/* BharatBeej: handmade paper, sindoor, haldi and marigold by day; indigo night lit by diyas after dark.
   Each stage of a course has its own colour: śravaṇa haldi, manana leaf, nididhyāsana sindoor. */
:root {
  --paper: #f8efdd;
  --paper-2: #f1e3c8;
  --card: #fffaf0;
  --ink: #2a1a10;
  --ink-2: #5a4232;
  --muted: #76604c;
  --line: #e4d0ac;
  --sindoor: #b8321f;
  --sindoor-ink: #fff6ea;
  --haldi: #e3a21a;
  --marigold: #f08a24;
  --leaf: #3f7a3a;
  --peacock: #0e6b6b;
  --gold: #b58a2a;
  --glow: rgba(240, 160, 40, .35);
  --hl: #ffd36b;
  --shadow: 0 1px 2px rgba(90, 50, 10, .08), 0 14px 40px -12px rgba(120, 60, 10, .25);
  --head: "Tiro Devanagari Sanskrit", "Noto Serif", Georgia, serif;
  --deva-display: "Yatra One", "Tiro Devanagari Sanskrit", serif;
  --body: "Mukta", system-ui, -apple-system, sans-serif;
  /* older names, used across the course pages */
  --bg: var(--paper);
  --surface: var(--card);
  --surface-2: var(--paper-2);
  --accent: var(--sindoor);
  --accent-ink: var(--sindoor-ink);
  --accent-soft: color-mix(in srgb, var(--sindoor) 13%, var(--card));
  --hl-ink: #2a1a10;
  --done: var(--leaf);
  --serif: "Literata", "Iowan Old Style", Charter, Georgia, serif;   /* course reading text (loaded by course.html) */
  --deva: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", serif;
  --sans: var(--body);
  --top-h: 60px;
  --rail-h: 0px;
  --nav-w: 300px;
  --player-h: 92px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0d0f22; --paper-2: #141733; --card: #161a38; --ink: #f4e8d2; --ink-2: #d4c3a6; --muted: #9c8d77;
    --line: #2b2f57; --sindoor: #ff6b4a; --sindoor-ink: #1a0c06; --haldi: #f2b843; --marigold: #ff9d3c; --leaf: #6fb565;
    --peacock: #3cc0b0; --gold: #e2b85a; --glow: rgba(255, 170, 60, .45); --hl: #f2b843;
    --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 50px -16px rgba(0,0,0,.7); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0d0f22; --paper-2: #141733; --card: #161a38; --ink: #f4e8d2; --ink-2: #d4c3a6; --muted: #9c8d77;
  --line: #2b2f57; --sindoor: #ff6b4a; --sindoor-ink: #1a0c06; --haldi: #f2b843; --marigold: #ff9d3c; --leaf: #6fb565;
  --peacock: #3cc0b0; --gold: #e2b85a; --glow: rgba(255, 170, 60, .45); --hl: #f2b843;
  --shadow: 0 1px 2px rgba(0,0,0,.5), 0 18px 50px -16px rgba(0,0,0,.7); color-scheme: dark;
}

