/* Jatakaveda has two themes. Day, "Temple dawn": sandalwood cream, kumkum maroon, saffron and marigold; palm-leaf cards with thin
   gold borders, a toran (mango leaves and marigolds) along the top, kolam dots in the paper, readable in sunlight on a phone.
   Night, the signature: deep indigo-black, one warm marigold accent, faint stars instead of kolam dots, no toran.
   The site follows the device (prefers-color-scheme); site/js/theme.js can fix it to day or night (data-theme on <html>). */
:root {
  --bg: #f7ecd9; --bg-2: #f1e2c6; --panel: #fdf6e8; --panel-2: #f5e7cb; --line: #dcc192;
  --ink: #3b1a12; --ink-2: #5e3a2a; --ink-3: #7a5846;
  /* accents (names kept from the first theme): links and emphasis in kumkum, saffron, leaf green, lotus */
  --gold: #9e1b32; --gold-2: #7a1226; --saffron: #a54a14; --teal: #2f6b3a; --rose: #a3243f; --violet: #8e3b8a;
  --fill: #f2a900; --fill-2: #e2711d; --on-fill: #3b1a12;       /* marigold buttons and active tabs, maroon text */
  --border-gold: #c9a24a;
  --shadow: 0 6px 22px rgba(94, 58, 42, .12);
  --radius: 14px;
  /* Chart colours, one job each (validated against the card surface #fdf6e8 with the dataviz palette checks):
     a single series (kumkum); a sequential ramp, low → high, one saffron hue; a diverging pair, below / above zero. */
  --viz-series: #9e1b32;
  --viz-seq-1: #df9640; --viz-seq-2: #c2701f; --viz-seq-3: #965011; --viz-seq-4: #663307;
  --viz-neg: #2a78d6; --viz-pos: #e34948; --viz-zero: #87634f;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Noto Serif Devanagari", "Nirmala UI", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Nirmala UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SF Mono", Consolas, monospace;
  /* The type scale. The owner's rule: nothing under 14 pixels, tabular digits, never a wrapped number. --fs-xs is the floor
     (kickers, tags, table headers, captions, notes); hierarchy comes from weight, colour and spacing, never a smaller size.
     tests/legibility.test.mjs fails on any font size under 14px in site/css. */
  --fs-xs: 14px;   /* the floor: kickers, tags, pills, table headers, captions, notes, footnotes */
  --fs-s: 15px;    /* secondary lines, chips, labels on phones */
  --fs-m: 16px;    /* body */
  --fs-l: 17px;    /* long-form reading */
  --fs-xl: 20px;   /* small headings and values */
  --hi: #fff;                     /* the inset highlight along the top of a card */
  --on-accent: #fff;               /* text on a solid --gold mark (today in the calendar) */
  --viz-seq-ink: #fdf6e8;          /* text on the darkest step of the sequential ramp */
  --good: #2f6b3a; --good-line: #9cc5a0;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
/* Night. The same tokens twice: following the device, and fixed by the theme button. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1026; --bg-2: #0f1533; --panel: #141c40; --panel-2: #1a2350; --line: #2c3768;
    --ink: #eef0fb; --ink-2: #bcc2e4; --ink-3: #959dc9;
    --gold: #f2b84b; --gold-2: #ffd27d; --saffron: #f0a25a; --teal: #7fd39a; --rose: #ff8fa6; --violet: #cfa3ec;
    --fill: #f2a900; --fill-2: #e2711d; --on-fill: #1a1205;
    --border-gold: #4d4426;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --viz-series: #f2b84b;
    --viz-seq-1: #4a3613; --viz-seq-2: #7a5517; --viz-seq-3: #b67c22; --viz-seq-4: #f2b84b;
    --viz-neg: #6aa8ff; --viz-pos: #ff7a72; --viz-zero: #959dc9;
    --hi: transparent; --on-accent: #1a1205; --viz-seq-ink: #1a1205;
    --good: #7fd39a; --good-line: #3f7a52;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --bg: #0b1026; --bg-2: #0f1533; --panel: #141c40; --panel-2: #1a2350; --line: #2c3768;
    --ink: #eef0fb; --ink-2: #bcc2e4; --ink-3: #959dc9;
    --gold: #f2b84b; --gold-2: #ffd27d; --saffron: #f0a25a; --teal: #7fd39a; --rose: #ff8fa6; --violet: #cfa3ec;
    --fill: #f2a900; --fill-2: #e2711d; --on-fill: #1a1205;
    --border-gold: #4d4426;
    --shadow: 0 10px 30px rgba(0, 0, 0, .45);
    --viz-series: #f2b84b;
    --viz-seq-1: #4a3613; --viz-seq-2: #7a5517; --viz-seq-3: #b67c22; --viz-seq-4: #f2b84b;
    --viz-neg: #6aa8ff; --viz-pos: #ff7a72; --viz-zero: #959dc9;
    --hi: transparent; --on-accent: #1a1205; --viz-seq-ink: #1a1205;
    --good: #7fd39a; --good-line: #3f7a52;
    color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 76px; }
body {
  margin: 0; background-color: var(--bg); color: var(--ink); font: var(--fs-m)/1.6 var(--sans);
  /* kolam: a faint grid of dots, as drawn on a doorstep at dawn; and a soft sunrise glow at the top */
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--border-gold) 38%, transparent) 1.2px, transparent 1.6px),
    radial-gradient(1100px 520px at 50% -12%, color-mix(in srgb, var(--fill) 22%, transparent), transparent 70%);
  background-size: 22px 22px, 100% 100%;
}
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { color: var(--gold-2); }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 4px; }
img { max-width: 100%; }
/* Digits in columns everywhere (times, dates, degrees, counts, scores, table numbers), except in running prose. !important
   because the font shorthand, used by many rules here and by Jaal on its 3D labels, resets font-variant-numeric. */
:not(.prose :is(p, li, blockquote, dd, h1, h2, h3, h4), .prose :is(p, li, blockquote, dd, h1, h2, h3, h4) *) { font-variant-numeric: tabular-nums !important; }
small, sub, sup { font-size: max(var(--fs-xs), .8em); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--fill); color: var(--on-fill); padding: 8px 12px; border-radius: 8px; z-index: 99; }
.skip:focus { left: 8px; }

/* Header and footer */
/* Day: the toran (mango leaves and marigolds) along the bottom of the header; night removes it (below) */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px clamp(16px, 4vw, 40px) 30px; background-color: color-mix(in srgb, var(--panel) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20width%3D'64'%20height%3D'26'%20viewBox%3D'0%200%2064%2026'%3E%20%3Cpath%20d%3D'M0%203%20Q16%207%2032%203%20T64%203'%20fill%3D'none'%20stroke%3D'%237a4a2a'%20stroke-width%3D'1.4'%2F%3E%20%3Cpath%20d%3D'M8%204%20C3%2010%204%2018%208%2023%20C12%2018%2013%2010%208%204Z'%20fill%3D'%233f7a3a'%2F%3E%3Cpath%20d%3D'M8%206%20L8%2021'%20stroke%3D'%232a5a2a'%20stroke-width%3D'.7'%2F%3E%20%3Cpath%20d%3D'M40%204%20C35%2010%2036%2018%2040%2023%20C44%2018%2045%2010%2040%204Z'%20fill%3D'%234d8a3f'%2F%3E%3Cpath%20d%3D'M40%206%20L40%2021'%20stroke%3D'%232f6b3a'%20stroke-width%3D'.7'%2F%3E%20%3Cpath%20d%3D'M24%205%20L24%209'%20stroke%3D'%237a4a2a'%20stroke-width%3D'.8'%2F%3E%3Ccircle%20cx%3D'24'%20cy%3D'13'%20r%3D'5'%20fill%3D'%23f2a900'%2F%3E%3Ccircle%20cx%3D'24'%20cy%3D'13'%20r%3D'2.4'%20fill%3D'%23e2711d'%2F%3E%20%3Cpath%20d%3D'M56%205%20L56%209'%20stroke%3D'%237a4a2a'%20stroke-width%3D'.8'%2F%3E%3Ccircle%20cx%3D'56'%20cy%3D'13'%20r%3D'5'%20fill%3D'%23e2711d'%2F%3E%3Ccircle%20cx%3D'56'%20cy%3D'13'%20r%3D'2.4'%20fill%3D'%239e1b32'%2F%3E%20%3C%2Fsvg%3E");
  background-repeat: repeat-x; background-position: left bottom 2px; background-size: 64px 26px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--gold); text-decoration: none; font: 600 20px var(--serif); letter-spacing: .02em; }
