:root {
  --nacht: #0f2433;
  --nacht-2: #17384d;
  --gold: #e3b341;
  --papier: #f4f6f8;
  --karte: #ffffff;
  --text: #15232d;
  --leise: #5b6b77;
  --linie: #dde3e8;
  --gruen: #1f7a4d;
  --rot: #b4372f;
  --rand: clamp(16px, 3vw, 48px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 17px; line-height: 1.5; color: var(--text); background: var(--papier);
}
h1, h2, h3 { line-height: 1.15; margin: 0; }
a { color: inherit; }
.kicker { margin: 0 0 6px; font-size: 13px; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); font-weight: 700; }

/* ---------- Startseite mit Code ---------- */
.start { background: radial-gradient(1200px 600px at 20% 0%, var(--nacht-2), var(--nacht)); }
.tor { flex: 1; display: grid; place-items: center; padding: 48px var(--rand); }
.tor-karte {
  width: min(100%, 640px); background: var(--karte); border-radius: 18px; padding: clamp(24px, 4vw, 48px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .35);
}
.tor-karte h1 { font-size: clamp(28px, 4vw, 40px); margin-bottom: 12px; }
.tor-karte p { color: var(--leise); }
.code-form { margin-top: 24px; }
.code-form label { display: block; font-weight: 700; margin-bottom: 8px; }
.code-zeile { display: flex; gap: 10px; }
.code-zeile input {
  flex: 1; min-width: 0; font-size: 26px; letter-spacing: .25em; text-transform: uppercase; padding: 14px 16px;
  border: 2px solid var(--linie); border-radius: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.code-zeile input:focus { outline: none; border-color: var(--nacht-2); }
button { font: inherit; cursor: pointer; }
.code-zeile button {
  font-size: 18px; font-weight: 700; padding: 0 26px; border: 0; border-radius: 12px; background: var(--nacht); color: #fff;
}
.code-zeile button:hover { background: var(--nacht-2); }
.fehler { color: var(--rot) !important; font-weight: 600; }
.hinweis { font-size: 15px; }

/* ---------- Kundenbereich ---------- */
.kopf { background: var(--nacht); color: #fff; padding: 32px var(--rand) 24px; position: sticky; top: 0; z-index: 5; box-shadow: 0 6px 24px rgba(0,0,0,.18); }
.kopf-innen { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.kopf h1 { font-size: clamp(26px, 3.4vw, 40px); }
.stand { margin: 0; color: #b9c7d1; font-size: 15px; }
.suche-rahmen { margin-top: 18px; }
#suche {
  width: 100%; font-size: clamp(20px, 2.4vw, 28px); padding: 16px 20px; border-radius: 14px; border: 0;
  background: #fff; color: var(--text); box-shadow: inset 0 0 0 3px transparent;
}
#suche:focus { outline: none; box-shadow: inset 0 0 0 3px var(--gold); }
.filter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; align-items: center; }
.chip {
  border: 1px solid #3c5a6e; background: transparent; color: #dce6ec; padding: 6px 14px; border-radius: 999px; font-size: 15px;
}
.chip:hover { border-color: var(--gold); }
.chip.aktiv { background: var(--gold); border-color: var(--gold); color: var(--nacht); font-weight: 700; }
.trenner { width: 1px; height: 24px; background: #3c5a6e; margin: 0 6px; }

.inhalt { flex: 1; padding: 28px var(--rand) 56px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; }
.inhalt > * { min-width: 0; }
.abschnitt-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.abschnitt-kopf h2 { font-size: 24px; }
.zaehler { margin: 0; color: var(--leise); }

.treffer-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.treffer-karte { background: var(--karte); border-radius: 14px; padding: 18px 20px; border: 2px solid var(--gold); box-shadow: 0 6px 18px rgba(15,36,51,.08); }
.treffer-titel { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; margin-bottom: 10px; }
.treffer-titel h3 { font-size: 21px; }
.frequenz-zeile { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; padding: 6px 0; border-top: 1px solid var(--linie); }
.frequenz-zeile .mhz { font-size: 28px; font-weight: 800; color: var(--nacht); }
.param { color: var(--leise); font-size: 15px; }
.gruppe { margin: 8px 0 0; font-size: 14px; color: var(--leise); }

.frequenzen { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.freq-karte { background: var(--karte); border-radius: 14px; border: 1px solid var(--linie); overflow: hidden; }
.freq-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 12px 16px; background: #eaf0f4; }
.freq-kopf .mhz { font-size: 22px; font-weight: 800; color: var(--nacht); }
.programme { list-style: none; margin: 0; padding: 6px 16px 12px; }
.programme li { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--linie); }
.programme li:last-child { border-bottom: 0; }
.marken { display: inline-flex; gap: 4px; flex-shrink: 0; }
.marke { font-size: 11px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; align-self: center; }
.marke.hd { background: #e1edf6; color: #1d4f73; }
.marke.radio { background: #eaf4ec; color: var(--gruen); }
.marke.karte { background: #fbe9e7; color: var(--rot); }

.hilfe h2 { font-size: 24px; margin-bottom: 14px; }
.hilfe-raster { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.hilfe-karte { background: var(--karte); border-radius: 14px; padding: 18px 20px; border: 1px solid var(--linie); }
.hilfe-karte h3 { font-size: 18px; margin-bottom: 6px; }
.hilfe-karte p { margin: 0; color: #33434e; }

/* ---------- Textseiten ---------- */
.textseite { flex: 1; padding: 40px var(--rand) 56px; }
.textseite .blatt { background: var(--karte); border-radius: 16px; padding: clamp(20px, 3vw, 40px); border: 1px solid var(--linie); }
.textseite h1 { font-size: 32px; margin-bottom: 18px; }
.textseite h2 { font-size: 20px; margin: 22px 0 6px; }
.spalten { columns: 2 380px; column-gap: 40px; }
.spalten > * { break-inside: avoid; }
.zurueck { display: inline-block; margin-bottom: 16px; color: var(--leise); }

/* ---------- Technik ---------- */
.technik-tabelle { width: 100%; border-collapse: collapse; background: var(--karte); font-size: 15px; }
.technik-tabelle th, .technik-tabelle td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.technik-tabelle th { background: #eaf0f4; position: sticky; top: 0; }
.technik-tabelle .warn { color: var(--rot); font-weight: 700; }
.technik-tabelle .klein { color: var(--leise); font-size: 13px; }
.tabelle-rahmen { overflow-x: auto; border-radius: 14px; border: 1px solid var(--linie); }
.kasten { background: #fff8e6; border: 1px solid #f0d58a; border-radius: 14px; padding: 16px 20px; }
.kasten ul { margin: 6px 0 0; padding-left: 20px; }

.t-suche { width: 100%; font-size: 20px; padding: 12px 16px; border-radius: 12px; border: 2px solid var(--linie); margin-bottom: 14px; }
.t-suche:focus { outline: none; border-color: var(--nacht-2); }
.dienst.treffer { background: var(--gold); color: var(--nacht); font-weight: 700; border-radius: 4px; padding: 0 3px; }

.band { --q64: #2a78d6; --q256: #eb6834; }
.band-legende { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 10px; color: var(--leise); font-size: 14px; align-items: center; }
.band-legende span { display: inline-flex; align-items: center; gap: 6px; }
.band-legende i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.q64 { background: var(--q64); }
.q256 { background: var(--q256); }
.qnull { background: repeating-linear-gradient(45deg, #9aa7b1 0 3px, #d7dee3 3px 6px); }
.band-rahmen { background: var(--karte); border: 1px solid var(--linie); border-radius: 14px; padding: 16px 12px 8px; overflow-x: auto; }
.band-raster { display: grid; grid-template-columns: repeat(var(--spalten), minmax(26px, 1fr)); gap: 2px; min-width: calc(var(--spalten) * 28px); height: 220px; align-items: end; }
.band-spalte { position: relative; display: flex; flex-direction: column; align-items: center; height: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; }
button.band-spalte { cursor: pointer; }
button.band-spalte:hover .band-saeule, button.band-spalte:focus-visible .band-saeule { background: #eef3f6; }
.band-saeule { flex: 1; width: 100%; display: flex; align-items: flex-end; border-bottom: 1px solid var(--linie); border-radius: 4px 4px 0 0; }
.band-balken { width: 100%; border-radius: 4px 4px 0 0; }
.band-spalte.frei .band-saeule { border-bottom-style: dashed; }
.band-spalte.luecke .band-saeule { border-bottom-color: transparent; }
.band-mhz { font-size: 11px; color: var(--leise); margin-top: 4px; writing-mode: vertical-rl; transform: rotate(180deg); height: 30px; }
.fehler-zeichen { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--rot); color: #fff; font-size: 12px; font-weight: 800; }
.band-spalte .fehler-zeichen { position: absolute; top: -4px; z-index: 1; }
.band-tip { position: absolute; z-index: 20; background: var(--nacht); color: #fff; font-size: 14px; padding: 8px 12px; border-radius: 8px; pointer-events: none; max-width: 360px; box-shadow: 0 8px 20px rgba(0,0,0,.25); }

.band-saeule.stapel { flex-direction: column-reverse; justify-content: flex-start; gap: 2px; }
.band-saeule.stapel .band-balken { border-radius: 0; }
.band-saeule.stapel .band-balken:last-child { border-radius: 4px 4px 0 0; }
.kunden-band .band-raster { height: 180px; }
@keyframes blink { 0% { box-shadow: 0 0 0 4px var(--gold); } 100% { box-shadow: 0 0 0 0 transparent; } }
.freq-karte.blink { animation: blink 1.6s ease-out; }

/* ---------- Fuss ---------- */
.fuss { background: var(--nacht); color: #b9c7d1; font-size: 14px; }
.start .fuss { background: transparent; }
.fuss-innen { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px var(--rand); }
.fuss nav { display: flex; gap: 18px; }
.fuss a { color: #dce6ec; text-decoration: none; }
.fuss a:hover { text-decoration: underline; }

@media (max-width: 760px) {
  .tabelle-rahmen { overflow: visible; border: 0; }
  .technik-tabelle, .technik-tabelle tbody, .technik-tabelle tr, .technik-tabelle td { display: block; width: 100%; }
  .technik-tabelle { background: none; }
  .technik-tabelle thead { display: none; }
  .technik-tabelle tr { background: var(--karte); border: 1px solid var(--linie); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
  .technik-tabelle tr[hidden] { display: none; }
  .technik-tabelle td { border: 0; padding: 4px 14px; display: grid; grid-template-columns: 96px 1fr; gap: 8px; }
  .technik-tabelle td::before { content: attr(data-label); color: var(--leise); font-size: 13px; font-weight: 600; }
  .technik-tabelle td.t-mhz { display: block; background: #eaf0f4; padding: 10px 14px; font-size: 20px; margin-bottom: 4px; }
  .technik-tabelle td.t-mhz::before { content: none; }
  .technik-tabelle td.t-dienste { display: block; padding-bottom: 12px; }
  .technik-tabelle td.t-dienste::before { display: block; margin-bottom: 2px; }
}
@media (max-width: 640px) {
  .kopf { position: static; }
  .code-zeile { flex-direction: column; }
  .code-zeile input { width: 100%; flex: none; letter-spacing: .18em; }
  .fuss-innen { flex-direction: column; gap: 8px; }
  .code-zeile button { padding: 14px; }
}
