/* Pantry Clock — theme tokens are set at runtime by applyTheme(); these are the defaults (Blueberry, light). */
:root {
  --bg: #F1F4F0; --surface: #FFFFFF; --sunk: #E6ECE7; --ink: #16201A; --muted: #58665E; --line: #D5DDD7;
  --accent: #3A45A6; --accent-ink: #FFFFFF; --accent-soft: #E3E5F6;
  --ok: #2B7A4C; --ok-soft: #DCEEE2; --soon: #9A6200; --soon-soft: #FAEDCD; --bad: #B0372B; --bad-soft: #F7DFDA;
  --fs: 1; --r: 14px; --r-sm: 10px;
  --display: "Bricolage Grotesque", "Segoe UI", Roboto, system-ui, sans-serif;
  --body: "Figtree", Roboto, "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "Roboto Mono", monospace;
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: calc(15px * var(--fs)); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 1rem/1.5 var(--body); padding: 0 16px calc(var(--nav-h) + 90px + env(safe-area-inset-bottom, 0px)); min-height: 100vh; overflow-x: hidden; }
body.sheet-open { overflow: hidden; }
img { max-width: 100%; }
[hidden] { display: none !important; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.15; text-wrap: balance; }
h1 { font-size: 1.9rem; font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: .3em 0; }
.wrap { max-width: 1040px; margin: 0 auto; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); } .small { font-size: .86rem; } .grow { flex: 1 1 auto; min-width: 0; }
.eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .09em; font-weight: 700; color: var(--muted); }
.sec { margin: 22px 0 8px; }
.ok-t { color: var(--ok); }
.link { color: var(--accent); font-weight: 600; overflow-wrap: anywhere; }
.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: 4px; }
.linkish:hover { color: var(--accent); }
.vh { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; pointer-events: none; }
@media (max-width: 420px) { .hide-xs { display: none; } }

/* ---------- header, nav, fab ---------- */
header.top { position: sticky; top: 0; z-index: 20; background: var(--bg); margin: 0 -16px; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 10px; }
header.top .wrap { display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 10px; margin-right: auto; font-family: var(--display); font-weight: 800; font-size: 1.2rem; letter-spacing: -.02em; }
.mark { width: 26px; height: 26px; border-radius: 50%; background: conic-gradient(var(--accent) 0 .7turn, var(--sunk) 0); position: relative; flex: none; display: inline-block; }
.mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--bg); }
.mark.big { width: 64px; height: 64px; } .mark.big::after { inset: 12px; background: var(--surface); }
.icon-btn { border: 0; background: transparent; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; font-size: 1.15rem; color: var(--muted); flex: none; }
.icon-btn:hover { background: var(--sunk); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; font-size: .9rem; border-radius: 8px; }
nav.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; justify-content: space-around; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); }
nav.tabs button { flex: 1; max-width: 120px; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 4px 2px; border-radius: 14px; color: var(--muted); font-weight: 600; font-size: .74rem; position: relative; }
nav.tabs .ti { font-size: 1.25rem; line-height: 1.2; filter: grayscale(.6); opacity: .8; }
nav.tabs button[aria-current="true"] { color: var(--accent); background: var(--accent-soft); }
nav.tabs button[aria-current="true"] .ti { filter: none; opacity: 1; }
.badge { position: absolute; top: 0; right: calc(50% - 22px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--bad); color: #fff; font: 700 .68rem/18px var(--mono); font-style: normal; }
.qbtn .badge { top: 4px; right: 6px; }
.fab { position: fixed; right: 16px; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom, 0px)); z-index: 25; border: 0; border-radius: 999px; padding: 12px 18px; background: var(--accent); color: var(--accent-ink); font-weight: 700; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
body.sheet-open .fab { display: none; }

/* ---------- buttons, chips, pills ---------- */
.btn { border: 1px solid var(--line); background: var(--surface); padding: 10px 16px; border-radius: 999px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 42px; text-decoration: none; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--sunk); color: var(--ink); }
.btn.sm { padding: 5px 12px; min-height: 34px; font-size: .86rem; }
.btn.danger { color: var(--bad); }
.btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: .45; cursor: default; }
label.btn { cursor: pointer; }
.row-btns { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row-btns.center { justify-content: center; }
.col-btns { display: flex; flex-direction: column; gap: 10px; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; margin: 4px 0 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 13px; font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip .c { font-family: var(--mono); font-size: .74rem; opacity: .75; margin-left: 5px; }
.seg { display: flex; background: var(--sunk); border-radius: 12px; padding: 3px; gap: 2px; flex-wrap: wrap; }
.seg button { flex: 1; border: 0; background: transparent; border-radius: 9px; padding: 8px 6px; font-weight: 600; font-size: .88rem; color: var(--muted); min-width: 44px; }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; padding: 2px 10px 2px 3px; border-radius: 999px; white-space: nowrap; --c: var(--muted); background: var(--sunk); color: var(--c); }
.pill.k-ok { --c: var(--ok); background: var(--ok-soft); }
.pill.k-soon, .pill.k-low { --c: var(--soon); background: var(--soon-soft); }
.pill.k-urgent, .pill.k-gone { --c: var(--bad); background: var(--bad-soft); }
.dial { width: 16px; height: 16px; border-radius: 50%; background: conic-gradient(var(--c) calc(var(--p) * 1turn), transparent 0); box-shadow: inset 0 0 0 1.5px var(--c); flex: none; display: inline-block; }
.tag { display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--sunk); color: var(--muted); white-space: nowrap; }
.tag.acc { background: var(--accent-soft); color: var(--accent); } .tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--soon-soft); color: var(--soon); } .tag.bad { background: var(--bad-soft); color: var(--bad); }
.stars { color: var(--soon); letter-spacing: 1px; }

/* ---------- layout blocks ---------- */
main { padding: 8px 0 20px; }
.block { margin: 0 0 24px; }
.head { display: flex; align-items: end; gap: 10px; margin: 6px 0 12px; flex-wrap: wrap; }
.banner { background: var(--accent-soft); border-radius: var(--r); padding: 12px 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.banner p { margin: 0; flex: 1 1 220px; }
.note { background: var(--sunk); border-radius: var(--r-sm); padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.err { background: var(--bad-soft); color: var(--bad); border-radius: var(--r-sm); padding: 10px 12px; font-weight: 600; margin: 10px 0; }
.busy { display: flex; gap: 12px; align-items: center; padding: 14px; background: var(--sunk); border-radius: var(--r); margin: 10px 0; }
.busy > div { flex: 1; }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: sp 1s linear infinite; flex: none; }
@keyframes sp { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) { .spin { animation-duration: 4s; } * { scroll-behavior: auto !important; } }
.emptyst { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 24px 18px; text-align: center; color: var(--muted); }
.emptyst h3 { color: var(--ink); margin-bottom: 6px; }
.card-lite { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; margin: 12px 0; }
.quick-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 18px; }
.qbtn { position: relative; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 4px 9px; display: flex; flex-direction: column; align-items: center; gap: 3px; font-size: .78rem; font-weight: 600; color: var(--ink); line-height: 1.2; text-align: center; }
.qbtn > span { font-size: 1.45rem; line-height: 1; }
.quick-row:has(> :nth-child(2):last-child) { grid-template-columns: repeat(2, 1fr); }

