/* Vāk-Setu design system — tokens, base, components.  Light is default; dark via [data-theme] or system preference. */
:root {
  --ivory: #FAF6EE; --paper: #FFFDF8; --sand: #F1EADC; --line: #E2D8C5;
  --ink: #23252B; --ink-2: #4B4F5C; --ink-3: #6B6F7B;
  --indigo: #1F2A55; --indigo-2: #2E3C74; --saffron: #8A4E12; --saffron-soft: #F6E6D0;
  --teal: #226B69; --teal-soft: #DCEDEA; --danger: #A3302A; --danger-soft: #F7E1DE; --ok: #276B3A; --ok-soft: #E1F0E4;
  --bg: var(--ivory); --surface: var(--paper); --surface-2: var(--sand); --text: var(--ink); --muted: var(--ink-3);
  --accent: var(--indigo); --accent-contrast: #fff; --link: var(--indigo-2); --focus: #B86E1F;
  --radius: 10px; --radius-lg: 16px; --shadow: 0 1px 2px rgba(31,42,85,.06), 0 6px 20px rgba(31,42,85,.06);
  --font-ui: "Noto Sans", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-read: "Noto Serif", "Noto Serif Devanagari", Georgia, serif;
  --wrap: 1180px; --read: 42rem; --read-size: 1.125rem; --read-leading: 1.85;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #13151B; --surface: #1B1E26; --surface-2: #242833; --line: #343949; --text: #ECE6DA; --muted: #A8A69F;
  --accent: #AAB6EA; --accent-contrast: #13151B; --link: #B9C3F0; --indigo: #AAB6EA; --indigo-2: #C3CCF3;
  --saffron: #E3A55E; --saffron-soft: #3A2D1C; --teal: #7CC7C1; --teal-soft: #1E3533; --danger: #F0948C; --danger-soft: #3B2220; --ok: #8FD3A0; --ok-soft: #1E3324;
  --shadow: 0 1px 2px rgba(0,0,0,.3); --focus: #E3A55E; color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #13151B; --surface: #1B1E26; --surface-2: #242833; --line: #343949; --text: #ECE6DA; --muted: #A8A69F;
    --accent: #AAB6EA; --accent-contrast: #13151B; --link: #B9C3F0; --indigo: #AAB6EA; --indigo-2: #C3CCF3;
    --saffron: #E3A55E; --saffron-soft: #3A2D1C; --teal: #7CC7C1; --teal-soft: #1E3533; --danger: #F0948C; --danger-soft: #3B2220; --ok: #8FD3A0; --ok-soft: #1E3324;
    --shadow: 0 1px 2px rgba(0,0,0,.3); --focus: #E3A55E; color-scheme: dark;
  }
}
*, *::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 { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-ui); font-size: 1rem; line-height: 1.65; }
:lang(hi), :lang(sa) { line-height: 1.8; }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a.ext::after, a[target="_blank"]::after { content: "↗"; font-size: .8em; margin-left: .2em; display: inline-block; text-decoration: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--font-read); color: var(--text); line-height: 1.3; margin: 0 0 .5em; font-weight: 700; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); } h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); } h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 28px; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 8px; top: -60px; background: var(--accent); color: var(--accent-contrast); padding: 10px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 8px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
.header-row { display: flex; align-items: center; gap: 12px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); margin-right: auto; }
.brand svg { width: 40px; height: 40px; flex: none; }
.brand-name { font-family: var(--font-read); font-weight: 700; font-size: 1.25rem; line-height: 1.1; display: block; white-space: nowrap; }
.brand-tag { font-size: .75rem; color: var(--muted); display: block; letter-spacing: .02em; }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--accent); }
.icon-btn svg { width: 20px; height: 20px; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.lang-switch a { padding: 8px 10px; font-size: .85rem; text-decoration: none; color: var(--text); min-width: 44px; text-align: center; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--accent-contrast); font-weight: 600; }
.main-nav { border-top: 1px solid var(--line); }
.main-nav > .wrap > ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; flex-wrap: wrap; }
.main-nav > .wrap > ul > li { position: relative; }
.nav-top { display: flex; align-items: center; gap: 4px; padding: 10px 12px; color: var(--text); text-decoration: none; font-weight: 500; background: none; border: 0; font: inherit; cursor: pointer; border-bottom: 2px solid transparent; }
.nav-top:hover, .nav-top[aria-expanded="true"] { color: var(--accent); }
.nav-top.active { border-bottom-color: var(--saffron); color: var(--accent); }
.nav-top .chev { width: 12px; height: 12px; transition: transform .15s; }
.nav-top[aria-expanded="true"] .chev { transform: rotate(180deg); }
.mega { position: absolute; left: 0; top: 100%; min-width: 260px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 10px; display: none; z-index: 50; }
.mega.wide { min-width: min(640px, 90vw); }
.mega.open { display: block; }
.mega ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.mega.wide ul { grid-template-columns: repeat(2, 1fr); }
.mega a { display: block; padding: 7px 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.mega a:hover, .mega a:focus-visible { background: var(--surface-2); }
.mega a small { display: block; color: var(--muted); font-size: .78rem; }
.menu-toggle { display: none; }
@media (max-width: 960px) {
  .menu-toggle { display: inline-grid; }
  .main-nav { display: none; }
  .main-nav.open { display: block; max-height: calc(100vh - 64px); overflow-y: auto; }
  .main-nav > .wrap > ul { flex-direction: column; padding: 8px 0 16px; }
  .nav-top { width: 100%; justify-content: space-between; padding: 12px 4px; }
  .mega, .mega.wide { position: static; box-shadow: none; border: 0; padding: 0 0 8px 8px; min-width: 0; }
  .mega.wide ul { grid-template-columns: 1fr; }
  .lang-switch a { padding: 8px 7px; min-width: 38px; }
  .brand-tag { display: none; }
}
@media (max-width: 420px) { .brand-name { font-size: 1.05rem; } .brand svg { width: 34px; height: 34px; } .header-row { gap: 6px; } .icon-btn { width: 38px; height: 38px; } }

/* Breadcrumb */
.breadcrumb ol { list-style: none; padding: 0; margin: 20px 0 8px; display: flex; flex-wrap: wrap; gap: 6px; font-size: .88rem; color: var(--muted); }
.breadcrumb li + li::before { content: "›"; margin-right: 6px; }
.breadcrumb a { color: var(--muted); }

/* Buttons & chips */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-contrast); text-decoration: none; font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; }
.btn:hover { filter: brightness(1.08); }
.btn.secondary { background: transparent; color: var(--accent); }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--text); font-weight: 500; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-block; font-size: .78rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); text-decoration: none; }
:root[data-theme="dark"] .chip { color: var(--text); }
.chip.demo { background: var(--saffron-soft); color: var(--saffron); border-color: transparent; font-weight: 600; }
.chip.lang { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.chip.status-proposed { background: var(--saffron-soft); color: var(--saffron); border-color: transparent; }
.chip.status-verified { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.status-contextDependent { background: var(--teal-soft); color: var(--teal); border-color: transparent; }
.meta { color: var(--muted); font-size: .88rem; display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; }

/* Sections & cards */
main { min-height: 60vh; }
.section { padding: 44px 0; }
.section + .section { border-top: 1px solid var(--line); }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .75rem; color: var(--saffron); font-weight: 700; margin-bottom: 6px; }
.grid { display: grid; gap: 18px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 8px; position: relative; }
.card h3 { margin: 0; font-size: 1.15rem; }
.card h3 a { color: var(--text); text-decoration: none; }
.card h3 a::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.card h3 a:focus-visible { outline: none; }
.card .excerpt { color: var(--ink-2); margin: 0; font-size: .95rem; }
:root[data-theme="dark"] .card .excerpt { color: var(--muted); }
.card .meta { margin-top: auto; padding-top: 6px; }
.card .chips { display: flex; gap: 6px; flex-wrap: wrap; position: relative; z-index: 1; }
.cat-card { padding: 16px 18px; }
.cat-card h3 { font-size: 1.05rem; }
.cat-card .count { color: var(--muted); font-size: .82rem; }
.cat-card .glyph { font-family: var(--font-read); font-size: 1.6rem; color: var(--saffron); line-height: 1; }
.empty { border: 1px dashed var(--line); border-radius: var(--radius-lg); padding: 28px; text-align: center; color: var(--muted); background: var(--surface); }
.empty .btn { margin-top: 8px; }

/* Hero */
.hero { padding: 56px 0 44px; position: relative; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.3rem); margin-bottom: .35em; }
.hero .lead { font-size: 1.15rem; color: var(--ink-2); max-width: 36rem; }
:root[data-theme="dark"] .hero .lead { color: var(--muted); }
.hero-art { aspect-ratio: 1 / .85; border-radius: 24px; background: var(--indigo); color: #F6EFE2; padding: 28px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
:root[data-theme="dark"] .hero-art { background: #222A4D; }
.hero-art svg.arc { position: absolute; inset: auto 0 0 0; width: 100%; opacity: .9; }
.hero-art .words { font-family: var(--font-read); font-size: clamp(1.2rem, 2.4vw, 1.7rem); line-height: 1.5; position: relative; }
.hero-art .words span { display: block; }
.hero-art .words span:nth-child(2) { color: #E9B77C; }
.hero-art .words span:nth-child(3) { color: #9ED3CE; }
.hero-art .cap { font-size: .8rem; opacity: .8; position: relative; }
@media (max-width: 860px) { .hero-grid { grid-template-columns: 1fr; } .hero-art { aspect-ratio: auto; min-height: 220px; } }
.mission { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px 24px; display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; }
.mission .seal { width: 54px; height: 54px; border-radius: 50%; background: var(--saffron-soft); display: grid; place-items: center; color: var(--saffron); font-family: var(--font-read); font-size: 1.5rem; font-weight: 700; }

/* Feature */
.feature { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; }
@media (max-width: 860px) { .feature { grid-template-columns: 1fr; } }
.feature-main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 28px; position: relative; border-top: 4px solid var(--saffron); }
.feature-main h3 { font-size: 1.6rem; }
.feature-main h3 a { color: var(--text); text-decoration: none; }
.list-plain { list-style: none; padding: 0; margin: 0; }
.list-plain li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-plain li:last-child { border-bottom: 0; }
.list-plain a { color: var(--text); font-weight: 600; text-decoration: none; }
.list-plain a:hover { text-decoration: underline; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 24px; }
.panel.accent { background: var(--indigo); color: #F6EFE2; border: 0; }
.panel.accent h2, .panel.accent h3 { color: #fff; }
.panel.accent .btn { background: #F6EFE2; color: #1F2A55; border-color: #F6EFE2; }
:root[data-theme="dark"] .panel.accent { background: #222A4D; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
label { font-weight: 600; font-size: .95rem; }
.req { color: var(--danger); font-weight: 400; font-size: .85em; }
input[type=text], input[type=email], input[type=search], select, textarea { font: inherit; color: var(--text); background: var(--surface); border: 1px solid color-mix(in srgb, var(--ink-3) 60%, var(--line)); border-radius: 10px; padding: 10px 12px; min-height: 44px; width: 100%; }
textarea { min-height: 140px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.check input { margin-top: .35em; width: 18px; height: 18px; flex: none; }
.hint { color: var(--muted); font-size: .85rem; }
.error-msg { color: var(--danger); font-size: .88rem; }
.hp { position: absolute; left: -9999px; }
.alert { padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); margin: 12px 0; }
.alert.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.alert.warn { background: var(--saffron-soft); color: var(--text); border-color: transparent; }
.alert.err { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 8px 0 20px; }
.filters .field { margin: 0; min-width: 160px; flex: 1 1 160px; }
.search-big { display: flex; gap: 8px; }
.search-big input { font-size: 1.05rem; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.2em; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--surface-2); font-weight: 600; }
tr:last-child td { border-bottom: 0; }

/* Reading */
.page-head { padding: 8px 0 18px; }
.page-head .lead { color: var(--muted); font-size: 1.08rem; max-width: 46rem; }
.reader { max-width: var(--read); margin: 0 auto; }
.reader.wide { --read: 52rem; }
.prose { font-family: var(--font-read); font-size: var(--read-size); line-height: var(--read-leading); }
.prose h2 { margin-top: 1.6em; } .prose h3 { margin-top: 1.4em; }
.prose blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--saffron); color: var(--ink-2); font-style: italic; }
:root[data-theme="dark"] .prose blockquote { color: var(--muted); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin: .3em 0; }
.prose .stanza { margin: 0 0 1.5em; white-space: normal; }
.prose.poem { font-size: calc(var(--read-size) * 1.05); }
.prose.quote { font-size: calc(var(--read-size) * 1.5); text-align: center; padding: 30px 0; }
.prose table { font-family: var(--font-ui); }
.callout { border-radius: var(--radius); padding: 14px 16px; margin: 1.2em 0; background: var(--surface-2); font-family: var(--font-ui); font-size: .95rem; }
.callout-title { font-weight: 700; margin-bottom: .3em; }
.callout-exercise { background: var(--teal-soft); }
.callout-note { background: var(--saffron-soft); }
.model-answer { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; margin: 0 0 1.4em; font-family: var(--font-ui); font-size: .95rem; background: var(--surface); }
.model-answer summary { cursor: pointer; font-weight: 600; color: var(--accent); }
.article-head { text-align: left; margin-bottom: 20px; }
.article-head h1 { margin-bottom: .3em; }
.article-head .summary { font-size: 1.12rem; color: var(--muted); }
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 10px 0; margin: 14px 0 26px; }
.toolbar .btn { padding: 7px 12px; min-height: 38px; font-size: .88rem; }
.reading-panel { display: none; gap: 16px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: -14px 0 22px; }
.reading-panel.open { display: flex; }
.reading-panel fieldset { border: 0; padding: 0; margin: 0; display: flex; gap: 6px; align-items: center; }
.reading-panel legend { font-size: .85rem; color: var(--muted); float: left; margin-right: 6px; }
.progress-bar { position: fixed; left: 0; top: 0; height: 3px; background: var(--saffron); width: 0; z-index: 60; }
.chapter-nav { display: flex; justify-content: space-between; gap: 12px; margin: 30px 0; flex-wrap: wrap; }
.chapter-nav a { flex: 1 1 200px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; text-decoration: none; color: var(--text); background: var(--surface); }
.chapter-nav a small { display: block; color: var(--muted); }
.chapter-nav a.next { text-align: right; }
.author-box { display: flex; gap: 14px; align-items: center; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 28px 0; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--teal-soft); color: var(--teal); display: grid; place-items: center; font-weight: 700; flex: none; }
.demo-banner { background: var(--saffron-soft); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; margin: 0 0 18px; }
.lang-notice { background: var(--teal-soft); color: var(--text); border-radius: var(--radius); padding: 10px 14px; font-size: .9rem; margin-bottom: 16px; }

/* Layout with sidebar */
.with-side { display: grid; grid-template-columns: 260px 1fr; gap: 32px; align-items: start; }
.side-nav { position: sticky; top: 140px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px; }
.side-nav h2 { font-size: 1rem; margin: 4px 8px 8px; }
.side-nav ul { list-style: none; padding: 0; margin: 0; }
.side-nav a { display: block; padding: 6px 10px; border-radius: 8px; text-decoration: none; color: var(--text); font-size: .93rem; }
.side-nav a[aria-current="page"] { background: var(--accent); color: var(--accent-contrast); }
.side-nav a:hover { background: var(--surface-2); }
.side-nav a[aria-current="page"]:hover { background: var(--accent); }
@media (max-width: 900px) { .with-side { grid-template-columns: 1fr; } .side-nav { position: static; } }

/* Course */
.course-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 18px 0; }
.course-meta .panel { padding: 16px 18px; }
.course-meta h3 { font-size: .95rem; font-family: var(--font-ui); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.course-meta ul { margin: 0; padding-left: 1.1em; }
.module { border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 12px; background: var(--surface); }
.module h3 { padding: 14px 18px 0; margin: 0; }
.module ol { margin: 8px 0 0; padding: 0 0 8px; list-style: none; counter-reset: l; }
.module li a { display: flex; gap: 12px; padding: 10px 18px; text-decoration: none; color: var(--text); align-items: center; }
.module li a::before { counter-increment: l; content: counter(l); width: 28px; height: 28px; border-radius: 50%; background: var(--surface-2); display: grid; place-items: center; font-size: .82rem; flex: none; }
.module li a.done::before { content: "✓"; background: var(--ok-soft); color: var(--ok); }
.module li a:hover { background: var(--surface-2); }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--teal); width: 0; }

