/* base reset (the artifact host used to provide this) */
html { color-scheme: light; }
body { margin: 0; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Layout: one narrow column like a training card, sticky date header, plate-coloured macros, bottom tab bar for one-handed use at the gym */
:root {
  --bg: #F1F1EC;          /* chalk */
  --surface: #FFFFFF;
  --sunk: #E7E8E2;
  --ink: #17202A;
  --muted: #5D6570;
  --line: #D6D8D1;
  --red: #C9302A;         /* 25 kg plate: protein, PRs */
  --blue: #2A5BC9;        /* 20 kg plate: carbs */
  --yellow: #D29C00;      /* 15 kg plate: fat */
  --green: #2F8A4C;       /* 10 kg plate: on target */
  --red-soft: #F6DEDC;
  --blue-soft: #DEE6F7;
  --yellow-soft: #F6EBC9;
  --green-soft: #DCEFE1;
  --btn: #17202A;
  --btn-ink: #FFFFFF;
  --font-display: "Barlow Condensed", "Arial Narrow", "Roboto Condensed", sans-serif;
  --font-body: "Barlow", "Segoe UI", system-ui, -apple-system, sans-serif;
  --r: 10px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11151A; --surface: #1A2027; --sunk: #232A33; --ink: #ECEEF0; --muted: #9AA3AD; --line: #2E3640;
    --red: #F0625A; --blue: #7099F2; --yellow: #F0C33A; --green: #5CC07C;
    --red-soft: #3A2020; --blue-soft: #1E2A44; --yellow-soft: #3A3218; --green-soft: #1D3325;
    --btn: #ECEEF0; --btn-ink: #11151A; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11151A; --surface: #1A2027; --sunk: #232A33; --ink: #ECEEF0; --muted: #9AA3AD; --line: #2E3640;
  --red: #F0625A; --blue: #7099F2; --yellow: #F0C33A; --green: #5CC07C;
  --red-soft: #3A2020; --blue-soft: #1E2A44; --yellow-soft: #3A3218; --green-soft: #1D3325;
  --btn: #ECEEF0; --btn-ink: #11151A; color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { background: var(--bg); }
body {
  color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  font-variant-numeric: tabular-nums;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.wrap { max-width: 720px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* header */
header.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); border-bottom: 1px solid var(--line); }
header.top .wrap { display: flex; align-items: center; gap: 12px; padding-block: 10px; }
.brand { white-space: nowrap; font-family: var(--font-display); font-weight: 700; font-size: 22px; letter-spacing: .02em; text-transform: uppercase; display: flex; align-items: center; gap: 8px; }
.brand .plate { width: 24px; height: 24px; border-radius: 6px; flex: none; background: var(--logo, url(icons/t/auto-180.png)) center / cover no-repeat; box-shadow: 0 0 0 1px var(--line); }
.datenav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.datenav button { background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }
.datenav .label { font-family: var(--font-display); font-weight: 600; font-size: 17px; min-width: 104px; text-align: center; text-transform: uppercase; letter-spacing: .03em; }
.datenav .label button { width: auto; border: 0; height: auto; font: inherit; display: inline; }
.iconbtn { background: none; border: 1px solid var(--line); border-radius: 8px; width: 34px; height: 34px; display: grid; place-items: center; }
.iconbtn svg, .datenav svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 2; }

main { padding-block: 16px 120px; display: grid; gap: 16px; }
.banner { background: var(--yellow-soft); border: 1px solid var(--yellow); border-radius: var(--r); padding: 10px 12px; font-size: 14px; }

/* sections */
.sec { display: grid; gap: 10px; }
.sec > h2 { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; display: flex; align-items: baseline; gap: 8px; }
.sec > h2 .aside { margin-left: auto; font-family: var(--font-body); font-weight: 500; letter-spacing: 0; text-transform: none; font-size: 13px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-family: var(--font-display); font-weight: 600; letter-spacing: .01em; }

/* macro bars */
.macros { display: grid; gap: 12px; }
.macro { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; }
.macro .k { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 14px; }
.macro .v { font-size: 14px; white-space: nowrap; }
.macro .v b { font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.bar { height: 12px; background: var(--sunk); border-radius: 6px; position: relative; overflow: hidden; }
.bar i { position: absolute; inset: 0 auto 0 0; border-radius: 6px; background: var(--c, var(--ink)); }
.bar.over i { background: repeating-linear-gradient(45deg, var(--c), var(--c) 6px, transparent 6px, transparent 9px), var(--c); opacity: .85; }
.kcal-big { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.kcal-big .n { font-family: var(--font-display); font-weight: 700; font-size: 44px; line-height: 1; }
.kcal-big .of { color: var(--muted); }
.kcal-big .left { margin-left: auto; font-size: 14px; }

.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week button { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 2px 8px; display: grid; gap: 4px; justify-items: center; font-size: 12px; }
.week button.on { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.week .d { font-family: var(--font-display); font-weight: 600; text-transform: uppercase; letter-spacing: .05em; }
.week .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--sunk); border: 1px solid var(--line); }
.week .dot.hit { background: var(--green); border-color: var(--green); }
.week .dot.part { background: var(--yellow); border-color: var(--yellow); }
.week .dot.over { background: var(--red); border-color: var(--red); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* lists */
.rows { display: grid; }
.row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row .t { font-weight: 600; min-width: 0; }
.row .m { font-size: 13px; color: var(--muted); }
.chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 1px 7px; border-radius: 999px; white-space: nowrap; }
.chip.p { background: var(--red-soft); color: var(--red); }
.chip.c { background: var(--blue-soft); color: var(--blue); }
.chip.f { background: var(--yellow-soft); color: var(--yellow); }
.chip.k { background: var(--sunk); color: var(--ink); }
.slotlabel + .row { border-top: 0; }
.slotlabel { font-family: var(--font-display); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: 13px; color: var(--muted); padding-top: 10px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.stepper button { background: none; border: 0; width: 30px; height: 30px; }
.stepper span { min-width: 34px; text-align: center; font-family: var(--font-display); font-weight: 600; }

/* buttons + forms */
.btn { background: var(--btn); color: var(--btn-ink); border: 1px solid var(--btn); border-radius: 8px; padding: 9px 14px; font-weight: 600; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.sm { padding: 5px 10px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: default; }
.linkbtn { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; }
.seg { display: flex; gap: 6px; flex-wrap: wrap; }
.seg button { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; font-weight: 600; font-size: 14px; }
.seg button[aria-pressed="true"] { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); }
label.f { display: grid; gap: 4px; font-size: 13px; color: var(--muted); font-weight: 500; }
input[type=text], input[type=search], input[type=number], input[type=date], select, textarea {
  background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 60px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.formrow { display: flex; gap: 8px; flex-wrap: wrap; align-items: end; }
.formrow > * { flex: 1 1 120px; min-width: 0; }
details.add > summary { list-style: none; cursor: pointer; }
details.add > summary::-webkit-details-marker { display: none; }

/* train */
.ex { display: grid; gap: 8px; }
.ex-head { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.ex-head input { font-family: var(--font-display); font-weight: 700; font-size: 19px; border: 0; border-bottom: 1px dashed var(--line); border-radius: 0; padding: 2px 0; background: transparent; flex: 1 1 200px; }
.ex-head .scheme { font-family: var(--font-display); font-weight: 600; font-size: 16px; color: var(--muted); white-space: nowrap; }
.last { font-size: 13px; color: var(--muted); }
.hint { font-size: 13px; border-radius: 6px; padding: 5px 9px; display: inline-block; }
.hint.up { background: var(--green-soft); color: var(--green); font-weight: 600; }
.hint.hold { background: var(--sunk); color: var(--muted); }
.sets { display: grid; gap: 6px; }
.setrow { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 6px; align-items: center; }
.setrow.half, .sethead.half { grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) 84px; }
.setrow .n { font-family: var(--font-display); font-weight: 700; color: var(--muted); text-align: center; }
.setrow input { text-align: center; padding: 7px 4px; }
.setrow .dropbtn { width: 100%; min-height: 34px; padding: 0 4px; border-radius: 8px; border: 1px dashed var(--line); background: none; color: var(--muted); font-size: 12px; font-weight: 600; white-space: nowrap; }
.setrow .dropbtn[aria-pressed="true"] { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }
.setrow .drop-lbl { text-align: center; color: var(--blue); }
.day-hint { margin-top: 2px; }
.setrow.drop .n { font-size: 11px; color: var(--blue); }
.sethead { display: grid; grid-template-columns: 26px minmax(0, 1fr) minmax(0, 1fr) 84px; gap: 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; font-weight: 600; }
.ex-foot { display: flex; gap: 12px; flex-wrap: wrap; }
.savebar { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 5; display: flex; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; box-shadow: 0 6px 20px rgb(0 0 0 / .12); }
.savebar > .btn { margin-left: auto; white-space: nowrap; }
.timer { display: inline-flex; gap: 4px; align-items: center; flex-wrap: nowrap; }
.timer .btn.sm { padding: 5px 7px; }
.timer .clock { font-family: var(--font-display); font-weight: 700; font-size: 20px; min-width: 42px; }
.timer .clock.done { color: var(--red); }

/* charts */
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--font-body); }
.chart .l1 { fill: none; stroke: var(--red); stroke-width: 2.5; }
.chart .l2 { fill: none; stroke: var(--ink); stroke-width: 2; }
.chart .a1 { fill: var(--red); opacity: .08; }
.chart .p1 { fill: var(--red); }
.chart .p2 { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.chart .end text { fill: var(--ink); font-family: var(--font-display); font-weight: 700; font-size: 14px; }
.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 7px 8px; border-top: 1px solid var(--line); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-top: 0; font-weight: 600; }
td.r, th.r { text-align: right; }
.up-txt { color: var(--green); font-weight: 600; }
.down-txt { color: var(--red); font-weight: 600; }
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat3 .s { display: grid; gap: 2px; }
.stat3 .s b { font-family: var(--font-display); font-size: 26px; font-weight: 700; line-height: 1.1; }
.stat3 .s span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; }

/* photos */
.gal { display: grid; gap: 14px; }
.gal .day { display: grid; gap: 6px; }
.gal .imgs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.ph { position: relative; aspect-ratio: 3 / 4; max-width: 100%; border-radius: 8px; overflow: hidden; background: var(--sunk); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .tag { position: absolute; left: 6px; bottom: 6px; background: rgb(0 0 0 / .6); color: #fff; font-size: 11px; font-weight: 600; padding: 1px 6px; border-radius: 4px; text-transform: uppercase; letter-spacing: .05em; }
.ph .x { position: absolute; right: 6px; top: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .55); color: #fff; font-size: 14px; line-height: 1; }
.ph .confirm { position: absolute; inset: 0; background: rgb(0 0 0 / .72); color: #fff; display: grid; place-content: center; gap: 8px; text-align: center; padding: 8px; font-size: 13px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.compare .cap { font-size: 13px; text-align: center; padding-top: 4px; }

/* nav */
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom, 0px); padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px); }
nav.tabs .in { max-width: 720px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
nav.tabs button { background: none; border: 0; padding: 8px 0 10px; display: grid; justify-items: center; gap: 2px; font-family: var(--font-display); font-weight: 600; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
nav.tabs button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; }
nav.tabs button[aria-current="page"] { color: var(--ink); }
nav.tabs button[aria-current="page"] svg { stroke: var(--red); }

/* settings sheet */
.sheet { position: fixed; inset: 0; z-index: 40; background: rgb(0 0 0 / .45); display: grid; align-items: end; }
.sheet .panel { background: var(--bg); max-height: 92vh; overflow: auto; border-radius: 14px 14px 0 0; padding-block: 16px calc(20px + env(safe-area-inset-bottom, 0px)); }
.sheet .panel .wrap { display: grid; gap: 16px; }
.sheet h3 { margin: 0; font-family: var(--font-display); font-size: 22px; text-transform: uppercase; letter-spacing: .03em; }
.progrow { display: grid; grid-template-columns: minmax(0, 1fr) 48px 48px 48px 30px; gap: 6px; align-items: center; }
.progrow input { padding: 6px; }
.progrow .del { background: none; border: 0; color: var(--red); font-size: 18px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); background: var(--btn); color: var(--btn-ink); padding: 8px 14px; border-radius: 8px; z-index: 58; font-weight: 600; font-size: 14px; }
.empty { text-align: center; padding: 18px 10px; color: var(--muted); }
.empty b { color: var(--ink); display: block; margin-bottom: 2px; }
@media (max-width: 420px) {
  .brand { font-size: 19px; }
  .brand .plate { width: 21px; height: 21px; border-radius: 5px; }
  .datenav .label { min-width: 84px; font-size: 16px; }
  .macro { grid-template-columns: 64px 1fr auto; }
  .kcal-big .n { font-size: 38px; }
  .grid4 { grid-template-columns: repeat(2, 1fr); }
}
@media (prefers-reduced-motion: no-preference) {
  .bar i { transition: width .35s ease; }
}

/* ---------- standalone app additions ---------- */
html { -webkit-text-size-adjust: 100%; }
body { padding-top: env(safe-area-inset-top, 0px); min-height: 100%; overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
header.top { top: 0; }
body::before { display: none; }
body.gated header.top, body.gated nav.tabs, body.gated main { display: none; }
#gate { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px max(16px, env(safe-area-inset-left, 0px)) 24px max(16px, env(safe-area-inset-right, 0px)); }
.gatebox { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.gatebox p { margin: 0; }
.brand.big { font-size: 34px; }
.brand.big .plate { width: 34px; height: 34px; border-radius: 8px; }
.gate-err { background: var(--red-soft); color: var(--red); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: 14px; }
.sync { width: 10px; height: 10px; border-radius: 50%; background: var(--green); flex: none; }
.sync[data-state="wait"] { background: var(--yellow); }
.sync[data-state="err"] { background: var(--red); }
.datenav + .sync { margin-left: 2px; }
.ph-off { position: absolute; inset: 0; display: grid; place-items: center; font-size: 12px; color: var(--muted); }
input, select, textarea { font-size: 16px; } /* stops iOS zooming into fields */
.setrow input { font-size: 16px; }
header.top .wrap { gap: 8px; }
.brand { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 430px) {
  .brand { font-size: 17px; gap: 6px; }
  .datenav { gap: 2px; }
  .datenav button, .iconbtn { width: 32px; height: 32px; }
  .datenav .label { min-width: 72px; font-size: 15px; }
}
/* keep form grids inside their cards on narrow phones */
label.f { min-width: 0; }
input[type=date] { min-width: 0; max-width: 100%; -webkit-appearance: none; appearance: none; min-height: 38px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 420px) { .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.card { min-width: 0; max-width: 100%; }
.sheet .panel { overflow-x: hidden; }
input[type=file] { max-width: 100%; font-size: 14px; }
/* meal plan row buttons + colour swatches */
.rowbtns { display: flex; gap: 8px; align-items: center; }
.xbtn { width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 17px; line-height: 1; display: grid; place-items: center; }
.xbtn:hover, .xbtn:focus-visible { color: var(--red); border-color: var(--red); }
.swatches { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.swatch { background: none; border: 0; padding: 0; display: grid; justify-items: center; gap: 4px; color: var(--ink); }
.swatch .sw { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .04); }
.swatch[aria-pressed="true"] .sw { outline: 3px solid var(--red); outline-offset: 2px; }
.swatch .swn { font-size: 11px; text-align: center; line-height: 1.2; }
@media (max-width: 360px) { .swatches { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* ---------- flower garden ---------- */
.garden { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; align-items: center; }
.garden-plant { width: 112px; }
.flower { width: 100%; height: auto; display: block; overflow: visible; }
.fl-stem { fill: none; stroke: var(--green); stroke-width: 3.5; stroke-linecap: round; }
.fl-leaf { fill: var(--green); }
.fl-seed { fill: #8B5E3C; }
.fl-bud { fill: var(--petal, #E8739B); }
.fl-petal { fill: var(--petal, #E8739B); stroke: var(--surface); stroke-width: 1.2; }
.fl-eye { fill: #F6C445; }
.fl-pot { fill: var(--pot, #D9906E); }
.fl-rim { fill: var(--pot-rim, #C47A57); }
.flower.wilt .fl-sway { filter: saturate(.45); }
.flower.wilt .fl-petal, .flower.wilt .fl-bud { opacity: .7; }
@media (prefers-reduced-motion: no-preference) {
  .fl-sway { transform-origin: 60px 112px; animation: sway 5s ease-in-out infinite; }
  .flower.wilt .fl-sway { animation: none; }
  @keyframes sway { 0%, 100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
}
.garden-text { display: grid; gap: 7px; min-width: 0; }
.garden-title { font-family: var(--font-display); font-weight: 700; font-size: 19px; }
.garden-bar { height: 8px; border-radius: 999px; background: var(--sunk); overflow: hidden; }
.garden-bar i { display: block; height: 100%; border-radius: 999px; background: var(--green); }
.bed { display: flex; flex-wrap: wrap; gap: 3px; align-items: center; }
.mini-bloom { width: 20px; height: 20px; }
.garden-how summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.garden-how { line-height: 1.5; }
@media (max-width: 360px) { .garden { grid-template-columns: 88px minmax(0, 1fr); } .garden-plant { width: 88px; } }

/* ---------- soft layout (Pink, Blush, Lilac) ---------- */
:root[data-style="soft"] {
  --font-display: "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", "Avenir Next", system-ui, -apple-system, sans-serif;
  --r: 20px;
  --green: #4E9A6B;
  --petal: var(--btn);
  --pot: color-mix(in srgb, var(--btn) 30%, var(--surface));
  --pot-rim: color-mix(in srgb, var(--btn) 45%, var(--surface));
  --shadow: 0 8px 24px color-mix(in srgb, var(--btn) 12%, transparent);
}
[data-style="soft"] body { font-family: var(--font-body); font-size: 15.5px; }
[data-style="soft"] .card { border: 0; box-shadow: var(--shadow, 0 6px 18px rgb(0 0 0 / .06)); border-radius: var(--r); padding: 16px 18px; }
[data-style="soft"] header.top { border-bottom: 0; }
[data-style="soft"] .brand { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 24px; }
[data-style="soft"] .sec > h2 { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; font-size: 21px; font-weight: 700; color: var(--ink); }
[data-style="soft"] .sec > h2 .aside { font-family: var(--font-body); font-style: normal; color: var(--muted); }
[data-style="soft"] .slotlabel, [data-style="soft"] .macro .k, [data-style="soft"] .stat3 .s span, [data-style="soft"] th, [data-style="soft"] .sethead, [data-style="soft"] .week .d {
  text-transform: none; letter-spacing: 0; font-family: var(--font-body); font-weight: 700; }
[data-style="soft"] .slotlabel { color: var(--btn); font-size: 14px; }
[data-style="soft"] .kcal-big .n, [data-style="soft"] .stat3 .s b, [data-style="soft"] .macro .v b, [data-style="soft"] .timer .clock, [data-style="soft"] .datenav .label { font-family: var(--font-display); }
[data-style="soft"] .datenav .label { text-transform: none; font-style: italic; }
[data-style="soft"] .ex-head input { font-family: var(--font-display); font-style: italic; }
[data-style="soft"] .ex-head .scheme, [data-style="soft"] .num { font-family: var(--font-body); }
[data-style="soft"] .bar { height: 14px; border-radius: 999px; }
[data-style="soft"] .bar i { border-radius: 999px; }
[data-style="soft"] .btn { border-radius: 999px; padding: 9px 18px; }
[data-style="soft"] .btn.sm { padding: 6px 14px; }
[data-style="soft"] .datenav button, [data-style="soft"] .iconbtn { border-radius: 999px; border: 0; background: var(--surface); box-shadow: var(--shadow); }
[data-style="soft"] .week button { border-radius: 16px; border: 0; box-shadow: var(--shadow); }
[data-style="soft"] .week button.on { box-shadow: inset 0 0 0 2px var(--btn), var(--shadow); }
[data-style="soft"] input[type=text], [data-style="soft"] input[type=search], [data-style="soft"] input[type=number], [data-style="soft"] input[type=date], [data-style="soft"] input[type=email], [data-style="soft"] input[type=password], [data-style="soft"] select, [data-style="soft"] textarea { border-radius: 14px; }
[data-style="soft"] .stepper { border-radius: 999px; }
[data-style="soft"] .savebar { border: 0; border-radius: 22px; }
[data-style="soft"] .seg button { border: 0; box-shadow: var(--shadow); }
[data-style="soft"] .row { border-top-style: dashed; }
[data-style="soft"] .ph { border-radius: 16px; border: 0; }
[data-style="soft"] .sheet .panel { border-radius: 26px 26px 0 0; }
[data-style="soft"] .sheet h3 { font-family: var(--font-display); font-style: italic; text-transform: none; letter-spacing: 0; }
[data-style="soft"] main { padding-bottom: calc(130px + env(safe-area-inset-bottom, 0px)); }
[data-style="soft"] nav.tabs { left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 26px; padding-bottom: 0; box-shadow: 0 10px 30px color-mix(in srgb, var(--btn) 22%, transparent); }
[data-style="soft"] nav.tabs button { font-family: var(--font-body); text-transform: none; letter-spacing: 0; font-weight: 700; font-size: 12.5px; }
[data-style="soft"] nav.tabs button[aria-current="page"] { color: var(--btn); }
[data-style="soft"] nav.tabs button[aria-current="page"] svg { stroke: var(--btn); }
[data-style="soft"] .savebar { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
[data-style="soft"] .toast { border-radius: 999px; bottom: calc(160px + env(safe-area-inset-bottom, 0px)); }
[data-style="soft"] .gatebox .brand.big { font-size: 40px; }
/* soft layout: keep the save bar and header inside narrow phones */
[data-style="soft"] .timer .btn.sm { padding: 5px 9px; }
[data-style="soft"] .savebar > .btn { padding: 9px 14px; }
.savebar { flex-wrap: wrap; }
.savebar .timer { min-width: 0; }
@media (max-width: 430px) {
  [data-style="soft"] .brand { font-size: 20px; }
  [data-style="soft"] .datenav .label { min-width: 64px; }
  [data-style="soft"] .seg button { padding: 6px 11px; }
}
.fl-soil { fill: #7A5236; }
/* flower picker */
.flower-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.fp { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 6px 2px 8px; display: grid; justify-items: center; gap: 2px; color: var(--ink); }
.fp[aria-pressed="true"] { border-color: var(--btn); box-shadow: inset 0 0 0 1.5px var(--btn); }
.fp-art { width: 100%; max-width: 64px; display: block; }
.fp-art .fl-sway { animation: none; }
.fp-name { font-size: 11px; line-height: 1.15; text-align: center; font-weight: 600; }
[data-style="soft"] .fp { border: 0; box-shadow: var(--shadow); }
[data-style="soft"] .fp[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--btn), var(--shadow); }

/* ===================== new features ===================== */
nav.tabs .in { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
nav.tabs button { min-width: 0; }
@media (max-width: 400px) { nav.tabs button { font-size: 11.5px; letter-spacing: .02em; } }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.iconbtn.sm { width: 28px; height: 28px; }
.iconbtn:disabled { opacity: .35; }

/* onboarding */
.sheet.ob { align-items: stretch; }
.sheet.ob .panel { max-height: none; height: 100%; border-radius: 0; padding-top: calc(16px + env(safe-area-inset-top, 0px)); }
.ob-wrap { max-width: 520px; }
.ob-wrap h3 { font-size: 26px; }
.ob-wrap p { margin: 0; }
.ob-wrap .f > span:first-child { font-weight: 600; color: var(--ink); font-size: 14px; }
.ob-wrap .f { display: grid; gap: 8px; }
.ob-dots { display: flex; gap: 6px; }
.ob-dot { width: 26px; height: 5px; border-radius: 999px; background: var(--sunk); }
.ob-dot.on { background: var(--btn); } .ob-dot.done { background: color-mix(in srgb, var(--btn) 45%, var(--sunk)); }
.ob-list { display: grid; gap: 8px; }
.ob-opt { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; font-weight: 600; }
.ob-opt[aria-pressed="true"] { border-color: var(--btn); box-shadow: inset 0 0 0 1.5px var(--btn); }
.ob-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 6px; }
.ob-targets { display: grid; gap: 12px; }
.ob-big { display: flex; align-items: baseline; gap: 8px; }
.ob-big b { font-family: var(--font-display); font-size: 46px; line-height: 1; }
[data-style="soft"] .ob-opt { border: 0; box-shadow: var(--shadow); border-radius: 18px; }
[data-style="soft"] .ob-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--btn), var(--shadow); }

/* streak chips on the garden card */
.streaks { display: flex; gap: 6px; flex-wrap: wrap; }
.streak-chip { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--sunk); color: var(--ink); }
.streak-chip svg { width: 14px; height: 14px; fill: none; stroke: #E8743B; stroke-width: 2; }

/* supplements */
.supp-row { display: flex; flex-wrap: wrap; gap: 8px; }
.supp { display: inline-flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px 7px 8px; font-weight: 600; }
.supp .tick { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.supp.on { background: color-mix(in srgb, var(--green) 14%, var(--surface)); border-color: var(--green); }
.supp.on .tick { background: var(--green); border-color: var(--green); }
.supp.on .tick::after { content: ""; width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.chipbtn { border: 0; cursor: pointer; }
[data-style="soft"] .supp { border: 0; box-shadow: var(--shadow); }
[data-style="soft"] .supp.on { box-shadow: inset 0 0 0 2px var(--green), var(--shadow); }

/* food tab: scan + grocery */
.groc-btn { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.groc-btn svg, .scan-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.scan-panel { display: grid; gap: 12px; padding-block: 4px; }
.scan-cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; font-size: 16px; }
.scan-result { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 12px; }
.scan-overlay { position: fixed; inset: 0; z-index: 60; background: #000; display: grid; }
.scan-overlay video { width: 100%; height: 100%; object-fit: cover; grid-area: 1 / 1; }
.scan-frame { grid-area: 1 / 1; place-self: center; width: min(78vw, 320px); aspect-ratio: 16 / 10; border: 3px solid rgb(255 255 255 / .9); border-radius: 16px; box-shadow: 0 0 0 100vmax rgb(0 0 0 / .45); }
.scan-ui { grid-area: 1 / 1; align-self: end; display: grid; gap: 12px; justify-items: center; padding: 20px 16px calc(28px + env(safe-area-inset-bottom, 0px)); color: #fff; text-align: center; }
.scan-tip { font-weight: 600; max-width: 320px; }
.groc { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto auto; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px dashed var(--line); cursor: pointer; }
.groc input { width: 20px; height: 20px; accent-color: var(--btn); }
.groc .gq { color: var(--muted); font-size: 14px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.groc.done .gn { text-decoration: line-through; color: var(--muted); }
.xbtn.sm { width: 24px; height: 24px; font-size: 14px; }

/* PB / bloom celebration */
.confetti { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 80; pointer-events: none; }
.celebrate { position: fixed; inset: 0; z-index: 70; background: rgb(0 0 0 / .35); display: grid; place-items: center; padding: 20px; }
.cele-card { width: min(100%, 380px); display: grid; gap: 12px; text-align: center; padding: 22px 20px; }
.cele-title { font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.cele-line { display: grid; gap: 2px; }
.cele-line b { font-size: 16px; }
.cele-line span { color: var(--muted); font-size: 14px; }
.cele-flower { width: 110px; justify-self: center; }
@media (prefers-reduced-motion: no-preference) { .cele-card { animation: pop .35s ease-out; } @keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } } }

/* weekly summary */
.wk-nav { display: inline-flex; align-items: center; gap: 6px; }
.wk { display: grid; gap: 12px; }
.wk-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.wk-tile { background: var(--sunk); border-radius: 12px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; }
.wk-k { font-size: 12px; font-weight: 700; color: var(--muted); }
.wk-tile b { font-family: var(--font-display); font-size: 24px; line-height: 1.1; }
.wk-sub { font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
.wk-pbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.chip.pb { background: color-mix(in srgb, var(--btn) 15%, var(--surface)); color: var(--btn); }
[data-style="soft"] .wk-tile { border-radius: 16px; background: color-mix(in srgb, var(--btn) 7%, var(--surface)); }

/* measurements */
.more-meas summary, .pw summary { cursor: pointer; font-weight: 600; color: var(--btn); padding: 2px 0; }
.more-meas[open], .pw[open] { display: grid; gap: 10px; }

/* garden tab */
.garden-scene { width: 100%; height: auto; display: block; border-radius: 18px; box-shadow: var(--shadow, none); }
.g-label { font-size: 10px; font-weight: 700; fill: #FFF6EC; font-family: var(--font-body); }
.weekdots { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; text-align: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.wd { display: grid; justify-items: center; gap: 4px; }
.wd i { width: 26px; height: 26px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line); }
.wd.l i { background: var(--sunk); }
.wd.w i { background: var(--btn); border-color: var(--btn); }
.wd.today { color: var(--ink); }
.wd.today i { outline: 2px solid var(--btn); outline-offset: 2px; }
:root[data-style="soft"] { --g-sky-top: color-mix(in srgb, var(--btn) 18%, #FFFFFF); --g-sky-bot: #FFF8FB; }
:root[data-theme="dark"] { --g-sky-top: #24324A; --g-sky-bot: #3B4A63; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --g-sky-top: #24324A; --g-sky-bot: #3B4A63; } }

/* water */
.water { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 14px; align-items: center; }
.water-art { width: 104px; }
.bottle-svg { width: 100%; height: auto; display: block; overflow: visible; }
.bottle-svg .wave { animation: wv 3.2s ease-in-out infinite alternate; }
.bottle-svg .bub { animation: bub 2.8s ease-in infinite; }
.bottle-svg .bub.b2 { animation-delay: 1.3s; }
@keyframes wv { from { transform: translateX(0); } to { transform: translateX(-20px); } }
@keyframes bub { 0% { transform: translateY(0); opacity: 0; } 20% { opacity: 1; } 100% { transform: translateY(-26px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bottle-svg .wave, .bottle-svg .bub { animation: none; } }
.water-side { display: grid; gap: 8px; min-width: 0; }
.water-n { font-size: 15px; color: var(--muted); }
.water-n b { font-size: 34px; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.water-n span { font-size: 13px; }
.water-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.water-btns .btn { padding-left: 11px; padding-right: 11px; }
.wb-sz { opacity: .75; font-weight: 500; margin-left: 2px; }
.water .linkbtn { justify-self: start; font-size: 13px; }
.water.done .water-n b { color: var(--green); }
[data-style="soft"] .water-n b { font-family: 'Playfair Display', Georgia, serif; }
[data-style="soft"] .water.done .water-n b { color: var(--btn); }
.stanley-pick { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.sp { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 8px 2px; display: grid; justify-items: center; gap: 4px; color: var(--ink); }
.sp[aria-pressed="true"] { border-color: var(--btn); box-shadow: inset 0 0 0 1.5px var(--btn); }
.sp-art { width: 100%; max-width: 40px; display: block; }
.sp-art .wave, .sp-art .bub { animation: none; }
.sp-name { font-size: 10.5px; line-height: 1.15; text-align: center; font-weight: 600; }
[data-style="soft"] .sp { border: 0; box-shadow: var(--shadow); }
[data-style="soft"] .sp[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--btn), var(--shadow); }

/* nutrients */
.nutr { display: grid; gap: 12px; }
.ngrp { display: grid; gap: 10px; }
.nrow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 10px; align-items: baseline; --c: var(--blue); }
.nrow .k { font-weight: 600; font-size: 15px; }
.nrow .v { font-size: 13px; color: var(--muted); white-space: nowrap; }
.nrow .v b { color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; }
.nrow .k { grid-area: 1 / 1; }
.nrow .v { grid-area: 1 / 2; }
.nrow .bar { grid-area: 2 / 1 / 3 / 3; height: 8px; }
.nrow .nnote { grid-area: 3 / 1 / 4 / 3; font-size: 12px; color: var(--muted); }
.nrow .k + .nnote { grid-area: 2 / 1 / 3 / 3; }
.nrow.hit { --c: var(--green); }
.nrow.over { --c: var(--red); }
.nrow.over .v b { color: var(--red); }
/* removed details */ .nmore-unused { border-top: 1px solid var(--line); padding-top: 10px; }
.nmore summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; display: flex; align-items: center; gap: 8px; }
.nmore summary::-webkit-details-marker { display: none; }
.nmore summary::before { content: ''; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .2s; }
.nmore[open] summary::before { transform: rotate(45deg); }
.nmore .slotlabel { padding-top: 12px; }
.nlow { color: var(--ink); background: color-mix(in srgb, var(--yellow) 18%, var(--surface)); border-radius: 10px; padding: 8px 10px; }
[data-style="soft"] .nrow { --c: var(--btn); }
[data-style="soft"] .nrow.hit { --c: var(--green); }
[data-style="soft"] .nrow.over { --c: var(--red); }
[data-style="soft"] .nrow .v b { font-family: var(--font-display); }
[data-style="soft"] .nlow { background: color-mix(in srgb, var(--btn) 10%, var(--surface)); border-radius: 14px; }

.tapcard { cursor: pointer; -webkit-tap-highlight-color: transparent; transition: transform .12s ease; }
.tapcard:active { transform: scale(.985); }
.tapcard:focus-visible { outline: 2px solid var(--btn); outline-offset: 2px; }
.tap-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; font-size: 13px; font-weight: 600; color: var(--muted); }
.tap-hint svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[data-style="soft"] .tap-hint { color: var(--btn); border-top-style: dashed; }
.nsheet { display: grid; gap: 12px; }
.nsheet .slotlabel { padding-top: 4px; }
.nsheet .nutr { gap: 10px; }

/* bonsai / car */
.garden.is-car .garden-plant { align-self: center; }
.flower.car .car-g { transition: filter .3s; }
.flower.car.wilt .car-g, .car-dusty { filter: saturate(.35) brightness(.92); }
.grow-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grow-pick .fp-art { max-width: 76px; }
:root[data-theme="dark"] { --gar-top: #2B3038; --gar-bot: #1E2228; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --gar-top: #2B3038; --gar-bot: #1E2228; } }
.gar-glow { opacity: .35; }
:root[data-theme="dark"] .gar-glow { opacity: .08; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .gar-glow { opacity: .08; } }
.car-pick { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.car-pick .fp-art { max-width: 92px; }
.mini-bloom.mini-car { width: 28px; }
.sec > h2 .h2btn { font-family: var(--font-body); font-weight: 600; letter-spacing: 0; text-transform: none; font-size: 13px; padding: 4px 0 4px 12px; font-style: normal; }
.sec > h2 .aside + .h2btn { margin-left: 0; }
.sec > h2 .h2btn.push { margin-left: auto; }
[data-style="soft"] .sec > h2 .h2btn { color: var(--btn); }
:root[data-style="soft"] { --gar-top: color-mix(in srgb, var(--btn) 10%, #FFFFFF); --gar-bot: color-mix(in srgb, var(--btn) 20%, #FFFFFF); --gar-floor: color-mix(in srgb, var(--btn) 30%, #B8AEB4); --gar-edge: color-mix(in srgb, var(--btn) 20%, #E6DCE1); --gar-bay: #FFFFFF; --gar-dot: color-mix(in srgb, var(--btn) 40%, #8A7F86); }

/* finished car drives into the garage */
.cele-drive { width: 100%; max-width: 300px; justify-self: center; }
.cele-drive svg { width: 100%; height: auto; display: block; overflow: hidden; border-radius: 12px; background: color-mix(in srgb, var(--sunk) 55%, var(--surface)); }
.dr-door { transform-box: fill-box; transform-origin: top; transform: scaleY(1); }
@media (prefers-reduced-motion: no-preference) {
  .dr-car { animation: drDrive 2.8s cubic-bezier(.55, 0, .85, .4) .2s both; }
  .dr-shake { animation: drShake .09s linear 0s 9 alternate; }
  .dr-lines { opacity: 0; animation: drLines 2.8s linear .2s both; }
  .dr-puff { opacity: 0; transform-box: fill-box; transform-origin: center; animation: drPuff 1s ease-out both; }
  .dr-puff.p0 { animation-delay: .9s; } .dr-puff.p1 { animation-delay: 1.05s; } .dr-puff.p2 { animation-delay: 1.2s; }
  .dr-door { animation: drDoor .6s ease-in 2.75s both; }
  @keyframes drDrive { 0%, 32% { transform: translateX(0); } 82%, 100% { transform: translateX(230px); } }
  @keyframes drShake { from { transform: translateY(-.5px); } to { transform: translateY(.5px); } }
  @keyframes drLines { 0%, 38% { opacity: 0; } 50%, 72% { opacity: .8; } 82%, 100% { opacity: 0; } }
  @keyframes drPuff { 0% { opacity: 0; transform: scale(.4); } 30% { opacity: .9; } 100% { opacity: 0; transform: scale(1.8) translate(-6px, -4px); } }
  @keyframes drDoor { from { transform: scaleY(0); } to { transform: scaleY(1); } }
}
@media (prefers-reduced-motion: reduce) { .dr-door { transform: scaleY(0); } }

/* search, drinks, steps */
.search-panel, .drinks-panel { display: grid; gap: 10px; }
.search-panel .rows .row .btn { flex: none; }
.seg.wrap { flex-wrap: wrap; }
.seg.wrap button { font-size: 13px; padding: 5px 11px; }
.drinks-panel .f { gap: 6px; }
.drink-total { display: flex; align-items: center; gap: 10px; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.drink-total > div { min-width: 0; display: grid; gap: 4px; }
.drink-total .btn { flex: none; }
.drink-recent { flex-wrap: wrap; }
.steps-box { display: grid; gap: 8px; }
.steps-n { font-size: 14px; color: var(--muted); }
.steps-n b { font-size: 28px; color: var(--ink); font-family: var(--font-display); line-height: 1; }
.steps-bar i { background: var(--blue); }
.steps-more summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.sec > h2 .groc-btn { display: inline-flex; align-items: center; gap: 5px; }
[data-style="soft"] .steps-bar i { background: var(--btn); }
input[type=search] { -webkit-appearance: none; appearance: none; }

/* meal pages */
.meal-open { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.meal-open:active { opacity: .7; }
.open-hint { color: var(--muted); font-weight: 700; }
.meal-page { display: grid; gap: 10px; }
.meal-page h3 { margin: 0; }
.meal-note { background: var(--sunk); border-radius: 10px; padding: 8px 10px; }
.ing-list, .method-list { margin: 0; padding-left: 20px; display: grid; gap: 6px; line-height: 1.4; }
.ing-list li::marker { color: var(--muted); }
.ing-list .ing-sub { list-style: none; margin-left: -20px; font-weight: 700; padding-top: 4px; }
.method-list li { padding-left: 2px; }
.meal-actions { padding-top: 6px; }
.meal-page .slotlabel .aside { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
[data-style="soft"] .meal-note { border-radius: 14px; }

/* quick add, favourites, what fits, planner */
.starbtn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: transparent; border: 0; padding: 0; color: var(--muted); }
.starbtn svg, .starbtn-wide svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; }
.starbtn svg .on, .starbtn-wide svg .on { fill: #F2B705; stroke: #D99A00; }
[data-style="soft"] .starbtn svg .on, [data-style="soft"] .starbtn-wide svg .on { fill: var(--btn); stroke: var(--btn); }
.starbtn-wide { display: inline-flex; align-items: center; gap: 6px; }
.meal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.qrow .rowbtns { align-items: center; }
.done-tick { color: var(--green); font-weight: 700; font-size: 13px; white-space: nowrap; }
.sec > h2 .groc-btn + .groc-btn { margin-left: 2px; }
.groc-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
.planner { display: grid; gap: 10px; }
.plan-day { display: grid; gap: 8px; }
.plan-day.today { box-shadow: inset 0 0 0 2px var(--btn); }
.plan-head { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.plan-head .aside { margin-left: auto; font-size: 12px; color: var(--muted); }
.plan-slot { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; align-items: start; }
.ps-l { font-size: 12px; font-weight: 700; color: var(--muted); padding-top: 7px; text-transform: uppercase; letter-spacing: .04em; }
.ps-items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.plan-chip { display: inline-flex; align-items: center; gap: 2px; background: var(--sunk); border-radius: 999px; padding: 4px 4px 4px 10px; font-size: 13px; font-weight: 600; max-width: 100%; }
.plan-chip button { border: 0; background: transparent; width: 22px; height: 22px; border-radius: 50%; color: var(--muted); font-size: 16px; line-height: 1; }
select.plan-add { font-size: 13px; padding: 5px 8px; min-height: 0; width: auto; max-width: 100%; color: var(--muted); }
[data-style="soft"] .ps-l { text-transform: none; letter-spacing: 0; font-size: 13px; }
.chain-chips { flex-wrap: wrap; }

/* how it's calculated */
.methods { display: grid; gap: 10px; }
.methods-cta { display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; color: var(--ink); cursor: pointer; }
.methods-cta > span { display: grid; gap: 2px; min-width: 0; }
.methods-cta svg { width: 20px; height: 20px; flex: none; margin-left: auto; fill: none; stroke: var(--muted); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.meth summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; align-items: center; gap: 8px; }
.meth summary::-webkit-details-marker { display: none; }
.meth summary::after { content: ''; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .2s; }
.meth[open] summary::after { transform: rotate(-135deg); }
.meth-body { display: grid; gap: 8px; padding-top: 10px; line-height: 1.45; font-size: 14px; }
.meth-body p { margin: 0; }
.meth-body a { color: var(--blue); }
[data-style="soft"] .meth-body a { color: var(--btn); }
[data-style="soft"] .meth summary { font-family: var(--font-display); font-size: 17px; }

/* add a meal: build from ingredients */
.build-card { display: grid; gap: 10px; }
.build-card .slotlabel .aside { font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted); margin-left: 6px; }
.build-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.build-btns .btn { display: inline-flex; align-items: center; gap: 6px; }
.build-btns svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.build-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; border-top: 1px solid var(--line); padding-top: 8px; font-size: 14px; }
.build-total b { font-size: 18px; }
.build-adder { display: grid; gap: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.serves { max-width: 220px; }
.scan-overlay video { pointer-events: none; }
.scan-frame { position: relative; z-index: 1; pointer-events: none; }
.scan-ui { position: relative; z-index: 2; }

/* custom sessions */
.custom-head { display: grid; gap: 8px; }
.add-ex-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
select.custom-pick { flex: 1 1 200px; min-width: 0; font-weight: 600; }

/* editing meals */
.edit-banner { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: color-mix(in srgb, var(--btn) 10%, var(--surface)); border-radius: 12px; padding: 10px 12px; font-size: 14px; }
.build-list .rowbtns { align-items: center; }
.amt { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.amt input { width: 72px; padding: 6px 8px; text-align: right; }

/* range slider */
input.range { width: 100%; accent-color: var(--btn); height: 28px; }

/* split builder */
.dayedit-head { display: flex; gap: 10px; align-items: center; }
.dayedit-head .dayname { flex: 1; min-width: 0; font-weight: 700; }
.wdpick { display: flex; gap: 6px; flex-wrap: wrap; }
.wd-chip { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); font-weight: 700; color: var(--muted); padding: 0; }
.wd-chip[aria-pressed="true"] { background: var(--btn); border-color: var(--btn); color: var(--btn-ink); }
.dayexs { display: grid; gap: 6px; }
.start-pick { display: grid; gap: 8px; }
.start-opt { display: grid; gap: 4px; text-align: left; color: var(--ink); cursor: pointer; }
.start-opt[aria-pressed="true"] { box-shadow: inset 0 0 0 2px var(--btn); border-color: var(--btn); }

.icon-note { display: flex; gap: 10px; align-items: center; }
.icon-note img { border-radius: 9px; flex: none; box-shadow: 0 0 0 1px var(--line); }

.gate-ok { color: var(--green); background: var(--sunk); padding: 8px 10px; border-radius: 8px; font-size: 14px; }

.tick { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.4; }
.tick input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--btn); }
details.privacy { font-size: 13.5px; color: var(--muted); }
details.privacy summary { cursor: pointer; font-weight: 600; color: var(--ink); }
details.privacy p { margin: 8px 0 0; line-height: 1.45; }

.banner.warn-soft { background: var(--sunk); border: 0; border-left: 3px solid var(--red); color: var(--ink); font-size: 13.5px; padding: 8px 10px; border-radius: 6px; }
details.fb summary, details.del summary { cursor: pointer; font-weight: 600; }
details.del summary { color: var(--red); }
#fb_text { width: 100%; font: inherit; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); resize: vertical; box-sizing: border-box; }

/* ---------- Food tab: hero, tiles, log button, overlay sheets ---------- */
.grow-chip { display: grid; grid-template-columns: 44px minmax(0, 1fr) 18px; gap: 10px; align-items: center; width: 100%; background: var(--sunk); border: 0; border-radius: 12px; padding: 6px 10px 6px 6px; color: var(--ink); text-align: left; font: inherit; cursor: pointer; }
.grow-chip .gc-art { width: 44px; height: 44px; display: grid; place-items: center; overflow: hidden; }
.grow-chip .gc-art svg { width: 44px; height: 44px; }
.grow-chip .gc-text { display: grid; gap: 5px; min-width: 0; font-size: 14px; }
.grow-chip .gc-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grow-chip .garden-bar { height: 6px; }
.grow-chip .gc-go { width: 18px; height: 18px; stroke: var(--muted); fill: none; stroke-width: 2; }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles.one { grid-template-columns: 1fr; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r, 12px); padding: 10px; display: grid; gap: 8px; align-content: space-between; }
.tile.done { border-color: var(--green); }
.tile-main { display: flex; gap: 8px; align-items: center; background: none; border: 0; padding: 0; color: var(--ink); text-align: left; font: inherit; cursor: pointer; flex-wrap: wrap; }
.tile-main .steps-bar { flex: 1 0 100%; height: 6px; }
.tile-art { width: 30px; height: 48px; flex: none; display: grid; place-items: center; }
.tile-art svg { width: 30px; height: 48px; }
.tile-txt { display: grid; line-height: 1.15; min-width: 0; }
.tile-k { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-txt b { font-size: 24px; }
.tile-of { font-size: 12.5px; color: var(--muted); }
.tile-btns { display: flex; gap: 6px; flex-wrap: wrap; }
.tile-btns .chip { font-size: 13px; padding: 5px 10px; }
.slot-adds { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: 6px; }
.slot-adds .chip { font-size: 13px; padding: 5px 10px; background: var(--sunk); color: var(--ink); }
.log-cta { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); z-index: 20; display: grid; padding-top: 4px; }
[data-style="soft"] .log-cta { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
.log-btn { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 14px; font-size: 16px; box-shadow: 0 8px 24px rgb(0 0 0 / .18); }
.log-btn svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2.4; }
.sheet.ovl { z-index: 45; }
.ovl-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.ovl-sub { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: -8px; }
.sheet.ovl .sec h2 { margin-top: 0; }
body.ovl-open { overflow: hidden; }
.prog-seg { margin-bottom: 2px; }

/* Sheets opened from inside Log food (planner, grocery, a meal page) sit on top of it. */
#sheetRoot .sheet { z-index: 50; }

/* Plan & shop */
.groc { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.groc .gl { display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; gap: 10px; align-items: center; cursor: pointer; min-width: 0; }
.groc span.gl { grid-template-columns: minmax(0, 1fr) auto; cursor: default; }
.groc .linkbtn { white-space: nowrap; }
.plan-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.plan-sum > div { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; display: grid; }
.plan-sum b { font-size: 20px; }
.plan-sum span { font-size: 12px; color: var(--muted); }
.plan-row.on .t { font-weight: 700; }
.stepper button:disabled { opacity: .35; }
details.card summary { cursor: pointer; }

/* Training split in Settings: one collapsed card, each day folds open */
details.split-wrap > summary { list-style: none; display: flex; align-items: center; gap: 10px; cursor: pointer; }
details.split-wrap > summary::-webkit-details-marker, details.dayedit > summary::-webkit-details-marker { display: none; }
.sw-head { display: grid; gap: 3px; min-width: 0; flex: 1; }
.sw-over { color: var(--muted); line-height: 1.4; }
.sw-edit { flex: none; font-weight: 600; }
details.split-wrap[open] .sw-edit { visibility: hidden; }
.split-body { display: grid; gap: 10px; margin-top: 12px; }
#splitDays { display: grid; gap: 8px; }
details.dayedit { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 0; }
details.dayedit > summary { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; gap: 8px; align-items: center; padding: 12px 12px; cursor: pointer; }
details.dayedit > summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); justify-self: center; margin-top: -4px; transition: transform .15s; }
details.dayedit[open] > summary::after { transform: rotate(-135deg); margin-top: 4px; }
.ds-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ds-meta { white-space: nowrap; }
.day-body { display: grid; gap: 8px; padding: 0 12px 12px; }
/* exercise rows inside a split day: name on its own line, then sets and rep range */
.dayedit .progrow.small { display: none; }
.dayedit .dayexs .progrow { grid-template-columns: 48px 48px 48px 1fr 30px; grid-template-areas: "name name name name del" "sets min max hint hint"; row-gap: 6px; padding: 8px 0; border-top: 1px dashed var(--line); }
.dayedit .dayexs .progrow:first-child { border-top: 0; padding-top: 0; }
.dayedit .progrow [data-k="name"] { grid-area: name; }
.dayedit .progrow [data-k="sets"] { grid-area: sets; }
.dayedit .progrow [data-k="min"] { grid-area: min; }
.dayedit .progrow [data-k="max"] { grid-area: max; }
.dayedit .progrow .del { grid-area: del; }
.dayedit .progrow::after { content: "sets · min–max reps"; grid-area: hint; align-self: center; font-size: 12px; color: var(--muted); padding-left: 4px; }

/* starter meals picker */
.sp-tabs { flex-wrap: wrap; }
.sp-avoid { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.sp-avoid .chip { background: var(--sunk); color: var(--ink); padding: 4px 10px; font-size: 13px; }
.sp-avoid .chip.on { background: var(--ink); color: var(--btn-ink); text-decoration: line-through; }
.sp-list { display: grid; gap: 8px; }
.sp-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; display: grid; gap: 6px; background: var(--surface); }
.sp-card.on { border-color: var(--btn); box-shadow: 0 0 0 1px var(--btn) inset; }
.sp-top { text-align: left; display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.sp-top input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--btn); }
.sp-name { display: grid; gap: 4px; min-width: 0; justify-items: start; text-align: left; font-size: 15px; }
.sp-row { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; }
.sp-row details { min-width: 0; flex: 1; }
.sp-row summary { cursor: pointer; color: var(--muted); }
.sp-size { flex: none; }
.sp-size span { min-width: 44px; font-size: 13px; }
.sp-legal { line-height: 1.4; }
.sp-bar { position: sticky; bottom: 0; padding: 10px 0 calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); display: grid; }
.sp-entry { padding: 4px 0 2px; }
.cutemoji { width: 1.35em; height: 1.35em; vertical-align: -0.3em; display: inline-block; }
.ob-grow-note { line-height: 1.45; }
.no-targets { background: var(--sunk); border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; display: grid; gap: 10px; }
.no-targets-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.grid2 > * { min-width: 0; } .grid2 input { width: 100%; box-sizing: border-box; }
/* very small phones (320–360px wide): keep the header and the save bar on one line */
@media (max-width: 360px) {
  header.top .brand { font-size: 0; gap: 0; }
  .savebar { flex-wrap: nowrap; gap: 6px; }
  .savebar .timer .btn[data-s="180"] { display: none; }
  .savebar > .btn { padding-inline: 12px; white-space: nowrap; }
  .timer .clock { font-size: 18px; min-width: 38px; }
}
