/* kunden.css — „Wer bleibt, wer kommt, wer geht.“ (nur diese Seite).
   Richtung Wirtschaftsteil: helle Zeitungsseite, Tinte-Schwarz und Kirschrot als Hausfarben, Grau nur für Hilfslinien,
   Linien statt Kästen, mehrspaltiger Satz. Die Seite ist bewusst nur hell. */

@font-face { font-family: "Archivo Black"; src: url("../../schrift/muster/archivo-black-latin-400-normal.woff2") format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../../schrift/muster/schibsted-grotesk-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../../schrift/muster/schibsted-grotesk-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../../schrift/muster/schibsted-grotesk-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Schibsted Grotesk"; src: url("../../schrift/muster/schibsted-grotesk-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root, :root[data-theme="light"] {
  color-scheme: light;
  --flaeche-0: #fbfaf5;          /* Zeitungspapier, fast weiß */
  --flaeche-1: #fffefa;
  --flaeche-2: #f1eee5;
  --linie: #c9c4b8;              /* Hilfslinien */
  --raster: #e6e2d8;
  --text-1: #111114;
  --text-2: #33333a;
  --text-3: #5c5c62;
  --tinte: #16161b;
  --kirsche: #b3122e;
  --kirsche-text: #9a0e26;
  --kirsche-hell: #fbe3e7;
  --blau: #2e5d8f;
  --akzent: #b3122e;
  --akzent-text: #9a0e26;
  --s1: #16161b; --s2: #b3122e; --s3: #2e5d8f; --s4: #c98a12;
  --s5: #7d3c6e; --s6: #5a4632; --s7: #16161b; --s8: #b3122e;
  /* Leistungen: feste Farben, auch ohne Farbsehen über die Helligkeit zu trennen */
  --l-service: #d0911a; --l-wartung: #2e5d8f; --l-sanierung: #7d3c6e; --l-neubau: #26221f; --l-sonst: #8d877b;
  /* Stufen hell → dunkel in Kirschrot (Jahrgänge) */
  --q1: #fbe7ea; --q2: #f5c6ce; --q3: #ec9eab; --q4: #dc6c80; --q5: #c63d56; --q6: #a5182f; --q7: #73101f;
  --gut-text: #16161b; --kritisch-text: #9a0e26;
  --schatten: 0 1px 0 rgb(0 0 0 / .05), 0 12px 24px -18px rgb(0 0 0 / .35);
  --kopfschrift: "Archivo Black", "Schibsted Grotesk", system-ui, sans-serif;
}

html { overflow-x: clip; }
body { overflow-x: clip; font-family: "Schibsted Grotesk", system-ui, sans-serif; font-size: 16px; font-variant-numeric: normal; }
body *, .dia svg text { font-variant-numeric: normal; }
.breite { width: min(100% - 32px, 1600px); }

:focus-visible { outline: 2px solid var(--kirsche); outline-offset: 2px; border-radius: 0; }
a:focus-visible, button:focus-visible, .knopf:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--kirsche); outline-offset: 2px; }
.knopf:has(input:focus-visible) { outline: 2px solid var(--kirsche); outline-offset: 2px; }

/* ---------- Kopfleiste ---------- */
.a-kopf { background: var(--flaeche-0); border-bottom: 1px solid var(--tinte); }
.a-kopf .a-zurueck { color: var(--text-2); }
.a-kopf .a-zurueck:hover { color: var(--kirsche-text); }
.a-kopf .a-name { font-weight: 700; letter-spacing: .01em; }

