/* ==========================================================================
   SCA Simulator — design tokens (calm clinical: muted teal + Plus Jakarta Sans)
   ========================================================================== */
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #fbfdfc;
  --surface: #ffffff;
  --surface-soft: #f6faf9;
  --accent: #0d9488;
  --accent-hover: #134e4a;
  --accent-soft: #e9f7f4;
  --accent-bright: #14b8a6;  /* gradients, glows, waveform bars ONLY — never solid text on light */
  --accent-solid: #0b8277;   /* solid button fill — darkened teal, white text 4.69:1 */
  --ink-dark: #0e1f1c;       /* dark panels / dark pills (prototype --dark) */

  --text: #10201d;
  --text-muted: #4b5f5b;
  --text-subtle: #7d8f8b;
  --border: #e2ebe9;
  --border-strong: #cfdedb;
  --hairline: #e2ebe9;

  /* Verdict semantic palette — desaturated family fitting the teal.
     Every text/tint pairing computed at ≥ 4.5:1 (AA at chip size). */
  --grade-clear-fail: #7c2d21;   /* dusty brick */
  --grade-fail: #9a4a33;         /* muted clay */
  --grade-pass: #4a6f58;         /* sage */
  --grade-clear-pass: #1e5c40;   /* deep green */

  --grade-clear-fail-bg: #f4e3df;
  --grade-fail-bg: #f6e9e3;
  --grade-pass-bg: #e9f0eb;
  --grade-clear-pass-bg: #e0ede6;

  --shadow-card: 0 4px 20px rgba(0,0,0,0.04);
  --shadow-card-hover: 0 8px 28px rgba(0,0,0,0.08);
  --shadow-elev: 0 12px 40px rgba(0,0,0,0.08);

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;

  --font-sans: "Plus Jakarta Sans", -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
}

/* Barely-there corner wash behind cards on logged-in pages (static). The
   landing manages its own glow language per-section. */
body:not(.lp-page) {
  background-image: radial-gradient(circle at 92% -4%, rgba(20,184,166,0.06), transparent 42%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

html, body {
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent-hover); text-decoration: none; }
a:hover { color: var(--accent); }

h1, h2, h3, h4 {
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.03em; }
h2 { font-size: clamp(1.5rem, 2.5vw, 2rem); }
h3 { font-size: 1.25rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }

p { margin: 0 0 1em; }

/* ==========================================================================
   Layout
   ========================================================================== */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}
.brand-accent { color: var(--accent); }
.nav {
  display: flex;
  gap: 12px 28px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.nav a {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--text); }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px;
}

.footer {
  text-align: center;
  padding: 48px 32px;
  color: var(--text-subtle);
  font-size: 0.85rem;
}

/* ==========================================================================
   Cards and sections
   ========================================================================== */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.2s, transform 0.2s;
}
.card:hover { box-shadow: var(--shadow-card-hover); }

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 16px;
}

.hero { margin-bottom: 48px; }
.hero h1 span { color: var(--accent); }
.hero .hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin-top: 12px;
}

/* ==========================================================================
   Case grid (home)
   ========================================================================== */
.case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.case-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
}
.case-card:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-2px);
  border-color: var(--accent-soft);
  color: inherit;
}
.case-card .station-num {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.case-card .case-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}
.case-card .case-meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.enriched-badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.search-bar {
  width: 100%;
  padding: 16px 20px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  margin-bottom: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-bar:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.filter-bar { margin-bottom: 24px; }
.filter-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-select {
  padding: 8px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  min-width: 200px;
}
.filter-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.active-filter {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
}
.clear-filter-btn {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.clear-filter-btn:hover { opacity: 0.7; }

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-block;
  padding: 12px 24px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}
.btn-primary {
  background: var(--accent-solid);
  color: white;
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: white;
}
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { background: var(--surface-soft); }
.btn-lg { padding: 16px 32px; font-size: 1rem; }

/* ==========================================================================
   Case brief page
   ========================================================================== */
.brief-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  margin-bottom: 32px;
}
/* Case page — calm clinical record layout (hero band + dl record rows) */
.case-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 40px;
  margin-bottom: 24px;
}
.case-eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.case-headline {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.15;
}
.case-meta {
  margin: 14px 0 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.case-meta span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--text-subtle);
}
.case-explainer {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 20px;
}
.case-record {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 40px;
}
.record-list {
  display: grid;
  grid-template-columns: 212px 1fr;
  margin: 0;
}
.record-list dt {
  grid-column: 1;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  padding: 26px 24px 24px 0;
  border-top: 1px solid var(--hairline);
  line-height: 1.5;
}
.record-list dd {
  grid-column: 2;
  margin: 0;
  padding: 22px 0 24px;
  border-top: 1px solid var(--hairline);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}
.record-list dt:first-of-type,
.record-list dt:first-of-type + dd {
  border-top: none;
}
@media (max-width: 700px) {
  .record-list { grid-template-columns: 1fr; }
  .record-list dt { grid-column: 1; padding: 20px 0 6px; }
  .record-list dd { grid-column: 1; padding: 0 0 20px; border-top: none; }
  .record-list dt:first-of-type { padding-top: 6px; }
  .case-hero, .case-record { padding-left: 20px; padding-right: 20px; }
}

/* ==========================================================================
   Session / chat
   ========================================================================== */
.session-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 960px) {
  .session-grid { grid-template-columns: 1fr; }
}

.chat-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 60vh;
}

.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 60vh;
}

.bubble {
  max-width: 72%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  word-wrap: break-word;
}
.bubble-doctor {
  align-self: flex-end;
  background: var(--accent);
  color: white;
  border-bottom-right-radius: 6px;
}
.bubble-patient {
  align-self: flex-start;
  background: var(--surface-soft);
  color: var(--text);
  border-bottom-left-radius: 6px;
}

.chat-input-row {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  padding: 12px 16px;
  font-size: 1rem;
  font-family: inherit;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
}
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chat-input:disabled {
  background: var(--surface-soft);
  color: var(--text-subtle);
  cursor: not-allowed;
}

/* ==========================================================================
   Countdown timer
   ========================================================================== */
.timer-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.timer-display {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.timer-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 6px;
}
.timer-warn { color: var(--grade-fail); }
.timer-danger { color: var(--grade-clear-fail); }

.sidebar-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.sidebar-panel h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  margin: 0 0 10px;
}
.sidebar-panel .patient-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}
.sidebar-panel .meta { font-size: 0.85rem; color: var(--text-muted); }

/* ==========================================================================
   Performance Analysis — tabs + grades
   ========================================================================== */
.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.tab-btn {
  padding: 14px 24px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

.verdict-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}
.verdict-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.verdict-headline {
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}
.verdict-summary {
  margin-top: 12px;
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 760px;
}

.grade-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.grade-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.grade-clear_fail  { background: var(--grade-clear-fail-bg);  color: var(--grade-clear-fail); }
.grade-clear_fail  .grade-dot { background: var(--grade-clear-fail); }
.grade-fail        { background: var(--grade-fail-bg);        color: var(--grade-fail); }
.grade-fail        .grade-dot { background: var(--grade-fail); }
.grade-pass        { background: var(--grade-pass-bg);        color: var(--grade-pass); }
.grade-pass        .grade-dot { background: var(--grade-pass); }
.grade-clear_pass  { background: var(--grade-clear-pass-bg);  color: var(--grade-clear-pass); }
.grade-clear_pass  .grade-dot { background: var(--grade-clear-pass); }

/* Numeric score chip — sits beside the verdict chip; colour reflects the
   personal pass line, not the verdict (a mismatch is legitimate feedback). */
.score-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
}
.score-above-line { background: var(--grade-pass-bg); color: var(--grade-pass); }
.score-below-line { background: var(--grade-fail-bg); color: var(--grade-fail); }
.score-unavailable { background: var(--surface-soft); color: var(--text-muted); }

.domain-score {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.domain-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.domain-header {
  padding: 24px 28px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  user-select: none;
  transition: background 0.15s;
}
.domain-header:hover { background: var(--surface-soft); }
.domain-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}
.domain-rationale {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}
.domain-caret {
  color: var(--text-subtle);
  transition: transform 0.2s;
  font-size: 1.1rem;
}
.domain-section.expanded .domain-caret { transform: rotate(180deg); }
.domain-body {
  padding: 0 28px 28px;
  display: none;
}
.domain-section.expanded .domain-body { display: block; }

.what-well {
  background: var(--grade-pass-bg);
  border-left: 3px solid var(--grade-pass);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}
.what-well .label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--grade-pass);
  margin-bottom: 6px;
}
.what-well p { margin: 0; color: var(--text); font-size: 0.95rem; line-height: 1.65; }

