:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f5f5f5;
  --text: #1c1c1c;
  --muted: #666666;
  --border: #e6e6e6;
  --primary: #1f5f46;
  --primary-hover: #174a36;
  --primary-soft: #eaf4ee;
  --on-primary: #ffffff;
  --accent: #b08a3e;
  --danger: #a33b32;
  --danger-soft: #fbeceb;

  --free: #2f8f5b;
  --partial: #d39b2a;
  --full: #c4c4c4;
  --selected: #1c1c1c;
  --chosen: #2b5bb8;

  --hall-fill: #ffffff;
  --hall-stroke: #3a3a3a;
  --room-fill: #f4f4f4;
  --stage-fill: #ececec;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 6px 20px rgba(0, 0, 0, 0.05);
  color-scheme: light;
}

* { box-sizing: border-box; }
/* Ausgeblendete Elemente bleiben verborgen, auch wenn eine Regel display setzt */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

h1, h2, h3 { line-height: 1.2; margin: 0; }
a { color: var(--primary); }
button, input, select, textarea { font: inherit; color: inherit; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }

/* ---------- Kopfbereich ---------- */
.hero {
  background: var(--bg);
  color: var(--text);
  padding: 40px 0 28px;
  border-bottom: 1px solid var(--border);
}
.hero .eyebrow { color: var(--primary); opacity: 1; }
.hero .meta { color: var(--muted); }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 13px;
  font-weight: 600;
  opacity: 0.85;
  margin: 0 0 8px;
}
.hero h1 { font-size: clamp(28px, 5vw, 42px); font-family: Georgia, 'Times New Roman', serif; font-weight: 600; }
.hero .meta { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 14px; font-size: 15px; opacity: 0.95; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 24px 0;
  padding: 0;
  list-style: none;
}
.steps li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 14px;
  color: var(--muted);
}
.steps strong { display: block; color: var(--text); font-size: 15px; margin-bottom: 2px; }
.steps .num {
  display: inline-grid;
  place-items: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ---------- Hauptbereich ---------- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
  align-items: start;
  padding-bottom: 48px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.layout > * { min-width: 0; }
.map-card { padding: 16px; }
.map-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.map-head h2 { font-size: 18px; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

.map-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.map-scroll svg { display: block; width: 100%; min-width: 640px; height: auto; }
.map-hint { font-size: 13px; color: var(--muted); margin: 8px 0 0; }

/* SVG */
.hall { fill: var(--hall-fill); stroke: var(--hall-stroke); stroke-width: 4; stroke-linejoin: round; }
.room { fill: var(--room-fill); stroke: var(--hall-stroke); stroke-width: 1.5; }
.dance { fill: none; stroke: var(--hall-stroke); stroke-width: 1.5; stroke-dasharray: 6 4; }
.stage { fill: var(--stage-fill); stroke: var(--hall-stroke); stroke-width: 2; }
.lm-label { fill: var(--muted); font-size: 11px; font-weight: 600; text-anchor: middle; dominant-baseline: middle; text-transform: uppercase; letter-spacing: 0.04em; pointer-events: none; }

.lm-label.sm { font-size: 9px; letter-spacing: 0; }
.tbl { cursor: pointer; outline: none; }
.tbl .table { stroke: var(--hall-fill); stroke-width: 2; }
.tbl text { fill: #fff; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.tbl.free .table { fill: var(--free); }
.tbl.partial .table { fill: var(--partial); }
.tbl.full { cursor: not-allowed; }
.tbl.full .table { fill: var(--full); }
.tbl.blocked { cursor: not-allowed; }
.tbl.blocked .table { fill: var(--surface-2); stroke: var(--full); stroke-dasharray: 3 2; }
.tbl.blocked text { fill: var(--muted); }
.blocked-label { fill: var(--muted); font-size: 9px; font-weight: 700; text-anchor: middle; text-transform: uppercase; letter-spacing: 0.05em; pointer-events: none; }
.map-scroll.detail .blocked-label { display: none; }
.tbl:hover .table, .tbl:focus-visible .table { stroke: var(--selected); stroke-width: 1.5; }
.tbl.selected .table { stroke: var(--selected); stroke-width: 3; }

/* Stühle im Saalplan: nur in der Detailansicht */
.chairs { display: none; }
.map-scroll.detail .chairs { display: inline; }
.map-scroll.detail .tbl.selected .table { stroke-width: 1.5; }
.chair { stroke-width: 0.8; cursor: pointer; }
.chair.open { fill: var(--surface); stroke: var(--free); }
.chair.taken { fill: var(--full); stroke: var(--full); cursor: not-allowed; }
.chair.chosen { fill: var(--chosen); stroke: var(--chosen); }
.map-scroll.detail svg { min-width: 1800px; }

.view-toggle { display: inline-flex; background: var(--surface-2); border-radius: 10px; padding: 3px; }
.view-toggle button { border: 0; background: none; padding: 6px 14px; border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 600; color: var(--muted); }
.view-toggle button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12); }
.map-legend { margin-bottom: 10px; }

/* Große Tischansicht in der Seitenleiste */
.table-detail { display: block; width: 100%; max-width: 300px; margin: 16px auto 4px; }
.td-table { fill: var(--surface-2); stroke: var(--border); stroke-width: 2; }
.td-label { fill: var(--muted); font-size: 13px; text-anchor: middle; dominant-baseline: central; }
.td-no { fill: var(--text); font-size: 26px; font-weight: 700; text-anchor: middle; dominant-baseline: central; }
.td-chair { cursor: pointer; outline: none; }
.td-chair circle { stroke-width: 2.5; transition: transform 0.1s; }
.td-chair text { font-size: 13px; font-weight: 700; text-anchor: middle; dominant-baseline: central; pointer-events: none; }
.td-chair.open circle { fill: var(--surface); stroke: var(--free); }
.td-chair.open text { fill: var(--free); }
.td-chair.open:hover circle, .td-chair:focus-visible circle { stroke-width: 4; }
.td-chair.chosen circle { fill: var(--chosen); stroke: var(--chosen); }
.td-chair.chosen text { fill: #fff; }
.td-chair.taken { cursor: not-allowed; }
.td-chair.taken circle { fill: var(--full); stroke: var(--full); }
.td-chair.taken text { fill: var(--surface); }

.chair-legend { justify-content: center; margin-bottom: 8px; }
.chair-legend i { border: 2px solid transparent; }
.chair-legend .lg-open { background: var(--surface); border-color: var(--free); }
.chair-legend .lg-chosen { background: var(--chosen); }
.chair-legend .lg-taken { background: var(--full); }

.chosen-bar { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: 14px; margin-top: 8px; }
button.link { border: 0; background: none; padding: 0; color: var(--primary); text-decoration: underline; cursor: pointer; font-size: 14px; }

/* ---------- Seitenleiste ---------- */
.panel { padding: 20px; position: sticky; top: 16px; }
.panel h2 { font-size: 20px; margin-bottom: 4px; }
.panel .sub { color: var(--muted); font-size: 14px; margin: 0 0 16px; }

label { display: block; font-size: 14px; font-weight: 600; margin: 14px 0 6px; }
label .opt { font-weight: 400; color: var(--muted); }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: 1px; border-color: transparent; }

.seat-picker { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.seat-picker button {
  padding: 8px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-weight: 600;
}
.seat-picker button[aria-pressed='true'] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.seat-picker button:disabled { opacity: 0.35; cursor: not-allowed; }

.total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 16px; padding: 12px 14px;
  background: var(--surface-2); border-radius: 10px; font-size: 14px;
}
.total strong { font-size: 18px; }

.btn {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px;
  width: 100%; margin-top: 16px; padding: 12px 16px;
  border: 0; border-radius: 10px;
  background: var(--primary); color: var(--on-primary);
  font-weight: 700; cursor: pointer;
}
.btn:hover { background: var(--primary-hover); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.btn.secondary { background: var(--surface-2); color: var(--text); }

.small { font-size: 13px; color: var(--muted); }
.error { background: var(--danger-soft); color: var(--danger); padding: 10px 12px; border-radius: 10px; font-size: 14px; margin-top: 12px; }
.notice { background: var(--primary-soft); padding: 12px 14px; border-radius: 10px; font-size: 14px; }
.hp { position: absolute; left: -10000px; }

.empty { text-align: center; padding: 12px 0 4px; color: var(--muted); }
.empty svg { width: 44px; height: 44px; color: var(--accent); margin-bottom: 8px; }

.confirm .code {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 26px; font-weight: 700; letter-spacing: 0.12em;
  background: var(--surface-2); border-radius: 10px; padding: 10px; text-align: center; margin: 12px 0;
}
.confirm dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 0 0 14px; }
.confirm dt { color: var(--muted); }
.confirm dd { margin: 0; font-weight: 600; }

footer { border-top: 1px solid var(--border); padding: 20px 0 32px; font-size: 13px; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 8px 20px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .panel { position: static; }
}
@media (max-width: 600px) {
  .steps { grid-template-columns: 1fr; }
  .hero { padding: 28px 0; }
}

/* Formularabschnitte, Versandart, Zahlung */
.form-section { font-size: 15px; margin: 22px 0 2px; padding-top: 16px; border-top: 1px solid var(--border); }
input[readonly] { background: var(--surface-2); color: var(--muted); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.choice { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; font-weight: 400; }
.choice:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.choice input { width: auto; margin: 3px 0 0; accent-color: var(--primary); }
.choice strong { display: block; font-size: 14px; }
.choice small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.address .row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; }
.summary { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 15px; margin: 12px 0 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; }
.summary .opt { font-weight: 400; color: var(--muted); font-size: 13px; }
.bank { background: var(--surface-2); border-radius: 10px; padding: 4px 14px; margin-top: 10px; }
.bank-row { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; font-size: 14px; }
.bank-row + .bank-row { border-top: 1px solid var(--border); }
.bank-row span { color: var(--muted); white-space: nowrap; }
.bank-row strong { text-align: right; }
.bank .iban { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.03em; }
.eyebrow.step { color: var(--primary); margin-bottom: 4px; }
.btn.secondary { margin-top: 8px; }

.home-link { display: inline-block; margin-bottom: 18px; font-size: 14px; color: var(--muted); text-decoration: none; }
.home-link:hover { color: var(--primary); text-decoration: underline; }

.pickup-points { display: grid; gap: 8px; }
.pickup-points > label:first-child { margin-bottom: -2px; }
.pickup-points .choice small { font-variant-numeric: tabular-nums; }

.bank-row.paypal strong { word-break: break-all; }
