/* v766: Terminplan je Betriebsstelle – Vorgangsliste mit Zeitleiste, Farben je Vorgang (exakt wie gewählt), Basispläne
   als Spuren unter dem Balken, Verzug in Arbeitstagen. Alles unter #view-terminplan; eigene Farbtokens für Tag/Nacht. */
#view-terminplan {
  --tp-bg: #f4f6f9; --tp-surface: #ffffff; --tp-surface-2: #f8fafc; --tp-surface-3: #f1f4f8;
  --tp-border: #e3e8ef; --tp-border-strong: #cfd6e0; --tp-grid: rgba(15, 26, 42, .06); --tp-we: rgba(15, 26, 42, .028);
  --tp-text: #0f1a2a; --tp-text-2: #44536a; --tp-text-3: #5f6b7f;
  --tp-work: #2563eb; --tp-work-soft: #eaf1ff; --tp-work-line: #bfd3ff; --tp-on-work: #ffffff;
  --tp-warn: #a15c00; --tp-warn-soft: #fff6e5; --tp-warn-line: #f5d9a8; --tp-ok: #0a7d56;
  --tp-shadow-sm: 0 1px 2px rgba(15, 26, 42, .05); --tp-shadow: 0 1px 2px rgba(15, 26, 42, .04), 0 2px 8px -2px rgba(15, 26, 42, .06);
  --tp-shadow-pop: 0 18px 40px -12px rgba(15, 26, 42, .28), 0 4px 12px -4px rgba(15, 26, 42, .12);
  --tp-font: "Segoe UI Variable Text", "Segoe UI", Inter, system-ui, -apple-system, Roboto, Arial, sans-serif;
  --tp-font-display: "Segoe UI Variable Display", "Segoe UI", Inter, system-ui, -apple-system, Roboto, sans-serif;
  --label: 292px;
}
html[data-theme="dark"] #view-terminplan {
  --tp-bg: #1a1d21; --tp-surface: #21252b; --tp-surface-2: #252a31; --tp-surface-3: #2a3038;
  --tp-border: #323942; --tp-border-strong: #424b56; --tp-grid: rgba(255, 255, 255, .055); --tp-we: rgba(255, 255, 255, .022);
  --tp-text: #eef1f5; --tp-text-2: #bac3cf; --tp-text-3: #8d97a5;
  --tp-work: #6b9bff; --tp-work-soft: rgba(107, 155, 255, .14); --tp-work-line: rgba(107, 155, 255, .38); --tp-on-work: #0b1424;
  --tp-warn: #f2b24c; --tp-warn-soft: rgba(242, 178, 76, .13); --tp-warn-line: rgba(242, 178, 76, .36); --tp-ok: #3ccf95;
  --tp-shadow-sm: 0 1px 2px rgba(0, 0, 0, .3); --tp-shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 4px 14px -6px rgba(0, 0, 0, .4);
  --tp-shadow-pop: 0 22px 48px -12px rgba(0, 0, 0, .6), 0 4px 14px -4px rgba(0, 0, 0, .4);
}
body[data-app-view="terminplan"] .app-layout, body[data-app-view="terminplan"] .app-layout > main { max-width: none; width: 100%; margin: 0; padding: 0; display: block; }
body[data-app-view="terminplan"] { background: var(--bg); }
#view-terminplan { --tab: clamp(540px, 44vw, 676px); background: var(--tp-bg); color: var(--tp-text); font-family: var(--tp-font); min-height: calc(100vh - 60px); }
#view-terminplan button { font-family: var(--tp-font); box-shadow: none; margin: 0; width: auto; height: auto; min-height: 0; padding: 0; line-height: 1.2; }
#view-terminplan .vg { position: relative; display: grid; gap: 16px; padding: 20px 24px 28px; }

/* Kopf */
#view-terminplan .vg-kopf { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
#view-terminplan .vg-titel { display: grid; gap: 2px; }
#view-terminplan .vg-eyebrow { color: var(--tp-text-3); font-size: 11.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; }
#view-terminplan .vg-titel h2 { margin: 0; font: 650 26px/1.15 var(--tp-font-display); letter-spacing: -.01em; color: var(--tp-text); }
#view-terminplan .vg-stand { color: var(--tp-text-2); font-size: 13px; }
#view-terminplan .vg-werkzeuge { display: flex; align-items: center; gap: 10px; }
#view-terminplan .vg-seg { display: inline-flex; height: 36px; padding: 3px; gap: 2px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface-2); }
#view-terminplan .vg-seg button { height: 28px; padding: 0 14px; border: 0; border-radius: 7px; background: transparent; color: var(--tp-text-2); font-size: 13px; font-weight: 600; cursor: pointer; }
#view-terminplan .vg-seg button[aria-pressed="true"] { background: var(--tp-surface); color: var(--tp-text); box-shadow: var(--tp-shadow-sm); }
#view-terminplan .vg-knopf { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; padding: 0 16px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface); color: var(--tp-text); font-size: 13px; font-weight: 600; cursor: pointer; }
#view-terminplan .vg-knopf.primaer { border-color: var(--tp-work); background: var(--tp-work); color: var(--tp-on-work); }
#view-terminplan .vg-knopf.primaer b { font-size: 17px; font-weight: 500; line-height: 1; }
#view-terminplan .vg-knopf.leise { border-color: transparent; background: transparent; color: var(--tp-text-2); }

/* Liste + Zeitleiste */
#view-terminplan .vg-karte { overflow: hidden; border: 1px solid var(--tp-border); border-radius: 14px; background: var(--tp-surface); box-shadow: var(--tp-shadow); }
#view-terminplan .vg-zeile { display: grid; grid-template-columns: var(--tab) minmax(0, 1fr); min-height: 36px; border-bottom: 1px solid var(--tp-border); }
#view-terminplan .vg-tab { display: grid; grid-template-columns: 34px minmax(0, 1fr) 84px 60px 96px 74px; align-items: center; column-gap: 8px; padding: 0 12px 0 10px; border-right: 1px solid var(--tp-border); font-size: 13px; }
#view-terminplan .vg-spur { position: relative; min-width: 0;
  background:
    repeating-linear-gradient(90deg, var(--tp-grid) 0 1px, transparent 1px calc(700% / var(--tage))),
    repeating-linear-gradient(90deg, transparent 0 calc(500% / var(--tage)), var(--tp-we) calc(500% / var(--tage)) calc(700% / var(--tage))); }
#view-terminplan .vg-nr { color: var(--tp-text-3); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; }
#view-terminplan .vg-name { overflow: hidden; color: var(--tp-text); white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .vg-dat { color: var(--tp-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan .vg-dat.leer { color: var(--tp-warn); font-weight: 600; }
#view-terminplan .vg-dauer { color: var(--tp-text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan .vg-ms { color: var(--tp-text-2); font-size: 12px; }
#view-terminplan .vg-vor { display: flex; gap: 4px; flex-wrap: nowrap; }
#view-terminplan .vg-vor i { display: inline-grid; place-items: center; min-width: 24px; height: 22px; padding: 0 6px; border: 1px solid var(--tp-border-strong); border-radius: 6px; background: var(--tp-surface-2); color: var(--tp-text-2); font-size: 12px; font-style: normal; font-weight: 600; font-variant-numeric: tabular-nums; }
#view-terminplan .vg-strich { color: var(--tp-text-3); }

#view-terminplan .vg-gruppe { background: var(--tp-surface-2); }
#view-terminplan .vg-gruppe .vg-tab { grid-template-columns: minmax(0, 1fr) auto; }
#view-terminplan .vg-gname { display: flex; align-items: center; gap: 8px; min-width: 0; border: 0; background: transparent; color: var(--tp-text); font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; }
#view-terminplan .vg-gname span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .vg-gname svg { flex: 0 0 auto; transition: transform .15s ease; }
#view-terminplan .vg-gruppe.zu .vg-gname svg { transform: rotate(-90deg); }
#view-terminplan .vg-gname svg { width: 14px; height: 14px; fill: none; stroke: var(--tp-text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view-terminplan .vg-ganz { color: var(--tp-text-3); font-size: 12px; }
#view-terminplan .vg-plus { min-height: 32px; }
#view-terminplan .vg-plus .vg-tab { display: flex; }
#view-terminplan .vg-plus-knopf { display: inline-flex; align-items: center; gap: 6px; height: 26px; margin-left: 48px !important; padding: 0 10px; border: 1px dashed transparent; border-radius: 7px; background: transparent; color: var(--tp-text-3); font-size: 12.5px; font-weight: 600; cursor: pointer; }
#view-terminplan .vg-plus-knopf:hover { border-color: var(--tp-border-strong); color: var(--tp-work); }
#view-terminplan .vg-plus-knopf b { font-size: 15px; font-weight: 500; }
#view-terminplan .vg-zeile.gewaehlt { background: color-mix(in srgb, var(--tp-work) 7%, transparent); }

