/* SHIO Kuechenmonitor (/kueche/). Setzt tokens.css, fonts.css und ui.css voraus.
   Laptop 1280x800 bis 1920x1080: dunkel, grosse Schrift, Beruehrflaechen mindestens 48 px.
   Die Grundschrift waechst mit der Breite (15 px bei 1280, rund 18,5 px bei 1920), alle Masse in rem. */

html {
  font-size: clamp(15px, calc(7.4px + .58vw), 19px);
  background: var(--schwarz);
  height: 100%;
  overflow: hidden;
}
body { height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--schwarz); }

.kd {
  --rand: 1.75rem;
  --erledigt-breite: 21rem;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  background: var(--schwarz);
}

/* ---------- Kopfleiste ---------- */
.kd-kopf {
  position: relative; z-index: 5; flex: none;
  background: linear-gradient(180deg, #0d1014, #090a0d);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04), 0 18px 40px -30px rgba(0, 0, 0, .9);
}
.kd-kopf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--ui-gold-linie); opacity: .55;
}
.kd-kopf__zeile { display: flex; align-items: center; gap: 1.5rem; padding-inline: var(--rand); }
.kd-kopf__zeile--oben { min-height: 4.6rem; padding-top: .7rem; padding-bottom: .35rem; }
.kd-kopf__zeile--reiter { padding-top: .35rem; padding-bottom: .9rem; }

.kd-marke { display: flex; align-items: center; gap: .85rem; flex: none; }
.kd-marke__zeichen { width: 2.9rem; height: 2.9rem; }
.kd-marke__text { display: grid; gap: .1rem; }
.kd-marke__name { font-size: .64rem; font-weight: 600; letter-spacing: var(--sperrung-logo); color: var(--gold); line-height: 1; }
.kd-marke__titel { display: flex; align-items: center; gap: .55rem; font-size: 1.55rem; font-weight: 500; color: var(--weiss); line-height: 1.05; letter-spacing: .01em; }
.kd-beispiel { font-size: .55rem; letter-spacing: .14em; }

.kd-zahlen { display: flex; align-items: stretch; margin: 0 auto 0 1.5rem; }
.kd-zahl { padding: .15rem 1.5rem; border-left: 1px solid var(--linie); display: grid; gap: .2rem; align-content: center; }
.kd-zahl dt { font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); line-height: 1.2; white-space: nowrap; }
.kd-zahl__zusatz { letter-spacing: .08em; text-transform: none; font-weight: 500; color: var(--text-3); opacity: .8; margin-left: .3em; }
.kd-zahl dd { margin: 0; font-size: 1.6rem; font-weight: 500; color: var(--weiss); line-height: 1.05; transition: color var(--ui-dauer) var(--ease); }
.kd-zahl dd.ist-warn { color: var(--warn); }
.kd-zahl dd.ist-alarm { color: #ff8e86; }
.kd-zahl dd.ist-leer { color: var(--text-3); }
.kd-zahl dd .kd-zahl__leise { font-size: .9rem; font-weight: 500; color: var(--text-3); }

.kd-werkzeug { display: flex; align-items: center; gap: .6rem; flex: none; }
.kd-uhr { display: grid; justify-items: end; gap: .15rem; margin-right: .7rem; }
.kd-uhr__zeit { font-size: 2.05rem; font-weight: 300; color: var(--weiss); line-height: 1; letter-spacing: .02em; }
.kd-uhr__datum { font-size: .62rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--text-3); line-height: 1; }
.kd-knopf-rund { width: 3.1rem; min-width: 48px; min-height: 48px; height: 3.1rem; }
.kd-knopf-rund .icon { width: 1.3rem; height: 1.3rem; }
.kd-knopf-rund[aria-pressed="false"] { color: var(--text-3); }
.kd-absender { padding-left: 1.1rem; margin-left: .5rem; border-left: 1px solid var(--linie); display: flex; align-items: center; min-height: 2.6rem; }
.kd-absender .rbpay-marke { font-size: .6rem; }

