/* Grundlage: Maße, Schrift, Bausteine. KEIN Farbwert — alle Farben
 * kommen aus hell.css und dunkel.css.
 *
 * Für ein Tablet an der Wand: große Schrift, Tippflächen ab 46 px,
 * wenig Bewegung. Gelesen wird im Vorbeigehen. */

:root {
  --takt: 160ms;
  --rund: 14px;
  --rund-klein: 10px;
  --kopf-oben: env(safe-area-inset-top, 0px);
  --rand-links: max(16px, env(safe-area-inset-left, 0px));
  --rand-rechts: max(16px, env(safe-area-inset-right, 0px));
  --rand-unten: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--text);
  /* Die Systemschrift — auf dem iPad San Francisco, wie in der
     Dangelo's-Küche. Keine Webschrift: nichts von fremden Servern, und
     beim ersten Start nach dem Aufwachen springt nichts um. */
  font: 400 17px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}

button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: var(--akzent); }

:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }

.zahlen { font-variant-numeric: tabular-nums; }
.leise { color: var(--leise); }
.klein { font-size: 0.86rem; }
.unsichtbar {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ── Knöpfe ──────────────────────────────────────────────────────── */
.knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 16px;
  border: 1px solid var(--linie); border-radius: var(--rund-klein);
  background: var(--flaeche); color: var(--text);
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: transform var(--takt) ease, background var(--takt) ease, border-color var(--takt) ease;
}
.knopf:hover:not(:disabled) { border-color: var(--linie-satt); }
.knopf:active:not(:disabled) { transform: scale(0.97); }
.knopf:disabled { opacity: 0.45; cursor: not-allowed; }
.knopf svg { flex: none; }

.knopf-haupt {
  background: var(--akzent-flaeche); border-color: var(--akzent-flaeche);
  color: var(--auf-akzent); font-weight: 700;
}
.knopf-haupt:hover:not(:disabled) { background: var(--akzent-druck); border-color: var(--akzent-druck); }

.knopf-dunkel { background: var(--dunkel); border-color: var(--dunkel); color: var(--auf-dunkel); }
.knopf-dunkel:hover:not(:disabled) { border-color: var(--dunkel); opacity: 0.92; }

.knopf-leise { background: transparent; border-color: transparent; color: var(--leise); }
.knopf-leise:hover:not(:disabled) { color: var(--text); border-color: var(--linie); }

.knopf-klein { min-height: 38px; padding: 0 12px; font-size: 0.9rem; }
.breit { width: 100%; }

.feld {
  width: 100%; min-height: 46px; padding: 0 14px;
  border: 1px solid var(--linie); border-radius: var(--rund-klein);
  background: var(--flaeche); color: var(--text);
}
.feld::placeholder { color: var(--leise); }
.feld:focus { border-color: var(--akzent); outline: none; }

/* ── Punkte: Drucker, Mitteilungen, Verbindung ───────────────────── */
.punkt { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--linie-satt); }
.punkt.ist-gut { background: var(--gut); }
.punkt.ist-warn { background: var(--warnung); }
.punkt.ist-schlecht { background: var(--fehler); animation: pulsieren 1.6s ease-in-out infinite; }
.punkt.ist-leer { background: transparent; box-shadow: inset 0 0 0 2px var(--leise); }

