/* Kalorien-App – dunkles Design, fürs Handy gemacht */
:root {
  --bg: #0E1113;
  --surface: #171B1F;
  --surface-2: #1F252A;
  --line: #2A3137;
  --text: #ECEFF1;
  --text-2: #C5CCD2;
  --muted: #9AA4AD;
  --accent: #7BD88F;
  --accent-ink: #0E1113;
  --protein: #6FA8FF;
  --carbs: #F2A65A;
  --fat: #C792EA;
  --danger: #FF8A80;
  --warn-bg: #2E2614;
  --warn: #F5C26B;
  --radius: 16px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.4 Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
body.has-nav { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
.wrap {
  max-width: 560px; margin: 0 auto;
  padding: calc(16px + env(safe-area-inset-top)) 16px 24px;
  display: flex; flex-direction: column; gap: 14px;
}
h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -0.01em; }
h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text-2); }
p { margin: 0; }
a { color: var(--accent); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: 0.9em; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { flex: 0 0 auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

/* Formulare */
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--text-2); }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px; min-height: 48px; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
textarea.code { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { font-size: 13px; color: var(--text-2); margin-bottom: 8px; padding: 0; }
label.check { flex-direction: row; align-items: center; gap: 10px; font-size: 15px; color: var(--text); min-height: 44px; }
label.check input { width: 22px; height: 22px; min-height: 0; accent-color: var(--accent); }

/* Auswahl zum Antippen */
.choices { display: flex; gap: 8px; }
.choices > legend { width: 100%; }
.wrap-choices { flex-wrap: wrap; }
.choice { flex: 1 1 0; min-width: 0; position: relative; }
.pick { position: relative; }
.choice input, .pick input, .toggle input[type="radio"] { position: absolute; opacity: 0; pointer-events: none; }
.choice span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: 4px 8px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
  color: var(--text); font-size: 15px; font-weight: 500; cursor: pointer; line-height: 1.2;
}
.wrap-choices .choice { flex: 1 1 auto; }
.wrap-choices .choice span { padding: 4px 14px; }
.choice input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.choice input:focus-visible + span, .pick input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
fieldset:disabled .choice span { opacity: 0.55; cursor: not-allowed; }

.cards { display: flex; flex-direction: column; gap: 8px; }
.pick > span {
  display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text); font-size: 15px; cursor: pointer;
}
.pick input:checked + span { background: #1A2620; }
.pick input:checked + span { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }

.toggles { display: flex; flex-direction: column; }
.toggle {
  flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--surface-2); color: var(--text); font-size: 15px;
}
.toggle:last-child { border-bottom: 0; }
.toggle input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 52px; height: 32px; min-height: 0; flex: 0 0 auto;
  border-radius: 16px; background: var(--line); border: 0; padding: 0; position: relative; cursor: pointer;
}
.toggle input[type="checkbox"]::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--text); transition: transform .15s;
}
.toggle input[type="checkbox"]:checked { background: var(--accent); }
.toggle input[type="checkbox"]:checked::after { transform: translateX(20px); background: var(--accent-ink); }

.slider { display: flex; flex-direction: column; gap: 8px; }
.slider label { display: block; color: var(--text); font-size: 15px; }
input[type="range"] { padding: 0; min-height: 44px; background: transparent; border: 0; accent-color: var(--accent); }
.scale { display: flex; justify-content: space-between; }

