/* Wine app · "Glass light" (owner, 29 Oct 2026: the Service app's design - variant B of its study - light and dark theme).
   Loaded LAST (after appmenu.css, which is a shared kit and stays untouched). No markup changes: styles.css, shell.css and
   wine.css stay as they are and are overridden here.
   Glass (backdrop blur, translucent fill, hairline light border, top highlight, soft shadow) only for the app bar, the
   floating tab bar, the controls on the page background (search field, filter chips, language switch), sheets, the app
   menu and toasts. Cards, KPI tiles and list rows stay SOLID (no backdrop-filter per row: older iPhones). The blur is
   never animated. Without backdrop-filter support, or with "Reduce transparency" on, every glass surface is solid
   (section 13). The printed Woche briefing stays plain: no glass, no glows, no backgrounds (section 14). */

/* ---------- 1. Tokens ---------- */
:root {
  /* materials */
  --glass-blur: blur(20px) saturate(180%);
  --glass-blur-strong: blur(30px) saturate(190%);
  --glass-bar: rgba(250, 246, 241, 0.66);
  --glass-ctl: linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0.6));
  --glass-border: rgba(255, 255, 255, 0.85);
  --glass-ring: rgba(92, 40, 52, 0.14);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --glass-sheet: rgba(250, 246, 241, 0.84);
  --glass-inset: rgba(255, 255, 255, 0.74); /* grouped lists inside a sheet */
  --glass-float-shadow: 0 14px 34px -10px rgba(74, 22, 38, 0.3), 0 2px 8px rgba(74, 22, 38, 0.08);
  --glass-ctl-shadow: 0 6px 16px -8px rgba(74, 22, 38, 0.25);
  --glass-hairline: rgba(92, 40, 52, 0.12);
  --glass-tint: rgba(177, 31, 75, 0.09);
  --glass-neutral: rgba(92, 64, 72, 0.07);
  --glass-grabber: rgba(92, 64, 72, 0.28);
  --glass-tab-active: rgba(177, 31, 75, 0.11);
  --glass-tab-active-text: #9a1a41;
  --glass-note-ok: rgba(122, 31, 43, 0.9); /* the house colour of confirmations, as tinted glass */
  --glass-note-bad: rgba(179, 38, 30, 0.9);
  --glass-fade: rgba(243, 236, 228, 0.97); /* the strip under the floating tab bar: scrolled text never shows there */

  /* solid cards and the primary action */
  --glass-card: #ffffff;
  --glass-card-border: rgba(92, 40, 52, 0.1);
  --glass-card-shadow: 0 1px 2px rgba(74, 22, 38, 0.06), 0 8px 22px -14px rgba(84, 28, 42, 0.3);
  --glass-row-shadow: 0 1px 2px rgba(74, 22, 38, 0.05), 0 6px 16px -12px rgba(84, 28, 42, 0.28);
  --glass-inbtn: #ffffff;
  --glass-inbtn-border: rgba(92, 40, 52, 0.22);
  --glass-primary: var(--cp-accent);
  --glass-primary-pressed: var(--cp-accent-hover);
  --glass-on-primary: #ffffff;
  --glass-radius-card: 22px;
  --glass-radius-tile: 18px;
  --glass-radius-inner: 14px;
  --glass-radius-sheet: 30px;

  /* layout: the floating tab bar (4rem high, max(12px, home-indicator inset) above the bottom) and the sticky app bar */
  --glass-tab-h: 4rem;
  --glass-tab-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  --glass-tab-clear: calc(var(--glass-tab-h) + var(--glass-tab-bottom));
  --glass-appbar-h: calc(3.25rem + env(safe-area-inset-top, 0px));

  /* the app's own tokens, warmed for the cream background (text >= 5.8:1 on it) */
  --cp-bg: #f4ede4;
  --cp-text: #231d1f;
  --cp-text-muted: #594f52;
  --cp-text-soft: #6a5f62;
  --cp-info-text: #0062ad; /* styles.css #006ec2 is 4.6:1 on its tint; same hue, a little darker for the small tags */
  --appbar-bg: #f7f1ea; /* the top of the glass app bar; theme.js copies it into <meta name="theme-color"> */
  --radius: 20px;
  --radius-sm: 12px;
}
html.is-standalone { --glass-appbar-h: calc(4.75rem + env(safe-area-inset-top, 0px)); }
@media (display-mode: standalone) { :root { --glass-appbar-h: calc(4.75rem + env(safe-area-inset-top, 0px)); } }

