:root {
  /* Traditional palette: kumkum maroon, turmeric gold, sandal paper */
  --bg: #f8eedb;
  --card: #fffaf0;
  --ink: #3a1f12;
  --muted: #7d5a43;
  --accent: #8e1b1b;
  --accent-soft: #f6e3c8;
  --line: #e2c99a;
  --gold: #c8962b;
  --gold-soft: #ecd59a;
  --maroon: #6e1414;
  --fs: 20px;
  --te: "Noto Serif Telugu", "Tiro Telugu", "Noto Sans Telugu", "Noto Sans Devanagari", "Noto Sans Kannada", "Noto Sans Tamil", "Telugu Sangam MN", "Kohinoor Devanagari", "Kannada Sangam MN", "Tamil Sangam MN", "Gautami", "Nirmala UI", serif;
  --en: "Noto Serif", Georgia, serif;
  --head: "Tiro Telugu", "Noto Serif", Georgia, serif;
}
:root.dark {
  --bg: #1a0d0b;
  --card: #261512;
  --ink: #f4e6cf;
  --muted: #c4a888;
  --accent: #e8b04a;
  --accent-soft: #3a1f17;
  --line: #4a2c1f;
  --gold: #d9a93c;
  --gold-soft: #6b4a22;
  --maroon: #3a0d0d;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--en); line-height: 1.55;
}
a { color: var(--accent); text-decoration: none; }

.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .8rem 1.2rem; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
}
.brand { font-weight: 700; font-size: 1.25rem; color: var(--ink); }
.om { color: var(--accent); font-family: var(--te); }
.topbar nav { display: flex; gap: 1rem; }
.topbar nav a { color: var(--ink); padding: .3rem .5rem; border-radius: 6px; }
.topbar nav a.active { background: var(--accent-soft); color: var(--accent); }

.toolbar {
  display: flex; gap: .8rem; align-items: center; flex-wrap: wrap;
  padding: .6rem 1.2rem; border-bottom: 1px solid var(--line); font-size: .9rem;
}
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button, .ghost {
  border: 0; background: var(--card); color: var(--ink); padding: .4rem .7rem; cursor: pointer; font: inherit;
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--accent); color: #fff; }
.ghost { border: 1px solid var(--line); border-radius: 8px; }
.check { display: inline-flex; gap: .3rem; align-items: center; cursor: pointer; }

main { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.2rem 4rem; }
h1 { font-size: 1.7rem; margin: .2rem 0 .4rem; }
h1 .te { font-family: var(--te); display: block; font-size: 1.3rem; color: var(--accent); font-weight: 600; }
.sub { color: var(--muted); margin: 0 0 1.4rem; }

.hero { text-align: center; padding: 2rem 0 1rem; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.tile {
  display: block; background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1.1rem; color: var(--ink);
}
.tile:hover { border-color: var(--accent); }
.tile b { display: block; font-size: 1.1rem; margin-bottom: .2rem; }
.tile span { color: var(--muted); font-size: .92rem; }

.filters { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1rem; }
.filters input {
  flex: 1 1 240px; padding: .6rem .8rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--card); color: var(--ink); font: inherit;
}
.chip {
  border: 1px solid var(--line); background: var(--card); color: var(--ink);
  border-radius: 999px; padding: .3rem .8rem; cursor: pointer; font: inherit; font-size: .9rem;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.list { display: grid; gap: .6rem; }
.row {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .8rem 1rem; color: var(--ink);
}
.row:hover { border-color: var(--accent); }
.row .t { font-weight: 600; }
.row .tt { font-family: var(--te); color: var(--accent); font-size: .95rem; }
.row .meta { color: var(--muted); font-size: .85rem; white-space: nowrap; }

.verse {
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 1rem 1.2rem; margin-bottom: .8rem; position: relative;
}
.verse .n { position: absolute; top: .5rem; right: .8rem; color: var(--muted); font-size: .8rem; }
.verse .te { font-family: var(--te); font-size: calc(var(--fs) * 1.1); line-height: 1.9; white-space: pre-line; }
.verse .en { font-family: var(--en); font-size: var(--fs); line-height: 1.7; white-space: pre-line; color: var(--ink); }
.verse .te + .en { margin-top: .5rem; color: var(--muted); font-style: italic; font-size: calc(var(--fs) * .9); }
.script-en .verse .te + .en { margin-top: 0; color: var(--ink); font-style: normal; font-size: var(--fs); }
.verse .meaning { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); color: var(--muted); font-size: .95rem; }
.hide-meaning .meaning { display: none; }
.script-te .en, .script-en .te { display: none; }
.verse.heading { background: transparent; border: 0; padding: .4rem 0; }
.verse.heading .te, .verse.heading .en { font-weight: 600; color: var(--accent); font-size: 1rem; }

.actions { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.btn {
  border: 1px solid var(--accent); background: var(--accent); color: #fff; border-radius: 8px;
  padding: .5rem 1rem; cursor: pointer; font: inherit;
}
.btn.outline { background: transparent; color: var(--accent); }

/* Daily pooja */
.deity-pick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1.2rem; }
.steps { counter-reset: step; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: 12px; margin-bottom: 1rem; overflow: hidden; }
.step > header { display: flex; gap: .8rem; align-items: baseline; padding: .9rem 1.2rem; cursor: pointer; }
.step > header::before {
  counter-increment: step; content: counter(step);
  background: var(--accent); color: #fff; border-radius: 50%; min-width: 1.8rem; height: 1.8rem;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .9rem;
}
.step h3 { margin: 0; font-size: 1.1rem; }
.step h3 .te { font-family: var(--te); color: var(--accent); font-weight: 600; margin-left: .4rem; }
.step .body { padding: 0 1.2rem 1rem; }
.step .how { color: var(--muted); margin: 0 0 .8rem; }
.step .verse { border-style: dashed; }
.step.done { opacity: .55; }
.step.done > header::before { content: "✓"; }
.progress { height: 6px; background: var(--line); border-radius: 3px; margin-bottom: 1.2rem; overflow: hidden; }
.progress div { height: 100%; background: var(--accent); transition: width .3s; }

.note { background: var(--accent-soft); border-radius: 10px; padding: .8rem 1rem; font-size: .92rem; margin-bottom: 1.2rem; }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 2rem 1rem; border-top: 1px solid var(--line); }
.empty { color: var(--muted); text-align: center; padding: 2rem; }

@media (max-width: 600px) {
  .topbar nav { gap: .3rem; font-size: .92rem; }
  }

