/* IBI Calendar v1.0 — styles. Mobile first, edge to edge at every width, light + dark, print = one wall-calendar page. */
:root {
  --bg: #f4f1ea; --surface: #ffffff; --surface-2: #faf7f0; --ink: #1d1a16; --ink-2: #5b544a; --line: #e4ddcf;
  --brand: #0b7fa8; --brand-ink: #ffffff; --accent: #9b1c1c; --accent-soft: #fde8e6; --gold: #b7791f; --gold-soft: #fdf3dc;
  --good: #137a4b; --good-soft: #e3f4ea; --bad: #b42318; --bad-soft: #fde7e4; --today: #0b7fa8; --sel: #fff1c9;
  --shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 16px rgba(0, 0, 0, .06);
  --head-bg: #0b0f17; --head-ink: #f1f5f9; --r: 14px;
  --font: Inter, "Noto Sans Tamil", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --serif: "Playfair Display", "Noto Serif Tamil", Georgia, serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0f17; --surface: #121826; --surface-2: #0f1522; --ink: #eef2f7; --ink-2: #a3adbd; --line: #243047;
  --brand: #35c0ed; --brand-ink: #04121a; --accent: #ff7a6e; --accent-soft: #3a1a1a; --gold: #f2c14e; --gold-soft: #33290f;
  --good: #4ade80; --good-soft: #10291c; --bad: #ff8a80; --bad-soft: #351616; --today: #35c0ed; --sel: #2b2610;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0f17; --surface: #121826; --surface-2: #0f1522; --ink: #eef2f7; --ink-2: #a3adbd; --line: #243047;
    --brand: #35c0ed; --brand-ink: #04121a; --accent: #ff7a6e; --accent-soft: #3a1a1a; --gold: #f2c14e; --gold-soft: #33290f;
    --good: #4ade80; --good-soft: #10291c; --bad: #ff8a80; --bad-soft: #351616; --today: #35c0ed; --sel: #2b2610;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4); color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; overflow-x: clip; }
body { background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-text-size-adjust: 100%; min-height: 100dvh; }
button, select, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ── header ── */
.topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; padding-top: max(6px, env(safe-area-inset-top)); background: var(--head-bg); color: var(--head-ink); min-height: 56px; }
.topbar::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, #35c0ed, #7f00ff, #e11d48, #f59e0b, #16a34a, #35c0ed); }
.brand { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ver-badge { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px; background: #35c0ed; color: #04121a; flex: 0 0 auto; }
.logo { width: 34px; height: 34px; border-radius: 9px; background: #000; display: grid; place-items: center; flex: 0 0 auto; border: 1px solid #1f2937; }
.logo svg { width: 24px; height: 24px; }
.brand-t { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-t b { font-size: 17px; white-space: nowrap; }
.brand-t small { font-size: 12px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.actions { display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }
.hbtn { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; display: inline-grid; place-items: center; padding: 0; color: inherit; }
.hbtn:hover { background: rgba(127, 127, 127, .18); }
.lang-btn { width: auto; border-radius: 999px; padding: 0 10px; display: inline-flex; gap: 6px; align-items: center; font-size: 14px; font-weight: 600; }
.install-pill { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 999px; background: #7f00ff; color: #fff; font-weight: 600; font-size: 14px; margin: 0 4px; }
.install-pill .i { width: 18px; height: 18px; }
.share-slot { display: inline-flex; color: var(--head-ink); }
.install-banner { position: sticky; top: 56px; z-index: 39; display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #1e1036; color: #f3e8ff; font-size: 14px; }
.install-banner span { flex: 1; min-width: 0; }
.install-banner .ib-short { display: none; }
@media (max-width: 639px) { .install-banner .ib-long { display: none; } .install-banner .ib-short { display: inline; } }

/* ── toolbar ── */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 10px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 56px; z-index: 30; }
.nav-group { display: flex; align-items: center; gap: 2px; }
.title-btn { border: 0; background: transparent; font-family: var(--serif); font-weight: 700; font-size: 22px; padding: 4px 8px; border-radius: 10px; min-height: 40px; white-space: nowrap; }
.title-btn:hover { background: var(--surface-2); }
.year-pick select { height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 10px; font-weight: 600; font-size: 16px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font-weight: 600; font-size: 15px; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 14px; }
.btn[disabled] { opacity: .55; cursor: default; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.seg button { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px; min-height: 40px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
.seg button .i { width: 18px; height: 18px; }
.seg button[aria-selected="true"] { background: var(--brand); color: var(--brand-ink); }
.clock { margin-left: auto; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ── layout: edge to edge; two columns from 1000 px ── */
main { padding: 0; }
.layout { display: block; }
@media (min-width: 1000px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 420px); align-items: start; }
  .col-side { position: sticky; top: 112px; max-height: calc(100dvh - 112px); overflow: auto; border-left: 1px solid var(--line); background: var(--surface); }
}
@media (max-width: 999px) { .col-side { display: none; } }

/* ── month page (looks like a printed wall calendar) ── */
.page { background: var(--surface); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.hero-art { position: relative; aspect-ratio: 2.4 / 1; overflow: hidden; background: #0b0f17; }
.hero-art svg { display: block; width: 100%; height: 100%; }
.hero-txt { padding: 12px 10px 8px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 6px 16px; border-bottom: 2px solid var(--accent); }
.m-title { font-family: var(--serif); font-size: 32px; line-height: 1.1; margin: 0; color: var(--accent); font-weight: 700; }
.m-sub { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.lg-hol { width: 12px; height: 12px; border-radius: 3px; background: var(--accent-soft); border: 1px solid var(--accent); }
.lg-star { color: var(--gold); font-weight: 700; }
.lg-am { width: 11px; height: 11px; border-radius: 50%; background: var(--ink); display: inline-block; }
.lg-pm { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--gold); display: inline-block; }
.lg-ev { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); display: inline-block; }

.grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); user-select: none; touch-action: pan-y; }
.wk { text-align: center; font-weight: 700; font-size: 13px; padding: 8px 2px; background: var(--accent); color: #fff; }
:root[data-theme="dark"] .wk { color: #1a0b0b; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wk { color: #1a0b0b; } }
.cell { position: relative; border: 0; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--surface); min-height: 62px; padding: 4px 4px 3px; text-align: left; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.cell:nth-child(7n + 7) { border-right: 0; }
.cell:hover { background: var(--surface-2); }
.cell .dn { font-size: 19px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cell .td { position: absolute; top: 4px; right: 5px; font-size: 12px; color: var(--ink-2); line-height: 1.1; }
.cell .td.m1 { color: var(--brand); font-weight: 700; }
.cell .ic { display: flex; gap: 3px; align-items: center; min-height: 14px; font-size: 12px; line-height: 1; }
.cell .fn { font-size: 12px; line-height: 1.25; color: var(--accent); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; }
.cell .fn.nf { color: var(--ink-2); font-weight: 500; }
.cell.sun .dn, .cell.hol .dn { color: var(--accent); }
.cell.hol { background: var(--accent-soft); }
.cell.muh { box-shadow: inset 0 -3px 0 var(--gold); }
.cell.other { background: var(--surface-2); }
.cell.other > * { opacity: .45; }
.cell.today .dn { background: var(--today); color: #fff; border-radius: 8px; padding: 0 6px; align-self: flex-start; }
:root[data-theme="dark"] .cell.today .dn { color: #04121a; }
.cell.sel { outline: 2px solid var(--brand); outline-offset: -2px; background: var(--sel); }
.am { width: 10px; height: 10px; border-radius: 50%; background: var(--ink); display: inline-block; }
.pm { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--gold); display: inline-block; }
.st { color: var(--gold); font-size: 13px; font-weight: 700; }
.ev { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); display: inline-block; }
@media (max-width: 639px) {
  .cell { min-height: 58px; padding: 3px 3px 2px; }
  .cell .dn { font-size: 18px; }
  .cell .fn { -webkit-line-clamp: 1; }
  .cell .fn.nf { display: none; }
}
@media (min-width: 640px) { .cell { min-height: 86px; } .wk { font-size: 14px; } }
@media (min-width: 1000px) { .cell { min-height: 92px; padding: 6px; } .cell .dn { font-size: 22px; } }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 8px; padding: 8px 0 0; }
.card { background: var(--surface); padding: 12px 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); overflow-wrap: break-word; }
.card h3 { margin: 0 0 8px; font-size: 16px; color: var(--accent); display: flex; align-items: center; gap: 8px; }
.card ul { list-style: none; margin: 0; padding: 0; }
.card li { padding: 6px 0; border-bottom: 1px dashed var(--line); display: flex; gap: 10px; align-items: baseline; }
.card li:last-child { border-bottom: 0; }
.card li .d { font-weight: 700; min-width: 74px; color: var(--ink); font-variant-numeric: tabular-nums; }
.card li button.link { border: 0; background: none; padding: 9px 2px; margin: -9px 0; text-align: left; color: inherit; font: inherit; cursor: pointer; }
.card li button.link:hover { color: var(--accent); text-decoration: underline; }
.card li button.link:hover { text-decoration: underline; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle; }
.tag.tent { background: var(--gold-soft); color: var(--gold); }
.tag.off { background: var(--good-soft); color: var(--good); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.kv b { color: var(--ink); }
.kural { font-family: "Noto Serif Tamil", var(--serif); font-size: 18px; line-height: 1.6; white-space: pre-line; margin: 0; }
.kural-n { font-size: 14px; color: var(--accent); font-weight: 600; margin-top: 4px; }
.kural-en { font-size: 15px; color: var(--ink-2); margin-top: 6px; }
.note { font-size: 13px; color: var(--ink-2); }

/* ── day details ── */
.dd { padding: 12px 10px 16px; }
.dd-head { display: flex; align-items: center; gap: 10px; }
.dd-big { font-family: var(--serif); font-size: 44px; line-height: 1; color: var(--accent); font-weight: 700; min-width: 56px; text-align: center; }
.dd-h { flex: 1; min-width: 0; }
.dd-h b { display: block; font-size: 18px; }
.dd-h span { display: block; font-size: 14px; color: var(--ink-2); }
.dd-nav { display: flex; gap: 2px; }
.dd-nav .hbtn { border: 1px solid var(--line); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.chip { font-size: 14px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
.chip.hol { background: var(--accent-soft); color: var(--accent); border-color: transparent; font-weight: 600; }
.chip.muh { background: var(--gold-soft); color: var(--gold); border-color: transparent; font-weight: 600; }
.chip.ev { background: var(--brand); color: var(--brand-ink); border-color: transparent; }
.sec { margin-top: 14px; }
.sec h4 { margin: 0 0 6px; font-size: 14px; text-transform: none; color: var(--ink-2); font-weight: 700; letter-spacing: .02em; }
.rows { display: grid; gap: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.row { display: grid; grid-template-columns: minmax(0, 42%) minmax(0, 1fr); gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.row:last-child { border-bottom: 0; }
.row .k { color: var(--ink-2); font-size: 15px; }
.row .v { font-weight: 600; font-size: 15px; }
.row .v small { display: block; font-weight: 400; color: var(--ink-2); font-size: 13px; }
.row.good .v { color: var(--good); }
.row.bad .v { color: var(--bad); }
.gowri { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.gowri ol { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.gowri li { display: flex; justify-content: space-between; gap: 6px; padding: 5px 8px; font-size: 13px; border-bottom: 1px solid var(--line); }
.gowri li:last-child { border-bottom: 0; }
.gowri li.g { background: var(--good-soft); color: var(--good); font-weight: 600; }
.gowri li.b { color: var(--ink-2); }
.gowri .gh { font-size: 13px; font-weight: 700; padding: 5px 8px; background: var(--surface-2); }
.evlist { display: grid; gap: 6px; }
.evrow { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; }
.evrow span { flex: 1; min-width: 0; overflow-wrap: break-word; }

/* ── year view ── */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px; padding: 8px 0; }
.mini { background: var(--surface); padding: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mini h3 { margin: 0 0 6px; font-family: var(--serif); color: var(--accent); font-size: 20px; }
.mini h3 button { border: 0; background: none; font: inherit; color: inherit; padding: 0; }
.mini h3 small { display: block; font-family: var(--font); font-size: 13px; color: var(--ink-2); font-weight: 500; }
.mini .mg { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.mini .mg b { font-size: 12px; color: var(--ink-2); }
.mini .mg button { border: 0; background: transparent; min-height: 34px; border-radius: 8px; font-size: 14px; font-variant-numeric: tabular-nums; padding: 0; position: relative; }
.mini .mg button:hover { background: var(--surface-2); }
.mini .mg button.sun { color: var(--accent); }
.mini .mg button.hol { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.mini .mg button.fest::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--gold); }
.mini .mg button.today { background: var(--today); color: #fff; font-weight: 700; }

/* ── festivals view ── */
.fest-tools { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px; background: var(--surface); border-bottom: 1px solid var(--line); align-items: center; }
.search { flex: 1 1 220px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; background: var(--surface-2); min-height: 42px; }
.search input { border: 0; background: transparent; flex: 1; min-width: 0; font-size: 16px; outline: none; height: 40px; }
.fest-month { background: var(--surface); margin-top: 8px; }
.fest-month h3 { margin: 0; padding: 10px; font-family: var(--serif); color: var(--accent); font-size: 20px; border-bottom: 1px solid var(--line); }
.frow { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: center; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: var(--surface); text-align: left; padding: 10px; }
.frow:hover { background: var(--surface-2); }
.frow .fd { text-align: center; line-height: 1.1; }
.frow .fd b { display: block; font-size: 22px; font-family: var(--serif); }
.frow .fd small { font-size: 12px; color: var(--ink-2); }
.frow.hol .fd b { color: var(--accent); }
.empty { padding: 24px 10px; text-align: center; color: var(--ink-2); }

/* ── overlays (sheet on phones, dialog on wide screens) ── */
.layer { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; background: rgba(5, 8, 15, .55); }
.sheet { background: var(--surface); width: 100%; max-height: 92dvh; display: flex; flex-direction: column; border-radius: 18px 18px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .3); overflow: hidden; }
.sheet-h { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-bottom: 1px solid var(--line); }
.sheet-h h2 { flex: 1; min-width: 0; margin: 0; font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-b { padding: 10px; overflow: auto; flex: 1; }
.sheet-b.flush { padding: 0; }
.sheet-f { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.sheet-f .btn { flex: 1; }
@media (min-width: 700px) {
  .layer { align-items: center; }
  .sheet { width: min(560px, 94vw); border-radius: 18px; max-height: 88dvh; }
}
body.layer-open { overflow: hidden; }
.mlist { display: grid; gap: 0; }
.mitem { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 50px; padding: 8px 10px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font-size: 16px; }
.mitem:hover { background: var(--surface-2); }
.mitem .i { color: var(--brand); }
.mitem span { flex: 1; min-width: 0; }
.mitem select { max-width: 55%; height: 40px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 0 8px; font-size: 15px; }
.mhead { padding: 12px 10px 4px; font-size: 13px; font-weight: 700; color: var(--ink-2); }
.switch { position: relative; width: 48px; height: 28px; border-radius: 999px; background: var(--line); flex: 0 0 auto; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); }
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(20px); }
.langs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.langs button { min-height: 56px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 6px 12px; text-align: left; }
.langs button b { font-size: 18px; }
.langs button small { font-size: 13px; color: var(--ink-2); }
.langs button[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); background: var(--surface-2); }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input[type="text"], .field input[type="date"], .field textarea { width: 100%; min-height: 44px; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--surface); font-size: 16px; }
.field .err { color: var(--bad); font-size: 14px; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; }
.help-list { margin: 0 0 8px; padding-left: 20px; }
.help-list li { margin: 4px 0; }
.ig-main { border: 1px solid var(--line); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.ig-main h3, .ig-other h3 { margin: 0 0 6px; font-size: 16px; }
.ig-more summary { cursor: pointer; font-weight: 600; padding: 8px 0; }

/* ── toast, footer ── */
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 200; background: #111827; color: #fff; padding: 10px 14px; border-radius: 12px; font-size: 15px; display: flex; gap: 12px; align-items: center; max-width: calc(100vw - 20px); box-shadow: 0 6px 24px rgba(0, 0, 0, .35); }
.toast button { border: 0; background: none; color: #35c0ed; font-weight: 700; }
.foot { padding: 14px 10px 24px; font-size: 13px; color: var(--ink-2); text-align: center; }
.foot a { color: inherit; }
.loading { padding: 40px 10px; text-align: center; color: var(--ink-2); }

/* ── phones: tighter header, edge to edge (no outer gutters anywhere) ── */
@media (max-width: 639px) {
  .brand-t small { display: none; }
  body.show-install .brand-t { display: none; }
  .lang-btn span { display: none; }
  .lang-btn { width: 40px; padding: 0; justify-content: center; }
  .toolbar { gap: 6px; }
  .title-btn { font-size: 20px; padding: 4px; }
  .seg { width: 100%; }
  .seg button { flex: 1; justify-content: center; padding: 0 6px; }
  .clock { margin-left: 0; width: 100%; font-size: 13px; }
  .m-title { font-size: 28px; }
  .hero-art { aspect-ratio: 3 / 1; }
  .toolbar { top: 56px; }
}
@media (max-width: 380px) { .install-pill span { display: none; } .install-pill { padding: 0 9px; } }

/* ── print: one wall-calendar page per month ── */
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root { --bg: #fff; --surface: #fff; --surface-2: #fafafa; --ink: #111; --ink-2: #444; --line: #ccc; --accent: #9b1c1c; --accent-soft: #fde8e6; color-scheme: light; }
  body { background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .toolbar, .install-banner, .col-side, .foot, .toast, .layer, #viewYear, #viewFest { display: none !important; }
  .layout { display: block !important; }
  .hero { grid-template-columns: 38% 62%; }
  .hero-art { aspect-ratio: 2.2 / 1; }
  .cell { min-height: 64px; }
  .cards { grid-template-columns: repeat(3, 1fr); }
  .card { break-inside: avoid; }
}

/* ── religions: one colour each, used in the month grid, lists, chips and the year view ── */
:root { --r-hindu: #c2410c; --r-muslim: #15803d; --r-christian: #6d28d9; --r-sikh: #1d4ed8; --r-jain: #db2777; --r-buddhist: #a16207; --r-parsi: #0f766e; --r-national: #475569; }
:root[data-theme="dark"] { --r-hindu: #fb923c; --r-muslim: #4ade80; --r-christian: #c4b5fd; --r-sikh: #93c5fd; --r-jain: #f9a8d4; --r-buddhist: #fcd34d; --r-parsi: #5eead4; --r-national: #cbd5e1; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --r-hindu: #fb923c; --r-muslim: #4ade80; --r-christian: #c4b5fd; --r-sikh: #93c5fd; --r-jain: #f9a8d4; --r-buddhist: #fcd34d; --r-parsi: #5eead4; --r-national: #cbd5e1; } }
.r-hindu { --rc: var(--r-hindu); } .r-muslim { --rc: var(--r-muslim); } .r-christian { --rc: var(--r-christian); } .r-sikh { --rc: var(--r-sikh); }
.r-jain { --rc: var(--r-jain); } .r-buddhist { --rc: var(--r-buddhist); } .r-parsi { --rc: var(--r-parsi); } .r-national { --rc: var(--r-national); }
.cell .fn[class*="r-"] { color: var(--rc); }
.cell .rbar { display: flex; gap: 2px; position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; pointer-events: none; }
.cell .rbar i { flex: 1; border-radius: 2px; background: var(--rc); }
.rdot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--rc); flex: 0 0 auto; }
.rlegend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.rlegend button { display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 6px 0; color: inherit; font: inherit; cursor: pointer; }
.chip.rel { border-color: var(--rc); color: var(--rc); background: var(--surface); font-weight: 600; }
.chip.rel.hol { background: var(--accent-soft); }
.srcs { margin: 6px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2); }
.srcs li { display: flex; gap: 6px; align-items: baseline; padding: 3px 0; }
.srcs li .rdot { transform: translateY(1px); }
.tent-note { display: block; font-size: 13px; color: var(--gold); font-weight: 600; }
.relchips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.relchips button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; cursor: pointer; }
.relchips button[aria-pressed="true"] { border-color: var(--rc, var(--brand)); box-shadow: inset 0 0 0 1px var(--rc, var(--brand)); font-weight: 600; }
.relchips button[aria-pressed="false"] { opacity: .55; }
.relchips button[aria-pressed="false"] .rdot { background: transparent; box-shadow: inset 0 0 0 2px var(--rc); }
.frow .fn-dot { margin-right: 6px; }
.mini .mg button.fest[class*="r-"]::after { background: var(--rc); }
.card li .rdot { margin-top: 7px; }
