/* ============================================================
   SGGS — shared styles for all pages
   Palette grounded in Gurdwara interiors at Amrit Vela:
     deep indigo night, lamp-gold, marble cream, sandalwood
   ============================================================ */
:root {
  --night:      #0e1430;
  --night-2:    #161e44;
  --night-3:    #1f2a5a;
  --gold:       #cda349;
  --gold-soft:  #e7c977;
  --cream:      #f6f1e7;
  --cream-2:    #efe7d6;
  --ink:        #2a2620;
  --ink-soft:   #6b6256;
  --sand:       #b9a684;
  --line:       #e2d8c4;
  --maxw:       720px;

  /* reading text sizes — overridden by [data-text-size] */
  --fs-gur:      clamp(22px, 4.4vw, 28px);
  --fs-translit: 16px;
  --fs-en:       18px;
  --fs-hi:       17px;
  --fs-body:     17px;

  --serif: "Cormorant Garamond", Georgia, serif;
  --sans:  "Inter", system-ui, sans-serif;
  --gur:   "Mukta Mahee", "Mukta", "Inter", sans-serif;
  --deva:  "Mukta", "Inter", sans-serif;

  --off-h: 0px;   /* height of the offline band; >0 only when offline */

  /* saroop (illuminated-page) frame for larivaar mode */
  --saroop-bg:        #fbf6e9;
  --saroop-band:      rgba(205,163,73,.16);
  --saroop-gold:      #b8893a;
  --saroop-gold-soft: #dcb964;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
html[data-net="offline"] { --off-h: 32px; }
body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
  padding-top: var(--off-h);   /* make room for the fixed offline band */
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px; letter-spacing: 0.28em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
}
a { color: inherit; }

/* ============================================================
   SHARED HEADER (site nav on every page)
   ============================================================ */
.site-header {
  position: sticky; top: var(--off-h, 0px); z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: rgba(14,20,48,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(205,163,73,.18);
}
/* header that sits over the dark hero gets a transparent variant */
.site-header.on-dark { background: transparent; border-bottom-color: transparent; backdrop-filter: none; }

/* offline strip — a fixed, full-width band pinned to the very top when offline.
   The page is pushed down by --off-h so it never overlaps the sticky bars. */
.site-offline { display: none; }
[data-net="offline"] .site-offline {
  display: flex; align-items: center; justify-content: center;
  position: fixed; top: 0; left: 0; right: 0; z-index: 60;
  height: var(--off-h); padding: 0 16px;
  background: #5a3e2b; color: #f6f1e7;
  font-family: var(--sans); font-size: 12.5px; line-height: 1.3; text-align: center;
}

.brand {
  font-family: var(--gur);
  font-weight: 600; font-size: 17px; letter-spacing: .01em;
  display: flex; align-items: center; gap: 11px;
  color: var(--cream); text-decoration: none;
}
.brand .ek { color: var(--gold-soft); font-size: 22px; }

/* right-side icon buttons (search + hamburger) */
.header-actions { display: flex; align-items: center; gap: 2px; }

.icon-btn {
  width: 38px; height: 38px;
  background: transparent; border: none; border-radius: 4px;
  cursor: pointer; color: rgba(246,241,231,.66);
  display: grid; place-items: center;
  transition: color .18s, background .18s;
}
.icon-btn:hover { color: var(--gold-soft); background: rgba(255,255,255,.07); }
.icon-btn svg { width: 18px; height: 18px; pointer-events: none; }

/* hamburger bars → X animation */
.ham { display: flex; flex-direction: column; gap: 5px; pointer-events: none; }
.bar {
  display: block; width: 18px; height: 1.5px;
  background: currentColor; border-radius: 1px;
  transition: transform .22s ease, opacity .22s ease;
}
.menu-btn[aria-expanded="true"] .bar-top { transform: translateY(6.5px) rotate(45deg); }
.menu-btn[aria-expanded="true"] .bar-mid { opacity: 0; transform: scaleX(0); }
.menu-btn[aria-expanded="true"] .bar-bot { transform: translateY(-6.5px) rotate(-45deg); }

/* dropdown nav menu */
.site-menu {
  position: absolute; top: 100%; right: 0;
  background: var(--night-2);
  border: 1px solid rgba(205,163,73,.22); border-top: none;
  min-width: 210px; max-width: 88vw;
  display: flex; flex-direction: column;
  /* never run past the viewport / into the footer — scroll inside instead */
  max-height: calc(100vh - var(--off-h, 0px) - 64px);
  max-height: calc(100dvh - var(--off-h, 0px) - 64px);
  overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  opacity: 0; pointer-events: none;
  transform: translateY(-6px);
  transition: opacity .18s ease, transform .18s ease;
}
.site-menu a { flex-shrink: 0; }   /* keep rows from compressing when scrolling */
.site-menu.open { opacity: 1; pointer-events: auto; transform: none; }
.site-menu a {
  display: block; padding: 13px 20px;
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  transition: color .15s, background .15s;
}
.site-menu a:last-child { border-bottom: none; }
.site-menu a:hover { color: var(--gold-soft); background: rgba(255,255,255,.04); }
.site-menu a[aria-current="page"] { color: var(--gold-soft); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  font-family: var(--sans); font-size: 14px; font-weight: 500; line-height: 1.2;
  padding: 13px 26px; border-radius: 2px; cursor: pointer;
  text-decoration: none; transition: all .22s ease; border: 1px solid transparent;
  display: inline-block;
  /* reset native <button> chrome so button.btn matches anchor.btn exactly */
  background: transparent; color: inherit; text-align: center;
  -webkit-appearance: none; appearance: none;
}
.btn-gold { background: var(--gold); color: var(--night); }
.btn-gold:hover { background: var(--gold-soft); transform: translateY(-1px); }
.btn-ghost { border-color: rgba(246,241,231,.25); color: var(--cream); }
.btn-ghost:hover { border-color: var(--gold-soft); color: var(--gold-soft); }

/* highlighted "Ask Gurbani AI" button — gently glows so it draws the eye */
.btn-ai {
  background: linear-gradient(120deg, rgba(205,163,73,.20), rgba(231,201,119,.08));
  border-color: var(--gold); color: var(--gold-soft);
  animation: ai-glow 2.8s ease-in-out infinite;
}
.btn-ai:hover { background: var(--gold); color: var(--night); border-color: var(--gold); transform: translateY(-1px); }
.btn-ai .ai-spark { margin-right: 5px; }
@keyframes ai-glow {
  0%, 100% { box-shadow: 0 0 10px rgba(205,163,73,.22); }
  50%      { box-shadow: 0 0 22px rgba(205,163,73,.48); }
}

/* ============================================================
   PWA — install prompt + offline banners
   ============================================================ */
.pwa-banner {
  position: fixed; left: 50%; bottom: 18px; z-index: 120;
  transform: translate(-50%, 150%);
  display: flex; align-items: center; gap: 12px;
  width: max-content; max-width: 92vw;
  padding: 11px 12px 11px 16px;
  background: #0e1430; color: #f6f1e7;
  border: 1px solid rgba(205,163,73,.4); border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  font-family: var(--sans); font-size: 14px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1);
}
.pwa-banner.in { transform: translate(-50%, 0); }
.pwa-banner .pwa-ek   { color: #e7c977; font-family: var(--gur); font-size: 22px; line-height: 1; flex-shrink: 0; }
.pwa-banner .pwa-text { flex: 1; line-height: 1.4; color: #f6f1e7; }
.pwa-banner .pwa-yes {
  flex-shrink: 0; background: #cda349; color: #0e1430;
  border: none; border-radius: 20px; padding: 8px 16px;
  font-family: var(--sans); font-weight: 600; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.pwa-banner .pwa-yes:hover { background: #e7c977; }
.pwa-banner .pwa-x {
  flex-shrink: 0; background: none; border: none; color: #b9a684;
  font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}

/* offline-data download modal */
.pwa-modal {
  position: fixed; inset: 0; z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(0,0,0,.55);
  opacity: 0; transition: opacity .2s;
}
.pwa-modal.in { opacity: 1; }
.pwa-modal-card {
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--line); border-radius: 16px;
  max-width: 420px; width: 100%; padding: 28px 24px; text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,.45);
}
.pwa-modal-ek { font-family: var(--gur); color: var(--gold); font-size: 34px; line-height: 1; margin-bottom: 10px; }
.pwa-modal-title { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink); margin-bottom: 10px; }
.pwa-modal-text { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.pwa-modal-ver { font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); margin: -4px 0 8px; }
.pwa-modal-size { display: block; margin-top: 10px; font-size: 12px; color: var(--sand); letter-spacing: .04em; text-transform: uppercase; }
.pwa-whatsnew {
  list-style: none; text-align: left; margin: 16px auto 0; max-width: 30ch;
  display: flex; flex-direction: column; gap: 9px;
}
.pwa-whatsnew li {
  position: relative; padding-left: 20px;
  font-family: var(--sans); font-size: 14px; color: var(--ink-soft); line-height: 1.5;
}
.pwa-whatsnew li::before { content: "✦"; position: absolute; left: 0; top: 1px; color: var(--gold); font-size: 12px; }
.pwa-modal-actions { display: flex; gap: 10px; justify-content: center; margin-top: 22px; }
.pwa-modal-yes, .pwa-modal-no {
  font-family: var(--sans); font-size: 14px; font-weight: 500;
  padding: 10px 22px; border-radius: 24px; cursor: pointer;
}
.pwa-modal-yes { background: var(--gold); color: #0e1430; border: none; }
.pwa-modal-yes:hover { background: var(--gold-soft); }
.pwa-modal-no { background: none; color: var(--ink-soft); border: 1px solid var(--line); }
.pwa-modal-no:hover { border-color: var(--gold); }
.pwa-progress { height: 8px; background: var(--line); border-radius: 6px; overflow: hidden; margin: 20px 0 6px; }
.pwa-progress-fill { height: 100%; width: 0%; background: linear-gradient(90deg, var(--gold), var(--gold-soft)); transition: width .2s ease; }

/* "how to use" first-run guide (carousel) */
.pwa-guide-card { position: relative; }
.pwa-guide-skip {
  position: absolute; top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  font-family: var(--sans); font-size: 13px; color: var(--sand); padding: 4px 6px;
}
.pwa-guide-skip:hover { color: var(--ink-soft); }
.pwa-guide-icon { font-size: 40px; line-height: 1; margin: 4px 0 12px; }
.pwa-guide-body { max-width: 34ch; margin-left: auto; margin-right: auto; min-height: 4.8em; }
.pwa-guide-body em { font-family: var(--mono, monospace); font-style: normal; color: var(--gold); }
.pwa-guide-dots { display: flex; gap: 7px; justify-content: center; margin-top: 18px; }
.pwa-guide-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--line); transition: background .2s, transform .2s; }
.pwa-guide-dot.on { background: var(--gold); transform: scale(1.25); }


/* ============================================================
   HERO (home page)
   ============================================================ */
