/* base reset (mirrors hosting sandbox defaults) */
html{color-scheme:light}
:root{padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}
img{max-width:100%}
[hidden]{display:none!important}

:root {
    --bg: #F6F7FB;
    --surface: #FFFFFF;
    --surface-2: #F0F1F7;
    --border: #E4E6F0;
    --border-strong: #D3D6E4;
    --ink: #1B1D2E;
    --ink-2: #565A73;
    --muted: #8A8DA3;
    --brand: #4B3F9E;
    --brand-2: #6D5FD6;
    --brand-soft: #EEEBFB;
    --accent: #E0902A;
    --accent-soft: #FBF0DC;
    --good: #2E9E6B;
    --good-soft: #E4F4EC;
    --bad: #DD4B57;
    --bad-soft: #FBE7E9;
    --unans: #9AA0B4;
    --unans-soft: #EDEEF3;
    --shadow: 0 1px 2px rgba(27,29,46,.04), 0 8px 24px rgba(27,29,46,.06);
    --shadow-lg: 0 12px 40px rgba(27,29,46,.14);
    --radius: 16px;
    --radius-sm: 10px;
    --maxw: 1080px;
    --font-body: 'Hanken Grotesk', system-ui, -apple-system, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;
    --font-mono: 'JetBrains Mono', ui-monospace, monospace;
    --logo-full: url("../assets/logo-full.png");
    --logo-mark: url("../assets/logo-mark.png");
  }
  .logo-img { display: inline-block; background: var(--logo-mark) center/contain no-repeat; flex: none; }
  .logo-mark { width: 40px; height: 40px; }
  .logo-mark.sm { width: 34px; height: 34px; }
  .logo-full { width: 190px; height: 190px; background-image: var(--logo-full); }
  @media (max-width: 480px) { .logo-full { width: 150px; height: 150px; } }
  /* Committed light aesthetic — single, airy visual world. */

  * { box-sizing: border-box; }
  [hidden] { display: none !important; }
  html, body { height: 100%; }
  body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
  }
  h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.15; text-wrap: balance; margin: 0; }
  button { font-family: inherit; cursor: pointer; }
  .mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  :focus-visible { outline: 2px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }

  /* ---------- Brand mark ---------- */
  .brand { display: flex; align-items: center; gap: 11px; }
  .brand-logo { width: 38px; height: 38px; flex: none; }
  .brand-text { display: flex; flex-direction: column; line-height: 1.05; }
  .brand-name { font-family: var(--font-display); font-weight: 600; font-size: 19px; letter-spacing: -.01em; color: var(--ink); }
  .brand-name b { color: var(--brand); font-weight: 600; }
  .brand-tag { font-size: 10.5px; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); font-weight: 600; }

  /* ---------- Buttons ---------- */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink);
    padding: 11px 18px; border-radius: 999px; font-size: 14px; font-weight: 600;
    transition: transform .08s ease, background .15s, border-color .15s, box-shadow .15s;
  }
  .btn:hover { border-color: var(--brand-2); }
  .btn:active { transform: translateY(1px); }
  .btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
  .btn-primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
  .btn-accent { background: var(--accent); border-color: var(--accent); color: #2a1e05; }
  .btn-accent:hover { filter: brightness(1.04); }
  .btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
  .btn-ghost:hover { background: var(--surface-2); border-color: transparent; }
  .btn-sm { padding: 8px 14px; font-size: 13px; }
  .btn:disabled { opacity: .4; cursor: not-allowed; }

  .icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border);
    background: var(--surface); color: var(--ink-2); display: inline-flex; align-items: center; justify-content: center;
  }
  .icon-btn:hover { color: var(--brand); border-color: var(--brand-2); }

  .screen { display: block; }
  .wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }

  /* ================= ACCESS GATE ================= */
  #gateScreen { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 32px 20px;
    background:
      radial-gradient(90% 60% at 15% 0%, var(--brand-soft) 0%, transparent 45%),
      radial-gradient(80% 60% at 100% 100%, var(--accent-soft) 0%, transparent 48%),
      var(--bg);
  }
  .gate-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; align-items: center; }
  .gate-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    box-shadow: var(--shadow-lg); padding: 38px 34px 30px; width: 100%; text-align: center;
  }
  .gate-brand { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 26px; }
  .gate-title { font-size: 26px; letter-spacing: -.015em; margin-bottom: 6px; }
  .gate-sub { color: var(--ink-2); font-size: 14px; margin: 0 auto 26px; max-width: 38ch; }
  .gate-series { font-size: 12px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
  .gate-topics { font-size: 13.5px; line-height: 1.55; color: var(--ink-2); margin: 0 auto 20px; max-width: 46ch; }
  .gate-topics b { color: var(--ink); font-weight: 600; }
  .exam-badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-bottom: 24px; }
  .exam-badge { font-size: 12px; font-weight: 600; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--border); padding: 6px 13px; border-radius: 999px; }
  .gate-divider { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; color: var(--muted); }
  .gate-divider::before, .gate-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
  .gate-divider span { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
  .gate-form { display: grid; gap: 15px; text-align: left; }
  .field { display: grid; gap: 7px; }
  .field-label { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .input {
    width: 100%; border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--ink);
    border-radius: 12px; padding: 13px 15px; font-family: inherit; font-size: 15px; transition: border-color .15s, box-shadow .15s;
  }
  .input::placeholder { color: var(--muted); }
  .input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
  .input.mono { letter-spacing: .08em; text-transform: uppercase; }
  .input.shake { animation: shake .35s; border-color: var(--bad); }
  @keyframes shake { 0%,100%{transform:translateX(0)} 20%,60%{transform:translateX(-6px)} 40%,80%{transform:translateX(6px)} }
  .gate-error { display: flex; align-items: center; gap: 8px; color: var(--bad); font-size: 13px; font-weight: 600; margin-top: -3px; }
  .gate-btn { width: 100%; padding: 14px; font-size: 15px; margin-top: 4px; }
  .gate-note { font-size: 12px; color: var(--muted); margin: 20px auto 0; max-width: 36ch; }
  .gate-foot { font-size: 12px; color: var(--muted); margin-top: 22px; letter-spacing: .02em; }

  .verified-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700;
    color: var(--good); background: var(--good-soft); padding: 7px 14px; border-radius: 999px; }

  /* greeting on start screen */
  .greeting { font-family: var(--font-display); font-size: 20px; font-weight: 500; color: var(--ink); margin-bottom: 14px; }
  .greeting b { color: var(--brand); font-weight: 600; }
  .greeting .wave { display: inline-block; animation: wave 2.2s ease-in-out infinite; transform-origin: 70% 80%; }
  @keyframes wave { 0%,60%,100%{transform:rotate(0)} 10%,30%{transform:rotate(16deg)} 20%{transform:rotate(-8deg)} }

  .report-for { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
  .report-for b { color: var(--brand); }

  /* ================= START SCREEN ================= */
  #startScreen { min-height: 100%; display: flex; flex-direction: column; }
  .start-top { padding-block: 20px; }
  .start-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .start-main { flex: 1; display: flex; align-items: center; padding-block: 24px 56px; }
  .start-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: 24px;
    box-shadow: var(--shadow); overflow: hidden; width: 100%;
  }
  .start-hero {
    padding: 40px 40px 30px; position: relative;
    background:
      radial-gradient(120% 140% at 100% 0%, var(--brand-soft) 0%, transparent 55%),
      linear-gradient(180deg, transparent, transparent);
    border-bottom: 1px solid var(--border);
  }
  .eyebrow {
    display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 700;
    letter-spacing: .12em; text-transform: uppercase; color: var(--brand);
    background: var(--brand-soft); padding: 6px 13px; border-radius: 999px;
  }
  .start-hero h1 { font-size: clamp(28px, 5vw, 40px); margin-top: 18px; letter-spacing: -.02em; }
  .start-hero .series { color: var(--ink-2); font-size: 16px; margin-top: 10px; max-width: 46ch; }
  .hero-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
  .chip {
    display: inline-flex; align-items: center; gap: 8px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; font-size: 13.5px; font-weight: 600; color: var(--ink);
  }
  .chip b { font-family: var(--font-mono); font-size: 16px; color: var(--brand); }
  .chip svg { color: var(--accent); }

  .start-body { padding: 30px 40px 38px; display: grid; grid-template-columns: 1fr; gap: 26px; }
  .inst-title { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
  .inst-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
  .inst-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; color: var(--ink-2); }
  .inst-list li b { color: var(--ink); font-weight: 600; }
  .inst-num {
    flex: none; width: 24px; height: 24px; border-radius: 7px; background: var(--brand-soft); color: var(--brand);
    font-family: var(--font-mono); font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px;
  }
  .start-note {
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
    border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13px; color: var(--ink-2); display: flex; gap: 10px;
  }
  .start-note svg { color: var(--accent); flex: none; margin-top: 2px; }
  .start-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 4px; }
  .start-actions .btn { padding: 14px 30px; font-size: 15px; }
  .sample-flag {
    font-size: 12.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px;
  }
  .sample-flag .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

  /* ================= TEST SCREEN ================= */
  #testScreen { min-height: 100%; display: flex; flex-direction: column; }
  .test-bar {
    position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30;
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    backdrop-filter: blur(10px); border-bottom: 1px solid var(--border);
  }
  .test-bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 20px; max-width: 1240px; margin: 0 auto; }
  .brand-mini { display: flex; align-items: center; gap: 9px; }
  .brand-mini .brand-name { font-size: 16px; }
  .brand-mini .brand-tag { display: none; }
  .test-bar-right { display: flex; align-items: center; gap: 12px; }
  .timer {
    display: inline-flex; align-items: center; gap: 9px; background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 999px; padding: 8px 16px 8px 14px;
  }
  .timer .t-label { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
  .timer .t-val { font-family: var(--font-mono); font-size: 18px; font-weight: 700; color: var(--ink); letter-spacing: .02em; }
  .timer.low { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 40%, transparent); animation: pulse 1s ease-in-out infinite; }
  .timer.low .t-val, .timer.low .t-label { color: var(--bad); }
  @keyframes pulse { 50% { opacity: .55; } }

  .test-body { flex: 1; display: flex; gap: 24px; align-items: flex-start; width: 100%; max-width: 1240px; margin: 0 auto; padding: 24px 20px 120px; }
  .q-col { flex: 1; min-width: 0; }
  .q-progress { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
  .q-progress .qnum { font-size: 14px; color: var(--ink-2); font-weight: 600; }
  .q-progress .qnum b { color: var(--ink); font-family: var(--font-mono); }
  .progress-track { flex: 1; height: 6px; background: var(--surface-2); border-radius: 999px; overflow: hidden; max-width: 340px; }
  .progress-fill { height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .3s ease; }

  .q-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 26px 28px; }
  .q-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
  .tag { font-size: 11.5px; font-weight: 600; padding: 4px 11px; border-radius: 999px; letter-spacing: .01em; }
  .tag-subject { background: var(--brand-soft); color: var(--brand); }
  .tag-diff { background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--border); }
  .q-text { font-size: 18px; line-height: 1.5; color: var(--ink); font-weight: 500; margin-bottom: 22px; }
  .options { display: grid; gap: 11px; }
  .option {
    display: flex; align-items: flex-start; gap: 13px; width: 100%; text-align: left;
    background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    padding: 14px 16px; font-size: 15px; color: var(--ink); transition: border-color .12s, background .12s;
  }
  .option:hover { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-soft) 45%, transparent); }
  .option .opt-key {
    flex: none; width: 27px; height: 27px; border-radius: 8px; border: 1.5px solid var(--border-strong);
    display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; color: var(--ink-2);
    font-family: var(--font-mono); transition: inherit;
  }
  .option .opt-text { padding-top: 2px; }
  .option.selected { border-color: var(--brand); background: var(--brand-soft); }
  .option.selected .opt-key { background: var(--brand); border-color: var(--brand); color: #fff; }

  .q-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
  .q-foot-left { display: flex; gap: 8px; flex-wrap: wrap; }
  .q-foot-right { display: flex; gap: 8px; }

  /* ---------- Palette ---------- */
  .palette {
    flex: none; width: 296px; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: sticky; top: 84px;
  }
  .palette h3 { font-size: 15px; margin-bottom: 4px; }
  .palette .p-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 16px; }
  .p-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
  .p-btn {
    aspect-ratio: 1; border-radius: 9px; border: 1.5px solid var(--border-strong); background: var(--surface);
    font-family: var(--font-mono); font-size: 13px; font-weight: 700; color: var(--ink-2); position: relative;
    display: flex; align-items: center; justify-content: center; transition: transform .08s;
  }
  .p-btn:active { transform: scale(.92); }
  .p-btn.current { outline: 2px solid var(--brand); outline-offset: 2px; }
  .p-btn.answered { background: var(--good); border-color: var(--good); color: #fff; }
  .p-btn.notans { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); color: var(--bad); }
  .p-btn.marked { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
  .p-btn.marked.answered::after {
    content: ''; position: absolute; right: 4px; top: 4px; width: 7px; height: 7px; border-radius: 50%;
    background: var(--good); border: 1.5px solid #fff;
  }
  .p-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
  .p-legend div { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
  .swatch { width: 15px; height: 15px; border-radius: 5px; flex: none; border: 1.5px solid var(--border-strong); }
  .swatch.answered { background: var(--good); border-color: var(--good); }
  .swatch.notans { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
  .swatch.marked { background: var(--brand-2); border-color: var(--brand-2); }
  .p-summary { display: flex; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
  .p-summary div { font-size: 12px; color: var(--muted); }
  .p-summary b { display: block; font-family: var(--font-mono); font-size: 18px; color: var(--ink); }
  .palette-close { display: none; }

  /* mobile palette trigger (bottom bar) */
  .mobile-bar { display: none; }

  /* ================= RESULTS SCREEN ================= */
  #resultScreen { padding-bottom: 60px; }
  .result-top { background: var(--surface); border-bottom: 1px solid var(--border); }
  .result-top .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 16px; }
  .result-hero { padding-block: 34px 26px; }
  .result-hero-grid { display: grid; grid-template-columns: auto 1fr; gap: 34px; align-items: center; }
  .score-ring { position: relative; width: 168px; height: 168px; flex: none; }
  .score-ring .score-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .score-center .s-pct { font-family: var(--font-mono); font-size: 40px; font-weight: 700; color: var(--ink); line-height: 1; }
  .score-center .s-lbl { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-top: 5px; }
  .result-headline .verdict { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); }
  .result-headline h1 { font-size: clamp(24px, 4vw, 32px); margin: 8px 0 6px; }
  .result-headline p { color: var(--ink-2); font-size: 15px; margin: 0; max-width: 52ch; }
  .score-line { font-family: var(--font-mono); font-size: 15px; color: var(--ink-2); margin-top: 14px; }
  .score-line b { color: var(--ink); }

  .tabs { display: flex; gap: 6px; background: var(--surface-2); border: 1px solid var(--border); padding: 5px; border-radius: 14px; width: fit-content; }
  .tab {
    border: none; background: transparent; color: var(--ink-2); padding: 10px 22px; border-radius: 10px;
    font-size: 14.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px;
  }
  .tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow); }

  .panel { padding-top: 26px; }
  .stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 24px; }
  .stat {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 18px;
  }
  .stat .s-top { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); font-weight: 600; }
  .stat .s-num { font-family: var(--font-mono); font-size: 27px; font-weight: 700; margin-top: 8px; line-height: 1; }
  .stat .s-sub { font-size: 12px; color: var(--muted); margin-top: 5px; }
  .stat.good .s-num { color: var(--good); }
  .stat.bad .s-num { color: var(--bad); }
  .stat.unans .s-num { color: var(--unans); }
  .dot-i { width: 9px; height: 9px; border-radius: 50%; flex: none; }

  .cards-2 { display: grid; grid-template-columns: 1fr 1.35fr; gap: 20px; margin-bottom: 20px; }
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
  .card h2, .card h3 { font-size: 17px; margin-bottom: 4px; }
  .card .c-sub { font-size: 12.5px; color: var(--muted); margin-bottom: 20px; }

  .donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
  .donut-legend { display: grid; gap: 12px; flex: 1; min-width: 130px; }
  .donut-legend .dl { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
  .donut-legend .dl .dl-v { margin-left: auto; font-family: var(--font-mono); font-weight: 700; color: var(--ink); }
  .donut-legend .dl .dl-t { color: var(--ink-2); }

  /* subject bars */
  .bars { display: grid; gap: 14px; }
  .bar-row { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .bar-head .b-name { font-size: 13.5px; font-weight: 600; color: var(--ink); }
  .bar-head .b-meta { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
  .bar-track { height: 22px; background: var(--surface-2); border-radius: 7px; overflow: hidden; position: relative; }
  .bar-fill { height: 100%; border-radius: 7px; display: flex; align-items: center; justify-content: flex-end; padding-right: 8px; min-width: 30px;
    font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; color: #fff; transition: width .6s cubic-bezier(.2,.7,.3,1); }

  .aw-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
  .area-list { display: grid; gap: 10px; }
  .area-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); }
  .area-item .a-ic { width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex: none; }
  .area-item.strong .a-ic { background: var(--good-soft); color: var(--good); }
  .area-item.weak .a-ic { background: var(--bad-soft); color: var(--bad); }
  .area-item .a-name { font-weight: 600; font-size: 14px; }
  .area-item .a-acc { margin-left: auto; font-family: var(--font-mono); font-weight: 700; font-size: 14px; }
  .area-item.strong .a-acc { color: var(--good); }
  .area-item.weak .a-acc { color: var(--bad); }
  .empty-note { font-size: 13px; color: var(--muted); padding: 10px 2px; }

  .tips { display: grid; gap: 12px; }
  .tip { display: flex; gap: 13px; padding: 15px 17px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--brand); }
  .tip.warn { border-left-color: var(--accent); }
  .tip.pos { border-left-color: var(--good); }
  .tip .t-ic { flex: none; margin-top: 1px; }
  .tip .t-body { font-size: 13.5px; color: var(--ink-2); }
  .tip .t-body b { color: var(--ink); }

  /* ---------- Answers / review ---------- */
  .review-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 20px; }
  .fchip {
    border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink-2);
    padding: 8px 15px; border-radius: 999px; font-size: 13px; font-weight: 600;
  }
  .fchip.active { background: var(--brand); border-color: var(--brand); color: #fff; }
  .fchip .cnt { opacity: .7; margin-left: 3px; }
  .fspace { flex: 1; }
  select.fsel { border: 1px solid var(--border-strong); background: var(--surface); color: var(--ink); padding: 8px 12px; border-radius: 10px; font-family: inherit; font-size: 13px; font-weight: 600; }

  .rev-list { display: grid; gap: 16px; }
  .rev-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
  .rev-head { display: flex; align-items: flex-start; gap: 13px; padding: 18px 20px 14px; }
  .rev-qn { flex: none; font-family: var(--font-mono); font-weight: 700; font-size: 13px; color: #fff; width: 30px; height: 30px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
  .rev-qn.correct { background: var(--good); }
  .rev-qn.incorrect { background: var(--bad); }
  .rev-qn.skipped { background: var(--unans); }
  .rev-q { flex: 1; }
  .rev-q .rq-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 9px; }
  .rev-q .rq-text { font-size: 15.5px; font-weight: 500; color: var(--ink); line-height: 1.45; }
  .verdict-pill { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; }
  .verdict-pill.correct { background: var(--good-soft); color: var(--good); }
  .verdict-pill.incorrect { background: var(--bad-soft); color: var(--bad); }
  .verdict-pill.skipped { background: var(--unans-soft); color: var(--unans); }

  .rev-opts { padding: 0 20px 6px; display: grid; gap: 8px; }
  .rev-opt { display: flex; align-items: flex-start; gap: 11px; padding: 11px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); font-size: 14px; }
  .rev-opt .ro-key { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1.5px solid var(--border-strong); font-family: var(--font-mono); font-weight: 700; font-size: 12px; display: flex; align-items: center; justify-content: center; color: var(--ink-2); }
  .rev-opt.correct { border-color: var(--good); background: var(--good-soft); }
  .rev-opt.correct .ro-key { background: var(--good); border-color: var(--good); color: #fff; }
  .rev-opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
  .rev-opt.wrong .ro-key { background: var(--bad); border-color: var(--bad); color: #fff; }
  .ro-flag { margin-left: auto; font-size: 11.5px; font-weight: 700; align-self: center; }
  .rev-opt.correct .ro-flag { color: var(--good); }
  .rev-opt.wrong .ro-flag { color: var(--bad); }

  .rev-expl { margin: 12px 20px 20px; padding: 15px 17px; background: var(--brand-soft); border-radius: var(--radius-sm); }
  .rev-expl .ex-h { font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); margin-bottom: 7px; display: flex; align-items: center; gap: 7px; }
  .rev-expl .ex-b { font-size: 14px; color: var(--ink); line-height: 1.6; }
  .rev-expl .ex-b b { color: var(--brand); }

  /* ---------- Modal & toast ---------- */
  .overlay { position: fixed; inset: 0; background: rgba(15,16,28,.55); backdrop-filter: blur(3px); z-index: 100; display: flex; align-items: center; justify-content: center; padding: 20px; }
  .modal { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-lg); max-width: 420px; width: 100%; padding: 28px; }
  .modal .m-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px; }
  .modal h3 { font-size: 20px; margin-bottom: 8px; }
  .modal p { color: var(--ink-2); font-size: 14px; margin: 0 0 12px; }
  .modal .m-stats { display: flex; gap: 18px; padding: 14px 0; margin-bottom: 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
  .modal .m-stats div { font-size: 12px; color: var(--muted); }
  .modal .m-stats b { display: block; font-family: var(--font-mono); font-size: 20px; color: var(--ink); }
  .modal .m-actions { display: flex; gap: 10px; margin-top: 20px; }
  .modal .m-actions .btn { flex: 1; }

  .toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); z-index: 200;
    background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px; font-size: 13.5px; font-weight: 600;
    box-shadow: var(--shadow-lg); opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; display: flex; align-items: center; gap: 9px; }
  .toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

  /* ---------- Match-the-column tables inside questions ---------- */
  .mt-wrap { overflow-x: auto; margin: 16px 0 6px; -webkit-overflow-scrolling: touch; }
  .match-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 14px;
    border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); background: var(--surface); }
  .match-table thead th { background: var(--brand-soft); color: var(--brand); text-align: left; font-weight: 700;
    font-size: 11px; letter-spacing: .07em; text-transform: uppercase; padding: 11px 15px; border-bottom: 1.5px solid var(--border-strong); }
  .match-table th + th, .match-table td + td { border-left: 1px solid var(--border); }
  .match-table td { padding: 11px 15px; border-top: 1px solid var(--border); color: var(--ink); vertical-align: top; line-height: 1.45; }
  .match-table tbody tr:first-child td { border-top: none; }
  .match-table tbody tr:nth-child(even) td { background: var(--surface-2); }
  .match-table tbody tr td:first-child { font-weight: 700; color: var(--brand); white-space: nowrap; width: 44%; }
  .rev-q .rq-text .mt-wrap { margin-top: 12px; }

  /* ---------- Negative-marking note ---------- */
  .marking-note { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--accent);
    background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); padding: 5px 12px; border-radius: 999px; }
  .neg { color: var(--bad); }
  .pos { color: var(--good); }
  .marks-break { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin-top: 4px; }

  /* single-device warning callout */
  .warn-note {
    background: var(--bad-soft); border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent);
    border-radius: var(--radius-sm); padding: 13px 16px; font-size: 13px; color: var(--ink); display: flex; gap: 10px; align-items: flex-start;
  }
  .warn-note svg { color: var(--bad); flex: none; margin-top: 2px; }
  .warn-note b { color: var(--bad); }

  /* ---------- Explanation structure & Exam Watch (Mock 3) ---------- */
  .rev-expl .ex-b p { margin: 0 0 9px; font-size: 14px; line-height: 1.6; color: var(--ink); }
  .rev-expl .ex-b p:last-child { margin-bottom: 0; }
  .rev-expl .ex-why b { color: var(--brand); }
  .rev-expl .ex-sub { font-size: 11.5px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--brand); margin: 13px 0 6px; }
  .rev-expl .ex-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
  .rev-expl .ex-list li { font-size: 13.5px; line-height: 1.5; color: var(--ink); }
  .exam-watch { margin: 0 20px 20px; padding: 14px 16px; background: var(--accent-soft);
    border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: var(--radius-sm);
    display: flex; gap: 11px; align-items: flex-start; font-size: 13.5px; color: var(--ink); line-height: 1.55; }
  .exam-watch .ew-ic { flex: none; font-size: 16px; margin-top: 1px; }
  .exam-watch .ew-h { display: block; font-weight: 700; color: var(--accent); font-size: 12px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 4px; }
  .exam-watch b { color: var(--ink); }
  /* Copy / selection deterrent */
  body { -webkit-user-select: none; -ms-user-select: none; user-select: none; }
  input, textarea, .input { -webkit-user-select: text; -ms-user-select: text; user-select: text; }

  /* ================= RESPONSIVE ================= */
  @media (max-width: 900px) {
    .cards-2 { grid-template-columns: 1fr; }
    .aw-grid { grid-template-columns: 1fr; }
    .result-hero-grid { grid-template-columns: 1fr; gap: 22px; justify-items: center; text-align: center; }
    .result-headline { text-align: center; }
    .result-headline p { margin-inline: auto; }
    .score-line { text-align: center; }
  }
  @media (max-width: 780px) {
    body { font-size: 14.5px; }
    .start-hero, .start-body { padding-inline: 24px; }
    .start-hero { padding-top: 30px; }
    .start-body { padding-bottom: 30px; }
    .test-body { padding-bottom: 96px; }
    /* palette becomes a bottom sheet */
    .palette {
      position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; z-index: 60;
      border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .3s cubic-bezier(.2,.7,.3,1);
      max-height: 78vh; overflow-y: auto; box-shadow: var(--shadow-lg);
      padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    }
    body.palette-open .palette { transform: translateY(0); }
    body.palette-open::after { content: ''; position: fixed; inset: 0; background: rgba(15,16,28,.5); z-index: 55; }
    .palette-close { display: inline-flex; position: absolute; right: 16px; top: 16px; }
    .p-grid { grid-template-columns: repeat(8, 1fr); }
    .mobile-bar {
      display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; gap: 10px;
      background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
      border-top: 1px solid var(--border); padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    }
    .mobile-bar .btn { flex: 1; }
    .q-foot-right { display: none; }
    .tabs { width: 100%; }
    .tab { flex: 1; justify-content: center; padding-inline: 10px; }
  }
  @media (max-width: 480px) {
    .wrap { padding-inline: 16px; }
    .start-top .wrap { padding-inline: 16px; }
    .q-card { padding: 20px 18px; }
    .q-text { font-size: 16.5px; }
    .p-grid { grid-template-columns: repeat(6, 1fr); }
    .stat-row { grid-template-columns: 1fr 1fr; }
    .test-bar-inner { padding-inline: 16px; }
    .brand-mini .brand-name { font-size: 15px; }
    .timer .t-val { font-size: 16px; }
  }
  @media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
  }
