/* ==========================================================================
   Chat — the assistant's cockpit.
   A dark, focused page: one centred conversation, a living orb, glass panels
   that slide in when asked for. The theme and the orb come from hud.css.
   ========================================================================== */

/* Private chat shifts the whole page to a warm hue, so the mode is never a thing
   to remember: it is the colour of the room. */
html.hud.private-chat[data-theme="dark"] {
  --paper: #0b0710;
  --paper-sunken: #140d18;
  --paper-raised: #1a1120;
  --accent: #ffb454;
  --accent-strong: #ffd193;
  --accent-wash: rgba(255, 180, 84, 0.16);
  --accent-two: #ff6f91;
  --accent-glow: rgba(255, 160, 90, 0.35);
  --rule: rgba(255, 185, 130, 0.14);
  --rule-strong: rgba(255, 185, 130, 0.28);
  --glass: rgba(34, 20, 38, 0.66);
  --glass-strong: rgba(22, 13, 26, 0.93);
}

body { overflow: hidden; }

.shell {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100vh;
  /* Mobile browsers count their collapsing toolbars out of dvh, so the composer
     stays on screen instead of sitting under the address bar. */
  height: 100dvh;
}

/* ------------------------------------------------------------------- top bar */

.app-nav {
  flex: none;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--paper) 60%, transparent);
  border-bottom: var(--rule-width) solid var(--rule);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.brand { gap: var(--space-3); margin-right: var(--space-4); }
.app-nav .brand-name,
.loading-text .brand-name {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.28em;
}

.nav-links { gap: var(--space-1); }
.nav-link {
  height: var(--control-h-sm);
  padding: 0 var(--space-3);
  border: var(--rule-width) solid transparent;
  border-radius: var(--radius-pill);
}
.nav-link:hover { background: var(--accent-wash); }
.nav-link.active {
  color: var(--accent);
  background: var(--accent-wash);
  border-color: var(--rule-strong);
}

.head-action { gap: var(--space-2); color: var(--ink-muted); border-color: transparent; }
#private-chat.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 16px var(--accent-wash);
}

.menu-toggle,
.activity-toggle { position: relative; }

/* A dot on the menu when mail is waiting inside it, and on the activity key
   while there is work to watch. */
