/* Life Design Lab — warm editorial.

   A blend of two directions (see DESIGN.md for the reference this departs from):

   KEPT from the Portal reference — the parts that give it craft:
     · a display serif as the editorial voice, display sizes only
     · glow rings instead of drop shadows
     · pill buttons, generous card radii, uppercase micro-eyebrows
     · a floating nav capsule rather than a header bar
     · one atmospheric gradient moment

   CHANGED — the parts that read cold or generic:
     · warm paper and warm ink replace #f7f7f7 / #000000
     · burnt amber replaces iOS blue, which is the most-used accent on the web
     · the blue-violet-pink dusk gradient is now a warm dusk (plum to amber);
       the original cool version has become shorthand for machine-made design
     · Fraunces replaces Playfair — an old-style serif with actual warmth in it,
       and its SOFT and WONK axes are turned up rather than left at zero
     · the UI face is the platform's own, not a webfont, so the app reads native
       instead of like a template
     · life areas get their quiet colour coding back: it is functional
       information, and losing it cost more than the single-accent rule was worth
*/

/* ============================================================
   Tokens
   ============================================================ */
:root {
  /* --- warm neutrals --- */
  --paper:      #fbf7f0;   /* warm white — card surfaces on light */
  --oat:        #f2ebe0;   /* page canvas on light */
  --oat-deep:   #e6dccd;   /* recessed surface on light */
  --ink:        #1c1713;   /* warm near-black */
  --ink-body:   #4c4239;
  --ink-muted:  #8a7f72;

  --char:       #141110;   /* warm near-black canvas on dark */
  --char-up:    #1f1b17;
  --char-up-2:  #2b2520;
  --cream:      #f7f2ea;
  --cream-body: #d9d0c4;
  --cream-muted:#a2968a;

  /* --- the single accent: burnt amber --- */
  --amber-light: #a5652a;
  --amber-dark:  #e0a458;

  /* --- warm dusk: plum through terracotta to amber --- */
  --gradient-dusk: linear-gradient(180deg,
    #2c2436 0%, #5c3f4c 26%, #9a5a4a 52%, #c87f4c 76%, #e8bd7f 100%);
  --gradient-brand: linear-gradient(155deg, #7a4a48 0%, #b8703f 55%, #e0a458 100%);

  /* --- type ---
     One webfont only. Fraunces carries the voice; the UI face is whatever the
     platform already has, which keeps the app feeling native and loads nothing. */
  --font-display: "Fraunces", "Playfair Display", Iowan Old Style, Palatino, Georgia, serif;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text",
             "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  --text-micro: 10.5px;
  --text-caption: 12.5px;
  --text-body-sm: 14.5px;
  --text-body: 16.5px;
  --text-heading-sm: 18px;

  /* --- shape: softened from the reference's 22-30px, firmer than a phone app --- */
  --radius-card: 20px;
  --radius-card-lg: 26px;
  --radius-inner: 14px;
  --radius-nav: 20px;
  --radius-pill: 999px;

  --section-gap: 50px;
  --card-padding: 20px;

  /* --- semantic: light --- */
  --bg: var(--oat);
  --surface: var(--paper);
  --surface-2: var(--oat-deep);
  --text: var(--ink);
  --body-text: var(--ink-body);
  --muted: var(--ink-muted);
  --line: rgba(28, 23, 19, 0.13);
  --hairline: rgba(28, 23, 19, 0.07);
  --accent: var(--amber-light);
  --accent-wash: rgba(165, 101, 42, 0.11);
  --on-accent: #fffaf2;

  /* Elevation is a ring in the canvas colour, never a drop shadow. */
  --ring: 0 0 0 5px var(--oat-deep);
  --ring-1: 0 0 0 1px rgba(28, 23, 19, 0.07);

  /* --- life areas: a functional whisper, all in the warm family --- */
  --a-connection: #b3707c;
  --a-health:     #6d8f57;
  --a-money:      #a3812c;
  --a-adventure:  #bd6a3d;
  --a-growth:     #86709b;
  --a-default:    var(--ink-muted);
}

[data-theme="dark"] {
  --bg: var(--char);
  --surface: var(--char-up);
  --surface-2: var(--char-up-2);
  --text: var(--cream);
  --body-text: var(--cream-body);
  --muted: var(--cream-muted);
  --line: rgba(247, 242, 234, 0.13);
  --hairline: rgba(247, 242, 234, 0.07);
  --accent: var(--amber-dark);
  --accent-wash: rgba(224, 164, 88, 0.15);
  --on-accent: #241703;

  --ring: 0 0 0 5px rgba(247, 242, 234, 0.045);
  --ring-1: 0 0 0 1px rgba(247, 242, 234, 0.06);

  --a-connection: #d98a9a;
  --a-health:     #92b57c;
  --a-money:      #d9b45c;
  --a-adventure:  #e08a5c;
  --a-growth:     #a99ccf;
  --a-default:    var(--cream-muted);
}

/* ============================================================
   Base
   ============================================================ */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--body-text);
  font-family: var(--font-ui);
  font-size: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  transition: background .3s, color .3s;
}

