/* Layout: sticky header with search; left panel (reading column) + right map that stays in view.
   Look (since 2026-11-27): a "polar" palette in two themes, light (Daylight) and dark (Midnight),
   chosen by html[data-theme] — set before paint by pages::theme_script from the visitor's choice
   (localStorage) or the system's; without script the light theme applies. Inter for text, a display
   serif for headings (DM Serif Display; Prata carries Cyrillic), JetBrains Mono for figures and
   small labels, frosted ("glass") chrome over the map. Fonts: static/fonts (SIL OFL 1.1). */
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Inter"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(fonts/inter-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/dm-serif-display-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/dm-serif-display-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Prata"; font-style: normal; font-weight: 400; font-display: swap; src: url(fonts/prata-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/jetbrains-mono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/jetbrains-mono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "JetBrains Mono"; font-style: normal; font-weight: 400 600; font-display: swap; src: url(fonts/jetbrains-mono-cyrillic.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }

/* Colours that app.js reads (cssVar) stay hex or rgba() with commas: canvas and MapLibre parse them. */
:root {
  /* canvas, surfaces, text */
  --bg: #f0f4fa;
  --panel: #ffffff;
  --ink: #0d1b2a;
  --muted: #475569;
  --faint: #64748b;
  --line: #dde4ed;
  --soft: #edf2f8;              /* hovered rows, table heads, bar tracks */
  --wash-1: rgba(0, 95, 204, 0.06);
  --wash-2: rgba(0, 168, 168, 0.045);
  /* interactive */
  --accent: #005fcc;
  --accent-soft: #e8f1fc;
  --accent-ring: rgba(0, 95, 204, 0.16);
  --sel: #005fcc;               /* pressed lenses, chosen chips, primary buttons */
  --sel-hover: #004db3;
  --sel-ink: #ffffff;
  --ctl: rgba(241, 245, 250, 0.9);        /* inputs, secondary buttons, pills */
  --ctl-line: #d2dce9;
  --ctl-line-hover: #a6b8ce;
  --glass: rgba(255, 255, 255, 0.88);     /* header and floating map chrome */
  --glass-line: rgba(15, 23, 42, 0.1);
  --field: #ffffff;                       /* form fields in the page */
  --field-line: #c6d2e1;
  --field-line-hover: #93a7bf;
  --field-h: 40px;                        /* field height; the header, filters and map chrome set smaller */
  --field-fs: 0.94rem;                    /* field text; 16 px on phones (iOS zooms into smaller) */
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%237f93ab' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 4.5 3.5 3.5 3.5-3.5'/%3E%3C/svg%3E");
  --magnifier: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%237f93ab' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E");
  /* meaning */
  --up: #1a7a45;
  --down: #b83232;
  --warn: #8a5a00;
  --warn-bg: #fdf4e3;
  --flat: #64748b;
  --c1: #2f62b0;              /* selected area */
  --c2: #8b9198;              /* city */
  --c3: #c58a17;              /* osiedle */
  --c4: #9b3fb3;              /* second place in comparison */
  --cp: #3168c9;              /* primary market */
  --cs: #d9822b;              /* secondary market */
  --r0: #e6eff5; --r1: #c0d7ea; --r2: #96b9dc; --r3: #6f97cb; --r4: #5874b6; --r5: #4c529a; --r6: #3d3478;
  /* elevation, shape, type */
  --sh-card: 0 1px 4px rgba(11, 29, 58, 0.06);
  --sh-card-hover: 0 6px 20px rgba(11, 29, 58, 0.1);
  --sh-float: 0 10px 28px -10px rgba(13, 27, 42, 0.22), 0 2px 6px rgba(13, 27, 42, 0.06);
  --radius: 12px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "DM Serif Display", Prata, Georgia, "Times New Roman", serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --header: 64px;
  color-scheme: light;
}
html[data-theme="dark"] {
  --bg: #050e1d; --panel: #0a192f; --ink: #f1f5f9; --muted: #94a3b8; --faint: #7489a3;
  --line: rgba(148, 210, 255, 0.14); --soft: #0e233f;
  --wash-1: rgba(14, 165, 233, 0.11); --wash-2: rgba(0, 168, 168, 0.07);
  --accent: #38bdf8; --accent-soft: rgba(56, 189, 248, 0.14); --accent-ring: rgba(56, 189, 248, 0.25);
  --sel: #0377b8; --sel-hover: #0284c7; --sel-ink: #ffffff;
  --ctl: rgba(255, 255, 255, 0.055); --ctl-line: rgba(148, 210, 255, 0.16); --ctl-line-hover: rgba(148, 210, 255, 0.32);
  --glass: rgba(7, 19, 37, 0.9); --glass-line: rgba(148, 210, 255, 0.16);
  --field: rgba(255, 255, 255, 0.06); --field-line: rgba(148, 210, 255, 0.2); --field-line-hover: rgba(148, 210, 255, 0.38);
  --up: #4ade80; --down: #f87171; --warn: #fbbf24; --warn-bg: rgba(245, 158, 11, 0.15); --flat: #94a3b8;
  --c1: #6f9be0; --c2: #9aa1a8; --c3: #e0a83a; --c4: #c77ddb; --cp: #6f9be0; --cs: #eba45a;
  --sh-card: 0 4px 18px rgba(2, 8, 20, 0.42);
  --sh-card-hover: 0 12px 30px rgba(2, 8, 20, 0.62), 0 0 0 1px rgba(56, 189, 248, 0.18);
  --sh-float: inset 0 1px 0 rgba(255, 255, 255, 0.07), 0 22px 48px -12px rgba(2, 8, 20, 0.76);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background:
    radial-gradient(ellipse 85% 460px at 18% 0%, var(--wash-1), transparent 70%) no-repeat,
    radial-gradient(ellipse 70% 380px at 84% 0%, var(--wash-2), transparent 65%) no-repeat,
    var(--bg);
  color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
h1, h2 { line-height: 1.2; text-wrap: balance; margin: 0; }
h1 { font: 400 2rem/1.15 var(--serif); letter-spacing: -0.015em; }
h2 { font: 400 1.3rem/1.25 var(--serif); letter-spacing: -0.01em; }
:is(h1, h2) b { font-weight: inherit; }   /* the serif has one weight: no synthetic bold */
b { font-weight: 600; }
.muted { color: var(--muted); font-weight: 400; }
.num, td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.up { color: var(--up); } .down { color: var(--down); } .flat { color: var(--flat); }

/* form fields: one look for every text, search and number field and every select. Zero
   specificity (:where), so a context changes it with a plain class rule or the --field-* variables. */
:where(input:not([type="checkbox"], [type="radio"], [type="range"], [type="hidden"]), select, textarea) {
  box-sizing: border-box; height: var(--field-h); min-width: 0; padding: 0 12px;
  border: 1px solid var(--field-line); border-radius: 10px; background-color: var(--field); color: var(--ink);
  font: inherit; font-size: var(--field-fs); font-weight: 400; letter-spacing: normal; text-transform: none;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
:where(textarea) { height: auto; min-height: 84px; padding: 9px 12px; }
:where(input, textarea)::placeholder { color: var(--faint); opacity: 1; }
:where(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):hover { border-color: var(--field-line-hover); }
:is(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus-visible,
:where(input:not([type="checkbox"], [type="radio"], [type="range"]), select, textarea):focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-ring); }
:where(input, select, textarea):disabled { opacity: 0.55; cursor: not-allowed; }
input[type="search"] { -webkit-appearance: none; appearance: none; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; font-variant-numeric: tabular-nums; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
select {
  -webkit-appearance: none; appearance: none; padding-right: 32px; cursor: pointer; text-overflow: ellipsis;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 11px center; background-size: 12px;
}
html[data-theme="dark"] select option { background-color: #0a192f; color: #f1f5f9; }  /* Windows draws options in the field's colours */
:where(input[type="radio"]) { width: 18px; height: 18px; margin: 0; flex: none; accent-color: var(--sel); cursor: pointer; }
:where(input[type="checkbox"]) {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin: 0; flex: none; cursor: pointer;
  border: 1.5px solid var(--field-line-hover); border-radius: 5px; background: var(--field) center / 12px no-repeat;
  transition: background-color 0.15s, border-color 0.15s;
}
:where(input[type="checkbox"]):hover { border-color: var(--accent); }
:where(input[type="checkbox"]):checked { background-color: var(--sel); border-color: var(--sel);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23fff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m2.5 6.2 2.3 2.3 4.7-5'/%3E%3C/svg%3E"); }
:where(input[type="checkbox"]):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
:where(input[type="range"]) { accent-color: var(--accent); }

/* header */
.top {
  position: sticky; top: 0; z-index: 20; height: var(--header);
  display: flex; align-items: center; gap: 12px;
  padding: 0 max(18px, env(safe-area-inset-right)) 0 max(18px, env(safe-area-inset-left));
  background: var(--glass); -webkit-backdrop-filter: blur(20px) saturate(140%); backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid var(--glass-line); box-shadow: 0 10px 28px -16px rgba(13, 27, 42, 0.2);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 24px; height: 24px; border-radius: 7px; box-shadow: 0 0 0 1px var(--glass-line); background:
  linear-gradient(135deg, var(--r2) 0 33%, var(--r4) 33% 66%, var(--r6) 66%); }
.brand-text { font: 400 1.22rem/1 var(--serif); letter-spacing: -0.012em; }
.brand-text b { font-weight: 400; color: var(--accent); }
/* address search: a field with a magnifier, in the header and in the page */
.search { position: relative; min-width: 0; }
.search input { width: 100%; padding-left: 36px; background-image: var(--magnifier); background-repeat: no-repeat; background-position: 12px 50%; }
.top { --field-h: 38px; --field-fs: 0.9rem; }
.top .search { flex: 1; max-width: 520px; }
.top .search input { background-color: var(--ctl); border-color: var(--ctl-line); }
.top .search input:hover { border-color: var(--ctl-line-hover); }
.top .search input:focus { background-color: var(--panel); border-color: var(--accent); }
.sugg {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 4px; list-style: none;
  background: var(--panel); border: 1px solid var(--glass-line); border-radius: 12px; box-shadow: var(--sh-float);
  max-height: 60vh; overflow: auto;
}
.sugg li { padding: 7px 10px; border-radius: 8px; cursor: pointer; display: grid; gap: 1px; }
.sugg li[aria-selected="true"], .sugg li:hover { background: var(--accent-soft); }
.sugg .s-label { font-weight: 550; }
.sugg .s-sub { font-size: 0.8rem; color: var(--muted); }
.sugg .s-kind { font: 600 0.62rem/1 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin-right: 6px; }
.sugg .s-empty { color: var(--muted); cursor: default; }
/* the main navigation: one capsule of pills */
.nav { display: flex; gap: 2px; margin-left: auto; padding: 3px; border-radius: 999px; background: var(--ctl); border: 1px solid var(--ctl-line); }
.nav a { display: inline-flex; align-items: center; height: 32px; padding: 0 13px; border-radius: 999px; color: var(--muted); font-size: 0.82rem; font-weight: 500; letter-spacing: 0.01em; white-space: nowrap; transition: background-color 0.16s, color 0.16s; }
.nav a:hover { background: color-mix(in srgb, var(--accent) 9%, transparent); text-decoration: none; color: var(--ink); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 32%, transparent); font-weight: 600; }
.city-pick { flex: none; height: 34px; margin-left: 2px; padding: 0 30px 0 12px; font-weight: 500; background-color: var(--ctl); background-position: right 11px center; border: 1px solid var(--ctl-line); border-radius: 999px; }
.city-pick:hover { border-color: var(--ctl-line-hover); }
.langs { display: flex; flex: none; gap: 2px; padding: 3px; border: 1px solid var(--ctl-line); border-radius: 999px; background: var(--ctl); }
.langs a { padding: 5px 8px; border-radius: 999px; font: 600 0.68rem/1.2 var(--mono); letter-spacing: 0.06em; color: var(--muted); }
.langs a:hover { background: var(--accent-soft); color: var(--ink); text-decoration: none; }
.langs a[aria-current="true"] { background: var(--sel); color: var(--sel-ink); }
/* light / dark switch: shows the theme it switches to */
.theme-toggle { flex: none; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; border: 1px solid var(--ctl-line); background: var(--ctl); color: var(--muted); cursor: pointer; transition: color 0.15s, border-color 0.15s; }
.theme-toggle:hover { color: var(--accent); border-color: var(--ctl-line-hover); }
.theme-toggle::before { content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M20.5 14.2A8.5 8.5 0 0 1 9.8 3.5a8.5 8.5 0 1 0 10.7 10.7z'/%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'%3E%3Cpath d='M20.5 14.2A8.5 8.5 0 0 1 9.8 3.5a8.5 8.5 0 1 0 10.7 10.7z'/%3E%3C/svg%3E") center / contain no-repeat; }
html[data-theme="dark"] .theme-toggle::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Cpath d='M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4'/%3E%3C/svg%3E"); }

/* shell */
.shell { display: grid; grid-template-columns: minmax(440px, 47%) 1fr; height: calc(100% - var(--header)); }
.panel { overflow-y: auto; padding: 22px max(22px, env(safe-area-inset-left)) 40px; min-width: 0; scroll-behavior: auto; }
.panel[aria-busy="true"] .view { opacity: 0.55; transition: opacity 0.15s 0.08s; }
.view { display: grid; gap: 14px; max-width: 980px; }
.mapbox { position: relative; min-width: 0; border-left: 1px solid var(--line); background: #f3f3f0; }
#map { position: absolute; inset: 0; }

.hero { display: grid; gap: 6px; padding: 4px 0 2px; }
/* the eyebrow line above a heading: small mono caps with a marker dot */
.kicker { font: 600 0.69rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.14em; color: var(--accent); }
.kicker::before { content: ""; display: inline-block; width: 6px; height: 6px; margin: 0 9px 0 1px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px var(--accent-soft); vertical-align: 1px; }
.sub { margin: 0; color: var(--muted); }
.lede { margin: 0; color: var(--ink); max-width: 70ch; }
.note { margin: 0; color: var(--muted); font-size: 0.82rem; line-height: 1.45; }
.note.auto { color: var(--ink); background: var(--accent-soft); padding: 7px 11px; border-radius: 10px; }
.scope-line { margin: 2px 0 0; font-size: 0.9rem; color: var(--muted); }
.scopes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.scope-chip {
  padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ctl-line); background: var(--ctl);
  color: var(--ink); font-size: 0.85rem; transition: border-color 0.15s, background-color 0.15s;
}
.scope-chip:hover { text-decoration: none; border-color: var(--accent); }
.scope-chip[aria-current="true"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
.scope-chip.implied { border-style: dashed; border-color: var(--accent); color: var(--accent); }

/* filters */
.filters, .compare-form, .estimate-form {
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--sh-card);
}
.filters, .compare-form { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: flex-end; --field-h: 32px; --field-fs: 0.88rem; }
/* forms of fields: a grid of equal columns. A field is its caption, the field and an optional
   .hint below it, on three rows it shares with the other fields of its line (subgrid): captions of
   one or two lines start together and the fields stay on one line. Hints are never placeholders
   (a narrow field cuts them). Full-row items: the address, a checkbox, "more", the button. */
.estimate-form, form.check, .estimate-form .form-more { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 14px; align-items: start; }
:is(.estimate-form, form.check, .form-more) > label:not(.check) { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 6px; min-width: 0; }
:is(.estimate-form, form.check, .form-more) > label:not(.check) > :is(input, select) { width: 100%; }
:is(.estimate-form, form.check, .form-more) > label > .hint { font-size: 0.76rem; font-weight: 400; line-height: 1.35; color: var(--muted); text-transform: none; letter-spacing: 0; }
:is(.estimate-form, form.check) > :is(.pick, .check-title, label.check, details.more, .btn) { grid-column: 1 / -1; }
:is(.estimate-form, form.check) > .btn { justify-self: start; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend, .estimate-form label, form.check label, .pick label, .commute label, .sun-form label, .work-form label {
  font-size: 0.68rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.07em; line-height: 1.3; padding: 0;
}
legend { margin-bottom: 6px; }
.seg { display: flex; flex-wrap: wrap; }
.seg legend { width: 100%; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; width: auto; height: auto; margin: 0; cursor: pointer; }
.seg span { display: block; height: var(--field-h); padding: 0 12px; line-height: calc(var(--field-h) - 2px); border: 1px solid var(--ctl-line); margin-left: -1px; font-size: 0.85rem; background: var(--ctl); }
.seg label:first-of-type span { border-radius: 999px 0 0 999px; margin-left: 0; padding-left: 14px; }
.seg label:last-of-type span { border-radius: 0 999px 999px 0; padding-right: 14px; }
.seg label:hover span { border-color: var(--ctl-line-hover); }
.seg input:checked + span { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); position: relative; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.range { display: flex; gap: 6px; flex-wrap: wrap; }
.range legend { width: 100%; }
.range input { width: 80px; }
.reset { font-size: 0.85rem; align-self: center; }
.pick { display: grid; gap: 6px; min-width: 0; }

/* tiles & cards */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; min-width: 0; box-shadow: var(--sh-card); }
.tile-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.tile-value { font: 600 1.25rem/1.3 var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { font-size: 0.8rem; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 10px; min-width: 0; box-shadow: var(--sh-card); }
.card.empty { color: var(--muted); }
.card-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 6px 8px; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.chart { min-height: 290px; }
.key { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 5px -1px 0; }
.k-scope { background: var(--c1); } .k-city { background: var(--c2); } .k-p { background: var(--cp); } .k-s { background: var(--cs); }

.hist { width: 100%; height: auto; display: block; }
.hist .bar { fill: var(--c1); fill-opacity: 0.55; }
.hist .bar:hover { fill-opacity: 0.9; }
.hist .tick { fill: var(--muted); font-size: 11px; }
.hist .m-scope { stroke: var(--c1); stroke-width: 2.5; }
.hist .m-city { stroke: var(--c2); stroke-width: 2; stroke-dasharray: 4 3; }

.bars { display: grid; gap: 8px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr; gap: 10px; align-items: center; }
.bar-label { font-size: 0.86rem; color: var(--muted); }
.bar-cells { display: grid; gap: 3px; }
.bar-line { display: flex; align-items: center; gap: 8px; height: 16px; }
.bar-fill { height: 12px; border-radius: 3px; min-width: 2px; }
.bar-fill.p { background: var(--cp); } .bar-fill.s { background: var(--cs); }
.bar-val { font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* tables */
.table-wrap { overflow: auto; max-height: 560px; border-radius: 10px; border: 1px solid var(--line); }
.table-wrap.short { max-height: 360px; }
table { border-collapse: collapse; width: 100%; font-size: 0.86rem; font-variant-numeric: tabular-nums; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
thead th { position: sticky; top: 0; background: var(--soft); font-weight: 600; color: var(--muted); font-size: 0.76rem; letter-spacing: 0.02em; z-index: 1; }
table.sortable thead th { cursor: pointer; user-select: none; }
th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.7em; }
th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.7em; }
tbody tr:hover { background: var(--soft); }
tbody th { color: var(--muted); font-weight: 500; position: static; background: none; }
.chip { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 0.74rem; line-height: 1.6; font-weight: 600; }
.chip.p { background: color-mix(in srgb, var(--cp) 16%, transparent); color: var(--cp); }
.chip.s { background: color-mix(in srgb, var(--cs) 18%, transparent); color: var(--cs); }
.chip.live { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }

.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.btn, button.btn {
  display: inline-flex; align-items: center; height: var(--field-h); padding: 0 18px; border-radius: 10px; border: 1px solid var(--ctl-line);
  background: var(--ctl); color: var(--ink); font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.btn:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.btn.primary { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); font-weight: 600; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); }
.btn.primary:hover { background: var(--sel-hover); border-color: var(--sel-hover); box-shadow: 0 4px 12px var(--accent-ring); }
.btn-link { font-size: 0.85rem; font-weight: 600; }
.foot { border-top: 1px solid var(--line); padding-top: 12px; }
.foot p { margin: 0; color: var(--muted); font-size: 0.78rem; max-width: 80ch; }

/* uPlot */
.u-legend { font-size: 0.8rem; text-align: left; }
.u-legend .u-series th, .u-legend .u-series td { padding: 1px 6px 1px 0; border: 0; }
.u-legend .u-label { font-weight: 500; }
.u-legend tr:hover { background: none; }

/* map chrome: frosted panels over the map */
.map-top { position: absolute; top: 10px; left: 10px; right: 52px; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; pointer-events: none; --field-h: 30px; --field-fs: 0.82rem; }
.map-top :is(input:not([type="range"]), select) { padding-left: 9px; border-radius: 8px; }
.map-top input:not([type="range"]) { padding-right: 9px; }
.map-top > * { pointer-events: auto; max-width: 100%; }
.lenses, .lens-sub, form.budget, .lens-kinds, .legend, .map-hint, .near-toggle, .map-toggle, .map-show, .lang-offer {
  background: var(--glass); -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid var(--glass-line); box-shadow: var(--sh-float);
}
.lenses { display: flex; border-radius: 14px; padding: 4px; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.lenses::-webkit-scrollbar { display: none; }
.lenses button { flex: none; border: 0; background: none; padding: 6px 12px; border-radius: 999px; font: inherit; font-size: 0.84rem; font-weight: 500; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background-color 0.15s, color 0.15s; }
.lenses button:hover { background: var(--accent-soft); }
.lenses button[aria-pressed="true"] { background: var(--sel); color: var(--sel-ink); font-weight: 600; }
.lens-sub, form.budget { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; border-radius: 12px; padding: 5px 8px; font-size: 0.8rem; color: var(--muted); }
.lens-sub[hidden], form.budget[hidden], .work-pick[hidden] { display: none; }
.mini-seg { display: inline-flex; border: 1px solid var(--ctl-line); border-radius: 999px; overflow: hidden; background: var(--ctl); }
.mini-seg button { border: 0; border-left: 1px solid var(--ctl-line); background: none; color: var(--muted); padding: 3px 10px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.mini-seg button:first-child { border-left: 0; }
.mini-seg button { white-space: nowrap; }
.mini-seg button:hover { color: var(--ink); }
.narrow-only { display: none; }
.mini-seg button[aria-pressed="true"] { background: var(--accent-soft); color: var(--ink); font-weight: 600; }
.work-pick { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sun-ctl label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 0.8rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
.map-top select { padding-right: 26px; background-position: right 8px center; }
.sun-ctl input[type="range"] { width: 150px; margin: 0; }
.sun-ctl output { min-width: 10.5em; color: var(--ink); font-variant-numeric: tabular-nums; }
.legend-swatches[hidden] { display: none; }
.legend-title.sub { margin-top: 6px; }
.permit-list { margin: 6px 0 0; }
.permit-list li { margin-bottom: 4px; }
.permit-name { font-size: 0.82rem; }
.legend-list .sw.levee { height: 4px; border-radius: 2px; background: #5b3a22; }
.legend-list .sw.strip { background: rgb(138 90 53 / 0.3); }
.work-pick .search { width: 240px; }
.map-top .search input { padding-left: 32px; background-position: 10px 50%; }
form.budget label { display: inline-flex; align-items: center; gap: 5px; margin: 0; font-size: 0.8rem; color: var(--muted); text-transform: none; letter-spacing: 0; }
form.budget input[name="area"] { width: 76px; }
form.budget input[name="budget"] { width: 112px; }
button.linkish { border: 0; background: none; color: var(--accent); font: inherit; font-size: 0.8rem; cursor: pointer; padding: 0; }
.near-toggle { position: absolute; right: 10px; top: 84px; z-index: 2; color: var(--ink); border-radius: 999px; padding: 4px 11px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.near-toggle[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.near-toggle[hidden] { display: none; }
/* the legend: a small button on the map; opened, a panel that scrolls instead of covering the map */
.legend { position: absolute; left: 10px; bottom: 24px; z-index: 2; display: flex; flex-direction: column; max-width: min(380px, calc(100% - 20px)); max-height: calc(100% - 150px); border-radius: 12px; font-size: 0.72rem; color: var(--muted); }
.legend [hidden] { display: none; }
.legend-toggle { flex: none; display: flex; align-items: center; gap: 6px; border: 0; background: none; margin: 0; padding: 6px 11px; font: inherit; font-size: 0.8rem; font-weight: 600; color: var(--ink); cursor: pointer; border-radius: 12px; text-align: left; }
.legend-toggle:hover { background: var(--accent-soft); }
.legend-toggle::before { content: ""; width: 14px; height: 14px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='1' y='2' width='4' height='3' rx='1'/%3E%3Crect x='1' y='6.5' width='4' height='3' rx='1'/%3E%3Crect x='1' y='11' width='4' height='3' rx='1'/%3E%3Crect x='7' y='3' width='8' height='1.4' rx='.7'/%3E%3Crect x='7' y='7.3' width='8' height='1.4' rx='.7'/%3E%3Crect x='7' y='11.6' width='8' height='1.4' rx='.7'/%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 16 16'%3E%3Crect x='1' y='2' width='4' height='3' rx='1'/%3E%3Crect x='1' y='6.5' width='4' height='3' rx='1'/%3E%3Crect x='1' y='11' width='4' height='3' rx='1'/%3E%3Crect x='7' y='3' width='8' height='1.4' rx='.7'/%3E%3Crect x='7' y='7.3' width='8' height='1.4' rx='.7'/%3E%3Crect x='7' y='11.6' width='8' height='1.4' rx='.7'/%3E%3C/svg%3E") center / contain no-repeat; }
.legend-toggle::after { content: ""; width: 6px; height: 6px; margin-left: 2px; border: solid var(--muted); border-width: 0 1.6px 1.6px 0; transform: rotate(-135deg) translate(-1px, -1px); }
.legend.open .legend-toggle { padding-bottom: 3px; }
.legend.open .legend-toggle::after { transform: rotate(45deg) translate(-1px, -1px); }
.legend-body { overflow-y: auto; overscroll-behavior: contain; padding: 0 11px 9px; }
.ico { flex: none; display: inline-block; width: 18px; height: 18px; vertical-align: -5px; background: center / contain no-repeat; }
.legend-unit.ico-line .ico { margin-right: 3px; }
.legend-list li .ico { margin: -2px 0; }
.map-hint { border-radius: 12px; padding: 5px 11px; font-size: 0.8rem; color: var(--ink); }
.map-hint[hidden] { display: none; }
.legend-swatches { display: flex; }
.legend-swatches span { min-width: 44px; padding: 3px 4px 2px; text-align: center; color: #1d2622; font-variant-numeric: tabular-nums; }
.legend-swatches span:first-child { border-radius: 4px 0 0 4px; }
.legend-swatches span:last-child { border-radius: 0 4px 4px 0; }
.legend-list { list-style: none; margin: 2px 0 0; padding: 0; display: grid; gap: 2px 12px; }
.legend-list.cols { grid-template-columns: repeat(2, minmax(0, auto)); }
.legend-list li { display: flex; align-items: center; gap: 5px; color: var(--ink); }
.legend-list .sw { flex: none; width: 13px; height: 11px; border-radius: 3px; }
.legend-list .sw.dash { background: none; border: 1.6px dashed #2b211d; }
.legend-list .sw.dash.draft { border-color: #6a3fb5; }
.legend-list.inline { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.near-legend { margin-top: 6px; padding-top: 5px; border-top: 1px solid var(--line); }
.pop-scores { display: grid; grid-template-columns: repeat(3, auto); gap: 1px 10px; margin: 4px 0; font-size: 12px; }
.pop-scores .prio { font-weight: 650; color: #005fcc; }
.pop-warn { color: #b83232; font-weight: 600; }
.pop-hint { color: #64748b; font-size: 11.5px; margin-top: 3px; }
.pop-link { display: inline-block; margin-top: 5px; font-weight: 600; }
.show-map { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; border: 1px solid var(--ctl-line); background: var(--ctl); color: var(--accent); border-radius: 999px; padding: 2px 10px; font: inherit; font-size: 0.8rem; cursor: pointer; }
.show-map::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'%3E%3Cpath d='M9 3 3 5.5v15.5l6-2.5 6 2.5 6-2.5V3l-6 2.5L9 3zm1 2.2 4 1.7v12l-4-1.7v-12z'/%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'%3E%3Cpath d='M9 3 3 5.5v15.5l6-2.5 6 2.5 6-2.5V3l-6 2.5L9 3zm1 2.2 4 1.7v12l-4-1.7v-12z'/%3E%3C/svg%3E") center / contain no-repeat; }
.show-map:hover { border-color: var(--accent); }
.card-head h2 + .show-map { margin-left: auto; }
.legend-title { color: var(--ink); font-weight: 600; margin-bottom: 4px; }
.legend-scale { display: flex; }
.legend-scale span { min-width: 38px; padding: 3px 0 2px; text-align: center; color: #fff; font-variant-numeric: tabular-nums; }
.legend-scale span:nth-child(1) { background: var(--r0); color: #3d4a57; border-radius: 4px 0 0 4px; }
.legend-scale span:nth-child(2) { background: var(--r1); color: #2e3d4d; }
.legend-scale span:nth-child(3) { background: var(--r2); color: #1f2e3d; }
.legend-scale span:nth-child(4) { background: var(--r3); }
.legend-scale span:nth-child(5) { background: var(--r4); }
.legend-scale span:nth-child(6) { background: var(--r5); }
.legend-scale span:nth-child(7) { background: var(--r6); border-radius: 0 4px 4px 0; }
.legend-unit { margin-top: 3px; }
.map-toggle { display: none; }
/* popups sit on the light basemap in both themes; .mapbox outranks maplibre-gl.css, loaded later */
.mapbox .maplibregl-popup-content { font: 13px/1.45 var(--font); padding: 9px 12px; border-radius: 10px; color: #0d1b2a; box-shadow: 0 10px 28px rgba(13, 27, 42, 0.2), 0 0 0 1px rgba(15, 23, 42, 0.06); }
.maplibregl-popup-content .muted { color: #475569; }
.maplibregl-popup-close-button { font-size: 18px; padding: 0 6px; }
.maplibregl-popup-content b { font-weight: 650; }
.mapbox .maplibregl-ctrl-group { border-radius: 10px; box-shadow: var(--sh-float); }

@media (max-width: 900px) {
  :root { --header: auto; }
  .top { height: auto; flex-wrap: wrap; padding-block: 8px; gap: 8px; }
  .top .search { order: 3; flex-basis: 100%; max-width: none; }
  /* iOS zooms into a field whose text is under 16 px */
  :root, .top, .map-top, .filters { --field-fs: 16px; }
  .nav { overflow-x: auto; margin-left: 0; max-width: calc(100vw - 32px); scrollbar-width: none; }
  .langs, .theme-toggle { order: 1; }
  .langs { margin-left: auto; }
  .nav { order: 2; }
  .shell { display: flex; flex-direction: column; height: auto; }
  .mapbox { order: -1; height: 42vh; border-left: 0; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; transition: height 0.2s; }
  .mapbox.collapsed { height: 44px; }
  .mapbox { height: 52vh; }
  .mapbox.collapsed #map, .mapbox.collapsed .legend, .mapbox.collapsed .map-top, .mapbox.collapsed .near-toggle, .mapbox.collapsed .maplibregl-control-container { visibility: hidden; }
  .map-top { right: 10px; }
  .near-toggle { top: auto; bottom: 44px; }
  .mini-seg button { padding: 3px 7px; }
  .narrow-only { display: inline; }
  .wide-only { display: none; }
  .lens-sub, form.budget { font-size: 0.76rem; padding: 4px 6px; }
  .legend-list.cols { grid-template-columns: 1fr 1fr; }
  .map-toggle { display: block; position: absolute; right: 10px; bottom: 8px; z-index: 3; color: var(--ink); border-radius: 999px; padding: 4px 12px; font: inherit; font-size: 0.82rem; }
  .legend { bottom: 8px; max-width: calc(100% - 120px); max-height: 48%; }  /* opened, it still leaves most of the map */
  .legend-toggle { padding: 5px 9px; font-size: 0.78rem; }
  .legend-body { padding: 0 8px 7px; }
  /* colour scales shrink to the legend's width instead of scrolling sideways */
  .legend-scale span, .legend-swatches span { flex: 1 1 auto; min-width: 0; padding-inline: 2px; font-size: 0.66rem; white-space: nowrap; }
  .panel { overflow: visible; padding: 16px 16px 32px; }
  .bar-row { grid-template-columns: 90px 1fr; }
  h1 { font-size: 1.65rem; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* buyer assistant */
.verdict { border-width: 2px; }
.verdict.good { border-color: var(--up); } .verdict.ok { border-color: var(--accent); }
.verdict.warn { border-color: var(--warn); } .verdict.bad { border-color: var(--down); }
.verdict-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; }
.verdict-label { font: 400 1.6rem/1.15 var(--serif); letter-spacing: -0.01em; }
.verdict.good .verdict-label { color: var(--up); } .verdict.warn .verdict-label { color: var(--warn); } .verdict.bad .verdict-label { color: var(--down); }
.verdict-pct { color: var(--muted); }
.verdict-scale { position: relative; height: 12px; border-radius: 6px; background: linear-gradient(90deg, color-mix(in srgb, var(--up) 35%, transparent), var(--soft) 30% 70%, color-mix(in srgb, var(--down) 35%, transparent)); }
.verdict-band { position: absolute; top: 0; bottom: 0; border: 1px dashed var(--muted); border-radius: 6px; }
.verdict-mark { position: absolute; top: -4px; width: 4px; height: 20px; margin-left: -2px; border-radius: 2px; background: var(--ink); }
.estimate-form label.check { display: flex; flex-direction: row; align-items: center; gap: 9px; justify-self: start; text-transform: none; letter-spacing: 0; font-size: 0.9rem; font-weight: 400; color: var(--ink); cursor: pointer; }
tr.total th, tr.total td { border-top: 2px solid var(--line); }
td.muted { color: var(--muted); white-space: normal; }
.link-btn { border: 0; background: none; padding: 0; color: var(--muted); font: inherit; font-size: 0.75rem; cursor: pointer; text-decoration: underline; }
.shortlist-link .count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 5px; border-radius: 9px; background: var(--sel); color: var(--sel-ink); font: 600 0.7rem/1.5 var(--mono); text-align: center; }
details summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }

/* location card */
.ctx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 14px 20px; }
.ctx-block { display: grid; gap: 6px; align-content: start; min-width: 0; }
.ctx-block.wide { grid-column: 1 / -1; }
.ctx-block h3 { margin: 0; font: 600 0.69rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ctx-block p { margin: 0; }
.ctx-block .big { font-size: 1.05rem; }
table.compact { font-size: 0.84rem; }
table.compact th, table.compact td { padding: 4px 8px 4px 0; border-bottom: 1px dashed var(--line); white-space: normal; vertical-align: top; }
table.compact th { color: var(--muted); font-weight: 500; background: none; position: static; text-align: left; }
table.compact thead th { font-size: 0.75rem; }
ul.stops { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.stop-name { font-weight: 600; }
.lines { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 2px; }
.line { font-size: 0.72rem; font-weight: 700; padding: 0 5px; border-radius: 4px; color: #fff; line-height: 1.6; font-variant-numeric: tabular-nums; }
.line.tram { background: #c8102e; } .line.bus { background: #1f4e9c; } .line.rail { background: #6b4a2b; }
.commute { display: grid; gap: 6px; margin-top: 4px; max-width: 520px; }
.commute-out { font-size: 0.88rem; }
.sun-form { --field-h: 34px; }
.sun-form label { display: inline-flex; align-items: center; gap: 8px; }
.sun-form input { width: 72px; }
.krs table.compact th { width: 45%; }

/* ===== buyer-first redesign ===== */
.home-hero { display: grid; gap: 12px; padding: 18px 0 8px; }
.home-hero h1 { font-size: 2.6rem; line-height: 1.08; letter-spacing: -0.022em; }
.home-hero .lede { font-size: 1.05rem; color: var(--muted); max-width: 60ch; }
.search.big input { height: 52px; font-size: max(1.02rem, var(--field-fs)); padding-left: 42px; border-radius: 14px; background-color: var(--panel); border: 1.5px solid color-mix(in srgb, var(--accent) 55%, var(--field-line)); background-position: 15px 50%; box-shadow: var(--sh-card); }
.search.big input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-ring); }
.hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.task, .city-card {
  display: grid; padding: 15px 17px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  box-shadow: var(--sh-card); transition: border-color 0.18s, box-shadow 0.18s, transform 0.18s;
}
.task { gap: 4px; }
.task:hover, .city-card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--sh-card-hover); transform: translateY(-1px); text-decoration: none; }
.task-title { font: 400 1.18rem/1.25 var(--serif); color: var(--ink); transition: color 0.18s; }
.task:hover .task-title { color: var(--accent); }
.task-text { font-size: 0.86rem; color: var(--muted); }
.prio-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip-btn { border: 1px solid var(--ctl-line); background: var(--ctl); color: var(--ink); border-radius: 999px; padding: 6px 13px; font: inherit; font-size: 0.86rem; cursor: pointer; transition: border-color 0.15s, background-color 0.15s; }
.chip-btn:hover { border-color: var(--accent); }
.chip-btn[aria-pressed="true"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
.work-form { display: grid; gap: 6px; max-width: 520px; }
.pulse { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; }
.pulse > div, .summary-side > div, .verdict-cols > div, .cost-row > div { display: grid; gap: 1px; }
.pulse b { font: 600 1.2rem/1.3 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pulse span, .summary-side span.muted, .verdict-cols span.muted, .cost-row span.muted { font-size: 0.78rem; }

.report-hero { gap: 4px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.section-nav { position: sticky; top: -22px; z-index: 4; display: flex; gap: 4px; overflow-x: auto; padding: 8px 0; margin: 0 0 -6px; background: var(--bg); scrollbar-width: none; }
.section-nav a { flex: none; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--ctl-line); background: var(--panel); color: var(--ink); font-size: 0.84rem; transition: border-color 0.15s; }
.section-nav a:hover { border-color: var(--accent); text-decoration: none; }
.summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 12px 20px; padding: 18px 20px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-card); }
.summary-main { display: grid; gap: 2px; }
.summary-label { font-size: 0.68rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--muted); }
.summary-value { font: 600 1.9rem/1.15 var(--mono); letter-spacing: -0.035em; font-variant-numeric: tabular-nums; margin: 2px 0; }
.summary-range, .summary-meta { font-size: 0.86rem; color: var(--muted); }
.summary-monthly { grid-column: 1 / -1; grid-row: 2; font-size: 0.92rem; padding-top: 10px; border-top: 1px dashed var(--line); }
.summary-side { grid-column: 2; grid-row: 1; display: grid; gap: 8px; align-content: start; }
.summary-side b { font: 600 1rem/1.35 var(--mono); letter-spacing: -0.02em; }
#my-commute { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 0.92rem; }
#match { padding: 8px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 0.92rem; }

form.check { padding: 14px 16px 16px; border-radius: var(--radius); background: var(--panel); border: 1px dashed color-mix(in srgb, var(--accent) 60%, transparent); }
form.check .check-title { font: 400 1.15rem/1.3 var(--serif); margin-bottom: -4px; }
.verdict-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.verdict-cols b { font: 600 1.08rem/1.35 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.conf { font-size: 0.75rem; padding: 2px 9px; border-radius: 999px; margin-left: auto; }
.conf.c-high { background: color-mix(in srgb, var(--up) 16%, transparent); color: var(--up); }
.conf.c-mid { background: var(--warn-bg); color: var(--warn); }
.conf.c-low { background: color-mix(in srgb, var(--down) 15%, transparent); color: var(--down); }

.proscons { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.pc { padding: 13px 15px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-card); }
.pc h3 { margin: 0 0 8px; font: 600 0.69rem/1.4 var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.pc ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 4px; }
.pc li { padding-left: 22px; position: relative; font-size: 0.92rem; }
.pc.pro li::before { content: "✓"; position: absolute; left: 2px; color: var(--up); font-weight: 700; }
.pc.con li::before { content: "!"; position: absolute; left: 5px; color: var(--warn); font-weight: 800; }

.scores { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 8px; }
.score { padding: 11px 13px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); display: grid; gap: 3px; align-content: start; box-shadow: var(--sh-card); }
.score.prio { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset, var(--sh-card); }
.score-top { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.score-title { font-size: 0.82rem; color: var(--muted); }
.score-val { font: 600 1.35rem/1.2 var(--mono); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.score-max { font: 500 0.72rem var(--mono); color: var(--muted); letter-spacing: 0; }
.score-bar { height: 5px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.score-bar span { display: block; height: 100%; border-radius: 3px; background: var(--sc, var(--accent)); }
/* the score colour, darkened (lightened in dark mode) towards the text colour so small words read at 4.5:1 */
.score-word { font-size: 0.78rem; font-weight: 600; color: color-mix(in srgb, var(--sc, var(--ink)) 70%, var(--ink)); }
.score-reason { font-size: 0.78rem; color: var(--muted); line-height: 1.35; }
.s-top { --sc: #1c8a55; } .s-good { --sc: #4f9a3c; } .s-mid { --sc: #b68a12; } .s-low { --sc: #c9661f; } .s-bad { --sc: #b0412f; }
.sc { display: inline-block; min-width: 24px; padding: 0 6px; border-radius: 6px; color: #fff; font-weight: 700; text-align: center; background: var(--sc); }

#risks .risk { margin: 0; padding: 9px 13px; border-left: 3px solid var(--warn); background: var(--warn-bg); border-radius: 0 10px 10px 0; font-size: 0.92rem; }
ul.checked { margin: 0; padding: 0; list-style: none; display: grid; gap: 3px; font-size: 0.86rem; color: var(--muted); }
ul.checked li::before { content: "✓ "; color: var(--up); font-weight: 700; }

.factor-list { display: grid; gap: 7px; }
.factor-row { display: grid; grid-template-columns: minmax(0, 1fr) 120px 78px; gap: 10px; align-items: center; font-size: 0.9rem; }
.factor-row.ns { opacity: 0.55; }
.factor-bar { height: 8px; background: var(--soft); border-radius: 4px; overflow: hidden; }
.factor-bar span { display: block; height: 100%; border-radius: 4px; }
.factor-bar .pos { background: var(--c1); } .factor-bar .neg { background: var(--cs); }
.factor-val { text-align: right; font: 600 0.86rem/1.3 var(--mono); font-variant-numeric: tabular-nums; }
.factor-val.pos { color: var(--c1); } .factor-val.neg { color: var(--cs); }
.factor-val .ci { display: block; font-size: 0.7rem; font-weight: 400; }

ul.plain { margin: 0; padding-left: 18px; display: grid; gap: 5px; font-size: 0.92rem; }
ul.check-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; font-size: 0.9rem; }
ul.check-list li { padding-left: 24px; position: relative; }
ul.check-list li::before { content: "☐"; position: absolute; left: 2px; color: var(--accent); }
.cost-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cost-row b { font: 600 1.08rem/1.35 var(--mono); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

details.more-block { border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); box-shadow: var(--sh-card); }
details.more-block > summary { padding: 13px 17px; font-weight: 600; color: var(--ink); font-size: 0.95rem; list-style: none; }
details.more-block > summary::-webkit-details-marker { display: none; }
details.more-block > summary::before { content: "▸ "; color: var(--accent); }
details.more-block[open] > summary::before { content: "▾ "; }
details.more-block[open] { padding-bottom: 12px; }
details.more-block > :not(summary) { margin: 0 12px 12px; }
details.more-block > .card { border: 0; padding: 4px 4px; box-shadow: none; }
details.more > summary { font-size: 0.85rem; color: var(--accent); }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-bottom: 8px; font-size: 0.85rem; }

@media (max-width: 900px) {
  .summary { grid-template-columns: 1fr; }
  .summary-side { grid-column: 1; grid-row: auto; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .summary-monthly { grid-row: auto; }
  .summary-value { font-size: 1.6rem; }
  .verdict-cols, .cost-row { grid-template-columns: 1fr 1fr; }
  .factor-row { grid-template-columns: minmax(0, 1fr) 70px 64px; }
  .section-nav { top: 0; }
  .home-hero h1 { font-size: 1.95rem; }
}
.map-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -4px; font-size: 0.85rem; }

/* ---- UI audit 2026-11: one check flow, one budget, folded report */
.summary-line { margin: 0; padding: 11px 15px; border-radius: var(--radius); background: var(--panel); border: 1px solid var(--line); font-size: 0.92rem; box-shadow: var(--sh-card); }
.verdict-range { margin: 0; }
.verdict .actions, .afford p:last-child { display: flex; flex-wrap: wrap; gap: 8px; }
.budget-line { margin: 0; font-weight: 600; }
.verdict-line { margin: 0 0 10px; font-size: 1rem; }
.afford h2 { margin-top: 0; }
.afford ul.plain { margin: 6px 0; }
.scope-chip[aria-current="page"] { background: var(--sel); border-color: var(--sel); color: var(--sel-ink); }
.tabs { margin-top: 10px; }
/* "more" inside a form: a section under a divider, opened by a chevron line */
.estimate-form details.more { padding-top: 12px; border-top: 1px solid var(--line); }
.estimate-form details.more > summary { display: inline-flex; align-items: center; gap: 8px; padding: 2px 0; list-style: none; font-size: 0.88rem; font-weight: 500; color: var(--accent); }
.estimate-form details.more > summary::-webkit-details-marker { display: none; }
.estimate-form details.more > summary::before { content: ""; width: 12px; height: 12px; background: currentColor; -webkit-mask: var(--chevron) center / contain no-repeat; mask: var(--chevron) center / contain no-repeat; transform: rotate(-90deg); transition: transform 0.15s; }
.estimate-form details.more[open] > summary::before { transform: none; }
.estimate-form .form-more { margin-top: 12px; }
tr.over-budget td { opacity: 0.45; }
#prefs > summary, .more-block > summary { cursor: pointer; }

/* table pages: the map folds away on wide screens, a button brings it back */
.shell.map-off { grid-template-columns: 1fr; }
.shell.map-off .mapbox { display: none; }
.map-show { position: fixed; right: 18px; bottom: 18px; z-index: 6; color: var(--ink); border-radius: 999px; padding: 10px 18px; font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer; }
.map-show:hover { border-color: var(--accent); }
.map-show[hidden] { display: none; }
.shell.map-off .panel { max-width: 1180px; width: 100%; margin-inline: auto; }
@media (max-width: 900px) {
  /* the opened map covers the screen instead of half of it; the strip stays one line */
  .mapbox:not(.collapsed) { position: fixed; inset: 0; height: auto; z-index: 30; border: 0; }
  body.map-open { overflow: hidden; }
  .mapbox:not(.collapsed) .map-toggle { top: 10px; bottom: auto; left: 10px; right: auto; }
  .map-show { display: none; }
  .shell.map-off .mapbox { display: block; }
  .lenses button, .mini-seg button, .scope-chip, .btn { min-height: 44px; }
}
/* mid-width screens: the header fits without a sideways scroll */
@media (min-width: 901px) and (max-width: 1180px) {
  .brand-text { display: none; }
  .top { gap: 8px; }
  .nav a { padding: 0 8px; font-size: 0.8rem; }
  .top .search { max-width: 240px; }
}
/* contrast (WCAG AA 4.5:1 for text): darker score words and falling-price figures in light mode */
.s-good { --sc: #3b7a2c; } .s-mid { --sc: #8a6500; } .s-low { --sc: #a24f12; } .s-bad { --sc: #9c3726; }
.factor-row .down, td.down, b.down, span.down { color: #9c3726; }
html[data-theme="dark"] .s-top { --sc: #5fd39a; }
html[data-theme="dark"] .s-good { --sc: #8fd07a; }
html[data-theme="dark"] .s-mid { --sc: #e0b34a; }
html[data-theme="dark"] .s-low { --sc: #f09a5c; }
html[data-theme="dark"] .s-bad { --sc: #ff8a73; }
html[data-theme="dark"] :is(.factor-row .down, td.down, b.down, span.down) { color: var(--down); }
h1[tabindex="-1"]:focus { outline: none; }
/* lens groups: the second row shows only for the chosen group; the bar wraps instead of hiding lenses */
.lens-kinds[hidden] { display: none; }
.lens-kinds { width: max-content; max-width: 100%; }
.mini-seg.lens-kinds { background: var(--glass); border-color: var(--glass-line); }  /* stands alone on the map */
@media (min-width: 901px) { .lenses { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 900px) {
  /* the full-screen map: the close button on its own line above the lens bar */
  .mapbox:not(.collapsed) .map-top { top: 58px; }
  .mapbox:not(.collapsed) .map-toggle { top: 10px; left: 10px; min-height: 40px; font-weight: 600; }
}

/* --- public URLs and SEO (web::seo) --- */
.crumbs ol { list-style: none; margin: 0 0 6px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 0.8rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--faint); }
.crumbs li[aria-current] { color: var(--ink); }
h1 .h1-sub { display: block; font: 400 0.95rem/1.4 var(--font); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.related .link-cloud { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.9rem; }
.related .link-cloud .muted { font-size: 0.8rem; }
/* floats over the page: shown after load, it must not push the content down (layout shift) */
.lang-offer { position: fixed; z-index: 1000; left: 50%; bottom: 16px; transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 16px; border-radius: 999px; font-size: 0.9rem; max-width: calc(100vw - 24px); }
.lang-offer button { border: 0; background: none; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--muted); padding: 2px 6px; }
body.national { height: auto; min-height: 100%; }
body.national .langs { margin-left: auto; }
body.national .brand-text { display: inline; }   /* its header has room: no search, no nav */
.national-main { max-width: 980px; margin: 0 auto; padding: 20px 20px 40px; display: grid; gap: 20px; }
.city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.city-card { gap: 2px; }
.city-name { font: 400 1.4rem/1.2 var(--serif); color: var(--ink); transition: color 0.18s; }
.city-card:hover .city-name { color: var(--accent); }
.city-price { font: 600 1.25rem/1.35 var(--mono); letter-spacing: -0.03em; margin-top: 4px; }
.national-main ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }
