@charset "utf-8";

/* ═══════════════════════════════════════════════════════════════════════
   FORGE — Obsidian & Ember
   Mobile-first. Dark is primary; light is a full peer, not an afterthought.
   SPEC §6.
   ═══════════════════════════════════════════════════════════════════════ */

/* ─────────────────────────────────────────────────────────────── fonts ── */
/* Variable WOFF2, latin subset, self-hosted. `make fonts` fetches these;
   until then the fallback stacks below carry the design without breaking it. */

@font-face {
  font-family: 'Fraunces';
  src: url('/static/fonts/fraunces.woff2') format('woff2-variations');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Switzer';
  src: url('/static/fonts/switzer.woff2') format('woff2-variations');
  font-weight: 300 800;
  font-display: swap;
}
@font-face {
  font-family: 'GeistMono';
  src: url('/static/fonts/geist-mono.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}

/* ────────────────────────────────────────────────────────────── tokens ── */

:root {
  /* Surfaces — warm near-black, never the blue-black of every dev tool */
  --bg:            #0B0A09;
  --bg-1:          #131110;
  --bg-2:          #1A1715;
  --bg-3:          #221E1A;
  --border:        #2A241D;
  --border-strong: #3A322A;
  --hairline:      rgba(245, 240, 232, .06);

  /* Text — warm bone, not pure white */
  --text:   #F5F0E8;
  --text-2: #B8AFA2;
  --text-3: #8A8073;
  --text-4: #5C544A;

  /* Accent */
  --ember:      #FF6B35;
  --ember-hi:   #FF8557;
  --ember-lo:   #C24A1E;
  --ember-soft: rgba(255, 107, 53, .12);
  --ember-glow: rgba(255, 107, 53, .35);
  --brass:      #E8B84B;

  /* Semantic */
  --ok:     #4ADE80;
  --warn:   #F0A93F;
  --danger: #F0533F;
  --info:   #6BA8D6;

  /* Heat ramp — ash through to white-hot */
  --heat-0: #16130F;
  --heat-1: #4A2416;
  --heat-2: #8A3D1E;
  --heat-3: #D4551F;
  --heat-4: #FF6B35;
  --heat-r: #E8B84B;

  /* Reflection strip — deliberately NOT the ember scale, and 'fell short'
     is muted slate rather than red: red is the vocabulary of judgment. */
  --refl-none:  #16130F;
  --refl-short: #3A4450;
  --refl-ord:   #5C544A;
  --refl-lived: #E8B84B;

  /* Type */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-ui:      'Switzer', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    'GeistMono', ui-monospace, SFMono-Regular, Menlo, monospace;

  --text-2xs: .6875rem;
  --text-xs:  .75rem;
  --text-sm:  .875rem;
  --text-md:  1rem;
  --text-lg:  1.125rem;
  --text-xl:  1.375rem;
  --text-2xl: 1.75rem;
  --text-3xl: 2.5rem;
  --text-hero: 3.5rem;

  /* Geometry */
  --r-chip: 6px;
  --r-ctl: 10px;
  --r-card: 14px;
  --r-sheet: 20px;
  --r-pill: 999px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;  --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px;  --sp-10: 40px; --sp-12: 48px;

  /* Depth in dark = lighter surface + an inner top highlight. Not shadows. */
  --lift-1: inset 0 1px 0 rgba(245, 240, 232, .04);
  --lift-2: inset 0 1px 0 rgba(245, 240, 232, .06), 0 1px 2px rgba(0, 0, 0, .4);
  --lift-3: inset 0 1px 0 rgba(245, 240, 232, .08), 0 8px 32px rgba(0, 0, 0, .5);

  /* Motion */
  --t-micro: 120ms;
  --t-std:   200ms;
  --t-sheet: 320ms;
  --ease:        cubic-bezier(.32, .72, 0, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);

  --hdr-h: 56px;
  --nav-h: 60px;

  color-scheme: dark;
}

/* Light — a full peer. Ember is darkened to #D9480F to hold 4.9:1 on paper.
   Two blocks: the media query handles theme='auto', the attribute selector
   handles an explicit choice and must win in both directions. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) {
    --bg:            #FDFBF7;
    --bg-1:          #FFFFFF;
    --bg-2:          #F7F3EC;
    --bg-3:          #F0EAE0;
    --border:        #E5DDD0;
    --border-strong: #D4C9B8;
    --hairline:      rgba(26, 22, 20, .07);

    --text:   #1A1614;
    --text-2: #4A423A;
    --text-3: #75695C;
    --text-4: #A0947F;

    --ember:      #D9480F;
    --ember-hi:   #F25C21;
    --ember-lo:   #9A320A;
    --ember-soft: rgba(217, 72, 15, .10);
    --ember-glow: rgba(217, 72, 15, .25);
    --brass:      #A16207;

    --ok:     #15803D;
    --warn:   #B45309;
    --danger: #C2350F;
    --info:   #1D4ED8;

    --heat-0: #F0EAE0;
    --heat-1: #FBD5B8;
    --heat-2: #F5A87A;
    --heat-3: #E8763C;
    --heat-4: #D9480F;
    --heat-r: #A16207;

    --refl-none:  #F0EAE0;
    --refl-short: #B8C2CE;
    --refl-ord:   #C9BFB0;
    --refl-lived: #A16207;

    --lift-1: 0 1px 2px rgba(74, 66, 58, .06);
    --lift-2: 0 2px 8px rgba(74, 66, 58, .08);
    --lift-3: 0 12px 32px rgba(74, 66, 58, .14);

    color-scheme: light;
  }
}

/* Explicit override wins over the media query in both directions. */
:root[data-theme='light'] {
  --bg:            #FDFBF7;
  --bg-1:          #FFFFFF;
  --bg-2:          #F7F3EC;
  --bg-3:          #F0EAE0;
  --border:        #E5DDD0;
  --border-strong: #D4C9B8;
  --hairline:      rgba(26, 22, 20, .07);

  --text:   #1A1614;
  --text-2: #4A423A;
  --text-3: #75695C;
  --text-4: #A0947F;

  --ember:      #D9480F;
  --ember-hi:   #F25C21;
  --ember-lo:   #9A320A;
  --ember-soft: rgba(217, 72, 15, .10);
  --ember-glow: rgba(217, 72, 15, .25);
  --brass:      #A16207;

  --ok:     #15803D;
  --warn:   #B45309;
  --danger: #C2350F;
  --info:   #1D4ED8;

  --heat-0: #F0EAE0;
  --heat-1: #FBD5B8;
  --heat-2: #F5A87A;
  --heat-3: #E8763C;
  --heat-4: #D9480F;
  --heat-r: #A16207;

  --refl-none:  #F0EAE0;
  --refl-short: #B8C2CE;
  --refl-ord:   #C9BFB0;
  --refl-lived: #A16207;

  --lift-1: 0 1px 2px rgba(74, 66, 58, .06);
  --lift-2: 0 2px 8px rgba(74, 66, 58, .08);
  --lift-3: 0 12px 32px rgba(74, 66, 58, .14);

  color-scheme: light;
}

/* ─────────────────────────────────────────────────────────────── reset ── */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: var(--text-md);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: contain;
}

/* Film grain. Stops large black areas reading as flat and dead — the
   difference between "dark mode" and "designed". Dark theme only. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme='dark']) body::before { opacity: 0; }
}
:root[data-theme='light'] body::before { opacity: 0; }

h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.display {
  font-family: var(--font-display);
  font-variation-settings: 'opsz' 48, 'SOFT' 30, 'WONK' 1;
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.1;
}

.stat {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--text-xs);
  letter-spacing: -.01em;
}

/* ────────────────────────────────────────────────────────────── layout ── */

.main {
  position: relative;
  z-index: 1;
  padding: var(--sp-5) var(--sp-4);
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-12));
  max-width: 720px;
  margin-inline: auto;
}

