/* ---- tokens: Ink, signed. Paper and ink do the work; Mochi is the only colour. ---- */
:root {
  color-scheme: light dark;
  --bg: #f7f6f3; /* paper */
  --raised: #ffffff; /* sheets and bubbles */
  --float: #ffffff; /* buttons that float over a sheet */
  --ink: #1d1c1a;
  --ink-soft: #6e6b66;
  --faint: #a9a6a0;
  --line: rgba(29, 28, 26, 0.09);
  --track: #eceae6;
  --glass: rgba(255, 255, 255, 0.78);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --fill-soft: rgba(29, 28, 26, 0.05);
  --fill: rgba(29, 28, 26, 0.07);
  --shadow: 0 -10px 30px rgba(29, 28, 26, 0.05);
  --lift: 0 1px 1px rgba(29, 28, 26, 0.04), 0 8px 24px rgba(29, 28, 26, 0.09);
  --danger: #b5503d;
  --late: #b9603f; /* "From Saturday": a leftover, said calmly */
  --heavy: #cf4f43;
  --moving: #c98a12;
  --easing: #2f9a68;
  --ring: #d6d3cd;
  /* Everything she can tap is ink, whatever colour Mochi is. */
  --accent: var(--ink);
  --accent-ink: var(--ink);
  --cta: #1d1c1a;
  --cta-ink: #ffffff;
  --cta-glow: rgba(29, 28, 26, 0.2);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur: 0.55s;
  --top-h: 74px; /* the top buttons end at 62px; the open sheet starts 12px below */
  --peek-h: 84px; /* how much of the sheet shows when it rests */
  --sheet-top: calc(100dvh - var(--peek-h) - var(--safe-b)); /* the sheet's top edge on Home: resting at Peek */
  --map-top: 300px; /* Life map's sheet rests higher: it's a page you came to read */
  --safe-b: env(safe-area-inset-bottom, 0px);
  /* One family for everything. Its optical size makes big titles a little hand-cut and reading text calm. */
  font-family: "Bricolage Grotesque", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
}