#view-terminplan .vg-kopfzeile { min-height: 0; background: var(--tp-surface); }
#view-terminplan .vg-tab-kopf { align-self: end; padding-bottom: 9px; color: var(--tp-text-3); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
#view-terminplan .vg-tab-kopf .vg-nr, #view-terminplan .vg-tab-kopf .vg-name, #view-terminplan .vg-tab-kopf .vg-dat, #view-terminplan .vg-tab-kopf .vg-dauer { color: var(--tp-text-3); font-size: 11px; font-weight: 650; }
#view-terminplan .vg-kopfzeile .vg-spur { background: none; }
#view-terminplan .vg-achse { display: grid; grid-template-rows: 24px 18px 24px; }
#view-terminplan .vg-achse > div { position: relative; }
#view-terminplan .vg-monat, #view-terminplan .vg-woche { position: absolute; top: 0; bottom: 0; left: calc(var(--i) * 100% / var(--tage)); width: calc(var(--n) * 100% / var(--tage)); display: flex; align-items: center; padding-left: 7px; border-left: 1px solid var(--tp-border); overflow: hidden; white-space: nowrap; }
#view-terminplan .vg-monat { font-size: 12.5px; font-weight: 650; }
#view-terminplan .vg-woche { color: var(--tp-text-3); font-size: 11px; font-weight: 600; }
#view-terminplan .vg-tage { border-top: 1px solid var(--tp-border); }
#view-terminplan .vg-tage span { position: absolute; top: 3px; left: calc(var(--i) * 100% / var(--tage)); width: calc(100% / var(--tage)); display: grid; place-items: center; height: 18px; color: var(--tp-text-2); font-size: 10.5px; font-variant-numeric: tabular-nums; }
#view-terminplan .vg-tage span.we { color: var(--tp-text-3); opacity: .7; }
#view-terminplan .vg-tage span.heute { z-index: 0; color: var(--tp-on-work); font-weight: 700; opacity: 1; }
#view-terminplan .vg-tage span.heute::before { content: ""; position: absolute; z-index: -1; inset: 0 1px; border-radius: 5px; background: var(--tp-work); }

#view-terminplan .vg-koerper { position: relative; }
#view-terminplan .vg-heute { position: absolute; top: 0; bottom: 0; z-index: 0; left: calc(var(--tab) + (var(--i) + .5) * (100% - var(--tab)) / var(--tage) - 1px); width: 2px; background: color-mix(in srgb, var(--tp-work) 70%, transparent); pointer-events: none; }
#view-terminplan .vg-pfeile { position: absolute; inset: 0; z-index: 1; overflow: visible; pointer-events: none; }
#view-terminplan .vg-pfad { fill: none; stroke: color-mix(in srgb, var(--tp-text-3) 75%, transparent); stroke-width: 1.2; }
#view-terminplan .vg-spitze { fill: color-mix(in srgb, var(--tp-text-3) 75%, transparent); }
#view-terminplan .vg-pfad.aktiv { stroke: var(--tp-work); stroke-width: 1.6; }
#view-terminplan .vg-spitze.aktiv { fill: var(--tp-work); }

#view-terminplan .vg-balken { position: absolute; top: 50%; height: 16px; left: calc(var(--von) * 100% / var(--tage) + 2px); width: calc(var(--n) * 100% / var(--tage) - 4px); transform: translateY(-50%); border-radius: 5px; }
#view-terminplan .vg-balken { z-index: 2; border: 1px solid color-mix(in srgb, var(--tp-work) 55%, transparent); background: color-mix(in srgb, var(--tp-work) 22%, var(--tp-surface)); cursor: grab; }
#view-terminplan .vg-balken.laeuft { background: color-mix(in srgb, var(--tp-work) 42%, var(--tp-surface)); border-color: var(--tp-work); }
#view-terminplan .vg-balken.weiter { border-top-right-radius: 0; border-bottom-right-radius: 0; border-right-style: dashed; }
#view-terminplan .vg-balken em { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--tp-text); font-size: 10.5px; font-style: normal; font-weight: 650; white-space: nowrap; }
#view-terminplan .vg-raute { position: absolute; z-index: 2; top: 50%; left: calc((var(--von) + .5) * 100% / var(--tage)); width: 12px; height: 12px; margin-left: -6px; transform: translateY(-50%); }
#view-terminplan .vg-raute i { display: block; width: 12px; height: 12px; border-radius: 2px; background: var(--tp-text); transform: rotate(45deg); }
#view-terminplan .vg-rand { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); color: var(--tp-text-3); font-size: 11px; font-weight: 650; }
#view-terminplan .vg-fuss { display: flex; flex-wrap: wrap; gap: 6px 22px; padding: 10px 16px; color: var(--tp-text-3); font-size: 12px; }
#view-terminplan kbd { padding: 1px 6px; border: 1px solid var(--tp-border); border-radius: 5px; background: var(--tp-surface-2); color: var(--tp-text-2); font: 600 11px var(--tp-font); }

/* Handy */
#view-terminplan .vg-handy { gap: 12px; padding: 14px 16px 24px; }
#view-terminplan .vg-handy .vg-kopf { align-items: center; flex-wrap: nowrap; }
#view-terminplan .vg-handy .vg-titel h2 { font-size: 22px; }
#view-terminplan .vg-knopf.rund { width: 42px; height: 42px; padding: 0; border-radius: 50%; font-size: 22px; font-weight: 500; }
#view-terminplan .vg-seg.voll { display: flex; height: 40px; }
#view-terminplan .vg-seg.voll button { flex: 1; height: 32px; }
#view-terminplan .vg-h-gruppe { display: grid; overflow: hidden; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); }
#view-terminplan .vg-h-gruppe h4 { display: flex; align-items: baseline; justify-content: space-between; margin: 0; padding: 10px 14px; background: var(--tp-surface-2); border-bottom: 1px solid var(--tp-border); font-size: 13.5px; font-weight: 650; }
#view-terminplan .vg-h-gruppe h4 small { color: var(--tp-text-3); font-size: 12px; font-weight: 500; }
#view-terminplan .vg-h-zeile { display: grid; grid-template-columns: 30px minmax(0, 1fr) 16px; align-items: center; gap: 10px; padding: 10px 12px 10px 10px; border: 0; border-bottom: 1px solid var(--tp-border); background: transparent; color: var(--tp-text); text-align: left; }
#view-terminplan .vg-h-zeile.offen { background: color-mix(in srgb, var(--tp-work) 7%, transparent); }
#view-terminplan .vg-h-zeile svg { width: 14px; height: 14px; fill: none; stroke: var(--tp-text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view-terminplan .vg-h-text { display: grid; gap: 2px; min-width: 0; }
#view-terminplan .vg-h-text strong { font-size: 14px; font-weight: 600; line-height: 1.3; }
#view-terminplan .vg-h-text small { color: var(--tp-text-3); font-size: 12.5px; font-variant-numeric: tabular-nums; }
#view-terminplan .vg-h-gruppe .vg-plus-knopf { justify-self: start; height: 40px; margin: 0 0 0 8px !important; }
#view-terminplan .vg-h-schleier { position: fixed; inset: 0; z-index: 40; background: rgba(5, 7, 10, .5); }
#view-terminplan .vg-h-blatt { position: fixed; z-index: 41; left: 0; right: 0; bottom: 0; display: grid; gap: 12px; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); }
#view-terminplan .vg-h-griff { justify-self: center; width: 38px; height: 4px; margin-bottom: 4px; border-radius: 99px; background: var(--tp-border-strong); }
#view-terminplan .vg-h-blattkopf { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 10px; align-items: center; }
#view-terminplan .vg-nr.gross { display: grid; place-items: center; height: 40px; border-radius: 10px; background: var(--tp-work-soft); color: var(--tp-work); font-size: 15px; font-weight: 700; }
#view-terminplan .vg-h-reihe { display: grid; gap: 10px; }
#view-terminplan .vg-h-reihe.zwei { grid-template-columns: 1fr 1fr; }
#view-terminplan .vg-feld { display: grid; gap: 2px; padding: 8px 12px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface-2); }
#view-terminplan .vg-feld small { color: var(--tp-text-3); font-size: 11px; }
#view-terminplan .vg-feld b { font-size: 14px; font-weight: 600; }
#view-terminplan .vg-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 3px; }
#view-terminplan .vg-chips i { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 8px 0 10px; border: 1px solid var(--tp-border-strong); border-radius: 8px; background: var(--tp-surface); font-size: 12.5px; font-style: normal; font-weight: 600; }
#view-terminplan .vg-chips em { color: var(--tp-text-3); font-style: normal; }
#view-terminplan .vg-chips button { height: 28px; padding: 0 10px; border: 1px dashed var(--tp-border-strong); border-radius: 8px; background: transparent; color: var(--tp-work); font-size: 12.5px; font-weight: 600; }
#view-terminplan .vg-h-schieben { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; }
#view-terminplan .vg-h-schieben button { height: 40px; border: 1px solid var(--tp-border); border-radius: 9px; background: var(--tp-surface); color: var(--tp-text-2); font-size: 14px; font-weight: 600; }
#view-terminplan .vg-h-schieben span { color: var(--tp-text-2); font-size: 12.5px; font-weight: 600; text-align: center; }
#view-terminplan .vg-h-nachf { padding: 9px 12px; border-radius: 10px; background: var(--tp-warn-soft); color: var(--tp-text-2); font-size: 12.5px; line-height: 1.4; }
#view-terminplan .vg-h-nachf b { color: var(--tp-text); }
#view-terminplan .vg-h-knoepfe { display: flex; justify-content: space-between; }
#view-terminplan .vg-h-knoepfe .vg-knopf { min-width: 120px; height: 44px; font-size: 14px; }

#view-terminplan .vg-balken.eigen, #view-terminplan .vg-balken.eigen.laeuft { border-color: var(--fb); background: var(--fb); }
#view-terminplan .vg-balken.eigen em { color: var(--fb-text); }
#view-terminplan .vg-raute.eigen i { background: var(--fb); }
#view-terminplan .vg-balken.markiert, #view-terminplan .vg-raute.markiert i { outline: 2px solid var(--tp-work); outline-offset: 2px; }

#view-terminplan .vg-bp-anker { position: relative; }
#view-terminplan .vg-knopf svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#view-terminplan .vg-knopf.mit-zahl { padding: 0 10px 0 13px; }
#view-terminplan .vg-knopf.offen { border-color: var(--tp-work); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-work) 22%, transparent); }
#view-terminplan .vg-zahl { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--tp-work-soft); color: var(--tp-work); font-size: 11.5px; font-weight: 700; }
#view-terminplan .vg-pop { position: absolute; z-index: 30; top: calc(100% + 8px); right: 0; display: grid; gap: 14px; width: 452px; padding: 16px; border: 1px solid var(--tp-border); border-radius: 14px; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); text-align: left; }
#view-terminplan .vg-pop-kopf { display: grid; gap: 3px; }
#view-terminplan .vg-pop-kopf b { font-size: 15px; font-weight: 650; }
#view-terminplan .vg-pop-kopf small { color: var(--tp-text-3); font-size: 12.5px; }
#view-terminplan .vg-bp-liste { display: grid; overflow: hidden; border: 1px solid var(--tp-border); border-radius: 10px; }
#view-terminplan .vg-bp-zeile { display: grid; grid-template-columns: 18px 24px minmax(0, 1fr) auto 28px; align-items: center; gap: 12px; min-height: 56px; padding: 0 8px 0 12px; border-bottom: 1px solid var(--tp-border); }
#view-terminplan .vg-bp-zeile:last-child { border-bottom: 0; }
#view-terminplan .vg-bp-zeile.aktuell { background: var(--tp-surface-2); }
#view-terminplan .vg-check { display: grid; place-items: center; width: 18px; height: 18px; border: 1.5px solid var(--tp-border-strong); border-radius: 5px; }
#view-terminplan .vg-check.an { border-color: var(--tp-work); background: var(--tp-work); }
#view-terminplan .vg-check.an::after { content: ""; width: 9px; height: 5px; border-left: 2px solid var(--tp-on-work); border-bottom: 2px solid var(--tp-on-work); transform: translateY(-1px) rotate(-45deg); }
#view-terminplan .vg-check.fest { opacity: .45; }
#view-terminplan .vg-bp-muster { display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--tp-border-strong); border-radius: 6px; background: var(--tp-surface); cursor: pointer; }
#view-terminplan .vg-bp-muster::before { content: ""; width: 14px; height: 4px; border-radius: 2px; background: var(--bpf); }
#view-terminplan .vg-bp-muster.aktuell { cursor: default; }
#view-terminplan .vg-bp-muster.aktuell::before { height: 10px; border-radius: 3px; background: var(--tp-text-2); }
#view-terminplan .vg-bp-text { display: grid; gap: 2px; min-width: 0; }
#view-terminplan .vg-bp-text b { overflow: hidden; font-size: 13.5px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .vg-bp-text small { color: var(--tp-text-3); font-size: 12px; font-variant-numeric: tabular-nums; }
#view-terminplan .vg-bezug { padding: 2px 7px; border-radius: 6px; background: var(--tp-surface-3); color: var(--tp-text-2); font-size: 11px; font-weight: 650; white-space: nowrap; }
#view-terminplan .vg-mehr { width: 28px; height: 28px !important; border: 0; border-radius: 7px; background: transparent; color: var(--tp-text-3); font-size: 17px; cursor: pointer; }
#view-terminplan .vg-pop-feld { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 12px; }
#view-terminplan .vg-pop-feld small { color: var(--tp-text-2); font-size: 12.5px; font-weight: 600; }
#view-terminplan .vg-auswahl { display: flex; align-items: center; justify-content: space-between; height: 36px; padding: 0 10px 0 12px; border: 1px solid var(--tp-border-strong); border-radius: 9px; background: var(--tp-surface); font-size: 13px; font-weight: 600; }
#view-terminplan .vg-auswahl svg, #view-terminplan .vg-h-vergleich > svg:last-child, #view-terminplan .vg-feld.wahl > svg { width: 14px; height: 14px; fill: none; stroke: var(--tp-text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
#view-terminplan .vg-pop-neu { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding-top: 14px; border-top: 1px solid var(--tp-border); }
#view-terminplan .vg-pop-info { margin: -6px 0 0; color: var(--tp-text-3); font-size: 12px; line-height: 1.45; }

#view-terminplan .vg-vergleich { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--tp-text-2); font-size: 12.5px; }
#view-terminplan .vg-vergleich > small { margin-right: 4px; color: var(--tp-text-3); font-size: 11px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
#view-terminplan .vg-chip { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 6px 0 12px; border: 1px solid var(--tp-border); border-radius: 9px; background: var(--tp-surface); color: var(--tp-text); font-weight: 650; }
#view-terminplan .vg-chip small { color: var(--tp-text-3); font-size: 12px; font-weight: 500; }
#view-terminplan .vg-linie { display: inline-block; flex: 0 0 auto; width: 18px; height: 4px; border-radius: 2px; background: var(--bpf); }
#view-terminplan .vg-x { display: grid; place-items: center; width: 22px; height: 22px !important; border: 0; border-radius: 6px; background: transparent; color: var(--tp-text-3); font-size: 15px; cursor: pointer; }
#view-terminplan .vg-erkl { margin-left: auto; color: var(--tp-text-3); font-size: 12px; }

/* Basispläne in der Zeitleiste: aktueller Balken oben, darunter je Basisplan eine dünne Spur (neueste zuerst) */
#view-terminplan .vg-karte.bp { --tab: clamp(600px, 49vw, 750px); }
#view-terminplan .vg-karte.bp .vg-tab { grid-template-columns: 34px minmax(0, 1fr) 84px 60px 96px 74px 66px; }
#view-terminplan .vg-karte.bp .vg-gruppe .vg-tab { grid-template-columns: minmax(0, 1fr) auto; }
#view-terminplan .vg-karte.bp .vg-plus .vg-tab { display: flex; }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] { min-height: calc(32px + var(--bp-n) * 8px); }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-tab { grid-template-rows: 30px; align-content: start; }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-balken { top: 8px; height: 14px; transform: none; }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-raute, #view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-rand { top: 15px; }
#view-terminplan .vg-bp { position: absolute; z-index: 1; top: calc(27px + var(--k) * 8px); left: calc(var(--von) * 100% / var(--tage) + 2px); width: calc(var(--n) * 100% / var(--tage) - 4px); height: 4px; border-radius: 2px; background: var(--bpf); }
#view-terminplan .vg-bp.vorher { left: 0; width: calc(var(--n) * 100% / var(--tage) - 2px); border-top-left-radius: 0; border-bottom-left-radius: 0; }
#view-terminplan .vg-bp-ms { position: absolute; z-index: 1; top: calc(29px + var(--k) * 8px); left: calc((var(--von) + .5) * 100% / var(--tage)); width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 1px; background: var(--bpf); transform: rotate(45deg); }
#view-terminplan .vg-vzk { padding-left: 8px; }
#view-terminplan .vg-vz { display: inline-grid; place-items: center; height: 22px; padding: 0 8px; border-radius: 99px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan .vg-vz.plus { background: var(--tp-warn-soft); color: var(--tp-warn); }
#view-terminplan .vg-vz.minus { background: color-mix(in srgb, var(--tp-ok) 14%, transparent); color: var(--tp-ok); }
#view-terminplan .vg-vz.null, #view-terminplan .vg-vz.leer { color: var(--tp-text-3); font-weight: 600; }
#view-terminplan .vg-gvz { color: var(--tp-warn); font-weight: 700; }

