/* The Bhagavad Gita, First-Hand — Shloka Lab
   Colours, type, spacing and shapes from the Whiz.Life design system (tokens v2), as in the Glossary.
   Each layer has its own accent so the learner always knows which layer she is in.
   Colour is never the only signal: every layer is also named and numbered. */

:root {
  --primary: #106b75;
  --primary-hover: #0d565f;
  --on-primary: #ffffff;
  --ink: #14253c;
  --navy: #0f1b2e;
  --steel: #365c83;
  --mint: #cbe5e1;
  --surface: #f4f8fa;
  --bg: #ffffff;
  --line: #dde5ea;
  --muted: #5b6678;
  --focus-ring: #106b75;
  --on-accent: #ffffff;   /* text on a filled accent: white in light mode, navy in dark (v0.18) */
  --mask-bg: #f7fbfe;
  color-scheme: light dark;

  /* Layer accents: line colour and a pale tint of it. */
  --l-text: #14253c;        --l-text-tint: #eef1f5;
  --l-translation: #365c83; --l-translation-tint: #eaf0f6;
  --l-commentary: #106b75;  --l-commentary-tint: #e5f2f0;
  --l-synthesis: #2f6fa3;   --l-synthesis-tint: #e6f1fb;   /* the editors' own voice: a lighter blue from the steel family, set apart from the teachers' teal */
  --l-you: #5b6678;         --l-you-tint: #ffffff;

  --ok: #1f7a4d; --ok-tint: #e9f5ee;
  --no: #a33a2f; --no-tint: #fbefed;

  --serif: "Lora", "Noto Serif", Georgia, serif;
  --sans: "Raleway", "Noto Sans", system-ui, sans-serif;
  --deva: "Noto Serif Devanagari", "Noto Sans Devanagari", serif;
  --iast: "Lora", "Noto Serif", Georgia, serif;

  --radius-sm: 12px;
  --radius-md: 30px;
  --radius-card: 16px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-size: 17px; line-height: 1.6; font-variant-numeric: lining-nums; }
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); text-decoration: underline; }
:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
button { font: inherit; color: inherit; }
p { margin: 0 0 12px; }
.dev { font-family: var(--deva); }
.iast { font-family: var(--iast); font-style: italic; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.overline { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.big { font-family: var(--serif); font-size: 21px; line-height: 1.45; }
.h1 { font-family: var(--serif); font-size: 28px; margin: 8px 0 12px; }
.h2 { font-family: var(--serif); font-size: 20px; font-weight: 700; margin: 28px 0 12px; }
.notice { margin: 24px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.notice.error { border-color: var(--no); background: var(--no-tint); }

.app { max-width: 1100px; margin: 0 auto; }

/* Header */
.top { padding: 20px 24px 12px; }
.where { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.top h1 { margin: 0; font-family: var(--serif); font-size: 26px; line-height: 1.3; }
.top h1 .overline { display: block; color: var(--primary); }

/* Steps */
.steps { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 8px 24px 0; }
.steps ol { list-style: none; display: flex; gap: 4px; margin: 0 0 6px; padding: 0; overflow-x: auto; scrollbar-width: thin; }
.st { position: relative; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 0; background: transparent; cursor: pointer; color: var(--muted); white-space: nowrap; font-size: 15px; }
.st .num { display: inline-flex; width: 26px; height: 26px; border-radius: 50%; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 1.5px solid currentColor; }
.st.seen { color: var(--ink); }
.st.on { color: var(--ink); font-weight: 700; }
.st.on .num { background: var(--primary); border-color: var(--primary); color: var(--on-accent); }
.st.on.ly-text .num { background: var(--l-text); border-color: var(--l-text); }
.st.on.ly-translation .num { background: var(--l-translation); border-color: var(--l-translation); }
.st.on.ly-commentary .num { background: var(--l-commentary); border-color: var(--l-commentary); }
.st.on.ly-synthesis .num { background: var(--l-synthesis); border-color: var(--l-synthesis); }
.st.on.ly-you .num { background: var(--l-you); border-color: var(--l-you); }
.bar { height: 3px; background: var(--line); margin: 0; border-radius: 2px; }
.bar span { display: block; height: 100%; background: var(--primary); transition: width .25s; }

main { padding: 20px 24px 8px; outline: none; }
section { margin-bottom: 8px; }

/* The layer reminder at the top of every layer */
.reminder { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; padding: 14px 18px; border-left: 5px solid; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: 0 0 24px; }
.reminder p { margin: 0; flex: 1 1 320px; font-size: 15px; }
.reminder .tag { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.reminder.ly-text { border-color: var(--l-text); background: var(--l-text-tint); } .reminder.ly-text .tag { color: var(--l-text); }
.reminder.ly-translation { border-color: var(--l-translation); background: var(--l-translation-tint); } .reminder.ly-translation .tag { color: var(--l-translation); }
.reminder.ly-commentary { border-color: var(--l-commentary); background: var(--l-commentary-tint); } .reminder.ly-commentary .tag { color: var(--l-commentary); }
.reminder.ly-synthesis { border-color: var(--l-synthesis); background: var(--l-synthesis-tint); } .reminder.ly-synthesis .tag { color: var(--l-synthesis); }
.reminder.ly-you { border: 2px dashed var(--l-you); border-left-width: 5px; border-left-style: solid; background: var(--l-you-tint); } .reminder.ly-you .tag { color: var(--l-you); }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 24px; border-radius: var(--radius-md); border: 1px solid var(--primary); background: var(--bg); color: var(--primary-hover); font-size: 16px; cursor: pointer; }
.btn:hover { background: var(--surface); }
.btn.filled { background: var(--primary); color: var(--on-primary); }
.btn.filled:hover { background: var(--primary-hover); }
.linkbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 20px; border: 1px solid var(--primary); border-radius: var(--radius-md); background: var(--bg); color: var(--primary-hover); font-size: 15px; }
.linkbtn:hover { background: var(--surface); text-decoration: none; }
.footnav { display: flex; justify-content: space-between; gap: 12px; padding: 20px 24px; border-top: 1px solid var(--line); margin-top: 24px; }
.foot { padding: 0 24px 28px; font-size: 13px; color: var(--muted); }

.two { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* Start */
.startgrid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 32px; align-items: start; }
.lylist { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.lycard { width: 100%; display: flex; gap: 14px; align-items: center; text-align: left; padding: 10px 16px; min-height: 56px; border: 1px solid var(--line); border-left: 5px solid; border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
.lycard:hover { background: var(--surface); }
.lycard .num { flex: 0 0 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: var(--on-accent); font-weight: 700; font-size: 14px; }
.lycard strong { display: block; } .lycard small { display: block; color: var(--muted); font-size: 14px; }
.lycard.ly-text { border-left-color: var(--l-text); } .lycard.ly-text .num { background: var(--l-text); }
.lycard.ly-translation { border-left-color: var(--l-translation); } .lycard.ly-translation .num { background: var(--l-translation); }
.lycard.ly-commentary { border-left-color: var(--l-commentary); } .lycard.ly-commentary .num { background: var(--l-commentary); }
.lycard.ly-synthesis { border-left-color: var(--l-synthesis); } .lycard.ly-synthesis .num { background: var(--l-synthesis); }
.lycard.ly-you { border-left-color: var(--l-you); } .lycard.ly-you .num { background: var(--l-you); }
.keep-apart { margin-top: 16px; font-weight: 600; }
.pic { margin: 0; }
.pic img { width: 100%; border-radius: var(--radius-card); }
.placeholder { aspect-ratio: 4 / 3; border: 2px dashed var(--line); border-radius: var(--radius-card); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 24px; text-align: center; color: var(--muted); }
.placeholder span { font-weight: 700; color: var(--ink); }
.placeholder small { font-size: 14px; max-width: 34ch; }
.pic figcaption { margin-top: 14px; font-family: var(--serif); font-size: 19px; line-height: 1.45; }

/* Text */
.versebox { text-align: center; padding: 28px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.versebox .dev { font-size: 26px; line-height: 1.8; margin-bottom: 14px; }
.versebox .iast { font-size: 19px; line-height: 1.7; color: var(--ink); }
.listen { margin-top: 20px; }
.listenhead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-bottom: 12px; }
.listenhead p { margin: 0; font-size: 14px; }
.frame { width: 100%; max-width: 560px; aspect-ratio: 16 / 9; min-height: 200px; min-width: 200px; background: var(--navy); border-radius: 8px; overflow: hidden; margin-bottom: 14px; }
.frame iframe { width: 100%; height: 100%; border: 0; display: block; }
.chips { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 44px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bg); font-family: var(--iast); font-style: italic; font-size: 17px; cursor: pointer; }
.chip:hover { border-color: var(--primary); }
.chip.on { background: var(--l-text); border-color: var(--l-text); color: var(--on-accent); }
.wordbox { padding: 18px 20px; border-radius: var(--radius-card); background: var(--l-text-tint); min-height: 92px; }
.wordbox.empty { display: flex; align-items: center; color: var(--muted); background: var(--surface); }
.wordbox.empty p { margin: 0; }
.wordbox .big { margin-bottom: 4px; }
.meaning { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.4; }
.keepcard { padding: 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--l-text); border-radius: var(--radius-card); }
.keepcard .big { margin-bottom: 6px; font-weight: 600; }
.sense { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 8px; padding: 0 18px; }
.sense summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font-size: 18px; }
.sense[open] summary { border-bottom: 1px solid var(--line); margin-bottom: 12px; }

/* Translation */
.toggle { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-md); padding: 4px; margin-bottom: 14px; }
.toggle button { min-height: 40px; padding: 0 18px; border: 0; border-radius: var(--radius-md); background: transparent; cursor: pointer; color: var(--muted); }
.toggle button[aria-pressed="true"] { background: var(--l-translation); color: var(--on-accent); font-weight: 600; }
.cmp { border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.cmprow { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr) minmax(0, 1fr); }
.cmprow > span { padding: 14px 16px; border-top: 1px solid var(--line); }
.cmprow > span + span { border-left: 1px solid var(--line); }
.cmprow.head > span { border-top: 0; background: var(--l-translation-tint); font-weight: 700; font-size: 14px; }
.cmprow.head small { display: block; font-weight: 400; color: var(--muted); }
.cmprow:not(.head):hover > span { background: var(--surface); }
.cmprow .iast { color: var(--l-text); }
.m { display: none; }
.saline { min-height: 32px; font-size: 18px; color: var(--l-text); margin: 4px 0 12px; }
.whole { padding: 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--l-translation); border-radius: var(--radius-card); }
.flow { font-family: var(--serif); font-size: 19px; line-height: 1.7; margin: 0; }
.ph { border-radius: 4px; padding: 1px 2px; cursor: pointer; transition: background .15s; }
.ph.hl { background: var(--mint); }
.note { margin-top: 20px; padding: 14px 18px; background: var(--surface); border-radius: var(--radius-sm); font-size: 15px; }

