:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --bg: #f6f6f3;
  --surface: #ffffff;
  --surface-2: #f0f0ec;
  --line: #e2e2dc;
  --line-2: #d0d0c8;
  --fg: #22262a;
  --fg-2: #494e52;
  --muted: #7a7f84;
  --accent: #0e7c7b;
  --accent-2: #0b5e5d;
  --accent-soft: #e2f1f0;
  --warn: #b26b00;
  --warn-soft: #fbf0dc;
  --fail: #b4432f;
  --fail-soft: #f8e3de;
  --pass: #2e7d4f;
  --pass-soft: #e1f2e7;
  --info: #3c6aa8;
  --info-soft: #e3ebf6;
  --cal: #6b3fa0;
  --cal-soft: #efe7f8;
  --flash: rgba(14, 124, 123, 0.22);
  --c1: #0e7c7b;   /* main series */
  --c2: #d08a2e;   /* secondary */
  --c3: #6b7bb8;
  --c-loss: #c25b3a;
  --c-gain: #3f8f5f;
  --pos: #c25b3a;
  --neg: #3c6aa8;
  --h-prior: rgba(122, 127, 132, 0.35);
  --h-post: rgba(14, 124, 123, 0.55);
  --shadow: 0 1px 2px rgba(0,0,0,.05), 0 4px 14px rgba(0,0,0,.05);
  --radius: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131517; --surface: #1b1e21; --surface-2: #23272b; --line: #2d3136; --line-2: #3a3f45;
    --fg: #e6e6e3; --fg-2: #c3c5c6; --muted: #8b9096; --accent: #3fb8b5; --accent-2: #66cfcc; --accent-soft: #163433;
    --warn: #e0a043; --warn-soft: #3a2d17; --fail: #e47a63; --fail-soft: #3d221c; --pass: #5fbf86; --pass-soft: #19301f;
    --info: #7ea6e0; --info-soft: #1b2738; --cal: #c3a0f0; --cal-soft: #2c2240; --flash: rgba(63, 184, 181, 0.28); --c1: #3fb8b5; --c2: #e0a043; --c3: #95a3e0; --c-loss: #e47a63; --c-gain: #5fbf86;
    --pos: #e47a63; --neg: #7ea6e0; --h-prior: rgba(160, 165, 170, 0.3); --h-post: rgba(63, 184, 181, 0.55);
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131517; --surface: #1b1e21; --surface-2: #23272b; --line: #2d3136; --line-2: #3a3f45;
  --fg: #e6e6e3; --fg-2: #c3c5c6; --muted: #8b9096; --accent: #3fb8b5; --accent-2: #66cfcc; --accent-soft: #163433;
  --warn: #e0a043; --warn-soft: #3a2d17; --fail: #e47a63; --fail-soft: #3d221c; --pass: #5fbf86; --pass-soft: #19301f;
  --info: #7ea6e0; --info-soft: #1b2738; --cal: #c3a0f0; --cal-soft: #2c2240; --flash: rgba(63, 184, 181, 0.28); --c1: #3fb8b5; --c2: #e0a043; --c3: #95a3e0; --c-loss: #e47a63; --c-gain: #5fbf86;
  --pos: #e47a63; --neg: #7ea6e0; --h-prior: rgba(160, 165, 170, 0.3); --h-post: rgba(63, 184, 181, 0.55);
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--fg); font: 15px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 18px; border-bottom: 1px solid var(--line); background: var(--surface); position: sticky; top: 0; z-index: 20; }
.top h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.top .sub:empty { visibility: hidden; }
/* the logo, and the links to the author's homepage and to the source code (user, 2026-11-18) */
.top .brand { flex: none; display: block; width: 24px; height: 24px; margin-right: -6px; }
.toplink { flex: none; display: inline-flex; align-items: center; color: var(--muted); font-size: 12.5px; text-decoration: none; white-space: nowrap; }
.toplink:hover { color: var(--fg); }
.toplink svg { display: block; }
.top .region { flex: none; margin-left: -6px; padding: 1px 9px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 12px; line-height: 1.5; color: var(--fg-2); white-space: nowrap; }
#theme .ti { display: none; }
.top .sub { color: var(--muted); font-size: 12.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn { border: 1px solid var(--line-2); background: var(--surface); border-radius: 8px; padding: 6px 12px; cursor: pointer; white-space: nowrap; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.small { padding: 3px 9px; font-size: 13px; }
.langsw { display: inline-flex; border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; background: var(--surface); flex: none; }
.langsw button { font: inherit; font-size: 12.5px; line-height: 1.5; padding: 3px 9px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.langsw button + button { border-left: 1px solid var(--line); }
.langsw button:hover { color: var(--fg); }
.langsw button[aria-pressed="true"] { background: var(--accent-soft); color: var(--fg); font-weight: 600; cursor: default; }
.btn:disabled { opacity: .5; cursor: default; }

.app { display: grid; grid-template-columns: minmax(380px, 40%) 1fr; height: calc(100vh - 51px); }
.mapcol { position: relative; border-right: 1px solid var(--line); min-height: 0; display: flex; flex-direction: column; }
#map { flex: 1; min-height: 300px; }
.search { position: absolute; top: 12px; left: 12px; right: 12px; z-index: 5; max-width: 440px; }
.search input { width: 100%; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); box-shadow: var(--shadow); outline: none; }
.search input:focus { border-color: var(--accent); }
.qres { margin-top: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); max-height: 320px; overflow: auto; }
.qres:empty { display: none; }
.qres button { display: block; width: 100%; text-align: left; border: 0; background: none; padding: 7px 12px; cursor: pointer; border-bottom: 1px solid var(--line); }
.qres button:hover { background: var(--accent-soft); }
.qres small { color: var(--muted); }
.presets { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--surface); }
.chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line-2); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; background: var(--surface); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.static { cursor: default; }
.chip.static:hover { border-color: var(--line-2); color: inherit; }
.maphint:empty { display: none; }
.maphint { position: absolute; bottom: 64px; left: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--muted); box-shadow: var(--shadow); z-index: 4; }
.maplibregl-ctrl-bottom-left .citylegend { margin: 0 0 10px 10px; }
.citylegend { background: var(--surface); border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow); padding: 7px 10px 6px; font-size: 12px; color: var(--muted); min-width: 0; max-width: calc(100% - 24px); }
.citylegend .cl-head { display: flex; align-items: center; gap: 6px; }
.citylegend select { font: inherit; font-size: 12.5px; color: var(--fg); background: none; border: 0; padding: 0; flex: 0 1 auto; min-width: 0; cursor: pointer; }
.citylegend .cl-head .tip { flex: none; }
.citylegend .cl-ramp { display: flex; gap: 2px; margin-top: 6px; padding-bottom: 17px; }
.citylegend .cl-sw { position: relative; width: 34px; height: 9px; border-radius: 2px; }
.citylegend .cl-sw i { position: absolute; right: -1px; top: 11px; transform: translateX(50%); font-style: normal; font-size: 11px; font-variant-numeric: tabular-nums; color: var(--muted); }
.citylegend .cl-unit { font-size: 11px; }
/* a narrow map: the expanded attribution (bottom right) would run into the legend, so the legend sits above its row */
#map { container-type: inline-size; }
@container (max-width: 720px) { .maplibregl-ctrl-bottom-left .citylegend { margin-bottom: 34px; } }
.citytip { position: absolute; z-index: 5; pointer-events: none; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow); padding: 3px 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.citytip b { color: var(--fg); font-weight: 600; }
/* which data would narrow the range most (building card) */
details.voi > summary { cursor: pointer; list-style: none; margin-bottom: 0; }
details.voi > summary::-webkit-details-marker { display: none; }
details.voi > summary h3::before { content: '▸'; display: inline-block; width: 1em; color: var(--muted); transition: transform 0.15s; }
details.voi[open] > summary h3::before { transform: rotate(90deg); }
details.voi[open] > summary { margin-bottom: 8px; }
#ov-voi .voi-now { font-size: 13px; color: var(--fg-2); font-variant-numeric: tabular-nums; margin-bottom: 8px; }
#ov-voi .voi-now b { color: var(--fg); font-weight: 600; }
#ov-voi .voi-have { display: flex; flex-wrap: wrap; gap: 4px 6px; margin-bottom: 10px; }
#ov-voi .vchip { font: inherit; font-size: 12px; border: 1px dashed var(--line-2); border-radius: 999px; padding: 1px 8px; color: var(--muted); background: none; cursor: pointer; }
#ov-voi .vchip:hover { border-color: var(--fg-2); }
#ov-voi .vchip b { font-weight: 500; color: var(--fg-2); }
#ov-voi .vchip.ok { border: 1px solid transparent; background: var(--pass-soft); }
#ov-voi .vchip.ok b { color: var(--fg); }
#ov-voi .voi-list { display: grid; gap: 5px; font-size: 13px; }
#ov-voi .voi-row { display: grid; grid-template-columns: 14.5em minmax(50px, 1fr) 11.5em 1em; grid-template-areas: "name bar val btn"; gap: 10px; align-items: center; cursor: pointer; border-radius: 6px; padding: 1px 4px; margin: 0 -4px; }
#ov-voi .voi-row:hover { background: var(--surface-2); }
#ov-voi .voi-go { font: inherit; color: var(--fg); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
#ov-voi .voi-go:hover { text-decoration-color: currentColor; }
#ov-voi .voi-flat .voi-go { color: var(--muted); font-size: 12px; }
#ov-voi .voi-chev { color: var(--muted); }
#ov-voi .voi-name { grid-area: name; display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px; min-width: 0; }
#ov-voi .voi-row > .voi-bar { grid-area: bar; }
#ov-voi .voi-row > .voi-val { grid-area: val; }
#ov-voi .voi-row > :last-child { grid-area: btn; justify-self: end; }
#ov-voi .voi-bar { position: relative; height: 8px; background: var(--surface-2); border-radius: 2px; }
#ov-voi .voi-bar i { position: absolute; inset: 0 auto 0 0; background: var(--c1); border-radius: 2px; }
#ov-voi .voi-bar i.rng { opacity: 0.35; border-radius: 0 2px 2px 0; }
#ov-voi .voi-val { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
#ov-voi .voi-val small { color: var(--c-gain); margin-left: 6px; font-size: 12px; }
#ov-voi .voi-flat { margin-top: 6px; font-size: 12px; color: var(--muted); }
#ov-voi .voi-sub { margin: 10px 0 5px; font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { #ov-voi .voi-row { grid-template-columns: 1fr auto 1em; grid-template-areas: "name val btn" "bar bar bar"; gap: 3px 8px; margin-bottom: 4px; } }
.citytip.wide { white-space: normal; width: max-content; max-width: min(330px, calc(100% - 16px)); line-height: 1.45; padding: 5px 9px; }
.citylegend .cl-scen { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; max-width: 100%; }
.citylegend .cl-cats { display: grid; gap: 3px; margin: 7px 0 2px; color: var(--fg); font-size: 12px; }
.citylegend .cl-cats span { display: flex; align-items: center; gap: 6px; }
.citylegend .cl-cats i { flex: none; width: 14px; height: 9px; border-radius: 2px; }
.mapbusy { position: absolute; top: 60px; left: 12px; background: var(--surface); border: 1px solid var(--accent); color: var(--accent); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; z-index: 4; }