/* Stationen-Reiter */
.kd-reiter {
  display: flex; gap: .3rem; padding: .3rem; flex-wrap: wrap;
  background: rgba(255, 255, 255, .025); border: 1px solid var(--linie); border-radius: 999px;
}
.kd-reiter__knopf {
  display: inline-flex; align-items: center; gap: .6rem;
  min-height: 3.35rem; padding: 0 1.1rem 0 1.25rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--text-2); cursor: pointer;
  font-size: 1rem; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  transition: background-color var(--ui-dauer) var(--ease), color var(--ui-dauer) var(--ease), box-shadow var(--ui-dauer) var(--ease);
}
.kd-reiter__knopf .icon { width: 1.25rem; height: 1.25rem; color: var(--text-3); transition: color var(--ui-dauer) var(--ease); }
.kd-reiter__knopf:hover { color: var(--weiss); background: rgba(255, 255, 255, .04); }
.kd-reiter__knopf[aria-selected="true"] {
  color: var(--weiss);
  background: linear-gradient(180deg, #252a32, #1a1e24);
  box-shadow: inset 0 0 0 1px rgba(201, 168, 106, .55), inset 0 1px 0 rgba(255, 255, 255, .06), 0 10px 24px -14px rgba(201, 168, 106, .55);
}
.kd-reiter__knopf[aria-selected="true"] .icon { color: var(--gold-hell); }
.kd-reiter__knopf:focus-visible { outline: 2px solid var(--ui-fokus); outline-offset: 2px; border-radius: 999px; }
.kd-reiter__zahl {
  min-width: 1.9rem; height: 1.9rem; padding: 0 .5rem; border-radius: 999px;
  display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .07); color: var(--text); font-size: .9rem; font-weight: 700; font-variant-numeric: tabular-nums;
  transition: background-color var(--ui-dauer) var(--ease), color var(--ui-dauer) var(--ease);
}
.kd-reiter__zahl.ist-null { color: var(--text-3); background: rgba(255, 255, 255, .03); }
.kd-reiter__knopf[aria-selected="true"] .kd-reiter__zahl:not(.ist-null) { background: var(--gold-verlauf); color: var(--ui-gold-text); }

.kd-erledigt-schalter { margin-left: auto; min-height: 3.35rem; gap: .6rem; padding: 0 1.1rem 0 1.2rem; font-size: .95rem; }
.kd-erledigt-schalter .icon { width: 1.2rem; height: 1.2rem; }
.kd-erledigt-schalter .kd-schalter__pfeil { transition: transform var(--ui-dauer-lang) var(--ease); color: var(--text-3); }
.kd-erledigt-schalter[aria-expanded="true"] .kd-schalter__pfeil { transform: rotate(180deg); }
.kd-erledigt-schalter .knopf__zahl { background: rgba(79, 207, 141, .16); color: #a8f0c9; }

/* ---------- Banner (Verbindung) ---------- */
.kd-banner {
  flex: none; margin: .9rem var(--rand) 0; padding: .7rem .8rem .7rem 1.1rem;
  display: flex; align-items: center; gap: 1rem;
  border-radius: 18px; border: 1px solid rgba(238, 90, 82, .5); background: rgba(238, 90, 82, .1);
  color: #ffd3cf; font-weight: 500;
  animation: kd-banner-rein 380ms var(--ease) both;
}
.kd-banner--lokal { border-color: rgba(201, 168, 106, .5); background: var(--gold-glanz); color: var(--gold-hell); }
.kd-banner .icon { width: 1.4rem; height: 1.4rem; flex: none; }
.kd-banner__text { flex: 1; line-height: 1.35; }
.kd-banner__text b { color: var(--weiss); font-weight: 600; }
.kd-banner .knopf { flex: none; }
@keyframes kd-banner-rein { from { opacity: 0; transform: translateY(-6px); } }

/* ---------- Mitte: Brett + Erledigt ---------- */
.kd-mitte {
  flex: 1 1 auto; display: grid; grid-template-columns: minmax(0, 1fr) var(--erledigt-breite); grid-template-rows: minmax(0, 1fr);
  min-height: 0;
  transition: grid-template-columns var(--ui-dauer-lang) var(--ease);
}
.kd.ist-erledigt-zu .kd-mitte { grid-template-columns: minmax(0, 1fr) 0; }

/* position:relative: Bezug fuer offsetTop der Bons (neuer Bon wird in Sicht gescrollt) */
.kd-brett { position: relative; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 1.3rem var(--rand) 2rem; scroll-behavior: smooth; overscroll-behavior: contain; }
.kd-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(18.5rem, 1fr)); gap: 1.1rem; align-items: start; }

