/* Mensawerk – Gestaltung
   Edelstahl-Grau als Grund, Weiß für Arbeitsflächen, Grün für die Hauptaktion,
   das Gelb des Logo-Griffs für "hier bist du". Rot, Blau, Grün wie die Schneidbretter:
   Fleisch, Fisch, Vegetarisches. Eine Schriftfamilie: Barlow, schmal für Überschriften, normal für Text. */

@font-face { font-family:"Barlow Semi Condensed"; font-weight:600; font-display:swap; src:url("fonts/barlow-semi-condensed-600.woff2") format("woff2"); }
@font-face { font-family:"Barlow Semi Condensed"; font-weight:700; font-display:swap; src:url("fonts/barlow-semi-condensed-700.woff2") format("woff2"); }
@font-face { font-family:"Barlow"; font-weight:400; font-display:swap; src:url("fonts/barlow-400.woff2") format("woff2"); }
@font-face { font-family:"Barlow"; font-weight:700; font-display:swap; src:url("fonts/barlow-600.woff2") format("woff2"); }

:root {
  --steel-50:#F2F4F5; --steel-100:#E5E9EB; --steel-200:#D0D7DA; --steel-400:#93A0A6; --steel-600:#56646B;
  --ink:#172126; --sheet:#FFFFFF;
  --green:#178443; --green-dark:#0F5C2E; --green-soft:#E1F2E7;
  --yellow:#FFCD29; --yellow-soft:#FFF5CF;
  --red:#B8322A; --red-soft:#FBE7E5;
  --blue:#2463A6; --blue-soft:#E3EDF8;
  --amber:#8F5500; --amber-soft:#FFF0D2;
  --display:"Barlow Semi Condensed","DIN Alternate","Bahnschrift","Arial Narrow",sans-serif;
  --text:"Barlow",system-ui,-apple-system,"Segoe UI",sans-serif;
  --radius:6px;
}

*, *::before, *::after { box-sizing:border-box; }
html { font-size:16px; }
body { margin:0; font:1.0625rem/1.5 var(--text); color:var(--ink); background:var(--steel-50); }
a { color:var(--green-dark); text-underline-offset:.15em; }
a:hover { color:var(--ink); }
h1, h2, h3 { font-family:var(--display); font-weight:700; line-height:1.15; margin:0; letter-spacing:.005em; }
h1 { font-size:2.1rem; }
h2 { font-size:1.45rem; margin:2rem 0 .6rem; }
h3 { font-size:1.15rem; }
p { margin:.25rem 0 .9rem; }
.lead { color:var(--steel-600); max-width:68ch; margin-top:.4rem; }
.muted { color:var(--steel-600); }
.small { font-size:.875rem; }
:focus-visible { outline:2px solid var(--ink); outline-offset:1px; box-shadow:0 0 0 5px var(--yellow); border-radius:3px; }

/* ---------- Gerüst ---------- */
.app { display:flex; min-height:100vh; }
.side { width:15.5rem; flex:none; background:var(--sheet); border-right:1px solid var(--steel-200); padding:1.1rem .9rem 2rem; position:sticky; top:0; height:100vh; overflow-y:auto; }
.side .brand { display:block; margin:0 .4rem 1.2rem; }
.side .brand img { display:block; height:46px; width:auto; }
.navlabel { font-family:var(--display); font-weight:600; font-size:.95rem; color:var(--steel-600); margin:1.3rem .5rem .35rem; }
.navlink { display:block; padding:.42rem .6rem; border-radius:var(--radius); color:var(--ink); text-decoration:none; }
.navlink:hover { background:var(--steel-100); }
.navlink.active { background:var(--ink); color:#fff; font-weight:700; }

/* Die Schiene: der Ablauf als nummerierte Stationen an einer durchgehenden Linie */
.rail { list-style:none; margin:0; padding:0; position:relative; }
.rail::before { content:""; position:absolute; left:1.42rem; top:1.1rem; bottom:1.1rem; width:3px; background:var(--steel-200); }
.rail a { display:flex; align-items:center; gap:.65rem; padding:.34rem .6rem; border-radius:var(--radius); color:var(--ink); text-decoration:none; position:relative; }
.rail a:hover { background:var(--steel-100); }
.node { flex:none; display:inline-flex; align-items:center; justify-content:center; width:1.7rem; height:1.7rem; border-radius:50%; background:var(--sheet); border:3px solid var(--steel-200); font-family:var(--display); font-weight:700; font-size:.95rem; line-height:1; }
.rail a.active { font-weight:700; }
.rail a.active .node { background:var(--yellow); border-color:var(--ink); }

.main { flex:1; min-width:0; display:flex; flex-direction:column; }
.top { display:flex; align-items:center; gap:.9rem; padding:.45rem 1.75rem; min-height:3.4rem; border-bottom:1px solid var(--steel-200); background:var(--sheet); }
.top .spacer { flex:1; }
.top form { margin:0; }
.top select { height:2.2rem; max-width:17rem; }
main { padding:1.6rem 1.75rem 4rem; max-width:88rem; width:100%; }
.plain .content { max-width:62rem; margin:0 auto; padding:2rem 1.25rem 4rem; }
.plain .brandbar { display:flex; align-items:center; gap:1rem; margin-bottom:1.75rem; }
.plain .brandbar img { height:52px; }

/* Seitenkopf: Titel links, die Knöpfe der Seite rechts auf seiner Höhe. Auf jeder Seite an derselben Stelle. */
.head { display:flex; flex-wrap:wrap; align-items:flex-start; gap:.6rem .8rem; margin-bottom:1.1rem; }
.head .grow { flex:1; min-width:min(16rem,100%); }
.head > .btn, .head > button, .head > form { margin-top:.1rem; }
.head .lead { margin-bottom:0; }
/* Leiste unter dem Kopf: links Woche, Tag oder Filter, rechts Werkzeuge der Ansicht */
.bar { display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .8rem; margin:0 0 1.1rem; }
.bar .grow { flex:1; }
.bar form { margin:0; }
.bar.inline { align-items:flex-end; }
.period { display:inline-flex; align-items:stretch; background:var(--sheet); border:1px solid var(--steel-400); border-radius:var(--radius); overflow:hidden; }
.period a { display:inline-flex; align-items:center; gap:.3rem; padding:.3rem .75rem; min-height:2.5rem; font-weight:700; color:var(--ink); text-decoration:none; }
.period a:hover { background:var(--steel-100); }
.period .when { display:inline-flex; align-items:center; gap:.45rem; padding:.3rem .9rem; border-left:1px solid var(--steel-200); border-right:1px solid var(--steel-200); white-space:nowrap; }
.period .when strong { font-family:var(--display); font-size:1.15rem; }

/* ---------- Flächen ---------- */
.card { background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); padding:1.1rem 1.25rem; margin-bottom:1rem; }
.card > h2:first-child { margin-top:0; }
.cards { display:grid; grid-template-columns:repeat(auto-fill,minmax(min(15rem,100%),1fr)); gap:1rem; }
.cols { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(21rem,100%),1fr)); gap:1rem; align-items:start; }
.kv { display:grid; grid-template-columns:max-content 1fr; gap:.3rem 1.25rem; margin:0; }
.kv dt { color:var(--steel-600); }
.kv dd { margin:0; }
.stat { font-family:var(--display); font-weight:700; font-size:1.9rem; line-height:1.1; }
pre { background:var(--steel-50); border:1px solid var(--steel-200); padding:.9rem; border-radius:var(--radius); white-space:pre-wrap; font:inherit; }