.brand small { font: 400 var(--fs-m) var(--serif); color: var(--saffron); }
.top nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.top nav a { color: var(--ink-2); text-decoration: none; padding: 7px 12px; border-radius: 999px; font-size: var(--fs-s); white-space: nowrap; }
.top nav a:hover { color: var(--ink); background: var(--panel); }
.top nav a[aria-current="page"] { color: var(--on-fill); background: var(--fill); }
.foot { border-top: 1px solid var(--line); padding: 28px clamp(16px, 4vw, 40px) 40px; color: var(--ink-3); font-size: var(--fs-xs); max-width: 1180px; margin: 64px auto 0; }
.foot p { margin: 6px 0; max-width: 820px; }

main { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 4vw, 40px); }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.2; letter-spacing: .005em; }
h1 { font-size: clamp(32px, 5vw, 54px); margin: .2em 0 .35em; }
h2 { font-size: clamp(24px, 3vw, 32px); margin: 1.6em 0 .5em; }
h3 { font-size: 20px; margin: 1.4em 0 .4em; }
.kicker { text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-xs); color: var(--saffron); font-weight: 600; margin: 0 0 6px; }
.lede { font-size: clamp(17px, 2vw, 20px); color: var(--ink-2); max-width: 760px; }
.note { color: var(--ink-3); font-size: var(--fs-xs); }
.muted { color: var(--ink-3); }

/* Hero and live sky */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(20px, 4vw, 48px); align-items: center; padding: 24px 0 8px; }
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lede { margin-bottom: 20px; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); } }
.wheel-box { position: relative; aspect-ratio: 1; width: 100%; max-width: 520px; justify-self: center; }
.wheel-box svg { width: 100%; height: 100%; display: block; overflow: visible; }
.wheel-caption { text-align: center; color: var(--ink-3); font-size: var(--fs-xs); margin-top: 6px; }

.controls { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 8px 0 4px; }
.controls label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
select, input, button { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
input[type="datetime-local"] { min-width: 0; }
button { cursor: pointer; background: var(--panel-2); }
button:hover { border-color: var(--gold); }
button.primary { background: var(--fill); color: var(--on-fill); border-color: var(--gold); font-weight: 600; }
button.primary:hover { filter: brightness(1.04); }
.status { font-size: var(--fs-xs); color: var(--ink-3); min-height: 1.4em; }

.limbs { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin: 18px 0; }
.limb { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; position: relative; }
.limb .k { font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.limb .v { font: 600 22px/1.25 var(--serif); margin: 4px 0 2px; }
.limb .s { font-size: var(--fs-xs); color: var(--ink-2); }
.limb details { margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-2); }
.limb summary { cursor: pointer; color: var(--gold); list-style: none; }
.limb summary::-webkit-details-marker { display: none; }
.limb summary::before { content: "ⓘ "; }
.limb details p { margin: 6px 0 0; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.two { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 16px; }
@media (max-width: 900px) { .two { grid-template-columns: minmax(0, 1fr); } }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1em 0; border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 14.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--ink-3); font-weight: 600; font-size: var(--fs-xs); text-transform: uppercase; letter-spacing: .04em; background: var(--panel-2); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
td.num { white-space: nowrap; }
.glyph { font-size: 18px; width: 1.4em; display: inline-block; text-align: center; color: var(--gold); }
.retro { color: var(--rose); font-size: var(--fs-xs); font-weight: 600; margin-left: 4px; }

/* Feature grid */
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; margin: 16px 0; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.feature h3 { margin: 6px 0 6px; font-size: 18px; }
.feature p { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.pill { display: inline-block; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .03em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-3); background: color-mix(in srgb, var(--fill) 14%, var(--panel)); }
.pill.live { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 50%, transparent); }
.pill.next { color: var(--saffron); border-color: color-mix(in srgb, var(--saffron) 50%, transparent); }

.principles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.principle { border-left: 3px solid var(--fill-2); padding: 4px 0 4px 14px; }
.principle strong { font-family: var(--serif); font-size: 18px; display: block; }
.principle span { color: var(--ink-2); font-size: 14.5px; }
.quote { font: italic 20px/1.5 var(--serif); color: var(--ink); border-left: 3px solid var(--fill-2); padding: 4px 0 4px 18px; margin: 24px 0; max-width: 760px; }
.quote cite { display: block; font: normal var(--fs-xs) var(--sans); color: var(--ink-3); margin-top: 6px; }

/* Library */
.page-head { padding: 16px 0 4px; }
.feature-paper { display: grid; gap: 6px; text-decoration: none; color: var(--ink); background: linear-gradient(135deg, var(--panel-2), var(--panel)); border: 1px solid var(--border-gold); border-radius: var(--radius); padding: 22px; margin: 20px 0 8px; box-shadow: var(--shadow); }
.feature-paper strong { font: 600 clamp(22px, 3vw, 28px)/1.2 var(--serif); }
.feature-paper span:last-child { color: var(--ink-2); }
.feature-paper:hover { border-color: var(--gold-2); }
h2.group { font-size: 20px; color: var(--ink-2); margin-top: 1.8em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.card { display: grid; gap: 6px; align-content: start; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card:hover { border-color: var(--gold); }
.card strong { font: 600 18px/1.25 var(--serif); }
.card span { color: var(--ink-2); font-size: 14.5px; }
.card small { color: var(--ink-3); }

/* Long-form documents */
main.wide { max-width: 1280px; }
.doc-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow: auto; font-size: var(--fs-xs); padding-right: 8px; }
.toc p { text-transform: uppercase; letter-spacing: .08em; font-weight: 600; color: var(--ink-3); margin: 8px 0; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0; }
.toc li.d3 { padding-left: 14px; }
.toc a { display: block; color: var(--ink-2); text-decoration: none; padding: 4px 8px; border-radius: 6px; line-height: 1.35; }
.toc a:hover { color: var(--ink); background: var(--panel); }
@media (max-width: 980px) { .doc-grid { grid-template-columns: 1fr; } .toc { position: static; max-height: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px; } }
.prose { max-width: 820px; min-width: 0; font-size: var(--fs-l); line-height: 1.72; overflow-wrap: break-word; } /* a long catalogue id breaks rather than widening the page */
.prose h1 { font-size: clamp(30px, 4.4vw, 46px); }
.prose h2 { padding-top: .4em; border-top: 1px solid var(--line); }
.prose p, .prose li { color: color-mix(in srgb, var(--ink) 92%, var(--ink-2)); }
.prose li { margin: .3em 0; }
.prose code { font-family: var(--mono); font-size: max(var(--fs-xs), .88em); background: var(--panel); border: 1px solid var(--line); padding: 1px 5px; border-radius: 5px; word-break: break-word; }
.prose pre { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px; overflow-x: auto; }
.prose pre code { border: 0; padding: 0; background: none; }
.prose blockquote { margin: 1.2em 0; padding: 4px 0 4px 18px; border-left: 3px solid var(--saffron); color: var(--ink-2); }
.prose table { font-size: 14px; }
.prose a { word-break: break-word; }
.prose .anchor { float: left; margin-left: -1em; padding-right: .25em; color: var(--ink-3); text-decoration: none; opacity: 0; font-weight: 400; }
.prose h2:hover .anchor, .prose h3:hover .anchor { opacity: 1; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }

/* Heritage gallery */
.demo { margin: 22px 0; }
.demo h2 { margin-top: 0; }
.demo .tag { margin-left: 8px; vertical-align: middle; }
.demo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .demo-grid { grid-template-columns: 1fr; } }
.big-num { font: 600 clamp(26px, 4vw, 40px)/1.15 var(--serif); color: var(--gold); word-break: break-all; }
.mono { font-family: var(--mono); font-size: var(--fs-xs); word-break: break-all; }
.pi-digits { font-family: var(--mono); font-size: var(--fs-xs); line-height: 1.7; word-break: break-all; }
.pi-digits .ok { color: var(--teal); }
.pi-digits .bad { color: var(--rose); text-decoration: line-through; }
.bar { height: 10px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--saffron), var(--gold)); }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.inline-form input { width: 9em; }
.inline-form input.wide { width: min(100%, 22em); }
.steps { font-family: var(--mono); font-size: var(--fs-xs); color: var(--ink-2); max-height: 220px; overflow-y: auto; overflow-wrap: anywhere; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.chips button { font-size: var(--fs-xs); padding: 4px 10px; border-radius: 999px; }
.svg-chart { width: 100%; height: auto; display: block; }

.charter-list { counter-reset: c; list-style: none; padding: 0; display: grid; gap: 14px; }
.charter-list li { counter-increment: c; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 60px; position: relative; }
.charter-list li::before { content: counter(c); position: absolute; left: 16px; top: 14px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--fill); color: var(--on-fill); font-weight: 700; }
.charter-list strong { font-family: var(--serif); font-size: 18px; }