/* Mochi's own colour: its body, the beans, and its words. Never a button, a bar or a tick. */
:root, [data-mochi="Lilac"] { --mochi: #b7a6ff; --mochi-ink: #5a47b5; }
[data-mochi="Pink"] { --mochi: #f7a3c8; --mochi-ink: #b03a7c; }
[data-mochi="Apricot"] { --mochi: #ffb27a; --mochi-ink: #b4521c; }
[data-mochi="Butter"] { --mochi: #f6d95e; --mochi-ink: #8f6200; }
[data-mochi="Leaf"] { --mochi: #97dba0; --mochi-ink: #2f7d45; }
[data-mochi="Blue"] { --mochi: #90b3ff; --mochi-ink: #3355d6; }

/* After dark the paper turns over: warm black, white ink, Mochi the brightest thing on screen. */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141311;
    --raised: #1e1d1a;
    --ink: #f1eee8;
    --ink-soft: #a19c94;
    --faint: #6e6a63;
    --line: rgba(241, 238, 232, 0.1);
    --track: #33312c;
    --glass: rgba(42, 40, 36, 0.85);
    --glass-edge: rgba(241, 238, 232, 0.08);
    --fill-soft: rgba(241, 238, 232, 0.06);
    --fill: rgba(241, 238, 232, 0.09);
    --shadow: none;
    --lift: none;
    --danger: #ff9b8a;
    --late: #e79a78;
    --heavy: #ff8a7d;
    --moving: #f0c060;
    --easing: #6fd3a0;
    --ring: #45423c;
    --cta: #f1eee8;
    --cta-ink: #141311;
    --cta-glow: rgba(0, 0, 0, 0.4);
    --float: #2a2824; /* no shadows on dark, so floating buttons get a little lighter instead */
  }
  [data-mochi] { --mochi-ink: var(--mochi); }
}

@media (prefers-reduced-motion: reduce) {
  :root { --dur: 0.01s; }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
}

button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: default; opacity: 0.5; }
input, textarea, select { font: inherit; font-size: 16px; color: var(--ink); }

.link {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 14px;
}
.link.inline { padding: 0; font-size: inherit; }
.muted { color: var(--ink-soft); font-size: 14px; }

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  background: none;
  border: 0;
  border-radius: 50%;
  padding: 0;
  color: var(--ink-soft);
}
.icon-btn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.glass {
  height: 44px;
  min-width: 44px;
  border: 0;
  border-radius: 22px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass);
  box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 1px 2px rgba(29, 28, 26, 0.06);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.glass svg { width: 20px; height: 20px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---- the surface: the whole app slides as one piece ---- */
#surface {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  background: var(--bg);
  transition: transform var(--dur) var(--ease);
  will-change: transform;
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.12);
}
#surface.dragging { transition: none; }

#edge { position: fixed; left: 0; top: var(--top-h); bottom: 0; width: 16px; z-index: 60; touch-action: none; }
#shield { position: absolute; inset: 0; z-index: 50; touch-action: none; cursor: pointer; }

#panel {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(84vw, 320px);
  z-index: 0;
  padding: max(14px, env(safe-area-inset-top)) 12px max(12px, var(--safe-b));
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ic { width: 22px; height: 22px; flex: 0 0 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.panel-name { display: flex; align-items: center; gap: 10px; padding: 4px 8px 2px; }
.panel-avatar {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--fill);
}
.panel-who { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.panel-who strong { font-size: 16px; font-weight: 600; }
.panel-who small { font-size: 13px; color: var(--ink-soft); }

.panel-search {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 14px;
  background: var(--raised);
  color: var(--ink-soft);
  font-size: 16px;
  text-align: left;
}

.panel-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin-inline: -4px; padding-inline: 4px; }
.panel-main { display: flex; flex-direction: column; gap: 2px; }

.panel-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 52px;
  padding: 0 14px;
  border: 0;
  border-radius: 15px;
  background: none;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
.panel-row .ic { color: var(--ink-soft); }
/* The menu's own icons are solid shapes in one colour, with real holes so any row fill shows through. */
.ic-solid { width: 24px; height: 24px; flex-basis: 24px; fill: currentColor; stroke: none; }
.panel-row[aria-current="page"], .panel-talk[aria-current="page"] { background: var(--fill); }
.panel-row[aria-current="page"] .ic { color: var(--accent-ink); }
.panel-row:active, .panel-talk:active, .panel-search:active { background: var(--fill); }
@media (hover: hover) { .panel-row:hover, .panel-talk:hover { background: var(--fill-soft); } }
.panel-row[aria-current="page"]:hover, .panel-talk[aria-current="page"]:hover { background: var(--fill); }

.panel-head { margin: 16px 14px 4px; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.panel-talk {
  display: block;
  width: 100%;
  padding: 8px 14px;
  border: 0;
  border-radius: 14px;
  background: none;
  text-align: left;
}
.panel-talk .t-title { display: block; font-size: 15px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-talk .t-line { display: block; font-size: 13px; line-height: 1.35; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-all { display: block; width: 100%; padding: 10px 14px; border: 0; border-radius: 14px; background: none; text-align: left; font-size: 14px; color: var(--ink-soft); }

.panel-bottom { flex: 0 0 auto; }

/* full talks page */
.talk-group { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin: 18px 0 2px; }
.talk-group:first-child { margin-top: 4px; }
.talk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; }
.talk-row .t-title { font-size: 16px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.talk-row .t-day { font-size: 13px; color: var(--ink-soft); align-self: center; }
.talk-row .t-line { grid-column: 1 / -1; font-size: 14px; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }

.top {
  position: absolute;
  inset: 0 0 auto 0;
  height: var(--top-h);
  padding: 18px 18px 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  z-index: 31;
  pointer-events: none;
}
.top > * { pointer-events: auto; }
.kept { padding: 0 14px 0 11px; gap: 5px; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; font-variant-numeric: tabular-nums; }
.kept svg { width: 17px; height: 17px; fill: var(--mochi); stroke: none; }
.bean-fly { position: absolute; z-index: 34; width: 18px; height: 18px; margin: -9px 0 0 -9px; pointer-events: none; }
.bean-fly svg { display: block; width: 100%; height: 100%; fill: var(--mochi); filter: drop-shadow(0 2px 3px rgba(29, 28, 26, 0.2)); }
#keptPill svg path { transform-origin: center bottom; }
.bean-up { position: absolute; top: 58px; right: 26px; z-index: 33; font-size: 15px; font-weight: 700; color: var(--mochi-ink); pointer-events: none; animation: bean-up 1.1s var(--ease) both; }
@keyframes bean-up { from { opacity: 0; transform: translateY(14px); } 25% { opacity: 1; } to { opacity: 0; transform: translateY(-16px); } }
body:not([data-stage="home"]) #menuBtn { display: none; }
body:not([data-stage="home"]) .top { justify-content: flex-start; }
body:not([data-stage="home"]) .kept { margin-left: auto; }
body[data-over="on"] .top { display: none; }

.banner { display: flex; align-items: center; gap: 12px; }
.banner > span { flex: 1; min-width: 0; }
.banner-act { flex: none; height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--cta); color: var(--cta-ink); font: inherit; font-size: 14px; font-weight: 600; }
.banner {
  position: absolute;
  top: var(--top-h);
  left: 16px;
  right: 16px;
  z-index: 32;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--raised);
  color: var(--danger);
  font-size: 14px;
  box-shadow: var(--lift);
}

/* ---- Home under the mochi: its words as plain type, then the doors ---- */
#bubble {
  position: absolute;
  top: calc(214px + var(--shift, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: min(340px, calc(100% - 40px));
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity 0.2s, transform var(--dur) var(--ease), top var(--dur) var(--ease);
}
#say {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.4px;
  line-height: 1.28;
  text-align: center;
  text-wrap: balance;
}
#reviewProposal { position: relative; margin-top: 6px; font-size: 13px; }

/* A door is a talk with a practice: a pill that hugs its words, the icon in that practice's colour.
   The door for right now goes first; nothing else marks it. */
#doors { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 34px; }
#doors:empty, body:not([data-map="off"]) #doors { display: none; }
.door {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 52px;
  padding: 0 22px 0 18px;
  border: 0;
  border-radius: 26px;
  background: var(--float);
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  max-width: 100%;
  box-shadow: var(--lift);
  transition: transform 0.14s var(--ease);
}
.door:active { transform: scale(0.97); }
/* Icons are filled: the shape in the practice's colour, any inner mark knocked out in white. */
.door svg, .practice-chip .pi, .practice-menu svg { width: 20px; height: 20px; flex: none; color: var(--pc, currentColor); fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.practice-menu .ok { fill: none; }
.door span { overflow: hidden; text-overflow: ellipsis; }
[data-p="plan"] { --pc: var(--a-making); }
[data-p="talk"], [data-p="open"] { --pc: var(--a-work); }
[data-p="reframe"] { --pc: var(--a-body); }
[data-p="winddown"] { --pc: var(--a-mind); }
[data-p="list"] { --pc: var(--a-home); }
[data-p="question"] { --pc: var(--a-people); }

/* Home rests on the doors: no Talk pill (the doors and a tap on Mochi start talks) and no
   dress button (the bean count opens it). Life map keeps its Talk. */
/* Home: talking has its own bar, above the list's resting edge. Mochi itself is for play. */
body[data-stage="home"][data-map="off"] #controls { bottom: calc(var(--peek-h) + var(--safe-b) + 14px); }
/* With the sheet pulled up, the bar keeps that same 14px, now from the bottom of the screen,
   and slides down with the sheet. */
body[data-stage="home"][data-map="off"][data-sheet="open"] #controls { bottom: calc(var(--safe-b) + 14px); }
body[data-stage="home"] #controls { transition: bottom var(--dur) var(--ease); }
#homeKeyBtn { display: none; }
body[data-stage="home"][data-map="off"] #homeKeyBtn { display: grid; }
#dressBtn { display: none; }

/* The practice chip in a talk, and its small menu. */
.practice-chip { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); gap: 8px; padding: 0 14px 0 13px; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; white-space: nowrap; }
.practice-chip .chev { width: 16px; height: 16px; fill: none; stroke: var(--ink-soft); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
body:not([data-stage="talk"]) .practice-chip, body[data-map="on"] .practice-chip, body[data-map="full"] .practice-chip { display: none; }
.practice-menu { position: absolute; top: 70px; left: 50%; transform: translateX(-50%); z-index: 40; width: 240px; padding: 6px; border-radius: 20px; background: var(--raised); box-shadow: 0 1px 2px rgba(29, 28, 26, 0.06), 0 14px 40px rgba(20, 18, 14, 0.18); }
.practice-menu button { display: flex; align-items: center; gap: 12px; width: 100%; height: 48px; padding: 0 12px; border: 0; border-radius: 14px; background: none; color: var(--ink); font-size: 17px; font-weight: 600; letter-spacing: -0.2px; text-align: left; }
.practice-menu button[aria-checked="true"] { background: var(--fill-soft); }
.practice-menu .ok { margin-left: auto; --pc: var(--ink); }

body:not([data-stage="home"]) #bubble, body[data-sheet="open"] #bubble { opacity: 0; pointer-events: none; transform: translate(-50%, 10px); }

/* ---- the transcript: under the mochi, streaming upward from the controls ---- */
#home {
  position: absolute;
  top: calc(212px + var(--shift, 0px));
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
body[data-stage="talk"] #home { opacity: 1; pointer-events: auto; transition-delay: 0.15s; }
#scroll {
  position: absolute;
  /* Ends a little above whatever the controls hold now (her live words, the mic bar or the
     text field), so the newest line never sits under them. app.js measures --controls-h. */
  inset: 0 0 calc(22px + var(--controls-h, 114px) + 18px + var(--safe-b)) 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 44px 22px 20px;
  scroll-behavior: smooth;
  -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 48px, #000 calc(100% - 22px), transparent 100%);
  mask-image: linear-gradient(180deg, transparent 0, #000 48px, #000 calc(100% - 22px), transparent 100%);
}
#transcript, #textForm, #talkBar, #pageBody, .page-head, #takeText, .take-meta, .sheet-head, #sheetBody > * { max-width: 520px; margin-inline: auto; width: 100%; }
#transcript { list-style: none; margin-block: auto 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
/* Cards that arrive while Mochi is still talking (a take, a meditation) wait here, the last
   thing in the chat: Mochi's words stream above them and they scroll with the rest. They join
   the transcript, in order, when the next line starts. */
#dock { list-style: none; margin: 14px auto 0; padding: 0; max-width: 520px; width: 100%; display: flex; flex-direction: column; gap: 14px; }
#dock:empty { display: none; }
#dock .take-item { margin-block: 4px; }

@keyframes word-in { from { opacity: 0; } to { opacity: 1; } }
#transcript .w { animation: word-in 0.26s linear both; animation-delay: var(--d, 0s); }

/* Style: Clean. Her words step back, the guide's are the page. */
#transcript .guide { font-size: 19px; line-height: 1.42; font-weight: 500; letter-spacing: -0.25px; }
#transcript .you { align-self: flex-end; max-width: 86%; text-align: right; font-size: 16px; line-height: 1.4; color: var(--ink-soft); }

/* Style: Focus. Only the line being said is in full ink. */
[data-transcript="focus"] #transcript { gap: 18px; }
[data-transcript="focus"] #transcript .guide { font-size: 17px; font-weight: 500; opacity: 0.32; transition: opacity 0.35s; }
[data-transcript="focus"] #transcript .guide.now { font-size: 25px; line-height: 1.3; font-weight: 600; letter-spacing: -0.5px; opacity: 1; }
[data-transcript="focus"] #transcript .you { opacity: 0.45; font-size: 15px; }

/* Style: Bubbles. Her words in a soft tint of the mochi. */
[data-transcript="bubbles"] #transcript .guide { font-size: 17px; line-height: 1.45; font-weight: 400; letter-spacing: -0.15px; }
[data-transcript="bubbles"] #transcript .you { text-align: left; color: var(--ink); background: var(--fill); border-radius: 18px 18px 4px 18px; padding: 9px 13px; }

/* Style: Sheet. The Home sheet stays, and its list turns into the conversation. */
[data-transcript="sheet"] #home { background: var(--raised); border-radius: 30px 30px 0 0; box-shadow: var(--shadow); top: 196px; }
[data-transcript="sheet"] #transcript .guide { font-size: 18px; line-height: 1.45; font-weight: 400; letter-spacing: -0.2px; }
[data-transcript="sheet"] #scroll { padding-top: 34px; -webkit-mask-image: linear-gradient(180deg, transparent 0, #000 34px, #000 calc(100% - 22px), transparent 100%); mask-image: linear-gradient(180deg, transparent 0, #000 34px, #000 calc(100% - 22px), transparent 100%); }

.chip-item, .signed-line { list-style: none; }
.action-item { list-style: none; }
/* What the guide changed: a one-line caption saying what happened, with Undo, over the rows. */
.cap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 2px 4px 12px; font-size: 13.5px; color: var(--ink-soft); }
.cap-undo { border: 0; background: none; padding: 0; font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.act-card { background: var(--raised); border-radius: 18px; padding: 0 16px 0 4px; box-shadow: var(--lift); }
button.act-card { display: block; width: 100%; border: 0; text-align: left; }
.act-card .r { display: flex; align-items: center; gap: 4px; }
.act-card .r + .r { border-top: 1px solid var(--line); }
.act-card .t { min-width: 0; display: flex; flex-direction: column; padding: 13px 0; }
.act-card b { font-size: 16px; font-weight: 550; letter-spacing: -0.2px; line-height: 1.3; }
.act-card small { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }
.act-card small[hidden] { display: none; }
.act-card .grateful-mark { flex: none; width: 24px; height: 24px; margin: 10px 10px 10px 8px; }
.act-card .grateful-mark svg { width: 13px; height: 13px; }
.act-card .k-done b { color: var(--ink-soft); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1.5px; }
.act-card .k-removed b { color: var(--faint); font-weight: 500; text-decoration: line-through; }
.ring.faint { opacity: 0.4; }
/* A turn's changes: steps one indent under their main task, as on Home; a main task shown only
   for its steps is faint; a goal shows its area icon, as on the Goals page. */
.act-card .r.step { padding-left: 36px; }
.act-card .r.step .ring::before { inset: 11px; }
.act-card .r.step .ring svg { width: 13px; height: 13px; }
.act-card .r.step b { font-size: 15.5px; font-weight: 500; }
.act-card .r.ctx b { color: var(--faint); font-weight: 500; }
.act-card .r.goal .area { flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.act-card .r.goal .area svg { width: 22px; height: 22px; fill: none; stroke: var(--ink-soft); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.mind-mark { flex: none; width: 22px; height: 22px; margin: 11px; color: var(--a-body); fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.action-item.undone .act-card { opacity: 0.45; }

/* A finished reframe: before and after, labels on top, then its test as a list row. */
.reframe-card { list-style: none; background: var(--raised); border-radius: 22px; padding: 18px 18px 4px; box-shadow: var(--lift); }
.reframe-card .blk { padding: 2px 0 16px; }
.reframe-card .blk + .blk { border-top: 1px solid var(--line); padding-top: 16px; }
.reframe-card .lb { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 5px; }
.reframe-card p { margin: 0; font-size: 17px; line-height: 1.42; letter-spacing: -0.2px; }
.reframe-card .after p { font-weight: 650; }
.take-chip {
  border: 0;
  background: var(--fill);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent-ink);
}
.signed-line .link { color: var(--ink-soft); font-size: 14px; text-align: left; }

/* ---- controls ---- */
#controls {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: calc(22px + var(--safe-b));
  z-index: 22;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
}
#controls > * { pointer-events: auto; }
#subcaption { margin: 0; font-size: 14px; color: var(--ink-soft); text-align: center; pointer-events: none; }
#subcaption:empty { display: none; }
/* In a talk her live words always have two lines kept for them, so the transcript doesn't
   jump each time she starts and stops talking. */
body[data-keyboard="on"] #subcaption { display: none; }
body[data-stage="talk"]:not([data-keyboard="on"]) #subcaption { display: flex; flex-direction: column; justify-content: flex-end; height: 2.8em; line-height: 1.4; overflow: hidden; }

#startRow { display: flex; align-items: center; gap: 12px; width: 100%; max-width: 420px; }
#talkBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  height: 62px;
  border: 0;
  border-radius: 31px;
  background: var(--cta);
  color: var(--cta-ink);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: -0.3px;
  box-shadow: 0 10px 26px var(--cta-glow);
  transition: transform 0.18s var(--ease);
}
#talkBtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#talkBtn:active { transform: scale(0.97); }
body[data-stage="talk"] #startRow, body[data-stage="dress"] #startRow, body[data-over="on"] #startRow { display: none; }

#talkBar { display: none; align-items: center; justify-content: center; gap: 12px; }
body[data-stage="talk"]:not([data-keyboard="on"]) #talkBar { display: flex; }
body[data-view="off"] #controls { visibility: hidden; }
body[data-sheet="open"] #controls { visibility: visible; }
body[data-sheet="open"][data-stage="talk"] #controls { visibility: hidden; }
body[data-over="on"] #controls { visibility: hidden; }

#micBtn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex: 0 1 244px;
  height: 62px;
  padding: 0 20px;
  border: 0;
  border-radius: 31px;
  background: var(--float);
  box-shadow: var(--lift);
  color: var(--cta);
  transition: background 0.2s, color 0.2s, transform 0.18s var(--ease);
}
#micBtn svg { width: 26px; height: 26px; flex: 0 0 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
#micBtn:active { transform: scale(0.97); }
#micLabel { font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink); white-space: nowrap; }
#micLabel:empty { display: none; }
#micDots { display: flex; align-items: center; gap: 5px; height: 24px; }
#micDots i { width: 6px; height: 6px; border-radius: 3px; background: currentColor; opacity: 0.55; transition: height 0.09s linear, opacity 0.2s; }
body[data-phase="recording"] #micBtn { background: var(--cta); color: var(--cta-ink); }
/* The talk controls (2026-11-11): the round mic switch, on or off at any moment (off, it fills
   with ink like a call's mute), and Mochi's voice on or off, top right. The talk button keeps
   its padding: when its words need the room, the dots go from 6 to 4 to 3 to none (fitMicDots). */
#micSwitch { transition: background 0.2s, color 0.2s, transform 0.18s var(--ease); }
#micSwitch svg { width: 26px; height: 26px; stroke-width: 2; }
#micSwitch:active { transform: scale(0.94); }
#micSwitch[aria-pressed="true"] { background: var(--cta); color: var(--cta-ink); }
#micSwitch .ic-off, #micSwitch[aria-pressed="true"] .ic-on, #voiceBtn .ic-off, #voiceBtn[aria-pressed="true"] .ic-on { display: none; }
#micSwitch[aria-pressed="true"] .ic-off, #voiceBtn[aria-pressed="true"] .ic-off { display: block; }
body[data-micoff="on"] #micDots i { opacity: 0.2; }
#micBtn[data-dots="4"] #micDots i:nth-child(1), #micBtn[data-dots="4"] #micDots i:nth-child(6),
#micBtn[data-dots="3"] #micDots i:nth-child(1), #micBtn[data-dots="3"] #micDots i:nth-child(4), #micBtn[data-dots="3"] #micDots i:nth-child(6) { display: none; }
#micBtn[data-dots="0"] #micDots { display: none; }
#voiceBtn { display: none; position: absolute; top: 18px; right: 18px; width: 44px; }
#voiceBtn svg { width: 21px; height: 21px; }
body[data-stage="talk"][data-map="off"] #voiceBtn { display: flex; }
body[data-phase="recording"] #micDots i { opacity: 1; height: calc(6px + var(--lv, 0) * var(--k, 1) * 18px); }
body[data-phase="recording"] #micLabel { color: inherit; }
#micDots i:nth-child(1), #micDots i:nth-child(6) { --k: 0.45; }
#micDots i:nth-child(2), #micDots i:nth-child(5) { --k: 0.8; }
#micDots i:nth-child(3), #micDots i:nth-child(4) { --k: 1; }
@keyframes dot-wait { 0%, 100% { transform: translateY(0); opacity: 0.35; } 50% { transform: translateY(-3px); opacity: 0.9; } }
body[data-busy="on"] #micDots i { animation: dot-wait 1.1s ease-in-out infinite; }
#micDots i:nth-child(2) { animation-delay: 0.1s; } #micDots i:nth-child(3) { animation-delay: 0.2s; } #micDots i:nth-child(4) { animation-delay: 0.3s; } #micDots i:nth-child(5) { animation-delay: 0.4s; } #micDots i:nth-child(6) { animation-delay: 0.5s; }

.round {
  width: 62px;
  height: 62px;
  flex: 0 0 62px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--float);
  box-shadow: var(--lift);
  padding: 0;
  color: var(--ink);
}
.round svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.pill {
  border: 0;
  background: var(--float);
  border-radius: 999px;
  padding: 9px 15px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.15;
  color: var(--accent-ink);
  box-shadow: var(--lift);
}

#textForm { display: flex; align-items: center; gap: 8px; height: 62px; padding: 0 8px 0 20px; background: var(--float); border-radius: 31px; box-shadow: var(--lift); }
#textForm input { flex: 1; min-width: 0; border: 0; background: none; outline: none; }
#textForm button { width: 46px; height: 46px; flex: 0 0 46px; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--cta); color: var(--cta-ink); padding: 0; }
#textForm svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
/* Empty, the button goes back to talking; with words in the field, it sends them. */
#textForm[data-empty="true"] .ic-send, #textForm:not([data-empty="true"]) .ic-voice { display: none; }
#textForm[data-empty="true"] button { background: var(--fill); color: var(--ink); }

/* ---- Presence: only this block and presence.js know how the guide is drawn ---- */
/* Where Mochi stands. On Home at rest, Mochi, its words and the doors sit together a little
   above the middle of the room over the sheet (app.js measures --home-y). In a talk Mochi
   steps down to clear the practice chip, and the transcript with it. */
body[data-stage="home"][data-map="off"][data-sheet="closed"] { --shift: var(--home-y, 0px); }
body[data-stage="talk"][data-map="off"] { --shift: 50px; }
#presence {
  --py: calc(28px + var(--shift, 0px));
  --ps: 0.88;
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 30;
  width: 200px;
  height: 200px;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  outline-offset: -20px;
  pointer-events: none;
  transform: translate(-50%, var(--py)) scale(var(--ps));
  transition: transform var(--dur) var(--ease);
}
/* The body's shape takes the touches, and follows it through the air. */
.presence-hit, #presence > .presence-body { pointer-events: auto; }
.presence-hit {
  position: absolute;
  left: 7%;
  right: 7%;
  top: 14%;
  bottom: 10%;
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
}
/* Home and talk share one size, so she can always find it. */
body[data-stage="play"] #presence { --py: calc(44dvh - 130px); --ps: 1.22; }
body[data-stage="dress"] #presence { --py: 92px; --ps: 1.12; }
/* Tall ears and hats need headroom, so the body sits a little lower and smaller. */
body[data-tall="on"]:not([data-stage="play"]):not([data-stage="dress"]) #presence { --py: calc(50px + var(--shift, 0px)); --ps: 0.74; }
body[data-sheet="open"] #presence { --py: -38px; --ps: 0.42; }