.statement-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--grade-fail);
  border-radius: var(--radius-sm);
  padding: 18px 22px;
  margin-bottom: 14px;
}
.statement-card.is-advisory { border-left-color: var(--accent); background: var(--surface); }
.statement-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}
.statement-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}
.statement-flag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}
.statement-flag.mandatory { background: var(--grade-fail-bg); color: var(--grade-fail); }
.statement-flag.advisory  { background: var(--accent-soft);    color: var(--accent); }
.statement-id {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-subtle);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}
.statement-narrative {
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 14px;
}
.statement-narrative p { margin: 0 0 10px; }
.statement-official { margin-top: 8px; }
.statement-official summary {
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 0;
  list-style: none;
}
.statement-official summary::before {
  content: "▸ ";
  color: var(--text-subtle);
}
.statement-official[open] summary::before { content: "▾ "; }
.statement-official-body {
  padding: 12px 16px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 6px;
}
.statement-official-body p { margin: 0 0 10px; }
.statement-official-body .label {
  font-weight: 700;
  color: var(--text);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
  margin-bottom: 4px;
}
.capability-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.capability-chip {
  font-size: 0.7rem;
  padding: 3px 10px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text-muted);
}

/* ==========================================================================
   Key takeaways, debrief, plan
   ========================================================================== */
.takeaways-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-card);
  margin-bottom: 20px;
}
.takeaways-card ol {
  padding-left: 20px;
  margin: 12px 0 0;
}
.takeaways-card li {
  padding: 8px 0;
  color: var(--text);
  font-size: 0.98rem;
  line-height: 1.5;
}

.debrief-card {
  background: var(--accent-soft);
  border: 1px solid var(--accent-soft);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.debrief-card h3 { color: var(--accent); margin-bottom: 8px; }
.debrief-card p { color: var(--text); margin: 0; }

.plan-card {
  background: var(--grade-pass-bg);
  border: 1px solid var(--grade-pass-bg);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 20px;
}
.plan-card h3 { color: var(--grade-pass); margin-bottom: 8px; }
.plan-card p { color: var(--text); margin: 0; white-space: pre-wrap; }

/* ==========================================================================
   Recent sessions table
   ========================================================================== */
.session-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.session-table th, .session-table td {
  padding: 14px 20px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.session-table th {
  background: var(--surface-soft);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
}
.session-table tbody tr:last-child td { border-bottom: none; }
.session-table tbody tr:hover { background: var(--surface-soft); }
.session-table a { color: var(--text); font-weight: 500; }

/* ==========================================================================
   Utility
   ========================================================================== */
.row { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
.mb-32 { margin-bottom: 32px; }
.muted { color: var(--text-muted); }
.subtle { color: var(--text-subtle); }
.text-accent { color: var(--accent); }
.small { font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════════════ */
/*  Voice mode                                                              */
/* ═══════════════════════════════════════════════════════════════════════ */
.voice-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: #FFF4EF;
  border: 1px solid #F5D5C4;
  border-radius: 12px;
  margin: 12px 0 6px;
}
.voice-indicator {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  color: var(--text);
}
.voice-indicator kbd {
  display: inline-block;
  padding: 1px 8px;
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 0.78rem;
  font-weight: 600;
  background: #FFFFFF;
  border: 1px solid #E3D7CF;
  border-radius: 6px;
  box-shadow: 0 1px 0 #E3D7CF;
  color: var(--text);
}
.voice-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #C9C3BD;
  box-shadow: 0 0 0 0 rgba(201, 100, 66, 0.5);
  transition: background 0.2s;
}
.voice-indicator.is-recording .voice-dot {
  background: #E03A3A;
  animation: voice-pulse 1s ease-out infinite;
}
.voice-indicator.is-processing .voice-dot {
  background: var(--accent);
  animation: voice-spin 1.1s linear infinite;
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.15);
}
.voice-indicator.is-speaking .voice-dot {
  background: #2F8F4E;
  animation: voice-breathe 1.4s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(224, 58, 58, 0.55); }
  70%  { box-shadow: 0 0 0 12px rgba(224, 58, 58, 0); }
  100% { box-shadow: 0 0 0 0   rgba(224, 58, 58, 0); }
}
@keyframes voice-breathe {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.35); opacity: 0.7; }
}
@keyframes voice-spin {
  0%   { transform: rotate(0deg)   scale(1); }
  50%  { transform: rotate(180deg) scale(0.8); }
  100% { transform: rotate(360deg) scale(1); }
}

/* ==========================================================================
   Settings page
   ========================================================================== */
.mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border-strong);
}
.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-logout-form { display: inline; margin: 0; }
.nav-logout {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  cursor: pointer;
}
.nav-logout:hover { color: var(--accent); }
.nav-cta { color: var(--accent) !important; font-weight: 600; }

/* Exam countdown chip */
.exam-chip-row { margin: -28px 0 24px; }
.exam-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.exam-chip:hover { color: var(--accent-hover); }
.exam-chip-unset {
  background: var(--surface-soft);
  color: var(--text-muted);
  font-weight: 500;
}

