/* ============================================================
   COALITION ASSISTANT — atmosphere pass
   Photographic background · floating glass pill · dark glass UI
   ============================================================ */

/* ── 01. Font loading (Metropolis, self-hosted) ─────────────── */
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Thin.otf") format("opentype"); font-weight: 100; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-ThinItalic.otf") format("opentype"); font-weight: 100; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-ExtraLight.otf") format("opentype"); font-weight: 200; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-ExtraLightItalic.otf") format("opentype"); font-weight: 200; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Light.otf") format("opentype"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-LightItalic.otf") format("opentype"); font-weight: 300; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Regular.otf") format("opentype"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-RegularItalic.otf") format("opentype"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Medium.otf") format("opentype"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-MediumItalic.otf") format("opentype"); font-weight: 500; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-SemiBold.otf") format("opentype"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-SemiBoldItalic.otf") format("opentype"); font-weight: 600; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Bold.otf") format("opentype"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-BoldItalic.otf") format("opentype"); font-weight: 700; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-ExtraBold.otf") format("opentype"); font-weight: 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-ExtraBoldItalic.otf") format("opentype"); font-weight: 800; font-style: italic; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-Black.otf") format("opentype"); font-weight: 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Metropolis"; src: url("assets/fonts/Metropolis-BlackItalic.otf") format("opentype"); font-weight: 900; font-style: italic; font-display: swap; }

/* ── 02. Tokens ─────────────────────────────────────────────── */
:root {
  --orange: #fea44b;
  --orange-deep: #f09730;
  --white: #ffffff;
  --off-white: #f5f6f7;
  --grey-dark: #545454;
  --black: #1a1a1a;

  --font: "Metropolis", "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --t-base: 250ms var(--ease);
  --t-fast: 150ms var(--ease-out);

  --container: 760px;
  --pad: 24px;

  /* Text-on-glass hierarchy */
  --ink: rgba(255, 255, 255, 0.96);
  --ink-soft: rgba(255, 255, 255, 0.75);
  --ink-faint: rgba(255, 255, 255, 0.55);
  --hairline: rgba(255, 255, 255, 0.25);
  --hairline-bright: rgba(255, 255, 255, 0.45);
}

/* ── 03. Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
/* min-height, not height — a fixed body height clamps scrollHeight and
   breaks bottom-pinning once the thread grows past one viewport. */
html, body { min-height: 100%; overflow-x: hidden; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

/* ── 04. Photographic background ───────────────────────────── */
body {
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  color: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;

  /* Slightly stronger mid + base than the first pass — keeps 4.5:1-ish
     contrast for secondary text over the brightest parts of the photo. */
  background-image:
    linear-gradient(
      180deg,
      rgba(15, 15, 18, 0.72) 0%,
      rgba(15, 15, 18, 0.56) 50%,
      rgba(15, 15, 18, 0.86) 100%
    ),
    url("./assets/no-more-waiting-background.jpg");
  background-size: cover;
  background-position: center center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

button { font-family: inherit; cursor: pointer; }

/* Keyboard focus — orange hairline everywhere, never the default blue */
:focus { outline: none; }
:focus-visible {
  outline: 1px solid rgba(254, 164, 75, 0.9);
  outline-offset: 2px;
  border-radius: 4px;
}
.pill:focus-visible,
.composer__send:focus-visible,
.copy-chip:focus-visible,
.new-reply:focus-visible {
  outline: 1px solid rgba(254, 164, 75, 0.9);
  outline-offset: 3px;
}

/* ── 05. Floating glass pill nav ───────────────────────────── */
.site-header {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  width: calc(100% - 48px);
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 28px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 100px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 8px 32px rgba(0, 0, 0, 0.2);
  transition: background var(--t-base);
}

/* Coalition logo (symbol + wordmark), tinted white via PNG transparency */
.nav-logo {
  height: 36px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.site-header__label {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
}

/* ── 06. Page ───────────────────────────────────────────────── */
.page {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--pad);
  min-height: 100vh;
}

/* Vertically center the empty state, but only while it's visible —
   once chat.js hides #empty-state the rule stops applying and the
   thread flows naturally from the top. */
.page:has(#empty-state:not(.hidden)) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 120px var(--pad) 160px;
}

.conversation { display: flex; flex-direction: column; width: 100%; }

/* ── 07. Welcome / hero state ──────────────────────────────── */
.welcome {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 32px;
}

.welcome__title {
  margin: 0 0 24px;
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 300;
  letter-spacing: -0.01em;
  line-height: 1;
  text-transform: uppercase;
  color: var(--white);
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.3);
  white-space: nowrap;
}

@media (max-width: 600px) {
  .welcome__title { white-space: normal; }
}

.welcome__subtitle {
  margin: 0 auto;
  max-width: 520px;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.8);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3);
}