.main--bare {
  display: grid;
  place-items: center;
  min-height: 100dvh;
  padding-bottom: var(--sp-5);
}

.page__title { font-size: var(--text-3xl); margin-bottom: var(--sp-1); }
.page__date  { color: var(--text-3); margin-bottom: var(--sp-8); }

/* ────────────────────────────────────────────────────────────── header ── */

.hdr {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: 0 var(--sp-4);
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 1px solid var(--hairline);
}

.hdr__streak { display: flex; align-items: center; gap: var(--sp-2); color: var(--text-3); }
.hdr__streak .flame { width: 16px; height: 20px; fill: var(--ember); stroke: none; }
.hdr__out { margin-left: auto; display: flex; }

.hdr__ring { position: relative; width: 32px; height: 32px; }
.hdr__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring__track { stroke: var(--border); stroke-width: 3; }
.ring__fill  { stroke: var(--ember); stroke-width: 3; stroke-linecap: round;
               transition: stroke-dasharray var(--t-sheet) var(--ease); }
.ring__label { position: absolute; inset: 0; display: grid; place-items: center;
               font-size: var(--text-2xs); color: var(--text-3); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;      /* 44px minimum touch target */
  margin: -6px;
  background: none;
  border: 0;
  border-radius: var(--r-ctl);
  color: var(--text-3);
  cursor: pointer;
  transition: color var(--t-micro) var(--ease), background var(--t-micro) var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { color: var(--text); background: var(--bg-2); }

/* ───────────────────────────────────────────────────────── bottom nav ── */
/* Bottom, never top: the top of a modern phone is unreachable one-handed. */

.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: var(--nav-h);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  border-top: 1px solid var(--hairline);
}

.nav__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-4);
  font-size: var(--text-2xs);
  letter-spacing: .01em;
  transition: color var(--t-micro) var(--ease);
}
.nav__item svg { width: 21px; height: 21px; }
.nav__item.is-active { color: var(--ember); }

/* ───────────────────────────────────────────────────────────────── fab ── */

.fab {
  position: fixed;
  right: var(--sp-5);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-4));
  z-index: 21;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--ember);
  color: #14100D;
  box-shadow: 0 6px 20px var(--ember-glow);
  cursor: pointer;
  transition: transform var(--t-micro) var(--ease-spring),
              box-shadow var(--t-std) var(--ease);
}
.fab svg { width: 24px; height: 24px; stroke-width: 2; }
.fab:active { transform: scale(.93); }

