/* Mariana. Calm, clean, deep. One accent (ocean blue); depth is the only metaphor. */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f1f4f8;
  --surface-3: #e8edf4;
  --border: #e1e7ef;
  --border-strong: #cbd4e1;
  --text: #0e1726;
  --muted: #5a687a;
  --faint: #8a97a8;
  --accent: #1a56db;
  --accent-strong: #1240a8;
  --accent-soft: #e8efff;
  --accent-text: #ffffff;
  --good: #0c8a68;
  --good-soft: #e2f5ee;
  --warn: #a8670f;
  --warn-soft: #fcf1df;
  --bad: #c93b3b;
  --bad-soft: #fcebeb;
  --shadow: 0 1px 2px rgba(14, 23, 38, 0.05), 0 4px 16px rgba(14, 23, 38, 0.05);
  --shadow-lg: 0 8px 40px rgba(14, 23, 38, 0.12);
  --radius: 14px;
  --radius-sm: 9px;
  /* depth: surface (light) to trench (dark) */
  --depth-0: #d9ecff;
  --depth-1: #9fd0ff;
  --depth-2: #5aa7f2;
  --depth-3: #2c74d6;
  --depth-4: #1a47a3;
  --depth-5: #0d2560;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #0a101b;
    --surface: #101a2a;
    --surface-2: #16223a;
    --surface-3: #1d2b46;
    --border: #22314b;
    --border-strong: #31446a;
    --text: #e6edf7;
    --muted: #9aa9bf;
    --faint: #6d7d96;
    --accent: #6d9cff;
    --accent-strong: #93b5ff;
    --accent-soft: #18284a;
    --accent-text: #08101e;
    --good: #3dcc9e;
    --good-soft: #0f2f28;
    --warn: #f0b45a;
    --warn-soft: #33260f;
    --bad: #ff7b7b;
    --bad-soft: #3a1818;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #0a101b;
  --surface: #101a2a;
  --surface-2: #16223a;
  --surface-3: #1d2b46;
  --border: #22314b;
  --border-strong: #31446a;
  --text: #e6edf7;
  --muted: #9aa9bf;
  --faint: #6d7d96;
  --accent: #6d9cff;
  --accent-strong: #93b5ff;
  --accent-soft: #18284a;
  --accent-text: #08101e;
  --good: #3dcc9e;
  --good-soft: #0f2f28;
  --warn: #f0b45a;
  --warn-soft: #33260f;
  --bad: #ff7b7b;
  --bad-soft: #3a1818;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 18px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.5);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { margin: 0 0 0.4em; line-height: 1.2; font-weight: 650; letter-spacing: -0.01em; }
h1 { font-family: var(--font-display); font-weight: 560; font-size: clamp(1.9rem, 4vw, 2.6rem); letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 0.8em; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 0.86rem; }
.tiny { font-size: 0.76rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 60px;
  padding: 0 max(16px, calc((100vw - 1180px) / 2));
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 650; font-size: 1.08rem; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 28px; height: 28px; }
.brand-name { font-family: var(--font-display); font-weight: 560; font-size: 1.3rem; letter-spacing: -0.01em; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); font-weight: 520; font-size: 0.94rem; }
.topnav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.topnav a.active { color: var(--text); background: var(--surface-2); }
.topbar .spacer { flex: 1; }
.container { max-width: 1180px; margin: 0 auto; padding: 28px 16px 80px; }
.narrow { max-width: 760px; margin: 0 auto; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .topnav { display: none; }
  .container { padding-top: 20px; }
}

