/* saansar.com (MuseMesh Lab + Sansar), in the design language it had on mume.ai: mume-web's brand language (app/globals.css + components/ui, shadcn "neutral" on Tailwind v4)
   reproduced in plain CSS. Tokens are the same oklch values; light/dark follows next-themes' mechanism: a `dark` (or
   `light`) class on <html>, set from localStorage "theme" by the inline script in base.html, with prefers-color-scheme
   as the fallback when no class is set (no JS, or theme "system"). */

:root {
  color-scheme: light;
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  --secondary: oklch(0.97 0 0);
  --secondary-foreground: oklch(0.205 0 0);
  --muted: oklch(0.97 0 0);
  --muted-foreground: oklch(0.52 0 0);
  --accent: oklch(0.97 0 0);
  --accent-foreground: oklch(0.205 0 0);
  --destructive: oklch(0.577 0.245 27.325);
  --border: oklch(0.922 0 0);
  --input: oklch(0.922 0 0);
  --ring: oklch(0.708 0 0);
  /* Sansar's own accent: the saffron of chart-1, darkened to clear 4.5:1 as text on white. */
  --sansar: oklch(0.54 0.17 45);
  --sansar-soft: oklch(0.96 0.03 60);
  /* The Sansar mark (docs/brand/avagraha): the stroke and its star. Day: deeper saffron + saffron, both clear of a
     white or pale-sky ground; night: saffron + gold. */
  --mark-s: #c8501d;
  --mark-star: #e8642f;
  /* Chart roles (dataviz reference palette, validated light/dark): series-1 blue, series-2 orange, series-3 aqua. */
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --grid: oklch(0.93 0 0);
  --good: #0a7d0a;
  --good-bg: oklch(0.96 0.05 145);
  --warn: #8a5a00;
  --warn-bg: oklch(0.96 0.06 85);
  --bad: #b42323;
  --bad-bg: oklch(0.96 0.03 25);
  --info-bg: oklch(0.96 0.03 250);
  --info: #1c5cab;
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-header: 0 1px 3px rgba(0, 0, 0, 0.04);
  --sans: "Geist", "Geist Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --deva: "Tiro Devanagari Sanskrit", "Noto Serif Devanagari", "Kohinoor Devanagari", "Nirmala UI", serif;
  --container: 72rem;
  /* One card system for every card on the site: padding, title / label / number sizes. */
  --card-pad: 18px 20px;
  --card-gap: 12px;
  --card-title: 600 15px/1.35 var(--sans);
  --card-label: 400 12px/1.5 var(--sans);
  --card-num: 600 1.05rem/1.35 var(--sans);
  --card-num-lg: 600 1.75rem/1.2 var(--sans);
  --card-sub: 400 12.5px/1.5 var(--sans);
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    color-scheme: dark;
    --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0);
    --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0);
    --primary: oklch(0.922 0 0); --primary-foreground: oklch(0.205 0 0);
    --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0);
    --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.72 0 0);
    --accent: oklch(0.269 0 0); --accent-foreground: oklch(0.985 0 0);
    --destructive: oklch(0.704 0.191 22.216);
    --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0);
    --sansar: oklch(0.8 0.13 62); --sansar-soft: oklch(0.27 0.03 60);
    --mark-s: #e8642f; --mark-star: #ffbf5e;
    --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
    --grid: oklch(1 0 0 / 8%);
    --good: #5fd35f; --good-bg: oklch(0.3 0.06 145);
    --warn: #f3c25a; --warn-bg: oklch(0.32 0.06 85);
    --bad: #f08080; --bad-bg: oklch(0.32 0.07 25);
    --info: #8db9f2; --info-bg: oklch(0.3 0.05 250);
    --shadow-header: 0 1px 3px rgba(0, 0, 0, 0.3);
  }
}
:root.dark {
  color-scheme: dark;
  --background: oklch(0.145 0 0); --foreground: oklch(0.985 0 0);
  --card: oklch(0.205 0 0); --card-foreground: oklch(0.985 0 0);
  --primary: oklch(0.922 0 0); --primary-foreground: oklch(0.205 0 0);
  --secondary: oklch(0.269 0 0); --secondary-foreground: oklch(0.985 0 0);
  --muted: oklch(0.269 0 0); --muted-foreground: oklch(0.72 0 0);
  --accent: oklch(0.269 0 0); --accent-foreground: oklch(0.985 0 0);
  --destructive: oklch(0.704 0.191 22.216);
  --border: oklch(1 0 0 / 10%); --input: oklch(1 0 0 / 15%); --ring: oklch(0.556 0 0);
  --sansar: oklch(0.8 0.13 62); --sansar-soft: oklch(0.27 0.03 60);
    --mark-s: #e8642f; --mark-star: #ffbf5e;
  --series-1: #3987e5; --series-2: #d95926; --series-3: #199e70;
  --grid: oklch(1 0 0 / 8%);
  --good: #5fd35f; --good-bg: oklch(0.3 0.06 145);
  --warn: #f3c25a; --warn-bg: oklch(0.32 0.06 85);
  --bad: #f08080; --bad-bg: oklch(0.32 0.07 25);
  --info: #8db9f2; --info-bg: oklch(0.3 0.05 250);
  --shadow-header: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* ─── Base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; border-color: var(--border); }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; background: var(--background); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--background); color: var(--foreground);
  font: 400 15px/1.6 var(--sans); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
html.has-sky body { background: transparent; }
main { flex: 1 0 auto; width: 100%; }
a { color: inherit; text-underline-offset: 4px; }
p a, li a, .link { color: var(--foreground); text-decoration: underline; text-decoration-color: color-mix(in oklch, var(--foreground) 30%, transparent); }
p a:hover, li a:hover, .link:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { letter-spacing: -0.02em; line-height: 1.2; margin: 0; font-weight: 600; }
img, svg { max-width: 100%; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
* { scrollbar-width: thin; scrollbar-color: oklch(0.55 0 0 / 0.6) transparent; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -40px; z-index: 100; background: var(--primary); color: var(--primary-foreground); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }
.deva, [lang="sa"] { font-family: var(--deva); }
[lang="sa-Latn"] { font-family: var(--sans); font-style: italic; }
.num, td, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted-foreground); }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 48rem; }

