/* nomnom – light, calm, fast. No framework. */

:root {
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --tint: #F6F8F6;
  --ink: #1F2421;
  --muted: #69716C;
  --faint: #A4AAA6;
  --line: #ECEEEA;
  --line-strong: #DCDFDA;
  --hover: #F3F4F1;
  --accent: #161816;
  --accent-ink: #FFFFFF;
  --accent-soft: #F1F2F0;
  --accent-line: #C9CCC8;
  --quick: #95560A;
  --quick-soft: #FDF4E3;
  --left-a: #EDF0FB;
  --left-b: #F5F7FD;
  --left-ink: #3D4B8C;
  --left-line: #D5DCF3;
  --active-bg: #F7F7F5;
  --hover-soft: #FAFAF8;
  --today-bg: #FBFBFA;
  --quick-strong: #E08A00;
  --warn: #95560A;
  --danger: #A33A2C;
  --health-off: #E8EAE7;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(31, 36, 33, .04), 0 8px 24px rgba(31, 36, 33, .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161917;
    --surface: #1D211F;
    --tint: #1D211F;
    --ink: #E8EBE8;
    --muted: #9BA29E;
    --faint: #6A716D;
    --line: #2A2F2C;
    --line-strong: #3A403C;
    --hover: #242926;
    --accent: #F2F3F1;
    --accent-ink: #141614;
    --accent-soft: #262A28;
    --accent-line: #4A504C;
    --quick: #E8B36A;
    --quick-soft: #2E2618;
    --left-a: #1E2333;
    --left-b: #23293B;
    --left-ink: #B4C0F0;
    --left-line: #343C58;
    --active-bg: #202523;
    --hover-soft: #1E2220;
    --today-bg: #1B1F1D;
    --quick-strong: #FFB020;
    --warn: #E8B36A;
    --danger: #EE8E80;
    --health-off: #333A36;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip;
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 15px/1.45 var(--font);
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; }
h1 { font-size: 26px; line-height: 1.2; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.i { flex-shrink: 0; }
[hidden] { display: none !important; }
ul.plain { list-style: none; margin: 0; padding: 0; }
.eyebrow { font-size: 12px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }

.wrap { max-width: 1440px; margin: 0 auto; padding: 0 28px; }
.page { padding-top: 24px; padding-bottom: 64px; }

/* ---------- top bar & navigation */

.topbar { background: var(--bg); position: sticky; top: 0; z-index: 10; border-bottom: 1px solid var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 28px; height: 60px; }
.logo { font-weight: 600; font-size: 19px; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.logo.big { font-size: 32px; text-align: center; margin-bottom: 28px; }
.mainnav { display: flex; gap: 2px; flex: 1; }
.mainnav a {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--muted); text-decoration: none; font-weight: 500;
}
.mainnav a:hover { background: var(--hover); color: var(--ink); }
.mainnav a[aria-current] { color: var(--ink); background: var(--hover); }
.mainnav .i { width: 18px; height: 18px; }
.avatar {
  width: 32px; height: 32px; border-radius: 99px; display: inline-flex; align-items: center; justify-content: center;
  background: #FFE3A3; color: #5C4200; font-weight: 600; font-size: 13px; text-decoration: none; flex-shrink: 0;
}
.avatar.small { width: 22px; height: 22px; font-size: 11px; }

@media (max-width: 720px) {
  .wrap { padding: 0 16px; }
  .page { padding-top: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .topbar { position: static; border: 0; }
  .topbar-inner { height: 52px; justify-content: space-between; }
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; gap: 0;
    background: var(--surface); border-top: 1px solid var(--line);
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom));
  }
  .mainnav a { flex: 1; flex-direction: column; gap: 2px; height: 52px; justify-content: center; font-size: 11px; padding: 0; }
  .mainnav a[aria-current] { background: none; color: var(--accent); }
  .mainnav .i { width: 22px; height: 22px; }
}

/* ---------- buttons, chips, fields */

.btn, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-weight: 500; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover, .btn-icon:hover { background: var(--hover); }
.btn .i { width: 18px; height: 18px; }
.btn-icon { width: 40px; padding: 0; color: var(--muted); border-color: transparent; background: transparent; }
.btn-icon:hover { color: var(--ink); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent); opacity: .88; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--muted); }
.btn-quiet:hover { color: var(--ink); }
.danger { color: var(--danger) !important; }
.wide { width: 100%; }
.grow { flex: 1; }
.linkbtn { border: 0; background: none; color: var(--muted); font-size: 13px; cursor: pointer; padding: 8px 4px; white-space: nowrap; }
.linkbtn:hover { color: var(--ink); text-decoration: underline; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}

.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px; border-radius: 8px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-chosen { background: var(--g-bg, var(--accent-soft)); color: var(--g-ink, var(--ink)); border-color: transparent; padding-right: 2px; font-weight: 500; cursor: default; }
.chip-chosen a { color: inherit; text-decoration: none; }
.chip-chosen.auto { background: var(--surface); border: 1px dashed var(--g-line, var(--accent-line)); }
.chip-chosen button, .chips-list button { width: 28px; height: 28px; border: 0; background: none; color: var(--muted); border-radius: 99px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.chip-chosen .i { width: 14px; height: 14px; }
.chips-list { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-list form { display: inline; }

.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.label { font-size: 13px; font-weight: 500; color: var(--muted); }
.hint { font-size: 13px; color: var(--muted); }
input[type=text], input[type=search], input[type=number], input[type=password], input:not([type]), select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line-strong);
  background: var(--surface); font-size: 16px; outline: none;
}
textarea { line-height: 1.5; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
input[type=checkbox] { accent-color: var(--accent); width: 20px; height: 20px; margin: 0; }
.error { color: var(--danger); font-size: 14px; }
.errorlist { list-style: none; padding: 0; margin: 0; color: var(--danger); font-size: 13px; }

.search { display: flex; align-items: center; gap: 10px; padding: 0 12px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); }
.search:focus-within { border-color: var(--accent); }
.search input { border: 0; padding-left: 0; padding-right: 0; min-height: 46px; background: transparent; }

