/* Besucherzähler – schlicht, gut lesbar, hell und dunkel. Aufbau wie bei IHK-Maintenance. */
:root {
  color-scheme: light dark;
  --bg: #f5f6f7;
  --karte: #ffffff;
  --text: #1d2330;
  --dezent: #6b7280;
  --linie: #e3e6eb;
  --akzent: #2f5f8a;
  --akzent-text: #ffffff;
  --gezaehlt: #e6eff7;
  --offen: #fff4e0; --offen-rand: #c2650a;
  --fehler: #b42318;
  --erfolg: #dcefe3; --erfolg-rand: #1f7a4a;
  --warn-bg: #fdecea;
  --eingabe: #ffffff;
  --eingabe-rand: #a3acb9;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --karte: #1d2128;
    --text: #e6e8eb;
    --dezent: #9aa1ab;
    --linie: #2e333c;
    --akzent: #7fb2e0;
    --akzent-text: #0f1720;
    --gezaehlt: #1c2a38;
    --offen: #3a2c18; --offen-rand: #f2a65a;
    --fehler: #f97066;
    --erfolg: #1c3a2b; --erfolg-rand: #6fcf97;
    --warn-bg: #3a1f1d;
    --eingabe: #0f1216;
    --eingabe-rand: #5a6472;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
main { max-width: 1100px; margin: 0 auto; padding: 1.25rem 1rem 3rem; }
h1 { margin: 0 0 .25rem; font-size: 1.6rem; }
h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
a { color: var(--akzent); }
.dezent { color: var(--dezent); }
.fuss { text-align: center; color: var(--dezent); font-size: .8rem; padding-bottom: 1rem; }

/* Kopfzeile */
.kopf {
  display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between;
  padding: .6rem 1rem; background: var(--karte); border-bottom: 1px solid var(--linie);
}
.marke { font-weight: 700; text-decoration: none; color: var(--text); }
.kopf nav { display: flex; gap: 1rem; align-items: center; }
.kopf nav a { text-decoration: none; }
.kopf form { margin: 0; }

/* Bausteine */
.karte {
  background: var(--karte); border: 1px solid var(--linie); border-radius: 10px;
  padding: 1rem 1.25rem; margin-bottom: 1rem; overflow-x: auto;
}
.karte.schmal { max-width: 380px; margin: 3rem auto; }
details > summary { cursor: pointer; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary h2 { display: inline; }
details > summary::before { content: "▸ "; color: var(--dezent); }
details[open] > summary::before { content: "▾ "; }
details[open] > summary { margin-bottom: .75rem; }
.meldung { padding: .6rem .9rem; border-radius: 8px; border-left: 4px solid var(--erfolg-rand); background: var(--erfolg); }
.meldung.error { border-color: var(--fehler); background: var(--warn-bg); }
.liste { margin: 0; padding-left: 1.25rem; }

label { display: block; margin-bottom: .75rem; font-weight: 500; }
input {
  display: block; width: 100%; margin-top: .25rem; padding: .55rem .7rem; font: inherit;
  color: var(--text); background: var(--eingabe); border: 1px solid var(--eingabe-rand); border-radius: 8px;
}
.zeile { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.zeile label { flex: 1 1 12rem; margin: 0; }
.zeile input { margin-top: .25rem; }

.knopf {
  display: inline-block; padding: .6rem 1.1rem; border: 1px solid var(--akzent); border-radius: 8px;
  background: var(--akzent); color: var(--akzent-text); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer; text-align: center;
}
.knopf.zweit { background: transparent; color: var(--akzent); }
.knopf.voll { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--akzent); cursor: pointer; }
button.link.fehler { color: var(--fehler); }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--linie); white-space: nowrap; }
th { font-size: .85rem; color: var(--dezent); font-weight: 600; }
.zahl { text-align: right; font-variant-numeric: tabular-nums; }