/* ─── Sky mount point (static/sky/, merged later): full-bleed, behind everything, never interactive ─── */
.sky { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.sky:empty:not([data-sky-fallback]) { display: none; }   /* boot.inline.js paints the fallback before the engine */

/* ─── Header: StaticHeader (sticky, translucent, blurred, hairline) ─── */
.site-header { position: sticky; top: 0; z-index: 50; isolation: isolate; }
/* Progressive blur: frosted at the top, fading into the sky below the bar (no hard edge). */
.site-header::before {
  content: ""; position: absolute; inset: 0 0 -28px 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, color-mix(in oklch, var(--background) 78%, transparent) 0%,
              color-mix(in oklch, var(--background) 55%, transparent) 62%, transparent 100%);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
          mask-image: linear-gradient(to bottom, #000 0%, #000 55%, transparent 100%);
}
.site-header .bar { display: flex; height: 56px; align-items: center; justify-content: space-between; gap: 12px; max-width: 80rem; margin: 0 auto; padding: 0 24px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand a { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: 15px; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand img { width: 22px; height: 22px; object-fit: contain; transition: transform .2s; }
.brand a:hover img { transform: scale(1.1); }
.brand svg.mark { flex: none; display: block; overflow: visible; transition: transform .2s; }
.brand a:hover svg.mark { transform: rotate(-6deg) scale(1.06); }
.brand .slash { color: var(--muted-foreground); opacity: .6; }
.brand .product { gap: 6px; }
.brand .product .deva { color: var(--sansar); font-weight: 400; font-size: 16px; }
.site-nav { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.site-nav a {
  padding: 6px 12px; border-radius: 8px; color: var(--muted-foreground); text-decoration: none; transition: color .15s, background .15s;
}
.site-nav a:hover { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 5%, transparent); }
.site-nav a[aria-current="page"] { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 6%, transparent); }

/* ─── Buttons: components/ui/button (default / outline / secondary / ghost; sm / default / lg / icon) ─── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  height: 36px; padding: 0 16px; border-radius: calc(var(--radius) - 2px); border: 1px solid transparent;
  font: 500 14px/1 var(--sans); cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
  background: var(--primary); color: var(--primary-foreground);
}
.btn:hover { background: color-mix(in oklch, var(--primary) 90%, transparent); }
.btn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); border-color: var(--ring); }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn-outline { background: var(--background); color: var(--foreground); border-color: var(--border); box-shadow: var(--shadow-sm); }
:root.dark .btn-outline { background: color-mix(in oklch, var(--input) 30%, transparent); border-color: var(--input); }
.btn-outline:hover { background: var(--accent); color: var(--accent-foreground); }
.btn-secondary { background: var(--secondary); color: var(--secondary-foreground); }
.btn-secondary:hover { background: color-mix(in oklch, var(--secondary) 80%, var(--foreground) 6%); }
.btn-ghost { background: transparent; color: var(--foreground); }
.btn-ghost:hover { background: var(--accent); }
.btn-sm { height: 32px; padding: 0 12px; gap: 6px; font-size: 13px; }
.btn-lg { height: 40px; padding: 0 24px; }
.btn-icon { width: 36px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex-shrink: 0; }
.theme-toggle .moon { display: none; }
:root.dark .theme-toggle .sun { display: none; }
:root.dark .theme-toggle .moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not(.light):not(.dark) .theme-toggle .sun { display: none; }
  :root:not(.light):not(.dark) .theme-toggle .moon { display: block; }
}

/* ─── Cards, badges, inputs ─── */
.card {
  background: var(--card); color: var(--card-foreground); border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow-sm);
}
.card-pad { padding: var(--card-pad); }
.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 6px;
  font: 500 12px/1 var(--sans); white-space: nowrap; border: 1px solid transparent;
  background: var(--secondary); color: var(--secondary-foreground);
}
.badge-outline { background: transparent; border-color: var(--border); color: var(--muted-foreground); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.winner, .badge.running { background: var(--good-bg); color: var(--good); }
.badge.keep { background: var(--info-bg); color: var(--info); }
.badge.neutral, .badge.queued, .badge.stopped { background: var(--secondary); color: var(--muted-foreground); }
.badge.discard, .badge.failed { background: var(--bad-bg); color: var(--bad); }
.badge.stale { background: var(--warn-bg); color: var(--warn); }
.badge.done { background: var(--secondary); color: var(--secondary-foreground); }
.badge.running .dot { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; }
.input, select.input, textarea.input {
  width: 100%; min-height: 36px; padding: 6px 12px; border-radius: calc(var(--radius) - 2px);
  border: 1px solid var(--input); background: transparent; color: var(--foreground); font: 400 14px/1.5 var(--sans);
  box-shadow: var(--shadow-sm); transition: box-shadow .15s, border-color .15s;
}
:root.dark .input { background: color-mix(in oklch, var(--input) 30%, transparent); }
select.input { padding-right: 28px; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted-foreground) 50%), linear-gradient(135deg, var(--muted-foreground) 50%, transparent 50%);
  background-position: calc(100% - 15px) 55%, calc(100% - 10px) 55%; background-size: 5px 5px; background-repeat: no-repeat; }
select.input option { background: var(--card); color: var(--foreground); }
.input:focus-visible { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.input::placeholder { color: var(--muted-foreground); }

/* ─── Page heads ─── */
.page-head { padding: 48px 0 24px; }
.kicker { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.page-head h1 { font-size: clamp(2rem, 5vw, 2.75rem); letter-spacing: -0.03em; }
.page-head h1 .deva { color: var(--sansar); font-weight: 400; letter-spacing: 0; margin-left: .15em; }
.lede { margin: 12px 0 0; max-width: 42rem; font-size: 1.0625rem; color: var(--muted-foreground); }
.section { padding: 28px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.section-head h2 { font-size: 1.25rem; }
.section-head p { margin: 0; color: var(--muted-foreground); font-size: 13px; }
.prose { max-width: 44rem; }
.prose h2 { font-size: 1.375rem; margin: 40px 0 12px; }
.prose h3 { font-size: 1.0625rem; margin: 28px 0 8px; }
.prose p, .prose li { color: color-mix(in oklch, var(--foreground) 88%, transparent); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: 4px 0; }
.callout { border-left: 3px solid var(--sansar); padding: 10px 16px; background: var(--sansar-soft); border-radius: 0 8px 8px 0; font-size: 14px; }

/* ─── Footer: LandingFooter (four columns, hairline, muted links) ─── */
.site-footer { margin-top: 96px; padding: 48px 0 40px; position: relative; isolation: isolate; }
/* Mirror of the header: the sky fades into a frosted footer instead of meeting a hard line. */
.site-footer::before {
  content: ""; position: absolute; inset: -72px 0 0 0; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent 0%, color-mix(in oklch, var(--background) 60%, transparent) 72px,
              color-mix(in oklch, var(--background) 85%, transparent) 100%);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 72px);
          mask-image: linear-gradient(to bottom, transparent 0%, #000 72px);
}
.site-footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h4 { font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in oklch, var(--foreground) 80%, transparent); margin: 0 0 14px; }
.site-footer nav { display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.site-footer nav a { color: var(--muted-foreground); text-decoration: none; width: fit-content; }
.site-footer nav a:hover { color: var(--foreground); }
.site-footer .tag { color: var(--muted-foreground); font-size: 14px; max-width: 22rem; margin: 12px 0 0; }
.site-footer .legal a.credit { color: inherit; text-decoration: none; }
.site-footer .legal a.credit:hover { color: var(--foreground); text-decoration: underline; }
.site-footer .legal { margin-top: 40px; padding-top: 20px; border-top: 1px solid color-mix(in oklch, var(--border) 40%, transparent); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; font-size: 13px; color: var(--muted-foreground); }
.site-footer nav .link-btn { all: unset; color: var(--muted-foreground); width: fit-content; cursor: pointer; font: inherit; }
.site-footer nav .link-btn:hover { color: var(--foreground); }
.site-footer nav .link-btn:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }

/* ─── Analytics cookie notice (only when GA is configured; static/js/analytics.js) ───
   Small and out of the way: a frosted card in the bottom-right corner (bottom, full width less the gutter, on phones),
   the header's blur over the sky. Shown while the visitor has not answered (<html data-consent="pending">, set before
   paint) or when reopened from "Cookie settings" (.open). Never shown without JavaScript. */
.consent {
  display: none; position: fixed; z-index: 60; right: 16px; bottom: 16px; width: min(360px, calc(100vw - 32px));
  padding: 14px 16px; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  background: color-mix(in oklch, var(--background) 82%, transparent); color: var(--foreground);
  -webkit-backdrop-filter: blur(20px) saturate(1.2); backdrop-filter: blur(20px) saturate(1.2);
  box-shadow: 0 8px 28px rgb(0 0 0 / 0.12), var(--shadow-sm);
  font-size: 13px; line-height: 1.5;
}
:root.dark .consent { box-shadow: 0 8px 28px rgb(0 0 0 / 0.45); }
html[data-consent="pending"] .consent, .consent.open { display: block; animation: consent-in .25s ease-out; }
.consent h2 { font-size: 13.5px; font-weight: 600; letter-spacing: -0.01em; margin: 0 0 4px; }
.consent p { margin: 0; color: var(--muted-foreground); }
.consent p a { color: var(--foreground); }
.consent .consent-now:empty { display: none; }
.consent .consent-now { margin-top: 6px; color: var(--foreground); }
.consent-actions { display: flex; gap: 8px; margin-top: 12px; }
.consent-actions .btn { flex: 1; }
@keyframes consent-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) { html[data-consent="pending"] .consent, .consent.open { animation: none; } }
@media (max-width: 640px) { .consent { right: 16px; left: 16px; bottom: max(16px, env(safe-area-inset-bottom)); width: auto; } }

