/* Messe-Radar web app. One stylesheet; colours come from the theme (:root custom properties written by
   app/theme.py), status colours are fixed. Inter for text and numbers, the theme's display font for h1 and the
   wordmark only (20 px and up). No framework. */

/* ------------------------------------------------------------------ fonts (self-hosted, OFL) */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/inter-500.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "Poppins"; font-style: normal; font-weight: 600; font-display: swap; src: url("../fonts/poppins-600.woff2") format("woff2"); }

/* ------------------------------------------------------------------ fallbacks when the theme block is missing */
:root {
  --brand-800: #2F365A; --brand-700: #434D7A; --brand-500: #828CB7; --brand-100: #E9EBF4; --brand-50: #F3F4F9;
  --link: #333399; --ink: #333333; --text: #545454; --text-muted: #5F6470; --bg: #F7F7F7; --surface: #FFFFFF;
  --line: #DDDFE6; --input-border: #8C91A6;
  --ok: #1E6B34; --ok-bg: #E7F3EA; --ok-line: #2E7D4F; --warn: #8A5300; --warn-bg: #FFF3D6; --warn-line: #A86B12;
  --nf: #5F6368; --nf-bg: #F1F3F4; --nf-line: #858B99; --err: #B3261E; --err-bg: #FCE8E6; --err-line: #D93025;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-body); --display-weight: 600;
  --radius: 8px; --radius-lg: 12px; --radius-pill: 999px;
  --shadow-1: 0 1px 2px rgba(31, 35, 58, .06), 0 1px 1px rgba(31, 35, 58, .04);
  --shadow-2: 0 6px 24px rgba(31, 35, 58, .10), 0 2px 6px rgba(31, 35, 58, .06);
  --focus: 0 0 0 2px var(--surface), 0 0 0 4px var(--brand-500);
  --page-max: 1200px; --gutter: 24px;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 15px; line-height: 1.55;
  font-feature-settings: "cv11" 1; -webkit-font-smoothing: antialiased; min-height: 100vh; display: flex; flex-direction: column;
}
img, svg { max-width: 100%; }
a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
b, strong { font-weight: 600; color: var(--ink); }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .88em; background: var(--brand-50); padding: 1px 5px; border-radius: 4px; color: var(--ink); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0; font-weight: 600; }
h1 { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 28px; letter-spacing: -.01em; color: var(--brand-800); }
h2 { font-size: 19px; letter-spacing: -.005em; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }
p { margin: 0 0 .75em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
::selection { background: var(--brand-100); color: var(--ink); }
.skip { position: absolute; left: 12px; top: -48px; background: var(--brand-800); color: #fff; padding: 8px 14px; border-radius: var(--radius); z-index: 100; text-decoration: none; }
.skip:focus { top: 12px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
[hidden] { display: none !important; }
.t-muted { color: var(--text-muted); }
.t-nf { color: var(--nf); font-style: italic; font-size: 13px; }
.t-warn { color: var(--warn); }
.t-num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.plain { list-style: none; padding: 0; margin: 0; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }

/* ------------------------------------------------------------------ top bar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.topbar__inner { max-width: var(--page-max); margin: 0 auto; padding: 0 var(--gutter); display: flex; align-items: center; gap: 28px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--brand-800); flex: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__logo { height: 38px; width: auto; max-width: 180px; object-fit: contain; }
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__client { font-size: 12px; font-weight: 500; color: var(--text-muted); letter-spacing: .01em; }
.brand__product { font-family: var(--font-display); font-weight: var(--display-weight); font-size: 20px; color: var(--brand-800); letter-spacing: -.01em; }
.nav { flex: 1; min-width: 0; }
.nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; }
.nav a {
  display: block; padding: 21px 12px 19px; color: var(--text); text-decoration: none; font-weight: 500; font-size: 14.5px;
  border-bottom: 3px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--brand-800); background: var(--brand-50); }
.nav a[aria-current="page"] { color: var(--brand-800); border-bottom-color: var(--brand-700); }
.userbox { display: flex; align-items: center; gap: 10px; flex: none; }
.userbox__name { font-size: 13.5px; color: var(--text-muted); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.userbox form { margin: 0; }
a.userbox__name { color: var(--text-muted); text-decoration: none; }
a.userbox__name:hover, a.userbox__name[aria-current] { color: var(--ink); text-decoration: underline; }

/* ------------------------------------------------------------------ page */
.page { flex: 1; width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 28px var(--gutter) 56px; outline: none; }
.page__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page__lead { color: var(--text-muted); max-width: 70ch; margin: 6px 0 0; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 13.5px; color: var(--text-muted); margin-bottom: 10px; flex-wrap: wrap; }
.crumbs a { color: var(--text-muted); }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 60vw; }
.section { margin: 28px 0; }
.section__title { font-size: 16px; margin-bottom: 12px; }
.footer { border-top: 1px solid var(--line); background: var(--surface); }
.footer__inner { max-width: var(--page-max); margin: 0 auto; padding: 16px var(--gutter); display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--text-muted); }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 16px;
  border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 500; font-size: 14.5px; line-height: 1.2;
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn .icon { width: 17px; height: 17px; }
.btn--primary { background: var(--brand-700); color: #fff; }
.btn--primary:hover { background: var(--brand-800); }
.btn--secondary { background: var(--surface); color: var(--brand-800); border-color: var(--brand-700); }
.btn--secondary:hover { background: var(--brand-50); }
.btn--quiet { background: transparent; color: var(--brand-800); border-color: var(--line); }
.btn--quiet:hover { background: var(--brand-50); border-color: var(--brand-500); }
.btn--danger { color: var(--err); }
.btn--danger:hover { background: var(--err-bg); border-color: var(--err-line); }
.btn--sm { min-height: 34px; padding: 6px 12px; font-size: 13.5px; }
.btn--lg { min-height: 48px; padding: 12px 22px; font-size: 15.5px; }
.btn--block { width: 100%; }
.btn[disabled], .btn.is-busy { opacity: .6; cursor: progress; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.btn-row form { margin: 0; display: contents; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--surface); color: var(--brand-800); cursor: pointer; text-decoration: none;
}
.icon-btn:hover { background: var(--brand-50); border-color: var(--brand-500); }
.icon-btn.is-disabled { opacity: .35; cursor: default; }

/* ------------------------------------------------------------------ cards */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 22px 24px; margin-bottom: 20px; }
.card--narrow { max-width: 460px; margin: 32px auto; }
.card--table { padding: 0; overflow: hidden; }
.card__head { margin-bottom: 16px; }
.card--table .card__head { padding: 20px 24px 0; }
.card__title { font-size: 17px; }
.card > .card__title, .help-grid .card__title { margin-bottom: 12px; }
.card__sub { color: var(--text-muted); font-size: 13.5px; margin: 4px 0 0; }
.card__subtitle { font-size: 14px; margin: 22px 0 10px; }

/* ------------------------------------------------------------------ badges, chips, tags */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: var(--radius-pill); font-size: 12.5px; font-weight: 500;
  line-height: 1.5; white-space: nowrap; border: 1px solid transparent; vertical-align: middle;
}
.badge--brand { background: var(--brand-100); color: var(--brand-800); }
.badge--ok { background: var(--ok-bg); color: var(--ok); }
.badge--warn { background: var(--warn-bg); color: var(--warn); }
.badge--nf, .badge--muted { background: var(--nf-bg); color: var(--nf); }
.badge--err { background: var(--err-bg); color: var(--err); }
.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px 1px 6px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 500;
  line-height: 1.55; white-space: nowrap; border: 1px solid; vertical-align: middle;
}
.chip__icon { width: 13px; height: 13px; stroke-width: 2.6; vertical-align: 0; }
.chip--sm { font-size: 11.5px; padding: 0 7px 0 5px; }
.chip--ok { color: var(--ok); background: var(--ok-bg); border-color: color-mix(in srgb, var(--ok-line) 35%, transparent); }
.chip--warn { color: var(--warn); background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-line) 45%, transparent); }
.chip--nf { color: var(--nf); background: var(--nf-bg); border-color: color-mix(in srgb, var(--nf-line) 35%, transparent); }
.chip--ns { color: var(--nf); background: transparent; border-color: var(--nf-line); border-style: dashed; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 5px; background: var(--brand-50); border: 1px solid var(--line); font-size: 12.5px; color: var(--text); line-height: 1.6; }
.tag--muted { color: var(--text-muted); background: var(--nf-bg); }
.tag--link { text-decoration: none; color: var(--link); }
.tag--link:hover { border-color: var(--brand-500); }
.taglist { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 6px; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 5px 0 10px; vertical-align: 0; }
.dot:first-child { margin-left: 0; }
.dot--ok { background: var(--ok-line); } .dot--warn { background: var(--warn-line); } .dot--nf { background: var(--nf-line); }
.dot--ns { background: transparent; border: 1.5px dashed var(--nf-line); }