.detail { overflow: auto; min-height: 0; min-width: 0; padding: 0 0 40px; }
.mapcol, .panel, .card { min-width: 0; }
.empty { padding: 48px 40px; max-width: 760px; color: var(--fg-2); }
.empty h2 { font-size: 22px; margin: 0 0 12px; color: var(--fg); }
.empty .steps { list-style: none; padding: 0; margin: 20px 0 28px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.empty .steps li { border-top: 2px solid var(--line-2); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.empty .steps b { color: var(--accent); font-size: 20px; line-height: 1; }
.tierkey { display: flex; flex-wrap: wrap; gap: 6px; }
.empty { display: flex; flex-direction: column; min-height: 100%; }
.structnote { margin: 0 0 32px; padding: 0 0 20px; border-bottom: 1px solid var(--line); }
.structnote h2 .addr { font-size: 13px; font-weight: 400; margin-left: 6px; }
.structnote p { margin: 6px 0 0; color: var(--fg); }
.structnote .why { color: var(--muted); font-size: 13.5px; max-width: 62ch; }
.empty .srcs { margin: auto 0 0; padding-top: 44px; font-size: 12.5px; color: var(--muted); }
.empty .srcs h3 { font-size: 12.5px; font-weight: 600; margin: 0 0 4px; color: var(--muted); }
.empty .srcs ul { list-style: none; margin: 0; padding: 0; }
.disclaimer { font-size: 11.5px; line-height: 1.55; color: var(--muted); max-width: 760px; }
.empty .srcs .disclaimer { margin: 18px 0 0; }
#content > .disclaimer { margin: 4px 24px 0; }
.empty .srcs li { display: grid; grid-template-columns: minmax(0, 14em) minmax(0, 1fr) auto; gap: 2px 16px; align-items: baseline; padding: 5px 0; border-top: 1px solid var(--line); }
.empty .srcs a { color: inherit; font-weight: 500; text-decoration: none; }
.empty .srcs a:hover { color: var(--fg-2); text-decoration: underline; }
.empty .srcs .lic { grid-column: 3; font-size: 11.5px; white-space: nowrap; }
.tierkey .src { font-size: 12.5px; padding: 1px 8px; }
.bhead { padding: 18px 24px 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
.bhead h2 { margin: 0; font-size: 21px; }
.bhead .addr { color: var(--muted); font-size: 13.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 24px 10px; }
.facts { display: flex; flex-wrap: wrap; row-gap: 2px; padding: 0 24px 12px; font-size: 13.5px; color: var(--fg-2); }
.facts > :not(:last-child)::after { content: '·'; margin: 0 8px; color: var(--muted); }
.facts button.fact { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.facts button.fact:hover, .facts button.fact:focus-visible { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; outline: none; }

.facts small { color: var(--muted); font-size: 12px; margin-left: 4px; }
.facts .cal { color: var(--cal); }
.bhead .addr a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
.bhead .addr a:hover { color: var(--accent); }
.src { font-size: 11.5px; border-radius: 5px; padding: 0 6px; white-space: nowrap; border: 1px solid transparent; }
.src.osm, .src.geometry, .src.lod2 { background: var(--pass-soft); color: var(--pass); }
.src.archetype, .src.profile, .src.zensus { background: var(--info-soft); color: var(--info); }
.src.default { background: var(--warn-soft); color: var(--warn); }
.src.user { background: var(--surface-2); color: var(--fg-2); border-color: var(--line-2); }
.src.calibrated { background: var(--cal-soft); color: var(--cal); }
.tip { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; margin-left: 6px; border-radius: 50%; border: 1px solid var(--line-2); color: var(--muted); font-size: 10.5px; font-weight: 600; font-style: normal; cursor: help; vertical-align: 2px; }
.tip:hover, .tip:focus { color: var(--accent); border-color: var(--accent); outline: none; }
.card-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 14px; margin-bottom: 8px; }
.card-head h3 { margin: 0; }
.counts { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.card-head .aside { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px 16px; margin: 12px 0 0; }
.stats div { min-width: 0; }
.stats dt { color: var(--muted); font-size: 12px; }
.stats dd { margin: 0; font-variant-numeric: tabular-nums; }
details.adv { margin-top: 12px; }
details.adv summary { cursor: pointer; color: var(--muted); font-size: 13px; }
details.adv[open] summary { margin-bottom: 8px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; padding: 4px 24px 14px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; min-width: 0; }
.kpi .k { color: var(--muted); font-size: 12.5px; }
.kpi .v { font-size: 24px; font-weight: 700; line-height: 1.25; font-variant-numeric: tabular-nums; }
.kpi .v small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.kpi.go { cursor: pointer; position: relative; transition: border-color .15s; }
.kpi.go::after { content: '›'; position: absolute; top: 6px; right: 12px; color: var(--muted); font-size: 17px; line-height: 1; }
.kpi.go:hover, .kpi.go:focus-visible { border-color: var(--accent); outline: none; }
.kpi.go:hover::after, .kpi.go:focus-visible::after { color: var(--accent); }
.rb[data-go] { cursor: pointer; border-radius: 4px; }
.rb[data-go]:hover .rb-track { box-shadow: 0 0 0 1px var(--accent); }
.kpi .r { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rb { display: flex; align-items: center; gap: 6px; margin-top: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rb-track { position: relative; flex: 1; height: 6px; background: var(--surface-2); border-radius: 3px; }
.rb-band { position: absolute; top: 0; bottom: 0; background: var(--h-prior); border-radius: 3px; }
.rb-band.wide { opacity: 0.45; }
.rb-band.post { background: var(--h-post); top: 1px; bottom: 1px; }
.rb-pt { position: absolute; top: -3px; width: 2px; height: 12px; margin-left: -1px; background: var(--fg); border-radius: 1px; }
.lod2cmp { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 10px; max-width: 520px; }
.lod2cmp h4 { margin: 0; font-size: 13.5px; }
.lod2cmp th.num { text-align: right; }
.lod2cmp td.on { font-weight: 700; color: var(--fg); }
.lod2cmp td.num:not(.on) { color: var(--muted); }
.lod2src { margin: 6px 0 0; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
/* Heizspiegel scale: four bands, the point value as a line, the prior band below, band limits underneath */
.cls { display: inline-block; min-width: 34px; text-align: center; border-radius: 6px; color: #fff; font-weight: 800; padding: 0 6px; margin-right: 6px; }

.tabs { display: flex; gap: 2px; padding: 0 14px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); z-index: 6; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }   /* German tab names are longer; still scrolls when the column is narrow */
.tabs button { border: 0; background: none; padding: 9px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); font-weight: 600; }
.tabs button .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-left: 5px; vertical-align: 1px; }
.panel { padding: 16px 24px; display: none; }
.panel.on { display: block; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.card h3 { margin: 0 0 8px; font-size: 15px; }
.card, .chain, .calc-row, table.t tr { scroll-margin-top: 60px; }
.card:focus, .chain:focus, table.t tr:focus { outline: none; }
/* Arrival highlight for drill-down targets: a row (or chain, stat, step) blinks twice; a whole card gets a ring. */
@keyframes blink-bg { 0%, 35%, 75%, 100% { background-color: transparent; } 15%, 55% { background-color: var(--flash); } }
@keyframes blink-ring { 0%, 35%, 100% { box-shadow: 0 0 0 0 transparent; } 15%, 55% { box-shadow: 0 0 0 3px var(--accent); } 75% { box-shadow: 0 0 0 3px transparent; } }
@keyframes fade-bg { 0% { background-color: var(--flash); } 100% { background-color: transparent; } }
.card.flash { animation: blink-ring 1.6s ease-in-out; }
tr.flash > td, .chain.flash, .calc-row.flash, .stats > div.flash, .step.flash { animation: blink-bg 1.6s ease-in-out; }
.chain.flash, .calc-row.flash, .stats > div.flash { border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  .card.flash { animation: none; box-shadow: 0 0 0 2px var(--accent); }
  tr.flash > td, .chain.flash, .calc-row.flash, .stats > div.flash, .step.flash { animation: fade-bg 2s ease-out; }
}
.chain { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; padding: 6px; margin: 0 -6px 6px; border-radius: 10px; }
.chain .step { display: flex; flex-direction: column; gap: 1px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; background: var(--surface); min-width: 0; text-align: left; font: inherit; color: inherit; }
.chain button.step { cursor: pointer; }
.chain button.step:hover, .chain button.step:focus-visible { border-color: var(--accent); outline: none; }
.chain .step.total { border-color: var(--line-2); background: var(--surface-2); }
.chain .sl { color: var(--muted); font-size: 12px; }
.chain .sv { font-weight: 650; font-variant-numeric: tabular-nums; }
.chain .ss { color: var(--muted); font-size: 11.5px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chain .src { margin-top: 3px; }
svg rect.sel { fill: var(--accent-soft); }
svg .lbl.on { fill: var(--fg); font-weight: 600; }
svg rect.hit { cursor: pointer; outline: none; }
svg rect.hit:focus-visible { stroke: var(--accent); stroke-width: 1.5; }
.calc { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 10px; }
.calc:empty { display: none; }
.calc-row { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 6px 10px; align-items: center; }
.calc-row + .calc-row { margin-top: 2px; }
.calc-row .chain { margin: 0; }
.calc-t { color: var(--fg-2); font-size: 12.5px; font-weight: 600; }
#bal-chain .calc-row, .grid2 .calc-row { grid-template-columns: minmax(0, 1fr); }
.grid2 .calc-row .calc-t { margin-bottom: -2px; }
button.linkish { border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
button.linkish:hover, button.linkish:focus-visible { color: var(--accent); text-decoration: underline dotted; text-underline-offset: 3px; outline: none; }
tr.expand { cursor: pointer; }
tr.expand:hover td { background: var(--surface-2); }
tr.expand[aria-expanded="true"] td { background: var(--accent-soft); }
tr.refrow > td { background: var(--surface-2); padding: 8px 12px 12px; }
ul.refs { list-style: none; padding: 0; margin: 6px 0 0; display: grid; gap: 4px; font-size: 13px; }
ul.refs li { line-height: 1.5; }
ul.refs a { white-space: nowrap; }
button.srcbtn { cursor: pointer; font: inherit; font-size: 11.5px; }
button.srcbtn:hover, button.srcbtn[aria-expanded="true"] { box-shadow: 0 0 0 1px currentColor; }
@media (max-width: 560px) { .calc-row { grid-template-columns: minmax(0, 1fr); } }
.chain .op { align-self: center; color: var(--muted); font-size: 18px; padding: 0 2px; }
.card .hint { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.viewer { height: 440px; border-radius: 8px; overflow: hidden; position: relative; background: var(--surface-2); }
.viewer-tools { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; margin-top: 10px; font-size: 13px; }
.viewer-tools label { display: inline-flex; align-items: center; gap: 6px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.legend .bar { width: 160px; height: 10px; border-radius: 3px; }
.pick:empty { display: none; }
.pick { font-size: 13px; color: var(--fg-2); min-height: 20px; margin-top: 6px; }

table.t { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.t th, table.t td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t th { color: var(--muted); font-weight: 500; font-size: 12.5px; }
table.t td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
table.t td.nm { white-space: nowrap; }
table.t tr.grp td { background: var(--surface-2); font-weight: 600; color: var(--fg-2); font-size: 12.5px; }
table.t input[type=number] { width: 90px; padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); text-align: right; }
.tblwrap { overflow-x: auto; }
table.t select { max-width: 240px; text-overflow: ellipsis; padding: 3px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); }
.note { color: var(--muted); font-size: 12.5px; }
.status { white-space: nowrap; display: inline-block; font-size: 12px; font-weight: 600; border-radius: 5px; padding: 0 7px; }
.status.pass { background: var(--pass-soft); color: var(--pass); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.fail { background: var(--fail-soft); color: var(--fail); }
.status.info { background: var(--info-soft); color: var(--info); }
.form { display: grid; grid-template-columns: 160px 1fr; gap: 8px 12px; align-items: center; font-size: 14px; }
.form input[type=number], .form select, .form input[type=text] { padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 7px; background: var(--surface); max-width: 260px; }
.months { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.months input { width: 100%; padding: 4px 6px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--surface); text-align: right; }
.months label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.progress { height: 6px; background: var(--surface-2); border-radius: 3px; overflow: hidden; margin: 10px 0; }
.progress > div { height: 100%; background: var(--accent); width: 0; }
.small-multiples { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.small-multiples .sm { border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; }
.small-multiples .sm .shr { font-size: 12px; color: var(--muted); }
.legend-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); margin-right: 14px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.callout { background: var(--accent-soft); padding: 8px 12px; border-radius: 8px; font-size: 13.5px; margin: 8px 0; }
.callout.warn { background: var(--warn-soft); }
.method h4 { margin: 14px 0 4px; font-size: 14.5px; }
.method p, .method li { font-size: 14px; color: var(--fg-2); }
.method code { font-family: var(--mono); font-size: 12.5px; background: var(--surface-2); padding: 0 4px; border-radius: 4px; }

svg .grid { stroke: var(--line); stroke-width: 1; }
svg .axis { stroke: var(--line-2); stroke-width: 1; }
svg .tick { fill: var(--muted); font-size: 11px; }
svg .tick.sub { font-size: 10px; }
svg .lbl { fill: var(--fg-2); font-size: 12px; }
svg .val { fill: var(--fg-2); font-size: 12px; font-variant-numeric: tabular-nums; }
svg .band { stroke: var(--fg-2); stroke-width: 1.3; opacity: .7; }
svg .meas { fill: var(--surface); stroke: var(--c2); stroke-width: 2.5; }
svg .truth { stroke: var(--c2); stroke-width: 2; }
svg .h-prior { fill: var(--h-prior); }
svg .h-post { fill: var(--h-post); }
svg .c-prior { fill: var(--h-prior); }
svg .c-post { fill: var(--c1); }
.chart-tip { position: absolute; pointer-events: none; background: var(--surface); border: 1px solid var(--line-2); border-radius: 7px; padding: 5px 9px; font-size: 12.5px; box-shadow: var(--shadow); z-index: 10; min-width: 120px; }

@media (max-width: 1360px) and (min-width: 1101px) { .tabs button { padding: 9px 7px; } }
@media (max-width: 1100px) {
  .app { grid-template-columns: minmax(0, 1fr); height: auto; }
  .mapcol { height: 62vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail { overflow: visible; }
  .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .top { padding: 8px 12px; gap: 12px; }
  .top .sub { display: none; }
  .top #home { display: none; }   /* the homepage stays linked in the licence line of the start page */
  .top .region, #theme .tt { display: none; }
  #theme { padding: 5px 8px; } #theme .ti { display: block; }
  .top h1 { flex: 1; font-size: 15.5px; }
  .panel, .bhead, .chips, .facts, .kpis { padding-left: 16px; padding-right: 16px; }
  .empty { padding: 28px 16px; }
  .empty .steps { grid-template-columns: 1fr; }
  .maplibregl-ctrl-bottom-left .citylegend { margin-bottom: 36px; }   /* the attribution spans the whole width on phones */
  .empty .srcs li { grid-template-columns: minmax(0, 1fr) auto; }
  .empty .srcs .what { grid-column: 1 / -1; grid-row: 2; }
  .empty .srcs .lic { grid-column: 2; grid-row: 1; }
  .form { grid-template-columns: 1fr; }
  .months { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid3 { grid-template-columns: 1fr; }
}


.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; margin: 6px 0 4px; }
.ph { display: flex; flex-direction: column; gap: 2px; color: inherit; text-decoration: none; font-size: 12.5px; min-width: 0; }
.ph img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); background: var(--surface-2); }
.ph:hover img { border-color: var(--accent); }
.ph-k b { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #b35c00; color: #fff; font-size: 10px; }
[data-theme="dark"] .ph-k b { background: #f2b33d; color: #1b1e21; }
.ph-c { color: var(--muted); font-size: 11.5px; overflow-wrap: anywhere; }
.ph-line { font-size: 13.5px; color: var(--fg-2); margin: 4px 0; }
.ph-line.mute { color: var(--muted); }
#ov-mly .mly-link { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line-2); }
#ov-mly .mly-link:hover { color: var(--accent); }
.ph-pano { display: block; width: 100%; aspect-ratio: 4 / 3; border-radius: 6px; border: 1px solid var(--line); background-color: var(--surface-2); background-size: auto 220%; background-repeat: repeat-x; }
.ph:hover .ph-pano { border-color: var(--accent); }
.ph-frame { position: relative; display: block; }
.ph-frame img, .ph-frame .ph-pano { display: block; }
/* where the building is in the picture: a small orange notch at the top and the bottom edge */
.ph-at { position: absolute; left: 50%; top: 0; bottom: 0; width: 0; pointer-events: none; }
.ph-at::before, .ph-at::after { content: ''; position: absolute; left: -6px; border: 6px solid transparent; }
.ph-at::before { top: 0; border-top: 9px solid #b35c00; }
.ph-at::after { bottom: 0; border-bottom: 9px solid #b35c00; }
[data-theme="dark"] .ph-at::before { border-top-color: #f2b33d; }
[data-theme="dark"] .ph-at::after { border-bottom-color: #f2b33d; }
/* Street walk (js/walk.js): the synthetic 3D street over the upper part of the map column, the map visible below; in
   full screen the map column fills the screen and the map becomes a small map in the corner */
.walk { position: absolute; left: 0; right: 0; top: 0; height: 72%; z-index: 6; background: #15181b; border-bottom: 1px solid var(--line); }
.walk > .walk-view { position: absolute; inset: 0; }
.walk-view canvas { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.walk-view canvas:active { cursor: grabbing; }
.walk-msg { position: absolute; left: 14px; top: 14px; margin: 0; color: #c9cdd1; font-size: 13px; z-index: 1; }
.walk-bar { position: absolute; top: 10px; right: 10px; z-index: 3; display: flex; gap: 6px; align-items: center; }
.walk-btn { display: inline-flex; align-items: center; height: 28px; padding: 0 10px; border-radius: 8px; border: 1px solid rgba(255,255,255,.24); background: rgba(21,24,27,.74); color: #f2f2ee; font: inherit; font-size: 12.5px; text-decoration: none; cursor: pointer; }
.walk-btn:hover, .walk-btn:focus-visible { border-color: rgba(255,255,255,.6); outline: none; }
.walk-x { font-size: 18px; line-height: 1; padding: 0 9px; }
.walk-bar .tip { margin: 0 2px 0 0; color: #c9cdd1; border-color: rgba(255,255,255,.34); background: rgba(21,24,27,.74); }
.walk-hint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); margin: 0; max-width: calc(100% - 24px); padding: 5px 12px; border-radius: 999px; background: rgba(21,24,27,.74); color: #f2f2ee; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; z-index: 2; transition: opacity .8s; }
.walk-hint.gone { opacity: 0; }
.walk-tag { position: absolute; z-index: 4; max-width: 240px; padding: 4px 9px; border-radius: 7px; background: rgba(21,24,27,.82); color: #f2f2ee; font-size: 12.5px; pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.walk-pad { position: absolute; right: 12px; bottom: 12px; z-index: 3; display: none; flex-direction: column; gap: 8px; }
.walk-pad .walk-btn { width: 46px; height: 46px; justify-content: center; font-size: 17px; padding: 0; }
@media (hover: none) { .walk-pad { display: flex; } }
.viewer-tools .walkbtn { margin-left: auto; }
@media (max-width: 560px) { .walk { height: 78%; } .walk-bar { top: auto; right: auto; bottom: 10px; left: 10px; } .walk-hint { bottom: auto; top: 12px; } }
.mapcol.walk-full { background: #15181b; }
.mapcol.walk-full .walk { height: 100%; border-bottom: 0; }
.mapcol.walk-full #map { position: absolute; right: 16px; bottom: 16px; width: min(340px, 36%); height: min(250px, 34%); min-height: 0; z-index: 8; border-radius: 10px; overflow: hidden; border: 2px solid rgba(255,255,255,.75); box-shadow: 0 6px 22px rgba(0,0,0,.35); }
.mapcol.walk-full .search, .mapcol.walk-full .presets, .mapcol.walk-full .maphint, .mapcol.walk-full .maplibregl-ctrl-top-right, .mapcol.walk-full .maplibregl-ctrl-bottom-left { display: none; }
.mapcol.walk-full .walk-pad { right: auto; left: 12px; }
.mapcol.walk-full .maplibregl-ctrl-attrib { font-size: 9px; line-height: 1.3; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }   /* the credit stays, on one small line */