/* ── Überlagerung und Blatt ──────────────────────────────────────── */
.ueberlagerung {
  position: fixed; inset: 0; z-index: 40;
  background: var(--abdunkeln);
  display: grid; place-items: end center;
  animation: auftauchen 140ms ease both;
}
.blatt {
  width: min(36rem, 100%); max-height: 92dvh; min-width: 0;
  display: flex; flex-direction: column;
  background: var(--flaeche); color: var(--text);
  border: 1px solid var(--linie); border-radius: 18px 18px 0 0;
  box-shadow: var(--schatten-3);
  padding-bottom: var(--rand-unten);
  animation: hochschieben 240ms cubic-bezier(0.2, 0.8, 0.3, 1) both;
}
.blatt-schmal { width: min(26rem, 100%); }
.blatt-kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: 18px 18px 10px;
}
.blatt-kopf h2 { font-size: 1.2rem; font-weight: 800; }
.blatt-kopf .unterzeile { color: var(--leise); font-size: 0.92rem; margin-top: 2px; }
.blatt-koerper {
  overflow-y: auto; padding: 4px 18px 16px;
  display: flex; flex-direction: column; gap: 14px;
  -webkit-overflow-scrolling: touch;
}
.blatt-fuss {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  padding: 12px 18px 16px; border-top: 1px solid var(--linie);
}
.blatt-fuss .knopf { flex: 1; }
.schliessen {
  display: grid; place-items: center; width: 44px; height: 44px; margin: -8px -8px 0 0;
  border: 0; border-radius: 50%; background: transparent; color: var(--leise); cursor: pointer;
}
.schliessen:hover { background: var(--flaeche-2); color: var(--text); }

@media (min-width: 40rem) {
  .ueberlagerung { place-items: center; padding: 20px; }
  .blatt { border-radius: 18px; padding-bottom: 0; }
}

.hinweis {
  padding: 10px 12px; border-radius: var(--rund-klein);
  background: var(--flaeche-2); color: var(--leise); font-size: 0.9rem;
}
.fehlerzeile { color: var(--fehler); font-weight: 600; font-size: 0.95rem; }

.dreher {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--linie); border-top-color: var(--akzent);
  animation: drehen 0.8s linear infinite;
}

