/* Kommunale Haushalte — flat/minimalist theme (plan §3.1).
   Modelled on ops_auth_pages.css; deliberately NOT the space chrome (no #stars,
   no cyan, no Courier). Light, calm, data-first. */
:root {
  --bg:#eef1f2; --surface:#ffffff; --surface-2:#f7f9fa;
  --text:#1a252f; --muted:#61707c; --faint:#8a97a1;
  --primary:#1c8f75; --primary-dark:#146b58;
  --border:#dbe1e5; --border-strong:#c2ccd2;
  --pos:#1c8f75; --neg:#c0392b; --neutral:#8a97a1;
  --radius:12px; --radius-sm:8px;
  --shadow:0 1px 2px rgba(20,40,55,.05), 0 1px 3px rgba(20,40,55,.04);
  --mono:"SFMono-Regular",ui-monospace,Menlo,Consolas,monospace;
}
* { box-sizing:border-box; }
html,body { margin:0; padding:0; }
body.haushaltePage {
  background:var(--bg); color:var(--text);
  font-family:"Segoe UI",system-ui,-apple-system,"Helvetica Neue",sans-serif;
  font-size:14px; line-height:1.45; -webkit-font-smoothing:antialiased;
}
a { color:var(--primary-dark); text-decoration:none; }
a:hover { text-decoration:underline; }
h1,h2,h3 { margin:0; font-weight:600; }

/* ---- top bar + tabs ---- */
.topbar { background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:0; z-index:20; }
.topbar-inner { max-width:1180px; margin:0 auto; padding:14px 22px; display:flex; align-items:baseline; gap:16px; flex-wrap:wrap; }
.topbar h1 { font-size:18px; letter-spacing:-.01em; }
.topbar .sub { color:var(--muted); font-size:13px; }
.tabs { max-width:1180px; margin:0 auto; padding:0 22px; display:flex; gap:2px; }
.tab { appearance:none; background:none; border:none; padding:11px 16px; font:inherit; font-size:14px;
  color:var(--muted); cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-1px; }
.tab:hover { color:var(--text); }
.tab.active { color:var(--primary-dark); border-bottom-color:var(--primary); font-weight:600; }
.tabstrip { background:var(--surface); border-bottom:1px solid var(--border); position:sticky; top:49px; z-index:19; }

main { max-width:1180px; margin:20px auto; padding:0 22px 60px; }
.view { display:none; }
.view.active { display:block; }

/* ---- cards / layout ---- */
.card { background:var(--surface); border:1px solid var(--border); border-radius:var(--radius);
  box-shadow:var(--shadow); padding:18px 20px; margin-bottom:18px; }
.card h2 { font-size:15px; margin-bottom:12px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:820px){ .grid2 { grid-template-columns:1fr; } }
.row { display:flex; gap:20px; flex-wrap:wrap; align-items:center; }
.spacer { flex:1; }

/* ---- stat tiles ---- */
.stats { display:flex; gap:34px; flex-wrap:wrap; }
.stat b { display:block; font-size:24px; font-weight:600; font-variant-numeric:tabular-nums; }
.stat span { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.05em; }

