@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ══════════════════════════════════════════════════════════════
   EMT ADAPTIVE PREP — Professional Test Prep Design System v3
   Deep slate shell + white surfaces + authoritative blue brand
   Designed for focused, high-stakes exam preparation
══════════════════════════════════════════════════════════════ */
:root {
  /* Backgrounds */
  --bg:          #f1f5f9;
  --bg2:         #ffffff;
  --bg3:         #f8fafc;
  --surface:     #e2e8f0;

  /* Borders */
  --border:         rgba(15, 23, 42, 0.08);
  --border-light:   rgba(29, 78, 216, 0.22);

  /* Typography */
  --text:       #0f172a;
  --text-muted: #475569;
  --text-dim:   #94a3b8;

  /* Primary Brand — Authoritative Blue */
  --accent:      #1d4ed8;
  --accent2:     #2563eb;
  --accent-glow: rgba(37, 99, 235, 0.14);
  --green-light: rgba(29, 78, 216, 0.05);

  /* Semantic Colors */
  --correct:    #16a34a;
  --correct-bg: rgba(22, 163, 74, 0.06);
  --correct-bd: rgba(22, 163, 74, 0.20);
  --wrong:      #dc2626;
  --wrong-bg:   rgba(220, 38, 38, 0.05);
  --wrong-bd:   rgba(220, 38, 38, 0.18);
  --warn:       #d97706;
  --warn-bg:    rgba(217, 119, 6, 0.06);
  --gold:       #b45309;
  --slate:      #64748b;
  --slate-light: rgba(100, 116, 139, 0.09);

  /* Layout Tokens */
  --radius:     10px;
  --radius-lg:  14px;
  --shadow:     0 1px 2px rgba(15,23,42,0.04), 0 2px 8px rgba(15,23,42,0.04);
  --shadow-lg:  0 4px 16px rgba(15,23,42,0.07), 0 1px 4px rgba(15,23,42,0.03);
  --nav-bg:     #0f172a;
}

/* ── Reset ────────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{
  font-family:'Inter',system-ui,-apple-system,sans-serif;
  background:var(--bg);color:var(--text);
  line-height:1.6;overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/* ── Typography ───────────────────────────────────────────── */
h1{font-size:clamp(1.6rem,2.8vw,2rem);font-weight:800;letter-spacing:-.035em;line-height:1.15;color:var(--text);}
h2{font-size:clamp(1.15rem,2.2vw,1.45rem);font-weight:700;letter-spacing:-.025em;line-height:1.2;}
h3{font-size:.95rem;font-weight:700;letter-spacing:-.015em;color:var(--text);}
p{font-size:.875rem;color:var(--text-muted);font-weight:400;line-height:1.7;}
a{color:var(--accent);text-decoration:none;transition:color .15s;}
a:hover{color:var(--accent2);}
.eyebrow{font-size:.65rem;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--accent);}

/* ══════════════════════════════════════════════════════════════
   APP SHELL
══════════════════════════════════════════════════════════════ */
.app-shell{display:grid;grid-template-columns:250px 1fr;grid-template-rows:56px 1fr;min-height:100vh;}

/* ── Top Nav ──────────────────────────────────────────────── */
.top-nav{
  grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;
  padding:0 1.5rem;background:var(--nav-bg);
  border-bottom:1px solid rgba(255,255,255,0.06);
  position:sticky;top:0;z-index:50;height:56px;
}
.top-nav-brand{
  display:flex;align-items:center;gap:.6rem;
  font-size:.88rem;font-weight:700;color:white;
  text-decoration:none;letter-spacing:-.015em;
}
.top-nav-brand:hover{color:white;}
.top-nav-right{display:flex;align-items:center;gap:.6rem;}
.user-chip{
  display:flex;align-items:center;gap:.45rem;
  padding:.25rem .65rem .25rem .3rem;border-radius:100px;
  background:rgba(255,255,255,0.07);border:1px solid rgba(255,255,255,0.09);
  font-size:.72rem;font-weight:600;color:rgba(255,255,255,0.78);
  transition:background .15s;
}
.user-chip:hover{background:rgba(255,255,255,0.1);}
.user-chip-avatar{
  width:24px;height:24px;border-radius:50%;
  background:var(--accent);color:white;
  display:flex;align-items:center;justify-content:center;
  font-size:.6rem;font-weight:800;
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar{
  background:var(--bg2);border-right:1px solid var(--border);
  padding:1rem 0;overflow-y:auto;
  position:sticky;top:56px;height:calc(100vh - 56px);
}
.sidebar-section{padding:0 .75rem;margin-bottom:1.5rem;}
.sidebar-section-label{
  font-size:.6rem;font-weight:700;letter-spacing:.12em;
  text-transform:uppercase;color:var(--text-dim);
  padding:0 .75rem;margin-bottom:.45rem;display:block;
}
.nav-item{
  display:flex;align-items:center;gap:.6rem;
  padding:.5rem .75rem;border-radius:8px;
  font-size:.8rem;font-weight:500;color:var(--text-muted);
  text-decoration:none;cursor:pointer;transition:all .15s;
  border:none;background:none;width:100%;text-align:left;
}
.nav-item:hover{background:var(--green-light);color:var(--accent);}
.nav-item.active{
  background:var(--green-light);color:var(--accent);font-weight:700;
  box-shadow:inset 3px 0 0 var(--accent);
}
.nav-item-icon{flex-shrink:0;width:20px;height:20px;display:inline-flex;align-items:center;justify-content:center;}
.nav-item-icon svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round;}
.nav-item-badge{
  margin-left:auto;font-size:.58rem;font-weight:700;
  background:var(--accent);color:white;
  padding:.12rem .45rem;border-radius:100px;
}