/* Festivals */
h2 { font-size: 1.2rem; margin: 1.6rem 0 .6rem; }
.when { margin: 0 0 .4rem; }
.bul { padding-left: 1.2rem; margin: 0 0 1rem; }
.bul li { margin-bottom: .3rem; }
.items { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .4rem .8rem; margin-bottom: 1rem; }
.badge { display: inline-block; margin-left: .5rem; padding: .05rem .5rem; border-radius: 999px; background: var(--accent); color: #fff; font-size: .7rem; font-weight: 600; vertical-align: middle; }
.step.special { border-color: var(--accent); border-width: 2px; }
.step .para { margin: 0 0 .8rem; line-height: 1.65; }
.step .te-p { font-family: var(--te); font-size: 1.05rem; line-height: 1.9; }
.script-te .en-p, .script-en .te-p { display: none; }
.te-p + .en-p { margin-top: 1.4rem; padding-top: 1rem; border-top: 1px dashed var(--line); }

/* Panchangam */
.te-i { font-family: var(--te); }
.script-both .te-i + .en-i::before { content: " · "; }
.script-te .en-i, .script-en .te-i { display: none; }
.pan-strip { display: block; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: .8rem 1rem; color: var(--ink); margin: .5rem 0 1rem; }
.pan-strip:hover { border-color: var(--accent); }
.pan-strip .sub { margin: .3rem 0 0; font-size: .85rem; }
.pan { background: var(--card); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 1rem; }
.pr { display: grid; grid-template-columns: minmax(150px, 38%) 1fr; gap: 1rem; padding: .65rem 1rem; border-bottom: 1px solid var(--line); }
.pr:last-child { border-bottom: 0; }
.pl { color: var(--muted); font-size: .9rem; }
.pv { font-weight: 600; }
.till { font-weight: 400; color: var(--muted); font-size: .88rem; margin-left: .3rem; }
.city select, .actions input[type=date] { font: inherit; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
.city { display: inline-flex; align-items: center; gap: .3rem; }
.actions { align-items: center; }
a.btn { display: inline-block; }
.soon { color: var(--accent); font-weight: 600; }
.row .meta { text-align: right; }
@media (max-width: 600px) { .pr { grid-template-columns: 1fr; gap: .1rem; } }

/* Month calendar */
h2 .small, h2 .masas { font-size: .85rem; font-weight: 400; margin-left: .5rem; }
h2 .masas { color: var(--accent); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 1rem; }
.cal-h { text-align: center; font-size: .75rem; color: var(--muted); padding: .3rem 0; }
.cal-h .te-i + .en-i::before { content: none; }
.cal-h .en-i { display: block; }
.script-both .cal-h .te-i { display: none; }
.cal-d { display: flex; flex-direction: column; gap: 2px; min-height: 92px; padding: .35rem; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink); overflow: hidden; }
.cal-d:hover { border-color: var(--accent); }
.cal-d.today { border: 2px solid var(--accent); }
.cal-d .dn { font-weight: 700; }
.cal-d .ct, .row .ct { font-size: .7rem; color: var(--muted); line-height: 1.3; }
.script-both .cal-d .ct .en-i { display: none; }
.script-both .cal-d .ct .te-i + .en-i::before { content: none; }
.ev { display: block; font-size: .66rem; line-height: 1.25; padding: 1px 4px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev .te-i + .en-i::before { content: none; }
.script-both .ev .te-i { display: none; }
.ev.fest { background: var(--accent); color: #fff; font-weight: 600; }
.ev.pournami { background: #fff3c4; color: #7a5b00; }
.ev.amavasya { background: #e4e0f5; color: #3d2f7a; }
.ev.sank { background: #ffe1cc; color: #9a3d00; }
:root.dark .ev.pournami { background: #4a3c00; color: #ffe27a; }
:root.dark .ev.amavasya { background: #2c2550; color: #cfc6ff; }
:root.dark .ev.sank { background: #4d2600; color: #ffc08a; }
.meta.evs { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 55%; }
.meta.evs .ev { display: inline-block; font-size: .75rem; }
@media (max-width: 600px) {
  .cal { gap: 2px; }
  .cal-d { min-height: 64px; padding: .2rem; }
  .cal-d .ct { display: none; }
  .ev { font-size: 0; height: 6px; padding: 0; }
}

/* Location form */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .8rem; margin-bottom: 1rem; }
.form label { display: flex; flex-direction: column; gap: .3rem; font-size: .9rem; color: var(--muted); }
.form input, .form select { font: inherit; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); }
#indic { padding: .4rem .5rem; font: inherit; color: var(--ink); }

/* Audio and read-aloud */
.audio { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .6rem 1rem; margin-bottom: 1rem; }
.audio audio { flex: 1; min-width: 240px; }
.verse.reading { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.foot .btn { margin-top: .8rem; }

/* Mantram of the day */
.mantram .verse { border: 2px solid var(--accent); background: linear-gradient(180deg, var(--accent-soft), var(--card) 60%); }
.big-verse .verse .te { font-size: calc(var(--fs) * 1.3); }
.big-verse .verse .en { font-size: calc(var(--fs) * 1.05); }
.japa { display: flex; gap: 1.5rem; align-items: center; flex-wrap: wrap; margin-bottom: 2rem; }
.japa-btn { width: 150px; height: 150px; border-radius: 50%; border: 4px solid var(--accent); background: var(--card); color: var(--accent);
  font: inherit; font-size: 2.6rem; font-weight: 700; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center;
  user-select: none; -webkit-tap-highlight-color: transparent; transition: transform .08s; }
.japa-btn:active { transform: scale(.95); background: var(--accent-soft); }
.japa-btn small { font-size: .75rem; font-weight: 400; color: var(--muted); }
.japa-side { flex: 1; min-width: 200px; }
.japa-bar { height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; margin-bottom: .5rem; }
.japa-bar div { height: 100%; background: var(--accent); transition: width .2s; }

/* Detailed panchangam */
.glance { display: flex; gap: 1.2rem; align-items: center; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.moon { width: 84px; height: 84px; flex: none; }
.glance .g1 { font-size: 1.15rem; font-weight: 700; }
.glance .g2 { margin-top: .25rem; }
.glance .g3 { margin-top: .4rem; color: var(--muted); font-size: .92rem; }
.why { color: var(--muted); font-size: .82rem; font-weight: 400; margin-top: .3rem; line-height: 1.45; }
.guide li { margin-bottom: .45rem; }
b.good, .good > b { color: #2e7d32; } b.bad { color: #c62828; } b.mixed { color: #b26a00; }
:root.dark b.good { color: #81c784; } :root.dark b.bad { color: #ef9a9a; } :root.dark b.mixed { color: #ffcc80; }

.tl { --tl-l: 64px; position: relative; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .8rem .8rem 1.8rem; margin-bottom: 1rem; }
.tl-row { display: grid; grid-template-columns: var(--tl-l) 1fr; align-items: center; margin-bottom: 6px; }
.tl-l { font-size: .75rem; color: var(--muted); }
.tl-b { position: relative; height: 26px; background: var(--bg); border-radius: 6px; overflow: hidden; }
.tseg { position: absolute; top: 0; bottom: 0; display: flex; align-items: center; justify-content: center; font-size: .68rem; overflow: hidden; white-space: nowrap; border-right: 1px solid var(--card); cursor: default; }
.tseg span { padding: 0 3px; overflow: hidden; text-overflow: ellipsis; }
.tseg.day { background: #ffe9b3; color: #7a5b00; } .tseg.night { background: #2d2a3e; color: #d9d4f2; }
.tseg.alt0 { background: var(--accent-soft); color: var(--accent); } .tseg.alt1 { background: #e8e2f7; color: #4a3a8a; }
.tseg.good { background: #c8e6c9; color: #1b5e20; } .tseg.good2 { background: #e3f2e4; color: #2e7d32; }
.tseg.bad { background: #ffcdd2; color: #b71c1c; } .tseg.bad2 { background: #ffe0e3; color: #c62828; }
:root.dark .tseg.day { background: #5a4a1a; color: #ffe9b3; } :root.dark .tseg.alt1 { background: #332a55; color: #d9d4f2; }
:root.dark .tseg.good { background: #1f4d22; color: #c8e6c9; } :root.dark .tseg.good2 { background: #183b1b; color: #a5d6a7; }
:root.dark .tseg.bad { background: #5c1e1e; color: #ffcdd2; } :root.dark .tseg.bad2 { background: #4a1a1a; color: #ffcdd2; }
.tl-now { position: absolute; top: .5rem; bottom: 1.5rem; width: 2px; background: var(--accent); opacity: .5; pointer-events: none; }
.tl-now span { position: absolute; top: -2px; left: 4px; font-size: .65rem; color: var(--accent); font-weight: 700; }
.tl-ticks { position: absolute; left: calc(.8rem + var(--tl-l)); right: .8rem; bottom: .4rem; height: 1rem; }
.tl-ticks span { position: absolute; transform: translateX(-50%); font-size: .62rem; color: var(--muted); white-space: nowrap; }
.tl-ticks span:first-child { transform: none; } .tl-ticks span:last-child { transform: translateX(-100%); }

details.more { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem 1rem; margin-bottom: .8rem; }
details.more summary { cursor: pointer; font-weight: 600; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .4rem; margin-top: .5rem; }
.hr { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .6rem; border-radius: 8px; background: var(--bg); font-size: .85rem; }
.hr.nt { background: var(--accent-soft); }
.hr.now { outline: 2px solid var(--accent); }
.hr.good b { color: #2e7d32; } .hr.bad b { color: #c62828; }
:root.dark .hr.good b { color: #81c784; } :root.dark .hr.bad b { color: #ef9a9a; }
@media (max-width: 600px) { .tl { --tl-l: 44px; } .tseg { font-size: .58rem; } .glance { flex-direction: column; text-align: center; } }

/* Interactive timeline */
.tl-ctrl { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: .6rem; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chips .chip { font-size: .8rem; padding: .25rem .65rem; }
.tl { cursor: crosshair; touch-action: pan-y; user-select: none; -webkit-user-select: none; outline: none; }
.tl:focus-visible { box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent); }
.tseg.sel { outline: 2px solid var(--ink); outline-offset: -2px; z-index: 1; }
.tl-cursor { position: absolute; top: .3rem; bottom: 1.4rem; width: 2px; margin-left: -1px; background: var(--ink); pointer-events: none; z-index: 2; }
.tl-cursor span { position: absolute; top: -.15rem; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .65rem; font-weight: 700; padding: 0 .35rem; border-radius: 4px; white-space: nowrap; }
.tl-panel { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 12px; padding: .8rem 1rem; margin-bottom: .8rem; min-height: 9rem; }
.tp-time { font-size: 1.3rem; font-weight: 700; }
.tl-panel .v { display: block; margin: .3rem 0 .6rem; font-weight: 600; }
.tl-panel .v.good { color: #2e7d32; } .tl-panel .v.bad { color: #c62828; }
:root.dark .tl-panel .v.good { color: #81c784; } :root.dark .tl-panel .v.bad { color: #ef9a9a; }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: .2rem 1rem; font-size: .9rem; }
.tp-grid > div { display: grid; grid-template-columns: 6.2rem 1fr; gap: .4rem; align-items: baseline; padding: .15rem 0; }
.tp-grid .k { color: var(--muted); font-size: .8rem; }
.tp-grid .till { display: block; margin-left: 0; }
.tl-panel .v.warn { color: #b26a00; } :root.dark .tl-panel .v.warn { color: #ffcc80; }
.tp-sel { margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .92rem; }
.best { margin-bottom: 1rem; }
.best .chips { margin-top: .4rem; }
.best .chip { background: #e3f2e4; border-color: #a5d6a7; color: #1b5e20; }
:root.dark .best .chip { background: #183b1b; border-color: #2e7d32; color: #c8e6c9; }
.step .para-h { margin: 1.2rem 0 .5rem; color: var(--accent); font-size: 1.05rem; }
.step .para-h.te-p { font-family: var(--te); }
.step .para-h.en-p:first-of-type, .te-p + .para-h.en-p { margin-top: 1.4rem; }

/* ===================== Traditional theme ===================== */
body {
  background-color: var(--bg);
  background-image: radial-gradient(circle at 1px 1px, rgba(200, 150, 43, .10) 1px, transparent 0);
  background-size: 22px 22px;
}
:root.dark body { background-image: radial-gradient(circle at 1px 1px, rgba(217, 169, 60, .07) 1px, transparent 0); }
h1, h2, h3, .brand, .tile b, .tp-time, .g1 { font-family: var(--head); font-weight: 400; letter-spacing: .01em; }
h1 { font-size: 2rem; color: var(--maroon); }
:root.dark h1 { color: var(--gold); }
h1 .te { color: var(--gold); font-family: var(--head); font-weight: 400; }
:root.dark h1 .te { color: var(--ink); }
h2 { color: var(--maroon); font-size: 1.35rem; }
:root.dark h2 { color: var(--gold); }
h2::after {
  content: ""; display: block; width: 140px; height: 12px; margin-top: .35rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='12'%3E%3Cpath d='M0 6h56M84 6h56' stroke='%23c8962b' stroke-width='1.2'/%3E%3Cpath d='M70 1l5 5-5 5-5-5z' fill='%23c8962b'/%3E%3Ccircle cx='60' cy='6' r='1.6' fill='%23c8962b'/%3E%3Ccircle cx='80' cy='6' r='1.6' fill='%23c8962b'/%3E%3C/svg%3E") no-repeat;
}
.hero h1::after, .gita h2::after { margin-left: auto; margin-right: auto; }

/* Header: maroon band with gold lettering and a temple-border fringe */
.topbar {
  background: linear-gradient(180deg, #7d1717, var(--maroon)); border-bottom: 2px solid var(--gold);
  box-shadow: 0 2px 0 #f3d98f inset;
}
:root.dark .topbar { background: linear-gradient(180deg, #4a1010, var(--maroon)); }
.topbar::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -12px; height: 12px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 0h24v1a12 11 0 0 1-12 11A12 11 0 0 1 0 1z' fill='%236e1414'/%3E%3Ccircle cx='12' cy='5' r='2' fill='%23c8962b'/%3E%3C/svg%3E") repeat-x;
}
:root.dark .topbar::after { filter: brightness(.6); }
.brand { color: #f3d98f; font-size: 1.45rem; text-shadow: 0 1px 0 rgba(0,0,0,.3); }
.topbar nav a { color: #f8e7c8; }
.topbar nav a:hover { color: #fff; }
.topbar nav a.active { background: var(--gold); color: var(--maroon); }
.toolbar { background: var(--accent-soft); border-bottom: 1px solid var(--line); padding-top: 1.1rem; }

/* Buttons and chips */
.btn { background: var(--maroon); border-color: var(--gold); color: #fff3d6; }
.btn.outline { background: transparent; color: var(--accent); border-color: var(--gold); }
.seg { border-color: var(--gold-soft); }
.seg button.on, .chip.on { background: var(--maroon); color: #fff3d6; border-color: var(--gold); }
:root.dark .seg button.on, :root.dark .chip.on, :root.dark .btn { background: var(--gold); color: #1a0d0b; }
:root.dark .btn.outline { background: transparent; color: var(--gold); }

/* Framed cards: double gold border like a printed stotram book */
.verse, .tile, .step, .glance, .pan, .tl, .tl-panel, details.more, .pan-strip, .audio, .row, .japa-btn {
  border-color: var(--line);
  box-shadow: inset 0 0 0 3px var(--card), inset 0 0 0 4px var(--gold-soft);
}
.verse { border-radius: 6px; }
.verse .n {
  top: .45rem; right: .55rem; min-width: 1.6rem; height: 1.6rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--gold); border-radius: 50%; color: var(--gold); font-size: .72rem; background: var(--card);
}
.verse .te { color: var(--ink); }
.tile { border-radius: 8px; text-align: center; padding: 1.3rem 1rem; }
.tile:hover { border-color: var(--gold); transform: translateY(-2px); transition: transform .15s; }
.tile b { color: var(--maroon); font-size: 1.2rem; }
:root.dark .tile b { color: var(--gold); }
.mantram .verse { border: 2px solid var(--gold); background: linear-gradient(180deg, #fff3d6, var(--card) 70%); }
:root.dark .mantram .verse { background: linear-gradient(180deg, #3a1f17, var(--card) 70%); }

/* Home hero: glowing Om and a diya over a faint kolam */
.hero { position: relative; padding: 2.4rem 0 1.4rem; }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .6;
  background: radial-gradient(circle, var(--gold-soft) 1.6px, transparent 2px) 0 0 / 20px 20px;
  -webkit-mask: radial-gradient(ellipse at center, #000 20%, transparent 70%); mask: radial-gradient(ellipse at center, #000 20%, transparent 70%);
}
.hero h1 { font-size: 2.5rem; }

/* Footer fringe */
.foot { position: relative; background: var(--accent-soft); border-top: 2px solid var(--gold); margin-top: 2rem; }
.foot::before {
  content: ""; position: absolute; left: 0; right: 0; top: -12px; height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='12'%3E%3Cpath d='M0 12h24v-1a12 11 0 0 0-12-11A12 11 0 0 0 0 11z' fill='%23c8962b'/%3E%3C/svg%3E") repeat-x;
}

/* Bhagavad Gita on the home page */
.gita { text-align: center; margin: 2.4rem 0 2rem; }
.gita-stage { position: relative; min-height: 300px; display: flex; align-items: center; justify-content: center; padding: 1.2rem 3rem; }
.gita-om {
  /* the brush-stroke Om image used as a stencil, filled with the brass gradient */
  position: absolute; left: 50%; top: 50%; width: 300px; height: 280px; transform: translate(-50%, -52%) rotate(-4deg);
  pointer-events: none;
  -webkit-mask: url("icons/om-brush.png") center / contain no-repeat; mask: url("icons/om-brush.png") center / contain no-repeat;
  background: linear-gradient(120deg, #e0731c 0%, #f4a52c 22%, #ffd25e 38%, #fff1b8 46%, #ffd25e 54%, #f4a52c 72%, #c95a12 100%);
  background-size: 260% 100%; background-position: 100% 0;
  opacity: .36;
  animation: om-shine 9s ease-in-out infinite alternate;
}
.gita-stage::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 320px; height: 300px; transform: translate(-50%, -52%);
  border-radius: 50%; pointer-events: none; filter: blur(10px);
  background: radial-gradient(circle, rgba(255, 210, 94, .22) 0%, rgba(244, 165, 44, .08) 45%, transparent 70%);
}
@keyframes om-shine { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) { .gita-om { animation: none; } }
:root.dark .gita-om { opacity: .28; }
@media (max-width: 600px) { .gita-om { width: 230px; height: 215px; } .gita-stage::before { width: 250px; height: 230px; } }
.gita-text { position: relative; max-width: 640px; opacity: 0; transition: opacity .7s ease; }
.gita-text.in { opacity: 1; }
.gita-sh { font-family: var(--te); font-size: 1.05rem; line-height: 1.85; color: var(--maroon); white-space: pre-line; margin-bottom: .4rem; }
:root.dark .gita-sh { color: var(--gold); }
.gita-tr { font-size: .85rem; color: var(--muted); font-style: italic; margin-bottom: .9rem; white-space: pre-line; }
.script-te .gita-tr, .script-en .gita-sh { display: none; }
.gita blockquote { margin: 0; font-family: var(--en); font-style: italic; font-size: 1.45rem; line-height: 1.5; color: #4a2a6a; }
:root.dark .gita blockquote { color: #e6d3f5; }
.gita cite { display: block; margin-top: .8rem; font-style: normal; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold); }
.gita-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 2.4rem; height: 2.4rem; border-radius: 50%; border: 1px solid var(--gold); background: var(--card); color: var(--maroon); font-size: 1.5rem; line-height: 1; cursor: pointer; }
.gita-nav.prev { left: 0; } .gita-nav.next { right: 0; }
.gita-nav:hover { background: var(--gold); color: #fff; }
.gita-dots { display: flex; gap: .4rem; justify-content: center; }
.gita-dots button { width: 9px; height: 9px; padding: 0; border-radius: 50%; border: 1px solid var(--gold); background: transparent; cursor: pointer; }
.gita-dots button.on { background: var(--gold); }
@media (max-width: 600px) { .gita-stage { padding: 1rem 2.4rem; } .gita blockquote { font-size: 1.15rem; } }
@media (prefers-reduced-motion: reduce) { .gita-text { transition: none; } }
:root.dark .gita-nav { color: var(--gold); }
:root.dark .gita-nav:hover { color: #1a0d0b; }

/* ===================== Logo ===================== */
/* Header: a cream strip with the logo, then the maroon menu bar with the temple fringe */
.topbar { display: block; padding: 0; background: none; border-bottom: 0; box-shadow: none; }
.topbar .brand {
  display: flex; justify-content: center; align-items: center; padding: .35rem 1rem;
  background: linear-gradient(180deg, #fffaf0, #f8eedb); border-bottom: 2px solid var(--gold);
}
.topbar .brand img { height: 52px; width: auto; display: block; }
.topbar nav {
  display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .6rem; padding: .45rem 1rem;
  background: linear-gradient(180deg, #7d1717, var(--maroon)); border-bottom: 2px solid var(--gold);
}
:root.dark .topbar nav { background: linear-gradient(180deg, #4a1010, var(--maroon)); }
:root.dark .topbar .brand { background: linear-gradient(180deg, #f6ead2, #ead8b4); }
@media (max-width: 600px) { .topbar .brand img { height: 40px; } .topbar nav { font-size: .9rem; gap: .1rem .3rem; } }

/* Home page: the full logo, large */
.hero-logo { margin: 0 auto .4rem; }
.hero-logo img { display: block; width: min(560px, 92%); height: auto; margin: 0 auto; }
.hero-logo .te { margin-top: .3rem; }
.hero-logo::after { margin-left: auto; margin-right: auto; }
:root.dark .hero-logo img { background: radial-gradient(ellipse at center, #f8eedb 55%, rgba(248, 238, 219, 0) 72%); padding: .8rem 1.4rem; border-radius: 20px; }

/* Membership and account */
.plan .price { font-family: var(--head); font-size: 2rem; color: var(--maroon); margin: .3rem 0 .6rem; }
:root.dark .plan .price { color: var(--gold); }
.fam { align-items: end; padding: .8rem; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
#pvMsg { min-height: 1.5em; color: var(--accent); }
.foot a { color: var(--accent); }

.credit { margin-top: .8rem; letter-spacing: .01em; }
.legal { max-width: 46rem; } .legal h2 { margin-top: 1.8rem; } .legal li { margin: .3rem 0; }
.legal table { border-collapse: collapse; width: 100%; font-size: .95em; } .legal th, .legal td { text-align: left; vertical-align: top; padding: .5rem .6rem; border: 1px solid var(--line); }

.social { margin: .7rem 0; } .social a { display: inline-flex; align-items: center; gap: .45rem; } .social svg { flex: none; }

/* Temples */
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin: .3rem 0 0; }
.tag { border: 1px solid var(--gold); border-radius: 999px; padding: .05rem .6rem; font-size: .78rem; color: var(--accent); background: var(--accent-soft); }
h1 + .tags { margin: .2rem 0 1rem; }
h2 .count { color: var(--muted); font-size: .85rem; font-weight: 400; margin-left: .3rem; }
.row.temple > div:first-child { min-width: 0; }
.about { margin: 1rem 0 1.2rem; line-height: 1.75; } .about p { margin: 0; } .about .te-p { font-family: var(--te); line-height: 1.95; font-size: 1.05rem; }
.pv .te-p, .pv .en-p { display: block; font-weight: 400; } .pv .te-p { font-family: var(--te); } .pv .te-p + .en-p { margin-top: .4rem; padding-top: .4rem; }
.script-te .pv .en-p, .script-en .pv .te-p { display: none; }
#tf .chip .en-i, #tf .chip .te-i { pointer-events: none; }
@media (max-width: 600px) {
  .topbar nav { font-size: .84rem; gap: .1rem; padding: .4rem .3rem; } .topbar nav a { padding: .25rem .38rem; }
  #tf { flex-wrap: nowrap; overflow-x: auto; margin-right: -1.2rem; padding: .1rem 1.2rem .4rem .1rem; scrollbar-width: thin; } #tf .chip { flex: none; }
  .row.temple { gap: .6rem; } .row.temple .meta { white-space: normal; max-width: 38%; }
}
