/* Scout Werkbank — „Lagebericht auf der Werkbank“.
   Meadow & Stone (WalkingCows): sage-getönte Neutrale, Sage für Aktion und Urteil, Terrakotta nur für Hitze
   (hot, Frist ≤ 7 Tage, fällig). Ein Token-Satz über light-dark(), Umschalter setzt color-scheme. */

/* ---------- Schriften (lokal, src/werkbank/assets.ts) ---------- */
@font-face { font-family: 'Instrument Sans'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/static/fonts/instrument-sans.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: normal; font-weight: 400; font-display: swap; src: url('/static/fonts/instrument-serif.woff2') format('woff2'); }
@font-face { font-family: 'Instrument Serif'; font-style: italic; font-weight: 400; font-display: swap; src: url('/static/fonts/instrument-serif-italic.woff2') format('woff2'); }
@font-face { font-family: 'Geist Mono'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('/static/fonts/geist-mono.woff2') format('woff2'); }

/* ---------- Tokens ---------- */
:root {
    color-scheme: light dark;
    --font-sans: 'Instrument Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-mono: 'Geist Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

    --brand: light-dark(#2f5d45, #8fc3a7);
    --brand-strong: light-dark(#264c38, #a6d1b8);
    --brand-tint: light-dark(#e4ecdc, #243a2e);
    --terra: light-dark(#b8623f, #d98b66);
    --terra-tint: light-dark(#f7e8df, #3a2a22);
    --honey: light-dark(#7a5a0f, #d9b35a);
    --honey-tint: light-dark(#f6ecd2, #3a3220);
    --rust: light-dark(#8e3a2b, #e08a7a);
    --rust-tint: light-dark(#f3e2dd, #3d2622);

    --bg-0: light-dark(#f4f6f0, #141a16);
    --bg-1: light-dark(#ffffff, #1b231e);
    --bg-2: light-dark(#ebf0e4, #222b25);
    --bg-hover: light-dark(#f1f4ec, #263028);
    --bg-selected: light-dark(#e4ecdc, #243a2e);

    --fg-1: light-dark(#1f2d26, #e8ece7);
    --fg-2: light-dark(#5e6e64, #a9b5ad);
    --fg-3: light-dark(#66756e, #869389);
    --fg-4: light-dark(#8a968f, #6b7a72);

    --line-1: light-dark(#dde4d9, #2c3630);
    --line-2: light-dark(#b8c5b6, #3d4a42);
    --line-input: light-dark(#9aa79f, #657569);

    --danger: var(--rust);
    --on-brand: light-dark(#ffffff, #10211a);

    /* Score-Bänder und Diagramme */
    --viz-1: var(--terra);
    --viz-2: light-dark(#2f5d45, #5fae82);
    --viz-3: light-dark(#a9c4b3, #3a5a48);
    --viz-0: light-dark(#d8e0d5, #3d4a42);
    --cat-1: light-dark(#5c8472, #8fc3a7);
    --cat-2: light-dark(#c9962b, #d9b35a);
    --cat-3: light-dark(#3f4f47, #b4bfb8);
    --cat-4: light-dark(#2f5d45, #5fae82);
    --cat-5: light-dark(#b05a4a, #e08a7a);
    --cat-0: light-dark(#b8c5b6, #4a564f);

    --shadow-1: 0 1px 2px rgb(27 42 34 / .06);
    --shadow-2: 0 8px 24px -12px rgb(27 42 34 / .25), 0 2px 6px -2px rgb(27 42 34 / .08);
    --shadow-3: 0 24px 60px -20px rgb(10 18 14 / .45);
    --radius: 10px;
    --radius-s: 7px;
    --sidebar-w: 236px;
    --ease: cubic-bezier(.2, .8, .2, 1);
    --fast: 120ms;
    --mid: 180ms;
}
:root[data-theme='light'] { color-scheme: light; }
:root[data-theme='dark'] { color-scheme: dark; }

/* ---------- Basis ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg-0);
    color: var(--fg-1);
    font: 14px/1.5 var(--font-sans);
    font-optical-sizing: auto;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.005em; text-wrap: balance; }
h1 { font: 400 30px/1.15 var(--font-serif); letter-spacing: 0; }
h2 { font-size: 15px; }
h3 { font-size: 14px; }
p { margin: 0; }
b, strong { font-weight: 600; }
code, .mono, kbd { font-family: var(--font-mono); font-size: 0.92em; font-variant-ligatures: none; }
code { background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }
kbd { display: inline-block; min-width: 18px; padding: 0 5px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 5px; background: var(--bg-1); color: var(--fg-2); font-size: 11px; line-height: 16px; text-align: center; vertical-align: 1px; }
time { font-variant-numeric: tabular-nums; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.muted { color: var(--fg-2); }
.faint { color: var(--fg-4); }
.small { font-size: 12.5px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; padding: 6px 10px; background: var(--bg-1); border: 1px solid var(--line-2); border-radius: var(--radius-s); }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--brand-tint); }
.ic { width: 16px; height: 16px; flex: 0 0 auto; }

/* ---------- Rahmen ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100dvh; }
.topbar { display: none; }
.sidebar {
    position: sticky; inset: 0 auto auto 0; align-self: start; height: 100dvh; overflow: auto;
    display: flex; flex-direction: column; gap: 14px;
    padding: 18px 14px 14px; margin: 0; width: auto; max-width: none; max-height: none;
    border: 0; border-right: 1px solid var(--line-1); background: var(--bg-0); color: var(--fg-1);
    view-transition-name: sidebar;
}
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.nav-collapse { padding: 6px; }
.nav-collapse .ic-expand { display: none; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--fg-1); font-weight: 600; padding: 2px 8px; }
.brand:hover { text-decoration: none; }
.brand .mark { color: var(--fg-1); }
.brand-name { display: flex; flex-direction: column; line-height: 1.1; font: 400 20px/1 var(--font-serif); letter-spacing: 0.01em; }
.brand-name small { font: 500 10.5px/1.2 var(--font-sans); color: var(--fg-3); letter-spacing: 0.08em; text-transform: uppercase; margin-top: 3px; }
.nav-group { display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 11px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; padding: 8px 10px 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: var(--radius-s); color: var(--fg-2); font-weight: 500; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.nav-item:hover { background: var(--bg-hover); color: var(--fg-1); text-decoration: none; }
.nav-item.active { background: var(--bg-1); color: var(--fg-1); box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line-1); }
.nav-item.active .ic { color: var(--brand); }
.nav-item.sub { font-weight: 450; font-size: 13.5px; padding-block: 6px; }
.nav-item .count { margin-left: auto; min-width: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--on-brand); font-size: 11.5px; font-weight: 600; line-height: 18px; text-align: center; font-variant-numeric: tabular-nums; }
.nav-item .count.zero { background: var(--bg-2); color: var(--fg-3); }
.nav-foot { margin-top: auto; display: flex; gap: 4px; align-items: center; padding-top: 10px; border-top: 1px solid var(--line-1); }
.nav-foot form { margin-left: auto; }
.ic-moon { display: none; }
:root[data-theme='dark'] .ic-sun { display: none; }
:root[data-theme='dark'] .ic-moon { display: inline; }
@media (prefers-color-scheme: dark) {
    :root:not([data-theme='light']) .ic-sun { display: none; }
    :root:not([data-theme='light']) .ic-moon { display: inline; }
}
.main { padding: 26px 32px 56px; max-width: 1720px; min-width: 0; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.page-head .meta { color: var(--fg-2); margin-top: 6px; max-width: 80ch; text-wrap: pretty; }
.page-head .count { font: 500 22px/1 var(--font-sans); color: var(--fg-3); font-variant-numeric: tabular-nums; margin-left: 6px; vertical-align: 3px; }
.sec { display: flex; align-items: baseline; gap: 8px; margin: 26px 0 10px; font-size: 15px; }
.sec .muted { font-weight: 400; font-size: 13px; }
.sec .more { margin-left: auto; font-size: 12.5px; font-weight: 500; }
.foot-note { margin-top: 18px; }

/* ---------- Karten, Kennzahlen ---------- */
.card { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow-1); min-width: 0; }
.card > h2 { font-size: 12px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.05em; text-transform: uppercase; margin-bottom: 12px; display: flex; gap: 8px; align-items: baseline; }
.card > h2 .muted { text-transform: none; letter-spacing: 0; font-weight: 500; }
.card-foot { margin-top: 8px; font-size: 12.5px; color: var(--fg-3); }
.grid2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; }
.grid2 > section { min-width: 0; container-type: inline-size; }
@container (max-width: 680px) { .c-src, th.c-src, .c-act, th.c-act { display: none; } }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 14px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 14px 16px 12px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); color: var(--fg-1); box-shadow: var(--shadow-1); overflow: hidden; transition: border-color var(--fast) var(--ease), transform var(--fast) var(--ease); }
a.stat:hover { text-decoration: none; border-color: var(--line-2); transform: translateY(-1px); }
.stat .k { font-size: 12px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.04em; text-transform: uppercase; }
.stat .v { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat .s { font-size: 12px; color: var(--fg-3); text-wrap: pretty; }
.stat.accent .v { color: var(--brand); }
.stat.heat .v { color: var(--terra); }
.stat .meter { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bg-2); }
.stat .meter::after { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--p, 0%); background: var(--brand); }

/* Pipeline-Schiene */
.pipeline { margin-bottom: 18px; }
.rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-1); }
.step { display: grid; grid-template-columns: 10px 1fr; column-gap: 8px; align-items: center; padding: 9px 11px; border-right: 1px solid var(--line-1); border-bottom: 1px solid var(--line-1); margin-bottom: -1px; color: var(--fg-1); min-width: 0; transition: background var(--fast) var(--ease); }
.step:hover { background: var(--bg-hover); text-decoration: none; }
.step .led { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--line-2); grid-row: 1 / span 3; align-self: start; margin-top: 5px; }
.step.ok .led { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
.step.bad .led { background: var(--rust); border-color: var(--rust); box-shadow: 0 0 0 3px var(--rust-tint); }
.step.stale .led { background: var(--honey); border-color: var(--honey); box-shadow: 0 0 0 3px var(--honey-tint); }
.step-name { font-size: 13px; font-weight: 600; }
.step-when { font-size: 12px; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.step-sum { font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Ringe */
.viz-row { margin-bottom: 6px; }
.viz-body { display: flex; gap: 20px; align-items: center; }
.viz-body svg { flex: 0 0 124px; width: 124px; height: 124px; }
.ring-n { font: 600 23px var(--font-sans); fill: var(--fg-1); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.ring-l { font: 500 9.5px var(--font-sans); fill: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.legend { list-style: none; margin: 0; padding: 0; font-size: 13px; flex: 1; min-width: 0; }
.legend li { display: flex; align-items: center; gap: 9px; line-height: 1.85; }
.legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend .pct { color: var(--fg-3); width: 38px; text-align: right; font-variant-numeric: tabular-nums; font-size: 12px; }

/* ---------- Tabellen ---------- */
.table-wrap { background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; z-index: 2; background: var(--bg-1); padding: 9px 12px; text-align: left; font-size: 11px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.05em; text-transform: uppercase; border-bottom: 1px solid var(--line-1); white-space: nowrap; }
th:first-child { border-top-left-radius: var(--radius); }
th:last-child { border-top-right-radius: var(--radius); }
td { padding: 9px 12px; border-top: 1px solid var(--line-1); vertical-align: middle; }
tr:first-child td { border-top: 0; }
tbody tr { transition: background var(--fast) var(--ease); }
tbody tr:hover td { background: var(--bg-hover); }
tr[data-href] { cursor: pointer; }
tr[data-href]:focus-visible { outline: none; }
tr[data-href]:focus-visible td { background: var(--bg-selected); box-shadow: inset 0 0 0 1px var(--brand); }
tr[data-href]:focus-visible td:first-child { box-shadow: inset 3px 0 0 var(--brand), inset 0 0 0 1px var(--brand); }
tr.off td { opacity: .6; }
.c-score { width: 60px; text-align: right; }
.c-date { white-space: nowrap; font-variant-numeric: tabular-nums; }
.c-src { width: 190px; }
.c-dec { white-space: nowrap; }
.c-act { width: 104px; padding-right: 8px; }
th.c-score { text-align: right; }
.list tbody tr.band-hot td:first-child { box-shadow: inset 3px 0 0 var(--terra); }
.list .title { display: block; color: var(--fg-1); font-size: 14.5px; font-weight: 500; line-height: 1.35; text-wrap: pretty; }
.list .title:hover { text-decoration: none; color: var(--brand); }
.list .sub { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; margin-top: 3px; font-size: 12.5px; color: var(--fg-3); }
.list .dl { display: flex; flex-direction: column; line-height: 1.25; }
.list .dl small { font-size: 11px; color: var(--fg-3); font-weight: 500; }
.src { font-family: var(--font-mono); font-size: 11.5px; color: var(--fg-3); overflow-wrap: break-word; }
.cat { display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; border: 1px solid var(--line-1); border-radius: 999px; font-size: 11.5px; color: var(--fg-3); white-space: nowrap; background: var(--bg-1); }
.cat.on { color: var(--brand); border-color: var(--brand-tint); background: var(--brand-tint); }
.cat .ic { width: 12px; height: 12px; }
table.plain .num b { font-variant-numeric: tabular-nums; }
.runs td, .routines td, .src-table td { font-size: 13.5px; }
.runs .c-date { color: var(--fg-2); }

/* Status, Entscheidung, Frist */
.st { display: inline-block; padding: 1px 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; background: var(--bg-2); color: var(--fg-2); white-space: nowrap; }
.st-new { background: var(--brand-tint); color: var(--brand); }
.st-updated { background: var(--honey-tint); color: var(--honey); }
.st-expired { color: var(--fg-3); text-decoration: line-through; }
.st-ok { background: var(--brand-tint); color: var(--brand); }
.st-bad { background: var(--rust-tint); color: var(--rust); }
.dec { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px 2px 7px; border: 1px solid transparent; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.dec .ic { width: 12px; height: 12px; stroke-width: 2.4; }
.dec-none { color: var(--fg-3); border-color: var(--line-1); border-style: dashed; padding-left: 9px; }
.dec-interesting { color: var(--brand); background: var(--brand-tint); }
.dec-follow_up { color: var(--honey); background: var(--honey-tint); }
.dec-ignored { color: var(--fg-3); border-color: var(--line-1); font-style: italic; padding-left: 9px; }
.dec-deleted { color: var(--fg-4); text-decoration: line-through; padding-left: 9px; }
.dec-applied, .dec-contacted { color: var(--fg-1); border-color: var(--line-2); }
.dec-won { color: var(--on-brand); background: var(--brand); }
.dec-lost { color: var(--rust); background: var(--rust-tint); }
.g { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; flex: 0 0 8px; }
.g-dot { background: currentColor; }
.g-half { background: linear-gradient(to right, currentColor 50%, transparent 50%); }
.g-two { box-shadow: 3px 0 0 -1px currentColor; margin-right: 2px; }
.dl.urgent, .dl.urgent small { color: var(--terra); font-weight: 600; }
.dl.soon, .dl.soon small { color: var(--honey); }
.dl.past, .dl.past small { color: var(--fg-4); }

/* Score */
.score { display: inline-block; min-width: 30px; padding: 0 1px 1px; border-bottom: 2px solid currentColor; font-size: 15px; font-weight: 700; line-height: 1.2; text-align: right; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.score.band-hot { color: var(--terra); }
.score.band-warm { color: var(--brand); }
.score.band-low { color: var(--fg-2); border-color: var(--line-2); }
.score.band-none { color: var(--fg-4); border-style: dotted; border-color: var(--line-2); font-weight: 500; }
.score.big { font-size: 46px; font-weight: 600; line-height: 1; letter-spacing: -0.03em; border-bottom-width: 3px; padding-bottom: 4px; min-width: 0; }

/* Schnellaktionen */
.row-actions { display: flex; gap: 2px; justify-content: flex-end; opacity: 0; transition: opacity var(--fast) var(--ease); }
.row-actions > form:not([popover]) { display: contents; }
tr:hover .row-actions, tr:focus-within .row-actions, tr:focus-visible .row-actions { opacity: 1; }
.qa { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 1px solid transparent; border-radius: 7px; background: transparent; color: var(--fg-2); cursor: pointer; transition: background var(--fast) var(--ease), color var(--fast) var(--ease); }
.qa:hover { background: var(--bg-1); border-color: var(--line-2); color: var(--brand); }
.qa:focus-visible { opacity: 1; }
.pop { width: min(440px, 92vw); padding: 16px 18px; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); color: var(--fg-1); box-shadow: var(--shadow-3); }
.pop::backdrop { background: rgb(20 26 22 / .35); backdrop-filter: blur(2px); }
.pop-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
@keyframes flash { from { background: var(--bg-selected); } to { background: transparent; } }
tr.flash td { animation: flash 2.4s var(--ease) forwards; }

/* ---------- Sichten, Filter ---------- */
.views { display: flex; flex-wrap: wrap; gap: 2px; border-bottom: 1px solid var(--line-1); margin-bottom: 14px; }
.view { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px 9px; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--fg-2); font-size: 13.5px; font-weight: 500; transition: color var(--fast) var(--ease); }
.view:hover { color: var(--fg-1); text-decoration: none; }
.view.active { color: var(--fg-1); border-color: var(--brand); font-weight: 600; }
.view.active .ic { color: var(--brand); }
.filters { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; margin-bottom: 12px; }
.search { position: relative; flex: 1 1 100%; display: flex; align-items: center; }
.search .ic { position: absolute; left: 12px; color: var(--fg-3); pointer-events: none; }
.filters .search input[name='q'] { width: 100%; padding: 10px 44px 10px 38px; font-size: 15px; border-radius: var(--radius); }
.search kbd { position: absolute; right: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.03em; text-transform: uppercase; min-width: 0; }
.field > span small, .field > span em { font-weight: 400; text-transform: none; letter-spacing: 0; }
.field.narrow input { width: 84px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 12px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 8px 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--fg-1); font-size: 12.5px; font-weight: 500; }
.chip:hover { text-decoration: none; background: var(--bg-selected); }
.chip .ic { width: 13px; height: 13px; color: var(--fg-3); }
.chip.reset { background: transparent; color: var(--fg-3); }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; }
.pager .pages { display: flex; align-items: center; gap: 10px; }

/* ---------- Formulare, Knöpfe ---------- */
input, select, textarea, button { font: inherit; color: var(--fg-1); }
input:not([type='checkbox']):not([type='radio']), select, textarea { width: 100%; padding: 7px 10px; background: var(--bg-1); border: 1px solid var(--line-input); border-radius: var(--radius-s); font-size: 13.5px; font-weight: 400; letter-spacing: 0; text-transform: none; transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease); }
select { padding-right: 28px; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2366756e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; background-size: 14px; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }
textarea { min-height: 72px; resize: vertical; field-sizing: content; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: var(--fg-4); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 7px 13px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--bg-1); color: var(--fg-1); font-size: 13.5px; font-weight: 500; line-height: 1.3; cursor: pointer; white-space: nowrap; transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease); }
.btn:hover { background: var(--bg-hover); border-color: var(--line-input); text-decoration: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.btn.primary:hover { background: var(--brand-strong); border-color: var(--brand-strong); }
.btn.primary kbd { background: transparent; border-color: color-mix(in oklch, var(--on-brand) 40%, transparent); color: var(--on-brand); }
.btn.danger { background: var(--rust); border-color: var(--rust); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--fg-2); padding: 6px 8px; }
.btn.ghost:hover { background: var(--bg-hover); color: var(--fg-1); }
.btn.disabled { opacity: .35; pointer-events: none; }
.check { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; color: var(--fg-2); cursor: pointer; }
.check input { margin: 3px 0 0; accent-color: var(--brand); }
.notice { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 8px 12px; border: 1px solid var(--brand-tint); border-radius: var(--radius-s); background: var(--brand-tint); color: var(--brand); font-size: 13px; font-weight: 500; }
.notice.error { border-color: var(--rust-tint); background: var(--rust-tint); color: var(--rust); }
.error { color: var(--danger); font-size: 13px; }
.empty { padding: 22px 18px; background: var(--bg-1); border: 1px dashed var(--line-2); border-radius: var(--radius); color: var(--fg-2); font: italic 400 17px/1.4 var(--font-serif); text-align: center; }
.empty.small { padding: 10px 0; border: 0; background: transparent; text-align: left; font-size: 15px; }

/* ---------- Detail ---------- */
.detail-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.queue { display: none; }
.crumbs { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; font-size: 13.5px; }
.crumbs > a { display: inline-flex; align-items: center; gap: 4px; color: var(--fg-2); font-weight: 500; }
.prevnext { display: flex; align-items: center; gap: 4px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.detail-head { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 16px; }
.score-hero { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 124px; padding: 14px 14px 12px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.band-word { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-3); }
.strip { display: flex; gap: 2px; width: 100%; height: 6px; margin-top: 4px; }
.strip i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(to right, var(--brand) var(--v, 0%), var(--bg-2) var(--v, 0%)); min-width: 3px; }
.strip-risk { font-size: 11px; font-weight: 600; color: var(--terra); }
.detail .title { font: 400 32px/1.15 var(--font-serif); letter-spacing: 0; text-wrap: balance; hyphens: auto; }
.byline { margin-top: 8px; font-size: 14.5px; color: var(--fg-2); }
.byline b { color: var(--fg-1); }
.ext { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; }
.chips-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.chips-line .id { font-size: 12px; color: var(--fg-3); }
.chips-line .dl { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; font-weight: 500; color: var(--fg-2); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
.col-read, .col-act { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.lede { font-size: 16px; line-height: 1.6; max-width: 70ch; text-wrap: pretty; }
.callout { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 14px 0 16px; padding: 12px 14px; border-left: 3px solid var(--terra); border-radius: 0 var(--radius-s) var(--radius-s) 0; background: var(--bg-2); }
.callout-k { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--terra); padding-top: 3px; }
.callout p { font-size: 14.5px; line-height: 1.55; max-width: 70ch; text-wrap: pretty; }
.dims { display: flex; flex-direction: column; gap: 3px; padding-top: 6px; border-top: 1px solid var(--line-1); }
.dim { display: grid; grid-template-columns: 160px minmax(0, 1fr) 30px 46px; gap: 10px; align-items: center; font-size: 13px; padding: 3px 0; }
.dim-l { color: var(--fg-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dim-bar { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.dim-bar i { display: block; height: 100%; width: var(--v, 0%); background: var(--brand); border-radius: 3px; transition: width 400ms var(--ease); }
.dim.risk .dim-bar i { background: var(--rust); }
.dim-v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.dim-w { text-align: right; font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); }
.dim-foot { margin-top: 10px; font-size: 12.5px; color: var(--fg-3); }
.text-box { position: relative; }
.text-box pre.text { margin: 0; max-height: 440px; overflow: hidden; font: 15px/1.6 var(--font-sans); white-space: pre-wrap; overflow-wrap: anywhere; max-width: 76ch; color: var(--fg-1); }
.text-box:not(.is-open) pre.text { mask-image: linear-gradient(to bottom, #000 72%, transparent); }
.text-box.is-open pre.text { max-height: none; mask-image: none; }
.text-box .expand { margin-top: 8px; color: var(--brand); font-weight: 500; }
.text-sep { color: var(--fg-3); font-size: 12px; letter-spacing: 0.06em; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; border: 0; margin: 0 0 12px; padding: 0; min-width: 0; }
.seg legend { padding: 0; margin-bottom: 6px; font-size: 11px; font-weight: 600; color: var(--fg-3); letter-spacing: 0.06em; text-transform: uppercase; }
.seg-item { position: relative; }
.seg-item input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.seg-item span { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--fg-2); background: var(--bg-1); cursor: pointer; transition: background var(--fast) var(--ease), color var(--fast) var(--ease), border-color var(--fast) var(--ease); }
.seg-item span kbd { font-size: 10px; min-width: 15px; padding: 0 3px; line-height: 14px; }
.seg-item:hover span { border-color: var(--line-input); color: var(--fg-1); }
.seg-item input:checked + span { background: var(--fg-1); border-color: var(--fg-1); color: var(--bg-1); }
.seg-item input:checked + span kbd { background: transparent; border-color: color-mix(in oklch, var(--bg-1) 40%, transparent); color: var(--bg-1); }
.seg-item input:focus-visible + span { outline: 2px solid var(--terra); outline-offset: 2px; }
.seg.danger input:checked + span { background: var(--rust); border-color: var(--rust); color: #fff; }
.decision .field { margin-bottom: 12px; }
.decision .follow-up { display: none; }
.decision form:has(input[value='follow_up']:checked) .follow-up { display: flex; }
.decision .follow-up small { color: var(--fg-3); font-weight: 400; }
.decision .req { display: none; color: var(--terra); font-style: normal; }
.decision form:has(input[value='ignored']:checked) .req { display: inline; }
.decision form:has(input[value='ignored']:checked) textarea { border-color: var(--terra); }
.form-foot { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.comment-form { display: flex; gap: 8px; align-items: flex-end; }
.comment-form textarea { min-height: 44px; }
.comments { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.comments li { padding: 2px 0 2px 12px; border-left: 2px solid var(--line-2); }
.comments time { display: block; font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); margin-bottom: 2px; }
.comments p { font-size: 14px; white-space: pre-wrap; }
.meta-dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px 14px; margin: 0; font-size: 13px; }
.meta-dl dt { color: var(--fg-3); }
.meta-dl dd { margin: 0; overflow-wrap: anywhere; }

/* Warteschlange neben dem Detail */
@media (min-width: 1180px) {
    .detail-shell.has-queue { grid-template-columns: 320px minmax(0, 1fr); }
    .queue { display: flex; flex-direction: column; position: sticky; top: 16px; max-height: calc(100dvh - 32px); background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
    .queue header { border-bottom: 1px solid var(--line-1); }
    .q-head { display: flex; align-items: center; gap: 8px; padding: 11px 14px; color: var(--fg-1); font-weight: 600; font-size: 13px; }
    .q-head b { margin-left: auto; font-weight: 500; color: var(--fg-3); font-variant-numeric: tabular-nums; }
    .q-head:hover { text-decoration: none; background: var(--bg-hover); }
    .q-list { overflow: auto; overscroll-behavior: contain; }
    .q-item { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 9px 12px; border-top: 1px solid var(--line-1); color: var(--fg-1); transition: background var(--fast) var(--ease); }
    .q-item:first-child { border-top: 0; }
    .q-item:hover { background: var(--bg-hover); text-decoration: none; }
    .q-item.current { background: var(--bg-selected); box-shadow: inset 3px 0 0 var(--brand); }
    .q-item .score { font-size: 13px; min-width: 26px; }
    .q-t { display: flex; flex-direction: column; min-width: 0; }
    .q-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .q-sub { font-size: 11.5px; color: var(--fg-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    .q-item .dec { font-size: 11px; padding: 1px 7px 1px 6px; }
    .q-item .dec .ic { width: 10px; height: 10px; }
}
/* Icon-Leiste: per Schalter (data-nav=rail, gemerkt) oder automatisch neben der Warteschlange unter 1500 px (solange nicht ausdrücklich „voll“) */
:root[data-nav='rail'] { --sidebar-w: 64px; }
:root[data-nav='rail'] .sidebar { padding-inline: 10px; }
:root[data-nav='rail'] .sidebar .brand-name, :root[data-nav='rail'] .sidebar .nav-item > span, :root[data-nav='rail'] .sidebar .nav-label { display: none; }
:root[data-nav='rail'] .sidebar .nav-item { justify-content: center; padding: 9px 0; }
:root[data-nav='rail'] .sidebar .nav-item .count { position: absolute; top: 2px; right: 4px; margin: 0; min-width: 16px; padding: 0 4px; font-size: 9.5px; line-height: 14px; }
:root[data-nav='rail'] .sidebar .nav-item .count.zero { display: none; }
:root[data-nav='rail'] .sidebar .brand-row { flex-direction: column; gap: 4px; }
:root[data-nav='rail'] .sidebar .brand { justify-content: center; padding: 2px 0; }
:root[data-nav='rail'] .nav-collapse .ic-collapse { display: none; }
:root[data-nav='rail'] .nav-collapse .ic-expand { display: inline; }
:root[data-nav='rail'] .nav-foot { flex-direction: column; }
:root[data-nav='rail'] .nav-foot form { margin-left: 0; }
@media (max-width: 1500px) {
    :root:not([data-nav='full']):has(.detail-shell.has-queue) { --sidebar-w: 64px; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar { padding-inline: 10px; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .brand-name, :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .nav-item > span, :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .nav-label { display: none; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .nav-item { justify-content: center; padding: 9px 0; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .nav-item .count { position: absolute; top: 2px; right: 4px; margin: 0; min-width: 16px; padding: 0 4px; font-size: 9.5px; line-height: 14px; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .nav-item .count.zero { display: none; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .brand-row { flex-direction: column; gap: 4px; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .sidebar .brand { justify-content: center; padding: 2px 0; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .nav-collapse .ic-collapse { display: none; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .nav-collapse .ic-expand { display: inline; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .nav-foot { flex-direction: column; }
    :root:not([data-nav='full']):has(.detail-shell.has-queue) .nav-foot form { margin-left: 0; }
}

/* ---------- Dialoge ---------- */
.dlg { width: min(480px, 92vw); padding: 0; border: 1px solid var(--line-2); border-radius: 14px; background: var(--bg-1); color: var(--fg-1); box-shadow: var(--shadow-3); }
.dlg::backdrop { background: rgb(20 26 22 / .45); backdrop-filter: blur(2px); }
.dlg header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px 0; }
.dlg header h2 { font: 400 22px/1.2 var(--font-serif); }
.dlg p { padding: 10px 18px 0; color: var(--fg-2); line-height: 1.55; }
.dlg footer { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 18px 18px; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 9px 16px; margin: 0; padding: 14px 18px; font-size: 13px; }
.keys dt { white-space: nowrap; }
.keys dd { margin: 0; color: var(--fg-2); }
.dlg .check { padding: 0 18px 18px; }

/* ---------- Login ---------- */
.login { min-height: 100dvh; display: grid; place-items: center; padding: 24px; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-tint), transparent 70%), var(--bg-0); }
.login-card { width: min(380px, 100%); display: flex; flex-direction: column; gap: 14px; padding: 28px 28px 26px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: 16px; box-shadow: var(--shadow-2); }
.login-card .brand.big { padding: 0 0 8px; align-self: center; }
.login-card .brand.big .mark { width: 40px; height: 40px; }
.login-card .brand-name { font-size: 28px; }
.login-card .btn { margin-top: 4px; padding: 10px; }
.login .login-card input[type='password'] { padding: 10px 12px; font-size: 15px; }

/* ---------- Prozess, Quellen ---------- */
.prozess-svg { padding: 10px; overflow-x: auto; margin-bottom: 8px; }
.job { margin-bottom: 14px; }
.job h3 { display: flex; gap: 12px; align-items: baseline; margin-bottom: 8px; font-size: 14px; }
.job h3 .muted { font-weight: 400; font-size: 12.5px; }
.flow { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin: 0; padding: 0; counter-reset: step; }
.flow .node { position: relative; padding: 10px 12px 10px 14px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); box-shadow: var(--shadow-1); counter-increment: step; }
.flow .node::before { content: counter(step); position: absolute; top: 8px; right: 10px; font: 600 11px var(--font-mono); color: var(--fg-4); }
.flow .cmd { font: 600 12.5px var(--font-mono); color: var(--brand); }
.flow .what { font-size: 12.5px; color: var(--fg-2); margin-top: 3px; text-wrap: pretty; }
.flow .run { margin-top: 7px; font-size: 12px; }
.src-cat { margin-bottom: 14px; }
.src-cat > header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; margin-bottom: 12px; }
.src-cat > header h2 { font: 600 15px/1.3 var(--font-sans); color: var(--fg-1); letter-spacing: 0; text-transform: none; margin: 0 0 4px; }
.src-cat > header p { max-width: 90ch; text-wrap: pretty; }
.src-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: 0 0 auto; }
.pips { display: inline-flex; gap: 3px; }
.pips i { width: 14px; height: 6px; border-radius: 2px; background: var(--bg-2); }
.pips i.on { background: var(--brand); }
.explorers { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.src-cat .table-wrap { border: 0; box-shadow: none; border-radius: 0; background: transparent; }
.src-cat th { background: var(--bg-1); position: static; }
.plain-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }

/* ---------- Bewerbung: Eckdaten und Unterlagen ---------- */
.bw-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 12px; margin-bottom: 12px; }
.bw-grid .wide { grid-column: 1 / -1; }
.files { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.files li { display: flex; align-items: center; gap: 6px; }
.files li .file-btn { flex: 1; min-width: 0; }
.files li form { display: contents; }
.files .qa { width: 36px; height: 36px; color: var(--fg-3); }
.files .qa:hover { color: var(--rust); border-color: var(--rust-tint); background: var(--rust-tint); }
.file-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 7px 14px 7px 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--bg-1); color: var(--fg-1); font-weight: 500; font-size: 14px; line-height: 1.3; max-width: 100%; transition: border-color var(--fast) var(--ease), background var(--fast) var(--ease); }
.file-btn:hover { text-decoration: none; border-color: var(--brand); background: var(--brand-tint); }
.file-btn .ic { color: var(--brand); width: 18px; height: 18px; }
.file-btn .file-name { min-width: 0; overflow-wrap: anywhere; }
.file-btn small { margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--fg-3); font-family: var(--font-mono); white-space: nowrap; }
.upload input[type='file'] { padding: 8px 10px; border-style: dashed; cursor: pointer; }
.upload input[type='file']::file-selector-button { font: inherit; font-weight: 500; margin-right: 10px; padding: 5px 11px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--bg-1); color: var(--fg-1); cursor: pointer; }
.bewerbung .form-foot { margin-top: 10px; }

/* ---------- Anruf ---------- */
.call { max-width: 820px; }
.call .page-head { margin-bottom: 12px; }
.call-search { margin-bottom: 8px; }
.call-search .search input[name='q'] { padding: 14px 16px 14px 46px; font-size: 19px; border-radius: 14px; border-color: var(--line-2); box-shadow: var(--shadow-2); }
.call-search .search .ic { left: 16px; width: 20px; height: 20px; }
.call-search input[type='search']::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-right: 2px; cursor: pointer; background: var(--fg-3); mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / 14px no-repeat; }
.call-count { margin: 0 2px 14px; }
.calls { display: flex; flex-direction: column; gap: 12px; }
.call-card { padding: 16px 18px 14px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: 14px; box-shadow: var(--shadow-1); }
.call-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.call-org { font: 400 26px/1.15 var(--font-serif); text-wrap: balance; }
.call-card > header .dec { flex: 0 0 auto; margin-top: 5px; }
.call-role { margin-top: 5px; font-size: 15.5px; font-weight: 500; line-height: 1.35; text-wrap: pretty; }
.call-sub { margin-top: 3px; font-size: 12.5px; color: var(--fg-3); }
.call-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 5px 14px; margin: 12px 0 0; padding-top: 12px; border-top: 1px solid var(--line-1); font-size: 14.5px; }
.call-facts dt { color: var(--fg-3); font-size: 12.5px; padding-top: 2px; }
.call-facts dd { margin: 0; overflow-wrap: anywhere; }
.call-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.call-note { margin-top: 12px; padding: 8px 12px; border-left: 2px solid var(--line-2); background: var(--bg-2); border-radius: 0 var(--radius-s) var(--radius-s) 0; font-size: 13.5px; white-space: pre-wrap; }
.call-note time { display: block; font-size: 11.5px; color: var(--fg-3); font-family: var(--font-mono); margin-bottom: 2px; }
.call-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.call-links .btn { min-height: 42px; }
.call-empty { margin-top: 12px; }
.call-empty a { font-style: normal; font: 500 14px var(--font-sans); }

/* ---------- Reports ---------- */
.reports { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; max-width: 760px; }
.reports a { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto auto; gap: 14px; align-items: center; padding: 12px 16px; background: var(--bg-1); border: 1px solid var(--line-1); border-radius: var(--radius); color: var(--fg-1); box-shadow: var(--shadow-1); transition: border-color var(--fast) var(--ease); }
.reports a:hover { text-decoration: none; border-color: var(--line-2); }
.reports .kw { font: 400 22px/1 var(--font-serif); }
.reports .rep-date { font-weight: 500; }

/* ---------- Mobil ---------- */
@media (max-width: 1023px) {
    .shell { grid-template-columns: minmax(0, 1fr); }
    .topbar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20; padding: 8px 12px; background: color-mix(in oklch, var(--bg-0) 85%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-1); }
    .topbar .brand { font: 400 20px var(--font-serif); }
    .topbar-actions { display: flex; align-items: center; gap: 2px; }
    .topbar-actions .btn { min-width: 40px; min-height: 40px; }
    .topbar-actions .btn.active { color: var(--brand); background: var(--brand-tint); }
    .sidebar { display: none; position: fixed; inset: 0 auto 0 0; height: 100dvh; width: min(300px, 86vw); border-right: 1px solid var(--line-2); box-shadow: var(--shadow-3); view-transition-name: none; }
    .sidebar:popover-open { display: flex; }
    :root[data-nav='rail'] .sidebar { padding-inline: 14px; }
    :root[data-nav='rail'] .sidebar .brand-name, :root[data-nav='rail'] .sidebar .nav-item > span, :root[data-nav='rail'] .sidebar .nav-label { display: initial; }
    :root[data-nav='rail'] .sidebar .nav-item { justify-content: flex-start; padding: 7px 10px; }
    :root[data-nav='rail'] .sidebar .nav-item .count { position: static; min-width: 22px; padding: 0 6px; font-size: 11.5px; line-height: 18px; margin-left: auto; }
    :root[data-nav='rail'] .sidebar .brand-row { flex-direction: row; }
    :root[data-nav='rail'] .nav-collapse { display: none; }
    :root[data-nav='rail'] .nav-foot { flex-direction: row; }
    :root[data-nav='rail'] .nav-foot form { margin-left: auto; }
    .sidebar::backdrop { background: rgb(20 26 22 / .4); }
    .main { padding: 16px 16px 40px; }
    .page-head { flex-direction: column; align-items: flex-start; }
    h1 { font-size: 26px; }
    .grid2, .detail-grid, .detail-head { grid-template-columns: minmax(0, 1fr); }
    .score-hero { flex-direction: row; justify-content: space-between; min-width: 0; }
    .score-hero .strip { display: none; }
    .table-wrap { overflow-x: auto; }
    th { position: static; }
    .c-src, .c-act, th.c-src, th.c-act { display: none; }
    .dim { grid-template-columns: 120px minmax(0, 1fr) 28px 40px; }
    .step { border-right: 0; }
    .viz-body { flex-direction: column; align-items: stretch; }
    .viz-body svg { align-self: center; }
    .src-cat > header { flex-direction: column; }
    .src-side { align-items: flex-start; }
    .reports a { grid-template-columns: 56px minmax(0, 1fr) auto; }
    .reports .mono { display: none; }
    .detail .title { font-size: 26px; }
}
@media (max-width: 600px) {
    .c-dec, th.c-dec { display: none; }
    .stat .v { font-size: 26px; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stats .stat:last-child { grid-column: 1 / -1; }
    .filters .field { flex: 1 1 45%; }
    .search kbd { display: none; }
    .filters .search input[name='q'] { padding-right: 12px; }
    .bw-grid { grid-template-columns: minmax(0, 1fr); }
    .call-card { padding: 14px 14px 12px; border-radius: 12px; }
    .call-org { font-size: 23px; }
    .call-card > header { flex-direction: column; gap: 6px; }
    .call-card > header .dec { margin-top: 0; }
    .call-facts { grid-template-columns: minmax(0, 1fr); gap: 2px; }
    .call-facts dt { padding-top: 6px; }
    .call-facts dt:first-child { padding-top: 0; }
    .call-files .file-btn { width: 100%; }
    .call-links .btn { flex: 1; }
    /* Datei-Knopf: Name in voller Breite, Typ und Größe darunter — kein Umbruch mitten im Namen */
    .file-btn { flex-wrap: wrap; row-gap: 1px; }
    .file-btn .file-name { flex: 1 1 0; }
    .file-btn small { flex: 0 0 100%; margin-left: 0; padding-left: 28px; }
}

/* ---------- Bewegung ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: 160ms; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}
@media print {
    .sidebar, .topbar, .row-actions, .filters, .views, .nav-foot, .queue, .crumbs { display: none !important; }
    .shell { grid-template-columns: 1fr; }
    body { background: #fff; }
}
