/*
 * Forkcast. Warm white: crisp white plates on a soft cream table, navy ink,
 * kōwhai yellow for the brand. Each of us has our own colour: lake teal and
 * boysenberry. Always light, always easy to read: text is Figtree, never
 * smaller than 13 px, and nothing is ever red.
 */

@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-latin.woff2') format('woff2'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage'; src: url('/fonts/bricolage-latin-ext.woff2') format('woff2'); font-weight: 200 800; font-stretch: 75% 100%; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin.woff2') format('woff2'); font-weight: 300 900; font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Figtree'; src: url('/fonts/figtree-latin-ext.woff2') format('woff2'); font-weight: 300 900; font-display: swap; unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --cream: #f4efe6;
  --line: #ebe5da;
  --line-2: #ddd5c7;
  --ink: #1c2330;
  --ink-2: #505967;
  --ink-3: #7c8490;
  --navy: #1e3557;
  --navy-2: #2a4670;
  --kowhai: #f2b233;
  --kowhai-soft: #fff4d4;
  --kowhai-ink: #6e4a00;
  --lake: #137c7c;
  --lake-soft: #e2f2f0;
  --berry: #963a6f;
  --berry-soft: #f8e8f0;
  --me: var(--lake);
  --me-soft: var(--lake-soft);
  --them: var(--berry);
  --them-soft: var(--berry-soft);
  --shadow: 0 1px 2px rgba(64, 48, 24, 0.05), 0 8px 24px -14px rgba(64, 48, 24, 0.2);
  --radius: 20px;
  --radius-s: 14px;
  --head: 'Bricolage', ui-rounded, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}

[data-me='berry'] { --me: var(--berry); --me-soft: var(--berry-soft); --them: var(--lake); --them-soft: var(--lake-soft); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
img, svg { display: block; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--kowhai); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; } }

/* ------------------------------------------------------------------ type */

.display, .h1, .h2 { font-family: var(--head); font-weight: 720; font-stretch: 90%; letter-spacing: -0.015em; line-height: 1.1; font-variation-settings: 'opsz' 72; }
.h1 { font-size: 31px; }
.h2 { font-size: 23px; }
.h3 { font-family: var(--head); font-size: 19px; font-weight: 660; font-stretch: 96%; line-height: 1.2; letter-spacing: -0.005em; font-variation-settings: 'opsz' 28; }
.label { font-size: 14.5px; font-weight: 700; color: var(--ink-2); }
.eyebrow { font-size: 14.5px; font-weight: 600; color: var(--ink-3); }
.muted { color: var(--ink-2); }
.faint { color: var(--ink-3); }
.small { font-size: 15px; }
.tiny { font-size: 13.5px; }
.center { text-align: center; }
.strong { font-weight: 700; color: var(--ink); }

/* ---------------------------------------------------------------- layout */

.app { max-width: 560px; margin: 0 auto; padding-bottom: calc(96px + var(--safe-b)); min-height: 100dvh; }
.screen { padding: calc(16px + var(--safe-t)) 18px 28px; }
.screen-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 20px; }
.screen-head .h1 { margin: 2px 0 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.stack-l { display: flex; flex-direction: column; gap: 24px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 32px 2px 12px; }
.section-title h2 { margin: 0; }
.wrap { overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- cards */

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow), inset 0 0 0 1px var(--line); padding: 18px; }
.card-tight { padding: 14px 16px; }
.card-quiet { background: var(--cream); box-shadow: none; }
.card-me { box-shadow: var(--shadow), inset 0 0 0 2px var(--me); }
.card-butter { background: var(--kowhai-soft); box-shadow: none; color: var(--kowhai-ink); }
a.card, button.card { display: block; width: 100%; text-align: left; border: 0; text-decoration: none; color: inherit; }
button.card:active, a.card:active { transform: scale(0.99); }

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  font-weight: 700; font-size: 16px; white-space: nowrap; text-decoration: none;
  transition: transform 0.12s ease, background 0.15s ease;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: none; }