/* ---------- surfaces ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.flat { box-shadow: none; }
.card.tight { padding: 14px 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-link { display: block; color: inherit; transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s; }
.card-link:hover { text-decoration: none; transform: translateY(-2px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 34px 0 14px; }
.section-title h2 { margin: 0; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.72rem; font-weight: 650; color: var(--faint); }
.divider { height: 1px; background: var(--border); margin: 20px 0; border: 0; }
.callout { border-radius: var(--radius-sm); padding: 12px 14px; background: var(--surface-2); border: 1px solid var(--border); }
.callout.warn { background: var(--warn-soft); border-color: transparent; color: var(--text); }
.callout.good { background: var(--good-soft); border-color: transparent; }
.callout.bad { background: var(--bad-soft); border-color: transparent; }
.callout.accent { background: var(--accent-soft); border-color: transparent; }

/* ---------- controls ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 560;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn.big { min-height: 50px; padding: 12px 22px; font-size: 1.02rem; border-radius: 12px; }
.btn.small { min-height: 32px; padding: 4px 11px; font-size: 0.86rem; border-radius: 8px; }
.btn.block { width: 100%; }
.btn .kbd { margin-left: 2px; }
.kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--border-strong); border-bottom-width: 2px; border-radius: 5px; font-size: 0.72rem; font-weight: 600; color: var(--faint); line-height: 16px; text-align: center; }
.btn.primary .kbd { color: inherit; border-color: color-mix(in srgb, var(--accent-text) 40%, transparent); }

label.field { display: block; }
label.field > span { display: block; font-weight: 580; font-size: 0.92rem; margin-bottom: 6px; }
label.field > small { display: block; color: var(--faint); font-size: 0.82rem; margin-top: 4px; }
.input, textarea.input, select.input {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--surface);
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
textarea.input { min-height: 120px; resize: vertical; line-height: 1.5; }
.input.huge { font-size: 1.25rem; min-height: 58px; padding: 12px 16px; border-radius: 13px; font-weight: 520; }
.segmented { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.segmented button { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 540; color: var(--muted); cursor: pointer; font-size: 0.92rem; }
.segmented button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.84rem;
  font-weight: 540;
  color: var(--muted);
  white-space: nowrap;
}
button.chip { cursor: pointer; }
button.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.accent { background: var(--accent-soft); color: var(--accent-strong); border-color: transparent; }
.chip.good { background: var(--good-soft); color: var(--good); border-color: transparent; }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.chip.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--border); margin: 18px 0 22px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  display: inline-flex; align-items: center; gap: 7px;
  border: 0; background: none; padding: 10px 14px; margin-bottom: -1px;
  border-bottom: 2px solid transparent; color: var(--muted); font-weight: 560; cursor: pointer; white-space: nowrap; font-size: 0.94rem;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected='true'] { color: var(--text); border-bottom-color: var(--accent); }
.tabs .tick { width: 15px; height: 15px; border-radius: 50%; background: var(--good); color: #fff; display: inline-grid; place-items: center; font-size: 10px; }
.tabs .lock { opacity: 0.6; }

/* meters */
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.5s ease; }
.meter.good > i { background: var(--good); }
.meter.warn > i { background: var(--warn); }
.credits { display: flex; align-items: center; gap: 10px; font-size: 0.82rem; color: var(--muted); }
.credits .meter { width: 70px; height: 6px; }
.credits span { white-space: nowrap; }
@media (max-width: 420px) { .credits .meter { display: none; } }