html[data-theme="dark"] {
  --glass-bar: rgba(38, 32, 34, 0.68);
  --glass-ctl: linear-gradient(180deg, rgba(66, 58, 61, 0.8), rgba(50, 43, 46, 0.72)); /* its own colour: a wine glow must not read as "pressed" */
  --glass-border: rgba(255, 255, 255, 0.12);
  --glass-ring: rgba(0, 0, 0, 0.35);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  --glass-sheet: rgba(36, 30, 32, 0.86);
  --glass-inset: rgba(255, 255, 255, 0.06);
  --glass-float-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.65), 0 2px 8px rgba(0, 0, 0, 0.3);
  --glass-ctl-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  --glass-hairline: rgba(255, 255, 255, 0.1);
  --glass-tint: rgba(253, 142, 161, 0.12);
  --glass-neutral: rgba(255, 255, 255, 0.07);
  --glass-grabber: rgba(255, 255, 255, 0.28);
  --glass-tab-active: rgba(253, 142, 161, 0.16);
  --glass-tab-active-text: #fd8ea1;
  --glass-note-ok: rgba(253, 142, 161, 0.92);
  --glass-note-bad: rgba(179, 38, 30, 0.92);
  --glass-fade: rgba(26, 21, 22, 0.97);

  --glass-card: #2a2426;
  --glass-card-border: rgba(255, 255, 255, 0.08);
  --glass-card-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 26px -14px rgba(0, 0, 0, 0.7);
  --glass-row-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 20px -14px rgba(0, 0, 0, 0.7);
  --glass-inbtn: #352e30;
  --glass-inbtn-border: rgba(255, 255, 255, 0.14);
  --glass-primary: #b8325a; /* wine with white text 5.8:1 (the light accent #fd8ea1 stays for text and icons) */
  --glass-primary-pressed: #9e2649;

  --cp-bg: #1c1718; /* deep warm charcoal */
  --cp-bg-elevated: #241e20;
  --cp-surface: #2a2426;
  --cp-surface-soft: #332c2e;
  --cp-border: #43393c;
  --cp-text: #ede6e7;
  --cp-text-muted: #b9aeb0;
  --cp-text-soft: #b3a8aa;
  --cp-info-text: #6cb6ff; /* styles.css #58acff is 4.6:1 on its tint */
  --cp-accent-soft-solid: #4a3439;
  --cp-neutral-soft: #3a3234;
  --appbar-bg: #1e191a;
}

/* ---------- 2. Ambient background: cream with soft wine and gold glows (dark: charcoal, dimmed glows) ---------- */
html { background: var(--cp-bg); }
body { background: transparent; }
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(38vmax 26vmax at 96% 16%, rgba(177, 31, 75, 0.17), transparent 70%),
    radial-gradient(40vmax 30vmax at -4% 34%, rgba(222, 168, 88, 0.28), transparent 70%),
    radial-gradient(40vmax 30vmax at 104% 66%, rgba(150, 30, 64, 0.14), transparent 72%),
    radial-gradient(46vmax 32vmax at 8% 100%, rgba(228, 182, 106, 0.26), transparent 72%),
    linear-gradient(180deg, #f8f2eb 0%, #f2e9de 100%);
}
html[data-theme="dark"] body::before {
  background:
    radial-gradient(36vmax 26vmax at 92% 4%, rgba(177, 31, 75, 0.24), transparent 70%),
    radial-gradient(40vmax 30vmax at -4% 32%, rgba(160, 110, 40, 0.14), transparent 70%),
    radial-gradient(40vmax 30vmax at 104% 70%, rgba(150, 30, 64, 0.13), transparent 72%),
    linear-gradient(180deg, #1f191a 0%, #171213 100%);
}

/* ---------- 3. App bar: glass; on phones it stays at the top and the content scrolls under it ---------- */
.appbar {
  background: linear-gradient(180deg, var(--appbar-bg) 0%, var(--glass-bar) 100%);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  border-bottom: 0;
  box-shadow: inset 0 -0.5px 0 var(--glass-hairline), 0 6px 18px -12px rgba(74, 22, 38, 0.25);
}
@media (max-width: 47.9375rem) {
  .appbar { position: sticky; top: 0; z-index: 25; }
  html { scroll-padding-top: var(--glass-appbar-h); scroll-padding-bottom: calc(var(--glass-tab-clear) + 0.5rem); }
}
.appbar__menu, .appbar__refresh { border-radius: 999px; }
.appbar__menu:active, .appbar__menu[aria-expanded="true"], .appbar__refresh:active { background: var(--glass-tint); }
.appbar__title { font-size: 1.0625rem; letter-spacing: 0.005em; }
.appbar__place { font-size: 0.75rem; letter-spacing: 0.02em; }

.screen__head { margin: 1rem 0 0.375rem; }
.screen__title { font-size: 2rem; line-height: 1.1; letter-spacing: -0.015em; }
.screen__sub { margin-top: 0.25rem; font-size: 0.9375rem; }
.sync-note { margin: 0.375rem 0 0.875rem; }
/* Section headings in the title serif, like "Ankünfte" in the Service app. */
.section-title, .stock-moves__title { color: var(--text); font-family: var(--serif); font-size: 1.25rem; font-weight: 700; letter-spacing: -0.005em; }
.section-title { margin: 0.25rem 0 0 0.125rem; }
.stock-moves__title { margin: 0 0 0.625rem 0.125rem; }

/* ---------- 4. Tab bar: a floating glass capsule on phones (inset 12 px, above the home indicator) ---------- */
@media (max-width: 47.9375rem) {
  html .tabbar {
    top: auto;
    bottom: var(--glass-tab-bottom);
    left: max(0.75rem, env(safe-area-inset-left, 0px), calc((100% - 32rem) / 2));
    right: max(0.75rem, env(safe-area-inset-right, 0px), calc((100% - 32rem) / 2));
    height: var(--glass-tab-h);
    gap: 2px;
    padding: 4px;
    border: 1px solid var(--glass-border);
    border-radius: 999px;
    background: var(--glass-bar);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-ring), var(--glass-float-shadow);
  }
  /* Five equal tabs (four for the staff, who do not see Preise); the long labels break at their soft hyphen. */
  html .tabbar .tabbar__link {
    min-height: 0;
    gap: 0.0625rem;
    padding: 0 0.125rem;
    border-radius: 999px;
    color: var(--text);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.005em;
  }
  html .tabbar .tabbar__icon { width: 1.5rem; height: 1.5rem; }
  html .tabbar .tabbar__link[aria-current="page"] {
    color: var(--glass-tab-active-text);
    background: var(--glass-tab-active);
    box-shadow: inset 0 0 0 0.5px var(--glass-tab-active);
  }
  html .tabbar .tabbar__link[aria-current="page"] .tabbar__icon { width: 1.5rem; height: 1.5rem; padding: 0; background: none; }
  .tabbar__badge { top: 0.3125rem; left: calc(50% + 0.5rem); box-shadow: 0 0 0 2px var(--glass-card); }

  /* Room for the floating bar on every screen; toasts sit above it. */
  body .main { padding-bottom: calc(var(--glass-tab-clear) + 1.75rem); }
  body .toasts { bottom: calc(var(--glass-tab-clear) + 0.75rem); }

  /* The list softens where it runs under the floating bar (a gradient only, no blur). */
  body::after {
    content: "";
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 19;
    height: calc(var(--glass-tab-clear) + 0.5rem);
    pointer-events: none;
    background: linear-gradient(to top, var(--glass-fade) 0%, var(--glass-fade) 30%, transparent 100%);
  }
  body.is-blocked::after { content: none; }
}
/* Tablets and desktops: the tab bar is the sticky top bar; glass as well. */
@media (min-width: 48rem) {
  .tabbar {
    top: 0; /* styles.css sets top: 0 and then inset: auto, which resets it: without this the bar scrolls away */
    background: var(--glass-bar);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    backdrop-filter: var(--glass-blur-strong);
    border-bottom: 0;
    box-shadow: inset 0 -0.5px 0 var(--glass-hairline);
  }
  .tabbar__link { color: var(--text); }
}