/* SVG charts (classes only: the CSP allows no inline styles). The heritage sine chart's words are sized for the width it is
   drawn at (a container query on its box), so they stay 14px or more on screen: 400 user units wide, drawn 250-600px wide. */
.w-tick { stroke: var(--line); stroke-width: .8; }
.w-div { stroke: var(--line); stroke-width: 1.2; }
.hc-box { container-type: inline-size; }
.hc-t { fill: var(--ink-3); font: 14px var(--sans); }
@container (max-width: 399px) { .hc-t { font-size: 19px; } }
@container (max-width: 299px) { .hc-t { font-size: 23px; } }
.chart-line { fill: none; stroke: var(--viz-zero); stroke-width: 1.5; }
.chart-dot { stroke: var(--panel); stroke-width: 2; }
.chart-dot.pos { fill: var(--viz-pos); }
.chart-dot.neg { fill: var(--viz-neg); }
.chart-zero { stroke: var(--viz-zero); stroke-width: 1; stroke-dasharray: 3 3; }

/* Kundli page */
.kform { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; align-items: end; }
.kform label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.kform .wide { grid-column: span 2; }
@media (max-width: 560px) { .kform .wide { grid-column: auto; } }
.kform .custom { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kform .adv { grid-column: 1 / -1; font-size: 14px; color: var(--ink-2); }
.kform .adv summary { cursor: pointer; color: var(--gold); padding: 11px 0; } /* a 44px target */
.kform .adv label { margin-top: 8px; max-width: 420px; }
.kform .status { grid-column: 1 / -1; }
.chart-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 12px; }
.chart-ctl { display: flex; flex-wrap: wrap; gap: 12px; align-items: end; }
.chart-ctl label { display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: var(--panel); }
.seg button[aria-pressed="true"] { background: var(--fill); color: var(--on-fill); font-weight: 600; }
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; margin: 12px 0; }
.kchart { width: 100%; height: auto; display: block; max-width: 460px; margin: 0 auto; }
.kc-cell, .kc-house { fill: var(--panel); stroke: var(--line); stroke-width: 1.4; }
.kc-cell.lagna, .kc-house.lagna { fill: color-mix(in srgb, var(--saffron) 14%, var(--panel)); }
[data-night="on"] .kc-cell.lagna, [data-night="on"] .kc-house.lagna { fill: color-mix(in srgb, var(--ink) 9%, var(--panel)); }
.kc-centre { fill: var(--bg-2); stroke: var(--line); }
/* The kundli chart, 400 user units, drawn 300-540px wide: its words are set large enough to stay 14px or more on screen
   (kundli.css sets them larger again on phones, where the chart is drawn smaller) */
.kc-sign { fill: var(--ink-3); font: 16px var(--serif); }
.kc-num { fill: var(--ink-3); font: 16px var(--sans); }
.kc-graha { fill: var(--gold-2); font: 600 17px var(--sans); }
.kc-graha.dense { font-size: 16px; }
.kc-asc { stroke: var(--saffron); stroke-width: 2; }
.kc-title { fill: var(--ink); font: 600 20px var(--serif); }
.kc-sub { fill: var(--ink-3); font: 16px var(--sans); }
tr.now td { background: color-mix(in srgb, var(--gold) 12%, transparent); }
.dashas details { border-bottom: 1px solid var(--line); padding: 6px 0; }
.dashas summary { cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.dashas summary .dates { margin-left: auto; color: var(--ink-2); font-size: var(--fs-xs); white-space: nowrap; }
.dashas summary .yrs { color: var(--ink-3); font-size: var(--fs-xs); width: 4em; text-align: right; white-space: nowrap; }
.dashas details.on > summary strong { color: var(--saffron); }
.dashas ul { list-style: none; margin: 6px 0 4px; padding: 0 0 0 12px; display: grid; gap: 2px; font-size: 14.5px; }
.dashas li { display: flex; justify-content: space-between; gap: 8px; }
.dashas li .muted { white-space: nowrap; }
.dashas li.on { color: var(--saffron); font-weight: 600; }
.sb { display: grid; gap: 8px; }
.sb-row { display: grid; grid-template-columns: 5.5em 1fr 7em; gap: 8px; align-items: center; font-size: var(--fs-xs); }
.sb-bar { position: relative; height: 12px; background: var(--panel-2); border-radius: 6px; overflow: hidden; }
.sb-bar span { display: block; height: 100%; background: var(--viz-series); border-radius: 0 4px 4px 0; }
.sb-low { color: var(--ink); font-size: var(--fs-xs); font-weight: 600; margin-left: 4px; }
.sb-bar i { position: absolute; top: -2px; bottom: -2px; width: 2px; margin-left: -1px; background: var(--ink); }
table.av { font-size: var(--fs-xs); }
table.av th.lag { color: var(--saffron); }
table.av td.av-0, table.av td.av-1 { background: transparent; }
table.av td.av-2 { background: color-mix(in srgb, var(--viz-seq-1) 35%, transparent); }
table.av td.av-3 { background: color-mix(in srgb, var(--viz-seq-1) 70%, transparent); }
table.av td.av-4 { background: color-mix(in srgb, var(--viz-seq-2) 70%, transparent); }
table.av td.av-5 { background: color-mix(in srgb, var(--viz-seq-3) 60%, transparent); }
table.av td.av-6 { background: color-mix(in srgb, var(--viz-seq-3) 85%, transparent); }
table.av td.av-7, table.av td.av-8 { background: var(--viz-seq-4); color: var(--viz-seq-ink); font-weight: 600; }
table.av tr.sav td.good { text-decoration: underline 2px var(--viz-seq-3); text-underline-offset: 4px; }
table.av tr.sav td { border-top: 2px solid var(--line); font-weight: 600; }
.yogas { display: grid; gap: 8px; }
.yoga { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.yoga summary { cursor: pointer; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.yoga p { margin: 8px 0 0; }

/* Jaal 3D stage (vendor/jaal via site/js/jaal-panel.js) */
.jaal-switch { margin: 0 0 10px; }
.jaal-stage { position: relative; overflow: hidden; border-radius: 12px; background: var(--bg); border: 1px solid var(--line); margin: 8px 0; }
.jaal-host, .jaal-labels { position: absolute; inset: 0; }
.jaal-labels { pointer-events: none; overflow: hidden; }
.jaal-host canvas { cursor: grab; }
/* Jaal writes its 3D labels with inline styles at 11.5px (vendor/jaal/lib/jaal/render/chart3d.ts); the floor wins here */
.jaal-labels > * { font-size: var(--fs-xs) !important; }
.jaal-tip { position: absolute; left: 0; top: 0; z-index: 2; max-width: 14rem; pointer-events: none; font-size: var(--fs-xs); padding: 6px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); color: var(--ink); }
.jaal-msg { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: 16px; text-align: center; color: var(--ink-3); font-size: 14px; }
.legend { font-size: var(--fs-xs); color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 6px 0; }
.lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.lg-pos { background: var(--viz-pos); } .lg-neg { background: var(--viz-neg); }
.yoga-family { font-size: 15px; text-transform: capitalize; color: var(--ink-2); margin: 14px 0 4px; font-family: var(--sans); font-weight: 600; letter-spacing: .02em; }

/* India place search */
.place-pick { position: relative; display: grid; gap: 4px; font-size: var(--fs-xs); color: var(--ink-3); }
.place-pick input { width: 100%; }
.place-results { position: absolute; z-index: 30; left: 0; right: 0; top: 100%; margin: 4px 0 0; padding: 4px; list-style: none; max-height: 320px; overflow: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.place-results li { padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--ink); font-size: 14.5px; }
.place-results li[aria-selected="true"], .place-results li:hover { background: color-mix(in srgb, var(--gold) 16%, transparent); }
.place-results li.hint { cursor: default; color: var(--ink-3); background: none; }
.place-results li .muted { font-size: var(--fs-xs); }
.place-results li .coords { float: right; color: var(--ink-3); margin-left: 8px; font-size: var(--fs-xs); white-space: nowrap; }
.place-results li .addr { display: block; color: var(--ink-2); font-size: var(--fs-xs); margin-top: 2px; }
.place-results li .local { color: var(--ink-2); }
.k-title { margin: 8px 0 2px; }

/* Languages */
.lang-pick select { padding: 5px 8px; font-size: 14px; border-radius: 999px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lang-draft { max-width: 1180px; margin: 10px auto 0; padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); color: var(--ink-2); font-size: var(--fs-xs); }
@media (max-width: 640px) { .lang-pick { order: 2; } }

/* Doshas: calm, checkable, nothing to buy */
.scam-box { border: 1px solid var(--line); border-left: 3px solid var(--teal); border-radius: 12px; background: var(--panel); padding: 12px 16px; margin: 12px 0; }
.scam-box p { margin: 6px 0 0; color: var(--ink-2); font-size: 14.5px; }
.doshas { display: grid; gap: 10px; margin: 12px 0; }
.dosha-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; }
.dosha-card summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dosha-card h3 { margin: 14px 0 4px; font-size: 15.5px; font-family: var(--sans); font-weight: 600; }
.dosha-card .dv { border-top: 1px solid var(--line); margin-top: 10px; }
.rate { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin: 6px 0; }
.rate p { margin: 0; flex: 1 1 220px; font-size: 14.5px; }
.icon-grid { display: grid; grid-template-columns: repeat(10, 9px); gap: 2px; }
.icon-grid i { width: 9px; height: 9px; border-radius: 2px; background: var(--panel-2); border: 1px solid var(--line); }
.icon-grid i.on { background: var(--viz-series); border-color: var(--viz-series); }
.dres { list-style: none; padding: 0; margin: 4px 0; display: grid; gap: 2px; font-size: 14.5px; }
.dres li { color: var(--ink-2); }
.dres li.meets { color: var(--ink); font-weight: 600; }
.cancels ul { list-style: none; padding: 0; display: grid; gap: 8px; }
.cancels li { font-size: 14.5px; }
.ctag { display: inline-block; font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); margin-right: 4px; }
.ctag.yes { border-color: var(--teal); color: var(--teal); }
.ctag.no { color: var(--ink-3); }
.ctag.na { color: var(--ink-3); border-style: dashed; }
.practices ul { margin: 6px 0 0; padding-left: 18px; display: grid; gap: 4px; font-size: 14.5px; }

