/* Decision Mastery Academy — styles */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d0f0e; --bg2: #14171580; --bg3: #1e2320;
  --surface: #171b18; --surface2: #20261f;
  --border: rgba(255,255,255,0.07); --border2: rgba(255,255,255,0.14);
  --text: #e8ede9; --text2: #9aab9d; --text3: #5f6f62;
  --accent: #ffa14a; --accent-dim: rgba(255,161,74,0.12);
  --gold: #ffd166; --gold-dim: rgba(255,209,102,0.12);
  --danger: #ff6b6b; --danger-dim: rgba(255,107,107,0.1);
  --info: #74b9ff; --info-dim: rgba(116,185,255,0.12);
  --radius: 14px; --radius-sm: 9px;
  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Outfit', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'DM Mono', 'Cascadia Mono', Consolas, monospace;
  --sidebar-w: 232px;
}

html { font-size: 16px; scroll-behavior: smooth; }
body { background: var(--bg); color: var(--text); font-family: var(--font-body); line-height: 1.65; min-height: 100vh; }
body::before { content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(255,161,74,0.016) 1px, transparent 1px), linear-gradient(90deg, rgba(255,161,74,0.016) 1px, transparent 1px);
  background-size: 64px 64px; }

/* ── layout ── */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar { width: var(--sidebar-w); flex-shrink: 0; border-right: 1px solid var(--border);
  padding: 1.4rem 1rem; position: sticky; top: 0; height: 100vh; overflow-y: auto; background: rgba(13,15,14,0.86); backdrop-filter: blur(6px); }
.main { flex: 1; min-width: 0; padding: 2.2rem clamp(1.2rem, 4vw, 3.4rem) 5rem; max-width: 1060px; }

.brand { font-family: var(--font-display); font-size: 1.25rem; color: var(--accent); text-decoration: none; display: block; margin-bottom: .2rem; }
.brand span { color: var(--text3); font-style: italic; font-size: .85rem; margin-left: .35rem; font-family: var(--font-body); }
.brand-sub { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); margin-bottom: 1.6rem; font-family: var(--font-mono); }

.nav a { display: flex; align-items: center; gap: .65rem; padding: .55rem .7rem; border-radius: var(--radius-sm);
  color: var(--text2); text-decoration: none; font-size: .92rem; margin-bottom: 2px; border: 1px solid transparent; }
.nav a:hover { background: var(--surface2); color: var(--text); }
.nav a.on { background: var(--accent-dim); color: var(--accent); border-color: rgba(255,161,74,0.2); }
.nav a .ico { width: 1.2rem; text-align: center; opacity: .9; }
.nav hr { border: none; border-top: 1px solid var(--border); margin: .8rem 0; }
.nav .nav-label { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--text3); padding: .4rem .7rem; font-family: var(--font-mono); }
.nav-xp { margin-top: 1.2rem; padding: .8rem .9rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: .8rem; color: var(--text2); }
.nav-xp b { color: var(--text); display: block; font-size: .95rem; }

#nav-burger { display: none; position: fixed; top: .9rem; right: .9rem; z-index: 60; width: 2.7rem; height: 2.7rem;
  border-radius: var(--radius-sm); border: 1px solid var(--border2); background: rgba(20,24,21,0.92); color: var(--text); font-size: 1.15rem; cursor: pointer; }

/* ── typography ── */
h1, h2, h3 { font-family: var(--font-display); font-weight: 400; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); margin-bottom: .7rem; }
h2 { font-size: 1.45rem; margin-bottom: .4rem; }
h3 { font-size: 1.08rem; margin: 1.4rem 0 .5rem; color: var(--text); }
p { margin-bottom: .9rem; color: var(--text2); }
b { color: var(--text); font-weight: 600; }
i { color: var(--text3); }
a { color: inherit; }
.crumb { display: inline-block; font-size: .85rem; color: var(--text3); text-decoration: none; margin-bottom: 1.2rem; font-family: var(--font-mono); }
.crumb:hover { color: var(--accent); }
.fine { font-size: .82rem; color: var(--text3); }
.sec-head { margin: 2.4rem 0 1.1rem; }
.sec-head:first-child { margin-top: 0; }
.sec-sub { font-size: .9rem; margin-bottom: 0; }