/* ───────────────────────────────────────────────────────────── controls ── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  min-height: 48px;
  padding: 0 var(--sp-5);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl);
  background: var(--bg-2);
  color: var(--text);
  font-size: var(--text-md);
  font-weight: 500;
  cursor: pointer;
  transition: transform var(--t-micro) var(--ease),
              background var(--t-micro) var(--ease);
}
.btn:active { transform: scale(.985); }
.btn--block { width: 100%; }

.btn--primary {
  background: var(--ember);
  border-color: transparent;
  color: #14100D;
  font-weight: 600;
}
.btn--primary:hover { background: var(--ember-hi); }

.field { display: block; margin-bottom: var(--sp-4); }
.field__label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--text-3);
  font-size: var(--text-sm);
  font-weight: 500;
}
.field input {
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;              /* never below 16px, or iOS zooms on focus */
  box-shadow: var(--lift-1);
  transition: border-color var(--t-micro) var(--ease),
              box-shadow var(--t-micro) var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-soft);
}

:where(a, button, input, [tabindex]):focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────── auth ── */

.auth { width: 100%; max-width: 360px; padding: var(--sp-6) var(--sp-5); text-align: center; }

.auth__mark {
  display: grid;
  place-items: center;
  width: 60px; height: 60px;
  margin: 0 auto var(--sp-5);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-1);
  box-shadow: var(--lift-2);
}
.auth__mark svg { width: 22px; height: 27px; fill: var(--ember); stroke: none; }

.auth__title { font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.auth__sub   { color: var(--text-3); font-size: var(--text-sm); margin-bottom: var(--sp-8); }
.auth__form  { text-align: left; }
.auth__form .btn { margin-top: var(--sp-5); }

/* ─────────────────────────────────────────────────────────────── empty ── */

.empty { text-align: center; padding: var(--sp-12) var(--sp-4); }
.empty__mark {
  display: grid; place-items: center;
  width: 72px; height: 72px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--bg-1);
  border: 1px solid var(--border);
  color: var(--text-4);
}
.empty__mark svg { width: 34px; height: 34px; }
.empty__lead { font-size: var(--text-xl); margin-bottom: var(--sp-2); }
.empty__body { color: var(--text-3); font-size: var(--text-sm); max-width: 34ch; margin-inline: auto; }

/* ──────────────────────────────────────────────────────── flash & toast ── */

.flash {
  position: relative;
  z-index: 30;
  margin: var(--sp-4) var(--sp-4) 0;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  font-size: var(--text-sm);
  box-shadow: var(--lift-2);
}
.flash--error { border-color: color-mix(in srgb, var(--danger) 40%, var(--border)); color: var(--danger); }
.flash--ok    { border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); color: var(--ok); }

.toasts {
  position: fixed;
  left: var(--sp-4); right: var(--sp-4);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-4));
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  pointer-events: none;
}
.toast {
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl);
  background: var(--bg-3);
  box-shadow: var(--lift-3);
  font-size: var(--text-sm);
  pointer-events: auto;
  animation: toast-in var(--t-std) var(--ease-spring);
}
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}

/* ───────────────────────────────────────────────────────── larger screens ── */

@media (min-width: 720px) {
  .main { padding-inline: var(--sp-8); padding-bottom: var(--sp-12); }
  .nav {
    left: 50%;
    right: auto;
    bottom: var(--sp-5);
    transform: translateX(-50%);
    width: min(440px, calc(100% - var(--sp-8)));
    border: 1px solid var(--border);
    border-radius: var(--r-pill);
    box-shadow: var(--lift-3);
    background: color-mix(in srgb, var(--bg-1) 92%, transparent);
    backdrop-filter: blur(12px);
  }
  .fab { bottom: calc(var(--nav-h) + var(--sp-10)); }
}

/* ──────────────────────────────────────────────────── reduced motion ── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════════
   PHASE 1 — tasks, routines, quick capture, sheet
   ═══════════════════════════════════════════════════════════════════════ */

.page { margin-bottom: var(--sp-5); }

/* ─────────────────────────────────────────────────────── quick capture ── */

.qa {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-1) var(--sp-1) var(--sp-1) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  box-shadow: var(--lift-1);
  transition: border-color var(--t-micro) var(--ease),
              box-shadow var(--t-micro) var(--ease);
}
.qa:focus-within {
  border-color: var(--ember);
  box-shadow: 0 0 0 3px var(--ember-soft);
}
.qa__input {
  flex: 1;
  min-height: 46px;
  border: 0;
  background: none;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;          /* below this, iOS zooms the whole page on focus */
}
.qa__input:focus { outline: none; }
.qa__input::placeholder { color: var(--text-4); }
.qa__go {
  display: grid; place-items: center;
  width: 40px; height: 40px;
  border: 0; border-radius: var(--r-chip);
  background: var(--ember-soft);
  color: var(--ember);
  cursor: pointer;
}
.qa__go svg { width: 18px; height: 18px; stroke-width: 2; }

/* Live parse preview — showing the interpretation is what makes a
   natural-language field trustworthy rather than a guessing game. */
.qa__preview {
  display: flex; flex-wrap: wrap; gap: var(--sp-2);
  min-height: 22px;
  margin: var(--sp-2) var(--sp-1) var(--sp-6);
  font-size: var(--text-xs);
}
.qa__preview:empty { margin-bottom: var(--sp-5); }
.qp__title { color: var(--text-2); font-weight: 500; }
.qp__bit {
  padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--ember-soft);
  color: var(--ember);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
}

/* ──────────────────────────────────────────────────────────── sections ── */