/* Activity heatmap — single-hue sequential teal, light → dark */
.heatmap {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.hm-col { display: flex; flex-direction: column; gap: 3px; }
.hm-cell {
  width: 14px;
  height: 14px;
  border-radius: 5px;
  background: #eef4f2;
  flex: none;
}
.hm-1 { background: #bfe8de; }
.hm-2 { background: #6ecbb5; }
.hm-3 { background: var(--accent); }
.hm-4 { background: var(--accent-hover); }
.hm-future { visibility: hidden; }

/* Consistency sweep: tabular numerals everywhere numbers align */
.stat-value, .timer-display, .score-chip, .domain-score, .insight-count,
.weak-item-count, .num-input, .lp-mock-timer {
  font-variant-numeric: tabular-nums;
}

/* Soft teal focus rings, consistently */
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Insights — recurring patterns + Deep Insight report */
.insight-pattern-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.insight-pattern {
  padding: 14px 16px;
  border-top: 1px solid var(--hairline);
  border-left: 3px solid transparent;
}
.insight-pattern-list .insight-pattern:first-child { border-top: none; }
.insight-pattern.is-mandatory {
  border-left-color: var(--grade-fail);
  background: var(--grade-fail-bg);
}
.insight-pattern.is-advisory {
  border-left-color: var(--border-strong);
}
.insight-pattern-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: baseline;
  font-size: 0.8rem;
  margin-bottom: 4px;
}
.insight-domain {
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.insight-pattern.is-mandatory .insight-domain { color: var(--grade-fail); }
.insight-count { color: var(--text-muted); }
.insight-pattern-text { font-size: 0.95rem; line-height: 1.5; }
.insight-pattern.is-mandatory .insight-pattern-text { font-weight: 600; }

.insight-locked {
  padding: 24px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.insight-lock-icon { margin-right: 8px; }

.insight-report {
  border-top: 1px solid var(--hairline);
  padding-top: 20px;
  line-height: 1.65;
  max-width: 820px;
}
.insight-report h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 28px 0 10px;
  color: var(--accent);
}
.insight-report h2:first-child { margin-top: 0; }
.insight-report h3 { font-size: 1rem; margin: 20px 0 8px; }
.insight-report blockquote {
  margin: 10px 0;
  padding: 6px 16px;
  border-left: 3px solid var(--accent-soft);
  color: var(--text-muted);
}
.insight-report li { margin-bottom: 6px; }

/* ==========================================================================
   Landing page — lifted from prototype_1_landing.html (approved design).
   Scoped under body.lp-page; class names adapted with lg- prefix.
   ========================================================================== */
.lp-page { background: var(--surface); }
.lg-glow {
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(20,184,166,.10), transparent 60%),
    radial-gradient(700px 400px at 0% 30%, rgba(99,102,241,.05), transparent 55%);
}
.lg-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.lg-nav-in {
  max-width: 1160px;
  margin: 0 auto;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  gap: 16px;
}
.lg-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -.02em;
  color: var(--text);
}
.lg-logo span { color: var(--accent); }
.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-bright));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  box-shadow: 0 6px 14px -6px rgba(13,148,136,.5);
  flex: none;
}
.lg-nav-links { display: flex; gap: 32px; font-size: 14px; font-weight: 600; }
.lg-nav-links a { color: var(--text-muted); }
.lg-nav-links a:hover { color: var(--text); }
.lg-nav-cta { display: flex; gap: 14px; align-items: center; font-size: 14px; font-weight: 600; }
.lg-nav-cta .lg-signin { color: var(--text-muted); }
.btn-dark {
  background: var(--text);
  color: #fff !important;
  padding: 11px 22px;
  border-radius: 99px;
  box-shadow: 0 8px 18px -8px rgba(16,32,29,.45);
  font-weight: 600;
}
.lg-hero { text-align: center; padding: 96px 24px 40px; }
.lg-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent-soft);
  border: 1px solid #cdeee8;
  color: var(--accent-hover);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 9px 18px;
  border-radius: 99px;
  margin-bottom: 34px;
}
.lg-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(20,184,166,.18);
}
.lg-hero h1 {
  font-size: clamp(44px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.035em;
  font-weight: 800;
  max-width: 900px;
  margin: 0 auto 28px;
}
.lg-hero h1 .lg-grad {
  background: linear-gradient(90deg, var(--text) 0%, var(--accent) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--accent-hover);
  -webkit-text-fill-color: transparent;
}
.lg-sub {
  font-size: 20px;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 18px;
  line-height: 1.65;
}
.lg-free-line {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 700;
  color: var(--accent-hover);
  background: #effaf7;
  border: 1px solid #d4f0ea;
  padding: 10px 20px;
  border-radius: 99px;
  margin-bottom: 40px;
}
.lg-ctas { display: flex; gap: 16px; justify-content: center; margin-bottom: 80px; flex-wrap: wrap; }
.lg-btn-primary {
  background: var(--accent-solid);
  color: #fff !important;
  font-weight: 700;
  font-size: 16px;
  padding: 17px 34px;
  border-radius: 99px;
  box-shadow: 0 16px 30px -12px rgba(13,148,136,.5);
}
.lg-btn-ghost {
  background: #fff;
  border: 1px solid var(--hairline);
  color: var(--text) !important;
  font-weight: 600;
  font-size: 16px;
  padding: 17px 34px;
  border-radius: 99px;
}
.lg-consult-card {
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  padding: 56px 40px;
  box-shadow: 0 40px 80px -40px rgba(13,148,136,.25);
  position: relative;
  overflow: hidden;
  animation: lg-float 6s ease-in-out infinite;
  text-align: center;
}
@keyframes lg-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.lg-consult-card::after {
  content: '';
  position: absolute;
  top: -90px;
  right: -90px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(20,184,166,.10);
  filter: blur(40px);
}
.lg-listening {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 34px;
}
.lg-wave { display: flex; gap: 7px; align-items: center; justify-content: center; height: 56px; margin-bottom: 34px; }
.lg-wave i {
  display: block;
  width: 7px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  animation: lg-wv 1.4s ease-in-out infinite;
}
.lg-wave i:nth-child(1) { animation-delay: 0s; }
.lg-wave i:nth-child(2) { animation-delay: .25s; }
.lg-wave i:nth-child(3) { animation-delay: .5s; }
.lg-wave i:nth-child(4) { animation-delay: .15s; }
.lg-wave i:nth-child(5) { animation-delay: .4s; }
@keyframes lg-wv { 0%, 100% { height: 14px; } 50% { height: 52px; } }
.lg-speech {
  display: inline-block;
  background: var(--surface-soft);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  padding: 13px 24px;
  font-size: 15px;
  color: var(--text-muted);
  font-weight: 500;
}
.lg-strip {
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  padding: 36px 24px;
  display: flex;
  justify-content: center;
  gap: 70px;
  flex-wrap: wrap;
  background: #fff;
}
.lg-stat { display: flex; align-items: center; gap: 12px; }
.lg-stat b { font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.lg-stat span { font-size: 13px; color: var(--text-subtle); font-weight: 600; line-height: 1.35; }
.lg-sec { padding: 100px 24px; }
.lg-sec-head { text-align: center; max-width: 660px; margin: 0 auto 64px; }
.lg-sec-head h2 { font-size: 40px; font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; }
.lg-sec-head p { font-size: 18px; color: var(--text-muted); line-height: 1.65; }
.lg-free-band {
  max-width: 1060px;
  margin: 0 auto;
  background: linear-gradient(120deg, #f0faf7, #f6f9ff);
  border: 1px solid #d9efe9;
  border-radius: 28px;
  padding: 52px 56px;
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.lg-free-band h3 { font-size: 28px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 12px; }
.lg-free-band p { color: var(--text-muted); font-size: 16px; line-height: 1.7; max-width: 520px; }
.lg-free-badge {
  flex-shrink: 0;
  text-align: center;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  padding: 28px 34px;
  box-shadow: 0 20px 40px -24px rgba(13,148,136,.3);
}
.lg-free-badge b { display: block; font-size: 44px; font-weight: 800; color: var(--accent); }
.lg-free-badge span { font-size: 13px; color: var(--text-subtle); font-weight: 600; }
.lg-pricing { background: var(--surface-soft); }
.lg-tiers { display: flex; gap: 24px; justify-content: center; max-width: 1000px; margin: 0 auto; flex-wrap: wrap; }
.lg-tier {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 24px;
  padding: 40px 36px;
  width: 300px;
  text-align: center;
  position: relative;
}
.lg-tier.lg-popular { border: 2px solid var(--accent); box-shadow: 0 30px 60px -30px rgba(13,148,136,.35); }
.lg-tag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-solid);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 99px;
}
.lg-tier h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-subtle);
  text-transform: uppercase;
  letter-spacing: .1em;
  margin-bottom: 14px;
}
.lg-price { font-size: 46px; font-weight: 800; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.lg-per { font-size: 14px; color: var(--text-subtle); font-weight: 600; margin: 6px 0 22px; }
.lg-tier ul { list-style: none; font-size: 14px; color: var(--text-muted); line-height: 2.1; margin: 0 0 26px; padding: 0; }
.lg-tier a {
  display: block;
  background: var(--text);
  color: #fff !important;
  font-weight: 700;
  font-size: 15px;
  padding: 14px;
  border-radius: 99px;
}
.lg-tier.lg-popular a { background: var(--accent-solid); }
.lg-pricing-note { text-align: center; margin-top: 36px; font-size: 15px; color: var(--text-muted); }
.lg-pricing-note b { color: var(--accent-hover); }
.lg-dark-cta {
  max-width: 1000px;
  margin: 0 auto 100px;
  background: var(--ink-dark);
  border-radius: 36px;
  padding: 88px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.lg-dark-cta::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: rgba(20,184,166,.22);
  filter: blur(90px);
}
.lg-dark-cta h2 { color: #fff; font-size: clamp(34px, 4.5vw, 46px); font-weight: 800; letter-spacing: -.03em; margin-bottom: 18px; position: relative; }
.lg-dark-cta p { color: #a8bcb8; font-size: 17px; max-width: 560px; margin: 0 auto 38px; line-height: 1.7; position: relative; }
.lg-dark-cta a {
  position: relative;
  display: inline-block;
  background: #fff;
  color: var(--text) !important;
  font-weight: 700;
  font-size: 17px;
  padding: 18px 40px;
  border-radius: 99px;
}
.lg-footer {
  border-top: 1px solid var(--hairline);
  padding: 36px 24px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 1160px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--text-subtle);
}
@media (max-width: 720px) {
  .lg-nav-links { display: none; }
  .lg-hero { padding: 64px 20px 32px; }
  .lg-sec { padding: 64px 20px; }
  .lg-free-band { padding: 36px 24px; }
  .lg-strip { gap: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .lg-consult-card { animation: none; }
  .lg-wave i { animation: none; }
}


/* Auth pages (login / signup / account) */
.auth-wrap {
  display: flex;
  justify-content: center;
  padding: 48px 0;
}
.auth-card {
  width: 100%;
  max-width: 440px;
  padding: 40px;
}
.auth-title {
  font-weight: 600;
  letter-spacing: -0.02em;
  font-size: 1.7rem;
  margin: 4px 0 12px;
}
.auth-error {
  background: var(--grade-fail-bg);
  color: var(--grade-fail);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.9rem;
}

/* Settings — record-row layout: gutter label left, controls right,
   hairline dividers between groups. */
.settings-grid {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 12px 40px;
  margin-bottom: 32px;
}

.settings-card,
.card.settings-card {
  display: grid;
  grid-template-columns: 212px 1fr;
  column-gap: 24px;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 26px 0;
  border-top: 1px solid var(--hairline);
}
.settings-card:hover { box-shadow: none; }
.settings-grid > .settings-card:first-child { border-top: none; }
.settings-card > * { grid-column: 2; min-width: 0; }

.settings-h2 {
  grid-column: 1;
  grid-row: 1;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0;
  padding-top: 4px;
  line-height: 1.5;
}
.settings-card > .settings-h2 { grid-column: 1; }

.settings-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 16px 0 6px;
}

.settings-input {
  width: 100%;
  padding: 10px 12px;
  font-size: 0.95rem;
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.settings-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

input[type="range"] {
  width: 100%;
  margin: 10px 0 4px;
  accent-color: var(--accent);
}

.slider-markers {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-subtle);
  margin-bottom: 4px;
}

.settings-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.settings-tip {
  margin-top: 10px;
  font-style: italic;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* Toggle switch — a real checkbox under the hood; track/thumb are styling only */
.toggle-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}
.toggle-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.toggle-track {
  flex: none;
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--border-strong);
  position: relative;
  transition: background 0.15s ease;
}
.toggle-thumb {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: left 0.15s ease;
}
.toggle-input:checked + .toggle-track { background: var(--accent); }
.toggle-input:checked + .toggle-track .toggle-thumb { left: 20px; }
.toggle-input:focus-visible + .toggle-track {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* API key fields — monospace with a show/hide affordance */
.key-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.key-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  flex: 1;
}
.key-reveal {
  flex: none;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--hairline);
  background: none;
  color: var(--accent);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
}
.key-reveal:hover { background: var(--accent-soft); }
.key-reveal:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Numeric fields — right-aligned value with unit suffix */
.num-field {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 220px;
}
.num-input { text-align: right; }
.num-unit {
  color: var(--text-muted);
  font-size: 0.9rem;
  flex: none;
}