/* Commentary */
.teacher { padding: 20px 22px; border: 1px solid var(--line); border-top: 4px solid var(--l-commentary); border-radius: var(--radius-card); }
.who { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.avatar { flex: 0 0 56px; height: 56px; border-radius: 50%; background: var(--l-commentary-tint); color: var(--l-commentary); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; border: 1.5px dashed var(--l-commentary); }
.who p { margin: 0; }
.name { font-family: var(--serif); font-size: 19px; font-weight: 700; }
blockquote { margin: 0 0 14px; padding: 14px 16px; background: var(--l-commentary-tint); border-radius: var(--radius-sm); }
.keyline { font-family: var(--serif); font-size: 21px; font-weight: 600; margin: 0; line-height: 1.4; }
.related { margin-top: 24px; padding: 20px 22px; border: 1.5px solid var(--steel); border-radius: var(--radius-card); background: var(--surface); }
.related .h2 { margin-top: 0; }
.related .quote { font-family: var(--serif); font-size: 18px; }
.related dl { margin: 14px 0 0; font-size: 15px; }
.related dt { font-weight: 700; }
.related dd { margin: 0 0 8px; }

/* Synthesis */
.editors { color: var(--l-synthesis); }
.points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.pt { display: flex; gap: 14px; padding: 16px 20px; background: var(--l-synthesis-tint); border-radius: var(--radius-sm); }
.pt .num { flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--l-synthesis); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.pthead { font-family: var(--serif); font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.pt p:last-child { margin: 0; }
.stand { margin-top: 24px; padding: 20px 22px; border: 1.5px solid var(--l-synthesis); border-radius: var(--radius-card); }
.stand .h2 { margin-top: 0; }

/* Your judgment: practice */
.tally { font-weight: 700; }
.sortlist { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sortcard { padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--bg); }
.sortcard.good { border-color: var(--ok); }
.sortcard.bad { border-color: var(--no); }
.snip { font-family: var(--serif); font-size: 18px; min-height: 54px; }
.picks { display: flex; flex-wrap: wrap; gap: 6px; }
.pick { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: var(--radius-md); border: 1px solid var(--line); background: var(--bg); font-size: 14px; cursor: pointer; }
.pick::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.pick:hover { background: var(--surface); }
.pick.ly-text::before { background: var(--l-text); } .pick.ly-translation::before { background: var(--l-translation); }
.pick.ly-commentary::before { background: var(--l-commentary); } .pick.ly-synthesis::before { background: var(--l-synthesis); }
.pick.ly-you::before { background: var(--l-you); }
.pick.on::before { background: var(--bg); }
.pick.on { background: var(--ink); color: var(--bg); }
.fb { margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 15px; }
.fb.ok { background: var(--ok-tint); } .fb.ok strong { color: var(--ok); }
.fb.no { background: var(--no-tint); } .fb.no strong { color: var(--no); }

/* Done */
.done { max-width: 720px; }
.tick { width: 64px; height: 64px; border-radius: 50%; background: var(--primary); color: var(--on-accent); font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 8px 0 0; }
.done .carry { margin: 8px 0 20px; }
.nextup { padding: 14px 18px; background: var(--mint); border-radius: var(--radius-sm); font-weight: 600; }

/* Phones */
@media (max-width: 760px) {
  .top, main, .footnav, .foot { padding-left: 16px; padding-right: 16px; }
  .steps { padding: 6px 12px 0; }
  .st { padding: 0 8px; }
  .st:not(.on) .lbl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .two, .startgrid, .sortlist { grid-template-columns: 1fr; }
  .versebox .dev { font-size: 21px; }
  .versebox .iast { font-size: 17px; }
  .cmprow { grid-template-columns: 1fr; }
  .cmprow.head { display: none; }
  .cmprow > span + span { border-left: 0; border-top: 1px dashed var(--line); }
  .cmprow > span:first-child { border-top: 3px solid var(--l-translation-tint); background: var(--surface); }
  .m { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--l-translation); }
  .footnav .btn { padding: 0 16px; font-size: 15px; }
}

/* Course synthesis: two tabs (added v0.3) */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 1px solid var(--line); margin: 0 0 20px; }
.tabs button { border: 0; background: transparent; min-height: 48px; padding: 0 18px; font-size: 16px; color: var(--muted); border-bottom: 3px solid transparent; cursor: pointer; }
.tabs button[aria-selected="true"] { color: var(--l-synthesis); font-weight: 700; border-bottom-color: var(--l-synthesis); }
.dlcard { padding: 18px 20px; background: var(--l-synthesis-tint); border-radius: var(--radius-card); margin: 0; }
.dlcard .h2 { margin-top: 0; }
.signs { margin: 0 0 10px; padding-left: 20px; }
.signs li { margin-bottom: 6px; }
.turnline { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); margin: 0; }
.moments { border: 1px solid var(--line); border-radius: var(--radius-card); overflow: hidden; }
.mrow { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) minmax(0, 1fr); }
.mrow > span { padding: 14px 16px; border-top: 1px solid var(--line); font-size: 15px; }
.mrow > span + span { border-left: 1px solid var(--line); }
.mrow.head > span { border-top: 0; background: var(--l-synthesis-tint); font-weight: 700; font-size: 14px; }
.marea strong { display: block; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--l-synthesis); margin-bottom: 4px; }
.marea.work strong { color: var(--steel); }
.mdef { color: var(--muted); }
.mask { background: var(--mask-bg); }
.notask { margin: 0; padding-left: 20px; }
.notask li { margin-bottom: 8px; }
.carry { margin-top: 24px; padding: 22px 24px; border-radius: var(--radius-card); background: var(--l-synthesis); color: var(--on-accent); }
.carry .overline { color: var(--on-accent); opacity: .8; }
.carryline { font-family: var(--serif); font-size: 24px; font-weight: 600; margin: 0; line-height: 1.35; }
.week { margin-top: 20px; }

/* Your judgment: real-life cases (added v0.3) */
.cases { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.case { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-card); }
.caseq { font-family: var(--serif); font-size: 18px; }
.opts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.opt { width: 100%; display: flex; gap: 12px; align-items: flex-start; text-align: left; padding: 12px 14px; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; font-size: 16px; }
.opt:hover { background: var(--surface); }
.opt .letter { flex: 0 0 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--muted); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: var(--muted); }
.opt.good { border-color: var(--ok); background: var(--ok-tint); } .opt.good .letter { border-color: var(--ok); background: var(--ok); color: var(--on-accent); }
.opt.bad { border-color: var(--no); background: var(--no-tint); } .opt.bad .letter { border-color: var(--no); background: var(--no); color: var(--on-accent); }

@media (max-width: 760px) {
  .mrow { grid-template-columns: 1fr; }
  .mrow.head { display: none; }
  .mrow > span + span { border-left: 0; border-top: 1px dashed var(--line); }
  .mrow .m { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--l-synthesis); }
  .carryline { font-size: 20px; }
}

/* Space above a button that follows a box (v0.5) */
.btnrow { margin: 24px 0 8px; }

/* Source line at the bottom of a teacher's card (v0.6) */
.teacher { display: flex; flex-direction: column; }
.teacher .src { margin: auto 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.teacher .src strong { color: var(--ink); }
.teacher .src a { white-space: nowrap; }
@media (max-width: 760px) { .teacher .src a { white-space: normal; } }

/* A teacher's own words, as a timed clip (v0.7) */
.tclip { margin: 4px 0 16px; }
.tclip .btn { min-height: 44px; font-size: 15px; padding: 0 18px; }
.tclip .muted { margin: 6px 0 10px; }
.tclip .frame { max-width: 100%; }
.two > * { min-width: 0; }
.tclip .btn { white-space: normal; text-align: left; height: auto; padding: 10px 18px; line-height: 1.35; }
.related .tclip { margin: 8px 0 4px; }
.related .tclip .frame { max-width: 640px; }
.foot p { margin: 0 0 4px; }

/* Start with a picture (v0.12) */
.hero { max-width: 860px; margin: 0 auto 12px; }
.hero img { display: block; width: 100%; height: auto; }
.caps { display: grid; gap: 16px; margin-top: 10px; }
.caps p { margin: 0; font-size: 14px; color: var(--muted); text-align: center; }
.oneline { font-family: var(--serif); font-size: 21px; line-height: 1.45; margin: 8px 0 24px; }
.h2.first { margin-top: 0; }

/* Whiz.Life brand (v0.13) */
.brandbar { margin: 0 0 14px; line-height: 0; }
.brandbar .logo { height: 24px; width: auto; }
.wordmark { font-family: var(--serif); font-weight: 700; font-size: 20px; line-height: 1.2; }
.foot { border-top: 1px solid var(--line); padding-top: 18px; }
.foot .tagline { font-family: var(--serif); font-size: 17px; color: var(--ink); margin-bottom: 10px; }
.foot .tagline a { font-family: var(--sans); font-size: 13px; }
.foot .copy { margin-top: 8px; font-size: 12px; }
.footnav { border-top: 0; }

/* iPhone and iPad: an iframe can grow wider than its box, which crops the video in landscape.
   A 1px width with a 100% minimum keeps it exactly as wide as its frame (v0.14). */
.frame { max-width: min(560px, 100%); }
.tclip .frame { max-width: 100%; }
.related .tclip .frame { max-width: min(640px, 100%); }
.frame iframe { width: 1px; min-width: 100%; max-width: 100%; height: 100%; }

/* Source line under the chanting, and the glossary line as plain text (v0.16) */
.listen .src { margin: 4px 0 0; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.listen .src strong { color: var(--ink); }
.glossnote { margin: 8px 0 0; font-size: 15px; color: var(--l-text); font-weight: 600; }
.glossnote::before { content: "→ "; }

/* "Course Curators" and "Course translation" badges (v0.17) */
.badgeline { margin: 0 0 14px; }
.badge { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 12px; border-radius: 999px; line-height: 1.4; }
.badge.cc { background: var(--l-synthesis); color: var(--on-accent); }
.badge.ct { background: var(--l-translation-tint); color: var(--l-translation); border: 1px solid var(--l-translation); }

/* ---------- v0.18 ---------- */

/* Dark mode. The device's setting decides ("auto"), unless ?theme=light or ?theme=dark, or "theme" in site.json, fixes it.
   Because the page declares its own dark colours, phones and browsers no longer darken it by force. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  --primary: #5cc0c9; --primary-hover: #8ad6dc; --on-primary: #0f1724; --focus-ring: #8ad6dc;
  --ink: #e8eef5; --navy: #0a111c; --steel: #8fb0d3; --mint: #24504f;
  --surface: #162131; --bg: #0f1724; --line: #2b3b52; --muted: #a6b2c3;
  --on-accent: #0f1724; --mask-bg: #13243a;
  --l-text: #a9bdd8;        --l-text-tint: #18263a;
  --l-translation: #8db2d9; --l-translation-tint: #172a40;
  --l-commentary: #5cc0c9;  --l-commentary-tint: #12302f;
  --l-synthesis: #74b3ea;   --l-synthesis-tint: #142b42;
  --l-you: #b3bdcb;         --l-you-tint: #0f1724;
  --ok: #63d09a; --ok-tint: #12301f;
  --no: #f08a7e; --no-tint: #3a1c19;
  }
}
:root[data-theme="dark"] {
  --primary: #5cc0c9; --primary-hover: #8ad6dc; --on-primary: #0f1724; --focus-ring: #8ad6dc;
  --ink: #e8eef5; --navy: #0a111c; --steel: #8fb0d3; --mint: #24504f;
  --surface: #162131; --bg: #0f1724; --line: #2b3b52; --muted: #a6b2c3;
  --on-accent: #0f1724; --mask-bg: #13243a;
  --l-text: #a9bdd8;        --l-text-tint: #18263a;
  --l-translation: #8db2d9; --l-translation-tint: #172a40;
  --l-commentary: #5cc0c9;  --l-commentary-tint: #12302f;
  --l-synthesis: #74b3ea;   --l-synthesis-tint: #142b42;
  --l-you: #b3bdcb;         --l-you-tint: #0f1724;
  --ok: #63d09a; --ok-tint: #12301f;
  --no: #f08a7e; --no-tint: #3a1c19;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
.logo-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-light { display: none; }
  :root:not([data-theme="light"]) .logo-dark { display: inline; }
  :root:not([data-theme="light"]) .hero img, :root:not([data-theme="light"]) .pic img { filter: brightness(.86); border-radius: 10px; }
}
:root[data-theme="dark"] .logo-light { display: none; }
:root[data-theme="dark"] .logo-dark { display: inline; }
:root[data-theme="dark"] .hero img, :root[data-theme="dark"] .pic img { filter: brightness(.86); border-radius: 10px; }

/* More than one verse in a Lab */
.versebox + .listen { margin-bottom: 20px; }
.verse + .verse { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line); }
.vref { margin: 0 0 6px; font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--l-text); }
.vref.small { margin: 14px 0 6px; }
.cmprow.vhead > span { grid-column: 1 / -1; padding: 8px 16px; background: var(--l-translation-tint); font-size: 13px; font-weight: 700; letter-spacing: .06em; color: var(--l-translation); }
.vtag { display: inline-block; font-family: var(--sans); font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--l-translation); margin-right: 4px; }
.flow + .flow { margin-top: 12px; }
.between { margin-top: 20px; padding: 18px 20px; border-radius: var(--radius-card); background: var(--surface); }
.between .h2 { margin-top: 0; }

