/* Noto fonts are bundled under the SIL Open Font License in fonts/OFL.txt. */
@font-face {
  font-family: "Noto Sans Gujarati";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("../fonts/noto-sans-gujarati.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D,
    U+20B9, U+25CC, U+A830-A839;
}

@font-face {
  font-family: "Noto Serif Gujarati";
  font-style: normal;
  font-weight: 500 600;
  font-display: swap;
  src: url("../fonts/noto-serif-gujarati.woff2") format("woff2");
  unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D,
    U+20B9, U+25CC, U+A830-A839;
}

/* ===== Theme variables ===== */
:root {
  --font-scale: 1;                 /* JS adjusts this for A− / A+ */

  --bg: #fbf6ee;
  --surface: #ffffff;
  --surface-2: #f4ecdf;
  --text: #2a2018;
  --text-soft: #6b5d4d;
  --accent: #7a1f1f;               /* shrinathji maroon */
  --accent-solid: #7a1f1f;
  --accent-soft: #f0dcdc;
  --gold: #c79a3a;
  --border: #e7ddcc;
  --shadow: 0 2px 10px rgba(80, 50, 20, 0.08);
}

[data-theme="dark"] {
  --bg: #15110d;
  --surface: #1f1a14;
  --surface-2: #261f17;
  --text: #f1e7d6;
  --text-soft: #b8a98f;
  --accent: #e6a23c;
  --accent-solid: #7a1f1f;
  --accent-soft: #3a2a18;
  --gold: #e6c168;
  --border: #322a20;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans Gujarati", "Shruti", system-ui, sans-serif;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  padding-bottom: env(safe-area-inset-bottom);
}

.hidden { display: none !important; }

/* ===== Top bar ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: calc(60px + env(safe-area-inset-top));
  padding: 6px 10px;
  padding-top: calc(6px + env(safe-area-inset-top));
  background: var(--accent-solid);
  color: #fff;
  box-shadow: var(--shadow);
}

.topbar__title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  font-family: "Noto Serif Gujarati", "Noto Sans Gujarati", serif;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__actions { display: flex; gap: 4px; }

.icon-btn {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1rem;
  min-width: 48px;
  height: 48px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, transform 0.1s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn:hover { background: rgba(255, 255, 255, 0.26); }

#backBtn { font-size: 1.8rem; line-height: 1; }

/* ===== Primary navigation ===== */
.primary-nav {
  position: sticky;
  top: calc(60px + env(safe-area-inset-top));
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-height: 54px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.primary-nav__item {
  appearance: none;
  min-width: 0;
  min-height: 54px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
}
.primary-nav__item.active {
  border-bottom-color: var(--accent);
  color: var(--accent);
}

/* ===== Search ===== */
.searchwrap {
  position: sticky;
  top: calc(114px + env(safe-area-inset-top));
  z-index: 9;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 10px;
  padding: 4px 6px 4px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}
.searchwrap__icon { opacity: 0.6; }
.searchwrap__input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-family: inherit;
  padding: 10px 4px;
}
.searchwrap__mic.listening {
  background: var(--accent-solid);
  color: #fff;
  animation: pulse 1.1s ease-in-out infinite;
}
.searchwrap .icon-btn { background: var(--surface-2); color: var(--text); }
.searchwrap .icon-btn:hover { background: var(--accent-soft); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(199, 60, 60, 0.5); }
  50% { box-shadow: 0 0 0 8px rgba(199, 60, 60, 0); }
}

.voice-status {
  margin: -4px 14px 6px;
  font-size: 0.9rem;
  color: var(--text-soft);
}
.app-status {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 30;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface);
  padding: 11px 16px;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.24);
  text-align: center;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
}
.app-status button {
  appearance: none;
  min-height: 38px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 6px 10px;
  font-family: inherit;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.recovery-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 14px;
  border: 1px solid #b77b1e;
  border-radius: 8px;
  background: #fff4d7;
  color: #5d3a08;
  padding: 11px 12px;
  line-height: 1.5;
  font-weight: 600;
}
.recovery-notice--global {
  margin: 6px 12px 8px;
}
.recovery-notice button {
  appearance: none;
  flex: 0 0 auto;
  min-height: 48px;
  border: 1px solid currentColor;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}
