:root {
  color-scheme: light dark;
  --grund: #e9efec;
  --flaeche: #ffffff;
  --tinte: #15211d;
  --leise: #5b6c66;
  --linie: #d3ddd8;
  --band: #1e5b4c;
  --band-tinte: #f1f7f4;
  --akzent: #1e5b4c;
  --anfrage: #d9a400;
  --arbeit: #d9661f;
  --nv: #b83a32;
  --netzwerk: #2c8a5a;
  --rund: 10px;
  --schrift: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", Roboto, system-ui, sans-serif;
  --titel: "Avenir Next Condensed", "Arial Narrow", "Roboto Condensed", var(--schrift);
}
@media (prefers-color-scheme: dark) {
  :root {
    --grund: #0f1a17;
    --flaeche: #172521;
    --tinte: #e4ece8;
    --leise: #9db0a9;
    --linie: #2a3b36;
    --band: #0b3b30;
    --akzent: #6cc4a1;
    --anfrage: #f0c23a;
    --arbeit: #f08a45;
    --nv: #e5675e;
    --netzwerk: #4fbf86;
  }
}

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font: 16px/1.5 var(--schrift);
  background: var(--grund);
  color: var(--tinte);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
a { color: var(--akzent); }
:focus-visible { outline: 3px solid var(--anfrage); outline-offset: 2px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Kopf */
.kopf {
  background: var(--band);
  color: var(--band-tinte);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.75rem;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) max(1.25rem, env(safe-area-inset-right)) 1rem max(1.25rem, env(safe-area-inset-left));
}
.marke {
  font: 800 2rem/1 var(--titel);
  letter-spacing: -.02em;
  color: inherit; text-decoration: none;
}
.kopf nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }
.kopf a { color: inherit; }
.kopf nav a { text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.kopf nav a:hover, .kopf nav a[aria-current] { border-bottom-color: currentColor; }
.konto { margin-left: auto; display: flex; gap: 1rem; font-size: .9rem; opacity: .9; }
.admin-marke { background: var(--anfrage); color: #15211d; padding: 0 .5rem; border-radius: 4px; font-weight: 700; }

main { max-width: 1200px; margin: 0 auto; padding: 1.5rem max(1.25rem, env(safe-area-inset-left)); }
h1 { font: 800 1.75rem/1.2 var(--titel); margin-bottom: 1rem; }
h1 small { font: 400 1rem var(--schrift); color: var(--leise); margin-left: .5rem; }
h2 { font: 700 1.25rem/1.3 var(--titel); margin: 2rem 0 .75rem; }
p + p { margin-top: .5rem; }

/* Hinweise */
.hinweis { padding: .75rem 1rem; border-radius: var(--rund); margin-bottom: 1rem; border-left: 5px solid var(--netzwerk); background: var(--flaeche); }
.hinweis.fehler { border-left-color: var(--nv); }

/* Status-Balken und Filter */
.stand { margin-bottom: 1.25rem; }
.balken { display: flex; height: 14px; border-radius: 7px; overflow: hidden; gap: 2px; margin-bottom: .75rem; }
.balken span { min-width: 6px; }
.s-anfrage  { --s: var(--anfrage); }
.s-arbeit   { --s: var(--arbeit); }
.s-nv       { --s: var(--nv); }
.s-netzwerk { --s: var(--netzwerk); }
.balken span { background: var(--s); }

.filter { display: flex; flex-wrap: wrap; gap: .5rem; }
.filter a {
  text-decoration: none; color: var(--tinte);
  padding: .35rem .8rem; border-radius: 999px;
  background: var(--flaeche); border: 1px solid var(--linie);
}
.filter a[class]::before { content: ""; display: inline-block; width: .6em; height: .6em; border-radius: 50%; background: var(--s); margin-right: .4em; }
.filter a b { font-weight: 700; margin-left: .2em; }
.filter a[aria-current] { border-color: var(--tinte); box-shadow: inset 0 0 0 1px var(--tinte); }

/* Suche */
.suche { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.25rem; }
.suche input[type=search] { flex: 1 1 240px; }

input, select, textarea, button {
  font: inherit; color: var(--tinte);
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px;
  padding: .55rem .7rem;
}
textarea { resize: vertical; }
button {
  background: var(--band); color: var(--band-tinte); border-color: transparent;
  font-weight: 600; cursor: pointer; padding: .55rem 1.1rem;
}
button:hover { filter: brightness(1.12); }
button.gefahr { background: transparent; color: var(--nv); border-color: var(--nv); }
button.klein { padding: .25rem .6rem; font-size: .85rem; }

/* Liste */
.tabelle-rahmen { overflow-x: auto; }
.liste { width: 100%; border-collapse: separate; border-spacing: 0 6px; }
.liste th { text-align: left; font-size: .85rem; color: var(--leise); font-weight: 600; padding: 0 .75rem; }
.liste td { background: var(--flaeche); padding: .7rem .75rem; vertical-align: top; }
.liste td:first-child { border-left: 6px solid var(--s); border-radius: var(--rund) 0 0 var(--rund); }
.liste td:last-child { border-radius: 0 var(--rund) var(--rund) 0; }
.liste tr:target td { background: color-mix(in srgb, var(--s) 16%, var(--flaeche)); }
.titel strong { display: block; font-weight: 650; }
.titel span { color: var(--leise); font-size: .9rem; }
.bem { color: var(--leise); font-size: .9rem; max-width: 32ch; overflow-wrap: anywhere; }
.status {
  display: inline-block; white-space: nowrap; font-size: .85rem; font-weight: 650;
  padding: .1rem .55rem; border-radius: 999px;
  background: color-mix(in srgb, var(--s) 18%, transparent);
  color: color-mix(in srgb, var(--s) 70%, var(--tinte));
}
.aktion { white-space: nowrap; }
.leer { color: var(--leise); padding: 2rem 0; }

@media (max-width: 760px) {
  .liste thead { display: none; }
  .liste, .liste tbody, .liste tr, .liste td { display: block; }
  .liste tr {
    background: var(--flaeche); border-left: 6px solid var(--s); border-radius: var(--rund);
    margin-bottom: .6rem; padding: .7rem .9rem;
    display: grid; grid-template-columns: 1fr auto; gap: .2rem .75rem;
  }
  .liste td, .liste td:first-child, .liste td:last-child { background: none; padding: 0; border: 0; border-radius: 0; }
  .liste td.titel { grid-column: 1; }
  .liste td:nth-child(5) { grid-column: 2; grid-row: 1; text-align: right; }
  .liste td[data-l] { grid-column: 1 / -1; font-size: .85rem; color: var(--leise); display: inline; }
  .liste td[data-l]::before { content: attr(data-l) ": "; }
  .liste td.bem, .liste td.aktion { grid-column: 1 / -1; max-width: none; }
  .liste tr:target { background: color-mix(in srgb, var(--s) 16%, var(--flaeche)); }
}

/* Formulare */
.formular {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem;
  background: var(--flaeche); padding: 1.25rem; border-radius: var(--rund);
  max-width: 640px;
}
.formular.schmal { max-width: 380px; }
.formular label, .formular fieldset { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; }
.formular label small { font-weight: 400; color: var(--leise); }
.formular .breit { grid-column: 1 / -1; }
.formular input, .formular select, .formular textarea { font-weight: 400; }
.formular > button { justify-self: start; }
.klein { font-size: .85rem; color: var(--leise); font-weight: 400; }
@media (max-width: 520px) { .formular { grid-template-columns: 1fr; } }

.status-wahl { border: 0; padding: 0; flex-direction: row !important; flex-wrap: wrap; gap: .5rem !important; }
.status-wahl legend { margin-bottom: .4rem; }
.status-wahl label {
  flex-direction: row; align-items: center; gap: .4rem; font-weight: 600;
  padding: .4rem .8rem; border-radius: 999px; border: 2px solid var(--linie); cursor: pointer;
}
.status-wahl label:has(input:checked) { border-color: var(--s); background: color-mix(in srgb, var(--s) 15%, transparent); }
.status-wahl input { accent-color: var(--s); }

.knoepfe { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.knoepfe .gefahr { margin-left: auto; }

.feedback { background: var(--flaeche); border-radius: var(--rund); padding: .9rem 1rem; margin-bottom: .6rem; max-width: 640px; }
.feedback header { display: flex; gap: .75rem; align-items: baseline; margin-bottom: .3rem; }
.feedback time { color: var(--leise); font-size: .85rem; }
.feedback form { margin-top: .5rem; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