main {
  max-width: 660px;
  margin: 0 auto;
  padding: 26px 20px calc(72px + env(safe-area-inset-bottom));
}

/* The editorial voice. SOFT rounds the terminals, WONK lets the italic-ish
   quirks through — this is where the warmth lives. */
h1, .editorial, .tally b, .win-card h3 {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 55, "WONK" 1;
  font-weight: 400;
  letter-spacing: -0.005em;
  color: var(--text);
}

h1 {
  font-size: clamp(34px, 8.6vw, 44px);
  line-height: 1.04;
  margin: 6px 0 16px;
}

/* h2 is a section eyebrow, not display type. */
h2 {
  font-family: var(--font-ui);
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--muted);
  margin: var(--section-gap) 0 13px;
}

h3 {
  font-family: var(--font-ui);
  font-size: var(--text-heading-sm);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.32;
  color: var(--text);
  margin: 0 0 6px;
}

p { margin: 0 0 12px; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

small { font-size: var(--text-caption); }

.muted { color: var(--muted); }
.center { text-align: center; }

.lede {
  font-size: var(--text-body);
  color: var(--muted);
  max-width: 46ch;
  margin: -4px 0 22px;
}

.editorial {
  font-size: clamp(28px, 6.8vw, 34px);
  line-height: 1.14;
}

.eyebrow {
  font-size: var(--text-caption);
  font-weight: 600;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   Floating nav capsule
   ============================================================ */
.nav-wrap {
  position: sticky; top: 0; z-index: 40;
  padding: max(13px, env(safe-area-inset-top)) 16px 9px;
  background: linear-gradient(to bottom, var(--bg) 64%, transparent);
}

.nav-capsule {
  max-width: 760px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: var(--surface);
  border-radius: var(--radius-nav);
  padding: 7px 10px 7px 12px;
  box-shadow: var(--ring);
}

.brand {
  display: flex; align-items: center; gap: 9px;
  color: var(--text); white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 29px; height: 29px; border-radius: 9px;
  background: var(--gradient-brand);
  display: grid; place-items: center; flex: none;
}
.brand-mark svg { width: 15px; height: 15px; display: block; }
.brand-text {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 55, "WONK" 1;
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
}
@media (max-width: 359px) { .brand-text { display: none; } }

.nav-links { display: none; margin-left: auto; gap: 1px; }
.nav-links a {
  color: var(--body-text);
  font-size: var(--text-body-sm);
  font-weight: 500;
  padding: 6px 11px;
  border-radius: var(--radius-pill);
  transition: color .2s, background .2s;
}
.nav-links a:hover { text-decoration: none; color: var(--text); background: var(--surface-2); }
.nav-links a.active { color: var(--accent); background: var(--accent-wash); }

.burger {
  margin-left: auto; background: none; border: none; cursor: pointer;
  padding: 8px 6px; display: flex; flex-direction: column; gap: 4px;
}
.burger span { width: 18px; height: 1.5px; background: var(--text); border-radius: 2px; }

.theme-toggle, .nav-icon {
  flex: none; background: var(--surface-2); border: none; color: var(--text);
  border-radius: 50%; width: 31px; height: 31px;
  cursor: pointer; font-size: 13px; line-height: 1;
}
/* The settings gear — reachable at every width, drawer or no drawer. */
.nav-icon {
  display: grid; place-items: center; text-decoration: none;
  font-size: 15px; transition: background .2s, color .2s;
}
.nav-icon:hover { text-decoration: none; color: var(--accent); }
.nav-icon.active { background: var(--accent-wash); color: var(--accent); }
.burger + .nav-icon { margin-left: 0; }

@media (min-width: 720px) {
  .nav-links { display: flex; }
  .burger { display: none; }
}

/* drawer */
.drawer {
  position: fixed; top: 0; left: 0; bottom: 0; width: 268px; z-index: 60;
  background: var(--surface);
  border-radius: 0 var(--radius-card-lg) var(--radius-card-lg) 0;
  transform: translateX(-100%);
  transition: transform .32s cubic-bezier(.32, .72, 0, 1);
  padding: max(22px, env(safe-area-inset-top)) 12px 22px;
  overflow-y: auto;
}
.drawer.open { transform: none; }
.drawer a {
  display: block; padding: 12px 16px; margin-bottom: 2px;
  color: var(--text); font-size: var(--text-body); font-weight: 500;
  border-radius: var(--radius-inner);
}
.drawer a:hover { text-decoration: none; background: var(--surface-2); }
.drawer a.active { color: var(--accent); background: var(--accent-wash); }
.drawer .drawer-sep { height: 1px; background: var(--line); margin: 10px 16px; }

.scrim {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(20, 17, 16, .42);
  opacity: 0; pointer-events: none; transition: opacity .32s;
}
.scrim.open { opacity: 1; pointer-events: auto; }

.site-footer {
  margin-top: 62px;
  padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--hairline);
}
.site-footer p {
  max-width: 660px; margin: 0 auto;
  color: var(--muted); font-size: var(--text-caption); line-height: 1.55;
}

/* ============================================================
   Hero — the one atmospheric moment (onboarding)
   ============================================================ */
.hero {
  background: var(--gradient-dusk);
  border-radius: var(--radius-card-lg);
  padding: 40px 22px 38px;
  margin-bottom: 26px;
  position: relative; overflow: hidden;
  text-align: center;
}
/* Tiling treeline, so the trees keep their shape at any width. Deep plum
   rather than near-black, so the hero's bottom edge still reads against the
   dark canvas instead of merging into it. */
.hero::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -1px; height: 40px;
  /* The viewBox matches the tile's 260x40 aspect exactly. With a mismatched
     ratio the default preserveAspectRatio ("meet") letterboxes the artwork
     into the middle of each tile, which leaves gaps between the trees. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 260 40'%3E%3Cpath fill='%233d2833' d='M0 32 L11 32 L18 10 L25 32 L38 32 L46 4 L54 32 L72 32 L78 16 L84 32 L104 32 L112 8 L120 32 L140 32 L146 18 L152 32 L170 32 L178 6 L186 32 L206 32 L212 14 L218 32 L237 32 L242 20 L247 32 L260 32 L260 40 L0 40 Z'/%3E%3C/svg%3E");
  background-size: 260px 40px;
  background-repeat: repeat-x;
  background-position: bottom left;
}
/* Copy sits on its own warm card, never directly on the gradient. */
.hero-card {
  position: relative; z-index: 1;
  background: var(--paper);
  border-radius: var(--radius-card);
  padding: 26px 22px;
  max-width: 440px; margin: 0 auto;
}
.hero-card h1 { color: var(--ink); margin-top: 0; font-size: clamp(30px, 8vw, 40px); }
.hero-card p { color: var(--ink-body); margin-bottom: 0; font-size: var(--text-body-sm); }

/* ============================================================
   Landing page
   ============================================================ */
.landing h2 { text-align: center; margin-top: 56px; }
.landing .hero { margin-top: 8px; }
.landing .hero-card h1 { font-size: clamp(34px, 9vw, 46px); line-height: 1.02; }

/* The hero's second line carries the promise, so it sits at full ink weight
   above the lighter supporting line. Scoped to .hero-card to outrank the
   `.hero-card p` body colour set further down. */
.hero-card .hero-lead {
  color: var(--ink);
  font-size: var(--text-body);
  margin-bottom: 7px;
}

/* Bold lead-in, description underneath — reads as a list without bullets. */
.points p { margin: 0 0 20px; }
.points p:last-child { margin-bottom: 0; }
.points b { display: block; color: var(--text); margin-bottom: 3px; }

/* A live mock of the Today screen — the product shown rather than described.
   Built from the real component classes, so it can never drift from the app. */
.demo {
  background: var(--bg);
  border-radius: var(--radius-card-lg);
  padding: 20px 16px;
  box-shadow: var(--ring-1);
  pointer-events: none;
}
.demo .todo li { margin-bottom: 7px; }
.demo .tick { border-color: var(--line); }

/* ============================================================
   Cards
   ============================================================ */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: var(--card-padding);
  margin: 14px 0;
  box-shadow: var(--ring-1);
}
.card.raised { box-shadow: var(--ring); }
.card.flat { background: none; box-shadow: none; padding: 0; }
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

