/* Abhyasa. Built on the Dixith Labs design standard, version 1.1
   (dixith-labs-design/DESIGN-PHILOSOPHY.md and tokens.css). Warm paper lit by
   daylight, or deep ink-grey lit from within; one accent the person chooses
   (Clay by default, as the nearest to saffron; or Ink or Lagoon); glass only
   for the frame, never behind reading. Each japa series keeps a colour of its
   own, as a dot and on its own ring. The counter always happens at night.

   Abhyasa's own tokens, beyond the shared set:
     --dawn            the meru bead and the celebration glow (the icon's peach)
     --night-*         the counter, the same in light and dark mode
     --warn            "behind pace", amber that reads as text
     --hm0..4          the consistency calendar, mixed from the accent       */

@font-face {
  font-family: 'Fraunces';
  src: url('fonts/fraunces-latin-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* Headings in the eight Indic scripts: Noto Serif, bold, the same files as
   Anudina's. Each carries its own unicode-range, so a phone downloads only
   the script it shows. SIL Open Font License. */
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-kannada-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C80-0CF3, U+1CD0, U+1CD2-1CD3, U+1CDA, U+1CF2, U+1CF4, U+200C-200D, U+20B9, U+25CC, U+A830-A835; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-deva-700.woff2') format('woff2'); unicode-range: U+0900-097F, U+1CD0-1CF9, U+200C-200D, U+20A8, U+20B9, U+20F0, U+25CC, U+A830-A839, U+A8E0-A8FF, U+11B00-11B09; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-telugu-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0C00-0C7F, U+1CDA, U+1CF2, U+200C-200D, U+25CC; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-tamil-700.woff2') format('woff2'); unicode-range: U+0964-0965, U+0B82-0BFA, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-malayalam-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0D00-0D7F, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC, U+A830-A832; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-oriya-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0B01-0B77, U+1CDA, U+1CF2, U+200C-200D, U+20B9, U+25CC; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-bengali-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0980-09FE, U+1CD0, U+1CD2, U+1CD5-1CD6, U+1CD8, U+1CE1, U+1CEA, U+1CED, U+1CF2, U+1CF5-1CF7, U+200C-200D, U+20B9, U+25CC, U+A8F1; }
@font-face { font-family: 'Abhyasa Serif'; font-weight: 700; font-style: normal; font-display: swap; src: url('fonts/noto-serif-gujarati-700.woff2') format('woff2'); unicode-range: U+0951-0952, U+0964-0965, U+0A80-0AFF, U+200C-200D, U+20B9, U+25CC, U+A830-A839; }