/* Fills the surface so a toss never clips. Takes no touches, so nothing is blocked. */
.presence-canvas { position: absolute; inset: 0; z-index: 30; width: 100%; height: 100%; pointer-events: none; }
.presence-token canvas { display: block; width: 100%; height: 100%; }

/* The fallback dot, used only when WebGL2 isn't available. */
.presence-body {
  display: block;
  width: 60%;
  height: 60%;
  margin: 20%;
  border-radius: 50%;
  background: var(--mochi);
  scale: calc(1 + var(--level, 0) * 0.4);
  transition: scale 90ms linear, filter var(--dur) var(--ease);
  animation: presence-breathe 7s ease-in-out infinite;
}
[data-state="thinking"] > .presence-body { animation-duration: 1.8s; }
[data-state="speaking"] > .presence-body { animation-duration: 4s; }
[data-state="happy"] > .presence-body { animation-duration: 0.7s; filter: brightness(1.12) saturate(1.2); }
[data-state="sleepy"] > .presence-body { animation-duration: 12s; filter: saturate(0.6); opacity: 0.8; }

@keyframes presence-breathe {
  0%, 100% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.05); opacity: 1; }
}

.presence-token { pointer-events: none; }

/* ---- the Today sheet ---- */
#sheet {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--top-h);
  height: calc(100% - var(--top-h));
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow);
  transform: translateY(calc(var(--sheet-top) - var(--top-h)));
  transition: transform var(--dur) var(--ease);
}
#sheet.dragging { transition: none; }
#sheet.away { transform: translateY(102%) !important; }

.grabber { display: block; width: 36px; height: 5px; border-radius: 3px; background: var(--track); margin: 0 auto; }

#peek { flex: 0 0 auto; padding: 10px 22px 6px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
#peek .grabber { margin-bottom: 14px; }

/* The sheet's top: three tabs, the first named for the day it shows, and the calendar. */
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 36px; }
.tabs { display: flex; gap: 18px; align-items: baseline; min-width: 0; }
.tabs button { border: 0; background: none; padding: 2px 0; font-size: 22px; font-weight: 700; letter-spacing: -0.7px; color: var(--faint); white-space: nowrap; transition: color 0.2s; }
.tabs button[aria-selected="true"] { color: var(--ink); }
.cal-btn { flex: none; width: 36px; height: 36px; border: 0; border-radius: 18px; display: grid; place-items: center; background: var(--fill-soft); color: var(--ink-soft); padding: 0; }
.cal-btn svg, .pop svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sheet-empty { margin: 0; padding: 14px 0; font-size: 16px; line-height: 1.35; color: var(--ink-soft); letter-spacing: -0.2px; }

#sheetBody {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 0 22px calc(var(--sheet-top) + 40px + var(--safe-b));
}
body[data-sheet="open"] #sheetBody { padding-bottom: calc(110px + var(--safe-b)); }

.today-list { list-style: none; margin: 0 auto; padding: 4px 0 0; }

/* One kind of row for every line, on every day. Swipe a task left for Move and Remove. */
.sw { position: relative; margin: 0 -22px; overflow: hidden; }
.sw .acts { position: absolute; top: 0; bottom: 0; right: 0; display: flex; visibility: hidden; }
.sw.on .acts { visibility: visible; }
.sw .acts button { width: 74px; border: 0; color: #fff; font-size: 14px; font-weight: 600; padding: 0; }
.sw .acts .mv { background: #8a8680; }
.sw .acts .rm { background: #d23f31; }
.today-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 2px 22px 2px 14px;
  background: var(--raised);
  touch-action: pan-y;
  transition: transform 0.28s var(--ease);
}
.today-text { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; text-align: left; }
.today-text .t { display: block; font-size: 17px; font-weight: 550; letter-spacing: -0.3px; line-height: 1.26; transition: color 0.25s; }
.today-text .s { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-soft); letter-spacing: -0.12px; }
.today-row.done .t { color: var(--ink-soft); font-weight: 500; text-decoration: line-through; text-decoration-thickness: 1.5px; }
#sheetBody .today-row.done .t { text-decoration-color: var(--faint); } /* struck through softly */
/* The line under a to-do: its goal, its deadline, its reminder, each with its own icon.
   A deadline that has come is in her Mochi's colour, not a warning red. */
.today-text .line { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 3px; font-size: 14px; letter-spacing: -0.12px; color: var(--ink-soft); }
.today-text .line .f { display: inline-flex; align-items: center; gap: 4px; min-width: 0; max-width: 100%; }
.today-text .line .ft { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-text .line svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.today-text .line .f.hot { color: var(--mochi-ink); font-weight: 600; }
.today-row.done .line, .today-row.done .line .f.hot { color: var(--faint); font-weight: 400; }
.today-text .s.note { margin-top: 3px; }
/* A step under a main task: one indent, a smaller circle and a smaller line. */
.today-row.step { padding-left: 50px; }
.today-row.step .ring::before { inset: 11px; }
.today-row.step .ring svg { width: 13px; height: 13px; }
.today-row.step .today-text { padding: 9px 0; }
.today-row.step .today-text .t { font-size: 15.5px; font-weight: 500; letter-spacing: -0.2px; }
.ring {
  flex: none;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  padding: 7px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  position: relative;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 8.5px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--ring);
  transition: background 0.2s, box-shadow 0.2s, transform 0.3s cubic-bezier(0.3, 1.8, 0.5, 1);
}
.ring svg { position: relative; width: 16px; height: 16px; fill: none; stroke: var(--cta-ink); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: scale(0.6); transition: opacity 0.15s, transform 0.25s cubic-bezier(0.3, 1.8, 0.5, 1); }
.ring:active::before { transform: scale(0.88); }
.ring[aria-pressed="true"]::before { background: var(--cta); box-shadow: none; }
.ring[aria-pressed="true"] svg { opacity: 1; transform: none; }
/* On Today a done circle fills with her Mochi's colour, with a dark check. */
#sheetBody .ring[aria-pressed="true"]::before { background: var(--mochi); }
#sheetBody .ring svg { stroke: #1d1c1a; }

/* A to-do opened in place: its words, three chips, and a short list under them. */
.today-row.editing { touch-action: auto; }
.edit-card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding: 10px 0; }
.edit-t { width: 100%; min-width: 0; border: 0; outline: none; background: none; padding: 0; font: inherit; font-size: 17px; font-weight: 550; letter-spacing: -0.3px; line-height: 1.26; color: var(--ink); user-select: text; -webkit-user-select: text; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; height: 32px; border-radius: 16px; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink-soft); background: transparent; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.chip.set { background: var(--fill-soft); color: var(--ink); box-shadow: none; }
.chip.hot { background: color-mix(in srgb, var(--mochi) 18%, transparent); color: var(--mochi-ink); }
.chip.open { background: color-mix(in srgb, var(--mochi) 26%, transparent); color: var(--mochi-ink); box-shadow: none; }
.chip button { height: 32px; border: 0; background: none; color: inherit; padding: 0; display: inline-flex; align-items: center; outline: none; border-radius: 16px; }
.chip .chip-b { gap: 6px; padding: 0 11px; font-size: 14px; font-weight: 500; letter-spacing: -0.12px; white-space: nowrap; }
.chip.set .chip-b { font-weight: 600; }
.chip.has-x .chip-b { padding-right: 2px; }
.chip .chip-x { width: 26px; justify-content: center; }
.chip svg { flex: none; width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.chip .chip-x svg { width: 11px; height: 11px; stroke-width: 2.4; }
.edit-card button:focus-visible { outline: none; box-shadow: 0 0 0 2px color-mix(in srgb, var(--mochi) 60%, transparent); }
.edit-pick { display: flex; flex-direction: column; gap: 1px; padding: 6px; border-radius: 14px; background: var(--bg); animation: pick-in 0.14s ease-out both; }
@keyframes pick-in { from { opacity: 0; } }
.opt { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 10px; background: none; text-align: left; font-size: 15.5px; font-weight: 550; letter-spacing: -0.2px; color: var(--ink); }
.opt.on { background: var(--raised); }
.opt.soft { color: var(--ink-soft); }
.opt .o-h { flex: none; font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--faint); }
.opt-sep { display: block; height: 1px; margin: 4px 10px; background: var(--line); }
.opt-none { margin: 0; padding: 10px; font-size: 14px; color: var(--faint); }
.edit-foot { display: flex; justify-content: flex-end; }
.edit-done { border: 0; background: none; padding: 4px 2px; font-size: 15px; font-weight: 650; color: var(--mochi-ink); }
@media (prefers-reduced-motion: reduce) { .edit-pick { animation: none; } }

