/* hflong – Oberfläche. Ruhig, hell, dicht: eine Akzentfarbe, Semantik nur für Passung und Flags. */

:root {
  color-scheme: light;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --surface-3: #e8ebf0;
  --line: #e2e5ea;
  --line-strong: #cdd2da;
  --text: #151821;
  --text-2: #464d5b;
  --text-3: #636b7a;
  --accent: #2c4fb5;
  --accent-hover: #233f93;
  --accent-soft: #edf1fb;
  --accent-line: #c5d1f1;
  --on-accent: #ffffff;
  --a: #13723f; --a-bg: #e4f3ea; --a-line: #b8dfc7;
  --b: #875600; --b-bg: #fbf0d9; --b-line: #efd49a;
  --c: #b0361f; --c-bg: #fcebe6; --c-line: #f2c3b6;
  --flag: #a8391a; --flag-bg: #fdefe9; --flag-line: #f1cbbd;
  --neg: #b0361f;
  --focus: #2c4fb5;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.06);
  --shadow-md: 0 4px 12px -2px rgb(16 24 40 / 0.10), 0 2px 4px -2px rgb(16 24 40 / 0.06);
  --shadow-lg: 0 16px 40px -8px rgb(16 24 40 / 0.18), 0 4px 10px -4px rgb(16 24 40 / 0.08);
  --radius: 8px;
  --radius-sm: 6px;
  --font: "Public Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --topbar-h: 52px;
  --toolbar-h: 0px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0f1116;
    --surface: #161920;
    --surface-2: #1c2029;
    --surface-3: #252a35;
    --line: #262b36;
    --line-strong: #353b48;
    --text: #e8eaef;
    --text-2: #b3b9c6;
    --text-3: #8d95a5;
    --accent: #8aa6f5;
    --accent-hover: #a8bdf8;
    --accent-soft: #1d2640;
    --accent-line: #34467a;
    --on-accent: #0f1116;
    --a: #6fd49a; --a-bg: #14291d; --a-line: #245238;
    --b: #e7bd63; --b-bg: #2b2413; --b-line: #574618;
    --c: #f19a85; --c-bg: #331a15; --c-line: #5e2c22;
    --flag: #f0a184; --flag-bg: #2e1b14; --flag-line: #5a3020;
    --neg: #f19a85;
    --focus: #8aa6f5;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / 0.4);
    --shadow-md: 0 4px 12px -2px rgb(0 0 0 / 0.5);
    --shadow-lg: 0 16px 40px -8px rgb(0 0 0 / 0.6);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 14px/1.5 var(--font);
  font-feature-settings: "tnum" 1, "cv11" 1;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-line); color: var(--text); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
h1 { font-size: 24px; line-height: 1.25; }
h2 { font-size: 16px; line-height: 1.35; }
h3 { font-size: 13px; }
p { margin: 0; }
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
[hidden]:not(.selbar) { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -3px; }
.icon.sm { width: 14px; height: 14px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }

/* -- Kopfzeile ------------------------------------------------------------ */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 28px;
  padding: 0 24px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; letter-spacing: -0.01em; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 22px; height: 22px; }
.brand-mark rect { fill: var(--accent); }
.brand small { font-weight: 400; color: var(--text-3); font-size: 12px; letter-spacing: 0; }
.topnav { display: flex; gap: 4px; }
.topnav a { color: var(--text-2); padding: 6px 10px; border-radius: var(--radius-sm); font-weight: 500; }
.topnav a:hover { background: var(--surface-2); text-decoration: none; color: var(--text); }
.topnav a[aria-current="page"] { color: var(--text); background: var(--surface-2); }

main { padding: 28px 24px 120px; max-width: 1720px; margin: 0 auto; }