/* stage colours */
.s-begin { --sc: var(--gold); --sc-on: #2a1a10; }
.s-sravana { --sc: var(--haldi); --sc-on: #2a1a10; }
.s-manana { --sc: var(--leaf); --sc-on: #fffaf0; }
.s-nididhyasana { --sc: var(--sindoor); --sc-on: var(--sindoor-ink); }
.s-begin, .s-sravana, .s-manana, .s-nididhyasana { --sc-ink: color-mix(in srgb, var(--sc) 72%, var(--ink)); --sc-soft: color-mix(in srgb, var(--sc) 14%, var(--card)); }
/* the light colours need more ink to be read as text (4.5:1) */
.s-sravana { --sc-ink: color-mix(in srgb, var(--sc) 50%, var(--ink)); }
.s-begin { --sc-ink: color-mix(in srgb, var(--sc) 60%, var(--ink)); }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 21px/1.75 var(--serif); }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; font-weight: 400; font-family: var(--serif); letter-spacing: -.012em; }
[lang="sa"] { font-family: var(--deva); }
button { font: inherit; color: inherit; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* every press answers at once, so a tap never feels lost */
button:active:not(:disabled) { transform: scale(.95); }
kbd { font: 12px var(--sans); padding: 1px 6px; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
::selection { background: var(--hl); color: #2a1a10; }

/* paper grain, very faint; a plain overlay so it costs nothing to keep on screen */
body::before { content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .35;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .3 0 0 0 0 .15 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
:root[data-theme="dark"] body::before { opacity: .2; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body::before { opacity: .2; } }

/* ── logo and top bar ─────────────────────────────────────────────────── */
/* the logo is one colour (fill: currentColor), so it follows --sindoor through day / night */
.logo, .lockup { flex: none; color: var(--sindoor); }
.logo { width: 30px; height: 34px; display: none; }
.lockup { height: 32px; width: auto; display: block; }
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 12px; height: var(--top-h);
  padding: 0 16px; background: var(--bg);
  border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: 15px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; }
.crumb { display: flex; flex-direction: column; min-width: 0; padding-left: 12px; border-left: 1px solid var(--line); line-height: 1.15;
  color: var(--ink); text-decoration: none; }
.crumb [lang="sa"] { font-size: 16px; color: var(--sindoor); white-space: nowrap; }
.crumb-en { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.spacer { flex: 1; }
.icon-btn { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; fill: none; stroke: var(--ink-2); stroke-width: 1.8; stroke-linecap: round; }
#theme-toggle svg { stroke: var(--haldi); } #theme-toggle svg circle { fill: var(--haldi); }
#nav-toggle { display: none; }

/* ── stage icon ───────────────────────────────────────────────────────── */
.stage-icon { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--sc-ink); stroke-width: 1.6; stroke-linecap: round; }
.stage-icon .fill { fill: var(--sc); stroke: none; }

/* ── the mala: course steps as beads (small screens) ──────────────────── */
.rail { display: none; }

/* ── course layout ────────────────────────────────────────────────────── */
.course { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr); min-height: calc(100vh - var(--top-h)); }
.sidenav { position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); overflow-y: auto; padding: 22px 14px 40px 16px;
  border-right: 1px solid var(--line); font-family: var(--sans); font-size: 16.5px; line-height: 1.35; background: var(--bg); }
.has-player .sidenav { height: calc(100vh - var(--top-h) - var(--player-h)); }
.side-topic { display: block; text-decoration: none; color: var(--ink); padding: 0 6px 12px; }
.side-deva { display: block; font-size: 22px; color: var(--sindoor); }
.side-title { display: block; font: 20px var(--serif); }
.side-src { display: block; color: var(--muted); font-size: 13px; }
.side-progress { height: 5px; margin: 4px 6px 4px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.side-progress span { display: block; height: 100%; width: 0; border-radius: 5px; background: linear-gradient(90deg, var(--haldi), var(--leaf), var(--sindoor)); transition: width .3s; }
.side-count { margin: 0 6px 10px; font-size: 13.5px; color: var(--muted); }
.side-stage { margin-top: 16px; }
.side-stage header { display: flex; align-items: center; gap: 9px; padding: 6px; }
.side-stage-name { display: flex; flex-direction: column; line-height: 1.15; font-size: 12.5px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.side-stage-name [lang="sa"] { font: 20px var(--deva); letter-spacing: 0; color: var(--sc-ink); }
.side-stage-count { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--sc-ink); background: var(--sc-soft); padding: 1px 8px; border-radius: 999px; }
.side-stage-count:empty { display: none; }
.sidenav ul { list-style: none; margin: 0; padding: 0; }
.side-stage ul { margin-left: 16px; padding-left: 0; border-left: 1.5px dotted color-mix(in srgb, var(--sc) 60%, transparent); }
.side-plain { margin-top: 6px; }
.sidenav li a { display: grid; grid-template-columns: 16px 1fr; column-gap: 9px; align-items: center; padding: 6px 8px; border-radius: 9px;
  color: var(--ink-2); text-decoration: none; }
.side-stage li a { margin-left: -9px; }
.sidenav li a small { grid-column: 2; color: var(--muted); font-size: 14px; }
.sidenav li a [lang="sa"] { font-size: 17.5px; }
.sidenav li a:hover { background: var(--surface-2); }
.sidenav li a.current { background: var(--sc-soft, var(--accent-soft)); color: var(--ink); font-weight: 600; }
.side-plain li a.current { background: var(--accent-soft); }
.tick { grid-row: span 2; width: 16px; height: 16px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--sc, var(--muted)) 70%, var(--line)); background: var(--bg); }
.side-plain .tick { --sc: var(--gold); }
/* opened: a dot in the ring; complete: filled */
a.visited .tick { background: radial-gradient(circle, var(--sc, var(--done)) 0 2.5px, var(--bg) 3px); }
a.done .tick { background: var(--sc, var(--done)); border-color: var(--sc, var(--done)); box-shadow: inset 0 0 0 3px var(--bg); }
/* a verse learned by heart wears a small gold bindu */
.sidenav li a[data-level="3"] .tick, .bead[data-level="3"], .path-steps a[data-level="3"] { position: relative; }
.sidenav li a[data-level="3"] .tick::after, .bead[data-level="3"]::after, .path-steps a[data-level="3"]::after {
  content: ""; position: absolute; top: -3px; right: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 2px var(--bg); }
a.current .tick { border-width: 2px; border-color: var(--sc, var(--accent)); }
.content { width: 100%; min-width: 0; max-width: 860px; padding: 34px 48px 64px; zoom: var(--zoom, 1); }
.has-player .content { padding-bottom: calc(var(--player-h) + 40px); }

/* stage chip and intro, at the top of every lesson */
.stage-chip { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 18px; padding: 4px 14px 4px 8px; border-radius: 999px;
  background: var(--sc-soft); color: var(--sc-ink); font: 600 14px var(--sans); }
.stage-chip [lang="sa"] { font-size: 16px; font-weight: 400; }
.stage-step { margin-left: 6px; padding-left: 10px; border-left: 1px solid color-mix(in srgb, var(--sc) 40%, transparent); font-weight: 500; color: var(--ink-2); }
.stage-intro { margin: -4px 0 26px; padding: 14px 18px; border-left: 4px solid var(--sc); border-radius: 0 14px 14px 0; background: var(--sc-soft); }
.stage-intro p { margin: 0; font-size: 20px; font-style: italic; color: var(--ink); }
.stage-intro.brief { cursor: pointer; padding: 8px 16px; }
.stage-intro.brief:not(.open) p { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; font-size: 17px; }
.sc-short { display: none; }

.eyebrow { font: 500 13px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 6px; }
.page-head h1, .page-hero h1 { font-size: clamp(36px, 5.4vw, 52px); margin: 0 0 12px; }
.h-deva { display: block; font-size: .7em; color: var(--sindoor); margin-bottom: 2px; }
.h-sub { display: block; font-size: .5em; font-style: italic; color: var(--ink-2); margin-top: 4px; }
/* a verse within a group page (long texts study several verses per page) */
.group-verse { font-size: 28px; margin: 56px 0 0; padding-top: 22px; border-top: 1px solid var(--line, rgba(0,0,0,.1)); scroll-margin-top: 80px; }
.group-verse span { font-style: italic; font-weight: 400; color: var(--ink-2); font-size: .8em; }
.group-verse + .speaker, .group-verse ~ .speaker { margin: 6px 0 -18px; }
.lede { font-size: 23px; line-height: 1.55; color: var(--ink-2); margin: 0 0 18px; }
.muted { color: var(--muted); } .small { font-size: 15px; }
.hint { font: 15px var(--sans); color: var(--muted); margin-top: 28px; }

/* overview */
.opening { margin: 24px 0; padding: 20px 24px; border-left: 4px solid var(--sindoor); background: var(--surface); border-radius: 0 14px 14px 0; box-shadow: var(--shadow); }
.opening p { margin: 0; }
.opening .deva { font-size: 31px; color: var(--sindoor); }
.opening .iast { font-style: italic; color: var(--ink-2); }
.opening .en { margin-top: 6px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 22px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--ink); font: 600 16px var(--sans); text-decoration: none; transition: transform .2s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background: linear-gradient(135deg, var(--sindoor), color-mix(in srgb, var(--sindoor) 70%, var(--marigold))); border-color: transparent;
  color: var(--sindoor-ink); box-shadow: 0 10px 26px -10px var(--sindoor); }
