/* Weekmenu — "Glas", the Huishoudpot design system (huishoudpot/frontend/DESIGN.md), without a build step.
   Frosted glass over four soft colour glows. Cards are translucent gradients with a light top edge
   (no backdrop-filter on ordinary cards: the glows behind them are already blurred, so long lists
   stay fast); floating things (tab bar, sheets, toasts, the basket bar) do blur what is behind them.
   Text is never translucent. Touchable glass grows a little under a pointer and springs in on press.
   Light and dark follow the system. */

:root {
  --bg: #f3f1fb;
  --text: #1d1d1f;
  --muted: #636368;
  --faint: #8a8a90;
  --line: rgba(23, 22, 43, 0.08);
  --surface: #ffffff;
  --surface-2: rgba(106, 92, 176, 0.07);

  --glass-1: rgba(255, 255, 255, 0.74);
  --glass-2: rgba(255, 255, 255, 0.46);
  --glass-strong: rgba(255, 255, 255, 0.86);
  --glass-edge: rgba(255, 255, 255, 0.85);
  --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(23, 22, 43, 0.05), 0 16px 36px -22px rgba(70, 50, 160, 0.4);
  --glass-shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(23, 22, 43, 0.06), 0 22px 44px -22px rgba(70, 50, 160, 0.5);
  --float-shadow: 0 30px 60px -30px rgba(50, 30, 140, 0.45);
  --glow-1: rgba(140, 110, 255, 0.55);
  --glow-2: rgba(255, 120, 185, 0.42);
  --glow-3: rgba(70, 200, 255, 0.38);
  --glow-4: rgba(255, 175, 95, 0.4);

  --accent: #6a5cb0;
  --accent-ink: #5d5294;
  --accent-2: #e2559a;
  --accent-grad: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 45%, var(--accent-2)));
  --accent-soft: color-mix(in srgb, var(--accent) 12%, transparent);
  --success: #1f7a36;
  --success-soft: rgba(31, 122, 54, 0.11);
  --warning: #b25000;
  --danger: #d70015;
  --offer: #d4380d;
  --offer-soft: rgba(232, 103, 46, 0.13);
  --vega: #1f7a36;
  --vis: #0b78a8;
  --vlees: #b5583a;
  --toast: rgba(23, 22, 43, 0.78);
  --img-bg: #ffffff;

  --radius: 24px;
  --radius-sm: 16px;
  --spring: cubic-bezier(0.2, 1.5, 0.4, 1);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
  --tabbar-space: calc(var(--tabbar-h) + max(12px, var(--safe-bottom)) + 12px);
  --sidebar-space: 0px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1024;
    --text: #e9e9ed;
    --muted: #9397ab;
    --faint: #7c8096;
    --line: rgba(255, 255, 255, 0.08);
    --surface: #232532;
    --surface-2: rgba(255, 255, 255, 0.06);
    --glass-1: rgba(255, 255, 255, 0.1);
    --glass-2: rgba(255, 255, 255, 0.035);
    --glass-strong: rgba(34, 34, 60, 0.82);
    --glass-edge: rgba(255, 255, 255, 0.12);
    --glass-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12), 0 0 0 1px rgba(255, 255, 255, 0.07), 0 18px 40px -22px rgba(0, 0, 0, 0.75);
    --glass-shadow-lift: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 48px -22px rgba(0, 0, 0, 0.85);
    --float-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.8);
    --glow-1: rgba(124, 92, 255, 0.5);
    --glow-2: rgba(255, 90, 170, 0.3);
    --glow-3: rgba(40, 190, 255, 0.26);
    --glow-4: rgba(255, 150, 70, 0.24);
    --accent: #988be0;
    --accent-ink: #d2cefd;
    --accent-2: #ff6fb5;
    --accent-grad: linear-gradient(135deg, #7d6fd6, color-mix(in oklab, #7d6fd6 45%, #ff6fb5));
    --success: #34c759;
    --success-soft: rgba(52, 199, 89, 0.15);
    --warning: #ffb340;
    --danger: #ff5a4f;
    --offer: #ff9466;
    --offer-soft: rgba(255, 137, 92, 0.16);
    --vega: #5fd98a;
    --vis: #5cc4f5;
    --vlees: #f2a27c;
    --toast: rgba(30, 28, 60, 0.78);
    --img-bg: #f4f4f7;
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
html.noscroll { overflow: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif;
  font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; overscroll-behavior-y: none;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { -webkit-user-select: none; user-select: none; }
a { color: var(--accent-ink); text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { -webkit-user-drag: none; }

/* The four glows, fixed behind every screen. Plain radial gradients (no filter), so free while scrolling. */
.backdrop {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(48vmax circle at -6% -8%, var(--glow-1), transparent 62%),
    radial-gradient(36vmax circle at 108% 18%, var(--glow-2), transparent 62%),
    radial-gradient(42vmax circle at 104% 70%, var(--glow-3), transparent 62%),
    radial-gradient(40vmax circle at -8% 96%, var(--glow-4), transparent 62%);
}
.backdrop span { display: none; }

/* --- surfaces ------------------------------------------------------------------------------------ */
.card, .glass {
  background: linear-gradient(145deg, var(--glass-1), var(--glass-2));
  border: 1px solid var(--glass-edge); border-radius: var(--radius); box-shadow: var(--glass-shadow);
}
.glass-strong { background: var(--glass-strong); }
.float {
  background: linear-gradient(145deg, var(--glass-1), var(--glass-2));
  border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow-lift), var(--float-shadow);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
}
.press { transition: transform 320ms var(--spring), box-shadow 200ms ease; cursor: pointer; }
@media (any-hover: hover) { .press:hover { transform: scale(1.02); box-shadow: var(--glass-shadow-lift); } }
.press:active { transform: scale(0.97); transition-duration: 80ms; }

/* --- layout --------------------------------------------------------------------------------------- */
.app { position: relative; z-index: 1; min-height: 100vh; }
.main {
  min-width: 0; padding: calc(var(--safe-top) + 16px) 16px calc(var(--tabbar-space) + 24px);
  padding-left: calc(16px + var(--sidebar-space));
}
.page { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; animation: page-enter 260ms ease-out backwards; }
.page.wide, .page.roomy { max-width: 1180px; }
/* Lists in two columns when there's room (iPad landscape and wider). */
@media (min-width: 1100px) {
  .list.cols { display: grid; grid-template-columns: 1fr 1fr; }
  .list.cols > :nth-child(odd) { border-right: 1px solid var(--line); }
  .list.cols > :nth-child(odd):nth-last-child(-n+2) .item, .list.cols > :nth-child(odd):nth-last-child(-n+2).item,
  .list.cols > :last-child .item, .list.cols > .item:last-child { border-bottom: 0; }
  .list.cols > :only-child { grid-column: 1 / -1; border-right: 0; }
}
@keyframes page-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Phone: a glass pill floating above the home indicator, with a pill that slides to the open tab. */
.tabbar {
  position: fixed; z-index: 20; left: 12px; right: 12px; margin: 0 auto; max-width: 30rem;
  bottom: max(12px, var(--safe-bottom)); height: var(--tabbar-h); border-radius: 28px; padding: 0 6px; display: flex;
}
.tabbar .pill {
  position: absolute; top: 6px; bottom: 6px; border-radius: 22px; pointer-events: none;
  left: calc(6px + var(--i) * (100% - 12px) / var(--n)); width: calc((100% - 12px) / var(--n));
  background: var(--glass-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px color-mix(in srgb, var(--accent) 18%, transparent),
    0 8px 18px -8px color-mix(in srgb, var(--accent) 55%, transparent);
  transition: left 450ms cubic-bezier(0.2, 1.3, 0.4, 1);
}
@media (prefers-color-scheme: dark) {
  .tabbar .pill { background: rgba(255, 255, 255, 0.12); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.1); }
}
.tab {
  position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--muted); font-size: 10.5px; font-weight: 500; letter-spacing: 0.01em; border: 0; background: none; cursor: pointer;
}
.tab svg { width: 23px; height: 23px; transition: scale 320ms var(--spring); }
.tab.active { color: var(--accent-ink); font-weight: 650; }
.tab.active svg { scale: 1.08; stroke-width: 2.3; }
.tab:active svg { scale: 0.86; }
.tab .ico { position: relative; display: inline-flex; }
.badge {
  position: absolute; top: -6px; right: -11px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
  background: var(--accent-grad); color: #fff; font-size: 10.5px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px var(--bg), 0 4px 10px -3px color-mix(in srgb, var(--accent-2) 70%, transparent);
  font-variant-numeric: tabular-nums;
}
.badge.bump { animation: bump 450ms var(--spring); }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.45); } 100% { transform: scale(1); } }