/* Long-press a to-do and drag it: it rides above the others on a soft shadow, a little
   bigger, and the rows it passes make room for it. */
:root { --lifted: 0 8px 18px rgba(29, 28, 26, 0.14); }
@media (prefers-color-scheme: dark) { :root { --lifted: 0 8px 22px rgba(0, 0, 0, 0.5); } }
#sheetBody .today-row:not(.editing) { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.today-list > li { position: relative; }
.today-list.lifting-list > li { transition: transform 0.3s var(--ease); }
.today-list.lifting-list .sw { transition: box-shadow 0.2s, border-radius 0.2s; }
.today-list > li.lifted { z-index: 5; transition: none; }
.today-list > li.lifted .sw { box-shadow: var(--lifted); border-radius: 16px; }
body.lifting, body.lifting * { cursor: grabbing; -webkit-user-select: none; user-select: none; }
@media (prefers-reduced-motion: reduce) { .today-list.lifting-list > li { transition: none; } }

/* Anytime: everything with no day yet, under Today. */
.anytime { margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.any-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.any-head b { font-size: 17px; font-weight: 700; letter-spacing: -0.3px; }
.any-head span { font-size: 13.5px; color: var(--ink-soft); }
.any-empty { margin: 0; padding: 10px 0; font-size: 15px; color: var(--faint); }

/* The day pop-up: a month calendar, centred over everything. */
.day-pop { position: absolute; inset: 0; z-index: 70; display: grid; place-items: center; padding: 16px; background: rgba(29, 28, 26, 0.28); animation: pop-fade 0.2s ease both; }
@keyframes pop-fade { from { opacity: 0; } }
.pop { width: min(346px, 100%); padding: 22px 18px 10px; border-radius: 28px; background: var(--raised); box-shadow: 0 24px 60px rgba(29, 28, 26, 0.25); animation: pop-in 0.28s var(--ease) both; }
@keyframes pop-in { from { opacity: 0; transform: scale(0.94); } }
.pop-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 4px; }
.pop-top b { display: block; font-size: 22px; font-weight: 700; letter-spacing: -0.5px; }
.pop-top small { display: block; margin-top: 2px; font-size: 14px; color: var(--ink-soft); letter-spacing: -0.1px; }
.pop-x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 20px; display: grid; place-items: center; background: var(--fill-soft); padding: 0; }
.pop-mo { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 4px; }
.pop-mo span { font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.pop-mo button { width: 44px; height: 40px; border: 0; background: none; display: grid; place-items: center; color: var(--cta); padding: 0; }
.pop-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px 3px; }
.pop-grid .wd { height: 22px; font-size: 12px; font-weight: 500; color: var(--faint); text-align: center; }
.pop-grid button, .pop-grid i { height: 44px; border: 0; border-radius: 12px; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 16px; color: var(--ink); }
.pop-grid button:disabled { opacity: 0.3; }
.pop-grid u { width: 4px; height: 4px; border-radius: 50%; background: transparent; text-decoration: none; }
.pop-grid u.on { background: var(--faint); }
.pop-grid button.td { box-shadow: inset 0 0 0 1px var(--cta); color: var(--cta); font-weight: 600; }
.pop-grid button.sel { background: var(--cta); color: var(--cta-ink); font-weight: 600; box-shadow: none; }
.pop-grid button.sel u.on { background: var(--cta-ink); }
.pop-foot { display: flex; justify-content: center; gap: 34px; margin-top: 4px; }
.pop-foot button { min-height: 44px; border: 0; background: none; font-size: 15px; font-weight: 600; color: var(--cta); }
@media (prefers-reduced-motion: reduce) { .day-pop, .pop { animation: none; } }

/* Goals: each part of life keeps one colour, for its icon and its history. */
:root {
  --a-body: #2f9a68; --a-mind: #7a62d6; --a-work: #3d6fc4; --a-making: #d06a26;
  --a-people: #cc4a74; --a-money: #b07e10; --a-learning: #1f8a9f; --a-home: #8a6d4f;
  --pace-bg: #e3f2ea; --pace-ink: #1f6b47;
  --behind-bg: #fbebdf; --behind-ink: #954719;
  --still-bg: var(--fill); --still-ink: #5c5a55;
}
@media (prefers-color-scheme: dark) {
  :root {
    --a-body: #6fd3a0; --a-mind: #b3a2ff; --a-work: #8fb4f0; --a-making: #f2a26b;
    --a-people: #f08aab; --a-money: #e8bf55; --a-learning: #6ccbe0; --a-home: #c9a888;
    --pace-bg: rgba(111, 211, 160, 0.16); --pace-ink: #8fe0b6;
    --behind-bg: rgba(231, 154, 120, 0.16); --behind-ink: #f0b293;
    --still-ink: #c9c4bc;
  }
}
[data-area] { --area: var(--ink-soft); }
[data-area="body"] { --area: var(--a-body); }
[data-area="mind"] { --area: var(--a-mind); }
[data-area="work"] { --area: var(--a-work); }
[data-area="making"] { --area: var(--a-making); }
[data-area="people"] { --area: var(--a-people); }
[data-area="money"] { --area: var(--a-money); }
[data-area="learning"] { --area: var(--a-learning); }
[data-area="home"] { --area: var(--a-home); }

.goal-list { list-style: none; margin: 0; padding: 4px 0 0; }
.goal-row { display: grid; grid-template-columns: 24px minmax(0, 1fr); align-items: start; gap: 14px; width: 100%; padding: 12px 0; border: 0; background: none; text-align: left; }
.goal-row .area { width: 24px; height: 24px; margin-top: 1px; display: grid; place-items: center; }
.goal-row .area svg { width: 24px; height: 24px; fill: none; stroke: var(--area); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.goal-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.goal-t { font-size: 18px; font-weight: 600; letter-spacing: -0.35px; line-height: 1.22; }
.goal-row.paused .goal-t { color: var(--ink-soft); }
.goal-row.paused .area svg { stroke: var(--faint); }

/* A goal's status as a word, and the one fact that matters for it. */
.pace-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pace { font-size: 12.5px; font-weight: 650; letter-spacing: -0.05px; padding: 2px 8px; border-radius: 6px; background: var(--still-bg); color: var(--still-ink); }
.pace[data-pace="on_pace"] { background: var(--pace-bg); color: var(--pace-ink); }
.pace[data-pace="behind"] { background: var(--behind-bg); color: var(--behind-ink); }
.pace-f { font-size: 14.5px; color: var(--ink-soft); letter-spacing: -0.12px; }

/* The goal page: the name with its icon, its status, and fifteen weeks of days. */
.goal-head { display: flex; align-items: center; gap: 10px; }
.goal-head > svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--area); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.goal-head .thread-title { padding: 0; }
.goal-page .pace-line { margin-top: 10px; }
.goal-page .pace-f { font-size: 15px; }
.heat { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; max-width: 340px; margin-top: 24px; }
.heat i { aspect-ratio: 1; border-radius: 4px; background: var(--track); }
.heat i[data-n="1"] { background: color-mix(in srgb, var(--area) 55%, transparent); }
.heat i[data-n="2"] { background: color-mix(in srgb, var(--area) 78%, transparent); }
.heat i[data-n="3"] { background: var(--area); }
.heat i.ahead { background: none; box-shadow: inset 0 0 0 1.5px var(--ring); }
.heat-cap { display: flex; justify-content: space-between; max-width: 340px; margin-top: 8px; font-size: 12.5px; color: var(--ink-soft); }
.goal-why { width: 100%; margin-top: 24px; border: 0; background: none; padding: 0; font: inherit; font-size: 17px; line-height: 1.4; letter-spacing: -0.2px; color: var(--ink-soft); outline: none; resize: none; field-sizing: content; }
.goal-why::placeholder { color: var(--faint); }
.goal-todos { margin-top: 14px; }
.today-text .s.next { color: var(--ink); font-weight: 600; }
.goal-done { border-top: 1px solid var(--line); margin-top: 10px; }
.goal-done summary { display: flex; justify-content: space-between; align-items: center; padding: 14px 0; font-size: 16px; font-weight: 550; list-style: none; cursor: pointer; }
.goal-done summary::-webkit-details-marker { display: none; }
.goal-done summary svg { width: 16px; height: 16px; fill: none; stroke: var(--faint); stroke-width: 2; stroke-linecap: round; transition: transform 0.2s; }
.goal-done[open] summary svg { transform: rotate(90deg); }
.goal-rhythm { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); font-size: 16px; }
.goal-rhythm select { border: 0; background: none; color: var(--ink-soft); font-size: 16px; text-align: right; padding: 0; }

.today-add, .today-add-form { display: flex; align-items: center; gap: 12px; width: 100%; height: 56px; border: 0; background: none; padding: 0; font-size: 16px; font-weight: 500; color: var(--ink-soft); letter-spacing: -0.2px; }
.today-add-form input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font-weight: 500; }
.plus { position: relative; width: 20px; height: 20px; flex: 0 0 20px; }
.plus::before, .plus::after { content: ""; position: absolute; background: var(--ink-soft); border-radius: 1px; }
.plus::before { left: 9px; top: 3px; width: 2.2px; height: 14px; }
.plus::after { left: 3px; top: 9px; width: 14px; height: 2.2px; }

.draft { background: var(--bg); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; font-size: 15px; }
.draft-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.draft p { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { color: var(--ink-soft); text-align: center; padding: 24px 0; }

/* ---- dress up ---- */
#dress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: min(56dvh, 480px);
  z-index: 24;
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow);
  transform: translateY(102%);
  transition: transform var(--dur) var(--ease);
}
body[data-stage="dress"] #dress { transform: none; }
.dress-head { flex: 0 0 auto; padding: 18px 22px 0; }
.dress-level { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dress-level strong { flex: 1; min-width: 0; font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 700; letter-spacing: -0.4px; }
#dressNext { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
#dressBar { height: 5px; margin-top: 10px; border-radius: 3px; background: var(--track); overflow: hidden; }
#dressBar i { display: block; height: 100%; width: var(--p, 0%); border-radius: 3px; background: var(--accent); transition: width 0.5s var(--ease); }
.dress-categories { flex: 0 0 auto; display: flex; justify-content: space-between; gap: 12px; padding: 14px 22px 0; border-bottom: 0.5px solid var(--line); }
#dressTabs { display: flex; gap: clamp(10px, 5vw, 22px); }
#dressTabs button, #openPortraits { border: 0; background: none; padding: 0 0 10px; font-size: 15px; font-weight: 600; letter-spacing: -0.2px; color: var(--ink-soft); box-shadow: none; }
#dressTabs button[aria-selected="true"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--ink); }
#dressGrid { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px 4px; padding: 10px 14px 12px; align-content: start; }
.tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; border: 0; border-radius: 16px; background: none; padding: 6px 2px 7px; }
.tile img { display: block; width: 58px; height: 58px; object-fit: contain; padding: 5px; }
.tile img.look { padding: 0; transform: scale(1.5); transform-origin: 50% 62%; }
.tile .tn { font-size: 11.5px; font-weight: 500; letter-spacing: -0.1px; line-height: 1.15; text-align: center; color: var(--ink); }
.tile .tp { display: flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 600; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.tile .tp svg { width: 11px; height: 11px; fill: var(--mochi); }
.tile[aria-pressed="true"] { background: var(--fill); }
.tile.locked img { opacity: 0.38; filter: saturate(0.5); }
.tile.none img { opacity: 0; }
.tile .no { position: absolute; top: 16px; width: 38px; height: 38px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--track); }
.tile .no::after { content: ""; position: absolute; left: 18px; top: 3px; width: 2px; height: 32px; background: var(--track); transform: rotate(45deg); }
#dressFoot { flex: 0 0 auto; padding: 8px 22px calc(18px + var(--safe-b)); display: flex; align-items: center; gap: 10px; }
#dressFoot .done { flex: 1; height: 52px; border: 0; border-radius: 26px; font-size: 16px; font-weight: 600; letter-spacing: -0.2px; background: var(--cta); color: var(--cta-ink); }
#dressFoot .done:disabled { background: var(--fill-soft); color: var(--ink-soft); }
.swatch-tile { width: 54px; height: 54px; margin: 2px; border-radius: 50%; background: var(--c); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.08); }