/* ---------- today ---------- */
.hello { display: flex; align-items: flex-start; gap: 12px; margin: 8px 0 14px; }
.hello > div { flex: 1; }
.wx { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 8px 12px; display: flex; gap: 8px; align-items: center; text-align: left; flex: none; }
.wx-ico { font-size: 1.8rem; line-height: 1; }
.wx b { font-family: var(--display); font-size: 1.3rem; display: block; line-height: 1.1; }
.wx small { color: var(--muted); font-size: .75rem; display: block; max-width: 9em; }
.meal-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .meal-grid { grid-template-columns: repeat(7, minmax(0, 1fr)); } }
.meal-type { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 4px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; font-size: .76rem; line-height: 1.15; text-align: center; overflow-wrap: anywhere; }
.meal-type span { font-size: 1.5rem; }
.meal-type.now { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.holiday { width: 100%; border: 0; border-radius: var(--r); background: linear-gradient(120deg, var(--accent-soft), var(--soon-soft)); padding: 12px 14px; display: flex; gap: 12px; align-items: center; text-align: left; margin-bottom: 20px; }
.holiday > span:first-child { font-size: 1.8rem; }
.holiday b { display: block; } .holiday small { color: var(--muted); }
.holiday span:nth-child(2) { flex: 1; }
.mood { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 12px; }
.nut-mini { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px 14px; text-align: left; display: flex; flex-direction: column; gap: 6px; }
.nut-mini b { font-size: 1.3rem; } .nut-mini small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.chev { color: var(--muted); font-size: 1.2rem; flex: none; }

/* ---------- kitchen ---------- */
.soon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.soon-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 7px; }
.soon-card > .pill { align-self: flex-start; }
.soon-top { border: 0; background: none; padding: 0; display: flex; gap: 8px; align-items: center; text-align: left; }
.soon-top .nm { font-weight: 700; }
.ico { font-size: 1.35rem; width: 1.6em; text-align: center; flex: none; line-height: 1; }
.big-ico { font-size: 1.4em; }
.dept { margin-bottom: 18px; }
.dept h3 { display: flex; gap: 8px; align-items: baseline; margin-bottom: 6px; }
.dept h3 .mono { font-size: .8rem; font-weight: 400; }
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "main qty fr"; gap: 8px; align-items: center; padding: 8px 10px; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.row-main { grid-area: main; border: 0; background: none; padding: 0; display: flex; gap: 8px; align-items: center; text-align: left; min-width: 0; }
.row-main .nm { min-width: 0; }
.row-main b { font-weight: 600; display: block; overflow-wrap: anywhere; }
.row-main small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.row .qty { grid-area: qty; } .row .fr { grid-area: fr; justify-self: end; }
@media (max-width: 640px) { .row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main main" "qty fr"; } }
.qty { display: flex; align-items: center; gap: 2px; font-family: var(--mono); font-size: .84rem; }
.qty span { min-width: 64px; text-align: center; }
.qty button { border: 1px solid var(--line); background: var(--surface); width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; display: grid; place-items: center; }
.qty button:hover { background: var(--sunk); }
.qty.big { font-size: 1.05rem; justify-content: center; }
.qty.big button { width: 44px; height: 44px; }
.fresh-parts { display: flex; gap: 16px; flex-wrap: wrap; margin: 6px 0; }
.fresh-parts > div { display: flex; flex-direction: column; gap: 3px; }

/* ---------- cook ---------- */
.weeknav { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.weeknav b { margin-right: auto; font-family: var(--display); }
.week { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 96px; }
.day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.dl { display: flex; justify-content: space-between; align-items: baseline; }
.dl b { font-family: var(--display); } .dl span { font-family: var(--mono); font-size: .76rem; color: var(--muted); }
.meal { background: var(--sunk); border-radius: 10px; padding: 7px 8px; display: flex; flex-direction: column; gap: 4px; font-size: .86rem; }
.meal.cooked { opacity: .6; } .meal.cooked .mn { text-decoration: line-through; }
.meal .mn { border: 0; background: none; padding: 0; text-align: left; font-weight: 600; line-height: 1.25; }
.meal .ma { display: flex; gap: 4px; align-items: center; }
.empty-day { font-size: .8rem; color: var(--muted); }
.add-day { margin-top: auto; border: 1px dashed var(--line); background: transparent; border-radius: 10px; padding: 5px; color: var(--muted); font-weight: 600; font-size: .82rem; }
.short { background: var(--soon-soft); border-radius: var(--r); padding: 12px 14px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 12px; }
.short p { margin: 0; flex: 1 1 240px; }
.ideas { display: flex; flex-direction: column; gap: 8px; }
.idea { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px; display: flex; gap: 12px; align-items: center; text-align: left; }
.idea.static { cursor: default; }
.idea-ico { font-size: 1.8rem; width: 44px; height: 44px; border-radius: 12px; background: var(--sunk); display: grid; place-items: center; flex: none; }
.idea-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.idea-t b { overflow-wrap: anywhere; }
.meta { display: flex; gap: 6px 10px; flex-wrap: wrap; align-items: center; font-size: .8rem; color: var(--muted); margin: 2px 0; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.rcard { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.rcard-ico { font-size: 2.2rem; }
.photo { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: 10px; background: var(--sunk); display: block; }
.days { display: flex; gap: 5px; flex-wrap: wrap; }
.days button { border: 1px solid var(--line); background: var(--surface); border-radius: 9px; padding: 6px 0; min-width: 48px; font-size: .8rem; font-weight: 700; color: var(--muted); }
.days button:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.days button.t { border-color: var(--accent); color: var(--accent); }
ul.ing { list-style: none; padding: 0; margin: 0; }
ul.ing li { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
ul.ing li:first-child { border-top: 0; }
ul.ing .q { font-family: var(--mono); font-size: .82rem; color: var(--muted); min-width: 70px; }
ul.ing .nm { flex: 1; }
ol.steps { margin: 0; padding-left: 1.3em; display: flex; flex-direction: column; gap: 8px; }
.scraps { background: var(--ok-soft); border-radius: var(--r); padding: 12px 14px; margin: 14px 0; }
.scraps ul { margin: 6px 0 0; padding-left: 1.1em; }
.nchips { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 2px; }
.nchips span { background: var(--sunk); border-radius: 999px; padding: 3px 10px; font-size: .82rem; font-weight: 600; }
.log { display: flex; flex-direction: column; gap: 10px; }
.logi { display: grid; grid-template-columns: 84px 1fr; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.logi img, .logi .ph { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; background: var(--sunk); display: grid; place-items: center; font-size: 2rem; }
.starpick { display: flex; gap: 6px; }
.starpick button { border: 0; background: var(--sunk); width: 46px; height: 46px; border-radius: 12px; font-size: 1.4rem; color: var(--muted); }
.starpick button[aria-pressed="true"] { background: var(--soon-soft); color: var(--soon); }
.preview { max-width: 100%; max-height: 240px; border-radius: 12px; display: block; margin: 8px 0; }

/* ---------- forms ---------- */
input[type=text], input[type=number], input[type=date], input[type=url], input[type=password], select, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 11px; width: 100%; min-width: 0; min-height: 44px; }
textarea { resize: vertical; min-height: 80px; }
label.f { display: flex; flex-direction: column; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--muted); }
label.check { display: flex; gap: 10px; align-items: center; margin: 10px 0; font-weight: 500; }
label.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.span2 { grid-column: 1 / -1; }
.addrow { display: flex; gap: 8px; margin: 8px 0 14px; }
.addrow input { flex: 1; }
details summary { cursor: pointer; color: var(--muted); padding: 6px 0; }

/* ---------- sheets ---------- */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(8, 12, 10, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.sheet { background: var(--surface); width: 100%; max-width: 680px; max-height: 92vh; max-height: 92dvh; border-radius: 22px 22px 0 0; display: flex; flex-direction: column; box-shadow: 0 -10px 40px rgba(0,0,0,.2); animation: up .2s ease-out; }
.sheet.full { height: 92vh; height: 92dvh; }
.sheet.wide { max-width: 900px; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 8px auto 0; flex: none; }
.sheet-body { overflow-y: auto; padding: 8px 18px calc(22px + env(safe-area-inset-bottom, 0px)); overscroll-behavior: contain; }
@media (min-width: 760px) { .scrim { align-items: center; padding: 24px; } .sheet { border-radius: 22px; max-height: 88vh; } .sheet.full { height: 88vh; } .grab { display: none; } .sheet-body { padding-top: 18px; } }
@keyframes up { from { transform: translateY(40px); opacity: .6; } }
@keyframes fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .scrim, .sheet { animation: none; } }
.sh { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 10px; position: sticky; top: -8px; background: var(--surface); padding: 8px 0 6px; z-index: 2; }
.sh > div { flex: 1; min-width: 0; }
.sh h2 { font-size: 1.3rem; overflow-wrap: anywhere; }
.sf { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: flex-end; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 18px; }
.sf .grow { flex: 1; }

/* ---------- scanning ---------- */
.drop-zone { border: 2px dashed var(--line); border-radius: var(--r); padding: 18px; text-align: center; display: flex; flex-direction: column; gap: 8px; align-items: center; margin: 12px 0; }
.dz-ico { font-size: 2.4rem; }
.seg.wide { margin: 8px 0; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.th { position: relative; }
.th img { width: 80px; height: 104px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); display: block; }
.th .icon-btn { position: absolute; top: 3px; right: 3px; background: var(--surface); }
.receipt { background: var(--sunk); border-radius: 8px; padding: 14px 14px 10px; position: relative; margin-bottom: 10px; }
.receipt::before, .receipt::after { content: ""; position: absolute; left: 0; right: 0; height: 8px; background: radial-gradient(circle at 6px 0, var(--surface) 5px, transparent 5.5px) 0 0 / 12px 8px repeat-x; }
.receipt::before { top: 0; } .receipt::after { bottom: 0; transform: scaleY(-1); }
.rrow { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.rev { display: flex; flex-direction: column; gap: 10px; }
.rev-item { border: 1px solid var(--line); border-radius: var(--r); padding: 10px; display: flex; flex-direction: column; gap: 6px; }
.rev-item.off { opacity: .5; }
.rev-top { display: flex; gap: 8px; align-items: center; }
.rev-top input[type=text] { flex: 1; font-weight: 600; }
.ico-in { width: 48px !important; flex: none; text-align: center; font-size: 1.2rem; padding: 6px !important; }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 6px; }
.rev-grid input, .rev-grid select { padding: 7px 8px; min-height: 38px; font-size: .88rem; }
.question { background: var(--soon-soft); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; }

/* ---------- list ---------- */
.glist { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; align-items: start; }
.gsec { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 12px 8px; }
.gsec h3 { font-size: .95rem; padding: 10px 0 4px; }
.gi { display: flex; gap: 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line); }
.gsec .gi:first-of-type, .rev .gi:first-child { border-top: 0; }
.gi input[type=checkbox] { width: 22px; height: 22px; accent-color: var(--accent); flex: none; }
.gt { flex: 1; min-width: 0; }
.gt small { display: block; color: var(--muted); font-size: .76rem; line-height: 1.3; }
.gt small.ok-t { color: var(--ok); }
.gi.done .gt > span { text-decoration: line-through; color: var(--muted); }
.gi .step { display: flex; gap: 2px; }
.qty-in { width: 64px !important; flex: none; } .unit-in { width: 64px !important; flex: none; }
.price { font-family: var(--mono); font-size: .82rem; text-align: right; white-space: nowrap; }
.price small { display: block; font-family: var(--body); color: var(--muted); font-size: .7rem; }
.totalbar, .tipstat { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; margin-bottom: 12px; }
.totalbar .big, .tipstat .big { font-family: var(--display); font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1; }

/* ---------- health ---------- */
.nbar { margin: 10px 0; }
.nl { display: flex; justify-content: space-between; gap: 10px; font-size: .9rem; font-weight: 600; margin-bottom: 4px; }
.track { height: 9px; border-radius: 5px; background: var(--sunk); overflow: hidden; }
.track i { display: block; height: 100%; border-radius: 5px; background: var(--ok); }
.track i.warn, .track i.low { background: var(--soon); } .track i.bad { background: var(--bad); }
.track i.low { opacity: .6; }
.vgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 10px 0; }
.vit { border-radius: 12px; padding: 8px; display: flex; flex-direction: column; background: var(--sunk); }
.vit b { font-family: var(--mono); font-size: 1.1rem; } .vit span { font-size: .76rem; color: var(--muted); }
.vit.ok { background: var(--ok-soft); } .vit.ok b { color: var(--ok); }
.vit.warn { background: var(--soon-soft); } .vit.warn b { color: var(--soon); }
.vit.low b { color: var(--bad); }
.tip-line { display: flex; flex-direction: column; padding: 8px 0; border-top: 1px solid var(--line); }
.tip { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.tip .tag { align-self: flex-start; }
.save { font-family: var(--mono); font-size: .8rem; color: var(--ok); font-weight: 600; }
.swaps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.swap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.swap-h { display: flex; gap: 10px; align-items: center; } .swap-h .big-ico { font-size: 2rem; }
.adds { display: flex; flex-direction: column; gap: 4px; }
.add { font-size: .8rem; background: var(--bad-soft); color: var(--ink); border-radius: 8px; padding: 4px 8px; }
.add b { color: var(--bad); font-family: var(--mono); }

/* ---------- catch up ---------- */
.progress { height: 6px; background: var(--sunk); border-radius: 3px; overflow: hidden; margin-bottom: 14px; }
.progress i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.cu-card { text-align: center; padding: 18px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.cu-ico { font-size: 3.2rem; }
.cu-btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; width: 100%; margin-top: 12px; }

/* ---------- assistant ---------- */
.chat { display: flex; flex-direction: column; gap: 10px; padding-bottom: 8px; }
.msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; line-height: 1.45; }
.msg.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 4px; }
.msg.ai { align-self: flex-start; background: var(--sunk); border-bottom-left-radius: 4px; }
.msg p { margin: .2em 0; } .msg ul { margin: .3em 0; padding-left: 1.2em; }
.chat-recipe { display: flex; flex-direction: column; gap: 6px; margin-left: 4px; }
.chat-in { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); background: var(--surface); display: flex; gap: 8px; padding: 10px 0 12px; margin-top: 8px; }
.chat-in input { flex: 1; }