.sidebar { display: none; }

/* iPad and wider: a floating glass sidebar. Icon rail up to 1200px, with names from there. */
@media (min-width: 820px) {
  :root { --sidebar-space: 108px; --tabbar-space: 0px; }
  .tabbar { display: none; }
  .sidebar {
    position: fixed; z-index: 20; display: flex; flex-direction: column; gap: 4px;
    left: 16px; top: calc(var(--safe-top) + 16px); bottom: 16px; width: 76px; padding: 14px 10px; border-radius: 28px;
  }
  .sidebar .brand { display: flex; align-items: center; justify-content: center; height: 48px; margin-bottom: 10px; }
  .sidebar .brand .logo { width: 40px; height: 40px; border-radius: 13px; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px var(--accent); }
  .sidebar .brand img.logo { box-shadow: 0 8px 18px -8px rgba(60, 30, 140, 0.6); }
  .sidebar .brand .name { display: none; }
  .sidebar .tab {
    flex: none; flex-direction: row; justify-content: center; gap: 12px; height: 50px; padding: 0 14px; border-radius: 16px;
    font-size: 15px; font-weight: 550; color: var(--muted); transition: background-color 200ms ease, transform 320ms var(--spring);
  }
  .sidebar .tab span.label { display: none; }
  @media (any-hover: hover) { .sidebar .tab:hover { background: var(--surface-2); transform: scale(1.03); } }
  .sidebar .tab.active, .sidebar .tab.active:hover {
    background: var(--accent-grad); color: #fff;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 22px -10px color-mix(in srgb, var(--accent) 85%, transparent),
      0 0 18px -4px color-mix(in srgb, var(--accent-2) 45%, transparent);
  }
  .sidebar .tab.active svg { scale: 1; }
  .sidebar .spacer { flex: 1; }
  .sidebar .badge { box-shadow: 0 0 0 2px var(--glass-strong); }
  .main { padding: calc(var(--safe-top) + 28px) 28px 40px calc(28px + var(--sidebar-space)); }
  .more-only { display: none !important; }
}
/* Collapsed by default (an icon rail, names in a pill on hover); the button at the bottom opens it,
   remembered per device (<html data-sidebar="open">). Like Huishoudpot. */
@media (min-width: 820px) {
  .sidebar { transition: width 450ms cubic-bezier(0.2, 1.2, 0.4, 1), padding 300ms ease; }
  .main { transition: padding-left 450ms cubic-bezier(0.2, 1.2, 0.4, 1); }
  .sidebar .tab { color: color-mix(in srgb, var(--text) 82%, transparent); }
  .sidebar .tab > .badge { display: none; }
  :root:not([data-sidebar="open"]) .sidebar .tab span.label {
    display: block; position: absolute; left: calc(100% + 12px); top: 50%; transform: translateY(-50%) scale(0.9); transform-origin: left center;
    padding: 7px 12px; border-radius: 999px; white-space: nowrap; font-size: 13.5px; font-weight: 650; color: var(--text);
    background: var(--glass-strong); box-shadow: var(--glass-shadow-lift), 0 10px 24px -12px rgba(40, 20, 120, 0.45);
    -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
    opacity: 0; pointer-events: none; transition: opacity 160ms ease, transform 260ms var(--spring);
  }
  :root:not([data-sidebar="open"]) .sidebar .tab:hover span.label,
  :root:not([data-sidebar="open"]) .sidebar .tab:focus-visible span.label { opacity: 1; transform: translateY(-50%) scale(1); }
  .sidebar .toggle svg { transition: transform 300ms ease; }
  :root[data-sidebar="open"] { --sidebar-space: 268px; }
  :root[data-sidebar="open"] .sidebar { width: 236px; padding: 18px 14px; }
  :root[data-sidebar="open"] .sidebar .brand { justify-content: flex-start; gap: 12px; padding: 0 6px; }
  :root[data-sidebar="open"] .sidebar .brand .name { display: block; font-size: 19px; font-weight: 750; letter-spacing: -0.3px; }
  :root[data-sidebar="open"] .sidebar .tab { justify-content: flex-start; font-weight: 600; }
  :root[data-sidebar="open"] .sidebar .tab span.label { display: inline; }
  /* The names take the colour of their button (white on the active one), not the muted .label style. */
  :root[data-sidebar="open"] .sidebar .tab span.label { color: inherit; font-size: 15.5px; font-weight: 600; letter-spacing: -0.1px; }
  :root[data-sidebar="open"] .sidebar .tab:not(.active) { color: var(--text); }
  :root[data-sidebar="open"] .sidebar .tab:not(.active) svg { color: var(--accent-ink); }
  :root[data-sidebar="open"] .sidebar .tab > .badge { display: inline-block; position: static; margin-left: auto; box-shadow: none; }
  :root[data-sidebar="open"] .sidebar .tab.active .badge { background: rgba(255, 255, 255, 0.28); }
  :root[data-sidebar="open"] .sidebar .tab .ico .badge { display: none; }
  :root[data-sidebar="open"] .sidebar .toggle svg { transform: rotate(180deg); }
}

/* Two columns on wide screens (iPad landscape): list + detail. */
.split { display: grid; gap: 16px; }
@media (min-width: 1080px) {
  .split { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .split > .sticky { position: sticky; top: 24px; }
}
.grid2 { display: grid; gap: 14px; }
@media (min-width: 820px) { .grid2 { grid-template-columns: 1fr 1fr; align-items: start; } }

/* --- typography & header ------------------------------------------------------------------------- */
.head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 2px 2px; }
.eyebrow { font-size: 13px; color: var(--muted); font-weight: 500; }
h1 { margin: 2px 0 0; font-size: 30px; font-weight: 800; letter-spacing: -0.7px; line-height: 1.1; }
h2 { margin: 8px 4px 0; font-size: 18px; font-weight: 700; letter-spacing: -0.2px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
h2 .aside { font-size: 14px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
h3 { margin: 0; font-size: 17px; font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.row-gap { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; display: inline-flex; align-items: center; gap: 6px; }
.kicker svg { width: 15px; height: 15px; }
.text-grad {
  background: linear-gradient(100deg, var(--text) 12%, var(--accent) 58%, var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* --- controls ------------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--glass-edge);
  background: linear-gradient(145deg, var(--glass-1), var(--glass-2)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5), 0 0 0 1px var(--line);
  color: var(--text); font-weight: 650; cursor: pointer; text-decoration: none;
  transition: transform 320ms var(--spring), filter 150ms ease;
}
@media (any-hover: hover) { .btn:hover:not(:disabled) { transform: scale(1.04); } }
.btn:active:not(:disabled) { transform: scale(0.95); transition-duration: 80ms; }
.btn.primary {
  background: var(--accent-grad); color: #fff; border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 22px -12px color-mix(in srgb, var(--accent) 90%, transparent);
}
.btn.ghost { background: none; border-color: transparent; box-shadow: none; color: var(--accent-ink); }
.btn.danger { color: var(--danger); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; gap: 4px; }
.btn.small svg { width: 16px; height: 16px; }
.btn.big { min-height: 52px; font-size: 16px; }
.btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 22px; border: 0; color: var(--text); cursor: pointer;
  background: linear-gradient(145deg, var(--glass-strong), var(--glass-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 0 0 1px color-mix(in srgb, var(--accent) 16%, transparent), 0 4px 10px -5px rgba(70, 50, 160, 0.35);
  transition: transform 320ms var(--spring);
}
@media (prefers-color-scheme: dark) {
  .icon-btn { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), 0 0 0 1px rgba(255, 255, 255, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.6); }
}
.icon-btn.plain { background: none; box-shadow: none; color: var(--muted); }
.icon-btn.accent { background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 18px -8px var(--accent); }
@media (any-hover: hover) { .icon-btn:hover:not(:disabled) { transform: scale(1.06); } }
.icon-btn:active:not(:disabled) { transform: scale(0.9); transition-duration: 80ms; }
.icon-btn:disabled { opacity: 0.5; cursor: default; }
.icon-btn svg, .btn svg { width: 19px; height: 19px; }

.segmented {
  display: flex; gap: 2px; padding: 4px; border-radius: 999px; position: relative;
  background: var(--glass-2); box-shadow: inset 0 1px 2px rgba(23, 22, 43, 0.07), 0 0 0 1px var(--line);
}
.segmented button {
  flex: 1; min-height: 36px; border: 0; border-radius: 999px; background: transparent; font-weight: 600; font-size: 14px;
  color: var(--muted); cursor: pointer; padding: 0 12px; transition: background 250ms ease, color 200ms ease, transform 320ms var(--spring);
}
.segmented button:active { transform: scale(0.95); }
.segmented button.on { background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -8px var(--accent); }

.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 -16px; padding: 2px 16px 4px; scroll-padding: 16px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--glass-edge); background: linear-gradient(145deg, var(--glass-1), var(--glass-2)); box-shadow: 0 0 0 1px var(--line);
  font-weight: 600; font-size: 13.5px; color: var(--text); cursor: pointer; transition: transform 320ms var(--spring);
}
.chip svg { width: 15px; height: 15px; color: var(--muted); }
.chip:active { transform: scale(0.94); }
.chip.on { background: var(--accent-grad); color: #fff; border-color: transparent; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.chip.on svg { color: #fff; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 650;
  white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.tag svg { width: 12px; height: 12px; }
.tag.offer { background: var(--offer-soft); color: var(--offer); }
.tag.vega { color: var(--vega); background: color-mix(in srgb, var(--vega) 13%, transparent); }
.tag.vis { color: var(--vis); background: color-mix(in srgb, var(--vis) 13%, transparent); }
.tag.vlees { color: var(--vlees); background: color-mix(in srgb, var(--vlees) 14%, transparent); }
.tag.ok { color: var(--success); background: var(--success-soft); }
.tag.accent { color: var(--accent-ink); background: var(--accent-soft); }

.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 13px; font-weight: 600; color: var(--muted); }
.input {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px; outline: none; color: var(--text);
  border: 1px solid var(--line); background: color-mix(in srgb, var(--surface) 55%, transparent);
  box-shadow: inset 0 1px 2px rgba(23, 22, 43, 0.06); transition: border-color 150ms ease, box-shadow 150ms ease;
}
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea.input { padding: 10px 14px; min-height: 84px; resize: vertical; }

.search {
  display: flex; align-items: center; gap: 10px; padding: 0 6px 0 16px; min-height: 52px; border-radius: 999px; position: relative;
  transition: box-shadow 200ms ease;
}
.search:focus-within { box-shadow: var(--glass-shadow-lift), 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.search > svg { width: 20px; height: 20px; flex-shrink: 0; color: var(--muted); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; outline: none; min-height: 48px; font-size: 16px; }
.search input::-webkit-search-cancel-button { display: none; }
.search .icon-btn { width: 38px; height: 38px; }
.search-wrap { position: sticky; z-index: 6; top: calc(var(--safe-top) + 8px); }
/* A haze behind the sticky search, so what scrolls under it fades out instead of peeking above it. */
/* No colour of its own (that showed as a box on the gradient background): a blur of what's behind,
   fading out at the bottom, so it blends into any background. */
.search-wrap::before {
  content: ""; position: absolute; z-index: -1; left: -28px; right: -28px; pointer-events: none;
  top: calc(-8px - var(--safe-top)); bottom: -18px;
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  -webkit-mask-image: linear-gradient(to bottom, #000 55%, transparent); mask-image: linear-gradient(to bottom, #000 55%, transparent);
}
.search-wrap .search { -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%); background: var(--glass-strong); }

.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--surface-2); padding: 3px; box-shadow: 0 0 0 1px var(--line); }
.stepper button { width: 38px; height: 38px; border: 0; border-radius: 19px; background: transparent; font-size: 19px; font-weight: 700; cursor: pointer; color: var(--accent-ink); }
.stepper button:active { background: var(--accent-soft); }
.stepper span { min-width: 46px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }

.switch { width: 56px; height: 44px; border: 0; padding: 0; background: transparent; display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.switch i {
  width: 50px; height: 30px; border-radius: 15px; background: color-mix(in srgb, var(--text) 14%, transparent); display: flex; align-items: center; padding: 3px;
  transition: background 250ms ease; box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.12);
}
.switch i::after { content: ""; width: 24px; height: 24px; border-radius: 12px; background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25); transition: transform 380ms var(--spring); }
.switch.on i { background: var(--accent-grad); }
.switch.on i::after { transform: translateX(20px); }

/* --- lists ------------------------------------------------------------------------------------------ */
.list { overflow: hidden; padding: 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); min-height: 60px; }
.item:last-child { border-bottom: 0; }
.item .grow { flex: 1; min-width: 0; }
.item .title { font-weight: 600; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item .title.wrap { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.item.link { cursor: pointer; transition: background-color 150ms ease; }
@media (any-hover: hover) { .item.link:hover { background: var(--surface-2); } }
.item.link:active { background: var(--surface-2); }
.item.dim .title { color: var(--faint); }
.sub > span + span:not(.tag)::before { content: "· "; }
.qty { min-width: 36px; height: 36px; flex-shrink: 0; border-radius: 12px; background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.price { text-align: right; flex-shrink: 0; font-weight: 700; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.price s { display: block; font-weight: 500; font-size: 11.5px; color: var(--faint); }
.price.offer { color: var(--offer); }

.day { width: 42px; height: 46px; border-radius: 14px; text-align: center; flex-shrink: 0; display: flex; flex-direction: column; justify-content: center; background: var(--surface-2); }
.day b { display: block; font-size: 18px; font-weight: 750; line-height: 1.05; }
.day small { font-size: 10.5px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px; }
.item.today .day { background: var(--accent-grad); color: #fff; box-shadow: 0 6px 14px -8px var(--accent); }
.item.today .day small { color: rgba(255, 255, 255, 0.85); }
.item.selected { background: var(--accent-soft); }
.rimg { width: 52px; height: 52px; border-radius: 14px; object-fit: cover; flex-shrink: 0; background: var(--surface-2); animation: img-in 300ms ease-out both; }

/* --- products ------------------------------------------------------------------------------------ */
.pimg { width: 52px; height: 52px; flex-shrink: 0; border-radius: 14px; background: var(--img-bg); overflow: hidden; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px var(--line); }
.pimg img { width: 100%; height: 100%; object-fit: contain; padding: 4px; animation: img-in 300ms ease-out both; }
@keyframes img-in { from { opacity: 0; } to { opacity: 1; } }
.pimg-ph { color: color-mix(in srgb, var(--accent) 45%, #b0b0c0); display: flex; }
.pimg-ph svg { width: 45%; height: 45%; min-width: 20px; min-height: 20px; margin: auto; }
.pimg.big { width: 100%; height: auto; aspect-ratio: 1; border-radius: 18px; }
.pimg.big img { padding: 12%; }
.pimg.hero { width: 100%; height: 240px; border-radius: 22px; }
.pimg.hero img { padding: 20px; }
.pimg.small { width: 40px; height: 40px; border-radius: 11px; }

.pprice { display: inline-flex; flex-direction: column; line-height: 1; font-variant-numeric: tabular-nums; }
.pprice b { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; }
.pprice b sup { font-size: 0.62em; font-weight: 800; margin-left: 1px; vertical-align: 0.42em; }
.pprice s { font-size: 11.5px; font-weight: 500; color: var(--faint); margin-top: 3px; }
.pprice.offer b { color: var(--offer); }
.pprice.lg b { font-size: 30px; }
.pprice.muted { font-size: 12px; font-weight: 500; }

.pgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .pgrid { grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); } }
.pcard { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 8px 8px 10px; border-radius: 22px; text-align: left; }
.pcard .pimg { box-shadow: none; }
.pcard .ptitle { font-size: 14px; font-weight: 600; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.5em; margin: 0 4px; }
.pcard .psub { font-size: 12px; color: var(--muted); margin: -4px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.pcard .pfoot { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; margin: auto 2px 0 4px; min-height: 40px; }
.pcard .promo { position: absolute; top: 14px; left: 14px; z-index: 1; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis;
  background: #dc4a1a; color: #fff; box-shadow: 0 4px 10px -4px rgba(220, 74, 26, 0.7); }
.pcard.in-basket { box-shadow: var(--glass-shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 50%, transparent); }
.pcard.unavailable .pimg img { opacity: 0.4; filter: grayscale(1); }

.add-btn {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 20px; border: 0; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 16px -8px var(--accent);
  transition: transform 320ms var(--spring);
}
.add-btn svg { width: 20px; height: 20px; stroke-width: 2.4; }
@media (any-hover: hover) { .add-btn:hover { transform: scale(1.1); } }
.add-btn:active { transform: scale(0.85); transition-duration: 80ms; }
.add-btn.compact { width: 36px; height: 36px; }
.qty-ctl {
  display: inline-flex; align-items: center; height: 40px; border-radius: 20px; padding: 2px; flex-shrink: 0;
  background: var(--accent-grad); color: #fff; box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 8px 16px -8px var(--accent);
  animation: qty-in 380ms var(--spring);
}
@keyframes qty-in { from { transform: scale(0.7); opacity: 0.4; } to { transform: none; opacity: 1; } }
.qty-ctl button { width: 36px; height: 36px; border: 0; border-radius: 18px; background: transparent; color: #fff; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.qty-ctl button:active:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.qty-ctl button:disabled { opacity: 0.45; cursor: default; }
.qty-ctl button svg { width: 17px; height: 17px; stroke-width: 2.4; }
.qty-ctl .n { min-width: 22px; text-align: center; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; animation: num-pop 380ms var(--spring); }
@keyframes num-pop { 0% { transform: scale(1.5); } 100% { transform: scale(1); } }
.qty-ctl.compact { height: 36px; }
.qty-ctl.compact button { width: 32px; height: 32px; }
.pgrid .qty-ctl { min-width: 0; }

/* Basket bar on the search screen: what is in the basket, one tap away. */
.cartbar {
  position: sticky; z-index: 6; bottom: calc(var(--tabbar-space) + 4px); margin-top: 4px;
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 18px; border-radius: 999px; text-decoration: none; color: var(--text);
  animation: rise 380ms var(--spring) backwards;
}
@media (min-width: 820px) { .cartbar { bottom: 20px; } }
.cartbar .what { flex: 1; min-width: 0; line-height: 1.2; }
.cartbar .what b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.cartbar .what small { color: var(--muted); font-size: 12.5px; }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }

.section-head { display: flex; justify-content: space-between; align-items: center; margin: 6px 4px -2px; gap: 8px; }
.section-head h2 { margin: 0; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(150px, 42%); gap: 12px; overflow-x: auto; scrollbar-width: none;
  margin: 0 -16px; padding: 4px 16px 10px; scroll-snap-type: x mandatory; scroll-padding: 16px; }
/* Rows that scroll sideways fade out at the ends instead of a hard edge. */
.rail, .chips.scroll {
  --fade: 22px;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
  mask-image: linear-gradient(to right, transparent, #000 var(--fade), #000 calc(100% - var(--fade)), transparent);
}
.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }
@media (min-width: 560px) { .rail { grid-auto-columns: 180px; } }
@media (min-width: 820px) {
  .rail { --fade: 28px; margin: 0 -28px; padding: 4px 28px 14px; scroll-padding: 28px; }
}

/* --- cards ------------------------------------------------------------------------------------------ */
.pad { padding: 16px 18px; }
.budget .amount { font-size: 34px; font-weight: 800; letter-spacing: -0.8px; line-height: 1.15; font-variant-numeric: tabular-nums; }
.budget .amount small { font-size: 16px; color: var(--muted); font-weight: 600; letter-spacing: 0; -webkit-text-fill-color: var(--muted); }
.bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: color-mix(in srgb, var(--text) 9%, transparent); gap: 2px; margin: 12px 0 10px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1); }
.bar i { display: block; height: 100%; border-radius: 5px; animation: bar-grow 1100ms cubic-bezier(0.2, 0.9, 0.3, 1) both; }
@keyframes bar-grow { from { width: 0; } }
.legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); flex-wrap: wrap; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend b { width: 9px; height: 9px; border-radius: 5px; display: inline-block; }
.c-fixed { background: var(--vis); }
.c-menu { background: var(--accent-grad); }
.c-loose { background: var(--offer); }
.over { color: var(--danger) !important; }
.good { color: var(--success); }

.empty { text-align: center; padding: 32px 22px; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.empty p { margin: 0; color: var(--muted); max-width: 360px; font-size: 14px; }
.empty-icon { width: 56px; height: 56px; border-radius: 28px; display: flex; align-items: center; justify-content: center; color: var(--accent-ink); background: var(--accent-soft); }
.empty-icon svg { width: 26px; height: 26px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; font-size: 14px; }
.notice > svg, .notice > span:first-child > svg { width: 19px; height: 19px; flex-shrink: 0; margin-top: 1px; color: var(--warning); }
.notice.info > svg { color: var(--accent); }
.tip { display: flex; flex-direction: column; gap: 10px; box-shadow: var(--glass-shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--offer) 35%, transparent); }

.hero-recipe { overflow: hidden; }
.hero-recipe img { width: 100%; height: 220px; object-fit: cover; display: block; }
.check { width: 26px; height: 26px; border-radius: 13px; border: 2px solid color-mix(in srgb, var(--text) 28%, transparent); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  transition: transform 300ms var(--spring); }
.check.on { background: linear-gradient(135deg, #4ce08a, #14a862); border-color: transparent; color: #fff; box-shadow: 0 0 12px rgba(52, 199, 120, 0.45); transform: scale(1.05); }
.check svg { width: 15px; height: 15px; stroke-width: 2.6; }
.steps { padding: 6px 0; }
.step { display: flex; gap: 12px; padding: 10px 16px; }
.step > b { width: 28px; height: 28px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-ink); display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; }

.footer-bar {
  position: sticky; bottom: calc(var(--tabbar-space) + 4px); z-index: 5;
  display: flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px; border-radius: 28px;
}
@media (min-width: 820px) { .footer-bar { bottom: 20px; } }

.progress { display: flex; flex-direction: column; gap: 10px; }
.progress .track { height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--text) 10%, transparent); overflow: hidden; }
.progress .track i { display: block; height: 100%; width: 35%; background: var(--accent-grad); border-radius: 3px; animation: slide 1.4s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }
.spin { animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Skeletons while loading: same shape as what comes. */
.skel { display: block; border-radius: 8px; background: linear-gradient(90deg, var(--surface-2) 0%, color-mix(in srgb, var(--text) 10%, transparent) 50%, var(--surface-2) 100%);
  background-size: 200% 100%; animation: shimmer 1.2s ease-in-out infinite; }
.skel.thumb { width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0; }
.skel.line { height: 12px; margin: 5px 0; width: 70%; }
.skel.line.short { width: 40%; }
.skel.square { width: 100%; aspect-ratio: 1; border-radius: 18px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-top) + 12px); transform: translateX(-50%);
  padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 14px; max-width: calc(100vw - 32px); color: #fff;
  background: var(--toast); box-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 20px 40px -16px rgba(0, 0, 0, 0.5);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  animation: toast-in 480ms var(--spring);
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -18px) scale(0.94); } to { opacity: 1; transform: translateX(-50%); } }

/* Sheet: from the bottom on a phone, a centered dialog on a wide screen. */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(15, 12, 40, 0.32); display: flex; align-items: flex-end; justify-content: center; animation: fade 200ms ease-out; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: relative; width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; outline: none;
  padding: 14px 18px calc(18px + var(--safe-bottom)); border-radius: 28px 28px 0 0;
  background: var(--glass-strong); border: 1px solid var(--glass-edge); box-shadow: var(--glass-shadow-lift), 0 -20px 60px -20px rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(30px) saturate(180%); backdrop-filter: blur(30px) saturate(180%);
  animation: sheet-up 420ms cubic-bezier(0.2, 1.1, 0.4, 1);
  display: flex; flex-direction: column; gap: 14px;
}
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: none; } }
.sheet .grabber { width: 38px; height: 5px; border-radius: 3px; background: color-mix(in srgb, var(--text) 22%, transparent); margin: -4px auto 0; }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; }
@media (min-width: 820px) {
  .scrim { align-items: center; }
  .sheet { border-radius: 28px; padding-bottom: 22px; animation: pop-in 320ms var(--spring); }
  .sheet .grabber { display: none; }
}
@keyframes pop-in { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }

.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; position: relative; z-index: 1; }
.login .card { width: 100%; max-width: 380px; padding: 28px 24px; display: flex; flex-direction: column; gap: 16px; animation: pop-in 420ms var(--spring); }
.login .logo { width: 56px; height: 56px; border-radius: 18px; background: var(--accent-grad); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 12px 24px -10px var(--accent); }
.login .logo svg { width: 30px; height: 30px; }
.select {
  appearance: none; -webkit-appearance: none; min-height: 40px; padding: 0 34px 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; max-width: 100%;
  background: var(--glass-1) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
}
.select.on { background-color: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.plan-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; min-height: 60px; }
.plan-row:last-child { border-bottom: 0; }
.plan-row .dayname { width: 92px; font-weight: 600; }
.plan-row .select { flex: 1; min-width: 150px; }
.plan-row .input { flex-basis: 100%; min-height: 42px; }
.plan-row .hint { flex-basis: 100%; font-size: 12.5px; color: var(--muted); margin-top: -4px; padding-left: 102px; }
@media (max-width: 420px) { .plan-row .hint { padding-left: 0; } }

