/* REMANSO. One design system: every size, space, corner, colour, shadow and movement on any screen comes from
   the tokens below, so the app reads as one thing. The colours follow the member's day (look A, "Greek light"):
   light from when they get up, dark from the wind-down, with a sky at the top of every screen that drifts very
   slowly. Cards are soft and coloured by the hour; each screen still has one main thing. Progress is always a thin
   level line (still water), never a ring: rings are a wearable's look, and nothing here rates the member's day.
   Calm visuals (remanso.look) and Reduce Motion stop everything that drifts, breathes or bursts. */
:root {
  --font-display: 'Cormorant Garamond', 'Iowan Old Style', 'Palatino Linotype', Palatino, Georgia, serif;
  --font-text: 'Jost', 'Avenir Next', Avenir, 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* Type: three sizes of text and four of display. Nothing else is used.
     Text: a label, a second line, the body. Display: the name of a thing, a section or a sheet, a page, the one
     large number a screen may have, and a figure on a card. Every page title is the same size. */
  --t-1: 0.75rem; --t-2: 0.875rem; --t-3: 1rem;
  --d-1: 1.375rem; --d-2: 1.625rem; --d-3: clamp(2.25rem, 1.5rem + 4vw, 2.75rem); --d-4: clamp(4.5rem, 3rem + 10vw, 5.5rem);
  /* And one for the figures on Today and other cards: bigger and a little bolder than a title. */
  --d-5: 2.125rem;

  /* Space: steps of four. */
  --s-1: 4px; --s-2: 8px; --s-3: 12px; --s-4: 16px; --s-5: 20px; --s-6: 24px; --s-7: 32px; --s-8: 40px;

  /* Corners: small parts; everything that can be tapped; cards; sheets; and fully round. */
  --r-1: 6px; --r-2: 12px; --r-3: 20px; --r-4: 28px; --r-pill: 999px;

  /* Sizes that fingers need: a control is 50 high, and nothing that can be tapped answers to less than 44. */
  --ctl: 50px; --tap: 44px;
  --gutter: 20px; --tabs-h: 62px; --kb: 0px;

  /* Movement: one curve that settles like still water, and four lengths. Transform and opacity only. */
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  /* A spring: screens and sheets arrive, go a touch past, and settle. Still transform and opacity only. */
  --spring: cubic-bezier(0.34, 1.32, 0.64, 1);
  --m-press: 0.12s; --m-quick: 0.2s; --m-move: 0.3s; --m-draw: 0.7s;

  /* Colour: the colours of the hour (look A, "Greek light", Alex, 16 Nov 2026). One palette for each part of the
     member's own day: dawn, day and golden hour are light; the evening (from the wind-down to lights out) and night
     are dark. The app sets data-phase on the page from the member's own times (M.lookPhase, and their choice of
     Automatic, Light or Dark). With none set, the evening's: Aegean Night and candle gold.
     Brand base: Aegean Night #1B2636 / #26364C, Warm Stone #CDBDA5, off-white #F4EFE7.
     tile: the colour of a card. cta: the one main button. fill: a level line. label: a card's small heading.
     chip: a chip that stands out. sky-1 to sky-3: the sky behind the top of a screen, from the top down.
     sun: the soft light in the sky's corner. glow: a finished moment's burst. shine: the shimmer while waiting.
     Every text colour is at least 4.5 to 1 against what it sits on, the sky included (a logic test checks). */
  --bg: #1B2636; --surface: #26364C; --tile: #26364C; --ink: #F4EFE7; --ink-2: #CDBDA5; --line: #3B4B63;
  --hair: #2D3C53; --accent: #E8B865; --on-accent: #1B2636; --notice: #26364C; --track: #34455E; --field: #7A889E;
  --cta: #E8B865; --on-cta: #1B2636; --fill: #E8B865; --label: #E8B865; --chip: #1B2636; --on-chip: #E8B865;
  --chip-edge: #E8B865; --sky-1: #2B3B56; --sky-2: #24334B; --sky-3: #1B2636; --toast-bg: #F4EFE7; --toast-ink: #1B2636;
  --toast-accent: #9C4426; --scrim: rgba(8, 12, 19, 0.6); --bar: rgba(27, 38, 54, 0.9); --sun: rgba(232, 184, 101, 0.3);
  --glow: rgba(232, 184, 101, 0.5); --shine: rgba(255, 255, 255, 0.07); --edge: inset 0 0 0 1px rgba(232, 184, 101, 0.1);
  --lift: 0 14px 30px -20px rgba(0, 0, 0, 0.6); --lift-press: 0 4px 12px -6px rgba(0, 0, 0, 0.6); --float: 0 12px 40px rgba(4, 9, 16, 0.55);
  --sky: radial-gradient(120% 75% at 50% 0%, rgba(232, 184, 101, 0.24) 0%, rgba(232, 184, 101, 0) 62%), linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, rgba(27, 38, 54, 0) 100%);
  color-scheme: dark;
}
:root[data-phase="dawn"] {
  --bg: #F4EFE7; --surface: #FBF7F1; --tile: #FCF8F3; --ink: #1B2636; --ink-2: #4A5566; --line: #D9CDBB;
  --hair: #E6DCCD; --accent: #9A4E28; --on-accent: #F4EFE7; --notice: #FBF7F1; --track: #E7DCCB; --field: #857F70;
  --cta: #F2B07F; --on-cta: #1B2636; --fill: #B85A2E; --label: #8A4A2A; --chip: #D3E5E1; --on-chip: #1B2636;
  --chip-edge: #D3E5E1; --sky-1: #F7C8A3; --sky-2: #F5D8BE; --sky-3: #D3E5E1; --toast-bg: #1B2636; --toast-ink: #F4EFE7;
  --toast-accent: #F2B07F; --scrim: rgba(27, 38, 54, 0.45); --bar: rgba(244, 239, 231, 0.9); --sun: rgba(255, 206, 156, 0.8);
  --glow: rgba(242, 176, 127, 0.6); --shine: rgba(255, 255, 255, 0.55); --edge: inset 0 0 0 1px rgba(27, 38, 54, 0.05);
  --lift: 0 1px 2px rgba(27, 38, 54, 0.04), 0 12px 28px -20px rgba(154, 78, 40, 0.5); --lift-press: 0 1px 2px rgba(27, 38, 54, 0.06), 0 4px 12px -6px rgba(154, 78, 40, 0.45);
  --float: 0 12px 40px rgba(27, 38, 54, 0.22);
  --sky: linear-gradient(172deg, var(--sky-1) 0%, var(--sky-2) 30%, var(--sky-3) 56%, rgba(244, 239, 231, 0) 84%);
  color-scheme: light;
}
:root[data-phase="day"] {
  --bg: #F4EFE7; --surface: #FBF8F3; --tile: #FDFBF7; --ink: #1B2636; --ink-2: #4A5566; --line: #D5CDBF;
  --hair: #E3D8C7; --accent: #1D5A96; --on-accent: #F4EFE7; --notice: #FBF8F3; --track: #E2DCCF; --field: #857F70;
  --cta: #F2D24B; --on-cta: #1B2636; --fill: #1F64A8; --label: #1D5A96; --chip: #F2D24B; --on-chip: #1B2636;
  --chip-edge: #F2D24B; --sky-1: #8EC0EA; --sky-2: #B0D3F0; --sky-3: #DCE7EE; --toast-bg: #1B2636; --toast-ink: #F4EFE7;
  --toast-accent: #F2D24B; --scrim: rgba(27, 38, 54, 0.45); --bar: rgba(244, 239, 231, 0.9); --sun: rgba(246, 214, 72, 0.7);
  --glow: rgba(242, 210, 75, 0.6); --shine: rgba(255, 255, 255, 0.55); --edge: inset 0 0 0 1px rgba(27, 38, 54, 0.05);
  --lift: 0 1px 2px rgba(27, 38, 54, 0.04), 0 12px 28px -20px rgba(31, 100, 168, 0.45); --lift-press: 0 1px 2px rgba(27, 38, 54, 0.06), 0 4px 12px -6px rgba(31, 100, 168, 0.4);
  --float: 0 12px 40px rgba(27, 38, 54, 0.22);
  --sky: linear-gradient(172deg, var(--sky-1) 0%, var(--sky-2) 30%, var(--sky-3) 56%, rgba(244, 239, 231, 0) 84%);
  color-scheme: light;
}
:root[data-phase="golden"] {
  --bg: #F4EFE7; --surface: #FBF6EF; --tile: #FCF7F0; --ink: #1B2636; --ink-2: #4A5566; --line: #D9CDBB;
  --hair: #E3D8C7; --accent: #9C4426; --on-accent: #F4EFE7; --notice: #FBF6EF; --track: #EBDCC6; --field: #857F70;
  --cta: #E9B04F; --on-cta: #1B2636; --fill: #A84D2E; --label: #9C4426; --chip: #F1C799; --on-chip: #1B2636;
  --chip-edge: #F1C799; --sky-1: #E59A62; --sky-2: #F1C799; --sky-3: #F4DDBE; --toast-bg: #1B2636; --toast-ink: #F4EFE7;
  --toast-accent: #E9B04F; --scrim: rgba(27, 38, 54, 0.45); --bar: rgba(244, 239, 231, 0.9); --sun: rgba(240, 186, 90, 0.8);
  --glow: rgba(233, 176, 79, 0.6); --shine: rgba(255, 255, 255, 0.55); --edge: inset 0 0 0 1px rgba(27, 38, 54, 0.05);
  --lift: 0 1px 2px rgba(27, 38, 54, 0.04), 0 12px 28px -20px rgba(168, 77, 46, 0.5); --lift-press: 0 1px 2px rgba(27, 38, 54, 0.06), 0 4px 12px -6px rgba(168, 77, 46, 0.45);
  --float: 0 12px 40px rgba(27, 38, 54, 0.22);
  --sky: linear-gradient(172deg, var(--sky-1) 0%, var(--sky-2) 30%, var(--sky-3) 56%, rgba(244, 239, 231, 0) 84%);
  color-scheme: light;
}
:root[data-phase="night"] {
  --bg: #0F1621; --surface: #18222F; --tile: #18222F; --ink: #EEF0F2; --ink-2: #B6BEC9; --line: #2B3747;
  --hair: #1F2938; --accent: #C9D3DE; --on-accent: #0F1621; --notice: #18222F; --track: #263243; --field: #6F7B8D;
  --cta: #C9D3DE; --on-cta: #0F1621; --fill: #C9D3DE; --label: #C9D3DE; --chip: #0F1621; --on-chip: #C9D3DE;
  --chip-edge: #C9D3DE; --sky-1: #1C2838; --sky-2: #151E2B; --sky-3: #0F1621; --toast-bg: #EEF0F2; --toast-ink: #0F1621;
  --toast-accent: #1D5A96; --scrim: rgba(4, 7, 12, 0.65); --bar: rgba(15, 22, 33, 0.9); --sun: rgba(201, 211, 222, 0.16);
  --glow: rgba(201, 211, 222, 0.4); --shine: rgba(255, 255, 255, 0.06); --edge: inset 0 0 0 1px rgba(201, 211, 222, 0.07);
  --lift: 0 14px 30px -20px rgba(0, 0, 0, 0.7); --lift-press: 0 4px 12px -6px rgba(0, 0, 0, 0.7); --float: 0 12px 40px rgba(0, 0, 0, 0.6);
  --sky: radial-gradient(60% 45% at 78% 8%, rgba(201, 211, 222, 0.14) 0%, rgba(201, 211, 222, 0) 70%), linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 45%, rgba(15, 22, 33, 0) 100%);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; min-height: 100dvh; background: var(--bg); color: var(--ink); font: 400 var(--t-3)/1.5 var(--font-text); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow-x: hidden; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