/* ---------- Zeitungskopf ---------- */
.k-kopf { padding: 28px 0 22px; }
.k-zeitungskopf { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 24px; border-top: 5px solid var(--tinte); border-bottom: 1px solid var(--tinte); padding: 8px 0 7px; margin-bottom: 26px; }
.k-ressort { margin: 0; font-weight: 700; font-size: 14px; letter-spacing: .16em; text-transform: uppercase; color: var(--kirsche-text); }
.k-ausgabe { margin: 0; font-size: 14px; color: var(--text-2); }
.a-titel h1 { font-family: var(--kopfschrift); font-weight: 800; font-stretch: normal; font-size: clamp(38px, 7.2vw, 112px); line-height: .94; letter-spacing: -.025em; max-width: 16ch; margin: 0 0 26px; color: var(--tinte); }
.k-vorspann { border-top: 1px solid var(--tinte); padding-top: 14px; }
.k-vorspann p, .a-titel .k-vorspann p { margin: 0; max-width: none; columns: 3 18rem; column-gap: 40px; column-rule: 1px solid var(--linie); font-size: 17px; line-height: 1.55; color: var(--text-1); hyphens: auto; text-align: left; }
.k-vorspann p::first-letter { font-family: var(--kopfschrift); font-weight: 800; float: left; font-size: 3.1em; line-height: .86; padding: 4px 8px 0 0; color: var(--kirsche); }
.a-quelle { margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--linie); }
.a-schild { border-radius: 0; background: transparent; border: 1px solid var(--tinte); padding: 3px 9px; font-weight: 600; }
.a-schild i { border-radius: 0; background: var(--kirsche); }
.a-schild.eigen i { background: var(--tinte); }