/* The album uses the same paper mount and square crop as its native sheet. */
#portraitAlbum { width: min(440px, calc(100% - 24px)); max-height: 90dvh; margin: auto; padding: 0; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 24px; color: var(--ink); background: var(--bg); }
#portraitAlbum::backdrop { background: rgb(25 23 20 / 32%); }
.album-content { padding: 24px; }
.album-content header, .album-byline, #portraitPages, .album-target { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.album-content header { margin-bottom: 28px; }
.album-content h2 { margin: 0; font-size: 34px; font-weight: 720; letter-spacing: -1.25px; }
#closePortraits { width: 44px; height: 44px; border-radius: 50%; background: var(--fill-soft); }
.album-print { margin: 0; padding: 12px; border: 1px solid rgb(0 0 0 / 8%); border-radius: 5px; box-shadow: 0 5px 12px rgb(0 0 0 / 9%); background: white; color: #1d1c1a; }
.album-print canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; background: linear-gradient(135deg, white, color-mix(in srgb, var(--mochi) 16%, white), color-mix(in srgb, var(--mochi) 46%, white)); }
.album-generic { display: block; margin: 8px auto 0; min-height: 44px; padding: 0 12px; color: var(--ink-soft); font: inherit; font-size: 14px; text-decoration: underline; background: transparent; border: 0; cursor: pointer; }
.album-print figcaption { padding: 16px 6px 10px; }
.album-byline { align-items: baseline; }
.album-caption { margin: 4px 0 0; font-size: 16px; font-weight: 470; line-height: 1.35; overflow-wrap: anywhere; }
.album-print figcaption strong { font-size: 25px; font-weight: 720; letter-spacing: -0.95px; }
.album-print time, .album-print small, #portraitProgress small, #portraitPages span { font-size: 14px; }
.album-print small { display: block; padding: 0 6px 6px; }
.album-empty, .album-loading { display: grid; align-content: center; justify-items: center; min-height: 230px; padding: 24px; text-align: center; border-radius: 12px; background: var(--raised); }
.album-empty strong { font-size: 22px; }
.album-empty p { margin: 8px 0; line-height: 1.4; color: var(--ink-soft); }
#portraitPages button, .album-empty button { min-width: 44px; min-height: 44px; border: 0; background: transparent; color: var(--ink); }
#portraitPages button { font-size: 26px; }
#portraitPages button:disabled { opacity: 0.3; }
#portraitProgress { margin-top: 28px; }
#portraitPages span, #portraitProgress small { color: var(--ink-soft); }
.album-target { font-weight: 600; }
.album-track { height: 5px; overflow: hidden; margin: 10px 0; background: var(--track); border-radius: 9px; }
.album-track i { display: block; height: 100%; background: var(--ink); border-radius: inherit; }

/* ---- pages ---- */
#page {
  position: absolute;
  inset: 0;
  z-index: 25;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
}
#page.open { transform: none; }
#page.instant { transition: none; }
.page-head { display: flex; align-items: center; gap: 4px; width: 100%; height: 56px; padding: 6px 16px 0 8px; flex: 0 0 auto; }
.page-head h1 { flex: 1; min-width: 0; margin: 0; font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#pageBody { flex: 1; width: 100%; overflow-y: auto; padding: 8px 16px calc(96px + var(--safe-b)); }

.list-row {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}
.row-sentence, .row-due { display: block; }
.med-list-row { display: flex; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.med-list-row .list-row { flex: 1; min-width: 0; border-bottom: 0; }
.med-star { flex: none; width: 44px; height: 44px; display: grid; place-items: center; border: 0; background: none; color: var(--faint); }
.med-star svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.med-star[aria-pressed="true"] { color: #e6a94e; }
.med-star[aria-pressed="true"] svg { fill: currentColor; }
.row-sentence { font-size: 16px; line-height: 1.35; }
.row-due { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }
.talk-you { background: var(--line); border-radius: 12px; padding: 8px 12px; margin: 10px 0 10px auto; max-width: 85%; width: fit-content; font-size: 15px; }
#transcript .companion-notice { display: block; color: var(--ink-soft); font-size: 14px; line-height: 1.4; font-weight: 400; letter-spacing: normal; }
#transcript .guide > .companion-notice { margin-top: 5px; }
.speaker-label { display: block; margin-bottom: 3px; color: var(--ink-soft); font-size: 13px; line-height: 1.2; font-weight: 600; letter-spacing: normal; overflow-wrap: anywhere; }
#transcript .speaker-label:has(+ .utterance:empty) { display: none; }
.talk-guide { font-size: 17px; line-height: 1.45; margin: 10px 0; }

#searchInput, #becomingText, .field select, .field input[type="text"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--raised);
  padding: 10px 12px;
}
#searchResults { margin-top: 8px; }
#becomingText { height: 48dvh; resize: vertical; font-size: 16px; line-height: 1.55; }
.continue-talk { min-height: 44px; background: var(--cta); color: var(--cta-ink); box-shadow: none; }
.doc-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 10px; }
.doc-actions button { border: 1px solid var(--line); background: var(--line); border-radius: 10px; padding: 8px 16px; }
.doc-status { margin-right: auto; color: var(--ink-soft); font-size: 14px; }
.proposal-note { border-left: 3px solid var(--accent); padding: 6px 10px; margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); }
.memory-box { margin-top: 16px; font-size: 14px; color: var(--ink-soft); }
.memory { white-space: pre-wrap; overflow-wrap: anywhere; font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; }

.field { display: block; border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.field > span, .field legend { display: block; font-size: 14px; color: var(--ink-soft); margin-bottom: 6px; padding: 0; }
.field-row { display: flex; gap: 8px; }
.field-row select { flex: 1; min-width: 0; }
.field-row button { border: 1px solid var(--line); background: var(--line); border-radius: 10px; padding: 8px 14px; }
.field label { display: block; margin: 6px 0; }
.field small { color: var(--ink-soft); }
.field input[type="text"] { font-size: 16px; }
.field-note { font-size: 13px; color: var(--ink-soft); margin: 0; }
.settings-legal { margin-top: 18px; }
.settings-legal h2 { margin: 0; font-size: 14px; font-weight: 500; color: var(--ink-soft); }
.settings-legal a { color: inherit; text-underline-offset: 0.16em; }
.settings-legal-links { display: flex; flex-wrap: wrap; column-gap: 18px; }
.settings-legal-links a { display: inline-flex; align-items: center; min-height: 44px; }
.settings-legal .field-note { line-height: 1.45; }
.names-note { margin: -10px 0 18px; }

.swatches { display: flex; gap: 12px; }
.swatch { position: relative; width: 48px; height: 48px; border: 0; border-radius: 50%; padding: 0; background: var(--c); box-shadow: inset 0 -6px 10px rgba(0, 0, 0, 0.08); }
.swatch[aria-pressed="true"]::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink); }

/* ---- take reading sheet ---- */
#takeSheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  top: 44px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
}
#takeSheet.open { transform: none; }
#takeSheet.dragging { transition: none; }
.take-head { padding: 10px 22px 4px; touch-action: none; flex: 0 0 auto; user-select: none; }
.take-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 14px; color: var(--ink-soft); }
#takeBody {
  flex: 1;
  width: 100%;
  overflow-y: auto;
  padding: 6px 22px calc(96px + var(--safe-b));
  font-size: 17px;
  line-height: 1.55;
  letter-spacing: -0.15px;
}
#takeText p { margin: 0 0 0.85em; }
#takeText ul, #takeText ol { margin: 0 0 0.85em; padding-left: 1.2em; }
#takeText strong { font-weight: 600; }
.take-action { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border: 0; border-radius: 999px; background: var(--fill); color: var(--accent-ink); font-size: 15px; font-weight: 600; }
.take-action .ic { width: 18px; height: 18px; flex-basis: 18px; }

@media (prefers-reduced-motion: reduce) {
  .presence-body { animation: none !important; }
  #scroll { scroll-behavior: auto; }
  #transcript .w { animation: none; }
}

