/* Styles nur fuer Modul H: Testprogramm (Workplace V3, Signatur ServiceNow GRC / Jira
   Advanced Roadmaps), Asset-Inventar als CMDB-Viewer und die Nachschau in der Auswertung.
   Grundbausteine aus design.css; hier nur Anordnung und Signatur: Liste mit Detailpanel,
   Kennzahlen mit Ringen, Zeitleiste Q4 mit Meilensteinen. */

/* Im Fenster fuellt das Werkzeug die Flaeche von Kante zu Kante. */
.ws-app-fill > .tool.tp, .ws-app-fill > .tool.tp-inv { height: 100%; border-radius: 0; box-shadow: none; }
.tp, .tp-inv, .tp-res { --tp-run-soft: color-mix(in srgb, var(--accent) 30%, var(--ds-bg-surface)); }
.tp label, .tp-inv label { margin: 0; }
.tp .ds-table, .tp-inv .ds-table, .tp-res .ds-table { margin: 0; }
.tp .ds-toolhead-ver, .tp .ds-toolhead-meta-v { font-family: var(--font-sans); }

/* ---------- Kopf: Reiter im Kopf ---------- */
.tp .tp-headtabs { align-self: stretch; margin: calc(-1 * var(--sp-2)) 0 calc(-1 * var(--sp-2)) var(--sp-4); }
.tp .ds-toolhead-tab {
  height: auto; margin: 0; padding: 0 var(--sp-3); border-radius: 0; background: transparent;
  font-family: inherit; display: inline-flex; align-items: center; gap: 6px;
  transition: color var(--dur-1) var(--ease), border-color var(--dur-1) var(--ease);
}
.tp .ds-toolhead-tab:hover, .tp .ds-toolhead-tab:active { background: transparent; color: var(--ds-text); }
.tp .ds-toolhead-tab.is-active { border-bottom-color: var(--accent); }
.tp .ds-toolhead-tab:focus-visible { outline: var(--focus-outline); outline-offset: -4px; }
.tp-tab-n {
  min-width: 20px; height: 18px; padding: 0 6px; border-radius: var(--r-pill);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ds-bg-muted); color: var(--ds-text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold);
}
.tp .ds-toolhead-tab.is-active .tp-tab-n { background: color-mix(in srgb, var(--accent) 14%, var(--ds-bg-surface)); color: var(--ds-text); }

