/* GrowTechnology Lagerübersicht — "warehouse manifest".
   Paper-white sheets, mono figures like a shipping label, teal accent, three stock states.
   Mobile first; tables collapse into cards below 760px. No external requests. */

@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Plex Sans"; src: url("../fonts/ibm-plex-sans-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("../fonts/ibm-plex-mono-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
    --paper: #f5f3ed;
    --sheet: #ffffff;
    --ink: #12272a;
    --ink-2: #3d5357;
    --ink-3: #5a6b6e; /* 5.0:1 on paper, 4.6:1 on the washes */
    --rule: #e2ded2;
    --rule-2: #ece9df;
    --teal: #0b7577; /* white on it 5.5:1 (buttons) */
    --teal-ink: #0a6466;
    --teal-wash: #e3f2f1;
    --in: #0e754d; /* 5.0:1 on its wash, 5.7:1 on white */
    --in-wash: #e2f3ea;
    --soon: #935700; /* 5.1:1 on its wash */
    --soon-wash: #fbefd9;
    --out: #a3442f;
    --out-wash: #f8e5df;
    --star: #d39a00;
    --focus: #0f8a8c;
    --radius: 10px;
    --radius-sm: 7px;
    --shadow: 0 1px 0 rgba(18, 39, 42, .04), 0 8px 24px -12px rgba(18, 39, 42, .18);
    --appbar-h: 60px;
    --sans: "Plex Sans", ui-sans-serif, -apple-system, "Segoe UI", sans-serif;
    --mono: "Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
    --safe-b: env(safe-area-inset-bottom, 0px);
    /* Side gutter of the page; full-bleed bars (sticky toolbar, admin tabs) pull out by exactly this much. */
    --gutter: 16px;
    /* Everything that differs between the themes is a token: text on teal buttons, the logo, the order bar. */
    --on-teal: #fff;
    --logo-filter: none;
    --logo-opacity: 1;
    --orderbar-bg: var(--ink);
    --orderbar-ink: var(--paper);
    color-scheme: light dark;
}
@media (max-width: 360px) { :root { --gutter: 12px; } }

/* Theme (Part 2 A): <html data-theme="system|light|dark"> comes from the server (cookie lager-theme), so there is no
   flash. "System" follows the device; "Hell" and "Dunkel" fix it, form controls and scrollbars included. The dark tokens
   are written twice, for a dark device without a fixed light theme and for a fixed dark one; the two lists must stay
   identical (StylesheetTest), and nothing else may depend on prefers-color-scheme. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --paper: #0e1719;
        --sheet: #142124;
        --ink: #e7efee;
        --ink-2: #b4c4c5;
        --ink-3: #7f9395;
        --rule: #26383b;
        --rule-2: #1d2d30;
        --teal: #3cc1c1;
        --teal-ink: #6fd6d4;
        --teal-wash: #12353a;
        --in: #4cc98f;
        --in-wash: #13362a;
        --soon: #f0a940;
        --soon-wash: #3a2b10;
        --out: #ec8a73;
        --out-wash: #3b1f19;
        --star: #f2c14e;
        --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
        --on-teal: #08221f;
        --logo-filter: brightness(0) invert(1);
        --logo-opacity: .92;
        --orderbar-bg: #e7efee;
        --orderbar-ink: #12272a;
    }
}
:root[data-theme="dark"] {
    --paper: #0e1719;
    --sheet: #142124;
    --ink: #e7efee;
    --ink-2: #b4c4c5;
    --ink-3: #7f9395;
    --rule: #26383b;
    --rule-2: #1d2d30;
    --teal: #3cc1c1;
    --teal-ink: #6fd6d4;
    --teal-wash: #12353a;
    --in: #4cc98f;
    --in-wash: #13362a;
    --soon: #f0a940;
    --soon-wash: #3a2b10;
    --out: #ec8a73;
    --out-wash: #3b1f19;
    --star: #f2c14e;
    --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 10px 30px -14px rgba(0, 0, 0, .7);
    --on-teal: #08221f;
    --logo-filter: brightness(0) invert(1);
    --logo-opacity: .92;
    --orderbar-bg: #e7efee;
    --orderbar-ink: #12272a;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
    margin: 0;
    font: 400 15px/1.5 var(--sans);
    color: var(--ink);
    background-color: var(--paper);
    /* faint ledger grid */
    background-image:
        linear-gradient(var(--rule-2) 1px, transparent 1px),
        linear-gradient(90deg, var(--rule-2) 1px, transparent 1px);
    background-size: 32px 32px;
    background-position: -1px -1px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; }
a { color: var(--teal-ink); text-underline-offset: 2px; }
a:hover { color: var(--teal); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; }
h2 { font-size: 1.05rem; font-weight: 600; }
h1 small, h2 small { font-size: .8rem; font-weight: 500; }
p { margin: 0 0 1em; }
.mono { font-family: var(--mono); font-feature-settings: "zero" 1; letter-spacing: -.01em; }
.muted { color: var(--ink-3); }
.small { font-size: .82em; }
.nowrap { white-space: nowrap; }
.nowrap-lg { white-space: nowrap; } /* one line while the table has room; may wrap at a space below 1200px */
.break { overflow-wrap: anywhere; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.center { text-align: center; }
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; border-radius: 6px; z-index: 100; }
.skip:focus { left: 8px; }

.ico { width: 18px; height: 18px; flex: none; }

