* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--text-body); font-variant-numeric: tabular-nums; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font: var(--text-title); }
h2 { font: var(--text-heading); }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
main:focus { outline: none; }
.wert { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sekundaer { color: var(--text-2); }

.sprung { position: absolute; left: -999px; }
.sprung:focus { left: 8px; top: 8px; z-index: 5; background: var(--bg); padding: var(--space-3) var(--space-5); border-radius: var(--radius-1); }

/* Gerüst */
.geruest { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100dvh; }
.seite { background: var(--bg-side); border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: var(--space-4); gap: var(--space-4); }
.gemeinde { font-weight: 600; padding: var(--space-3) var(--space-4); min-height: var(--control); display: flex; align-items: center; }
.gemeindewahl { width: 100%; min-height: var(--control); background: transparent; border: 1px solid var(--line-field); border-radius: var(--radius-1); padding: 0 var(--space-3); font-weight: 600; }
.navi { display: flex; flex-direction: column; gap: 1px; flex: 1; min-height: 0; overflow: auto; }
.navi a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: var(--control); padding: 0 var(--space-4); border-radius: var(--radius-2); color: var(--text-2); text-decoration: none; transition: background-color var(--fast) var(--ease); }
.navi a:hover { background: var(--bg-hover); }
.navi a[aria-current='page'] { background: var(--bg-selected); color: var(--text); font-weight: 500; }
.navi .trenner { height: 1px; background: var(--line); margin: var(--space-4) 0; flex: none; }
.navi .anzahl { color: var(--text-2); font-weight: 400; }
.konto { position: relative; }
.konto-knopf { width: 100%; min-height: var(--control); text-align: left; background: none; border: 0; border-radius: var(--radius-2); padding: 0 var(--space-4); cursor: pointer; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.konto-knopf:hover { background: var(--bg-hover); }
.menue { position: absolute; bottom: calc(100% + var(--space-2)); left: 0; width: 100%; min-width: 200px; background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius-2); box-shadow: var(--shadow-pop); padding: var(--space-2); z-index: 4; display: grid; gap: 1px; }
.menue button { background: none; border: 0; border-radius: var(--radius-1); min-height: var(--control); text-align: left; padding: 0 var(--space-4); cursor: pointer; }
.menue button:hover { background: var(--bg-hover); }
.menue .gruppe { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; border-block: 1px solid var(--line); padding-block: var(--space-2); margin-block: var(--space-1); }
.menue .gruppe button { text-align: center; padding: 0; }
.menue .gruppe button[aria-pressed='true'] { background: var(--bg-selected); font-weight: 500; }
.menue .email { color: var(--text-2); padding: var(--space-3) var(--space-4); overflow-wrap: anywhere; font: var(--text-small); }

.haupt { min-width: 0; display: flex; flex-direction: column; padding-bottom: 44px; }
.kopf { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-5); min-height: 48px; padding: var(--space-3) var(--space-7); border-bottom: 1px solid var(--line); }
.kopf h1 { min-width: 0; overflow-wrap: anywhere; }
.kopf .aktionen { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); }
.pfad { color: var(--text-2); font-weight: 400; text-decoration: none; }
.pfad:hover { text-decoration: underline; }
.pfad-trenner { color: var(--text-2); font-weight: 400; padding-inline: var(--space-2); }
.inhalt { padding: var(--space-6) var(--space-7) var(--space-8); }

/* Knöpfe */
.knopf { display: inline-flex; align-items: center; justify-content: center; min-height: var(--control); padding: 0 var(--space-5); border-radius: var(--radius-1); border: 1px solid var(--line-field); background: transparent; font-weight: 500; cursor: pointer; text-decoration: none; color: var(--text); white-space: nowrap; transition: background-color var(--fast) var(--ease); }
.knopf:hover { background: var(--bg-hover); }
.knopf.primaer { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.knopf.primaer:hover { background: var(--accent); filter: brightness(.92); }
.knopf.schlicht { border-color: transparent; color: var(--text-2); }
.knopf.gefahr { color: var(--error); }
.knopf.gefahr-flaeche { background: var(--error); border-color: var(--error); color: var(--bg); }
.knopf[disabled] { color: var(--text-3); cursor: default; }

/* Filter, Tabellen */
.filter { display: flex; gap: var(--space-2); margin-bottom: var(--space-5); }
.filter button { min-height: var(--control-sm); padding: 0 var(--space-5); border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--text-2); cursor: pointer; }
.filter button[aria-pressed='true'] { background: var(--bg-selected); border-color: transparent; color: var(--text); font-weight: 500; }
.tabelle { width: 100%; border-collapse: collapse; }
.tabelle th { font: var(--text-small); font-weight: 500; color: var(--text-2); text-align: left; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabelle td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--line); height: var(--row); vertical-align: middle; }
.tabelle td.titel { overflow-wrap: anywhere; font-weight: 500; }
.tabelle td.titel a { color: var(--text); text-decoration: none; }
.tabelle td.titel a:hover { text-decoration: underline; }
.tabelle tbody tr[data-klick] { cursor: pointer; transition: background-color var(--fast) var(--ease); }
.tabelle tbody tr[data-klick]:hover { background: var(--bg-hover); }
.tabelle .gruppe-kopf td { font-weight: 600; color: var(--text-2); padding-top: var(--space-6); border-bottom: 1px solid var(--line); }
.tabelle .schmal-info { display: none; color: var(--text-2); font: var(--text-small); font-weight: 400; margin-top: var(--space-1); }
.tabelle .rechts { text-align: right; }
.abschnitt { margin-top: var(--space-7); }
.abschnitt h2 { margin-bottom: var(--space-3); }
.leer { padding: var(--space-5) 0; color: var(--text-2); display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }

/* Status */
.status { display: inline-flex; align-items: baseline; gap: var(--space-3); white-space: nowrap; }
.status .zeichen { font-size: 9px; line-height: 1; }
.status.ok .zeichen { color: var(--ok); }
.status.warn .zeichen { color: var(--warn); }
.status.fehler .zeichen { color: var(--error); }
.status.aus .zeichen { color: var(--text-3); }
.status.fehler { color: var(--error); }
.status.warn { color: var(--warn); }

/* Systemstatus */
.system { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; max-width: 760px; }
.system .name { padding-right: var(--space-7); }
.system > * { min-height: var(--row); display: flex; align-items: center; padding-block: var(--space-2); border-bottom: 1px solid var(--line); }
.system .name { font-weight: 500; }
.system .wert-zelle { overflow-wrap: anywhere; min-width: 0; }
.system .wert-zelle .status { white-space: normal; }

/* Banner */
.banner { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4) var(--space-5); border-left: 3px solid var(--error); background: var(--bg-side); padding: var(--space-4) var(--space-5); margin-bottom: var(--space-5); }
.banner.warn { border-left-color: var(--warn); }
.banner.neutral { border-left-color: var(--line-field); }
.banner p { flex: 1 1 240px; }
.banner .knopf { max-width: 100%; height: auto; min-height: var(--control); white-space: normal; text-align: left; }
.gesamtfehler:focus, .gesamtfehler:focus-visible { outline: none; }
.vergleich { table-layout: fixed; max-width: 760px; margin-bottom: var(--space-6); }
.vergleich caption { font: var(--text-heading); text-align: left; padding-block: var(--space-4); }
.vergleich th[scope="row"] { font: var(--text-body); font-weight: 500; color: var(--text); white-space: normal; }
.vergleich th, .vergleich td { overflow-wrap: anywhere; vertical-align: top; white-space: pre-line; }
.vergleich img { display: block; max-width: 100%; max-height: 96px; }
.vergleich-knoepfe { display: flex; flex-wrap: wrap; gap: var(--space-4); }

