:root {
  color-scheme: light;
  --seite: #f9f9f7;
  --flaeche: #fcfcfb;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #6f6e69;
  --gitter: #e1e0d9;
  --achse: #c3c2b7;
  --rand: rgba(11, 11, 11, 0.10);
  --kauf: #2a78d6;
  --verkauf: #eb6834;
  --sonstiges: #898781;
  --kurs: #52514e;
  --hinweis: #f0efec;
  --link: #1c5cab;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --seite: #0d0d0d;
    --flaeche: #1a1a19;
    --text: #f0efec;
    --text-2: #c3c2b7;
    --text-3: #9a9890;
    --gitter: #2c2c2a;
    --achse: #383835;
    --rand: rgba(255, 255, 255, 0.10);
    --kauf: #3987e5;
    --verkauf: #d95926;
    --kurs: #c3c2b7;
    --hinweis: #262624;
    --link: #86b6ef;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--seite);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
main, header.kopf, footer { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

.hinweisband {
  background: var(--hinweis);
  color: var(--text-2);
  font-size: 13px;
  text-align: center;
  padding: 6px 16px;
}
header.kopf { padding-top: 28px; padding-bottom: 8px; }
header.kopf .marke { font-weight: 600; color: var(--text-2); font-size: 14px; }
h1 { font-size: 28px; line-height: 1.2; margin: 4px 0 6px; font-weight: 650; }
h2 { font-size: 19px; margin: 0 0 4px; font-weight: 620; }
.unterzeile { color: var(--text-2); margin: 0; max-width: 760px; }
.stand { color: var(--text-3); font-size: 13px; margin-top: 8px; }

section.karte {
  background: var(--flaeche);
  border: 1px solid var(--rand);
  border-radius: 12px;
  padding: 20px;
  margin: 16px 0;
}
.karte .erklaerung { color: var(--text-2); font-size: 14px; margin: 0 0 14px; max-width: 760px; }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 16px 0; }
.kachel { background: var(--flaeche); border: 1px solid var(--rand); border-radius: 12px; padding: 14px 16px; }
.kachel .label { color: var(--text-2); font-size: 13px; }
.kachel .wert { font-size: 26px; font-weight: 620; margin: 2px 0; }
.kachel .zusatz { color: var(--text-3); font-size: 12px; }

/* Diagramme */
.diagramm { position: relative; width: 100%; }
.diagramm svg { display: block; width: 100%; overflow: visible; }
.diagramm .gitter { stroke: var(--gitter); stroke-width: 1; }
.diagramm .achse { stroke: var(--achse); stroke-width: 1; }
.diagramm .null { stroke: var(--achse); stroke-width: 1; }
.diagramm text { fill: var(--text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
.diagramm text.stark { fill: var(--text-2); }
.diagramm .linie { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.diagramm .fadenkreuz { stroke: var(--achse); stroke-width: 1; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--flaeche); border: 1px solid var(--rand); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  padding: 8px 10px; font-size: 13px; min-width: 150px; max-width: 280px;
}
.tooltip .titel { color: var(--text-2); margin-bottom: 4px; }
.tooltip .zeile { display: flex; align-items: center; gap: 8px; }
.tooltip .zeile b { font-variant-numeric: tabular-nums; }
.tooltip .zeile span { color: var(--text-2); }
.tooltip .klein { color: var(--text-3); font-size: 12px; }
.strich { display: inline-block; width: 12px; height: 2px; border-radius: 1px; flex: none; }
.punkt { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.punkt.hohl { background: transparent !important; border: 2px solid; width: 9px; height: 9px; }

.legende { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.legende span { display: inline-flex; align-items: center; gap: 6px; }

/* Filter und Tabellen */
.filter { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.knopfgruppe { display: inline-flex; border: 1px solid var(--rand); border-radius: 8px; overflow: hidden; }
.knopfgruppe button, button.knopf {
  font: inherit; font-size: 13px; color: var(--text-2); background: transparent;
  border: 0; padding: 6px 12px; cursor: pointer;
}
.knopfgruppe button + button { border-left: 1px solid var(--rand); }
.knopfgruppe button[aria-pressed="true"] { background: var(--hinweis); color: var(--text); font-weight: 600; }
button.knopf { border: 1px solid var(--rand); border-radius: 8px; }
button.knopf:hover, .knopfgruppe button:hover { background: var(--hinweis); }
label.schalter { font-size: 13px; color: var(--text-2); display: inline-flex; gap: 6px; align-items: center; }
input[type="search"] {
  font: inherit; font-size: 14px; color: var(--text); background: var(--flaeche);
  border: 1px solid var(--rand); border-radius: 8px; padding: 7px 10px; width: 100%; max-width: 320px;
}

.tabelle-rahmen { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--text-2); font-size: 12px; padding: 6px 8px; border-bottom: 1px solid var(--achse); white-space: nowrap; }
td { padding: 7px 8px; border-bottom: 1px solid var(--gitter); vertical-align: top; }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.datum { white-space: nowrap; color: var(--text-2); font-variant-numeric: tabular-nums; }
td .klein, .klein { color: var(--text-3); font-size: 12px; }
.art { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.positiv { color: #006300; }
.negativ { color: #b8322f; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .positiv { color: #0ca30c; }
  :root:not([data-theme="light"]) .negativ { color: #e66767; }
}
.mehr { margin-top: 10px; }
details summary { cursor: pointer; color: var(--text-2); font-size: 13px; margin-top: 12px; }

/* Cluster und Firmenliste */
.cluster-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.cluster { border: 1px solid var(--rand); border-radius: 10px; padding: 12px 14px; }
.cluster .name { font-weight: 600; }
.cluster .zeitraum { color: var(--text-2); font-size: 13px; }
.cluster .betrag { font-size: 20px; font-weight: 620; margin: 4px 0; }
.cluster .personen { color: var(--text-3); font-size: 12px; }
.firmen-liste { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; margin-top: 12px; }
.firmen-liste a { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--gitter); }
.firmen-liste .klein { white-space: nowrap; }
.leer { color: var(--text-3); font-size: 14px; }

.zweispaltig { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .zweispaltig { grid-template-columns: 1fr; } h1 { font-size: 24px; } }

footer { color: var(--text-3); font-size: 13px; padding-top: 12px; padding-bottom: 40px; }
footer p { margin: 4px 0; }
.text-seite h2 { margin-top: 22px; }
.text-seite p, .text-seite li { color: var(--text-2); max-width: 760px; }
.platzhalter { background: var(--hinweis); border-radius: 4px; padding: 0 4px; }