/* ---------- app bar ---------- */
.appbar {
    position: sticky; top: 0; z-index: 30;
    background: color-mix(in srgb, var(--sheet) 96%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(10px);
    backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--rule);
    padding-top: env(safe-area-inset-top, 0px);
}
.appbar-inner {
    max-width: 1320px; margin: 0 auto; height: var(--appbar-h);
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 max(var(--gutter), env(safe-area-inset-right)) 0 max(var(--gutter), env(safe-area-inset-left));
}
.brandmark { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; min-width: 0; min-height: 44px; }
.brandmark img { height: 26px; width: auto; }
.brandmark img, .auth-head img { filter: var(--logo-filter); opacity: var(--logo-opacity); }
.brand-titles { display: flex; flex-direction: column; border-left: 1px solid var(--rule); padding-left: 12px; min-width: 0; }
.brand-titles .t1 { font-weight: 600; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-titles .t2 { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; color: var(--ink-3); }
.usernav { display: flex; align-items: center; gap: 6px; }
.navlink {
    display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px;
    border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; cursor: pointer;
}
.navlink:hover { background: var(--teal-wash); color: var(--teal-ink); }
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 264px;
    background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 6px; display: grid; gap: 2px;
    animation: pop .14s ease-out;
}
.menu-who { padding: 8px 10px 10px; border-bottom: 1px solid var(--rule-2); margin-bottom: 4px; display: grid; }
.menu-who small { color: var(--ink-3); overflow-wrap: anywhere; }
.menu-pop a, .menu-item {
    display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 6px; color: var(--ink);
    text-decoration: none; background: none; border: 0; font: inherit; width: 100%; text-align: left; cursor: pointer;
}
.menu-pop a:hover, .menu-item:hover { background: var(--teal-wash); }
.menu-lang { display: flex; align-items: center; gap: 4px; padding: 6px 10px; color: var(--ink-3); }
.menu-lang button { font: inherit; font-size: .85rem; border: 1px solid var(--rule); background: none; color: var(--ink-2); border-radius: 999px; padding: 0 14px; min-height: 40px; cursor: pointer; }
.menu-lang button.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
/* Theme switch: a segmented control in the account menu and under "Mein Konto", icons only in the footers. */
.theme-switch { display: inline-flex; align-items: center; gap: 2px; margin: 0; padding: 1px; border: 1px solid var(--rule); border-radius: 999px; background: var(--sheet); }
.theme-switch button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; min-width: 40px; padding: 0 12px;
    border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 .84rem var(--sans); cursor: pointer; white-space: nowrap;
}
.theme-switch button:hover { color: var(--teal-ink); }
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.theme-switch .ico { width: 16px; height: 16px; }
.menu-pop .theme-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 2px 10px 6px; }
.menu-pop .theme-switch button { padding: 0 6px; gap: 4px; font-size: .8rem; }
.theme-switch-compact { border-color: transparent; background: none; }
.theme-switch-compact button { padding: 0; color: var(--ink-3); }
.theme-switch-compact button:hover { background: var(--teal-wash); color: var(--ink); }
.theme-switch-compact button[aria-pressed="true"] { background: var(--rule-2); color: var(--ink); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ---------- layout ---------- */
.main { flex: 1; width: 100%; max-width: 1320px; margin: 0 auto; padding: 22px max(var(--gutter), env(safe-area-inset-right)) 40px max(var(--gutter), env(safe-area-inset-left)); }
.main-stock { padding-bottom: 28px; }
.narrow { max-width: 760px; margin: 0 auto; }
.site-footer {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px;
    max-width: 1320px; width: 100%; margin: 0 auto; padding: 18px max(var(--gutter), env(safe-area-inset-right)) calc(18px + var(--safe-b)) max(var(--gutter), env(safe-area-inset-left));
    color: var(--ink-3); font-size: .82rem; border-top: 1px solid var(--rule);
}
.site-footer nav { display: flex; gap: 16px; }
.site-footer a { color: var(--ink-3); display: inline-flex; align-items: center; min-height: 40px; }
.main-stock ~ .site-footer { padding-bottom: calc(18px + var(--safe-b) + var(--orderbar-h, 0px)); }

.card { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px; margin: 0 0 18px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 14px; }
.grid2 { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.grid2 > * { min-width: 0; }
input[type="datetime-local"] { width: 100%; min-width: 0; }
@media (min-width: 640px) { .grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.cols { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.cols > * { min-width: 0; }
.head-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 14px; }
.head-row h1 { margin: 0; }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cols3 { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv-inline { margin-bottom: 18px; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: .82rem; font-weight: 600; color: var(--ink-2); }
input, select, textarea {
    font: inherit; font-size: 16px; /* no iOS zoom */
    color: var(--ink); background: var(--sheet);
    border: 1px solid var(--rule); border-radius: var(--radius-sm);
    padding: 10px 12px; min-height: 44px; width: 100%;
    transition: border-color .15s, box-shadow .15s;
}
textarea { resize: vertical; min-height: 64px; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal) 22%, transparent); }
input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--teal); }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.hint { font-size: .85rem; color: var(--ink-3); margin: 0; }
.card > .hint { margin-bottom: 14px; }
.hint-sep { border-top: 1px dashed var(--rule); padding-top: 14px; margin-top: 4px; }
.code-input { font-family: var(--mono); font-size: 26px; letter-spacing: .4em; text-align: center; padding-left: .4em; }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    min-height: 44px; padding: 0 16px; border-radius: var(--radius-sm);
    border: 1px solid var(--rule); background: var(--sheet); color: var(--ink);
    font: 600 .92rem var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap;
    transition: background .15s, border-color .15s, transform .05s;
}
.btn:hover { border-color: var(--teal); color: var(--teal-ink); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.btn-primary:hover { background: var(--teal-ink); border-color: var(--teal-ink); color: var(--on-teal); }
.btn-ghost { background: transparent; }
.btn-warn { color: var(--soon); border-color: color-mix(in srgb, var(--soon) 40%, var(--rule)); }
.btn-danger { color: var(--out); border-color: color-mix(in srgb, var(--out) 40%, var(--rule)); }
.btn-danger:hover { background: var(--out-wash); border-color: var(--out); color: var(--out); }
.btn-sm { min-height: 40px; padding: 0 12px; font-size: .84rem; }
.btn-block { width: 100%; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }

.flash { border-radius: var(--radius-sm); padding: 11px 14px; margin: 0 0 16px; border: 1px solid; font-size: .92rem; }
.flash-ok { background: var(--in-wash); border-color: color-mix(in srgb, var(--in) 35%, transparent); color: var(--ink); }
.flash-err { background: var(--out-wash); border-color: color-mix(in srgb, var(--out) 35%, transparent); color: var(--ink); }
.flash-warn { background: var(--soon-wash); border-color: color-mix(in srgb, var(--soon) 35%, transparent); color: var(--ink); }

.badge { display: inline-block; font: 600 .72rem var(--mono); text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 999px; white-space: nowrap; }
.badge-ok { background: var(--in-wash); color: var(--in); }
.badge-warn { background: var(--soon-wash); color: var(--soon); }
.badge-bad { background: var(--out-wash); color: var(--out); }
.badge-admin { background: var(--ink); color: var(--paper); }

/* ---------- auth ---------- */
body.auth { justify-content: center; }
.auth-wrap { flex: 1; display: grid; place-items: center; align-content: center; gap: 14px; padding: 24px 16px calc(24px + var(--safe-b)); }
.auth-card {
    width: min(440px, 100%); background: var(--sheet); border: 1px solid var(--rule); border-radius: 14px;
    padding: 28px 24px 24px; box-shadow: var(--shadow); position: relative; overflow: hidden;
    animation: rise .35s cubic-bezier(.2, .7, .2, 1);
}
.auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: repeating-linear-gradient(90deg, var(--teal) 0 18px, transparent 18px 24px); }
.auth-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.auth-head img { height: 32px; width: auto; }
@media (max-width: 360px) { .auth-head img { height: 26px; } } /* the stamp beside it was cut off on 320 px phones */
.stamp { font: 600 .66rem var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--teal-ink); border: 1.5px solid currentColor; border-radius: 4px; padding: 4px 7px; transform: rotate(-2deg); white-space: nowrap; }
.auth-card h1 { font-size: 1.45rem; margin-bottom: .3em; }
.lede { color: var(--ink-2); }
.lede strong { color: var(--ink); font-weight: 600; }
/* /login/code: the code is the second way in, so it sits in a quiet box below the link instruction (R4-1). */
.code-alt { background: var(--paper); border: 1px solid var(--rule-2); border-radius: var(--radius-sm); padding: 14px; margin: 0 0 16px; }
.code-alt-intro { font-size: .9rem; color: var(--ink-2); margin: 0 0 12px; }
.auth-foot { font-size: .8rem; color: var(--ink-3); margin: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0 6px; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; margin: 0 0 0 6px; color: var(--ink-3); font-size: .8rem; }
.lang-switch button { font: 600 .78rem var(--mono); letter-spacing: .04em; border: 0; background: none; color: var(--ink-3); min-height: 40px; min-width: 40px; padding: 0 6px; border-radius: 6px; cursor: pointer; }
.lang-switch button:hover { background: var(--teal-wash); color: var(--ink); }
.lang-switch button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.auth-foot a { color: var(--ink-3); display: inline-flex; align-items: center; min-height: 40px; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: var(--rule-2); border-radius: 9px; padding: 3px; margin: 4px 0 18px; }
.seg button { font: 600 .88rem var(--sans); border: 0; background: none; color: var(--ink-3); min-height: 40px; border-radius: 7px; cursor: pointer; }
.seg button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
/* P3: a refused sign-in says what is wrong in one line, the lock in a second, and offers the two ways out below. */
.flash-lead { margin: 0; font-weight: 600; }
.flash-more { margin: 4px 0 0; font-size: .85rem; color: var(--ink-2); }
.recover { display: grid; gap: 8px; margin: -6px 0 18px; }
.recover-form { margin: 0; }
.card .recover-form { margin: -6px 0 14px; }
/* P1: "Passwort vergessen?" right under the password field: a plain link, but bold and a full tap target. */
.forgot { justify-self: start; display: inline-flex; align-items: center; min-height: 40px; margin: -10px 0 -4px; font-weight: 600; font-size: .92rem; }
.err-code { font-size: 4rem; font-weight: 600; color: var(--teal); margin: 0; line-height: 1; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- stock page ---------- */
.stock-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 16px; }
.stock-title h1 { margin-bottom: .2em; }
.asof { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .86rem; color: var(--ink-3); }
.asof b { color: var(--ink); font-weight: 600; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--in); box-shadow: 0 0 0 0 color-mix(in srgb, var(--in) 60%, transparent); animation: pulse 2.4s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.live.is-stale { background: var(--ink-3); box-shadow: none; animation: none; }
.flash.stale { margin-bottom: 12px; }
.notice {
    display: flex; align-items: flex-start; gap: 10px; margin: 0 0 12px; padding: 11px 14px;
    border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, var(--teal) 35%, transparent);
    border-left-width: 4px; background: var(--teal-wash); color: var(--ink); font-size: .92rem;
}
.notice .ico { color: var(--teal-ink); margin-top: 2px; }
.notice p { margin: 0; overflow-wrap: anywhere; }
.notice-warning { background: var(--soon-wash); border-color: color-mix(in srgb, var(--soon) 45%, transparent); }
.notice-warning .ico { color: var(--soon); }
.notice-levels { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.notice-levels legend { font-size: .82rem; font-weight: 600; color: var(--ink-2); padding: 0; margin-bottom: 6px; width: 100%; }
.notice-levels .check { min-height: 44px; }
input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--teal); }
.reloadbar {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 4px 4px 4px 14px; border-radius: 999px; font-size: .86rem; font-weight: 600;
    background: var(--soon-wash); border: 1px solid color-mix(in srgb, var(--soon) 40%, transparent); color: var(--ink);
}
.reloadbar .btn { border-radius: 999px; }
.reload-short { display: none; }
@media (max-width: 760px) { .reload-long { display: none; } .reload-short { display: inline; } } /* one line on phones */
.reslinks { display: flex; flex-wrap: wrap; gap: 6px; }
.reslinks a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: .84rem; font-weight: 500; color: var(--ink-2); text-decoration: none; border: 1px solid var(--rule); background: var(--sheet); border-radius: 999px; padding: 0 14px; }
.reslinks a:hover { border-color: var(--teal); color: var(--teal-ink); }
.reslinks .ico { width: 14px; height: 14px; }