/* Bearbeiten */
.bearbeiten { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-7); align-items: start; }
.formular { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); max-width: 560px; }
.feld { display: grid; gap: var(--space-2); }
.feld > label, .feld > .label { font-weight: 500; }
.feld .optional { color: var(--text-2); font-weight: 400; }
.feld small, .formular small { font: var(--text-small); color: var(--text-2); }
.feld input:not([type='checkbox']):not([type='file']), .feld select, .feld textarea { width: 100%; min-height: var(--control); padding: 0 var(--space-4); background: transparent; border: 1px solid var(--line-field); border-radius: var(--radius-1); }
.feld textarea { min-height: 84px; padding-block: var(--space-3); resize: vertical; }
.feld .fehler { font: var(--text-small); color: var(--error); }
.feld [aria-invalid='true'] { border-color: var(--error) !important; }
.schalter { display: grid; grid-template-columns: 16px 1fr; gap: var(--space-1) var(--space-4); align-items: start; cursor: pointer; }
.schalter input { width: 14px; height: 14px; margin: 2px 0 0; accent-color: var(--accent); }
.schalter span { font-weight: 500; }
.schalter small { grid-column: 2; }
.bildwahl { display: flex; flex-wrap: wrap; gap: var(--space-5); align-items: center; }
.bildwahl input { max-width: 100%; }
.bildwahl img { width: 96px; height: 64px; object-fit: cover; border-radius: var(--radius-1); }
.zweier { display: grid; gap: var(--space-5); grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.warnzeile { color: var(--warn); }
.nurlesen { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0 var(--space-6); max-width: 760px; }
.nurlesen dt, .nurlesen dd { padding-block: var(--space-3); border-bottom: 1px solid var(--line); overflow-wrap: anywhere; white-space: pre-line; min-width: 0; }
.nurlesen dt { font-weight: 500; }

/* Inspector und Vorschau in den Farben der Gemeinde (Daten, keine Oberfläche) */
.inspector { position: sticky; top: var(--space-6); display: grid; gap: var(--space-5); }
.inspector h2 { font: var(--text-small); font-weight: 500; color: var(--text-2); }
.vorschau-flaeche { background: var(--data-hintergrund); color: #1c1b19; border-radius: var(--radius-2); padding: var(--space-6); overflow: hidden; }
.v-karte { background: #fff; border-radius: var(--radius-2); overflow: hidden; }
.v-bild { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.v-bild-leer { aspect-ratio: 16/9; background: var(--data-linie); }
.v-text { padding: var(--space-5); display: grid; gap: var(--space-2); overflow-wrap: anywhere; }
.v-datum { color: var(--data-haupt); font-weight: 600; }
.v-titel { font: var(--text-heading); color: var(--data-haupt-dunkel); }
.v-format { justify-self: start; background: var(--data-akzent); color: #1c1b19; padding: 0 var(--space-3); border-radius: var(--radius-1); font: var(--text-micro); line-height: 18px; }
.v-knopf { justify-self: start; background: var(--data-haupt); color: #fff; padding: var(--space-1) var(--space-4); border-radius: var(--radius-1); margin-top: var(--space-2); }
.v-frage summary { font-weight: 600; }
.v-frage p { margin-top: var(--space-3); overflow-wrap: anywhere; white-space: pre-line; }
.v-footer { background: var(--data-haupt-dunkel); color: #fff; border-radius: var(--radius-2); padding: var(--space-6); display: grid; gap: var(--space-5); overflow-wrap: anywhere; }
.v-footer h3 { font: var(--text-heading); color: var(--data-akzent); }
.v-footer p { white-space: pre-line; }
.erscheint { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); }
.seitenzeile { display: grid; gap: var(--space-2); }

/* Statusleiste */
.leiste { position: fixed; left: var(--sidebar); right: 0; bottom: 0; display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-5); min-height: 28px; padding: var(--space-2) var(--space-7); background: var(--bg-side); border-top: 1px solid var(--line); z-index: 3; }
.leiste button { background: none; border: 0; color: var(--accent); cursor: pointer; font-weight: 500; padding: 0; min-height: 20px; }
.leiste a { font-weight: 500; }

/* Anmelden */
.anmelden { padding: var(--space-8) var(--space-7); max-width: 520px; display: grid; gap: var(--space-6); }
.anmelden form { display: grid; gap: var(--space-5); justify-items: start; }
.anmelden .feld { width: 100%; }
.anmelden .knopfzeile { display: flex; flex-wrap: wrap; gap: var(--space-4); }
.anmelden .zustand { border-top: 1px solid var(--line); padding-top: var(--space-5); display: grid; gap: var(--space-3); }
.entwicklung { font-family: var(--font-mono); overflow-wrap: anywhere; }

/* Gerüstzeilen */
.gerueste { display: grid; gap: var(--space-2); padding: var(--space-6) var(--space-7); }
.gerueste div { height: var(--row); background: var(--bg-hover); border-radius: var(--radius-1); }

/* Dialoge */
dialog { border: 1px solid var(--line); border-radius: var(--radius-3); box-shadow: var(--shadow-pop); background: var(--bg); color: var(--text); padding: var(--space-6); max-width: min(420px, calc(100vw - 32px)); }
dialog::backdrop { background: rgb(0 0 0 / .35); }
.frage { display: grid; gap: var(--space-5); }
.frage .knopfzeile { display: flex; justify-content: flex-end; gap: var(--space-4); }

/* Bühne: die eine laute Stelle. Eigene Farbwelt aus den Gemeindefarben, Thema: ein Eintrag wandert auf die Website. */
.buehne { padding: 0; border: 0; border-radius: var(--radius-3); width: min(720px, calc(100vw - 32px)); max-width: none; background: #14110f; color: #f5f1ec; overflow: hidden; }
.buehne::backdrop { background: rgb(8 6 5 / .72); }
.b-szene { position: relative; height: 280px; overflow: hidden; background: radial-gradient(90% 120% at 15% 10%, color-mix(in srgb, var(--data-haupt) 75%, #14110f), transparent 70%), radial-gradient(70% 120% at 95% 95%, color-mix(in srgb, var(--data-akzent) 55%, #14110f), transparent 70%), #14110f; }
.b-tool, .b-site { position: absolute; top: 40px; bottom: 40px; border-radius: 10px; }
.b-tool { left: 6%; width: 34%; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .18); padding: 14px; display: grid; gap: 10px; align-content: start; }
.b-tool i { display: block; height: 10px; border-radius: 3px; background: rgb(255 255 255 / .22); }
.b-tool i:nth-child(2) { width: 70%; }
.b-tool i:nth-child(3) { width: 85%; }
.b-site { right: 6%; width: 40%; background: var(--data-hintergrund); overflow: hidden; }
.b-site b { display: block; height: 28px; background: var(--data-haupt-dunkel); }
.b-site i { display: block; height: 44px; margin: 10px 12px 0; border-radius: 6px; background: var(--data-linie); }
.b-draht { position: absolute; left: 40%; right: 46%; top: 50%; height: 2px; background: repeating-linear-gradient(90deg, var(--data-akzent) 0 6px, transparent 6px 12px); animation: b-draht 1s linear 3; }
.b-karte { position: absolute; left: 58.5%; top: 79px; width: 31.5%; height: 44px; border-radius: 6px; background: #fff; color: #1c1b19; padding: 6px 10px; font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; box-shadow: 0 8px 24px rgb(0 0 0 / .35); border-left: 4px solid var(--data-akzent); animation: b-wandern 2.4s var(--ease) both; }
.buehne.kurz .b-karte { animation-duration: 1.2s; }
.buehne.kurz .b-draht { animation-iteration-count: 1; }
.buehne.fertig .b-karte, .buehne.fertig .b-draht { animation: none; }
@keyframes b-wandern { 0%, 30% { left: 9%; top: 118px; transform: scale(.96); } 75% { transform: scale(1.06); } 100% { left: 58.5%; top: 79px; transform: scale(1); } }
@keyframes b-draht { to { background-position: 12px 0; } }
.b-unten { padding: var(--space-7); display: grid; gap: var(--space-5); background: #14110f; }
.b-unten h2 { font: 600 24px/30px var(--font-sans); }
.b-unten p { font-size: 15px; line-height: 22px; color: #d9d3cc; }
.b-system { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: var(--space-2) var(--space-6); font-size: 14px; overflow-wrap: anywhere; }
.b-system dt { font-weight: 500; color: #d9d3cc; }
.b-system dd { min-width: 0; font-family: var(--font-mono); }
.b-leiste { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-5); }
.b-punkte { display: flex; gap: var(--space-3); margin-right: auto; }
.b-punkte span { width: 8px; height: 8px; border-radius: 50%; background: rgb(255 255 255 / .28); }
.b-punkte span[aria-current='step'] { background: #ff8a4c; }
.buehne .knopf { border-color: rgb(255 255 255 / .5); color: #f5f1ec; }
.buehne .knopf:hover { background: rgb(255 255 255 / .1); }
.buehne .knopf.primaer { background: #ff8a4c; border-color: #ff8a4c; color: #14110f; }

/* Schmal und Touch */
@media (max-width: 1080px) {
  .bearbeiten { grid-template-columns: minmax(0, 1fr); }
  .inspector { position: static; max-width: 560px; }
}
@media (max-width: 760px) {
  .geruest { grid-template-columns: minmax(0, 1fr); }
  .seite { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; align-items: center; padding: var(--space-3) var(--space-6); }
  .gemeinde-box { flex: 1 1 0; min-width: 0; }
  .konto { flex: 0 1 40%; min-width: 0; }
  .navi { order: 3; flex: 1 0 100%; flex-direction: row; overflow-x: auto; }
  .navi a { flex: none; }
  .navi .trenner { display: none; }
  .menue { bottom: auto; top: calc(100% + var(--space-2)); left: auto; right: 0; }
  .kopf { padding-inline: var(--space-6); }
  .inhalt { padding-inline: var(--space-6); }
  .tabelle .neben { display: none; }
  .tabelle .schmal-info { display: block; }
  .leiste { left: 0; padding-inline: var(--space-6); }
  .system { grid-template-columns: minmax(0, 1fr) auto; }
  .system .name { grid-column: 1 / -1; border-bottom: 0; min-height: 0; padding-top: var(--space-4); }
  .zweier { grid-template-columns: minmax(0, 1fr); }
  .anmelden { padding: var(--space-7) var(--space-6); }
  .nurlesen { grid-template-columns: minmax(0, 1fr); }
  .nurlesen dt { border-bottom: 0; padding-bottom: 0; }
  .b-szene { height: 200px; }
  .b-tool, .b-site { top: 24px; bottom: 24px; }
}
@media (pointer: coarse) {
  .knopf, .navi a, .konto-knopf, .menue button, .gemeindewahl, .filter button, .leiste button { min-height: 44px; }
  .feld input:not([type='checkbox']):not([type='file']), .feld select { min-height: 44px; font-size: 16px; }
  .feld textarea { font-size: 16px; }
  .schalter input { width: 24px; height: 24px; }
  .schalter { grid-template-columns: 28px 1fr; }
  .tabelle td { height: 44px; }
}
