/* KathaMantra — mobile-first reading styles */
:root, [data-theme="light"] {
  --bg: #FFFFFF; --fg: #1F1A17; --muted: #6B5E55; --line: #F0E6D8; --line2: #EADFCF;
  --soft: #F7F1E8; --tint: #FFF4E5; --path: #FFF7D6; --accent: #A3311F; --accent-deep: #7E2416;
  --kesar: #E07A1F; --on-accent: #FFFFFF; --card: #FFFFFF; --hl: #FFE9A8; --dark: #1F1A17; --on-dark: #FFFFFF;
  --wa: #18743F; --shadow: 0 6px 24px rgba(0,0,0,.14);
  color-scheme: light;
}
[data-theme="sepia"] {
  --bg: #F6EEDC; --fg: #3A2E25; --muted: #6B5A48; --line: #E2D3B8; --line2: #D9C7A8;
  --soft: #EFE2C8; --tint: #F1E3C6; --path: #F3E6C4; --accent: #9A2A1C; --accent-deep: #7E2416;
  --kesar: #C9661A; --on-accent: #FFFFFF; --card: #FBF6EA; --hl: #F7D98B; --dark: #3A2E25; --on-dark: #F6EEDC;
}
[data-theme="night"] {
  --bg: #16110D; --fg: #EDE3D6; --muted: #B8A99A; --line: #2E241D; --line2: #3A2E25;
  --soft: #221A14; --tint: #2A2018; --path: #241C12; --accent: #F6A75B; --accent-deep: #F6A75B;
  --kesar: #F6A75B; --on-accent: #16110D; --card: #1E1712; --hl: #5A4410; --dark: #2B211B; --on-dark: #F5EBDD;
  --wa: #2FA866; --shadow: 0 6px 24px rgba(0,0,0,.5);
  color-scheme: dark;
}
html[data-fs="0"] { --fs-body: 17px; --fs-path: 19px; --fs-shlok: 22px; }
html, html[data-fs="1"] { --fs-body: 18px; --fs-path: 22px; --fs-shlok: 25px; }
html[data-fs="2"] { --fs-body: 20px; --fs-path: 25px; --fs-shlok: 28px; }
html[data-fs="3"] { --fs-body: 22px; --fs-path: 29px; --fs-shlok: 32px; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font-family: Mukta, "Noto Sans Devanagari", system-ui, sans-serif; font-size: 17px; line-height: 1.6;
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
a { color: var(--accent); }
a:hover { color: var(--accent-deep); }
h1 { font-size: 28px; line-height: 1.25; margin: 16px 0 10px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
h3 { font-size: 15px; margin: 8px 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--kesar); outline-offset: 2px; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; z-index: 50; }
.skip:focus { left: 8px; }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 16px; }
main { overflow-x: clip; }
h1, h2, p, .rl-t, .rl-s { overflow-wrap: anywhere; }
img, svg { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { color: var(--muted); font-size: 17px; margin: 0 0 16px; }
.note { color: var(--muted); font-size: 14px; }

/* header */
.top { position: sticky; top: 0; z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; gap: 8px; height: 60px; }
.logo { display: flex; align-items: baseline; gap: 8px; text-decoration: none; margin-right: auto; }
.logo-dev { font-family: "Tiro Devanagari Hindi", serif; font-size: 26px; color: var(--accent); line-height: 1; }
.logo-en { font-size: 13px; font-weight: 600; letter-spacing: .04em; color: var(--muted); }
.top-links { display: none; gap: 18px; margin-right: 12px; }
.top-links a { color: var(--fg); text-decoration: none; font-weight: 600; }
.langsw { display: inline-flex; padding: 3px; border-radius: 22px; background: var(--soft); border: 1px solid var(--line2); }
.langsw a { min-height: 34px; padding: 0 11px; display: inline-flex; align-items: center; border-radius: 17px; font-size: 14px; font-weight: 700; color: var(--fg); text-decoration: none; }
.langsw a[aria-current] { background: var(--accent); color: var(--on-accent); }
.iconbtn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: 22px; color: var(--fg); }
.iconbtn[aria-pressed="true"] svg { fill: var(--accent); stroke: var(--accent); }
@media (max-width: 460px) { .logo-en { display: none; } }
.top-in > .iconbtn { flex: none; }