/* ---------------------------------------------------------------- tokens (from tokens.css) */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Kannada', 'Noto Sans Devanagari', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Fraunces', 'Abhyasa Serif', Georgia, 'Times New Roman', serif;
  --verse: 'Iowan Old Style', 'Palatino Linotype', Palatino, 'Book Antiqua', Georgia, serif;
  --bg: #F6F4EF; --bg-2: #EEEBE4; --surface: #FFFFFF; --surface-2: #FAF9F6;
  --glass: rgba(250, 249, 245, .68); --glass-strong: rgba(253, 252, 250, .84); --glass-edge: rgba(255, 255, 255, .7);
  --ink: #1C1E24; --ink-2: #5A5F6B; --ink-3: #8D919B; --line: rgba(28, 30, 36, .08); --line-2: rgba(28, 30, 36, .15);
  --hover: rgba(28, 30, 36, .045); --press: rgba(28, 30, 36, .08);
  --late: #C4453A; --good: #2F8F5B; --warn: #9A5B0B; --p2: #DD8A1F;
  --shadow-1: 0 1px 2px rgba(20, 22, 30, .05), 0 2px 8px rgba(20, 22, 30, .04);
  --shadow-2: 0 2px 6px rgba(20, 22, 30, .06), 0 16px 40px rgba(20, 22, 30, .10);
  --scrim: rgba(18, 20, 28, .26);
  --blob-a: .16; --blob-b: .10;
  --r: 14px; --r-lg: 22px;
  --side: 284px;
  --tabs-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px); --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --slow: .32s;
  --dawn: #FFD7A8;
  --night: #0B0D12; --night-2: #12151C; --night-ink: #ECEDEF;
  color-scheme: light;
}
:root[data-accent="ink"]    { --accent: #3552A8; --accent-2: #5C6FD8; --accent-ink: #2B4491; --accent-soft: rgba(53, 82, 168, .11); --accent-line: rgba(53, 82, 168, .28); --night-accent: #94A8F2; --night-accent-2: #B3A6F5; }
:root[data-accent="lagoon"] { --accent: #0E7C73; --accent-2: #2AA898; --accent-ink: #0A665E; --accent-soft: rgba(14, 124, 115, .11); --accent-line: rgba(14, 124, 115, .28); --night-accent: #52C8B8; --night-accent-2: #7FD9C2; }
:root[data-accent="clay"]   { --accent: #B4532F; --accent-2: #D97A4D; --accent-ink: #9A4526; --accent-soft: rgba(180, 83, 47, .11); --accent-line: rgba(180, 83, 47, .28); --night-accent: #F0916B; --night-accent-2: #F5B27F; }
:root { --on-accent: #fff; }

/* Dark: chosen, not inverted. */
:root[data-theme="dark"], :root.auto-dark {
  --bg: #111317; --bg-2: #16191E; --surface: #1A1D23; --surface-2: #1F232A;
  --glass: rgba(22, 25, 31, .64); --glass-strong: rgba(28, 31, 38, .82); --glass-edge: rgba(255, 255, 255, .07);
  --ink: #ECEDEF; --ink-2: #A8ACB5; --ink-3: #737882; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --hover: rgba(255, 255, 255, .045); --press: rgba(255, 255, 255, .08);
  --late: #F07A6E; --good: #5FC58E; --warn: #F2B45A; --p2: #F2A844;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 8px 40px rgba(0, 0, 0, .45);
  --scrim: rgba(0, 0, 0, .45);
  --blob-a: .22; --blob-b: .14;
  --on-accent: #0D1018;
  color-scheme: dark;
}
:root[data-theme="dark"][data-accent="ink"], :root.auto-dark[data-accent="ink"]       { --accent: #94A8F2; --accent-2: #B3A6F5; --accent-ink: #AEBCF6; --accent-soft: rgba(148, 168, 242, .14); --accent-line: rgba(148, 168, 242, .34); }
:root[data-theme="dark"][data-accent="lagoon"], :root.auto-dark[data-accent="lagoon"] { --accent: #52C8B8; --accent-2: #7FD9C2; --accent-ink: #72D6C8; --accent-soft: rgba(82, 200, 184, .14); --accent-line: rgba(82, 200, 184, .34); }
:root[data-theme="dark"][data-accent="clay"], :root.auto-dark[data-accent="clay"]     { --accent: #F0916B; --accent-2: #F5B27F; --accent-ink: #F4A585; --accent-soft: rgba(240, 145, 107, .14); --accent-line: rgba(240, 145, 107, .34); }

/* The consistency calendar: five steps of the accent. */
:root { --hm0: var(--bg-2); --hm1: color-mix(in srgb, var(--accent) 22%, var(--surface)); --hm2: color-mix(in srgb, var(--accent) 42%, var(--surface)); --hm3: color-mix(in srgb, var(--accent) 68%, var(--surface)); --hm4: var(--accent); }

/* ---------------------------------------------------------------- base */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; background: var(--bg); }
body {
  min-height: 100vh; min-height: 100dvh; background: transparent; color: var(--ink);
  font: 400 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
svg { flex-shrink: 0; }
.hidden, [hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
h1, h2, h3, p { overflow-wrap: anywhere; }

/* The colour fields behind the glass. */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop i { position: absolute; border-radius: 50%; filter: blur(70px); }
.backdrop i:nth-child(1) { width: 60vmax; height: 60vmax; left: -18vmax; top: -24vmax; background: var(--accent); opacity: var(--blob-b); }
.backdrop i:nth-child(2) { width: 46vmax; height: 46vmax; right: -16vmax; top: 24vh; background: var(--accent-2); opacity: calc(var(--blob-b) * .8); }
.backdrop i:nth-child(3) { width: 50vmax; height: 50vmax; left: 10vw; bottom: -30vmax; background: var(--accent); opacity: calc(var(--blob-b) * .6); }

.glass { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .glass { background: var(--surface-2); } }

/* ---------------------------------------------------------------- layout */

#view {
  max-width: 680px; margin: 0 auto;
  padding: 0 16px calc(var(--tabs-h) + var(--safe-b) + 32px);
}
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#view.enter { animation: rise var(--slow) var(--ease) backwards; }
body.no-tabs #view { padding-top: calc(var(--safe-t) + 16px); padding-bottom: calc(var(--safe-b) + 32px); }

/* The header: a large Fraunces title that shrinks and turns to glass once the page scrolls. */
.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; min-height: 44px;
  margin: 0 -16px 14px; padding: calc(16px + var(--safe-t)) 16px 10px;
  border-bottom: 1px solid transparent; transition: background .2s, border-color .2s, padding .2s var(--ease);
}
body.scrolled .topbar {
  padding-top: calc(8px + var(--safe-t)); padding-bottom: 8px;
  background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border-bottom-color: var(--line);
}
.topbar h1 { font: 700 32px/1.1 var(--display); margin: 0; letter-spacing: -.015em; flex: 1; min-width: 0; transition: font-size .2s var(--ease); }
body.scrolled .topbar h1 { font-size: 22px; }
.topbar .hello { flex: 1; min-width: 0; }
.topbar .hello h1 { font-size: 30px; }
body.scrolled .topbar .hello h1 { font-size: 22px; }
.topbar .hello > span { display: block; margin-top: 4px; transition: opacity .2s, height .2s, margin .2s; }
body.scrolled .topbar .hello > span { opacity: 0; height: 0; margin: 0; overflow: hidden; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 12px; display: inline-grid; place-items: center; flex: none;
  border: 0; background: none; color: var(--ink-2); text-decoration: none; transition: background .15s, transform .12s;
}
.icon-btn:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
.icon-btn:active { transform: scale(.94); }
.icon-btn svg { width: 21px; height: 21px; }

.sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); display: inline-block; flex: none; }
.sync-dot.ok { background: var(--good); }
.sync-dot.syncing { background: var(--accent); animation: soft 2.4s var(--ease) infinite; }
.sync-dot.error, .sync-dot.offline { background: var(--late); }
@keyframes soft { 50% { opacity: .4; } }

.card {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); padding: 20px; margin-bottom: 14px;
}
.card h2, .section-title {
  font: 700 12.5px/1.3 var(--font); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin: 0 0 14px;
}
.section-title { margin: 26px 6px 10px; }
.card h3 { font: 700 20px/1.25 var(--display); margin: 0 0 6px; letter-spacing: -.005em; }
.muted { color: var(--ink-2); }
.small { font-size: 13.5px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.between > h2 { min-width: 0; }
.stack > * + * { margin-top: 14px; }
.foot { text-align: center; margin-top: 26px; }
.warn-text { color: var(--late); }

/* ---------------------------------------------------------------- buttons, chips */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 18px; border-radius: 13px; border: 0;
  font-weight: 600; font-size: 15px; text-decoration: none; background: none; color: var(--ink);
  transition: transform .12s var(--ease), background .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: scale(.97); }
.btn.primary {
  color: var(--on-accent); background: linear-gradient(145deg, var(--accent-2), var(--accent));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent);
  min-height: 52px; font-size: 16px; border-radius: 15px; padding: 0 22px; font-weight: 700;
}
.btn.soft { color: var(--accent-ink); background: var(--accent-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .35); }
:root[data-theme="dark"] .btn.soft, :root.auto-dark .btn.soft { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05); }
.btn.secondary { color: var(--ink); background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.secondary:hover, .btn.ghost:hover { background: var(--hover); }
.btn.ghost { color: var(--accent-ink); background: transparent; }
.btn.danger { color: var(--late); background: transparent; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--late) 40%, transparent); }
.sheet .btn.danger { color: #fff; background: var(--late); box-shadow: none; }
:root[data-theme="dark"] .sheet .btn.danger, :root.auto-dark .sheet .btn.danger { color: var(--on-accent); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn svg { width: 19px; height: 19px; }
.btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.btn-row > * { min-width: 0; }
.begin { min-height: 56px !important; font-size: 17px !important; margin-top: 4px; }

.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 0; border-radius: 18px; background: var(--surface); color: var(--ink); font-size: 14px; font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--line-2); text-align: center; line-height: 1.2;
  transition: background .15s, color .15s, box-shadow .15s, transform .12s var(--ease);
}
.chip:hover { background: color-mix(in srgb, var(--ink) 4%, var(--surface)); }
.chip:active { transform: scale(.97); }
.chip.on { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

.seg { display: inline-flex; flex-wrap: wrap; background: var(--bg-2); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; }
.seg button { white-space: nowrap; border: 0; background: none; padding: 7px 12px; border-radius: 9px; font-size: 14px; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.seg.wide { display: flex; width: 100%; margin-bottom: 16px; }
.seg.wide button { flex: 1; padding: 10px 6px; font-size: 15px; }

/* ---------------------------------------------------------------- tiles */

.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile {
  background: var(--surface); border-radius: 18px; padding: 14px 15px;
  box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); min-width: 0;
}
.tile .k { font-size: 13px; color: var(--ink-2); display: block; }
.tile .v { font: 700 22px/1.25 var(--display); font-variant-numeric: tabular-nums; display: block; margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: -.01em; }
.tile .s { font-size: 12px; color: var(--ink-3); display: block; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--bg-2); color: var(--ink-2); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 9px 12px; font-size: 15px; margin: 0; }
.kv dt { color: var(--ink-2); }
.kv dd { margin: 0; text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- charts */

.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-2); font-size: 10px; font-family: var(--font); }
.chart .bar { fill: color-mix(in srgb, var(--accent-2) 55%, var(--surface)); }
.chart .bar.today { fill: var(--accent); }
.chart .hit { fill: transparent; cursor: pointer; }
.chart .hit.hovered { fill: var(--hover); }
.chart .ref { stroke: var(--accent-ink); stroke-width: 1.5; stroke-dasharray: 4 4; opacity: .7; }
.chart .ref-label { fill: var(--ink-2); font-size: 10px; font-weight: 700; paint-order: stroke; stroke: var(--surface); stroke-width: 3px; stroke-linejoin: round; }
.chart .line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart .line.before { stroke: var(--ink-3); stroke-dasharray: 5 4; }
.chart .line.after { stroke: var(--accent); }
.chart .dot { stroke: var(--surface); stroke-width: 1.5; }
.chart .dot.before { fill: var(--ink-3); }
.chart .dot.after { fill: var(--accent); }
.chart .hm { stroke: none; cursor: pointer; }
.chart .hm.l0 { fill: var(--hm0); } .chart .hm.l1 { fill: var(--hm1); } .chart .hm.l2 { fill: var(--hm2); }
.chart .hm.l3 { fill: var(--hm3); } .chart .hm.l4 { fill: var(--hm4); }
.chart .hm.now { stroke: var(--ink-2); stroke-width: 1.2; }
.chart .hm.hovered { stroke: var(--ink); stroke-width: 1.2; }
.heat-wrap { overflow-x: auto; scrollbar-width: none; direction: rtl; }
.heat-wrap .chart { direction: ltr; min-width: 360px; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; font-size: 12px; color: var(--ink-2); margin-top: 10px; }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 6px; background: var(--accent); }
.legend i.before { background: repeating-linear-gradient(90deg, var(--ink-3) 0 5px, transparent 5px 8px); }
.legend i.after { background: var(--accent); }
.legend .sw { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend .sw + .sw { margin-left: -10px; }
.tip {
  position: fixed; z-index: 90; pointer-events: none; opacity: 0; transform: translateY(4px);
  background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--bg); border-radius: 12px; padding: 7px 11px; font-size: 12.5px;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  transition: opacity .18s var(--ease), transform .18s var(--ease); box-shadow: var(--shadow-2); white-space: nowrap;
}
.tip.on { opacity: 1; transform: none; }
.tip span { display: block; opacity: .75; }
.tip strong { font-size: 14.5px; font-variant-numeric: tabular-nums; }

.feel-sum { margin: 0 0 10px; }
.feel-split { display: flex; gap: 16px; flex-wrap: wrap; font-size: 13.5px; color: var(--ink-2); margin-bottom: 12px; }
.feel-split b { color: var(--ink); }
.tod { display: grid; gap: 9px; }
.tod-row { display: grid; grid-template-columns: 112px 1fr 26px; align-items: center; gap: 10px; font-size: 14px; color: var(--ink-2); }
.tod-row.fav { color: var(--ink); font-weight: 600; }
.tod-bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
.tod-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); }
.tod-row .n { text-align: right; font-variant-numeric: tabular-nums; }

.mile-group + .mile-group { margin-top: 16px; }
.mile-group h3 { font: 700 15px var(--font) !important; color: var(--ink); margin: 0 0 4px !important; letter-spacing: -.005em !important; }
.miles { list-style: none; margin: 0; padding: 0; }
.miles li { display: grid; grid-template-columns: 24px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.miles li:last-child { border-bottom: 0; }
.miles .m { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--line-2); margin: 0 auto; }
.miles li.done { color: var(--ink); }
.miles li.done .m { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.miles li.next { color: var(--ink); }
.miles li.next .m { border-color: var(--accent); border-style: dashed; }
.miles .when { font-size: 13px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- lists and forms */

.list { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); overflow: hidden; margin-bottom: 14px; }
.list > * { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 11px 18px; border: 0; border-bottom: 1px solid var(--line); width: 100%; text-align: left; background: none; text-decoration: none; color: var(--ink); cursor: pointer; transition: background .15s; }
.list > *:hover { text-decoration: none; }
.list > *:last-child { border-bottom: 0; }
.list > * > svg { color: var(--ink-2); flex: none; width: 20px; height: 20px; }
.list .title { font-weight: 600; display: block; }
.list .sub { font-size: 13.5px; color: var(--ink-2); display: block; }
.avatar { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }

.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 14px; font-weight: 600; margin-bottom: 7px; }
.field > small { display: block; font-size: 13px; color: var(--ink-2); margin-top: 8px; }
.input, textarea.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-size: 16px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--ink-3); }
textarea.input { min-height: 88px; resize: vertical; line-height: 1.5; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.big { font: 700 34px/1.1 var(--display); text-align: center; font-variant-numeric: tabular-nums; }
.input.code { font: 700 28px/1 var(--font); letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.input[type="date"], .input[type="time"] { min-width: 0; display: block; -webkit-appearance: none; appearance: none; }
.range { width: 100%; accent-color: var(--accent); height: 30px; }
.toggle { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; }
.toggle > .title { flex: 1 1 auto; }
.toggle .title { display: block; font-weight: 600; }
.toggle .sub { display: block; font-size: 13px; color: var(--ink-2); }
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; margin: 0; position: absolute; cursor: pointer; z-index: 1; }
.switch i { position: absolute; inset: 0; border-radius: 14px; background: var(--line-2); transition: background .2s; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .22s var(--ease); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.error-text { color: var(--late); font-size: 14px; margin: 4px 0 12px; }

/* ---------------------------------------------------------------- accent picker (section 8.7) */

.appearance .toggle + .accents { margin-top: 16px; }
.accents { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.accent-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px; border: 0; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line-2); text-align: left; background: var(--surface-2); color: var(--ink); transition: box-shadow .15s, transform .12s var(--ease); }
.accent-card:active { transform: scale(.97); }
.accent-card.on { box-shadow: inset 0 0 0 2px var(--accent); background: var(--accent-soft); }
.accent-card b { font-size: 15px; margin-top: 6px; }
.accent-card small { font-size: 12px; color: var(--ink-2); line-height: 1.3; }
.ac-swatch { display: flex; width: 100%; height: 38px; border-radius: 10px; overflow: hidden; }
.ac-swatch i { flex: 1; }
.ac-swatch i:first-child { background: linear-gradient(145deg, color-mix(in srgb, var(--a1) 70%, #fff), var(--a1)); }
.ac-swatch i:last-child { background: #15181D; position: relative; }
.ac-swatch i:last-child::after { content: ''; position: absolute; inset: 9px 12px; border-radius: 6px; background: var(--a2); }
@media (max-width: 420px) { .accent-card small { display: none; } }

/* ---------------------------------------------------------------- tabs, and the sidebar on wide screens */

#tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  padding: 6px max(10px, env(safe-area-inset-left)) calc(var(--safe-b) + 6px);
  border-top: 1px solid var(--line);
}
#tabs .brand { display: none; }
#tabs .inner { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; }
#tabs a {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0 2px; border-radius: 12px;
  text-decoration: none; color: var(--ink-3); font-size: 11px; font-weight: 600; transition: color .15s;
}
#tabs a svg { width: 25px; height: 25px; }
#tabs a.on { color: var(--accent-ink); }
#tabs a.center { color: var(--ink-2); }
#tabs a.center.on { color: var(--accent-ink); }
#tabs a.center .dot {
  width: 54px; height: 54px; margin-top: -22px; border-radius: 20px; display: grid; place-items: center;
  background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--on-accent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .30), 0 10px 26px -4px color-mix(in srgb, var(--accent) 50%, transparent), var(--shadow-1);
  transition: transform .18s var(--ease);
}
#tabs a.center:hover .dot { transform: translateY(-1px) scale(1.03); }
#tabs a.center:active .dot { transform: scale(.95); }
#tabs a.center .dot svg { width: 26px; height: 26px; }
body.no-tabs #tabs { display: none; }

@media (min-width: 900px) {
  #tabs {
    top: 0; right: auto; bottom: 0; width: var(--side); padding: calc(24px + var(--safe-t)) 14px 20px;
    border-top: 0; border-right: 1px solid var(--line); display: flex; flex-direction: column;
  }
  #tabs .brand { display: flex; align-items: center; gap: 10px; padding: 0 8px 22px; color: var(--ink); text-decoration: none; }
  #tabs .brand b { font: 700 21px/1 var(--display); letter-spacing: -.01em; }
  #tabs .brand small { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 400; margin-top: 3px; }
  .brand-mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--on-accent); background: linear-gradient(145deg, var(--accent-2), var(--accent)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
  .brand-mark svg { width: 18px; height: 18px; }
  #tabs .inner { display: flex; flex-direction: column; align-items: stretch; gap: 2px; max-width: none; margin: 0; }
  #tabs a { flex-direction: row; gap: 12px; padding: 10px 12px; font-size: 15px; font-weight: 600; color: var(--ink-2); }
  #tabs a svg { width: 21px; height: 21px; }
  #tabs a:hover { background: var(--hover); color: var(--ink); text-decoration: none; }
  #tabs a.on { background: var(--accent-soft); color: var(--accent-ink); }
  #tabs a.center { order: -1; margin-bottom: 12px; padding: 0 18px; min-height: 48px; justify-content: center; gap: 8px; border-radius: 15px;
    color: var(--on-accent); background: linear-gradient(145deg, var(--accent-2), var(--accent));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 2px 10px color-mix(in srgb, var(--accent) 30%, transparent); }
  #tabs a.center:hover { background: linear-gradient(145deg, var(--accent-2), var(--accent)); color: var(--on-accent); }
  #tabs a.center .dot { width: auto; height: auto; margin: 0; background: none; box-shadow: none; border-radius: 0; color: inherit; }
  #tabs a.center .dot svg { width: 21px; height: 21px; }
  body:not(.no-tabs) #view { margin-left: max(var(--side), calc(var(--side) + (100vw - var(--side) - 680px) / 2)); margin-right: auto; padding-bottom: 48px; }
  body:not(.no-tabs) .topbar { padding-top: calc(26px + var(--safe-t)); }
}