/* A slot for something still to come (shown only while "showPending" is true in site.json) */
.pending { margin: 8px 0 14px; padding: 10px 14px; border: 1.5px dashed var(--line); border-radius: var(--radius-sm); font-size: 14px; color: var(--muted); }

/* One teacher: the card spans the width */
.teachers.one { grid-template-columns: 1fr; }

/* A staircase of steps (2.62–63: the slide; 3.42: the order) */
.ladder { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ladder.up { flex-direction: column-reverse; }
.ladder li { margin-left: var(--off, 0); }
.rung { width: 100%; max-width: 520px; display: flex; align-items: center; gap: 12px; text-align: left; padding: 8px 14px; min-height: 48px; border: 1px solid var(--line); border-left: 4px solid var(--l-text); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
.rung:hover { background: var(--surface); }
.rung .num { flex: 0 0 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; border: 1.5px solid var(--l-text); color: var(--l-text); }
.rung .txt { flex: 1 1 auto; min-width: 0; }
.rung .en { font-weight: 600; }
.rung .iast { color: var(--muted); }
.rung.on { background: var(--l-text-tint); border-color: var(--l-text); }
.rung.on .num { background: var(--l-text); color: var(--on-accent); }
.rungbox { padding: 16px 20px; border-radius: var(--radius-card); background: var(--l-text-tint); min-height: 80px; }
.rungbox.empty { display: flex; align-items: center; color: var(--muted); background: var(--surface); }
.rungbox p:last-child { margin-bottom: 0; }
.rungbox .meaning .iast { font-size: 17px; font-weight: 400; color: var(--muted); }
@media (max-width: 760px) { .ladder li { margin-left: calc(var(--off, 0) * .5); } }

/* A parallel from research, inside Course synthesis */
.related.parallel { border-color: var(--l-synthesis); }
.done .lylist + .muted { margin-top: 12px; }
