/* ==========================================================================
   ReadingLab — design system
   Warm editorial base, navy ink, one teal accent, one warm highlight.
   ========================================================================== */
:root {
  --bg: #FBF8F3;
  --bg-soft: #F4EFE6;
  --surface: #FFFFFF;
  --ink: #1C2433;
  --ink-2: #3B4558;
  --muted: #6B7383;
  --line: #E6DFD3;
  --line-strong: #D5CCBC;
  --accent: #0E6E6C;
  --accent-ink: #0A5654;
  --accent-soft: #DCEDEA;
  --warm: #D9692F;
  --warm-soft: #FBE7DA;
  --good: #23784A;
  --good-soft: #E1F2E7;
  --bad: #B23A3A;
  --bad-soft: #F8E3E1;
  --gold: #B7862B;

  --lvl-a1: #3E7D57;
  --lvl-a2: #0E6E6C;
  --lvl-b1: #2F5C9E;
  --lvl-b2: #6A4C93;

  --font-ui: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Georgia, serif;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 2px rgba(28, 36, 51, .06);
  --shadow: 0 1px 2px rgba(28, 36, 51, .05), 0 8px 24px rgba(28, 36, 51, .06);
  --shadow-lg: 0 2px 4px rgba(28, 36, 51, .05), 0 20px 48px rgba(28, 36, 51, .10);

  --wrap: 1180px;
  --read-size: 1.25rem;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-ui); font-size: 1rem; line-height: 1.55;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; }
p { margin: 0; }
ul { margin: 0; padding: 0; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.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-link { position: absolute; left: 1rem; top: -3rem; z-index: 100; background: var(--ink); color: var(--bg); padding: .6rem 1rem; border-radius: 8px; text-decoration: none; }
.skip-link:focus { top: 1rem; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
main:focus { outline: none; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.site-header.scrolled { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; font-weight: 600; font-size: 1.15rem; letter-spacing: -.01em; color: var(--ink); }
.brand b { color: var(--accent); font-weight: 700; }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.primary-nav { display: flex; gap: .25rem; }
.primary-nav a { text-decoration: none; padding: .5rem .8rem; border-radius: 999px; font-weight: 500; color: var(--ink-2); font-size: .95rem; transition: background .15s, color .15s; }
.primary-nav a:hover { background: var(--bg-soft); color: var(--ink); }
.primary-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.nav-toggle { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; position: relative; }
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; content: ""; transition: transform .2s; }
.nav-toggle-bar { top: 21px; }
.nav-toggle-bar::before { left: 0; right: 0; top: -6px; }
.nav-toggle-bar::after { left: 0; right: 0; top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: block; }
  .primary-nav { position: absolute; top: 68px; left: 0; right: 0; flex-direction: column; background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 1.25rem 1rem; display: none; box-shadow: var(--shadow); }
  .primary-nav.open { display: flex; }
  .primary-nav a { padding: .85rem 1rem; border-radius: 12px; font-size: 1.05rem; }
}

.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; opacity: 0; transition: opacity .2s; }
.read-progress.on { opacity: 1; }
.read-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .1s linear; }