/* ---- Temple dawn motifs (the toran, the kumkum brand and the saffron kickers are in their base rules above) ------------ */
main h2::before { content: ""; display: inline-block; width: 30px; height: 18px; margin-right: 8px; vertical-align: -2px;
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D'http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg'%20viewBox%3D'0%200%2044%2026'%3E%20%3Cpath%20d%3D'M22%202%20C16%209%2016%2017%2022%2024%20C28%2017%2028%209%2022%202Z'%20fill%3D'%23d9577a'%2F%3E%20%3Cpath%20d%3D'M22%2024%20C14%2022%209%2015%208%207%20C14%2010%2019%2015%2022%2024Z'%20fill%3D'%23e88aa2'%2F%3E%3Cpath%20d%3D'M22%2024%20C30%2022%2035%2015%2036%207%20C30%2010%2025%2015%2022%2024Z'%20fill%3D'%23e88aa2'%2F%3E%20%3Cpath%20d%3D'M22%2024%20C12%2025%204%2021%201%2015%20C9%2015%2016%2018%2022%2024Z'%20fill%3D'%23f2b8c6'%2F%3E%3Cpath%20d%3D'M22%2024%20C32%2025%2040%2021%2043%2015%20C35%2015%2028%2018%2022%2024Z'%20fill%3D'%23f2b8c6'%2F%3E%20%3C%2Fsvg%3E") no-repeat center / contain; }
.prose h2::before { margin-left: 0; }
.panel, .limb, .feature, .card, .dosha-card, .yoga, .feature-paper, .scam-box, .charter-list li, .kform {
  background: var(--panel); border-color: var(--line); box-shadow: 0 1px 0 var(--hi) inset, var(--shadow); }
.panel, .limb, .feature, .card, .dosha-card { border-width: 1px; border-style: solid;
  background-image: linear-gradient(180deg, color-mix(in srgb, var(--hi) 55%, transparent), transparent 40%); }

/* ---- The sage: a rishi in meditation at the top of every page, with today's teaching ---------------------------------- */
.sage { max-width: 1180px; margin: 10px auto 0; padding: 0 clamp(12px, 4vw, 40px); display: flex; align-items: center; gap: 14px; }
.sage-figure { flex: 0 0 auto; width: 72px; height: 72px; }
.sage-figure svg { width: 100%; height: 100%; display: block; overflow: visible; }
.sage-bubble { position: relative; flex: 1; margin: 0; background: var(--panel); border: 1px solid var(--border-gold); border-radius: 16px;
  padding: 12px 16px; box-shadow: var(--shadow); }
.sage-bubble::before { content: ""; position: absolute; left: -9px; top: 50%; width: 16px; height: 16px; transform: translateY(-50%) rotate(45deg);
  background: var(--panel); border-left: 1px solid var(--border-gold); border-bottom: 1px solid var(--border-gold); }
.sage-bubble .sage-k { margin: 0 0 2px; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; color: var(--saffron); font-weight: 700; }
.sage-bubble blockquote { margin: 0; font: italic 17px/1.45 var(--serif); color: var(--ink); }
.sage-acts { display: flex; flex-wrap: wrap; gap: 4px 18px; margin: 4px 0 0; }
.sage-bubble .sage-acts button.sage-close { color: var(--ink-3); }
.sage-bubble .sage-orig { margin: 2px 0 6px; font: 16px/1.6 "Nirmala UI", "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Tamil", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Bengali", "Noto Sans Gujarati", serif; color: var(--gold); }
.sage-bubble figcaption { margin-top: 6px; font-size: var(--fs-xs); color: var(--ink-3); }
.sage-bubble button { margin-top: 4px; padding: 4px 0; min-height: 0; font-size: 14px; font-weight: 600; background: none; border: 0; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sg-aura { transform-origin: 80px 70px; animation: sg-aura 6s ease-in-out infinite; }
.sg-body { transform-origin: 80px 150px; animation: sg-breathe 5.5s ease-in-out infinite; }
.sg-flame { transform-box: fill-box; transform-origin: 50% 100%; animation: sg-flicker 1.7s ease-in-out infinite; }
.sg-om { animation: sg-float 7s ease-in-out infinite; }
@keyframes sg-aura { 0%, 100% { opacity: .7; transform: scale(1); } 50% { opacity: 1; transform: scale(1.07); } }
@keyframes sg-breathe { 0%, 100% { transform: scaleY(1); } 45% { transform: scaleY(1.022); } }
@keyframes sg-flicker { 0%, 100% { transform: scale(1, 1) rotate(0deg); } 25% { transform: scale(.92, 1.08) rotate(-3deg); } 60% { transform: scale(1.05, .94) rotate(2deg); } }
@keyframes sg-float { 0%, 100% { transform: translateY(0); opacity: .65; } 50% { transform: translateY(-5px); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sg-aura, .sg-body, .sg-flame, .sg-om { animation: none; } }

/* ---- Phone tab bar ----------------------------------------------------------------------------------------------------- */
.tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; justify-content: space-around; gap: 2px;
  background: color-mix(in srgb, var(--panel) 96%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border-gold);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); box-shadow: 0 -6px 18px color-mix(in srgb, var(--ink) 10%, transparent); }
.tabbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 60px; min-height: 50px;
  padding: 2px 4px; color: var(--ink-3); font-size: var(--fs-xs); line-height: 1.2; font-weight: 600; text-decoration: none; border-radius: 14px; }
.tabbar a[aria-current="page"] { color: var(--gold); background: color-mix(in srgb, var(--fill) 24%, transparent); }

/* ---- Kundli jump chips --------------------------------------------------------------------------------------------- */
.k-chips { position: sticky; top: var(--header-h, 64px); z-index: 15; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none;
  margin: 8px -4px 10px; padding: 8px 4px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); }
