:root {
  --text: #1f2937; --leise: #6b7280; --linie: #e5e7eb; --grund: #f5f7fa; --karte: #ffffff;
  --marke: #334155; --akzent: #1d4ed8; --gut: #15803d; --schlecht: #b91c1c; --warn: #b45309;
}
* { box-sizing: border-box; }
html { font-family: -apple-system, "Segoe UI", Helvetica, Arial, "DejaVu Sans", sans-serif; color: var(--text); background: var(--grund); }
body { margin: 0; font-size: 15px; line-height: 1.45; }
a { color: var(--akzent); }
h1 { font-size: 1.75rem; margin: 0.1rem 0 0.2rem; }
h2 { font-size: 1.15rem; margin: 2rem 0 0.8rem; }
h3 { font-size: 1.05rem; margin: 0; }
main { max-width: 1280px; margin: 0 auto; padding: 1.2rem 1.5rem 3rem; }

.kopf { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 0.7rem 1.5rem; background: var(--karte); border-bottom: 1px solid var(--linie); }
.marke { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--marke); font-weight: 700; }
.logo { display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 0.45rem; background: var(--marke); color: #fff; font-size: 0.85rem; }
.nutzer { display: flex; align-items: center; gap: 1rem; font-size: 0.9rem; }
.nutzer form { margin: 0; }
.rolle { color: var(--leise); font-size: 0.8rem; margin-left: 0.3rem; }
.textlink { text-decoration: none; }

.knopf { font: inherit; cursor: pointer; padding: 0.45rem 0.9rem; border-radius: 0.4rem; border: 1px solid var(--marke); background: var(--marke); color: #fff; text-decoration: none; display: inline-block; }
.knopf:hover { background: #1e293b; }
.knopf-leise { background: transparent; color: var(--marke); border-color: var(--linie); }
.knopf-leise:hover { background: var(--grund); }
.knopf-zweit { background: var(--karte); color: var(--marke); }
.knopf-zweit:hover { background: var(--grund); }
.knopf-gross { width: 100%; padding: 0.6rem; }

.titelzeile { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.titelaktionen { display: flex; gap: 0.8rem; align-items: center; flex-wrap: wrap; }
.brotkrumen { margin: 0; font-size: 0.9rem; }
.unterzeile { margin: 0; color: var(--leise); }

.umschalter { display: inline-flex; border: 1px solid var(--linie); border-radius: 0.5rem; background: var(--karte); overflow: hidden; }
.umschalter a { padding: 0.45rem 0.9rem; text-decoration: none; color: var(--text); border-right: 1px solid var(--linie); display: flex; align-items: center; gap: 0.4rem; }
.umschalter a:last-child { border-right: 0; }
.umschalter a:hover { background: var(--grund); }
.umschalter a.aktiv { background: var(--marke); color: #fff; font-weight: 600; }

.punkt { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #888; margin-right: 0.4rem; vertical-align: baseline; flex: none; }
.p-meta { background: #1877F2; }
.p-google_ads { background: #34A853; }
.p-matomo { background: #E8A33D; }
.punkte .punkt { margin: 0 0 0 0.25rem; }

.filter { background: var(--karte); border: 1px solid var(--linie); border-radius: 0.6rem; padding: 0.8rem 1rem; margin: 1rem 0 0.8rem; }
.filter-zeile { display: flex; flex-wrap: wrap; gap: 0.8rem 1rem; align-items: flex-end; }
.feld { display: flex; flex-direction: column; font-size: 0.8rem; color: var(--leise); gap: 0.2rem; }
.feld input, .feld select, .formular input { font: inherit; font-size: 0.95rem; color: var(--text); padding: 0.4rem 0.5rem; border: 1px solid #cbd5e1; border-radius: 0.35rem; background: #fff; }
.schnellwahl { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem; }
.chip { padding: 0.2rem 0.7rem; border: 1px solid var(--linie); border-radius: 1rem; text-decoration: none; color: var(--text); font-size: 0.85rem; background: var(--grund); }
.chip:hover { border-color: var(--marke); }
.chip-aktiv { background: var(--marke); color: #fff; border-color: var(--marke); }

.datenstand { font-size: 0.85rem; color: var(--leise); margin: 0 0 0.6rem; }
.datenstand-warnung { color: var(--warn); }
.meldung { padding: 0.6rem 0.9rem; border-radius: 0.4rem; border-left: 4px solid #94a3b8; background: #f1f5f9; margin: 0 0 0.6rem; }
.meldung-fehler { border-color: var(--schlecht); background: #fef2f2; color: #7f1d1d; }
.meldung-warnung { border-color: var(--warn); background: #fffbeb; color: #78350f; }
.meldung.klein { font-size: 0.8rem; padding: 0.3rem 0.6rem; margin: 0.5rem 0; }

.kpi-raster { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 0.8rem; }
.kpi-reihe { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 0.8rem; }
.kpi { background: var(--karte); border: 1px solid var(--linie); border-radius: 0.6rem; padding: 0.8rem 1rem; }
.kpi-label { color: var(--leise); font-size: 0.85rem; }
.kpi-wert { font-size: 1.6rem; font-weight: 700; margin: 0.1rem 0; font-variant-numeric: tabular-nums; }
.kpi-vergleich { font-size: 0.9rem; }
.kpi-kontext { font-size: 0.75rem; color: var(--leise); margin-top: 0.2rem; }
.vorher { color: var(--leise); font-size: 0.8rem; margin-left: 0.3rem; }
.aend { font-weight: 600; color: #4b5563; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aend-gut { color: var(--gut); }
.aend-schlecht { color: var(--schlecht); }
.aend-keine { color: var(--leise); }
.aend-unsicher { color: var(--warn); text-decoration: underline dotted; }
.pfeil { font-size: 0.7em; }

.kachelraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1rem; }
.ukachel { background: var(--karte); border: 1px solid var(--linie); border-radius: 0.7rem; padding: 1rem 1.1rem; display: flex; flex-direction: column; }
.ukachel:hover { border-color: #94a3b8; box-shadow: 0 1px 6px rgba(15, 23, 42, 0.08); }
.ukachel header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; }
.ukachel h3 a { text-decoration: none; color: var(--text); }
.werte { margin: 0; }
.wertzeile { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.3rem 0; border-top: 1px solid var(--linie); }
.wertzeile dt { color: var(--leise); }
.wertzeile dd { margin: 0; text-align: right; }
.wertzeile .zahl { font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 0.4rem; }
.mehr { margin-top: 0.7rem; font-size: 0.9rem; text-decoration: none; align-self: flex-start; }

.reichweite-abruf { display: flex; flex-wrap: wrap; gap: 0.6rem 1rem; align-items: center; margin: 0 0 0.8rem; font-size: 0.9rem; color: var(--leise); }

.diagrammraster { display: grid; grid-template-columns: repeat(auto-fill, minmax(420px, 1fr)); gap: 1rem; }
.diagramm { margin: 0; background: var(--karte); border: 1px solid var(--linie); border-radius: 0.6rem; padding: 0.7rem 0.8rem; }
.diagramm figcaption { font-weight: 600; margin-bottom: 0.2rem; }
.diagramm svg { width: 100%; height: auto; display: block; }
.diagramm-breit { margin-bottom: 1rem; }
.hit:hover { fill: rgba(51, 65, 85, 0.07); }

.tabellenrahmen { overflow-x: auto; background: var(--karte); border: 1px solid var(--linie); border-radius: 0.6rem; }
.tabelle { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
.tabelle th, .tabelle td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--linie); text-align: left; vertical-align: top; }
.tabelle thead th { background: #f8fafc; color: var(--leise); font-weight: 600; font-size: 0.8rem; white-space: nowrap; }
.tabelle tbody th { font-weight: 500; min-width: 220px; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle tbody tr:last-child th, .tabelle tbody tr:last-child td { border-bottom: 0; }
.klein { font-size: 0.78rem; }
.leise { color: var(--leise); display: block; font-weight: 400; }
.fussnote { color: var(--leise); font-size: 0.8rem; margin: 0.5rem 0 1rem; }

.anmeldung { max-width: 380px; margin: 4rem auto; background: var(--karte); border: 1px solid var(--linie); border-radius: 0.7rem; padding: 1.5rem 1.8rem; }
.formular { display: flex; flex-direction: column; gap: 1rem; }
.formular label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--leise); }

@media (max-width: 1000px) {
  /* Tablet: Tabellen sollen ohne Wischen passen (gemessen 820 px Breite) */
  .tabelle { font-size: 0.82rem; }
  .tabelle th, .tabelle td { padding: 0.45rem 0.5rem; }
  .tabelle tbody th { min-width: 140px; }
}
@media (max-width: 720px) {
  main { padding: 1rem; }
  .diagrammraster { grid-template-columns: 1fr; }
  .kopf { flex-wrap: wrap; }
}
@media print { .kopf, .filter, .titelaktionen { display: none; } }
