/* ==========================================================================
   Butterfly Market Insider — Börsenschule
   Design system: warm paper, ink navy, gold accent. Light + dark.
   ========================================================================== */

@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/fraunces-latin-opsz-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/fraunces-latin-ext-opsz-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/fraunces-latin-opsz-italic.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin-opsz-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url(/static/fonts/inter-latin-ext-opsz-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 100 800; font-display: swap;
  src: url(/static/fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2"); }

/* ---------- Tokens ---------- */
:root {
  color-scheme: light;
  --paper: #fbf8f2;
  --paper-2: #f4efe4;
  --paper-3: #ece5d6;
  --card: #fffdf9;
  --ink: #13203a;
  --ink-2: #33415c;
  --muted: #5f6b80;
  --faint: #8a93a3;
  --line: #e3dccd;
  --line-2: #d4cab6;
  --accent: #96661a;          /* gold text — AA on paper */
  --accent-strong: #b47d22;
  --accent-bright: #d9a441;
  --accent-soft: #f6ead2;
  --accent-ink: #2a1c05;
  --navy: #0f1d33;
  --navy-2: #1b2c4a;
  --up: #17794f;
  --up-soft: #e1f2e9;
  --down: #b83a30;
  --down-soft: #f8e3e0;
  --info: #2c5d8f;
  --info-soft: #e3edf7;
  --warn: #8a5a00;
  --warn-soft: #fbefd5;
  --focus: #2c5d8f;
  --shadow-sm: 0 1px 2px rgba(19, 32, 58, .06), 0 1px 1px rgba(19, 32, 58, .04);
  --shadow: 0 1px 2px rgba(19, 32, 58, .05), 0 8px 24px -8px rgba(19, 32, 58, .12);
  --shadow-lg: 0 2px 4px rgba(19, 32, 58, .05), 0 24px 48px -16px rgba(19, 32, 58, .22);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --measure: 70ch;
  --wrap: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 68px;

  /* module hues */
  --m1: #2f7a74; --m1-soft: #e0efec;
  --m2: #4a58a8; --m2-soft: #e5e7f5;
  --m3: #9a5d16; --m3-soft: #f6e9d6;
  --m4: #7d4a86; --m4-soft: #f0e4f1;
  --m5: #2f6b98; --m5-soft: #e0ebf4;
  --m6: #a8483a; --m6-soft: #f6e2de;
  --m7: #4d6f37; --m7-soft: #e5eedd;
  --m8: #9c3d68; --m8-soft: #f5e1ea;
  --ok: #3f8f2f; --ok-soft: #e4f3dc; --ok-ink: #1e4a14;
  --bad: #c2453b; --bad-soft: #fbe4e1; --bad-ink: #6b1a14;
  --flame: #e8742a;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --paper: #0b1322; --paper-2: #0f192b; --paper-3: #16223a; --card: #111c30;
    --ink: #ece7dc; --ink-2: #c9cdd6; --muted: #98a2b4; --faint: #6f7a8f;
    --line: #22304a; --line-2: #2e3e5c;
    --accent: #e2b45c; --accent-strong: #e8bd68; --accent-bright: #f0c977; --accent-soft: #2a2414; --accent-ink: #1a1203;
    --navy: #070d18; --navy-2: #0d1628;
    --up: #4cc38a; --up-soft: #10291f; --down: #f07a6e; --down-soft: #2f1613;
    --info: #79aee0; --info-soft: #12243a; --warn: #e8b34a; --warn-soft: #2a2110; --focus: #79aee0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -10px rgba(0,0,0,.55);
    --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 28px 56px -18px rgba(0,0,0,.7);
    --m1: #6cc2b9; --m1-soft: #10272a; --m2: #9aa7ef; --m2-soft: #171d38; --m3: #e2a75a; --m3-soft: #2a1f10;
    --m4: #cf9ad8; --m4-soft: #261a2b; --m5: #7fb6e2; --m5-soft: #112233; --m6: #ef9282; --m6-soft: #2c1714;
    --m7: #9cc77c; --m7-soft: #18240f;
    --m8: #e88bb5; --m8-soft: #2c1520;
    --ok: #6cc35a; --ok-soft: #14280f; --ok-ink: #c8f0bd; --bad: #f07a6e; --bad-soft: #2f1613; --bad-ink: #ffd6d1; --flame: #ff9a4d;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0b1322; --paper-2: #0f192b; --paper-3: #16223a; --card: #111c30;
  --ink: #ece7dc; --ink-2: #c9cdd6; --muted: #98a2b4; --faint: #6f7a8f;
  --line: #22304a; --line-2: #2e3e5c;
  --accent: #e2b45c; --accent-strong: #e8bd68; --accent-bright: #f0c977; --accent-soft: #2a2414; --accent-ink: #1a1203;
  --navy: #070d18; --navy-2: #0d1628;
  --up: #4cc38a; --up-soft: #10291f; --down: #f07a6e; --down-soft: #2f1613;
  --info: #79aee0; --info-soft: #12243a; --warn: #e8b34a; --warn-soft: #2a2110; --focus: #79aee0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 10px 28px -10px rgba(0,0,0,.55);
  --shadow-lg: 0 2px 4px rgba(0,0,0,.3), 0 28px 56px -18px rgba(0,0,0,.7);
  --m1: #6cc2b9; --m1-soft: #10272a; --m2: #9aa7ef; --m2-soft: #171d38; --m3: #e2a75a; --m3-soft: #2a1f10;
  --m4: #cf9ad8; --m4-soft: #261a2b; --m5: #7fb6e2; --m5-soft: #112233; --m6: #ef9282; --m6-soft: #2c1714;
  --m7: #9cc77c; --m7-soft: #18240f;
  --m8: #e88bb5; --m8-soft: #2c1520;
  --ok: #6cc35a; --ok-soft: #14280f; --ok-ink: #c8f0bd; --bad: #f07a6e; --bad-soft: #2f1613; --bad-ink: #ffd6d1; --flame: #ff9a4d;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-size: 17px; line-height: 1.65;
  font-optical-sizing: auto; font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { max-width: 100%; height: auto; }
svg { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--accent-soft); color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; color: var(--paper); }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.tnum { font-variant-numeric: tabular-nums; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -.015em; color: var(--ink); margin: 0; font-variation-settings: "SOFT" 30; }
h1 { font-size: clamp(2.1rem, 1.4rem + 3vw, 3.6rem); letter-spacing: -.025em; }
h2 { font-size: clamp(1.55rem, 1.2rem + 1.4vw, 2.15rem); }
h3 { font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); }
h4 { font-size: 1.08rem; font-family: var(--sans); font-weight: 650; letter-spacing: -.005em; }
p { margin: 0 0 1.1em; }
.eyebrow { font: 600 .74rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.lead { font-size: clamp(1.08rem, 1rem + .35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); }
.muted { color: var(--muted); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, background .2s;
}
.site-header.scrolled { border-bottom-color: var(--line); }
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 22px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; letter-spacing: -.01em; white-space: nowrap; }
.brand-name b { font-family: var(--sans); font-weight: 700; font-size: .7rem; letter-spacing: .26em; color: var(--muted); margin-left: .55em; vertical-align: .14em; }
.brand-sub { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); margin-top: 5px; font-weight: 600; }
.main-nav { display: flex; gap: 4px; margin-left: 10px; }
.main-nav a { text-decoration: none; font-weight: 550; font-size: .95rem; color: var(--ink-2); padding: 8px 12px; border-radius: 999px; transition: background .15s, color .15s; }
.main-nav a:hover { background: var(--paper-2); color: var(--ink); }
.main-nav a[aria-current="page"], .main-nav a.active { color: var(--ink); background: var(--paper-3); }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.icon-btn { appearance: none; border: 0; background: transparent; color: var(--ink-2); width: 40px; height: 40px; border-radius: 999px; display: inline-grid; place-items: center; cursor: pointer; transition: background .15s, color .15s; text-decoration: none; }
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }
.search-btn { width: auto; padding: 0 12px 0 11px; gap: 9px; display: inline-flex; border: 1px solid var(--line); background: var(--card); font: 500 .88rem var(--sans); color: var(--muted); height: 38px; }
.search-btn kbd { font: 500 .72rem var(--mono); border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px; color: var(--faint); }
.lang-switch { font: 650 .78rem var(--sans); letter-spacing: .08em; text-decoration: none; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 7px 10px; }
.lang-switch:hover { border-color: var(--line-2); color: var(--ink); }
.menu-btn { display: none; }
.theme-toggle .sun { display: none; }
:root[data-theme="dark"] .theme-toggle .sun { display: block; }
:root[data-theme="dark"] .theme-toggle .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-toggle .sun { display: block; } :root:not([data-theme="light"]) .theme-toggle .moon { display: none; } }

@media (max-width: 940px) {
  .main-nav { display: none; }
  .menu-btn { display: inline-grid; }
  .search-btn span, .search-btn kbd { display: none; }
  .search-btn { width: 40px; padding: 0; justify-content: center; border: 0; background: transparent; }
}
@media (max-width: 420px) { .brand-name b { display: none; } .lang-switch { padding: 6px 8px; } }

.mobile-nav { position: fixed; inset: var(--header-h) 0 0 0; z-index: 39; background: var(--paper); padding: 20px var(--gutter) 40px; display: none; overflow-y: auto; }
.mobile-nav.open { display: block; }
.mobile-nav a { display: block; font-family: var(--serif); font-size: 1.6rem; padding: 14px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.mobile-nav .small { font-family: var(--sans); font-size: 1rem; color: var(--muted); border: 0; padding: 10px 0; }

/* ---------- Market strip ---------- */
.ticker { border-bottom: 1px solid var(--line); background: var(--paper-2); font-size: .82rem; }
.ticker .wrap { display: flex; gap: 26px; overflow-x: auto; scrollbar-width: none; padding-top: 8px; padding-bottom: 8px; align-items: center; white-space: nowrap; }
.ticker .wrap::-webkit-scrollbar { display: none; }
.ticker .t-item { display: inline-flex; gap: 8px; align-items: baseline; }
.ticker .t-label { color: var(--muted); font-weight: 550; }
.ticker .t-val { font-family: var(--mono); font-size: .8rem; color: var(--ink); }
.ticker .t-chg { font-family: var(--mono); font-size: .78rem; }
.up { color: var(--up); } .down { color: var(--down); }
.ticker .t-time { margin-left: auto; color: var(--faint); font-size: .75rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 10px; font: 600 .98rem var(--sans); text-decoration: none; padding: 13px 22px; border-radius: 999px; border: 1px solid transparent; cursor: pointer; transition: transform .15s, background .15s, box-shadow .15s, color .15s; line-height: 1.2; }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--paper); box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--navy-2); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow); }
:root[data-theme="dark"] .btn-primary:hover { background: #fff; color: var(--navy); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary:hover { background: #fff; color: var(--navy); } }
.btn-gold { background: var(--accent-bright); color: var(--accent-ink); }
.btn-gold:hover { background: var(--accent-strong); color: var(--accent-ink); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--card); color: var(--ink); border-color: var(--ink-2); }
.btn-sm { padding: 8px 14px; font-size: .88rem; }

/* ---------- Home: hero ---------- */
.hero { position: relative; padding: clamp(48px, 7vw, 96px) 0 clamp(40px, 6vw, 80px); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 85% 20%, color-mix(in srgb, var(--accent-bright) 16%, transparent), transparent 70%),
    radial-gradient(ellipse 50% 60% at 10% 90%, color-mix(in srgb, var(--m5) 10%, transparent), transparent 70%); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero h1 { font-size: clamp(2.5rem, 1.5rem + 4.2vw, 4.6rem); line-height: 1.02; margin: 18px 0 22px; }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--accent); }