.sec-block { margin-bottom: var(--sp-8); }

.sec {
  display: flex; align-items: baseline; gap: var(--sp-2);
  margin-bottom: var(--sp-3);
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-3);
}
.sec__n { color: var(--text-4); letter-spacing: 0; }
.sec__hint {
  margin: calc(var(--sp-2) * -1) 0 var(--sp-3);
  color: var(--text-4);
  font-size: var(--text-xs);
}
.sec__hint--top { margin: 0 0 var(--sp-4); }

.sec-block--overdue .sec { color: var(--danger); }
.sec-block--done { opacity: .55; }

/* ─────────────────────────────────────────────────────────── routines ── */
/* Compact and tap-only. Deliberately a different rhythm from tasks: a
   five-second morning sweep, not considered work. */

.rt-strip {
  display: flex; flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-1);
  overflow: hidden;
}
.rt + .rt { border-top: 1px solid var(--hairline); }
.rt__btn {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; min-height: 44px;
  padding: 0 var(--sp-4);
  border: 0; background: none;
  text-align: left;
  cursor: pointer;
}
.rt__tick { display: grid; place-items: center; width: 20px; height: 20px; color: var(--text-4); }
.rt__tick svg { width: 20px; height: 20px; }
.rt__title { flex: 1; font-size: var(--text-sm); }
.rt__prog, .rt__time { color: var(--text-4); }

.rt .task__check { stroke-dasharray: 20; stroke-dashoffset: 20; }
.rt.is-done .rt__tick { color: var(--ok); }
.rt.is-done .task__check { stroke-dashoffset: 0; transition: stroke-dashoffset var(--t-std) var(--ease); }
.rt.is-done .rt__title { color: var(--text-3); text-decoration: line-through; }

/* ────────────────────────────────────────────────────────────── tasks ── */

.tasks { list-style: none; margin: 0; padding: 0; }

.task {
  position: relative;
  border-radius: var(--r-card);
  overflow: hidden;
  background: var(--bg-1);
  border: 1px solid var(--border);
  margin-bottom: var(--sp-2);
}

/* Revealed beneath the row as it is dragged. */
.task__under {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--sp-5);
  font-size: var(--text-sm); font-weight: 600;
}
.task__under-do    { color: var(--ok); }
.task__under-later { color: var(--warn); margin-left: auto; }

.task__row {
  position: relative;
  display: flex; align-items: flex-start; gap: var(--sp-1);
  min-height: 56px;
  padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-1);
  background: var(--bg-1);
  transition: transform var(--t-std) var(--ease);
  touch-action: pan-y;
}
.task.is-dragging .task__row { transition: none; }

.task__tick {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;       /* full-size target even though it looks small */
  margin-top: 3px;
  border: 0; background: none;
  color: var(--text-4);
  cursor: pointer;
}
.task__tick svg { width: 21px; height: 21px; }
.task__check { stroke-dasharray: 20; stroke-dashoffset: 20; }

.task.is-done .task__tick { color: var(--ok); }
.task.is-done .task__check { stroke-dashoffset: 0; transition: stroke-dashoffset var(--t-std) var(--ease); }
.task.is-done .task__title { color: var(--text-3); text-decoration: line-through; }

.task__main {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 3px;
  padding: var(--sp-2) 0;
}
.task__title { font-size: var(--text-md); line-height: 1.35; }
.task__meta { display: flex; flex-wrap: wrap; gap: var(--sp-1); }

.task__prio {
  flex: none;
  align-self: center;
  color: var(--danger);
  font-weight: 700;
  font-size: var(--text-lg);
  padding-right: var(--sp-1);
}

.chip {
  padding: 1px 7px;
  border-radius: var(--r-chip);
  background: var(--bg-2);
  color: var(--text-3);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.chip--today    { background: var(--ember-soft); color: var(--ember); }
.chip--overdue  { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.chip--slip     { background: transparent; color: var(--text-4); font-style: italic; }
.chip--resched  { background: color-mix(in srgb, var(--warn) 14%, transparent); color: var(--warn); }

/* Row actions, revealed by a left swipe or the sheet. */
.task__actions {
  display: none;
  gap: var(--sp-2);
  flex-wrap: wrap;
  padding: 0 var(--sp-3) var(--sp-3) var(--sp-3);
  border-top: 1px solid var(--hairline);
  padding-top: var(--sp-3);
}
.task.is-open .task__actions { display: flex; }

.act {
  min-height: 36px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-chip);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  cursor: pointer;
}
.act--plan { border-color: var(--ember); color: var(--ember); }
.act--drop { color: var(--text-3); }
.act--snooze { color: var(--warn); }

/* ─────────────────────────────────────────────────────────────── sheet ── */

.sheet-wrap { position: fixed; inset: 0; z-index: 50; }
.sheet__scrim {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  animation: fade-in var(--t-std) var(--ease);
}
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }

.sheet {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  max-height: 90dvh;
  overflow-y: auto;
  padding: var(--sp-3) var(--sp-5) calc(var(--sp-6) + env(safe-area-inset-bottom));
  border-radius: var(--r-sheet) var(--r-sheet) 0 0;
  background: var(--bg-2);
  box-shadow: var(--lift-3);
  animation: sheet-up var(--t-sheet) var(--ease);
}
@keyframes sheet-up { from { transform: translateY(100%) } to { transform: none } }