/* ---------- Befehlsleiste ---------- */
.tp .ds-cmd:disabled { background: transparent; }
.tp .ds-cmd--primary:disabled { background: var(--ds-primary); color: #fff; opacity: 0.4; }

/* ---------- Abdeckungs-Kennzahlen: Band mit Ringen ---------- */
.tp-kpis {
  display: flex; align-items: stretch; flex-shrink: 0;
  background: var(--ds-bg-subtle); border-bottom: 1px solid var(--ds-border-subtle);
}
.tp-kpi {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--sp-3);
  padding: 10px var(--sp-4);
}
.tp-kpi + .tp-kpi { border-left: 1px solid var(--ds-border-subtle); }
.tp-kpi-t { display: flex; flex-direction: column; min-width: 0; }
.tp-kpi-v { font-size: var(--fs-l); font-weight: var(--fw-semibold); color: var(--ds-text); line-height: 1.2; }
.tp-kpi-v small { font-size: var(--fs-s); font-weight: var(--fw-regular); color: var(--ds-text-3); }
.tp-kpi-l { font-size: var(--fs-xs); color: var(--ds-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-ring { width: 36px; height: 36px; flex-shrink: 0; }
.tp-ring-bg { fill: none; stroke: var(--ds-bg-sunken); stroke-width: 4; }
.tp-ring-fg { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dasharray var(--dur-3) var(--ease-out); }
.tp-ring.voll .tp-ring-fg { stroke: var(--ds-ok); }
.tp-kpi-ic { width: 36px; height: 36px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 12%, var(--ds-bg-surface)); color: var(--accent); }
.tp-kpi-ic svg { width: 18px; height: 18px; }

/* ---------- Liste und Detailpanel ---------- */
.tp-split { flex: 1; min-height: 0; display: flex; }
.tp-body { flex: 1; min-width: 0; min-height: 0; overflow: auto; background: var(--ds-bg-surface); outline: none; container: tpbody / inline-size; }
/* Schmale Liste: Die Exposition steht im Detailpanel, die Spalte entfaellt. */
@container tpbody (max-width: 980px) { .tp-list .tp-c-exp { display: none; } }
.tp-list { table-layout: auto; }
.tp-list thead th:first-child, .tp-list tbody td:first-child { padding-left: var(--sp-5); }
.tp-list tbody td { height: 56px; padding-top: 6px; padding-bottom: 6px; }
.tp-list tbody tr { cursor: pointer; }
.tp-list tbody tr.is-selected, .tp-list tbody tr.is-selected:hover { box-shadow: none; }
.tp-list tbody tr.is-selected td { background: var(--ds-primary-soft); }
.tp-list tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tp-c-name { min-width: 180px; }
.tp-c-krit, .tp-c-st, .tp-c-termin { width: 1%; white-space: nowrap; }
.tp-c-freq { white-space: nowrap; }
.tp-name { display: block; font-family: var(--font-mono); font-size: var(--fs-s); font-weight: var(--fw-semibold); color: var(--ds-text); white-space: nowrap; }
.tp-purpose { display: block; font-size: var(--fs-s); color: var(--ds-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.tp-risk { font-variant-numeric: tabular-nums; }
.tp-exp { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-s); color: var(--ds-text-2); }
.tp-exp svg { width: 14px; height: 14px; flex-shrink: 0; }
.tp-exp.exposed { color: var(--ds-bad-text); font-weight: var(--fw-semibold); }
.tp-freq { display: block; color: var(--ds-text); }
.tp-ohne { display: block; font-size: var(--fs-xs); color: var(--ds-warn-text); }
.tp-verfs { display: flex; flex-wrap: wrap; gap: 4px; }
.tp-verf {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: var(--r-xs);
  background: var(--ds-bg-muted); color: var(--ds-text-2); font-size: var(--fs-xs); font-weight: var(--fw-semibold); white-space: nowrap;
}
.tp-st { min-width: 72px; }
.tp-leer { color: var(--ds-text-3); font-style: italic; font-weight: var(--fw-regular); }
.tp-empty { min-height: 160px; }

/* Programmvorgaben unter der Liste: Spalten mit Linien statt Karten */
.tp-vorgaben { border-top: 1px solid var(--ds-border-subtle); padding: var(--sp-4) var(--sp-5) var(--sp-5); background: var(--ds-bg-subtle); }
.tp-sec { margin: 0 0 var(--sp-3); font-size: var(--fs-s); font-weight: var(--fw-semibold); color: var(--ds-text); }
.tp-decisions { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3); }
.tp-decision {
  padding: var(--sp-3) var(--sp-4); background: var(--ds-bg-surface);
  border: 1px solid var(--ds-border-subtle); border-radius: var(--r-m);
}
.tp-decision-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); margin-bottom: var(--sp-2); }
.tp-h { margin: 0; font-size: var(--fs-s); font-weight: var(--fw-semibold); color: var(--ds-text); }
.tp-welle { box-shadow: inset 3px 0 0 var(--ds-info); }
.tp-opts { display: flex; flex-direction: column; gap: 2px; }
.tp-opt {
  align-items: flex-start; padding: 6px var(--sp-2); margin: 0 calc(-1 * var(--sp-2));
  border-radius: var(--r-s); font-size: var(--fs-s); line-height: var(--lh-snug);
}
.tp-opt input { margin-top: 1px; }
.tp-opt:hover { background: var(--ds-bg-hover); }
.tp-opt.is-on { background: var(--ds-primary-soft); color: var(--ds-primary-text); }