@media (max-width: 700px) {
  .settings-grid { padding: 4px 20px; }
  .settings-card { grid-template-columns: 1fr; padding: 20px 0; }
  .settings-card > * { grid-column: 1; }
  .settings-card > .settings-h2 { grid-column: 1; grid-row: auto; margin-bottom: 8px; }
}

.settings-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.settings-footer .mono { word-break: break-all; }

.settings-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: var(--shadow-elev);
  z-index: 1000;
}
.toast-ok  { background: var(--grade-pass-bg); color: var(--grade-pass); border: 1px solid var(--grade-pass); }
.toast-err { background: var(--grade-clear-fail-bg); color: var(--grade-clear-fail); border: 1px solid var(--grade-clear-fail); }

/* ==========================================================================
   Consultation-type badge + banner (telephone / video / face-to-face)
   ========================================================================== */
.ct-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
}
.ct-ftf {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-color: var(--border);
}
.ct-telephone {
  background: var(--accent-soft);
  color: var(--accent-hover);
  border-color: var(--accent-soft);
}
.ct-video {
  background: var(--grade-pass-bg);
  color: var(--grade-clear-pass);
  border-color: var(--grade-pass-bg);
}

.ct-icon {
  display: inline-block;
  margin-right: 6px;
  font-size: 1.1em;
  vertical-align: baseline;
}

.consult-banner {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid;
  margin: 0 0 16px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.consult-banner-telephone {
  background: var(--accent-soft);
  border-color: var(--accent-soft);
  color: var(--accent-hover);
}
.consult-banner-video {
  background: var(--grade-pass-bg);
  border-color: var(--grade-pass-bg);
  color: var(--grade-clear-pass);
}

/* "Practice mode" override block on the case page */
.mode-override {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin-bottom: 8px;
}

/* ==========================================================================
   Timing analysis panel (session review)
   ========================================================================== */
.timing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-card);
}
.timing-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.timing-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text);
}
.timing-total {
  font-size: 0.95rem;
  color: var(--text-muted);
}
.timing-total strong {
  color: var(--text);
  font-size: 1.05rem;
}

.phase-bar {
  position: relative;
  margin: 8px 0 18px;
}
.phase-bar-track {
  position: relative;
  display: flex;
  width: 100%;
  height: 48px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--border);
}
.phase-bar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 2px;
  color: #fff;
  font-size: 0.78rem;
  line-height: 1.15;
  padding: 4px 6px;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.4s ease;
}
.phase-bar-seg span {
  opacity: 0.9;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.phase-bar-seg strong {
  font-size: 0.92rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.phase-bar-dg {
  background: linear-gradient(135deg, #5A7FBF 0%, #4B6DA8 100%);
}
.phase-bar-mg {
  background: linear-gradient(135deg, var(--grade-pass) 0%, var(--grade-clear-pass) 100%);
}
.phase-bar-targets {
  position: relative;
  height: 22px;
  margin-top: 6px;
}
.phase-bar-target-band {
  position: absolute;
  top: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    rgba(201, 100, 66, 0.18),
    rgba(201, 100, 66, 0.18) 6px,
    rgba(201, 100, 66, 0.08) 6px,
    rgba(201, 100, 66, 0.08) 12px
  );
  border-left: 2px dashed var(--accent);
  border-right: 2px dashed var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}
.phase-bar-target-label {
  font-size: 0.7rem;
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
  background: var(--surface);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--accent-soft);
}
.phase-bar-scale {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-variant-numeric: tabular-nums;
}

.timing-flags {
  margin: 14px 0 0;
  padding: 14px 18px;
  list-style: none;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.timing-flags li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text);
  padding: 4px 0;
}
.timing-flags li + li {
  border-top: 1px dashed var(--border);
  margin-top: 4px;
  padding-top: 8px;
}

.timing-targets-details {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.timing-targets-details summary {
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  list-style: none;
}
.timing-targets-details summary::-webkit-details-marker {
  display: none;
}
.timing-targets-details summary::before {
  content: "▸ ";
  color: var(--accent);
  transition: transform 0.15s;
  display: inline-block;
}
.timing-targets-details[open] summary::before {
  content: "▾ ";
}

/* ==========================================================================
   Dashboard page
   ========================================================================== */

/* Section wrapper */
.dash-section {
  margin: 32px 0;
}
.dash-section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  gap: 16px;
  flex-wrap: wrap;
}
.dash-section-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.empty-panel {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 28px 32px;
  color: var(--text-muted);
  text-align: center;
}
.empty-panel pre {
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-radius: var(--radius-sm);
  display: inline-block;
  font-size: 0.8rem;
  color: var(--text);
  text-align: left;
}

/* ─── Header stat strip ─── */
.dash-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin: 24px 0 8px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.15s;
}
.stat-card:hover {
  box-shadow: var(--shadow-card-hover);
}
.stat-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.stat-value {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.stat-value-suffix {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-muted);
}
.stat-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ─── Window toggle (chart history range) ─── */
.window-toggle {
  display: inline-flex;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.window-btn {
  background: transparent;
  border: none;
  font: inherit;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s;
}
.window-btn:hover {
  color: var(--text);
}
.window-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ─── Chart container ─── */
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.chart-hint {
  margin: 12px 0 0;
  text-align: center;
}

/* ─── Weakness engine ─── */
.weak-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
}
.weak-card-tier1 {
  border-color: var(--accent);
  border-width: 1.5px;
  background: linear-gradient(135deg, var(--surface) 0%, var(--accent-soft) 200%);
}
.weak-card-tier1 .weak-card-header h3 {
  color: var(--accent);
}
.weak-card-header {
  margin-bottom: 14px;
}
.weak-card-header h3 {
  margin: 0 0 2px;
  font-size: 1rem;
  font-weight: 600;
}

.weak-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.weak-grid .weak-card {
  margin-bottom: 0;
}

.weak-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.weak-item {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.weak-item:first-child {
  border-top: none;
  padding-top: 4px;
}
.weak-item-main {
  flex: 1;
  min-width: 0;
}
.weak-item-text {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 500;
}
.weak-item-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.5;
}
.weak-item-meta strong {
  color: var(--text);
}
.weak-link {
  color: var(--accent);
  text-decoration: none;
  margin-left: 6px;
}
.weak-link:hover {
  text-decoration: underline;
}
.weak-item-count {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
  padding-top: 2px;
}
.weak-empty {
  font-size: 0.85rem;
  color: var(--text-subtle);
  padding: 8px 0 2px;
  font-style: italic;
}

.trend {
  font-size: 0.75rem;
  padding: 1px 7px;
  border-radius: 999px;
  font-weight: 600;
  display: inline-block;
}
.trend-up {
  background: #FBEEEC;
  color: var(--grade-clear-fail);
}
.trend-down {
  background: var(--grade-pass-bg);
  color: var(--grade-clear-pass);
}
.trend-flat {
  background: var(--surface-soft);
  color: var(--text-muted);
}

/* ─── Pacing row ─── */
.pacing-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.5;
  border: 1px solid;
  margin-top: 8px;
}
.pacing-on_track {
  background: var(--grade-pass-bg);
  border-color: #CBE4CF;
  color: var(--grade-clear-pass);
}
.pacing-data_gathering_long,
.pacing-management_short {
  background: #FBF3E8;
  border-color: #E8D6B8;
  color: #7A5520;
}
.pacing-icon {
  font-size: 1.1rem;
  flex-shrink: 0;
}

/* ─── Worst session this week card ─── */
.worst-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--grade-fail);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}
.worst-card-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
  margin-bottom: 4px;
}
.worst-card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.worst-card-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.worst-card-actions {
  display: flex;
  gap: 8px;
}