/* A tap is a tap: no double-tap zoom, no text selected or menu opened by a long press on a control. */
button, a, input, select, textarea, label, summary { touch-action: manipulation; }
button, summary { cursor: pointer; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { display: block; flex: none; }

/* ---------- frame ---------- */
.status-strip { position: fixed; top: 0; left: 0; right: 0; height: env(safe-area-inset-top, 0px); background: var(--bg); z-index: 30; }
/* The sky: a soft gradient in the hour's colours behind the top of every screen, and a light in its corner. The
   layer is wider than the screen and slides very slowly from side to side (transform only); words over it are
   tested against its colours. */
.shell { position: relative; z-index: 0; }
.shell::before { content: ''; position: absolute; z-index: -1; top: 0; left: -8%; width: 116%; height: 240px; background: var(--sky); pointer-events: none; animation: sky-drift 40s ease-in-out infinite alternate; }
.shell::after { content: ''; position: absolute; z-index: -1; top: -60px; right: -40px; width: 300px; height: 300px; border-radius: 50%; background: radial-gradient(closest-side, var(--sun), transparent); pointer-events: none; animation: sun-breathe 7s ease-in-out infinite alternate; }
:root[data-view="today"] .shell::before, :root[data-view="gate"] .shell::before { height: 380px; }
@keyframes sky-drift { from { transform: translateX(-6%); } to { transform: translateX(6%); } }
@keyframes sun-breathe { from { opacity: 0.55; } to { opacity: 1; } }
.shell { max-width: 30rem; margin: 0 auto; padding: calc(var(--s-3) + env(safe-area-inset-top, 0px)) max(var(--gutter), env(safe-area-inset-right, 0px)) calc(var(--tabs-h) + var(--s-8) + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px)); overflow-x: clip; }
.shell-plain { padding-bottom: 48px; }
.top { display: flex; align-items: center; justify-content: space-between; min-height: var(--tap); margin-bottom: var(--s-4); }
.wordmark { font-family: var(--font-display); font-size: var(--d-1); letter-spacing: 0.24em; color: var(--ink); text-decoration: none; }
.top-actions { display: flex; align-items: center; gap: var(--s-2); }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); }
.icon-btn.round { border: 1px solid var(--line); color: var(--ink); }
.icon-btn.round-small { background: var(--bg); }
.icon-btn:disabled { opacity: 0.35; cursor: default; }
.pill { position: relative; border: 1px solid var(--accent); border-radius: var(--r-pill); background: transparent; color: var(--accent); padding: 6px var(--s-3); font-size: var(--t-2); font-variant-numeric: tabular-nums; }
/* You: a labelled button in the corner, so settings, goals, progress and backup are easy to find. */
.you-btn { display: inline-flex; align-items: center; gap: 6px; min-height: var(--tap); padding: 0 14px 0 11px; border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; color: var(--ink); font-size: var(--t-2); }
.you-btn .icon { color: var(--accent); }

.noteb { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-3); margin: 0 0 var(--s-4); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--notice); font-size: var(--t-2); }
.noteb-text { flex: 1 1 100%; color: var(--ink-2); font-size: var(--t-2); }
/* Sixteen-point text in every field: anything smaller makes an iPhone zoom the page when the field is tapped. */
.noteb-select { flex: 1; min-width: 0; min-height: var(--tap); border: 1px solid var(--field); border-radius: var(--r-1); background: var(--bg); padding: 6px 10px; font-size: var(--t-3); }
.noteb-reminder { justify-content: space-between; border: 1px solid var(--accent); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; justify-content: center; padding: 0 max(var(--s-2), env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(var(--s-2), env(safe-area-inset-left, 0px)); background: var(--bg); border-top: 1px solid var(--hair); }
/* The page shows faintly through the bar as it scrolls underneath, where the phone can do that cheaply. */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .tabs { background: var(--bar); -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px); }
}
.tab { flex: 1 1 0; max-width: 6rem; min-height: var(--tabs-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; padding: 6px 2px var(--s-2); border: 0; background: transparent; color: var(--ink-2); font-size: var(--t-1); letter-spacing: 0.02em; position: relative; }
.tab[aria-current="page"] { color: var(--accent); }
/* One marker that slides to the tab you are on. */
.tab-ink { position: absolute; top: -1px; left: 0; width: 22px; height: 2px; border-radius: 2px; background: var(--accent); opacity: 0; pointer-events: none; }
.tab-ink.is-placed { opacity: 1; transition: transform 0.32s var(--ease); }

/* ---------- type ---------- */
.display { font-family: var(--font-display); font-weight: 400; font-size: var(--d-3); line-height: 1.04; letter-spacing: -0.01em; margin: 2px 0 var(--s-3); text-wrap: balance; }
.date { color: var(--ink-2); font-size: var(--t-2); }
.lede { color: var(--ink-2); font-size: var(--t-3); font-weight: 300; line-height: 1.45; margin: 0 0 var(--s-5); max-width: 34ch; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-2); line-height: 1.45; }
.done { color: var(--accent); font-family: var(--font-display); font-size: var(--d-1); margin-top: var(--s-3); }
.notice { background: var(--notice); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); font-size: var(--t-2); margin: 0 0 var(--s-4); }
.form-error { color: var(--ink); background: var(--notice); border-left: 2px solid var(--accent); border-radius: 0 var(--r-1) var(--r-1) 0; padding: 10px var(--s-3); font-size: var(--t-2); }

/* ---------- buttons, links, chips ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: var(--ctl); padding: 10px var(--s-5); border: 1px solid var(--line); border-radius: var(--r-2); background: transparent; color: var(--ink); font-size: var(--t-3); font-weight: 500; text-align: center; }
.btn-primary { background: var(--cta); border-color: var(--cta); color: var(--on-cta); }
.btn-quiet { border-color: transparent; color: var(--ink-2); }
.btn-wide { width: 100%; }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); margin-top: var(--s-3); }
.btn-row .btn:only-child { grid-column: 1 / -1; }
.btn-small { min-height: var(--tap); padding: 6px var(--s-4); font-size: var(--t-2); }
.btn-danger { border-color: var(--ink); color: var(--ink); }
.btn.is-armed { border-color: var(--ink); color: var(--ink); }
.btn:disabled { opacity: 0.4; cursor: default; }
.link { position: relative; border: 0; background: none; padding: 10px 0; min-height: var(--tap); color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: var(--t-2); }
.link-quiet { color: var(--ink-2); display: block; }
.back { display: inline-flex; align-items: center; gap: var(--s-1); min-height: var(--tap); margin: -6px 0 var(--s-1) -4px; padding: 0 var(--s-2) 0 0; border: 0; background: none; color: var(--ink-2); font-size: var(--t-2); }
.stack { display: grid; gap: var(--s-3); margin: 0 0 var(--s-4); }
.chips { display: flex; gap: var(--s-2); overflow-x: auto; margin: 0 0 var(--s-1); padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips-wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; max-width: 100%; min-height: var(--tap); padding: 6px var(--s-4); border: 1px solid var(--line); border-radius: var(--r-pill); background: transparent; font-size: var(--t-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.tag { flex: none; border: 1px solid var(--line); border-radius: var(--r-pill); padding: var(--s-1) 10px; font-size: var(--t-1); color: var(--ink-2); white-space: nowrap; }
.confirm { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.confirm .btn { flex: 1 1 auto; }

/* ---------- first screen ---------- */
.gate { padding-top: 5vh; }
.mark { color: var(--accent); margin: 0 0 var(--s-3) -8px; }
.mark .water { stroke-dasharray: 60; stroke-dashoffset: 60; animation: settle 1.1s ease-out forwards; }
.mark .w2 { animation-delay: 0.18s; }
.mark .w3 { animation-delay: 0.36s; }
@keyframes settle { to { stroke-dashoffset: 0; } }
.tagline { font-family: var(--font-display); font-style: italic; font-size: var(--d-1); color: var(--ink-2); margin-bottom: var(--s-2); }
.gate-links { display: flex; flex-wrap: wrap; gap: 0 var(--s-5); margin: var(--s-1) 0 var(--s-3); }

