/* Eigenes CSS, keine Fremdquellen: keine CDNs, keine externen Fonts (Datenschutz-Basis B3).
   Gestaltung wie im Artefakt vom 20.11.2026 (docs/vorlage/artefakt.html): eine schmale
   Arbeitsspalte, Beträge rechtsbündig, Produzenten als Buchstaben-Marken H / R / M. */

:root {
	--bg: #F7F3EC; --surface: #FFFFFF; --ink: #1D1D1B; --muted: #625C53;
	--line: #E0D8CA; --line-strong: #BDB3A2;
	--accent: #E30613; --accent-deep: #B8050F; --on-accent: #FFFFFF;
	--good: #256F28; --good-bg: #E3F0DF; --warn: #7A5200; --warn-bg: #FBF0D0;
	--bad: #B8050F; --bad-bg: #FBE3E1;
	--h-bg: #D5E9D0; --h-fg: #1C5420;
	--r-bg: #F4D3C3; --r-fg: #7E3212;
	--m-bg: #F5E6A3; --m-fg: #5E4900;
	--x-bg: #E4E0D8; --x-fg: #3F3B35;
	--font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
	--r-md: 8px; --r-lg: 14px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #191817; --surface: #242220; --ink: #F3ECE3; --muted: #ABA498;
		--line: #39352F; --line-strong: #5A544B;
		--accent: #E30613; --accent-deep: #F0303B; --on-accent: #FFFFFF;
		--good: #86CC88; --good-bg: #1F3322; --warn: #E6BC5C; --warn-bg: #3D3210;
		--bad: #FF7A80; --bad-bg: #40201F;
		--h-bg: #24452A; --h-fg: #C4E8C3;
		--r-bg: #55301F; --r-fg: #F6CBB6;
		--m-bg: #4D4214; --m-fg: #F4E294;
		--x-bg: #3A3733; --x-fg: #E4DED4;
		color-scheme: dark;
	}
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
	margin: 0;
	background: var(--bg); color: var(--ink);
	font-family: var(--font); font-size: 15px; line-height: 1.45;
	padding: 20px max(16px, env(safe-area-inset-right, 0px)) 48px max(16px, env(safe-area-inset-left, 0px));
}