.hero .lead { max-width: 34em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 26px; margin-top: 34px; color: var(--muted); font-size: .9rem; }
.hero-facts span { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { width: 17px; height: 17px; color: var(--accent); }
.hero-art { position: relative; }
.hero-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 22px 22px 16px; }
.hero-card .hc-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.hero-card .hc-title { font: 600 .82rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.hero-card .hc-big { font: 600 1.9rem var(--mono); letter-spacing: -.03em; }
.hero-note { position: absolute; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 13px; box-shadow: var(--shadow); font-size: .82rem; line-height: 1.35; max-width: 210px; }
.hero-note b { display: block; font-family: var(--serif); font-size: .98rem; margin-bottom: 2px; }
.hero-note.n1 { left: -26px; bottom: 54px; }
.hero-note.n2 { right: -14px; top: -22px; }
@media (max-width: 900px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-note.n1 { left: 10px; } .hero-note.n2 { right: 10px; }
}
@media (max-width: 520px) { .hero-note { display: none; } }

/* ---------- Sections ---------- */
.section { padding: clamp(48px, 7vw, 96px) 0; }
.section-alt { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.section-head h2 { margin-top: 10px; max-width: 22em; }
.section-head p { max-width: 36em; margin: 12px 0 0; color: var(--muted); }
.link-arrow { font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; color: var(--ink); white-space: nowrap; }
.link-arrow::after { content: "→"; transition: transform .15s; }
.link-arrow:hover::after { transform: translateX(3px); }

/* ---------- Module cards ---------- */
.path { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 18px; }
.module-card { --mc: var(--m1); --mcs: var(--m1-soft); position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 24px 20px; text-decoration: none; color: var(--ink); transition: transform .2s, box-shadow .2s, border-color .2s; overflow: hidden; }
.module-card::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 4px; background: var(--mc); opacity: .85; }
.module-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-2); color: var(--ink); }
.module-card .mc-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.module-card .mc-num { font: 600 .78rem var(--mono); color: var(--mc); background: var(--mcs); padding: 4px 9px; border-radius: 999px; letter-spacing: .02em; }
.module-card .mc-icon { width: 44px; height: 44px; border-radius: 12px; background: var(--mcs); color: var(--mc); display: grid; place-items: center; }
.module-card .mc-icon svg { width: 24px; height: 24px; }
.module-card h3 { font-size: 1.38rem; margin-bottom: 8px; }
.module-card p { color: var(--muted); font-size: .95rem; margin: 0 0 18px; flex: 1; }
.module-card .mc-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; gap: 10px; }
.level { display: inline-flex; align-items: center; gap: 6px; }
.level i { display: inline-block; width: 6px; height: 6px; border-radius: 2px; background: var(--line-2); }
.level i.on { background: var(--mc, var(--accent)); }
.progress { height: 5px; border-radius: 99px; background: var(--paper-3); overflow: hidden; margin-top: 12px; }
.progress span { display: block; height: 100%; width: 0; background: var(--mc, var(--accent)); border-radius: 99px; transition: width .6s cubic-bezier(.2,.8,.2,1); }
.m1 { --mc: var(--m1); --mcs: var(--m1-soft); } .m2 { --mc: var(--m2); --mcs: var(--m2-soft); }
.m3 { --mc: var(--m3); --mcs: var(--m3-soft); } .m4 { --mc: var(--m4); --mcs: var(--m4-soft); }
.m5 { --mc: var(--m5); --mcs: var(--m5-soft); } .m6 { --mc: var(--m6); --mcs: var(--m6-soft); }
.m7 { --mc: var(--m7); --mcs: var(--m7-soft); } .m8 { --mc: var(--m8); --mcs: var(--m8-soft); }

/* ---------- Home: term of the day + news ---------- */
.split { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(24px, 4vw, 56px); align-items: start; }
@media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.term-card { background: var(--navy); color: #ece7dc; border-radius: var(--radius-lg); padding: clamp(26px, 4vw, 40px); position: relative; overflow: hidden; }
.term-card::after { content: ""; position: absolute; right: -60px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; border: 1px solid rgba(217, 164, 65, .25); box-shadow: 0 0 0 30px rgba(217,164,65,.05), 0 0 0 60px rgba(217,164,65,.03); }
.term-card .eyebrow { color: var(--accent-bright); }
.term-card h3 { color: #fff; font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem); margin: 14px 0 14px; }
.term-card p { color: #c9cdd6; font-size: 1.05rem; }
.term-card a.link-arrow { color: var(--accent-bright); }
.glossary-search { margin-top: 22px; position: relative; }
.input { width: 100%; font: 500 1rem var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-2); border-radius: 12px; padding: 13px 14px 13px 44px; transition: border-color .15s, box-shadow .15s; }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 18%, transparent); }
.input-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }

.news-list { list-style: none; margin: 0; padding: 0; }
.news-item { display: grid; grid-template-columns: 64px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.news-item:first-child { padding-top: 0; }
.news-time { font: 500 .8rem var(--mono); color: var(--muted); padding-top: 3px; }
.news-title { font-family: var(--serif); font-weight: 550; font-size: 1.12rem; line-height: 1.3; margin: 0 0 6px; letter-spacing: -.005em; }
.news-title a { text-decoration: none; }
.news-title a:hover { text-decoration: underline; color: var(--ink); }
.news-sum { color: var(--ink-2); font-size: .95rem; margin: 0 0 8px; }
.news-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; align-items: center; font-size: .78rem; color: var(--muted); }
.news-source { font-weight: 650; letter-spacing: .04em; text-transform: uppercase; font-size: .7rem; }
.chip { display: inline-flex; align-items: center; gap: 5px; font: 600 .74rem var(--sans); padding: 3px 9px; border-radius: 999px; background: var(--paper-3); color: var(--ink-2); text-decoration: none; border: 1px solid transparent; }
a.chip:hover { border-color: var(--line-2); color: var(--ink); }
.chip-term { background: var(--accent-soft); color: var(--accent); }
.chip-term::before { content: "?"; font: 700 .65rem var(--sans); width: 14px; height: 14px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid currentColor; }
.chip-cat { background: transparent; border-color: var(--line); }

/* ---------- Tools grid ---------- */
.tools { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.tool-card { display: flex; gap: 16px; align-items: flex-start; padding: 20px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.tool-card:hover { border-color: var(--line-2); transform: translateY(-2px); box-shadow: var(--shadow); color: var(--ink); }
.tool-card .ti { width: 42px; height: 42px; flex-shrink: 0; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.tool-card .ti svg { width: 22px; height: 22px; }
.tool-card h3 { font-size: 1.08rem; margin: 2px 0 5px; }
.tool-card p { font-size: .9rem; color: var(--muted); margin: 0; }

.principles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
@media (max-width: 800px) { .principles { grid-template-columns: 1fr; } }
.principle h3 { font-size: 1.25rem; margin: 14px 0 8px; }
.principle p { color: var(--muted); margin: 0; }
.principle .pi { width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--line-2); display: grid; place-items: center; color: var(--accent); }
.principle .pi svg { width: 22px; height: 22px; }

/* ---------- Page header (inner pages) ---------- */
.page-head { padding: clamp(36px, 5vw, 64px) 0 clamp(24px, 3vw, 36px); border-bottom: 1px solid var(--line); background: linear-gradient(to bottom, var(--paper-2), var(--paper)); }
.page-head h1 { margin: 12px 0 14px; max-width: 18em; }
.page-head .lead { max-width: 40em; margin: 0; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .85rem; color: var(--muted); list-style: none; margin: 0; padding: 0; }
.crumbs a { text-decoration: none; color: var(--muted); }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.crumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-2); }

/* ---------- Course overview ---------- */
.course { display: grid; gap: 26px; margin: 40px 0 80px; }
.course-module { --mc: var(--m1); --mcs: var(--m1-soft); display: grid; grid-template-columns: 300px 1fr; gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; }
.course-module .cm-side { padding: 28px; background: var(--mcs); border-right: 1px solid var(--line); position: relative; }
.course-module .cm-side .mc-num { font: 600 .78rem var(--mono); color: var(--mc); }
.course-module .cm-side h2 { font-size: 1.6rem; margin: 10px 0 10px; }
.course-module .cm-side h2 a { text-decoration: none; }
.course-module .cm-side p { color: var(--ink-2); font-size: .94rem; }
.course-module .cm-side .mc-icon { width: 48px; height: 48px; border-radius: 13px; background: var(--card); color: var(--mc); display: grid; place-items: center; margin-bottom: 18px; box-shadow: var(--shadow-sm); }
.course-module .cm-side .mc-icon svg { width: 26px; height: 26px; }
.lesson-list { list-style: none; margin: 0; padding: 10px 0; counter-reset: l; }
.lesson-list li a { display: grid; grid-template-columns: 34px 1fr auto; gap: 14px; align-items: center; padding: 13px 26px; text-decoration: none; transition: background .12s; }
.lesson-list li a:hover { background: var(--paper-2); color: var(--ink); }
.lesson-list .ln { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 .78rem var(--mono); color: var(--muted); }
.lesson-list li.done .ln { background: var(--mc); border-color: var(--mc); color: #fff; font-size: 0; }
.lesson-list li.done .ln::before { content: ""; width: 10px; height: 6px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); color: #fff; }
.lesson-list .lt { font-weight: 600; line-height: 1.35; }
.lesson-list .ld { display: block; font-weight: 400; color: var(--muted); font-size: .88rem; margin-top: 2px; }
.lesson-list .lm { font-size: .8rem; color: var(--faint); white-space: nowrap; font-family: var(--mono); }
@media (max-width: 820px) {
  .course-module { grid-template-columns: 1fr; }
  .course-module .cm-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .lesson-list li a { padding: 12px 18px; grid-template-columns: 30px 1fr; }
  .lesson-list .lm { display: none; }
}

/* ---------- Lesson layout ---------- */
.lesson-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr) 210px; gap: clamp(24px, 3.5vw, 56px); padding-top: 40px; padding-bottom: 80px; max-width: 1380px; }
@media (max-width: 1180px) { .lesson-wrap { grid-template-columns: 230px minmax(0, 1fr); } .toc-col { display: none; } }
@media (max-width: 900px) { .lesson-wrap { grid-template-columns: minmax(0, 1fr); padding-top: 24px; } .side-col { display: none; } }
.side-col, .toc-col { position: relative; }
.sticky { position: sticky; top: calc(var(--header-h) + 24px); max-height: calc(100vh - var(--header-h) - 48px); overflow-y: auto; scrollbar-width: thin; }
.side-title { font: 650 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.side-module { --mc: var(--m1); }
.side-module .sm-name { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; text-decoration: none; margin-bottom: 12px; line-height: 1.25; }
.side-lessons { list-style: none; margin: 0 0 22px; padding: 0; border-left: 2px solid var(--line); }
.side-lessons a { display: block; padding: 7px 0 7px 14px; margin-left: -2px; border-left: 2px solid transparent; text-decoration: none; font-size: .9rem; color: var(--muted); line-height: 1.35; }
.side-lessons a:hover { color: var(--ink); }
.side-lessons a[aria-current="page"] { color: var(--ink); font-weight: 600; border-left-color: var(--mc); }
.side-lessons li.done a::after { content: " ✓"; color: var(--up); font-weight: 700; }
.side-other { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.side-other a { display: flex; gap: 8px; align-items: center; padding: 5px 0; text-decoration: none; color: var(--muted); }
.side-other a:hover { color: var(--ink); }
.side-other i { width: 8px; height: 8px; border-radius: 3px; background: var(--mc); flex-shrink: 0; }

.toc { list-style: none; margin: 0; padding: 0; font-size: .86rem; }
.toc a { display: block; padding: 5px 0 5px 12px; border-left: 2px solid var(--line); text-decoration: none; color: var(--muted); line-height: 1.35; }
.toc a:hover { color: var(--ink); }
.toc a.active { color: var(--ink); border-left-color: var(--accent); }
.toc .lvl3 a { padding-left: 24px; font-size: .82rem; }

.lesson-head { margin-bottom: 30px; }
.lesson-head .crumbs { margin-bottom: 22px; }
.lesson-head h1 { font-size: clamp(2rem, 1.5rem + 2.4vw, 3.1rem); margin: 10px 0 18px; }
.lesson-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: .86rem; color: var(--muted); margin-top: 18px; align-items: center; }
.lesson-meta span { display: inline-flex; align-items: center; gap: 7px; }
.lesson-meta svg { width: 16px; height: 16px; }
.module-pill { --mc: var(--m1); --mcs: var(--m1-soft); display: inline-flex; gap: 8px; align-items: center; font: 650 .74rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--mc); background: var(--mcs); padding: 5px 11px; border-radius: 999px; text-decoration: none; }
.module-pill:hover { color: var(--mc); filter: brightness(.97); }