/* ─── Recent sessions list ─── */
.session-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.session-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 22px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}
.session-row:hover {
  box-shadow: var(--shadow-card-hover);
  transform: translateY(-1px);
  border-color: var(--border-strong);
}
.session-row-left {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}
.session-row-mode {
  font-size: 1.4rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.session-row-main {
  flex: 1;
  min-width: 0;
}
.session-row-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 2px;
}
.session-row-station {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-subtle);
  font-weight: 600;
}
.session-row-case {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 560px;
}
.session-row-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.cat-pill {
  display: inline-block;
  padding: 1px 8px;
  background: var(--surface-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  color: var(--text);
  font-weight: 500;
}
.cat-secondary {
  background: var(--surface-soft);
  color: var(--text-muted);
  border-style: dashed;
  border-width: 1px;
  border-color: var(--text-muted);
}
.top-stmt {
  font-style: italic;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 380px;
}
.session-row-phasebar {
  margin-top: 8px;
  height: 6px;
  border-radius: 999px;
  background: var(--surface-soft);
  overflow: hidden;
  display: flex;
  max-width: 260px;
}
.phase-mini-dg {
  background: linear-gradient(90deg, #5A7FBF, #4B6DA8);
  height: 100%;
}
.phase-mini-mg {
  background: linear-gradient(90deg, var(--grade-pass), var(--grade-clear-pass));
  height: 100%;
}
.session-row-right {
  flex-shrink: 0;
}
.status-pill {
  display: inline-block;
  padding: 4px 12px;
  background: var(--surface-soft);
  color: var(--text-muted);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* Buttons used on the dashboard (btn-primary already elsewhere, add -ghost fallback) */
.btn {
  display: inline-block;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

/* ─── History page ─── */
.history-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.history-toggle input[type="checkbox"] {
  accent-color: var(--accent);
}
.session-incomplete {
  opacity: 0.55;
}
.pill-progress {
  background: #E8C547;
  color: #3A3000;
}
.pill-unassessed {
  background: var(--border);
  color: var(--muted);
}

/* ==========================================================================
   Drill mode — smart case picker
   ========================================================================== */

.weak-item-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}
.grade-chip-sm {
  padding: 3px 10px;
  font-size: 0.72rem;
}

/* ==========================================================================
   Ask the Trainer — coaching panel
   ========================================================================== */
.coach-panel {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.coach-toggle {
  background: none;
  border: none;
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.coach-toggle:hover { opacity: 0.8; }

.coach-toggle-icon {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.coach-body { margin-top: 16px; }

.coach-messages {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.coach-msg {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
  max-width: 85%;
}
.coach-msg-user {
  background: var(--accent-soft);
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
}
.coach-msg-assistant {
  background: var(--surface-soft);
  color: var(--text);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
}

.coach-input-row {
  display: flex;
  gap: 8px;
}
.coach-input {
  flex: 1;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.coach-input:focus {
  outline: none;
  border-color: var(--accent);
}

.coach-model-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.model-btn {
  background: var(--surface-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s;
}
.model-btn.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.model-btn:hover { border-color: var(--accent); }

/* Markdown rendering inside coach messages */
.coach-msg-assistant p {
  margin: 0 0 8px;
}
.coach-msg-assistant p:last-child {
  margin-bottom: 0;
}
.coach-msg-assistant ol,
.coach-msg-assistant ul {
  margin: 4px 0 8px;
  padding-left: 20px;
}
.coach-msg-assistant li {
  margin-bottom: 4px;
}
.coach-msg-assistant strong {
  color: var(--text);
}
.coach-msg-assistant em {
  color: var(--accent);
}

.bubble-playing {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.bubble[data-turn-index]:hover {
  background: var(--accent-soft);
}

/* Small screens: the recent-sessions table on /cases scrolls inside itself */
@media (max-width: 700px) {
  .session-table {
    display: block;
    overflow-x: auto;
  }
}

/* Overview tab breathes: more space between the kept blocks */
#dashtab-overview .dash-section,
#dashtab-overview .dash-stats { margin-bottom: 56px; }
#dashtab-overview .exam-chip-row { margin-bottom: 32px; }

/* Item 5 — Past Attempts mode chips (replaces the emoji glyphs) */
.mode-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  flex: none;
}

/* Item 2 — landing mock: better-phrasing snippet + moderator prose */
.lp-better {
  margin-top: 10px;
  padding: 10px 14px;
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: var(--accent-hover);
}
.lp-better strong {
  display: block;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--accent);
}
.lp-mock-prose {
  border-top: 1px solid var(--hairline);
  margin: 16px 0 18px;
  padding-top: 14px;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Landing FAQ — accessible details/summary in the prototype language */
.lg-faq-list { max-width: 760px; margin: 0 auto; }
.lg-faq-list details { border-top: 1px solid var(--hairline); }
.lg-faq-list details:last-of-type { border-bottom: 1px solid var(--hairline); }
.lg-faq-list summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 16.5px;
  padding: 20px 4px;
  list-style-position: outside;
}
.lg-faq-list summary:hover { color: var(--accent-hover); }
.lg-faq-list p { color: var(--text-muted); line-height: 1.7; margin: 0 0 20px; padding: 0 4px; max-width: 680px; }

/* ==========================================================================
   Logged-in compact nav — lifted from prototype_2 nav language
   ========================================================================== */
.topbar-inner { height: 64px; padding: 0 28px; }
.brand.lg-logo { font-size: 17px; font-weight: 800; gap: 9px; }
.brand.lg-logo .logo-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; display: inline-flex; align-items: center; justify-content: center; }
.brand-teal { color: var(--accent); }
.nav-compact { gap: 26px; font-size: 13.5px; align-items: center; }
.nav-compact a { color: var(--text-subtle); font-weight: 600; }
.nav-compact a.on { color: var(--text); }
.nav-compact a:hover { color: var(--text); }

/* ==========================================================================
   Case page — lifted from prototype_2_case_page.html (records rail + avatar)
   ========================================================================== */
.cs-wrap {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  overflow: hidden;
  margin-top: 8px;
}
.cs-aside { border-right: 1px solid var(--hairline); padding: 36px 32px; background: var(--surface); }
.cs-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); margin: 14px 0 10px; }
.cs-name { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 4px; }
.cs-age { font-size: 15px; color: var(--text-muted); font-weight: 500; margin-bottom: 26px; }
.cs-rec-label { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 14px; }
.cs-rec { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; margin-bottom: 12px; overflow: hidden; }
.cs-rec summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}
.cs-rec summary::-webkit-details-marker { display: none; }
.cs-rec summary i { color: var(--text-subtle); font-style: normal; }
.cs-rec summary i::before { content: '▸'; }
.cs-rec[open] summary i::before { content: '▾'; }
.cs-rec-body { padding: 0 20px 18px; font-size: 14.5px; color: var(--text-muted); line-height: 1.75; white-space: pre-wrap; }
.cs-rec-body ul { list-style: none; margin: 0; padding: 0; }
.cs-rec-body li { padding-left: 16px; position: relative; }
.cs-rec-body li::before { content: ''; position: absolute; left: 0; top: 11px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-bright); }
.cs-read-btn {
  display: inline-block; margin: 14px 0 22px;
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  font-size: 13px; font-weight: 700; padding: 10px 18px; border-radius: 99px;
  text-decoration: none;
}
.cs-read-btn:hover, .cs-read-btn:focus-visible { border-color: var(--accent); color: var(--accent-hover); }

/* ── Recent-notes entries (shared with the written-case reader; prototype 7 .note) ── */
.cs-rec-notes { white-space: normal; }
.rn-note { padding: 16px 0; border-bottom: 1px solid #f0f5f4; }
.rn-note:first-child { padding-top: 4px; }
.rn-note:last-child { border-bottom: none; padding-bottom: 0; }
.rn-when { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #617471; margin-bottom: 6px; } /* 4.95:1 on white — --text-subtle fails AA at this size */
.rn-note p { margin: 0 0 8px; line-height: 1.75; }
.rn-note p:last-child { margin-bottom: 0; }
.cs-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  background: radial-gradient(700px 420px at 50% 6%, rgba(20,184,166,.07), transparent 60%);
}
.cs-avatar {
  width: 230px;
  height: 230px;
  border-radius: 50%;
  margin-bottom: 40px;
  position: relative;
  background: linear-gradient(135deg, #dff3ee, #eef4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 14px rgba(20,184,166,.07), 0 0 0 28px rgba(20,184,166,.035), 0 30px 60px -30px rgba(13,148,136,.35);
}
.cs-avatar b { font-size: 64px; font-weight: 800; color: var(--accent-hover); letter-spacing: -.02em; }
.cs-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-hover);
  padding: 7px 14px;
  box-shadow: 0 8px 16px -8px rgba(16,32,29,.25);
  white-space: nowrap;
}
.cs-ready { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 14px; text-align: center; }
.cs-ready-sub { font-size: 16px; color: var(--text-muted); line-height: 1.7; max-width: 460px; text-align: center; margin-bottom: 36px; }
.cs-form { width: 100%; max-width: 520px; display: flex; flex-direction: column; align-items: center; }
.cs-mode-select {
  width: 100%;
  margin-bottom: 14px;
  padding: 12px 16px;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 14px;
}
.cs-begin {
  width: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-solid));
  color: #fff;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  padding: 19px;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 20px 40px -16px rgba(13,148,136,.55);
  margin-bottom: 22px;
}
.cs-mic-chip { background: #fffbeb; border: 1px solid #f5e6b8; color: #8a6410; font-size: 13.5px; font-weight: 600; padding: 11px 22px; border-radius: 12px; margin-bottom: 14px; text-align: center; }
.cs-helper { font-size: 13.5px; color: var(--text-subtle); text-align: center; }
@media (max-width: 900px) {
  .cs-wrap { grid-template-columns: 1fr; }
  .cs-aside { border-right: none; border-bottom: 1px solid var(--hairline); }
  .cs-main { padding: 40px 20px; }
  .cs-avatar { width: 170px; height: 170px; }
  .cs-avatar b { font-size: 46px; }
}

/* ==========================================================================
   Dashboard — lifted from prototype_3_dashboard.html
   ========================================================================== */
.greet-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 8px 0 36px; }
.greet small { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); }
.greet h1 { font-size: clamp(30px, 3.5vw, 40px); font-weight: 800; letter-spacing: -.03em; margin: 6px 0 0; }
.greet h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--accent-hover);
  -webkit-text-fill-color: transparent;
}
.greet p { font-size: 15px; color: var(--text-muted); margin: 6px 0 0; }
.chips { display: flex; gap: 12px; flex-wrap: wrap; }
.chip { background: var(--surface); border: 1px solid var(--hairline); border-radius: 16px; padding: 14px 20px; text-align: center; min-width: 110px; color: var(--text); }
.chip small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-subtle); margin-bottom: 4px; }
.chip b { font-size: 22px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.chip b .u { font-size: 13px; color: var(--text-subtle); font-weight: 600; }
.chip .chip-set { font-size: 15px; color: var(--accent-hover); }
a.chip:hover { border-color: var(--accent); }

.pill-tabs { background: #eef4f2; border-radius: 99px; padding: 5px; margin-bottom: 36px; border-bottom: none; gap: 0; }
.pill-tabs .tab-btn {
  flex: 1;
  text-align: center;
  padding: 12px;
  border-radius: 99px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-subtle);
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.pill-tabs .tab-btn.active { background: var(--surface); color: var(--text); box-shadow: 0 6px 14px -8px rgba(16,32,29,.25); }

.dgrid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 20px; }
.dgrid > * { min-width: 0; }
.dg-full { grid-column: 1 / -1; }
.card2 { background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; padding: 28px 30px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.card-ic { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: none; }
.card-head h3 { font-size: 17px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.card-head small { display: block; font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); margin-top: 2px; }

.stats-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.mini { padding: 0 18px; border-right: 1px solid var(--hairline); }
.mini:first-child { padding-left: 0; }
.mini:last-child { border: none; }
.mini small { font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-subtle); }
.mini b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 2px; font-variant-numeric: tabular-nums; }
.mini b .mini-denom { font-size: 15px; color: var(--text-subtle); }
.mini span { font-size: 12.5px; color: var(--text-muted); font-weight: 600; }

