:root {
  --bg: #101317; --panel: #161a1f; --panel2: #1c2128; --panel3: #262d36; --linie: #2b323c;
  --text: #e9edf2; --leise: #9aa6b3; --akzent: #fcd321; --akzent-ink: #15181c;
  --blau: #5b8fd9; --rot: #ef5b5b; --gruen: #3fae78; --orange: #f2891d; --gedaemmt: #e1d28a; --geplant: #86b6ff;
  --links: 600px; --kopf: 58px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto; height: 100dvh; overflow: hidden;
  background: var(--bg); color: var(--text);
  font: 14px/1.45 "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--akzent); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: #9cc3f5; }
.code { display: inline-block; min-width: 26px; padding: 0 5px; margin-right: 6px; border-radius: 4px; background: var(--panel3); color: var(--text); font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.code.krit { background: #5a2427; color: #ffb3b3; }
.rot { color: #ff7b7b !important; }
.klein { font-size: 12px; color: var(--leise); }
.hinweis { font-size: 12px; color: var(--leise); }

/* Kopf */
.kopf { display: flex; align-items: center; gap: 16px; min-height: var(--kopf); padding: 0 16px; background: var(--panel); border-bottom: 1px solid var(--linie); }
.marke { display: flex; align-items: center; gap: 10px; min-width: 0; }
.logo { width: 34px; height: 34px; border-radius: 8px; background: var(--akzent); color: var(--akzent-ink); display: grid; place-items: center; flex: none; }
.marke b { display: block; font-size: 15px; white-space: nowrap; }
.marke small { display: block; font-size: 12px; color: var(--leise); white-space: nowrap; }
.reiter { display: flex; gap: 2px; align-self: stretch; margin-left: 6px; }
.reiter button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 12px; color: var(--leise); font-weight: 600; white-space: nowrap; }
.reiter button:hover { color: var(--text); }
.reiter button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--akzent); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.umschalter { display: flex; padding: 3px; gap: 3px; background: var(--bg); border: 1px solid var(--linie); border-radius: 8px; }
.umschalter button { background: none; border: 0; border-radius: 6px; padding: 4px 10px; color: var(--leise); font-weight: 600; text-align: left; line-height: 1.25; }
.umschalter button small { display: block; font-weight: 400; font-size: 11px; }
.umschalter button[aria-pressed="true"] { background: var(--panel3); color: var(--text); }
body[data-sz="aktuell"] .umschalter button[aria-pressed="true"] { box-shadow: inset 0 -2px 0 var(--orange); }
.textknopf { background: none; border: 0; padding: 0; color: #9cc3f5; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

main { position: relative; min-height: 0; }
.tab { position: absolute; inset: 0; overflow: auto; }

/* Bühne */
#tab-gebaeude { overflow: hidden; }
.buehne { position: absolute; inset: 0; background: #cfdbe4; }
#leinwand { display: block; width: 100%; height: 100%; touch-action: none; cursor: grab; }
#leinwand:active { cursor: grabbing; }
.lade { position: absolute; inset: 0; display: grid; place-items: center; color: #3b4a58; font-weight: 600; pointer-events: none; }
.buehne.bereit .lade { display: none; }
.kein-3d { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); max-width: 420px; padding: 18px; border-radius: 10px; background: var(--panel); border: 1px solid var(--linie); text-align: center; }
.panel { background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 10px; }

.karte-ausgaben { position: absolute; left: 16px; top: 16px; width: 310px; padding: 14px 16px 12px; background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25); }
.k-titel { display: block; font-size: 12px; color: var(--leise); }
.k-zahl { display: block; font-size: 30px; line-height: 1.15; margin: 2px 0; letter-spacing: -0.5px; }
.karte-ausgaben small { display: block; color: var(--leise); font-size: 12px; }
.balken { height: 6px; margin: 8px 0; border-radius: 3px; background: var(--panel3); overflow: hidden; }
.balken i { display: block; height: 100%; background: var(--akzent); border-radius: 3px; }
.k-arbeit { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--linie); }
.k-arbeit > span { font-size: 12px; font-weight: 700; }
.k-arbeit ul { list-style: none; margin: 6px 0 0; padding: 0; }
.k-arbeit li { display: flex; align-items: flex-start; padding: 3px 4px; margin: 0 -4px; border-radius: 5px; font-size: 12.5px; line-height: 18px; cursor: pointer; }
.k-arbeit li:hover { background: var(--panel3); }

.werkzeuge { position: absolute; right: 16px; top: 16px; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; transition: right 0.2s ease; }
body:has(#detail:not([hidden])) .werkzeuge { right: 396px; }
.segment { display: flex; padding: 3px; gap: 3px; background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 8px; }
.segment button { background: none; border: 0; border-radius: 6px; padding: 5px 12px; color: var(--leise); font-weight: 600; }
.segment button[aria-pressed="true"] { background: var(--akzent); color: var(--akzent-ink); }
.ebenen-knopf { padding: 6px 12px; border-radius: 8px; border: 1px solid var(--linie); background: rgba(22, 26, 31, 0.94); font-weight: 600; }
.ebenen-knopf[aria-expanded="true"] { border-color: var(--akzent); }
.ebenen { width: 240px; padding: 10px 12px; background: rgba(22, 26, 31, 0.96); border: 1px solid var(--linie); border-radius: 10px; }
.ebenen label { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; cursor: pointer; }
.ebenen input { accent-color: var(--akzent); width: 15px; height: 15px; }
.ebenen hr { border: 0; border-top: 1px solid var(--linie); margin: 6px 0; }

.unten { position: absolute; left: 16px; right: 16px; bottom: 14px; display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.unten > * { pointer-events: auto; }
.kameras { display: flex; gap: 4px; padding: 3px; background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 8px; overflow-x: auto; scrollbar-width: none; }
.kameras button { background: none; border: 0; border-radius: 6px; padding: 6px 10px; color: var(--text); font-size: 13px; white-space: nowrap; }
.kameras button:hover { background: var(--panel3); }
.legende { display: flex; gap: 12px; padding: 7px 12px; background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 8px; font-size: 12px; color: var(--leise); }
.legende span { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legende i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.lg-fertig { background: linear-gradient(135deg, #efebe3 0 50%, #3b3e44 50%); }
.lg-arbeit { background: var(--orange); }
.lg-bestand { background: #c4b9a1; }
.lg-geplant { border: 1.5px dashed var(--geplant); background: rgba(134, 182, 255, 0.15); }
body:has(#detail:not([hidden])) .legende { margin-right: 380px; }

.buehne.planmodus .ebenen-knopf, .buehne.planmodus .ebenen, .buehne.planmodus .unten { display: none; }

/* Pläne */
.plan-ansicht { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 16px; padding: 16px 16px 70px 342px; background: #0d1620; background-image: linear-gradient(rgba(120, 150, 180, 0.06) 1px, transparent 1px), linear-gradient(90deg, rgba(120, 150, 180, 0.06) 1px, transparent 1px); background-size: 24px 24px; }
.plan-zeichnung { min-width: 0; min-height: 0; display: grid; place-items: center; }
.plan-zeichnung svg { width: 100%; height: 100%; max-height: 100%; }
.plan-seite { display: flex; flex-direction: column; gap: 12px; padding-top: 50px; min-height: 0; }
.plan-liste { flex: 1; min-height: 0; overflow: auto; padding: 12px; background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 10px; }
.plan-liste h3 { margin: 0 0 2px; font-size: 15px; }
.plan-liste p { margin: 0 0 8px; }
.fortschritt { list-style: none; margin: 0; padding: 0; }
.fortschritt li { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 2px; padding: 5px 4px 8px; font-size: 12.5px; border-radius: 5px; cursor: pointer; }
.fortschritt li:hover { background: var(--panel3); }
.fortschritt .fn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fortschritt .fp { color: var(--leise); margin-left: 6px; }
.fortschritt i { position: absolute; left: 4px; right: 4px; bottom: 3px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--gruen) calc(var(--f) * 100%), var(--panel3) 0); }
.plan-legende { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 8px 12px; font-size: 12px; color: var(--leise); background: rgba(22, 26, 31, 0.94); border: 1px solid var(--linie); border-radius: 10px; }
.plan-legende span { display: flex; align-items: center; gap: 5px; }
.plan-legende i { width: 12px; height: 12px; display: inline-block; border: 1px solid; }
.plan-svg { font-family: inherit; }
.plan-svg * { vector-effect: non-scaling-stroke; }
.p-zelle, .p-fenster, .p-balkon, .p-dach, .p-pv { stroke-width: 1px; }
.p-alt, i.p-alt { fill: rgba(150, 165, 180, 0.08); stroke: #7f93a8; background: rgba(150, 165, 180, 0.15); border-color: #7f93a8 !important; }
.p-fenster.p-alt { fill: rgba(30, 45, 60, 0.9); }
.p-arbeit, i.p-arbeit { fill: url(#schraffur); stroke: var(--orange); background: rgba(242, 137, 29, 0.6); border-color: var(--orange) !important; }
.p-zwischen, i.p-zwischen { fill: rgba(225, 210, 138, 0.42); stroke: var(--gedaemmt); background: rgba(225, 210, 138, 0.5); border-color: var(--gedaemmt) !important; }
.p-neu, i.p-neu { fill: rgba(63, 174, 120, 0.42); stroke: #63d39c; background: rgba(63, 174, 120, 0.55); border-color: #63d39c !important; }
.p-geplant, i.p-geplant { fill: none; stroke: var(--geplant); stroke-dasharray: 4 3; background: transparent; border: 1px dashed var(--geplant) !important; }
.p-weg { fill: none; stroke: none; }
.p-da { fill: rgba(194, 198, 203, 0.2); stroke: #c2c6cb; }
.p-keller { fill: rgba(30, 45, 60, 0.9); stroke: #6f8296; stroke-width: 1px; }
.p-geruest { fill: rgba(194, 198, 203, 0.06); }
.p-geruest-l { stroke: rgba(194, 198, 203, 0.32); stroke-width: 1px; }
.p-gelaende { stroke: #6f8296; stroke-width: 2px; }
.p-ortgang { fill: none !important; stroke-width: 5px !important; }
.p-text { fill: #9fb1c4; font-size: 0.8px; }
.p-titel { fill: #d6e0ea; font-size: 0.95px; font-weight: 600; }

/* Detailtafel */
.detail { position: fixed; z-index: 30; right: 16px; top: calc(var(--kopf) + 16px); bottom: 92px; width: 364px; overflow: auto; padding: 16px; background: rgba(22, 26, 31, 0.97); border: 1px solid var(--linie); border-radius: 12px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35); }
.detail h3 { margin: 2px 32px 8px 0; font-size: 17px; line-height: 1.3; }
.d-art { font-size: 12px; color: var(--leise); }
.schliessen { position: absolute; right: 10px; top: 10px; width: 30px; height: 30px; border: 0; border-radius: 6px; background: var(--panel3); font-size: 18px; line-height: 1; }
.chip { display: inline-block; padding: 2px 8px; margin: 0 6px 4px 0; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--panel3); color: var(--text); }
.chip.z-fertig, .chip.z-neu { background: rgba(63, 174, 120, 0.22); color: #7ee0ad; }
.chip.z-arbeit, .chip.z-arbeit2 { background: rgba(242, 137, 29, 0.22); color: #ffb26b; }
.chip.z-zwischen { background: rgba(225, 210, 138, 0.2); color: var(--gedaemmt); }
.chip.z-offen, .chip.z-alt, .chip.z-bestand { background: var(--panel3); color: var(--leise); }
.chip.z-geplant { background: rgba(134, 182, 255, 0.16); color: var(--geplant); }
.chip.z-weg, .chip.z-da { background: var(--panel3); color: var(--text); }
.chip.krit { background: rgba(239, 91, 91, 0.2); color: #ff9a9a; }
.d-vorgang { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--linie); }
.detail > .d-vorgang:nth-child(3) { margin-top: 6px; padding-top: 0; border-top: 0; }
.d-kopf { display: flex; align-items: flex-start; gap: 2px; margin-bottom: 8px; font-size: 14px; }
.d-vorgang dl { display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 4px 8px; margin: 10px 0; font-size: 13px; }
.d-vorgang dt { color: var(--leise); }
.d-vorgang dd { margin: 0; }
.d-geld { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.d-geld div { padding: 8px 10px; background: var(--panel2); border-radius: 8px; }
.d-geld span { display: block; font-size: 11.5px; color: var(--leise); }
.d-geld b { font-size: 17px; }
.d-warn { padding: 8px 10px; border-radius: 8px; background: rgba(242, 137, 29, 0.12); color: #ffc58f; font-size: 13px; }
.d-hinweis { font-size: 13px; color: var(--leise); }
.d-aend { padding: 8px 10px; border-radius: 8px; background: rgba(239, 91, 91, 0.12); color: #ffb3b3; font-size: 13px; }
.d-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.d-knoepfe button { padding: 6px 12px; border-radius: 7px; border: 1px solid var(--linie); background: var(--panel2); font-weight: 600; font-size: 13px; }
.d-knoepfe button:hover { border-color: var(--akzent); }

/* Bauzeitenplan */
#tab-zeitplan { display: flex; flex-direction: column; overflow: hidden; }
.leiste { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; padding: 12px 16px; border-bottom: 1px solid var(--linie); background: var(--panel); }
.leiste h2 { margin: 0; font-size: 16px; }
.schalter { display: flex; align-items: center; gap: 6px; font-weight: 600; cursor: pointer; }
.schalter input { accent-color: var(--akzent); }
.legende-mini { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 4px 6px; font-size: 12px; color: var(--leise); }
.legende-mini i { display: inline-block; margin-left: 6px; }
.lg-g { width: 18px; height: 9px; border-radius: 2px; }
.lg-g.normal { background: #355684; } .lg-g.krit { background: #8b3035; } .lg-g.fertig { background: #6f9be0; } .lg-g.basis { height: 4px; background: #8892a0; }
.lg-raute { width: 9px; height: 9px; transform: rotate(45deg); background: var(--akzent); }
.lg-bar { width: 12px; height: 10px; background: #6f9be0; border-radius: 2px; }
.lg-linie { width: 18px; height: 3px; background: var(--akzent); border-radius: 2px; }
.lg-linie.plan { background: repeating-linear-gradient(90deg, #9aa6b3 0 4px, transparent 4px 7px); }
.gantt { flex: 1; min-height: 0; overflow: auto; position: relative; }
.g-tab { position: relative; width: calc(var(--links) + var(--zeit)); min-width: 100%; padding-bottom: 24px; }
.g-kopf, .g-zeile { display: flex; }
.g-kopf { position: sticky; top: 0; z-index: 4; height: 32px; background: var(--panel); border-bottom: 1px solid var(--linie); }
.g-links { position: sticky; left: 0; z-index: 3; flex: none; width: var(--links); display: grid; grid-template-columns: 38px minmax(0, 1fr) 52px 62px 62px 68px; align-items: center; gap: 8px; padding: 0 10px; background: var(--bg); border-right: 1px solid var(--linie); font-size: 12.5px; }
.g-kopf .g-links { background: var(--panel); color: var(--leise); font-size: 12px; font-weight: 600; }
.g-r { text-align: right; }
.g-zeit { position: relative; flex: none; width: var(--zeit); }
.g-monat { position: absolute; top: 0; height: 32px; line-height: 32px; padding-left: 6px; font-size: 11.5px; color: var(--leise); border-left: 1px solid var(--linie); overflow: hidden; white-space: nowrap; }
.g-zeile { height: 28px; border-bottom: 1px solid rgba(255, 255, 255, 0.035); cursor: pointer; }
.g-zeile:hover .g-links { background: #161b21; }
.g-zeile.gewaehlt .g-links { background: #2a2614; box-shadow: inset 3px 0 0 var(--akzent); }
.g-zeile.gewaehlt { background: rgba(252, 211, 33, 0.05); }
.g-gruppe { height: 30px; cursor: default; background: var(--panel2); }
.g-gruppe .g-links { background: var(--panel2); font-weight: 700; font-size: 13px; }
.g-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.g-aend { color: var(--orange); font-weight: 800; }
.g-balken { position: absolute; z-index: 1; top: 7px; height: 14px; border-radius: 3px; background: #2f4c75; overflow: hidden; }
.g-balken i { display: block; height: 100%; background: #6f9be0; }
.g-balken.krit { background: #6b2a2e; }
.g-balken.krit i { background: #e5484d; }
.g-balken.verzug { box-shadow: 0 0 0 1.5px #ff7b7b; }
.g-balken.klammer { top: 11px; height: 6px; background: #3d454f; }
.g-balken.klammer i { background: #8792a0; }
.g-balken.meilenstein { width: 13px; height: 13px; top: 7px; border-radius: 2px; transform: rotate(45deg); background: var(--akzent); overflow: visible; }
.g-balken.meilenstein.krit { background: #e5484d; }
.g-basis { position: absolute; top: 22px; height: 4px; border-radius: 2px; background: #8892a0; opacity: 0.75; }
.g-basis.meilenstein { width: 7px !important; height: 7px; top: 20px; transform: rotate(45deg); }
.g-frist { position: absolute; top: 3px; bottom: 3px; width: 2px; background: #ff7b7b; z-index: 2; }
.g-raster { position: absolute; top: 0; bottom: 0; left: var(--links); width: var(--zeit); pointer-events: none; z-index: 2; }
.g-raster i { position: absolute; top: 32px; bottom: 0; width: 1px; background: rgba(255, 255, 255, 0.05); }
.g-heute { position: absolute; top: 0; bottom: 0; width: 2px; background: var(--akzent); }
.g-heute span { position: sticky; top: 36px; display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; background: var(--akzent); color: var(--akzent-ink); font-size: 11px; font-weight: 700; white-space: nowrap; }

/* Kosten und Soll/Ist */
.inhalt { max-width: 1320px; margin: 0 auto; padding: 18px 16px 40px; }
.kz-reihe { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.kz { padding: 14px 16px; background: var(--panel); border: 1px solid var(--linie); border-radius: 10px; }
.kz span { display: block; font-size: 12px; color: var(--leise); }
.kz b { display: block; font-size: 24px; line-height: 1.25; margin: 2px 0; }
.kz small { display: block; font-size: 12px; color: var(--leise); }
.kz.schlecht { border-color: rgba(239, 91, 91, 0.55); }
.kz.schlecht b { color: #ff9a9a; }
.karte { margin-bottom: 14px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--linie); border-radius: 10px; }
.karte-kopf { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 10px; }
.karte h3 { margin: 0; font-size: 15px; }
.tab-scroll { overflow-x: auto; }
.kp { width: 100%; border-collapse: collapse; font-size: 13px; }
.kp th { position: sticky; top: 0; text-align: left; font-size: 12px; color: var(--leise); font-weight: 600; padding: 7px 8px; border-bottom: 1px solid var(--linie); background: var(--panel); white-space: nowrap; }
.kp td { padding: 6px 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.04); vertical-align: top; }
.kp .r { text-align: right; white-space: nowrap; }
.kp .m { color: var(--leise); font-size: 12px; }
.kp tr.kg1 td { background: var(--panel2); font-weight: 700; border-top: 1px solid var(--linie); }
.kp tr.kg2 td { font-weight: 600; color: #cfd7e0; }
.kp tr.kp-pos { cursor: pointer; }
.kp tr.kp-pos td:nth-child(2) { padding-left: 20px; }
.kp tr.kp-pos:hover td { background: #1b2027; }
.kp tr.summe td { font-weight: 800; font-size: 14px; border-top: 2px solid var(--akzent); }
.warn { color: var(--orange); cursor: help; }
.annahmen { margin: 0; padding-left: 18px; columns: 2 340px; column-gap: 28px; font-size: 13px; color: #cfd7e0; }
.annahmen li { break-inside: avoid; margin-bottom: 10px; }
.kurve { display: block; width: 100%; height: auto; }
.kurve .gitter { stroke: rgba(255, 255, 255, 0.06); }
.kurve .achse { fill: var(--leise); font-size: 11px; }
.kurve .bar { fill: #6f9be0; }
.kurve .bar.zukunft { fill: #2f4c75; }
.kurve .linie { fill: none; stroke: var(--akzent); stroke-width: 2.5; }
.kurve .linie.plan { stroke: #9aa6b3; stroke-dasharray: 5 4; stroke-width: 2; }
.kurve .heute { stroke: var(--akzent); stroke-width: 1.5; stroke-dasharray: 3 3; }
.banner { margin: 0 0 14px; padding: 10px 14px; border-radius: 8px; background: rgba(242, 137, 29, 0.1); border: 1px solid rgba(242, 137, 29, 0.35); color: #ffd2a8; font-size: 13.5px; }
.si-raster { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 14px; }
.aenderungen { list-style: none; margin: 0; padding: 0; }
.aenderungen li { padding: 10px 0; border-bottom: 1px solid var(--linie); }
.aenderungen li:last-child { border-bottom: 0; }
.aenderungen time { display: block; font-size: 12px; color: var(--leise); }
.aenderungen p { margin: 4px 0 8px; font-size: 13px; color: #cfd7e0; }
.wirkung { padding: 8px 10px; border-radius: 8px; background: var(--panel2); font-size: 12.5px; }

/* Zeitleiste */
.zeitleiste { display: grid; grid-template-columns: auto auto 190px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 16px 12px; background: var(--panel); border-top: 1px solid var(--linie); }
.abspielen { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border: 0; border-radius: 8px; background: var(--akzent); color: var(--akzent-ink); font-weight: 700; }
.abspielen[aria-pressed="true"] svg { display: none; }
.tempo { padding: 7px 10px; border-radius: 8px; border: 1px solid var(--linie); background: var(--panel2); font-size: 12.5px; white-space: nowrap; }
.datum b { display: block; font-size: 14px; white-space: nowrap; }
.datum small { display: block; font-size: 12px; color: var(--leise); }
.regler-feld { position: relative; padding-top: 20px; min-width: 0; }
.regler-marken { position: absolute; left: 9px; right: 9px; top: 0; height: 30px; pointer-events: none; }
.rm-monat { position: absolute; top: 0; transform: translateX(-50%); font-size: 10.5px; color: var(--leise); white-space: nowrap; }
.rm-monat::after { content: ""; position: absolute; left: 50%; top: 15px; width: 1px; height: 6px; background: var(--linie); }
.rm-meilenstein, .rm-aenderung { position: absolute; top: 24px; width: 9px; height: 9px; margin-left: -4.5px; transform: rotate(45deg); background: var(--text); border-radius: 1px; pointer-events: auto; }
.rm-meilenstein.rot { background: var(--rot); }
.rm-aenderung { background: var(--orange); top: 14px; width: 7px; height: 7px; margin-left: -3.5px; }
#regler { width: 100%; height: 22px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
#regler::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: var(--panel3); }
#regler::-moz-range-track { height: 4px; border-radius: 2px; background: var(--panel3); }
#regler::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: var(--akzent); border: 3px solid var(--panel); box-shadow: 0 0 0 1px var(--akzent); }
#regler::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--akzent); border: 3px solid var(--panel); }
.recht { display: flex; gap: 10px; font-size: 12px; }
.recht a { color: var(--leise); }

/* Dialog */
dialog { max-width: 640px; width: calc(100% - 32px); padding: 0; border: 1px solid var(--linie); border-radius: 12px; background: var(--panel); color: var(--text); }
dialog::backdrop { background: rgba(5, 8, 12, 0.6); }
.dlg { padding: 22px 24px; max-height: 80vh; overflow: auto; }
.dlg h2 { margin: 0 0 10px; font-size: 19px; }
.dlg h3 { margin: 16px 0 4px; font-size: 14px; color: var(--akzent); }
.dlg p { margin: 0 0 8px; color: #cfd7e0; }
.knopf-gelb { margin-top: 12px; padding: 8px 18px; border: 0; border-radius: 8px; background: var(--akzent); color: var(--akzent-ink); font-weight: 700; }

/* Tablet */
@media (max-width: 1180px) {
  .marke small { display: none; }
  .umschalter button small { display: none; }
  .kz-reihe { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .si-raster { grid-template-columns: 1fr; }
  .legende { display: none; }
}

/* Handy */
@media (max-width: 760px) {
  :root { --links: 230px; --kopf: 104px; }
  .kopf { flex-wrap: wrap; gap: 6px 10px; padding: 8px 12px 0; }
  .marke b { font-size: 14px; }
  .logo { width: 30px; height: 30px; }
  .kopf-rechts { margin-left: auto; gap: 8px; }
  .textknopf { font-size: 12.5px; }
  .umschalter button { padding: 4px 8px; font-size: 12.5px; }
  .reiter { order: 3; width: calc(100% + 24px); margin: 0 -12px; padding: 0 4px; overflow-x: auto; scrollbar-width: none; height: 42px; }
  .reiter button { padding: 0 10px; }
  .karte-ausgaben { left: 10px; top: 10px; width: min(230px, 58vw); padding: 10px 12px; }
  .k-zahl { font-size: 22px; }
  .k-arbeit ul { display: none; }
  .werkzeuge { right: 10px; top: 10px; }
  body:has(#detail:not([hidden])) .werkzeuge { right: 10px; }
  .ebenen { width: 210px; }
  .unten { left: 10px; right: 10px; bottom: 10px; }
  .kameras { max-width: 100%; }
  .kameras button { padding: 6px 8px; font-size: 12.5px; }
  .detail { left: 8px; right: 8px; width: auto; top: auto; bottom: 162px; max-height: calc(100dvh - 290px); }
  .plan-ansicht { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; padding: 56px 10px 60px; }
  .buehne.planmodus .karte-ausgaben { display: none; }
  .plan-seite { padding-top: 0; }
  .plan-liste { max-height: 26vh; }
  .zeitleiste { grid-template-columns: auto auto minmax(0, 1fr); gap: 8px 10px; padding: 8px 12px 10px; }
  .regler-feld { grid-column: 1 / -1; order: 5; }
  .recht { grid-column: 1 / -1; order: 6; justify-content: center; }
  .rm-monat.ungerade { display: none; }
  .tempo { padding: 6px 8px; }
  .abspielen { padding: 8px 12px; }
  .g-links { grid-template-columns: 34px minmax(0, 1fr); }
  .g-links > span:nth-child(n + 3) { display: none; }
  .kz b { font-size: 19px; }
  .kz-reihe { gap: 8px; }
  .inhalt { padding: 12px 10px 30px; }
  .leiste .hinweis { display: none; }
}
.t-kurz { display: none; }
@media (max-width: 760px) {
  .t-lang { display: none; }
  .t-kurz { display: inline; }
}
@media (max-width: 420px) {
  .umschalter button { font-size: 12px; padding: 4px 6px; }
  .marke b { font-size: 13px; white-space: normal; line-height: 1.2; }
}
@media (prefers-reduced-motion: reduce) {
  .werkzeuge { transition: none; }
}