/* Handy: Farbstreifen am Eintrag, Farbe im Bearbeiten-Blatt, Verzug je Basisplan */
#view-terminplan .vg-h-zeile { position: relative; }
#view-terminplan .vg-h-zeile.eigen::before { content: ""; position: absolute; top: 9px; bottom: 9px; left: 0; width: 4px; border-radius: 0 3px 3px 0; background: var(--fb); }
#view-terminplan .vg-h-text small .vg-vz { height: 18px; margin-left: 4px; padding: 0 6px; font-size: 11px; vertical-align: 1px; }
#view-terminplan .vg-h-vergleich { display: grid; grid-template-columns: 18px minmax(0, 1fr) 14px; align-items: center; gap: 10px; height: 44px; padding: 0 14px !important; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); color: var(--tp-text-2); font-size: 13px; text-align: left; }
#view-terminplan .vg-h-vergleich > svg:first-child { width: 18px; height: 18px; fill: none; stroke: var(--tp-text-2); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
#view-terminplan .vg-h-vergleich b { color: var(--tp-text); font-weight: 650; }
#view-terminplan .vg-feld.wahl { grid-template-columns: minmax(0, 1fr) 14px; align-items: center; column-gap: 8px; color: var(--tp-text); text-align: left; }
#view-terminplan .vg-feld.wahl small, #view-terminplan .vg-feld.wahl b { grid-column: 1; }
#view-terminplan .vg-feld.wahl > svg { grid-column: 2; grid-row: 1 / span 2; }
#view-terminplan .vg-farbpunkt { display: inline-block; width: 14px; height: 14px; margin-right: 8px; border-radius: 4px; background: var(--fb); vertical-align: -2px; }
#view-terminplan .vg-h-vz { display: grid; gap: 8px; padding: 10px 12px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface-2); color: var(--tp-text-2); font-size: 12.5px; }
#view-terminplan .vg-h-vz > span { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 62px; align-items: center; gap: 8px; }
#view-terminplan .vg-h-vz b { color: var(--tp-text); font-weight: 600; font-variant-numeric: tabular-nums; }
#view-terminplan .vg-h-vz .vg-vz { justify-self: end; height: 20px; font-size: 11.5px; }
#view-terminplan .vg-h-zeile.eigen .vg-h-raute { color: var(--fb); }

/* Eingaben in der Zeile (Anlegen/Bearbeiten), Betriebsstelle anlegen/umbenennen, Basisplan speichern */
#view-terminplan .tp-ein { width: 100%; min-width: 0; height: 28px; margin: 0; padding: 0 8px; border: 1px solid var(--tp-border-strong); border-radius: 6px; background: var(--tp-surface); color: var(--tp-text); font: 400 13px var(--tp-font); font-variant-numeric: tabular-nums; box-shadow: none; }
#view-terminplan .tp-ein::placeholder { color: var(--tp-text-3); }
#view-terminplan .tp-ein:focus { border-color: var(--tp-work); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-work) 25%, transparent); }
#view-terminplan .tp-ein.ungueltig { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .18); }
#view-terminplan .tp-ein.kurz { width: 56px; }
#view-terminplan .tp-ein.gruppe { max-width: 340px; height: 30px; font-weight: 600; }
#view-terminplan .vg-zeile.vg-neu { background: color-mix(in srgb, var(--tp-work) 5%, transparent); }
#view-terminplan .vg-zeile.vg-neu .vg-tab { padding-top: 4px; padding-bottom: 4px; }
#view-terminplan .tp-hilfe { position: absolute; top: 50%; left: 12px; right: 12px; overflow: hidden; transform: translateY(-50%); color: var(--tp-text-3); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-hilfe b { color: var(--tp-text-2); font-weight: 650; }
#view-terminplan .vg-plus.neu-gruppe .vg-tab { display: flex; align-items: center; gap: 12px; padding-left: 48px; }
#view-terminplan .tp-hilfe-klein { color: var(--tp-text-3); font-size: 12px; white-space: nowrap; }
#view-terminplan .vg-gruppe .tp-ein.gruppe { margin-left: 22px; }

/* Ziehen und Größe ändern */
#view-terminplan [data-zieh] { cursor: grab; touch-action: none; }
#view-terminplan .vg-balken.zieht, #view-terminplan .vg-raute.zieht { z-index: 4; cursor: grabbing; box-shadow: var(--tp-shadow-pop); }
#view-terminplan .tp-griff { position: absolute; top: -1px; right: -1px; bottom: -1px; width: 9px; border-radius: 0 5px 5px 0; cursor: ew-resize; }
#view-terminplan .tp-griff::after { content: ""; position: absolute; top: 3px; bottom: 3px; right: 3px; width: 2px; border-radius: 1px; background: currentColor; opacity: 0; }
#view-terminplan .vg-balken:hover .tp-griff::after { opacity: .55; }
#view-terminplan .vg-balken { color: var(--tp-text); }
#view-terminplan .vg-balken.eigen { color: var(--fb-text); }
#view-terminplan .tp-zieh-info { position: fixed; z-index: 60; padding: 5px 9px; border-radius: 7px; background: var(--tp-text); color: var(--tp-surface); font-size: 12px; font-weight: 600; white-space: nowrap; pointer-events: none; box-shadow: var(--tp-shadow-pop); }
#view-terminplan .vg-balken.vorher { border-top-left-radius: 0; border-bottom-left-radius: 0; }
#view-terminplan .vg-rand.links { right: auto; left: 6px; }

/* Kontextmenü */
#view-terminplan .tp-menue { position: fixed; z-index: 70; display: grid; min-width: 232px; padding: 6px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); }
#view-terminplan .tp-menue button { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 32px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; color: var(--tp-text); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer; }
#view-terminplan .tp-menue button:hover:not([disabled]), #view-terminplan .tp-menue button:focus-visible { background: var(--tp-surface-3); outline: none; }
#view-terminplan .tp-menue button[disabled] { color: var(--tp-text-3); cursor: default; opacity: .6; }
#view-terminplan .tp-menue button.gefahr:not([disabled]) { color: #dc2626; }
#view-terminplan .tp-menue small { color: var(--tp-text-3); font-size: 11.5px; }
#view-terminplan .tp-menue hr { height: 1px; margin: 5px 4px; border: 0; background: var(--tp-border); }

/* Leerer Plan / Laden / Fehler */
#view-terminplan .tp-leer { display: grid; gap: 8px; justify-items: start; padding: 28px; border: 1px solid var(--tp-border); border-radius: 14px; background: var(--tp-surface); box-shadow: var(--tp-shadow); color: var(--tp-text-2); font-size: 13.5px; line-height: 1.5; }
#view-terminplan .tp-leer b { color: var(--tp-text); font-size: 16px; font-weight: 650; }
#view-terminplan .tp-leer-zeile { display: flex; gap: 8px; width: min(520px, 100%); margin-top: 6px; }
#view-terminplan .tp-leer-zeile .tp-ein { flex: 1; max-width: none; height: 36px; }

/* Basisplan-Fenster: echte Bedienelemente */
#view-terminplan button.vg-check { padding: 0; cursor: pointer; }
#view-terminplan .vg-check:not(.an) { background: var(--tp-surface); }
#view-terminplan .vg-bp-muster[disabled] { cursor: default; }
#view-terminplan .vg-bp-text .tp-ein { height: 28px; font-weight: 600; }
#view-terminplan .vg-pop .tp-ein { height: 36px; padding: 0 12px; border-radius: 9px; }
#view-terminplan select.vg-auswahl { width: 100%; color: var(--tp-text); font-family: var(--tp-font); cursor: pointer; }
#view-terminplan .vg-bp-zeile.leer { min-height: 44px; }
#view-terminplan .vg-mehr:hover, #view-terminplan .vg-x:hover { background: var(--tp-surface-3); color: var(--tp-text); }

/* Meldung mit „Rückgängig“ */
#view-terminplan .vg-toast { position: fixed; z-index: 50; left: 50%; bottom: 22px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px; width: max-content; max-width: min(760px, calc(100vw - 32px)); padding: 11px 12px 11px 14px; border-radius: 12px; background: var(--tp-text); color: var(--tp-surface); box-shadow: var(--tp-shadow-pop); font-size: 13px; line-height: 1.4; }
#view-terminplan .vg-toast-icon { display: grid; place-items: center; flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%; background: color-mix(in srgb, var(--tp-surface) 18%, transparent); font-weight: 700; }
#view-terminplan .vg-toast button { flex: 0 0 auto; height: 30px; padding: 0 12px; border: 0; border-radius: 8px; background: color-mix(in srgb, var(--tp-surface) 16%, transparent); color: var(--tp-surface); font-size: 12.5px; font-weight: 650; cursor: pointer; }