.btn-primary:active { background: var(--navy-2); }
.btn-me { background: var(--me); color: #fff; box-shadow: none; }
.btn-kowhai { background: var(--kowhai); color: #1b2230; box-shadow: none; }
.btn-quiet { background: transparent; box-shadow: none; color: var(--ink-2); padding: 0 12px; }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 48px; padding: 0; }
.btn-icon.btn-small { width: 40px; }
.link { background: none; border: 0; padding: 4px 0; color: var(--navy); font-weight: 700; font-size: 15.5px; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; color: var(--ink-2); font-weight: 700; font-size: 15.5px; text-decoration: none; margin-left: -4px; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 16px; border-radius: 999px; border: 0;
  background: var(--card); color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--line-2);
  font-size: 15.5px; font-weight: 600; white-space: nowrap;
}
.chip[aria-pressed='true'] { background: var(--navy); color: #fff; box-shadow: none; }

/* An iOS-style switcher: a cream track with a white, lifted choice. */
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 2px; padding: 4px; border-radius: 14px; background: var(--cream); }
.seg button { min-height: 42px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-2); font-weight: 700; font-size: 15px; padding: 0 8px; white-space: nowrap; }
.seg button[aria-pressed='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(64, 48, 24, 0.14), 0 0 0 1px var(--line); }

/* ----------------------------------------------------------------- forms */

.field { display: flex; flex-direction: column; gap: 8px; }
.field > span { font-size: 15.5px; font-weight: 700; color: var(--ink); }
.field small { font-size: 14px; color: var(--ink-3); line-height: 1.4; }
.input {
  width: 100%; min-height: 54px; padding: 0 16px; border-radius: var(--radius-s); border: 0;
  background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2);
  font-size: 18px;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--navy); }
textarea.input { padding: 14px 16px; min-height: 120px; resize: vertical; line-height: 1.45; font-size: 17px; }
select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.unit-input { position: relative; }
.unit-input .input { padding-right: 60px; }
.unit-input em { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); font-style: normal; font-size: 16px; font-weight: 600; color: var(--ink-3); pointer-events: none; }
.errors { background: var(--kowhai-soft); color: var(--kowhai-ink); border-radius: var(--radius-s); padding: 14px 16px; font-size: 15.5px; }
.errors p { margin: 0; }
.errors p + p { margin-top: 4px; }

.toggle { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 56px; font-size: 16.5px; }
.switch { position: relative; width: 54px; height: 32px; border-radius: 999px; background: var(--line-2); border: 0; flex: none; transition: background 0.2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); transition: transform 0.2s; }
.switch[aria-checked='true'] { background: var(--me); }
.switch[aria-checked='true']::after { transform: translateX(22px); }

.check {
  flex: none; width: 30px; height: 30px; border-radius: 9px; border: 0; padding: 0;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--line-2);
  display: grid; place-items: center; color: #fff;
}
.check[aria-checked='true'] { background: var(--me); box-shadow: none; }
.check svg { width: 17px; height: 17px; opacity: 0; transform: scale(0.6); transition: 0.15s; }
.check[aria-checked='true'] svg { opacity: 1; transform: none; }

/* --------------------------------------------------------------- tab bar */

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 6px 10px calc(6px + var(--safe-b));
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tabbar nav { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 0 5px; color: var(--ink-3); text-decoration: none; font-size: 12.5px; font-weight: 700; }
.tabbar a svg { width: 27px; height: 27px; }
.tabbar a[aria-current='page'] { color: var(--ink); }
.tabbar a[aria-current='page'] svg { color: var(--me); }

.fab {
  position: fixed; right: max(18px, calc(50% - 262px)); bottom: calc(88px + var(--safe-b)); z-index: 19;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 22px 0 18px; border-radius: 999px; border: 0;
  background: var(--navy); color: #fff; font-weight: 700; font-size: 16px;
  box-shadow: 0 12px 26px -10px rgba(30, 53, 87, 0.55);
}
.fab svg { width: 22px; height: 22px; }

/* ---------------------------------------------------------------- sheets */