.sheet__grip {
  width: 36px; height: 4px;
  margin: 0 auto var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--border-strong);
}
.sheet textarea {
  width: 100%;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  resize: vertical;
}
.sheet select {
  width: 100%; min-height: 48px;
  padding: 0 var(--sp-3);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
}
.sheet input[type=date], .sheet input[type=time] {
  min-height: 48px;
}
.field-row { display: flex; gap: var(--sp-3); }
.field-row .field { flex: 1; }
.field-row .field--time { flex: 0 0 106px; }

.sheet__note {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  border-radius: var(--r-ctl);
  background: color-mix(in srgb, var(--warn) 10%, transparent);
  color: var(--warn);
  font-size: var(--text-xs);
}
.sheet__foot { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.sheet__foot .btn { flex: 1; }

.sheet__drop {
  width: 100%;
  margin-top: var(--sp-4);
  padding: var(--sp-3);
  border: 0; background: none;
  color: var(--text-4);
  font-size: var(--text-sm);
  cursor: pointer;
}
.sheet__drop:hover { color: var(--danger); }

.toast { display: flex; align-items: center; gap: var(--sp-4); }
.toast__act {
  margin-left: auto;
  border: 0; background: none;
  color: var(--ember);
  font-weight: 600;
  font-size: var(--text-sm);
  cursor: pointer;
}

/* ═══════════════════════════════════════════════════════ PHASE 2 ══════ */

.banner {
  margin-bottom: var(--sp-5);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  font-size: var(--text-sm);
  line-height: 1.5;
}
.banner--fail { border-color: color-mix(in srgb, var(--danger) 45%, var(--border)); }
.banner code { font-family: var(--font-mono); font-size: var(--text-xs); }

.card {
  padding: var(--sp-4);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-1);
  box-shadow: var(--lift-1);
}
.card__lead { color: var(--text-2); font-size: var(--text-sm); margin-bottom: var(--sp-4); }
.card__note { color: var(--text-4); font-size: var(--text-xs); margin-top: var(--sp-2); }
.card__note code, .card code { font-family: var(--font-mono); }
.card__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.card__actions .btn { flex: 1; min-width: 140px; }

.inline-form { display: flex; gap: var(--sp-3); align-items: flex-end; }
.inline-form .field { flex: 1; margin-bottom: 0; }
.inline-form .field--time { flex: 0 0 130px; }
.inline-form .btn { flex: none; }

.keybox {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3);
  border: 1px solid var(--ember);
  border-radius: var(--r-ctl);
  background: var(--ember-soft);
}
.keybox__label { color: var(--ember); font-size: var(--text-xs); margin-bottom: var(--sp-2); }
.keybox__value {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  word-break: break-all;
  color: var(--text);
}

.keys { list-style: none; margin: var(--sp-4) 0 0; padding: 0; }
.keys__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--hairline);
}
.keys__name { display: block; font-size: var(--text-sm); }
.keys__meta { display: block; color: var(--text-4); }
.keys__revoke {
  border: 0; background: none; color: var(--text-4);
  font-size: var(--text-xs); cursor: pointer;
}
.keys__revoke:hover { color: var(--danger); }

.recipe { margin-top: var(--sp-5); }
.recipe summary {
  cursor: pointer;
  color: var(--ember);
  font-size: var(--text-sm);
  padding: var(--sp-2) 0;
}
.recipe__steps { margin: var(--sp-3) 0; padding-left: var(--sp-5); color: var(--text-2); font-size: var(--text-sm); }
.recipe__steps li { margin-bottom: var(--sp-2); }
.recipe__steps ul { margin: var(--sp-2) 0; padding-left: var(--sp-4); }
.recipe__steps code, .recipe__note code { font-family: var(--font-mono); font-size: var(--text-xs); }
.recipe__note { color: var(--text-3); font-size: var(--text-xs); margin: var(--sp-3) 0; }
.recipe__code {
  overflow-x: auto;
  padding: var(--sp-3);
  border-radius: var(--r-ctl);
  background: var(--bg-3);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  line-height: 1.6;
}