/* -- Seitenkopf ------------------------------------------------------------ */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-3); margin-bottom: 10px; }
.crumbs a { color: var(--text-3); }
.crumbs > * { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs > a { max-width: 42ch; }
.crumbs > .icon { flex: none; }
.crumbs a:hover { color: var(--text); }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .meta { margin-top: 6px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 13px; }
.page-actions { display: flex; gap: 8px; align-items: center; }

/* -- Knöpfe und Eingaben ----------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  height: 34px; padding: 0 14px;
  font: 500 13px/1 var(--font);
  color: var(--on-accent); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  cursor: pointer; white-space: nowrap; text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: background 150ms var(--ease), border-color 150ms var(--ease), box-shadow 150ms var(--ease), transform 80ms;
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.sec { background: var(--surface); color: var(--text); border-color: var(--line-strong); }
.btn.sec:hover { background: var(--surface-2); }
.btn.ghost { background: transparent; color: var(--text-2); border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; gap: 5px; }
.btn.lg { height: 40px; padding: 0 18px; font-size: 14px; }
.btn .count { background: var(--accent); color: var(--on-accent); border-radius: 999px; padding: 2px 6px; font-size: 11px; line-height: 1; }
.btn[aria-pressed="true"], .btn[aria-expanded="true"] { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

input[type=text], input[type=search], input[type=number], input[type=email], input[type=password], textarea, select {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 7px 10px; width: 100%;
  transition: border-color 150ms, box-shadow 150ms;
}
input::placeholder, textarea::placeholder { color: var(--text-3); }
/* Autofill des Browsers übernimmt sonst eigene Hintergrund- und Textfarben, die nicht zum Theme passen */
input:-webkit-autofill, input:-webkit-autofill:hover {
  -webkit-text-fill-color: var(--text); caret-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset; transition: background-color 9999s;
}
input:-webkit-autofill:focus { -webkit-box-shadow: 0 0 0 1000px var(--surface) inset, 0 0 0 3px var(--accent-soft); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=number] { width: 88px; }
input[type=checkbox] { accent-color: var(--accent); width: 15px; height: 15px; margin: 0; cursor: pointer; vertical-align: middle; }
label.field { display: block; font-weight: 500; font-size: 13px; margin: 0 0 6px; color: var(--text-2); }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; font-size: 13px; color: var(--text-2); user-select: none; }