/* Stationen auf der Übersicht */
.stations { list-style:none; margin:1.6rem 0 0; padding:0; display:grid; grid-template-columns:repeat(auto-fit,minmax(min(13rem,100%),1fr)); row-gap:2.2rem; }
.station { position:relative; border-top:4px solid var(--steel-200); padding:1.35rem 1.25rem 0 0; display:flex; flex-direction:column; }
.station > .node { position:absolute; top:-1.15rem; left:0; width:2.2rem; height:2.2rem; font-size:1.15rem; border-width:4px; }
.station.done { border-top-color:var(--green); }
.station.done > .node { background:var(--green); border-color:var(--green); color:#fff; }
.station.now > .node { background:var(--yellow); border-color:var(--ink); }
.station h3 { margin:0 0 .3rem; font-size:1.3rem; }
.station h3 a { color:var(--ink); text-decoration:none; }
.station h3 a::after { content:""; position:absolute; inset:0; }   /* die ganze Station ist anklickbar */
.station h3 a:hover { text-decoration:underline; }
.station ul { margin:0; padding:0; list-style:none; color:var(--steel-600); font-size:.95rem; }
.station li + li { margin-top:.15rem; }
.station.now ul { color:var(--ink); }

/* ---------- Tabellen: die Arbeitsflächen ---------- */
.tablewrap { overflow-x:auto; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); margin-bottom:1.1rem; }
table { border-collapse:collapse; width:100%; font-variant-numeric:tabular-nums; }
th, td { text-align:left; padding:.55rem .8rem; border-bottom:1px solid var(--steel-100); vertical-align:top; }
tbody tr:last-child > td, tbody tr:last-child > th { border-bottom:0; }
thead th { font-family:var(--display); font-weight:600; font-size:.98rem; color:var(--steel-600); background:var(--steel-50); border-bottom:1px solid var(--steel-200); white-space:nowrap; }
tbody th { font-family:var(--display); font-weight:600; }
tbody tr:hover > td { background:#FAFBFB; }
td.num, th.num { text-align:right; white-space:nowrap; }
tfoot td { font-weight:700; background:var(--steel-50); border-top:1px solid var(--steel-200); border-bottom:0; }
tr.sub > td:first-child { padding-left:2rem; }
.grid td { min-width:11.5rem; }
/* Breite Raster: die erste Spalte bleibt beim waagerechten Blättern stehen */
.grid tbody th, .grid thead th:first-child, .grid tbody td:first-child { position:sticky; left:0; z-index:1; background:var(--sheet); box-shadow:1px 0 0 var(--steel-200); }
.grid thead th:first-child { background:var(--steel-50); }
.grid select { width:100%; font-size:.98rem; }
.days span { display:inline-block; margin-right:.7rem; white-space:nowrap; }
.cellinfo { font-size:.82rem; color:var(--steel-600); margin-top:.25rem; }

/* ---------- Bedienelemente ---------- */
.btn, button { display:inline-flex; align-items:center; justify-content:center; gap:.4rem; min-height:2.5rem; padding:.4rem 1rem; font:700 1rem/1.2 var(--text); color:var(--ink); background:var(--sheet); border:1px solid var(--steel-400); border-radius:var(--radius); cursor:pointer; text-decoration:none; }
.btn:hover, button:hover { background:var(--steel-100); color:var(--ink); }
.btn.primary, button.primary { background:var(--green); border-color:var(--green); color:#fff; }
.btn.primary:hover, button.primary:hover { background:var(--green-dark); border-color:var(--green-dark); color:#fff; }
.btn.danger, button.danger { color:var(--red); border-color:#DDA9A5; background:var(--sheet); }
.btn.danger:hover, button.danger:hover { background:var(--red-soft); }
.btn.small, button.small { min-height:2rem; padding:.2rem .65rem; font-size:.9rem; }
.btn[aria-pressed="true"], button[aria-pressed="true"] { background:var(--ink); border-color:var(--ink); color:#fff; }
.actions { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; margin:1rem 0; }
.nav2 { display:flex; flex-wrap:wrap; gap:.45rem; align-items:center; }

input, select, textarea { font:inherit; color:var(--ink); min-height:2.5rem; padding:.4rem .6rem; border:1px solid var(--steel-400); border-radius:var(--radius); background:#fff; max-width:100%; }
textarea { width:100%; min-height:5rem; }
input[type=number] { width:6rem; text-align:right; }
input.qty { width:4.6rem; }
input[type=checkbox], input[type=radio] { min-height:0; width:1.15rem; height:1.15rem; accent-color:var(--green); vertical-align:-.15em; }
input[type=file] { border:0; padding-left:0; }
input:disabled { background:var(--steel-100); color:var(--steel-600); }
form.stack > div, .formgrid > div { margin-bottom:1rem; }
form.stack label, .formgrid label, .stack > div > label { display:block; font-weight:700; margin-bottom:.25rem; }
form.stack input[type=text], form.stack input[type=email], form.stack input[type=password], form.stack select, .stack input[type=text], .stack select { width:100%; max-width:30rem; }
form.stack div > div label, .stack div > div label { font-weight:400; display:inline-block; margin:0 1.1rem .2rem 0; }
.helptext { display:block; color:var(--steel-600); font-size:.875rem; margin-top:.2rem; }
.errorlist { color:var(--red); margin:.25rem 0; padding-left:1.1rem; font-weight:700; }
.inline { display:flex; flex-wrap:wrap; gap:.75rem; align-items:flex-end; }
.inline > div { margin:0; }
.inline label { display:block; font-size:.875rem; color:var(--steel-600); margin-bottom:.15rem; }
.choice { display:block; cursor:pointer; }
.choice input { margin-right:.5rem; }
.choice:has(input:checked) { border-color:var(--ink); box-shadow:inset 0 0 0 2px var(--ink); background:var(--yellow-soft); }

/* Reiter innerhalb eines Bereichs */
.tabs { display:flex; gap:.25rem; border-bottom:2px solid var(--steel-200); margin:0 0 1.25rem; }
.tabs a { padding:.5rem 1rem; text-decoration:none; color:var(--steel-600); font-family:var(--display); font-weight:600; font-size:1.1rem; border-bottom:4px solid transparent; margin-bottom:-3px; }
.tabs a:hover { color:var(--ink); }
.tabs a.active { color:var(--ink); border-bottom-color:var(--yellow); }

/* ---------- Hinweise und Etiketten ---------- */
.msg, .hint { padding:.7rem 1rem; border-radius:var(--radius); margin-bottom:.7rem; background:var(--blue-soft); border-left:5px solid var(--blue); }
.msg.success { background:var(--green-soft); border-left-color:var(--green); }
.msg.warning, .hint { background:var(--amber-soft); border-left-color:var(--amber); }
.msg.error { background:var(--red-soft); border-left-color:var(--red); }
/* Etiketten: rechteckig mit farbigem Rand, wie die Aufkleber auf den Behältern */
.badge { display:inline-block; padding:.05rem .45rem; border-radius:3px; font-size:.82rem; font-weight:700; line-height:1.4; white-space:nowrap; background:var(--steel-100); color:var(--ink); border-left:4px solid var(--steel-400); }
.badge.ok { background:var(--green-soft); border-left-color:var(--green); }
.badge.warn { background:var(--amber-soft); border-left-color:var(--amber); }
.badge.bad { background:var(--red-soft); border-left-color:var(--red); }
/* Brettfarben: Art des Gerichts */
.board { display:inline-block; width:.8rem; height:.8rem; border-radius:2px; vertical-align:-.05em; margin-right:.3rem; background:var(--green); }
.board-meat { background:var(--red); }
.board-fish { background:var(--blue); }
.board-vegetarian, .board-vegan { background:var(--green); }

/* ---------- Lagerplan ---------- */
.plan-layout { display:grid; grid-template-columns:minmax(0,1fr) 21rem; gap:1.25rem; align-items:start; }
.plan-scroll { overflow:auto; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); padding:1.25rem; }
.floor { position:relative; background-color:#FBFCFC; border:3px solid var(--ink); border-radius:2px;
  background-image:linear-gradient(var(--steel-100) 1px, transparent 1px), linear-gradient(90deg, var(--steel-100) 1px, transparent 1px); touch-action:none; }
.shelf { position:absolute; display:flex; flex-direction:column; align-items:flex-start; justify-content:space-between; overflow:hidden; padding:.25rem .4rem; border:2px solid var(--ink); border-radius:3px; background:#DDE3E6; color:var(--ink); text-align:left; font:inherit; min-height:0; cursor:pointer; user-select:none; -webkit-user-select:none; }
.shelf:hover { background:#D2DADE; }
.shelf .code { font-family:var(--display); font-weight:700; font-size:1.25rem; line-height:1; }
.shelf .what { font-size:.74rem; line-height:1.15; color:var(--steel-600); max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.shelf .fill { font-size:.74rem; font-weight:700; line-height:1.15; }
.shelf.flat { flex-direction:row; align-items:center; justify-content:flex-start; gap:.5rem; }
.shelf.narrow .what { display:none; }
.shelf.narrow.flat .fill { display:none; }
.shelf.kind-fridge { background:var(--blue-soft); }
.shelf.kind-freezer { background:#CFE0F3; }
.shelf.kind-pallet { background:#F1E6D2; border-style:dashed; }
.shelf.kind-table { background:#fff; border-color:var(--steel-400); }
.shelf.kind-door { background:var(--yellow); border-width:0 0 4px 0; border-radius:0; }
.shelf.kind-wall { background:var(--ink); color:#fff; }
.shelf.kind-wall .what, .shelf.kind-door .what { display:none; }
.shelf.empty .fill { color:var(--steel-600); font-weight:400; }
.shelf.alert::after { content:""; position:absolute; top:4px; right:4px; width:.75rem; height:.75rem; border-radius:50%; background:var(--amber); border:2px solid #fff; }
.shelf.alert.expired::after { background:var(--red); }
.shelf.selected { box-shadow:0 0 0 4px var(--yellow); z-index:3; }
.shelf.hit { box-shadow:0 0 0 4px var(--green); z-index:2; }
.floor.searching .shelf:not(.hit) { opacity:.35; }
.shelf.dropping { box-shadow:0 0 0 4px var(--green); }
.shelf.blocked { border-color:var(--red); background:var(--red-soft); }
.editing .shelf { cursor:grab; }
.editing .shelf.dragging { cursor:grabbing; opacity:.85; z-index:4; }
.shelf .grip { display:none; position:absolute; right:0; bottom:0; width:16px; height:16px; background:var(--ink); border-top-left-radius:3px; cursor:nwse-resize; }
.editing .shelf.selected .grip { display:block; }
.plan-side { position:sticky; top:1rem; }
.plan-side h2 { margin-top:0; }
.plan-side h3 { margin:.9rem 0 .35rem; }
.plan-side table td { padding:.4rem .3rem; }
.plan-side select { max-width:9.5rem; min-height:2.1rem; padding:.2rem .4rem; }
.chips { display:flex; flex-wrap:wrap; gap:.35rem; margin:.4rem 0 .9rem; }
.chip { display:inline-block; padding:.2rem .55rem; border:1px solid var(--steel-400); border-radius:3px; background:var(--sheet); font-size:.9rem; cursor:grab; }
.chip:active { cursor:grabbing; }
button.chip { min-height:2.25rem; font-weight:400; }
.legend { display:flex; flex-wrap:wrap; gap:.4rem 1.1rem; font-size:.875rem; color:var(--steel-600); margin-top:.8rem; }
.legend .l-amber::before, .legend .l-red::before, .legend .l-sel::before { content:""; display:inline-block; width:.8rem; height:.8rem; border-radius:50%; margin-right:.35rem; vertical-align:-.05em; background:var(--amber); }
.legend .l-red::before { background:var(--red); }
.legend .l-sel::before { background:var(--yellow); border-radius:2px; }
.status-line { font-size:.875rem; color:var(--steel-600); min-height:1.3rem; }

.note { break-inside:avoid; }

/* ---------- Kopfzeile, Benutzermenü, App ---------- */
.side-head { display:flex; align-items:center; justify-content:space-between; }
.side-close, .menu-toggle, .top-mark, .side-org { display:none; }
.iconbtn { min-height:2.75rem; min-width:2.75rem; padding:0; border-color:transparent; background:transparent; font-size:1.2rem; }
.iconbtn:hover { background:var(--steel-100); }
.top-org { display:flex; align-items:center; gap:.9rem; min-width:0; }
.side:focus { outline:none; }
.top-org .org-name.only-small { display:none; }
.top-org .org-name { font-family:var(--display); font-size:1.1rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.trial-chip { font-size:.875rem; font-weight:700; text-decoration:none; color:var(--ink); background:var(--yellow-soft); border:1px solid var(--yellow); border-radius:999px; padding:.2rem .7rem; white-space:nowrap; }
.usermenu { position:relative; }
.usermenu summary { list-style:none; display:flex; align-items:center; gap:.5rem; cursor:pointer; min-height:2.75rem; padding:0 .4rem; border-radius:var(--radius); }
.usermenu summary::-webkit-details-marker { display:none; }
.usermenu summary:hover { background:var(--steel-100); }
.avatar { display:inline-flex; align-items:center; justify-content:center; width:2rem; height:2rem; border-radius:50%; background:var(--ink); color:#fff; font-family:var(--display); font-weight:700; }
.usermenu .username { font-weight:700; max-width:12rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.usermenu-panel { position:absolute; right:0; top:calc(100% + .35rem); z-index:30; min-width:15rem; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); box-shadow:0 10px 30px rgba(23,33,38,.14); padding:.4rem; display:flex; flex-direction:column; }
.usermenu-panel a, .usermenu-panel button { display:flex; justify-content:flex-start; width:100%; min-height:2.6rem; padding:.45rem .7rem; border:0; border-radius:4px; background:none; font:inherit; font-weight:400; color:var(--ink); text-decoration:none; text-align:left; }
.usermenu-panel a:hover, .usermenu-panel button:hover { background:var(--steel-100); }
.usermenu-panel form { margin:0; border-top:1px solid var(--steel-100); margin-top:.3rem; padding-top:.3rem; }
.usermenu-who { padding:.5rem .7rem .6rem; border-bottom:1px solid var(--steel-100); margin-bottom:.3rem; }
.usermenu-panel [hidden] { display:none; }
/* Sprache wählen: drei gleich breite Knöpfe, die gewählte Sprache hervorgehoben. Im Benutzermenü und unter den Seiten ohne Anmeldung. */
.langs { display:flex; gap:.3rem; margin:0; }
.langs button { flex:1 1 0; justify-content:center; min-height:2.4rem; padding:.3rem .5rem; border:1px solid var(--steel-200); border-radius:4px; background:var(--sheet); font:inherit; font-size:.95rem; font-weight:400; color:var(--ink); text-align:center; cursor:pointer; }
.langs button:hover { background:var(--steel-100); }
.langs button[aria-current] { border-color:var(--green); background:var(--green-soft); color:var(--green-dark); font-weight:600; }
.usermenu-panel .langs { padding:.5rem .3rem .3rem; }
.usermenu-panel .langs button { width:auto; min-height:2.4rem; padding:.3rem .5rem; border:1px solid var(--steel-200); justify-content:center; text-align:center; }
.usermenu-panel .langs button[aria-current] { border-color:var(--green); background:var(--green-soft); font-weight:600; }
.plain .content > .noprint > .langs, .plain .content > .langs { max-width:30rem; margin-top:2.5rem; }
.offline-bar { position:sticky; top:0; z-index:40; background:var(--amber-soft); border-bottom:2px solid var(--amber); padding:.5rem 1rem; font-weight:700; text-align:center; }
.offline-bar[hidden] { display:none; }
.narrow-card { max-width:30rem; }
.formrow { display:grid; grid-template-columns:repeat(auto-fit,minmax(10rem,1fr)); gap:0 1rem; }

/* ---------- Abo ---------- */
.meters .stat .of { font-size:1.05rem; color:var(--steel-600); font-weight:600; }
.meter { height:.55rem; background:var(--steel-100); border-radius:999px; overflow:hidden; margin:.5rem 0 .6rem; }
.meter span { display:block; height:100%; background:var(--green); border-radius:999px; max-width:100%; }
.meter.over span { background:var(--amber); }
.plans { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(16rem,100%),1fr)); gap:1rem; margin-top:1rem; }
.plans .actions { grid-column:1/-1; margin-top:0; }
.plan { display:flex; flex-direction:column; gap:.35rem; margin:0; }
.plan-top { display:flex; align-items:center; gap:.5rem; }
.plan-name { font-family:var(--display); font-size:1.4rem; }
.plan-price { font-family:var(--display); font-weight:700; font-size:1.9rem; line-height:1.1; }
.plan ul { margin:.3rem 0 0; padding-left:1.1rem; }
.plan.current { border-color:var(--green); }
.keybox { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.95rem; word-break:break-all; background:var(--yellow-soft); border:1px dashed var(--amber); padding:.7rem .9rem; border-radius:var(--radius); user-select:all; }
pre.code { font-family:ui-monospace,SFMono-Regular,Menlo,monospace; font-size:.85rem; overflow-x:auto; white-space:pre; }

/* ---------- Lager: Übersicht, Buchen, Wareneingang, Zählen ---------- */
.head-actions { display:flex; gap:.6rem; flex-wrap:wrap; }
.btn.big, button.big { min-height:3.1rem; padding:.5rem 1.4rem; font-size:1.1rem; }
.btn svg, button svg { flex:none; }
button:disabled, button:disabled:hover { background:var(--steel-100); border-color:var(--steel-200); color:var(--steel-400); cursor:not-allowed; }
.linklike, .linklike:hover { display:inline; min-height:0; padding:0; border:0; background:none; font:inherit; color:var(--green-dark); text-decoration:underline; text-underline-offset:.15em; cursor:pointer; }
.linklike:hover { color:var(--ink); }
.crumb { margin:0 0 .3rem; font-size:.95rem; }

/* Kennzahlen als Kacheln mit farbiger Oberkante, wie die Stationen der Übersicht */
.tiles { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:.8rem; margin-bottom:.4rem; }
.tile { display:flex; flex-direction:column; gap:.1rem; padding:.8rem 1rem .9rem; background:var(--sheet); border:1px solid var(--steel-200); border-top:4px solid var(--steel-200); border-radius:var(--radius); color:var(--ink); text-decoration:none; }
.tile:hover { border-color:var(--steel-400); color:var(--ink); }
.tile .stat { font-size:2.2rem; }
.tile-label { color:var(--steel-600); font-size:.95rem; line-height:1.25; }
.tile.now { border-top-color:var(--yellow); }
.tile.warn { border-top-color:var(--amber); }
.tile.bad { border-top-color:var(--red); }
.split { display:grid; grid-template-columns:minmax(0,1.65fr) minmax(0,1fr); gap:0 1.75rem; align-items:start; }

/* Aufgaben: eine Zeile, ein Handgriff */
.tasks { list-style:none; margin:0 0 .6rem; padding:0; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); overflow:hidden; }
.task { display:flex; flex-wrap:wrap; align-items:center; gap:.5rem 1rem; padding:.75rem 1rem .75rem .85rem; border-bottom:1px solid var(--steel-100); border-left:5px solid transparent; }
.task:last-child { border-bottom:0; }
.task.now { border-left-color:var(--yellow); }
.task.warn { border-left-color:var(--amber); }
.task.bad { border-left-color:var(--red); }
.task-main { flex:1; min-width:min(13rem,100%); }
.task-title { font-family:var(--display); font-weight:700; font-size:1.15rem; margin-right:.35rem; }
.task-actions { display:flex; gap:.5rem; flex-wrap:wrap; }
.task-actions form { margin:0; }
.plus { color:var(--green-dark); font-weight:700; }
.minus { font-weight:700; }
.meter.low span { background:var(--amber); }

/* Buchungsdialog */
dialog.sheet { border:0; padding:0; width:min(34rem,calc(100vw - 2rem)); max-height:calc(100dvh - 2rem); border-radius:10px; box-shadow:0 24px 60px rgba(23,33,38,.35); color:var(--ink); background:var(--sheet); overflow:hidden; }
dialog.sheet::backdrop { background:rgba(23,33,38,.45); }
dialog.sheet[open] { display:flex; flex-direction:column; }
dialog.sheet > form { display:flex; flex-direction:column; min-height:0; flex:1; margin:0; }
#scanner-manual { margin-top:.4rem; }
#scanner-manual label { margin-top:.6rem; }
.sheet-head { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.85rem .75rem .5rem 1.25rem; }
.sheet-head h2 { margin:0; }
.sheet-body { padding:.2rem 1.25rem 1.1rem; overflow-y:auto; flex:1; }
.sheet-body label, .sheet-body legend { display:block; font-weight:700; margin:1rem 0 .3rem; padding:0; }
.sheet-body input[type=search], .sheet-body input[type=text]:not(.stepper input), .sheet-body select { width:100%; }
.sheet-body .formrow > div { min-width:0; }
.sheet-foot { display:flex; gap:.6rem; padding:.8rem 1.25rem; border-top:1px solid var(--steel-200); background:var(--steel-50); }
.sheet-foot .primary { flex:1; }
.seg { display:inline-flex; border:1px solid var(--steel-400); border-radius:var(--radius); overflow:hidden; background:var(--sheet); }
.seg button { border:0; border-radius:0; min-height:2.6rem; padding:.3rem 1.1rem; }
.seg button + button { border-left:1px solid var(--steel-400); }
.seg.wide { display:flex; }
.seg.wide button { flex:1; font-size:1.05rem; min-height:2.9rem; }
.stepper { display:inline-flex; align-items:stretch; border:1px solid var(--steel-400); border-radius:var(--radius); overflow:hidden; background:#fff; }
.stepper button { border:0; border-radius:0; min-width:3rem; min-height:3rem; padding:0; font-size:1.5rem; line-height:1; background:var(--steel-50); }
.stepper button:hover { background:var(--steel-100); }
.stepper input { border:0; border-radius:0; width:5.5rem; min-height:3rem; text-align:center; font:700 1.35rem/1 var(--display); border-left:1px solid var(--steel-200); border-right:1px solid var(--steel-200); }
.stepper:focus-within { outline:2px solid var(--ink); outline-offset:1px; box-shadow:0 0 0 5px var(--yellow); }
.stepper input:focus-visible { outline:none; box-shadow:none; }
.qtyrow { display:flex; flex-wrap:wrap; gap:.6rem; align-items:center; }
.picklist { list-style:none; margin:.5rem 0 0; padding:0; border:1px solid var(--steel-200); border-radius:var(--radius); max-height:min(21rem,44dvh); overflow-y:auto; }
.picklist li + li { border-top:1px solid var(--steel-100); }
.picklist button { display:flex; width:100%; justify-content:space-between; align-items:baseline; gap:1rem; border:0; border-radius:0; min-height:3rem; padding:.5rem .8rem; background:none; font-weight:400; text-align:left; }
.picklist button:hover, .picklist button:focus-visible { background:var(--yellow-soft); }
.picklist .pl-name { font-weight:700; }
.picklist .pl-info { color:var(--steel-600); font-size:.875rem; text-align:right; }
.picklist .none { padding:.8rem; color:var(--steel-600); }
.picked { display:flex; align-items:center; justify-content:space-between; gap:1rem; padding:.65rem .9rem; margin-top:1rem; background:var(--steel-50); border:1px solid var(--steel-200); border-left:5px solid var(--yellow); border-radius:var(--radius); }
.picked strong { font-family:var(--display); font-size:1.3rem; line-height:1.15; }
.choices { border:0; margin:0; padding:0; min-width:0; }
.sheet-body .pill { display:inline-flex; margin:0 .4rem .4rem 0; font-weight:400; cursor:pointer; }
.pill input { position:absolute; opacity:0; width:0; height:0; min-height:0; }
.pill span { display:inline-flex; align-items:center; min-height:2.5rem; padding:.3rem .9rem; border:1px solid var(--steel-400); border-radius:999px; background:var(--sheet); }
.pill input:checked + span { background:var(--ink); border-color:var(--ink); color:#fff; font-weight:700; }
.pill input:focus-visible + span { outline:2px solid var(--ink); outline-offset:1px; box-shadow:0 0 0 5px var(--yellow); }
.sheet-body .chips { margin:.6rem 0 0; }
.sheet-body .chips button { font-weight:400; }
.sheet-body .status-line { margin:.5rem 0 0; }
.status-line.warn { color:var(--amber); font-weight:700; }
details.more { margin-top:.9rem; }
details.more summary { cursor:pointer; color:var(--green-dark); text-decoration:underline; text-underline-offset:.15em; }
details.more input { margin-top:.4rem; }

/* Strichcodes scannen */
.scanbtn svg { margin-right:.1rem; }
.viewfinder { position:relative; background:var(--ink); border-radius:var(--radius); overflow:hidden; aspect-ratio:4 / 3; }
.viewfinder video { display:block; width:100%; height:100%; object-fit:cover; }
.viewfinder .frame { position:absolute; inset:28% 10%; border:3px solid var(--yellow); border-radius:8px; box-shadow:0 0 0 100vmax rgba(23,33,38,.35); }
.toast { position:fixed; left:50%; bottom:calc(1.25rem + env(safe-area-inset-bottom)); transform:translateX(-50%); z-index:60; max-width:min(34rem,calc(100vw - 2rem)); padding:.7rem 1.1rem; border-radius:var(--radius); background:var(--ink); color:#fff; font-weight:700; box-shadow:0 10px 30px rgba(23,33,38,.3); }
.toast.warn { background:var(--amber-soft); color:var(--ink); border:2px solid var(--amber); }
.toast[hidden] { display:none; }
.hint.info { background:var(--blue-soft); border-left-color:var(--blue); }
.sheet-body > .hint { margin:.9rem 0 0; }
.scanned-mark { display:none; }
.recv-line.scanned { border-left-color:var(--green); }
.recv-line.scanned .scanned-mark { display:inline-block; }
.recv.assigning, .assigning .recv-line { cursor:pointer; }
.assigning .recv-line:hover { background:var(--yellow-soft); }
@keyframes flash { from { background:var(--green-soft); } to { background:transparent; } }
.recv-line.flash { animation:flash 1.4s ease-out; }
@media (prefers-reduced-motion:reduce) { .recv-line.flash { animation:none; } }
/* Prüfprotokoll */
.temp { display:inline-flex; align-items:center; gap:.35rem; white-space:nowrap; }
.temp select { min-width:3.2rem; padding-left:.5rem; padding-right:.2rem; font-weight:700; }
.temp input { width:5rem; text-align:right; }
.tempfield label { display:block; font-weight:700; margin-bottom:.25rem; }
.tempfield.wanted label::after { content:" · bitte messen"; font-weight:400; color:var(--amber); }
.cellinfo.warn { color:var(--red); font-weight:700; }
#check .choices { margin-top:1rem; }
#check legend, #check-issues > label { display:block; font-weight:700; margin:0 0 .35rem; padding:0; }
#check .pill { display:inline-flex; margin:0 .4rem .4rem 0; cursor:pointer; }
#check-issues > label { margin-top:.6rem; }

/* Bestand */
.filterbar { display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; margin-bottom:1rem; }
.filterbar input[type=search] { width:min(18rem,100%); }
.filterbar .chips { margin:0; }
.fchip { min-height:2.25rem; padding:.2rem .8rem; border-radius:999px; font-weight:400; font-size:.95rem; }
.fchip .n { font-weight:700; margin-left:.1rem; }
.rowactions { white-space:nowrap; text-align:right; }
.rowactions button + button { margin-left:.35rem; }
.rowactions button { border-color:var(--steel-200); }
.rowactions button:hover { border-color:var(--steel-400); }
.only-small { display:none; }
tr.sub > td { background:var(--steel-50); font-size:.95rem; }
tr.is-empty > td:not(.rowactions) { color:var(--steel-600); }

/* Wareneingang und Zählen */
.stickybar { position:sticky; bottom:.75rem; z-index:5; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem 1rem; padding:.75rem 1rem; margin:1.1rem 0 0; background:var(--sheet); border:1px solid var(--steel-400); border-radius:var(--radius); box-shadow:0 8px 24px rgba(23,33,38,.14); }
.stickybar .grow { flex:1; min-width:min(12rem,100%); }
.recv { list-style:none; margin:0; padding:0; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); overflow:hidden; }
.recv-line { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:.5rem 1.5rem; align-items:center; padding:.8rem 1rem .8rem .85rem; border-bottom:1px solid var(--steel-100); border-left:5px solid transparent; }
.recv-line:last-child { border-bottom:0; }
.recv-line.diff { border-left-color:var(--amber); background:#FFFBF1; }
.recv-line label { display:block; font-size:.875rem; color:var(--steel-600); margin-bottom:.15rem; }
.recv-what strong { font-family:var(--display); font-size:1.15rem; }
.recv-place { margin-top:.15rem; }
.counttable thead th { font-size:1.05rem; color:var(--ink); }
.counttable thead th .muted { font-family:var(--text); font-weight:400; font-size:.9rem; }
.counttable td.countcell { white-space:nowrap; text-align:right; width:1%; }
.counttable .unit { display:inline-block; min-width:2.6rem; text-align:left; }
.counttable tr.changed > td { background:var(--yellow-soft); }
.printbox { display:none; }

/* Lagerplan: Posten am Regal */
.lotlist { list-style:none; margin:0; padding:0; }
.lotitem { padding:.55rem 0; border-bottom:1px solid var(--steel-100); }
.lotitem:last-child { border-bottom:0; }
.lotitem-top { display:flex; justify-content:space-between; gap:.75rem; align-items:baseline; }
.lotitem .amount { font-family:var(--display); font-weight:700; font-size:1.1rem; white-space:nowrap; }
.lotitem-actions { display:flex; gap:.4rem; margin-top:.4rem; align-items:center; }
.plan-side .lotitem-actions select { max-width:none; flex:1; min-width:0; }
.chip[aria-pressed="true"] { background:var(--yellow); border-color:var(--ink); font-weight:700; }
.floor.picking .shelf:not(.kind-table):not(.kind-door):not(.kind-wall) { box-shadow:0 0 0 3px var(--green); }
.floor.compact .shelf { padding:.05rem .2rem; border-width:1.5px; }
.floor.compact .shelf .code { font-size:.95rem; }
.floor.compact .shelf .what { display:none; }
.floor.compact .shelf .fill { font-size:.62rem; }
.floor.compact .shelf.flat .fill { display:none; }
.planbar { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin:0 0 1rem; }
.planbar .grow { flex:1; }

/* Küche: Bereitstellen zum Abhaken */
.picktable td.check { width:1%; padding-right:0; }
.picktable input[type=checkbox] { width:1.5rem; height:1.5rem; }
.picktable tr.done > td { color:var(--steel-600); background:var(--steel-50); }
.picktable tr.done .pick-name { text-decoration:line-through; }

/* ---------- Tablet hochkant und kleiner: Navigation als Schublade ---------- */
@media (max-width:1023px) {
  .side { position:fixed; z-index:50; top:0; left:0; bottom:0; height:auto; width:min(19rem,86vw); transform:translateX(-105%); transition:transform .22s ease; box-shadow:none; padding-top:calc(.9rem + env(safe-area-inset-top)); padding-bottom:calc(2rem + env(safe-area-inset-bottom)); padding-left:calc(.9rem + env(safe-area-inset-left)); }
  .nav-open .side { transform:none; box-shadow:0 0 40px rgba(23,33,38,.3); }
  .side-close { display:inline-flex; }
  .side .brand { margin-bottom:.6rem; }
  .scrim { position:fixed; inset:0; z-index:45; background:rgba(23,33,38,.4); }
  .scrim[hidden] { display:none; }
  .nav-open { overflow:hidden; }
  .menu-toggle, .top-mark { display:inline-flex; }
  .top-mark img { height:34px; width:auto; display:block; }
  .top { position:sticky; top:0; z-index:20; gap:.5rem; padding:.35rem .75rem; padding-top:calc(.35rem + env(safe-area-inset-top)); padding-left:calc(.75rem + env(safe-area-inset-left)); padding-right:calc(.75rem + env(safe-area-inset-right)); }
  .navlink, .rail a { min-height:2.75rem; }
  main { padding:1.25rem 1.25rem 4rem; }
}
@media (max-width:900px) {
  .plan-layout { grid-template-columns:minmax(0,1fr); }
  .plan-side { position:static; }
}
@media (prefers-reduced-motion:reduce) { .side { transition:none; } }

/* ---------- Handy ---------- */
@media (max-width:640px) {
  html { font-size:15.5px; }
  .top .profile-label, .usermenu .username { display:none; }
  .top-org form, .top-org .org-name { display:none; }
  .side-org { display:block; margin:0 0 .6rem; }
  .side-org .navlabel { margin:.4rem .5rem .3rem; display:block; }
  .side-org select { width:100%; }
  .trial-chip { font-size:.8rem; padding:.15rem .55rem; }
  main { padding:1rem 1rem calc(3rem + env(safe-area-inset-bottom)); padding-left:calc(1rem + env(safe-area-inset-left)); padding-right:calc(1rem + env(safe-area-inset-right)); }
  h1 { font-size:1.65rem; }
  h2 { font-size:1.3rem; margin-top:1.6rem; }
  .card { padding:.95rem 1rem; }
  .head { margin-bottom:1rem; }
  .head .grow { min-width:0; flex-basis:100%; }
  th, td { padding:.5rem .6rem; }
  .tabs { overflow-x:auto; scrollbar-width:none; }
  .tabs a { white-space:nowrap; padding:.5rem .75rem; font-size:1rem; }
  .actions > .btn, .actions > button { flex:1 1 auto; }
  .stations { grid-template-columns:1fr; row-gap:2.2rem; }
  .station { padding-right:0; }
  .plain .content { padding:1.25rem 1rem 3rem; }
  .plain .brandbar img { height:44px; }
  form.stack input[type=text], form.stack input[type=email], form.stack input[type=password], form.stack select { max-width:none; }
  .top-org .org-name, .top-org .org-name.only-small { display:block; font-size:1rem; max-width:52vw; }
  .grid td { min-width:9.5rem; }
  .grid tbody th, .grid tbody td:first-child { max-width:7.5rem; white-space:normal; }
  /* Tabellen als Karten, z. B. die Tourliste fürs Fahrerhandy */
  .tablewrap:has(> .cardtable) { background:none; border:0; overflow:visible; }
  .cardtable thead { display:none; }
  .cardtable, .cardtable tbody, .cardtable tr, .cardtable td { display:block; width:auto; }
  .cardtable tr { background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); padding:.7rem .9rem; margin-bottom:.7rem; position:relative; }
  .cardtable td { border:0; padding:.2rem 0; text-align:left; }
  .cardtable td.num { text-align:left; }
  .cardtable td[data-label]::before { content:attr(data-label); display:block; font-size:.8rem; color:var(--steel-600); font-weight:700; }
  .cardtable td.ct-empty { display:none; }
  .cardtable .ct-nr { position:absolute; right:.8rem; top:.7rem; padding:0; }
  .cardtable .ct-title { font-family:var(--display); font-size:1.2rem; font-weight:700; padding-right:2.5rem; }
  .cardtable tbody tr:hover > td { background:none; }
  .usermenu-panel { position:fixed; left:.5rem; right:.5rem; top:auto; bottom:calc(.5rem + env(safe-area-inset-bottom)); min-width:0; }
}
/* Lager auf kleinen Bildschirmen */
@media (max-width:1100px) { .split { grid-template-columns:minmax(0,1fr); } }
@media (max-width:640px) {
  .tiles { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tile .stat { font-size:1.9rem; }
  .head-actions { width:100%; }
  .head-actions > .btn, .head-actions > button { flex:1; min-height:3rem; }
  .head-actions > .scanbtn.compact { flex:0 0 auto; padding:.4rem .9rem; }
  .head-actions > .scanbtn.compact span { display:none; }
  .sheet-head .btn.small { min-height:2.5rem; }
  dialog.sheet { width:100vw; max-width:100vw; height:100dvh; max-height:100dvh; margin:0; border-radius:0; }
  dialog.sheet > form { height:100dvh; }
  .sheet-foot { padding-bottom:calc(.8rem + env(safe-area-inset-bottom)); }
  .task-actions { width:100%; }
  .task-actions > *, .task-actions form > button { flex:1; }
  .task-actions form { display:flex; flex:1; }
  .recv-line { grid-template-columns:auto minmax(0,1fr); gap:.6rem .8rem; align-items:end; }
  .recv .stepper input { width:3.6rem; }
  .recv .stepper button { min-width:2.75rem; }
  .recv-what { grid-column:1 / -1; }
  .recv-mhd input { width:100%; }
  .stickybar { bottom:0; margin-left:-1rem; margin-right:-1rem; border-radius:0; border-left:0; border-right:0; border-bottom:0; padding-bottom:calc(.75rem + env(safe-area-inset-bottom)); }
  .stickybar .primary { flex:1; }
  .cardtable .rowactions { display:flex; gap:.5rem; padding-top:.5rem; }
  .cardtable .rowactions button { flex:1; margin:0; min-height:2.75rem; }
  .cardtable tr.sub { margin-left:1rem; background:var(--steel-50); }
  .filterbar input[type=search] { width:100%; }
  .filterbar .chips { flex-wrap:nowrap; overflow-x:auto; scrollbar-width:none; margin:0 -1rem; padding:0 1rem; }
  .fchip { white-space:nowrap; flex:none; }
  .counttable td { padding:.5rem .55rem; }
  .only-wide { display:none !important; }
  .only-small { display:inline; }
  /* Bestand als kompakte Karten: Name und Menge oben, Platz und Haltbarkeit darunter */
  .stocktable tr { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:.1rem .75rem; align-items:baseline; }
  .stocktable tr[hidden] { display:none; }
  .stocktable td { grid-column:1 / -1; }
  .stocktable td.ct-title { grid-column:1; padding-right:0; }
  .stocktable td.c-qty { grid-column:2; grid-row:1; text-align:right; font-family:var(--display); font-size:1.2rem; }
  .stocktable td.c-qty .cellinfo { font-family:var(--text); font-size:.8rem; margin-top:0; }
  .stocktable td.c-place, .stocktable td.c-mhd, .stocktable td.c-free { color:var(--steel-600); font-size:.95rem; }
  .stocktable td.c-free .cellinfo { display:inline; font-size:inherit; }
  .stocktable td.c-free .cellinfo::before { content:"· "; }
  .planbar input[type=search] { flex:1; min-width:8rem; }
  .plan-scroll { padding:.5rem; }
}
/* Finger statt Maus: größere Ziele */
@media (pointer:coarse) {
  .btn, button { min-height:2.75rem; }
  .btn.small, button.small { min-height:2.4rem; }
  input, select { min-height:2.75rem; }
  input[type=checkbox], input[type=radio] { width:1.35rem; height:1.35rem; }
}
.standalone .top { -webkit-user-select:none; user-select:none; }

/* ---------- Druck ---------- */
@media print {
  .side, .top, .noprint, .offline-bar, .scrim, .readonly-bar, .actions, .msg, .tabs, .plan-side { display:none !important; }
  body { background:#fff; font-size:11.5pt; }
  main, .plain .content { padding:0; max-width:none; }
  .card, .tablewrap, .plan-scroll { border:0; padding:0; }
  .note { border-bottom:1px dashed #888; padding-bottom:1rem; margin-bottom:1rem; }
  .pagebreak { break-after:page; }
  .plan-layout { display:block; }
  .stickybar, .filterbar, .head-actions, dialog { display:none !important; }
  .countcell input { display:none; }
  .printbox { display:inline-block; width:5rem; height:1.5rem; border:1px solid #333; vertical-align:middle; margin-right:.3rem; }
  .tiles { display:none; }
}

/* Beleg einlesen */
.receipt-buttons { display:flex; flex-wrap:wrap; gap:.75rem; margin-bottom:.8rem; }
.filebtn { position:relative; display:inline-flex; align-items:center; gap:.5rem; cursor:pointer; }
.filebtn input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; min-height:0; }
.filebtn:focus-within { outline:2px solid var(--ink); outline-offset:1px; box-shadow:0 0 0 5px var(--yellow); }
.filebtn.disabled { opacity:.5; pointer-events:none; }
.rline-use { display:flex !important; align-items:center; gap:.5rem; font-size:inherit !important; color:inherit !important; margin:0 !important; cursor:pointer; }
.rline-use input { width:1.35rem; height:1.35rem; min-height:0; flex:none; }
.rline .rline-label { margin-top:.55rem; }
.rline select[data-ing] { width:100%; max-width:28rem; }
.rline-new { margin-top:.5rem; }
.qtyunit { display:inline-flex; align-items:center; gap:.4rem; white-space:nowrap; }
.qtyunit input { width:5.5rem; }
.status-line.bad { color:var(--red); font-weight:700; }
.receipt-text { white-space:pre-wrap; font-size:.85rem; background:var(--steel-100); padding:.8rem; border-radius:var(--radius); max-height:24rem; overflow:auto; }
@media (max-width:640px) { .receipt-buttons .btn { flex:1 1 100%; justify-content:center; } }
.rline-new[hidden] { display:none; }
.receipt-head label { display:block; }
.receipt-head select { width:100%; }

/* ====================================================================================================
   Bedienung: Orientierung, Suche, Formulare, schnelle Eingabe
   Ein Rahmen für alle: Jede Seite hat denselben Kopf, dieselben Stellen für Woche und Tag, dieselbe Leiste zum
   Speichern. Wer schnell arbeiten will, bekommt Suche, Tastatur und eine kompakte Darstellung dazu, ohne dass
   für die anderen etwas hinzukommt.
   ==================================================================================================== */
.sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
h2.first { margin-top:.4rem; }
kbd { display:inline-block; min-width:1.5rem; padding:.05rem .4rem; border:1px solid var(--steel-400); border-bottom-width:2px; border-radius:4px; background:var(--sheet); font:600 .82rem/1.5 var(--text); text-align:center; color:var(--steel-600); }

/* ---------- Navigation: Zähler neben dem Bereich ---------- */
.rail a .navtext { flex:1; min-width:0; }
.count { flex:none; min-width:1.5rem; padding:0 .4rem; border-radius:999px; background:var(--yellow); color:var(--ink); font:700 .82rem/1.5rem var(--text); text-align:center; }

/* ---------- Suche in der Kopfzeile ---------- */
.search { position:relative; flex:1 1 20rem; max-width:30rem; display:flex; align-items:center; }
.search > svg { position:absolute; left:.7rem; color:var(--steel-600); pointer-events:none; }
.search input { width:100%; height:2.4rem; min-height:0; padding-left:2.3rem; padding-right:2.4rem; background:var(--steel-50); border-color:var(--steel-200); }
.search input:focus { background:#fff; border-color:var(--steel-400); }
.search input::-webkit-search-cancel-button { display:none; }
.search kbd { position:absolute; right:.55rem; }
.search:focus-within kbd { display:none; }
.search-link { display:none; }
.search-results { position:absolute; left:0; right:0; top:calc(100% + .35rem); z-index:35; max-height:min(32rem,75vh); overflow-y:auto; background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); box-shadow:0 10px 30px rgba(23,33,38,.18); padding:.3rem; }
.search-results[hidden] { display:none; }
.search-group { padding:.5rem .6rem .15rem; font-family:var(--display); font-weight:600; font-size:.9rem; color:var(--steel-600); }
.search-item { display:flex; align-items:baseline; gap:.6rem; padding:.45rem .6rem; border-radius:4px; color:var(--ink); text-decoration:none; }
.search-item .sub { color:var(--steel-600); font-size:.875rem; margin-left:auto; text-align:right; }
.search-item:hover, .search-item.active { background:var(--yellow-soft); }
.search-item.active { box-shadow:inset 3px 0 0 var(--ink); }
.search-none { padding:.7rem .6rem; color:var(--steel-600); }
.linklist { padding:0; }
.linklist li { border-bottom:1px solid var(--steel-100); }
.linklist li:last-child { border-bottom:0; }
.linklist a { display:block; padding:.6rem 1rem; color:var(--ink); text-decoration:none; }
.linklist a:hover { background:var(--yellow-soft); }

/* ---------- Kopf der Seite ---------- */
.crumb { margin:0 0 .35rem; font-size:.95rem; }
.crumb a { text-decoration:none; font-weight:700; }
.crumb a:hover { text-decoration:underline; }
.head h1 .badge { vertical-align:middle; font-size:.9rem; margin-left:.4rem; }
.empty { padding:1rem 1.25rem; background:var(--sheet); border:1px dashed var(--steel-400); border-radius:var(--radius); color:var(--steel-600); margin-bottom:1rem; }
.empty.ok { border-style:solid; border-color:var(--steel-200); border-left:5px solid var(--green); color:var(--ink); }
.tiles.glance { grid-template-columns:repeat(auto-fit,minmax(min(14rem,100%),1fr)); margin-top:1.2rem; }
.tiles.glance .tile { border-top-color:var(--ink); }
.tile-go { margin-top:.35rem; font-weight:700; color:var(--green-dark); }
.task .btn { white-space:nowrap; }
details.why { margin:0 0 1rem; color:var(--steel-600); font-size:.95rem; }
details.why summary { cursor:pointer; display:inline-block; color:var(--green-dark); text-decoration:underline; text-underline-offset:.15em; }
details.why p { margin:.4rem 0 0; max-width:72ch; }

/* ---------- Listen: Filter, anklickbare Zeilen ---------- */
.listbar { display:flex; flex-wrap:wrap; gap:.6rem .8rem; align-items:center; margin:0 0 .8rem; }
.listbar input[type=search] { width:min(22rem,100%); }
.listbar .n { color:var(--steel-600); font-size:.95rem; }
.listbar .grow { flex:1; }
tr[data-href] { cursor:pointer; }
tr[data-href]:hover > td { background:var(--yellow-soft); }
tr[data-href] td:first-child a { color:var(--ink); font-weight:700; text-decoration:none; }
tr[data-href]:hover td:first-child a { text-decoration:underline; }
tr.filtered-out { display:none; }
.nomatch { padding:.8rem 1rem; color:var(--steel-600); }
.nomatch[hidden] { display:none; }

/* ---------- Formulare: Abschnitte mit Überschrift, Felder im Raster ---------- */
.section { background:var(--sheet); border:1px solid var(--steel-200); border-radius:var(--radius); padding:1rem 1.25rem .35rem; margin-bottom:1rem; }
.section > h2 { margin:0 0 .8rem; font-size:1.2rem; }
.section > h2 + .muted { margin-top:-.5rem; }
.fields { display:grid; grid-template-columns:repeat(12,minmax(0,1fr)); gap:0 1rem; }
.field { grid-column:span 12; margin-bottom:.9rem; min-width:0; }
.field.w6 { grid-column:span 6; } .field.w4 { grid-column:span 4; } .field.w3 { grid-column:span 3; } .field.w8 { grid-column:span 8; }
.field > label, .field > .label { display:block; font-weight:700; margin-bottom:.2rem; }
.field input[type=text], .field input[type=email], .field input[type=password], .field input[type=number], .field input[type=date], .field input[type=time], .field select, .field textarea { width:100%; }
.field input[type=number] { text-align:left; }
.field .helptext { margin-top:.25rem; }
.field.check > label { display:flex; align-items:flex-start; gap:.55rem; font-weight:700; cursor:pointer; }
.field.check > label input { margin-top:.2rem; flex:none; }
.field.has-error input, .field.has-error select, .field.has-error textarea { border-color:var(--red); box-shadow:0 0 0 1px var(--red); }
/* Mehrfachauswahl (Allergene, Wochentage, Portionsgrößen) als Raster aus Kästchen statt als lange Liste */
.field fieldset > div[id], .stack > div > div[id], .stack fieldset > div[id] { display:grid; grid-template-columns:repeat(auto-fill,minmax(11.5rem,1fr)); gap:.1rem .9rem; }
.field fieldset > div[id] label, .stack > div > div[id] label, .stack fieldset > div[id] label { display:flex; align-items:center; gap:.45rem; font-weight:400; margin:0; padding:.2rem 0; cursor:pointer; }
form.stack > div > fieldset, .field > fieldset { border:0; padding:0; margin:0; min-width:0; }
form.stack > div > fieldset > legend, .field > fieldset > legend { font-weight:700; padding:0; margin-bottom:.25rem; }
/* Leiste zum Speichern: bleibt am unteren Rand stehen und sagt, ob etwas offen ist */
.savebar { position:sticky; bottom:.75rem; z-index:6; display:flex; flex-wrap:wrap; align-items:center; gap:.6rem .9rem; padding:.7rem 1rem; margin:1.1rem 0 0; background:var(--sheet); border:1px solid var(--steel-400); border-radius:var(--radius); box-shadow:0 8px 24px rgba(23,33,38,.14); }
.savebar .grow { flex:1; min-width:min(10rem,100%); }
.savebar .state { color:var(--steel-600); font-size:.95rem; }
.savebar.dirty { border-color:var(--ink); box-shadow:0 0 0 3px var(--yellow), 0 8px 24px rgba(23,33,38,.14); }
.savebar.dirty .state { color:var(--ink); font-weight:700; }
.changed-cell { box-shadow:inset 0 0 0 2px var(--yellow); background:var(--yellow-soft); }

/* ---------- Auswahl mit Suche (Gericht im Speiseplan, Zutat im Rezept) ---------- */
.combo { position:relative; }
.combo > select { display:none; }
.combo-btn { display:flex; width:100%; min-height:2.5rem; padding:.35rem .55rem; align-items:center; justify-content:space-between; gap:.4rem; font-weight:400; text-align:left; line-height:1.25; border-color:var(--steel-400); background:#fff; }
.combo-btn .v { min-width:0; overflow-wrap:break-word; hyphens:auto; }
.combo-btn.is-empty .v { color:var(--steel-600); }
.combo-btn::after { content:""; flex:none; width:.5rem; height:.5rem; border-right:2px solid var(--steel-600); border-bottom:2px solid var(--steel-600); transform:rotate(45deg) translateY(-2px); }
.combo-pop { position:absolute; left:0; top:calc(100% + 2px); z-index:25; width:max(100%,19rem); max-width:calc(100vw - 2rem); background:var(--sheet); border:1px solid var(--steel-400); border-radius:var(--radius); box-shadow:0 12px 32px rgba(23,33,38,.22); padding:.4rem; }
.combo-pop.right { left:auto; right:0; }
.combo-pop.up { top:auto; bottom:calc(100% + 2px); }
.combo-pop input { width:100%; margin-bottom:.35rem; }
.combo-list { list-style:none; margin:0; padding:0; max-height:17rem; overflow-y:auto; }
.combo-list li { padding:.4rem .55rem; border-radius:4px; cursor:pointer; display:flex; justify-content:space-between; gap:.75rem; align-items:baseline; }
.combo-list li .sub { color:var(--steel-600); font-size:.85rem; white-space:nowrap; }
.combo-list li.group { cursor:default; font-family:var(--display); font-weight:600; font-size:.9rem; color:var(--steel-600); padding-top:.55rem; }
.combo-list li.active { background:var(--yellow-soft); box-shadow:inset 3px 0 0 var(--ink); }
.combo-list li.current { font-weight:700; }
.combo-list li.none { color:var(--steel-600); cursor:default; }

/* ---------- Wochenraster: passt in die Breite, am Handy ein Tag auf einmal ---------- */
table.week { table-layout:fixed; }
table.week th:first-child, table.week td:first-child { width:9.5rem; }
table.week td, table.week th { padding:.5rem .4rem; min-width:0; overflow-wrap:break-word; hyphens:auto; }
table.week.days7 th:first-child, table.week.days7 td:first-child { width:7.5rem; }
table.week.days7 .combo-btn { font-size:.95rem; padding:.3rem .4rem; gap:.25rem; }
.nw { white-space:nowrap; }
table.week td:first-child, table.week th:first-child { padding-left:.8rem; }
table.week .cellinfo { font-size:.8rem; line-height:1.35; }
table.week input.qty { width:100%; max-width:5rem; }
th.today, td.today { background:#FFFBEA; }
thead th.today { background:var(--yellow-soft); color:var(--ink); }
.daytabs { display:none; }
.rowremove { min-height:2.2rem; min-width:2.2rem; padding:0; border-color:var(--steel-200); color:var(--steel-600); font-size:1.1rem; }
.rowremove:hover { color:var(--red); border-color:#DDA9A5; background:var(--red-soft); }
tr.removing > td { background:var(--red-soft); }
tr.removing > td:not(:last-child) { text-decoration:line-through; color:var(--steel-600); }
tr.removing .rowremove { color:var(--red); border-color:var(--red); }
.totalline { display:flex; flex-wrap:wrap; gap:.3rem 1.5rem; align-items:baseline; margin:0 0 1rem; }
.totalline .stat { font-size:1.5rem; }
.grouphead { display:flex; flex-wrap:wrap; align-items:baseline; gap:.3rem .9rem; margin:1.6rem 0 .5rem; }
.grouphead h2 { margin:0; }
.grouphead .sum { margin-left:auto; font-family:var(--display); font-weight:700; font-size:1.2rem; }
.packline { display:flex; flex-wrap:wrap; gap:.35rem; margin:.2rem 0 .8rem; }
.packline .badge { font-weight:400; background:var(--sheet); border:1px solid var(--steel-200); border-left:4px solid var(--steel-400); }
.subnav { display:flex; flex-wrap:wrap; gap:.4rem; margin:0 0 1.25rem; }
.keys { display:grid; grid-template-columns:max-content 1fr; gap:.6rem 1.1rem; margin:0 0 1rem; align-items:baseline; }
.keys dt { white-space:nowrap; } .keys dd { margin:0; }

/* ---------- Kompakte Darstellung: mehr Zeilen auf einmal, für Leute, die viel erfassen ---------- */
html[data-density="compact"] { font-size:14.5px; }
html[data-density="compact"] body { line-height:1.4; }
html[data-density="compact"] th, html[data-density="compact"] td { padding:.32rem .65rem; }
html[data-density="compact"] .btn, html[data-density="compact"] button { min-height:2.2rem; padding:.25rem .8rem; }
html[data-density="compact"] input, html[data-density="compact"] select { min-height:2.2rem; padding:.2rem .5rem; }
html[data-density="compact"] input[type=checkbox], html[data-density="compact"] input[type=radio] { min-height:0; padding:0; }
html[data-density="compact"] .navlink, html[data-density="compact"] .rail a { padding-top:.26rem; padding-bottom:.26rem; }
html[data-density="compact"] h1 { font-size:1.8rem; }
html[data-density="compact"] h2 { margin-top:1.5rem; }
html[data-density="compact"] main { padding-top:1.1rem; }
html[data-density="compact"] .card, html[data-density="compact"] .section { padding:.8rem 1rem .3rem; }
html[data-density="compact"] .field { margin-bottom:.65rem; }
html[data-density="compact"] .task { padding-top:.5rem; padding-bottom:.5rem; }

@media (max-width:1023px) {
  .search { flex:1 1 10rem; }
  .search kbd { display:none; }
}
@media (max-width:860px) {
  .field.w6, .field.w4, .field.w3, .field.w8 { grid-column:span 6; }
}
@media (max-width:640px) {
  .search { display:none; }
  .search-link { display:inline-flex; align-items:center; justify-content:center; color:var(--ink); }
  .field.w6, .field.w4, .field.w3, .field.w8 { grid-column:span 12; }
  .field.w3.keep, .field.w4.keep { grid-column:span 6; }
  .period { width:100%; }
  .period .when { flex:1; justify-content:center; }
  .period a .txt { display:none; }
  .bar > .btn, .bar > button { flex:1 1 auto; }
  .head > .btn, .head > button, .head-actions > .btn { flex:1 1 auto; }
  .savebar { bottom:0; margin-left:-1rem; margin-right:-1rem; border-radius:0; border-left:0; border-right:0; border-bottom:0; padding-bottom:calc(.7rem + env(safe-area-inset-bottom)); }
  .savebar .primary { flex:1; }
  .stations { grid-template-columns:1fr 1fr; column-gap:.5rem; }
  /* Wochenraster: ein Tag auf einmal, die Tage als Reiter darüber */
  .daytabs { display:flex; gap:.3rem; margin:0 0 .7rem; }
  .daytabs button { flex:1; min-width:0; padding:.3rem .1rem; flex-direction:column; gap:0; font-size:.95rem; line-height:1.15; }
  .daytabs button small { font-weight:400; font-size:.75rem; color:var(--steel-600); }
  .daytabs button[aria-pressed="true"] small { color:#fff; }
  table.week th:first-child, table.week td:first-child { width:42%; }
  .dayview [data-col] { display:none; }
  .dayview[data-day="0"] [data-col="0"], .dayview[data-day="1"] [data-col="1"], .dayview[data-day="2"] [data-col="2"], .dayview[data-day="3"] [data-col="3"],
  .dayview[data-day="4"] [data-col="4"], .dayview[data-day="5"] [data-col="5"], .dayview[data-day="6"] [data-col="6"] { display:table-cell; }
  .combo-pop { position:fixed; left:.75rem; right:.75rem; top:auto; bottom:calc(.75rem + env(safe-area-inset-bottom)); width:auto; max-width:none; z-index:60; }
  .grouphead .sum { margin-left:0; }
}
@media (pointer:coarse) {
  html[data-density="compact"] .btn, html[data-density="compact"] button, html[data-density="compact"] input, html[data-density="compact"] select { min-height:2.75rem; }
  html[data-density="compact"] input[type=checkbox], html[data-density="compact"] input[type=radio] { min-height:0; }
}
@media print {
  .bar, .listbar, .savebar, .crumb, .subnav, .daytabs, .combo-pop, details.why, #shortcuts { display:none !important; }
  .combo-btn { border:0; padding:0; min-height:0; } .combo-btn::after { display:none; }
}

/* Stand eines Belegs als Strecke: Entwurf → Bestellt → Geliefert. Zeigt, wo man steht und was als Nächstes kommt. */
.track { list-style:none; display:flex; gap:0; margin:0 0 1rem; padding:0; font-family:var(--display); font-weight:600; }
.track li { position:relative; padding:.25rem 1rem .25rem 1.9rem; color:var(--steel-600); border-bottom:4px solid var(--steel-200); }
.track li::before { content:""; position:absolute; left:.55rem; top:.55rem; width:.8rem; height:.8rem; border-radius:50%; background:var(--sheet); border:3px solid var(--steel-200); }
.track li.done { color:var(--ink); border-bottom-color:var(--green); }
.track li.done::before { background:var(--green); border-color:var(--green); }
.track li.now { color:var(--ink); border-bottom-color:var(--yellow); }
.track li.now::before { background:var(--yellow); border-color:var(--ink); }
tr.grouprow > td { font-weight:700; }
.tabs .count { margin-left:.3rem; }
@media print { .track { display:none; } }

/* Formular links, Auskunft rechts (Kalkulation eines Gerichts, Bezugsquellen einer Zutat) */
.formsplit { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(18rem,1fr); gap:1rem 1.25rem; align-items:start; }
.formsplit > :only-child { grid-column:1 / -1; max-width:60rem; }
.formpage { max-width:60rem; }
.sidecard { position:sticky; top:1rem; }
.sidecard .stat { font-size:1.6rem; }
.tablewrap.flat { border-left:0; border-right:0; border-radius:0; margin-left:-1.25rem; margin-right:-1.25rem; }
table.recipe td { vertical-align:middle; }
table.recipe td:first-child { width:55%; }
table.recipe input[type=number] { width:6.5rem; }
table.tight th, table.tight td { padding:.4rem .5rem; }
table.tight th:first-child, table.tight td:first-child { padding-left:0; }
.card > h2, aside .card h2 { margin-top:0; font-size:1.2rem; }
@media (max-width:1100px) { .formsplit { grid-template-columns:minmax(0,1fr); } .sidecard { position:static; } }

.field.check .helptext { font-weight:400; }
html[data-density="compact"] .search input { padding-left:2.3rem; padding-right:2.4rem; height:2.2rem; }
html[data-density="compact"] .combo-btn { min-height:2.2rem; padding:.2rem .45rem; }

/* Handy: Die Leiste zum Speichern bleibt eine Zeile. Der Rückweg steht oben, „Abbrechen“ braucht hier keinen Platz. */
@media (max-width:640px) {
  .savebar { flex-wrap:nowrap; gap:.5rem; }
  .savebar .state, .savebar .grow.muted { display:none; }
  .savebar.dirty .state { display:block; flex:1; font-size:.85rem; line-height:1.2; }
  .savebar a.btn:not(.danger) { display:none; }
  .savebar .danger { flex:none; }
  .only-small.block { display:block; }
  table.stickyfirst th:first-child, table.stickyfirst td:first-child { position:sticky; left:0; z-index:1; background:var(--sheet); box-shadow:1px 0 0 var(--steel-200); max-width:8.5rem; }
  table.stickyfirst thead th:first-child { background:var(--steel-50); }
}