/* ── Main Content ─────────────────────────────────────────── */
.main-content{padding:2rem 2.25rem;overflow-y:auto;max-height:calc(100vh - 56px);}
.page-header{margin-bottom:1.75rem;}

/* ══════════════════════════════════════════════════════════════
   COMPONENTS
══════════════════════════════════════════════════════════════ */

/* ── Cards ────────────────────────────────────────────────── */
.card{
  background:var(--bg2);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.5rem;
  box-shadow:var(--shadow);
}
.card-sm{padding:1.25rem;border-radius:var(--radius);}

/* ── Stat Cards ───────────────────────────────────────────── */
.stats-row{display:grid;grid-template-columns:repeat(4,1fr);gap:.875rem;margin-bottom:1.5rem;}
.stat-card{
  background:var(--bg2);border:1px solid var(--border);
  border-radius:var(--radius);padding:1.15rem 1.25rem;
  transition:border-color .2s,transform .2s,box-shadow .2s;
}
.stat-card:hover{border-color:var(--border-light);transform:translateY(-1px);box-shadow:var(--shadow);}
.stat-card-label{
  font-size:.64rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--text-dim);margin-bottom:.45rem;
  display:flex;align-items:center;gap:.35rem;
}
.stat-card-value{font-size:1.75rem;font-weight:800;color:var(--text);letter-spacing:-.04em;line-height:1;}
.stat-card-sub{font-size:.68rem;color:var(--text-dim);margin-top:.25rem;}
.stat-card-value.green{color:var(--correct);}
.stat-card-value.gold{color:var(--gold);}
.stat-card-value.accent{color:var(--accent);}
.stat-card-value.slate{color:var(--slate);}

/* ── Tooltip ──────────────────────────────────────────────── */
.tooltip-icon{
  display:inline-flex;align-items:center;justify-content:center;
  width:14px;height:14px;border-radius:50%;
  background:var(--surface);color:var(--text-dim);
  font-size:.58rem;font-weight:800;cursor:help;
  flex-shrink:0;border:1px solid var(--border);
}
.tooltip-wrap{position:relative;display:inline-flex;align-items:center;}
.tooltip-wrap .tooltip-box{
  position:absolute;bottom:calc(100% + 6px);left:50%;
  transform:translateX(-50%);background:var(--nav-bg);color:white;
  font-size:.7rem;line-height:1.5;padding:.5rem .8rem;
  border-radius:8px;white-space:normal;width:220px;
  pointer-events:none;opacity:0;transition:opacity .15s;z-index:100;font-weight:400;
}
.tooltip-wrap:hover .tooltip-box{opacity:1;}

/* ── Pro Gate ─────────────────────────────────────────────── */
.pro-gate{position:relative;}
.pro-gate .pro-blur{filter:blur(4px);pointer-events:none;user-select:none;opacity:.5;}
.pro-gate .pro-overlay{
  position:absolute;inset:0;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:.5rem;
  background:rgba(241,245,249,.8);border-radius:var(--radius);backdrop-filter:blur(3px);
}
.pro-overlay-label{font-size:.72rem;font-weight:700;color:var(--gold);text-transform:uppercase;letter-spacing:.08em;}