.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(28, 35, 48, 0.36); animation: fade 0.2s ease; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-width: 560px; margin: 0 auto; max-height: 92dvh; overflow: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 18px calc(22px + var(--safe-b));
  box-shadow: 0 -12px 40px -12px rgba(28, 35, 48, 0.35);
  animation: rise 0.28s cubic-bezier(0.2, 0.9, 0.3, 1);
}
.sheet:focus { outline: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 3px; background: var(--line-2); margin: 0 auto 14px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.sheet-head h2 { margin: 0; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }

.toast {
  position: fixed; left: 50%; bottom: calc(100px + var(--safe-b)); z-index: 60; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 13px 20px; border-radius: 999px; font-weight: 700; font-size: 15.5px;
  box-shadow: 0 12px 30px -10px rgba(0, 0, 0, 0.45); animation: rise 0.25s ease; max-width: calc(100% - 36px); text-align: center;
}

/* ------------------------------------------------------ today: the dial */

.hero { text-align: center; }
.hero-top { text-align: left; }
.hero-top .h1 { margin: 2px 0 0; }
.dial-wrap { width: min(62vw, 236px); margin: 18px auto 0; }
.dial-wrap svg { width: 100%; height: auto; filter: drop-shadow(0 14px 22px rgba(64, 48, 24, 0.16)); }
.needle { transform-origin: 256px 256px; transition: transform 1.1s cubic-bezier(0.3, 1.3, 0.4, 1); }
.dial-read { margin-top: 14px; }
.dial-read .big { font-weight: 800; font-size: 46px; line-height: 1; letter-spacing: -0.02em; }
.dial-read .big small { font-size: 19px; font-weight: 700; letter-spacing: 0; color: var(--ink-2); margin-left: 6px; }
.dial-read .sub { font-size: 15.5px; color: var(--ink-3); margin-top: 6px; }

.macros { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 22px; text-align: left; }
.macro { background: var(--card); border-radius: 16px; padding: 12px 13px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); min-width: 0; }
.macro .k { font-size: 14px; font-weight: 700; color: var(--ink-2); }
.macro .v { font-size: 17px; font-weight: 800; margin-top: 2px; white-space: nowrap; }
.macro .v small { font-size: 13.5px; font-weight: 600; color: var(--ink-3); }
.bar { height: 7px; border-radius: 4px; background: var(--cream); overflow: hidden; margin-top: 8px; }
.bar i { display: block; height: 100%; border-radius: 4px; background: var(--me); transition: width 0.9s cubic-bezier(0.3, 1, 0.4, 1); }

/* ------------------------------------------------------------ meal cards */

