/* =====================================================================
   STYLES
   Rules are in the order they were added: a later rule for the same
   element refines an earlier one. To change a look, search for the
   selector and edit the LAST rule that sets that property.

   Themes are sets of colour variables (--bg, --ink, --accent, …) on :root.
   Light is the default; dark follows the device unless a theme is picked
   in Settings (data-pref="light|sepia|dark"); data-hc="1" = high contrast.
   data-lang (mr|en|both) is set on each region, not on <html>: the
   pieces, group headings, printout and contents lists carry the text
   language; the bar, settings, date card, buttons and dialogs carry the
   menu language (en|mr).
   Other switches on <html>: data-ref (dhrupad
   1 = once, 0 = after every stanza), data-cols (1|2), data-rail (left
   menu shown), data-print (print layout being printed).
   ===================================================================== */

/* ==== Fonts ====
   Inter (English), Noto Sans Devanagari (menus), Tiro Devanagari Marathi (texts) and
   Tiro Devanagari Sanskrit (Atharvashirsha, with the Vedic swara marks), all SIL Open Font License.
   The files are in fonts/, copied from Google Fonts and split by script like Google serves them:
   a browser downloads only the parts a page uses, and sw.js keeps all of them for offline use.
   Inter and Noto Sans Devanagari are variable fonts: one file covers weights 400–700. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/inter-latin.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 Sans Devanagari";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-sans-deva-devanagari.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-sans-deva-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Noto Sans Devanagari";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-sans-deva-latin.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: "Tiro Devanagari Marathi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-marathi-devanagari.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "Tiro Devanagari Marathi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-marathi-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Tiro Devanagari Marathi";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-marathi-latin.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: "Tiro Devanagari Sanskrit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-sanskrit-devanagari.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "Tiro Devanagari Sanskrit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-sanskrit-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Tiro Devanagari Sanskrit";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/tiro-sanskrit-latin.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;
}

/* Kannada letters (Settings → Main language → ಕನ್ನಡ). One file, Noto Sans Kannada, with the dandas and Vedic accent
   marks too, which must come from the same font as the letter they sit on. Where it is used: the rule at the end of
   this file. (Not added under the other families: a Kannada face inside "Noto Sans Devanagari" changes how Chrome
   draws the Marathi.) A browser downloads it only when Kannada letters are on screen. */
@font-face {
  font-family: "Noto Sans Kannada";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-sans-kannada-kannada.woff2) format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0C80-0CF3, U+1CD0-1CFA, U+200C-200D, U+25CC;
}

/* Kannada letters in the other text fonts (Classic, Bold, Handwritten). Kannada letters only: the dandas and Vedic
   marks come from Noto Sans Kannada (Classic has its own), and the Atharvashirsha keeps a font with those marks. */
@font-face {
  font-family: "SC Kn Classic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-serif-kannada-kannada.woff2) format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0C80-0CF3, U+1CD0-1CFA, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "SC Kn Bold";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(../fonts/baloo-tamma-kannada.woff2) format("woff2");
  unicode-range: U+0C80-0CF3, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "SC Kn Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/hubballi-kannada.woff2) format("woff2");
  unicode-range: U+0C80-0CF3, U+200C-200D, U+25CC;
}

/* Text font choices (Settings → Text font). Each family joins its Marathi and English letters; a browser downloads
   a file only when someone picks that font (the service worker then keeps it for offline use). */
@font-face {
  font-family: "SC Classic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-serif-deva-devanagari.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "SC Classic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-serif-latin.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: "SC Classic";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/noto-serif-latin-ext.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "SC Bold";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/sura-devanagari-400.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "SC Bold";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/sura-latin-400.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: "SC Bold";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/sura-latin-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "SC Bold";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/sura-devanagari-700.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "SC Bold";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/sura-latin-700.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: "SC Bold";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/sura-latin-ext-700.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "SC Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/kalam-devanagari-400.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "SC Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/kalam-latin-400.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: "SC Hand";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/kalam-latin-ext-400.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "SC Hand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/kalam-devanagari-700.woff2) format("woff2");
  unicode-range: U+0900-097F, U+1CD0-1CF4, U+1CF7-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B0A;
}
@font-face {
  font-family: "SC Hand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/kalam-latin-700.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: "SC Hand";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url(../fonts/kalam-latin-ext-700.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==== Theme colours and fonts ==== */
:root {
  --bg: #fcf9f4;
  --surface: #f4ecd8;
  --ink: #391a0e;
  --muted: #6d5a4c;
  --accent: #7b1113;
  --rule: #d9c9b4;
  --bar: #fcf9f4ee;
  --head:
    "Tiro Devanagari Marathi", "Kohinoor Devanagari", "Noto Sans Devanagari", "Devanagari Sangam MN", "Nirmala UI",
    Mangal, serif;
  --body: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, sans-serif;
  --fs: 21px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --bg: #17110e;
    --surface: #241a15;
    --ink: #efe3d4;
    --muted: #b4a08f;
    --accent: #e8a98c;
    --rule: #3a2d25;
    --bar: #17110eee;
    color-scheme: dark;
  }
}

:root[data-pref="dark"] {
  --bg: #17110e;
  --surface: #241a15;
  --ink: #efe3d4;
  --muted: #b4a08f;
  --accent: #e8a98c;
  --rule: #3a2d25;
  --bar: #17110eee;
  color-scheme: dark;
}
:root[data-pref="light"] {
  --bg: #fcf9f4;
  --surface: #f4ecd8;
  --ink: #391a0e;
  --muted: #6d5a4c;
  --accent: #7b1113;
  --rule: #d9c9b4;
  --bar: #fcf9f4ee;
  color-scheme: light;
}
:root[data-pref="sepia"] {
  --bg: #efe0c3;
  --surface: #e4d1ab;
  --ink: #3b2a17;
  --muted: #6a5436;
  --accent: #7a2418;
  --rule: #cdb78d;
  --bar: #efe0c3ee;
  color-scheme: light;
}

/* ==== Page, top bar and buttons ==== */
html {
  -webkit-text-size-adjust: 100%;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--body);
  padding-inline: 16px;
  padding-block: 0 40px;
  line-height: 1.7;
  font-size: var(--fs);
}
.wrap {
  max-width: 34rem;
  margin: 0 auto;
}
.bar {
  top: env(safe-area-inset-top, 0px);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  background: var(--bar);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  margin-inline: -16px;
}
.bar .t {
  font: 700 15px/1.2 var(--body);
  color: var(--accent);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tools {
  display: flex;
  flex: none;
}
button {
  font: 600 15px/1 var(--body);
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
button[aria-pressed="true"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

/* ==== Home page contents list ==== */
#home {
  padding-block: 28px 24px;
}
#home h1 {
  font: 400 1.6em/1.25 var(--head);
  color: var(--accent);
  margin: 0 0 4px;
  text-align: center;
  text-wrap: balance;
}

ol.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--rule);
}
ol.toc li {
  border-bottom: 1px solid var(--rule);
}
ol.toc a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 14px 4px;
  min-height: 48px;
  text-decoration: none;
  color: var(--ink);
}
ol.toc a:active {
  background: var(--surface);
}
ol.toc .m {
  font: 400 1.05em/1.3 var(--head);
  color: var(--ink);
}


/* ==== Pieces: header, verses, previous / next links ==== */
.ash h2 {
  font: 400 1.4em/1.3 var(--head);
  color: var(--accent);
  margin: 0;
  text-wrap: balance;
}

.ash header::after {
  content: "";
  width: 56px;
  height: 2px;
  background: var(--accent);
  margin: 16px auto 6px;
  opacity: 0.7;
}
.verse {
  text-align: center;
  margin: 0 0 1.15em;
  padding: 0.1em 0;
}
.verse p {
  margin: 0;
  text-wrap: pretty;
}
.verse.bold p {
  font-weight: 700;
}

.verse p {
  overflow-wrap: anywhere;
}
/* End of each piece: ‹ Previous | Home + Search | Next › (the search button works like the top bar's) */
.pn {
  display: grid;
  gap: 8px;
  margin-top: 22px;
}
.pn > a {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: 500 16.5px/1.3 var(--head);
  min-height: 64px;
}
.pn small {
  display: flex;
  align-items: center;
  gap: 3px;
  font: 600 12.5px/1 var(--body);
  letter-spacing: 0.02em;
  color: var(--accent);
}
.pn small span {
  display: inline;
}
.pn .next {
  text-align: right;
}
.pn .next small {
  justify-content: flex-end;
}
.pn span {
  display: block;
}
.pn svg {
  flex: none;
}
.pnq {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pnq a,
.pnq button {
  flex: 1;
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.pn > a:active,
.pnq a:active,
.pnq button:active {
  background: var(--rule);
}


/* ==== Language switching: .mr and .en parts shown according to data-lang ==== */
:root {
  --lat: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
[data-lang="en"] .mr,
[data-lang="mr"] .en {
  display: none !important;
}
.en {
  font-family: var(--lat);
}

.verse .en p {
  font-size: 0.86em;
  line-height: 1.6;
}
[data-lang="both"] .verse .en {
  color: var(--muted);
  font-size: 0.72em;
  margin-top: 0.15em;
  line-height: 1.5;
}
[data-lang="both"] .verse .en p {
  font-size: 1em;
}

[data-lang="both"] h2 .en,
[data-lang="both"] ol.toc .en,
[data-lang="both"] .pn > a > .en {
  display: block;
  font-size: 0.55em;
  color: var(--muted);
  font-weight: 400;
}

[data-lang="en"] h2,
[data-lang="en"] ol.toc .m {
  font-family: var(--lat);
}
[data-lang="en"] h2 {
  font-size: 1.1em;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.ash h2 {
  overflow-wrap: anywhere;
}
[data-lang="en"] ol.toc .m {
  font-size: 0.95em;
  font-weight: 600;
}

/* ==== Settings panel ==== */

/* ==== Wider screens (820px and up) ==== */
@media (min-width: 820px) {
  .wrap {
    max-width: 46rem;
  }
  ol.toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }
  .bar {
    margin-inline: -16px;
  }
  .pn {
    max-width: 46rem;
  }
  .verse p {
    font-size: 1.05em;
  }
}
#home h1[data-lang="both"] .en {
  display: block;
  font-size: 0.55em;
  color: var(--muted);
}


/* ==== Piece spacing; contents + search overlay (#jump) ==== */
.bar {
  padding-inline: max(16px, calc((100vw - 46rem) / 2));
}

.ash {
  scroll-margin-top: 60px;
  border-top: 1px solid var(--rule);
  margin-top: 34px;
}
.ash:first-of-type {
  margin-top: 8px;
}
.ash header {
  padding-block: 26px 8px;
}
.ash header .mr,
.ash header .en {
  overflow-wrap: anywhere;
}
#jump {
  top: 61px;
  margin-inline: -16px;
  padding: 10px 16px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--rule);
}
#jump[hidden] {
  display: none;
}
#jump ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
#jump a {
  display: flex;
  flex-direction: column;
  min-height: 48px;
  padding: 6px 12px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font: 500 15px/1.3 var(--body);
}
#jump a.on {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
#jl .en {
  font-size: 0.8em;
}
#jl[data-lang="both"] .en {
  display: block;
  opacity: 0.8;
}


/* ==== Reduced motion; print (first set of print rules, more further down) ==== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
@media print {
  :root:root:root[data-pref],
  :root:root:root {
    --bg: #fff;
    --surface: #fff;
    --ink: #000;
    --muted: #444;
    --accent: #7b1113;
    --rule: #bbb;
    color-scheme: light;
  }
  html {
    scroll-behavior: auto;
  }
  body {
    background: #fff !important;
    color: #000;
    font-size: 14pt !important;
    padding: 0 !important;
    line-height: 1.55;
  }
  .bar,
#jump {
    display: none !important;
  }
  .wrap {
    max-width: none;
  }
  #home {
    padding: 0 0 10px;
    break-after: page;
  }
  ol.toc {
    display: block;
  }
  ol.toc a {
    padding: 6px 4px;
    min-height: 0;
  }
  ol.toc .m {
    font-size: 15pt;
  }
  .ash {
    break-before: auto;
    break-inside: auto;
    margin: 0 0 22pt;
    border: 0;
    animation: none !important;
  }
  .ash:first-of-type {
    break-before: auto;
  }
  .ash header {
    break-after: avoid;
    padding-top: 0;
  }
  .ash h2 {
    font-size: 22pt;
  }
  .verse {
    break-inside: avoid;
    margin: 0 0 0.9em;
  }
  [data-lang="both"] .verse .en {
    font-size: 0.78em;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .ash {
    animation: in 0.18s ease-out;
  }
  @keyframes in {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
}


/* ==== Tapped-line highlight, high contrast, language tag ==== */
:root {
  --hl: #f9e4a6;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --hl: #4d3a22;
  }
}
:root[data-pref="dark"] {
  --hl: #4d3a22;
}
:root[data-pref="sepia"] {
  --hl: #dcbf86;
}
:root[data-pref="light"] {
  --hl: #f9e4a6;
}
:root:root:root[data-hc="1"] {
  --bg: #000;
  --surface: #141414;
  --ink: #fff;
  --muted: #f2f2f2;
  --accent: #ffd54a;
  --rule: #fff;
  --bar: #000;
  --hl: #ffd54a;
  color-scheme: dark;
}
[data-hc="1"] body {
  font-weight: 500;
}
[data-hc="1"] .verse p.hl {
  color: #000;
}
[data-lang="both"] .tag .en {
  display: none;
}
.tag {
  display: inline-block;
  margin-top: 8px;
  padding: 1px 12px;
  border: 1px solid var(--rule);
  border-radius: 99px;
  font: 600 13px/1.7 var(--body);
  color: var(--muted);
}
.verse p {
  cursor: pointer;
  border-radius: 8px;
  -webkit-tap-highlight-color: transparent;
  padding-inline: 0.25em;
}
.verse p.hl {
  background: var(--hl);
}
/* the stanza (or dhrupad) holding the tapped line gets a soft band with a gold rule, so the place is easy
   to find again at a glance (class "hli", set with the line's "hl"); screen only */