/* ─── Demo ─── */
.hero { text-align: center; padding: 56px 0 28px; }
.hero .lede { margin-left: auto; margin-right: auto; }
/* The way into the lab from the demo: one quiet announcement-style chip under the lede. */
.lab-entry { margin: 18px 0 0; }
.lab-entry a {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%; padding: 4px 12px 4px 4px; border-radius: 999px;
  border: 1px solid var(--border); background: color-mix(in oklch, var(--background) 70%, transparent);
  color: var(--muted-foreground); font-size: 13.5px; text-decoration: none; transition: color .15s, border-color .15s;
}
.lab-entry a:hover { color: var(--foreground); border-color: color-mix(in oklch, var(--foreground) 30%, transparent); }
.lab-entry .pill { padding: 2px 10px; border-radius: 999px; background: var(--sansar-soft); color: var(--sansar); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
.try .label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 8px; }
.try textarea { font: 1.3rem/1.9 var(--deva); min-height: 5.8rem; resize: vertical; padding: 12px 14px; border-radius: var(--radius); }
.try textarea::placeholder { font: 1rem var(--sans); }
.row { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.count { margin-left: auto; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.settings { margin-top: 12px; font-size: 14px; color: var(--muted-foreground); }
.settings summary { cursor: pointer; width: max-content; border-radius: 6px; }
.settings .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 24px; margin-top: 10px; }
.settings label { display: flex; flex-direction: column; gap: 4px; }
.settings input[type=range] { width: 100%; accent-color: var(--primary); }
.hint { margin: 8px 0 0; font-size: 13px; }
.out { margin-top: 16px; padding: 20px 24px; min-height: 180px; }
.empty { margin: 0; padding: 52px 0; text-align: center; color: var(--muted-foreground); }
.out .verse { font: 1.35rem/2.05 var(--deva); white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.out .p { color: var(--muted-foreground); }
.out .g { color: var(--foreground); }
.out .g.live::after { content: ""; display: inline-block; width: 2px; height: 1.1em; margin-left: 2px; vertical-align: -0.15em; background: var(--sansar); animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.out .iast { margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--border); font-size: 1rem; line-height: 1.7; color: var(--muted-foreground); white-space: pre-wrap; overflow-wrap: anywhere; }
.out .meta { margin: 12px 0 0; font-size: 13px; color: var(--muted-foreground); display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.out .error { margin: 0; padding: 40px 0; text-align: center; }
.out .error small { display: block; color: var(--muted-foreground); margin-top: 4px; }
.note { font-size: 13px; color: var(--muted-foreground); margin: 10px 2px 0; }
.chips { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.chip { width: 100%; text-align: left; background: var(--card); color: var(--foreground); border: 1px solid var(--border); border-radius: var(--radius); padding: 10px 14px; display: block; cursor: pointer; font: inherit; transition: border-color .15s, background .15s; }
.chip:hover { background: var(--accent); }
.chip .t { display: block; font: 1.1rem/1.7 var(--deva); }
.chip .d { display: block; font-size: 12px; color: var(--muted-foreground); }

/* ─── Tokenizer box ─── */
.tok-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.tok-input { font: 1.2rem/1.8 var(--deva) !important; min-height: 4.4rem; resize: vertical; }
.tok-pieces { display: flex; flex-wrap: wrap; gap: 4px 3px; min-height: 72px; padding: 14px; align-content: flex-start; }
.tok {
  display: inline-flex; align-items: baseline; padding: 1px 6px 2px; border-radius: 6px; font: 1.12rem/1.75 var(--deva);
  background: var(--tc); color: var(--foreground); border: 1px solid color-mix(in oklch, var(--tc) 60%, var(--foreground) 12%);
  animation: tok-in .28s ease-out both; animation-delay: calc(var(--i, 0) * 14ms);
}
.tok.space { background: transparent; border-style: dashed; color: var(--muted-foreground); font-family: var(--sans); font-size: .8rem; padding: 0 4px; align-self: center; }
.tok.partial { font-family: var(--sans); font-style: italic; font-size: .9rem; align-self: center; }
.tok.byte, .tok.mark { font-family: var(--mono); font-size: .72rem; align-self: center; color: var(--muted-foreground); }
.tok.word-start { margin-left: 8px; }
@keyframes tok-in { from { opacity: 0; transform: translateY(4px) scale(.96); } to { opacity: 1; transform: none; } }
.tc0 { --tc: oklch(0.93 0.05 45); } .tc1 { --tc: oklch(0.93 0.05 250); } .tc2 { --tc: oklch(0.93 0.05 160); }
.tc3 { --tc: oklch(0.93 0.05 330); } .tc4 { --tc: oklch(0.93 0.06 95); } .tc5 { --tc: oklch(0.93 0.04 290); }
:root.dark .tc0 { --tc: oklch(0.33 0.06 45); } :root.dark .tc1 { --tc: oklch(0.33 0.06 250); } :root.dark .tc2 { --tc: oklch(0.33 0.06 160); }
:root.dark .tc3 { --tc: oklch(0.33 0.06 330); } :root.dark .tc4 { --tc: oklch(0.33 0.06 95); } :root.dark .tc5 { --tc: oklch(0.33 0.05 290); }
@media (prefers-color-scheme: dark) {
  :root:not(.light) .tc0 { --tc: oklch(0.33 0.06 45); } :root:not(.light) .tc1 { --tc: oklch(0.33 0.06 250); } :root:not(.light) .tc2 { --tc: oklch(0.33 0.06 160); }
  :root:not(.light) .tc3 { --tc: oklch(0.33 0.06 330); } :root:not(.light) .tc4 { --tc: oklch(0.33 0.06 95); } :root:not(.light) .tc5 { --tc: oklch(0.33 0.05 290); }
}
.tok-counts { padding: var(--card-pad); }
.tok-counts h3, .published h3 { font: var(--card-title); letter-spacing: -0.01em; margin-bottom: 4px; }
.tok-row { display: grid; grid-template-columns: 6.5rem 1fr 3.2rem; gap: 10px; align-items: center; padding: 7px 0; font-size: 14px; }
.tok-row .bar { height: 10px; border-radius: 0 4px 4px 0; background: var(--series-1); transition: width .35s ease-out; min-width: 2px; }
.tok-row.sansar .bar { background: var(--series-2); }
.tok-row .track { background: var(--muted); border-radius: 0 4px 4px 0; height: 10px; }
.tok-row .n { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.tok-row .name small { display: block; color: var(--muted-foreground); font-size: 11px; line-height: 1.2; }
.tok-row.na .n { font-weight: 400; color: var(--muted-foreground); }
.tok-meta { font-size: 12px; color: var(--muted-foreground); margin: 10px 0 0; }
.tok-examples { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.published { margin-top: 16px; }
.published table { width: 100%; }

/* ─── Tables ─── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px); background: var(--card); }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th, table.data td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
table.data thead th { font-size: 12px; font-weight: 500; color: var(--muted-foreground); background: color-mix(in oklch, var(--muted) 50%, transparent); position: sticky; top: 0; }
table.data th.r, table.data td.r { text-align: right; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: color-mix(in oklch, var(--accent) 60%, transparent); }
table.data a { text-decoration: none; font-weight: 500; }
table.data a:hover { text-decoration: underline; }
table.data th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; border-radius: 4px; }
table.data th button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
table.data th button .arrow { opacity: .35; font-size: 10px; }
table.data th[aria-sort] button .arrow { opacity: 1; }
table.data td .sub { color: var(--muted-foreground); font-size: 12px; }
table.data td .sub.id { max-width: 15rem; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
table.data td.wrap { white-space: normal; min-width: 9rem; max-width: 13rem; }
table.data th, table.data td { padding: 9px 10px; }
.wide-page { max-width: 80rem; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; margin-bottom: 12px; }
.filters .field { min-width: 9rem; }
.filters .search { flex: 1 1 14rem; }
.filters .count { margin-left: auto; align-self: center; display: inline-flex; gap: 8px; align-items: baseline; }
.show-all { all: unset; cursor: pointer; color: var(--foreground); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.show-all:hover { text-decoration-color: currentColor; }
.show-all:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.show-all[hidden] { display: none; }

/* ─── Runs: live cards ─── */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 16px; }
/* Every live card has the same rows (header, chips, progress, stats, chart, footer), each a fixed height, so cards
   side by side line up row for row; the footer is pinned to the bottom of the (equal-height) card. */
.live-card { padding: var(--card-pad); display: flex; flex-direction: column; gap: var(--card-gap); min-width: 0; }
.live-card.is-stale { opacity: .78; }
.live-card .lc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.live-card h3 { font: var(--card-title); letter-spacing: -0.01em; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-card h3 a { text-decoration: none; }
.live-card h3 a:hover { text-decoration: underline; }
.live-card .lc-head .badge { flex-shrink: 0; }
.chips-row { display: flex; flex-wrap: nowrap; gap: 6px; min-width: 0; overflow: hidden; height: 22px; }
.chips-row > * { flex-shrink: 0; }
.chips-row.is-clipped { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; margin: 0; }
.stats div { min-width: 0; }
.stats dt, .mini-stats dt { font: var(--card-label); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd { margin: 2px 0 0; font: var(--card-num); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats dd .at { font-size: 11px; font-weight: 400; color: var(--muted-foreground); }
.progress { height: 8px; border-radius: 999px; background: var(--muted); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--series-2); border-radius: 999px; transition: width .8s ease-out; }
.progress-label { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 18px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; margin-bottom: 6px; white-space: nowrap; }
.spark { width: 100%; height: 64px; display: block; overflow: hidden; }
.spark .ln { fill: none; stroke: var(--series-2); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.spark .area2 { fill: var(--series-2); fill-opacity: .1; stroke: none; }
.spark .xhair { stroke: var(--muted-foreground); stroke-width: 1; stroke-opacity: .5; }
.spark-wrap { position: relative; }
.spark-wrap .cap { display: flex; justify-content: space-between; gap: 8px; height: 18px; font-size: 11px; line-height: 18px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; }
.spark-wrap .tip { min-width: 0; white-space: nowrap; }
/* No curve (an OCR job): the chart row keeps its height as a quiet dashed panel. */
.spark-wrap.is-empty .spark { border: 1px dashed var(--border); border-radius: 8px; background: color-mix(in oklch, var(--muted) 35%, transparent); }
.lc-foot { margin: auto 0 0; font-size: 12px; line-height: 18px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.state { padding: 28px 24px; text-align: center; color: var(--muted-foreground); }
.state strong { display: block; color: var(--foreground); font-weight: 600; margin-bottom: 4px; }
.state .btn { margin-top: 12px; }
.skeleton { background: linear-gradient(90deg, var(--muted) 25%, color-mix(in oklch, var(--muted) 60%, var(--background)) 50%, var(--muted) 75%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: var(--radius); }
@keyframes shimmer { to { background-position: -200% 0; } }
.skeleton.card-h { height: 330px; }

/* ─── Charts (hand-rolled SVG, static/js/charts.js) ─── */
.chart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.chart-grid .wide { grid-column: 1 / -1; }
figure.chart { margin: 0; padding: var(--card-pad); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
figure.chart h3 { font: var(--card-title); letter-spacing: -0.01em; }
figure.chart .sub { font: var(--card-sub); color: var(--muted-foreground); margin: 0; }
/* Cards side by side share their rows (title, description, chart), so a longer description does not push one
   chart lower than its neighbour. */
@supports (grid-template-rows: subgrid) {
  .chart-grid > figure.chart:not(.wide) { display: grid; grid-row: span 3; grid-template-rows: subgrid; grid-template-columns: minmax(0, 1fr); row-gap: 8px; align-content: start; }
  .chart-grid > figure.chart:not(.wide) > .sub { align-self: start; }
}
.chart-box { position: relative; width: 100%; }
.chart-box svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart-box .axis text, .chart-box .lbl { fill: var(--muted-foreground); font: 11px var(--sans); font-variant-numeric: tabular-nums; }
.chart-box .lbl.strong { fill: var(--foreground); font-weight: 500; }
.chart-box .grid line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart-box .axis line, .chart-box .axis path { stroke: var(--border); }
.chart-box .milestone line { stroke: var(--muted-foreground); stroke-width: 1; stroke-opacity: .45; }
.chart-box .ln { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .s1 { stroke: var(--series-1); } .chart-box .f1 { fill: var(--series-1); }
.chart-box .s2 { stroke: var(--series-2); } .chart-box .f2 { fill: var(--series-2); }
.chart-box .s3 { stroke: var(--series-3); } .chart-box .f3 { fill: var(--series-3); }
.chart-box .area2 { fill: var(--series-2); fill-opacity: .1; stroke: none; }
.chart-box .dot { stroke: var(--card); stroke-width: 2; }
.chart-box .hit { fill: transparent; cursor: pointer; }
.chart-box .xhair { stroke: var(--muted-foreground); stroke-width: 1; stroke-opacity: .5; }
.chart-box .hollow { fill: var(--card); stroke-width: 2; }
.tip {
  position: absolute; pointer-events: none; z-index: 5; min-width: 120px; max-width: 260px; padding: 8px 10px; border-radius: 8px;
  background: var(--popover, var(--card)); color: var(--foreground); border: 1px solid var(--border); box-shadow: 0 4px 16px rgb(0 0 0 / .12);
  font-size: 12px; line-height: 1.45; font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .1s; left: 0; top: 0;
  overflow-wrap: anywhere;
}
.tip.on { opacity: 1; }
.tip b { font-weight: 600; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted-foreground); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.legend i.l { width: 14px; height: 2px; border-radius: 1px; }
.legend i.hollow { background: transparent !important; border: 2px solid; width: 10px; height: 10px; }
.chart-table summary { font-size: 12.5px; color: var(--muted-foreground); cursor: pointer; width: fit-content; border-radius: 4px; }
/* Charts fill the card; the table preview sits at the bottom so side-by-side cards line up row for row. */
figure.chart .chart-box { flex: 1; display: flex; flex-direction: column; gap: 10px; }
figure.chart .chart-box > :first-child { flex: 1; display: flex; flex-direction: column; justify-content: center; }
figure.chart .chart-box > .chart-table { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); }
div.chart-table tr.more { display: none; }
div.chart-table.open tr.more { display: table-row; }
table.data.compact th, table.data.compact td { padding-top: 7px; padding-bottom: 7px; font-size: 13px; }
.more-btn {
  margin-top: 8px; align-self: flex-start; font: 500 12.5px var(--sans); color: var(--muted-foreground); background: none;
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer;
}
.more-btn:hover, .more-btn:focus-visible { color: var(--foreground); border-color: var(--ring); outline: none; }
ol.milestones { margin: 8px 0 0; padding-left: 0; font-size: 13px; font-variant-numeric: tabular-nums; }
/* One line each: a long title is cut with an ellipsis and shown whole on hover (title attribute). The number sits
   inside the line, since the overflow that makes the ellipsis would clip an outside marker. */
ol.milestones li { margin: 0 0 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; list-style-position: inside; }
ol.milestones li::marker { color: var(--muted-foreground); }
ol.milestones li.more { display: none; }
ol.milestones.open li.more { display: list-item; }
ol.milestones .track-chip { vertical-align: 1px; }
ol.milestones a { color: var(--foreground); }
.chart-empty { padding: 36px 0; text-align: center; color: var(--muted-foreground); font: var(--card-sub); }

/* ─── Run detail ─── */
.run-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.run-id { font-family: var(--mono); font-size: 13px; color: var(--muted-foreground); overflow-wrap: anywhere; margin: 8px 0 0; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18rem), 1fr)); gap: 16px; }
#run-live .live-grid:empty { display: none; }
.facts .card { padding: var(--card-pad); }
.facts h3, .story h3 { font: 500 12px/1.5 var(--sans); color: var(--muted-foreground); letter-spacing: 0; margin-bottom: 8px; }
.facts dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 14px; line-height: 1.5; }
.facts dt { color: var(--muted-foreground); }
.facts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.headline { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 16px; }
.headline .card { padding: var(--card-pad); display: flex; flex-direction: column; min-width: 0; }
.headline .v { font: var(--card-num-lg); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.headline .l, .headline .u { font: var(--card-label); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.headline .delta { margin-top: auto; padding-top: 4px; }
.delta { font-size: 12px; font-weight: 500; }
.delta.better { color: var(--good); } .delta.worse { color: var(--bad); }
.story { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.story .card { padding: var(--card-pad); }
.story p { margin: 0; }
.kin { display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs { font-size: 13px; color: var(--muted-foreground); }
.crumbs a { color: var(--muted-foreground); text-decoration: none; }
.crumbs a:hover { color: var(--foreground); }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .tok-grid, .chart-grid, .story { grid-template-columns: minmax(0, 1fr); }
  .site-footer .cols { grid-template-columns: 1fr 1fr; }
  .site-footer .cols > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .container, .site-header .bar { padding: 0 16px; }
  .site-nav .hide-sm { display: none; }
  .site-nav a { padding: 6px 8px; }
  .brand .site-name { display: none; }                 /* the mark alone; the nav needs the width */
  .lab-entry a { font-size: 13px; text-align: left; }
  .settings .grid { grid-template-columns: 1fr; }
  .out { padding: 14px; }
  .out .verse { font-size: 1.22rem; }
  .page-head { padding: 32px 0 16px; }
  .hero { padding: 36px 0 20px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .count { margin-left: 0; }
  .filters .field { min-width: calc(50% - 4px); flex: 1 1 calc(50% - 4px); }
  .filters .count { margin-left: 0; }
}
/* Phones: chart figures drop the card (border, background, padding) so the chart and its table get the full content
   width; a hairline separates figures that follow one another. */
@media (max-width: 640px) {
  figure.card.chart { background: none; border: 0; border-radius: 0; box-shadow: none; padding: 0; }
  .chart-grid { gap: 24px; }
  .chart-grid > figure.card.chart + figure.card.chart { padding-top: 20px; border-top: 1px solid var(--border); }
}
/* Phones: the runs table becomes one card per run (label: value pairs), so nothing scrolls sideways. */
@media (max-width: 640px) {
  table.data.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack, table.data.stack tbody { display: block; }
  table.data.stack tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
  table.data.stack tr[hidden] { display: none; }
  table.data.stack td { display: flex; justify-content: space-between; gap: 8px; padding: 2px 0; border: 0; white-space: normal; text-align: right; max-width: none; min-width: 0; font-size: 13px; }
  table.data.stack td::before { content: attr(data-label); color: var(--muted-foreground); text-align: left; font-size: 12px; }
  table.data.stack td.run-cell { grid-column: 1 / -1; display: block; text-align: left; padding-bottom: 6px; }
  table.data.stack td.run-cell::before { content: none; }
  table.data.stack td.nil { display: none; }
  table.data.stack td .sub { display: none; }
  table.data.stack td.run-cell .sub.id { display: block; max-width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0s !important; animation-delay: 0s !important; transition-duration: 0s !important; }
  .out .g.live::after { animation: none; }
}

/* Inline note: a small "i" that shows the note on hover, focus or tap (no extra column). */
.info { position: relative; display: inline-flex; vertical-align: 1px; margin-left: 4px; }
.info-btn {
  width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
  font: italic 600 10px/14px Georgia, serif; padding: 0; cursor: help;
}
.info-btn:hover, .info-btn:focus-visible { color: var(--foreground); border-color: var(--ring); outline: none; }
.info-pop {
  position: absolute; left: 50%; top: calc(100% + 6px); transform: translateX(-30%); z-index: 6; width: max-content; max-width: 280px;
  padding: 8px 10px; border-radius: 8px; background: var(--popover, var(--card)); color: var(--foreground); border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgb(0 0 0 / .12); font-size: 12px; line-height: 1.45; font-weight: 400; white-space: normal;
  opacity: 0; visibility: hidden; transition: opacity .12s;
}
.info:hover .info-pop, .info-btn:focus-visible + .info-pop, .info-btn:focus + .info-pop { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .info-pop { transition: none; } }

/* Tithi · nakṣatra from the sky engine, written into the footer (never floats over content). */
.sky-caption:not(:empty)::before { content: "·"; margin: 0 8px; opacity: .6; }

/* ─── MuseMesh Lab (/lab): track tabs, track cards, track chips ─── */
.lab-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 4px 0 8px; padding: 4px; border: 1px solid var(--border); border-radius: 999px; width: fit-content; max-width: 100%; background: color-mix(in oklch, var(--card) 80%, transparent); }
.lab-tabs::-webkit-scrollbar { display: none; }
.lab-tabs a { display: inline-flex; align-items: center; gap: 7px; padding: 6px 14px; border-radius: 999px; font-size: 14px; color: var(--muted-foreground); text-decoration: none; white-space: nowrap; }
.lab-tabs a:hover { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 5%, transparent); }
.lab-tabs a[aria-current="page"] { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 8%, transparent); font-weight: 500; }
.lab-tabs .dot, .track-chip .dot, .track-card h3 .dot, .track-title .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent, var(--muted-foreground)); flex-shrink: 0; display: inline-block; }
.lab-tabs .live-n { font-size: 11px; font-weight: 600; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; background: var(--good-bg); color: var(--good); font-variant-numeric: tabular-nums; }
.track-chip { gap: 6px; text-decoration: none; color: var(--foreground); }
a.track-chip:hover { border-color: var(--ring); }
.track-title { display: flex; align-items: center; gap: 14px; }
.track-title .dot { width: 14px; height: 14px; }
.track-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 16.5rem), 1fr)); gap: 16px; }
.track-card { padding: var(--card-pad); display: flex; flex-direction: column; gap: var(--card-gap); border-top: 3px solid var(--accent); min-width: 0; }
.track-card header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.track-card h3 { font: var(--card-title); font-size: 1.05rem; letter-spacing: -0.01em; min-width: 0; }
.track-card h3 a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.track-card h3 a:hover { text-decoration: underline; }
.track-card .blurb { margin: 0; font: var(--card-sub); font-size: 13px; color: var(--muted-foreground); flex: 1; }
.track-card .best .l { font: var(--card-label); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-card .best .v { font: var(--card-num-lg); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.track-card .best .u { font-size: 13px; font-weight: 400; color: var(--muted-foreground); letter-spacing: 0; }
.track-card .best .sub { font: var(--card-sub); color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-card .best .sub a { color: var(--foreground); }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; padding-top: 12px; border-top: 1px solid var(--border); }
.mini-stats dd { margin: 2px 0 0; font: var(--card-num); font-variant-numeric: tabular-nums; white-space: nowrap; }
.headline-note { position: relative; z-index: 30; margin: 14px 0 0; max-width: 46rem; font-size: 14px; color: var(--muted-foreground); }
.headline-note strong { color: var(--foreground); font-weight: 600; }
.info-wide { position: static; }  /* the pop anchors to the line, not the icon, so it never runs off a phone screen */
.info-wide .info-pop { left: 0; transform: none; max-width: min(400px, 100%); }
.info-wide .info-pop span { display: block; }
.info-wide .info-pop span + span { margin-top: 6px; }
.glossary { margin-top: 12px; max-width: 46rem; font-size: 14px; }
.glossary summary { cursor: pointer; width: fit-content; color: var(--muted-foreground); border-radius: 4px; }
.glossary dl { margin: 10px 0 0; display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 8px 16px; }
.glossary dt { font-weight: 500; }
.glossary dt .muted { font-weight: 400; font-size: 12px; display: block; }
.glossary dd { margin: 0; color: var(--muted-foreground); }
.headline .headline-main { border-color: color-mix(in oklch, var(--accent, var(--border)) 45%, var(--border)); }
table.data.scores th.set-name { font-weight: 500; font-size: 13.5px; color: var(--foreground); background: none; white-space: normal; min-width: 12rem; }
table.data.scores th.set-name .sub { font-weight: 400; color: var(--muted-foreground); font-size: 12px; max-width: 34rem; }
table.data.scores tr.is-headline { background: color-mix(in oklch, var(--accent, var(--muted)) 7%, transparent); }
.unit-note { max-width: 46rem; }
.lab-link { margin-top: 12px; }
.run-head .track-chip { font-size: 13px; }
@media (max-width: 640px) {
  .glossary dl { grid-template-columns: 1fr; gap: 2px; }
  .glossary dd { margin-bottom: 8px; }
  table.data.scores th.set-name { min-width: 0; }
  .lab-tabs { border-radius: 12px; }
}

/* Over the sky, muted text needs a little more ink than on a plain page so the contrast guard can keep 4.5:1
   with a light veil (otherwise the veil has to go nearly opaque). Only while the sky is showing. */
html.has-sky.light { --muted-foreground: oklch(0.43 0 0); }
html.has-sky.dark { --muted-foreground: oklch(0.76 0 0); }

/* ─── Lab first fold ───
   On the overview and the track pages, the hero, the tabs and Live now fill the first screen exactly when something is
   live: the block is the viewport's height (less the 56px header), Live now sits at its foot, and the next section starts
   below the fold instead of peeking in half cut. Capped, so a very tall screen does not get a tall empty gap. With
   nothing live there is no Live now section and no minimum height: the next section moves up into the fold. */
.fold { display: flex; flex-direction: column; }
.fold.has-live { min-height: min(calc(100vh - 56px), 54rem); min-height: min(calc(100svh - 56px), 54rem); }
.fold.has-live > .live-section { margin-top: auto; padding-bottom: 20px; }
.fold .lab-tabs { margin-bottom: 0; }
.fold > .live-section { padding-top: 20px; }
.fold > .live-section .section-head { margin-bottom: 12px; }

/* The machine-status pill, beside the page's first line: small, never a banner. */
.kicker-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin: 0 0 10px; min-height: 24px; }
.kicker-row > .kicker, .kicker-row > .crumbs { margin: 0; }
.machine-pill { display: inline-flex; align-items: center; gap: 7px; max-width: 100%; min-width: 0; margin: 0; padding: 1px 10px 1px 9px;
  border: 1px solid transparent; border-radius: 999px; font-size: 12.5px; line-height: 20px; }
.machine-pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.machine-pill .ms-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.machine-pill .ms-label { font-weight: 600; }
.machine-pill.is-maintenance { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in oklch, var(--warn) 22%, transparent); }
.machine-pill.is-outage, .machine-pill.is-offline { background: var(--bad-bg); color: var(--bad); border-color: color-mix(in oklch, var(--bad) 22%, transparent); }

/* Live now on the lab pages: one row that scrolls sideways (snapping card by card), never more rows. The edge with more
   behind it fades, and the next card shows a sliver, so it reads as scrollable. */
.live-row { --live-card-w: 24rem; display: flex; gap: 16px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-behavior: smooth; padding-bottom: 4px; }
.live-row > .live-card, .live-row > .skeleton { flex: 0 0 var(--live-card-w); max-width: var(--live-card-w); scroll-snap-align: start; }
.live-row > .state { flex: 1 0 100%; }
.live-row:focus-visible { outline-offset: 4px; }
.live-row.fade-end { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
.live-row.fade-start { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px); mask-image: linear-gradient(to right, transparent, #000 56px); }
.live-row.fade-start.fade-end { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
@media (prefers-reduced-motion: reduce) { .live-row { scroll-behavior: auto; } }
/* Shorter screens (a laptop's 1280×800 leaves about 700px of page): a tighter hero and a slightly shorter card, so the
   whole first fold still fits. */
@media (max-height: 880px) {
  .fold > .page-head { padding: 28px 0 16px; }
  .fold > .page-head h1 { font-size: clamp(1.75rem, 4vw, 2.25rem); }
  .fold > .page-head .lede { margin-top: 8px; }
  .fold .lab-entry, .fold .headline-note { margin-top: 12px; }
  .fold > .live-section { padding-top: 16px; }
  .live-row .live-card { --card-pad: 16px 18px; gap: 10px; }
  .live-row .spark { height: 48px; }
}
@media (max-height: 760px) and (min-width: 641px) {
  .fold > .page-head { padding: 18px 0 12px; }
  .fold > .page-head h1 { font-size: clamp(1.625rem, 3.4vw, 2rem); }
  .fold > .page-head .lede { font-size: 1rem; }
  .fold.has-live > .live-section { padding-bottom: 12px; }
  .live-row .spark { height: 40px; }
}
/* Phones: the same fold in 375×812. A card is the row's width less a sliver of the next one; its stats stay in three
   columns (one row fewer than the stacked grid elsewhere). */
@media (max-width: 640px) {
  .fold > .page-head { padding: 18px 0 12px; }
  .fold > .page-head h1 { font-size: 1.75rem; }
  .fold > .page-head .lede { font-size: 15px; line-height: 1.5; margin-top: 8px; }
  .fold .lab-entry, .fold .headline-note { margin-top: 10px; }
  .fold .lab-tabs { margin-top: 0; }
  .fold > .live-section { padding-top: 14px; }
  .fold.has-live > .live-section { padding-bottom: 12px; }
  .fold > .live-section .section-head { margin-bottom: 10px; }
  .live-row { --live-card-w: calc(100% - 44px); gap: 12px; }
  .live-row .live-card { --card-pad: 14px 16px; gap: 10px; }
  .live-row .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; }
  .live-row .stats dd { font-size: 0.95rem; }
  .live-row .spark { height: 44px; }
  .kicker-row .machine-pill { flex: 1 1 100%; }
}

/* ─── Daily Sanskrit (/daily) ───
   Editorial and calm: one card per item in a reading-width column, the Sanskrit large, labels small. Kinds have a
   quiet colour each (chip + dot), from the site's own soft tokens; a fact gets violet, defined here for both themes. */
:root { --violet: #6d3fc0; --violet-bg: oklch(0.95 0.03 300); }
@media (prefers-color-scheme: dark) { :root:not(.light) { --violet: #c4a6f5; --violet-bg: oklch(0.3 0.06 300); } }
:root.dark { --violet: #c4a6f5; --violet-bg: oklch(0.3 0.06 300); }
.kind-chip { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font: 600 11.5px/1 var(--sans); letter-spacing: .04em; text-transform: uppercase; white-space: nowrap; }
.kind-mantra { background: var(--sansar-soft); color: var(--sansar); }
.kind-subhashita { background: var(--info-bg); color: var(--info); }
.kind-story { background: var(--good-bg); color: var(--good); }
.kind-fact { background: var(--violet-bg); color: var(--violet); }
.kind-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; padding: 0; }
.kind-dot.kind-mantra { background: var(--sansar); } .kind-dot.kind-subhashita { background: var(--info); }
.kind-dot.kind-story { background: var(--good); } .kind-dot.kind-fact { background: var(--violet); }

.daily-page { max-width: 46rem; }
.daily-page.daily-wide { max-width: 64rem; }
.daily-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; padding: 28px 0 14px; }
.daily-bar .kicker { margin: 0; }
.daily-bar .kicker a { text-decoration: none; color: inherit; }
.daily-bar .kicker a:hover { color: var(--foreground); }
.daily-links { display: flex; gap: 4px; font-size: 13.5px; }
.daily-links a { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 8px; color: var(--muted-foreground); text-decoration: none; }
.daily-links a:hover { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 5%, transparent); }
.daily-links a[aria-current="page"] { color: var(--foreground); background: color-mix(in oklch, var(--foreground) 7%, transparent); }
.count-pill { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-grid; place-items: center; font: 600 11px/1 var(--sans); background: var(--sansar-soft); color: var(--sansar); font-variant-numeric: tabular-nums; }
.daily-page-head { padding-top: 8px; }

.daily-card { padding: 36px 40px 28px; }
.daily-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.daily-head h1 { font-size: clamp(1.5rem, 3.6vw, 2rem); letter-spacing: -0.025em; }
.daily-head h1:focus { outline: none; }

.daily-text { display: flex; flex-direction: column; gap: 10px; margin: 26px 0 0; padding: 22px 0 22px 22px; border-left: 3px solid var(--sansar); position: relative; }
.daily-text .verse { margin: 0; overflow-wrap: anywhere; }
.daily-text .verse-deva { font: 400 clamp(1.5rem, 4.4vw, 2.15rem)/1.8 var(--deva); color: var(--foreground); }
.daily-text .verse-iast { font: italic 400 1.05rem/1.7 var(--sans); color: var(--muted-foreground); }
.daily-text[data-script="iast"] .verse-iast { order: -1; font: 500 clamp(1.25rem, 3.6vw, 1.6rem)/1.6 var(--sans); font-style: normal; color: var(--foreground); }
.daily-text[data-script="iast"] .verse-deva { font-size: 1.15rem; line-height: 1.75; color: var(--muted-foreground); }
.script-toggle { position: absolute; top: -14px; right: 0; display: inline-flex; padding: 2px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); }
.script-toggle button { all: unset; cursor: pointer; padding: 2px 10px; border-radius: 999px; font: 500 12px/20px var(--sans); color: var(--muted-foreground); }
.script-toggle button [lang="sa"] { font-size: 13px; }
.script-toggle button[aria-pressed="true"] { background: color-mix(in oklch, var(--foreground) 9%, transparent); color: var(--foreground); }
.script-toggle button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.script-toggle[hidden] + .verse { margin-top: 0; }

.daily-translation { margin: 22px 0 0; }
.daily-translation p { margin: 0; font-size: 1.1875rem; line-height: 1.6; letter-spacing: -0.005em; color: var(--foreground); }
.daily-audio { margin: 18px 0 0; display: flex; align-items: center; gap: 12px; }
.daily-audio figcaption { font-size: 13px; color: var(--muted-foreground); }
.daily-audio audio { height: 36px; max-width: 100%; }
/* the chant player (static/js/daily-audio.js): a round play button, the caption, a seek bar with the time */
.daily-audio.chant { align-items: flex-start; gap: 14px; margin-top: 20px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in oklch, var(--sansar-soft) 55%, transparent); }
.chant-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.daily-audio.chant figcaption { font-size: 14px; color: var(--foreground); line-height: 1.4; }
.chant-title { font-weight: 500; }
.chant-note { color: var(--muted-foreground); }
.chant-audio { width: 100%; }
.daily-audio.chant.is-enhanced .chant-audio { display: none; }
.chant-play { flex: none; display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 999px; border: 0; padding: 0; cursor: pointer; background: var(--sansar); color: var(--background); box-shadow: var(--shadow-sm); transition: transform .12s ease, background .12s ease; }
.chant-play:hover { background: color-mix(in oklch, var(--sansar) 88%, var(--foreground)); }
.chant-play:active { transform: scale(.96); }
.chant-play:focus-visible { outline: 2px solid var(--ring); outline-offset: 3px; }
.chant-play svg { width: 20px; height: 20px; }
.chant-play .i-play { margin-left: 2px; }
.chant-play .i-pause, .is-playing .chant-play .i-play { display: none; }
.is-playing .chant-play .i-pause { display: block; }
.is-loading .chant-play { opacity: .75; }
.is-loading .chant-play svg { animation: chant-pulse 1s ease-in-out infinite; }
@keyframes chant-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .is-loading .chant-play svg { animation: none; } .chant-play { transition: none; } }
.chant-track { display: flex; align-items: center; gap: 10px; }
.chant-track[hidden] { display: none; }
.chant-time { flex: none; font: 12.5px/1 var(--sans); font-variant-numeric: tabular-nums; color: var(--muted-foreground); }
.chant-seek { --p: 0%; flex: 1 1 auto; min-width: 0; height: 24px; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; }
.chant-seek::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--sansar) var(--p), color-mix(in oklch, var(--foreground) 14%, transparent) var(--p)); }
.chant-seek::-moz-range-track { height: 4px; border-radius: 4px; background: color-mix(in oklch, var(--foreground) 14%, transparent); }
.chant-seek::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--sansar); }
.chant-seek::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 14px; height: 14px; margin-top: -5px; border-radius: 50%; background: var(--sansar); border: 2px solid var(--background); }
.chant-seek::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--sansar); border: 2px solid var(--background); }
.chant-seek:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; border-radius: 4px; }
.chant-status { margin: 0; font-size: 13px; color: var(--bad); }
.chant-status:empty { display: none; }
.daily-source .chant-credit { margin-top: 6px; }

.daily-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 24px 0 4px; }
.daily-actions .btn[aria-pressed="true"] { background: var(--sansar-soft); color: var(--sansar); border-color: color-mix(in oklch, var(--sansar) 30%, transparent); }
.daily-actions .btn[aria-pressed="true"] svg { fill: currentColor; }
.daily-actions .btn[aria-busy="true"] { opacity: .7; pointer-events: none; }
.daily-status { flex: 1 1 100%; margin: 2px 0 0; min-height: 0; font-size: 13px; color: var(--muted-foreground); }
.daily-status:empty { display: none; }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 12rem; padding: 4px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); box-shadow: 0 8px 24px rgb(0 0 0 / .12); display: flex; flex-direction: column; }
:root.dark .menu-pop { box-shadow: 0 8px 24px rgb(0 0 0 / .45); }
.menu-pop button { all: unset; cursor: pointer; padding: 8px 10px; border-radius: 6px; font-size: 14px; }
.menu-pop button:hover, .menu-pop button:focus-visible { background: var(--accent); }

.daily-sec, .daily-fact, .daily-words, .daily-source { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--border); }
.daily-sec h2, .daily-fact h2 { margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted-foreground); }
.daily-sec p, .daily-fact p { margin: 0 0 12px; font-size: 1rem; line-height: 1.7; color: color-mix(in oklch, var(--foreground) 90%, transparent); max-width: 40rem; }
.daily-sec p:last-child, .daily-fact p:last-child { margin-bottom: 0; }
.daily-fact { border-top: 0; padding: 16px 18px; border-radius: var(--radius); background: var(--violet-bg); }
.daily-fact h2 { color: var(--violet); }
.daily-words summary { cursor: pointer; width: fit-content; font-size: 14.5px; font-weight: 500; border-radius: 4px; }
.daily-words .table-wrap { margin-top: 12px; }
table.data.words td { white-space: normal; vertical-align: top; }
table.data.words .w-deva { font: 1.15rem/1.6 var(--deva); white-space: nowrap; }
table.data.words .w-iast { font-style: italic; white-space: nowrap; color: var(--muted-foreground); }
table.data.words .w-gloss { min-width: 12rem; }
table.data.words tbody tr:hover { background: none; }
.daily-pron .syllables { font: 500 1.125rem/1.9 var(--sans); letter-spacing: .01em; color: var(--foreground); max-width: none; }
.daily-pron .syl-dot { color: var(--sansar); margin: 0 .12em; font-weight: 700; }
.daily-text.is-long .verse-deva { font-size: clamp(1.2rem, 3vw, 1.45rem); line-height: 1.85; }
.daily-text.is-long[data-script="iast"] .verse-iast { font-size: 1.15rem; line-height: 1.7; }
.daily-pron .pron-note, .daily-accents .pron-note { margin: 4px 0 0; font-size: 13px; color: var(--muted-foreground); }
.daily-accents .verse-accented { margin: 12px 0 0; font: 1.5rem/1.9 var(--deva); }
.daily-accents { margin-top: 0; padding-top: 14px; border-top: 0; }
.daily-source .credit a { color: var(--muted-foreground); overflow-wrap: anywhere; }
.daily-source .credit a:hover { color: var(--foreground); }
.daily-pron .tips { margin: 10px 0 0; padding-left: 1.1rem; font-size: 14.5px; line-height: 1.65; color: color-mix(in oklch, var(--foreground) 88%, transparent); }
.daily-pron .tips li { margin: 4px 0; }
.daily-source p { margin: 0 0 6px; font-size: 13px; line-height: 1.55; color: var(--muted-foreground); }
.daily-source strong { color: var(--foreground); font-weight: 500; }
.daily-source .label { display: inline-block; margin-right: 6px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.daily-source .sep { margin: 0 4px; opacity: .6; }
.daily-source .ai-note { margin-top: 10px; }
.daily-source .ai-note a { color: var(--muted-foreground); }
.daily-source .ai-note a:hover { color: var(--foreground); }

.daily-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin: 18px 4px 0; font-size: 14px; }
.daily-pager a { color: var(--muted-foreground); text-decoration: none; padding: 6px 0; }
.daily-pager a:hover { color: var(--foreground); }
.daily-pager .pg-mid { text-align: center; color: var(--muted-foreground); }
.daily-pager .pg-next { text-align: right; }
.daily-slot-swap { animation: daily-in .28s ease-out; }
@keyframes daily-in { from { opacity: 0; transform: translateY(6px); } }