.meal-kind { font-size: 14.5px; font-weight: 700; color: var(--ink-3); }
.meal-title { display: block; margin: 4px 0 0; text-decoration: none; color: var(--ink); }
.portion { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.portion span { font-size: 15px; background: var(--cream); border-radius: 10px; padding: 6px 11px; color: var(--ink); line-height: 1.3; }
.portion b { font-weight: 800; margin-right: 5px; }
.portion em { font-style: normal; color: var(--ink-3); }
.meal-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.kcal-tag { font-size: 15px; color: var(--ink-2); font-weight: 600; }
.logged { display: inline-flex; align-items: center; gap: 6px; color: var(--me); font-weight: 800; font-size: 15.5px; }
.logged svg { width: 19px; height: 19px; }
.note-light { font-size: 15px; color: var(--kowhai-ink); background: var(--kowhai-soft); border-radius: 12px; padding: 9px 13px; margin-top: 12px; line-height: 1.4; }

.empty { text-align: center; padding: 30px 20px; }
.empty .h2 { margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin: 0 auto 18px; max-width: 30ch; }

/* ------------------------------------------------------- leftovers shelf */

.shelf { display: flex; gap: 12px; overflow-x: auto; margin: 0 -18px; padding: 2px 18px 10px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.shelf::-webkit-scrollbar { display: none; }
.box {
  flex: none; width: 176px; scroll-snap-align: start; text-align: left; border: 0;
  background: var(--card); border-radius: 16px 16px 20px 20px; padding: 16px 15px 15px;
  box-shadow: var(--shadow), inset 0 0 0 1px var(--line), inset 0 6px 0 var(--kowhai);
}
.box.frozen { box-shadow: var(--shadow), inset 0 0 0 1px var(--line), inset 0 6px 0 #8fb6d9; }
.box .h3 { font-size: 17px; margin-top: 6px; }
.box .when { font-size: 14px; font-weight: 700; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }

/* ------------------------------------------------- portions: two plates */

.plates { display: flex; align-items: flex-end; justify-content: center; gap: 16px; flex-wrap: wrap; padding: 8px 0 4px; }
.pplate { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.pplate-disc {
  border-radius: 50%; display: grid; place-items: center; text-align: center; background: #fff;
  box-shadow: inset 0 0 0 3px var(--navy), inset 0 0 0 8px #fff, inset 0 0 0 10px var(--who, var(--me)), 0 12px 22px -12px rgba(64, 48, 24, 0.45);
}
.pplate-disc .k { font-weight: 800; font-size: 20px; line-height: 1; }
.pplate-disc .p { font-size: 13px; color: var(--ink-3); margin-top: 3px; font-weight: 600; }
.pplate-name { font-weight: 800; font-size: 15px; color: var(--who, var(--me)); }
.lunchbox {
  display: grid; place-items: center; text-align: center; border-radius: 14px 14px 18px 18px; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line-2), inset 0 7px 0 var(--who, var(--me)), 0 10px 20px -14px rgba(64, 48, 24, 0.5);
}
.lunchbox .k { font-weight: 800; font-size: 17px; line-height: 1; }
.lunchbox .p { font-size: 13px; color: var(--ink-3); font-weight: 600; margin-top: 3px; }

.pcard { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow), inset 0 0 0 1px var(--line), inset 5px 0 0 var(--who, var(--me)); padding: 16px 18px 10px 22px; }
.pcard-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.pcard-head .who { font-family: var(--head); font-weight: 680; font-size: 19px; color: var(--ink); }
.pcard-head .who em { font-style: normal; color: var(--who, var(--me)); }
.pline { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.pline:first-of-type { border-top: 0; }
.pline .n { font-size: 16.5px; line-height: 1.3; }
.pline .g { font-weight: 800; font-size: 17px; text-align: right; white-space: nowrap; }
.pline .g small { display: block; font-weight: 600; font-size: 13.5px; color: var(--ink-3); }

.steps-note { counter-reset: s; margin: 0; padding: 0; list-style: none; }
.steps-note li { position: relative; padding-left: 32px; margin: 8px 0; font-size: 15.5px; color: var(--ink-2); line-height: 1.4; }
.steps-note li::before { counter-increment: s; content: counter(s); position: absolute; left: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; background: var(--cream); color: var(--ink); font-size: 13px; font-weight: 800; display: grid; place-items: center; }

.step { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); align-items: flex-start; text-align: left; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; }
.step:first-child { border-top: 0; }
.step .n { flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-size: 15px; font-weight: 800; background: var(--cream); color: var(--ink); }
.step p { margin: 3px 0 0; font-size: 18px; line-height: 1.5; }
.step.done p { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.step.done .n { background: var(--me); color: #fff; }

/* ------------------------------------------------------------ checklists */

.aisle { margin-top: 14px; }
.aisle h3 { margin: 0 0 4px; font-size: 15px; font-weight: 800; color: var(--ink-2); }
.item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.aisle h3 + .item, .item:first-child { border-top: 0; }
.item .what { flex: 1; min-width: 0; }
.item .name { font-weight: 700; font-size: 16.5px; overflow-wrap: anywhere; line-height: 1.3; }
.item .buy { font-size: 14.5px; color: var(--ink-2); margin-top: 2px; line-height: 1.35; }
.item.done .name { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }
.item.done .buy { color: var(--ink-3); }
.price { font-size: 15px; font-weight: 700; color: var(--ink-2); }

/* ------------------------------------------------------------------ week */

.day { padding: 16px 18px 8px; }
.day-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 2px; }
.day.today { box-shadow: var(--shadow), inset 0 0 0 2px var(--kowhai); }
.today-tag { font-size: 13px; font-weight: 800; color: var(--kowhai-ink); background: var(--kowhai-soft); border-radius: 999px; padding: 3px 10px; }
.slotline { display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 11px 0; width: 100%; background: none; border: 0; border-top: 1px solid var(--line); text-align: left; }
.slotline:first-of-type { border-top: 0; }
.slotline .k { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14.5px; font-weight: 700; color: var(--ink-3); line-height: 1.35; }
.slotline .t { min-width: 0; font-weight: 600; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.slotline.dinner .t { font-weight: 800; font-size: 17px; }
.slotline .gap { color: var(--ink-3); font-weight: 400; }
.tag-left { font-size: 13px; font-weight: 800; color: var(--kowhai-ink); background: var(--kowhai-soft); border-radius: 999px; padding: 3px 9px; white-space: nowrap; margin-top: 1px; }
.who-name { font-weight: 800; color: var(--who); }

.progress-steps { display: flex; flex-direction: column; gap: 12px; margin: 6px 0 4px; }
.progress-steps div { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 16.5px; }
.progress-steps div.on { color: var(--ink); font-weight: 700; }
.progress-steps div.done { color: var(--ink-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--line-2); border-top-color: var(--navy); animation: spin 0.8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* --------------------------------------------------------------- recipes */

.rcard { display: flex; flex-direction: column; gap: 5px; text-align: left; width: 100%; border: 0; }
.rmeta { font-size: 15px; color: var(--ink-2); display: flex; gap: 4px 14px; flex-wrap: wrap; }
.thumbs { display: inline-flex; gap: 8px; }
.thumbs button[aria-pressed='true'] { background: var(--me); color: #fff; box-shadow: none; }
.source { font-size: 13px; font-weight: 800; border-radius: 999px; padding: 3px 10px; background: var(--cream); color: var(--ink-2); white-space: nowrap; }
.ingrow { display: grid; grid-template-columns: 1fr 112px 40px; gap: 10px; align-items: center; }
.ingrow .n { font-weight: 700; overflow-wrap: anywhere; line-height: 1.3; }
.nutri { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.nutri div { background: var(--card); border-radius: 14px; padding: 12px 6px; text-align: center; box-shadow: inset 0 0 0 1px var(--line); }
.nutri b { display: block; font-weight: 800; font-size: 19px; }
.nutri span { font-size: 13.5px; color: var(--ink-3); font-weight: 600; }
.results { max-height: 48dvh; overflow: auto; margin-top: 10px; }
.result { display: flex; justify-content: space-between; gap: 12px; align-items: center; width: 100%; padding: 14px 2px; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; font-size: 16.5px; }
.result .k { font-size: 14px; color: var(--ink-3); white-space: nowrap; font-weight: 600; }

/* ---------------------------------------------------------------- weight */

.chart { width: 100%; height: auto; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .grid text, .chart .axis { fill: var(--ink-3); font: 600 12px var(--font); }
.chart .dots circle { fill: #fff; stroke: var(--me); stroke-width: 1.5; }
.chart .trend { fill: none; stroke: var(--me); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chart .theirs { fill: none; stroke: var(--them); stroke-width: 2; stroke-dasharray: 4 5; stroke-linecap: round; }
.chart .goal { stroke: var(--kowhai); stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 13px 12px; box-shadow: var(--shadow), inset 0 0 0 1px var(--line); }
.stat b { display: block; font-size: 21px; font-weight: 800; }
.stat span { font-size: 13.5px; color: var(--ink-3); font-weight: 600; line-height: 1.3; display: block; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

.meter { height: 10px; border-radius: 5px; background: var(--cream); overflow: hidden; }
.meter i { display: block; height: 100%; background: var(--kowhai); border-radius: 5px; }

.gp { display: flex; gap: 12px; align-items: flex-start; }
.gp svg { flex: none; width: 22px; height: 22px; margin-top: 1px; }

button.card.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.settings-row .chev { color: var(--ink-3); flex: none; }

/* ------------------------------------------------------------ onboarding */

.ob { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(20px + var(--safe-t)) 20px calc(20px + var(--safe-b)); max-width: 560px; margin: 0 auto; }
.ob-body { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-top: 20px; }
.ob-foot { display: flex; gap: 10px; padding-top: 22px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dots i { width: 26px; height: 5px; border-radius: 3px; background: var(--line-2); }
.ob-dots i.on { background: var(--navy); }
.welcome .ob-body { justify-content: center; align-items: center; text-align: center; gap: 16px; }
.welcome .display { font-size: 48px; color: var(--navy); }
.welcome p { color: var(--ink-2); max-width: 28ch; margin: 0 auto; font-size: 18.5px; line-height: 1.5; }
.welcome img { filter: drop-shadow(0 16px 24px rgba(64, 48, 24, 0.18)); }
.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; text-align: left; width: 100%; padding: 15px 16px; border-radius: var(--radius-s); border: 0; background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.choice b { font-weight: 800; font-size: 17px; }
.choice span { font-size: 15px; color: var(--ink-2); line-height: 1.35; }
.choice[aria-pressed='true'] { box-shadow: inset 0 0 0 2.5px var(--navy); background: #fff; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }

/* --------------------------------------------------------------- scanner */

.scanner { position: relative; border-radius: 20px; overflow: hidden; background: #111; aspect-ratio: 3 / 4; }
.scanner video { width: 100%; height: 100%; object-fit: cover; }
.scanner .frame { position: absolute; left: 12%; right: 12%; top: 36%; height: 26%; border-radius: 18px; box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.35), inset 0 0 0 3px var(--kowhai); }

.loading { display: grid; place-items: center; min-height: 50dvh; color: var(--ink-3); }
.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }
