/* ===== THE Chalet – Tischplanung (Design-Tokens & Layout) ===== */
:root {
  --paper: #F5F1EA; --paper-2: #EDE7DB; --card: #FFFFFF; --ink: #221F1A;
  --ink-soft: #5E574C; --line: #DAD1C2; --pine: #37624A; --pine-soft: #EAF0EB;
  --wood: #A9773D; --ok: #3C7A52; --ok-bg: #E7F1E9; --warn: #B07A1E;
  --warn-bg: #F6ECD6; --over: #B23A2E; --over-bg: #F6E1DD;
  --seat-empty: #E7E0D2; --seat-empty-line: #CFC6B4; --seat-present: #7C8085;
  --shadow: 0 1px 2px rgba(34,31,26,.06), 0 6px 20px rgba(34,31,26,.06);
  --radius: 14px;
  --font-display: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --font-ui: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Mono", "Consolas", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #1A1815; --paper-2: #211E19; --card: #24211B; --ink: #F2ECE0;
    --ink-soft: #B3A991; --line: #38322A; --pine: #7FB08F; --pine-soft: #22302A;
    --wood: #D3A45F; --ok: #7FB08F; --ok-bg: #22302A; --warn: #D6AC5B;
    --warn-bg: #322A19; --over: #E08476; --over-bg: #362119;
    --seat-empty: #322D25; --seat-empty-line: #47402F; --seat-present: #565A5F;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
  }
}
:root[data-theme="light"] {
  --paper: #F5F1EA; --paper-2: #EDE7DB; --card: #FFFFFF; --ink: #221F1A;
  --ink-soft: #5E574C; --line: #DAD1C2; --pine: #37624A; --pine-soft: #EAF0EB;
  --wood: #A9773D; --ok: #3C7A52; --ok-bg: #E7F1E9; --warn: #B07A1E;
  --warn-bg: #F6ECD6; --over: #B23A2E; --over-bg: #F6E1DD;
  --seat-empty: #E7E0D2; --seat-empty-line: #CFC6B4; --seat-present: #7C8085;
  --shadow: 0 1px 2px rgba(34,31,26,.06), 0 6px 20px rgba(34,31,26,.06);
}
:root[data-theme="dark"] {
  --paper: #1A1815; --paper-2: #211E19; --card: #24211B; --ink: #F2ECE0;
  --ink-soft: #B3A991; --line: #38322A; --pine: #7FB08F; --pine-soft: #22302A;
  --wood: #D3A45F; --ok: #7FB08F; --ok-bg: #22302A; --warn: #D6AC5B;
  --warn-bg: #322A19; --over: #E08476; --over-bg: #362119;
  --seat-empty: #322D25; --seat-empty-line: #47402F;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font-ui); font-size: 15px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; margin: 0; }
button { font-family: inherit; cursor: pointer; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.hidden { display: none !important; }

/* ---------- Header ---------- */
.app-header {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 22px; background: var(--card);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
}
.print-only { display: none; }
.brand { display: flex; align-items: baseline; gap: 10px; }
.brand .mark { font-family: var(--font-display); font-size: 22px; letter-spacing: .01em; }
.brand .mark b { color: var(--pine); }
.brand .sub { font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--ink-soft); }

.event-pick {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--pine-soft); border: 1px solid var(--line); border-radius: 10px;
  padding: 4px 10px 4px 12px;
}
.event-pick .ep-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--pine); }
.event-pick select {
  border: 0; background: transparent; color: var(--ink); font-family: inherit;
  font-size: 14px; font-weight: 600; padding: 4px 2px; cursor: pointer; max-width: 320px;
}
.event-pick select:focus-visible { outline: 2px solid var(--pine); outline-offset: 2px; border-radius: 4px; }

.build-badge {
  font-size: 11px; font-variant-numeric: tabular-nums; letter-spacing: .02em;
  color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 7px; padding: 2px 7px; font-weight: 600; user-select: none; cursor: default;
}
.save-status { font-size: 12px; color: var(--ink-soft); min-width: 92px; }
.save-status.saving { color: var(--warn); }
.save-status.saved { color: var(--ok); }
.save-status.error { color: var(--over); }

