/* ============================================================================
   KassenFlow – Table Selection Styles (Tischauswahl + Numpad)
   ============================================================================ */

/* ── Override: Wenn Tischauswahl im productGrid aktiv ist ── */
.product-grid:has(.ts-layout) {
  display: block;
  padding: 8px 16px;
}

/* ── Layout: Grid + Numpad Side-by-Side ── */
.ts-layout {
  display: grid;
  /* Numpad-Breite skalierbar (Anzeige-Einstellung/KI: „Nummernfeld kleiner") */
  grid-template-columns: 1fr calc(240px * var(--kf-numpad-scale, 1) * var(--kf-numpad-width-scale, 1));
  gap: 16px;
  height: 100%;
  padding: 8px 0;
}

@media (max-width: 768px) {
  .ts-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 1fr auto;
  }
}

/* Nummernfeld ausgeblendet (Anzeige-Einstellung/KI: set_numpad_visible):
   Tisch-Grid bekommt die volle Breite. */
.kf-no-numpad .ts-numpad-panel { display: none; }
.kf-no-numpad .ts-layout { grid-template-columns: 1fr; }

/* ── Header ── */
.ts-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ts-header__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary, #e0e6ff);
  white-space: nowrap;
}

.ts-header__counter-btn {
  margin-left: auto;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.ts-header__counter-btn:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.ts-header__counter-btn:active {
  transform: scale(0.97);
}

/* ── Tisch-Grid ── */
.ts-grid {
  display: grid;
  /* --kf-table-size-scale wird über Einstellungen → Ansicht gesetzt (Standard 1) */
  grid-template-columns: repeat(auto-fill, minmax(calc(130px * var(--kf-table-size-scale, 1)), 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
  align-content: start;
}

.ts-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  gap: 8px;
}

.ts-empty__icon {
  font-size: 3rem;
  opacity: 0.4;
}

.ts-empty__text {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-secondary, #8b93b0);
}

.ts-empty__sub {
  font-size: max(0.8rem, 12px);
  color: var(--text-tertiary, #5a617a);
}

.ts-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-secondary, #8b93b0);
  font-size: 0.9rem;
}

/* ── Tisch-Kachel ── */
.ts-table {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 8px;
  border: 2px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 90px;
  font-family: inherit;
}

.ts-table:hover {
  border-color: rgba(108, 92, 231, 0.5);
  background: rgba(108, 92, 231, 0.08);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.ts-table:active {
  transform: translateY(0);
}

.ts-table__number {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1;
}

.ts-table__status {
  font-size: max(0.72rem, 12px);
  font-weight: 500;
  opacity: 0.85;
  white-space: nowrap;
}

/* ── Status-Punkt (frei/besetzt/da) ──────────────────────────────────────────
   BEWUSST CSS statt Emoji (🟢/🔵/🟣): Der Tisch-Status ist FUNKTIONALE Anzeige,
   kein Schmuck. Emoji haengen an der Schrift des GERAETS – auf dem Sunmi V2 Pro
   (Android 7.1, Unicode 9) wurden 🟢/🔵/🟣 zu leeren Kaestchen, sobald die
   Play-Dienste fehlten (die liefern die neuere Emoji-Schrift nach; 🟢 ist
   Emoji 12.0 von 2019). Der Tischplan war damit unlesbar. Ein CSS-Punkt kann
   nicht fehlen, folgt dem Theme und braucht keine Schrift.
   Die Farbe kommt aus der ohnehin vorhandenen Zustands-Klasse am Button. */
.ts-table__dot {
  display: inline-block;
  width: 0.6em;
  height: 0.6em;
  border-radius: 50%;
  margin-right: 0.35em;
  vertical-align: baseline;
  background: #4ade80;              /* Default = frei */
}

.ts-table--occupied .ts-table__dot { background: #60a5fa; }
.ts-table--arrived  .ts-table__dot { background: #c084fc; }
/* Split-Ziel-Kacheln tragen eine EIGENE Zustands-Klasse (nicht ts-table--*). */
.split-target-btn--occupied .ts-table__dot { background: #60a5fa; }

.ts-table__duration {
  font-size: max(0.65rem, 12px);
  opacity: 0.5;
}

/* MANAGERALARM-2: Markierung „Storno offen“ (Fall „Storno ohne Neubezahlung“) am Tisch */
.ts-table__manager {
  font-size: max(0.65rem, 12px);
  font-weight: 700;
  color: #fbbf24;
}

.ts-table__name {
  font-size: max(0.65rem, 12px);
  opacity: 0.5;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Tisch: Frei ── */
.ts-table--free {
  border-color: rgba(34, 197, 94, 0.25);
  background: rgba(34, 197, 94, 0.06);
}

.ts-table--free:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.12);
}

.ts-table--free .ts-table__number {
  color: #4ade80;
}

/* ── Tisch: Besetzt ── */
.ts-table--occupied {
  border-color: rgba(59, 130, 246, 0.35);
  background: rgba(59, 130, 246, 0.08);
}

.ts-table--occupied:hover {
  border-color: rgba(59, 130, 246, 0.6);
  background: rgba(59, 130, 246, 0.15);
}

.ts-table--occupied .ts-table__number {
  color: #60a5fa;
}

.ts-table--occupied .ts-table__status {
  color: #93c5fd;
  font-weight: 600;
}

/* ── Tisch: Reserviert / Da ── */
.ts-table--arrived {
  border-color: rgba(168, 85, 247, 0.35);
  background: rgba(168, 85, 247, 0.08);
}

.ts-table--arrived:hover {
  border-color: rgba(168, 85, 247, 0.6);
  background: rgba(168, 85, 247, 0.15);
}

.ts-table--arrived .ts-table__number {
  color: #c084fc;
}

.ts-table--arrived .ts-table__status {
  color: #d8b4fe;
  font-weight: 600;
}

/* ── Numpad Panel ── */
.ts-numpad-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px;
}

.ts-numpad-display {
  text-align: center;
  font-size: calc(2.4rem * var(--kf-numpad-scale, 1));
  font-weight: 800;
  color: var(--text-primary, #e0e6ff);
  padding: 12px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
}

.ts-numpad-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.ts-numpad-key {
  min-height: 44px; /* GESTALT-39: Mindest-Tippfläche (Ziffernblock am V3 unter 44 px) */
  padding: calc(18px * var(--kf-numpad-scale, 1)) 8px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-primary, #e0e6ff);
  font-size: calc(1.3rem * var(--kf-numpad-scale, 1));
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.ts-numpad-key:hover {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(1.04);
}

.ts-numpad-key:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.2);
}

.ts-numpad-key--clear {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.ts-numpad-key--clear:hover {
  background: rgba(239, 68, 68, 0.25);
}

.ts-numpad-key--confirm {
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: white;
  font-size: 1.5rem;
}

.ts-numpad-key--confirm:hover {
  background: linear-gradient(135deg, #4ade80, #22c55e);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.4);
}

/* ── Order Header (Bestellmodus) ── */
.ts-order-header {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.ts-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 14px;
  min-height: 44px; /* WZ-875: Mindest-Tippfläche */
  /* Vorher rgba(255,255,255,…) für Rahmen+Fläche → im Sonnenmodus (weißer
     Hintergrund) UNSICHTBAR, der Knopf sah aus wie bloßer Text (Betreiber-Foto
     18.07.2026 „Tische hat keinen richtigen Button"). Jetzt Akzent-Kontur, die
     in BEIDEN Themes klar als Knopf lesbar ist. */
  border: 1px solid var(--accent, #6c5ce7);
  border-radius: 8px;
  background: var(--accent-glow, rgba(108, 92, 231, 0.12));
  color: var(--accent, #6c5ce7);
  font-size: max(0.85rem, 12px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.ts-back-btn:hover,
.ts-back-btn:active {
  background: var(--accent, #6c5ce7);
  color: #fff;
}

.ts-order-table {
  font-size: 1.1rem;
  font-weight: 700;
  color: #a29bfe;
}

.ts-order-info {
  font-size: max(0.8rem, 12px);
  color: var(--text-secondary, #8b93b0);
  margin-left: auto;
}

/* ── Parteien-Tabs ── */
.party-tabs {
  display: flex;
  gap: 4px;
  padding: 6px 12px;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex-shrink: 0;
}

.party-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  font-family: inherit;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.party-tab__label {
  font-weight: 700;
}

.party-tab__badge {
  font-size: max(0.7rem, 12px);
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted, #64748b);
}

.party-tab--active .party-tab__badge {
  background: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.9);
}

.party-tab:hover {
  background: rgba(108, 92, 231, 0.1);
  border-color: rgba(108, 92, 231, 0.3);
}

.party-tab--active {
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  border-color: transparent;
}

.party-tab--paid {
  opacity: 0.4;
  pointer-events: none;
}

.party-tab--paid .party-tab__label {
  text-decoration: line-through;
}

.party-tab--add {
  border-style: dashed;
  color: #6C5CE7;
}

.party-tab--add:hover {
  background: rgba(108, 92, 231, 0.12);
}

/* ── Cart-Actions: Flexbox-Wrap für 4 Buttons ── */
.cart-actions {
  flex-wrap: wrap;
}

/* ── Park Button ── */
.cart-btn--park {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #F59E0B, #d97706);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.cart-btn--park svg {
  width: 18px;
  height: 18px;
}

.cart-btn--park:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.cart-btn--park:active {
  transform: scale(0.97);
}

/* ── Park Button: Disabled (nichts zu parken) ── */
.cart-btn--park:disabled,
.cart-btn--park[disabled] {
  background: linear-gradient(135deg, #4b5563, #374151);
  color: rgba(255, 255, 255, 0.5);
  cursor: not-allowed;
  opacity: 0.7;
}

.cart-btn--park:disabled:hover,
.cart-btn--park[disabled]:hover {
  transform: none;
  box-shadow: none;
}

.cart-btn--park:disabled:active,
.cart-btn--park[disabled]:active {
  transform: none;
}

/* ── Alles kassieren Button ── */
.cart-btn--pay-all {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #059669, #10b981);
  color: white;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 4px;
}

.cart-btn--pay-all svg {
  width: 18px;
  height: 18px;
}

.cart-btn--pay-all:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* ── Storno Dialog (GoBD-konform) ── */
.storno-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

/* POSZEILE-V3: Pulsieren des Markiermodus-Knopfs (nur Schatten, keine Größenänderung — das Raster bleibt ruhig).
   PULSROT-1 (Betreiber 05.11.2026): ROT statt Grün — „einfach nur die farbe die pulsiert von grün zu rot, das ist auffälliger". */
@keyframes kf-ah-puls {
  0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.8); }
  50% { box-shadow: 0 0 0 7px rgba(220, 38, 38, 0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.storno-dialog {
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: 16px;
  padding: 24px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.storno-dialog__header h3 {
  margin: 0 0 4px;
  font-size: 1.1rem;
  color: #f87171;
}

.storno-dialog__sub {
  font-size: max(0.75rem, 12px);
  color: var(--text-tertiary, #5a617a);
}

.storno-dialog__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  margin: 14px 0 0;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: 10px;
  color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem;
}

.storno-dialog__remaining {
  padding: 6px 14px;
  margin: 6px 0 14px;
  background: rgba(59, 130, 246, 0.06);
  border: 1px solid rgba(59, 130, 246, 0.15);
  border-radius: 8px;
  color: var(--text-secondary, #8b93b0);
  font-size: max(0.78rem, 12px);
  text-align: center;
}

.storno-dialog__reasons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.storno-reason-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: max(0.8rem, 12px);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  text-align: left;
}

.storno-reason-btn:hover {
  border-color: rgba(239, 68, 68, 0.3);
  background: rgba(239, 68, 68, 0.08);
  color: var(--text-primary, #e0e6ff);
}

.storno-reason-btn.active {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.storno-reason-icon {
  font-size: 1rem;
}

.storno-dialog__custom {
  margin-bottom: 14px;
}

.storno-dialog__custom input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary, #e0e6ff);
  font-size: max(0.85rem, 12px);
  font-family: inherit;
  outline: none;
  box-sizing: border-box;
}

.storno-dialog__custom input:focus {
  border-color: rgba(239, 68, 68, 0.5);
}

.storno-dialog__actions {
  display: flex;
  gap: 10px;
}

.storno-btn-cancel {
  flex: 1;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary, #8b93b0);
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.storno-btn-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.storno-btn-confirm {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
  font-size: max(0.85rem, 12px);
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.storno-btn-confirm:hover:not(:disabled) {
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
  transform: scale(1.02);
}

.storno-btn-confirm:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ══════════════════════════════════════════════════════════════════ */
/* Split-Button (auf Cart-Items)                                     */
/* ══════════════════════════════════════════════════════════════════ */

.split-btn {
  width: 28px;
  height: 28px;
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 6px;
  background: rgba(108, 92, 231, 0.08);
  color: #a29bfe;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.split-btn:hover {
  background: rgba(108, 92, 231, 0.2);
  border-color: rgba(108, 92, 231, 0.5);
  transform: scale(1.1);
}

/* ══════════════════════════════════════════════════════════════════ */
/* Split-Dialog (Overlay)                                            */
/* ══════════════════════════════════════════════════════════════════ */

.split-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.2s ease;
}

.split-dialog {
  background: var(--bg-secondary, #1a1d2e);
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 16px;
  padding: 20px;
  width: 440px;
  max-width: 92vw;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.split-dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.split-dialog__header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: #a29bfe;
}

.split-dialog__close {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}

.split-dialog__close:hover {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}

.split-dialog__item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: rgba(108, 92, 231, 0.08);
  border: 1px solid rgba(108, 92, 231, 0.2);
  border-radius: 10px;
  color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* ── Qty Controls ── */
.split-dialog__qty {
  margin-bottom: 14px;
}

.split-dialog__qty label {
  display: block;
  font-size: max(0.8rem, 12px);
  color: var(--text-secondary, #8b93b0);
  margin-bottom: 6px;
}

.split-dialog__qty-controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.split-qty-btn {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary, #e0e6ff);
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-qty-btn:hover:not(:disabled) {
  background: rgba(108, 92, 231, 0.15);
  border-color: rgba(108, 92, 231, 0.4);
}

.split-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.split-qty-value {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary, #e0e6ff);
  min-width: 30px;
  text-align: center;
}

.split-qty-max {
  font-size: max(0.8rem, 12px);
  color: var(--text-tertiary, #5a617a);
}

/* ── Sections ── */
.split-dialog__section {
  margin-bottom: 14px;
}

.split-dialog__section h4 {
  margin: 0 0 8px;
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  color: var(--text-secondary, #8b93b0);
}

.split-dialog__targets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.split-dialog__tables {
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  max-height: 160px;
  overflow-y: auto;
}

/* ── Numpad im Split-Dialog ── */
.split-dialog__numpad-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.split-numpad-input {
  width: 80px;
  height: 100%;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid rgba(108, 92, 231, 0.3);
  border-radius: 10px;
  background: rgba(108, 92, 231, 0.06);
  color: var(--text-primary, #e0e6ff);
  font-size: 1.3rem;
  font-weight: 800;
  text-align: center;
  font-family: inherit;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.split-numpad-input::placeholder {
  color: var(--text-tertiary, #5a617a);
  font-weight: 500;
  font-size: max(0.85rem, 12px);
}

.split-numpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex: 1;
}

.split-numpad-key {
  padding: 6px;
  min-height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.1s ease;
  font-family: inherit;
  touch-action: manipulation;
}

.split-numpad-key:hover {
  background: rgba(255, 255, 255, 0.1);
}

.split-numpad-key:active {
  transform: scale(0.95);
}

.split-numpad-key--clear {
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.2);
}

.split-numpad-key--go {
  background: linear-gradient(135deg, #6C5CE7, #a29bfe);
  color: white;
  border-color: transparent;
  font-size: 1rem;
}

.split-numpad-key--go:hover {
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.4);
}

.split-target-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 12px 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-primary, #e0e6ff);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  touch-action: manipulation;
}

.split-target-btn:hover {
  border-color: rgba(108, 92, 231, 0.5);
  background: rgba(108, 92, 231, 0.12);
  transform: translateY(-1px);
}

.split-target-btn:active {
  transform: translateY(0);
}

.split-target__label {
  font-size: 0.9rem;
  font-weight: 700;
}

.split-target__info {
  font-size: max(0.7rem, 12px);
  color: var(--text-tertiary, #5a617a);
}

.split-target-btn--occupied {
  border-color: rgba(59, 130, 246, 0.25);
  background: rgba(59, 130, 246, 0.06);
}

.split-target-btn--occupied:hover {
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(59, 130, 246, 0.12);
}

.split-target-btn--new {
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.07);
  border-style: dashed;
}

.split-target-btn--new:hover {
  border-color: rgba(34, 197, 94, 0.6);
  background: rgba(34, 197, 94, 0.14);
}

.split-dialog__cancel {
  width: 100%;
  padding: 12px;
  margin-top: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary, #8b93b0);
  font-size: max(0.85rem, 12px);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.split-dialog__cancel:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* ══════════════════════════════════════════════════════════════════ */
/* SMARTPHONE: Tischauswahl-Verhältnisse an das Display anpassen       */
/* ----------------------------------------------------------------- */
/* MUSS am Dateiende stehen: die Basisregeln (.ts-grid, .ts-table,    */
/* .ts-numpad-*) stehen weiter oben; bei gleicher Spezifität gewinnt   */
/* die SPÄTERE Regel. Sonst überschreibt die Basis diese Overrides.   */
/* Problem ohne das: der große Numpad frisst fast die ganze Höhe und   */
/* drückt das Tisch-Grid zu einem 37px-Streifen → "Warenkorb überdeckt */
/* die Tische". Hier: Tische = Hauptbereich (scrollbar), Numpad kompakt.*/
/* ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ts-layout {
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 10px;
    min-height: 0;
    height: 100%;
  }

  .ts-grid {
    min-height: 0; /* erlaubt echtes Schrumpfen → eigenes Scrollen statt Überlauf */
    grid-template-columns: repeat(auto-fill, minmax(calc(96px * var(--kf-table-size-scale, 1)), 1fr));
    gap: 8px;
  }

  .ts-table {
    min-height: 72px;
    padding: 10px 6px;
  }

  .ts-table__number {
    font-size: 1.3rem;
  }

  /* Numpad deutlich kompakter – damit die Tische die Mehrheit der Höhe bekommen. */
  .ts-numpad-panel {
    padding: 8px;
    gap: 6px;
  }

  .ts-numpad-display {
    font-size: 1.5rem;
    min-height: 40px;
    padding: 6px;
  }

  .ts-numpad-grid {
    gap: 6px;
  }

  .ts-numpad-key {
    padding: 11px 6px;
    font-size: 1.05rem;
  }

  .ts-numpad-key--confirm {
    font-size: 1.2rem;
  }
}

/* Kurze Displays (kleine/ältere Smartphones, Landscape): Numpad NOCH kompakter,
   damit das Tisch-Grid auch bei wenig Höhe nutzbar bleibt statt zum Streifen zu
   schrumpfen. Greift zusätzlich zur Breiten-Regel oben. */
@media (max-width: 768px) and (max-height: 720px) {
  .ts-numpad-panel {
    padding: 6px;
    gap: 4px;
  }

  .ts-numpad-display {
    font-size: 1.15rem;
    min-height: 28px;
    padding: 4px;
  }

  .ts-numpad-grid {
    gap: 4px;
  }

  .ts-numpad-key {
    padding: 6px 5px;
    font-size: 0.9rem;
  }

  .ts-numpad-key--confirm {
    font-size: 1rem;
  }
}

/* ============================================================================
   STAMMGÄSTE (benennbare „Tische") – Sektion unter dem Tisch-Grid + Umschalter
   ============================================================================ */

/* Linke Spalte: Tische oben, Stammgäste unten. Auf großen Screens beide sichtbar. */
.ts-left-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.ts-left-col .ts-grid { flex: 1 1 auto; min-height: 0; }

.ts-regulars {
  flex: 0 0 auto;
  max-height: 38%;
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-top: 1px solid var(--glass-border, rgba(255, 255, 255, 0.1));
  padding-top: 8px;
}
.ts-regulars__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  flex-shrink: 0;
}
.ts-regulars__title { font-size: 0.95rem; font-weight: 700; color: var(--text-primary, #e0e6ff); }
.ts-add-regular {
  padding: 6px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: var(--glass, rgba(255, 255, 255, 0.06));
  color: var(--text-primary, #e0e6ff);
  font-size: max(0.82rem, 12px);
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ts-add-regular:hover { background: rgba(255, 255, 255, 0.12); }
.ts-regulars-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(calc(130px * var(--kf-table-size-scale, 1)), 1fr));
  gap: 10px;
  overflow-y: auto;
  padding: 4px;
  align-content: start;
}
.ts-regulars__empty {
  grid-column: 1 / -1;
  color: var(--text-muted, #8a90b8);
  font-size: max(0.85rem, 12px);
  padding: 12px;
  text-align: center;
}
/* Stammgast-Kachel erbt die .ts-table-Optik, mit leichtem Stern-Akzent. */
.ts-table.ts-regular {
  background: linear-gradient(135deg, rgba(255, 193, 7, 0.06), rgba(108, 92, 231, 0.05));
}

/* Ansicht-Umschalter im Header. Seit dem Kompakt-Layout (17.07.2026) ist er
   die EINZIGE Tisch-Navigation (kein Titel, kein separater Theken-Button) und
   daher IMMER sichtbar – die Icon-Variante spart Platz auf kleinen Displays. */
.ts-view-toggle { display: flex; gap: 6px; }
.ts-header--compact { justify-content: center; }
.ts-view-btn {
  padding: 6px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15));
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #a9b0d6);
  font-size: max(0.82rem, 12px);
  font-weight: 600;
  cursor: pointer;
}
.ts-view-btn--active { background: var(--accent, #6C5CE7); color: #fff; border-color: var(--accent, #6C5CE7); }

/* Icon-Umschalter: größere, gleich breite Touch-Ziele (Emoji als Label). */
.ts-view-toggle--icons { gap: 8px; }
.ts-view-toggle--icons .ts-view-btn {
  font-size: 1.35rem;
  line-height: 1;
  padding: 8px 0;
  min-width: 56px;
  min-height: 44px; /* WZ-875: Mindest-Tippfläche auf jeder Größe */
  text-align: center;
}
/* Thekenverkauf-Kachel (Barhocker) dezent abgesetzt – sie WECHSELT den Modus,
   ist kein reiner Ansichts-Umschalter wie Tische/Stammgäste. */
.ts-view-btn--counter { border-color: rgba(108, 92, 231, 0.55); }
.ts-view-btn--counter:active { transform: scale(0.95); }

/* ── Der ⭐-Umschalter wirkt auf JEDER Bildschirmgröße (Betreiber-Fund
   20.08.2026, Foto vom Laptop: „die Stammgast-Seite schaut exakt genauso aus
   wie die normale Tische-Seite") ──────────────────────────────────────────
   Diese drei Regeln standen bis dahin AUSSCHLIESSLICH in
   @media (max-width: 768px). Der Umschalter ist aber laut Kommentar oben
   bewusst IMMER sichtbar — auf dem Laptop setzte der Klick also nur die
   Klasse, ohne dass sich etwas änderte: Tische und Numpad blieben stehen,
   die Stammgast-Liste klebte unten dran. Ein sichtbares Bedienelement, das
   nichts tut, ist schlimmer als keines: der Bediener glaubt, die Ansicht
   sei leer.
   Der Zweck der ⭐-Ansicht ist, die Stammgäste GROSS und allein zu zeigen —
   deshalb weichen Tisch-Raster UND Numpad (namensbasiert, der Nummernblock
   ist dort nutzlos und kostet nur Höhe). */
.ts-layout:not(.ts-show-regulars) .ts-regulars { display: none; }
.ts-layout.ts-show-regulars .ts-grid,
.ts-layout.ts-show-regulars .ts-numpad-panel { display: none; }
.ts-layout.ts-show-regulars .ts-regulars {
  max-height: none;
  flex: 1 1 auto;
  border-top: none;
  padding-top: 0;
}

@media (max-width: 768px) {
  .ts-header { flex-wrap: wrap; }
}

/* ── Stammgast-Anlege-Modal (Namens-Vorauswahl / Autocomplete + ✕ zum Löschen) ── */
.ts-reg-modal {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 10050; padding: 16px;
}
.ts-reg-box {
  width: 100%; max-width: 420px; max-height: 80vh;
  display: flex; flex-direction: column;
  background: var(--bg-secondary, #1a1f3a);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12));
  border-radius: 14px; padding: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}
.ts-reg-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 1.05rem; font-weight: 700; color: var(--text-primary, #e0e6ff); margin-bottom: 12px;
}
.ts-reg-close {
  border: none; background: transparent; color: var(--text-muted, #8a90b8);
  font-size: 1.1rem; cursor: pointer; padding: 4px 8px; border-radius: 6px;
}
.ts-reg-close:hover { background: rgba(255, 255, 255, 0.08); color: var(--text-primary, #e0e6ff); }
.ts-reg-input {
  width: 100%; box-sizing: border-box; padding: 12px 14px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15)); border-radius: 10px;
  background: var(--bg-primary, #12162e); color: var(--text-primary, #e0e6ff);
  font-size: 1rem; outline: none;
}
.ts-reg-input:focus { border-color: var(--accent, #6C5CE7); box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.25); }
.ts-reg-list { margin-top: 10px; overflow-y: auto; flex: 1 1 auto; min-height: 40px; }
.ts-reg-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ts-reg-name {
  flex: 1; text-align: left; padding: 10px 12px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12)); border-radius: 8px;
  background: var(--bg-card, rgba(255, 255, 255, 0.04)); color: var(--text-primary, #e0e6ff);
  font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.ts-reg-name:hover { background: var(--accent, #6C5CE7); color: #fff; border-color: var(--accent, #6C5CE7); }
.ts-reg-del {
  flex-shrink: 0; width: 38px; height: 38px;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.12)); border-radius: 8px;
  background: transparent; color: var(--text-muted, #8a90b8); font-size: 0.95rem; cursor: pointer;
}
.ts-reg-del:hover { background: rgba(239, 68, 68, 0.18); color: #ef4444; border-color: rgba(239, 68, 68, 0.35); }
.ts-reg-empty { color: var(--text-muted, #8a90b8); font-size: max(0.85rem, 12px); padding: 14px 4px; text-align: center; }
.ts-reg-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 12px; }
.ts-reg-btn {
  padding: 10px 18px; border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.15)); border-radius: 8px;
  background: var(--glass, rgba(255, 255, 255, 0.06)); color: var(--text-primary, #e0e6ff);
  font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.ts-reg-btn--primary { background: var(--accent, #6C5CE7); border-color: var(--accent, #6C5CE7); color: #fff; }
.ts-reg-btn--danger { background: var(--danger, #e05555); border-color: var(--danger, #e05555); color: #fff; }
.ts-reg-btn:hover { filter: brightness(1.1); }

/* ── Bestätigungs-Dialog (tsConfirm) – nutzt die ts-reg-Modal-Optik ── */
.ts-confirm-box { max-width: 360px; }
.ts-confirm-msg { font-size: 0.98rem; line-height: 1.45; color: var(--text-primary, #e0e6ff); }

/* ── Stammgast-Kachel mit „−"-Entfernen-Knopf ──
   Wrapper füllt die Grid-Zelle; die Kachel bleibt der große Öffnen-Bereich,
   das „−" liegt als eigener Knopf oben rechts (ein <button> darf kein <button>
   enthalten → deshalb der Wrapper). */
.ts-regular-wrap { position: relative; display: flex; }
.ts-regular-wrap > .ts-table { flex: 1 1 auto; width: 100%; }
.ts-regular-remove {
  position: absolute; top: 5px; right: 5px;
  width: 30px; height: 30px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
  background: rgba(18, 22, 46, 0.78);
  color: var(--text-secondary, #cfd3ee);
  font-size: 22px; font-weight: 700; line-height: 1; cursor: pointer;
  z-index: 2; -webkit-tap-highlight-color: transparent;
}
.ts-regular-remove:hover { background: var(--danger, #e05555); border-color: var(--danger, #e05555); color: #fff; }
.ts-regular-remove:active { transform: scale(0.9); }
/* Boniert = optisch gesperrt (bleibt klickbar → erklärender Toast statt still). */
.ts-regular-remove--locked { opacity: 0.4; }
.ts-regular-remove--locked:hover {
  background: rgba(18, 22, 46, 0.78);
  border-color: var(--glass-border, rgba(255, 255, 255, 0.2));
  color: var(--text-secondary, #cfd3ee);
  cursor: not-allowed;
}

/* HELL-MODUS (Sonnenmodus) – Tisch-Kacheln sichtbar (Pilot-Fund 2026-07-14).
   .ts-table ist für DUNKLEN Grund gebaut (background/border = rgba(255,255,255,…))
   → im Hell-Modus unsichtbar (nur Nummer/Icon „schweben"). Gleiche Fehlerklasse
   wie die schwarzen Felder: für Dunkel verdrahtete Farben ignorieren den Hell-Modus. */
html.kf-light .ts-table {
  background: #ffffff;
  border-color: rgba(15, 23, 42, 0.14);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.10);
}
html.kf-light .ts-table:hover {
  background: #f1f5f9;
  border-color: rgba(108, 92, 231, 0.55);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.14);
}
/* Kachel-TEXT im Hell-Modus lesbar machen (Betreiber-Fund Sunmi 22.07.2026):
   die Basis-Textfarbe ist #e0e6ff (für Dunkel) und die Sekundärtexte nutzen
   opacity auf hellem Text → auf Weiß UNSICHTBAR. Echte dunkle Farben statt
   opacity, und kräftigere Zustandsfarben (die Pastelltöne #4ade80/#60a5fa/
   #c084fc sind auf Weiß zu blass). */
html.kf-light .ts-table { color: #1b2432; }
html.kf-light .ts-table__status { color: #475569; opacity: 1; }
html.kf-light .ts-table__name,
html.kf-light .ts-table__duration { color: #64748b; opacity: 1; }
html.kf-light .ts-table__manager { color: #b45309; }
/* Zustände auf Weiß klar unterscheidbar: zarter Farbgrund + kräftiger Rahmen +
   dunklere Nummer/Status-Farbe. */
html.kf-light .ts-table--free { background: #f0fdf4; border-color: rgba(22, 163, 74, 0.45); }
html.kf-light .ts-table--free .ts-table__number { color: #16a34a; }
html.kf-light .ts-table--occupied { background: #eff6ff; border-color: rgba(37, 99, 235, 0.5); }
html.kf-light .ts-table--occupied .ts-table__number { color: #2563eb; }
html.kf-light .ts-table--occupied .ts-table__status { color: #1d4ed8; }
html.kf-light .ts-table--arrived { background: #faf5ff; border-color: rgba(147, 51, 234, 0.5); }
html.kf-light .ts-table--arrived .ts-table__number { color: #9333ea; }
html.kf-light .ts-table--arrived .ts-table__status { color: #7e22ce; }

/* ══════════════════════════════════════════════════════════════════ */
/* WZ-593 (Betreiber-Foto 28.09.2026, Tischübersicht mit Nummernpad,     */
/* O-Ton "Das Nummernpad muss fest unten sein, sonst nimmt es oben Platz */
/* zur Sicht auf die Artikel"): am Handy FEST unten, nie Teil des        */
/* scrollenden Flusses. MUSS wie die anderen Smartphone-Overrides am     */
/* DATEIENDE stehen (s. Kommentar weiter oben) — sonst gewinnt bei       */
/* gleicher Spezifität die frühere .ts-numpad-panel-Regel.               */
/* ══════════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .ts-layout {
    /* Das Numpad verlässt den Grid-Fluss (position:fixed) — nur noch EINE
       Zeile für die linke Spalte (Tische/Stammgäste). */
    grid-template-rows: 1fr;
  }

  .ts-numpad-panel {
    position: fixed;
    left: 16px;
    right: 16px;
    /* env(safe-area-inset-bottom): Geräte mit Home-Indicator (iPhone-Notch-
       Klasse) — das Pad darf nicht dahinter verschwinden. */
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.35);
  }

  /* Boden-Abstand: table-selection.js (syncNumpadOffset) setzt padding-bottom
     als INLINE-Style direkt auf die gemessene Lücke zwischen der (padding-
     unabhängigen, `height:100%`) Unterkante von `.ts-left-col` und der
     tatsächlichen Numpad-Oberkante (Kontroll-Nachbesserung 28.09.2026 — die
     reine Numpad-HÖHE war hier falsch, s. Kommentar im JS). Der Fallback-Wert
     unten greift nur im ALLERERSTEN Frame, bevor die Messung einmal
     gelaufen ist; das Inline-Style überschreibt ihn sofort danach. */
  .ts-left-col {
    padding-bottom: 220px;
  }
}

/* V3 (360 px, GESTALT-20, gemessen): die Bestell-Kopfzeile sitzt in der Kopfmitte (168 px breit, 34–202).
   „👤 4 Plätze“ lief bis x=221 und lag unter dem Avatar (208–244); „Tisch 1“ brach zweizeilig um.
   Jetzt bleibt alles in der Mitte: Titel einzeilig, Platz-Angabe wird gekürzt statt überzulaufen. */
@media (max-width: 480px) {
  /* GESTALT-52 (Avatar 44 px) schiebt die Mitte 8 px schmaler: der Abstand im Kopf wird knapper, damit die Platz-Angabe in der Mitte bleibt. */
  .ts-order-header { gap: 2px; min-width: 0; overflow: hidden; }
  /* Nachbesserung 3/3 (Leitstand, #3107): der Pfeil allein darf nicht schmaler als 44 px sein (war 34 px). */
  .ts-back-btn { padding: 6px 10px; min-width: 44px; justify-content: center; }
  /* GESTALT-20: der Pfeil genügt auf 360 px — die Platz-Angabe bekommt den Platz (Gerätefund: „👤 4…“). */
  .ts-back-btn__wort { display: inline; }
  /* Der Tischname kürzt sich zuerst; die Platz-Angabe bleibt ganz (GESTALT-20, Gerätefund „👤 4…“). */
  /* Gerätedurchgang 2 (V3 360 px, Entscheid Leitstand GESTALT-47): der Tischname bleibt ganz („Tisch 1“, nicht „T.“). */
  .ts-order-table { font-size: 1rem; white-space: nowrap; flex: 0 0 auto; }
  /* GESTALT-52 (Avatar 44 px): die Platz-Angabe schrumpft nicht; der Tischname kürzt sich zuerst. */
  .ts-order-info { flex: 0 0 auto; min-width: 0; overflow: hidden; white-space: nowrap; }
}
/* Auf 360 px nur „👤 4“ — das Wort „Plätze“ entfällt, Titel und Bedienhilfe nennen es weiter. */
@media (max-width: 360px) {
  .ts-order-info__wort { display: none; }
}

/* GESTALT-29 (Gerätedurchgang 30.10.): „+ Stammgast“ war 42 px hoch — Mindest-Tippfläche 44 px. */
.ts-add-regular { min-height: 44px; }

/* ═══ TISCH-V3 (Betreiber-Entwurf 04.11.2026, endgültig „dann so bauen lassen“; Handheld V3 360 px) ════════════════════════════
   Gilt NUR in der Gastro-Tischansicht (body.kf-tisch-ansicht, table-selection.js) bis 480 px (dieselbe Grenze wie tischV3Schmal() und
   renderCourseBar). Beide Kopfzeilen stehen in der Kopfleiste auf EINEM 6er-Raster: halb = 1 Feld, ganz = 2 Felder, Kanten übereinander.
     Zeile 1 (hellgrau): [Kürzel über T1] [A] [Gang] [+ Partei] [⠿] [☰]          — sechs halbe Knöpfe
     Zeile 2 (fast weiß, feine Linie): [← Zurück] [Im Haus/Außer Haus] [⇄ Tisch]  — drei ganze Knöpfe
   Fingerziele ≥ 44 px, Schrift ≥ 12 px (Skill funktionspruefung). */
/* Außerhalb des Handhelds gibt es nur den bisherigen Kopf (← Zurück, Tisch 1, Plätze). */
.ts-t1, .ts-gang-slot, .ts-partei-slot, #tsVerzehr { display: none; }
@media (max-width: 480px) {
  /* Kopfhöhe fest: 6 + 52 (Zeile 1, Kürzel über T1) + 6 + 44 (Zeile 2) + 6 = 114 px; der Warenkorb setzt darunter an. */
  body.kf-tisch-ansicht { --kf-tisch-v3-gruen: #4c7a6d; --kf-tisch-v3-luecke: 6px; --kf-tisch-v3-rand: 8px; --kf-tisch-v3-kopf: 114px; }

  body.kf-tisch-ansicht .top-bar {
    position: relative; isolation: isolate;
    display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); grid-template-rows: 52px 44px;
    gap: var(--kf-tisch-v3-luecke); align-items: center; padding: 6px var(--kf-tisch-v3-rand);
    box-sizing: border-box; height: var(--kf-tisch-v3-kopf); min-height: var(--kf-tisch-v3-kopf);
  }
  body.kf-tisch-ansicht .cart-panel.cart-panel--table-mode {
    top: calc(var(--kf-tisch-v3-kopf) + var(--kf-banner-h, 0px));
    height: calc(100dvh - var(--kf-tisch-v3-kopf) - var(--kf-banner-h, 0px));
    max-height: calc(100dvh - var(--kf-tisch-v3-kopf) - var(--kf-banner-h, 0px));
  }
  /* Zeile 2 auf fast weißem Grund mit feiner Trennlinie (Rasterelement hinter den Knöpfen). */
  body.kf-tisch-ansicht .top-bar::before {
    content: ''; grid-row: 2; grid-column: 1 / -1; align-self: stretch; z-index: -1;
    margin: calc(-1 * var(--kf-tisch-v3-luecke) / 2) calc(-1 * var(--kf-tisch-v3-rand)) -6px;
    background: var(--bg-primary); border-top: 1px solid var(--glass-border);
  }
  body.kf-tisch-ansicht .top-bar__left, body.kf-tisch-ansicht .top-bar__center, body.kf-tisch-ansicht .top-bar__right, body.kf-tisch-ansicht .top-bar__center .search-bar, body.kf-tisch-ansicht .ts-order-header,
  body.kf-tisch-ansicht #cashierInfo, body.kf-tisch-ansicht #tsParteiSlot, body.kf-tisch-ansicht #partyTabs { display: contents; }
  body.kf-tisch-ansicht #partyTabs { background: transparent; border: 0; } /* keine graue Fläche (e2e-tisch-warenkorb-kompakt 7a) */
  /* Der TSE-Punkt geht im Ring des Kürzels auf (derselbe Zustand, pwa-connectivity.js updateTseIndicator, WZ-395). */
  body.kf-tisch-ansicht .top-bar .tse-status, body.kf-tisch-ansicht #cashierInfo > div, body.kf-tisch-ansicht .ts-order-table, body.kf-tisch-ansicht .ts-order-info,
  body.kf-tisch-ansicht .top-bar__right > button:not(#btnFunctionsToggle):not(#btnMenuToggle),
  body.kf-tisch-ansicht .cart-panel.cart-panel--table-mode .cart-header { display: none; }

  /* Zeile 1 */
  body.kf-tisch-ansicht #cashierAvatar {
    grid-row: 1; grid-column: 1; align-self: start; justify-self: center; margin-top: 4px;
    box-sizing: border-box; width: 30px; height: 30px; min-width: 0; min-height: 0; padding: 0; font-size: 12px; background: var(--kf-tisch-v3-gruen); color: #fff;
    box-shadow: 0 0 0 2px var(--bg-secondary, #fff), 0 0 0 4px var(--green, #22c55e);
    cursor: default; /* keine Tippfunktion (pos.js überspringt den Klick hier) — Ummelden/Abmelden liegen im ⠿-Menü */
  }
  body.kf-tisch-ansicht #cashierAvatar.cashier-avatar--tse-aus { box-shadow: 0 0 0 2px var(--bg-secondary, #fff), 0 0 0 4px var(--red, #ef4444); }
  /* T1 unter dem Ring: Ring außen 4 px + Abstand, damit er T1 nicht verdeckt. */
  body.kf-tisch-ansicht #tsT1 { grid-row: 1; grid-column: 1; align-self: end; justify-self: center; display: block;
    font-size: 13px; font-weight: 800; line-height: 1; color: var(--text-primary); pointer-events: none; }
  body.kf-tisch-ansicht #partyTabs > .party-tab[data-party], body.kf-tisch-ansicht #partyTabs > #partySelect { grid-row: 1; grid-column: 2; }
  body.kf-tisch-ansicht #tsGangSlot { display: block; grid-row: 1; grid-column: 3; min-width: 0; }
  body.kf-tisch-ansicht #partyTabs > #tsAddParty, body.kf-tisch-ansicht #partyTabs > #tsAddPartyDd { grid-row: 1; grid-column: 4; }
  body.kf-tisch-ansicht #btnFunctionsToggle { grid-row: 1; grid-column: 5; }
  body.kf-tisch-ansicht #btnMenuToggle { grid-row: 1; grid-column: 6; }
  /* Zeile 2 */
  body.kf-tisch-ansicht #tsBackBtn { grid-row: 2; grid-column: 1 / span 2; }
  body.kf-tisch-ansicht #partyTabs > #tsVerzehr { display: inline-flex; grid-row: 2; grid-column: 3 / span 2; }
  body.kf-tisch-ansicht #partyTabs > #tsMoveTable { grid-row: 2; grid-column: 5 / span 2; }

  /* Gemeinsame Knopfform: gleiche Höhe und Schrift für A, Gang, + Partei, ⠿, ☰ und Zeile 2. */
  body.kf-tisch-ansicht #partyTabs > *, body.kf-tisch-ansicht #tsGangSlot .course-select, body.kf-tisch-ansicht #btnFunctionsToggle, body.kf-tisch-ansicht #btnMenuToggle, body.kf-tisch-ansicht #tsBackBtn {
    box-sizing: border-box; width: 100%; min-width: 0; height: 44px; min-height: 44px; margin: 0; padding: 0 2px;
    display: inline-flex; align-items: center; justify-content: center; justify-self: stretch;
    font-size: 13px; font-weight: 700; line-height: 1.1; white-space: nowrap; border-radius: 10px;
  }
  /* Zeile 1 (halbe Felder): EINE Schriftgröße für A, Gang und „+ Partei“ — gemessen 04.11.2026 bei 360 px: Feld innen 50,3 px,
     „+ Partei“ fett 12 px = 45,4 px (13 px = 49,2 px, nur ~1 px Luft). Einzeilig, kein Umbruch; e2e-tisch-v3 prüft den Überlauf. */
  body.kf-tisch-ansicht #partyTabs > .party-tab[data-party], body.kf-tisch-ansicht #partyTabs > #partySelect, body.kf-tisch-ansicht #partyTabs > #tsAddParty, body.kf-tisch-ansicht #partyTabs > #tsAddPartyDd,
  body.kf-tisch-ansicht #tsGangSlot .course-select { font-size: 12px; padding: 0; overflow: hidden; }
  body.kf-tisch-ansicht #tsGangSlot .course-bar { display: block; margin: 0; padding: 0; }
  body.kf-tisch-ansicht #tsGangSlot .course-select { display: block; padding: 0 2px; text-align: center; }
  body.kf-tisch-ansicht #partyTabs > .party-tab--active, body.kf-tisch-ansicht #partyTabs > #partySelect { background: var(--kf-tisch-v3-gruen); border-color: var(--kf-tisch-v3-gruen); color: #fff; }
  body.kf-tisch-ansicht #tsBackBtn .ts-back-btn__wort { display: inline; }
  html.kf-ohne-schalter body.kf-tisch-ansicht #partyTabs > #tsVerzehr { display: none; }
  /* „Gang abrufen“ (WZ-725) steht am Handheld nur im Aktionen-Menü (Aufruf showFireCourseDialog). Zwei IDs: schlägt die Knopfform
     „#partyTabs > *“ (sonst wird es eine dritte Rasterzeile über dem Suchfeld, Kontrolle 3 zu #3253, N1). */
  body.kf-tisch-ansicht #partyTabs > #tsFireCourse { display: none; }
  html.kf-ohne-partei body.kf-tisch-ansicht #partyTabs > #tsAddParty { display: none; }
  /* Die alte Zeile „Im Haus | Außer Haus | Gang“ samt „Speisen 7 % · Getränke 19 %“ entfällt: Umschalter und Gang stehen oben. */
  body.kf-tisch-ansicht .cart-panel--table-mode #ctxCourseRow, body.kf-tisch-ansicht .cart-panel--table-mode #taxContextToggle { display: none; }

  /* POSZEILE-V3 (Betreiber 05.11.2026, Variante B): Zeile = Name (höchstens 2 Zeilen) | − | Menge | + | Preis in FESTEN Spalten, damit die
     Knöpfe aller Zeilen exakt untereinander stehen. 📦 und ↗ entfallen hier: Außer Haus über den Markiermodus im Kopf (#tsVerzehr),
     Umbuchen einzelner Positionen über das Aktionen-Menü. Einzelpreis und Steuerbuchstabe entfallen weiter. */
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item {
    grid-template-columns: minmax(0, 1fr) 44px 28px 44px 66px; grid-template-rows: auto; align-items: center; gap: 4px 4px; padding: 8px 10px;
    border: 2px solid transparent; border-radius: 8px;
  }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__details,
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__qty { display: contents; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__name {
    grid-column: 1; grid-row: 1; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 14px; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto;
  }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__qty .qty-btn--remove { grid-column: 2; grid-row: 1; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__qty .qty-value { grid-column: 3; grid-row: 1; min-width: 0; text-align: center; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__qty .qty-btn:not(.qty-btn--remove) { grid-column: 4; grid-row: 1; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__qty .qty-btn {
    box-sizing: border-box; width: 44px; min-width: 44px; height: 44px; min-height: 44px; margin: 0; justify-self: center;
  }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__price { grid-column: 5; grid-row: 1; justify-self: end; white-space: nowrap; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__modifiers { grid-column: 1 / -1; grid-row: 2; }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__unit, body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__tax-letter,
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__details .togo-btn, body.kf-tisch-ansicht .cart-panel--table-mode .cart-item__details .split-btn { display: none; }
  /* Markiermodus an: „Außer Haus ✓“ PULSIERT ROT (Betreiber 05.11.2026: unübersehbar, PULSROT-1). Bei reduzierter Bewegung
     statt Animation ein fester, auffälliger roter Ring. */
  body.kf-tisch-ansicht #partyTabs > #tsVerzehr.ts-verzehr--ausser {
    background: var(--kf-tisch-v3-gruen); color: #fff; border-color: var(--kf-tisch-v3-gruen);
    animation: kf-ah-puls 1.4s ease-in-out infinite;
  }
  @media (prefers-reduced-motion: reduce) {
    body.kf-tisch-ansicht #partyTabs > #tsVerzehr.ts-verzehr--ausser { animation: none; box-shadow: 0 0 0 3px #dc2626; outline: 3px solid var(--bg-primary); outline-offset: -5px; }
  }
  /* Außer Haus je Position: grün umrandet und 🥡 vor dem Namen (Markiermodus des Kopfknopfs). */
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item.cart-item--togo { border-color: var(--kf-tisch-v3-gruen); background: rgba(76, 122, 109, 0.08); }
  body.kf-tisch-ansicht .cart-panel--table-mode .cart-item.cart-item--togo .cart-item__name::before { content: '🥡 '; }
  body.kf-tisch-ansicht .cart-items--ah-markieren .cart-item, body.kf-tisch-ansicht .cart-items--umbuch-wahl .cart-item { cursor: pointer; }
  /* Umbuchen → Einzelne Position: Hinweis mit Abbrechen über den Positionen. */
  body.kf-tisch-ansicht .kf-umbuch-hinweis {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 10px; padding: 6px 8px;
    border: 2px dashed var(--kf-tisch-v3-gruen); border-radius: 8px; font-size: 13px; font-weight: 700;
  }
  body.kf-tisch-ansicht .kf-umbuch-hinweis__abbrechen { min-height: 44px; min-width: 44px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
  body.kf-tisch-ansicht .ts-umbuchen-wahl { min-height: 48px; font-size: 15px; font-weight: 700; }

  /* Aktionen-Menü: drei Spalten (dialog-einheit.css), „Alles kassieren“ ist ein Feld wie die anderen. */
  body.kf-tisch-ansicht .am-gast-btn { font-size: 13px; }
  body.kf-tisch-ansicht .am-gast-btn--breit { grid-column: auto; }
}

/* ── TISCHSPERRE-1b: „Tisch 5 wird gerade von Anna bearbeitet“ ────────────────
   Steht über dem Produkt-Grid, solange ein ANDERES Gerät diesen Tisch hält
   (gefüllt von frontend/tisch-sperre.js). Farben ausschliesslich über Tokens —
   die Leiste muss in der hellen Anzeige genauso lesbar sein wie in der dunklen;
   die Auffälligkeit trägt der linke Rand, nicht ein fester Farbwert. */
.ts-sperre-hinweis {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 12px 0;
  padding: 8px 10px;
  border: 2px solid var(--amber);
  border-left-width: 8px;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}
.ts-sperre-hinweis[hidden] { display: none; }
.ts-sperre-hinweis__text { flex: 1 1 auto; min-width: 0; }
.ts-sperre-hinweis__loesen {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 2px solid var(--red);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ts-sperre-hinweis__loesen[hidden] { display: none; }

/* 3-104: „Erneut versuchen" — der Ausweg aus dem Lese-Modus, wenn das andere
   Gerät den Tisch inzwischen freigegeben hat. Ruhiger als „Sperre lösen":
   es übernimmt nichts, es fragt nur neu. */
.ts-sperre-hinweis__erneut {
  flex: 0 0 auto;
  min-height: 44px;
  min-width: 44px;
  padding: 0 12px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.ts-sperre-hinweis__erneut[hidden] { display: none; }

/* Am Handheld steht der Knopf unter dem Satz: der vollständige Text bleibt
   sichtbar, statt am schmalen Display abgeschnitten zu werden. */
@media (max-width: 480px) {
  .ts-sperre-hinweis { flex-wrap: wrap; }
  .ts-sperre-hinweis__loesen,
  .ts-sperre-hinweis__erneut { width: 100%; }
}