/* ── buttons/chips ── */
.btn { display: inline-flex; align-items: center; gap: .45rem; padding: .62rem 1.15rem; border-radius: var(--radius-sm);
  border: 1px solid var(--border2); background: var(--surface2); color: var(--text); font-family: var(--font-body);
  font-size: .92rem; font-weight: 500; cursor: pointer; text-decoration: none; transition: border-color .15s, transform .1s, background .15s; }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: #0a120b; border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: #ffb76e; }
.btn-ghost { background: transparent; }
.btn-defect { border-color: rgba(255,107,107,0.4); color: #ff8b8b; background: var(--danger-dim); }
.btn-defect:hover { border-color: var(--danger); }
.btn-sm { padding: .38rem .8rem; font-size: .82rem; }
.btn.is-done { opacity: .7; }
.chip { padding: .35rem .8rem; border-radius: 99px; border: 1px solid var(--border2); background: var(--surface);
  color: var(--text2); font-size: .82rem; cursor: pointer; font-family: var(--font-body); }
.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.on { background: var(--accent-dim); border-color: var(--accent); color: var(--accent); }

/* ── hero / home ── */
.hero { display: grid; grid-template-columns: 1.5fr 1fr; gap: 2.4rem; padding: 2.2rem 0 1rem; align-items: start; }
.hero-kicker { font-family: var(--font-mono); font-size: .75rem; letter-spacing: .18em; text-transform: uppercase; color: var(--accent); margin-bottom: .8rem; }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3rem); }
.hero-sub { font-size: 1.02rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .7rem; margin-top: 1.4rem; flex-wrap: wrap; }
.hero-actions.center { justify-content: center; }
.hero-side { display: flex; flex-direction: column; gap: 1rem; }
.rank-card { background: linear-gradient(160deg, var(--surface2), var(--surface)); border: 1px solid var(--border2);
  border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.rank-name { font-family: var(--font-display); font-size: 1.5rem; color: var(--gold); }
.rank-xp { font-family: var(--font-mono); font-size: .85rem; color: var(--text2); margin: .15rem 0 .6rem; }
.rank-next { font-size: .8rem; color: var(--text3); margin-top: .45rem; }
.rank-note { font-size: .85rem; font-style: italic; color: var(--text2); margin-top: .3rem; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .8rem; }
.stat b { display: block; font-family: var(--font-mono); font-size: 1.05rem; color: var(--accent); }
.stat span { font-size: .74rem; color: var(--text3); }
.home-lower .tool-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem; }

/* ── module cards ── */
.mod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: .9rem; }
.mod-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.15rem; text-decoration: none; transition: border-color .15s, transform .12s; position: relative; }
.mod-card:hover { border-color: var(--mc, var(--accent)); transform: translateY(-2px); }
.mod-card.locked { opacity: .5; filter: saturate(.4); }
.mod-card.done { border-color: rgba(255,161,74,0.25); }
.mod-card-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .5rem; }
.mod-num { font-family: var(--font-mono); font-size: .8rem; color: var(--mc, var(--accent)); letter-spacing: .1em; }
.mod-lock { font-size: .72rem; color: var(--text3); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .08em; }
.mod-card h3 { font-size: 1.12rem; margin: 0 0 .3rem; }
.mod-tag { font-size: .85rem; margin-bottom: .8rem; }
.mod-meta { font-size: .78rem; color: var(--text3); font-family: var(--font-mono); }
.mod-bar { height: 5px; background: rgba(255,255,255,0.06); border-radius: 99px; overflow: hidden; }
.mod-bar i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s; }

.mod-hero { border: 1px solid var(--border); border-left: 3px solid var(--mc, var(--accent)); background: var(--surface);
  border-radius: var(--radius); padding: 1.5rem 1.7rem; margin-bottom: 1.6rem; }
.mod-kicker { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--mc, var(--accent)); margin-bottom: .5rem; }
.mod-tagline { font-size: 1.02rem; color: var(--text2); }
.mod-desc { font-size: .94rem; margin-bottom: 0; }