/* Detailpanel */
.tp-detail {
  width: 380px; flex-shrink: 0; min-height: 0; display: flex; flex-direction: column;
  border-left: 1px solid var(--ds-border-subtle); background: var(--ds-bg-surface);
}
@container wz (min-width: 1600px) { .tp-detail { width: 440px; } }
.tp-d-head { display: flex; align-items: center; gap: var(--sp-2); padding: var(--sp-4) var(--sp-3) var(--sp-2) var(--sp-4); }
.tp-d-ic { width: 36px; height: 36px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; background: color-mix(in srgb, var(--accent) 12%, var(--ds-bg-surface)); color: var(--accent); }
.tp-d-ic svg { width: 18px; height: 18px; }
.tp-d-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.tp-d-name { font-family: var(--font-mono); font-size: var(--fs-l); font-weight: var(--fw-semibold); color: var(--ds-text); }
.tp-d-sub { font-size: var(--fs-s); color: var(--ds-text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-d-head .ds-iconbtn:disabled { opacity: 0.35; cursor: default; background: transparent; }
.tp-d-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-2); padding: 0 var(--sp-4) var(--sp-2); }
.tp-d-st { margin-left: auto; }
.tp-d-links { padding: 0 var(--sp-3) var(--sp-2); border-bottom: 1px solid var(--ds-border-subtle); }
.tp .tp-d-inv { height: 30px; }
.tp-d-body { flex: 1; min-height: 0; overflow: auto; padding: 0 var(--sp-4) var(--sp-4); }
.tp-d-sec { padding: var(--sp-3) 0; border-bottom: 1px solid var(--ds-border-subtle); }
.tp-d-sec:last-child { border-bottom: 0; }
.tp-d-sec .tp-h { margin-bottom: var(--sp-2); }
.tp-d-sec .ds-field { margin: 0 0 var(--sp-2); gap: 3px; }
.tp-d-sec .ds-field:last-child { margin-bottom: 0; }
.tp-d-sec .ds-select { width: 100%; }
.tp-reason:disabled { opacity: 0.6; }

/* Verfahren als Auswahlliste mit Kaestchen */
.tp-chips { display: flex; flex-direction: column; gap: 2px; }
.tp-chip {
  display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%;
  height: 34px; margin: 0; padding: 0 var(--sp-2);
  background: transparent; border: 0; border-radius: var(--r-s);
  font-family: inherit; font-size: var(--fs-s); color: var(--ds-text); text-align: left; cursor: pointer;
  transition: background var(--dur-1) var(--ease);
}
.tp-chip:hover { background: var(--ds-bg-hover); }
.tp-chip:active { background: var(--ds-bg-active); }
.tp-chip.is-on { background: var(--ds-primary-soft); color: var(--ds-primary-text); font-weight: var(--fw-medium); }
.tp-chip-box {
  width: 16px; height: 16px; border-radius: 4px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ds-gray-400); background: var(--ds-bg-surface); color: #fff;
}
.tp-chip.is-on .tp-chip-box { background: var(--ds-primary); border-color: var(--ds-primary); }
.tp-chip-box svg { width: 11px; height: 11px; }

/* Laeufe des Objekts als Streifen ueber die Wochen */
.tp-d-strip { display: grid; grid-template-columns: repeat(14, 1fr); gap: 3px; margin-top: var(--sp-3); }
.tp-d-wk { height: 14px; border-radius: 3px; background: var(--ds-bg-muted); }
.tp-d-wk.lauf { background: var(--tp-run-soft); }
.tp-d-wk.erst { background: var(--accent); }
.tp-d-strip-leg { display: flex; justify-content: space-between; margin-top: 4px; font-size: var(--fs-xs); color: var(--ds-text-3); }

/* ---------- Fusszeile ---------- */
.tp-foot {
  display: flex; align-items: center; gap: var(--sp-4);
  min-height: 34px; padding: 4px var(--sp-4); box-sizing: border-box;
  border-top: 1px solid var(--ds-border-subtle); background: var(--ds-bg-subtle); flex-shrink: 0;
  font-size: var(--fs-xs); color: var(--ds-text-3);
}
.tp-bezug { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.tp-ref { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ds-text-2); padding: 1px 6px; border-radius: var(--r-xs); background: var(--ds-bg-muted); }
.tp-offen, .tp-bereit { margin-left: auto; white-space: normal; text-align: right; font-size: var(--fs-xs); }

