:root { color-scheme: dark; font: 14px/1.45 system-ui, sans-serif; color: #e8eceb; background: #151a1c;
  --lab-rand: #394345; --lab-hintergrund: #1b2625; --lab-muted: #a5afb1; --lab-gebaeude: #eac8a6; }
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button, input, select, a, summary { outline-offset: 3px; }
:focus-visible { outline: 2px solid #7ccea0; }
[hidden] { display: none !important; }
.page { width: 100%; padding: 12px; }
.header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 2px 5px 12px; }
.header-main { min-width: 0; }
.brand { display: block; font-size: 19px; line-height: 1.2; letter-spacing: -.025em; }
.header-meta { display: flex; justify-content: flex-end; align-items: center; gap: 11px; color: #a5afb1; font-size: 12px; white-space: nowrap; }
.pill { padding: 4px 10px; border: 1px solid #46775b; border-radius: 999px; color: #a7d9bb; font-size: 11px; }
.grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 360px; gap: 10px; align-items: stretch; }
.panel, .map-panel { min-width: 0; background: #22282a; border: 1px solid #394244; border-radius: 10px; }
.panel { padding: 16px; }
h1, h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.controls label { display: block; margin: 14px 0 5px; color: #c5cece; font-size: 12px; }
.controls #parameter > label:first-child { margin-top: 0; }
input, select { display: block; width: 100%; min-width: 0; padding: 8px 10px; color: #e8eceb; background: #171d1f; border: 1px solid #465153; border-radius: 6px; }
input::placeholder { color: #889496; }
.actions { display: flex; gap: 7px; margin: 16px 0 8px; }
.actions button { flex: 1; padding-inline: 7px; white-space: nowrap; }
button { padding: 8px 11px; border: 1px solid #475255; border-radius: 6px; background: #30383a; color: #e8eceb; cursor: pointer; }
button:hover:not(:disabled) { background: #3b4648; }
button:disabled { opacity: .45; cursor: default; }
button.primary { background: #2f7d5b; border-color: #2f7d5b; color: white; }
button.primary:hover:not(:disabled) { background: #398d69; }
button.secondary { background: #252f30; }
button.full { width: 100%; margin-top: 7px; }
.help { margin: 12px 0 0; padding: 9px; border-left: 3px solid #5fb38a; background: #1a3028; border-radius: 4px; font-size: 12px; }
#zeichnen-status { margin: 7px 0 0; min-height: 1.4em; color: #a5afb1; font-size: 12px; }
.side-section { border-top: 1px solid #384244; margin-top: 17px; padding-top: 14px; }
.side-section h2 { margin-bottom: 6px; font-size: 13px; }
.saved-list { display: grid; gap: 6px; }
.saved-item { display: grid; grid-template-columns: 27px minmax(0, 1fr) auto; gap: 7px; align-items: center; padding: 7px; border: 1px solid #394244; border-radius: 7px; background: #1c2325; }
.badge { display: grid; place-items: center; width: 27px; height: 27px; flex: none; border-radius: 50%; background: #245e45; color: white; font-size: 12px; font-weight: 700; }
.saved-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.saved-name small { display: block; color: #9da9aa; font-size: 10px; }
.saved-actions { display: flex; gap: 4px; }
.saved-actions button { padding: 4px 6px; font-size: 11px; }
.empty { margin: 0; color: #a5afb1; font-size: 12px; }
.map-panel { position: relative; overflow: hidden; min-height: 55vh; height: 65vh; background: #1b2223; }
.map, .map canvas { display: block; width: 100%; height: 100%; }
.map canvas { outline-offset: -4px; }
.map-panel.is-drawing .map canvas { cursor: crosshair; }
.loading { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; background: #1b2223; color: #c5cece; }
.legend { position: absolute; z-index: 1; bottom: 12px; left: 12px; display: grid; gap: 5px; padding: 8px 10px; background: #151a1ce6; border: 1px solid #465153; border-radius: 7px; font-size: 11px; pointer-events: none; }
.legend span { display: flex; align-items: center; gap: 7px; }
.swatch { width: 12px; height: 12px; display: inline-block; flex: none; }
.swatch.area { background: #2f7d5b99; border: 2px solid #5fb38a; }
.swatch.building { background: var(--lab-gebaeude); border: 2px solid #fff; }
.swatch.road { background: #f2b134; height: 4px; width: 14px; }
.swatch.stop { background: #4a7aa8; border: 2px solid #c2d9ec; border-radius: 50%; }
.metrics { overflow: auto; }
.tabs { display: flex; gap: 3px; border-bottom: 1px solid #3d494a; margin: -2px 0 13px; }
.tabs button { flex: 1; padding: 6px 7px 9px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: none; color: #a5afb1; font-size: 13px; }
.tabs button[aria-selected="true"] { border-bottom-color: #7ccea0; color: #eef5f0; }
.scenario-label { margin: 0 0 9px; color: #a5afb1; font-size: 12px; }
.bebauung { margin-bottom: 13px; padding: 11px; border: 1px solid var(--lab-rand); border-radius: 7px; background: var(--lab-hintergrund); }
.bebauung h2 { margin-bottom: 6px; font-size: 13px; }
.bebauung p { margin: 5px 0; }
.bebauung-prinzip { font-size: 13px; }
.bebauung-daten { display: grid; gap: 3px; margin: 7px 0; font-size: 12px; }
.bebauung-daten span { display: flex; justify-content: space-between; gap: 9px; }
.bebauung-daten strong { text-align: right; }
.bebauung-detail { font-size: 12px; }
.bebauung-herkunft { color: var(--lab-muted); font-size: 11px; }
.lead-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-bottom: 12px; }
.lead-card { min-width: 0; padding: 10px; border: 1px solid #3c4849; border-radius: 7px; background: #1b2625; }
.lead-card span { display: block; color: #aab5b4; font-size: 12px; }
.lead-card strong { display: block; margin-top: 4px; font-size: 26px; font-weight: 650; line-height: 1.15; font-variant-numeric: tabular-nums; }
.lead-card small { margin-left: 3px; color: #b7c4c0; font-size: 11px; font-weight: 400; }
.metric { border-top: 1px solid #394345; padding: 9px 0; }
.metric-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.metric-title { margin: 0; color: #c4cecc; font-size: 12px; }
.metric-value { flex: none; display: flex; gap: 4px; align-items: baseline; font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.metric-unit { color: #a5afb1; font-size: 11px; font-weight: 400; }
details { margin-top: 3px; color: #b9c4c3; font-size: 11px; }
summary { width: fit-content; color: #9cc5e8; cursor: pointer; }
.formula { margin: 8px 0; padding: 7px; background: #181f21; border-radius: 5px; overflow-wrap: anywhere; font: 11px/1.4 ui-monospace, SFMono-Regular, monospace; }
.metric table { width: 100%; border-collapse: collapse; text-align: left; table-layout: fixed; }
.metric th, .metric td { padding: 4px 3px; border-bottom: 1px solid #394345; vertical-align: top; overflow-wrap: anywhere; }
.metric th { color: #a5afb1; font-weight: 500; }
.metric th:first-child { width: 30%; }
.metric th:nth-child(2), .metric th:nth-child(3) { width: 18%; }
.metric .source, .metric .limits { margin: 8px 0 0; overflow-wrap: anywhere; }
.assumption { display: inline-block; margin-left: 4px; padding: 1px 4px; background: #4b493c; border-radius: 4px; color: #d6c99d; font-size: 10px; }
.message { padding: 9px; border-left: 3px solid #4a7aa8; border-radius: 4px; background: #1d2932; }
.compare-selects { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 13px; }
.compare-selects label { color: #b8c4c2; font-size: 12px; }
.compare-selects select { margin-top: 4px; }
.compare-scroll { overflow-x: auto; }
.compare-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 11px; }
.compare-table th, .compare-table td { border-bottom: 1px solid #394345; padding: 8px 3px; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.compare-table th:first-child, .compare-table td:first-child { width: 40%; text-align: left; white-space: normal; overflow-wrap: anywhere; }
.compare-table th:nth-child(2), .compare-table th:nth-child(3) { width: 16%; }
.compare-table th:last-child { width: 28%; white-space: normal; overflow-wrap: anywhere; }
.compare-table th { color: #a5afb1; font-weight: 500; }
.compare-unit { color: #9da9aa; font-size: 10px; font-weight: 400; }
.delta-up { color: #9bd3ac; }
.delta-down { color: #dfa69d; }
.analysis { grid-column: 1 / -1; }
.analysis h2 { margin-bottom: 4px; }
.analysis h2 small { margin-left: 7px; color: #a5afb1; font-size: 11px; font-weight: 400; white-space: nowrap; }
.analysis p { margin: 0; color: #c5cecc; font-size: 12px; }
.footer { margin-top: 10px; padding: 5px 10px; color: #879396; font-size: 11px; }
.footer p { margin: 0; }
.footer a { color: #9bc4e5; }
@media (min-width: 1100px) {
  .page { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 0; height: 100vh; overflow: hidden; }
  .grid { min-height: 0; grid-template-rows: minmax(0, 1fr) 110px; }
  .controls, .metrics { min-height: 0; overflow: auto; scrollbar-color: #526063 transparent; scrollbar-width: thin; }
  .map-panel { height: 100%; min-height: 0; }
}
@media (max-width: 1099px) {
  .grid { grid-template-columns: minmax(0, 1fr); }
  .map-panel { order: -1; height: 55vh; }
  .analysis { grid-column: auto; }
}
@media (max-width: 700px) {
  .header-meta { align-self: start; flex-direction: column; gap: 4px; font-size: 10px; }
}
@media (max-width: 480px) {
  .page { padding: 7px; }
  .header { gap: 4px; }
  .brand { font-size: 17px; }
  .panel { padding: 13px; }
  .map-panel { min-height: 0; height: 48vh; }
}