.shell:has(#inbox-panel:not([hidden])) .menu-toggle::after,
html:not([data-core="idle"]) .activity-toggle::after {
  content: '';
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.app-nav [data-whoami] { margin-left: var(--space-2); }

.orb-card { --orb: 96px; margin: 0 auto var(--space-4); }

/* ------------------------------------------------------------------- drawers
   Both side columns are sheets at every width. */

.workspace { display: flex; flex: 1; min-height: 0; }

html.hud [data-drawer-panel] {
  position: fixed;
  top: var(--nav-height);
  bottom: 0;
  z-index: var(--z-tooltip);
  width: min(340px, 90vw);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--glass-strong);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  visibility: hidden;
  transition: transform var(--duration) var(--ease), visibility 0s linear var(--duration);
}
html.hud [data-drawer-panel][data-drawer-side="left"] {
  left: 0;
  border-right: var(--rule-width) solid var(--rule-strong);
  transform: translateX(-101%);
}
html.hud [data-drawer-panel][data-drawer-side="right"] {
  right: 0;
  border-left: var(--rule-width) solid var(--rule-strong);
  transform: translateX(101%);
}
html.hud [data-drawer-panel][data-drawer-side][data-open] {
  transform: none;
  visibility: visible;
  box-shadow: 0 0 60px rgba(0, 0, 0, 0.55);
  transition: transform var(--duration) var(--ease);
}

html.hud[data-drawer] .drawer-scrim {
  display: block;
  position: fixed;
  inset: var(--nav-height) 0 0;
  z-index: calc(var(--z-tooltip) - 1);
  background: rgba(2, 4, 10, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}

html.hud .drawer-toggle,
html.hud .drawer-close { display: inline-flex; }

html.hud .drawer-head {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  display: flex;
  justify-content: flex-end;
  flex: none;
  padding: var(--space-2) var(--space-3) 0;
  background: transparent;
}

.side > .panel { background: transparent; border-radius: 0; padding: var(--space-4); }
.panel-title { font-weight: var(--weight-semibold); color: var(--ink-muted); }

/* ------------------------------------------------------------ assistant card */

.assistant-card {
  flex: none;
  padding: var(--space-2) var(--space-5) var(--space-5);
  text-align: center;
  border-bottom: var(--rule-width) solid var(--rule);
}
.assistant-card h3 {
  margin: 0 0 var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  letter-spacing: 0.04em;
}
.assistant-card p {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  color: var(--ink-muted);
}
#graph-summary { margin-top: var(--space-3); }

/* --------------------------------------------------------------- graph list */

.graph-list { display: flex; flex-direction: column; }
.graph-group + .graph-group { margin-top: var(--space-4); }
.graph-group-label {
  padding: 0 var(--space-2) var(--space-1);
  font-size: var(--text-2xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.graph-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  font-size: var(--text-sm);
  color: var(--ink-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}
.graph-row:hover { color: var(--ink); background: var(--accent-wash); }
.graph-swatch { width: var(--mark-swatch); height: var(--mark-swatch); flex: none; border-radius: 50%; }
.graph-row .count { margin-left: auto; font-size: var(--text-2xs); color: var(--ink-faint); }
.graph-row.empty-graph { color: var(--ink-faint); }
.graph-row.empty-graph .graph-swatch { opacity: 0.4; }

/* ------------------------------------------------------------------ messages */

.chat-panel {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.chat-ready-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--paper);
}
.chat-ready-overlay .loading-content { gap: var(--space-6); }
.loading-status { font-family: var(--font-ui); }

/* A centred reading column, with the scrollbar left at the window's edge. A column
   flexbox so a short conversation sits on the composer. */
.transcript {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: var(--space-6) max(var(--space-4), calc((100% - var(--column)) / 2)) var(--space-3);
}
.transcript > :first-child { margin-top: auto; }

.turn {
  display: flex;
  flex: none;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  animation: turn-in 0.35s var(--ease) both;
}
@keyframes turn-in { from { opacity: 0; transform: translateY(8px); } }

.avatar {
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
}
/* The assistant wears the logo instead of initials. */
.avatar.ai {
  width: 32px;
  height: 32px;
  font-size: 0;
  background: #000 url("/static/img/logo-mark.png") center / cover no-repeat;
  box-shadow: 0 0 0 1px var(--rule-strong), 0 0 14px var(--accent-glow);
}
.avatar.me { display: none; }

.bubble { min-width: 0; flex: 1; }
.bubble .who {
  margin-bottom: var(--space-1);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  line-height: 28px;
}

.bubble .body {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--ink);
  overflow-wrap: break-word;
}
.bubble .body p { margin: 0 0 var(--space-3); }
.bubble .body p:last-child { margin-bottom: 0; }
.bubble .body ul, .bubble .body ol { margin: 0 0 var(--space-3); padding-left: var(--space-5); }
.bubble .body li { margin-bottom: var(--space-1); }
.bubble .body li::marker { color: var(--accent); }
.bubble .body code {
  padding: 1px var(--space-1);
  font-family: var(--font-mono);
  font-size: 0.86em;
  color: var(--accent-strong);
  background: var(--accent-wash);
  border-radius: var(--radius-sm);
}
.bubble .body pre {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  background: var(--glass-strong);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
}
.bubble .body pre code {
  background: none;
  padding: 0;
  color: var(--ink);
  font-size: var(--text-xs);
  line-height: var(--leading-prose);
}
.bubble .body strong { font-weight: var(--weight-semibold); color: #fff; }
.bubble .body a { color: var(--accent); word-break: break-word; }
.bubble .body a:hover { color: var(--accent-strong); }
.bubble .body .faint { color: var(--ink-faint); }

.bubble .body img.bubble-media {
  display: block;
  max-width: min(100%, 480px);
  height: auto;
  margin: var(--space-2) 0;
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sunken);
}
.bubble-embed-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  max-width: min(100%, 480px);
  margin: var(--space-2) 0;
}
.bubble-embed {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  height: auto;
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--paper-sunken);
}
.bubble-embed-link { font-size: var(--text-2xs); color: var(--ink-faint); }