.recovery-notice button:disabled { opacity: 0.55; cursor: default; }
[data-theme="dark"] .recovery-notice {
  border-color: #c99c4d;
  background: #342712;
  color: #f2d89d;
}

/* ===== Main / views ===== */
.main { max-width: 760px; margin: 0 auto; padding: 6px 0 40px; }
.view { padding: 6px 12px 0; }

/* ===== Main tabs ===== */
.home-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0 0 14px;
  border-bottom: 1px solid var(--border);
}
.home-tab {
  appearance: none;
  min-height: 50px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}
.home-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.home-tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 26px;
  height: 26px;
  margin-left: 4px;
  padding: 0 7px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.82rem;
}

/* ===== Category quick-jump bar ===== */
.cat-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 0;
  margin: 0 0 16px;
}
.cat-chip {
  appearance: none;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: 36px auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 2px;
  direction: ltr;
  min-width: 0;
  min-height: 72px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  line-height: 1.35;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.paath-topic-cue {
  --cue-bg: #eee4d4;
  --cue-ink: #4b3c2b;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(42, 32, 24, 0.14);
  border-radius: 6px;
  background: var(--cue-bg);
  color: var(--cue-ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.14);
  grid-column: 1;
  grid-row: 1;
}
.paath-topic-cue svg {
  display: block;
  width: 21px;
  height: 21px;
  overflow: visible;
}
.cat-chip__label {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  min-width: 0;
  direction: rtl;
  text-align: center;
  word-break: normal;
  overflow-wrap: normal;
}
.cat-chip:active { transform: scale(0.96); }
.cat-chip.active { background: var(--accent-solid); color: #fff; border-color: var(--accent-solid); }
.cat-chip__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  grid-column: 1;
  grid-row: 2;
  justify-self: center;
  min-width: 24px;
  min-height: 22px;
  padding: 1px 5px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--text-soft);
  font-size: 0.78rem;
  opacity: 1;
  font-weight: 500;
}
.cat-chip.active .cat-chip__n {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  opacity: 0.9;
}

@media (min-width: 620px) {
  .cat-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 360px) {
  .cat-nav {
    grid-template-columns: minmax(0, 1fr);
  }
  .cat-chip {
    grid-template-columns: 36px auto minmax(0, 1fr);
    grid-template-rows: auto;
    column-gap: 8px;
    row-gap: 0;
    min-height: 56px;
    padding: 8px 10px;
  }
  .paath-topic-cue {
    grid-column: 1;
    grid-row: 1;
  }
  .cat-chip__n {
    grid-column: 2;
    grid-row: 1;
    min-width: 24px;
    min-height: 22px;
    padding: 1px 5px;
    font-size: 0.78rem;
  }
  .cat-chip__label {
    grid-column: 3;
    grid-row: 1;
  }
}