/* Handy: Blatt mit echten Eingaben, Basisplan-Fenster als Blatt, Zeitleiste zum Wischen */
#view-terminplan .vg-feld, #view-terminplan .vg-pop-feld, #view-terminplan .tp-schalter { min-width: 0; margin: 0; }
#view-terminplan .vg-feld small { line-height: 15px; }
#view-terminplan .vg-feld > b, #view-terminplan .vg-feld .tp-blatt-ein { line-height: 22px; }
#view-terminplan button.vg-feld { font: 400 13px/1.2 var(--tp-font); text-align: left; }
#view-terminplan .tp-blatt-ein { width: 100%; min-width: 0; height: 22px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--tp-text); font: 600 14px var(--tp-font); box-shadow: none; }
#view-terminplan .tp-blatt-ein:focus { outline: none; }
#view-terminplan .vg-feld:focus-within { border-color: var(--tp-work); box-shadow: 0 0 0 3px color-mix(in srgb, var(--tp-work) 20%, transparent); }
#view-terminplan .vg-feld.aus { opacity: .5; }
#view-terminplan button.vg-feld { border: 1px solid var(--tp-border); cursor: pointer; }
#view-terminplan .tp-schalter { display: flex; align-items: center; gap: 10px; min-height: 32px; color: var(--tp-text-2); font-size: 13.5px; }
#view-terminplan .tp-schalter input { width: 18px; height: 18px; margin: 0; accent-color: var(--tp-work); }
#view-terminplan .vg-chips em { cursor: pointer; }
#view-terminplan .tp-vor-neu { height: 28px; padding: 0 8px; border: 1px dashed var(--tp-border-strong); border-radius: 8px; background: transparent; color: var(--tp-work); font: 600 12.5px var(--tp-font); }
#view-terminplan .vg-h-blatt { max-height: calc(100dvh - 48px); overflow-y: auto; }
#view-terminplan .tp-h-panel .vg-pop { position: static; width: auto; padding: 0; border: 0; box-shadow: none; }
#view-terminplan .vg-plus-knopf.gruppe.handy { justify-self: start; height: 40px; margin: 0 !important; }
#view-terminplan .tp-h-neu { display: flex; gap: 8px; padding: 10px; }
#view-terminplan .tp-h-neu .tp-ein { max-width: none; height: 40px; }
#view-terminplan .vg-seg.klein { height: 36px; }
#view-terminplan .vg-seg.klein button { flex: 1; height: 28px; padding: 0 6px; font-size: 12.5px; }
#view-terminplan .tp-h-zeitleiste { overflow-x: auto; border-radius: 14px; -webkit-overflow-scrolling: touch; }
#view-terminplan .tp-h-zeitleiste .vg-karte { --tab: 150px; min-width: calc(150px + var(--tage) * 18px); }
#view-terminplan .tp-h-zeitleiste .vg-karte.bp { --tab: 150px; }
#view-terminplan .tp-h-zeitleiste .vg-tab, #view-terminplan .tp-h-zeitleiste .vg-karte.bp .vg-tab { position: sticky; left: 0; z-index: 5; grid-template-columns: 24px minmax(0, 1fr); padding: 0 8px; background: var(--tp-surface); }
#view-terminplan .tp-h-zeitleiste .vg-gruppe .vg-tab, #view-terminplan .tp-h-zeitleiste .vg-karte.bp .vg-gruppe .vg-tab { grid-template-columns: minmax(0, 1fr); background: var(--tp-surface-2); }
#view-terminplan .tp-h-zeitleiste :is(.vg-dat, .vg-dauer, .vg-vor, .vg-vzs, .vg-vzk, .vg-ganz, .vg-plus, .vg-fuss, .tp-griff) { display: none; }

/* Runde 2 (Rückmeldung 20.10.): Name im Balken, Griffe vorne/hinten, sichtbare Aktionen, klarere Basisplan-Spuren,
   Hover-Karte, Sammelbalken je Betriebsstelle, Kalender im Datumsfeld. */

/* Balken: 18 px mit Namen; die gewählte Farbe bleibt exakt, die Schrift passt sich an */
#view-terminplan .vg-balken { display: flex; align-items: center; gap: 8px; height: 18px; padding: 0 8px; }
#view-terminplan .tp-label { flex: 1 1 auto; min-width: 0; overflow: hidden; color: inherit; font-size: 11.5px; font-weight: 600; line-height: 16px; white-space: nowrap; text-overflow: ellipsis; pointer-events: none; }
#view-terminplan .vg-balken em { position: static; flex: 0 0 auto; transform: none; color: inherit; }
#view-terminplan .vg-balken.aussen .tp-label, #view-terminplan .vg-balken.aussen-links .tp-label { position: absolute; top: 50%; overflow: hidden; color: var(--tp-text-2); transform: translateY(-50%); }
#view-terminplan .vg-balken.aussen .tp-label { left: calc(100% + 18px); }
#view-terminplan .vg-balken.aussen-links .tp-label { right: calc(100% + 10px); }
#view-terminplan .vg-raute .tp-label { position: absolute; top: 50%; color: var(--tp-text-2); transform: translateY(-50%); }
#view-terminplan .vg-raute.aussen .tp-label { left: 20px; }
#view-terminplan .vg-raute.aussen-links .tp-label { right: 20px; }
#view-terminplan .vg-balken.markiert .tp-label { color: inherit; }

/* Griffe: vorne ändert den Beginn, hinten das Ende – beim Überfahren sichtbar */
#view-terminplan .tp-griff.links { left: -1px; right: auto; border-radius: 5px 0 0 5px; }
#view-terminplan .tp-griff.links::after { left: 3px; right: auto; }
#view-terminplan .vg-balken:hover .tp-griff::after { opacity: .7; }

/* Mit Basisplänen: Balken oben, je Basisplan eine Spur darunter (10 px Abstand), oben und unten 6 px Luft.
   In der Tabelle steht auf Höhe jeder Spur eine kleine Zeile: BP n · Name · Beginn · Ende · Dauer · Verzug. */
#view-terminplan .vg-karte.bp { --tp-spalten: 34px minmax(0, 1fr) 84px 60px 96px 74px 66px; }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] { min-height: calc(30px + var(--bp-n) * 10px); }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-tab { position: relative; }
#view-terminplan .vg-karte.bp .vg-zeile[data-zeile] .vg-balken { top: 6px; height: 18px; }
#view-terminplan .vg-bp { top: calc(29px + var(--k) * 10px); }
#view-terminplan .vg-bp-ms { top: calc(31px + var(--k) * 10px); }
#view-terminplan .tp-bp-unter { position: absolute; left: 0; right: 0; top: calc(26px + var(--k) * 10px); display: grid; grid-template-columns: var(--tp-spalten); column-gap: 8px; align-items: center; height: 10px; padding: 0 12px 0 10px; color: color-mix(in srgb, var(--tp-text-3) 70%, transparent); font-size: 10px; font-variant-numeric: tabular-nums; line-height: 10px; white-space: nowrap; pointer-events: none; }
#view-terminplan .tp-bp-unter > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
#view-terminplan .tp-bpu-linie { justify-self: center; width: 14px; height: 3px; border-radius: 2px; background: var(--bpf); }
#view-terminplan .tp-bpu-name { color: var(--tp-text-2); font-weight: 700; }
#view-terminplan .tp-bp-unter .anders { color: var(--tp-text); font-weight: 600; }
#view-terminplan .tp-bpu-leer { grid-column: 3 / span 4; font-style: italic; }
#view-terminplan .tp-bpu-vz { padding-left: 8px; font-weight: 700; }
#view-terminplan .tp-bpu-vz .plus { color: var(--tp-warn); }
#view-terminplan .tp-bpu-vz .minus { color: var(--tp-ok); }
#view-terminplan .tp-vz-linie { position: absolute; z-index: 1; top: calc(30.25px + var(--k) * 10px); left: calc(var(--l) * 100% / var(--tage)); width: calc((var(--r) - var(--l)) * 100% / var(--tage)); height: 0; border-top: 1.5px dashed var(--tp-warn); pointer-events: none; }
#view-terminplan .tp-vz-linie.frueher { border-top-color: var(--tp-ok); }
#view-terminplan .tp-vz-linie::after { content: ""; position: absolute; top: -4.75px; right: 0; width: 1.5px; height: 8px; border-radius: 1px; background: var(--tp-warn); }
#view-terminplan .tp-vz-linie.frueher::after { right: auto; left: 0; background: var(--tp-ok); }

/* Sammelbalken je Betriebsstelle: vom ersten Beginn bis zum letzten Ende */
#view-terminplan .tp-summe { position: absolute; top: 50%; height: 6px; left: calc(var(--von) * 100% / var(--tage) + 2px); width: calc(var(--n) * 100% / var(--tage) - 4px); margin-top: -5px; border-radius: 1px; background: var(--tp-text-2); opacity: .8; }
#view-terminplan .tp-summe::before, #view-terminplan .tp-summe::after { content: ""; position: absolute; top: 100%; width: 0; height: 0; border-top: 5px solid var(--tp-text-2); }
#view-terminplan .tp-summe::before { left: 0; border-right: 6px solid transparent; }
#view-terminplan .tp-summe::after { right: 0; border-left: 6px solid transparent; }
#view-terminplan .tp-summe.vorher::before, #view-terminplan .tp-summe.weiter::after { display: none; }

/* Zeile beim Überfahren hervorheben (Liste und Diagramm gemeinsam) */
#view-terminplan .vg-zeile[data-zeile]:hover { background: color-mix(in srgb, var(--tp-text) 4%, transparent); }
#view-terminplan .vg-zeile[data-zeile].gewaehlt:hover { background: color-mix(in srgb, var(--tp-work) 10%, transparent); }

