/* LeanRoutine Gastro – Hausfarben #1d1d1b / #575756, große Bedienflächen für Handy und Tablet */
:root {
  --dunkel: #1d1d1b; --grau: #575756; --hell: #f4f4f2; --linie: #d6d6d3; --weiss: #fff;
  --petrol: #0f5a68; --gelb: #fff3bf; --gelbRand: #e0b400; --rot: #b42318; --gruen: #1e7a3c;
  --r: 12px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--hell); color: var(--dunkel); font: 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
body { padding-bottom: env(safe-area-inset-bottom); }
h1 { font-size: 1.25rem; margin: 0; flex: 1; }
h2 { font-size: 1.05rem; margin: 24px 0 8px; }
a { color: var(--petrol); }
.kopf { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top), var(--safe-area-inset-top, 0px)); background: var(--dunkel); color: var(--weiss); }
.kopf .knopf.flach { color: var(--weiss); border-color: transparent; }
.symbol { width: 34px; height: 34px; border-radius: 8px; }
.schritte { display: flex; gap: 4px; list-style: none; margin: 0; padding: 8px 16px; background: var(--weiss); border-bottom: 1px solid var(--linie); font-size: .8rem; color: var(--grau); overflow-x: auto; }
.schritte li { flex: 1; text-align: center; padding: 4px 0; border-bottom: 3px solid var(--linie); white-space: nowrap; }
.schritte li.fertig { border-color: var(--grau); }
.schritte li.jetzt { border-color: var(--petrol); color: var(--dunkel); font-weight: 600; }
.inhalt { max-width: 760px; margin: 0 auto; padding: 16px; }
.zweispaltig { max-width: 1180px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
@media (min-width: 900px) { .zweispaltig { grid-template-columns: minmax(300px, 1fr) minmax(0, 1.3fr); align-items: start; } .beleg { position: sticky; top: 76px; } }
.beleg { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 8px; max-height: 80vh; overflow: auto; }
.beleg img { width: 100%; display: block; }
.knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 1px solid var(--grau); border-radius: var(--r); background: var(--weiss); color: var(--dunkel); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.knopf.haupt { background: var(--dunkel); border-color: var(--dunkel); color: var(--weiss); }
.knopf.gross { width: 100%; min-height: 64px; font-size: 1.15rem; }
.knopf.flach { background: transparent; border-color: transparent; color: var(--petrol); }
.knopf.klein { min-height: 36px; padding: 4px 10px; font-size: .9rem; }
.knopf:disabled { opacity: .45; cursor: not-allowed; }
.leiste { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.leiste.senkrecht { flex-direction: column; align-items: stretch; }
.reihe { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
label { display: block; margin: 10px 0; font-size: .92rem; color: var(--grau); }
label small { display: block; color: var(--grau); }
input, select, textarea { display: block; width: 100%; margin-top: 4px; min-height: 48px; padding: 10px 12px; border: 1px solid var(--linie); border-radius: 10px; background: var(--weiss); color: var(--dunkel); font: inherit; font-size: 1rem; }
input[type="checkbox"], input[type="radio"] { display: inline-block; width: 22px; height: 22px; min-height: 0; margin: 0 8px 0 0; vertical-align: middle; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(15, 90, 104, .35); border-color: var(--petrol); }
.unsicher, input.unsicher { background: var(--gelb); border-color: var(--gelbRand); }
.felder { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 0 12px; }
input[type="date"], input[type="time"] { min-width: 0; }
fieldset.wahl { border: 1px solid var(--linie); border-radius: var(--r); margin: 12px 0; padding: 6px 12px; background: var(--weiss); }
fieldset.wahl.unsicher { background: var(--gelb); }
fieldset.wahl label { display: inline-flex; align-items: center; margin: 6px 16px 6px 0; color: var(--dunkel); font-size: 1rem; min-height: 40px; }
.haken { display: flex; align-items: center; color: var(--dunkel); }
table.saetze { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--weiss); border-radius: var(--r); overflow: hidden; }
table.saetze.unsicher { outline: 2px solid var(--gelbRand); }
table.saetze th, table.saetze td { padding: 6px; text-align: right; border-bottom: 1px solid var(--linie); }
table.saetze th:first-child, table.saetze td:first-child { text-align: left; }
table.saetze input, table.saetze select { margin: 0; text-align: right; min-width: 0; padding: 8px 6px; }
table.saetze th:nth-child(1) { width: 26%; } table.saetze th:nth-child(5) { width: 44px; }
table.saetze td { padding: 6px 3px; }
table.saetze tfoot td { font-weight: 600; }
.netto { color: var(--grau); }
.hinweis { margin: 8px 0; padding: 10px 12px; border-left: 4px solid var(--grau); background: var(--weiss); border-radius: 6px; font-size: .93rem; }
.hinweis.warnung { border-color: var(--gelbRand); background: var(--gelb); }
.leise { color: var(--grau); font-size: .9rem; }
.fuss { color: var(--grau); font-size: .8rem; margin-top: 32px; text-align: center; }
.karte { background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); padding: 16px; margin: 12px 0; }
.karte h2 { margin-top: 0; }
table.kurz { width: 100%; border-collapse: collapse; }
table.kurz td { padding: 4px 0; } table.kurz td:last-child { text-align: right; }
table.kurz tr.summe td { border-top: 2px solid var(--dunkel); font-weight: 700; padding-top: 8px; }
.liste { list-style: none; margin: 0; padding: 0; }
.liste li { display: flex; align-items: center; gap: 6px; margin: 6px 0; }
.zeile { flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; background: var(--weiss); border: 1px solid var(--linie); border-radius: var(--r); font: inherit; color: var(--dunkel); text-align: left; cursor: pointer; }
.zeile small { color: var(--grau); }
.offen { color: var(--rot); }
.ok { color: var(--gruen); font-weight: 600; }
.fotofeld input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.fotofeld { margin: 8px 0 4px; }
.balken { height: 10px; background: var(--linie); border-radius: 5px; overflow: hidden; margin-top: 20px; }
#balken { height: 100%; width: 0; background: var(--petrol); transition: width .2s; }
pre.ocr { white-space: pre-wrap; font-size: .8rem; background: var(--weiss); padding: 8px; border-radius: 8px; max-height: 300px; overflow: auto; }
details { margin: 14px 0; } summary { cursor: pointer; color: var(--petrol); font-weight: 600; min-height: 40px; display: flex; align-items: center; }
.gast { font-size: 1.1rem; }
.gast h1 { font-size: 1.6rem; margin: 12px 0; }
.gast input, .gast textarea { font-size: 1.15rem; min-height: 56px; }
.gast label { font-size: 1rem; color: var(--dunkel); }
.betrag { font-size: 1.3rem; font-weight: 700; margin: 8px 0 16px; }
.logo { max-width: 200px; max-height: 80px; }
#meldungen { position: fixed; right: 16px; bottom: max(16px, env(safe-area-inset-bottom)); left: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; pointer-events: none; z-index: 20; }
.meldung { pointer-events: none; max-width: 520px; padding: 12px 16px; border-radius: 10px; background: var(--dunkel); color: var(--weiss); box-shadow: 0 4px 16px rgba(0,0,0,.2); }
.meldung.fehler { background: var(--rot); }
input.gerechnet { color: var(--grau); font-style: italic; background: var(--hell); }
label.gesamt input { max-width: 220px; font-weight: 700; }
ol.anleitung { margin: 0 0 4px; padding-left: 22px; line-height: 1.5; }
ol.anleitung li { margin: 6px 0; }
/* 0.3.0: Positionen, Speisekarte, Unterschrift */
table.positionen, table.karteListe { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--weiss); border-radius: var(--r); overflow: hidden; }
table.positionen.unsicher { outline: 2px solid var(--gelbRand); }
table.positionen th, table.positionen td, table.karteListe th, table.karteListe td { padding: 5px 3px; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
table.positionen th:nth-child(1) { width: 15%; } table.positionen th:nth-child(3) { width: 24%; } table.positionen th:nth-child(4) { width: 22%; } table.positionen th:nth-child(5) { width: 44px; }
table.karteListe th:nth-child(2) { width: 24%; } table.karteListe th:nth-child(3) { width: 22%; } table.karteListe th:nth-child(4) { width: 44px; }
table.positionen input, table.positionen select, table.karteListe input, table.karteListe select { margin: 0; min-width: 0; padding: 8px 6px; }
table.positionen td:nth-child(1) input, table.positionen td:nth-child(3) input, #posSumme { text-align: right; }
table.positionen tr.unsicher td { background: var(--gelb); }
table.positionen tfoot td { font-weight: 600; border-bottom: 0; }
small.einzel { display: block; color: var(--grau); font-size: .78rem; margin-top: 2px; }
canvas.unterschrift { display: block; width: 100%; height: 160px; background: var(--weiss); border: 1px dashed var(--grau); border-radius: 10px; touch-action: none; }
.karte label.haken { margin: 8px 0; }
/* Handy: je Position zwei Zeilen – Bezeichnung ganz breit, darunter Menge, Betrag, Satz */
@media (max-width: 600px) {
  table.positionen thead { display: none; }
  table.positionen tbody tr { display: grid; grid-template-columns: 64px 1fr 104px 84px 40px; grid-template-areas: "text text text text weg" "menge leer betrag satz satz"; gap: 4px 6px; padding: 6px 4px; border-bottom: 1px solid var(--linie); }
  table.positionen tbody td { border: 0; padding: 0; }
  table.positionen tbody td:nth-child(1) { grid-area: menge; } table.positionen tbody td:nth-child(2) { grid-area: text; }
  table.positionen tbody td:nth-child(3) { grid-area: betrag; } table.positionen tbody td:nth-child(4) { grid-area: satz; } table.positionen tbody td:nth-child(5) { grid-area: weg; }
  table.positionen tbody tr.unsicher { background: var(--gelb); }
  table.positionen tfoot tr { display: flex; justify-content: space-between; align-items: center; padding: 4px; }
  table.positionen tfoot td { border: 0; }
}

/* Bon zuschneiden (ab 0.4.0) */
.zuschnitt { display: flex; justify-content: center; margin: 12px 0; background: #2a2a28; border-radius: 8px; padding: 10px; }

/* Karten in den Einstellungen (0.8.0): Löschen steht in der Kartenzeile, Sprungleiste oben */
summary.kartenzeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; padding: 10px 0; }
summary.kartenzeile .kartenname { flex: 1 1 auto; min-width: 0; }
summary.kartenzeile .loeschen { flex: 0 0 auto; }
details[data-kid] { border-bottom: 1px solid var(--linie, #d9d9d6); }
nav.sprung { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
h2[id^="sek-"] { scroll-margin-top: 72px; }
ul.geraete { list-style: none; padding: 0; margin: 8px 0; }
ul.geraete li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--linie, #d9d9d6); }
ul.geraete li button { margin-left: auto; }