/* ---------- 5. Buttons: capsules; the primary action solid wine ---------- */
.btn, .btn--small { border-radius: 999px; }
.btn--primary {
  background-color: var(--glass-primary);
  color: var(--glass-on-primary);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), inset 0 -10px 16px -10px rgba(0, 0, 0, 0.22), 0 6px 16px -7px rgba(142, 27, 62, 0.55);
}
html .btn--primary:hover:not(:disabled), html .btn--primary:active:not(:disabled) { background: var(--glass-primary-pressed); }
@media (hover: none) { html .btn--primary:hover:not(:disabled) { background: var(--glass-primary); } }
html .btn--primary:active:not(:disabled) { background: var(--glass-primary-pressed); }
.btn--danger { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 16px -7px rgba(140, 20, 20, 0.5); }
/* Inside a card (e.g. "Stornieren" on an open order) the destructive action is a ghost capsule with red text, like the
   Service app's cards; the solid red button stays for the confirm sheet. */
html .card .btn--danger { background: var(--glass-inbtn); border: 1px solid var(--glass-inbtn-border); color: var(--negative);
  box-shadow: 0 1px 2px rgba(74, 22, 38, 0.06); }
html .card .btn--danger:active:not(:disabled) { background: var(--error-bg); }
.btn--secondary {
  background: var(--glass-ctl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-ring), 0 4px 12px -6px rgba(74, 22, 38, 0.22);
  color: var(--text);
}
html .btn--secondary:hover:not(:disabled) { background: var(--glass-ctl); }
@media (hover: hover) { html .btn--secondary:hover:not(:disabled) { background: var(--glass-tint); } }
html .btn--secondary:active:not(:disabled) { background: var(--glass-tint); }
.btn--ghost { color: var(--link); }

/* ---------- 6. Controls on the page: glass capsules with a real backdrop blur (few, small) ---------- */
/* Search field (Bestand, Preise): a capsule; it keeps its 3:1 outline. */
.toolbar .input[type="search"] {
  padding-inline: 1.125rem;
  border-color: var(--border-strong);
  border-radius: 999px;
  background: var(--glass-ctl);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: var(--glass-highlight), var(--glass-ctl-shadow);
}
.toolbar .input[type="search"]:focus-visible { border-color: var(--focus); }

/* Filter chips (Bestand, Preise), the language and style switches (wine sheet, Woche, Wein suchen), the kinds in Lager buchen */
.chip, .lang-switch__btn, .stock-kinds__item {
  background: var(--glass-ctl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-ring), var(--glass-ctl-shadow);
  color: var(--text);
}
.toolbar .chip, .main .lang-switch__btn {
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
}
/* In a sheet the controls sit on the sheet's glass: same look, no second blur. */
.sheet .chip, .sheet .lang-switch__btn, .sheet .stock-kinds__item {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-ring);
}
.chip { min-height: 2.75rem; padding: 0 1.125rem; border-radius: 999px; font-size: 0.9375rem; }
html .chip:has(.chip__input:checked), html .lang-switch__btn[aria-pressed="true"] {
  background: var(--glass-primary); color: var(--glass-on-primary); border-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 6px 14px -6px rgba(142, 27, 62, 0.5);
}
/* The filter chips: one row that scrolls sideways, edge to edge */
/* Phones: one sideways-scrolling chip row from edge to edge; tablets and desktops keep the wrapping rows (no chip cut off). */
@media (max-width: 47.9375rem) {
  .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; margin: 0 -1rem; padding: 0.25rem 1rem 0.625rem; scrollbar-width: none; }
  .toolbar .chips::-webkit-scrollbar { display: none; }
  .toolbar .chips .chip { flex: none; }
}
.lang-switch { gap: 0.375rem; }
.lang-switch__btn { min-height: 2.75rem; padding: 0 1rem; border-radius: 999px; font-size: 0.875rem; font-weight: 600; }
.stock-kinds__item { padding: 0.25rem 1rem 0.25rem 0.875rem; border-radius: 999px; }
html .stock-kinds__item:has(input:checked) { border-color: var(--link); background: var(--glass-tint); color: var(--link); }

/* Fields keep their 3:1 outline; only rounder */
.input { border-radius: 12px; }
.input--area { border-radius: var(--glass-radius-inner); }

/* ---------- 7. Tags: tinted capsules ---------- */
.tag { padding: 0.1875rem 0.625rem; font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.005em; }

/* ---------- 8. Cards, KPI tiles and rows: solid, larger radius, a soft shadow ---------- */
.card, .kpi, .item-row, .stock-move, .state--error, .state--empty {
  background: var(--glass-card);
  border: 1px solid var(--glass-card-border);
  border-radius: var(--glass-radius-card);
  box-shadow: var(--glass-card-shadow);
}
.state--empty { border-style: dashed; border-color: var(--border-strong); box-shadow: none; }
.kpi, .stock-move { border-radius: var(--glass-radius-tile); }