/* ---------- Bon-Karte ---------- */
.bon {
  --akzent: linear-gradient(90deg, transparent, rgba(201, 168, 106, .75) 25%, rgba(233, 213, 166, .9) 50%, rgba(201, 168, 106, .75) 75%, transparent);
  position: relative; display: flex; flex-direction: column; min-width: 0; max-height: var(--bon-max, none);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, 0) 7rem), var(--flaeche);
  border: 1px solid rgba(255, 255, 255, .11); border-radius: 22px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 44px -30px rgba(0, 0, 0, .95);
  transition: border-color 400ms var(--ease), background-color 400ms var(--ease);
}
.bon::before {
  content: ""; position: absolute; left: 18px; right: 18px; top: -1px; height: 2px; border-radius: 2px;
  background: var(--akzent); opacity: .9; transition: opacity 400ms var(--ease);
}
.bon[data-stufe="warn"] { --akzent: linear-gradient(90deg, transparent, var(--warn) 18%, var(--warn) 82%, transparent); border-color: rgba(240, 181, 69, .38); }
.bon[data-stufe="alarm"] {
  --akzent: linear-gradient(90deg, transparent, var(--alarm) 14%, var(--alarm) 86%, transparent);
  border-color: rgba(238, 90, 82, .6);
  animation: bon-puls 2.8s ease-in-out infinite;
}
@keyframes bon-puls {
  0%, 100% { box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 0 0 0 rgba(238, 90, 82, 0), 0 20px 44px -30px rgba(0, 0, 0, .95); }
  50% { box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 0 0 3px rgba(238, 90, 82, .16), 0 0 38px -8px rgba(238, 90, 82, .42); }
}

.bon__kopf { flex: none; display: grid; grid-template-columns: auto 1fr; align-items: end; gap: .2rem 1rem; padding: 1.05rem 1.15rem .8rem 1.3rem; }
.bon__tisch { display: grid; gap: .3rem; }
.bon__tisch-label { font-size: .6rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--text-3); line-height: 1; }
.bon__tisch-nr { font-size: 3.5rem; font-weight: 600; color: var(--weiss); line-height: .86; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bon__warte { justify-self: end; display: grid; justify-items: end; gap: .3rem; }
.bon__warte-label { font-size: .6rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--text-3); line-height: 1; }
.bon__warte-zeit {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: 1.75rem; font-weight: 500; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums;
  transition: color 400ms var(--ease);
}
.bon__warte-zeit .icon { width: 1.1rem; height: 1.1rem; color: var(--text-3); transition: color 400ms var(--ease); }
.bon[data-stufe="warn"] .bon__warte-zeit, .bon[data-stufe="warn"] .bon__warte-zeit .icon { color: var(--warn); }
.bon[data-stufe="alarm"] .bon__warte-zeit, .bon[data-stufe="alarm"] .bon__warte-zeit .icon { color: #ff8e86; }
.bon__meta {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .55rem; margin-top: .55rem; padding-top: .65rem;
  border-top: 1px solid var(--linie); font-size: .82rem; color: var(--text-2); line-height: 1.3;
}
.bon__meta b { color: var(--gold-hell); font-weight: 600; }
.bon__meta-punkt { width: 3px; height: 3px; border-radius: 50%; background: var(--text-3); }

.bon__liste { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .15rem .55rem .5rem; display: flex; flex-direction: column; gap: .1rem; }
.bon__liste > * { flex: none; }
.bon__liste.ist-ueberlauf { -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 2.6rem), rgba(0, 0, 0, .15)); mask-image: linear-gradient(180deg, #000 calc(100% - 2.6rem), rgba(0, 0, 0, .15)); }
.bon__station {
  display: flex; align-items: center; gap: .5rem; padding: .7rem .7rem .3rem;
  font-size: .64rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold);
}
.bon__station .icon { width: 1rem; height: 1rem; }
.bon__station::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(201, 168, 106, .3), transparent); margin-left: .3rem; }
.bon__station:first-child { padding-top: .35rem; }