/* Knöpfe */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 16px; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-danger { background: transparent; color: var(--danger); border-color: #4A2A28; }
.btn-block { width: 100%; }
.btn:focus-visible, .iconbtn:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.iconbtn {
  width: 44px; height: 44px; flex: 0 0 auto; border-radius: 12px; border: 0;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.iconbtn:disabled { opacity: 0.35; cursor: default; }
.iconbtn.danger { color: var(--danger); }

/* Meldungen */
.flash { padding: 12px 14px; border-radius: 12px; font-size: 14px; background: #183322; color: #B9F0C6; }
.flash-fehler { background: #3A2422; color: #FFC2BC; }
.warning {
  display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px;
  background: var(--warn-bg); color: var(--warn); font-size: 14px;
}
.warning p + p { margin-top: 6px; }
.notice { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; border: 1px solid var(--accent); }
.notice .icon { color: var(--accent); }
.badge { font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--surface-2); color: var(--text-2); }
.badge-off { background: #3A2422; color: #FFC2BC; }

/* Seitenkopf */
.pagehead { display: flex; flex-direction: column; gap: 4px; position: relative; }
.pagehead .back { margin-bottom: 6px; }
.back {
  width: 44px; height: 44px; border-radius: 22px; background: var(--surface);
  color: var(--text); display: inline-flex; align-items: center; justify-content: center;
}
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.daynav > a {
  width: 44px; height: 44px; border-radius: 22px; background: var(--surface); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center;
}
.daynav .center { display: flex; flex-direction: column; align-items: center; }

/* Tagesübersicht */
.summary { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 140px; height: 140px; flex: 0 0 auto; }
.ring-bg { fill: none; stroke: #262D33; stroke-width: 14; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 14; stroke-linecap: round; }
.ring-fg.over { stroke: var(--carbs); }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label strong { font-size: 30px; font-weight: 700; }
.summary-side { display: flex; flex-direction: column; gap: 12px; }
.summary-side div { display: flex; flex-direction: column; }
.summary-side strong { font-size: 18px; font-weight: 600; }

.macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.macro { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.macro strong { font-size: 14px; font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; }
.dot-p { background: var(--protein); } .dot-c { background: var(--carbs); } .dot-f { background: var(--fat); }
progress.bar { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border: 0; border-radius: 3px; background: #262D33; overflow: hidden; }
progress.bar::-webkit-progress-bar { background: #262D33; border-radius: 3px; }
progress.bar::-webkit-progress-value { border-radius: 3px; }
progress.bar-p::-webkit-progress-value { background: var(--protein); } progress.bar-p::-moz-progress-bar { background: var(--protein); }
progress.bar-c::-webkit-progress-value { background: var(--carbs); } progress.bar-c::-moz-progress-bar { background: var(--carbs); }
progress.bar-f::-webkit-progress-value { background: var(--fat); } progress.bar-f::-moz-progress-bar { background: var(--fat); }

.meals { display: flex; flex-direction: column; gap: 10px; }
.meal { padding: 8px 8px 8px 16px; }
.meal-head { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.entry {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px 10px 0; margin-right: 0;
  border-top: 1px solid var(--surface-2); color: var(--text); text-decoration: none; font-size: 15px;
}
.empty { padding: 4px 0 8px; }

/* Listen und Menüs */
.list { padding: 4px 16px; }
.row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--surface-2); color: var(--text); text-decoration: none; }
.row:last-child { border-bottom: 0; }
.slot-row { gap: 6px; padding: 8px 0; }
.inline-form input { min-height: 44px; }
.menu { padding: 4px 16px; display: flex; flex-direction: column; }
.menu a { display: flex; align-items: center; gap: 14px; min-height: 56px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--surface-2); }
.menu a:last-child { border-bottom: 0; }
.menu a span { flex: 1 1 auto; }
.menu a .icon:first-child { color: var(--accent); }
details summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; min-height: 28px; list-style: none; }
details summary::-webkit-details-marker { display: none; }
details[open] summary { margin-bottom: 14px; }
.helper summary { font-weight: 500; color: var(--text-2); font-size: 15px; }
.helper .btn { margin-top: 12px; }
.danger-zone { margin-top: 4px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips form { display: contents; }
.chip {
  display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; cursor: pointer; max-width: 100%;
}

/* Rechner-Ergebnis */
.result { display: flex; flex-direction: column; gap: 14px; }
.result-main { display: flex; flex-direction: column; align-items: center; }
.big { font-size: 44px; font-weight: 700; color: var(--accent); line-height: 1.1; }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.result-grid div { display: flex; flex-direction: column; gap: 2px; }
.result-grid strong { font-size: 16px; }

/* Anmeldung */
.login { display: flex; flex-direction: column; gap: 20px; padding-top: 8vh; }
.brand { display: flex; align-items: center; justify-content: center; gap: 10px; font-size: 24px; font-weight: 700; color: var(--accent); }

/* Untere Navigation */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center; gap: 0;
  background: #12161A; border-top: 1px solid var(--surface-2);
  padding: 6px 8px calc(8px + env(safe-area-inset-bottom));
}
.tabbar a {
  flex: 1 1 0; max-width: 140px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 6px 0; min-height: 52px; font-size: 12px; color: var(--muted); text-decoration: none;
}
.tabbar a.active { color: var(--accent); }

@media (max-width: 360px) {
  .summary { gap: 14px; }
  .ring, .ring svg { width: 120px; height: 120px; }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Paket 2 ---- */
.quick-add { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-add .btn:only-child { grid-column: 1 / -1; }
.tracking { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.track { display: grid !important; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: 12px; }
.track .track-head, .track > strong, .track > progress { grid-column: 1; }
.track .track-btns, .track .steps-edit { grid-column: 2; grid-row: 1 / span 3; }
.track-btns .pill { flex: 0 0 auto; padding: 0 12px; }
.track { padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.track-head { display: flex; align-items: center; gap: 6px; }
.track-head .icon { color: var(--protein); }
.track:nth-child(2) .track-head .icon { color: var(--carbs); }
.track strong { font-size: 16px; }
.track-btns { display: flex; gap: 6px; align-items: center; }
.track-btns form { display: contents; }
.track-btns .iconbtn { width: 36px; height: 44px; }
.pill {
  flex: 1 1 0; min-height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  color: var(--text); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; padding: 0 4px; white-space: nowrap;
}
.steps-edit summary { min-height: 32px; font-weight: 500; }
.steps-edit[open] summary { margin-bottom: 6px; }
.inline-row { display: flex; gap: 6px; }
.inline-row input { min-height: 44px; padding: 8px 10px; }

.photo-drop {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 240px; border-radius: var(--radius); border: 2px dashed #3A434A; background: var(--surface);
  color: var(--text); font-size: 16px; text-align: center; padding: 24px; cursor: pointer;
}
.photo-drop .icon { color: var(--accent); }
.photo-drop input[type="file"], .file-btn input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; min-height: 0; }
.file-btn { position: relative; overflow: hidden; }
.is-busy .photo-drop { opacity: 0.4; pointer-events: none; }
.busy { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; color: var(--text-2); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.chip.on { border-color: var(--accent); color: var(--accent); }
.hint-label { margin-top: 12px; }
.ai-item.off { opacity: 0.45; }
.ai-item .toggle { padding: 0; border: 0; }
.ai-item .toggle input.grow { font-weight: 600; }
.item-sum strong { font-size: 18px; }
.choices .choice span { font-variant-numeric: tabular-nums; }

.scanner { display: flex; flex-direction: column; gap: 10px; }
.viewfinder { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: #000; display: flex; align-items: center; justify-content: center; }
.viewfinder video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.viewfinder .frame { position: absolute; left: 8%; right: 8%; top: 30%; bottom: 30%; border: 3px solid var(--accent); border-radius: 12px; display: none; }
.viewfinder .frame::after { content: ""; position: absolute; left: 6%; right: 6%; top: 50%; height: 2px; background: #FF6B5E; }
.scanner.live .frame { display: block; }
.scanner.no-camera .viewfinder { display: none; }
.product-name { font-size: 18px; color: var(--text); }
.portion-sum strong { font-size: 22px; color: var(--accent); }

.token { font-family: ui-monospace, Menlo, monospace; font-size: 13px; }
.steps-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 15px; color: var(--text-2); }
.steps-list strong { color: var(--text); }
.steps-list input { margin-top: 6px; }

.stepper { display: flex; align-items: center; gap: 10px; }
.big-btn { width: 56px; height: 56px; border-radius: 16px; }
.stepper-value { flex: 1 1 auto; }
.stepper-value input { text-align: center; font-size: 26px; font-weight: 700; min-height: 56px; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.seg { display: flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.seg a { padding: 6px 10px; border-radius: 8px; font-size: 13px; color: var(--muted); text-decoration: none; min-height: 32px; display: flex; align-items: center; }
.seg a.active { background: var(--surface); color: var(--text); }
.chart { width: 100%; height: auto; }
.chart .grid { stroke: #262D33; stroke-width: 1; }
.chart .axis { fill: var(--muted); font-size: 10px; }
.chart .target { stroke: var(--accent); stroke-width: 1.5; stroke-dasharray: 5 4; }
.chart .target-label { fill: var(--accent); }
.chart .line { fill: none; stroke: var(--protein); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .pt { fill: var(--protein); }
.chart .pt.last { fill: var(--text); stroke: var(--protein); stroke-width: 2; }
.bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; align-items: end; }
.bar-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.bar-val { font-size: 10px; color: var(--text-2); min-height: 14px; }
.bar-track { position: relative; width: 100%; height: 120px; background: #1C2227; border-radius: 6px; overflow: hidden; }
.bar-fill { position: absolute; left: 0; right: 0; bottom: 0; background: var(--accent); border-radius: 6px 6px 0 0; }
.bar-fill.over { background: var(--carbs); }
.bar-target { position: absolute; left: 0; right: 0; border-top: 2px dashed var(--text-2); }
.legend-target { display: inline-block; width: 14px; border-top: 2px dashed var(--text-2); vertical-align: middle; margin-right: 4px; }
.list.flat { padding: 0; }
.bar-fill.h0 { height: 0%; } .bar-target.h0 { bottom: 0%; }
.bar-fill.h5 { height: 5%; } .bar-target.h5 { bottom: 5%; }
.bar-fill.h10 { height: 10%; } .bar-target.h10 { bottom: 10%; }
.bar-fill.h15 { height: 15%; } .bar-target.h15 { bottom: 15%; }
.bar-fill.h20 { height: 20%; } .bar-target.h20 { bottom: 20%; }
.bar-fill.h25 { height: 25%; } .bar-target.h25 { bottom: 25%; }
.bar-fill.h30 { height: 30%; } .bar-target.h30 { bottom: 30%; }
.bar-fill.h35 { height: 35%; } .bar-target.h35 { bottom: 35%; }
.bar-fill.h40 { height: 40%; } .bar-target.h40 { bottom: 40%; }
.bar-fill.h45 { height: 45%; } .bar-target.h45 { bottom: 45%; }
.bar-fill.h50 { height: 50%; } .bar-target.h50 { bottom: 50%; }
.bar-fill.h55 { height: 55%; } .bar-target.h55 { bottom: 55%; }
.bar-fill.h60 { height: 60%; } .bar-target.h60 { bottom: 60%; }
.bar-fill.h65 { height: 65%; } .bar-target.h65 { bottom: 65%; }
.bar-fill.h70 { height: 70%; } .bar-target.h70 { bottom: 70%; }
.bar-fill.h75 { height: 75%; } .bar-target.h75 { bottom: 75%; }
.bar-fill.h80 { height: 80%; } .bar-target.h80 { bottom: 80%; }
.bar-fill.h85 { height: 85%; } .bar-target.h85 { bottom: 85%; }
.bar-fill.h90 { height: 90%; } .bar-target.h90 { bottom: 90%; }
.bar-fill.h95 { height: 95%; } .bar-target.h95 { bottom: 95%; }
.bar-fill.h100 { height: 100%; } .bar-target.h100 { bottom: 100%; }
.entry > span:last-child { white-space: nowrap; }

.badge-on { background: #183322; color: #B9F0C6; display: inline-flex; align-items: center; gap: 4px; }
.key-eigen { border: 1px solid #2E5A3C; }
.key-eigen .icon { color: var(--accent); vertical-align: -4px; }
.key-keiner { border: 1px solid #5A4A2E; }

/* ---- Paket 3: Wochenplan ---- */
.center-card { align-items: center; text-align: center; }
.center-card .icon { color: var(--accent); }
.center-card form { width: 100%; }
.pagehead .seg { align-self: flex-start; margin-top: 6px; }
.seg button { padding: 6px 10px; border-radius: 8px; font: inherit; font-size: 13px; color: var(--muted); background: transparent; border: 0; min-height: 32px; cursor: pointer; }
.seg button.active { background: var(--surface); color: var(--text); }
.daychips { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.daychips a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 56px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--surface-2); color: var(--text); text-decoration: none; font-size: 12px; }
.daychips a strong { font-size: 16px; }
.daychips a.today { border-color: var(--line); }
.daychips a.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.day-sum strong { font-size: 18px; margin-left: 2px; }
.day-sum > div { display: flex; flex-direction: column; gap: 2px; }
.plan-meal { display: flex; flex-direction: column; gap: 6px; }
.plan-meal.eaten { border: 1px solid #2E5A3C; }
.plan-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--text); text-decoration: none; font-size: 17px; }
.plan-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; }
.plan-actions { display: flex; gap: 8px; margin-top: 4px; }
.plan-actions form { flex: 1 1 0; }
.plan-actions .pill { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.pill.on { background: #183322; border-color: #2E5A3C; color: #B9F0C6; }
.busy-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(8, 10, 12, 0.82); display: flex; align-items: center; justify-content: center; padding: 24px; }
.busy-overlay .card { align-items: center; max-width: 320px; }

.wizard-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.wizard-progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.wizard:not(.js) .wizard-progress { display: none; }
.wizard-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.group-title { margin: 6px 0 0; font-size: 13px; color: var(--muted); font-weight: 600; }
.chip.tri.like, .tri-demo.like { background: #183322; border-color: #2E5A3C; color: #B9F0C6; }
.chip.tri.dislike, .chip.dislike, .tri-demo.dislike { background: #3A2422; border-color: #5A3330; color: #FFC2BC; text-decoration: line-through; }
.chip.dislike { text-decoration: none; }
.tri-demo { padding: 1px 6px; border-radius: 6px; border: 1px solid transparent; }
.tri-wrap { display: contents; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); font-size: 15px; cursor: pointer; }
.chip-check input:checked + span { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.cards .pick strong { font-weight: 500; }

.rate-row { display: flex; align-items: center; gap: 8px; }
.rate-row span { flex: 1 1 auto; }
.iconbtn.rate.on-like { background: #183322; color: #B9F0C6; }
.iconbtn.rate.on-dislike { background: #3A2422; color: #FFC2BC; }
.offer { border: 1px solid var(--accent); }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; align-items: center; gap: 12px; padding: 4px 0; border-bottom: 1px solid var(--surface-2); min-height: 52px; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .amount { min-width: 76px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ingredients li.disliked { opacity: 0.5; text-decoration: line-through; }
.iconbtn.thumb { background: transparent; color: var(--muted); }
.recipe-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 12px; line-height: 1.5; }
.recipe-steps li::marker { color: var(--accent); font-weight: 700; }

.cook { position: fixed; inset: 0; z-index: 60; background: var(--bg); display: flex; flex-direction: column;
  padding: calc(16px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom)); gap: 16px; }
.cook-top { display: flex; justify-content: space-between; align-items: center; }
.cook-step { flex: 1 1 auto; display: flex; align-items: center; font-size: 26px; line-height: 1.4; font-weight: 500; overflow-y: auto; }
.cook-bottom { display: flex; flex-direction: column; gap: 12px; }
.cook-btns { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; }
.cook-btns .btn { min-height: 60px; }
body.cooking { overflow: hidden; }
body.cooking .tabbar { display: none; }

.shop-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.shop-tools { display: flex; gap: 8px; align-items: center; }
.shop-tools .pill { flex: 0 0 auto; padding: 0 12px; }
.shop { display: flex; flex-direction: column; gap: 10px; }
.shop-group { padding: 12px 16px 4px; }
.shop-group h2 { margin-bottom: 4px; }
.shop-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 0; border: 0; border-top: 1px solid var(--surface-2);
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer; min-height: 52px; }
.shop-item:first-of-type .shop-btn { border-top: 0; }
.shop-btn .box { width: 24px; height: 24px; flex: 0 0 auto; border-radius: 7px; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; color: transparent; }
.shop-item.done .box { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.shop-item.done .shop-name { text-decoration: line-through; color: var(--muted); }
.shop-amt { color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.shop.hide-done .shop-item.done { display: none; }
.iconbtn.on { color: var(--accent); }
.tabbar a { font-size: 11px; }

.active-note { display: block; margin-top: 2px; }
.accent { color: var(--accent); }
.active-kcal { color: var(--carbs); display: inline-flex; align-items: center; gap: 4px; }
.steps-edit form.stack { gap: 8px; min-width: 150px; }
.steps-edit .btn { min-height: 44px; }
.steps-edit[open] { grid-column: 1 / -1 !important; grid-row: auto !important; }
.viewfinder #camera-start { position: relative; z-index: 2; }

.test-mail { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--surface-2); }

.mail-log pre { white-space: pre-wrap; word-break: break-all; font-size: 12px; background: var(--surface-2); border-radius: 10px; padding: 10px; margin: 0; max-height: 360px; overflow: auto; }

.ingredient-rows { gap: 8px; }
.calc-item { cursor: pointer; }
.calc-item input[type="checkbox"] { width: 22px; height: 22px; min-height: 0; flex: 0 0 auto; accent-color: var(--accent); }
.calc-item.off { opacity: 0.45; }
.nowrap { white-space: nowrap; }
.calc-total strong { font-size: 22px; color: var(--accent); }
.manual-toggle > summary { list-style: none; justify-content: center; font-weight: 600; }
.manual-toggle[open] > summary { margin-bottom: 14px; }
label.calc-item { flex-direction: row; align-items: center; gap: 12px; color: var(--text); font-size: 15px; }