.toolbar {
    position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px)); z-index: 20;
    display: grid; gap: 10px; margin: 0 calc(-1 * max(var(--gutter), env(safe-area-inset-right))) 6px calc(-1 * max(var(--gutter), env(safe-area-inset-left)));
    padding: 10px max(var(--gutter), env(safe-area-inset-right)) 10px max(var(--gutter), env(safe-area-inset-left));
    background: var(--paper);
}
.toolbar::after { content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px; pointer-events: none; background: linear-gradient(var(--paper), transparent); }
.brandtabs { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.brandtabs::-webkit-scrollbar { display: none; }
.brandtab {
    flex: none; scroll-snap-align: start; font: 600 .92rem var(--sans); min-height: 42px; padding: 0 16px;
    border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2); cursor: pointer;
}
.brandtab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.brandtab { position: relative; display: inline-flex; align-items: center; gap: 7px; }
.brandtab.is-none:not([aria-selected="true"]) { color: var(--ink-3); background: transparent; border-style: dashed; } /* dimmed, still >= 4.5:1 */
.tabcount { min-width: 22px; padding: 1px 6px; border-radius: 999px; font-size: .72rem; line-height: 1.5; text-align: center; background: var(--teal-wash); color: var(--teal-ink); }
.brandtab[aria-selected="true"] .tabcount { background: var(--paper); color: var(--ink); }
.tabcount[hidden] { display: none; }
/* F7: availability filter — one segmented control, labels stay visible on phones (unlike .chip) */
.availseg { display: inline-flex; padding: 1px; gap: 2px; border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); }
.availseg button {
    display: inline-flex; align-items: center; justify-content: center; gap: 4px; min-height: 40px; padding: 0 12px;
    border: 0; border-radius: 999px; background: none; color: var(--ink-2); font: 600 .84rem var(--sans); cursor: pointer; white-space: nowrap;
}
.availseg button:hover { color: var(--teal-ink); }
.availseg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.segdot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.segdot-in { background: var(--in); }
.segdot-soon { background: var(--soon); }
.segdot + .segdot { margin-left: -2px; }
.segdot:last-of-type { margin-right: 3px; }
.hits-other { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 8px; }
.hits-other[hidden] { display: none; }
@media (max-width: 1000px) {
    .availseg { order: 5; flex: 1 1 100%; }
    .availseg button { flex: 1 1 auto; min-width: 44px; padding: 2px 10px; white-space: normal; line-height: 1.15; text-align: center; }
}
/* Landscape phones: appbar, a sticky toolbar and the order bar would cover the whole window. The toolbar scrolls
   away with the page there (app.js then leaves it out of scroll-padding), so the list keeps most of the height; only
   the reload bar (F1) stays in view under the appbar while it is shown. */