/* The first run: four slides side by side in a strip that snaps, so a finger can drag between them. */
.intro { display: flex; align-items: flex-start; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; margin: 0 calc(var(--gutter) * -1); }
.intro::-webkit-scrollbar { display: none; }
.intro-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; padding: 0 var(--gutter) var(--s-6); }
.intro-step { color: var(--accent); font-size: var(--t-2); letter-spacing: 0.08em; text-transform: uppercase; margin: var(--s-2) 0 var(--s-2); }
.intro-slide .display:focus { outline: none; }
.intro-bed { margin-bottom: var(--s-5); }
.intro-anchors { margin-bottom: var(--s-4); }
.intro-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; display: grid; gap: var(--s-3); max-width: 30rem; margin: 0 auto; padding: var(--s-3) max(var(--gutter), env(safe-area-inset-right, 0px)) calc(var(--s-4) + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px)); background: var(--bg); border-top: 1px solid var(--hair); }
.intro-dots { display: flex; justify-content: center; gap: var(--s-2); }
.intro-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--line); transition: transform var(--m-quick) var(--ease), background-color 0.15s ease; }
.intro-dots i.is-on { background: var(--accent); transform: scale(1.5); }
.intro-acts { display: flex; gap: var(--s-3); }
.intro-acts .btn-primary { flex: 1 1 auto; }
.top-skip { padding: 0 var(--s-1); }
.follow .tick:checked + label .check-title { color: var(--ink); }

/* ---------- sections and cards ---------- */
.view { display: block; }
.view > .seg { margin: 0 0 var(--s-4); }
.block { margin: var(--s-8) 0 0; }
.block > .level { margin: 0 0 var(--s-4); }
.block > .btn-wide { margin-top: var(--s-3); }
.block > .grid2, .block > .field:first-of-type { margin-top: var(--s-3); }
.block > .muted.small { margin-top: var(--s-2); }
.block > .chips { margin-top: var(--s-3); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.section-title { font-family: var(--font-display); font-weight: 500; font-size: var(--d-2); line-height: 1.15; }
.section-aside { position: relative; color: var(--ink-2); font-size: var(--t-2); text-align: right; font-variant-numeric: tabular-nums; }
.card { padding: var(--s-4) var(--s-5); margin: var(--s-2) 0 var(--s-5); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); }
.card-plain { background: transparent; box-shadow: none; padding: 0; margin-bottom: var(--s-6); }
.card-title { font-family: var(--font-display); font-weight: 500; font-size: var(--d-2); line-height: 1.15; margin-bottom: var(--s-3); }
.card-label { color: var(--ink-2); font-size: var(--t-2); margin-bottom: var(--s-1); }
.card .btn { margin-top: var(--s-4); }
.foot { margin-top: var(--s-8); padding-top: var(--s-4); border-top: 1px solid var(--hair); color: var(--ink-2); font-size: var(--t-2); }
.foot-line { display: flex; align-items: center; gap: var(--s-4); }
.foot .link { font-size: var(--t-2); }

/* You: a picture or a letter, the week as days, the goal and targets as plain facts, settings in groups. */
.avatar { flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; object-fit: cover; overflow: hidden; background: var(--surface); box-shadow: var(--edge); color: var(--accent); }
.avatar-l { width: 64px; height: 64px; }
.avatar-s { width: 26px; height: 26px; }
.avatar-letter { font-family: var(--font-display); font-size: var(--d-2); line-height: 1; }
.avatar-s .avatar-letter { font-family: var(--font-text); font-size: var(--t-2); font-weight: 500; }
.avatar .state-mark { margin: 0; }
.you-btn.has-avatar { padding-left: var(--s-2); }
.you-btn.has-avatar > .icon { display: none; }
.you-head { display: flex; align-items: center; gap: var(--s-4); margin: 0 0 var(--s-5); }
.you-who { flex: 1; min-width: 0; }
.you-who .display { overflow-wrap: anywhere; }
.you-photo { display: flex; align-items: center; gap: var(--s-4); margin: 0 0 var(--s-4); }
.you-photo-acts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }
.you-photo-acts .link { padding: 0; }
.card .section-head { margin-bottom: var(--s-2); }
.card .section-head .card-title { margin-bottom: 0; }
.card-link { padding: 0; min-height: 0; }
.glance { display: grid; gap: var(--s-2); margin: 0 0 var(--s-3); }
.glance-row { display: grid; grid-template-columns: minmax(0, 1fr) auto 2.6rem; align-items: center; gap: var(--s-2); }
.glance-label { min-width: 0; font-size: var(--t-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.glance-marks { display: grid; grid-template-columns: repeat(7, 12px); gap: 5px; justify-items: center; align-items: center; }
.glance-day { color: var(--ink-2); font-size: var(--t-1); font-style: normal; }
.glance-day.is-today { color: var(--ink); font-weight: 500; }
.glance-count { color: var(--ink-2); font-size: var(--t-2); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.facts > div { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); padding: var(--s-2) 0; }
.facts > div + div { border-top: 1px solid var(--hair); }
.facts dt { flex: none; color: var(--ink-2); font-size: var(--t-2); }
.facts dd { font-size: var(--t-2); text-align: right; }
.group .places { margin-bottom: 0; }
.group .places + .sheet-block, .group .places + .places { margin-top: var(--s-3); }
.group > .section-head + .sheet-block { border-top: 0; padding-top: 0; }

/* Nothing here yet, or something did not work: the mark at rest, a few words, and one way on. */
.state { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding: var(--s-5); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); margin: 0 0 var(--s-4); }
.state-mark { color: var(--accent); margin-bottom: var(--s-1); }
.state-title { font-family: var(--font-display); font-weight: 500; font-size: var(--d-1); line-height: 1.2; }
.state-text { color: var(--ink-2); font-size: var(--t-2); max-width: 34ch; }
.state .btn { margin-top: var(--s-2); }
.state-error { border-top-color: var(--accent); }
.sheet-body .state { border-top: 0; padding-top: var(--s-2); }
.empty { display: flex; align-items: center; gap: var(--s-3); color: var(--ink-2); font-size: var(--t-2); padding: var(--s-3) 0 var(--s-1); }
.empty .state-mark { flex: none; margin: 0; opacity: 0.7; }

/* Waiting: the three lines of water from the mark, drawing in turn, and under them the outline of what is
   on its way, so nothing jumps when it arrives. No spinners. */
.waiting { display: inline-flex; align-items: center; gap: var(--s-3); color: var(--ink-2); }
.waters { flex: none; color: var(--accent); overflow: visible; }
.waters .wl { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw 1.9s var(--ease) infinite; }
.waters .wl2 { animation-delay: 0.16s; }
.waters .wl3 { animation-delay: 0.32s; }
@keyframes draw { 0% { stroke-dashoffset: 40; opacity: 1; } 45%, 78% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
.est-waiting { margin: 6px 0 var(--s-3); }
.msg-wait .waiting { color: inherit; }
.sk { position: relative; overflow: hidden; display: block; border-radius: var(--r-1); background: var(--track); }
.sk::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, var(--shine), transparent); transform: translateX(-100%); animation: shimmer 1.6s ease-in-out infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }
.sk-line { height: 12px; border-radius: var(--r-1); }
.sk-title { height: 22px; width: 62%; border-radius: var(--r-1); }
.sk-num { height: 34px; width: 40%; }
.sk-chip { display: inline-block; width: 96px; height: var(--tap); border-radius: var(--r-pill); }
.sk-w30 { width: 30%; } .sk-w45 { width: 45%; } .sk-w60 { width: 60%; } .sk-w80 { width: 80%; } .sk-w100 { width: 100%; }
.sk-stack { display: grid; gap: var(--s-2); }
.sk-card { display: grid; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge); }
.sk-card + .sk-card { margin-top: var(--s-3); }

.sk-row { display: flex; gap: var(--s-2); }
/* Opening the app: the shape of Today while it loads. */
.loading { display: grid; gap: var(--s-3); }
.loading .sk-head { height: 34px; width: 56%; }
.loading .sk-box { height: 52px; border-radius: var(--r-pill); }
.loading .sk-board { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }
.loading .sk-tile { height: 104px; border-radius: var(--r-2); }
.loading.is-first > * { visibility: hidden; }

