:root {
  --bg: #f6f7f9; --surface: #ffffff; --ink: #1c2330; --muted: #5d6879; --line: #dfe3ea;
  --accent: #1f5fbf; --accent-ink: #ffffff; --ok: #1d7a46; --ok-bg: #e5f4ec;
  --warn: #8a5a00; --warn-bg: #fff3d6; --bad: #b3261e; --bad-bg: #fde8e6; --info-bg: #e8effb;
  --radius: 8px; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14181f; --surface: #1c222c; --ink: #e6e9ef; --muted: #9aa5b5; --line: #2f3846;
    --accent: #6ea2f0; --accent-ink: #0d1117; --ok: #5fcf8f; --ok-bg: #173226;
    --warn: #f0c05a; --warn-bg: #3a2e12; --bad: #ff8a80; --bad-bg: #3d1d1b; --info-bg: #1b2a44;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; } a:hover { text-decoration: underline; }
header.top { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.top-inner { max-width: 1280px; margin: 0 auto; padding: 6px 16px 0; display: flex; align-items: center; gap: 4px 20px; flex-wrap: wrap; }
.brand { font-weight: 700; letter-spacing: .01em; color: var(--ink); } .brand small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); }
/* zwei Zeilen: oben Projekt und Person, darunter die Hauptnavigation über die volle Breite */
.brand { order: 1; } .proj-switch { order: 2; }
nav { order: 4; flex: 1 0 100%; display: flex; gap: 1px; flex-wrap: wrap; margin: 2px -6px 0; padding: 4px 0 6px; border-top: 1px solid var(--line); }
nav a { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 6px; color: var(--muted); font-weight: 500; font-size: 13.5px; white-space: nowrap; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: .85; }
nav a.active .ico, nav a:hover .ico { opacity: 1; }
/* Verwaltung (Regeln, Audit, Einstellungen) steht oben rechts neben der Person */
nav.sec { order: 3; flex: 0 0 auto; margin: 0 0 0 auto; padding: 0; border: 0; }
nav a:hover { background: var(--bg); text-decoration: none; color: var(--ink); } nav a.active { background: var(--info-bg); color: var(--accent); }
.whoami { order: 3; margin-left: 8px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--muted); }
main { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
h1 { font-size: 22px; margin: 0 0 4px; } h2 { font-size: 17px; margin: 24px 0 8px; } h3 { font-size: 15px; margin: 16px 0 6px; }
.sub { color: var(--muted); margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.grid { display: grid; gap: 12px; } .g4 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); } .g2 { grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); }
.kpi .n { font-size: 28px; font-weight: 700; line-height: 1.1; } .kpi .l { color: var(--muted); font-size: 13px; }
.bar { height: 6px; background: var(--line); border-radius: 3px; margin-top: 8px; overflow: hidden; } .bar > i { display: block; height: 100%; background: var(--ok); }
table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); position: sticky; top: 0; }
tr:last-child td { border-bottom: 0; } td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: 13px; }
.badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; background: var(--bg); color: var(--muted); border: 1px solid var(--line); white-space: nowrap; }
.b-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; } .b-bad { background: var(--bad-bg); color: var(--bad); border-color: transparent; }
.b-warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; } .b-info { background: var(--info-bg); color: var(--accent); border-color: transparent; }
.flash { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 12px; border: 1px solid transparent; }
.flash.ok { background: var(--ok-bg); color: var(--ok); } .flash.error { background: var(--bad-bg); color: var(--bad); }
form.inline { display: inline; }
button, .btn { font: inherit; cursor: pointer; padding: 5px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
button:hover, .btn:hover { border-color: var(--accent); text-decoration: none; }
button.primary, .btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.danger { color: var(--bad); } button.small { padding: 2px 8px; font-size: 13px; }
input, select, textarea { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 6px; padding: 5px 8px; }
textarea { width: 100%; min-height: 70px; } input[type=text], input:not([type]) { min-width: 0; }
label { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 3px; }
.row { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; } .row > div { flex: 0 1 auto; } .row label { margin-top: 0; }
.filters { margin: 0 0 12px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 4px 12px; } .kv dt { color: var(--muted); } .kv dd { margin: 0; } .pre { white-space: pre-wrap; }
.tag-H { color: var(--bad); } .tag-M { color: var(--warn); } .tag-L { color: var(--muted); }
.suspect { background: var(--warn-bg); } .empty { color: var(--muted); padding: 18px; text-align: center; }
details > summary { cursor: pointer; color: var(--accent); }
.sil-col { background: var(--info-bg); font-weight: 700; }
.pager { display: flex; gap: 8px; align-items: center; margin-top: 10px; color: var(--muted); }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.split { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; } @media (max-width: 900px) { .split { grid-template-columns: 1fr; } }
.q-yes { color: var(--ok); } .q-no { color: var(--bad); }

/* Formulare: Hilfetexte, Checkboxen, Hinweise */
.fld { margin: 0 0 4px; } .fld label { margin-top: 12px; }
.fld input:not([type=checkbox]), .fld select, .fld textarea { max-width: 100%; }
.fld input:not([type=checkbox]):not([type=hidden]), .fld select { min-width: 280px; }
.help { color: var(--muted); font-size: 13px; margin: 3px 0 0; max-width: 70ch; }
label.check { display: flex; gap: 8px; align-items: center; color: var(--ink); font-size: 15px; margin-top: 14px; cursor: pointer; }
label.check input { width: 18px; height: 18px; }
.flash.warn { background: var(--warn-bg); color: var(--warn); } .flash ul { margin: 6px 0 0; padding-left: 20px; }
.hint-ok { color: var(--ok); } .hint-bad { color: var(--bad); }
abbr[data-gl] { text-decoration: underline dotted var(--muted); text-underline-offset: 3px; cursor: help; }
input[readonly] { background: var(--bg); color: var(--muted); }

/* Prozess-Board */
.vtree { display: grid; grid-template-columns: repeat(23, minmax(0, 1fr)); grid-template-rows: auto auto repeat(5, auto) auto; gap: 10px 0; }
.vtree > * { min-width: 0; }
.vcell { padding: 0 4px; display: flex; } .vcell > .pcard { flex: 1; }
.vhead { grid-row: 1; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.vhead-l { grid-column: 1 / 12; } .vhead-r { grid-column: 12 / -1; text-align: right; }
.vlink { align-self: center; position: relative; height: 0; margin: 0 -2px; border-top: 2px dashed var(--line); text-align: center; }
.vlink span { position: absolute; left: 50%; top: -9px; transform: translateX(-50%); background: var(--bg); padding: 0 6px; font: 600 11.5px var(--mono); color: var(--muted); white-space: nowrap; }
.vlink:hover { border-top-color: var(--accent); } .vlink:hover span { color: var(--accent); }
.vband { border: 1px dashed var(--line); border-radius: var(--radius); padding: 6px 8px 8px; }
.vband-label { font-size: 12px; color: var(--muted); margin: 0 0 6px 4px; }
.vband-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
@media (max-width: 900px) {
  .vtree { display: flex; flex-direction: column; gap: 8px; }
  .vtree > * { grid-row: auto !important; grid-column: auto !important; } .vcell { padding: 0; }
  .vlink, .vhead { display: none; } .vband-row { display: flex; flex-direction: column; gap: 8px; } .vband-row .vcell { padding: 0; }
}
.pcard { display: block; background: var(--surface); border: 1px solid var(--line); border-left: 6px solid var(--line); border-radius: var(--radius); padding: 10px 12px; color: var(--ink); }
.pcard:hover { text-decoration: none; border-color: var(--accent); }
.ph-code { display: inline-block; min-width: 2.4em; text-align: center; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; font: 600 12px var(--mono); padding: 0 4px; }
.ph-meta { color: var(--muted); font-size: 12.5px; margin: 2px 0 0; } .ph-foot { margin-top: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pcard.st-done { border-left-color: var(--ok); } .pcard.st-in_progress, .pcard.st-in_review, .pcard.st-reviewed { border-left-color: var(--warn); }
.pcard.st-redo { border-left-color: var(--bad); } .pcard.st-tailored { border-left-style: dashed; border-left-color: var(--muted); }
.badge.st-done { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.badge.st-in_progress, .badge.st-in_review, .badge.st-reviewed { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.st-redo { background: var(--bad-bg); color: var(--bad); border-color: transparent; } .badge.st-tailored { border-style: dashed; }
.pcard .bar { margin-top: 6px; }
.legend { align-self: stretch; }
.why { color: var(--warn); font-size: 13px; margin-top: 2px; }
.task { padding: 8px 0; border-bottom: 1px solid var(--line); } .task:last-child { border-bottom: 0; }
.btn.small { padding: 2px 8px; font-size: 13px; display: inline-block; }

/* Requirements/Tests: Chips, Matrix, Baum */
.chip { display: inline-block; min-width: 2.6em; text-align: center; padding: 0 5px; margin-right: 3px; border-radius: 4px; font: 600 11.5px var(--mono); border: 1px solid transparent; }
.c-pass { background: var(--ok-bg); color: var(--ok); } .c-fail { background: var(--bad-bg); color: var(--bad); }
.c-open { background: var(--warn-bg); color: var(--warn); } .c-none { background: var(--bg); color: var(--muted); border-color: var(--line); }
table.matrix { width: auto; } .matrix th, .matrix td { padding: 4px 8px; } .mcell { text-align: center; min-width: 3.2em; font-weight: 600; }
ul.tree { list-style: none; margin: 4px 0 4px 6px; padding-left: 16px; border-left: 1px solid var(--line); } ul.tree.root { border: 0; padding-left: 0; margin: 0; }
ul.tree li { margin: 3px 0; } ul.tree summary { cursor: pointer; }
tr.rowsel td { background: var(--info-bg); }
.help.mono, .sub.mono { font-family: var(--mono); }

/* Dokumente aus Vorlagen */
.sec-off { opacity: .6; } .docbody { margin-top: 6px; } .docbody table { margin: 6px 0; } .docbody td, .docbody th { padding: 4px 8px; }
button.small[data-autotext] { margin-top: 6px; }
.reportbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.reportpaper { background: #fff; color: #1a1f2b; border: 1px solid var(--line); border-radius: var(--radius); padding: 22px 26px; }
.reportpaper h1, .reportpaper h2, .reportpaper h3 { color: #1a1f2b; }
.reportpaper table { background: #fff; width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: 13px; border: 0; border-radius: 0; }
.reportpaper th, .reportpaper td { border: 1px solid #cfd4dc; padding: 5px 8px; vertical-align: top; text-align: left; position: static; } .reportpaper th { background: #eef1f5; color: #1a1f2b; }
.reportpaper .meta { color: #566073; font-size: 12.5px; } .reportpaper .mono { font-family: var(--mono); font-size: 12.5px; }
.reportpaper .ok { color: #1d7a46; font-weight: 600; } .reportpaper .bad { color: #b3261e; font-weight: 600; } .reportpaper .warn { color: #8a5a00; font-weight: 600; }
.reportpaper .tag { display: inline-block; border: 1px solid #cfd4dc; border-radius: 9px; padding: 0 7px; font-size: 12px; margin-right: 3px; }
.reportpaper .tag.ok { background: #e5f4ec; } .reportpaper .tag.bad { background: #fde8e6; } .reportpaper .tag.warn { background: #fff3d6; }
.reportpaper .hash { font: 11px var(--mono); color: #566073; word-break: break-all; }

.proj-switch{display:flex;align-items:center;gap:6px;margin-left:12px}
.proj-switch select{width:auto;max-width:11em}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