/* Your own words: a glass bubble on the right. */
.turn.user { justify-content: flex-end; }
.turn.user .bubble {
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: flex-end;
  max-width: 82%;
}
.turn.user .who { display: none; }
.turn.user .bubble .body {
  /* The bubble shrinks to its text, so a pasted URL or token has to be allowed to
     break anywhere or it pushes the bubble off the left of a narrow screen. */
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: var(--space-3) var(--space-4);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--accent) 17%, transparent),
    color-mix(in srgb, var(--accent-two) 24%, transparent));
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius-lg) var(--radius-lg) var(--radius-sm) var(--radius-lg);
}

/* Speech still being recognised: shown at once, but not yet the final wording. */
.turn.provisional .bubble .body { color: var(--ink-faint); }

.turn.blocked .bubble .body {
  padding: var(--space-3) var(--space-4);
  background: color-mix(in srgb, var(--status-bad) 10%, transparent);
  border-left: 2px solid var(--status-bad);
  border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius-sm);
}

/* Activity tags inside a turn. */
.trace { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-bottom: var(--space-2); }
.trace .tag { font-size: var(--text-2xs); background: var(--glass); }
.trace .tag-accent { border-color: var(--rule-strong); }
.trace .tag-ok { border-color: color-mix(in srgb, var(--status-ok) 45%, transparent); }
.turn.user .trace { justify-content: flex-end; }

.cursor-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: caret 1s step-end infinite;
}
@keyframes caret { 50% { opacity: 0; } }

/* ------------------------------------------------------------------ thinking
   Shown until the first word arrives: three bouncing lights and what is going on. */
.thinking {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--rule);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, var(--accent-wash), transparent 80%);
}
.thinking-dots { display: flex; align-items: center; gap: 6px; height: 22px; }
.thinking-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent-glow);
  animation: think-bounce 1.2s ease-in-out infinite;
}
.thinking-dots i:nth-child(2) {
  background: color-mix(in srgb, var(--accent), var(--accent-two));
  animation-delay: 0.15s;
}
.thinking-dots i:nth-child(3) { background: var(--accent-two); animation-delay: 0.3s; }
.thinking-label {
  font-size: var(--text-sm);
  background: linear-gradient(90deg, var(--ink-faint) 35%, var(--ink) 50%, var(--ink-faint) 65%) 0 0 / 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: think-shimmer 2.2s linear infinite;
}
/* The logo glows in time while it thinks. */
.turn:has(.thinking) .avatar.ai { animation: think-glow 1.2s ease-in-out infinite; }

/* Jump, then squash a little on landing. */
@keyframes think-bounce {
  0%, 65%, 100% { transform: translateY(0) scale(0.85); opacity: 0.55; }
  30% { transform: translateY(-7px) scale(1.15); opacity: 1; }
  52% { transform: translateY(2px) scale(1.2, 0.75); opacity: 0.85; }
}
@keyframes think-shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
@keyframes think-glow {
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 0 2px var(--accent), 0 0 20px var(--accent-glow);
  }
}

#sound-toggle .sound-off,
#sound-toggle[aria-pressed="false"] .sound-on { display: none; }
#sound-toggle[aria-pressed="false"] .sound-off { display: inline; }
#sound-toggle[aria-pressed="false"] { color: var(--ink-faint); }

/* ------------------------------------------------------------------ composer */