@media (max-height: 500px) {
    .toolbar { position: static; }
    .toolbar::after { display: none; }
    .reloadbar:not([hidden]) {
        position: fixed; z-index: 25; top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px) + 6px);
        left: max(var(--gutter), env(safe-area-inset-left)); right: max(var(--gutter), env(safe-area-inset-right)); box-shadow: var(--shadow);
    }
}

.tools form { margin: 0; }
.search { position: relative; flex: 1 1 260px; display: flex; align-items: center; }
.search .ico { position: absolute; left: 12px; color: var(--ink-3); pointer-events: none; }
.search input { padding-left: 38px; border-radius: 999px; background: var(--sheet); }
.chip {
    display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px;
    border-radius: 999px; border: 1px solid var(--rule); background: var(--sheet); color: var(--ink-2);
    font: 600 .86rem var(--sans); cursor: pointer; white-space: nowrap;
}
.chip:hover { border-color: var(--teal); color: var(--teal-ink); }
.chip[aria-pressed="true"] { background: color-mix(in srgb, var(--star) 16%, var(--sheet)); border-color: var(--star); color: var(--ink); }
.chip[aria-pressed="true"] .ico { fill: var(--star); stroke: var(--star); }
.chip-icon { width: 44px; padding: 0; justify-content: center; }
.chip-strong { background: var(--teal); border-color: var(--teal); color: var(--on-teal); }
.chip-strong:hover { background: var(--teal-ink); color: var(--on-teal); }
.dates-note { font-size: .8rem; color: var(--ink-3); margin: 0 0 12px; }
.dates-note-foot { margin-top: 14px; }

.sheet { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table.stock { width: 100%; border-collapse: collapse; }
table.stock thead th {
    font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .1em; color: var(--ink-3);
    text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); background: var(--sheet); white-space: nowrap;
}
table.stock thead sup { color: var(--soon); }
table.stock td, table.stock tbody th { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; text-align: left; font-weight: 400; }
.c-num { text-align: right !important; white-space: nowrap; }
table.stock thead .c-num { text-align: right; }
.c-code { white-space: nowrap; font-size: .86rem; color: var(--ink); font-weight: 500 !important; }
.c-name { color: var(--ink-2); }
.c-fav { width: 44px; padding-right: 0 !important; }
.c-qty { width: 150px; }
/* C7: the packing unit; an article with a VPE above 1 stands out, its explanation is its title and the note below the
   quantity (tapping it shows the note). */
.c-vpe { text-align: right !important; white-space: nowrap; width: 64px; color: var(--ink-3); font-size: .86rem; }
.has-vpe .c-vpe { color: var(--ink); font-weight: 600; }
[data-vpe-tip] { cursor: help; }
.qty-vpe { display: none; } /* the VPE caption under the field, only where the VPE column does not fit (tablets) */
.qty-note { display: block; margin-top: 4px; font-size: .74rem; line-height: 1.3; color: var(--teal-ink); text-align: right; }
.qty-note[hidden] { display: none; }
.c-date { white-space: nowrap; }

.aisle-head th { padding: 0 !important; background: color-mix(in srgb, var(--teal-wash) 55%, var(--sheet)); border-bottom: 1px solid var(--rule) !important; }
.aisle-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 0 12px;
    background: none; border: 0; color: var(--ink); font: 600 .9rem var(--sans); cursor: pointer; text-align: left;
}
.aisle-no { font-size: .72rem; color: var(--teal-ink); border: 1px solid color-mix(in srgb, var(--teal) 45%, transparent); border-radius: 4px; padding: 1px 5px; }
.aisle-name { flex: 1; }
.aisle-count { font-size: .76rem; color: var(--ink-3); background: var(--sheet); border: 1px solid var(--rule); border-radius: 999px; padding: 1px 8px; }
.chev { transition: transform .18s; color: var(--ink-3); }
.aisle.collapsed .chev { transform: rotate(-90deg); }
.aisle.collapsed .item { display: none; }

.item:hover td, .item:hover th { background: color-mix(in srgb, var(--teal-wash) 30%, transparent); }
.c-avail { font-weight: 600; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; background: var(--out); }
.is-in .dot { background: var(--in); }
.is-soon .dot { background: var(--soon); }
.is-in .c-avail { color: var(--in); }
.is-soon .c-avail { color: var(--soon); }
.is-out .c-avail { color: var(--out); }
.pill { display: inline-block; font-size: .8rem; background: var(--soon-wash); color: var(--soon); border-radius: 5px; padding: 2px 7px; border: 1px dashed color-mix(in srgb, var(--soon) 55%, transparent); }