/* Quiz */
.quiz-shell { max-width: 46rem; margin: 0 auto; }
.quiz-q { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 22px; margin-bottom: 14px; }
.quiz-q h3 { font-family: var(--font-ui); font-size: 1.08rem; line-height: 1.6; }
.quiz-q .qnum { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.opt { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; margin: 8px 0; cursor: pointer; background: var(--bg); font-weight: 400; }
.opt:hover { border-color: var(--accent); }
.opt input { margin-top: .35em; width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.opt:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.opt.is-correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.is-wrong { border-color: var(--danger); background: var(--danger-soft); }
.quiz-bar { position: sticky; bottom: 0; background: var(--bg); border-top: 1px solid var(--line); padding: 12px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; }
.score-ring { font-family: var(--font-read); font-size: 3rem; font-weight: 700; color: var(--accent); }
.verdict { font-weight: 700; font-size: .9rem; }
.verdict.ok { color: var(--ok); } .verdict.bad { color: var(--danger); }

/* Glossary & directory */
.alpha { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 16px; }
.alpha button { min-width: 38px; min-height: 38px; border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; font: inherit; }
.alpha button[aria-pressed="true"] { background: var(--accent); color: var(--accent-contrast); border-color: var(--accent); }
.term-card .trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 6px 0; }
.term-card .trio div { background: var(--surface-2); border-radius: 8px; padding: 8px 10px; position: relative; }
.term-card .trio small { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.term-card .trio strong { font-family: var(--font-read); font-size: 1.08rem; word-break: break-word; }
.term-card .copy { position: absolute; right: 4px; top: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; font-size: .75rem; padding: 4px; z-index: 1; }
@media (max-width: 560px) { .term-card .trio { grid-template-columns: 1fr; } }
.dir-item h3 a { word-break: break-word; }
.dir-item dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; font-size: .86rem; margin: 6px 0 0; }
.dir-item dt { color: var(--muted); } .dir-item dd { margin: 0; }
.cat-group { margin-bottom: 28px; }
.cat-group > h2 { font-size: 1.2rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }

/* Video */
.video-frame { aspect-ratio: 16/9; background: #1F2A55; border-radius: var(--radius); display: grid; place-items: center; color: #F6EFE2; text-align: center; padding: 16px; position: relative; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-frame .play { width: 58px; height: 58px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; margin: 0 auto 8px; }

/* Search results */
.result { padding: 16px 0; border-bottom: 1px solid var(--line); }
.result h3 { margin: 4px 0; font-size: 1.1rem; }
.result p { margin: 4px 0; color: var(--muted); }
mark { background: var(--saffron-soft); color: inherit; padding: 0 2px; border-radius: 3px; }

/* Footer */
.site-footer { margin-top: 56px; background: var(--indigo); color: #E9E4F2; padding: 44px 0 24px; }
:root[data-theme="dark"] .site-footer { background: #0E1015; border-top: 1px solid var(--line); }
.site-footer a { color: #F6EFE2; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; }
.footer-grid h2 { color: #fff; font-size: .95rem; font-family: var(--font-ui); text-transform: uppercase; letter-spacing: .08em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; font-size: .93rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); margin-top: 28px; padding-top: 16px; font-size: .85rem; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; opacity: .9; }
@media (max-width: 860px) { .footer-grid { grid-template-columns: 1fr 1fr; } .footer-grid > :first-child { grid-column: 1 / -1; } }
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
.to-top.show { opacity: 1; pointer-events: auto; }
.pager { display: flex; justify-content: center; margin-top: 22px; }

/* Print */
@media print {
  .site-header, .site-footer, .toolbar, .reading-panel, .to-top, .breadcrumb, .chapter-nav, .related, .progress-bar, .skip { display: none !important; }
  body { background: #fff; color: #000; }
  .prose { font-size: 12pt; }
  a.ext::after { content: " (" attr(href) ")"; }
}
[hidden] { display: none !important; }
@media (max-width: 560px) {
  .grid.cols-4 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cat-card { padding: 12px 14px; }
  .cat-card .count { font-size: .75rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .section { padding: 32px 0; }
  .hero { padding-top: 32px; }
}

.md-figure{margin:1.4em 0}.md-figure img{max-width:100%;height:auto;border-radius:10px;display:block}.md-figure figcaption{font-size:.9rem;color:var(--muted,#667);margin-top:6px}

.brand img.brand-logo{height:40px;width:auto;max-width:190px;object-fit:contain;flex:none;display:block}
.brand img.brand-logo.only + span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
@media (max-width:420px){.brand img.brand-logo{height:34px;max-width:150px}}

.social{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0 0}
.social-link{width:36px;height:36px;border-radius:50%;border:1px solid rgba(255,255,255,.38);display:inline-flex;align-items:center;justify-content:center;color:#F6EFE2}
.social-link svg{width:19px;height:19px}.social-link img{width:22px;height:22px;object-fit:contain;border-radius:4px}
.social-link:hover{background:rgba(255,255,255,.16);text-decoration:none!important}
.social-link::after,.social-link::before{content:none!important;display:none!important}

figure.md-figure.cover{margin:1.2em 0}figure.md-figure.cover img{width:100%;max-height:460px;object-fit:cover}