@media screen {
  .hli {
    background: var(--hdr);
    box-shadow: inset 3px 0 0 var(--gold);
    border-radius: 10px;
  }
}
/* the transliteration under a tapped line keeps full contrast on the highlight */
html:not([data-hc="1"]) [data-lang="both"] .verse .en p.hl {
  color: var(--ink);
}
/* parts of a long line between preferred break points (see "Preferred line breaks" in the script) */
.zs {
  display: inline-block;
}
@keyframes fl {
  from {
    background: var(--hl);
  }
  to {
    background: transparent;
  }
}
p.fl {
  animation: fl 1.6s ease-out;
}

/* ==== Dhrupad: data-ref="1" shows it once at the top (.rftop) and hides the repeats (.rf); .rmk marks where it is sung ==== */
.rftop,
.rmk {
  display: none;
}
[data-ref="1"] .rftop {
  display: block;
}
[data-ref="1"] .item.rf,
[data-ref="1"] p.rf {
  display: none;
}
[data-ref="1"] .rmk {
  display: block;
}
.rftop {
  text-align: center;
}
.rftop .lab {
  margin-bottom: 0.3em;
}
.rmk {
  text-align: center;
  color: var(--muted);
  font: 600 0.6em/1.2 var(--body);
  margin: -0.2em 0 0.6em;
}
.items {
  display: block;
}

/* ==== Search box and results, status message (#szt), settings panel details ==== */

#q {
  width: 100%;
  box-sizing: border-box;
  height: 46px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 0 14px;
  font: 16px var(--body);
  background: var(--surface);
  color: var(--ink);
}
#res {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 52vh;
  overflow: auto;
}
#res li {
  border-bottom: 1px solid var(--rule);
}
#res button {
  display: block;
  width: 100%;
  height: auto;
  text-align: start;
  border: 0;
  background: none;
  border-radius: 0;
  padding: 10px 4px;
  font: 400 16px/1.45 var(--body);
}
#res .rs {
  display: block;
  font: 600 12px var(--lat);
  color: var(--muted);
}
#res .rl {
  display: block;
}
#res mark {
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: inherit;
  font-weight: 700;
  border-radius: 3px;
  padding: 0 1px;
}
#res .rl2 {
  display: block;
  font: 14px var(--lat);
  color: var(--muted);
}
#none {
  padding: 10px 4px;
  color: var(--muted);
  font-size: 15px;
}

#hm {
  font-size: 22px;
  padding-inline: 12px;
}
html,
body {
  touch-action: pan-x pan-y;
}
#szt {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 99px;
  font: 700 15px var(--lat);
  z-index: 9;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
#szt.on {
  opacity: 0.92;
}
/* After a pinch: a pill in the same place that puts the text size back to the default in one tap */
#szr {
  position: fixed;
  left: 50%;
  top: 84px;
  transform: translateX(-50%);
  z-index: 9;
  height: 40px;
  padding: 0 18px;
  border-radius: 99px;
  border: 0;
  background: var(--accent);
  color: var(--bg);
  font: 700 15px var(--lat);
  box-shadow: 0 2px 10px #0003;
}
#szr .mr {
  font-family: var(--body);
}
@media print {
  #szr {
    display: none !important;
  }
}
[hidden] {
  display: none !important;
}
.wide {
  width: 100%;
  height: 42px;
  border-color: var(--accent);
  color: var(--accent);
}


/* ==== Phones held sideways ==== */
@media (orientation: landscape) and (max-height: 520px) {
  body {
    line-height: 1.5;
  }
  .bar {
    padding-block: 4px;
  }
  .bar button {
    height: 38px;
  }
  .ash header {
    padding-block: 10px 4px;
  }
  .ash header::after {
    margin: 8px auto 2px;
  }

  .verse {
    margin-bottom: 0.7em;
  }
}
@media print {
  :root:root:root:root[data-hc="1"] {
    --bg: #fff;
    --surface: #fff;
    --ink: #000;
    --muted: #444;
    --accent: #7b1113;
    --rule: #bbb;
    --hl: #fff;
    color-scheme: light;
  }
  [data-hc="1"] body {
    font-weight: 400;
  }
  .verse p.hl {
    background: none !important;
  }

  .pn {
    display: none !important;
  }
}


/* ==== Group headings (पूजा / भजने / आरती) in the contents; "coming soon"; section dividers ==== */
.gh {
  font: 700 0.74em/1.2 var(--body);
  color: var(--accent);
  margin: 24px 0 8px;
  padding: 0 4px;
  letter-spacing: 0.03em;
}
[data-lang="both"] .gh .en {
  font-size: 0.85em;
  color: var(--muted);
  font-weight: 600;
  margin-left: 0.5em;
}
[data-lang="en"] .gh {
  font-family: var(--lat);
}
ol.toc li.soon .m {
  display: block;
  padding: 14px 4px;
  color: var(--muted);
  font: 400 0.9em/1.3 var(--body);
}
[data-lang="both"] ol.toc li.soon .en {
  display: inline;
  margin-left: 0.5em;
}
#jump li.jh {
  grid-column: 1/-1;
  color: var(--accent);
}
#jump li.jh:first-child {
  padding-top: 0;
}
#jl[data-lang="both"] li.jh .en {
  display: inline;
  margin-left: 0.5em;
  opacity: 0.8;
}
.grp {
  margin: 48px 0 -18px;
  text-align: center;
  font: 700 0.8em/1.2 var(--body);
  color: var(--accent);
  letter-spacing: 0.08em;
}
#home + .grp {
  margin-top: 8px;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
}
.grp + .ash {
  border-top: 0;
}
.grp {
  scroll-margin-top: 64px;
}
.grp[data-lang="both"] .en {
  margin-left: 0.6em;
  color: var(--muted);
}

@media (min-width: 820px) {
  .tocg ol.toc {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 32px;
  }
}
@media print {
  .gh {
    margin-top: 14pt;
  }
  .grp {
    margin: 0 0 8pt;
    break-after: avoid;
  }
}

/* ==== Atharvashirsha: Vedic text in Tiro Devanagari Sanskrit ==== */
#p1 .mr p {
  font-family: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", "Sanskrit 2003", "Kohinoor Devanagari", var(--body);
  line-height: 2.1;
}
#p1 .verse .mr {
  font-size: 1.05em;
}


/* ==== Top-bar title, heading for screen readers, contents overlay refinements ==== */
.sr {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.bar .t.site {
  font: 400 23px/1.25 var(--head);
  color: var(--accent);
}
/* Title follows the text language: English only when the text is English */
.bar .t.site[data-tl="en"] {
  font: 600 19px/1.25 var(--lat);
}
#home {
  padding-top: 6px;
}
.tocg ol.toc {
  margin-left: 18px;
}
.tocg ol.toc li.soon .m {
  padding-left: 4px;
}
@media print {
  .sr {
    position: static !important;
    width: auto;
    height: auto;
    clip: auto;
    font: 400 26pt var(--head);
    color: var(--accent);
    text-align: center;
    margin: 0 0 10pt;
  }
}
ol.toc a {
  box-sizing: border-box;
  justify-content: center;
}
.bar .lb {
  font: 600 17px/1 var(--body);
  min-width: 48px;
}
#jump {
  max-height: calc(100dvh - 90px);
  overflow: auto;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.18);
}
#hm[aria-expanded="true"] {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}
#jump {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  max-width: 46rem;
  box-sizing: border-box;
  z-index: 6;
}
@media (min-width: 820px) {
  #jump {
    border: 1px solid var(--rule);
    border-top: 0;
    border-radius: 0 0 12px 12px;
  }
}

#hm svg {
  display: block;
  margin: auto;
}
#jump #q {
  margin: 0 0 10px;
}
#jump #res {
  display: block;
  max-height: none;
  margin: 0 0 4px;
}
#jump #none {
  padding: 6px 4px 10px;
}

#rb {
  font: 600 19px/1 var(--head);
  min-width: 44px;
}

#aa svg {
  display: block;
  margin: auto;
}
.tools {
  gap: 5px;
}
.bar .t {
  flex: 1 1 auto;
}
a.t {
  text-decoration: none;
  display: block;
}
#rb {
  padding: 0 4px;
}
#rb svg {
  display: block;
  margin: auto;
}
#szt.msg {
  font: 600 16px/1.3 var(--body);
  padding: 10px 18px;
  white-space: nowrap;
}
#szt.msg.err {
  white-space: normal;
  width: min(92vw, 30rem);
  box-sizing: border-box;
  border-radius: 14px;
  text-align: center;
  font-size: 14px;
}
.bar .lb {
  padding: 0 3px;
}
.bar .lb svg {
  display: block;
  margin: auto;
}


/* ==== Share / QR / Print buttons, QR pop-up ==== */
#shr {
  margin: 22px 0 0;
}
#shb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  font-size: 16px;
}
@media print {
  #shr {
    display: none !important;
  }
}

#shr {
  display: grid;
  gap: 10px;
}
#qrb {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  font-size: 16px;
}
#qrm,
#inm {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#qrm[hidden],
#inm[hidden] {
  display: none;
}
.qrc {
  width: min(340px, 100%);
  background: var(--bg);
  border: 1px solid var(--rule);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
}
.qrt {
  font: 600 17px/1.35 var(--body);
  color: var(--accent);
  margin-bottom: 12px;
}
.qri {
  background: #fff;
  border-radius: 10px;
  padding: 6px;
  width: min(280px, 100%);
  aspect-ratio: 1;
  margin: 0 auto;
}
.qru {
  font: 13px/1.4 var(--lat);
  color: var(--muted);
  margin: 10px 0 14px;
  overflow-wrap: anywhere;
}

@media print {
  #qrm,
  #inm,
  .inb {
    display: none !important;
  }
}

/* ==== Add to Home Screen: button on the home page and in Settings, steps pop-up (#inm) ==== */
.inb {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: auto;
  min-height: 48px;
  margin: 22px 0 0;
  font: 16px/1.3 var(--lat);
}
.inb .mr {
  font-family: var(--body);
}
.inb[hidden] {
  display: none;
}
#inb:not([hidden]) + #shr {
  margin-top: 10px;
}
.inl {
  text-align: left;
  font: 16px/1.5 var(--lat);
  margin: 0 0 10px;
  padding-left: 24px;
}
.inl .mr {
  font-family: var(--body);
}
.inl li + li {
  margin-top: 6px;
}
.inn {
  font: 14px/1.45 var(--lat);
  color: var(--muted);
  margin: 0 0 14px;
}
.inn .mr {
  font-family: var(--body);
}


/* ==== Top-bar title with Ganesha (home) icon; Home button in the contents overlay ==== */
.bar .t.site {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 21px;
}
.bar .t.site svg {
  flex: none;
  opacity: 0.85;
}
.bar .t.site span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#jump li.jhome {
  grid-column: 1/-1;
}
#jhb {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  justify-content: flex-start;
  padding: 0 14px;
  font: 500 17px/1 var(--body);
  color: var(--accent);
  border-color: var(--rule);
}
#jhb svg {
  flex: none;
}
[data-lang="both"] #jhb .en {
  display: inline;
  margin-left: 4px;
  font-size: 0.85em;
}
/* Panels take focus when opened (for keyboards and screen readers); the panel itself shows no ring */
/* Skip link: off screen until a keyboard Tab lands on it */
.skip {
  position: fixed;
  left: 8px;
  top: -60px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  font: 600 15px/1.2 var(--lat);
}
.skip:focus {
  top: calc(8px + env(safe-area-inset-top));
}
@media print {
  .skip {
    display: none;
  }
}
#main:focus,
#jump:focus,
h2[tabindex="-1"]:focus {
  outline: none;
}


/* ==== Contents headings (refined) ==== */
.tocg .gh {
  font: 600 1.02em/1.3 var(--head);
  color: var(--accent);
  letter-spacing: 0;
  margin: 24px 0 6px;
  padding: 0 4px 6px;
  border-bottom: 2px solid var(--accent);
}
/* The first group right under the date card */
#home .sr + .tocg .gh {
  margin-top: 10px;
}
.tocg:first-child .gh {
  margin-top: 6px;
}
.tocg[data-lang="en"] .gh {
  font: 600 0.95em/1.3 var(--lat);
}
#jump li.jh {
  font: 600 16px/1.3 var(--head);
  padding: 10px 2px 2px;
}
#jl[data-lang="en"] li.jh {
  font: 600 15px/1.3 var(--lat);
}
.tocg ol.toc {
  border-top: 0;
}
@media print {
  #szt {
    display: none !important;
  }
  .tocg:has(li.soon) {
    display: none !important;
  }
}
@media print {
  .rftop {
    break-inside: avoid;
  }
  .rmk {
    break-before: avoid;
  }
}