/* ============================================================
   Buttons
   ============================================================ */
.btn, .chip {
  font-family: var(--font-ui);
  font-size: var(--text-body-sm);
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--text);
  padding: 9px 18px;
  transition: transform .12s, background .2s, border-color .2s, color .2s;
}
.btn:active, .chip:active { transform: scale(.97); }
.btn:hover, .chip:hover { border-color: var(--muted); }

.btn.go, .chip.go {
  background: var(--accent); color: var(--on-accent);
  border-color: transparent; font-weight: 600;
}
.btn.go:hover, .chip.go:hover { border-color: transparent; filter: brightness(1.07); }

.btn.ghost, .chip.ghost {
  background: transparent; border-color: transparent; color: var(--muted);
}
.btn.ghost:hover, .chip.ghost:hover { border-color: var(--line); color: var(--text); }

.btn.block {
  display: block; width: 100%; text-align: center;
  padding: 15px; font-size: var(--text-body); font-weight: 600;
}
.chip { padding: 8px 15px; }
.chip.mini { font-size: var(--text-caption); padding: 5px 12px; }

/* Selected reads as tinted, not filled — a row of solid accent pills would
   shout over the one real call to action on the screen. */
.chip[aria-pressed="true"] {
  background: var(--accent-wash);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
button:disabled { opacity: .4; cursor: default; }
button:disabled:hover { border-color: var(--line); }

/* ============================================================
   Life areas — quiet colour coding, restored
   ============================================================ */
.area {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: var(--text-caption);
  letter-spacing: 0.055em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ac, var(--a-default));
}
.area .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

/* ============================================================
   Today
   ============================================================ */
.focus-line { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 4px; }
.focus-line .lbl { color: var(--muted); font-size: var(--text-body-sm); }
.focus-pill {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 6px 14px 6px 11px;
  font-size: var(--text-body-sm); font-weight: 600;
  color: var(--text);
  box-shadow: var(--ring-1);
}
.focus-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ac, var(--a-default)); flex: none;
}

.todo { list-style: none; margin: 0; padding: 0; }
.todo li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface);
  border-radius: var(--radius-inner);
  padding: 15px 17px;
  margin-bottom: 8px;
  box-shadow: var(--ring-1);
  transition: background .2s;
}
.todo .tick {
  flex: none; width: 23px; height: 23px; margin-top: 2px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  background: none; cursor: pointer;
  display: grid; place-items: center;
  color: transparent; font-size: 11px;
  transition: all .18s;
}
.todo .tick:hover { border-color: var(--accent); }
.todo li.done { background: transparent; box-shadow: none; }
.todo li.done .tick { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.todo li.done .t-title { color: var(--muted); text-decoration: line-through; }

.t-body { flex: 1; min-width: 0; }
.t-title {
  font-size: var(--text-body); font-weight: 500;
  line-height: 1.35; color: var(--text);
}
/* Metadata rows are uniformly caption-sized, so an area label, a duration and
   a bare word like "because" sit on the same optical line. */
.t-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 6px;
  font-size: var(--text-caption); color: var(--muted);
}
.t-skip {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--muted); font-family: var(--font-ui); font-size: var(--text-caption);
}
.t-skip:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Look-forward card — a little of the dusk returns as an edge. */
.forward {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 21px;
  box-shadow: var(--ring);
  position: relative; overflow: hidden;
}
.forward::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--gradient-dusk);
}
.forward .big-emoji { font-size: 25px; line-height: 1; margin-bottom: 9px; }
.forward h3 { font-size: 19px; }