/* ---------- settings ---------- */
section.set { border-top: 1px solid var(--line); padding: 14px 0; }
section.set:first-of-type { border-top: 0; }
section.set h3 { margin-bottom: 6px; }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 10px; }
.swatch { border: 2px solid; border-radius: 12px; padding: 10px; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .86rem; }
.swatch i { width: 18px; height: 18px; border-radius: 50%; flex: none; }
.swatch[aria-pressed="true"] { outline: 3px solid var(--accent); outline-offset: 1px; }
.colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin: 6px 0; }
.color { display: flex; gap: 8px; align-items: center; font-size: .86rem; font-weight: 600; background: var(--sunk); border-radius: 10px; padding: 6px 8px; }
.color input { width: 34px; height: 30px; border: 0; padding: 0; background: none; }

/* ---------- welcome & toasts ---------- */
.welcome { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; padding: 10px 2px; }
.welcome ul { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.welcome .col-btns { width: 100%; margin-top: 8px; }
.toasts { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 70px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100% - 32px)); pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 11px 14px; border-radius: 12px; display: flex; gap: 10px; align-items: center; box-shadow: 0 6px 24px rgba(0,0,0,.25); font-size: .92rem; pointer-events: auto; }
.toast span { flex: 1; }
.toast button { background: transparent; border: 1px solid currentColor; color: inherit; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .84rem; }
body:not(.ready) main { opacity: 0; }
.toast { cursor: pointer; animation: tin .16s ease-out; transition: opacity .18s, transform .18s; }
.toast.out { opacity: 0; transform: translateY(6px); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* ---------- v6 ---------- */
.quick-row.five { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.quick-row.five .qbtn { font-size: .72rem; padding: 9px 2px 8px; }
.quick-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.btn.xs { padding: 2px 10px; min-height: 26px; font-size: .74rem; border-radius: 999px; }
.search, input[type=search] { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 9px 14px; width: 100%; min-height: 42px; margin: 4px 0 10px; }
.move-note { color: var(--accent); font-weight: 600; margin: 4px 0; }
.fav-mark { color: var(--soon); }

/* kitchen rows: brand under the name, a star, and "Used up" above the clock */
small.brand { display: block; color: var(--accent); font-size: .76rem; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.soon-top .nm small.brand { font-weight: 600; }
.row { grid-template-columns: minmax(0, 1fr) auto auto auto; grid-template-areas: "main star qty fr"; }
.row .star { grid-area: star; }
.row .fr { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
@media (max-width: 640px) { .row { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "main main star" "qty fr fr"; } .row .fr { justify-self: end; } }
.star { border: 0; background: none; width: 34px; height: 34px; border-radius: 10px; font-size: 1.2rem; color: var(--muted); display: grid; place-items: center; align-self: start; }
.star[aria-pressed="true"], .star-big[aria-pressed="true"] { color: var(--soon); }
.star:hover { background: var(--sunk); }
.star-big { font-size: 1.4rem; }
.use-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin: 10px 0; }

/* recipe list: rectangle with little square photos on the right */
.rc-list { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.rcard { flex-direction: row; align-items: stretch; gap: 10px; min-height: 92px; }
.rc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.rc-top { display: flex; gap: 8px; align-items: center; }
.rc-top b { overflow-wrap: anywhere; }
.rcard .rcard-ico { font-size: 1.6rem; line-height: 1; }
.rc-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.rc-thumbs { flex: none; display: grid; gap: 4px; align-self: center; }
.rc-thumbs img { width: 52px; height: 52px; object-fit: cover; border-radius: 8px; background: var(--sunk); display: block; }
.rc-thumbs.n1 img { width: 76px; height: 76px; }
.rc-thumbs.n2 { grid-template-columns: 1fr; } .rc-thumbs.n2 img { width: 44px; height: 44px; }
.rc-thumbs.n3 { grid-template-columns: 1fr 1fr; } .rc-thumbs.n3 img { width: 40px; height: 40px; } .rc-thumbs.n3 img:first-child { grid-column: 1 / -1; width: 84px; height: 48px; }
.rec-tools { display: flex; gap: 8px; align-items: center; }
.rec-tools .search { flex: 1; margin: 4px 0; }
.sortsel { flex: none; max-width: 45%; }
.sortsel select { border-radius: 999px; padding: 8px 10px; min-height: 42px; width: 100%; }
.due { background: var(--accent-soft); border-radius: var(--r); padding: 10px 12px; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.due .idea { background: var(--surface); }

/* recipe page */
.banner-ph { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -18px 10px; padding: 0 18px; scrollbar-width: none; }
.banner-ph::-webkit-scrollbar { display: none; }
.banner-ph button { flex: 0 0 100%; border: 0; padding: 0; background: none; scroll-snap-align: center; }
.banner-ph.multi button { flex-basis: 88%; }
.banner-ph img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 16px; display: block; background: var(--sunk); }
label.check.remind { background: var(--sunk); border-radius: var(--r-sm); padding: 10px 12px; font-size: .9rem; align-items: flex-start; }
ul.ing .nm { display: flex; flex-direction: column; }
small.as { color: var(--ok); font-size: .74rem; }
ul.ing li > .linkish.small { font-size: .76rem; color: var(--accent); flex: none; }
.timeline { list-style: none; margin: 4px 0 0; padding: 0 0 0 6px; }
.timeline li { position: relative; display: grid; grid-template-columns: 18px 1fr; gap: 8px; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); margin-top: 3px; box-shadow: 0 0 0 3px var(--accent-soft); }
.tl-body p { margin: 2px 0 0; font-size: .9rem; }
.tl-thumbs { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.tl-ph { border: 0; padding: 0; background: none; border-radius: 10px; }
.tl-ph img { width: 92px; height: 92px; object-fit: cover; border-radius: 10px; display: block; background: var(--sunk); }

/* recipe editor: photos first, stuck to the top while you write */
.sh-stick { position: sticky; top: -8px; z-index: 3; background: var(--surface); padding-bottom: 6px; margin: 0 -18px; padding-left: 18px; padding-right: 18px; border-bottom: 1px solid var(--line); }
.sh-stick .sh { position: static; margin-bottom: 4px; }
.re-photos { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; }
.re-photos::-webkit-scrollbar { display: none; }
.re-th { position: relative; flex: none; }
.re-img { display: block; border: 0; padding: 0; background: var(--sunk); width: 72px; height: 72px; border-radius: 10px; overflow: hidden; }
.re-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.re-th.main .re-img { box-shadow: 0 0 0 2px var(--soon); }
.re-main { position: absolute; left: 4px; bottom: 4px; background: var(--soon); color: #fff; font-size: .62rem; font-weight: 700; border-radius: 6px; padding: 0 5px; }
.re-mk, .re-rm { position: absolute; top: 3px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: .72rem; display: grid; place-items: center; padding: 0; }
.re-rm { right: 3px; } .re-mk { left: 3px; }
.re-add { flex: none; width: 72px; height: 72px; border: 2px dashed var(--line); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: .72rem; font-weight: 600; color: var(--muted); cursor: pointer; text-align: center; }
.re-add span { font-size: 1.3rem; }
.th.sq img { width: 84px; height: 84px; }

/* photo viewer */
.lightbox { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; align-items: center; justify-content: center; animation: fade .15s; touch-action: pan-y; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; display: block; }
.lb-bar { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; gap: 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 12px 10px 16px; color: #fff; background: linear-gradient(rgba(0,0,0,.6), transparent); font-weight: 600; }
.lb-bar > span { flex: 1; }
.lb-x, .lb-nav { border: 0; background: rgba(255,255,255,.14); color: #fff; width: 42px; height: 42px; border-radius: 50%; font-size: 1.1rem; display: grid; place-items: center; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 1.8rem; }
.lb-prev { left: 10px; } .lb-next { right: 10px; }

/* barcode */
.cam { position: relative; border-radius: var(--r); overflow: hidden; background: #000; aspect-ratio: 4 / 3; margin: 8px 0 12px; }
.cam video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-line { position: absolute; left: 12%; right: 12%; top: 50%; height: 2px; background: #ff4d4d; box-shadow: 0 0 10px #ff4d4d; animation: scanl 1.6s ease-in-out infinite alternate; }
@keyframes scanl { from { transform: translateY(-40px); } to { transform: translateY(40px); } }
@media (prefers-reduced-motion: reduce) { .cam-line { animation: none; } }
.prod { display: flex; gap: 12px; align-items: center; margin: 4px 0 12px; }
.prod img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 10px; border: 1px solid var(--line); flex: none; }
.prod-ico { font-size: 2.4rem; width: 72px; height: 72px; display: grid; place-items: center; background: var(--sunk); border-radius: 10px; flex: none; }
.verdict { display: flex; gap: 12px; align-items: center; border-radius: var(--r); padding: 12px 14px; margin: 8px 0; background: var(--sunk); }
.verdict .v-ico { font-size: 1.8rem; }
.verdict.v-good { background: var(--ok-soft); } .verdict.v-good b { color: var(--ok); }
.verdict.v-ok { background: var(--soon-soft); } .verdict.v-ok b { color: var(--soon); }
.verdict.v-poor { background: var(--bad-soft); } .verdict.v-poor b { color: var(--bad); }
.scores { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.scores > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px 12px; display: flex; flex-direction: column; gap: 4px; }
.ns-row { display: flex; gap: 2px; }
.ns-row i { font-style: normal; font-weight: 800; color: #fff; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 6px; opacity: .35; font-size: .85rem; }
.ns-row i.on { opacity: 1; transform: scale(1.18); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--ink); }
.ns-a { background: #038141; } .ns-b { background: #85BB2F; } .ns-c { background: #E6A700; } .ns-d { background: #EE8100; } .ns-e { background: #E63E11; }
.nova b { font-family: var(--display); } .nova small { color: var(--muted); font-size: .76rem; }
.nova.n4 b { color: var(--bad); } .nova.n3 b { color: var(--soon); } .nova.n1 b, .nova.n2 b { color: var(--ok); }
.lights { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lt { background: var(--sunk); border-radius: 10px; padding: 4px 9px; font-size: .82rem; }
.lt-ok { background: var(--ok-soft); } .lt-warn { background: var(--soon-soft); } .lt-bad { background: var(--bad-soft); }
.lt-bad b { color: var(--bad); } .lt-ok b { color: var(--ok); }
.money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.money > div { background: var(--sunk); border-radius: 10px; padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.money b { font-size: 1.1rem; } .money small { font-size: .7rem; color: var(--muted); }
.healthier { margin: 6px 0; padding-left: 1.1em; }
.brand-in { min-height: 36px !important; padding: 6px 10px !important; font-size: .84rem; }

/* screen pets */
#pets { position: fixed; inset: 0; pointer-events: none; z-index: 26; overflow: hidden; }
body.sheet-open #pets { display: none; }
.pet { position: absolute; left: 0; top: 0; display: none; background-repeat: no-repeat; image-rendering: pixelated; image-rendering: crisp-edges; will-change: transform; filter: drop-shadow(0 1px 0 rgba(0,0,0,.18)); }
.pet-pop { position: absolute; transform: translate(-50%, -100%); font-size: 1rem; color: var(--bad); font-weight: 800; animation: petpop 1.1s ease-out forwards; }
@keyframes petpop { to { transform: translate(-50%, -260%); opacity: 0; } }
@media (prefers-color-scheme: dark) { .pet { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); } }
:root[style*="color-scheme: dark"] .pet { filter: drop-shadow(0 0 1px rgba(255,255,255,.55)); }

/* ---------- v7 ---------- */
nav.tabs button { min-width: 0; }
nav.tabs .tl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tag.tagbtn { border: 0; cursor: pointer; font: inherit; font-size: .72rem; font-weight: 700; }
.src-ph { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.src-ph .tl-ph img { width: 52px; height: 52px; }
.kpick { background: var(--sunk); border-radius: var(--r-sm); padding: 6px 10px 2px; margin: -2px 0 10px; }
.kpick summary { padding: 4px 0; }
.kpick .search { margin: 6px 0; min-height: 36px; padding: 6px 12px; }
.kpick .chips { max-height: 180px; overflow-y: auto; }
.datef { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.datef input[type=date] { width: auto; min-height: 34px; padding: 4px 8px; border-radius: 999px; }
.tl-body > div:first-child { position: relative; padding-right: 30px; }
.tl-del { position: absolute; right: 0; top: -4px; opacity: .6; }

/* freezer space */
.fz { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; text-align: left; }
.fz-top { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; color: var(--muted); }
.fz-track { height: 8px; border-radius: 4px; background: var(--sunk); overflow: hidden; }
.fz-track i { display: block; height: 100%; border-radius: 4px; background: var(--accent); opacity: .75; }
.fz.full { background: var(--accent-soft); border-color: var(--accent-soft); }
.fz.full .fz-top { color: var(--accent); }
.dept > .btn.sm { margin-bottom: 8px; }

/* cycle */
.cy-start p { margin: 4px 0 8px; }
.cy-hero { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; margin-bottom: 10px; --c: var(--accent); }
.cy-menstrual { --c: var(--bad); } .cy-follicular { --c: var(--ok); } .cy-ovulatory { --c: var(--accent); } .cy-luteal { --c: var(--soon); }
.cy-ring { width: 84px; height: 84px; border-radius: 50%; flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; position: relative;
  background: conic-gradient(var(--c) calc(var(--p) * 1turn), var(--sunk) 0); }
.cy-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--surface); }
.cy-ring b, .cy-ring small { position: relative; } .cy-ring b { font-family: var(--display); font-size: 1.05rem; } .cy-ring small { font-size: .7rem; color: var(--muted); }
.cy-hero p { margin: 2px 0; }
.cy-note { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cy-guide { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 0 10px; }
.cal .weeknav b { text-align: center; }
.cal-g { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; text-align: center; }
.cal-h { font-size: .7rem; font-weight: 700; color: var(--muted); }
.cal-d { font-size: .8rem; padding: 6px 0; border-radius: 50%; aspect-ratio: 1; display: grid; place-items: center; font-family: var(--mono); }
.cal-d.per { background: var(--bad); color: #fff; } .cal-d.per-p { background: var(--bad-soft); color: var(--bad); }
.cal-d.ovu { background: var(--accent-soft); color: var(--accent); } .cal-d.today { box-shadow: 0 0 0 2px var(--ink); font-weight: 700; }
.cal-key { display: flex; gap: 12px; margin-top: 8px; color: var(--muted); }
.cal-key i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.cal-key i.per { background: var(--bad); } .cal-key i.per-p { background: var(--bad-soft); border: 1px solid var(--bad); } .cal-key i.ovu { background: var(--accent-soft); border: 1px solid var(--accent); }
.cy-mini { width: 100%; display: flex; gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px; margin-bottom: 16px; --c: var(--accent); border-left: 4px solid var(--c); }
.cy-mini > span:first-child { font-size: 1.5rem; } .cy-mini b { display: block; } .cy-mini small { color: var(--muted); }

/* ---------- v8 ---------- */
.quick-row.six { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.quick-row.six .qbtn { font-size: .74rem; padding: 8px 2px; }
.badge.soft { background: var(--accent); }
.ask-empty { background: var(--soon-soft); border-radius: var(--r); padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.ask-card { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border-radius: var(--r-sm); padding: 10px; }
.ask-card small { display: block; margin: 2px 0 6px; }
.rw[hidden], .fam[hidden], .dept[hidden] { display: none; }
.rows > .rw:first-child > .row, .rows > .fam:first-child { border-top: 0; }
.rw > .row { border-top: 1px solid var(--line); }
.fam { border-top: 1px solid var(--line); }
.fam > summary { list-style: none; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; padding: 10px; cursor: pointer; }
.fam > summary::-webkit-details-marker { display: none; }
.fam > summary .nm b { display: block; } .fam > summary small { display: block; color: var(--muted); font-size: .78rem; }
.fam > summary::after { content: "▾"; grid-column: 3; color: var(--muted); display: none; }
.fam[open] > summary { background: var(--sunk); }
.fam-rows { border-left: 3px solid var(--accent-soft); margin-left: 10px; }
.outs { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 4px 10px; }
.outs > summary { padding: 10px 2px; cursor: pointer; }
.row.out { opacity: .75; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main fr"; }
.out-btns { display: flex; gap: 4px; align-items: center; }
.used { background: var(--sunk); border: 0; }
.used-row { padding: 8px 0; border-top: 1px solid var(--line); }
.used-row:first-of-type { border-top: 0; }
.used-row .chips { margin: 4px 0 0; padding: 0; }
.keep-note { margin: 4px 0 8px; }
.tweaks { margin: 10px 0 0; }
.tl-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.tl-note { margin-top: 4px; color: var(--accent); font-size: .8rem; }
.next-time { background: var(--accent-soft); }
.act-card { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--r); padding: 10px 12px; margin: 0 0 4px 4px; }
.act-line { margin: 4px 0; font-size: .9rem; }
.tidy { margin: -2px 0 8px; }
.cu-in { width: 100%; max-width: 360px; margin: 10px auto 0; }
.cu-in select { width: auto; }

/* ---------- v9 ---------- */
.warn-t { color: var(--soon); font-weight: 600; }
.chk-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; padding: 4px 0; }
.serves-step { display: inline-flex; align-items: center; gap: 2px; }
.serves-step .icon-btn { width: 26px; height: 26px; font-size: .9rem; }
/* cook mode */
.cookmode .cm-serves { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 8px; font-weight: 600; }
.cm-ing li { padding: 4px 0; } .cm-ing label.check { margin: 0; font-size: 1.05rem; }
.cm-step { min-height: 40vh; display: flex; flex-direction: column; gap: 14px; justify-content: center; }
.cm-text { font-size: 1.45rem; line-height: 1.45; font-weight: 500; }
.cm-nav { position: sticky; bottom: calc(-22px - env(safe-area-inset-bottom, 0px)); background: var(--surface); display: flex; gap: 8px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); margin-top: 16px; }
.cm-nav .btn { min-height: 52px; font-size: 1.05rem; padding: 0 22px; }
.cm-dots { flex: 1; display: flex; gap: 4px; justify-content: center; flex-wrap: wrap; }
.cm-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.cm-dots i.on { background: var(--accent); width: 18px; border-radius: 4px; }
.tm-bar { display: flex; gap: 6px; overflow-x: auto; margin: 0 0 10px; position: sticky; top: 52px; z-index: 2; background: var(--surface); padding: 4px 0; }
.tm { border: 2px solid var(--accent); background: var(--accent-soft); color: var(--ink); border-radius: 12px; padding: 6px 12px; display: flex; flex-direction: column; align-items: flex-start; flex: none; }
.tm b { font-family: var(--mono); font-size: 1.3rem; } .tm small { font-size: .72rem; color: var(--muted); }
.tm.done { border-color: var(--ok); background: var(--ok-soft); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.04); } }
/* week plan */
.wp-day { margin: 10px 0; display: flex; flex-direction: column; gap: 6px; }
.idea.off, .wp-batch.off { opacity: .45; }
.meal.prep { background: var(--accent-soft); }
.meal.prep label.check { margin: 2px 0; font-size: .78rem; align-items: flex-start; }
.meal.prep label.check input { width: 16px; height: 16px; }
/* cycle heat map */
.heat { display: grid; grid-template-columns: minmax(70px, auto) repeat(var(--n), minmax(0, 1fr)); gap: 2px; align-items: center; overflow-x: auto; }
.heat .hd { font-size: .6rem; color: var(--muted); text-align: center; height: 12px; }
.heat .hd.h-per { border-bottom: 2px solid var(--bad); } .heat .hd.h-ovu { border-bottom: 2px solid var(--accent); }
.heat .hl { font-size: .72rem; color: var(--muted); white-space: nowrap; padding-right: 4px; }
.hc { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--sunk); min-width: 5px; }
.hc.l1 { background: color-mix(in srgb, var(--accent) 35%, var(--sunk)); } .hc.l2 { background: color-mix(in srgb, var(--accent) 65%, var(--sunk)); } .hc.l3 { background: var(--accent); }
.h-key { display: inline-block; width: 12px; height: 3px; vertical-align: middle; margin: 0 2px 0 6px; } .h-key.h-per { background: var(--bad); } .h-key.h-ovu { background: var(--accent); }

/* ---------- v10: simpler layout — one ＋ for adding, ☰ More for the rest, tips, heart measures, cooking-photo recipes ---------- */
.fab { display: none; }
.hbtn { border: 0; background: transparent; display: inline-flex; flex-direction: column; align-items: center; gap: 0; padding: 2px 8px; border-radius: 12px; color: var(--muted); font: 600 .68rem/1.1 var(--body); min-width: 44px; min-height: 40px; justify-content: center; }
.hbtn > span { font-size: 1.15rem; line-height: 1.2; }
.hbtn:hover, .hbtn[aria-pressed="true"] { background: var(--sunk); color: var(--ink); }
nav.tabs .nav-add { flex: 0 0 auto; width: 64px; max-width: 64px; margin-top: -22px; color: var(--accent); }
nav.tabs .nav-add .ti { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 1.9rem; font-weight: 700; filter: none; opacity: 1; box-shadow: 0 6px 18px rgba(0,0,0,.22); border: 4px solid var(--surface); }
.back-home { border: 0; background: var(--sunk); color: var(--ink); font-weight: 600; border-radius: 999px; padding: 6px 14px; margin: 2px 0 10px; }

.hub-g { margin: 14px 0 6px; }
.hub-g h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-family: var(--body); }
.hub-rows { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.hub-row, .todo-row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 12px 14px; color: var(--ink); font: inherit; }
.hub-row:first-child, .todo-row:first-child { border-top: 0; }
.hub-row:active, .todo-row:active { background: var(--sunk); }
.hub-ico { font-size: 1.45rem; width: 34px; text-align: center; flex: none; }
.hub-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hub-t small { color: var(--muted); font-size: .8rem; line-height: 1.3; }
.hub-row .badge { position: static; margin-left: auto; }
.hub-row.new .hub-t b::after { content: "NEW"; font: 700 .6rem/1 var(--mono); background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 5px; margin-left: 6px; vertical-align: 2px; }
.card-box .hub-rows { margin-top: 6px; }
.all-good { text-align: center; color: var(--muted); margin: 6px 0 16px; font-weight: 600; }

.help-tip { display: flex; align-items: flex-start; gap: 10px; background: var(--accent-soft); border-radius: var(--r); padding: 10px 12px; margin: 4px 0 14px; }
.help-tip p { margin: 0; flex: 1; font-size: .88rem; }
.tip-i { font-size: 1.1rem; }

.cy-wrap { position: relative; }
.cy-wrap .cy-mini { padding-right: 44px; }
.cy-wrap .cy-mini .chev { display: none; }
.cy-x { position: absolute; top: 50%; right: 6px; transform: translateY(-50%); border: 0; background: transparent; width: 34px; height: 34px; border-radius: 10px; color: var(--muted); font-size: .95rem; }
.cy-x:hover { background: var(--sunk); color: var(--ink); }

.seg.kview { margin: 4px 0 12px; flex-wrap: nowrap; }
.seg.kview button { font-size: .84rem; padding: 9px 4px; white-space: nowrap; }
.seg .c { font-style: normal; font-family: var(--mono); font-size: .72rem; opacity: .7; margin-left: 2px; }

.cu-own { width: 100%; text-align: left; margin-top: 8px; }
.cu-own-btn { margin-top: 10px; }

ul.ing-ed { list-style: none; padding: 0; margin: 4px 0 10px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
ul.ing-ed li { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 12px; border-top: 1px solid var(--line); }
ul.ing-ed li:first-child { border-top: 0; }
ul.ing-ed .nm { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.amt { border: 1px solid var(--line); background: var(--sunk); color: var(--ink); border-radius: 999px; padding: 5px 12px; font: 600 .82rem/1.2 var(--body); white-space: nowrap; max-width: 55%; overflow: hidden; text-overflow: ellipsis; }
.amt.ask { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.heart-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 6px 0 14px; }
.heart { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: var(--r-sm, 10px); padding: 8px 10px; font: inherit; }
.heart > span { grid-row: span 2; font-size: 1.4rem; }
.heart b { font-size: .9rem; } .heart small { color: var(--muted); font-size: .72rem; line-height: 1.2; }
.heart[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.am-n { margin: 4px 0 10px; }
.am-ph img { width: 100%; max-height: 200px; object-fit: cover; border-radius: var(--r); display: block; margin-bottom: 10px; }
.am-ch { margin: 4px 0 14px; }
.am-more { margin: 12px 0; }

.steps-how { display: flex; gap: 10px; align-items: flex-start; margin: 8px 0; }
.steps-how > span { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font: 700 .85rem var(--mono); }
.steps-how p { margin: 2px 0 0; font-size: .92rem; }
.stp-thumbs .th img { width: 76px; height: 76px; }
.th-n { position: absolute; left: 4px; bottom: 4px; background: rgba(0,0,0,.6); color: #fff; font: 700 .7rem/1 var(--mono); padding: 3px 5px; border-radius: 6px; }
ol.stp-list { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.stp { display: flex; gap: 10px; align-items: flex-start; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 8px; }
.stp-ph { flex: none; border: 0; padding: 0; background: var(--sunk); width: 72px; height: 72px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; font-size: 1.4rem; }
.stp-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.stp-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.stp-body textarea { width: 100%; font: inherit; font-size: .9rem; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); padding: 6px 8px; resize: vertical; box-sizing: border-box; }
.stp-move { display: flex; flex-direction: column; gap: 2px; }
.st-ph { float: right; border: 0; padding: 0; background: none; margin: 0 0 6px 10px; }
.st-ph img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; }
ol.steps li { overflow: hidden; }
.cm-ph { width: 100%; max-height: 38vh; object-fit: cover; border-radius: var(--r); display: block; margin: 8px 0; }
.ed-h { display: flex; align-items: center; gap: 8px; font-size: 1rem; margin: 20px 0 8px; }
.ed-h > span { width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font: 700 .78rem var(--mono); flex: none; }
.ed-h small { font-weight: 500; font-size: .78rem; }
.ed-more > summary { list-style: none; cursor: pointer; }
.ed-more > summary::-webkit-details-marker { display: none; }
.ed-more[open] > summary .ed-h small { display: none; }
/* water */
.water { display: flex; flex-direction: column; gap: 8px; }
.water b.mono { font-size: 1.3rem; } .water b small { font-size: .8rem; color: var(--muted); font-weight: 400; }
.glasses { display: flex; flex-wrap: wrap; gap: 2px; font-size: 1.05rem; }
.glasses span { filter: grayscale(1); opacity: .3; } .glasses span.on { filter: none; opacity: 1; }
.homeseg { margin-bottom: 4px; }

/* ---------- v14 ---------- */
.ico.ph { width: 2.2rem; height: 2.2rem; font-size: 0; }
.ico.ph img { width: 100%; height: 100%; object-fit: cover; border-radius: 10px; display: block; }
.it-ph { display: flex; gap: 10px; align-items: flex-end; margin: 8px 0; }
.it-ph > button { border: 0; padding: 0; background: none; flex: none; }
.it-ph img { width: 96px; height: 96px; object-fit: cover; border-radius: 14px; display: block; }
.e-ph { width: 44px; height: 44px; object-fit: cover; border-radius: 10px; }
.prep-box .addrow { margin: 0; }
.fam-add { margin: 6px 10px 10px; }
.uses { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.use-chip { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); background: var(--sunk); border-radius: 999px; padding: 2px 4px 2px 10px; font-size: .85rem; }
.use-chip.new { border-style: dashed; }
.use-chip .x { border: 0; background: none; color: var(--muted); padding: 2px 6px; font-size: .8rem; }
.uses .mu-new { flex: 1 1 100%; margin: 2px 0 0; }
.uses .mu-new input { font-size: .9rem; }
.todo-wrap { position: relative; }
.todo-wrap .todo-row { padding-right: 44px; }
.todo-x { position: absolute; right: 30px; top: 50%; transform: translateY(-50%); }
.cu-btns .idk { flex-basis: 100%; }
.tm-starts { display: grid; gap: 8px; margin-top: 10px; }
.alarm-full { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.82); display: flex; align-items: center; justify-content: center; }
.alarm-full > div { background: var(--surface); color: var(--ink); border-radius: 22px; padding: 26px 24px; display: grid; gap: 8px; justify-items: center; text-align: center; min-width: min(320px, 86vw); }
.alarm-full span { font-size: 3.2rem; line-height: 1; }
.alarm-full b { font-size: 1.4rem; }
.alarm-full .btn { font-size: 1.15rem; padding: 14px 40px; margin-top: 6px; }
.rec-notes ul { margin: 6px 0 0; padding-left: 18px; }
.label-nudge .btn { margin-top: 6px; }

/* ---------- v15 ---------- */
.focus { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 12px; }
.focus-b { border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 18px; padding: 14px 12px; display: grid; gap: 4px; text-align: left; }
.focus-b span { font-size: 1.8rem; line-height: 1; }
.focus-b small { color: var(--muted); font-size: .78rem; line-height: 1.3; }
.focus-b[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.say-big { width: 100%; display: flex; gap: 12px; align-items: center; text-align: left; border: 0; border-radius: 18px; padding: 14px 16px; margin-bottom: 14px; background: var(--accent); color: var(--accent-ink); }
.say-big > span:first-child { font-size: 1.8rem; }
.say-big b { display: block; font-size: 1.05rem; } .say-big small { opacity: .85; font-size: .8rem; }
.voice { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 10px 0 4px; }
.voice .mic { width: 96px; height: 96px; border-radius: 50%; border: 0; font-size: 2.6rem; background: var(--accent-soft); color: var(--ink); }
.voice.on .mic { background: var(--accent); animation: micpulse 1.2s infinite; }
@keyframes micpulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 60%, transparent); } 100% { box-shadow: 0 0 0 26px transparent; } }
.vc-text { font-size: 1.15rem; min-height: 2.6em; margin: 0; }
.wins { display: grid; gap: 10px; }
.win { display: flex; gap: 12px; align-items: center; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; background: var(--surface); }
.win-ico { font-size: 1.8rem; } .win b { font-size: 1.3rem; display: block; } .win small { display: block; }
.win .track { margin: 6px 0 2px; }
.win-line { width: 100%; display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); background: var(--ok-soft); color: var(--ink); border-radius: 14px; padding: 10px 14px; margin: 0 0 14px; text-align: left; font-weight: 600; }
.season .chip.have { border-color: var(--ok); background: var(--ok-soft); }
.season .chips + .chips { margin-top: 6px; }
.fresh-list { margin: 10px 0; }
.shop-scan { width: 100%; margin: 4px 0 12px; justify-content: flex-start; text-align: left; }
.shop-scan small { color: var(--muted); font-weight: 500; }
.ok-note { background: var(--ok-soft); }
.cost-line { margin: 4px 0; }
.banner.fresh { background: var(--accent-soft); }

/* v16: idea photos + search */
.idea.has-ph { padding: 8px 12px 8px 8px; }
.idea-ph { width: 72px; height: 72px; border-radius: 12px; object-fit: cover; flex: none; background: var(--sunk); }
.idea-search { display: flex; gap: 8px; margin: 4px 0 14px; }
.idea-search input { flex: 1; min-width: 0; }

/* v16: list pickers */
.chips.two-rows { display: grid; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: max-content; overflow-x: auto; gap: 8px; padding-bottom: 6px; scrollbar-width: thin; }
.quick-row.four { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.quick-row.four .qbtn { font-size: .74rem; padding: 9px 2px 8px; }
.bb-list { display: flex; flex-direction: column; gap: 6px; }
.bb { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px; }
.bb .ico { font-size: 1.4rem; }
.bb-t, .bb-p { display: flex; flex-direction: column; min-width: 0; }
.bb-t { flex: 1; }
.bb-p { text-align: right; }
.bb small { color: var(--muted); font-size: .78rem; }
nav.tabs.many button .tl { font-size: .66rem; }
nav.tabs.many .ti { font-size: 1.12rem; }
.pin-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 12px; }
/* v16: long-press menu + categories */
.lp-head { display: flex; gap: 12px; align-items: center; margin: 4px 0 14px; }
.lp-head div { display: flex; flex-direction: column; }
.lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 8px; margin-bottom: 14px; }
.lp-btn { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 6px; font-weight: 600; font-size: .8rem; color: var(--ink); }
.lp-btn span { width: 58px; height: 58px; border-radius: 50%; background: var(--sunk); display: grid; place-items: center; font-size: 1.6rem; }
.lp-btn:active span { background: var(--accent-soft); transform: scale(.94); }
.btn.wide { width: 100%; }
.cat-row { display: flex; gap: 6px; align-items: center; }
.cat-row .idea { flex: 1; }
[data-act="item-open"] { -webkit-touch-callout: none; user-select: none; }
/* v16: ＋ add, pin style */
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px 8px; padding: 6px 0 10px; }
.pin-btn { border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; gap: 7px; font-weight: 600; font-size: .82rem; color: var(--ink); text-align: center; }
.pin-btn span { position: relative; width: 66px; height: 66px; border-radius: 22px; background: var(--sunk); display: grid; place-items: center; font-size: 1.9rem; transition: transform .12s; }
.pin-btn:active span { transform: scale(.92); background: var(--accent-soft); }
.pin-btn .badge { position: absolute; top: -4px; right: -4px; }
/* v16: goals */
.aim-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.aim { text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 14px; padding: 9px 10px; display: flex; flex-direction: column; gap: 2px; color: var(--ink); }
.aim small { color: var(--muted); font-size: .74rem; }
.aim[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.gn-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 6px 0 8px; }
.gn-grid div { background: var(--sunk); border-radius: 12px; padding: 8px; text-align: center; display: flex; flex-direction: column; }
.gn-grid b { font-size: 1.1rem; }
.gn-grid small { color: var(--muted); font-size: .74rem; }
.milestones { margin: 4px 0 0 18px; padding: 0; display: grid; gap: 3px; }
.milestones li.done { color: var(--muted); text-decoration: line-through; }
.wt-chart { width: 100%; height: 80px; margin: 6px 0; }
.wt-line { fill: none; stroke: var(--accent); stroke-width: 2.5; stroke-linejoin: round; }
.wt-dot { fill: var(--accent); }
.wt-goal { stroke: var(--muted); stroke-dasharray: 5 5; stroke-width: 1.5; }
.warn-note { background: color-mix(in srgb, #f5b400 22%, var(--surface)); color: var(--ink); }
.rec-list label.check { align-items: flex-start; }
.rec-tools .search { min-width: 0; }
.rec-tools .sortsel { max-width: 38%; }
.rec-tools [data-act="cats-open"] { flex: none; padding: 0 10px; min-height: 42px; font-size: 1.15rem; }
/* v17: kitchen tools, sorting cards, look-alikes, grouped pickers */
.k-tools { margin: 0 0 10px; }
.k-tools .c { font-style: normal; background: var(--accent-soft); color: var(--accent); border-radius: 999px; padding: 0 6px; margin-left: 4px; font-size: .78em; }
.loose-h { margin: 10px 2px 4px; text-transform: uppercase; letter-spacing: .04em; font-size: .72rem; }
.gc-dept { margin: 8px 0 4px; }
.gc-cat { margin: 2px 0 6px; }
.gc-l { display: block; margin: 4px 0 3px; font-size: .75rem; }
.sort-cards { display: grid; gap: 10px; margin: 6px 0 12px; }
.sort-card { border: 1.5px solid var(--line); border-radius: var(--r); padding: 10px; background: var(--surface); transition: border-color .15s, background .15s; }
.sort-card.new { border-style: dashed; border-color: var(--accent); }
.sort-card.loose { background: var(--sunk); }
.sort-card.target .sc-head, .sort-card.over { border-color: var(--accent); background: var(--accent-soft); }
.sc-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; cursor: pointer; border-radius: var(--r-sm); padding: 2px 4px; }
.sc-head .big-ico { font-size: 1.3rem; }
.sc-name { flex: 1; min-width: 0; font-weight: 700; border: 0; border-bottom: 1.5px dashed var(--line); background: transparent; padding: 2px 0; font: inherit; color: var(--ink); }
.sc-here { margin-left: auto; color: var(--accent); font-weight: 700; font-size: .8rem; }
.sort-chip { touch-action: none; user-select: none; }
.sort-chip .dpt { font-size: .7em; opacity: .7; margin-right: 2px; }
.sort-chip.sel { outline: 2px solid var(--accent); background: var(--accent-soft); }
.sort-chip.dragging { opacity: .35; }
.drag-ghost { position: fixed; left: 0; top: 0; z-index: 9999; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); transform-origin: center; }
.sim-cards { display: grid; gap: 10px; }
.sim-card { border: 1.5px solid var(--line); border-radius: var(--r); padding: 12px; background: var(--surface); }
.sim-pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 8px; align-items: center; margin-bottom: 10px; }
.sim-side { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; min-width: 0; }
.sim-side small { overflow-wrap: anywhere; }
.sim-vs { font-size: 1.4rem; color: var(--muted); }
/* receipt check: small cards */
.rev-main { display: flex; gap: 8px; align-items: flex-end; flex-wrap: wrap; margin: 8px 0 4px; }
.rev-main .f { flex: 1 1 120px; }
.rev-main .each { padding-bottom: 10px; color: var(--ok); white-space: nowrap; }
.rev-more { margin-top: 4px; }
.rev-more summary { cursor: pointer; padding: 4px 0; list-style: none; display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.rev-more summary::-webkit-details-marker { display: none; }
.rev-more summary b { color: var(--accent); font-size: .8rem; }
.rev-item.matched { border-color: var(--ok); background: var(--ok-soft); }
.inl { display: flex; gap: 4px; } .inl input { flex: 1; min-width: 0; } .inl select { width: 5em; }
/* recipe: cost maths, nutrition heading */
.cost-line { display: block; text-align: left; margin: 6px 0; }
.cost-tbl { display: grid; gap: 2px; margin: 8px 0; }
.cost-row { display: grid; grid-template-columns: 1fr auto; gap: 0 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cost-row small { grid-column: 1 / -1; }
.nut-h { margin: 10px 0 4px; }
/* spending: tap a kind */
.kind-row summary { list-style: none; cursor: pointer; }
.kind-row summary::-webkit-details-marker { display: none; }
.kind-row[open] summary .muted { transform: rotate(90deg); display: inline-block; }
.kind-body { padding: 4px 4px 10px 10px; border-left: 2px solid var(--accent-soft); margin: 2px 0 8px; }
.kind-it { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; border-bottom: 1px dashed var(--line); }
.kind-tips { margin-top: 8px; font-size: .86rem; background: var(--soon-soft); border-radius: var(--r-sm); padding: 8px 10px; }
/* preferences, receipts, people */
.pref-row, .person { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.pref-row span { flex: 1; }
.pref-form { margin-top: 10px; }
.rcpt summary { display: flex; justify-content: space-between; cursor: pointer; list-style: none; }
.rcpt summary::-webkit-details-marker { display: none; }
.chip.on { display: inline-flex; align-items: center; gap: 4px; }
.chip .x { border: 0; background: transparent; color: var(--muted); padding: 0 2px; cursor: pointer; }
.rc-thumbs.web img { opacity: .92; }
/* v18: nutrition lookup, label check, sugars */
.lk-rows { display: grid; gap: 8px; margin: 6px 0 12px; }
.lk-row { border: 1.5px solid var(--line); border-radius: var(--r); padding: 10px; background: var(--surface); }
.lk-row.on { border-color: var(--ok); }
.lk-top { display: grid; grid-template-columns: auto 44px 1fr auto; gap: 8px; align-items: center; }
.lk-ph { width: 44px; height: 44px; border-radius: var(--r-sm); background: var(--sunk); display: grid; place-items: center; overflow: hidden; font-size: 1.4rem; }
.lk-ph img { width: 100%; height: 100%; object-fit: cover; }
.lk-t { display: flex; flex-direction: column; min-width: 0; } .lk-t small { overflow-wrap: anywhere; }
.lk-alts { margin-top: 8px; }
.lbl-check { border-color: var(--accent); }
.sugar-kind { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 8px; }
.chip.dim { opacity: .6; }
.sugar-card .nbar.sub { margin: 4px 0 10px 10px; padding-left: 10px; border-left: 2px solid var(--line); }
.sugar-card .track { position: relative; }
.sugar-card .ideal { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); opacity: .45; border-radius: 1px; }
.bad-t { color: var(--bad); }
/* v20: friends, feed, profile, challenges */
.signin-card { border-color: var(--accent); background: var(--accent-soft); text-align: left; }
.signin-card ul { margin: 6px 0 10px; padding-left: 18px; }
.soc-gate { text-align: left; }
.av { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 800; }
.av.sm { width: 28px; height: 28px; font-size: .8rem; }
.av.big { width: 72px; height: 72px; font-size: 1.6rem; }
.feed { display: grid; gap: 14px; margin: 8px 0 14px; }
.post { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; }
.post header { display: flex; gap: 10px; align-items: center; margin-bottom: 8px; }
.post header small { display: block; }
.post-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--r-sm); margin: 4px 0 8px; background: var(--sunk); }
.post h3 { margin: 4px 0; }
.post footer { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 10px; }
.kudo { border: 1.5px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; font: inherit; cursor: pointer; }
.kudo.on { background: var(--soon-soft); border-color: var(--soon); }
.cmts { display: grid; gap: 10px; margin: 8px 0 12px; }
.cmt { display: flex; gap: 8px; align-items: flex-start; } .cmt p { margin: 2px 0 0; }
.person { display: flex; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person.big { border: 0; }
.prof-top { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.streaks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 8px 0 12px; }
.streak { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.streak span { font-size: 1.6rem; } .streak b { font-size: 2rem; font-family: var(--display); line-height: 1.1; }
.post-ph-pick { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.post-ph-pick img, .post-ph-pick > span { width: 84px; height: 84px; border-radius: var(--r-sm); object-fit: cover; background: var(--sunk); display: grid; place-items: center; font-size: 1.8rem; }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.who-p { display: inline-flex; gap: 6px; align-items: center; background: var(--sunk); border-radius: 999px; padding: 3px 10px 3px 3px; font-size: .85rem; }