.mod-checkrow { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: .8rem; }
.check { flex: 1; min-width: 150px; display: flex; flex-direction: column; gap: .1rem; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .75rem .95rem; text-decoration: none; font-size: .85rem; color: var(--text2); }
.check b { color: var(--text); font-size: .92rem; }
.check.ok { border-color: rgba(255,161,74,0.3); }
.check .check-ico { font-size: .8rem; color: var(--text3); }
.check.ok .check-ico { color: var(--accent); }
.banner-ok { background: var(--accent-dim); border: 1px solid rgba(255,161,74,0.3); color: var(--accent);
  border-radius: var(--radius-sm); padding: .7rem 1rem; font-size: .92rem; margin-bottom: 1rem; }

/* ── lessons ── */
.lesson-list { display: flex; flex-direction: column; gap: .5rem; }
.lesson-row { display: flex; align-items: center; gap: .95rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1.05rem; text-decoration: none; transition: border-color .15s; }
.lesson-row:hover { border-color: var(--border2); }
.lesson-row.done { border-color: rgba(255,161,74,0.22); }
.lesson-num { width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-family: var(--font-mono); font-size: .8rem; color: var(--text2); flex-shrink: 0; }
.lesson-row.done .lesson-num { background: var(--accent-dim); color: var(--accent); }
.lesson-t { flex: 1; display: flex; flex-direction: column; }
.lesson-t b { font-size: .98rem; }
.lesson-t i { font-size: .78rem; font-style: normal; font-family: var(--font-mono); }
.lesson-go { color: var(--text3); }
.lesson { max-width: 46rem; }
.lesson-body p { color: var(--text2); font-size: .98rem; }
.lesson-body ul { margin: 0 0 1rem 1.2rem; color: var(--text2); }
.lesson-body li { margin-bottom: .45rem; }
.lesson-body ol { margin: 0 0 1rem 1.3rem; color: var(--text2); }
.lesson-body ol li { margin-bottom: .4rem; }
.lesson-foot { margin-top: 1.8rem; padding-top: 1.3rem; border-top: 1px solid var(--border); display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.lesson-nav { display: flex; gap: .6rem; flex-wrap: wrap; }

.callout { border-radius: var(--radius-sm); padding: .95rem 1.1rem; margin: 1.1rem 0; font-size: .93rem; }
.callout .callout-t { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; margin-bottom: .4rem; }
.callout.ex { background: var(--info-dim); border: 1px solid rgba(116,185,255,0.25); }
.callout.ex .callout-t { color: var(--info); }
.callout.key { background: var(--gold-dim); border: 1px solid rgba(255,209,102,0.3); color: var(--text); }
.callout.key .callout-t { color: var(--gold); }

.tbl-wrap { overflow-x: auto; margin: 1rem 0 1.2rem; }
table { border-collapse: collapse; width: 100%; font-size: .9rem; }
th, td { border: 1px solid var(--border2); padding: .5rem .75rem; text-align: center; }
th { background: var(--surface2); font-family: var(--font-mono); font-size: .78rem; color: var(--text2); }
td { color: var(--text2); }

/* ── drills ── */
.drill-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.drill-prog { font-family: var(--font-mono); font-size: .85rem; color: var(--text2); }
.drill-tags { display: flex; gap: .45rem; flex-wrap: wrap; }
.tag { font-size: .72rem; font-family: var(--font-mono); padding: .22rem .6rem; border-radius: 99px; background: var(--accent-dim); color: var(--accent); border: 1px solid rgba(255,161,74,0.2); }
.tag.dim { background: var(--surface2); color: var(--text3); border-color: var(--border); }
.tag.warn { background: var(--gold-dim); color: var(--gold); border-color: rgba(255,209,102,0.3); }
.drill { max-width: 46rem; }
.drill-body { font-size: 1.02rem; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.drill-hint-row { display: flex; align-items: center; gap: .7rem; margin: 1.1rem 0; flex-wrap: wrap; }

.opts { display: flex; flex-direction: column; gap: .6rem; margin: 1rem 0; }
.opt { display: flex; align-items: center; gap: .9rem; text-align: left; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .85rem 1rem; cursor: pointer; color: var(--text2); font-family: var(--font-body); transition: border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--border2); background: var(--surface2); }
.opt:disabled { cursor: default; }
.opt-letter { width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--surface2); display: flex; align-items: center;
  justify-content: center; font-family: var(--font-mono); font-size: .78rem; flex-shrink: 0; color: var(--text2); border: 1px solid var(--border); }