/* ---------- Typography helpers ---------- */
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); }
.display { font-family: var(--font-serif); font-weight: 500; letter-spacing: -.02em; }
.section { padding: 4.5rem 0; }
.section-tight { padding: 3rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; flex-wrap: wrap; }
.section-head h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.7rem, 3vw, 2.3rem); letter-spacing: -.015em; }
.section-head p { color: var(--muted); max-width: 46ch; margin-top: .4rem; }
.link-arrow { text-decoration: none; font-weight: 600; color: var(--accent); white-space: nowrap; }
.link-arrow:hover { text-decoration: underline; text-underline-offset: 3px; }
.muted { color: var(--muted); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 46px; padding: .7rem 1.25rem; border-radius: 999px; border: 1px solid transparent; font-weight: 600; text-decoration: none; font-size: .98rem; transition: background .15s, color .15s, border-color .15s, transform .15s var(--ease), box-shadow .15s; white-space: nowrap; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: #2A3446; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn-ghost:hover { background: var(--surface); border-color: var(--ink); }
.btn-soft { background: var(--bg-soft); color: var(--ink); }
.btn-soft:hover { background: var(--line); }
.btn-sm { min-height: 38px; padding: .45rem .9rem; font-size: .9rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); transition: background .15s, border-color .15s; }
.icon-btn:hover { border-color: var(--ink); }
.icon-btn[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.icon-btn svg { width: 20px; height: 20px; }

/* ---------- Badges & chips ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; height: 24px; padding: 0 .55rem; border-radius: 6px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; }
.lvl { color: #fff; }
.lvl-A1 { background: var(--lvl-a1); } .lvl-A2 { background: var(--lvl-a2); } .lvl-B1 { background: var(--lvl-b1); } .lvl-B2 { background: var(--lvl-b2); }
.topic { font-size: .78rem; font-weight: 600; color: var(--ink-2); text-transform: uppercase; letter-spacing: .08em; }
.meta-row { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem .75rem; font-size: .88rem; color: var(--muted); }
.meta-row .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-strong); }
.chip { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .4rem .95rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-weight: 500; font-size: .92rem; transition: all .15s; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: 4rem 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 3.5rem; align-items: center; }
.hero h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.6rem, 5.6vw, 4.6rem); letter-spacing: -.03em; line-height: 1.02; }
.hero h1 em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 1.2rem; color: var(--ink-2); margin: 1.4rem 0 2rem; max-width: 38ch; }
.hero-cta { display: flex; gap: .75rem; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 2rem; margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 500; }
.hero-stats span { font-size: .85rem; color: var(--muted); }
.hero-collage { position: relative; aspect-ratio: 1 / 1.02; }
.hero-card { position: absolute; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--surface); text-decoration: none; transition: transform .4s var(--ease); }
.hero-card:hover { transform: translateY(-4px) rotate(0deg) !important; }
.hero-card .cover { aspect-ratio: 16/10; }
.hero-card .hero-card-body { padding: .8rem 1rem 1rem; }
.hero-card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.05rem; margin-top: .35rem; }
.hero-card.c1 { width: 48%; left: 0; top: 7%; transform: rotate(-2deg); z-index: 2; }
.hero-card.c2 { width: 48%; right: 0; top: 0; transform: rotate(2.5deg); z-index: 1; }
.hero-card.c3 { width: 50%; left: 25%; bottom: 2%; transform: rotate(-1deg); z-index: 3; }
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 2.5rem; }
  .hero-collage { aspect-ratio: auto; display: grid; grid-template-columns: repeat(3, minmax(220px, 1fr)); gap: 1rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
  .hero-card { position: relative; inset: auto !important; width: auto !important; transform: none !important; scroll-snap-align: start; }
}

/* ---------- Article cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 1.5rem; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s, border-color .2s; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.card .cover { aspect-ratio: 16/10; }
.card-body { padding: 1.1rem 1.2rem 1.25rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card-top { display: flex; align-items: center; gap: .6rem; }
.card h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.3rem; letter-spacing: -.01em; }
.card h3 a { text-decoration: none; }
.card h3 a::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card p.desc { color: var(--ink-2); font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta-row { margin-top: auto; padding-top: .4rem; }
.card-status { position: absolute; top: .75rem; right: .75rem; z-index: 2; display: flex; gap: .35rem; }
.pill { display: inline-flex; align-items: center; gap: .3rem; height: 26px; padding: 0 .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: var(--shadow-sm); }
.pill.done { background: var(--good); color: #fff; }
.pill svg { width: 13px; height: 13px; }

.card-feature { display: grid; grid-template-columns: 1.25fr 1fr; }
.card-feature .cover { aspect-ratio: auto; min-height: 100%; }
.card-feature .card-body { padding: 2rem; justify-content: center; }
.card-feature h3 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); }
@media (max-width: 760px) { .card-feature { grid-template-columns: 1fr; } .card-feature .cover { aspect-ratio: 16/10; } .card-feature .card-body { padding: 1.25rem; } }

.cover { position: relative; background: var(--bg-soft); overflow: hidden; }
.cover svg { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Levels & topics ---------- */
.level-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.level-card { display: flex; flex-direction: column; gap: .6rem; padding: 1.4rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; position: relative; overflow: hidden; transition: transform .25s var(--ease), box-shadow .25s; }
.level-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.level-card .lvl-code { font-family: var(--font-serif); font-size: 2.6rem; line-height: 1; font-weight: 500; }
.level-card h3 { font-size: 1.05rem; font-weight: 600; }
.level-card p { color: var(--muted); font-size: .92rem; }
.level-card .bar { height: 4px; border-radius: 4px; background: var(--bg-soft); margin-top: .4rem; overflow: hidden; }
.level-card .bar span { display: block; height: 100%; }
.level-card .count { font-size: .85rem; font-weight: 600; color: var(--ink-2); }
.level-card[data-lvl="A1"] .lvl-code { color: var(--lvl-a1); } .level-card[data-lvl="A1"] .bar span { background: var(--lvl-a1); }
.level-card[data-lvl="A2"] .lvl-code { color: var(--lvl-a2); } .level-card[data-lvl="A2"] .bar span { background: var(--lvl-a2); }
.level-card[data-lvl="B1"] .lvl-code { color: var(--lvl-b1); } .level-card[data-lvl="B1"] .bar span { background: var(--lvl-b1); }
.level-card[data-lvl="B2"] .lvl-code { color: var(--lvl-b2); } .level-card[data-lvl="B2"] .bar span { background: var(--lvl-b2); }
@media (max-width: 900px) { .level-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .level-grid { grid-template-columns: 1fr; } }

.topic-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.topic-card { display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .2s, transform .25s var(--ease); }
.topic-card:hover { border-color: var(--ink); transform: translateY(-2px); }
.topic-swatch { width: 56px; height: 56px; border-radius: 12px; flex: none; overflow: hidden; }
.topic-card h3 { font-size: 1rem; font-weight: 600; }
.topic-card span { font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) { .topic-grid { grid-template-columns: repeat(2, 1fr); } }

/* ---------- Daily challenge & how it works ---------- */
.challenge { display: grid; grid-template-columns: 1fr 1.1fr; background: var(--ink); color: var(--bg); border-radius: var(--radius-lg); overflow: hidden; }
.challenge .cover { min-height: 280px; }
.challenge-body { padding: 2.25rem; display: flex; flex-direction: column; gap: 1rem; justify-content: center; }
.challenge-body .eyebrow { color: #F6B98F; }
.challenge-body h2 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.challenge-body p { color: #C9CFDA; }
.challenge-goals { display: flex; flex-direction: column; gap: .5rem; list-style: none; }
.challenge-goals li { display: flex; gap: .6rem; align-items: center; font-size: .95rem; }
.goal-dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #5A6478; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.goal-dot.ok { background: #6CC59A; border-color: #6CC59A; color: var(--ink); }
.goal-dot svg { width: 12px; height: 12px; }
.challenge .btn-light { background: var(--bg); color: var(--ink); }
.challenge .btn-light:hover { background: #fff; }
@media (max-width: 800px) { .challenge { grid-template-columns: 1fr; } .challenge .cover { min-height: 200px; aspect-ratio: 16/9; } .challenge-body { padding: 1.5rem; } }

.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; counter-reset: step; }
.step { padding-top: 1.25rem; border-top: 2px solid var(--ink); }
.step .num { font-family: var(--font-serif); font-size: 1rem; color: var(--accent); font-weight: 600; }
.step h3 { font-size: 1.1rem; font-weight: 600; margin: .4rem 0; }
.step p { color: var(--muted); font-size: .95rem; }
@media (max-width: 860px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Page header ---------- */
.page-head { padding: 3rem 0 1.5rem; }
.page-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.2rem, 4.5vw, 3.4rem); letter-spacing: -.025em; }
.page-head p { color: var(--ink-2); font-size: 1.1rem; margin-top: .6rem; max-width: 60ch; }

/* ---------- Explore / filters ---------- */
.filters { display: grid; gap: 1rem; padding: 1.25rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 2rem; }
.filter-row { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }
.filter-label { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; min-width: 70px; }
.search { position: relative; flex: 1 1 280px; }
.search input { width: 100%; height: 48px; padding: 0 1rem 0 2.75rem; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg); font-size: 1rem; }
.search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search svg { position: absolute; left: .9rem; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--muted); }
.select { height: 44px; padding: 0 2.25rem 0 .9rem; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C2433' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right .85rem center; appearance: none; -webkit-appearance: none; font-size: .95rem; }
.select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.results-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; color: var(--muted); font-size: .92rem; gap: 1rem; flex-wrap: wrap; }
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.empty h3 { color: var(--ink); font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; margin-bottom: .4rem; }

