/* Bestellportal – eine Schrift, neutrale Flächen, ein Farbton (Petrol) nur auf Daten und Marke. */
@font-face {
  font-family: "IBM Plex Sans";
  src: url("/static/fonts/plex-sans-400.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --ground: #f6f7f7;
  --surface: #ffffff;
  --raised: #f1f3f3;
  --active: #e9ecec;
  --border: #e3e6e6;
  --rule: #eef0f0;
  --control: #cdd2d2;
  --text: #111516;
  --muted: #586163;
  --primary: #16191a;
  --accent: #0e6f6a;
  --accent-soft: #9fcdc9;
  --positive: #247b50;
  --negative: #b3261e;
  --pill-positive-bg: #dcfae5; --pill-positive-ink: #04250e;
  --pill-negative-bg: #ffedea; --pill-negative-ink: #831c1e;
  --pill-warning-bg: #fff6d6;  --pill-warning-ink: #6f4a00;
  --pill-neutral-bg: #e9ecec;  --pill-neutral-ink: #23292a;

  --radius-card: 8px;
  --radius-control: 6px;
  --radius-chip: 4px;
  --gap: 16px;
  --pad: 20px;
  --control-h: 36px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --font: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font: 400 14px/20px var(--font);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; border-radius: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; line-height: 18px; }
.strong { font-weight: 600; }
.neg { color: var(--negative); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

h1 { font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -0.01em; }
h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.subline { color: var(--muted); margin-top: 2px; }

/* ------------------------------------------------------------------ Shell */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.topbar { display: none; }
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  display: flex; flex-direction: column;
  padding: 20px 12px 16px;
  border-right: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; font-size: 15px; padding: 0 8px; }
.mark { flex: none; }
.scope { margin: 20px 0 8px; padding: 10px 8px 12px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.scope-name { font-weight: 500; }
.scope-meta { color: var(--muted); font-size: 12px; line-height: 18px; }
.nav-label { color: var(--muted); font-size: 12px; line-height: 18px; padding: 16px 8px 6px; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  height: 34px; padding: 0 8px; border-radius: var(--radius-control);
  color: #2b3233;
  transition: background-color 120ms ease;
}
.nav-item.is-active { background: var(--active); color: var(--text); font-weight: 500; }
.count {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--active); font-size: 12px; font-weight: 500; font-variant-numeric: tabular-nums;
}
.nav-item.is-active .count { background: var(--surface); }
.count.is-open { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.account { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--border); }
.account-name { font-weight: 500; }
.account-mail { color: var(--muted); font-size: 12px; line-height: 18px; overflow: hidden; text-overflow: ellipsis; }
.link { background: none; border: 0; padding: 0; cursor: pointer; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.account .link { margin-top: 8px; }

.canvas { padding: 32px 40px 64px; max-width: 1320px; width: 100%; }
.title-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.crumb { color: var(--muted); margin-bottom: 12px; }
.crumb a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.stamp { color: var(--muted); font-size: 12px; margin-top: 24px; }

/* --------------------------------------------------------------- Controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: var(--control-h); padding: 0 14px;
  border: 1px solid var(--control); border-radius: var(--radius-control);
  background: var(--surface); color: var(--text); font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform 140ms var(--ease-out), background-color 140ms ease, border-color 140ms ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-block { width: 100%; height: 40px; }
.btn[disabled] { background: var(--raised); border-color: var(--border); color: var(--muted); cursor: not-allowed; }

input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="number"], textarea {
  width: 100%; height: var(--control-h); padding: 0 12px;
  background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-control);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
textarea { height: auto; padding: 8px 12px; resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
input::placeholder, textarea::placeholder { color: #6b7375; }
input[aria-invalid="true"] { border-color: var(--negative); }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.field { margin-bottom: 16px; }
.field label, .label { display: block; font-weight: 500; margin-bottom: 8px; }
.hint { color: var(--muted); font-size: 12px; line-height: 18px; margin-top: 6px; }
.field-error, .form-error { color: var(--negative); font-size: 13px; margin-top: 6px; }
.form-error { background: var(--pill-negative-bg); color: var(--pill-negative-ink); padding: 10px 12px; border-radius: var(--radius-control); margin: 0 0 16px; }
.pw { position: relative; }
.pw input { padding-right: 88px; }
.pw-toggle { position: absolute; right: 4px; top: 4px; height: 28px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; }

.stepper { display: inline-flex; align-items: stretch; height: 32px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); overflow: hidden; }
.stepper button { width: 30px; border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); transition: background-color 120ms ease; }
.stepper button:active { background: var(--active); }
.stepper input { width: 46px; height: auto; border: 0; border-radius: 0; padding: 0; text-align: center; box-shadow: none; }
.stepper:focus-within { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.stepper-lg { height: 40px; }
.stepper-lg button { width: 40px; }
.stepper-lg input { width: 64px; }

.search { width: 300px; flex: none; }

.tabs { display: flex; gap: 24px; border-bottom: 1px solid var(--border); margin-bottom: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { flex: none; padding: 0 0 10px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; transition: color 120ms ease; }
.tab.is-active { color: var(--text); font-weight: 500; border-bottom-color: var(--text); }
.tab-n { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; margin-left: 2px; }

.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 500; white-space: nowrap; flex: none; }
.pill-positive { background: var(--pill-positive-bg); color: var(--pill-positive-ink); }
.pill-negative { background: var(--pill-negative-bg); color: var(--pill-negative-ink); }
.pill-warning { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }
.pill-neutral { background: var(--pill-neutral-bg); color: var(--pill-neutral-ink); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); }
.empty { padding: 14px 16px; border: 1px dashed var(--control); border-radius: var(--radius-card); color: var(--muted); }
.empty a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.notice { background: var(--pill-warning-bg); color: var(--pill-warning-ink); border-radius: var(--radius-control); padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }

/* ------------------------------------------------------- Kunde, Startseite */
.brand-logo { height: 28px; width: auto; max-width: 180px; object-fit: contain; object-position: left center; }
.brand-lg .brand-logo { height: 40px; max-width: 240px; }
.brand-sub { color: var(--muted); font-size: 12px; line-height: 18px; padding: 6px 8px 0; }
.nav-start { margin-top: 8px; }

.start { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 16px; padding: 16px var(--pad) 0; }
.panel-head h2 { white-space: nowrap; }
.panel-head .legend { margin: 0; }
.panel-empty { padding: 12px var(--pad) 20px; }
.budget-list { padding: 4px var(--pad) 8px; }
.budget-list li { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--rule); }
.budget-list li:first-child { border-top: 0; }
.budget-list strong { font-weight: 600; }
.todo { padding: 8px 8px 8px; }
.todo a { display: grid; grid-template-columns: 28px 1fr; gap: 10px; align-items: center; padding: 8px 12px; border-radius: var(--radius-control); transition: background-color 120ms ease; }
.todo .count { justify-self: start; }
.todo-none { padding: 8px 12px; }
.start-notice { margin: 0 var(--pad) var(--pad); padding-top: 12px; border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; }
.section-title { margin: 32px 0 12px; }
.section-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.tiles .card-media { aspect-ratio: 4 / 3; }
.tiles .card-body { align-items: baseline; }
.tiles .card-title { grid-column: auto; font-size: 15px; }
@media (hover: hover) and (pointer: fine) { .todo a:hover { background: var(--raised); } }
@media (max-width: 1180px) { .start { grid-template-columns: minmax(0, 1fr); } }

/* ----------------------------------------------------------------- Katalog */
/* Raster: 4 Spalten, 3 x 16 px Abstand, läuft von Canvas-Kante zu Canvas-Kante. */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.card { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); overflow: hidden; transition: border-color 140ms ease, transform 140ms var(--ease-out); }
.card:active { transform: scale(0.99); }
.card-media { position: relative; display: flex; align-items: center; justify-content: center; aspect-ratio: 1; background: var(--surface); border-bottom: 1px solid var(--rule); }
.card-media img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.noimg { color: var(--muted); font-size: 12px; }
.card-body { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 14px 14px; }
.card-title { grid-column: 1 / -1; font-weight: 500; }
.card-meta { color: var(--muted); font-size: 13px; }
.card-cat { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }
.subcats { margin: -8px 0 24px; }
.subcats .chip { height: 28px; padding: 0 10px; font-size: 13px; gap: 4px; }
.chip-up { color: var(--muted); border-color: transparent; background: none; padding-left: 0; }
.col-cat { white-space: normal; }