/* Archive: one card per day, by month. */
.kind-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; }
.kind-filter button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; padding: 5px 12px; border: 1px solid var(--border); border-radius: 999px; font-size: 13px; color: var(--muted-foreground); background: color-mix(in oklch, var(--card) 80%, transparent); }
.kind-filter button:hover { color: var(--foreground); }
.kind-filter button[aria-pressed="true"] { color: var(--foreground); border-color: color-mix(in oklch, var(--foreground) 35%, transparent); background: var(--card); }
.kind-filter button:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.archive-month { padding: 18px 0 6px; }
.archive-month h2 { font-size: 1rem; margin: 0 0 12px; }
.archive-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 18.5rem), 1fr)); gap: 12px; }
.archive-card { display: flex; flex-direction: column; gap: 8px; height: 100%; padding: 16px 18px; text-decoration: none; transition: border-color .15s, transform .15s; }
.archive-card:hover { border-color: color-mix(in oklch, var(--foreground) 25%, transparent); }
.ac-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
.ac-title { font: var(--card-title); letter-spacing: -0.01em; }
.ac-line { font: 1.15rem/1.6 var(--deva); color: color-mix(in oklch, var(--foreground) 80%, transparent); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* Your collection */
.saved-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 16px; }
.saved-tools .file-btn { position: relative; }
.saved-tools .file-btn:focus-within { box-shadow: 0 0 0 3px color-mix(in oklch, var(--ring) 50%, transparent); }
.saved-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); gap: 12px; }
.saved-card { padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.saved-card .ac-meta { justify-content: flex-start; }
.saved-card h3 { font: var(--card-title); }
.saved-card h3 a { text-decoration: none; }
.saved-card h3 a:hover { text-decoration: underline; }
.saved-card .sc-deva { margin: 0; font: 1.2rem/1.7 var(--deva); overflow-wrap: anywhere; }
.saved-card .sc-iast { margin: 0; font-size: 13.5px; font-style: italic; color: var(--muted-foreground); overflow-wrap: anywhere; }
.saved-card .sc-tr { margin: 0; font-size: 14.5px; line-height: 1.55; }
.saved-card .sc-src { margin: 0; font-size: 12.5px; color: var(--muted-foreground); }
.saved-card .sc-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--border); }
.saved-card .sc-actions .btn { color: var(--muted-foreground); }
.saved-card .sc-actions .btn:hover { color: var(--foreground); }

