
/* ---------- Design tokens ---------- */
:root{
  --bg:#f4f5f7;
  --surface:#ffffff;
  --surface-2:#f8f9fb;
  --ink:#141a26;
  --ink-2:#2c3445;
  --muted:#5f6676;
  --line:#e2e5eb;
  --line-strong:#cfd4dd;
  --primary:#2846c4;
  --primary-hover:#1f39a6;
  --primary-soft:#ebeffc;
  --teal:#0e4f4c;
  --green:#17724f;
  --green-soft:#e6f4ee;
  --red:#b3343e;
  --red-soft:#fbeced;
  --amber:#93600b;
  --amber-soft:#fdf3e1;
  --radius:14px;
  --radius-sm:10px;
  --shadow:0 1px 2px rgba(20,26,38,.05),0 1px 1px rgba(20,26,38,.03);
  --shadow-lg:0 12px 32px -12px rgba(20,26,38,.18);
  --sidebar:248px;
  font-family:Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
  font-size:15px;
  color:var(--ink);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
:root[data-theme="dark"]{
  --bg:#0f131b;
  --surface:#171c26;
  --surface-2:#1d2330;
  --ink:#eef1f6;
  --ink-2:#c9cfda;
  --muted:#939bab;
  --line:#2a3141;
  --line-strong:#3a4356;
  --primary:#7b93ff;
  --primary-hover:#98abff;
  --primary-soft:#232c4a;
  --teal:#5cc3bb;
  --green:#4cc590;
  --green-soft:#16302a;
  --red:#f07a83;
  --red-soft:#3a1d22;
  --amber:#f0b45a;
  --amber-soft:#3a2c14;
  --shadow:0 1px 2px rgba(0,0,0,.4);
  --shadow-lg:0 12px 32px -12px rgba(0,0,0,.6);
  color-scheme:dark;
}
:root[data-theme="dark"] .btn:not(.secondary):not(.ghost){color:#0f131b}
:root[data-theme="dark"] .qimages img{background:#fff;border-radius:8px}
:root[data-theme="dark"] .topbar{background:rgba(15,19,27,.85)}
:root[data-theme="dark"] .tabs button.active{background:var(--primary);color:#0f131b}

/* ---------- Pro features ---------- */
.scenario{background:var(--surface-2);border:1px solid var(--line);border-left:3px solid var(--primary);border-radius:var(--radius-sm);padding:14px 16px;margin-bottom:16px;line-height:1.6;color:var(--ink-2)}
.steps{margin-top:12px;padding-top:12px;border-top:1px solid var(--line)}
.steps ol{margin:0;padding-left:20px;display:flex;flex-direction:column;gap:4px;line-height:1.5}
.prompt-row{align-items:flex-start;gap:12px}
.prompt-row h2{flex:1}
.icon-btn{flex:none;padding:8px;border-radius:999px}
.icon-btn svg{width:18px;height:18px}
.facts{list-style:none;padding:0;margin:4px 0 12px;display:flex;flex-direction:column;gap:6px;font-size:14px;color:var(--ink-2)}
.facts li{display:flex;gap:8px;align-items:flex-start;line-height:1.45}
.facts svg{width:16px;height:16px;flex:none;margin-top:2px;color:var(--green)}
.exam-card{display:flex;flex-direction:column}
.exam-card .btn{margin-top:auto;align-self:flex-start}
.stats.four{grid-template-columns:repeat(4,minmax(0,1fr))}
.meter{display:flex;flex-direction:column;gap:6px;padding:8px 0}
.meter + .meter{border-top:1px solid var(--line)}
.meter span{font-size:14px;font-weight:550}
.meter-track{height:8px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden;margin-top:6px}
.meter .meter-track{margin-top:0}
.meter-fill{display:block;height:100%;border-radius:999px;background:var(--primary)}
.meter-fill.good{background:var(--green)}
.meter-fill.mid{background:var(--amber)}
.meter-fill.low{background:var(--red)}
.bars{display:flex;align-items:flex-end;gap:4px;height:140px}
.bar{flex:1;height:100%;display:flex;flex-direction:column;justify-content:flex-end;align-items:center;gap:6px;min-width:0}
.bar span{width:100%;min-height:2px;background:var(--primary);border-radius:4px 4px 0 0;opacity:.85}
.bar small{font-size:10px;line-height:1}
.grid.badges{grid-template-columns:repeat(auto-fill,minmax(220px,1fr))}
.badge-card{display:flex;gap:12px;align-items:flex-start;opacity:.55}
.badge-card.earned{opacity:1;border-color:var(--amber)}
.badge-card p{margin:2px 0 0;font-size:13px;color:var(--muted);line-height:1.45}
.badge-icon{flex:none;width:38px;height:38px;border-radius:999px;display:grid;place-items:center;background:var(--surface-2);color:var(--muted)}
.badge-card.earned .badge-icon{background:var(--amber-soft);color:var(--amber)}
.badge-icon svg{width:20px;height:20px}
.admin-content textarea{width:100%;resize:vertical}
code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.9em;background:var(--surface-2);border:1px solid var(--line);padding:1px 6px;border-radius:6px}
@media (max-width:900px){.stats.four{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media print{.scenario{border:1px solid #999}.icon-btn{display:none}}

*{box-sizing:border-box}
body{margin:0;min-height:100vh}
img{max-width:100%;height:auto}
button,input,select,textarea{font:inherit;color:inherit}
button,a,input,select,textarea{-webkit-tap-highlight-color:transparent}
button{cursor:pointer;border:0;background:none}
button:disabled{opacity:.45;cursor:not-allowed}
a{color:var(--primary);text-underline-offset:3px}
:focus-visible{outline:2px solid var(--primary);outline-offset:2px;border-radius:6px}
h1,h2,h3,p{margin-top:0}
h1{font-size:clamp(26px,3.2vw,36px);letter-spacing:-.02em;line-height:1.15;font-weight:700;margin-bottom:10px;text-wrap:balance}
h2{font-size:19px;letter-spacing:-.01em;line-height:1.3;font-weight:650;margin-bottom:10px}
h3{font-size:16px;line-height:1.35;font-weight:650;margin-bottom:8px}
p{line-height:1.6;color:var(--ink-2)}
.muted,small{color:var(--muted)}
small{font-size:12.5px;line-height:1.5}
.label{font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;font-weight:650;color:var(--muted);display:block;margin-bottom:10px}
.hidden{display:none!important}
.printonly{display:none}
.skip{position:absolute;left:-9999px;top:8px;background:var(--ink);color:#fff;padding:10px 14px;border-radius:8px;z-index:100}
.skip:focus{left:8px}
.loading{display:grid;place-items:center;min-height:100vh;color:var(--muted)}

/* ---------- Sidebar ---------- */
.sidebar{width:var(--sidebar);background:var(--surface);border-right:1px solid var(--line);position:fixed;inset:0 auto 0 0;display:flex;flex-direction:column;padding:24px 16px;z-index:10}
.brand{font-size:19px;font-weight:700;letter-spacing:-.02em;display:flex;align-items:center;gap:10px;color:var(--ink);text-decoration:none;margin:0 8px 32px}
.brand .muted{color:var(--primary)}
.brandmark{width:32px;height:32px;background:var(--primary);border-radius:9px;display:grid;place-items:center;color:#fff;flex:none}
.brandmark svg{width:18px;height:18px}
.nav{display:flex;flex-direction:column;gap:2px}
.nav button{display:flex;align-items:center;gap:12px;text-align:left;padding:10px 12px;border-radius:var(--radius-sm);color:var(--muted);font-size:14px;font-weight:550;transition:background .15s,color .15s}
.nav button:hover{background:var(--surface-2);color:var(--ink)}
.nav button.active{background:var(--primary-soft);color:var(--primary)}
.nav svg{width:18px;height:18px;flex:none}
.side-note{margin-top:auto;padding:14px;background:var(--surface-2);border:1px solid var(--line);border-radius:var(--radius-sm);font-size:13px;line-height:1.55;color:var(--muted)}
.side-note strong{color:var(--ink)}
.profile{display:flex;align-items:center;gap:10px;margin-top:14px;padding:12px 8px 0;border-top:1px solid var(--line);font-size:13.5px}
.profile>div{flex:1;min-width:0;line-height:1.3}
.profile strong{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avatar{width:34px;height:34px;border-radius:50%;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;font-weight:700;flex:none;text-transform:uppercase}
.exit{width:34px;height:34px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
.exit:hover{background:var(--surface-2);color:var(--red)}

/* ---------- Shell / topbar ---------- */
.shell{margin-left:var(--sidebar);min-height:100vh;display:flex;flex-direction:column}
.topbar{height:60px;display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 40px;border-bottom:1px solid var(--line);background:rgba(244,245,247,.85);backdrop-filter:saturate(180%) blur(8px);position:sticky;top:0;z-index:5}
.mobilebrand{display:none}
.breadcrumb{font-size:13.5px;font-weight:550;color:var(--ink)}
.status{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted)}
.status button{width:32px;height:32px;border-radius:8px;display:grid;place-items:center;color:var(--muted)}
.status button:hover{background:var(--surface);color:var(--red)}
.dot{width:8px;height:8px;border-radius:50%;background:var(--green);box-shadow:0 0 0 3px var(--green-soft)}
main{padding:36px 40px 40px;max-width:1240px;width:100%;flex:1}
.footer{display:flex;justify-content:space-between;flex-wrap:wrap;gap:8px;margin-top:56px;padding-top:20px;border-top:1px solid var(--line);font-size:12.5px;color:var(--muted)}

/* ---------- Page heading ---------- */
.welcome{display:flex;justify-content:space-between;align-items:flex-end;gap:24px;margin-bottom:28px}
.welcome p{margin:0;color:var(--muted);max-width:620px}
.date-pill{flex:none;padding:7px 12px;border:1px solid var(--line);border-radius:999px;background:var(--surface);font-size:12.5px;color:var(--muted);font-weight:550}

/* ---------- Layout helpers ---------- */
.grid{display:grid;gap:16px}
.grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.row{display:flex;align-items:center;gap:10px}
.row.between{justify-content:space-between}
.wrap{flex-wrap:wrap}
.center{justify-content:center}
.stack{display:flex;flex-direction:column;gap:12px}
.home-layout{display:grid;grid-template-columns:minmax(0,1fr) 320px;gap:24px;align-items:start}
.home-aside{display:flex;flex-direction:column;gap:16px}
.section-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:36px 0 12px}
.section-title h2{margin:0;font-size:17px}

/* ---------- Cards ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:24px;box-shadow:var(--shadow)}
.card + .card{margin-top:0}
.card>h2:first-child,.card>h3:first-child{margin-top:0}
.card img{border-radius:8px}
.card.tip{background:var(--ink);border-color:var(--ink);color:#fff}
.card.tip p{color:rgba(255,255,255,.75)}
.card.tip .label{color:rgba(255,255,255,.6)}

/* Journey hero cards */
.journey{position:relative;overflow:hidden;border-radius:var(--radius);padding:28px;min-height:280px;display:flex;flex-direction:column;align-items:flex-start;color:#fff;box-shadow:var(--shadow)}
.journey.kids{background:var(--primary)}
.journey.papa{background:var(--teal)}
.journey h2{font-size:28px;letter-spacing:-.02em;margin-bottom:8px;color:#fff;position:relative;z-index:1}
.journey p{color:rgba(255,255,255,.82);max-width:min(240px,58%);position:relative;z-index:1;margin-bottom:20px;text-wrap:pretty}
.journey .btn{margin-top:auto;position:relative;z-index:1}
.journey svg.art{position:absolute;right:12px;bottom:12px;width:min(130px,38%);height:auto;opacity:.9;pointer-events:none}
@media (min-width:1400px){.journey svg.art{width:min(160px,38%)}}
.tag{display:inline-flex;font-size:11.5px;font-weight:650;letter-spacing:.06em;text-transform:uppercase;padding:5px 10px;border-radius:999px;background:rgba(255,255,255,.14);color:#fff;margin-bottom:18px;position:relative;z-index:1}

/* Stats */
.stats{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:18px 20px;box-shadow:var(--shadow)}
.stat strong{display:block;font-size:28px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;line-height:1.1;margin-bottom:4px}
.stat span{font-size:13px;color:var(--muted)}

/* Ring */
.ring{position:relative;width:150px;margin:16px auto 20px}
.ring svg{display:block;width:150px;height:150px;transform:rotate(-90deg)}
.ring circle:first-child{stroke:var(--line)}
.ring circle:last-child{stroke:var(--primary);transition:stroke-dasharray .6s ease}
.ringtext{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center}
.ringtext strong{font-size:28px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.ringtext span{font-size:12px;color:var(--muted)}
.legend{display:flex;justify-content:space-between;padding:10px 0;border-top:1px solid var(--line);font-size:13.5px;color:var(--muted)}
.legend strong{color:var(--ink);font-variant-numeric:tabular-nums}

/* Course cards */
.course{display:flex;flex-direction:column;align-items:flex-start;transition:border-color .15s,box-shadow .15s}
.course:hover{border-color:var(--line-strong);box-shadow:var(--shadow-lg)}
.course p{color:var(--muted);font-size:14px;flex:1}
.iconbox{width:42px;height:42px;border-radius:10px;background:var(--primary-soft);color:var(--primary);display:grid;place-items:center;font-weight:700;font-size:15px;margin-bottom:16px}
.count{font-size:12.5px;color:var(--muted);margin-bottom:16px;display:block}

/* Lists */
.listrow{display:flex;justify-content:space-between;align-items:center;gap:16px;padding:14px 0;border-bottom:1px solid var(--line)}
.listrow:first-child{padding-top:0}
.listrow:last-child{border-bottom:0;padding-bottom:0}
.listrow p{margin:2px 0 0;font-size:13px;color:var(--muted)}
.listrow strong{font-weight:600}
.empty{padding:24px 8px;text-align:center;color:var(--muted);font-size:14px;line-height:1.6}

/* ---------- Buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:42px;padding:0 18px;border-radius:var(--radius-sm);background:var(--primary);color:#fff;font-weight:600;font-size:14px;text-decoration:none;white-space:nowrap;transition:background .15s,border-color .15s,color .15s}
.btn:hover{background:var(--primary-hover)}
.btn svg{width:16px;height:16px}
.btn.secondary{background:var(--surface);color:var(--ink);border:1px solid var(--line-strong)}
.btn.secondary:hover{background:var(--surface-2);border-color:var(--muted)}
.btn.ghost{background:transparent;color:var(--primary)}
.btn.ghost:hover{background:var(--primary-soft)}
.btn.white{background:#fff;color:var(--ink)}
.btn.white:hover{background:rgba(255,255,255,.88)}
.btn.small{min-height:34px;padding:0 12px;font-size:13px}

/* Tabs */
.tabs{display:inline-flex;gap:2px;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:20px;flex-wrap:wrap}
.tabs button{padding:8px 16px;border-radius:9px;font-size:13.5px;font-weight:600;color:var(--muted)}
.tabs button:hover{color:var(--ink)}
.tabs button.active{background:var(--ink);color:#fff}

/* Badges */
.badge{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border-radius:999px;background:var(--primary-soft);color:var(--primary);font-size:12px;font-weight:600;white-space:nowrap}
.badge.green{background:var(--green-soft);color:var(--green)}
.badge.red{background:var(--red-soft);color:var(--red)}
.badge.orange{background:var(--amber-soft);color:var(--amber)}

/* Notices / feedback */
.notice{padding:14px 16px;border-radius:var(--radius-sm);background:var(--primary-soft);color:var(--ink-2);font-size:13.5px;line-height:1.6;margin:16px 0;border:1px solid rgba(40,70,196,.15)}
.notice.warn{background:var(--amber-soft);border-color:rgba(147,96,11,.2);color:#5b3c07}
.feedback{padding:14px 16px;border-radius:var(--radius-sm);background:var(--green-soft);border:1px solid rgba(23,114,79,.2);font-size:14px;line-height:1.6;margin-top:14px}
.feedback.wrong{background:var(--red-soft);border-color:rgba(179,52,62,.2)}
.rubric{font-size:13px;color:var(--muted);border-left:3px solid var(--line-strong);padding-left:12px}
.error{color:var(--red);font-size:13.5px;min-height:1em;margin:4px 0 12px}
.credit{font-size:12px;color:var(--muted);margin-top:12px}

/* ---------- Forms ---------- */
.field{display:flex;flex-direction:column;gap:6px;font-size:13.5px;font-weight:550;margin-bottom:14px;color:var(--ink-2)}
label{font-size:13.5px;font-weight:550;color:var(--ink-2)}
input:not([type=radio]):not([type=checkbox]),select,textarea{width:100%;min-height:42px;padding:9px 12px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);background:var(--surface);font-size:14.5px;font-weight:400;transition:border-color .15s,box-shadow .15s}
input:not([type=radio]):not([type=checkbox]):hover,select:hover,textarea:hover{border-color:var(--muted)}
input:not([type=radio]):not([type=checkbox]):focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px rgba(40,70,196,.15)}
textarea{min-height:180px;resize:vertical;line-height:1.6}
.filters{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;align-items:end}
.filters label{display:flex;flex-direction:column;gap:6px}
.filteractions{display:flex;flex-wrap:wrap;gap:8px;margin-top:16px}
.row label{display:flex;flex-direction:column;gap:6px}

/* ---------- Question view ---------- */
.question-layout{display:grid;grid-template-columns:minmax(0,1fr) 260px;gap:20px;align-items:start}
.question-layout>aside{position:sticky;top:80px}
.question{padding:32px!important}
.question h2{font-size:21px;line-height:1.45;margin:14px 0 18px;font-weight:600}
.options{display:flex;flex-direction:column;gap:10px;margin:18px 0}
.option{display:flex;gap:12px;align-items:flex-start;padding:14px 16px;border:1px solid var(--line-strong);border-radius:var(--radius-sm);cursor:pointer;font-weight:450;line-height:1.5;transition:border-color .15s,background .15s}
.option:hover{border-color:var(--primary);background:var(--surface-2)}
.option:has(input:checked){border-color:var(--primary);background:var(--primary-soft);box-shadow:inset 0 0 0 1px var(--primary)}
.option input{margin:3px 0 0;accent-color:var(--primary);width:16px;height:16px;flex:none}
.option span{display:flex;flex-direction:column;gap:8px}
.option img{max-width:200px}
.qimages{display:flex;flex-wrap:wrap;gap:12px;margin:0 0 16px}
.qimages img{max-height:260px;border:1px solid var(--line);border-radius:8px;background:#fff}
.question-footer{display:flex;justify-content:space-between;gap:10px;margin-top:24px;padding-top:20px;border-top:1px solid var(--line)}
.timer{font-size:30px;font-weight:700;letter-spacing:-.02em;font-variant-numeric:tabular-nums;margin:2px 0 12px}
.progressbar{margin:8px 0 16px}
progress{width:100%;height:6px;appearance:none;border:0;border-radius:99px;background:var(--line);overflow:hidden;display:block}
progress::-webkit-progress-bar{background:var(--line);border-radius:99px}
progress::-webkit-progress-value{background:var(--primary);border-radius:99px}
progress::-moz-progress-bar{background:var(--primary);border-radius:99px}
.qnav{display:grid;grid-template-columns:repeat(5,1fr);gap:6px;max-height:340px;overflow:auto;padding:2px}
.qnav button{min-height:34px;border-radius:8px;border:1px solid var(--line);background:var(--surface);font-size:12.5px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums}
.qnav button:hover{border-color:var(--line-strong);color:var(--ink)}
.qnav button.answered{background:var(--primary-soft);border-color:transparent;color:var(--primary)}
.qnav button.current{background:var(--ink);border-color:var(--ink);color:#fff}

/* ---------- Result ---------- */
.result-head{text-align:center;padding:40px 24px;display:flex;flex-direction:column;align-items:center}
.result-head h1{margin-top:6px}
.bigscore{font-size:64px;font-weight:700;letter-spacing:-.04em;line-height:1;font-variant-numeric:tabular-nums;color:var(--primary)}
.bigscore small{font-size:26px;color:var(--muted);letter-spacing:-.01em}
.result-head .row{margin-top:8px}
.review-card{margin-top:12px}
.review-card h3{font-size:16px;line-height:1.5;margin-top:10px}
.answer-block{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:14px 0}
.answer-block>div{padding:14px 16px;border-radius:var(--radius-sm);background:var(--surface-2);border:1px solid var(--line);font-size:14px;line-height:1.55;display:flex;flex-direction:column;gap:6px}
.answer-block .label{margin-bottom:2px}
.review-form{margin-top:16px;padding-top:16px;border-top:1px solid var(--line)}

/* ---------- Tables ---------- */
.tablewrap{overflow-x:auto;margin-top:12px;border:1px solid var(--line);border-radius:var(--radius-sm)}
table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);font-weight:650;background:var(--surface-2);padding:10px 14px;border-bottom:1px solid var(--line);white-space:nowrap}
td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
tr:last-child td{border-bottom:0}
tbody tr:hover td{background:var(--surface-2)}

/* Knots */
.knots img{max-height:220px;object-fit:contain;background:var(--surface-2);border:1px solid var(--line);margin-bottom:12px;display:block}
.knots ol{padding-left:20px;line-height:1.7;color:var(--ink-2)}

/* ---------- Auth ---------- */
.auth{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,1fr);min-height:100vh}
.auth-visual{position:relative;overflow:hidden;background:var(--ink);color:#fff;padding:120px 64px 64px;display:flex;flex-direction:column;justify-content:center}
.auth-visual .brand{position:absolute;top:36px;left:64px;margin:0;color:#fff}
.auth-visual .brand .muted{color:#8ea2ff}
.auth-visual .label{color:rgba(255,255,255,.55)}
.auth-visual h1{font-size:clamp(34px,4.2vw,52px);max-width:480px;color:#fff}
.auth-visual p{color:rgba(255,255,255,.7);max-width:420px;font-size:16px}
.auth-visual svg.art{width:min(320px,70%);margin-top:32px;opacity:.95}
.auth-form{display:flex;align-items:center;justify-content:center;padding:48px 24px;background:var(--surface)}
.auth-box{width:100%;max-width:400px}
.auth-box h2{font-size:26px;letter-spacing:-.02em;margin-bottom:8px}
.auth-box>p{color:var(--muted);font-size:14.5px;margin-bottom:24px}
.auth-box form .btn{width:100%;margin-top:6px}

/* ---------- Toast ---------- */
#toast{display:none;position:fixed;left:50%;bottom:24px;transform:translateX(-50%);background:var(--ink);color:#fff;padding:12px 18px;border-radius:var(--radius-sm);font-size:14px;box-shadow:var(--shadow-lg);z-index:100;max-width:calc(100vw - 32px)}

/* ---------- Responsive ---------- */
@media(max-width:1190px){
  :root{--sidebar:216px}
  main{padding:32px 28px}
  .topbar{padding:0 28px}
  .home-layout{grid-template-columns:1fr}
  .home-aside{display:grid;grid-template-columns:1fr 1fr}
  .grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}
  .question-layout{grid-template-columns:minmax(0,1fr) 220px}
  .filters{grid-template-columns:repeat(2,minmax(0,1fr))}
  .auth-visual{padding:110px 40px 48px}
  .auth-visual .brand{left:40px}
}
@media(max-width:760px){
  .sidebar{position:static;width:100%;padding:0;border:0;background:transparent}
  .sidebar>.brand,.sidebar>.side-note,.sidebar>.profile{display:none}
  .sidebar .nav{position:fixed;bottom:0;left:0;right:0;flex-direction:row;justify-content:space-around;background:var(--surface);border-top:1px solid var(--line);padding:6px 4px calc(6px + env(safe-area-inset-bottom));z-index:50}
  .nav button{flex:1;flex-direction:column;gap:4px;padding:8px 4px;font-size:10.5px;text-align:center}
  .nav button.active{background:transparent}
  .nav svg{width:20px;height:20px}
  .shell{margin:0}
  .topbar{height:56px;padding:0 16px}
  .mobilebrand{display:flex;font-size:17px;font-weight:700;gap:8px;align-items:center;letter-spacing:-.02em}
  .mobilebrand .muted{color:var(--primary)}
  .mobilebrand .brandmark{width:28px;height:28px;border-radius:8px}
  .breadcrumb{display:none}
  main{padding:24px 16px 100px}
  .welcome{margin-bottom:20px}
  .date-pill{display:none}
  h1{font-size:26px}
  .grid.two,.grid.three,.home-aside{grid-template-columns:1fr}
  .journey{min-height:240px;padding:22px}
  .journey h2{font-size:24px}
  .journey svg.art{width:130px;right:8px;bottom:12px}
  .journey p{max-width:170px}
  .stats{gap:8px}
  .stat{padding:14px}
  .stat strong{font-size:22px}
  .stat span{font-size:11.5px}
  .card{padding:18px}
  .filters{grid-template-columns:1fr 1fr}
  .question-layout{display:flex;flex-direction:column-reverse}
  .question-layout>aside{position:static;width:100%}
  .qnav{grid-template-columns:repeat(8,1fr);max-height:160px}
  .question{padding:20px!important}
  .question h2{font-size:18px}
  .question-footer{flex-wrap:wrap}
  .question-footer .btn{flex:1}
  .timer{font-size:24px}
  .answer-block{grid-template-columns:1fr}
  .listrow{flex-wrap:wrap}
  .bigscore{font-size:52px}
  .auth{grid-template-columns:1fr}
  .auth-visual{padding:84px 24px 32px;min-height:auto}
  .auth-visual .brand{top:24px;left:24px}
  .auth-visual h1{font-size:32px}
  .auth-visual svg.art{display:none}
  .auth-form{padding:32px 20px 48px}
  #toast{bottom:84px}
}

/* ---------- Print ---------- */
@media print{
  .sidebar,.topbar,.footer,.noprint,#toast,.tabs,.btn,.review-form{display:none!important}
  .shell{margin:0}
  body{background:#fff;color:#000}
  main{padding:0;max-width:none}
  .card{border:1px solid #ccc;box-shadow:none;border-radius:0;break-inside:avoid}
  .printonly{display:block}
  .result-head{padding:10px}
  .result-head .bigscore{font-size:30px}
  .review-card{font-size:12px}
  .review-card h3{font-size:14px}
  .review-card img{max-height:100px}
  .answer-block>div{font-size:12px}
  .grid{display:block}
}
