/* ============================================================
   QuietPrompter — design system
   Dark, calm, professional. One accent (teal→sky gradient),
   semantic colors reserved for hint types and status.
   ============================================================ */

:root {
  /* Surfaces */
  --bg: #0b0f14;
  --surface: #131a22;
  --surface-2: #1a232e;
  --surface-3: #212d3a;
  --border: rgba(148, 180, 212, 0.14);
  --border-strong: rgba(148, 180, 212, 0.26);

  /* Text */
  --text: #e8edf3;
  --muted: #93a3b4;
  --faint: #64748b;

  /* Brand */
  --accent: #2dd4bf;
  --accent-2: #38bdf8;
  --accent-dim: #17766c;
  --accent-soft: rgba(45, 212, 191, 0.11);
  --grad: linear-gradient(135deg, #2dd4bf, #38bdf8);

  /* Semantic */
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --say: #60a5fa;
  --ask: #c084fc;
  --observe: #4ade80;
  --gold: #d6b656;

  /* Shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --shadow: 0 18px 50px -18px rgba(0, 0, 0, 0.55);
}

* { box-sizing: border-box; }

html { color-scheme: dark; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(900px 480px at 12% -8%, rgba(45, 212, 191, 0.07), transparent 60%),
    radial-gradient(900px 520px at 95% 4%, rgba(56, 189, 248, 0.06), transparent 60%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.screen { max-width: 1160px; margin: 0 auto; padding: 1.4rem 1.5rem 3rem; }

/* The live session uses the whole viewport: full width, full height, the two
   columns absorb all remaining space and scroll internally. */
#session {
  max-width: none;
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: 0 1.2rem 1rem;
}

::selection { background: rgba(45, 212, 191, 0.3); }

/* Slim, quiet scrollbars inside the panes. */
.scroll::-webkit-scrollbar { width: 8px; }
.scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; }
.scroll::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

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

/* ============================ Top nav ============================ */

.topnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.4rem 0 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.logo span { color: var(--accent); }
.mark { width: 26px; height: 26px; flex: none; }

.nav-right { display: flex; align-items: center; gap: 0.9rem; }

.server-status { font-size: 0.82rem; font-weight: 600; margin: 0; }
.server-status.ok { color: var(--ok); }
.server-status.degraded { color: var(--warn); }
.server-status.down { color: var(--danger); }

/* ============================ Hero ============================ */

.hero { padding: 2.2rem 0 1rem; max-width: 720px; }

.hero h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin: 0;
}
.hero h1 em {
  font-style: normal;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero .sub {
  color: var(--muted);
  font-size: 1.05rem;
  max-width: 56ch;
  margin: 1rem 0 0;
}

.feature-chips {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0;
  margin: 1.3rem 0 0;
}
.feature-chips li {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
}

/* ============================ Setup form ============================ */

#setup-form {
  margin-top: 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  padding: 1.9rem clamp(1.2rem, 4vw, 2.2rem) 1.6rem;
  display: flex;
  flex-direction: column;
  gap: 1.4rem;
  max-width: 860px;
}

.form-title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; }

.group {
  border-top: 1px solid var(--border);
  padding-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.group h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
}
.step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 800;
}

label { display: flex; flex-direction: column; gap: 0.4rem; font-weight: 600; font-size: 0.9rem; }
label small { color: var(--faint); font-weight: 500; font-size: 0.8rem; }

input, textarea, select {
  background: #0e141b;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}
textarea { resize: vertical; min-height: 4.2rem; }
select { cursor: pointer; }

/* ---------- Custom dropdown ----------
   Native <select> popups are OS-rendered (white, unthemable), so every select
   is progressively enhanced into a .dd: the real <select> stays in the DOM
   (hidden) as the source of truth; the button + list below are pure theme. */
.dd { position: relative; }
.dd > select { display: none; }

.dd-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: #0e141b;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: var(--r-sm);
  padding: 0.65rem 0.8rem;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: left;
}
.dd-btn::after {
  content: "";
  flex: none;
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.6px solid var(--muted);
  border-bottom: 1.6px solid var(--muted);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 0.15s;
}
.dd.open .dd-btn::after { transform: rotate(-135deg) translateY(-2px); }
.dd-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.dd.open .dd-btn,
.dd-btn:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.18);
}

.dd-list {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  min-width: 100%;
  max-height: 16rem;
  overflow-y: auto;
  margin: 0;
  padding: 0.3rem;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  box-shadow: var(--shadow);
}
.dd-list li {
  padding: 0.5rem 0.7rem;
  border-radius: var(--r-sm);
  font-size: 0.9rem;
  cursor: pointer;
  white-space: nowrap;
}
.dd-list li:hover, .dd-list li.focus { background: var(--surface-3); }
.dd-list li.selected { color: var(--accent); background: var(--accent-soft); }
.dd-list li.selected::before { content: "✓ "; }

/* Header-sized dropdowns (transcript language switcher). */
.dd.small .dd-btn { padding: 0.3rem 0.55rem; font-size: 0.82rem; border-radius: 999px; }
.dd.small .dd-btn::after { width: 0.42rem; height: 0.42rem; }

.row { display: flex; gap: 1rem; }
.row label { flex: 1; min-width: 0; }
@media (max-width: 680px) { .row { flex-direction: column; } }

/* Toggle switch (real checkbox underneath — JS reads .checked). */
.check span { display: flex; align-items: center; gap: 0.6rem; font-weight: 600; }
.check small { margin-left: calc(2.4rem + 0.6rem); }
.switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 2.4rem;
  height: 1.35rem;
  margin: 0;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--border);
  position: relative;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
  flex: none;
}
.switch input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  transform: translateY(-50%);
  width: 0.95rem;
  height: 0.95rem;
  border-radius: 50%;
  background: var(--muted);
  transition: left 0.18s, background 0.18s;
}
.switch input[type="checkbox"]:checked { background: var(--accent-dim); border-color: var(--accent); }
.switch input[type="checkbox"]:checked::after { left: calc(100% - 0.95rem - 3px); background: var(--accent); }
.switch input[type="checkbox"]:focus-visible { box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.25); outline: none; }
.switch .knob { display: none; } /* reserved — knob is drawn with ::after */

/* Tips */
.tip {
  background: var(--accent-soft);
  border: 1px solid rgba(45, 212, 191, 0.25);
  border-radius: var(--r-sm);
  padding: 0.7rem 0.9rem;
  font-size: 0.86rem;
  color: var(--text);
  margin: 0;
  line-height: 1.5;
}
.tip strong { color: var(--accent); }

/* Advanced settings */
.advanced { font-size: 0.9rem; }
.advanced summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  border-radius: var(--r-sm);
  padding: 0.25rem 0.4rem;
}
.advanced summary::-webkit-details-marker { display: none; }
.advanced summary::before {
  content: "▸";
  font-size: 0.8rem;
  color: var(--faint);
  transition: transform 0.15s;
}
.advanced[open] summary::before { transform: rotate(90deg); }
.advanced summary:hover { color: var(--text); background: var(--surface-2); }
.advanced-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.1rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}
.advanced-grid .tip { grid-column: 1 / -1; }
@media (max-width: 560px) { .advanced-grid { grid-template-columns: 1fr; } }

/* Buttons */
button {
  border: none;
  border-radius: var(--r-sm);
  padding: 0.7rem 1.2rem;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.15s, filter 0.15s, background 0.15s;
}
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:active { transform: translateY(1px); }

button.primary {
  background: var(--grad);
  color: #04231f;
  font-size: 1.05rem;
  padding: 0.85rem 1.4rem;
  border-radius: var(--r-md);
  box-shadow: 0 10px 30px -10px rgba(45, 212, 191, 0.45);
}
button.primary:hover { filter: brightness(1.08); box-shadow: 0 12px 34px -10px rgba(45, 212, 191, 0.6); }

button.danger { background: transparent; color: var(--danger); border: 1px solid rgba(248, 113, 113, 0.5); }
button.danger:hover { background: rgba(248, 113, 113, 0.12); border-color: var(--danger); }