/* ==== Share / QR / Print row; print pop-up (#prm); print view (#pv, built by the script just before printing) ==== */
#shr {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
#shr button {
  font-size: 15px;
  padding: 0 6px;
}
.prs {
  display: grid;
  gap: 10px;
  margin: 4px 0 10px;
}
.prs button {
  height: auto;
  min-height: 50px;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.3;
}
.prn {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}
.prx {
  border-color: var(--rule);
  color: var(--ink);
}
#prm {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#prm[hidden] {
  display: none;
}
#pv {
  display: none;
}
@media print {
  @page {
    margin: 9mm 9mm 14mm;
    @bottom-center {
      content: counter(page) " / " counter(pages);
      font: 9pt sans-serif;
      color: #555;
      vertical-align: top;
      padding-top: 3mm;
    }
  }
  #prm {
    display: none !important;
  }
  :root[data-print] .wrap,
  :root[data-print] .bar {
    display: none !important;
  }
  :root[data-print] #pv {
    display: block !important;
    font-size: 13pt;
    line-height: 1.45;
    color: #000;
  }
  #pv .pvh {
    font: 400 22pt/1.2 var(--head);
    color: var(--accent);
    text-align: center;
    margin: 0 0 6pt;
  }
  #pv .pvs {
    margin: 0 0 10pt;
  }
  #pv .pvs h2 {
    font: 400 16pt/1.25 var(--head);
    color: var(--accent);
    text-align: center;
    /* padding rather than margin above, so the tops of the letters stay on the heading's own page */
    margin: 9pt 0 6pt;
    padding-top: 3pt;
    break-after: avoid;
  }
  #pv .pvs h2 .en {
    display: none;
  }
  #pv[data-lang="en"] .pvs h2 .en {
    display: inline;
  }
  #pv[data-lang="en"] .pvs h2 .mr {
    display: none;
  }
  #pv .pvt {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    margin: 0 0 4pt;
  }
  #pv .pvt td {
    vertical-align: top;
    padding: 0 8pt;
  }
  #pv .pvt tr {
    break-inside: avoid;
  }
  #pv .pv2 td:first-child {
    border-right: 0.5pt solid #bbb;
  }
  #pv .verse {
    margin: 0 0 0.7em;
    break-inside: avoid;
  }
  #pv .verse p {
    padding: 0;
    cursor: auto;
  }
  #pv .rmk {
    display: block;
    text-align: center;
    font-size: 0.75em;
    margin: -0.3em 0 0.5em;
    color: #555;
  }
  #pv .pvref {
    margin: 0 auto 8pt;
    background: none;
    display: table;
  }
  #pv .pvk {
    display: block;
    font-size: 13pt;
    line-height: 1.45;
    break-inside: avoid;
    page-break-inside: avoid;
  } /* Safari splits table rows across pages and ignores keep-together on them; an inline-block cannot be split */
  .wk #pv .pvs {
    font-size: 0;
    line-height: 0;
  }
  .wk #pv .pvk {
    display: inline-block;
    width: 100%;
    vertical-align: top;
  }
  :root[data-print="one"] #pv .pvk {
    font-size: 14pt;
  }
  #pv .pvg {
    font: 600 11pt/1.3 var(--head);
    color: var(--accent);
    text-align: center;
    letter-spacing: 0.04em;
    margin: 6pt 0 0;
  }
  /* Contents on page 1 (it gets a page to itself: see the final print rules) */
  #pv .pvtoc {
    margin: 10pt 0 14pt;
  }
  #pv .pvtoc h3 {
    font: 600 13pt/1.3 var(--head);
    color: var(--accent);
    margin: 16pt 0 4pt;
    padding: 0 0 3pt;
    border-bottom: 1pt solid var(--accent);
  }
  #pv .pvtoc ol {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  #pv .pvtoc li {
    font: 400 13pt/1.35 var(--head);
    padding: 4pt 2pt;
    border-bottom: 0.5pt solid #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  #pv[data-lang="both"] .pvtoc .en {
    display: block;
    font: 400 10pt/1.3 var(--lat);
    color: #555;
  }
  #pv[data-lang="both"] .pvtoc h3 .en {
    display: inline;
    margin-left: 0.5em;
  }
  #pv[data-lang="en"] .pvtoc li,
  #pv[data-lang="en"] .pvtoc h3 {
    font-family: var(--lat);
  }
  :root[data-print="one"] #pv .verse {
    text-align: center;
  }
  #pv .pvk > table {
    margin-bottom: 0;
  }
  #pv .pvside {
    margin: 0;
  }
  #pv .pvside .pvm {
    border-right: 0.5pt solid #bbb;
  }

  #pv .pvside .mr,
  #pv .pvside .en {
    display: block !important;
    text-align: left;
  }
  #pv .pvside .en {
    font-size: 0.92em !important;
    color: #000 !important;
    line-height: 1.45;
  }
  #pv .pvside tr.pvrefrow td {
    border-left: 0;
  }
  #pv .pvside .rmk .mr,
  #pv .pvside .rmk .en,
  #pv .pvside .lab .mr,
  #pv .pvside .lab .en {
    display: inline !important;
    margin-right: 0.7em;
  }
  #pv .pvg .en {
    margin-left: 0.5em;
    font-weight: 400;
  }
  #pv .pvside .lab {
    font-size: 0.7em;
    color: #555;
  }

  #pv .pvs[data-sid="p1"] .mr p {
    font-family: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", var(--body);
    line-height: 1.9;
  }
}

@media print {
  #pv .pvh .en {
    display: none;
  }
  #pv[data-lang="en"] .pvh .en {
    display: inline;
  }
  #pv[data-lang="en"] .pvh .mr {
    display: none;
  }
  #pv .pvside td {
    padding: 1pt 10pt;
    vertical-align: baseline;
  }
  #pv .pvside td.pve {
    font-family: var(--lat);
    font-size: 0.9em;
    color: #000;
  }
  #pv .pvside tr.pvend td {
    padding-bottom: 9pt;
  }
  #pv .pvside tr.pvb td {
    font-weight: 700;
  }
  [data-ref="1"] #pv .pvside tr.rfl {
    display: none;
  }
  #pv .pvs[data-sid="p1"] td.pvm {
    font-family: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", var(--body);
  }
  #pv .pvside td.mr,
  #pv .pvside td.en {
    display: table-cell !important;
  }
}
@media print {
  #p1 .mr p {
    line-height: 1.75;
  }
  #p1 .verse {
    margin-bottom: 0.6em;
  }
}
#home h2.gh {
  margin-left: 0;
  margin-right: 0;
}
@media print {
  #pv .pvh {
    break-after: avoid;
  }
  #pv .pvs h2,
  #pv .pvref {
    break-after: avoid;
  }
}


/* ==== Piece header card (saffron, maroon top edge) ==== */
:root {
  --hdr: #fbe9cf;
  --hdrl: #efcf9f;
  --hdrt: #fff6e8;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --hdr: #2a1d16;
    --hdrl: #4a3426;
    --hdrt: #1f1611;
  }
}
:root[data-pref="dark"] {
  --hdr: #2a1d16;
  --hdrl: #4a3426;
  --hdrt: #1f1611;
}
:root[data-pref="light"] {
  --hdr: #fbe9cf;
  --hdrl: #efcf9f;
  --hdrt: #fff6e8;
}
:root[data-pref="sepia"] {
  --hdr: #e8cfa0;
  --hdrl: #d4b47f;
  --hdrt: #f1e1c2;
}
:root:root:root[data-hc="1"] {
  --hdr: #000;
  --hdrl: #fff;
  --hdrt: #000;
}
.ash header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 4px 12px;
  margin: 26px 0 18px;
  padding: 12px 14px;
  background: var(--hdr);
  border: 1px solid var(--hdrl);
  border-top: 4px solid var(--accent);
  border-radius: 12px;
  text-align: center;
}
.ash header::after {
  display: none;
}
.ash header h2 {
  flex: 0 1 auto;
  min-width: 0;
}
.ash header .tag {
  margin: 0;
  background: var(--hdrt);
  border-color: var(--hdrl);
}
.ash[data-lang="both"] header h2 .en {
  margin-top: 2px;
}
.grp + .ash header {
  margin-top: 14px;
}
@media (orientation: landscape) and (max-height: 520px) {
  .ash header {
    margin: 14px 0 10px;
    padding: 8px 12px;
  }
}
@media print {
  .ash header {
    background: none !important;
    border: 1pt solid #bbb;
    border-top: 3pt solid #7b1113;
    margin: 6pt 0 10pt;
    padding: 6pt 10pt;
  }
  .ash header .tag {
    background: none;
  }
}

/* ==== Dhrupad at the top: small label above, thin rule on the left (final look below) ==== */
[data-lang="both"] .rftop .lab .en::before {
  content: " · ";
}

.rftop {
  border-inline-start: 1px dashed var(--rule);
}
.rftop .lab {
  top: 0;
  left: 50%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item.rf p,
.verse p.rf,
.rftop p {
  font-weight: 600;
}
[data-hc="1"] .rftop {
  border-color: #fff;
}
@media print {
  .rftop {
    border-left: 1pt dashed #999;
  }
}
.rftop .verse {
  margin-bottom: 0.35em;
}

:root {
  --gold: #d8b27a;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --gold: #8f6c3f;
  }
}
:root[data-pref="dark"] {
  --gold: #8f6c3f;
}
:root[data-pref="light"] {
  --gold: #d8b27a;
}
:root[data-pref="sepia"] {
  --gold: #b8925a;
}
:root:root:root[data-hc="1"] {
  --gold: #fff;
}
.rftop {
  position: static;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}
.rftop .lab {
  position: static;
  transform: none;
  max-width: none;
  white-space: normal;
  background: none;
  padding: 0;
  margin: 0 0 4px;
  font: 600 11px/1.4 var(--body);
  color: var(--muted);
  letter-spacing: 0.03em;
}
.rftop .verse {
  border-left: 2px solid var(--gold);
  border-radius: 0;
  padding: 2px 0 2px 6px;
  margin: 0;
}
[data-hc="1"] .rftop {
  border: 0;
}
@media print {
  .rftop {
    border: 0 !important;
    background: none;
  }
  .rftop .lab {
    background: none;
  }
  .rftop .verse {
    border-left: 1pt solid #999;
  }
  #pv .pvref {
    border-left: 1pt solid #999 !important;
  }
}
.rftop {
  margin: 6px 10px 1.3em;
}


/* ==== Two columns on wide screens (data-cols="2"); the script assigns each stanza its grid row ==== */
[data-cols="2"] .wrap {
  max-width: 76rem;
}
[data-cols="2"] .bar {
  padding-inline: max(16px, calc((100vw - 76rem) / 2));
}
[data-cols="2"] .ash header,
[data-cols="2"] .rftop {
  max-width: 46rem;
  margin-left: auto;
  margin-right: auto;
}
@media screen {
  [data-cols="2"] .items {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 64px;
    align-items: start;
  }
  [data-cols="2"] .rftop .verse {
    width: fit-content;
    margin-inline: auto;
    padding-right: 1em;
  }
  [data-cols="2"] .pn {
    margin-inline: auto;
  }
}

[data-cols="2"] #home {
  max-width: 46rem;
  margin: 0 auto;
}
/* stanza columns drawn closer together in pieces of short lines (--pull, set by the script: pull()) */
@media screen {
  /* the translate property, not transform, so the fade-in on scroll (which animates transform) leaves it be */
  [data-cols="2"] .items > .c1 {
    translate: var(--pull, 0px) 0;
  }
  [data-cols="2"] .items > .c2 {
    translate: calc(-1 * var(--pull, 0px)) 0;
  }
}
@media print {
  [data-cols="2"] .wrap {
    max-width: none;
  }
  [data-cols="2"] .items {
    column-count: 1;
    column-rule: none;
  }
  [data-cols="2"] #home,
  [data-cols="2"] .ash header,
  [data-cols="2"] .rftop {
    max-width: none;
  }
}

/* ==== Piece numbers (.no) and stanza numbers (.sn, added by the script) ==== */
.no {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-weight: 600;
  margin-right: 0.15em;
}
.no .ne,
[data-lang="en"] .no .nm,
[data-lang="both"] .no .nm {
  display: none;
}
[data-lang="en"] .no .ne,
[data-lang="both"] .no .ne {
  display: inline;
}
.sn {
  white-space: nowrap;
  color: var(--muted);
  font-weight: 400;
  font-size: 0.85em;
}
@media print {
  /* final dhrupad styling in print: one gold rule beside the dhrupad text */
  #pv .pvref {
    border: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
  }
  #pv .pvside tr.pvrefrow td.pvm {
    box-shadow: none !important;
    border-left: 2pt solid var(--accent) !important;
    padding-left: 10pt;
  }
}
@media print {
  /* ==== Print: page border, contents on its own page, two-column flow (final rules) ==== */
  /* light border on every page: a fixed box repeats on each printed page (around the page area);
     the print view keeps a little space inside it on every page (box-decoration-break: clone).
     Only where the browser can do both, so text never touches the line. */
  @supports (box-decoration-break: clone) {
    :root[data-print] #pv {
      box-decoration-break: clone;
      padding: 6mm 7mm;
    }
    :root[data-print] #pv::before {
      content: "";
      position: fixed;
      inset: 0;
      border: 0.75pt solid #c9ab7f;
      border-radius: 2mm;
      pointer-events: none;
    }
  }
  #pv .pvtoc {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
    break-after: page;
    page-break-after: always;
  }
  /* contents in two columns read top to bottom; a grid, because Safari ignores CSS columns in print */
  #pv .pvtoc ol {
    columns: auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-flow: column;
    column-gap: 28pt;
  }
  /* page number at the right of each contents line */
  #pv .pvtoc li[data-sid] {
    position: relative;
    padding-right: 26pt;
  }
  #pv .pvtoc .pgn {
    position: absolute;
    right: 2pt;
    top: 4pt;
    font: 400 12pt/1.35 var(--lat);
    color: #555;
  }
  #pv[data-lang="mr"] .pvtoc .pgn {
    font-family: var(--head);
  }
  /* two columns: stanzas run down the left column to the foot of the page, then down the right */
  #pv .pvhd {
    break-after: avoid;
    page-break-after: avoid;
  }
  #pv .pvc {
    columns: 2;
    column-gap: 16pt;
    column-rule: 0.5pt solid #bbb;
    column-fill: balance;
    margin: 0 0 6pt;
  }
  #pv .pvc .pvk {
    break-inside: avoid;
    page-break-inside: avoid;
    -webkit-column-break-inside: avoid;
  }
  #pv .pvc .verse {
    text-align: center;
  }
  /* each piece starts at the top of a new page: a forced break is the one page rule Chrome and
     Safari both follow, so every print breaks the same way and the contents numbers stay right */
  #pv .pvs + .pvs {
    break-before: page;
    page-break-before: always;
  }
  #pv .pvs:last-child {
    margin-bottom: 0;
  }
  /* a page break the print plan forces (see paginate) */
  #pv .pvbr {
    display: block;
    height: 0;
    margin: 0;
    break-before: page;
    page-break-before: always;
  }
  /* nothing after the last piece, so Safari adds no empty page at the end */
  .wk[data-print] body {
    margin: 0;
  }
  /* pages always print upright (the contents numbers are worked out for upright pages) */
  @page {
    size: portrait;
  }
}