/* ---------- Zeitleiste Q4 ---------- */
.tp-cal-wrap { min-width: 760px; }
.tp-cal { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; font-size: var(--fs-s); margin: 0; }
.tp-cal-c-asset { width: 210px; }
.tp-cal-c-freq { width: 110px; }
.tp-cal-c-n { width: 60px; }
.tp-cal th, .tp-cal td { padding: 0; border: 0; border-bottom: 1px solid var(--ds-border-subtle); text-align: center; vertical-align: middle; }
.tp-cal thead th {
  position: sticky; z-index: 1; background: var(--ds-bg-muted); color: var(--ds-text-3);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); text-transform: none; letter-spacing: 0;
}
.tp-cal-mon th { top: 0; height: 28px; text-transform: uppercase; letter-spacing: var(--ls-caps); border-bottom: 1px solid var(--ds-border); }
.tp-cal thead th[rowspan] { top: 0; text-transform: uppercase; letter-spacing: var(--ls-caps); border-bottom: 1px solid var(--ds-border); }
.tp-cal-kw th { top: 28px; height: 34px; font-weight: var(--fw-semibold); font-variant-numeric: tabular-nums; }
.tp-cal-kw th span { display: block; font-size: var(--fs-xs); font-weight: var(--fw-regular); color: var(--ds-text-3); line-height: 1; }
.tp-cal-ms th { top: 62px; height: 24px; background: var(--ds-bg-subtle); border-bottom: 1px solid var(--ds-border); overflow: visible; }
.tp-cal-ms th.tp-ms-on { z-index: 2; text-align: left; }
.tp-ms { position: relative; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--ds-text); margin-left: 30%; }
.tp-ms-d { display: inline-block; width: 9px; height: 9px; background: var(--ds-text); transform: rotate(45deg); border-radius: 1px; flex-shrink: 0; }
.tp-cal .tp-cal-msep { box-shadow: inset 1px 0 0 var(--ds-border); }
.tp-cal .tp-cal-asset, .tp-cal .tp-cal-freq { text-align: left; padding: 0 var(--sp-3); }
.tp-cal thead .tp-cal-asset { padding-left: var(--sp-5); }
.tp-cal tbody td { height: 54px; }
.tp-cal tbody td.tp-cal-asset { padding: 6px var(--sp-3) 6px var(--sp-5); }
.tp-cal-row { cursor: pointer; }
.tp-cal-row:hover td { background: var(--ds-bg-hover); }
.tp-cal-row.is-selected td { background: var(--ds-primary-soft); }
.tp-cal-row.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tp-cal-name { display: block; font-family: var(--font-mono); font-weight: var(--fw-semibold); color: var(--ds-text); }
.tp-cal-verf { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 3px; }
.tp-cal-verf .tp-verf { height: 18px; padding: 0 5px; }
.tp-cal-freq { color: var(--ds-text-2); white-space: nowrap; }
.tp-cal-n { font-weight: var(--fw-semibold); color: var(--ds-text); }
.tp-cal-mark {
  position: relative; display: block; height: 14px; margin: 0 4px; border-radius: 4px;
  background: var(--tp-run-soft);
}
.tp-cal-mark.l { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.tp-cal-mark.r { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.tp-cal-d {
  position: absolute; left: 50%; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px;
  background: var(--accent); transform: rotate(45deg); border-radius: 2px;
  box-shadow: 0 0 0 2px var(--ds-bg-surface);
}
.tp-cal-d--leg { position: static; margin: 0 4px 0 2px; display: inline-block; width: 10px; height: 10px; box-shadow: none; }
.tp-cal-mark--leg { display: inline-block; width: 26px; height: 10px; margin: 0; }
.tp-cal td.tp-cal-offen {
  color: var(--ds-warn-text); font-style: italic; text-align: left; padding-left: var(--sp-3);
  background: repeating-linear-gradient(135deg, var(--ds-bg-surface) 0 6px, var(--ds-warn-soft) 6px 12px);
}
.tp-cal td.tp-cal-offen span { background: var(--ds-bg-surface); padding: 2px 6px; border-radius: var(--r-xs); }
.tp-cal tbody tr:last-child td { border-bottom: 0; }
.tp-cal-leg { display: flex; align-items: center; gap: var(--sp-5); padding: var(--sp-2) var(--sp-5); border-top: 1px solid var(--ds-border-subtle); font-size: var(--fs-xs); color: var(--ds-text-2); background: var(--ds-bg-subtle); }
.tp-cal-key { display: inline-flex; align-items: center; gap: 6px; }
.tp-cal-hatch { display: inline-block; width: 22px; height: 10px; border-radius: var(--r-xs); background: repeating-linear-gradient(135deg, var(--ds-bg-surface) 0 3px, var(--ds-warn-soft) 3px 6px); box-shadow: inset 0 0 0 1px var(--ds-border); }

/* ---------- Asset-Inventar (CMDB-Viewer) ---------- */
.tp-inv-cmdbar { gap: var(--sp-2); }
.tp-inv-crumbs { padding-left: var(--sp-1); }
.tp-search {
  display: inline-flex; align-items: center; gap: 7px;
  height: 32px; width: 240px; padding: 0 10px;
  background: var(--ds-bg-subtle); border: 1px solid var(--ds-border); border-radius: var(--r-s);
  color: var(--ds-icon); cursor: text;
  transition: border-color var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease), background var(--dur-1) var(--ease);
}
.tp-search:hover { border-color: var(--ds-border-strong); }
.tp-search:focus-within { background: var(--ds-bg-surface); border-color: var(--ds-primary); box-shadow: 0 0 0 3px var(--ds-primary-ring); }
.tp-search svg { width: 15px; height: 15px; flex-shrink: 0; }
.tp-search input { flex: 1; min-width: 0; height: 100%; margin: 0; padding: 0; border: 0; outline: none; background: transparent; font-family: inherit; font-size: var(--fs-s); color: var(--ds-text); }
.tp-search input::placeholder { color: var(--ds-text-3); }
.tp-inv-body { flex: 1; }
.tp-inv-tab tbody td { height: auto; padding-top: 10px; padding-bottom: 10px; vertical-align: top; }
.tp-inv-tab thead th:first-child, .tp-inv-tab tbody td:first-child { padding-left: var(--sp-5); }
.tp-inv-row { cursor: pointer; }
.tp-inv-tab tbody tr.is-selected, .tp-inv-tab tbody tr.is-selected:hover { box-shadow: none; }
.tp-inv-tab tbody tr.is-selected td { background: var(--ds-primary-soft); }
.tp-inv-tab tbody tr.is-selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.tp-ci { display: inline-flex; align-items: center; gap: var(--sp-2); }
.tp-ci-ic { width: 28px; height: 28px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--accent) 12%, var(--ds-bg-surface)); color: var(--accent); flex-shrink: 0; }
.tp-ci-ic svg { width: 15px; height: 15px; }
.tp-nowrap { white-space: nowrap; }
.tp-sourcing { color: var(--ds-text-2); min-width: 260px; line-height: var(--lh-base); }
.tp-inv-foot { min-height: 30px; display: flex; align-items: center; padding: 0 var(--sp-5); border-top: 1px solid var(--ds-border-subtle); background: var(--ds-bg-subtle); font-size: var(--fs-xs); color: var(--ds-text-3); flex-shrink: 0; }