.seite { max-width: 1120px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: 22px; line-height: 1.2; }
h2 { font-size: 18px; line-height: 1.25; }
h3 { font-size: 15.5px; line-height: 1.3; }
p { margin: 0; }
a { color: var(--ink); text-underline-offset: 3px; }
.klein { font-size: 13px; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.schmal { max-width: 30rem; }
.text { max-width: 62ch; }

/* Kopf */
.kopf { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; }
.kopf .ueber { font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.marke { font-family: var(--font-display); font-size: 24px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; text-decoration: none; }
.kopf-rechts { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 14px; }

/* Reiter */
.reiter { display: flex; gap: 4px; border-bottom: 1px solid var(--line-strong); }
.reiter a {
	flex: 1 1 0; min-width: 0; text-align: center; text-decoration: none;
	border-bottom: 3px solid transparent; margin-bottom: -1px;
	padding: 10px 6px 9px; font-weight: 500; color: var(--muted);
	border-radius: var(--r-md) var(--r-md) 0 0;
}
.reiter a:hover { color: var(--ink); }
.reiter a[aria-current="page"] { color: var(--ink); font-weight: 650; border-bottom-color: var(--accent); }
.unterreiter { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.unterreiter span { color: var(--muted); }
.unterreiter a[aria-current="page"] { font-weight: 650; }

/* Hinweise */
.hinweis, .fehler { border-radius: var(--r-md); padding: 10px 12px; font-size: 14px; }
.hinweis { background: var(--warn-bg); color: var(--warn); }
.hinweis.gut { background: var(--good-bg); color: var(--good); }
.fehler { background: var(--bad-bg); color: var(--bad); font-weight: 500; }

/* Flächen */
.flaeche { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px; }
.stapel { display: flex; flex-direction: column; gap: 14px; }
.eng { gap: 8px; }
.leer { color: var(--muted); padding: 18px 4px; max-width: 60ch; }

/* Schaltflächen */
button { font: inherit; color: inherit; }
.btn, .btn-sek {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border-radius: var(--r-md); padding: 9px 16px; font-weight: 600; cursor: pointer;
	border: 1px solid transparent; text-decoration: none;
	transition: background-color .14s, transform .14s;
}
.btn { background: var(--accent); color: var(--on-accent); }
.btn:hover { background: #B8050F; }
.btn-sek { background: var(--surface); border-color: var(--line-strong); color: var(--ink); }
.btn-sek:hover { background: var(--bg); }
.btn:active, .btn-sek:active { transform: scale(.98); }
.btn[disabled], .btn-sek[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 4px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-weight: 500; }
.link:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.knoepfe { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Produzenten-Marke */
.pz {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 22px; height: 22px; border-radius: 6px; font-size: 12.5px; font-weight: 700; line-height: 1;
	background: var(--x-bg); color: var(--x-fg);
}
.pz-H { background: var(--h-bg); color: var(--h-fg); }
.pz-R { background: var(--r-bg); color: var(--r-fg); }
.pz-M { background: var(--m-bg); color: var(--m-fg); }
.marke-klein { display: inline-block; font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.marke-klein.gut { color: var(--good); border-color: currentColor; }
.marke-klein.offen { color: var(--warn); border-color: currentColor; }

/* Formulare */
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 14px; }
.feld { display: flex; flex-direction: column; gap: 5px; min-width: 0; border: 0; padding: 0; margin: 0; }
.feld.breit { grid-column: 1 / -1; }
.feld > label, .feld > legend { font-size: 13px; font-weight: 600; padding: 0; }
.feld > legend { margin-bottom: 5px; }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], textarea, select {
	font: inherit; font-size: 16px; color: var(--ink); background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--r-md); padding: 8px 11px; width: 100%; min-width: 0;
}
textarea { resize: vertical; min-height: 44px; }
.wahl { display: flex; flex-wrap: wrap; gap: 8px; }
.wahl label { position: relative; cursor: pointer; }
.wahl input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.wahl label > span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px 7px 8px; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); }
.wahl input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); font-weight: 600; }
.wahl input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.haken { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.haken input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; flex: none; }
.inline { display: inline; margin: 0; }
.qr { background: #FFFFFF; padding: 8px; border-radius: var(--r-md); align-self: flex-start; line-height: 0; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; overflow-wrap: anywhere; }

/* Bestellen */
.bestellen { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@media (min-width: 880px) {
	.bestellen { grid-template-columns: minmax(0, 1fr) 300px; }
	.summe { position: sticky; top: 16px; }
}
.korbwahl { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 12px; }
.korb { display: flex; flex-direction: column; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; }
.korb-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.korb-kopf .num { font-weight: 700; font-size: 16px; }
.korb p { flex: 1; }
.anteil-zeile { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.anteil { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }

.zeile { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.zeile-kopf { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.zeile-titel { flex: 1 1 150px; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.zeile-titel .klein { flex-basis: 100%; }
.zeile-kopf > .num { font-weight: 700; font-size: 16px; min-width: 104px; text-align: right; margin-left: auto; }
.zeile-aktionen { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); flex: none; }
.stepper button { width: 36px; height: 36px; background: none; border: 0; font-size: 18px; line-height: 1; cursor: pointer; border-radius: var(--r-md); }
.stepper button:hover { background: var(--bg); }
.stepper .wert { min-width: 30px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper.klein-st button { width: 32px; height: 32px; }
.inhalt { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.posten { display: flex; align-items: center; gap: 10px; padding: 4px 0; }
.posten .pname { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.posten.null .pname, .posten.null .num { color: var(--muted); text-decoration: line-through; }
.zusatz { display: flex; flex-direction: column; gap: 5px; margin-top: 8px; font-size: 13px; font-weight: 600; }

.summe { display: flex; flex-direction: column; gap: 12px; }
.liste-ohne { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.liste-ohne li { display: flex; align-items: center; gap: 8px; }
.liste-ohne li .num { margin-left: auto; }
.total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-strong); padding-top: 10px; font-weight: 600; }
.total .num { font-size: 22px; font-weight: 700; font-family: var(--font-display); }
.summe .btn { flex: 1 1 auto; }

/* Bestellungen */
.karte { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.karte-kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.karte-kopf h3 { min-width: 0; overflow-wrap: anywhere; }
.karte-kopf .num { font-weight: 700; font-size: 16px; }
.marken { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.verk { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; }
.karte-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 18px; border-top: 1px solid var(--line); padding-top: 8px; }

/* Abrechnung */
.segment { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line-strong); border-radius: var(--r-md); overflow: hidden; background: var(--surface); max-width: 100%; }
.tab th a.sortier { color: inherit; text-decoration: underline; text-decoration-style: dotted; }
.tab th[aria-sort] a.sortier { color: var(--ink); }
.segment a { padding: 8px 14px; font-weight: 500; color: var(--muted); text-decoration: none; }
.segment a + a { border-left: 1px solid var(--line-strong); }
.segment a[aria-current="page"] { background: var(--ink); color: var(--bg); font-weight: 600; }
.leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.leiste form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.leiste select { width: auto; font-size: 15px; padding: 7px 10px; }
.tabrahmen { overflow-x: auto; }
table.tab { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.tab th { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); text-align: left; padding: 6px 10px 6px 0; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
.tab td { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); vertical-align: baseline; }
.tab th:last-child, .tab td:last-child { padding-right: 0; }
.tab .r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tab tfoot td { font-weight: 700; border-bottom: 0; border-top: 1px solid var(--line-strong); }
.tab .pzelle, .pzelle { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.tab input[type="text"], .tab select { font-size: 15px; padding: 6px 8px; min-width: 5.5rem; }
.tab td.eng-zelle input[type="text"] { min-width: 4rem; width: 5.5rem; }
/* Tabelle mit Raster wie in der Excel-Vorlage: jede Zelle gerahmt, Kopf abgesetzt. */
.tab.raster { background: var(--surface); border: 1px solid var(--line-strong); }
.tab.raster th, .tab.raster td { border: 1px solid var(--line); padding: 7px 8px; vertical-align: top; }
.tab.raster th:last-child, .tab.raster td:last-child { padding-right: 8px; }
.tab.raster thead th { background: var(--bg); border-color: var(--line-strong); vertical-align: bottom; }
.tab.raster th.gruppe { text-align: center; }
.tab.raster tbody tr:hover td { background: var(--bg); }
.tab.raster tfoot td { background: var(--bg); border-top: 2px solid var(--line-strong); border-bottom: 1px solid var(--line); }
.tab.raster tfoot td.klein { font-weight: 500; }
.tab.raster tr.zwischensumme td { background: var(--bg); font-weight: 700; border-bottom: 2px solid var(--line-strong); }
.tab.raster td[rowspan] { vertical-align: top; }
.tab.schmal-tab { width: auto; min-width: min(100%, 26rem); }
.klein-kopf { font-weight: 500; letter-spacing: 0; text-transform: none; }
.tab td.besteller { min-width: 11rem; overflow-wrap: anywhere; }
.tab .aktionen { white-space: nowrap; }
.tab .aktionen a + a { margin-left: 12px; }
.kein-umbruch { white-space: nowrap; }
.nur-leser { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.schalter {
	font-size: 12.5px; font-weight: 600; padding: 3px 12px; border-radius: 999px; cursor: pointer;
	background: var(--surface); border: 1px solid currentColor; min-width: 3.4rem;
}
.schalter.gut { color: var(--good); }
.schalter.offen { color: var(--warn); }
.schalter:hover { background: var(--bg); }

.saldo-plus { color: var(--good); font-weight: 700; }
.saldo-minus { color: var(--bad); font-weight: 700; }
.zahlung { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 16px; }
.zahlung:last-child { border-bottom: 0; padding-bottom: 0; }
.zahlung .num { margin-left: auto; font-weight: 700; font-size: 18px; font-family: var(--font-display); }
.zahlung .pfeil { color: var(--muted); }
.kopie textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; min-height: 220px; }

details > summary { cursor: pointer; font-weight: 600; }
details[open] > summary { margin-bottom: 12px; }

footer { color: var(--muted); font-size: 13px; }

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