/* Fuel. Colours and fonts are tokens: theme.js swaps them live (see "Try looks" on the Today screen). */
:root {
  /* colour roles, defaults = Color Run light */
  --bg: #fbfaff; --surface: #ffffff; --ink: #1e1b3a; --mute: #5e5a7a; --line: #e3dff3;
  --accent: #d9005f; --accent-ink: #ffffff; --accent-soft: #ffd9ea; --danger: #c0262b;
  --hero-bg: #2b1e6b; --hero-ink: #ffffff; --hero-mute: rgba(255, 255, 255, .74);
  --pop1: #ff3d81; --pop2: #ffb800; --pop3: #1ea7fd; --pop4: #22c98a;   /* the four "powder" colours */

  /* font roles, defaults = Tall */
  --display: 'Avenir Next Condensed', 'DIN Condensed', 'Roboto Condensed', 'Bahnschrift SemiCondensed', 'Arial Narrow', system-ui, sans-serif;
  --body: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, system-ui, sans-serif;
  --d-weight: 800; --d-caps: uppercase; --d-track: .16em; --d-track-head: .1em; --d-track-title: .01em; --d-style: normal; --d-lh: .92;

  /* type: six sizes; the top two and the scoreboard numerals move with the font */
  --t-xs: 14px; --t-base: 17px; --t-lg: 22px; --t-xl: 28px; --t-2xl: 36px; --t-3xl: 52px;
  --stat-size: clamp(36px, 12.5vw, 52px);
  --w-body: 400; --w-strong: 600;

  /* space and radius */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px; --s9: 96px;
  --r-sm: 6px; --r-md: 12px; --r-lg: 20px; --r-full: 999px;

  /* shadow ramp: raised / card / modal */
  --shadow-raised: 0 1px 2px rgba(30, 20, 70, .14), 0 6px 16px rgba(30, 20, 70, .2);
  --shadow-card: 0 1px 2px rgba(30, 20, 70, .1), 0 4px 8px rgba(30, 20, 70, .08), 0 18px 40px rgba(30, 20, 70, .16);
  --shadow-modal: 0 -2px 6px rgba(30, 20, 70, .08), 0 -16px 40px rgba(30, 20, 70, .26);
}
:root[data-mode="dark"] {
  --shadow-raised: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 16px rgba(0, 0, 0, .45);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 8px rgba(0, 0, 0, .3), 0 18px 40px rgba(0, 0, 0, .4);
  --shadow-modal: 0 -2px 6px rgba(0, 0, 0, .3), 0 -16px 40px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: var(--w-body) var(--t-base)/1.5 var(--body); -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
::selection { background: var(--accent); color: var(--accent-ink); }
button, input, select { font: inherit; color: inherit; margin: 0; }
button { cursor: pointer; padding: 0; touch-action: manipulation; -webkit-user-select: none; user-select: none; }
b, strong { font-weight: var(--w-strong); }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { text-wrap: balance; }
.lead, .note, .fineprint, .empty { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.app { max-width: 560px; margin: 0 auto; padding: var(--s4) var(--s4) calc(var(--s9) + var(--s8) + env(safe-area-inset-bottom)); }
body.lab-open .app { padding-bottom: calc(var(--s9) * 4 + env(safe-area-inset-bottom)); }
body.lab-open .fab, body.lab-open .tabs { display: none; }

/* ---------- header ---------- */
.strip { display: flex; gap: var(--s1); margin-bottom: var(--s3); }
.strip i { width: var(--s5); height: 6px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.strip i:nth-child(1) { background: var(--pop1); }
.strip i:nth-child(2) { background: var(--pop2); }
.strip i:nth-child(3) { background: var(--pop3); }
.strip i:nth-child(4) { background: var(--pop4); }
.top { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s2); padding: var(--s4) 0 var(--s5); }
.eyebrow { font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: var(--d-track); text-transform: uppercase; color: var(--mute); margin-bottom: var(--s2); }
.top h1 { font: var(--d-weight) var(--t-3xl)/var(--d-lh) var(--display); font-style: var(--d-style); text-transform: var(--d-caps); letter-spacing: var(--d-track-title); }
.daynav { display: flex; gap: var(--s2); }
.iconbtn {
  width: 44px; height: 44px; padding: 0; border-radius: var(--r-md); border: 1.5px solid var(--line);
  background: var(--surface); display: grid; place-items: center; font-size: var(--t-lg); line-height: 1;
}
.iconbtn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn.look { border-color: var(--accent); color: var(--accent); }
.iconbtn:disabled { opacity: .3; cursor: default; }

/* ---------- the scoreboard (one per screen) ---------- */
.hero {
  background: var(--hero-bg); color: var(--hero-ink); border-radius: var(--r-lg);
  padding: var(--s5); box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 255, 255, .14);
  background-image: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--pop1) 24%, transparent), transparent 62%), radial-gradient(90% 70% at 0% 100%, color-mix(in srgb, var(--pop3) 14%, transparent), transparent 60%);
}
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s5) var(--s4); }
.stat { min-width: 0; }
.stat-label { font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: var(--d-track); text-transform: uppercase; color: var(--hero-mute); }
.stat-val { font: var(--d-weight) var(--stat-size)/1 var(--display); margin-top: var(--s3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stat-val .unit { display: block; font: var(--w-strong) var(--t-xs)/1 var(--body); color: var(--hero-mute); margin-top: var(--s2); }
.stat-sub { font-size: var(--t-xs); color: var(--hero-mute); margin-top: var(--s2); }
.stat-note { font-size: var(--t-xs); color: var(--hero-mute); margin-top: var(--s1); }
.more-line { margin-top: var(--s5); padding-top: var(--s3); border-top: 1px solid var(--hero-mute); font-size: var(--t-xs); color: var(--hero-mute); display: flex; gap: var(--s5); flex-wrap: wrap; align-items: baseline; }
.more-line b { font: var(--d-weight) var(--t-lg)/1 var(--display); color: var(--hero-ink); font-variant-numeric: tabular-nums; margin-left: var(--s1); }
.hero .fineprint { color: var(--hero-mute); margin-top: var(--s3); }

/* weight-stack meter: 10 slabs, fills by percent of target. Calories = pop1, protein = pop2, always on the hero colour. */
.stack {
  --gap: 3px; height: 14px; margin-top: var(--s3); color: var(--pop1);
  background: color-mix(in srgb, currentColor 22%, transparent);
  -webkit-mask: repeating-linear-gradient(90deg, #000 0 calc(10% - var(--gap)), transparent calc(10% - var(--gap)) 10%);
  mask: repeating-linear-gradient(90deg, #000 0 calc(10% - var(--gap)), transparent calc(10% - var(--gap)) 10%);
}
.stack.pro { color: var(--pop2); }
.stack i { display: block; height: 100%; background: currentColor; }
.stack.mini { height: 8px; margin: 0; --gap: 2px; }
.minibars { display: grid; gap: var(--s2); min-width: 0; background: var(--hero-bg); padding: var(--s2); border-radius: var(--r-sm); }

/* ---------- log: flat, hairline-ruled; rows bleed so text shares the heading edge ---------- */
.card { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: var(--s5); }
.card h3 { font: var(--d-weight) var(--t-lg)/1 var(--display); text-transform: var(--d-caps); font-style: var(--d-style); letter-spacing: var(--d-track-head); }
.fineprint { font-size: var(--t-xs); color: var(--mute); margin-top: var(--s3); }
.footnote { font-size: var(--t-xs); color: var(--mute); text-align: center; margin-top: var(--s5); }
.section { margin-top: var(--s6); }
.section-head { display: flex; align-items: center; justify-content: space-between; border-top: 2px solid var(--ink); padding-top: var(--s2); }
.section-head h2 { display: flex; align-items: center; gap: var(--s2); font: var(--d-weight) var(--t-lg)/1 var(--display); letter-spacing: var(--d-track-head); text-transform: var(--d-caps); font-style: var(--d-style); }
.section-head h2::before { content: ""; width: 12px; height: 12px; background: var(--mk, var(--pop1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 18%, transparent); }
.m-breakfast { --mk: var(--pop1); } .m-lunch { --mk: var(--pop2); } .m-dinner { --mk: var(--pop3); } .m-snacks { --mk: var(--pop4); }
.linkbtn { background: none; border: 0; padding: var(--s3) 0 var(--s3) var(--s4); color: var(--accent); font-weight: var(--w-strong); font-size: var(--t-xs); }
.list { margin-top: var(--s1); }
.row, .dayrow, .later-item {
  position: relative; width: calc(100% + var(--s4)); margin: 0 calc(-1 * var(--s2)); padding: var(--s3) var(--s2);
  min-height: 64px; background: none; border: 0; border-radius: var(--r-md); text-align: left;
}
.row { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.row::after, .dayrow::after, .later-item::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); bottom: 0; height: 1px; background: var(--line); }
.list > :last-child::after { display: none; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-main b { overflow: hidden; text-overflow: ellipsis; }
.row-main small, .row-nums small { color: var(--mute); font-size: var(--t-xs); }
.row-nums { display: flex; flex-direction: column; align-items: flex-end; flex-shrink: 0; font-size: var(--t-xs); color: var(--mute); font-variant-numeric: tabular-nums; }
.row-nums b { font: var(--d-weight) var(--t-lg)/1.1 var(--display); color: var(--ink); margin-right: var(--s1); }
.tag { font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: .08em; text-transform: uppercase; color: var(--mute); border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--s1); margin-left: var(--s2); vertical-align: 2px; }
.empty { padding: var(--s6) 0 var(--s2); color: var(--mute); }
.empty-line { padding: var(--s4) 0; color: var(--mute); }
.donebar { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); margin-top: var(--s6); padding: var(--s4) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.donebar p { color: var(--mute); font-size: var(--t-xs); margin-top: var(--s1); }

/* ---------- controls ---------- */
.btn {
  min-height: 48px; padding: 0 var(--s5); border-radius: var(--r-md); border: 1.5px solid var(--ink);
  background: transparent; font-weight: var(--w-strong);
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.danger { color: var(--danger); border-color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 40px; padding: 0 var(--s4); }
.btn.scan { display: flex; align-items: center; justify-content: center; gap: var(--s2); border-color: var(--accent); color: var(--accent); background: var(--accent-soft); margin-top: var(--s3); }
.btn.scan svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-row { display: flex; gap: var(--s2); flex-wrap: wrap; margin-top: var(--s3); }
.btn-row .btn { flex: 1; }
.field { display: block; margin-top: var(--s4); }
.field > span, .lab-h { display: block; font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: var(--d-track); text-transform: uppercase; color: var(--mute); margin-bottom: var(--s2); }
.input { width: 100%; min-height: 48px; padding: 0 var(--s3); border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); outline: none; }
.input:focus-visible { border-color: var(--accent); outline: 3px solid var(--accent-soft); outline-offset: 0; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.chips { display: flex; gap: var(--s2); flex-wrap: wrap; }
.chip { min-height: 40px; padding: 0 var(--s4); border-radius: var(--r-md); border: 1.5px solid var(--line); background: var(--surface); font-size: var(--t-xs); font-weight: var(--w-strong); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); }
.chips.meals { display: grid; grid-template-columns: repeat(4, 1fr); }
.chips.meals .chip { padding: 0; }
.chips.three { display: grid; grid-template-columns: repeat(3, 1fr); }
.chips.three .chip, .chips.four .chip { padding: 0; }
.chips.four { display: grid; grid-template-columns: repeat(4, 1fr); }
.switch { display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s3) 0; }
.switch small { color: var(--mute); display: block; font-size: var(--t-xs); }
.switch input { width: 24px; height: 24px; accent-color: var(--accent); flex-shrink: 0; }
.code { margin-top: var(--s4); padding: var(--s5) var(--s3); text-align: center; background: var(--accent-soft); border: 1.5px dashed var(--accent); border-radius: var(--r-md); font: 800 var(--t-xl)/1.4 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .04em; user-select: all; -webkit-user-select: all; white-space: nowrap; }
.steps { display: flex; gap: var(--s1); margin-bottom: var(--s3); }
.steps i { width: var(--s5); height: 6px; background: var(--line); }
.steps i.on { background: var(--accent); }
.link { background: none; border: 0; color: var(--accent); font-weight: var(--w-strong); padding: var(--s3) 0; text-align: left; }
.bignums { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.unit-in { position: relative; }
.unit-in .input { padding-right: var(--s7); font: var(--d-weight) var(--t-xl)/1 var(--display); min-height: 56px; }
.unit-in em { position: absolute; right: var(--s3); top: 50%; transform: translateY(-50%); font: var(--w-strong) var(--t-xs)/1 var(--body); color: var(--mute); font-style: normal; }

@media (hover: hover) {
  .row:hover, .dayrow:hover { background: color-mix(in srgb, var(--accent) 7%, transparent); }
  .btn:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
  .btn.primary:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
  .chip:hover:not(.on), .iconbtn:hover:not(:disabled) { border-color: var(--accent); }
  .linkbtn:hover, .link:hover { text-decoration: underline; }
  .tab:hover { color: var(--ink); }
  .fab:hover { filter: brightness(1.08); }
}

/* ---------- nav + add ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; max-width: 560px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1.5px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs::before { content: ""; position: absolute; top: -1.5px; left: calc(var(--i, 0) * 20% + 5%); width: 10%; height: 3px; background: var(--accent); border-radius: 0 0 var(--r-sm) var(--r-sm); }
.tab {
  position: relative; background: none; border: 0; min-height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--s1);
  font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--mute);
}
.row.ticked .row-main b { text-decoration: line-through; color: var(--mute); }
.tab svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.tab.on { color: var(--ink); }
.tab.on svg { stroke: var(--accent); }

.fab {
  position: fixed; z-index: 11; right: max(var(--s4), calc(50% - 264px)); bottom: calc(80px + env(safe-area-inset-bottom));
  height: 56px; padding: 0 var(--s5) 0 var(--s4); border-radius: var(--r-md); border: 0; background: var(--accent); color: var(--accent-ink);
  font: var(--d-weight) var(--t-base)/1 var(--display); letter-spacing: .08em; text-transform: var(--d-caps); display: flex; align-items: center; gap: var(--s2);
  box-shadow: var(--shadow-raised);
}
.fab svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2.6; stroke-linecap: round; }

/* ---------- week ---------- */
.dayrow { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s4); align-items: center; }
.dayrow .d { display: flex; flex-direction: column; }
.dayrow .d b { font: var(--d-weight) var(--t-lg)/1 var(--display); letter-spacing: .04em; text-transform: var(--d-caps); }
.dayrow .d small { color: var(--mute); font-size: var(--t-xs); margin-top: var(--s1); }
.status { display: inline-flex; align-items: center; gap: var(--s2); font-size: var(--t-xs); font-weight: var(--w-strong); color: var(--mute); white-space: nowrap; }
.status .dot { width: 12px; height: 12px; border-radius: var(--r-full); border: 2px solid currentColor; }
.status.full, .status.part { color: var(--ink); }
.status.full .dot { background: var(--accent); border-color: var(--accent); }
.status.part .dot { border-color: var(--accent); background: linear-gradient(90deg, var(--accent) 50%, transparent 50%); }
.dayrow .stat-sub { color: var(--mute); margin: 0; }

/* ---------- sheet ---------- */
.backdrop { position: fixed; inset: 0; z-index: 20; background: rgba(14, 10, 36, .5); }
.sheet {
  position: fixed; z-index: 21; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto;
  max-height: 92vh; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--surface); border-radius: var(--r-lg) var(--r-lg) 0 0; padding: var(--s3) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-modal);
}
.grab { position: relative; width: 72px; height: 24px; margin: 0 auto var(--s2); touch-action: none; cursor: grab; }
.grab::after { content: ""; position: absolute; left: 16px; right: 16px; top: 10px; height: 4px; border-radius: var(--r-full); background: var(--line); }
.sheet h2 { font: var(--d-weight) var(--t-2xl)/var(--d-lh) var(--display); font-style: var(--d-style); text-transform: var(--d-caps); letter-spacing: var(--d-track-title); margin-bottom: var(--s2); }
.sheet .lead { color: var(--mute); margin-bottom: var(--s2); }
.qty { display: grid; grid-template-columns: 48px 1fr 48px; gap: var(--s2); }
.qty .input { text-align: center; font: var(--d-weight) var(--t-xl) var(--display); }
.qty .iconbtn { width: 48px; height: 48px; }
.preview { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 2px solid var(--ink); margin-top: var(--s4); }
.preview div { padding: var(--s3) var(--s1) 0; font-variant-numeric: tabular-nums; }
.preview b { display: block; font: var(--d-weight) var(--t-xl)/1 var(--display); }
.preview small { color: var(--mute); font: var(--d-weight) var(--t-xs) var(--display); text-transform: uppercase; letter-spacing: .06em; white-space: nowrap; }
.note { font-size: var(--t-xs); color: var(--mute); margin-top: var(--s3); }
.note.box { background: var(--bg); border-radius: var(--r-md); padding: var(--s3) var(--s4); }
.note.box b { color: var(--ink); }
.note.warn { background: var(--accent-soft); border-left: 4px solid var(--accent); border-radius: var(--r-sm); color: var(--ink); margin-top: var(--s4); }

/* ---------- barcode scanner ---------- */
.cam { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r-lg); overflow: hidden; background: #000; margin-top: var(--s3); }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-guide { position: absolute; inset: 24% 8%; border-radius: var(--r-md); box-shadow: 0 0 0 999px rgba(0, 0, 0, .38); border: 2px solid var(--pop2); }
.cam-guide::after { content: ""; position: absolute; left: var(--s2); right: var(--s2); top: 50%; height: 2px; background: var(--pop1); box-shadow: 0 0 8px var(--pop1); }

/* ---------- toast ---------- */
#toast {
  position: fixed; z-index: 40; left: var(--s4); right: var(--s4); max-width: 528px; margin: 0 auto;
  bottom: calc(88px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  background: var(--ink); color: var(--bg); border-radius: var(--r-md); padding: var(--s3) var(--s4); box-shadow: var(--shadow-raised);
  opacity: 0; transform: translateY(var(--s3)) scale(.98);
}
#toast.in { opacity: 1; transform: none; }
#toast button { background: none; border: 0; color: inherit; font-weight: var(--w-strong); text-decoration: underline; padding: var(--s2); }

/* ---------- look lab ---------- */
.lab {
  position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: var(--surface);
  border-radius: var(--r-lg) var(--r-lg) 0 0; border-top: 3px solid var(--accent); box-shadow: var(--shadow-modal);
  padding: var(--s3) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom)); max-height: 62vh; max-height: 62dvh; overflow-y: auto;
}
.lab-top { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); margin-bottom: var(--s2); }
.lab-top b { font: var(--d-weight) var(--t-lg)/1 var(--display); text-transform: var(--d-caps); font-style: var(--d-style); }
.lab-now { color: var(--mute); font-size: var(--t-xs); }
.lab-row { margin-top: var(--s3); }
.lab-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--s2); }
.opt {
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: var(--s1); min-height: 72px; padding: var(--s2) var(--s1);
  border: 1.5px solid var(--line); border-radius: var(--r-md); background: var(--bg); font-size: var(--t-xs); font-weight: var(--w-strong); line-height: 1.1; text-align: center;
}
.opt.on { border-color: var(--accent); background: var(--accent-soft); }
.opt .sw { display: grid; grid-template-columns: repeat(4, 1fr); width: 100%; height: 28px; border-radius: var(--r-sm); overflow: hidden; }
.opt .sw i { display: block; }
.opt .aa { font-size: var(--t-lg); line-height: 1; padding-top: var(--s1); }
.sample-tag { color: var(--hero-mute); }