/* ── Buttons ──────────────────────────────────────────────── */
.btn{
  display:inline-flex;align-items:center;gap:.45rem;
  padding:.6rem 1.25rem;border-radius:8px;
  font-family:'Inter',sans-serif;font-size:.82rem;font-weight:600;
  cursor:pointer;transition:all .2s;text-decoration:none;
  border:1.5px solid transparent;line-height:1.4;
}
.btn-primary{background:var(--accent);color:white;border-color:var(--accent);}
.btn-primary:hover{background:var(--accent2);color:white;box-shadow:0 4px 12px var(--accent-glow);transform:translateY(-1px);}
.btn-secondary{background:transparent;color:var(--text);border-color:rgba(29,78,216,0.2);}
.btn-secondary:hover{border-color:var(--accent);color:var(--accent);background:var(--green-light);}
.btn-danger{background:transparent;color:var(--wrong);border-color:var(--wrong-bd);}
.btn-danger:hover{background:var(--wrong-bg);}
.btn-gold{background:linear-gradient(135deg,#d97706,#b45309);color:white;border-color:transparent;}
.btn-gold:hover{transform:translateY(-1px);box-shadow:0 4px 12px rgba(180,83,9,.25);}
.btn-nav{background:rgba(255,255,255,0.08);color:rgba(255,255,255,0.75);border-color:rgba(255,255,255,0.1);}
.btn-nav:hover{background:rgba(255,255,255,0.13);color:white;}
.btn-lg{padding:.8rem 1.75rem;font-size:.9rem;border-radius:10px;}
.btn-sm{padding:.35rem .75rem;font-size:.73rem;border-radius:6px;}
.btn-block{width:100%;justify-content:center;}
.btn:disabled{opacity:.4;cursor:not-allowed;transform:none!important;box-shadow:none!important;}

/* ── Forms ────────────────────────────────────────────────── */
.form-group{margin-bottom:1.15rem;}
.form-label{display:block;font-size:.78rem;font-weight:600;color:var(--text);margin-bottom:.35rem;}
.form-input{
  width:100%;padding:.65rem .9rem;
  border:1.5px solid var(--border);border-radius:8px;
  background:var(--bg3);font-family:'Inter',sans-serif;
  font-size:.85rem;color:var(--text);
  transition:border-color .15s,box-shadow .15s;outline:none;
}
.form-input:focus{border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-glow);}
.form-input.error{border-color:var(--wrong);}
.form-hint{font-size:.7rem;color:var(--text-dim);margin-top:.25rem;}
.form-error{font-size:.7rem;color:var(--wrong);margin-top:.25rem;display:none;}
.form-error.show{display:block;}

/* ── Alerts ───────────────────────────────────────────────── */
.alert{padding:.75rem .9rem;border-radius:8px;font-size:.8rem;line-height:1.6;display:none;margin-bottom:.875rem;}
.alert.show{display:flex;align-items:flex-start;gap:.45rem;}
.alert-success{background:var(--correct-bg);border:1px solid var(--correct-bd);color:var(--correct);}
.alert-error{background:var(--wrong-bg);border:1px solid var(--wrong-bd);color:var(--wrong);}
.alert-warn{background:var(--warn-bg);border:1px solid rgba(217,119,6,.2);color:#92400e;}
.alert-info{background:var(--green-light);border:1px solid var(--border-light);color:var(--accent);}

/* ── Progress ─────────────────────────────────────────────── */
.progress-track{height:5px;background:var(--surface);border-radius:100px;overflow:hidden;}
.progress-fill{height:100%;border-radius:100px;background:linear-gradient(90deg,var(--accent),var(--accent2));transition:width .6s cubic-bezier(.4,0,.2,1);}
.progress-fill.warn{background:linear-gradient(90deg,var(--gold),var(--wrong));}

/* ── Domain Rows ──────────────────────────────────────────── */
.domain-row{margin-bottom:.875rem;}
.domain-row-header{display:flex;justify-content:space-between;align-items:center;margin-bottom:.25rem;}
.domain-row-name{font-size:.76rem;color:var(--text-muted);font-weight:500;}
.domain-row-pct{font-size:.76rem;font-weight:700;color:var(--text);}

/* ── Badges ───────────────────────────────────────────────── */
.badge{
  display:inline-flex;align-items:center;
  font-size:.6rem;font-weight:700;letter-spacing:.06em;
  text-transform:uppercase;padding:.18rem .5rem;border-radius:4px;
}
.badge-accent{background:rgba(29,78,216,.08);border:1px solid rgba(29,78,216,.18);color:var(--accent);}
.badge-gold{background:rgba(180,83,9,.08);border:1px solid rgba(180,83,9,.18);color:#92400e;}
.badge-correct{background:var(--correct-bg);border:1px solid var(--correct-bd);color:var(--correct);}
.badge-wrong{background:var(--wrong-bg);border:1px solid var(--wrong-bd);color:var(--wrong);}
.badge-pro{background:linear-gradient(135deg,rgba(180,83,9,.12),rgba(180,83,9,.04));border:1px solid rgba(180,83,9,.22);color:#92400e;}
.badge-slate{background:var(--slate-light);border:1px solid rgba(100,116,139,.15);color:var(--slate);}

/* ── Tables ───────────────────────────────────────────────── */
.table-wrap{overflow-x:auto;}
table{width:100%;border-collapse:collapse;font-size:.8rem;}
th{
  padding:.65rem .875rem;text-align:left;
  font-size:.64rem;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--text-dim);
  border-bottom:1.5px solid var(--border);white-space:nowrap;
}
td{padding:.7rem .875rem;border-bottom:1px solid var(--border);color:var(--text-muted);vertical-align:middle;}
tr:last-child td{border-bottom:none;}
tr:hover td{background:var(--green-light);}

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay{
  position:fixed;inset:0;z-index:200;
  background:rgba(15,23,42,.5);backdrop-filter:blur(4px);
  display:flex;align-items:center;justify-content:center;padding:1rem;
  opacity:0;pointer-events:none;transition:opacity .2s;
}
.modal-overlay.open{opacity:1;pointer-events:all;}
.modal{
  background:var(--bg2);border-radius:var(--radius-lg);padding:1.75rem;
  max-width:480px;width:100%;
  box-shadow:0 20px 60px rgba(0,0,0,.14);
  transform:translateY(12px);transition:transform .25s;
}
.modal-overlay.open .modal{transform:translateY(0);}
.modal-header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:1.25rem;}
.modal-close{background:none;border:none;cursor:pointer;font-size:1.1rem;color:var(--text-dim);padding:.25rem;border-radius:4px;}
.modal-close:hover{color:var(--text);}

/* ── Option Buttons (Question Choices) ────────────────────── */
.option-btn{
  display:flex;align-items:flex-start;gap:.875rem;
  padding:.85rem 1.1rem;border-radius:10px;
  border:1.5px solid var(--border);background:var(--bg2);
  cursor:pointer;transition:all .15s;text-align:left;
  width:100%;font-family:'Inter',sans-serif;margin-bottom:.5rem;
}
.option-btn:hover:not(:disabled){border-color:var(--border-light);background:var(--green-light);transform:translateX(2px);}
.option-btn.selected{border-color:var(--accent);background:var(--green-light);}
.option-btn.selected .option-letter{background:var(--accent);color:white;border-color:var(--accent);}
.option-btn:disabled{cursor:default;}
.option-letter{
  width:28px;height:28px;border-radius:7px;flex-shrink:0;
  background:var(--bg3);display:flex;align-items:center;justify-content:center;
  font-size:.7rem;font-weight:800;color:var(--text-dim);
  margin-top:1px;border:1px solid var(--border);transition:all .15s;
}
.option-text{font-size:.85rem;color:var(--text-muted);line-height:1.65;padding-top:2px;}
.option-btn.correct{border-color:var(--correct-bd);background:var(--correct-bg);}
.option-btn.correct .option-letter{background:var(--correct);color:white;border-color:var(--correct);}
.option-btn.correct .option-text{color:var(--correct);font-weight:600;}
.option-btn.wrong{border-color:var(--wrong-bd);background:var(--wrong-bg);}
.option-btn.wrong .option-letter{background:var(--wrong);color:white;border-color:var(--wrong);}
.option-btn.wrong .option-text{color:var(--wrong);font-weight:600;}
.option-btn.revealed{border-color:var(--correct-bd);background:var(--correct-bg);}
.option-btn.revealed .option-letter{background:var(--correct);color:white;border-color:var(--correct);}
.option-btn.revealed .option-text{color:var(--correct);font-weight:600;}

/* ── Proficiency Badges ───────────────────────────────────── */
.prof-badge{display:inline-flex;align-items:center;font-size:.6rem;font-weight:700;letter-spacing:.04em;padding:.2rem .5rem;border-radius:4px;}
.prof-above{background:var(--correct-bg);color:var(--correct);border:1px solid var(--correct-bd);}
.prof-near{background:rgba(217,119,6,.07);color:#92400e;border:1px solid rgba(217,119,6,.2);}
.prof-below{background:var(--wrong-bg);color:var(--wrong);border:1px solid var(--wrong-bd);}
.prof-none{background:var(--bg3);color:var(--text-dim);border:1px solid var(--border);}

/* ── Readiness Ring ───────────────────────────────────────── */
.readiness-ring-wrap{position:relative;width:110px;height:110px;flex-shrink:0;}
.readiness-ring-svg{transform:rotate(-90deg);}
.readiness-ring-bg{fill:none;stroke:var(--surface);stroke-width:8;}
.readiness-ring-fill{fill:none;stroke:var(--accent);stroke-width:8;stroke-linecap:round;transition:stroke-dashoffset 1s cubic-bezier(.4,0,.2,1);}
.readiness-ring-text{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;}
.readiness-ring-num{font-size:1.3rem;font-weight:800;color:var(--accent);letter-spacing:-.04em;line-height:1;}
.readiness-ring-label{font-size:.55rem;color:var(--text-dim);font-weight:700;text-transform:uppercase;letter-spacing:.06em;}

/* ══════════════════════════════════════════════════════════════
   SCORE SCALE — NREMT-style linear score report
══════════════════════════════════════════════════════════════ */
.score-scale-card{
  background:var(--bg2);border:1px solid var(--border);
  border-radius:var(--radius-lg);padding:1.75rem 1.5rem 1.25rem;
  box-shadow:var(--shadow);margin-bottom:1.5rem;
}
.score-scale-card-title{
  font-size:.66rem;font-weight:700;letter-spacing:.1em;
  text-transform:uppercase;color:var(--text-dim);
  text-align:center;margin-bottom:1.5rem;
}
.score-track{position:relative;height:14px;background:var(--surface);border-radius:7px;margin:0 8px;}
.score-track-fail{
  position:absolute;left:0;top:0;bottom:0;
  background:rgba(220,38,38,0.1);border-radius:7px 0 0 7px;
  border-right:2px solid rgba(220,38,38,0.35);
}
.score-track-pass{
  position:absolute;top:0;bottom:0;right:0;
  background:rgba(22,163,74,0.08);border-radius:0 7px 7px 0;
}
.score-track-fill{
  position:absolute;left:0;top:0;bottom:0;border-radius:7px;
  transition:width 1.2s cubic-bezier(.4,0,.2,1);
}
.score-needle{
  position:absolute;top:-44px;transform:translateX(-50%);
  display:flex;flex-direction:column;align-items:center;
  transition:left 1.2s cubic-bezier(.4,0,.2,1);
}
.score-needle-bubble{
  background:var(--nav-bg);color:white;
  font-size:.76rem;font-weight:700;
  padding:.25rem .6rem;border-radius:6px;
  white-space:nowrap;box-shadow:0 2px 8px rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,0.08);
}
.score-needle-bubble::after{
  content:'';display:block;width:0;height:0;
  border:5px solid transparent;border-top-color:var(--nav-bg);margin:0 auto;
}
.score-needle-stem{width:2px;height:18px;border-radius:1px;background:var(--nav-bg);opacity:.65;}
.score-ticks{display:flex;justify-content:space-between;margin:0.4rem 8px 0;}
.score-tick{display:flex;flex-direction:column;align-items:center;gap:2px;}
.score-tick-mark{width:1.5px;height:5px;background:var(--text-dim);border-radius:1px;}
.score-tick-val{font-size:.72rem;font-weight:700;color:var(--text);}
.score-tick-lbl{font-size:.6rem;color:var(--text-dim);text-align:center;line-height:1.3;margin-top:1px;}

/* ══════════════════════════════════════════════════════════════
   UTILITIES & ANIMATION
══════════════════════════════════════════════════════════════ */
@keyframes fadeUp{from{opacity:0;transform:translateY(10px);}to{opacity:1;transform:translateY(0);}}
@keyframes spin{to{transform:rotate(360deg);}}
.animate-up{animation:fadeUp .35s ease both;}
.spinner{
  display:inline-block;width:16px;height:16px;
  border:2.5px solid rgba(255,255,255,.25);
  border-top-color:white;border-radius:50%;
  animation:spin .65s linear infinite;
}
.spinner.dark{border-color:rgba(29,78,216,.15);border-top-color:var(--accent);}
.divider{height:1px;background:var(--border);margin:1.5rem 0;}
.divider-text{display:flex;align-items:center;gap:1rem;margin:1.5rem 0;color:var(--text-dim);font-size:.73rem;font-weight:500;}
.divider-text::before,.divider-text::after{content:'';flex:1;height:1px;background:var(--border);}
.two-col{display:grid;grid-template-columns:1fr 1fr;gap:1.25rem;}
.three-col{display:grid;grid-template-columns:1fr 1fr 1fr;gap:1.25rem;}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════ */
@media(max-width:900px){
  .app-shell{grid-template-columns:1fr;}
  .sidebar{display:none;}
  .stats-row{grid-template-columns:1fr 1fr;}
  .two-col,.three-col{grid-template-columns:1fr;}
  .top-nav{padding:0 1rem;}
  .main-content{padding:1.25rem 1rem;max-height:none;}
  .card{padding:1.25rem;}
  .modal{padding:1.25rem;margin:.75rem;}
  .modal-overlay{align-items:flex-end;padding:0;}
  .modal{border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-width:100%!important;width:100%;margin:0;}
}
@media(max-width:600px){
  .stats-row{grid-template-columns:1fr 1fr;}
  .main-content{padding:1rem;}
  h1{font-size:1.4rem!important;}
  .btn-lg{padding:.7rem 1.15rem;font-size:.85rem;}
  table{font-size:.73rem;}
  th,td{padding:.45rem .55rem;}
  .user-chip-name{display:none;}
  #planBadge{display:none;}
  .page-header{margin-bottom:1.15rem;}
  .start-options{grid-template-columns:1fr!important;}
  .config-grid{grid-template-columns:1fr 1fr!important;}
  .domain-checkboxes{grid-template-columns:1fr!important;}
  .top-nav-right .btn-nav{display:none;}
  .score-tick-lbl{display:none;}
}

/* ══════════════════════════════════════════════════════════════
   CASE STUDY — NCLEX-style full-screen split layout
══════════════════════════════════════════════════════════════ */

/* ── Full-screen shell ── */
.cs-fs{position:fixed;inset:0;z-index:1000;display:flex;flex-direction:column;background:var(--bg);overflow:hidden;}

/* ── Top Nav ── */
.cs-topnav{display:flex;align-items:center;justify-content:space-between;height:52px;padding:0 1.25rem;background:var(--bg2);border-bottom:1px solid var(--border);flex-shrink:0;}
.cs-topnav-left{display:flex;align-items:center;gap:.5rem;}
.cs-topnav-logo{width:28px;height:20px;object-fit:contain;}
.cs-topnav-brand{font-size:.88rem;font-weight:700;color:var(--accent);letter-spacing:-.01em;}
.cs-topnav-center{display:flex;align-items:center;gap:.85rem;}
.cs-topnav-case{font-size:.78rem;font-weight:600;color:var(--text-muted);}
.cs-topnav-end{display:inline-flex;align-items:center;gap:.35rem;padding:.4rem 1rem;border-radius:6px;background:var(--wrong);color:white;border:none;font-family:'Inter',sans-serif;font-size:.78rem;font-weight:700;cursor:pointer;transition:background .15s;}
.cs-topnav-end:hover{background:#b91c1c;}
.cs-topnav-right{display:flex;align-items:center;gap:.65rem;}
.cs-topnav-plan{font-size:.6rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;background:var(--wrong);color:white;padding:.2rem .55rem;border-radius:4px;}
.cs-topnav-user{display:flex;align-items:center;gap:.4rem;padding:.25rem .6rem .25rem .25rem;border:1px solid var(--border);border-radius:100px;font-size:.75rem;font-weight:600;color:var(--text-muted);}
.cs-topnav-avatar{width:26px;height:26px;border-radius:50%;background:var(--accent);color:white;display:flex;align-items:center;justify-content:center;font-size:.6rem;font-weight:800;}
.cs-topnav-name{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}

/* ── Content body: two columns ── */
.cs-body{flex:1;display:grid;grid-template-columns:1fr 1fr;overflow:hidden;}

/* ── Left: Scenario ── */
.cs-left{overflow-y:auto;padding:2rem 2.25rem;background:var(--bg2);border-right:1px solid var(--border);}
.cs-scenario-hdr{font-size:.62rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;color:var(--accent);margin-bottom:.75rem;}
.cs-scenario-title{font-size:1.2rem;font-weight:800;color:var(--text);line-height:1.3;margin-bottom:.5rem;}
.cs-domain-badge{display:inline-block;font-size:.65rem;font-weight:700;color:var(--correct);background:var(--correct-bg);border:1px solid var(--correct-bd);padding:.2rem .6rem;border-radius:4px;margin-bottom:1.25rem;}
.cs-scenario-narrative{font-size:.9rem;line-height:1.8;color:var(--text);}
.cs-scenario-narrative p{margin:0 0 1rem;}

/* ── Vitals table ── */
.cs-vitals-tbl{width:100%;border-collapse:collapse;margin-top:1.25rem;font-size:.82rem;}
.cs-vt-label{padding:.55rem .65rem;font-weight:700;color:var(--text);background:var(--bg3);border:1px solid var(--border);text-align:center;width:60px;}
.cs-vt-val{padding:.55rem .65rem;font-weight:600;color:var(--text-muted);border:1px solid var(--border);text-align:center;}
.cs-vitals-string{margin-top:1.25rem;padding:1rem 1.25rem;background:var(--bg3);border:1px solid var(--border);border-radius:8px;font-size:.88rem;color:var(--text);line-height:1.7;}

/* ── Right: Question area ── */
.cs-right{display:flex;flex-direction:column;overflow:hidden;background:var(--bg);}
.cs-right-header{flex-shrink:0;padding:.75rem 1.5rem;border-bottom:1px solid var(--border);background:var(--bg2);}
.cs-right-qinfo{font-size:.78rem;color:var(--text-muted);font-weight:500;display:block;margin-bottom:.65rem;}
.cs-right-body{flex:1;overflow-y:auto;padding:1.75rem 2rem;}

/* ── Step segments (progress bar) ── */
.cs-segs{display:flex;gap:4px;}
.cs-seg{flex:1;display:flex;flex-direction:column;gap:3px;}
.cs-seg-bar{height:4px;border-radius:2px;background:var(--surface);transition:background .3s;}
.cs-seg-label{font-size:.6rem;font-weight:600;color:var(--text-dim);text-align:center;}
.cs-seg.done .cs-seg-bar{background:var(--correct);}
.cs-seg.done .cs-seg-label{color:var(--correct);}
.cs-seg.active .cs-seg-bar{background:var(--wrong);} /* red = current like screenshot */
.cs-seg.active .cs-seg-label{color:var(--accent);font-weight:700;}

/* ── Question card ── */
.cs-q-card{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.75rem;box-shadow:var(--shadow);animation:fadeUp .3s ease both;max-width:720px;}
.cs-q-header{display:flex;align-items:center;gap:.5rem;margin-bottom:1.25rem;flex-wrap:wrap;}
.cs-q-num{font-size:.68rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-dim);}
.cs-q-type{font-size:.6rem;font-weight:700;letter-spacing:.04em;text-transform:uppercase;padding:.2rem .55rem;border-radius:4px;}
.cs-q-type-sata{background:var(--wrong-bg);border:1px solid var(--wrong-bd);color:var(--wrong);}
.cs-q-type-default{background:rgba(29,78,216,.06);border:1px solid rgba(29,78,216,.15);color:var(--accent);}
.cs-q-step-name{font-size:.68rem;font-weight:600;color:var(--text-muted);background:var(--bg3);border:1px solid var(--border);padding:.2rem .55rem;border-radius:4px;}

/* ── Stem ── */
.cs-stem{font-size:1rem;font-weight:600;color:var(--text);line-height:1.75;margin-bottom:1.5rem;}
.cs-stem-placeholder{color:var(--text-muted);font-weight:400;}

/* ── SATA hint bar ── */
.cs-sata-hint{display:flex;align-items:center;gap:.65rem;font-size:.72rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--accent);margin-bottom:1rem;}
.cs-sata-hint-bar{width:4px;height:18px;border-radius:2px;background:var(--wrong);flex-shrink:0;}

/* ── Options ── */
.cs-opts{display:flex;flex-direction:column;gap:.5rem;}
.cs-opt{display:flex;align-items:center;gap:1rem;padding:1rem 1.25rem;border-radius:10px;border:1.5px solid var(--border);background:var(--bg2);cursor:pointer;transition:all .15s;text-align:left;width:100%;font-family:'Inter',sans-serif;font-size:.9rem;color:var(--text);}
.cs-opt:hover:not(.locked){border-color:var(--border-light);background:var(--green-light);}
.cs-opt.selected{border-color:var(--accent);background:rgba(29,78,216,.04);}
.cs-opt.selected .cs-opt-letter{background:var(--accent);color:white;border-color:var(--accent);}
.cs-opt.locked{pointer-events:none;opacity:.85;}
.cs-opt.correct-answer{border-color:var(--correct-bd);background:var(--correct-bg);}
.cs-opt.correct-answer .cs-opt-letter{background:var(--correct);color:white;border-color:var(--correct);}
.cs-opt.wrong-answer{border-color:var(--wrong-bd);background:var(--wrong-bg);}
.cs-opt.wrong-answer .cs-opt-letter{background:var(--wrong);color:white;border-color:var(--wrong);}
.cs-opt-letter{width:32px;height:32px;border-radius:50%;flex-shrink:0;background:var(--bg3);display:flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:800;color:var(--text-dim);border:1.5px solid var(--border);transition:all .15s;}
.cs-opt-text{flex:1;line-height:1.55;font-weight:500;}

/* ── Drag & Drop (Category Mode) ── */
.cs-dnd-source{display:flex;gap:.5rem;flex-wrap:wrap;margin-bottom:1.25rem;padding:.85rem;background:var(--bg2);border:1px solid var(--border);border-radius:10px;min-height:48px;}
.cs-dnd-chip{padding:.5rem .85rem;font-size:.82rem;font-weight:600;cursor:grab;user-select:none;border-radius:6px;background:var(--accent);color:white;transition:all .15s;box-shadow:0 1px 3px rgba(0,0,0,.1);}
.cs-dnd-chip:hover{transform:translateY(-1px);box-shadow:0 2px 6px rgba(0,0,0,.15);}
.cs-dnd-chip.cs-tap-selected{outline:2.5px solid var(--text);outline-offset:2px;transform:translateY(-1px);box-shadow:0 2px 8px rgba(0,0,0,.2);}
.cs-dnd-chip.cs-dragging{opacity:.5;}
.cs-dnd-chip.placed{cursor:pointer;opacity:.9;font-size:.78rem;background:var(--accent);position:relative;}
.cs-dnd-chip.placed::after{content:'✕';margin-left:.4rem;font-size:.65rem;opacity:.7;}
.cs-dnd-targets{display:grid;gap:.75rem;}
.cs-dnd-zone{min-height:80px;border:2px dashed var(--border);border-radius:10px;padding:.75rem;background:var(--bg2);transition:all .15s;cursor:pointer;}
.cs-dnd-zone.hover{border-color:var(--accent);background:var(--green-light);}
.cs-dnd-zone-label{font-size:.72rem;font-weight:700;color:var(--text);text-transform:uppercase;letter-spacing:.04em;margin-bottom:.5rem;text-align:center;padding:.35rem;background:var(--bg3);border-radius:6px;}
.cs-dnd-zone-items{display:flex;flex-direction:column;gap:.35rem;min-height:32px;}

/* ── DnD Ordering ── */
.cs-dnd-order{display:flex;flex-direction:column;gap:.5rem;}
.cs-dnd-order-item{display:flex;align-items:center;gap:.75rem;padding:.75rem 1rem;border-radius:8px;border:1.5px solid var(--border);background:var(--bg2);cursor:grab;user-select:none;transition:all .15s;font-size:.88rem;color:var(--text);}
.cs-dnd-order-item:hover{border-color:var(--border-light);background:var(--bg3);}
.cs-dnd-order-item:active{cursor:grabbing;box-shadow:0 4px 12px rgba(0,0,0,.1);}
.cs-dnd-order-item.cs-dragging{opacity:.5;}
.cs-dnd-order-item.cs-drag-over{border-color:#3b82f6;background:rgba(59,130,246,.06);}
.cs-dnd-grip{font-size:1.1rem;cursor:grab;color:var(--text-dim);flex-shrink:0;line-height:1;}
.cs-dnd-order-num{width:26px;height:26px;border-radius:50%;background:var(--accent);color:white;display:flex;align-items:center;justify-content:center;font-size:.7rem;font-weight:800;flex-shrink:0;}
.cs-dnd-order-text{flex:1;line-height:1.55;font-weight:500;}
.cs-dnd-move-btn{width:28px;height:28px;border-radius:6px;border:1.5px solid var(--border);background:var(--bg3);color:var(--text);font-size:.85rem;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;flex-shrink:0;transition:all .15s;padding:0;line-height:1;}
.cs-dnd-move-btn:hover{background:var(--accent);color:white;border-color:var(--accent);}
.cs-dnd-move-btn:active{transform:scale(.92);}

/* ── Hot Spot ── */
.cs-hs-wrap{margin-bottom:1rem;}
.cs-hs-img-container{position:relative;display:inline-block;width:100%;border:1.5px solid var(--border);border-radius:10px;overflow:hidden;background:var(--bg3);}
.cs-hs-img{width:100%;height:auto;display:block;user-select:none;-webkit-user-drag:none;}
.cs-hs-placeholder-img{display:flex;flex-direction:column;align-items:center;justify-content:center;padding:3rem;color:var(--text-dim);gap:.5rem;min-height:300px;}
.cs-hs-placeholder-img p{font-size:.82rem;margin:0;}
.cs-hs-zone{position:absolute;border:2px solid transparent;border-radius:6px;cursor:pointer;transition:all .2s;display:flex;align-items:center;justify-content:center;background:rgba(29,78,216,.05);}
.cs-hs-zone:hover:not(.locked){border-color:var(--accent);background:rgba(29,78,216,.12);box-shadow:0 0 0 2px var(--accent-glow);}
.cs-hs-zone.selected{border-color:var(--accent);background:rgba(29,78,216,.18);box-shadow:0 0 0 3px var(--accent-glow);}
.cs-hs-zone.locked{cursor:default;pointer-events:none;}
.cs-hs-zone.hs-correct{border-color:var(--correct);background:rgba(22,163,74,.2);box-shadow:0 0 0 2px rgba(22,163,74,.3);}
.cs-hs-zone.hs-wrong{border-color:var(--wrong);background:rgba(220,38,38,.2);box-shadow:0 0 0 2px rgba(220,38,38,.3);}
.cs-hs-zone.hs-missed{border:2px dashed var(--warn);background:rgba(217,119,6,.15);box-shadow:0 0 0 2px rgba(217,119,6,.2);}
.cs-hs-zone-label{font-size:.6rem;font-weight:700;color:transparent;text-align:center;padding:2px 4px;pointer-events:none;transition:color .2s;}
.cs-hs-zone.selected .cs-hs-zone-label,.cs-hs-zone.hs-correct .cs-hs-zone-label,.cs-hs-zone.hs-wrong .cs-hs-zone-label,.cs-hs-zone.hs-missed .cs-hs-zone-label{color:var(--text);font-size:.65rem;background:rgba(255,255,255,.85);border-radius:3px;padding:1px 4px;}
.cs-hs-counter{font-size:.78rem;color:var(--text-dim);margin-top:.5rem;font-weight:500;}

/* ── Matrix Grid ── */
.cs-matrix-wrap{margin-bottom:1rem;overflow:visible;}
.cs-matrix-tbl{width:100%;border-collapse:collapse;border:1px solid var(--border);border-radius:8px;overflow:hidden;font-size:.75rem;table-layout:fixed;}
.cs-matrix-tbl th{padding:.45rem .35rem;font-weight:700;color:var(--text-dim);background:var(--bg3);border:1px solid var(--border);font-size:.62rem;letter-spacing:.02em;text-transform:none;vertical-align:top;word-wrap:break-word;overflow-wrap:break-word;line-height:1.35;}
.cs-matrix-tbl th:first-child{width:38%;text-align:left;font-size:.65rem;}
.cs-mx-row{padding:.4rem .35rem;font-weight:500;color:var(--text);border:1px solid var(--border);font-size:.72rem;line-height:1.4;vertical-align:top;word-wrap:break-word;}
.cs-mx-cell{text-align:center;padding:.35rem .2rem;border:1px solid var(--border);vertical-align:middle;}
.cs-mx-radio{width:20px;height:20px;accent-color:var(--accent);cursor:pointer;}
/* Mobile matrix: stack as cards */
@media(max-width:700px){
  .cs-matrix-tbl,.cs-matrix-tbl thead,.cs-matrix-tbl tbody,.cs-matrix-tbl th,.cs-matrix-tbl td,.cs-matrix-tbl tr{display:block;width:100%;}
  .cs-matrix-tbl thead{position:absolute;top:-9999px;left:-9999px;}
  .cs-matrix-tbl tr{border:1.5px solid var(--border);border-radius:8px;margin-bottom:.65rem;padding:.5rem;background:var(--bg2);}
  .cs-mx-row{font-weight:600;font-size:.78rem;padding:.5rem;border:none;border-bottom:1px solid var(--border);margin-bottom:.35rem;}
  .cs-mx-cell{display:flex;align-items:center;gap:.5rem;padding:.35rem .5rem;border:none;text-align:left;justify-content:flex-start;}
  .cs-mx-cell::before{content:attr(data-col);font-size:.68rem;font-weight:600;color:var(--text-muted);flex:1;line-height:1.3;}
  .cs-mx-radio{flex-shrink:0;}
}

/* ── Placeholder ── */
.cs-placeholder{text-align:center;padding:2rem 1.5rem;background:var(--bg3);border:2px dashed var(--border);border-radius:12px;color:var(--text-muted);font-size:.85rem;line-height:1.6;}

/* ── Feedback ── */
.cs-fb{display:flex;gap:1rem;padding:1.25rem;border-radius:10px;font-size:.88rem;line-height:1.65;animation:fadeUp .3s ease;}
.cs-fb-correct{background:var(--correct-bg);border:1.5px solid var(--correct-bd);}
.cs-fb-wrong{background:var(--wrong-bg);border:1.5px solid var(--wrong-bd);}
.cs-fb-icon{font-size:1.4rem;font-weight:800;flex-shrink:0;line-height:1;}
.cs-fb-correct .cs-fb-icon{color:var(--correct);}
.cs-fb-wrong .cs-fb-icon{color:var(--wrong);}
.cs-fb-body{flex:1;}
.cs-fb-title{font-size:.95rem;font-weight:700;margin:0 0 .35rem;}
.cs-fb-correct .cs-fb-title{color:var(--correct);}
.cs-fb-wrong .cs-fb-title{color:var(--wrong);}
.cs-fb-body p{margin:.25rem 0;}
.cs-fb-detail{margin-top:.5rem;font-size:.85rem;color:var(--text-muted);}
.cs-fb-mnemonic{margin-top:.75rem;padding:.75rem;background:rgba(29,78,216,.04);border:1px solid rgba(29,78,216,.12);border-radius:8px;font-size:.82rem;color:var(--text);line-height:1.6;}

/* ── Question Actions ── */
.cs-q-actions{display:flex;gap:.75rem;margin-top:1.75rem;}
.cs-q-actions .btn{flex:1;justify-content:center;padding:.8rem 1.25rem;border-radius:10px;font-size:.9rem;}
.cs-next-btn{background:var(--correct)!important;border-color:var(--correct)!important;}
.cs-next-btn:hover{background:#15803d!important;}

/* ── Review Mode ── */
.cs-rv{animation:fadeUp .5s ease both;}
.cs-rv-hero{background:linear-gradient(135deg,#0f172a,#1e293b);border-radius:var(--radius-lg);padding:2rem;text-align:center;color:white;margin-bottom:1.5rem;}
.cs-rv-hero h2{font-size:1.5rem;font-weight:800;margin:0 0 .35rem;color:white;}
.cs-rv-hero p{margin:0;color:rgba(255,255,255,.6);font-size:.88rem;}
.cs-rv-case{background:var(--bg2);border:1px solid var(--border);border-radius:var(--radius-lg);padding:1.25rem;margin-bottom:1rem;}
.cs-rv-case h3{font-size:.95rem;font-weight:700;margin-bottom:1rem;color:var(--text);}
.cs-rv-q{display:flex;flex-wrap:wrap;align-items:center;gap:.5rem;padding:.65rem .85rem;border-radius:8px;margin-bottom:.4rem;border:1px solid var(--border);background:var(--bg3);}
.cs-rv-q.ok{border-color:var(--correct-bd);background:var(--correct-bg);}
.cs-rv-q.fail{border-color:var(--wrong-bd);background:var(--wrong-bg);}
.cs-rv-num{font-size:.68rem;font-weight:800;color:var(--text-dim);}
.cs-rv-step{font-size:.8rem;font-weight:700;color:var(--text);flex:1;}
.cs-rv-status{font-size:.6rem;font-weight:700;text-transform:uppercase;letter-spacing:.04em;}
.cs-rv-q.ok .cs-rv-status{color:var(--correct);}
.cs-rv-q.fail .cs-rv-status{color:var(--wrong);}
.cs-rv-q.skip .cs-rv-status{color:var(--text-dim);}
.cs-rv-stem{width:100%;font-size:.8rem;color:var(--text-muted);line-height:1.5;margin:.15rem 0 0;}

/* ── Case Study Responsive ── */
@media(max-width:900px){
  .cs-body{grid-template-columns:1fr;grid-template-rows:35vh 1fr;}
  .cs-left{border-right:none;border-bottom:1px solid var(--border);padding:1.25rem;}
  .cs-right-body{padding:1.25rem;}
  .cs-topnav-name{display:none;}
  .cs-topnav-plan{display:none;}
}
@media(max-width:600px){
  .cs-topnav{padding:0 .75rem;height:46px;}
  .cs-topnav-brand{font-size:.78rem;}
  .cs-left{padding:1rem;max-height:30vh;}
  .cs-right-body{padding:1rem;}
  .cs-q-card{padding:1.25rem;}
  .cs-seg-label{font-size:.5rem;}
}