.composer {
  flex: none;
  width: min(100%, calc(var(--column) + var(--space-8)));
  margin: 0 auto;
  padding: var(--space-2) var(--space-4) var(--space-2);
}
.composer-box {
  display: flex;
  align-items: flex-end;
  gap: var(--space-2);
  padding: var(--space-2);
  background: var(--glass);
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: 28px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.composer-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash), 0 0 34px var(--accent-wash);
}
.composer-box textarea {
  flex: 1;
  min-width: 0;
  min-height: 40px;
  max-height: 180px;
  padding: 8px var(--space-3);
  font-size: var(--text-md);
  line-height: 24px;
  background: none;
  border: none;
  border-radius: 0;
  resize: none;
}
.composer-box textarea:focus,
.composer-box textarea:focus-visible { outline: none; border: none; }

.send-btn,
.mic-btn { width: 40px; height: 40px; padding: 0; flex: none; border-radius: 50%; }
.send-btn.btn-primary {
  color: var(--ink-inverse);
  background: linear-gradient(135deg, var(--accent), var(--accent-two));
  border: none;
  box-shadow: 0 0 18px var(--accent-glow);
}
.send-btn.btn-primary:hover { background: linear-gradient(135deg, var(--accent-strong), var(--accent-two)); }
.send-btn.btn-primary:disabled {
  color: var(--ink-faint);
  background: var(--paper-raised);
  box-shadow: none;
}
.mic-btn.active {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
  box-shadow: 0 0 18px var(--accent-glow);
}

.composer-foot {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 22px;
  margin-top: var(--space-1);
  padding: 0 var(--space-4);
  font-size: var(--text-2xs);
  color: var(--ink-faint);
}
#status-line { color: var(--accent); }
.credit { margin-left: auto; }

/* ---------------------------------------------------------------- live voice */

.live-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
  padding: var(--space-1) var(--space-2) var(--space-1) var(--space-4);
  font-size: var(--text-xs);
  color: var(--ink-muted);
  background: var(--glass);
  border: var(--rule-width) solid var(--rule-strong);
  border-radius: var(--radius-pill);
}
.live-mark { width: 9px; height: 9px; flex: none; border-radius: 50%; background: var(--status-idle); }
.live-bar[data-state="listening"] .live-mark { background: var(--status-ok); box-shadow: 0 0 10px var(--status-ok); }
.live-bar[data-state="thinking"] .live-mark,
.live-bar[data-state="working"] .live-mark,
.live-bar[data-state="reconnecting"] .live-mark { background: var(--status-warn); box-shadow: 0 0 10px var(--status-warn); }
.live-bar[data-state="speaking"] .live-mark { background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.live-state { flex: none; color: var(--ink); }

/* The words being said right now, trimmed to the tail by the caller. */
.live-caption {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--ink-faint);
}
.live-bar .btn.active { color: var(--accent); }

/* -------------------------------------------------------------- empty state */

.welcome {
  width: 100%;
  margin: auto 0;
  padding: var(--space-4) 0;
  text-align: center;
}
.welcome .orb { --orb: clamp(110px, 22vh, 180px); margin: 0 auto var(--space-6); }
.welcome h2 {
  margin: 0 0 var(--space-2);
  font-family: var(--font-display);
  font-size: clamp(24px, 4.2vw, 36px);
  font-weight: var(--weight-semibold);
  background: linear-gradient(100deg, #fff 20%, var(--accent) 65%, var(--accent-two));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.welcome p {
  max-width: 46ch;
  margin: 0 auto var(--space-8);
  font-size: var(--text-md);
  line-height: var(--leading-prose);
  color: var(--ink-muted);
}
.starters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  text-align: left;
}
.starter {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  overflow-wrap: anywhere;
  font: inherit;
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  text-align: left;
  color: var(--ink-muted);
  background: var(--glass);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color var(--duration) var(--ease), border-color var(--duration) var(--ease),
    transform var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.starter:hover {
  color: var(--ink);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px var(--accent-wash);
}
.starter b {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
  color: var(--accent);
}

/* ----------------------------------------------------------------- inbox */

.inbox-card {
  padding: var(--space-3);
  margin-bottom: var(--space-2);
  background: var(--glass);
  border: var(--rule-width) solid var(--rule);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm) var(--radius) var(--radius) var(--radius-sm);
}
.inbox-card .from { margin-bottom: var(--space-1); font-size: var(--text-2xs); color: var(--ink-faint); }
.inbox-card .body-text { font-size: var(--text-sm); line-height: var(--leading-prose); }