.hero {
  background: radial-gradient(120% 90% at 50% -10%, #25306a 0%, var(--night) 55%, #090d22 100%);
  color: var(--cream);
  min-height: 100svh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(40% 30% at 50% 8%, rgba(205,163,73,0.18), transparent 70%);
  pointer-events: none;
}
.hero-center {
  position: relative; z-index: 2;
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 40px 24px 64px;
}
.ek-onkar {
  font-family: var(--gur);
  font-size: clamp(84px, 18vw, 168px);
  line-height: 1; color: var(--gold);
  text-shadow: 0 0 50px rgba(205,163,73,.35);
  animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both;
}
.hero-greeting {
  font-family: var(--gur); color: var(--gold-soft); font-weight: 500;
  font-size: clamp(46px, 15vw, 160px); line-height: 1.05; letter-spacing: .005em;
  text-shadow: 0 0 55px rgba(205,163,73,.3);
  animation: rise 1.4s cubic-bezier(.2,.7,.2,1) both;
  transition: opacity .45s ease;
  /* reserve room for the taller (two-line) phrase so nothing below jumps */
  min-height: clamp(80px, 28vw, 290px);
  display: flex; align-items: center; justify-content: center; text-align: center;
}
.hero-greeting.fading { opacity: 0; }
/* the longer Khalsa fateh phrase takes two lines at a fitting size */
.hero-greeting.hg-2 { font-size: clamp(30px, 11vw, 112px); line-height: 1.25; }
.hero-welcome {
  margin: 22px auto 0; line-height: 1.1; text-align: center;
  font-family: var(--serif); font-weight: 400; color: #f6f1e7;
  animation: rise 1.4s .15s cubic-bezier(.2,.7,.2,1) both;
}
.hw-pre {
  display: block; font-style: italic;
  font-size: clamp(16px, 3vw, 22px); letter-spacing: .04em;
  color: rgba(246,241,231,.66); margin-bottom: 10px;
}
.brandmark-lg { display: inline-block; font-size: clamp(40px, 9vw, 78px); }

/* "Read: SGGS" brandmark — shared by the hero and the header.
   A gold shine sweeps across twice, then settles; re-fires every 60s. */
.brandmark {
  position: relative; display: inline-block; white-space: nowrap;
  overflow: hidden; padding: 0 .08em;
}
.brandmark::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, rgba(255,255,255,.55) 50%, transparent 62%);
  transform: translateX(-130%);
  animation: brand-sweep 60s ease-in-out infinite;
}
@keyframes brand-sweep {
  0%          { transform: translateX(-130%); }
  2%          { transform: translateX(130%); }   /* sweep 1 (left → right) */
  2.01%       { transform: translateX(-130%); }  /* jump back off-screen, invisible */
  4%          { transform: translateX(130%); }   /* sweep 2 */
  4.01%, 100% { transform: translateX(130%); }   /* parked off-screen until next minute */
}
.brandmark .bm-read {
  font-family: var(--serif); font-weight: 600; font-style: italic;
  background: linear-gradient(95deg, #e7c977 0%, #cda349 58%, #b98e34 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.brandmark .bm-colon { color: var(--gold); margin: 0 1px; font-weight: 600; }
.brandmark .bm-sggs {
  font-family: var(--sans); font-weight: 700; letter-spacing: .06em;
  color: #f6f1e7; margin-left: 6px;
}
.hero-cta {
  margin-top: 44px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center;
  animation: rise 1.4s .65s cubic-bezier(.2,.7,.2,1) both;
}
/* 2×2 button grid on the home hero */
.hero-cta-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  max-width: 520px; width: 100%; margin-left: auto; margin-right: auto;
}
.hero-cta-grid .btn {
  display: flex; align-items: center; justify-content: center; text-align: center;
  margin: 0;
}
/* gold glow for the two primary buttons (matches the Ask button's pulse) */
.btn-glow { animation: ai-glow 2.8s ease-in-out infinite; }
.seva-line {
  font-family: var(--sans); font-size: 13px; letter-spacing: .03em;
  color: var(--gold-soft); max-width: 440px; margin: 30px auto 0; line-height: 1.7;
  animation: rise 1.4s .55s cubic-bezier(.2,.7,.2,1) both;
}
.scroll-hint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  z-index: 2; font-family: var(--gur); font-size: 15px; letter-spacing: .02em;
  color: rgba(246,241,231,.5); animation: float 2.4s ease-in-out infinite;
}
@keyframes rise { from { opacity:0; transform: translateY(18px);} to {opacity:1; transform:none;} }
@keyframes float { 0%,100%{transform:translate(-50%,0)} 50%{transform:translate(-50%,6px)} }

/* ============================================================
   CONTENT PAGES (about, roadmap)
   ============================================================ */
.page {
  min-height: 70vh; padding: 72px 24px 96px;
  max-width: var(--maxw); margin: 0 auto;
  animation: rise .8s cubic-bezier(.2,.7,.2,1) both;
}
.page .ek-mark { font-family: var(--gur); color: var(--gold); font-size: 40px; line-height: 1; }
.page h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 6vw, 46px); color: var(--ink);
  margin: 14px 0 8px; line-height: 1.15;
}
.page .lede {
  font-family: var(--serif); font-size: 20px; font-style: italic;
  color: var(--ink-soft); max-width: 56ch; margin-bottom: 36px;
}
.page h2 {
  font-family: var(--serif); font-weight: 600; font-size: 24px;
  color: var(--ink); margin: 40px 0 12px;
}
.page p { font-size: var(--fs-body); color: var(--ink-soft); margin-bottom: 16px; max-width: 64ch; }
.page .rule { width: 46px; height: 1px; background: var(--gold); margin: 0 0 34px; opacity: .6; }

/* roadmap timeline */
.phase { border-left: 2px solid var(--line); padding: 4px 0 24px 22px; position: relative; }
.phase::before {
  content: ""; position: absolute; left: -7px; top: 7px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--cream); border: 2px solid var(--gold);
}
.phase.done::before { background: var(--gold); }
.phase h3 { font-family: var(--serif); font-size: 21px; color: var(--ink); margin-bottom: 4px; }
.phase .tag {
  font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 10px; display: inline-block;
}
.phase ul { list-style: none; }
.phase li { font-size: var(--fs-body); color: var(--ink-soft); padding: 4px 0 4px 18px; position: relative; }
.phase li::before { content: "·"; position: absolute; left: 4px; color: var(--gold); font-weight: 700; }

/* ============================================================
   READER
   ============================================================ */
.reader { background: var(--cream); padding: 0 0 120px; }

.controls {
  position: sticky; top: calc(57px + var(--off-h, 0px)); z-index: 20;   /* sits below the site-header */
  background: rgba(246,241,231,.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.controls-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 12px 24px 8px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.ang-nav { display: flex; align-items: center; gap: 14px; }
.ang-btn {
  width: 34px; height: 34px; border: 1px solid var(--line); background: #fff;
  border-radius: 50%; cursor: pointer; font-size: 16px; color: var(--ink-soft);
  display: grid; place-items: center; transition: all .18s;
}
.ang-btn:hover { border-color: var(--gold); color: var(--gold); }
.ang-btn:disabled { opacity: .35; cursor: not-allowed; }
.ang-speak-btn svg { width: 16px; height: 16px; }
.ang-speak-btn.tts-on {
  border-color: var(--gold); color: var(--gold);
  background: rgba(205,163,73,.14);
  animation: tts-pulse 1.6s ease-in-out infinite;
}
.tts-speak-btn.tts-on { border-color: var(--gold); color: var(--gold); background: rgba(205,163,73,.12); }
@keyframes tts-pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(205,163,73,.4); } 50% { box-shadow: 0 0 0 5px rgba(205,163,73,0); } }

/* language chooser popup (when several languages are on screen) */
.tts-lang-pick {
  position: absolute; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  max-width: min(80vw, 320px);
  padding: 8px 10px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  animation: vm-rise .15s ease-out both;
}
.tts-pick-label { font-size: 11px; letter-spacing: .04em; color: var(--ink-soft); margin-right: 2px; }
.tts-pick-btn {
  border: 1px solid var(--line); background: none; color: var(--ink-soft);
  border-radius: 999px; padding: 5px 12px; font-size: 13px; cursor: pointer;
  font-family: inherit; transition: all .15s;
}
.tts-pick-btn:hover { border-color: var(--gold); color: var(--gold); }
.ang-label { font-size: 13px; letter-spacing: .04em; }
.ang-label b { font-family: var(--gur); }
#angInput {
  width: 56px; font: inherit; font-weight: 600; text-align: center;
  border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px;
  background: #fff; color: var(--ink); -appearance: textfield;
}
#angInput:focus { outline: 2px solid var(--gold); outline-offset: 1px; border-color: var(--gold); }
#angInput::-webkit-outer-spin-button, #angInput::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.layers { display: flex; gap: 6px; }
.layer-toggle {
  font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 2px; cursor: pointer; color: var(--ink-soft); transition: all .18s;
  font-weight: 500;
}
.layer-toggle[aria-pressed="true"] { background: var(--night); color: var(--cream); border-color: var(--night); }

.ang-head { text-align: center; padding: 50px 24px 28px; }
.ang-head h2 {
  font-family: var(--serif); font-weight: 500; font-size: 30px;
  color: var(--ink);
}
.rule { width: 46px; height: 1px; background: var(--gold); margin: 22px auto 0; opacity: .6; }

.verses { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px; }

/* page-turn on ang change — FLOWING MODES ONLY (padched + larivaar).
   The freshly-rendered .lv-page swings in from the binding edge while the ink
   is revealed by a soft left-to-right wipe. (Line-by-line keeps its plain rise.)
   It animates one fresh element with one keyframe set → no flash, no cleanup. */