/* ------------------------------------------------------------------ forms */
.field { margin-bottom: 16px; min-width: 0; }
.field__label { display: block; font-weight: 500; color: var(--ink); font-size: 14px; margin-bottom: 6px; }
.field__hint { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }
.field__error { color: var(--err); font-size: 13.5px; font-weight: 500; margin: 6px 0 0; }
.field--inline { display: inline-flex; align-items: center; gap: 10px; margin: 0; }
.field--inline .field__label { margin: 0; }
.input, .select, .textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: var(--surface); border: 1px solid var(--input-border);
  border-radius: var(--radius); padding: 9px 12px; min-height: 42px; transition: border-color .15s, box-shadow .15s;
}
.input::placeholder, .textarea::placeholder { color: color-mix(in srgb, var(--text-muted) 85%, white); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--brand-700); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-700); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-500) 35%, transparent); }
.input[aria-invalid="true"], .is-invalid { border-color: var(--err) !important; }
.select { appearance: none; padding-right: 34px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235F6470' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
.textarea--mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13.5px; }
.input--num { width: 140px; font-variant-numeric: tabular-nums; }
.input--xs { width: 72px; }
.input-unit { display: inline-flex; align-items: center; gap: 8px; color: var(--text-muted); }
.check { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; cursor: pointer; color: var(--ink); line-height: 1.45; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand-700); }
.check--sub { margin-top: 10px; font-size: 14px; }
.check-hint { margin: -2px 0 10px 28px; }
.check-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.check-row .check { margin: 8px 0; }
.group { border: 0; padding: 0; margin: 0 0 24px; min-width: 0; }
.group__title { font-weight: 600; color: var(--ink); font-size: 15px; padding: 0; margin-bottom: 12px; }
.row { display: grid; gap: 0 20px; }
.row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.row--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.form-actions--sub { margin-top: 10px; }
.inline-form { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 0; }
.inline-form--quiet { padding-top: 14px; border-top: 1px solid var(--line); margin-top: 18px; }