.trend-wrap { position: relative; height: 190px; margin-top: 8px; }

.cal-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.streak-chip { display: inline-flex; align-items: center; gap: 7px; background: #fff4ec; border: 1px solid #f5dcc8; color: #9a4a33; font-weight: 700; font-size: 13px; padding: 7px 14px; border-radius: 99px; }

.topic { margin-bottom: 18px; }
.topic-last { margin-bottom: 0; }
.topic-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.topic-row b { font-weight: 700; }
.topic-row span { color: var(--text-subtle); font-size: 12.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bar { height: 9px; border-radius: 99px; background: #eef4f2; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-hover), var(--accent-bright)); }

.encourage {
  background: linear-gradient(90deg, #effaf7, #f2f6ff);
  border: 1px solid #d9efe9;
  border-radius: 18px;
  padding: 18px 26px;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-hover);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.encourage-link {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--accent-hover);
  font-family: inherit;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  white-space: nowrap;
}
.encourage-link:hover { color: var(--accent); }

@media (max-width: 900px) {
  .dgrid { grid-template-columns: 1fr; }
  .stats-row { grid-template-columns: 1fr 1fr; row-gap: 20px; }
  .mini:nth-child(2) { border-right: none; }
  .mini:nth-child(3) { padding-left: 0; }
  .greet-row { align-items: flex-start; flex-direction: column; }
}
@media (max-width: 480px) {
  .card2 { padding: 20px; }
  .mini { padding: 0 10px; }
  .mini b { font-size: 24px; }
  .topic-row { flex-wrap: wrap; }
  .topic-row span { white-space: normal; }
  .pill-tabs .tab-btn { font-size: 12.5px; padding: 10px 6px; }
}

/* ==========================================================================
   Auth — lifted from prototype_4_auth.html
   ========================================================================== */
.au-stage {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 70px 24px;
  background:
    radial-gradient(800px 500px at 80% 0%, rgba(20,184,166,.09), transparent 60%),
    radial-gradient(600px 400px at 5% 80%, rgba(99,102,241,.05), transparent 55%);
}
.au-card {
  width: 440px;
  max-width: 94vw;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 26px;
  padding: 48px 44px;
  box-shadow: 0 40px 80px -44px rgba(13,148,136,.35);
}
.au-logo { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 800; font-size: 19px; margin-bottom: 30px; color: var(--text); }
.au-logo span { color: var(--accent); }
.au-h1 { font-size: 27px; font-weight: 800; letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.au-sub { font-size: 14.5px; color: var(--text-muted); text-align: center; margin: 0 0 32px; line-height: 1.6; }
.au-card label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 8px;
}
.au-card input:not([type="hidden"]) {
  width: 100%;
  font-family: inherit;
  font-size: 15.5px;
  padding: 14px 18px;
  border: 1.5px solid var(--hairline);
  border-radius: 14px;
  margin-bottom: 20px;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.au-card input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(20,184,166,.12);
  background: var(--surface);
}
.au-card input.au-bad { border-color: var(--grade-clear-fail); }
.au-error {
  background: var(--grade-clear-fail-bg);
  color: var(--grade-clear-fail);
  border-radius: 12px;
  padding: 11px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 20px;
  line-height: 1.5;
}
.au-row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; margin: -6px 0 22px; }
.au-row span { color: var(--text-subtle); font-weight: 500; }
.au-btn {
  width: 100%;
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-solid));
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  padding: 16px;
  border: none;
  border-radius: 99px;
  cursor: pointer;
  box-shadow: 0 16px 32px -14px rgba(13,148,136,.55);
}
.au-switch { text-align: center; font-size: 14px; color: var(--text-muted); margin-top: 26px; }
.au-switch a { color: var(--accent-hover); font-weight: 700; }
.au-free-note {
  margin-top: 26px;
  background: #effaf7;
  border: 1px solid #d4f0ea;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 13.5px;
  color: var(--accent-hover);
  font-weight: 600;
  line-height: 1.6;
  text-align: center;
}
.au-back { text-align: center; margin-top: 22px; font-size: 13px; }
.au-back a { color: var(--text-subtle); font-weight: 600; }

/* ==========================================================================
   Case library — lifted from prototype_6_case_library.html
   ========================================================================== */