/* ---------- today ---------- */
.today-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 0 var(--s-4); }
.today-head .display { margin-bottom: 0; }
/* Today moves a day with a sideways swipe; up and down still scroll, and two fingers still zoom. */
#view-today { touch-action: pan-y pinch-zoom; }
/* The entry box: a camera inside it, and your usual meals while it is in use. */
.tell { margin: 0 0 var(--s-2); }
.tell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tell-row { position: relative; display: flex; align-items: center; gap: var(--s-2); }
.tell-row .input { border-radius: var(--r-pill); min-height: 52px; padding-left: var(--s-5); background: var(--tile); border-color: transparent; box-shadow: var(--edge), var(--lift); }
.tell-row .input:focus { border-color: var(--accent); outline: none; }
.tell-row .input::placeholder { text-overflow: ellipsis; }
.tell-row.has-cam .input { padding-right: 54px; text-overflow: ellipsis; }
.tell-send { width: 52px; height: 52px; }
.tell-cam { position: absolute; top: 4px; right: 64px; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; }
.tell-usual { margin: var(--s-2) 0 0; }
.tell-library { margin: -6px 0 6px; display: flex; flex-wrap: wrap; column-gap: var(--s-5); }
.tell-library .link-quiet { display: inline-block; }
.scan-figures { font-size: var(--t-3); margin: var(--s-3) 0 var(--s-4); }
.macros { margin: 0 0 var(--s-4); }
.macro-head { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-3); font-size: var(--t-2); color: var(--ink-2); }
.macro-val { color: var(--ink); }
.macro-rest { margin: var(--s-3) 0 0; }
.row-btn { padding: 0; border: 0; background: none; text-align: left; color: inherit; min-height: var(--tap); justify-content: center; }
.recipe-totals { margin: var(--s-4) 0; }
.recipe-total { font-size: var(--t-2); margin: 0 0 var(--s-2); }
.recipe-edit { padding: var(--s-3) 0; }
.check-wrap { flex-wrap: wrap; }
.track-more { flex-basis: 100%; padding: 0 0 var(--s-2); }
.track-more .check-sub { margin: 0 0 var(--s-2); }
.careful-list { margin: 0 0 var(--s-4); padding-left: var(--s-5); }
.careful-list li { margin: 0 0 var(--s-1); }
.left { margin: var(--s-4) 0; }
.left-text { margin: 0 0 var(--s-3); }
.tell-out { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--s-4); margin-top: var(--s-2); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--notice); font-size: var(--t-2); }
.tell-text { flex: 1 1 12rem; min-width: 0; }
.tell-acts { display: inline-flex; gap: var(--s-5); }
.tell-acts .link { padding: 0; min-height: 40px; }
.tell-ask { display: block; }
.tell-ask .chips { margin-top: var(--s-2); }

/* The note for this time of day: the one main thing on Today (and on Morning), with the one thing worth a tap
   under it. Words on the page, not in a box. */
.brief { margin: 0 0 var(--s-4); }
.brief-line { font-size: var(--t-3); line-height: 1.45; }
.brief-night { color: var(--ink-2); font-size: var(--t-2); }
.brief-act { margin-top: var(--s-3); }
.brief-page { margin: var(--s-4) 0 var(--s-6); padding: var(--s-4) var(--s-5); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); }
.brief-page > p + p { margin-top: var(--s-1); }
.chip-again { background: var(--chip); border-color: var(--chip-edge); color: var(--on-chip); }
.chip-kept { border-color: var(--ink-2); }

/* The daily board: six figures, each a number, its target, a level line, and one tap to add. No boxes: a
   hairline above each, two columns, and the add sitting quietly at the right of its figure. */
.board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-3); margin: 0 0 var(--s-6); }
.tile { position: relative; border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); }
/* Pressed, a card gives a little and its shadow draws in: the deeper shadow is a layer that fades (opacity only). */
.tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: var(--lift-press); opacity: 0; pointer-events: none; transition: opacity var(--m-press) ease; }
.tile:active::after { opacity: 1; }
.tile { min-height: 132px; }
.tile-main { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-3); width: 100%; height: 100%; padding: var(--s-4) var(--s-4) var(--s-3); border: 0; border-radius: inherit; background: none; text-align: left; color: var(--ink); }
.tile-icon { display: inline-flex; color: var(--label); }
.tile-figure { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 var(--s-1); margin-top: auto; }
.tile-unit { color: var(--ink-2); font-size: var(--t-2); }
.tile-big { position: relative; font-family: var(--font-display); font-size: var(--d-5); font-weight: 500; letter-spacing: -0.015em; line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.tile-big.is-dim { color: var(--ink-2); }
.tile .level { width: 100%; margin-top: auto; }
.tile-main .level { margin-top: var(--s-1); }
.tile-add { position: absolute; top: var(--s-1); right: var(--s-1); min-width: var(--tap); height: var(--tap); padding: 0 10px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--accent); display: inline-flex; align-items: center; justify-content: center; font-size: var(--t-2); font-weight: 500; }
/* With an odd number of tiles chosen, the last one takes the full width, so no gap is left. */
.board .tile:last-child:nth-child(odd) { grid-column: 1 / -1; min-height: 108px; }
.tile-add.has-text { padding: 0 var(--s-3); font-weight: 500; }
.day-open { margin-bottom: var(--s-4); }
.day-tools { display: flex; justify-content: flex-end; gap: var(--s-5); margin: -6px 0 var(--s-2); }
.day-empty { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.nudge { display: flex; align-items: center; gap: var(--s-3); margin: 0 0 var(--s-5); padding: var(--s-2) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); font-size: var(--t-2); }
.nudge-text { flex: 1; min-width: 0; }
.nudge .link { padding: 0 6px; }

/* The middle anchor has the longest label, so it gets the widest column. */
.anchors { display: grid; grid-template-columns: 1fr 1.4fr 1fr; gap: var(--s-2); }
.anchor { display: flex; flex-direction: column; gap: 1px; padding-left: 10px; border-left: 1px solid var(--line); }
.anchor-time { font-family: var(--font-display); font-size: var(--d-1); line-height: 1.1; font-variant-numeric: lining-nums tabular-nums; }
.anchor-label { color: var(--ink-2); font-size: var(--t-1); line-height: 1.3; }
.anchor.is-past .anchor-time { color: var(--ink-2); }

.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s-2); }
.quick-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: var(--s-2) var(--s-1); border: 1px solid var(--line); border-radius: var(--r-2); background: transparent; color: var(--ink); }
.quick-big { font-family: var(--font-display); font-size: var(--d-2); line-height: 1; font-variant-numeric: lining-nums; }
.quick-unit { color: var(--ink-2); font-size: var(--t-1); }

/* The level line. It fills by being stretched from its left edge, which a phone can do without laying the
   page out again. */
.level { display: block; height: 4px; margin-top: var(--s-2); border-radius: 4px; background: var(--track); overflow: hidden; }
.level-fill { display: block; width: 100%; height: 100%; border-radius: 4px; background: var(--fill); transform: scaleX(0); transform-origin: 0 50%; transition: transform var(--m-draw) var(--ease); }
.level-big { height: 4px; margin: var(--s-1) 0 var(--s-4); }
.level-none { background: transparent; }

/* ---------- lists ---------- */
.rows > li + li { border-top: 1px solid var(--hair); }
.row { display: flex; align-items: center; gap: var(--s-3); width: 100%; min-height: 56px; padding: var(--s-2) 0; border: 0; background: none; text-align: left; color: var(--ink); }
.row > .icon { flex: none; color: var(--ink-2); }
.row-card { padding: var(--s-3) 0; }
.row-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; color: var(--ink-2); }
.row-photo { flex: none; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--track); }
.row-photo.is-arriving { visibility: hidden; }
.row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: var(--t-3); overflow-wrap: anywhere; }
.row-sub { color: var(--ink-2); font-size: var(--t-2); font-variant-numeric: tabular-nums; }
.places { display: grid; gap: 0; margin: 0 0 var(--s-5); padding: 0 var(--s-4); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); }
.places > * + * { border-top: 1px solid var(--hair); }
.places .row-card { min-height: 60px; }
.show-all { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: var(--s-1); }
/* The day as a timeline: what was logged, a line for now, and what tonight still holds. */
.row-plan { color: var(--ink-2); }
.row-plan .row-title { color: var(--ink); font-size: var(--t-2); }
.row-icon-plan { color: var(--ink-2); }
.day-mark.is-past .row-title, .day-mark.is-done .row-title { color: var(--ink-2); }
.day-mark.is-past .row-icon-plan { opacity: 0.6; }
.day-mark.is-done .row-icon-plan { color: var(--accent); }
.rows > li.day-now { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) 0; border-top: 0; color: var(--accent); font-size: var(--t-2); font-weight: 500; font-variant-numeric: tabular-nums; }
.rows > li.day-now::after { content: ''; flex: 1; height: 1px; background: var(--accent); opacity: 0.5; }
.rows > li.day-now + li { border-top: 0; }
.search-day { margin: var(--s-4) 0 0; }
.morning-times { margin-top: var(--s-4); }