.onething { margin: 2px 0 0; }
.onething .q { margin: 8px 0 10px; }

/* ============================================================
   Empty states — a feature, not an error
   ============================================================ */
.empty {
  color: var(--muted); text-align: center; padding: 30px 18px;
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--ring-1);
  font-size: var(--text-body-sm); line-height: 1.55;
}
.empty .em { font-size: 23px; display: block; margin-bottom: 9px; }

/* ============================================================
   Forms
   ============================================================ */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="date"], textarea, select {
  font-family: var(--font-ui);
  font-size: var(--text-body);
  width: 100%;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--radius-inner);
  padding: 12px 15px;
  transition: border-color .2s, box-shadow .2s;
}
input::placeholder, textarea::placeholder { color: var(--muted); }
textarea { resize: vertical; min-height: 94px; line-height: 1.5; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

label.fld { display: block; margin: 16px 0; }
label.fld > span {
  display: block;
  font-size: var(--text-caption); letter-spacing: 0.055em;
  text-transform: uppercase; font-weight: 600;
  color: var(--muted); margin-bottom: 7px;
}
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1; min-width: 150px; }

.ml-edit { border-bottom: 1.5px dashed var(--line); cursor: pointer; transition: border-color .2s; }
.ml-edit:hover { border-bottom-color: var(--accent); }
.ml-input {
  font: inherit; color: var(--text); background: none;
  border: none; border-bottom: 1.5px solid var(--accent); padding: 0; outline: none;
}
/* Multiline click-to-edit: same idea as .ml-input, room for a sentence. */
.ml-area {
  font: inherit; color: var(--text);
  background: var(--surface-2);
  width: 100%; min-height: 62px; resize: vertical;
  border: 1.5px solid var(--accent); border-radius: var(--radius-inner);
  padding: 9px 11px; outline: none; line-height: 1.45;
}
/* The note is prose, so its edit hint sits under the text rather than
   stretching a dashed rule across an empty row. */
.why.ml-edit { display: inline-block; border-bottom-color: var(--hairline); }
.why.ml-edit:hover { border-bottom-color: var(--accent); }

.steps { display: flex; gap: 6px; margin-bottom: 24px; }
.steps i { flex: 1; height: 3px; border-radius: var(--radius-pill); background: var(--line); }
.steps i.on { background: var(--accent); }

/* ============================================================
   Ideas
   ============================================================ */