@keyframes auftauchen { from { opacity: 0; } to { opacity: 1; } }
@keyframes hochschieben { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes hereinkommen {
  0% { opacity: 0; transform: translateY(-8px) scale(0.98); }
  60% { transform: translateY(0) scale(1.01); }
  100% { opacity: 1; transform: none; }
}
@keyframes pulsieren { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes drehen { to { transform: rotate(360deg); } }
@keyframes ruetteln {
  0%, 100% { transform: none; }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}

/* Wer im System „Bewegung reduzieren" gesetzt hat, bekommt sie nicht. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important; animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* Die helle Farbtafel — die Vorgabe.
 *
 * Nach dem Vorbild von Dangelo's (public/hell.css dort), das Rot aus
 * dem heutigen Küchen-Dashboard. Alle Farben der Seite stehen in dieser
 * und in dunkel.css; basis.css und kueche.css enthalten keinen einzigen
 * Farbwert. bin/pruefe_kontrast.mjs rechnet die Paare nach, auf die es
 * ankommt, und bricht das Bauen unter 4,5 : 1 ab.
 *
 * ── Zwei Marken für den Akzent ─────────────────────────────────────
 *   --akzent          als Schrift und Rand auf dem Grund
 *   --akzent-flaeche  als gefüllte Fläche, darauf --auf-akzent
 * Auf Hell ist das dasselbe Rot. Auf Dunkel nicht: Ein Rot, das als
 * Schrift auf Schwarz lesbar ist, ist zu hell, um weiße Schrift zu
 * tragen. Dangelo's löst das mit einer Liste von Ausnahmeregeln; hier
 * sind es von vornherein zwei Namen. */

:root {
  color-scheme: light;

  --grund:        #F7F3EE;
  --flaeche:      #FFFFFF;
  --flaeche-2:    #F4EEE8;
  --flaeche-3:    #EAE0D7;
  --linie:        #E5DAD0;
  --linie-satt:   #C9B8AA;
  --text:         #2A1A10;
  --leise:        #6B5647;

  --akzent:         #B01B1B;
  --akzent-flaeche: #C41E1E;
  --akzent-druck:   #A51818;
  --akzent-weich:   #FBEAE8;
  --auf-akzent:     #FFFFFF;

  --dunkel:       #3D1F0B;
  --auf-dunkel:   #FFFFFF;

  --gut:          #2B6A3F;
  --gut-weich:    #E6F2E9;
  --warnung:      #8A4F06;
  --warnung-weich:#FCEFDC;
  --fehler:       #B01B1B;
  --fehler-weich: #FBEAE8;

  /* Der Statuslauf. Jede Stufe ein Schriftton und eine weiche Fläche
     dahinter; der Schriftton trägt zugleich den linken Kartenrand. */
  --st-neu:           #B01B1B;  --st-neu-weich:          #FBEAE8;
  --st-bestaetigt:    #2B6A3F;  --st-bestaetigt-weich:   #E6F2E9;
  --st-zubereitung:   #9A4A05;  --st-zubereitung-weich:  #FCEEDC;
  --st-fertig:        #1B5AA0;  --st-fertig-weich:       #E5EFFA;
  --st-unterwegs:     #6A3C9C;  --st-unterwegs-weich:    #F1E9F8;
  --st-abholbereit:   #0D6B61;  --st-abholbereit-weich:  #E1F2F0;
  --st-erledigt:      #2B6A3F;  --st-erledigt-weich:     #E6F2E9;
  --st-storno:        #8E1B1B;  --st-storno-weich:       #F6E6E6;

  --abdunkeln:  rgba(42, 26, 16, 0.46);
  --schatten:   0 1px 2px rgba(61, 31, 11, 0.05), 0 2px 10px rgba(61, 31, 11, 0.05);
  --schatten-2: 0 8px 26px rgba(61, 31, 11, 0.12);
  --schatten-3: 0 20px 50px rgba(61, 31, 11, 0.24);
}
/* Die dunkle Farbtafel.
 *
 * Greift, wenn farbe.js an der Wurzel `data-farbe="dunkel"` gesetzt hat
 * — nach der Wahl in der Kopfzeile oder, solange nie gewählt wurde,
 * nach der Einstellung des Geräts. Dieselben Namen wie in hell.css,
 * nichts darüber hinaus: Eine Regel, die nur hier eine Farbe bekäme,
 * stünde auf Hell ohne da.
 *
 * Grundtöne aus der Dangelo's-Küche. Die Kontraste rechnet
 * bin/pruefe_kontrast.mjs nach. */

:root[data-farbe="dunkel"] {
  color-scheme: dark;

  --grund:        #120E0C;
  --flaeche:      #1C1714;
  --flaeche-2:    #261F1B;
  --flaeche-3:    #322824;
  --linie:        #3A2F29;
  --linie-satt:   #5C4B42;
  --text:         #F4ECE6;
  --leise:        #BBA99E;

  --akzent:         #F28B7D;
  --akzent-flaeche: #B3261E;
  --akzent-druck:   #9E211A;
  --akzent-weich:   #3A1F1A;
  --auf-akzent:     #FFFFFF;

  /* Eine Stufe über dem Grund und nicht darunter: Das dunkle Band muss
     sich auf Schwarz noch abheben. */
  --dunkel:       #EDE3DB;
  --auf-dunkel:   #1C1714;

  --gut:          #72C990;
  --gut-weich:    #16281C;
  --warnung:      #EDB866;
  --warnung-weich:#2C2113;
  --fehler:       #F28B7D;
  --fehler-weich: #3A1F1A;

  --st-neu:           #F28B7D;  --st-neu-weich:          #3A1F1A;
  --st-bestaetigt:    #72C990;  --st-bestaetigt-weich:   #16281C;
  --st-zubereitung:   #F0A860;  --st-zubereitung-weich:  #2E2114;
  --st-fertig:        #8AB8F2;  --st-fertig-weich:       #16233A;
  --st-unterwegs:     #C7A6F0;  --st-unterwegs-weich:    #271D37;
  --st-abholbereit:   #6FD0C2;  --st-abholbereit-weich:  #10292A;
  --st-erledigt:      #72C990;  --st-erledigt-weich:     #16281C;
  --st-storno:        #EE9A9A;  --st-storno-weich:       #341818;

  --abdunkeln:  rgba(0, 0, 0, 0.66);
  --schatten:   0 1px 2px rgba(0, 0, 0, 0.35), 0 2px 10px rgba(0, 0, 0, 0.25);
  --schatten-2: 0 8px 26px rgba(0, 0, 0, 0.45);
  --schatten-3: 0 20px 50px rgba(0, 0, 0, 0.6);
}
/* Das Küchen-Dashboard. Keine Farbwerte — nur Marken aus hell/dunkel.css. */

/* ── Anmeldung ───────────────────────────────────────────────────── */
.anmeldung {
  min-height: 100dvh; display: grid; place-items: center;
  padding: calc(24px + var(--kopf-oben)) 20px 24px;
}
.anmeldekarte {
  width: min(24rem, 100%); padding: 30px 26px;
  display: flex; flex-direction: column; gap: 14px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 18px;
  box-shadow: var(--schatten-2);
}
.anmeldekarte .marke { justify-content: center; margin-bottom: 6px; text-align: center; }
.anmeldekarte .marke-text { align-items: center; }
.anmelde-logo { display: block; width: 132px; height: auto; margin: -6px auto 0; }
.anmeldekarte .feld { text-align: center; font-weight: 600; letter-spacing: 0.04em; }
.anmeldekarte .hinweis { text-align: center; }
.startbild {
  min-height: 100dvh; display: grid; place-items: center; align-content: center; gap: 18px;
  padding: var(--kopf-oben) 20px var(--rand-unten);
  color: var(--leise);
}
/* Das Logo ist eine fertig gerundete Kachel mit eigenem Schatten. */
.startbild-logo {
  display: block; width: min(180px, 46vw); height: auto;
  animation: auftauchen 240ms ease both;
}

/* ── Marke ───────────────────────────────────────────────────────── */
.marke { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* Die Symbole sind eckig mit Motiv bis zum Rand — ein Kreis schnitte
   den Schriftzug an. Die Rundung entspricht der von iOS. */
.marke-zeichen { width: 38px; height: 38px; border-radius: 22%; flex: none; display: block; }
.marke-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.marke-name { font-weight: 800; font-size: 1.2rem; white-space: nowrap; }
.marke-zusatz {
  color: var(--akzent); font-size: 0.68rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.14em;
}
.testband {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 7px var(--rand-rechts) 7px var(--rand-links);
  background: var(--warnung-weich); color: var(--warnung); font-size: 0.88rem; text-align: center;
}

/* ── Kopfzeile ───────────────────────────────────────────────────── */
.kopf {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: calc(10px + var(--kopf-oben)) var(--rand-rechts) 10px var(--rand-links);
  background: var(--flaeche); border-bottom: 1px solid var(--linie);
  box-shadow: var(--schatten);
}
.kopf-melder { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.kopf-rechts { display: flex; align-items: center; gap: 4px; margin-left: auto; }

/* Pille: ein Zustand mit Punkt, antippbar. Laden, Drucker, Mitteilungen. */
.pille {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 42px; padding: 0 12px;
  border: 1px solid var(--linie); border-radius: 999px;
  background: var(--flaeche); color: var(--text);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.pille:active { transform: scale(0.97); }
.pille.ist-gut { color: var(--gut); background: var(--gut-weich); border-color: transparent; }
.pille.ist-warn { color: var(--warnung); background: var(--warnung-weich); border-color: transparent; }
.pille.ist-schlecht { color: var(--fehler); background: var(--fehler-weich); border-color: var(--fehler); }
.pille .pfeil { opacity: 0.7; }

.werkzeug {
  position: relative; display: grid; place-items: center;
  width: 46px; height: 46px; border-radius: 12px;
  border: 1px solid transparent; background: transparent; color: var(--text);
  cursor: pointer;
}
.werkzeug:hover { background: var(--flaeche-2); }
.werkzeug:active { transform: scale(0.94); }
.werkzeug.ist-aus { color: var(--leise); }
.werkzeug.mit-text {
  display: inline-flex; gap: 6px; width: auto; padding: 0 10px;
  border-color: var(--linie); font-weight: 600; font-size: 0.9rem;
}
.werkzeug.mit-text.hat-warnung::after { top: -3px; right: -3px; }
@media (max-width: 40rem) { .werkzeug.mit-text span { display: none; } .werkzeug.mit-text { padding: 0; width: 46px; justify-content: center; } }
/* Der rote Punkt: Zutaten oder Artikel sind gerade abgeschaltet. */
.werkzeug.hat-warnung::after {
  content: ""; position: absolute; top: 7px; right: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--akzent-flaeche); box-shadow: 0 0 0 2px var(--flaeche);
}

.uhr { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; padding-left: 6px; }
.stand { color: var(--leise); font-size: 0.72rem; font-variant-numeric: tabular-nums; text-align: right; line-height: 1.1; }
.uhrblock { display: flex; flex-direction: column; align-items: flex-end; }

/* Bis zur Breite eines großen iPads stehen die Zustände in einer eigenen
   Zeile — IMMER, nicht erst, wenn der Platz ausgeht. Sonst bräche die
   Kopfzeile genau dann um, wenn „Drucker offline" länger ist als
   „Drucker bereit", und die ganze Liste spränge im Betrieb nach unten. */
@media (max-width: 80rem) {
  .kopf-melder { order: 3; width: 100%; }
}
@media (max-width: 40rem) {
  .kopf-rechts { width: 100%; justify-content: space-between; margin-left: 0; }
  .marke-zusatz { display: none; }
}

/* ── Bänder unter der Kopfzeile ──────────────────────────────────── */
.band {
  display: flex; align-items: center; gap: 14px; width: calc(100% - var(--rand-links) - var(--rand-rechts));
  margin: 12px var(--rand-rechts) 0 var(--rand-links); padding: 12px 16px;
  border-radius: var(--rund); border: 1px solid transparent; text-align: left; cursor: pointer;
}
.band-alarm { background: var(--akzent-flaeche); color: var(--auf-akzent); box-shadow: var(--schatten-2); }
.band-alarm:active { background: var(--akzent-druck); }
.band-fehler { background: var(--fehler-weich); color: var(--fehler); border-color: var(--fehler); }
.band-titel { font-weight: 800; }
.band-text { font-size: 0.9rem; opacity: 0.95; }
.band-mitte { flex: 1; min-width: 0; }

/* ── Kennzahlen ──────────────────────────────────────────────────── */
.kennzahlen {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1px;
  margin: 12px var(--rand-rechts) 0 var(--rand-links);
  border: 1px solid var(--linie); border-radius: var(--rund); overflow: hidden;
  background: var(--linie);
}
.kennzahl { background: var(--flaeche); padding: 10px 14px; display: flex; flex-direction: column; }
.kennzahl b { font-size: 1.7rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kennzahl span { color: var(--leise); font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.kennzahl.ist-aktiv b { color: var(--akzent); }
@media (max-width: 36rem) {
  .kennzahl { padding: 8px 10px; }
  .kennzahl b { font-size: 1.3rem; }
  .kennzahl span { font-size: 0.62rem; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
}

/* ── Leisten: Tag und Filter ─────────────────────────────────────── */
.leiste {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 12px var(--rand-rechts) 0 var(--rand-links);
}
.leiste-rechts { margin-left: auto; display: flex; gap: 10px; }

/* Die Datumswahl: ein echtes <input type="date"> liegt unsichtbar über
   der Beschriftung. So öffnet ein Tippen den Kalender des Systems. */
.datumswahl { position: relative; }
.datumswahl input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; border: 0;
}
.datumswahl .knopf { pointer-events: none; font-size: 1rem; }

.reiterleiste {
  display: flex; gap: 4px; padding: 4px; overflow-x: auto;
  background: var(--flaeche-2); border-radius: 12px; max-width: 100%;
  scrollbar-width: none;
}
.reiterleiste::-webkit-scrollbar { display: none; }
.reiter {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 40px; padding: 0 14px; border: 0; border-radius: 9px;
  background: transparent; color: var(--leise); font-weight: 600; cursor: pointer; white-space: nowrap;
}
.reiter.ist-an { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten); }
.reiter:disabled { opacity: 0.4; cursor: default; }
.reiter .zahl {
  min-width: 22px; padding: 1px 7px; border-radius: 999px;
  background: var(--flaeche-3); color: var(--text); font-size: 0.78rem; font-weight: 800;
  font-variant-numeric: tabular-nums; text-align: center;
}
.reiter .zahl.ist-alarm { background: var(--akzent-flaeche); color: var(--auf-akzent); }

.auswahl {
  min-height: 46px; padding: 0 12px; border: 1px solid var(--linie); border-radius: var(--rund-klein);
  background: var(--flaeche); color: var(--text); font-weight: 600;
}
.suchfeld { position: relative; flex: 1 1 14rem; max-width: 22rem; }
.suchfeld svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--leise); pointer-events: none; }
.suchfeld .feld { padding-left: 40px; padding-right: 44px; }
.suchfeld .leeren {
  position: absolute; right: 2px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px; display: grid; place-items: center;
  border: 0; background: transparent; color: var(--leise); cursor: pointer;
}
.suchstand { margin: 12px var(--rand-rechts) 0 var(--rand-links); color: var(--leise); font-weight: 600; font-size: 0.92rem; }

@media (max-width: 52rem) {
  .suchfeld { max-width: none; }
}

/* ── Die Tafel ───────────────────────────────────────────────────── */
.tafel {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: repeat(auto-fill, minmax(min(21rem, 100%), 1fr));
  padding: 14px var(--rand-rechts) calc(96px + var(--rand-unten)) var(--rand-links);
}

.karte {
  --status: var(--st-neu); --status-weich: var(--st-neu-weich);
  position: relative; display: flex; flex-direction: column;
  background: var(--flaeche); border: 1px solid var(--linie); border-left: 5px solid var(--status);
  border-radius: var(--rund); box-shadow: var(--schatten); overflow: hidden;
  animation: auftauchen 200ms ease both;
}
.karte[data-ton="neu"]         { --status: var(--st-neu);         --status-weich: var(--st-neu-weich); }
.karte[data-ton="bestaetigt"]  { --status: var(--st-bestaetigt);  --status-weich: var(--st-bestaetigt-weich); }
.karte[data-ton="zubereitung"] { --status: var(--st-zubereitung); --status-weich: var(--st-zubereitung-weich); }
.karte[data-ton="fertig"]      { --status: var(--st-fertig);      --status-weich: var(--st-fertig-weich); }
.karte[data-ton="unterwegs"]   { --status: var(--st-unterwegs);   --status-weich: var(--st-unterwegs-weich); }
.karte[data-ton="abholbereit"] { --status: var(--st-abholbereit); --status-weich: var(--st-abholbereit-weich); }
.karte[data-ton="erledigt"]    { --status: var(--st-erledigt);    --status-weich: var(--st-erledigt-weich); }
.karte[data-ton="storno"]      { --status: var(--st-storno);      --status-weich: var(--st-storno-weich); }

.karte.ist-neu { box-shadow: 0 0 0 2px var(--akzent), var(--schatten-2); }
.karte.ist-frisch { animation: hereinkommen 600ms ease both; }
.karte.ist-erledigt .positionen, .karte.ist-erledigt .karte-kopf { opacity: 0.62; }
.karte.ist-storniert .artikel { text-decoration: line-through; }

.karte-kopf {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 12px 14px 10px; border: 0; background: transparent; text-align: left; cursor: pointer;
}
.nummer { font-size: 1.75rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.karte.ist-neu .nummer { color: var(--akzent); }
.kopf-mitte { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.statuschip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--status-weich); color: var(--status);
  font-size: 0.8rem; font-weight: 800; white-space: nowrap;
}
.vorchip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  background: var(--warnung-weich); color: var(--warnung);
  font-size: 0.8rem; font-weight: 800; white-space: nowrap;
}
.kopf-ende { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.art { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.88rem; white-space: nowrap; }
.art-zeit { color: var(--leise); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.aufklapp { color: var(--leise); transition: transform var(--takt) ease; }
.aufklapp.ist-offen { transform: rotate(180deg); }

.vorband {
  display: flex; align-items: center; gap: 8px;
  margin: 0 14px 8px; padding: 8px 12px; border-radius: var(--rund-klein);
  background: var(--warnung-weich); color: var(--warnung); font-weight: 800;
}

.positionen { list-style: none; margin: 0; padding: 0 14px; display: flex; flex-direction: column; }
.position { padding: 8px 0; border-top: 1px solid var(--linie); }
.position:first-child { border-top: 0; padding-top: 2px; }
.position-kopf { display: flex; gap: 8px; align-items: baseline; }
.menge { font-weight: 800; color: var(--akzent); font-variant-numeric: tabular-nums; min-width: 2.2ch; }
.artikel { font-weight: 700; }
.sku { color: var(--leise); font-weight: 500; font-size: 0.85rem; }
.extras { margin: 3px 0 0 calc(2.2ch + 8px); color: var(--leise); font-size: 0.93rem; }
.anmerkung {
  margin: 5px 0 0 calc(2.2ch + 8px); color: var(--akzent); font-weight: 700; font-size: 0.95rem;
}

.notiz {
  margin: 6px 14px 4px; padding: 9px 12px;
  background: var(--warnung-weich); color: var(--text);
  border-left: 3px solid var(--warnung); border-radius: 0 var(--rund-klein) var(--rund-klein) 0;
  font-size: 0.95rem;
}
.notiz b { color: var(--warnung); }

.details {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 14px;
  margin: 8px 14px 4px; padding: 12px; border-radius: var(--rund-klein); background: var(--flaeche-2);
}
.details .ganz { grid-column: 1 / -1; }
.details dt { color: var(--leise); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }
.details dd { margin: 1px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.details a { text-decoration: none; font-weight: 700; }
.details .summe { font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.details .knopf { grid-column: 1 / -1; }

.karte-fuss {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 14px; color: var(--leise); font-size: 0.9rem;
}
.karte-fuss .summe { color: var(--text); font-weight: 800; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.karte.ist-alt .alter { color: var(--fehler); font-weight: 700; }

.druckzeile {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 14px; border-top: 1px solid var(--linie);
}
.druckstand { font-size: 0.85rem; font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.druckstand.ist-gedruckt { color: var(--gut); }
.druckstand.ist-offen { color: var(--fehler); }
.druckstand.ist-unbekannt { color: var(--leise); }

.aktionen { display: flex; gap: 8px; padding: 10px 14px 14px; }
.aktionen .knopf-haupt { flex: 1; min-height: 52px; font-size: 1.05rem; }
.aktionen .storno { width: 52px; min-height: 52px; padding: 0; color: var(--leise); }
.aktionen .storno:hover:not(:disabled) { color: var(--fehler); border-color: var(--fehler); }

.rueckfrage {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 14px 14px; font-weight: 700;
}
.rueckfrage span { flex: 1; color: var(--fehler); }

/* ── Leer und Laden ──────────────────────────────────────────────── */
.leer {
  display: grid; place-items: center; gap: 10px; text-align: center;
  padding: 80px 24px; color: var(--leise);
}
.leer svg { opacity: 0.5; }

/* ── Schwebende Hinweise ─────────────────────────────────────────── */
.neu-pille {
  position: fixed; left: 50%; bottom: calc(18px + var(--rand-unten)); transform: translateX(-50%); z-index: 15;
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 999px;
  background: var(--akzent-flaeche); color: var(--auf-akzent);
  font-weight: 800; font-size: 1.05rem; box-shadow: var(--schatten-3); cursor: pointer; white-space: nowrap;
  animation: huepfen 2.4s ease-in-out infinite;
}
.neu-pille b { font-size: 1.3rem; font-variant-numeric: tabular-nums; }
@keyframes huepfen { 0%, 88%, 100% { transform: translateX(-50%); } 94% { transform: translateX(-50%) translateY(-6px); } }

.toast {
  position: fixed; left: 50%; top: calc(84px + var(--kopf-oben)); transform: translateX(-50%); z-index: 50;
  max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px;
  background: var(--dunkel); color: var(--auf-dunkel); font-weight: 700; box-shadow: var(--schatten-3);
  animation: auftauchen 160ms ease both;
}
.toast.ist-fehler { background: var(--akzent-flaeche); color: var(--auf-akzent); }

/* ── Blätter ─────────────────────────────────────────────────────── */
.wahlzeile {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 60px; padding: 10px 14px;
  border: 1px solid var(--linie); border-radius: 12px;
  background: var(--flaeche); color: var(--text); text-align: left; cursor: pointer;
}
.wahlzeile:disabled { cursor: not-allowed; opacity: 0.55; }
.wahlzeile.ist-an { border-color: var(--akzent); box-shadow: inset 0 0 0 1px var(--akzent); }
.wahlzeile .wahl-text { flex: 1; }
.wahlzeile b { display: block; }
.wahlzeile small { color: var(--leise); font-size: 0.86rem; }

.druckerlage {
  display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px;
}
.druckerlage.ist-gut { background: var(--gut-weich); color: var(--gut); }
.druckerlage.ist-schlecht { background: var(--fehler-weich); color: var(--fehler); }
.druckerlage b { display: block; font-size: 1.05rem; }
.druckerlage span { font-size: 0.9rem; }
.schritte { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; counter-reset: schritt; }
.schritte li { display: flex; gap: 12px; counter-increment: schritt; }
.schritte li::before {
  content: counter(schritt); flex: none; display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--flaeche-3); color: var(--text); font-weight: 800; font-size: 0.9rem;
}
.schritte small { display: block; color: var(--leise); margin-top: 2px; }
.hotline {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 8px;
  padding: 12px 14px; border-radius: 12px; background: var(--flaeche-2);
}
.hotline a { font-size: 1.2rem; font-weight: 800; text-decoration: none; font-variant-numeric: tabular-nums; }

.gruppe { display: flex; flex-direction: column; gap: 6px; }
.gruppe-kopf { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gruppe-kopf h3 { font-size: 0.95rem; font-weight: 800; }
.schalterzeile {
  display: flex; align-items: center; gap: 12px;
  min-height: 54px; padding: 6px 8px 6px 14px;
  border: 1px solid var(--linie); border-radius: 12px; background: var(--flaeche);
}
.schalterzeile.ist-aus { background: var(--fehler-weich); border-color: transparent; }
.schalterzeile .name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.schalterzeile.ist-aus .name { color: var(--fehler); }
.schalterzeile .preis { color: var(--leise); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.schalterzeile .stand-text { color: var(--fehler); font-size: 0.8rem; font-weight: 700; }
.ausgeblendet { display: flex; flex-wrap: wrap; gap: 6px; }
.marke-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border: 1px solid var(--linie); border-radius: 999px; background: var(--flaeche); cursor: pointer; font-weight: 600; font-size: 0.88rem;
}

/* Die einzige feste Farbe der Seite, mit Absicht: Ein QR-Code braucht
   dunkle Punkte auf hellem Grund, sonst liest ihn manche Kamera nicht —
   auch im dunklen Modus. */
.qr { display: grid; place-items: center; padding: 14px; border-radius: 12px; background: #FFFFFF; }
.qr img { display: block; width: min(260px, 70vw); height: auto; image-rendering: pixelated; }

.pin-feld {
  text-align: center; font-size: 2rem; font-weight: 800; letter-spacing: 0.5em;
  min-height: 64px; font-variant-numeric: tabular-nums;
}
.pin-feld.ist-falsch { border-color: var(--fehler); animation: ruetteln 360ms ease; }

.anleitung { margin: 0; padding-left: 1.3rem; display: flex; flex-direction: column; gap: 6px; }
.stand-an { display: flex; align-items: center; gap: 10px; font-weight: 700; }