/* Filter auf Artikeleigenschaften */
.filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: -8px 0 16px; }
.filters-label { color: var(--muted); font-size: 13px; margin-right: 4px; }
.facet { position: relative; }
.facet summary {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; list-style: none; cursor: pointer;
  border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface);
  font-size: 13px; white-space: nowrap; user-select: none; transition: border-color 120ms ease;
}
.facet summary::-webkit-details-marker { display: none; }
.facet summary::after { content: ""; width: 6px; height: 6px; margin: -3px 2px 0 2px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); }
.facet.is-set summary { border-color: var(--text); font-weight: 500; }
.facet[open] summary { border-color: var(--text); }
.facet-n { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--text); color: var(--surface); font-size: 11px; font-variant-numeric: tabular-nums; }
.facet-menu {
  position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 220px; max-width: min(360px, 86vw);
  padding: 8px; background: var(--surface); border: 1px solid var(--control); border-radius: var(--radius-card);
  transform-origin: top left; transition: opacity 140ms var(--ease-out), transform 140ms var(--ease-out);
}
@starting-style { .facet[open] .facet-menu { opacity: 0; transform: scale(0.97); } }
.facet-menu ul { max-height: 280px; overflow-y: auto; margin-bottom: 8px; }
.facet-menu label { display: grid; grid-template-columns: 16px 1fr auto; gap: 8px; align-items: center; padding: 6px 6px; border-radius: var(--radius-chip); cursor: pointer; font-size: 13px; line-height: 18px; }
.facet-menu label.is-empty { color: var(--muted); }
.facet-menu input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 13px; width: 100%; }
.filter-active { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 20px; font-size: 13px; }
.chip-remove { height: 26px; padding: 0 8px; font-size: 13px; gap: 6px; background: var(--raised); border-color: transparent; }
@media (hover: hover) and (pointer: fine) {
  .facet summary:hover { border-color: #9aa2a3; }
  .facet-menu label:hover { background: var(--raised); }
  .chip-remove:hover { border-color: var(--control); }
  .docs a:hover .doc-title { text-decoration: underline; text-underline-offset: 3px; }
}

/* Eigenschaften und Dokumente am Produkt */
.facts-title { margin-top: 32px; }
.facts-title + .facts { margin-top: 8px; }
.docs { margin-top: 8px; border-top: 1px solid var(--border); }
.docs a { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.doc-type { flex: none; padding: 1px 5px; border: 1px solid var(--control); border-radius: var(--radius-chip); font-size: 11px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.docs .muted { margin-left: auto; font-size: 12px; white-space: nowrap; }

/* Ansicht wechseln (nur Admin) */
.scope-switch { margin-top: 8px; }
.scope-switch select { width: 100%; height: 30px; padding: 0 6px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); font: inherit; font-size: 13px; }
.scope-switch .btn { margin-top: 6px; }
.card-price { font-weight: 600; align-self: end; }
@media (hover: hover) and (pointer: fine) {
  .card:hover { border-color: var(--control); }
  .nav-item:hover { background: var(--active); }
  .btn:hover { border-color: #9aa2a3; }
  .btn-primary:hover { background: #2a2f30; border-color: #2a2f30; }
  .btn-ghost:hover { border-color: transparent; color: var(--text); }
  .tab:hover, .link:hover { color: var(--text); }
  .stepper button:hover { background: var(--raised); color: var(--text); }
  .table.rows a:hover { text-decoration: underline; text-underline-offset: 3px; }
  .chip:hover { border-color: #9aa2a3; }
}

.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-weight: 400; font-size: 12px; color: var(--muted); padding: 10px 12px; white-space: nowrap; }
.table td { padding: 10px 12px; border-top: 1px solid var(--rule); vertical-align: middle; }
.table th:first-child, .table td:first-child { padding-left: var(--pad); }
.table th:last-child, .table td:last-child { padding-right: var(--pad); }
.table th.num, .table td.num { text-align: right; white-space: nowrap; }
.table tfoot td { border-top: 1px solid var(--border); padding-top: 14px; padding-bottom: 14px; }
.table.compact td { padding-top: 8px; padding-bottom: 8px; }
.col-media { width: 44px; padding-right: 0 !important; }
.col-media img, .thumb-empty { width: 44px; height: 44px; object-fit: contain; border-radius: var(--radius-chip); background: var(--raised); display: block; }
.col-name a { font-weight: 500; }
.col-name .sub, .sub { display: block; color: var(--muted); font-size: 12px; line-height: 18px; }
.col-unit { color: var(--muted); white-space: nowrap; }
.col-qty { width: 130px; text-align: right; white-space: nowrap; }
.table th.col-qty { text-align: center; }
.col-x { width: 1%; white-space: nowrap; text-align: right; }
.list-panel { overflow: clip; }
.list-bar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px var(--pad); background: var(--surface); border-top: 1px solid var(--border); color: var(--muted); border-radius: 0 0 var(--radius-card) var(--radius-card); }
.list-bar.has-items { color: var(--text); }

/* ----------------------------------------------------------------- Produkt */
.product { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 40px; align-items: start; }
.product-media { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.product-media img { position: absolute; inset: 32px; width: calc(100% - 64px); height: calc(100% - 64px); object-fit: contain; }
.product-price { font-size: 24px; line-height: 32px; font-weight: 600; margin: 16px 0 24px; }
.product-price .muted { font-size: 14px; font-weight: 400; }
.colors { margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); white-space: nowrap; transition: border-color 120ms ease; }
.chip.is-active { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); font-weight: 500; }
.sizes { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }
.size { display: flex; flex-direction: column; gap: 4px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-control); transition: border-color 120ms ease, background-color 120ms ease; }
.size-label { font-weight: 500; font-size: 13px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.size input { height: 32px; text-align: center; padding: 0 4px; }
.size.has-qty { border-color: var(--accent); background: #f1f8f7; }
.size-price, .size-cart { font-size: 12px; line-height: 16px; color: var(--muted); text-align: center; }
.single-qty { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.single-qty .label { margin: 0; }
.product-buy { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--border); }
.product-sum strong { font-size: 16px; margin-left: 6px; }
.facts { margin-top: 32px; border-top: 1px solid var(--border); }
.facts div { display: grid; grid-template-columns: 180px 1fr; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.facts dt { color: var(--muted); }
.longtext { margin-top: 16px; color: #2b3233; max-width: 68ch; white-space: pre-line; }

/* --------------------------------------------------------------- Warenkorb */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); align-items: start; }
.checkout { padding: var(--pad); position: sticky; top: 24px; }
.checkout h2 { margin-bottom: 12px; }
.cc-list { display: grid; gap: 8px; }
.cc { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-control); cursor: pointer; transition: border-color 120ms ease, background-color 120ms ease; }
.cc:has(input:checked) { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.cc input { margin: 3px 0 0; accent-color: var(--primary); }
.cc-head { display: flex; justify-content: space-between; gap: 8px; }
.cc-name { font-weight: 500; }
.cc-code { color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-figures { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; line-height: 18px; }
.cc-body { display: grid; gap: 6px; min-width: 0; }
.track { display: flex; height: 6px; border-radius: 3px; background: var(--active); overflow: hidden; }
.track span { display: block; height: 100%; }
.track-spent { background: var(--accent); }
.track-reserved { background: var(--accent-soft); }
.track-add { background: var(--text); }
.track-add.is-over { background: var(--negative); }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--muted); font-size: 12px; line-height: 18px; margin: 10px 0 20px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.sw { width: 12px; height: 6px; border-radius: 3px; display: inline-block; }
.sw-spent { background: var(--accent); } .sw-reserved { background: var(--accent-soft); } .sw-add { background: var(--text); }
.sum { border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 16px; }
.sum div { display: flex; justify-content: space-between; padding: 3px 0; color: var(--muted); }
.sum .sum-total { color: var(--text); font-weight: 600; font-size: 16px; line-height: 24px; padding-top: 8px; }

/* ------------------------------------------------- Bestellung, Genehmigung */
.order { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--gap); align-items: start; }
.order-side { padding: var(--pad); display: grid; gap: 12px; }
.steps { display: grid; gap: 0; }
.steps li { position: relative; padding: 0 0 14px 22px; display: flex; justify-content: space-between; gap: 12px; }
.steps li::before { content: ""; position: absolute; left: 0; top: 5px; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--control); background: var(--surface); }
.steps li::after { content: ""; position: absolute; left: 4px; top: 16px; bottom: -3px; width: 1.5px; background: var(--border); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps .is-done::before { background: var(--accent); border-color: var(--accent); }
.steps .is-open { color: var(--muted); }
.step-name { font-weight: 500; }
.steps .is-open .step-name { font-weight: 400; }
.step-detail { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }

.approval { margin-bottom: var(--gap); max-width: 860px; }
.approval-head { display: flex; justify-content: space-between; gap: 24px; padding: 16px var(--pad) 12px; }
.approval-head h2 a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--control); }
.approval-sum { text-align: right; display: grid; }
.approval-sum strong { font-size: 18px; line-height: 24px; }
.approval-sum span { font-size: 12px; line-height: 18px; }
.approval-note { padding: 10px var(--pad); border-top: 1px solid var(--rule); color: var(--muted); }
.approval-actions { display: flex; gap: 8px; padding: 12px var(--pad); border-top: 1px solid var(--border); }
.approval-actions input { flex: 1; min-width: 0; }