.k-chips a { flex: 0 0 auto; padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border-gold); background: var(--panel);
  color: var(--ink-2); font-size: 14.5px; font-weight: 600; text-decoration: none; min-height: 40px; display: inline-flex; align-items: center; }
.k-chips a:hover, .k-chips a:focus-visible { color: var(--gold); }

/* ---- Phones: one-row header, the tab bar, thumb-sized targets, readable text ----------------------------------------- */
@media (max-width: 760px) {
  :root { --header-h: 76px; }
  html { scroll-padding-top: 140px; }
  .top { flex-wrap: nowrap; padding: 8px 14px 28px; background-size: 52px 21px; }
  .top nav { display: none; }
  .brand small { font-size: var(--fs-xs); }
  .tabbar { display: flex; }
  body { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
  .foot { margin-bottom: 0; }
  main { padding: 14px 16px; }
  th, td { padding: 7px 6px; } /* four columns of numbers fit a phone at the 14px floor */
  h1 { font-size: clamp(28px, 8vw, 38px); }
  .note, .lede, .card span, .feature p, .principle span, .limb .s, .dres, .cancels li, .practices ul, .scam-box p { font-size: var(--fs-s); }
  input, select, button, .seg button, .lang-pick select { min-height: 44px; font-size: 16px; }
  .controls label, .controls select { max-width: 100%; min-width: 0; }
  .controls select { width: 100%; }
  .controls label:first-child { flex: 1 1 100%; }
  .sage-bubble button { min-height: 32px; }
  summary { min-height: 44px; display: flex; align-items: center; }
  .dashas summary { flex-wrap: wrap; row-gap: 2px; }
  .dashas li { min-height: 32px; align-items: center; }
  .sage { gap: 8px; margin-top: 6px; }
  .sage-figure { width: 52px; height: 54px; margin-left: -4px; }
  .sage-bubble { padding: 10px 12px; }
  .sage-bubble::before { display: none; }
  /* Brand, search, theme and language on one row: the language menu gives way */
  .top { gap: 6px; }
  .top-search { margin-left: auto; }
  .lang-pick select { max-width: 104px; padding-left: 10px; padding-right: 4px; }
  .sage-bubble blockquote { font-size: 16px; }
  /* Home: today's panchanga straight after the headline; the wheel after it; the long introduction on wider screens only */
  main:has(> .hero) { display: flex; flex-direction: column; }
  main:has(> .hero) > .hero { display: contents; }
  main:has(> .hero) > .hero > div:first-child { order: 1; }
  main:has(> .hero) > section[aria-labelledby="pan-h"] { order: 2; }
  main:has(> .hero) > .hero > div:last-child { order: 3; }
  main:has(> .hero) > section:not(.hero):not([aria-labelledby="pan-h"]) { order: 4; }
  .hero .lede { display: none; }
  .limbs { grid-template-columns: 1fr 1fr; }
  .limb .v { font-size: 19px; }
  .limb:first-child { grid-column: 1 / -1; }
}
@media (pointer: coarse) { .top nav a, .k-chips a { min-height: 44px; } }

/* ---- Calendar ----------------------------------------------------------------------------------------------------------- */
.cal-place { display: grid; gap: 6px; justify-items: center; text-align: center; }
.cal-place-row { margin: 4px 0 0; max-width: 100%; }
.cal-place-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; max-width: 100%; padding: 8px 16px 8px 14px; border-radius: 999px;
  border: 1px solid var(--border-gold); background: color-mix(in srgb, var(--panel) 85%, transparent); color: var(--ink);
  font: 600 16px/1.2 var(--sans); white-space: nowrap; box-shadow: none; cursor: pointer; }
.cal-place-btn svg { color: var(--gold); flex: none; }
.cal-place-btn .cal-chev { color: var(--ink-3); transition: none; }
.cal-place-btn[aria-expanded="true"] .cal-chev { transform: rotate(180deg); }
.cal-place-btn #cal-place-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.cal-place-btn:hover { border-color: var(--gold); }
.cal-place-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.cal-picked { margin: 0; }
.cal-place-form { display: grid; gap: 10px; width: 100%; text-align: left; justify-self: stretch; }
.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 18px; }
.cal-head { text-align: center; flex: 1; min-width: 0; }
.cal-head h2 { margin: 0; }
.cal-head h2::before { display: none; }
.cal-head .note { margin: 2px 0 0; }
.cal-nav { width: 44px; height: 44px; border-radius: 50%; font-size: 24px; line-height: 1; padding: 0; background: var(--panel); border: 1px solid var(--border-gold); color: var(--gold); }
.cal-today { display: block; margin: 8px auto 10px; padding: 6px 16px; border-radius: 999px; background: var(--panel); border: 1px solid var(--border-gold); color: var(--gold); font-weight: 600; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-wd { text-align: center; font-size: var(--fs-xs); font-weight: 700; color: var(--saffron); padding: 4px 0; text-transform: uppercase; letter-spacing: .04em; }
.cal-cell { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 92px; padding: 6px 2px 6px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--line); color: var(--ink); font: inherit; text-align: center; cursor: pointer; min-width: 0; }
.cal-cell.cal-empty { background: transparent; border-color: transparent; cursor: default; }
.cal-cell[aria-pressed="true"] { border: 2px solid var(--gold); padding: 5px 1px; background: color-mix(in srgb, var(--fill) 16%, var(--panel)); }
.cal-cell.cal-is-today .cal-n { background: var(--gold); color: var(--on-accent); border-radius: 999px; padding: 0 7px; }
.cal-n { font-weight: 700; font-size: 16px; line-height: 1.4; }
/* A cell's words: the tithi, the nakshatra and a festival (each cut with an ellipsis rather than shrunk); on phones the cell
   keeps the date, the Moon and the dots, and the words wait in the day's detail (below) */