/* ---------- Nachschau (Auswertung) ---------- */
.tp-res {
  display: flex; flex-direction: column; gap: var(--sp-3);
  max-width: 1080px; margin: 0 auto; box-sizing: border-box;
  padding: var(--sp-6) var(--sp-6) var(--sp-2);
}
.tp-res-tool { border: var(--bd); box-shadow: var(--sh-1); }
/* clip statt hidden: kein eigener Scrollbereich, damit der Kopf am Fenster haftet, wenn jemand die Seite scrollt */
.tp-res-tool { overflow: clip; }
#tp-res-head { position: sticky; top: 0; z-index: 3; }
.tp-kennung { white-space: nowrap; }
.tp-fst-id { width: 150px; }
.tp-fst-status { width: 160px; }
.tp-chron-head { padding: var(--sp-3) var(--sp-4) var(--sp-1); border-top: var(--bd); }
.tp-chron { list-style: none; margin: 0; padding: var(--sp-2) var(--sp-4) var(--sp-4); position: relative;
  max-height: clamp(150px, 34vh, 320px); overflow-y: auto; }   /* nur die Chronik scrollt, Kopf und Feststellungen bleiben stehen */
.tp-res-tool:not(.is-live) .tp-chron { max-height: none; overflow: visible; }   /* nach dem Lauf steht die ganze Chronik */
.tp-chron-row {
  position: relative; display: flex; gap: var(--sp-3); align-items: flex-start;
  padding: 6px 0 6px 2px;
  font-size: var(--fs-s); line-height: var(--lh-base); color: var(--ds-text);
}
.tp-chron-row::before {
  content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 1px; background: var(--ds-border);
}
.tp-chron-row:first-child::before { top: 14px; }
.tp-chron-row:last-child::before { bottom: calc(100% - 14px); }
.tp-chron-dot {
  position: relative; z-index: 1; flex-shrink: 0;
  width: 10px; height: 10px; margin-top: 5px; border-radius: 50%;
  background: var(--ds-gray-400); box-shadow: 0 0 0 3px var(--ds-bg-surface);
}
.tp-chron-row.kind-ok .tp-chron-dot { background: var(--ds-ok); }
.tp-chron-row.kind-warn .tp-chron-dot { background: var(--ds-warn); }
.tp-chron-row.kind-bad .tp-chron-dot { background: var(--ds-bad); }
.tp-chron-row.kind-bad .tp-chron-text { color: var(--ds-bad-text); }
.tp-res-tool.is-live .ds-toolhead-dot { animation: tp-puls 1.6s var(--ease) infinite; }
@keyframes tp-puls { 50% { opacity: 0.35; } }
.tp-sum { font-size: var(--fs-m); }
.tp-sum ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); }
.tp-sum li { margin: 3px 0; color: var(--ds-text); }
.tp-res-foot { display: flex; justify-content: flex-end; gap: var(--sp-2); padding: var(--sp-1) 0 var(--sp-2); }

