/* GZRM SEO-Dashboard
   Farben als Tokens; hell als Vorgabe, dunkel ueber prefers-color-scheme
   oder data-theme. Systemschriften, keine externen Fonts. */

:root {
  --bg: #f4f5f7;
  --bg-sub: #eceef2;
  --flaeche: #ffffff;
  --flaeche-2: #f8f9fb;
  --linie: #e1e4ea;
  --linie-stark: #c9ced8;
  --text: #1b2230;
  --text-2: #4a5468;
  --text-3: #7a8396;
  --akzent: #1f5fae;
  --akzent-hell: #e7effa;
  --akzent-text: #ffffff;
  --gut: #1c8a4e;
  --gut-hell: #e3f4ea;
  --warn: #b86e00;
  --warn-hell: #fdf1dc;
  --schlecht: #c0362c;
  --schlecht-hell: #fbe7e5;
  --neutral-hell: #edf0f4;
  --lila: #6b4fbb;
  --lila-hell: #efeafb;
  --tuerkis: #0f766e;
  --tuerkis-hell: #ddf3ef;
  --schatten: 0 1px 2px rgba(20, 30, 50, .06), 0 1px 3px rgba(20, 30, 50, .04);
  --radius: 10px;
  --radius-s: 6px;
  --nav-breite: 236px;
  --schrift: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12151b; --bg-sub: #171b22; --flaeche: #1b2029; --flaeche-2: #20262f;
    --linie: #2a313c; --linie-stark: #3a4350; --text: #e6e9ef; --text-2: #b3bac7; --text-3: #8a93a3;
    --akzent: #5b9be6; --akzent-hell: #1d2c40; --akzent-text: #0d1117;
    --gut: #4cc38a; --gut-hell: #173528; --warn: #e3a447; --warn-hell: #3a2c14;
    --schlecht: #f0706a; --schlecht-hell: #3d1d1c; --neutral-hell: #252b35;
    --lila: #a68cf0; --lila-hell: #2a2440;
    --tuerkis: #4fd1c0; --tuerkis-hell: #123a36;
    --schatten: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #12151b; --bg-sub: #171b22; --flaeche: #1b2029; --flaeche-2: #20262f;
  --linie: #2a313c; --linie-stark: #3a4350; --text: #e6e9ef; --text-2: #b3bac7; --text-3: #8a93a3;
  --akzent: #5b9be6; --akzent-hell: #1d2c40; --akzent-text: #0d1117;
  --gut: #4cc38a; --gut-hell: #173528; --warn: #e3a447; --warn-hell: #3a2c14;
  --schlecht: #f0706a; --schlecht-hell: #3d1d1c; --neutral-hell: #252b35;
  --lila: #a68cf0; --lila-hell: #2a2440;
  --tuerkis: #4fd1c0; --tuerkis-hell: #123a36;
  --schatten: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.5 var(--schrift);
}
a { color: var(--akzent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 650; }
h1 { font-size: 22px; letter-spacing: -.01em; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
code { font-family: var(--mono); font-size: .9em; background: var(--neutral-hell); padding: 1px 5px; border-radius: 4px; }
hr { border: 0; border-top: 1px solid var(--linie); margin: 20px 0; }
[x-cloak] { display: none !important; }

/* ---------- Grundgeruest ---------- */
.app { display: grid; grid-template-columns: var(--nav-breite) 1fr; min-height: 100vh; }
.nav {
  background: var(--flaeche); border-right: 1px solid var(--linie);
  position: sticky; top: 0; height: 100vh; overflow-y: auto; padding: 18px 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.nav-marke { display: flex; align-items: center; gap: 10px; padding: 4px 8px 16px; color: var(--text); }
.nav-marke:hover { text-decoration: none; }
.nav-logo {
  width: 34px; height: 34px; border-radius: 8px; background: var(--akzent); color: var(--akzent-text);
  display: grid; place-items: center; font-weight: 800; font-size: 13px; letter-spacing: .02em;
}
.nav-marke b { display: block; font-size: 14px; }
.nav-marke small { color: var(--text-3); font-size: 12px; }
.nav-gruppe { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 14px 10px 4px; }
.nav a.nav-link {
  display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s);
  color: var(--text-2); font-weight: 500;
}
.nav a.nav-link:hover { background: var(--bg-sub); text-decoration: none; color: var(--text); }
.nav a.nav-link.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.nav a.nav-link svg { width: 17px; height: 17px; flex: none; opacity: .85; }
/* Werkzeuge eines Arbeitsbereichs (Text-Werkstatt, Keywords unter Content-SEO) eingerueckt. */
.nav a.nav-link.nav-unter { padding-left: 30px; font-size: 13px; }
.nav a.nav-link.nav-unter svg { width: 15px; height: 15px; }
.nav .zahl { margin-left: auto; font-size: 11px; background: var(--neutral-hell); color: var(--text-2); padding: 0 7px; border-radius: 10px; }
.nav-fuss { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--linie); font-size: 12.5px; color: var(--text-3); }
.nav-fuss form { display: inline; }
.nav-fuss button { background: none; border: 0; color: var(--akzent); cursor: pointer; padding: 0; font: inherit; }

.haupt { padding: 26px 32px 60px; min-width: 0; }
.kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.kopf p { color: var(--text-2); margin: 2px 0 0; }
.kopf-aktionen { display: flex; gap: 8px; flex-wrap: wrap; }
.brotkrumen { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.brotkrumen a { color: var(--text-3); }

.mobil-kopf { display: none; }

/* ---------- Karten und Raster ---------- */
.karte {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius);
  box-shadow: var(--schatten); padding: 18px 20px;
}
.karte + .karte { margin-top: 16px; }
/* Im Raster sorgt gap fuer den Abstand; sonst sitzt die zweite Karte einer Reihe 16px tiefer. */
.raster > .karte + .karte { margin-top: 0; }
.karte-kopf { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }
.karte-kopf .hinweis { font-size: 12px; color: var(--text-3); }
.karte.flach { box-shadow: none; }
.karte.eng { padding: 14px 16px; }

.raster { display: grid; gap: 16px; }
.raster-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.raster-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.raster-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.raster-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.raster-12 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
/* Abstand zwischen Rastern und Kachelreihen auf der Seite, ohne dass jede Stelle .abstand braucht.
   :where() haelt die Spezifitaet bei 0,1,0 (wie .abstand, .abstand-gross, .reiter) - diese gewinnen,
   weil sie WEITER UNTEN stehen. Diese Regel deshalb nicht nach unten verschieben. */
.haupt > :where(.raster, .kpis) + *, .haupt > * + :where(.raster, .kpis) { margin-top: 16px; }
.abstand { margin-top: 16px; }
.abstand-gross { margin-top: 28px; }

/* ---------- Kennzahl-Kacheln ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.kpi {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--schatten); display: flex; flex-direction: column; gap: 4px; min-width: 0;
}
.kpi-name { font-size: 12.5px; color: var(--text-2); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.kpi-quelle { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.kpi-wert { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.kpi-wert.leer { font-size: 15px; font-weight: 600; color: var(--warn); }
.kpi-vergleich { font-size: 12px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 10px; }
.kpi-vergleich span { white-space: nowrap; }

.trend { font-weight: 600; font-variant-numeric: tabular-nums; }
.trend-gut { color: var(--gut); }
.trend-schlecht { color: var(--schlecht); }
.trend-neutral { color: var(--text-3); }

/* Baustellen-Zaehler */
.baustellen { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.baustelle {
  border: 1px solid var(--linie); border-radius: var(--radius); padding: 14px 16px; background: var(--flaeche);
  display: flex; flex-direction: column; gap: 6px; color: var(--text);
}
a.baustelle:hover { text-decoration: none; border-color: var(--linie-stark); }
.baustelle-kopf { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.baustelle-wert { font-size: 26px; font-weight: 700; font-variant-numeric: tabular-nums; }
.baustelle-wert small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.baustelle.erledigt .baustelle-wert { color: var(--gut); }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--neutral-hell); color: var(--text-2);
}
.badge-massnahme-geplant, .badge-befund-in_arbeit, .badge-seite-geplant { background: var(--akzent-hell); color: var(--akzent); }
.badge-massnahme-in_arbeit, .badge-seite-in_arbeit { background: var(--warn-hell); color: var(--warn); }
.badge-massnahme-pruefen { background: var(--lila-hell); color: var(--lila); }
.badge-massnahme-erledigt, .badge-befund-behoben, .badge-seite-optimiert, .badge-keyword-optimiert { background: var(--gut-hell); color: var(--gut); }
.badge-befund-offen { background: var(--schlecht-hell); color: var(--schlecht); }
.badge-keyword-ziel { background: var(--akzent-hell); color: var(--akzent); }
.badge-intern { background: var(--lila-hell); color: var(--lila); }

.prio { display: inline-block; min-width: 26px; text-align: center; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 5px; }
.prio-1 { background: var(--schlecht); color: #fff; }
.prio-2 { background: var(--warn-hell); color: var(--warn); }
.prio-3 { background: var(--neutral-hell); color: var(--text-2); }

.chip { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--bg-sub); color: var(--text-2); margin: 0 3px 3px 0; }
.chip-schlecht { background: var(--schlecht-hell); color: var(--schlecht); }
.chip-warn { background: var(--warn-hell); color: var(--warn); }
/* Kennzeichen eines Arbeitsbereichs im gemeinsamen Aufgabenbereich (Ratgeber-Aufgaben R-xx, seit 27.11.2026) */
.chip-bereich { font-weight: 600; }
.chip-ratgeber { background: var(--tuerkis-hell); color: var(--tuerkis); }
.chip-content { background: var(--akzent-hell); color: var(--akzent); }

.score { display: inline-grid; place-items: center; width: 36px; height: 22px; border-radius: 6px; font-weight: 700; font-size: 12px; font-variant-numeric: tabular-nums; }
.score-gut { background: var(--gut-hell); color: var(--gut); }
.score-mittel { background: var(--warn-hell); color: var(--warn); }
.score-schlecht { background: var(--schlecht-hell); color: var(--schlecht); }

/* ---------- Tabellen ---------- */
.tabelle-huelle { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
table.tabelle { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabelle th {
  text-align: left; font-weight: 600; font-size: 12px; color: var(--text-3); padding: 8px 10px;
  border-bottom: 1px solid var(--linie); white-space: nowrap; background: var(--flaeche);
}
.tabelle th a { color: inherit; }
.tabelle td { padding: 9px 10px; border-bottom: 1px solid var(--linie); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle tbody tr:hover td { background: var(--flaeche-2); }
.tabelle .z { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabelle .klein { font-size: 12px; color: var(--text-3); }
.tabelle .titel-zelle { min-width: 220px; }
.tabelle .titel-zelle a { color: var(--text); font-weight: 550; }
.tabelle .url { font-family: var(--mono); font-size: 12px; color: var(--text-2); word-break: break-all; }

/* ---------- Formulare ---------- */
.formular { display: grid; gap: 14px; align-content: start; }
.raster > .formular { align-self: start; }
.feld { display: flex; flex-direction: column; gap: 5px; }
.feld label { font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.feld .hilfe { font-size: 12px; color: var(--text-3); }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--linie-stark); border-radius: var(--radius-s);
  background: var(--flaeche); color: var(--text); font: inherit;
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }
textarea.gross { min-height: 260px; font-family: var(--mono); font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--akzent-hell); border-color: var(--akzent); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.filterleiste { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filterleiste select, .filterleiste input { width: auto; min-width: 140px; padding: 6px 9px; }
.filterleiste input[type=search] { min-width: 220px; }

.knopf {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: var(--radius-s);
  border: 1px solid var(--linie-stark); background: var(--flaeche); color: var(--text); font: inherit; font-weight: 550;
  cursor: pointer; white-space: nowrap; justify-content: center;
}
.knopf:hover { background: var(--bg-sub); text-decoration: none; }
.knopf-primaer { background: var(--akzent); border-color: var(--akzent); color: var(--akzent-text); }
.knopf-primaer:hover { background: var(--akzent); filter: brightness(1.08); }
.knopf-klein { padding: 4px 10px; font-size: 12.5px; }
.knopf-gefahr { color: var(--schlecht); }

.meldung { padding: 10px 14px; border-radius: var(--radius-s); margin-bottom: 14px; background: var(--gut-hell); color: var(--gut); font-weight: 550; }
.meldung-fehler { background: var(--schlecht-hell); color: var(--schlecht); }
.hinweisbox { padding: 12px 14px; border-radius: var(--radius-s); background: var(--warn-hell); color: var(--text); border-left: 3px solid var(--warn); }
.infobox { padding: 12px 14px; border-radius: var(--radius-s); background: var(--akzent-hell); color: var(--text); border-left: 3px solid var(--akzent); }

/* ---------- Fortschritt ---------- */
.balken { height: 8px; background: var(--neutral-hell); border-radius: 99px; overflow: hidden; }
.balken span { display: block; height: 100%; background: var(--akzent); border-radius: 99px; }
.balken.gut span { background: var(--gut); }

/* ---------- Detailseiten ---------- */
.meta-liste { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 13.5px; margin: 0; }
.meta-liste dt { color: var(--text-3); }
.meta-liste dd { margin: 0; }
.prosa { font-size: 14px; line-height: 1.65; max-width: 860px; }
.prosa h1 { font-size: 21px; margin-top: 1.2em; }
.prosa h2 { font-size: 17px; margin-top: 1.6em; padding-top: .4em; border-top: 1px solid var(--linie); }
.prosa h3 { font-size: 15px; margin-top: 1.3em; }
.prosa ul, .prosa ol { padding-left: 1.3em; margin: 0 0 .9em; }
.prosa li { margin-bottom: .25em; }
.prosa table { border-collapse: collapse; width: 100%; font-size: 13px; margin: .5em 0 1.2em; display: block; overflow-x: auto; }
.prosa th, .prosa td { border: 1px solid var(--linie); padding: 6px 9px; text-align: left; vertical-align: top; }
.prosa th { background: var(--flaeche-2); }
.prosa blockquote { margin: 0 0 1em; padding: 4px 14px; border-left: 3px solid var(--linie-stark); color: var(--text-2); }

.checkliste { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.checkliste li { display: flex; gap: 9px; align-items: flex-start; }
.checkliste input { margin-top: 3px; }
.checkliste .erledigt span { text-decoration: line-through; color: var(--text-3); }

.zeitleiste { list-style: none; margin: 0; padding: 0; }
.zeitleiste li { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--linie); font-size: 13px; }
.zeitleiste li:last-child { border-bottom: 0; }
.zeitleiste time { color: var(--text-3); font-variant-numeric: tabular-nums; font-size: 12px; }
.zeitleiste .wer { color: var(--text-3); font-size: 12px; }

/* ---------- Kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(220px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 8px; align-items: start; }
.spalte { background: var(--bg-sub); border-radius: var(--radius); padding: 10px; min-height: 200px; }
.spalte-kopf { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: 13px; padding: 2px 4px 10px; }
.spalte-kopf .zahl { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.spalte-liste { display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.kachel {
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: 8px; padding: 10px 11px; cursor: grab;
  box-shadow: var(--schatten); display: flex; flex-direction: column; gap: 6px;
}
.kachel:active { cursor: grabbing; }
.kachel a { color: var(--text); font-weight: 550; font-size: 13px; line-height: 1.35; }
.kachel-fuss { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.kachel-fuss .rechts { margin-left: auto; }
/* Ziehen: Ring per box-shadow (folgt dem border-radius sauber, anders als outline). */
.kachel-gewaehlt { box-shadow: 0 0 0 2px var(--akzent), var(--schatten); }
.kachel-platzhalter { background: var(--akzent-hell); border: 2px dashed var(--akzent); box-shadow: none; }
.kachel-platzhalter > * { visibility: hidden; }
.kachel-zieht { opacity: .95 !important; transform: rotate(1.5deg); box-shadow: 0 0 0 2px var(--akzent), 0 12px 28px rgba(20, 30, 50, .22) !important; cursor: grabbing; }

/* ---------- Roadmap ---------- */
.phasen { display: grid; gap: 14px; }
.phase { display: grid; grid-template-columns: 54px 1fr; gap: 16px; }
.phase-marke {
  width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 15px;
  background: var(--akzent-hell); color: var(--akzent);
}
.phase.fertig .phase-marke { background: var(--gut-hell); color: var(--gut); }
.phase-kopf { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.phase-kopf h3 { margin: 0; }
.phase-zeit { font-size: 12.5px; color: var(--text-3); }
.phase-massnahmen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.phase-massnahmen a {
  font-size: 12px; padding: 3px 8px; border-radius: 6px; border: 1px solid var(--linie); color: var(--text-2); background: var(--flaeche);
}
.phase-massnahmen a.erledigt { background: var(--gut-hell); color: var(--gut); border-color: transparent; }
.phase-massnahmen a.laeuft { background: var(--warn-hell); color: var(--warn); border-color: transparent; }

/* ---------- Diagramme ---------- */
.diagramm { position: relative; height: 260px; }
.diagramm.klein { height: 180px; }
.diagramm.hoch { height: 340px; }

/* ---------- Login ---------- */
.login-seite { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.login-karte { width: 100%; max-width: 380px; }
.login-karte .nav-marke { padding: 0 0 18px; }

/* ---------- Bericht (Kunde und Druck) ---------- */
.bericht { max-width: 920px; }
.bericht-kopf { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; border-bottom: 2px solid var(--text); padding-bottom: 14px; margin-bottom: 20px; }
.bericht-kopf h1 { font-size: 26px; margin: 0; }
.bericht-kopf .marke { text-align: right; font-size: 12.5px; color: var(--text-2); }
.bericht h2 { margin-top: 28px; font-size: 18px; }
.bericht .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.leer { color: var(--text-3); text-align: center; padding: 24px 10px; }
.text-2 { color: var(--text-2); }
.text-3 { color: var(--text-3); }
.text-warn { color: var(--warn); }
.liste-schlicht { margin: 0; padding-left: 1.1em; display: grid; gap: 6px; }
.klein { font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.rechts { text-align: right; }
.zeile { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.zeile.zwischen { justify-content: space-between; }

/* ---------- Mobil ---------- */
@media (max-width: 1100px) {
  .raster-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .raster-21, .raster-12, .raster-3 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; }
  .nav { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.2); }
  .nav.offen { transform: none; }
  .mobil-kopf { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--flaeche); border-bottom: 1px solid var(--linie); position: sticky; top: 0; z-index: 20; }
  .mobil-kopf button { background: none; border: 1px solid var(--linie); border-radius: 6px; padding: 5px 9px; color: var(--text); font-size: 16px; }
  .haupt { padding: 18px 16px 50px; }
  .raster-2 { grid-template-columns: minmax(0, 1fr); }
  .bericht .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tabelle-huelle { margin: 0 -16px; padding: 0 16px; }
  .karte { padding: 16px; }
}

/* ---------- Druck ---------- */
@media print {
  :root { --bg: #fff; --flaeche: #fff; --schatten: none; }
  body { font-size: 11.5pt; background: #fff; color: #000; }
  .nav, .mobil-kopf, .kopf-aktionen, .nicht-drucken { display: none !important; }
  .app { display: block; }
  .haupt { padding: 0; }
  .karte, .kpi { box-shadow: none; break-inside: avoid; }
  .bericht { max-width: none; }
  .bericht h2 { break-after: avoid; }
  .tabelle tr { break-inside: avoid; }
  a { color: #000; }
  @page { margin: 16mm 14mm; }
}

/* Logo als Icon */
.nav-logo svg { width: 20px; height: 20px; }

/* ---------- Roadmap: Zeitleiste ---------- */
.gantt { --gantt-name: 190px; position: relative; padding-top: 26px; }
.gantt-achse { position: absolute; top: 0; left: var(--gantt-name); right: 0; height: 100%; pointer-events: none; }
.gantt-achse span { position: absolute; top: 0; font-size: 11.5px; color: var(--text-3); padding-left: 4px; border-left: 1px solid var(--linie); height: 100%; }
.gantt-zeile { display: grid; grid-template-columns: var(--gantt-name) 1fr; align-items: center; min-height: 38px; position: relative; }
.gantt-name { font-size: 13px; padding-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gantt-spur { position: relative; height: 26px; }
.gantt-balken {
  position: absolute; top: 0; height: 26px; border-radius: 6px; background: var(--akzent-hell); border: 1px solid var(--akzent);
  overflow: hidden; color: var(--text); display: flex; align-items: center;
}
.gantt-balken:hover { text-decoration: none; filter: brightness(.97); }
.gantt-balken.fertig { background: var(--gut-hell); border-color: var(--gut); }
.gantt-fortschritt { position: absolute; inset: 0 auto 0 0; background: var(--akzent); opacity: .35; }
.gantt-balken.fertig .gantt-fortschritt { background: var(--gut); }
.gantt-text { position: relative; font-size: 11.5px; font-weight: 700; padding: 0 8px; }
.gantt-heute { position: absolute; top: 18px; bottom: 0; width: 0; border-left: 2px solid var(--schlecht); pointer-events: none; }
.gantt-heute span { position: absolute; top: -18px; left: -14px; font-size: 10.5px; font-weight: 700; color: var(--schlecht); }

.phase-block { margin-top: 14px; padding: 0; }
.phase-block > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 54px 1fr 150px; gap: 14px; align-items: center; padding: 14px 18px; }
.phase-block > summary::-webkit-details-marker { display: none; }
.phase-block[open] > summary { border-bottom: 1px solid var(--linie); }
.phase-block .tabelle-huelle { margin: 0; padding: 4px 8px 8px; }
.phase-block .phase-marke { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; background: var(--akzent-hell); color: var(--akzent); }
.phase-block .phase-marke.fertig { background: var(--gut-hell); color: var(--gut); }
.phase-titel { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.phase-stand { display: flex; flex-direction: column; gap: 4px; text-align: right; font-size: 13px; }
.ueberfaellig { color: var(--schlecht); font-weight: 600; }
@media (max-width: 820px) {
  .gantt { --gantt-name: 92px; }
  .gantt-name { font-size: 11.5px; }
  .phase-block > summary { grid-template-columns: 46px 1fr; }
  .phase-stand { grid-column: 1 / -1; text-align: left; }
}

/* ---------- Warnungen ---------- */
.warnungen { display: grid; gap: 6px; margin-bottom: 16px; }
.warnung { display: flex; align-items: center; gap: 10px; padding: 9px 14px; border-radius: var(--radius-s); font-size: 13.5px; color: var(--text); border: 1px solid var(--linie); background: var(--flaeche); }
.warnung:hover { text-decoration: none; border-color: var(--linie-stark); }
.warnung-punkt { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
.warnung-hoch { border-left: 3px solid var(--schlecht); }
.warnung-hoch .warnung-punkt { background: var(--schlecht); }
.warnung-mittel { border-left: 3px solid var(--warn); }
.warnung-mittel .warnung-punkt { background: var(--warn); }
.warnung-info { border-left: 3px solid var(--akzent); }
.warnung-info .warnung-punkt { background: var(--akzent); }

/* ---------- Roadmap: Stufen ohne Datum ---------- */
.stufen { display: flex; align-items: stretch; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.stufe {
  flex: 1 1 0; min-width: 170px; display: flex; flex-direction: column; gap: 8px; padding: 14px 16px;
  background: var(--flaeche); border: 1px solid var(--linie); border-radius: var(--radius); box-shadow: var(--schatten); color: var(--text);
}
.stufe:hover { text-decoration: none; border-color: var(--linie-stark); }
.stufe-kopf { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.stufe-code { font-weight: 800; font-size: 13px; color: var(--akzent); background: var(--akzent-hell); border-radius: 6px; padding: 1px 8px; }
.stufe-zustand { font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.stufe-fertig { border-color: var(--gut); }
.stufe-fertig .stufe-code { color: var(--gut); background: var(--gut-hell); }
.stufe-fertig .stufe-zustand { color: var(--gut); }
.stufe-laeuft { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.stufe-laeuft .stufe-zustand { color: var(--warn); }
.stufe-naechste { border-color: var(--akzent); }
.stufe-naechste .stufe-zustand { color: var(--akzent); }
.stufe-spaeter { opacity: .8; }
.stufe-pfeil { align-self: center; color: var(--text-3); font-size: 18px; flex: none; }
@media (max-width: 820px) {
  .stufen { flex-direction: column; }
  .stufe-pfeil { transform: rotate(90deg); }
}

.testhinweis { background: var(--warn-hell); color: var(--text); border: 1px dashed var(--warn); border-radius: var(--radius-s); padding: 8px 14px; margin-bottom: 16px; font-size: 13px; font-weight: 600; }

/* ---------- Ratgeber ---------- */
/* Testregister: Zeitplan-Balken (Vorperiode | Anlauf | Messung) und Status-Chips. */
.testplan { position: relative; display: flex; height: 46px; border-radius: var(--radius-s); overflow: visible; margin: 4px 0 2px; }
.testplan-teil { display: flex; flex-direction: column; justify-content: center; padding: 0 10px; font-size: 12px; overflow: hidden; white-space: nowrap; min-width: 0; }
.testplan-teil span { color: var(--text-3); font-size: 11.5px; }
.testplan-teil.vor { background: var(--neutral-hell); border-radius: var(--radius-s) 0 0 var(--radius-s); }
.testplan-teil.anlauf { background: var(--warn-hell); }
.testplan-teil.messung { background: var(--akzent-hell); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.testplan-heute { position: absolute; top: -4px; bottom: -4px; border-left: 2px solid var(--schlecht); }
.testplan-heute span { position: absolute; top: -16px; left: -14px; font-size: 10.5px; color: var(--schlecht); font-weight: 600; }
.chip.test-status-entwurf { background: var(--neutral-hell); }
.chip.test-status-festgelegt, .chip.test-status-anlauf { background: var(--warn-hell); color: var(--warn); }
.chip.test-status-messung { background: var(--akzent-hell); color: var(--akzent); }
.chip.test-status-ausgewertet, .chip.test-status-entschieden { background: var(--gut-hell); color: var(--gut); }
.chip.test-status-abgebrochen { background: var(--schlecht-hell); color: var(--schlecht); }
details.abbruch { position: relative; }
details.abbruch > summary { list-style: none; }
details.abbruch > summary::-webkit-details-marker { display: none; }
/* Umschalter zweier Ansichten (Aufgaben: Kanban | Liste). */
.umschalter { display: inline-flex; border: 1px solid var(--linie-stark); border-radius: var(--radius-s); overflow: hidden; background: var(--flaeche); }
.umschalter a { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; color: var(--text-2); font-weight: 550; text-decoration: none; white-space: nowrap; }
.umschalter a + a { border-left: 1px solid var(--linie-stark); }
.umschalter a:hover { color: var(--text); background: var(--bg-sub); text-decoration: none; }
.umschalter a.aktiv { background: var(--akzent-hell); color: var(--akzent); }
.umschalter svg { width: 15px; height: 15px; }
/* Linie als innerer Schatten statt border-bottom mit -1px-Rand der Links: sonst laeuft die Leiste
   senkrecht ueber und zeigt Scroll-Pfeile. */
.reiter { display: flex; gap: 2px; box-shadow: inset 0 -1px 0 var(--linie); margin: -6px 0 18px; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
.reiter a { padding: 8px 14px; font-size: 13.5px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; white-space: nowrap; }
.reiter a:hover { color: var(--text); }
.reiter a.aktiv { color: var(--akzent); border-bottom-color: var(--akzent); font-weight: 600; }
.badge-ratgeber-geprueft { background: var(--gut-hell); color: var(--gut); }
.badge-ratgeber-importiert { background: var(--warn-hell); color: var(--warn); }
.badge-ratgeber-entwurf { background: var(--akzent-hell); color: var(--akzent); }
.badge-ratgeber-live { background: var(--lila-hell); color: var(--lila); }
.diff { font-family: var(--mono); font-size: 12px; white-space: pre-wrap; background: var(--flaeche-2); border-radius: var(--radius-s); padding: 10px 12px; max-height: 420px; overflow: auto; }
.diff-neu { background: var(--gut-hell); color: var(--gut); }
.diff-alt { background: var(--schlecht-hell); color: var(--schlecht); text-decoration: line-through; }
.diff .diff-alt { text-decoration: none; }
.prosa.vorschau { border: 1px solid var(--linie); border-radius: var(--radius-s); padding: 12px 16px; max-height: 520px; overflow: auto; }
.knopf-link { background: none; border: 0; padding: 0; color: var(--akzent); cursor: pointer; font: inherit; }
.zeitleiste-gross li { grid-template-columns: 100px 1fr; }
.zeitleiste-gross li.jahr { display: block; padding-top: 14px; font-size: 15px; border-bottom: 1px solid var(--linie); }
.zeitleiste-gross li.art-sicherheit time { color: var(--schlecht); }
.nowrap { white-space: nowrap; }

/* Bilder zu Aufgaben (Vorher/Nachher) */
.bild-vergleich { align-items: start; }
.bild-kachel { margin: 6px 0 12px; }
.bild-kachel img { display: block; width: 100%; height: auto; border: 1px solid var(--linie); border-radius: var(--radius-s); }
.bild-kachel figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-3); margin-top: 4px; }
.bild-upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* Ratgeber-Arbeitsbereich: Verweis von den allgemeinen Aufgaben */
.bereich-hinweis { display: flex; gap: 12px; align-items: center; color: var(--text); text-decoration: none; padding: 12px 16px; border-left: 3px solid var(--akzent); font-size: 13.5px; margin-bottom: 16px; }
.bereich-hinweis:hover { text-decoration: none; filter: brightness(.98); }
.bereich-hinweis-icon { display: inline-flex; color: var(--akzent); }
.bereich-hinweis-icon svg { width: 20px; height: 20px; }
.bereich-hinweis .rechts { margin-left: auto; color: var(--akzent); white-space: nowrap; font-weight: 600; }

/* ---------- Vorlagen (Content-SEO): Ist und Vorlage nebeneinander ---------- */
.chip.vorlage-status-entwurf { background: var(--neutral-hell); }
.chip.vorlage-status-zur_freigabe { background: var(--warn-hell); color: var(--warn); }
.chip.vorlage-status-freigegeben, .chip.vorlage-status-umgesetzt { background: var(--gut-hell); color: var(--gut); }
.chip.vorlage-status-aenderungen { background: var(--schlecht-hell); color: var(--schlecht); }
.vz-leiste { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 12px; }
.vz-leiste select { padding: 6px 8px; }
.vz-raster { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.vz-buehne { display: grid; gap: 12px; min-width: 0; }
.vz-buehne.vz-beide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.vz-spalte { min-width: 0; }
.vz-titel { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 6px; }
.vz-titel a { margin-left: auto; }
.vz-rahmen { position: relative; overflow: hidden; height: calc(100vh - 210px); min-height: 520px; border: 1px solid var(--linie-stark);
  border-radius: var(--radius-s); background: #fff; }
.vz-rahmen iframe { position: absolute; top: 0; left: 0; border: 0; transform-origin: 0 0; background: #fff; }
.vz-rahmen iframe.verdeckt { visibility: hidden; pointer-events: none; }
.vz-raster.vz-breit { grid-template-columns: 1fr; }
.vz-raster.vz-breit .vz-seite { position: static; max-height: none; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.vz-neu[hidden] { display: none; }
.vz-seite { position: sticky; top: 12px; max-height: calc(100vh - 24px); overflow: auto; display: grid; gap: 12px; }
.vz-seite .karte { margin: 0; }
.vz-anm { list-style: none; margin: 0; padding: 0; }
.vz-anm li { border-top: 1px solid var(--linie); }
.vz-anm li:first-child { border-top: 0; }
.vz-anm-kopf { display: flex; gap: 8px; align-items: center; width: 100%; padding: 8px 2px; background: none; border: 0; text-align: left; cursor: pointer; color: var(--text); font: inherit; }
.vz-anm-kopf b { flex: 1; font-weight: 600; }
.vz-anm-kopf:hover b { color: var(--akzent); }
.vz-nr { flex: none; width: 22px; height: 22px; border-radius: 50%; background: #f5a300; color: #1b1b1b; font-weight: 700; font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center; }
.vz-anm-text { display: none; padding: 0 2px 10px 30px; color: var(--text-2); }
.vz-anm-text p { margin: 0 0 6px; }
.vz-anm li.offen .vz-anm-text { display: block; }
.vz-anm li.offen .vz-anm-kopf b { color: var(--akzent); }
.vz-neu { border: 1px solid var(--akzent); border-radius: var(--radius-s); padding: 10px; margin-bottom: 10px; background: var(--akzent-hell); }
.vz-liste { margin-top: 10px; }
.vz-k { border-top: 1px solid var(--linie); padding: 9px 0; }
.vz-k.hell { background: var(--akzent-hell); margin: 0 -8px; padding: 9px 8px; border-radius: var(--radius-s); }
.vz-k.erledigt { opacity: .6; }
.vz-k-kopf { display: flex; gap: 8px; align-items: center; }
.vz-k-nr { flex: none; min-width: 22px; height: 22px; padding: 0 5px; border-radius: 11px 11px 11px 2px; background: #2563eb; color: #fff; border: 0;
  font-weight: 700; font-size: 12px; cursor: pointer; }
.vz-k-text { white-space: pre-wrap; margin-top: 3px; }
.vz-k-antwort { margin: 6px 0 0 18px; padding-left: 10px; border-left: 2px solid var(--linie-stark); }
.vz-k-aktionen { display: flex; gap: 12px; margin-top: 4px; }
.vz-k-form { margin: 8px 0 0 18px; display: grid; gap: 6px; }
@media (max-width: 1100px) {
  .vz-raster { grid-template-columns: 1fr; }
  .vz-seite, .vz-raster.vz-breit .vz-seite { position: static; max-height: none; grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .vz-buehne.vz-beide { grid-template-columns: 1fr; }
  .vz-rahmen { height: 70vh; min-height: 420px; }
}

/* Ratgeber-Uebersicht (eine Seite, 27.11.2026) */
.rg-aufgabe { padding: 8px 0; border-bottom: 1px solid var(--linie); }
.rg-aufgabe:last-of-type { border-bottom: 0; }
.rg-bewegung h3 { margin: 0 0 6px; }
#artikel .filterleiste .umschalter a { padding: 5px 11px; font-size: 13px; }