.cal-t, .cal-k, .cal-f { font-size: var(--fs-xs); line-height: 1.25; color: var(--ink-2); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-k { color: var(--ink-3); }
.cal-moon { width: 16px; height: 16px; }
.cal-moon-dark { fill: color-mix(in srgb, var(--ink) 18%, var(--panel)); stroke: color-mix(in srgb, var(--ink) 30%, transparent); stroke-width: .6; }
.cal-moon-lit { fill: #f6d77a; }
.cal-full { background: color-mix(in srgb, #f6d77a 22%, var(--panel)); }
.cal-new { background: color-mix(in srgb, var(--ink) 8%, var(--panel)); }
.cal-ekadashi .cal-t { color: var(--saffron); font-weight: 700; }
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.cal-cell .cal-dot { position: absolute; top: 6px; right: 6px; }
.cal-cell .cal-dot-v { right: 16px; }
.cal-dot-k { background: var(--gold); }
.cal-dot-v { background: var(--fill-2); }
.cal-key { margin-top: 10px; }
.cal-day { margin-top: 16px; }
.cal-day h2 { margin-top: 0; }
.cal-day h2::before { display: none; }
.cal-hindu { font: 600 18px/1.4 var(--serif); color: var(--gold); margin: 0 0 6px; }
.cal-dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 12px 0; }
.cal-dl div { margin: 0; }
.cal-dl .wide { grid-column: 1 / -1; }
.cal-dl dt { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--saffron); }
.cal-dl dd { margin: 2px 0 0; font-size: 16px; line-height: 1.5; }
@media (max-width: 760px) {
  /* Phones: the date, the Moon in its phase and the dots; the tithi, nakshatra and festival names are in the day's detail */
  .cal-grid { gap: 3px; margin: 0 -8px; }
  .cal-cell { min-height: 60px; padding: 6px 1px 4px; gap: 4px; border-radius: 8px; }
  .cal-cell[aria-pressed="true"] { padding: 5px 0 3px; }
  .cal-n { font-size: var(--fs-s); }
  .cal-t, .cal-k, .cal-f { display: none; }
  .cal-moon { width: 18px; height: 18px; }
  .cal-cell .cal-dot { top: 4px; right: 4px; width: 7px; height: 7px; }
  .cal-cell .cal-dot-v { right: 13px; }
  .cal-fest::after { left: 4px; top: 4px; width: 7px; height: 7px; }
}

/* ---- More ------------------------------------------------------------------------------------------------------------- */
.more-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.more-list a { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line);
  box-shadow: var(--shadow); color: var(--ink); text-decoration: none; min-height: 44px; }
.more-list a:hover, .more-list a:focus-visible { border-color: var(--border-gold); }
.more-list b { font: 600 19px/1.3 var(--serif); color: var(--gold); }
.more-list span { font-size: 15px; color: var(--ink-2); }

/* ---- Saved charts ------------------------------------------------------------------------------------------------------ */
.k-open { margin: 10px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 15px; }
.file-btn { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border-gold); background: var(--panel); color: var(--gold); font-weight: 600; cursor: pointer; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--gold); outline-offset: 2px; }
.k-record { margin-top: 18px; }
.foot-c { font-size: var(--fs-xs); color: var(--ink-3); }
.sage-bubble .sage-en { margin: 6px 0 0; font: italic 15.5px/1.45 var(--serif); color: var(--ink-2); }
.sage-bubble .sage-draft { margin: 6px 0 0; font-size: var(--fs-xs); color: var(--ink-3); }
.sage-bubble .sage-link { background: none; border: 0; padding: 0; min-height: 0; font: inherit; font-weight: 600; color: var(--gold); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.sage-bubble blockquote:lang(te), .sage-bubble blockquote:lang(kn), .sage-bubble blockquote:lang(ta), .sage-bubble blockquote:lang(ml), .sage-bubble blockquote:lang(hi), .sage-bubble blockquote:lang(mr), .sage-bubble blockquote:lang(bn), .sage-bubble blockquote:lang(gu) { font-style: normal; line-height: 1.6; }

/* ---- The day's timings ------------------------------------------------------------------------------------------------- */
.tm { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.tm h3 { margin: 0 0 8px; }
.tm-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.tm-list li { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 2px 10px; padding: 8px 10px; border-radius: 10px; background: color-mix(in srgb, var(--fill) 7%, var(--panel)); }
.tm-k { font-weight: 600; }
.tm-t { text-align: right; }
.tm-src { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--ink-3); }
.tm-src summary { display: inline-block; cursor: pointer; min-height: 0; }
.tm-src summary::-webkit-details-marker { display: none; }
.tm-tag { font-size: var(--fs-xs); font-weight: 700; padding: 1px 9px; border-radius: 999px; border: 1px solid var(--line); }
.tm-classical { color: var(--gold); }
.tm-regional { color: var(--saffron); }
.tm-src[open] > span { display: block; margin-top: 4px; }

/* ---- Matching ---------------------------------------------------------------------------------------------------------- */
.mt-people { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 8px 0 12px; }
.mt-person { margin: 0; display: grid; gap: 10px; }
.mt-person legend { font: 600 18px/1.3 var(--serif); color: var(--gold); padding: 0 6px; }
.mt-star, .mt-birth { display: grid; gap: 8px; }
.mt-star { grid-template-columns: 1fr auto; }
.mt-totals { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.mt-total { background: var(--panel); border: 1px solid var(--border-gold); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); }
.mt-total-2 { border-color: var(--line); }
.mt-n { font: 700 34px/1.1 var(--serif); color: var(--gold); }
.mt-total-2 .mt-n { color: var(--ink-2); }
.mt-n small { font-size: 16px; color: var(--ink-3); }
.mt-l { font-size: 14px; color: var(--ink-2); margin-top: 2px; }
.mt-exc { margin-top: 12px; }
.mt-exc h3 { margin-top: 0; }
.mt-table td, .mt-table th { vertical-align: top; }
.mt-sum th, .mt-sum td { border-top: 2px solid var(--border-gold); }
.mt-dp { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; }
.mt-dp li { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.mt-dp-k { font-weight: 600; }
.mt-dp-x { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--ink-3); }
.mt-chip { font-size: var(--fs-xs); font-weight: 700; padding: 2px 9px; white-space: nowrap; border-radius: 999px; border: 1px solid var(--line); }
.mt-dp-yes .mt-chip, .mt-dp-neutral .mt-chip { color: var(--good); border-color: var(--good-line); }
.mt-dp-no .mt-chip { color: var(--gold); border-color: var(--border-gold); }
.mt-dp-excused .mt-chip, .mt-dp-partial .mt-chip, .mt-dp-unstated .mt-chip { color: var(--ink-3); }
.mt-evidence { margin-top: 18px; }
.mt-evidence h2 { margin-top: 0; }
@media (max-width: 760px) {
  .mt-people { grid-template-columns: 1fr; }
  .mt-n { font-size: 28px; }
  /* The ashtakoota table as one card per koota: its name and the classical score, what it compares, the websites' score */
  .mt-wrap { border: 0; border-radius: 0; overflow: visible; }
  .mt-table, .mt-table tbody { display: block; }
  .mt-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .mt-table tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "k c" "x x" "w w"; gap: 4px 12px;
    padding: 12px 14px; margin: 0 0 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; align-items: baseline; }
  .mt-table th, .mt-table td { display: block; padding: 0; border: 0; background: none; }
  .mt-table tbody th { grid-area: k; font-size: var(--fs-m); text-transform: none; letter-spacing: 0; color: var(--ink); }
  .mt-table td:nth-child(2) { grid-area: x; color: var(--ink-2); font-size: var(--fs-s); }
  .mt-table td:nth-child(2):empty { display: none; }
  .mt-table td:nth-child(3) { grid-area: c; }
  .mt-table td:nth-child(4) { grid-area: w; text-align: left; color: var(--ink-2); }
  .mt-table td[data-label]::before { content: attr(data-label) " "; color: var(--ink-3); font-weight: 400; }
  .mt-sum th, .mt-sum td { border-top: 0; }
  .mt-table tr.mt-sum { border: 2px solid var(--border-gold); }
}