.maillog { list-style: none; margin: 0; padding: 0; }
.maillog__row {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-2) 0;
  border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
}
.maillog__row:first-child { border-top: 0; }
.maillog__when { flex: none; color: var(--text-4); }
.maillog__subj { flex: 1; min-width: 0; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.maillog__status { flex: none; font-family: var(--font-mono); font-size: var(--text-2xs); }
.maillog__status--sent { color: var(--ok); }
.maillog__status--failed { color: var(--danger); }

/* Email action confirmation — the page you land on from the lock screen.
   Big, calm, and obvious; you are half-awake when you see it. */
.act-page {
  display: grid; place-items: center;
  min-height: 80dvh;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
}
.act-page__mark {
  display: grid; place-items: center;
  width: 84px; height: 84px;
  margin-bottom: var(--sp-5);
  border-radius: var(--r-pill);
  background: var(--ember-soft);
  color: var(--ember);
}
.act-page__mark.is-fail { background: var(--bg-2); color: var(--text-4); }
.act-page__mark svg { width: 40px; height: 40px; }
.act-page__head { font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.act-page__detail { color: var(--text-3); font-size: var(--text-sm); max-width: 30ch; }
.act-page__undo { margin-top: var(--sp-6); }
.act-page__link { margin-top: var(--sp-6); color: var(--ember); font-size: var(--text-sm); }

/* ═══════════════════════════════════════════════════════ PHASE 3 ══════ */

.hdr__streak, .hdr__ring { text-decoration: none; }
.hdr__streak.is-hot .flame   { fill: var(--brass); }
.hdr__streak.is-white .flame { fill: var(--text); filter: drop-shadow(0 0 4px var(--brass)); }
.hdr__ring.is-met .ring__fill { stroke: var(--ok); }
.hdr__welcome {
  margin-left: auto;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--ember-soft);
  color: var(--ember);
  font-size: var(--text-xs);
  font-weight: 600;
}
.hdr__welcome ~ .hdr__out { margin-left: var(--sp-2); }

/* ── tiles ─────────────────────────────────────────────────────────── */

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-2); }
.tile {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-2);
  padding: var(--sp-4) var(--sp-2);
  border: 1px solid var(--border);
  border-radius: var(--r-card);
  background: var(--bg-1);
  box-shadow: var(--lift-1);
  text-align: center;
}
.tile__ring { position: relative; width: 52px; height: 52px; }
.tile__ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.tile__ringnum { position: absolute; inset: 0; display: grid; place-items: center; }
.tile__big { font-size: var(--text-2xl); line-height: 1; }
.tile__label { color: var(--text-3); font-size: var(--text-2xs); line-height: 1.3; }
.tile__sub { color: var(--brass); }

/* ── heat map ──────────────────────────────────────────────────────── */
/* The forge: your year runs cold ash → ember → white-hot. */

.heat-wrap {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: var(--sp-2);
  -webkit-overflow-scrolling: touch;
}
.heat { display: flex; gap: 3px; min-width: min-content; }
.heat__col { display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; }

.heat__cell {
  width: 12px; height: 12px;
  border-radius: 3px;
  background: var(--heat-0);
  flex: none;
}
.heat__cell--l0 { background: var(--heat-0); }
.heat__cell--l1 { background: var(--heat-1); }
.heat__cell--l2 { background: var(--heat-2); }
.heat__cell--l3 { background: var(--heat-3); }
.heat__cell--l4 { background: var(--heat-4); }
.heat__cell--future { background: transparent; }

/* A record day gets a brass rim. */
.heat__cell.is-record { box-shadow: inset 0 0 0 1.5px var(--brass); }

/* Days you were away read as a gap, not a failure. Hatched, not empty —
   the difference between "I stopped for a while" and "I failed". */
.heat__cell.is-paused {
  background: repeating-linear-gradient(45deg,
    var(--heat-0) 0 2px, var(--border) 2px 4px);
}

/* Today breathes. */
.heat__cell.is-today {
  box-shadow: inset 0 0 0 1.5px var(--ember);
  animation: ember-pulse 2.4s ease-in-out infinite;
}
@keyframes ember-pulse {
  0%, 100% { box-shadow: inset 0 0 0 1.5px var(--ember); }
  50%      { box-shadow: inset 0 0 0 1.5px var(--ember), 0 0 7px var(--ember-glow); }
}

.heat__legend {
  display: flex; align-items: center; gap: var(--sp-1);
  margin-top: var(--sp-3);
  color: var(--text-4);
}
.heat__legend .heat__cell { width: 10px; height: 10px; }
.heat__toggle { margin-left: auto; color: var(--ember); font-size: var(--text-xs); }

/* ── deferral gauge ────────────────────────────────────────────────── */

.gauge-card { display: block; }
.gauge__bar {
  height: 8px;
  border-radius: var(--r-pill);
  background: var(--bg-3);
  overflow: hidden;
}
.gauge__fill {
  height: 100%;
  border-radius: var(--r-pill);
  transition: width var(--t-sheet) var(--ease);
}
.gauge__fill--clear    { background: var(--ok); }
.gauge__fill--building { background: var(--brass); }
.gauge__fill--heavy    { background: var(--warn); }
.gauge__fill--critical { background: var(--danger); }

.gauge__row {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-top: var(--sp-2);
}
.gauge__band { font-size: var(--text-sm); font-weight: 600; }
.gauge__band--clear    { color: var(--ok); }
.gauge__band--building { color: var(--brass); }
.gauge__band--heavy    { color: var(--warn); }
.gauge__band--critical { color: var(--danger); }
.gauge__row .stat { color: var(--text-4); }

/* Reckoning: "Let it go" carries the same weight as doing it. A large share
   of what sits here is stuff you are never going to do. */
.task__actions.is-shown { display: flex; }
.act--letgo { color: var(--text-3); }

/* ── welcome back ──────────────────────────────────────────────────── */

.welcome {
  display: grid; place-content: center; align-content: center;
  min-height: 70dvh;
  text-align: center;
  padding: var(--sp-8) var(--sp-5);
  max-width: 30rem; margin-inline: auto;
}
.welcome__head { font-size: var(--text-2xl); margin-bottom: var(--sp-2); }
.welcome__sub { color: var(--text-3); margin-bottom: var(--sp-6); }
.welcome__facts { display: flex; flex-direction: column; gap: var(--sp-3); margin-bottom: var(--sp-8); }
.welcome__fact { color: var(--text-2); font-size: var(--text-sm); }
.welcome__fact--good { color: var(--ok); }
.welcome__go { margin-bottom: var(--sp-4); }
.welcome__skip { color: var(--text-4); font-size: var(--text-sm); }

/* ═══════════════════════════════════════════════════════ PHASE 4 ══════ */

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.refl__title { font-size: var(--text-xl); margin-bottom: var(--sp-3); }
.refl__body { color: var(--text-2); font-size: var(--text-md); line-height: 1.6; }
.refl__points { margin: var(--sp-4) 0 0; padding-left: var(--sp-5); color: var(--text-2); font-size: var(--text-sm); }
.refl__points li { margin-bottom: var(--sp-2); line-height: 1.55; }
.refl__meta { color: var(--text-4); margin-top: var(--sp-4); }
.refl .act { margin-top: var(--sp-4); }

/* The reflection strip. Its own palette, its own page — never beside the
   ember heat map, or the two read as one metric. */
.refl-strip { display: flex; flex-wrap: wrap; gap: 4px; }
.refl-cell { width: 14px; height: 14px; border-radius: 4px; background: var(--refl-none); }
.refl-cell--lived { background: var(--refl-lived); }
.refl-cell--ord   { background: var(--refl-ord); }
/* Muted slate, never red: red is the vocabulary of danger and failure. */
.refl-cell--short { background: var(--refl-short); }

.diff { margin: var(--sp-2) 0 0; padding-left: var(--sp-5); font-size: var(--text-sm); }
.diff__err { margin-top: var(--sp-2); color: var(--danger); font-size: var(--text-xs); }

.import { margin-top: var(--sp-4); }
.import input[type=file] { width: 100%; font-size: var(--text-sm); color: var(--text-3); }
.import__row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.import__opt { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--text-xs); color: var(--text-3); }

.themes { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.theme-chip {
  padding: 4px 10px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--bg-1);
  color: var(--text-3); font-size: var(--text-xs);
}
.theme-chip.is-active { border-color: var(--ember); color: var(--ember); background: var(--ember-soft); }

.lib { list-style: none; margin: 0; padding: 0; }
.lib__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) 0; border-top: 1px solid var(--hairline);
}
.lib__row.is-off { opacity: .45; }
.lib__title { display: block; font-size: var(--text-sm); }
.lib__meta { display: block; color: var(--text-4); }
.lib__toggle { border: 0; background: none; color: var(--text-4); font-size: var(--text-xs); cursor: pointer; }
.lib__toggle:hover { color: var(--ember); }

/* ── signature moments ─────────────────────────────────────────────── */

/* Completion burst: the checkbox fills, sparks scatter, the points chip
   flies to the ring. Under half a second, and gone. */
@keyframes spark {
  from { opacity: 1; transform: translate(0,0) scale(1); }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.2); }
}
.spark {
  position: fixed; z-index: 60;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--ember);
  pointer-events: none;
  animation: spark 420ms var(--ease) forwards;
}
@keyframes fly {
  from { opacity: 1; transform: translate(0,0) scale(1); }
  70%  { opacity: 1; }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.6); }
}
.pointfly {
  position: fixed; z-index: 61;
  padding: 2px 8px; border-radius: var(--r-pill);
  background: var(--ember); color: #14100D;
  font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 700;
  pointer-events: none;
  animation: fly 520ms var(--ease) forwards;
}

/* Pull to refresh — an ember that brightens as you pull. */
.ptr {
  position: fixed; left: 50%; top: 0; z-index: 25;
  width: 30px; height: 30px; margin-left: -15px;
  display: grid; place-items: center;
  pointer-events: none;
  opacity: 0;
}
.ptr svg { width: 16px; height: 20px; fill: var(--ember); stroke: none; }
.ptr.is-armed svg { filter: drop-shadow(0 0 6px var(--ember-glow)); }
.ptr.is-spinning { animation: ptr-spin 700ms linear infinite; }
@keyframes ptr-spin { to { transform: rotate(360deg); } }

/* Install prompt — offered once, dismissible, never nagging. */
.install {
  position: fixed; left: var(--sp-4); right: var(--sp-4);
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-4));
  z-index: 45;
  display: flex; align-items: center; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border-strong); border-radius: var(--r-card);
  background: var(--bg-3); box-shadow: var(--lift-3);
  font-size: var(--text-sm);
  animation: toast-in var(--t-std) var(--ease-spring);
}
.install__x { margin-left: auto; border: 0; background: none; color: var(--text-4); cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  .spark, .pointfly, .ptr { display: none !important; }
}

/* ── calendar ──────────────────────────────────────────────────────── */

.cal-head { display: flex; align-items: flex-start; justify-content: space-between; }
.cal-nav { display: flex; gap: var(--sp-1); }

.cal__dow {
  display: grid; grid-template-columns: repeat(7, 1fr);
  margin-bottom: var(--sp-2);
  color: var(--text-4);
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  text-align: center;
}
.cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }

.cal__day {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px;
  aspect-ratio: 1;
  min-height: 44px;                 /* touch target */
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--r-ctl);
  background: var(--bg-1);
  color: var(--text-2);
  font-size: var(--text-sm);
  cursor: pointer;
}
.cal__day.is-out { opacity: .32; }
.cal__day.is-empty { background: transparent; }
.cal__day.is-today {
  border-color: var(--ember);
  color: var(--ember);
  font-weight: 600;
}
.cal__n { font-variant-numeric: tabular-nums; }

