/* Achala. 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
   (Ink by default, Lagoon or Clay); glass only for the frame, never behind
   reading. The sitting itself always happens at night, in the chosen accent.

   Achala's own tokens, beyond the shared set:
     --dawn            the warm centre of the glowing circle (the icon's peach)
     --night-*         the sitting screen, the same in light and dark mode
     --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;
}

/* ---------------------------------------------------------------- tokens (from tokens.css) */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, 'Noto Sans', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Fraunces', 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;
  --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;
  --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); }

/* ---------------------------------------------------------------- home */

.hero { text-align: center; padding: 2px 0 4px; display: grid; justify-items: center; gap: 6px; }
.hero-orb {
  position: relative; display: block; width: min(236px, 64vw); aspect-ratio: 1; margin: 2px auto 10px; padding: 0;
  border: 0; background: none; color: inherit; border-radius: 50%; transition: transform .18s var(--ease);
}
.hero-orb:active { transform: scale(.96); }
.hero-orb:focus-visible { outline-offset: 6px; border-radius: 50%; }
.goal-ring { position: absolute; inset: 0; width: 100%; height: 100%; }
.gr-track { fill: none; stroke: var(--line-2); }
.gr-fill { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s var(--ease); }
.hero-orb .glow {
  position: absolute; inset: 15%; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dawn) 60%, var(--surface)) 0%, color-mix(in srgb, var(--accent-2) 30%, var(--surface)) 46%, color-mix(in srgb, var(--accent-2) 0%, transparent) 72%);
  animation: breathe 12s var(--ease) infinite; transition: filter .3s var(--ease);
}
:root[data-theme="dark"] .hero-orb .glow, :root.auto-dark .hero-orb .glow {
  background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dawn) 30%, var(--surface)) 0%, color-mix(in srgb, var(--accent-2) 26%, var(--surface)) 46%, color-mix(in srgb, var(--accent-2) 0%, transparent) 72%);
}
.hero-orb:hover .glow, .hero-orb:focus-visible .glow { filter: brightness(1.06) saturate(1.1); }
@keyframes breathe { 0%, 100% { transform: scale(.94); opacity: .85; } 50% { transform: scale(1.02); opacity: 1; } }
.hero-center { position: absolute; inset: 0; display: grid; place-content: center; }
.hero-center > span { display: block; }
.hero-center .big { font: 700 44px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.hero-center .big small { font: 500 16px var(--font); color: var(--ink-2); letter-spacing: 0; }
.hero-center .of { font-size: 14px; color: var(--ink-2); margin-top: 6px; }
.start-label { display: grid; justify-items: center; gap: 2px; margin-bottom: 4px; }
.start-label .what { font: 700 22px/1.2 var(--display); letter-spacing: -.01em; }
.start-label .how { font-size: 14px; color: var(--ink-2); }
.start-label .tap { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); }
.start-label .tap svg { width: 12px; height: 12px; }

.me {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none; position: relative;
  font: 700 16px/1 var(--display); text-decoration: none; color: var(--accent-ink);
  background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line);
}
.me:hover { text-decoration: none; }
.me::after {
  content: ''; position: absolute; right: -1px; bottom: -1px; width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-3); border: 2px solid var(--bg);
}
.me.ok::after { background: var(--good); }
.me.syncing::after { background: var(--accent); animation: soft 2.4s var(--ease) infinite; }
.me.error::after, .me.offline::after { background: var(--late); }

.page-line { margin: -6px 4px 18px; color: var(--ink-2); font: italic 400 16px/1.5 var(--verse); }