/* ---- Names ------------------------------------------------------------------------------------------------------------- */
.nm-form { display: grid; gap: 10px; }
.nm-birth, .nm-star { display: grid; gap: 8px; }
.nm-result { margin-top: 16px; }
.nm-big { display: flex; align-items: baseline; gap: 16px; padding: 16px 18px; border-radius: 16px; background: var(--panel); border: 1px solid var(--border-gold); box-shadow: var(--shadow); }
.nm-syl { font: 700 64px/1 "Nirmala UI", "Noto Sans Devanagari", "Noto Sans Telugu", "Noto Sans Kannada", "Noto Sans Malayalam", "Noto Sans Bengali", "Noto Sans Gujarati", serif; color: var(--gold); }
.nm-simple { font: 600 26px/1 var(--serif); color: var(--ink-2); }
.nm-where { font: 600 18px/1.4 var(--serif); margin: 10px 0 4px; }
.nm-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; }
.nm-grid-9 { grid-template-columns: repeat(9, minmax(0, 1fr)); }
.nm-cell { display: flex; flex-direction: column; align-items: center; padding: 8px 2px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.nm-cell b { font: 600 22px/1.2 "Nirmala UI", "Noto Sans Devanagari", "Noto Sans Telugu", serif; }
.nm-cell small { font-size: var(--fs-xs); color: var(--ink-3); }
.nm-on { border: 2px solid var(--gold); background: color-mix(in srgb, var(--fill) 16%, var(--panel)); }
.nm-history { margin-top: 24px; }
@media (max-width: 760px) {
  .nm-grid-9 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .nm-syl { font-size: 54px; }
}

/* ---- Festivals on the calendar ------------------------------------------------------------------------------------------ */
.cal-f { color: var(--gold); font-weight: 700; } /* size and cut with .cal-t above */
.cal-fest::after { content: ""; position: absolute; left: 6px; top: 6px; width: 7px; height: 7px; border-radius: 50%; background: var(--fill-2); }
.fs { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; }
.fs h3 { margin: 0 0 8px; }
.fs-classical { color: var(--gold); }
.fs-custom, .fs-convention { color: var(--saffron); }

/* ---- Eclipses ---------------------------------------------------------------------------------------------------------- */
.cal-ecl { margin-top: 20px; }
.ec-card { margin: 10px 0; }
.ec-card h3 { margin: 0 0 4px; }
.ec-vis { font-weight: 700; margin: 0 0 6px; }
.ec-yes { color: var(--gold); }
.ec-no { color: var(--ink-3); }
.ec-trad { margin-top: 6px; }
.cal-eclipse { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--ink) 55%, transparent); }
.cal-eclipse .cal-n::after { content: " ◐"; font-size: var(--fs-xs); }

/* ---- Protect ----------------------------------------------------------------------------------------------------------- */
.pr ol, .pr ul { padding-left: 1.3em; }
.pr li { margin: 6px 0; }
.more-list .more-protect { border-color: var(--border-gold); background: color-mix(in srgb, var(--fill) 10%, var(--panel)); }