/* ===== Continue card ===== */
.continue-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: right;
  background: linear-gradient(135deg, var(--accent-solid), #9c3636);
  color: #fff;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  margin-bottom: 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.continue-card__copy {
  display: block;
  flex: 1;
  min-width: 0;
}
.continue-card small {
  display: block;
  opacity: 0.85;
  font-size: 0.85rem;
  margin-bottom: 4px;
}
.continue-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.2rem;
  font-weight: 600;
}
.continue-card__copy > span {
  display: block;
  margin-top: 3px;
  color: #f5dfbd;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ===== Index list ===== */
.cat-group { margin-bottom: 18px; }
.cat-group__title {
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1rem;
  color: var(--accent);
  margin: 6px 4px 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid var(--accent-soft);
  font-weight: 600;
}
.cat-group__title:focus {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
  border-radius: 2px;
}

.paath-seal {
  --paath-subject-bg: #6b5d4d;
  --paath-subject-ink: #fff;
  --cue-bg: #eee4d4;
  --cue-ink: #4b3c2b;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 56px 22px;
  width: 78px;
  height: 56px;
  overflow: hidden;
  border: 1px solid rgba(42, 32, 24, 0.18);
  border-radius: 7px;
  background: var(--paath-subject-bg);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.paath-seal__subject,
.paath-seal__form {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}
.paath-seal__subject {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--paath-subject-bg);
  color: var(--paath-subject-ink);
}
.paath-seal__form {
  border-left: 1px solid rgba(42, 32, 24, 0.16);
  background: var(--cue-bg);
  color: var(--cue-ink);
}
.paath-seal__fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paath-subject-ink);
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1.05rem;
  font-weight: 700;
}
.paath-seal__subject img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.paath-seal__subject img.is-unavailable {
  display: none;
}
.paath-seal__form svg {
  display: block;
  width: 18px;
  height: 18px;
  overflow: visible;
}
.paath-seal[data-subject="pushtimarg"] {
  --paath-subject-bg: #7a2830;
  --paath-subject-ink: #fff4dc;
}
.paath-seal[data-subject="krishna"] {
  --paath-subject-bg: #23677a;
  --paath-subject-ink: #f4fcff;
}
.paath-seal[data-subject="yamuna"] {
  --paath-subject-bg: #28778f;
  --paath-subject-ink: #f2fcff;
}
.paath-seal[data-subject="shiva"] {
  --paath-subject-bg: #515a78;
  --paath-subject-ink: #f7f4ff;
}
.paath-seal[data-subject="devi"] {
  --paath-subject-bg: #9b3150;
  --paath-subject-ink: #fff6f8;
}
.paath-seal[data-subject="revapuri"] {
  --paath-subject-bg: #955125;
  --paath-subject-ink: #fff8ed;
}
.paath-seal[data-subject="vishnu"] {
  --paath-subject-bg: #315e9b;
  --paath-subject-ink: #f4f8ff;
}
.paath-seal[data-subject="ganesha"] {
  --paath-subject-bg: #ae4d3b;
  --paath-subject-ink: #fff8f4;
}
.paath-seal[data-subject="lakshmi"] {
  --paath-subject-bg: #91396f;
  --paath-subject-ink: #fff5fb;
}
.paath-seal[data-subject="rama"] {
  --paath-subject-bg: #3e7657;
  --paath-subject-ink: #f3fff8;
}
.paath-seal[data-subject="gayatri"] {
  --paath-subject-bg: #c17a1b;
  --paath-subject-ink: #2f1c06;
}
.paath-seal[data-subject="govardhan"] {
  --paath-subject-bg: #557044;
  --paath-subject-ink: #f7fff1;
}
.paath-seal[data-subject="sudarshan"] {
  --paath-subject-bg: #2f6b72;
  --paath-subject-ink: #effeff;
}
.paath-seal[data-subject="kartikeya"] {
  --paath-subject-bg: #8c3f4a;
  --paath-subject-ink: #fff6f6;
}
.paath-seal[data-subject="dattatreya"] {
  --paath-subject-bg: #94572f;
  --paath-subject-ink: #fff8ef;
}
.paath-seal[data-subject="hanuman"] {
  --paath-subject-bg: #a44832;
  --paath-subject-ink: #fff7f3;
}
.paath-seal[data-subject="shani"] {
  --paath-subject-bg: #424653;
  --paath-subject-ink: #f7f8fc;
}
.paath-seal[data-subject="vishwakarma"] {
  --paath-subject-bg: #4d6671;
  --paath-subject-ink: #f4fbff;
}
.paath-seal[data-subject="surya"] {
  --paath-subject-bg: #d18a1e;
  --paath-subject-ink: #301a00;
}
.paath-seal[data-subject="indra"] {
  --paath-subject-bg: #66558d;
  --paath-subject-ink: #fbf8ff;
}
.paath-seal[data-subject="ganga"] {
  --paath-subject-bg: #2c7f82;
  --paath-subject-ink: #f2ffff;
}
.paath-seal[data-subject="bhairav"] {
  --paath-subject-bg: #5d2d36;
  --paath-subject-ink: #fff6f7;
}
.paath-seal[data-subject="sant"] {
  --paath-subject-bg: #6b6238;
  --paath-subject-ink: #fffbea;
}
.paath-seal[data-form="mantra"] {
  --cue-bg: #f0cc6b;
  --cue-ink: #3b2600;
}
.paath-seal[data-form="invocation"],
.paath-topic-cue[data-topic-cue="daily"] {
  --cue-bg: #efa457;
  --cue-ink: #432100;
}
.paath-seal[data-form="stotra"] {
  --cue-bg: #d7e3cb;
  --cue-ink: #294329;
}
.paath-seal[data-form="granth"],
.paath-topic-cue[data-topic-cue="granth"] {
  --cue-bg: #cdddf2;
  --cue-ink: #1c3f68;
}
.paath-seal[data-form="kavach"],
.paath-topic-cue[data-topic-cue="kavach"] {
  --cue-bg: #de8a72;
  --cue-ink: #48170d;
}
.paath-seal[data-form="sahasranama"],
.paath-topic-cue[data-topic-cue="sahasranama"] {
  --cue-bg: #d9c9e8;
  --cue-ink: #44305b;
}
.paath-seal[data-form="chalisa"],
.paath-topic-cue[data-topic-cue="chalisa"] {
  --cue-bg: #ebc97e;
  --cue-ink: #3d2a05;
}
.paath-seal[data-form="bhajan"],
.paath-topic-cue[data-topic-cue="bhajan"] {
  --cue-bg: #b7ded7;
  --cue-ink: #15483f;
}
.paath-seal[data-form="aarti"],
.paath-topic-cue[data-topic-cue="aarti"] {
  --cue-bg: #e79078;
  --cue-ink: #4d160c;
}
.paath-seal--continue {
  border-color: rgba(255, 255, 255, 0.34);
  box-shadow: 0 2px 8px rgba(42, 12, 12, 0.24);
}