/* ---------- the night by the member's own taps, and the day's small facts ---------- */
.two-up { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.night-sum { font-family: var(--font-display); font-size: var(--d-1); margin: 0 0 var(--s-3); }
.night-line { font-size: var(--t-3); margin: 0 0 var(--s-1); }
.night { padding: var(--s-4) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.night-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); }
.night-big { font-family: var(--font-display); font-size: var(--d-2); line-height: 1.1; font-variant-numeric: lining-nums; }
.night .bed { border: 0; padding: 0 0 var(--s-2); }
.pattern-lines .letter-line + .letter-line { margin-top: var(--s-2); }
.sips { margin: 0 0 var(--s-3); }
.sips .chip { display: inline-flex; align-items: center; gap: var(--s-2); }
.felt { margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--hair); }
.felt .field-label { margin-bottom: var(--s-2); }
.asleep { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-3); margin: var(--s-4) 0 0; }
.asleep-text { flex: 1; min-width: 0; }
.sleep-go { margin-top: var(--s-4); }
.stats-plain { margin-top: var(--s-2); padding-top: 0; border-top: 0; }
.good-times { margin: var(--s-3) 0; padding: var(--s-3) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.good-times .brief-line + .brief-line { margin-top: var(--s-1); }
.brief-lines .brief-line + .brief-line { margin-top: var(--s-1); }
.note-source { margin-top: var(--s-2); }
.run-open { margin-top: var(--s-4); }
.run-walk { display: inline-flex; margin-top: var(--s-2); }
.bed-below { margin-top: var(--s-6); }
/* The Assistant's two tools that run on the device, and the plan while it is being looked at. */
.assist { margin: 0 0 var(--s-4); }
.assist-tools { margin-bottom: var(--s-3); }
.assist .card { margin-bottom: 0; }
.row-time { flex: none; min-width: 3.2rem; color: var(--ink-2); font-size: var(--t-2); font-variant-numeric: tabular-nums; }
.plan-rows { margin: var(--s-2) 0 0; }
.news-lines { display: grid; gap: var(--s-2); margin: 0 0 var(--s-2); padding-left: 1.1rem; list-style: disc; font-size: var(--t-2); }
.sheet-body .news-lines { margin-bottom: var(--s-4); }
.list-name { margin-top: var(--s-4); }
.idea-list { padding: 0; }
.letter-aim { margin-top: var(--s-2); color: var(--accent); }
.letter .btn { margin-top: var(--s-3); }
.run-title { margin-top: 0; }
.run-clock { font-family: var(--font-display); font-size: var(--d-4); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; margin: var(--s-2) 0 var(--s-3); }
.again { margin: var(--s-4) 0 6px; }
.checks > .check + .check { border-top: 1px solid var(--hair); }
.check { display: flex; align-items: center; gap: var(--s-4); min-height: 54px; padding: 6px 0; }
.check label { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 0; cursor: pointer; }
.check-title { font-size: var(--t-3); overflow-wrap: anywhere; }
.check-sub { color: var(--ink-2); font-size: var(--t-2); }
.check-inline { align-items: flex-start; min-height: 0; gap: var(--s-3); }
.check-inline label { color: var(--ink-2); font-size: var(--t-2); padding: 2px 0; }
.tick { position: relative; appearance: none; -webkit-appearance: none; flex: none; width: 28px; height: 28px; margin: 0; border: 1.5px solid var(--ink-2); border-radius: 50%; background: transparent; cursor: pointer; display: inline-grid; place-content: center; }
.tick::after { content: ''; width: 12px; height: 7px; margin-top: -3px; border-left: 2px solid var(--on-accent); border-bottom: 2px solid var(--on-accent); transform: rotate(-45deg) scale(0); transition: transform 0.15s ease; }
.tick:checked { background: var(--accent); border-color: var(--accent); }
.tick:checked::after { transform: rotate(-45deg) scale(1); }
.tick-small { width: 22px; height: 22px; border-radius: var(--r-1); }
.tick-small::after { width: 10px; height: 6px; }
.tick:checked + label .check-title, .tick:checked + label .step-title { color: var(--ink-2); }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; min-width: 0; margin: 0 0 var(--s-4); }
.field-label { color: var(--ink-2); font-size: var(--t-2); }
.field-hint { color: var(--ink-2); font-size: var(--t-2); }
.input { width: 100%; min-width: 0; max-width: 100%; min-height: var(--ctl); padding: 11px 14px; border: 1px solid var(--field); border-radius: var(--r-2); background: var(--bg); color: var(--ink); font-size: var(--t-3); appearance: none; -webkit-appearance: none; }
select.input { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea.input { resize: vertical; line-height: 1.45; }
.input::placeholder { color: var(--ink-2); opacity: 1; }
.input.is-bad { border-color: var(--ink); }
.code { font-family: var(--font-mono); margin-top: var(--s-3); }
div.code, p.code { font-size: var(--t-1); }
.code-big { font-family: var(--font-mono); font-size: var(--d-1); letter-spacing: 0.04em; text-align: center; padding: var(--s-4) var(--s-2); border-radius: var(--r-2); background: var(--bg); overflow-wrap: anywhere; -webkit-user-select: all; user-select: all; }
/* Choosing a file: the browser's own control is kept for screen readers and the keyboard, drawn as one of ours. */
.file { width: 100%; margin: var(--s-1) 0 var(--s-3); font-size: var(--t-2); color: var(--ink-2); }
.file::file-selector-button { min-height: var(--tap); margin-right: var(--s-3); padding: 6px var(--s-4); border: 1px solid var(--line); border-radius: var(--r-2); background: transparent; color: var(--ink); font: 500 var(--t-2) var(--font-text); cursor: pointer; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 var(--s-3); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 0; border: 1px solid var(--line); border-radius: var(--r-2); overflow: hidden; }
.seg-btn { min-height: 46px; padding: 6px var(--s-1); border: 0; border-left: 1px solid var(--line); background: transparent; font-size: var(--t-2); }
.seg-btn:first-child { border-left: 0; }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); font-weight: 500; }
.stepper { display: flex; align-items: center; gap: var(--s-3); }
.stepper-value { min-width: 5.5ch; text-align: center; white-space: nowrap; font-family: var(--font-display); font-size: var(--d-2); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }
.feel { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.feel-btn { min-height: 58px; padding: 6px 0; border: 1px solid var(--line); border-radius: var(--r-2); background: transparent; font-size: var(--t-2); }
.feel-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 500; }
.goal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); margin: var(--s-3) 0 var(--s-4); }
.goal-btn { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-height: 58px; padding: var(--s-2) 14px; border: 1px solid var(--line); border-radius: var(--r-2); background: transparent; text-align: left; }
.goal-btn:last-child:nth-child(odd) { grid-column: 1 / -1; }
.goal-name { font-size: var(--t-2); font-weight: 500; line-height: 1.25; }
.goal-hint { color: var(--ink-2); font-size: var(--t-1); line-height: 1.3; }
.goal-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.goal-btn[aria-pressed="true"] .goal-hint { color: var(--on-accent); opacity: 0.85; }
.goal-line { margin: 0 0 var(--s-3); }
.goal-line .link { font-size: inherit; }

/* ---------- estimates ---------- */
.est { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s-3); margin: 0 0 var(--s-2); }
.est-kcal { grid-column: 1 / -1; }
.est-kcal .input { font-family: var(--font-display); font-size: var(--d-2); min-height: 58px; font-variant-numeric: lining-nums; }
.est-note { margin: 0 0 var(--s-3); }
.est-q { font-family: var(--font-display); font-size: var(--d-1); line-height: 1.2; margin: var(--s-1) 0 var(--s-3); }
.est-answer { display: flex; gap: var(--s-2); align-items: center; margin: 0 0 var(--s-1); }
.est-check { margin: 0 0 6px; }
.est-check .link { padding: 0; min-height: 0; }

/* ---------- ritual ---------- */
.sessions > .session + .session { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--hair); }
.session { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); }
.session-main { display: flex; flex-direction: column; min-width: 0; }
.session-name { font-family: var(--font-display); font-size: var(--d-1); line-height: 1.15; overflow-wrap: anywhere; }
.session-sub { color: var(--ink-2); font-size: var(--t-2); }
.bed { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) 0; border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); margin: 0 0 var(--s-1); }
.bed .card-label { margin: 0; color: var(--ink); font-size: var(--t-3); }
.steps { position: relative; }
.steps::before { content: ''; position: absolute; left: calc(3.4rem + 13px); top: 28px; bottom: 28px; width: 1px; background: var(--hair); }
.step { position: relative; display: grid; grid-template-columns: 3.4rem 28px 1fr; align-items: start; gap: 0 var(--s-3); padding: var(--s-3) 0; }
.step-time { padding-top: 3px; color: var(--ink-2); font-size: var(--t-2); font-variant-numeric: tabular-nums; }
.step .tick { background: var(--bg); }
.step .tick:checked { background: var(--accent); }
.step label { display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-height: var(--tap); }
.step-title { font-family: var(--font-display); font-size: var(--d-1); line-height: 1.2; }
.step-note { color: var(--ink-2); font-size: var(--t-2); }
.step.is-due .step-time { color: var(--accent); font-weight: 500; }
.setup > div { padding: var(--s-3) 0; }
.setup > div + div { border-top: 1px solid var(--hair); }
.setup dt { font-family: var(--font-display); font-size: var(--d-1); line-height: 1.2; font-variant-numeric: lining-nums; }
.setup dd { color: var(--ink-2); font-size: var(--t-2); margin-top: 2px; }