/* ── 08. Suggested pills (dark glass on photo) ─────────────── */
.suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin: 0;
  width: 100%;
  text-align: left;
}

.pill {
  text-align: left;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1.4;
  cursor: pointer;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.15);
  transition: all 0.25s var(--ease);
}

.pill:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: var(--hairline-bright);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 12px 40px rgba(0, 0, 0, 0.2);
}

.pill:active { transform: translateY(0); }

/* ── 09. Thread + bubbles ──────────────────────────────────── */
.thread {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 140px 0 240px; /* bottom clears the floating dock */
}

.thread:empty { display: none; }

.msg { display: flex; width: 100%; }

/* Entrance: a quiet 8px rise + fade. The thinking dot is the one
   signature motion moment — everything else stays understated. */
.msg--user { justify-content: flex-end; }
.msg--bot  { justify-content: flex-start; }

.msg {
  animation: msg-rise 250ms var(--ease-out) both;
}

@keyframes msg-rise {
  from { opacity: 0; transform: translate3d(0, 8px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* Thinking indicator crossfades out as the reply takes its place */
.msg--leaving {
  opacity: 0;
  transition: opacity 150ms var(--ease-out);
}

.bubble {
  font-size: 16px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* User — solid orange, the user's voice */
.msg--user .bubble {
  align-self: flex-end;
  max-width: 75%;
  padding: 14px 20px;
  background: var(--orange);
  color: var(--white);
  border-radius: 20px 20px 6px 20px;
  font-weight: 500;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 4px 16px rgba(254, 164, 75, 0.35);
}

/* Assistant — light glass refracting the photo; text-shadow handles readability */
.msg--bot .bubble {
  position: relative;
  align-self: flex-start;
  max-width: min(640px, 85%); /* comfortable reading measure */
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.3);
  color: var(--ink);
  border-radius: 20px 20px 20px 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.2);
}

/* Quiet notice for errors / usage caps — same glass, softer voice */
.msg--notice .bubble {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--hairline);
  color: var(--ink-soft);
  font-size: 14.5px;
  max-width: min(560px, 85%);
}

.bubble a {
  color: var(--orange);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.msg--user .bubble a { color: var(--white); }

/* ── 09b. Rendered markdown inside bot bubbles ─────────────── */
/* Markdown is real HTML now — block margins do the spacing, so
   pre-wrap (kept for user bubbles / fallback text) must go. */
.msg--bot .bubble__body { white-space: normal; }

.bubble__body > :first-child { margin-top: 0; }
.bubble__body > :last-child { margin-bottom: 0; }

.bubble__body p { margin: 0 0 10px; }

.bubble__body strong { font-weight: 700; }

/* Brand rule: no italics, ever. Emphasis renders as bold. */
.bubble__body em {
  font-style: normal;
  font-weight: 700;
}

/* Headings speak the coalition label-tag language: small uppercase,
   light weight, led by a small orange dot. */
.bubble__body h1,
.bubble__body h2,
.bubble__body h3,
.bubble__body h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 300;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
}

.bubble__body h1::before,
.bubble__body h2::before,
.bubble__body h3::before,
.bubble__body h4::before {
  content: "";
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--orange);
}