/* key takeaways */
.takeaways { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 24px 18px; margin: 0 0 36px; box-shadow: var(--shadow-sm); }
.takeaways h2 { font: 650 .74rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin: 0 0 12px; }
.takeaways ul { margin: 0; padding: 0; list-style: none; }
.takeaways li { position: relative; padding-left: 28px; margin: 0 0 9px; line-height: 1.5; }
.takeaways li::before { content: ""; position: absolute; left: 2px; top: .42em; width: 14px; height: 8px; border-left: 2px solid var(--up); border-bottom: 2px solid var(--up); transform: rotate(-45deg); }

/* ---------- Prose ---------- */
.prose { max-width: var(--measure); font-size: 1.07rem; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 0; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 1.95rem); margin: 2.2em 0 .7em; padding-top: .2em; }
.prose h3 { font-size: 1.28rem; margin: 1.9em 0 .6em; }
.prose h4 { margin: 1.6em 0 .5em; }
.prose h2 .anchor, .prose h3 .anchor { opacity: 0; margin-left: .35em; color: var(--faint); text-decoration: none; font-family: var(--sans); font-weight: 400; transition: opacity .15s; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose a { color: var(--ink); text-decoration-color: var(--accent-bright); text-decoration-thickness: 1.5px; }
.prose a:hover { color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.35em; margin: 0 0 1.3em; }
.prose li { margin: .35em 0; padding-left: .2em; }
.prose li::marker { color: var(--accent); }
.prose ol li::marker { font-family: var(--mono); font-size: .9em; }
.prose strong { font-weight: 650; }
.prose blockquote { margin: 1.8em 0; padding: .2em 0 .2em 1.3em; border-left: 3px solid var(--accent-bright); font-family: var(--serif); font-size: 1.22rem; line-height: 1.5; color: var(--ink-2); font-style: italic; }
.prose blockquote p:last-child { margin: 0; }
.prose blockquote cite { display: block; margin-top: .6em; font: normal 500 .86rem var(--sans); color: var(--muted); }
.prose code { font-family: var(--mono); font-size: .88em; background: var(--paper-3); padding: .12em .4em; border-radius: 5px; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.6em 0; font-size: .95rem; line-height: 1.45; display: block; overflow-x: auto; }
.prose thead th { text-align: left; font: 650 .76rem var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-bottom: 2px solid var(--line-2); padding: 10px 14px 10px 0; white-space: nowrap; }
.prose tbody td { border-bottom: 1px solid var(--line); padding: 11px 14px 11px 0; vertical-align: top; }
.prose td.r, .prose th.r { text-align: right; font-variant-numeric: tabular-nums; }
.prose .formula { font-family: var(--serif); font-size: 1.18rem; text-align: center; margin: 1.6em 0; padding: 18px 20px; background: var(--paper-2); border-radius: var(--radius); border: 1px solid var(--line); overflow-x: auto; }
.prose .formula .frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; margin: 0 .2em; }
.prose .formula .frac > span:first-child { border-bottom: 1.5px solid currentColor; padding: 0 .3em .1em; }
.prose .formula .frac > span:last-child { padding: .1em .3em 0; }
.prose .formula small { display: block; font: 400 .82rem var(--sans); color: var(--muted); margin-top: 10px; }

/* glossary links in prose */
.gl { text-decoration: underline dotted !important; text-decoration-color: var(--accent) !important; text-decoration-thickness: 1.5px !important; text-underline-offset: .22em; cursor: help; }
.gl:hover { color: var(--accent) !important; }

/* callouts */
.callout { --c: var(--info); --cs: var(--info-soft); margin: 1.8em 0; padding: 18px 20px 4px 20px; border-radius: var(--radius); background: var(--cs); border: 1px solid color-mix(in srgb, var(--c) 22%, transparent); position: relative; font-size: 1rem; line-height: 1.65; }
.callout .callout-title { display: flex; align-items: center; gap: 9px; font: 650 .78rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--c); margin: 0 0 8px; }
.callout .callout-title svg { width: 18px; height: 18px; }
.callout .callout-title span.t2 { text-transform: none; letter-spacing: 0; font: 600 1.02rem var(--serif); color: var(--ink); }
.callout p { margin: 0 0 1em; }
.callout ul { margin: 0 0 1em; }
.callout-merke { --c: var(--accent); --cs: var(--accent-soft); }
.callout-beispiel { --c: var(--m1); --cs: var(--m1-soft); }
.callout-achtung { --c: var(--down); --cs: var(--down-soft); }
.callout-vertiefung { --c: var(--m4); --cs: var(--m4-soft); }
.callout-info { --c: var(--info); --cs: var(--info-soft); }
.callout-geschichte { --c: var(--m3); --cs: var(--m3-soft); }
details.callout > summary { cursor: pointer; list-style: none; }
details.callout > summary::-webkit-details-marker { display: none; }
details.callout > summary .callout-title::after { content: "+"; margin-left: auto; font: 500 1.2rem var(--sans); }
details.callout[open] > summary .callout-title::after { content: "–"; }
details.callout:not([open]) { padding-bottom: 10px; }
details.callout:not([open]) .callout-title { margin: 0; }