/* Sichtbare Aktionen: ⋯ am Vorgang und an der Betriebsstelle */
#view-terminplan .vg-zeile[data-zeile] .vg-name { display: flex; align-items: center; gap: 4px; }
#view-terminplan .tp-name-text { flex: 1 1 auto; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-gkopf { display: flex; align-items: center; gap: 4px; min-width: 0; }
#view-terminplan .tp-zeile-mehr { display: grid; flex: 0 0 auto; place-items: center; width: 26px; height: 24px !important; border: 1px solid transparent; border-radius: 6px; background: transparent; color: var(--tp-text-3); font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; opacity: 0; }
#view-terminplan .vg-zeile:hover .tp-zeile-mehr, #view-terminplan .vg-zeile.gewaehlt .tp-zeile-mehr, #view-terminplan .tp-zeile-mehr:focus-visible { opacity: 1; }
#view-terminplan .tp-zeile-mehr:hover { border-color: var(--tp-border-strong); background: var(--tp-surface); color: var(--tp-text); }
@media (hover: none) { #view-terminplan .tp-zeile-mehr { opacity: 1; } }

/* Bearbeiten-Zeile: Speichern · Abbrechen · Löschen */
#view-terminplan .tp-edit-knoepfe { position: absolute; z-index: 3; top: 50%; left: 10px; right: 10px; display: flex; align-items: center; gap: 6px; transform: translateY(-50%); }
#view-terminplan .tp-mini { flex: 0 0 auto; height: 26px; padding: 0 10px; border: 1px solid var(--tp-border-strong); border-radius: 7px; background: var(--tp-surface); color: var(--tp-text); font-size: 12px; font-weight: 600; cursor: pointer; }
#view-terminplan .tp-mini:hover { background: var(--tp-surface-3); }
#view-terminplan .tp-mini.primaer { border-color: var(--tp-work); background: var(--tp-work); color: var(--tp-on-work); }
#view-terminplan .tp-mini.gefahr { color: #dc2626; }
#view-terminplan .tp-edit-knoepfe .tp-hilfe-klein { min-width: 0; margin-left: 6px; overflow: hidden; text-overflow: ellipsis; }
#view-terminplan .tp-hilfe-klein b { color: var(--tp-text-2); font-weight: 650; }

/* Hover-Karte */
#view-terminplan .tp-karte { position: fixed; z-index: 65; display: grid; gap: 4px; width: 400px; padding: 12px 14px; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); color: var(--tp-text-2); font-size: 12.5px; pointer-events: none; }
#view-terminplan .tp-karte-kopf { display: flex; align-items: center; gap: 8px; min-width: 0; color: var(--tp-text); font-size: 13.5px; font-weight: 650; }
#view-terminplan .tp-karte-kopf b { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-karte small { color: var(--tp-text-3); font-size: 12px; }
#view-terminplan .tp-karte-zeilen { display: grid; gap: 6px; margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--tp-border); }
#view-terminplan .tp-karte-zeile { display: grid; grid-template-columns: minmax(0, 1fr) auto 58px; align-items: center; gap: 10px; }
#view-terminplan .tp-karte-zeile > span:first-child { display: flex; align-items: center; gap: 8px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-karte-zeile b { color: var(--tp-text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan .tp-karte-zeile .vg-vz { justify-self: end; height: 20px; padding: 0 7px; font-size: 11.5px; }
#view-terminplan .tp-akt-linie { flex: 0 0 auto; width: 18px; height: 8px; border-radius: 3px; background: var(--fb); }
#view-terminplan .tp-akt-linie.raute { width: 10px; height: 10px; border-radius: 2px; transform: rotate(45deg); }

/* Kalender im Datumsfeld */
#view-terminplan .tp-kalender { position: fixed; z-index: 75; width: 296px; padding: 10px; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); color: var(--tp-text); font-size: 12.5px; }
#view-terminplan .tp-kal-kopf { display: grid; grid-template-columns: 32px minmax(0, 1fr) 32px; align-items: center; margin-bottom: 6px; }
#view-terminplan .tp-kal-kopf b { font-size: 13.5px; font-weight: 650; text-align: center; }
#view-terminplan .tp-kal-kopf button { height: 30px; border: 0; border-radius: 8px; background: transparent; color: var(--tp-text-2); font-size: 17px; cursor: pointer; }
#view-terminplan .tp-kal-kopf button:hover { background: var(--tp-surface-3); color: var(--tp-text); }
#view-terminplan .tp-kal-woche { display: grid; grid-template-columns: 26px repeat(7, minmax(0, 1fr)); gap: 2px 0; }
#view-terminplan .tp-kal-woche.kopf span { display: grid; place-items: center; height: 24px; color: var(--tp-text-3); font-size: 11px; font-weight: 650; }
#view-terminplan .tp-kal-kw { display: grid; place-items: center; color: var(--tp-text-3); font-size: 10.5px; font-variant-numeric: tabular-nums; }
#view-terminplan .tp-kal-woche button { height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--tp-text); font: 500 12.5px var(--tp-font); font-variant-numeric: tabular-nums; cursor: pointer; }
#view-terminplan .tp-kal-woche button.we { color: var(--tp-text-3); }
#view-terminplan .tp-kal-woche button.fremd { opacity: .4; }
#view-terminplan .tp-kal-woche button.bereich, #view-terminplan .tp-kal-woche button.vorschau { border-radius: 0; background: var(--tp-work-soft); }
#view-terminplan .tp-kal-woche button.anfang { border-radius: 8px 0 0 8px; }
#view-terminplan .tp-kal-woche button.schluss { border-radius: 0 8px 8px 0; }
#view-terminplan .tp-kal-woche button.anfang.schluss { border-radius: 8px; }
#view-terminplan .tp-kal-woche button.heute { box-shadow: inset 0 0 0 1.5px var(--tp-work); color: var(--tp-work); font-weight: 700; }
#view-terminplan .tp-kal-woche button:hover:not(.gewaehlt) { background: var(--tp-surface-3); }
#view-terminplan .tp-kal-woche button.gewaehlt { border-radius: 8px; background: var(--tp-work); color: var(--tp-on-work); font-weight: 700; }
#view-terminplan .tp-kal-fuss { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--tp-border); color: var(--tp-text-3); font-size: 12px; }
#view-terminplan .tp-kal-fuss button { height: 28px; padding: 0 10px; border: 1px solid var(--tp-border); border-radius: 7px; background: var(--tp-surface); color: var(--tp-text); font-size: 12px; font-weight: 600; cursor: pointer; }
#view-terminplan .tp-h-zeitleiste .tp-bp-unter { display: none; }
#view-terminplan .tp-h-zeitleiste .tp-zeile-mehr { display: none; }   /* Handy: Antippen öffnet das Blatt */

/* Runde 3 (Zusatzfunktionen): Spalte „Stand“ (Fortschritt), „Was steht an“, Betriebsstelle kopieren */

/* Spalte „Stand“ zwischen Dauer und Vorgänger */
#view-terminplan { --tab: clamp(590px, 47vw, 726px); }
#view-terminplan .vg-tab { grid-template-columns: 34px minmax(0, 1fr) 84px 60px 88px 58px 74px; }
#view-terminplan .vg-karte.bp { --tab: clamp(650px, 52vw, 800px); --tp-spalten: 34px minmax(0, 1fr) 84px 60px 88px 58px 74px 66px; }
#view-terminplan .vg-karte.bp .vg-tab { grid-template-columns: var(--tp-spalten); }
#view-terminplan .vg-gruppe .vg-tab, #view-terminplan .vg-karte.bp .vg-gruppe .vg-tab { grid-template-columns: minmax(0, 1fr) auto; }
#view-terminplan .tp-bpu-leer { grid-column: 3 / span 5; }
#view-terminplan .tp-stand { display: inline-flex; align-items: center; gap: 6px; height: 24px !important; padding: 0 6px 0 4px; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--tp-text-2); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan button.tp-stand { cursor: pointer; }
#view-terminplan button.tp-stand:hover { border-color: var(--tp-border-strong); background: var(--tp-surface); }
#view-terminplan .tp-ring { --ring: var(--tp-text-3); --rest: var(--tp-border-strong); flex: 0 0 auto; width: 14px; height: 14px; border-radius: 50%; background: conic-gradient(var(--ring) calc(var(--p) * 1%), var(--rest) 0); -webkit-mask: radial-gradient(circle, transparent 3.5px, #000 4px); mask: radial-gradient(circle, transparent 3.5px, #000 4px); }
#view-terminplan .tp-stand.laeuft { color: var(--tp-text); }
#view-terminplan .tp-stand.laeuft .tp-ring { --ring: var(--tp-work); }
#view-terminplan .tp-stand.fertig { color: var(--tp-ok); }
#view-terminplan .tp-stand.fertig .tp-ring { --ring: var(--tp-ok); }
#view-terminplan .tp-stand.ueber { color: var(--tp-warn); }
#view-terminplan .tp-stand.ueber .tp-ring { --ring: var(--tp-warn); --rest: color-mix(in srgb, var(--tp-warn) 35%, transparent); }
#view-terminplan .vg-dat.ueber { color: var(--tp-warn); font-weight: 650; }

/* Im Balken: Fortschritt als feine Linie unten (die gewählte Farbe bleibt unverändert), überfällig mit orangem Rand */
#view-terminplan .tp-fortschritt { position: absolute; left: 3px; bottom: 2px; width: calc((100% - 6px) * var(--p) / 100); height: 2px; border-radius: 1px; background: currentColor; opacity: .75; pointer-events: none; }
#view-terminplan .vg-balken.ueber { box-shadow: 0 0 0 2px var(--tp-surface), 0 0 0 3.5px var(--tp-warn); }
#view-terminplan .vg-raute.ueber i { box-shadow: 0 0 0 2px var(--tp-surface), 0 0 0 3.5px var(--tp-warn); }

/* „Was steht an“ – drei gleich hohe Karten */
#view-terminplan .tp-anstehend { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
#view-terminplan .tp-an-karte { display: grid; align-content: start; gap: 2px; min-width: 0; padding: 10px 10px 8px; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); box-shadow: var(--tp-shadow-sm); }
#view-terminplan .tp-an-karte header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px 6px; color: var(--tp-text-3); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
#view-terminplan .tp-an-karte header b { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--tp-surface-3); color: var(--tp-text-2); font-size: 11.5px; letter-spacing: 0; }
#view-terminplan .tp-an-karte.ueber { border-color: color-mix(in srgb, var(--tp-warn) 45%, var(--tp-border)); }
#view-terminplan .tp-an-karte.ueber header b { background: var(--tp-warn-soft); color: var(--tp-warn); }
#view-terminplan .tp-an-karte.ok header b { background: color-mix(in srgb, var(--tp-ok) 14%, transparent); color: var(--tp-ok); }
#view-terminplan .tp-an-eintrag { display: grid; grid-template-columns: 14px minmax(0, 1fr) auto; align-items: center; gap: 10px; width: 100%; min-height: 42px; padding: 4px 6px !important; border: 0; border-radius: 8px; background: transparent; color: var(--tp-text); text-align: left; cursor: pointer; }
#view-terminplan .tp-an-eintrag:hover, #view-terminplan .tp-an-eintrag:focus-visible { background: var(--tp-surface-3); outline: none; }
#view-terminplan .tp-an-punkt { justify-self: center; width: 10px; height: 10px; border-radius: 3px; background: var(--fb); }
#view-terminplan .tp-an-punkt.raute { border-radius: 2px; transform: rotate(45deg); }
#view-terminplan .tp-an-text, #view-terminplan .tp-an-rechts { display: grid; gap: 1px; min-width: 0; }
#view-terminplan .tp-an-text b { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-an-text small, #view-terminplan .tp-an-rechts small { overflow: hidden; color: var(--tp-text-3); font-size: 11.5px; white-space: nowrap; text-overflow: ellipsis; }
#view-terminplan .tp-an-rechts { justify-items: end; text-align: right; }
#view-terminplan .tp-an-rechts b { font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
#view-terminplan .tp-an-karte.ueber .tp-an-rechts b { color: var(--tp-warn); }
#view-terminplan .tp-an-leer { margin: 0; padding: 10px 6px; color: var(--tp-text-3); font-size: 12.5px; }
#view-terminplan .tp-an-karte.ok .tp-an-leer { color: var(--tp-ok); font-weight: 600; }
#view-terminplan .tp-an-mehr { margin: 2px 6px 0; color: var(--tp-text-3); font-size: 12px; }
#view-terminplan .vg-zeile.blinkt { animation: tp-blinken 1.8s ease-out 1; }
@keyframes tp-blinken { 0%, 35% { background: color-mix(in srgb, var(--tp-work) 24%, transparent); } 100% { background: transparent; } }
#view-terminplan .vg-handy .tp-anstehend { grid-template-columns: minmax(0, 1fr); gap: 10px; }

/* Betriebsstelle kopieren */
#view-terminplan .tp-schleier { position: fixed; inset: 0; z-index: 80; background: rgba(5, 7, 10, .45); }
#view-terminplan .tp-dialog { position: fixed; z-index: 81; top: 50%; left: 50%; display: grid; gap: 14px; width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; padding: 20px; border: 1px solid var(--tp-border); border-radius: 16px; background: var(--tp-surface); box-shadow: var(--tp-shadow-pop); transform: translate(-50%, -50%); }
#view-terminplan .tp-dialog h3 { margin: 0; color: var(--tp-text); font: 650 17px/1.25 var(--tp-font-display); }
#view-terminplan .tp-d-info { margin: -6px 0 0; color: var(--tp-text-2); font-size: 13px; line-height: 1.45; }
#view-terminplan .tp-d-feld { display: grid; gap: 6px; margin: 0; }
#view-terminplan .tp-d-feld small { color: var(--tp-text-3); font-size: 12px; font-weight: 600; }
#view-terminplan .tp-d-feld .tp-ein { max-width: none; height: 38px; padding: 0 12px; border-radius: 9px; font-size: 14px; }
#view-terminplan .tp-d-zwei { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; align-items: end; }
#view-terminplan .tp-d-schieben { display: flex; align-items: center; height: 38px; padding: 0 12px; border: 1px dashed var(--tp-border-strong); border-radius: 9px; color: var(--tp-text); font-size: 14px; font-weight: 600; }
#view-terminplan .tp-d-vorschau { padding: 10px 12px; border: 1px solid var(--tp-border); border-radius: 10px; background: var(--tp-surface-2); color: var(--tp-text-2); font-size: 13px; line-height: 1.5; }
#view-terminplan .tp-d-vorschau b { color: var(--tp-text); }
#view-terminplan .tp-d-knoepfe { display: flex; justify-content: flex-end; gap: 8px; }
#view-terminplan .tp-kalender { z-index: 90; }

/* Handy: Fortschritt im Blatt, Hinweise in der Liste */
#view-terminplan .tp-stand-wahl { display: grid; gap: 6px; }
#view-terminplan .tp-stand-wahl small { color: var(--tp-text-3); font-size: 11px; }
#view-terminplan .tp-stand-wahl > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)) minmax(0, 1.5fr); gap: 6px; }
#view-terminplan .tp-stand-wahl button { height: 38px !important; border: 1px solid var(--tp-border); border-radius: 9px; background: var(--tp-surface); color: var(--tp-text-2); font-size: 13px; font-weight: 600; white-space: nowrap; }
#view-terminplan .tp-stand-wahl button[aria-pressed="true"] { border-color: var(--tp-work); background: var(--tp-work-soft); color: var(--tp-text); }
#view-terminplan .tp-stand-wahl button:last-child[aria-pressed="true"] { border-color: var(--tp-ok); background: color-mix(in srgb, var(--tp-ok) 12%, transparent); color: var(--tp-ok); }
#view-terminplan .tp-h-fertig { color: var(--tp-ok); font-weight: 600; }
#view-terminplan .tp-h-ueber { color: var(--tp-warn); font-weight: 650; }

/* Handy-Zeitleiste: nur Nr. und Vorgang (die Regeln oben gelten dort nicht) */
#view-terminplan .tp-h-zeitleiste .vg-tab, #view-terminplan .tp-h-zeitleiste .vg-karte.bp .vg-tab { grid-template-columns: 24px minmax(0, 1fr); }
#view-terminplan .tp-h-zeitleiste .vg-gruppe .vg-tab, #view-terminplan .tp-h-zeitleiste .vg-karte.bp .vg-gruppe .vg-tab { grid-template-columns: minmax(0, 1fr); }
#view-terminplan .tp-h-zeitleiste .vg-karte, #view-terminplan .tp-h-zeitleiste .vg-karte.bp { --tab: 150px; }
#view-terminplan .tp-h-zeitleiste .vg-stand { display: none; }
#view-terminplan .vg-tab-kopf .vg-stand { color: var(--tp-text-3); font-size: 11px; font-weight: 650; }
#view-terminplan .tp-an-kurz { display: grid; grid-template-columns: auto auto minmax(0, 1fr) 14px; align-items: center; gap: 14px; height: 46px; padding: 0 14px !important; border: 1px solid var(--tp-border); border-radius: 12px; background: var(--tp-surface); color: var(--tp-text-2); font-size: 13px; font-weight: 600; text-align: left; }
#view-terminplan .tp-an-kurz > span { display: inline-flex; align-items: center; gap: 7px; white-space: nowrap; }
#view-terminplan .tp-an-kurz .zahl-ueber { justify-self: end; color: var(--tp-warn); font-weight: 700; }
#view-terminplan .tp-an-kurz .zahl-ok { justify-self: end; color: var(--tp-ok); }
#view-terminplan .tp-an-kurz.ueber { border-color: color-mix(in srgb, var(--tp-warn) 45%, var(--tp-border)); }
#view-terminplan .tp-an-kurz > svg { width: 14px; height: 14px; fill: none; stroke: var(--tp-text-3); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s ease; }
#view-terminplan .tp-an-kurz[aria-expanded="true"] > svg { transform: rotate(180deg); }

/* v768: Kachel „Terminplan“ im Arbeitsbereich wie „Dashboard“ und „Digitaler Bauleiter“: Pfeil rechts, die ganze
   Zeile ist klickbar. Das Symbolfeld kommt seit v769 aus arbeitsbereich.css (.ab-symbol). */
#terminplanCard::before { content: ""; }
#bauleiterArbeitsbereich #terminplanCard { min-height: 78px !important; padding: 15px 76px 15px 70px !important; }
#bauleiterArbeitsbereich #terminplanCard > #btnTerminplanOeffnen {
  position: absolute !important; inset: 0 !important; z-index: 4 !important; width: 100% !important; min-width: 0 !important; max-width: none !important;
  height: 100% !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; transform: none !important; border: 0 !important;
  border-radius: 0 !important; background: transparent !important; box-shadow: none !important; color: transparent !important; font-size: 0 !important; cursor: pointer !important;
}
#bauleiterArbeitsbereich #terminplanCard::after {
  content: "›"; position: absolute; right: 20px; top: 39px; transform: translateY(-50%); z-index: 3;
  color: var(--text-muted); font-size: 26px; font-weight: 400; line-height: 1; pointer-events: none;
}
@media (max-width: 900px) {
  #bauleiterArbeitsbereich #terminplanCard { min-height: 74px !important; padding: 14px 58px 14px 60px !important; }
  #bauleiterArbeitsbereich #terminplanCard::after { right: 14px; top: 37px; }
}
@media (max-width: 620px) {
  #bauleiterArbeitsbereich #terminplanCard { min-height: 72px !important; padding: 13px 48px 13px 56px !important; }
  #bauleiterArbeitsbereich #terminplanCard::after { right: 10px; top: 36px; font-size: 24px; }
}
/* ===================== v788: Verbinden mit der Maus ===================== */
#view-terminplan .tp-verbinder { position: absolute; top: 50%; right: -17px; z-index: 3; width: 17px; height: 17px; transform: translateY(-50%); cursor: crosshair; opacity: 0; transition: opacity .12s; }
#view-terminplan .tp-verbinder::after { content: ""; position: absolute; top: 50%; left: 4px; width: 9px; height: 9px; border: 2px solid var(--tp-work); border-radius: 50%; background: var(--tp-surface); transform: translateY(-50%); box-sizing: border-box; }
#view-terminplan .vg-raute .tp-verbinder { right: -19px; }
#view-terminplan :is(.vg-balken, .vg-raute):hover .tp-verbinder, #view-terminplan .tp-verbinder:hover { opacity: 1; }
#view-terminplan .tp-verbinder:hover::after { background: var(--tp-work); }
#view-terminplan .vg-raute.aussen:hover .tp-label { left: 36px; }
#view-terminplan.tp-verbindet, #view-terminplan.tp-verbindet * { cursor: crosshair !important; }
#view-terminplan.tp-verbindet .tp-verbinder { opacity: 0; }
#view-terminplan .vg-gummi { fill: none; stroke: var(--tp-work); stroke-width: 2; stroke-dasharray: 5 4; }
#view-terminplan .tp-ziel { outline: 2px solid var(--tp-work); outline-offset: 3px; }
#view-terminplan .tp-ziel-nein { outline: 2px dashed var(--tp-bad, #b42318); outline-offset: 3px; }
#view-terminplan .tp-zieh-info.nein { background: var(--tp-bad, #b42318); color: var(--tp-on-bad, #ffffff); }
#view-terminplan .vg-pfeile .vg-treffer { fill: none; stroke: transparent; stroke-width: 12; }
#view-terminplan .vg-pfeile.bearbeitbar .vg-treffer { pointer-events: stroke; cursor: pointer; }
#view-terminplan .vg-pfeile.bearbeitbar .vg-kante:hover .vg-pfad { stroke: var(--tp-work); stroke-width: 2; }
#view-terminplan .vg-pfeile.bearbeitbar .vg-kante:hover .vg-spitze { fill: var(--tp-work); }
#view-terminplan .tp-menue-titel { max-width: 340px; padding: 8px 12px 7px; color: var(--tp-text); font-size: 12.5px; font-weight: 650; line-height: 1.35; }
#view-terminplan .tp-menue-titel small { display: block; margin-top: 2px; color: var(--tp-text-3); font-size: 11.5px; font-weight: 500; }
/* ===================== v788: Kopf und Zeitleiste fest – nur die Vorgänge scrollen ===================== */
body[data-app-view="terminplan"].tp-fest { overflow: hidden; }
body[data-app-view="terminplan"].tp-fest #view-terminplan .vg-scroll { overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
#view-terminplan .vg-karte > .vg-kopfzeile { padding-right: var(--tp-sb, 0px); border-bottom-color: var(--tp-border-strong); }
/* ===================== v788: Was steht an kompakt – drei Kennzahlen unter dem Titel, der Plan hat den Platz ===================== */
#view-terminplan { --tp-warn-text: var(--tp-warn); --tp-ok-text: var(--tp-ok); }
#view-terminplan .vg-kopf .vg-stand { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-top: 2px; }
#view-terminplan .tp-lage-leiste { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
#view-terminplan .tp-lage-anker { position: relative; }
#view-terminplan .tp-lage { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px !important; border: 1px solid var(--tp-border); border-radius: 99px; background: var(--tp-surface); color: var(--tp-text-2); font-size: 12px; font-weight: 600; white-space: nowrap; cursor: pointer; }
#view-terminplan .tp-lage b { color: var(--tp-text); font-weight: 700; font-variant-numeric: tabular-nums; }
#view-terminplan .tp-lage .tp-an-punkt { width: 8px; height: 8px; }
#view-terminplan .tp-lage:hover, #view-terminplan .tp-lage[aria-expanded="true"] { border-color: var(--tp-work); }
#view-terminplan .tp-lage.ueber { border-color: var(--tp-warn-line); background: var(--tp-warn-soft); color: var(--tp-warn-text); }
#view-terminplan .tp-lage.ueber b { color: var(--tp-warn-text); }
#view-terminplan .tp-lage.ueber:hover, #view-terminplan .tp-lage.ueber[aria-expanded="true"] { border-color: var(--tp-warn); }
#view-terminplan .tp-lage.ok { color: var(--tp-ok-text); }
#view-terminplan .tp-lage-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 45; width: 380px; max-width: calc(100vw - 32px); box-shadow: var(--tp-shadow-pop); }
#view-terminplan .tp-lage-liste { display: grid; gap: 2px; max-height: 360px; overflow-y: auto; }
#view-terminplan .tp-lage-pop.ueber .tp-an-rechts b { color: var(--tp-warn-text); }
/* Tablet: ohne Maus kein „darüber“ – am ausgewählten Balken bleibt der Verbinden-Punkt sichtbar */
#view-terminplan :is(.vg-balken, .vg-raute).markiert .tp-verbinder { opacity: 1; }
#view-terminplan .tp-verbinder { touch-action: none; }
/* v788: Kontrast – Tag: Nebenschrift, Orange und Grün wie in der Einsatzplanung (≥ 4,5 : 1, Werte oben in den Tokens);
   Nacht: Meldung und Zieh-Hinweis als dunkle Fläche statt hell */