/* The teaser on the lab overview. */
.daily-teaser { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 22px 24px; text-decoration: none; max-width: 46rem; border-left: 3px solid var(--sansar); transition: border-color .15s; }
.daily-teaser:hover { border-color: color-mix(in oklch, var(--foreground) 25%, transparent); border-left-color: var(--sansar); }
.dt-meta { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted-foreground); }
.dt-line { font: 400 1.5rem/1.7 var(--deva); overflow-wrap: anywhere; }
.dt-title { font: var(--card-title); }
.dt-tr { font-size: 14.5px; line-height: 1.55; color: var(--muted-foreground); }
.dt-more { margin-top: 4px; font-size: 13.5px; font-weight: 500; color: var(--sansar); }

@media (max-width: 640px) {
  .daily-bar { padding: 18px 0 10px; }
  .daily-links a { padding: 4px 8px; }
  .daily-card { padding: 22px 18px 20px; border-radius: var(--radius); }
  .daily-text { padding: 26px 0 14px 14px; margin-top: 20px; }
  .daily-text .verse-deva { font-size: 1.45rem; line-height: 1.75; }
  .script-toggle { top: -12px; }
  .daily-translation p { font-size: 1.0625rem; }
  .daily-actions .btn-ghost > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .daily-actions { gap: 6px; }
  .daily-actions .btn { padding: 0 12px; }
  .daily-actions .btn-ghost { width: 34px; padding: 0; }
  .menu-pop { left: auto; right: 0; }
  .daily-sec, .daily-fact, .daily-words, .daily-source { margin-top: 22px; padding-top: 18px; }
  .daily-fact { padding: 14px 14px; }
  table.data.words .w-gloss { min-width: 9rem; }
  .daily-teaser { padding: 18px 16px; }
  .dt-line { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .daily-slot-swap { animation: none; } }

/* ── /lab/capacity: GPU capacity watch ──────────────────────────────────────────────────────────────────────────── */
.cap-page { --series-0: var(--muted-foreground); }
.chart-box .s0 { stroke: var(--series-0); }
.chart-box .ln.dash { stroke-dasharray: 7 5; }
.chart-box .ln.dot { stroke-dasharray: 1.5 4; stroke-width: 1.5; }
.legend i.l.dash { -webkit-mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); mask: repeating-linear-gradient(90deg, #000 0 5px, transparent 5px 8px); }
.legend i.l.dot { -webkit-mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px); mask: repeating-linear-gradient(90deg, #000 0 2px, transparent 2px 5px); }
.cap-meta { font-size: 13px; color: var(--muted-foreground); margin: 8px 0 0; }
.cap-verdict { margin: -4px 0 14px; max-width: 52rem; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: calc(var(--radius) - 2px); padding: 2px; gap: 2px; background: var(--card); flex-wrap: wrap; }
.seg button { all: unset; cursor: pointer; font-size: 12.5px; padding: 4px 10px; border-radius: calc(var(--radius) - 4px); color: var(--muted-foreground); }
.seg button[aria-pressed="true"] { background: var(--secondary); color: var(--foreground); font-weight: 500; }
.seg button:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.cap-controls { display: flex; gap: 12px; align-items: end; flex-wrap: wrap; }
.cap-controls .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted-foreground); }
.cap-controls select.input { min-width: 15rem; max-width: 100%; }
.cap-table tr.group th { background: color-mix(in oklch, var(--muted) 60%, transparent); font-size: 12.5px; font-weight: 600; color: var(--foreground); position: static; white-space: normal; }
.cap-table tr.group th .muted { font-weight: 400; }
.cap-table tr.group .badge { margin-left: 6px; }
.cap-table td .sub.wrap { white-space: normal; max-width: 18rem; }
.cap-table td.mach strong { font-weight: 600; }
.cap-table .score.low { color: var(--warn); }
.badge.buy-spot { background: var(--good-bg); color: var(--good); }
.badge.buy-od { background: var(--info-bg); color: var(--info); }
.cap-sparks { display: grid; grid-template-columns: auto 120px; gap: 2px 8px; align-items: center; }
.cap-sparks .sk-l { font-size: 11px; color: var(--muted-foreground); text-align: right; }
.cap-spark { position: relative; display: block; width: 120px; height: 28px; }
.cap-spark svg { display: block; width: 120px; height: 28px; overflow: visible; }
.cap-spark .ln { fill: none; stroke: var(--series-1); stroke-width: 1.5; stroke-linejoin: round; }
.cap-spark .base { stroke: var(--grid); stroke-width: 1; }
.cap-spark .xhair { stroke: var(--muted-foreground); stroke-opacity: .5; }
.cap-spark.nodata::after { content: "—"; position: absolute; left: 0; top: 4px; font-size: 12px; color: var(--muted-foreground); }
.cap-spark .tip { white-space: nowrap; }
.chart-box .cell.nodata { fill: none; stroke: var(--border); stroke-dasharray: 2 2; }
.chart-box .cell-v { font: 500 10.5px var(--sans); fill: var(--foreground); font-variant-numeric: tabular-nums; pointer-events: none; }
.chart-box .cell-v.on-dark { fill: #fff; }
.heat-legend { align-items: center; }
.heat-legend .ramp { width: 90px; height: 10px; border-radius: 2px; }
.heat-legend .ramp.r1 { background: linear-gradient(90deg, color-mix(in oklab, var(--series-1) 10%, var(--card)), var(--series-1)); }
.heat-legend .ramp.r2 { background: linear-gradient(90deg, color-mix(in oklab, var(--series-2) 10%, var(--card)), var(--series-2)); }
.heat-legend i.nodata { width: 10px; height: 10px; border-radius: 2px; border: 1px dashed var(--border); background: transparent; margin-right: 4px; }
.cap-explain { padding: var(--card-pad); max-width: none; }
.cap-explain dl { margin: 0; display: grid; gap: 4px; max-width: 48rem; }
.cap-explain dt { font-weight: 600; margin-top: 10px; }
.cap-explain dt:first-child { margin-top: 0; }
.cap-explain dd { margin: 0; color: color-mix(in oklch, var(--foreground) 85%, transparent); }
.lab-more { font-size: 13px; color: var(--muted-foreground); margin: 10px 0 0; }
@media (max-width: 640px) {
  .cap-table.stack tr.group { display: block; padding: 10px 14px; }
  .cap-table.stack tr.group th { display: block; background: none; padding: 0; }
  .cap-table.stack td.mach, .cap-table.stack td.trend, .cap-table.stack td[data-label="Our rule says"] { grid-column: 1 / -1; }
  .cap-table.stack td.mach { display: block; text-align: left; }
  .cap-table.stack td.mach::before { content: none; }
  .cap-table.stack td.mach .sub, .cap-table.stack td[data-label="Our rule says"] .sub { display: block; text-align: left; }
  .cap-table.stack td[data-label="Our rule says"] { flex-wrap: wrap; justify-content: flex-start; text-align: left; }
  .cap-table.stack td[data-label="Our rule says"]::before { flex-basis: 100%; }
  .cap-controls select.input { min-width: 0; width: 100%; }
  .cap-controls .field { flex: 1 1 100%; }
}
.cap-spark .end { fill: var(--series-1); }
.chart-box .lbl.small { font-size: 10px; }