/* ---- map ---- */
#map { height:560px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); }
#detailMap { height:220px; border-radius:var(--radius-sm); overflow:hidden; border:1px solid var(--border); }
.maplibregl-popup-content { font-family:inherit; font-size:13px; border-radius:8px; padding:8px 12px; }
.legend { display:flex; align-items:center; gap:8px; font-size:12px; color:var(--muted); margin-top:10px; }
.legend .bar { height:10px; width:180px; border-radius:5px;
  background:linear-gradient(90deg,#c0392b,#e0a94b,#f2f2f2,#7fc0a8,#1c8f75); }

/* ---- tables ---- */
table { width:100%; border-collapse:collapse; }
th,td { text-align:left; padding:9px 10px; border-bottom:1px solid var(--border); vertical-align:middle; }
thead th { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; font-weight:600; }
tbody tr:hover { background:var(--surface-2); }
td.num,th.num { text-align:right; font-variant-numeric:tabular-nums; }
.clickrow { cursor:pointer; }
.neg { color:var(--neg); } .pos { color:var(--pos); }

/* ---- pills / badges ---- */
.pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:11px; font-weight:600;
  background:var(--surface-2); color:var(--muted); border:1px solid var(--border); }
.pill.src-component { background:#eef6f3; color:var(--primary-dark); border-color:#cfe6dd; }
.pill.marked { background:#eef6f3; color:var(--primary-dark); border-color:#cfe6dd; }
.pill.konto { background:#f3f0fa; color:#6b4fa0; border-color:#e0d8f2; }
.pill.einmalig { background:#fbf3e8; color:#a06a1c; border-color:#f0e0c4; }

/* ---- pies (hand SVG) ---- */
.pies { display:grid; grid-template-columns:1fr 1fr; gap:18px; }
@media (max-width:820px){ .pies { grid-template-columns:1fr; } }
.pie-wrap { display:flex; gap:16px; align-items:center; }
.pie-legend { flex:1; font-size:12.5px; }
.pie-legend .li { display:flex; align-items:center; gap:8px; padding:3px 0; cursor:pointer; border-radius:6px; }
.pie-legend .li:hover { background:var(--surface-2); }
.pie-legend .sw { width:11px; height:11px; border-radius:3px; flex:none; }
.pie-legend .lbl { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pie-legend .val { color:var(--muted); font-variant-numeric:tabular-nums; }
svg.pie path { cursor:pointer; transition:opacity .12s; }
svg.pie path:hover { opacity:.82; }
.pie-title { font-weight:600; font-size:13.5px; margin-bottom:8px; cursor:pointer;
  display:inline-flex; align-items:center; gap:4px; color:var(--text);
  padding:2px 8px; margin-left:-8px; border-radius:6px; transition:background .12s; }
.pie-title:hover { background:var(--surface-2); color:var(--primary-dark); }

/* ---- percentile bars (itemized list) ---- */
.itemized { width:100%; }
.itemized .head, .itemized .r {
  display:grid; grid-template-columns:minmax(180px,1.4fr) 3fr 120px 96px 64px; gap:12px;
  align-items:center; padding:8px 4px; border-bottom:1px solid var(--border); }
.itemized .head { color:var(--muted); font-size:11px; text-transform:uppercase; letter-spacing:.04em; }
.itemized .r .lbl { font-size:13.5px; }
.itemized .num { text-align:right; font-variant-numeric:tabular-nums; }
.itemized .itm-subhead { font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--muted);
  font-weight:600; margin:14px 0 4px; padding-top:10px; border-top:1px dashed var(--border); }
/* detail header: two stacked rows. Row 1 = commune name (left) ↔ Haushaltsjahr (right);
   row 2 = Vergabe/Personen buttons (left) ↔ Haushalt tiles (right). Each row top-aligns its two
   cells so the year is flush with the name and the tile numbers are flush with the button tops. */
.detail-head { display:flex; flex-direction:column; gap:16px; }
.dh-row { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.dh-name { min-width:0; }
.dh-name h2 { margin:0 0 4px; }
.detail-actions { display:flex; gap:10px; align-items:stretch; flex-wrap:wrap; }
.detail-actions .verg-detail-link { margin-left:0; }
.dh-metrics .stats { justify-content:flex-end; }
.detail-jahr { font-size:12px; text-transform:uppercase; letter-spacing:.1em; color:var(--muted); font-weight:600;
  text-align:right; line-height:1.1; }
.detail-jahr b { display:block; font-size:28px; letter-spacing:-.01em; color:var(--text); font-weight:700;
  font-variant-numeric:tabular-nums; margin-top:2px; }
/* Vergaben deep-link badge on the commune detail header */
.verg-detail-link { display:inline-flex; align-items:center; gap:11px; text-decoration:none; color:var(--text);
  border:1px solid var(--border); border-radius:12px; padding:8px 14px; background:var(--surface-2);
  margin-left:10px; transition:border-color .15s ease, background .15s ease; }
.verg-detail-link:hover { border-color:var(--primary); background:var(--surface); }
.verg-detail-link.empty { opacity:.55; }
.vdl-num { font-size:22px; font-weight:700; font-variant-numeric:tabular-nums; color:var(--primary);
  min-width:1.3em; text-align:center; }
.verg-detail-link.empty .vdl-num { color:var(--muted); }
.vdl-lbl { font-size:12px; line-height:1.25; color:var(--muted); }
.vdl-lbl small { color:var(--primary); }
button.verg-detail-link { cursor:pointer; font:inherit; }
.vdl-person { width:22px; height:22px; stroke:var(--primary); flex:none; }
/* Personen modal */
.modal-lg { max-width:720px; width:94vw; }
.p-section { border:1px solid var(--border); border-radius:10px; margin-bottom:10px; overflow:hidden; }
.p-sechead { width:100%; display:flex; align-items:center; gap:10px; padding:10px 14px; cursor:pointer;
  background:var(--fc); color:var(--ft); border:none; font:inherit; font-weight:650; text-align:left; }
.p-secname { flex:1; font-size:14px; }
.p-seccount { font-variant-numeric:tabular-nums; font-size:12.5px; background:rgba(127,127,127,.28);
  padding:1px 9px; border-radius:999px; }
.p-chev { width:15px; height:15px; stroke:currentColor; transition:transform .18s ease; opacity:.85; }
.p-section.open .p-chev { transform:rotate(180deg); }
.p-secbody { display:none; padding:2px 14px 6px; }
.p-section.open .p-secbody { display:block; }
.p-member { padding:9px 0; border-bottom:1px solid var(--border); }
.p-member:last-child { border-bottom:none; }
.p-main { display:flex; align-items:baseline; gap:10px; flex-wrap:wrap; }
.p-name { font-weight:600; font-size:14px; }
.p-role { font-size:12px; color:var(--muted); }
.p-contacts { display:flex; flex-wrap:wrap; gap:4px 14px; margin-top:3px; font-size:12px; }
.p-contacts a, .p-contacts .pc { color:var(--muted); text-decoration:none; }
.p-contacts a:hover { color:var(--primary); text-decoration:underline; }
.p-nocontact { font-style:italic; opacity:.6; }
.p-comm { display:flex; flex-wrap:wrap; gap:5px; margin-top:6px; }
.p-tag { font-size:11px; background:var(--surface-2); border:1px solid var(--border); color:var(--muted);
  padding:1px 8px; border-radius:999px; }
@media (prefers-reduced-motion:reduce){ .p-chev { transition:none; } }
.pbar { position:relative; height:20px; background:var(--surface-2); border-radius:5px; border:1px solid var(--border); }
.pbar .fill { position:absolute; left:0; top:0; bottom:0; border-radius:5px 0 0 5px; opacity:.85; }
.pbar .median { position:absolute; top:-2px; bottom:-2px; width:2px; background:var(--text); opacity:.55; }
.pbar .val { position:absolute; top:-3px; bottom:-3px; width:3px; background:var(--primary-dark); border-radius:2px; }
.pbar .cap { position:absolute; top:1px; font-size:11px; color:var(--muted); }
.pbar.na { background:repeating-linear-gradient(45deg,#f4f6f7,#f4f6f7 6px,#eef1f2 6px,#eef1f2 12px); }
.itemized .r.flash { animation:rowflash 1.8s ease-out 1; }
@keyframes rowflash { 0%{ background:#fff3d6; } 100%{ background:transparent; } }

/* ---- detail-view Investitionen preview + filter chip ---- */
.inv-mini { display:flex; gap:10px; align-items:baseline; padding:4px 0; border-bottom:1px solid var(--border); font-size:13px; }
.inv-mini .l { flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.inv-mini .a { font-variant-numeric:tabular-nums; color:var(--muted); flex:none; }
.inv-link { display:inline-block; margin-top:10px; font-size:13px; font-weight:600; }
.filter-chip { display:inline-flex; align-items:center; gap:8px; margin-bottom:12px;
  background:#eef6f3; color:var(--primary-dark); border:1px solid #cfe6dd; border-radius:999px;
  padding:5px 12px; font-size:13px; }
.filter-chip .x { cursor:pointer; font-weight:700; opacity:.7; }
.filter-chip .x:hover { opacity:1; }

/* ---- Landeshaushalte (Stadtstaaten) ---- */
.land-marker { background:#c9a227; color:#3a2c00; font-weight:700; font-size:12px;
  padding:3px 9px; border-radius:999px; border:2px solid #fff; cursor:pointer; white-space:nowrap;
  box-shadow:0 1px 4px rgba(20,40,55,.35); }
.land-marker:hover { background:#dcb62f; }
.pill.land-pill { background:#f7efd4; color:#7a5c00; border-color:#e6d59a; }
.card.caveat { background:#fbf6e6; border-color:#ecdca0; color:#6a5320; font-size:13px; }
.lbar { display:grid; grid-template-columns:minmax(120px,1.5fr) 3fr 120px; gap:10px; align-items:center;
  padding:5px 2px; border-bottom:1px solid var(--border); font-size:13px; }
.lbar-l { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.lbar-track { height:14px; background:var(--surface-2); border-radius:5px; border:1px solid var(--border); overflow:hidden; }
.lbar-fill { height:100%; background:var(--primary); }
.lbar-v { text-align:right; font-variant-numeric:tabular-nums; color:var(--muted); }

/* ---- controls ---- */
.controls { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:14px; }
.seg { display:inline-flex; border:1px solid var(--border); border-radius:8px; overflow:hidden; }
.seg button { appearance:none; background:var(--surface); border:none; padding:7px 13px; font:inherit; font-size:13px;
  color:var(--muted); cursor:pointer; border-right:1px solid var(--border); }
.seg button:last-child { border-right:none; }
.seg button.active { background:var(--primary); color:#fff; }
input.search { padding:8px 12px; border:1px solid var(--border); border-radius:8px; font:inherit; min-width:220px; }

/* ---- misc ---- */
.note { color:var(--muted); font-size:13px; }
.loading { color:var(--faint); padding:24px; text-align:center; }
.back { cursor:pointer; color:var(--muted); font-size:13px; margin-bottom:12px; display:inline-flex; gap:6px; }
.back:hover { color:var(--text); }
.progress { height:8px; background:var(--surface-2); border-radius:5px; overflow:hidden; border:1px solid var(--border); }
.progress .fill { height:100%; background:var(--primary); }
.empty { text-align:center; padding:40px 20px; color:var(--muted); }

/* ---- Vergaben: chain cards + stepper (task 7/8) ---- */
.chain-card { border:1px solid var(--border); border-radius:var(--radius-sm); margin-bottom:10px; background:var(--surface); }
.chain-head { display:flex; align-items:center; gap:12px; padding:12px 14px; cursor:pointer; }
.chain-head:hover { background:var(--surface-2); }
.chain-vol { font-variant-numeric:tabular-nums; font-weight:600; }
.chain-meta { padding:0 14px 10px; }
/* Vergabe-Chance controls + traffic-light */
.verg-ctrl { display:inline-flex; align-items:center; gap:6px; font-size:13px; color:var(--muted); }
.verg-ctrl select { padding:6px 9px; border:1px solid var(--border); border-radius:8px; font:inherit; font-size:13px;
  background:var(--surface); color:var(--text); cursor:pointer; }
.verg-hint { margin:8px 0 14px; max-width:640px; line-height:1.45; }
.prob-badge { display:inline-flex; align-items:center; gap:6px; font-size:12px; font-weight:600;
  padding:2px 9px; border-radius:999px; font-variant-numeric:tabular-nums; white-space:nowrap; }
.pb-dot { width:8px; height:8px; border-radius:50%; background:currentColor; flex:0 0 auto; }
.pb-hoch   { background:#eaf7ef; color:#1a8a52; }
.pb-mittel { background:#fbf4e6; color:#b3801a; }
.pb-gering { background:#f2f0f5; color:#7d768c; }
.pb-done   { background:#eef7f2; color:#146b58; }
.pb-na     { background:transparent; color:var(--faint); }
.prob-summary { margin:2px 0 12px; font-size:13px; display:flex; align-items:center; gap:8px; flex-wrap:wrap; }
/* imputed volume band (task C) — visually softer than a parsed figure */
.vol-est { font-weight:600; color:var(--muted); font-variant-numeric:tabular-nums; }
.gesch { font-size:10px; font-weight:600; text-transform:uppercase; letter-spacing:.03em; color:var(--faint);
  border:1px solid var(--border); border-radius:4px; padding:0 4px; }
/* info icon + explanatory modal (Vergabe-Wahrscheinlichkeit) */
.prob-info { flex:0 0 auto; width:18px; height:18px; border-radius:50%; border:1px solid var(--border);
  background:var(--surface-2); color:var(--muted); font-size:11px; font-weight:700; line-height:1;
  cursor:pointer; padding:0; display:inline-flex; align-items:center; justify-content:center; }
.prob-info:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
.modal-overlay { display:none; position:fixed; inset:0; z-index:1000; background:rgba(0,0,0,.45);
  align-items:center; justify-content:center; padding:20px; }
.modal-box { background:var(--surface); color:var(--text); border:1px solid var(--border);
  border-radius:12px; max-width:560px; width:100%; max-height:85vh; overflow:auto; box-shadow:0 12px 40px rgba(0,0,0,.3); }
.modal-head { display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:14px 18px; border-bottom:1px solid var(--border); position:sticky; top:0; background:var(--surface); }
.modal-head h3 { margin:0; font-size:15px; }
.modal-x { appearance:none; border:none; background:none; font-size:22px; line-height:1; cursor:pointer;
  color:var(--muted); padding:0 4px; }
.modal-x:hover { color:var(--text); }
.modal-body { padding:16px 18px; font-size:13.5px; line-height:1.5; }
.modal-body p { margin:0 0 11px; }
.modal-caveat { border-left:3px solid var(--primary); padding-left:10px; color:var(--muted); }
.verif-legend-h { font-size:11px; letter-spacing:.12em; text-transform:uppercase; color:var(--muted);
  font-weight:600; margin:16px 0 8px; }
.verif-row .verg-ctrl { flex-wrap:wrap; }
/* coverage funnel (Karte) */
.funnel-title { font-size:15px; font-weight:650; margin:0; }
.funnel { display:flex; flex-direction:column; gap:9px; margin-top:8px; }
.funnel-row { display:grid; grid-template-columns:220px 1fr 128px; align-items:center; gap:12px; }
.funnel-label { font-size:13px; color:var(--text); }
.funnel-track { height:20px; background:var(--surface-2); border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.funnel-bar { height:100%; border-radius:5px 6px 6px 5px; min-width:2px; }
.funnel-val { font-size:12.5px; text-align:right; font-variant-numeric:tabular-nums; }
.funnel-val b { font-weight:650; }
.funnel-pct { color:var(--muted); margin-left:7px; }
@media (max-width:640px){ .funnel-row { grid-template-columns:128px 1fr 94px; gap:8px; } .funnel-label{ font-size:12px; } }
@media (prefers-reduced-motion:no-preference){ .funnel-bar { transition:width .5s ease; } }
.funnel-i { border:none; background:none; cursor:pointer; color:var(--muted); font:italic 600 12px Georgia,"Times New Roman",serif;
  padding:0 3px; margin-left:3px; border-radius:50%; }
.funnel-i:hover, .funnel-i.open { color:var(--primary); }
.funnel-desc { font-size:12px; color:var(--muted); line-height:1.5; padding:2px 0 6px 2px; max-width:74ch; }
/* verification: icon (not colour) differentiates the certainty tiers */
.verifchk .vicon { display:inline-block; min-width:1.5em; text-align:center; font-weight:700; color:var(--text); }
/* Jahresergebnis-je-Einwohner histogram */
.histogram { margin-top:10px; }
.hist-chart { display:flex; align-items:flex-end; gap:2px; border-bottom:1px solid var(--border); }
.hbar-wrap { flex:1; display:flex; align-items:flex-end; justify-content:center; height:100%; }
.hbar { width:100%; border-radius:3px 3px 0 0; }
.hist-axis { display:flex; justify-content:space-between; font-size:11px; color:var(--muted); margin-top:5px; font-variant-numeric:tabular-nums; }
.hist-foot { margin-top:9px; }
.verg-ctrl select { padding:5px 8px; }
.chain-detail { padding:0 14px; }
.chain-card.open .chain-detail { padding:6px 14px 16px; border-top:1px solid var(--border); }
.stage-pill { font-size:11px; font-weight:600; padding:2px 9px; border-radius:999px; }
.s-bedarf{ background:#eef2f6; color:#5b6b78; } .s-studie{ background:#eaf1fb; color:#2f6fb5; }
.s-beschluss{ background:#f3eefa; color:#6b4fa0; } .s-planung{ background:#fbf3e8; color:#a06a1c; }
.s-vergabe{ background:#eef7f2; color:#146b58; }
.stepper { display:flex; flex-direction:column; margin-top:6px; }
.step { display:flex; gap:14px; }
.step-rail { display:flex; flex-direction:column; align-items:center; width:22px; flex:none; }
.step-rail .dot { width:18px; height:18px; border-radius:50%; border:2px solid var(--border-strong);
  background:var(--surface); display:flex; align-items:center; justify-content:center; font-size:11px; color:#fff; z-index:1; }
.step-rail .line { width:2px; flex:1; min-height:14px; background:var(--border); }
.step.done .dot { background:var(--primary); border-color:var(--primary); }
.step.done .line { background:var(--primary); }
.step.current .dot { border-color:var(--primary); box-shadow:0 0 0 4px rgba(28,143,117,.18); }
.step.upcoming .dot { background:var(--surface); }
.step-body { padding-bottom:12px; flex:1; }
.step-title { font-weight:600; font-size:13.5px; }
.step-title .now { font-size:10px; font-weight:700; color:var(--primary-dark); background:#eef7f2;
  padding:1px 6px; border-radius:999px; margin-left:6px; }
.step-doc { display:flex; gap:8px; font-size:12.5px; padding:2px 0; }
.step-doc .d { color:var(--faint); font-variant-numeric:tabular-nums; flex:none; width:76px; }
.ki-btn { appearance:none; border:1px solid var(--primary); background:var(--primary); color:#fff;
  padding:8px 14px; border-radius:8px; font:inherit; font-size:13px; cursor:pointer; }
.ki-btn:hover { background:var(--primary-dark); }
.ki-btn:disabled { opacity:.6; cursor:default; }
.ki-out { flex:1; }
.ki-result { background:var(--surface-2); border:1px solid var(--border); border-radius:8px;
  padding:12px 14px; margin-top:10px; font-size:13.5px; line-height:1.55; }

/* ---- KI model picker ---- */
.model-pick { padding:6px 10px; border:1px solid var(--border); border-radius:8px; font:inherit;
  font-size:12.5px; min-width:240px; }

/* ---- multi-year line chart (lazy, per line item) ---- */
.lbl.chartable { cursor:pointer; }
.lbl.chartable:hover { color:var(--primary-dark); }
.chart-hint { font-size:11px; opacity:.55; }
.lbl.chartable:hover .chart-hint { opacity:1; }
.series-host { padding:6px 4px 14px; border-bottom:1px solid var(--border); }
.series-head { display:flex; align-items:center; justify-content:space-between; gap:12px;
  margin:2px 0 6px; font-size:13px; flex-wrap:wrap; }
.seg.mini button { padding:4px 9px; font-size:12px; }
.linechart { display:block; background:var(--surface-2); border:1px solid var(--border); border-radius:8px; padding:4px; }

/* itemized grid: keep the row grid intact on narrow screens (scroll instead of stacking) */
.itemized { overflow-x:auto; }
.itemized .head, .itemized .r { min-width:560px; }
.series-host { min-width:560px; }
@media (max-width:640px){
  .itemized .head, .itemized .r { grid-template-columns:minmax(120px,1.4fr) 2.2fr 96px 80px 52px; gap:8px; }
}

/* ---- Investitionen filter bar ---- */
#invYear { display:block; }   /* override .controls flex so filter rows stack */
.inv-filters { display:flex; gap:16px; flex-wrap:wrap; align-items:flex-end; margin-bottom:8px; }
.inv-f { display:flex; flex-direction:column; gap:4px; }
.inv-f > span { font-size:11px; color:var(--muted); text-transform:uppercase; letter-spacing:.04em; }
.inv-f input.search { min-width:210px; }
.checks { display:flex; gap:12px; flex-wrap:wrap; padding-bottom:4px; }
.chk { display:inline-flex; align-items:center; gap:5px; font-size:12.5px; cursor:pointer; white-space:nowrap; }
.chk input { accent-color:var(--primary); }
.chips-row { display:flex; gap:8px; flex-wrap:wrap; margin:2px 0 6px; }
.chips-row:empty { display:none; }
.seg.multi { border:none; overflow:visible; flex-wrap:wrap; gap:6px; }
.seg.multi button { border:1px solid var(--border); border-radius:8px; }
.seg.multi button.active { background:var(--primary); color:#fff; border-color:var(--primary); }
.seg.multi .cnt { opacity:.55; font-size:10px; margin-left:5px; font-variant-numeric:tabular-nums; }

/* Vergabekategorie facet pill (bottom-up taxonomy) */
.cat-pill{display:inline-block;padding:1px 7px;border-radius:10px;background:var(--ops-primary,#1c8f75);
  color:#fff;font-size:11px;font-weight:600;white-space:nowrap}

/* Vergaben map (above the filters + list) */
#vergabenMapWrap { margin:6px 0 14px; }
#vergabenMap { height:420px; border-radius:var(--radius); overflow:hidden; border:1px solid var(--border); }
.verg-maplegend { margin-top:8px; font-size:12px; color:#5a6b76; display:flex; gap:14px;
  align-items:center; flex-wrap:wrap; }
.verg-marker { display:flex; align-items:center; justify-content:center; border-radius:50%;
  color:#fff; font-weight:700; font-size:12px; border:2px solid #fff;
  box-shadow:0 1px 3px rgba(0,0,0,.35); cursor:pointer; line-height:1; }
.verg-marker.sel { outline:3px solid #1c8f75; outline-offset:1px; }
.verg-unitchip { background:#1c8f75; color:#fff; padding:1px 8px; border-radius:10px;
  cursor:pointer; font-weight:600; }
.verg-legscale { display:inline-flex; align-items:center; gap:6px; }
.verg-legscale i { display:inline-block; width:90px; height:10px; border-radius:5px;
  background:linear-gradient(90deg,#d1495b,#e6a800,#2e8b57); }

/* Vergaben category multi-select + category-mix pie markers */
.verg-multi { position:relative; display:inline-flex; align-items:center; gap:6px; }
.verg-catbtn { cursor:pointer; padding:3px 10px; border:1px solid var(--border); border-radius:6px;
  background:#fff; font:inherit; max-width:220px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.verg-catpanel { position:absolute; top:100%; left:0; z-index:20; margin-top:4px; max-height:300px;
  overflow:auto; background:#fff; border:1px solid var(--border); border-radius:8px;
  box-shadow:0 4px 14px rgba(0,0,0,.15); padding:6px; min-width:270px; }
.verg-catopt { display:flex; align-items:center; gap:6px; padding:3px 6px; font-size:13px;
  cursor:pointer; white-space:nowrap; }
.verg-catopt:hover { background:var(--surface-2); border-radius:5px; }
.verg-catopt .sw { width:11px; height:11px; border-radius:3px; flex:none; }
.verg-catopt i { color:#8a97a1; font-style:normal; }
.verg-marker.pie { color:#111; }
.verg-pienum { background:#fff; border-radius:50%; width:62%; height:62%; display:flex;
  align-items:center; justify-content:center; font-size:11px; font-weight:700; }
.verg-catlegend { display:inline-flex; gap:10px; flex-wrap:wrap; align-items:center; }
.verg-catlegend .sw { display:inline-block; width:11px; height:11px; border-radius:3px;
  margin-right:3px; vertical-align:-1px; }

/* Vergabe-Chance tier checkboxes (colour-coded) + commune availability annotation */
.tierchk input { accent-color:var(--tc); }
.tierchk span { border-bottom:2px solid var(--tc); padding-bottom:1px; }
.verg-catopt.unavail { opacity:.42; }
.verg-catopt .here { color:#8a97a1; font-style:normal; margin-left:2px; }
