/* Mood tokens — §10.2.1. Text and muted are constant across every mood so
   contrast cannot regress (FR-ADAPT-016). Only surface, accent and wash move.
   Values are normative — do not edit. Everything else in this file is free. */
:root {
  --bg: #0E1113;
  --surface: #161A1D;
  --accent: #7FA6A0;
  --wash: transparent;
  --response-size: 20px;
  --text: #E8EAEB;
  --muted: #9AA3A8;
  /* Two-font system: serif for the words the system says to the user (a
     page, read), sans for the instrument reading it out (chrome, data,
     controls). The contrast is the whole idea — book vs. gauge. */
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-read: ui-serif, Georgia, "Iowan Old Style", "Times New Roman", serif;
}
:root[data-mood="OVERWHELMED"] { --bg:#0C1012; --surface:#141A1C; --accent:#6E9AA8; --wash:#6E9AA8; }
:root[data-mood="NUMB"]        { --bg:#0B0D0E; --surface:#131517; --accent:#8A9296; --wash:transparent; --response-size:22px; }
:root[data-mood="RAW"]         { --bg:#12100F; --surface:#1A1715; --accent:#B08D7A; --wash:#B08D7A; --response-size:22px; }
:root[data-mood="ANXIOUS"]     { --bg:#0D1114; --surface:#151B1F; --accent:#7F9BB5; --wash:#7F9BB5; }
:root[data-mood="CRISIS"]      { --bg:#0A0C0D; --surface:#171A1C; --accent:#D9E1E4; --wash:transparent; --response-size:22px; }

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding-bottom: 96px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font-ui);
  transition: background-color 200ms ease, color 200ms ease;
}

/* CRISIS applies immediately, nothing cross-fades (FR-ADAPT-019). Reduced
   motion removes every transition on the page, not just the obvious ones. */
:root[data-mood="CRISIS"] *,
:root[data-mood="CRISIS"] *::before,
:root[data-mood="CRISIS"] *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 0%, var(--wash) 0%, transparent 60%);
  opacity: .06; transition: opacity 200ms ease;
}

button { font-family: inherit; }
button:focus-visible, .skip:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

/* Entry — one screen, two rows, both skippable (FR-ADAPT-001). */
.entry {
  position: fixed; inset: 0; z-index: 20;
  display: grid; place-items: center;
  background: var(--bg); padding: 24px;
}
.entry[hidden] { display: none; }
.entry-inner { max-width: 640px; text-align: center; }
.entry-kicker {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 20px;
}
.entry-lead {
  font-family: var(--font-read); font-style: italic; font-weight: 400;
  font-size: 26px; line-height: 1.4; letter-spacing: -.005em;
  margin: 0 0 32px;
}
.entry-divider {
  width: 40px; height: 1px; margin: 32px auto;
  background: rgba(255,255,255,.14);
}
.entry-sub { color: var(--muted); margin: 0 0 16px; font-size: 15px; }
.entry-row { display: flex; gap: 12px; justify-content: center; }
.entry-row.wrap { flex-wrap: wrap; }

.chip {
  background: var(--surface); color: var(--text);
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  padding: 12px 20px; font-size: 15px; font-family: inherit; cursor: pointer;
  transition: border-color 200ms ease;
}
.chip:hover { border-color: var(--accent); }
.chip.lg { padding: 18px 44px; font-size: 18px; }
.chip.sm { padding: 8px 14px; font-size: 13px; font-variant-numeric: tabular-nums; }
.chip.sm.active { border-color: var(--accent); color: var(--accent); }
.skip {
  margin-top: 28px; background: none; border: none; cursor: pointer;
  color: var(--muted); font: inherit; font-size: 14px; text-decoration: underline;
  text-underline-offset: 4px;
}

.header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; padding: 24px;
  position: relative; border-bottom: 1px solid rgba(255,255,255,.08);
}
/* A fixed instrument bezel-line, not a 6%-opacity wash, so mood reads at
   a glance from the back of a room (OPEN-07). */