/* ---------- morning and charts ---------- */
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4) var(--s-3); margin-top: var(--s-4); padding-top: var(--s-4); border-top: 1px solid var(--hair); }
.stats dt { color: var(--ink-2); font-size: var(--t-2); }
.stats dd { font-family: var(--font-display); font-size: var(--d-2); line-height: 1.15; font-variant-numeric: lining-nums; }
.chart { display: block; width: 100%; height: auto; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.chart .goal-line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 4; }
/* A filled bar met the target (or followed a ritual night); a soft one was logged; an outline is another night. */
.chart .bar-ritual { fill: var(--accent); }
.chart .bar-other { fill: none; stroke: var(--ink-2); stroke-width: 1.2; }
.chart .bar-plain { fill: var(--accent); opacity: 0.6; }
.chart-label { fill: var(--ink-2); font: 400 10px var(--font-text); }
.chart-label.is-today { fill: var(--ink); font-weight: 500; }
.chart-week { margin-bottom: var(--s-1); }
.legend { display: flex; flex-wrap: wrap; gap: 6px var(--s-5); margin: var(--s-2) 0; color: var(--ink-2); font-size: var(--t-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.key { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.key-ritual { background: var(--accent); }
.key-plain { background: var(--accent); opacity: 0.6; }
.key-other { border: 1.2px solid var(--ink-2); }

/* ---------- assistant ---------- */
.fold { margin: 0 0 var(--s-4); }
.fold summary { min-height: var(--tap); display: flex; align-items: center; color: var(--ink-2); font-size: var(--t-2); text-decoration: underline; text-underline-offset: 3px; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold[open] summary { margin-bottom: var(--s-1); }
.fold-block { margin-top: var(--s-6); }
.chat { display: flex; flex-direction: column; gap: var(--s-3); margin: var(--s-2) 0 var(--s-4); }
.chat-empty { display: grid; gap: var(--s-3); }
.msg { max-width: 88%; padding: var(--s-3) var(--s-4); border-radius: var(--r-2); }
.msg-you { align-self: flex-end; background: var(--accent); color: var(--on-accent); border-bottom-right-radius: var(--r-1); }
.msg-coach { align-self: flex-start; background: var(--surface); box-shadow: var(--edge); border-bottom-left-radius: var(--r-1); }
.msg-who { font-size: var(--t-1); opacity: 0.85; margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-wait { width: 72%; }
.msg-wait .sk-stack { margin-top: var(--s-3); }
.composer { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom, 0px)); display: grid; gap: var(--s-2); padding: var(--s-3) 0; background: var(--bg); border-top: 1px solid var(--hair); }
.composer-row { display: flex; align-items: flex-end; gap: var(--s-2); }
textarea.chat-input { min-height: var(--ctl); max-height: 140px; resize: none; border-radius: var(--r-2); }
.send { flex: none; width: var(--ctl); height: var(--ctl); border: 0; border-radius: 50%; background: var(--cta); color: var(--on-cta); display: inline-flex; align-items: center; justify-content: center; }
.send:disabled { opacity: 0.4; }

/* ---------- focus ---------- */
.timer { text-align: center; margin: 6px 0 var(--s-4); }
.timer .field, .timer .card-label { text-align: left; }
.timer-clock { font-family: var(--font-display); font-size: var(--d-4); line-height: 1; letter-spacing: -0.02em; font-variant-numeric: lining-nums tabular-nums; margin: 6px 0 var(--s-3); }
.timer-lengths { display: grid; grid-template-columns: 1fr 5.5rem; gap: var(--s-2); margin: 0 0 var(--s-4); }
.timer-lengths .input { min-height: 48px; text-align: center; padding: var(--s-2); }
.timer .sheet-actions { justify-content: center; }

/* ---------- progress ---------- */
.pip { width: 11px; height: 11px; border-radius: 50%; border: 1.2px solid var(--line); display: inline-block; }
.pip.is-on { background: var(--accent); border-color: var(--accent); }
.table-wrap { overflow-x: auto; margin: var(--s-1) 0 var(--s-2); }
.table { border-collapse: collapse; font-size: var(--t-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.table th, .table td { padding: var(--s-2) var(--s-3) var(--s-2) 0; text-align: left; border-bottom: 1px solid var(--hair); font-weight: 400; }
.table thead th { color: var(--ink-2); }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin: 0 0 6px; }
.daynav-day { font-family: var(--font-display); font-size: var(--d-1); }
.letter-line { font-size: var(--t-3); line-height: 1.5; }

/* ---------- food ideas ---------- */
.ideas { min-height: 96px; margin-bottom: var(--s-4); }
.ideas-wait { padding: var(--s-2) 0 var(--s-4); }
.ideas-intro { margin-bottom: var(--s-3); font-size: var(--t-2); }
.idea { padding: var(--s-4); border-radius: var(--r-3); background: var(--bg); box-shadow: var(--edge); }
.idea + .idea { margin-top: var(--s-3); }
.idea-name { font-family: var(--font-display); font-size: var(--d-1); font-weight: 500; line-height: 1.2; }
.idea-portion { color: var(--ink-2); font-size: var(--t-2); margin-top: 2px; }
.idea-nums { margin-top: var(--s-2); font-variant-numeric: lining-nums tabular-nums; }
.idea-kcal { display: block; font-size: var(--t-3); font-weight: 500; }
.idea-macros { display: block; color: var(--ink-2); font-size: var(--t-2); }
.idea-macro { white-space: nowrap; }
.idea-why { color: var(--ink-2); font-size: var(--t-2); margin-top: 2px; }
.idea .btn { margin-top: var(--s-3); }
.idea-done { margin-top: var(--s-3); color: var(--accent); font-size: var(--t-2); font-weight: 500; }
.idea.is-logged { box-shadow: inset 0 0 0 1.5px var(--fill); }
.ideas-tail { color: var(--ink-2); font-size: var(--t-1); margin: var(--s-3) 0; }

/* ---------- a meal read from a photo ---------- */
.tell-out.photo { display: block; padding: var(--s-3); border-radius: var(--r-2); }
.photo-top { display: flex; align-items: flex-start; gap: var(--s-3); }
.photo-thumb { flex: none; width: 72px; height: 72px; border-radius: var(--r-2); object-fit: cover; background: var(--track); }
.photo-blank { display: inline-flex; align-items: center; justify-content: center; color: var(--ink-2); }
.photo-main { flex: 1; min-width: 0; min-height: 72px; display: flex; flex-direction: column; justify-content: center; }
.photo-main .sk-row { margin-top: var(--s-2); }
.photo-lead { color: var(--ink-2); font-size: var(--t-2); margin-bottom: 6px; }
.photo .photo-items { margin: 0; gap: 6px; }
.photo-items .chip { display: inline-flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: 5px 14px; border-radius: var(--r-2); background: var(--bg); white-space: normal; text-align: left; }
.chip-name { font-size: var(--t-2); line-height: 1.25; overflow-wrap: anywhere; }
.chip-sub { color: var(--ink-2); font-size: var(--t-1); line-height: 1.25; }
.photo-items .chip-add { align-items: center; width: var(--tap); padding: 0; color: var(--accent); }
.photo-other { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) var(--s-3); margin-top: var(--s-3); }
.photo-other .chips { margin: 0; }
.photo-or { color: var(--ink-2); font-size: var(--t-2); }
.photo-est { margin-top: var(--s-3); }
.photo-est .sk-stack { margin-top: var(--s-2); }
.photo-kcal { font-family: var(--font-display); font-size: var(--d-2); line-height: 1.05; font-variant-numeric: lining-nums tabular-nums; }
.photo-about, .photo-unit { font-family: var(--font-text); font-size: var(--t-2); color: var(--ink-2); }
.photo-macros { color: var(--ink-2); font-size: var(--t-2); margin-top: 2px; }
.photo-q { margin-top: var(--s-3); }
.photo-q .chips { margin: var(--s-2) 0 0; }
.photo-note { font-size: var(--t-2); margin-top: var(--s-2); }
.photo-top .photo-note { margin-top: 0; }
.photo-acts { display: flex; align-items: center; gap: var(--s-5); margin-top: var(--s-3); }
.photo-acts .link { padding: 0; min-height: 40px; }
.photo-fine { color: var(--ink-2); font-size: var(--t-1); margin-top: 6px; }
.photo-cancel { padding: 0; min-height: 36px; font-size: var(--t-2); }
.photo-ghost { position: fixed; z-index: 60; margin: 0; object-fit: cover; pointer-events: none; border-radius: var(--r-2); box-shadow: var(--float); }
.photo-count { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--hair); }
.photo-count .photo-ask { margin: 0 0 6px; }
.count-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); min-height: 48px; }
.count-name { font-size: var(--t-2); overflow-wrap: anywhere; }
.count-step { display: flex; align-items: center; gap: 6px; flex: none; }
.count-n { min-width: 2.2ch; text-align: center; font-family: var(--font-display); font-size: var(--d-2); line-height: 1; font-variant-numeric: lining-nums tabular-nums; }

/* ---------- sheets and toast ---------- */
/* Sheets rise from the bottom edge, follow the finger, settle back or slide away, and leave the way they came. */
.sheet { position: fixed; inset: auto 0 var(--kb) 0; z-index: 40; width: 100%; max-width: 30rem; max-height: calc(100vh - var(--kb) - 24px); max-height: calc(100dvh - var(--kb) - 24px - env(safe-area-inset-top, 0px)); margin: 0 auto; padding: 0; border: 0; border-radius: var(--r-4) var(--r-4) 0 0; background: var(--surface); color: var(--ink); box-shadow: var(--float); overflow-y: auto; overscroll-behavior: contain; transform: translateY(105%); opacity: 0; transition: transform 0.24s var(--ease); }
.sheet::backdrop { background: var(--scrim); }
.sheet[open] { transform: translateY(var(--drag, 0px)); opacity: 1; animation: rise 0.42s var(--spring); }
@keyframes rise { from { transform: translateY(100%); } }
.sheet:not([open]), .sheet:not([open])::backdrop { pointer-events: none; }
.sheet.is-dragging { transition: none; }
.sheet-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-5) var(--s-3) var(--s-2) max(var(--gutter), env(safe-area-inset-left, 0px)); background: var(--surface); }
#sheet .sheet-head { touch-action: none; }
#sheet .sheet-head::before { content: ''; position: absolute; top: var(--s-2); left: 50%; width: 36px; height: 4px; margin-left: -18px; border-radius: 4px; background: var(--line); }
.sheet-title { font-family: var(--font-display); font-weight: 500; font-size: var(--d-2); line-height: 1.1; }
.sheet-body { padding: var(--s-1) max(var(--gutter), env(safe-area-inset-right, 0px)) calc(var(--s-6) + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px)); }
.sheet-body > p { margin-bottom: var(--s-3); }
.sheet-body .chips { margin: -4px 0 var(--s-4); }
/* The row of moments in the ideas sheet runs edge to edge, so it comes after the rule above. */
.sheet-body .ideas-moments { margin: 0 calc(var(--gutter) * -1) var(--s-4); padding: 0 var(--gutter) 2px; }
.sheet-body .checks { margin-bottom: 6px; }
.sheet-body .setup { margin-bottom: var(--s-2); }
.sheet-body .setup dt { font-size: var(--d-1); }
.sheet-body .fold { margin-top: var(--s-3); }
.sheet-body .muted.small .link { padding: 0; min-height: 0; font-size: inherit; }
.sheet-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }
.sheet-actions .btn-primary { flex: 1 1 auto; }
.sheet-actions + .muted { margin-top: var(--s-3); }
.sheet-block { padding: var(--s-4) 0; border-top: 1px solid var(--hair); }
.sheet-block:first-child { border-top: 0; padding-top: 0; }
.sheet-block > p, .sheet-block > .btn { margin-bottom: var(--s-3); }
.sheet-sub { font-family: var(--font-display); font-weight: 500; font-size: var(--d-1); margin-bottom: 6px; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tabs-h) + var(--s-4) + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 2147483000; display: flex; align-items: center; gap: var(--s-4); width: max-content; max-width: min(26rem, calc(100vw - 32px)); padding: var(--s-3) var(--s-4); border-radius: var(--r-2); background: var(--toast-bg); color: var(--toast-ink); font-size: var(--t-2); box-shadow: var(--float); }
.toast-action { position: relative; border: 0; background: none; padding: var(--s-1) 0; color: var(--toast-accent); font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
@supports (transition-behavior: allow-discrete) {
  .sheet { transition: transform 0.24s var(--ease), opacity 0.2s ease, overlay 0.24s allow-discrete, display 0.24s allow-discrete; }
  .sheet.is-dragging { transition: none; }
  .sheet::backdrop { opacity: 0; transition: opacity 0.24s ease, overlay 0.24s allow-discrete, display 0.24s allow-discrete; }
  .sheet[open]::backdrop { opacity: 1; }
  @starting-style { .sheet[open]::backdrop { opacity: 0; } }
  .toast { transition: opacity 0.2s ease, transform 0.2s ease, display 0.2s allow-discrete; }
  .toast[hidden] { opacity: 0; transform: translate(-50%, 8px); pointer-events: none; }
}

/* ---------- privacy text ---------- */
.prose h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--d-3); line-height: 1.05; margin: 6px 0 var(--s-4); }
.prose h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--d-2); margin: var(--s-6) 0 var(--s-2); }
.prose p, .prose li { color: var(--ink); font-weight: 300; margin: 0 0 var(--s-3); max-width: 66ch; }
.prose ul { list-style: disc; padding-left: 1.2rem; }
.prose .draft { background: var(--notice); border-radius: var(--r-2); padding: var(--s-3) var(--s-4); font-weight: 400; }
.prose a { color: var(--accent); }
.noscript { padding: var(--s-6); }