/* Position: ganze Zeile ist der Knopf */
.pos {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) 2.2rem; align-items: center; gap: .15rem .6rem;
  width: 100%; min-height: 56px; padding: .55rem .6rem .55rem .7rem; margin: 0;
  border: 0; border-radius: 14px; background: transparent; color: var(--weiss); text-align: left; cursor: pointer;
  transition: background-color 180ms var(--ease), transform 140ms var(--ease);
}
.pos:hover { background: rgba(255, 255, 255, .045); }
.pos:active { transform: scale(.985); background: rgba(255, 255, 255, .06); }
.pos:focus-visible { outline: 2px solid var(--ui-fokus); outline-offset: -2px; border-radius: 14px; }
.pos[disabled] { cursor: default; }
.pos[disabled]:hover, .pos[disabled]:active { background: transparent; transform: none; }
.pos__menge { font-size: 1.3rem; font-weight: 700; color: var(--gold-hell); font-variant-numeric: tabular-nums; line-height: 1.2; letter-spacing: -.01em; transition: color 300ms var(--ease); }
.pos__text { display: block; font-size: 1.16rem; font-weight: 500; line-height: 1.28; min-width: 0; overflow-wrap: anywhere; }
.pos__name {
  background: linear-gradient(var(--ok), var(--ok)) no-repeat 0 58% / 0% 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
  transition: background-size 320ms var(--ease), color 320ms var(--ease);
}
.pos__zusatz:empty { display: none; }
.pos__zusatz { display: block; margin-top: .15rem; font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--text-3); }
.pos__status {
  width: 2.1rem; height: 2.1rem; border-radius: 50%; justify-self: end; position: relative;
  border: 2px solid rgba(255, 255, 255, .26); display: grid; place-items: center; color: #06140c;
  transition: background-color 260ms var(--ease), border-color 260ms var(--ease), box-shadow 260ms var(--ease);
}
.pos__status .icon { width: 1.2rem; height: 1.2rem; --icon-strich: 2.8; transform: scale(0); opacity: 0; transition: transform 320ms var(--ease-feder), opacity 180ms var(--ease); }
.pos__status::after { content: ""; position: absolute; inset: 0; margin: auto; width: .6rem; height: .6rem; border-radius: 50%; background: var(--warn); transform: scale(0); transition: transform 260ms var(--ease-feder); }
.pos__notiz {
  grid-column: 2 / 4; display: flex; align-items: flex-start; gap: .5rem; margin-top: .35rem;
  padding: .45rem .7rem .45rem .6rem; border-radius: 10px;
  background: rgba(240, 181, 69, .12); box-shadow: inset 3px 0 0 var(--warn);
  color: #ffdca6; font-size: .95rem; font-weight: 600; line-height: 1.3;
}
.pos__notiz .icon { width: 1.05rem; height: 1.05rem; margin-top: .1rem; color: var(--warn); }