html[data-theme="dark"] #view-terminplan :is(.vg-toast, .tp-zieh-info:not(.nein)) { border: 1px solid var(--tp-border-strong); background: var(--tp-surface-3); color: var(--tp-text); }
html[data-theme="dark"] #view-terminplan :is(.vg-toast-icon, .vg-toast button) { background: color-mix(in srgb, var(--tp-text) 12%, transparent); color: var(--tp-text); }
#view-terminplan { --tp-bad: #b42318; --tp-on-bad: #ffffff; }
html[data-theme="dark"] #view-terminplan { --tp-bad: #ff7b7b; --tp-on-bad: #2a0b0b; }
#view-terminplan :is(.tp-menue button.gefahr:not([disabled]), .tp-mini.gefahr) { color: var(--tp-bad); }
html[data-theme="dark"] #view-terminplan .tp-zieh-info.nein { border: 1px solid var(--tp-bad); background: color-mix(in srgb, var(--tp-bad) 16%, var(--tp-surface)); color: var(--tp-bad); }
/* v788: sehr schmale Tagesspalten – nur Wochenbeginn (Mo) und „heute“ beschriften */
#view-terminplan .vg-karte.tage-eng .vg-tage span:not(.heute):not(.mo), #view-terminplan .vg-karte.tage-eng .vg-tage span.mo.nah { visibility: hidden; }
#view-terminplan .vg-karte.tage-eng .vg-tage span.heute { left: calc((var(--i) + .5) * 100% / var(--tage)); width: auto; min-width: 20px; padding: 0 4px; transform: translateX(-50%); }