/* figures */
.fig { margin: 2em 0; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.fig svg { width: 100%; height: auto; overflow: visible; }
.fig figcaption { margin-top: 14px; font-size: .88rem; color: var(--muted); line-height: 1.5; }
.fig figcaption b { color: var(--ink); font-weight: 600; }
.fig.wide { margin-left: -22px; margin-right: -22px; }
@media (max-width: 700px) { .fig { padding: 14px; } .fig.wide { margin-left: 0; margin-right: 0; } }

/* SVG diagram palette (works in both themes) */
.d-ink { fill: var(--ink); } .d-ink-s { stroke: var(--ink); fill: none; }
.d-muted { fill: var(--muted); } .d-muted-s { stroke: var(--muted); fill: none; }
.d-faint-s { stroke: var(--line-2); fill: none; }
.d-line { stroke: var(--line); fill: none; }
.d-paper { fill: var(--paper-2); } .d-card { fill: var(--card); }
.d-accent { fill: var(--accent-bright); } .d-accent-s { stroke: var(--accent-strong); fill: none; }
.d-accent-soft { fill: var(--accent-soft); }
.d-up { fill: var(--up); } .d-up-s { stroke: var(--up); fill: none; } .d-up-soft { fill: var(--up-soft); }
.d-down { fill: var(--down); } .d-down-s { stroke: var(--down); fill: none; } .d-down-soft { fill: var(--down-soft); }
.d-info { fill: var(--info); } .d-info-s { stroke: var(--info); fill: none; } .d-info-soft { fill: var(--info-soft); }
.d-m4 { fill: var(--m4); } .d-m4-s { stroke: var(--m4); fill: none; } .d-m4-soft { fill: var(--m4-soft); }
.fig text, .widget svg text { font-family: var(--sans); font-size: 13px; fill: var(--ink-2); }
.fig text.t-s, .widget svg text.t-s { font-size: 11.5px; fill: var(--muted); }
.fig text.t-b { font-weight: 650; fill: var(--ink); }
.fig text.t-serif { font-family: var(--serif); font-size: 16px; fill: var(--ink); font-weight: 600; }
.fig text.t-mono, .widget svg text.t-mono { font-family: var(--mono); font-size: 12px; }
.fig text.t-up { fill: var(--up); } .fig text.t-down { fill: var(--down); } .fig text.t-acc { fill: var(--accent); }

/* ---------- Widgets ---------- */
.widget { container-type: inline-size; margin: 2.2em 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); overflow: hidden; font-size: .95rem; line-height: 1.5; }
.widget-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.widget-head .wi { width: 32px; height: 32px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex-shrink: 0; }
.widget-head .wi svg { width: 18px; height: 18px; }
.widget-head h3 { font-size: 1.05rem; margin: 0; }
.widget-head .wtag { margin-left: auto; font: 650 .68rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.widget-body { padding: 20px 22px 22px; }
.widget-grid { display: grid; grid-template-columns: minmax(220px, 300px) 1fr; gap: 26px; align-items: start; }
@container (max-width: 680px) { .widget-grid { grid-template-columns: 1fr; gap: 8px; } }
.ctrl { margin-bottom: 16px; }
.ctrl label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-weight: 600; font-size: .86rem; color: var(--ink-2); margin-bottom: 6px; }
.ctrl label output { font: 600 .86rem var(--mono); color: var(--ink); }
.ctrl .hint { font-size: .78rem; color: var(--muted); margin-top: 4px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 26px; background: transparent; cursor: pointer; margin: 0; }
input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 99px; background: linear-gradient(to right, var(--accent-bright) 0 var(--p, 50%), var(--paper-3) var(--p, 50%) 100%); }
input[type="range"]::-moz-range-track { height: 5px; border-radius: 99px; background: var(--paper-3); }
input[type="range"]::-moz-range-progress { height: 5px; border-radius: 99px; background: var(--accent-bright); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent-strong); margin-top: -7.5px; box-shadow: var(--shadow-sm); transition: transform .12s; }
input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 2px solid var(--accent-strong); box-shadow: var(--shadow-sm); }
input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
.num-input { width: 100%; font: 600 .95rem var(--mono); color: var(--ink); background: var(--paper); border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px; }
.num-input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 16%, transparent); }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--paper-2); border: 1px solid var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg button { appearance: none; border: 0; background: transparent; font: 600 .82rem var(--sans); color: var(--muted); padding: 7px 11px; border-radius: 8px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--paper-2); border-radius: 11px; padding: 12px 14px; border: 1px solid var(--line); }
.stat .sl { font-size: .74rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.stat .sv { font: 650 1.22rem var(--mono); letter-spacing: -.02em; margin-top: 3px; color: var(--ink); }
.stat .sv.up { color: var(--up); } .stat .sv.down { color: var(--down); }
.stat.hl { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.chart { width: 100%; height: auto; display: block; }
.chart .grid line { stroke: var(--line); }
.chart .axis text { font: 11px var(--mono); fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--muted); margin-top: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 4px; border-radius: 2px; display: inline-block; }
.widget-note { font-size: .82rem; color: var(--muted); margin: 12px 0 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.wbtn { appearance: none; font: 600 .86rem var(--sans); padding: 9px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink); cursor: pointer; transition: background .12s, border-color .12s; }
.wbtn:hover { background: var(--paper-2); border-color: var(--ink-2); }
.wbtn.buy { background: var(--up); border-color: var(--up); color: #fff; }
.wbtn.sell { background: var(--down); border-color: var(--down); color: #fff; }
.wbtn.buy:hover, .wbtn.sell:hover { filter: brightness(1.08); }
:root[data-theme="dark"] .wbtn.buy, :root[data-theme="dark"] .wbtn.sell { color: #08111f; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wbtn.buy, :root:not([data-theme="light"]) .wbtn.sell { color: #08111f; } }

/* order book */
.book { width: 100%; border-collapse: collapse; font: 500 .86rem var(--mono); }
.book th { font: 650 .7rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); text-align: right; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.book th:first-child, .book td:first-child { text-align: left; }
.book td { padding: 5px 10px; text-align: right; position: relative; }
.book td .bar { position: absolute; top: 2px; bottom: 2px; right: 0; border-radius: 4px; opacity: .55; z-index: 0; }
.book td span { position: relative; z-index: 1; }
.book tr.ask td { color: var(--down); } .book tr.ask .bar { background: var(--down-soft); }
.book tr.bid td { color: var(--up); } .book tr.bid .bar { background: var(--up-soft); }
.book tr.spread td { text-align: center; color: var(--muted); font: 600 .78rem var(--sans); padding: 8px; background: var(--paper-2); }
.book tr.flash td { animation: flash .8s ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }
.trade-log { font: .82rem var(--mono); color: var(--ink-2); background: var(--paper-2); border-radius: 10px; padding: 10px 12px; min-height: 64px; max-height: 140px; overflow-y: auto; margin-top: 12px; border: 1px solid var(--line); }
.trade-log div { padding: 2px 0; }

/* candle widget */
.candle-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 600px) { .candle-wrap { grid-template-columns: 1fr; } }

/* ---------- Quiz ---------- */
.quiz { margin: 3em 0 2em; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--card); overflow: hidden; box-shadow: var(--shadow-sm); }
.quiz-head { padding: 20px 24px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 14px; background: var(--paper-2); }
.quiz-head h2 { font-size: 1.3rem; margin: 0 !important; padding: 0 !important; }
.quiz-head .qs { margin-left: auto; font: 600 .82rem var(--mono); color: var(--muted); }
.quiz-q { padding: 22px 24px; border-bottom: 1px solid var(--line); }
.quiz-q:last-of-type { border-bottom: 0; }
.quiz-q .qq { font-weight: 650; font-size: 1.04rem; margin: 0 0 14px; line-height: 1.45; }
.quiz-q .qq .qn { font: 600 .8rem var(--mono); color: var(--accent); margin-right: 8px; }
.quiz-opts { display: grid; gap: 8px; }
.quiz-opt { appearance: none; text-align: left; font: 500 .97rem var(--sans); color: var(--ink); background: var(--paper); border: 1.5px solid var(--line); border-radius: 11px; padding: 12px 14px 12px 44px; cursor: pointer; position: relative; line-height: 1.4; transition: border-color .12s, background .12s; }
.quiz-opt::before { content: attr(data-l); position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--line-2); display: grid; place-items: center; font: 600 .72rem var(--mono); color: var(--muted); }
.quiz-opt:hover:not([disabled]) { border-color: var(--ink-2); }
.quiz-opt.correct { border-color: var(--up); background: var(--up-soft); }
.quiz-opt.correct::before { background: var(--up); border-color: var(--up); color: #fff; content: "✓"; }
.quiz-opt.wrong { border-color: var(--down); background: var(--down-soft); }
.quiz-opt.wrong::before { background: var(--down); border-color: var(--down); color: #fff; content: "✕"; }
.quiz-opt[disabled] { cursor: default; }
.quiz-explain { display: none; margin-top: 12px; font-size: .94rem; color: var(--ink-2); padding: 12px 14px; border-radius: 10px; background: var(--paper-2); border-left: 3px solid var(--accent-bright); }
.quiz-q.answered .quiz-explain { display: block; }
.quiz-result { padding: 20px 24px; display: none; align-items: center; gap: 16px; background: var(--accent-soft); flex-wrap: wrap; }
.quiz-result.show { display: flex; }
.quiz-result .score { font: 650 1.6rem var(--mono); }

/* lesson footer */
.complete-box { margin: 2.5em 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; border-radius: var(--radius); border: 1px dashed var(--line-2); flex-wrap: wrap; }
.complete-box p { margin: 0; color: var(--muted); }
.complete-box.is-done { border-style: solid; border-color: color-mix(in srgb, var(--up) 40%, transparent); background: var(--up-soft); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 2em 0 0; }
.pager a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; background: var(--card); transition: border-color .15s, transform .15s; }
.pager a:hover { border-color: var(--line-2); transform: translateY(-2px); color: var(--ink); }
.pager .pl { font: 650 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pager .pt { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; margin-top: 5px; line-height: 1.3; }
.pager .next { text-align: right; grid-column: 2; }
@media (max-width: 600px) { .pager { grid-template-columns: 1fr; } .pager .next { grid-column: 1; } }
.related-terms { margin: 2.5em 0 0; }
.related-terms h2 { font: 650 .74rem var(--sans) !important; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px !important; }
.related-terms .chips { display: flex; flex-wrap: wrap; gap: 8px; }
.related-terms .chip { font-size: .85rem; padding: 6px 12px; }

/* ---------- Glossary ---------- */
.az { position: sticky; top: var(--header-h); z-index: 20; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.az .wrap { display: flex; gap: 4px; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; align-items: center; }
.az a { font: 600 .9rem var(--mono); text-decoration: none; min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--ink-2); }
.az a:hover { background: var(--paper-3); color: var(--ink); }
.az span.dis { font: 600 .9rem var(--mono); min-width: 32px; text-align: center; color: var(--line-2); }
.az .gfilter { margin-left: auto; position: relative; min-width: 220px; }
.az .gfilter .input { padding-top: 8px; padding-bottom: 8px; font-size: .92rem; }
@media (max-width: 700px) { .az .gfilter { display: none; } }
.gl-letter { display: grid; grid-template-columns: 90px 1fr; gap: 24px; padding: 34px 0; border-bottom: 1px solid var(--line); }
.gl-letter > h2 { font-size: 3rem; color: var(--accent); font-weight: 500; line-height: 1; position: sticky; top: calc(var(--header-h) + 70px); align-self: start; }
.gl-terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 6px 28px; }
.gl-terms a { display: block; padding: 10px 0; text-decoration: none; border-bottom: 1px solid transparent; }
.gl-terms a:hover { color: var(--ink); }
.gl-terms a:hover b { color: var(--accent); }
.gl-terms b { font-family: var(--serif); font-weight: 600; font-size: 1.08rem; display: block; }
.gl-terms small { display: block; color: var(--muted); font-size: .88rem; line-height: 1.45; margin-top: 2px; }
@media (max-width: 640px) { .gl-letter { grid-template-columns: 1fr; gap: 10px; } .gl-letter > h2 { position: static; font-size: 2.2rem; } }
.term-page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: clamp(28px, 5vw, 72px); padding: 40px 0 90px; }
@media (max-width: 900px) { .term-page { grid-template-columns: 1fr; } }
.term-def { font-family: var(--serif); font-size: clamp(1.25rem, 1.1rem + .6vw, 1.55rem); line-height: 1.45; color: var(--ink); margin: 0 0 1.4em; padding-bottom: 1.2em; border-bottom: 1px solid var(--line); font-weight: 450; }
.term-aside .box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; }
.term-aside h3 { font: 650 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.term-aside ul { list-style: none; margin: 0; padding: 0; }
.term-aside li a { display: block; padding: 6px 0; text-decoration: none; font-weight: 550; }
.term-aside li a:hover { color: var(--accent); }
.term-aside .lesson-link { display: block; text-decoration: none; }
.term-aside .lesson-link b { display: block; font-family: var(--serif); font-size: 1.08rem; line-height: 1.3; margin: 6px 0 4px; }
.term-aside .lesson-link:hover b { color: var(--accent); }
.term-aside .alias { font-size: .88rem; color: var(--muted); }
.term-en { font-size: .95rem; color: var(--muted); margin-top: -6px; }

/* glossary popover */
.gpop { position: absolute; z-index: 60; width: min(340px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line-2); border-radius: 14px; box-shadow: var(--shadow-lg); padding: 16px 18px 14px; font-size: .92rem; line-height: 1.5; opacity: 0; transform: translateY(4px); transition: opacity .14s, transform .14s; pointer-events: none; }
.gpop.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.gpop b { display: block; font-family: var(--serif); font-size: 1.1rem; margin-bottom: 4px; }
.gpop p { margin: 0 0 10px; color: var(--ink-2); }
.gpop a { font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--accent); }

