/* Atlas brand, taken from the Atlas home page on lynks.ba (lynks-site/src/index.css):
   navy + cyan, one family (Sora), sentence case, left aligned. Cyan marks only what you can
   act on and your own question; gold marks only an answer without a source.

   WCAG AAA, computed against the real backgrounds (navy, navy-2, navy-3), not eyeballed:
   every text colour is >= 7:1 (mist 12.6+, slate 7.4+, cyan 7.2+, gold 7.5+, danger 7.3+),
   field and control borders are >= 3:1 (--field-line 3.1+), every target is >= 44x44 px
   except citation numbers inside a sentence. Change a value, re-check it before shipping. */

/* Sora, self-hosted like on the website (no request to Google). One variable file per
   subset carries weights 300-600; latin-ext carries č, ć, ž, š, đ. */
@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(/fonts/sora-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "Sora";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url(/fonts/sora-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: dark;

  --navy: #0b131b;
  --navy-2: #13202c;
  --navy-3: #1a2a38;
  --navy-line: #22364a;    /* decorative dividers only */
  --field-line: #5b7690;   /* borders that identify a control: >= 3:1 */
  --mist: #e9eef2;
  --slate: #aabbc8;        /* the site's #9DB0BF, lifted to reach 7:1 on navy-3 */
  --cyan: #29c4f2;
  --gold: #dcb563;         /* the site's #D2A94E, lifted to reach 7:1 on navy-3 */
  --danger: #f4a197;
  --ok: #3ddc97;           /* the site's "online" dot; never used for text */
  --font-atlas: "Sora", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --shadow-window: 0 40px 80px -40px rgb(0 0 0 / 0.8);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: var(--font-atlas);
  font-size: 16px;
  background: var(--navy);
  color: var(--mist);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--cyan);
  color: var(--navy);
}

.hidden {
  display: none !important;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.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;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: 10px;
  background: var(--cyan);
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 16px;
}

/* The lockup from the site's nav: mark + name. */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--mist);
  text-decoration: none;
}

.brand img {
  height: 24px;
  width: auto;
}

/* ---------- Shared controls ---------- */

.btn-solid {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border: none;
  border-radius: 10px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 15px;
  font-weight: 600;
  padding: 0 24px;
  transition: background-color 0.25s ease;
}

.btn-solid:hover {
  background: var(--mist);
}

.btn-solid:disabled {
  background: var(--navy-3);
  color: var(--slate);
  cursor: progress;
}

.btn-block {
  width: 100%;
}

/* Secondary actions: text you can read at a glance, an outline you can find. */
.link-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  background: transparent;
  color: var(--mist);
  border: 1px solid var(--field-line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  padding: 0 16px;
  text-decoration: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.link-btn:hover {
  border-color: var(--mist);
  background: var(--navy-3);
}

.link-btn:disabled {
  color: var(--slate);
  cursor: progress;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--mist);
}

.icon-btn:hover {
  background: var(--navy-3);
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--mist);
}

.field input,
.field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  font-size: 16px;
  background: var(--navy);
  color: var(--mist);
  transition: border-color 0.15s ease;
}

.field input:hover,
.field select:hover {
  border-color: var(--slate);
}

.field input:focus-visible,
.field select:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 0;
  border-color: var(--cyan);
}

.error-box {
  border: 1px solid var(--danger);
  border-radius: 10px;
  color: var(--danger);
  background: var(--navy);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 18px;
}

/* ---------- Login ---------- */

.login {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr auto;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  overflow-x: clip;
}

.topbar {
  display: flex;
  align-items: center;
  height: 76px;
}

.login-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  align-items: center;
  gap: clamp(48px, 8vw, 120px);
  padding: 32px 0 64px;
}

/* Sizes from the site's hero: --e is the emblem's width. */
.login-hero {
  --e: clamp(10rem, 24vw, 14rem);
}

/* Shifted left so the mark, not the rings, lines up with the text; the page clips the rings. */
.emblem {
  position: relative;
  width: var(--e);
  height: var(--e);
  transform: translateX(-33%);
}

.bearing {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  color: var(--cyan);
  /* The lower half fades out before the headline so no line crosses the letters. */
  -webkit-mask-image: linear-gradient(to bottom, #000 52%, transparent 72%);
  mask-image: linear-gradient(to bottom, #000 52%, transparent 72%);
}

/* The star's centre sits 67% down the mark, so that point goes on the crosshair. */
.emblem-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 34%;
  height: auto;
  transform: translate(-50%, -67%);
}

.login-title {
  margin: calc(var(--e) * -0.3) 0 0;
  font-size: clamp(3.5rem, 6vw, 5.25rem);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.03em;
  color: var(--mist);
}

.login-lede {
  margin: 28px 0 0;
  max-width: 34rem;
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.65;
  color: var(--slate);
  text-wrap: balance;
}

/* The site's chat window, holding the form. */
.window {
  background: var(--navy-2);
  border: 1px solid var(--navy-line);
  border-radius: 16px;
  box-shadow: var(--shadow-window);
  overflow: hidden;
}

.window-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--navy-line);
}