.words-card { padding-bottom: 18px; }
.link-btn { background: none; border: 0; padding: 6px 2px; color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
#wbody { transition: opacity .3s var(--ease); }
#wbody.swap { opacity: 0; }
.words { margin: 14px 0 0; }
.words blockquote { margin: 0; }
.words p { margin: 0; }
.words .sa { font: 500 19px/1.6 'Noto Serif Devanagari', 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Devanagari Sangam MN', serif; color: var(--ink); }
.words .tr { font-size: 13.5px; font-style: italic; color: var(--ink-2); margin-top: 4px; line-height: 1.5; }
.words .en { font: italic 400 19px/1.5 var(--verse); color: var(--ink); margin-top: 10px; }
.words.quote .en { margin-top: 0; font-size: 20px; }
.words figcaption { margin-top: 10px; font-size: 13px; color: var(--ink-2); letter-spacing: .02em; }
.words figcaption span { display: block; font-size: 12px; color: var(--ink-3); }
.words.quiet .en { font-size: 17.5px; }
.words.quiet .sa { font-size: 17px; }

.quick-row { display: flex; gap: 6px; justify-content: center; flex-wrap: nowrap; margin: 16px 0 20px; }
.quick-row .chip { flex: 0 1 auto; min-width: 0; white-space: nowrap; padding: 0 12px; }

.recent-row { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; padding: 4px 0 0; border-radius: 12px; }
.recent-row .sub { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 2px; }
.k-ico { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.k-ico svg { width: 20px; height: 20px; }
.note-line { display: block; font-size: 14px; color: var(--ink-2); margin-top: 6px; font-style: italic; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.quiet-intro p { margin: 0; }
.next-mile { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-size: 13.5px; margin: 18px 0 0; }
.next-mile svg { width: 18px; height: 18px; color: var(--accent); }
.grow { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- 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; 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; }

/* ---------------------------------------------------------------- sit setup */

.durations { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dur {
  border: 0; background: var(--surface-2); border-radius: 16px; padding: 12px 4px 10px;
  display: grid; justify-items: center; gap: 0; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .15s, box-shadow .15s, transform .12s var(--ease);
}
.dur:active, .pattern:active, .choice:active, .day-chip:active { transform: scale(.97); }
.dur b { font: 700 24px/1.1 var(--display); font-variant-numeric: tabular-nums; }
.dur span { font-size: 12px; color: var(--ink-2); }
.dur.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.dur.on b { color: var(--accent-ink); }
.patterns { display: grid; gap: 8px; }
.pattern {
  display: grid; gap: 2px; text-align: left; padding: 13px 15px; border-radius: 16px; border: 0;
  background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background .15s, box-shadow .15s, transform .12s var(--ease);
}
.pattern span { font-size: 13.5px; color: var(--ink-2); }
.pattern.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.steppers { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stepper { background: var(--surface-2); border-radius: 14px; padding: 10px 12px; box-shadow: inset 0 0 0 1px var(--line); }
.stepper > span { display: block; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.stepper > div { display: flex; align-items: center; justify-content: space-between; }
.stepper b { font: 700 20px var(--display); font-variant-numeric: tabular-nums; }
.stepper button { width: 38px; height: 38px; border-radius: 12px; border: 0; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); display: grid; place-items: center; color: var(--ink-2); transition: transform .12s var(--ease); }
.stepper button:active { transform: scale(.94); }
.stepper button svg { width: 16px; height: 16px; }
.options .opt { margin-bottom: 16px; }
.options .opt > span { font-size: 14px; font-weight: 600; }
.options > .toggle { margin-bottom: 12px; }
.row-link { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; background: none; border: 0; border-top: 1px solid var(--line); padding: 14px 0 0; color: var(--ink); }
.row-link svg { color: var(--ink-2); }
.row-link .title { display: block; font-weight: 600; }
.row-link .sub { display: block; font-size: 13.5px; color: var(--ink-2); }
.chev { color: var(--ink-3); display: grid; }

/* feelings */
.feel { margin-top: 4px; }
.feel-row { display: flex; justify-content: space-between; gap: 6px; }
.feel-row button {
  flex: 1; height: 50px; border-radius: 14px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2);
  display: grid; place-items: center; transition: background .15s, box-shadow .15s, transform .12s var(--ease);
}
.feel-row button:active { transform: scale(.96); }
.feel-row i { width: calc(26px * var(--s)); height: calc(26px * var(--s)); border-radius: 50%; background: color-mix(in srgb, var(--accent) 30%, transparent); transition: background .2s, transform .28s var(--ease); }
.feel-row button.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.feel-row button.on i { background: var(--accent); transform: scale(1.1); }
.feel-ends { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--ink-2); margin-top: 7px; gap: 8px; }
.feel-ends b { font-size: 13.5px; color: var(--accent-ink); font-weight: 700; }

/* ---------------------------------------------------------------- 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; }

/* ---------------------------------------------------------------- journal */

.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: 13.5px; font-variant-numeric: tabular-nums; }
.entries { background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line); overflow: hidden; }
.entry { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; color: var(--ink); transition: background .15s; }
.entry:last-child { border-bottom: 0; }
@media (hover: hover) { .entry:hover, .list > *:hover { background: var(--hover); } }
.entry .date { width: 38px; text-align: center; line-height: 1.1; flex: none; padding-top: 2px; }
.entry .date b { display: block; font: 700 21px var(--display); font-variant-numeric: tabular-nums; }
.entry .date span { font-size: 11px; font-weight: 700; color: var(--ink-3); text-transform: uppercase; letter-spacing: .06em; }
.entry .title { display: block; font-weight: 600; }
.entry .title .muted { font-weight: 400; }
.entry .sub { display: block; font-size: 13.5px; color: var(--ink-2); }
.empty { text-align: center; padding: 34px 22px; color: var(--ink-2); }
.empty h3, .empty b:first-child { font-family: var(--display); }
.empty-orb { width: 88px; height: 88px; margin: 0 auto 14px; border-radius: 50%; background: radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--dawn) 70%, var(--surface)), color-mix(in srgb, var(--accent-2) 30%, var(--surface)) 55%, transparent 72%); }