/* ---------- Ablage und Knöpfe ---------- */
.ablage { border: 0; border-top: 2px solid var(--tinte); border-bottom: 1px solid var(--tinte); border-radius: 0; background: transparent; padding: 18px 0; margin: 4px 0 18px; }
.ablage.drueber { background: var(--kirsche-hell); }
.ablage svg { color: var(--kirsche); }
.ablage span { display: block; margin-top: 2px; }
.ablage .vorlage-satz { color: var(--text-1); font-weight: 500; margin-top: 6px; }
.ablage .fehler { color: var(--kirsche-text); font-weight: 600; }
.knopf { border-radius: 0; background: var(--kirsche); color: #fff; font-weight: 600; }
.knopf:hover { filter: none; background: var(--kirsche-text); }
.knopf.leise { background: transparent; color: var(--tinte); border: 1px solid var(--tinte); }
.knopf.leise:hover { background: var(--tinte); color: #fff; }
.knopf.k-klein { min-height: 36px; padding: 0 12px; font-size: 13px; margin-left: auto; flex: none; }

/* ---------- Filter ---------- */
.k-filter { gap: 12px 28px; align-items: flex-end; padding-bottom: 16px; border-bottom: 1px solid var(--linie); margin-bottom: 0; }
.k-feld { display: flex; flex-direction: column; gap: 5px; }
.k-feld .f-name { font-size: 14px; font-weight: 700; color: var(--text-1); margin: 0; }
.wahl { background: transparent; border: 1px solid var(--tinte); border-radius: 0; padding: 0; gap: 0; flex-wrap: wrap; }
.wahl button { border-radius: 0; min-height: 40px; color: var(--tinte); font-weight: 600; }
.wahl button + button { border-left: 1px solid var(--tinte); }
.wahl button:hover { background: var(--flaeche-2); }
.wahl button[aria-pressed="true"] { background: var(--tinte); color: #fff; box-shadow: none; }
select.feld { border-radius: 0; border: 1px solid var(--tinte); background: var(--flaeche-1); font-weight: 600; min-height: 42px; }
.k-hinweis { margin: 14px 0 0; padding: 10px 0 10px 14px; border-left: 3px solid var(--kirsche); font-size: 14px; color: var(--text-2); }
.k-hinweis b { color: var(--text-1); }

/* ---------- Abschnitte, Karten als Zeitungsspalten ---------- */
.abschnitt { margin: 52px 0 0; }
.abschnitt.k-erst { margin-top: 26px; }
.abschnitt > h2 { font-family: var(--kopfschrift); font-weight: 800; font-size: clamp(26px, 3vw, 38px); line-height: 1.02; letter-spacing: -.015em; margin: 0 0 8px; padding-top: 14px; border-top: 5px solid var(--tinte); }
.abschnitt > p.unter { color: var(--text-2); max-width: 78ch; margin-bottom: 18px; }
.gitter { column-gap: 48px; row-gap: 28px; }
.karte { background: transparent; border: 0; border-top: 2px solid var(--tinte); border-radius: 0; padding: 12px 0 6px; }
.karte.rechts::before { content: ""; position: absolute; left: -24px; top: 0; bottom: 0; border-left: 1px solid var(--linie); }
@media (max-width: 1020px) { .karte.rechts::before { display: none; } .gitter { grid-template-columns: minmax(0, 1fr); column-gap: 0; } }
.karte-kopf { align-items: flex-start; flex-wrap: wrap; }
.karte-kopf > div:first-child { flex: 1 1 260px; min-width: 0; }
.karte-kopf h2 { font-size: 19px; font-weight: 700; letter-spacing: -.005em; }
.karte-kopf p { font-size: 14px; color: var(--text-2); }
.karte-kopf .tabelle-knopf { border-radius: 0; border-color: var(--tinte); color: var(--tinte); font-weight: 600; }
.karte-kopf .tabelle-knopf:hover { background: var(--tinte); color: #fff; }
.einsicht { border-top: 1px solid var(--linie); font-size: 15px; color: var(--text-2); max-width: 110ch; }
.einsicht b { color: var(--text-1); font-weight: 700; }
.einsicht:empty { display: none; }

/* ---------- Kundenfluss ---------- */
.k-flusswahl { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 26px; margin: 4px 0 14px; }
.k-leg { margin: 0; }
.k-leg i { width: 14px; height: 12px; border-radius: 0; }
.k-leg i.bleibt, .k-leg i.basis { background: var(--tinte); }
.k-leg i.basis { background: #4b4b55; }
.k-leg i.zur { background: var(--blau); }
.k-leg i.neu { background: var(--kirsche); }
.k-leg i.weg { background: repeating-linear-gradient(45deg, var(--kirsche) 0 2px, var(--kirsche-hell) 2px 5px); outline: 1px solid var(--kirsche); outline-offset: -1px; }
#d-fluss svg { font-family: "Schibsted Grotesk", system-ui, sans-serif; }
.dia .k-grund { stroke: var(--tinte); stroke-width: 1; }
.dia .k-band { fill: var(--tinte); fill-opacity: .12; stroke: var(--tinte); stroke-opacity: .25; stroke-width: .6; transition: fill-opacity .15s; }
.dia .k-band:hover { fill-opacity: .22; }
.dia .k-weg { stroke: var(--kirsche); stroke-width: 1; }
.dia .k-weg:hover { stroke-width: 2; }
.dia .k-zu-neu { fill: var(--kirsche); fill-opacity: .38; }
.dia .k-zu-zur { fill: var(--blau); fill-opacity: .4; }
.dia .k-zu-neu:hover, .dia .k-zu-zur:hover { fill-opacity: .6; }
.dia .k-saeule.bleibt { fill: var(--tinte); }
.dia .k-saeule.basis { fill: #4b4b55; }
.dia .k-saeule.zur { fill: var(--blau); }
.dia .k-saeule.neu { fill: var(--kirsche); }
.dia .k-saeule:hover { filter: brightness(1.25); }
.dia .k-jahr { font-family: var(--kopfschrift); font-size: 17px; fill: var(--tinte); }
.dia .k-summe { font-size: 13px; font-weight: 600; fill: var(--text-2); }
.dia .k-zahl { font-size: 13px; font-weight: 700; fill: var(--text-1); }
.dia .k-wort { font-size: 11.5px; fill: var(--text-2); }
.dia .k-band-text { font-size: 13px; font-weight: 700; fill: var(--tinte); pointer-events: none; }
.dia .k-band-text.klein { font-size: 11px; font-weight: 500; fill: var(--text-2); }
#k-fluss .dia { padding-bottom: 4px; }

/* ---------- Meldungen in Spalten ---------- */
.k-meldungen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 48px; margin-top: 34px; border-top: 5px solid var(--tinte); }
.k-meldung { position: relative; padding: 16px 0 18px; border-bottom: 1px solid var(--linie); }
.k-meldung:not(:nth-child(3n + 1))::before { content: ""; position: absolute; left: -24px; top: 16px; bottom: 16px; border-left: 1px solid var(--linie); }
.k-meldung h3 { margin: 0 0 6px; font-family: var(--kopfschrift); font-weight: 800; font-size: 21px; line-height: 1.12; letter-spacing: -.01em; color: var(--tinte); overflow-wrap: anywhere; }
.k-meldung.erste h3 { font-size: 26px; }
.k-meldung p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-2); }
@media (max-width: 1020px) {
  .k-meldungen { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .k-meldung:not(:nth-child(3n + 1))::before { display: none; }
  .k-meldung:nth-child(2n)::before { display: block; content: ""; position: absolute; left: -24px; top: 16px; bottom: 16px; border-left: 1px solid var(--linie); }
}
@media (max-width: 640px) {
  .k-meldungen { grid-template-columns: 1fr; }
  .k-meldung:nth-child(2n)::before { display: none; }
  .k-meldung h3 { font-size: 19px; }
}

/* ---------- Jahrgänge ---------- */
.k-stufen { display: flex; align-items: center; gap: 3px; margin: 0; font-size: 13px; color: var(--text-2); flex-wrap: wrap; }
.k-stufen span { margin: 0 6px; }
.k-stufen i { width: 20px; height: 12px; display: inline-block; }
.k-tabelle, #d-jahrgang { position: relative; overflow-x: auto; }
table.k-jg { width: auto; border-collapse: separate; border-spacing: 3px; font-size: 14px; min-width: min(520px, 100%); }
table.k-jg th, table.k-jg td { border-bottom: 0; padding: 9px 12px; white-space: nowrap; }
table.k-jg thead th { position: static; background: transparent; color: var(--text-2); font-weight: 600; border-bottom: 1px solid var(--tinte); }
table.k-jg tbody th { font-family: var(--kopfschrift); font-weight: 800; font-size: 15px; color: var(--tinte); }
table.k-jg td.zelle { text-align: right; font-weight: 700; color: var(--tinte); min-width: 92px; }
table.k-jg td.zelle small { display: block; font-weight: 500; font-size: 12px; color: var(--text-2); }
table.k-jg td.zelle.dunkel, table.k-jg td.zelle.dunkel small { color: #fff; }
table.k-jg td.start { border: 1px solid var(--tinte); background: transparent; }
table.k-jg td.leer { background: transparent; }
table.k-jg tr:hover td { background-color: inherit; }
table.k-jg tbody tr:hover td:not(.zelle) { background: transparent; }

/* ---------- Ranglisten ---------- */
.k-rang { display: grid; gap: 2px; }
.k-zeile { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(70px, 1fr) minmax(0, 1.05fr); gap: 14px; align-items: center; padding: 7px 0; border-bottom: 1px solid var(--raster); }
.k-zeile:hover { background: var(--flaeche-2); }
.k-name { font-weight: 600; font-size: 14.5px; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.k-liste .k-zeile { grid-template-columns: minmax(0, 1.5fr) minmax(48px, .9fr) minmax(0, 1fr); }
.k-name small, .k-wert small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.k-spur { position: relative; height: 14px; }
.k-spur i { position: absolute; left: 0; top: 0; bottom: 0; }
.k-spur i.auf { background: var(--tinte); }
.k-spur i.ab { background: repeating-linear-gradient(45deg, var(--kirsche) 0 2px, var(--kirsche-hell) 2px 5px); outline: 1px solid var(--kirsche); outline-offset: -1px; }
.k-wert { font-weight: 700; font-size: 14.5px; text-align: right; }
.k-leer { margin: 8px 0; color: var(--text-2); }
@media (max-width: 560px) {
  .k-zeile, .k-liste .k-zeile { grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; }
  .k-spur { grid-column: 1 / -1; grid-row: 2; }
  .k-wert { grid-row: 1; grid-column: 2; }
}

/* ---------- Tabelle eingeschlafen ---------- */
.k-wisch { display: none; margin: 0 0 6px; font-size: 12.5px; color: var(--text-3); }
@media (max-width: 760px) { .k-wisch { display: block; } }
.k-tabelle { border-top: 1px solid var(--tinte); max-height: 560px; overflow: auto; }
.k-tabelle table.daten { font-size: 14px; }
.k-tabelle table.daten th { background: var(--flaeche-0); color: var(--text-1); font-weight: 700; border-bottom: 1px solid var(--tinte); }
.k-tabelle table.daten td.breit { white-space: normal; min-width: 200px; font-weight: 600; }
table.daten tr:hover td { background: var(--flaeche-2); }
.tabelle-huelle { border-radius: 0; border-color: var(--linie); }
table.daten th { background: var(--flaeche-2); }

/* ---------- Leistungsmix ---------- */
.k-mix .legende { margin-bottom: 12px; }
.k-mix .legende i { border-radius: 0; width: 14px; height: 12px; }
.k-mixzeile { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 14px; }
.k-mixzeile p { margin: 0; font-weight: 700; font-size: 15px; }
.k-mixzeile p small { display: block; font-weight: 400; font-size: 12.5px; color: var(--text-2); }
.k-stapel { display: flex; height: 40px; gap: 2px; }
.k-stapel span { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 13px; font-weight: 700; min-width: 0; overflow: hidden; white-space: nowrap; }
.k-stapel span.hell { color: var(--tinte); }
@media (max-width: 560px) { .k-mixzeile { grid-template-columns: 1fr; gap: 6px; } }

/* ---------- SVG-Texte aus Dia ---------- */
.dia .name-label { font-size: 13px; fill: var(--text-1); }
.dia .wert-label { font-size: 12px; fill: var(--text-2); }
.dia .achse text { font-size: 11.5px; fill: var(--text-3); }

/* ---------- Hinweisfenster und Rest ---------- */
.tipp { border-radius: 0; border: 1px solid var(--tinte); box-shadow: var(--schatten); }
.tipp .t-zeile i { border-radius: 0; }
.status { font-size: 12.5px; }
.status::before { border-radius: 0; }
.status.warn { color: #8a5a00; }
.k-selbst > h2 { border-top-width: 2px; }
.k-knoepfe { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; }
.a-fuss { border-top: 5px solid var(--tinte); }
.zeichen-link { border-radius: 0; }
.zeichen-link:hover { background: var(--flaeche-2); color: var(--kirsche-text); }

@media (max-width: 640px) {
  .k-kopf { padding-top: 18px; }
  .k-zeitungskopf { margin-bottom: 18px; }
  .k-vorspann p, .a-titel .k-vorspann p { font-size: 16px; }
  .abschnitt { margin-top: 40px; }
  .gitter { row-gap: 22px; }
}

/* Überschriften ausgeglichen umbrechen, gedrückter Zustand */
.a-titel h1, .abschnitt > h2, .k-meldung h3, .karte-kopf h2 { text-wrap: balance; }
.knopf:active, .wahl button:active, .karte-kopf .tabelle-knopf:active { transform: translateY(1px); }
.knopf { white-space: nowrap; }

/* Verweis auf „Datei erkennen lassen“ */
.erkennen-satz { display: block; margin-top: 6px; font-size: 14px; color: var(--text-2); }
.erkennen-satz a { color: var(--akzent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