/* bottom nav */
.bottomnav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--bg); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.bottomnav a { min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.bottomnav a[aria-current] { color: var(--accent); }
@media (min-width: 900px) {
  .bottomnav { display: none; }
  .top-links { display: flex; }
  body { padding-bottom: 0; }
  body.has-readerbar { padding-bottom: 80px; }
}

/* footer */
.foot { color: var(--muted); font-size: 14px; padding-top: 32px; padding-bottom: 24px; border-top: 1px solid var(--line); margin-top: 40px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 24px;
  border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 16px; text-decoration: none; }
.btn:hover { color: var(--on-accent); filter: brightness(1.05); }
.btn.outline { background: transparent; color: var(--accent); }
.btn.light { background: #FFFFFF; color: #A3311F; border-color: #FFFFFF; }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #FFFFFF; }
.btn.wide { width: 100%; }
.pill { min-width: 44px; height: 40px; border-radius: 20px; border: 1px solid var(--line2); background: var(--card); font-weight: 700; font-size: 15px; }
.pill.big { font-size: 19px; }
.chip { min-height: 38px; padding: 4px 14px; border-radius: 19px; border: 1px solid var(--line2); background: var(--soft); font-size: 15px; font-weight: 600; color: var(--fg); text-decoration: none; display: inline-flex; align-items: center; }
.chip[aria-pressed="true"], .chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.badge { font-size: 12px; font-weight: 700; color: var(--muted); background: var(--soft); border-radius: 10px; padding: 2px 10px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row-between h2 { margin: 0; }

/* home */
.search { margin: 16px 0 8px; }
.searchbox { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 26px; background: var(--soft); border: 1px solid var(--line2); color: var(--muted); }
.searchbox input { flex: 1; min-width: 0; border: 0; background: transparent; font-size: 16px; color: var(--fg); outline: none; }
.today { margin: 12px 0 0; padding: 20px; border-radius: 20px; background: #A3311F; color: #FFFFFF; }
.today p { margin: 0; }
.today-k { font-size: 14px; font-weight: 600; opacity: .92; }
.today-t { font-family: "Tiro Devanagari Hindi", serif; font-size: 27px; line-height: 1.3; margin: 4px 0 !important; }
.today-m { opacity: .92; font-size: 15px; margin-bottom: 14px !important; }
.nextcard { margin-top: 12px; padding: 14px 16px; border-radius: 16px; background: var(--tint); border: 1px solid var(--line2); display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--fg); }
.nextcard[hidden] { display: none; }
.nc-date { width: 52px; height: 52px; border-radius: 14px; background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); line-height: 1.1; border: 1px solid var(--line2); }
.nc-date span:last-child { font-size: 11px; color: var(--muted); font-weight: 600; }
.nc-main { flex: 1; display: flex; flex-direction: column; }
.nc-k { font-size: 13px; color: var(--muted); }
.nc-t { font-weight: 700; }
.block { margin-top: 8px; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.tile { min-height: 100px; border-radius: 16px; background: var(--soft); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-decoration: none; color: var(--fg); padding: 8px; text-align: center; }
.tile-g { width: 44px; height: 44px; border-radius: 22px; background: var(--card); display: flex; align-items: center; justify-content: center; font-family: "Tiro Devanagari Hindi", serif; font-size: 19px; color: var(--accent); }
.tile-t { font-size: 15px; font-weight: 600; line-height: 1.2; }
.rows { display: flex; flex-direction: column; }
.rowlink { min-height: 62px; display: flex; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); padding: 6px 0; }
.rowlink svg { color: var(--muted); flex-shrink: 0; }
.rowlink.soon { opacity: .75; }
.num { min-width: 28px; font-weight: 700; color: var(--accent); }
.rl-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.rl-t { font-size: 17px; font-weight: 600; }
.rl-s { font-size: 14px; color: var(--muted); }
.cards { display: grid; gap: 10px; }
@media (min-width: 600px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.storycard { padding: 16px; border-radius: 16px; border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 4px; text-decoration: none; color: var(--fg); }
.sc-k { font-size: 13px; color: var(--muted); }
.sc-t { font-size: 18px; font-weight: 700; }
.sc-l { font-size: 15px; color: var(--muted); }
.askcard { margin: 28px 0 0; padding: 18px; border-radius: 18px; background: var(--dark); color: var(--on-dark); display: flex; flex-direction: column; gap: 4px; text-decoration: none; }
.askcard:hover { color: var(--on-dark); }
.ac-t { font-size: 19px; font-weight: 700; }
.ac-s { font-size: 15px; opacity: .9; }
.askcard.small { padding: 14px 18px; }
.askcard.small .ac-t { font-size: 16px; }
.continue-card { padding: 16px; border-radius: 16px; border: 1px solid var(--line2); display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--fg); }
.bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.bar > span { display: block; height: 6px; background: var(--kesar); }

/* reader */
.crumbs { font-size: 14px; color: var(--muted); margin-top: 14px; }
.crumbs a { color: var(--muted); }
.answer { margin: 0; padding: 14px 16px; border-radius: 14px; background: var(--tint); font-size: 16px; line-height: 1.6; }
.metarow { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; }
.meta { flex: 1; font-size: 14px; color: var(--muted); }
.path { margin: 16px -16px 0; background: var(--path); border-left: 5px solid var(--kesar); padding: 20px 16px 8px 22px; }
@media (min-width: 752px) { .path { margin-left: 0; margin-right: 0; border-radius: 0 14px 14px 0; } }
.path-head { margin: 4px 0 14px; font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .04em; }
.couplet { margin: 0 0 1.1em; font-size: var(--fs-path); line-height: 1.7; white-space: pre-line; }
.path[lang="en"] .couplet { font-size: calc(var(--fs-path) - 2px); }
.reader > .btn { margin-top: 16px; }
.meaning h2 { margin-top: 20px; }
.mn { padding: 14px 0; border-bottom: 1px solid var(--line); }
.mn p { margin: 0; }
.mn-l { font-size: 13px; font-weight: 700; color: var(--accent); }
.mn-v { font-weight: 600; white-space: pre-line; font-size: var(--fs-body); }
.mn-m { color: var(--muted); font-size: var(--fs-body); line-height: 1.65; margin-top: 4px !important; }
.sharerow { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.sharerow .btn { flex: 1 1 160px; }
.relgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.relcard { padding: 14px; border-radius: 14px; background: var(--soft); text-decoration: none; color: var(--fg); font-weight: 600; font-size: 15px; }
.faq { border-bottom: 1px solid var(--line); }
.faq summary { min-height: 52px; display: flex; align-items: center; cursor: pointer; font-size: 16px; padding: 8px 0; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 20px; }
.faq[open] summary::after { content: "−"; }
.faq p { margin: 0 0 14px; color: var(--muted); }
.resume { margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--tint); display: flex; align-items: center; gap: 10px; font-size: 15px; }
.resume[hidden] { display: none; }
.resume button { border: 0; background: transparent; color: var(--accent); font-weight: 700; padding: 6px 0; }
.resume .x { margin-left: auto; color: var(--muted); font-size: 20px; width: 36px; }
.kicker { font-size: 14px; color: var(--muted); margin: 14px 0 0; }

/* gita */
.shlok { margin-top: 16px; padding: 24px 18px; border-radius: 20px; background: var(--tint); border: 1px solid var(--line2); text-align: center; }
.shlok-dev { margin: 0; font-family: "Tiro Devanagari Sanskrit", serif; font-size: var(--fs-shlok); line-height: 1.8; color: var(--accent-deep); white-space: pre-line; }
.shlok-rom { margin: 12px 0 0; font-size: 15px; font-style: italic; color: var(--muted); white-space: pre-line; }
.prose { font-size: var(--fs-body); line-height: 1.85; }
.words { display: flex; flex-wrap: wrap; gap: 8px; }
.word { padding: 8px 12px; border-radius: 12px; background: var(--soft); display: flex; flex-direction: column; }
.w-s { font-family: "Tiro Devanagari Sanskrit", serif; font-size: 17px; color: var(--accent-deep); }
.w-m { font-size: 13px; color: var(--muted); }
.lesson { margin-top: 24px; padding: 20px; border-radius: 18px; background: #A3311F; color: #FFFFFF; }
.lesson.dark { background: var(--dark); color: var(--on-dark); }
.lesson p { margin: 0; }
.lesson-k { font-size: 14px; font-weight: 700; opacity: .9; }
.lesson-t { font-size: 18px; line-height: 1.6; margin-top: 6px !important; }
.pngrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 24px; }
.pn { padding: 14px 16px; border-radius: 16px; background: var(--soft); text-decoration: none; color: var(--fg); display: flex; flex-direction: column; }
.pn.next { background: var(--accent); color: var(--on-accent); align-items: flex-end; }
.pn-k { font-size: 13px; opacity: .85; }
.pn-t { font-weight: 700; }

/* stories */
.story-h { font-family: "Tiro Devanagari Hindi", serif; font-weight: 400; font-size: 32px; margin-top: 6px; }
.chars { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.chars-k { font-size: 13px; font-weight: 700; color: var(--muted); width: 100%; }
.charinfo { margin: 10px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--soft); font-size: 15px; }
.recap { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: var(--soft); }
.recap p { margin: 0; }
.recap-k { font-size: 13px; font-weight: 700; color: var(--muted); }
.story-text .para { margin: 18px 0 0; border-radius: 6px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.para.hl { background: var(--hl); box-shadow: 0 0 0 4px var(--hl); }
.para .note-mark { display: block; font-size: 14px; color: var(--muted); margin-top: 4px; }
.gloss { border: 0; padding: 0; background: transparent; color: inherit; text-decoration: underline dotted; text-underline-offset: 5px; text-decoration-color: var(--kesar); font-size: inherit; line-height: inherit; }
.quote { margin: 22px 0 0; padding: 16px 18px; border-radius: 14px; background: var(--tint); }
.quote p { margin: 0; }
.q-dev { font-family: "Tiro Devanagari Hindi", serif; font-size: 21px; line-height: 1.7; color: var(--accent-deep); white-space: pre-line; }
.q-m { color: var(--muted); margin-top: 8px !important; }
.q-src { font-size: 13px; color: var(--muted); margin-top: 6px !important; }
.nextch { margin-top: 20px; padding: 18px 20px; border-radius: 18px; background: var(--dark); color: var(--on-dark); display: flex; align-items: center; gap: 12px; text-decoration: none; justify-content: space-between; }
.nextch:hover { color: var(--on-dark); }
.nextch > span { display: flex; flex-direction: column; }
.nx-k { font-size: 13px; opacity: .85; }
.nx-t { font-size: 19px; font-weight: 700; }
.chlist { list-style: none; padding: 0; margin: 0; }
.chlist a { min-height: 54px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--fg); }
.chlist a[aria-current] .rl-t { font-weight: 700; color: var(--accent); }
.chlist a.done .num { color: var(--wa); }
.chlist a.done .num::after { content: " ✓"; }
.grp { color: var(--accent); }
.streak { margin: 10px 0 0; padding: 12px 14px; border-radius: 14px; background: var(--tint); }

/* reader bar (stories) */
.readerbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--bg); border-top: 1px solid var(--line); padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); }
.has-readerbar .bottomnav { display: none; }
.rb-prog { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--muted); }
.rb-bar { flex: 1; height: 4px; border-radius: 2px; background: var(--line); }
.rb-fill { height: 4px; border-radius: 2px; background: var(--kesar); width: 0; }
.rb-btns { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.rb-btns > * { min-height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var(--fg); font-size: 14px; font-weight: 600; text-decoration: none; }
.rb-btns [aria-pressed="true"] { color: var(--accent); }
.rb-btns .rb-ask { color: var(--accent); font-weight: 700; }

/* sheets, popovers, toast */
.sheet { border: 0; padding: 0; width: 100%; max-width: 560px; margin: auto auto 0; border-radius: 20px 20px 0 0; background: var(--card); color: var(--fg); box-shadow: var(--shadow); }
.sheet::backdrop { background: rgba(0,0,0,.35); }
@media (min-width: 600px) { .sheet { margin: auto; border-radius: 20px; } }
.sheet-in { padding: 20px 16px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 14px; }
.sheet h2 { margin: 0; font-size: 18px; }
.sheet-label { font-size: 15px; font-weight: 600; margin: 0; }
.themes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.th { height: 48px; border-radius: 12px; font-weight: 600; border: 2px solid transparent; }
.th-light { background: #FFFFFF; color: #1F1A17; border-color: #EADFCF; }
.th-sepia { background: #F6EEDC; color: #3A2E25; border-color: #D9C7A8; }
.th-night { background: #16110D; color: #EDE3D6; border-color: #3A2E25; }
.th[aria-pressed="true"] { border-color: #E07A1F; }
.fsbtns { display: inline-flex; gap: 8px; }
.pm-text { margin: 0; font-size: 15px; color: var(--muted); max-height: 5.2em; overflow: hidden; }
.pm-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pm-btns .btn { flex: 1 1 120px; }
.pm-note { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.pm-note textarea { border-radius: 12px; border: 1px solid var(--line2); background: var(--bg); padding: 10px 12px; resize: vertical; font-weight: 400; }
.pop { position: absolute; z-index: 40; max-width: min(340px, calc(100vw - 32px)); padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line2); box-shadow: var(--shadow); font-size: 15px; line-height: 1.55; }
.pop strong { display: block; font-size: 17px; margin-bottom: 2px; }
.toast { position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px); opacity: 0; pointer-events: none;
  background: var(--dark); color: var(--on-dark); padding: 10px 18px; border-radius: 20px; font-size: 15px; transition: .2s; z-index: 60; }
.toast.on { opacity: 1; transform: translateX(-50%); }

/* jaap */
.jaap { text-align: center; }
.jaap .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.jaap .chips::-webkit-scrollbar { display: none; }
.jaap .chip { flex: none; }
.rowlink[hidden] { display: none; }
.jaap-text { font-family: "Tiro Devanagari Sanskrit", serif; font-size: 26px; line-height: 1.5; color: var(--accent-deep); white-space: pre-line; margin: 16px 0 4px; }
.ring { position: relative; width: 260px; height: 260px; margin: 16px auto; border: 0; background: transparent; padding: 0; display: flex; align-items: center; justify-content: center; border-radius: 50%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.ring svg { position: absolute; inset: 0; width: 260px; height: 260px; }
.ring-bg { fill: var(--soft); stroke: none; }
.bead { fill: var(--line2); transition: fill .15s; }
.bead.on { fill: var(--kesar); }
.ring-sweep { fill: none; stroke: var(--kesar); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 0 100; opacity: 0; }
.ring-sweep.go { animation: sweep .7s ease-out; }
@keyframes sweep { 0% { stroke-dasharray: 0 100; opacity: .9; } 85% { stroke-dasharray: 100 0; opacity: .9; } 100% { stroke-dasharray: 100 0; opacity: 0; } }
.mala-done .ring-bg { animation: glow 2.4s ease-out; }
@keyframes glow { 0%, 60% { fill: var(--hl); } 100% { fill: var(--soft); } }
@media (prefers-reduced-motion: reduce) { .ring-sweep.go, .mala-done .ring-bg { animation: none; } }
.ring:active { transform: scale(.98); }
.ring-in { position: relative; display: flex; flex-direction: column; align-items: center; }
.ring-n { font-size: 72px; font-weight: 700; line-height: 1; }
.ring-s { color: var(--muted); }
.ring-tap { color: var(--accent); font-size: 14px; margin-top: 8px; }
.jaap-btns { display: flex; gap: 10px; justify-content: center; }

/* ask */
.chat { display: flex; flex-direction: column; gap: 12px; margin: 16px 0; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 18px; font-size: 16px; line-height: 1.6; white-space: pre-line; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: 4px; }
.msg.bot { align-self: flex-start; background: var(--soft); border-bottom-left-radius: 4px; }
.msg.bot.wait { color: var(--muted); }
.srcs { align-self: flex-start; display: flex; flex-wrap: wrap; gap: 8px; max-width: 88%; }
.srcs a { padding: 6px 12px; border-radius: 12px; border: 1px solid var(--line2); font-size: 14px; font-weight: 600; text-decoration: none; }
.fb { align-self: flex-start; display: flex; gap: 8px; }
.fb button { min-height: 36px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line2); background: var(--card); font-size: 14px; }
.askform { position: sticky; bottom: calc(72px + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: center; padding: 10px 0; background: var(--bg); }
@media (min-width: 900px) { .askform { bottom: 0; } }
.askbox { flex: 1; display: flex; align-items: center; height: 50px; padding: 0 16px; border-radius: 25px; background: var(--soft); border: 1px solid var(--line2); }
.askbox input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; font-size: 16px; }
.roundbtn { width: 50px; height: 50px; flex-shrink: 0; border-radius: 25px; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent); display: inline-flex; align-items: center; justify-content: center; }
.roundbtn.outline { background: var(--card); color: var(--fg); border-color: var(--line2); }
.roundbtn.listening { background: var(--kesar); color: #1F1A17; }
@media (max-width: 359px) { .askform { gap: 6px; } .roundbtn { width: 44px; height: 44px; } .askbox { padding: 0 12px; } }

/* ekadashi, misc */
.steps li, .eklist li { margin: 6px 0; }
.eklist { columns: 2; column-gap: 24px; }
.empty { text-align: center; padding: 48px 0; }
.player { margin-top: 14px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 16px; background: var(--dark); color: var(--on-dark); }
.player button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--kesar); color: #1F1A17; font-weight: 700; }
.player .rep { width: auto; padding: 0 12px; background: transparent; border: 1px solid var(--muted); color: var(--on-dark); }
.player .pbar { flex: 1; height: 4px; border-radius: 2px; background: rgba(255,255,255,.25); }
.player .pfill { height: 4px; border-radius: 2px; background: var(--kesar); width: 0; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* brand mark */
.logo { align-items: center; }
.logo-mark { flex: none; border-radius: 8px; }

/* home hero, verse of the day, install */
.hero { margin: 18px 0 4px; }
.hero h1 { font-size: 24px; line-height: 1.3; margin: 0 0 6px; }
.hero p { margin: 0; color: var(--muted); font-size: 16px; }
.vd-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 16px; background: var(--tint);
  border-left: 4px solid var(--kesar); text-decoration: none; color: var(--fg); }
.vd-r { font-size: 13px; font-weight: 700; color: var(--accent); }
.vd-v { font-family: "Tiro Devanagari Sanskrit", "Tiro Devanagari Hindi", serif; font-size: 19px; line-height: 1.7; white-space: pre-line; }
.vd-m { font-size: 15px; color: var(--muted); line-height: 1.55; }
.install { margin-top: 20px; }
.install[hidden], [data-install-ios][hidden] { display: none; }
.social { margin-top: 18px; font-size: 15px; }

/* guides (dharan & niyam) */
.facts { margin: 0; border: 1px solid var(--line2); border-radius: 14px; overflow: hidden; }
.facts div { display: grid; grid-template-columns: minmax(84px, 34%) 1fr; gap: 10px; padding: 11px 14px; border-top: 1px solid var(--line); }
.facts div:first-child { border-top: 0; }
.facts dt { font-weight: 700; color: var(--muted); font-size: 14px; }
.facts dd { margin: 0; font-size: 15px; overflow-wrap: anywhere; }
.guide ol, .guide ul { margin: 0; padding-left: 0; list-style: none; font-size: var(--fs-body); line-height: 1.7; }
.guide li { position: relative; padding: 10px 0 10px 40px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.g-steps { counter-reset: st; }
.g-steps li::before { counter-increment: st; content: counter(st); position: absolute; left: 0; top: 10px; width: 28px; height: 28px; border-radius: 14px;
  background: var(--accent); color: var(--on-accent); font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.g-list li::before, .g-do li::before, .g-dont li::before { position: absolute; left: 4px; top: 10px; font-weight: 700; }
.g-list li::before { content: "•"; color: var(--kesar); left: 9px; }
.g-do li::before { content: "✓"; color: #2E7D32; }
.g-dont li::before { content: "✕"; color: #C62828; }
[data-theme="night"] .g-do li::before { color: #81C784; }
[data-theme="night"] .g-dont li::before { color: #EF9A9A; }
.guide .meta { margin: 0 0 12px; }

/* ── Reading Mode Overlay ─────────────────────────────── */
.rm-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: var(--bg); display: flex; flex-direction: column;
  animation: rmIn .15s ease;
}
@keyframes rmIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.rm-overlay[hidden] { display: none; }
.rm-prog-wrap { height: 3px; background: var(--line2); }
.rm-prog { height: 3px; background: var(--kesar); transition: width .25s; }
.rm-top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; min-height: 50px; border-bottom: 1px solid var(--line2);
}
.rm-counter { font-size: 14px; color: var(--fg2); font-weight: 700; }
.rm-body {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center;
}
.rm-verse {
  font-family: "Tiro Devanagari Hindi", serif;
  font-size: clamp(22px, 5.5vw, 32px);
  line-height: 2; white-space: pre-line; color: var(--fg); margin: 0;
}
.rm-mean {
  margin-top: 20px; font-size: 15px; line-height: 1.65; color: var(--fg2);
  padding: 14px 18px; background: var(--soft); border-radius: 14px;
  text-align: left; max-width: 480px; width: 100%;
}
.rm-mean[hidden] { display: none; }
.rm-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-top: 1px solid var(--line2); gap: 10px;
}
.rm-nav {
  width: 56px; height: 56px; border-radius: 28px;
  border: 1.5px solid var(--line2); background: var(--card);
  font-size: 22px; display: flex; align-items: center; justify-content: center;
  touch-action: manipulation; cursor: pointer; flex-shrink: 0;
}
.rm-nav:disabled { opacity: .3; pointer-events: none; }
.rm-mtoggle {
  flex: 1; height: 48px; border-radius: 24px;
  border: 1.5px solid var(--kesar); color: var(--kesar);
  background: transparent; font-size: 14px; font-weight: 700;
  cursor: pointer; touch-action: manipulation;
}
/* ── Better text reading typography (mobile-first) ───── */
.couplet {
  margin: 0 0 1.5em;
  font-size: var(--fs-path);
  line-height: 1.9;
  white-space: pre-line;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.couplet:last-child { border-bottom: 0; }
.path { padding: 8px 0; }
.path[lang="en"] .couplet { font-size: calc(var(--fs-path) - 1px); line-height: 1.75; }