.avatar {
  display: block;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
  background: var(--navy) url(/atlas/mark.png) center / 19px auto no-repeat;
}

.window-name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  color: var(--mist);
}

.window-title {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: var(--slate);
}

.window-body {
  padding: 24px 20px 20px;
}

.window-body .btn-solid {
  margin-top: 6px;
}

.window-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 14px 20px;
  border-top: 1px solid var(--navy-line);
  font-size: 14px;
  color: var(--slate);
}

/* The own password (spec 01 D5, D6): the login's window alone, centred. */
.password-main {
  display: grid;
  grid-template-columns: minmax(0, 26rem);
  justify-content: center;
  align-content: start;
  padding: 32px 0 64px;
}

.password-lede {
  margin: 0 0 18px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--mist);
}

.field-hint {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--slate);
}

.password-back {
  margin-top: 10px;
}

.login-footer {
  display: flex;
  align-items: center;
  min-height: 72px;
  border-top: 1px solid var(--navy-line);
  font-size: 14px;
  color: var(--slate);
}

.login-footer p {
  margin: 0;
}

@media (max-width: 860px) {
  .topbar {
    height: 64px;
  }
  .login-main {
    grid-template-columns: 1fr;
    align-content: start;
    gap: 40px;
    padding-top: 8px;
  }
  .login-hero {
    --e: clamp(8.5rem, 38vw, 11rem);
  }
  .login-title {
    font-size: clamp(2.75rem, 12vw, 4rem);
  }
}

/* ---------- App shell: sidebar + chat ---------- */

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
}

.sidebar {
  width: 288px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--navy-line);
  padding: 12px 14px 14px;
}

.sidebar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 6px 14px;
}

.sidebar-toggle {
  display: none;
}

.sidebar-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: transparent;
  color: var(--mist);
  font-size: 15px;
  font-weight: 500;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.new-chat-btn svg {
  color: var(--cyan);
}

.new-chat-btn:hover {
  border-color: var(--mist);
  background: var(--navy-3);
}

.sidebar-search {
  position: relative;
  margin-top: 10px;
}

.sidebar-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate);
  pointer-events: none;
}

.sidebar-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px 0 38px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--navy);
  color: var(--mist);
  font-size: 15px;
}

.sidebar-search input::placeholder {
  color: var(--slate);
  opacity: 1;
}

.sidebar-search input:focus-visible {
  outline-offset: 0;
  border-color: var(--cyan);
}

.sidebar-label {
  margin: 22px 6px 6px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate);
}

.conversation-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 -4px;
  padding: 2px 4px;
}

.conv-item {
  position: relative;
  display: flex;
  align-items: center;
  border-radius: 10px;
}

.conv-item:hover,
.conv-item.active {
  background: var(--navy-3);
}

/* The open conversation. A mist line, not cyan: it is a state, not an action. */
.conv-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 2px;
  border-radius: 2px;
  background: var(--mist);
}

.conv-open {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 8px 0 12px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--mist);
  font-size: 14px;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conv-item.active .conv-open {
  font-weight: 500;
}

/* Delete takes two clicks: the first turns the cross into "Obriši", the second deletes. */
.conv-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--slate);
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
}

.conv-item:hover .conv-delete,
.conv-item:focus-within .conv-delete,
.conv-delete.confirm {
  opacity: 1;
}

.conv-delete:hover {
  color: var(--mist);
}

.conv-delete.confirm {
  color: var(--danger);
}

.conv-empty {
  margin: 0;
  padding: 10px 6px;
  font-size: 14px;
  color: var(--slate);
}

.sidebar-foot {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--navy-line);
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--mist);
  font-size: 14px;
  text-decoration: none;
}

button.side-link {
  width: 100%;
  background: none;
  border: 0;
  font: inherit;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
}

.side-link svg {
  color: var(--slate);
}

.side-link:hover {
  background: var(--navy-3);
}

.sidebar-user {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-left: 12px;
  font-size: 14px;
}

.user-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  color: var(--mist);
}

/* ---------- Chat main ---------- */

.chat-main {
  flex: 1;
  min-width: 0;
  min-height: 0; /* on a phone the shell is a column; without this the answers push the composer off screen */
  display: flex;
  flex-direction: column;
}

