/* Inside the GITA — styles */

@font-face { font-family: 'Tiro Devanagari Sanskrit'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/tiro-devanagari-sanskrit-devanagari-400-normal.woff2) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: 'Tiro Devanagari Sanskrit'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/tiro-devanagari-sanskrit-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Noto Serif Devanagari'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/noto-serif-devanagari-devanagari-400-normal.woff2) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: 'Noto Serif Devanagari'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/noto-serif-devanagari-devanagari-600-normal.woff2) format('woff2');
  unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/literata-latin-400-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 400; font-display: swap;
  src: url(../fonts/literata-latin-ext-400-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/literata-latin-400-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 400; font-display: swap;
  src: url(../fonts/literata-latin-ext-400-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/literata-latin-600-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: normal; font-weight: 600; font-display: swap;
  src: url(../fonts/literata-latin-ext-600-normal.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 600; font-display: swap;
  src: url(../fonts/literata-latin-600-italic.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Literata'; font-style: italic; font-weight: 600; font-display: swap;
  src: url(../fonts/literata-latin-ext-600-italic.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/inter-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 500; font-display: swap; src: url(../fonts/inter-latin-500-normal.woff2) format('woff2'); }
@font-face { font-family: 'Inter'; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/inter-latin-600-normal.woff2) format('woff2'); }

:root {
  --scale: 1;
  --device: 1; /* bigger screens get slightly larger text */
  --s: calc(var(--scale) * var(--device));
  --bg: #FBF8F1;
  --paper: #F4ECD8;
  --paper-glow: radial-gradient(ellipse at center, rgba(255, 252, 244, 0.55), rgba(232, 219, 190, 0.35));
  --ink: #2B2219;
  --ink-soft: #3D3227;
  --muted: #6B5D4F;
  --accent: #9C4A14;
  --rule: #CDBB98;
  --track: #DCCDAE;
  --tile: #FFFFFF;
  --tile-border: #E3D8C4;
  --tile-on: #FBE9D6;
  --sheet: #FBF8F1;
  --ui: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --serif: Literata, Georgia, 'Noto Serif', serif;
  --deva: 'Noto Serif Devanagari', 'Tiro Devanagari Sanskrit', 'Noto Sans Devanagari', serif;
  --sanskrit: 'Tiro Devanagari Sanskrit', 'Noto Serif Devanagari', serif;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}
:root[data-theme="light"] {
  --bg: #FFFFFF; --paper: #FFFFFF; --paper-glow: none; --ink: #1F1A15; --ink-soft: #2E2822; --muted: #6B6259;
  --rule: #E2DDD5; --track: #ECE8E1; --tile: #FFFFFF; --tile-border: #E6E1D8; --sheet: #FFFFFF;
}
:root[data-theme="dark"] {
  --bg: #15120F; --paper: #15120F; --paper-glow: none; --ink: #EDE4D3; --ink-soft: #CFC4B2; --muted: #A8998A;
  --accent: #E39A5E; --rule: #3A3129; --track: #2E2620; --tile: #221C17; --tile-border: #3A3129; --tile-on: #3A2817; --sheet: #1E1915;
}
:root[data-theme="dark"] .sa-box { background: rgba(227, 154, 94, .08); border-color: rgba(227, 154, 94, .22); }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--ui);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none; overflow: hidden;
}
button { font: inherit; color: inherit; cursor: pointer; }
a { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.screen {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  max-width: 560px; margin: 0 auto; background: var(--bg);
}
.screen[hidden] { display: none; }

/* ---------- Language screen ---------- */
#lang { padding: calc(40px + var(--safe-top)) 24px calc(24px + var(--safe-bottom)); }
.wordmark { margin: 0; font-family: var(--serif); font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
#lang h1 { margin: 8px 0 6px; font-family: var(--serif); font-size: 28px; font-weight: 600; line-height: 1.2; }
#lang .sub { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.45; }
.lang-grid {
  flex: 1 1 auto; min-height: 0; margin-top: 20px;
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(6, minmax(52px, 1fr)); gap: 10px;
}
.lang-tile {
  display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px;
  padding: 0 14px; border-radius: 12px; text-align: start;
  background: var(--tile); border: 1px solid var(--tile-border);
}
.lang-tile[aria-checked="true"] { background: var(--tile-on); border: 2px solid var(--accent); padding: 0 13px; }
.lang-tile .native { font-size: 20px; line-height: 1.35; }
.lang-tile .native.serif-latin { font-family: var(--serif); }
.lang-tile .native.serif-deva { font-family: var(--deva); }
.lang-tile .eng { font-size: 12px; color: var(--muted); }
.btn-primary {
  margin-top: 16px; height: 54px; border: 0; border-radius: 14px; flex-shrink: 0;
  background: var(--ink); color: var(--bg); font-size: 16px; font-weight: 600;
}

/* ---------- Title screen ---------- */
#title { text-align: center; overflow: hidden; }
.hero { position: relative; flex: 0 0 auto; height: min(58vh, 520px); overflow: hidden; }
.hero img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; filter: sepia(.35) contrast(.95); }
:root[data-theme="dark"] .hero img { filter: sepia(.35) contrast(.95) brightness(.85); }
.hero::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32%; background: linear-gradient(to bottom, transparent, var(--bg)); }
.title-body { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; padding: 0 28px calc(24px + var(--safe-bottom)); margin-top: -32px; position: relative; }
.title-body h1 { margin: 6px 0 0; font-family: var(--sanskrit); font-size: 38px; font-weight: 400; line-height: 1.3; }
.title-body .subtitle { margin: 0; font-family: var(--serif); font-style: italic; font-size: 18px; color: var(--muted); }
.title-body .intro { margin: 14px 0 0; font-family: var(--serif); font-size: 16px; line-height: 1.6; max-width: 34ch; }
.title-body .counts { margin: 10px 0 0; font-size: 14px; color: var(--muted); }
.title-body .spacer { flex: 1 1 auto; min-height: 16px; }
.begin { display: flex; flex-direction: column; align-items: center; gap: 6px; background: none; border: 0; color: var(--accent); font-size: 15px; font-weight: 600; padding: 8px 16px; }
.begin svg { animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hint-link { margin-top: 10px; background: none; border: 0; font-size: 13px; color: var(--muted); padding: 8px; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; }

/* ---------- Reader ---------- */
#reader { background: var(--paper); background-image: var(--paper-glow); user-select: none; -webkit-user-select: none; touch-action: none; }
.page {
  flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column;
  padding: calc(40px + var(--safe-top)) 24px 0;
  transition: opacity .22s ease, transform .26s cubic-bezier(.2, .8, .2, 1);
}
.page.out-up { opacity: 0; transform: translateY(-30%); }
.page.out-down { opacity: 0; transform: translateY(30%); }
.page.from-below { opacity: 0; transform: translateY(30%); transition: none; }
.page.from-above { opacity: 0; transform: translateY(-30%); transition: none; }
.speaker { margin: 0 0 6px; text-align: center; font-family: var(--sanskrit); font-size: calc(15px * var(--s)); color: var(--muted); }
.sa { flex-shrink: 0; display: flex; flex-direction: column; gap: 2px; font-family: var(--sanskrit); line-height: 1.7; }
.sa-line { margin: 0; white-space: nowrap; text-align: justify; text-align-last: justify; }
.sa.four .sa-line { text-align: center; text-align-last: center; }
.sa-line.wrap { white-space: normal; text-align: center; text-align-last: center; }
.sa-line.mid-speaker { text-align: center; text-align-last: center; font-size: .72em; color: var(--muted); }
.tl { margin: 10px 0 0; font-family: var(--serif); font-style: italic; font-size: calc(15px * var(--s)); color: var(--muted); text-align: center; line-height: 1.5; }
/* Speaker and the Sanskrit button */
.vhead { flex-shrink: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.who { margin: 0; font-family: var(--serif); font-size: 13px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.who.deva { font-family: var(--deva); font-size: 15px; letter-spacing: 0; text-transform: none; }
.sa-btn { flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 10px; border-radius: 999px;
  background: rgba(255, 252, 244, .7); color: var(--accent); border: 1px solid rgba(156, 74, 20, .45); }
.sa-btn .om { font-family: var(--sanskrit); font-size: 16px; line-height: 1; }
.sa-btn .lbl { font-family: var(--ui); font-size: 13px; font-weight: 600; }
.sa-btn .lbl.deva { font-family: var(--deva); }
.sa-btn svg { transition: transform .2s ease; }
.sa-btn[aria-expanded="true"] { background: var(--accent); color: var(--bg); border-color: var(--accent); }
.sa-btn[aria-expanded="true"] svg { transform: rotate(180deg); }
:root[data-theme="dark"] .sa-btn { background: transparent; border-color: rgba(227, 154, 94, .5); }
.sa-box { flex-shrink: 0; margin-top: 16px; padding: 12px; border-radius: 14px; background: rgba(156, 74, 20, .07); border: 1px solid rgba(156, 74, 20, .18); }
.sa.boxed .sa-line { text-align: center; text-align-last: center; }
.vhead + .tr, .sa-box + .tr { margin-top: 18px; }
.tr { flex-shrink: 0; margin: 20px 0 0; font-family: var(--serif); font-style: italic; font-size: calc(23px * var(--s)); line-height: 1.5; text-align: start; color: var(--ink); }
.tr.deva { font-family: var(--deva); font-style: normal; font-weight: 600; line-height: 1.65; }
.rule { flex-shrink: 0; height: 1px; border: 0; background: var(--rule); margin: 20px 0; }
.ex-wrap { flex: 1 1 0; min-height: 0; overflow: hidden; font-size: calc(19px * var(--s)); }
.ex-wrap.clipped { -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent); mask-image: linear-gradient(to bottom, #000 78%, transparent); }
.ex { margin: 0; font-family: var(--serif); font-size: 1em; line-height: 1.65; color: var(--ink-soft); text-align: justify; hyphens: auto; }
.ex.deva { font-family: var(--deva); line-height: 1.75; }
.ex + .ex { margin-top: .7em; }
.ex strong { font-weight: 600; }
.ex.note { color: var(--muted); font-style: italic; text-align: center; }
[dir="rtl"] .tr, [dir="rtl"] .ex { text-align: justify; font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif; line-height: 2; font-style: normal; }
.read-more {
  flex-shrink: 0; align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  min-height: 44px; margin-top: 4px; padding: 0; background: none; border: 0;
  color: var(--accent); font-size: 16px; font-weight: 600;
}
.read-more[hidden] { display: none; }
.foot { flex-shrink: 0; padding: 10px 24px calc(22px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 10px; }
.foot .hint { margin: 0; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; font-size: 12px; color: var(--muted); }
.progress { display: flex; align-items: center; gap: 12px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { flex: 1 1 auto; height: 3px; border-radius: 2px; background: var(--track); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 2px; transition: width .2s ease; }

/* Toolbar shown on tap */
.toolbar {
  position: absolute; left: 0; right: 0; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(6px + var(--safe-top)) 8px 6px 16px;
  background: var(--sheet); border-bottom: 1px solid var(--tile-border);
  box-shadow: 0 6px 20px rgba(43, 34, 25, .08);
  transition: transform .2s ease, opacity .2s ease;
}
.toolbar[hidden] { display: flex; transform: translateY(-100%); opacity: 0; pointer-events: none; }
.toolbar .where { margin: 0; font-size: 14px; font-weight: 500; color: var(--muted); }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; background: none; border: 0; border-radius: 10px; color: var(--ink); }
.icon-btn .aa { font-family: var(--serif); font-size: 18px; }

/* ---------- Read more ---------- */
#more { background: var(--paper); }
.more-head { flex-shrink: 0; display: flex; align-items: center; gap: 4px; padding: calc(6px + var(--safe-top)) 12px 6px; border-bottom: 1px solid var(--rule); }
.more-head p { margin: 0; font-size: 15px; font-weight: 600; }
.more-body { flex: 1 1 auto; overflow-y: auto; padding: 22px 24px calc(40px + var(--safe-bottom)); font-family: var(--serif); font-size: calc(17px * var(--s)); line-height: 1.7; -webkit-overflow-scrolling: touch; }
.more-body.deva { font-family: var(--deva); line-height: 1.8; }
.more-body .m-sa { margin: 0; font-family: var(--sanskrit); color: var(--muted); font-size: calc(18px * var(--s)); text-align: center; }
.more-body .m-tr { margin: 16px 0 0; font-style: italic; }
.more-body.deva .m-tr { font-style: normal; font-weight: 600; }
.more-body h2 { margin: 26px 0 8px; font-family: var(--ui); font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.more-body.deva h2 { font-family: var(--deva); font-size: 14px; letter-spacing: 0; text-transform: none; }
.more-body p { margin: 0 0 12px; }
.more-body ul { margin: 0 0 12px; padding-inline-start: 20px; }
.more-body li { margin-bottom: 8px; }
[dir="rtl"].more-body { font-family: 'Noto Nastaliq Urdu', 'Noto Naskh Arabic', serif; line-height: 2.1; }

/* ---------- Sheets (settings, contents) ---------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: rgba(27, 23, 19, .35); display: flex; align-items: flex-end; justify-content: center; }
.scrim[hidden] { display: none; }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; display: flex; flex-direction: column;
  background: var(--sheet); color: var(--ink); border-radius: 20px 20px 0 0;
  padding: 8px 20px calc(20px + var(--safe-bottom)); box-shadow: 0 -10px 30px rgba(0, 0, 0, .15);
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.sheet-head h2 { margin: 0; font-size: 17px; font-weight: 600; }
.setting { padding: 14px 0; border-top: 1px solid var(--tile-border); }
.setting > p { margin: 0 0 10px; font-size: 13px; font-weight: 500; color: var(--muted); }
.size-row { display: flex; align-items: center; gap: 12px; }
.size-row .icon-btn { border: 1px solid var(--tile-border); }
.size-dots { flex: 1 1 auto; display: flex; justify-content: space-between; padding: 0 6px; }
.size-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--track); }
.size-dots i.on { background: var(--accent); }
.switch-row { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: none; border: 0; padding: 0; font-size: 16px; text-align: start; }
.switch { flex-shrink: 0; width: 46px; height: 28px; border-radius: 999px; background: var(--track); position: relative; 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,.25); transition: transform .2s; }
.switch-row[aria-checked="true"] .switch { background: var(--accent); }
.switch-row[aria-checked="true"] .switch::after { transform: translateX(18px); }
.theme-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.theme-card { display: flex; flex-direction: column; align-items: center; gap: 0; padding: 11px 8px 12px; border-radius: 14px; border: 1px solid var(--tile-border); text-align: center; }
.theme-card[aria-checked="true"] { border: 2px solid var(--accent); padding: 10px 7px 11px; }
.theme-card .aa { font-family: Literata, Georgia, serif; font-size: 26px; line-height: 1.2; }
.theme-card .ln { display: block; height: 3px; border-radius: 2px; background: currentColor; opacity: .25; margin: 8px auto 4px; width: 60%; }
.theme-card .ln.short { width: 45%; margin: 0 auto 10px; }
.theme-card .nm { font-size: 13px; font-weight: 600; }
.theme-card .tick { margin-top: 6px; width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; visibility: hidden; background: #9C4A14; color: #fff; }
.theme-card[aria-checked="true"] .tick { visibility: visible; }
.theme-card.cream { background: #F4ECD8; color: #2B2219; }
.theme-card.white { background: #FFFFFF; color: #1F1A15; }
.theme-card.night { background: #15120F; color: #EDE4D3; border-color: #3A3129; }
.theme-card.night[aria-checked="true"] .tick { background: #E39A5E; color: #15120F; }
.theme-note { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.row-btn { width: 100%; min-height: 48px; display: flex; align-items: center; justify-content: space-between; background: none; border: 0; padding: 0; font-size: 16px; text-align: start; }
.row-btn span:last-child { color: var(--muted); font-size: 14px; }
.contents-list { overflow-y: auto; margin: 0 -20px; padding: 0 20px; }
.ch-row { width: 100%; display: flex; gap: 14px; align-items: baseline; padding: 12px 0; background: none; border: 0; border-top: 1px solid var(--tile-border); text-align: start; }
.ch-row .num { width: 26px; flex-shrink: 0; font-size: 14px; color: var(--accent); font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-row .names { display: flex; flex-direction: column; gap: 2px; }
.ch-row .sa-name { font-family: var(--sanskrit); font-size: 17px; }
.ch-row .loc-name { font-family: var(--serif); font-size: 14px; color: var(--muted); }
.ch-row[aria-current="true"] .sa-name { color: var(--accent); }
.verse-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; padding: 4px 0 14px 40px; }
.verse-grid button { height: 40px; border-radius: 10px; border: 1px solid var(--tile-border); background: var(--tile); font-size: 14px; font-variant-numeric: tabular-nums; }
.verse-grid button[aria-current="true"] { border: 2px solid var(--accent); color: var(--accent); font-weight: 600; }

/* Chapter opening page */
.opening { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 4px 24px; }
.op-label { margin: 0; font-family: var(--serif); font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); }
.op-sa.rom { font-family: var(--serif); font-weight: 600; font-size: calc(36px * var(--s)); line-height: 1.25; }
.op-sa.deva { font-family: var(--deva); font-weight: 600; font-size: calc(40px * var(--s)); }
.ch-row .sa-name.rom { font-family: var(--serif); font-weight: 600; font-size: 16px; }
.ch-row .sa-name.deva { font-family: var(--deva); font-weight: 600; font-size: 17px; }
.op-label.deva { font-family: var(--deva); letter-spacing: 0; font-size: 16px; }
.op-sa { margin: 14px 0 0; font-family: var(--sanskrit); font-weight: 400; font-size: calc(44px * var(--s)); line-height: 1.3; }
.op-name { margin: 6px 0 0; font-family: var(--serif); font-style: italic; font-size: calc(20px * var(--s)); color: var(--muted); }
.op-name.deva { font-family: var(--deva); font-style: normal; }
.op-orn { display: flex; align-items: center; gap: 10px; width: 60%; margin: 28px 0; }
.op-orn span { flex: 1; height: 1px; background: var(--rule); }
.op-orn i { width: 8px; height: 8px; transform: rotate(45deg); background: var(--rule); }
.op-intro { margin: 0; font-family: var(--serif); font-size: calc(19px * var(--s)); line-height: 1.7; color: var(--ink-soft); }
.op-intro.deva { font-family: var(--deva); line-height: 1.85; }
.op-count { margin: 24px 0 0; font-size: 14px; color: var(--muted); }

/* End of book */
.done { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; }
.done p { margin: 0; font-family: var(--serif); font-size: 20px; }

@media (prefers-reduced-motion: reduce) {
  .page, .toolbar, .bar > i { transition: none; }
  .begin svg { animation: none; }
}
.more-body .who + .m-tr { margin-top: 6px; }


/* ---------- Unlock, sign-in and thank-you screens ---------- */
.pay [hidden] { display: none !important; }
.pay { background: var(--paper); background-image: var(--paper-glow); overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(44px + var(--safe-top)) 24px calc(20px + var(--safe-bottom)); }
.pay .pay-body { flex: 1 0 auto; display: flex; flex-direction: column; }
.pay .pay-foot { flex: 0 0 auto; padding-top: 18px; }
.pay .eyebrow { margin: 0; font-family: var(--serif); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--accent); }
.pay h1 { margin: 10px 0; font-family: var(--serif); font-size: 30px; font-weight: 600; line-height: 1.2; }
:root[lang="hi"] .pay h1, :root[lang="sa"] .pay h1, :root[lang="mr"] .pay h1 { font-family: var(--deva); }
.pay .lead { margin: 0; font-family: var(--serif); font-size: 16.5px; line-height: 1.55; color: var(--ink-soft); }
:root[lang="hi"] .pay .lead, :root[lang="sa"] .pay .lead, :root[lang="mr"] .pay .lead { font-family: var(--deva); }
.ul-quote { margin: 0 0 16px; padding: 2px 0 2px 14px; border-left: 2px solid var(--rule); font-family: var(--serif); font-style: italic; font-size: 16.5px; line-height: 1.5; color: var(--ink-soft); }
:root[lang="hi"] .ul-quote { font-family: var(--deva); font-style: normal; }
.benefits { list-style: none; padding: 0; margin: 18px 0 20px; display: grid; gap: 9px; }
.benefits li { display: flex; gap: 10px; align-items: baseline; font-size: 15px; color: var(--ink-soft); }
.benefits li::before { content: ""; flex: 0 0 auto; width: 12px; height: 6px; border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg) translateY(-3px); }
.plans { display: grid; gap: 10px; }
.plan { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; text-align: start;
  border: 1.5px solid var(--tile-border); background: var(--tile); border-radius: 16px; padding: 15px 16px; }
.plan[aria-checked="true"] { border-color: var(--accent); background: var(--tile-on); }
.plan .radio { width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid var(--rule); flex: 0 0 auto; }
.plan[aria-checked="true"] .radio { border: 6px solid var(--accent); background: var(--tile); }
.plan-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pname { font-weight: 600; font-size: 16px; }
.psub { font-size: 13px; color: var(--muted); margin-top: 2px; }
.price { text-align: end; white-space: nowrap; display: flex; flex-direction: column; align-items: flex-end; }
.price .amt { font-family: var(--serif); font-weight: 600; font-size: 22px; }
.price small { font-size: 13px; color: var(--muted); }
.plan[data-plan="monthly"] .price { flex-direction: row; align-items: baseline; gap: 2px; }
.plan .tag { position: absolute; top: -10px; right: 16px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 600; letter-spacing: .04em; padding: 3px 9px; border-radius: 999px; }
:root[data-theme="dark"] .plan .tag { color: #1E1915; }
.compare { margin: 10px 4px 0; font-size: 12.5px; color: var(--muted); }
.pay .btn-primary { width: 100%; margin-top: 0; }
.pay .btn-primary[disabled] { opacity: .6; }
.btn-light { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 54px; border-radius: 14px;
  background: var(--tile); border: 1.5px solid var(--tile-border); font-size: 16px; font-weight: 600; }
.g-mark { width: 20px; height: 20px; border-radius: 50%; border: 2px solid currentColor; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; }
.fine { margin: 10px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--muted); text-align: center; }
.fine.small { font-size: 11.5px; }
.fine a { color: inherit; }
.pay-links { display: flex; justify-content: center; gap: 22px; margin-top: 6px; }
.pay-links button { background: none; border: 0; padding: 8px 4px; font-size: 14.5px; font-weight: 600; color: var(--accent); }
.pay-links .quiet { color: var(--muted); font-weight: 500; }
.pay-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--tile); border: 1px solid var(--tile-border); font-size: 14px; color: var(--ink-soft); }
.link { background: none; border: 0; padding: 4px 0; color: var(--accent); font-weight: 600; font-size: 14px; }
.pay .back { margin: -14px 0 8px -10px; align-self: flex-start; }
.summary { display: flex; align-items: center; gap: 12px; border: 1px solid var(--tile-border); background: var(--tile-on); border-radius: 14px; padding: 12px 14px; margin: 22px 0 26px; }
.summary .sum-txt { flex: 1; display: flex; flex-direction: column; }
.summary .pname { font-size: 15px; }
.sum-price { font-family: var(--serif); font-weight: 600; font-size: 19px; }
#si-form .btn-primary { margin-top: 12px; }
.or { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 13px; margin: 18px 0; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--rule); }
.field { width: 100%; height: 54px; border: 1.5px solid var(--tile-border); background: var(--tile); color: var(--ink); border-radius: 14px; padding: 0 16px; font: inherit; font-size: 16px; }
.field:focus { outline: none; border-color: var(--accent); }
.sent-title { margin: 8px 0 6px; font-weight: 600; font-size: 18px; }
.pay.center { text-align: center; }
.pay.center .pay-body { justify-content: center; }
.om { font-family: var(--sanskrit); font-size: 46px; line-height: 1; color: var(--accent); }
.pay.center h1 { margin-top: 18px; font-size: 32px; }
.orn { display: flex; align-items: center; gap: 10px; justify-content: center; margin: 4px 0 22px; }
.orn::before, .orn::after { content: ""; width: 56px; height: 1px; background: var(--rule); }
.orn span { width: 7px; height: 7px; background: var(--accent); transform: rotate(45deg); opacity: .8; }
.account-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; font-size: 15px; color: var(--ink-soft); word-break: break-all; }
.ct-unlock { display: flex; align-items: center; gap: 12px; width: 100%; text-align: start; background: var(--tile-on); border: 1px solid var(--tile-border); border-radius: 14px; padding: 12px 14px; margin: 6px 0 12px; }
.ct-unlock .t1 { font-weight: 600; font-size: 15px; display: block; }
.ct-unlock .t2 { font-size: 13px; color: var(--muted); display: block; }
.ct-unlock .go { margin-left: auto; font-weight: 600; color: var(--accent); font-size: 15px; }
.ch-row .lock { margin-left: auto; align-self: center; flex: 0 0 auto; color: var(--muted); }
.ch-row.locked .names { opacity: .72; }
.verse-grid button.locked { opacity: .45; }
@media (min-width: 500px) {
  .pay { padding-left: max(24px, calc(50% - 240px)); padding-right: max(24px, calc(50% - 240px)); }
}

