/* HearingReady -- restrained, institutional interface. Light background only, one muted
   accent colour, no gradients, no glow, no dark mode. Plain CSS, no framework, no build step.
   Design tokens live in :root; everything else reads them rather than hardcoding colour. */

:root {
  --bg: #f7f5f0;
  --surface: #ffffff;
  --surface-alt: #efece4;
  --surface-sunken: #f1efe8;
  --border: #ded9cc;
  --border-strong: #c7bfac;
  --text: #26241f;
  --text-muted: #6c675c;
  --text-faint: #948e7d;
  --accent: #7a3b34;
  --accent-strong: #632e28;
  --accent-soft: #f3e7e3;
  --accent-soft-border: #e3cac4;
  --error: #8a3324;
  /* Landing-page-only verdict palette (Step 4's own explicit spec: muted green for grounded
     findings, amber for incomplete findings, red only for high-risk) -- deliberately separate
     from the rest of this app's internal "one accent colour, state shown by shape not hue"
     restraint (see the debrief close-out's own comment on .verdict-badge), which stays
     unchanged. Muted/desaturated on purpose, matching this page's institutional tone -- not a
     bright traffic-light palette. --high-risk reuses --error rather than defining a second red. */
  --held-up: #3f6b46;
  --held-up-soft: #e8efe9;
  --needs-work: #8a6a1f;
  --needs-work-soft: #f3ecdb;
  --serif: Georgia, "Times New Roman", Cambria, serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: Consolas, "SF Mono", Menlo, monospace;
  --radius: 3px;
}

* { box-sizing: border-box; }

body {
  font-family: var(--sans);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.5rem 3rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}

header {
  border-bottom: 1px solid var(--border-strong);
  padding: 1rem 0;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
header h1 {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}
.header-link {
  font-size: 0.85rem;
  color: var(--text-muted);
  white-space: nowrap;
}

h2 { font-family: var(--serif); font-size: 1.5rem; font-weight: 600; margin: 0 0 0.75rem; }
h3 { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; margin: 1.2rem 0 0.5rem; color: var(--text); }
h4 { font-size: 0.95rem; font-weight: 600; margin: 0 0 0.2rem; }

a { color: var(--accent); }
a:hover { color: var(--accent-strong); }

label { display: block; margin-top: 0.75rem; font-weight: 600; font-size: 0.92rem; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; padding: 0.45rem 0.55rem; font-size: 0.95rem; font-family: var(--sans);
  box-sizing: border-box; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text);
}
input:focus, textarea:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}

button {
  margin-top: 1rem; padding: 0.5rem 1.1rem; font-size: 0.92rem; font-family: var(--sans);
  cursor: pointer; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: #fff; font-weight: 600;
}
button:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
button.secondary {
  background: var(--surface); color: var(--text); border-color: var(--border-strong); font-weight: normal;
}
button.secondary:hover { background: var(--surface-alt); }
button:disabled { opacity: 0.55; cursor: default; }

fieldset { margin-top: 1rem; border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; }
legend { font-family: var(--serif); font-weight: 600; padding: 0 0.4rem; }

.error { color: var(--error); font-weight: 600; }
.status-line { color: var(--text-muted); font-style: italic; margin: 0.5rem 0; font-size: 0.92rem; }

.summary-box {
  background: var(--surface); border: 1px solid var(--border); padding: 1rem; border-radius: var(--radius);
  white-space: pre-wrap; font-family: var(--mono); font-size: 0.86rem; color: var(--text);
}

/* ---------------------------------------------------------------------------
   Hearing layout
--------------------------------------------------------------------------- */

.hearing-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

.hearing-header {
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
}
.hearing-header .project-line {
  font-family: var(--serif); font-size: 1.25rem; font-weight: 600; margin: 0 0 0.15rem;
}
.hearing-header .zoning-line {
  color: var(--text-muted); font-size: 0.92rem; margin: 0 0 0.5rem;
}
.hearing-header .phase-line {
  display: flex; align-items: center; gap: 0.6rem; font-size: 0.88rem;
}
.phase-badge {
  display: inline-flex; align-items: center; gap: 0.4rem;
  background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 999px; padding: 0.25rem 0.7rem; font-weight: 600; color: var(--text);
}

/* ---------------------------------------------------------------------------
   The room -- an abstract three-quarter view (the "Chamber" treatment: warm wood tones,
   a soft lift of light on each figure, faint grounding shadows). See hearing.js's
   renderRoomScene/updateRoomSpeaking for how this gets built and kept in sync with the
   transcript's own colours.
--------------------------------------------------------------------------- */
#room-scene {
  grid-column: 1 / -1;
  background: #f5efe0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.6rem 1rem 0.3rem;
  margin-bottom: 1.2rem;
}
#room-svg { display: block; width: 100%; max-width: 640px; height: auto; margin: 0 auto; }