/* Status: a short coloured mark at the left edge instead of a full-height stripe (only where something needs a look) */
.item-row, .kpi, .stock-move { position: relative; }
.wine-row--reorder, .wine-row--negative, .price-row--erhoehen, .kpi--danger, .stock-move--failed { --glass-mark: var(--negative); }
.wine-row--low, .price-row--pruefen, .kpi--warning, .stock-move--unclear, .stock-move--pending { --glass-mark: var(--warning-border); }
.wine-row--reorder::before, .wine-row--negative::before, .wine-row--low::before, .price-row--erhoehen::before,
.price-row--pruefen::before, .kpi--danger::before, .kpi--warning::before, .stock-move--failed::before,
.stock-move--unclear::before, .stock-move--pending::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  width: 4px;
  height: min(2.5rem, calc(100% - 28px));
  border-radius: 4px;
  background: var(--glass-mark);
  pointer-events: none;
}

/* buttons inside cards: solid capsules with an outline (no blur) */
html .card .btn--secondary {
  background: var(--glass-inbtn);
  border: 1px solid var(--glass-inbtn-border);
  box-shadow: 0 1px 2px rgba(74, 22, 38, 0.06);
}
html .card .btn--secondary:active:not(:disabled) { background: var(--accent-soft); }
.card__actions .btn, .order-actions .btn { min-height: 2.875rem; }

/* inner panels: rounded and tinted, no stripes */
.proposal__verdict, .glass-warnings, .similar, .profile-legacy { border-radius: var(--glass-radius-inner); }
.mode-banner { gap: 0.625rem; padding: 0.875rem 1rem; border-radius: 18px; box-shadow: inset 0 0 0 0.5px var(--glass-hairline); }

/* ---------- 9. The tabs: Bestand, Preise, Bestellen, Lieferanten, Woche ---------- */
/* KPI tiles: the figure big, its label muted below */
.kpis { gap: 0.625rem; margin: 0.25rem 0 1.125rem; }
.kpi { gap: 0.1875rem; padding: 0.8125rem 0.875rem 0.875rem 1rem; }
.kpi__value { font-size: 1.625rem; line-height: 1.1; letter-spacing: -0.015em; }
.kpi__label { line-height: 1.3; }

/* Wine rows (Bestand) and price rows (Preise): name prominent, meta muted, the count / margin on the right */
.list-count { margin: 0.25rem 0 0.625rem 0.125rem; }
.item-rows { gap: 0.625rem; }
.item-row { gap: 0.25rem 0.75rem; padding: 0.875rem 1rem; }
.item-row__name { font-size: 1.0625rem; line-height: 1.3; }
.item-row__tags { margin-top: 0.25rem; }
.item-row .progress { height: 0.375rem; margin: 0.375rem 0 0.125rem; }
.wine-row__count { font-size: 1.625rem; letter-spacing: -0.015em; }
.figures { margin-top: 0.25rem; padding-top: 0.625rem; border-top: 0.5px solid var(--glass-hairline); }

/* Letzte Buchungen (Bestand) */
.stock-moves__items { gap: 0.625rem; }
.stock-move { padding: 0.75rem 1rem; box-shadow: var(--glass-row-shadow); }

/* Bestellen: open orders and proposals as cards; order lines with hairlines */
.open-orders { gap: 0.625rem; margin-bottom: 1.5rem; }
.proposals { gap: 0.875rem; }
.proposal__title, .supplier-card__name, .glass-card__title { font-family: var(--serif); font-weight: 700; letter-spacing: -0.005em; }
.proposal__title { font-size: 1.1875rem; }
.order-lines > li + li { border-top: 0.5px solid var(--glass-hairline); }
.order-line { border-radius: 12px; }

/* Lieferanten: supplier cards; their facts as a soft inset group */
.supplier-cards { gap: 0.875rem; }
.supplier-card__name { font-size: 1.1875rem; }
.supplier-card .facts { padding: 0 0.875rem; border-radius: var(--glass-radius-inner); background: var(--glass-neutral); }
.supplier-card .fact { padding: 0.5625rem 0; border-bottom: 0.5px solid var(--glass-hairline); }
.supplier-card .fact:last-child { border-bottom: 0; }

/* Woche: the wines of the week in one card; the dish in the house colour, the counting figures in a soft panel */
.week-card { padding: 1rem 1.125rem; }
.week-row { border-top: 0.5px solid var(--glass-hairline); }
.week-row__dish { color: var(--link); font-size: 1.0625rem; }
.glass-facts { padding: 0.5rem 0.75rem; border-radius: var(--glass-radius-inner); background: var(--glass-neutral); }
.week-row__actions .btn { min-height: 2.75rem; }

/* ---------- 10. Sheets: floating glass, large radius, a grabber ---------- */
html dialog.sheet {
  border: 1px solid var(--glass-border);
  border-radius: var(--glass-radius-sheet);
  background: var(--glass-sheet);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  box-shadow: var(--glass-highlight), 0 0 0 0.5px var(--glass-ring), 0 30px 70px -18px rgba(40, 12, 22, 0.45);
  scrollbar-width: none;
}
@media (max-width: 39.9375rem) {
  html dialog.sheet {
    width: calc(100% - 1rem);
    max-width: calc(100% - 1rem);
    margin: auto 0.5rem 0.5rem; /* floats; the home indicator draws over its bottom edge, as with iOS sheets */
  }
  .sheet__inner { padding: 0.5rem 1.25rem calc(1.25rem + max(0px, env(safe-area-inset-bottom, 0px) - 0.5rem)); }
}
html dialog.sheet::backdrop { background: rgba(40, 18, 26, 0.3); }
.sheet__inner::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 0.3125rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: var(--glass-grabber);
}
.sheet__title { font-size: 1.5rem; line-height: 1.15; letter-spacing: -0.01em; }
.sheet__actions .btn { min-width: 7rem; }

/* Grouped lists in sheets (iOS settings style): the facts and the history */
.sheet .facts, .sheet .history {
  padding: 0 1rem;
  background: var(--glass-inset);
  border-radius: 18px;
  box-shadow: inset 0 0 0 0.5px var(--glass-hairline);
}
html .sheet .fact { padding: 0.6875rem 0; border-bottom: 0.5px solid var(--glass-hairline); }
html .sheet .fact:last-child { border-bottom: 0; }
html .sheet .fact .fact__label { color: var(--muted); font-weight: 400; }
html .sheet .fact .fact__value { font-size: 1rem; }
.sheet .history > li { padding: 0.625rem 0; border-bottom: 0.5px solid var(--glass-hairline); }
.sheet .history > li:last-child { border-bottom: 0; }

/* A fact whose value does not fit beside its label: the value goes below the label, left-aligned (no more lines of
   right-aligned text). The label takes the free space, so a short value still ends at the right. */
.fact { flex-wrap: wrap; justify-content: flex-start; column-gap: 1rem; row-gap: 0.125rem; }
.fact__label { flex: 1 0 auto; }
.fact__value { flex: 0 1 auto; min-width: 0; text-align: left; overflow-wrap: anywhere; }

/* Section labels in sheets: small, muted capitals above their group */
.detail-section { margin-top: 1.375rem; }
.detail-section__title, .form-section-title {
  color: var(--muted); font-family: var(--sans); font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
}
.detail-section__title { margin: 0 0 0.375rem 0.25rem; }
.detail-section__title:has(+ .facts, + .history) { margin-left: 1rem; }
/* The long heading over the suggestions in Wein suchen stays a normal heading. */
.suggest-block .form-section-title { color: var(--text); font-size: 1rem; font-weight: 700; letter-spacing: 0; text-transform: none; }

/* Wine sheet: label photo, profile ("Profil & Geschichte" with DE/EN/FR/Magyar), Bearbeiten */
.wine-photo { border-radius: 18px; background: var(--glass-inset); box-shadow: inset 0 0 0 0.5px var(--glass-hairline); }
.profile-legacy { background: var(--glass-tint); }
.profile-story { line-height: 1.55; }
.profile-storyblock { gap: 0.625rem; }

/* Wein suchen (Woche): the wines as solid rows */
.choice-list { gap: 0.5rem; }
.choice {
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--glass-card-border);
  border-radius: 16px;
  background: var(--glass-card);
  box-shadow: var(--glass-row-shadow);
}
html .choice:has(input:checked) { border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link), var(--glass-row-shadow); }
.choice input { accent-color: var(--glass-primary); }
.choice__name { font-weight: 700; }

