@import url("https://fonts.googleapis.com/css2?family=Saira+Semi+Condensed:wght@500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500;600&display=swap");

/* ------------------------------------------------------------------
   Leitstand tokens — a night control-room palette with a semantic
   signal system: green = go, amber = hold, red = stop, cyan = telemetry.
------------------------------------------------------------------- */
:root {
  --nacht: #0c121d;          /* page background            */
  --pult: #121a29;           /* panel                      */
  --pult-2: #182236;         /* raised surface             */
  --pult-3: #1f2c45;         /* hover / inset               */
  --papier: #e9e7de;         /* primary text (warm paper)  */
  --nebel: #8e97a8;          /* muted text                 */
  --nebel-2: #626c80;        /* faint text                 */
  --kante: #232f47;          /* border                     */
  --kante-2: #2f3d5c;        /* strong border              */
  --fahrt: #40d18e;          /* signal green — go          */
  --fahrt-dim: #1b3a33;
  --halt: #f25c50;           /* signal red — stop          */
  --halt-dim: #42222a;
  --warte: #efb63d;          /* signal amber — hold        */
  --warte-dim: #3f3423;
  --puls: #62c6e8;           /* telemetry cyan — active    */
  --puls-dim: #1c3348;
  --linie-2: #b28bf0;        /* line L2 badge              */
  --linie-3: #6fa8f5;        /* line L3 badge              */
  --track: #26324c;          /* unlit track                */
  --radius: 12px;
  --display: "Saira Semi Condensed", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono: "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--nacht);
  color: var(--papier);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.5;
}
button, select { font: inherit; }
button, a, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--puls);
  outline-offset: 2px;
}
svg { fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
[hidden] { display: none !important; }
h1, h2 { font-family: var(--display); font-weight: 600; letter-spacing: .01em; margin: 0; text-transform: uppercase; }

.skip-link { background: var(--puls); color: var(--nacht); font-weight: 600; left: 12px; padding: 10px 14px; position: fixed; top: -60px; z-index: 100; }
.skip-link:focus { top: 12px; }

/* ---------------------------------------------------------------- topbar */
.topbar {
  align-items: center;
  background: rgba(12, 18, 29, .92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--kante);
  display: flex;
  height: 64px;
  justify-content: space-between;
  padding: 0 22px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand { align-items: center; color: inherit; display: flex; gap: 12px; text-decoration: none; }
.brand-mark {
  align-items: center;
  background: var(--pult-2);
  border: 1px solid var(--kante-2);
  border-radius: 9px;
  color: var(--papier);
  display: flex;
  font-family: var(--display);
  font-size: 17px;
  font-weight: 700;
  gap: 5px;
  height: 38px;
  justify-content: center;
  width: 46px;
}
.brand-lamp { background: var(--fahrt); border-radius: 50%; box-shadow: 0 0 8px rgba(64, 209, 142, .8); height: 6px; width: 6px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; }
.brand-copy strong { font-family: var(--display); font-size: 15px; letter-spacing: .04em; text-transform: uppercase; }
.brand-copy small { color: var(--nebel); font-size: 11px; letter-spacing: .05em; }
.topbar-actions { align-items: center; display: flex; gap: 12px; }
.ecosystem-links { align-items: center; display: flex; gap: 4px; }
.ecosystem-links a {
  border-radius: 7px;
  color: var(--nebel);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 6px 8px;
  text-decoration: none;
}
.ecosystem-links a:hover { background: var(--pult-2); color: var(--papier); }
.environment-badge {
  align-items: center;
  background: var(--warte-dim);
  border: 1px solid rgba(239, 182, 61, .35);
  border-radius: 999px;
  color: var(--warte);
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  gap: 7px;
  letter-spacing: .09em;
  padding: 6px 11px;
}
.environment-badge i { background: var(--warte); border-radius: 50%; box-shadow: 0 0 6px rgba(239, 182, 61, .7); height: 6px; width: 6px; }
.locale-toggle { background: var(--pult-2); border: 1px solid var(--kante); border-radius: 8px; display: flex; padding: 3px; }
.locale-button { background: none; border: 0; border-radius: 6px; color: var(--nebel); cursor: pointer; font-size: 11px; font-weight: 600; letter-spacing: .05em; padding: 5px 9px; }
.locale-button.is-active { background: var(--pult-3); color: var(--papier); }
.icon-link, .icon-button {
  align-items: center;
  background: transparent;
  border: 1px solid var(--kante);
  border-radius: 8px;
  color: var(--nebel);
  cursor: pointer;
  display: flex;
  height: 34px;
  justify-content: center;
  width: 34px;
}
.icon-link:hover, .icon-button:hover { border-color: var(--kante-2); color: var(--papier); }
.icon-link svg, .icon-button svg { height: 18px; width: 18px; }

/* ---------------------------------------------------------------- shell */
.studio-shell { display: flex; flex-direction: column; gap: 16px; margin: 0 auto; max-width: 1360px; padding: 18px 22px 0; }
.panel { background: var(--pult); border: 1px solid var(--kante); border-radius: var(--radius); }
.panel-heading { align-items: center; border-bottom: 1px solid var(--kante); display: flex; gap: 10px; justify-content: space-between; padding: 14px 18px; }
.panel-heading.compact { padding: 12px 16px; }
.panel-heading h2 { font-size: 16px; }
.eyebrow { color: var(--nebel-2); font-size: 10px; font-weight: 600; letter-spacing: .16em; margin: 0 0 3px; text-transform: uppercase; }

.chip { background: var(--pult-3); border-radius: 999px; color: var(--nebel); font-size: 10px; font-weight: 600; letter-spacing: .07em; padding: 4px 9px; text-transform: uppercase; white-space: nowrap; }
.chip.amber { background: var(--warte-dim); color: var(--warte); }
.chip.ready { background: var(--puls-dim); color: var(--puls); }
.chip.approved { background: var(--fahrt-dim); color: var(--fahrt); }

/* ---------------------------------------------------------------- lines */
.lines { display: flex; gap: 10px; overflow-x: auto; }
.line-chip {
  align-items: center;
  background: var(--pult);
  border: 1px solid var(--kante);
  border-radius: 10px;
  color: var(--papier);
  cursor: pointer;
  display: flex;
  flex: 0 1 auto;
  gap: 11px;
  min-width: 0;
  padding: 9px 13px;
  text-align: left;
}
.line-chip.is-active { background: var(--pult-2); border-color: var(--kante-2); box-shadow: inset 0 -2px 0 var(--fahrt); }
.line-chip:disabled { cursor: not-allowed; opacity: .55; }
.line-badge {
  align-items: center;
  background: var(--fahrt-dim);
  border-radius: 7px;
  color: var(--fahrt);
  display: flex;
  flex: 0 0 auto;
  font-family: var(--display);
  font-size: 13px;
  font-weight: 700;
  height: 30px;
  justify-content: center;
  width: 34px;
}
.line-badge.l2 { background: rgba(178, 139, 240, .14); color: var(--linie-2); }
.line-badge.l3 { background: rgba(111, 168, 245, .14); color: var(--linie-3); }
.line-copy { line-height: 1.3; min-width: 0; }
.line-copy strong, .line-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-copy strong { font-size: 12.5px; font-weight: 600; }
.line-copy small { color: var(--nebel); font-family: var(--mono); font-size: 10px; margin-top: 1px; }
.line-state { color: var(--nebel-2); flex: 0 0 auto; font-size: 9px; font-weight: 600; letter-spacing: .1em; margin-left: 4px; text-transform: uppercase; }
.line-state.live { color: var(--fahrt); }

/* ---------------------------------------------------------------- board */
.board {
  background:
    radial-gradient(90% 140% at 50% -30%, rgba(98, 198, 232, .05), transparent 60%),
    repeating-linear-gradient(to right, rgba(98, 198, 232, .025) 0 1px, transparent 1px 56px),
    var(--pult);
  overflow: hidden;
}
.board-header { align-items: flex-end; display: flex; gap: 16px; justify-content: space-between; padding: 22px 26px 6px; }
.eyebrow-line { border-right: 1px solid var(--kante-2); color: var(--fahrt); margin-right: 9px; padding-right: 9px; }
.title-row { align-items: center; display: flex; flex-wrap: wrap; gap: 13px; }
.board h1 { font-size: clamp(26px, 3.4vw, 38px); font-weight: 700; letter-spacing: .02em; line-height: 1.05; }
.board-summary { color: var(--nebel); font-size: 13.5px; margin: 7px 0 0; max-width: 60ch; }
.status-pill {
  align-items: center;
  border: 1px solid var(--kante-2);
  border-radius: 999px;
  display: inline-flex;
  font-size: 10px;
  font-weight: 600;
  gap: 7px;
  letter-spacing: .09em;
  padding: 6px 11px;
  text-transform: uppercase;
}
.status-pill i { background: currentColor; border-radius: 50%; height: 7px; width: 7px; }
.status-pill.idle { color: var(--nebel); }
.status-pill.running { border-color: rgba(98, 198, 232, .4); color: var(--puls); }
.status-pill.running i { box-shadow: 0 0 8px rgba(98, 198, 232, .9); }
.status-pill.waiting_approval { border-color: rgba(239, 182, 61, .4); color: var(--warte); }
.status-pill.waiting_approval i { box-shadow: 0 0 8px rgba(239, 182, 61, .9); }
.status-pill.completed { border-color: rgba(64, 209, 142, .4); color: var(--fahrt); }
.status-pill.completed i { box-shadow: 0 0 8px rgba(64, 209, 142, .9); }
.status-pill.failed, .status-pill.rejected { border-color: rgba(242, 92, 80, .4); color: var(--halt); }
.status-pill.failed i, .status-pill.rejected i { box-shadow: 0 0 8px rgba(242, 92, 80, .9); }
.run-meta { align-items: flex-end; display: flex; flex-direction: column; flex: 0 0 auto; gap: 4px; padding-bottom: 4px; }
.run-meta > span:first-child { color: var(--nebel-2); font-size: 9px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; }
.run-meta strong { color: var(--nebel); font-family: var(--mono); font-size: 11px; font-weight: 500; }
.transport-label { background: var(--pult-3); border-radius: 999px; color: var(--nebel); font-size: 9px; font-weight: 600; letter-spacing: .08em; padding: 4px 8px; text-transform: uppercase; }
.transport-label.live { background: var(--fahrt-dim); color: var(--fahrt); }

/* The route: an illuminated track diagram. The unlit track runs behind all
   lamps; each station's ::after is the lit segment that fills toward it. */
.route { display: flex; list-style: none; margin: 0; padding: 34px 26px 10px; }
.station { flex: 1; min-width: 0; padding: 0 8px; position: relative; text-align: center; }
.station::before {
  background: var(--track);
  content: "";
  height: 2px;
  left: -50%;
  position: absolute;
  top: 13px;
  width: 100%;
  z-index: 0;
}
.station:first-child::before { display: none; }
.station::after {
  background: linear-gradient(90deg, var(--fahrt), var(--puls));
  box-shadow: 0 0 10px rgba(98, 198, 232, .55);
  content: "";
  height: 2px;
  left: -50%;
  position: absolute;
  top: 13px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s linear;
  width: 100%;
  z-index: 1;
}
.station:first-child::after { display: none; }
.station.seg-lit::after { transform: scaleX(1); }
.lamp {
  background: var(--pult-2);
  border: 2px solid var(--kante-2);
  border-radius: 50%;
  display: inline-block;
  height: 28px;
  position: relative;
  transition: background .25s, border-color .25s, box-shadow .25s;
  width: 28px;
  z-index: 2;
}
.lamp::after {
  background: var(--nebel-2);
  border-radius: 50%;
  content: "";
  height: 8px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  transition: background .25s, box-shadow .25s;
  width: 8px;
}
.station-copy { display: block; margin-top: 12px; }
.station-id { color: var(--nebel-2); display: block; font-family: var(--display); font-size: 11px; font-weight: 600; letter-spacing: .22em; }
.station-copy strong { display: block; font-family: var(--display); font-size: 15px; font-weight: 600; letter-spacing: .05em; margin-top: 2px; text-transform: uppercase; }
.station-copy small { color: var(--nebel); display: block; font-family: var(--mono); font-size: 9.5px; margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.station-state { color: var(--nebel-2); display: block; font-size: 9px; font-weight: 600; letter-spacing: .12em; margin-top: 7px; text-transform: uppercase; }

.station.active .lamp { border-color: var(--puls); box-shadow: 0 0 14px rgba(98, 198, 232, .45); }
.station.active .lamp::after { animation: lampPulse 1.4s ease-in-out infinite; background: var(--puls); box-shadow: 0 0 10px var(--puls); }
.station.active .station-state { color: var(--puls); }
.station.complete .lamp { border-color: var(--fahrt); }
.station.complete .lamp::after { background: var(--fahrt); box-shadow: 0 0 9px rgba(64, 209, 142, .8); }
.station.complete .station-state { color: var(--fahrt); }
.station.paused .lamp { border-color: var(--warte); box-shadow: 0 0 14px rgba(239, 182, 61, .35); }
.station.paused .lamp::after { animation: holdBlink 1.6s steps(1) infinite; background: var(--warte); box-shadow: 0 0 10px var(--warte); }
.station.paused .station-state { color: var(--warte); }
.station.failed .lamp, .station.rejected .lamp { border-color: var(--halt); box-shadow: 0 0 16px rgba(242, 92, 80, .4); }
.station.failed .lamp::after, .station.rejected .lamp::after { background: var(--halt); box-shadow: 0 0 10px var(--halt); }
.station.failed .station-state, .station.rejected .station-state { color: var(--halt); }
.station.failed::after, .station.rejected::after { background: linear-gradient(90deg, var(--puls), var(--halt)); box-shadow: 0 0 10px rgba(242, 92, 80, .5); }
.station.is-gate .lamp { border-radius: 7px; }
.station.is-gate .lamp::after { border-radius: 2px; }
@keyframes lampPulse { 50% { opacity: .45; } }
@keyframes holdBlink { 50% { opacity: .25; } }

.station-net {
  align-items: center;
  color: var(--nebel-2);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 8.5px;
  gap: 5px;
  justify-content: center;
  letter-spacing: .08em;
  margin-top: 6px;
  text-transform: uppercase;
}
.station-net i { background: var(--nebel-2); border-radius: 50%; height: 5px; width: 5px; }
.station-net[data-level="ok"] i { background: var(--fahrt); box-shadow: 0 0 5px rgba(64, 209, 142, .8); }
.station-net[data-level="partial"] i, .station-net[data-level="maint"] i { background: var(--warte); box-shadow: 0 0 5px rgba(239, 182, 61, .8); }
.station-net[data-level="full"] i { background: var(--halt); box-shadow: 0 0 5px rgba(242, 92, 80, .8); }
.station-net .net-value { color: var(--nebel); }

.board-legend { border-top: 1px solid var(--kante); color: var(--nebel); display: flex; font-size: 10px; gap: 18px; letter-spacing: .05em; margin-top: 18px; padding: 11px 26px; }
.board-legend > span { align-items: center; display: flex; gap: 6px; }
.legend-lamp { border-radius: 50%; height: 7px; width: 7px; }
.legend-lamp.complete { background: var(--fahrt); }
.legend-lamp.active { background: var(--puls); }
.legend-lamp.paused { background: var(--warte); }
.legend-lamp.failed { background: var(--halt); }

/* ---------------------------------------------------------------- band */
.band { align-items: start; display: grid; gap: 16px; grid-template-columns: minmax(0, 1.55fr) minmax(300px, .85fr); }
.band-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.text-button { align-items: center; background: none; border: 0; color: var(--puls); cursor: pointer; display: flex; font-size: 11px; font-weight: 600; gap: 4px; letter-spacing: .04em; }
.text-button svg { height: 14px; transition: transform .2s; width: 14px; }
.text-button[aria-expanded="true"] svg { transform: rotate(90deg); }
.trace-empty { align-items: center; color: var(--nebel-2); display: flex; gap: 11px; justify-content: center; min-height: 84px; padding: 0 18px; }
.trace-empty p { font-size: 12px; margin: 0; }
.trace-pulse { animation: lampPulse 2.2s ease-in-out infinite; background: var(--puls); border-radius: 50%; box-shadow: 0 0 8px rgba(98, 198, 232, .6); height: 7px; width: 7px; }
.trace-list { display: grid; list-style: none; margin: 0; padding: 8px 18px 12px; }
.trace-item {
  align-items: baseline;
  animation: traceIn .3s ease;
  border-bottom: 1px solid var(--kante);
  display: grid;
  font-family: var(--mono);
  gap: 12px;
  grid-template-columns: 9px minmax(120px, .7fr) minmax(160px, 1.3fr) auto;
  padding: 8px 2px;
}
.trace-item:last-child { border: 0; }
.trace-item > i { align-self: center; background: var(--nebel-2); border-radius: 50%; height: 7px; width: 7px; }
.trace-item.complete > i { background: var(--fahrt); box-shadow: 0 0 6px rgba(64, 209, 142, .7); }
.trace-item.failed > i, .trace-item.rejected > i { background: var(--halt); box-shadow: 0 0 6px rgba(242, 92, 80, .7); }
.trace-item.paused > i, .trace-item.active > i { background: var(--warte); box-shadow: 0 0 6px rgba(239, 182, 61, .7); }
.trace-name { color: var(--papier); font-size: 11px; font-weight: 500; }
.trace-description { color: var(--nebel); font-family: var(--body); font-size: 11.5px; }
.trace-duration { color: var(--nebel-2); font-size: 10px; }
@keyframes traceIn { from { opacity: 0; transform: translateY(4px); } }
.evidence-drawer { border-top: 1px solid var(--kante); display: grid; gap: 15px; grid-template-columns: minmax(150px, .35fr) minmax(0, 1fr); padding: 15px 18px 18px; }
.evidence-heading strong, .evidence-heading span { display: block; }
.evidence-heading strong { font-size: 12.5px; }
.evidence-heading span { color: var(--nebel); font-size: 11px; margin-top: 4px; }
.evidence-drawer pre { background: var(--nacht); border: 1px solid var(--kante); border-radius: 9px; color: #bfe8d6; font: 10px/1.6 var(--mono); margin: 0; max-height: 220px; overflow: auto; padding: 13px; }

.context-grid { display: grid; gap: 16px; grid-template-columns: 1fr 1.1fr; }
.patient-identity { align-items: center; display: flex; gap: 12px; padding: 14px 16px 10px; }
.avatar { align-items: center; background: var(--pult-3); border: 1px solid var(--kante-2); border-radius: 10px; color: var(--papier); display: flex; font-family: var(--display); font-size: 13px; font-weight: 600; height: 40px; justify-content: center; width: 40px; }
.patient-identity strong, .patient-identity span { display: block; }
.patient-identity strong { font-size: 13.5px; }
.patient-identity span { color: var(--nebel); font-family: var(--mono); font-size: 10px; margin-top: 2px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0; padding: 0 16px 15px; }
.detail-grid > div { border-top: 1px solid var(--kante); padding: 9px 6px 3px 0; }
.detail-grid > div:nth-child(even) { padding-left: 12px; }
.detail-grid dt { color: var(--nebel-2); font-size: 10px; letter-spacing: .03em; }
.detail-grid dd { font-family: var(--mono); font-size: 11.5px; font-weight: 500; margin: 3px 0 0; }
.artifact-empty { align-items: center; color: var(--nebel-2); display: flex; flex-direction: column; justify-content: center; min-height: 118px; padding: 18px; text-align: center; }
.artifact-empty svg { height: 26px; opacity: .7; width: 26px; }
.artifact-empty p { font-size: 11.5px; margin: 8px 0 0; }
.artifact-preview { display: grid; grid-template-columns: 1fr 1fr; min-height: 118px; padding: 10px 16px 13px; }
.artifact-preview > div { border-bottom: 1px solid var(--kante); padding: 8px 6px 8px 0; }
.artifact-preview > div:last-child { border-bottom: 0; grid-column: 1 / -1; }
.artifact-preview span, .artifact-preview strong { display: block; }
.artifact-preview span { color: var(--nebel-2); font-size: 10px; }
.artifact-preview strong { font-size: 12px; font-weight: 500; margin-top: 3px; }
.artifact-preview > div:last-child strong { font-family: var(--mono); font-size: 11px; }

.sandbox-note { align-items: center; color: var(--nebel-2); display: flex; gap: 9px; padding: 0 4px; }
.sandbox-note svg { color: var(--warte); flex: 0 0 auto; height: 15px; width: 15px; }
.sandbox-note p { font-size: 11px; margin: 0; }
.sandbox-note strong { color: var(--nebel); font-weight: 600; }

/* ---------------------------------------------------------------- TI-Lage */
.tilage { display: flex; flex-direction: column; }
.tilage-tools { align-items: center; display: flex; gap: 8px; }
.icon-button { height: 28px; width: 28px; }
.icon-button svg { height: 14px; width: 14px; }
.chip.source { align-items: center; display: inline-flex; gap: 6px; }
.chip.source::before { background: var(--nebel-2); border-radius: 50%; content: ""; height: 6px; width: 6px; }
.chip.source.live { background: var(--fahrt-dim); color: var(--fahrt); }
.chip.source.live::before { animation: lampPulse 2s ease-in-out infinite; background: var(--fahrt); box-shadow: 0 0 6px rgba(64, 209, 142, .8); }
.chip.source.sample { background: var(--warte-dim); color: var(--warte); }
.chip.source.sample::before { background: var(--warte); }
.tilage-summary { border-bottom: 1px solid var(--kante); color: var(--nebel); font-size: 12px; margin: 0; padding: 11px 18px; }
.tilage-summary.trouble { color: var(--warte); }
.tilage-list { display: grid; list-style: none; margin: 0; padding: 4px 18px 6px; }
.tilage-row { align-items: center; border-bottom: 1px solid var(--kante); display: grid; gap: 12px; grid-template-columns: minmax(86px, auto) 1fr auto; padding: 9px 0; }
.tilage-row:last-child { border-bottom: 0; }
.tilage-name strong { display: block; font-family: var(--display); font-size: 13.5px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.tilage-name small { color: var(--nebel-2); display: block; font-size: 9.5px; line-height: 1.3; margin-top: 1px; }
.tilage-ticks { align-items: flex-end; display: flex; gap: 2px; height: 14px; justify-content: flex-end; overflow: hidden; }
.tick { background: var(--pult-3); border-radius: 1px; flex: 0 0 auto; height: 100%; width: 3px; }
.tick.ok { background: var(--fahrt); opacity: .75; }
.tick.partial, .tick.maint { background: var(--warte); }
.tick.full { background: var(--halt); }
.tilage-state { align-items: center; display: inline-flex; font-size: 10px; font-weight: 600; gap: 6px; justify-self: end; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.tilage-state i { background: var(--nebel-2); border-radius: 50%; height: 7px; width: 7px; }
.tilage-state.ok { color: var(--fahrt); }
.tilage-state.ok i { background: var(--fahrt); box-shadow: 0 0 6px rgba(64, 209, 142, .7); }
.tilage-state.partial, .tilage-state.maint { color: var(--warte); }
.tilage-state.partial i, .tilage-state.maint i { background: var(--warte); box-shadow: 0 0 6px rgba(239, 182, 61, .7); }
.tilage-state.full { color: var(--halt); }
.tilage-state.full i { animation: lampPulse 1.2s ease-in-out infinite; background: var(--halt); box-shadow: 0 0 6px rgba(242, 92, 80, .8); }
.tilage-state.unknown { color: var(--nebel-2); }
.tilage-causes { border-top: 1px solid var(--kante); padding: 11px 18px; }
.tilage-causes strong { font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.tilage-causes ul { color: var(--nebel); font-family: var(--mono); font-size: 10.5px; line-height: 1.6; list-style: none; margin: 6px 0 0; padding: 0; }
.tilage-causes li::before { color: var(--halt); content: "▪ "; }
.tilage-footer { align-items: center; border-top: 1px solid var(--kante); color: var(--nebel-2); display: flex; font-size: 10.5px; gap: 10px; justify-content: space-between; margin-top: auto; padding: 11px 18px; }
.tilage-updated { font-family: var(--mono); }
.tilage-links { display: flex; gap: 12px; }
.tilage-links a { color: var(--nebel); text-decoration: none; }
.tilage-links a:hover { color: var(--puls); }

/* ---------------------------------------------------------------- actions */
.action-bar {
  align-items: center;
  background: rgba(12, 18, 29, .92);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--kante);
  bottom: 0;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin: 2px -22px 0;
  padding: 12px 22px;
  position: sticky;
  z-index: 10;
}
.action-primary, .action-secondary { align-items: center; display: flex; gap: 8px; }
.button {
  align-items: center;
  background: var(--pult-2);
  border: 1px solid var(--kante-2);
  border-radius: 8px;
  color: var(--papier);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 600;
  gap: 7px;
  justify-content: center;
  letter-spacing: .02em;
  min-height: 38px;
  padding: 8px 14px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.button:hover:not(:disabled) { border-color: var(--nebel-2); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button svg { height: 16px; width: 16px; }
.button.primary { background: var(--fahrt); border-color: var(--fahrt); color: #07130d; }
.button.primary:hover:not(:disabled) { box-shadow: 0 0 18px rgba(64, 209, 142, .35); }
.button.approve { background: var(--fahrt); border-color: var(--fahrt); color: #07130d; }
.button.approve:hover:not(:disabled) { box-shadow: 0 0 18px rgba(64, 209, 142, .35); }
.button.secondary { background: var(--pult-2); }
.button.ghost { background: transparent; border-color: transparent; color: var(--nebel); }
.danger-text { color: var(--halt) !important; }
.failure-select-label { color: var(--nebel-2); font-size: 9.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
#failure-mode {
  appearance: none;
  background: var(--pult-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238e97a8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px;
  border: 1px solid var(--kante-2);
  border-radius: 8px;
  color: var(--papier);
  font-size: 11px;
  height: 38px;
  max-width: 180px;
  padding: 0 28px 0 10px;
}
.toast-region { bottom: 76px; display: grid; gap: 8px; position: fixed; right: 22px; z-index: 50; }
.toast { animation: toastIn .2s ease; background: var(--pult-3); border: 1px solid var(--kante-2); border-left: 3px solid var(--puls); border-radius: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); color: var(--papier); font-size: 12px; max-width: 330px; padding: 11px 14px; }
.toast.error { border-left-color: var(--halt); }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } }
.noscript { background: var(--halt-dim); color: var(--halt); margin: 0; padding: 14px; text-align: center; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1080px) {
  .band { grid-template-columns: 1fr; }
  .tilage { order: -1; }
  .board-header { padding: 18px 20px 4px; }
  .route { padding: 28px 16px 8px; }
  .board-legend { padding: 10px 20px; }
}
@media (max-width: 820px) {
  .topbar { padding: 0 14px; }
  .ecosystem-links { display: none; }
  .environment-badge span { display: none; }
  .environment-badge { padding: 7px; }
  .studio-shell { padding: 14px 14px 0; }
  .line-chip { flex: 0 0 auto; }
  .line-copy small { display: none; }
  .line-state { display: none; }
  .context-grid { grid-template-columns: 1fr; }
  .evidence-drawer { grid-template-columns: 1fr; }
  .action-bar { align-items: stretch; flex-direction: column; margin: 2px -14px 0; padding: 12px 14px; position: static; }
  .action-primary, .action-secondary { flex-wrap: wrap; }
  .toast-region { bottom: 16px; left: 14px; right: 14px; }
}
@media (max-width: 620px) {
  .brand-copy small { display: none; }
  .board h1 { font-size: 24px; }
  .board-header { align-items: flex-start; flex-direction: column; }
  .run-meta { align-items: flex-start; }
  /* vertical route */
  .route { display: block; padding: 20px 18px 6px; }
  .station { display: grid; gap: 0 14px; grid-template-columns: 28px minmax(0, 1fr); padding: 9px 0; text-align: left; }
  .station::before, .station::after { height: 100%; left: 13px; top: -50%; width: 2px; }
  .station::after { transform: scaleY(0); transform-origin: top; }
  .station.seg-lit::after { transform: scaleY(1); }
  .station .lamp { align-self: start; }
  .station-copy { grid-column: 2; margin-top: 0; }
  .station-id { display: inline; letter-spacing: .14em; margin-right: 7px; }
  .station-copy strong { display: inline; }
  .station-net { justify-content: flex-start; }
  .board-legend { flex-wrap: wrap; gap: 12px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid > div:nth-child(even) { padding-left: 0; }
  .artifact-preview { grid-template-columns: 1fr; }
  .artifact-preview > div { grid-column: 1 !important; }
  .trace-item { grid-template-columns: 9px minmax(0, 1fr) auto; }
  .trace-description { display: none; }
  .button { flex: 1; }
  .action-secondary #failure-mode { flex: 1; max-width: none; }
  .tilage-row { grid-template-columns: minmax(76px, auto) 1fr auto; }
  .tilage-ticks { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