@media (min-width: 420px) { :root { --gutter: 24px; } }
:root[data-text="large"] { font-size: 112.5%; }
:root[data-text="larger"] { font-size: 125%; }

/* ---------- the look's details ---------- */
/* Icons in two tones: shapes take a soft fill of their own colour; lines and arrows stay lines. */
.icon-2 path, .icon-2 circle { fill: currentColor; fill-opacity: 0.2; }
/* Warm moments are set in serif italics: the golden hour and the evening on Today and Tonight, and the end of the
   wind-down. */
:root[data-phase="golden"] .today-head .display, :root[data-phase="evening"] .today-head .display, :root[data-phase="evening"] #view-tonight > .display, .warm { font-style: italic; }
/* The ritual's glow: once the wind-down has begun, a warm light breathes slowly behind the top of Tonight, with a
   smaller candle-like light that wavers in it. Opacity only. */
.ritual-glow { position: absolute; z-index: -1; left: 50%; top: 40px; width: 420px; height: 420px; margin-left: -210px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); pointer-events: none; animation: glow-breathe 6s ease-in-out infinite alternate; }
.ritual-glow > i { position: absolute; left: 50%; top: 42%; width: 120px; height: 160px; margin-left: -60px; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 214, 150, 0.55), transparent); animation: candle 2.6s ease-in-out infinite; }
#view-tonight { position: relative; }
@keyframes glow-breathe { from { opacity: 0.45; } to { opacity: 0.95; } }
@keyframes candle { 0% { opacity: 0.8; } 18% { opacity: 0.62; } 31% { opacity: 0.9; } 47% { opacity: 0.7; } 63% { opacity: 1; } 79% { opacity: 0.66; } }
/* A finished moment: a short burst of soft light where it happened, gone within a second. Never for a count. */
.burst { position: fixed; z-index: 60; width: 0; height: 0; pointer-events: none; }
.burst.is-in-sheet { position: absolute; }
.burst::before { content: ''; position: absolute; left: -36px; top: -36px; width: 72px; height: 72px; border-radius: 50%; background: radial-gradient(closest-side, var(--glow), transparent); animation: burst-glow 0.8s var(--ease) forwards; }
.burst > i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: var(--fill); opacity: 0; animation: burst-out 0.8s var(--ease) forwards; }
@keyframes burst-glow { from { transform: scale(0.3); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
@keyframes burst-out { 0% { transform: rotate(var(--a)) translateY(0) scale(1); opacity: 1; } 100% { transform: rotate(var(--a)) translateY(-46px) scale(0.4); opacity: 0; } }
/* Lists arrive in turn on a screen's first showing. */
.is-entering .rows > li { animation: settle-in 0.32s var(--ease) backwards; }
.is-entering .rows > li:nth-child(2) { animation-delay: 0.03s; }
.is-entering .rows > li:nth-child(3) { animation-delay: 0.06s; }
.is-entering .rows > li:nth-child(4) { animation-delay: 0.09s; }
.is-entering .rows > li:nth-child(5) { animation-delay: 0.12s; }
.is-entering .rows > li:nth-child(6) { animation-delay: 0.15s; }
.is-entering .rows > li:nth-child(n+7) { animation-delay: 0.18s; }
/* Calm visuals (You, This app): nothing drifts, breathes, wavers or shimmers, and there are no bursts. */
:root[data-calm] .shell::before, :root[data-calm] .shell::after, :root[data-calm] .ritual-glow, :root[data-calm] .ritual-glow > i, :root[data-calm] .sk::after { animation: none; }
:root[data-calm] .sk::after { display: none; }
/* Out of sight, everything that moves holds still, so a hidden page uses no power drawing. */
:root[data-paused] *, :root[data-paused] *::before, :root[data-paused] *::after { animation-play-state: paused !important; }

/* ---------- Remanso 2.0: the top bar, the + button, Updates, the "i", swipe rows ---------- */
/* The top bar holds the day on the left, and Updates and You on the right. The wordmark is for the first screen. */
.top-day { position: relative; min-height: var(--tap); padding: 0; border: 0; background: none; color: var(--ink-2); font-size: var(--t-2); font-weight: 500; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.top-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; width: var(--tap); height: var(--tap); padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink); }
.bell-dot { position: absolute; top: 10px; right: 11px; width: 8px; height: 8px; border-radius: 50%; background: var(--fill); box-shadow: 0 0 0 2px var(--bg); opacity: 0; transform: scale(0.4); transition: opacity var(--m-press) ease, transform var(--m-press) ease; }
.top-icon.has-new .bell-dot { opacity: 1; transform: none; }
.top .you-btn, .top .you-btn.has-avatar { width: var(--tap); padding: 0; justify-content: center; border-radius: 50%; }
.top .you-btn .icon { color: var(--ink); }
.chip-sample { min-height: var(--tap); padding: 0 var(--s-3); border-color: var(--accent); color: var(--accent); }
/* The + button: low on the right, within reach of a thumb, on the screens where things are logged. */
.fab { position: fixed; z-index: 25; right: max(var(--gutter), calc((100vw - 30rem) / 2 + var(--gutter))); bottom: calc(var(--tabs-h) + var(--s-4) + env(safe-area-inset-bottom, 0px)); display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; padding: 0; border: 0; border-radius: 50%; background: var(--cta); color: var(--on-cta); box-shadow: var(--float); }
.shell { padding-bottom: calc(var(--tabs-h) + 96px + env(safe-area-inset-bottom, 0px)); }
.toast { bottom: calc(var(--tabs-h) + 88px + env(safe-area-inset-bottom, 0px)); }
/* Inside an open sheet: a line of no height that stays at the foot of what is in view, with the message above it. */
.toast-anchor { position: sticky; bottom: 0; z-index: 2; height: 0; }
.toast.is-in-sheet { position: absolute; bottom: calc(var(--s-4) + env(safe-area-inset-bottom, 0px)); }
.add-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-3); margin-bottom: var(--s-5); }
.add-btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s-2); min-height: 92px; padding: var(--s-3) var(--s-2); border: 0; border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); color: var(--ink); font-size: var(--t-2); font-weight: 500; }
.add-btn .icon { color: var(--accent); }
.add-usual-box .chips { flex-wrap: wrap; margin: 0 0 var(--s-2); }
/* Updates: a title, one line and one button each; the unread ones in the hour's chip colour. */
.updates { margin: 0; padding: 0; list-style: none; }
.update { display: flex; gap: var(--s-3); padding: var(--s-4) 0; }
.update + .update { border-top: 1px solid var(--hair); }
.update-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: var(--track); color: var(--ink); }
.update.is-unread .update-icon { background: var(--chip); color: var(--on-chip); }
.update-main { flex: 1; min-width: 0; }
.update-title { font-size: var(--t-3); font-weight: 500; }
.update-line { margin-top: 2px; color: var(--ink-2); font-size: var(--t-2); }
.update-act { margin-top: var(--s-2); }
.update .news-lines, .update .chips { margin: var(--s-2) 0 0; }
/* The "i": an explanation one tap away. */
.title-row { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2); }
.title-row > :first-child { min-width: 0; margin-bottom: 0; }
.info-btn { flex: none; color: var(--ink-2); }
.about-line { margin-bottom: var(--s-3); line-height: 1.5; }
/* A row that slides left to show Edit and Delete. Delete is the accent, never a warning red. */
.swipe { position: relative; overflow: hidden; }
.swipe > .row { position: relative; z-index: 1; background: var(--bg); touch-action: pan-y; transition: transform 0.26s var(--spring); }
.sheet .swipe > .row { background: var(--surface); }
.swipe > .row.is-sliding { transition: none; }
.swipe-acts { position: absolute; top: 0; right: 0; bottom: 0; display: flex; }
.swipe-act { display: inline-flex; align-items: center; justify-content: center; width: 64px; min-height: var(--tap); padding: 0; border: 0; background: var(--track); color: var(--ink); }
.swipe-act.is-delete { background: var(--accent); color: var(--on-accent); }

