:root{
  --bg:#F4F6F5; --surface:#FFFFFF; --surface-2:#EAEEEC; --surface-3:#E1E7E4;
  --line:#D5DCD9; --line-soft:#E4EAE8;
  --ink:#16211F; --ink-2:#4E5C59; --ink-3:#7A8783;
  --accent:#0F6E63; --accent-ink:#0B5049; --accent-soft:#D9EBE7; --on-accent:#FFFFFF;
  --good:#2E7D63; --warn:#B37416; --over:#B0453A; --alc:#6B4E8F;
  --m-break:#0F6E63; --m-lunch:#3F8F73; --m-dinner:#7BA98C; --m-snack:#B37416; --m-drink:#6B4E8F;
  --shadow:0 1px 2px rgba(22,33,31,.06), 0 8px 24px -12px rgba(22,33,31,.18);
  --sans:"Instrument Sans",-apple-system,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif;
  --serif:"Newsreader",Georgia,"Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,SFMono-Regular,Menlo,monospace;
  --r:10px; --maxw:600px;
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    --bg:#0E1614; --surface:#16211E; --surface-2:#1E2C29; --surface-3:#263632;
    --line:#2C3D39; --line-soft:#223330;
    --ink:#E8EFED; --ink-2:#A3B3AF; --ink-3:#74847F;
    --accent:#4FBFAE; --accent-ink:#7FD6C8; --accent-soft:#12332E; --on-accent:#08201C;
    --good:#58B98F; --warn:#D9A047; --over:#E0705F; --alc:#A588CF;
    --m-break:#4FBFAE; --m-lunch:#3F9E8C; --m-dinner:#6E8F84; --m-snack:#D9A047; --m-drink:#A588CF;
    --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
  }
}
:root[data-theme="dark"]{
  --bg:#0E1614; --surface:#16211E; --surface-2:#1E2C29; --surface-3:#263632;
  --line:#2C3D39; --line-soft:#223330;
  --ink:#E8EFED; --ink-2:#A3B3AF; --ink-3:#74847F;
  --accent:#4FBFAE; --accent-ink:#7FD6C8; --accent-soft:#12332E; --on-accent:#08201C;
  --good:#58B98F; --warn:#D9A047; --over:#E0705F; --alc:#A588CF;
  --m-break:#4FBFAE; --m-lunch:#3F9E8C; --m-dinner:#6E8F84; --m-snack:#D9A047; --m-drink:#A588CF;
  --shadow:0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.6);
}

*{box-sizing:border-box}
html,body{height:100%}
/* No double-tap-to-zoom. Pinch still works, so zooming stays available. */
html{touch-action:manipulation}
/* Nothing scrolls sideways, so nothing should rubber-band sideways either.
   Without this iOS lets the whole app be dragged left and right and snap back. */
html,body{overscroll-behavior-x:none;overflow-x:hidden}
body{
  background:var(--bg); color:var(--ink); font-family:var(--sans);
  font-size:15px; line-height:1.45; margin:0; overflow:hidden;
  -webkit-text-size-adjust:100%; -webkit-font-smoothing:antialiased;
}
/* Nothing may force the page wider than the screen. */
.grid2>*,.grid3>*,label.field{min-width:0}
input,select,textarea{min-width:0;max-width:100%}
/* iOS zooms the page when a focused control is under 16px, and does not
   zoom back out. This rule used to lose to the more specific
   input[type=text]{font-size:15px} further down — and to every component
   that set its own size — so on a phone every field was 15px and every
   tap into one zoomed the page. !important because the threshold is the
   platform's rule, not a style choice any component gets to override. */
@media (pointer:coarse){
  input,select,textarea{font-size:16px !important}
}
input[type=date],input[type=time]{-webkit-appearance:none;appearance:none;width:100%;
  min-width:0;background-clip:padding-box}
/* Stacked form fields below this width — date pickers never fit two-up. */
@media (max-width:460px){ .grid2--form{grid-template-columns:1fr} }
.review-body,.note,.banner{overflow-wrap:anywhere}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer;background:none;border:none;padding:0}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:4px}
@media (prefers-reduced-motion:reduce){*{animation-duration:.01ms !important;transition-duration:.01ms !important}}

/* ---------- shell ---------- */
/* Fixed-height shell: the topbar and tabbar are flex siblings that never
   move, and only <main> scrolls. Survives being framed, where a
   position:fixed bar can pin to the frame instead of the screen. */
.app{max-width:var(--maxw);margin:0 auto;height:100%;display:flex;flex-direction:column}
.topbar{flex:none;z-index:20;background:var(--bg);border-bottom:1px solid var(--line-soft);
  padding:10px 16px; display:flex;align-items:center;gap:10px;
  padding-top:calc(10px + env(safe-area-inset-top,0px))}
@media (display-mode:standalone),(display-mode:fullscreen){
  .topbar{padding-top:calc(10px + max(env(safe-area-inset-top,0px), 54px))}
}
.brand{font-family:var(--serif);font-weight:500;font-size:17px;letter-spacing:-.01em;margin-right:auto}
.brand span{color:var(--accent)}
.datenav{display:flex;align-items:center;gap:2px}
.datenav button{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;color:var(--ink-2)}
.datenav button:hover{background:var(--surface-2);color:var(--ink)}
.datenav button[disabled]{opacity:.28;cursor:default}
/* Present to the browser so showPicker() has somewhere to anchor, absent to
   the eye. display:none would make the picker refuse to open. */
.jumpdate{position:fixed;left:50%;top:44px;width:1px;height:1px;opacity:0;pointer-events:none;border:0;padding:0}

.datelabel{font-family:var(--mono);font-size:12px;letter-spacing:.02em;color:var(--ink-2);
  min-width:98px;text-align:center;padding:5px 6px;border-radius:8px}
.datelabel.is-today{color:var(--accent);background:var(--accent-soft)}
main{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;overscroll-behavior-x:none;
  -webkit-overflow-scrolling:touch;padding:16px 16px 24px}

/* One quiet line at the foot of every page, below whatever the page holds. */
.sharefoot{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px 8px;
  margin-top:28px;padding-top:14px;border-top:1px solid var(--line-soft);
  font-size:12px;color:var(--ink-3);text-align:center}

/* ---------- tabs ---------- */
.tabbar{flex:none;z-index:30;background:var(--surface);
  border-top:1px solid var(--line);display:flex;
  padding-bottom:env(safe-area-inset-bottom,0px)}
@media (display-mode:standalone),(display-mode:fullscreen){
  .tabbar{padding-bottom:max(env(safe-area-inset-bottom,0px), 20px)}
}
.tabbar-inner{max-width:var(--maxw);margin:0 auto;display:grid;grid-template-columns:repeat(5,1fr);width:100%}
.tab{display:flex;flex-direction:column;align-items:center;gap:3px;padding:9px 4px 8px;color:var(--ink-3);
  font-size:10.5px;font-weight:600;letter-spacing:.03em;text-transform:uppercase;border-top:2px solid transparent;margin-top:-1px}