/* ---------------------------------------------------------------- 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; align-items: center; justify-content: space-between; gap: 14px; }
.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; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 14px; border-radius: 14px; border: 0;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; color: var(--ink); text-align: left;
  transition: background .15s, box-shadow .15s, transform .12s var(--ease);
}
.choice .play { color: var(--ink-2); display: grid; }
.choice .play svg { width: 16px; height: 16px; }
.choice.on { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); color: var(--accent-ink); }
.days { display: flex; gap: 6px; justify-content: space-between; }
.day-chip { flex: 1; height: 44px; border-radius: 12px; border: 0; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line-2); font-weight: 600; color: var(--ink-2); transition: background .15s, transform .12s var(--ease); }
.day-chip.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); color: var(--accent-ink); }
.reminder-now { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 18px; }
.reminder-now svg { color: var(--good); flex: none; margin-top: 1px; }
.honest summary { cursor: pointer; font-weight: 600; color: var(--ink-2); list-style: none; }
.honest summary::-webkit-details-marker { display: none; }
.honest summary::after { content: ' +'; color: var(--ink-3); }
.honest[open] summary::after { content: ' \2013'; }
.honest p { font-size: 14.5px; color: var(--ink-2); margin: 12px 0 0; }

/* ---------------------------------------------------------------- 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 a sitting stay in the night colours. */
.scrim.dark { background: rgba(3, 4, 8, .55); -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.scrim.dark .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); } }

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

