/* Public company guide · Streaming Reply visual language:
   cream ground, glass header pill, word-by-word ink, signal-green user bubbles. */
#nexa-window,
#nexa-root {
  --nx-ink: #141714;
  --nx-soft: #5f665f;
  --nx-line: #e7e7df;
  --nx-ground: #fbfaf6;
  --nx-paper: #ffffff;
  --nx-green: #15803d;
  --nx-green-dark: #0f5f2e;
  --nx-user: #ccefd8;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  box-sizing: border-box;
}
#nexa-window *,
#nexa-root * { box-sizing: border-box; }

#nexa-window {
  position: fixed;
  right: 20px;
  bottom: 88px;
  width: min(430px, calc(100vw - 24px));
  height: min(660px, calc(100dvh - 112px));
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: var(--nx-ground);
  color: var(--nx-ink);
  border: 1px solid var(--nx-line);
  border-radius: 26px;
  box-shadow: 0 30px 90px rgba(18, 30, 22, .18);
  overflow: hidden;
  font-size: 14px;
  line-height: 1.55;
}
#nexa-window[hidden] { display: none; }
#nexa-window button,
#nexa-window input { font: inherit; }

.nexa-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  background: color-mix(in srgb, var(--nx-ground) 82%, transparent);
  border-bottom: 1px solid var(--nx-line);
  backdrop-filter: blur(18px);
}
.nexa-header strong { display: block; font-size: 16px; font-weight: 720; letter-spacing: -.02em; color: var(--nx-ink); }
.nexa-header small { display: block; font-size: 10px; color: var(--nx-soft); letter-spacing: .02em; }
#nexa-close-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: rgba(255, 255, 255, .7);
  color: var(--nx-soft);
  border: 1px solid var(--nx-line);
  border-radius: 50%;
  font-size: 20px !important;
  line-height: 1;
  cursor: pointer;
}
#nexa-close-btn:hover { color: var(--nx-ink); background: #fff; }

#nexa-messages {
  flex: 1;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 22px 18px 8px;
  display: flex;
  flex-direction: column;
  gap: 22px;
  scrollbar-width: thin;
}

.nexa-msg { display: flex; flex-direction: column; gap: 10px; }
.nexa-msg.is-user { align-items: flex-end; }
.nexa-msg.is-assistant { align-items: flex-start; }

.nexa-msg-head {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 6px;
  border: 1px solid rgba(20, 23, 20, .08);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9) inset, 0 6px 18px rgba(20, 23, 20, .06);
  backdrop-filter: blur(20px) saturate(1.1);
}
.nexa-mark {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #1b1e1b;
  color: #fff;
  font-size: 14px;
  flex: none;
}
.nexa-msg-head strong { font-size: 14px; font-weight: 660; letter-spacing: -.015em; }
.nexa-phase {
  min-width: 48px;
  font-size: 9.5px;
  font-weight: 750;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: #8a8f88;
}
.nexa-msg[data-phase="thinking"] .nexa-phase { color: var(--nx-green); animation: nexa-breathe 1.4s ease-in-out infinite; }
.nexa-msg[data-phase="writing"] .nexa-phase { color: var(--nx-green); }
.nexa-msg[data-phase="stopped"] .nexa-phase { color: #b42318; }
.nexa-msg[data-phase="done"] .nexa-phase { color: #8a8f88; }

.nexa-reply {
  padding: 0 3px;
  font-size: 15.5px;
  line-height: 1.68;
  font-weight: 540;
  letter-spacing: -.012em;
  color: var(--nx-ink);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.nexa-word { opacity: 0; transform: translateY(2px); transition: opacity .34s ease, transform .46s cubic-bezier(.22, .7, .3, 1); }
.nexa-word.is-in { opacity: 1; transform: none; }

.nexa-bubble {
  max-width: 86%;
  padding: 12px 16px;
  border-radius: 18px 18px 5px 18px;
  background: var(--nx-user);
  border: 1px solid color-mix(in srgb, var(--nx-green) 16%, transparent);
  color: #102418;
  font-size: 14.5px;
  line-height: 1.5;
  font-weight: 560;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.nexa-reply-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 2px;
  opacity: .62;
  transition: opacity .15s ease;
}
.nexa-msg:hover .nexa-reply-actions,
.nexa-msg:focus-within .nexa-reply-actions { opacity: 1; }
.nexa-reply-actions button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  color: var(--nx-soft);
  font-size: 10.5px;
  font-weight: 650;
  cursor: pointer;
  backdrop-filter: blur(12px);
}
.nexa-reply-actions button:hover { color: var(--nx-ink); background: #fff; }
.nexa-reply-actions i { font-style: normal; font-size: 12px; }
.nexa-copied { font-size: 10.5px; color: var(--nx-green); font-weight: 650; margin-left: 2px; }

.nexa-typing { display: inline-flex; gap: 4px; padding: 5px 0; }
.nexa-typing i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nx-green);
  animation: nexa-dot 1.1s ease-in-out infinite;
}
.nexa-typing i:nth-child(2) { animation-delay: .14s; }
.nexa-typing i:nth-child(3) { animation-delay: .28s; }

.nexa-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -8px; }
.nexa-actions a,
#nexa-chips button {
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  color: var(--nx-green-dark);
  background: rgba(255, 255, 255, .78);
  text-decoration: none;
  padding: 7px 11px;
  font-size: 11px;
  font-weight: 620;
  cursor: pointer;
}
.nexa-actions a:hover,
#nexa-chips button:hover { background: #fff; border-color: #cfe2d6; }