/* The membership card on You: the wordmark, the picture, the name, and since when. */
.member-card { margin: 0 0 var(--s-5); padding: var(--s-4) var(--s-5) var(--s-5); border-radius: var(--r-3); background: var(--tile); box-shadow: var(--edge), var(--lift); }
.member-mark { display: block; margin-bottom: var(--s-4); font-size: var(--t-2); color: var(--label); }
.member-who { display: flex; align-items: center; gap: var(--s-4); }
.member-name { flex: 1; min-width: 0; }
.member-name .display { margin-bottom: 0; overflow-wrap: anywhere; }
.member-since { margin-top: 2px; color: var(--ink-2); font-size: var(--t-2); }
/* Food's figures: a name, the figure, and the thin line. */
.figures { display: grid; gap: var(--s-4); margin: 0 0 var(--s-6); }
.figure-head { display: flex; align-items: center; gap: var(--s-3); min-height: var(--tap); }
.figure-name { flex: 1; font-size: var(--t-3); font-weight: 500; }
.figure-btn { padding: 0; border: 0; background: none; color: var(--ink); text-align: left; min-height: var(--tap); }
.figure-of { color: var(--ink-2); font-size: var(--t-2); font-variant-numeric: tabular-nums; }
.row-value { flex: none; color: var(--ink-2); font-size: var(--t-3); font-variant-numeric: tabular-nums; }
.ritual-nudge { margin: calc(var(--s-2) * -1) 0 var(--s-4); }
.target-chips { margin-top: var(--s-2); }
.chat-empty { margin-top: var(--s-3); }
/* The message box sits low, within reach of a thumb, even before there is a conversation. */
#view-coach.view-chat { display: flex; flex-direction: column; min-height: calc(100vh - var(--tabs-h) - 150px); min-height: calc(100dvh - var(--tabs-h) - 150px - env(safe-area-inset-bottom, 0px)); }
#view-coach.view-chat > .chat { flex: 1; }
.title-row .field { flex: 1; min-width: 0; }

/* ---------- small controls, full-size touch ---------- */
/* A link in a sentence, the toast's action, a tick and the timer pill keep their look, but each answers to a
   touch of at least 44 points: an unseen area is centred on it. */
.link::after, .toast-action::after, .pill::after, .tick::before {
  content: ''; position: absolute; left: 50%; top: 50%; width: max(100%, var(--tap)); height: max(100%, var(--tap)); transform: translate(-50%, -50%);
}

/* ---------- movement ---------- */
/* What changed is what moves. A screen comes from the side you went to; a page pushes in from the right and
   leaves to it; a number counts; a line fills; a new row settles. Nothing here waits for a tap or blocks one. */
@keyframes settle-in { from { opacity: 0; transform: translateY(6px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes view-fwd { from { opacity: 0; transform: translateX(26px); } }
@keyframes view-back { from { opacity: 0; transform: translateX(-26px); } }
@keyframes number-in { from { opacity: 0.2; transform: translateY(7px); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }
@keyframes grow { from { transform: scaleY(0.2); } }
@keyframes draw-x { from { transform: scaleX(0); } }
@keyframes fade-in { from { opacity: 0; } }
.view-enter { animation: view-in 0.38s var(--spring); }
.view-enter-fwd { animation: view-fwd 0.38s var(--spring); }
.view-enter-back { animation: view-back 0.38s var(--spring); }
/* On arriving at a screen its lines fill from empty, its bars grow from the axis and the day line runs to now. */
.is-entering .level-fill { animation: draw-x var(--m-draw) var(--ease) 0.1s backwards; }
.is-entering .chart .bar { animation: grow 0.5s var(--ease) backwards; transform-box: fill-box; transform-origin: 50% 100%; }
.chart .bar:nth-of-type(2) { animation-delay: 0.025s; }
.chart .bar:nth-of-type(3) { animation-delay: 0.050s; }
.chart .bar:nth-of-type(4) { animation-delay: 0.075s; }
.chart .bar:nth-of-type(5) { animation-delay: 0.100s; }
.chart .bar:nth-of-type(6) { animation-delay: 0.125s; }
.chart .bar:nth-of-type(7) { animation-delay: 0.150s; }
.chart .bar:nth-of-type(8) { animation-delay: 0.175s; }
.chart .bar:nth-of-type(9) { animation-delay: 0.200s; }
.chart .bar:nth-of-type(10) { animation-delay: 0.225s; }
.chart .bar:nth-of-type(11) { animation-delay: 0.250s; }
.chart .bar:nth-of-type(12) { animation-delay: 0.275s; }
.chart .bar:nth-of-type(13) { animation-delay: 0.300s; }
.chart .bar:nth-of-type(14) { animation-delay: 0.325s; }
.is-entering .pip { animation: fade-in 0.4s ease backwards; }
.is-entering .pip:nth-child(2) { animation-delay: 0.04s; }
.is-entering .pip:nth-child(3) { animation-delay: 0.08s; }
.is-entering .pip:nth-child(4) { animation-delay: 0.12s; }
.is-entering .pip:nth-child(5) { animation-delay: 0.16s; }
.is-entering .pip:nth-child(6) { animation-delay: 0.2s; }
.is-entering .pip:nth-child(7) { animation-delay: 0.24s; }
/* Opening the app: the six tiles arrive in turn, all within a third of a second. */
.board.is-opening .tile { animation: settle-in 0.34s var(--ease) both; }
.board.is-opening .tile:nth-child(2) { animation-delay: 0.04s; }
.board.is-opening .tile:nth-child(3) { animation-delay: 0.08s; }
.board.is-opening .tile:nth-child(4) { animation-delay: 0.12s; }
/* The first screen arrives a line at a time. */
.gate:not([hidden]) #intro-1 > * { animation: settle-in 0.5s var(--ease) backwards; }
#intro-1 > :nth-child(2) { animation-delay: 0.08s; }
#intro-1 > :nth-child(3) { animation-delay: 0.14s; }
#intro-1 > :nth-child(4) { animation-delay: 0.2s; }
#intro-1 > :nth-child(n+5) { animation-delay: 0.26s; }
/* What is new settles in: a logged row, an answer under the entry box, an idea, a reply, the usual meals. */
.rows > li.is-new { animation: settle-in 0.32s var(--ease) both; }
.tell-out.is-new { animation: settle-in 0.26s var(--ease); }
.photo.is-moved .photo-main > *, .photo.is-moved .photo-est, .photo.is-moved .photo-q, .photo.is-moved .photo-acts { animation: settle-in 0.28s var(--ease); }
.idea { animation: settle-in 0.28s var(--ease) both; }
.idea:nth-of-type(2) { animation-delay: 0.05s; }
.idea:nth-of-type(3) { animation-delay: 0.1s; }
.idea:nth-of-type(4) { animation-delay: 0.15s; }
.msg.is-new { animation: settle-in 0.28s var(--ease); }
.state { animation: fade-in 0.3s ease; }
.toast:not([hidden]) { animation: toast-in 0.22s var(--ease); }
/* A number on the board counts to its new value. The text underneath is already the new value. */
.tile.is-bumped .tile-big { animation: number-in 0.32s ease-out; }
.is-rolling { color: transparent !important; animation: none !important; }
.is-rolling::after { content: attr(data-roll); position: absolute; left: 0; top: 0; color: var(--ink); white-space: nowrap; }
.section-aside.is-rolling::after { left: auto; right: 0; color: var(--ink-2); }
/* One pressed feel for everything that can be tapped: it gives a little under the finger, at once. */
.btn, .tile, .tile-add, .tile-main, .quick-btn, .chip, .feel-btn, .send, .seg-btn, .tab, .row, .goal-btn, .back, .you-btn, .link, .toast-action, .icon-btn, .tell-cam, .pill, .fab, .add-btn, .top-icon, .top-day {
  transition: transform var(--m-press) ease, opacity var(--m-press) ease, background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn:active, .tile-add:active, .quick-btn:active, .chip:active, .feel-btn:active, .send:active, .back:active, .you-btn:active, .link:active, .toast-action:active, .icon-btn:active, .tell-cam:active, .pill:active, .fab:active, .add-btn:active, .top-icon:active, .top-day:active { transform: scale(0.96); }
.tile:active, .row:active, .goal-btn:active { transform: scale(0.98); }
.seg-btn:active, .tab:active { opacity: 0.6; }
.back:active, .you-btn:active, .link:active, .toast-action:active, .icon-btn:active, .row:active { opacity: 0.75; }
.tile-add:active, .quick-btn:active, .tell-cam:active { background: var(--track); }
.btn:disabled:active, .send:disabled:active { transform: none; }
.icon-btn:disabled:active { transform: none; opacity: 0.35; }
.tab .icon { transition: transform 0.18s ease; }
.tab[aria-current="page"] .icon { transform: translateY(-1px); }
.step .tick:checked + label .step-title { transition: color 0.2s ease; }

/* When the phone asks for less motion, everything simply appears. This comes last so it wins. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .mark .water { stroke-dashoffset: 0; animation: none; }
  .waters .wl { stroke-dashoffset: 0; animation: none; }
  .sk { animation: none; opacity: 0.7; }
  .sk::after { display: none; }
  .shell::before, .shell::after, .ritual-glow, .ritual-glow > i, .is-entering .rows > li { animation: none; }
  .burst { display: none; }
  .idea, .state, .msg.is-new, .rows > li.is-new, .board.is-opening .tile, .gate:not([hidden]) #intro-1 > *, .sheet[open] { animation: none; }
  .is-entering .level-fill, .is-entering .chart .bar, .is-entering .pip { animation: none; }
  .btn:active, .tile-add:active, .quick-btn:active, .chip:active, .feel-btn:active, .send:active, .back:active, .you-btn:active, .link:active, .toast-action:active, .icon-btn:active, .tell-cam:active, .pill:active, .tile:active, .row:active, .goal-btn:active, .fab:active, .add-btn:active, .top-icon:active, .top-day:active { transform: none; }
}