.bubble__body ul,
.bubble__body ol {
  margin: 0 0 10px;
  padding-left: 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bubble__body li > p { margin: 0; }

.bubble__body ul li::marker { color: var(--orange); }
.bubble__body ol li::marker { color: var(--orange); font-weight: 600; }

.bubble__body blockquote {
  margin: 0 0 10px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid rgba(254, 164, 75, 0.6);
  color: rgba(255, 255, 255, 0.8);
}

.bubble__body code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 0.88em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.bubble__body pre {
  margin: 0 0 10px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  overflow-x: auto;
}

.bubble__body pre code {
  padding: 0;
  border: none;
  background: none;
}

.bubble__body hr {
  margin: 12px 0;
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* ── 10. Citations — footnotes, visually quieter than the answer ── */
.citations {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.14); /* hairline divider */
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11.5px;
  letter-spacing: 0.01em;
  line-height: 1.5;
  color: var(--ink-faint);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.citations__item { display: flex; gap: 4px; }
.citations__num  { display: none; } /* hide leading [n] — show plain Source: ... */

/* ── 11. Thinking indicator — the signature motion moment ──── */
/* A single orange dot with a slow breathing halo, beside the word
   THINKING. No bars, no beams, no spinners. */

.msg--bot .bubble--thinking {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 16px 22px;
  /* glass treatment carries over from .msg--bot .bubble */
}

.thinking-dot {
  position: relative;
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--orange);
  animation: dot-breathe 1.8s ease-in-out infinite;
}

/* The halo: a radial pulse expanding and fading to transparent */
.thinking-dot::before {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(254, 164, 75, 0.55) 0%, rgba(254, 164, 75, 0) 70%);
  animation: halo-breathe 1.8s ease-in-out infinite;
}

@keyframes dot-breathe {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

@keyframes halo-breathe {
  0%, 100% { transform: scale(1); opacity: 0; }
  50%      { transform: scale(2.6); opacity: 1; }
}

.thinking-label {
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* ── 11b. Streaming caret ──────────────────────────────────── */
/* Tokens stream straight into the bubble; the caret is a 2px rounded
   orange bar pulsing at the insertion point, removed on completion. */
.stream-caret {
  display: inline-block;
  width: 2px;
  height: 1em;
  margin-left: 3px;
  vertical-align: -0.12em;
  border-radius: 2px;
  background: var(--orange);
  animation: caret-pulse 1s ease-in-out infinite;
}

@keyframes caret-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.35; }
}

/* ── 11c. Copy chip (bot messages, on hover) ───────────────── */
.copy-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-fast), border-color var(--t-fast);
}

.msg--bot .bubble:hover .copy-chip,
.copy-chip:focus-visible {
  opacity: 1;
  pointer-events: auto;
}

.copy-chip:hover { border-color: var(--hairline-bright); color: var(--ink); }
.copy-chip--done { color: var(--orange); border-color: rgba(254, 164, 75, 0.5); }

/* Touch devices have no hover — keep the chip reachable, ≥44px hit area */
@media (pointer: coarse) {
  .copy-chip {
    opacity: 1;
    pointer-events: auto;
    padding: 8px 14px;
    min-height: 32px;
  }
  .copy-chip::after {
    content: "";
    position: absolute;
    inset: -8px; /* invisible hit-area extension to ~48px */
  }
}

/* ── 11d. "New reply" chip — shown instead of yanking the scroll ── */
.new-reply {
  position: fixed;
  bottom: 108px;
  left: 0;
  right: 0;
  margin-inline: auto; /* centered without transform — msg-rise animates transform */
  width: fit-content;
  z-index: 99;
  padding: 10px 18px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--hairline);
  border-radius: 100px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.3),
    0 8px 24px rgba(0, 0, 0, 0.25);
  animation: msg-rise 250ms var(--ease-out) both;
}

.new-reply:hover { border-color: var(--hairline-bright); background: rgba(255, 255, 255, 0.22); }

