/* SealedVault – Design: Lagerregal.
   Mobile first: Basis = Handy, Erweiterungen per min-width. Keine externen Schriften oder Skripte (läuft offline im Heimnetz).
   Ein Akzent: das gelbe Regalschild (.tag) markiert Lagerplätze – alles andere bleibt ruhig. */

:root {
  --bg: #f2f4f5;
  --surface: #ffffff;
  --surface-2: #e8ecef;
  --ink: #14212b;
  --ink-2: #44535f;
  --ink-3: #5f6e7a;
  --line: #d5dce1;
  --primary: #14212b;
  --on-primary: #ffffff;
  --label: #ffc933;
  --on-label: #14212b;
  --up: #11704a;
  --up-bg: #dcf2e7;
  --down: #b3261e;
  --down-bg: #fbe3e0;
  --focus: #2b62f0;
  --shadow: 0 12px 32px rgb(20 33 43 / .18);

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --gap: 16px;
  --header-h: 56px;
  --tabbar-h: 64px;
  --font: "Segoe UI Variable Text", "SF Pro Text", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d151c;
    --surface: #16222b;
    --surface-2: #1f2d38;
    --ink: #eaf0f4;
    --ink-2: #b2c0ca;
    --ink-3: #93a3af;
    --line: #2c3b47;
    --primary: #eaf0f4;
    --on-primary: #0d151c;
    --up: #62d79d;
    --up-bg: #12382a;
    --down: #ff9189;
    --down-bg: #40201d;
    --focus: #80a4ff;
    --shadow: 0 12px 32px rgb(0 0 0 / .5);
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 1rem/1.45 var(--font);
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em; font-weight: 750; }
h2 { font-size: 1.0625rem; line-height: 1.3; font-weight: 700; }
a { color: inherit; }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 6px; font-size: .875em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; left: 8px; top: -60px; z-index: 100; background: var(--primary); color: var(--on-primary); padding: 10px 14px; border-radius: var(--r-s); }
.skip:focus { top: 8px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.ic { width: 1.25rem; height: 1.25rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ic.flip { transform: rotate(180deg); }
.big-ic { width: 3rem; height: 3rem; color: var(--ink-3); }

/* ---------- Kopfzeile & Navigation ---------- */
.top {
  position: sticky; top: 0; z-index: 30; height: var(--header-h);
  padding: 0 var(--gap); padding-top: env(safe-area-inset-top);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 750; letter-spacing: -.01em; min-width: 0; }
.brand-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mark { width: 32px; height: 32px; border-radius: 9px; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; flex: none; }
.mark .ic { width: 1.1rem; height: 1.1rem; }
.top-nav { display: none; }

.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  display: grid; grid-template-columns: repeat(4, 1fr); align-items: stretch;
  background: color-mix(in srgb, var(--surface) 98%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  text-decoration: none; color: var(--ink-3); font-size: .75rem; font-weight: 600; min-height: 48px;
}
.tabbar a[aria-current="page"] { color: var(--ink); }
.tabbar a[aria-current="page"] .ic { stroke-width: 2.3; }
.tab-add-btn { width: 44px; height: 44px; margin-top: -16px; border-radius: 50%; background: var(--primary); color: var(--on-primary); display: grid; place-items: center; box-shadow: 0 6px 16px rgb(20 33 43 / .3); border: 3px solid var(--bg); }
.tab-add { color: var(--ink) !important; }

/* ---------- Layout ---------- */
.wrap { max-width: 1080px; margin: 0 auto; padding: var(--gap) var(--gap) calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 28px); }
body.focus .wrap { padding-bottom: 24px; }
body.auth .wrap { padding-top: 28px; padding-bottom: 40px; }
.stack { display: grid; gap: 14px; }
.stack.sub { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.page-head { display: flex; align-items: center; gap: 8px; margin: 4px 0 16px; }
.back { width: 44px; height: 44px; margin-left: -10px; display: grid; place-items: center; border-radius: 50%; text-decoration: none; }
.back:hover { background: var(--surface-2); }
.help { color: var(--ink-3); font-size: .875rem; line-height: 1.4; }
.notice { background: var(--down-bg); color: var(--down); padding: 10px 12px; border-radius: var(--r-m); font-size: .9375rem; margin-bottom: 14px; font-weight: 600; }
.lbl { color: var(--ink-3); font-size: .8125rem; font-weight: 500; }
.hint { color: var(--ink-3); font-size: .8125rem; }
.num, .big, .pill, .qty, .tag { font-variant-numeric: tabular-nums; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 20px; border-radius: var(--r-m); border: 1.5px solid transparent;
  background: var(--primary); color: var(--on-primary); font: 650 1rem/1 var(--font);
  text-decoration: none; cursor: pointer; transition: transform .08s ease, background-color .15s ease;
}
.btn:active { transform: scale(.98); }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.secondary:hover { background: var(--surface-2); }
.btn.danger-outline { background: transparent; color: var(--down); border-color: color-mix(in srgb, var(--down) 45%, transparent); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: .9375rem; }
.btn.icon { padding: 0; width: 48px; }
.btn.block { width: 100%; }
.btn.grow { flex: 1; }

/* ---------- Formularfelder ---------- */
.panel { background: var(--surface); border-radius: var(--r-l); padding: 16px; display: grid; gap: 14px; }
.row2 { display: grid; gap: 14px; }
.row2.tight { grid-template-columns: 1fr 1fr; }
.field { display: grid; gap: 6px; }
.field > span { font-size: .875rem; font-weight: 600; color: var(--ink-2); }
:where(input:not([type="checkbox"]):not([type="file"]), select, textarea) {
  width: 100%; min-height: 48px; padding: 11px 14px; border: 1.5px solid var(--line); border-radius: var(--r-m);
  background: var(--bg); color: var(--ink); font: inherit; font-size: 1rem; /* 16px verhindert Zoom auf iOS */
}
textarea { resize: vertical; min-height: 88px; line-height: 1.4; }
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: .85; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; border-color: transparent; }
input[type="file"] { font-size: .9375rem; }
.field.loc input { background: var(--label); color: var(--on-label); border-color: transparent; font-weight: 800; font-size: 1.25rem; letter-spacing: .02em; }
.field.loc input::placeholder { color: #5b4a00; font-weight: 500; font-size: 1rem; letter-spacing: 0; }
.stepper { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; }
.stepper input { text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }

.drop { position: relative; display: grid; place-items: center; min-height: 168px; border: 2px dashed var(--line); border-radius: var(--r-l); background: var(--bg); overflow: hidden; cursor: pointer; text-align: center; }
.drop:hover { border-color: var(--ink-3); }
.drop:focus-within { outline: 3px solid var(--focus); outline-offset: 2px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-prev { width: 100%; max-height: 320px; object-fit: contain; display: block; background: var(--surface-2); }
.drop-hint { display: grid; gap: 4px; justify-items: center; padding: 20px; color: var(--ink-2); }
.drop-hint .ic { width: 1.75rem; height: 1.75rem; }
.drop-hint small { color: var(--ink-3); }
.drop.has-img .drop-hint { display: none; }
.drop.has-img { border-style: solid; }
.drop.slim { min-height: 96px; }
.drop-name { display: block; padding: 20px; font-weight: 650; word-break: break-all; }
.drop-name[hidden] { display: none; }
.drop.has-file .drop-hint { display: none; }
.drop.has-file { border-style: solid; }
.rcpt-cur { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 600; }
.rcpt-cur .ic { color: var(--up); }
.rcpt-cur a { margin-left: auto; color: var(--focus); }
.pick-or { margin: 0; }

.actionbar {
  position: sticky; bottom: 0; z-index: 10; display: flex; gap: 10px;
  margin: 0 calc(var(--gap) * -1); padding: 12px var(--gap) calc(12px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.danger-zone { margin-top: 28px; display: grid; }

/* ---------- Übersicht ---------- */
.summary { background: var(--surface); border-radius: var(--r-l); padding: 18px 16px 16px; display: grid; gap: 16px; }
.sum-main { display: grid; gap: 6px; justify-items: start; }
.big { font-size: 2rem; line-height: 1.1; letter-spacing: -.03em; font-weight: 800; }
.big.dim { color: var(--ink-3); }
.sum-side { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 14px; border-top: 1px solid var(--line); }
.sum-side > div { display: grid; gap: 2px; align-content: start; }
.sum-side strong { font-size: 1.0625rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: .875rem; font-weight: 700; }
.pill .ic { width: 1rem; height: 1rem; }
.pill.up { background: var(--up-bg); color: var(--up); }
.pill.down { background: var(--down-bg); color: var(--down); }
.pill.sm { padding: 1px 8px; font-size: .8125rem; }

/* ---------- Suche & Filter ---------- */
.search { display: grid; grid-template-columns: minmax(0, 1fr) 138px; gap: 8px; margin: 16px 0 12px; }
.search-field { position: relative; }
.search-field .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); pointer-events: none; }
.search-field input { padding-left: 44px; background: var(--surface); }
.search select { background: var(--surface); padding-right: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 calc(var(--gap) * -1) 14px; padding: 2px var(--gap); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; font-weight: 600; font-size: .9375rem; color: var(--ink-2); }
.chip[aria-current="true"] { background: var(--primary); color: var(--on-primary); border-color: transparent; }

/* ---------- Produktliste ---------- */
/* kein overflow:clip – sonst wird das Aktionsmenü am letzten Eintrag abgeschnitten; Rundung sitzt an den Randelementen */
.items { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-l); }
.items > :first-child { border-top-left-radius: var(--r-l); border-top-right-radius: var(--r-l); }
.items > :last-child { border-bottom-left-radius: var(--r-l); border-bottom-right-radius: var(--r-l); }
.group { position: sticky; top: var(--header-h); z-index: 2; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--surface-2); font-weight: 650; font-size: .9375rem; color: var(--ink-2); }
.item {
  position: relative; display: grid; gap: 4px 12px; padding: 14px;
  grid-template-columns: 76px minmax(0, 1fr) 44px;
  grid-template-areas: "thumb info menu" "thumb money money" "multi multi multi" "src src src";
  align-items: start; border-top: 1px solid var(--line);
}
.group + .item { border-top: 0; }
.thumb { grid-area: thumb; position: relative; width: 76px; height: 76px; }
.thumb-img { width: 100%; height: 100%; border-radius: 10px; background: var(--surface-2); overflow: hidden; display: grid; place-items: center; color: var(--ink-3); }
.thumb-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Das Regalschild: einzige Signalfarbe der Anwendung */
.tag { display: inline-block; max-width: 100%; min-width: 28px; padding: 2px 8px; border-radius: 5px; background: var(--label); color: var(--on-label); font-weight: 800; font-size: .8125rem; line-height: 1.35; letter-spacing: .02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.thumb .tag { position: absolute; left: -4px; bottom: -6px; max-width: 92px; box-shadow: 0 0 0 2px var(--surface); }

.info { grid-area: info; min-width: 0; display: grid; gap: 2px; padding-top: 2px; }
.info h3 { font-size: 1rem; font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stretch { text-decoration: none; }
.stretch::after { content: ""; position: absolute; inset: 0; }
.meta { color: var(--ink-3); font-size: .875rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.qty { color: var(--ink-2); font-size: .875rem; font-weight: 600; }
.multi { grid-area: multi; list-style: none; margin: 6px 0 0; padding: 8px 10px; display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 6px 10px; border-radius: var(--r-s); background: var(--bg); }
.multi li { display: grid; gap: 1px; min-width: 0; }
.multi .num { font-weight: 700; font-size: .9375rem; white-space: nowrap; }
.multi .foot { grid-column: 1 / -1; color: var(--ink-3); font-size: .75rem; line-height: 1.35; }
.multi sup { font-size: .7em; color: var(--ink-3); }
.multi .dim { color: var(--ink-3); }
.money { grid-area: money; display: flex; flex-wrap: wrap; gap: 4px 18px; align-items: flex-end; margin-top: 4px; }
.money > div { display: grid; gap: 1px; justify-items: start; }
.money .num { font-weight: 700; font-size: .9375rem; }

.menu { grid-area: menu; position: relative; z-index: 4; justify-self: end; }
.menu summary { list-style: none; width: 44px; height: 44px; margin: -8px -8px 0 0; display: grid; place-items: center; border-radius: 12px; cursor: pointer; color: var(--ink-2); }
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover, .menu[open] summary { background: var(--surface-2); }
.menu-pop { position: absolute; right: 0; top: 40px; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.menu-pop form { margin: 0; }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 46px; padding: 0 12px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 500 .9375rem var(--font); text-align: left; text-decoration: none; cursor: pointer; }
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .danger { color: var(--down); }

.perr { grid-area: src; position: relative; z-index: 2; margin-top: 6px; padding: 8px 10px; border-radius: var(--r-s); background: var(--down-bg); color: var(--down); font-size: .8125rem; line-height: 1.4; }
.qty .rcpt { position: relative; z-index: 2; display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 3px 9px 3px 7px; border-radius: 999px; background: var(--up-bg); color: var(--up); text-decoration: none; font-size: .8125rem; font-weight: 650; vertical-align: middle; }
.qty .rcpt .ic { width: 1rem; height: 1rem; }
.src { grid-area: src; position: relative; z-index: 2; margin-top: 4px; }
.src summary { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; list-style: none; cursor: pointer; color: var(--ink-3); font-size: .8125rem; font-weight: 600; }
.src summary::-webkit-details-marker { display: none; }
.src summary .ic { width: 1rem; height: 1rem; transition: transform .15s ease; }
.src[open] summary .ic { transform: rotate(90deg); }
.src ul { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; font-size: .875rem; }
.src li { display: flex; flex-wrap: wrap; gap: 2px 12px; align-items: baseline; padding: 8px 10px; background: var(--bg); border-radius: var(--r-s); }
.src li > :first-child { font-weight: 650; }
.src .when { color: var(--ink-3); font-size: .8125rem; }
.src .detail { flex-basis: 100%; order: 3; color: var(--ink-2); font-size: .8125rem; }
.src .when, .src a { order: 4; }
.src a { color: var(--focus); font-weight: 600; }

.empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 56px 20px; background: var(--surface); border-radius: var(--r-l); }
.empty p { color: var(--ink-2); max-width: 34ch; margin-bottom: 8px; }

/* ---------- Einstellungen ---------- */
.accs { display: grid; gap: 10px; }
.acc { background: var(--surface); border-radius: var(--r-l); scroll-margin-top: calc(var(--header-h) + 8px); }
.acc summary { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 12px 16px; cursor: pointer; list-style: none; border-radius: var(--r-l); }
.acc summary::-webkit-details-marker { display: none; }
.acc-ic { width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2); display: grid; place-items: center; flex: none; }
.acc-t { display: grid; gap: 1px; min-width: 0; flex: 1; }
.acc-t small { color: var(--ink-3); font-size: .8125rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chev { color: var(--ink-3); transition: transform .18s ease; }
.acc[open] > summary .chev { transform: rotate(90deg); }
.acc-body { padding: 4px 16px 18px; }
.addon { border: 1.5px solid var(--line); border-radius: var(--r-m); padding: 12px 14px 14px; display: grid; gap: 12px; margin: 0; min-width: 0; }
.addon legend { font-weight: 700; padding: 0 6px; }
.test-row { display: grid; gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; position: relative; font-weight: 600; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 48px; height: 28px; margin: 0; cursor: pointer; }
.track { width: 48px; height: 28px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background-color .15s ease; }
.track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .15s ease; }
.switch input:checked + .track { background: var(--up); }
.switch input:checked + .track::after { transform: translateX(20px); }
.switch input:focus-visible + .track { outline: 3px solid var(--focus); outline-offset: 2px; }

dl.sysinfo { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; font-size: .9375rem; padding-top: 6px; }
dl.sysinfo dt { color: var(--ink-3); }
dl.sysinfo dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- Hinweise (Toasts) ---------- */
.toasts { position: fixed; z-index: 60; left: 0; right: 0; top: calc(var(--header-h) + env(safe-area-inset-top) + 8px); display: grid; gap: 8px; justify-items: center; padding: 0 var(--gap); pointer-events: none; }
.toast { pointer-events: auto; width: min(100%, 520px); display: flex; align-items: flex-start; gap: 10px; padding: 12px 8px 12px 14px; border-radius: var(--r-m); background: var(--primary); color: var(--on-primary); box-shadow: var(--shadow); font-size: .9375rem; line-height: 1.35; animation: toast-in .22s ease-out; }
.toast > .ic { margin-top: 2px; }
.toast > span { flex: 1; padding-top: 1px; overflow-wrap: anywhere; }
.toast.error { background: var(--down); color: #fff; }
.toast-x { flex: none; width: 36px; height: 36px; margin: -6px 0; display: grid; place-items: center; border: 0; border-radius: 10px; background: transparent; color: inherit; cursor: pointer; }
.toast-x:hover { background: rgb(255 255 255 / .16); }
.toast.leaving { opacity: 0; transform: translateY(-8px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- Anmeldung & Einrichtung ---------- */
.auth-card { max-width: 520px; margin: 0 auto; display: grid; gap: 16px; }
.auth-card.narrow { max-width: 400px; padding-top: 12vh; }
.lead { color: var(--ink-2); }

/* ---------- Ab 600 px: Formulare zweispaltig ---------- */
/* Lager: Lagerstätten und Boxen */
.stor-add { display: grid; gap: 10px; margin-bottom: 18px; }
.fold > summary { display: flex; align-items: center; min-height: 44px; margin: -8px 0; cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s ease; }
.fold[open] > summary::after { transform: rotate(-135deg); }
.fold[open] > summary { margin-bottom: 6px; }
.site { margin-bottom: 22px; }
.site-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-bottom: 8px; }
.site-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1.125rem; flex: 1; }
.site-head .ic { width: 1.25rem; height: 1.25rem; color: var(--ink-3); }
.site-edit { flex-basis: 100%; }
.boxes { list-style: none; margin: 0; padding: 0; background: var(--surface); border-radius: var(--r-l); overflow: clip; }
.box { padding: 14px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.box:first-child { border-top: 0; }
.box-main { display: grid; grid-template-columns: minmax(64px, auto) minmax(0, 1fr); gap: 8px 14px; align-items: center; }
.box-main .btn { grid-column: 1 / -1; }
.box-fill { display: grid; gap: 4px; min-width: 0; }
.box-txt { font-size: .875rem; color: var(--ink-2); font-weight: 600; }
.box-txt.over, .cap.over { color: var(--down); }
progress { width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: var(--surface-2); accent-color: var(--up); appearance: none; -webkit-appearance: none; }
progress::-webkit-progress-bar { background: var(--surface-2); border-radius: 999px; }
progress::-webkit-progress-value { background: var(--up); border-radius: 999px; }
progress::-moz-progress-bar { background: var(--up); border-radius: 999px; }
progress.over::-webkit-progress-value { background: var(--down); }
progress.over::-moz-progress-bar { background: var(--down); }
.fold-in > summary { display: inline-flex; align-items: center; min-height: 36px; cursor: pointer; color: var(--ink-3); font-size: .875rem; font-weight: 600; }
.fold-in[open] { display: grid; gap: 14px; }
.fold-in[open] > summary { margin-bottom: -4px; }
.stor-sum { margin-bottom: 14px; }
.stor-sum .big { font-size: 2.25rem; }
.filterbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0 0 14px; padding: 8px 14px; border-radius: var(--r-m); background: var(--surface); font-weight: 600; }
.filterbar a { color: var(--focus); }
.group .cap { margin-left: auto; font-size: .8125rem; font-weight: 600; color: var(--ink-3); }

/* Debug-Ausgabe der Preiserkennung */
.dbg { flex-basis: 100%; order: 5; margin-top: 4px; }
.dbg summary { display: inline-flex; align-items: center; min-height: 32px; cursor: pointer; color: var(--ink-3); font-size: .8125rem; font-weight: 650; }
.dbg pre { margin: 4px 0 0; padding: 10px; max-height: 320px; overflow: auto; border-radius: var(--r-s); background: var(--surface); border: 1px solid var(--line); color: var(--ink); font: .75rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.perr .dbg summary { color: inherit; }
.dbg-toggle[aria-pressed="true"] { background: var(--label); color: var(--on-label); border-color: transparent; }

/* Auswahlhilfe im Produktformular (Produktart -> Set -> Produktname) */
.pick > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-height: 44px; margin: -8px 0; cursor: pointer; list-style: none; }
.pick > summary::-webkit-details-marker { display: none; }
.pick > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg); transition: transform .15s ease; }
.pick[open] > summary::after { transform: rotate(-135deg); }
.pick[open] > * + * { margin-top: 14px; }
.pick[open] > summary + * { margin-top: 22px; }
.req { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: var(--label); color: var(--on-label); font-size: .6875rem; font-weight: 800; letter-spacing: .03em; text-transform: uppercase; vertical-align: middle; }
.pick-state { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 4px 10px; border-radius: 999px; background: var(--up-bg); color: var(--up); font-size: .8125rem; font-weight: 600; }
.pick-state[hidden], .pick-actions [hidden] { display: none; }
.pick-state .ic { width: 1rem; height: 1rem; flex: none; }
.pick-state span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pick select { text-overflow: ellipsis; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pick-actions .btn { flex: 1 1 140px; }

@media (min-width: 600px) {
  .row2 { grid-template-columns: 1fr 1fr; }
  .sum-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 1.75rem; }
}

/* ---------- Ab 900 px: Desktop – obere Navigation, tabellarische Liste ---------- */
@media (min-width: 900px) {
  :root { --gap: 28px; --header-h: 64px; }
  .tabbar { display: none; }
  .top-nav { display: flex; align-items: center; gap: 6px; }
  .top-nav a:not(.btn) { padding: 8px 14px; border-radius: 999px; text-decoration: none; font-weight: 600; color: var(--ink-2); }
  .top-nav a:not(.btn):hover { background: var(--surface-2); }
  .top-nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }
  .top-nav .btn { margin-left: 8px; }
  .wrap { padding-bottom: 56px; }
  .tab-add-btn { box-shadow: none; }

  .summary { grid-template-columns: 1.3fr 1fr auto; align-items: center; gap: 28px; padding: 22px 26px; }
  .sum-side { padding: 0 0 0 28px; border: 0; border-left: 1px solid var(--line); }
  .big { font-size: 2.5rem; }
  .search { grid-template-columns: 1fr 200px; }
  .chips { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; overflow: visible; }

  .item { grid-template-columns: 88px minmax(0, 1fr) 280px 44px; grid-template-areas: "thumb info money menu" ". multi multi ." ". src src ."; gap: 4px 20px; padding: 14px 18px; align-items: center; }
  .thumb { width: 88px; height: 88px; }
  .thumb .tag { max-width: 104px; }
  .money { margin: 0; flex-wrap: nowrap; gap: 24px; }
  .money > div { min-width: 118px; }
  .src { margin: 0; }
  .menu summary { margin: 0; }
  .toasts { top: calc(var(--header-h) + 12px); }

  .actionbar { position: static; margin: 4px 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; justify-content: flex-start; }
  .actionbar .btn.grow { flex: none; min-width: 200px; }
  .stack { max-width: 720px; }
  .accs { max-width: 760px; }
  #item-form, .danger-zone { max-width: 720px; }
  .acc-body { padding-inline: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.searchrow { display: flex; gap: .5rem; }
.searchrow input { flex: 1; min-width: 0; }
.searchrow .btn { flex: none; }

.vsrc { margin-left: .5rem; }