/* ==== Share / QR / Print use the Latin font ==== */
#shr button,
#prm .qrt,
#prm .prn,
#prm button {
  font-family: var(--lat);
}
#shr {
  align-items: stretch;
}
#shr button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin: 0;
}
#shr button svg {
  margin-right: 8px !important;
  vertical-align: 0 !important;
}

/* ==== Button rows (final rules), styled like the top menu: home page (#shr: App, Share, QR, Print, Help)
   and the bottom of Settings (#shr2: App, Help) ==== */
#shr {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin: 18px 0 6px;
}
#shr button {
  flex: 1 1 0;
  min-width: 0;
  max-width: 128px;
  height: 44px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 0 2px;
  border: 1px solid var(--rule);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: 500 13.5px/1 var(--lat);
  text-decoration: none;
  white-space: nowrap;
}
#shr button[hidden] {
  display: none;
}
#shr button .mr {
  font-family: var(--body);
}
#shr button svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0 !important;
}
/* Version number beside the Settings title, so we can tell which copy a phone is showing */
/* Narrow phones: icons only (each button keeps its spoken name in aria-label) */
@media (max-width: 379px) {
  #shr button span {
    display: none !important;
  }
}

/* ==== Both languages on wide screens: each Marathi line with its transliteration beside it ==== */
@media screen {
  [data-cols="2"] [data-lang="both"] .items {
    display: block;
  }
  [data-cols="2"] [data-lang="both"] .verse {
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
    column-gap: 40px;
    align-items: baseline;
  }
  [data-cols="2"] [data-lang="both"] .verse > .mr,
  [data-cols="2"] [data-lang="both"] .verse > .en {
    display: contents;
  }
  [data-cols="2"] [data-lang="both"] .verse > .mr > p {
    grid-column: 1;
    text-align: right;
  }
  [data-cols="2"] [data-lang="both"] .verse > .en {
    font-size: 0.8em;
    line-height: 1.5;
  }
  [data-cols="2"] [data-lang="both"] .verse > .en > p {
    grid-column: 2;
    text-align: left;
    font-size: 1em;
    margin: 0;
  }
  [data-cols="2"] [data-lang="both"] .rftop {
    max-width: none;
  }
  [data-cols="2"] [data-lang="both"] .rftop .verse {
    width: auto;
  }
  [data-cols="2"] [data-lang="both"] .rftop .lab {
    text-align: center;
  }
  [data-cols="2"] [data-lang="both"] .items .item,
  [data-cols="2"] [data-lang="both"] .items .rmk {
    grid-row: auto !important;
    grid-column: auto !important;
  }
}


/* ==== Left menu (contents) on screens 1100px and wider ==== */
#rail {
  display: none;
}
:root {
  --ww: 46rem;
}
[data-cols="2"] {
  --ww: 76rem;
}
/* With the side menu (iPad landscape, desktop) the page sits right beside the menu and uses its whole width, up to 60rem */
[data-rail="1"] {
  --ww: 60rem;
}
@media screen and (min-width: 1100px) {
  [data-rail="1"] {
    --W: min(var(--ww), calc(100vw - 340px));
    --L: max(24px, calc((100vw - 260px - var(--W)) / 2));
  }
  [data-rail="1"] .wrap {
    max-width: var(--W);
    margin-left: calc(var(--L) + 260px);
    margin-right: 0;
  }
  [data-rail="1"] .bar {
    padding-left: calc(var(--L) - 8px);
    padding-right: max(16px, calc(100vw - var(--L) - 260px - var(--W) - 8px));
  }
  [data-rail="1"] #rail {
    display: block;
    position: fixed;
    z-index: 4;
    left: var(--L);
    top: 72px;
    width: 220px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    padding: 4px 6px 12px 0;
    scrollbar-width: thin;
  }
  #rail .rg,
  #rail a.rg {
    display: block;
    font: 600 13px/1.3 var(--head);
    color: var(--accent);
    margin: 14px 0 4px;
    padding: 0 8px 4px;
    border: 0;
    border-bottom: 1px solid var(--rule);
    border-radius: 0;
  }
  #rail a.rg {
    padding-top: 6px;
    margin-top: 8px;
  }
  @media (hover: hover) {
    #rail a.rg:hover {
      background: var(--surface);
    }
  }
  #rail[data-lang="both"] a.rg .en {
    display: none;
  }
  #rail .rg:first-child {
    margin-top: 0;
  }
  #rail .rg .en {
    display: none;
  }
  #rail[data-lang="en"] .rg .en {
    display: inline;
  }
  #rail ul {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  #rail a {
    display: block;
    padding: 6px 8px 6px 10px;
    border-left: 3px solid transparent;
    border-radius: 0 8px 8px 0;
    color: var(--ink);
    text-decoration: none;
    font: 400 15px/1.35 var(--head);
  }
  #rail[data-lang="en"] a {
    font: 500 14px/1.35 var(--lat);
  }
  #rail a .en {
    display: none;
  }
  #rail[data-lang="en"] a .en {
    display: inline;
  }
  #rail[data-lang="en"] a .mr {
    display: none;
  }
  #rail[data-lang="both"] a .en {
    display: block;
    font: 400 11.5px/1.3 var(--lat);
    color: var(--muted);
  }
  #rail a .no {
    color: var(--muted);
    font-weight: 400;
    margin-right: 0.3em;
  }
  @media (hover: hover) {
    #rail a:hover {
      background: var(--surface);
    }
  }
  #rail a.on {
    border-left-color: var(--accent);
    background: var(--hdr);
    color: var(--accent);
  }
  #rail a.on .no {
    color: var(--accent);
  }
}

/* ==== Reading progress line under the top bar ==== */
.bar {
  position: sticky;
}
#prog {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  opacity: 0.75;
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ==== Dhrupad markers (↻ ध्रुपद) as small pills ==== */
@media screen {
  [data-ref="1"] .rmk {
    display: block;
    width: fit-content;
    margin: 0.15em auto 0.8em;
    padding: 1px 12px 2px;
    border-radius: 999px;
    background: var(--hdr);
    border: 1px solid var(--hdrl);
    color: var(--accent);
    font: 600 0.58em/1.6 var(--body);
    letter-spacing: 0.02em;
  }
  [data-cols="2"] .items > .rmk {
    justify-self: center;
  }
}

/* ==== The top of the home page sits on a raised "paper sheet" ====
   Phones and tablets: greeting, date card, Share/QR/Print and Help (.top). Wide screens with the left
   contents menu: the whole top piece (#home, down to Help), since its contents list is hidden there. */
:root {
  --sheet: color-mix(in srgb, var(--bg) 45%, #fff);
  --sheet-sh: 0 1px 2px rgb(60 30 10 / 0.06), 0 10px 28px -14px rgb(60 30 10 / 0.22);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --sheet: color-mix(in srgb, var(--surface) 60%, var(--bg));
    --sheet-sh: 0 10px 28px -14px rgb(0 0 0 / 0.6);
  }
}
:root[data-pref="dark"] {
  --sheet: color-mix(in srgb, var(--surface) 60%, var(--bg));
  --sheet-sh: 0 10px 28px -14px rgb(0 0 0 / 0.6);
}
/* High contrast is always black, whichever theme is picked, so the sheet uses the dark mix */
:root:root:root[data-hc="1"] {
  --sheet: color-mix(in srgb, var(--surface) 60%, var(--bg));
  --sheet-sh: none;
}
/* The card matches the section rows below it (Contents, Pooja, Aarti): accent bar on top, same border and corners */
.top {
  background: var(--hdr);
  border: 1px solid var(--hdrl);
  border-top: 3px solid var(--accent);
  border-radius: 12px;
  padding: 10px 10px 2px;
  margin-bottom: 8px;
}
/* the card's own top bar replaces the Ganesha band's (kept on wide screens, where the card has no frame) */
.top .hero {
  border-top: 0;
}
@media screen and (min-width: 1100px) {
  [data-rail="1"] #home {
    margin-top: 16px;
    padding-bottom: 0;
  }
  [data-rail="1"] .top {
    margin-bottom: 0;
  }
}
@media print {
  .top {
    background: none;
    border: 0;
    box-shadow: none;
  }
}

/* ==== Offline: a small muted cloud in the top bar (#ofb) while there is no internet; the saved copy is in use.
   Not a warning, so no colour. Settings → About says whether the site is saved for offline use. ==== */
:root {
  --ok: #1f8a4c;
  --warn: #a8650a;
  --warnbg: #fbefd9;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --ok: #5fd08e;
    --warn: #f0b35a;
    --warnbg: #3a2a12;
  }
}
:root[data-pref="dark"],
:root:root:root[data-hc="1"] {
  --ok: #5fd08e;
  --warn: #f0b35a;
  --warnbg: #3a2a12;
}
.top {
  position: relative;
}
#ofb {
  display: inline-grid;
  place-items: center;
  width: 30px;
  align-self: center;
  color: var(--muted);
  opacity: 0.8;
}
#ofb[hidden] {
  display: none;
}
@media print {
  #ofb {
    display: none !important;
  }
}

/* ==== Lotus ornament at the end of each piece ==== */
.fin {
  display: flex;
  justify-content: center;
  color: var(--gold);
  margin: 22px 0 4px;
  opacity: 0.9;
}
.fin svg {
  max-width: 60%;
  height: auto;
}

/* ==== Home page saffron band with ॐ ==== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 2px 0 10px;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: linear-gradient(180deg, var(--hdr), transparent);
  border-top: 3px solid var(--accent);
  text-align: center;
}
.hero .hl1 {
  font: 400 0.95em/1.4 var(--head);
  color: var(--accent);
  letter-spacing: 0.02em;
}

/* ==== Quieter piece number and language tag in headers ==== */
.ash header .no {
  font-weight: 400;
  font-size: 0.86em;
  color: var(--muted);
  margin-right: 0.1em;
}
.ash header .tag {
  line-height: 1.6;
  padding: 0 9px;
  color: var(--ink);
  font-weight: 500;
}

/* ==== Gentle fade-in on scroll (class added and removed by the script) ==== */
@keyframes fxin {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.fx-in {
  animation: fxin 0.5s ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .fx-in {
    animation: none;
  }
}
@media print {
  #rail,
  #prog,
  .hero,
  .fin {
    display: none !important;
  }
  .fx-in {
    animation: none !important;
  }
  .rmk {
    background: none !important;
    border: 0 !important;
  }
}


/* ==== Next Sankashti card (home page) ==== */
.skc {
  margin: 0 0 14px;
  padding: 8px 12px 8px;
  border: 1px solid var(--hdrl);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}
.skc.today {
  box-shadow: 0 0 0 2px var(--hdr) inset;
}
.skc .skh {
  font: 600 0.8em/1.4 var(--body);
  color: var(--accent);
  letter-spacing: 0.02em;
}
.skc .skd {
  font: 400 1.15em/1.3 var(--head);
  margin: 0;
}
/* Calendar button after the date */
.skc .skd #skcal {
  margin: -6px -8px -6px 2px;
  vertical-align: -3px;
}
/* Pin button after the place name: use / update my location */
.skc .skli {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: -6px -4px -6px -2px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--accent);
  cursor: pointer;
}
.skc .skm .skli svg {
  color: inherit;
}
.skc .skli:focus-visible,
.skc #skb:focus-visible,
.skc #skall:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}
.skc #skb:not([hidden]),
.skc #skall {
  display: block;
  margin: 6px auto 0;
}
.skc #skall {
  margin: 2px auto -6px;
  font-size: 12px;
  color: var(--muted);
}
/* On the day: pooja time and moonrise countdown */
.skc .skcd {
  margin-top: 2px;
  font: 600 13px/1.4 var(--lat);
  color: var(--accent);
}
.skc .skcd .mr {
  font-family: var(--body);
}
.skc .skm {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  font-size: 0.92em;
  color: var(--ink);
}
.skc .skm svg {
  color: var(--gold);
}
.skc .skp {
  color: var(--muted);
  font-size: 0.9em;
  font-family: var(--lat);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.skc .skp.own {
  flex-basis: 100%;
  justify-content: center;
}
.skc .skl {
  background: none;
  border: 0;
  padding: 4px 8px;
  min-height: 32px;
  color: var(--accent);
  font: 500 13px/1.3 var(--lat);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.skc[data-lang="both"] .skh .en,
.skc[data-lang="both"] .skd .en {
  display: block;
  font: 400 12px/1.4 var(--lat);
  color: var(--muted);
}
.skc[data-lang="both"] .skm .en {
  display: none;
}
/* Today's date, a small line at the top of the card */
.skc .sktd {
  margin: 0 0 4px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--hdrl);
  font: 500 14px/1.4 var(--body);
  color: var(--ink);
}
.skc[data-lang="en"] .sktd {
  font-family: var(--lat);
}
.skc[data-lang="both"] .sktd .en {
  display: block;
  font: 400 12px/1.4 var(--lat);
}
.skc .ske {
  display: none;
}
.skc[data-lang="both"] .ske {
  display: block;
  font: 400 12px/1.4 var(--lat);
  color: var(--muted);
}
.skc[data-lang="en"] .skd {
  font: 600 1.1em/1.35 var(--lat);
}
/* Date strip: every Sankashti from last January to the end of next year; tap one to show it above */
.skc .sks {
  position: relative;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 6px -6px 0;
  padding: 10px 6px 2px;
  border-top: 1px solid var(--hdrl);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}
.skc .skch {
  flex: none;
  position: relative;
  min-width: 46px;
  min-height: 46px;
  padding: 4px 6px;
  border: 1px solid var(--hdrl);
  border-radius: 12px;
  background: var(--bg);
  color: var(--ink);
  font: 400 12px/1.25 var(--body);
  cursor: pointer;
}
.skc .skch b {
  display: block;
  font: 600 16px/1.2 var(--body);
}
.skc[data-lang="en"] .skch b {
  font-family: var(--lat);
}
.skc[data-lang="both"] .skch .en {
  display: none;
}
.skc .skch.past {
  color: var(--muted);
}
.skc .skch.ang {
  border-color: var(--gold);
}
.skc .skch.on {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
}
.skc .skch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.skc .skch i {
  position: absolute;
  top: -8px;
  left: 4px;
  padding: 0 3px;
  background: var(--surface);
  color: var(--muted);
  font: 600 10px/1.2 var(--lat);
  font-style: normal;
}
.skc[data-lang="both"] .skch i .en {
  display: none;
}
.skc[data-lang="both"] #skb .en {
  display: none;
}
@media print {
  .skc {
    display: none !important;
  }
}