.titelzeile { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin-bottom: .75rem; }
.monate { display: flex; gap: .5rem; }
.gross { display: block; font-size: 2rem; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.kennzahlen { display: flex; flex-wrap: wrap; gap: 2rem; margin-bottom: 1rem; }
.kennzahlen small, .kachel small { color: var(--dezent); }

.kacheln { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem; }
.kachel {
  display: block; padding: 1rem; border: 1px solid var(--linie); border-radius: 10px;
  text-decoration: none; color: var(--text); background: var(--gezaehlt);
}

/* Summe und schematischer Plan */
.summe { text-align: right; }
.summe span { display: block; font-size: 3rem; font-weight: 800; line-height: 1; color: var(--akzent); font-variant-numeric: tabular-nums; }
.summe small { color: var(--dezent); }

/* Schaubild nach dem Grundriss: Säle und Sektoren liegen in Prozent darauf. */
.plan {
  position: relative; aspect-ratio: 155 / 100; margin-bottom: 1rem; container-type: inline-size;
  background: var(--karte); border: 1px solid var(--linie); border-radius: 10px;
}
.saal { position: absolute; border: 2px solid var(--dezent); border-radius: 4px; }
.saal-name {
  position: absolute; left: 1cqw; bottom: .5cqw; font-size: clamp(.65rem, 2.2cqw, 1rem);
  font-weight: 700; color: var(--dezent); pointer-events: none;
}
.saal-summe { color: var(--text); margin-left: .3em; }
.buehne {
  position: absolute; display: flex; align-items: center; justify-content: center;
  background: repeating-linear-gradient(45deg, var(--linie) 0 6px, transparent 6px 12px);
  border: 1px solid var(--linie); color: var(--dezent); font-size: clamp(.6rem, 1.8cqw, .9rem);
}
.sektor {
  position: absolute; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 0; border: 2px dashed var(--eingabe-rand); border-radius: 6px; background: var(--karte);
  text-decoration: none; color: var(--text); text-align: center; overflow: hidden; font: inherit;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.sektor.gezaehlt { border-style: solid; border-color: var(--akzent); background: var(--gezaehlt); }
.sektor.offen { border-style: solid; border-color: var(--offen-rand); background: var(--offen); }
.sektor.aktiv { box-shadow: 0 0 0 3px var(--text); z-index: 1; }
.sektor .nr { font-size: clamp(.6rem, 2cqw, .95rem); font-weight: 700; color: var(--dezent); line-height: 1; }
.sektor .wert { font-size: clamp(1rem, 5cqw, 2.4rem); font-weight: 800; line-height: 1.05; font-variant-numeric: tabular-nums; }
.sektor .info { font-size: clamp(.5rem, 1.5cqw, .75rem); color: var(--dezent); line-height: 1.1; padding: 0 2px; }
@container (max-width: 420px) { .sektor .info { display: none; } }
.gross-knopf { padding: .9rem; font-size: 1.15rem; }

/* Zählseite: alles auf einen Bildschirm, großes Tippfeld */
.zaehlseite .kopf, .zaehlseite .fuss { display: none; }
.zaehlseite main { padding: .5rem .75rem calc(.75rem + env(safe-area-inset-bottom)); max-width: 760px; }
.zaehler { display: flex; flex-direction: column; gap: .6rem; min-height: calc(100dvh - 1.25rem); }
.zaehler .plan { margin: 0; }
.zaehler .meldung { margin: 0; }
.zaehler-kopf { display: flex; gap: .75rem; align-items: center; justify-content: space-between; font-size: .9rem; }
.kopf-summe b { font-size: 1.2rem; color: var(--akzent); }
.zurueck { white-space: nowrap; text-decoration: none; font-weight: 600; }
.tippfeld {
  flex: 1; min-height: 38vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 18px; background: var(--akzent); color: var(--akzent-text); font: inherit;
  cursor: pointer; touch-action: manipulation; user-select: none; -webkit-user-select: none;
  -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent;
}
.tippfeld.inaktiv { background: var(--linie); color: var(--dezent); }
.tipp-sektor { font-size: 1.1rem; font-weight: 600; }
.tippfeld .stand { font-size: clamp(4.5rem, 24vw, 9rem); font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tippfeld .hinweis { opacity: .85; margin-top: .5rem; }
.tippfeld.blitz { animation: blitz .18s ease-out; }
@keyframes blitz { from { filter: brightness(1.35); transform: scale(.985); } to { filter: none; transform: none; } }
.zaehler-leiste { display: grid; grid-template-columns: 1fr 1.4fr 1.6fr; gap: .5rem; }
.zaehler-leiste .knopf { padding: .9rem .5rem; font-size: 1.05rem; }
.eingabe summary { color: var(--akzent); }
.eingabe .zeile input { flex: 1; margin: 0; }