.room-desk { fill: url(#roomDeskWood); }
.room-plinth { fill: #b6a688; }
.room-mic { stroke: #b6a688; stroke-width: 1.3; }
.room-shadow { fill: #4a3a22; opacity: 0.16; }
.room-shoulders, .room-head { stroke: none; }

/* Gentle idle motion -- a slow, faint rise-and-settle, staggered per figure via --idle-delay
   (set in hearing.js) so the room never breathes in unison. Explicitly NOT a highlight, scale
   pulse, or colour change -- per direct feedback, the room should feel occupied, not gamified. */
.room-figure {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: room-idle 4.6s ease-in-out infinite;
  animation-delay: var(--idle-delay, 0ms);
}
@keyframes room-idle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-1.4px); }
}

/* The speaking cue -- a slight lean toward the mic, nothing else changes (no scale, no
   colour, no glow). Idle motion is switched off while leaning so the two never fight. */
.room-figure.is-leaning {
  animation: none;
  transform: rotate(-7deg) translateY(-2px);
  transition: transform 420ms ease;
}
.room-figure:not(.is-leaning) { transition: transform 420ms ease; }

@media (prefers-reduced-motion: reduce) {
  .room-figure { animation: none; }
  .room-figure.is-leaning, .room-figure:not(.is-leaning) { transition: none; }
}
.phase-badge .live-dot {
  width: 0.45rem; height: 0.45rem; border-radius: 50%; background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}

.transcript-column { min-width: 0; }

#packet-panel {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 0.6rem 0.9rem; margin-bottom: 1.2rem;
}
#packet-panel summary {
  cursor: pointer; font-weight: 600; font-family: var(--serif); font-size: 0.98rem; list-style: none;
}
#packet-panel summary::-webkit-details-marker { display: none; }
#packet-panel summary::before { content: "▸ "; color: var(--text-muted); }
#packet-panel[open] summary::before { content: "▾ "; }
#packet-panel[open] summary { margin-bottom: 0.6rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--border); }

/* ---------------------------------------------------------------------------
   Transcript
--------------------------------------------------------------------------- */

#transcript { margin-bottom: 1.2rem; }

/* max-width below is 60ch, not the 65-70-character target itself -- measured live against real
   generated turns: `Nch` is sized by the "0" glyph, which runs wider than this font's average
   character, so 68ch actually rendered ~74-76 real characters/line (measured via
   getBoundingClientRect() per character across two real streamed turns), well past the intended
   range. 60ch was recalibrated from that same measurement, not guessed -- applies to every
   max-width: 60ch below (.turn, .turn.applicant, .phase-divider). */
.turn {
  display: flex; gap: 0.65rem; margin-bottom: 1.3rem; max-width: 60ch;
}
.turn .avatar {
  flex: 0 0 auto; width: 2.15rem; height: 2.15rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.78rem; font-family: var(--sans);
  margin-top: 0.1rem;
}
.turn .turn-body { min-width: 0; flex: 1; }
.turn .speaker {
  font-weight: 600; font-size: 0.84rem; color: var(--text-muted); margin-bottom: 0.2rem;
  display: flex; align-items: center; gap: 0.4rem;
}
.turn .speaker .speaker-name { color: var(--text); }
.turn .speaker .speaking-dot {
  width: 0.4rem; height: 0.4rem; border-radius: 50%; background: var(--accent);
  animation: pulse 1.1s ease-in-out infinite; display: none;
}
.turn.is-speaking .speaking-dot { display: inline-block; }
.turn .text { white-space: pre-wrap; }
.waiting-flavor { color: var(--text-faint); font-style: italic; animation: waiting-fade 2.2s ease-in-out infinite; }
@keyframes waiting-fade { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

/* Applicant's own turns: conversational, not a roster entry -- indented, tinted, no avatar */
.turn.applicant {
  max-width: 60ch; margin-left: 2.8rem; padding: 0.6rem 0.9rem;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: var(--radius);
}
.turn.applicant .speaker { color: var(--accent-strong); }
.turn.applicant .avatar { display: none; }

.phase-divider {
  display: flex; align-items: center; gap: 0.75rem; margin: 1.6rem 0; max-width: 60ch;
  color: var(--text-faint); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
}
.phase-divider::before, .phase-divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

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

/* ---------------------------------------------------------------------------
   Input area
--------------------------------------------------------------------------- */

#input-area { border-top: 1px solid var(--border-strong); padding-top: 1rem; }
#input-row { display: flex; gap: 0.6rem; align-items: flex-end; }
#response-box { flex: 1; resize: vertical; min-height: 3.2rem; }
#input-hint { color: var(--text-faint); font-size: 0.78rem; margin: 0.3rem 0 0; }

.input-buttons { display: flex; gap: 0.5rem; align-items: center; }
#mic-button {
  margin-top: 0; width: 2.6rem; height: 2.6rem; padding: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--border-strong); color: var(--text);
}
#mic-button svg { width: 1.15rem; height: 1.15rem; fill: currentColor; }
#mic-button:hover { background: var(--surface-alt); }
#mic-button.recording {
  background: var(--error); border-color: var(--error); color: #fff;
  animation: pulse 1.3s ease-in-out infinite;
}
#submit-button { margin-top: 0; }

