/* ============================================================
   Editorial design layer — loaded after every other theme file.

   Direction: Swiss / editorial. Warm paper and ink, one signal colour,
   hairline rules instead of shadows, tight type with a serif for display,
   mono for numbers. No gradients, glass, glow or blobs.
   Light and dark share the same hierarchy; only the values change.
   ============================================================ */

:root {
  color-scheme: light;

  --font-body: 'Geist', 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-heading: 'Geist', 'Inter', -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-mono: 'Geist Mono', 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --bg: #f3f0e8;
  --bg-2: #ebe7dc;
  --surface: #faf8f3;
  --surface-2: #f3f0e8;
  --surface-hover: #ebe7dc;
  --border: #dcd7c9;
  --border-strong: #14130f;

  --text: #14130f;
  --text-dim: #55534a;
  --text-faint: #6b695f;
  --text-secondary: #55534a;

  --accent: #c93b17;
  --accent-hover: #a82f10;
  --accent-soft: rgba(201, 59, 23, 0.09);
  --accent-ink: #ffffff;

  --blue: #14130f;
  --blue-soft: rgba(20, 19, 15, 0.06);
  --purple: #14130f;
  --purple-soft: rgba(20, 19, 15, 0.06);
  --cyan: #55534a;
  --cyan-soft: rgba(20, 19, 15, 0.06);
  --success: #2f6b3f;
  --success-soft: rgba(47, 107, 63, 0.10);
  --warning: #8a5a00;
  --warning-soft: rgba(138, 90, 0, 0.10);
  --danger: #b3261e;
  --danger-soft: rgba(179, 38, 30, 0.09);

  --radius-xs: 2px;
  --radius-sm: 3px;
  --radius: 4px;
  --radius-lg: 6px;
  --radius-xl: 6px;

  --shadow-xs: none;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: 0 12px 32px rgba(20, 19, 15, 0.14);
  --shadow-xl: 0 20px 48px rgba(20, 19, 15, 0.18);
  --glow-brand: none;
  --gradient-brand: var(--accent);
  --gradient-brand-soft: var(--accent-soft);
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #0d0d0b;
  --bg-2: #141412;
  --surface: #131311;
  --surface-2: #1a1a17;
  --surface-hover: #22221e;
  --border: #2b2a25;
  --border-strong: #ecebe4;

  --text: #ecebe4;
  --text-dim: #a8a69b;
  --text-faint: #8f8d82;
  --text-secondary: #a8a69b;

  --accent: #ff6a3d;
  --accent-hover: #ff8a63;
  --accent-soft: rgba(255, 106, 61, 0.12);
  --accent-ink: #14130f;

  --blue: #ecebe4;
  --blue-soft: rgba(236, 235, 228, 0.07);
  --purple: #ecebe4;
  --purple-soft: rgba(236, 235, 228, 0.07);
  --cyan: #a8a69b;
  --cyan-soft: rgba(236, 235, 228, 0.07);
  --success: #6fc287;
  --success-soft: rgba(111, 194, 135, 0.12);
  --warning: #e0a53a;
  --warning-soft: rgba(224, 165, 58, 0.12);
  --danger: #f06b60;
  --danger-soft: rgba(240, 107, 96, 0.12);

  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.55);
  --shadow-xl: 0 20px 48px rgba(0, 0, 0, 0.6);
}

/* ---------- Base ---------- */
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}
.ambient-blob { display: none !important; }

h1, h2, h3, h4, .card-title, .page-title {
  font-family: var(--font-heading);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text);
}
.grad-text,
.brand-text h1 span {
  background: none;
  -webkit-text-fill-color: currentColor;
  color: var(--accent);
}
:root[data-theme="dark"] .brand-text h1 span { color: var(--accent); }