/* ---------- Reader ---------- */
.reader-head { padding: 2.5rem 0 1.5rem; }
.reader-col { width: min(100% - 2.5rem, 720px); margin-inline: auto; }
.crumbs { display: flex; gap: .5rem; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 1.5rem; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.reader-head h1 { font-family: var(--font-serif); font-weight: 500; font-size: clamp(2.1rem, 5vw, 3.3rem); letter-spacing: -.025em; line-height: 1.06; margin: .8rem 0 .9rem; }
.reader-head .subtitle { font-family: var(--font-serif); font-size: 1.35rem; color: var(--ink-2); line-height: 1.4; }
.reader-cover { width: min(100% - 2.5rem, 980px); margin: 1.75rem auto 0; border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 16 / 8; }
.reader-cover figcaption { font-size: .8rem; color: var(--muted); padding-top: .5rem; }
.reader-figure { width: min(100% - 2.5rem, 980px); margin: 1.75rem auto 0; }
.reader-figure .reader-cover { width: 100%; margin: 0; }
.reader-figure figcaption { font-size: .82rem; color: var(--muted); margin-top: .5rem; }

.toolbar { position: sticky; top: 68px; z-index: 30; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); margin-top: 2rem; }
.toolbar-inner { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .55rem 0; }
.toolbar-group { display: flex; align-items: center; gap: .4rem; }
.toolbar .icon-btn { width: 40px; height: 40px; }
.font-ctl { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); }
.font-ctl button { width: 42px; height: 38px; border: 0; background: transparent; font-family: var(--font-serif); font-weight: 600; }
.font-ctl button + button { border-left: 1px solid var(--line); }
.font-ctl button:hover { background: var(--bg-soft); }
.font-ctl button[disabled] { opacity: .35; cursor: default; }
.toggle { display: inline-flex; align-items: center; gap: .5rem; font-size: .88rem; font-weight: 500; color: var(--ink-2); cursor: pointer; user-select: none; padding: .3rem .2rem; }
.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.toggle .track { width: 36px; height: 22px; border-radius: 999px; background: var(--line-strong); position: relative; transition: background .15s; flex: none; }
.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); box-shadow: var(--shadow-sm); }
.toggle input:checked + .track { background: var(--accent); }
.toggle input:checked + .track::after { transform: translateX(14px); }
.toggle input:focus-visible + .track { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
@media (max-width: 560px) { .toggle .lbl-long { display: none; } }

.article-body { font-family: var(--font-serif); font-size: var(--read-size); line-height: 1.72; color: #222A38; padding: 2.25rem 0 1rem; }
.article-body p { margin: 0 0 1.35em; }
.article-body p.lede::first-letter { float: left; font-size: 3.6em; line-height: .86; padding: .06em .1em 0 0; font-weight: 500; color: var(--accent); }
.para-num { font-family: var(--font-ui); font-size: .7rem; font-weight: 700; color: var(--muted); letter-spacing: .06em; display: none; margin-bottom: .2rem; }
.show-para-nums .para-num { display: block; }
.show-para-nums p.lede::first-letter { float: none; font-size: inherit; padding: 0; color: inherit; }
.vw { font: inherit; color: inherit; background: none; border: 0; padding: 0 .04em; margin: 0; border-radius: 3px; cursor: pointer; line-height: inherit; text-align: inherit; }
.vocab-on .vw { background: linear-gradient(transparent 62%, color-mix(in srgb, var(--warm) 22%, transparent) 62%); border-bottom: 1.5px dotted color-mix(in srgb, var(--warm) 70%, transparent); }
.vocab-on .vw:hover, .vw.active { background: var(--warm-soft); }
.vw:focus-visible { outline: 2px solid var(--warm); outline-offset: 1px; }

.popover { position: absolute; z-index: 70; width: min(340px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 1rem 1.1rem 1.05rem; font-family: var(--font-ui); animation: pop .18s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(4px) scale(.98); } to { opacity: 1; transform: none; } }
.popover .pv-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.popover h4 { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 500; }
.popover .pv-pos { font-size: .8rem; color: var(--muted); font-style: italic; }
.popover .pv-def { margin: .45rem 0 .6rem; font-size: .98rem; line-height: 1.45; }
.popover .pv-uz { display: flex; gap: .5rem; align-items: baseline; font-size: .95rem; padding: .5rem .65rem; border-radius: 8px; background: var(--bg-soft); }
.popover .pv-uz b { font-size: .7rem; letter-spacing: .08em; color: var(--muted); }
.popover .pv-ex { font-family: var(--font-serif); font-style: italic; color: var(--ink-2); margin-top: .6rem; font-size: 1rem; line-height: 1.45; }
.popover .pv-actions { display: flex; gap: .5rem; margin-top: .8rem; }
.popover .pv-close { position: absolute; top: .4rem; right: .4rem; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); }
.popover .pv-close:hover { background: var(--bg-soft); color: var(--ink); }

.source-box { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 1.4rem 0; margin: 1rem 0 2rem; font-size: .92rem; color: var(--ink-2); }
.source-box h2 { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin-bottom: .7rem; }
.source-box .ctype { display: inline-flex; align-items: center; gap: .4rem; font-weight: 600; color: var(--ink); background: var(--accent-soft); padding: .25rem .6rem; border-radius: 6px; font-size: .82rem; margin-bottom: .7rem; }
.source-box ul { list-style: none; display: grid; gap: .45rem; margin-top: .6rem; }
.source-box li { padding-left: 1rem; position: relative; }
.source-box li::before { content: ""; position: absolute; left: 0; top: .6em; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.source-box a { color: var(--accent-ink); text-underline-offset: 2px; word-break: break-word; }

.wordlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin-top: .75rem; }
.wordlist button { text-align: left; padding: .55rem .75rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font-size: .92rem; display: flex; flex-direction: column; }
.wordlist button:hover { border-color: var(--ink); }
.wordlist small { color: var(--muted); font-size: .78rem; }

.article-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 3rem 0 1rem; }
.article-nav a { display: flex; flex-direction: column; gap: .3rem; padding: 1.1rem 1.25rem; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); text-decoration: none; transition: border-color .2s; }
.article-nav a:hover { border-color: var(--ink); }
.article-nav a.next { text-align: right; }
.article-nav span { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }
.article-nav strong { font-family: var(--font-serif); font-weight: 500; font-size: 1.15rem; }
@media (max-width: 560px) { .article-nav { grid-template-columns: 1fr; } .article-nav a.next { text-align: left; } }