.chat-scroll {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* The start of a conversation: left aligned in the same column the answers will use. */
.empty-state {
  width: 100%;
  max-width: 760px;
  margin: auto;
  padding: 48px 32px;
}

.empty-state h2 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.875rem, 3.2vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.025em;
  color: var(--mist);
  text-wrap: balance;
}

.empty-lede {
  margin: 16px 0 0;
  max-width: 34rem;
  font-size: 17px;
  line-height: 1.6;
  color: var(--slate);
}

.access {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 0;
  font-size: 15px;
  color: var(--mist);
}

.access svg {
  flex-shrink: 0;
  color: var(--slate);
}

.suggest-label {
  margin: 40px 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
}

.suggestions {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--navy-line);
}

/* A row per question with the site's send arrow: clicking asks it. */
.suggestion-chip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 60px;
  padding: 12px 4px 12px 0;
  border: none;
  border-bottom: 1px solid var(--navy-line);
  background: none;
  color: var(--mist);
  font-size: 16px;
  line-height: 1.5;
  text-align: left;
}

.suggestion-chip .send-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--navy-3);
  color: var(--mist);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.suggestion-chip:hover .send-mark,
.suggestion-chip:focus-visible .send-mark {
  background: var(--cyan);
  color: var(--navy);
}

.thread {
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
  padding: 40px 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.turn {
  animation: rise 0.2s ease;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Your question: the cyan bubble from the site's chat. */
.turn-user {
  display: flex;
  justify-content: flex-end;
}

.turn-user .turn-bubble {
  max-width: min(80%, 36rem);
  padding: 12px 18px;
  border-radius: 18px 18px 6px 18px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 16px;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* Atlas's answer, with the mark as its avatar like on the site. The text stays unboxed:
   real answers run long and read better as plain text than inside a bubble. */
.turn-assistant {
  position: relative;
  min-height: 36px;
  padding-left: 52px;
  max-width: calc(68ch + 52px);
  font-size: 16px;
  line-height: 1.7;
  color: var(--mist);
  white-space: pre-wrap;
}

.turn-assistant::before {
  content: "";
  position: absolute;
  left: 0;
  top: -2px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--navy-line);
  background: var(--navy-2) url(/atlas/mark.png) center / 19px auto no-repeat;
}

/* No source found: gold, the only place gold is used. */
.turn-assistant.refused {
  color: var(--gold);
}

/* A failure (service unavailable, answer cut off): not a refusal, so not gold. */
.turn-assistant.failed {
  color: var(--slate);
  font-style: italic;
}

.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5em;
  height: 1.5em;
  margin: 0 2px;
  padding: 0 4px;
  border: 1px solid var(--cyan);
  border-radius: 6px;
  background: transparent;
  color: var(--cyan);
  font-size: 0.75em;
  font-weight: 600;
  line-height: 1;
  vertical-align: 0.2em;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.cite:hover {
  background: var(--cyan);
  color: var(--navy);
}

/* Sources: the site's attached-file card, numbered to match the marks in the text. */
.refs-label {
  margin: 20px 0 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  white-space: normal;
}

.refs {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  white-space: normal;
}

.ref-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 60px;
  padding: 10px 14px 10px 10px;
  border: 1px solid var(--navy-line);
  border-radius: 12px;
  background: var(--navy-2);
  color: var(--mist);
  text-align: left;
  transition: border-color 0.15s ease;
}

.ref-toggle:hover,
.ref-toggle[aria-expanded="true"] {
  border-color: var(--field-line);
}

.ref-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--navy);
  color: var(--cyan);
  font-size: 15px;
  font-weight: 600;
}

.ref-text {
  flex: 1;
  min-width: 0;
  line-height: 1.4;
}

.ref-name {
  display: block;
  font-size: 15px;
  font-weight: 500;
  color: var(--mist);
  overflow-wrap: anywhere;
}

.ref-loc {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  color: var(--slate);
}

.ref-chev {
  flex-shrink: 0;
  color: var(--slate);
  transition: transform 0.2s ease;
}

.ref-toggle[aria-expanded="true"] .ref-chev {
  transform: rotate(180deg);
}

.ref-toggle.flash {
  animation: flash-ref 0.9s ease;
}

@keyframes flash-ref {
  0%, 100% { border-color: var(--navy-line); }
  30% { border-color: var(--cyan); }
}

.ref-detail {
  display: none;
  margin: 6px 0 4px;
  padding: 16px 18px;
  max-height: 22rem;
  overflow-y: auto;
  border-left: 2px solid var(--cyan);
  border-radius: 0 12px 12px 0;
  background: var(--navy-2);
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--mist);
  white-space: normal;
  position: relative; /* offsetTop of the cited sentence is measured from here */
}