#nexa-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px; }
#nexa-status { margin: 0; padding: 0 18px 10px; color: var(--nx-soft); font-size: 10px; }
#nexa-form {
  display: flex;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--nx-line);
  background: color-mix(in srgb, var(--nx-ground) 86%, transparent);
  backdrop-filter: blur(16px);
}
#nexa-input {
  min-width: 0;
  flex: 1;
  border: 1px solid var(--nx-line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--nx-ink);
  background: rgba(255, 255, 255, .88);
  outline: none;
}
#nexa-input:focus { border-color: #b9d9c4; box-shadow: 0 0 0 3px rgba(21, 128, 61, .1); }
#nexa-send {
  background: var(--nx-green);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 8px 15px;
  cursor: pointer;
  font-weight: 650;
}
#nexa-send:hover { background: var(--nx-green-dark); }
#nexa-window button:disabled { opacity: .5; cursor: default; }
.nexa-footer { display: flex; justify-content: space-between; gap: 8px; padding: 0 16px 12px; font-size: 10px; }
.nexa-footer a, .nexa-footer button { color: var(--nx-soft); text-decoration: underline; }
.nexa-footer button { background: none; border: 0; cursor: pointer; font-size: 10px !important; }

#nexa-root {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid rgba(20, 23, 20, .1);
  border-radius: 999px;
  background: #fff;
  color: var(--nx-ink);
  padding: 12px 18px 12px 13px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: -.01em;
  box-shadow: 0 10px 32px rgba(18, 30, 22, .16);
  cursor: pointer;
}
#nexa-root span {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  margin: 0;
  border-radius: 50%;
  background: #1b1e1b;
  color: #fff;
  font-size: 12px;
}
#nexa-root:hover { box-shadow: 0 12px 38px rgba(18, 30, 22, .22); }

#nexa-window :focus-visible,
#nexa-root:focus-visible { outline: 2px solid var(--nx-green); outline-offset: 3px; }
.nexa-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@keyframes nexa-dot {
  0%, 60%, 100% { opacity: .28; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}
@keyframes nexa-breathe { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

@media (max-width: 440px) {
  #nexa-window { right: 12px; bottom: 80px; border-radius: 22px; }
  #nexa-root { right: 12px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .nexa-word { transition: opacity .18s linear; transform: none; }
  .nexa-typing i { animation: none; opacity: .75; }
  .nexa-msg[data-phase="thinking"] .nexa-phase { animation: none; }
}