/* ---------------------------------------------------------------- sheets */

.scrim {
  position: fixed; inset: 0; z-index: 60; background: var(--scrim);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade .22s var(--ease) both;
}
.scrim.leaving { animation: fadeout .22s var(--ease) both; pointer-events: none; }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
.sheet {
  width: 100%; max-width: 640px; max-height: 88vh; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--glass-strong); -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  border-radius: 26px 26px 0 0; box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge);
  padding: 8px 20px calc(var(--safe-b) + 20px);
  animation: slide .32s var(--ease) both;
}
.scrim.leaving .sheet { animation: slidedown .22s var(--ease) both; }
@keyframes slide { from { transform: translateY(24px); } }
@keyframes slidedown { to { transform: translateY(40px); } }
.sheet .grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet h2 { font: 700 21px/1.2 var(--display); margin: 0 0 16px; letter-spacing: -.005em; }
.sheet:focus { outline: none; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .sheet { background: var(--surface-2); } }
@media (min-width: 700px) {
  .scrim { align-items: flex-start; padding-top: 9vh; }
  .sheet { border-radius: 24px; max-width: 560px; max-height: 82vh; padding-top: 18px; animation-name: pop; }
  .scrim.leaving .sheet { animation-name: popout; }
  .sheet .grab { display: none; }
  @keyframes pop { from { transform: translateY(-8px) scale(.985); } }
  @keyframes popout { to { transform: scale(.985); } }
}
/* Sheets opened over the counter stay in the night colours. */
.scrim.dark, body.counting .scrim { background: rgba(3, 4, 8, .55); -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.scrim.dark .sheet, body.counting .scrim .sheet {
  --ink: var(--night-ink); --ink-2: #A8ACB5; --ink-3: #737882; --line: rgba(255, 255, 255, .07); --line-2: rgba(255, 255, 255, .13);
  --surface: #1A1D23; --surface-2: #1F232A; --hover: rgba(255, 255, 255, .045);
  --accent: var(--night-accent); --accent-2: var(--night-accent-2); --accent-ink: var(--night-accent);
  --accent-soft: color-mix(in srgb, var(--night-accent) 14%, transparent); --accent-line: color-mix(in srgb, var(--night-accent) 34%, transparent);
  --on-accent: #0D1018;
  background: rgba(24, 27, 34, .94); color: var(--night-ink); box-shadow: 0 8px 40px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .07);
}