.btn [lang="sa"] { font-weight: 400; }
.path h2 { font-size: 34px; margin: 48px 0 4px; }
.path > p { margin: 0 0 18px; font: 16px var(--sans); }
.path-stages { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.path-stage { padding: 20px 22px; border-radius: 18px; background: var(--card); border: 1px solid var(--line); border-top: 4px solid var(--sc); box-shadow: var(--shadow); }
.path-stage header { display: flex; align-items: center; gap: 14px; }
.path-icon { width: 46px; height: 46px; display: grid; place-items: center; border-radius: 50%; background: var(--sc-soft); }
.path-icon .stage-icon { width: 28px; height: 28px; }
.path-deva { display: block; font-size: 26px; line-height: 1.2; color: var(--sc-ink); }
.path-name { display: block; font: 600 14px var(--sans); letter-spacing: .05em; color: var(--muted); }
.path-count { margin-left: auto; font: 600 13px var(--sans); color: var(--sc-ink); background: var(--sc-soft); padding: 3px 10px; border-radius: 999px; }
.path-count:empty { display: none; }
.path-intro { margin: 12px 0 14px; font-size: 19px; color: var(--ink-2); }
.path-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.path-steps a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 13px 6px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); text-decoration: none; font: 500 15px var(--sans); }
.path-steps a:hover { border-color: var(--sc); }
.path-steps a [lang="sa"] { font-size: 16px; }
.path-steps .tick { width: 14px; height: 14px; }
.path-label { align-self: center; font: 600 13px var(--sans); color: var(--muted); letter-spacing: .04em; margin-left: 4px; }
.path-steps a.is-verse { width: 36px; height: 36px; padding: 0; justify-content: center; border-color: color-mix(in srgb, var(--sc) 50%, var(--line)); }
.path-steps a.is-verse [lang="sa"] { font-size: 18px; padding-top: 2px; }
.path-steps a.is-verse.visited { border-width: 2px; border-color: var(--sc); }
.path-steps a.is-verse.done { background: var(--sc); border-color: var(--sc); color: var(--sc-on); }
.prose h2 { font-size: 33px; margin: 44px 0 10px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 18px; }
.prose td, .prose th { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose .source { font-size: 15px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 14px; margin-top: 32px; }
.takeaways h2 { font-size: 33px; margin: 52px 0 18px; }
.take-grid { list-style: none; counter-reset: t; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.take-grid li { counter-increment: t; position: relative; padding: 18px 18px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.take-grid li::before { content: counter(t, devanagari); position: absolute; top: 12px; right: 16px; font: 28px var(--deva); color: color-mix(in srgb, var(--gold) 55%, transparent); }
.take-grid h3 { margin: 0 0 6px; font-size: 22px; padding-right: 30px; }
.take-grid p { margin: 0; font-size: 18px; line-height: 1.6; color: var(--ink-2); }

/* script switch */
.script-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; padding: 3px; background: var(--surface); font: 15px var(--sans); }
.script-switch button { border: 0; background: none; padding: 6px 15px; border-radius: 999px; cursor: pointer; color: var(--ink-2); }
.script-switch button[lang="sa"] { font-family: var(--deva); }
.script-switch button.on { background: var(--sindoor); color: var(--sindoor-ink); }
[data-script="deva"] .script-iast, [data-script="iast"] .script-deva,
[data-script="deva"] .memo-iast, [data-script="iast"] .memo-deva { display: none; }
[data-hide~="translation"] .blk-translation, [data-hide~="translation"] .spoken.translation,
[data-hide~="padapatha"] .blk-padapatha, [data-hide~="interp"] .blk-interp, [data-hide~="interp"] .spoken.interp { display: none; }

/* track blocks */
.block { margin: 34px 0; }
.block-label { font: 600 14px var(--sans); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 12px; }
.block-label a { color: inherit; text-decoration: none; } .block-label a:hover { color: var(--accent); }
.block-label span { text-transform: none; letter-spacing: 0; font: italic 18px var(--serif); }
.verse-block { position: relative; padding: 24px 26px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.verse-block::before { content: ""; position: absolute; inset: 7px; border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 13px; pointer-events: none; }
.verse-text .vline { margin: 0; border-radius: 10px; transition: background-color .2s, box-shadow .2s; -webkit-touch-callout: none; }
.script-deva .vline { overflow-wrap: anywhere; }
.vline.looping { box-shadow: -10px 0 0 color-mix(in srgb, var(--leaf) 22%, transparent), 10px 0 0 color-mix(in srgb, var(--leaf) 22%, transparent); background: color-mix(in srgb, var(--leaf) 22%, transparent); }
.vline.your-turn { background: color-mix(in srgb, var(--haldi) 30%, transparent); box-shadow: -10px 0 0 color-mix(in srgb, var(--haldi) 30%, transparent), 10px 0 0 color-mix(in srgb, var(--haldi) 30%, transparent); }
.script-deva { font-size: 32px; line-height: 1.8; }
.script-iast { font-size: 21px; font-style: italic; color: var(--ink-2); margin-top: 12px; }
[data-script="iast"] .script-iast { margin-top: 0; font-size: 25px; color: var(--ink); }
.big .script-deva { font-size: 34px; }
.danda { color: var(--sindoor); }
.spoken { margin: 14px 0 0; }
.spoken.translation { font-size: 23px; line-height: 1.6; }
.spoken.interp { color: var(--ink-2); }
.prose-block .spoken { color: var(--ink); }
.verse-quote { font-style: italic; color: var(--muted); margin: 0 0 4px; }
.w, .dw { border-radius: 5px; transition: background-color .12s, color .12s; cursor: pointer; padding: 1px 0; }
.w:hover, .dw:hover { background: var(--surface-2); }
.w.on, .dw.on { background: var(--hl); color: var(--hl-ink); box-shadow: 0 0 0 3px var(--hl); }
.w.picked, .dw.picked { box-shadow: 0 0 0 2px var(--sindoor); }
.w.read { color: inherit; }
.sw:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* padapatha */
.padapatha { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 10px; }
.pp-break { grid-column: 1 / -1; height: 4px; }
.pp { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; text-align: left; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; transition: background .12s, border-color .12s; }
.pp:hover { border-color: var(--leaf); }
.pp.on { background: var(--hl); border-color: var(--hl); color: var(--hl-ink); }
.pp-word { font-family: var(--serif); font-style: italic; font-size: 20px; }
.pp-parts { font: italic 16px var(--serif); color: var(--sindoor); }
.pp.on .pp-parts { color: var(--hl-ink); }
.pp-mean { font: 16px/1.4 var(--sans); color: var(--ink-2); }
.pp.on .pp-mean { color: var(--hl-ink); }

/* glossary */
.filter { width: 100%; max-width: 360px; padding: 10px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: 16px var(--sans); }
.glossary { display: grid; gap: 10px; margin: 24px 0; }
.g-item { padding: 14px 18px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.g-item dt { display: flex; align-items: baseline; gap: 12px; }
.g-iast { font-style: italic; font-size: 23px; }
.g-deva { font-size: 25px; color: var(--sindoor); }
.g-item dd { margin: 4px 0 0; color: var(--ink-2); font-size: 19px; line-height: 1.6; }

.g-hear { width: 34px; height: 34px; margin-left: auto; flex: none; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line);
  background: var(--bg); color: var(--sindoor); cursor: pointer; }
.g-hear .i { width: 16px; height: 16px; }
.g-hear.playing { background: var(--sindoor); color: var(--sindoor-ink); border-color: var(--sindoor); }
.g-item dt { align-items: center; }

/* one-time tip */
.tip { position: relative; display: flex; align-items: center; gap: 12px; margin: -18px 0 30px; padding: 12px 14px 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--bg); font: 15.5px/1.45 var(--sans); box-shadow: var(--shadow); }
.tip::before { content: ""; position: absolute; top: -7px; left: 28px; border: 7px solid transparent; border-top: 0; border-bottom-color: var(--ink); }
.tip p { margin: 0; flex: 1; }
.tip .chip { background: var(--bg); color: var(--ink); border: 0; }
/* swiping to the next verse */
.content.swipe-next { transform: translateX(-24px); opacity: .4; transition: transform .18s, opacity .18s; }
.content.swipe-prev { transform: translateX(24px); opacity: .4; transition: transform .18s, opacity .18s; }

/* quiz */
.quiz { padding-left: 22px; }
.q { margin: 0 0 28px; }
.q-text { font-weight: 500; margin: 0 0 12px; font-size: 22px; line-height: 1.45; }
.q-opts { display: grid; gap: 8px; }
.q-opt { text-align: left; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: 19px/1.45 var(--serif); }
.q-opt:hover:not(:disabled) { border-color: var(--accent); }
.q-opt.right { background: color-mix(in srgb, var(--done) 18%, var(--surface)); border-color: var(--done); }
.q-opt.wrong { background: color-mix(in srgb, #c0392b 14%, var(--surface)); border-color: #c0392b; }
.q-opt:disabled { cursor: default; }
.q-why { margin: 10px 0 0; padding: 12px 16px; border-radius: 12px; background: var(--surface-2); font-size: 18px; line-height: 1.55; }
.quiz-end { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.quiz-score { flex: 1 1 260px; margin: 0; font: 600 18px var(--sans); padding: 16px 20px; border-radius: 14px; background: var(--accent-soft); }
.quiz-best { margin: -8px 0 0; font: 600 15px var(--sans); color: var(--leaf); }

/* end of step */
.endcard { display: grid; gap: 12px; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); font-family: var(--sans); }
.end-status { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 15px; color: var(--muted); }
.end-check { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 2px dashed color-mix(in srgb, var(--sc, var(--gold)) 70%, var(--line)); }
.endcard.is-done .end-status { color: var(--sc-ink, var(--leaf)); font-weight: 600; }
.endcard.is-done .end-check { border: 0; background: var(--sc, var(--leaf)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 15px no-repeat; animation: pop .4s ease; }
@keyframes pop { 50% { transform: scale(1.25); } }
.end-next { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 14px; padding: 16px 20px; border-radius: 18px; text-decoration: none; color: var(--ink);
  background: var(--sc-soft, var(--accent-soft)); border: 1.5px solid var(--sc, var(--sindoor)); transition: transform .2s; }
.end-next:hover { transform: translateY(-2px); }
.end-next small { font: 600 12.5px var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--sc-ink, var(--sindoor)); }
.end-next small [lang="sa"] { font-size: 15px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.end-title { grid-column: 1; font: 22px/1.3 var(--serif); }
.end-title em { color: var(--ink-2); font-size: .85em; }
.end-arrow { grid-row: 1 / span 2; grid-column: 2; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%;
  background: var(--sc, var(--sindoor)); color: var(--sc-on, var(--sindoor-ink)); font-size: 22px; }
.end-prev { justify-self: start; font-size: 15px; color: var(--muted); text-decoration: none; padding: 4px 2px; }
.end-prev:hover { color: var(--ink); }

/* buttons and controls shared by the panels */
.tbtn { flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; border: 0; background: none; cursor: pointer; color: var(--ink-2); }
.tbtn:hover { background: var(--surface-2); }
.tbtn:disabled { opacity: .3; cursor: default; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.i .fill { fill: currentColor; }
.btn .i { width: 18px; height: 18px; }
.chip .i { width: 14px; height: 14px; vertical-align: -2px; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font: inherit; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 3px; border-radius: 14px; background: var(--surface-2); }
.seg button { border: 1.5px solid transparent; background: none; padding: 7px 13px; border-radius: 11px; cursor: pointer; font: 500 14.5px var(--sans); color: var(--ink-2);
  transition: background-color .15s, color .15s, transform .1s; }
/* one choice of several: filled sindoor, plain to see by day or night */
.seg button.on { background: var(--sindoor); color: var(--sindoor-ink); font-weight: 600; }
/* on / off parts: on is outlined in leaf with a tick, off is struck through */
#ps-parts button, #aa-show button { border-color: color-mix(in srgb, var(--muted) 40%, transparent); }
#ps-parts button[aria-pressed="true"], #aa-show button[aria-pressed="true"] { background: color-mix(in srgb, var(--leaf) 20%, var(--card)); border-color: var(--leaf); color: var(--ink); font-weight: 600; }
#ps-parts button[aria-pressed="true"]::before, #aa-show button[aria-pressed="true"]::before { content: "✓ "; color: var(--leaf); }
#ps-parts button[aria-pressed="false"], #aa-show button[aria-pressed="false"] { text-decoration: line-through; color: var(--muted); }
.switch { flex: none; width: 46px; height: 28px; border-radius: 999px; border: 0; padding: 0; background: color-mix(in srgb, var(--muted) 55%, transparent); position: relative; cursor: pointer; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .2s; }
.switch[aria-checked="true"] { background: var(--leaf); }
.switch[aria-checked="true"]::after { transform: translateX(18px); }
.ps-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.ps-row:first-of-type { border-top: 0; }
.ps-label { display: flex; flex-direction: column; font: 600 15px var(--sans); color: var(--ink); }
.ps-label small { font-weight: 400; font-size: 13px; color: var(--muted); line-height: 1.35; margin-top: 2px; max-width: 34ch; }
.head-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.btn.small-btn { padding: 7px 14px; font-size: 14.5px; }

/* reading settings */
.aa-btn span { font: 600 16px var(--serif); color: var(--ink-2); }
.aa { position: fixed; z-index: 60; top: calc(var(--top-h) + 8px); right: 12px; width: min(420px, calc(100vw - 24px)); padding: 6px 18px;
  border-radius: 18px; background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); font-family: var(--sans); }
.aa .script-switch { flex-wrap: wrap; }
.aa-size { display: flex; align-items: center; gap: 6px; }
.aa-size .tbtn { width: 32px; height: 32px; font: 600 13px var(--serif); }
.aa-size .tbtn.big { font-size: 20px; }
.aa-size input { width: 120px; accent-color: var(--sindoor); }

/* word card */
.wcard { position: fixed; z-index: 55; width: 300px; padding: 14px 16px 12px; border-radius: 16px; background: var(--card); border: 1px solid var(--line);
  box-shadow: var(--shadow); font-family: var(--sans); }
.wcard p { margin: 0; }
.wc-word { font: italic 24px var(--serif); color: var(--sindoor); }
.wc-parts { font: italic 17px var(--serif); color: var(--ink-2); }
.wc-mean { margin-top: 4px !important; font-size: 16px; line-height: 1.45; color: var(--ink); }
.wc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.wcard.sheet { left: 8px !important; right: 8px; width: auto; bottom: calc(var(--player-h) + 10px); top: auto !important; }
body:not(.has-player) .wcard.sheet { bottom: 12px; }

/* memorise */
.memo { position: fixed; inset: 0; z-index: 70; display: flex; flex-direction: column; background: var(--bg); }
.memo-open { overflow: hidden; }
.memo-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); font-family: var(--sans); }
.memo-title { font: 600 16px var(--sans); margin-right: auto; }
.memo-stage { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px 20px; text-align: center; overflow-y: auto; }
.memo-count { font: 600 13px var(--sans); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; margin: 0 0 18px; }
.memo-line { max-width: 900px; }
.memo-deva { margin: 0; font: 46px/1.7 var(--deva); overflow-wrap: anywhere; }
.memo-iast { margin: 10px 0 0; font: italic 26px/1.6 var(--serif); color: var(--ink-2); }
[data-script="iast"] .memo-iast { font-size: 36px; color: var(--ink); margin: 0; }
.m-word { display: inline-block; white-space: nowrap; margin-right: .18em; }
.m-blank { display: inline-block; height: .12em; vertical-align: .12em; margin-left: .06em; border-radius: 2px; background: color-mix(in srgb, var(--gold) 70%, transparent); }
.memo-line.revealed .m-word { color: var(--leaf); }
.memo-hint { margin: 26px 0 0; font: 15px var(--sans); color: var(--muted); }
.memo-foot { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.memo-foot .tbtn { width: 52px; height: 52px; border: 1px solid var(--line); }
#memo-reveal { touch-action: none; user-select: none; -webkit-user-select: none; min-width: 120px; justify-content: center; }

/* stage complete */
.diya-done { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 20px; background: rgba(20, 10, 0, .55); }
.diya-card { width: min(420px, 100%); padding: 28px 26px 22px; border-radius: 24px; text-align: center; background: var(--card); box-shadow: var(--shadow);
  transform: translateY(16px) scale(.97); opacity: 0; transition: transform .45s ease, opacity .45s ease; }
.diya-done.lit .diya-card { transform: none; opacity: 1; }
.diya { width: 120px; height: 120px; }
.diya .bowl { fill: var(--sindoor); } .diya .rim { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.diya .flame { fill: var(--marigold); transform-origin: 60px 56px; transform: scale(0); transition: transform .8s cubic-bezier(.3, 1.6, .5, 1) .35s; filter: drop-shadow(0 0 10px var(--glow)); }
.diya .flame-in { fill: #ffe9a8; transform-origin: 60px 56px; transform: scale(0); transition: transform .8s ease .55s; }
.diya-done.lit .flame, .diya-done.lit .flame-in { transform: scale(1); animation: flicker 2.4s ease-in-out 1.4s infinite; }
@keyframes flicker { 50% { transform: scale(.94, 1.05); } }
.diya-stage { margin: 6px 0 0; font-size: 26px; color: var(--sindoor); }
.diya-card h2 { margin: 2px 0 8px; font-size: 30px; }
.diya-card p { font-size: 18px; color: var(--ink-2); margin: 0 0 18px; }
.diya-card .btn { width: 100%; justify-content: center; }
.diya-card .linkish { margin-top: 12px; font-size: 15px; color: var(--muted); }
.toast { position: fixed; z-index: 90; left: 50%; bottom: calc(var(--player-h) + 18px); transform: translateX(-50%); max-width: calc(100vw - 32px);
  padding: 10px 18px; border-radius: 14px; background: var(--ink); color: var(--bg); font: 15px var(--sans); box-shadow: var(--shadow); }
body:not(.has-player) .toast { bottom: 24px; }

/* verse page: your reflection and how well you know it */
.note-prompt { display: block; font-size: 19px; color: var(--ink-2); margin-bottom: 10px; }
.note { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 19px/1.6 var(--serif); resize: vertical; }
.note:focus { outline: 2px solid color-mix(in srgb, var(--leaf) 60%, transparent); border-color: var(--leaf); }
.note-saved { margin: 6px 0 0; min-height: 1.2em; font-family: var(--sans); }
.levels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.levels button { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px 14px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: 600 16px var(--sans); color: var(--ink); }
.levels small { font-weight: 400; font-size: 13.5px; color: var(--muted); }
.lv-dot { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--leaf); margin-bottom: 4px; }
.levels button.on { border-color: var(--leaf); background: color-mix(in srgb, var(--leaf) 12%, var(--surface)); }
.levels button.on .lv-dot { background: var(--leaf); }
.levels li:last-child button.on { border-color: var(--gold); background: color-mix(in srgb, var(--gold) 16%, var(--surface)); }
.levels li:last-child button.on .lv-dot { background: var(--gold); border-color: var(--gold); }

/* overview: today's practice, reflections, offline */
.review { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; max-width: 560px; margin: 4px 0 8px; padding: 14px 16px;
  border-radius: 16px; background: var(--s-soft, color-mix(in srgb, var(--haldi) 14%, var(--card))); border: 1px solid color-mix(in srgb, var(--haldi) 50%, var(--line));
  color: var(--ink); text-decoration: none; font-family: var(--sans); --sc: var(--haldi); --sc-ink: color-mix(in srgb, var(--haldi) 72%, var(--ink)); }
.review-icon { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--card); }
.review-text { display: flex; flex-direction: column; line-height: 1.3; }
.review-text small { font: 600 12px var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--sc-ink); }
#review-title { font: 20px var(--serif); }
.review-why { font-size: 14px; color: var(--muted); }
.review .end-arrow { --sc: var(--haldi); --sc-on: #2a1a10; width: 36px; height: 36px; font-size: 18px; grid-row: auto; grid-column: auto; }
.review.calm .end-arrow { display: none; }
.reflections h2, .offline h2 { font-size: 30px; margin: 48px 0 4px; }
.refl-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 10px; }
.refl-list li { padding: 14px 18px; border-radius: 14px; background: var(--surface); border-left: 4px solid var(--leaf); }
.refl-list a { font: 600 15px var(--sans); color: var(--leaf); text-decoration: none; }
.refl-list p { margin: 4px 0 0; font-size: 19px; white-space: pre-wrap; }
.offline { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px 24px; margin-top: 48px; padding: 4px 22px 22px;
  border-radius: 18px; border: 1px dashed color-mix(in srgb, var(--peacock) 60%, var(--line)); }
.offline > div { flex: 1 1 320px; }
.offline h2 { margin-top: 18px; color: var(--peacock); }
.offline p { margin: 6px 0 0; font-size: 18px; color: var(--ink-2); }
.offline.saved { border-style: solid; background: color-mix(in srgb, var(--peacock) 7%, transparent); }
.offline-bar { height: 6px; margin-top: 12px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.offline-bar span { display: block; height: 100%; width: 0; background: var(--peacock); transition: width .2s; }
.offline .btn:disabled { opacity: .7; }

/* player */
.player { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 30px -12px rgba(60, 30, 10, .3); font-family: var(--sans); }
.player::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: linear-gradient(90deg, var(--haldi), var(--marigold), var(--sindoor)); opacity: .8; }
.player-row { display: flex; align-items: center; gap: 14px; max-width: 1100px; margin: 0 auto; }
.play { flex: none; width: 52px; height: 52px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, var(--marigold), var(--sindoor)); box-shadow: 0 8px 20px -8px var(--sindoor); }
.play svg { width: 26px; height: 26px; fill: var(--sindoor-ink); }
.play .i-pause, .playing .play .i-play { display: none; }
.playing .play .i-pause { display: block; }
.bar-wrap { flex: 1; min-width: 0; }
.section-label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); margin-bottom: 6px; white-space: nowrap; min-width: 0; }
#section-label { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.badges { display: flex; gap: 4px; overflow: hidden; flex: 0 1 auto; }
.badges span { padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; line-height: 18px; color: var(--sc-ink, var(--leaf)); background: color-mix(in srgb, var(--leaf) 14%, var(--card)); color: var(--leaf); }
.loading .play { animation: breathe 1s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .55; } }
.player .tbtn.more { border: 1px solid var(--line); }
.player .tbtn.more[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent); }
.turn, .resume, .upnext { display: flex; align-items: center; justify-content: center; gap: 10px; max-width: 1100px; margin: 0 auto 8px; font-size: 15px; color: var(--ink-2); }
.turn { color: var(--ink); font-weight: 600; }
.turn-ring, .upnext-ring svg { width: 28px; height: 28px; flex: none; transform: rotate(-90deg); }
.turn-ring circle, .upnext-ring circle { fill: none; stroke: var(--surface-2); stroke-width: 4; }
#turn-arc, #upnext-arc { stroke: var(--haldi); stroke-dasharray: 100; stroke-dashoffset: 0; stroke-linecap: round; }
#upnext-arc { stroke: var(--sindoor); }
.upnext-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.upnext-text small { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
#upnext-title { font: 17px var(--serif); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.psheet { max-width: 640px; margin: 10px auto 2px; padding: 4px 4px 2px; max-height: min(70vh, 560px); overflow-y: auto; }
.ps-head { display: flex; align-items: center; justify-content: space-between; font: 600 16px var(--sans); padding-bottom: 4px; }
.bar { position: relative; height: 8px; border-radius: 8px; background: var(--surface-2); cursor: pointer; touch-action: none; }
.bar-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 8px; background: linear-gradient(90deg, var(--haldi), var(--sindoor)); }
.tick-mark { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--muted); opacity: .45; border-radius: 1px; }
.time { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.time-left { display: none; margin-left: auto; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.chapters { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chapter { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 5px 12px; font: 500 14px var(--sans); color: var(--ink-2); cursor: pointer; }
.chapter.now { background: var(--sindoor); border-color: var(--sindoor); color: var(--sindoor-ink); }
.ps-chapters { flex-wrap: wrap; }
.chip { flex: none; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--ink); }
.player > .now { display: flex; gap: 10px; align-items: baseline; justify-content: center; max-width: 1100px; margin: 0 auto 6px; font-size: 15px; }
.now-word { font: italic 20px var(--serif); color: var(--sindoor); }
.now-meaning { color: var(--ink-2); }

/* the practice settings: choices of several fill the row under their label */
.psheet .ps-row:has(.seg), .psheet .ps-chapters { flex-direction: column; align-items: stretch; gap: 8px; flex-wrap: nowrap; }
.psheet .seg { display: flex; }
.psheet .seg button { flex: 1 0 auto; padding-inline: 8px; white-space: nowrap; }
.psheet .chapters { justify-content: flex-start; }
.psheet .ps-label small { max-width: none; }
@keyframes pop { from { opacity: 0; transform: translateY(8px); } }

/* wide screens: the player sits under the reading column, and its settings open as a card just above their button */
@media (min-width: 901px) {
  .player { left: var(--nav-w); padding-inline: 48px; }
  .player-row, .player > .now, .turn, .resume, .upnext { max-width: 900px; margin-left: 0; }
  .has-player .sidenav { height: calc(100vh - var(--top-h)); }
  .psheet { position: absolute; bottom: calc(100% + 12px); left: calc(48px + min(100% - 96px, 900px) - 400px); width: 400px; margin: 0;
    max-height: calc(100vh - var(--top-h) - var(--player-h) - 36px); padding: 6px 20px 12px; border-radius: 18px;
    background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); animation: pop .16s ease-out; overscroll-behavior: contain; }
}
@media (min-width: 901px) and (max-width: 1180px) { .player .wide-only { display: none; } }

/* ── small screens: the rail replaces the sidebar; the sidebar becomes a drawer ── */
@media (max-width: 900px) {
  :root { --rail-h: 52px; }
  /* the top bar and rail slide away while you read down, and come back when you scroll up */
  .topbar, .rail { transition: transform .25s ease; }
  .chrome-hidden .topbar, .chrome-hidden .rail { transform: translateY(calc(-1 * (var(--top-h) + var(--rail-h)))); }
  .time-left { display: inline; }
  .course { grid-template-columns: minmax(0, 1fr); }
  #nav-toggle { display: grid; }
  .rail { display: block; position: sticky; top: var(--top-h); z-index: 39; height: var(--rail-h); overflow-x: auto; overflow-y: hidden;
    background: var(--bg); border-bottom: 1px solid var(--line); scrollbar-width: none; scroll-behavior: smooth; }
  .rail::-webkit-scrollbar { display: none; }
  .rail ol { display: flex; align-items: center; gap: 6px; width: max-content; height: 100%; margin: 0; padding: 0 14px; list-style: none;
    background: linear-gradient(color-mix(in srgb, var(--gold) 55%, transparent), color-mix(in srgb, var(--gold) 55%, transparent)) 0 50% / 100% 1px no-repeat; }
  .rail-stage { display: flex; align-items: center; gap: 5px; margin-left: 10px; padding: 3px 10px 3px 6px; border-radius: 999px;
    background: var(--bg); color: var(--sc-ink); font-size: 15px; white-space: nowrap; }
  .rail-stage .stage-icon { width: 18px; height: 18px; }
  .bead { display: grid; place-items: center; height: 34px; min-width: 34px; padding: 0 13px; border-radius: 999px; white-space: nowrap;
    border: 1.5px solid color-mix(in srgb, var(--sc) 55%, var(--line)); background: var(--card); color: var(--ink-2);
    font: 600 14px var(--sans); text-decoration: none; }
  .bead.verse { padding: 0; width: 34px; }
  .bead.verse [lang="sa"] { font-size: 17px; font-weight: 400; line-height: 1; padding-top: 2px; }
  .bead.visited { background: var(--sc-soft); border-color: var(--sc); color: var(--ink); }
  .bead.current { background: var(--sc); border-color: var(--sc); color: var(--sc-on); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sc) 30%, transparent); }
  .sidenav { position: fixed; top: calc(var(--top-h) + var(--rail-h)); left: 0; bottom: 0; height: auto; z-index: 45; width: min(330px, 88vw);
    transform: translateX(-102%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .has-player .sidenav { height: auto; bottom: var(--player-h); }
  .nav-open .sidenav { transform: none; }
  .nav-open::after { content: ""; position: fixed; inset: 0; z-index: 44; background: rgba(20, 10, 0, .35); }
  .content { padding: 22px 18px 48px; }
  body { font-size: 20px; }
  .lede { font-size: 21px; }
  .verse-block { padding: 20px 18px; }
  .script-deva { font-size: 26px; } .big .script-deva { font-size: 28px; }
  .script-iast { font-size: 20px; }
  .padapatha { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .time, .wide-only { display: none; }
  .player-row { gap: 6px; }
  .play { width: 48px; height: 48px; }
  .levels { grid-template-columns: 1fr; }
  .levels button { flex-direction: row; align-items: center; flex-wrap: wrap; column-gap: 10px; }
  .levels small { flex-basis: 100%; padding-left: 28px; margin-top: -2px; }
  .lv-dot { margin-bottom: 0; }
  .memo-deva { font-size: 32px; } .memo-iast { font-size: 21px; }
  [data-script="iast"] .memo-iast { font-size: 27px; }
  .memo-head .seg button { padding: 6px 9px; font-size: 13px; }
  .memo-title { display: none; }
  .ps-row { flex-wrap: wrap; }
  .ps-row:has(.switch) { flex-wrap: nowrap; }
  .ps-label small { max-width: none; }
}
@media (max-width: 560px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar .lockup { display: none; }
  .topbar .logo { display: block; }
  .crumb { padding-left: 10px; }
  .end-title { font-size: 20px; }
  .sc-name, .sc-long { display: none; }
  .sc-short { display: inline; }
  .stage-chip [lang="sa"] { margin-right: 2px; }
  .page-head h1 { font-size: 34px; }
  .page-head .lede { font-size: 18px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; cursor: pointer; }
  .page-head .lede.open { display: block; }
  .head-tools .bl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .head-tools .small-btn { width: 40px; height: 40px; padding: 0; justify-content: center; }
  .stage-intro { margin-bottom: 18px; }
  .script-deva { font-size: 24px; } .big .script-deva { font-size: 26px; }
}
@media (max-width: 420px) { body { font-size: 19px; } .big .script-deva { font-size: 24px; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