body.sitting, html.boot-sitting, html.boot-sitting body { background: var(--night); }
body.sitting .backdrop { display: none; }
body.sitting #view { padding: 0; }
.session {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; color: var(--night-ink);
  user-select: none; -webkit-user-select: none; touch-action: manipulation; cursor: default;
}
.session .sky {
  position: absolute; inset: -10%;
  background:
    radial-gradient(60% 45% at 50% 42%, color-mix(in srgb, var(--night-accent) 26%, transparent), transparent 70%),
    radial-gradient(70% 40% at 50% 110%, color-mix(in srgb, var(--night-accent-2) 12%, transparent), transparent 70%),
    linear-gradient(180deg, color-mix(in srgb, var(--night-accent) 12%, var(--night-2)) 0%, var(--night) 60%, #06070A 100%);
  transition: opacity 4s var(--ease), filter 4s var(--ease);
}
.session .stage { position: absolute; left: 50%; top: 40%; width: min(70vw, 38vh, 330px); aspect-ratio: 1; transform: translate(-50%, -50%); }
.session .orb, .session .halo { position: absolute; inset: 0; border-radius: 50%; will-change: transform; }
.session .halo {
  inset: -18%;
  background: radial-gradient(circle, color-mix(in srgb, var(--dawn) 16%, transparent), color-mix(in srgb, var(--night-accent) 12%, transparent) 40%, transparent 68%);
  opacity: .5; transition: opacity 3s var(--ease);
}
.session .orb .orb-core, .done-orb .orb-core, .intro-orb .orb-core {
  position: absolute; inset: 0; border-radius: 50%;
  background: radial-gradient(circle at 50% 42%,
    color-mix(in srgb, var(--dawn) 95%, #fff) 0%, color-mix(in srgb, var(--dawn) 72%, transparent) 20%,
    color-mix(in srgb, var(--night-accent) 55%, transparent) 46%, color-mix(in srgb, var(--night-accent) 22%, transparent) 64%,
    color-mix(in srgb, var(--night-accent) 6%, transparent) 82%, transparent 100%);
  filter: blur(4px);
}
/* On the paper pages (the intro, the page after) the circle takes the day accent. */
.done-orb .orb-core, .intro-orb .orb-core {
  background: radial-gradient(circle at 50% 42%,
    color-mix(in srgb, var(--dawn) 95%, #fff) 0%, color-mix(in srgb, var(--dawn) 70%, transparent) 22%,
    color-mix(in srgb, var(--accent-2) 50%, transparent) 48%, color-mix(in srgb, var(--accent-2) 18%, transparent) 66%, transparent 86%);
}
/* In an open or timed sitting the circle swells very slowly (20 s, far slower
   than a breath, so nothing invites you to follow it), and all but stops once
   the screen dims. --amp is animatable, so the change is itself gradual. */
@property --amp { syntax: '<number>'; inherits: true; initial-value: 0.035; }
.session { --amp: 0.035; transition: --amp 6s var(--ease); }
.session.dim { --amp: 0.008; }
.session:not(.breathing) .orb { animation: orb-drift 20s var(--ease) infinite; }
.session:not(.breathing) .halo { animation: orb-drift 20s var(--ease) infinite; animation-delay: -2s; }
.session.still-orb:not(.breathing) .orb, .session.still-orb:not(.breathing) .halo { animation: none; transform: scale(.98); }
@keyframes orb-drift { 0%, 100% { transform: scale(calc(1 - var(--amp))); } 50% { transform: scale(1); } }
@keyframes orb { 0%, 100% { transform: scale(.93); } 50% { transform: scale(1); } }
.session.settling .orb { opacity: .55; }
.session .orb { transition: opacity 3s var(--ease); }
.session.breathing .orb { transform: scale(.52); }
.session.breathing .halo { transform: scale(.65); }

.breath-word {
  position: absolute; left: 0; right: 0; top: calc(40% + min(35vw, 19vh, 165px) + 14px); text-align: center;
  font: 700 26px/1.2 var(--display); letter-spacing: .01em; color: var(--night-ink); transition: opacity 1.5s var(--ease);
}
.breath-word small { display: block; font: 500 15px var(--font); color: rgba(236, 237, 239, .6); margin-top: 6px; font-variant-numeric: tabular-nums; }
.session:not(.breathing) .breath-word { display: none; }

.readout { position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 128px); text-align: center; transition: opacity 3s var(--ease); }
.session .time { font: 700 clamp(40px, 12vw, 56px)/1 var(--display); letter-spacing: .01em; font-variant-numeric: tabular-nums; color: rgba(236, 237, 239, .84); }
.session .sub { font-size: 13px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: rgba(236, 237, 239, .5); margin-top: 10px; }
.session.breathing .readout { bottom: calc(var(--safe-b) + 112px); }
.session.breathing .time { font-size: 26px; color: rgba(236, 237, 239, .58); }
.session.no-time:not(.settling):not(.paused) .time { opacity: 0; }
.session.no-time .readout .time { transition: opacity 1.5s var(--ease); }

.controls {
  position: absolute; left: 0; right: 0; bottom: calc(var(--safe-b) + 34px); display: flex; justify-content: center; align-items: center; gap: 26px;
  opacity: 0; pointer-events: none; transition: opacity 1.2s var(--ease);
}
.session.show-ctl .controls, .session.paused .controls { opacity: 1; pointer-events: auto; }
.ctl {
  width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; border: 0;
  background: rgba(255, 255, 255, .07); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: var(--night-ink); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: transform .12s var(--ease);
}
.ctl:active { transform: scale(.95); }
.ctl.main {
  width: 66px; height: 66px; border-radius: 22px;
  background: color-mix(in srgb, var(--night-accent) 20%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--night-accent) 38%, transparent), inset 0 1px 0 rgba(255, 255, 255, .10);
}
.ctl svg { width: 22px; height: 22px; }
.skip-settle {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: calc(var(--safe-b) + 106px);
  background: none; border: 0; color: rgba(236, 237, 239, .64); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; padding: 8px 12px;
}
.session:not(.settling) .skip-settle { display: none; }
.sound-note { position: absolute; top: calc(var(--safe-t) + 22px); left: 0; right: 0; text-align: center; font-size: 13.5px; color: rgba(236, 237, 239, .64); }

/* It dims itself after a few seconds: the glow stays, faintly. */
.session.dim .sky { opacity: .35; }
.session.dim .stage { opacity: .5; transition: opacity 5s var(--ease); }
.session .stage { transition: opacity 2s var(--ease); }
.session.dim .readout { opacity: .22; }
.session.dim.no-time .readout { opacity: 0; }
.session.dim .breath-word { opacity: .55; }
.session.paused .stage { opacity: .6; }

/* A line to settle with, and one while paused. */
.whisper {
  position: absolute; left: 24px; right: 24px; top: calc(40% + min(35vw, 19vh, 165px) + 18px); text-align: center;
  font: italic 400 19px/1.5 var(--verse); color: rgba(236, 237, 239, .74);
  opacity: 0; transition: opacity 2.2s var(--ease); pointer-events: none;
}
.whisper.on { opacity: 1; }
.session.dim .whisper.on { opacity: .45; }

/* Into the night at the start, and a slow dawn at the end. */
.veil { position: absolute; inset: 0; pointer-events: none; z-index: 5; opacity: 0; }
.veil.dusk { background: var(--bg); animation: dusk 3.6s var(--ease) forwards; }
@keyframes dusk { from { opacity: 1; } to { opacity: 0; } }
.session.dawn .veil {
  background: radial-gradient(120% 80% at 50% 110%, color-mix(in srgb, var(--dawn) 55%, var(--bg)), var(--bg) 70%);
  animation: none; transition: opacity 4s var(--ease); opacity: 1;
}
.session.dawn.quick .veil { transition-duration: 1.3s; }
.session.dawn .controls, .session.dawn .skip-settle { pointer-events: none; }

/* The page after a sitting. */
.done { text-align: center; padding-top: 5vh; animation: rise 1.2s var(--ease) backwards; }
.done-orb { position: relative; width: 104px; height: 104px; margin: 0 auto 18px; }
.done-len { font: 700 46px/1 var(--display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.done h1 { font: 700 13px var(--font); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin: 12px 0 4px; }
.done p { margin: 6px auto 0; max-width: 34ch; }
.milestone-note { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1px var(--accent-line); font-size: 14px; font-weight: 600; margin-top: 14px !important; }
.milestone-note svg { width: 16px; height: 16px; }
.done-card { text-align: left; margin-top: 26px; }
/* A few quiet seconds before anything is asked. */
.done-card.after-pause { animation: rise 1.4s var(--ease) 3.2s backwards; }
.done-words { max-width: 36ch; margin: 22px auto 0; text-align: center; animation: fadein 2.4s var(--ease) .8s backwards; }
.done-words .words { margin: 0; }
@keyframes fadein { from { opacity: 0; } }

/* ---------------------------------------------------------------- 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; }

.intro { position: relative; text-align: center; min-height: calc(100dvh - var(--safe-t) - var(--safe-b) - 64px); display: flex; flex-direction: column; justify-content: center; padding: 40px 6px 0; max-width: 460px; margin: 0 auto; animation: rise 1s var(--ease) backwards; }
.intro-skip { position: absolute; top: 0; right: 0; color: var(--ink-2); }
.intro-orb { position: relative; width: 140px; height: 140px; margin: 0 auto 34px; animation: orb 14s var(--ease) infinite; }
.intro h1 { font: 700 38px/1.1 var(--display); margin: 0 0 14px; letter-spacing: -.02em; }
.intro .lede { font-size: 17px; line-height: 1.6; color: var(--ink-2); max-width: 30ch; margin: 0 auto; min-height: 6.4em; }
.intro-dots { display: flex; justify-content: center; gap: 6px; margin: 28px 0 22px; }
.intro-dots span { width: 18px; height: 5px; border-radius: 3px; background: var(--line-2); transition: background .32s var(--ease), width .32s var(--ease); }
.intro-dots span.on { width: 26px; background: var(--accent); }
.intro .begin { max-width: 360px; width: 100%; margin: 0 auto; }

/* ---------------------------------------------------------------- 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) .scrim:not(.dark) { -webkit-backdrop-filter: blur(4px) saturate(120%); backdrop-filter: blur(4px) saturate(120%); }
html:not([data-theme="dark"]):not(.auto-dark) .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, .entries, .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, .entries, .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; }
  .hero-orb .glow, .session .orb, .session .halo, .intro-orb, .welcome .logo { animation: none !important; }
  /* The glow still brightens and fades with the breath, which is not movement. */
  .session.still .halo { transition: opacity .8s linear !important; }
}