.toast {
  position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--safe-b) + 18px); z-index: 80;
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; padding: 11px 12px 11px 18px; border-radius: 16px; max-width: calc(100vw - 32px);
  background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--bg); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-2); font-size: 15px; font-weight: 500; transition: opacity .2s, transform .28s var(--ease);
}
body.no-tabs .toast { bottom: calc(var(--safe-b) + 22px); }
.toast.on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { background: none; border: 0; color: color-mix(in srgb, var(--accent-2) 70%, var(--bg)); font-weight: 700; padding: 4px 8px; border-radius: 8px; }
:root[data-theme="dark"] .toast button, :root.auto-dark .toast button { color: var(--accent-ink); filter: brightness(.7) saturate(1.4); }
@media (min-width: 900px) { body:not(.no-tabs) .toast { bottom: 28px; left: calc(50% + var(--side) / 2); } }

/* ---------------------------------------------------------------- Abhyasa's charts */

.chart .line { stroke: var(--accent); stroke-width: 2.5; }
.chart .plan { fill: none; stroke: var(--ink-3); stroke-width: 1.5; stroke-dasharray: 2 4; }
.chart .dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--ink-3) 0 2px, transparent 2px 5px); }
.legend i.gold { background: repeating-linear-gradient(90deg, var(--accent-ink) 0 4px, transparent 4px 8px); }
.legend .sw { vertical-align: -1px; }

/* ---------------------------------------------------------------- the series header */

.series-switch {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  background: none; border: 0; padding: 4px 0; border-radius: 12px; color: var(--ink);
}
.series-switch .t { min-width: 0; }
.series-switch .name { font: 700 30px/1.1 var(--display); letter-spacing: -.015em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; transition: font-size .2s var(--ease); }
body.scrolled .series-switch .name { font-size: 22px; }
.series-switch .sub { font-size: 14px; color: var(--ink-2); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; transition: opacity .2s, height .2s; }
body.scrolled .series-switch .sub { opacity: 0; height: 0; margin: 0; }
.series-switch svg { flex: none; color: var(--ink-3); width: 20px; height: 20px; }

/* ---------------------------------------------------------------- hero: the series' own ring */

