/* nachkalkulation.css — „Wo ist das Geld geblieben?“ (nur diese Seite).
   Richtung „Brücke“: heller, kühler Grund, Olivgrün und Ocker als Hausfarben, schmale kräftige Schrift
   (Saira Condensed für Zahlen und Überschriften, Saira für Text). Eckige Karten mit kräftiger Oberkante.
   Die Seite ist bewusst nur hell. */

@font-face { font-family: "Saira Condensed"; src: url("../../schrift/muster/saira-condensed-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("../../schrift/muster/saira-condensed-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Saira Condensed"; src: url("../../schrift/muster/saira-condensed-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Saira"; src: url("../../schrift/muster/saira-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Saira"; src: url("../../schrift/muster/saira-latin-500-normal.woff2") format("woff2"); font-weight: 500 700; font-display: swap; }

:root, :root[data-theme="light"] {
  color-scheme: light;
  --flaeche-0: #e9eff0;          /* kühles Hellgrau-Blau als Grund */
  --flaeche-1: #ffffff;
  --flaeche-2: #dde5e7;
  --linie: #bccacd;
  --raster: #e2e9eb;
  --text-1: #141c1a;
  --text-2: #3c4a47;
  --text-3: #5b6a67;
  --oliv: #56691a;               /* Hausfarbe 1 */
  --oliv-tief: #3a4810;
  --oliv-hell: #c3cf96;
  --ocker: #c4880f;              /* Hausfarbe 2 */
  --ocker-text: #8a5c00;
  --akzent: #56691a;
  --akzent-text: #3a4810;
  /* Brücke: Summen, besser, schlechter, Gemeinkosten */
  --b-summe: #1e2a26;
  --b-gut: #56691a;
  --b-schlecht: #b0284a;
  --b-gk: #c4880f;
  --gut-text: #3a4810;
  --kritisch-text: #9c1f3e;
  /* Soll hell, Ist dunkel, überall gleich */
  --soll: #b9c78a;
  --ist: #3a4810;
  /* Kostenarten, feste Plätze */
  --k-lohn: #56691a; --k-material: #d29a2a; --k-fremd: #8e4a86; --k-geraete: #33434c; --k-sonst: #b3b0a3;
  --s1: #56691a; --s2: #c4880f; --s3: #8e4a86; --s4: #33434c; --s5: #b0284a; --s6: #b3b0a3; --s7: #6f7f2c; --s8: #8a5c00;
  --schatten: 0 1px 0 rgb(20 40 40 / .05), 0 12px 26px -18px rgb(20 40 40 / .35);
  --zahl: "Saira Condensed", "Arial Narrow", system-ui, sans-serif;
  --kopfschrift: "Saira Condensed", "Arial Narrow", system-ui, sans-serif;
}

html { overflow-x: clip; }
body { overflow-x: clip; font-family: "Saira", system-ui, sans-serif; font-size: 16px; }
:focus-visible { outline: 2px solid var(--ocker); 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(--ocker); outline-offset: 2px; }
.knopf:has(input:focus-visible) { outline: 2px solid var(--ocker); outline-offset: 2px; }
.breite { width: min(100% - 32px, 1600px); }

/* ---------- Kopfleiste ---------- */
.a-kopf { background: var(--b-summe); border-bottom: 4px solid var(--ocker); }
.a-kopf .a-zurueck { color: #d7e0dd; }
.a-kopf .a-zurueck:hover { color: #f7faf9; }
.a-kopf .a-name { color: #f7faf9; font-family: var(--kopfschrift); font-weight: 700; font-size: 18px; letter-spacing: .02em; text-transform: uppercase; }
.a-kopf :focus-visible { outline-color: #f2c35a; }

/* ---------- Seitenkopf mit Ablage ---------- */
.n-kopf { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .9fr); gap: 28px 56px; align-items: end; padding: 40px 0 26px; }
.a-titel h1 { font-family: var(--kopfschrift); font-weight: 700; font-stretch: normal; font-size: clamp(44px, 7vw, 104px); line-height: 1.02; letter-spacing: -.01em; text-transform: uppercase; max-width: 11ch; text-wrap: balance; margin-bottom: 18px; color: var(--b-summe); }
.a-titel p { font-size: 18px; max-width: 54ch; color: var(--text-2); }
.a-schild { border-radius: 0; background: var(--flaeche-1); border: 1px solid var(--linie); }
.a-schild i { background: var(--ocker); border-radius: 0; }
.a-schild.eigen i { background: var(--oliv); }
@media (max-width: 980px) { .n-kopf { grid-template-columns: 1fr; padding-top: 30px; } }

.ablage { grid-template-columns: 1fr; gap: 12px; margin: 0; border-radius: 0; border: 1px solid var(--linie); border-top: 6px solid var(--oliv); background: var(--flaeche-1); box-shadow: var(--schatten); }
.ablage svg { display: none; }
.ablage b { font-family: var(--kopfschrift); font-size: 20px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.ablage span { display: block; }
.ablage .vorlage-satz { margin-top: 6px; color: var(--text-1); }
.ablage .knoepfe { justify-content: flex-start; }
.ablage.drueber { border-color: var(--ocker); border-top-color: var(--ocker); }
.knopf { border-radius: 0; font-weight: 600; background: var(--oliv); white-space: nowrap; }
.knopf:active { background: var(--b-summe); }
.wahl button:active { background: var(--flaeche-1); }
.knopf:disabled, .wahl button:disabled { opacity: .5; cursor: not-allowed; }
.knopf:hover { background: var(--oliv-tief); filter: none; }
.knopf.leise { background: var(--flaeche-1); color: var(--text-1); border-color: var(--linie); }
.knopf.leise:hover { background: var(--flaeche-2); }
.n-hinweis { margin: 14px 0 0; font-size: 14px; color: var(--text-2); max-width: 120ch; }

/* ---------- Brücke ---------- */
.n-bruecke-abschnitt { margin-top: 36px; }
.n-bruecke-kopf { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: end; justify-content: space-between; margin-bottom: 14px; }
.n-bruecke-kopf h2 { text-wrap: balance; font-family: var(--kopfschrift); font-size: clamp(28px, 3.4vw, 46px); font-weight: 700; line-height: 1; text-transform: uppercase; margin: 0 0 6px; color: var(--b-summe); }
.n-bruecke-kopf p { margin: 0; color: var(--text-2); max-width: 70ch; }
.wahl { border-radius: 0; background: var(--flaeche-2); flex-wrap: wrap; }
.wahl button { border-radius: 0; min-height: 40px; font-weight: 600; }
.wahl button[aria-pressed="true"] { background: var(--b-summe); color: #f7faf9; box-shadow: none; }
.karte.n-bruecke { border-top-width: 8px; padding: 22px 24px 18px; }
.n-bruecke .karte-kopf h2 { font-size: 20px; }
#d-bruecke { min-height: 200px; }
.dia .b-name { fill: var(--text-1); font-family: var(--zahl); font-size: 13.5px; font-weight: 500; }
.dia .b-name.summe { font-weight: 700; }
.dia .b-bruch { stroke: var(--flaeche-1); stroke-width: 3; fill: none; }
.dia .b-wert { font-family: var(--zahl); font-size: 17px; font-weight: 700; fill: var(--text-1); }
.dia .b-wort { font-size: 11.5px; font-weight: 500; fill: var(--text-2); }
.dia .b-wert.gut, .dia .b-wort.gut { fill: var(--gut-text); }
.dia .b-wert.schlecht, .dia .b-wort.schlecht { fill: var(--kritisch-text); }
.dia .b-verbinder { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.dia .b-null { stroke: var(--text-1); stroke-width: 1.5; }
.b-balken { opacity: 0; animation: b-auf .5s ease-out forwards; }
@keyframes b-auf { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .b-balken { animation: none; opacity: 1; } }

/* Brücke als Zeilen (schmale Fenster) */
.b-zeilen { display: grid; gap: 4px; }
.b-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 6px 0; border-top: 1px solid var(--raster); align-items: baseline; }
.b-zeile:first-child { border-top: 0; }
.b-zeile .bz-name { font-size: 14px; font-weight: 500; min-width: 0; }
.b-zeile .bz-wert { font-family: var(--zahl); font-size: 18px; font-weight: 700; text-align: right; white-space: nowrap; }
.b-zeile .bz-wert small { display: block; font-family: "Saira", system-ui, sans-serif; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.b-zeile .bz-spur { grid-column: 1 / -1; position: relative; height: 16px; background: var(--raster); }
.b-zeile .bz-spur i { position: absolute; top: 0; bottom: 0; }
.b-zeile .bz-spur b { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text-1); }
.b-zeile.summe .bz-name { font-weight: 700; }
.b-zeile.summe + .b-zeile, .b-zeile + .b-zeile.summe { border-top-color: var(--linie); }
.bz-wert.gut, .bz-wert.gut small { color: var(--gut-text); }
.bz-wert.schlecht, .bz-wert.schlecht small { color: var(--kritisch-text); }

/* Regler */
.n-regler { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 0; }
.n-regel { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; background: var(--flaeche-1); border: 1px solid var(--linie); border-top: 4px solid var(--ocker); padding: 14px 18px; }
.n-regel-name { font-weight: 600; font-size: 15px; }
.n-regel-wert { font-family: var(--zahl); font-size: 26px; font-weight: 700; line-height: 1; }
.n-regel input { grid-column: 1 / -1; width: 100%; min-height: 32px; accent-color: var(--oliv); margin: 4px 0 0; }
.n-regel-erkl { grid-column: 1 / -1; font-size: 13px; color: var(--text-2); }
@media (max-width: 760px) { .n-regler { grid-template-columns: 1fr; } }

/* ---------- Gegenüberstellungen ---------- */
.n-gegen { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.n-gegen[hidden] { display: none; }
@media (max-width: 900px) { .n-gegen { grid-template-columns: 1fr; } }
.n-gg { background: var(--flaeche-1); border: 1px solid var(--linie); border-top: 8px solid var(--oliv); padding: 20px 24px 18px; box-shadow: var(--schatten); min-width: 0; }
.n-gg + .n-gg { border-top-color: var(--ocker); }
.n-gg h3 { margin: 0; font-family: var(--kopfschrift); font-size: 24px; font-weight: 700; text-transform: uppercase; letter-spacing: .01em; }
.n-gg .gg-erkl { margin: 2px 0 14px; font-size: 14px; color: var(--text-2); max-width: 60ch; }
.gg-paar { display: grid; grid-template-columns: minmax(0, 1fr) 2px minmax(0, 1fr); gap: 0 22px; align-items: end; }
.gg-trenn { align-self: stretch; background: var(--linie); }
.gg-seite { min-width: 0; }
.gg-wer { display: block; font-size: 14px; font-weight: 600; color: var(--text-3); }
.gg-zahl { display: block; font-family: var(--zahl); font-weight: 700; font-size: clamp(34px, 4.6vw, 64px); line-height: 1; letter-spacing: -.01em; margin: 4px 0 2px; white-space: nowrap; }
.gg-seite.ist .gg-zahl { color: var(--b-summe); }
.gg-seite.plan .gg-zahl { color: var(--text-3); }
.gg-pz { display: block; font-size: 14px; color: var(--text-2); }
.gg-diff { margin: 14px 0 0; padding-top: 10px; border-top: 1px solid var(--raster); font-size: 15px; }
.gg-diff b { font-family: var(--zahl); font-size: 22px; font-weight: 700; }
.gg-diff.gut b { color: var(--gut-text); }
.gg-diff.schlecht b { color: var(--kritisch-text); }
.gg-neben { margin: 6px 0 0; font-size: 13.5px; color: var(--text-2); }
@media (max-width: 420px) { .gg-paar { gap: 0 12px; } .gg-zahl { font-size: 30px; } .n-gg { padding: 16px 16px 14px; } }

/* ---------- Abschnitte und Karten: eckig, kräftige Oberkante ---------- */
.abschnitt { margin-top: 56px; }
.abschnitt > h2 { text-wrap: balance; font-family: var(--kopfschrift); font-size: clamp(26px, 2.8vw, 38px); font-weight: 700; text-transform: uppercase; line-height: 1.05; margin-bottom: 6px; color: var(--b-summe); }
.abschnitt > p.unter { max-width: 74ch; }
.gitter { gap: 12px; }
.karte { border-radius: 0; border-top: 5px solid var(--oliv); padding: 20px 20px 16px; box-shadow: var(--schatten); }
.abschnitt:nth-of-type(even) .karte { border-top-color: var(--ocker); }
.karte-kopf h2 { font-family: var(--kopfschrift); font-size: 20px; font-weight: 700; letter-spacing: .01em; }
.karte-kopf .tabelle-knopf { border-radius: 0; min-height: 36px; }
.tipp { border-radius: 0; }
.tipp .t-zeile b { font-family: var(--zahl); font-weight: 600; font-size: 14px; }
.tabelle-huelle { border-radius: 0; }
table.daten td.z { font-family: var(--zahl); font-size: 14px; }
.legende i { border-radius: 0; }
.einsicht b { font-weight: 600; color: var(--text-1); }
.dia .achse text, .dia text.achse { font-size: 11.5px; }

/* Paarbalken (kalkuliert hell, tatsächlich dunkel) */
.p-liste { display: grid; gap: 2px; }
.p-zeile { display: grid; grid-template-columns: minmax(150px, 1.1fr) minmax(0, 2fr) 172px; gap: 4px 14px; align-items: center; padding: 6px 0; border-top: 1px solid var(--raster); }
.p-zeile:first-child { border-top: 0; }
.p-name { font-size: 14px; font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.p-name small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.p-spur { display: grid; gap: 3px; min-width: 0; }
.p-spur i { display: block; height: 9px; min-width: 2px; }
.p-spur i.soll { background: var(--soll); }
.p-spur i.ist { background: var(--ist); height: 12px; }
.p-wert { text-align: right; font-family: var(--zahl); font-size: 18px; font-weight: 700; white-space: nowrap; }
.p-wert small { display: block; font-family: "Saira", system-ui, sans-serif; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.p-wert.gut, .p-wert.gut small { color: var(--gut-text); }
.p-wert.schlecht, .p-wert.schlecht small { color: var(--kritisch-text); }
.p-schluss { margin: 8px 0 0; font-size: 13px; color: var(--text-3); }
.p-schluss i { display: inline-block; width: 14px; height: 10px; margin: 0 5px 0 0; vertical-align: -1px; }
.p-schluss i.soll { background: var(--soll); }
.p-schluss i.ist { background: var(--ist); margin-left: 14px; }
@media (max-width: 640px) {
  .p-zeile { grid-template-columns: minmax(0, 1fr) auto; }
  .p-spur { grid-column: 1 / -1; grid-row: 2; }
}

/* Abweichung mit Mittellinie */
.a-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 7px 0; border-top: 1px solid var(--raster); align-items: baseline; }
.a-zeile:first-child { border-top: 0; }
.a-name { font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.a-name i { width: 10px; height: 10px; flex: none; }
.a-name small { color: var(--text-3); font-size: 12px; font-weight: 400; }
.a-wert { font-family: var(--zahl); font-size: 18px; font-weight: 700; white-space: nowrap; text-align: right; }
.a-wert small { font-family: "Saira", system-ui, sans-serif; font-size: 11.5px; font-weight: 500; margin-left: 4px; }
.a-wert.gut { color: var(--gut-text); } .a-wert.schlecht { color: var(--kritisch-text); }
.a-spur { grid-column: 1 / -1; position: relative; height: 12px; background: var(--raster); }
.a-spur i { position: absolute; top: 0; bottom: 0; }
.a-spur b { position: absolute; left: 50%; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--text-1); }

/* Lohnanteil: zwei gestapelte Balken */
.l-reihe { margin: 4px 0 14px; }
.l-kopf { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.l-kopf span { font-size: 14px; font-weight: 600; color: var(--text-3); }
.l-kopf b { font-family: var(--zahl); font-size: 22px; font-weight: 700; }
.l-balken { display: flex; height: 30px; gap: 2px; }
.l-balken i { display: block; min-width: 2px; }
.l-leg { display: grid; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; font-size: 13px; }
.l-leg li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; }
.l-leg li i { width: 12px; height: 12px; }
.l-leg li span { color: var(--text-2); }
.l-leg li b { font-family: var(--zahl); font-weight: 600; font-size: 15px; text-align: right; min-width: 48px; }

/* Nachträge */
.nt-liste { display: grid; gap: 0; }
.nt-zeile { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(84px, 1fr)) minmax(150px, auto); gap: 4px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--raster); }
.nt-zeile.kopf { border-top: 0; padding-top: 0; font-size: 13px; font-weight: 600; color: var(--text-3); }
.nt-name { font-weight: 500; min-width: 0; overflow-wrap: anywhere; }
.nt-name small { display: block; font-size: 12px; color: var(--text-3); font-weight: 400; }
.nt-z { text-align: right; font-family: var(--zahl); font-size: 18px; font-weight: 600; white-space: nowrap; }
.nt-z.gut { color: var(--gut-text); } .nt-z.schlecht { color: var(--kritisch-text); }
.nt-z em { display: none; font-style: normal; font-family: "Saira", system-ui, sans-serif; font-size: 12px; font-weight: 500; color: var(--text-3); margin-right: 6px; }
.nt-status { justify-self: end; }
@media (max-width: 760px) {
  .nt-zeile { grid-template-columns: 1fr 1fr 1fr; }
  .nt-zeile.kopf { display: none; }
  .nt-name { grid-column: 1 / -1; }
  .nt-z { text-align: left; font-size: 16px; }
  .nt-z em { display: block; }
  .nt-status { grid-column: 1 / -1; justify-self: start; }
}
.status { font-size: 12.5px; }
.status.warn { color: #8a5c00; }
.status.kritisch { color: var(--kritisch-text); }
.status.gut { color: var(--gut-text); }

/* Lehre-Tabelle */
#d-lehre .tabelle-huelle { max-height: none; }
.n-wisch { display: none; margin: 0 0 6px; font-size: 13px; color: var(--text-3); }
@media (max-width: 900px) { .n-wisch { display: block; } }
.n-knoepfe { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; }

/* Befunde */
.n-befunde { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.n-befunde li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 18px; padding: 12px 0; border-top: 1px solid var(--raster); }
.n-befunde li:first-child { border-top: 0; }
.n-befunde li p { margin: 0; max-width: 75ch; }
.n-befunde li b { font-weight: 600; }
@media (max-width: 640px) { .n-befunde li { grid-template-columns: 1fr; } }

.m-leer, .n-leer { margin: 8px 0; color: var(--text-3); font-size: 14px; }

/* Fuß */
.a-fuss { border-top: 4px solid var(--oliv); background: var(--flaeche-1); }
.zeichen-link { border-radius: 0; }

/* Umschalter über der Brücke */
.n-wahlen { display: flex; flex-wrap: wrap; gap: 8px; }

/* Deckungsbeitrag aufgeteilt in Gemeinkosten und Ergebnis */
.tl { margin-top: 14px; display: grid; gap: 6px; }
.tl-reihe { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.tl-wer { font-size: 13px; font-weight: 600; color: var(--text-3); }
.tl-balken { position: relative; display: flex; height: 18px; background: var(--raster); }
.tl-balken i { display: block; height: 100%; }
.tl-balken b { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--text-1); }
.tl-gk { background: var(--b-gk); }
.tl-erg { background: var(--b-gut); }
.tl-erg.neg { background: repeating-linear-gradient(135deg, var(--b-schlecht) 0 4px, transparent 4px 7px); }
.tl-zahl { font-family: var(--zahl); font-weight: 600; font-size: 16px; text-align: right; min-width: 74px; }
.tl-leg { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.tl-leg i { display: inline-block; width: 12px; height: 10px; margin: 0 5px 0 0; vertical-align: -1px; }
.tl-leg i + i, .tl-leg i:nth-of-type(2) { margin-left: 12px; }

/* 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; }