/* -- Pillen und Abzeichen ---------------------------------------------------- */
.pill { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.pill .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.run .dot { animation: pulse 1.4s ease-in-out infinite; }
.pill.ok { background: var(--a-bg); color: var(--a); border-color: var(--a-line); }
.pill.warn { background: var(--c-bg); color: var(--c); border-color: var(--c-line); }
.pill.info { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
@keyframes pulse { 50% { opacity: .3; } }
@media (prefers-reduced-motion: reduce) { .pill.run .dot { animation: none; } }

.grade { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-weight: 600; font-size: 13px; border: 1px solid transparent; }
.grade-A { background: var(--a-bg); color: var(--a); border-color: var(--a-line); }
.grade-B { background: var(--b-bg); color: var(--b); border-color: var(--b-line); }
.grade-C { background: var(--c-bg); color: var(--c); border-color: var(--c-line); }
.grade-none { background: var(--surface-2); color: var(--text-3); border-color: var(--line); }

.flag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; font-weight: 500; background: var(--flag-bg); color: var(--flag); border: 1px solid var(--flag-line); white-space: nowrap; }
.flag.off { background: transparent; color: var(--text-3); border-style: dashed; border-color: var(--line-strong); }
.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11.5px; background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* -- Fortschritt der Pipeline ----------------------------------------------- */
.steps { display: flex; align-items: center; gap: 0; list-style: none; margin: 18px 0 0; padding: 0; font-size: 12.5px; flex-wrap: wrap; row-gap: 8px; }
.steps li { display: flex; align-items: center; gap: 8px; color: var(--text-3); }
.steps li + li::before { content: ""; width: 28px; height: 1px; background: var(--line-strong); margin: 0 10px; }
.steps .mark { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; border: 1.5px solid var(--line-strong); background: var(--surface); }
.steps .done { color: var(--text-2); }
.steps .done .mark { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.steps .done + li::before, .steps .now::before { background: var(--accent); }
.steps .now { color: var(--text); font-weight: 600; }
.steps .now .mark { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.steps .now .mark::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.steps .now.run .mark::after { animation: pulse 1.4s ease-in-out infinite; }
.steps .err .mark { border-color: var(--c); }
.steps .err .mark::after { background: var(--c); }

/* -- Hinweise ------------------------------------------------------------------ */
.notice { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); margin: 0 0 12px; font-size: 13px; }
.notice .icon { color: var(--text-3); }
.notice.warn { background: var(--c-bg); border-color: var(--c-line); color: var(--text); }
.notice.warn .icon { color: var(--c); }
.notice.info { background: var(--accent-soft); border-color: var(--accent-line); }
.notice.info .icon { color: var(--accent); }
.notice .grow { flex: 1; }

/* -- Trichter: Longlist bis Priorität 1 ------------------------------------------- */
.funnel { display: flex; align-items: stretch; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); margin-bottom: 16px; overflow-x: auto; }
.funnel > * { flex: 1 1 0; min-width: 130px; padding: 14px 18px; position: relative; text-align: left; font: inherit; color: inherit; background: none; border: 0; border-left: 1px solid var(--line); }
.funnel > :first-child { border-left: 0; }
.funnel button { cursor: pointer; transition: background 150ms; }
.funnel button:hover { background: var(--surface-2); }
.funnel button[aria-pressed="true"] { background: var(--accent-soft); box-shadow: inset 0 -2px 0 var(--accent); }
.funnel .v { display: block; font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.funnel .l { display: block; font-size: 12px; color: var(--text-3); margin-top: 2px; }
.funnel .split { display: flex; gap: 10px; align-items: baseline; }
.funnel .split span { font-size: 22px; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; }
.funnel .split .sa { color: var(--a); } .funnel .split .sb { color: var(--b); } .funnel .split .sc { color: var(--c); }
.funnel .split small { font-size: 12px; font-weight: 500; margin-left: 1px; }

/* -- Werkzeugleiste --------------------------------------------------------------- */
.toolbar {
  position: sticky; top: var(--topbar-h); z-index: 20;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 10px 0;
  background: var(--bg);
}
.search { position: relative; flex: 0 1 320px; min-width: 200px; }
.search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { padding-left: 32px; padding-right: 30px; height: 34px; }
.search kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font: 500 11px var(--font); color: var(--text-3); border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 5px; background: var(--surface-2); }
.search input:focus + kbd, .search input:not(:placeholder-shown) + kbd { display: none; }
.seg { display: inline-flex; max-width: 100%; overflow-x: auto; scrollbar-width: none; background: var(--surface-3); border-radius: var(--radius-sm); padding: 2px; gap: 2px; }
.seg button { font: 500 13px var(--font); color: var(--text-2); background: none; border: 0; height: 30px; padding: 0 11px; border-radius: 5px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }
.seg button .n { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.toolbar .spacer { flex: 1; }
.result-count { font-size: 13px; color: var(--text-3); white-space: nowrap; }
.result-count b { color: var(--text); font-weight: 600; }

/* Aktive Filter */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 0 10px; }
.active-filters:empty { display: none; }
.fchip { display: inline-flex; align-items: center; gap: 4px; height: 26px; padding: 0 4px 0 10px; border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.fchip.neg { background: var(--flag-bg); color: var(--flag); border-color: var(--flag-line); }
.fchip button { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; border: 0; background: none; color: inherit; cursor: pointer; }
.fchip button:hover { background: color-mix(in srgb, currentColor 14%, transparent); }
.linkbtn { background: none; border: 0; padding: 0 4px; font: 500 12px var(--font); color: var(--text-3); cursor: pointer; }
.linkbtn:hover { color: var(--text); text-decoration: underline; }

/* Filterfeld, klappt unter der Werkzeugleiste auf */
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px 28px; padding: 18px 20px; margin: 0 0 12px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); }
.filters[hidden] { display: none; }
.fgroup h3 { font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.fgroup h3 .hint { font-weight: 400; color: var(--text-3); font-size: 11.5px; }
.fgroup.wide { grid-column: span 2; }
@media (max-width: 720px) { .fgroup.wide { grid-column: auto; } }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2); font: 500 12.5px var(--font); cursor: pointer; transition: all 120ms; }
.opt:hover { border-color: var(--text-3); color: var(--text); }
.opt .n { color: var(--text-3); font-weight: 400; font-size: 11.5px; }
.opt .state { display: none; }
.opt[data-state="on"], .opt[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.opt[data-state="on"] .state.on { display: inline; }
.opt[data-state="off"] { background: var(--flag-bg); border-color: var(--flag); color: var(--flag); }
.opt[data-state="off"] .state.off { display: inline; }
.opt[data-state="off"] .lbl { text-decoration: line-through; text-decoration-thickness: 1px; }
.range { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.range input { height: 30px; }
.range .to { color: var(--text-3); }
.fgroup .check { margin-top: 8px; }
.fgroup .stack { display: grid; gap: 8px; }

/* Spaltenauswahl */
.menu { position: relative; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 40; min-width: 220px; padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.menu-pop label { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 5px; cursor: pointer; font-size: 13px; }
.menu-pop label:hover { background: var(--surface-2); }

/* -- Tabellen --------------------------------------------------------------------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td { text-align: left; vertical-align: top; padding: 10px 10px; border-bottom: 1px solid var(--line); }
th { font-size: 12px; font-weight: 500; color: var(--text-3); background: var(--surface-2); white-space: nowrap; padding-top: 9px; padding-bottom: 9px; }
thead th:first-child { border-top-left-radius: var(--radius); }
thead th:last-child { border-top-right-radius: var(--radius); }
tbody:last-child tr:last-child td, tbody tr:last-child td { border-bottom: 0; }
table.plain td { font-size: 13px; }
table.plain tbody tr:hover td { background: var(--surface-2); }
.table-wrap.scroll { overflow-x: auto; }

/* Longlist */
.longlist { table-layout: fixed; min-width: 1180px; }
.longlist thead th { position: sticky; top: calc(var(--topbar-h) + var(--toolbar-h)); z-index: 10; }
.longlist col.c-chk { width: 40px; } .longlist col.c-exp { width: 30px; }
.longlist col.c-name { width: 22%; } .longlist col.c-pass { width: 70px; }
.longlist col.c-desc { width: 27%; } .longlist col.c-ma { width: 88px; }
.longlist col.c-money { width: 100px; } .longlist col.c-ges { width: 17%; }
.longlist col.c-jg { width: 64px; } .longlist col.c-flags { width: 140px; } .longlist col.c-prio { width: 70px; } .longlist col.c-src { width: 104px; }
.longlist th button.sort { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; border-radius: 4px; }
.longlist th button.sort:hover { color: var(--text); }
.longlist th button.sort:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.longlist th button.sort .icon { opacity: 0; transition: opacity 120ms; }
.longlist th button.sort:hover .icon { opacity: .6; }
.longlist th[aria-sort] { color: var(--text); }
.longlist th[aria-sort] button.sort .icon { opacity: 1; color: var(--accent); }
.longlist th.num button.sort { flex-direction: row-reverse; }
.longlist td { font-size: 13px; }
.longlist tbody.cand > tr.main:hover td { background: color-mix(in srgb, var(--surface-2) 70%, var(--surface)); }
.longlist tbody.cand.sel > tr.main td { background: var(--accent-soft); }
.longlist tbody.cand.sel > tr.main td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.longlist tbody.cand.open > tr.main td { border-bottom-color: transparent; }
.longlist tbody.cand.dim .co-name, .longlist tbody.cand.dim .desc, .longlist tbody.cand.dim .num, .longlist tbody.cand.dim .ges { color: var(--text-3); }
.longlist tbody.cand[hidden] { display: none; }
.co-name { font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; }
a.co-name:hover { color: var(--accent); text-decoration: none; }
.co-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.co-meta a { color: var(--text-3); }
.co-meta a:hover { color: var(--accent); }
.co-group { margin-top: 5px; }
.desc .cat { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
.money { display: block; font-weight: 500; }
.money.neg { color: var(--neg); }
.money-y { display: block; font-size: 11.5px; color: var(--text-3); }
.nodata { color: var(--line-strong); }
.ges { font-size: 12.5px; color: var(--text-2); }
.src { font-size: 11.5px; color: var(--text-3); }
.expander { all: unset; cursor: pointer; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; color: var(--text-3); margin-top: 1px; }
.expander:hover { background: var(--surface-3); color: var(--text); }
.expander:focus-visible { outline: 2px solid var(--focus); }
.expander .icon { transition: transform 180ms var(--ease); }
.open .expander .icon { transform: rotate(90deg); }
.chk-cell { padding-right: 0; }
.chk-cell input { margin-top: 3px; }

tr.detail td { padding: 0 10px 16px; background: var(--surface); }
.sel tr.detail td { background: var(--accent-soft); }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 16px 28px; padding: 14px 16px 4px 70px; border-top: 1px dashed var(--line); animation: reveal 220ms var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .detail-grid { animation: none; } }
.detail-grid h4 { margin: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--text-3); }
.detail-grid p, .detail-grid li { font-size: 13px; color: var(--text-2); max-width: 75ch; }
.detail-grid ul { margin: 0; padding-left: 0; list-style: none; display: grid; gap: 6px; }
.detail-grid .blk + .blk { margin-top: 14px; }
.detail-grid .flagline { display: flex; gap: 8px; align-items: baseline; }
.detail-grid .flagline .flag { flex: none; }
.detail-grid .foot { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; }

.empty { padding: 56px 24px; text-align: center; color: var(--text-3); }
.empty h3 { font-size: 15px; color: var(--text); margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }

/* Auswahlleiste unten */
.selbar {
  position: fixed; left: 50%; bottom: 20px; z-index: 50;
  transform: translate(-50%, 0);
  display: flex; align-items: center; gap: 16px;
  padding: 10px 10px 10px 18px;
  background: #151821; color: #f2f4f7;
  border-radius: 12px; box-shadow: var(--shadow-lg);
  transition: transform 260ms var(--ease), opacity 200ms;
  max-width: calc(100vw - 32px);
}
@media (prefers-color-scheme: dark) { .selbar { background: #e8eaef; color: #151821; } }
.selbar[hidden] { display: flex; opacity: 0; transform: translate(-50%, 24px); pointer-events: none; }
.selbar .info { font-size: 13px; white-space: nowrap; }
.selbar .info b { font-weight: 600; }
.selbar .info .muted { color: inherit; opacity: .65; }
.selbar .dirty { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #f5b83d; margin-right: 6px; vertical-align: 1px; }
.selbar .btn.sec { background: transparent; color: inherit; border-color: color-mix(in srgb, currentColor 30%, transparent); box-shadow: none; }
.selbar .btn.sec:hover { background: color-mix(in srgb, currentColor 10%, transparent); }
@media (max-width: 720px) { .selbar { left: 16px; right: 16px; transform: none; flex-wrap: wrap; } .selbar[hidden] { transform: translateY(24px); } }

/* -- Karten und Formulare -------------------------------------------------------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.panel-body { padding: 18px 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.section { margin-top: 32px; }
.section > h2 { margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.section > h2 .n { font-size: 13px; font-weight: 500; color: var(--text-3); }

/* Neue Recherche */
.starter { padding: 20px; }
.starter-row { display: flex; gap: 10px; }
.starter-row input { height: 40px; font-size: 15px; }
.starter details { margin-top: 12px; }
.starter summary { cursor: pointer; font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; list-style: none; }
.starter summary::-webkit-details-marker { display: none; }
.starter summary .icon { transition: transform 180ms var(--ease); }
.starter details[open] summary .icon { transform: rotate(90deg); }
.starter-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px 28px; margin-top: 14px; padding-top: 16px; border-top: 1px solid var(--line); }
.starter-opts .full { grid-column: 1 / -1; }
.starter .hint { margin-top: 10px; font-size: 12.5px; color: var(--text-3); }
.starter .hint b { color: var(--text); font-weight: 600; }
.kosten { margin: 0 0 16px; }
.kosten > summary { cursor: pointer; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 12px 16px; font-size: 13px; }
.kosten > summary::-webkit-details-marker { display: none; }
.kosten > summary .icon { transition: transform 180ms var(--ease); color: var(--text-3); }
.kosten[open] > summary .icon { transform: rotate(90deg); }
.kosten > summary b { font-weight: 600; }
.kosten-body { border-top: 1px solid var(--line); overflow-x: auto; }
.kosten-body table { width: 100%; }
.kosten-body tfoot td { border-top: 1px solid var(--line); }
.kosten-body .hint { padding: 10px 16px 14px; font-size: 12.5px; color: var(--text-3); }
.opt input { position: absolute; opacity: 0; pointer-events: none; }
.opt:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.opt:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.opt { position: relative; }

/* Liste der Recherchen */
.rlist td { vertical-align: middle; padding-top: 12px; padding-bottom: 12px; }
.rlist .title { font-weight: 600; color: var(--text); font-size: 14px; }
.rlist tr { cursor: pointer; }
.rlist .mini-steps { display: flex; gap: 3px; margin-top: 6px; }
.rlist .mini-steps i { width: 18px; height: 3px; border-radius: 2px; background: var(--line); }
.rlist .mini-steps i.on { background: var(--accent); }
.rlist .mini-steps.err i.on { background: var(--c); }

/* -- Unternehmensdetail --------------------------------------------------------------- */
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
@media (max-width: 1080px) { .detail-layout { grid-template-columns: minmax(0, 1fr); } .facts { position: static; } }
.facts { padding: 6px 20px; position: sticky; top: calc(var(--topbar-h) + 20px); }
.facts dl { margin: 0; }
.facts div { display: grid; grid-template-columns: 110px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--text-3); }
.facts dd { margin: 0; color: var(--text); overflow-wrap: break-word; hyphens: auto; min-width: 0; }
.prose { font-size: 14px; line-height: 1.6; color: var(--text-2); max-width: 75ch; }
.kz th:first-child, .kz td:first-child { position: sticky; left: 0; background: inherit; }
.kz td.num { font-weight: 500; }
.kz td .src-note { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); }
.cand-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.cand-card:last-child { border-bottom: 0; }
.funde-group + .funde-group { border-top: 1px solid var(--line); }
.funde-group summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; padding: 12px 20px; font-weight: 500; font-size: 13px; }
.funde-group summary::-webkit-details-marker { display: none; }
.funde-group summary .icon { transition: transform 180ms var(--ease); color: var(--text-3); }
.funde-group[open] summary .icon { transform: rotate(90deg); }
.funde-group ul { list-style: none; margin: 0; padding: 0 20px 12px 46px; display: grid; gap: 12px; }
.funde-group li { font-size: 13px; color: var(--text-2); }
.funde-group li .q { font-size: 12px; color: var(--text-3); }
.funde-group li a { word-break: break-all; }

@media (max-width: 720px) {
  main { padding: 20px 16px 120px; }
  .topbar { padding: 0 16px; gap: 16px; }
  .brand small { display: none; }
  .toolbar { position: static; }
  .longlist thead th { position: static; }
  .table-wrap.ll { overflow-x: auto; }
  .detail-grid { grid-template-columns: 1fr; padding-left: 16px; }
  .starter-row { flex-direction: column; }
  .search { flex: 1 1 100%; }
  h1 { font-size: 20px; }
  .steps li + li::before { width: 10px; margin: 0 6px; }
  .page-head { gap: 14px; }
}
@media (max-width: 1260px) {
  .table-wrap.ll { overflow-x: auto; }
  .longlist thead th { position: static; }
}

.grow-sig { color: var(--a); font-weight: 600; }
.whoami { margin-left: auto; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.whoami a { color: inherit; text-decoration: none; }
.such-hinweise { margin: 6px 0 0; padding-left: 18px; }
.such-hinweise li { margin: 2px 0; }
.whoami a:hover { text-decoration: underline; }
.login { max-width: 380px; margin: 64px auto; padding: 24px; }
.login .field { margin-top: 12px; }
.login input { width: 100%; }
.login .btn { margin-top: 18px; width: 100%; justify-content: center; }
.admin-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; padding: 16px 20px; }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-3); }
.admin-form select, .admin-form input:not([type=checkbox]) { width: auto; }