.segmented { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: var(--hover); margin: 0; border: 0; }
.segmented > button, .segmented > a, .segmented > label {
  flex: 1; display: flex; align-items: center; justify-content: center; height: 36px; padding: 0 10px; border: 0; border-radius: 9px;
  background: none; color: var(--muted); font-weight: 500; text-decoration: none; cursor: pointer; font-size: 14px;
}
.segmented [aria-checked="true"], .segmented [aria-current], .segmented label:has(input:checked) { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.segmented label input { position: absolute; opacity: 0; pointer-events: none; }

/* ---------- toasts */

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast { background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; box-shadow: var(--shadow); animation: toast 4s forwards; }
.toast-error { background: var(--danger); color: #fff; }
@keyframes toast { 0% { opacity: 0; transform: translateY(8px); } 6%, 85% { opacity: 1; transform: none; } 100% { opacity: 0; } }
@media (max-width: 720px) { .toasts { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* ---------- week */

/* The week page is a two-column shell: the calendar, and the dish panel beside it (not over it). */
.page-week .page { max-width: none; width: 100%; margin: 0; padding-left: 0; padding-right: 0; container: week / inline-size; }
.weekhead { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 10px; padding: 0 28px; }
.weeknav { display: flex; gap: 2px; }
.weekhead .btn-icon { border: 1px solid var(--line); }
.weektitle { flex: 1 1 220px; }
.weektitle p { margin-top: 2px; font-size: 14px; }
.weekactions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.weekactions form { display: contents; }
/* Split button: main action + chevron that opens bulk options. */
.split { display: inline-flex; position: relative; }
.split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-toggle { list-style: none; width: 34px; padding: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; border-left: 1px solid rgba(255, 255, 255, .22); }
.split-toggle::-webkit-details-marker { display: none; }
.split-toggle .i { width: 16px; height: 16px; transition: transform .12s; }
.splitdrop[open] .split-toggle .i { transform: rotate(180deg); }
.filtermenu.splitmenu { width: 250px; }
.splitmenu form { display: block !important; }
.mopt { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 40px; padding: 0 10px; border: 0; border-radius: 8px; background: none; color: var(--ink); font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.mopt .i { width: 16px; height: 16px; flex-shrink: 0; }
.mopt span:first-of-type { flex: 1; white-space: nowrap; }
.mopt-keep .i { color: #2E8A4E; }
.mopt-del .i { color: var(--danger); }
.mopt:hover:not(:disabled) { background: var(--hover); }
.mopt:disabled { color: var(--faint); cursor: default; }
.msep { height: 1px; margin: 4px 6px; background: var(--line); }
.mopt:disabled .i { color: inherit; }
.btn[aria-pressed="true"] { background: var(--hover); border-color: var(--ink); }

.weekhead { margin-bottom: 16px; }
.weektitle-row { display: flex; align-items: center; gap: 6px; }
.weekdot .tip { min-width: 200px; }
.tip-rows { display: flex; flex-direction: column; gap: 2px; margin-top: 2px; }
.tip-row { display: flex; justify-content: space-between; gap: 16px; color: color-mix(in srgb, var(--bg) 70%, transparent); }
.tip-row span:last-child { color: var(--bg); font-weight: 500; font-variant-numeric: tabular-nums; }
.tip-row.miss span:last-child { color: #FFB35C; }

/* Each day spans 3 rows of the grid (head, lunch, dinner) and shares them via subgrid,
   so all lunches and all dinners line up across the week. */
.weekgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.day { grid-row: span 3; display: grid; grid-template-rows: subgrid; row-gap: 0; min-width: 0; border-right: 1px solid var(--line); }
.day:last-child { border-right: 0; }
.day.is-today { background: var(--today-bg); box-shadow: inset 0 3px 0 var(--accent); }
.day.is-past { opacity: .6; }

.dayhead { display: flex; align-items: center; gap: 8px; padding: 12px 8px 10px 14px; min-height: 52px; min-width: 0; }
.daydate { display: flex; align-items: baseline; gap: 5px; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; line-height: 1; white-space: nowrap; }
.dayname { color: var(--faint); font-weight: 500; }
.today-mark { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; color: var(--accent-ink); background: var(--accent); }
.dayhead-end { margin-left: auto; display: flex; align-items: center; gap: 2px; }

/* Health: a coloured dot, the detail in a tooltip on hover / focus / tap. */
.hdot { position: relative; width: 26px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: help; outline: none; flex-shrink: 0; }
.hdot::before { content: ""; width: 9px; height: 9px; border-radius: 99px; background: var(--dot); box-shadow: 0 0 0 3px color-mix(in srgb, var(--dot) 18%, transparent); }
.hdot.good { --dot: #2FA35A; }
.hdot.ok { --dot: #E0A100; }
.hdot.low { --dot: #E04A32; }
.hdot .tip {
  position: absolute; top: calc(100% + 4px); right: -2px; z-index: 20; transform: translateY(-4px);
  width: max-content; max-width: 220px; padding: 10px 12px; border-radius: 10px;
  background: var(--ink); color: var(--bg); font-size: 12px; line-height: 1.4; font-weight: 400; letter-spacing: 0;
  display: none; flex-direction: column; gap: 4px; text-align: left; pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .14);
}
.hdot .tip::before { content: ""; position: absolute; top: -4px; right: 11px; width: 8px; height: 8px; background: inherit; transform: rotate(45deg); border-radius: 1px; }
.hdot:hover .tip, .hdot:focus .tip { display: flex; animation: tip-in .12s ease forwards; }
@keyframes tip-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.tip b { font-weight: 600; font-size: 13px; }
.tip b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 99px; background: var(--dot); margin-right: 6px; vertical-align: 1px; }
.tip-hint { color: color-mix(in srgb, var(--bg) 92%, transparent); }
.tip-list { display: flex; flex-direction: column; gap: 1px; color: color-mix(in srgb, var(--bg) 62%, transparent); }

.quick {
  display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; padding: 0;
  border-radius: 8px; border: 0; background: transparent; color: var(--line-strong); cursor: pointer;
}
.quick .i { width: 16px; height: 16px; }
.day:hover .quick, .quick:focus-visible { color: var(--faint); }
.quick:hover { background: var(--hover); color: var(--muted); }
.quick.on, .day:hover .quick.on { background: var(--quick-soft); color: var(--quick-strong); }
.quick.on .i { fill: currentColor; }
.quick.static { cursor: default; }
.quick-text { color: var(--quick-strong); display: inline-flex; align-items: center; gap: 4px; font-size: 13px; vertical-align: -2px; }
.quick-text .i { width: 14px; height: 14px; fill: currentColor; }

/* ---------- slots */

.slot { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 8px 8px 12px; border-top: 1px solid var(--line); transition: background .12s; }
.slot[data-slot] { cursor: pointer; }
.slot[data-slot]:hover { background: var(--hover-soft); }
.slot.is-active, .slot.is-active:hover { background: var(--active-bg); box-shadow: inset 0 0 0 1.5px var(--ink); }
.slot.drop, .slot.drop:hover { background: var(--active-bg); box-shadow: inset 0 0 0 1.5px var(--faint); }

.slothead { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; padding-left: 4px; }
.slotlabel { font-size: 11px; font-weight: 500; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); }
.slot-tools { display: flex; gap: 2px; }
.tool {
  width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--faint); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.tool .i { width: 15px; height: 15px; }
.slot:hover .tool, .tool:focus-visible, .tool.on { opacity: 1; }
.tool:hover { background: var(--hover); color: var(--ink); }
.tool.on { color: var(--ink); }
@media (hover: none) { .tool { opacity: .7; } }

/* Dish cards: one fixed layout so the calendar scans in straight lines.
   Row 1 symbol + time, row 2 the name (always two lines tall), row 3 the actions. */
.dcard {
  position: relative; display: flex; flex-direction: column; flex-shrink: 0; min-width: 0; overflow: hidden;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line-strong);
}
.dcard.auto { border-style: dashed; }
.dcard[draggable="true"] { cursor: grab; }
.dcard.dragging { opacity: .4; }
.card-body { display: flex; flex-direction: column; gap: 7px; padding: 9px 10px 10px; min-width: 0; }
.card-top { display: flex; align-items: center; gap: 7px; height: 22px; min-width: 0; }
.card-min { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.card-name {
  font-weight: 500; font-size: 14px; line-height: 18px; height: 36px; overflow-wrap: break-word; hyphens: auto; -webkit-hyphens: auto;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-meta { display: flex; align-items: center; gap: 6px; min-width: 0; font-size: 12px; line-height: 18px; color: var(--muted); white-space: nowrap; overflow: hidden; }
.card-meta > * { flex-shrink: 0; }

/* Category symbol: the emoji on the category colour. */
.caticon {
  display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0;
  border-radius: 6px; background: var(--g-bg, var(--hover)); color: var(--g-ink, var(--muted));
  font-size: 13px; line-height: 1; font-weight: 600;
}
.caticon.none { background: var(--hover-soft); box-shadow: inset 0 0 0 1px var(--line); }
.caticon .i { width: 14px; height: 14px; }

.card-actions { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px dashed var(--line-strong); margin: 0; }
.dcard.kept .card-actions { border-top-style: solid; border-top-color: var(--line); }
.card-actions form { display: flex; }
.card-actions form + form { border-left: 1px dashed var(--line-strong); }
.dcard.kept .card-actions form + form { border-left: 1px solid var(--line); }
.card-actions button {
  flex: 1; height: 30px; border: 0; background: none; color: var(--faint); cursor: pointer; gap: 5px; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; transition: background .12s, color .12s;
}
.card-actions button .i { width: 15px; height: 15px; }
.card-actions .act-keep[aria-pressed="true"] { color: #2E8A4E; }
.card-actions .act-keep[aria-pressed="true"] .i { stroke-width: 2.6; }
.card-actions .act-keep:hover { background: #E7F6EC; color: #1F7A40; }
.card-actions .act-redo:hover { background: #FDF3D8; color: #9A6B00; }
.card-actions .act-del:hover { background: #FCE8E4; color: #B9321D; }
.card-actions.single { display: flex; }

/* Accepted dishes stay compact: no button row. On hover (or keyboard focus) the buttons
   slide in over the bottom of the card. Touch screens have no hover, so there the row stays. */
@media (hover: hover) {
  .dcard.kept .card-actions {
    position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface);
    border-top: 1px solid var(--line); box-shadow: 0 -4px 10px rgba(20, 24, 22, .10);
    opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .12s, transform .12s;
  }
  .dcard.kept:hover .card-actions, .dcard.kept:focus-within .card-actions { opacity: 1; transform: none; pointer-events: auto; }
}
.dcard.kept .card-actions form + form { border-left-color: var(--line); }
.dcard[data-detail] { cursor: pointer; }
.dcard[data-detail][draggable="true"]:active { cursor: grabbing; }
@media (prefers-color-scheme: dark) {
  .card-actions .act-keep[aria-pressed="true"] { color: #7FD39A; }
  .card-actions .act-keep:hover { background: #1C3324; color: #7FD39A; }
  .card-actions .act-redo:hover { background: #352B14; color: #F0C35A; }
  .card-actions .act-del:hover { background: #3A1F1A; color: #F09080; }
}

/* Restln: same rows as a dish, its own colour and a gentle stripe. */
.card-left {
  background: repeating-linear-gradient(135deg, var(--left-a) 0 7px, var(--left-b) 7px 14px);
  border: 1px solid var(--left-line);
}
.card-left .card-name { color: var(--left-ink); font-weight: 600; }
.card-left .card-actions { border-top: 1px solid var(--left-line); }
.left-icon { background: var(--surface); color: var(--left-ink); box-shadow: 0 0 0 1px var(--left-line); }
.tool.on[value="leftovers"] { color: var(--left-ink); background: var(--left-a); }

.slot-empty, .slot-add { display: flex; align-items: center; gap: 6px; font-size: 13px; padding: 0 4px; }
.slot-empty { min-height: 40px; color: var(--faint); border: 1px dashed var(--line-strong); border-radius: 10px; padding: 0 10px; }
.slot:hover .slot-empty { color: var(--muted); }
.slot-add { color: var(--faint); min-height: 26px; opacity: 0; transition: opacity .12s; }
.slot:hover .slot-add { opacity: 1; }
@media (hover: none) { .slot-add { opacity: 1; } }
.slot-empty .i, .slot-add .i { width: 14px; height: 14px; }
.slot-none { padding: 4px; }

/* Auswärts: the note is edited right in the slot. */
.slot-out { display: flex; align-items: center; gap: 6px; margin: 0; padding: 0 4px; min-height: 34px; color: var(--muted); font-size: 14px; }
.slot-out .i { width: 14px; height: 14px; flex-shrink: 0; }
.slot-out input {
  min-height: 30px; padding: 0 6px; margin-left: -6px; border: 1px solid transparent; border-radius: 7px; background: transparent;
  font-size: 14px; color: var(--ink); cursor: text;
}
.slot-out input::placeholder { color: var(--muted); }
.slot-out input:hover { border-color: var(--line); }
.slot-out input:focus { border-color: var(--line-strong); background: var(--surface); }

.empty { margin: 0 28px 20px; background: var(--tint); border-radius: 16px; padding: 28px; display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.empty p { color: var(--muted); max-width: 52ch; }

/* Wide: the week fills the window, lunch and dinner get equal halves. */
@media (min-width: 900px) and (min-height: 600px) {
  .page-week .page { min-height: calc(100vh - 61px); min-height: calc(100dvh - 61px); display: flex; flex-direction: column; padding-bottom: 0; }
  .page-week #week { flex: 1; display: flex; flex-direction: column; }
  .page-week .weekgrid { flex: 1; grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); border-bottom: 0; }
}

/* Narrow calendar (small screen, or the panel is open on a small laptop): days become cards. */
@container week (max-width: 840px) {
  .page-week .weekgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: none; align-content: start; border: 0; gap: 12px; padding: 0 16px 16px; }
  .day { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
  .day:last-child { border-right: 1px solid var(--line); }
  .day.is-today { box-shadow: inset 0 0 0 2px var(--accent); }
  .weekhead { padding: 0 16px; }
}
@container week (max-width: 640px) { .page-week .weekgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container week (max-width: 420px) {
  .page-week .weekgrid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .dcard .card-name { height: auto; }  /* one column: nothing to line up with, so no reserved second line */
}
@media (max-width: 560px) {
  .card-name { font-size: 15px; }
  .weekhead { gap: 10px; }
  .weektitle { order: -1; flex-basis: 100%; }
  h1 { font-size: 22px; }
  .weekactions { flex: 1; flex-wrap: nowrap; }
  .weekactions .split { flex: 1; }
  .weekactions .split-main { flex: 1; }
  .weekactions .btn:not(.btn-primary) { width: 40px; padding: 0; }
  .weekactions .btn:not(.btn-primary) span { display: none; }
}

/* ---------- dish panel */

.panel {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 40;
  background: var(--surface); border-left: 1px solid var(--line); box-shadow: -12px 0 32px rgba(20, 24, 22, .08);
  transform: translateX(105%); visibility: hidden; transition: transform .2s ease, visibility 0s .2s;
  display: flex; flex-direction: column;
}
.panel.open { transform: none; visibility: visible; transition: transform .2s ease; }
.panel.loading .picker { opacity: .55; }
@media (max-width: 560px) { .panel { width: 100vw; border-left: 0; } }

/* From 900px the panel takes its own column and the calendar shrinks. */
@media (min-width: 900px) {
  .page-week .shell { display: grid; grid-template-columns: minmax(0, 1fr) 0; transition: grid-template-columns .2s ease; }
  body.panel-open.page-week .shell { grid-template-columns: minmax(0, 1fr) 380px; }
  .page-week .panel {
    position: sticky; top: 61px; height: calc(100vh - 61px); height: calc(100dvh - 61px); width: auto; min-width: 0; z-index: 5;
    transform: none; box-shadow: none; overflow: hidden; transition: visibility 0s .2s;
  }
  .page-week .panel.open { transition: none; }
  .page-week .panel .picker { width: 380px; }
}

.picker { display: flex; flex-direction: column; gap: 14px; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; flex: 1; }
.picker-head { display: flex; align-items: center; gap: 2px; }
.picker-head h2 { font-size: 18px; flex: 1; }
.picker-head .btn-icon { width: 36px; height: 36px; }

.target { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 6px 6px 6px 12px; border-radius: 10px; background: var(--active-bg); border: 1.5px solid var(--ink); font-size: 14px; margin: 0; }
.target-text { flex: 1; min-width: 0; }
.target b { font-weight: 600; }
.target-clear { width: 30px; height: 30px; border: 0; border-radius: 7px; background: none; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.target-clear:hover { background: var(--hover); color: var(--ink); }
.target-clear .i { width: 15px; height: 15px; }

.add { display: flex; flex-direction: column; gap: 12px; }
.create { justify-content: flex-start; height: 44px; }
.create b { font-weight: 600; }
/* Search with a filter dropdown next to it. */
.searchrow { display: flex; gap: 8px; align-items: stretch; }
.searchrow .search { flex: 1; min-width: 0; }
.filterdrop { position: relative; }
.filterdrop > summary { list-style: none; height: 48px; padding: 0 14px; border-radius: 12px; }
.filterdrop > summary::-webkit-details-marker { display: none; }
.filterdrop[open] > summary { border-color: var(--ink); }
.fcount { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 6px; background: var(--ink); color: var(--bg); font-size: 11.5px; font-weight: 600; }
.filtermenu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; width: 240px; max-height: min(420px, 60vh); overflow-y: auto;
  padding: 6px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(20, 24, 22, .12);
  display: flex; flex-direction: column;
}
.fopt { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 8px; border-radius: 8px; cursor: pointer; font-size: 14px; }
.fopt:hover { background: var(--hover); }
.fopt input { width: 18px; height: 18px; flex-shrink: 0; }
.quick-ic { background: var(--quick-soft); color: var(--quick-strong); }
.quick-ic .i { fill: currentColor; }
.fsep { margin: 8px 8px 2px; font-size: 11px; }
.fclear { align-self: flex-start; margin: 4px 0 0; padding: 8px; }
.lib-group { display: flex; flex-direction: column; gap: 6px; }
.lib-group h3 { margin: 6px 0 2px; }

.libcard {
  display: flex; align-items: center; gap: 10px; min-height: 64px; padding: 8px 8px 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); cursor: grab; transition: border-color .12s, background .12s;
}
.libcard:hover { border-color: var(--faint); }
.libcard.dragging { opacity: .4; }
.libcard.is-chosen { background: var(--hover-soft); border-color: var(--line); }
.libcard-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.libcard .caticon { width: 30px; height: 30px; border-radius: 8px; font-size: 16px; }
.libcard .card-name { -webkit-line-clamp: 1; height: auto; }
.why { color: var(--faint); overflow: hidden; text-overflow: ellipsis; flex-shrink: 1 !important; min-width: 0; }
.lib-add {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, color .12s, border-color .12s;
}
.lib-add .i { width: 16px; height: 16px; }
.lib-view {
  width: 34px; height: 34px; flex-shrink: 0; border-radius: 8px; border: 0; background: none; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .12s, color .12s;
}
.lib-view .i { width: 16px; height: 16px; }
.lib-view:hover { background: var(--hover); color: var(--ink); }
.libcard:has(button.lib-add) { cursor: pointer; }
.libcard:has(button.lib-add):hover { border-color: var(--ink); }
.lib-add:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.lib-add.is-done { border-color: transparent; background: none; color: #2E8A4E; cursor: default; }
.row-form { display: flex; gap: 8px; align-items: flex-end; }

/* ---------- pages */

.pagehead { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.count { font-size: 13px; font-weight: 500; color: var(--muted); }
h1 .count { font-size: 15px; margin-left: 4px; }
.back { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); text-decoration: none; font-size: 14px; margin: 0 0 12px -4px; min-height: 32px; }
.back .i { width: 18px; height: 18px; }
.back:hover { color: var(--ink); }

.empty-row { padding: 18px 4px; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.tag-emoji { margin-right: 5px; font-size: 12px; }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; line-height: 1; font-weight: 500; white-space: nowrap; background: var(--g-bg, var(--hover)); color: var(--g-ink, var(--ink)); }
.meta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; margin-left: 6px; color: var(--muted); }
.meta .i { width: 15px; height: 15px; }
.note { margin-top: 10px; font-size: 14px; color: var(--warn); }
.lines li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.prose { font-size: 16px; line-height: 1.65; max-width: 62ch; }
.prose p { margin: 0 0 12px; }
.emptybox { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 24px; border: 1px dashed var(--line-strong); border-radius: 14px; }
.emptybox p { margin: 0; }
.emptybox .btn { margin-top: 6px; }
.center { text-align: center; }

/* ---- Dish list: a grid of cards */
.dishes { display: flex; flex-direction: column; gap: 16px; }
.listbar { display: flex; gap: 8px; align-items: stretch; }
.listbar .search { flex: 1; min-width: 0; max-width: 520px; }
.sortselect { position: relative; display: inline-flex; align-items: center; }
.sortselect select {
  appearance: none; -webkit-appearance: none; height: 48px; padding: 0 36px 0 14px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer;
}
.sortselect select:hover { background: var(--hover); }
.sortselect select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sortselect .i { position: absolute; right: 12px; width: 16px; height: 16px; pointer-events: none; color: var(--muted); }
.dishgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.dishgrid li[hidden] { display: none; }
.dishcard {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; height: 100%; min-height: 76px; padding: 12px 14px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); text-decoration: none; transition: border-color .12s, box-shadow .12s;
}
.dishcard:hover { border-color: var(--faint); box-shadow: 0 2px 10px rgba(20, 24, 22, .06); }
.dishcard .caticon { width: 40px; height: 40px; border-radius: 10px; font-size: 21px; }
.dishcard-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dishcard-name { font-size: 15px; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dishcard-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12.5px; color: var(--muted); }
.dishcard-meta > span { display: inline-flex; align-items: center; gap: 3px; }
.dishcard-meta .i { width: 13px; height: 13px; }
.dishcard-meta .veg { color: #2E8A4E; }
.faint { color: var(--faint); }
.dishcard-last { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; font-size: 12px; color: var(--faint); text-align: right; white-space: nowrap; }
.dishcard-last b { font-size: 13px; font-weight: 500; color: var(--muted); }
.nothing { padding: 32px 0; }
.listfoot { margin-top: 28px; }

/* ---- Dish page */
.page-dish .page, .page-dishform .page { max-width: 1080px; }
.dishhero { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 20px; }
.dishhero > .caticon { width: 64px; height: 64px; border-radius: 16px; font-size: 34px; flex-shrink: 0; }
.dishhero-main { flex: 1; min-width: 0; padding-top: 2px; }
.dishhero h1 { font-size: 30px; letter-spacing: -0.025em; line-height: 1.15; }
.dishhero .tags { margin-top: 8px; }
.dishhero-actions { display: flex; gap: 6px; flex-shrink: 0; }
.btn-icon-b { width: 40px; padding: 0; list-style: none; }
.btn-icon-b::-webkit-details-marker { display: none; }
.moredrop .splitmenu { width: 220px; }
.dishstats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0 0 24px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.dishstats > div { padding: 12px 16px; }
.dishstats > div + div { border-left: 1px solid var(--line); }
.dishstats dt { font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.dishstats dd { margin: 0; font-size: 15px; font-weight: 500; }
.dishstats a { color: var(--ink); }
.recipegrid { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 1.8fr); gap: 16px; align-items: start; }
.recipegrid > .rcard:only-child { grid-column: 1 / -1; max-width: 720px; }
.rcard { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.rcard h2, .dishhistory h2 { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.rcard h2 .muted { font-weight: 500; margin-left: 4px; }
.ilist li { padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 15px; }
.ilist li:last-child { border-bottom: 0; }
.ilist b { font-weight: 600; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; align-items: start; }
.stepnum { width: 28px; height: 28px; border-radius: 99px; background: var(--hover); display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.steps p { margin: 3px 0 0; font-size: 16px; line-height: 1.6; max-width: 66ch; }
.steps.small { gap: 10px; }
.steps.small li { grid-template-columns: 24px minmax(0, 1fr); gap: 10px; }
.steps.small .stepnum { width: 24px; height: 24px; font-size: 12px; }
.steps.small p { font-size: 15px; margin-top: 1px; }
.lines b { font-weight: 600; }
.source { margin-top: 14px; }
.dishhistory { margin-top: 28px; }
.datechips { display: flex; flex-wrap: wrap; gap: 6px; }
.datechip { display: inline-flex; align-items: center; height: 30px; padding: 0 10px; border-radius: 8px; background: var(--hover); color: var(--ink); text-decoration: none; font-size: 13px; }
.datechip:hover { background: var(--line); }
.datechip.is-next { background: var(--surface); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 500; }
@media (max-width: 720px) {
  .recipegrid { grid-template-columns: minmax(0, 1fr); }
  .dishhero { flex-wrap: wrap; }
  .dishhero > .caticon { width: 52px; height: 52px; font-size: 28px; border-radius: 14px; }
  .dishhero-main { flex-basis: calc(100% - 68px); }
  .dishhero h1 { font-size: 24px; }
  .dishhero-actions { width: 100%; }
  .dishhero-actions > .btn { flex: 1; }
  .dishstats > div { padding: 10px 12px; }
  .dishstats dd { font-size: 14px; }
}
@media (max-width: 560px) {
  .listbar { flex-wrap: wrap; }
  .listbar .search { flex-basis: 100%; max-width: none; }
  .listbar .filterdrop, .listbar .sortselect { flex: 1; }
  .listbar .filterdrop > summary, .sortselect select { width: 100%; }
  .dishstats { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .dishstats > div:last-child { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
}

/* ---- Dish form */
.dishform { margin-top: 18px; display: flex; flex-direction: column; gap: 16px; }
.dishform-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.fcard { display: flex; flex-direction: column; gap: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.fcard h2 { font-size: 16px; }
.fcard h2 .muted { font-size: 13px; font-weight: 400; margin-left: 4px; }
.fcard .field-row { flex-wrap: nowrap; align-items: flex-end; gap: 20px; }
.fcard .segmented.small label { white-space: nowrap; }
.fcard .field-row .field:first-child { width: 120px; flex-shrink: 0; }
.field.grow { flex: 1; min-width: 0; }
.fcard .segmented.small { max-width: none; }
.fcard .segmented.small label { flex: 1; }
.suffix { position: relative; display: flex; align-items: center; }
.suffix input { padding-right: 44px; }
.suffix > span { position: absolute; right: 12px; font-size: 14px; color: var(--muted); pointer-events: none; }
.catpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 6px; }
.catopt { position: relative; }
.catopt input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.catopt-box { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface); font-size: 13.5px; transition: background .12s, border-color .12s; }
.catopt-box > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.catopt-emoji { width: 24px; height: 24px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; background: var(--g-bg, var(--hover)); flex-shrink: 0; color: var(--muted); }
.catopt:hover .catopt-box { background: var(--hover); }
.catopt input:checked + .catopt-box { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; background: var(--surface); }
.catopt input:focus-visible + .catopt-box { outline: 2px solid var(--accent); outline-offset: 2px; }
.fcard textarea { min-height: 180px; resize: vertical; }
.savebar {
  position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 8px; padding: 12px 0 16px;
  background: linear-gradient(to bottom, transparent, var(--bg) 30%);
}
.savebar .btn-primary { min-width: 140px; }
@media (max-width: 860px) { .dishform-cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 560px) {
  .fcard { padding: 16px; }
  .fcard .field-row { flex-wrap: wrap; }
  .catpick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .savebar .btn { flex: 1; }
}

.form { display: flex; flex-direction: column; gap: 20px; }
.form.narrow { max-width: 640px; margin-top: 18px; }
.field-row { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.field-row .field:first-child { width: 140px; }
.field.check { flex-direction: row; align-items: center; gap: 10px; min-height: 44px; cursor: pointer; }
.switch { position: relative; display: inline-flex; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch i { width: 40px; height: 24px; border-radius: 99px; background: var(--line-strong); position: relative; transition: background .15s; }
.switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 99px; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.chips-select { display: flex; flex-wrap: wrap; gap: 6px; }
.chips-select > div, .chips-select ul { display: contents; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; inset: 0; cursor: pointer; width: 100%; height: 100%; margin: 0; }
.chip-check span { display: inline-flex; align-items: center; height: 36px; padding: 0 13px; border-radius: 8px; border: 1px solid var(--line-strong); font-size: 14px; background: var(--surface); }
.chip-check input:checked + span { background: var(--g-bg, var(--accent-soft)); border-color: var(--g-line, var(--accent-line)); color: var(--g-ink, var(--ink)); font-weight: 500; }
.chip-check span:has(.tag-emoji)::before { display: none; }
.chip-check span::before, .chip[data-filter]::before { content: ""; width: 8px; height: 8px; border-radius: 99px; background: var(--g-dot, transparent); margin-right: 7px; }
.chip[data-filter="quick"]::before { display: none; }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.segmented.small { max-width: 420px; }
.more { border-top: 1px solid var(--line); padding-top: 14px; }
.more summary { cursor: pointer; font-weight: 500; min-height: 32px; display: flex; align-items: center; gap: 8px; }
.more[open] summary { margin-bottom: 16px; }
.more .field + .field { margin-top: 16px; }
.actions { display: flex; gap: 8px; align-items: center; }

.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 16px; margin-top: 18px; align-items: start; }
.card { background: var(--surface); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 12px; border: 1px solid var(--line); }
.card h3 { margin-top: 8px; }
.rules { display: flex; flex-direction: column; }
.rule { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.rule input { width: 80px; text-align: center; }
.outgrid { display: grid; grid-template-columns: 40px 64px 64px; gap: 4px 8px; align-items: center; justify-items: center; }
.outgrid > span:nth-child(3n+1) { justify-self: start; }
.cell { width: 44px; height: 36px; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.editlist li { border-bottom: 1px solid var(--line); padding: 6px 0; }
.editlist li:last-child { border-bottom: 0; }
.inline-form { display: flex; gap: 6px; align-items: center; }
.inline-form input { flex: 1.2; min-width: 0; }
.inline-form select { flex: 1; min-width: 0; }
.member { display: flex; align-items: center; gap: 10px; min-height: 44px; }

.loginbox { max-width: 360px; margin: 10vh auto 0; display: flex; flex-direction: column; gap: 16px; }

/* ---------- shopping */

.tabs { display: flex; gap: 4px; margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs a { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 99px; color: var(--muted); text-decoration: none; font-weight: 500; white-space: nowrap; }
.tabs a[aria-current] { background: var(--ink); color: var(--bg); }
.tabs a[aria-current] .count { color: inherit; opacity: .7; }
.shop { max-width: 680px; display: flex; flex-direction: column; gap: 14px; }
.additem .search { background: var(--surface); }
.items { list-style: none; margin: 0; padding: 0; }
.item { display: flex; align-items: center; gap: 6px; border-bottom: 1px solid var(--line); min-height: 54px; }
.item > form { display: flex; }
.tick { width: 44px; height: 50px; border: 0; background: none; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.box { width: 22px; height: 22px; border-radius: 99px; border: 1.5px solid var(--line-strong); display: flex; align-items: center; justify-content: center; color: var(--accent-ink); transition: all .12s; }
.tick:hover .box { border-color: var(--accent); }
.is-done .box, .item.ticking .box { background: var(--accent); border-color: var(--accent); }
.box .i { width: 14px; height: 14px; }
.item.ticking { opacity: .5; }
.item-body { flex: 1; min-width: 0; }
.item-body summary { list-style: none; cursor: pointer; display: flex; flex-direction: column; justify-content: center; min-height: 50px; padding: 4px 0; }
.item-body summary::-webkit-details-marker { display: none; }
.item-name { font-size: 16px; overflow-wrap: anywhere; }
.item-note { font-size: 12px; color: var(--muted); }
.is-done .item-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--faint); }
.item-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px 0 12px; }
.item-edit input[name=name], .item-edit input[name=note] { grid-column: 1 / -1; }
.done-group { margin-top: 8px; }
.done-group > summary { cursor: pointer; color: var(--muted); min-height: 44px; display: flex; align-items: center; font-size: 14px; }
.done-group form { margin-top: 8px; }

.ingredients-form { max-width: 680px; display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pickrow { flex: 1; display: flex; align-items: center; gap: 14px; min-height: 56px; padding: 6px 4px; cursor: pointer; min-width: 0; }
.pickrow .item-body { display: flex; flex-direction: column; }
.pickrow .item-name b { font-weight: 600; }
.is-onlist { opacity: .6; }
.badge { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 500; background: var(--hover); color: var(--muted); white-space: nowrap; }
.notice { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #E7F6EC; color: #1F5E35; font-size: 14px; margin: 0; }
.notice .i { width: 16px; height: 16px; }
.notice a { color: inherit; font-weight: 600; }
@media (prefers-color-scheme: dark) { .notice { background: #1C3324; color: #9FE0B4; } }
.panel .stickybar { background: linear-gradient(to top, var(--surface) 75%, transparent); bottom: -24px; padding-bottom: 24px; }
.panel .segmented { max-width: none; margin: 0; }
.panel .segmented > a { font-size: 13px; white-space: nowrap; padding: 0 6px; }
.ingr .items .item:last-child { border-bottom: 0; }
.stickybar {
  position: sticky; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent);
}
.stickybar select { min-width: 140px; }
@media (max-width: 720px) { .stickybar { bottom: calc(60px + env(safe-area-inset-bottom)); } }
nav.segmented { max-width: 360px; margin-bottom: 10px; }

/* ---------- colours per kind of ingredient (Tag.group) */

.g-veg        { --g-bg: #E1F3D8; --g-ink: #2C6619; --g-line: #9BCB82; --g-dot: #5AAE37; }
.g-legume     { --g-bg: #EBE3FA; --g-ink: #553A92; --g-line: #B9A4E6; --g-dot: #8A64D6; }
.g-fish       { --g-bg: #DDEEFB; --g-ink: #1D5687; --g-line: #93C2EA; --g-dot: #3A8FD6; }
.g-poultry    { --g-bg: #FFEFCF; --g-ink: #7F5200; --g-line: #F0C772; --g-dot: #EBA623; }
.g-meat       { --g-bg: #FCE1DC; --g-ink: #962C1F; --g-line: #EDA397; --g-dot: #DE5A45; }
.g-egg        { --g-bg: #FFF5C2; --g-ink: #6E5900; --g-line: #E8D36A; --g-dot: #E5C320; }
.g-dairy      { --g-bg: #DDF3F2; --g-ink: #1C6763; --g-line: #8ACFCA; --g-dot: #2FA9A0; }
.g-wholegrain { --g-bg: #F2E6D9; --g-ink: #74471E; --g-line: #D3AE88; --g-dot: #B07A45; }
.g-starch     { --g-bg: #F4EEDF; --g-ink: #66552E; --g-line: #D8C99E; --g-dot: #C4A962; }
.g-sweet      { --g-bg: #FCE4F0; --g-ink: #8F2F63; --g-line: #EDA6C9; --g-dot: #DD5C9C; }
.g-form       { --g-bg: #ECEEF1; --g-ink: #434A55; --g-line: #BFC5CE; --g-dot: #8A94A3; }

@media (prefers-color-scheme: dark) {
  .g-veg        { --g-bg: #1F3319; --g-ink: #A9DD92; --g-line: #3F6A30; }
  .g-legume     { --g-bg: #2B2340; --g-ink: #C9B6F2; --g-line: #574385; }
  .g-fish       { --g-bg: #172C3F; --g-ink: #9CCBF2; --g-line: #2F5B82; }
  .g-poultry    { --g-bg: #352A12; --g-ink: #F2CD7E; --g-line: #6E5520; }
  .g-meat       { --g-bg: #3A1D18; --g-ink: #F2AA9E; --g-line: #7A3529; }
  .g-egg        { --g-bg: #332E12; --g-ink: #EEDC7C; --g-line: #6B5F1F; }
  .g-dairy      { --g-bg: #15302E; --g-ink: #8FD8D2; --g-line: #2D625D; }
  .g-wholegrain { --g-bg: #33261A; --g-ink: #DDB993; --g-line: #6B4D30; }
  .g-starch     { --g-bg: #2F2A1C; --g-ink: #DECE9F; --g-line: #625738; }
  .g-sweet      { --g-bg: #3A1D2C; --g-ink: #F2AACD; --g-line: #7A3558; }
  .g-form       { --g-bg: #272B31; --g-ink: #C5CBD4; --g-line: #4D545E; }
}

.dots { display: inline-flex; gap: 3px; margin-right: 6px; vertical-align: 1px; }
.dots i { width: 7px; height: 7px; border-radius: 99px; background: var(--g-dot); }
.tagrow { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-top: 3px; }

.tagrow-form { display: grid; grid-template-columns: 52px minmax(0, 1.3fr) minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 8px 0; }
.tagrow-form .tag { grid-column: 1 / -1; justify-self: start; }
.tagrow-form input, .tagrow-form select { min-width: 0; width: 100%; }
.tag-placeholder { color: var(--faint); background: none; box-shadow: inset 0 0 0 1px dashed var(--line); border: 1px dashed var(--line-strong); }
.emoji-input { width: 52px; text-align: center; padding-left: 4px; padding-right: 4px; }

/* Ingredients: pick everything at once */
.pickall { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 0 4px; border-bottom: 1px solid var(--line); cursor: pointer; font-weight: 500; font-size: 14px; }
.pickall .muted { margin-left: auto; }
.stickybar .btn:disabled { opacity: .45; cursor: default; }

/* Dish details in the side panel */
.dishpanel .picker-head h2 { font-size: 20px; letter-spacing: -0.02em; line-height: 1.25; }
.dishpanel .tags { margin: -4px 0 0; }
.dp-section { display: flex; flex-direction: column; gap: 6px; }
.dishpanel .lines li { font-size: 15px; padding: 8px 0; }
.dishpanel .lines li:last-child { border-bottom: 0; }
.dishpanel .prose { font-size: 15px; line-height: 1.6; }
.dp-empty { padding: 14px; border: 1px dashed var(--line-strong); border-radius: 10px; font-size: 14px; }
.dp-when { padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; gap: 4px; }
.dp-when p { margin: 0; }
.dp-when .muted { display: inline-block; min-width: 128px; }