.idea {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 15px 0; border-bottom: 1px solid var(--hairline);
}
.idea:last-child { border-bottom: none; }
.idea:first-child { padding-top: 4px; }
.idea .em { font-size: 21px; line-height: 1.2; flex: none; }
.idea .why { color: var(--muted); font-size: var(--text-body-sm); margin-top: 3px; line-height: 1.45; }
.tag {
  display: inline-block; font-size: var(--text-micro);
  letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
  color: var(--muted); background: var(--surface-2);
  border-radius: var(--radius-pill); padding: 3px 9px;
}
.src {
  display: inline-block; font-size: var(--text-micro);
  letter-spacing: 0.05em; text-transform: uppercase; font-weight: 600;
  color: var(--accent); background: var(--accent-wash);
  border-radius: var(--radius-pill); padding: 3px 9px;
}

/* ============================================================
   Quests
   ============================================================ */
.mstones { list-style: none; margin: 15px 0 0; padding: 0; }
.mstones li { display: flex; gap: 14px; align-items: flex-start; padding: 9px 0; position: relative; }
.mstones li::before {
  content: ""; position: absolute; left: 8px; top: 28px; bottom: -9px;
  width: 1.5px; background: var(--line);
}
.mstones li:last-child::before { display: none; }
.mstones .node {
  flex: none; width: 17px; height: 17px; border-radius: 50%; margin-top: 4px;
  border: 1.5px solid var(--line); background: var(--surface);
  cursor: pointer; z-index: 1;
  display: grid; place-items: center; font-size: 9px; color: transparent;
  transition: all .18s;
}
.mstones .node:hover { border-color: var(--accent); }
.mstones li.done .node { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.mstones li.done .m-label { color: var(--muted); }
.m-week {
  font-size: var(--text-micro); letter-spacing: 0.075em;
  text-transform: uppercase; font-weight: 600; color: var(--muted);
}
.m-label { font-size: var(--text-body-sm); color: var(--text); margin-top: 1px; }

/* ============================================================
   Story
   ============================================================ */
.moment {
  position: relative; padding: 2px 0 22px 22px;
  border-left: 1.5px solid var(--line);
}
.moment:last-child { border-left-color: transparent; }
.moment::before {
  content: ""; position: absolute; left: -4.5px; top: 7px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.moment .when {
  font-size: var(--text-micro); letter-spacing: 0.075em;
  text-transform: uppercase; font-weight: 600; color: var(--muted);
}
.moment .what {
  margin-top: 5px; line-height: 1.5; white-space: pre-wrap;
  color: var(--body-text); font-size: var(--text-body);
}
.moment .t-skip { margin-top: 6px; }

.tally { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.tally div {
  flex: 1; min-width: 102px;
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 17px 16px;
  box-shadow: var(--ring-1);
}
.tally b { display: block; font-size: 38px; line-height: 1; margin-bottom: 7px; }
.tally span { font-size: var(--text-caption); color: var(--muted); line-height: 1.3; display: block; }

/* ============================================================
   Celebration
   ============================================================ */
.win-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(20, 17, 16, .5);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 24px;
}
.win-card {
  background: var(--surface);
  border-radius: var(--radius-card-lg);
  padding: 32px 26px; text-align: center; max-width: 372px;
  animation: pop .32s cubic-bezier(.2, 1.25, .4, 1);
}
.win-card h3 { font-size: 30px; line-height: 1.1; margin: 13px 0 8px; }
.win-card p { color: var(--muted); font-size: var(--text-body-sm); }
.win-emoji { font-size: 42px; line-height: 1; }
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }

.confetti {
  position: fixed; top: -14px; width: 7px; height: 12px; z-index: 95;
  border-radius: 2px; pointer-events: none;
  animation: fall 3s linear forwards;
}
@keyframes fall { to { transform: translateY(105vh) rotate(680deg); opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(26px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 80;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius-pill);
  padding: 12px 21px;
  font-size: var(--text-body-sm); font-weight: 500;
  max-width: calc(100vw - 40px);
  animation: rise .24s ease;
}
[data-theme="dark"] .toast { background: var(--surface-2); color: var(--text); box-shadow: var(--ring-1); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 12px); } }

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