/* ---------- Zwei Fenster nebeneinander (Container wz am Fenster, tpbody an der Liste) ---------- */
/* Kopf: Reiter in der zweiten Zeile buendig zum Rand und in voller Hoehe */
@container wz (max-width: 900px) {
  .tp .tp-headtabs { align-self: stretch; margin: 0 0 0 calc(-1 * var(--sp-3)); }
  .tp .ds-toolhead-tab { min-height: 36px; }
}
/* Kennzahlen bleiben eine Zeile: Beschriftung bricht um, kleinere Ringe */
@container wz (max-width: 1000px) {
  .tp-kpi { gap: var(--sp-2); padding: 8px var(--sp-3); }
  .tp-kpi-l { white-space: normal; line-height: var(--lh-snug); }
  .tp-ring, .tp-kpi-ic { width: 30px; height: 30px; }
}
/* Sehr schmal: Ringe und Symbol entfallen, der Wert "x / n" steht als Zahl da */
@container wz (max-width: 640px) {
  .tp-kpi { padding: 6px var(--sp-2) 6px var(--sp-3); }
  .tp-ring, .tp-kpi-ic { display: none; }
  .tp-kpi-v { font-size: var(--fs-m); }
}
/* Detailpanel schmaler; es hat keinen Schliessen-Knopf und immer eine Auswahl,
   deshalb bleibt es neben der Liste statt sie zu ueberdecken. */
@container wz (max-width: 1000px) {
  .tp-detail { width: 320px; }
  .tp-chip { height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; line-height: var(--lh-snug); }
  .tp-d-meta .tp-d-st { margin-left: 0; }
}
@container wz (max-width: 640px) {
  .tp-detail { width: 280px; }
  .tp-d-head { padding: var(--sp-3) var(--sp-2) var(--sp-2) var(--sp-3); }
  .tp-d-meta { padding: 0 var(--sp-3) var(--sp-2); }
  .tp-d-body { padding: 0 var(--sp-3) var(--sp-3); }
  .tp-d-name { font-size: var(--fs-m); }
}
/* Liste: was im Detailpanel steht, entfaellt bei schmaler Liste */
@container tpbody (max-width: 720px) {
  .tp-list .tp-c-termin, .tp-list .tp-c-verf { display: none; }
}
@container tpbody (max-width: 480px) {
  .tp-list .tp-c-freq { display: none; }
  .tp-purpose { max-width: 200px; }
}
@container tpbody (max-width: 340px) {
  .tp-list .tp-c-st { display: none; }
  .tp-c-name { min-width: 0; }
  .tp-list thead th, .tp-list tbody td { padding-left: var(--sp-2); padding-right: var(--sp-2); }
  .tp-list thead th:first-child, .tp-list tbody td:first-child { padding-left: var(--sp-4); }
  .tp-purpose { max-width: 150px; }
}
@container tpbody (max-width: 560px) {
  .tp-vorgaben { padding: var(--sp-3) var(--sp-4) var(--sp-4); }
  .tp-decisions { grid-template-columns: minmax(0, 1fr); }
  .tp-decision-head { flex-wrap: wrap; justify-content: flex-start; }
}
/* Kalender Q4 braucht die Breite: im schmalen Fenster steht das Detailpanel darunter
   und rollt als Ganzes. Der Kalender rollt seitlich, wenn er nicht passt. */