.iconbtn {
    display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 8px;
    border: 1px solid transparent; background: none; color: var(--ink-3); cursor: pointer; flex: none;
}
.iconbtn:hover { color: var(--ink); background: var(--rule-2); }
.fav[aria-pressed="true"] { color: var(--star); }
.fav[aria-pressed="true"] .ico { fill: var(--star); }
.fav:active .ico, .bell:active .ico { transform: scale(.85); }
.bell[aria-pressed="true"] { color: var(--teal); background: var(--teal-wash); }
.bell[aria-pressed="true"] .ico { fill: color-mix(in srgb, var(--teal) 30%, transparent); }
.qty-wrap { display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
.bell-slot { width: 40px; height: 40px; flex: none; } /* the bell's place in rows without one: quantities line up (Part 2 B) */
.qty { width: 84px; min-height: 40px; padding: 6px 8px; text-align: right; font-family: var(--mono); }
.qty.has { border-color: var(--teal); background: var(--teal-wash); font-weight: 600; }

.no-results { display: grid; justify-items: center; gap: 6px; padding: 40px 16px; color: var(--ink-3); text-align: center; }
.no-results .ico { width: 30px; height: 30px; }
.no-results b { color: var(--ink); }
.searching .aisle.collapsed .item:not(.q-hide) { display: table-row; }
.q-hide, .f-hide { display: none !important; }
.empty { padding: 40px 0; color: var(--ink-3); }

/* sticky order bar */
.orderbar {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0;
    background: var(--orderbar-bg); color: var(--orderbar-ink);
    padding: 10px max(14px, env(safe-area-inset-right)) calc(10px + var(--safe-b)) max(14px, env(safe-area-inset-left));
    box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .45);
    animation: slideup .25s cubic-bezier(.2, .7, .2, 1);
}
.orderbar-inner { max-width: 1320px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.orderbar-sum {
    display: flex; align-items: center; gap: 10px; flex: 1 1 auto; min-height: 48px; padding: 0 8px 0 14px;
    border-radius: var(--radius-sm); border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    background: color-mix(in srgb, currentColor 8%, transparent); color: inherit; font: 400 .92rem var(--sans); text-align: left; cursor: pointer;
}
.orderbar-sum:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.orderbar-counts { display: flex; flex-wrap: wrap; gap: 0 10px; flex: 1 1 auto; }
.orderbar-counts > span { white-space: nowrap; } /* "6 Positionen", never the number above the word */
.orderbar-sum .muted { color: inherit; opacity: .65; }
.orderbar-open { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; white-space: nowrap; }
.chev-up { transform: rotate(180deg); }
.orderbar-actions { display: flex; gap: 8px; }
.orderbar .btn-ghost { color: inherit; border-color: color-mix(in srgb, currentColor 30%, transparent); }
.orderbar-hint { max-width: 1320px; margin: 4px auto 0; font-size: .74rem; opacity: .6; }
@media (max-height: 500px) { .orderbar-hint { display: none; } } /* the review dialog says it too */
@keyframes slideup { from { transform: translateY(100%); } }

/* F8: order review dialog (a bottom sheet on phones) */
html { scroll-padding-top: calc(var(--appbar-h) + var(--toolbar-h, 0px) + 8px); scroll-padding-bottom: calc(var(--orderbar-h, 0px) + 8px); }
.review {
    width: min(760px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; overflow-y: auto; overscroll-behavior: contain;
    border: 1px solid var(--rule); border-radius: 14px; background: var(--sheet); color: var(--ink); box-shadow: var(--shadow);
}
.review::backdrop { background: rgba(18, 39, 42, .5); }
.review-head {
    position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 12px 10px 18px; background: var(--sheet); border-bottom: 1px solid var(--rule);
}
.review-head h2 { margin: 0; font-size: 1.15rem; }
.review-sum { margin: 10px 18px 0; font-size: .86rem; color: var(--ink-3); }
.review-list { list-style: none; margin: 0; padding: 4px 18px; }
.rl { display: flex; align-items: flex-start; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.rl-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.rl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.rl-code { font-size: .92rem; }
.rl-brand { font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
.rl-name { font-size: .88rem; color: var(--ink-2); overflow-wrap: anywhere; }
.rl-stock { font-size: .8rem; color: var(--ink-3); }
.rl-stock .dot { margin-right: 6px; }
.rl-flag { display: flex; align-items: flex-start; gap: 6px; margin-top: 4px; padding: 5px 8px; border-radius: var(--radius-sm); background: var(--soon-wash); color: var(--ink); font-size: .82rem; font-weight: 600; }
.rl-flag[hidden] { display: none; }
.rl-flag .ico { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--soon); }
.rl.is-out .rl-flag { background: var(--out-wash); }
.rl.is-out .rl-flag .ico { color: var(--out); }
.rl-qty { display: flex; align-items: center; gap: 2px; flex: none; }
.rl.is-flagged .qty { border-color: var(--soon); }
.review-foot { position: sticky; bottom: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 12px 18px calc(14px + var(--safe-b)); background: var(--sheet); border-top: 1px solid var(--rule); }
.review-foot .hint { font-size: .8rem; }
/* C0: one short line above the send button: a request, not an order. */
.review-note { display: flex; align-items: flex-start; gap: 8px; margin: 0; padding: 8px 10px; border-left: 3px solid var(--teal); border-radius: var(--radius-sm); background: var(--teal-wash); color: var(--ink); font-size: .84rem; line-height: 1.4; }
.review-note .ico { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--teal-ink); }
.review-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
/* A label longer than the dialog is wide (320 px phones, larger text) wraps inside its button: the foot's single column
   (minmax(0, 1fr) above) never grows past the dialog, so nothing scrolls sideways (review round 2). */
.review-actions .btn { white-space: normal; max-width: 100%; text-align: center; }
/* Short windows (landscape phones, low desktop windows): a sticky foot would leave the list a sliver, so it scrolls
   with the list as on phones, and the head is the only sticky part. */
@media (max-height: 600px) {
    .review { max-height: calc(100dvh - 16px); }
    .review-foot { position: static; border-top: 0; }
}
@media (max-width: 760px) {
    .review { width: 100%; max-width: 100%; max-height: 92dvh; margin: auto 0 0; border-radius: 14px 14px 0 0; border-bottom: 0; }
    .review-list { padding: 4px 14px; }
    .review-head { padding-left: 14px; }
    .review-sum { margin-left: 14px; margin-right: 14px; }
    .review-foot { position: static; padding-left: 14px; padding-right: 14px; border-top: 0; } /* the list gets the height; download after reading it */
    .review-actions .btn { flex: 1 1 auto; }
    .review-foot textarea { min-height: 48px; }
}

/* C2: sending the order from the dialog, and the answer */
.review-error { margin: 0; }
.review-done { display: grid; gap: 10px; padding: 18px 18px calc(18px + var(--safe-b)); }
.review-done[hidden] { display: none; }
.review-done:focus { outline: none; }
.review-done p { margin: 0; }
.review-done-title { display: flex; align-items: center; gap: 8px; font-size: 1.05rem; }
.review-done-title .ico { color: var(--in); }
[data-order-send][aria-busy="true"] { cursor: progress; opacity: .8; }

/* C3: Meine Anfragen */
.order-rec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; margin-bottom: 12px; }
.order-rec-head h2 { margin: 0; font-size: 1.05rem; }
.order-rec-lines { margin-top: 12px; }
.order-rec-lines summary { display: inline-flex; align-items: center; min-height: 40px; cursor: pointer; color: var(--teal-ink); font-weight: 500; }
.order-rec-lines .table-wrap { margin: 8px 0 0; }

/* ---------- admin ---------- */
.admin { display: grid; gap: 18px; grid-template-columns: 1fr; }
.admin-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter) 6px; border-bottom: 1px solid var(--rule); }
.admin-nav::-webkit-scrollbar { display: none; }
.admin-nav a { display: inline-flex; align-items: center; gap: 8px; flex: none; min-height: 42px; padding: 0 12px; border-radius: var(--radius-sm); color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .9rem; }
.admin-nav a:hover { background: var(--teal-wash); color: var(--teal-ink); }
.admin-nav a.on { background: var(--ink); color: var(--paper); }
@media (min-width: 1000px) {
    .admin { grid-template-columns: 200px minmax(0, 1fr); align-items: start; }
    .admin-nav { flex-direction: column; position: sticky; top: calc(var(--appbar-h) + 18px); margin: 0; padding: 0; border: 0; overflow: visible; }
    .admin-nav-out { margin-top: 12px; border-top: 1px solid var(--rule); border-radius: 0 !important; padding-top: 12px !important; }
}
.admin-body { min-width: 0; }
.tiles { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); margin-bottom: 14px; }
.tile { display: grid; gap: 2px; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile b { font-size: 1.7rem; line-height: 1.1; }
.tile span { font-size: .82rem; color: var(--ink-2); }
.tile small { color: var(--ink-3); }
a.tile:hover { border-color: var(--teal); }
.tile-warn { border-color: var(--soon); background: color-mix(in srgb, var(--soon-wash) 60%, var(--sheet)); }
.tile-bad { border-color: var(--out); background: color-mix(in srgb, var(--out-wash) 70%, var(--sheet)); }
.tile-bad b { color: var(--out); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; align-items: center; }
.filters input[type="search"] { flex: 1 1 260px; width: auto; }
.filters select { width: auto; flex: 0 1 200px; }
/* position: relative keeps the visually hidden header labels (.sr, absolute) inside the scroller: without it they sat
   at the table's right edge and widened the whole page whenever a table was wider than its box. */
.table-wrap { position: relative; background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); overflow: auto; margin-bottom: 14px; box-shadow: var(--shadow); }
.card .table-wrap { box-shadow: none; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th { font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
.data-compact td { padding: 7px 10px; }
.ua { color: var(--ink-3); font-size: .8rem; max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-off td { opacity: .55; }
.rowform { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex: 1 1 auto; margin: 0; }
.inline-del { margin: 0; }
.w-sort { width: 84px; flex: none; }
.w-art { width: 220px; flex: 1 1 160px; }
.w-grow { flex: 1 1 180px; width: auto; }
/* Touch: grow hit areas of text links in tables without changing the layout. */
@media (pointer: coarse) {
    table.data td a:not(.btn), .kv a:not(.btn), .pager a, .plain a:not(.btn), .head-row > a:not(.btn), .card > p > a:not(.btn), .admin-body > p > a:not(.btn) {
        display: inline-block; padding: 9px 11px; margin: -9px -11px;
    }
}
/* Brand list: "3 Kategorien · 16 Artikel →" opens the brand; a 40 px target on every screen, not a 22 px text line. */
table.data td a.brand-open { display: inline-flex; align-items: center; min-height: 40px; padding: 0 8px; margin: 0 -8px; border-radius: var(--radius-sm); }
table.data td a.brand-open:hover { background: var(--teal-wash); color: var(--teal-ink); }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 10px 0 18px; font-size: .88rem; color: var(--ink-3); }

/* Admin catalog per brand (Part 2 D/E): every category with its articles in compact rows. All row actions are 40 px
   icon buttons in one cell; rows are about 48 px high on wide screens and cards below 1000 px. */
.catalog-hint { margin-bottom: 14px; }
.catalog-error { margin-bottom: 12px; }
.catalog.is-busy { cursor: progress; }
.catsec {
    background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow);
    margin: 0 0 14px; scroll-margin-top: calc(var(--appbar-h) + 12px);
}
.catsec-head {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 4px 6px 4px 4px;
    background: color-mix(in srgb, var(--teal-wash) 55%, var(--sheet)); border-bottom: 1px solid var(--rule); border-radius: var(--radius) var(--radius) 0 0;
}
.catsec-title { flex: 1 1 160px; min-width: 0; margin: 0; font-size: .95rem; overflow-wrap: anywhere; }
.catsec-title small { font-weight: 400; }
.catsec-actions { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.catsec-actions form, .sku-actions form { margin: 0; }
.catsec-edit { display: none; gap: 10px; padding: 12px; border-bottom: 1px solid var(--rule); }
.catsec-edit:target, .catsec-edit.is-open { display: grid; }
@media (min-width: 640px) { .catsec-edit { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; align-items: end; } }
.grip { display: inline-grid; place-items: center; width: 28px; height: 40px; border-radius: 6px; color: var(--ink-3); cursor: move; flex: none; }
.grip:hover { color: var(--ink); background: var(--rule-2); }
.iconbtn:disabled { opacity: .35; cursor: default; background: none; }
.iconbtn-danger:hover { color: var(--out); background: var(--out-wash); }
.catsec .table-wrap { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
table.skus { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.skus thead th { font: 600 .7rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
table.skus td, table.skus tbody th { padding: 4px 8px; border-bottom: 1px solid var(--rule-2); vertical-align: middle; text-align: left; font-weight: 400; }
.sku { scroll-margin-top: calc(var(--appbar-h) + 12px); }
.sku:hover td, .sku:hover th { background: color-mix(in srgb, var(--teal-wash) 30%, transparent); }
table.skus .sku-grip { width: 32px; padding-left: 4px; padding-right: 0; }
.sku-art { white-space: nowrap; width: 1%; }
.sku-art-text { font-size: .86rem; font-weight: 500; }
.sku-name { color: var(--ink-2); overflow-wrap: anywhere; }
table.skus .sku-avail { text-align: right; white-space: nowrap; width: 1%; }
table.skus .sku-vpe { text-align: right; white-space: nowrap; width: 1%; color: var(--ink-3); }
table.skus .has-vpe .sku-vpe { color: var(--ink); font-weight: 600; }
.sku-edit input.sku-vpe-input { width: 5.5rem; flex: 0 0 5.5rem; }
table.skus .sku-actions { white-space: nowrap; width: 1%; text-align: right; }
.sku-tools { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }
.sku-order, .sku-move { display: flex; align-items: center; gap: 2px; }
.sku-move select { width: 12rem; min-height: 40px; padding: 6px 8px; }
.sku-edit { display: none; flex-wrap: wrap; align-items: center; gap: 4px; }
.sku:target .sku-edit, .sku.is-open .sku-edit { display: flex; }
.sku:target .sku-art-text, .sku.is-open .sku-art-text { display: none; }
.sku-edit input { width: 13rem; min-height: 40px; padding: 6px 8px; }
.sku-empty td { padding: 12px; color: var(--ink-3); font-size: .86rem; }
table.skus tbody:has(.sku) .sku-empty { display: none; }
.sku-add { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 8px; margin: 0; }
.sku-add input { flex: 1 1 220px; width: auto; min-height: 40px; padding: 6px 10px; }
.sku-add .hint { flex-basis: 100%; font-size: .8rem; }
/* The dragged row (or category) is its own drop slot; while a category is dragged, every category shows only its head. */
.sku.is-dragging { outline: 2px dashed var(--teal); outline-offset: -2px; }
.sku.is-dragging > * { opacity: .45; }
.catsec.is-dragging { outline: 2px dashed var(--teal); opacity: .6; }
.cat-dragging .catsec > :not(.catsec-head) { display: none; }
.cat-dragging .catsec-head { border-bottom: 0; border-radius: var(--radius); }
.dock {
    position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; max-height: 70dvh; overflow: hidden;
    padding: 12px max(var(--gutter), env(safe-area-inset-right)) calc(12px + var(--safe-b)) max(var(--gutter), env(safe-area-inset-left));
    background: var(--sheet); border-top: 1px solid var(--rule); box-shadow: 0 -10px 30px -12px rgba(0, 0, 0, .35);
}
.dock-title { margin: 0 0 8px; font-size: .82rem; font-weight: 600; color: var(--ink-3); }
/* Every target at once: the dock never scrolls (dragging against a scrolling list does not work). Chips are one line
   (the full name is their title), so 37 categories fit at 1024 × 768; should they still not fit, catalog.js measures and
   makes the dock dense (review round 2). */
.dock-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 4px; }
.dock-chip { padding: 5px 8px; border: 1px dashed color-mix(in srgb, var(--teal) 55%, var(--rule)); border-radius: var(--radius-sm); background: var(--paper); font-size: .8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dock.is-dense { padding-top: 8px; padding-bottom: calc(8px + var(--safe-b)); }
.dock.is-dense .dock-title { margin-bottom: 4px; }
.dock.is-dense .dock-chips { grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 3px; }
.dock.is-dense .dock-chip { padding: 2px 6px; font-size: .74rem; }
.dock-chip.is-over { border-style: solid; border-color: var(--teal); background: var(--teal-wash); color: var(--teal-ink); }
.dock-chip.is-source { display: none; }
/* Up to 1300 px (tablets in landscape, small laptops) the table stays, but a closed row has no room for
   "Verschieben nach …" (the row was 840–900 px in 828 px on an iPad in landscape): it sits in the row's edit panel, as
   on phones, and an open row puts it on a line of its own above the icons. Dragging onto the dock is unchanged. */
@media (max-width: 1300px) {
    .sku-move select, .sku-edit input { width: 9rem; }
    .sku-move { display: none; }
    .sku:target .sku-move, .sku.is-open .sku-move { display: flex; }
}
@media (min-width: 1000px) and (max-width: 1300px) {
    .sku:target .sku-tools, .sku.is-open .sku-tools { flex-wrap: wrap; }
    .sku:target .sku-move, .sku.is-open .sku-move { flex-basis: 100%; order: -1; }
}
/* Touch screens use the arrows and "Verschieben nach …": native drag and drop does not work well there. */
@media (pointer: coarse) {
    .grip, table.skus .sku-grip { display: none; }
}
@media (max-width: 999px) {
    table.skus thead { display: none; }
    table.skus, table.skus tbody, table.skus .sku-empty, table.skus .sku-empty td { display: block; }
    table.skus tr.sku {
        display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
        grid-template-areas: "grip art vpe avail" "grip name name name" "grip actions actions actions";
        gap: 2px 8px; padding: 8px 10px 8px 4px; border-bottom: 1px solid var(--rule-2);
    }
    table.skus tr.sku > * { border: 0; padding: 0; width: auto; }
    table.skus .sku-grip { grid-area: grip; align-self: start; }
    table.skus .sku-art { grid-area: art; align-self: center; }
    table.skus .sku-avail { grid-area: avail; align-self: center; }
    table.skus .sku-vpe { grid-area: vpe; align-self: center; display: none; }
    table.skus .has-vpe .sku-vpe { display: block; }
    table.skus .sku-vpe::before { content: attr(data-label) " "; font: 500 .66rem var(--mono); text-transform: uppercase; color: var(--ink-3); }
    table.skus .sku-name { grid-area: name; font-size: .86rem; }
    table.skus .sku-actions { grid-area: actions; margin-top: 4px; white-space: normal; }
    .sku-tools { flex-wrap: wrap; justify-content: flex-start; gap: 4px; }
    /* "Verschieben nach …" sits in the row's edit panel (the 1300 px rule above: the pencil, or the row as the URL's
       #target without JavaScript): a closed card is two lines of text and one line of icons (review round 2). */
    .sku-move { flex: 1 1 200px; min-width: 0; }
    .sku-move select { flex: 1 1 auto; width: auto; min-width: 0; }
    .sku-edit { flex-wrap: wrap; }
    .sku-edit input { flex: 1 1 140px; width: auto; min-width: 0; }
}
@media (max-width: 560px) {
    .sku-move { flex-basis: 100%; order: -1; } /* in an open row: "Verschieben nach …" on a line of its own, the icons below */
}

/* tablet: tighter stock table so all columns fit at 768px */
@media (max-width: 1000px) {
    table.stock thead th { white-space: normal; vertical-align: bottom; line-height: 1.25; padding: 10px 8px; letter-spacing: .06em; }
    table.stock td, table.stock tbody th { padding: 9px 6px; }
    .c-fav { width: 40px; }
    .c-vpe { width: 48px; }
    .c-qty { width: 124px; }
    .qty { width: 72px; }
}
/* Portrait tablets (768–834 px): a long German compound in a name ("Geräuschreduzierungs-Klemmen") may break, and the
   VPE moves from its own column to a caption under the quantity field ("VPE 12"), so the sheet needs no sideways
   scrolling. Screen only: print keeps its own layout. */
@media screen and (min-width: 761px) and (max-width: 1000px) {
    table.stock .c-name { hyphens: auto; overflow-wrap: anywhere; }
    table.stock .c-vpe { display: none; }
    .has-vpe .qty-vpe {
        display: block; margin-top: 3px; padding-right: 44px; /* under the field, not under the bell's slot */
        font-size: .72rem; line-height: 1.3; color: var(--ink); font-weight: 600; text-align: right; white-space: nowrap; cursor: help;
    }
}

@media (max-width: 1200px) {
    .ua { max-width: 100px; }
    .nowrap-lg { white-space: normal; }
    table.data th, table.data td { padding-left: 8px; padding-right: 8px; }
}

/* ---------- legal ---------- */
.prose { background: var(--sheet); border: 1px solid var(--rule); border-radius: var(--radius); padding: 22px 22px 8px; box-shadow: var(--shadow); }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

/* ---------- mobile: rows become cards ---------- */
@media (max-width: 760px) {
    :root { --appbar-h: 56px; }
    .hide-sm, .brand-titles .t2 { display: none; }
    .brandmark img { height: 22px; }
    .main { padding-top: 16px; }
    .chip span { display: none; }
    .chip { width: 44px; padding: 0; justify-content: center; }
    .search { flex: 1 1 0; min-width: 0; }

    table.stock thead { display: none; }
    table.stock, table.stock tbody, table.stock tr, table.stock td, table.stock tbody th { display: block; }
    .aisle-head th { display: block; }
    .item {
        display: grid !important; grid-template-columns: 44px minmax(0, 1fr) auto; grid-template-areas:
            "fav code qty"
            "fav name qty"
            "fav avail avail"
            "fav inc inc"
            "fav date date"
            "fav vpe vpe";
        gap: 0 8px; padding: 12px 12px 12px 4px; border-bottom: 1px solid var(--rule-2);
    }
    .item.q-hide { display: none !important; }
    .aisle.collapsed .item { display: none !important; }
    .searching .aisle.collapsed .item:not(.q-hide) { display: grid !important; }
    .item > * { border: 0 !important; padding: 0 !important; }
    .item .c-fav { grid-area: fav; width: auto; align-self: start; }
    .item .c-code { grid-area: code; font-size: .9rem; }
    .item .c-name { grid-area: name; font-size: .88rem; overflow-wrap: anywhere; }
    .item .c-qty { grid-area: qty; width: auto; align-self: start; }
    .item .c-avail { grid-area: avail; }
    .item .c-num:not(.c-avail) { grid-area: inc; }
    .item .c-date { grid-area: date; }
    .item .c-vpe { grid-area: vpe; width: auto; text-align: left !important; }
    .item .c-avail, .item .c-num, .item .c-date, .item .c-vpe {
        display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px; font-size: .84rem; margin-top: 6px;
    }
    .item .c-num:not(.c-avail), .item .c-date, .item .c-vpe { display: none; margin-top: 4px; }
    .item.has-inc .c-num:not(.c-avail), .item.has-date .c-date, .item.has-vpe .c-vpe { display: flex; } /* a VPE of 1 says nothing */
    .item .c-avail::before, .item .c-num::before, .item .c-date::before, .item .c-vpe::before { content: attr(data-label); font: 500 .66rem var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ink-3); }
    .item .c-avail .dot { margin-right: 0; }
    .qty { width: 72px; }

    .orderbar-inner { flex-wrap: nowrap; }
    .orderbar-sum { min-width: 0; padding-left: 10px; gap: 8px; }
}

/* data tables become cards on phones and portrait tablets */
@media (max-width: 900px) {
    table.data thead { display: none; }
    table.data, table.data tbody, table.data tr, table.data td { display: block; width: 100%; }
    table.data tr { padding: 10px 12px; border-bottom: 1px solid var(--rule-2); }
    table.data td { padding: 2px 0 !important; border: 0 !important; display: flex; gap: 10px; }
    table.data td.mono { overflow-wrap: anywhere; } /* "user.legacy_password_dropped", IPv6: no spaces to wrap at */
    table.data td[data-label]::before { content: attr(data-label); flex: 0 0 38%; color: var(--ink-3); font: 500 .7rem var(--mono); text-transform: uppercase; letter-spacing: .06em; padding-top: 3px; }
    .ua { max-width: none; white-space: normal; }
    .rowform, .inline-form { width: 100%; }
    table.data td.rowform { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; padding: 0 !important; }
    table.data td > .badge { align-self: flex-start; white-space: normal; border-radius: 10px; min-width: 0; }
    table.data td > .badge-admin { flex: none; white-space: nowrap; }
    table.data td > a { min-width: 0; overflow-wrap: anywhere; }
    .w-grow { flex-basis: 140px; min-width: 0; }
    .w-art { flex-basis: 120px; min-width: 0; }
    .inline-form .nowrap { white-space: normal; flex: 1 1 auto; }
}

@media (max-width: 380px) {
    .search { flex-basis: 100%; order: -1; }
    .orderbar-hint { display: none; } /* three more lines on the smallest phones; the review dialog says the same */
}

@media (max-width: 360px) {
    .qty { width: 64px; }
    .orderbar-open-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } /* the chevron says it; the name keeps the word */
}

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

@media print {
    .appbar, .toolbar, .orderbar, .site-footer, .c-fav, .c-qty, .reslinks { display: none !important; }
    body { background: #fff; }
    .sheet { box-shadow: none; border: 0; }
    .sheet[hidden] { display: block !important; }
}