.hero {
  position: relative; text-align: center; padding: 22px 16px 18px;
}
.ring-wrap { position: relative; width: min(260px, 72vw); margin: 0 auto; aspect-ratio: 1;
  --c: var(--accent); --ring-a: color-mix(in srgb, var(--c) 62%, #fff); --ring-b: var(--c); }
:root[data-theme="dark"] .ring-wrap, :root.auto-dark .ring-wrap { --ring-a: color-mix(in srgb, var(--c) 70%, #fff); --ring-b: color-mix(in srgb, var(--c) 88%, #fff); }
.ring { width: 100%; height: 100%; display: block; overflow: visible; }
.ring-track { fill: none; stroke: var(--bg-2); }
:root[data-theme="dark"] .ring-track, :root.auto-dark .ring-track { stroke: var(--line-2); }
.ring-fill { fill: none; stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.ring-tick { stroke: var(--line-2); stroke-width: 2; stroke-linecap: round; }
.ring-tick.on { stroke: var(--c); }
.ring-bead { fill: var(--surface); stroke: var(--ring-b); stroke-width: 3; }
.ring-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; padding: 0 18%; }
.ring-center .big { font: 700 clamp(30px, 9.5vw, 42px)/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ring-center .of { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.pct-pill {
  display: inline-block; margin: 10px auto 0; padding: 3px 11px; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 700; font-size: 14px; font-variant-numeric: tabular-nums;
}
.hero-foot { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; margin-top: 18px; }
.hero-foot div { padding: 6px 2px; }
.hero-foot b { display: block; font: 700 20px/1.2 var(--display); font-variant-numeric: tabular-nums; }
.hero-foot span { font-size: 12.5px; color: var(--ink-2); }
.mantra-line {
  font: italic 400 16px/1.6 var(--verse); color: var(--ink-2); margin: 0 auto 14px; max-width: 34ch; white-space: pre-line;
}

/* ---------------------------------------------------------------- today */

.today-card { display: grid; gap: 14px; }
.today-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.today-top .n { font: 700 34px/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.today-top .n small { font: 500 14px var(--font); color: var(--ink-2); margin-left: 4px; letter-spacing: 0; }
.today-top .btn.primary { min-height: 42px; font-size: 15px; border-radius: 13px; padding: 0 16px; }
.goal-bar { height: 8px; border-radius: 99px; background: var(--bg-2); overflow: hidden; }
:root[data-theme="dark"] .goal-bar, :root.auto-dark .goal-bar { background: var(--line-2); }
.goal-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent-2), var(--accent)); transition: width .6s var(--ease); }
.quick { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick .chip { display: block; min-height: 52px; padding: 9px 6px; border-radius: 15px; background: var(--surface-2); }
.chip small { display: block; font-weight: 400; color: var(--ink-2); font-size: 12px; margin-top: 2px; }

.pace { display: grid; gap: 12px; }
.pace .headline { font: 700 20px/1.3 var(--display); letter-spacing: -.005em; }
.badge.good { background: color-mix(in srgb, var(--good) 12%, transparent); color: var(--good); }
.badge.warn { background: color-mix(in srgb, var(--p2) 14%, transparent); color: var(--warn); }
.badge.neutral { background: var(--bg-2); color: var(--ink-2); }
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; font-size: 13px; }

/* milestones */
.miles { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.miles li { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.miles li:last-child { border-bottom: 0; }
.miles .m { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-2); margin: 0 auto; }
.miles li.done .m { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.miles li.next .m { border-color: var(--accent); border-style: dashed; }
.miles .when { font-size: 13px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- history */

.month { margin-bottom: 20px; }
.month-head { display: flex; justify-content: space-between; align-items: baseline; margin: 0 6px 8px; gap: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.month-head h3 { font: 700 18px var(--display); margin: 0; letter-spacing: -.005em; }
.month-head span { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; }
.days { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); overflow: hidden; }
.day { display: grid; grid-template-columns: 46px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.day:last-child { border-bottom: 0; }
.day .date { text-align: center; line-height: 1.1; }
.day .date b { display: block; font: 700 21px var(--display); font-variant-numeric: tabular-nums; }
.day .date span { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.day .items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.entry-pill {
  border: 0; background: var(--bg-2); color: var(--ink); border-radius: 10px; padding: 5px 10px; min-height: 30px;
  font-size: 13.5px; font-variant-numeric: tabular-nums; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: background .15s, transform .12s var(--ease);
}
.entry-pill:hover { background: var(--accent-soft); }
.entry-pill:active { transform: scale(.97); }
.entry-pill em { font-style: normal; color: var(--ink-2); margin-left: 4px; font-weight: 400; }
.day .sum { font: 700 17px var(--display); font-variant-numeric: tabular-nums; }
.empty .art { width: 120px; margin: 0 auto 10px; opacity: .9; }

/* ---------------------------------------------------------------- empty states, list details */

.empty { text-align: center; padding: 34px 22px; color: var(--ink-2); }
.empty h3 { font-family: var(--display); color: var(--ink); }
.grow { flex: 1; min-width: 0; }
.chev { color: var(--ink-3); display: grid; }
@media (hover: hover) { .list > *:hover { background: var(--hover); } }

/* ---------------------------------------------------------------- series */

.series-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 0%, transparent); }
.list .series-dot { width: 14px; height: 14px; }
.mini-bar { height: 5px; border-radius: 9px; background: var(--bg-2); margin-top: 7px; overflow: hidden; }
:root[data-theme="dark"] .mini-bar, :root.auto-dark .mini-bar { background: var(--line-2); }
.mini-bar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 0; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08); transition: transform .12s var(--ease), box-shadow .15s; }
.swatch:active { transform: scale(.94); }
.swatch.on { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink-2); }
select.input { font-size: 16px; }

/* ---------------------------------------------------------------- the counter: always at night, in the chosen accent */

body.counting, html:has(body.counting) { background: var(--night); }
body.counting .backdrop { display: none; }
.counter {
  position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column;
  color: var(--night-ink); user-select: none; -webkit-user-select: none; touch-action: manipulation;
  background:
    radial-gradient(90% 55% at 50% 45%, color-mix(in srgb, var(--night-accent) 22%, transparent), transparent 75%),
    linear-gradient(180deg, color-mix(in srgb, var(--night-accent) 10%, var(--night-2)), var(--night) 70%);
  padding: calc(var(--safe-t) + 10px) 16px calc(var(--safe-b) + 16px);
}
.counter .bar-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.counter .icon-btn { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12); color: var(--night-ink); }
.counter .icon-btn:hover { background: rgba(255, 255, 255, .12); color: var(--night-ink); }
.counter .title { text-align: center; flex: 1; min-width: 0; }
.counter .title b { display: block; font: 700 18px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.counter .title span { font-size: 13px; color: rgba(236, 237, 239, .66); }
.tap-zone { flex: 1; display: grid; place-items: center; position: relative; cursor: pointer; outline: none; min-height: 0; }
.tap-zone .mala-wrap { position: relative; width: min(86vw, 58vh, 420px); aspect-ratio: 1; }
.mala { width: 100%; height: 100%; display: block; overflow: visible; }
.bead { fill: rgba(236, 237, 239, .14); transition: fill .18s; }
.bead.lit { fill: var(--night-accent); }
.bead.meru { fill: var(--dawn); }
.tap-zone .count { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.tap-zone .count b { font: 700 clamp(64px, 24vw, 120px)/1 var(--display); font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.tap-zone .count span { font-size: 15px; color: rgba(236, 237, 239, .7); margin-top: 8px; }
.tap-zone .ripple {
  position: absolute; width: 60px; height: 60px; border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--night-accent) 35%, transparent); transform: translate(-50%, -50%) scale(0); animation: rip .5s var(--ease) forwards;
}
@keyframes rip { to { transform: translate(-50%, -50%) scale(4); opacity: 0; } }
.tap-zone.pulse .mala-wrap { animation: done .7s var(--ease); }
@keyframes done { 30% { transform: scale(1.04); filter: drop-shadow(0 0 30px color-mix(in srgb, var(--night-accent) 60%, transparent)); } }
.counter .stats-line { display: flex; justify-content: center; gap: 22px; text-align: center; margin: 4px 0 14px; }
.counter .stats-line b { display: block; font: 700 22px var(--display); font-variant-numeric: tabular-nums; }
.counter .stats-line span { font-size: 12.5px; color: rgba(236, 237, 239, .64); }
.counter .controls { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 10px; max-width: 520px; margin: 0 auto; width: 100%; }
.counter .controls .btn { min-height: 52px; white-space: nowrap; padding: 0 12px; min-width: 0; overflow: hidden; text-overflow: ellipsis; border-radius: 15px; }
:root:not([data-script="latin"]) .counter .controls .btn { white-space: normal; line-height: 1.2; padding: 4px 8px; }
.counter .btn.secondary { background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); color: var(--night-ink); }
.counter .btn.primary {
  --accent: var(--night-accent); --accent-2: var(--night-accent-2); color: #0D1018;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 4px 18px color-mix(in srgb, var(--night-accent) 30%, transparent);
}
.counter .hint { text-align: center; font-size: 13px; color: rgba(236, 237, 239, .6); margin-top: 10px; }
.counter .btn:focus { outline: none; }
.counter .btn:focus-visible, .counter .icon-btn:focus-visible { outline: 2px solid var(--night-accent); outline-offset: 2px; }
.tap-zone:focus { outline: none; }
.tap-zone:focus-visible .mala-wrap { outline: 2px solid color-mix(in srgb, var(--night-accent) 60%, transparent); outline-offset: 8px; border-radius: 50%; }

/* ---------------------------------------------------------------- celebration */

.celebrate { text-align: center; padding: 10px 4px 4px; }
.celebrate .glow {
  width: 140px; height: 140px; margin: 6px auto 14px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle, color-mix(in srgb, var(--dawn) 70%, transparent), transparent 70%);
}
.celebrate .glow img { box-shadow: 0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent) !important; border-radius: 23% !important; }
.celebrate h2 { font: 700 28px/1.15 var(--display); margin: 0 0 8px; letter-spacing: -.01em; }
.celebrate p { color: var(--ink-2); margin: 0 0 18px; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 9px; height: 9px; border-radius: 50%; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(105vh) rotate(540deg); } }