.lv-page.turn-fwd, .lv-page.turn-back {
  -webkit-mask-image: linear-gradient(to right, #000 0 40%, transparent 80%);
          mask-image: linear-gradient(to right, #000 0 40%, transparent 80%);
  -webkit-mask-size: 260% 100%; mask-size: 260% 100%;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  backface-visibility: hidden;
}
.lv-page.turn-fwd  { transform-origin: left center;  animation: lv-turn-fwd  .6s cubic-bezier(.25,.7,.3,1) both; }
.lv-page.turn-back { transform-origin: right center; animation: lv-turn-back .6s cubic-bezier(.25,.7,.3,1) both; }
@keyframes lv-turn-fwd {
  0%   { opacity: 0; transform: perspective(1800px) rotateY(-18deg); -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  100% { opacity: 1; transform: perspective(1800px) rotateY(0);      -webkit-mask-position: 0% 0;   mask-position: 0% 0; }
}
@keyframes lv-turn-back {
  0%   { opacity: 0; transform: perspective(1800px) rotateY(18deg);  -webkit-mask-position: 100% 0; mask-position: 100% 0; }
  100% { opacity: 1; transform: perspective(1800px) rotateY(0);      -webkit-mask-position: 0% 0;   mask-position: 0% 0; }
}
.verse {
  padding: 26px 0 26px 0; border-bottom: 1px solid var(--line);
  display: grid; gap: 12px;
  position: relative;
}

/* bookmark button — shows on verse hover; always visible when saved */
.bk-btn {
  position: absolute; top: 22px; right: 0;
  width: 30px; height: 30px;
  background: none; border: none; cursor: pointer; padding: 5px;
  color: var(--sand); opacity: 0;
  transition: opacity .15s, color .15s;
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.verse:hover .bk-btn,
.bk-btn:focus-visible,
.bk-btn.is-bookmarked        { opacity: 1; }
.bk-btn.is-bookmarked        { color: var(--gold); }
.bk-btn:hover:not(.is-bookmarked) { color: var(--ink-soft); }
.bk-btn svg                  { width: 15px; height: 15px; }
.bk-btn .bk-icon-path        { fill: none; transition: fill .15s; }
.bk-btn.is-bookmarked .bk-icon-path { fill: currentColor; }
@media (hover: none) { .bk-btn { opacity: 0.3; } }
/* Entrance animation is opt-in: only hide-then-reveal when JS has
   marked the container as animating. Without JS (or if the observer
   never fires) verses are simply visible — never stuck invisible. */
.verses.js-anim .verse { opacity: 0; transform: translateY(14px); }
.verses.js-anim .verse.in { animation: rise .7s cubic-bezier(.2,.7,.2,1) forwards; }
.verse:last-child { border-bottom: none; }

/* verse share submenu — slides in on tap/click */
.verse-menu {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 12px 0 2px;
  border-top: 1px solid var(--line);
  animation: vm-rise .15s ease-out both;
}
@keyframes vm-rise {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}
.verse-menu-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 1px solid var(--line); border-radius: 3px;
  padding: 5px 11px;
  font-family: var(--sans); font-size: .72rem; font-weight: 500;
  letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s, color .15s;
}
.verse-menu-btn:hover { border-color: var(--gold); color: var(--gold); }
.verse-menu-btn.copied { border-color: #4a8a50; color: #4a8a50; }
.verse-menu-btn svg { width: 13px; height: 13px; flex-shrink: 0; }
.verse-menu-close {
  margin-left: auto;
  background: none; border: none; cursor: pointer;
  color: var(--sand); font-size: 1.1rem; line-height: 1;
  padding: 3px 6px; border-radius: 3px;
  transition: color .15s, background .15s;
}
.verse-menu-close:hover { color: var(--ink); background: var(--cream-2); }

/* glow a line gold when opened via a shared ?line= link (both modes) */
.verse--linked, .lv-line--linked { animation: read-glow 5s ease-out forwards; border-radius: 4px; }
/* When scroll-reveal is on, the `.in` rise animation shares the `animation`
   property and would override the glow — win with higher specificity and
   keep the line visible (no fade-in for the focused line). */
.verses.js-anim .verse.verse--linked {
  opacity: 1; transform: none;
  animation: read-glow 5s ease-out forwards;
}
@keyframes read-glow {
  0%   { background: rgba(205, 163, 73, .30); }
  100% { background: transparent; }
}

/* subtle hover hint on devices with a pointer */
@media (hover: hover) {
  .verse { cursor: pointer; }
  .verse:hover { background: rgba(128, 128, 128, .04); transition: background .15s; }
}

/* ============================================================
   READING MODE SELECTOR + LARIVAAR CONTROLS
   ============================================================ */
.mode-select { display: flex; justify-content: center; gap: 0; margin-top: 10px; }
.mode-btn {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  letter-spacing: .03em; padding: 5px 14px; cursor: pointer; white-space: nowrap;
  background: #fff; color: var(--ink-soft);
  border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.mode-btn:not(:last-child) { border-right: none; }
.mode-btn:first-child { border-radius: 20px 0 0 20px; }
.mode-btn:last-child  { border-radius: 0 20px 20px 0; }
.mode-btn.active { background: var(--gold); color: #fff; border-color: var(--gold); }

.larivaar-controls { display: none; align-items: center; gap: 6px; flex-wrap: wrap; }
/* Padched: hide the multi-layer toggles, show the single-language picker.
   Larivaar: hide both — it's unbroken Gurmukhi only. */
[data-read-mode="padched"]  .layers           { display: none; }
[data-read-mode="padched"]  .larivaar-controls { display: flex; }
[data-read-mode="larivaar"] .layers           { display: none; }

.lv-langs { display: flex; gap: 6px; }
/* match the line-by-line layer toggles exactly */
.lv-lang-btn {
  font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase;
  padding: 7px 12px; border: 1px solid var(--line); background: #fff;
  border-radius: 2px; cursor: pointer; color: var(--ink-soft); transition: all .18s; font-weight: 500;
}
.lv-lang-btn:hover { border-color: var(--gold); }
.lv-lang-btn.active { background: var(--night); color: var(--cream); border-color: var(--night); }

/* ============================================================
   LARIVAAR PAGE — one language flowing like the physical SGGS
   ============================================================ */
.verses.larivaar { padding-top: 18px; }
.lv-page {
  max-width: var(--maxw); margin: 0 auto;
  text-align: justify; text-justify: inter-word;
}
.lv-page.in { animation: rise .7s cubic-bezier(.2,.7,.2,1) both; }
.lv-line {
  cursor: pointer;
  transition: color .15s, background .15s;
  border-radius: 3px;
}
.lv-line:hover { color: var(--gold); }
.lv-line--active { background: rgba(205,163,73,.16); color: var(--ink); }
.lv-line.is-bookmarked { box-shadow: inset 0 -2px 0 var(--gold); }

/* per-language typography for the flowing text */
.lv-page.lang-gur {
  font-family: var(--gur); font-weight: 500;
  font-size: var(--fs-gur); line-height: 2.05; color: var(--ink);
  letter-spacing: .01em;
}
.lv-page.lang-translit {
  font-family: var(--serif); font-style: italic;
  font-size: calc(var(--fs-en) + 1px); line-height: 1.95; color: var(--ink);
}
.lv-page.lang-en {
  font-family: var(--serif);
  font-size: calc(var(--fs-en) + 1px); line-height: 1.9; color: var(--ink);
}
.lv-page.lang-hi {
  font-family: var(--deva);
  font-size: var(--fs-hi); line-height: 2.0; color: var(--ink);
}

/* ============================================================
   LARIVAAR — flow the unbroken Gurmukhi to fill each row like a
   hand-written saroop, inside an illuminated (saroop) frame.
   ============================================================ */
[data-read-mode="larivaar"] .verses.larivaar,
[data-read-mode="padched"]  .verses.larivaar {
  padding: 16px 14px 44px;
}
/* the illuminated saroop frame wraps both flowing modes (larivaar + padched) */
[data-read-mode="larivaar"] .lv-page,
[data-read-mode="padched"]  .lv-page {
  background: var(--saroop-bg);
  border: 20px solid transparent;
  border-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' fill='none'%3E%3Crect x='1.5' y='1.5' width='97' height='97' rx='2' stroke='%23b8893a' stroke-width='2.4'/%3E%3Crect x='6' y='6' width='88' height='88' stroke='%23dcb964' stroke-width='1'/%3E%3Crect x='9.5' y='9.5' width='81' height='81' stroke='%23b8893a' stroke-width='1.3'/%3E%3Cg fill='%23b8893a'%3E%3Ccircle cx='16' cy='16' r='2'/%3E%3Ccircle cx='22' cy='16' r='1.2'/%3E%3Ccircle cx='16' cy='22' r='1.2'/%3E%3Ccircle cx='84' cy='16' r='2'/%3E%3Ccircle cx='78' cy='16' r='1.2'/%3E%3Ccircle cx='84' cy='22' r='1.2'/%3E%3Ccircle cx='16' cy='84' r='2'/%3E%3Ccircle cx='22' cy='84' r='1.2'/%3E%3Ccircle cx='16' cy='78' r='1.2'/%3E%3Ccircle cx='84' cy='84' r='2'/%3E%3Ccircle cx='78' cy='84' r='1.2'/%3E%3Ccircle cx='84' cy='78' r='1.2'/%3E%3C/g%3E%3Cg fill='%23b8893a'%3E%3Cpath d='M50 5.6 l1.9 2.1 l-1.9 2.1 l-1.9 -2.1 z'/%3E%3Cpath d='M50 90.2 l1.9 2.1 l-1.9 2.1 l-1.9 -2.1 z'/%3E%3Cpath d='M5.6 50 l2.1 1.9 l-2.1 1.9 l-2.1 -1.9 z'/%3E%3Cpath d='M90.2 50 l2.1 1.9 l-2.1 1.9 l-2.1 -1.9 z'/%3E%3C/g%3E%3C/svg%3E") 28 round;
  padding: clamp(20px, 5.5vw, 40px) clamp(16px, 4.5vw, 34px);
  box-shadow: 0 14px 40px rgba(0,0,0,.16);
}
/* larivaar only — flow continuously and fill each line to both margins, breaking
   like a scribe. line-break:anywhere makes every character an equal wrap point, so
   the danda (॥) never gets preferred as a break — rows pack full instead of leaving
   a short, gappy justified tail. break-all is the fallback for older engines. */
[data-read-mode="larivaar"] .lv-page {
  text-align: justify;
  text-justify: inter-character;
  line-break: anywhere;
  word-break: break-all;
  overflow-wrap: anywhere;
  hyphens: none;
}
/* larivaar tracks the S/M/L text-size setting (via --fs-gur); just a tighter,
   more saroop-like line-height than the per-verse view */
[data-read-mode="larivaar"] .lv-page.lang-gur {
  line-height: 1.85;
  letter-spacing: 0;
}
/* keep the active/bookmark highlight readable on the parchment */
[data-read-mode="larivaar"] .lv-line--active,
[data-read-mode="padched"]  .lv-line--active { background: rgba(205,163,73,.22); }

/* floating per-line menu (larivaar) */
.lv-menu {
  position: absolute; z-index: 60; display: none;
  align-items: center; flex-wrap: wrap; gap: 6px;
  max-width: calc(100vw - 24px);
  padding: 7px 8px;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.16);
}
.lv-menu .verse-menu-btn.is-bookmarked { border-color: var(--gold); color: var(--gold); }
.lv-menu .verse-menu-btn.is-bookmarked .bk-icon-path { fill: currentColor; }

.v-gur {
  font-family: var(--gur); font-weight: 500;
  font-size: var(--fs-gur);
  line-height: 1.9; color: var(--ink); letter-spacing: .005em;
}
.v-translit {
  font-family: var(--serif); font-style: italic;
  font-size: var(--fs-translit); color: var(--sand); line-height: 1.6;
}
.v-en {
  font-family: var(--serif);
  font-size: var(--fs-en); color: var(--ink-soft); line-height: 1.7;
}
.v-hi {
  font-family: var(--deva);
  font-size: var(--fs-hi); color: var(--ink-soft); line-height: 1.85;
}
.hidden { display: none !important; }

/* ============================================================
   LIVE CONTEXT STRIP (in sticky header) — ang/page · raag · author,
   updates as you scroll. Same behaviour on mobile and desktop.
   ============================================================ */
.context-strip {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px 10px;
  display: flex; align-items: baseline; justify-content: center;
  gap: 8px; flex-wrap: wrap;
  font-size: 12px; line-height: 1.4; text-align: center;
}
.context-strip .ctx-raag {
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--gold); font-weight: 600;
}
.context-strip .ctx-author {
  font-family: var(--sans); letter-spacing: .08em; text-transform: uppercase;
  font-size: 11px; color: var(--sand);
}
.context-strip .ctx-sep { color: var(--line); }
/* hide separators when there's no section info yet (top of some angs) */
.context-strip:not(.has-section) .ctx-sep,
.context-strip:not(.has-section) .ctx-sep-author { display: none; }

/* ============================================================
   LINE-BY-LINE NAV — fixed bar at the bottom of the viewport
   ============================================================ */
.line-nav {
  position: sticky; bottom: 0; z-index: 10;
  display: flex; align-items: center;
  padding: 10px 20px;
  background: var(--cream);
  border-top: 1px solid var(--line);
  box-shadow: 0 -4px 16px rgba(0,0,0,.07);
}
.line-nav-btn {
  flex-shrink: 0;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--line); border-radius: 50%;
  cursor: pointer; color: var(--ink);
  transition: border-color .15s, background .15s, color .15s;
}
.line-nav-btn:hover  { border-color: var(--gold); color: var(--gold); }
.line-nav-btn:active { background: var(--cream-2); }
.line-nav-btn svg    { width: 16px; height: 16px; }
/* centre of the nav: current raag · author, opens the table of contents */
.line-nav-ctx {
  flex: 1; min-width: 0; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: none; border: none; cursor: pointer;
  padding: 4px 24px; color: var(--ink); border-radius: 10px;
  transition: background .15s;
}
.line-nav-ctx:hover { background: rgba(205,163,73,.07); }
.ln-ctx-text {
  display: inline-flex; align-items: baseline; gap: 6px; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.line-nav-ctx .ctx-raag { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--gold); font-weight: 600; }
.line-nav-ctx .ctx-author { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--sand); }
.line-nav-ctx .ctx-sep { color: var(--line); }
.line-nav-ctx:not(.has-section) .ctx-sep-author,
.line-nav-ctx:not(.has-section) .ctx-author { display: none; }
.ln-ctx-chev { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 13px; height: 13px; color: var(--sand); }
.line-nav-count {
  font-family: var(--sans); font-size: .62rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}

/* table of contents overlay (bottom sheet) */
.reader-toc { position: fixed; inset: 0; z-index: 130; pointer-events: none; }
.reader-toc.open { pointer-events: auto; }
.reader-toc-backdrop { position: absolute; inset: 0; background: rgba(8,10,24,.5); opacity: 0; transition: opacity .25s ease; }
.reader-toc.open .reader-toc-backdrop { opacity: 1; }
.reader-toc-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 82vh; display: flex; flex-direction: column;
  background: var(--cream); border-top: 1px solid var(--line);
  border-radius: 18px 18px 0 0; box-shadow: 0 -12px 40px rgba(0,0,0,.3);
  transform: translateY(100%); transition: transform .28s cubic-bezier(.2,.7,.2,1);
}
.reader-toc.open .reader-toc-panel { transform: none; }
.reader-toc-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.reader-toc-title { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); }
.reader-toc-close { display: grid; place-items: center; width: 34px; height: 34px; border: none; background: none; color: var(--ink-soft); cursor: pointer; border-radius: 50%; }
.reader-toc-close:hover { color: var(--gold); background: rgba(205,163,73,.1); }
.reader-toc-close svg { width: 20px; height: 20px; }
.reader-toc-list { overflow-y: auto; padding: 4px 0 calc(14px + env(safe-area-inset-bottom, 0px)); }
.reader-toc-row {
  display: block; width: 100%; text-align: left; cursor: pointer;
  background: none; border: none; border-bottom: 1px solid var(--line);
  padding: 12px 18px; color: var(--ink);
}
.reader-toc-row:hover { background: rgba(205,163,73,.06); }
.reader-toc-row.current { background: rgba(205,163,73,.12); }
.rtoc-line { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.rtoc-raag { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.reader-toc-row.current .rtoc-raag { color: var(--gold); font-weight: 600; }
.rtoc-ang { font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: var(--gold); white-space: nowrap; flex-shrink: 0; }
.rtoc-au { display: block; margin-top: 3px; font-family: var(--sans); font-size: 12px; color: var(--sand); line-height: 1.45; }

/* Sehaj Path progress ribbon — 3px line at the bottom of the sticky controls */
.reader-progress { height: 3px; background: var(--line); }
.reader-progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  transition: width .4s ease;
}

/* ============================================================
   ANG CONTENTS (top of each ang — lists all raags & authors)
   ============================================================ */
.ang-contents {
  margin: 12px auto 0; max-width: 56ch;
  display: flex; flex-direction: column; gap: 4px;
}
.ang-contents .contents-row {
  font-family: var(--serif); font-size: 15px; color: var(--ink-soft);
  line-height: 1.5;
}
.ang-contents .contents-key {
  font-family: var(--sans); font-size: 10px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--gold); font-weight: 600;
  margin-right: 8px;
}

/* ============================================================
   FOOTER (every page)
   ============================================================ */
.foot {
  background: var(--night); color: rgba(246,241,231,.6);
  text-align: center; padding: 50px 24px; font-size: 13px; line-height: 1.8;
}
.foot .ek { font-family: var(--gur); color: var(--gold); font-size: 22px; }
.foot a { color: var(--gold-soft); text-decoration: none; }
.foot .footlinks { margin-top: 12px; display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.foot .note { font-size: 11px; color: rgba(246,241,231,.35); margin-top: 16px; max-width: 520px; margin-inline:auto; }

/* ============================================================
   HEADER SEARCH BAR — slides in over the brand/actions
   ============================================================ */
.header-search {
  position: absolute; inset: 0;
  display: flex; align-items: center;
  padding: 0 8px 0 18px;
  background: rgba(14,20,48,.92);
  backdrop-filter: blur(10px);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
}
.site-header.is-searching .header-search  { opacity: 1; pointer-events: auto; }
.site-header.is-searching .brand,
.site-header.is-searching .header-actions { opacity: 0; pointer-events: none; transition: opacity .15s; }
/* on the dark hero, the search bar still needs a solid background */
.site-header.on-dark.is-searching { background: rgba(14,20,48,.92); backdrop-filter: blur(10px); }

.header-search-form {
  flex: 1; display: flex; align-items: center; gap: 10px;
}
.header-search-form svg { width: 16px; height: 16px; color: var(--gold-soft); flex-shrink: 0; }

.header-search-input {
  flex: 1; background: transparent; border: none; outline: none;
  font-family: var(--sans); font-size: 15px;
  color: var(--cream); caret-color: var(--gold);
}
.header-search-input::placeholder { color: rgba(246,241,231,.32); }
.header-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* "ways to search" guide — drops below the header while searching an empty field */
.search-guide {
  display: none;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  background: rgba(14,20,48,.97); backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(205,163,73,.22);
  box-shadow: 0 14px 30px rgba(0,0,0,.34);
  padding: 12px 18px 14px;
  max-height: 62vh; overflow-y: auto;
}
.site-header.guide-open .search-guide { display: block; animation: sg-drop .18s ease-out both; }
@keyframes sg-drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sg-head {
  font-family: var(--sans); font-size: 10.5px; font-weight: 600;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold-soft); margin-bottom: 6px;
}
.sg-row { padding: 9px 0; border-top: 1px solid rgba(255,255,255,.07); }
.sg-row:first-of-type { border-top: none; }
.sg-line { font-family: var(--sans); line-height: 1.5; }
.sg-name { font-size: 14px; font-weight: 600; color: #f6f1e7; margin-right: 7px; }
.sg-desc { font-size: 13px; color: rgba(246,241,231,.6); }
.sg-egs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.sg-eg {
  font-family: var(--sans); font-size: 12.5px; color: var(--gold-soft);
  border: 1px solid rgba(205,163,73,.4); border-radius: 999px;
  padding: 3px 11px; text-decoration: none; transition: background .15s;
}
.sg-eg:hover { background: rgba(205,163,73,.15); }

/* ============================================================
   SEARCH RESULTS PAGE
   ============================================================ */
.search-page {
  max-width: var(--maxw); margin: 0 auto;
  padding: 36px 24px 96px;
  min-height: 70vh;
}

.search-count {
  font-family: var(--serif); font-size: 17px; font-style: italic;
  color: var(--ink-soft); margin-bottom: 28px;
}
.search-count strong { font-style: normal; color: var(--ink); }

.search-empty, .search-loading {
  font-family: var(--serif); font-style: italic;
  font-size: 18px; color: var(--sand); margin-top: 40px;
}

.results-section-head {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600;
  margin: 36px 0 12px;
}

.result-card {
  display: block; text-decoration: none; color: inherit;
  border: 1px solid var(--line);
  border-radius: 4px; padding: 18px 20px;
  margin-bottom: 10px; cursor: pointer;
  transition: border-color .18s, box-shadow .18s;
  background: #fff;
}
.result-card:hover {
  border-color: var(--gold);
  box-shadow: 0 2px 14px rgba(205,163,73,.12);
}

.result-card-head {
  display: flex; align-items: center;
  justify-content: space-between; gap: 10px;
  margin-bottom: 8px;
}
.result-source {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--sand);
}

.score-chip {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 20px; letter-spacing: .04em;
  flex-shrink: 0;
}
.score-chip.high { background: rgba(205,163,73,.15); color: var(--gold); }
.score-chip.mid  { background: rgba(14,20,48,.06);   color: var(--ink-soft); }
.score-chip.low  { background: rgba(14,20,48,.04);   color: var(--sand); }
.score-chip.author  { background: rgba(205,163,73,.15); color: var(--gold); text-transform: none; letter-spacing: .02em; }
.score-chip.related { background: rgba(14,20,48,.06); color: var(--ink-soft); text-transform: none; letter-spacing: .02em; }
.score-chip.initials { background: rgba(205,163,73,.15); color: var(--gold); text-transform: none; letter-spacing: .02em; white-space: nowrap; }
/* unified ranking: % chip + a small type tag for non-keyword matches */
.result-chips { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.kind-tag {
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--sand); white-space: nowrap;
}

.result-gur {
  font-family: var(--gur); font-size: 20px;
  line-height: 1.8; color: var(--ink); margin-bottom: 4px;
}
.result-en {
  font-family: var(--serif); font-size: 15px;
  color: var(--ink-soft); line-height: 1.6;
  margin-bottom: 4px;
}
.result-link {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .06em; color: var(--gold);
  margin-top: 10px;
}

/* ============================================================
   ASK / GURBANI COMPANION  (chat.html)
   ============================================================ */
.chat-body { padding-bottom: 0; }

.chat-main {
  max-width: var(--maxw); margin: 0 auto;
  padding: 0 24px;
  min-height: calc(100vh - 220px);
}

/* intro (shown before the first question) */
.chat-intro {
  padding: 56px 0 24px;
  animation: rise .8s cubic-bezier(.2,.7,.2,1) both;
}
.chat-intro .ek-mark { font-family: var(--gur); color: var(--gold); font-size: 40px; line-height: 1; }
.chat-intro h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(30px, 5.6vw, 44px); color: var(--ink);
  margin: 10px 0 8px; line-height: 1.15;
}
.chat-intro .lede {
  font-family: var(--serif); font-size: 20px; font-style: italic;
  color: var(--ink-soft); max-width: 54ch; margin-bottom: 28px;
}
.chat-intro .rule { width: 46px; height: 1px; background: var(--gold); margin: 0 0 28px; opacity: .6; }

.chat-suggest { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.suggest-btn {
  font-family: var(--sans); font-size: 14px;
  text-align: left; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 22px;
  padding: 10px 16px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s, color .15s;
}
.suggest-btn:hover { border-color: var(--gold); color: var(--gold); box-shadow: 0 2px 12px rgba(205,163,73,.12); }

.chat-disclaimer {
  font-family: var(--sans); font-size: 12.5px; line-height: 1.6;
  color: var(--sand); max-width: 60ch;
  border-top: 1px solid var(--line); padding-top: 18px;
}

/* conversation toolbar (history + new) */
.chat-bar {
  position: sticky; top: calc(57px + var(--off-h, 0px)); z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 0;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.chat-bar-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 500;
  color: var(--ink-soft); background: transparent;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: all .15s;
}
.chat-bar-btn:hover { border-color: var(--gold); color: var(--gold); }
.chat-bar-btn svg { width: 16px; height: 16px; }

/* conversations drawer */
.chat-drawer { position: fixed; inset: 0; z-index: 120; pointer-events: none; }
.chat-drawer.open { pointer-events: auto; }
.chat-drawer-backdrop {
  position: absolute; inset: 0; background: rgba(8,10,24,.5);
  opacity: 0; transition: opacity .25s ease;
}
.chat-drawer.open .chat-drawer-backdrop { opacity: 1; }
.chat-drawer-panel {
  position: absolute; top: 0; left: 0; height: 100%;
  width: min(340px, 86vw);
  display: flex; flex-direction: column;
  background: var(--cream); border-right: 1px solid var(--line);
  box-shadow: 8px 0 32px rgba(0,0,0,.25);
  transform: translateX(-100%); transition: transform .25s ease;
}
.chat-drawer.open .chat-drawer-panel { transform: none; }
.chat-drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 18px 12px;
}
.chat-drawer-title { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); }
.chat-drawer-close {
  display: grid; place-items: center; width: 34px; height: 34px;
  border: none; background: transparent; color: var(--ink-soft); cursor: pointer; border-radius: 50%;
}
.chat-drawer-close:hover { color: var(--gold); background: rgba(205,163,73,.1); }
.chat-drawer-close svg { width: 20px; height: 20px; }
.chat-drawer-new {
  display: flex; align-items: center; gap: 8px;
  margin: 0 14px 8px; padding: 11px 14px;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  color: var(--night); background: var(--gold);
  border: none; border-radius: 10px; cursor: pointer; transition: background .15s;
}
.chat-drawer-new:hover { background: var(--gold-soft); }
.chat-drawer-new svg { width: 16px; height: 16px; }
.chat-drawer-list { flex: 1; overflow-y: auto; padding: 6px 10px 10px; }
.chat-drawer-empty { font-family: var(--sans); font-size: 13px; color: var(--sand); padding: 16px 8px; text-align: center; }
.chat-conv {
  display: flex; align-items: stretch; gap: 2px;
  border-radius: 10px; transition: background .15s;
}
.chat-conv:hover { background: rgba(205,163,73,.08); }
.chat-conv.active { background: rgba(205,163,73,.14); }
.chat-conv-open {
  flex: 1; min-width: 0; text-align: left; cursor: pointer;
  background: transparent; border: none; padding: 10px 10px;
  display: flex; flex-direction: column; gap: 3px;
}
.chat-conv-title {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-conv-time { font-family: var(--sans); font-size: 11px; color: var(--sand); }
.chat-conv-del {
  flex-shrink: 0; width: 36px; display: grid; place-items: center;
  background: transparent; border: none; color: var(--sand); cursor: pointer; border-radius: 8px;
}
.chat-conv-del:hover { color: #c0584e; background: rgba(192,88,78,.1); }
.chat-conv-del svg { width: 15px; height: 15px; }
.chat-drawer-note {
  font-family: var(--sans); font-size: 11px; color: var(--sand);
  padding: 12px 18px; border-top: 1px solid var(--line);
}

/* conversation thread */
.chat-thread { padding: 16px 0 40px; display: flex; flex-direction: column; gap: 22px; }

.chat-msg { display: flex; }
.chat-msg-user  { justify-content: flex-end; }
.chat-msg-model { justify-content: flex-start; }

.chat-bubble {
  max-width: 88%;
  font-size: var(--fs-body); line-height: 1.7;
  animation: rise .4s ease both;
}
.chat-msg-user .chat-bubble {
  background: var(--night); color: var(--cream);
  border-radius: 16px 16px 4px 16px;
  padding: 12px 18px;
}
.chat-msg-model .chat-bubble {
  background: transparent; color: var(--ink);
  max-width: 100%;
}
.chat-msg-model .chat-bubble p { margin: 0 0 12px; }
.chat-msg-model .chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { color: var(--ink); font-weight: 600; }
.chat-bubble em { font-style: italic; }

/* rendered Markdown inside an answer */
.chat-msg-model .chat-bubble h3,
.chat-msg-model .chat-bubble h4,
.chat-msg-model .chat-bubble h5 {
  font-family: var(--sans); color: var(--ink); font-weight: 600;
  margin: 16px 0 6px; line-height: 1.3;
}
.chat-msg-model .chat-bubble h3 { font-size: 1.1em; }
.chat-msg-model .chat-bubble h4 { font-size: 1em; }
.chat-msg-model .chat-bubble h5 { font-size: .92em; color: var(--ink-soft); letter-spacing: .02em; text-transform: uppercase; }
.chat-msg-model .chat-bubble h3:first-child,
.chat-msg-model .chat-bubble h4:first-child,
.chat-msg-model .chat-bubble h5:first-child { margin-top: 0; }
.chat-msg-model .chat-bubble ul,
.chat-msg-model .chat-bubble ol { margin: 4px 0 12px; padding-left: 22px; }
.chat-msg-model .chat-bubble li { margin: 3px 0; line-height: 1.6; }
.chat-bubble code {
  font-family: monospace; font-size: .9em;
  background: var(--cream-2); padding: 1px 5px; border-radius: 3px;
}

/* inline citation links */
.chat-cite {
  display: inline; white-space: nowrap;
  font-family: var(--sans); font-size: .82em; font-weight: 600;
  color: var(--gold); text-decoration: none;
  border-bottom: 1px dotted var(--gold);
  padding: 0 1px;
}
.chat-cite:hover { color: var(--ink); border-bottom-style: solid; }

/* referenced verse cards under an answer */
.chat-verses { margin-top: 18px; display: flex; flex-direction: column; gap: 10px; }
.chat-verses-head {
  font-family: var(--sans); font-size: 11px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold); font-weight: 600; margin-bottom: 2px;
}

/* collapsible references under an answer */
.chat-refs { margin-top: 16px; }
.chat-refs-summary {
  cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--gold);
  padding: 6px 0; user-select: none;
}
.chat-refs-summary::-webkit-details-marker { display: none; }
.chat-refs-summary::before {
  content: "▸"; color: var(--sand); font-size: 10px; transition: transform .15s;
}
.chat-refs[open] .chat-refs-summary::before { content: "▾"; }
.chat-refs-count {
  background: rgba(205,163,73,.15); color: var(--gold);
  border-radius: 20px; padding: 1px 9px; font-size: 10px; letter-spacing: .02em;
}
.chat-refs-list { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }

/* read-aloud (device TTS) button under an answer */
.chat-answer-actions { margin-top: 10px; }
.chat-speak {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 50%;
  color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chat-speak:hover { border-color: var(--gold); color: var(--gold); }
.chat-speak.speaking { border-color: var(--gold); color: var(--gold); background: rgba(205,163,73,.12); }
.chat-speak svg { width: 16px; height: 16px; }

/* follow-up suggestion chips under the latest answer */
.chat-followups {
  margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.chat-followups-label {
  width: 100%;
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--sand); margin-bottom: 2px;
}
.chat-followup {
  font-family: var(--sans); font-size: 13.5px; text-align: left;
  color: var(--ink); background: transparent;
  border: 1px solid var(--line); border-radius: 18px;
  padding: 8px 14px; cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.chat-followup::before { content: "↳ "; color: var(--gold); }
.chat-followup:hover { border-color: var(--gold); color: var(--gold); background: rgba(205,163,73,.06); }
.chat-verse {
  display: block; text-decoration: none;
  border: 1px solid var(--line); border-left: 3px solid var(--gold);
  border-radius: 4px; padding: 14px 16px; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.chat-verse:hover { box-shadow: 0 2px 14px rgba(205,163,73,.12); }
.chat-verse-meta {
  font-family: var(--sans); font-size: 10.5px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--sand);
  margin-bottom: 8px;
}
.chat-verse-gur { font-family: var(--gur); font-size: 19px; line-height: 1.8; color: var(--ink); margin-bottom: 4px; }
.chat-verse-en  { font-family: var(--serif); font-size: 15px; color: var(--ink-soft); line-height: 1.55; }
.chat-verse-link { font-family: var(--sans); font-size: 11px; letter-spacing: .06em; color: var(--gold); display: inline-block; margin-top: 8px; }

.chat-error { color: #b4452f; font-style: italic; }

/* typing indicator */
.chat-typing { display: inline-flex; gap: 5px; padding: 4px 0; }
.chat-typing i {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--sand); display: inline-block;
  animation: chat-blink 1.2s infinite both;
}
.chat-typing i:nth-child(2) { animation-delay: .2s; }
.chat-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes chat-blink { 0%,80%,100% { opacity:.25; transform: translateY(0); } 40% { opacity:1; transform: translateY(-3px); } }
.chat-thinking {
  margin-left: 8px; font-family: var(--serif); font-style: italic;
  font-size: 14px; color: var(--sand);
}

/* composer pinned to the bottom of the viewport */
.chat-composer {
  position: sticky; bottom: 0; z-index: 20;
  background: var(--cream);
  border-top: 1px solid var(--line);
  padding: 12px 24px calc(10px + env(safe-area-inset-bottom, 0px));
}
.chat-composer-inner {
  max-width: var(--maxw); margin: 0 auto;
  display: flex; align-items: flex-end; gap: 10px;
}
.chat-input {
  flex: 1; resize: none; overflow-y: auto;
  font-family: var(--sans); font-size: 16px; line-height: 1.5;
  color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 22px;
  padding: 11px 16px; max-height: 160px;
  transition: border-color .15s;
}
.chat-input:focus { outline: none; border-color: var(--gold); }
.chat-input:disabled { opacity: .6; }
.chat-send {
  flex-shrink: 0; width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold); color: #fff;
  border: none; border-radius: 50%; cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
}
.chat-send:hover:not(:disabled) { background: var(--gold-soft); }
.chat-send:active:not(:disabled) { transform: scale(.94); }
.chat-send:disabled { opacity: .4; cursor: default; }
.chat-send svg { width: 19px; height: 19px; }
.chat-composer-note {
  max-width: var(--maxw); margin: 8px auto 0;
  font-family: var(--sans); font-size: 11px; color: var(--sand);
  text-align: center;
}

/* ============================================================
   DARK MODE  [data-theme="dark"]
   ============================================================ */
[data-theme="dark"] {
  --cream:    #0e1430;
  --cream-2:  #161e44;
  --ink:      #f0ead8;
  --ink-soft: #b0a494;
  --sand:     #9a8d76;
  --line:     #28335e;
  --saroop-bg:   #12183a;
  --saroop-band: rgba(205,163,73,.13);
}
/* always-dark surfaces use --cream for text; pin them to the original light value */
[data-theme="dark"] .brand               { color: #f6f1e7; }
[data-theme="dark"] .mool                { color: #f6f1e7; }
[data-theme="dark"] .btn-ghost           { color: #f6f1e7; }
[data-theme="dark"] .header-search-input { color: #f6f1e7; }
[data-theme="dark"] .controls     { background: rgba(14,20,48,.97); }
[data-theme="dark"] .ang-btn      { background: var(--night-2); }
[data-theme="dark"] #angInput     { background: var(--night-2); color: var(--ink); border-color: var(--line); }
[data-theme="dark"] .layer-toggle { background: var(--night-2); border-color: var(--line); }
[data-theme="dark"] .layer-toggle[aria-pressed="true"] { background: var(--gold); color: var(--night); border-color: var(--gold); }
[data-theme="dark"] .result-card  { background: var(--night-2); }
[data-theme="dark"] .score-chip.mid { background: rgba(255,255,255,.08); }
[data-theme="dark"] .score-chip.low { background: rgba(255,255,255,.05); }
[data-theme="dark"] .phase::before { background: var(--cream); }
[data-theme="dark"] .suggest-btn   { background: var(--night-2); }
[data-theme="dark"] .chat-verse    { background: var(--night-2); }
[data-theme="dark"] .chat-input    { background: var(--night-2); color: var(--ink); }
[data-theme="dark"] .chat-msg-user .chat-bubble { background: var(--night-3); color: #f6f1e7; }
[data-theme="dark"] .chat-send     { color: var(--night); }
[data-theme="dark"] .huk-speed-btn { background: var(--night-2); }
[data-theme="dark"] .huk-speed-btn.active { background: var(--gold); color: var(--night); }
[data-theme="dark"] .mode-btn,
[data-theme="dark"] .lv-lang-btn { background: var(--night-2); border-color: var(--line); }
[data-theme="dark"] .lv-lang-btn.active { background: var(--gold); color: var(--night); border-color: var(--gold); }
[data-theme="dark"] .lv-line--active { background: rgba(205,163,73,.22); }

/* ============================================================
   OLED DARK MODE  [data-theme="oled"]
   Pure black — saves battery and looks best on OLED screens.
   ============================================================ */
[data-theme="oled"] {
  --cream:    #000000;
  --cream-2:  #0d0d0d;
  --ink:      #f0ead8;
  --ink-soft: #a09080;
  --sand:     #7a6f5f;
  --line:     #1e1e1e;
  --night:    #000000;
  --night-2:  #0d0d0d;
  --night-3:  #111111;
  --saroop-bg:   #080808;
  --saroop-band: rgba(205,163,73,.12);
}
[data-theme="oled"] .brand               { color: #f6f1e7; }
[data-theme="oled"] .mool                { color: #f6f1e7; }
[data-theme="oled"] .btn-ghost           { color: #f6f1e7; }
[data-theme="oled"] .header-search-input { color: #f6f1e7; }
[data-theme="oled"] .site-header         { background: rgba(0,0,0,.98); }
[data-theme="oled"] .controls     { background: rgba(0,0,0,.97); }
[data-theme="oled"] .ang-btn      { background: var(--night-2); }
[data-theme="oled"] #angInput     { background: var(--night-2); color: var(--ink); border-color: var(--line); }
[data-theme="oled"] .layer-toggle { background: var(--night-2); border-color: var(--line); }
[data-theme="oled"] .layer-toggle[aria-pressed="true"] { background: var(--gold); color: #000; border-color: var(--gold); }
[data-theme="oled"] .result-card  { background: var(--night-2); }
[data-theme="oled"] .score-chip.mid { background: rgba(255,255,255,.08); }
[data-theme="oled"] .score-chip.low { background: rgba(255,255,255,.05); }
[data-theme="oled"] .phase::before { background: var(--cream); }
[data-theme="oled"] .suggest-btn   { background: var(--night-2); }
[data-theme="oled"] .chat-verse    { background: var(--night-2); }
[data-theme="oled"] .chat-input    { background: var(--night-2); color: var(--ink); }
[data-theme="oled"] .chat-msg-user .chat-bubble { background: var(--night-3); color: #f6f1e7; }
[data-theme="oled"] .chat-send     { color: #000; }
[data-theme="oled"] .chat-composer { background: rgba(0,0,0,.98); }
[data-theme="oled"] .huk-speed-btn { background: var(--night-2); }
[data-theme="oled"] .huk-speed-btn.active { background: var(--gold); color: #000; }
[data-theme="oled"] .mode-btn,
[data-theme="oled"] .lv-lang-btn { background: var(--night-2); border-color: var(--line); }
[data-theme="oled"] .lv-lang-btn.active { background: var(--gold); color: #000; border-color: var(--gold); }
[data-theme="oled"] .lv-line--active { background: rgba(205,163,73,.22); }

/* ============================================================
   TEXT SIZE  [data-text-size]
   ============================================================ */
[data-text-size="sm"] {
  --fs-gur:      clamp(18px, 3.4vw, 22px);
  --fs-translit: 14px;
  --fs-en:       15px;
  --fs-hi:       14px;
  --fs-body:     15px;
}
[data-text-size="lg"] {
  --fs-gur:      clamp(26px, 5.2vw, 34px);
  --fs-translit: 19px;
  --fs-en:       21px;
  --fs-hi:       20px;
  --fs-body:     20px;
}

/* ============================================================
   NAV MENU SETTINGS (dark mode toggle + text size)
   ============================================================ */
.menu-settings {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 4px 0 6px;
  flex-shrink: 0;   /* don't compress the settings rows when the menu scrolls */
}
.menu-theme-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68);
}
.theme-btns { display: flex; gap: 5px; }
.theme-btn {
  height: 30px; padding: 0 9px; border-radius: 2px;
  border: 1px solid rgba(246,241,231,.22); background: transparent;
  cursor: pointer;
  font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .06em;
  color: rgba(246,241,231,.55);
  transition: all .15s;
}
.theme-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.theme-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }
.menu-size-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 12px;
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68);
}
.size-btns { display: flex; gap: 5px; }
.size-btn {
  width: 30px; height: 30px; border-radius: 2px;
  border: 1px solid rgba(246,241,231,.22); background: transparent;
  cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .06em;
  color: rgba(246,241,231,.55);
  transition: all .15s;
}
.size-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.size-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

/* read-aloud speed row (Slow / Normal / Fast) */
.menu-speech-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 20px 12px;
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68);
}
.speed-btns { display: flex; gap: 5px; }
.speed-btn {
  height: 30px; padding: 0 9px; border-radius: 2px;
  border: 1px solid rgba(246,241,231,.22); background: transparent; cursor: pointer;
  font-family: var(--sans); font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: none; color: rgba(246,241,231,.55); transition: all .15s;
}
.speed-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.speed-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

/* language selector row in the menu (matches the theme row) */
.menu-lang-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px 10px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--sans); font-size: 13px;
  letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68);
}
.lang-btns { display: flex; gap: 5px; }
.lang-btn {
  height: 30px; padding: 0 12px; border-radius: 2px;
  border: 1px solid rgba(246,241,231,.22); background: transparent;
  cursor: pointer;
  font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  text-transform: none;
  color: rgba(246,241,231,.55);
  transition: all .15s;
}
.lang-btn:hover { border-color: var(--gold-soft); color: var(--gold-soft); }
.lang-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

/* ============================================================
   LANGUAGE POPUPS (first visit)
   ============================================================ */
.lang-pop-backdrop {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  padding: 24px;
  background: rgba(8,10,24,.55);
  backdrop-filter: blur(3px);
  opacity: 0; transition: opacity .22s ease;
}
.lang-pop-backdrop.show { opacity: 1; }
.lang-pop {
  width: 100%; max-width: 380px;
  background: var(--cream); color: var(--ink);
  border: 1px solid var(--line); border-radius: 18px;
  padding: 30px 26px 24px; text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,.35);
  transform: translateY(10px) scale(.98); transition: transform .22s ease;
}
.lang-pop-backdrop.show .lang-pop { transform: none; }
.lang-pop-ek { font-family: var(--gur); font-size: 34px; color: var(--gold); line-height: 1; margin-bottom: 12px; }
.lang-pop-title { font-family: var(--serif); font-size: 25px; font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.lang-pop-body { font-family: var(--sans); font-size: 15px; line-height: 1.55; color: var(--ink-soft); margin-bottom: 20px; }
.lang-pop-actions { display: flex; flex-direction: column; gap: 10px; }
.lang-pop-btn {
  width: 100%; padding: 13px 16px; border-radius: 10px;
  border: 1px solid var(--line); background: transparent; color: var(--ink);
  font-family: var(--sans); font-size: 15px; font-weight: 600; cursor: pointer;
  transition: all .15s;
}
.lang-pop-btn:hover { border-color: var(--gold); color: var(--gold); }
.lang-pop-primary { background: var(--gold); border-color: var(--gold); color: var(--night); }
.lang-pop-primary:hover { background: var(--gold-soft); border-color: var(--gold-soft); color: var(--night); }

/* Punjabi UI: keep Latin in Inter/Cormorant, render Gurmukhi via Mukta Mahee (per-glyph fallback) */
html[data-lang="pa"] {
  --sans:  "Inter", "Mukta Mahee", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Mukta Mahee", Georgia, serif;
}
/* Hindi UI: Latin in Inter/Cormorant, Devanagari via Mukta (per-glyph fallback) */
html[data-lang="hi"] {
  --sans:  "Inter", "Mukta", system-ui, sans-serif;
  --serif: "Cormorant Garamond", "Mukta", Georgia, serif;
}
/* Indic scripts must NOT be letter-spaced — tracking inserts gaps between
   characters and breaks matras/conjuncts. Neutralise it across the UI when the
   interface language is Punjabi or Hindi (Latin tracking is only an en nicety). */
html[data-lang="pa"] *,
html[data-lang="hi"] * { letter-spacing: normal !important; }

/* long-form prose pages keep all languages in the markup; show the active one */
[data-lang-block] { display: none; }
html[data-lang="pa"] [data-lang-block="pa"] { display: block; }
html[data-lang="hi"] [data-lang-block="hi"] { display: block; }
html:not([data-lang="pa"]):not([data-lang="hi"]) [data-lang-block="en"] { display: block; }

/* ============================================================
   HUKAMNAMA PAGE
   ============================================================ */
.huk-main { background: var(--cream); padding: 0 0 120px; }
.huk-head {
  max-width: var(--maxw); margin: 0 auto;
  padding: 72px 24px 32px;
  animation: rise .8s cubic-bezier(.2,.7,.2,1) both;
}
.huk-head .ek-mark { font-family: var(--gur); color: var(--gold); font-size: 40px; line-height: 1; margin-bottom: 14px; }
.huk-head h1 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(32px, 6vw, 46px); color: var(--ink);
  margin: 14px 0 8px; line-height: 1.15;
}
.huk-meta { font-size: 15px; color: var(--ink-soft); margin-top: 6px; }
.huk-ang-link { color: var(--gold); text-decoration: none; font-weight: 500; }
.huk-ang-link:hover { text-decoration: underline; }

/* HUKAMNAMA AUDIO PLAYERS */
.huk-audio { margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.huk-audio-label {
  font-family: var(--sans); font-size: 11px; font-weight: 600;
  letter-spacing: .18em; text-transform: uppercase; color: var(--gold);
  margin-bottom: 12px;
}
.huk-audio-note {
  display: block; margin-top: 4px;
  font-weight: 400; letter-spacing: .02em; text-transform: none;
  font-size: 11.5px; color: var(--sand);
}
.huk-speed { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.huk-speed-label {
  font-family: var(--sans); font-size: 10px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase; color: var(--sand);
  margin-right: 2px;
}
.huk-speed-btn {
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  padding: 4px 14px; border: 1px solid var(--line); border-radius: 20px;
  background: #fff; color: var(--ink-soft); cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.huk-speed-btn:hover { border-color: var(--gold); }
.huk-speed-btn.active { background: var(--gold); color: #fff; border-color: var(--gold); }

.huk-audio-items { display: flex; flex-direction: column; gap: 12px; }
.huk-audio-item { display: flex; align-items: center; gap: 12px; }
.huk-audio-lang {
  flex-shrink: 0; width: 84px;
  font-family: var(--gur); font-size: 14px; color: var(--ink-soft);
}
.huk-audio-item audio { flex: 1; height: 38px; max-width: 420px; }

/* HUKAMNAMA HOMEPAGE WIDGET */
.huk-section {
  background: var(--cream-2);
  padding: 56px 24px 68px;
  border-top: 1px solid var(--line);
}
.huk-widget-head {
  max-width: var(--maxw); margin: 0 auto 8px;
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: 8px;
}
.huk-widget-date { font-size: 14px; color: var(--ink-soft); }
.huk-widget-meta {
  max-width: var(--maxw); margin: 0 auto 24px;
  font-size: 14px; color: var(--ink-soft);
}
.huk-widget-verse {
  max-width: var(--maxw); margin: 0 auto 28px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.huk-widget-verse p { margin: 0; }
.huk-widget-verse .v-gur {
  font-family: var(--gur); font-weight: 500;
  font-size: clamp(20px, 4vw, 26px);
  line-height: 1.9; color: var(--ink); margin-bottom: 8px;
}
.huk-widget-verse .v-en {
  font-family: var(--serif); font-style: italic;
  font-size: 17px; color: var(--ink-soft); line-height: 1.7;
}
.huk-widget-more {
  display: block; max-width: var(--maxw); margin: 0 auto;
  font-size: 15px; font-weight: 500;
  color: var(--gold); text-decoration: none;
}
.huk-widget-more:hover { text-decoration: underline; }

/* ============================================================
   SEHAJ PATH PROGRESS (homepage widget)
   ============================================================ */
.sehaj-section {
  background: var(--cream);
  padding: 44px 24px 52px;
  border-top: 1px solid var(--line);
}
.sehaj-inner { max-width: var(--maxw); margin: 0 auto; }
.sehaj-section .eyebrow { margin-bottom: 18px; }
.sehaj-track {
  height: 6px; background: var(--line);
  border-radius: 3px; overflow: hidden;
}
.sehaj-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--gold), var(--gold-soft));
  border-radius: 3px;
  transition: width .6s ease;
}
.sehaj-stat {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px;
}
.sehaj-text { font-size: 14px; color: var(--ink-soft); }
.sehaj-resume { font-size: 14px; font-weight: 500; color: var(--gold); text-decoration: none; }
.sehaj-resume:hover { text-decoration: underline; }

/* ============================================================
   BOOKMARKS PAGE
   ============================================================ */
.bk-empty {
  font-family: var(--serif); font-style: italic;
  font-size: 17px; color: var(--sand); margin-top: 4px; line-height: 1.7;
}
.bk-list { margin-top: 8px; }

/* export / import row */
.bk-io { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 16px 0 4px; }
.bk-io-btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--sans); font-size: 13px; font-weight: 500; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; cursor: pointer; transition: all .15s;
}
.bk-io-btn:hover { border-color: var(--gold); color: var(--gold); }
.bk-io-btn svg { width: 15px; height: 15px; }
.bk-io-status { font-family: var(--sans); font-size: 12.5px; color: var(--sand); }

/* language selector on the bookmarks page */
.bk-layers { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 16px; }

/* folder filter bar */
.bk-folders { margin: 0 0 6px; }
.bk-folder-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-folder-chip {
  font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; transition: all .15s;
}
.bk-folder-chip:hover { border-color: var(--gold); color: var(--gold); }
.bk-folder-chip.active { background: var(--gold); border-color: var(--gold); color: var(--night); }
.bk-folder-new {
  font-family: var(--sans); font-size: 13px; color: var(--gold);
  background: transparent; border: 1px dashed var(--gold-soft); border-radius: 999px;
  padding: 6px 14px; cursor: pointer; transition: background .15s;
}
.bk-folder-new:hover { background: rgba(205,163,73,.08); }
.bk-folder-tools { display: flex; gap: 14px; margin-top: 10px; }
.bk-folder-tool {
  font-family: var(--sans); font-size: 12px; color: var(--ink-soft);
  background: none; border: none; cursor: pointer; padding: 2px 0; text-decoration: underline;
}
.bk-folder-tool:hover { color: var(--gold); }
.bk-folder-tool.danger:hover { color: #b03020; }
.bk-folder-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bk-folder-input {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 12px; min-width: 160px;
}
.bk-folder-save, .bk-folder-cancel {
  font-family: var(--sans); font-size: 13px; cursor: pointer; border-radius: 8px;
  padding: 8px 14px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft);
}
.bk-folder-save { background: var(--gold); border-color: var(--gold); color: var(--night); font-weight: 600; }

/* cards */
.bk-card {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 20px 0; border-bottom: 1px solid var(--line);
}
.bk-card:first-child { border-top: 1px solid var(--line); }
.bk-card.dragging { opacity: .55; }
.bk-card-body { flex: 1; min-width: 0; }
.bk-drag {
  flex-shrink: 0; margin-top: 2px;
  display: grid; place-items: center; width: 28px; height: 28px;
  background: none; border: none; cursor: grab; color: var(--sand);
  touch-action: none; border-radius: 6px;
}
.bk-drag:hover { color: var(--gold); background: rgba(205,163,73,.08); }
.bk-drag:active { cursor: grabbing; }
.bk-drag svg { width: 18px; height: 18px; }
.bk-meta {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sand); margin-bottom: 12px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.bk-ang-link { color: var(--gold); text-decoration: none; font-weight: 600; }
.bk-ang-link:hover { text-decoration: underline; }
.bk-meta-sep { color: var(--line); }
.bk-line { margin-bottom: 7px; }
.bk-gur { font-family: var(--gur); font-size: clamp(18px, 3.5vw, 22px); color: var(--ink); line-height: 1.9; }
.bk-translit { font-family: var(--serif); font-style: italic; font-size: 14px; color: var(--ink-soft); line-height: 1.6; }
.bk-en { font-family: var(--serif); font-style: italic; font-size: 15px; color: var(--ink-soft); line-height: 1.65; }
.bk-hi { font-family: var(--deva); font-size: 15px; color: var(--ink-soft); line-height: 1.75; }
.bk-actions {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 12px; margin-top: 12px;
}
.bk-read { font-size: 13px; font-weight: 500; color: var(--gold); text-decoration: none; }
.bk-read:hover { text-decoration: underline; }
.bk-move { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; color: var(--sand); }
.bk-move-label { flex: none; }
.bk-foldertags { display: flex; flex-wrap: wrap; gap: 6px; }
/* a verse can belong to several folders — each is a toggle chip */
.bk-foldertag {
  font-family: var(--sans); font-size: 12px; color: var(--ink-soft);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 11px; cursor: pointer; transition: all .15s;
}
.bk-foldertag:hover { border-color: var(--gold); color: var(--gold); }
.bk-foldertag.on { background: var(--gold); border-color: var(--gold); color: var(--night, #1a1208); font-weight: 600; }
.bk-nofolders { font-size: 12px; color: var(--sand); font-style: italic; }
.bk-remove {
  background: none; border: none; cursor: pointer; padding: 4px 0;
  font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: var(--sand);
}
.bk-remove:hover { color: #b03020; }

/* compact cards (folder views): just the verse text until tapped */
.bk-compact .bk-card-body { position: relative; padding-right: 26px; }
.bk-compact .bk-verse { cursor: pointer; outline: none; }
.bk-compact .bk-verse:focus-visible { outline: 2px solid var(--gold-soft); outline-offset: 4px; border-radius: 4px; }
.bk-compact .bk-verse .bk-line:last-child { margin-bottom: 0; }
.bk-expand { position: absolute; top: 0; right: 0; color: var(--sand); transition: transform .2s ease; pointer-events: none; }
.bk-expand svg { width: 16px; height: 16px; }
.bk-compact.expanded .bk-expand { transform: rotate(180deg); }
.bk-compact .bk-details { display: none; margin-top: 14px; }
.bk-compact.expanded .bk-details { display: block; }

/* reader: "save to folder" chooser popup */
.bk-folder-pick {
  position: absolute; z-index: 60; max-width: min(86vw, 320px);
  padding: 10px 12px; background: var(--cream);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18);
  animation: vm-rise .15s ease-out both;
}
.bk-pick-label { display: block; font-size: 11px; letter-spacing: .04em; color: var(--ink-soft); margin-bottom: 8px; }
.bk-pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.bk-pick-btn {
  font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; cursor: pointer; transition: all .15s;
}
.bk-pick-btn:hover { border-color: var(--gold); color: var(--gold); }
.bk-pick-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night, #1a1208); font-weight: 600; }
.bk-pick-new { border-style: dashed; color: var(--gold); }
.bk-pick-foot { margin-top: 10px; display: flex; justify-content: flex-end; }
.bk-pick-save {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: .02em;
  color: var(--night, #1a1208); background: var(--gold); border: 1px solid var(--gold);
  border-radius: 999px; padding: 7px 18px; cursor: pointer; transition: filter .15s;
}
.bk-pick-save:hover { filter: brightness(1.06); }
.bk-new-form { display: flex; gap: 6px; }
.bk-new-input {
  font-family: var(--sans); font-size: 14px; color: var(--ink);
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 8px;
  padding: 7px 10px; min-width: 150px;
}

/* ============================================================
   CONTENTS / INDEX PAGE
   ============================================================ */
.toc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 6px; }
.toc-tab {
  font-family: var(--sans); font-size: 13px; color: var(--ink-soft);
  background: transparent; border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 16px; cursor: pointer; transition: all .15s;
}
.toc-tab:hover { border-color: var(--gold); color: var(--gold); }
.toc-tab.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

.toc-panel { margin-top: 8px; }
.toc-empty { font-family: var(--serif); font-style: italic; color: var(--sand); padding: 16px 0; }

.toc-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 2px; border-bottom: 1px solid var(--line);
  text-decoration: none; color: var(--ink); transition: background .12s;
}
.toc-row:hover { background: rgba(205,163,73,.06); }
.toc-row-name { font-family: var(--serif); font-size: 18px; }
.toc-row-meta { font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: var(--sand); white-space: nowrap; flex-shrink: 0; }

.toc-author { border-bottom: 1px solid var(--line); }
.toc-author-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  padding: 13px 2px; cursor: pointer; list-style: none;
}
.toc-author-head::-webkit-details-marker { display: none; }
.toc-author-head::after {
  content: "›"; margin-left: auto; color: var(--sand); font-size: 18px;
  transition: transform .2s; flex-shrink: 0;
}
.toc-author[open] .toc-author-head::after { transform: rotate(90deg); }
.toc-chips { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 2px 16px; }
.toc-chip {
  font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft);
  background: var(--cream-2); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 11px; text-decoration: none; transition: all .15s;
}
.toc-chip:hover { border-color: var(--gold); color: var(--gold); }
.toc-chip-ang { color: var(--gold); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
  .brand { font-size: 15px; }
  .controls { top: calc(53px + var(--off-h, 0px)); }
  .chat-bar { top: calc(53px + var(--off-h, 0px)); }
  .controls-inner { flex-direction: column; align-items: stretch; }
  .ang-nav { justify-content: space-between; }
  .layers, .larivaar-controls { justify-content: center; }
  .huk-widget-head { flex-direction: column; gap: 2px; }
}

/* ============================================================
   RELATED VERSES — reader overlay (semantic neighbours)
   ============================================================ */
.rel-overlay {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: flex-end; justify-content: center;
  background: rgba(0,0,0,.5); opacity: 0; pointer-events: none;
  transition: opacity .2s;
}
.rel-overlay.show { opacity: 1; pointer-events: auto; }
.rel-sheet {
  background: var(--cream); color: var(--ink);
  width: 100%; max-width: 680px; max-height: 85vh;
  border-radius: 18px 18px 0 0; display: flex; flex-direction: column;
  box-shadow: 0 -10px 40px rgba(0,0,0,.3);
  transform: translateY(18px); transition: transform .2s;
}
.rel-overlay.show .rel-sheet { transform: none; }
.rel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px 10px; border-bottom: 1px solid var(--line);
}
.rel-title { font-family: var(--serif); font-size: 19px; font-weight: 600; color: var(--ink); }
.rel-close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--sand); cursor: pointer; padding: 0 4px; }
.rel-source {
  margin: 0; padding: 12px 20px 0;
  font-family: var(--gur); font-size: 15px; color: var(--ink-soft); line-height: 1.5;
}
.rel-body { padding: 8px 14px 22px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.rel-status { padding: 34px 20px; text-align: center; color: var(--sand); font-family: var(--sans); font-size: 14px; }
.rel-card {
  display: block; text-decoration: none; color: inherit;
  padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  margin: 8px 0; transition: border-color .15s, background .15s;
}
.rel-card:hover { border-color: var(--gold); background: rgba(205,163,73,.05); }
.rel-meta { font-family: var(--sans); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--sand); margin-bottom: 5px; }
.rel-gur { font-family: var(--gur); font-size: 17px; color: var(--ink); margin: 0 0 4px; line-height: 1.5; }
.rel-en { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); margin: 0; line-height: 1.45; }

/* ============================================================
   BANIS — Nitnem & daily paaths
   ============================================================ */
/* reader, focused on a single bani: hide ang-to-ang chrome */
html[data-bani="1"] #prevAng,
html[data-bani="1"] #nextAng,
html[data-bani="1"] .ang-label,
html[data-bani="1"] #readerProgress { display: none; }
/* in a bani the centre isn't a raag/ToC jump — keep it as a passive, centred
   label (bani name / line count) so the prev/next buttons stay at the edges
   instead of bunching on the left */
html[data-bani="1"] .ln-ctx-chev { display: none; }
html[data-bani="1"] .line-nav-ctx { cursor: default; }
html[data-bani="1"] .line-nav-ctx:hover { background: none; }
/* larivaar & padched render the whole bani as one flowing page — there's no
   line-by-line stepping, so the bottom nav bar isn't needed at all */
html[data-bani="1"][data-read-mode="larivaar"] .line-nav,
html[data-bani="1"][data-read-mode="padched"]  .line-nav { display: none; }
.bani-back { font-family: var(--sans); font-size: 13px; color: var(--gold); text-decoration: none; }
.bani-back:hover { text-decoration: underline; }
.verse.verse-header { text-align: center; opacity: .9; }
.verse.verse-header .v-gur { color: var(--gold); }

/* selector page */
.bani-group { margin: 26px 0; }
.bani-grp-title {
  font-family: var(--sans); font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--sand); margin: 0 0 12px;
}
.bani-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.bani-card {
  display: flex; flex-direction: column; gap: 4px;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; color: inherit; background: var(--cream-2, transparent);
  transition: border-color .15s, transform .15s;
}
.bani-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.bani-card-gur { font-family: var(--gur); font-size: 20px; color: var(--ink); }
.bani-card-en  { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }

/* concordance: the tapped line's words as chips, above the occurrence list */
.conc-words {
  display: flex; flex-wrap: wrap; gap: 7px;
  padding: 12px 20px 4px; border-bottom: 1px solid var(--line);
}
.conc-chip {
  font-family: var(--gur); font-size: 16px;
  background: none; border: 1px solid var(--line); border-radius: 999px;
  padding: 4px 12px; cursor: pointer; color: var(--ink-soft); transition: all .15s;
}
.conc-chip:hover { border-color: var(--gold); color: var(--gold); }
.conc-chip.active { background: var(--gold); border-color: var(--gold); color: var(--night, #1a1208); }
.conc-count {
  padding: 12px 6px 4px; margin: 0;
  font-family: var(--sans); font-size: 12px; letter-spacing: .04em; color: var(--sand);
}

/* Contents → Themes (explore by subject) */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 6px; }
.theme-card {
  display: flex; flex-direction: column; gap: 4px; text-align: left;
  padding: 16px 18px; border: 1px solid var(--line); border-radius: 14px;
  background: var(--cream-2, transparent); color: inherit; cursor: pointer;
  transition: border-color .15s, transform .15s;
}
.theme-card:hover { border-color: var(--gold); transform: translateY(-1px); }
.theme-card-name { font-family: var(--serif); font-size: 18px; color: var(--ink); }
.theme-card-meta { font-family: var(--sans); font-size: 12px; color: var(--sand); }
.theme-back {
  background: none; border: none; cursor: pointer; padding: 4px 0; margin-bottom: 4px;
  font-family: var(--sans); font-size: 14px; color: var(--gold);
}
.theme-head { font-family: var(--serif); font-weight: 600; font-size: 22px; color: var(--ink); margin: 4px 0 2px; }
.theme-note { font-family: var(--sans); font-size: 13px; color: var(--sand); margin: 0 0 16px; }

/* Guided journey — a focused, full-screen paced reading */
.journey-start {
  display: inline-block; margin: 0 0 18px; padding: 10px 18px; border-radius: 999px;
  border: 1px solid var(--gold); background: rgba(205,163,73,.08); color: var(--gold);
  font-family: var(--sans); font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s;
}
.journey-start:hover { background: var(--gold); color: var(--night, #1a1208); }
.journey-overlay { position: fixed; inset: 0; z-index: 200; display: none; background: var(--cream); }
.journey-overlay.show { display: flex; }
.journey-card { margin: auto; width: 100%; max-width: 640px; height: 100%; display: flex; flex-direction: column; padding: 16px 22px 22px; box-sizing: border-box; }
.journey-top { display: flex; align-items: center; justify-content: space-between; }
.journey-step { font-family: var(--sans); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--sand); }
.journey-close { background: none; border: none; font-size: 26px; line-height: 1; color: var(--sand); cursor: pointer; }
.journey-bar { height: 3px; background: var(--line); border-radius: 3px; margin-top: 10px; overflow: hidden; }
.journey-bar-fill { height: 100%; width: 0; background: var(--gold); transition: width .3s ease; }
.journey-stage { flex: 1; display: flex; align-items: center; justify-content: center; overflow-y: auto; padding: 14px 0; }
.journey-intro, .journey-verse { text-align: center; max-width: 40ch; }
.journey-ek { font-family: var(--gur); color: var(--gold); font-size: 40px; margin-bottom: 14px; }
.journey-title { font-family: var(--serif); font-weight: 600; font-size: 26px; color: var(--ink); margin: 0 0 12px; }
.journey-introtext { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); line-height: 1.7; max-width: 36ch; margin: 0 auto; }
.journey-gur { font-family: var(--gur); font-size: clamp(22px, 6vw, 30px); color: var(--ink); line-height: 1.75; margin: 0 0 18px; }
.journey-en { font-family: var(--sans); font-size: 16px; color: var(--ink-soft); line-height: 1.6; margin: 0 0 18px; }
.journey-context { font-family: var(--sans); font-size: 13px; color: var(--gold); text-decoration: none; }
.journey-context:hover { text-decoration: underline; }
.journey-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 10px; }
.journey-btn { font-family: var(--sans); font-size: 15px; font-weight: 600; padding: 12px 26px; border-radius: 999px; border: none; cursor: pointer; background: var(--gold); color: var(--night, #1a1208); }
.journey-btn.ghost { background: none; border: 1px solid var(--line); color: var(--ink-soft); padding: 12px 20px; }

/* padchhed — word-by-word meanings list */
.pad-list { display: flex; flex-direction: column; gap: 2px; padding: 4px 0; }
.pad-row { display: flex; gap: 10px; padding: 9px 4px; border-bottom: 1px solid var(--line); align-items: baseline; }
.pad-row:last-child { border-bottom: none; }
.pad-w { font-family: var(--gur); font-size: 16px; color: var(--gold); flex: 0 0 38%; max-width: 38%; }
.pad-m { font-family: var(--gur); font-size: 15px; color: var(--ink-soft); flex: 1; line-height: 1.5; }
.pad-note { font-family: var(--gur); font-size: 14px; color: var(--sand); padding: 6px 4px; line-height: 1.5; }
.pad-credit { font-family: var(--sans); font-size: 11px; color: var(--sand); margin: 14px 4px 4px; font-style: italic; }

/* expandable nav group (Contents → Sections / Themes / Raags / Authors) */
.menu-grouphead {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; padding: 13px 20px; background: none; border: none;
  border-bottom: 1px solid rgba(255,255,255,.06);
  font-family: var(--sans); font-size: 13px; letter-spacing: .08em; text-transform: uppercase;
  color: rgba(246,241,231,.68); cursor: pointer; text-align: left;
}
.menu-grouphead:hover { color: var(--gold-soft); background: rgba(255,255,255,.04); }
.menu-grouphead[aria-current="page"] { color: var(--gold-soft); }
.menu-chev { transition: transform .18s ease; font-size: 16px; opacity: .65; }
.menu-group.open .menu-chev { transform: rotate(90deg); }
.menu-sub { display: none; background: rgba(0,0,0,.18); }
.menu-group.open .menu-sub { display: block; }
.menu-sublink {
  display: block; padding: 11px 20px 11px 34px;
  font-family: var(--sans); font-size: 12px; letter-spacing: .06em; text-transform: uppercase;
  color: rgba(246,241,231,.6); text-decoration: none;
  border-bottom: 1px solid rgba(255,255,255,.05);
}
.menu-sublink:last-child { border-bottom: none; }
.menu-sublink:hover { color: var(--gold-soft); background: rgba(255,255,255,.04); }
.menu-group { flex-shrink: 0; }

/* Sehaj Paath mode banner (sehaj.html only) — a quiet label above the progress ribbon */
.sehaj-modebar { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 2px 0 6px; padding: 0 2px; }
.sehaj-modetag { font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--gold, #b8860b); }
.sehaj-modehint { font-size: .74rem; color: var(--sand); }
@media (max-width: 520px) { .sehaj-modehint { display: none; } }

/* ============================================================
   Homepage Hukamnama scrolling banner — a single looping marquee
   line below the hero; tap to open the full Hukamnama.
   ============================================================ */
.huk-marquee {
  display: flex; align-items: center; overflow: hidden; white-space: nowrap;
  position: relative; z-index: 5;
  /* the hero strip is dark in every theme, so use fixed light text (not the
     theme color vars, which flip dark in dark/OLED mode) */
  background: rgba(9,13,34,.42); color: #f6f1e7;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-top: 1px solid rgba(205,163,73,.22);
  border-bottom: 1px solid rgba(205,163,73,.28);
  padding: 8px 0; cursor: pointer; text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.huk-marquee:hover { background: rgba(18,26,62,.55); }
/* fixed label, stays put while the text scrolls past on the right */
.hm-fixed {
  flex: 0 0 auto; align-self: stretch; display: flex; align-items: center;
  font-family: var(--sans); font-weight: 700; font-size: .9rem; letter-spacing: .02em;
  color: #e7c977; padding: 0 14px 0 24px;
  border-right: 1px solid rgba(205,163,73,.3);
}
/* the scrolling viewport (clips the moving track) */
.hm-scroll { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.huk-marquee-track {
  display: flex; width: max-content; will-change: transform;
  animation: huk-scroll 60s linear infinite;
}
.huk-marquee:hover .huk-marquee-track { animation-play-state: paused; }
@keyframes huk-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
/* padding-left lives on the segment (not the track) so each repeated copy is
   identical and the -50% loop stays seamless */
.hm-seg { display: inline-flex; align-items: baseline; gap: 18px; white-space: nowrap; padding-left: 18px; }
.hm-date { font-family: var(--sans); font-weight: 600; font-size: .9rem; color: #e7c977; }
.hm-gur { font-family: var(--gur); font-size: 1.12rem; color: #f6f1e7; }
.hm-tl  { font-family: var(--sans); font-size: .95rem; color: #e7c977; }
.hm-en  { font-family: var(--serif); font-style: italic; font-size: 1rem; color: #cdbfa3; }
.hm-gap { color: rgba(205,163,73,.55); }
@media (prefers-reduced-motion: reduce) {
  .huk-marquee-track { animation: none; }
}

/* ============================================================
   Reminders page (reminders.html)
   ============================================================ */
.page-wrap { max-width: 680px; margin: 0 auto; padding: 28px 20px 80px; }
.page-title { font-family: var(--serif); font-size: clamp(28px, 6vw, 40px); color: var(--ink); margin: 0 0 6px; }
.page-sub { font-family: var(--sans); font-size: 14px; color: var(--ink-soft); margin: 0 0 22px; }

.rem-gate { text-align: center; padding: 30px 16px; }
.rem-gate-msg { font-family: var(--sans); font-size: 15px; color: var(--ink-soft); margin: 0 0 16px; line-height: 1.5; }

.rem-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 16px; margin-bottom: 18px; }
[data-theme="dark"] .rem-card, [data-theme="oled"] .rem-card { background: rgba(255,255,255,.03); }
.rem-card-title { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 14px 0 4px; }

.rem-row { display: flex; align-items: center; gap: 14px; padding: 14px 4px; }
.rem-switch { cursor: pointer; border-bottom: 1px solid var(--line); }
.rem-card .rem-switch:last-of-type { border-bottom: none; }
.rem-row-main { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.rem-row-name { font-family: var(--sans); font-size: 15px; font-weight: 600; color: var(--ink); }
.rem-row-hint { font-family: var(--sans); font-size: 12.5px; color: var(--ink-soft); line-height: 1.4; }
.rem-check { width: 44px; height: 26px; appearance: none; -webkit-appearance: none; border-radius: 999px; background: var(--line); position: relative; cursor: pointer; flex-shrink: 0; transition: background .18s; }
.rem-check::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.rem-check:checked { background: var(--gold); }
.rem-check:checked::after { transform: translateX(18px); }

.rem-list { display: flex; flex-direction: column; gap: 12px; margin: 10px 0 14px; }
.rem-empty { font-family: var(--sans); font-size: 13.5px; color: var(--ink-soft); margin: 10px 0 14px; }
.rem-item { border: 1px solid var(--line); border-radius: 8px; padding: 12px; }
.rem-item-top { display: flex; align-items: center; gap: 8px; }
.rem-bani { flex: 1; min-width: 0; font-family: var(--sans); font-size: 14px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
.rem-time { font-family: var(--sans); font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
[data-theme="dark"] .rem-bani, [data-theme="oled"] .rem-bani,
[data-theme="dark"] .rem-time, [data-theme="oled"] .rem-time { background: rgba(255,255,255,.06); color: var(--ink); }
[data-theme="dark"] .rem-bani option, [data-theme="oled"] .rem-bani option { background: #161e44; color: var(--ink); }
.rem-del { flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 6px; background: none; color: var(--ink-soft); font-size: 20px; line-height: 1; cursor: pointer; }
.rem-del:hover { border-color: #c0392b; color: #c0392b; }
.rem-days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rem-day { min-width: 38px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 999px; background: none; font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink-soft); cursor: pointer; transition: all .14s; }
.rem-day.on { background: var(--gold); border-color: var(--gold); color: var(--night); }

.rem-add { margin-top: 4px; padding: 10px 16px; border: 1px dashed var(--line); border-radius: 8px; background: none; font-family: var(--sans); font-size: 14px; font-weight: 600; color: var(--gold); cursor: pointer; width: 100%; }
.rem-add:hover { border-color: var(--gold); background: rgba(205,163,73,.05); }

.rem-actions { display: flex; align-items: center; gap: 14px; margin: 20px 0 8px; }
.rem-saved { font-family: var(--sans); font-size: 13px; color: var(--ink-soft); }
.rem-off { display: block; margin: 18px auto 0; padding: 8px 14px; border: none; background: none; font-family: var(--sans); font-size: 13px; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.rem-off:hover { color: #c0392b; }

/* ============================================================
   Settings page (settings.html)
   ============================================================ */
.settings-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px 14px; margin-bottom: 18px; }
[data-theme="dark"] .settings-card, [data-theme="oled"] .settings-card { background: rgba(255,255,255,.03); }
/* neutralise the dark-menu styling on the reused Language/Theme/Text/Read-aloud rows */
.settings-rows { border: none !important; padding: 0 !important; margin: 0 !important; }
.settings-rows .menu-lang-row,
.settings-rows .menu-theme-row,
.settings-rows .menu-size-row,
.settings-rows .menu-speech-row { color: var(--ink-soft); border-bottom: 1px solid var(--line); }
.settings-rows > :last-child { border-bottom: none; }
.settings-rows .lang-btn, .settings-rows .theme-btn,
.settings-rows .size-btn, .settings-rows .speed-btn { color: var(--ink-soft); border-color: var(--line); }
.settings-rows .lang-btn.active, .settings-rows .theme-btn.active,
.settings-rows .size-btn.active, .settings-rows .speed-btn.active { background: var(--gold); border-color: var(--gold); color: var(--night); }

.settings-links { padding: 0 14px; }
.settings-link { display: block; padding: 15px 4px; font-family: var(--sans); font-size: 15px; font-weight: 600;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); cursor: pointer; }
.settings-links .settings-link:last-child { border-bottom: none; }
.settings-link:hover { color: var(--gold); }

/* ============================================================
   Site notice — a dismissible banner set from the admin page,
   shown at the very top of every page (announcements, greetings).
   ============================================================ */
.site-notice {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; text-decoration: none;
  background: linear-gradient(90deg, rgba(205,163,73,.16), rgba(231,201,119,.10));
  border-bottom: 1px solid rgba(205,163,73,.4);
  color: var(--ink); font-family: var(--sans); font-size: 14px;
}
.site-notice-ek { color: var(--gold); font-size: 17px; flex-shrink: 0; }
.site-notice-text { flex: 1; line-height: 1.4; }
.site-notice-x {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  color: var(--ink-soft); font-size: 22px; line-height: 1; padding: 0 4px;
}
.site-notice-x:hover { color: var(--ink); }