/* segmented control */
.segmented { display: inline-flex; border: 1px solid var(--input-border); border-radius: var(--radius); padding: 3px; gap: 3px; margin-bottom: 16px; background: var(--surface); flex-wrap: wrap; }
.segmented__opt { position: relative; }
.segmented__opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented__opt span { display: block; padding: 7px 14px; border-radius: 6px; font-weight: 500; font-size: 14px; color: var(--text); cursor: pointer; }
.segmented__opt input:checked + span { background: var(--brand-700); color: #fff; }
.segmented__opt input:focus-visible + span { box-shadow: var(--focus); }

/* choices (step 1) */
.choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 6px 0 22px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice__body {
  display: flex; flex-direction: column; gap: 6px; height: 100%; padding: 18px 18px 16px; border: 1.5px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface); transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.choice:hover .choice__body { border-color: var(--brand-500); }
.choice input:checked + .choice__body { border-color: var(--brand-700); background: var(--brand-50); box-shadow: inset 0 0 0 1px var(--brand-700); }
.choice input:focus-visible + .choice__body { box-shadow: var(--focus); }
.choice__icon { width: 28px; height: 28px; color: var(--brand-700); margin-bottom: 4px; }
.choice__title { font-weight: 600; color: var(--ink); font-size: 15.5px; }
.choice__text { color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }

/* wizard */
.steps { list-style: none; display: flex; gap: 6px; margin: 0 0 18px; padding: 0; counter-reset: step; flex-wrap: wrap; }
.steps__item { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: var(--radius-pill); color: var(--text-muted); font-weight: 500; font-size: 14px; background: transparent; }
.steps__num { width: 26px; height: 26px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid var(--line); font-size: 13px; font-weight: 600; background: var(--surface); }
.steps__item.is-current { background: var(--brand-100); color: var(--brand-800); }
.steps__item.is-current .steps__num { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.steps__item.is-done .steps__num { border-color: var(--brand-700); color: var(--brand-700); }
.steps__item[data-goto] { cursor: pointer; }
.wizard__step { margin-bottom: 18px; }
.step__title { display: flex; align-items: center; gap: 10px; font-size: 18px; margin-bottom: 18px; }
.step__no { width: 28px; height: 28px; border-radius: 50%; background: var(--brand-100); color: var(--brand-800); display: inline-flex; align-items: center; justify-content: center; font-size: 14px; }
.wizard.is-js .step__no { display: none; }
.wizard__nav { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; border-top: 1px solid var(--line); margin-top: 8px; }
.wizard:not(.is-js) .wizard__nav { display: none; }
.wizard__submit { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.wizard__explain { max-width: 75ch; }

/* drop zone */
.dropzone {
  display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 20px; align-items: center; padding: 16px; border: 1.5px dashed var(--input-border);
  border-radius: var(--radius-lg); background: var(--brand-50); transition: border-color .15s, background-color .15s;
}
.dropzone.is-over { border-color: var(--brand-700); background: var(--brand-100); }
.dropzone.is-done { border-style: solid; border-color: var(--ok-line); background: color-mix(in srgb, var(--ok-bg) 60%, var(--surface)); }
.dropzone__motion { min-height: 120px; border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.dropzone__motion .lai-motion { width: 100%; }
.dropzone__title { font-weight: 600; color: var(--ink); font-size: 16px; margin: 0 0 2px; }
.dropzone__hint { color: var(--text-muted); font-size: 13.5px; margin: 0 0 12px; }
.dropzone__pick { position: relative; overflow: hidden; }
.dropzone__input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.dropzone__status { margin: 10px 0 0; font-size: 14px; color: var(--ink); min-height: 1.4em; }
.progress--thin { height: 6px; margin-top: 8px; }

/* radius */
.radius { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.radius__range { flex: 1; min-width: 140px; accent-color: var(--brand-700); }
.radius__preview { width: 52px; height: 52px; flex: none; }
.radius__outer { fill: var(--brand-50); stroke: var(--line); }
.radius__ring { fill: color-mix(in srgb, var(--brand-500) 22%, transparent); stroke: var(--brand-700); stroke-width: 1.5; }
.radius__pin { fill: var(--brand-800); }

/* Branchen picks */
.picks { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.pick { position: relative; }
.pick input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.pick span {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px; border-radius: var(--radius-pill); border: 1px solid var(--input-border);
  background: var(--surface); color: var(--ink); font-size: 14px; cursor: pointer; transition: background-color .12s, border-color .12s;
}
.pick span:hover { border-color: var(--brand-700); }
.pick input:checked + span { background: var(--brand-700); border-color: var(--brand-700); color: #fff; }
.pick input:checked + span::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat; }
.pick input:focus-visible + span { box-shadow: var(--focus); }
.add-row { display: flex; gap: 8px; align-items: center; }
.add-row .input { max-width: 340px; }

/* modules */
.modules { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.module { position: relative; display: flex; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); cursor: pointer; background: var(--surface); transition: border-color .15s, background-color .15s; }
.module:hover { border-color: var(--brand-500); }
.module:has(input:checked) { border-color: var(--brand-700); background: var(--brand-50); }
.module--fixed { cursor: default; }
.module input { width: 18px; height: 18px; margin: 2px 0 0; flex: none; accent-color: var(--brand-700); }
.module__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.module__title { font-weight: 600; color: var(--ink); }
.module__text { color: var(--text-muted); font-size: 13.5px; line-height: 1.45; }
.module__price { font-size: 13px; color: var(--brand-800); font-weight: 500; font-variant-numeric: tabular-nums; margin-top: 2px; }

/* estimate */
.estimate { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--brand-50); padding: 14px 18px; margin: 16px 0; }
.estimate--live { margin: 18px 0 24px; }
.estimate__title { margin: 0 0 6px; color: var(--ink); }
.estimate__title strong { font-size: 18px; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.estimate__lines { list-style: none; padding: 0; margin: 0 0 6px; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 2px 24px; }
.estimate__lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; border-bottom: 1px dashed var(--line); padding: 3px 0; font-variant-numeric: tabular-nums; }
.estimate__basis { color: var(--text-muted); font-size: 13px; margin: 6px 0 0; }

/* ------------------------------------------------------------------ phase panel */
.panel {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-1); padding: 22px 24px; margin-bottom: 20px; overflow: hidden;
}
.panel::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--brand-700); }
.panel--ok::before { background: var(--ok-line); } .panel--warn::before { background: var(--warn-line); }
.panel--err::before { background: var(--err-line); } .panel--nf::before { background: var(--nf-line); }
.panel--motion { grid-template-columns: minmax(0, 1fr) minmax(260px, 400px); align-items: start; }
.panel__eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 13px; color: var(--text-muted); }
.panel__title { font-size: 22px; margin-bottom: 8px; color: var(--brand-800); }
.panel__lead { font-size: 15.5px; color: var(--ink); max-width: 68ch; }
.panel__note { color: var(--text-muted); font-size: 13.5px; max-width: 70ch; margin-top: 12px; }
.panel__actions { margin-top: 18px; }
.panel__motion { border-radius: var(--radius); overflow: hidden; background: var(--surface); min-height: 160px; position: relative; }
.panel__motion .lai-motion { width: 100%; }
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 16px 0 4px; }
.fact { background: var(--brand-50); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.fact dt { font-size: 12.5px; color: var(--text-muted); margin-bottom: 2px; }
.fact dd { margin: 0; font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact__sub { display: block; font-size: 12.5px; font-weight: 400; color: var(--text-muted); margin-top: 1px; }
.highlights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 4px; }
.highlight { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.highlight__value { font-size: 24px; font-weight: 600; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.highlight__label { font-size: 12.5px; color: var(--text-muted); line-height: 1.35; }
.minirates { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 18px; margin: 12px 0 16px; }
.minirate { display: flex; flex-direction: column; gap: 1px; border-bottom: 1px solid var(--line); padding: 4px 0 6px; font-size: 14px; min-width: 0; }
.minirate__label { color: var(--text-muted); font-size: 12.5px; }
.minirate__value { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.minirate__value .t-warn, .minirate__value .t-muted { font-weight: 400; }
.tune { background: var(--brand-50); border-radius: var(--radius); padding: 12px 16px; margin: 6px 0 4px; }
.tune__title { font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.tune__list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 20px; }
.tune__list a::before { content: "→ "; text-decoration: none; display: inline-block; margin-right: 2px; }
.criteria { padding: 0; }
.criteria summary { display: flex; justify-content: space-between; gap: 16px; padding: 14px 24px; cursor: pointer; font-weight: 500; color: var(--ink); list-style: none; }
.criteria summary::-webkit-details-marker { display: none; }
.criteria summary::after { content: ""; width: 10px; height: 10px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); margin-top: 3px; flex: none; }
.criteria[open] summary::after { transform: rotate(-135deg); margin-top: 8px; }
.criteria summary .t-muted { margin-left: auto; font-weight: 400; font-size: 13.5px; text-align: right; }
.criteria__body { padding: 0 24px 16px; }
.criteria__list { margin: 0 0 8px 18px; }
.run-head h1 { font-size: 26px; overflow-wrap: anywhere; }
.run-head__meta { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin: 8px 0 0; color: var(--text-muted); font-size: 14px; }

/* hero on the Übersicht */
.hero { margin-bottom: 26px; }
.hero__label { font-size: 13px; font-weight: 600; color: var(--brand-700); margin: 0 0 2px; }
.hero__name { font-size: 20px; margin: 0 0 10px; }
.hero__name a { color: var(--ink); text-decoration: none; }
.hero__name a:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ progress, rates */
.progress { height: 8px; background: var(--brand-100); border-radius: var(--radius-pill); overflow: hidden; margin: 10px 0; }
.progress__bar { height: 100%; background: var(--brand-700); border-radius: inherit; transition: width .6s ease; min-width: 2px; }
.rates { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 20px 32px; }
.rate { min-width: 0; }
.rate__head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.rate__label { font-weight: 500; color: var(--ink); }
.rate__value { font-weight: 600; color: var(--brand-800); font-variant-numeric: tabular-nums; }
.stack { display: flex; height: 12px; border-radius: var(--radius-pill); overflow: hidden; background: var(--nf-bg); gap: 2px; }
.stack__seg { height: 100%; }
.stack__seg--ok { background: var(--ok-line); } .stack__seg--warn { background: var(--warn-line); }
.stack__seg--nf { background: var(--nf-line); opacity: .55; }
.stack__seg--ns { background: repeating-linear-gradient(135deg, var(--line) 0 4px, transparent 4px 8px); }
.rate__counts { font-size: 12.5px; color: var(--text-muted); margin: 6px 0 0; font-variant-numeric: tabular-nums; }
.legend { font-size: 13px; color: var(--text-muted); margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--line); }
.minibars { display: grid; gap: 3px; min-width: 170px; }
.minibar { display: grid; grid-template-columns: 56px minmax(40px, 1fr) 46px; align-items: center; gap: 8px; font-size: 12px; }
.minibar__label { color: var(--text-muted); }
.minibar__track { height: 6px; background: var(--brand-100); border-radius: var(--radius-pill); overflow: hidden; }
.minibar__fill { display: block; height: 100%; background: var(--brand-700); border-radius: inherit; }
.minibar__value { text-align: right; font-variant-numeric: tabular-nums; color: var(--ink); }
.kv { list-style: none; margin: 0; padding: 0; }
.kv li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.kv--dl > div { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv--dl dt { color: var(--text-muted); }
.kv--dl dd { margin: 0; color: var(--ink); }
.pre { background: var(--brand-50); border-radius: var(--radius); padding: 12px; overflow: auto; font-size: 12.5px; max-height: 420px; }

/* ------------------------------------------------------------------ tabs, filters, tables */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 28px 0 16px; overflow-x: auto; scroll-margin-top: 80px; }
.tab { padding: 10px 14px 9px; text-decoration: none; color: var(--text); font-weight: 500; border-bottom: 3px solid transparent; white-space: nowrap; margin-bottom: -1px; }
.tab:hover { color: var(--brand-800); }
.tab[aria-current="page"] { color: var(--brand-800); border-bottom-color: var(--brand-700); }
.tab__count { display: inline-block; margin-left: 4px; padding: 0 7px; border-radius: var(--radius-pill); background: var(--brand-100); font-size: 12px; font-variant-numeric: tabular-nums; }
.filters { display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: flex-end; padding: 18px 20px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--brand-50) 55%, var(--surface)); }
.filters__search { position: relative; flex: 1 1 260px; min-width: 200px; }
.filters__search .input { padding-left: 38px; }
.filters__icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); width: 17px; height: 17px; pointer-events: none; }
.filters__field { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--text-muted); font-weight: 500; min-width: 0; }
.filters__field .select { min-width: 150px; min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.filters__field .input { min-height: 40px; }
.filters .input, .filters .select { height: 40px; min-height: 40px; padding-top: 7px; padding-bottom: 7px; }
.filters__field > span:first-child, .filters__legend { line-height: 1.3; }
.filters--bestand .filters__field .select { max-width: 260px; }
.table--locs tr.is-repeat td { border-top: 0; }
.table--locs tr.is-repeat td.cell-firm .firm-link--repeat { color: var(--text-muted); font-weight: 400; font-size: 13px; }
.table--locs tr:has(+ tr.is-repeat) td { border-bottom-color: transparent; }
.filters__checks { display: flex; flex-wrap: wrap; gap: 0 16px; align-items: center; min-height: 40px; }
.filters__checks .check { margin: 0; font-size: 14px; white-space: nowrap; }
.filters__actions { display: flex; gap: 8px; align-items: center; }
.filters.is-js .filters__actions button[type="submit"] { display: none; }
.table-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 20px; flex-wrap: wrap; }
.table-count { margin: 0; font-size: 14px; }
.update-notice { display: flex; align-items: center; gap: 10px; margin: 0 20px 12px; padding: 10px 14px; border-radius: var(--radius); background: var(--brand-100); color: var(--brand-800); flex-wrap: wrap; }
.update-notice span { flex: 1; min-width: 160px; }
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.table th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text-muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: var(--surface); white-space: nowrap; }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tfoot th, .table tfoot td { border-top: 2px solid var(--line); border-bottom: 0; color: var(--ink); font-size: 14px; }
.table th:first-child, .table td:first-child { padding-left: 20px; }
.table th:last-child, .table td:last-child { padding-right: 20px; }
.card:not(.card--table) .table th:first-child, .card:not(.card--table) .table td:first-child { padding-left: 4px; }
.card:not(.card--table) .table th:last-child, .card:not(.card--table) .table td:last-child { padding-right: 4px; }
.table--compact td, .table--compact th { padding: 6px 8px; }
tr[data-row-link] { cursor: pointer; }
tr[data-row-link]:hover td { background: var(--brand-50); }
tr.is-current td { background: var(--brand-100); }
.cell-main { display: block; }
.cell-sub { display: block; font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.cell-firm { min-width: 200px; max-width: 360px; }
.cell-firm .badge { margin-top: 4px; }
.cell-firm > .badge { display: flex; width: fit-content; }
.cell-progress { min-width: 150px; }
.cell-progress .progress { margin: 6px 0 4px; height: 6px; }
.firm-link { font-weight: 600; color: var(--brand-800); text-decoration: none; overflow-wrap: anywhere; }
.firm-link:hover { text-decoration: underline; color: var(--link); }
.table--sources td { font-size: 13px; }
/* nine columns (regional contact): tighter cells so the table fits 1,200 px without sideways scrolling */
.table--wide th, .table--wide td { padding-left: 8px; padding-right: 8px; }
.table--wide .cell-firm { min-width: 170px; max-width: 260px; }
.table--wide td .badge { white-space: normal; border-radius: 8px; }
.table--wide td[data-label^="Regional"] { min-width: 150px; max-width: 200px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 16px 20px 20px; flex-wrap: wrap; }
.pager ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; justify-content: center; }
.pager__num, .pager__step { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 38px; height: 38px; padding: 0 10px; border-radius: var(--radius); text-decoration: none; color: var(--brand-800); border: 1px solid var(--line); font-variant-numeric: tabular-nums; }
a.pager__num:hover, a.pager__step:hover { background: var(--brand-50); border-color: var(--brand-500); }
.pager__num[aria-current] { background: var(--brand-700); color: #fff; border-color: var(--brand-700); font-weight: 600; }
.pager__gap { padding: 0 4px; color: var(--text-muted); align-self: center; }
.pager__step.is-disabled { opacity: .4; }
.empty-inline { padding: 28px 24px; text-align: center; color: var(--text-muted); }
.empty-inline p { margin-bottom: 12px; }

/* run cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.runcard { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); text-decoration: none; color: var(--text); box-shadow: var(--shadow-1); transition: border-color .15s, box-shadow .15s; border-left: 4px solid var(--brand-700); }
.runcard--warn { border-left-color: var(--warn-line); } .runcard--ok { border-left-color: var(--ok-line); } .runcard--nf { border-left-color: var(--nf-line); } .runcard--err { border-left-color: var(--err-line); }
.runcard:hover { border-color: var(--brand-500); box-shadow: var(--shadow-2); }
.runcard__top { display: flex; gap: 6px; flex-wrap: wrap; }
.runcard__name { font-weight: 600; color: var(--ink); font-size: 16px; }
.runcard__meta { font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.runcard .progress { margin: 4px 0; height: 6px; }

/* ------------------------------------------------------------------ notices, toasts */
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--radius); margin: 0 0 16px; border: 1px solid; font-size: 14.5px; }
.notice p { margin: 0; }
.notice .icon { margin-top: 1px; }
.notice--ok { background: var(--ok-bg); color: var(--ok); border-color: color-mix(in srgb, var(--ok-line) 30%, transparent); }
.notice--warn { background: var(--warn-bg); color: var(--warn); border-color: color-mix(in srgb, var(--warn-line) 35%, transparent); }
.notice--err { background: var(--err-bg); color: var(--err); border-color: color-mix(in srgb, var(--err-line) 30%, transparent); }
.notice--nf { background: var(--nf-bg); color: var(--nf); border-color: color-mix(in srgb, var(--nf-line) 30%, transparent); }
.notice--info { background: var(--brand-50); color: var(--brand-800); border-color: var(--line); }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; max-width: calc(100vw - 32px); }
.toast { pointer-events: auto; background: var(--brand-800); color: #fff; padding: 12px 16px; border-radius: var(--radius); box-shadow: var(--shadow-2); font-size: 14.5px; max-width: 420px;
  animation: toast-in .25s ease-out both, toast-out .3s ease-in 5.5s forwards; }