/* Lager buchen and the new-wine sheet (label scan): solid rows, soft panels */
.stock-line, .stock-search__hit {
  border: 1px solid var(--glass-card-border);
  background: var(--glass-card);
  box-shadow: var(--glass-row-shadow);
}
.stock-line { border-radius: 16px; }
.stock-search__hit { border-radius: var(--glass-radius-inner); }
.scan-preview img { border-radius: var(--glass-radius-inner); }

/* ---------- 11. Toasts: tinted glass in the house colour / signal red ---------- */
.toast {
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 18px;
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 14px 34px -10px rgba(60, 10, 25, 0.45);
}
.toast--info { background: var(--glass-note-ok); }
.toast--error { background: var(--glass-note-bad); }

/* ---------- 12. App menu drawer: glass ---------- */
.appmenu {
  background: var(--glass-sheet);
  -webkit-backdrop-filter: var(--glass-blur-strong);
  backdrop-filter: var(--glass-blur-strong);
  border-right: 1px solid var(--glass-border);
  border-radius: 0 28px 28px 0;
}
.appmenu__app, .appmenu__close { border-radius: 999px; }
.appmenu__app:active, .appmenu__app[aria-current="page"] { background: var(--glass-tint); }

/* ---------- 13. No transparency wanted, or no backdrop-filter: the same colours, solid, no blur ---------- */
@media (prefers-reduced-transparency: reduce) {
  :root {
    --glass-blur: none; --glass-blur-strong: none;
    --glass-bar: #f9f5f0; --glass-ctl: #ffffff; --glass-sheet: #faf6f1; --glass-inset: #ffffff;
    --glass-note-ok: var(--note-ok-bg); --glass-note-bad: var(--note-bad-bg);
  }
  html[data-theme="dark"] {
    --glass-bar: #262022; --glass-ctl: #322b2d; --glass-sheet: #262022; --glass-inset: #2e282a;
    --glass-note-ok: var(--note-ok-bg); --glass-note-bad: var(--note-bad-bg);
  }
  body::after { content: none; }
  html dialog.sheet::backdrop { -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  :root {
    --glass-bar: #f9f5f0; --glass-ctl: #ffffff; --glass-sheet: #faf6f1; --glass-inset: #ffffff;
    --glass-note-ok: var(--note-ok-bg); --glass-note-bad: var(--note-bad-bg);
  }
  html[data-theme="dark"] {
    --glass-bar: #262022; --glass-ctl: #322b2d; --glass-sheet: #262022; --glass-inset: #2e282a;
    --glass-note-ok: var(--note-ok-bg); --glass-note-bad: var(--note-bad-bg);
  }
}

/* ---------- 14. Print (the Woche service briefing): plain - no glass, no glows, no backgrounds, black text ---------- */
@media print {
  body::before, body::after { content: none !important; display: none !important; }
  *, *::before, *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; text-shadow: none !important; }
  html, body { background: #fff !important; }
  .main { padding-bottom: 0 !important; }
  .card { border-radius: 0 !important; }
  .week-row { border-top-color: #bbb !important; }
  .screen__title, .week-row__dish, .week-row__empty, .week-row__profile, .week-row__table, .week-row__notes { color: #000 !important; }
}

/* ---------- 15. Photo import (4 Nov 2026): the picker card, the upload progress, solid photo cards, the Bestand banner ---------- */
.import-pick { display: grid; gap: 0.625rem; margin: 0 0 1.25rem; padding: 1rem; }
.import-pick__title { margin: 0; font-size: 1.125rem; }
.import-pick__hint { margin: 0; color: var(--cp-text-muted); font-size: 0.875rem; }
.import-pick__choose { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem; width: 100%; min-height: 3rem; cursor: pointer; }
.import-pick__choose .inline-icon { width: 1.375rem; height: 1.375rem; }
.import-pick__choose:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.import-pick__choose.is-busy { opacity: 0.6; pointer-events: none; }
.import-pick__picked { display: grid; gap: 0.25rem; margin: 0; font-weight: 600; }
.import-pick__picked:empty { display: none; }
.import-pick__extra { color: var(--warning-text); font-size: 0.875rem; font-weight: 400; }
.import-pick__send { width: 100%; min-height: 3rem; }
.import-progress { display: grid; gap: 0.5rem; }
.import-progress__bar { width: 100%; height: 0.5rem; }
.import-progress__text { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.import-progress__failed { display: grid; gap: 0.375rem; margin: 0; padding: 0; list-style: none; font-size: 0.875rem; }
.import-progress__failed li { display: grid; gap: 0.125rem; padding: 0.5rem 0.75rem; border-radius: var(--glass-radius-inner); background: var(--cp-danger-soft); }
.import-progress__file { font-weight: 600; overflow-wrap: anywhere; }
.import-progress__error { color: var(--cp-danger-text); overflow-wrap: anywhere; }
/* Refused for every photo (too many this hour, too many waiting): one line for all photos not sent. */
.import-progress__stopped { margin: 0; padding: 0.5rem 0.75rem; border-radius: var(--glass-radius-inner); background: var(--cp-danger-soft);
  color: var(--cp-danger-text); font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.import-list__title { margin: 0 0 0.625rem; font-size: 1.125rem; }
/* "Alle fertigen anlegen" above the photos and again below them: normal buttons in the flow (a sticky bar covered the
   Flaschen/VK fields of the card being typed into). */
.import-bulk { display: grid; gap: 0.375rem; margin: 0 0 0.875rem; }
.import-bulk__button { width: 100%; min-height: 3rem; }
.import-bulk__hint { margin: 0; color: var(--cp-text-muted); font-size: 0.8125rem; }
.import-batch { margin: 0 0 1.25rem; }
.import-batch__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.375rem 0.75rem; margin: 0 0 0.625rem; }
.import-batch__title { margin: 0; font-size: 1rem; }
.import-batch__bar { flex: 1 0 100%; height: 0.375rem; }
.import-items { display: grid; gap: 0.625rem; margin: 0; padding: 0; list-style: none; }
.import-item { display: grid; gap: 0.75rem; padding: 0.875rem; border-radius: var(--glass-radius-tile); }
.import-item__main { display: grid; grid-template-columns: 4.5rem minmax(0, 1fr); gap: 0.75rem; align-items: start; }
.import-item__photo { display: block; width: 4.5rem; height: 4.5rem; object-fit: cover; border-radius: var(--glass-radius-inner); background: var(--accent-soft); }
.import-item__photo--none { display: grid; place-items: center; color: var(--cp-text-soft); }
.import-item__photo--none .icon { width: 1.5rem; height: 1.5rem; }
.import-item__text { display: grid; gap: 0.25rem; min-width: 0; }
.import-item__name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.import-item__meta, .import-item__notes { margin: 0; color: var(--cp-text-muted); font-size: 0.875rem; overflow-wrap: anywhere; }
.import-item__tags { display: flex; flex-wrap: wrap; gap: 0.25rem; margin: 0.125rem 0 0; }
.import-item__hint { margin: 0; color: var(--cp-info-text); font-size: 0.875rem; font-weight: 600; overflow-wrap: anywhere; }
.import-item__error { margin: 0; color: var(--cp-danger-text); font-size: 0.875rem; overflow-wrap: anywhere; }
.import-item__admin { display: grid; gap: 0.625rem; }
.import-item__quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; }
.import-item__quick .field { margin: 0; }
.import-item__actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.import-item--created, .import-item--delivered, .import-item--discarded { opacity: 0.78; }
.import-banner { display: flex; align-items: center; gap: 0.625rem; margin: 0 0 0.875rem; padding: 0.75rem 1rem; border: 1px solid var(--glass-card-border);
  border-radius: 999px; background: var(--glass-card); box-shadow: var(--glass-card-shadow); color: var(--cp-text); font-weight: 600; text-decoration: none; }
.import-banner .inline-icon { flex: none; width: 1.25rem; height: 1.25rem; color: var(--glass-primary); }
.import-banner__text { flex: 1; min-width: 0; }
.import-banner:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.review-note { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 0.75rem; padding: 0.625rem 0.875rem;
  border-radius: var(--glass-radius-inner); background: var(--warning-bg); color: var(--warning-text); font-weight: 600; }
.review-note .inline-icon { flex: none; width: 1.125rem; height: 1.125rem; }
.review-note__text { flex: 1; min-width: 10rem; }
.import-banner[hidden], .import-bulk[hidden], .import-pick [hidden] { display: none !important; }