/* ==== Desktop: the left menu replaces the home-page contents list ==== */
@media screen and (min-width: 1100px) {
  [data-rail="1"] #home .tocg {
    display: none;
  }
  /* The rail lists the contents, so the fold button has nothing to fold */
  [data-rail="1"] #tfr {
    display: none !important;
  }
  #rail .rhome {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font: 600 15px/1.35 var(--head);
    color: var(--accent);
  }
  #rail[data-lang="en"] .rhome {
    font: 600 14px/1.35 var(--lat);
  }
  #rail .rhome .en {
    display: none;
  }
  #rail[data-lang="en"] .rhome .en {
    display: inline;
  }
  #rail[data-lang="en"] .rhome .mr {
    display: none;
  }
  #rail[data-lang="both"] .rhome .en {
    display: inline;
    font: 400 12px var(--lat);
    color: var(--muted);
    margin-left: 4px;
  }
}


/* ==== Tappable dhrupad marker (Aartis 1–5, 7 and 9): sits right under the stanza; tap shows the dhrupad above ==== */
@media screen {
  [data-ref="1"] .items > .rmk.rmkt {
    position: relative;
    margin-top: -1.6em;
    margin-bottom: 2.2em;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .rmk.rmkt:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 2px;
  }
  .rmk.rmkt[aria-expanded="true"] {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
  }
  .rmkpop {
    position: absolute;
    z-index: 6;
    bottom: calc(100% + 8px);
    left: 0;
    width: max-content;
    max-width: min(560px, calc(100vw - 16px));
    box-sizing: border-box;
    padding: 0.5em 1em 0.6em;
    border: 1px solid var(--hdrl);
    border-inline-start: 3px solid var(--accent);
    border-radius: 10px;
    background: var(--surface);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    color: var(--ink);
    font-size: calc(var(--fs) * 0.85);
    letter-spacing: 0;
    text-align: center;
    cursor: default;
    animation: rmkin 0.15s ease-out;
  }
  .rmkpop.below {
    bottom: auto;
    top: calc(100% + 8px);
  }
  .rmkpop .verse {
    display: block;
    margin: 0;
  }
  .rmkpop .verse p {
    margin: 0.1em 0;
    font-weight: 700;
    line-height: 1.45;
  }
  [data-lang="both"] .rmkpop .verse .en p {
    font-weight: 400;
    font-size: 0.85em;
    color: var(--muted);
  }
  @keyframes rmkin {
    from {
      opacity: 0;
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .rmkpop {
    animation: none;
  }
}
@media print {
  .rmkpop {
    display: none !important;
  }
}

/* ==== Aarti 6: one-line dhrupad, always shown at the end of each stanza (no top box, no ↻ markers) ==== */
[data-ref] .ash.norf p.rf {
  display: block;
}

/* ==== Repeated dhrupad (repeat mode, and Aarti 6's always-shown line): lighter, smaller, thin gold rule; the main stanza stays the focus ==== */
@media screen {
  [data-ref="0"] .item.rf p,
  [data-ref="0"] .verse p.rf,
  .ash.norf .verse p.rf {
    font-weight: 400;
    color: var(--muted);
    font-size: 0.9em;
  }
  [data-ref="0"] .items > .item.rf > .verse {
    width: fit-content;
    max-width: 100%;
    box-sizing: border-box;
    margin-inline: auto;
    padding-inline-start: 0.6em;
    border-inline-start: 2px solid var(--gold);
  }
  /* Desktop Both (Marathi | English side by side): keep the grid full width, no rule */
  [data-ref="0"][data-cols="2"] [data-lang="both"] .items > .item.rf > .verse {
    width: auto;
    margin-inline: 0;
    padding-inline-start: 0;
    border-inline-start: 0;
  }
}

/* ==== Help (English, phone-first) ==== */
#help {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: var(--bg);
  color: var(--ink);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  font: 400 16px/1.55 var(--lat);
}
#help[hidden] {
  display: none;
}
#help .hlpbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px;
  background: var(--bar);
  border-bottom: 1px solid var(--rule);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
#help h2 {
  margin: 0;
  font: 600 20px/1.2 var(--lat);
  color: var(--accent);
}
#hlpx {
  background: var(--surface);
  font: 500 15px/1 var(--lat);
  cursor: pointer;
}
#help .hlpin {
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 16px calc(40px + env(safe-area-inset-bottom, 0px));
}
#help .hlead {
  color: var(--muted);
}
#help h3 {
  margin: 26px 0 6px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent);
  font: 600 17px/1.3 var(--lat);
  color: var(--accent);
}
#help h4 {
  margin: 14px 0 4px;
  font: 600 15px/1.3 var(--lat);
}
#help ol,
#help ul {
  margin: 0;
  padding-left: 1.3em;
}
#help li {
  margin: 6px 0;
}
#help li::marker {
  color: var(--accent);
}
/* Help pictures of where to tap (drawn, not screenshots) */
#help .hfigs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
  margin: 10px 0 6px;
}
#help .hfig {
  margin: 0;
}
#help .hfig svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 300px;
  font-family: var(--lat);
}
#help .hfig figcaption {
  margin-top: 4px;
  font: 600 14px/1.3 var(--lat);
  color: var(--muted);
}
#help .hfig .sc {
  fill: var(--surface);
  stroke: var(--rule);
}
#help .hfig .pl {
  fill: var(--bg);
  stroke: var(--rule);
}
#help .hfig .dv {
  stroke: var(--rule);
}
#help .hfig .ln {
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#help .hfig .hl {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
}
#help .hfig .k {
  fill: var(--ink);
}
#help .hfig .m {
  fill: var(--muted);
}
#help .hfig .a {
  fill: var(--accent);
}
#hlpb:focus-visible,
#hlpx:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
@media print {
  #help,
  #hlpb {
    display: none !important;
  }
}

/* ==== Settings panel (final rules): like phone settings. Two rounded cards with hairlines between rows,
   label on the left, a small sliding control on the right; switches for High contrast and Keep screen on;
   App and Help as quiet links at the bottom ==== */
/* a feature held back for a later release (see FEAT_AS in the script) */
[data-feat][hidden] {
  display: none !important;
}
/* Header: Settings v1.0 … App, Help, ✕ (App and Help as small outlined pills, always in view) */
/* compact rows (44px, still a comfortable tap) so the panel fits on a phone without scrolling */

/* ==== Polish after the 1.0 review (final rules) ==== */
/* Previous / Next cards at the end of each piece: always the same width; readable English names */
.pn {
  grid-template-columns: minmax(0, 1fr) 46px minmax(0, 1fr);
}
[data-lang="both"] .pn > a > .en {
  font: 400 12.5px/1.3 var(--lat);
}
.pn > a {
  padding: 10px 12px;
  font-size: 15.5px;
  overflow-wrap: anywhere;
}
@media (max-width: 420px) {
  .pn {
    grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
    gap: 6px;
  }
  .pn > a {
    padding-inline: 10px;
    font-size: 14.5px;
  }
}
/* Refrain marker in Marathi + English: one arrow ("↻ ध्रुपद · Refrain"), and a taller area to tap */
@media screen {
  [data-lang="both"] .rmk .ra {
    display: none;
  }
  [data-lang="both"] .rmk .en::before {
    content: "· ";
  }
  [data-ref="1"] .rmk .en {
    margin-left: 0.3em;
  }
  .rmk.rmkt::after {
    content: "";
    position: absolute;
  }
}
/* Help's close button: the same round ✕ as Settings */
#hlpx {
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  color: var(--muted);
}
/* Small labels a little larger */
.rftop .lab {
  font-size: 12.5px;
}
.ash header .tag {
  font-size: 12.5px;
}
/* Date card: the calendar and pin buttons keep their look but get a full 44 px area to tap;
   the date strip fades out at its edges, so dates cut off at the side read as "swipe for more" */
.skc .skli {
  position: relative;
}
.skc .skli::after {
  content: "";
  position: absolute;
  inset: -6px;
}
.skc .sks {
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent);
}
/* Home page contents: the same two-column cards as the Contents panel (a group with one piece spans both columns) */
@media screen {
  #home .tocg ol.toc {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin: 0;
    border: 0;
  }
  #home .tocg ol.toc li {
    border: 0;
  }
  #home .tocg ol.toc li:only-child {
    grid-column: 1 / -1;
  }
  #home .tocg ol.toc .m {
    font-size: 1em;
  }
  #home .tocg[data-lang="both"] ol.toc .en {
    font: 400 12.5px/1.3 var(--lat);
    margin-top: 2px;
  }
  #home .tocg .gh {
    margin-bottom: 10px;
  }
}
/* Top bar showing the piece being read: a little smaller, so most names fit */
.bar .t.site.pc {
  font-size: 16.5px;
  gap: 4px;
}
.bar .t.site.pc[data-tl="en"] {
  font-size: 14.5px;
}
/* ==== Round 2 review (final rules) ==== */
/* A+ is for the verses: the home page keeps its normal size, and very long names may wrap */
#home {
  font-size: min(var(--fs), 24px);
}
@media (min-width: 600px) {
  #home {
    font-size: min(var(--fs), 28px);
  }
}
#home .tocg ol.toc a,
#jump a {
  overflow-wrap: anywhere;
}
/* Contents panel: the number beside the name, as on the home page */
#jump a {
  flex-flow: row wrap;
  align-items: baseline;
  justify-content: flex-start;
  align-content: center;
  column-gap: 0.3em;
}
#jump a > .mr,
#jump a > .en {
  flex: 1 1 0;
  min-width: 0;
}
#jl[data-lang="both"] a .en {
  flex-basis: 100%;
}
/* Side by side on wide screens: a soft gold band marks the refrain (a left line would sit far from the right-aligned Marathi), and one space before "· Refrain" */
@media screen {
  [data-cols="2"] [data-lang="both"] .rftop .verse {
    border-left: 0;
    border-radius: 12px;
    padding: 8px 0;
    background: color-mix(in srgb, var(--gold) 10%, transparent);
  }
  [data-cols="2"] [data-lang="both"] .rmk .en {
    margin-left: 0.3em;
  }
}
/* ==== Ganesha in the home card, and folding the card (final rules) ==== */
#cvb {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
}
#cvb::after {
  content: "";
  position: absolute;
  inset: -5px;
}
#cvb svg {
  transition: transform 0.2s;
}
.top.fold #cvb {
  top: 14px;
  right: 12px;
}
.top.fold #cvb svg {
  transform: rotate(180deg);
}
#slim {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 4px 52px 0 4px;
  text-align: left;
}
#slim[hidden] {
  display: none;
}
#slim img {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}
#slimt {
  min-width: 0;
  font-family: var(--lat);
  line-height: 1.3;
}
#slimt b {
  display: block;
  font-weight: 600;
  font-size: 14px;
  color: var(--accent);
}
#slimt .sld {
  display: block;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
}
#slimt .slm {
  display: block;
  font-weight: 500;
  font-size: 13px;
  color: var(--muted);
}
#slimt .mr {
  font-family: var(--body);
}
.top.fold .hero,
.top.fold #skc,
.top.fold #shr {
  display: none !important;
}
.top.fold {
  padding-bottom: 8px;
}
@media print {
  #cvb,
  #slim {
    display: none !important;
  }
}
/* ==== Folding the Pooja and Aarti sections (the headings' look is in "Fold headings" below) ==== */
#pfb,
#xfb {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: inherit;
  font: inherit;
  cursor: pointer;
}
#pfb svg,
#xfb svg {
  flex: none;
  transition: transform 0.2s;
}
@media screen {
  [data-pf="1"] .pj,
  [data-xf="1"] .ar {
    display: none !important;
  }
  [data-pf="1"] #pfb svg,
  [data-xf="1"] #xfb svg {
    transform: rotate(180deg);
  }
}
/* the print view copies these headings as plain labels (पूजा POOJA) */
@media print {
  #pfb,
  #xfb {
    border: 0;
    background: none;
    padding: 0;
    min-height: 0;
    letter-spacing: inherit;
    text-transform: inherit;
  }
  #pfb .en,
  #xfb .en {
    font: 500 0.72em/1.3 var(--lat);
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  #pfb svg,
  #xfb svg {
    display: none !important;
  }
}
/* ==== Bottom bar (footer menu on every page; replaced the Previous / Next cards at the end of each piece) ==== */
@media screen {
  .pn {
    display: none !important;
  }
}
#asc {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7;
  /* on iPhones without a home button the buttons sit partly in the home-bar zone (as Safari's own toolbar
     does), so the bar isn't padded by the whole zone; never less than 8px */
  padding: 8px 16px max(8px, calc(env(safe-area-inset-bottom, 0px) - 16px));
  background: var(--bar);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--rule);
}
#asc[hidden] {
  display: none;
}
/* out of the way while Settings or Contents is open (data-menu is set by the script; a CSS :has() rule
   here made every style change on the page several times slower) */