.paath-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 8px;
  margin-bottom: 10px;
}

.paath-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: right;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0;
  cursor: pointer;
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform 0.1s, border-color 0.15s;
}
.paath-item:active { transform: scale(0.99); }
.paath-item:hover { border-color: var(--accent); }

.paath-item__main { flex: 1; min-width: 0; }
.paath-item__heading {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}
.paath-item__title {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 1.14rem;
  font-weight: 600;
  font-family: "Noto Serif Gujarati", serif;
  margin-bottom: 2px;
}
.paath-item__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1px 5px;
  color: var(--text-soft);
  font-size: 0.79rem;
  line-height: 1.45;
}
.paath-item__star {
  flex: 0 0 auto;
  color: var(--accent);
  font-size: 1rem;
  line-height: 1.4;
}
.list-add-btn {
  appearance: none;
  min-width: 0;
  min-height: 68px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}
.list-add-btn__icon { font-size: 1.5rem; line-height: 1; }
.list-add-btn.is-added {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
}
.list-add-btn:disabled { cursor: default; opacity: 1; }

/* ===== Search results ===== */
.search-results { margin-bottom: 12px; }
.search-results__empty { color: var(--text-soft); text-align: center; padding: 24px; }
.result-snippet { color: var(--text-soft); font-size: 0.95rem; margin-top: 4px; }
.result-snippet mark {
  background: var(--gold);
  color: #1a1207;
  border-radius: 3px;
  padding: 0 2px;
}

/* ===== Ordered reading list ===== */
.reading-list__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 14px;
}
.reading-list__head h2 {
  margin: 0;
  color: var(--accent);
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1.45rem;
}
.primary-btn {
  appearance: none;
  min-height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--accent-solid);
  color: #fff;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.primary-btn:disabled { opacity: 0.45; cursor: default; }