/* ---------- Activities ---------- */
.activities { background: var(--bg-soft); border-top: 1px solid var(--line); padding: 3rem 0 4rem; margin-top: 1rem; }
.activities-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.activities-head h2 { font-family: var(--font-serif); font-weight: 500; font-size: 2rem; }
.stepper { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.stepper button { display: inline-flex; align-items: center; gap: .45rem; min-height: 40px; padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .86rem; font-weight: 600; color: var(--ink-2); }
.stepper button[aria-current="step"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stepper .sdot { width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .7rem; background: var(--bg-soft); color: var(--ink-2); }
.stepper button[aria-current="step"] .sdot { background: rgba(255,255,255,.18); color: var(--bg); }
.stepper .sdot.ok { background: var(--good); color: #fff; }
.stepper .sdot svg { width: 11px; height: 11px; }

.ex { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.75rem; box-shadow: var(--shadow-sm); }
.ex-head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; margin-bottom: 1rem; flex-wrap: wrap; }
.ex-type { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.ex h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.5rem; margin-top: .25rem; }
.ex-instr { color: var(--ink-2); margin-bottom: 1.25rem; font-size: .98rem; }
.ex-key { background: var(--bg-soft); border-radius: 10px; padding: .75rem .9rem; font-size: .88rem; color: var(--ink-2); margin-bottom: 1.25rem; display: grid; gap: .25rem; }
.ex-key b { color: var(--ink); }
.hint-box { background: #FFF7E8; border: 1px solid #F1D9A7; color: #6B4E12; border-radius: 10px; padding: .75rem .9rem; font-size: .92rem; margin-bottom: 1rem; display: flex; gap: .5rem; }
.ex-items { display: grid; gap: .9rem; list-style: none; padding: 0; margin: 0; }
.q { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; transition: border-color .2s, background .2s; }
.q.correct { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: var(--good-soft); }
.q.incorrect { border-color: color-mix(in srgb, var(--bad) 40%, transparent); background: var(--bad-soft); }
.q-text { font-weight: 500; margin-bottom: .7rem; display: flex; gap: .6rem; }
.q-text .qn { font-weight: 700; color: var(--muted); min-width: 1.4rem; }
.q-text .qt { flex: 1; }
.opts { display: flex; flex-wrap: wrap; gap: .5rem; }
.opts.stack { flex-direction: column; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.opt span { display: flex; align-items: center; gap: .6rem; min-height: 44px; padding: .55rem .95rem; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: .96rem; transition: all .12s; }
.opts.stack .opt span { border-radius: 12px; }
.opt span::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; transition: all .12s; }
.opt input:checked + span { border-color: var(--ink); background: var(--bg-soft); }
.opt input:checked + span::before { border-color: var(--ink); background: var(--ink); box-shadow: inset 0 0 0 3px var(--surface); }
.opt input:focus-visible + span { outline: 3px solid var(--accent-soft); outline-offset: 1px; }
.opt input:disabled + span { cursor: default; }
.opt.is-right span { border-color: var(--good) !important; background: #fff !important; }
.opt.is-right span::before { border-color: var(--good) !important; background: var(--good) !important; }
.opt.is-wrong span { border-color: var(--bad) !important; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.gap-line { line-height: 2.4; font-size: 1.02rem; }
.gap-input { height: 40px; min-width: 130px; width: auto; padding: 0 .7rem; border-radius: 10px; border: 1.5px solid var(--line-strong); background: var(--surface); font-size: 1rem; vertical-align: middle; }
.gap-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.gap-input { padding-right: 2rem; appearance: none; -webkit-appearance: none; background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%231C2433' stroke-width='1.6' fill='none'/%3E%3C/svg%3E") no-repeat right .7rem center; }
.gap-input.right { border-color: var(--good); background-color: #fff; }
.gap-input.wrong { border-color: var(--bad); background-color: #fff; }
.bank { display: flex; flex-wrap: wrap; gap: .45rem; padding: .8rem; border: 1px dashed var(--line-strong); border-radius: 12px; margin-bottom: 1.1rem; }
.bank span { padding: .3rem .7rem; border-radius: 8px; background: var(--bg-soft); font-weight: 600; font-size: .92rem; }
.bank span.used { opacity: .4; text-decoration: line-through; }
.match-row { display: grid; grid-template-columns: minmax(120px, .8fr) 1.6fr; gap: .75rem; align-items: center; }
.match-row .term { font-weight: 600; font-family: var(--font-serif); font-size: 1.15rem; }
.match-row select { width: 100%; }
@media (max-width: 600px) { .match-row { grid-template-columns: 1fr; gap: .4rem; } }
.para-ref { font-family: var(--font-serif); color: var(--ink-2); font-size: .98rem; line-height: 1.5; border-left: 3px solid var(--line-strong); padding-left: .8rem; margin-bottom: .7rem; max-height: 6.2em; overflow: hidden; position: relative; }
.para-ref::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1.6em; background: linear-gradient(transparent, var(--surface)); }
.q.correct .para-ref::after { background: linear-gradient(transparent, var(--good-soft)); }
.q.incorrect .para-ref::after { background: linear-gradient(transparent, var(--bad-soft)); }
.order-list { list-style: none; display: grid; gap: .5rem; }
.order-item { display: flex; align-items: center; gap: .6rem; padding: .6rem .6rem .6rem .9rem; border: 1.5px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: transform .2s var(--ease), border-color .2s; }
.order-item .pos { width: 28px; height: 28px; border-radius: 8px; background: var(--bg-soft); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .85rem; flex: none; }
.order-item .txt { flex: 1; }
.order-item .mv { display: flex; gap: .3rem; }
.order-item .mv button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; }
.order-item .mv button:hover:not([disabled]) { border-color: var(--ink); }
.order-item .mv button[disabled] { opacity: .3; cursor: default; }
.order-item.right { border-color: var(--good); background: var(--good-soft); }
.order-item.wrong { border-color: var(--bad); background: var(--bad-soft); }
.order-item.flash { transform: scale(1.01); border-color: var(--accent); }
.feedback { margin-top: .7rem; font-size: .93rem; display: flex; gap: .55rem; align-items: start; color: var(--ink-2); }
.feedback .fi { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex: none; color: #fff; }
.feedback .fi svg { width: 12px; height: 12px; }
.feedback.ok .fi { background: var(--good); }
.feedback.no .fi { background: var(--bad); }
.feedback .ans { font-weight: 600; color: var(--ink); }
.summary-text { font-family: var(--font-serif); font-size: 1.12rem; line-height: 2.3; }

.ex-actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line); }
.ex-actions .spacer { flex: 1; }
.scorecard { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.2rem; border-radius: var(--radius); background: var(--bg-soft); margin-top: 1.25rem; animation: pop .25s var(--ease); }
.ring { width: 64px; height: 64px; flex: none; }
.ring circle { fill: none; stroke-width: 7; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring text { font-family: var(--font-ui); font-size: 15px; font-weight: 700; fill: var(--ink); }
.scorecard h4 { font-size: 1.05rem; }
.scorecard p { color: var(--muted); font-size: .92rem; }
.all-done { text-align: center; padding: 2.5rem 1.5rem; }
.all-done h3 { font-family: var(--font-serif); font-weight: 500; font-size: 2rem; margin: .5rem 0; }

/* ---------- Vocabulary Lab ---------- */
.tabs { display: inline-flex; gap: .3rem; padding: .3rem; background: var(--bg-soft); border-radius: 999px; margin-bottom: 1.5rem; flex-wrap: wrap; }
.tabs button { min-height: 40px; padding: .4rem 1.05rem; border-radius: 999px; border: 0; background: transparent; font-weight: 600; color: var(--ink-2); }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.vocab-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.vstat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.vstat strong { display: block; font-family: var(--font-serif); font-size: 1.9rem; font-weight: 500; line-height: 1.1; }
.vstat span { font-size: .85rem; color: var(--muted); }
@media (max-width: 700px) { .vocab-stats { grid-template-columns: repeat(2, 1fr); } }
.vocab-list { display: grid; gap: .75rem; }
.vcard { display: grid; grid-template-columns: 1fr auto; gap: 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; }
.vcard.learned { background: color-mix(in srgb, var(--good-soft) 55%, var(--surface)); }
.vcard h3 { font-family: var(--font-serif); font-weight: 500; font-size: 1.4rem; display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.vcard .pos { font-family: var(--font-ui); font-style: italic; color: var(--muted); font-size: .85rem; font-weight: 400; }
.vcard .def { margin: .35rem 0; }
.vcard .uz { font-size: .92rem; color: var(--ink-2); }
.vcard .uz b { font-size: .7rem; letter-spacing: .08em; color: var(--muted); margin-right: .3rem; }
.vcard .vex { font-family: var(--font-serif); font-style: italic; color: var(--ink-2); margin-top: .35rem; }
.vcard .from { font-size: .82rem; color: var(--muted); margin-top: .5rem; }
.vcard .from a { color: var(--accent-ink); }
.vcard-actions { display: flex; flex-direction: column; gap: .5rem; align-items: stretch; }
.vbtn { display: inline-flex; align-items: center; gap: .4rem; min-height: 40px; padding: .35rem .8rem; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.vbtn svg { width: 16px; height: 16px; }
.vbtn[aria-pressed="true"].star { background: #FFF3D6; border-color: var(--gold); color: #7A5410; }
.vbtn[aria-pressed="true"].learn { background: var(--good); border-color: var(--good); color: #fff; }
@media (max-width: 600px) { .vcard { grid-template-columns: 1fr; } .vcard-actions { flex-direction: row; } }

.flash-wrap { display: grid; justify-items: center; gap: 1.25rem; padding: 1rem 0; }
.flashcard { width: min(520px, 100%); aspect-ratio: 3 / 2; perspective: 1200px; cursor: pointer; border: 0; background: transparent; padding: 0; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .55s var(--ease); transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.fc-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem; text-align: center; gap: .5rem; }
.fc-back { transform: rotateY(180deg); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.fc-face .fc-word { font-family: var(--font-serif); font-size: clamp(2rem, 6vw, 2.8rem); font-weight: 500; }
.fc-face .fc-hint { font-size: .85rem; color: var(--muted); }
.fc-back .fc-def { font-size: 1.15rem; line-height: 1.45; }
.fc-back .fc-uz { color: #F6B98F; font-weight: 600; }
.fc-back .fc-ex { font-family: var(--font-serif); font-style: italic; color: #C9CFDA; font-size: 1rem; }
.fc-controls { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; align-items: center; }
.fc-count { font-size: .9rem; color: var(--muted); min-width: 80px; text-align: center; }

.match-game { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.mg-col { display: grid; gap: .6rem; align-content: start; }
.mg-tile { min-height: 64px; padding: .7rem .9rem; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); text-align: left; font-size: .95rem; transition: all .15s; }
.mg-tile.word { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 500; }
.mg-tile:hover:not([disabled]) { border-color: var(--ink); }
.mg-tile.sel { border-color: var(--accent); background: var(--accent-soft); }
.mg-tile.done { border-color: var(--good); background: var(--good-soft); color: var(--good); opacity: .75; cursor: default; }
.mg-tile.shake { animation: shake .35s; border-color: var(--bad); }
@keyframes shake { 20%, 60% { transform: translateX(-4px); } 40%, 80% { transform: translateX(4px); } }
.practice-bar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.25rem; }

/* ---------- Progress ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .3rem; }
.stat .label { font-size: .85rem; color: var(--muted); font-weight: 500; }
.stat strong { font-family: var(--font-serif); font-size: 2.4rem; font-weight: 500; line-height: 1; letter-spacing: -.02em; }
.stat strong small { font-size: 1rem; color: var(--muted); font-family: var(--font-ui); margin-left: .2rem; }
.stat .sub { font-size: .85rem; color: var(--muted); }
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.panel h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.45rem; margin-bottom: 1rem; }
.two-col { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1rem; margin-top: 1rem; }
@media (max-width: 860px) { .two-col { grid-template-columns: 1fr; } }
.lvl-bars { display: grid; gap: 1rem; }
.lvl-bar-row { display: grid; grid-template-columns: 48px 1fr auto; gap: .8rem; align-items: center; }
.lvl-bar-track { height: 12px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.lvl-bar-track span { display: block; height: 100%; border-radius: 999px; transition: width .7s var(--ease); }
.lvl-bar-row .n { font-size: .88rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .4rem; }
.week .d { display: flex; flex-direction: column; align-items: center; gap: .35rem; font-size: .75rem; color: var(--muted); }
.week .d i { width: 100%; max-width: 40px; aspect-ratio: 1; border-radius: 10px; background: var(--bg-soft); display: block; }
.week .d.on i { background: var(--accent); }
.week .d.today span { color: var(--ink); font-weight: 700; }
.recent { list-style: none; display: grid; gap: .5rem; }
.recent li a { display: grid; grid-template-columns: 64px 1fr auto; gap: .9rem; align-items: center; padding: .5rem; border-radius: 12px; text-decoration: none; }
.recent li a:hover { background: var(--bg-soft); }
.recent .thumb { width: 64px; height: 44px; border-radius: 8px; overflow: hidden; }
.recent .t { font-weight: 600; font-size: .95rem; }
.recent .s { font-size: .82rem; color: var(--muted); }
.recent .sc { font-weight: 700; font-size: .9rem; }
.danger-link { background: none; border: 0; color: var(--bad); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: .3rem; }

/* ---------- Practice ---------- */
.skill-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.skill { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; }
.skill h3 { font-size: 1.05rem; font-weight: 600; }
.skill p { color: var(--muted); font-size: .92rem; }
.skill .levels { display: flex; gap: .3rem; margin-top: .2rem; }
.skill-list { list-style: none; display: grid; gap: .35rem; margin-top: .5rem; }
.skill-list a { display: flex; justify-content: space-between; gap: .5rem; text-decoration: none; font-size: .9rem; padding: .45rem .6rem; border-radius: 8px; background: var(--bg-soft); }
.skill-list a:hover { background: var(--line); }
.skill-list .ok { color: var(--good); font-weight: 700; }
.path { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.path-col h3 { display: flex; align-items: center; gap: .5rem; font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.path-col ol { list-style: none; display: grid; gap: .45rem; padding: 0; margin: 0; }
.path-col li a { display: flex; gap: .6rem; align-items: center; padding: .55rem .7rem; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); text-decoration: none; font-size: .92rem; }
.path-col li a:hover { border-color: var(--ink); }
.path-col .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-strong); flex: none; display: inline-flex; align-items: center; justify-content: center; }
.path-col .tick.ok { background: var(--good); border-color: var(--good); color: #fff; }
.path-col .tick svg { width: 11px; height: 11px; }
@media (max-width: 900px) { .path { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .path { grid-template-columns: 1fr; } }

/* ---------- Modal (placement test) ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(28, 36, 51, .45); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 1rem; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--bg); border-radius: var(--radius-lg); width: min(620px, 100%); max-height: calc(100vh - 2rem); overflow: auto; padding: 1.75rem; box-shadow: var(--shadow-lg); position: relative; animation: pop .25s var(--ease); }
.modal h2 { font-family: var(--font-serif); font-weight: 500; font-size: 1.8rem; margin-bottom: .4rem; }
.modal .close { position: absolute; top: .9rem; right: .9rem; }
.progress-dots { display: flex; gap: .3rem; margin: 1rem 0 1.25rem; }
.progress-dots i { flex: 1; height: 4px; border-radius: 4px; background: var(--line); }
.progress-dots i.on { background: var(--accent); }

/* ---------- Footer & misc ---------- */
.site-footer { background: var(--ink); color: #C9CFDA; padding: 3.5rem 0 1.5rem; margin-top: 4rem; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 2rem; }
.brand-footer { color: var(--bg); }
.brand-footer .brand-mark { color: var(--bg); }
.brand-footer b { color: #7FD1C9; }
.footer-tag { font-family: var(--font-serif); font-size: 1.25rem; color: var(--bg); margin: .9rem 0 .4rem; }
.footer-small { font-size: .88rem; color: #9AA3B5; margin-top: .4rem; max-width: 36ch; }
.footer-h { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: #9AA3B5; font-weight: 600; margin-bottom: .9rem; }
.footer-links { list-style: none; display: grid; gap: .55rem; }
.footer-links a { text-decoration: none; color: #E6E9EF; font-size: .95rem; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom { border-top: 1px solid #2E3850; margin-top: 2.5rem; padding-top: 1.25rem; font-size: .82rem; color: #8790A3; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

.toast { visibility: hidden; position: fixed; bottom: 1.25rem; left: 50%; transform: translate(-50%, 150%); background: var(--ink); color: var(--bg); padding: .75rem 1.2rem; border-radius: 12px; font-size: .92rem; font-weight: 500; z-index: 90; transition: transform .3s var(--ease); box-shadow: var(--shadow-lg); max-width: calc(100vw - 2rem); }
.toast.show { visibility: visible; transform: translate(-50%, 0); }

.prose { font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.7; color: #222A38; }
.prose h2 { font-size: 1.6rem; font-weight: 500; margin: 2rem 0 .6rem; }
.prose p { margin-bottom: 1rem; }
.prose ul { padding-left: 1.2rem; margin-bottom: 1rem; }
.prose li { margin-bottom: .4rem; }

.fade-in { animation: fadeUp .45s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

@media (max-width: 600px) {
  body { font-size: .98rem; }
  .section { padding: 3rem 0; }
  .hero { padding: 2.5rem 0 2rem; }
  .ex { padding: 1.15rem; }
  .q { padding: .85rem; }
  .article-body { font-size: calc(var(--read-size) - .08rem); }
  .wrap, .reader-col { width: calc(100% - 2rem); }
}
@media print {
  .site-header, .site-footer, .toolbar, .activities, .article-nav, .read-progress { display: none !important; }
}
@media (max-width: 560px) {
  .toolbar-inner { gap: .3rem; }
  .toolbar-group { gap: .3rem; }
  .toolbar .btn-sm { padding: .45rem .75rem; }
  .toolbar .toggle > span:last-child { display: none; }
  .font-ctl button { width: 38px; }
}