@container wz (max-width: 1000px) {
  .tp-split:has(.tp-cal-wrap) { flex-direction: column; }
  .tp-split:has(.tp-cal-wrap) .tp-body { flex: 0 1 auto; max-height: 60%; }
  .tp-split:has(.tp-cal-wrap) .tp-detail {
    flex: 1 1 0; width: auto; min-height: 120px; overflow-y: auto;
    border-left: 0; border-top: 1px solid var(--ds-border);
  }
  .tp-split:has(.tp-cal-wrap) .tp-d-body { flex: none; overflow: visible; }
  .tp-cal-wrap { min-width: 640px; }
  .tp-cal-c-asset { width: 170px; }
  .tp-cal-c-freq { width: 96px; }
  .tp-cal-c-n { width: 52px; }
  .tp-cal .tp-cal-asset, .tp-cal .tp-cal-freq { padding: 0 var(--sp-2); }
  .tp-cal thead .tp-cal-asset, .tp-cal tbody td.tp-cal-asset { padding-left: var(--sp-4); }
  .tp-cal tbody td { height: 48px; }
  .tp-cal-leg { flex-wrap: wrap; gap: var(--sp-1) var(--sp-4); padding: var(--sp-2) var(--sp-4); }
}
/* Fusszeile: Hinweis rutscht unter die Bezuege und hat die volle Breite */
@container wz (max-width: 960px) {
  .tp-foot { flex-wrap: wrap; row-gap: 2px; gap: 2px var(--sp-3); }
  .tp-offen, .tp-bereit { margin-left: 0; flex: 1 1 100%; text-align: left; }
}
@container wz (max-width: 640px) {
  .tp-foot { padding: 4px var(--sp-3); }
}
/* Inventar: jede Zeile zweizeilig. Oben System, Funktion, Kritikalitaet, Exposition;
   darunter Klasse unter dem System und Bezug und Pflege ueber die restliche Breite. */
@container wz (max-width: 820px) {
  .tp-inv-tab, .tp-inv-tab thead, .tp-inv-tab tbody { display: block; }
  .tp-inv-tab tr { display: grid; grid-template-columns: 172px minmax(0, 1.15fr) 100px minmax(0, 1fr); }
  .tp-inv-tab th, .tp-inv-tab td { min-width: 0; }
  .tp-inv-tab thead th:nth-child(2), .tp-inv-tab thead th:nth-child(6) { display: none; }
  .tp-inv-tab thead th { display: flex; align-items: center; }
  .tp-inv-tab tbody td:nth-child(1) { grid-area: 1 / 1; }
  .tp-inv-tab tbody td:nth-child(2) { grid-area: 2 / 1; padding-top: 0; padding-left: calc(var(--sp-5) + 28px + var(--sp-2)); }
  .tp-inv-tab tbody td:nth-child(3) { grid-area: 1 / 2; }
  .tp-inv-tab tbody td:nth-child(4) { grid-area: 1 / 3; }
  .tp-inv-tab tbody td:nth-child(5) { grid-area: 1 / 4; }
  .tp-inv-tab tbody td.tp-sourcing { grid-area: 2 / 2 / 3 / -1; min-width: 0; padding-top: 0; }
  .tp-inv-tab tbody td { border-bottom: 0; }
  .tp-inv-tab tbody tr { border-bottom: 1px solid var(--ds-border-subtle); }
  .tp-inv-tab tbody tr.is-selected, .tp-inv-tab tbody tr.is-selected:hover { box-shadow: inset 3px 0 0 var(--accent); }
  .tp-inv-tab tbody tr.is-selected td:first-child { box-shadow: none; }
}
@container wz (max-width: 640px) {
  .tp-inv-cmdbar .tp-search { flex: 1 1 180px; width: auto; }
  .tp-inv-tab tr { grid-template-columns: 150px minmax(0, 1.15fr) 108px minmax(0, 1fr); }
  .tp-inv-tab thead th:first-child, .tp-inv-tab tbody td:first-child { padding-left: var(--sp-4); }
  .tp-inv-tab tbody td:nth-child(2) { padding-left: calc(var(--sp-4) + 28px + var(--sp-2)); }
  .tp-inv-tab th, .tp-inv-tab td { padding-left: var(--sp-2); padding-right: var(--sp-2); }
}
.tp-inv-tab .tp-exp { align-items: flex-start; }
.tp-inv-tab .tp-exp svg { margin-top: 2px; }

@media (prefers-reduced-motion: reduce) {
  .tp-res-tool.is-live .ds-toolhead-dot { animation: none; }
}