#mic-status { color: var(--text-muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
#mic-status.error { color: var(--error); font-weight: 600; }
#mic-waveform {
  width: 100%; height: 48px; background: var(--surface-alt); border-radius: var(--radius);
  margin-top: 0.5rem; border: 1px solid var(--border);
}

/* board_member mode: ordinance-grounded prompts shown above the question box */
#available-prompts {
  border: 1px solid var(--border); background: var(--surface-sunken); border-radius: var(--radius);
  padding: 0.6rem 0.8rem; margin-bottom: 0.7rem; font-size: 0.86rem;
}
.prompts-label { color: var(--text-muted); font-style: italic; margin-bottom: 0.4rem; }
.prompt-item { margin: 0.2rem 0; }
.prompt-id { font-family: var(--mono); color: var(--accent-strong); font-weight: 600; margin-right: 0.3rem; }

/* board_member mode: public comment pass/respond -- Pass is the single, prominent, one-click
   default; "Respond instead" is deliberately understated (a plain text-style toggle, not a
   boxed button) so the two are never equal-weight choices. See RULES.md's reasoning: if both
   cost the same effort, politeness-to-the-interface silently defeats the judgment being trained. */
#pc-reaction-area { border-top: 1px solid var(--border-strong); padding-top: 1rem; }
#pc-claim-callout {
  border: 1px solid var(--accent-soft-border); background: var(--accent-soft); border-radius: var(--radius);
  padding: 0.6rem 0.8rem; margin-bottom: 0.8rem; font-style: normal;
}
.pc-reaction-buttons { display: flex; align-items: baseline; gap: 1.2rem; }
.pc-pass-button { font-size: 1.02rem; padding: 0.6rem 1.8rem; }
.pc-respond-toggle {
  margin-top: 1rem; padding: 0.3rem 0; background: none; border: none; color: var(--text-muted);
  font-weight: normal; text-decoration: underline; text-underline-offset: 2px;
}
.pc-respond-toggle:hover { background: none; color: var(--text); }
#pc-respond-box-area { margin-top: 0.7rem; }
#pc-respond-box { width: 100%; resize: vertical; min-height: 3.2rem; }
#pc-respond-box-area button { margin-top: 0.5rem; }

.sentence.speaking { background: var(--accent-soft); border-radius: 2px; }

/* A turn that hit its length ceiling before the model finished (check_run.is_truncated,
   threaded through to the client -- see tts.js's flushTurn/_markCutShort). The leftover
   fragment reads as visibly incomplete rather than a normal, finished sentence. */
.sentence.truncated-fragment { font-style: italic; color: var(--text-muted); }
.cut-short-note { color: var(--text-faint); font-size: 0.8rem; font-style: italic; }

/* ---------------------------------------------------------------------------
   Side panel
--------------------------------------------------------------------------- */

.side-panel {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; font-size: 0.88rem; position: sticky; top: 1rem;
}
.side-panel h3:first-child { margin-top: 0; }
.side-panel h3 {
  font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted);
  font-family: var(--sans); font-weight: 700; border-bottom: 1px solid var(--border); padding-bottom: 0.3rem;
}
.side-panel ul { list-style: none; padding: 0; margin: 0 0 0.4rem; }
.side-panel li { margin-bottom: 0.4rem; }

/* Structured debrief rendering (replaces the old raw <pre> markdown dump) -- see
   web\debrief_render.py for the parser that produces these sections/blocks. */
.debrief-sections { margin: 1rem 0 1.5rem; }
.debrief-section { margin-bottom: 1.4rem; }
.debrief-section h3 {
  font-family: var(--serif); font-size: 1.05rem; margin: 0 0 0.5rem; color: var(--accent-strong);
}
.debrief-section p { margin: 0 0 0.6rem; }
.debrief-section ul { margin: 0 0 0.6rem; padding-left: 1.3rem; }
.debrief-section li { margin-bottom: 0.35rem; }

/* Step 3 rehearsal close-out -- scannable summary above the full analysis. Verdict severity is
   shown by border weight/label, not a traffic-light palette -- matches this app's existing
   restrained design language (see the record-state comment just below: one accent colour,
   state shown by shape/fill). HIGH RISK borrows --error (already used for warnings elsewhere
   in this app); NEEDS WORK and HELD UP stay neutral, distinguished by their text label alone. */
/* Disposition banner -- reuses the existing accent-soft token pair (already used for e.g. the
   applicant's own turn background) rather than a new colour, per explicit instruction. */
.closeout-status {
  margin: 0.8rem 0 1.3rem; padding: 0.9rem 1.1rem; font-size: 1.02rem;
  background: var(--accent-soft); border: 1px solid var(--accent-soft-border); border-radius: var(--radius);
}
.closeout-status-label {
  margin: 0 0 0.5rem; font-family: var(--sans); font-size: 0.78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em; color: var(--accent-strong);
}
.closeout-status p { margin: 0 0 0.5rem; }
.closeout-status p:last-child { margin-bottom: 0; }

.closeout-corrections, .closeout-responses, .closeout-commitments,
.closeout-unresolved, .closeout-nextrun { margin: 0 0 1.6rem; }
.closeout-corrections h3, .closeout-responses h3, .closeout-commitments h3,
.closeout-unresolved h3, .closeout-nextrun h3 {
  font-family: var(--serif); font-size: 1.1rem; margin: 0 0 0.7rem; color: var(--accent-strong);
}

.verdict-badge {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.03em;
  text-transform: uppercase; padding: 0.15rem 0.5rem; border-radius: var(--radius);
  border: 1px solid var(--border-strong); color: var(--text-muted); background: var(--surface-alt);
}

.correction-card, .response-card {
  border: 1px solid var(--border); border-left: 4px solid var(--border-strong);
  border-radius: var(--radius); background: var(--surface); padding: 0.8rem 1rem; margin-bottom: 0.8rem;
}
.correction-card.verdict-high-risk, .response-card.verdict-high-risk { border-left-color: var(--error); }
.correction-card.verdict-high-risk .verdict-badge, .response-card.verdict-high-risk .verdict-badge {
  border-color: var(--error); color: var(--error); background: transparent;
}
.correction-card.verdict-needs-work, .response-card.verdict-needs-work { border-left-color: var(--accent); }
.correction-card.verdict-needs-work .verdict-badge, .response-card.verdict-needs-work .verdict-badge {
  border-color: var(--accent); color: var(--accent-strong);
}

.correction-header, .response-header { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; margin-bottom: 0.4rem; }
.correction-moment, .response-moment { font-weight: 600; color: var(--text); }
.response-index { font-family: var(--mono); font-size: 0.82rem; color: var(--text-faint); }
.correction-problem { margin: 0 0 0.4rem; }
.correction-quote { margin: 0 0 0.4rem; font-style: italic; color: var(--text-muted); }
.correction-fix { margin: 0; }
.response-card p { margin: 0 0 0.5rem; }
.response-better { color: var(--accent-strong); }
.response-details summary { cursor: pointer; color: var(--text-muted); font-size: 0.88rem; }
.response-details p { margin: 0.5rem 0 0; font-size: 0.92rem; }

.commitment-list { list-style: none; margin: 0; padding: 0; }
.commitment-item {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.7rem 0.9rem;
  margin-bottom: 0.6rem; background: var(--surface);
}
.commitment-top { display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap; }
.commitment-quote { font-weight: 600; }
.commitment-cite { font-family: var(--mono); font-size: 0.8rem; color: var(--text-faint); }
.commitment-statuses { margin-top: 0.35rem; }
.status-badge {
  display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.02em;
  text-transform: uppercase; padding: 0.1rem 0.4rem; border-radius: var(--radius);
  border: 1px solid var(--border-strong); color: var(--text-muted); margin-right: 0.3rem;
}
.commitment-detail { margin: 0.4rem 0 0; color: var(--text-muted); font-size: 0.92rem; }

.unresolved-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 640px) { .unresolved-columns { grid-template-columns: 1fr; } }
.unresolved-column {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 0.8rem 1rem; background: var(--surface);
}
.unresolved-column h4 { margin: 0 0 0.3rem; font-family: var(--serif); }

.closeout-nextrun ol { padding-left: 1.3rem; }
.closeout-nextrun li { margin-bottom: 0.4rem; }

.closeout-full-analysis { margin: 1.5rem 0; border-top: 1px solid var(--border); padding-top: 1rem; }
.closeout-full-analysis > summary {
  cursor: pointer; font-family: var(--serif); font-size: 1.05rem; color: var(--accent-strong);
}
.closeout-full-analysis[open] > summary { margin-bottom: 0.8rem; }

/* "The record" -- topics + discretionary findings, state shown by shape/fill, not colour hue
   (the interface has exactly one accent colour, used only for a settled/resolved outcome) */
.record-item { display: flex; align-items: flex-start; gap: 0.5rem; }
.state-icon {
  flex: 0 0 auto; width: 0.62rem; height: 0.62rem; border-radius: 50%; margin-top: 0.3rem;
  border: 1.5px solid var(--border-strong); background: transparent;
}
.state-icon.state-pressed { background: var(--border-strong); }
.state-icon.state-resolved, .state-icon.state-persuaded {
  background: var(--accent); border-color: var(--accent);
}
.state-icon.state-deferred { border-color: var(--text-faint); background: transparent; }
.state-icon.state-unpersuaded {
  border-radius: 2px; background: var(--text); border-color: var(--text);
}
.record-item .record-label { color: var(--text); }
.record-item .record-state { color: var(--text-faint); font-size: 0.78rem; text-transform: capitalize; }
.record-item .record-detail { color: var(--text-muted); font-size: 0.82rem; margin-top: 0.1rem; }

/* The record, moved to /debrief -- same .record-item/.state-icon classes as the (removed)
   live side panel, just not nested under .side-panel, so the list reset is repeated here. */
.debrief-record ul { list-style: none; padding: 0; margin: 0 0 0.6rem; }
.debrief-record li { margin-bottom: 0.5rem; }
.debrief-record h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); margin: 1rem 0 0.2rem; }

/* "In the room" roster */
.roster-group-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-faint);
  margin: 0.6rem 0 0.25rem;
}
.roster-group-label:first-child { margin-top: 0; }
.roster-item { display: flex; align-items: center; gap: 0.5rem; }
.roster-item .avatar {
  width: 1.6rem; height: 1.6rem; border-radius: 50%; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.62rem;
}
.roster-item .roster-name { color: var(--text); }
.roster-item .roster-role { color: var(--text-faint); font-size: 0.78rem; }

/* Audio controls -- functional, deliberately unobtrusive */
#tts-controls { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; margin-bottom: 0.2rem; }
#tts-controls button {
  margin-top: 0; padding: 0.28rem 0.6rem; font-size: 0.78rem; background: var(--surface);
  color: var(--text); border-color: var(--border-strong); font-weight: normal;
}
#tts-controls button.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#tts-speed-label { display: flex; align-items: center; gap: 0.3rem; margin-top: 0; font-weight: normal; font-size: 0.78rem; }
#tts-speed { width: auto; padding: 0.15rem; font-size: 0.78rem; }
#tts-status { color: var(--text-muted); font-size: 0.85rem; margin: 0.5rem 0 0; }
#tts-status.error { color: var(--error); font-weight: 600; }

/* Coach panel -- its own named voice, off to the side, never inside the transcript */
#coach-panel { margin-top: 1rem; }
#coach-panel h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 0.4rem; }
#coach-toggle-label {
  text-transform: none; letter-spacing: normal; font-weight: normal; font-size: 0.78rem;
  color: var(--text-muted); display: flex; align-items: center; gap: 0.25rem;
}
#coach-log { display: flex; flex-direction: column; gap: 0.5rem; max-height: 16rem; overflow-y: auto; }
.coach-entry { font-size: 0.85rem; border-left: 2px solid var(--border-strong); padding-left: 0.5rem; }
.coach-entry .coach-topic {
  display: block; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); margin-bottom: 0.1rem;
}
.coach-entry .coach-text { color: var(--text); }
.coach-entry.coach-concern { border-left-color: var(--error); }
.coach-entry.coach-praise, .coach-entry.coach-nudge { border-left-color: var(--accent); }

/* ---------------------------------------------------------------------------
   Scenario cards (setup_step1/3/4.html, role/scenario/jurisdiction picks)
--------------------------------------------------------------------------- */
.scenario-options { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.5rem; }
.scenario-card {
  display: block; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface);
  padding: 0.6rem 0.8rem; font-weight: normal; cursor: pointer;
}
.scenario-card input[type="radio"] { width: auto; display: inline; margin-right: 0.5rem; }
.scenario-title { font-weight: 600; }
.scenario-description { display: block; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.2rem; }

/* ---------------------------------------------------------------------------
   Setup wizard -- progress indicator (_wizard_steps.html) + per-step nav row
--------------------------------------------------------------------------- */
.wizard-steps { margin-bottom: 1.3rem; }
.wizard-steps ol {
  list-style: none; display: flex; flex-wrap: wrap; gap: 0; padding: 0; margin: 0;
  border-bottom: 1px solid var(--border);
}
.wizard-steps li {
  display: flex; align-items: baseline; gap: 0.35rem; padding: 0 1rem 0.6rem 0;
  margin-right: 1rem; font-size: 0.85rem; color: var(--text-faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wizard-steps li a { color: inherit; text-decoration: none; display: flex; align-items: baseline; gap: 0.35rem; }
.wizard-steps li a:hover .wizard-step-label { text-decoration: underline; }
.wizard-step-num {
  display: inline-flex; align-items: center; justify-content: center; width: 1.2rem; height: 1.2rem;
  border-radius: 50%; border: 1px solid var(--text-faint); font-size: 0.72rem; font-weight: 600;
}
.wizard-steps li.is-done { color: var(--text-muted); }
.wizard-steps li.is-done .wizard-step-num { border-color: var(--text-muted); background: var(--surface-alt); }
.wizard-steps li.is-current {
  color: var(--text); font-weight: 600; border-bottom-color: var(--accent);
}
.wizard-steps li.is-current .wizard-step-num { border-color: var(--accent); background: var(--accent); color: #fff; }

.wizard-nav { display: flex; justify-content: space-between; align-items: center; margin-top: 1.3rem; }
.button-link {
  display: inline-block; margin-top: 1rem; padding: 0.5rem 1.1rem; font-size: 0.92rem;
  font-family: var(--sans); text-decoration: none; border-radius: var(--radius); font-weight: normal;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong);
}
.button-link:hover { background: var(--surface-alt); color: var(--text); }

/* ---------------------------------------------------------------------------
   Jurisdiction picker (setup_step4.html) -- cascading state -> county select, plus the
   on-selection detail panel
--------------------------------------------------------------------------- */
select option.no-data { color: var(--text-faint); }
#jurisdiction-detail {
  background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.7rem 1rem; margin-top: 0.7rem; font-size: 0.9rem;
}
#jurisdiction-detail p { margin: 0 0 0.4rem; }
#jurisdiction-detail ul { list-style: none; padding: 0; margin: 0; }
#jurisdiction-detail li { margin-bottom: 0.25rem; color: var(--text-muted); }
#jurisdiction-detail .stale-flag { color: var(--error); font-weight: 600; }

/* ---------------------------------------------------------------------------
   Packet view (_packet_view.html -- shared by packet_reveal.html and hearing.html's panel)
--------------------------------------------------------------------------- */
.packet-view h3 { margin-top: 1.2rem; }
.packet-view .project-facts { margin-top: 0.5rem; }
.packet-view dt { font-weight: 600; float: left; width: 9rem; clear: left; color: var(--text-muted); }
.packet-view dd { margin-left: 9.5rem; margin-bottom: 0.4rem; }
.packet-doc {
  border-left: 3px solid var(--border-strong); background: var(--surface-sunken);
  padding: 0.6rem 0.8rem; margin-bottom: 0.7rem; border-radius: 0 var(--radius) var(--radius) 0;
}
.packet-doc h4 { margin: 0 0 0.2rem; }

/* ---------------------------------------------------------------------------
   Build-your-own form (build_scenario.html)
--------------------------------------------------------------------------- */
.doc-option { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.5rem; }
.doc-checkbox-label { display: flex; align-items: center; gap: 0.4rem; font-weight: normal; flex: 0 0 16rem; margin-top: 0; }
.doc-checkbox-label input[type="checkbox"] { width: auto; }
.doc-finding { flex: 1; margin-top: 0; }
.doc-finding:disabled { background: var(--surface-alt); color: var(--text-faint); }
#conditions-list input[type="text"] { margin-top: 0.4rem; }
#add-condition { margin-top: 0.6rem; }

/* ---------------------------------------------------------------------------
   Processing / progress
--------------------------------------------------------------------------- */
.progress-bar-track {
  width: 100%; height: 10px; background: var(--surface-alt); border: 1px solid var(--border);
  border-radius: 999px; overflow: hidden; margin: 0.9rem 0;
}
.progress-bar-fill {
  height: 100%; background: var(--accent); width: 0%; transition: width 300ms ease;
}
.progress-bar-fill.indeterminate {
  width: 35%; animation: indeterminate 1.4s ease-in-out infinite;
}
@keyframes indeterminate {
  0% { margin-left: 0%; }
  50% { margin-left: 65%; }
  100% { margin-left: 0%; }
}
#progress-counts { list-style: none; padding: 0; color: var(--text-muted); font-size: 0.9rem; }
#progress-counts li { margin-bottom: 0.2rem; }

@media (max-width: 860px) {
  .hearing-layout { grid-template-columns: 1fr; }
  .side-panel { position: static; }
}

/* /admin -- plain tables, no charts, matches the rest of the app's restrained tone */
.admin-table-wrap { overflow-x: auto; margin: 0.75rem 0 1.5rem; }
table.admin-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.admin-table caption { text-align: left; font-family: var(--serif); font-weight: 600;
  font-size: 1.05rem; margin-bottom: 0.4rem; }
table.admin-table th, table.admin-table td {
  padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap;
}
table.admin-table thead th {
  border-bottom: 1px solid var(--border-strong); color: var(--text-muted);
  font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em;
}
table.admin-table tbody tr:hover { background: var(--surface-alt); }
table.admin-table td.feedback-comment { white-space: pre-wrap; max-width: 32rem; }
.admin-totals { display: flex; flex-wrap: wrap; gap: 1.5rem; margin: 0.75rem 0 1.5rem; }
.admin-totals div { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.6rem 1rem; }
.admin-totals .num { display: block; font-family: var(--serif); font-size: 1.4rem; font-weight: 600; }
.admin-totals .label { color: var(--text-muted); font-size: 0.8rem; }
.badge { display: inline-block; padding: 0.05rem 0.4rem; border-radius: var(--radius); font-size: 0.78rem; font-weight: 600; }
.badge-completed { background: var(--accent-soft); color: var(--accent-strong); border: 1px solid var(--accent-soft-border); }
.badge-abandoned { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); }
.badge-in_progress { background: #eef3ea; color: #3a5a2f; border: 1px solid #cfe0c6; }

/* Feedback widget -- fixed corner button + panel, present on every session page (see
   base.html's {% if session %} gate). Deliberately quiet -- not competing with the room. */
#feedback-widget { position: fixed; right: 1rem; bottom: 1rem; z-index: 40; }
#feedback-toggle {
  font-size: 0.82rem; padding: 0.4rem 0.75rem; border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
#feedback-panel {
  position: absolute; right: 0; bottom: calc(100% + 0.5rem); width: 18rem;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18); padding: 0.75rem;
}
#feedback-panel label { display: block; font-size: 0.85rem; margin-bottom: 0.35rem; }
#feedback-panel textarea {
  width: 100%; box-sizing: border-box; font: inherit; font-size: 0.88rem;
  border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 0.4rem;
  resize: vertical;
}
.feedback-actions { display: flex; gap: 0.5rem; margin-top: 0.5rem; }
.feedback-actions button { font-size: 0.82rem; padding: 0.3rem 0.65rem; }
#feedback-status { margin: 0.5rem 0 0; }

@media (max-width: 480px) {
  #feedback-panel { width: calc(100vw - 2rem); right: -0.25rem; }
}

/* ---------------------------------------------------------------------------
   Landing page (Step 4) -- same cream/oxblood/serif identity as the rest of the app, wider
   max-width for a hero-driven page, no gradients/glow/animation. body's own 1180px max-width
   already covers the ~1,100-1,200px target; sections below just add generous vertical rhythm.
--------------------------------------------------------------------------- */
.landing-header { border-bottom: 1px solid var(--border-strong); padding: 1rem 0; }
.landing-header-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.8rem;
}
.wordmark {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 700; color: var(--text);
  text-decoration: none;
}
.wordmark:hover { color: var(--text); text-decoration: underline; }
.landing-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; }
.landing-nav a { color: var(--text-muted); text-decoration: none; font-size: 0.92rem; }
.landing-nav a:hover, .landing-nav a:focus-visible { color: var(--accent-strong); text-decoration: underline; }
.landing-header-cta { margin-top: 0; white-space: nowrap; }

.hero { padding: 2.6rem 0 2.2rem; max-width: 760px; }
.hero-eyebrow {
  font-family: var(--sans); font-size: 0.82rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--accent-strong); margin: 0 0 0.9rem;
}
.hero-headline {
  font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.18;
  margin: 0 0 1rem; color: var(--text); font-weight: 700;
}
.hero-copy { font-size: 1.08rem; line-height: 1.6; color: var(--text-muted); margin: 0 0 1.4rem; max-width: 640px; }
.hero-cta { margin-top: 0; background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; }
.hero-cta:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }

.hero-preview {
  margin-top: 2.2rem; max-width: 620px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface); padding: 1rem 1.1rem;
}
.hero-preview-label {
  margin: 0 0 0.7rem; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); font-weight: 600;
}
.hero-preview .turn { margin-bottom: 0.7rem; }
.hero-finding { margin: 0.8rem 0 0; }
.hero-finding p { margin: 0.4rem 0 0; font-size: 0.9rem; color: var(--text-muted); }

.credibility-strip { padding: 1.6rem 0; border-top: 1px solid var(--border); }
.credibility-strip ul {
  list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.7rem 1.6rem;
}
.credibility-strip li {
  font-size: 0.92rem; color: var(--text-muted); position: relative; padding-left: 1.1rem;
}
.credibility-strip li::before {
  content: ""; position: absolute; left: 0; top: 0.5em; width: 0.4rem; height: 0.4rem;
  border-radius: 50%; background: var(--accent);
}

.problem-section, .how-it-works, .product-tour, .sample-evaluation, .research-foundation,
.data-handling, .invite-code-section { padding: 2.4rem 0; border-top: 1px solid var(--border); }
.problem-section h3, .how-it-works h3, .product-tour h3, .sample-evaluation h3,
.research-foundation h3, .data-handling h3, .invite-code-section h3 {
  font-family: var(--serif); font-size: 1.4rem; margin: 0 0 1.2rem;
}

.card-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
.tour-row { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 800px) { .card-row, .tour-row { grid-template-columns: 1fr; } }

.info-card, .tour-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 1.1rem 1.2rem;
}
.info-card h4, .tour-card h4 { margin: 0 0 0.5rem; font-family: var(--serif); font-size: 1.02rem; }
.info-card p, .tour-card p { margin: 0; font-size: 0.92rem; color: var(--text-muted); }
.tour-card .verdict-badge { margin-bottom: 0.6rem; }
.tour-mini-record { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.tour-mini-record .record-item { margin-bottom: 0.3rem; }
.tour-mini-turn {
  display: block; margin: 0 0 0.6rem; padding: 0.5rem 0.6rem; background: var(--surface-alt);
  border-radius: var(--radius); font-size: 0.85rem;
}
.tour-mini-turn .speaker-name { display: block; font-weight: 600; margin-bottom: 0.2rem; }
.tour-mini-turn .text { color: var(--text-muted); }

.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; gap: 1.3rem; }
.steps-list li { position: relative; padding-left: 2.6rem; }
.steps-list li::before {
  counter-increment: step; content: counter(step); position: absolute; left: 0; top: 0.1rem;
  width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--accent); color: #fff;
  font-family: var(--serif); font-weight: 700; display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
}
.steps-list h4 { margin: 0 0 0.3rem; font-family: var(--serif); font-size: 1.05rem; }
.steps-list p { margin: 0; color: var(--text-muted); }

.eval-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface);
  padding: 1.3rem 1.4rem; max-width: 720px;
}
.eval-field { margin: 0 0 0.9rem; line-height: 1.55; }
.eval-field:last-child { margin-bottom: 0; }
.eval-label {
  display: block; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--text-faint); font-weight: 700; margin-bottom: 0.2rem;
}

.data-handling ul, .research-foundation + .data-handling ul { margin: 0; padding-left: 1.3rem; }
.data-handling li { margin-bottom: 0.6rem; line-height: 1.55; }

.invite-code-section form { max-width: 360px; }

.landing-footer { border-top: 1px solid var(--border-strong); padding: 2rem 0 1rem; text-align: center; }
.footer-links { font-size: 0.88rem; }
.footer-disclaimer { font-size: 0.82rem; color: var(--text-faint); margin-top: 0.8rem; }

/* Verdict badges -- landing-page-only green/amber/red modifiers (color-independent: the text
   label -- "Needs work"/"High risk" -- is always present, color is reinforcement only). */
.verdict-badge-needs-work { border-color: var(--needs-work); color: var(--needs-work); background: var(--needs-work-soft); }
.verdict-badge-high-risk { border-color: var(--error); color: var(--error); background: var(--accent-soft); }
.verdict-badge-held-up { border-color: var(--held-up); color: var(--held-up); background: var(--held-up-soft); }

@media (max-width: 640px) {
  .landing-header-inner { flex-direction: column; align-items: flex-start; }
  .landing-nav { gap: 0.6rem 1rem; }
}