.opt-main { flex: 1; display: flex; flex-direction: column; gap: .15rem; }
.opt-main b { font-size: .95rem; }
.opt-main i { font-size: .84rem; }
.opt-data { display: none; gap: .35rem; flex-wrap: wrap; justify-content: flex-end; max-width: 15rem; }
.dtag { font-family: var(--font-mono); font-size: .7rem; padding: .18rem .5rem; border-radius: 5px; background: var(--accent-dim); color: var(--accent); white-space: nowrap; }
.dtag.dim { background: var(--surface2); color: var(--text3); }
.opt.is-mine { border-color: var(--border2); }
.opt.is-opt { border-color: rgba(255,161,74,0.55); background: rgba(255,161,74,0.07); }
.opt.is-opt .opt-letter { background: var(--accent-dim); color: var(--accent); border-color: rgba(255,161,74,0.4); }
.opt.is-bad { border-color: rgba(255,107,107,0.55); background: var(--danger-dim); }
.opt.is-bad .opt-letter { color: var(--danger); border-color: rgba(255,107,107,0.4); }

.reveal { border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.1rem 0; border: 1px solid; }
.reveal.ok { background: rgba(255,161,74,0.07); border-color: rgba(255,161,74,0.35); }
.reveal.miss { background: var(--danger-dim); border-color: rgba(255,107,107,0.35); }
.reveal-head { font-weight: 600; margin-bottom: .4rem; }
.reveal.ok .reveal-head { color: var(--accent); }
.reveal.miss .reveal-head { color: var(--danger); }
.reveal-outcome { margin-bottom: .3rem; }

.ev-chart { margin: 1.2rem 0; }
.ev-title { font-family: var(--font-mono); font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text3); margin-bottom: .6rem; }
.ev-row { display: flex; align-items: center; gap: .8rem; margin-bottom: .45rem; font-size: .84rem; }
.ev-l { width: 34%; min-width: 180px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ev-bar { flex: 1; height: 10px; background: rgba(255,255,255,0.05); border-radius: 99px; overflow: hidden; }
.ev-bar i { display: block; height: 100%; background: var(--text3); border-radius: 99px; }
.ev-row.best .ev-bar i { background: var(--accent); }
.ev-row.mine .ev-bar i { background: var(--gold); }
.ev-row.mine.best .ev-bar i { background: linear-gradient(90deg, var(--gold), var(--accent)); }
.ev-v { font-family: var(--font-mono); font-size: .74rem; color: var(--text3); white-space: nowrap; }
.drill-next-row { display: flex; gap: .7rem; margin-top: 1.2rem; flex-wrap: wrap; }
.drill-cta-row { display: flex; align-items: center; gap: 1rem; margin: 1rem 0 1.3rem; flex-wrap: wrap; }
.drill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .6rem; }
.drill-cell { display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: .7rem .9rem; text-decoration: none; transition: border-color .15s; position: relative; }
.drill-cell:hover { border-color: var(--border2); }
.drill-cell b { font-size: .88rem; }
.drill-cell i { font-size: .74rem; font-style: normal; font-family: var(--font-mono); color: var(--text3); }
.drill-cell-lv { font-family: var(--font-mono); font-size: .68rem; color: var(--gold); }
.drill-cell.ok { border-color: rgba(255,161,74,0.3); }
.drill-cell.ok::after, .drill-cell.miss::after { content: '✓'; position: absolute; top: .5rem; right: .7rem; color: var(--accent); font-size: .8rem; }
.drill-cell.miss::after { content: '✗'; color: var(--danger); }

/* ── quiz ── */
.quiz-prog { font-family: var(--font-mono); font-size: .85rem; color: var(--text2); margin-bottom: .8rem; }
.quiz { max-width: 46rem; }

/* ── sims ── */
.sim-head { margin-bottom: 1.2rem; }
.sim-sub { font-size: .92rem; max-width: 44rem; }
.pd-opp-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
.pd-opp-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .7rem .85rem;
  text-align: left; cursor: pointer; color: var(--text2); font-family: var(--font-body); transition: border-color .15s; }