.presence-line {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-2xs);
  color: var(--ink-muted);
  background: var(--glass);
  border-radius: var(--radius-sm);
}
.presence-line.offline { color: var(--ink-faint); }
.presence-line .hint { margin-left: auto; color: var(--ink-faint); }

/* --------------------------------------------------------- compose sidebar */

.compose-panel { flex: none; display: flex; flex-direction: column; }
/* The search box narrows the list below it, so the two read as one control. */
.compose-to input[type='search'] { margin-bottom: var(--space-2); }
#msg-match { margin: calc(-1 * var(--space-2)) 0 var(--space-3); }
.compose-panel .field-grow { display: flex; flex-direction: column; margin-bottom: var(--space-3); }
.compose-panel .field-grow textarea { min-height: var(--space-16); padding: var(--space-2) var(--space-3); resize: none; }
.compose-panel input, .compose-panel select { padding: var(--space-1) var(--space-3); }

/* -------------------------------------------------------------- activity log */

.activity { display: flex; flex-direction: column; gap: var(--space-2); overflow-y: auto; }
.activity > .empty { padding: var(--space-1) 0 0; }
.event {
  display: flex;
  flex: none;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3);
  font-size: var(--text-xs);
  background: var(--glass);
  border: var(--rule-width) solid var(--rule);
  border-radius: var(--radius);
}
.event .icon { flex: none; display: flex; align-items: center; height: calc(var(--text-xs) * var(--leading-snug)); }
.event.tool .mark { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.event .what { min-width: 0; }
.event .what b { display: block; font-weight: var(--weight-medium); color: var(--ink); }
.event .what span { color: var(--ink-faint); overflow-wrap: anywhere; }

/* -------------------------------------------------------------------- toasts */

#toasts { top: calc(var(--nav-height) + var(--space-3)); bottom: auto; }

/* ---------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  /* Model name, account and button wording are desk-side detail. */
  #llm-chip,
  .app-nav [data-whoami],
  .head-action .label { display: none; }
  .head-action { width: var(--control-h-sm); padding: 0; }
  .brand { margin-right: var(--space-1); }
}

@media (max-width: 640px) {
  .app-nav { gap: var(--space-1); padding: 0 var(--space-2); }
  .app-nav .brand-name,
  .nav-link[data-page="chat"] { display: none; }
  .nav-link { padding: 0 var(--space-2); }

  .transcript { padding-top: var(--space-4); }
  .turn { gap: var(--space-2); margin-bottom: var(--space-5); }
  .turn.user .bubble { max-width: 90%; }

  .composer { padding: var(--space-2) var(--space-2) var(--space-1); }
  .composer-box textarea { font-size: 16px; }
  /* There is no Shift+Enter on a touch keyboard. */
  .kbd-hint { display: none; }
  .live-bar { flex-wrap: wrap; border-radius: var(--radius); }
  .live-caption { flex-basis: 100%; }

  .welcome .orb { --orb: 104px; margin-bottom: var(--space-4); }
  .welcome p { margin-bottom: var(--space-5); font-size: var(--text-sm); }
  .starters { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
  .starter { padding: var(--space-2) var(--space-3); }
  .starter .prompt {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
  }
}

/* A short window gives the orb's room to the conversation starters. */
@media (max-height: 640px) {
  .welcome .orb { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .turn, .cursor-caret, .thinking-dots i, .thinking-label,
  .turn:has(.thinking) .avatar.ai { animation: none !important; }
  .thinking-label { color: var(--ink-muted); }
  .starter:hover { transform: none; }
}

/* Room for four page links beside the chat's own header buttons. */
@media (max-width: 400px) {
  .app-nav { gap: 0; }
  .nav-link { padding: 0 var(--space-1); }
}
