/* SCENARIUM Design – identische Tokens in Schritt 3 (Prüfauswertung) und auf der Startseite.
   Violett → Indigo → Cyan als Markenverlauf, Space Grotesk / Inter / JetBrains Mono, weiche Karten mit Radius. */
:root {
  --bg: #f5f6fb; --panel: #ffffff; --panel-2: #f3f4fa; --ink: #14162e; --ink-2: #3d4266; --muted: #62678a; --faint: #9398b6;
  --line: #e3e5f0; --line-2: #cfd2e4;
  --accent: #6d4aff; --accent-2: #5433e6; --accent-soft: #efeaff; --accent-ink: #ffffff; --cyan: #06b6d4;
  --grad: linear-gradient(120deg, #8b5cf6 0%, #6366f1 45%, #06b6d4 100%);
  --id-bg: #efeaff; --id-ink: #4c2fd9;
  --hero: #0d0f24; --hero-ink: #f1f2ff; --hero-muted: #a9aed3;
  --ok: #0f7b4b; --ok-soft: #e3f7ec; --warn: #9a6200; --warn-soft: #fff3dc; --bad: #c0263d; --bad-soft: #fde8ec;
  --const: #4f46e5; --decl: #b45309; --param: #0e8a6a;
  --radius: 16px; --radius-s: 10px;
  --shadow: 0 1px 2px rgba(20,22,46,.04), 0 10px 28px -14px rgba(20,22,46,.16);
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --display: "Space Grotesk", "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, "Cascadia Mono", monospace;
  --serif: var(--sans);

  /* Szene */
  --ground: #e7ebe3; --walk: #d6d9e4; --road: #474d63; --mark: #f6f7fb;
  --vut: #6d4aff; --tgt: #f97316; --vru: #db2777; --obst: #8a8fab;
  --scene-ink: #14162e; --tag-bg: #ffffff; --island: #bfd0b5;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0b18; --panel: #12142a; --panel-2: #181b36; --ink: #eceefe; --ink-2: #c0c4e6; --muted: #8f94bd; --faint: #676c95;
    --line: #252949; --line-2: #343960;
    --accent: #a18bff; --accent-2: #c4b5ff; --accent-soft: #251f4d; --accent-ink: #0d0f24;
    --id-bg: #251f4d; --id-ink: #c4b5ff;
    --hero: #070816; --hero-ink: #f1f2ff; --hero-muted: #a3a8cf;
    --ok: #4ade80; --ok-soft: #0f2e22; --warn: #fbbf24; --warn-soft: #33260c; --bad: #fb7185; --bad-soft: #3a1420;
    --const: #a5b4fc; --decl: #fbbf24; --param: #34d399;
    --shadow: 0 1px 0 rgba(255,255,255,.03), 0 12px 32px -16px rgba(0,0,0,.7);
    --ground: #151a30; --walk: #202645; --road: #2c3252; --mark: #d9dcec;
    --vut: #8b74ff; --tgt: #fb923c; --vru: #f472b6; --obst: #8f94bd;
    --scene-ink: #eceefe; --tag-bg: #181b36; --island: #1f3b35;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0b18; --panel: #12142a; --panel-2: #181b36; --ink: #eceefe; --ink-2: #c0c4e6; --muted: #8f94bd; --faint: #676c95;
  --line: #252949; --line-2: #343960;
  --accent: #a18bff; --accent-2: #c4b5ff; --accent-soft: #251f4d; --accent-ink: #0d0f24;
  --id-bg: #251f4d; --id-ink: #c4b5ff;
  --hero: #070816; --hero-ink: #f1f2ff; --hero-muted: #a3a8cf;
  --ok: #4ade80; --ok-soft: #0f2e22; --warn: #fbbf24; --warn-soft: #33260c; --bad: #fb7185; --bad-soft: #3a1420;
  --const: #a5b4fc; --decl: #fbbf24; --param: #34d399;
  --shadow: 0 1px 0 rgba(255,255,255,.03), 0 12px 32px -16px rgba(0,0,0,.7);
  --ground: #151a30; --walk: #202645; --road: #2c3252; --mark: #d9dcec;
  --vut: #8b74ff; --tgt: #fb923c; --vru: #f472b6; --obst: #8f94bd;
  --scene-ink: #eceefe; --tag-bg: #181b36; --island: #1f3b35;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 var(--sans);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
code, .mono { font-family: var(--mono); font-size: 12.5px; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; text-wrap: balance; }
a { color: var(--accent-2); }

/* ---------- Allgemein ---------- */
a.btn { text-decoration: none; }
.btn.disabled { opacity: .4; cursor: default; pointer-events: none; }

/* ---------- Übersicht ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(135px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 14px 16px; box-shadow: var(--shadow); }
.stat .v { font-size: 26px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 15px; color: var(--muted); font-weight: 600; }
.stat .k { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.search {
  flex: 1 1 280px; min-width: 0; height: 36px; padding: 0 12px; border-radius: 0; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--ink); font: inherit;
}
.search:focus, .btn:focus-visible, .seg:focus-visible, tr.row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.segs { display: inline-flex; border: 1px solid var(--line); border-radius: 0; overflow: hidden; }
.seg { border: 0; background: var(--panel); color: var(--ink); font: inherit; font-size: 12.5px; padding: 7px 12px; cursor: pointer; border-right: 1px solid var(--line); }
.seg:last-child { border-right: 0; }
.seg .n { color: var(--muted); font-variant-numeric: tabular-nums; margin-left: 2px; }
.seg.on { background: var(--accent); color: var(--accent-ink); }
.seg.on .n { color: inherit; opacity: .75; }
.list-wrap { border: 0; border-radius: 0; }
table.list th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
table.list th.sortable { cursor: pointer; user-select: none; }
table.list th.sortable:hover { color: var(--ink); }
table.list th .arr { margin-left: 5px; font-size: 10px; opacity: .45; }
table.list th.on { color: var(--accent); }
table.list th.on .arr { opacity: 1; }
table.list th.num, table.list td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
table.list tr.row { cursor: pointer; }
table.list tr.row:hover td { background: var(--accent-soft); }
table.list td { font-size: 13px; }
table.list a.sid { text-decoration: none; white-space: nowrap; }
table.list .tt { font-weight: 600; min-width: 220px; }
table.list .t-proc { min-width: 170px; }
table.list .t-req { min-width: 230px; }
table.list .t-req .chip { margin: 1px 0; }
.chip.more { cursor: help; color: var(--accent); }
.para { display: inline-flex; align-items: baseline; flex-wrap: wrap; gap: 4px; padding: 2px 8px; margin: 1px 0; border-radius: 0; background: var(--accent-soft); color: var(--accent); font-family: var(--mono); font-size: 12px; font-weight: 600; }
.para + .para { margin-top: 3px; }
.para-a { font-family: var(--sans); font-size: 11px; font-weight: 600; opacity: .8; }
.para-x { font-family: var(--sans); font-weight: 500; color: var(--muted); font-size: 11.5px; }
.para.alt { background: var(--warn-soft); color: var(--warn); font-family: var(--sans); }
td .para { display: flex; width: fit-content; }
.dom { display: inline-block; font-size: 11px; font-weight: 650; padding: 1px 6px; border-radius: 0; border: 1px solid var(--line); color: var(--muted); margin-right: 3px; }
.badge.c-track_test { background: var(--accent-soft); color: var(--accent); border: 0; }
.badge.c-public_road { background: var(--ok-soft); color: var(--ok); border: 0; }
.badge.c-agreed_test { background: var(--warn-soft); color: var(--warn); border: 0; }
td.empty { text-align: center; color: var(--muted); padding: 28px; }
.detail-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.detail-nav .grow, .grow { flex: 1; }

/* ---------- Schrittleiste + Kopfbereich (identisch mit Schritt 3) ---------- */
.pnav { position: sticky; top: 0; z-index: 40; background: rgba(9,10,24,.88); backdrop-filter: saturate(160%) blur(12px); -webkit-backdrop-filter: saturate(160%) blur(12px); color: #dfe2f7; }
.pnav-in { max-width: none; margin: 0; padding: 0 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; min-height: 54px; }
.pnav-brand { display: inline-flex; align-items: center; gap: 10px; padding: 8px 18px 8px 0; margin-right: 8px; border-right: 1px solid rgba(255,255,255,.1); color: #fff; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: .16em; }
.pnav-brand img, .pnav-brand svg { width: 28px; height: 28px; display: block; }
.pnav-brand span { background: linear-gradient(90deg, #fff 30%, #c4b5ff 70%, #67e8f9); -webkit-background-clip: text; background-clip: text; color: transparent; }
.pnav a:not(.pnav-brand) { display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px 7px 8px; color: #aeb3d6; text-decoration: none; font-size: 13px; font-weight: 600; border-radius: 999px; transition: background .15s, color .15s; }
.pnav a:not(.pnav-brand):hover { color: #fff; background: rgba(255,255,255,.06); }
.pnav a b { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid rgba(255,255,255,.25); font-size: 11px; font-family: var(--display); }
.pnav a.on { color: #fff; background: rgba(139,92,246,.2); box-shadow: inset 0 0 0 1px rgba(167,139,250,.35); }
.pnav a.on b { background: var(--grad); border-color: transparent; color: #fff; }
.pnav a em { font-style: normal; font-size: 11px; font-weight: 600; color: #8b90b8; font-family: var(--mono); }
.pnav a em:empty { display: none; }
.brandline { height: 2px; background: var(--grad); }
.phero { position: relative; overflow: hidden; color: var(--hero-ink);
  background: radial-gradient(760px 320px at 88% -20%, rgba(6,182,212,.30), transparent 62%), radial-gradient(720px 360px at 6% 130%, rgba(139,92,246,.42), transparent 62%), var(--hero); }
.phero::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 44px 44px; -webkit-mask-image: linear-gradient(100deg, transparent 35%, #000 95%); mask-image: linear-gradient(100deg, transparent 35%, #000 95%); }
.hero-in { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 30px 20px 34px; display: flex; flex-wrap: wrap; gap: 20px 40px; align-items: flex-end; justify-content: space-between; }
.phero .brand { display: flex; flex-direction: column; gap: 12px; max-width: 760px; min-width: 0; }
.logo-row { display: flex; align-items: center; gap: 12px; }
.logo-row svg, .logo-row img { flex: none; width: 40px; height: 40px; display: block; }
.eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--hero-muted); line-height: 1.6; }
.eyebrow b { color: var(--hero-ink); font-weight: 700; }
.phero h1 { font-family: var(--display); font-size: clamp(28px, 4vw, 42px); line-height: 1.06; letter-spacing: -.02em;
  background: linear-gradient(90deg, #ffffff 0%, #d9d0ff 55%, #7ee8f5 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.phero .sub-h { font-size: .46em; color: var(--hero-muted); font-weight: 500; letter-spacing: 0; margin-left: 6px; font-family: var(--sans); }
.phero .step-tag { display: inline-block; font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: #d9d0ff; margin-bottom: 8px; padding: 3px 10px; border-radius: 999px; background: rgba(139,92,246,.22); box-shadow: inset 0 0 0 1px rgba(167,139,250,.35); }
.lede { margin: 12px 0 0; color: var(--hero-muted); max-width: 72ch; font-size: 15px; line-height: 1.7; }
.lede b { color: var(--hero-ink); }
.lede a { color: #7ee8f5; }
.phero .para { background: rgba(255,255,255,.08); color: var(--hero-ink); }
.phero .para-x { color: var(--hero-muted); }
.hero-side { flex: 0 1 440px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.phero .ctxbar { display: flex; flex-wrap: wrap; gap: 6px; }
.phero .ctx { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; border: 1px solid rgba(255,255,255,.12); color: var(--hero-muted); font-size: 12px; background: rgba(255,255,255,.04); }
.phero .ctx .dot { width: 7px; height: 7px; border-radius: 50%; background: #4b5078; }
.phero .ctx.on { color: var(--hero-ink); }
.phero .ctx.on .dot { background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.18); }
.specbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 12.5px; color: var(--hero-muted); }
.specbar label, .specbar .linkbtn { cursor: pointer; color: #7ee8f5; text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.specbar .linkbtn { background: none; border: 0; padding: 0; font: inherit; }
.specbar input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.phero.compact .hero-in { padding: 18px 20px 20px; align-items: center; }
.phero.compact .logo-row { display: none; }
.phero.compact .brand { flex-direction: row; align-items: center; gap: 18px; flex-wrap: wrap; }
.phero.compact h1 { font-size: 24px; }
.phero.compact .step-tag { margin-bottom: 4px; }
.phero.compact .hero-side { flex-basis: auto; }
.phero.compact .ctxbar { display: none; }
@media (max-width: 760px) { .pnav-brand { border-right: 0; } }
/* Demo-Hinweis */
.demobar { background: linear-gradient(90deg, rgba(251,191,36,.16), rgba(251,191,36,.06)); border-bottom: 1px solid rgba(251,191,36,.35); color: var(--ink); }
.demobar .demo-in { max-width: 1320px; margin: 0 auto; padding: 8px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13px; }
.demobar .demo-tag { font-family: var(--display); font-weight: 700; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; padding: 3px 10px; border-radius: 999px; background: #fbbf24; color: #1c1300; }
.demobar .demo-t { flex: 1 1 320px; color: var(--ink-2); }
.demobar .demo-btn { font: inherit; font-size: 12.5px; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; }
.demobar .demo-btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.danger { border-color: var(--bad); color: var(--bad); }
.btn.danger:hover { background: var(--bad-soft); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
a.mini { font-size: 12px; text-decoration: none; }
.var-card .h { align-items: center; }

/* ---------- Formular Parametrieren ---------- */
.form-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.form-side { position: sticky; top: 16px; }
@media (max-width: 1080px) { .form-grid { grid-template-columns: minmax(0, 1fr); } .form-side { position: static; } }
.form-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px 16px; }
.fr { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 10px; }
.inp { font: inherit; font-size: 13.5px; font-weight: 400; color: var(--ink); background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 7px 10px; min-width: 0; }
.inp:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
select.inp { padding-right: 6px; }
textarea.inp { resize: vertical; }
.num-wrap { display: inline-flex; align-items: center; gap: 6px; }
.num-in { width: 130px; text-align: right; }
.num-wrap .u { color: var(--muted); font-size: 12px; }
table.ftbl td { vertical-align: middle; }
.save-card { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }

/* ---------- Testspezifikation & Freigabe ---------- */
.spec-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.approval-col { position: sticky; top: 16px; }
@media (max-width: 1080px) { .spec-grid { grid-template-columns: minmax(0, 1fr); } .approval-col { position: static; } }
.spec { padding: 0 0 8px; }
.spec-head { padding: 18px 22px; border-bottom: 1px solid var(--line); }
.spec-org { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.spec-head h1 { font-size: 21px; margin: 6px 0 2px; }
.spec-head .desc { color: var(--muted); margin: 4px 0 0; }
.spec-sec { padding: 16px 22px 6px; }
.spec-sec + .spec-sec { border-top: 1px solid var(--line); }
.spec-sec h2 { font-size: 14.5px; margin-bottom: 10px; }
.spec-sec ol.plain, .spec-sec ul.plain { padding-left: 20px; }
.spec-sec li { margin: 3px 0; }
table.hist td { padding: 4px 10px 4px 0; border: 0; font-size: 12.5px; }
.approval .card-h { align-items: center; }
.checks { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 14px; }
.chk { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; cursor: pointer; }
.chk input { margin-top: 3px; accent-color: var(--accent); }
.warnbox { background: var(--warn-soft); color: var(--warn); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); padding: 8px 10px; border-radius: 0; font-size: 12.5px; margin: 8px 0; }
.hist-list { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12.5px; }
.hist-list li { padding: 6px 0; border-bottom: 1px solid var(--line); }
.hist-list li:last-child { border-bottom: 0; }
.ap { display: inline-block; padding: 1px 9px; border-radius: 0; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
.ap-draft { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.ap-submitted { background: var(--accent-soft); color: var(--accent); }
.ap-accepted { background: var(--ok-soft); color: var(--ok); }
.ap-rejected { background: var(--bad-soft); color: var(--bad); }

@media print {
  :root { --bg: #fff; --panel: #fff; --panel-2: #f6f7f9; }
  .pnav, .brandline, .phero, .no-print, #dragOverlay, .toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .card { box-shadow: none; border: 0; }
  .spec-grid { display: block; }
  .spec-sec { break-inside: avoid; }
  svg.scene { max-height: 320px; }
}
.btn {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
  border-radius: 0; border: 1px solid var(--line); background: var(--panel); color: var(--ink);
  font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--faint); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); }
select.btn { padding-right: 8px; max-width: 360px; }


main { max-width: 1320px; margin: 0 auto; padding: 20px 20px 60px; }

/* ---------- Dropzone ---------- */
.dropzone {
  margin: 48px auto; max-width: 720px; padding: 48px 32px; text-align: center;
  border: 2px dashed var(--line); border-radius: 0; background: var(--panel);
}
.dropzone h1 { font-size: 22px; margin-bottom: 8px; }
.dropzone p { color: var(--muted); margin: 6px 0; }
.dropzone .hint { font-size: 12.5px; color: var(--faint); margin-top: 18px; }
.drop-icon { width: 56px; height: 56px; margin: 0 auto 14px; color: var(--accent); }
#dragOverlay {
  position: fixed; inset: 0; z-index: 50; display: none; place-items: center;
  background: color-mix(in srgb, var(--accent) 14%, transparent); backdrop-filter: blur(2px);
  font-size: 22px; font-weight: 650; color: var(--accent); border: 3px dashed var(--accent);
}
body.dragging #dragOverlay { display: grid; }

/* ---------- Cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 0; box-shadow: var(--shadow); }
.card + .card, .section + .section { margin-top: 16px; }
.card-h { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 14px 18px 0; }
.card-h .sub { min-width: 0; }
.card-h h2 { font-size: 15px; font-weight: 650; }
.card-b { padding: 12px 18px 16px; }
.sub { color: var(--muted); font-size: 12.5px; }

/* ---------- Header of scenario ---------- */
.hero { padding: 18px 20px; }
.hero-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.sid { font-family: var(--mono); font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 0; font-size: 13px; }
.hero h1 { font-size: 22px; font-weight: 680; }
.hero .en { color: var(--muted); font-size: 13px; margin-top: 2px; }
.hero .desc { margin-top: 10px; max-width: 110ch; color: var(--ink); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px 20px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.fact .k { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; }
.fact .v { margin-top: 3px; display: flex; flex-wrap: wrap; gap: 4px; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border-radius: 0;
  border: 1px solid var(--line); background: var(--panel-2); font-size: 12px; white-space: nowrap;
}
.chip.ref { font-family: var(--mono); font-size: 11.5px; cursor: help; }
.badge { padding: 1px 8px; border-radius: 0; font-size: 11.5px; font-weight: 600; }
.badge.draft { background: var(--warn-soft); color: var(--warn); }
.badge.review { background: var(--accent-soft); color: var(--accent); }
.badge.released { background: var(--ok-soft); color: var(--ok); }
.badge.obsolete { background: var(--bad-soft); color: var(--bad); }
.badge.cat { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }

/* ---------- Scene ---------- */
.scene-wrap { padding: 0 18px 16px; }
.tests { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 18px; }
.tab {
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); border-radius: 0;
  padding: 5px 12px; font: inherit; font-size: 12.5px; cursor: pointer; display: inline-flex; gap: 6px; align-items: center;
}
.tab .t-id { font-family: var(--mono); font-weight: 600; }
.tab.base .t-id { color: var(--accent); }
.tab.ext .t-id { color: var(--param); }
.tab.run .t-id { color: var(--decl); }
.tab[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tab[aria-pressed="true"] .t-id { color: var(--accent-ink); }
.test-info { margin: 0 18px 12px; padding: 10px 12px; border-radius: 0; background: var(--panel-2); border: 1px solid var(--line); font-size: 13px; }
.test-info b { font-weight: 650; }

svg.scene { width: 100%; height: auto; display: block; border-radius: 0; border: 1px solid var(--line); }
.scene .ground { fill: var(--ground); }
.scene .walk { fill: var(--walk); }
.scene .road { fill: var(--road); }
.scene .island { fill: var(--island); }
.scene .mark { stroke: var(--mark); stroke-width: 2.5; fill: none; }
.scene .mark.dash { stroke-dasharray: 18 14; }
.scene .mark.thin { stroke-width: 1.6; }
.scene .zebra { fill: var(--mark); opacity: .9; }
.scene .lane-arrow { fill: var(--mark); opacity: .35; }
.scene .veh { stroke: rgba(0,0,0,.35); stroke-width: 1; }
.scene .veh.vut { fill: var(--vut); }
.scene .veh.tgt { fill: var(--tgt); }
.scene .veh.obst { fill: var(--obst); }
.scene .veh.emerg { fill: #d8d8d8; }
.scene .glass { fill: rgba(255,255,255,.55); }
.scene .brake { fill: #ff2b2b; }
.scene .ghost { opacity: .42; }
.scene .ghost .veh { stroke-dasharray: 4 3; stroke: var(--scene-ink); }
.scene .vru-body { fill: var(--vru); stroke: rgba(0,0,0,.3); }
.scene .vru-line { stroke: var(--vru); stroke-width: 3; stroke-linecap: round; fill: none; }
.scene .obstacle { fill: url(#hatch); stroke: var(--obst); stroke-width: 1.5; }
.scene .hatch-bg { fill: var(--walk); }
.scene .hatch-ln { stroke: var(--obst); stroke-width: 2; }
.scene .vl rect { fill: var(--tag-bg); stroke: var(--line); opacity: .94; }
.scene .vl text { fill: var(--scene-ink); font-size: 11.5px; font-weight: 600; }
.scene .vlabel { fill: var(--scene-ink); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--ground); stroke-width: 3px; }
.scene .vlabel.on-road { fill: #fff; stroke: var(--road); }
.scene .traj { fill: none; stroke-width: 2.5; stroke-dasharray: 7 5; }
.scene .t-vut { stroke: var(--vut); }
.scene .t-tgt { stroke: var(--tgt); }
.scene .t-vru { stroke: var(--vru); }
.scene .t-mut { stroke: var(--faint); }
.scene .t-bad { stroke: var(--bad); }
.scene .mk-vut { fill: var(--vut); }
.scene .mk-tgt { fill: var(--tgt); }
.scene .mk-vru { fill: var(--vru); }
.scene .mk-mut { fill: var(--faint); }
.scene .mk-bad { fill: var(--bad); }
.scene .tag rect { fill: var(--tag-bg); stroke: var(--line); }
.scene .tag text { fill: var(--scene-ink); font-size: 11.5px; }
.scene .tag.var rect { stroke: var(--param); stroke-width: 1.6; }
.scene .tag.var text { fill: var(--param); font-weight: 600; }
.scene .tag.accent rect { fill: var(--accent-soft); stroke: var(--accent); }
.scene .tag.accent text { fill: var(--accent); font-weight: 600; }
.scene .tag.bad rect { fill: var(--bad-soft); stroke: var(--bad); }
.scene .tag.bad text { fill: var(--bad); font-weight: 600; }
.scene .note { fill: var(--scene-ink); font-size: 13px; font-weight: 600; }
.scene .note-sub { fill: var(--muted); font-size: 11.5px; }
.scene .dim { stroke: var(--scene-ink); stroke-width: 1.2; fill: none; }
.scene .dim-tx { fill: var(--scene-ink); font-size: 11.5px; font-weight: 600; paint-order: stroke; stroke: var(--ground); stroke-width: 3px; }
.scene .xmark { stroke: var(--bad); stroke-width: 4; stroke-linecap: round; }
.scene .conflict { fill: var(--bad); }
.scene .conflict-tx { fill: #fff; font-weight: 800; font-size: 15px; }
.scene .sign-ring { fill: #fff; stroke: #d0312d; stroke-width: 4; }
.scene .sign-tx { fill: #111; font-weight: 800; font-size: 13px; }
.scene .sign-stop { fill: #d0312d; stroke: #fff; stroke-width: 2; }
.scene .sign-yield { fill: #fff; stroke: #d0312d; stroke-width: 4; }
.scene .sign-pole { stroke: var(--faint); stroke-width: 2; }
.scene .tl-box { fill: #222; }
.scene .tl-red { fill: #e53935; } .scene .tl-amb { fill: #555; } .scene .tl-grn { fill: #555; }
.scene .cone { fill: #f08a24; stroke: #fff; stroke-width: 1; }
.scene .tl-lane { fill: var(--panel-2); stroke: var(--line); }
.scene .tl-seg { fill: var(--accent-soft); stroke: var(--accent); }
.scene .tl-seg.off { fill: var(--bad-soft); stroke: var(--bad); }
.scene .tl-seg.on { fill: var(--ok-soft); stroke: var(--ok); }
.scene .tl-seg.warn { fill: var(--warn-soft); stroke: var(--warn); }
.scene .tl-seg.mute { fill: var(--panel); stroke: var(--line); }
.scene .tl-segtx { fill: var(--scene-ink); font-size: 11.5px; font-weight: 600; }
.scene .tl-row { fill: var(--scene-ink); font-size: 12px; font-weight: 600; }
.scene .tl-axis { stroke: var(--muted); stroke-width: 1.2; }
.scene .tl-tick { fill: var(--muted); font-size: 11px; }
.scene .tl-ev { stroke-width: 1.6; stroke-dasharray: 4 3; }
.scene .tl-ev.warn { stroke: var(--warn); } .scene .tl-ev.bad { stroke: var(--bad); } .scene .tl-ev.acc { stroke: var(--accent); } .scene .tl-ev.ok { stroke: var(--ok); }
.scene .tl-evtx { font-size: 11.5px; font-weight: 650; }
.scene .tl-evtx.warn { fill: var(--warn); } .scene .tl-evtx.bad { fill: var(--bad); } .scene .tl-evtx.acc { fill: var(--accent); } .scene .tl-evtx.ok { fill: var(--ok); }
.scene .box { fill: var(--panel); stroke: var(--line); stroke-width: 1.5; }
.scene .box.acc { fill: var(--accent-soft); stroke: var(--accent); }
.scene .box.ok { fill: var(--ok-soft); stroke: var(--ok); }
.scene .box.warn { fill: var(--warn-soft); stroke: var(--warn); }
.scene .box.bad { fill: var(--bad-soft); stroke: var(--bad); }
.scene .box-tx { fill: var(--scene-ink); font-size: 13px; font-weight: 650; }
.scene .box-sub { fill: var(--muted); font-size: 11.5px; }
.scene .edge { stroke: var(--muted); stroke-width: 1.6; fill: none; }
.scene .plot-line { stroke: var(--accent); stroke-width: 3; fill: none; }
.scene .plot-area { fill: var(--accent-soft); }
.scene .grid { stroke: var(--line); stroke-width: 1; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 14px; height: 9px; border-radius: 0; display: inline-block; }

/* ---------- Layout grid ---------- */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.grid-2 > * { margin-top: 0 !important; }
@media (max-width: 980px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.var-card, .req-row > div, .kv > div { overflow-wrap: anywhere; }
td { overflow-wrap: break-word; }

/* ---------- Tables ---------- */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .4px; background: var(--panel-2); }
tr:last-child td { border-bottom: none; }
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 0; }
td .pname { font-family: var(--mono); font-weight: 600; }
td .pdesc { color: var(--muted); font-size: 12px; margin-top: 2px; }
tr.hl td { background: color-mix(in srgb, var(--param) 9%, transparent); }
tr.hl-base td { background: color-mix(in srgb, var(--accent) 8%, transparent); }
tr.dim td { opacity: .45; }

.range { position: relative; height: 6px; border-radius: 0; background: var(--line); margin: 8px 0 4px; min-width: 120px; }
.range > i { position: absolute; top: 0; bottom: 0; border-radius: 0; background: var(--accent); }
.range-lbl { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--muted); }
.vals { display: flex; flex-wrap: wrap; gap: 4px; }
.vals .chip.sel { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

.expr { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.tok { padding: 0 6px; border-radius: 0; font-family: var(--mono); font-size: 11.5px; cursor: help; border: 1px solid transparent; }
.tok.const { color: var(--const); background: color-mix(in srgb, var(--const) 10%, transparent); }
.tok.decl { color: var(--decl); background: color-mix(in srgb, var(--decl) 12%, transparent); }
.tok.param { color: var(--param); background: color-mix(in srgb, var(--param) 12%, transparent); }
.resolved { font-weight: 650; color: var(--ink); }
.unres { color: var(--faint); font-style: italic; font-size: 12px; }

.formula { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; }
.fn { color: var(--muted); font-family: var(--mono); font-size: 12px; }
.sig { font-family: var(--mono); font-size: 12px; font-weight: 600; padding: 0 6px; border-radius: 0; background: var(--panel-2); border: 1px solid var(--line); cursor: help; }
.op { font-weight: 700; color: var(--accent); }
.kind { display: inline-block; font-size: 11px; font-weight: 650; padding: 1px 7px; border-radius: 0; }
.kind.measured { background: var(--accent-soft); color: var(--accent); }
.kind.assessment { background: var(--warn-soft); color: var(--warn); }
.when { margin-top: 4px; font-size: 12px; color: var(--muted); }
.when b { color: var(--ink); font-weight: 600; }

/* ---------- Lists ---------- */
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 13px; }
.kv .k { color: var(--muted); }
ul.plain { margin: 0; padding-left: 18px; }
ul.plain li + li { margin-top: 3px; }
.actor { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.actor:last-child { border-bottom: none; }
.actor .ic { width: 28px; height: 28px; border-radius: 0; display: grid; place-items: center; flex: none; color: #fff; font-size: 11px; font-weight: 700; }
.var-card { border: 1px solid var(--line); border-radius: 0; padding: 10px 12px; background: var(--panel-2); cursor: pointer; }
.var-card:hover { border-color: var(--faint); }
.var-card + .var-card { margin-top: 8px; }
.var-card .h { display: flex; gap: 8px; align-items: baseline; }
.var-card .id { font-family: var(--mono); font-weight: 700; }
.var-card.base .id { color: var(--accent); }
.var-card.ext .id { color: var(--param); }
.var-card .it { color: var(--muted); font-size: 12px; }
.req-row { display: grid; grid-template-columns: minmax(96px, 190px) minmax(0, 1fr); gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.req-row:last-child { border-bottom: none; }
.req-row code { color: var(--accent); font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.st { font-weight: 650; }
.st.ok { color: var(--ok); } .st.bad { color: var(--bad); } .st.open { color: var(--warn); }
.verdict { padding: 1px 8px; border-radius: 0; font-size: 11.5px; font-weight: 650; }
.verdict.pass { background: var(--ok-soft); color: var(--ok); }
.verdict.fail { background: var(--bad-soft); color: var(--bad); }
.verdict.pending, .verdict.invalid { background: var(--warn-soft); color: var(--warn); }

pre.raw { margin: 0; max-height: 520px; overflow: auto; padding: 14px; background: var(--panel-2); border-radius: 0; border: 1px solid var(--line); font-size: 12px; line-height: 1.45; }
details > summary { cursor: pointer; font-weight: 600; padding: 12px 18px; list-style: none; }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: "▸ "; color: var(--muted); }
details[open] > summary::before { content: "▾ "; }
details .card-b { padding-top: 0; }

.toast {
  position: fixed; right: 20px; bottom: 20px; z-index: 60; max-width: 420px; padding: 12px 16px; border-radius: 0;
  background: var(--panel); border: 1px solid var(--line); box-shadow: 0 6px 24px rgba(0,0,0,.18); font-size: 13px;
}
.toast.err { border-color: var(--bad); }
.toast b { display: block; margin-bottom: 2px; }

@media (max-width: 640px) {
    main { padding: 16px 16px 48px; }
    .hero h1 { font-size: 19px; }
}
/* ================= SCENARIUM-Stil: weiche Karten, Verlaufsakzente, runde Bedienelemente ================= */
body { font-size: 14px; }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; }
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: clip; }
.card-h { padding: 18px 22px 0; }
.card-b { padding: 12px 22px 18px; }
.card-h h2, .spec-sec h2 { position: relative; padding-bottom: 9px; font-size: 17px; font-weight: 700; }
.card-h h2::after, .spec-sec h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 30px; height: 3px; border-radius: 3px; background: var(--grad); }
details > summary { font-weight: 700; font-family: var(--display); }
th { background: none; font-size: 11.5px; letter-spacing: .07em; border-bottom: 1px solid var(--line-2); }
.tbl-wrap { border: 0; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: var(--grad); }
.stat .v { font-family: var(--display); font-size: 30px; letter-spacing: -.02em; }
.sid { color: var(--id-ink); background: var(--id-bg); font-weight: 600; font-size: 12px; padding: 2px 8px; border-radius: 6px; }
a.sid:hover { filter: brightness(1.08); }
.btn { border: 1px solid var(--line-2); border-radius: var(--radius-s); font-weight: 600; font-size: 13px; height: 36px; transition: border-color .15s, background .15s, box-shadow .15s; }
.btn:hover { background: var(--panel-2); border-color: var(--accent); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px -8px rgba(109,74,255,.7); }
.btn.primary:hover { background: var(--grad); filter: brightness(1.08); }
.btn.sm { height: 30px; border-radius: 8px; }
.segs { border-radius: 999px; border-color: var(--line-2); padding: 2px; gap: 2px; background: var(--panel-2); }
.seg { font-weight: 600; border: 0; border-radius: 999px; background: none; }
.seg.on { background: var(--panel); color: var(--accent); box-shadow: 0 1px 3px rgba(20,22,46,.12), inset 0 0 0 1px var(--line-2); }
.seg.on .n { color: var(--accent); }
.search, .inp { border-color: var(--line-2); background: var(--panel); border-radius: var(--radius-s); }
.search:focus, .inp:focus { outline: 3px solid color-mix(in srgb, var(--accent) 25%, transparent); outline-offset: 0; border-color: var(--accent); }
.chip, .badge, .dom, .kind, .ap, .verdict, .tok, .sig, .para { border-radius: 999px; }
.para { border-radius: 8px; }
.tab { font-weight: 600; border-radius: 999px; }
.test-info { border: 0; border-left: 3px solid var(--accent); border-radius: 0 var(--radius-s) var(--radius-s) 0; }
.var-card { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: var(--radius-s); }
.var-card.base { border-left-color: var(--accent); }
.var-card.ext { border-left-color: var(--param); }
.var-card:hover { border-color: var(--accent); }
.warnbox, pre.raw, .range, .range > i, .sw { border-radius: 8px; }
.actor .ic { border-radius: 9px; }
table.list tr.row:hover td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.dropzone { border: 1.5px dashed var(--line-2); border-radius: 22px; box-shadow: var(--shadow); }
.dropzone h2 { font-size: 22px; margin-bottom: 8px; }
.spec-head { border-bottom: 0; background: var(--panel-2); position: relative; }
.spec-head::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 4px; background: var(--grad); }
.spec-org { color: var(--ink-2); }
.toast { background: #12142a; color: #eceefe; border: 1px solid #2a2e55; border-radius: 14px; box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); }
.toast::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--grad); }
.toast.err::before { background: #fb7185; }
.toast a { color: #7ee8f5; }
svg.scene { border: 0; border-radius: 12px; }
@media print {
  .spec-head { background: none; }
  .card { box-shadow: none; border: 0; }
  .card-h h2::after, .spec-sec h2::after, .spec-head::before { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .demobar { display: none !important; }
}
/* Copyright-Hinweis, klein und unauffällig */
.copy { text-align: center; font-size: 10.5px; color: var(--faint); opacity: .75; padding: 0 16px 18px; margin-top: -36px; }
@media print { .copy { display: none; } }
/* Animation konkreter Szenarien (animation.js): Button in der Szene, schlanke Abspielleiste */
.scene-box { position: relative; }
.anim-toggle { position: absolute; top: 10px; right: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px;
  font: 600 12px var(--sans); padding: 5px 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; }
.anim-toggle:hover { border-color: var(--accent); color: var(--accent); }
.anim-toggle:focus-visible, .anim-play:focus-visible, .anim-scrub:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.anim-bar { display: flex; align-items: center; gap: 10px; padding: 8px 0 0; }
.anim-play { width: 32px; height: 28px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink); cursor: pointer; font-size: 12px; }
.anim-scrub { flex: 1; min-width: 0; height: 6px; appearance: none; -webkit-appearance: none; cursor: pointer; background: linear-gradient(90deg, var(--marks)), var(--line); }
.anim-scrub::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }
.anim-scrub::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); border: 0; }
.anim-t { font: 600 12px var(--mono); font-variant-numeric: tabular-nums; color: var(--muted); min-width: 64px; text-align: right; }
.scene .anim-bad { fill: var(--bad); font-weight: 600; }
@media print { .anim-toggle, .anim-bar { display: none !important; } }

/* Freigabe: vereinbarte Grenzwerte */
.thr-agree { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.thr-agree .thr { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.thr-in { display: flex; align-items: center; gap: 6px; }
.thr-in .inp { width: 110px; }
.scn-nav .br { display: none; }