.pos[data-status="zubereitung"] .pos__status { border-color: var(--warn); box-shadow: 0 0 0 4px rgba(240, 181, 69, .12); }
.pos[data-status="zubereitung"] .pos__status::after { transform: scale(1); }
.pos[data-status="fertig"] .pos__status,
.pos[data-status="serviert"] .pos__status { background: var(--ok); border-color: var(--ok); box-shadow: 0 0 0 4px rgba(79, 207, 141, .14); }
.pos[data-status="serviert"] .pos__status { background: transparent; color: var(--ok); }
.pos[data-status="fertig"] .pos__status .icon,
.pos[data-status="serviert"] .pos__status .icon { transform: none; opacity: 1; }
.pos[data-status="fertig"] .pos__name,
.pos[data-status="serviert"] .pos__name { background-size: 100% 2px; color: var(--text-3); }
.pos[data-status="fertig"] .pos__menge,
.pos[data-status="serviert"] .pos__menge { color: var(--text-3); }
.pos[data-status="fertig"] .pos__notiz,
.pos[data-status="serviert"] .pos__notiz { opacity: .5; }
.pos[data-status="storniert"] .pos__name { background-image: linear-gradient(var(--alarm), var(--alarm)); background-size: 100% 2px; color: var(--text-3); }
.pos[data-status="storniert"] .pos__menge { color: var(--text-3); }
.pos[data-status="storniert"] .pos__status { border-style: dashed; border-color: rgba(238, 90, 82, .5); }
.pos[data-status="storniert"] .pos__zusatz { color: #ff9f98; }
.pos[data-status="serviert"] .pos__zusatz { color: #8fdcb3; }

.bon__fuss { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .7rem .8rem .8rem; margin-top: auto; border-top: 1px solid var(--linie); }
.bon__fuss .knopf { min-height: 3.35rem; font-size: 1rem; padding: 0 .9em; white-space: nowrap; }
.bon__laeuft {
  display: inline-flex; white-space: nowrap; padding: 0 .55em; align-items: center; justify-content: center; gap: .6rem; min-height: 3.35rem;
  border-radius: 999px; border: 1px dashed rgba(240, 181, 69, .45); color: #ffd48a; font-size: .84rem; font-weight: 600;
}
.bon__laeuft::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 4px rgba(240, 181, 69, .16); animation: kd-atmen 2.2s ease-in-out infinite; }
@keyframes kd-atmen { 50% { box-shadow: 0 0 0 7px rgba(240, 181, 69, 0); opacity: .75; } }

/* Zustaende der Karte */
.bon.ist-komplett .bon__fuss [data-aktion="fertig"] {
  grid-column: 1 / -1; opacity: 1; filter: none; cursor: default; transform: none;
  background: rgba(79, 207, 141, .14); border-color: rgba(79, 207, 141, .55); color: #a8f0c9; box-shadow: none; text-shadow: none;
}
.bon.ist-komplett .bon__fuss [data-aktion="beginnen"], .bon.ist-komplett .bon__fuss [data-laeuft] { display: none !important; }
.bon.ist-komplett { border-color: rgba(79, 207, 141, .55); animation: none; box-shadow: 0 0 0 3px rgba(79, 207, 141, .14), 0 0 36px -10px rgba(79, 207, 141, .45); }
.bon.ist-komplett::before { background: linear-gradient(90deg, transparent, var(--ok) 15%, var(--ok) 85%, transparent); }
/* Bon einer schon geschlossenen Sitzung (Tisch bezahlt und freigegeben): gestrichelt, Nummer leiser, kein Alarm-Puls,
   damit er in "Alle" nicht mit der neuen Sitzung am selben Tisch verwechselt wird */
.bon.ist-bezahlt { border-style: dashed; }
.bon.ist-bezahlt:not(.ist-komplett) { border-color: rgba(240, 181, 69, .5); }
.bon.ist-bezahlt .bon__tisch-nr { color: var(--text-2); }
.bon.ist-bezahlt[data-stufe="alarm"]:not(.ist-geht) { animation: none; }
.bon__bezahlt { grid-column: 1 / -1; margin-top: .55rem; display: flex; }
.bon__bezahlt .pille { font-size: .68rem; min-height: 1.9rem; padding-inline: .7rem .8rem; }
.erl__kopf { flex-wrap: wrap; row-gap: .2rem; }
.erl__bezahlt { font-size: .62rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: #ffd48a; border: 1px solid rgba(240, 181, 69, .45); border-radius: 999px; padding: .1rem .5rem; white-space: nowrap; align-self: center; }
.bon.ist-rein { animation: bon-rein 520ms var(--ease) both; }
.bon.ist-neu { animation: bon-rein 560ms var(--ease) both, bon-leuchten 3.2s var(--ease) 80ms both; }
.bon.ist-neu[data-stufe="alarm"] { animation: bon-rein 560ms var(--ease) both, bon-leuchten 3.2s var(--ease) 80ms both; }
.bon.ist-geht { animation: bon-raus 480ms var(--ease) var(--verzug, 0ms) forwards; pointer-events: none; }
@keyframes bon-rein { from { opacity: 0; transform: translateY(18px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes bon-leuchten {
  0% { box-shadow: 0 0 0 0 rgba(233, 213, 166, 0), 0 0 0 0 rgba(201, 168, 106, 0); border-color: rgba(233, 213, 166, .95); }
  18% { box-shadow: 0 0 0 3px rgba(233, 213, 166, .35), 0 0 44px -4px rgba(201, 168, 106, .6); border-color: rgba(233, 213, 166, .95); }
  100% { box-shadow: 0 0 0 0 rgba(233, 213, 166, 0), 0 20px 44px -30px rgba(0, 0, 0, .95); }
}
@keyframes bon-raus { to { opacity: 0; transform: translateY(-10px) scale(.95); } }

/* ---------- Leer-Zustand ---------- */
.kd-leer { min-height: min(60vh, 34rem); display: grid; place-content: center; justify-items: center; gap: .9rem; text-align: center; padding: 2rem; }
.kd-leer img { width: 5.5rem; height: 5.5rem; opacity: .55; margin-bottom: .6rem; }
.kd-leer__titel { font-size: 1.6rem; font-weight: 400; color: var(--weiss); }
.kd-leer__text { color: var(--text-3); font-size: .95rem; max-width: 34ch; }
.kd-leer.ist-rein { animation: bon-rein 600ms var(--ease) both; }

/* ---------- Erledigt-Spalte ---------- */
.kd-erledigt {
  min-width: 0; min-height: 0; overflow: hidden; display: flex; flex-direction: column;
  border-left: 1px solid var(--linie); background: linear-gradient(180deg, rgba(255, 255, 255, .02), rgba(255, 255, 255, 0) 40%);
  transition: opacity var(--ui-dauer) var(--ease), visibility 0s linear 0s;
}
.kd.ist-erledigt-zu .kd-erledigt { opacity: 0; visibility: hidden; border-left-color: transparent; transition: opacity var(--ui-dauer) var(--ease), visibility 0s linear var(--ui-dauer-lang); }
.kd-erledigt__kopf { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; padding: 1.35rem 1.4rem .7rem; min-width: var(--erledigt-breite); }
.kd-erledigt__titel { display: flex; align-items: center; gap: .55rem; font-size: 1rem; font-weight: 600; color: var(--weiss); }
.kd-erledigt__titel .icon { color: var(--ok); width: 1.2rem; height: 1.2rem; }
.kd-erledigt__liste { list-style: none; margin: 0; padding: .2rem 1rem 1.6rem; display: grid; gap: .55rem; align-content: start; overflow-y: auto; min-height: 0; min-width: var(--erledigt-breite); }
.erl {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .2rem .8rem;
  padding: .7rem .6rem .7rem 1rem; border-radius: 16px; background: var(--flaeche); border: 1px solid var(--linie);
}
.erl.ist-neu { animation: erl-rein 520ms var(--ease) both; }
@keyframes erl-rein { from { opacity: 0; transform: translateX(14px); } }
.erl__kopf { display: flex; align-items: baseline; gap: .6rem; min-width: 0; }
.erl__runde { font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--gold); white-space: nowrap; }
.erl__tisch { font-size: 1.05rem; font-weight: 600; color: var(--weiss); white-space: nowrap; }
.erl__zeit { font-size: .76rem; color: var(--text-3); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.erl__zeit { grid-column: 1; }
.erl__pos { grid-column: 1; font-size: .8rem; color: var(--text-2); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.erl__knopf { grid-column: 2; grid-row: 1 / span 3; }
.erl__knopf .icon { width: 1.15rem; height: 1.15rem; }
.kd-erledigt__leer { padding: 1.2rem 1.4rem; font-size: .85rem; color: var(--text-3); }

/* ---------- Rufe-Leiste ---------- */
.kd-rufe {
  position: relative; z-index: 4; flex: none; display: flex; align-items: center; gap: 1.2rem;
  min-height: 5.1rem; padding: .7rem var(--rand) calc(.7rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #0d1014, #08090b);
  box-shadow: 0 -18px 40px -28px rgba(0, 0, 0, .9);
}
.kd-rufe::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; background: var(--ui-gold-linie); opacity: .45; }
.kd-rufe__kopf { display: flex; align-items: center; gap: .6rem; flex: none; padding-right: 1.2rem; border-right: 1px solid var(--linie); min-height: 3rem; }
.kd-rufe__icon .icon, .kd-rufe__kopf > .icon { width: 1.35rem; height: 1.35rem; color: var(--gold); }
.kd-rufe__titel { font-size: .68rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--gold); }
.kd-rufe__zahl {
  min-width: 1.8rem; height: 1.8rem; padding: 0 .45rem; border-radius: 999px; display: inline-grid; place-items: center;
  background: rgba(255, 255, 255, .06); color: var(--text-3); font-size: .85rem; font-weight: 700;
}
.kd-rufe__zahl.ist-aktiv { background: var(--gold-verlauf); color: var(--ui-gold-text); }
.kd-rufe__liste { position: relative; list-style: none; margin: 0; padding: .25rem .1rem; display: flex; gap: .7rem; overflow-x: auto; flex: 1; min-width: 0; scrollbar-width: thin; }
/* Auslaufkanten: dort liegen weitere Rufe ausserhalb der Leiste */
.kd-rufe__liste.ist-mehr-rechts { -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), rgba(0, 0, 0, .12)); mask-image: linear-gradient(90deg, #000 calc(100% - 3.5rem), rgba(0, 0, 0, .12)); }
.kd-rufe__liste.ist-mehr-links { -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .12), #000 3.5rem); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .12), #000 3.5rem); }
.kd-rufe__liste.ist-mehr-links.ist-mehr-rechts { -webkit-mask-image: linear-gradient(90deg, rgba(0, 0, 0, .12), #000 3.5rem, #000 calc(100% - 3.5rem), rgba(0, 0, 0, .12)); mask-image: linear-gradient(90deg, rgba(0, 0, 0, .12), #000 3.5rem, #000 calc(100% - 3.5rem), rgba(0, 0, 0, .12)); }
.kd-rufe__leer { color: var(--text-3); font-size: .9rem; display: flex; align-items: center; gap: .5rem; }
.kd-rufe__leer .icon { color: var(--ok); opacity: .75; }

.ruf {
  flex: none; display: flex; align-items: center; gap: .75rem;
  padding: .3rem .3rem .3rem 1rem; border-radius: 999px; white-space: nowrap;
  border: 1px solid rgba(240, 181, 69, .45); background: rgba(240, 181, 69, .08);
}
.ruf--rechnung { border-color: rgba(201, 168, 106, .6); background: var(--gold-glanz); }
.ruf.ist-neu { animation: ruf-rein 520ms var(--ease) both, ruf-leuchten 2.6s var(--ease) 100ms both; }
.ruf.ist-geht { overflow: hidden; pointer-events: none; }
@keyframes ruf-rein { from { opacity: 0; transform: translateY(10px); } }
@keyframes ruf-leuchten { 20% { box-shadow: 0 0 0 3px rgba(240, 181, 69, .25), 0 0 26px -4px rgba(240, 181, 69, .55); } 100% { box-shadow: none; } }
.ruf__icon { width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center; background: rgba(240, 181, 69, .16); color: var(--warn); flex: none; }
.ruf--rechnung .ruf__icon { background: rgba(201, 168, 106, .2); color: var(--gold-hell); }
.ruf__icon .icon { width: 1.15rem; height: 1.15rem; }
.ruf__text { display: grid; gap: .1rem; line-height: 1.15; }
.ruf__tisch { font-size: 1.05rem; font-weight: 700; color: var(--weiss); }
.ruf__grund { font-size: .78rem; color: var(--text-2); }
.ruf__grund .ruf__seit { color: var(--text-3); font-variant-numeric: tabular-nums; }
.ruf .knopf { min-height: 48px; padding: 0 1.1em; font-size: .9rem; }

/* ---------- Ueberlagerung (Start, gesperrt, Fehler) ---------- */
.kd-schicht {
  position: fixed; inset: 0; z-index: 800; display: grid; place-items: center; padding: 24px;
  background: rgba(5, 6, 8, .68); -webkit-backdrop-filter: blur(12px) saturate(.9); backdrop-filter: blur(12px) saturate(.9);
  opacity: 0; transition: opacity 420ms var(--ease);
}
.kd-schicht.ist-offen { opacity: 1; }
.kd-schicht:not(.ist-offen) { pointer-events: none; } /* beim Ausblenden keine Klicks mehr abfangen */
.kd-schicht__karte {
  width: min(34rem, 100%); text-align: center; padding: 2.8rem 2.6rem 2.3rem; position: relative; overflow: hidden;
  border-radius: 32px; border: 1px solid rgba(201, 168, 106, .3);
  background: radial-gradient(120% 70% at 50% 0%, #181c22, #0b0d10 72%);
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .03) inset;
  transform: translateY(10px) scale(.98); transition: transform 520ms var(--ease);
}
.kd-schicht.ist-offen .kd-schicht__karte { transform: none; }
.kd-schicht__karte::before { content: ""; position: absolute; left: 40px; right: 40px; top: 0; height: 1px; background: var(--ui-gold-linie); }
.kd-schicht__zeichen { width: 6rem; height: 6rem; margin: 0 auto 1.3rem; }
.kd-schicht__label { display: block; margin-bottom: .7rem; }
.kd-schicht__titel { font-size: 2.1rem; font-weight: 400; color: var(--weiss); line-height: 1.15; letter-spacing: .005em; }
.kd-schicht__text { margin: .9rem auto 0; max-width: 30ch; color: var(--text-2); font-size: 1rem; line-height: 1.5; }
.kd-schicht__knoepfe { margin-top: 1.9rem; display: grid; gap: .7rem; justify-items: center; }
.kd-schicht__knoepfe .knopf--riesig { min-width: 17rem; }
.kd-schicht__hinweis { margin-top: 1.4rem; display: flex; align-items: center; justify-content: center; gap: 1.2rem; flex-wrap: wrap; color: var(--text-3); font-size: .78rem; }
.kd-schicht__hinweis span { display: inline-flex; align-items: center; gap: .4rem; }
.kd-schicht__hinweis .icon { width: 1rem; height: 1rem; color: var(--gold); }
.kd-schicht__fuss { margin-top: 1.8rem; display: flex; justify-content: center; }

/* ---------- Toast (oben in der Kopfzeile, Lage setzt kueche.js) ---------- */
.kd-zahlen { transition: opacity var(--ui-dauer) var(--ease); }
.kd.ist-meldung-oben .kd-zahlen { opacity: 0; }
.kd-toast-leiste .toast { transform: translateY(-14px) scale(.98); }
.kd-toast-leiste .toast.ist-offen { transform: none; }
.kd-toast { padding: 6px 6px 6px 16px; }
.kd-toast__text { flex: 1; }
.kd-toast .knopf { min-height: 48px; padding: 0 1.15em; flex: none; }

.kd-noscript { padding: 2rem; color: var(--text); }

/* ---------- Breiten ---------- */
@media (max-height: 860px) {
  .kd-kopf__zeile--oben { min-height: 4.1rem; padding-top: .5rem; padding-bottom: .25rem; }
  .kd-kopf__zeile--reiter { padding-bottom: .7rem; }
  .kd-brett { padding-top: 1rem; padding-bottom: 1.2rem; }
  .bon__kopf { padding-top: .85rem; padding-bottom: .6rem; }
  .bon__tisch-nr { font-size: 3.05rem; }
  .bon__meta { margin-top: .4rem; padding-top: .5rem; }
  .pos { min-height: 50px; padding-block: .4rem; }
  .bon__fuss { padding-block: .6rem .65rem; }
  .kd-rufe { min-height: 4.6rem; padding-block: .55rem; }
}
@media (max-width: 1360px) {
  .kd { --rand: 1.25rem; --erledigt-breite: 19rem; }
  .kd-zahl { padding-inline: 1.1rem; }
  .kd-zahlen { margin-left: .8rem; }
}
@media (max-width: 1180px) {
  .kd-kopf__zeile--oben { flex-wrap: wrap; row-gap: .4rem; }
  .kd-zahlen { order: 3; margin: 0; width: 100%; }
  .kd-zahl:first-child { border-left: 0; padding-left: 0; }
  .kd-werkzeug { margin-left: auto; }
  .kd-reiter__knopf { padding-inline: .9rem; }
}
@media (max-width: 900px) {
  .kd-absender { display: none; }
  .kd-mitte, .kd.ist-erledigt-zu .kd-mitte { grid-template-columns: minmax(0, 1fr); }
  .kd-erledigt { display: none; }
  .kd-erledigt-schalter { display: none; }
}