.header::after {
  content: ""; position: absolute; left: 24px; right: 24px; bottom: -1px;
  height: 2px; background: var(--accent); transition: background-color 200ms ease;
}
.wordmark { font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.shift { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.shift-label { font-size: 11px; color: var(--muted); margin-right: 4px; }

.stack {
  padding: 16px 24px 24px; max-width: 1280px; margin: 0 auto;
}
/* Three panels as one instrument, not three floating cards: a single
   surface with hairline dividers between registers. */
.ledger {
  display: grid; gap: 0; overflow: hidden;
  background: var(--surface); border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px; transition: background-color 200ms ease;
}
@media (min-width: 1024px) { .ledger { grid-template-columns: 1fr 1fr 1fr; } }

.panel { padding: 24px; }
.panel:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,.08); }
@media (min-width: 1024px) {
  .panel:not(:last-child) { border-bottom: none; border-right: 1px solid rgba(255,255,255,.08); }
}
.panel-h {
  font-size: 13px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); opacity: .6; margin: 0 0 16px; font-weight: 500;
  position: relative; padding-left: 14px;
}
.panel-h::before {
  content: ""; position: absolute; left: 0; top: 50%; margin-top: -3px;
  width: 6px; height: 6px; border-radius: 1px;
  background: var(--accent); transition: background-color 200ms ease;
}
.muted { color: var(--muted); margin: 0; }

.facts { list-style: none; margin: 0; padding: 0; }
.facts li { padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,.06); font-size: 15px; }
.facts li:last-child { border-bottom: none; }
.src { color: var(--muted); font-size: 12px; margin-left: 8px; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
/* Text labels, never colour alone (NFR-A11Y-010). */
.mode {
  border: 1px solid var(--accent); color: var(--accent);
  border-radius: 3px; padding: 4px 12px; font-size: 13px;
  transition: border-color 200ms ease, color 200ms ease;
}
.mood-chip { color: var(--muted); font-size: 13px; margin-bottom: 12px; }
.rationale { list-style: none; margin: 0; padding: 0; }
.rationale li { padding: 6px 0 6px 14px; position: relative; font-size: 15px; }
.rationale li::before { content: "—"; position: absolute; left: 0; color: var(--accent); }
.degraded { color: var(--muted); font-size: 13px; margin-top: 12px; font-style: italic; }

.response {
  font-family: var(--font-read);
  font-size: var(--response-size); line-height: 1.5; max-width: 46ch;
  margin: 0 0 24px; padding-left: 16px;
  border-left: 2px solid var(--accent);
  transition: border-color 200ms ease;
}
.play {
  background: none; border: 1px solid rgba(255,255,255,.14); color: var(--text);
  border-radius: 3px; padding: 6px 16px; font: inherit; font-size: 13px;
  cursor: pointer; margin-bottom: 16px;
}
.action {
  border-left: 2px solid var(--accent); padding: 4px 0 4px 16px; margin: 16px 0;
  transition: border-color 200ms ease;
}
.action-step { font-family: var(--font-read); margin: 0 0 6px; font-size: 17px; line-height: 1.5; }
.action-why { margin: 0; color: var(--muted); font-size: 14px; }
.parked { font-size: 14px; margin: 12px 0; }

.quiet-btn {
  width: 100%; margin-top: 20px; background: none; color: var(--text);
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 14px; font: inherit; font-size: 15px; cursor: pointer;
}
.quiet-btn:hover { border-color: var(--accent); }

.composer {
  position: fixed; bottom: 0; left: 0; right: 0;
  display: flex; gap: 8px; align-items: center;
  padding: 16px 24px; background: var(--bg);
  border-top: 1px solid rgba(255,255,255,.08);
}
#input {
  flex: 1; background: var(--surface); color: var(--text);
  border: 1px solid rgba(255,255,255,.08); border-radius: 12px;
  padding: 12px 14px; font: inherit;
}
#input:focus { outline: none; border-color: var(--accent); }
.mic {
  flex: 1; background: var(--surface); color: var(--text);
  border: 1px solid rgba(255,255,255,.14); border-radius: 12px;
  padding: 14px; font: inherit; font-size: 15px; cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: none;
  transition: border-color 200ms ease, color 200ms ease;
}
.mic:hover { border-color: var(--accent); }
.mic.recording { border-color: var(--accent); color: var(--accent); }
.send {
  background: var(--accent); color: #0E1113; border: none; border-radius: 12px;
  padding: 12px 22px; font: inherit; font-weight: 500; cursor: pointer;
}
.footer { text-align: center; color: var(--muted); font-size: 12px; margin: 24px 0 0; }

/* Quiet is a first-class state, not an empty one (FR-UI-009/011). */
body.quiet .ledger { border-color: transparent; background: transparent; }
body.quiet .panel:not(:last-child) { border-color: transparent; }
body.quiet #p-heard .panel-body, body.quiet #p-chose .rationale,
body.quiet .action, body.quiet .parked, body.quiet .quiet-btn, body.quiet .play { display: none; }