/* Flatten everything that was glass, glow or gradient */
.card, .grid > .card, .modal, .job-details-modal, .stat-card, .dashboard-hero,
.sidebar, .topbar, .tracker-col, .tracker-card, .mi-bubble-ai, .mi-bubble-you,
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .grid > .card,
:root[data-theme="dark"] .sidebar,
:root[data-theme="dark"] .topbar,
:root[data-theme="dark"] .dashboard-hero,
:root[data-theme="dark"] .tracker-col,
:root[data-theme="dark"] .tracker-card {
  background: var(--surface);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.card:hover, .stat-card:hover, .grid > .card:hover { transform: none; box-shadow: none; border-color: var(--border-strong); }
.card::before, .card::after, .dashboard-hero::before, .dashboard-hero::after { display: none; }

/* ---------- Card headings: small mono label, no decorative dash ---------- */
.card-title { font-size: 15px; display: flex; align-items: center; gap: 8px; }
.card-title::after { display: none; }
.card-title i { color: var(--text-dim) !important; font-size: 14px; }
.card-sub, .text-dim { color: var(--text-dim); }

/* ---------- Shell ---------- */
.sidebar { border-radius: 0; border: 0; border-right: 1px solid var(--border); background: var(--bg); }
.topbar { border-radius: 0; border: 0; border-bottom: 1px solid var(--border); background: var(--bg); }
.page-title { font-size: 20px; }
.page-subtitle { color: var(--text-dim); }

.brand-logo, .user-avatar, .chatbot-avatar, .auth-logo {
  background: var(--text);
  color: var(--bg);
  box-shadow: none;
  border-radius: var(--radius);
}
.brand-text h1 { font-weight: 700; letter-spacing: -0.03em; }
.brand-text p, .nav-section {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

.nav-link {
  border-radius: var(--radius);
  color: var(--text-dim);
  font-weight: 500;
  border-left: 2px solid transparent;
  transition: color 120ms, background-color 120ms;
}
.nav-link:hover { background: var(--surface-hover); color: var(--text); transform: none; }
.nav-link.active {
  background: transparent;
  color: var(--text);
  font-weight: 600;
  box-shadow: none;
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.nav-link.active .nav-icon { color: var(--accent); }

/* ---------- Buttons: ink fill, accent only for emphasis states ---------- */
.btn { border-radius: var(--radius); font-weight: 500; letter-spacing: -0.005em; box-shadow: none; }
.btn:hover { transform: none; }
.btn-primary, .btn-accent,
:root[data-theme="dark"] .btn-primary {
  background: var(--text);
  color: var(--bg);
  border: 1px solid var(--text);
  box-shadow: none;
  background-image: none;
}
.btn-primary:hover, .btn-accent:hover,
:root[data-theme="dark"] .btn-primary:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-ghost, .btn-outline,
:root[data-theme="dark"] .btn-ghost,
:root[data-theme="dark"] .btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.btn-ghost:hover, .btn-outline:hover,
:root[data-theme="dark"] .btn-ghost:hover,
:root[data-theme="dark"] .btn-outline:hover { background: var(--surface-hover); border-color: var(--border-strong); }

/* ---------- Chips: neutral, outlined. Colour only where it carries meaning ---------- */
.chip, .chip.blue, .chip.purple, .chip.cyan, .chip.green, .chip.gray,
:root[data-theme="dark"] .chip.green, :root[data-theme="dark"] .chip.blue, :root[data-theme="dark"] .chip.purple {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.chip.orange, .chip.red { color: var(--danger); border-color: currentColor; }
.chip.yellow { color: var(--warning); border-color: currentColor; }

/* ---------- Inputs ---------- */
input, select, textarea,
:root[data-theme="dark"] input, :root[data-theme="dark"] select, :root[data-theme="dark"] textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }

/* ---------- Numbers: mono, tabular ---------- */
.card-stat, .hero-num b, .stat-value, .mini-val {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  color: var(--text);
}
.card-stat-label, .hero-num span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Dashboard hero: serif headline, plain ring ---------- */
.dashboard-hero { background: var(--surface); border-color: var(--border); padding-block: 28px; }
.hero-msg h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.015em;
}
.hero-ring .bg { stroke: var(--border); }
.hero-ring .fg { stroke: var(--accent); stroke-linecap: butt; }
#readinessGradient stop { stop-color: var(--accent); }
.hero-num b { font-size: 30px; }

/* Progress bars: flat, thin */
.progress, .progress-bar, .mini-bar { height: 4px; overflow: hidden; border-radius: 0; background: var(--border); }
.progress-fill, .mini-fill { background: var(--accent); border-radius: 0; background-image: none; }

/* Skill heat map: one ink ramp instead of a green one */
.heat-cell.l1 { background: color-mix(in srgb, var(--text) 10%, var(--surface)); border-color: var(--border); }
.heat-cell.l2 { background: color-mix(in srgb, var(--text) 28%, var(--surface)); border-color: var(--border); }
.heat-cell.l3 { background: color-mix(in srgb, var(--text) 55%, var(--surface)); border-color: var(--border); }
.heat-cell.l4 { background: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .heat-cell.l1,
:root[data-theme="dark"] .heat-cell.l2,
:root[data-theme="dark"] .heat-cell.l3 { border-color: var(--border); }
:root[data-theme="dark"] .heat-cell.l4 { background: var(--accent); border-color: var(--accent); }
:root[data-theme="dark"] .heat-cell.l1 { background: color-mix(in srgb, var(--text) 10%, var(--surface)); }
:root[data-theme="dark"] .heat-cell.l2 { background: color-mix(in srgb, var(--text) 28%, var(--surface)); }
:root[data-theme="dark"] .heat-cell.l3 { background: color-mix(in srgb, var(--text) 55%, var(--surface)); }

/* Chat launcher + user bubbles */
.chatbot-fab { background: var(--text); color: var(--bg); box-shadow: var(--shadow-lg); }
.msg.user { background: var(--text); color: var(--bg); }

/* Links */
a:not(.btn):not(.nav-link):not(.chip):not(.brand) { color: var(--accent); }

/* Toast + modal overlays keep their lift so they separate from the page */
.toast, .modal, .job-details-modal { box-shadow: var(--shadow-lg); }

@media (prefers-reduced-motion: reduce) {
  .card, .btn, .nav-link { transition: none !important; }
}

/* ---------- Overrides for rules the older sheets pinned to a dark-green sidebar ---------- */
.sidebar .brand-text h1,
.sidebar .brand-text p,
.sidebar .nav-link,
.sidebar .mini-label,
.sidebar .footer-note { color: var(--text); }
.sidebar .brand-text p,
.sidebar .mini-label,
.sidebar .footer-note,
.sidebar .nav-section { color: var(--text-faint); }
.sidebar .nav-link { color: var(--text-dim); }
.sidebar .nav-link:hover,
.sidebar .nav-link.active { color: var(--text); }
.sidebar .brand-text h1 span,
.sidebar .mini-val { color: var(--accent); }
.sidebar .footer-note a { color: var(--text-dim); text-decoration: underline; text-underline-offset: 3px; }
.sidebar .footer-note a:hover { color: var(--accent); }
.brand { border-bottom-color: var(--border); }
.sidebar .mini-bar { background: var(--border); }

.hero-ring svg circle.bg { stroke: var(--border); }
.hero-ring svg circle.fg { stroke: var(--accent); stroke-linecap: butt; }

/* Stat values read as ink; colour is kept for the one number that is the point */
.card-stat.text-accent, .card-stat.text-success, .card-stat.text-warning { color: var(--text) !important; }

/* Pills become plain rectangles, like everything else */
.date-badge, .user-badge { border-radius: var(--radius); background: transparent; box-shadow: none; border: 1px solid var(--border); }
.date-badge { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.02em; }

/* Dark-mode shell: the dark sheet rounded and boxed these; keep them as flat bars */
:root[data-theme="dark"] .sidebar { border: 0; border-right: 1px solid var(--border); border-radius: 0; background: var(--bg); }
:root[data-theme="dark"] .topbar { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; background: var(--bg); }

/* Drop zone: hairline dashes, accent only while dragging */
.drop-zone { border: 1px dashed var(--text-faint); }

/* Filter rows (Coding, Company Patterns, Interview wall): selects sit side by side and wrap on small screens.
   .filter-bar had no rule at all, so every control stacked at full width. */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 12px;
}
.filter-bar > select,
.filter-bar > input {
  flex: 1 1 180px;
  min-width: 0;
  width: auto;
}
.filter-bar > input[type="search"],
.filter-bar > input[type="text"] { flex: 2 1 240px; }

/* Timed quiz countdown */
#quizTimer { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.timer-low { color: var(--danger); }
.sidebar .mini-fill { background: var(--accent); }

/* ---------- Live interview room ---------- */
.iv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.iv-stage { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.iv-tile {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.iv-tile video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); background: #000; }
.iv-empty { position: relative; color: var(--text-faint); font-size: 13px; }
.iv-name { position: absolute; left: 12px; bottom: 10px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text); background: var(--bg); padding: 2px 8px; border-radius: var(--radius-sm); }
.iv-me.iv-live { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.iv-interviewer { flex-direction: column; gap: 14px; }
.iv-avatar {
  width: 84px; height: 84px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-display); font-size: 44px; line-height: 1;
  background: var(--text); color: var(--bg);
  transition: box-shadow 160ms;
}
.iv-avatar.iv-speaking { animation: ivPulse 1.1s ease-in-out infinite; }
.iv-avatar.iv-thinking { opacity: 0.6; }
@keyframes ivPulse { 0%, 100% { box-shadow: 0 0 0 0 var(--accent-soft), 0 0 0 0 transparent; } 50% { box-shadow: 0 0 0 10px var(--accent-soft), 0 0 0 20px transparent; } }
@media (prefers-reduced-motion: reduce) { .iv-avatar.iv-speaking { animation: none; box-shadow: 0 0 0 6px var(--accent-soft); } }
.iv-state { font-size: 13px; color: var(--text-dim); text-align: center; padding: 0 12px; }
.iv-meter { position: absolute; right: 12px; bottom: 14px; width: 90px; height: 4px; background: var(--border); }
.iv-meter i { display: block; height: 100%; width: 0; background: var(--accent); transition: width 80ms linear; }
.iv-check .iv-meter { position: static; width: 100%; margin-top: 10px; }
.iv-preview { aspect-ratio: 16 / 9; }
.iv-captions { margin-top: 16px; border-top: 1px solid var(--text); padding-top: 14px; min-height: 120px; }
.iv-q { font-family: var(--font-display); font-size: clamp(22px, 2.6vw, 30px); line-height: 1.2; }
.iv-a { margin-top: 10px; color: var(--text-dim); font-size: 14.5px; min-height: 22px; }
.iv-captions textarea { width: 100%; margin-top: 10px; }
.iv-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.iv-hero { display: flex; gap: 28px; align-items: center; }
.iv-overall { display: flex; flex-direction: column; min-width: 120px; }
.iv-overall b { font-family: var(--font-mono); font-size: 64px; font-weight: 500; line-height: 1; letter-spacing: -0.04em; }
.iv-overall span { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-faint); margin-top: 6px; }
.iv-score { margin-top: 12px; }
.iv-score-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
.iv-list { margin: 8px 0 0 18px; line-height: 1.6; }
.iv-pq { padding: 12px 0; border-top: 1px solid var(--border); }
.iv-pq p { margin-top: 4px; font-size: 14px; }
@media (max-width: 680px) {
  .iv-stage { grid-template-columns: 1fr; }
  .iv-hero { flex-direction: column; align-items: flex-start; gap: 12px; }
}

[hidden] { display: none !important; }

.iv-speed { display: inline-flex; align-items: center; gap: 8px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-dim); }
.iv-speed select { width: auto; min-height: 36px; padding: 4px 8px; font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-size: 13px; }