[data-menu="1"] #asc {
  display: none;
}
[data-asb="1"] body {
  padding-bottom: calc(53px + max(8px, calc(env(safe-area-inset-bottom, 0px) - 16px)));
}
#asi {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  max-width: 34rem;
  margin: 0 auto;
}
@media screen and (min-width: 1100px) {
  [data-rail="1"] #asc {
    padding-left: calc(var(--L) + 260px);
    padding-right: max(16px, calc(100vw - var(--L) - 260px - var(--W)));
  }
}
/* Buttons as in the top bar (fixed pixel sizes, so text size and pinch leave the bar alone) */
#asc .asx {
  font: 600 15px/1 var(--lat);
  white-space: nowrap;
}
#asc .asx:lang(mr) {
  font-family: var(--body);
}
#asc .asx:disabled {
  opacity: 0.4;
  cursor: default;
}
#asc .asi {
  padding: 0;
  display: grid;
  place-items: center;
}
#asb {
  padding: 0;
  display: grid;
  place-items: center;
}
#asb svg {
  grid-area: 1 / 1;
}
#asb .ia,
#asc.on #asb .ip {
  display: none;
}
#asc.on #asb .ia {
  display: block;
}
#ass,
#asc.on .asx,
:root:not([data-ason="1"]) #asb {
  display: none !important;
}
#asc.on #ass {
  display: flex !important;
}
/* Tilt to scroll: the button shows on phones and tablets (data-tilt); while it runs (#asc.tl) the bar
   shows the meter (a dot that moves with the lean), the label and ⏸ */
:root:not([data-tilt="1"]) #tlb,
#asc.tl #asi > :not(#tls) {
  display: none !important;
}
#tls {
  display: none;
}
#asc.tl #tls {
  display: flex;
}
#asc.tl #asi {
  justify-content: center;
}
#tlb svg {
  color: var(--accent);
}
#tls {
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 4px 0 12px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
}
#tlm {
  position: relative;
  flex: none;
  width: 14px;
  height: 34px;
  border-radius: 7px;
  background: var(--rule);
}
#tlm b {
  position: absolute;
  left: 2px;
  right: 2px;
  top: 16px;
  height: 2px;
  background: var(--ink);
  opacity: 0.4;
}
#tlm i {
  position: absolute;
  left: 2px;
  top: 12px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}
#tlt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
#tll {
  font: 600 14px/1 var(--lat);
  white-space: nowrap;
}
#tlh {
  font: 500 12px/1.1 var(--lat);
  white-space: nowrap;
}
#tls:lang(mr) #tll,
#tls:lang(mr) #tlh {
  font-family: var(--body);
}
#tlx {
  border: 0;
  background: none;
  width: 40px;
  height: 40px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--accent);
}
@media (max-width: 359px) {
  #tlh {
    display: none;
  }
}
#asc.on #asi {
  justify-content: center;
}
#ass {
  align-items: center;
  height: 44px;
  border-radius: 10px;
  border: 1px solid var(--rule);
  background: var(--surface);
}
#ass button {
  border: 0;
  background: none;
  min-width: 40px;
  font-size: 20px;
  color: var(--accent);
}
#asl {
  min-width: 58px;
  text-align: center;
  white-space: nowrap;
  font: 600 14px/1 var(--lat);
  color: var(--ink);
}
#asl:lang(mr) {
  font-family: var(--body);
}
@media (max-width: 359px) {
  #asl {
    min-width: 22px;
  }
  #asl .asw {
    display: none;
  }
  #ass button {
    min-width: 32px;
  }
  #asc .asx {
    padding: 0 9px;
  }
}
.rmkpop .ash-h {
  margin-top: 6px;
  padding-top: 5px;
  border-top: 1px solid var(--hdrl);
  font: 600 12px/1.3 var(--lat);
  color: var(--muted);
}
.rmkpop .ash-h:lang(mr) {
  font-family: var(--body);
}
/* ==== Bars tuck away while reading (phones and tablets without the side menu) ====
   Scrolling down slides the top and bottom bars out of view, leaving a slim strip with the piece name;
   scrolling up, reaching the end of the page, or tapping a blank part of the page brings them back.
   While autoscroll runs the bottom bar (pause, speed) stays. The script sets data-tuck on <html>. */
#tuck {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  height: calc(30px + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 16px 0;
  background: var(--bar);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
  font: 600 14px/1 var(--body);
  color: var(--accent);
  visibility: hidden;
}
#tuck span:lang(en) {
  font-family: var(--lat);
}
#tuck span {
  line-height: 1.6;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#tuck i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  opacity: 0.75;
  transform: scaleX(0);
  transform-origin: 0 50%;
}
/* Shown and hidden at once with visibility, never slid with a transform or transition: on iPhones a
   fixed bar that is being transformed while the page scrolls can be drawn mid-page (seen 2026-10-15). */
[data-tuck="1"] #tuck {
  visibility: visible;
}
[data-tuck="1"] body > .bar,
[data-tuck="1"] #asc:not(.on):not(.tl) {
  visibility: hidden;
}
@media print {
  #tuck {
    display: none !important;
  }
}
@media print {
  #asc {
    display: none !important;
  }
}
/* ==== Folding the home contents list and each piece (the Contents button's look is in "Fold headings" below) ==== */
#tfb {
  cursor: pointer;
}
#tfb svg {
  flex: none;
  transition: transform 0.2s;
}
.ash header {
  position: relative;
  padding-inline: 56px;
}
.afb {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid var(--hdrl);
  border-radius: 50%;
  background: var(--hdrt, var(--surface));
  color: var(--muted);
  cursor: pointer;
}
.afb::after {
  content: "";
  position: absolute;
  inset: -4px;
}
.afb svg {
  transition: transform 0.2s;
}
@media screen {
  [data-tf="1"] #home .tocg {
    display: none !important;
  }
  [data-tf="1"] #tfb svg,
  .ash.af .afb svg {
    transform: rotate(180deg);
  }
  .ash.af > :not(header) {
    display: none !important;
  }
  /* Piece headings are one row, open or folded, so folding never makes the heading jump: number and name
     on the left, ⌃ on the right, the same height as the Contents, Pooja and Aarti rows (Satish's pick B,
     2026-10-14). The language tag shows only in print. In Marathi + English the English name follows
     the Marathi on the same line, small and muted, like the section rows; long names wrap. */
  .ash header {
    box-sizing: border-box;
    justify-content: flex-start;
    flex-wrap: nowrap;
    text-align: left;
    min-height: 52px;
    padding: 8px 56px 8px 16px;
    margin: 10px 0 14px;
    /* plain like the old section rows; the accent bar marks the sections (Contents, पूजा, आरती) instead */
    background: var(--surface);
    border-top: 1px solid var(--hdrl);
  }
  .ash.af header {
    margin-bottom: 0;
  }
  /* the same type as the section rows: 19 px Marathi, 16 px English, so pieces and sections line up */
  .ash header h2 {
    font-size: 19px;
    line-height: 1.3;
    flex: 1 1 auto;
    text-wrap: pretty;
  }
  .ash[data-lang="en"] header h2 {
    font-size: 16px;
  }
  [data-lang="both"] .ash header h2 .en,
  .ash[data-lang="both"] header h2 .en {
    margin: 1px 0 0;
    font: 600 14px/1.25 var(--lat);
    color: var(--muted);
  }
  .ash header .tag {
    display: none;
  }
  .afb {
    right: 10px;
  }
  .ash.af {
    margin-top: 0;
    border-top: 0;
  }
  /* no rule between pieces: the boxed heading rows and the end ornament already separate them */
  .ash {
    border-top: 0;
  }
  .ash.af + .ash {
    margin-top: 10px;
  }
  .ash.af + .ash.af {
    margin-top: 10px;
    border-top: 0;
  }
}
@media print {
  .afb,
  #tfr {
    display: none !important;
  }
  .ash header {
    padding-inline: 14px;
  }
}
/* ==== Fold headings (Contents, Pooja, Aarti): one look, full-width rows lined up with the folded pieces ==== */
@media screen {
  #tfr,
  .grp,
  #home + .grp {
    display: block;
    max-width: 46rem;
    margin: 10px auto 0;
  }
  .grp,
  #home + .grp {
    padding: 0;
    border: 0;
  }
  [data-tf="1"] #home {
    padding-bottom: 0;
  }
  #tfb,
  #pfb,
  #xfb {
    display: flex;
    width: 100%;
    box-sizing: border-box;
    min-height: 52px;
    margin: 0;
    padding: 0 10px 0 16px;
    gap: 10px;
    align-items: center;
    justify-content: flex-start;
    border: 1px solid var(--hdrl);
    border-top: 3px solid var(--accent);
    border-radius: 12px;
    background: var(--hdr);
    color: var(--accent);
    text-align: left;
  }
  #tfb .mr,
  #pfb .mr,
  #xfb .mr {
    font: 600 20px/1.2 var(--head);
    color: var(--accent);
  }
  #tfb .en,
  #pfb .en,
  #xfb .en {
    font: 600 14px/1.2 var(--lat);
    color: var(--muted);
  }
  #g-pooja[data-lang="en"] #pfb .en,
  #g-aarti[data-lang="en"] #xfb .en,
  #tfr[data-lang="en"] #tfb .en {
    font: 700 17px/1.2 var(--lat);
    color: var(--accent);
  }
  #tfb svg,
  #pfb svg,
  #xfb svg {
    margin-left: auto;
    box-sizing: border-box;
    width: 36px;
    height: 36px;
    padding: 8px;
    border-radius: 50%;
    border: 1px solid var(--hdrl);
    color: var(--muted);
  }
  .grp + .ash header {
    margin-top: 10px;
  }
}

@media screen and (min-width: 1100px) {
  [data-rail="1"] #home,
  [data-rail="1"] #tfr,
  [data-rail="1"] .grp,
  [data-rail="1"] #home + .grp,
  [data-rail="1"] .ash header,
  [data-rail="1"] .rftop {
    max-width: none;
  }
}
/* Piece headings, the card's Ganesha picture and its folded line fold or open with a tap anywhere on them */
.ash header,
#home .hero,
#slim {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* The app's picture on the home card, and its full-screen viewer (#pzv) */
#iconb {
  display: block;
  width: 72px;
  height: 72px;
  min-height: 0;
  margin: 0 auto 6px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
#iconb img {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 2px 5px rgb(0 0 0 / 0.3));
}
#pzv {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgb(8 6 4 / 0.94);
  touch-action: none;
  overflow: hidden;
  overscroll-behavior: contain;
  -webkit-user-select: none;
  user-select: none;
}
#pzv[hidden] {
  display: none;
}
#pzi {
  max-width: min(94vw, 760px);
  max-height: 82vh;
  width: auto;
  height: auto;
  transform-origin: 50% 50%;
  will-change: transform;
  cursor: zoom-in;
  -webkit-user-drag: none;
}
#pzv.zoomed #pzi {
  cursor: grab;
}
#pzx {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top));
  right: 12px;
  width: 44px;
  height: 44px;
  min-height: 0;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid rgb(255 255 255 / 0.3);
  border-radius: 50%;
  background: rgb(0 0 0 / 0.5);
  color: #fff;
}
#pzh {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(18px + env(safe-area-inset-bottom));
  text-align: center;
  color: rgb(255 255 255 / 0.7);
  font: 500 13px/1.3 var(--lat);
  pointer-events: none;
}
@media print {
  #iconb,
  #pzv {
    display: none !important;
  }
}

/* Vibrant home card (option B): gold glow behind the picture, warm date box, next date in the accent colour
   with an "in N days" badge, a gold ring on the chosen date chip, past dates dimmed */
.top .hero {
  background:
    radial-gradient(closest-side, color-mix(in srgb, var(--gold) 38%, transparent), transparent) no-repeat center 0 / 150px 110px,
    linear-gradient(180deg, var(--hdr), transparent);
}
#iconb img {
  filter: drop-shadow(0 0 10px color-mix(in srgb, var(--gold) 55%, transparent));
}
.skc {
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 14%, var(--surface)), var(--surface) 55%);
  border-color: color-mix(in srgb, var(--gold) 55%, var(--hdrl));
}
.skc.today {
  border-color: var(--accent);
}
.skc .skh .en {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.9em;
}
.skc[data-lang="both"] .skh .en {
  text-transform: none;
  letter-spacing: 0;
}
.skc .skd {
  color: var(--accent);
  font-weight: 600;
}
.skc .skd .skin {
  display: inline-block;
  margin: 0 2px 0 8px;
  padding: 0 9px;
  border: 1px solid color-mix(in srgb, var(--gold) 60%, transparent);
  border-radius: 99px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font: 600 12px/1.6 var(--lat);
  vertical-align: 4px;
  white-space: nowrap;
}
.skc .skd .skin.mr {
  font-family: var(--body);
}
.skc[data-lang="both"] .skd .skin.en {
  display: none;
}
.skc .skch.on {
  box-shadow:
    0 0 0 2px var(--surface),
    0 0 0 3.5px var(--gold),
    0 4px 12px color-mix(in srgb, var(--accent) 45%, transparent);
}
.skc .skch.past:not(.on) {
  opacity: 0.6;
}
/* A little tighter (Satish, 2026-10-14): smaller gaps between the card's lines; room under the chips for the chosen one's glow */
@media screen {
  .top .hero {
    padding-bottom: 2px;
    margin-bottom: 6px;
  }
  .skc {
    padding-top: 6px;
    margin-bottom: 10px;
  }
  .skc .sktd {
    margin-bottom: 2px;
    padding-bottom: 3px;
  }
  .skc .skm {
    row-gap: 0;
  }
  .skc .skp.own {
    margin-top: -2px;
  }
  .skc .sks {
    margin-top: 4px;
    padding: 8px 6px 7px;
  }
  .skc #skall {
    margin: 0 auto -6px;
  }
}

/* Text font (Settings): Standard keeps the site's own fonts; the others change the texts (Marathi and English).
   The Atharvashirsha's Marathi lines keep their Sanskrit font, which has the Vedic accent marks. */
:root[data-font="classic"] {
  --tf: "SC Classic";
}
:root[data-font="bold"] {
  --tf: "SC Bold";
}
:root[data-font="hand"] {
  --tf: "SC Hand";
}
:root[data-font]:not([data-font="std"]) .ash .items,
:root[data-font]:not([data-font="std"]) .ash .rftop {
  font-family: var(--tf), var(--body);
}
:root[data-font]:not([data-font="std"]) .ash .items .en,
:root[data-font]:not([data-font="std"]) .ash .rftop .en,
:root[data-font]:not([data-font="std"]) .ash .items .en p,
:root[data-font]:not([data-font="std"]) .ash .rftop .en p {
  font-family: var(--tf), var(--lat);
}
/* the chosen font also reaches the printed copy (#pv has no .ash wrapper); headings keep theirs */
:root[data-font]:not([data-font="std"]) #pv .pvs {
  font-family: var(--tf), var(--body);
}
:root[data-font]:not([data-font="std"]) #pv .pvs .en,
:root[data-font]:not([data-font="std"]) #pv .pvs .en p,
:root[data-font]:not([data-font="std"]) #pv .pvs td.pve {
  font-family: var(--tf), var(--lat);
}
:root[data-font]:not([data-font="std"]) #pv .pvs h2 .en {
  font-family: inherit;
}
/* and the home page, the section bars (पूजा, आरती) and the piece title cards: their font names point to the
   chosen font first. The home page's buttons and offline line, and the Open all / Fold all pill, stay in the site's own fonts (they are controls). */
:root[data-font]:not([data-font="std"]) #home,
:root[data-font]:not([data-font="std"]) .grp,
:root[data-font]:not([data-font="std"]) .ash header {
  --head: var(--tf), "Tiro Devanagari Marathi", "Kohinoor Devanagari", "Noto Sans Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, serif;
  --body: var(--tf), "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, sans-serif;
  --lat: var(--tf), "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
:root[data-font]:not([data-font="std"]) #home #shr,
:root[data-font]:not([data-font="std"]) #home #cvb,
:root[data-font]:not([data-font="std"]) .grp .allb {
  --head: "Tiro Devanagari Marathi", "Kohinoor Devanagari", "Noto Sans Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, serif;
  --body: "Noto Sans Devanagari", "Kohinoor Devanagari", "Devanagari Sangam MN", "Nirmala UI", Mangal, sans-serif;
  --lat: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
/* and the home page's Table of Contents: piece names, numbers and languages */
:root[data-font]:not([data-font="std"]) #home .tocg ol.toc .m,
:root[data-font]:not([data-font="std"]) #home .tocg ol.toc .lt {
  font-family: var(--tf), var(--head);
}
:root[data-font]:not([data-font="std"]) #home .tocg ol.toc .en {
  font-family: var(--tf), var(--lat);
}
/* the font row: label on top, the four choices across the full width */

/* English style choices: example on top, a small caption (Simple / Standard (IAST)) under it, same row height */

/* Open all / Fold all pill in a section row, just left of the section's arrow */
.grp {
  position: relative;
}
.allb {
  position: absolute;
  top: 50%;
  right: 60px;
  transform: translateY(calc(-50% + 1px));
  height: 30px;
  min-height: 0;
  padding: 0 12px;
  border: 1px solid var(--hdrl);
  border-radius: 15px;
  background: var(--surface);
  color: var(--accent);
  font: 600 13px/1 var(--lat);
  cursor: pointer;
}
.allb[lang="mr"] {
  font: 500 14px/1 var(--body);
}
.allb::after {
  content: "";
  position: absolute;
  inset: -7px -4px;
}
@media print {
  .allb {
    display: none !important;
  }
}

/* ==== Bigger tap areas, same look (2026-10-14 accessibility review) ====
   Small controls get an invisible touch area of about 44 px (Apple and Google's guide) from a transparent
   ::after, or for the top-bar title (whose box clips) from padding cancelled by a negative margin. */
.bar .t.site {
  padding-block: 9px;
  margin-block: -9px;
}
.skc .skl {
  position: relative;
}
.skc .skl::after {
  content: "";
  position: absolute;
  inset: -6px 0;
}
@media screen {
  .rmk.rmkt::after {
    inset: -10px -8px;
  }
}

/* ==== Home contents as a book index (1.0.2, option A of the "book-like" mockups): no tiles or box; the
   अनुक्रमणिका title between two gold rules, small पूजा / आरती labels between fading gold lines, and one piece per
   line with a dotted leader to its language (संस्कृत / मराठी / हिंदी, from the piece's own tag) ==== */
:root {
  --igold: #8a6430; /* gold for the index's text and rules: 4.5:1 or more on each theme's background */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-pref]) {
    --igold: #d8b27a;
  }
}
:root[data-pref="dark"] {
  --igold: #d8b27a;
}
:root[data-pref="light"] {
  --igold: #8a6430;
}
:root[data-pref="sepia"] {
  --igold: #73521f;
}
:root:root:root[data-hc="1"] {
  --igold: var(--accent);
}
@media screen {
  #tfr,
  #home .tocg {
    max-width: 34rem;
    box-sizing: border-box;
    margin-inline: auto;
  }
  #tfr {
    margin-top: 18px;
    border-block: 1px solid var(--igold);
  }
  #tfb {
    position: relative;
    justify-content: center;
    min-height: 54px;
    padding: 0 48px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  #tfb .mr {
    font-size: 22px;
  }
  #tfb svg {
    position: absolute;
    right: 4px;
    top: 50%;
    margin-top: -18px;
    border-color: transparent;
  }
  #home .tocg {
    margin-block: 0;
    padding: 1px 4px 0;
    border: 0;
    background: transparent;
  }
  #home .tocg:last-child {
    padding-bottom: 14px;
    border-bottom: 1px solid var(--igold);
  }
  #home .tocg .gh,
  #home .sr + .tocg .gh,
  #home .tocg:first-child .gh {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 4px;
    padding: 0;
    border: 0;
    font: 500 15px/1.3 var(--head);
    color: var(--igold);
  }
  #home .tocg[data-lang="en"] .gh {
    font: 500 14px/1.3 var(--lat);
    letter-spacing: 0.08em;
  }
  #home .tocg .gh::before,
  #home .tocg .gh::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--igold), transparent);
  }
  #home .tocg[data-lang="both"] .gh .en {
    display: inline;
    margin-left: 0.5em;
    font: 500 13px/1.3 var(--lat);
    color: var(--igold);
  }
  #home .tocg ol.toc {
    display: block;
  }
  #home .tocg ol.toc a {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 0;
    min-height: 0;
    height: auto;
    padding: 11px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  #home .tocg ol.toc a:active {
    background: var(--surface);
  }
  #home .tocg ol.toc .m {
    flex: 0 1 auto;
    max-width: 100%;
    overflow-wrap: normal;
  }
  /* Marathi + English: the English line starts under the Marathi title, past the number */
  #home .tocg[data-lang="both"] ol.toc .m {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.3em;
    align-items: baseline;
  }
  #home .tocg[data-lang="both"] ol.toc .m > .no {
    grid-row: 1;
  }
  #home .tocg[data-lang="both"] ol.toc .m > .mr,
  #home .tocg[data-lang="both"] ol.toc .m > .en {
    grid-column: 2;
  }
  /* Latin titles look larger than Devanagari at the same size */
  #home .tocg[data-lang="en"] ol.toc .m {
    font-size: 0.86em;
  }
  #home .tocg ol.toc .no {
    color: var(--igold);
  }
  /* the dotted leader, then the language: one piece, so on a long title both move to the next line together */
  #home .tocg ol.toc .lt::before {
    content: "";
    flex: 1 1 16px;
    min-width: 16px;
    margin: 0 8px;
    border-bottom: 1.5px dotted var(--igold);
    transform: translateY(-0.3em);
  }
  #home .tocg ol.toc .lt {
    flex: 1 0 auto;
    align-items: baseline;
    white-space: nowrap;
    font: 400 15px/1 var(--body);
    color: var(--muted);
  }
  #home .tocg[data-lang="en"] ol.toc .lt {
    font: 400 13px/1 var(--lat);
  }
  #home .tocg[data-lang="both"] ol.toc .lt .en {
    display: none;
  }
  #home + .grp {
    margin-top: 28px;
  }
}
/* The language tags are only for the home list on screen */
.lt {
  display: none;
}
@media screen {
  #home .tocg ol.toc .lt {
    display: flex;
  }
  /* Marathi + English: "अनुक्रमणिका Contents" (English alone says "Table of Contents"), to fit one line */
  #tfr[data-lang="both"] #tfb .tfo {
    display: none;
  }
  /* Marathi + English piece headings: the English line starts under the Marathi title, past the number */
  .ash[data-lang="both"] header h2 {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.3em;
    align-items: baseline;
    justify-items: start;
  }
  .ash[data-lang="both"] header h2 > .no {
    grid-row: 1;
  }
  .ash[data-lang="both"] header h2 > .mr,
  .ash[data-lang="both"] header h2 > .en {
    grid-column: 2;
  }
  /* the same in the desktop left menu and the contents list of the search panel */
  #rail[data-lang="both"] ul a,
  #jl[data-lang="both"] li > a {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 0.3em;
    align-items: baseline;
    justify-items: start;
  }
  #rail[data-lang="both"] ul a > .no,
  #jl[data-lang="both"] li > a > .no {
    grid-row: 1;
  }
  #rail[data-lang="both"] ul a > .mr,
  #rail[data-lang="both"] ul a > .en,
  #jl[data-lang="both"] li > a > .mr,
  #jl[data-lang="both"] li > a > .en {
    grid-column: 2;
  }
}
/* ==== Author line under the lotus at the end of each piece (who wrote it, with a Wikipedia link) ==== */
.cr {
  margin: 2px 0 12px;
  text-align: center;
  color: var(--muted);
  font-family: Inter, "Noto Sans Devanagari", sans-serif;
  font-size: 14px;
  line-height: 1.55;
}
.cr small {
  display: block;
  font-size: 12.5px;
}
.cr a {
  color: inherit;
  text-decoration: underline dotted;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.cr a:hover {
  color: var(--accent);
}
.cr a:not([href]) {
  text-decoration: none;
  cursor: default;
}
.cr a:not([href]) .crx {
  display: none;
}
.ash[data-lang="both"] .cr .en,
#pv[data-lang="both"] .pvcr .en {
  display: none;
}
@media print {
  .cr {
    display: none;
  }
  #pv .pvcr {
    display: block;
    margin: 6pt 0 0;
    text-align: center;
    font-size: 9.5pt;
    color: #555;
    break-before: avoid;
  }
  #pv .pvcr small {
    font-size: 8.5pt;
  }
}
/* ==== Both languages, English first (Settings → "In Both, show first": English) ====
   The script sets data-lead="en" on the page (only in Both) and moves each stanza's English block above its
   Marathi. English gets the reading size and colour; the Marathi becomes the smaller, muted line. */
[data-lead="en"] [data-lang="both"] .verse .en {
  color: var(--ink);
  font-size: 1em;
  margin-top: 0;
  line-height: inherit;
}
[data-lead="en"] [data-lang="both"] .verse .en p {
  font-size: 0.86em;
  line-height: 1.6;
}
[data-lead="en"] [data-lang="both"] .verse .mr {
  color: var(--muted);
  font-size: 0.72em;
  margin-top: 0.15em;
  line-height: 1.5;
}
html:not([data-hc="1"])[data-lead="en"] [data-lang="both"] .verse .mr p.hl {
  color: var(--ink);
}
[data-lead="en"] [data-lang="both"] .rmkpop .verse .en p {
  font-weight: 700;
  font-size: 0.86em;
  color: inherit;
}
[data-lead="en"] [data-lang="both"] .rmkpop .verse .mr p {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--muted);
}
/* piece titles: the English title leads, the Marathi one sits under it */
html[data-lead="en"] .ash[data-lang="both"] header h2 .en {
  display: inline;
  margin: 0;
  font-family: var(--lat);
  font-size: 0.92em;
  font-weight: 600;
  line-height: inherit;
  color: inherit;
}
html[data-lead="en"] .ash[data-lang="both"] header h2 .mr {
  display: block;
  margin: 1px 0 0;
  font-size: 0.72em;
  font-weight: 400;
  color: var(--muted);
}
/* the author line follows the leading language */
html[data-lead="en"] .ash[data-lang="both"] .cr .en,
html[data-lead="en"] #pv[data-lang="both"] .pvcr .en {
  display: inline;
}
html[data-lead="en"] .ash[data-lang="both"] .cr small .en,
html[data-lead="en"] #pv[data-lang="both"] .pvcr small .en {
  display: block;
}
html[data-lead="en"] .ash[data-lang="both"] .cr .mr,
html[data-lead="en"] #pv[data-lang="both"] .pvcr .mr {
  display: none;
}
/* contents lists (home, desktop menu, search panel): the English title leads, the Marathi one under it */
@media screen {
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .m > .en {
    margin: 0;
    font: 600 0.86em/1.3 var(--lat);
    color: inherit;
  }
  /* one line for the English title (Safari otherwise sizes the title to the shorter Marathi line under it) */
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .m > .en {
    white-space: nowrap;
  }
  /* the language tag on the right follows too: Marathi, Hindi, Sanskrit */
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .lt {
    font: 400 13px/1 var(--lat);
  }
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .lt .en {
    display: inline;
  }
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .lt .mr {
    display: none;
  }
  html[data-lead="en"] [data-lang="both"] .tag .en {
    display: inline;
  }
  html[data-lead="en"] [data-lang="both"] .tag .mr {
    display: none;
  }
  html[data-lead="en"] #home .tocg[data-lang="both"] ol.toc .m > .mr {
    display: block;
    margin-top: 2px;
    font: 400 13.5px/1.3 var(--body);
    color: var(--muted);
  }
  html[data-lead="en"] #rail[data-lang="both"] ul a > .en {
    display: block;
    font: 500 14px/1.35 var(--lat);
    color: inherit;
  }
  html[data-lead="en"] #rail[data-lang="both"] ul a > .mr {
    display: block;
    font: 400 12.5px/1.3 var(--head);
    color: var(--muted);
  }
  html[data-lead="en"] #jl[data-lang="both"] li > a > .en {
    display: block;
    font-size: 1em;
    opacity: 1;
  }
  html[data-lead="en"] #jl[data-lang="both"] li > a > .mr {
    display: block;
    font-size: 0.8em;
    opacity: 0.8;
  }
}
/* wide screens, side by side: English on the left (right-aligned toward the centre), Marathi on the right */
@media screen {
  html[data-lead="en"][data-cols="2"] [data-lang="both"] .verse > .en {
    font-size: 1em;
    line-height: inherit;
  }
  html[data-lead="en"][data-cols="2"] [data-lang="both"] .verse > .en > p {
    grid-column: 1;
    text-align: right;
    font-size: 0.86em;
  }
  html[data-lead="en"][data-cols="2"] [data-lang="both"] .verse > .mr {
    font-size: 0.8em;
    line-height: 1.5;
  }
  html[data-lead="en"][data-cols="2"] [data-lang="both"] .verse > .mr > p {
    grid-column: 2;
    text-align: left;
    font-size: 1em;
    margin: 0;
  }
}
@media print {
  [data-lead="en"] [data-lang="both"] .verse .en {
    font-size: 1em;
  }
  [data-lead="en"] [data-lang="both"] .verse .mr {
    font-size: 0.78em;
  }
  /* side by side: English is the left column, so the dividing rule and the dhrupad mark move with it */
  html[data-lead="en"] #pv .pvside .pvm {
    border-right: 0;
  }
  html[data-lead="en"] #pv .pvside .pve {
    border-right: 0.5pt solid #bbb;
  }
  html[data-lead="en"] #pv .pvside tr.pvrefrow td.pvm {
    box-shadow: none;
    border-left: 0;
    padding-left: 10pt;
  }
  html[data-lead="en"] #pv .pvside tr.pvrefrow td.pve {
    box-shadow: inset 2.5pt 0 0 var(--accent);
    padding-left: 12pt;
  }
}

/* ==== Settings page (option A, 2026-10-15): covers the whole page while open; rounded cards of rows in groups
   (Languages, Reading, Screen, About), like phone settings. The main and second language are dropdowns.
   Centred, at most 640px wide, on wide screens. ==== */
html[data-sp] {
  overflow: hidden;
}
.sp {
  position: fixed;
  inset: 0;
  z-index: 15;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--bg);
  color: var(--ink);
  font: 400 16px/1.35 var(--lat);
}
.sp:focus {
  outline: none;
}
.sp *,
.sp *::before,
.sp *::after {
  box-sizing: border-box;
}
.sp-pg {
  max-width: 640px;
  margin-inline: auto;
  padding-bottom: calc(32px + env(safe-area-inset-bottom));
}
.sp-hd {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 56px;
  padding: env(safe-area-inset-top) 8px 0;
  background: var(--bg);
  /* the bar and its line run the full width of the screen, past the centred column */
  box-shadow:
    0 1px 0 var(--rule),
    0 0 0 100vmax var(--bg);
  clip-path: inset(0 -100vmax -1px -100vmax);
}
.sp-hd h2 {
  grid-column: 2;
  margin: 0;
  font: 700 19px/1.2 var(--lat);
  text-align: center;
}
.sp-hd h2 .mr {
  font-family: var(--body);
}
.sp button {
  font: inherit;
  color: inherit;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  text-align: start;
}
.sp .sp-bk {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 44px;
  padding: 0 10px 0 4px;
  border-radius: 10px;
  color: var(--accent);
  font-weight: 600;
  font-size: 17px;
}
.sp-bk .mr {
  font-family: var(--body);
}
.sp-body {
  padding: 4px 16px 0;
}
.sp-h {
  margin: 22px 6px 8px;
  font: 600 12.5px/1.2 var(--lat);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.sp-h .mr {
  font: 600 14px/1.2 var(--body);
  letter-spacing: 0;
}
.sp-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 14px;
  overflow: hidden;
}
.sp .sp-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 8px 14px;
  border-top: 1px solid var(--rule);
}
.sp-card > :first-child,
.sp-card > [hidden] + .sp-row:not([hidden]) {
  border-top: 0;
}
.sp-row[hidden] {
  display: none;
}
.sp-l {
  flex: 1;
  min-width: 0;
  font-weight: 500;
}
.sp-l .mr,
.sp-row [lang="mr"] {
  font-family: var(--body);
}
.sp-l small {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}
.sp-v {
  flex: none;
  color: var(--muted);
  font-size: 15px;
}
.sp-ch {
  flex: none;
  color: var(--muted);
}
.sp .sp-go:active {
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.sp button:focus-visible,
.sp .sp-pick:has(select:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}
/* language rows: the phone's own dropdown, invisible over the whole row, so a tap anywhere opens it */
.sp .sp-pick {
  position: relative;
  cursor: pointer;
}
.sp-pick select {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  font-size: 16px; /* iPhone zooms into a select under 16px */
  cursor: pointer;
}
/* segmented controls: a soft track with the chosen option raised */
.sp-seg {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 9%, var(--bg));
}
.sp .sp-seg button {
  flex: 1 1 auto;
  min-height: 32px;
  padding: 4px 10px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  line-height: 1.15;
}
.sp .sp-seg button[aria-pressed="true"] {
  background: var(--bg);
  color: var(--ink);
  font-weight: 600;
  box-shadow:
    0 1px 3px #0003,
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.sp-seg small {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--muted);
}
.sp .sp-sz button {
  color: var(--ink);
  font-weight: 600;
  padding: 4px 12px;
}
/* the text size as a share of the default (100%), between A− and A+ */
.sp-szv {
  align-self: center;
  min-width: 3.4em;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--muted);
}
/* rows whose control needs the whole width put it under the label */
.sp .sp-stk {
  flex-wrap: wrap;
  padding-block: 10px 12px;
}
.sp-stk .sp-l {
  flex-basis: 100%;
}
.sp-stk .sp-seg {
  flex: 1 1 100%;
}
.sp-stk .sp-seg button {
  flex: 1 1 0;
}
/* the four text fonts on one line: each button as wide as its name; on the narrowest phones they wrap rather than
   let a long name spill out of its button */
.sp #sfn {
  flex-wrap: wrap;
}
.sp #sfn button {
  flex: 1 1 auto;
  padding-inline: 6px;
}
/* switches */
.sp .sp-sw::after {
  content: "";
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 14px 50%, #fff 11px, transparent 12px),
    color-mix(in srgb, var(--ink) 20%, var(--surface));
  box-shadow: inset 0 0 0 1px #0001;
  transition: background 0.2s;
}
.sp .sp-sw[aria-pressed="true"]::after {
  background:
    radial-gradient(circle at 32px 50%, #fff 11px, transparent 12px),
    var(--accent);
}
/* the preview: a few lines as the pieces show them */
.sp-prev {
  margin-top: 12px;
  padding: 12px 14px 14px;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: color-mix(in srgb, var(--accent) 6%, var(--surface));
  text-align: center;
}
.sp-prev p {
  margin: 0;
  white-space: nowrap;
}
/* the preview is a fixed window: lines never wrap, so A+ visibly makes the text bigger, running past the edges
   (faded) and below the window, as it would on the page */
.sp-pw {
  touch-action: pan-y; /* a pinch here changes the text size (js/app.js), not the page zoom */
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 150px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent),
    linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 16px, #000 calc(100% - 16px), transparent),
    linear-gradient(to bottom, #000 calc(100% - 22px), transparent);
  mask-composite: intersect;
}
.sp-pw > div {
  display: flex;
  flex-direction: column;
  align-items: center;
}
/* Check for updates: "Checking…", then "Up to date" in green, or "No internet" in amber */
.sp #upd[data-s="ok"] #updv {
  color: var(--ok);
}
.sp #upd[data-s="off"] #updv {
  color: var(--warn);
}
.sp-pt {
  margin-bottom: 6px;
  font: 600 11.5px var(--lat);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
/* the preview's lines follow the pieces: the same text size (--fs) and share of it, line spacing and font */
.sp-p1 {
  font: 400 var(--fs) / 1.7 var(--body);
}
.sp-p1[lang="en"] {
  font-size: calc(var(--fs) * 0.86);
  line-height: 1.6;
}
.sp-p2 {
  margin-top: 4px;
  font: 400 calc(var(--fs) * 0.72) / 1.6 var(--body);
  color: var(--muted);
}
.sp-p2[lang="en"] {
  line-height: 1.5;
}
.sp-p1[lang="en"],
.sp-p2[lang="en"] {
  font-family: var(--lat);
}
/* two columns on wide screens make the pieces' text a little larger */
:root[data-cols="2"] .sp-p1:not([lang="en"]) {
  font-size: calc(var(--fs) * 1.05);
}
:root[data-cols="2"] .sp-p2 {
  font-size: calc(var(--fs) * 0.8);
}
:root[data-font]:not([data-font="std"]) .sp-pw > div {
  font-family: var(--tf), var(--body);
}
:root[data-font]:not([data-font="std"]) .sp-pw > [lang="en"] {
  font-family: var(--tf), var(--lat);
}
/* the maker's name and email, quiet, under About */
.sp-by {
  margin: 18px 6px 8px;
  font: 400 13px/1.6 var(--lat);
  text-align: center;
  color: var(--muted);
}
.sp-by a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
  text-underline-offset: 3px;
}
@media (max-width: 359px) {
  .sp-body {
    padding-inline: 12px;
  }
  .sp .sp-seg button {
    padding: 4px 6px;
    font-size: 13px;
  }
  .sp .sp-stk .sp-seg button {
    padding-inline: 2px;
    font-size: 12.5px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .sp .sp-sw::after {
    transition: none;
  }
}
@media print {
  .sp {
    display: none !important;
  }
}

/* ==== Kannada letters: the original text when it is shown in Kannada letters (html[data-scr="kn"], set by js/render.js),
   and the word ಕನ್ನಡ wherever it appears (the language pages in Settings, Help) ==== */
html[data-scr="kn"] .mr,
html[data-scr="kn"] .mr *,
html[data-scr="kn"] #home .nm,
html[data-scr="kn"] #home .hl1,
html[data-scr="kn"] #bt[data-tl="mr"] #btt,
[lang="kn"]:not(html):not(.ash) {
  font-family: "Noto Sans Kannada", var(--body) !important;
}
/* the chosen text font (Settings → Text font) for the Kannada texts, the home page and the Settings preview; the
   Atharvashirsha keeps a font with its Vedic accent marks (Noto Sans Kannada, or Noto Serif Kannada for Classic) */
:root[data-font="classic"] {
  --kf: "SC Kn Classic";
  --kv: "SC Kn Classic";
}
:root[data-font="bold"] {
  --kf: "SC Kn Bold";
}
:root[data-font="hand"] {
  --kf: "SC Kn Hand";
}
html[data-scr="kn"][data-font]:not([data-font="std"]) .mr,
html[data-scr="kn"][data-font]:not([data-font="std"]) .mr *,
html[data-scr="kn"][data-font]:not([data-font="std"]) #home .nm,
html[data-scr="kn"][data-font]:not([data-font="std"]) #home .hl1,
html[data-scr="kn"][data-font]:not([data-font="std"]) .sp-pw [lang="kn"] {
  font-family: var(--kf), "Noto Sans Kannada", var(--body) !important;
}
/* Baloo Tamma at its regular weight is no heavier than the standard font; a step up keeps Bold looking bold */
html[data-scr="kn"][data-font="bold"] .mr,
html[data-scr="kn"][data-font="bold"] .sp-pw [lang="kn"] {
  font-weight: 500;
}
html[data-scr="kn"][data-font]:not([data-font="std"]) #p1 .mr,
html[data-scr="kn"][data-font]:not([data-font="std"]) #p1 .mr *,
html[data-scr="kn"][data-font]:not([data-font="std"]) #pv .pvs[data-sid="p1"] .mr,
html[data-scr="kn"][data-font]:not([data-font="std"]) #pv .pvs[data-sid="p1"] .mr * {
  font-family: var(--kv, "Noto Sans Kannada"), "Noto Sans Kannada", var(--body) !important;
}