/* ---------- Bigger screens: iPhone Duo opened, tablets ---------- */
.page.is-opening, .page.is-done { display: flex; }
@media (min-width: 500px) {
  :root { --device: 1.1; }
  .screen { max-width: none; }
  #reader .page, #reader .foot { width: 100%; max-width: 680px; margin-left: auto; margin-right: auto; }
  #reader .page { padding-left: 40px; padding-right: 40px; padding-top: calc(56px + var(--safe-top)); }
  #reader .foot { padding-left: 40px; padding-right: 40px; }
  .toolbar { padding-left: max(16px, calc(50% - 320px)); padding-right: max(8px, calc(50% - 330px)); }
  #lang { padding-left: max(24px, calc(50% - 320px)); padding-right: max(24px, calc(50% - 320px)); }
  .title-body { max-width: 620px; margin-left: auto; margin-right: auto; }
  .hero { height: min(56vh, 640px); }
  .more-head, .more-body { width: 100%; max-width: 720px; margin-left: auto; margin-right: auto; }
}
@media (min-width: 760px) {
  :root { --device: 1.2; }
  .scrim { align-items: center; }
  .sheet { border-radius: 20px; max-height: 80vh; }
}
#reader .page.fits { justify-content: center; }
#reader .page.fits .ex-wrap { flex: 0 0 auto; }
#reader .page.fits .read-more { margin-top: 20px; }
/* Tablet held sideways: an open book. Verse on the left page, explanation on the right. */
@media (min-width: 860px) and (orientation: landscape) {
  :root { --device: 1.15; }
  #reader .page:not(.is-opening):not(.is-done) {
    max-width: 1200px; display: grid; position: relative;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 112px;
    grid-template-rows: auto auto auto minmax(0, 1fr) auto; align-content: start;
    padding-left: 64px; padding-right: 64px; padding-top: calc(64px + var(--safe-top));
  }
  #reader .page:not(.is-opening):not(.is-done)::before {
    content: ""; position: absolute; top: 48px; bottom: 16px; left: 50%; width: 1px;
    background: linear-gradient(to bottom, transparent, var(--rule) 12%, var(--rule) 88%, transparent);
  }
  #reader .page .vhead, #reader .page > .speaker { grid-column: 1; grid-row: 1; }
  #reader .page .sa-box, #reader .page > .sa { grid-column: 1; grid-row: 2; }
  #reader .page .tr, #reader .page > .tl { grid-column: 1; grid-row: 3 / 6; align-self: center; font-size: calc(27px * var(--s)); line-height: 1.55; margin: 0; padding-bottom: 40px; }
  #reader .page .rule { display: none; }
  #reader .page .ex-wrap, #reader .page > .ex.note { grid-column: 2; grid-row: 1 / 5; min-height: 0; height: 100%; }
  #reader .page .read-more { grid-column: 2; grid-row: 5; }
  #reader .foot { max-width: 1200px; padding-left: 64px; padding-right: 64px; }
  #title { flex-direction: row; }
  #title .hero { width: 50%; height: auto; }
  #title .hero::after { left: auto; top: 0; width: 30%; height: auto; background: linear-gradient(to right, transparent, var(--bg)); }
  #title .title-body { width: 50%; margin: 0; justify-content: center; padding-top: 40px; }
  #title .title-body .spacer { flex: 0 0 40px; }
}
