/* =====================================================================
   Assessment Engine - design tokens
   ===================================================================== */
:root {
  color-scheme: light;
  --page: #f2f3f3;
  --surface: #ffffff;
  --surface-2: #f8f8f7;
  --surface-3: #eef0f1;
  --ink: #0f1111;
  --ink-2: #414d5c;
  --muted: #687078;
  --line: #d5dbdb;
  --line-soft: #e9ebed;
  --brand: #232f3e;          /* AWS squid ink */
  --brand-2: #161e2d;
  --accent: #ff9900;         /* AWS orange */
  --accent-ink: #0f1111;
  --primary: #0972d3;
  --primary-hover: #065eb0;
  --primary-soft: #e8f2fc;
  --focus: #0972d3;
  /* data-viz (validated reference palette) */
  --series-1: #2a78d6;
  --good: #0ca30c;
  --good-ink: #006300;
  --good-soft: #e9f7e9;
  --bad: #d03b3b;
  --bad-ink: #b02a2a;
  --bad-soft: #fdecec;
  --warn: #fab219;
  --warn-ink: #8a5a00;
  --warn-soft: #fff6e0;
  --grid: #e1e0d9;
  --axis: #c3c2b7;
  --chart-muted: #b9b8b1;
  --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.05);
  --shadow-lg: 0 12px 40px rgba(15,17,17,.18);
  --radius: 12px;
  --radius-s: 8px;
  --font: "Amazon Ember", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0d1117; --surface: #161b22; --surface-2: #1b2129; --surface-3: #232a33;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8d96a0; --line: #30363d; --line-soft: #262c34;
    --primary: #539fe5; --primary-hover: #7cb6ec; --primary-soft: #14273d; --focus: #7cb6ec;
    --series-1: #3987e5; --good-ink: #4fd14f; --good-soft: #0f2a12; --bad: #e66767; --bad-ink: #ff8f8f; --bad-soft: #351616;
    --warn-ink: #fab219; --warn-soft: #3a2c0b; --grid: #2c2c2a; --axis: #383835; --chart-muted: #55554f;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0d1117; --surface: #161b22; --surface-2: #1b2129; --surface-3: #232a33;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #8d96a0; --line: #30363d; --line-soft: #262c34;
  --primary: #539fe5; --primary-hover: #7cb6ec; --primary-soft: #14273d; --focus: #7cb6ec;
  --series-1: #3987e5; --good-ink: #4fd14f; --good-soft: #0f2a12; --bad: #e66767; --bad-ink: #ff8f8f; --bad-soft: #351616;
  --warn-ink: #fab219; --warn-soft: #3a2c0b; --grid: #2c2c2a; --axis: #383835; --chart-muted: #55554f;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.3);
}

/* =====================================================================
   Base
   ===================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--font); background: var(--page); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .75em; }
code { font-family: var(--mono); font-size: .9em; background: var(--surface-3); padding: .1em .35em; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.right { text-align: right; }
.row { display: flex; align-items: center; }
.wrap { flex-wrap: wrap; }
.gap-s { gap: .5rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .75rem; font-weight: 700; color: var(--muted); margin-bottom: .25rem; }
.lead { font-size: 1.1rem; }
.link { font-weight: 600; }
.print-only { display: none; }
[hidden] { display: none !important; }

/* =====================================================================
   Buttons, chips, badges
   ===================================================================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border: 1px solid transparent; border-radius: 20px; padding: .5rem 1.1rem; font-weight: 700; font-size: .9rem; cursor: pointer; text-decoration: none !important; transition: background .15s, border-color .15s, transform .05s, box-shadow .15s; white-space: nowrap; line-height: 1.3; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-secondary { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover:not(:disabled) { background: var(--primary-soft); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-3); }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover:not(:disabled) { background: #ec7211; }
.btn-danger { background: var(--bad); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.92); }
.btn-sm { padding: .3rem .75rem; font-size: .8rem; }
.btn-lg { padding: .75rem 1.6rem; font-size: 1rem; }
.btn-block { width: 100%; }
.icon-btn { background: transparent; border: 0; width: 36px; height: 36px; border-radius: 50%; cursor: pointer; display: inline-grid; place-items: center; color: inherit; }
.icon-btn:hover { background: rgba(127,127,127,.15); }

.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); font-size: .78rem; font-weight: 600; white-space: nowrap; }
.chip-soft { background: var(--primary-soft); color: var(--primary); }
.chip-accent { background: #fff1db; color: #8a4b00; }
.chip-warn { background: var(--warn-soft); color: var(--warn-ink); }
.chip-link { text-decoration: none !important; }
.chip-link:hover { background: var(--primary-soft); color: var(--primary); }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .6rem; }

.badge { display: inline-flex; align-items: center; gap: .3rem; border-radius: 6px; padding: .15rem .55rem; font-size: .78rem; font-weight: 700; white-space: nowrap; }
.badge-good { background: var(--good-soft); color: var(--good-ink); }
.badge-bad { background: var(--bad-soft); color: var(--bad-ink); }
.badge-warn { background: var(--warn-soft); color: var(--warn-ink); }
.badge-info { background: var(--primary-soft); color: var(--primary); }
.badge-muted { background: var(--surface-3); color: var(--muted); }
.badge-lg { font-size: 1rem; padding: .3rem .8rem; letter-spacing: .04em; }
.tag { display: inline-block; margin-left: .4rem; font-size: .7rem; font-weight: 700; padding: .05rem .45rem; border-radius: 4px; vertical-align: middle; }
.tag-good { background: var(--good-soft); color: var(--good-ink); }
.tag-bad { background: var(--bad-soft); color: var(--bad-ink); }

/* =====================================================================
   App shell
   ===================================================================== */
.topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1.5rem; padding: 0 1.25rem; height: 56px; background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: .55rem; color: inherit; text-decoration: none !important; }
.brand-mark { display: inline-flex; }
.brand-text { font-size: 1.05rem; letter-spacing: -.01em; color: #fff; }
.brand-text b { color: var(--accent); margin-left: .15rem; }
.nav { display: flex; gap: .25rem; flex: 1; overflow-x: auto; }
.nav-link { color: #d1d5db; padding: .45rem .8rem; border-radius: 6px; font-weight: 600; font-size: .9rem; text-decoration: none !important; white-space: nowrap; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #fff; box-shadow: inset 0 -3px 0 var(--accent); border-radius: 0; }
.topbar-right { display: flex; align-items: center; gap: .5rem; }
.topbar .icon-btn { color: #fff; }
.user-menu { position: relative; }
.user-btn { display: flex; align-items: center; gap: .5rem; background: transparent; border: 0; color: #fff; cursor: pointer; padding: .25rem .5rem; border-radius: 6px; }
.user-btn:hover { background: rgba(255,255,255,.08); }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, #ffb84d, #ff7a00); color: #232f3e; font-weight: 800; font-size: .8rem; flex: none; }
.menu { position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow-lg); padding: .35rem; z-index: 40; }
.menu button, .menu a { display: block; width: 100%; text-align: left; background: none; border: 0; padding: .55rem .7rem; border-radius: 6px; cursor: pointer; color: var(--ink); font-size: .9rem; text-decoration: none !important; }
.menu button:hover, .menu a:hover { background: var(--surface-3); }
.menu .danger { color: var(--bad-ink); }
.menu-head { padding: .5rem .7rem .6rem; border-bottom: 1px solid var(--line-soft); margin-bottom: .3rem; display: grid; }
.menu-head span { color: var(--muted); font-size: .8rem; }
.view { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; outline: none; }
.site-foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 1rem 1.25rem 2rem; }
@media (max-width: 720px) { .user-name { display: none; } .topbar { gap: .6rem; padding: 0 .75rem; } .brand-text { display: none; } .view { padding: 1rem 1rem 2rem; } }

.loading { display: grid; place-items: center; min-height: 40vh; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.card { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem 1.4rem; margin-bottom: 1.25rem; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1.5rem; margin: .5rem 0 1.5rem; flex-wrap: wrap; }
.page-head h1 { margin-bottom: .3rem; }
.empty-state { text-align: center; padding: 3rem 1.5rem; max-width: 640px; margin: 2rem auto; }

/* =====================================================================
   Login
   ===================================================================== */
body.bare { background: var(--page); }
.auth { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.auth-hero { position: relative; overflow: hidden; background: radial-gradient(1200px 600px at 10% 0%, #2f4058 0%, #232f3e 45%, #121a26 100%); color: #fff; display: flex; align-items: center; padding: 3rem; }
.auth-orbs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .45; animation: float 14s ease-in-out infinite; }
.auth-orbs i:nth-child(1) { width: 380px; height: 380px; background: #ff9900; top: -120px; right: -80px; }
.auth-orbs i:nth-child(2) { width: 300px; height: 300px; background: #2a78d6; bottom: -100px; left: -60px; animation-delay: -5s; }
.auth-orbs i:nth-child(3) { width: 220px; height: 220px; background: #8b5cf6; top: 45%; left: 55%; animation-delay: -9s; opacity: .25; }
@keyframes float { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(30px,-25px) scale(1.08); } }
.auth-hero-inner { position: relative; max-width: 560px; }
.auth-hero h1 { font-size: clamp(2rem, 3.4vw, 2.9rem); margin: 2.2rem 0 1rem; letter-spacing: -.02em; }
.auth-hero .hl { background: linear-gradient(90deg, #ffb84d, #ff7a00); -webkit-background-clip: text; background-clip: text; color: transparent; }
.auth-hero p { color: #c9d1db; font-size: 1.05rem; }
.auth-facts { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.auth-facts li { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: 12px; padding: .8rem; backdrop-filter: blur(6px); }
.auth-facts b { display: block; font-size: 1.6rem; color: #ffb84d; }
.auth-facts span { font-size: .78rem; color: #c9d1db; }
.auth-ticker { display: flex; flex-wrap: wrap; gap: .4rem; }
.auth-ticker span { font-size: .78rem; padding: .25rem .65rem; border-radius: 999px; border: 1px solid rgba(255,255,255,.18); color: #e5e7eb; }
.auth-panel { display: grid; place-items: center; padding: 2rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 380px; display: grid; gap: 1rem; }
.auth-card h2 { font-size: 1.6rem; margin: 0; }
.auth-card label, .form label { display: grid; gap: .35rem; font-weight: 600; font-size: .88rem; }
.auth-card input, .form input, .form select, select, .search { width: 100%; padding: .65rem .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
select { width: auto; }
.form select { width: 100%; }
.auth-card input:focus, .form input:focus, select:focus, .search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(9,114,211,.25); }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 6rem; }
.pw-toggle { position: absolute; right: .35rem; top: 50%; transform: translateY(-50%); background: var(--surface-3); border: 0; border-radius: 6px; padding: .3rem .6rem; font-size: .78rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.form-error { color: var(--bad-ink); background: var(--bad-soft); padding: .55rem .75rem; border-radius: 8px; font-size: .88rem; margin: 0; }
.auth-note { font-size: .8rem; color: var(--muted); margin: 0; }
.shake { animation: shake .4s; }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-8px); } 40%,80% { transform: translateX(8px); } }
.auth-bg { min-height: 100vh; background: radial-gradient(1200px 600px at 10% 0%, #2f4058 0%, #232f3e 45%, #121a26 100%); }
.brand-light .brand-text { color: #fff; font-size: 1.2rem; }
@media (max-width: 900px) { .auth { grid-template-columns: 1fr; } .auth-hero { padding: 2rem 1.25rem; } .auth-facts { grid-template-columns: repeat(2, 1fr); } .auth-hero h1 { margin-top: 1.25rem; } }

/* =====================================================================
   Home
   ===================================================================== */
.hero-greet { background: linear-gradient(120deg, var(--brand) 0%, #2f4058 60%, #3b4f6b 100%); color: #fff; border-radius: var(--radius); padding: 1.6rem 1.8rem; margin-top: 0; position: relative; overflow: hidden; }
.hero-greet::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,153,0,.45), transparent 70%); }
.hero-greet .eyebrow { color: #ffb84d; }
.hero-greet .muted { color: #c9d1db; margin: 0; }
.greet-stats { display: flex; gap: .75rem; position: relative; z-index: 1; }
.greet-stats div { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); border-radius: 10px; padding: .6rem 1rem; min-width: 92px; text-align: center; }
.page-head:not(.hero-greet) .greet-stats div { background: var(--surface); border-color: var(--line-soft); box-shadow: var(--shadow); }
.greet-stats b { display: block; font-size: 1.45rem; }
.greet-stats span { font-size: .75rem; opacity: .8; }

.exam-head { display: flex; justify-content: space-between; gap: 1.5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.exam-id { display: flex; gap: 1.1rem; flex: 1; min-width: 280px; }
.exam-id h2 { font-size: 1.35rem; margin-bottom: .25rem; }
.exam-badge { flex: none; width: 92px; height: 104px; border-radius: 14px; background: linear-gradient(160deg, #2f4058, #161e2d); color: #fff; display: grid; place-content: center; text-align: center; gap: .1rem; box-shadow: inset 0 0 0 2px rgba(255,153,0,.6), var(--shadow); clip-path: polygon(50% 0, 100% 18%, 100% 82%, 50% 100%, 0 82%, 0 18%); }
.exam-badge span { font-size: .7rem; color: #ffb84d; font-weight: 800; letter-spacing: .1em; }
.exam-badge b { font-size: .95rem; }
.exam-badge small { font-size: .5rem; color: #c9d1db; text-transform: uppercase; letter-spacing: .06em; }
.readiness-mini { display: grid; gap: .1rem; min-width: 230px; padding: 1rem 1.2rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); text-decoration: none !important; transition: transform .15s, box-shadow .15s; }
.readiness-mini:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.rm-label { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.rm-score { font-size: 2.2rem; font-weight: 800; line-height: 1.1; }
.rm-verdict { font-weight: 700; }
.rm-prob { font-size: .8rem; color: var(--muted); }
.rm-cta { font-size: .82rem; color: var(--primary); font-weight: 700; margin-top: .3rem; }
.v-ready { border-color: rgba(12,163,12,.45); }
.v-ready .rm-verdict, .verdict.v-ready { color: var(--good-ink); }
.v-almost .rm-verdict, .verdict.v-almost { color: var(--warn-ink); }
.v-not .rm-verdict, .verdict.v-not { color: var(--bad-ink); }

.set-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.set-card { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; background: var(--surface); display: flex; flex-direction: column; gap: .55rem; transition: transform .15s, box-shadow .15s, border-color .15s; }
.set-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--primary); }
.set-card h3 { margin: 0; font-size: 1.1rem; }
.set-card p { margin: 0; }
.set-top { display: flex; justify-content: space-between; align-items: center; }
.set-num { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-weight: 800; background: var(--brand); color: var(--accent); }
.state-passed .set-num { background: var(--good); color: #fff; }
.state-progress .set-num { background: var(--primary); color: #fff; }
.set-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; padding: .6rem 0; border-top: 1px dashed var(--line-soft); border-bottom: 1px dashed var(--line-soft); }
.set-stats div { display: grid; }
.set-stats span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.set-stats b { font-size: 1.2rem; }
.set-progress { position: relative; height: 6px; background: var(--surface-3); border-radius: 3px; }
.set-progress > div { height: 100%; border-radius: 3px; }
.set-progress > div.good { background: var(--good); }
.set-progress > div.bad { background: var(--bad); }
.set-progress > i { position: absolute; top: -3px; width: 2px; height: 12px; background: var(--ink-2); }
.set-actions { display: grid; gap: .45rem; margin-top: auto; }
.resume-box { margin-top: auto; background: var(--primary-soft); border-radius: 8px; padding: .65rem; display: grid; gap: .5rem; font-size: .85rem; font-weight: 600; color: var(--primary); }
.set-card.locked { opacity: .65; border-style: dashed; }
.set-card.locked:hover { transform: none; box-shadow: none; border-color: var(--line); }
.set-card.drill { background: linear-gradient(160deg, rgba(255,153,0,.1), transparent 70%), var(--surface); border-color: rgba(255,153,0,.45); }
.set-card.drill .set-num { background: var(--accent); color: var(--brand); }
.set-card.drill .row { margin-top: auto; }
.drill-domains { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.drill-domains legend { width: 100%; margin-bottom: .3rem; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: .2rem .65rem; border-radius: 999px; border: 1px solid var(--line); font-size: .8rem; font-weight: 700; cursor: pointer; }
.chip-check input:checked + span { background: var(--brand); color: var(--accent); border-color: var(--brand); }
.chip-check input:focus-visible + span { outline: 2px solid var(--focus); }

/* tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: .6rem .7rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: .7rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tbody tr:hover { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.row-disabled { opacity: .55; }

/* =====================================================================
   Exam (Pearson VUE-style chrome)
   ===================================================================== */
.exam-app { --q-scale: 1; display: grid; grid-template-rows: auto auto 1fr auto; height: 100vh; height: 100dvh; background: var(--surface); }
.exam-top { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; background: var(--brand); color: #fff; padding: .55rem 1rem; }
.et-left { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.et-logo { display: inline-flex; flex: none; }
.et-left > div { min-width: 0; }
.et-title { font-weight: 700; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.et-sub { font-size: .75rem; color: #c9d1db; }
.et-center { font-size: .95rem; text-align: center; white-space: nowrap; }
.et-right { justify-self: end; }
.timer { display: grid; text-align: right; line-height: 1.15; padding: .2rem .7rem; border-radius: 8px; }
.timer-label { font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: #c9d1db; }
.timer-val { font-family: var(--mono); font-size: 1.2rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timer.warn { background: rgba(250,178,25,.18); }
.timer.warn .timer-val { color: #ffcf66; }
.timer.crit { background: rgba(208,59,59,.3); animation: pulse 1s ease-in-out infinite; }
.timer.crit .timer-val { color: #ffb3b3; }
@keyframes pulse { 50% { background: rgba(208,59,59,.5); } }
.exam-sub { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .45rem 1rem; background: #e9ebed; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
:root[data-theme="dark"] .exam-sub { background: #1b2129; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .exam-sub { background: #1b2129; } }
.flag-toggle { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .9rem; cursor: pointer; padding: .3rem .7rem; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); user-select: none; }
.flag-toggle input { accent-color: var(--accent); width: 16px; height: 16px; }
.flag-toggle.on { background: #fff1db; border-color: var(--accent); color: #8a4b00; }
.flag-icon { color: var(--accent); font-size: 1.05rem; }
.answered-meter { display: flex; align-items: center; gap: .6rem; font-size: .8rem; color: var(--ink-2); flex: 1; justify-content: center; min-width: 200px; }
.am-bar { width: 160px; height: 6px; background: var(--surface-3); border-radius: 3px; overflow: hidden; }
.am-bar div { height: 100%; background: var(--series-1); transition: width .3s; }
.save-state { color: var(--muted); font-size: .75rem; }
.save-state.warn { color: var(--bad-ink); }
.sub-tools { display: flex; gap: .3rem; flex-wrap: wrap; }
.tool-btn { border: 1px solid var(--line); background: var(--surface); padding: .3rem .6rem; border-radius: 6px; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.tool-btn:hover { border-color: var(--primary); color: var(--primary); }
.tool-btn[aria-pressed="true"] { background: var(--primary-soft); color: var(--primary); border-color: var(--primary); }

.exam-body { display: grid; grid-template-columns: 1fr 0; overflow: hidden; transition: grid-template-columns .25s; }
.exam-body.nav-open { grid-template-columns: 1fr 260px; }
.q-pane { overflow-y: auto; padding: 2rem clamp(1rem, 5vw, 4rem) 3rem; outline: none; }
.nav-pane { overflow-y: auto; border-left: 1px solid var(--line); background: var(--surface-2); padding: 1rem; min-width: 0; }
.exam-body:not(.nav-open) .nav-pane { padding: 0; border: 0; overflow: hidden; }
.question { max-width: 860px; margin: 0 auto; font-size: calc(1rem * var(--q-scale)); }
.q-meta { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: 1rem; }
.q-num { font-weight: 800; font-size: 1.1em; }
.q-type { font-size: .78em; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: .1rem .45rem; }
.q-flagged { color: #c45500; font-weight: 700; font-size: .85em; }
.q-stem { font-size: 1.08em; line-height: 1.6; margin-bottom: 1.25rem; }
.q-hint { color: var(--ink-2); font-size: .9em; margin-bottom: .75rem; display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.options { display: grid; gap: .6rem; }
.opt { position: relative; display: grid; grid-template-columns: auto auto 1fr auto; align-items: start; gap: .75rem; padding: .85rem 1rem; border: 1.5px solid var(--line); border-radius: 10px; cursor: pointer; background: var(--surface); transition: border-color .12s, background .12s, box-shadow .12s; user-select: none; }
.opt:hover:not(.locked) { border-color: var(--primary); background: var(--primary-soft); }
.opt.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: inset 4px 0 0 var(--primary); }
.opt-key { font-weight: 800; color: var(--muted); width: 1.2rem; padding-top: .05rem; }
.opt-control { width: 20px; height: 20px; border: 2px solid var(--muted); margin-top: .15rem; flex: none; display: grid; place-items: center; background: var(--surface); }
.opt-control.round { border-radius: 50%; }
.opt-control.square { border-radius: 5px; }
.opt.selected .opt-control { border-color: var(--primary); background: var(--primary); }
.opt.selected .opt-control.round::after { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #fff; }
.opt.selected .opt-control.square::after { content: "✓"; color: #fff; font-size: 13px; font-weight: 900; line-height: 1; }
.opt-text { line-height: 1.5; }
.opt-strike { opacity: 0; border: 0; background: transparent; cursor: pointer; font-size: 1.05rem; color: var(--muted); border-radius: 6px; padding: 0 .3rem; }
.opt:hover .opt-strike, .opt.eliminated .opt-strike, .opt-strike:focus-visible { opacity: 1; }
.opt-strike:hover { color: var(--bad-ink); background: var(--bad-soft); }
.opt.eliminated .opt-text { text-decoration: line-through; color: var(--muted); }
.opt.eliminated { background: var(--surface-2); border-style: dashed; }
.opt.locked { cursor: default; }
.opt.is-correct { border-color: var(--good); background: var(--good-soft); box-shadow: inset 4px 0 0 var(--good); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); box-shadow: inset 4px 0 0 var(--bad); }
.opt-mark { font-weight: 900; font-size: 1.1rem; }
.opt.is-correct .opt-mark { color: var(--good-ink); }
.opt.is-wrong .opt-mark { color: var(--bad-ink); }
.opt-note { display: block; font-size: .86em; color: var(--ink-2); margin-top: .35rem; }
.order-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.order-item { display: grid; grid-template-columns: auto auto 1fr auto; align-items: center; gap: .75rem; padding: .75rem 1rem; border: 1.5px solid var(--line); border-radius: 10px; background: var(--surface); cursor: grab; }
.order-item.dragging { opacity: .5; border-style: dashed; }
.order-list.locked .order-item { cursor: default; }
.order-item.is-correct { border-color: var(--good); background: var(--good-soft); }
.order-item.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.drag { color: var(--muted); letter-spacing: -2px; }
.order-pos { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--accent); display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.order-btns { display: flex; gap: .25rem; }
.order-btns button { border: 1px solid var(--line); background: var(--surface); border-radius: 6px; width: 30px; height: 28px; cursor: pointer; }
.order-btns button:disabled { opacity: .3; cursor: default; }
.correct-order { margin-top: 1rem; background: var(--good-soft); border-radius: 10px; padding: .75rem 1rem; }
.match-table { display: grid; gap: .55rem; }
.match-row { display: grid; grid-template-columns: 1fr auto minmax(220px, 1.2fr); gap: .75rem; align-items: center; padding: .7rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; }
.match-row select { width: 100%; padding: .55rem; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.match-row.is-correct { border-color: var(--good); background: var(--good-soft); }
.match-row.is-wrong { border-color: var(--bad); background: var(--bad-soft); }
.match-prompt { font-weight: 600; }
.match-arrow { color: var(--muted); }
.match-correct { grid-column: 3; color: var(--good-ink); font-size: .88em; font-weight: 600; }
@media (max-width: 720px) { .match-row { grid-template-columns: 1fr; } .match-arrow { display: none; } .match-correct { grid-column: 1; } }
.q-actions { margin-top: 1.25rem; display: flex; gap: .5rem; }
.feedback { margin-top: 1.25rem; border-radius: 12px; padding: 1rem 1.2rem; border-left: 5px solid; animation: slidein .25s ease-out; }
.fb-good { background: var(--good-soft); border-color: var(--good); }
.fb-bad { background: var(--bad-soft); border-color: var(--bad); }
.feedback h3 { margin-bottom: .4rem; }
.fb-good h3 { color: var(--good-ink); }
.fb-bad h3 { color: var(--bad-ink); }
.fb-ref { font-size: .85em; color: var(--ink-2); margin: .5rem 0 0; }
@keyframes slidein { from { opacity: 0; transform: translateY(6px); } }

.nav-head { display: flex; justify-content: space-between; margin-bottom: .6rem; }
.nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: .35rem; }
.nav-q { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; height: 34px; font-size: .8rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.nav-q:hover { border-color: var(--primary); }
.nav-q.answered { background: var(--brand); color: #fff; border-color: var(--brand); }
:root[data-theme="dark"] .nav-q.answered { background: #3b4f6b; }
.nav-q.flagged::after { content: ""; position: absolute; top: -3px; right: -3px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface-2); }
.nav-q.current { outline: 2px solid var(--primary); outline-offset: 1px; }
.nav-q.right { box-shadow: inset 0 -4px 0 var(--good); }
.nav-q.wrong { box-shadow: inset 0 -4px 0 var(--bad); }
.nav-legend { display: grid; gap: .3rem; margin-top: 1rem; font-size: .75rem; color: var(--muted); }
.nav-legend span { display: flex; align-items: center; gap: .4rem; }
.lg { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid var(--line); background: var(--surface); position: relative; }
.lg.answered { background: var(--brand); border-color: var(--brand); }
.lg.flagged::after { content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.lg.right { box-shadow: inset 0 -3px 0 var(--good); }
.lg.wrong { box-shadow: inset 0 -3px 0 var(--bad); }

.exam-foot { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; background: var(--brand); }
.foot-mid { flex: 1; display: flex; justify-content: center; align-items: center; gap: .75rem; }
.btn-exam { background: #fff; color: var(--brand); border-radius: 6px; min-width: 120px; }
.btn-exam:hover:not(:disabled) { background: #e9ebed; }
.btn-exam-outline { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.5); border-radius: 6px; }
.btn-exam-outline:hover { background: rgba(255,255,255,.1); }
.btn-exam-end { background: var(--accent); color: var(--brand); border-radius: 6px; }
.btn-exam-end:hover { background: #ec7211; }
.filter-pill { color: #fff; font-size: .8rem; background: rgba(255,255,255,.12); border-radius: 999px; padding: .25rem .4rem .25rem .8rem; display: inline-flex; gap: .4rem; align-items: center; }
.filter-pill button { background: rgba(255,255,255,.2); border: 0; color: #fff; border-radius: 50%; width: 20px; height: 20px; cursor: pointer; font-size: .7rem; }
@media (max-width: 760px) {
  .exam-top { grid-template-columns: minmax(0,1fr) auto; }
  .timer-label { display: none; }
  .et-center { display: none; }
  .exam-body.nav-open { grid-template-columns: 1fr; }
  .exam-body.nav-open .q-pane { display: none; }
  .exam-foot { flex-wrap: wrap; }
  .btn-exam { min-width: 0; flex: 1; }
  .foot-mid { order: 3; flex-basis: 100%; }
  .answered-meter { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .opt { grid-template-columns: auto 1fr auto; } .opt-key { display: none; }
}

.review-screen { max-width: 1000px; margin: 0 auto; }
.review-summary { display: flex; gap: .75rem; margin: 1rem 0; }
.review-summary div { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: .6rem 1.1rem; text-align: center; }
.review-summary div.warn { background: var(--warn-soft); border-color: var(--warn); }
.review-summary b { display: block; font-size: 1.5rem; }
.review-summary span { font-size: .78rem; color: var(--muted); }
.review-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.review-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; }
.review-item { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: .6rem .75rem; cursor: pointer; display: grid; gap: .15rem; }
.review-item:hover { border-color: var(--primary); }
.review-item.incomplete { border-left: 4px solid var(--warn); }
.review-item.flagged .ri-num { color: #c45500; }
.ri-num { font-weight: 800; font-size: .85rem; }
.ri-state { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.review-item.incomplete .ri-state { color: var(--warn-ink); }
.ri-stem { font-size: .8rem; color: var(--ink-2); }

/* intro */
.exam-app.intro { grid-template-rows: auto 1fr; }
.intro-body { overflow-y: auto; padding: 2rem 1rem; background: var(--page); }
.intro-card { max-width: 820px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); padding: 2rem clamp(1.25rem, 4vw, 2.5rem); box-shadow: var(--shadow); border-top: 5px solid var(--accent); }
.intro-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; margin: 1.25rem 0 1.5rem; }
.intro-grid div { background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: 10px; padding: .75rem; display: grid; }
.intro-grid span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.intro-grid b { font-size: 1.3rem; }
@media (max-width: 640px) { .intro-grid { grid-template-columns: repeat(2, 1fr); } }
.intro-list { padding-left: 1.2rem; display: grid; gap: .45rem; }
.shortcuts { margin: 1rem 0; border: 1px solid var(--line-soft); border-radius: 10px; padding: .6rem 1rem; }
.shortcuts summary { cursor: pointer; font-weight: 700; }
.kbd-grid { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin-top: .75rem; font-size: .9rem; }
kbd { font-family: var(--mono); font-size: .8rem; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: .05rem .4rem; background: var(--surface-2); }
.agree { display: flex; gap: .6rem; align-items: center; font-weight: 600; margin: 1.25rem 0; padding: .8rem 1rem; background: var(--warn-soft); border-radius: 10px; cursor: pointer; }
.agree input { width: 18px; height: 18px; accent-color: var(--accent); }
.intro-actions { display: flex; justify-content: flex-end; gap: .75rem; margin-top: 1rem; }

.submit-overlay, .pdf-overlay { position: fixed; inset: 0; background: rgba(15,17,17,.55); display: grid; place-items: center; z-index: 100; backdrop-filter: blur(2px); }
.pdf-overlay-card { background: var(--surface); color: var(--ink); padding: 1.5rem 2rem; border-radius: 12px; display: flex; gap: 1rem; align-items: center; box-shadow: var(--shadow-lg); font-weight: 600; }

/* =====================================================================
   Reports & dashboards
   ===================================================================== */
.report-actions { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.report-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 5px solid var(--accent); }
.report-head h1 { font-size: 1.5rem; margin-bottom: .2rem; }
.report-head p { margin: 0; }
.report-logo { font-weight: 900; color: var(--accent); background: var(--brand); padding: .6rem .9rem; border-radius: 10px; letter-spacing: .04em; white-space: nowrap; }
.score-hero { display: grid; grid-template-columns: 300px 1fr; gap: 1.5rem; align-items: center; }
.score-hero h2 { font-size: 1.3rem; margin: .7rem 0; }
.hero-pass { background: linear-gradient(120deg, rgba(12,163,12,.08), rgba(12,163,12,0) 60%), var(--surface); }
.hero-fail { background: linear-gradient(120deg, rgba(208,59,59,.07), rgba(208,59,59,0) 60%), var(--surface); }
.readiness-hero.v-ready { background: linear-gradient(120deg, rgba(12,163,12,.09), rgba(12,163,12,0) 60%), var(--surface); }
.readiness-hero.v-almost { background: linear-gradient(120deg, rgba(250,178,25,.12), rgba(250,178,25,0) 60%), var(--surface); }
.readiness-hero.v-not { background: linear-gradient(120deg, rgba(208,59,59,.07), rgba(208,59,59,0) 60%), var(--surface); }
@media (max-width: 760px) { .score-hero { grid-template-columns: 1fr; } .score-gauge { max-width: 300px; margin: 0 auto; } }
.verdict { font-weight: 800; font-size: 1.05rem; display: inline-flex; gap: .35rem; align-items: center; padding: .25rem .75rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); }
.prob { color: var(--ink-2); }
.prob b { font-size: 1.2rem; color: var(--ink); }

.gauge { width: 100%; height: auto; display: block; }
.gauge-track { fill: none; stroke: var(--surface-3); stroke-width: 18; stroke-linecap: round; }
.gauge-value { fill: none; stroke-width: 18; stroke-linecap: round; }
.gauge-good { stroke: var(--good); }
.gauge-bad { stroke: var(--bad); }
.gauge-band { fill: none; stroke: var(--series-1); stroke-width: 5; stroke-linecap: round; opacity: .55; }
.gauge-pass { stroke: var(--ink); stroke-width: 2.5; }
.gauge-pass-label { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.gauge-score { fill: var(--ink); font-size: 46px; font-weight: 800; }
.gauge-caption { fill: var(--muted); font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.gauge-end { fill: var(--muted); font-size: 11px; }

.tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: .75rem; margin-bottom: 1.25rem; }
@media (max-width: 1000px) { .tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .tiles { grid-template-columns: repeat(2, 1fr); } }
.tile { background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--radius); padding: .9rem 1rem; display: grid; gap: .1rem; box-shadow: var(--shadow); }
.tile-label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; }
.tile-value { font-size: 1.55rem; font-weight: 800; line-height: 1.2; }
.tile-sub { font-size: .78rem; color: var(--ink-2); }

.meter { position: relative; height: 10px; background: var(--surface-3); border-radius: 5px; flex: 1; min-width: 80px; }
.meter-thin { height: 7px; }
.meter-fill { height: 100%; border-radius: 5px; background: var(--series-1); transition: width .6s cubic-bezier(.2,.8,.2,1); }
.meter-good { background: var(--good); }
.meter-bad { background: var(--bad); }
.meter-mark { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.meter-val { font-size: .8rem; font-weight: 700; font-variant-numeric: tabular-nums; margin-left: .5rem; }
.meter-cell { display: flex; align-items: center; min-width: 180px; }

.task-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 1rem 2rem; }
@media (max-width: 520px) { .task-grid { grid-template-columns: 1fr; } }
.task-group h3 { font-size: .9rem; color: var(--ink-2); border-bottom: 1px solid var(--line-soft); padding-bottom: .35rem; }
.task-row { display: grid; grid-template-columns: 2.4rem 1fr 120px 3rem; gap: .6rem; align-items: center; padding: .3rem 0; font-size: .86rem; }
.task-id { font-weight: 800; }
.task-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; }
@media (max-width: 600px) { .task-row { grid-template-columns: 2.4rem 1fr 3rem; } .task-bar { grid-column: 1 / -1; } }

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .tick { fill: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .threshold { stroke: var(--ink-2); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .threshold-label { fill: var(--ink-2); font-size: 11px; font-weight: 700; }
.chart .series-line { fill: none; stroke: var(--series-1); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .series-dot { stroke: var(--surface); stroke-width: 2; }
.chart .dot-good { fill: var(--good); }
.chart .dot-bad { fill: var(--bad); }
.chart .direct-label { fill: var(--ink); font-size: 13px; font-weight: 800; }
.chart .hit { fill: transparent; cursor: crosshair; }
.chart .hit:hover { fill: rgba(42,120,214,.08); }
.chart .bar-good { fill: var(--good); }
.chart .bar-bad { fill: var(--bad); }
.chart .bar-muted { fill: var(--chart-muted); }
.chart .flag-dot { fill: var(--accent); }
.tl-col:hover .bar-good, .tl-col:hover .bar-bad, .tl-col:hover .bar-muted { opacity: .75; }
.legend { display: flex; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: .35rem; }
.legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-good { background: var(--good); } .lg-bad { background: var(--bad); } .lg-muted { background: var(--chart-muted); }
.lg-flag { background: var(--accent); border-radius: 50% !important; width: 8px !important; height: 8px !important; }

.insight-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.insight-grid .card { margin-bottom: 1.25rem; }
@media (max-width: 900px) { .insight-grid { grid-template-columns: 1fr; } }
.insights { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.insights li { padding: .6rem .8rem .6rem 2.2rem; border-radius: 8px; background: var(--surface-2); position: relative; font-size: .9rem; }
.insights li::before { content: "i"; position: absolute; left: .7rem; top: .65rem; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 900; background: var(--series-1); color: #fff; }
.insights li.ins-good::before { content: "✓"; background: var(--good); }
.insights li.ins-bad::before { content: "!"; background: var(--bad); }
.focus-list { padding-left: 1.2rem; display: grid; gap: 1rem; margin: 0; }
.focus-head { display: flex; justify-content: space-between; gap: .75rem; align-items: center; }
.topics { margin: .4rem 0; padding-left: 1.1rem; font-size: .86rem; color: var(--ink-2); }
.resources { display: flex; flex-wrap: wrap; gap: .3rem .9rem; font-size: .82rem; font-weight: 600; margin-top: .3rem; }

.review-head-sec { margin-top: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin-bottom: 1rem; position: sticky; top: 56px; z-index: 5; background: var(--page); padding: .6rem 0; }
.filter-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: .35rem .85rem; font-size: .82rem; font-weight: 700; cursor: pointer; color: var(--ink-2); }
.filter-chip:hover { border-color: var(--primary); }
.filter-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.filters select { padding: .35rem .6rem; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; }
.rq { background: var(--surface); border: 1px solid var(--line-soft); border-left: 5px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.3rem; margin-bottom: 1rem; box-shadow: var(--shadow); }
.rq-correct { border-left-color: var(--good); }
.rq-incorrect { border-left-color: var(--bad); }
.rq-unanswered { border-left-color: var(--chart-muted); }
.rq-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .75rem; }
.rq-num { font-weight: 800; }
.rq-status { font-weight: 800; font-size: .85rem; }
.rq-correct .rq-status { color: var(--good-ink); }
.rq-incorrect .rq-status { color: var(--bad-ink); }
.rq-unanswered .rq-status { color: var(--muted); }
.rq-time { margin-left: auto; font-size: .8rem; color: var(--muted); }
.rq-stem { font-size: 1rem; margin-bottom: .75rem; }
.rq-opts { list-style: none; padding: 0; margin: 0 0 .75rem; display: grid; gap: .45rem; }
.rq-opts li { display: grid; grid-template-columns: 1.5rem 1fr; gap: .5rem; padding: .55rem .75rem; border-radius: 8px; border: 1px solid var(--line-soft); }
.rq-opts li.is-correct { background: var(--good-soft); border-color: rgba(12,163,12,.5); }
.rq-opts li.is-wrong { background: var(--bad-soft); border-color: rgba(208,59,59,.5); }
.rq-opt-text { font-weight: 600; }
.rq-note { font-size: .86rem; color: var(--ink-2); margin-top: .2rem; }
.rq-expl { background: var(--surface-2); border-radius: 10px; padding: .8rem 1rem; font-size: .92rem; }
.rq-expl h4 { margin: 0 0 .35rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.rq-expl p:last-child { margin-bottom: 0; }
.rq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: .75rem; }
.rq-two h5 { margin: 0 0 .3rem; font-size: .8rem; text-transform: uppercase; color: var(--muted); }
.rq-two ol { margin: 0; padding-left: 1.3rem; }
.rq-two li.ok { color: var(--good-ink); } .rq-two li.bad { color: var(--bad-ink); }
.rq-match td.ok { color: var(--good-ink); font-weight: 600; } .rq-match td.bad { color: var(--bad-ink); font-weight: 600; }
@media (max-width: 640px) { .rq-two { grid-template-columns: 1fr; } }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem 1.5rem; }
@media (max-width: 800px) { .checklist { grid-template-columns: 1fr; } }
.checklist li { display: grid; grid-template-columns: 1.6rem 1fr auto; gap: .5rem; align-items: center; padding: .5rem .7rem; border-radius: 8px; background: var(--surface-2); }
.checklist .ck { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .8rem; }
.checklist li.ok .ck { background: var(--good); color: #fff; }
.checklist li.no .ck { border: 2px solid var(--line); color: var(--muted); }

.heatmap-wrap { overflow-x: auto; }
.heatmap { border-collapse: separate; border-spacing: 3px; width: 100%; font-size: .85rem; }
.heatmap th { font-size: .75rem; color: var(--muted); font-weight: 700; text-align: left; padding: .3rem .5rem; white-space: nowrap; }
.heatmap thead th { text-align: center; }
.heatmap td { text-align: center; padding: .55rem .4rem; border-radius: 6px; font-weight: 700; font-variant-numeric: tabular-nums; min-width: 70px; }
.heatmap .hm-score { background: var(--surface-3); }
.heatmap .hm-empty { color: var(--muted); }
.hm-legend { display: flex; align-items: center; gap: 3px; margin-top: .6rem; font-size: .75rem; color: var(--muted); justify-content: flex-end; }
.hm-legend i { width: 22px; height: 10px; border-radius: 2px; display: inline-block; }
.hm-legend span { margin: 0 .3rem; }

.domain-bars { display: grid; gap: .8rem; margin-bottom: 1.25rem; }
.db-row { display: grid; grid-template-columns: minmax(220px, 1.2fr) 2fr 3.5rem; gap: 1rem; align-items: center; }
.db-label { display: grid; line-height: 1.3; }
.db-id { font-weight: 800; font-size: .85rem; }
.db-name { font-size: .88rem; }
.db-weight { font-size: .75rem; color: var(--muted); }
.db-value { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 640px) { .db-row { grid-template-columns: 1fr 3rem; } .db-bar { grid-column: 1 / -1; grid-row: 2; } }
.delta { font-size: .8rem; font-weight: 800; }
.delta.up { color: var(--good-ink); } .delta.down { color: var(--bad-ink); } .delta.flat { color: var(--muted); }

.plan { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; }
.plan-item { display: grid; grid-template-columns: 2.4rem 1fr; gap: .8rem; padding: .9rem; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-2); }
.plan-rank { width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--brand); color: var(--accent); display: grid; place-items: center; font-weight: 900; }
.plan-topics { display: flex; flex-wrap: wrap; gap: .3rem; margin: .5rem 0; }
.missed { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.missed li { display: grid; grid-template-columns: 3.2rem 1fr; gap: .75rem; align-items: start; padding: .6rem .75rem; border-radius: 8px; background: var(--surface-2); font-size: .9rem; }
.missed-count { font-weight: 900; text-align: center; background: var(--bad-soft); color: var(--bad-ink); border-radius: 6px; padding: .2rem; font-variant-numeric: tabular-nums; }
.missed-count.recovered { background: var(--good-soft); color: var(--good-ink); }
.user-pick { display: inline-flex; align-items: center; gap: .5rem; font-weight: 600; }

/* admin */
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; }
.tab { background: none; border: 0; padding: .7rem 1rem; font-weight: 700; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--ink); border-color: var(--accent); }
.search { max-width: 320px; }
.user-cell { display: flex; align-items: center; gap: .6rem; }
.row-actions { display: inline-flex; gap: .3rem; align-items: center; }
.more { position: relative; }
.more summary { list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more .menu { top: calc(100% + 4px); }
.form { display: grid; gap: 1rem; }
.form small { font-weight: 400; color: var(--muted); font-size: .78rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; align-items: start; }
.span-2 { grid-column: 1 / -1; }
@media (max-width: 640px) { .form-grid { grid-template-columns: 1fr; } }
.assign-tree { display: grid; gap: .75rem; }
.assign-exam { border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem 1rem; margin: 0; }
.assign-exam legend { padding: 0 .4rem; }
.check { display: inline-flex !important; grid-template-columns: none; align-items: center; gap: .5rem; font-weight: 600; }
.check input, .check-card input { width: 17px; height: 17px; accent-color: var(--primary); }
.assign-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .5rem; margin-top: .5rem; }
.check-card { display: flex !important; gap: .6rem; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; cursor: pointer; }
.check-card:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.check-card span { display: grid; }
.check-card small { color: var(--muted); font-weight: 400; }
.cred-box { display: grid; gap: .6rem; background: var(--surface-2); border-radius: 10px; padding: 1rem; }
.cred-box div { display: grid; gap: .15rem; }
.cred-box span { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.cred-box code { font-size: 1rem; padding: .35rem .5rem; user-select: all; }
.callout { background: var(--primary-soft); color: var(--primary); padding: .6rem .8rem; border-radius: 8px; font-size: .88rem; }
.blueprint { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: .75rem; }
.bp-domain { border: 1px solid var(--line-soft); border-radius: 10px; padding: .75rem 1rem; background: var(--surface-2); }
.bp-head { display: flex; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.bp-domain ul { margin: 0; padding-left: 1rem; font-size: .85rem; color: var(--ink-2); display: grid; gap: .2rem; }

/* modal, toast, tooltip */
.modal-backdrop { position: fixed; inset: 0; background: rgba(15,17,17,.5); display: grid; place-items: center; padding: 1rem; z-index: 60; opacity: 0; transition: opacity .2s; }
.modal-backdrop.show { opacity: 1; }
.modal { background: var(--surface); color: var(--ink); border-radius: 14px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: calc(100vh - 2rem); display: flex; flex-direction: column; transform: translateY(12px) scale(.98); transition: transform .2s; outline: none; }
.modal-lg { width: min(760px, 100%); }
.modal-backdrop.show .modal { transform: none; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line-soft); }
.modal-head h2 { margin: 0; }
.modal-body { padding: 1.1rem 1.25rem; overflow-y: auto; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .85rem 1.25rem; border-top: 1px solid var(--line-soft); }
.end-summary ul { padding-left: 1.2rem; }
.end-summary li.warn { color: var(--bad-ink); }
#toasts { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); display: grid; gap: .5rem; z-index: 120; width: min(460px, calc(100vw - 2rem)); }
.toast { display: flex; gap: .6rem; align-items: center; background: var(--brand); color: #fff; padding: .7rem 1rem; border-radius: 10px; box-shadow: var(--shadow-lg); font-size: .9rem; opacity: 0; transform: translateY(10px); transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: none; }
.toast-icon { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font-weight: 900; font-size: .75rem; background: rgba(255,255,255,.2); flex: none; }
.toast-success .toast-icon { background: var(--good); }
.toast-error .toast-icon { background: var(--bad); }
.toast-warning .toast-icon { background: var(--warn); color: #0b0b0b; }
.tooltip { position: fixed; left: 0; top: 0; z-index: 150; pointer-events: none; background: var(--brand); color: #fff; padding: .5rem .7rem; border-radius: 8px; font-size: .8rem; line-height: 1.45; box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .12s; max-width: 280px; }
.tooltip.show { opacity: 1; }
.tooltip strong { display: block; margin-bottom: .1rem; }

/* =====================================================================
   PDF / print
   ===================================================================== */
.pdf-mode { background: #fff; }
.pdf-mode, .pdf-mode * { background-image: none !important; }
.pdf-mode .card, .pdf-mode .tile, .pdf-mode .rq { box-shadow: none; border-color: #dcdcdc; }
.pdf-mode .print-only { display: block; }
.pdf-mode .meter-fill { transition: none; }
.pdf-mode .pdf-section { padding-right: 8px; }
.pdf-mode .rq { padding: .6rem .8rem; margin-bottom: .5rem; font-size: 12px; border-left-width: 4px; }
.pdf-mode .rq-stem { font-size: 12.5px; margin-bottom: .4rem; }
.pdf-mode .rq-stem p { margin-bottom: .3rem; }
.pdf-mode .rq-head { margin-bottom: .35rem; gap: .35rem; }
.pdf-mode .rq-opts { gap: .2rem; margin-bottom: .4rem; }
.pdf-mode .rq-opts li { padding: .25rem .5rem; }
.pdf-mode .rq-note { font-size: 11px; margin-top: 0; }
.pdf-mode .rq-expl { padding: .45rem .7rem; font-size: 11.5px; }
.pdf-mode .rq-expl p { margin-bottom: .25rem; }
.pdf-mode .chip { font-size: 10px; padding: .1rem .45rem; }
.pdf-mode .rq[hidden], .pdf-mode .rq-group[hidden] { display: block !important; }
@media print {
  .topbar, .site-foot, .report-actions, .filters, .review-head-sec, [data-html2canvas-ignore] { display: none !important; }
  body { background: #fff; }
  .view { max-width: none; padding: 0; }
  .card, .tile, .rq { box-shadow: none; break-inside: avoid; }
  .pdf-section { break-after: page; }
  .print-only { display: block; }
  .rq[hidden], .rq-group[hidden] { display: block !important; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