.ref-detail.open {
  display: block;
}

.ref-para {
  margin: 0 0 10px;
}

.ref-lead {
  font-weight: 600;
}

/* The cited sentence is the proof, the rest is context: quieter text around a lit sentence.
   Neither cyan (clickable) nor gold (answer without a source). */
.ref-detail.has-quote {
  color: var(--slate);
}

.ref-quote {
  padding: 2px 4px;
  border-radius: 4px;
  background: var(--navy-line);
  color: var(--mist);
  font-weight: 600;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.ref-path {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--slate);
}

.ref-open {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.ref-open:hover {
  color: var(--mist);
}

.feedback {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin-top: 14px;
  font-size: 14px;
  color: var(--slate);
  white-space: normal;
}

.fb-q {
  margin-right: 6px;
}

.fb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: none;
  color: var(--slate);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.fb-btn:hover {
  background: var(--navy-3);
  color: var(--mist);
}

.fb-btn.active {
  color: var(--cyan);
  border-color: var(--cyan);
}

.fb-note {
  margin-left: 8px;
}

.fb-reason {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-top: 8px;
}

.fb-reason-input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--field-line);
  border-radius: 10px;
  background: var(--navy);
  color: var(--mist);
  font-size: 15px;
}

.fb-reason-input::placeholder {
  color: var(--slate);
  opacity: 1;
}

.fb-reason-input:focus-visible {
  outline-offset: 0;
  border-color: var(--cyan);
}

.fb-send {
  min-height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: var(--cyan);
  color: var(--navy);
  font-size: 14px;
  font-weight: 600;
  transition: background-color 0.25s ease;
}

.fb-send:hover {
  background: var(--mist);
}

.typing-line {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
}

.typing-line .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--slate);
  animation: pulse 1s infinite ease-in-out;
}

.typing-line .dot:nth-child(2) { animation-delay: 0.18s; }
.typing-line .dot:nth-child(3) { animation-delay: 0.36s; }

.typing-status {
  margin-left: 10px;
  font-size: 14px;
  color: var(--slate);
}

@keyframes pulse {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 1; }
}

/* ---------- Composer: the site's message box ---------- */

.composer-wrap {
  flex-shrink: 0;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 32px;
}

.composer {
  display: flex;
  align-items: flex-end; /* the send button stays on the last line while the question grows */
  gap: 10px;
  padding: 6px 6px 6px 18px;
  border: 1px solid var(--field-line);
  border-radius: 14px;
  background: var(--navy-2);
  transition: border-color 0.15s ease;
}

.composer:focus-within {
  border-color: var(--cyan);
}

.composer textarea {
  flex: 1;
  display: block;
  min-width: 0;
  min-height: 44px;
  /* about 6 lines (24px each plus the padding), then it scrolls inside; app.js sets the height in between */
  max-height: 164px;
  margin: 0;
  padding: 10px 0;
  border: none;
  background: transparent;
  color: var(--mist);
  font-size: 16px; /* 16px or more, so iPhone Safari does not zoom in on focus */
  line-height: 24px;
  resize: none;
  overflow-y: hidden;
  overflow-wrap: anywhere; /* a long word or link wraps to the next line too, never sideways */
}

.composer textarea::placeholder {
  color: var(--slate);
  opacity: 1;
}

/* The box's cyan border already shows focus. */
.composer textarea:focus-visible {
  outline: none;
}

.composer button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: none;
  border-radius: 10px;
  background: var(--cyan);
  color: var(--navy);
  transition: background-color 0.25s ease;
}

.composer button:hover {
  background: var(--mist);
}

.composer button:disabled {
  background: var(--navy-3);
  color: var(--slate);
  cursor: progress;
}

.composer-hint {
  margin: 10px 0 18px;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  color: var(--slate);
}

/* ---------- Phone ---------- */

@media (max-width: 760px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    flex-shrink: 0;
    padding: 6px 12px;
    border-right: none;
    border-bottom: 1px solid var(--navy-line);
  }
  .sidebar-top {
    padding: 0 0 0 4px;
  }
  .sidebar-toggle {
    display: inline-flex;
  }
  /* The conversation list opens under the bar instead of taking half the screen. */
  .sidebar-panel {
    display: none;
    max-height: 70dvh;
    padding: 8px 0 10px;
  }
  .sidebar.open .sidebar-panel {
    display: flex;
  }
  .empty-state {
    margin: 0;
    padding: 32px 20px;
  }
  .thread {
    padding: 24px 16px 16px;
  }
  .turn-assistant {
    padding-left: 0;
    padding-top: 44px;
  }
  .composer-wrap {
    padding: 0 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before {
    animation: none !important;
    transition: none !important;
  }
}