.cal__dots { display: flex; gap: 3px; height: 5px; }
.dot { width: 5px; height: 5px; border-radius: 50%; display: inline-block; }
.dot--plan  { background: var(--ember); }
.dot--due   { background: var(--danger); }
.dot--event { background: var(--info); }

.cal__key {
  display: flex; gap: var(--sp-4);
  margin: var(--sp-3) 0 var(--sp-8);
  color: var(--text-4);
  font-size: var(--text-2xs);
}
.cal__key span { display: flex; align-items: center; gap: var(--sp-1); }

.sheet__title { font-size: var(--text-xl); margin-bottom: var(--sp-4); }
.sheet__empty { color: var(--text-3); font-size: var(--text-sm); padding: var(--sp-4) 0; }

.agenda { list-style: none; margin: 0 0 var(--sp-5); padding: 0; }
.agenda__row {
  display: flex; align-items: baseline; gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-top: 1px solid var(--hairline);
}
.agenda__time { flex: none; width: 64px; color: var(--text-4); }
.agenda__title { flex: 1; font-size: var(--text-sm); }
.agenda__row--event .agenda__time { color: var(--info); }
.agenda__row--due .agenda__time { color: var(--danger); }

/* ── weekly review ─────────────────────────────────────────────────── */

.steps { display: flex; gap: var(--sp-2); list-style: none; margin: 0 0 var(--sp-6); padding: 0; }
.steps__i {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  color: var(--text-4); font-size: var(--text-2xs);
}
.steps__n {
  display: grid; place-items: center;
  width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono); font-size: var(--text-2xs);
}
.steps__i.is-now  { color: var(--ember); }
.steps__i.is-now .steps__n { border-color: var(--ember); background: var(--ember-soft); }
.steps__i.is-done { color: var(--ok); }
.steps__i.is-done .steps__n { border-color: var(--ok); }
.steps__l { text-align: center; }

.review__head { font-size: var(--text-xl); margin-bottom: var(--sp-2); }
.review__lead { color: var(--text-3); font-size: var(--text-sm); margin-bottom: var(--sp-5); line-height: 1.55; }
.review__clear { color: var(--ok); font-size: var(--text-sm); padding: var(--sp-6) 0; text-align: center; }
.review__nav { display: flex; gap: var(--sp-3); margin-top: var(--sp-8); }
.review__nav .btn { flex: 1; }
.review__skip { text-align: center; margin-top: var(--sp-4); }
.review__skip button {
  border: 0; background: none; color: var(--text-4);
  font-size: var(--text-xs); cursor: pointer;
}
.week-day { margin-bottom: var(--sp-5); }

/* ── accessibility ─────────────────────────────────────────────────── */

.skip {
  position: absolute; left: var(--sp-4); top: -100px; z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--r-ctl);
  background: var(--ember); color: #14100D;
  font-weight: 600;
  transition: top var(--t-std) var(--ease);
}
.skip:focus { top: var(--sp-4); }

/* The bottom nav is fixed, so a focused control can end up underneath it. */
.main :focus-visible { scroll-margin-bottom: calc(var(--nav-h) + var(--sp-6)); }

/* Honour a forced-colours mode rather than fighting it. */
@media (forced-colors: active) {
  .heat__cell, .refl-cell, .dot { forced-color-adjust: none; }
  .task, .card, .cal__day { border: 1px solid CanvasText; }
}

/* ── updates ───────────────────────────────────────────────────────── */

.banner__detail { margin-top: var(--sp-2); color: var(--text-3); font-size: var(--text-xs); line-height: 1.55; }
.upload { display: flex; flex-wrap: wrap; gap: var(--sp-3); align-items: center; margin-bottom: var(--sp-4); }
.upload input[type=file] { flex: 1; min-width: 180px; font-size: var(--text-sm); color: var(--text-3); }

.steps-list {
  margin: 0; padding-left: var(--sp-5);
  color: var(--text-3); font-size: var(--text-xs); line-height: 1.7;
}

.rel { list-style: none; margin: 0; padding: 0; }
.rel__row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--border); border-radius: var(--r-ctl);
  background: var(--bg-1);
  margin-bottom: var(--sp-2);
}
.rel__row.is-current { border-color: var(--ember); }
.rel__v { display: block; font-size: var(--text-sm); font-family: var(--font-mono); }
.rel__meta { display: block; color: var(--text-4); margin-top: 2px; }
.rel__tag {
  margin-left: var(--sp-2); padding: 1px 7px;
  border-radius: var(--r-pill);
  background: var(--ember-soft); color: var(--ember);
  font-family: var(--font-ui); font-size: var(--text-2xs);
}
.rel__tag--prev { background: var(--bg-3); color: var(--text-4); }

.backups { list-style: none; margin: var(--sp-4) 0 0; padding: 0; }
.backups__row {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-2) 0; border-top: 1px solid var(--hairline);
  font-size: var(--text-xs);
}
.backups__row a { color: var(--ember); font-family: var(--font-mono); }
.backups__meta { color: var(--text-4); }

.field__hint {
  margin: calc(var(--sp-3) * -1) 0 var(--sp-4);
  color: var(--text-4);
  font-size: var(--text-xs);
  line-height: 1.5;
}
.field__opt { color: var(--text-4); font-weight: 400; }