/* -------------------------------------------------------------------- Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 20; translate: -50% 0;
  padding: 10px 16px; border-radius: var(--radius-card);
  background: var(--primary); color: #fff; font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 1; transform: translateY(0);
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
}
@starting-style { .toast { opacity: 0; transform: translateY(12px); } }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition-duration: 160ms; }
.toast.is-hint { background: var(--pill-warning-bg); color: var(--pill-warning-ink); }

/* -------------------------------------------------------- Login, Onboarding */
body.auth { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.auth-form { display: flex; flex-direction: column; padding: 32px 48px; }
.auth-form .brand { padding: 0; }
.auth-body { width: 100%; max-width: 380px; margin: auto; padding: 48px 0; }
.auth-body h1 { font-size: 28px; line-height: 36px; }
.lead { color: var(--muted); margin: 6px 0 28px; font-size: 15px; line-height: 22px; }
.auth-body input { height: 40px; }
.auth-body .pw-toggle { top: 6px; }
.help { color: var(--muted); font-size: 13px; margin-top: 20px; }
.auth-foot { color: var(--muted); font-size: 12px; }
.auth-side { background: var(--accent); color: #fff; padding: 48px 56px; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-claim { font-size: 32px; line-height: 40px; font-weight: 500; letter-spacing: -0.015em; max-width: 22ch; }
.auth-facts { display: grid; gap: 20px; max-width: 420px; }
.auth-facts dt { font-weight: 600; }
.auth-facts dd { color: #d9eeec; }

body.onboard { background: var(--ground); }
.onboard-main { max-width: 720px; margin: 0 auto; padding: 32px 24px 64px; }
.onboard-main .brand { padding: 0; margin-bottom: 40px; }
.onboard-main .panel { padding: var(--pad); margin-bottom: var(--gap); }
.onboard-main .panel h2 + .muted { margin: 2px 0 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field-row .field { margin-bottom: 0; }
.consent-text { max-height: 280px; overflow-y: auto; padding: 16px; margin-bottom: 16px; background: var(--raised); border-radius: var(--radius-control); color: #2b3233; }
.consent-text h3 { font-size: 14px; font-weight: 600; margin: 16px 0 4px; }
.consent-text h3:first-child { margin-top: 0; }
.consent-text ul { list-style: disc; padding-left: 20px; }
.check { display: grid; grid-template-columns: 18px 1fr; gap: 10px; align-items: start; cursor: pointer; font-weight: 500; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--primary); }
.check.is-invalid input { outline: 2px solid var(--negative); outline-offset: 1px; }
.onboard-actions { display: flex; gap: 8px; margin-top: 24px; }

/* ---------------------------------------------------------------- Schmaler */
@media (max-width: 1180px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cart, .order { grid-template-columns: minmax(0, 1fr); }
  .checkout { position: static; }
  .product { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 900px) {
  .shell { display: block; }
  .topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 12px; height: 52px; padding: 0 16px; background: var(--ground); border-bottom: 1px solid var(--border); }
  .topbar .brand { padding: 0; margin-right: auto; }
  .topbar-cart { display: inline-flex; align-items: center; gap: 6px; height: 36px; font-weight: 500; }
  .menu-btn { height: 36px; padding: 0 12px; border: 1px solid var(--control); border-radius: var(--radius-control); background: var(--surface); font-weight: 500; cursor: pointer; }
  .sidebar { display: none; position: fixed; inset: 52px 0 0; z-index: 9; height: auto; background: var(--ground); border-right: 0; padding: 8px 16px 24px; }
  .sidebar .brand { display: none; }
  .sidebar.is-open { display: flex; }
  .nav-item { height: 44px; font-size: 15px; }
  .canvas { padding: 20px 16px 48px; }
  .title-row { flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 16px; }
  .search { width: 100%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .product { grid-template-columns: minmax(0, 1fr); }
  .product-media { padding: 16px; max-width: 420px; }
  body.auth { grid-template-columns: minmax(0, 1fr); }
  .auth-form { padding: 20px 20px 32px; min-height: 0; }
  .auth-body { padding: 40px 0 24px; margin: 0 auto; }
  .auth-side { padding: 32px 20px; gap: 28px; }
  .auth-claim { font-size: 24px; line-height: 32px; max-width: none; }
  input[type="text"], input[type="email"], input[type="password"], input[type="search"], textarea { font-size: 16px; }
}
@media (max-width: 640px) {
  .field-row { grid-template-columns: 1fr; }
  .onboard-actions { flex-direction: column; }
  .onboard-actions .btn { height: 44px; }
  .col-unit, .table thead { display: none; }
  .table.rows tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 4px 12px; padding: 12px 16px; border-top: 1px solid var(--rule); align-items: center; }
  .table.rows tbody tr:first-child { border-top: 0; }
  .table.rows td { padding: 0 !important; border: 0; }
  .table.rows .col-name { grid-column: 2 / -1; }
  .table.rows .col-media { grid-row: span 2; align-self: start; }
  .table.rows .col-qty { width: auto; grid-column: 2; justify-self: start; }
  .list-panel .table.rows .col-qty { grid-row: 2; }
  .list-panel .table.rows td.num { grid-column: 3; grid-row: 2; font-weight: 600; }
  .table.rows.stack tr, .order .table.rows tr, .approval .table.rows tr { grid-template-columns: minmax(0, 1fr) auto; }
  .table.rows.stack .col-name, .order .col-name, .approval .col-name { grid-column: 1 / -1; }
  .table.rows.stack td[data-label]::before { content: attr(data-label) " "; color: var(--muted); }
  .table.rows.stack td.num, .order td.num, .approval td.num { text-align: left; }
  .table.rows.stack td:last-child, .order td.strong, .approval td.strong { justify-self: end; }
  .table tfoot tr { display: flex !important; justify-content: space-between; }
  .list-bar { flex-direction: column; align-items: stretch; padding: 12px 16px; }
  .list-bar .btn { height: 44px; }
  .product-buy { flex-direction: column; align-items: stretch; }
  .product-buy .btn { height: 44px; }
  .facts div { grid-template-columns: 1fr; gap: 0; }
  .approval-head { flex-direction: column; gap: 8px; }
  .approval-sum { text-align: left; }
  .approval-actions { flex-wrap: wrap; }
  .approval-actions input { flex-basis: 100%; }
  .approval-actions .btn { flex: 1; height: 44px; }
  .toast { left: 16px; right: 16px; translate: none; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
  .btn:active, .card:active { transform: none; }
}