.pd-opp-card:hover { border-color: var(--border2); }
.pd-opp-card.sel { border-color: var(--oc, var(--accent)); background: rgba(255,255,255,0.03); }
.pd-opp-name { display: block; font-weight: 600; font-size: .9rem; color: var(--oc, var(--text)); margin-bottom: .2rem; }
.pd-opp-desc { font-size: .76rem; }
.pd-board { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.pd-scorebar { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; gap: .8rem; flex-wrap: wrap; }
.pd-score { display: flex; flex-direction: column; }
.pd-score .lbl { font-size: .72rem; font-family: var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--text3); }
.pd-score .val { font-family: var(--font-display); font-size: 1.7rem; }
.pd-score.you .val { color: var(--accent); }
.pd-round { font-family: var(--font-mono); font-size: .82rem; color: var(--text2); }
.pd-log { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: .6rem .8rem; margin-bottom: 1rem; font-family: var(--font-mono); font-size: .8rem; }
.pd-log-empty { color: var(--text3); }
.pd-log-row { display: flex; gap: 1rem; padding: .18rem 0; color: var(--text2); }
.pd-r { color: var(--text3); width: 1.6rem; }
.pd-moves { display: flex; gap: 1.2rem; flex: 1; }
.pd-moves i { font-style: normal; }
.pd-moves i.c { color: var(--accent); }
.pd-moves i.d { color: var(--danger); }
.pd-pay { color: var(--gold); }
.pd-actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.btn-coop { border-color: rgba(255,161,74,0.4); background: var(--accent-dim); color: var(--accent); }
.btn-coop:hover:not(:disabled) { border-color: var(--accent); }
.btn-defect { }
.pd-verdict { margin-top: 1rem; }
.pd-verdict-box { border-radius: var(--radius-sm); padding: .85rem 1rem; font-size: .92rem; border: 1px solid rgba(255,209,102,0.35); background: var(--gold-dim); }
.pd-verdict-box.good { border-color: rgba(255,161,74,0.4); background: var(--accent-dim); }
.pd-verdict-box.bad { border-color: rgba(255,107,107,0.4); background: var(--danger-dim); }

.nash-games { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.1rem; }
.nash-table { max-width: 30rem; margin-bottom: .8rem; }
.nash-table td { cursor: pointer; font-family: var(--font-mono); font-size: .92rem; color: var(--text); transition: background .15s; }
.nash-table td.ne { background: var(--accent-dim); box-shadow: inset 0 0 0 1px rgba(255,161,74,0.45); }
.nash-table td.clicked { background: rgba(255,161,74,0.28); }
.nash-found { font-size: .88rem; color: var(--text2); margin-bottom: .6rem; }
.nash-note { font-size: .92rem; color: var(--text2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .9rem 1.1rem; max-width: 40rem; }

.bayes-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; align-items: start; }
.bayes-controls label { display: block; font-size: .88rem; color: var(--text2); margin-bottom: 1rem; }
.bayes-controls input[type=range] { width: 100%; margin-top: .4rem; accent-color: #ffa14a; }
.bayes-controls b { color: var(--gold); font-family: var(--font-mono); }
.bayes-presets { display: flex; gap: .45rem; flex-wrap: wrap; align-items: center; margin-top: 1.2rem; }
.bayes-presets .lbl { font-size: .78rem; color: var(--text3); }
.bayes-viz { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem 1.3rem; }
.bayes-bar-wrap { height: 26px; background: rgba(255,255,255,0.05); border-radius: 8px; overflow: hidden; margin-bottom: 1rem; }
.bayes-bar { height: 100%; width: 50%; background: var(--accent); border-radius: 8px; transition: width .25s; }
.bayes-readout div:first-child { font-size: 1rem; color: var(--text2); margin-bottom: .4rem; }
.bayes-readout b { font-family: var(--font-mono); font-size: 1.25rem; color: var(--accent); }
.bayes-math { font-family: var(--font-mono); font-size: .76rem; color: var(--text3); margin-bottom: .8rem; }
.bayes-lesson { font-size: .9rem; color: var(--text2); border-top: 1px solid var(--border); padding-top: .8rem; }

/* ── toolkit ── */
.toolkit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.toolkit-grid.narrow { grid-template-columns: 1fr; max-width: 44rem; }
.tool-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.25rem; text-decoration: none; transition: border-color .15s; }
.tool-card:hover { border-color: var(--border2); }
.tool-card b { font-size: .95rem; }
.tool-card p { font-size: .88rem; margin: .5rem 0 .6rem; }
.tool-card.big p { font-size: .93rem; }
.tool-head { display: flex; align-items: center; gap: .8rem; margin-bottom: .3rem; }
.tool-ico { font-size: 1.5rem; }
.tool-head i { display: block; font-size: .78rem; font-style: normal; font-family: var(--font-mono); color: var(--text3); }