.seg { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--ink-soft); padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.seg button.active { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.spacer { flex: 1; }

.user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--ink-soft); }
.user .email { font-family: var(--font-mono); font-size: 12px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--pine); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.badge-ok { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--ok); background: var(--ok-bg); padding: 2px 7px; border-radius: 6px; font-weight: 700; }
.linkbtn { border: 0; background: transparent; color: var(--pine); font-size: 13px; font-weight: 600; text-decoration: underline; }

/* ---------- Layout ---------- */
.app { display: grid; grid-template-columns: 340px 1fr; height: calc(100vh - 64px); }
@media (max-width: 880px) { .app { grid-template-columns: 1fr; height: auto; } }
aside { border-right: 1px solid var(--line); background: var(--card); display: flex; flex-direction: column; overflow-y: auto; }
main { overflow-y: auto; padding: 22px 26px; }

.panel { padding: 18px 18px 6px; }
.panel h2 { font-size: 15px; margin-bottom: 4px; }
.panel .hint { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }

label.field { display: block; margin-bottom: 10px; }
label.field span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-soft); margin-bottom: 4px; font-weight: 600; }
input[type="text"], input[type="number"] {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--paper); color: var(--ink); font-family: inherit; font-size: 14px;
}
input:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 96px; gap: 10px; align-items: end; }

.btn { border: 1px solid var(--line); background: var(--paper); color: var(--ink); padding: 9px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; }
.btn:hover { border-color: var(--ink-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--pine); color: #fff; border-color: var(--pine); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-full { width: 100%; }
.btn-row { display: flex; gap: 8px; padding: 0 18px 14px; }

/* ---------- Group list ---------- */
.groups { list-style: none; margin: 0; padding: 6px 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.group { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: grab; }
.group:active { cursor: grabbing; }
.group.dragging { opacity: .5; }
.group.selected { border-color: var(--pine); box-shadow: 0 0 0 2px var(--pine-soft); }
.group.done { opacity: .55; }
.swatch { width: 12px; height: 12px; border-radius: 3px; flex: none; }
.group .g-id { font-weight: 600; font-size: 14px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group .g-count { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); background: var(--card); border: 1px solid var(--line); border-radius: 7px; padding: 2px 7px; white-space: nowrap; }
.group .g-count.part { color: var(--warn); border-color: var(--warn); }
.group .g-count.full { color: var(--ok); border-color: var(--ok); }
.group .g-tables { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); background: var(--paper-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; flex: none; }
/* Platzierungs-Flag (Stuhl): gesetzt = kräftig, teilweise = mit Zahl (warn), keiner = blass */
.group .g-seated { flex: none; font-size: 13px; line-height: 1; opacity: .3; white-space: nowrap; }
.group .g-seated.full { opacity: 1; }
.group .g-seated.part { opacity: 1; font-family: var(--font-mono); font-size: 11px; color: var(--warn); }
.group .g-del { border: 0; background: transparent; color: var(--ink-soft); font-size: 16px; padding: 2px 4px; line-height: 1; border-radius: 6px; }
.group .g-del:hover { color: var(--over); background: var(--over-bg); }
.group .g-edit { border: 0; background: transparent; color: var(--ink-soft); font-size: 13px; padding: 2px 4px; line-height: 1; border-radius: 6px; }
.group .g-edit:hover { color: var(--pine); background: var(--pine-soft); }
.group .g-save { border: 0; background: transparent; color: var(--ok); font-size: 15px; font-weight: 700; padding: 2px 5px; line-height: 1; border-radius: 6px; }
.group .g-save:hover { background: var(--ok-bg); }
.group.editing { gap: 6px; cursor: default; flex-wrap: wrap; }
/* .group .g-edit-* : höhere Spezifität als globales input[type=...]{width:100%} */
.group .g-edit-label { flex: 1 1 auto; width: auto; min-width: 0; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 13px; }
.group .g-edit-size { flex: 0 0 56px; width: 56px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 13px; }
.group .g-edit-label:focus-visible, .group .g-edit-size:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
.empty-note { color: var(--ink-soft); font-size: 13px; padding: 10px 20px 18px; }

/* ---------- Kategorie-Badge / Check-in ---------- */
.cat-badge { display: inline-grid; place-items: center; width: 17px; height: 17px; border-radius: 5px; background: var(--paper-2); border: 1px solid var(--line); color: var(--ink-soft); font-family: var(--font-mono); font-size: 10px; font-weight: 700; flex: none; }
.group .g-checkin { border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); width: 22px; height: 22px; font-size: 12px; line-height: 1; padding: 0; border-radius: 6px; flex: none; }
.group .g-checkin:hover { border-color: var(--ok); color: var(--ok); }
.group .g-checkin.on { color: var(--ok); border-color: var(--ok); background: var(--ok-bg); }
.group .g-checkin.part { color: var(--warn); border-color: var(--warn); background: var(--warn-bg); }
.group.checkedin { border-left: 3px solid var(--ok); }
/* Kategorie-Auswahl in der Bearbeiten-Zeile (eigene Zeile, volle Breite) */
.group .g-edit-cat { flex: 1 1 100%; width: 100%; padding: 5px 7px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); color: var(--ink); font-size: 12px; }
.group .g-edit-cat:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }
/* Rabattstufen-Auswahl im Erfassungsformular */
.field select { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font-family: inherit; font-size: 14px; }
.field select:focus-visible { outline: 2px solid var(--pine); outline-offset: 1px; }

/* ---------- Druck-Titel (nur im Druck sichtbar) ---------- */
.print-title { align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 10px; margin-bottom: 14px; border-bottom: 2px solid var(--ink); }
.print-title .eb-eye { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); font-weight: 600; }
.print-title .eb-name { font-family: var(--font-display); font-size: 22px; font-weight: 600; }
.print-title .eb-meta { display: flex; gap: 14px; font-size: 12px; color: var(--ink-soft); flex-wrap: wrap; }
.print-title .eb-meta b { color: var(--ink); }

/* ---------- Event banner ---------- */
.event-banner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--pine); border-radius: 12px; padding: 12px 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.event-banner .eb-eye { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); font-weight: 600; }
.event-banner .eb-name { font-family: var(--font-display); font-size: 21px; font-weight: 600; }
.event-banner .eb-meta { display: flex; gap: 18px; font-size: 13px; color: var(--ink-soft); flex-wrap: wrap; text-align: right; }
.event-banner .eb-meta b { color: var(--ink); font-weight: 600; }

/* ---------- Summary strip ---------- */
.summary { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; min-width: 118px; box-shadow: var(--shadow); }
.stat .k { font-size: 11px; text-transform: uppercase; letter-spacing: .09em; color: var(--ink-soft); }
.stat .v { font-family: var(--font-mono); font-size: 22px; font-weight: 600; line-height: 1.2; margin-top: 2px; }
.stat .v small { font-size: 13px; color: var(--ink-soft); font-weight: 400; }
.stat.alert .v { color: var(--over); }
.stat.warn .v { color: var(--warn); }

.plan-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.plan-head h2 { font-size: 20px; }

/* Einklappbare Sektionen */
.sec-head { cursor: pointer; display: flex; align-items: center; gap: 8px; user-select: none; }
.sec-head .chev { font-size: 11px; color: var(--ink-soft); width: 12px; display: inline-block; text-align: center; }
.sec-head:hover, .sec-head:hover .chev { color: var(--pine); }
.sec-body.collapsed { display: none; }
@media print { .sec-body.collapsed { display: block !important; } }
.plan-hint { color: var(--ink-soft); font-size: 13px; margin: -6px 0 18px; }
.plan-hint.sel-hint { color: var(--ink); background: var(--pine-soft); border: 1px solid var(--line); border-left: 3px solid var(--pine); border-radius: 9px; padding: 9px 13px; margin: -6px 0 16px; }
.plan-hint.sel-hint b { color: var(--pine); }
.plan-hint.checkin-hint { color: var(--ink); background: var(--ok-bg); border: 1px solid var(--line); border-left: 3px solid var(--ok); border-radius: 9px; padding: 9px 13px; margin: -6px 0 16px; }
.plan-hint.checkin-hint b { color: var(--ok); }
.toggle.toggle-on { color: var(--ok); font-weight: 600; }
.toggle { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.switch { position: relative; width: 40px; height: 22px; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .track { position: absolute; inset: 0; background: var(--line); border-radius: 999px; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--pine); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--pine); outline-offset: 2px; }

/* ---------- Table grid ---------- */
.floor { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 34px; max-width: 760px; }
.floor .t7-slot { grid-column: 2; }
@media (max-width: 620px) { .floor { grid-template-columns: 1fr; } .floor .t7-slot { grid-column: 1; } }