.tab svg{width:21px;height:21px;stroke:currentColor;fill:none;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.tab[aria-current="page"]{color:var(--accent);border-top-color:var(--accent)}

/* ---------- primitives ---------- */
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:16px}
.card--lift{box-shadow:var(--shadow);border-color:var(--line-soft)}
.stack{display:flex;flex-direction:column;gap:16px}
.row{display:flex;align-items:center;gap:10px}
.eyebrow{font-size:10.5px;font-weight:600;letter-spacing:.1em;text-transform:uppercase;color:var(--ink-3)}
.num{font-family:var(--serif);font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.mono{font-family:var(--mono);font-variant-numeric:tabular-nums}
.muted{color:var(--ink-2)}
.faint{color:var(--ink-3)}
.hint{font-size:11.5px;color:var(--ink-3);margin:-4px 0 0;line-height:1.45}

/* ---------- work in hand ---------- */
/* The card that exists to say: we have your words, and they are on this
   phone. A spinner in a button said neither. */
.jobs{border-color:color-mix(in srgb,var(--accent) 34%,var(--line))}
.job{display:flex;align-items:flex-start;gap:11px}
.job + .job{padding-top:10px;border-top:1px solid var(--line-soft)}
.job-mark{width:20px;height:20px;flex:none;display:grid;place-items:center;color:var(--accent);margin-top:1px}
.job-b{min-width:0;flex:1;display:flex;flex-direction:column;gap:2px}
.job-b b{font-size:13.5px;font-weight:600}
.job-b span{font-size:12.5px;color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.job-b small{font-size:11px;color:var(--ink-3);line-height:1.45}
.job-x{width:26px;height:26px;flex:none;border-radius:7px;color:var(--ink-3);font-size:17px;line-height:1;
  display:grid;place-items:center;background:none;border:none;cursor:pointer}
.job-x:hover{background:var(--surface-2);color:var(--ink-2)}
h2.sec{font-family:var(--serif);font-size:15px;font-weight:500;margin:0}
.pagetitle{font-family:var(--serif);font-size:24px;font-weight:500;letter-spacing:-.01em;margin:2px 0 -4px}
.pagetitle + .pageintro{margin:0 0 2px;font-size:12.5px;line-height:1.5;color:var(--ink-3)}
hr.rule{border:none;border-top:1px solid var(--line-soft);margin:0}

.btn{background:var(--accent);color:var(--on-accent);border-radius:9px;padding:11px 16px;font-weight:600;
  font-size:14.5px;display:inline-flex;align-items:center;justify-content:center;gap:8px;transition:filter .12s;
  border:1px solid transparent}
.btn:hover{filter:brightness(1.08)}
.btn[disabled]{opacity:.5;cursor:default;filter:none}
.btn.btn--ghost{background:transparent;color:var(--accent);border-color:var(--line)}
.btn.btn--quiet{background:var(--surface-2);color:var(--ink);border-color:var(--line)}
.btn.btn--danger{background:var(--surface-2);color:var(--over);border-color:var(--line)}
.btn--full{width:100%}
.btn--sm{padding:7px 12px;font-size:13px;border-radius:8px}

label.field{display:flex;flex-direction:column;gap:5px}
label.field > span{font-size:12px;font-weight:600;color:var(--ink-2)}
input[type=text],input[type=number],input[type=date],input[type=time],select,textarea{
  background:var(--bg);border:1px solid var(--line);border-radius:8px;padding:10px 11px;width:100%;
  color:var(--ink);font-size:15px}
input:focus,select:focus,textarea:focus{border-color:var(--accent);outline:none}
textarea{resize:vertical;min-height:74px;line-height:1.5}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.grid3{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}

.pill{display:inline-flex;align-items:center;gap:5px;font-size:11px;font-weight:600;letter-spacing:.04em;
  text-transform:uppercase;padding:3px 8px;border-radius:999px;background:var(--surface-2);color:var(--ink-2)}
.pill--good{background:color-mix(in srgb,var(--good) 15%,transparent);color:var(--good)}
.pill--warn{background:color-mix(in srgb,var(--warn) 16%,transparent);color:var(--warn)}
.pill--over{background:color-mix(in srgb,var(--over) 15%,transparent);color:var(--over)}
.pill--alc{background:color-mix(in srgb,var(--alc) 16%,transparent);color:var(--alc)}

/* ---------- budget header ---------- */
.budget{display:flex;flex-direction:column;gap:14px}
.budget-top{display:flex;align-items:flex-end;gap:14px}
.budget-big{font-family:var(--serif);font-size:52px;line-height:.92;font-weight:500;font-variant-numeric:tabular-nums;
  letter-spacing:-.03em}
.budget-big.is-over{color:var(--over)}
.budget-cap{display:flex;flex-direction:column;gap:2px;padding-bottom:5px}
.budget-side{margin-left:auto;text-align:right;display:flex;flex-direction:column;gap:2px;padding-bottom:5px}
/* Consumed leads at the left, where the meter starts filling. */
.budget-side--start{margin-left:0;text-align:left}
.budget-end{margin-left:auto;display:flex;align-items:flex-end;gap:10px}

.meter{height:12px;border-radius:999px;background:var(--surface-2);overflow:hidden;display:flex;
  border:1px solid var(--line-soft)}
.meter-seg{height:100%;min-width:0}
.meter-over{background:repeating-linear-gradient(45deg,var(--over),var(--over) 4px,transparent 4px,transparent 8px)}
.legend{display:flex;flex-wrap:wrap;gap:4px 14px}
.legend-item{display:flex;align-items:center;gap:6px;font-size:11.5px;color:var(--ink-2)}
.dot{width:8px;height:8px;border-radius:2px;flex:none}

/* ---------- macro meters ---------- */
.macros{display:grid;grid-template-columns:repeat(2,1fr);gap:14px 18px}
.macro{display:flex;flex-direction:column;gap:5px}
.macro-head{display:flex;align-items:baseline;gap:6px}
.macro-name{font-size:12px;font-weight:600;color:var(--ink-2)}
.macro-val{margin-left:auto;font-family:var(--mono);font-size:12px;color:var(--ink)}
.bar{height:5px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.bar-fill{height:100%;border-radius:999px;background:var(--accent);transition:width .3s ease}
.bar-fill.is-over{background:var(--over)}
.bar-fill.is-alc{background:var(--alc)}

/* ---------- meals ---------- */
.meal{display:flex;flex-direction:column}
.meal-head{display:flex;align-items:center;gap:8px;padding:0 0 8px}
.meal-stripe{width:3px;align-self:stretch;border-radius:2px;flex:none;min-height:16px}
.meal-kcal{margin-left:auto;font-family:var(--mono);font-size:12.5px;color:var(--ink-2)}
.meal-add{width:26px;height:26px;border-radius:7px;display:grid;place-items:center;color:var(--ink-3);
  border:1px dashed var(--line)}
.meal-add:hover{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.meal-list{display:flex;flex-direction:column}
.entry{display:flex;align-items:center;gap:11px;padding:9px 0;border-top:1px solid var(--line-soft);text-align:left;width:100%}
.entry:first-child{border-top:none}
.entry-thumb{width:36px;height:36px;border-radius:7px;object-fit:cover;flex:none;background:var(--surface-2);
  border:1px solid var(--line-soft)}
.entry-thumb--ph{display:grid;place-items:center;color:var(--ink-3);font-size:15px}
.entry-body{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
.entry-name{font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entry-sub{font-family:var(--mono);font-size:10.5px;color:var(--ink-3);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.entry-kcal{font-family:var(--mono);font-size:13px;flex:none;font-variant-numeric:tabular-nums}
.meal-empty{font-size:12.5px;color:var(--ink-3);padding:6px 0 8px;font-style:italic}

/* ---------- micros ---------- */
.micro-grid{display:grid;grid-template-columns:1fr 1fr;gap:11px 20px;margin-top:4px}
.micro{display:flex;flex-direction:column;gap:4px}
.micro-head{display:flex;align-items:baseline;gap:6px;font-size:11.5px}
.micro-name{color:var(--ink-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.micro-pct{margin-left:auto;font-family:var(--mono);font-size:10.5px;color:var(--ink-3)}
.micro .bar{height:4px}
details.panel > summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px;padding:2px 0}
details.panel > summary::-webkit-details-marker{display:none}
.chev{margin-left:auto;color:var(--ink-3);transition:transform .18s}
details.panel[open] .chev{transform:rotate(180deg)}

/* ---------- capture ---------- */
/* One capture action, not a grid of two. The photo library and the manual
   barcode moved inside the camera, where they are one tap away instead of
   a screen away. */
.capmain{display:flex;align-items:center;gap:15px;width:100%;text-align:left;
  background:var(--accent);color:var(--on-accent);border:0;border-radius:var(--r);
  padding:17px 18px;cursor:pointer;box-shadow:var(--shadow);font-family:var(--sans)}
.capmain:disabled{opacity:.55;cursor:default}
.capmain svg{flex:none;width:27px;height:27px;stroke:currentColor;fill:none;
  stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}
.capmain b{display:block;font-size:15.5px;font-weight:600;letter-spacing:-.01em}
.capmain small{display:block;font-size:12px;opacity:.82;margin-top:2px;line-height:1.35}


.analysing{display:flex;align-items:center;gap:12px;padding:14px 16px;background:var(--accent-soft);
  border:1px solid color-mix(in srgb,var(--accent) 30%,transparent);border-radius:var(--r)}
.spin{width:17px;height:17px;border:2px solid color-mix(in srgb,var(--accent) 30%,transparent);
  border-top-color:var(--accent);border-radius:50%;animation:spin .8s linear infinite;flex:none}
@keyframes spin{to{transform:rotate(360deg)}}

.review-img{width:100%;max-height:190px;object-fit:cover;border-radius:8px;border:1px solid var(--line)}
.item-row{display:grid;grid-template-columns:1fr 76px;gap:9px;align-items:center;padding:9px 0;border-top:1px solid var(--line-soft)}
.item-row:first-of-type{border-top:none}
.item-name{font-size:13.5px}
.item-portion{font-family:var(--mono);font-size:10.5px;color:var(--ink-3)}
.item-row input{text-align:right;padding:7px 9px;font-family:var(--mono);font-size:13px}

.note{font-size:12.5px;color:var(--ink-2);line-height:1.5;padding:10px 12px;background:var(--surface-2);
  border-radius:8px;border-left:2px solid var(--accent)}
.err{font-size:13px;color:var(--over);padding:11px 13px;background:color-mix(in srgb,var(--over) 9%,transparent);
  border-radius:8px;border:1px solid color-mix(in srgb,var(--over) 26%,transparent)}
.banner{font-size:12.5px;padding:10px 13px;border-radius:8px;background:color-mix(in srgb,var(--warn) 12%,transparent);
  border:1px solid color-mix(in srgb,var(--warn) 30%,transparent);color:var(--ink);line-height:1.45}

/* ---------- charts ---------- */
.chartwrap{overflow-x:auto;overscroll-behavior-x:contain;-webkit-overflow-scrolling:touch}
svg.chart{display:block;width:100%;height:auto;min-width:280px}
.tick{font-family:var(--mono);font-size:9px;fill:var(--ink-3)}
.axis{stroke:var(--line);stroke-width:1}
.gridline{stroke:var(--line-soft);stroke-width:1}

.kpis{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;background:var(--line);border:1px solid var(--line);
  border-radius:var(--r);overflow:hidden}
.kpi{background:var(--surface);padding:12px 10px;display:flex;flex-direction:column;gap:2px}
.kpi b{font-family:var(--serif);font-size:21px;font-weight:500;font-variant-numeric:tabular-nums;letter-spacing:-.02em}
.kpi span{font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3)}
.kpi small{font-size:10.5px;color:var(--ink-3);font-family:var(--mono)}

/* The fourth figure. Related enough to sit with the other three, passive
   enough not to be one of them — so it runs across rather than beside. */
.kpiset{display:flex;flex-direction:column}
.kpiset .kpis{border-radius:var(--r) var(--r) 0 0}
.kpi-rest{display:flex;flex-wrap:wrap;align-items:baseline;gap:8px;background:var(--surface-2);
  border:1px solid var(--line);border-top:none;border-radius:0 0 var(--r) var(--r);padding:10px 12px}
.kpi-rest span{font-size:10px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--ink-3)}
.kpi-rest b{font-family:var(--serif);font-size:17px;font-weight:500;font-variant-numeric:tabular-nums;
  letter-spacing:-.02em;margin-left:auto}
.kpi-rest small{font-size:10.5px;color:var(--ink-3);font-family:var(--mono)}
.kpi-head{display:flex;align-items:center;gap:6px}
.kpi-head .infodot{margin-left:auto;text-transform:none;letter-spacing:0}
.kpiset > .infobody{margin-top:8px}

.review-body{font-size:14px;line-height:1.62;white-space:pre-wrap}
.review-body strong{font-weight:600}

.emptystate{text-align:center;padding:30px 16px;display:flex;flex-direction:column;align-items:center;gap:9px}
.emptystate h3{font-family:var(--serif);font-size:17px;font-weight:500;margin:0}
.emptystate p{font-size:13.5px;color:var(--ink-2);margin:0;max-width:34ch;line-height:1.5}

.wlog{display:flex;flex-direction:column}
.wrow{display:flex;align-items:center;gap:10px;padding:8px 0;border-top:1px solid var(--line-soft);font-size:13.5px}
.wrow:first-child{border-top:none}
.del{color:var(--ink-3);padding:4px;border-radius:6px;flex:none;display:grid;place-items:center}
.del:hover{color:var(--over);background:color-mix(in srgb,var(--over) 10%,transparent)}
.del svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round}

.sheet{position:fixed;inset:0;z-index:60;background:color-mix(in srgb,var(--ink) 45%,transparent);
  display:flex;align-items:flex-end;justify-content:center;padding:0}
.sheet-inner{overscroll-behavior:contain;background:var(--surface);width:100%;max-width:var(--maxw);border-radius:16px 16px 0 0;
  padding:20px 16px calc(20px + env(safe-area-inset-bottom,0px));display:flex;flex-direction:column;gap:14px;
  max-height:88vh;overflow-y:auto;border-top:1px solid var(--line)}

/* ---------- token gate ---------- */
.gate{position:fixed;inset:0;display:grid;place-items:center;padding:24px;background:var(--bg);z-index:100}
.gate-card{width:100%;max-width:340px;display:flex;flex-direction:column;gap:14px;
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:22px;box-shadow:var(--shadow)}
.gate-brand{font-family:var(--serif);font-weight:500;font-size:21px;letter-spacing:-.01em}
.gate-brand span{color:var(--accent)}
.gate-card p{margin:0;font-size:13.5px;color:var(--ink-2);line-height:1.5}

/* ---------- portion multiplier ---------- */
.fieldlabel{font-size:12px;font-weight:600;color:var(--ink-2);display:block;margin-bottom:5px}
/* One line, however narrow: the chips share the width and the custom box
   takes a little more, rather than "other" dropping to a second row. */
.qty{display:flex;gap:6px;flex-wrap:nowrap;align-items:center}
.qty-chip{flex:1 1 0;min-width:0;padding:8px 0;text-align:center;border-radius:8px;border:1px solid var(--line);background:var(--surface-2);
  font-family:var(--mono);font-size:13.5px;font-weight:500;color:var(--ink);transition:background .12s,color .12s}
.qty-chip[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
.qty .qty-custom{flex:1.4 1 0;width:auto;min-width:0;text-align:center;font-family:var(--mono);font-size:13.5px;padding:8px 4px}

/* ---------- editable entry title + correction ---------- */
/* Reads as the title, not a form field, until it is touched. The input
   form of it has to out-rank input[type=text], which otherwise gave it a
   box and a fill — and with the negative margin that box stuck out past
   the card's edge, out of line with everything under it. */
.titleinput,input.titleinput[type=text]{font-family:var(--serif);font-size:17px;font-weight:500;letter-spacing:-.01em;
  background:transparent;border:1px solid transparent;border-radius:8px;padding:5px 8px;
  margin:-5px -8px;flex:1;min-width:0;color:var(--ink);width:auto}
/* 17px is above the size at which iOS zooms, so the title keeps its size. */
input.titleinput[type=text]{font-size:17px !important}
.titleinput:hover,input.titleinput[type=text]:hover{border-color:var(--line-soft);background:var(--surface-2)}
.titleinput:focus,input.titleinput[type=text]:focus{border-color:var(--accent);background:var(--bg);outline:none}
details.correction > summary{padding:8px 0 0}
details.correction .eyebrow{color:var(--accent)}

/* ---------- progressive refinement ---------- */
.item-block{border-top:1px solid var(--line-soft);padding:4px 0 10px}
.item-block:first-child{border-top:none}
.item-block .item-row{border-top:none}
.refine{display:flex;flex-wrap:wrap;gap:6px;padding:2px 0 0}
.chip{display:inline-flex;align-items:center;gap:6px;background:var(--surface-2);border:1px solid var(--line);
  border-radius:999px;padding:4px 4px 4px 11px;position:relative;max-width:100%}
.chip-k{font-size:10.5px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--ink-3);
  white-space:nowrap;flex:none}
.chip-s{appearance:none;-webkit-appearance:none;background:transparent;border:none;padding:2px 20px 2px 0;
  font-size:13px;font-weight:500;color:var(--ink);max-width:150px;text-overflow:ellipsis;
  border-radius:999px;cursor:pointer}
.chip-s:focus{outline:none}
.chip:focus-within{border-color:var(--accent);background:var(--accent-soft)}
.chip::after{content:"";position:absolute;right:11px;top:50%;width:6px;height:6px;pointer-events:none;
  border-right:1.6px solid var(--ink-3);border-bottom:1.6px solid var(--ink-3);
  transform:translateY(-70%) rotate(45deg)}
.qty{align-items:center}

/* ---------- NOVA ---------- */
.novaline{display:flex;align-items:center;gap:7px;font-size:11.5px;color:var(--ink-2);padding:2px 0 6px}
.novadot{width:7px;height:7px;border-radius:2px;flex:none}

/* ---------- barcode scanner ---------- */
.scan{position:fixed;inset:0;z-index:90;background:#000;display:flex;align-items:center;justify-content:center}
.scan video{width:100%;height:100%;object-fit:cover}
.scan-frame{position:absolute;left:10%;right:10%;top:38%;height:22%;border:2px solid rgba(255,255,255,.85);
  border-radius:12px;box-shadow:0 0 0 100vmax rgba(0,0,0,.45)}
.scan-bar{position:absolute;left:0;right:0;bottom:0;display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  justify-content:center;padding:18px 16px calc(24px + env(safe-area-inset-bottom,0px));
  background:linear-gradient(transparent,rgba(0,0,0,.75) 40%)}
.scan-line{position:absolute;left:6%;right:6%;top:50%;height:2px;background:var(--accent);
  box-shadow:0 0 12px var(--accent);animation:sweep 1.9s ease-in-out infinite}
@keyframes sweep{0%,100%{transform:translateY(-46px)}50%{transform:translateY(46px)}}
@media (prefers-reduced-motion:reduce){.scan-line{animation:none}}
.linkish{color:var(--accent);font-size:12px;font-weight:600;text-decoration:underline;
  text-underline-offset:2px;padding:0}

/* ---------- camera ---------- */
.scan-hint{position:absolute;left:0;right:0;top:calc(18% - 42px);text-align:center;color:#fff;
  font-size:14px;font-weight:600;text-shadow:0 1px 6px rgba(0,0,0,.7);padding:0 24px}

/* The other two ways in, without closing the camera first. */
.scan-alt{position:absolute;left:0;right:0;bottom:calc(112px + env(safe-area-inset-bottom,0px));
  display:flex;justify-content:center;gap:9px;padding:0 18px}
.scan-alt-b{background:rgba(0,0,0,.42);border:1px solid rgba(255,255,255,.3);color:#fff;
  border-radius:999px;padding:8px 15px;font-size:12.5px;font-weight:600;
  font-family:var(--sans);cursor:pointer;backdrop-filter:blur(6px)}
.scan-alt-b:hover{background:rgba(0,0,0,.6)}
.scan-bar{justify-content:center;gap:0}
.scan-x{position:absolute;left:22px;color:#fff;font-size:22px;width:44px;height:44px;border-radius:50%;
  background:rgba(255,255,255,.16)}
.shutter{width:72px;height:72px;border-radius:50%;background:transparent;border:4px solid #fff;
  display:grid;place-items:center;padding:0}
.shutter span{width:56px;height:56px;border-radius:50%;background:#fff;display:block;transition:transform .1s}
.shutter:active span{transform:scale(.86)}
.scan.hit .scan-frame{border-color:var(--accent);box-shadow:0 0 0 100vmax rgba(15,110,99,.35)}

/* ---------- entry detail sheet ---------- */
.sheet-inner{gap:0}
.sh-head{display:flex;align-items:flex-start;gap:12px;padding-bottom:14px}
.sh-title{min-width:0;flex:1}
.sh-title h2{font-family:var(--serif);font-size:17px;font-weight:500;margin:0 0 2px;letter-spacing:-.01em}
.sh-meta{font-family:var(--mono);font-size:11px;color:var(--ink-3)}
.sh-sec{border-top:1px solid var(--line-soft);padding:14px 0}
.sh-sec:last-of-type{padding-bottom:4px}
.sh-kcal{display:flex;align-items:baseline;gap:8px;margin-bottom:12px}
.sh-kcal b{font-family:var(--serif);font-size:34px;font-weight:500;letter-spacing:-.02em;
  font-variant-numeric:tabular-nums;line-height:1}
.sh-kcal span{font-family:var(--mono);font-size:12px;color:var(--ink-3)}
.sh-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:10px 8px}
.sh-cell{display:flex;flex-direction:column;gap:1px;min-width:0}
.sh-cell b{font-family:var(--mono);font-size:14px;font-variant-numeric:tabular-nums}
.sh-cell span{font-size:10px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3)}
.sh-badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
.badge{display:inline-flex;align-items:center;gap:6px;font-size:11.5px;font-weight:600;
  padding:5px 10px;border-radius:999px;background:var(--surface-2);border:1px solid var(--line);color:var(--ink-2)}
.badge i{width:7px;height:7px;border-radius:2px;font-style:normal;flex:none}
.sh-parts{display:flex;flex-direction:column;gap:0}
.sh-part{display:flex;align-items:baseline;gap:10px;padding:7px 0;border-top:1px solid var(--line-soft);font-size:13.5px}
.sh-part:first-child{border-top:none}
.sh-part em{font-style:normal;font-family:var(--mono);font-size:10.5px;color:var(--ink-3)}
.sh-part b{margin-left:auto;font-family:var(--mono);font-size:13px;font-weight:500;flex:none}
.sh-partbtn{flex:none;font-size:11.5px}
.sh-aside{margin-top:12px;padding-top:10px;border-top:1px dashed var(--line-soft)}
.sh-aside-head{font-size:11.5px;color:var(--ink-3);margin-bottom:2px}
.sh-aside .sh-part{border-top:none;color:var(--ink-3)}
.sh-actions{display:flex;flex-direction:column;gap:9px;padding-top:16px;border-top:1px solid var(--line-soft);margin-top:4px}
.sh-del{font-size:13px;color:var(--over);text-align:center;padding:9px;border-radius:8px;font-weight:500}
.sh-del:hover{color:var(--over);background:color-mix(in srgb,var(--over) 8%,transparent)}
.sh-confirm{display:flex;flex-direction:column;gap:9px;padding:13px;border-radius:9px;
  background:color-mix(in srgb,var(--over) 8%,transparent);
  border:1px solid color-mix(in srgb,var(--over) 28%,transparent)}
.sh-confirm p{margin:0;font-size:13.5px;color:var(--ink);line-height:1.45}
.sh-confirm .row{gap:9px}
.sh-confirm .btn{flex:1}
.btn.btn--del{background:var(--over);color:#fff;border-color:var(--over)}

/* ---------- provenance ---------- */
.pv{display:flex;flex-direction:column}
.pv-row{display:flex;align-items:baseline;gap:14px;padding:7px 0;border-top:1px solid var(--line-soft);font-size:13.5px}
.pv-row:first-child{border-top:none}
.pv-k{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);
  flex:none;width:104px}
.pv-v{min-width:0;font-weight:500}
details.sh-sec > summary{list-style:none;cursor:pointer;display:flex;align-items:center;gap:8px}
details.sh-sec > summary::-webkit-details-marker{display:none}
.entry--pending{opacity:.75}
.entry--pending .entry-name{font-style:italic;color:var(--ink-2)}
.entry--failed .entry-name{color:var(--over)}
.entry--failed .entry-thumb--ph{color:var(--over)}

/* ---------- week strip ---------- */
.wk{display:flex;align-items:flex-end;gap:0;height:56px}
.wk-day{display:flex;flex-direction:column;align-items:center;gap:5px;height:100%}
.wk-col{flex:1;width:60%;display:flex;align-items:flex-end;background:var(--surface-2);border-radius:3px;overflow:hidden}
.wk-bar{width:100%;border-radius:3px;min-height:2px}
.wk-full{background:var(--accent)}
.wk-part{background:repeating-linear-gradient(-45deg,var(--accent),var(--accent) 3px,transparent 3px,transparent 6px)}
.wk-missing{background:var(--line)}
.wk-future{background:transparent}
.wk-day span{font-family:var(--mono);font-size:9.5px;color:var(--ink-3)}
.call-derived{background:var(--accent-soft);border:1px solid color-mix(in srgb,var(--accent) 28%,transparent);
  border-radius:var(--r);padding:15px 16px}

/* ---------- your usual ---------- */
.usuals{display:flex;flex-direction:column}
.usual{display:flex;align-items:center;gap:11px;padding:9px 0;border-top:1px solid var(--line-soft);
  text-align:left;width:100%}
.usual:first-child{border-top:none}
.usual img,.usual-ph{width:36px;height:36px;border-radius:7px;object-fit:cover;flex:none;
  background:var(--surface-2);border:1px solid var(--line-soft);display:grid;place-items:center;color:var(--ink-3)}
/* Big enough to read as the thing it is, not as decoration. */
.usual-ph--emoji{font-size:19px;line-height:1}
.usual-b{min-width:0;flex:1;display:flex;flex-direction:column;gap:1px}
.usual-b b{font-size:14px;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.usual-b span{font-family:var(--mono);font-size:10.5px;color:var(--ink-3)}
.usual-add{width:28px;height:28px;border-radius:8px;display:grid;place-items:center;flex:none;
  background:var(--accent-soft);color:var(--accent);font-size:18px;font-weight:600;line-height:1}
.usual:hover .usual-add{background:var(--accent);color:var(--on-accent)}
.pv-note{font-size:11.5px;color:var(--ink-3);line-height:1.5;margin:10px 0 0;
  padding:9px 11px;background:var(--surface-2);border-radius:7px}

/* ---------- guardrails ---------- */
/* The target is set from day one; this says where it came from and when a
   better one arrives. Sits quietly under the budget meter — a statement
   about what happens next, not a warning about the number above it. */
/* Named .refine once, which collided with the chip row of the same class
   and gave every chip container a border and 11.5px type. */
.targetnote{margin:10px 0 0;padding-top:10px;border-top:1px solid var(--line-soft);
  font-size:11.5px;line-height:1.5;color:var(--ink-3);
  display:flex;flex-wrap:wrap;align-items:center;gap:7px}
.targetnote .infobody{flex:1 0 100%;margin-top:2px}
.targetnote b{color:var(--ink-2);font-weight:600}

/* ---------- info affordance ---------- */
/* An explanation worth reading once. The icon is quiet enough to ignore and
   large enough to hit. */
.infodot{width:18px;height:18px;flex:0 0 18px;border-radius:999px;border:1px solid var(--line);
  background:var(--surface-2);color:var(--ink-3);font-family:var(--serif);font-size:11px;
  font-style:italic;font-weight:600;line-height:1;display:inline-grid;place-items:center;
  cursor:pointer;padding:0;vertical-align:middle}
.infodot:hover{color:var(--ink-2);border-color:var(--ink-3)}
.infodot[aria-expanded="true"]{background:var(--ink);color:var(--bg);border-color:var(--ink)}
.infobody{margin-top:9px;font-size:11.5px;line-height:1.55;color:var(--ink-2);
  background:var(--surface-2);border-radius:8px;padding:10px 12px}
/* A write that has not reached the server yet. Deliberately quiet and
   deliberately reassuring — the change is already safe on the device. */
.syncpill{position:fixed;left:50%;transform:translateX(-50%);
  bottom:calc(80px + env(safe-area-inset-bottom,0px));
  background:var(--surface-2);color:var(--ink-2);border:1px solid var(--line);
  padding:7px 14px;border-radius:999px;font-size:12px;font-weight:500;
  z-index:70;max-width:80vw;text-align:center;box-shadow:var(--shadow)}

/* ---------- access code + data controls ---------- */

/* A code someone has been sent and is pasting in. They should be able to
   read it back — a hidden field plus a typo is a dead end. */
.gate-row{display:flex;gap:6px;align-items:stretch}
.gate-row input{flex:1;min-width:0}
.gate-reveal{flex:none;padding:0 11px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface-2);color:var(--ink-2);font-size:12px;font-weight:600;cursor:pointer}
.gate-reveal:hover{color:var(--ink)}
.gate-note{font-size:11.5px!important;line-height:1.5!important;color:var(--ink-3)!important;
  padding-top:12px;border-top:1px solid var(--line-soft)}

/* Inside a button that is working. */
.spin--btn{width:13px;height:13px;border-width:2px;display:inline-block;
  vertical-align:-2px;margin-right:7px}

.linkish--del{color:var(--over)}

.erase{display:flex;flex-direction:column;gap:11px;padding:13px 14px;border-radius:9px;
  background:color-mix(in srgb,var(--over) 8%,transparent);
  border:1px solid color-mix(in srgb,var(--over) 28%,transparent)}
.erase p{margin:0;font-size:12.5px;line-height:1.5;color:var(--ink-2)}
.erase input{text-transform:uppercase}

/* Long windows pack the bars in tightly. The label must not be clipped by
   its own column — it is allowed to sit over the gap either side, because
   only a few columns carry one. */
.wk-day span{white-space:nowrap;overflow:visible}

/* ---------- recounting a day ---------- */

/* Which day is being described. Two shortcuts plus a date field, because
   "yesterday" is the overwhelming case and last Tuesday still has to be
   reachable without eight taps of an arrow. */
.daypick{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.daypick .is-on{border-color:var(--accent);color:var(--accent)}
.daypick-date{flex:1;min-width:118px;font-family:var(--mono);font-size:12px;
  padding:6px 9px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);color:var(--ink)}

/* One proposed entry: a tick to keep it, what it was read as, and what the
   person actually said. The pairing is the point — it is what tells them
   whether the number is worth correcting. */
.recrow{display:flex;align-items:flex-start;gap:11px}
.recrow.is-off{opacity:.42}
.reccheck{flex:none;width:22px;height:22px;margin-top:1px;border-radius:6px;
  border:1.5px solid var(--line);background:var(--surface);cursor:pointer;
  font-size:12px;font-weight:600;color:#fff;line-height:1;
  display:grid;place-items:center;padding:0}
.recrow:not(.is-off) .reccheck{background:var(--accent);border-color:var(--accent)}
/* The tap target reaches 44px without the box growing. */
.reccheck::after{content:"";position:absolute;inset:-11px}
.reccheck{position:relative}
.recbody{flex:1;min-width:0}
.recname{font-size:13.5px;font-weight:600;line-height:1.35}
.recname .faint{font-weight:400}
.recsaid{font-family:var(--serif);font-style:italic;font-size:12.5px;color:var(--ink-3);
  line-height:1.4;margin-top:2px}
.recbody .refine{margin-top:8px}
/* The figure, editable, and narrow enough to leave the name and its chips
   the room they need. An unconstrained number input takes about 170px and
   crushed everything to its left. */
.reckcal{flex:none;width:76px;font-family:var(--mono);font-size:13px;text-align:right;line-height:1.3}
.reckcal input{width:100%;font-family:var(--mono);font-size:13px;text-align:right;
  padding:6px 8px;border:1px solid var(--line);border-radius:8px;
  background:var(--surface);color:var(--ink)}
.reckcal input:disabled{background:var(--surface-2);color:var(--ink-3)}
.reckcal small{display:block;font-size:10.5px;color:var(--alc);margin-top:3px}

/* Where a figure came from, in the diary. Quiet, but there every time. */
.entry-thumb--rec{font-family:var(--serif);font-size:15px;color:var(--ink-3);
  letter-spacing:-1px}
.pill--recalled{background:var(--surface-2);color:var(--ink-2);border:1px solid var(--line)}

.asmp{margin:0;padding-left:17px;display:flex;flex-direction:column;gap:5px}
.asmp li{font-size:12.5px;line-height:1.45;color:var(--ink-2)}

/* A one-tap repeat, sitting where the meal would have been. Deliberately
   quieter than a logged entry — it is an offer, not a record. */
.mealusual{display:flex;align-items:center;gap:11px;width:100%;text-align:left;
  background:transparent;border:1px dashed var(--line);border-radius:10px;
  padding:9px 11px;cursor:pointer;font-family:var(--sans);color:var(--ink)}
.mealusual:hover{border-color:var(--accent);border-style:solid;background:var(--accent-soft)}
.mealusual + .mealusual{margin-top:7px}
.mealusual-add{flex:none;width:22px;height:22px;border-radius:50%;background:var(--accent);
  color:var(--on-accent);display:grid;place-items:center;font-size:15px;font-weight:600;line-height:1}
.mealusual-b{min-width:0;flex:1}
.mealusual-b b{display:block;font-size:13.5px;font-weight:600;line-height:1.3;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mealusual-b span{display:block;font-size:11px;color:var(--ink-3);margin-top:1px}

/* Hold to move — the menu behind a long press on an entry or a meal name.
   Selection and the iOS callout have to be off, or a press long enough to
   mean something is a press long enough to start selecting the text. */
.entry,.meal-head[data-mealmenu]{-webkit-touch-callout:none;-webkit-user-select:none;user-select:none}
.menu-list{display:flex;flex-direction:column;gap:8px}
.menu-btn{display:flex;align-items:center;gap:10px;width:100%;text-align:left;padding:13px 14px;
  border-radius:10px;background:var(--surface-2);border:1px solid var(--line);
  font-size:14px;font-weight:500;color:var(--ink)}
.menu-btn:hover{border-color:var(--accent);color:var(--accent)}
.menu-btn small{margin-left:auto;font-family:var(--mono);font-size:11px;color:var(--ink-3);font-weight:400}
.menu-btn--danger{color:var(--over)}
.menu-btn--danger:hover{border-color:var(--over);color:var(--over)}
.menu-pick{display:flex;gap:8px;align-items:center;margin-top:10px}
/* A class that sets display outranks the browser's own [hidden] rule, so
   say it once here rather than per component. */
[hidden]{display:none!important}
.menu-pick input{flex:1;min-width:0;font-family:var(--mono);font-size:13px;padding:10px 12px;
  border:1px solid var(--line);border-radius:9px;background:var(--surface);color:var(--ink)}
.holdhint{font-size:11.5px;color:var(--ink-3);margin:2px 0 0;line-height:1.5;text-align:center}

/* A correction that costs a call, while it is still costing it. */
.refine-busy{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--ink-3);margin:8px 0 2px}
/* ---------- summary ---------- */
/* The day's number, small enough to sit above everything, and a way into
   the full card on Diary. A button, because the whole thing goes there. */
.sumhead{display:flex;flex-direction:column;gap:9px;width:100%;text-align:left;color:var(--ink);
  background:var(--surface);cursor:pointer}
.sumhead-go{margin-left:auto;font-size:12px;font-weight:600;color:var(--accent)}
.sumhead-big{font-size:34px;font-weight:600;line-height:1}
.sumhead-big.is-over{color:var(--over)}
.sumhead .meter{height:8px}
/* Four ranges, one tap each. A segmented control rather than a select,
   because the choice is small and seeing all four is the point. */
.rangepick{display:grid;grid-template-columns:repeat(4,1fr);gap:3px;padding:3px;border-radius:10px;
  background:var(--surface-2);border:1px solid var(--line)}
.rangepick button{padding:8px 4px;border-radius:7px;font-size:12.5px;font-weight:600;color:var(--ink-2);
  white-space:nowrap;min-width:0}
.rangepick button[aria-pressed="true"]{background:var(--surface);color:var(--accent);
  box-shadow:0 1px 2px rgba(22,33,31,.1)}
/* ---------- diary ---------- */
/* ---------- add ---------- */
.capgrid{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.capgrid .capmain{flex-direction:column;align-items:flex-start;gap:10px;padding:16px}
.capmain--alt{background:var(--surface);color:var(--ink);border:1px solid var(--line)}
.capmain--alt svg{color:var(--accent)}
.capmain--alt small{color:var(--ink-3);opacity:1}
.lk-row{display:grid;grid-template-columns:minmax(0,1fr) 84px;gap:8px}
.lk-results{margin-top:2px}
.lk-head{font-size:10.5px;font-weight:600;letter-spacing:.08em;text-transform:uppercase;color:var(--ink-3);
  padding:10px 0 2px}
.lk-results .lk-head:first-child{padding-top:2px}
.lk-results .lk-head + .usual{border-top:none}
.lk-note{display:flex;align-items:center;font-size:12px;color:var(--ink-3);padding:8px 0 2px}
/* ---------- pages opened from a tab ---------- */
.backlink{align-self:flex-start;font-size:13px;font-weight:600;color:var(--accent);padding:2px 0;margin-bottom:-6px}
.about-p{margin:0;font-size:13px;line-height:1.55;color:var(--ink-2)}
.about-p a{color:var(--accent);font-weight:600}
/* ---------- read-only cards on You ---------- */
.rd{display:flex;flex-direction:column}
.rd-row{display:flex;align-items:baseline;gap:12px;padding:7px 0;border-top:1px solid var(--line-soft);font-size:13.5px}
.rd-row:first-child{border-top:none}
.rd-row span{color:var(--ink-2)}
.rd-row b{margin-left:auto;font-weight:600;text-align:right;font-variant-numeric:tabular-nums}
.rd-row b .faint{font-weight:400;font-size:11.5px}
.rd-line{margin:0;font-size:13.5px;color:var(--ink-2)}
/* A preference that is either on or off, with the reason beside it. */
.toggle{display:flex;align-items:flex-start;gap:11px;cursor:pointer}
.toggle input{flex:none;width:20px;height:20px;margin:1px 0 0;accent-color:var(--accent)}
.toggle span{display:flex;flex-direction:column;gap:2px;min-width:0}
.toggle b{font-size:14px;font-weight:600}
.toggle small{font-size:12px;color:var(--ink-3);line-height:1.45}
.switchrow{display:flex;align-items:center;justify-content:space-between;gap:12px}
.switchrow label{cursor:pointer}
.switch{appearance:none;-webkit-appearance:none;flex:none;position:relative;width:44px;height:26px;margin:0;border-radius:13px;background:var(--surface-3);border:1px solid var(--line);cursor:pointer;transition:background .15s,border-color .15s}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.25);transition:transform .15s}
.switch:checked{background:var(--accent);border-color:var(--accent)}
.switch:checked::after{transform:translateX(18px);background:var(--on-accent)}
@media (prefers-reduced-motion:reduce){.switch,.switch::after{transition:none}}
/* Before there is anything to show. Quiet, and where the content will be. */
.booting{display:flex;align-items:center;justify-content:center;gap:10px;padding:64px 0;
  font-size:13px;color:var(--ink-3)}
/* Where an item's figures came from. Quiet; the point is that it is there. */
.basis{font-size:11px;color:var(--ink-3);padding:1px 0 4px;line-height:1.4}
.basis--cofid::before,.basis--off::before,.basis--history::before{content:"\2713\00a0";color:var(--good)}
.sh-basis{display:block;font-size:10.5px;color:var(--ink-3);margin-top:1px}
/* ---------- tally ---------- */
/* Big targets, three across, for a thumb in a dark room. */
.tally{display:grid;grid-template-columns:repeat(3,1fr);gap:10px}
.tile{position:relative;aspect-ratio:1/1;display:flex;flex-direction:column;align-items:center;justify-content:center;
  gap:3px;padding:10px 6px;border-radius:14px;background:var(--surface);border:1px solid var(--line);
  box-shadow:var(--shadow);color:var(--ink);text-align:center;min-width:0;
  -webkit-touch-callout:none;-webkit-user-select:none;user-select:none;transition:transform .08s}
.tile:active{transform:scale(.96)}
.tile-e{font-size:34px;line-height:1.05}
.tile-l{font-size:13px;font-weight:600;line-height:1.2;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tile-s{font-family:var(--mono);font-size:10px;color:var(--ink-3);white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.tile-n{position:absolute;top:7px;right:7px;min-width:22px;height:22px;padding:0 6px;border-radius:999px;
  background:var(--accent);color:var(--on-accent);font-family:var(--mono);font-size:12px;font-weight:600;
  display:grid;place-items:center}
.tile--smoke .tile-n{background:var(--ink-2)}
.tile--empty{background:transparent;border-style:dashed;box-shadow:none;color:var(--ink-3)}
.tile--empty .tile-e{font-size:26px;color:var(--ink-3)}
.tally.is-editing .tile:not(.tile--empty){border-color:var(--accent);border-style:dashed}
@keyframes tilehit{0%{box-shadow:0 0 0 0 color-mix(in srgb,var(--accent) 55%,transparent)}100%{box-shadow:0 0 0 14px transparent}}
.tile.is-hit{animation:tilehit .45s ease-out}
@media (prefers-reduced-motion:reduce){.tile.is-hit{animation:none}}
/* Five tabs at phone width: the labels have less room than they did. */
@media (max-width:360px){ .tab{font-size:9.5px;letter-spacing:.01em} .tile-s{font-size:9px} .tile-e{font-size:30px} }
.lk-row--solo{grid-template-columns:minmax(0,1fr)}
.lk-ask{margin-top:8px}
.sh-portion{margin-top:14px}
/* Edit mode: the tile's face opens it, the arrows move it. */
.tile--edit{padding:0;overflow:hidden}
.tile--edit:active{transform:none}
.tile-main{flex:1;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  padding:8px 6px 0;color:inherit;min-width:0}
.tile-move{display:flex;width:100%;border-top:1px solid var(--line-soft)}
.tile-move button{flex:1;padding:6px 0;font-size:17px;line-height:1;color:var(--accent);font-weight:600}
.tile-move button + button{border-left:1px solid var(--line-soft)}
.tile-move button:disabled{color:var(--line);cursor:default}
.pv-ingr{margin-top:10px;font-size:12.5px}
.pv-ingr summary{cursor:pointer;color:var(--accent);font-weight:600;font-size:12px}
.pv-ingr p{margin:6px 0 0;color:var(--ink-2);line-height:1.5}
.tile-s--alc{color:var(--alc)}
/* ---------- admin ---------- */
.adm-bars{display:flex;align-items:flex-end;gap:2px;height:70px}
.adm-bars span{flex:1;background:var(--accent);border-radius:2px 2px 0 0;min-width:2px}
.adm-err{padding:7px 0;border-top:1px solid var(--line-soft);font-size:12.5px}
.adm-err:first-of-type{border-top:none}
.adm-err b{font-weight:600;overflow-wrap:anywhere}
.adm-err .mono{font-size:10.5px;margin-top:2px}
/* ---------- sign-in and onboarding ---------- */
/* The card can outgrow a short phone once onboarding's forms are on it. */
.gate{overflow-y:auto;align-items:start;padding-top:max(24px, env(safe-area-inset-top, 0px))}
@media (min-height:700px){ .gate{align-items:center} }
.gate-h{font-family:var(--serif);font-size:20px;font-weight:500;margin:0;letter-spacing:-.01em}
.codeinput{font-family:var(--mono);font-size:26px !important;letter-spacing:.5em;text-align:center;padding:12px 8px}
.ob-dots{display:flex;gap:6px;justify-content:center}
.ob-dots i{width:7px;height:7px;border-radius:50%;background:var(--line)}
.ob-dots i.on{background:var(--accent)}
.ob-target{margin:0;font-size:13.5px;font-weight:600;color:var(--accent)}

/* How much of an item the estimate assumed — editable, and it carries the rest. */
.amt{display:inline-flex;align-items:center;gap:4px;margin-top:5px;font-family:var(--mono);font-size:11px;color:var(--ink-3)}
.amt input{width:64px;padding:4px 6px;border:1px solid var(--line);border-radius:6px;background:var(--surface);color:var(--ink);font:inherit;font-size:13px;text-align:right}
.amt input:focus{outline:2px solid var(--accent);outline-offset:1px;border-color:transparent}
.amt input::-webkit-inner-spin-button,.amt input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
.amt input{-moz-appearance:textfield;appearance:textfield}

/* Where the figures came from, in words (BRAND.md §6). Quiet, and never a grade. */
.srcnote{font-size:12px;color:var(--ink-3)}

/* Feedback: three kinds of note, one line, in the interface type rather
   than the figures' mono. */
.fb-kinds{display:flex;gap:6px}
.fb-kind{flex:1 1 0;min-width:0;padding:9px 6px;border-radius:8px;border:1px solid var(--line);background:var(--surface-2);
  font-family:var(--sans);font-size:13.5px;font-weight:500;color:var(--ink);white-space:nowrap;
  transition:background .12s,color .12s}
.fb-kind[aria-pressed="true"]{background:var(--accent);color:var(--on-accent);border-color:var(--accent)}
#fbText{font-family:var(--sans)}

/* Swaps (UX-PLAN.md 5.4) and Your diet (5.7) */
.swap-head{font-family:var(--serif, inherit);font-size:18px;line-height:1.3;margin:0;color:var(--ink)}
/* The swap recommendation is called out in green so it is not scrolled past. */
.swapcard{background:var(--accent-soft);border-color:color-mix(in srgb, var(--accent) 40%, transparent)}
.swap-eyebrow{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.08em;
  text-transform:uppercase;color:var(--accent-ink)}
.swap-eyebrow svg,.swap-actions svg,.swap-trying svg{width:16px;height:16px;fill:none;stroke:currentColor;
  stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}
.swap-body{font-size:13.5px;line-height:1.45;margin:0;color:var(--ink-2)}
.swap-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:6px}
.swap-actions .btn{display:inline-flex;align-items:center;justify-content:center;gap:7px}
.swapcard .btn--ghost{background:var(--surface)}
.swap-hint{font-size:11.5px;line-height:1.4;margin:0;color:var(--ink-2)}
.swap-trying{display:flex;align-items:center;gap:10px;margin-top:6px;font-size:12.5px;line-height:1.4;color:var(--ink-2)}
.swap-trying svg{color:var(--accent);width:20px;height:20px}
.swap-trying .btn{margin-left:auto;flex:none}
.checkgrid{display:grid;grid-template-columns:1fr 1fr;gap:8px 12px}
.radiolist{display:grid;gap:8px}
.check{display:flex;gap:8px;align-items:center;font-size:13.5px;color:var(--ink-2);cursor:pointer}
.check input{width:18px;height:18px;margin:0;accent-color:var(--accent);flex:none}
.fieldhead{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--ink-3);margin-top:4px}