/* ---- How it was calculated -------------------------------------------------------------------------------------------- */
.calc { margin-top: 12px; }
.calc summary { font-weight: 700; color: var(--gold); cursor: pointer; }
.calc-t th { text-align: left; font-weight: 600; white-space: nowrap; padding-right: 12px; vertical-align: top; }
.calc-t td { font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .calc-t th { white-space: normal; } .calc-t td { font-size: 14px; } }
/* The course: chapter list and previous/next links */
.course-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 10px; counter-reset: none; }
.course-list li a { display: grid; gap: 4px; text-decoration: none; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.course-list li a:hover { border-color: var(--gold); }
.course-list strong { font: 600 18px/1.25 var(--serif); }
.course-list span { color: var(--ink-2); font-size: 14.5px; }
.course-list small { color: var(--ink-3); }
.course-nav { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; margin: 40px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.course-nav a { display: grid; gap: 2px; text-decoration: none; color: var(--ink); font-weight: 600; }
.course-nav a:last-child { text-align: right; }
.course-nav a:nth-child(2) { text-align: center; }
.course-nav small { color: var(--ink-3); font-weight: 400; }
@media (max-width: 640px) { .course-nav { grid-template-columns: 1fr; } .course-nav a, .course-nav a:last-child, .course-nav a:nth-child(2) { text-align: left; } }
.chart-figure { margin: 18px 0; display: grid; justify-items: center; gap: 8px; color: var(--ink); }
.chart-figure figcaption { color: var(--ink-3); font-size: var(--fs-xs); max-width: 520px; text-align: center; }
/* A chart drawn in a chapter's markdown sets font-size="12" on its words; the stylesheet wins over that attribute */
.chart-figure svg { max-width: 100%; height: auto; }
.chart-figure svg text { font-size: var(--fs-s); }

/* Search: the header icon and the /search/ page */
.top-search { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 999px; color: var(--ink-2); flex: none; }
.top-search:hover, .top-search[aria-current="page"] { color: var(--on-fill); background: var(--fill); }
.top-theme { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--ink-2); flex: none; }
.top-theme:hover { color: var(--on-fill); background: var(--fill); }
.top-theme .th-sun { display: none; }
[data-night="on"] .top-theme .th-sun { display: inline; }
[data-night="on"] .top-theme .th-moon { display: none; }
@media (max-width: 640px) { .top-theme { order: 2; } }
@media (max-width: 760px) { .top-theme { width: 44px; height: 44px; min-height: 44px; } }
@media (max-width: 640px) { .top-search { order: 2; margin-left: auto; } }
@media (max-width: 760px) { .top-search { width: 44px; height: 44px; } }
.search-form { display: flex; gap: 8px; margin: 4px 0 6px; }
.search-form input { flex: 1; min-width: 0; padding: 10px 14px; font-size: 17px; border-radius: 999px; }
.search-status { color: var(--ink-2); margin: 14px 0 6px; }
.search-results { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.search-hit { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.search-page { display: block; font: 600 18px/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.search-page small { display: block; font: 500 var(--fs-xs)/1.4 var(--sans); letter-spacing: .03em; text-transform: uppercase; color: var(--ink-3); }
.search-hit ul { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.search-hit ul a { display: block; text-decoration: none; color: var(--ink-2); font-size: 14.5px; border-left: 2px solid var(--line); padding-left: 10px; }
.search-hit ul a:hover { border-left-color: var(--gold); }
.search-hit ul b { display: block; color: var(--gold); font-weight: 600; }
.search-hit mark { background: color-mix(in srgb, var(--fill) 45%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Kundli: now, and this year */
.tr-table .good, .vp .good { color: var(--teal); font-weight: 600; }
.vp { display: grid; gap: 8px; margin: 8px 0; }
.vp div { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 10px; }
.vp dt { color: var(--ink-3); }
.vp dd { margin: 0; }
@media (max-width: 480px) { .vp div { grid-template-columns: 1fr; gap: 0; } }

/* Five birds (Pancha Pakshi) */
.pk-form .check { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.pk-form .check input { min-height: auto; margin-top: 4px; }
.pk-when { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.pk-table td, .pk-table th { white-space: nowrap; }
.pk-table th.pk-mine, .pk-table td[data-mine] { background: color-mix(in srgb, var(--fill) 22%, transparent); font-weight: 600; }
.pk-table .pk-rule, .pk-table .pk-eat { color: var(--teal); }
.pk-table .pk-die { color: var(--rose); }
.pk-table tr.pk-night td { background-color: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.pk-table tr.pk-now td { outline: 2px solid var(--gold); outline-offset: -2px; }
.pk-warn { border-left: 3px solid var(--rose); padding: 6px 10px; background: var(--panel); }
@media (max-width: 760px) {
  /* One card per period: its name and time, your bird's state across the top, then the other four birds two by two */
  .pk-wrap { border: 0; border-radius: 0; overflow: visible; }
  .pk-table, .pk-table tbody { display: block; }
  .pk-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .pk-table tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 12px; padding: 10px 12px; margin: 0 0 8px;
    background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
  .pk-table td { display: block; padding: 0; border: 0; white-space: normal; min-width: 0; }
  .pk-table td:first-child { font-weight: 600; }
  .pk-table td.num { text-align: right; }
  .pk-table td[data-mine] { grid-column: 1 / -1; padding: 4px 8px; border-radius: 8px; }
  .pk-table td[data-label]::before { content: attr(data-label) " "; color: var(--ink-3); font-weight: 400; }
  .pk-table tr.pk-night { background: color-mix(in srgb, var(--panel-2) 60%, var(--panel)); }
  .pk-table tr.pk-night td { background-color: transparent; }
  .pk-table tr.pk-night td[data-mine] { background: color-mix(in srgb, var(--fill) 22%, transparent); }
  .pk-table tr.pk-now { outline: 2px solid var(--gold); outline-offset: -2px; }
  .pk-table tr.pk-now td { outline: 0; }
}

/* ---- Night: the sky instead of the paper ------------------------------------------------------------------------------
   Faint stars in place of the kolam dots, a deep violet glow where the dawn was, and a quiet header without the toran. */
[data-night="on"] body {
  background-image:
    radial-gradient(1px 1px at 12% 18%, rgba(255, 255, 255, .55), transparent 60%),
    radial-gradient(1px 1px at 68% 7%, rgba(255, 255, 255, .45), transparent 60%),
    radial-gradient(1.4px 1.4px at 83% 31%, rgba(255, 236, 200, .6), transparent 60%),
    radial-gradient(1px 1px at 37% 44%, rgba(255, 255, 255, .35), transparent 60%),
    radial-gradient(1px 1px at 91% 72%, rgba(255, 255, 255, .4), transparent 60%),
    radial-gradient(1.2px 1.2px at 23% 81%, rgba(220, 230, 255, .45), transparent 60%),
    radial-gradient(1px 1px at 55% 63%, rgba(255, 255, 255, .3), transparent 60%),
    radial-gradient(1100px 560px at 50% -14%, rgba(92, 70, 190, .30), transparent 70%);
  background-size: 380px 380px, 380px 380px, 380px 380px, 380px 380px, 380px 380px, 380px 380px, 380px 380px, 100% 100%;
  background-attachment: fixed;
}
[data-night="on"] .top { background-image: none; padding-bottom: 12px; border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  background-color: color-mix(in srgb, var(--bg) 78%, transparent); }
@media (max-width: 760px) { [data-night="on"] .top { padding-bottom: 8px; } }
[data-night="on"] main h2::before { opacity: .8; }
[data-night="on"] .panel, [data-night="on"] .limb, [data-night="on"] .feature, [data-night="on"] .card, [data-night="on"] .dosha-card { background-image: none; }
[data-night="on"] .tabbar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-top-color: var(--line); }
[data-night="on"] .tabbar a[aria-current="page"] { color: var(--gold); background: color-mix(in srgb, var(--gold) 14%, transparent); }
[data-night="on"] .top nav a[aria-current="page"] { color: var(--on-fill); background: var(--gold); }
[data-night="on"] .cal-moon-dark { fill: #222b55; stroke: #3a4680; }
[data-night="on"] .cal-full { background: color-mix(in srgb, #f6d77a 12%, var(--panel)); }
[data-night="on"] .search-hit mark { background: color-mix(in srgb, var(--fill) 35%, transparent); }
@media (prefers-reduced-motion: no-preference) { body { transition: background-color .35s var(--ease), color .35s var(--ease); } }

/* ---- The teaching, folded: one line until "Read" opens it (it never pushes a page's hero below the fold) --------------- */
.sage-more { flex: none; align-self: center; min-height: 36px; padding: 4px 14px; border-radius: 999px; border: 1px solid var(--border-gold); background: var(--panel); color: var(--gold); font-weight: 600; font-size: 15px; }
.sage:not(.open) { gap: 10px; }
.sage:not(.open) .sage-figure { width: 40px; height: 40px; }
.sage:not(.open) .sage-bubble { display: flex; align-items: baseline; gap: 10px; min-width: 0; padding: 8px 16px; border-radius: 999px; box-shadow: none; }
.sage:not(.open) .sage-bubble::before { display: none; }
.sage:not(.open) .sage-bubble .sage-k { flex: none; margin: 0; }
.sage:not(.open) .sage-bubble blockquote { flex: 1; min-width: 0; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.sage:not(.open) .sage-orig, .sage:not(.open) .sage-bubble figcaption, .sage:not(.open) .sage-acts { display: none; }
@media (max-width: 760px) {
  .sage:not(.open) .sage-figure { width: 32px; height: 32px; margin-left: 0; }
  .sage:not(.open) .sage-bubble { padding: 6px 12px; }
  .sage:not(.open) .sage-bubble .sage-k { display: none; }
  .sage-more { padding: 4px 12px; min-height: 40px; }
}

/* ---- The app shell: five sections, and the rest in the footer --------------------------------------------------------- */
.foot-links { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 14px; }
.foot-links a { color: var(--ink-2); text-decoration: none; font-weight: 600; min-height: 32px; display: inline-flex; align-items: center; }
.foot-links a:hover, .foot-links a[aria-current="page"] { color: var(--gold); text-decoration: underline; }
.learn-group h2.group { margin: 1.4em 0 .5em; }
.learn-group h2.group::before { display: none; }
.learn-group:first-of-type h2.group { margin-top: .6em; }
/* Installed as an app: no browser bar, so the tab bar and header respect the notch and the home indicator */
@media (display-mode: standalone) { .top { padding-top: max(8px, env(safe-area-inset-top)); } }
/* Desktop header: the brand, the five sections in the middle, and search, theme and language together on the right */
@media (min-width: 761px) { .top > nav { flex: 1; justify-content: center; } .top { justify-content: flex-start; } .top-search { margin-left: auto; } }

/* ---- Moving between pages -----------------------------------------------------------------------------------------------
   Every page is its own document, so the browser's cross-document view transitions carry the app feel: the header and the
   tab bar hold still, the highlighted section slides to the one tapped, and the page itself fades up. Browsers without it
   simply load the page. Nothing moves for readers who ask for reduced motion: all of it lives inside no-preference.
   The next page is fetched while the finger is still on the link (site/speculation-rules.json, sent as a header). */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  .top { view-transition-name: astro-top; }
  .tabbar { view-transition-name: astro-tabbar; }
  .tabbar a[aria-current="page"] { view-transition-name: astro-tab-on; }
  .top nav a[aria-current="page"] { view-transition-name: astro-nav-on; }
  ::view-transition-group(*) { animation-duration: .28s; animation-timing-function: var(--ease); }
  ::view-transition-old(astro-top), ::view-transition-new(astro-top),
  ::view-transition-old(astro-tabbar), ::view-transition-new(astro-tabbar) { animation: none; }
  ::view-transition-old(root) { animation: astro-page-out .16s var(--ease) both; }
  ::view-transition-new(root) { animation: astro-page-in .28s var(--ease) both; }
  @keyframes astro-page-out { to { opacity: 0; } }
  @keyframes astro-page-in { from { opacity: 0; transform: translateY(8px); } }
}

/* A narrow phone shows only the Latin name; the native-script name beside it follows the language. */
@media (max-width: 430px) { .brand small { display: none; } }

/* Feature cards that lead somewhere are links; on a phone the list is compact rows instead of boxes */
a.feature { display: block; color: inherit; text-decoration: none; }
a.feature h3 { color: var(--gold); }
a.feature h3::after { content: " \203A"; }
a.feature:hover { border-color: var(--border-gold); }
a.feature:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (max-width: 760px) {
  .features { gap: 0; margin: 8px 0 12px; }
  .feature { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 2px; }
  .feature h3 { margin: 0 0 4px; font-size: var(--fs-l); }
}

/* A timing that is over reads quieter; the one running now is outlined and badged (Today and Calendar) */
.tm-list .tmc-past .tm-k, .tm-list .tmc-past .tm-t { color: var(--ink-3); font-weight: 400; }
.tm-list .tmc-now { outline: 2px solid var(--gold); outline-offset: -2px; background: color-mix(in srgb, var(--fill) 16%, var(--panel)); }
.tmc-badge { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--fill); color: var(--on-fill); font: 700 var(--fs-xs)/1.6 var(--sans); letter-spacing: .04em; vertical-align: 1px; }