/* ---- threads ---- */
.thread-title { width: 100%; border: 0; background: none; padding: 0 0 10px; font: inherit; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.4px; color: var(--ink); outline: none; }
.thread-label { display: block; padding: 10px 0; border-top: 1px solid var(--line); }
.thread-label span { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 3px; }
.thread-field { width: 100%; border: 0; background: none; padding: 0; font: inherit; font-size: 16px; line-height: 1.4; color: var(--ink); outline: none; resize: none; field-sizing: content; }
.thread-new { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.thread-new input { flex: 1; min-width: 0; border: 0; background: none; padding: 0; font: inherit; font-size: 16px; color: var(--ink); outline: none; }
.thread-new input::placeholder { color: var(--ink-soft); }
.thread-actions { display: flex; gap: 20px; padding: 22px 0 8px; }
#pageBody .today-row { align-items: center; padding: 0; margin-left: -8px; background: none; }
#pageBody .today-text { display: block; padding: 12px 0; }

/* ---- on my mind ---- */
.mind-note { font-size: 14px; line-height: 1.4; color: var(--ink-soft); margin: 2px 0 10px; }
.mind-root { display: block; width: 100%; text-align: left; border: 0; background: var(--fill); border-radius: 16px; padding: 16px; margin: 6px 0 4px; font: inherit; color: var(--ink); cursor: pointer; }
.mind-kicker, .mind-by { display: block; font-size: 13px; color: var(--ink-soft); }
.mind-root-text { display: block; font-size: 20px; line-height: 1.3; font-weight: 600; letter-spacing: -0.2px; margin: 6px 0 8px; }
.mind-by { font-weight: 400; }
.thread-label span .mind-by { display: inline; margin: 0 0 0 6px; opacity: 0.8; }
.thread-label span .mind-by::before { content: "· "; }
.mind-big { font-size: 18px; line-height: 1.35; font-weight: 500; }
.mind-move { display: flex; gap: 10px; width: 100%; margin: 0; padding: 8px 0; border: 0; background: none; text-align: left; font: inherit; font-size: 15px; line-height: 1.35; color: var(--ink); cursor: pointer; }
.mind-when { flex: 0 0 auto; min-width: 46px; font-size: 13px; line-height: 20px; color: var(--ink-soft); }
.mind-row .row-sentence { font-size: 16px; }
.mind-theme { font-weight: 600; }
.mind-moved { color: var(--accent-ink); }
.mind-draft { font-size: 13px; }
.mind-back { display: block; margin: 0 0 10px; padding: 0; color: var(--ink-soft); }
.mind-action { display: inline-block; padding: 8px 0; color: var(--accent-ink); }
.mind-words { margin: 8px 0 6px; padding: 0; font-size: 17px; line-height: 1.45; }
.mind-quote[hidden], .mind-action[hidden] { display: none; }
.mind-foot { font-size: 13px; line-height: 1.4; color: var(--ink-soft); margin: 14px 0 0; }
.mind-center { justify-content: center; }
.mind-select { width: 100%; border: 0; background: none; padding: 0; font: inherit; font-size: 16px; color: var(--ink); outline: none; }

/* ---- Life map: takes the sheet's place while it's open, three deep (lifemap.js) ---- */
body:not([data-map="off"]) #menuBtn, body:not([data-map="off"]) #dressBtn { display: none; }
body:not([data-map="off"]) .top { justify-content: flex-start; }
body:not([data-map="off"]) .kept { margin-left: auto; }
body[data-map="full"] #presence { --py: -38px; --ps: 0.42; }

/* Another screen is up (a page or a note): Mochi waits at the bottom, over anything that
   would put it at the top: the open sheet, the Life map, tall ears or a hat. */
body[data-over="on"] #presence,
body[data-over="on"][data-tall="on"]:not([data-stage="play"]):not([data-stage="dress"]) #presence { --py: calc(100dvh - var(--safe-b) - 144px); --ps: 0.36; }
body[data-map="full"] #bubble { opacity: 0; pointer-events: none; transform: translate(-50%, 10px); }

#mapSheet {
  position: absolute;
  left: 0;
  right: 0;
  top: var(--top-h);
  height: calc(100% - var(--top-h));
  z-index: 20;
  display: flex;
  flex-direction: column;
  background: var(--raised);
  border-radius: 30px 30px 0 0;
  box-shadow: var(--shadow);
  overflow: hidden;
  transform: translateY(102%);
  transition: transform var(--dur) var(--ease);
}
#mapSheet.on { transform: translateY(calc(var(--map-top) - var(--top-h))); }
#mapSheet.on.full { transform: none; }
#mapSheet.dragging { transition: none; }
body:not([data-stage="home"]) #mapSheet { transform: translateY(102%); }
.lm-peek { flex: 0 0 auto; padding: 10px 22px 8px; touch-action: none; user-select: none; -webkit-user-select: none; cursor: grab; }
.lm-peek .grabber { margin-bottom: 16px; }
.lm-peek > :not(.grabber), .lm-pane > * { max-width: 520px; margin-inline: auto; width: 100%; }
.lm-head { display: flex; align-items: center; gap: 6px; min-height: 32px; }
.lm-head h1 { flex: 1; margin: 0; font-size: 27px; font-weight: 700; letter-spacing: -0.9px; }
.lm-crumb { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.25px; }
.lm-n { font-size: 15px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lm-backbtn { width: 32px; height: 32px; margin-left: -8px; border: 0; background: none; padding: 0; display: grid; place-items: center; border-radius: 16px; color: var(--ink); }
.lm-back svg { width: 22px; height: 22px; stroke-width: 2.2; }
.lm-bar { height: 6px; border-radius: 3px; background: var(--track); margin-top: 12px; overflow: hidden; }
.lm-bar i { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 3px; transition: width 0.5s var(--ease); }
#mapSheet[data-level="2"] .lm-bar { display: none; }
#mapSheet svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.lm-body { flex: 1; position: relative; overflow: hidden; }
.lm-pane { position: absolute; inset: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 22px calc(var(--map-top) + 60px + var(--safe-b)); scrollbar-width: none; transition: transform var(--dur) var(--ease), opacity 0.3s; }
.lm-pane::-webkit-scrollbar { display: none; }
#mapSheet.full .lm-pane { padding-bottom: calc(120px + var(--safe-b)); }
.lm-pane[data-pane="1"], .lm-pane[data-pane="2"] { transform: translateX(100%); }
#mapSheet[data-level="1"] .lm-pane[data-pane="0"],
#mapSheet[data-level="2"] .lm-pane[data-pane="0"],
#mapSheet[data-level="2"] .lm-pane[data-pane="1"] { transform: translateX(-30%); opacity: 0; pointer-events: none; }
#mapSheet[data-level="1"] .lm-pane[data-pane="1"], #mapSheet[data-level="2"] .lm-pane[data-pane="2"] { transform: none; }

/* the seven areas */
.lm-row { display: flex; align-items: center; gap: 14px; height: 62px; border: 0; border-bottom: 0.5px solid var(--line); background: none; padding: 0; text-align: left; color: var(--ink); }
.lm-row:last-child { border-bottom: 0; }
.lm-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; background: var(--fill-soft); color: var(--ink); display: grid; place-items: center; }
.lm-ico svg { width: 21px; height: 21px; }
.lm-t { flex: 1; font-size: 17px; font-weight: 600; letter-spacing: -0.3px; }
.lm-ct { font-size: 14px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.lm-chev { flex: none; color: var(--faint); display: grid; place-items: center; }
.lm-chev svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* one area: questions to talk about, then her answers */
.lm-blurb { margin: 0 auto; padding: 6px 0 14px; font-size: 15px; line-height: 1.35; color: var(--ink-soft); }
.lm-card { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; padding: 15px 14px 15px 16px; border: 0; border-radius: 16px; background: var(--fill-soft); text-align: left; color: var(--ink); font-size: 16.5px; line-height: 1.32; font-weight: 500; letter-spacing: -0.2px; transition: transform 0.15s; }
.lm-card span:first-child { flex: 1; }
.lm-card:active { transform: scale(0.985); }
.lm-note { margin: 0 auto; padding: 4px 0 6px; font-size: 15px; color: var(--ink-soft); }
.lm-sec { margin: 22px auto 2px; font-size: 13px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.05px; }
.lm-arow { display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 14px 0; border: 0; border-bottom: 0.5px solid var(--line); background: none; text-align: left; color: var(--ink); }
.lm-arow:last-child { border-bottom: 0; }
.lm-aq { font-size: 14px; line-height: 1.3; color: var(--ink-soft); }
.lm-al { margin-top: 4px; font-size: 17px; line-height: 1.3; font-weight: 600; letter-spacing: -0.3px; }
.lm-ad { margin-top: 5px; font-size: 12.5px; color: var(--faint); }
.lm-arow .lm-chev { grid-column: 2; grid-row: 1 / span 3; }

/* one answer, written up as a short letter in her words */
.lm-meta { display: flex; align-items: center; gap: 6px; margin: 0 auto; padding-top: 4px; font-size: 13.5px; color: var(--ink-soft); }
.lm-metaic svg { width: 16px; height: 16px; color: var(--ink-soft); }
.lm-q { margin: 10px auto 0; font-size: 23px; line-height: 1.18; font-weight: 700; letter-spacing: -0.9px; }
.lm-letter { margin: 16px auto 0; font-size: 19px; line-height: 1.5; letter-spacing: -0.3px; white-space: pre-wrap; }
.lm-wait { margin: 18px auto 0; font-size: 16px; color: var(--ink-soft); }
.lm-noticed { margin-top: 8px; }
.lm-guess { margin: 0; font-size: 17.5px; line-height: 1.38; font-weight: 500; letter-spacing: -0.2px; color: var(--mochi-ink); }
.lm-st { display: flex; align-items: center; gap: 5px; margin: 8px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.lm-stic svg { width: 15px; height: 15px; stroke-width: 2.4; color: var(--accent); }
.lm-fix { margin: 4px 0 0; font-size: 16.5px; line-height: 1.4; font-weight: 500; }
.lm-chips { display: flex; gap: 8px; margin-top: 12px; }
.lm-chip { border: 0; border-radius: 999px; padding: 10px 16px; font-size: 15px; font-weight: 600; background: var(--cta); color: var(--cta-ink); }
.lm-chip.plain { background: var(--fill-soft); color: var(--ink); }
.lm-fixform { display: flex; gap: 8px; margin-top: 12px; }
.lm-input { flex: 1; min-width: 0; border: 0; border-radius: 14px; padding: 10px 14px; background: var(--fill-soft); color: var(--ink); font: inherit; font-size: 16px; outline: none; }
.lm-input:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.lm-try { display: flex; gap: 12px; align-items: flex-start; margin-top: 8px; padding: 14px 16px; border-radius: 16px; background: var(--fill-soft); font-size: 16px; line-height: 1.38; font-weight: 500; }
.lm-tryic svg { width: 20px; height: 20px; margin-top: 1px; color: var(--accent-ink); }
.lm-txbtn { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding: 15px 0; border: 0; border-top: 0.5px solid var(--line); border-bottom: 0.5px solid var(--line); background: none; color: var(--ink); font-size: 16px; font-weight: 600; letter-spacing: -0.2px; }
.lm-txbtn small { margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--ink-soft); }
.lm-txbtn .lm-chev { transition: transform 0.3s var(--ease); }
.lm-txbtn.on .lm-chev { transform: rotate(90deg); }
.lm-tx { list-style: none; margin: 0 auto; padding: 14px 0 0; display: flex; flex-direction: column; gap: 12px; }
.lm-tx[hidden] { display: none; }
.lm-tx .g { font-size: 16px; line-height: 1.42; color: var(--ink-soft); }
.lm-tx .y { padding-left: 14px; font-size: 16px; line-height: 1.42; font-weight: 500; }

/* the topic stays in view during the talk */
.lm-topic { position: absolute; top: 216px; left: 50%; transform: translateX(-50%); z-index: 15; height: 34px; padding: 0 14px 0 11px; border-radius: 17px; display: flex; align-items: center; gap: 7px; background: var(--glass); box-shadow: inset 0 0 0 0.5px var(--glass-edge), 0 1px 2px rgba(29, 28, 26, 0.06); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); font-size: 14px; font-weight: 600; color: var(--ink); white-space: nowrap; pointer-events: none; }
.lm-topic[hidden], body:not([data-stage="talk"]) .lm-topic { display: none; }
.lm-topicic svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* In a talk the chip takes the middle of the top bar; the bean count waits for Home. */
body[data-stage="talk"]:not([data-map="on"]):not([data-map="full"]) .kept { visibility: hidden; }