/* ── 12. Floating dock + composer (dark glass) ─────────────── */
.dock {
  position: fixed;
  bottom: calc(28px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 760px;
  z-index: 100;
}

.composer { display: block; }

.composer__shell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 24px;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(30px) saturate(200%);
  -webkit-backdrop-filter: blur(30px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 28px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 16px 48px rgba(0, 0, 0, 0.25);
  transition: border-color var(--t-base), box-shadow var(--t-base);
}

/* Focus: the glass lifts — hairline brightens, shadow deepens */
.composer__shell:focus-within {
  border-color: var(--hairline-bright);
  background: rgba(255, 255, 255, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 0 0 4px rgba(254, 164, 75, 0.1),
    0 20px 56px rgba(0, 0, 0, 0.32);
}

.composer__input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  resize: none;
  font-family: var(--font);
  font-size: 16px; /* ≥16px also stops iOS zoom-on-focus */
  font-weight: 400;
  line-height: 1.5;
  color: var(--white);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  padding: 10px 0;
  min-height: 40px;
  max-height: 120px;
  overflow-y: auto;
}

.composer__input::placeholder {
  color: rgba(255, 255, 255, 0.6);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}

.composer__send {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border: 0;
  border-radius: 50%;
  background: var(--orange);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(254, 164, 75, 0.4);
  transition: all 0.2s var(--ease);
}

.composer__send svg {
  width: 18px;
  height: 18px;
  transform: translate(-1px, 1px);
}

.composer__send:hover:not(:disabled) {
  background: var(--orange-deep);
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(254, 164, 75, 0.5);
}

.composer__send:active:not(:disabled) { transform: scale(0.96); }

.composer__send:disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: not-allowed;
}

/* ── 13. Keyboard hint (fixed beneath the dock) ────────────── */
.dock-hint {
  position: fixed;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  font-size: 11px;
  letter-spacing: 0.05em;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  white-space: nowrap;
}

.dock-hint kbd {
  font-family: inherit;
  font-size: 10.5px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.12);
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  letter-spacing: 0.03em;
}

/* ── 14. Scrollbars (orange thread) ────────────────────────── */
*::-webkit-scrollbar { width: 6px; height: 6px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(254, 164, 75, 0.4);
  border-radius: 100px;
  transition: background var(--t-base);
}
*::-webkit-scrollbar-thumb:hover { background: rgba(254, 164, 75, 0.7); }

* { scrollbar-width: thin; scrollbar-color: rgba(254, 164, 75, 0.4) transparent; }

/* ── 15. Utilities ─────────────────────────────────────────── */
.hidden { display: none !important; }

/* ── 16. Responsive ────────────────────────────────────────── */
@media (max-width: 640px) {
  :root { --pad: 16px; }

  .site-header {
    top: 12px;
    gap: 12px;
    padding: 10px 18px;
  }
  .site-header__label { font-size: 11px; letter-spacing: 0.1em; }

  .page:has(#empty-state:not(.hidden)) { padding: 100px 16px 150px; }

  .suggestions { grid-template-columns: 1fr; }

  .pill { padding: 16px 20px; min-height: 44px; }

  .thread { padding: 120px 0 220px; }

  .dock {
    width: calc(100% - 24px);
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .composer__shell { padding-left: 18px; }

  /* No physical Enter key — the hint is desktop furniture */
  .dock-hint { display: none; }

  .new-reply { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }

  .msg--user .bubble { max-width: 86%; }
  .msg--bot  .bubble { max-width: 92%; }
}

@media (max-width: 400px) {
  .site-header__label { font-size: 10.5px; }
  .welcome__title { font-size: 2.1rem; }
  .welcome__subtitle { font-size: 15.5px; }
}

/* ── 17. Reduced motion — disable everything nonessential ──── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .thinking-dot { animation: none; }
  .thinking-dot::before { animation: none; opacity: 0.5; transform: scale(1.6); }
  .stream-caret { animation: none; }
  .msg, .new-reply { animation: none; }
}