/* account button & menu */
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; font-weight: 650; font-size: 0.85rem; overflow: hidden; border: 1px solid var(--border); cursor: pointer; padding: 0; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.menu { position: absolute; right: 0; top: 44px; min-width: 240px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; z-index: 40; }
.menu .menu-head { padding: 10px 12px 8px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.menu button, .menu a { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border: 0; background: none; border-radius: 8px; cursor: pointer; text-align: left; color: var(--text); font-size: 0.93rem; }
.menu button:hover, .menu a:hover { background: var(--surface-2); text-decoration: none; }
.badge-dot { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 0.7rem; font-weight: 700; display: inline-grid; place-items: center; }

/* toasts & modal */
.toasts { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center; width: min(92vw, 520px); }
.toast { background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 11px; box-shadow: var(--shadow-lg); font-size: 0.93rem; animation: toast-in 0.25s ease; max-width: 100%; }
.toast.bad { background: var(--bad); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.modal-back { position: fixed; inset: 0; background: rgba(5, 10, 20, 0.45); z-index: 80; display: grid; place-items: center; padding: 16px; animation: fade 0.15s ease; }
.modal { background: var(--surface); border-radius: 16px; box-shadow: var(--shadow-lg); width: min(520px, 100%); max-height: 88vh; overflow: auto; padding: 24px; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* loading */
.spinner { width: 18px; height: 18px; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); border-top-color: currentColor; border-radius: 50%; animation: spin 0.8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 10px; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* the dive: shown while the AI works */
.dive { position: relative; overflow: hidden; border-radius: 18px; padding: 44px 24px; text-align: center; color: #e8f1ff; background: linear-gradient(180deg, #2c74d6 0%, #1a47a3 45%, #0d2560 80%, #07142f 100%); min-height: 280px; }
.dive h2 { color: #fff; font-family: var(--font-display); font-weight: 520; font-size: 1.6rem; }
.dive .dive-msg { min-height: 1.6em; opacity: 0.92; }
.dive .depth-readout { font-variant-numeric: tabular-nums; font-size: 0.85rem; opacity: 0.75; margin-top: 18px; letter-spacing: 0.04em; }
.bubbles span { position: absolute; bottom: -20px; width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.5); animation: rise 6s linear infinite; }
@keyframes rise { to { transform: translateY(-360px); opacity: 0; } }

/* ---------- landing ---------- */
.hero { padding: 60px 0 36px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6vw, 3.8rem); margin-bottom: 14px; }
.hero .lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-art { aspect-ratio: 1; border-radius: 28px; background: linear-gradient(180deg, var(--depth-0), var(--depth-2) 40%, var(--depth-4) 75%, var(--depth-5)); position: relative; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero-art .layer { position: absolute; left: 0; right: 0; color: rgba(255, 255, 255, 0.85); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; padding: 0 22px; display: flex; justify-content: space-between; border-top: 1px dashed rgba(255, 255, 255, 0.25); padding-top: 6px; }
.signin-card { max-width: 420px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.feature .ico { width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; margin-bottom: 10px; font-size: 18px; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 28px; }
  .hero-art { display: none; }
  .features { grid-template-columns: 1fr; }
}

/* ---------- depth badge ---------- */
.depth { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.84rem; }
.depth-swatch { width: 12px; height: 12px; border-radius: 4px; }
.depth-bar { display: grid; grid-template-columns: repeat(6, 1fr); gap: 3px; width: 100%; }
.depth-bar i { height: 6px; border-radius: 3px; background: var(--surface-3); }
.depth-gauge { display: flex; flex-direction: column; gap: 6px; min-width: 180px; }

/* subject cards */
.subject-card { display: flex; flex-direction: column; gap: 10px; min-height: 170px; }
.subject-card h3 { font-size: 1.12rem; margin: 0; }
.subject-card .foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.new-card { border-style: dashed; border-width: 1.5px; display: grid; place-items: center; text-align: center; color: var(--muted); box-shadow: none; background: transparent; }
.new-card:hover { color: var(--accent); border-color: var(--accent); }
.review-banner { display: flex; align-items: center; gap: 18px; justify-content: space-between; flex-wrap: wrap; background: linear-gradient(120deg, var(--accent-soft), var(--surface)); }
.big-number { font-size: 2.2rem; font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; }

/* subject page */
.subject-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; flex-wrap: wrap; }
.subject-head .tagline { font-size: 1.1rem; color: var(--muted); margin: 0; }
.kt-list { display: grid; gap: 10px; }
.kt { display: grid; grid-template-columns: 130px 1fr; gap: 12px; align-items: center; }
.kt .meter { height: 6px; }
@media (max-width: 560px) { .kt { grid-template-columns: 1fr; gap: 4px; } }
.lens-list { display: grid; gap: 10px; }
.lens-item { display: flex; gap: 12px; align-items: flex-start; }
.lens-item .ico { flex: none; width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: var(--surface-2); font-size: 16px; }
.lens-item.on .ico { background: var(--accent-soft); }
.lens-item.soon { opacity: 0.78; }
.unit-list { display: grid; gap: 12px; }
.unit-row { display: grid; grid-template-columns: 44px 1fr auto; gap: 16px; align-items: center; }
.unit-num { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.unit-row.ready .unit-num { background: var(--accent-soft); color: var(--accent-strong); }
.unit-row h3 { margin: 0 0 2px; }
.tool-icons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
@media (max-width: 560px) { .unit-row { grid-template-columns: 36px 1fr; } .unit-row > :last-child { grid-column: 1 / -1; } .unit-num { width: 36px; height: 36px; } }

/* concept map */
.cmap-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.cmap { display: block; min-width: 100%; }
.cmap .node rect { stroke: var(--border-strong); stroke-width: 1; transition: stroke 0.12s; }
.cmap .node { cursor: pointer; }
.cmap .node:hover rect, .cmap .node.sel rect { stroke: var(--accent); stroke-width: 2; }
.cmap .node text { font-size: 12.5px; font-weight: 560; fill: var(--text); pointer-events: none; }
.cmap .node.deep text { fill: #fff; }
.cmap .edge { fill: none; stroke: var(--border-strong); stroke-width: 1.4; }
.cmap .edge.hi { stroke: var(--accent); stroke-width: 2; }
.cmap .gate { fill: var(--warn); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.8rem; color: var(--muted); align-items: center; }
.legend i { display: inline-block; width: 11px; height: 11px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- study tools ---------- */
.study-card {
  position: relative;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 36px 28px;
  font-size: 1.22rem;
  line-height: 1.45;
}
.study-card .face { max-width: 34em; }
.study-card .answer { margin-top: 20px; padding-top: 20px; border-top: 1px dashed var(--border-strong); width: 100%; font-weight: 600; color: var(--accent-strong); }
.study-card .meta { position: absolute; top: 14px; left: 18px; right: 18px; display: flex; justify-content: space-between; font-size: 0.78rem; color: var(--faint); }
.study-card .source-quote { font-size: 0.86rem; color: var(--muted); font-style: italic; margin-top: 12px; font-weight: 400; }
.blank { display: inline-block; min-width: 4em; border-bottom: 2px solid var(--accent); margin: 0 3px; height: 1em; vertical-align: -2px; }
.confidence { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.grades .btn { flex-direction: column; gap: 0; min-height: 56px; line-height: 1.2; }
.grades .btn small { font-weight: 450; color: var(--faint); font-size: 0.74rem; }
.grades .again { color: var(--bad); }
.grades .good { color: var(--good); }
@media (max-width: 560px) { .confidence { grid-template-columns: 1fr; } .grades { grid-template-columns: repeat(2, 1fr); } .study-card { font-size: 1.08rem; padding: 34px 18px; } }
.session-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.session-top .meter { flex: 1; max-width: 360px; }
.surprise { background: var(--warn-soft); border-radius: 10px; padding: 10px 14px; font-size: 0.92rem; margin-top: 12px; text-align: left; }
.choice-list { display: grid; gap: 10px; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%;
  padding: 13px 15px; border-radius: 11px; border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; font-size: 1rem;
}
.choice:hover { border-color: var(--accent); }
.choice .letter { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-weight: 650; font-size: 0.85rem; color: var(--muted); }
.choice[aria-pressed='true'] { border-color: var(--accent); background: var(--accent-soft); }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice:disabled { cursor: default; }
.feedback { border-radius: 12px; padding: 14px 16px; margin-top: 16px; }
.feedback.right { background: var(--good-soft); }
.feedback.partly { background: var(--warn-soft); }
.feedback.wrong { background: var(--bad-soft); }
.feedback h4 { margin: 0 0 4px; }
.calib { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.calib .cell { background: var(--surface-2); border-radius: 10px; padding: 12px; }
.calib .cell b { display: block; font-size: 1.4rem; }
@media (max-width: 560px) { .calib { grid-template-columns: 1fr; } }

/* vocab */
.vocab-list { display: grid; gap: 10px; }
.vocab-item { display: grid; grid-template-columns: minmax(140px, 220px) 1fr auto; gap: 16px; align-items: start; }
.vocab-item .term { font-weight: 650; font-size: 1.04rem; }
.vocab-item .def.hidden-def { filter: blur(6px); cursor: pointer; user-select: none; }
.vocab-item .example { color: var(--muted); font-size: 0.92rem; margin-top: 4px; }
.vocab-item .hook { font-size: 0.86rem; color: var(--accent-strong); margin-top: 4px; }
.star { border: 0; background: none; font-size: 1.15rem; cursor: pointer; color: var(--faint); padding: 2px 6px; }
.star[aria-pressed='true'] { color: #e3a008; }
@media (max-width: 640px) { .vocab-item { grid-template-columns: 1fr auto; } .vocab-item .def-col { grid-column: 1 / -1; } }

/* overview */
.overview-hook { font-family: var(--font-display); font-size: 1.45rem; line-height: 1.35; font-weight: 450; margin-bottom: 16px; }
.key-ideas { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.key-ideas li { display: flex; gap: 12px; align-items: flex-start; }
.key-ideas li::before { content: ''; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 9px; }
.locked { text-align: center; padding: 40px 20px; }

/* lenses */
.lens-frame { border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); overflow: hidden; }
.lens-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.diagram-canvas { padding: 20px; overflow-x: auto; min-height: 220px; display: grid; place-items: center; }
.diagram-canvas svg { max-width: 100%; height: auto; }
.diagram-canvas .node { cursor: pointer; }
.diagram-detail { padding: 12px 16px; border-top: 1px solid var(--border); min-height: 50px; }
.blank-inputs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; padding: 14px 16px; border-top: 1px solid var(--border); }
.blank-inputs label { display: flex; align-items: center; gap: 8px; }
.blank-inputs .num { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: var(--accent-text); display: grid; place-items: center; font-weight: 700; font-size: 0.82rem; }
.blank-inputs .input { min-height: 38px; padding: 6px 10px; }
.blank-inputs .input.right { border-color: var(--good); background: var(--good-soft); }
.blank-inputs .input.wrong { border-color: var(--bad); background: var(--bad-soft); }

.timeline { position: relative; padding: 30px 20px 20px; overflow-x: auto; }
.tl-track { position: relative; height: 4px; background: var(--surface-3); border-radius: 2px; margin: 0 10px; }
.tl-events { position: relative; display: grid; gap: 12px; margin-top: 24px; }
.tl-event { display: grid; grid-template-columns: 110px 18px 1fr; gap: 12px; align-items: start; cursor: pointer; border-radius: 10px; padding: 6px; }
.tl-event:hover { background: var(--surface-2); }
.tl-event .date { text-align: right; font-weight: 650; color: var(--accent-strong); font-variant-numeric: tabular-nums; font-size: 0.92rem; padding-top: 1px; }
.tl-event .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--surface); border: 3px solid var(--accent); margin-top: 4px; position: relative; }
.tl-event .dot::after { content: ''; position: absolute; left: 3px; top: 14px; width: 2px; height: calc(100% + 40px); background: var(--border); }
.tl-event:last-child .dot::after { display: none; }
.tl-event .body .detail { color: var(--muted); font-size: 0.92rem; }
.tl-ticks { position: absolute; inset: 0; }
.tl-tick { position: absolute; top: -6px; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); cursor: pointer; }
.tl-tick.sel { transform: scale(1.4); }
.tl-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--faint); margin: 8px 10px 0; }
.order-list { display: grid; gap: 8px; padding: 16px; }
.order-item { display: grid; grid-template-columns: 30px 1fr auto; gap: 10px; align-items: center; padding: 10px 12px; border: 1.5px solid var(--border-strong); border-radius: 10px; background: var(--surface); }
.order-item.right { border-color: var(--good); background: var(--good-soft); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
.order-item .pos { font-weight: 700; color: var(--faint); text-align: center; }
.order-item .moves { display: flex; gap: 4px; }

.map-box { position: relative; height: min(68vh, 560px); min-height: 360px; }
.map-box .maplibregl-map { position: absolute; inset: 0; }
.map-side { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.map-list { border-left: 1px solid var(--border); max-height: min(68vh, 560px); overflow: auto; padding: 8px; }
.map-list button { display: flex; gap: 10px; width: 100%; text-align: left; border: 0; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; align-items: flex-start; }
.map-list button:hover { background: var(--surface-2); }
.map-list .pin { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); margin-top: 6px; }
.map-list .pin.country { border-radius: 3px; background: var(--depth-2); }
.map-list .pin.route { border-radius: 2px; height: 4px; margin-top: 9px; background: var(--warn); }
.map-prompt { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); z-index: 5; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg); border-radius: 12px; padding: 10px 16px; font-weight: 600; text-align: center; max-width: 90%; }
.map-prompt .small { font-weight: 450; }
@media (max-width: 760px) { .map-side { grid-template-columns: 1fr; } .map-list { border-left: 0; border-top: 1px solid var(--border); max-height: 240px; } }
.maplibregl-popup-content { background: var(--surface) !important; color: var(--text); border-radius: 10px !important; box-shadow: var(--shadow-lg) !important; font-family: var(--font); padding: 10px 14px !important; }
.maplibregl-popup-tip { border-top-color: var(--surface) !important; border-bottom-color: var(--surface) !important; }

/* warm-up */
.warm-q { display: grid; gap: 10px; }
.warm-q .model { background: var(--accent-soft); border-radius: 10px; padding: 10px 13px; }

/* admin */
table.table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.table th, .table td { text-align: left; padding: 10px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table th { font-size: 0.76rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--faint); font-weight: 650; }
.table .input { min-height: 32px; padding: 4px 8px; width: 80px; }
.table-wrap { overflow-x: auto; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 120px; padding-top: 10px; }
.bars .bar { flex: 1; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; position: relative; }
.bars .bar span { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 0.66rem; color: var(--faint); white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.5rem; letter-spacing: -0.02em; }

/* easter egg */
.hog-swim { position: fixed; bottom: 30px; left: -140px; width: 110px; z-index: 90; pointer-events: none; animation: swim 9s linear forwards; }
@keyframes swim { 0% { left: -140px; transform: translateY(0); } 25% { transform: translateY(-14px); } 50% { transform: translateY(6px); } 75% { transform: translateY(-10px); } 100% { left: calc(100vw + 40px); transform: translateY(0); } }

/* ---------- print ---------- */
.print-toolbar { position: sticky; top: 60px; z-index: 10; background: var(--bg); padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.sheet { background: #fff; color: #111; width: 100%; max-width: 8.5in; margin: 0 auto 24px; padding: 0.6in 0.65in; box-shadow: var(--shadow-lg); border-radius: 4px; font-size: 11pt; line-height: 1.45; }
.sheet h1 { font-size: 20pt; font-family: var(--font-display); color: #111; margin-bottom: 2pt; }
.sheet h2 { font-size: 13pt; margin: 14pt 0 6pt; color: #111; }
.sheet .sub { color: #555; font-size: 10pt; margin-bottom: 12pt; }
.sheet table { width: 100%; border-collapse: collapse; }
.sheet td, .sheet th { border-bottom: 1px solid #ddd; padding: 5pt 6pt; vertical-align: top; text-align: left; }
.sheet th { font-size: 8.5pt; text-transform: uppercase; letter-spacing: 0.05em; color: #666; }
.sheet .line { border-bottom: 1px solid #999; height: 22pt; }
.sheet .q { margin-bottom: 12pt; break-inside: avoid; }
.sheet .q ol { margin: 4pt 0 0; padding-left: 18pt; list-style: upper-alpha; }
.sheet .cut-grid { display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: 2.15in; border-top: 1px dashed #aaa; border-left: 1px dashed #aaa; }
.sheet .cut-grid > div { border-right: 1px dashed #aaa; border-bottom: 1px dashed #aaa; padding: 12pt; display: grid; place-items: center; text-align: center; font-size: 11.5pt; }
.sheet .cut-grid.backs > div { font-weight: 600; }
.sheet .foot-note { font-size: 8pt; color: #888; margin-top: 16pt; }
.sheet svg text { font-family: var(--font); }
.page-break { break-after: page; }
@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; }
  .topbar, .print-toolbar, .no-print, .toasts { display: none !important; }
  .container { padding: 0; max-width: none; }
  .sheet { box-shadow: none; padding: 0; margin: 0; max-width: none; border-radius: 0; }
  .sheet + .sheet { break-before: page; }
}