/* ---------- News page ---------- */
.news-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: clamp(28px, 5vw, 64px); padding: 36px 0 90px; }
@media (max-width: 960px) { .news-layout { grid-template-columns: 1fr; } }
.news-day { font: 650 .74rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 34px 0 6px; padding-bottom: 10px; border-bottom: 2px solid var(--ink); }
.news-day:first-child { margin-top: 0; }
.news-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 26px; }
.news-filters button { appearance: none; font: 600 .84rem var(--sans); padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--card); color: var(--ink-2); cursor: pointer; }
.news-filters button[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.market-box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.market-box h3 { font: 650 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 12px; }
.market-row { display: flex; justify-content: space-between; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; }
.market-row:last-child { border-bottom: 0; }
.market-row .mv { font: 500 .88rem var(--mono); }
.market-row .mc { font: 600 .8rem var(--mono); min-width: 64px; text-align: right; }
.fg-meter { margin: 6px 0 4px; }
.fg-meter .fg-bar { height: 10px; border-radius: 99px; background: linear-gradient(90deg, #b83a30, #d9822b 30%, #d9b341 50%, #8bb84a 70%, #17794f); position: relative; }
.fg-meter .fg-dot { position: absolute; top: 50%; width: 18px; height: 18px; border-radius: 50%; background: var(--card); border: 3px solid var(--ink); transform: translate(-50%, -50%); }
.fg-meter .fg-lbl { display: flex; justify-content: space-between; font-size: .72rem; color: var(--muted); margin-top: 6px; }
.fg-val { font: 650 2rem var(--mono); letter-spacing: -.03em; }

/* ---------- Search dialog ---------- */
.search-dlg { position: fixed; inset: 0; z-index: 80; display: none; align-items: flex-start; justify-content: center; padding: 10vh 16px 16px; background: rgba(8, 14, 26, .45); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); }
.search-dlg.open { display: flex; }
.search-panel { width: min(640px, 100%); background: var(--card); border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--line-2); overflow: hidden; }
.search-panel .sp-in { position: relative; border-bottom: 1px solid var(--line); }
.search-panel input { width: 100%; border: 0; background: transparent; font: 500 1.1rem var(--sans); color: var(--ink); padding: 20px 20px 20px 52px; }
.search-panel input:focus { outline: none; }
.search-panel .sp-in svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--faint); }
.search-results { max-height: 56vh; overflow-y: auto; padding: 8px; }
.search-results a { display: block; padding: 11px 14px; border-radius: 10px; text-decoration: none; }
.search-results a:hover, .search-results a.sel { background: var(--paper-2); color: var(--ink); }
.search-results .rt { font-weight: 600; display: flex; gap: 10px; align-items: center; }
.search-results .rk { font: 650 .64rem var(--sans); letter-spacing: .1em; text-transform: uppercase; padding: 2px 7px; border-radius: 99px; background: var(--paper-3); color: var(--muted); }
.search-results .rd { font-size: .86rem; color: var(--muted); margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results .empty { padding: 26px; text-align: center; color: var(--muted); }
.search-foot { border-top: 1px solid var(--line); padding: 10px 16px; font-size: .76rem; color: var(--faint); display: flex; gap: 16px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #b9c0cc; padding: 64px 0 34px; margin-top: 0; font-size: .92rem; }
.site-footer a { color: #d9dde4; text-decoration: none; }
.site-footer a:hover { color: var(--accent-bright); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 36px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-brand { grid-column: 1 / -1; } }
.footer-brand .brand { color: #fff; }
.footer-brand .brand-name b { color: #8f99ab; }
.footer-brand p { margin: 16px 0 0; max-width: 30em; line-height: 1.6; }
.site-footer h4 { color: #fff; font: 650 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; margin: 0 0 14px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 0 0 9px; }
.footer-bottom { margin-top: 44px; padding-top: 22px; border-top: 1px solid rgba(255,255,255,.1); display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; color: #8f99ab; }
.disclaimer { max-width: 60em; }

/* ---------- Simple pages ---------- */
.page-body { padding: 44px 0 90px; }
.page-body .prose h2 { margin-top: 1.6em; }

/* ---------- 404/410 ---------- */
.gone { min-height: 60vh; display: grid; place-items: center; text-align: center; padding: 60px 0; }
.gone .code { font: 600 .9rem var(--mono); color: var(--accent); letter-spacing: .1em; }
.gone h1 { margin: 14px 0; }
.gone p { color: var(--muted); max-width: 32em; margin: 0 auto 26px; }
.gone-suggest { max-width: 34em; margin: 0 auto 28px; text-align: left; }
.gone-suggest h2 { text-align: center; margin: 0 0 12px; }
.gone-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.gone-list li { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--card); }
.gone-list a { font-weight: 600; display: block; margin-bottom: 3px; }
.gone-list span { color: var(--muted); font-size: .9rem; display: block; }

/* reveal on scroll */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
}
@media print {
  .site-header, .site-footer, .side-col, .toc-col, .quiz, .pager, .ticker, .complete-box { display: none !important; }
  body { background: #fff; color: #000; }
  .lesson-wrap { display: block; }
}

/* widgets inside prose: undo prose table styling */
.prose .widget table, .widget table.book { display: table; width: 100%; margin: 0; overflow: visible; }
.widget .book th { padding: 6px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.widget .book td { padding: 4px 10px; border-bottom: 0; vertical-align: middle; }
.widget .book td:first-child, .widget .book th:first-child { padding-left: 4px; }
.prose .widget p { margin: 0; }
.prose .widget .widget-note { margin-top: 12px; }
.prose .widget h3 { margin: 0; font-size: 1.05rem; }

@media (max-width: 520px) {
  .site-header .wrap { gap: 8px; }
  .header-tools { gap: 2px; }
  .icon-btn { width: 36px; height: 36px; }
  .brand-mark { width: 30px; height: 30px; }
  .brand-name { font-size: 1.02rem; }
  .brand-sub { font-size: .6rem; letter-spacing: .12em; }
  .lang-switch { padding: 5px 8px; font-size: .72rem; }
  .prose { font-size: 1.02rem; }
  .takeaways { padding: 18px 18px 12px; }
  .takeaways li { font-size: .98rem; }
}

/* ==========================================================================
   Learning engine (learn.js): path, practice sessions, progress
   ========================================================================== */

/* tactile buttons */
.btn-3d { box-shadow: 0 4px 0 color-mix(in srgb, currentColor 0%, var(--navy) 100%); }
.btn-primary.btn-3d { box-shadow: 0 4px 0 #050b16; }
.btn-gold.btn-3d { box-shadow: 0 4px 0 #a87623; }
.btn-3d:hover { transform: translateY(-1px); }
.btn-3d:active { transform: translateY(3px); box-shadow: 0 1px 0 #050b16; }
:root[data-theme="dark"] .btn-primary.btn-3d { box-shadow: 0 4px 0 #8f8a80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary.btn-3d { box-shadow: 0 4px 0 #8f8a80; } }
button.btn { font-family: var(--sans); }
.btn[disabled] { opacity: .5; cursor: default; transform: none; }

/* switch */
.switch { appearance: none; display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; padding: 6px 0; font: 550 .9rem var(--sans); color: var(--ink-2); cursor: pointer; }
.switch i { width: 38px; height: 22px; border-radius: 99px; background: var(--line-2); position: relative; flex: none; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .18s; }
.switch[aria-checked="true"] i { background: var(--ok); }
.switch[aria-checked="true"] i::after { transform: translateX(16px); }
.pp-card .switch { display: flex; width: 100%; padding: 10px 0; border-bottom: 1px solid var(--line); }
.pp-card .switch:last-of-type { border-bottom: 0; }

/* header HUD */
.hud { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 10px 4px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); margin-right: 4px; }
.hud:hover { border-color: var(--line-2); color: var(--ink); }
.hud-streak { display: inline-flex; align-items: center; gap: 3px; font: 700 .9rem var(--sans); color: var(--faint); }
.hud-streak svg { width: 18px; height: 18px; }
.hud-streak.lit { color: var(--flame); }
.hud-streak.lit svg { fill: color-mix(in srgb, var(--flame) 25%, transparent); }
.hud-streak b { color: var(--ink); }
.hud-goal { position: relative; width: 28px; height: 28px; display: inline-grid; place-items: center; }
.hud-goal .ring { position: absolute; inset: 0; }
.hud-xp svg { width: 13px; height: 13px; color: var(--accent); }
.ring-bg { stroke: var(--paper-3); }
.ring-fg { stroke: var(--accent-bright); transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.2,1); }
@media (max-width: 420px) { .hud { padding: 3px 7px; gap: 5px; } }

/* mobile tab bar */
.tabbar { display: none; }
@media (max-width: 940px) {
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font: 600 .68rem var(--sans); color: var(--muted); padding: 5px 0; border-radius: 10px; }
  .tabbar a svg { width: 22px; height: 22px; }
  .tabbar a[aria-current="page"] { color: var(--ink); }
  .tabbar a[aria-current="page"] svg { color: var(--accent-strong); }
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- learning path ---------- */
.path-head { padding-bottom: 28px; }
.path-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.lpath { max-width: 780px; padding-top: 30px; padding-bottom: 90px; --amp: 46px; }
@media (max-width: 600px) { .lpath { --amp: 18px; } .lpath .node { width: calc(100% - var(--amp) * 1.5); } }  /* 14.10.: Zickzack schob Knoten über den rechten Rand (375 px) */
.unit { margin: 0 0 34px; }
.unit-head { position: relative; display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 22px 24px 20px; border-radius: var(--radius-lg); background: var(--mc); color: #fff; box-shadow: 0 5px 0 color-mix(in srgb, var(--mc) 70%, #000); overflow: hidden; }
.unit-head::after { content: ""; position: absolute; right: -40px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); pointer-events: none; }
.unit-k { font: 700 .72rem var(--sans); letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.unit-head h2 { color: #fff; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); margin: 6px 0 6px; }
.unit-head h2 a { color: inherit; text-decoration: none; }
.unit-head h2 a:hover { text-decoration: underline; }
.unit-head p { margin: 0; font-size: .93rem; opacity: .92; max-width: 46em; line-height: 1.5; }
.unit-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.unit-icon { width: 46px; height: 46px; border-radius: 14px; background: rgba(255,255,255,.16); display: grid; place-items: center; }
.unit-icon svg { width: 24px; height: 24px; }
.unit-count { font: 700 .82rem var(--mono); background: rgba(0,0,0,.18); padding: 3px 9px; border-radius: 99px; }
.unit-head .progress { grid-column: 1 / -1; background: rgba(255,255,255,.22); margin-top: 4px; height: 6px; }
.unit-head .progress span { background: #fff; }
:root[data-theme="dark"] .unit-head { color: #0b1322; }
:root[data-theme="dark"] .unit-head h2 { color: #0b1322; }
:root[data-theme="dark"] .unit-head .progress span { background: #0b1322; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .unit-head, :root:not([data-theme="light"]) .unit-head h2 { color: #0b1322; } :root:not([data-theme="light"]) .unit-head .progress span { background: #0b1322; } }

.nodes { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.node { display: flex; align-items: center; gap: 16px; width: min(100%, 470px); transform: translateX(calc(var(--x) * var(--amp))); }
.node-btn { position: relative; flex: none; width: 70px; height: 64px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; border: 0; cursor: pointer;
  background: var(--paper-3); color: var(--faint); box-shadow: 0 6px 0 var(--line-2); transition: transform .12s, box-shadow .12s; font: 750 1.25rem var(--sans); }
.node-btn:hover { transform: translateY(-2px); color: var(--ink); }
.node-btn:active { transform: translateY(4px); box-shadow: 0 2px 0 var(--line-2); }
.node-btn svg { width: 28px; height: 28px; }
.node .i-check, .node .i-play, .node .i-star { display: none; }
.node.done .node-btn { background: var(--mc); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--mc) 65%, #000); }
.node.done .i-num { display: none; } .node.done .i-check { display: block; stroke-width: 3; }
.node.done.perfect .i-check { display: none; } .node.done.perfect .i-star { display: block; fill: #fff; }
.node.current .node-btn { background: var(--mc); color: #fff; box-shadow: 0 6px 0 color-mix(in srgb, var(--mc) 65%, #000), 0 0 0 7px var(--paper), 0 0 0 11px color-mix(in srgb, var(--mc) 35%, transparent); }
.node.current .i-num { display: none; } .node.current .i-play { display: block; fill: #fff; }
@media (prefers-reduced-motion: no-preference) { .node.current .node-btn { animation: nodePulse 2.2s ease-in-out infinite; } }
@keyframes nodePulse { 50% { box-shadow: 0 6px 0 color-mix(in srgb, var(--mc) 65%, #000), 0 0 0 7px var(--paper), 0 0 0 15px color-mix(in srgb, var(--mc) 15%, transparent); } }
.node-bubble { display: none; position: absolute; bottom: calc(100% + 14px); left: 50%; transform: translateX(-50%); background: var(--card); color: var(--mc); border: 2px solid var(--line); font: 800 .78rem var(--sans); letter-spacing: .08em; text-transform: uppercase; padding: 6px 12px; border-radius: 10px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.node-bubble::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -7px; border: 7px solid transparent; border-top-color: var(--line); }
.node.current .node-bubble { display: block; }
@media (prefers-reduced-motion: no-preference) { .node.current .node-bubble { animation: bob 1.6s ease-in-out infinite; } }
@keyframes bob { 50% { transform: translate(-50%, -4px); } }
.node.current { margin-top: 30px; }
.node-label { display: block; text-decoration: none; min-width: 0; line-height: 1.3; }
.node-label b { display: block; font-family: var(--serif); font-weight: 600; font-size: 1.03rem; color: var(--ink); }
.node-label span { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
a.node-label:hover b { color: var(--mc); }
.node.upcoming .node-label b { color: var(--ink-2); }
.node-test .node-btn { background: var(--accent-soft); color: var(--accent); box-shadow: 0 6px 0 color-mix(in srgb, var(--accent-bright) 55%, var(--line-2)); border-radius: 18px; }
.node-test.passed .node-btn { background: var(--accent-bright); color: var(--accent-ink); box-shadow: 0 6px 0 #a87623; }
.node-test.passed .node-btn svg { fill: color-mix(in srgb, #fff 45%, transparent); }
.path-end { text-align: center; padding: 30px 20px 10px; color: var(--muted); }
.path-end > svg { width: 40px; height: 40px; margin: 0 auto 10px; color: var(--accent); }
.path-end p { max-width: 30em; margin: 0 auto 18px; }
.module-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- lesson: bite-sized reading + practice box ---------- */
.readbar { position: fixed; top: var(--header-h); left: 0; right: 0; height: 3px; z-index: 39; pointer-events: none; }
.readbar span { display: block; height: 100%; width: 0; background: var(--accent-bright); }
.lesson-meta .switch { font-size: .85rem; padding: 0; }
.js .prose.stepping .hidden-chunk { display: none; }
.chunk-next { margin: 2.2em 0 .5em; padding: 18px 20px; border-radius: var(--radius); background: var(--paper-2); border: 1px solid var(--line); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.chunk-next .cn-dots { display: flex; gap: 5px; flex: 1 1 100%; }
.chunk-next .cn-dots i { flex: 1; height: 6px; border-radius: 99px; background: var(--line-2); }
.chunk-next .cn-dots i.on { background: var(--accent-bright); }
.chunk-next .cn-t { font: 600 .86rem var(--sans); color: var(--muted); margin-right: auto; }
.prose .chunk-next p { margin: 0; }
.js .quiz-static { display: none; }
.practice-box { margin: 2.6em 0 1em; padding: 24px; border-radius: var(--radius-lg); border: 2px solid var(--mc); background: var(--mcs); display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; }
.practice-box .pb-art { width: 56px; height: 56px; border-radius: 16px; background: var(--mc); color: #fff; display: grid; place-items: center; }
.practice-box .pb-art svg { width: 28px; height: 28px; }
.practice-box h2 { font-size: 1.35rem; margin: 0 0 4px; }
.practice-box p { margin: 0; font-size: .93rem; color: var(--ink-2); }
.practice-box .pb-status { margin-top: 8px; font-weight: 650; color: var(--ok); display: flex; align-items: center; gap: 6px; }
.practice-box .pb-status:empty { display: none; }
.practice-box .pb-status svg { width: 18px; height: 18px; }
.practice-box.is-done { border-color: var(--ok); }
@media (max-width: 640px) { .practice-box { grid-template-columns: 1fr; text-align: left; } .practice-box .btn { justify-content: center; } }
:root:not(.js) .practice-box { display: none; }

/* ---------- practice session overlay ---------- */
body.ps-open { overflow: hidden; }
.ps { position: fixed; inset: 0; z-index: 100; background: var(--paper); display: flex; flex-direction: column; opacity: 0; transform: translateY(12px); transition: opacity .2s, transform .2s; }
.ps.in { opacity: 1; transform: none; }
.ps-top { display: flex; align-items: center; gap: 16px; padding: calc(14px + env(safe-area-inset-top, 0px)) clamp(16px, 4vw, 40px) 14px; max-width: 1000px; width: 100%; margin: 0 auto; }
.ps-x, .ps-snd { appearance: none; background: none; border: 0; color: var(--faint); cursor: pointer; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; flex: none; }
.ps-x:hover, .ps-snd:hover { color: var(--ink); background: var(--paper-2); }
.ps-x svg, .ps-snd svg { width: 24px; height: 24px; }
.ps-bar { flex: 1; height: 16px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.ps-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--ok); transition: width .45s cubic-bezier(.2,.8,.2,1); box-shadow: inset 0 -4px 0 rgba(0,0,0,.08), inset 0 4px 0 rgba(255,255,255,.25); }
.ps-main { flex: 1; overflow-y: auto; padding: 10px clamp(16px, 4vw, 40px) 30px; }
.ps-card { max-width: 640px; margin: 4vh auto 0; }
@media (prefers-reduced-motion: no-preference) { .ps-card.enter { animation: cardIn .28s cubic-bezier(.2,.8,.2,1); } }
@keyframes cardIn { from { opacity: 0; transform: translateX(24px); } }
.ps-again { display: inline-flex; align-items: center; gap: 6px; font: 700 .75rem var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--flame); margin: 0 0 12px; }
.ps-again svg { width: 15px; height: 15px; }
.ps-hint { font: 700 .76rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.ps-q { font-family: var(--serif); font-size: clamp(1.25rem, 1.05rem + .8vw, 1.6rem); font-weight: 560; line-height: 1.35; color: var(--ink); margin: 0 0 26px; }
.ps-q b, .ps-q strong { font-weight: 700; }
.ps-def { display: block; margin-top: 14px; font-family: var(--sans); font-size: 1.05rem; font-weight: 450; line-height: 1.55; color: var(--ink-2); padding: 14px 18px; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent-bright); border-radius: 12px; }
.ps-stmt { padding: 22px 24px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; }
.ps-opts { display: grid; gap: 10px; }
.ps-opt, .ps-tile, .ps-tf { appearance: none; font: 550 1rem var(--sans); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 14px 16px; cursor: pointer; text-align: left; line-height: 1.4; transition: border-color .1s, background .1s, transform .08s; }
.ps-opt { display: flex; align-items: center; gap: 14px; }
.ps-opt .k { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; font: 700 .78rem var(--mono); color: var(--faint); }
.ps-opt:hover:not([disabled]), .ps-tile:hover:not([disabled]), .ps-tf:hover:not([disabled]) { background: var(--paper-2); }
.ps-opt:active:not([disabled]), .ps-tile:active:not([disabled]), .ps-tf:active:not([disabled]) { transform: translateY(2px); border-bottom-width: 2px; }
.ps-opt.sel, .ps-tf.sel, .ps-tile.sel { border-color: var(--info); background: var(--info-soft); }
.ps-opt.sel .k { border-color: var(--info); color: var(--info); }
.ps-opt.right, .ps-tf.right, .ps-tile.right { border-color: var(--ok); background: var(--ok-soft); }
.ps-opt.right .k { border-color: var(--ok); background: var(--ok); color: #fff; }
.ps-opt.wrong, .ps-tf.wrong, .ps-tile.wrong { border-color: var(--bad); background: var(--bad-soft); }
.ps-opt.wrong .k { border-color: var(--bad); background: var(--bad); color: #fff; }
.ps-opt[disabled], .ps-tf[disabled], .ps-tile[disabled] { cursor: default; }
.ps-opts.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.ps-opts.chips .ps-opt { padding: 10px 16px; }
.ps-gapq .gap { display: inline-block; min-width: 5.5em; border-bottom: 3px solid var(--line-2); margin: 0 .15em; padding: 0 .3em; text-align: center; color: var(--info); font-family: var(--sans); font-weight: 650; font-size: .9em; }
.ps-gapq .gap.filled { border-bottom-color: var(--info); }
.is-ok .ps-gapq .gap { color: var(--ok); border-color: var(--ok); }
.is-bad .ps-gapq .gap { color: var(--bad); border-color: var(--bad); }
.ps-tfrow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ps-tf { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 18px; font-weight: 700; text-align: center; }
.ps-tf svg { width: 26px; height: 26px; stroke-width: 2.6; }
.ps-tf.yes svg { color: var(--ok); } .ps-tf.no svg { color: var(--bad); }
.ps-num { display: flex; align-items: center; gap: 10px; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 6px 16px; max-width: 340px; }
.ps-num:focus-within { border-color: var(--info); }
.ps-num input { flex: 1; min-width: 0; border: 0; background: transparent; font: 650 1.4rem var(--mono); color: var(--ink); padding: 8px 0; }
.ps-num input:focus { outline: none; }
.ps-num .u { font: 650 1.1rem var(--sans); color: var(--muted); }
.ps-num.right { border-color: var(--ok); background: var(--ok-soft); }
.ps-num.wrong { border-color: var(--bad); background: var(--bad-soft); }
.ps-line { list-style: none; margin: 0 0 18px; padding: 10px; min-height: 64px; border: 2px dashed var(--line-2); border-radius: 14px; display: flex; flex-direction: column; gap: 8px; counter-reset: ord; }
.ps-line.empty::before { content: ""; }
.ps-line li { counter-increment: ord; display: flex; align-items: center; gap: 10px; }
.ps-line li::before { content: counter(ord); font: 700 .8rem var(--mono); color: var(--muted); width: 20px; text-align: right; flex: none; }
.ps-line .ps-tile { flex: 1; }
.ps-bank { display: flex; flex-direction: column; gap: 8px; }
.ps-tile { display: block; width: 100%; padding: 11px 14px; font-size: .96rem; }
.ps-tile.ghost { opacity: .35; border-style: dashed; }
.ps-match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.ps-match.long { grid-template-columns: minmax(0, .8fr) minmax(0, 1.4fr); }
.ps-match .col { display: flex; flex-direction: column; gap: 10px; }
.ps-match .ps-tile { text-align: center; flex: 1; display: grid; place-items: center; min-height: 52px; }
.ps-match.long .r .ps-tile { text-align: left; font-size: .88rem; place-items: center start; }
.ps-match .ps-tile.ok { border-color: var(--ok); background: var(--ok-soft); opacity: .55; }
.ps-match .ps-tile.bad { border-color: var(--bad); background: var(--bad-soft); }
@media (prefers-reduced-motion: no-preference) { .ps-match .ps-tile.bad { animation: shake .35s; } }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
/* flashcards */
.fc { perspective: 1200px; position: relative; min-height: 240px; }
.fc-front, .fc-back { background: var(--card); border: 2px solid var(--line); border-bottom-width: 5px; border-radius: 20px; padding: 32px 28px; min-height: 240px; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; backface-visibility: hidden; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.fc-front b { font-family: var(--serif); font-size: clamp(1.6rem, 1.2rem + 1.5vw, 2.3rem); font-weight: 600; }
.fc-back { position: absolute; inset: 0; transform: rotateY(180deg); }
.fc-back b { font-family: var(--serif); font-size: 1.25rem; margin-bottom: 10px; }
.fc-back p { margin: 0 0 14px; font-size: 1.04rem; line-height: 1.55; color: var(--ink-2); }
.fc-back a { font: 600 .85rem var(--sans); color: var(--accent); text-decoration: none; display: inline-flex; gap: 5px; align-items: center; }
.fc-back a svg { width: 14px; height: 14px; }
.flipped .fc-front { transform: rotateY(-180deg); }
.flipped .fc-back { transform: rotateY(0); }
@media (prefers-reduced-motion: reduce) { .fc-front, .fc-back { transition: none; } }
/* footer */
.ps-foot { border-top: 2px solid var(--line); background: var(--paper); padding: 18px clamp(16px, 4vw, 40px) calc(18px + env(safe-area-inset-bottom, 0px)); transition: background .15s, border-color .15s; }
.ps-foot-in { max-width: 1000px; margin: 0 auto; display: flex; align-items: center; gap: 16px; }
.ps-fb { flex: 1; min-width: 0; }
.ps-fb-h { display: flex; align-items: center; gap: 10px; font: 750 1.2rem var(--sans); }
.ps-fb-h svg { width: 30px; height: 30px; padding: 5px; border-radius: 50%; background: #fff; stroke-width: 3; flex: none; }
.ps-sol { margin: 6px 0 0; font-weight: 650; }
.ps-sol span { font-weight: 500; opacity: .85; }
.ps-sol ol { margin: 4px 0 0; padding-left: 1.3em; font-weight: 550; }
.ps-ex { margin: 6px 0 0; font-size: .93rem; line-height: 1.5; max-height: 26vh; overflow-y: auto; }
.ps-btn { appearance: none; flex: none; font: 750 1rem var(--sans); letter-spacing: .04em; text-transform: uppercase; padding: 14px 30px; border-radius: 14px; border: 0; cursor: pointer; background: var(--ok); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--ok) 60%, #000); display: inline-flex; align-items: center; gap: 8px; min-width: 150px; justify-content: center; }
.ps-btn svg { width: 18px; height: 18px; stroke-width: 2.6; }
.ps-btn:active:not([disabled]) { transform: translateY(3px); box-shadow: 0 1px 0 color-mix(in srgb, var(--ok) 60%, #000); }
.ps-btn[disabled] { background: var(--paper-3); color: var(--faint); box-shadow: 0 4px 0 var(--line-2); cursor: default; }
.ps-btn-ghost { background: var(--card); color: var(--ink-2); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.ps-btn-ghost:active { box-shadow: 0 1px 0 var(--line) !important; }
.ps-foot.ok { background: var(--ok-soft); border-color: transparent; color: var(--ok-ink); }
.ps-foot.ok .ps-fb-h svg { color: var(--ok); }
.ps-foot.bad { background: var(--bad-soft); border-color: transparent; color: var(--bad-ink); }
.ps-foot.bad .ps-fb-h svg { color: var(--bad); }
.ps-foot.bad .ps-btn:not(.ps-btn-ghost) { background: var(--bad); box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 60%, #000); }
.ps-cardbtns { display: flex; gap: 12px; justify-content: flex-end; flex-wrap: wrap; }
.ps-cardbtns .ps-btn { min-width: 0; flex: 1; max-width: 240px; }
.ps-foot.card .ps-foot-in > .ps-btn { display: none; }
.ps-foot.end .ps-foot-in { justify-content: flex-end; }
@media (max-width: 640px) {
  .ps-foot-in { flex-direction: column; align-items: stretch; gap: 12px; }
  .ps-btn { width: 100%; }
  .ps-foot.end .ps-foot-in { flex-direction: column-reverse; }
  .ps-card { margin-top: 1vh; }
  .ps-q { margin-bottom: 20px; }
}
/* end screen */
.ps-end { text-align: center; padding-top: 2vh; }
.ps-end-art { width: 96px; height: 96px; margin: 0 auto 12px; color: var(--ink); }
.ps-end-art svg { width: 100%; height: 100%; }
@media (prefers-reduced-motion: no-preference) { .ps-end-art:not(.fail) svg { animation: flutter 1.4s ease-in-out infinite; transform-origin: 50% 60%; } }
@keyframes flutter { 50% { transform: scaleX(.86) translateY(-6px); } }
.ps-end h2 { font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem); color: var(--accent); margin-bottom: 6px; }
.ps-end-art.fail + h2 { color: var(--ink); }
.ps-end-t { color: var(--muted); margin: 0 auto 22px; max-width: 30em; }
.ps-stats { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; margin: 18px 0 20px; }
.ps-stats .st { min-width: 120px; border-radius: 16px; border: 2px solid var(--stc); overflow: hidden; background: var(--card); }
.ps-stats .st span { display: block; background: var(--stc); color: #fff; font: 800 .7rem var(--sans); letter-spacing: .12em; text-transform: uppercase; padding: 5px 8px; }
.ps-stats .st b { display: flex; align-items: center; justify-content: center; gap: 6px; font: 750 1.3rem var(--sans); padding: 10px 8px; color: var(--stc); }
.ps-stats .st b svg { width: 20px; height: 20px; }
.st-xp { --stc: var(--accent-strong); } .st-acc { --stc: var(--ok); } .st-time { --stc: var(--info); }
.ps-end-row { display: flex; align-items: center; gap: 12px; text-align: left; max-width: 420px; margin: 10px auto 0; padding: 12px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); font-size: .93rem; }
.ps-end-row > svg { width: 26px; height: 26px; color: var(--flame); flex: none; }
.ps-end-row.goal > svg { color: var(--accent-strong); }
.ps-end-row.prize { border-color: var(--accent-bright); background: var(--accent-soft); }
.ps-end-row.prize > svg { color: var(--accent); }
.ps-end-row small { display: block; font: 700 .68rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
/* quit dialog, toast, loading, confetti */
.ps-quit { position: absolute; inset: 0; background: rgba(8, 14, 26, .5); display: grid; place-items: end center; padding: 16px; z-index: 5; }
.ps-quit-in { background: var(--card); border-radius: 22px; padding: 26px; width: min(460px, 100%); text-align: center; box-shadow: var(--shadow-lg); margin-bottom: 4vh; }
.ps-quit-in p { color: var(--muted); }
.ps-quit-b { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
.ps-quit-b .ps-btn { width: 100%; }
.ps-toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); z-index: 120; background: var(--ink); color: var(--paper); padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); display: flex; gap: 10px; align-items: flex-start; max-width: min(460px, calc(100vw - 32px)); font-size: .93rem; opacity: 0; transition: opacity .25s, transform .25s; }
.ps-toast.in { opacity: 1; transform: translate(-50%, 0); }
.ps-toast svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.ps-loading { position: fixed; inset: 0; z-index: 110; background: color-mix(in srgb, var(--paper) 80%, transparent); display: grid; place-items: center; font-weight: 600; color: var(--muted); gap: 12px; align-content: center; }
.spin { width: 34px; height: 34px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent-bright); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.confetti { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 4; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.2s cubic-bezier(.25,.6,.4,1) forwards; }
@keyframes fall { to { transform: translate(var(--dx), 105vh) rotate(var(--r)); opacity: .2; } }

/* ---------- onboarding ---------- */
.ob { position: fixed; inset: 0; z-index: 100; background: rgba(8, 14, 26, .55); display: grid; place-items: center; padding: 16px; overflow-y: auto; opacity: 0; transition: opacity .2s; }
.ob.in { opacity: 1; }
.ob-in { position: relative; background: var(--paper); border-radius: 26px; padding: 30px clamp(20px, 4vw, 36px); width: min(560px, 100%); box-shadow: var(--shadow-lg); text-align: center; }
.ob-x { position: absolute; right: 14px; top: 14px; appearance: none; border: 0; background: none; color: var(--faint); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.ob-x svg { width: 22px; height: 22px; }
.ob-art { width: 64px; height: 64px; margin: 0 auto 8px; color: var(--ink); }
.ob-art svg { width: 100%; height: 100%; }
.ob-q { font-weight: 650; margin: 20px 0 10px; }
.ob-goals { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 520px) { .ob-goals { grid-template-columns: repeat(2, 1fr); } }
.ob-goal, .ob-lv { appearance: none; cursor: pointer; background: var(--card); color: var(--ink); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 8px; font-family: var(--sans); display: flex; flex-direction: column; gap: 2px; align-items: center; }
.ob-goal b { font-size: .95rem; } .ob-goal span { font-size: .78rem; color: var(--muted); } .ob-goal em { font-style: normal; font: 700 .72rem var(--mono); color: var(--accent); margin-top: 3px; }
.ob-goal.sel { border-color: var(--info); background: var(--info-soft); }
.ob-levels { display: grid; gap: 10px; }
.ob-lv { flex-direction: row; gap: 14px; padding: 14px 16px; text-align: left; }
.ob-lv:hover { border-color: var(--info); }
.ob-lv svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.ob-lv b { display: block; font-size: 1rem; } .ob-lv small { color: var(--muted); font-size: .85rem; }
.ob-note { font-size: .8rem; color: var(--muted); margin: 18px 0 0; }

/* ---------- home: dashboard, demo card, steps, daily ---------- */
.dash-sec { display: none; padding: clamp(28px, 4vw, 48px) 0 clamp(20px, 3vw, 36px); }
.has-progress .dash-sec { display: block; }
.has-progress .hero { display: none; }
.dash { display: grid; grid-template-columns: 1.3fr 1fr; gap: 18px; }
@media (max-width: 860px) { .dash { grid-template-columns: 1fr; } }
.dash-main { background: var(--navy); color: #e8e4da; border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 32px); position: relative; overflow: hidden; }
.dash-main .eyebrow { color: var(--accent-bright); }
.dash-stats { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; margin: 10px 0 22px; }
.dash-streak { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; }
.dash-streak svg { width: 34px; height: 34px; color: var(--flame); fill: color-mix(in srgb, var(--flame) 30%, transparent); }
.dash-streak b { font: 750 2rem var(--sans); color: #fff; }
.dash-level { font: 600 .82rem var(--mono); padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.1); }
.dash-next { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px; text-decoration: none; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.14); border-radius: 18px; padding: 16px 18px; color: #fff; transition: background .15s; }
.dash-next:hover { background: rgba(255,255,255,.12); color: #fff; }
.dn-k { font: 700 .72rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: #aab3c2; }
.dash-next b { font-family: var(--serif); font-size: 1.25rem; grid-column: 1; font-weight: 600; }
.dn-go { grid-row: 1 / span 2; grid-column: 2; width: 52px; height: 52px; border-radius: 50%; background: var(--accent-bright); color: var(--accent-ink); display: grid; place-items: center; box-shadow: 0 4px 0 #a87623; }
.dn-go svg { width: 22px; height: 22px; fill: currentColor; }
.dash-side { display: grid; gap: 12px; }
.dash-tile { display: flex; align-items: center; gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: left; font-family: var(--sans); color: var(--ink); }
.dash-goal b { display: block; font: 700 1.05rem var(--sans); }
.dash-goal a { font-size: .8rem; color: var(--muted); }
.dt-k { font: 700 .7rem var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.dash-ring { position: relative; width: 64px; height: 64px; flex: none; display: grid; place-items: center; }
.dash-ring .ring { position: absolute; inset: 0; }
.dash-ring b { font: 750 1rem var(--sans); }
.dash-btn { appearance: none; cursor: pointer; border-bottom-width: 4px; transition: transform .1s; }
.dash-btn:hover { border-color: var(--line-2); }
.dash-btn:active { transform: translateY(2px); }
.dash-btn > svg { width: 28px; height: 28px; color: var(--accent); flex: none; }
.dash-btn b { display: block; font-size: 1rem; }
.dash-btn small { color: var(--muted); font-size: .84rem; }
.dash-btn small.hot { color: var(--flame); font-weight: 650; }
.dash-btn.is-done small::after { content: " ✓"; color: var(--ok); }
.demo-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); padding: 18px 20px 0; overflow: hidden; }
.demo-top { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; color: var(--faint); }
.demo-top svg { width: 20px; height: 20px; }
.demo-bar { flex: 1; height: 12px; border-radius: 99px; background: var(--paper-3); overflow: hidden; }
.demo-bar span { display: block; width: 62%; height: 100%; background: var(--ok); border-radius: 99px; }
.demo-q { font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; margin: 0 0 16px; }
.demo-opts { display: grid; gap: 8px; }
.demo-opts span { border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 12px; padding: 10px 14px; font-weight: 550; font-size: .95rem; }
.demo-opts .right { border-color: var(--ok); background: var(--ok-soft); }
.demo-fb { display: flex; gap: 10px; align-items: flex-start; margin: 16px -20px 0; padding: 14px 20px; background: var(--ok-soft); color: var(--ok-ink); font-size: .9rem; line-height: 1.45; }
.demo-fb svg { width: 26px; height: 26px; padding: 4px; border-radius: 50%; background: #fff; color: var(--ok); stroke-width: 3; flex: none; }
.hero-note { display: inline-flex; align-items: center; gap: 8px; }
.hero-note svg { width: 20px; height: 20px; color: var(--accent-strong); }
.hero-note b { margin: 0; display: inline; }
.hero-note.flame svg { color: var(--flame); fill: color-mix(in srgb, var(--flame) 25%, transparent); }
.hero-note.n1 { left: -22px; bottom: 120px; top: auto; }
.how { padding-top: clamp(40px, 5vw, 64px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
@media (max-width: 980px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .steps { grid-template-columns: 1fr; } }
.steps li { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 20px 20px; }
.steps li > svg { width: 28px; height: 28px; color: var(--accent); margin-bottom: 12px; }
.steps .sn { position: absolute; right: 16px; top: 14px; font: 700 .8rem var(--mono); color: var(--faint); }
.steps h3 { font-size: 1.15rem; margin-bottom: 6px; }
.steps p { margin: 0; font-size: .92rem; color: var(--ink-2); line-height: 1.55; }
.daily-card { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent-bright) 45%, transparent); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 18px; }
.daily-card .dc-icon { width: 48px; height: 48px; border-radius: 14px; background: var(--accent-bright); color: var(--accent-ink); display: grid; place-items: center; }
.daily-card .dc-icon svg { width: 24px; height: 24px; }
.daily-card h3 { font-size: 1.2rem; margin: 2px 0 4px; }
.daily-card p { margin: 0; font-size: .92rem; color: var(--ink-2); }
.daily-card .btn { grid-column: 1 / -1; justify-self: start; margin-top: 12px; }

/* ---------- practice hub ---------- */
.hub { padding-top: 34px; padding-bottom: 90px; }
.hub-top { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 900px) { .hub-top { grid-template-columns: 1fr; } }
.hub-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.hub-card .hc-ico { width: 50px; height: 50px; border-radius: 15px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); margin-bottom: 14px; }
.hub-daily .hc-ico { background: var(--accent-soft); color: var(--accent); }
.hub-place .hc-ico { background: var(--info-soft); color: var(--info); }
.hub-card .hc-ico svg { width: 26px; height: 26px; }
.hub-card h2 { font-size: 1.35rem; margin-bottom: 8px; }
.hub-card p { font-size: .93rem; color: var(--ink-2); margin: 0 0 18px; flex: 1; }
.hc-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.due-pill { font: 650 .8rem var(--sans); color: var(--muted); }
.due-pill.hot { color: var(--flame); }
.hub-daily.is-done .due-pill { color: var(--ok); }
.hub-sec { margin-top: 56px; }
.decks { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 12px; }
.deck { appearance: none; cursor: pointer; text-align: left; font-family: var(--sans); color: var(--ink); display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; align-items: center; background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 16px; padding: 14px 16px 12px; transition: border-color .12s, transform .08s; }
.deck:hover { border-color: var(--mc); }
.deck:active { transform: translateY(2px); }
.deck-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--mcs, var(--paper-3)); color: var(--mc, var(--ink-2)); display: grid; place-items: center; grid-row: span 2; }
.deck-ico svg { width: 22px; height: 22px; }
.deck-t b { display: block; font-size: .96rem; line-height: 1.3; }
.deck-t small { color: var(--muted); font-size: .8rem; }
.deck .progress { grid-column: 2; margin-top: 4px; }
.m0 { --mc: var(--ink-2); --mcs: var(--paper-3); }
.mtests { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); overflow: hidden; }
.mtest-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.mtest-row:first-child { border-top: 0; }
.mt-n { width: 34px; height: 34px; border-radius: 10px; background: var(--mcs); color: var(--mc); display: grid; place-items: center; font: 750 .95rem var(--mono); }
.mt-t b { display: block; font-size: .98rem; } .mt-t small { color: var(--muted); font-size: .8rem; }
.mt-s { font: 650 .82rem var(--sans); color: var(--faint); display: inline-flex; gap: 5px; align-items: center; }
.mt-s svg { width: 16px; height: 16px; }
.mtest-row.passed .mt-s { color: var(--accent); }
@media (max-width: 560px) { .mtest-row { grid-template-columns: auto 1fr auto; } .mt-s { display: none; } }
.hub-why { display: grid; grid-template-columns: auto 1fr; gap: 20px; background: var(--paper-2); border-radius: var(--radius-lg); padding: clamp(22px, 3vw, 34px); }
.hub-why > svg { width: 40px; height: 40px; color: var(--accent); }
.hub-why h2 { font-size: 1.4rem; margin-bottom: 8px; }
.hub-why p { margin: 0; color: var(--ink-2); max-width: 62em; }
@media (max-width: 560px) { .hub-why { grid-template-columns: 1fr; } }

/* ---------- progress page ---------- */
.pp { padding-top: 34px; padding-bottom: 90px; display: grid; gap: 18px; }
.pp-tiles { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 980px) { .pp-tiles { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 520px) { .pp-tiles { grid-template-columns: repeat(2, 1fr); } }
.pp-tile { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; display: grid; gap: 2px; }
.pp-tile svg { width: 24px; height: 24px; color: var(--accent); margin-bottom: 6px; }
.pp-tile.lit svg { color: var(--flame); fill: color-mix(in srgb, var(--flame) 25%, transparent); }
.pp-tile b { font: 750 1.5rem var(--sans); letter-spacing: -.02em; }
.pp-tile span { font-size: .8rem; color: var(--muted); }
.pp-lv { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.pp-lv .progress { margin: 0; height: 12px; }
.progress.gold span { background: var(--accent-bright); }
.pp-lv-n { font: 750 1rem var(--sans); } .pp-lv-r { font: 600 .8rem var(--mono); color: var(--muted); }
@media (max-width: 520px) { .pp-lv { grid-template-columns: 1fr; gap: 8px; } }
.pp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .pp-grid { grid-template-columns: 1fr; } }
.pp-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; }
.pp-card h2 { font-size: 1.25rem; margin-bottom: 14px; }
.pp-card p.muted { font-size: .9rem; margin-top: -6px; }
.week { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; height: 190px; align-items: end; }
.wk { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; position: relative; z-index: 1; }
.wk-bar { width: 100%; max-width: 38px; height: 78%; display: flex; align-items: flex-end; background: var(--paper-2); border-radius: 8px; overflow: hidden; }
.wk-bar span { display: block; width: 100%; background: var(--line-2); border-radius: 8px 8px 0 0; min-height: 0; transition: height .5s; }
.wk.hit .wk-bar span { background: var(--accent-bright); }
.wk-v { font: 650 .72rem var(--mono); color: var(--muted); min-height: 1em; }
.wk-d { font: 650 .75rem var(--sans); color: var(--muted); }
.wk.today .wk-d { color: var(--ink); }
.wk-goal { position: absolute; left: 0; right: 0; border-top: 2px dashed color-mix(in srgb, var(--accent-bright) 70%, transparent); z-index: 2; pointer-events: none; }
.wk-goal span { position: absolute; right: 0; top: -20px; font: 650 .68rem var(--sans); color: var(--accent); background: var(--card); padding: 0 4px; }
.goal-pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.goal-pick button { appearance: none; cursor: pointer; text-align: left; font-family: var(--sans); color: var(--ink); background: var(--card); border: 2px solid var(--line); border-bottom-width: 4px; border-radius: 14px; padding: 12px 14px; }
.goal-pick button b { display: block; } .goal-pick button span { font-size: .82rem; color: var(--muted); }
.goal-pick button.sel { border-color: var(--info); background: var(--info-soft); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.badge { text-align: center; padding: 16px 10px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--paper); opacity: .55; filter: grayscale(1); }
.badge.got { opacity: 1; filter: none; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent-bright) 50%, transparent); }
.badge .bi { width: 52px; height: 52px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-3); color: var(--muted); }
.badge.got .bi { background: var(--accent-bright); color: var(--accent-ink); box-shadow: 0 3px 0 #a87623; }
.badge .bi svg { width: 26px; height: 26px; }
.badge b { display: block; font-size: .92rem; } .badge small { display: block; font-size: .76rem; color: var(--muted); line-height: 1.35; margin-top: 3px; }
.ppm-list { display: grid; gap: 8px; }
.ppm { display: grid; grid-template-columns: auto 1fr auto auto; gap: 14px; align-items: center; text-decoration: none; padding: 10px 12px; border-radius: 12px; }
.ppm:hover { background: var(--paper-2); color: var(--ink); }
.ppm-i { width: 38px; height: 38px; border-radius: 11px; background: var(--mcs); color: var(--mc); display: grid; place-items: center; }
.ppm-i svg { width: 20px; height: 20px; }
.ppm-t b { display: block; font-size: .95rem; } .ppm-t .progress { margin-top: 6px; height: 7px; }
.ppm-c { font: 650 .8rem var(--mono); color: var(--muted); }
.ppm-crown { color: var(--line-2); } .ppm-crown svg { width: 20px; height: 20px; }
.ppm.mastered .ppm-crown { color: var(--accent-strong); }
.bk-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.bk-code { padding-left: 14px; font: 500 .8rem var(--mono); resize: vertical; margin-top: 6px; }
.bk-msg { font-size: .88rem; margin: 6px 0 0; min-height: 1.2em; }
.bk-msg.ok { color: var(--ok); } .bk-msg.bad { color: var(--bad); }
.danger { color: var(--bad) !important; }
.danger-solid { background: var(--bad); color: #fff; }
.bk-confirm { background: var(--bad-soft); border-radius: 12px; padding: 14px; margin-top: 8px; }
.bk-confirm p { margin: 0 0 10px; color: var(--bad-ink); font-size: .9rem; }
@media print { .tabbar, .practice-box, .readbar, .hud { display: none !important; } }
.hud[hidden] { display: none; }
.node.current .node-label { margin-left: 10px; }
@media (max-width: 900px) {
  .hub-card { display: grid; grid-template-columns: auto 1fr; column-gap: 14px; align-items: center; padding: 20px; }
  .hub-card .hc-ico { width: 42px; height: 42px; margin: 0; border-radius: 12px; }
  .hub-card h2 { margin: 0; font-size: 1.2rem; }
  .hub-card p, .hub-card .hc-foot { grid-column: 1 / -1; }
  .hub-card p { margin: 12px 0 16px; }
}
.gl-cards-cta { margin-top: 22px; }
.mn-theme { display: none; appearance: none; background: none; border: 0; cursor: pointer; align-items: center; gap: 10px; width: 100%; text-align: left; }
.mn-theme svg { width: 18px; height: 18px; }
.mn-theme .sun { display: none; }
:root[data-theme="dark"] .mn-theme .sun { display: block; } :root[data-theme="dark"] .mn-theme .moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mn-theme .sun { display: block; } :root:not([data-theme="light"]) .mn-theme .moon { display: none; } }
@media (max-width: 520px) {
  .header-tools .theme-toggle { display: none; }
  .mn-theme { display: flex; }
  .hud-goal { display: none; }
  .hud { margin-right: 0; padding: 4px 9px; }
}

/* ---------- account ---------- */
.acct-btn { position: relative; }
.acct-btn .acct-ini { display: none; }
.acct-btn.in svg { display: none; }
.acct-btn.in .acct-ini { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-bright); color: var(--accent-ink); font: 750 .78rem var(--sans); letter-spacing: .02em; }
.acct { padding-top: 34px; padding-bottom: 90px; }
.acct-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.acct-grid[hidden] { display: none; }
@media (max-width: 860px) { .acct-grid { grid-template-columns: 1fr; } }
.acct-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: clamp(20px, 3vw, 30px); box-shadow: var(--shadow-sm); }
.acct-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--paper-2); border-radius: 14px; padding: 4px; margin-bottom: 22px; }
.acct-tabs[hidden] { display: none; }
.acct-tabs button { appearance: none; border: 0; background: none; font: 650 .95rem var(--sans); color: var(--muted); padding: 10px; border-radius: 11px; cursor: pointer; }
.acct-tabs button[aria-selected="true"] { background: var(--card); color: var(--ink); box-shadow: var(--shadow-sm); }
.acct-form { display: grid; gap: 14px; }
.acct-form[hidden] { display: none; }
.acct-form h2 { font-size: 1.3rem; }
.field { display: grid; gap: 6px; }
.field > span { font: 600 .85rem var(--sans); color: var(--ink-2); }
.inp { width: 100%; font: 500 1rem var(--sans); color: var(--ink); background: var(--paper); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; transition: border-color .15s; }
.inp:focus { outline: none; border-color: var(--info); }
.acct-form .btn { justify-content: center; }
.acct-form .btn-sm { justify-self: start; }
.linkish { appearance: none; background: none; border: 0; padding: 0; font: 600 .88rem var(--sans); color: var(--accent); cursor: pointer; justify-self: center; }
.linkish:hover { text-decoration: underline; }
.form-note { font-size: .85rem; color: var(--muted); margin: 0; line-height: 1.5; }
.form-msg { margin: 0; font-size: .9rem; font-weight: 550; min-height: 0; }
.form-msg:empty { display: none; }
.form-msg.ok { color: var(--ok); } .form-msg.bad { color: var(--bad); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.acct-side { display: grid; gap: 16px; }
.acct-perks { background: var(--paper-2); border-radius: var(--radius-lg); padding: 22px 24px; }
.acct-perks h2 { font-size: 1.25rem; margin-bottom: 12px; }
.acct-perks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.acct-perks li { display: grid; grid-template-columns: auto 1fr; gap: 12px; font-size: .9rem; color: var(--ink-2); line-height: 1.45; }
.acct-perks li > svg { width: 22px; height: 22px; color: var(--accent); margin-top: 1px; }
.acct-perks li b { display: block; color: var(--ink); }
.acct-legacy { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); font-size: .88rem; color: var(--ink-2); }
.acct-legacy svg { width: 20px; height: 20px; color: var(--info); }
.acct-legacy p { margin: 0; line-height: 1.5; }
.acct-hello { display: flex; gap: 16px; align-items: center; margin-bottom: 22px; }
.acct-hello h2 { font-size: 1.4rem; }
.acct-hello p { margin: 2px 0 0; font-size: .88rem; }
.acct-avatar { width: 58px; height: 58px; border-radius: 50%; background: var(--accent-bright); color: var(--accent-ink); display: grid; place-items: center; font: 750 1.2rem var(--sans); flex: none; box-shadow: 0 3px 0 #a87623; }
.acct-sync { display: inline-flex; align-items: center; gap: 6px; color: var(--ok) !important; font-weight: 600; }
.acct-sync svg { width: 16px; height: 16px; }
.acct-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); }
.acct-more { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0 18px; }
.acct-more summary { cursor: pointer; padding: 16px 0; font-weight: 650; }
.acct-more[open] { padding-bottom: 18px; }
.acct-more .form-note { margin-bottom: 12px; }
.danger-zone { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-2); }
.ps-end-row.nudge { text-decoration: none; border-color: var(--info); background: var(--info-soft); color: var(--ink); }
.ps-end-row.nudge > svg { color: var(--info); }
.league-card h2 { display: flex; align-items: center; gap: 10px; }
.league-card h2 svg { width: 22px; height: 22px; color: var(--accent); }
.league { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.league li { display: grid; grid-template-columns: 34px 34px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 12px; }
.league li.me { background: var(--info-soft); }
.league .lr { font: 750 .95rem var(--mono); color: var(--muted); text-align: center; }
.league .top1 .lr { color: #c7962d; } .league .top2 .lr { color: #8f99ab; } .league .top3 .lr { color: #b0703a; }
.league .la { width: 32px; height: 32px; border-radius: 50%; background: var(--paper-3); display: grid; place-items: center; font: 700 .72rem var(--sans); color: var(--ink-2); }
.league .ln { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.league .lx { font: 650 .85rem var(--mono); color: var(--ink-2); }
.league-me { margin: 10px 0 0; font-weight: 650; }
.league-foot { font-size: .82rem; margin: 12px 0 0; }
@media (max-width: 520px) { .acct-btn { width: 36px; height: 36px; } }
.mobile-nav .mn-lang { display: none; }
@media (max-width: 520px) {
  .header-tools .lang-switch { display: none; }
  .mobile-nav .mn-lang { display: block; }
}