.table-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 12px 14px; box-shadow: var(--shadow); }
.table-card.drop-hover { border-color: var(--pine); box-shadow: 0 0 0 3px var(--pine-soft); }
.tc-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.tc-head .name { font-family: var(--font-display); font-size: 16px; font-weight: 600; }
.tc-head .occ { font-family: var(--font-mono); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 7px; background: var(--paper-2); color: var(--ink-soft); }
.tc-head .occ.some { background: var(--warn-bg); color: var(--warn); }
.tc-head .occ.full { background: var(--ok-bg); color: var(--ok); }
.tc-head .clear { border: 0; background: transparent; color: var(--ink-soft); font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.tc-head .clear:hover { color: var(--over); background: var(--over-bg); }

.table-diagram { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 26px 58px 26px; gap: 8px; align-items: center; justify-items: center; }
.surface { grid-column: 1 / 5; grid-row: 2; width: 100%; height: 100%; background: var(--paper-2); border: 1px dashed var(--seat-empty-line); border-radius: 8px; display: grid; place-items: center; color: var(--ink-soft); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.seat { position: relative; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--seat-empty-line); background: var(--seat-empty); cursor: pointer; display: grid; place-items: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-soft); transition: transform .1s; }
.seat.occ { border-color: transparent; color: #fff; font-weight: 700; }
.seat.occ:hover { transform: scale(1.12); }
.seat:hover { border-color: var(--pine); }
.seat.occ[draggable="true"] { cursor: grab; }
.seat.occ[draggable="true"]:active { cursor: grabbing; }
.seat.sel { outline: 3px solid var(--pine); outline-offset: 1px; }
/* Sitz-Zelle: Träger für das Anwesenheits-Feld hinter dem Kreis */
.seat-cell { position: relative; z-index: 0; display: grid; place-items: center; }
/* Check-in: anwesend = graues Feld HINTER dem Kreis (Kreis unverändert), ragt über den Tisch */
.seat-cell.present::before {
  content: ""; position: absolute; z-index: -1; width: 34px;
  left: 50%; transform: translateX(-50%);
  background: var(--seat-present); border-radius: 7px;
}
.seat-cell.present.row-top::before { top: -5px; bottom: -20px; }
.seat-cell.present.row-bottom::before { top: -20px; bottom: -5px; }
@media print { .seat-cell.present::before { display: none; } }

.table-foot { margin-top: 8px; min-height: 20px; display: flex; flex-wrap: wrap; gap: 5px; }
.chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; color: #fff; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.chip .n { font-family: var(--font-mono); opacity: .85; }

/* Gruppen im Tisch als Liste (untereinander), wählbar, Konditionen rechts (einzeilig) */
.table-groups { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 3px; min-height: 20px; }
.table-groups li { display: flex; align-items: center; gap: 6px; font-size: 12px; padding: 5px; border-bottom: 1px solid var(--line); cursor: pointer; }
.table-groups li:last-child { border-bottom: none; }
.table-groups li:hover { background: var(--paper-2); }
.table-groups li.sel { background: var(--pine-soft); box-shadow: inset 0 0 0 1px var(--pine); }
.table-groups .tg-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.table-groups .tg-label { flex: 1 1 auto; min-width: 0; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-groups .tg-n { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); flex: none; }
.table-groups .tg-cond { flex: none; padding-left: 8px; text-align: right; color: var(--ink-soft); font-size: 11px; white-space: nowrap; }
/* Check-in-Toggle in der gewählten Tischzeile */
.table-groups .tg-checkin { margin-left: auto; flex: none; border: 1px solid var(--pine); background: var(--card); color: var(--pine); font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.table-groups .tg-checkin.on { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
.table-groups .tg-checkin.part { border-color: var(--warn); background: var(--warn-bg); color: var(--warn); }

/* ---------- Report (grafisch, A4) ---------- */
.report { max-width: 900px; }
.report .meta { color: var(--ink-soft); font-size: 13px; margin-bottom: 16px; }
.rep-sheet { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 24px 26px; box-shadow: var(--shadow); }
.rep-sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-bottom: 12px; margin-bottom: 18px; border-bottom: 2px solid var(--ink); }
.rep-sheet-head .eye { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--pine); font-weight: 700; }
.rep-sheet-head .ttl { font-family: var(--font-display); font-size: 24px; font-weight: 600; }
.rep-sheet-head .r { text-align: right; font-size: 12px; color: var(--ink-soft); line-height: 1.7; }
.rep-sheet-head .r b { color: var(--ink); }
.rep-floor { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px 30px; }
.rep-floor .t7 { grid-column: 2; }
.rep-tcard { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px 12px; }
.rep-tcard.empty { opacity: .55; }
.rep-tcard .th { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.rep-tcard .th .n { font-family: var(--font-display); font-size: 15px; font-weight: 600; }
.rep-tcard .th .o { font-family: var(--font-mono); font-size: 11px; color: var(--ink-soft); font-weight: 600; }
.rep-dia { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: 22px 38px 22px; gap: 6px; align-items: center; justify-items: center; }
.rep-surface { grid-column: 1 / 5; grid-row: 2; width: 100%; height: 100%; border: 1px dashed var(--seat-empty-line); border-radius: 6px; }
.rep-seat { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--seat-empty-line); background: var(--seat-empty); font-family: var(--font-mono); font-size: 9px; display: grid; place-items: center; color: var(--ink-soft); }
.rep-seat.occ { border-color: transparent; color: #fff; font-weight: 700; }
.rep-foot { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 5px; }
.rep-legend { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.rep-legend .lg { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; }
.rep-legend .lg .n { font-family: var(--font-mono); color: var(--ink-soft); }
.rep-legend .total { margin-left: auto; font-weight: 700; font-size: 13px; }

/* ---------- Access / states ---------- */
.center-panel { display: grid; place-items: center; min-height: 70vh; padding: 24px; text-align: center; }
.center-panel .box { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 32px 34px; max-width: 420px; box-shadow: var(--shadow); }
.center-panel h2 { font-size: 20px; margin-bottom: 8px; }
.center-panel p { color: var(--ink-soft); font-size: 14px; }
.center-panel .mark { font-family: var(--font-display); font-size: 26px; margin-bottom: 14px; }
.center-panel .mark b { color: var(--pine); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 10px 18px; border-radius: 10px; font-size: 13px; box-shadow: var(--shadow); z-index: 100; max-width: 90vw; text-align: center; }

/* ---------- Print A4 ---------- */
@media print {
  @page { size: A4 portrait; margin: 10mm; }
  .app-header, aside, .no-print { display: none !important; }
  .app { display: block; height: auto; }
  main { padding: 0; overflow: visible; }
  html, body { background: #fff; font-size: 12px; }
  .print-only { display: flex !important; }
  /* Immer 2 Tische pro Reihe (3 Reihen; mit 7. Tisch 4 Reihen), kompakt für ein A4 */
  .floor { max-width: none; grid-template-columns: repeat(2, 1fr) !important; gap: 8px 16px; }
  .table-card { box-shadow: none; break-inside: avoid; padding: 6px 8px 8px; }
  .tc-head { margin-bottom: 4px; }
  .tc-head .name { font-size: 13px; }
  .table-diagram { grid-template-rows: 18px 32px 18px; gap: 5px; }
  .surface { font-size: 9px; }
  .seat { width: 19px; height: 19px; font-size: 8px; }
  .table-foot { margin-top: 5px; gap: 4px; }
  .chip { font-size: 9px; padding: 1px 6px; }
  .print-title { margin-bottom: 8px; padding-bottom: 6px; }
  .print-title .eb-name { font-size: 18px; }
  .rep-legend { margin-top: 8px; padding-top: 8px; gap: 4px 12px; }
  .rep-legend .lg { font-size: 10px; }
  .table-groups { margin-top: 5px; gap: 2px; }
  .table-groups li { font-size: 9px; }
  .table-groups .tg-cond { font-size: 8px; }
  .seat, .chip, .surface, .swatch, .tg-swatch, .print-title { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ---------- Mobile: Controls und Tische untereinander ---------- */
@media (max-width: 880px) {
  aside { border-right: none; border-bottom: 1px solid var(--line); }
}
@media (max-width: 560px) {
  .app-header { gap: 8px 12px; padding: 10px 14px; }
  .brand .sub { display: none; }
  .event-pick { padding: 4px 8px; }
  .event-pick select { max-width: 190px; font-size: 13px; }
  .user .u-text { display: none; }
  main { padding: 16px 14px; }
  .event-banner { flex-direction: column; align-items: flex-start; }
  .event-banner .eb-meta { text-align: left; gap: 6px 14px; }
  .summary .stat { min-width: calc(50% - 6px); flex: 1; }
  .floor { grid-template-columns: 1fr; }
  .floor .t7-slot { grid-column: 1; }
}