/* ---------------------------------------------------------------- languages
   Indic scripts have no capitals, and spacing the letters of a word apart
   breaks the conjuncts, so small headings keep their shape. */
:root:not([data-script="latin"]) .card h2, :root:not([data-script="latin"]) .section-title,
:root:not([data-script="latin"]) .day .date span, :root:not([data-script="latin"]) .list-head { text-transform: none; letter-spacing: 0; font-size: 14px; }
:root:not([data-script="latin"]) body { line-height: 1.6; }
:root:not([data-script="latin"]) :is(.topbar h1, .series-switch .name, .welcome h1) { letter-spacing: 0; line-height: 1.25; }
.lang-row { display: flex; justify-content: flex-end; margin: -2vh 0 8px; }
.lang-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px 0 10px; border-radius: 18px; border: 0;
  box-shadow: inset 0 0 0 1px var(--line-2); background: var(--surface); color: var(--ink-2); font: 600 14px/1 var(--font); }
.lang-chip svg { width: 18px; height: 18px; }
.lang-list { max-height: 62vh; overflow-y: auto; }

/* ---------------------------------------------------------------- welcome */

.welcome { text-align: center; padding-top: 5vh; max-width: 460px; margin: 0 auto; }
.welcome .logo {
  width: 96px; height: 96px; margin: 0 auto 18px; border-radius: 23%; display: block;
  filter: drop-shadow(0 12px 28px color-mix(in srgb, var(--accent) 35%, transparent)); animation: float 6s ease-in-out infinite;
}
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
.welcome h1 { font: 700 46px/1.05 var(--display); margin: 0 0 10px; letter-spacing: -.02em; }
.welcome .lede { font-size: 19px; line-height: 1.45; color: var(--ink-2); max-width: 30ch; margin: 0 auto 26px; }
.welcome .card { text-align: left; }
.welcome .fine { font-size: 13px; color: var(--ink-2); margin-top: 18px; }
.feature-list { list-style: none; padding: 0; margin: 24px 0 0; text-align: left; display: grid; gap: 14px; }
.feature-list li { display: grid; grid-template-columns: 34px 1fr; gap: 14px; align-items: start; font-size: 15px; color: var(--ink-2); }
.feature-list li b { color: var(--ink); display: block; font-weight: 600; }
.feature-list .fi { width: 34px; height: 34px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.feature-list .fi svg { width: 20px; height: 20px; }


/* ---------------------------------------------------------------- daylight glass (light mode), from tokens.css */

:root:not([data-theme="dark"]):not(.auto-dark) {
  --blob-b: .20;
  --warm: #FFC996; --warm-o: .30;
  --glass: rgba(255, 255, 255, .66);
  --glass-strong: rgba(255, 255, 255, .80);
  --glass-edge: rgba(255, 255, 255, .95);
  --glass-rim: rgba(255, 255, 255, .75);
  --milk: rgba(255, 255, 255, .74);
  --scrim: color-mix(in srgb, var(--accent) 10%, rgba(240, 238, 232, .38));
  --shadow-glass: 0 1px 1px rgba(20, 22, 30, .03), 0 12px 32px -8px color-mix(in srgb, var(--accent) 22%, rgba(20, 22, 30, .10));
  --shadow-2: 0 2px 6px rgba(20, 22, 30, .05), 0 24px 56px -12px color-mix(in srgb, var(--accent) 28%, rgba(20, 22, 30, .14));
}
html:not([data-theme="dark"]):not(.auto-dark) { background: linear-gradient(180deg, #F9F7F2 0%, #F4F2EC 55%, #F1EFEA 100%) fixed; }
html[data-accent="clay"]:not([data-theme="dark"]):not(.auto-dark) { --warm-o: .16; }
html:not([data-theme="dark"]):not(.auto-dark) .backdrop i { filter: blur(80px) saturate(140%); }
html:not([data-theme="dark"]):not(.auto-dark) .backdrop::before {
  content: ''; position: absolute; width: 44vmax; height: 44vmax; right: -12vmax; top: -14vmax; border-radius: 50%;
  background: var(--warm); opacity: var(--warm-o); filter: blur(90px);
}
html:not([data-theme="dark"]):not(.auto-dark) .glass {
  background: linear-gradient(180deg, rgba(255, 255, 255, .82), var(--glass));
  -webkit-backdrop-filter: saturate(200%) blur(24px); backdrop-filter: saturate(200%) blur(24px);
}
html:not([data-theme="dark"]):not(.auto-dark) #tabs { border-top-color: var(--glass-rim); box-shadow: 0 -1px 0 rgba(20, 22, 30, .05), 0 -10px 30px -12px color-mix(in srgb, var(--accent) 18%, transparent); }
@media (min-width: 900px) {
  html:not([data-theme="dark"]):not(.auto-dark) #tabs { border-right-color: var(--glass-rim); box-shadow: 1px 0 0 rgba(20, 22, 30, .05); }
}
html:not([data-theme="dark"]):not(.auto-dark) body.scrolled .topbar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .90), rgba(255, 255, 255, .76));
  -webkit-backdrop-filter: saturate(200%) blur(24px); backdrop-filter: saturate(200%) blur(24px);
  border-bottom-color: rgba(20, 22, 30, .06); box-shadow: inset 0 -1px 0 var(--glass-rim);
}
html:not([data-theme="dark"]):not(.auto-dark) body:not(.counting) .scrim:not(.dark) { -webkit-backdrop-filter: blur(4px) saturate(120%); backdrop-filter: blur(4px) saturate(120%); }
html:not([data-theme="dark"]):not(.auto-dark) body:not(.counting) .scrim:not(.dark) .sheet {
  background: linear-gradient(180deg, rgba(255, 255, 255, .90), var(--glass-strong) 40%);
  -webkit-backdrop-filter: saturate(200%) blur(30px); backdrop-filter: saturate(200%) blur(30px);
  box-shadow: var(--shadow-2), inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px var(--glass-rim);
}
/* Milk-glass cards: the colour fields glow faintly through. */
html:not([data-theme="dark"]):not(.auto-dark) :is(.card, .list, .days, .tile, .accent-card) {
  background: var(--milk);
  -webkit-backdrop-filter: saturate(160%) blur(16px); backdrop-filter: saturate(160%) blur(16px);
}
html:not([data-theme="dark"]):not(.auto-dark) :is(.card, .list, .days, .tile) { box-shadow: var(--shadow-glass), inset 0 1px 0 var(--glass-edge), inset 0 0 0 1px rgba(20, 22, 30, .05); }
html:not([data-theme="dark"]):not(.auto-dark) .accent-card.on { background: color-mix(in srgb, var(--accent) 10%, var(--milk)); box-shadow: inset 0 0 0 2px var(--accent); }
html:not([data-theme="dark"]):not(.auto-dark) .toast { background: color-mix(in srgb, var(--ink) 80%, transparent); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px); box-shadow: var(--shadow-2), inset 0 1px 0 rgba(255, 255, 255, .12); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  html:not([data-theme="dark"]):not(.auto-dark) :is(.glass, .sheet, body.scrolled .topbar) { background: var(--surface-2); }
}

/* ---------------------------------------------------------------- motion */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
  .welcome .logo, .celebrate .glow { animation: none !important; }
  .confetti { display: none; }
}