/* ---------- more ---------- */
.later-item { display: flex; gap: var(--s3); align-items: flex-start; padding-top: var(--s4); padding-bottom: var(--s4); }
.later-item input[type=checkbox] { width: 24px; height: 24px; margin-top: var(--s1); accent-color: var(--accent); flex-shrink: 0; }
.later-item b { display: block; }
.later-item small { display: block; color: var(--mute); font-size: var(--t-xs); margin-top: var(--s1); }
.later-item.done b { text-decoration: line-through; color: var(--mute); }
.later-item .x { margin-left: auto; background: none; border: 0; color: var(--mute); font-size: var(--t-lg); padding: 0 var(--s1); }
.pill { display: inline-block; font: var(--d-weight) var(--t-xs)/1 var(--display); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent); border-radius: var(--r-sm); padding: var(--s1); margin-left: var(--s2); vertical-align: 2px; }
.h-sec { font: var(--d-weight) var(--t-lg)/1 var(--display); letter-spacing: var(--d-track-head); text-transform: var(--d-caps); font-style: var(--d-style); border-top: 2px solid var(--ink); padding-top: var(--s2); margin: var(--s7) 0 var(--s2); }
.h-sec:first-child { margin-top: 0; }

/* ---------- motion: 120-200ms for touch feedback, 250-300ms for movement, none for reduced-motion ---------- */
#modal.leaving { pointer-events: none; }
#view.out { opacity: 0; transform: translateY(var(--s2)); }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  #view { transition: opacity .11s ease, transform .11s ease; }
  #view.in { animation: viewin .26s cubic-bezier(.2, .8, .2, 1); }
  .sheet, .lab { animation: up .3s cubic-bezier(.2, .8, .2, 1); }
  .backdrop { animation: fade .22s ease; backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); }
  #modal.still .sheet, #modal.still .backdrop, .lab.still { animation: none; }
  #modal.leaving .sheet { animation: down .21s cubic-bezier(.4, 0, 1, 1) forwards; }
  #modal.leaving .backdrop { animation: fadeout .21s ease forwards; }
  .lab.leaving { animation: down .2s cubic-bezier(.4, 0, 1, 1) forwards; }
  .tabs::before { transition: left .34s cubic-bezier(.3, 1.2, .5, 1); }
  .tab { transition: color .2s ease; }
  .tab svg { transition: transform .25s cubic-bezier(.3, 1.4, .5, 1); }
  .tab.on svg { transform: translateY(-2px) scale(1.08); }
  #toast { transition: opacity .22s ease, transform .28s cubic-bezier(.2, .8, .2, 1); }
  .row, .btn, .chip, .iconbtn, .dayrow, .opt, .fab, .link, .linkbtn { transition: background-color .18s ease, border-color .18s ease, transform .15s cubic-bezier(.2, .8, .2, 1), filter .18s ease; }
  .btn:active, .chip:active, .iconbtn:active:not(:disabled), .opt:active, .fab:active { transform: scale(.96); }
  .row:active, .dayrow:active { background: color-mix(in srgb, var(--accent) 11%, transparent); }
  .fresh { animation: fresh 1.5s ease-out; }
  .stack i { transition: width .4s ease; }
  .cam-guide::after { animation: sweep 1.8s ease-in-out infinite alternate; }
  .theming, .theming *, .theming *::before, .theming *::after { transition: background-color .35s ease, color .35s ease, border-color .35s ease, box-shadow .35s ease, fill .35s ease, stroke .35s ease !important; }
}
@keyframes up { from { transform: translateY(var(--s5)); opacity: .5; } }
@keyframes down { to { transform: translateY(105%); opacity: .5; } }
@keyframes fade { from { opacity: 0; } }
@keyframes fadeout { to { opacity: 0; } }
@keyframes viewin { from { opacity: 0; transform: translate(var(--dx, 0), var(--s2)); } }
@keyframes fresh { 0% { opacity: .2; transform: translateY(var(--s2)); background: color-mix(in srgb, var(--accent) 26%, transparent); } 28% { opacity: 1; transform: none; } 100% { background: transparent; } }
@keyframes sweep { from { top: 20%; } to { top: 80%; } }