/* ── achievements ── */
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .8rem; }
.ach { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 1rem 1.1rem;
  display: flex; flex-direction: column; gap: .25rem; opacity: .55; }
.ach.got { opacity: 1; border-color: rgba(255,209,102,0.35); }
.ach-ico { font-size: 1.6rem; }
.ach b { font-size: .95rem; }
.ach i { font-size: .8rem; }
.ach em { font-family: var(--font-mono); font-size: .72rem; color: var(--gold); font-style: normal; }
.ach em.dim { color: var(--text3); }

/* ── misc ── */
.empty-state { text-align: center; padding: 3.5rem 1rem; max-width: 34rem; margin: 0 auto; }
.empty-state p { margin-bottom: 1rem; }
.toast { position: fixed; bottom: 1.4rem; left: 50%; transform: translate(-50%, 20px); background: #1c231e; color: var(--text);
  border: 1px solid var(--border2); border-radius: var(--radius-sm); padding: .75rem 1.2rem; font-size: .9rem;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100; max-width: 90vw; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ach { border-color: rgba(255,209,102,0.5); }
.toast.rank { border-color: rgba(255,161,74,0.5); color: var(--accent); }

/* ── responsive ── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 1.4rem; }
  .bayes-grid, .toolkit-grid, .home-lower .tool-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  #nav-burger { display: block; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; z-index: 50; transform: translateX(-100%); transition: transform .22s ease; height: 100dvh; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: 0 0 60px rgba(0,0,0,0.6); }
  .main { padding: 4.2rem 1.1rem 4rem; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .ev-l { min-width: 120px; width: 40%; }
  .opt-data { max-width: 100%; justify-content: flex-start; }
  .drill-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .drill-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-actions .btn { flex: 1; justify-content: center; }
}

/* ── cloud sync (optional account) ─────────── */
.cloud-form { display: flex; flex-direction: column; gap: .55rem; margin-top: .6rem; }
.cloud-form label { font-size: .74rem; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; font-family: var(--font-mono); }
.cloud-form input { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .6rem .8rem; color: var(--text); font-family: var(--font-mono); font-size: .9rem; }
.cloud-form input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); }
.cloud-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .25rem; }
.admin-grid { grid-template-columns: repeat(4, 1fr); }
.spark-row { display: flex; align-items: flex-end; gap: 3px; height: 40px; margin: .35rem 0 .9rem; }
.spark-row i { flex: 1; min-width: 4px; background: var(--accent-dim); border: 1px solid rgba(255,161,74,0.25); border-bottom: none; border-radius: 3px 3px 0 0; }
@media (max-width: 640px) { .admin-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── about (research notes) ───────────────── */
.about-list { margin: .5rem 0 0; padding-left: 1.15rem; display: grid; gap: .5rem; }
.about-list li { font-size: .92rem; color: var(--text2); line-height: 1.55; }
.about-list b { color: var(--text); }

/* ── signed-in chip (sidebar) ─────────────── */
.cloud-chip { margin-top: 1rem; padding: .55rem .7rem; border: 1px solid var(--border); border-radius: var(--radius-sm); display: flex; align-items: center; gap: .5rem; justify-content: space-between; font-family: var(--font-mono); font-size: .72rem; color: var(--text2); }
.cloud-chip b { color: var(--accent); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.cloud-chip button { background: none; border: 1px solid var(--border2); color: var(--text2); border-radius: 6px; padding: .18rem .5rem; cursor: pointer; font-family: inherit; font-size: .68rem; flex-shrink: 0; }
.cloud-chip button:hover { border-color: var(--accent); color: var(--accent); }