/* Device and speech warnings: impossible to miss, still on-brand */
.iv-alert { margin: 10px 0; padding: 10px 12px; border-left: 3px solid var(--warning); background: var(--warning-soft); color: var(--text); font-size: 13.5px; line-height: 1.5; }
.iv-alert[hidden] { display: none; }

/* ---------- Coding practice: ways to solve it + how the work grows ---------- */
.cx-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.cx-tab { font: inherit; font-size: 13px; padding: 6px 10px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); border-radius: var(--radius); cursor: pointer; }
.cx-tab.active { border-color: var(--text); color: var(--text); font-weight: 600; }
.cx-tab:hover { background: var(--surface-hover); }
.cx-idea { line-height: 1.55; font-size: 14px; }
.cx-badges { display: flex; gap: 6px; margin: 8px 0; }
.cx-code { margin: 8px 0; padding: 12px; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); overflow-x: auto; font-family: var(--font-mono); font-size: 12.5px; line-height: 1.55; white-space: pre; }
.cx-note { font-size: 12.5px; }
.cx-grow { margin-top: 18px; border-top: 1px solid var(--text); padding-top: 12px; }
.cx-grow-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.cx-slider { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-dim); }
.cx-slider input[type="range"] { width: 140px; min-height: 0; padding: 0; accent-color: var(--accent); }
.cx-slider output { font-family: var(--font-mono); color: var(--text); min-width: 70px; }
.cx-row { display: grid; grid-template-columns: minmax(130px, 1.3fr) 2fr minmax(70px, auto) minmax(90px, auto); gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid var(--border); font-size: 13px; }
.cx-bar { height: 8px; background: var(--border); }
.cx-bar i { display: block; height: 100%; }
.cx-bar i.cx-ok { background: var(--success); } .cx-bar i.cx-warn { background: var(--warning); } .cx-bar i.cx-bad { background: var(--danger); }
.cx-ops { font-family: var(--font-mono); font-size: 12px; text-align: right; }
.cx-ok-t { color: var(--success); } .cx-warn-t { color: var(--warning); } .cx-bad-t { color: var(--danger); }
.cx-verdict { font-size: 12px; font-weight: 600; }
.cx-foot { font-size: 12px; margin-top: 8px; }
.cx-guide { margin-top: 10px; font-size: 13px; }
.cx-guide summary { cursor: pointer; color: var(--text-dim); }
@media (max-width: 680px) { .cx-row { grid-template-columns: 1fr 1fr; } .cx-bar { grid-column: 1 / -1; } }