.lib-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin: 8px 0 28px; }
.lib-head small, .lib-progress small { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); }
.lib-head h1 { font-size: clamp(28px, 3.2vw, 36px); font-weight: 800; letter-spacing: -.03em; margin: 6px 0 0; }
.lib-head h1 em {
  font-style: normal;
  background: linear-gradient(90deg, var(--text), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: var(--accent-hover);
  -webkit-text-fill-color: transparent;
}
.lib-progress { text-align: right; }
.lib-progress b { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; display: block; }
.lib-progress b span { color: var(--text-subtle); font-size: 15px; font-weight: 600; }
.lib-progress small { display: block; margin-bottom: 6px; }
.pbar { width: 180px; height: 8px; border-radius: 99px; background: #eef4f2; margin-top: 8px; overflow: hidden; margin-left: auto; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-hover), var(--accent-bright)); }
.lib-controls { display: flex; gap: 12px; margin-bottom: 22px; flex-wrap: wrap; }
.lib-search {
  flex: 1;
  min-width: 220px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1.5px solid var(--hairline);
  border-radius: 99px;
  padding: 0 22px;
  color: var(--text-subtle);
}
.lib-search input { flex: 1; border: none; outline: none; background: none; font-family: inherit; font-size: 14.5px; padding: 13px 0; color: var(--text); }
.lib-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(20,184,166,.12); }
.lib-seg { display: flex; background: #eef4f2; border-radius: 99px; padding: 4px; }
.lib-seg button { padding: 10px 20px; border-radius: 99px; font-size: 13px; font-weight: 700; color: var(--text-subtle); cursor: pointer; border: none; background: none; font-family: inherit; }
.lib-seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 4px 10px -6px rgba(16,32,29,.3); }
.lib-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 36px; }
.lib-pill { font-size: 13px; font-weight: 700; padding: 9px 18px; border-radius: 99px; border: 1px solid var(--hairline); background: var(--surface); color: var(--text-muted); cursor: pointer; font-family: inherit; }
.lib-pill.on { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.lib-pill b { font-weight: 800; opacity: .6; margin-left: 4px; }
.lib-group { margin-bottom: 40px; }
.lib-group-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.lib-group-head h2 { font-size: 18px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
.lib-group-head .count { font-size: 12px; font-weight: 700; color: var(--text-subtle); white-space: nowrap; }
.lib-group-head .rule { flex: 1; height: 1px; background: var(--hairline); }
.lib-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.lib-card {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 20px 22px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  position: relative;
  color: var(--text);
  display: block;
}
.lib-card:hover { transform: translateY(-3px); box-shadow: 0 20px 36px -22px rgba(13,148,136,.35); border-color: #cde7e1; color: var(--text); }
.lib-card small { font-size: 10.5px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--text-subtle); }
.lib-card h3 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin: 7px 0 14px; line-height: 1.45; }
.lib-meta { display: flex; gap: 8px; align-items: center; }
.lib-tag { font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 99px; background: #f2f7f6; border: 1px solid var(--hairline); color: var(--text-muted); }
.lib-score { margin-left: auto; font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: 99px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lib-score.pass { background: var(--grade-pass-bg); color: var(--grade-clear-pass); }
.lib-score.fail { background: var(--grade-fail-bg); color: var(--grade-fail); }
.lib-score.todo { background: var(--surface); border: 1px dashed #cbdad6; color: var(--text-subtle); font-weight: 700; }
.lib-read { font-size: 11.5px; font-weight: 800; padding: 5px 11px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-hover); white-space: nowrap; }
.lib-read:hover, .lib-read:focus-visible { background: var(--accent-solid); color: #fff; }
.done-tick { position: absolute; top: 16px; right: 16px; width: 22px; height: 22px; border-radius: 50%; background: var(--grade-pass-bg); color: var(--grade-clear-pass); font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 800; }
@media (max-width: 900px) { .lib-cards { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .lib-cards { grid-template-columns: 1fr; } .lib-progress { text-align: left; } .pbar { margin-left: 0; } }

/* ==========================================================================
   Live session — lifted from prototype_5_session.html
   ========================================================================== */
.sx-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  background: rgba(255,255,255,.9);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  padding: 12px 22px;
  margin-bottom: 14px;
}
.sx-case { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.sx-case small { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--text-subtle); }
.sx-timer { display: flex; align-items: center; gap: 10px; background: #effaf7; border: 1px solid #d4f0ea; border-radius: 99px; padding: 8px 18px; }
.sx-timer b { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-hover); }
.sx-timer #timer-note { font-size: 12px; color: var(--text-subtle); font-weight: 600; }
.sx-timer .ring { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--accent) 100%, #dcebe8 0); flex: none; }
.sx-timer .ring::after { content: ''; display: block; width: 16px; height: 16px; border-radius: 50%; background: #effaf7; margin: 5px; }
.sx-timer .timer-warn { color: var(--grade-fail); }
.sx-timer .timer-danger { color: var(--grade-clear-fail); }
.sx-end {
  background: var(--surface);
  border: 1.5px solid #eddad6;
  color: #a3352c;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 10px 20px;
  border-radius: 99px;
  cursor: pointer;
}
.sx-banner { margin-bottom: 14px; }
.sx-stage {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 22px;
  overflow: hidden;
  min-height: 560px;
}
.sx-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px 40px;
  background: radial-gradient(600px 380px at 50% 20%, rgba(20,184,166,.08), transparent 60%);
}
.sx-avatar {
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: linear-gradient(135deg, #dff3ee, #eef4ff);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 26px;
  box-shadow: 0 0 0 0 rgba(20,184,166,.25);
}
.sx-avatar.is-speaking { animation: sx-pulse 2.4s ease-out infinite; }
@keyframes sx-pulse {
  0% { box-shadow: 0 0 0 0 rgba(20,184,166,.28); }
  70% { box-shadow: 0 0 0 26px rgba(20,184,166,0); }
  100% { box-shadow: 0 0 0 0 rgba(20,184,166,0); }
}
.sx-avatar b { font-size: 52px; font-weight: 800; color: var(--accent-hover); }
.sx-pt { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.sx-pt-sub { font-size: 13.5px; color: var(--text-subtle); font-weight: 600; margin-bottom: 30px; text-align: center; }
.sx-state {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 99px;
  padding: 13px 28px;
  box-shadow: 0 14px 30px -18px rgba(16,32,29,.25);
  margin-bottom: 18px;
}
.sx-indicator { display: flex; align-items: center; gap: 12px; }
.sx-indicator #voice-status-text { font-size: 14.5px; font-weight: 700; color: var(--accent-hover); }
.sx-wave { display: flex; gap: 4px; align-items: center; height: 22px; }
.sx-wave i { display: block; width: 4px; height: 6px; border-radius: 99px; background: var(--accent-bright); }
.sx-indicator.is-speaking .sx-wave i { animation: sx-wv 1.3s ease-in-out infinite; }
.sx-indicator.is-speaking .sx-wave i:nth-child(2) { animation-delay: .2s; }
.sx-indicator.is-speaking .sx-wave i:nth-child(3) { animation-delay: .4s; }
.sx-indicator.is-speaking .sx-wave i:nth-child(4) { animation-delay: .1s; }
.sx-indicator.is-recording .sx-wave i { background: var(--grade-clear-fail); height: 14px; }
@keyframes sx-wv { 0%, 100% { height: 6px; } 50% { height: 20px; } }
.sx-hint { font-size: 13px; color: var(--text-subtle); font-weight: 500; margin-bottom: 22px; text-align: center; }
.sx-controls { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sx-rail { border-left: 1px solid var(--hairline); background: var(--surface); display: flex; flex-direction: column; min-width: 0; }
.sx-rail-head {
  padding: 20px 24px;
  border-bottom: 1px solid var(--hairline);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-subtle);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sx-rail-head button {
  font-size: 11px;
  color: var(--accent-hover);
  letter-spacing: .06em;
  background: none;
  border: none;
  font-family: inherit;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}
.sx-feed { flex: 1; padding: 22px 24px; display: flex; flex-direction: column; gap: 14px; overflow: auto; max-height: 460px; }
.sx-feed .bubble { max-width: 88%; font-size: 14px; line-height: 1.6; padding: 12px 16px; border-radius: 16px; }
.sx-feed .bubble::before {
  display: block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-bottom: 4px;
  opacity: .65;
}
.sx-feed .bubble-doctor { align-self: flex-end; background: var(--accent-hover); color: #eafaf6; border-bottom-right-radius: 4px; }
.sx-feed .bubble-doctor::before { content: 'You'; }
.sx-feed .bubble-patient { align-self: flex-start; background: #f2f7f6; color: var(--text); border: 1px solid var(--hairline); border-bottom-left-radius: 4px; }
.sx-feed .bubble-patient::before { content: 'Patient'; }
.sx-input { padding: 14px 18px; border-top: 1px solid var(--hairline); margin: 0; }
.sx-rail-foot { padding: 14px 24px; border-top: 1px solid var(--hairline); font-size: 12.5px; color: var(--text-subtle); font-weight: 600; text-align: center; }
@media (max-width: 900px) {
  .sx-stage { grid-template-columns: 1fr; }
  .sx-rail { border-left: none; border-top: 1px solid var(--hairline); }
  .sx-main { padding: 36px 20px; }
  .sx-avatar { width: 140px; height: 140px; }
  .sx-avatar b { font-size: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .sx-avatar.is-speaking { animation: none; }
  .sx-indicator.is-speaking .sx-wave i { animation: none; height: 14px; }
}

/* ══════════════════ Written-case reader (/case/N/read — prototype 7) ══════════════════ */
.rd-bar {
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hairline);
  min-height: 64px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 28px;
  position: sticky; top: 64px; z-index: 40;
  margin: -24px -28px 0;
}
.rd-crumb { font-size: 13px; font-weight: 600; color: var(--text-subtle); }
.rd-crumb a { color: var(--text-subtle); }
.rd-crumb b { color: var(--text); font-weight: 700; }
.rd-bar-actions { display: flex; gap: 10px; align-items: center; flex-shrink: 0; }
.rd-btn-ghost {
  background: var(--surface); border: 1px solid var(--hairline); color: var(--text);
  font-family: inherit; font-size: 13px; font-weight: 700; padding: 10px 18px;
  border-radius: 99px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.rd-btn-solid {
  background: linear-gradient(90deg, var(--accent-hover), var(--accent-solid)); color: #fff;
  border: none; font-family: inherit; font-size: 13px; font-weight: 700; padding: 11px 20px;
  border-radius: 99px; cursor: pointer; text-decoration: none; white-space: nowrap;
}
.rd-page {
  max-width: 880px; margin: 0 auto; padding: 44px 0 80px;
  background: radial-gradient(600px 320px at 90% -5%, rgba(20,184,166,.06), transparent 60%);
}
.rd-head { margin-bottom: 30px; }
.rd-head small { font-size: 11px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--text-subtle); }
.rd-head h1 { font-size: 34px; font-weight: 800; letter-spacing: -.03em; margin: 8px 0 0; }
.rd-meta { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.rd-tag { font-size: 12px; font-weight: 700; padding: 6px 14px; border-radius: 99px; background: #f2f7f6; border: 1px solid var(--hairline); color: var(--text-muted); }
.rd-timer-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: var(--surface); border: 1px solid var(--hairline); border-radius: 20px;
  padding: 18px 24px; margin-bottom: 30px;
  box-shadow: 0 16px 32px -24px rgba(13,148,136,.3);
}
.rd-timer-left { display: flex; align-items: center; gap: 16px; }
.rd-timer-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.rd-timer-left h3 { font-size: 15px; font-weight: 800; margin: 0; }
.rd-timer-left p { font-size: 12.5px; color: var(--text-subtle); font-weight: 600; margin: 0; }
.rd-timer-right { display: flex; align-items: center; gap: 14px; }
.rd-clock { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--accent-hover); min-width: 110px; text-align: right; }
.rd-clock-low { color: #a3352c; }
.rd-tabs {
  display: flex; background: #eef4f2; border-radius: 99px; padding: 5px; margin-bottom: 30px;
  position: sticky; top: 140px; z-index: 30;
}
.rd-tab {
  flex: 1; text-align: center; padding: 13px; border: none; background: none;
  border-radius: 99px; font-family: inherit; font-size: 14px; font-weight: 700;
  color: var(--text-subtle); cursor: pointer;
}
.rd-tab.on { background: var(--surface); color: var(--text); box-shadow: 0 6px 14px -8px rgba(16,32,29,.25); }
.rd-tab small { display: block; font-size: 10px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; opacity: .6; }
.rd-doc { background: var(--surface); border: 1px solid var(--hairline); border-radius: 22px; padding: 40px 44px; }
.rd-doc h2 {
  font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--hairline);
}
.rd-doc h2.rd-sec-gap { margin-top: 34px; }
.rd-kv { display: grid; grid-template-columns: 190px 1fr; gap: 0; margin: 0; }
.rd-kv dt { font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--text-subtle); padding: 14px 0; border-bottom: 1px solid #f0f5f4; }
.rd-kv dd { font-size: 15px; line-height: 1.75; color: var(--text-muted); padding: 14px 0 14px 12px; border-bottom: 1px solid #f0f5f4; margin: 0; }
.rd-kv dt:last-of-type, .rd-kv dd:last-of-type { border-bottom: none; }
.rd-doc .rn-note p, .rd-para, .rd-list li { font-size: 15px; line-height: 1.75; color: var(--text-muted); }
.rd-para { margin: 0 0 12px; }
.rd-mark-head { margin-top: 14px; }
.rd-list { margin: 0 0 8px; padding-left: 20px; }
.rd-list li { margin-bottom: 6px; }
.rd-pager { display: flex; justify-content: space-between; margin-top: 26px; }
.rd-pager a { font-size: 14px; font-weight: 700; color: var(--accent); text-decoration: none; }
.rd-locknote { margin-top: 30px; text-align: center; font-size: 13px; color: var(--text-subtle); font-weight: 600; }

@media (max-width: 720px) {
  .rd-bar { flex-wrap: wrap; margin: -24px -16px 0; padding: 10px 16px; position: static; }
  .rd-tabs { position: static; }
  .rd-timer-card { flex-direction: column; align-items: flex-start; }
  .rd-timer-right { width: 100%; justify-content: space-between; }
  .rd-clock { text-align: left; min-width: 0; }
  .rd-doc { padding: 26px 20px; }
  .rd-kv { grid-template-columns: 1fr; }
  .rd-kv dt { padding-bottom: 2px; border-bottom: none; }
  .rd-kv dd { padding-top: 0; padding-left: 0; }
  .rd-head h1 { font-size: 27px; }
  .rd-tab { font-size: 13px; padding: 11px 6px; }
}

/* ══════════════════ Free prep-sheet band (landing) ══════════════════ */
.lg-prep-band {
  max-width: 1060px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 28px;
  padding: 44px 56px;
  display: flex;
  gap: 48px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.lg-prep-band h3 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 10px; }
.lg-prep-band p { color: var(--text-muted); font-size: 16px; line-height: 1.7; max-width: 560px; }
.lg-prep-btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 700px) {
  .lg-prep-band { padding: 32px 24px; }
  .lg-prep-btn { white-space: normal; width: 100%; text-align: center; }
}

/* ══════════════════ Terms and Conditions / legal pages ══════════════════ */
.tc-page { max-width: 70ch; margin: 0 auto; padding: 40px 0 80px; }
.tc-page h1 { font-size: 30px; font-weight: 800; letter-spacing: -.02em; margin-bottom: 18px; }
.tc-page h2 {
  font-size: 17px; font-weight: 800; letter-spacing: -.01em;
  margin: 34px 0 10px; padding-top: 8px; scroll-margin-top: 84px;
}
.tc-page p { font-size: 15px; line-height: 1.8; color: var(--text-muted); margin: 0 0 12px; }
.tc-page p strong { color: var(--text); }
.tc-anchor { color: var(--accent); text-decoration: none; margin-right: 4px; }
.tc-anchor:hover { text-decoration: underline; }
.tc-updated { font-weight: 700; color: var(--text); }
.tc-draft-note {
  background: #fff7e6; border: 1px solid #f3e2b6; border-radius: 10px;
  padding: 10px 14px; font-size: 13.5px; color: #8a6410;
}
mark.ph {
  background: #fff1c9; color: #8a6410; font-weight: 700;
  padding: 1px 5px; border-radius: 5px; border: 1px solid #f3e2b6;
}

/* signup agreement line */
.au-terms-note { margin-top: 10px; font-size: 12.5px; color: var(--text-subtle); text-align: center; }
.au-terms-note a { color: var(--accent-hover); font-weight: 700; }

/* ══════════════════ Credits (phase 1) ══════════════════ */
.nav-credits {
  background: var(--accent-soft); color: var(--accent-hover) !important;
  font-weight: 800; font-size: 12.5px; padding: 7px 14px; border-radius: 99px;
  white-space: nowrap;
}
.nav-credits:hover { background: var(--accent-solid); color: #fff !important; }
.cs-cost-row {
  display: flex; gap: 10px; align-items: center; margin-top: 14px;
  font-size: 13px; color: var(--text-muted); font-weight: 600;
}
.cs-cost-row b { color: var(--text); }
.cs-cost-sep { color: var(--text-subtle); }
.credits-sheet-backdrop {
  position: fixed; inset: 0; background: rgba(16,32,29,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.credits-sheet {
  background: var(--surface); border-radius: 22px; padding: 34px 36px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: 0 30px 60px -20px rgba(16,32,29,.4);
}
.credits-sheet-ic {
  width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 14px;
  background: var(--accent-soft); color: var(--accent); font-size: 24px;
  display: flex; align-items: center; justify-content: center;
}
.credits-sheet h3 { font-size: 21px; font-weight: 800; margin-bottom: 8px; }
.credits-sheet p { color: var(--text-muted); font-size: 14.5px; line-height: 1.65; margin-bottom: 20px; }
.credits-sheet-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* admin credits + account history tables */
.ac-table-wrap { overflow-x: auto; }
.ac-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ac-table th {
  text-align: left; font-size: 10.5px; font-weight: 800; letter-spacing: .1em;
  text-transform: uppercase; color: #617471; padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hairline);
}
.ac-table td { padding: 10px 12px 10px 0; border-bottom: 1px solid #f0f5f4; color: var(--text-muted); vertical-align: top; }
.ac-table tr:last-child td { border-bottom: none; }
.ac-user-link { font-weight: 700; color: var(--accent-hover); }
.ac-pos { color: var(--grade-clear-pass); font-weight: 800; }
.ac-neg { color: var(--grade-fail); font-weight: 800; }
.ac-balance-row { display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap; }
.ac-balance b { font-size: 30px; font-weight: 800; margin-right: 6px; }
.ac-balance span { color: var(--text-muted); font-weight: 600; }
.ac-grant-row { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 14px; }
@media (max-width: 700px) { .ac-grant-row { grid-template-columns: 1fr; } }
.lg-pricing-honesty { font-size: 13.5px; color: #617471; margin-top: 6px; } /* 4.7:1 on the pricing band — --text-subtle fails AA at this size */

/* hosted hardening: suspension + auth notices */
.ac-susp-badge { display: inline-block; margin-left: 8px; font-size: 10.5px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; padding: 3px 9px; border-radius: 99px; background: var(--grade-fail-bg); color: var(--grade-fail); }
.ac-susp-form { display: flex; gap: 8px; align-items: center; }
.ac-susp-note { max-width: 170px; font-size: 12.5px; }
.au-notice { background: var(--accent-soft); border: 1px solid #cfe9e3; color: var(--accent-hover); border-radius: 12px; padding: 11px 15px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.au-beta-note { font-size: 12.5px; color: #617471; margin: -6px 0 12px; }