.link-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; min-height: 60px; color: var(--text); border-bottom: 1px solid var(--line); }
.link-row:last-child { border-bottom: 0; }
.link-row .ico { width: 36px; height: 36px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.link-row .ico svg { width: 19px; height: 19px; }
.link-row > svg { width: 18px; height: 18px; color: var(--faint); margin-left: auto; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .card, .glass, .float, .sheet, .search-wrap .search { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .card, .glass, .float { background: var(--surface); border-color: var(--faint); }
  .text-grad { background: none; color: var(--text); }
}

/* ============================================================================================
   Beweging en verfijning (like Huishoudpot): sections assemble themselves, the segmented pill
   springs, adding to the basket bursts and flies to the tab, rings fill, checks pop.
   Everything has a reduced-motion override at the end.
   ============================================================================================ */

/* Floating chrome: less see-through, so bright product photos don't wash out the tab bar. */
:root { --chrome: rgba(255, 255, 255, 0.78); }
@media (prefers-color-scheme: dark) { :root { --chrome: rgba(24, 24, 48, 0.82); } }
.tabbar, .sidebar { background: linear-gradient(145deg, var(--chrome), color-mix(in srgb, var(--chrome) 85%, transparent)); }
.tab { color: color-mix(in srgb, var(--text) 62%, transparent); }

/* Sections and list items assemble themselves: fade + rise, one after the other. */
@keyframes rise-in { from { opacity: 0; transform: translateY(14px) scale(0.985); } to { opacity: 1; transform: none; } }
.page > *, .pgrid > *, .rail > *, .list > .item, .list > div, .list > .link-row, .grid2 > * {
  animation: rise-in 520ms cubic-bezier(0.2, 0.9, 0.3, 1) backwards;
}
.page { animation: none; }
.page > :nth-child(2), .pgrid > :nth-child(2), .rail > :nth-child(2), .list > :nth-child(2), .grid2 > :nth-child(2) { animation-delay: 50ms; }
.page > :nth-child(3), .pgrid > :nth-child(3), .rail > :nth-child(3), .list > :nth-child(3) { animation-delay: 100ms; }
.page > :nth-child(4), .pgrid > :nth-child(4), .rail > :nth-child(4), .list > :nth-child(4) { animation-delay: 150ms; }
.page > :nth-child(5), .pgrid > :nth-child(5), .rail > :nth-child(5), .list > :nth-child(5) { animation-delay: 200ms; }
.page > :nth-child(6), .pgrid > :nth-child(6), .rail > :nth-child(6), .list > :nth-child(6) { animation-delay: 240ms; }
.page > :nth-child(7), .pgrid > :nth-child(7), .list > :nth-child(7) { animation-delay: 280ms; }
.page > :nth-child(n+8), .pgrid > :nth-child(8), .list > :nth-child(n+8) { animation-delay: 320ms; }
.pgrid > :nth-child(n+9) { animation-delay: 360ms; }
/* Sticky/fixed children must not move while they appear. */
.page > .search-wrap, .page > .scrim { animation: none; }

/* Segmented control: a gradient pill that springs to the chosen option. */
.segmented { isolation: isolate; }
.segmented .seg-pill {
  position: absolute; z-index: -1; top: 4px; bottom: 4px; border-radius: 999px;
  left: calc(4px + var(--i) * (100% - 8px) / var(--n)); width: calc((100% - 8px) / var(--n));
  background: var(--accent-grad); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.3), 0 6px 14px -8px var(--accent);
  transition: left 460ms cubic-bezier(0.2, 1.35, 0.4, 1);
}
.segmented button { position: relative; transition: color 250ms ease, transform 320ms var(--spring); }
.segmented button.on { background: transparent; box-shadow: none; color: #fff; }
.segmented button { flex: 1 1 0; }

/* Add to basket: ring + sparks around the button, and the picture flying to the basket tab. */
.qty-wrap { position: relative; display: inline-flex; flex-shrink: 0; }
.burst { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.burst-ring { position: absolute; inset: 0; border-radius: 999px; border: 2px solid #b48bff; animation: burst-ring 600ms ease-out forwards; }
.spark { position: absolute; left: 50%; top: 50%; width: 9px; height: 9px; border-radius: 5px; animation: spark 720ms cubic-bezier(0.15, 0.8, 0.3, 1) forwards; }
@keyframes burst-ring { 0% { transform: scale(0.7); opacity: 0.9; } 100% { transform: scale(2.2); opacity: 0; } }
@keyframes spark {
  0% { transform: translate(-50%, -50%) scale(1.2); opacity: 1; }
  70% { opacity: 1; }
  100% { transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.2); opacity: 0; }
}
.add-btn { animation: none; }
.add-btn:active { animation: none; }
.qty-wrap .add-btn:focus-visible { outline-offset: 3px; }
.fly {
  position: fixed; z-index: 70; pointer-events: none; border-radius: 16px; object-fit: contain; padding: 6px;
  background: var(--img-bg); box-shadow: 0 12px 30px -8px rgba(60, 30, 140, 0.55), 0 0 0 1px var(--line);
}
span.fly { background: var(--accent-grad); border-radius: 999px; padding: 0; width: 28px !important; height: 28px !important; }
[data-basket-target].catch { animation: catch 520ms var(--spring); }
@keyframes catch { 0% { transform: scale(1); } 30% { transform: scale(1.35) rotate(-8deg); } 60% { transform: scale(0.92) rotate(4deg); } 100% { transform: none; } }

/* The tick in a recipe: balloons and settles, with the burst around it. */
.check.on { animation: check-pop 600ms cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes check-pop { 0% { transform: scale(1); } 30% { transform: scale(1.35); } 55% { transform: scale(0.88); } 75% { transform: scale(1.06); } 100% { transform: scale(1.05); } }
.item .check + .burst .burst-ring { border-color: #4ce08a; }

/* Budget ring: fills from 0 when the card appears. */
.ring { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ring svg { position: absolute; inset: 0; }
.ring-track { stroke: color-mix(in srgb, var(--text) 10%, transparent); }
.ring-fill { stroke: url(#ring-grad); transition: stroke-dashoffset 1200ms cubic-bezier(0.2, 0.9, 0.3, 1); filter: drop-shadow(0 0 4px color-mix(in srgb, var(--accent-2) 45%, transparent)); }
.ring-fill.over { stroke: var(--danger); }
.ring-label { font-size: 13px; font-weight: 700; }

/* Rows react to a tap; recipe info cross-fades when a day is swapped. */
.item.link { transition: background-color 150ms ease, transform 260ms var(--spring); }
.item.link:active { transform: scale(0.985); }
.swap-in { animation: swap-in 420ms cubic-bezier(0.2, 0.9, 0.3, 1) backwards; }
@keyframes swap-in { from { opacity: 0; transform: translateX(14px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* Generating the menu: the sparkle breathes. */
.breathe svg { animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1) rotate(0); opacity: 0.85; } 50% { transform: scale(1.18) rotate(12deg); opacity: 1; } }

/* Lines that change in the basket get a short highlight. */
.flash { animation: flash 900ms ease-out; }
@keyframes flash { from { background: var(--accent-soft); } to { background: transparent; } }

/* Primary buttons: a soft sheen passes over them when pressed. */
.btn.primary, .add-btn, .icon-btn.accent { position: relative; overflow: hidden; }
.btn.primary::after, .add-btn::after, .icon-btn.accent::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; transform: translateX(-120%);
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.35) 50%, transparent 70%);
}
.btn.primary:active::after, .add-btn:active::after, .icon-btn.accent:active::after { transform: translateX(120%); transition: transform 500ms ease; }

@media (prefers-reduced-motion: reduce) {
  .page > *, .pgrid > *, .rail > *, .list > *, .grid2 > *, .check.on, .swap-in, .breathe svg, .flash, [data-basket-target].catch { animation: none !important; }
  .segmented .seg-pill, .ring-fill { transition: none !important; }
  .burst, .fly { display: none !important; }
}

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.88em; background: var(--surface-2); padding: 1px 6px; border-radius: 6px; word-break: break-all; }
ol.steps .step span { min-width: 0; }

/* The cart of points of light (js/cart.js) and the opening screen with it. */
.cart-anim { display: inline-block; flex-shrink: 0; position: relative; }
.splash { position: fixed; inset: 0; z-index: 90; overflow: hidden; background: var(--bg); transition: opacity 600ms ease 350ms, backdrop-filter 600ms ease; }
.splash .backdrop { position: absolute; }
.splash.leaving { opacity: 0; pointer-events: none; }
.splash-text { position: absolute; left: 0; right: 0; text-align: center; display: flex; flex-direction: column; gap: 4px; pointer-events: none; }
.splash-text b { font-size: 20px; font-weight: 750; letter-spacing: -0.3px; }
.splash-text span { font-size: 14px; color: var(--muted); animation: fade 400ms ease-out; }
.splash.leaving .splash-text { opacity: 0; transform: translateY(8px); transition: opacity 250ms ease, transform 250ms ease; }
@media (prefers-reduced-motion: reduce) { .splash, .splash-text, .splash-text span { transition: none !important; animation: none !important; } }

/* iPhone zoom: iOS zooms in when a field with text under 16px gets focus, and on a quick double tap
   (two taps on +). Both left the page zoomed in. Fields are 16px, double-tap zoom is off, and nothing
   may stick out sideways (that made the page zoom out). Pinching yourself still works. */
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
input, select, textarea, .input, .select { font-size: 16px !important; }
.input, .select { min-width: 0; }
.app, .login { overflow-x: clip; }
.main { max-width: 100vw; }
/* What comes after a cart stays readable on top of its (wider, transparent) canvas. */
.cart-anim ~ * { position: relative; z-index: 1; }

/* Nutrition: kcal big, then protein / carbs / fat with a split bar (by energy). */
:root { --protein: #3b82f6; --carbs: #f59e0b; --fat: #e2559a; }
.c-protein { background: var(--protein); }
.c-carbs { background: var(--carbs); }
.c-fat { background: var(--fat); }
.nutrition { display: flex; flex-direction: column; gap: 12px; }
.nutri-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr 1fr; gap: 8px; }
.nutri { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nutri b { font-size: 18px; font-weight: 750; white-space: nowrap; }
.nutri.nutri-main b { font-size: 26px; letter-spacing: -0.5px; }
.nutri span { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.nutri span i, .nutri-strip i { width: 8px; height: 8px; border-radius: 4px; display: inline-block; flex-shrink: 0; }
@media (max-width: 400px) { .nutri-grid { grid-template-columns: 1fr 1fr; } }
.macro-bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; gap: 2px; background: var(--surface-2); }
.macro-bar i { display: block; height: 100%; animation: bar-grow 1000ms cubic-bezier(0.2, 0.9, 0.3, 1) both; }
.nutri-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13.5px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.nutri-strip span { display: inline-flex; align-items: center; gap: 5px; }
.nutri-strip small { flex-basis: 100%; color: var(--muted); font-size: 12px; }
.item > svg, .item.link > svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--faint); }

/* Settings (Gezin): one column on a phone; on a big screen a sticky index on the left and the
   sections in a comfortable reading width. The save bar floats at the bottom. */
.settings { display: block; }
.settings-nav { display: none; }
.settings-body { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.settings-body > h2 { scroll-margin-top: 24px; }
.save-bar .small b { color: var(--warning); }
.save-bar.dirty { box-shadow: var(--glass-shadow-lift), var(--float-shadow), inset 0 0 0 1.5px color-mix(in srgb, var(--warning) 45%, transparent); }
@media (min-width: 1000px) {
  .settings { display: grid; grid-template-columns: 230px minmax(0, 760px); gap: 28px; align-items: start; }
  .settings-nav { display: flex; flex-direction: column; gap: 4px; position: sticky; top: 28px; padding: 10px; border-radius: 22px; }
  .settings-nav .tab { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px; height: 44px; padding: 0 12px;
    border-radius: 14px; font-size: 14.5px; font-weight: 600; color: var(--text); }
  .settings-nav .tab svg { width: 19px; height: 19px; color: var(--accent-ink); }
  @media (any-hover: hover) { .settings-nav .tab:hover { background: var(--surface-2); } }
  .settings-body > h2 { margin-top: 18px; }
  .settings-body > h2:first-child { margin-top: 4px; }
}

/* Making the week menu: a dialog with the big cart, the steps and what happens now. */
.gen-scrim { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 12, 40, 0.38); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); animation: fade 250ms ease-out; }
.gen-card { width: 100%; max-width: 440px; border-radius: 30px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 14px;
  align-items: stretch; text-align: center; background: var(--glass-strong); animation: pop-in 420ms var(--spring); max-height: 92vh; overflow-y: auto; }
.gen-cart { display: flex; align-items: center; justify-content: center; position: relative; }
.gen-done { width: 96px !important; height: 96px !important; border-radius: 48px !important; animation: check-pop 700ms cubic-bezier(0.2, 1.6, 0.4, 1); }
.gen-done svg { width: 46px !important; height: 46px !important; }
.gen-title { font-size: 21px; letter-spacing: -0.3px; }
.gen-now { min-height: 2.6em; color: var(--accent-ink); font-weight: 600; font-size: 15px; animation: fade 350ms ease-out; }
.gen-steps { list-style: none; margin: 0; padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: var(--surface-2); border-radius: 18px; }
.gen-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--faint); transition: color 300ms ease; }
.gen-steps li.now { color: var(--text); font-weight: 650; }
.gen-steps li.done { color: var(--muted); }
.gen-steps .dot { width: 22px; height: 22px; border-radius: 11px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  border: 2px solid color-mix(in srgb, var(--text) 18%, transparent); }
.gen-steps li.done .dot { background: linear-gradient(135deg, #4ce08a, #14a862); border-color: transparent; color: #fff; animation: check-pop 500ms var(--spring); }
.gen-steps li.done .dot svg { width: 13px; height: 13px; stroke-width: 3; }
.gen-steps li.now .dot { border-color: var(--accent); }
.gen-steps li.now .dot i { width: 10px; height: 10px; border-radius: 5px; background: var(--accent-grad); animation: breathe 1.2s ease-in-out infinite; }
.gen-note { text-align: left; }
.card.link { cursor: pointer; }
@media (prefers-reduced-motion: reduce) { .gen-card, .gen-scrim, .gen-steps li.now .dot i { animation: none !important; } }

/* Favourites: a heart that fills and pops. */
svg.filled { fill: currentColor; }
.icon-btn.fav { color: var(--muted); }
.icon-btn.fav.on { color: #e2355f; }
.icon-btn.fav.on svg { animation: check-pop 600ms cubic-bezier(0.2, 1.6, 0.4, 1); }
.fav-wrap .burst-ring { border-color: #ff6f91; }
.hero-fav { position: absolute; top: 12px; right: 12px; z-index: 2; }
.fav-dot { color: #e2355f; display: inline-flex; vertical-align: -2px; }
.fav-dot svg { width: 15px; height: 15px; fill: currentColor; }
.nutri-parts summary { cursor: pointer; font-size: 13.5px; font-weight: 600; color: var(--accent-ink); }
.nutri-parts ul { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; }
.nutri-parts li { display: flex; justify-content: space-between; gap: 10px; }
.nutri-parts small { color: var(--muted); }
.cost-big { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }

/* Server restarting: a quiet banner at the top while the app keeps trying. */
.server-banner { position: fixed; z-index: 95; left: 50%; top: calc(var(--safe-top) + 10px); transform: translateX(-50%);
  display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 999px; font-size: 13.5px;
  max-width: calc(100vw - 32px); animation: toast-in 480ms var(--spring); background: var(--glass-strong); }
.server-banner svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-ink); }

/* Recipe editor: the linked product with picture, price and kcal; the totals of the recipe. */
.ing-product { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--surface-2); text-align: left; color: var(--text); transition: transform 260ms var(--spring); }
.ing-product:active { transform: scale(0.98); }
.ing-product .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ing-product .title { font-weight: 600; font-size: 14px; }
.ing-product .sub { font-size: 12.5px; color: var(--muted); display: flex; gap: 8px; }
.ing-product .link-text { color: var(--accent-ink); font-weight: 600; }
.ing-product .pprice b { font-size: 16px; }
.totals { display: flex; flex-direction: column; gap: 12px; }
.totals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.totals .cost-big { font-size: 24px; }

/* Basislijst: what was found in the order history, closed by default, by product group. */
.discovered { overflow: hidden; }
.disc-head { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px 16px; border: 0; background: none;
  text-align: left; cursor: pointer; color: var(--text); }
.disc-head .ico { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: var(--accent-soft); color: var(--accent-ink); flex-shrink: 0; }
.disc-head .ico svg { width: 20px; height: 20px; }
.disc-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.disc-head b { font-size: 16px; }
.disc-head .chev svg { width: 20px; height: 20px; color: var(--muted); transition: transform 300ms var(--spring); }
.disc-head .chev.open svg { transform: rotate(90deg); }
.disc-body { border-top: 1px solid var(--line); padding: 12px 0 4px; display: flex; flex-direction: column; gap: 10px; animation: fade 250ms ease-out; }
.disc-group-head { display: flex; align-items: center; gap: 8px; padding: 6px 16px 2px; }
.disc-group-head b { font-size: 14px; }
.disc-group-head .muted { font-size: 13px; }
.disc-group-head .btn { margin-left: auto; }
.disc-group .list .item { padding-left: 16px; }
.disc-group-head b { min-width: 0; }
.disc-group-head .btn { white-space: nowrap; flex-shrink: 0; }

/* Voorraad: the camera scanner and the list of what's in the house. */
.scan-head { display: flex; flex-direction: column; gap: 10px; }
.scan-view { position: relative; border-radius: 22px; overflow: hidden; background: #0d0b1a; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
.scan-view video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-frame { position: absolute; left: 12%; right: 12%; top: 30%; bottom: 30%; border-radius: 16px; pointer-events: none;
  box-shadow: 0 0 0 9999px rgba(10, 8, 25, 0.38); border: 2.5px solid rgba(255, 255, 255, 0.9); }
.scan-frame::after { content: ""; position: absolute; left: 8px; right: 8px; top: 50%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-2), transparent); animation: scan-line 1.8s ease-in-out infinite; }
@keyframes scan-line { 0%, 100% { transform: translateY(-34px); opacity: 0.6; } 50% { transform: translateY(34px); opacity: 1; } }
.scan-error { position: absolute; inset: auto 12px 12px; padding: 10px 12px; border-radius: 14px; background: rgba(20, 16, 40, 0.82);
  color: #fff; font-size: 13.5px; display: flex; gap: 8px; align-items: flex-start; }
.scan-error svg { width: 18px; height: 18px; flex-shrink: 0; }
.scan-last { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; animation: rise-in 320ms var(--spring); }
.scan-last .grow { flex: 1; min-width: 0; }
.scan-last > .row-gap { flex-basis: 100%; justify-content: flex-end; }
.scan-choose { display: flex; flex-direction: column; gap: 12px; }
.scan-cta { display: flex; align-items: center; gap: 14px; width: 100%; text-align: left; border: 0; color: var(--text); font: inherit; }
.scan-cta .ico { width: 46px; height: 46px; border-radius: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  background: var(--accent-grad); color: #fff; box-shadow: 0 10px 22px -10px var(--accent); }
.scan-cta .ico svg { width: 24px; height: 24px; }
.scan-cta .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.scan-cta > svg { width: 18px; height: 18px; color: var(--faint); }
.linklike { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; }
.chip.small { padding: 4px 10px; min-height: 0; font-size: 12.5px; }
@media (prefers-reduced-motion: reduce) { .scan-frame::after { animation: none; } }
.open-tag { border: 0; cursor: pointer; font: inherit; font-size: 12px; }
.muted-link { color: var(--muted); font-weight: 500; }