.reading-list__empty {
  padding: 36px 18px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  text-align: center;
  font-size: 1.1rem;
}
.reading-list-item {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.reading-list-item__main {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.reading-list-item__number {
  flex: 0 0 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.reading-list-item__title {
  appearance: none;
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  padding: 6px 0;
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1.18rem;
  font-weight: 700;
  text-align: right;
  cursor: pointer;
}
.reading-list-item__title span,
.reading-list-item__title small {
  display: block;
  overflow-wrap: anywhere;
}
.reading-list-item__title small {
  margin-top: 3px;
  color: var(--text-soft);
  font-family: "Noto Sans Gujarati", sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.4;
}
.paath-seal--list {
  grid-template-columns: 50px 20px;
  width: 70px;
  height: 50px;
}
.paath-seal--list .paath-seal__form svg {
  width: 16px;
  height: 16px;
}
.reading-list-item__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.reading-list-item__actions button {
  appearance: none;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.reading-list-item__actions button:disabled { opacity: 0.35; cursor: default; }
.reading-list-item__actions .reading-list-item__remove { color: #a12626; }

/* ===== Reader ===== */
.reader-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 4px 10px;
}
.reader-head__copy {
  flex: 1;
  min-width: 0;
  text-align: right;
}
.reader-head__title {
  margin: 0;
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
  text-align: right;
  overflow-wrap: anywhere;
}
.reader-head__identity {
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.4;
}
.reader-head__visual { flex: 0 0 auto; }
.paath-seal--reader {
  grid-template-columns: 60px 24px;
  width: 84px;
  height: 60px;
}
.paath-seal--reader .paath-seal__form svg {
  width: 19px;
  height: 19px;
}
.reader-head__star { background: var(--surface-2); color: var(--gold); font-size: 1.4rem; }
.reader-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 4px 12px;
}
.reader-list-btn {
  appearance: none;
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.reader-list-btn.is-added {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
}
.reader-list-btn:disabled { opacity: 1; cursor: default; }
.reading-list-progress {
  color: var(--text-soft);
  font-size: 0.9rem;
  font-weight: 700;
  white-space: nowrap;
}

.reader-note {
  background: var(--accent-soft);
  color: var(--text);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0 4px 14px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.reader-body { padding: 0 4px; }

.verse {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.verse__num {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 8px;
  padding: 1px 10px;
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.verse__text {
  /* THE main reading text — scales with --font-scale */
  font-size: calc(1.55rem * var(--font-scale));
  line-height: 2;
  white-space: pre-wrap;
  overflow-wrap: break-word;
  font-family: "Noto Serif Gujarati", "Noto Sans Gujarati", serif;
  font-weight: 500;
  text-align: center;
}
.verse__marker { display: inline-block; white-space: nowrap; }
.verse__meaning {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.verse__meaning-label {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: calc(0.88rem * var(--font-scale));
  font-weight: 700;
}
.verse__meaning-text {
  color: var(--text-soft);
  font-size: calc(1.08rem * var(--font-scale));
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: break-word;
}

.reader-nav {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 18px;
  padding: 0 4px;
}
.nav-btn {
  flex: 1;
  appearance: none;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--accent);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
  padding: 14px;
  border-radius: 14px;
  cursor: pointer;
}
.nav-btn:disabled { opacity: 0.4; cursor: default; }
.nav-btn:not(:disabled):active { transform: scale(0.98); }

@media (max-width: 360px) {
  .paath-seal {
    grid-template-columns: 52px 18px;
    width: 70px;
    height: 52px;
  }
  .paath-seal__form svg {
    width: 15px;
    height: 15px;
  }
  .paath-item {
    gap: 8px;
    padding: 9px;
  }
  .paath-item__title { font-size: 1.08rem; }
  .paath-seal--reader {
    grid-template-columns: 54px 18px;
    width: 72px;
    height: 54px;
  }
  .reading-list-item__number {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
  }
}

button:focus-visible,
input:focus-visible,
a:focus-visible,
.topbar__title:focus-visible,
#darshanDetailTitle:focus-visible,
#savedDarshanHeading:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 2px;
}

/* ===== Darshan directory ===== */
.section-head,
.saved-list-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 2px 14px;
}
.section-head h2,
.saved-list-head h2 {
  margin: 0;
  color: var(--accent);
  font-family: "Noto Serif Gujarati", serif;
  font-size: calc(1.55rem * var(--font-scale));
}
.section-head__meta {
  min-height: 22px;
  margin: 3px 0 0;
  color: var(--text-soft);
  font-size: calc(0.9rem * var(--font-scale));
}
.offline-ready {
  flex: 0 0 auto;
  border: 1px solid #38705f;
  border-radius: 8px;
  background: #e3f1eb;
  color: #245848;
  padding: 7px 9px;
  font-size: 0.82rem;
  font-weight: 700;
}
[data-theme="dark"] .offline-ready {
  border-color: #679b89;
  background: #18372e;
  color: #b8e1d2;
}
.darshan-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 52px;
  margin-bottom: 10px;
  padding: 0 6px 0 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.darshan-search__icon {
  color: var(--text-soft);
  font-size: 1.35rem;
  line-height: 1;
}
.darshan-search input {
  flex: 1;
  min-width: 0;
  min-height: 50px;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: calc(1rem * var(--font-scale));
}
.plain-icon-btn {
  appearance: none;
  flex: 0 0 48px;
  height: 48px;
  border: none;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-size: 1.45rem;
  cursor: pointer;
}
.darshan-filters {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.darshan-filter {
  appearance: none;
  min-width: 0;
  min-height: 48px;
  border: none;
  border-left: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-soft);
  font-family: inherit;
  font-size: calc(0.94rem * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}
.darshan-filter:first-child { border-left: none; }
.darshan-filter.active {
  background: var(--accent-solid);
  color: #fff;
}
.darshan-filter__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  min-height: 24px;
  margin-left: 3px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text);
  padding: 1px 6px;
  font-size: 0.82em;
}
.darshan-filter.active .darshan-filter__count {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}
.darshan-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 84px;
  gap: 8px;
  margin-bottom: 10px;
}
.darshan-row--live {
  grid-template-columns: minmax(0, 1fr) 190px;
}
.darshan-row__live-actions {
  display: grid;
  grid-template-rows: minmax(56px, 1fr) 48px;
  gap: 8px;
}
.darshan-live-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 56px;
  border: 1px solid #2f6b56;
  border-radius: 8px;
  background: #2f6b56;
  color: #fff;
  padding: 9px 12px;
  font-family: inherit;
  font-size: calc(0.96rem * var(--font-scale));
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.darshan-live-btn:hover { background: #245543; }
.darshan-live-btn:disabled {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: default;
}
.darshan-row__live-actions .darshan-save-btn {
  min-height: 48px;
}
.darshan-card__open {
  appearance: none;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 86px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  padding: 12px;
  box-shadow: var(--shadow);
  text-align: right;
  cursor: pointer;
}
.darshan-card__open:hover { border-color: var(--accent); }
.darshan-mark {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  overflow: hidden;
  color: #fff;
  font-family: "Noto Serif Gujarati", serif;
  font-size: 1.25rem;
  font-weight: 700;
}
.darshan-mark__fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.darshan-mark__image {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: inherit;
}
.darshan-mark__image.is-unavailable { display: none; }
.darshan-mark[data-tone="shiva"] { background: #41637a; }
.darshan-mark[data-tone="krishna"] { background: #2e6b64; }
.darshan-mark[data-tone="vishnu"] { background: #4e5ca5; }
.darshan-mark[data-tone="shakti"] { background: #9a3f59; }
.darshan-mark[data-tone="ganesha"] { background: #a95d2f; }
.darshan-mark[data-tone="rama"] { background: #56723d; }
.darshan-mark[data-tone="hanuman"] { background: #a44b35; }
.darshan-card__main { min-width: 0; }
.darshan-card__title {
  display: block;
  margin-bottom: 4px;
  font-family: "Noto Serif Gujarati", serif;
  font-size: calc(1.16rem * var(--font-scale));
  font-weight: 700;
  overflow-wrap: anywhere;
}
.darshan-card__location,
.darshan-card__meta {
  display: block;
  color: var(--text-soft);
  font-size: calc(0.86rem * var(--font-scale));
  line-height: 1.45;
}
.darshan-card__meta.has-live { color: #2f6b56; font-weight: 700; }
[data-theme="dark"] .darshan-card__meta.has-live { color: #8cc6b0; }
.darshan-save-btn {
  appearance: none;
  min-width: 0;
  min-height: 86px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 7px;
  font-family: inherit;
  font-size: calc(0.9rem * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}
.darshan-save-btn.is-saved {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
}
.darshan-save-btn:disabled { cursor: default; opacity: 0.6; }
.directory-empty {
  padding: 30px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  color: var(--text-soft);
  text-align: center;
  line-height: 1.7;
}
.directory-empty button {
  display: block;
  min-height: 48px;
  margin: 14px auto 0;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 8px 14px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Darshan detail ===== */
.darshan-detail__identity {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin: 6px 2px 18px;
}
.darshan-detail__identity .darshan-mark {
  width: 64px;
  height: 64px;
}
.darshan-detail__identity > div { min-width: 0; }
.darshan-detail__identity h2 {
  margin: 0 0 4px;
  color: var(--accent);
  font-family: "Noto Serif Gujarati", serif;
  font-size: calc(1.55rem * var(--font-scale));
  overflow-wrap: anywhere;
}
.darshan-detail__identity p {
  margin: 0;
  color: var(--text-soft);
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.darshan-detail__description {
  margin: 0 2px 18px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: calc(1.06rem * var(--font-scale));
  line-height: 1.75;
  overflow-wrap: anywhere;
}
.darshan-detail__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 2px 20px;
}
.darshan-detail__actions.is-single { grid-template-columns: 1fr; }
.darshan-detail__actions > * {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 52px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 9px 12px;
  font-family: inherit;
  font-size: calc(0.96rem * var(--font-scale));
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  overflow-wrap: anywhere;
}
.darshan-detail__actions .official-link {
  border-color: #2f6b56;
  background: #2f6b56;
  color: #fff;
}
.darshan-detail__actions > :disabled {
  border-color: var(--border);
  background: var(--surface-2);
  color: var(--text-soft);
  cursor: default;
}
.darshan-link-note {
  margin: -10px 2px 18px;
  color: var(--text-soft);
  font-size: calc(0.88rem * var(--font-scale));
  line-height: 1.5;
}
.darshan-link-note a,
.darshan-schedule__source a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 700;
}
.darshan-schedule {
  margin: 0 2px 20px;
}
.darshan-schedule h3 {
  margin: 0 0 8px;
  color: var(--accent);
  font-family: "Noto Serif Gujarati", serif;
  font-size: calc(1.2rem * var(--font-scale));
}
.darshan-schedule__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.darshan-schedule__row strong { font-size: calc(0.98rem * var(--font-scale)); }
.darshan-schedule__time { white-space: nowrap; font-weight: 700; }
.darshan-schedule__source {
  margin: 8px 0 0;
  color: var(--text-soft);
  font-size: calc(0.85rem * var(--font-scale));
  line-height: 1.55;
}
.darshan-schedule__source a { color: var(--accent); }
.darshan-unavailable {
  margin: 0 2px 18px;
  padding: 12px;
  border-left: 4px solid var(--gold);
  background: var(--surface-2);
  color: var(--text-soft);
  line-height: 1.55;
}

/* ===== Saved darshan list ===== */
.secondary-btn {
  appearance: none;
  min-height: 48px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent);
  padding: 8px 12px;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}
.saved-darshan-item {
  margin-bottom: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.saved-darshan-item__main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.saved-darshan-item__number {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
}
.saved-darshan-item__title {
  appearance: none;
  min-width: 0;
  min-height: 48px;
  border: none;
  background: transparent;
  color: var(--text);
  font-family: "Noto Serif Gujarati", serif;
  font-size: calc(1.12rem * var(--font-scale));
  font-weight: 700;
  text-align: right;
  cursor: pointer;
}
.saved-darshan-item__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}
.saved-darshan-item__actions button {
  appearance: none;
  min-width: 0;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: calc(0.92rem * var(--font-scale));
  font-weight: 700;
  cursor: pointer;
}
.saved-darshan-item__actions button:disabled { opacity: 0.4; cursor: default; }
.saved-darshan-item__actions .saved-darshan-item__remove { color: #a12626; }
[data-theme="dark"] .saved-darshan-item__actions .saved-darshan-item__remove {
  color: #ffaaa1;
}

@media (max-width: 560px) {
  .darshan-row.darshan-row--live { grid-template-columns: minmax(0, 1fr); }
  .darshan-row__live-actions {
    grid-template-columns: minmax(0, 1fr) 92px;
    grid-template-rows: minmax(52px, auto);
  }
  .darshan-live-btn { min-height: 52px; }
}

@media (max-width: 390px) {
  .reading-list__head { align-items: stretch; flex-direction: column; }
  .primary-btn { width: 100%; }
  .reading-list-item__actions button { font-size: 0.88rem; }
  .primary-nav__item { font-size: 0.93rem; }
  .darshan-row { grid-template-columns: minmax(0, 1fr) 76px; }
  .darshan-card__open {
    grid-template-columns: 48px minmax(0, 1fr);
    gap: 10px;
    padding: 10px;
  }
  .darshan-mark { width: 48px; height: 48px; font-size: 1.08rem; }
  .darshan-save-btn { font-size: calc(0.84rem * var(--font-scale)); }
  .darshan-detail__actions { grid-template-columns: 1fr; }
  .saved-darshan-item__actions button {
    font-size: calc(0.86rem * var(--font-scale));
  }
  .recovery-notice { align-items: stretch; flex-direction: column; }
  .recovery-notice button { width: 100%; }
}