.toast--err { background: var(--err); }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); visibility: hidden; } }

/* ------------------------------------------------------------------ drawer and firm detail */
dialog.drawer {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0; border: 0; width: min(700px, 100vw); max-width: 100vw; height: 100%; max-height: 100dvh;
  background: var(--surface); color: var(--text); box-shadow: -12px 0 40px rgba(31, 35, 58, .18); overflow: hidden;
}
dialog.drawer[open] { display: flex; flex-direction: column; animation: drawer-in .22s ease-out; }
dialog.drawer::backdrop { background: rgba(31, 35, 58, .38); animation: fade-in .2s ease-out; }
@keyframes drawer-in { from { transform: translateX(32px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
.drawer__content { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.drawer__loading { padding: 40px 28px; color: var(--text-muted); }
.firm__head { position: sticky; top: 0; background: var(--surface); padding: 16px 28px 14px; border-bottom: 1px solid var(--line); z-index: 2; }
.firm-page .firm__head { position: static; padding: 0 0 16px; }
.firm__nav { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.firm__pos { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.firm__step { display: flex; gap: 6px; }
.firm__eyebrow { font-size: 13px; color: var(--text-muted); margin: 0 0 2px; min-height: 1em; }
.firm__name { font-size: 22px; color: var(--brand-800); outline: none; overflow-wrap: anywhere; }
.firm__legal { color: var(--text-muted); margin: 2px 0 0; font-size: 14px; }
.firm__badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }
.firm__body { padding: 18px 28px 32px; }
.firm-page .firm__body { padding: 18px 0 0; }
.firm__sec { padding: 4px 0 18px; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
.firm__sec > h3 { font-size: 15px; font-weight: 600; color: var(--brand-700); margin: 0 0 10px; }
.firm__sub { font-size: 14px; color: var(--ink); margin: 14px 0 6px; }
.firm__sources summary { cursor: pointer; font-weight: 600; color: var(--brand-800); padding: 6px 0; }
.firm__foot { color: var(--text-muted); font-size: 13px; margin-top: 16px; }
.vlist { margin: 0; }
.v { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 4px 16px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.v:last-child { border-bottom: 0; }
.v__label { color: var(--text-muted); font-size: 13.5px; padding-top: 2px; }
.v__main { margin: 0; min-width: 0; }
.v__line { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.v__value { color: var(--ink); font-weight: 500; overflow-wrap: anywhere; }
a.v__value { color: var(--link); }
.v__value--empty { color: var(--nf); font-weight: 400; font-style: italic; }
.v__meta { font-size: 12.5px; color: var(--text-muted); margin: 3px 0 0; overflow-wrap: anywhere; }
.v__more { margin-top: 4px; font-size: 13px; }
.v__more summary { cursor: pointer; color: var(--link); width: fit-content; }
.v__more blockquote { margin: 6px 0 2px; padding: 6px 10px; border-left: 3px solid var(--brand-100); color: var(--text); font-size: 13px; background: var(--brand-50); border-radius: 0 6px 6px 0; }
.v__alts { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.v__alts li { font-size: 13px; color: var(--text); }
.v__empty { color: var(--nf); font-style: italic; margin: 0 0 6px; display: flex; gap: 8px; align-items: center; }
.persons { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.person { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.persons--candidates .person { border-style: dashed; }
.person__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.person__name { font-weight: 600; color: var(--ink); }
.person__function { margin: 2px 0 0; font-size: 13.5px; color: var(--text); }
.person__links { margin: 4px 0 0; font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.person__linkconf { display: inline-flex; gap: 4px; align-items: center; color: var(--text-muted); font-size: 12.5px; margin-left: 4px; }
.seeks { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.jobs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.job { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.job:last-child { border-bottom: 0; }
.job__head { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-weight: 500; }
.locs li { padding: 2px 0; font-size: 13.5px; }

/* ------------------------------------------------------------------ drawer actions */
.firm__actions { margin: 0 0 18px; }
.actbar { display: flex; flex-wrap: wrap; gap: 8px; }
.actbar__btn.is-active { background: var(--brand-100); border-color: var(--brand-700); color: var(--brand-800); }
.btn.is-disabled { opacity: .55; cursor: not-allowed; }
.btn .tag { margin-left: 4px; font-size: 11.5px; padding: 0 6px; }
.actpanel { margin-top: 12px; padding: 14px 16px 16px; border: 1px solid var(--brand-500); border-radius: var(--radius); background: var(--brand-50);
  box-shadow: inset 4px 0 0 var(--brand-700); }
.actpanel p { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.actpanel .field { margin-bottom: 12px; }
.actpanel .check { font-size: 14px; }
.actpanel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.actpanel__title { font-size: 15.5px; color: var(--brand-800); outline: none; }
.actpanel__cost { font-weight: 500; font-variant-numeric: tabular-nums; }
.actpanel__warn, .actpanel__note { display: flex; gap: 8px; align-items: flex-start; font-size: 13.5px !important; }
.actpanel__warn { color: var(--warn) !important; background: var(--warn-bg); border-radius: 6px; padding: 8px 10px; }
.actpanel__note { color: var(--text-muted) !important; }
.actpanel__warn .icon, .actpanel__note .icon { width: 16px; height: 16px; margin-top: 2px; }
.actpanel--inline { margin-top: 8px; box-shadow: none; border-color: var(--line); background: var(--surface); }
.icon-btn--sm { width: 32px; height: 32px; }
.icon-btn--sm .icon { width: 16px; height: 16px; }
.btn--danger-solid { background: var(--err); color: #fff; border-color: var(--err); }
.btn--danger-solid:hover { background: #8f1f18; }
.person__act { margin-top: 8px; }
.person__act > summary { list-style: none; width: fit-content; }
.person__act > summary::-webkit-details-marker { display: none; }
.person__act[open] > summary { background: var(--brand-100); border-color: var(--brand-700); }

/* Standorte und Töchter */
.locs { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.locs--grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.loc { padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius); }
.loc__head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.loc__name { font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.loc__km { margin-left: auto; font-size: 13px; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.loc__addr { margin: 3px 0 0; font-size: 13.5px; color: var(--text); overflow-wrap: anywhere; }
.firm__sec > h3 .tab__count { margin-left: 6px; font-weight: 500; vertical-align: 1px; }

/* ------------------------------------------------------------------ Firmenbestand */
.filters__group { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.filters__legend { font-size: 12.5px; color: var(--text-muted); font-weight: 500; }
.filters__pair { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted); font-size: 13.5px; }
.filters__pair .input { min-height: 40px; }
.input--plz { width: 92px; font-variant-numeric: tabular-nums; }
.table-hint { margin: -4px 20px 10px; font-size: 13px; }
.cell-check { width: 44px; }
.check--cell { margin: 0; justify-content: center; }
.cell-change { color: var(--brand-800); }
.table--bestand .badge { margin-bottom: 2px; }
.bestand-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0 20px; align-items: start; }
.changes { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.changes li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.changes .icon { color: var(--brand-700); margin-top: 2px; width: 17px; height: 17px; }
.takeover__firms { background: var(--brand-50); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 18px; }
.takeover__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 4px 20px; font-size: 14px; }
.takeover .module__body { justify-content: center; }

/* ------------------------------------------------------------------ Einstellungen: Sperrliste und bekannte Firmen */
.settings__lead { color: var(--text-muted); max-width: 80ch; margin: -6px 0 6px; }
.settings__split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 32px; }
.settings__block .card__subtitle { margin-top: 14px; }
.known-status { display: flex; gap: 10px; align-items: flex-start; color: var(--ink); }
.known-status .icon { color: var(--brand-700); margin-top: 2px; }
.upload-row { margin-top: 10px; }
.upload-row__inputs { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.filepick { position: relative; display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; cursor: pointer; max-width: 100%; }
.filepick__input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; }
.filepick__input:focus-visible + .filepick__btn { box-shadow: var(--focus); }
.filepick:hover .filepick__btn { background: var(--brand-50); }
.filepick__name { font-size: 14px; color: var(--text-muted); overflow-wrap: anywhere; min-width: 0; }
.filepick__name.is-set { color: var(--ink); font-weight: 500; }
.sperre { list-style: none; margin: 0 0 12px; padding: 0; border-top: 1px solid var(--line); }
.sperre__item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.sperre__item form { margin: 0; flex: none; }
.sperre__text { min-width: 0; overflow-wrap: anywhere; color: var(--ink); }
.sperre-add { margin-top: 12px; }

/* ------------------------------------------------------------------ wizard: module options, Mittelpunkt combobox */
.module-options { margin-top: 12px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--brand-50); }
.module-options__title { font-weight: 600; color: var(--ink); margin: 0 0 2px; }
.module-options .check { margin: 6px 0 4px; font-size: 14px; }
.module-options .module__price { display: block; margin-top: 2px; }
.module-options.is-off, .modules:not(:has(input[value="teamseite"]:checked)) + .module-options { display: none; }
.combo { position: relative; }
.combo__list { position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px; list-style: none; background: var(--surface);
  border: 1px solid var(--input-border); border-radius: var(--radius); box-shadow: var(--shadow-2); max-height: 280px; overflow-y: auto; }
.combo__opt { display: flex; justify-content: space-between; gap: 12px; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink); }
.combo__opt:hover, .combo__opt.is-active { background: var(--brand-100); color: var(--brand-800); }
.combo__opt.is-active { box-shadow: inset 3px 0 0 var(--brand-700); }
.combo__sub { color: var(--text-muted); font-size: 13px; white-space: nowrap; }

/* ------------------------------------------------------------------ Nachlauf on the finished run */
.nachlaeufe { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }
.nachlaeufe__title { font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.nachlaeufe li { padding: 3px 0; display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
.disclosure { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.disclosure > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 12px 16px; cursor: pointer; list-style: none;
  border-radius: var(--radius); }
.disclosure > summary::-webkit-details-marker { display: none; }
.disclosure > summary::before { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--brand-700); border-bottom: 2px solid var(--brand-700);
  transform: rotate(-45deg); margin-right: 2px; align-self: center; flex: none; transition: transform .15s; }
.disclosure[open] > summary::before { transform: rotate(45deg); }
.disclosure > summary:hover { background: var(--brand-50); }
.disclosure__title { font-weight: 600; color: var(--brand-800); }
.disclosure[open] > summary { border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.nachlauf-form { padding: 14px 16px 16px; }
.nachlauf-form .group { margin-bottom: 14px; }

/* ------------------------------------------------------------------ Übersicht onboarding */
.onboarding { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.onboarding__motion { min-height: 200px; min-width: 0; }
.onboarding__text h2 { font-size: 20px; margin-bottom: 12px; }
.howto { counter-reset: howto; list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 10px; }
.howto li { counter-increment: howto; position: relative; padding-left: 38px; }
.howto li::before { content: counter(howto); position: absolute; left: 0; top: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--brand-700); color: #fff; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; }

/* ------------------------------------------------------------------ settings, help, login */
.toc { display: flex; flex-wrap: wrap; gap: 6px; margin: -6px 0 20px; }
.toc a { padding: 5px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line); text-decoration: none; color: var(--brand-800); font-size: 13.5px; background: var(--surface); }
.toc a:hover { border-color: var(--brand-500); background: var(--brand-50); }
.settings { scroll-margin-top: 84px; }
.settings .card__title { margin-bottom: 14px; }
.settings__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px 28px; }
.settings details > summary { display: flex; align-items: baseline; gap: 14px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.settings details > summary::-webkit-details-marker { display: none; }
.settings details > summary .card__title { margin: 0; }
.settings details[open] > summary { margin-bottom: 16px; }
.settings details > summary::after { content: ""; width: 9px; height: 9px; border-right: 2px solid var(--text-muted); border-bottom: 2px solid var(--text-muted); transform: rotate(45deg); margin-left: auto; align-self: center; }
.settings details[open] > summary::after { transform: rotate(-135deg); }
.services { list-style: none; padding: 0; margin: 0 0 10px; }
.service { display: grid; grid-template-columns: 190px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.service__name { font-weight: 500; color: var(--ink); }
.service__text { color: var(--text-muted); font-size: 13.5px; }
.logo-preview { display: flex; align-items: center; min-height: 64px; padding: 12px; border: 1px dashed var(--line); border-radius: var(--radius); background: var(--bg); margin-bottom: 10px; }
.logo-preview img { max-height: 56px; width: auto; }
.form-actions--wrap { flex-wrap: wrap; }
.help-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 0 20px; align-items: start; }
.help-list { display: grid; gap: 8px; }
.help-list li { padding-left: 16px; position: relative; }
.help-list li::before { content: ""; position: absolute; left: 2px; top: .62em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); }
.legend-list { margin: 0 0 12px; display: grid; gap: 10px; }
.legend-list > div { display: grid; grid-template-columns: 130px minmax(0, 1fr); gap: 12px; align-items: start; }
.legend-list dt { padding-top: 1px; }
.legend-list dd { margin: 0; font-size: 14px; }
.login { margin-top: 48px; }
.login h1 { margin-bottom: 4px; }
.login .form { margin-top: 18px; }
.login__foot { font-size: 13px; margin: 16px 0 0; }
.empty { text-align: center; }
.empty__code { font-size: 44px; font-weight: 600; color: var(--brand-500); margin: 0; font-variant-numeric: tabular-nums; }
.empty__title { margin-bottom: 10px; }

/* ------------------------------------------------------------------ motion hosts (canvases are drawn by motion-app.js) */
.lai-motion { display: block; position: relative; }
.lai-motion:empty { min-height: 0; }

/* ------------------------------------------------------------------ Laufzettel (screen view = paper preview) */
.page-print .page { max-width: 1240px; }
.lz-toolbar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.lz-toolbar__text { margin: 0; flex: 1; min-width: 220px; color: var(--text-muted); }
.lz-sheet { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-1); padding: 26px 28px; margin: 0 auto 24px; max-width: 1180px; border-radius: 4px; }
.lz-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; border-bottom: 2px solid var(--brand-700); padding-bottom: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.lz-title { font-family: var(--font-display); font-size: 22px; color: var(--brand-800); }
.lz-count { font-family: var(--font-body); font-weight: 500; font-size: 15px; color: var(--text-muted); }
.lz-meta { margin: 0; color: var(--text-muted); font-size: 12.5px; }
.lz-table { width: 100%; border-collapse: collapse; font-size: 12.5px; table-layout: fixed; }
.lz-table th { text-align: left; font-size: 11px; color: var(--text-muted); font-weight: 600; padding: 5px 6px; border-bottom: 1px solid var(--input-border); }
.lz-table td { padding: 6px; border-bottom: 1px solid var(--line); vertical-align: top; color: #222; overflow-wrap: anywhere; }
.lz-c-stand { width: 8%; } .lz-c-firm { width: 27%; } .lz-c-gf { width: 15%; } .lz-c-sales { width: 13%; } .lz-c-ma { width: 7%; } .lz-c-check { width: 14%; } .lz-c-notes { width: 16%; }
.lz-stand { font-weight: 600; white-space: nowrap; }
.lz-firm strong { display: block; color: #111; }
.lz-firm span, .lz-sub { display: block; color: #555; font-size: 11px; }
.lz-empty { color: #777; font-style: italic; }
.lz-checks { font-size: 11px; line-height: 1.6; }
.lz-check { display: inline-block; white-space: nowrap; margin-right: 8px; }
.lz-box { display: inline-block; width: 10px; height: 10px; border: 1.2px solid #444; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }
.lz-notes { background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 17px, #d6d6d6 17px, #d6d6d6 18px); }
.lz-firm .lz-mark { display: inline-block; margin-top: 2px; padding: 0 5px; border: 1px solid #8a5300; border-radius: 3px; color: #8a5300; font-size: 10.5px; font-weight: 600; }
.lz-regional { margin-top: 3px; }

@page { size: A4 landscape; margin: 11mm 10mm 13mm; }
@media print {
  body { background: #fff; display: block; min-height: 0; font-size: 10pt; }
  .topbar, .footer, .toast-region, .no-print, .skip, .lz-toolbar, dialog { display: none !important; }
  .page { padding: 0; max-width: none; }
  .lz-sheet { border: 0; box-shadow: none; padding: 0; margin: 0; max-width: none; break-after: page; }
  .lz-sheet:last-of-type { break-after: auto; }
  .lz-table thead { display: table-header-group; }
  .lz-table tr { break-inside: avoid; }
  .lz-table td { padding: 4px 5px; line-height: 1.35; }
  .lz-table th { padding: 4px 5px; }
  .lz-head { margin-bottom: 6px; padding-bottom: 5px; }
  .lz-head { border-bottom-color: #434D7A; }
  a { color: inherit; text-decoration: none; }
}

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1100px) {
  .panel--motion { grid-template-columns: minmax(0, 1fr) minmax(220px, 320px); }
  .nav a { padding-left: 9px; padding-right: 9px; }
}
/* seven menu items (admins) need ~1080 px in one row: below that the menu gets its own row */
@media (max-width: 1080px) {
  .topbar__inner { flex-wrap: wrap; gap: 0 16px; min-height: 0; padding-top: 10px; }
  .brand { order: 1; }
  .userbox { order: 2; margin-left: auto; }
  .nav { order: 3; flex-basis: 100%; overflow-x: auto; margin: 0 calc(-1 * var(--gutter)); padding: 0 var(--gutter); scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { padding: 12px 10px 10px; }
  .nav { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
}
@media (max-width: 920px) {
  :root { --gutter: 16px; }
  .panel--motion { grid-template-columns: minmax(0, 1fr); }
  .panel--motion .panel__motion { order: -1; }
  .choices { grid-template-columns: minmax(0, 1fr); }
  .onboarding { grid-template-columns: minmax(0, 1fr); }
  .bestand-grid, .settings__split { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  body { font-size: 15px; }
  h1 { font-size: 24px; }
  .page { padding-top: 18px; }
  .card { padding: 18px 16px; border-radius: 10px; }
  .card--table { padding: 0; }
  .panel { padding: 18px 16px 18px 20px; }
  .panel__title { font-size: 20px; }
  .row--2, .row--3, .modules { grid-template-columns: minmax(0, 1fr); }
  .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dropzone { grid-template-columns: minmax(0, 1fr); }
  .dropzone__motion { min-height: 100px; }
  .filters { padding: 14px 16px; }
  .filters__field { flex: 1 1 140px; }
  .filters__field .select { min-width: 0; width: 100%; }
  .table-tools { padding: 10px 16px; }
  .update-notice { margin: 0 16px 12px; }
  .kv--dl > div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .v { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .service { grid-template-columns: minmax(0, 1fr) auto; }
  .service__text { grid-column: 1 / -1; grid-row: 2; }
  .legend-list > div { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .firm__head { padding: 14px 16px 12px; }
  .firm__body { padding: 14px 16px 28px; }
  .userbox__name { display: none; }
  .criteria summary { padding: 14px 16px; flex-wrap: wrap; }
  .criteria summary .t-muted { margin-left: 0; text-align: left; flex-basis: 100%; }
  .criteria__body { padding: 0 16px 14px; }
  .steps__label { display: none; }
  .steps__item.is-current .steps__label { display: inline; }
  .wizard__submit .btn { width: 100%; }
  .lz-sheet { padding: 14px; overflow-x: auto; }
  .lz-table { min-width: 860px; }

  /* tables become cards */
  .table--firms, .table--runs { font-size: 14px; }
  .table--firms thead, .table--runs thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .table--firms tr, .table--runs tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 4px 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
  .table--firms td, .table--runs td { display: block; padding: 0 !important; border: 0; min-width: 0; max-width: none; }
  .table--firms td::before, .table--runs td::before { content: attr(data-label); display: block; font-size: 11.5px; color: var(--text-muted); font-weight: 500; }
  .table--firms td.cell-firm, .table--runs td.cell-firm { grid-column: 1 / -1; order: -1; }
  .table--firms td.cell-firm::before, .table--runs td.cell-firm::before { display: none; }
  .table--firms td:empty, .table--runs td:empty { display: none; }
  .table--runs td.cell-action::before { display: none; }
  .table--firms .t-num, .table--runs .t-num { text-align: left; }
  .table--runs td.cell-progress, .table--runs td[data-label="Trefferquote"] { grid-column: 1 / -1; }
  .firm-link { font-size: 15.5px; }
  .table--bestand tr { position: relative; }
  .table--bestand td.cell-check { position: absolute; right: 10px; top: 10px; }
  .table--bestand td.cell-check::before { display: none; }
  .table--bestand td.cell-firm { padding-right: 40px !important; }
  .table--locs td[data-label="Adresse"], .table--history td[data-label="Adresse"] { grid-column: 1 / -1; }
  .table-hint { margin: -4px 16px 10px; }
  .filters__group { flex: 1 1 100%; }
  .filters__pair { display: flex; width: 100%; }
  .filters__pair .input, .filters__pair .input-unit { flex: 1 1 0; min-width: 0; width: auto; }
  .filters__pair .input-unit .input { flex: 1 1 0; min-width: 0; width: 100%; }
  .actpanel { padding: 12px 12px 14px; }
  .disclosure > summary { padding: 12px; }
  .nachlauf-form { padding: 12px; }
  .filepick { width: 100%; }
}
@media (max-width: 420px) {
  .brand__client { display: none; }
  .brand__product { font-size: 19px; }
  .btn-row > .btn, .btn-row > form > .btn { flex: 1 1 auto; }
  .inline-form { align-items: stretch; }
  .facts, .highlights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .actbar > .btn { flex: 1 1 calc(50% - 4px); justify-content: flex-start; white-space: normal; text-align: left; }
  .sperre__item { align-items: flex-start; }
}

/* ------------------------------------------------------------------ reduced motion: no transitions, no animations */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .toast { animation: none; }
}
html[data-motion="reduce"] *, html[data-motion="reduce"] *::before, html[data-motion="reduce"] *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }

/* Benutzer (user administration) */
.user-edit > summary { cursor: pointer; color: var(--link, var(--brand-700)); }
.user-edit[open] { min-width: 300px; }
.user-edit .form { margin-top: 10px; }
.manual-link { display: block; word-break: break-all; user-select: all; padding: 8px 10px; background: var(--surface, #fff); border: 1px solid var(--line); }

/* Personen */
.contact-links { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.contact-links a { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.contact-links .icon { width: 14px; height: 14px; }