/* ---------- Live interview: full screen. The video fills the window and Aria floats in a corner. ---------- */
body.iv-immersive { overflow: hidden; }
body.iv-immersive .iv-room { position: fixed; inset: 0; z-index: 450; background: #000; color: #fff; }
body.iv-immersive .iv-stage { position: absolute; inset: 0; display: block; }
body.iv-immersive .iv-me { position: absolute; inset: 0; aspect-ratio: auto; border: 0; border-radius: 0; background: #000; box-shadow: none; }
body.iv-immersive .iv-me.iv-live { box-shadow: inset 0 0 0 3px var(--accent); }
body.iv-immersive .iv-me .iv-name { left: 16px; bottom: 150px; }
body.iv-immersive .iv-me .iv-meter { right: 16px; bottom: 156px; width: 120px; }
body.iv-immersive .iv-interviewer {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: clamp(150px, 18vw, 260px); aspect-ratio: 16 / 10;
  gap: 8px; border: 1px solid rgba(255, 255, 255, 0.25); border-radius: var(--radius-lg);
  background: rgba(15, 15, 15, 0.82);
}
body.iv-immersive .iv-interviewer .iv-avatar { width: 56px; height: 56px; font-size: 30px; background: #fff; color: #000; }
body.iv-immersive .iv-interviewer .iv-state { color: rgba(255, 255, 255, 0.8); font-size: 11.5px; }
body.iv-immersive .iv-interviewer .iv-name { background: rgba(0, 0, 0, 0.6); color: #fff; left: 8px; bottom: 6px; font-size: 10px; }
body.iv-immersive .iv-bar { position: absolute; top: 14px; left: 16px; z-index: 3; margin: 0; max-width: calc(100% - 300px); }
body.iv-immersive .iv-bar .chip { background: rgba(0, 0, 0, 0.55); color: #fff; border-color: rgba(255, 255, 255, 0.3); }
body.iv-immersive .iv-bar .text-dim { color: rgba(255, 255, 255, 0.75); }
body.iv-immersive .iv-alert { position: absolute; top: 64px; left: 16px; right: clamp(180px, 20vw, 290px); z-index: 3; margin: 0; background: rgba(0, 0, 0, 0.75); color: #fff; }
body.iv-immersive .iv-captions {
  position: absolute; left: 0; right: 0; bottom: 64px; z-index: 3; min-height: 0;
  padding: 56px 5vw 14px; margin: 0; border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0));
}
body.iv-immersive .iv-q { color: #fff; text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
body.iv-immersive .iv-a { color: rgba(255, 255, 255, 0.85); }
body.iv-immersive .iv-captions textarea { background: rgba(10, 10, 10, 0.88); color: #fff; border-color: rgba(255, 255, 255, 0.4); }
body.iv-immersive .iv-controls {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; margin: 0;
  padding: 10px 5vw; justify-content: center; align-items: center;
  background: rgba(0, 0, 0, 0.88);
}
body.iv-immersive .iv-controls .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
body.iv-immersive .iv-controls .btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }
body.iv-immersive .iv-controls .btn-primary { background: #fff; color: #000; border-color: #fff; }
body.iv-immersive .iv-controls .btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
body.iv-immersive .iv-controls .iv-speed { color: rgba(255, 255, 255, 0.8); }
body.iv-immersive .iv-controls .iv-speed select { background: #111; color: #fff; border-color: rgba(255, 255, 255, 0.4); }
body.iv-immersive .iv-empty { color: rgba(255, 255, 255, 0.6); }
@media (max-width: 680px) {
  body.iv-immersive .iv-bar { max-width: calc(100% - 170px); }
  body.iv-immersive .iv-me .iv-name, body.iv-immersive .iv-me .iv-meter { display: none; }
  body.iv-immersive .iv-bar .text-dim { display: none; }
  body.iv-immersive .iv-captions { bottom: 168px; padding-top: 24px; }
  body.iv-immersive .iv-captions .iv-q { font-size: 20px; }
  body.iv-immersive .iv-controls { flex-wrap: wrap; gap: 6px; padding-block: 8px; }
  body.iv-immersive .iv-controls .btn { min-height: 40px; padding: 6px 10px; font-size: 13px; }
  body.iv-immersive .iv-controls .iv-speed { display: none; }
}

/* Coding practice: your activity (solved and attempted problems) */
.act-list { display: flex; flex-direction: column; margin-top: 4px; }
.act-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; background: transparent; border: 0; border-top: 1px solid var(--border); padding: 10px 2px; cursor: pointer; }
.act-row:hover { background: var(--surface-hover); }
.act-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.act-main b { font-size: 13.5px; font-weight: 600; }
.act-main .text-dim { font-size: 12px; }
.act-detail { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-dim); text-align: right; flex: none; max-width: 48%; }
@media (max-width: 680px) { .act-row { flex-direction: column; gap: 2px; } .act-detail { text-align: left; max-width: none; } }

/* Coding focus mode: only the problem, editor and results */
body.coding-focus .sidebar,body.coding-focus .topbar,body.coding-focus .overlay,body.coding-focus .chatbot-fab{display:none!important}
body.coding-focus .main-content{margin-left:0!important;max-width:none}
.focus-exit{position:fixed;top:10px;right:10px;z-index:var(--z-modal,1000);background:var(--accent);color:#fff;border:0;box-shadow:0 2px 10px rgba(0,0,0,.25)}
@media (max-width:600px){.focus-exit{top:auto;bottom:12px;right:12px}}

/* Session palette */
.qpal{display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.qpal-btn{min-width:34px;height:34px;border-radius:8px;border:1px solid var(--border,#d7ddd9);background:transparent;color:inherit;font-weight:600;cursor:pointer}
.qpal-btn.solved{background:var(--accent);border-color:var(--accent);color:#fff}
.qpal-btn.attempted{border-color:#b45309;color:#b45309;background:rgba(180,83,9,.1)}
.qpal-btn.current{outline:2px solid var(--accent);outline-offset:2px}

.verdict{font-weight:700;font-size:15px;margin-bottom:6px}.verdict.ok{color:var(--accent)}.verdict.bad{color:#b91c1c}

/* Code editor (CodeMirror): emerald / teal on the editor's dark green panel, no blue or violet.
   The panel is dark in both themes, so these colours do not change with the page theme. */
.code-wrap{--cm-text:#d7ebe2;--cm-keyword:#34d399;--cm-string:#e6c27a;--cm-number:#5eead4;--cm-function:#86efc4;--cm-type:#f0b46a;--cm-comment:#6f9486;--cm-punct:#9bbcad;--cm-gutter:#5f8274;--cm-caret:#34d399;--cm-active-line:rgba(52,211,153,.08);--cm-selection:rgba(52,211,153,.28)}
.cm-host{min-height:260px;max-height:520px;overflow:auto;border-radius:0 0 10px 10px}
.cm-host .cm-editor{min-height:260px}

/* Universal-language coding page: input/output spec, language row, test output */
.io-spec{margin:0 0 12px;padding:12px 14px;border:1px solid var(--border,#d7ddd9);border-radius:10px;font-size:13px}
.io-title{font-weight:700;font-size:12px;letter-spacing:.04em;text-transform:uppercase;margin:8px 0 4px}
.io-title:first-child{margin-top:0}
.io-note{margin:0 0 6px;color:var(--text-dim)}
.io-list{margin:0 0 6px;padding-left:18px}
.io-example{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.io-label{font-size:11.5px;color:var(--text-dim)}
.io-spec pre,.io-pre{margin:2px 0 0;padding:6px 8px;border-radius:6px;background:rgba(9,122,84,.06);font-family:'JetBrains Mono',ui-monospace,Consolas,monospace;font-size:12.5px;white-space:pre-wrap;word-break:break-word;max-height:180px;overflow:auto}
.io-msg{color:#b91c1c;white-space:pre-wrap;margin-top:6px}
.lang-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.lang-row select{width:auto;max-width:100%;min-width:0}
@media (max-width:600px){.io-example{grid-template-columns:1fr}.lang-row select{flex:1 1 140px}}

/* Focus mode fills the screen: only the problem, the editor and the results, with a tall editor */
body.coding-focus .main-content{padding:12px 16px}
body.coding-focus .cm-host{max-height:none;height:calc(100vh - 300px);min-height:320px}
body.coding-focus .code-input{min-height:calc(100vh - 300px)}

/* Resume analyzer */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.resume-fix .chip{flex-shrink:0}
#resumeFileNote b{font-weight:700}
