:root {
  color-scheme: dark;
  --bg: #0f1216;
  --flaeche: #171c23;
  --flaeche-hoch: #1e242d;
  --linie: #2a323d;
  --fg: #e9edf3;
  --mut: #8e9bad;
  --akzent: #ff8a3d;
  --warn: #f0b429;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: 64px;
}
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Kopf */
.top {
  background: linear-gradient(180deg, #151a21, var(--bg));
  border-bottom: 1px solid var(--linie);
  padding: 26px 0 0;
  margin-bottom: 28px;
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(8px);
}
.top-in { display: flex; gap: 16px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.01em; }
.sub { margin: 2px 0 0; color: var(--mut); font-size: .9rem; }
.sub strong { color: var(--fg); font-weight: 600; }
.warnzahl { color: var(--warn); }

#suche {
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--fg);
  border-radius: 10px; padding: 9px 14px; font-size: .95rem; min-width: 220px; flex: 1 1 200px; max-width: 320px;
}
#suche:focus { outline: none; border-color: var(--akzent); }

.filter { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 16px; padding-bottom: 16px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--flaeche); border: 1px solid var(--linie); color: var(--mut);
  border-radius: 999px; padding: 6px 13px; font: inherit; font-size: .85rem; cursor: pointer;
  transition: border-color .15s, color .15s;
}
.chip:hover { color: var(--fg); }
.chip.an { color: var(--fg); border-color: #4a5566; background: var(--flaeche-hoch); }
.chip i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.chip span { color: var(--mut); font-variant-numeric: tabular-nums; }

/* Gruppen */
.gruppe { margin-bottom: 38px; }
.gruppe h2 {
  font-size: .78rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--mut); margin: 0 0 14px; font-weight: 600;
}
.gruppe h2 span { color: #5d6a7d; margin-left: 4px; }
.gruppe[hidden] { display: none; }

.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Karte */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 16px 18px 14px; display: flex; flex-direction: column; gap: 9px;
  transition: border-color .15s, transform .15s;
}
.karte:hover { border-color: #3d4756; transform: translateY(-2px); }
.karte[hidden] { display: none; }

.haupt { text-decoration: none; color: inherit; display: block; }
.status {
  display: inline-block; font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  color: var(--f);
  border: 1px solid var(--linie);              /* Rueckfall fuer aeltere Browser */
  background: var(--flaeche-hoch);
  border-color: color-mix(in srgb, var(--f) 40%, transparent);
  background: color-mix(in srgb, var(--f) 12%, transparent);
  border-radius: 999px; padding: 3px 9px; margin-bottom: 9px;
}
.karte h3 { margin: 0; font-size: 1.12rem; letter-spacing: -.01em; }
.haupt:hover h3 { color: var(--akzent); }
.pfad { margin: 3px 0 0; color: var(--mut); font-size: .82rem; font-variant-numeric: tabular-nums; }

.notiz {
  margin: 0; font-size: .9rem; color: #c3ccd9;
  border-left: 2px solid var(--linie); padding-left: 10px;
}
.meta { margin: 0; color: var(--mut); font-size: .8rem; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.wer { margin-left: auto; background: var(--flaeche-hoch); border-radius: 999px; padding: 2px 9px; color: #b6c1d0; }

.hinweise { font-size: .82rem; }
.hinweise summary { cursor: pointer; color: var(--warn); list-style: none; }
.hinweise summary::-webkit-details-marker { display: none; }
.hinweise summary::before { content: "▸ "; }
.hinweise[open] summary::before { content: "▾ "; }
.hinweise ul { margin: 6px 0 0; padding-left: 18px; color: var(--mut); }

.aktionen { display: flex; gap: 7px; flex-wrap: wrap; margin-top: auto; padding-top: 5px; }
.btn {
  background: var(--flaeche-hoch); border: 1px solid var(--linie); color: var(--fg);
  border-radius: 9px; padding: 7px 13px; font: inherit; font-size: .85rem;
  cursor: pointer; text-decoration: none; display: inline-block;
  transition: border-color .15s, background .15s;
}
.btn:hover { border-color: var(--akzent); }
.btn.haupt-btn { background: var(--akzent); border-color: var(--akzent); color: #1a1207; font-weight: 600; }
.btn.haupt-btn:hover { filter: brightness(1.08); }

/* Leer + Fuss */
.leer { border: 1px dashed var(--linie); border-radius: var(--radius); padding: 40px 28px; text-align: center; }
.leer h2 { margin: 0 0 8px; font-size: 1.15rem; }
.mut { color: var(--mut); }
code { background: #0a0d11; border: 1px solid var(--linie); border-radius: 6px; padding: 2px 7px; font-size: .85em; }
.fuss { color: var(--mut); font-size: .82rem; border-top: 1px solid var(--linie); padding-top: 18px; margin-top: 10px; }

/* Modal */
.modal {
  position: fixed; inset: 0; background: rgba(6, 8, 11, .72);
  display: flex; align-items: center; justify-content: center; padding: 16px; z-index: 50;
}
.modal[hidden] { display: none; }
.box {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  padding: 24px; width: min(460px, 100%); max-height: 90vh; overflow: auto;
  display: flex; flex-direction: column; gap: 13px;
}
.box h3 { margin: 0; font-size: 1.1rem; }
.qrbox { text-align: center; align-items: center; }
.qrbox #qrBild { background: #fff; padding: 14px; border-radius: 12px; line-height: 0; }
.qrbox #qrBild svg { width: 220px; height: 220px; display: block; }
.qrbox p { margin: 0; font-size: .85rem; word-break: break-all; }

label { display: flex; flex-direction: column; gap: 5px; font-size: .82rem; color: var(--mut); }
input[type=text], input[type=url], select, textarea {
  background: var(--bg); border: 1px solid var(--linie); color: var(--fg);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: .95rem; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--akzent); }
textarea { resize: vertical; }
.reihe { display: flex; gap: 12px; }
.reihe label { flex: 1; }
.fehler { color: #ff7a7a; font-size: .85rem; margin: 0; }

@media (max-width: 520px) {
  .top { position: static; }
  .reihe { flex-direction: column; }
  #suche { max-width: none; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* Link zur Statistik-Zentrale im Kopf */
.stat-link { align-self: center; padding: 9px 14px; border-radius: 999px; background: var(--akzent); color: #1a1208; font-weight: 700; text-decoration: none; }

/* ---------- Anmeldung, Benutzerverwaltung (Cockpit live) ---------- */
input[type=email], input[type=password] {
  background: var(--bg); border: 1px solid var(--linie); color: var(--fg);
  border-radius: 9px; padding: 9px 12px; font: inherit; font-size: .95rem; width: 100%;
}
input:disabled { opacity: .55; }
body.auth { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-wrap { width: min(420px, 100%); }
.auth-marke { text-align: center; font-weight: 800; font-size: 1.15rem; letter-spacing: .02em; margin-bottom: 14px; }
.auth-marke span { color: var(--akzent); }
.auth-box { background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 26px 24px; }
.auth-box h1 { font-size: 1.3rem; margin-bottom: 14px; }
.auth-form { display: flex; flex-direction: column; gap: 13px; }
.auth-form .btn { align-self: flex-start; padding: 10px 18px; font-size: .95rem; }
.auth-links { margin: 4px 0 0; font-size: .85rem; }
.auth-links a { color: var(--mut); }
.auth-links a:hover { color: var(--fg); }
label.check { flex-direction: row; align-items: center; gap: 8px; color: var(--fg); font-size: .9rem; cursor: pointer; }
label.check input { width: auto; accent-color: var(--akzent); }
.meldung { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; font-size: .92rem; }
.meldung.fehler { background: rgba(255, 122, 122, .12); border: 1px solid rgba(255, 122, 122, .4); color: #ffb3b3; }
.meldung.ok { background: rgba(62, 207, 142, .12); border: 1px solid rgba(62, 207, 142, .4); color: #9fe8c2; }
.mut.klein { font-size: .8rem; margin: 6px 0 0; }
.kopf-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; align-self: center; }
.kopf-nav .mut { margin-right: 6px; font-size: .9rem; }
form.inline { display: inline; }
.btn.gefahr:hover { border-color: #ff7a7a; color: #ffb3b3; }
.form-karte, .link-karte { margin-bottom: 22px; }
.form-karte h3, .link-karte h3 { margin-bottom: 6px; }
.form-karte .reihe label { min-width: 0; }
.sites-wahl { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.link-code { display: block; padding: 10px 12px; word-break: break-all; font-size: .9rem; user-select: all; }
.tabelle { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); overflow: hidden; }
.tabelle th, .tabelle td { text-align: left; padding: 10px 12px; border-top: 1px solid var(--linie); vertical-align: middle; }
.tabelle th { color: var(--mut); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; border-top: 0; }
.tabelle tr.gesperrt td { opacity: .55; }
.zeilen-aktionen { white-space: nowrap; }
.zeilen-aktionen .btn { padding: 5px 10px; font-size: .8rem; margin: 2px 2px 2px 0; }
@media (max-width: 760px) {
  .tabelle thead { display: none; }
  .tabelle tr { display: block; padding: 8px 0; border-top: 1px solid var(--linie); }
  .tabelle td { display: block; border: 0; padding: 3px 12px; }
  .zeilen-aktionen { white-space: normal; }
}
