:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #16212e;
  --ink-2: #44515f;
  --muted: #7a8591;
  --line: #e2dccf;
  --navy: #0f2a44;
  --navy-2: #1d4268;
  --gold: #e0a43a;
  --gold-soft: #fbefd6;
  --ok: #1f7a4d;
  --ok-soft: #e3f3ea;
  --bad: #b33a2e;
  --bad-soft: #fbe8e5;
  --warn: #9a6a00;
  --warn-soft: #fff4d6;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 42, 68, .06), 0 8px 24px rgba(15, 42, 68, .06);
  --serif: "Source Serif 4", Georgia, serif;
  --sans: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
[data-theme="dark"] {
  --bg: #0d141c;
  --paper: #141e29;
  --ink: #e8edf2;
  --ink-2: #b8c3cf;
  --muted: #84909c;
  --line: #243242;
  --navy: #0a1622;
  --navy-2: #2a5a8a;
  --gold: #f0b54d;
  --gold-soft: #2e2615;
  --ok: #4cc28a;
  --ok-soft: #12291f;
  --bad: #ef7a6c;
  --bad-soft: #301a18;
  --warn: #f0c35a;
  --warn-soft: #2c2512;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15.5px/1.6 var(--sans);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--navy-2); }
[data-theme="dark"] a { color: #8cc0f2; }
button, input, select { font: inherit; color: inherit; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
main.wrap { flex: 1; padding: 28px 0 56px; outline: none; }
.muted { color: var(--muted); }
.hidden { display: none !important; }

/* Top bar */
.topbar {
  background: var(--navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 3px solid var(--gold);
}
.topbar-in { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.08);
  display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 26px; height: 26px; fill: none; stroke: var(--gold); stroke-width: 4.5; stroke-linejoin: round; stroke-linecap: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--serif); font-size: 18px; letter-spacing: .2px; }
.brand-text small { font-size: 11.5px; opacity: .7; }
.mainnav { display: flex; gap: 4px; margin-left: auto; }
.mainnav a {
  color: rgba(255,255,255,.82); text-decoration: none; padding: 8px 12px; border-radius: 8px;
  font-weight: 500; font-size: 14.5px;
}
.mainnav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.mainnav a.active { background: rgba(224,164,58,.16); color: var(--gold); }
.theme-toggle {
  border: 1px solid rgba(255,255,255,.18); background: transparent; width: 38px; height: 38px;
  border-radius: 10px; cursor: pointer; display: grid; place-items: center;
}
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2; }

/* Typography */
h1, h2, h3 { font-family: var(--sans); font-weight: 700; line-height: 1.25; margin: 0 0 12px; letter-spacing: -.2px; }
h1 { font-size: clamp(26px, 4vw, 36px); }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
.eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 1.4px; color: var(--gold); font-weight: 700; margin-bottom: 8px; }
[data-theme="light"] .eyebrow, :root:not([data-theme="dark"]) .eyebrow { color: #a8700f; }

/* Cards & layout */
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, #183b5e 100%);
  color: #fff; border-radius: 18px; padding: 32px; position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px;
  border: 28px solid rgba(224,164,58,.14); border-radius: 50%;
}
.hero p { color: rgba(255,255,255,.82); max-width: 640px; margin: 0 0 18px; }
.hero .eyebrow { color: var(--gold); }
.hero-meta { display: flex; gap: 18px; flex-wrap: wrap; font-size: 13.5px; color: rgba(255,255,255,.75); }
.hero-meta b { color: #fff; }

/* Stats */
.stat { padding: 18px; }
.stat .num { font-family: var(--serif); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .lbl { color: var(--muted); font-size: 13px; }
.bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; margin-top: 10px; }
.bar > span { display: block; height: 100%; background: var(--gold); border-radius: 99px; transition: width .4s; }
.bar.ok > span { background: var(--ok); }

/* Mode tiles */
.tile {
  display: block; text-decoration: none; color: inherit; cursor: pointer; text-align: left;
  border: 1px solid var(--line); background: var(--paper); border-radius: var(--radius);
  padding: 20px; transition: transform .15s, box-shadow .15s, border-color .15s; width: 100%;
}
.tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--gold); }
.tile .ico {
  width: 40px; height: 40px; border-radius: 10px; background: var(--gold-soft); display: grid; place-items: center; margin-bottom: 12px;
}
.tile .ico svg { width: 22px; height: 22px; fill: none; stroke: var(--navy-2); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[data-theme="dark"] .tile .ico svg { stroke: var(--gold); }
.tile h3 { margin-bottom: 4px; }
.tile p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* Buttons & form */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  padding: 10px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  text-decoration: none; transition: background .15s, border-color .15s;
}
.btn:hover { border-color: var(--navy-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--navy); color: #fff; border-color: var(--navy); }
.btn-primary:hover { background: var(--navy-2); }
[data-theme="dark"] .btn-primary { background: var(--navy-2); border-color: var(--navy-2); }
.btn-gold { background: var(--gold); border-color: var(--gold); color: #1b1407; }
.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn.on { border-color: var(--gold); background: var(--gold-soft); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; color: var(--ink-2); font-weight: 500; }
.input, select.input {
  border: 1px solid var(--line); background: var(--paper); border-radius: 10px; padding: 9px 12px; min-width: 0;
}
.input:focus { outline: 2px solid var(--gold); outline-offset: 1px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.seg button { border: 1px solid var(--line); background: var(--paper); padding: 8px 12px; cursor: pointer; font-size: 13.5px; font-weight: 500; border-radius: 9px; }
.seg button:hover { border-color: var(--navy-2); }
.seg button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .seg button.on { background: var(--navy-2); }

/* Chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--paper); border-radius: 99px; padding: 5px 12px;
  font-size: 13px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.chip b { font-weight: 600; color: var(--muted); }
.chip.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.chip.on b { color: var(--gold); }
.tag { display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 99px; background: var(--gold-soft); color: var(--ink-2); font-weight: 500; }
.tag.warn { background: var(--warn-soft); color: var(--warn); }
.tag.ok { background: var(--ok-soft); color: var(--ok); }

/* Question */
.q-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.q-no { font-family: var(--serif); font-weight: 700; font-size: 15px; background: var(--navy); color: #fff; border-radius: 8px; padding: 3px 10px; }
.q-text { font-size: 17px; font-weight: 500; line-height: 1.6; margin: 0 0 18px; white-space: pre-line; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  border: 1.5px solid var(--line); background: var(--paper); border-radius: 12px; padding: 12px 14px; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.opt:hover:not(:disabled) { border-color: var(--navy-2); }
.opt:disabled { cursor: default; }
.opt .k {
  flex: none; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center;
  font-weight: 700; background: var(--bg); border: 1px solid var(--line); font-size: 14px;
}
.opt .t { padding-top: 2px; }
.opt.sel { border-color: var(--navy-2); background: rgba(29,66,104,.06); }
.opt.sel .k { background: var(--navy); color: #fff; border-color: var(--navy); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); }
.opt.right .k { background: var(--ok); color: #fff; border-color: var(--ok); }
.opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.opt.wrong .k { background: var(--bad); color: #fff; border-color: var(--bad); }
.explain { margin-top: 16px; border-left: 4px solid var(--gold); background: var(--gold-soft); padding: 12px 14px; border-radius: 0 10px 10px 0; font-size: 14.5px; }
.explain.warn { border-color: var(--warn); background: var(--warn-soft); }
.explain p { margin: 4px 0 0; }
.q-nav { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.icon-btn { border: 1px solid var(--line); background: var(--paper); border-radius: 10px; width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.icon-btn.on { background: var(--gold-soft); border-color: var(--gold); }
.icon-btn.on svg { fill: var(--gold); stroke: var(--gold); }
.progress-line { height: 4px; background: var(--line); border-radius: 99px; overflow: hidden; margin-bottom: 16px; }
.progress-line span { display: block; height: 100%; background: var(--gold); transition: width .25s; }

/* Exam */
.exam-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.exam-side { position: sticky; top: 84px; padding: 0; overflow: hidden; }
.timer { font-family: var(--serif); font-size: 32px; font-weight: 700; text-align: center; letter-spacing: 1px; }
.timer.low { color: var(--bad); }
.navgrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; max-height: 430px; overflow: auto; padding: 16px; }
.navgrid button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 9px; height: 38px; cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--ink-2);
}
.navgrid button.done { background: var(--navy); color: #fff; border-color: var(--navy); }
[data-theme="dark"] .navgrid button.done { background: var(--navy-2); }
.navgrid button.cur { outline: 2px solid var(--gold); outline-offset: 1px; background: var(--ink); color: var(--paper); border-color: var(--ink); }
.navgrid button.flag { box-shadow: inset 0 -4px 0 var(--gold); }
.navgrid button.right { background: var(--ok); color: #fff; border-color: var(--ok); }
.navgrid button.wrong { background: var(--bad); color: #fff; border-color: var(--bad); }
.result-ring { width: 150px; height: 150px; margin: 0 auto 8px; position: relative; }
.result-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.result-ring .val { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--serif); font-size: 32px; font-weight: 700; }
.verdict { text-align: center; font-weight: 700; font-size: 18px; }
.verdict.pass { color: var(--ok); }
.verdict.fail { color: var(--bad); }

/* Bank list */
.list-item { padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item .qq { font-weight: 500; margin: 6px 0 8px; }
.list-item ol { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 4px; }
.list-item li { font-size: 14px; color: var(--ink-2); padding: 4px 8px; border-radius: 6px; }
.list-item li.ans { background: var(--ok-soft); color: var(--ok); font-weight: 600; }
mark { background: #ffe08a; color: #1b1407; border-radius: 3px; padding: 0 1px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 18px; flex-wrap: wrap; }

/* Modal */
.modal { position: fixed; inset: 0; background: rgba(10, 20, 30, .55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal[hidden] { display: none; }
.modal-box { background: var(--paper); border-radius: 16px; max-width: 460px; width: 100%; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }

/* Footer */
.footer { border-top: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--ink-2); }
.footer-in { padding: 20px 0 28px; }
.footer p { margin: 6px 0; }

.kbd { font: 600 12px/1 var(--sans); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px; padding: 3px 6px; background: var(--bg); }
.note-list { margin: 0; padding-left: 18px; }
.note-list li { margin: 6px 0; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; box-shadow: var(--shadow); }

@media (max-width: 900px) {
  .exam-layout { grid-template-columns: 1fr; }
  .exam-side { position: static; order: 2; }
  .navgrid { grid-template-columns: repeat(7, 1fr); max-height: none; }
  .mode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .mode-grid { grid-template-columns: 1fr; }
  .xbar-top { flex-wrap: wrap; }
  .xclock { order: -1; width: 100%; justify-content: center; }
  .xnav { grid-template-columns: 1fr 2fr; }
  .mainnav { position: fixed; bottom: 0; left: 0; right: 0; background: var(--navy); justify-content: space-around; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); border-top: 1px solid rgba(255,255,255,.1); z-index: 30; }
  .mainnav a { font-size: 12.5px; padding: 8px 6px; }
  .theme-toggle { margin-left: auto; }
  body { padding-bottom: 64px; }
  .grid-2 { grid-template-columns: 1fr; }
  .hero { padding: 24px 20px; }
  .card { padding: 18px; }
  .q-text { font-size: 16px; }
  .brand-text small { display: none; }
}
@media print {
  .topbar, .footer, .q-nav, .exam-side { display: none; }
}

/* Home modes */
.home-head { text-align: center; padding: 8px 0 22px; }
.home-head h1 { font-size: clamp(28px, 5vw, 40px); margin-bottom: 8px; }
.home-head p { color: var(--ink-2); max-width: 680px; margin: 0 auto; }
.resume { background: var(--gold-soft); border: 1px solid var(--gold); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; display: grid; gap: 8px; font-size: 14.5px; }
.mode-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.mode { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 22px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); transition: transform .15s; }
.mode:hover { transform: translateY(-2px); }
.mode-h { display: flex; align-items: center; gap: 12px; }
.mode-h h2 { margin: 0; font-size: 20px; }
.mode p { margin: 0 0 4px; color: var(--ink-2); font-size: 14px; flex: 1; }
.mi { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.mi svg { width: 24px; height: 24px; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mi-dark { background: #eef1f5; } .mi-dark svg { stroke: #16212e; }
.mi-gold { background: var(--gold-soft); } .mi-gold svg { stroke: #a8700f; }
.mi-violet { background: #eeedfd; } .mi-violet svg { stroke: #4f46e5; }
.mi-green { background: #e7f6ee; } .mi-green svg { stroke: #2f8f5b; }
[data-theme="dark"] .mi { background: rgba(255,255,255,.06); }
[data-theme="dark"] .mi svg { stroke: var(--gold); }
.mlabel { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.mode .input { width: 100%; }
.btn-lg { padding: 13px 18px; font-size: 15px; border-radius: 12px; width: 100%; }
.btn-dark { background: #111827; color: #fff; border-color: #111827; }
.btn-dark:hover { background: #1f2937; }
[data-theme="dark"] .btn-dark { background: #e8edf2; color: #0d141c; border-color: #e8edf2; }
.btn-violet { background: #4f46e5; color: #fff; border-color: #4f46e5; }
.btn-violet:hover { background: #4338ca; }
.btn-green { background: #2f8f5b; color: #fff; border-color: #2f8f5b; }
.btn-green:hover { background: #267a4c; }
.mini-stat { font-size: 13.5px; color: var(--ink-2); }
.mini-stat b { font-size: 20px; color: var(--ink); }
.trow { display: grid; grid-template-columns: minmax(0, 1fr) 90px 64px; gap: 12px; align-items: center; width: 100%; padding: 10px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; cursor: pointer; text-align: left; border-radius: 8px; }
.trow:hover { background: var(--bg); }
.trow:last-child { border-bottom: 0; }
.trow-name { font-size: 14px; }
.trow-name b { color: var(--muted); font-weight: 700; margin-right: 4px; }
.trow .bar { margin: 0; }
.trow-num { text-align: right; font-weight: 600; font-size: 14px; line-height: 1.2; }
.trow-num small { display: block; color: var(--muted); font-weight: 400; font-size: 11.5px; }
.kpis .num { font-size: 26px; font-weight: 700; line-height: 1.1; }
.kpis { gap: 14px; }
.hlist { display: grid; gap: 6px; }
.hrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; color: inherit; text-decoration: none; font-size: 14px; }
.hrow:hover { border-color: var(--navy-2); }

/* Exam screen */
.xbar { padding: 16px 20px; }
.xbar-top { display: flex; align-items: center; gap: 12px; }
.xtitle { font-weight: 700; font-size: 17px; }
.xclock { display: flex; align-items: center; gap: 8px; font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin-right: 6px; }
.xclock svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 2; }
.xclock .low, #xTimer.low { color: var(--bad); }
.xprog { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.xprog .bar { margin: 0; }
.xprog b { color: #4f46e5; }
[data-theme="dark"] .xprog b { color: #a5b4fc; }
.side-h, .xhead { font-size: 12px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); padding: 14px 18px; border-bottom: 1px solid var(--line); }
.xhead { display: flex; align-items: center; margin: -22px -22px 18px; }
.xhead .btn { text-transform: none; letter-spacing: 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 16px 16px; font-size: 12px; color: var(--muted); }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 4px; }
.lg.done { background: var(--navy); border-color: var(--navy); }
.lg.flag { box-shadow: inset 0 -3px 0 var(--gold); }
.xq { font-size: 17px; font-weight: 600; line-height: 1.55; margin: 0 0 16px; }
.xopts { display: grid; gap: 4px; }
.xopt { display: flex; gap: 12px; text-align: left; border: 1.5px solid transparent; background: transparent; border-radius: 12px; padding: 11px 12px; cursor: pointer; font-size: 15.5px; line-height: 1.5; }
.xopt:hover { background: var(--bg); }
.xopt .xk { color: var(--muted); font-weight: 700; min-width: 20px; }
.xopt.sel { border-color: var(--navy-2); background: rgba(29,66,104,.07); }
.xopt.sel .xk { color: var(--navy-2); }
[data-theme="dark"] .xopt.sel .xk { color: #8cc0f2; }
.xnav { display: grid; grid-template-columns: 1fr 2fr; gap: 12px; margin: 20px -22px -22px; padding: 18px 22px; border-top: 1px solid var(--line); }
.xnav .btn-lg { width: 100%; }

/* ---------- today ---------- */
.today { display: grid; margin-bottom: 18px; grid-template-columns: 1.1fr 1.4fr auto; gap: 18px; align-items: center; margin-top: 18px; }
.today-a { display: flex; flex-direction: column; gap: 6px; }
.today-goal { font-size: 15px; color: var(--muted); }
.today-goal b { font: 700 30px/1.1 var(--sans); color: var(--ink); }
.streak { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #c2410c; }
.streak svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.dbars { display: flex; align-items: flex-end; gap: 5px; height: 78px; }
.dbar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; }
.dbar span { width: 100%; min-height: 3px; border-radius: 4px 4px 2px 2px; background: var(--line); }
.dbar span.hit { background: #2f8f5b; }
.dbar i { font: normal 10px/1 var(--sans); color: var(--muted); }
.today-c { display: flex; flex-direction: column; gap: 8px; }
button.link { background: none; border: 0; padding: 0; color: var(--navy-2); text-decoration: underline; cursor: pointer; font: inherit; }
[data-theme="dark"] button.link { color: var(--gold); }
.num-hl { color: #b45309; font-weight: 700; background: rgba(224,164,58,.14); border-radius: 4px; padding: 0 2px; }
[data-theme="dark"] .num-hl { color: #f5c26b; }
.ans-line { margin: 6px 0; }

/* ---------- exam elimination ---------- */
.xrow { display: flex; gap: 8px; align-items: stretch; }
.xrow .xopt { flex: 1; }
.xout { flex: 0 0 auto; border: 1px solid var(--line); background: var(--card); color: var(--muted); border-radius: 10px; padding: 0 10px; font: 600 12px var(--sans); cursor: pointer; }
.xout:hover { color: var(--bad); border-color: var(--bad); }
.xrow.out .xopt { opacity: .45; text-decoration: line-through; }
.xrow.out .xout { color: var(--bad); border-color: var(--bad); }

/* ---------- flashcards ---------- */
.flash { perspective: 1600px; cursor: pointer; margin: 6px 0 16px; }
.flash-in { position: relative; display: grid; transition: transform .45s ease; transform-style: preserve-3d; }
.flash.flipped .flash-in { transform: rotateY(180deg); }
.flash.flipped { cursor: default; }
.face { grid-area: 1 / 1; backface-visibility: hidden; -webkit-backface-visibility: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 24px; box-shadow: var(--shadow, 0 6px 24px rgba(15,23,42,.06)); min-height: 300px; display: flex; flex-direction: column; gap: 12px; }
.face.back { transform: rotateY(180deg); border-color: var(--gold); }
.flash-q { font-size: 19px; line-height: 1.55; margin: 0; font-weight: 500; }
.flash-sub { margin: 0; color: var(--muted); font-size: 15px; }
.flash-opts { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; color: var(--ink-2); font-size: 15px; }
.flash-hint { margin-top: auto; text-align: center; color: var(--muted); font-size: 13px; }
.flash-ans { display: flex; gap: 14px; align-items: flex-start; font-size: 19px; line-height: 1.5; background: var(--ok-soft, #e7f6ee); border-radius: 12px; padding: 14px 16px; }
.flash-ans .big { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: #2f8f5b; color: #fff; font: 700 20px/1 var(--sans); }
.flash-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.flash-actions .btn { width: auto; min-width: 160px; justify-content: center; }
.flash-actions .btn svg { vertical-align: -3px; }
.btn-bad { background: #c2410c; color: #fff; border-color: #c2410c; }
.btn-bad:hover { background: #9a3412; }
.btn-bad .kbd, .btn-green .kbd, .btn-dark .kbd { background: rgba(255,255,255,.15); border-color: rgba(255,255,255,.3); color: inherit; }

/* ---------- notes ---------- */
.note-sec { margin-bottom: 14px; }
.note-sec h2 { margin: 0 0 6px; font-size: 18px; }
.note-item { border-top: 1px dashed var(--line); padding: 10px 0; }
.note-item:first-of-type { border-top: 0; }
.note-item p { margin: 0 0 6px; line-height: 1.6; }

@media (max-width: 900px) {
  .today { grid-template-columns: 1fr; }
  .today-c { flex-direction: row; flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .mainnav a.nav-about { display: none; }
  .mainnav a { font-size: 11.5px; padding: 8px 4px; }
  .face { padding: 18px; min-height: 260px; }
  .flash-q { font-size: 17px; }
  .flash-actions .btn { min-width: 0; flex: 1; }
}
