/* Max web app — one stylesheet, mobile-first, light + dark. No build step.
   Tokens first; components after. Warm, energetic, friendly: Max is a friend, not a dashboard. */

:root {
  --bg: #fff8f3;
  --bg-glow: #ffe9dc;
  --surface: #ffffff;
  --surface-2: #fff3ec;
  --ink: #1b1530;
  --muted: #6b6478;
  --border: #efe4da;
  --brand: #ff5a36;
  --brand-ink: #ffffff;
  --brand-soft: #ffe7df;
  --violet: #7c3aed;
  --grad: linear-gradient(135deg, #ff8a3d 0%, #ff4f6d 52%, #b44cff 100%);
  --grad-soft: linear-gradient(135deg, #fff1e6 0%, #ffe6ee 60%, #f3e8ff 100%);
  --danger: #d92d3a;
  --danger-soft: #fdecee;
  --ok: #0f9f62;
  --ok-soft: #e3f7ee;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgb(27 21 48 / 0.04), 0 12px 32px -12px rgb(27 21 48 / 0.12);
  --shadow-brand: 0 10px 24px -10px rgb(255 79 109 / 0.65);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --bg: #0f0b1a;
    --bg-glow: #24123a;
    --surface: #1a1528;
    --surface-2: #221b35;
    --ink: #f5f1ff;
    --muted: #a59dbb;
    --border: #2c2442;
    --brand: #ff6d4a;
    --brand-ink: #ffffff;
    --brand-soft: #3a1d26;
    --grad-soft: linear-gradient(135deg, #2a1a2c 0%, #2a1631 60%, #221a3d 100%);
    --danger: #ff6b74;
    --danger-soft: #3a1820;
    --ok: #43d69a;
    --ok-soft: #12312a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.6); }
}
:root:where([data-theme="dark"]) { --bg: #0f0b1a;
    --bg-glow: #24123a;
    --surface: #1a1528;
    --surface-2: #221b35;
    --ink: #f5f1ff;
    --muted: #a59dbb;
    --border: #2c2442;
    --brand: #ff6d4a;
    --brand-ink: #ffffff;
    --brand-soft: #3a1d26;
    --grad-soft: linear-gradient(135deg, #2a1a2c 0%, #2a1631 60%, #221a3d 100%);
    --danger: #ff6b74;
    --danger-soft: #3a1820;
    --ok: #43d69a;
    --ok-soft: #12312a;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3), 0 12px 32px -12px rgb(0 0 0 / 0.6); }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  font: 16px/1.55 var(--font);
  background:
    radial-gradient(900px 500px at 100% -10%, var(--bg-glow), transparent 60%),
    radial-gradient(700px 420px at -10% 110%, var(--bg-glow), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); font-weight: 600; text-decoration-thickness: 2px; text-underline-offset: 3px; }
h1, h2, h3 { letter-spacing: -0.02em; }

/* ── Top bar ───────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 16px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 800; font-size: 1.2rem; }
.brand-mark {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
  background: var(--grad); color: #fff; font-weight: 800; box-shadow: var(--shadow-brand);
}
.topbar-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand); font-weight: 800;
}
.link-button {
  background: none; border: 1px solid var(--border); color: var(--muted); font: inherit; font-size: 0.9rem;
  cursor: pointer; padding: 6px 12px; border-radius: 999px;
}
.link-button:hover { color: var(--ink); border-color: var(--muted); }

/* ── Page shells ───────────────────────────────────────── */
.page { flex: 1; width: 100%; max-width: 720px; margin: 0 auto; padding: 4px 16px 32px; display: grid; gap: 18px; align-content: start; }

.auth-shell { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 16px 32px; display: grid; gap: 20px; }
@media (min-width: 900px) {
  .auth-shell { grid-template-columns: 1.05fr 1fr; align-items: stretch; padding-top: 12px; }
}

/* ── Brand panel (auth pages) ──────────────────────────── */
.brand-panel {
  position: relative; overflow: hidden; color: #fff;
  background: var(--grad); border-radius: 28px; padding: 28px 24px;
  box-shadow: var(--shadow-brand);
}
.brand-panel::before, .brand-panel::after {
  content: ""; position: absolute; border-radius: 50%; background: rgb(255 255 255 / 0.14);
}
.brand-panel::before { width: 320px; height: 320px; right: -110px; top: -120px; }
.brand-panel::after { width: 220px; height: 220px; left: -80px; bottom: -110px; }
.brand-panel > * { position: relative; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px;
  background: rgb(255 255 255 / 0.2); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em;
  align-self: flex-start; width: fit-content;
}
.brand-panel h2 { font-size: clamp(1.8rem, 5vw, 2.6rem); line-height: 1.08; margin: 14px 0 8px; }
.brand-panel .tagline { font-size: 1.05rem; opacity: 0.92; margin: 0; max-width: 32ch; }
.features { list-style: none; padding: 0; margin: 22px 0 0; display: none; gap: 12px; }
.features li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.features .icon {
  display: inline-grid; place-items: center; width: 38px; height: 38px; flex: none;
  border-radius: 12px; background: rgb(255 255 255 / 0.2); font-size: 1.15rem;
}

/* chat preview: shows the feeling of the product */
.chat-preview { margin-top: 24px; display: none; gap: 8px; max-width: 360px; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: 0.93rem; line-height: 1.4; box-shadow: 0 6px 16px -8px rgb(0 0 0 / 0.35); }
.bubble.max { background: #fff; color: #1b1530; border-bottom-left-radius: 6px; justify-self: start; }
.bubble.me { background: rgb(27 21 48 / 0.82); color: #fff; border-bottom-right-radius: 6px; justify-self: end; }
.bubble .meta { display: block; margin-top: 4px; font-size: 0.78rem; color: #6b6478; font-weight: 600; }

@media (min-width: 900px) {
  .brand-panel { padding: 40px 36px; display: flex; flex-direction: column; }
  .features { display: grid; }
  .chat-preview { display: grid; margin-top: auto; padding-top: 28px; }
}

/* ── Cards ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 20px; box-shadow: var(--shadow); }
.card > :last-child { margin-bottom: 0; }
@media (min-width: 600px) { .card { padding: 28px; } }
.auth-card { align-self: center; }
@media (min-width: 900px) { .auth-card { padding: 40px 36px; } }

h1 { font-size: clamp(1.6rem, 4.5vw, 2rem); line-height: 1.15; margin: 0 0 6px; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
.lede { color: var(--muted); margin: 0 0 22px; }
.eyebrow { color: var(--muted); font-size: 0.8rem; margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; }

/* ── Forms ─────────────────────────────────────────────── */
.field { display: grid; gap: 6px; margin-bottom: 16px; }
.field label { font-weight: 700; font-size: 0.92rem; }
.field input {
  width: 100%; height: 50px; padding: 0 16px; font: inherit; color: var(--ink);
  background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm);
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.field input::placeholder { color: var(--muted); opacity: 0.7; }
.field input:hover { border-color: var(--border); }
.field input:focus { outline: none; background: var(--surface); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.field.has-error input { border-color: var(--danger); background: var(--danger-soft); }
.input-wrap { position: relative; }
.input-wrap input { padding-right: 76px; }
.reveal {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: var(--surface); color: var(--muted); font: inherit; font-size: 0.82rem; font-weight: 700;
  padding: 6px 10px; border-radius: 10px; cursor: pointer;
}
.reveal:hover { color: var(--ink); }
.help { color: var(--muted); font-size: 0.84rem; margin: 0; }
.error { color: var(--danger); font-size: 0.88rem; font-weight: 600; margin: 0; }
.error.banner { display: flex; gap: 8px; align-items: center; background: var(--danger-soft); padding: 12px 14px; border-radius: var(--radius-sm); margin-bottom: 16px; }

.button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; width: 100%; height: 52px;
  padding: 0 18px; border-radius: var(--radius-sm); border: 0; font: inherit; font-weight: 800; font-size: 1rem;
  cursor: pointer; transition: transform 0.12s, box-shadow 0.12s, filter 0.12s;
}
.button.primary { background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); }
.button.primary:hover { transform: translateY(-1px); filter: saturate(1.1); }
.button.primary:active { transform: translateY(0); }
.switch { text-align: center; color: var(--muted); margin: 18px 0 0; }
.auth-card .forgot { text-align: right; margin: 10px 0 0; font-size: 0.9rem; }

/* ── Home ──────────────────────────────────────────────── */
.badge { display: inline-block; margin-top: 14px; padding: 4px 12px; border-radius: 999px; background: rgb(255 255 255 / 0.22); font-size: 0.8rem; font-weight: 700; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px 12px; text-align: center; box-shadow: var(--shadow); }
.ring {
  --p: 0; width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%;
  background: conic-gradient(var(--brand) calc(var(--p) * 1%), var(--surface-2) 0);
  display: grid; place-items: center;
}
.ring::after { content: attr(data-icon); width: 48px; height: 48px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.2rem; }
.stat .value { font-weight: 800; font-size: 1.05rem; }
.stat .label { color: var(--muted); font-size: 0.8rem; font-weight: 600; }

.chip { flex: none; padding: 4px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 800; background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.chip.next { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

/* ── Footer ────────────────────────────────────────────── */
.footer {
  display: flex; flex-wrap: wrap; gap: 6px 12px; justify-content: flex-end;
  width: 100%; max-width: 1080px; margin: 0 auto; padding: 18px 16px; color: var(--muted); font-size: 0.8rem;
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ══════════════════════ App (logged-in) components ══════════════════════ */

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }

/* Navigation: top links on desktop, bottom tab bar on phones */
.topnav { display: none; gap: 4px; }
.topnav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.92rem; }
.topnav a:hover { color: var(--ink); background: var(--surface-2); }
.topnav a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); background: var(--surface);
  border-top: 1px solid var(--border); box-shadow: 0 -8px 24px -16px rgb(0 0 0 / 0.25);
}
.tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 0; font-size: 0.72rem; font-weight: 700; color: var(--muted); text-decoration: none; border-radius: 12px; }
.tabbar a span { font-size: 1.25rem; line-height: 1; }
.tabbar a[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
body.has-nav { padding-bottom: 84px; }
@media (min-width: 900px) {
  .topnav { display: flex; }
  .tabbar { display: none; }
  body.has-nav { padding-bottom: 0; }
  .topbar-right .avatar { display: inline-grid; }
}

/* Flash messages */
.flash-wrap { width: 100%; max-width: 720px; margin: 0 auto; padding: 0 16px; }
.flash { margin: 0 0 8px; padding: 12px 14px; border-radius: var(--radius-sm); font-weight: 600; background: var(--ok-soft); color: var(--ok); }
.flash.error { background: var(--danger-soft); color: var(--danger); }

/* Generic rows, grids, helpers */
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.row:last-child { border-bottom: 0; }
.row > span:last-child { white-space: nowrap; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.hint { color: var(--muted); font-size: 0.9rem; margin: -6px 4px 0; }
.empty { color: var(--muted); margin: 4px 0; }
.di-sub { display: block; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
.stack { display: grid; gap: 6px; margin-top: 14px; }
.stack > label, .card > label { font-weight: 700; font-size: 0.92rem; }
.inline { display: inline; }

/* Inputs used outside .field */
.row-form { display: flex; gap: 8px; align-items: center; }
.row-form input, .card > input, .stack input, select, .r-add input, .di-qty input, .meal-when input {
  height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 12px; min-width: 0;
}
.row-form input, .card > input, .stack input[type="search"] { flex: 1; width: 100%; }
select { padding-right: 8px; }
.row-form input:focus, .card > input:focus, .stack input:focus, select:focus, .r-add input:focus, .di-qty input:focus,
.meal-when input:focus {
  outline: none; border-color: var(--brand); background: var(--surface); box-shadow: 0 0 0 4px var(--brand-soft);
}
input[type="file"] { padding: 9px 12px; }

/* Buttons */
.button.small { width: auto; height: 44px; padding: 0 16px; font-size: 0.92rem; white-space: nowrap; }
.button.soft { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.button.soft:hover { filter: saturate(1.2); }
.button.wide { grid-column: 1 / -1; }
a.button { text-decoration: none; }
.icon-button { border: 0; background: none; color: var(--muted); font-size: 0.95rem; cursor: pointer; padding: 6px 8px; border-radius: 10px; }
.icon-button:hover { color: var(--danger); background: var(--danger-soft); }
.chip-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: inherit; font-size: 0.8rem; font-weight: 700; border-radius: 999px; padding: 6px 10px; cursor: pointer; }
.chip-btn:hover { border-color: var(--brand); color: var(--brand); }
.chip.est { background: #fff4d6; color: #8a5a00; border-color: transparent; }
.chip.mine { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chip.est { background: #3a2e12; color: #ffcf6b; }
}
:where(:root[data-theme="dark"]) .chip.est { background: #3a2e12; color: #ffcf6b; }

/* Today */
.pill-link { color: #fff; background: rgb(255 255 255 / 0.22); padding: 5px 12px; border-radius: 999px; font-size: 0.85rem; text-decoration: none; }
.pill-link:hover { background: rgb(255 255 255 / 0.32); }
.stat .of { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.meal { padding: 12px 0; border-bottom: 1px solid var(--border); }
.meal:last-child { border-bottom: 0; }
.items { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.items li { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 0.92rem; }

/* Log meal */
.thinking { color: var(--brand); font-weight: 700; margin: 10px 0 0; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: block; }
.results { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.result { display: grid; gap: 8px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
@media (min-width: 640px) { .result { grid-template-columns: 1fr auto; align-items: center; } }
.r-add { display: flex; gap: 6px; align-items: center; }
.r-add input { width: 64px; }
.draft-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.draft-head h2 { margin: 0; }
.draft-items { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 10px; }
.draft-item { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; align-items: center; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.di-name { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: baseline; }
.di-name .di-sub { flex-basis: 100%; }
.di-qty { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.di-qty input { width: 64px; }

/* Forms with a grid of fields (my foods, body) */
.food-form { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.food-form .field.wide { grid-column: 1 / -1; }
.field select { height: 50px; border-radius: var(--radius-sm); }
fieldset.field { border: 0; padding: 0; margin: 0 0 16px; }
fieldset.field legend { font-weight: 700; font-size: 0.92rem; margin-bottom: 8px; }
fieldset.per { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
fieldset.per legend { flex-basis: 100%; }
.field input:is([type="radio"], [type="checkbox"]) {
  width: 18px; height: 18px; padding: 0; margin: 0; accent-color: var(--brand); box-shadow: none;
}
fieldset.per label {
  display: inline-flex; align-items: center; gap: 8px; font-weight: 600; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid transparent;
}
fieldset.per label:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.scale { display: flex; gap: 8px; flex-wrap: wrap; }
.scale legend { flex-basis: 100%; }
.scale-opt input { position: absolute; opacity: 0; }
.scale-opt span {
  display: inline-grid; place-items: center; width: 46px; height: 46px; border-radius: 14px;
  background: var(--surface-2); font-weight: 800; cursor: pointer; border: 1.5px solid transparent;
}
.scale-opt input:checked + span { background: var(--brand); color: #fff; }
.scale-opt input:focus-visible + span { border-color: var(--brand); }

/* ── Onboarding & goals (step 6) ─────────────────────── */
.card:not(.hero) .pill-link { color: var(--brand); background: var(--brand-soft); }
.onboard { max-width: 640px; margin-inline: auto; }
.onboard-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.onboard .eyebrow { color: var(--muted); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-bottom: 18px; }
.progress span, .bar span { display: block; height: 100%; border-radius: inherit; background: var(--grad); }
.promise { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.promise li { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; }
.stack-form { display: grid; gap: 4px; margin-top: 8px; }
.stack-form .field select, .stack-form textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px 16px;
}
.stack-form textarea { resize: vertical; min-height: 110px; }
fieldset.choices { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
fieldset.choices legend { font-weight: 700; font-size: 0.92rem; margin-bottom: 8px; padding: 0; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: 0.92rem;
  padding: 10px 14px; border-radius: 999px; background: var(--surface-2); border: 1.5px solid transparent;
}
.pill input { position: absolute; opacity: 0; pointer-events: none; }
.pill:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.pill:has(input:focus-visible) { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
.field.check label { display: flex; gap: 12px; align-items: flex-start; font-weight: 600; cursor: pointer; }
.field.check input[type="checkbox"] { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.link-button.skip { display: block; margin: 12px auto 0; color: var(--muted); }
.suggestions { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.suggestion { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid transparent; cursor: pointer; }
.suggestion:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.suggestion input { width: 20px; height: 20px; flex: none; margin-top: 2px; accent-color: var(--brand); }
.s-body { display: grid; gap: 2px; }
.s-area { font-size: 0.78rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.goals { display: grid; gap: 12px; margin-bottom: 16px; }
.goals.compact { margin-bottom: 0; }
@media (min-width: 720px) { .goals { grid-template-columns: 1fr 1fr; } }
.goal { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 6px; }
.goal.paused { opacity: 0.65; }
.goal h3 { margin: 0; font-size: 1rem; }
.goal-head { display: flex; justify-content: space-between; align-items: center; }
.bar { height: 8px; border-radius: 999px; background: var(--border); overflow: hidden; }
.chip.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.chip.behind { background: #fff4d6; color: #8a5a00; border-color: transparent; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chip.behind { background: #3a2e12; color: #ffcf6b; }
}
:where(:root[data-theme="dark"]) .chip.behind { background: #3a2e12; color: #ffcf6b; }
.goal-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.targets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 10px; }
.targets div { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; display: grid; text-align: center; }
.targets strong { font-size: 1.1rem; }
.targets span { color: var(--muted); font-size: 0.8rem; }
.hint.warn { color: #8a5a00; background: #fff4d6; padding: 10px 12px; border-radius: var(--radius-sm); margin: 8px 0; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .hint.warn { color: #ffcf6b; background: #3a2e12; }
}
:where(:root[data-theme="dark"]) .hint.warn { color: #ffcf6b; background: #3a2e12; }
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { display: inline; }
details > summary h2::after { content: " ＋"; color: var(--brand); }
details[open] > summary h2::after { content: " －"; }

/* ── Chat & inbox (step 7) ───────────────────────────── */
.topnav a { position: relative; }
.badge {
  position: absolute; top: -4px; right: -6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 0.7rem; font-weight: 800; display: grid; place-items: center;
}
.tabbar a { position: relative; }
.tabbar .badge { top: 2px; right: 18%; }
.topnav a:has(.badge) { padding-right: 26px; }
.topnav .badge { top: 50%; right: 4px; margin: 0; transform: translateY(-50%); }
.chat { display: flex; flex-direction: column; gap: 10px; }
.chat-head { display: flex; gap: 12px; align-items: center; }
.chat-head h1 { margin: 0; font-size: 1.3rem; }
.thread { display: flex; flex-direction: column; gap: 10px; max-height: min(62vh, 640px); overflow-y: auto; padding: 4px 2px; }
.thread.inbox { max-height: none; margin-bottom: 16px; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 86%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .who {
  flex: none; width: 28px; height: 28px; border-radius: 9px; background: var(--grad); color: #fff;
  font-weight: 800; font-size: 0.8rem; display: grid; place-items: center;
}
.b-body { display: grid; gap: 2px; }
.b-text { padding: 10px 14px; border-radius: 18px; background: var(--surface-2); line-height: 1.45; overflow-wrap: anywhere; }
.msg.assistant .b-text { border-bottom-left-radius: 6px; }
.b-card { display: block; width: 100%; max-width: 360px; height: auto; border-radius: 18px; border: 1px solid var(--border, #efe4da); margin-bottom: 6px; }
.msg.user .b-text { background: var(--grad); color: #fff; border-bottom-right-radius: 6px; }
.msg.user .b-text a { color: #fff; }
.msg.safety .b-text { background: var(--ok-soft); border: 1px solid var(--ok); }
.msg.unread .b-text { border: 1.5px solid var(--brand); }
.msg time { font-size: 0.72rem; color: var(--muted); padding: 0 6px; }
.msg.user time { text-align: right; }
.day-sep { align-self: center; display: flex; justify-content: center; margin: 10px 0 2px; }
.day-sep span { font-size: 0.72rem; font-weight: 700; color: var(--muted); background: var(--surface-2); border-radius: 99px; padding: 3px 10px; }
.thread .earlier { align-self: center; display: flex; justify-content: center; margin: 4px 0 8px; }
.msg.user.failed .b-text { opacity: .6; }
.msg.user.failed time { color: var(--warn, #b4532a); }
.composer { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea {
  flex: 1; resize: none; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent;
  border-radius: 18px; padding: 12px 16px; min-height: 48px; max-height: 160px; field-sizing: content;
}
.composer textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.composer button[disabled] { opacity: 0.6; }
.typing { display: none; gap: 4px; padding: 6px 40px; }
.typing.htmx-request { display: flex; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: blink 1.2s infinite ease-in-out; }
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 80%, 100% { opacity: 0.25; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .typing span { animation: none; opacity: 0.6; } }
.chat-head .tg { margin-left: auto; }
.chat-head .tg form { display: flex; align-items: center; gap: 6px; }
.onboard .button.soft.wide { display: block; text-align: center; margin-bottom: 8px; }

/* ── Voice button & "tell me about you" (onboarding v2) ─ */
.mic-wrap { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.mic {
  display: inline-flex; align-items: center; gap: 6px; font: inherit; font-weight: 700; cursor: pointer;
  padding: 10px 16px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--surface); color: var(--ink);
}
.mic:hover { border-color: var(--brand); color: var(--brand); }
.mic[data-state="recording"] { background: var(--danger); border-color: var(--danger); color: #fff; animation: pulse 1.4s infinite; }
.mic[data-state="working"] { opacity: 0.7; cursor: progress; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(217 45 58 / 0.4); } 50% { box-shadow: 0 0 0 8px rgb(217 45 58 / 0); } }
@media (prefers-reduced-motion: reduce) { .mic[data-state="recording"] { animation: none; } }
.mic-note { font-size: 0.85rem; color: var(--muted); }
.talk { display: grid; gap: 8px; margin: 8px 0 16px; }
.talk-label { font-weight: 700; }
.talk textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent;
  border-radius: var(--radius-sm); padding: 14px 16px; resize: vertical; min-height: 110px; line-height: 1.45;
}
.talk textarea:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.talk-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-form { border-top: 1px dashed var(--border); padding-top: 14px; display: grid; gap: 4px; }
.card-form h2 { margin: 0 0 4px; }
.card-form.just-read { animation: glow 1.6s ease-out 1; border-radius: var(--radius-sm); }
@keyframes glow { from { box-shadow: 0 0 0 6px var(--brand-soft); } to { box-shadow: none; } }
.got-grid { display: grid; gap: 0 14px; }
@media (min-width: 640px) { .got-grid { grid-template-columns: 1fr 1fr; } .got-grid fieldset.choices { grid-column: 1 / -1; } }
/* Units switch (cm · kg or ft · in · lb): both sets are in the form, the checked one shows */
.u-metric, .u-imperial { display: contents; }
form:has(input[name="units"][value="imperial"]:checked) .u-metric,
form:has(input[name="units"][value="metric"]:checked) .u-imperial { display: none; }
.ftin-row { display: flex; gap: 10px; }
.ftin-box { flex: 1; display: flex; align-items: center; gap: 6px; min-width: 0; }
.ftin-box input { flex: 1; min-width: 0; }
.ftin-box > span { color: var(--muted); font-weight: 600; }
.activities .act-head, .activities .act-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px; }
.activities .act-head { font-size: 0.78rem; color: var(--muted); font-weight: 700; margin-bottom: 4px; }
.activities .act-row { margin-bottom: 6px; }
.activities .act-row[hidden] { display: none; }
.activities input { width: 100%; height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); }
.activities input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
.got-sub { margin: 0 0 8px; font-size: 1rem; }
.add-activity { margin: 2px 0 6px; }
.why-box { margin: 14px 0 10px; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.why-box textarea { width: 100%; background: var(--surface); }
.why-box .talk-label { margin-top: 0; }
.aim-recap { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 14px; margin: 0 0 14px; }
.aim-recap p { margin: 0; }
.aim-label { font-size: 0.78rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.aim-wants { font-weight: 700; margin-top: 2px !important; }
.aim-why { font-style: italic; color: var(--ink); margin-top: 2px !important; }
details.more { margin: 6px 0 12px; }
details.more > summary { color: var(--brand); font-weight: 700; padding: 6px 0; }
.stack-form textarea, .card-form textarea { width: 100%; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent; border-radius: var(--radius-sm); padding: 12px 16px; }
.tg-offer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 4px 0 14px; }
.help.center { text-align: center; }
a.avatar { text-decoration: none; }
.ask-portion { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 10px 12px; margin-bottom: 10px; border-radius: var(--radius-sm); background: var(--brand-soft); font-weight: 600; font-size: 0.9rem; }
.mic.icon { padding: 0; width: 44px; height: 44px; justify-content: center; flex: none; }
.mic.icon[data-state="recording"] .mic-label { position: static; width: auto; height: auto; clip: auto; margin: 0; font-size: 0.7rem; }
.plan-head { font-weight: 700; margin: 6px 0 8px; }
.suggestion.warn { border-color: #e6b44c; }
.held p { margin: 0 0 10px; }
.held-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.s-until { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 0 34px; font-size: 0.9rem; }
.s-until input[type="date"] { width: auto; }
.suggestion.off { opacity: 0.6; cursor: not-allowed; }
.s-area .chip { margin-left: 4px; text-transform: none; letter-spacing: 0; }
.card.note { display: flex; gap: 12px; align-items: flex-start; background: var(--grad-soft); }
.card.note .who { flex: none; width: 34px; height: 34px; border-radius: 11px; background: var(--grad); color: #fff; font-weight: 800; display: grid; place-items: center; }
.card.note p { margin: 0; }
.card.note .eyebrow { color: var(--muted); font-size: 0.75rem; margin-bottom: 2px; }

/* ── weekly plan ─────────────────────────────────────────────────────── */
.week-days { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 8px; }
.wd { display: grid; grid-template-columns: 56px 1fr; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.wd.today { border-color: var(--brand); background: var(--brand-soft); }
.wd-day { font-weight: 800; display: flex; flex-direction: column; line-height: 1.2; }
.wd-day small { font-weight: 600; color: var(--muted); font-size: 0.75rem; }
.wd-body { display: grid; gap: 6px; min-width: 0; }
.wd-session { display: flex; gap: 10px; align-items: flex-start; }
.wd-session.done .wd-what strong { text-decoration: line-through; color: var(--muted); }
.wd-what { min-width: 0; }
.wd-what .di-sub { display: block; }
.wd-rest { color: var(--muted); }
.tick { width: 26px; height: 26px; flex: none; border-radius: 8px; border: 2px solid var(--border); background: var(--surface); color: var(--ok); font-weight: 900; cursor: pointer; padding: 0; }
.tick[aria-pressed="true"] { background: var(--ok-soft); border-color: var(--ok); }
.chip.i-hard { background: #ffe3dc; color: #a33a1a; border-color: transparent; }
.chip.i-easy { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.week-numbers { display: flex; flex-wrap: wrap; gap: 8px 16px; font-weight: 700; margin: 8px 0; }
.plan-notes { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 4px; font-size: 0.9rem; color: var(--muted); }
.today-plan .wd-session { margin-top: 6px; }

/* ── progress ────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 6px; margin-bottom: 16px; background: var(--surface-2); padding: 4px; border-radius: 999px; width: fit-content; }
.tabs a { padding: 6px 16px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 700; }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }
.results { list-style: none; padding: 0; margin: 8px 0 12px; display: grid; gap: 8px; }
.result { display: flex; gap: 12px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.r-mark { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 8px; font-weight: 900; background: var(--surface-2); color: var(--muted); }
.result.hit .r-mark { background: var(--ok-soft); color: var(--ok); }
.result.miss .r-mark { background: #ffe3dc; color: #a33a1a; }
.r-body { display: grid; min-width: 0; }
.outlook { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: -4px 0 4px; font-size: 0.9rem; padding: 0 4px; }
.chip.behind { background: #fff4d6; color: #8a5a00; border-color: transparent; }
.chart { margin: 8px 0 4px; }
.chart svg { width: 100%; height: auto; background: var(--surface-2); border-radius: 12px; }
.chart figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 4px; }
.key.trend::before, .key.expected::before { content: ""; display: inline-block; width: 16px; height: 3px; vertical-align: middle; margin-right: 4px; background: var(--brand); }
.key.expected::before { background: var(--muted); }
.muted { color: var(--muted); }
.week-targets { list-style: none; padding: 0; margin: 6px 0 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.week-targets li { background: var(--surface-2); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 0.9rem; }
.topnav a { white-space: nowrap; }
.goal .outlook { margin: 2px 0 0; padding: 0; font-size: 0.85rem; }

/* ── check-in moments ────────────────────────────────────────────────── */
.moments { display: grid; gap: 8px; }
.moment { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.moment .m-on { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; min-width: 0; }
.moment .m-on > span { display: grid; }
.moment input[type="time"] { width: 10rem; min-width: 0; }
.moment .error { grid-column: 1 / -1; margin: 0; }

/* ── usual days ──────────────────────────────────────────────────────── */
.usual-days { display: grid; gap: 12px; margin-top: 16px; }
.usual-day { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 6px; }
.usual-day header { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.usual-meals { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.usual-meals li { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 8px; align-items: baseline; font-size: 0.92rem; }
.um-type { font-weight: 700; color: var(--muted); }
.um-what { min-width: 0; }
.um-num { white-space: nowrap; color: var(--muted); }
.um-check { grid-column: 2 / -1; margin: 0; font-size: 0.85rem; }
@media (max-width: 480px) { .um-check { grid-column: 1 / -1; } }
.usual-total { margin: 4px 0 0; font-weight: 700; }
.skip-form { margin-top: 12px; text-align: center; }
@media (max-width: 480px) { .usual-meals li { grid-template-columns: 1fr auto; } .um-type { grid-column: 1 / -1; } }

/* ── patterns ────────────────────────────────────────────────────────── */
.pattern { border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; display: grid; gap: 4px; margin-bottom: 10px; }
.pattern header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pattern p { margin: 0; }
.pattern.fixed { background: var(--ok-soft); border-color: transparent; }

/* Tell Max with Siri */
.siri-steps { padding-left: 1.2rem; display: grid; gap: 14px; margin: 12px 0 18px; }
.siri-steps h2 { font-size: 1.05rem; margin: 0 0 6px; }
.siri-steps p { margin: 4px 0; }
.key-box { display: flex; gap: 8px; align-items: center; }
.key-box input { flex: 1; min-width: 0; height: 44px; padding: 0 12px; font: 0.9rem ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--brand); border-radius: var(--radius-sm); }
.plain-list { padding-left: 1.1rem; margin: 6px 0; display: grid; gap: 6px; }
.siri code { font-size: 0.85em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; word-break: break-all; }
.siri-off { margin: 12px 0; }

/* Daily checklist */
.tick { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--brand); background: var(--surface); color: #fff; font-weight: 800; cursor: pointer; }
.routine-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.routine details { background: var(--surface-2); border-radius: var(--radius-sm); padding: 10px 12px; }
.routine summary { cursor: pointer; display: grid; gap: 2px; }
.routine-form .choices .pills { flex-wrap: wrap; }
.stop-form { margin-top: 6px; }
.tomorrow h2 { font-size: 1.05rem; margin: 18px 0 6px; }
.max-reply { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 14px; margin: 10px 0; }
.max-reply .you-said { color: var(--muted); font-size: 0.9rem; margin: 0 0 6px; }

/* ═══ Design refresh 2026-11-11: one calm day view ═══════════════════════════════════════════════════
   Fewer, quieter surfaces: one header with the numbers, one "tell Max" box, the day as a timeline.
   The brand gradient is kept for the few things that matter (the calorie ring, primary actions). */

:root { --line: color-mix(in srgb, var(--border) 85%, var(--muted)); --ring-track: var(--surface-2); --water: #2f9bff; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --water: #5cb4ff; }
}
:root:where([data-theme="dark"]) { --water: #5cb4ff; }
body { background: radial-gradient(900px 480px at 100% -15%, var(--bg-glow), transparent 60%), var(--bg); }
.page { gap: 14px; }
.card { padding: 20px 18px; }
@media (min-width: 600px) { .card { padding: 24px; } }
.chip.soft { background: var(--surface-2); color: var(--muted); font-weight: 700; font-size: 0.7rem; padding: 2px 8px; vertical-align: middle; }
.ok-text { color: var(--ok); font-weight: 700; }
.warn-text { color: #c77700; font-weight: 700; }

/* Header: date, hello, the day's numbers */
.today-head { display: grid; gap: 12px; padding: 4px 2px 2px; }
.round-link { display: inline-grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); text-decoration: none; font-weight: 800; }
.round-link.wide { font-size: 0.85rem; }
.numbers { display: grid; grid-template-columns: 132px 1fr; gap: 18px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
@media (max-width: 380px) { .numbers { grid-template-columns: 112px 1fr; gap: 14px; } }

/* One box to tell Max anything */
.tell-box { display: flex; gap: 8px; align-items: center; background: var(--surface); border: 1.5px solid var(--border); border-radius: 999px; padding: 6px 6px 6px 16px; box-shadow: var(--shadow); }
.tell-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.tell-box input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--ink); padding: 8px 0; outline: none; }
.tell-box .mic-wrap { display: contents; }
.tell-box .mic { padding: 8px 12px; min-height: 0; }
.tell-box .mic .mic-label { display: none; }
.tell-box .mic-note { display: none; }
.tell-box.in-card { margin: 0 0 18px; box-shadow: none; }

/* The day as a timeline */
.day-total { margin: 12px 0 0; font-weight: 700; font-size: 0.92rem; display: grid; gap: 4px; }
.day-total .tip { font-weight: 500; color: var(--muted); }

/* Log hub */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { display: grid; gap: 2px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--ink); text-decoration: none; }
.tile span { font-size: 1.4rem; }
.tile small { color: var(--muted); font-weight: 500; }
.tile:hover { outline: 2px solid var(--brand-soft); }

/* Navigation: Today · Plan · + · Max · Progress */
.topnav .nav-log { background: var(--grad); color: #fff; margin-left: 6px; }
.topnav .nav-log:hover, .topnav .nav-log[aria-current="page"] { color: #fff; background: var(--grad); filter: saturate(1.15); }
.tabbar .tab-log { align-self: center; justify-self: center; width: 52px; height: 52px; border-radius: 50%; background: var(--grad); color: #fff; box-shadow: var(--shadow-brand); place-items: center; padding: 0; margin-top: -18px; }
.tabbar .tab-log span { font-size: 1.8rem; font-weight: 400; line-height: 1; }
.tabbar .tab-log[aria-current="page"] { background: var(--grad); color: #fff; }
/* Plan sections */
.seg { display: flex; gap: 6px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.seg a { flex: none; padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.88rem; }
.tracker .seg a[aria-current="page"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }

/* ── Things I keep in mind (About me) ─────────────────── */
.memories { list-style: none; margin: 8px 0 12px; padding: 0; }
.memories li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.memories li:last-child { border-bottom: 0; }

/* ── Usage page (admins) ──────────────────────────────── */
.kpis { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.kpis li { background: var(--surface-2); border-radius: 14px; padding: 12px 14px; display: grid; gap: 2px; }
.k-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.k-value { font-size: 1.4rem; font-weight: 800; color: var(--ink); }
.k-value.bad, .admin-links small.bad { color: #d64545; }
.k-sub { font-size: 0.8rem; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table.usage { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.usage th, table.usage td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.usage thead th { font-size: 0.75rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.errors-list { list-style: none; margin: 0; padding: 0; }
.errors-list li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.k-value.warn { color: #b7791f; }
table.usage td.num, table.usage th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.usage tr.quiet th { color: var(--muted); }
.state { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: 0.75rem; font-weight: 700; background: var(--surface-2); color: var(--muted); }
.state.warn { color: #8a5a00; background: #fff4d6; }
.state.bad { color: #a32020; background: #fde4e4; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .state.warn { color: #ffcf6b; background: #3a2e12; }
  :where(:root:not([data-theme="light"])) .state.bad { color: #ff9b9b; background: #3d1a1a; }
}
:where(:root[data-theme="dark"]) .state.warn { color: #ffcf6b; background: #3a2e12; }
:where(:root[data-theme="dark"]) .state.bad { color: #ff9b9b; background: #3d1a1a; }
.funnel { list-style: none; margin: 0; padding: 0; }
.funnel li { padding: 8px 0; border-bottom: 1px solid var(--line); }
.funnel .names { color: var(--muted); font-size: 0.9rem; }
.day-bar { display: inline-block; vertical-align: middle; width: 64px; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-right: 6px; }
.day-bar > span { display: block; height: 100%; background: var(--accent, #2f855a); border-radius: 999px; }
table.usage tr.so-far th, table.usage tr.so-far td { color: var(--muted); }
table.usage tr.weekend th { font-style: italic; }
.usage-split > * { min-width: 0; }
ul.defs { padding-left: 18px; display: grid; gap: 4px; }
.usage-split { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

/* ── Meal date and time (log page) ────────────────────── */
.meal-when { display: grid; grid-template-columns: auto 1fr auto 1fr; gap: 6px 10px; align-items: center; margin: 4px 0 12px; }
.meal-when label { font-size: 0.85rem; color: var(--muted); font-weight: 700; }
.meal-when input { width: 100%; min-width: 0; }
@media (max-width: 420px) { .meal-when { grid-template-columns: auto 1fr; } }

/* ── Weight & body (log body) ─────────────────────────── */
.measure { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; border: 0; padding: 0; margin: 0 0 8px; }
.measure legend { font-weight: 800; margin-bottom: 6px; }
@media (min-width: 640px) { .measure { grid-template-columns: repeat(3, 1fr); } }
.di-qty .each { display: inline-flex; align-items: center; gap: 4px; font-size: 0.85rem; color: var(--muted); }
.di-qty .each input { width: 3.5em; }

/* ── Baby steps note (Today) ─────────────────────────── */
.step-note { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; margin: 6px 4px 0; font-size: 0.9rem; color: var(--muted); }
.step-note strong { color: var(--ink); }

/* ═══ Calm design 2026-11-12 ═══════════════════════════════════════════════════════════════════════
   Warm paper ground, white cards, deep ink, ONE accent (pine). Amber = carbs, slate = fat. Inter with
   tabular numbers. No gradients or emoji in the chrome. Primary actions are ink pills; the accent marks
   what's done, selected or growing. Overrides the tokens and components above (last rule wins). */

:root {
  --bg: #F6F4EF; --bg-glow: #F6F4EF; --surface: #FFFFFF; --surface-2: #F1EEE7;
  --ink: #15171C; --muted: #5F636B; --border: #E8E4DC; --line: #EEEBE4;
  --brand: #1F6B52; --brand-ink: #FFFFFF; --brand-soft: #E3EFE9; --brand-deep: #174F3D;
  --carbs: #B4602B; --carbs-text: #9A4F22; --fat: #3E5C8A; --water: #3E5C8A;
  --grad: var(--brand); --grad-soft: var(--brand-soft);
  --danger: #B42318; --danger-soft: #FBEAE7; --ok: #1F6B52; --ok-soft: #E3EFE9;
  --warn: #8A4B1A; --warn-soft: #F6E9DF;
  --radius: 22px; --radius-sm: 14px; --ring-track: #EEEBE4;
  --shadow: 0 1px 2px rgb(21 23 28 / 0.04); --shadow-brand: none;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --bg: #111312; --bg-glow: #111312; --surface: #1A1D1B; --surface-2: #232724;
    --ink: #F2F1EC; --muted: #A6A9A2; --border: #2C302D; --line: #2C302D;
    --brand: #5DBB97; --brand-ink: #0E1A15; --brand-soft: #1D3329; --brand-deep: #8ED3B6;
    --carbs: #D9935F; --carbs-text: #E3A574; --fat: #8FA8D6; --water: #8FA8D6;
    --danger: #FF8A80; --danger-soft: #3A1E1B; --ok: #5DBB97; --ok-soft: #1D3329;
    --warn: #E3A574; --warn-soft: #33261B; --ring-track: #2C302D;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3); }
}
:root:where([data-theme="dark"]) { --bg: #111312; --bg-glow: #111312; --surface: #1A1D1B; --surface-2: #232724;
    --ink: #F2F1EC; --muted: #A6A9A2; --border: #2C302D; --line: #2C302D;
    --brand: #5DBB97; --brand-ink: #0E1A15; --brand-soft: #1D3329; --brand-deep: #8ED3B6;
    --carbs: #D9935F; --carbs-text: #E3A574; --fat: #8FA8D6; --water: #8FA8D6;
    --danger: #FF8A80; --danger-soft: #3A1E1B; --ok: #5DBB97; --ok-soft: #1D3329;
    --warn: #E3A574; --warn-soft: #33261B; --ring-track: #2C302D;
    --shadow: 0 1px 2px rgb(0 0 0 / 0.3); }

body { background: var(--bg); font: 16px/1.5 var(--font); font-variant-numeric: tabular-nums; letter-spacing: -0.005em; }
a { color: var(--brand); font-weight: 600; }
h1, h2, h3 { letter-spacing: -0.02em; font-weight: 700; }

/* Shell */
.brand-mark { background: var(--ink); color: var(--bg); box-shadow: none; border-radius: 11px; }
.avatar { background: var(--brand-soft); color: var(--brand-deep); }
.topnav a { font-weight: 600; }
.topnav a[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.topnav .nav-log, .topnav .nav-log:hover, .topnav .nav-log[aria-current="page"] { background: var(--ink); color: var(--bg); filter: none; }
.tabbar { box-shadow: none; padding-top: 4px; }
.tabbar a { font-weight: 500; font-size: 0.7rem; gap: 3px; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a[aria-current="page"] { color: var(--brand); background: none; font-weight: 700; }
.tabbar .tab-log, .tabbar .tab-log[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; margin-top: -14px; }
.tabbar .tab-log svg { width: 22px; height: 22px; }
.badge { background: var(--carbs); }

/* Surfaces */
.card, .numbers { border: 0; box-shadow: var(--shadow); border-radius: var(--radius); }
.flash { background: var(--brand-soft); color: var(--brand-deep); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.hint.warn { background: var(--warn-soft); color: var(--warn); }
.chip.est, .chip.behind { background: var(--warn-soft); color: var(--warn); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .chip.est, :where(:root:not([data-theme="light"])) .chip.behind, :where(:root:not([data-theme="light"])) .hint.warn { background: var(--warn-soft); color: var(--warn); }
}
:where(:root[data-theme="dark"]) .chip.est, :where(:root[data-theme="dark"]) .chip.behind, :where(:root[data-theme="dark"]) .hint.warn { background: var(--warn-soft); color: var(--warn); }

/* Buttons: ink pills for the one main action; quiet outlines for the rest */
.button.primary { background: var(--ink); color: var(--bg); box-shadow: none; border-radius: 999px; }
.button.primary:hover { filter: none; opacity: 0.92; }
.button.soft { background: var(--surface); color: var(--ink); border: 1px solid var(--border); }
.button.soft:hover { border-color: var(--ink); filter: none; }
.chip-btn { font-weight: 600; }
.chip-btn:hover { border-color: var(--ink); color: var(--ink); }
.link-button { color: var(--brand); font-weight: 600; }

/* Inputs */
.row-form input, .card > input, .stack input, select, .r-add input, .di-qty input, .meal-when input { background: var(--surface-2); border-radius: 12px; }
.row-form input:focus, .card > input:focus, .stack input:focus, select:focus, .r-add input:focus, .di-qty input:focus,
.meal-when input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px var(--line); }

/* Today: the numbers */
.numbers { gap: 20px; padding: 18px 20px; }
.step-note { margin: 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-deep); font-size: 0.86rem; align-items: center; }
.step-note strong { color: var(--brand-deep); }
.step-note svg { flex: none; }
.step-note .link-button { color: var(--brand-deep); text-decoration: underline; border: 0; padding: 0; font-weight: 600; }
.mic svg { display: block; }
.tell-box { border: 0; padding: 6px 6px 6px 18px; }
.tell-box:focus-within { box-shadow: 0 0 0 3px var(--line); }
.tell-box .button.primary, .tell-box button[type="submit"] { background: var(--brand); color: var(--brand-ink); }

/* Today: the day */
.progress span, .bar span { background: var(--brand); }

/* Chat */
.msg.user .b-text { background: var(--brand); color: var(--brand-ink); }
.msg .who, .card.note .who { background: var(--ink); color: var(--bg); }
.card.note { background: var(--surface); }

/* Log food: macros line and the sticky main action */
.draft-item .di-sub strong { color: var(--ink); }
.tracker .seg a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.tile { background: var(--surface); box-shadow: var(--shadow); }
.tile:hover { outline: 2px solid var(--line); }
/* The welcome panel keeps a deep pine in both modes so white text always reads. */
.brand-panel { background: #1F6B52; color: #FFFFFF; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .brand-panel { background: #17382C; }
}
:where(:root[data-theme="dark"]) .brand-panel { background: #17382C; }
/* Never wider than the phone, whatever font the device falls back to: grid columns may shrink below their
   content, and long words wrap. (CI's Linux fonts once pushed Today 14 px past a 390 px screen.) */
.numbers { grid-template-columns: 132px minmax(0, 1fr); }
@media (max-width: 380px) { .numbers { grid-template-columns: 112px minmax(0, 1fr); } }
.page { min-width: 0; }  /* (its max-width stays: a centred column on desktop) */
/* The Tell Max bar can't push past the screen: the text box starts at 0 and takes what's left. */
.tell-box { min-width: 0; max-width: 100%; }
.tell-box input { width: 0; flex: 1 1 0; min-width: 0; }
.tell-box > button, .tell-box .mic { flex: none; }
@media (max-width: 400px) { .tell-box .button.small { padding: 0 14px; } }

/* ── Log food, like the samples: stepper, unit tabs, meal chips, macro tiles ── */
.meal-meta { display: grid; gap: 10px; margin: 2px 0 14px; }
.seg-tabs { display: flex; flex-wrap: wrap; gap: 4px; border: 0; margin: 0; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.seg-tab { position: relative; flex: 1 1 auto; }
.seg-tab input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-tab span { display: block; text-align: center; padding: 8px 10px; border-radius: 10px; font-size: 0.86rem; font-weight: 500; color: var(--muted); white-space: nowrap; }
.seg-tab input:checked + span { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgb(21 23 28 / 0.08); }
.seg-tab input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
.draft-item { flex-wrap: wrap; }
.draft-item .di-qty { display: grid; gap: 8px; width: 100%; }
.stepper { display: flex; align-items: center; gap: 8px; }
.step-btn { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: 400 1.4rem/1 var(--font); cursor: pointer; }
.step-btn.plus { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.di-qty .step-value { width: 4.5rem; text-align: center; font-size: 1.15rem; font-weight: 700; }
.seg-tabs.units .seg-tab span { padding: 6px 8px; font-size: 0.8rem; }
.di-qty .each { font-size: 0.82rem; }
.macro-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 14px 0 12px; }
.macro-tiles .mt { display: grid; gap: 1px; padding: 10px; border-radius: 14px; background: var(--surface-2); }
.macro-tiles .mt strong { font-size: 1.05rem; font-weight: 700; }
.macro-tiles .mt span { font-size: 0.75rem; color: var(--muted); }
.macro-tiles .mt.kcal { background: var(--ink); }
.macro-tiles .mt.kcal strong, .macro-tiles .mt.kcal span { color: var(--bg); }
.macro-tiles .mt.p strong { color: var(--brand); }
.macro-tiles .mt.c strong { color: var(--carbs-text); }
.macro-tiles .mt.f strong { color: var(--fat); }

/* ── Weight & body, like the samples ──────────────────── */
.weigh { border: 0; margin: 0 0 6px; padding: 18px 12px; border-radius: var(--radius); background: var(--surface-2); display: grid; justify-items: center; gap: 8px; }
.weigh-label { font-size: 0.85rem; font-weight: 500; color: var(--muted); }
.weigh-row { display: flex; align-items: center; gap: 16px; }
.weigh-num { display: inline-flex; align-items: baseline; gap: 6px; }
.weigh-num input { width: 7.5rem; text-align: right; border: 0; background: transparent; font: 700 2.6rem/1.1 var(--font); letter-spacing: -0.03em; color: var(--ink); padding: 0; }
.weigh-num input::placeholder { color: var(--muted); opacity: 0.7; }
.weigh-num span { font-weight: 600; color: var(--muted); }
.help.center { text-align: center; margin: 0; }
.list-rows { display: grid; border-radius: var(--radius); background: var(--surface-2); padding: 2px 14px; }
.list-rows .lr { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-weight: 500; }
.list-rows .lr:last-child { border-bottom: 0; }
.list-rows input { height: 38px; border-radius: 10px; border: 0; background: var(--surface); font: 600 0.95rem var(--font); color: var(--ink); padding: 0 10px; min-width: 0; }
.lr-in { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.lr-in input { width: 5rem; text-align: right; }
.trend-card { border-radius: var(--radius); background: var(--surface-2); padding: 14px 16px; color: var(--brand); }
.trend-card .tc-head { display: flex; justify-content: space-between; align-items: baseline; color: var(--ink); }
.trend-card .help { color: var(--muted); margin: 4px 0 0; }

/* ── Chat, like the samples: no box around it, white bubbles on paper, a pill composer ── */
.card.chat { background: transparent; box-shadow: none; padding: 4px 0 0; gap: 12px; }
.chat-head { padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.chat-head .brand-mark { width: 44px; height: 44px; border-radius: 50%; font-size: 1.1rem; }
.thread { max-height: min(64vh, 680px); padding: 6px 2px; gap: 12px; }
.msg.assistant .b-text { background: var(--surface); box-shadow: var(--shadow); border-radius: 20px 20px 20px 6px; }
.msg.user .b-text { background: var(--brand); color: var(--brand-ink); border-radius: 20px 20px 6px 20px; }
.msg .who { display: none; }
.msg { max-width: 82%; }
.msg.safety .b-text { background: var(--brand-soft); border: 1px solid var(--brand); }
.msg.unread .b-text { border: 1.5px solid var(--brand); }
.composer { align-items: center; background: var(--surface); border-radius: 28px; padding: 6px; box-shadow: var(--shadow); }
.composer textarea { background: transparent; border: 0; padding: 12px 10px 12px 14px; min-height: 44px; }
.composer textarea:focus { background: transparent; border: 0; }
.composer:focus-within { box-shadow: 0 0 0 3px var(--line); }
.composer .mic.icon { width: 44px; height: 44px; border-radius: 50%; padding: 0; display: grid; place-items: center; background: var(--surface-2); border: 0; color: var(--ink); flex: none; }
.composer .button.primary.small { border-radius: 999px; background: var(--brand); color: var(--brand-ink); flex: none; }
/* Search results on a phone: the name on top, then amount · unit · Add on one row. */
.result:has(.r-add) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.r-add { display: flex; gap: 8px; align-items: center; }
.r-add input[name="quantity"] { width: 4.5rem; flex: none; text-align: center; }
.r-add select { flex: 1 1 auto; min-width: 0; }
@media (min-width: 640px) { .result:has(.r-add) { grid-template-columns: minmax(0, 1fr) auto; align-items: center; } .r-add select { flex: none; } }
.di-qty .each input { width: 4.5rem; text-align: center; }

/* Welcome panel list: line icons in soft squares */
.features li { font-weight: 500; align-items: flex-start; line-height: 1.4; }
.features .icon { background: rgb(255 255 255 / 0.14); color: #FFFFFF; display: grid; place-items: center; flex: none; }

/* ── My foods, Google Health style ───────────────────── */
.food-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; }
.food-list li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.food-list li:last-child { border-bottom: 0; }
.fl-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.fl-main b { color: var(--ink); font-weight: 600; }
.create-food { display: grid; gap: 12px; }
.cf-amount { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 10px; align-items: end; }
.cf-amount .field { margin: 0; }
@media (max-width: 520px) { .cf-amount { grid-template-columns: minmax(0, 1fr); } }
.cf-macros { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .cf-macros { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cf-for { margin: 0; }
.cf-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cf-actions .button { flex: 1 1 10rem; }

/* ── Goal edit ────────────────────────────────────────── */
.goal-edit { margin-top: 8px; }
.goal-edit > summary { color: var(--brand); font-weight: 600; font-size: 0.9rem; }
.ge-form { display: grid; gap: 4px; margin: 8px 0; }
.ge-confirm { display: flex; gap: 8px; align-items: center; font-size: 0.85rem; color: var(--muted); }
.ge-actions { display: flex; gap: 8px; margin-top: 6px; }
.link-button.danger { color: var(--danger); border: 0; padding: 4px 0; }
.brand-panel .pill { background: rgb(255 255 255 / 0.16); color: #FFFFFF; }

/* ── Max suggests (Today) ─────────────────────────────── */
.suggest .sg { padding: 12px 0; border-top: 1px solid var(--line); }
.suggest .sg:first-of-type { border-top: 0; }
.suggest .sg p { margin: 0 0 10px; }

/* Rarely needed body fields stay folded away. */
.more-fields > summary { cursor: pointer; font-size: 0.88rem; font-weight: 600; color: var(--brand); padding: 4px 0; }
.more-fields[open] > summary { margin-bottom: 8px; }
.add-routine > summary { cursor: pointer; list-style: none; }
.add-routine > summary h2 { display: inline; }
.add-routine > summary::after { content: " ›"; color: var(--muted); }
.add-routine[open] > summary::after { content: " ⌄"; }
.tl-link { color: inherit; text-decoration: none; }
.tl-link:hover, .tl-link:focus-visible { text-decoration: underline; }
.back-link { margin: 0 0 8px; font-weight: 600; }

/* Review 4: water undo, usual-day weekday picks, placeholder meals */
.warn-box { background: var(--warn-soft); color: var(--warn); padding: 10px 12px; border-radius: var(--radius-sm); }
.change-days { margin-top: 8px; }
.change-days summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 0.9rem; }
.day-picks { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.day-pick { display: inline-flex; }
.day-pick input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-pick span { padding: 6px 10px; border-radius: 999px; border: 1px solid var(--border); font-weight: 600; font-size: 0.85rem; cursor: pointer; }
.day-pick input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.day-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.siri-adds { display: flex; flex-wrap: wrap; gap: 8px; }
.siri-adds .button { flex: 0 1 auto; }
/* Inputs: a visible edge in dark mode, where the fill sits close to the card */
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .field input, :where(:root:not([data-theme="light"])) .row-form input, :where(:root:not([data-theme="light"])) .card > input, :where(:root:not([data-theme="light"])) .stack input, :where(:root:not([data-theme="light"])) select, :where(:root:not([data-theme="light"])) .r-add input, :where(:root:not([data-theme="light"])) .di-qty input, :where(:root:not([data-theme="light"])) .meal-when input, :where(:root:not([data-theme="light"])) .talk textarea, :where(:root:not([data-theme="light"])) .stack-form textarea, :where(:root:not([data-theme="light"])) .card-form textarea { border-color: rgb(255 255 255 / 0.14); }
}
:where(:root[data-theme="dark"]) .field input, :where(:root[data-theme="dark"]) .row-form input, :where(:root[data-theme="dark"]) .card > input, :where(:root[data-theme="dark"]) .stack input, :where(:root[data-theme="dark"]) select, :where(:root[data-theme="dark"]) .r-add input, :where(:root[data-theme="dark"]) .di-qty input, :where(:root[data-theme="dark"]) .meal-when input, :where(:root[data-theme="dark"]) .talk textarea, :where(:root[data-theme="dark"]) .stack-form textarea, :where(:root[data-theme="dark"]) .card-form textarea { border-color: rgb(255 255 255 / 0.14); }
form.card, .card form.stack:last-child, .card details[open] > form:last-child { padding-bottom: 8px; }
.change-days + .hint, .usual-day .change-days { margin-bottom: 8px; }

/* One meal eaten in bits, and ticked habits, fold into one row */
.icon-button.small { width: 26px; height: 26px; font-size: 0.8rem; }

/* This week, before a plan: the usual days laid out */
.usual-week { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 2px; }
.usual-week li { display: grid; grid-template-columns: 4.2rem minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 8px 10px; border-radius: var(--radius-sm); font-size: 0.9rem; }
.usual-week li.today { background: var(--brand-soft); }
.usual-week li.past { opacity: 0.55; }
.usual-week .uw-day { font-weight: 700; font-variant-numeric: tabular-nums; }
.usual-week .uw-day small { color: var(--brand); font-weight: 700; }
.usual-week .uw-num { color: var(--muted); font-size: 0.82rem; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 380px) { .usual-week li { grid-template-columns: 3.6rem minmax(0, 1fr); } .usual-week .uw-num { grid-column: 2; text-align: left; } }
.flash.warning { background: var(--warn-soft); color: var(--warn); }
/* Chat: the day you're reading stays pinned at the top of the thread */
.thread .day-sep { position: sticky; top: 0; z-index: 2; margin: 6px 0 0; pointer-events: none; }
.thread .day-sep span { box-shadow: 0 1px 4px rgb(0 0 0 / 0.08); }
/* Progress: switching Day / Week / Month doesn't shift the page sideways (scrollbar coming and going)
   and lands back on the period card instead of the top */
html { scrollbar-gutter: stable; }
.chart { width: 100%; overflow: hidden; }

/* Spacing sweep (13 Nov): hints sit under what they explain, aligned with the text, not tucked under it */
.hint { margin: 8px 0 0; }
.field + .hint, .talk + .hint { margin-top: -6px; }
.usual-total + .hint, .usual-total + .di-sub { margin-top: 6px; }
.um-vague { color: var(--muted); font-style: italic; }
/* chips never break across lines ("planned · not counted yet") */
.chip { white-space: nowrap; display: inline-block; }
/* the Tell Max box inside a card has its own fill, so it doesn't vanish into the card */
.card .tell-box, .tell-box.in-card { background: var(--surface-2); }
/* goal cards in a row start at the top: a short card isn't spread out to match a tall neighbour */
.goal { align-content: start; }
.goal-head { min-height: 28px; }
/* About me check-in times: on a phone the time sits under its text, full width, so neither is squeezed */
@media (max-width: 480px) {
  .moment { grid-template-columns: 1fr; }
  .moment input[type="time"] { width: 100%; }
}
/* on the timeline the chip gets its own line under the title, wrapping inside itself if it must */
legend { padding: 0; }
fieldset { min-width: 0; }
/* Siri page on wider screens: buttons sized to their words, side by side, not full-width bars */
@media (min-width: 640px) {
  .siri-steps .button { width: auto; padding: 0 24px; }
  .siri-adds { flex-wrap: nowrap; }
}
/* Usual days: each meal opens its editor; "+ Add a meal" under each kind */
.um-editable .um-what a { color: inherit; text-decoration: none; }
.um-editable .um-what a:hover, .um-editable .um-what a:focus-visible { text-decoration: underline; }
.add-usual-meal { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.add-usual-meal select { flex: 0 1 auto; }

/* My foods: edit; portion sizes edit/forget */
.food-list li > .button { flex: none; }
.portion-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.portion-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.portion-edit { display: flex; align-items: center; gap: 8px; }
.portion-edit input { width: 5rem; height: 40px; }
/* Body & mood: today's entries, each changeable or removable */
.entry-list { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; gap: 4px; }
.entry-list li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.entry-list .el-time { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.entry-list .el-edit { display: flex; align-items: center; gap: 6px; }
.entry-list .el-edit input { width: 4.5rem; height: 36px; }
.entry-list .el-unit, .entry-list .el-value { font-size: 0.85rem; color: var(--muted); }
@media (max-width: 420px) { .entry-list li { grid-template-columns: 2.8rem minmax(0, 1fr) auto; } .entry-list .el-edit, .entry-list .el-value { grid-column: 2; } }
.mem-edit { flex: 1; min-width: 0; }
.mem-edit summary { list-style: none; cursor: pointer; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.mem-edit summary::-webkit-details-marker { display: none; }
.mem-edit[open] summary .link-button { display: none; }
.mem-edit .row-form { margin-top: 6px; }
.portion-edit input, .entry-list .el-edit input, .mem-edit input {
  height: 40px; padding: 0 10px; font: inherit; color: var(--ink); background: var(--surface-2);
  border: 1.5px solid transparent; border-radius: 12px; min-width: 0;
}
.portion-edit input:focus, .entry-list .el-edit input:focus, .mem-edit input:focus { outline: none; border-color: var(--brand); background: var(--surface); }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .portion-edit input, :where(:root:not([data-theme="light"])) .entry-list .el-edit input, :where(:root:not([data-theme="light"])) .mem-edit input { border-color: rgb(255 255 255 / 0.14); }
}
:where(:root[data-theme="dark"]) .portion-edit input, :where(:root[data-theme="dark"]) .entry-list .el-edit input, :where(:root[data-theme="dark"]) .mem-edit input { border-color: rgb(255 255 255 / 0.14); }

/* ── Plan pages (Tomorrow, This week, Usual days, Checklist): content first, one card per section,
      roomy rows that stay on one line on a phone ─────────────────────────────────────────────── */
.page-head h1 { margin: 0; }
.page-head .ph-sub { color: var(--muted); margin: 6px 0 14px; font-size: 0.95rem; line-height: 1.45; }
.page-head .tell-box { margin-bottom: 0; }
.page-head .max-reply { margin-top: 14px; }
.plan-section { padding-top: 18px; }
.ps-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.ps-head h2 { margin: 0; font-size: 1.1rem; }
.ps-sum { font-weight: 700; font-size: 0.92rem; font-variant-numeric: tabular-nums; }
.plan-section .empty { margin: 8px 0 0; }
.plan-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.plan-rows li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 13px 0; border-bottom: 1px solid var(--line); }
.plan-rows li:last-child { border-bottom: 0; }
.plan-rows li:only-child, .plan-rows li:has(.pr-what:only-child) { grid-template-columns: minmax(0, 1fr); }
.plan-rows .pr-what { min-width: 0; line-height: 1.4; }
.plan-rows .pr-what small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.plan-rows .pr-num { color: var(--muted); font-size: 0.88rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) {
  .plan-rows li { grid-template-columns: 5.2rem minmax(0, 1fr) auto; gap: 10px; }
}
.plan-section .routine-list { gap: 0; margin-top: 4px; }
.plan-section .routine { border-bottom: 1px solid var(--line); }
.plan-section .routine:last-child { border-bottom: 0; }
.plan-section .routine details { background: none; border-radius: 0; padding: 0; }
.plan-section .routine summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; }
.plan-section .routine summary::-webkit-details-marker { display: none; }
.plan-section .rt-main { display: grid; gap: 3px; min-width: 0; }
.plan-section .rt-main strong { font-size: 1rem; }
.plan-section .rt-amount { color: var(--ink); font-size: 0.9rem; }
.plan-section .rt-when { color: var(--muted); font-size: 0.85rem; }
.plan-section .rt-edit { color: var(--brand); font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.plan-section .routine details[open] .rt-edit { visibility: hidden; }
.plan-section .routine details[open] { padding-bottom: 14px; }
.plan-section .routine.paused .rt-main strong { color: var(--muted); }
/* This week: days as divided rows, today marked; the intensity chip stays beside the session */
.week-days { gap: 0; margin: 8px 0 14px; }
.wd { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 13px 4px; grid-template-columns: 3.6rem minmax(0, 1fr); }
.wd:last-child { border-bottom: 0; }
.wd.today { border-radius: var(--radius-sm); border-bottom-color: transparent; padding-left: 10px; padding-right: 10px; }
.wd-what strong { font-size: 0.98rem; }
.wd-what .chip { margin-left: 4px; vertical-align: 1px; font-size: 0.72rem; }
.wd-what .di-sub { margin-top: 2px; }
/* Usual days: each kind of day is roomier; meal name and food on one line on a phone too */
.usual-days { display: grid; gap: 14px; }
.usual-day { padding: 16px; gap: 8px; }
.usual-day header strong { font-size: 1.05rem; }
.usual-meals { gap: 0; }
.usual-meals li { padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 0.95rem; }
.usual-meals li:last-child { border-bottom: 0; }
@media (max-width: 480px) {
  .usual-meals li { grid-template-columns: 5.6rem minmax(0, 1fr) auto; gap: 10px; }
  .usual-meals .um-type { grid-column: auto; }
}
.usual-total { margin-top: 6px; }
.redo-week { margin: 4px 0 16px; }
.redo-week > summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 0.92rem; list-style: none; padding: 6px 0; }
.redo-week > summary::-webkit-details-marker { display: none; }
.redo-week[open] > summary { margin-bottom: 8px; }
.page-head .lede { font-size: 0.95rem; }
.ud-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.ud-foot .add-usual-meal { margin: 0; }
.ud-foot .change-days { margin: 0; }
.ud-foot .change-days[open] { flex-basis: 100%; }
.usual-meals .um-num { font-size: 0.85rem; }

/* Waitlist (public) and the admin waitlist */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.admin-links li { grid-template-columns: minmax(0, 1fr) auto; }
.admin-links a.pr-what { color: inherit; text-decoration: none; display: grid; gap: 2px; }
.invite-direct { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.invite-direct input { flex: 1 1 160px; height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; min-width: 0; }
.waitlist-rows { list-style: none; margin: 4px 0 0; padding: 0; }
.waitlist-rows li { display: flex; gap: 12px; justify-content: space-between; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.waitlist-rows li:last-child { border-bottom: 0; }
.wl-main { display: grid; gap: 3px; min-width: 0; }
.wl-email { color: var(--ink); font-size: 0.92rem; overflow-wrap: anywhere; }
.wl-note { color: var(--muted); font-size: 0.88rem; }
.wl-meta { color: var(--muted); font-size: 0.8rem; }
.wl-status { font-size: 0.72rem; }
.wl-joined .wl-status { background: var(--ok-soft); color: var(--ok); }
.wl-declined .wl-main { opacity: 0.6; }
.wl-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex: none; }
.wl-link { display: flex; gap: 6px; margin-top: 6px; }
.wl-link input { flex: 1; min-width: 0; height: 36px; padding: 0 10px; font: inherit; font-size: 0.8rem; color: var(--muted); background: var(--surface-2); border: 0; border-radius: 10px; }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .invite-direct input { border-color: rgb(255 255 255 / 0.14); }
}
:where(:root[data-theme="dark"]) .invite-direct input { border-color: rgb(255 255 255 / 0.14); }
.wl-main > .wl-status { justify-self: start; }
.wl-main > strong { font-size: 1rem; }
.wl-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ═══ Progress redesign 2026-11-14: body trackers first, then goals, the period, patterns ═══════════ */
#trackers, #period, #patterns, #entries { scroll-margin-top: 12px; }

/* Segmented control: Weight · Body fat · BMI */
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; background: var(--surface-2); border-radius: 999px; }
.tracker .seg a { background: none; border: 0; box-shadow: none; text-align: center; padding: 8px 6px; border-radius: 999px; text-decoration: none; color: var(--muted); font-weight: 600; font-size: 0.92rem; }
.tracker .seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }

.ranges { display: flex; gap: 6px; margin: 4px 0 10px; }
.ranges a { flex: 1; text-align: center; padding: 5px 0; border-radius: 10px; font-size: 0.8rem; font-weight: 700; color: var(--muted); text-decoration: none; border: 1px solid var(--border); }
.ranges a[aria-current="page"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }

/* The chart: SVG stretched to the card, labels in HTML so text never stretches */
.tchart { margin: 14px 0 8px; }
.tc-plot .c-dots.dense { stroke-width: 3; }
.tc-plot { position: relative; margin-left: 34px; height: 190px; touch-action: pan-y; }
.tc-plot svg { display: block; width: 100%; height: 100%; overflow: visible; background: none; border-radius: 0; }
.tc-plot .c-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.tc-plot .c-band { fill: transparent; }
.tc-plot .c-band.ok { fill: var(--brand-soft); opacity: 0.7; }
.tc-plot .c-goal { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 5 5; vector-effect: non-scaling-stroke; opacity: 0.8; }
.tc-plot .c-dots { fill: none; stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tc-plot .c-dots.solid { stroke: var(--brand); stroke-opacity: 1; stroke-width: 8; }
.tc-plot .c-line { fill: none; stroke: var(--brand); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tc-plot .c-last { stroke: var(--brand); stroke-width: 12; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.tc-y { position: absolute; inset: 0 auto 0 -34px; width: 30px; pointer-events: none; }
.tc-y span { position: absolute; right: 0; transform: translateY(-50%); font-size: 0.7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.tc-x { display: flex; justify-content: space-between; margin: 6px 0 0 34px; font-size: 0.72rem; color: var(--muted); }
.tc-plot.reading::after { content: ""; position: absolute; left: var(--cx); top: var(--cy); width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--surface); border: 3px solid var(--ink); pointer-events: none; }
.tc-tip { position: absolute; transform: translate(-50%, calc(-100% - 12px)); background: var(--ink); color: var(--bg); font-size: 0.75rem; font-weight: 600; padding: 4px 8px; border-radius: 8px; white-space: nowrap; pointer-events: none; z-index: 2; }
.tc-tip.below { transform: translate(-50%, 14px); }
.tchart figcaption { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 10px 0 0; font-size: 0.78rem; color: var(--muted); }
.tchart .key::before { content: ""; display: inline-block; vertical-align: middle; margin-right: 6px; }
.tchart .key.line::before { width: 14px; height: 3px; border-radius: 2px; background: var(--brand); }
.tchart .key.dot::before { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); opacity: 0.5; }
.tchart .key.plan::before { width: 14px; border-top: 2px dashed var(--muted); }
.tchart .key.band::before { width: 12px; height: 10px; border-radius: 3px; background: var(--brand-soft); }

/* Log a number right under the chart */
.t-log { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; margin: 14px 0 4px; }
.t-log input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); color: var(--ink); font: inherit; }
.t-log input:focus { outline: none; border-color: var(--ink); background: var(--surface); }
.t-log .button { height: 40px; white-space: nowrap; }
@media (max-width: 520px) { .t-log { grid-template-columns: 1fr 1fr; } .t-log .button { grid-column: 1 / -1; width: 100%; } }
@media (prefers-color-scheme: dark) {
  :where(:root:not([data-theme="light"])) .t-log input { border-color: rgb(255 255 255 / 0.14); }
}
:where(:root[data-theme="dark"]) .t-log input { border-color: rgb(255 255 255 / 0.14); }

/* BMI: where you sit on the scale (only the healthy band is coloured) */
.bmi-scale { position: relative; display: grid; grid-template-columns: 17.5fr 32.5fr 25fr 25fr; gap: 3px; height: 8px; margin: 14px 0 4px; }
.bmi-scale .bs-seg { border-radius: 4px; background: var(--surface-2); }
.bmi-scale .bs-seg.ok { background: var(--brand); opacity: 0.55; }
.bmi-scale .bs-mark { position: absolute; top: -5px; width: 4px; height: 18px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.bmi-labels { position: relative; height: 1.2em; font-size: 0.7rem; color: var(--muted); margin-bottom: 4px; }
.bmi-labels span { position: absolute; transform: translateX(-50%); }
.bmi-labels span:first-child { transform: none; }
.bmi-labels span:last-child { transform: translateX(-100%); }

/* Period tiles: the week / month at a glance */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.tile { background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px; display: grid; gap: 2px; }
@media (max-width: 420px) { .tiles { grid-template-columns: 1fr 1fr; } }

/* Privacy / Terms (public) */
.legal-shell { max-width: 760px; margin: 0 auto; padding: 24px 16px 48px; }
.legal h1 { margin: 8px 0 4px; }
.legal h2 { font-size: 1.05rem; margin: 24px 0 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 20px; margin: 0; }
.legal li { margin-bottom: 6px; }
.legal-nav { font-size: 0.9rem; margin: 0; }
.b-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.b-actions form { margin: 0; }

/* Today: water as a glass filling up (14 Nov) */
.glass .g-edge { fill: none; stroke: var(--line); stroke-width: 2.5; stroke-linejoin: round; }
.glass .g-water { fill: color-mix(in srgb, var(--water) 55%, transparent); transition: y .6s ease; }
.glass .g-wave { fill: color-mix(in srgb, var(--water) 80%, transparent); animation: wave 3s linear infinite; }
.glass .g-mark { stroke: var(--line); stroke-width: 1.5; stroke-linecap: round; }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(32px); } }
@media (prefers-reduced-motion: reduce) { .glass .g-wave { animation: none; } }

/* Today: connect WhatsApp tip (14 Nov; Telegram only with TELEGRAM_COACHING) */
.connect-tip { margin: 12px 0; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--ink); }
.connect-tip p { margin: 0 0 10px; line-height: 1.5; }
.tg-offer { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tg-offer .help { flex-basis: 100%; margin: 0; }

/* Feedback (14 Nov) */
.fb-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font: 600 0.85rem var(--font); padding: 6px 10px; border-radius: 999px; }
.fb-link:hover { background: var(--surface-2); color: var(--ink); }
.fb-link svg { width: 18px; height: 18px; }
@media (max-width: 640px) { .fb-link span { display: none; } }
.feedback-form textarea { width: 100%; }
.fb-items, .fb-themes { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.fb-theme { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.fb-text { margin: 0; line-height: 1.5; }
.fb-decide { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.fb-decide input { min-width: 0; width: 160px; }
.fb-theme.s-fixed strong, .fb-theme.s-wont_fix strong { color: var(--muted); text-decoration: line-through; }

/* How you eat: plan / describe / log (14 Nov) */
.style-choices { display: grid; gap: 10px; margin-top: 8px; }
.style-choices form { margin: 0; }
.style-choice { display: flex; gap: 14px; align-items: flex-start; width: 100%; text-align: left; padding: 16px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; }
.style-choice:hover { border-color: var(--brand); }
.style-choice .sc-icon { font-size: 1.5rem; line-height: 1; }
.style-choice strong { display: block; font-size: 1rem; }
.style-choice small { display: block; color: var(--muted); margin-top: 4px; line-height: 1.4; font-size: 0.86rem; }

/* About me: a hub of grouped rows, and its sub-pages (14 Nov) */
.page-title { margin: 8px 4px 0; font-size: 1.6rem; }
.group-title { margin: 0 4px 8px; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.card .group-title { margin: 0 0 6px; }
.card.list { padding: 0 16px; }
.list-row { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 0; color: var(--ink); text-decoration: none; font-weight: 400; border-top: 1px solid var(--line); margin: 0; }
.card.list > .list-row:first-child { border-top: 0; }
.list-row > span:first-of-type { flex: 1; min-width: 0; display: grid; gap: 1px; }
.list-row strong { font-size: 0.95rem; font-weight: 600; }
.list-row small { font-size: 0.82rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row small a { font-weight: 600; }
.list-row .chev { flex: none; color: var(--muted); }
.list-row .list-end { flex: none; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
a.list-row:hover strong { color: var(--brand); }
.list-act { display: flex; align-items: center; gap: 8px; margin: 0; }
.you-card { display: grid; gap: 14px; }
.you-top { display: flex; align-items: center; gap: 14px; }
.you-ava { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); display: grid; place-items: center; font-size: 1.3rem; font-weight: 700; }
.you-who { flex: 1; min-width: 0; display: grid; gap: 2px; }
.you-who strong { font-size: 1.1rem; }
.you-who small { color: var(--muted); font-size: 0.85rem; }
.you-why { margin: 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: 0.92rem; line-height: 1.5; }
.you-new { display: flex; align-items: center; gap: 6px; padding: 4px 4px 4px 14px; border: 1px solid var(--border); border-radius: 999px; }
.you-new input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 0.95rem; color: var(--ink); height: 40px; }
.you-new .mic-label { display: none; }
.you-new .mic-note:empty { display: none; }
.you-foot { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 18px; font-size: 0.88rem; padding: 4px 0 8px; }
.you-foot a:not(:first-child) { color: var(--muted); }
.you-foot form { margin: 0; }
.link-button.danger { border: 0; padding: 0; color: var(--danger); font-size: 0.88rem; font-weight: 600; }

.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row label { font-weight: 600; font-size: 0.95rem; }
.set-row input[type="time"], .moment input[type="time"] { width: auto; min-width: 0; height: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface-2); font: 600 0.95rem var(--font); color: var(--ink); }
.moment input[type="time"] { padding: 0 14px; }
@media (max-width: 640px) { .moment input[type="time"]::-webkit-calendar-picker-indicator, .set-row input[type="time"]::-webkit-calendar-picker-indicator { display: none; } }

/* Check-in times: one compact row each, a switch and a time (also onboarding's plan step) */
.moments { gap: 0; margin: 0; }
.moments > .help { margin: 0 0 6px; }
.moment { grid-template-columns: 1fr auto; padding: 10px 0; border: 0; border-top: 1px solid var(--line); border-radius: 0; }
.moments legend + .help + .moment, .moments legend + .moment { border-top: 0; }
.moment .m-on { align-items: center; gap: 12px; }
.moment .m-on strong { font-weight: 600; font-size: 0.95rem; }
.moment .di-sub { font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.moment input[type="checkbox"] { appearance: none; -webkit-appearance: none; flex: none; width: 44px; height: 26px; margin: 0; border-radius: 13px; background: var(--border); position: relative; cursor: pointer; transition: background 0.15s; }
.moment input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s; }
.moment input[type="checkbox"]:checked { background: var(--brand); }
.moment input[type="checkbox"]:checked::before { transform: translateX(18px); }
.moment input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.moment:has(input[type="checkbox"]:not(:checked)) strong, .moment:has(input[type="checkbox"]:not(:checked)) input[type="time"] { color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .moment input[type="checkbox"], .moment input[type="checkbox"]::before { transition: none; } }

/* Today, compact (14 Nov): stats under the ring, Next up, one-line rows, Tell Max docked on phones */
.today-head { gap: 10px; }
.today-head h1 { font-size: 1.5rem; margin: 0; }

.day-total { font-size: 0.9rem; }
.day-total .tip { display: block; margin-top: 4px; font-size: 0.85rem; font-weight: 400; color: var(--muted); }

.connect-tip { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; padding: 10px 14px; }
.connect-tip p { margin: 0; flex: 1 1 220px; font-size: 0.9rem; }

/* Redesign, the rest (14 Nov): Plan tabs, Progress, Log, chat, and the desktop shell */

/* Plan: four tabs on one row, as a segmented control */
nav.seg[aria-label="Plan"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
nav.seg[aria-label="Plan"] a { background: none; border: 0; text-align: center; padding: 8px 4px; border-radius: 999px; font-weight: 600; font-size: 0.84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
nav.seg[aria-label="Plan"] a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.plan-rows li { padding: 9px 0; }

/* Progress: weigh-in on one row; goals stack on phones */
@media (max-width: 520px) {
  .t-log { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) auto; gap: 6px; }
  .t-log .button { grid-column: auto; width: auto; padding: 0 12px; }
  .t-log input[type="date"] { font-size: 0.85rem; padding: 0 6px; }
}

/* Log: tiles in two tight columns */
.tiles .tile strong { font-size: 0.95rem; }
a.tile { padding: 14px; }

/* Chat: a quieter header on phones */
@media (max-width: 640px) {
  .chat-head .help { display: none; }
  .chat-head .brand-mark { width: 36px; height: 36px; }
  .chat-head h1 { font-size: 1.15rem; }
}

/* Desktop (1100 px and up): the top bar becomes a left menu; pages use the width */
@media (min-width: 1100px) {
  body.has-nav { padding-left: 232px; }
  body.has-nav .topbar { position: fixed; inset: 0 auto 0 0; width: 232px; max-width: none; height: 100vh; margin: 0; padding: 24px 16px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 4px; border-right: 1px solid var(--border); background: var(--bg); z-index: 5; box-sizing: border-box; }
  body.has-nav .brand { padding: 0 8px 18px; }
  body.has-nav .topnav { display: flex; flex-direction: column; align-items: stretch; gap: 2px; }
  body.has-nav .topnav a { display: flex; align-items: center; padding: 10px 12px; border-radius: 12px; font-size: 0.95rem; }
  body.has-nav .topnav a[aria-current="page"] { background: var(--surface); box-shadow: var(--shadow); }
  body.has-nav .topnav .nav-log { order: -1; justify-content: center; margin: 0 0 14px; border-radius: 999px; }
  body.has-nav .topnav a:has(.badge) { padding-right: 12px; justify-content: space-between; }
  body.has-nav .topnav .badge { position: static; transform: none; }
  body.has-nav .topbar-right { margin-top: auto; flex-direction: column; align-items: stretch; gap: 6px; }
  body.has-nav .topbar-right .fb-link span { display: inline; }
  body.has-nav .page { padding-top: 28px; }
  /* Only pages laid out in columns get the extra width; forms stay a readable 720 px column */
  body.today-page .page, .page:has(> .plan-section[aria-labelledby="food-h"]) { max-width: 1080px; padding-left: 32px; padding-right: 32px; }

  /* Today: the day on the left, goals, reach-me and water on the right */
  body.today-page .page { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr); gap: 20px; align-items: start; }

  /* Plan: sections side by side under the tabs and the heading */
  .page:has(> .plan-section[aria-labelledby="food-h"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page:has(> .plan-section[aria-labelledby="food-h"]) > .seg, .page:has(> .plan-section[aria-labelledby="food-h"]) > .page-head { grid-column: 1 / -1; }
  .page:has(> .plan-section[aria-labelledby="food-h"]) > .plan-section:first-of-type { grid-row: span 2; }

  /* Log: tiles in a row */
  .tiles:has(> a.tile) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.topnav .nav-ic, .rail-me { display: none; }
@media (min-width: 1100px) {
  body.has-nav .topnav .nav-ic { display: inline-block; width: 18px; height: 18px; margin-right: 10px; flex: none; color: var(--muted); }
  body.has-nav .topnav a[aria-current="page"] .nav-ic { color: var(--brand); }
  body.has-nav .topbar-right { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px 10px; }
  body.has-nav .topbar-right .fb-link { grid-column: 1 / -1; padding: 8px 12px; }
  body.has-nav .rail-me { display: block; color: var(--ink); text-decoration: none; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
/* Onboarding is one focused screen: no menu until setup is done (the links would only send them back) */
body.onboarding-page .topnav, body.onboarding-page .tabbar, body.onboarding-page .rail-me { display: none !important; }
body.onboarding-page.has-nav { padding-bottom: 0; }
@media (min-width: 1100px) {
  body.onboarding-page.has-nav { padding-left: 0; }
  body.onboarding-page.has-nav .topbar { position: static; width: 100%; max-width: 1080px; height: auto; margin: 0 auto; padding: 16px; flex-direction: row; align-items: center; justify-content: space-between; border-right: 0; background: none; }
  body.onboarding-page.has-nav .brand { padding: 0; }
  body.onboarding-page.has-nav .topbar-right { margin-top: 0; display: flex; flex-direction: row; }
}
.onboard { max-width: 640px; width: 100%; justify-self: center; }

/* ── Yesterday: fill in what got missed; older days are view-only (LLD §6.2h) ───────────────── */
.round-link.yday { padding: 0 14px; }
.round-link.yday.soon { background: var(--brand-soft); border-color: transparent; color: var(--brand); }
.view-only, .for-day-note { margin: 12px 0 0; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); color: var(--muted); font-size: 0.9rem; }
.for-day-note { margin: 0 0 14px; border: 0; background: var(--brand-soft); color: var(--ink); }
.for-day-note a { margin-left: 6px; }
.round-link.wide { white-space: nowrap; }

/* ── Goals as a week: a dot a day, Monday to Sunday (LLD §6.2i) ─────────────────────────────── */
.wdots { list-style: none; margin: 0; padding: 0; display: flex; gap: 5px; flex-shrink: 0; }
.wdot { position: relative; width: 16px; height: 16px; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--border); background: transparent; }
.wdot.done { background: var(--brand); border-color: var(--brand); }
.wdot.missed { background: var(--border); border-color: transparent; }
.wdot.today { border: 1.5px dashed var(--brand); }
.wdot.ahead { opacity: 0.45; }
.wdot.off { border-color: transparent; background: radial-gradient(circle, var(--border) 0 3px, transparent 3.5px); }
.wdot.is-today.done { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--brand); }
.wg-days { display: flex; gap: 5px; justify-content: flex-end; font-size: 0.7rem; font-weight: 700; color: var(--muted); margin: 2px 0 2px; }
.wg-days span { width: 16px; text-align: center; }
.goal .wg-days { justify-content: flex-start; margin-top: 8px; }
.goal .wdots { margin: 0 0 8px; }
.goal .wdot { width: 22px; height: 22px; }
.goal .wdots, .goal .wg-days { gap: 8px; }
.goal .wg-days span { width: 22px; }
.past-weeks { margin-top: 2px; }
.bar { position: relative; }
.bar-expected { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); opacity: 0.55; }
.goals.compact { min-width: 0; } /* the goal row scrolls; it never widens the page */

/* ── Admin feedback: cross items off (LLD 11) ──────────────────────────────────────────────── */
.fb-items { gap: 0; margin-top: 12px; }
.fb-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.fb-item:first-child { border-top: 0; }
.fb-body { min-width: 0; overflow-wrap: anywhere; }
.fb-body .help { margin: 4px 0 0; }
.fb-actions { flex-shrink: 0; }
.fb-actions form { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.fb-themes .fb-theme { flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.fb-themes .fb-theme:first-child { border-top: 0; }
.fb-theme .fb-decide { width: 100%; flex-wrap: nowrap; }
.fb-theme .fb-decide select { width: auto; flex-shrink: 0; }
.fb-theme .fb-decide input { flex: 1; width: auto; min-width: 0; }
.fb-themes { gap: 0; }
.fb-item:not(.st-open) .fb-text { text-decoration: line-through; color: var(--muted); }
.fb-item.st-noted .fb-text { text-decoration: none; }
.fb-closed { margin: 6px 0 0; font-size: 0.8rem; color: var(--muted); }
.st-chip { font-size: 0.75rem; }
.st-done .st-chip { background: var(--brand-soft); color: var(--brand); }
.tab-n { font-weight: 600; opacity: 0.6; margin-left: 2px; }
.fb-empty { margin-top: 14px; }
.fb-closed-themes { margin-top: 12px; }
.fb-closed-themes summary { cursor: pointer; color: var(--muted); font-weight: 600; }
.fb-closed-themes .fb-themes { margin-top: 12px; }
.fb-theme > div, .fb-body, .fb-decide, .fb-items, .fb-themes { min-width: 0; max-width: 100%; }
@media (max-width: 640px) {
  .fb-item, .fb-theme { flex-direction: column; }
  .fb-actions form { justify-content: flex-start; }
  .fb-theme .fb-decide { flex-wrap: wrap; }
  .fb-theme .fb-decide input { flex-basis: 140px; }
  #items .tabs { max-width: 100%; overflow-x: auto; }
}

/* ── Usual week draft: change one meal before saving (LLD 05 §6.2j) ─────────────────────────── */
.um-edit { grid-column: 1 / -1; margin-top: -2px; }
.um-edit summary, .um-add summary { cursor: pointer; color: var(--brand); font-weight: 700; font-size: 0.85rem; list-style: none; display: inline-block; }
.um-edit summary::-webkit-details-marker, .um-add summary::-webkit-details-marker { display: none; }
.um-edit[open] summary { color: var(--muted); }
.um-edit-form { display: grid; gap: 8px; margin-top: 8px; }
.um-edit-form input[name="text"] { width: 100%; min-width: 0; box-sizing: border-box; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid transparent; border-radius: 12px; padding: 10px 14px; }
.um-edit-form input[name="text"]:focus { outline: none; border-color: var(--brand); }
@media (max-width: 480px) { /* a draft meal: name and kcal on top, what it is on its own full line */
  .usual-meals li { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .usual-meals .um-type { grid-column: 1; grid-row: 1; }
  .usual-meals .um-num { grid-column: 2; grid-row: 1; }
  .usual-meals .um-what { grid-column: 1 / -1; grid-row: 2; }
}
.um-edit-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; justify-content: flex-end; }
.um-edit-actions .mic-wrap { margin-right: auto; }
.um-add { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.um-add select { justify-self: start; }
.danger-text { color: var(--danger); }
.um-update { order: 2; } /* first in the form, so Enter updates; shown after Remove */
.um-remove { order: 1; }

/* ── Reminders muted by quiet hours: said where people look (Checklist, About me) ── */
.quiet-muted { margin: 0 0 12px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--warn-soft, var(--surface-2, var(--surface))); font-size: 0.88rem; overflow-wrap: anywhere; }
.rt-muted { display: block; font-size: 0.8rem; color: var(--warn, var(--muted)); }

/* P1 quick wins: the docked Tell bar never hides the end of the page; the hint fits a phone */
.ct-alt { font-size: 0.84rem; color: var(--muted); text-decoration: underline; white-space: nowrap; }
.chat-head .tg a.chip { text-decoration: none; white-space: nowrap; }
.rt-today { display: block; font-size: 0.8rem; color: var(--accent, var(--muted)); }

/* ── Private beta: the waitlist comes first for new people; the points show on phones too ── */
.beta-note { background: var(--surface-2); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 20px; display: grid; gap: 10px; }
.beta-note p { margin: 0; font-size: 0.92rem; line-height: 1.45; }
@media (max-width: 899px) {
  .brand-panel { padding: 22px 20px; }
  .brand-panel h2 { font-size: 1.6rem; margin: 10px 0 4px; }
  .brand-panel .tagline { font-size: 0.95rem; }
  .features { display: grid; gap: 10px; margin-top: 16px; }
  .features li { font-size: 0.9rem; gap: 10px; }
  .features .icon { width: 30px; height: 30px; border-radius: 9px; }
  .features .icon svg { width: 16px; height: 16px; }
}

/* ── Onboarding, About yourself: the brief sits under the question; Talk is the main way in ── */
.talk-brief { margin: 2px 0 8px; }
.talk .talk-actions .mic { width: 100%; justify-content: center; min-height: 48px; font-size: 1rem; background: var(--accent-soft, var(--surface-2)); }
.talk .talk-actions .mic-wrap { display: grid; width: 100%; gap: 6px; }

/* Tap targets and instant feedback (16 Nov): a ✕ is at least finger-sized on a phone; a delete asks by a
   second tap ("Delete?"); a button that was tapped looks pressed until the page answers. */
@media (pointer: coarse) {
  .icon-button, .icon-button.small { min-width: 40px; min-height: 40px; width: auto; height: auto; display: inline-flex; align-items: center; justify-content: center; }
}
.confirming, .icon-button.confirming { color: var(--danger); background: var(--danger-soft); font-weight: 700; font-size: 0.85rem; width: auto; padding: 6px 12px; white-space: nowrap; }
button.is-busy { opacity: 0.55; cursor: progress; }

/* ── Your day as tiles (16 Nov): one tile per kind of meal, then Habits and Move. Order is the day's order of
   meals, never the clock. ─────────────────────────────────────────────────────────────────────────────── */
.dt { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: 8px; min-height: 108px; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1.5px solid transparent; min-width: 0; }
.dt.logged { background: var(--ok-soft); }
.dt.next { background: var(--surface); border-color: var(--brand); }
.slot-bit { display: grid; gap: 10px; margin-top: 12px; }
.slot-top { display: flex; flex-direction: column; gap: 2px; }
.slot-act { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.slot-add { margin: 14px 0; }

/* Habits vs the one-day checklist, tonight's carry-over and the quiet-hours heads-up (16 Nov). */
.dt-quiet { flex: 1 1 100%; display: grid; gap: 4px; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface); }
.dt-quiet[hidden] { display: none; }

/* Today, calmer (16 Nov): one row per checklist item, nothing folded away, a collapsed "+ Add", water right under the day on a phone. */
@media (max-width: 899px) {
  body.today-page .page { display: flex; flex-direction: column; gap: 14px; }
  body.today-page .connect-tip { order: 3; }
}

/* Redesign (16 Nov): week strip, past-day verdict, water in one tap, fill-in card, dot legend, goal next step,
   weigh-in stepper, Plan's gap fix and movement picks. */
.fill-in h2 { margin: 0 0 8px; font-size: 1rem; }
.wd-key { display: flex; flex-wrap: wrap; gap: 12px; margin: 8px 0 0; font-size: 0.72rem; color: var(--muted); }
.wd-key span { display: inline-flex; align-items: center; gap: 5px; }
.wkey { width: 10px; height: 10px; display: inline-block; border-radius: 50%; box-sizing: border-box; border: 1.5px solid var(--border); }
.wkey.done { background: var(--brand); border-color: var(--brand); }
.wkey.missed { background: var(--border); border-color: transparent; }
.wkey.today { border: 1.5px dashed var(--brand); }
.wkey.ahead { opacity: 0.45; }
.g-next { margin: 8px 0 0; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-size: 0.85rem; line-height: 1.4; }
.t-log { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 520px) { .t-log { grid-template-columns: minmax(0, 1fr) auto; } .t-log .button { grid-column: auto; width: auto; } }

/* Theme switch (16 Nov): Auto follows the phone; Light or Dark (a cookie, set on About me) wins over it. The
   theme selectors use :where() so they add no specificity: the light and dark rules stack exactly as before. */
:root:where([data-theme="light"]) { color-scheme: light; }
:root:where([data-theme="dark"]) { color-scheme: dark; }
.theme-seg { display: flex; gap: 4px; padding: 3px; border-radius: var(--radius-sm); background: var(--surface-2); margin: 0; }
.theme-seg button { flex: 1; height: 36px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font: 600 0.88rem var(--font); cursor: pointer; }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
.list-row.theme-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.theme-row .theme-seg { width: 100%; }

/* ═══ Public pages 2026-11-18: landing, How it works, Contact, and the logged-out header/footer ═════════
   Same calm tokens as the app (paper, white cards, ink pills, pine accent), so light and dark come free. */
body:not(.has-nav) .topbar { flex-wrap: wrap; }
.pubnav { order: 3; width: 100%; display: flex; gap: 4px; overflow-x: auto; margin: 0 -8px; }
.pubnav a, .pub-login {
  color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.92rem; padding: 6px 10px;
  border-radius: 999px; white-space: nowrap;
}
.pubnav a:hover, .pub-login:hover { color: var(--ink); }
.pubnav a[aria-current="page"], .pub-login[aria-current="page"] { color: var(--ink); background: var(--surface); box-shadow: var(--shadow); }
.pub-actions { gap: 6px; }
.pub-actions .button.small { height: 40px; font-size: 0.9rem; font-weight: 700; }
@media (min-width: 760px) {
  .pubnav { order: 0; width: auto; flex: 1; justify-content: center; margin: 0; }
}

.pub { flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding: 8px 16px 40px; display: grid; gap: 48px; min-width: 0; }
.pub.narrow { max-width: 820px; gap: 40px; }
.pub h1 { font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.05; margin: 10px 0 14px; letter-spacing: -0.035em; }
.pub h2 { font-size: clamp(1.35rem, 4vw, 1.75rem); margin: 0 0 8px; letter-spacing: -0.025em; }
.pub h3 { font-size: 1.02rem; margin: 0 0 4px; }
.pub p { margin: 0; }
.pub-eyebrow { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-deep); font-size: 0.8rem; font-weight: 700; letter-spacing: 0.02em; }
.pub-lede { font-size: 1.1rem; color: var(--muted); max-width: 46ch; }
.pub-lede strong { color: var(--ink); }
.pub-sub { color: var(--muted); margin: 0 0 18px !important; }
.pub-small { color: var(--muted); font-size: 0.92rem; margin-top: 12px !important; }
.pub-ctas { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.pub-ctas .button { width: auto; flex: 1 1 200px; max-width: 260px; border-radius: 999px; }
@media (max-width: 480px) { .pub-ctas .button { max-width: none; } }

/* Hero: copy + an example chat in a phone */
.pub-hero { display: grid; gap: 32px; align-items: center; padding-top: 12px; }
@media (min-width: 900px) { .pub-hero { grid-template-columns: 1.15fr 0.85fr; padding-top: 32px; } }
.phone {
  justify-self: center; width: 100%; max-width: 360px; background: var(--surface); border-radius: 32px;
  padding: 14px; box-shadow: 0 1px 2px rgb(21 23 28 / 0.05), 0 24px 48px -24px rgb(21 23 28 / 0.25);
  border: 1px solid var(--border);
}
.phone-head { display: flex; align-items: center; gap: 10px; padding: 6px 8px 12px; border-bottom: 1px solid var(--line); }
.phone-head small { display: block; color: var(--muted); font-size: 0.78rem; }
.phone-head strong { display: block; line-height: 1.1; }
.phone-chat { display: grid; gap: 8px; padding: 14px 4px 6px; }
.pub .bubble { box-shadow: none; max-width: 85%; margin: 0; }
.pub .bubble.max { background: var(--surface-2); color: var(--ink); }
.pub .bubble.me { background: var(--brand); color: var(--brand-ink); }
.pub .bubble .meta { color: var(--muted); }

/* Bands, cards, steps */
.pub-band { display: grid; gap: 8px; }
.pub-grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .pub-grid.two, .pub-grid.three, .pub-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .pub-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); } .pub-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pub-card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.pub-card p { color: var(--muted); font-size: 0.95rem; }
.pub-ic { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--brand-soft); color: var(--brand-deep); margin-bottom: 12px; }
.pub-steps { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 12px; }
@media (min-width: 900px) { .pub:not(.narrow) .pub-steps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.pub-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.pub-steps p { color: var(--muted); font-size: 0.95rem; }
.pub-num { flex: none; display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font-weight: 700; }
.pub-more { margin-top: 6px !important; }
.pub-list { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.pub-list li { line-height: 1.55; }

/* A day with Max */
.pub-day { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 14px; }
.pub-day li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 12px; }
.pub-day time { font-weight: 700; color: var(--muted); padding-top: 9px; font-size: 0.92rem; }
.pub-day li > div { display: grid; gap: 6px; background: var(--surface); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.pub-day .bubble.me { justify-self: end; }
.pub-day .bubble.max { justify-self: start; }
.pub-note { color: var(--muted); font-size: 0.9rem; }

/* Closing call to action: the same deep pine as the welcome panel, in both modes */
.pub-cta { background: #1F6B52; color: #fff; border-radius: 28px; padding: 32px 24px; text-align: center; display: grid; justify-items: center; gap: 8px; }
.pub-cta p { max-width: 52ch; opacity: 0.92; }
.pub-cta .pub-ctas { justify-content: center; width: 100%; }
.pub-cta .button.primary { background: #fff; color: #15171C; }
.pub-cta .button.soft { background: transparent; color: #fff; border-color: rgb(255 255 255 / 0.5); }
@media (prefers-color-scheme: dark) { :where(:root:not([data-theme="light"])) .pub-cta { background: #17382C; } }
:where(:root[data-theme="dark"]) .pub-cta { background: #17382C; }

/* Contact */
.pub-head { display: grid; gap: 4px; justify-items: start; }
.pub-contact { display: grid; gap: 16px; }
@media (min-width: 760px) { .pub-contact { grid-template-columns: 1.4fr 1fr; align-items: start; } }
.pub-contact-side { display: grid; gap: 12px; }
.pub-contact-side a { overflow-wrap: anywhere; }
.contact-form textarea {
  width: 100%; font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid transparent;
  background: var(--surface-2); color: var(--ink); resize: vertical; min-height: 120px;
}
.contact-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--line); }
.contact-form .button { margin-top: 4px; }
.contact-form .help { margin-top: 10px; }

/* Footer (logged out everywhere; on the public and legal pages for everyone) */
.pubfoot { width: 100%; border-top: 1px solid var(--line); margin-top: 24px; }
.pubfoot-in { max-width: 1080px; margin: 0 auto; padding: 24px 16px 32px; display: grid; gap: 16px; }
.pubfoot-brand { display: flex; gap: 12px; align-items: flex-start; margin: 0; color: var(--muted); font-size: 0.9rem; }
.pubfoot-brand strong { color: var(--ink); }
.pubfoot-brand .brand-mark { flex: none; width: 32px; height: 32px; }
.pubfoot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pubfoot nav a { color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.92rem; }
.pubfoot nav a:hover { color: var(--brand); text-decoration: underline; }
.pubfoot-note { margin: 0; color: var(--muted); font-size: 0.82rem; }
@media (min-width: 760px) { .pubfoot-in { grid-template-columns: 1fr auto; align-items: center; } .pubfoot-note { grid-column: 1 / -1; } }

/* Deleting an account (/me/delete/, /admin/people/<id>/delete/) */
.button.danger { background: var(--danger-soft); color: var(--danger); border: 1.5px solid var(--danger); box-shadow: none; }
.you-foot a.danger { color: var(--danger); }
.del-plain { margin: 6px 0 10px; padding-left: 20px; }
.del-plain li { margin: 3px 0; }
.del-who { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 10px 0; }
.del-who dt { color: var(--muted); }
.del-who dd { margin: 0; overflow-wrap: anywhere; }
.del-form { display: grid; gap: 8px; margin-top: 12px; max-width: 420px; }
.del-form label small { display: block; color: var(--muted); font-weight: 400; overflow-wrap: anywhere; }
.del-form input { height: 44px; padding: 0 12px; font: inherit; color: var(--ink); background: var(--surface-2); border: 1.5px solid var(--border); border-radius: 12px; min-width: 0; }
.del-form input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.del-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.del-actions .button { width: auto; height: 46px; }
.wl-warn { color: var(--danger); font-weight: 600; }  /* People: reminders that never reached them */

/* ═══ Design 2026-11-22: one answer first, then rows (web redesign, LLD 05 §6.3) ══════════════════════════
   Same token names as before, values within a shade: paper ground, white surfaces, deep ink, one accent
   (pine) that means done or on track. Over and behind are grey words, never amber. Type 40 / 24 / 17 / 15 / 14,
   12 for labels only. Radius 12 and pills. 16 inside cards, 32 between sections, 44 px to tap. The ui-*
   components are shared by every redesigned screen; td-* is Today. Older rules above stay until the last PR
   prunes what nothing uses. */
:root {
  --bg: #F6F5F1; --bg-glow: #F6F5F1; --surface: #FFFFFF; --surface-2: #EFEDE7;
  --ink: #16181D; --muted: #5B5F66; --border: #E5E2DA; --line: #E5E2DA; --field-line: #8A8D93;
  --brand: #1F6B52; --brand-ink: #FFFFFF; --brand-soft: #E3EEE8; --brand-deep: #174F3D;
  --accent: var(--brand); --accent-soft: var(--brand-soft); --accent-ink: var(--brand-ink);
  --r: 12px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) { --bg: #0F1211; --bg-glow: #0F1211; --surface: #171A19; --surface-2: #202422;
    --ink: #EFEFEA; --muted: #A2A69F; --border: #2A2F2C; --line: #2A2F2C; --field-line: #6B706B;
    --brand: #63C29D; --brand-ink: #0B1712; --brand-soft: #1B3128; --brand-deep: #8ED3B6; --ring-track: #2A2F2C; }
}
:root:where([data-theme="dark"]) { --bg: #0F1211; --bg-glow: #0F1211; --surface: #171A19; --surface-2: #202422;
  --ink: #EFEFEA; --muted: #A2A69F; --border: #2A2F2C; --line: #2A2F2C; --field-line: #6B706B;
  --brand: #63C29D; --brand-ink: #0B1712; --brand-soft: #1B3128; --brand-deep: #8ED3B6; --ring-track: #2A2F2C; }

/* Shared components */
.ui-card { background: var(--surface); border-radius: var(--r); padding: 16px; display: grid; gap: 16px; min-width: 0; }
.ui-sec { display: grid; gap: 8px; min-width: 0; }
.ui-sh { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 0 4px; }
.ui-sh h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.ui-sh h2 span { font-size: 14px; font-weight: 400; color: var(--muted); letter-spacing: 0; }
.ui-aside { font-size: 14px; line-height: 20px; color: var(--muted); text-align: right; }
.ui-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r); overflow: hidden; min-width: 0; }
.ui-list > li + li { border-top: 1px solid var(--line); }
.ui-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 16px; min-height: 60px; min-width: 0; }
.ui-row .t { display: block; font-weight: 500; }
.ui-row .s { display: block; margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.ui-grp { margin: 0; padding: 12px 16px 4px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.ui-wrap { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.ui-wrap form { margin: 0; }
.ui-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; vertical-align: 1px; }
.ui-who { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; }

/* Buttons: outline pills; acc (soft pine) for the step that moves the day on; pri (ink) once per screen at most.
   Each draws at 40 px with a 44 px hit area. Links are pine text. */
.ui-btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); text-decoration: none; white-space: nowrap; cursor: pointer; }
.ui-btn::after { content: ""; position: absolute; inset: -2px; }
.ui-btn:hover { border-color: var(--ink); }
.ui-btn.acc { background: var(--brand-soft); color: var(--brand-deep); border-color: transparent; }
.ui-btn.acc:hover { border-color: var(--brand); }
.ui-btn.pri { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.ui-btn.sq { width: 40px; padding: 0; }
.ui-btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.ui-btn.ghost:hover { color: var(--ink); background: var(--surface-2); }
.ui-btn:disabled { opacity: 0.55; cursor: progress; }
.ui-link { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0; border: 0; background: none; color: var(--brand); font: 500 15px/20px var(--font); text-decoration: none; cursor: pointer; }
.ui-link:hover { text-decoration: underline; text-underline-offset: 3px; }
summary.ui-link, summary.ui-btn { list-style: none; }
.ui-btn:focus-visible, .ui-link:focus-visible, .ui-tick:focus-visible, .ui-time:focus-visible, .ui-fold > summary:focus-visible,
.td-meal-main:focus-visible, .td-stats a:focus-visible, .td-wday:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 10px; }

/* Bars: pine for what you steer towards; grey for the rest and for past the target */
.ui-bar { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.ui-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.ui-bar.thin { height: 4px; }
.ui-bar.plain > i, .ui-bar.over > i { background: color-mix(in srgb, var(--ink) 55%, transparent); }

/* Ticks: a ring to tap (44 px), and time chips for things done several times a day */
.ui-tick { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; }
.ui-tick i, .ui-time i { position: relative; display: block; flex: none; border-radius: 50%; border: 1.5px solid var(--muted); background: var(--surface); }
.ui-tick i { width: 24px; height: 24px; }
.ui-time i { width: 20px; height: 20px; }
.ui-tick[aria-pressed="true"] i, .ui-tick.on i, .ui-time[aria-pressed="true"] i, .ui-time.on i { background: var(--brand); border-color: var(--brand); }
.ui-tick[aria-pressed="true"] i::after, .ui-tick.on i::after, .ui-time[aria-pressed="true"] i::after, .ui-time.on i::after {
  content: ""; position: absolute; left: 50%; top: 45%; width: 30%; height: 55%; border: solid var(--brand-ink); border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg); }
.ui-time { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px 0 8px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 500 14px/1 var(--font); cursor: pointer; white-space: nowrap; }
.ui-time::after { content: ""; position: absolute; inset: -2px; }
.ui-time[aria-pressed="true"], .ui-time.on { background: var(--brand-soft); color: var(--brand-deep); }

/* Fields */
.ui-input { min-height: 44px; min-width: 0; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 15px var(--font); }
.ui-input:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.ui-input::placeholder { color: var(--muted); opacity: 1; }
.ui-seg { display: flex; gap: 2px; margin: 0; padding: 2px; border: 0; border-radius: 999px; background: var(--surface-2); }
.ui-seg label { position: relative; flex: 1; }
.ui-seg input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.ui-seg span { display: grid; place-items: center; min-height: 44px; border-radius: 999px; color: var(--muted); font: 500 14px var(--font); }
.ui-seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.ui-seg input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 1px; }

/* A section folded to one row (details): the summary says what's inside */
.ui-fold { background: var(--surface); border-radius: var(--r); overflow: hidden; }
.ui-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; padding: 12px 16px; cursor: pointer; }
.ui-fold > summary .t { display: block; font-size: 17px; line-height: 24px; font-weight: 600; }
.ui-fold > summary .s { display: block; font-size: 14px; line-height: 20px; color: var(--muted); }
.ui-chev { flex: none; color: var(--muted); transition: transform 0.15s; }
.ui-fold[open] .ui-chev { transform: rotate(180deg); }
.ui-fold[open] > summary { border-bottom: 1px solid var(--line); }
.ui-fold .ui-list { border-radius: 0; background: transparent; }
@media (prefers-reduced-motion: reduce) { .ui-chev { transition: none; } }

/* ── Today ── */
body.day-page .page { gap: 0; }
@media (min-width: 1100px) { body.day-page .page { max-width: 720px; padding-left: 32px; padding-right: 32px; } }
.td { display: grid; gap: 32px; min-width: 0; font-size: 15px; line-height: 22px; }
.td h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.td p { margin: 0; }
.td-eyebrow { font-size: 14px; line-height: 20px; color: var(--muted); }
.td-sub { font-size: 14px; line-height: 20px; color: var(--muted); }
.td-sub b, .td-sub strong { color: var(--ink); font-weight: 500; }
.td-sub .ui-link, .td-why .ui-link:not(summary), .td-nogoal .ui-link { display: inline; min-height: 0; font-size: inherit; line-height: inherit; }
.td a:not(.ui-btn):not(.ui-link) { font-weight: inherit; }

.td-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-top: 12px; }
.td-wday { display: grid; justify-items: center; gap: 2px; padding: 2px 0; color: var(--muted); font: 500 12px/16px var(--font); text-decoration: none; }
.td-wday b { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--ink); font-size: 15px; font-weight: 500; }
.td-wday:hover b { background: var(--surface); }
.td-wday.on b { background: var(--ink); color: var(--bg); }
.td-wday.soon:not(.on) b { box-shadow: inset 0 0 0 1.5px var(--brand); }

.td-kcal { display: grid; gap: 10px; }
.td-big { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.td-big strong { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.03em; }
.td-big span { color: var(--muted); }
.td-verdict { color: var(--muted); }
.td-verdict.ok { color: var(--brand); font-weight: 500; }
.td-macros { list-style: none; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--line); display: grid; gap: 12px; }
.td-macros li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 6.5rem; gap: 2px 12px; align-items: center; }
.td-mk { font-weight: 500; }
.td-mv { font-weight: 500; text-align: right; }
.td-mv small { font-size: 14px; font-weight: 400; color: var(--muted); }
.td-over { display: block; font-style: normal; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--muted); }
.td-step { grid-column: 2 / -1; font-size: 14px; line-height: 20px; color: var(--muted); }
.td-moved { font-size: 14px; line-height: 20px; color: var(--muted); }
.td-answer > .td-why, .td-answer > .td-nogoal { margin-top: -8px; }
.td-why > summary { min-height: 44px; }
.td-why ul { margin: 4px 0 4px; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 20px; color: var(--muted); }
.td-why strong { color: var(--ink); font-weight: 600; }
.td-inline { display: inline; margin: 0; }

.td-maxnote { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; padding: 14px 16px; border-radius: var(--r); background: var(--surface); }
.td-maxnote small { display: block; font-size: 14px; line-height: 20px; color: var(--muted); }

.td-sg { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.td-change > summary { min-height: 44px; }
.ui-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 4px; font-size: 14px; }
.ui-inline .ui-input { width: 7rem; }

.td-fillin { gap: 10px; }
.td-fillin h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.td-fillin ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }

.td-meal-main { display: grid; align-content: center; gap: 2px; min-width: 0; align-self: stretch; margin: -12px 0 -12px -16px; padding: 12px 0 12px 16px; color: var(--ink); text-decoration: none; }
a.td-meal-main:hover .t { color: var(--brand); }
.td-meal .td-note { margin-top: 2px; }
.td-water { grid-template-columns: minmax(0, 1fr); gap: 10px; }
.td-water-top { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.td-water .w-num strong { color: var(--ink); font-weight: 600; }
.td-water-left { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 20px; margin: -6px 0; }
.td-water-left form { margin: 0; }

.td-tell { position: relative; display: flex; align-items: center; gap: 4px; min-width: 0; min-height: 52px; margin: 0; padding: 4px 4px 4px 16px; border: 1px solid var(--field-line); border-radius: 999px; background: var(--surface); }
.td-tell:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.td-tell input { flex: 1 1 0; width: 0; min-width: 0; height: 44px; border: 0; padding: 0; background: none; color: var(--ink); font: 400 15px var(--font); outline: none; }
.td-tell input::placeholder { color: var(--muted); opacity: 1; }
.td-tell .mic-wrap { display: contents; }
.td-tell .mic { flex: none; justify-content: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.td-tell .mic:hover { background: var(--surface-2); color: var(--ink); }
.td-tell .mic[data-state="recording"] { background: var(--danger); color: #fff; }
.td-tell .mic .mic-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.td-tell .mic-note { position: absolute; left: 16px; top: calc(100% + 4px); font-size: 14px; }
.td-tell .mic-note:empty { display: none; }
.td-tell > .ui-btn { flex: none; }
.td .day-total { margin: 0 4px; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted); }
.td .day-total .tip { display: block; margin-top: 2px; font-size: 14px; color: var(--muted); }
.td-viewonly, .td-empty { padding: 0 4px; }
.td-day { display: grid; gap: 32px; min-width: 0; }

.td-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--surface); border-radius: var(--r); overflow: hidden; }
.td-stats a { display: grid; align-content: start; gap: 2px; min-height: 72px; min-width: 0; padding: 12px 14px; color: var(--ink); text-decoration: none; font-weight: 400; }
.td-stats a + a { border-left: 1px solid var(--line); }
.td-stats a:hover { background: var(--surface-2); }
.td-stats .k, .td-stats small { font-size: 14px; line-height: 20px; color: var(--muted); }
.td-stats .v { font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.td-stats .add { color: var(--brand); font-weight: 600; }

.td-carry { gap: 8px; }
.td-carry .t { font-weight: 600; }
.td-checks { list-style: none; margin: 0; padding: 0; }
.td-checks + .ui-grp { border-top: 1px solid var(--line); }
.td-check { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 0 6px; align-items: start; min-height: 60px; padding: 8px 12px 8px 6px; }
.td-check + .td-check { border-top: 1px solid var(--line); }
.td-check.multi { grid-template-columns: minmax(0, 1fr); padding: 12px 16px; }
.td-tick { margin: 0; }
.td-check-body { display: grid; gap: 2px; min-width: 0; padding: 11px 0 4px; }
.td-check.multi .td-check-body { gap: 8px; padding: 0; }
.td-check .t { font-weight: 500; }
.td-check .s { font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.td-check.done .t { color: var(--muted); }
.td-check > form:last-child { align-self: center; }
.td-edit { color: var(--ink); text-decoration: none; }
.td-edit:hover { color: var(--brand); }
.td-amount { margin-top: 8px; }
.td-amount > .ui-btn { order: -1; }
.td-other[open] { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.td-other .ui-input { width: 7rem; }
.td-addsheet { border-top: 1px solid var(--line); padding: 4px 16px; }
.td-addsheet > summary { display: flex; justify-content: flex-start; }
.td-addsheet[open] { padding-bottom: 16px; }
.td-add { display: grid; gap: 10px; margin: 0; }
.td-add .ui-btn { justify-self: start; }
.td-timelab { font-size: 14px; line-height: 20px; font-weight: 500; }
.td-quiet { display: grid; gap: 6px; padding: 10px 12px; border-radius: var(--r); background: var(--surface-2); }
.td-quiet[hidden] { display: none; }
.td-any { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 500; }

.td-goal .t { font-weight: 500; }
.td-state { color: var(--muted); }
.td-state.ok, .td-pct.ok { color: var(--brand); font-weight: 500; }
.td-pct { font-weight: 600; color: var(--muted); }
.td-key { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; min-height: 52px; }
.td-key .wd-key { margin: 0; font-size: 14px; gap: 6px 14px; }
.td-connect { gap: 10px; }
/* ── Progress and Goals (PR 2): weight first, goals as rows, the week; Goals is where goals change ── */
body.ui-page .page { gap: 0; }
@media (min-width: 1100px) { body.ui-page .page { max-width: 720px; padding-left: 32px; padding-right: 32px; } }
.pg { display: grid; gap: 32px; min-width: 0; font-size: 15px; line-height: 22px; }
.pg h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.pg p { margin: 0; }
.pg-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pg-lede { display: grid; gap: 12px; }
.pg-note { font-size: 14px; line-height: 20px; color: var(--muted); }
.pg-inline { display: inline; min-height: 0; min-width: 0; font-size: inherit; line-height: inherit; }
.pg-end { justify-self: start; margin: -8px 0 -12px; }
.pg-wide { width: 100%; min-height: 48px; font-size: 15px; }
/* Segmented links (tracker, range, period): the current one is a white pill */
.pg-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; padding: 2px; border-radius: 999px; background: var(--surface-2); }
.pg-seg a { position: relative; display: grid; place-items: center; min-height: 40px; border-radius: 999px; color: var(--muted); font: 500 14px/1 var(--font); text-decoration: none; }
.pg-seg a::after { content: ""; position: absolute; inset: -2px 0; }
.pg-seg a:hover { color: var(--ink); }
.pg-seg a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.pg-seg.sm a { min-height: 36px; font-size: 12px; }
.pg-seg.sm a::after { inset: -4px 0; }
.pg-seg a:focus-visible, a.pg-res-body:focus-visible, .pg-edit > summary:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* Tracker card */
.pg-now { display: grid; gap: 4px; }
.pg-big { display: flex; align-items: baseline; gap: 8px; }
.pg-big strong { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -0.03em; }
.pg-big span { color: var(--muted); }
.pg-sub { font-size: 14px; line-height: 20px; color: var(--muted); }
.pg-sub b { color: var(--ink); font-weight: 500; }
.pg-change { color: var(--muted); font-weight: 500; }
.pg-change.ok { color: var(--brand); }
.pg-tracker .tchart { margin: 0; }
.pg-tracker .tc-plot { height: 160px; }
.pg-tracker .tchart figcaption { font-size: 12px; }
.pg-tracker .bmi-scale { margin-top: 0; }
.pg-empty { padding: 24px 8px; border-radius: var(--r); background: var(--surface-2); color: var(--muted); font-size: 14px; line-height: 20px; text-align: center; }
.pg-log { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.pg-step { display: inline-flex; align-items: center; gap: 4px; }
.pg-num { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 10px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); cursor: text; }
.pg-num:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pg-num input { width: 3.4em; padding: 0; border: 0; background: none; color: var(--ink); font: 600 17px var(--font); font-variant-numeric: tabular-nums; text-align: right; outline: none; }
.pg-num > span:last-child { color: var(--muted); font-size: 14px; }
.pg-more { display: flex; flex-wrap: wrap; align-items: flex-start; column-gap: 20px; margin: -8px 0 -12px; }
.pg-more details[open] { flex-basis: 100%; padding-bottom: 12px; }
.pg-count { color: var(--muted); font-weight: 400; margin-left: 4px; }
.pg-field { display: grid; gap: 6px; }
.pg-field label { font-size: 15px; font-weight: 500; }
.pg-field .help { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.pg-field .ui-input { width: 100%; }
.pg-entry-list { list-style: none; margin: 0 0 4px; padding: 0; border: 1px solid var(--line); border-radius: var(--r); }
.pg-entry { display: grid; grid-template-columns: 4.8em minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 8px 4px 8px 12px; }
.pg-entry + .pg-entry { border-top: 1px solid var(--line); }
.pg-entry .d { font-size: 14px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.pg-entry form { margin: 0; }
.pg-entry .el-edit { display: flex; align-items: center; gap: 6px; min-width: 0; }
.pg-entry .el-edit .ui-input { width: 4.6rem; padding: 0 8px; font-variant-numeric: tabular-nums; }
.pg-entry .u { font-size: 14px; color: var(--muted); }
/* A goal (or pattern) as a row */
.pg-item { display: grid; gap: 8px; padding: 14px 16px; min-width: 0; }
.pg-item .hd { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.pg-item .t { font-weight: 500; }
.pg-item .s { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); overflow-wrap: anywhere; }
.pg-item .s b { color: var(--ink); font-weight: 500; }
.pg-area { font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pg-state { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.pg-state.ok { color: var(--brand); }
.ui-tag.ok { background: var(--brand-soft); color: var(--brand-deep); }
.pg-back { font-size: 14px; line-height: 20px; color: var(--muted); }
.pg-back b { color: var(--ink); font-weight: 600; }
.pg-bar { position: relative; height: 6px; margin: 4px 0; border-radius: 999px; background: var(--surface-2); }
.pg-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.pg-bar .bar-expected { top: -4px; bottom: -4px; }
/* This week's dots under M T W T F S S; the key once under the list */
.pg-dots { display: grid; gap: 3px; justify-content: start; }
.pg-days, .pg-dots .wdots { display: grid; grid-template-columns: repeat(7, 22px); gap: 2px; }
.pg-days span { font-size: 12px; line-height: 12px; font-weight: 500; color: var(--muted); text-align: center; }
.pg-dots .wdot { width: 12px; height: 12px; justify-self: center; }
.pg-dots .wdot.missed, .pg-key .wkey.missed { background: color-mix(in srgb, var(--muted) 60%, var(--surface)); }
.pg-dots .wdot.ahead, .pg-key .wkey.ahead { opacity: 1; border-color: color-mix(in srgb, var(--muted) 60%, var(--surface)); }
.pg-dots .wdot.off { background: radial-gradient(circle, color-mix(in srgb, var(--muted) 60%, var(--surface)) 0 2px, transparent 2.5px); }
.pg-key { padding: 12px 16px; }
.pg-key .wd-key { margin: 0; font-size: 12px; gap: 4px 14px; }
.pg-key .wkey { width: 12px; height: 12px; }
/* Goals: Pause, Done and Edit on one line; Edit opens the form under them */
.pg-acts { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; margin-top: 4px; }
.pg-status { display: contents; }
.pg-edit[open] { flex-basis: 100%; display: grid; gap: 14px; }
.pg-edit[open] > summary { justify-self: start; background: var(--brand-soft); color: var(--brand-deep); border-color: transparent; }
.pg-form { display: grid; gap: 14px; margin: 0; }
.pg-form .ui-btn.acc:not(.pg-wide) { justify-self: start; }
.pg-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 14px; cursor: pointer; }
.pg-check input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--brand); }
.pg-del { justify-content: flex-start; color: var(--danger); }
.pg-form .field { gap: 6px; margin: 0; }
.pg-form .field label { font-size: 15px; font-weight: 500; }
.pg-form .field input:not([type="checkbox"]):not([type="radio"]), .pg-form .field select { width: 100%; height: auto; min-height: 44px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); color: var(--ink); font: 400 15px var(--font); }
.pg-form .field input:focus, .pg-form .field select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pg-form .field .help { font-size: 14px; line-height: 20px; }
.pg-addbox { display: grid; gap: 14px; padding: 16px; }
.pg-ask { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; line-height: 20px; }
/* How it's going */
.pg-period { gap: 14px; }
.pg-per { display: grid; grid-template-columns: 40px minmax(0, 1fr) 40px; align-items: center; gap: 8px; }
.pg-per h3 { margin: 0; font-size: 15px; line-height: 22px; font-weight: 600; text-align: center; }
.pg-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); overflow: hidden; border-radius: var(--r); background: var(--surface-2); }
.pg-stats > div { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 12px 14px; box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.pg-stats .v { font-size: 17px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.pg-stats .v small { font-size: 14px; font-weight: 400; color: var(--muted); }
.pg-stats .k { font-size: 12px; line-height: 16px; color: var(--muted); }
.pg-targets { grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); }
.pg-targets > div { padding: 12px 4px; text-align: center; }
.pg-targets .v { font-size: 15px; line-height: 22px; white-space: nowrap; }
.pg-why { margin-top: -4px; padding: 0 4px; }
.pg-why[open] > summary { margin-bottom: 4px; }
.pg-grp { padding: 4px 0 0; }
.pg-results { list-style: none; margin: 0; padding: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); }
.pg-res { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; }
.pg-res + .pg-res { border-top: 1px solid var(--line); }
.pg-res > .s:only-child { grid-column: 1 / -1; }
.pg-res-body { display: grid; gap: 2px; min-width: 0; color: var(--ink); text-decoration: none; }
a.pg-res-body:hover .t { color: var(--brand); }
.pg-res .t { font-weight: 500; }
.pg-res .s { font-size: 14px; line-height: 20px; color: var(--muted); }
.pg-mark { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; }
.pg-mark.hit { background: var(--brand); color: var(--brand-ink); }
.pg-mark.miss { background: var(--surface-2); color: var(--muted); }
.pg-mark.open { border: 1.5px solid color-mix(in srgb, var(--muted) 60%, var(--surface)); }
.pg-pattern .ui-wrap { margin-top: 4px; }
/* ── Settings pages (PR 3): Check-ins & tone, About you, Things I keep in mind. Scoped to .st, so the shared
   _about_card and _moments draw as before in onboarding (PR 4 redoes those). ── */
.st { display: grid; gap: 32px; min-width: 0; font-size: 15px; line-height: 22px; }
.st p { margin: 0; }
.st-head { display: flex; align-items: center; gap: 12px; }
.st-head h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.st-lede, .st-note, .st-empty { font-size: 14px; line-height: 20px; color: var(--muted); }
.st-lede, .st-empty { padding: 0 4px; }
.st-status b { font-weight: 600; }
.st-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; min-width: 0; }
.st-inline .ui-input { flex: 1 1 8rem; width: auto; }
.st-box { display: block; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); font-size: 14px; line-height: 20px; }
.st-box[hidden] { display: none; }
.st-box strong { font-weight: 600; }
.st-box > * + * { margin-top: 8px; }
.st-box .ui-btn { vertical-align: middle; }
.st .st-inline-link { display: inline; min-height: 0; min-width: 0; font-size: inherit; line-height: inherit; text-decoration: underline; text-underline-offset: 3px; }
.st-form { display: grid; gap: 32px; margin: 0; min-width: 0; }
html:has(.st-save) { scroll-padding-bottom: 168px; }

/* Fields: a 15 px label, the input, a 14 px help line */
.st .field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.st .field > label, .st .field > legend { padding: 0; font-size: 15px; line-height: 22px; font-weight: 500; color: var(--ink); }
.st .field > legend { margin-bottom: 8px; }
.st .field .help, .st .help { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.st .field .error { margin: 0; font-size: 14px; line-height: 20px; }
.st .field input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="time"]), .st .field select, .st .field textarea,
.st input.ui-input, .st select.ui-input, .st .activities input, .st .talk textarea {
  width: 100%; min-width: 0; min-height: 44px; height: auto; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r);
  background: var(--surface); color: var(--ink); font: 400 15px/22px var(--font); box-shadow: none; }
.st .field textarea, .st .talk textarea { padding: 10px 12px; resize: vertical; }
.st .field input:focus, .st .field select:focus, .st .field textarea:focus, .st input.ui-input:focus, .st select.ui-input:focus,
.st .activities input:focus, .st .talk textarea:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }
.st .field input::placeholder, .st textarea::placeholder, .st input.ui-input::placeholder { color: var(--muted); opacity: 1; }
.st .field.has-error input, .st .field.has-error select { border-color: var(--danger); }

/* A choice: a segmented row (short, one pick), one option per row (long, one pick), or chips (several) */
.st .st-seg { flex-wrap: nowrap; }
.st .st-seg .pill { position: relative; flex: 1 1 auto; display: block; width: auto; min-width: 0; padding: 0; border: 0; border-radius: 999px; background: none; color: inherit; font: inherit; }
.st .st-seg .pill span { padding: 0 4px; text-align: center; white-space: nowrap; }
.st .st-seg .pill:has(input:checked) { background: none; }
.st .st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st .st-chips .pill { position: relative; display: inline-flex; width: auto; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--border);
  border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 14px/1.2 var(--font); cursor: pointer; }
.st .st-chips .pill::after { content: ""; position: absolute; inset: -2px; }
.st .st-chips .pill:hover { border-color: var(--ink); }
.st .st-chips .pill:has(input:checked) { background: var(--brand-soft); border-color: transparent; color: var(--brand-deep); }
.st .st-chips .pill:has(input:checked) span::before { content: "✓"; margin-right: 6px; font-weight: 700; }
.st .st-opts { display: grid; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.st .st-opts .pill { position: relative; display: flex; width: auto; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px;
  border: 0; border-radius: 0; background: var(--surface); color: var(--ink); font: 400 15px/22px var(--font); cursor: pointer; }
.st .st-opts .pill + .pill { border-top: 1px solid var(--line); }
.st .st-opts .pill::after { content: ""; flex: none; box-sizing: border-box; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); }
.st .st-opts .pill:has(input:checked) { background: var(--surface); font-weight: 500; }
.st .st-opts .pill:has(input:checked)::after { border: 7px solid var(--brand); }
.st .st-chips .pill:has(input:focus-visible), .st .st-opts .pill:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }

/* Switches: check-in toggles and the feedback consent */
.st .moment input[type="checkbox"], .st .st-toggle input[type="checkbox"] { appearance: none; -webkit-appearance: none; position: relative; flex: none; width: 44px; height: 26px;
  margin: 0; border-radius: 13px; background: color-mix(in srgb, var(--muted) 55%, var(--surface)); cursor: pointer; transition: background 0.15s; accent-color: auto; }
.st .moment input[type="checkbox"]::before, .st .st-toggle input[type="checkbox"]::before { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 0.2); transition: transform 0.15s; }
.st .moment input[type="checkbox"]::after, .st .st-toggle input[type="checkbox"]::after { content: ""; position: absolute; inset: -9px 0; }
.st .moment input[type="checkbox"]:checked, .st .st-toggle input[type="checkbox"]:checked { background: var(--brand); }
.st .moment input[type="checkbox"]:checked::before, .st .st-toggle input[type="checkbox"]:checked::before { transform: translateX(18px); }
.st .moment input[type="checkbox"]:focus-visible, .st .st-toggle input[type="checkbox"]:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.st .st-toggle label { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 44px; font-weight: 400; cursor: pointer; }
.st .st-toggle label > span { order: -1; }
@media (prefers-reduced-motion: reduce) { .st .moment input[type="checkbox"], .st .st-toggle input[type="checkbox"], .st .moment input[type="checkbox"]::before,
  .st .st-toggle input[type="checkbox"]::before { transition: none; } }

/* Times: a 44 px pill, the phone's own picker */
.st input[type="time"] { width: auto; min-width: 0; height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 500 15px var(--font); }
.st input[type="time"]:focus { outline: 2px solid var(--brand); outline-offset: 1px; }

/* Check-ins & tone */
.st-card { gap: 16px; }
.st-times .moments { display: block; margin: 0; padding: 0; border: 0; min-width: 0; }
.st-times .moments > legend { display: block; padding: 10px 4px; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.01em; }
.st-times .moments > .help { margin: 0 0 8px; padding: 0 4px; }
.st .moment { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 12px 16px; border: 0; border-top: 1px solid var(--line);
  border-radius: 0; background: var(--surface); }
.st .moments > .help + .moment, .st .moments > legend + .moment { border-top: 0; border-radius: var(--r) var(--r) 0 0; }
.st .moment:last-child { border-radius: 0 0 var(--r) var(--r); }
.st .moment .m-on, .st .moment .m-on > span { display: contents; }
.st .moment input[type="checkbox"] { grid-column: 1; grid-row: 1; }
.st .moment strong { grid-column: 2; grid-row: 1; font-size: 15px; font-weight: 500; cursor: pointer; }
.st .moment input[type="time"] { grid-column: 3; grid-row: 1; }
.st .moment .di-sub { grid-column: 1 / -1; grid-row: 2; font-size: 14px; line-height: 20px; color: var(--muted); cursor: pointer; }
.st .moment .error { grid-column: 1 / -1; margin: 4px 0 0; }
.st .moment:has(input[type="checkbox"]:not(:checked)) strong, .st .moment:has(input[type="checkbox"]:not(:checked)) input[type="time"] { color: var(--muted); }
.st-rows { display: grid; margin: -6px 0; }
.st .set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; border-top: 1px solid var(--line); }
.st .set-row:first-child { border-top: 0; }
.st .set-row label { font-size: 15px; font-weight: 500; }
.st-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 2; margin-top: -16px; padding: 16px 0 8px; background: linear-gradient(transparent, var(--bg) 16px); }
.st-save .ui-btn { width: 100%; min-height: 48px; font-size: 15px; }
@media (min-width: 900px) { .st-save { bottom: 0; padding-bottom: 16px; } }

/* About you: tell, then the details under one heading, grouped */
.st-about .talk, .st-about .card-form { display: grid; gap: 12px; margin: 0; padding: 16px; border: 0; border-radius: var(--r); background: var(--surface); min-width: 0; animation: none; }
.st-about .talk-label { font-size: 17px; line-height: 24px; font-weight: 600; }
.st-about .talk-brief { margin: -4px 0 4px; }
.st-about .talk .mic { width: 100%; min-height: 44px; justify-content: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); }
.st-about .talk .mic:hover { border-color: var(--ink); }
.st-about .why-box { display: grid; gap: 8px; margin: 4px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.st-about .why-box .talk-label { font-size: 15px; line-height: 22px; font-weight: 500; }
.st-about .why-box .talk-label .muted { font-weight: 400; color: var(--muted); }
.st-about .talk > .button, .st-about .card-form > .button { width: 100%; min-height: 48px; margin: 4px 0 0; border-radius: 999px; font: 600 15px var(--font); box-shadow: none; }
.st-about .talk > .button { border: 0; background: var(--brand-soft); color: var(--brand-deep); }
.st-about .card-form > .button { border: 1px solid var(--ink); background: var(--ink); color: var(--bg); }
.st-about .card-form { gap: 20px; }
.st-about .card-form h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.st-about .got-sub, .st-about .activities > legend, .st-about .got-health > .got-sub { margin: 0; padding: 16px 0 0; border-top: 1px solid var(--line); font-size: 12px; line-height: 16px;
  font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.st-about .activities > legend { float: left; width: 100%; margin-bottom: 12px; }
.st-about .got-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; }
.st-about .got-grid > .choices, .st-about .got-grid > .ftin { grid-column: 1 / -1; }
.st-about .ftin-row { display: flex; gap: 12px; }
.st-about .ftin-box > span { font-size: 15px; font-weight: 500; }
.st-about .activities { display: grid; gap: 8px; }
.st-about .activities .act-head { clear: both; margin: 0; font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted); }
.st-about .activities .act-row { margin: 0; }
.st-about .add-activity { justify-self: start; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); }
.st-about .got-health { display: grid; gap: 20px; }
.st-about .hint.warn { margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-size: 14px; line-height: 20px; }
.st-about .help.center { padding: 0 4px; text-align: left; }

/* Things I keep in mind */
.st-mems > li { min-width: 0; }
.st-mem { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 4px; align-items: start; padding: 8px 8px 8px 16px; }
.st-mem .mem-edit summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 44px; list-style: none; cursor: pointer; }
.st-mem .mem-edit summary::-webkit-details-marker { display: none; }
.st-mem .mem-edit .t { min-width: 0; overflow-wrap: anywhere; }
.st-mem .d, .st .trend-said .d { color: var(--muted); font-size: 14px; }
.st-mem .mem-edit[open] summary .ui-btn { display: none; }
.st-mem .mem-edit .st-inline { margin: 4px 0 8px; }
.st-mem > form { margin: 0; }
.st-add { padding: 12px 16px; }
.st-trends { display: grid; gap: 8px; }
.st-trend { display: grid; gap: 12px; padding: 12px 16px 8px; font-size: 14px; line-height: 20px; }
.st-trend ul { margin: 0; padding-left: 18px; display: grid; gap: 6px; }
.st-trend .trend-said { list-style: none; padding: 0; }
.st-trend .trend-said li { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-trend form { margin: 0; }
.st-trend .ui-link { justify-content: flex-start; font-size: 14px; }

/* ── Plan pages (PR 5): Tomorrow, This week, Usual days and the checklist. Scoped to .pl, so the usual-days card
   draws as before in onboarding (PR 4 redoes it). The checklist is also .st, for the settings pages' fields. ── */
.pl { display: grid; gap: 32px; min-width: 0; font-size: 15px; line-height: 22px; }
.pl p { margin: 0; }
.pl h1 { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.02em; }
.pl > .pl-tabs { margin-bottom: -12px; }
.pl > .st-head + .pl-head { margin-top: -16px; }
.pl-head { display: grid; gap: 12px; min-width: 0; }
.pl-title { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; }
.pl .st-head .ui-tag { margin-left: auto; }
.pl .ui-tag.ok { background: var(--brand-soft); color: var(--brand-deep); }
.pl-note { font-size: 14px; line-height: 20px; color: var(--muted); }
.pl-pad { padding: 0 4px; }
.pl-box { display: block; margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-size: 14px; line-height: 20px; }
.pl-box strong { font-weight: 600; }
.pl-box > * + * { margin-top: 8px; }
.pl .pl-box a, .pl-empty a { color: var(--brand); font-weight: 500; }
.pl .max-reply { margin: 0; }
.pl .max-reply .you-said { margin: 0; color: var(--muted); font-size: 14px; }
.pl .pl-inline { display: inline; min-height: 0; min-width: 0; font-size: inherit; line-height: inherit; }
.pl-empty { font-size: 14px; line-height: 20px; color: var(--muted); }
.pl-card { gap: 12px; }
.pl-end { justify-self: start; margin: -4px 0 -12px; padding: 0 4px; }
.pl-grp { margin: 4px 0 -4px; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pl-label { margin: 4px 0 -4px; font-size: 15px; font-weight: 500; }
.pl-wide, .pl-go .ui-btn { width: 100%; min-height: 48px; font-size: 15px; }
.pl-go { margin: 4px 0 0; }
.pl .n { font-size: 14px; line-height: 20px; color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }

/* Tomorrow: meals as rows (the meal over what's in it, kcal on the right); the gap with its one button */
.pl-rows { list-style: none; margin: 0 -16px; padding: 0; }
.pl-rows > li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 16px; }
.pl-rows > li + li { border-top: 1px solid var(--line); }
.pl-rows .k { display: block; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pl-rows .t { display: block; font-weight: 500; overflow-wrap: anywhere; }
.pl-rows .n { white-space: nowrap; }
.pl .um-vague { font-style: normal; font-weight: 400; color: var(--muted); }
.pl .um-vague a { color: var(--brand); }
.pl-box.pl-gap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.pl-gap > * + * { margin-top: 0; }

/* This week: the numbers as pills, this week's goals as rows with a mark, each day as a row */
.pl .pl-nums { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; font-weight: 400; }
.pl .pl-nums span { padding: 6px 12px; border-radius: 999px; background: var(--surface-2); font-size: 14px; line-height: 20px; font-weight: 500; }
.pl .pl-targets { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.pl .pl-targets li { display: flex; align-items: center; min-height: 44px; padding: 0; border-radius: 0; background: none; font-size: 15px; line-height: 22px; font-weight: 500; }
.pl .pl-targets li + li { border-top: 1px solid var(--line); }
.pl .pl-results { display: grid; gap: 0; margin: 0; padding: 0; }
.pl .pl-results .result { display: grid; grid-template-columns: 24px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border: 0; border-radius: 0; background: none; }
.pl .pl-results .result + .result { border-top: 1px solid var(--line); }
.pl .pl-results .r-mark { display: grid; place-items: center; width: 24px; height: 24px; margin-top: 1px; border-radius: 50%; background: none; }
.pl .r-mark i { position: relative; display: block; box-sizing: border-box; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--muted); }
.pl .result.hit .r-mark i { background: var(--brand); border-color: var(--brand); }
.pl .result.hit .r-mark i::after { content: ""; position: absolute; left: 50%; top: 45%; width: 30%; height: 55%; border: solid var(--brand-ink); border-width: 0 2px 2px 0; transform: translate(-50%, -50%) rotate(45deg); }
.pl .result.miss .r-mark i { background: var(--surface-2); border-color: transparent; }
.pl .result.miss .r-mark i::before, .pl .result.miss .r-mark i::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; border-radius: 1px; background: var(--muted); transform: translate(-50%, -50%) rotate(45deg); }
.pl .result.miss .r-mark i::after { transform: translate(-50%, -50%) rotate(-45deg); }
.pl .r-body { display: grid; min-width: 0; }
.pl .r-body .t { font-weight: 500; }
.pl .r-body .s { font-size: 14px; line-height: 20px; color: var(--muted); }
.pl .pl-days { display: block; margin: 0; padding: 0; list-style: none; background: var(--surface); border-radius: var(--r); overflow: hidden; }
.pl .pl-days .wd { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 12px; align-items: center; min-height: 60px; padding: 8px 16px; border: 0; border-radius: 0; background: none; }
.pl .pl-days .wd + .wd { border-top: 1px solid var(--line); }
.pl .pl-days .wd.today { box-shadow: inset 3px 0 0 var(--brand); }
.pl .wd-day { display: flex; flex-direction: column; align-self: start; padding-top: 2px; font-size: 15px; line-height: 20px; font-weight: 600; }
.pl .wd-day small { font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.pl .wd.today .wd-day, .pl .wd.today .wd-day small { color: var(--brand); }
.pl .wd-body { display: grid; gap: 4px; min-width: 0; }
.pl .wd-session { display: flex; align-items: flex-start; gap: 4px; min-width: 0; }
.pl .wd-session form { margin: -10px 0 -10px -10px; }
.pl .wd-session.has-tick .wd-what { padding-top: 1px; }
.pl .wd-what { min-width: 0; }
.pl .wd-what strong { font-size: 15px; font-weight: 500; }
.pl .wd-what .ui-tag { margin-left: 4px; }
.pl .wd-what .s { display: block; font-size: 14px; line-height: 20px; color: var(--muted); }
.pl .wd-session.done .wd-what strong { text-decoration: line-through; color: var(--muted); }
.pl .wd-rest { color: var(--muted); }
.pl-card .pl-days { margin: 0 -16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); border-radius: 0; }
.pl .plan-notes { display: grid; gap: 6px; margin: 0; padding: 12px 14px; list-style: none; color: var(--ink); font-size: 14px; }
.pl .usual-week { display: block; margin: 0; gap: 0; }
.pl .usual-week li { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; min-height: 52px; padding: 8px 16px; border-radius: 0; font-size: 15px; }
.pl .usual-week li + li { border-top: 1px solid var(--line); }
.pl .usual-week li.today { background: none; box-shadow: inset 3px 0 0 var(--brand); }
.pl .usual-week li.past { opacity: 1; color: var(--muted); }
.pl .usual-week .uw-day { font-weight: 600; }
.pl .usual-week .uw-day small { color: var(--brand); font-size: 12px; font-weight: 600; }
.pl .usual-week .uw-num { font-size: 14px; line-height: 20px; color: var(--muted); }
@media (max-width: 400px) { .pl .usual-week li { grid-template-columns: 4.5rem minmax(0, 1fr); } .pl .usual-week .uw-num { grid-column: 2; text-align: left; } }

/* Talking to Max: a card with the question, the box, Talk (outline) and the one ink button */
.pl .talk { display: grid; gap: 12px; margin: 0; padding: 16px; border-radius: var(--r); background: var(--surface); min-width: 0; }
.pl .talk-label { font-size: 17px; line-height: 24px; font-weight: 600; }
.pl .talk-brief { margin: -4px 0 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.pl .talk textarea { width: 100%; min-width: 0; min-height: 96px; padding: 10px 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); color: var(--ink);
  font: 400 15px/22px var(--font); resize: vertical; box-shadow: none; }
.pl .talk textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pl .talk textarea::placeholder { color: var(--muted); opacity: 1; }
.pl .talk-actions { display: grid; grid-template-columns: minmax(0, 1fr); justify-content: stretch; gap: 8px; }
.pl .talk .talk-actions .mic-wrap { display: grid; gap: 6px; width: 100%; }
.pl .talk .mic { width: 100%; min-height: 44px; justify-content: center; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px var(--font); }
.pl .talk .mic:hover { border-color: var(--ink); }
.pl .talk .mic[data-state="recording"] { background: var(--danger); border-color: var(--danger); color: #fff; }
.pl .talk-actions .ui-btn { width: 100%; min-height: 48px; font-size: 15px; }

/* Usual days: each kind of day is a card of meal rows; a whole row opens that meal */
.pl-usual { display: grid; gap: 16px; min-width: 0; }
.pl-usual .redo-week { margin: -8px 0 0; }
.pl-usual .redo-week > summary { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; color: var(--brand); font-size: 15px; font-weight: 500; }
.pl-usual .redo-week[open] > summary { margin-bottom: 8px; }
.pl-usual .button { position: relative; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); box-shadow: none; white-space: nowrap; cursor: pointer; }
.pl-usual .button::after { content: ""; position: absolute; inset: -2px; }
.pl-usual .button:hover { border-color: var(--ink); }
.pl-usual .button.primary { border-color: transparent; background: var(--brand-soft); color: var(--brand-deep); }
.pl-usual .button.wide { width: 100%; min-height: 48px; font-size: 15px; }
.pl-usual .usual-days > form > .button.primary { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.pl-usual .button.danger-text { border-color: transparent; background: transparent; color: var(--muted); }
.pl-usual select, .pl-usual input[type="text"] { min-height: 44px; min-width: 0; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: 400 15px var(--font); box-shadow: none; }
.pl-usual select:focus, .pl-usual input[type="text"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.pl-usual .plan-for-me { margin: 0; border-radius: var(--r); background: var(--surface); overflow: hidden; }
.pl-usual .plan-for-me > summary { display: flex; align-items: center; gap: 6px; min-height: 56px; padding: 12px 16px; list-style: none; cursor: pointer; }
.pl-usual .plan-for-me > summary::-webkit-details-marker { display: none; }
.pl-usual .plan-for-me > summary strong { color: var(--brand); font-weight: 600; }
.pl-usual .pfm-form { display: grid; gap: 16px; margin: 0; padding: 0 16px 16px; }
.pl-usual .pfm-form fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.pl-usual .pfm-form legend { margin-bottom: 8px; padding: 0; font-size: 15px; font-weight: 500; }
.pl-usual .pfm-form .help { font-size: 14px; line-height: 20px; color: var(--muted); }
.pl-usual .pills .pill { position: relative; display: inline-flex; width: auto; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--ink); font: 500 14px/1.2 var(--font); cursor: pointer; }
.pl-usual .pills .pill::after { content: ""; position: absolute; inset: -2px; }
.pl-usual .pills .pill:hover { border-color: var(--ink); }
.pl-usual .pills .pill:has(input:checked) { border-color: transparent; background: var(--brand-soft); color: var(--brand-deep); }
.pl-usual .pills .pill:has(input:checked) span::before { content: "✓"; margin-right: 6px; font-weight: 700; }
.pl-usual .pills .pill:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.pl-usual .usual-days { display: grid; gap: 16px; margin: 0; }
.pl-usual .usual-days > h2 { margin: 0; padding: 0 4px; font-size: 17px; line-height: 24px; font-weight: 600; }
.pl-usual .usual-days > .help { padding: 0 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.pl-usual .usual-day { display: grid; gap: 12px; padding: 16px; border: 0; border-radius: var(--r); background: var(--surface); min-width: 0; }
.pl-usual .usual-day header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.pl-usual .usual-day header strong { font-size: 17px; line-height: 24px; font-weight: 600; }
.pl-usual .chip { flex: none; padding: 2px 8px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.pl-usual .chip.est { background: var(--surface-2); color: var(--ink); }
.pl-usual .usual-meals { display: block; margin: 0 -16px; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.pl-usual .usual-meals li { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; align-items: center; padding: 10px 16px; font-size: 15px; }
.pl-usual .usual-meals li { border-bottom: 0; }
.pl-usual .usual-meals li + li { border-top: 1px solid var(--line); }
.pl-usual .um-type { grid-column: 1; font-size: 12px; line-height: 16px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.pl-usual .um-what { grid-column: 1; font-weight: 500; overflow-wrap: anywhere; }
.pl-usual .um-num { grid-column: 2; grid-row: 1 / span 2; font-size: 14px; line-height: 20px; color: var(--muted); white-space: nowrap; }
.pl-usual .um-editable .um-what a::after { content: ""; position: absolute; inset: 0; }
.pl-usual .um-editable:hover { background: var(--surface-2); }
.pl-usual .um-editable .um-what a:focus-visible { outline: none; }
.pl-usual .um-editable:has(a:focus-visible) { outline: 2px solid var(--brand); outline-offset: -2px; }
.pl-usual .um-check { grid-column: 1 / -1; margin: 4px 0 0; }
.pl-usual .um-edit { grid-column: 1 / -1; margin: 4px 0 0; }
.pl-usual .um-edit > summary, .pl-usual .um-add > summary { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink); font-size: 14px; font-weight: 600; }
.pl-usual .um-edit[open] > summary { color: var(--muted); }
.pl-usual .um-add { margin: 0; padding: 0; border: 0; }
.pl-usual .um-edit-form { display: grid; gap: 8px; margin-top: 8px; }
.pl-usual .um-edit-form input[name="text"] { padding: 0 12px; border: 1px solid var(--field-line); background: var(--surface); }
.pl-usual .um-edit-form select { justify-self: start; }
.pl-usual .usual-total { margin: 0; font-weight: 600; }
.pl-usual .usual-total .di-sub { font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted); }
.pl-usual .hint { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.pl-usual .hint.tip, .pl-usual .warn-box, .pl-usual .check-estimates { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); }
.pl-usual .check-estimates a { color: var(--brand); font-weight: 500; }
.pl-usual .ud-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pl-usual .add-usual-meal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.pl-usual .change-days { flex-basis: 100%; margin: 0; }
.pl-usual .change-days > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--brand); font-size: 15px; font-weight: 500; list-style: none; }
.pl-usual .change-days > summary::-webkit-details-marker { display: none; }
.pl-usual .day-picks { gap: 8px; margin-top: 4px; }
.pl-usual .day-pick { position: relative; }
.pl-usual .day-pick span::after { content: ""; position: absolute; inset: -2px; }
.pl-usual .day-pick span { position: relative; display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-color: var(--border); font-size: 14px; font-weight: 600; }
.pl-usual .day-pick input:checked + span { border-color: transparent; background: var(--brand-soft); color: var(--brand-deep); }
.pl-usual .day-picks .button.primary { min-height: 40px; border-color: var(--ink); background: var(--surface); color: var(--ink); }
.pl-usual .usual-days > form { margin: 0; }
.pl-usual details > summary::-webkit-details-marker { display: none; }
.pl-usual details > summary { list-style: none; cursor: pointer; }

/* The checklist: each item a row with Edit; open, its form and Stop */
.pl .routine-list { display: block; gap: 0; margin: 0; padding: 0; }
.pl .routine details { padding: 0; border-radius: 0; background: none; }
.pl .routine summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; min-height: 60px; padding: 10px 12px 10px 16px; list-style: none; cursor: pointer; }
.pl .routine summary::-webkit-details-marker { display: none; }
.pl .routine summary:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.pl .rt-main { display: grid; gap: 2px; min-width: 0; }
.pl .rt-main .t { font-weight: 500; overflow-wrap: anywhere; }
.pl .rt-amount, .pl .rt-when, .pl .rt-today, .pl .rt-muted { font-size: 14px; line-height: 20px; color: var(--muted); }
.pl .rt-main .ui-tag { justify-self: start; margin-top: 4px; }
.pl .routine details[open] > summary .rt-edit { visibility: hidden; }
.pl .routine.paused .rt-main .t { color: var(--muted); }
.pl .rt-body { display: grid; gap: 12px; padding: 4px 16px 16px; }
.pl .pl-form { display: grid; gap: 20px; margin: 0; }
.pl .stop-form { justify-self: start; margin: 0; }
.pl .add-routine > summary h2 { display: block; margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.pl .add-routine > summary::after, .pl .add-routine > summary h2::after { content: none; }
.pl .add-routine > form { padding: 16px; }
.pl .dt-quiet { padding: 0; background: none; }

/* ── Log pages (PR 6): Log, Log food and the meal editor, a meal of the day, exercise, workouts and planned movement,
   Body & mood, My foods. Each page is .st .pl .lg: PR 3's fields, PR 5's notes, and these rules on top. ── */
.lg-under { margin-top: -20px; }
.lg .ui-link, .lg a.ui-row { text-decoration: none; }
.lg a.ui-row { color: var(--ink); }
.lg a.ui-row:hover { background: var(--surface-2); }
.lg a.ui-row:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.lg .ui-row .ui-chev { color: var(--muted); }
.lg-add { gap: 16px; }
.lg-line { display: flex; align-items: center; gap: 8px; min-width: 0; }
.lg .lg-line > input, .lg .lg-line > select { flex: 1 1 auto; width: auto; min-width: 0; }
.lg-line > .ui-btn { flex: none; }
.lg .thinking { margin: -4px 0 0; color: var(--muted); font-size: 14px; font-weight: 500; }
.lg-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.lg .lg-form { gap: 20px; margin: 0; }
.lg-del { justify-self: center; margin: -8px 0 0; }
.lg-left { justify-self: start; }
.lg-empty, .lg-none { font-size: 14px; line-height: 20px; color: var(--muted); }
.lg-none { padding: 12px 16px; }
.lg .r-add input, .lg .r-add select, .lg .step-value, .lg .each input, .lg .el-edit input, .lg .portion-edit input, .lg .row-form input,
.lg .row-form select, .lg .lr-in input, .lg .meal-when input {
  height: 44px; min-height: 44px; min-width: 0; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface);
  color: var(--ink); font: 400 15px var(--font); box-shadow: none; }
.lg .r-add input:focus, .lg .r-add select:focus, .lg .step-value:focus, .lg .each input:focus, .lg .el-edit input:focus, .lg .portion-edit input:focus,
.lg .row-form input:focus, .lg .row-form select:focus, .lg .lr-in input:focus, .lg .meal-when input:focus { outline: none; border-color: var(--ink); background: var(--surface); box-shadow: 0 0 0 3px var(--brand-soft); }

/* Search results (food and activity): a row each, with its amount and Add on the line under */
.lg .lg-results { margin: 0 -16px -16px; border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
.lg .lg-results .result { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; align-items: center; padding: 12px 16px; border: 0; border-radius: 0; background: none; }
.lg .lg-results .result + .result { border-top: 1px solid var(--line); }
.lg .r-name { display: grid; gap: 2px; min-width: 0; }
.lg .r-name strong { font-weight: 500; }
.lg .r-name .di-sub { font-size: 14px; line-height: 20px; font-weight: 400; }
.lg .r-name .ui-tag { justify-self: start; }
.lg .r-add { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.lg .r-add input { width: 4.5rem; flex: none; text-align: center; }
.lg .r-add select { flex: 1 1 6rem; width: auto; }
.lg .r-add .di-sub { font-size: 14px; }

/* The meal editor */
.lg .lg-draft { gap: 16px; }
.lg .draft-head { margin: 0; }
.lg .draft-head h2 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.lg .meal-meta { display: grid; gap: 12px; margin: 0; }
.lg .seg-tabs { gap: 2px; padding: 2px; border-radius: var(--r); }
.lg .seg-tab span { display: grid; place-items: center; min-height: 44px; padding: 0 8px; border-radius: 10px; font: 500 14px/18px var(--font); color: var(--muted); }
.lg .seg-tab input:checked + span { font-weight: 500; color: var(--ink); }
.lg .seg-tab input:focus-visible + span { outline: 2px solid var(--brand); }
.lg .meal-meta .seg-tabs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.lg .meal-when { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto auto; grid-auto-flow: column; gap: 6px 12px; margin: 0; }
.lg .meal-when label { font-size: 14px; font-weight: 500; color: var(--muted); }
.lg .meal-when input { width: 100%; }
.lg .ask-portion { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); color: var(--ink); font-size: 14px; line-height: 20px; }
.lg .ask-portion > span { flex-basis: 100%; }
.lg .chip-btn.ui-btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); }
.lg .chip-btn.ui-btn.acc { border-color: transparent; background: var(--brand-soft); color: var(--brand-deep); }
.lg .chip-btn.ui-btn.sq { width: 40px; padding: 0; }
.lg .draft-items { display: block; margin: 0 -16px; padding: 0; list-style: none; }
.lg .draft-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 4px; align-items: start; padding: 12px 8px 14px 16px; border: 0; border-top: 1px solid var(--line); border-radius: 0; background: none; }
.lg .di-name { grid-column: 1; grid-row: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; min-width: 0; }
.lg .di-name > strong { font-size: 15px; font-weight: 500; }
.lg .di-name .di-sub { flex-basis: 100%; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--muted); }
.lg .di-name .di-sub strong { font-weight: 600; color: var(--ink); }
.lg .chip { padding: 2px 8px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 600; }
.lg .chip.est { color: var(--ink); }
.lg .chip.mine { background: var(--brand-soft); color: var(--brand-deep); }
.lg .draft-item > form:last-child { grid-column: 2; grid-row: 1; margin: -6px 0 0; }
.lg .di-qty { grid-column: 1 / -1; grid-row: 2; display: grid; gap: 10px; width: auto; margin: 0; padding-right: 8px; }
.lg .stepper { display: flex; align-items: center; gap: 8px; }
.lg .stepper .step-btn { width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 500 18px/1 var(--font); }
.lg .stepper .step-btn:hover { border-color: var(--ink); }
.lg .di-qty .step-value { width: 4.5rem; text-align: center; font-weight: 600; }
.lg .di-qty .seg-tabs.units { display: flex; flex-wrap: nowrap; overflow-x: auto; border-radius: 999px; scrollbar-width: none; }
.lg .di-qty .seg-tabs.units::-webkit-scrollbar { display: none; }
.lg .seg-tabs.units .seg-tab { flex: none; }
.lg .seg-tabs.units .seg-tab span { padding: 0 12px; border-radius: 999px; font-size: 14px; }
.lg .di-qty .each { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); }
.lg .di-qty .each input { width: 4.5rem; text-align: center; }
.lg .macro-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin: 0; border-radius: var(--r); overflow: hidden; }
.lg .macro-tiles .mt, .lg .macro-tiles .mt.kcal { display: grid; gap: 0; padding: 10px 4px; border-radius: 0; background: var(--surface-2); text-align: center; }
.lg .macro-tiles .mt strong, .lg .macro-tiles .mt.kcal strong { font-size: 17px; line-height: 24px; font-weight: 600; color: var(--ink); }
.lg .macro-tiles .mt span, .lg .macro-tiles .mt.kcal span { font-size: 12px; line-height: 16px; color: var(--muted); }
.lg-save { width: 100%; min-height: 48px; font-size: 15px; }

/* A meal of the day: each bit a row with its actions under it */
.lg .lg-bit { display: grid; gap: 10px; padding: 12px 16px; }
.lg .slot-top { display: grid; gap: 2px; min-width: 0; }
.lg .slot-top .t { font-weight: 500; }
.lg .slot-top .s { font-size: 14px; line-height: 20px; color: var(--muted); }

/* Body & mood */
.lg-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin: 0; }
.lg .lg-weigh { gap: 12px; }
.lg .weigh { display: grid; justify-items: center; gap: 4px; margin: 0; padding: 4px 0 0; border: 0; border-radius: 0; background: none; }
.lg .weigh-label { font-size: 15px; font-weight: 500; color: var(--ink); }
.lg .weigh-row { display: flex; align-items: center; justify-content: center; gap: 12px; }
.lg .weigh-row .step-btn { width: 44px; height: 44px; font-size: 20px; }
.lg .weigh-row .step-btn.plus { background: var(--surface); color: var(--ink); border-color: var(--border); }
.lg .weigh-num { display: inline-flex; align-items: baseline; gap: 4px; }
.lg .weigh-num input#weight { width: 6.5rem; min-height: 0; height: auto; padding: 0; border: 0; background: none; box-shadow: none; text-align: right; font: 600 40px/44px var(--font); letter-spacing: -0.03em; color: var(--ink); }
.lg .weigh-num input#weight:focus { outline: none; box-shadow: 0 2px 0 var(--brand); border-radius: 0; }
.lg .weigh-num input#weight::placeholder { color: var(--muted); opacity: 1; }
.lg .weigh-num span { font-size: 15px; font-weight: 500; color: var(--muted); }
.lg .trend-card { display: grid; gap: 4px; margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); border-radius: 0; background: none; color: var(--brand); }
.lg .trend-card .tc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; color: var(--ink); }
.lg .trend-card .tc-head .t { font-weight: 500; }
.lg .trend-card .ok-text { font-size: 14px; font-weight: 500; color: var(--brand); }
.lg .lg-more { margin: 0 -16px -16px; border-top: 1px solid var(--line); }
.lg .lg-more > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 16px; color: var(--ink); font-size: 15px; font-weight: 500; list-style: none; cursor: pointer; }
.lg .lg-more > summary::-webkit-details-marker { display: none; }
.lg .lg-more[open] .ui-chev { transform: rotate(180deg); }
.lg .lg-more[open] > summary { margin: 0; }
.lg .list-rows { display: grid; margin: 0; padding: 0 16px 8px; border-radius: 0; background: none; }
.lg .list-rows .lr { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 6px 0; border: 0; border-top: 1px solid var(--line); font-size: 15px; font-weight: 400; }
.lg .lr-in { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 14px; }
.lg .lr-in input { width: 5.5rem; text-align: right; }
.lg .list-rows input[type="date"], .lg .list-rows input[type="time"] { width: auto; height: 44px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--surface-2); color: var(--ink); font: 500 15px var(--font); }
.lg .lg-group { gap: 16px; }
.lg-ct { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
.lg .scale { display: grid; gap: 8px; }
.lg .scale legend { margin: 0 0 8px; }
.lg .scale legend .di-sub { display: inline; margin-left: 6px; font-size: 14px; font-weight: 400; color: var(--muted); }
.lg .lg-scale { display: flex; }
.lg .lg-scale .scale-opt { position: relative; display: block; flex: 1; margin: 0; padding: 0; border: 0; background: none; }
.lg .lg-scale .scale-opt span { display: grid; place-items: center; min-height: 44px; width: auto; height: auto; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--muted); font: 500 15px var(--font); }
.lg .lg-scale .scale-opt input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / 0.12); }
.lg .lg-facts .ui-row { min-height: 52px; }
.lg .lg-facts .n { font-weight: 500; color: var(--ink); font-size: 15px; }
.lg .entry-list { display: block; margin: 0; padding: 0; }
.lg .entry-list li { display: grid; grid-template-columns: 3rem minmax(0, 1fr) auto; gap: 6px 8px; align-items: center; min-height: 60px; padding: 8px 8px 8px 16px; border-bottom: 0; }
.lg .entry-list li + li { border-top: 1px solid var(--line); }
.lg .entry-list .el-time { grid-column: 1; grid-row: 1; font-size: 14px; color: var(--muted); }
.lg .entry-list .el-label { grid-column: 2; grid-row: 1; font-weight: 500; overflow-wrap: anywhere; }
.lg .entry-list li > form:last-child { grid-column: 3; grid-row: 1; }
.lg .entry-list .el-edit, .lg .entry-list .el-value { grid-column: 2 / -1; grid-row: 2; }
.lg .entry-list .el-edit { display: flex; align-items: center; gap: 8px; margin: 0; }
.lg .entry-list .el-edit input { width: 5.5rem; }
.lg .entry-list .el-unit, .lg .entry-list .el-value { font-size: 14px; color: var(--muted); }

/* My foods */
.lg .food-list { display: block; margin: 0; }
.lg .food-list li { display: grid; gap: 8px; padding: 12px 16px; border-bottom: 0; }
.lg .food-list li + li { border-top: 1px solid var(--line); }
.lg .fl-main { display: grid; gap: 2px; min-width: 0; }
.lg .fl-main .t { font-weight: 500; }
.lg .fl-main .s { font-size: 14px; line-height: 20px; color: var(--muted); }
.lg .fl-act form { margin: 0; }
.lg .create-food { gap: 16px; }
.lg .cf-amount { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.lg .lg-units { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; background: none; }
.lg .lg-units .seg-tab { flex: none; }
.lg .lg-units .seg-tab span { min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); }
.lg .lg-units .seg-tab span::after { content: ""; position: absolute; inset: -2px; }
.lg .lg-units .seg-tab input:checked + span { border-color: transparent; background: var(--brand-soft); color: var(--brand-deep); box-shadow: none; }
.lg .cf-for { margin: 0; font-size: 14px; color: var(--muted); }
.lg .cf-macros { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 12px; }
.lg .cf-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.lg .cf-actions .ui-btn { flex: 1 1 9rem; min-height: 48px; font-size: 15px; }
.lg-fold { display: grid; gap: 12px; padding: 12px 16px 16px; }
.lg .portion-list { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.lg .portion-list li { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 56px; border-top: 1px solid var(--line); }
.lg .portion-edit { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 15px; }
.lg .portion-edit input { width: 5rem; }
.lg .lg-line select { flex: 0 1 8rem; }
.lg details.more.ui-fold { margin: 0; }
.lg details.more.ui-fold > summary { padding: 12px 16px; color: var(--ink); font-weight: 400; }
.lg .macro-check[hidden] { display: none; }
/* A time beside a number reads as the same kind of box; a long title never squeezes the back button */
.lg .lg-pair input[type="time"] { width: 100%; height: auto; min-height: 44px; padding: 0 12px; border: 1px solid var(--field-line); border-radius: var(--r); background: var(--surface); font: 400 15px/22px var(--font); }
.lg .lg-pair input[type="time"]:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.st-head > .ui-btn.sq { flex: none; }
/* On a Log page the desktop sidebar's "+ Log" was white on white: the current-page rule painted it surface. Keep it ink. */
body.has-nav .topnav .nav-log[aria-current="page"] { background: var(--ink); color: var(--bg); box-shadow: none; }
.lg .list-rows .lr-in { display: grid; grid-template-columns: 5.5rem 1.5rem; }

/* Continue with Google (LLD §6.1): _google_button.html, the "or" line, About me's Signing in card */
.google-form { margin: 0; }
.google-button { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; background: var(--surface); color: var(--ink); border: 1.5px solid var(--border); border-radius: 999px; font-weight: 600; box-shadow: none; }
.google-button:hover { background: var(--surface-2); }
.google-button.small { width: auto; }
.google-g { flex: none; }
.or-line { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: var(--muted); font-size: 0.88rem; }
.or-line::before, .or-line::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.del-actions .google-form .button { width: auto; height: 46px; }
.confirm-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 16px; margin: 0 0 14px; }
.confirm-banner p { margin: 0; font-size: 0.92rem; }
.confirm-banner form { margin: 0; }
/* ── Chat (web redesign PR 7, 23 Nov 2026, LLD 05 §6.3j) ──────────────────────────────────────────────
   One header: below 1100 px the top bar already says Max, so the page's own title is kept for screen readers only
   and the head shows just the WhatsApp / Telegram link. The chat fills the screen between the bars, so the page
   never scrolls behind the thread. Days are a line in the thread, not a sticky chip over the text. */
body.chat-page .page { padding-bottom: 0; }
.ch.card.chat { display: flex; flex-direction: column; gap: 8px; height: calc(100dvh - 72px - 84px - env(safe-area-inset-bottom, 0px)); min-height: 380px; margin: 0; padding: 0; background: none; box-shadow: none; }
@media (min-width: 900px) { .ch.card.chat { height: calc(100dvh - 74px - 16px); } }
@media (min-width: 1100px) { .ch.card.chat { height: calc(100dvh - 28px - 24px); } }
.ch .chat-head { flex: none; display: flex; align-items: center; gap: 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
.ch .chat-head .brand-mark { width: 40px; height: 40px; border-radius: 50%; font-size: 17px; }
.ch .ch-title { min-width: 0; }
.ch .ch-title h1 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: 0; }
.ch .ch-title .help { margin: 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.ch .chat-head .tg { margin-left: auto; flex: none; }
.ch .chat-head .ui-btn { min-height: 40px; padding: 0 14px; border-radius: 999px; font: 600 14px/1 var(--font); text-decoration: none; white-space: nowrap; }
.ch .chat-head .ui-btn.acc { border: 1px solid transparent; background: var(--brand-soft); color: var(--brand-deep); }
.ch .chat-head .chip.ok.ui-btn { border: 1px solid var(--border); background: var(--surface); color: var(--ink); }
@media (max-width: 1099px) {
  .ch .chat-head { justify-content: flex-end; padding: 0; border-bottom: 0; }
  .ch .chat-head .brand-mark { display: none; }
  .ch .ch-title { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ch .chat-head.ch-bare { margin-bottom: -8px; }
}
.ch .thread { flex: 1 1 auto; min-height: 0; max-height: none; gap: 12px; margin: 0; padding: 8px 0; overscroll-behavior: contain; }
.ch .msg { max-width: 85%; }
.ch .b-text { padding: 10px 14px; font-size: 15px; line-height: 22px; }
.ch .msg.assistant .b-text { background: var(--surface); color: var(--ink); box-shadow: none; border-radius: 20px 20px 20px 6px; }
.ch .msg.user .b-text { background: var(--brand); color: var(--brand-ink); border-radius: 20px 20px 6px 20px; }
.ch .msg.safety .b-text { background: var(--brand-soft); border: 0; }
.ch .msg time { padding: 2px 8px 0; font-size: 12px; line-height: 16px; color: var(--muted); }
.ch .thread .day-sep { position: static; align-self: stretch; display: flex; align-items: center; gap: 12px; margin: 8px 0 0; pointer-events: none; }
.ch .thread .day-sep::before, .ch .thread .day-sep::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.ch .thread .day-sep span { padding: 0; border-radius: 0; background: none; box-shadow: none; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--muted); }
.ch .thread .earlier { margin: 0 0 4px; }
.ch .thread .earlier .ui-btn, .ch .b-actions .chip-btn.ui-btn { min-height: 40px; padding: 0 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font: 600 14px/1.2 var(--font); }
.ch .b-actions { gap: 8px; margin-top: 8px; }
.ch .typing { flex: none; padding: 0 8px; }
.ch .composer { flex: none; display: flex; align-items: flex-end; gap: 4px; min-height: 52px; margin: 0 0 8px; padding: 3px 3px 3px 16px; border: 1px solid var(--field-line); border-radius: 26px; background: var(--surface); box-shadow: none; }
.ch .composer:focus-within { border-color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.ch .composer textarea { flex: 1 1 0; min-width: 0; min-height: 44px; max-height: 160px; padding: 11px 0; border: 0; border-radius: 0; background: none; color: var(--ink); font: 400 15px/22px var(--font); resize: none; outline: none; }
.ch .composer textarea:focus { border: 0; background: none; }
.ch .composer textarea::placeholder { color: var(--muted); opacity: 1; }
.ch .composer .mic.icon { width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink); }
.ch .composer .mic.icon:hover { background: var(--surface-2); }
.ch .composer .mic.icon[data-state="recording"] { background: var(--danger); color: #fff; }
.ch .composer .ui-btn.pri { flex: none; min-height: 44px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: var(--bg); font: 600 15px/1 var(--font); }

/* Oriku's home page (oriku.in, 26 Nov 2026): the public styles, with its own hero and agent cards */
.oriku-hero { grid-template-columns: minmax(0, 1fr) !important; padding-top: 28px; }
.oriku-hero .pub-lede { max-width: 58ch; }
.oriku-agent { display: grid; gap: 12px; align-content: start; }
.oriku-agent-head { display: flex; gap: 12px; align-items: center; }
.oriku-agent-head .brand-mark { flex: none; width: 40px; height: 40px; }
.oriku-agent-head strong { display: block; font-size: 1.1rem; color: var(--ink); }
.oriku-agent-head small { color: var(--muted); font-size: 0.85rem; }
.oriku-next { box-shadow: none; border: 1px dashed var(--line); background: transparent; }
.oriku-next .brand-mark { background: var(--surface-2); color: var(--muted); }
.pub-cta a.oriku-mail { color: #fff; font-weight: 600; }
.pubfoot-note a { color: inherit; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