button.help { background: var(--grad); color: #04231f; white-space: nowrap; }
button.help:hover { filter: brightness(1.08); }
button.help:disabled { opacity: 0.55; cursor: wait; }

/* Window unfocused: keystrokes can't reach the page — dim the button, stamp
   a forbidden sign over the H key cap, and explain in the note beside it. */
button.help.nofocus { filter: grayscale(0.45) brightness(0.92); }
button.help.nofocus .kbd { position: relative; color: transparent; }
button.help.nofocus .kbd::after {
  content: "🚫";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  color: #04231f; /* emoji alpha follows `color` in Blink — must be opaque */
}
.focus-note {
  color: var(--faint);
  font-size: 0.72rem;
  font-style: italic;
  white-space: nowrap;
}

button.cc {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  white-space: nowrap;
}
button.cc:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
button.cc.active { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }

.kbd {
  background: rgba(4, 35, 31, 0.35);
  border-radius: 4px;
  padding: 0.05rem 0.4rem;
  font-size: 0.75rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.consent { color: var(--faint); font-size: 0.8rem; margin: 0; text-align: center; line-height: 1.55; }

.foot { margin-top: 2rem; text-align: center; }
.foot p { color: var(--faint); font-size: 0.8rem; margin: 0; }

/* ============================ Session bar ============================ */

.session-bar {
  flex: none;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
  padding: 0.7rem 0.9rem;
  margin: 0 -1.2rem;
  background: rgba(11, 15, 20, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

/* Simple mode (default): the diagnostic chrome stays out of the way. */
#session.simple-ui .adv-only { display: none !important; }

.home-btn {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
}
.home-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--surface-2); }
.home-btn .mark { width: 20px; height: 20px; }

.timer {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font-variant-numeric: tabular-nums;
}

/* Advisor spend meter — fills faster while ⚡ code mode runs a stronger model */
.usage-meter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
}
.usage-track {
  width: 90px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.usage-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.4s ease;
}
.usage-meter.boosted .usage-fill { background: linear-gradient(135deg, #fbbf24, #f87171); }
.usage-units {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 2ch;
}
.usage-boost {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--warn);
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

.status-cluster {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

.health { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 700; }
.health-dot { width: 9px; height: 9px; border-radius: 50%; }
.health.ok .health-dot { background: var(--ok); box-shadow: 0 0 7px rgba(74, 222, 128, 0.7); }
.health.ok #health-text { color: var(--ok); }
.health.degraded .health-dot { background: var(--warn); box-shadow: 0 0 7px rgba(251, 191, 36, 0.7); }
.health.degraded #health-text { color: var(--warn); }
.health.down .health-dot { background: var(--danger); box-shadow: 0 0 7px rgba(248, 113, 113, 0.7); animation: pulse 1s ease-in-out infinite; }
.health.down #health-text { color: var(--danger); }

.pstatus-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  border-left: 1px solid var(--border);
  padding-left: 0.7rem;
}
.pstatus { display: flex; align-items: center; gap: 0.35rem; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.pstatus .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.pstatus.working { color: var(--warn); }
.pstatus.working .dot { background: var(--warn); animation: pulse 1s ease-in-out infinite; }
.pstatus.error { color: var(--danger); }
.pstatus.error .dot { background: var(--danger); }
.pstatus.error .pulse { background: var(--danger); }

.pulse {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.75); }
}

.goal-chip {
  flex: 1;
  min-width: 8rem;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.actions { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ============================ Panes ============================ */

/* Left column: transcript over summary. Right column: the advisor. Both
   stretch to the bottom of the viewport; each pane scrolls internally. */
.panes {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 1.1rem;
  margin-top: 1rem;
}
@media (max-width: 820px) { .panes { grid-template-columns: 1fr; } }

.col-left {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-height: 0;
}
.transcript-pane { flex: 1; min-height: 0; }

.pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 1rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pane-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.8rem;
}
.pane-head h2 {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.09em;
}
.pane-hint { color: var(--faint); font-size: 0.75rem; white-space: nowrap; }

.scroll { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 0.55rem; padding-right: 2px; }

.placeholder {
  color: var(--faint);
  font-style: italic;
  font-size: 0.9rem;
  text-align: center;
  margin: auto 0;
  padding: 2rem 1rem;
}

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

.line {
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 0.55rem 0.8rem;
  font-size: 0.93rem;
  line-height: 1.5;
}

/* The live draft line (utterance currently being spoken). */
.line.draft {
  border-color: rgba(45, 212, 191, 0.3);
  box-shadow: inset 3px 0 0 var(--accent);
  animation: draftpulse 1.6s ease-in-out infinite;
}
/* Cloud STT labels speaker turns inside the draft ("S1: …\nS2: …") —
   let the newlines render so each turn sits on its own line. */
.line.draft .original {
  white-space: pre-line;
}
@keyframes draftpulse { 0%, 100% { opacity: 0.92; } 50% { opacity: 0.6; } }

.line .translation {
  color: var(--accent);
  font-size: 0.86rem;
  font-style: italic;
  margin-top: 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
}

/* Speaker label from cloud STT diarization. */
.line .original .speaker {
  display: inline-block;
  margin-right: 0.45rem;
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: 0.08em;
  background: rgba(45, 212, 191, 0.14);
  color: var(--accent);
}
.line .original .speaker.s2 { background: rgba(192, 132, 252, 0.14); color: var(--ask); }
.line .original .speaker.s3 { background: rgba(74, 222, 128, 0.13); color: var(--observe); }
.line .original .speaker.s4 { background: rgba(251, 191, 36, 0.13); color: var(--warn); }
.line .original .speaker.s5 { background: rgba(244, 114, 182, 0.14); color: #f472b6; }
.line .original .speaker.s6 { background: rgba(96, 165, 250, 0.14); color: var(--say); }

/* Translation mode: hoverable per-word gloss. */
.line .original .word {
  cursor: help;
  border-bottom: 1px dotted var(--accent-dim);
  transition: color 0.1s;
}
.line .original .word:hover { color: var(--accent); }

.word-tip {
  position: fixed;
  z-index: 50;
  transform: translate(-50%, calc(-100% - 6px));
  background: #0a0e13;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0.3rem 0.55rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-style: normal;
  line-height: 1.3;
  pointer-events: none;
  white-space: nowrap;
  max-width: 320px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

/* ---------- Transcript-pane language switcher ---------- */

.lang-switch { display: flex; align-items: center; gap: 0.45rem; }
.lang-switch .lang-arrow {
  background: none;
  border: none;
  padding: 0.1rem 0.25rem;
  border-radius: var(--r-sm);
  color: var(--faint);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.lang-switch .lang-arrow:hover { color: var(--accent); background: var(--surface-2); }
.lang-switch select { font-size: 0.82rem; padding: 0.3rem 0.5rem; }
/* Translation off → the language pair is visible but clearly inert. */
.lang-switch.off .lang-arrow,
.lang-switch.off .dd { opacity: 0.35; pointer-events: none; }
/* Reviewing a saved file → the whole switcher is informational. */
.lang-switch.review { opacity: 0.5; pointer-events: none; }

/* Compact switch for pane headers (same design, smaller). */
.switch.mini { flex-direction: row; }
.switch.mini input[type="checkbox"] { width: 2rem; height: 1.15rem; }
.switch.mini input[type="checkbox"]::after { width: 0.8rem; height: 0.8rem; }

/* ---------- Note composer + note chips ---------- */

.note-form { display: flex; gap: 0.5rem; margin-top: 0.7rem; }
.note-hint { color: var(--faint); font-size: 0.74rem; margin: 0.45rem 0 0; text-align: center; }
.note-form input { flex: 1; border-radius: 999px; padding-left: 1rem; }
.note-form button {
  background: var(--surface-3);
  color: var(--text);
  font-size: 0.84rem;
  border-radius: 999px;
  white-space: nowrap;
}
.note-form button:hover { background: var(--accent-dim); color: #fff; }

.note-chip {
  align-self: flex-start;
  max-width: 100%;
  background: rgba(214, 182, 86, 0.1);
  border: 1px dashed rgba(214, 182, 86, 0.55);
  color: #e6d6a3;
  border-radius: var(--r-md);
  padding: 0.4rem 0.75rem;
  font-size: 0.84rem;
  font-style: italic;
}

/* ---------- Hint cards ---------- */

.hint-card {
  border-radius: var(--r-md);
  padding: 0.8rem 0.95rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  animation: slide-in 0.25s ease-out;
}
@keyframes slide-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.hint-card .kind {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 800;
  margin-bottom: 0.3rem;
}
.hint-card .tldr { font-size: 1.08rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.01em; }
.hint-card .detail { color: var(--muted); font-size: 0.86rem; line-height: 1.45; margin-top: 0.35rem; }
.hint-card .code {
  margin: 0.5rem 0 0;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow-x: auto;
}
.hint-card .code code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82rem;
  line-height: 1.5;
  color: var(--text);
  white-space: pre;
  display: block;
}

.hint-card.suggest_say { border-left-color: var(--say); }
.hint-card.suggest_say .kind { color: var(--say); }
.hint-card.ask_question { border-left-color: var(--ask); }
.hint-card.ask_question .kind { color: var(--ask); }
.hint-card.warning { border-left-color: var(--warn); }
.hint-card.warning .kind { color: var(--warn); }
.hint-card.observation { border-left-color: var(--observe); }
.hint-card.observation .kind { color: var(--observe); }
.hint-card.goal_progress { border-left-color: var(--accent); }
.hint-card.goal_progress .kind { color: var(--accent); }

/* ---------- Pinned hints, panic fast path, duplicate bumps ---------- */

/* Load-bearing hints stay put above the scrolling feed. */
.pinned-hints {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 0.55rem;
  margin-bottom: 0.55rem;
  border-bottom: 1px dashed var(--border-strong);
  max-height: 45%;
  overflow-y: auto;
  flex-shrink: 0;
}

.hint-card { position: relative; }
.hint-card .pin-btn {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  background: none;
  border: none;
  padding: 0.1rem 0.2rem;
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.2;
  filter: grayscale(1);
  transition: opacity 0.15s ease;
}
.hint-card:hover .pin-btn { opacity: 0.75; }
.hint-card.pinned .pin-btn { opacity: 1; filter: none; }

/* Panic fast path — the ⚡ quick one-liner while the full advisor thinks. */
.hint-card.fast { border-left-color: var(--gold); }
.hint-card.fast .kind { color: var(--gold); }

/* H-button answer — the user explicitly asked, so make it pop. */
.hint-card.help {
  border-left-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 1px rgba(45, 212, 191, 0.35), 0 8px 22px -10px rgba(45, 212, 191, 0.5);
}
.hint-card.help .kind { color: var(--accent); }
.hint-card.help .fast-badge {
  background: var(--accent-soft);
  border-color: rgba(45, 212, 191, 0.5);
  color: var(--accent);
}
.fast-badge {
  margin-left: 0.5rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: rgba(214, 182, 86, 0.16);
  border: 1px solid rgba(214, 182, 86, 0.5);
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
}

/* A near-duplicate hint bumped this card instead of stacking a new one. */
.bump-count {
  margin-left: 0.5rem;
  padding: 0.05rem 0.35rem;
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 0.62rem;
}
.hint-card.bumped { animation: bump-flash 1.2s ease-out; }
@keyframes bump-flash {
  0% { background: rgba(45, 212, 191, 0.22); border-color: var(--accent); }
  100% { background: var(--surface-2); border-color: var(--border); }
}

.hint-card .visual {
  margin-top: 0.6rem;
  background: #0e141b;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 0.5rem;
  overflow-x: auto;
}
.hint-card .visual svg { max-width: 100%; height: auto; }

/* Pre-call briefing card */
.hint-card.briefing { border-left-color: var(--gold); }
.hint-card.briefing .kind { color: var(--gold); }
.hint-card.briefing h4 {
  margin: 0.75rem 0 0.25rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.hint-card.briefing p { margin: 0; font-size: 0.92rem; line-height: 1.5; }
.hint-card.briefing ul { margin: 0; padding-left: 1.1rem; }
.hint-card.briefing li { font-size: 0.89rem; line-height: 1.5; margin-bottom: 0.2rem; }
.briefing-loading { font-style: italic; }

/* ---------- Summary pane (bottom of the transcript column) ---------- */

.summary-pane {
  flex: none;
  height: 30%;
  min-height: 130px;
}
#summary ul { margin: 0; padding-left: 1.2rem; display: flex; flex-direction: column; gap: 0.35rem; }
#summary li { font-size: 0.92rem; line-height: 1.5; }
#summary li::marker { color: var(--accent); }

/* ============================ Toast ============================ */

.toast {
  position: fixed;
  z-index: 100;
  bottom: 1.2rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-3);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
  padding: 0.7rem 1.1rem;
  font-size: 0.9rem;
  max-width: min(80vw, 560px);
  box-shadow: var(--shadow);
}

/* ============================ Small screens ============================ */

@media (max-width: 680px) {
  .screen { padding: 1rem 1rem 2.5rem; }
  #session { padding: 0 0.8rem 0.8rem; height: auto; min-height: 100dvh; }
  .hero { padding-top: 1.2rem; }
  .session-bar { gap: 0.55rem; padding: 0.6rem; margin: 0 -0.8rem; }
  .goal-chip { order: 5; flex-basis: 100%; }
  .actions { width: 100%; justify-content: flex-end; }
  /* Stacked single column — give each pane a workable height again. */
  .transcript-pane, .advisor-pane { min-height: 46vh; }
  .summary-pane { height: auto; max-height: 32vh; }
}