/* ---- the day page: Journal and From your talks above the list ---- */
.day-lab { margin: 18px 0 2px; font-size: 14px; font-weight: 600; color: var(--ink-soft); letter-spacing: -0.1px; }
.day-list > .day-lab:first-child, .day-list > .day-sec:first-child > .day-lab:first-child { margin-top: 6px; }
.day-sec .day-sec .day-lab { margin-top: 16px; }
.jnote { margin: 8px 0 4px; padding: 16px 18px 17px; border-radius: 20px; background: var(--bg); }
.jtop { display: flex; align-items: center; gap: 12px; }
.jtop b { display: block; font-size: 17px; font-weight: 650; letter-spacing: -0.3px; }
.jtop small { display: block; margin-top: 1px; font-size: 13.5px; color: var(--ink-soft); }
.jnote-text { display: block; width: 100%; margin-top: 10px; padding: 0; border: 0; background: none; text-align: left; font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); letter-spacing: -0.15px; cursor: text; }
.jedit textarea { width: 100%; margin-top: 10px; padding: 10px 12px; border: 0; border-radius: 12px; background: var(--raised); font: inherit; font-size: 16px; line-height: 1.45; color: var(--ink); resize: vertical; box-shadow: inset 0 0 0 1px var(--line); }
.jedit-acts { display: flex; justify-content: flex-end; gap: 18px; margin-top: 6px; }
.jedit-acts .strong { color: var(--ink); font-weight: 650; }
/* How the day felt, as its weather. Filled, in the weather's own colour. */
.wx { flex: none; width: 28px; height: 28px; fill: currentColor; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.wx .cut { stroke: var(--bg); stroke-width: 1.6; }
.wx-great { color: #d06a26; } .wx-good { color: #c98a12; } .wx-okay { color: #7b8794; } .wx-low { color: #3d6fc4; } .wx-rough { color: #5b5f8a; }
.wx.cal { width: 13px; height: 13px; stroke-width: 2; }
.wx.cal .cut, .pop-grid button.sel .wx.cal { color: currentColor; }
.pop-grid button.sel .wx.cal .cut { stroke: var(--cta); }
/* Rows that aren't to-dos: the same slot and size as the list's circle, filled. */
.mark-row { align-items: center; }
.mark-slot { flex: none; width: 44px; height: 44px; display: grid; place-items: center; }
.mark { width: 27px; height: 27px; border-radius: 50%; display: grid; place-items: center; }
.mark.heart { background: #e0688a; }
.mark.heart svg { width: 15px; height: 15px; margin-top: 1px; fill: #fff; stroke: none; }
.mark.hard { background: none; }
.mark.hard .wx { width: 27px; height: 27px; }
.talk-ic { width: 25px; height: 25px; fill: currentColor; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.talk-ic.reframe { color: var(--a-body); } .talk-ic.thought { color: var(--a-mind); } .talk-ic.talk { color: var(--a-work); }
.act-card .jmark { flex: none; width: 27px; display: grid; place-items: center; }
.act-card .jmark .wx { width: 26px; height: 26px; }
.act-card .jmark .wx .cut { stroke: var(--raised); }

/* ---- a take in the talk: a card that shows its opening and opens on a tap ---- */
.take-item { list-style: none; }
.take-thinking { display: flex; align-items: center; gap: 10px; margin: 0; padding: 6px 2px; font-size: 15px; font-weight: 500; color: var(--ink-soft); }
#transcript .take-item, .page .take-card { margin-block: 4px; }
.take-card { display: block; width: 100%; padding: 18px 20px 0; border-radius: 22px; background: var(--raised); box-shadow: var(--lift); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform 0.14s var(--ease); }
.take-card:active { transform: scale(0.985); }
.take-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.tk-top { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--faint); }
.tk-dots { display: inline-flex; gap: 3px; } .tk-dots i { width: 4px; height: 4px; border-radius: 50%; background: var(--faint); animation: tk-dot 1.2s infinite both; }
.tk-dots i:nth-child(2) { animation-delay: 0.2s; } .tk-dots i:nth-child(3) { animation-delay: 0.4s; }
@keyframes tk-dot { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
.tk-title { margin: 6px 0 0; font-size: 20px; font-weight: 650; line-height: 1.24; letter-spacing: -0.4px; text-wrap: balance; }
.tk-body { position: relative; max-height: 150px; overflow: hidden; margin-top: 10px; font-size: 15.5px; line-height: 1.45; letter-spacing: -0.15px; color: var(--ink); }
.tk-body p { margin: 0 0 0.7em; }
.tk-body ul, .tk-body ol { margin: 0 0 0.7em; padding-left: 1.2em; }
.tk-body::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 72px; background: linear-gradient(to bottom, color-mix(in srgb, var(--raised) 0%, transparent), var(--raised) 92%); pointer-events: none; }
.take-card.writing .tk-body { max-height: 128px; }
.tk-caret { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--ink); animation: tk-blink 1s steps(1) infinite; }
@keyframes tk-blink { 50% { opacity: 0; } }
.tk-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; padding: 13px 0 15px; border-top: 1px solid var(--line); font-size: 16px; }
.tk-foot b { font-weight: 600; } .tk-foot small { margin-left: 8px; font-size: 14px; color: var(--ink-soft); }
.tk-go { width: 32px; height: 32px; border-radius: 50%; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; flex: none; }
.tk-go svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* A take that fits shows whole: no fade, no row, nothing to open. */
.take-card.short { cursor: default; padding-bottom: 8px; }
.take-card.short:active { transform: none; }
.take-card.short .tk-body { max-height: none; }
.take-card.short .tk-body::after, .take-card.short .tk-foot { display: none; }
.take-title { margin: 4px 0 14px; font-size: 25px; font-weight: 650; line-height: 1.2; letter-spacing: -0.5px; text-wrap: balance; }
@media (prefers-reduced-motion: reduce) { .tk-dots i, .tk-caret { animation: none; } }

/* ---- meditation: the hand-off in the talk, and the player ---- */
[data-p="meditation"] { --pc: var(--a-learning); }
.talk-ic.meditation { color: var(--a-learning); }
.med-item { list-style: none; }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--fill); border-top-color: var(--a-learning); flex: none; animation: med-spin 0.9s linear infinite; }
@keyframes med-spin { to { transform: rotate(360deg); } }
/* While a meditation is being made or ready, nothing listens: Start takes the mic's place. */
body[data-handoff="making"] #talkBar, body[data-handoff="ready"] #talkBar, body[data-handoff="failed"] #talkBar, body[data-handoff="making"] #textForm, body[data-handoff="ready"] #textForm, body[data-handoff="failed"] #textForm { display: none !important; }
#medStart { display: none; align-items: center; justify-content: center; gap: 10px; width: 100%; max-width: 420px; height: 62px; border: 0; border-radius: 31px; background: var(--cta); color: var(--cta-ink); font: inherit; font-size: 19px; font-weight: 600; letter-spacing: -0.3px; box-shadow: 0 10px 26px var(--cta-glow); transition: transform 0.18s var(--ease); }
#medStart svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
#medStart:active { transform: scale(0.97); }
body[data-stage="talk"][data-handoff="ready"] #medStart { display: flex; }
/* The first talk's end: one big Continue in place of the mic and the text form. */
#firstContinue { display: none; align-items: center; justify-content: center; width: 100%; max-width: 420px; height: 62px; border: 0; border-radius: 31px; background: var(--cta); color: var(--cta-ink); font: inherit; font-size: 19px; font-weight: 600; letter-spacing: -0.3px; box-shadow: 0 10px 26px var(--cta-glow); transition: transform 0.18s var(--ease); }
#firstContinue:active { transform: scale(0.97); }
body[data-stage="talk"][data-continue="on"] #firstContinue { display: flex; }
body[data-continue="on"] #talkBar, body[data-continue="on"] #textForm { display: none !important; }
/* The day page's row plays it again. */
.today-row.med-row { width: 100%; border: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.med-row .play { flex: none; width: 34px; height: 34px; margin-left: auto; border-radius: 50%; background: color-mix(in srgb, var(--a-learning) 13%, transparent); color: var(--a-learning); display: grid; place-items: center; }
.med-row .play svg { width: 15px; height: 15px; }
.med-row.making { cursor: default; }
.med-row.making .spin { margin-left: auto; border-top-color: var(--med); }
/* A meditation's card in the talk and on Home: a small window onto its player. The
   practice's name, the title, and the player's tide (drawn in app.js). Making: the tide rolls
   in and it can't be opened. Ready: the round play button grows in and a tap anywhere starts
   it. The caption over it shows until it's all made. */
:root { --med: #1e9be0; --med-soft: #d6ecfa; }
.mc-wrap { display: flex; flex-direction: column; align-items: stretch; gap: 8px; width: min(346px, 100%); }
.med-item .mc-wrap { width: 100%; }
.mc-cap { margin: 0 0 0 4px; font-size: 13.5px; line-height: 1.35; color: var(--ink-soft); }
.mc { position: relative; display: block; width: 100%; height: 172px; padding: 0; border: 0; border-radius: 22px; overflow: hidden; background: var(--raised, #fff); box-shadow: var(--lift); text-align: left; font: inherit; color: var(--ink); -webkit-tap-highlight-color: transparent; }
.mc.ready { cursor: pointer; transition: transform 0.14s var(--ease); }
.mc.ready:active { transform: scale(0.98); }
.mc-tide { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; }
.mc-k { position: absolute; left: 20px; top: 18px; font-size: 13px; font-weight: 600; color: var(--faint); }
.mc-n { position: absolute; left: 20px; right: 20px; top: 40px; font-size: 21px; font-weight: 650; letter-spacing: -0.4px; line-height: 1.22; text-wrap: balance; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mc.making .mc-n { color: color-mix(in srgb, var(--ink) 72%, transparent); }
.mc-m { position: absolute; left: 20px; right: 66px; bottom: 22px; font-size: 14.5px; font-weight: 600; letter-spacing: -0.1px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mc-m i { font-style: normal; color: color-mix(in srgb, var(--ink) 66%, transparent); }
.mc.failed .mc-m { right: 20px; font-size: 14px; font-weight: 500; color: var(--ink-soft); white-space: normal; }
.mc-go { position: absolute; right: 14px; bottom: 12px; width: 40px; height: 40px; border-radius: 50%; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; }
.mc-go.fresh { animation: mc-go 0.55s var(--ease) both; }
.mc-pl { width: 17px; height: 17px; fill: currentColor; stroke: currentColor; }
@keyframes mc-go { from { transform: scale(0.6); opacity: 0; } }
/* A suggestion that makes something says so. */
.now-go { flex: none; height: 34px; padding: 0 12px; border-radius: 17px; background: var(--cta); color: var(--cta-ink); display: grid; place-items: center; font-size: 14px; font-weight: 650; letter-spacing: -0.1px; white-space: nowrap; }
.now-card:has(.now-go) { gap: 12px; }
.now-card:has(.now-go) .now-t b { font-size: 17px; }
.now-card.can-dismiss:has(.now-go) { padding-right: 46px; }
.now-wrap:has(.now-go) .now-x { right: 10px; width: 28px; height: 28px; margin-top: -18px; }
/* The player's bar: how far it's loaded, under what's played. */
.med-track .buf { position: absolute; left: 0; top: 12px; height: 4px; width: 0; border-radius: 2px; background: rgba(241, 238, 232, 0.24); }
@media (prefers-reduced-motion: reduce) { .mc-go.fresh { animation: none; } }

/* The meditation player: its own screen, from the modes board (states 4 and 5). Night,
   the name in a chip, Mochi asleep and breathing, the line lit sentence by sentence, a bar
   with times she can drag, End. */
.med {
  --m-bg: #141311; --m-ink: #f1eee8; --m-soft: rgba(241, 238, 232, 0.42); --m-faint: rgba(241, 238, 232, 0.14); --m-fill: rgba(241, 238, 232, 0.09); --m-accent: #b7a6ff;
  position: fixed; inset: 0; z-index: 90; display: flex; flex-direction: column; align-items: center;
  padding: calc(16px + env(safe-area-inset-top, 0px)) 22px calc(26px + var(--safe-b));
  background: var(--m-bg); color: var(--m-ink); opacity: 0; transition: opacity 0.4s ease;
  overflow: hidden; -webkit-user-select: none; user-select: none;
}
.med.open { opacity: 1; }
.med[hidden] { display: none; }
.med-top { position: relative; z-index: 2; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: center; gap: 4px; width: 100%; max-width: 520px; }
.med-x { width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 22px; background: var(--m-fill); color: var(--m-ink); }
.med-x svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.med-chip { justify-self: center; display: flex; align-items: center; gap: 7px; max-width: 100%; height: 44px; padding: 0 14px 0 12px; border-radius: 22px; background: var(--m-fill); font-size: 15px; font-weight: 600; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; }
.med-chip span { overflow: hidden; text-overflow: ellipsis; }
.med-chip-ic { width: 19px; height: 19px; flex: none; }
/* The glow: one soft lilac light breathing with the script. The player sets its size, brightness
   and the circling tints each frame. It's screen-blended, so it only ever adds light to the night. */
.med-orb { position: relative; z-index: 1; width: min(62vw, 250px); aspect-ratio: 1; margin-top: max(24px, 6vh); flex: none; pointer-events: none; mix-blend-mode: screen; }
.med-orb i { position: absolute; left: 50%; top: 50%; translate: -50% -50%; border-radius: 50%; }
.med-orb .ground { width: 170%; aspect-ratio: 1; background: radial-gradient(closest-side, #000 95%, rgba(0, 0, 0, 0)); } /* black adds nothing under screen; it gives the grain something dark to sit on */
.med-orb .body { width: 130%; aspect-ratio: 1; opacity: 0.62; will-change: transform, opacity; background: radial-gradient(closest-side, rgba(219, 211, 255, 0.62) 0%, rgba(183, 166, 255, 0.56) 22%, rgba(145, 127, 235, 0.44) 46%, rgba(106, 88, 214, 0.22) 70%, rgba(106, 88, 214, 0.06) 88%, rgba(106, 88, 214, 0) 100%); }
.med-orb .tint { aspect-ratio: 1; will-change: transform, opacity; }
.med-orb .rose { width: 83%; background: radial-gradient(closest-side, rgba(255, 179, 209, 0.42), rgba(255, 179, 209, 0.15) 55%, rgba(255, 179, 209, 0)); }
.med-orb .cool { width: 76%; background: radial-gradient(closest-side, rgba(126, 123, 220, 0.3), rgba(126, 123, 220, 0)); }
.med-orb .grain { width: 170%; aspect-ratio: 1; mix-blend-mode: overlay; opacity: 0.55; -webkit-mask-image: radial-gradient(closest-side, #000 65%, transparent 92%); mask-image: radial-gradient(closest-side, #000 65%, transparent 92%);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.med-line { position: relative; z-index: 1; flex: 1; display: grid; place-items: center; max-width: 360px; margin: 0; padding: 16px 0 24px; text-align: center; text-wrap: balance; font-size: 25px; line-height: 1.32; font-weight: 500; letter-spacing: -0.37px; }
.med-line .dim { color: var(--m-soft); }
.med[data-state="making"] .med-line .lit::after { content: ""; display: inline-block; width: 1.1em; text-align: left; animation: med-dots 1.4s steps(4) infinite; }
@keyframes med-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.med-prog { position: relative; z-index: 1; width: 100%; max-width: 420px; margin-bottom: 22px; padding: 0 18px; visibility: hidden; }
.med[data-state="playing"] .med-prog, .med[data-state="paused"] .med-prog, .med[data-state="done"] .med-prog { visibility: visible; }
.med-track { position: relative; height: 28px; cursor: pointer; touch-action: none; }
.med-track .rail, .med-track .fill { position: absolute; left: 0; top: 12px; height: 4px; border-radius: 2px; }
.med-track .rail { right: 0; background: var(--m-faint); }
.med-track .fill { width: 0; background: var(--m-accent); }
.med-track .knob { position: absolute; top: 7px; left: 0; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--m-ink); opacity: 0; transition: opacity 0.2s, transform 0.15s; }
.med-track:hover .knob, .med-track:focus-visible .knob, .med[data-drag="on"] .med-track .knob { opacity: 1; }
.med[data-drag="on"] .med-track .knob { transform: scale(1.3); }
.med-times { display: flex; justify-content: space-between; margin-top: 2px; font-size: 14px; font-variant-numeric: tabular-nums; color: rgba(241, 238, 232, 0.5); }
.med-foot { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; max-width: 420px; }
.med-row { display: flex; align-items: center; gap: 12px; }
.med-say { margin: 0; }
/* Playing: one big pause button (close is the × at the top). */
.med-round { display: none; place-items: center; width: 72px; height: 72px; border: 0; border-radius: 50%; background: rgba(241, 238, 232, 0.12); color: var(--m-ink); }
.med-round svg { width: 26px; height: 26px; fill: currentColor; }
.med[data-state="playing"] .med-pill, .med[data-state="paused"] .med-pill { display: none; }
.med[data-state="playing"] .med-round, .med[data-state="paused"] .med-round { display: grid; }
.med-pill { height: 48px; padding: 0 26px; border: 0; border-radius: 24px; background: rgba(241, 238, 232, 0.1); color: var(--m-ink); font: inherit; font-size: 17px; font-weight: 600; }
.med[data-state="making"] .med-pill { display: none; }
.med[data-state="ready"] .med-pill { min-width: 200px; height: 56px; border-radius: 28px; background: var(--m-ink); color: var(--m-bg); font-size: 18px; }
.med-alt { display: none; height: 40px; padding: 0 16px; border: 0; background: none; color: rgba(241, 238, 232, 0.78); font: inherit; font-size: 16px; font-weight: 600; }
.med[data-state="done"] .med-alt { display: block; }
.med-note { min-height: 1.3em; max-width: 320px; text-align: center; font-size: 14px; line-height: 1.4; color: rgba(241, 238, 232, 0.45); }
.med-pill:active, .med-round:active, .med-x:active { transform: scale(0.97); }
.med button:focus-visible { outline: 2px solid var(--m-ink); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 2.4s; } .med { transition: none; } }


/* ---- Home: the card for this moment, over the four practices ---- */
.now-card { display: flex; align-items: center; gap: 14px; width: min(346px, 100%); margin-top: -8px; padding: 16px 16px 16px 18px; border: 0; border-radius: 22px; background: var(--float); color: var(--ink); text-align: left; box-shadow: var(--lift); transition: transform 0.14s var(--ease); }
.now-card:active { transform: scale(0.98); }
.now-card .now-ic { width: 30px; height: 30px; flex: none; }
.now-t { flex: 1; min-width: 0; } .now-t b { display: block; font-size: 18px; font-weight: 650; letter-spacing: -0.3px; line-height: 1.25; } .now-t small { display: block; margin-top: 2px; font-size: 14.5px; color: var(--ink-soft); }
.now-len { flex: none; padding: 5px 8px; border-radius: 7px; background: var(--fill-soft); font-size: 11.5px; font-weight: 700; letter-spacing: 0.08em; color: var(--ink-soft); white-space: nowrap; }
.now-chev { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--faint); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.practice-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; width: min(346px, 100%); margin-top: -10px; }
.pr { display: flex; flex-direction: column; align-items: center; gap: 9px; padding: 0; border: 0; background: none; color: var(--ink); }
.pr-tile { width: 58px; height: 58px; border-radius: 18px; background: var(--float); display: grid; place-items: center; box-shadow: 0 1px 1px rgba(29, 28, 26, 0.04), 0 6px 16px rgba(29, 28, 26, 0.08); transition: transform 0.14s var(--ease); }
.pr:active .pr-tile { transform: scale(0.94); }
.pr-tile svg { width: 30px; height: 30px; }
.pr-l { font-size: 14px; font-weight: 600; letter-spacing: -0.1px; color: var(--ink); opacity: 0.85; }
/* A suggestion she can wave off (×), with the practices underneath. ?doors=chip|say: the designs she compared. */
.doors-stack { display: flex; flex-direction: column; align-items: center; gap: 26px; width: 100%; }
.doors-stack .practice-row { margin-top: 0; }
.doors-stack .now-card { margin-top: -8px; }
.now-wrap { position: relative; width: min(346px, 100%); display: flex; justify-content: center; }
.now-card.can-dismiss { padding-right: 56px; }
.now-x, .now-chip-x { position: absolute; display: grid; place-items: center; border: 0; border-radius: 50%; background: var(--fill-soft); color: var(--ink-soft); }
.now-x { right: 14px; top: 50%; width: 30px; height: 30px; margin-top: -19px; }
.now-x svg, .now-chip-x svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.now-chip { position: relative; display: flex; align-items: center; max-width: min(346px, 100%); margin-top: -10px; padding: 0 44px 0 0; border-radius: 22px; background: var(--float); box-shadow: var(--lift); }
/* One line when it fits; a long thought wraps (up to three lines) and the chip grows into a soft box. */
.now-chip-go { display: flex; align-items: flex-start; gap: 8px; min-height: 44px; padding: 11px 4px 11px 12px; border: 0; background: none; color: var(--ink); text-align: left; font-size: 15.5px; font-weight: 650; letter-spacing: -0.2px; line-height: 1.32; }
.now-chip-go span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.now-chip-go small { margin-left: 7px; font-size: 13.5px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }
.now-chip-ic { width: 22px; height: 22px; flex: none; margin-top: -1px; }
.now-chip-x { right: 8px; top: 8px; width: 28px; height: 28px; }
.now-offer { display: flex; align-items: center; gap: 6px; margin-top: -14px; }
.now-yes { height: 42px; padding: 0 18px; border: 0; border-radius: 21px; background: var(--cta); color: var(--cta-ink); font-size: 15.5px; font-weight: 650; letter-spacing: -0.2px; }
.now-no { height: 42px; padding: 0 14px; border: 0; background: none; color: var(--ink-soft); font-size: 15.5px; font-weight: 600; }
.now-t b, .now-chip-go span { text-wrap: balance; } /* a long thought breaks into even lines, never one word alone */

/* The first talk's opening choice: answers she can tap, on her side of the page. */
#transcript .choices { align-self: flex-end; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; list-style: none; }
#transcript .choice { height: 44px; padding: 0 16px; border: 0; border-radius: 22px; background: var(--raised, #fff); color: var(--ink); font: inherit; font-size: 15.5px; font-weight: 600; box-shadow: 0 1px 1px rgba(29,28,26,.04), 0 4px 12px rgba(29,28,26,.07); cursor: pointer; transition: transform .15s; }
#transcript .choice:active { transform: scale(.96); }
/* A Reframe's recent thoughts: Mochi is offering them, so they sit on its side as pills, one
   per row, under a quiet caption that says what they are. The way out is quiet text. */
#transcript .choices.stack { align-self: flex-start; flex-direction: column; align-items: flex-start; flex-wrap: nowrap; max-width: 92%; margin-top: 4px; }
#transcript .choices-cap { font-size: 14px; font-weight: 500; color: var(--ink-soft); margin: 0 4px 2px; animation: choice-in .32s cubic-bezier(.32,.72,0,1) both; }
#transcript .choices.stack .choice { height: auto; min-height: 44px; padding: 11px 16px; line-height: 1.3; text-align: left; text-wrap: balance; animation: choice-in .32s cubic-bezier(.32,.72,0,1) both; animation-delay: calc((var(--i) + 1) * 60ms); }
#transcript .choices.stack .choice.out { min-height: 40px; padding: 8px 4px; background: none; box-shadow: none; color: var(--ink-soft); font-weight: 600; }
@keyframes choice-in { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { #transcript .choices.stack .choice, #transcript .choices-cap { animation: none; } }

/* ---- Home's deck, tucked (2026-11-08): the front card, and the bottom edges of up to two
   cards under it, centred, smaller and lighter. No dots: the edges say how many. ---- */
.deck { position: relative; width: min(346px, 100%); display: flex; justify-content: center; margin-top: -8px; }
.deck.b1 { margin-bottom: 9px; }
.deck.b2 { margin-bottom: 18px; }
.deck .now-wrap { z-index: 2; touch-action: pan-y; transition: transform 0.32s var(--ease), opacity 0.32s var(--ease); }
.deck .now-card { margin-top: 0; width: 100%; }
.deck-under { position: absolute; inset: 0; border-radius: 22px; transform-origin: 50% 100%; box-shadow: 0 1px 1px rgba(29, 28, 26, 0.04), 0 4px 12px rgba(29, 28, 26, 0.07); pointer-events: none; }
.deck-under.u1 { z-index: 1; transform: translateY(9px) scale(0.93); background: color-mix(in srgb, var(--float) 70%, var(--bg)); }
.deck-under.u2 { z-index: 0; transform: translateY(18px) scale(0.86); background: color-mix(in srgb, var(--float) 40%, var(--bg)); }
.deck .now-x { margin-top: -15px; }
.deck .now-wrap.rise { animation: deck-rise 0.34s var(--ease); }
.deck .now-wrap.gone { transform: translateX(-120%) !important; opacity: 0; }
@keyframes deck-rise { from { transform: translateY(9px) scale(0.93); opacity: 0.6; } }
/* A step's ring: tap to tick it off, as on Today. It sits where a card's icon would. */
.now-card.has-ring .ring-space { width: 30px; height: 30px; flex: none; }
.deck-ring { position: absolute; left: 20px; top: 50%; width: 26px; height: 26px; margin-top: -13px; padding: 0; border-radius: 50%; border: 2px solid var(--faint); background: none; display: grid; place-items: center; transition: background 0.2s, border-color 0.2s; }
.deck-ring svg { width: 14px; height: 14px; fill: none; stroke: var(--cta-ink); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }
.deck-ring.on { background: var(--ink); border-color: var(--ink); }
.deck-ring.on svg { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .deck .now-wrap, .deck .now-wrap.rise { animation: none; transition: none; } }
