@font-face { font-family: 'Bricolage'; src: url('/static/vendor/bricolage.woff2') format('woff2'); font-weight: 200 800; font-display: swap }
@font-face { font-family: 'Hanken'; src: url('/static/vendor/hanken.woff2') format('woff2'); font-weight: 100 900; font-display: swap }

:root {
  color-scheme: light;
  --paper: #e9edf0;
  --surface: #f7f9fa;
  --raised: #ffffff;
  --ink: #15212c;
  --ink-2: #4b5b69;
  --ink-3: #74828e;
  --line: #d0d8de;
  --line-2: #e3e8ec;
  --accent: #4b3caa;
  --accent-ink: #ffffff;
  --accent-wash: #ecebfb;
  --spark: #e0683f;
  --good: #006300;
  --bad: #b3261e;
  --warn: #8a5a00;
  --rail: #15212c;
  --rail-ink: #b9c5cf;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --series-3: #1baf7a;
  --series-4: #eda100;
  --series-5: #e87ba4;
  --grid: #e1e0d9;
  --display: 'Bricolage', 'Hanken', system-ui, sans-serif;
  --text: 'Hanken', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --shadow: 0 1px 2px rgb(21 33 44 / 8%), 0 12px 32px rgb(21 33 44 / 12%);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --paper: #0b1218;
  --surface: #111a22;
  --raised: #17222c;
  --ink: #e7edf1;
  --ink-2: #a9b6c1;
  --ink-3: #7f8d99;
  --line: #27343f;
  --line-2: #1c2832;
  --accent: #a9a2f0;
  --accent-ink: #15123a;
  --accent-wash: #24203f;
  --spark: #ef7a4f;
  --good: #46c063;
  --bad: #f08475;
  --warn: #e3ad45;
  --rail: #070c11;
  --rail-ink: #93a1ad;
  --series-1: #3987e5;
  --series-2: #d95926;
  --series-3: #199e70;
  --series-4: #c98500;
  --series-5: #d55181;
  --grid: #2c2c2a;
  --shadow: 0 1px 2px rgb(0 0 0 / 40%), 0 16px 40px rgb(0 0 0 / 45%);
}

* { box-sizing: border-box }
[hidden] { display: none !important }
html { font: 14px/1.45 var(--text); color: var(--ink); background: var(--paper); font-variant-numeric: tabular-nums }
body { margin: 0; height: 100vh; display: grid; grid-template-columns: 76px 1fr; overflow: hidden }
h1, h2, h3, h4, p { margin: 0 }
h1, h2, .figure-xl { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em }
h2 { font-size: 1.55rem; line-height: 1.15 }
h3 { font-size: 1rem; font-weight: 650 }
a { color: var(--accent) }
small, .note { color: var(--ink-3); font-size: 0.86rem }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px }

button, .button, select, input, textarea {
  font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--line); border-radius: 5px; padding: 6px 10px
}
button, .button { cursor: pointer; text-decoration: none; white-space: nowrap; font-weight: 550 }
button:hover, .button:hover { border-color: var(--ink-3) }
button:disabled { opacity: 0.55; cursor: progress }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); padding: 10px 16px }
button.quiet { border-color: transparent; background: none; color: var(--ink-2); padding: 4px 6px }
input[type='search'], input[type='number'], input[type='text'], input[type='email'], input[type='password'], textarea { width: 100% }
input::placeholder { color: var(--ink-3) }
.grow { flex: 1 }

.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: var(--raised) }
.segmented button { border: 0; border-radius: 0; background: none; padding: 6px 12px; color: var(--ink-2) }
.segmented button + button { border-left: 1px solid var(--line) }
.segmented button.on { background: var(--ink); color: var(--paper) }

.chips { display: flex; flex-wrap: wrap; gap: 5px }
.chips button, .chip { border-radius: 99px; padding: 3px 10px; font-weight: 500; font-size: 0.9rem; color: var(--ink-2) }
.chips button.on, .chip.on { background: var(--accent-wash); border-color: var(--accent); color: var(--accent) }

.switch { display: flex; align-items: center; gap: 7px; cursor: pointer; color: var(--ink-2); white-space: nowrap }
.switch input { appearance: none; width: 28px; height: 16px; border-radius: 99px; background: var(--line); border: 0; padding: 0; position: relative; cursor: pointer; transition: background 0.15s }
.switch input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 12px; height: 12px; border-radius: 50%; background: var(--raised); transition: translate 0.15s }
.switch input:checked { background: var(--accent) }
.switch input:checked::after { translate: 12px }
.switch input:checked + span { color: var(--ink) }
.pick { display: flex; align-items: center; gap: 6px; color: var(--ink-2) }

#rail { background: var(--rail); display: flex; flex-direction: column; align-items: stretch; padding: 12px 6px; gap: 2px }
#rail .brand { display: grid; place-items: center; padding: 4px 0 14px }
#rail a, #account { display: grid; justify-items: center; gap: 3px; padding: 9px 2px; border-radius: 7px; color: var(--rail-ink); text-decoration: none; font-size: 0.76rem; font-weight: 550; border: 0; background: none }
#rail svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
#rail a:hover, #account:hover { color: #fff }
#rail a.on { color: #fff; background: rgb(255 255 255 / 9%); box-shadow: inset 3px 0 0 var(--spark) }
#account b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--spark); color: #fff; font-size: 0.8rem }

#views { min-width: 0; height: 100vh; position: relative }
.view { height: 100%; display: flex; flex-direction: column }
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); flex-wrap: wrap }
.bar #q { width: 190px }
#count { color: var(--ink-2) }
#count b { font-family: var(--display); font-size: 1.15rem; color: var(--ink); margin-right: 4px }
#review-count:not(:empty) { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-size: 0.78rem; margin-left: 4px }
.view[data-mode='list'] .map-only { display: none }

.work { flex: 1; min-height: 0; display: grid; grid-template-columns: 268px 1fr }
#filters { overflow-y: auto; padding: 14px 16px 24px; border-right: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 14px }
.filters-head { display: flex; align-items: baseline; justify-content: space-between }
.filters-head h2 { font-size: 1.15rem }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; min-width: 0 }
legend { padding: 0; font-weight: 650; font-size: 0.86rem; color: var(--ink-2); margin-bottom: 5px }
.range { display: grid; grid-template-columns: 1fr 1fr; gap: 6px }
.min { display: flex }
.min button { flex: 1; padding: 5px 0 }

#stage { min-width: 0; min-height: 0 }
#map-pane { height: 100%; display: grid; grid-template-columns: 1fr 348px }
#map { position: relative; min-width: 0 }
#map.drawing canvas { cursor: crosshair }
#legend { position: absolute; left: 12px; bottom: 28px; z-index: 2; background: var(--raised); border-radius: 8px; padding: 9px 11px; box-shadow: var(--shadow); font-size: 0.84rem; display: grid; gap: 2px }
#legend .row { display: flex; align-items: center; gap: 7px }
#legend i { width: 11px; height: 11px; border-radius: 50%; flex: none }
#legend i.ring { background: none; border: 2.5px solid }
#legend hr { width: 100%; border: 0; border-top: 1px solid var(--line-2); margin: 4px 0 }
#hint { position: absolute; top: 12px; left: 50%; translate: -50%; z-index: 3; background: var(--ink); color: var(--paper); padding: 6px 6px 6px 12px; border-radius: 8px; display: flex; align-items: center; gap: 8px; box-shadow: var(--shadow) }
#hint button { padding: 5px 10px }
#hint button:not(.primary) { background: none; color: var(--paper); border-color: rgb(255 255 255 / 30%) }
#crosshair { position: absolute; left: 50%; top: 50%; width: 28px; height: 28px; translate: -50% -50%; z-index: 2; pointer-events: none; border: 2px solid var(--accent); border-radius: 50%; box-shadow: 0 0 0 3px rgb(255 255 255 / 70%) }
#crosshair::after { content: ''; position: absolute; inset: 11px; border-radius: 50%; background: var(--accent) }
.narrow-only { display: none !important }
#tools { display: contents }
#filter-count:not(:empty) { background: var(--accent); color: var(--accent-ink); border-radius: 99px; padding: 0 6px; font-size: 0.78rem; margin-left: 4px }
.maplibregl-popup-content { background: var(--raised); color: var(--ink); font: 13px/1.4 var(--text); border-radius: 6px; padding: 7px 10px; box-shadow: var(--shadow) }
.maplibregl-popup-tip { display: none }

#results { border-left: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; min-height: 0 }
.results-head { padding: 10px 12px; border-bottom: 1px solid var(--line-2) }
.results-head select { width: 100% }
#cards { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1 }
#cards li { padding: 11px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 1px 10px }
#cards li:hover, #cards li.hover { background: var(--accent-wash) }
#cards .title { font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#cards .price { font-family: var(--display); font-weight: 600; font-size: 1.05rem; text-align: right }
#cards .meta { color: var(--ink-2); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
#cards .meta + .meta { text-align: right }
#more-cards, #more-rows { margin: 10px auto; display: block }
.good { color: var(--good) }
.bad { color: var(--bad) }
.star { color: #c99a06 }
.tag { display: inline-block; border-radius: 4px; padding: 0 6px; font-size: 0.78rem; font-weight: 650; background: var(--accent-wash); color: var(--accent) }
.tag.pending { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn) }

#table-pane { height: 100%; display: flex; flex-direction: column; background: var(--surface) }
.table-wrap { overflow: auto; flex: 1 }
table { border-collapse: collapse; width: 100% }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line-2); white-space: nowrap }
th { position: sticky; top: 0; background: var(--surface); font-size: 0.84rem; color: var(--ink-2); font-weight: 650; z-index: 1; box-shadow: inset 0 -1px 0 var(--line) }
th.num, td.num { text-align: right }
th button { all: unset; cursor: pointer; display: inline-flex; gap: 4px; align-items: center }
th button:focus-visible { outline: 2px solid var(--accent) }
th[aria-sort] button { color: var(--ink) }
th[aria-sort='ascending'] button::after { content: '▲'; font-size: 0.6rem }
th[aria-sort='descending'] button::after { content: '▼'; font-size: 0.6rem }
#table tbody tr { cursor: pointer }
#table tbody tr:hover { background: var(--accent-wash) }
#table td.wide { max-width: 240px; overflow: hidden; text-overflow: ellipsis }
#table td.strong { font-weight: 650 }

#drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(480px, 100%); background: var(--raised); box-shadow: var(--shadow); border-left: 1px solid var(--line); z-index: 5; overflow-y: auto; padding: 18px 22px 32px; display: grid; gap: 16px; align-content: start; animation: slide 0.18s ease-out }
@keyframes slide { from { translate: 24px; opacity: 0 } }
.drawer-head { display: flex; align-items: start; gap: 12px }
.drawer-head h2 { flex: 1 }
.figure-xl { font-size: 2.3rem; line-height: 1.05 }
.offer { display: grid; gap: 4px; padding-top: 14px; border-top: 1px solid var(--line-2) }
.offer-top { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap }
.offer-top span { color: var(--ink-2) }
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 0 }
.facts div { background: var(--surface); border-radius: 7px; padding: 8px 10px }
.facts dt { color: var(--ink-3); font-size: 0.8rem }
.facts dd { margin: 0; font-weight: 650; font-size: 1.05rem }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0 }
.kv dt { color: var(--ink-3) }
.kv dd { margin: 0 }
.plain { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px }
.actions { display: flex; gap: 8px; flex-wrap: wrap }
button.favorite.on { border-color: #c99a06; color: #9a7400 }
#drawer textarea { min-height: 64px; resize: vertical }
#drawer form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
#drawer form label { display: grid; gap: 3px; color: var(--ink-2) }
#drawer form button { grid-column: 1 / -1 }
.pair { display: grid; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line-2) }
.pair .side { background: var(--surface); border-radius: 7px; padding: 8px 10px; display: grid; gap: 2px }

.history { position: relative }
.history svg { width: 100%; height: 170px; display: block; overflow: visible }
.history .grid { stroke: var(--grid); stroke-width: 1 }
.history text { fill: var(--ink-3); font-size: 11px }
.history path { fill: none; stroke-width: 2; stroke-linejoin: round }
.history circle { stroke: var(--raised); stroke-width: 2 }
.history .hit { fill: transparent; stroke: none; cursor: crosshair }
.legend-row { display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--ink-2); font-size: 0.86rem }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px }
.chart-tip { position: fixed; top: 0; left: 0; z-index: 20; pointer-events: none; background: var(--ink); color: var(--paper); padding: 6px 9px; border-radius: 5px; font-size: 0.86rem; max-width: 280px }

.page { overflow-y: auto; padding: 26px 32px 48px; display: block }
.page.loading { opacity: 0.55 }
.page-head { display: flex; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px }
.page-head h2 { font-size: 2.1rem }
.report-filters { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; margin-bottom: 18px }
.report-filters label, .report-filters .group { display: grid; gap: 4px; color: var(--ink-2); font-size: 0.86rem; font-weight: 600 }
.report-filters input[type='number'] { width: 104px }
.report-filters .pair-inputs { display: flex; gap: 5px }
.report-filters .chips { grid-column: 1 / -1 }
.active-filters { flex-basis: 100%; display: flex; flex-wrap: wrap; gap: 5px; align-items: center }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; margin-bottom: 18px }
.tile { background: var(--raised); padding: 14px 16px; display: grid; gap: 2px; align-content: start }
.tile span { color: var(--ink-2); font-size: 0.88rem }
.tile b { font-family: var(--display); font-size: 1.7rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.1 }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 16px }
.card { background: var(--raised); border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; display: grid; gap: 10px; align-content: start; min-width: 0 }
.card.wide { grid-column: 1 / -1 }
.card table { font-size: 0.93rem }
.empty { color: var(--ink-3) }
.single { font-family: var(--display); font-size: 1.6rem; font-weight: 600; display: grid }
.single small { font: 0.86rem var(--text) }
.bars { display: grid; gap: 5px }
.bar-row { display: grid; grid-template-columns: minmax(90px, 190px) 1fr auto; gap: 10px; align-items: center }
.bar-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.bar-track { height: 10px }
.bar-track i { display: block; height: 100%; background: var(--series-1); border-radius: 0 4px 4px 0 }
.bar-value { font-weight: 600 }
.columns { display: flex; align-items: end; gap: 2px; height: 130px; border-bottom: 1px solid var(--line) }
.column { flex: 1; height: 100%; display: flex; align-items: end }
.column i { width: 100%; background: var(--series-1); border-radius: 4px 4px 0 0; min-height: 1px }
.axis { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 0.82rem }
svg.line { width: 100%; height: 130px; overflow: visible }
svg.line path { fill: none; stroke: var(--series-1); stroke-width: 2 }
svg.line circle { fill: var(--series-1); stroke: var(--raised); stroke-width: 2 }
.status { font-weight: 650 }
.status.complete::before { content: '● '; color: var(--good) }
.status.partial::before { content: '◐ '; color: var(--warn) }
.status.failed::before { content: '✕ '; color: var(--bad) }

.insight .lead { font-family: var(--display); font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em }
.insight-list, .ranking { list-style: none; margin: 0; padding: 0; display: grid }
.insight-list li, .ranking li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line-2) }
.insight-list li { cursor: pointer }
.insight-list li:hover { background: var(--accent-wash) }
.insight-list span { display: grid; min-width: 0 }
.insight-list .figure { text-align: right; flex: none }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 18px }
h4 { font-size: 0.86rem; color: var(--ink-2) }

.settings { max-width: 720px; display: grid; gap: 16px }
.field { display: grid; gap: 5px; justify-items: start }
.field-label { font-weight: 650 }
.field input, .field select { max-width: 260px }
.notice { color: var(--good) }
.notice.bad { color: var(--bad) }

.gate { grid-template-columns: 1.15fr minmax(360px, 0.85fr); background: var(--raised); overflow: auto }
.gate-art { background: #17153a; overflow: hidden }
.gate-art svg { width: 100%; height: 100%; display: block }
.gate-art path { stroke-linejoin: round; animation: rise 0.9s ease-out backwards }
.gate-art line { stroke: #ef7a4f; stroke-width: 2.5; stroke-linecap: round; animation: rise 0.9s ease-out backwards }
@keyframes rise { from { opacity: 0; translate: 0 14px } }
.gate-form { display: grid; align-content: center; gap: 14px; padding: 48px clamp(28px, 6vw, 84px); max-width: 560px }
.gate-form h1 { font-size: clamp(2rem, 3.4vw, 3rem); line-height: 1.02; text-wrap: balance }
.gate-form > p { color: var(--ink-2); font-size: 1.05rem; max-width: 34ch }
.gate-form form { display: grid; gap: 12px; margin-top: 10px }
.gate-form label { display: grid; gap: 4px; font-weight: 600; color: var(--ink-2) }
.gate-form input { padding: 10px 12px; font-size: 1rem }
#problem { color: var(--bad); font-weight: 600 }

@media (max-width: 900px) {
  body { grid-template-columns: 1fr; grid-template-rows: 1fr auto; height: 100dvh }
  #rail { grid-row: 2; flex-direction: row; padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); justify-content: space-around }
  #rail .brand, #rail .grow { display: none }
  #rail a, #account { padding: 6px 2px; font-size: 0.72rem; min-width: 52px }
  #views { height: auto; min-height: 0 }
  .narrow-only { display: inline-flex !important }
  .results-head.narrow-only { display: block !important }

  .bar { position: relative; padding: 8px 12px; gap: 8px; z-index: 6 }
  .bar #q { width: auto; flex: 1 1 calc(100% - 170px); min-width: 0 }
  #open-filters, #more { align-items: center }
  #count { flex: 1; text-align: right; font-size: 0.86rem }
  #count b { font-size: 1rem }
  #tools { display: none; position: absolute; top: calc(100% + 4px); left: 8px; right: 8px; background: var(--raised); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); padding: 14px; flex-wrap: wrap; gap: 12px; align-items: center }
  #tools.open { display: flex }
  .view[data-mode='list'] #tools .map-only { display: none }

  .work { grid-template-columns: 1fr; position: relative }
  #filters { position: fixed; left: 0; right: 0; bottom: 0; max-height: 86dvh; z-index: 9; border-right: 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); padding-bottom: 0; translate: 0 100%; visibility: hidden; transition: translate 0.22s ease-out, visibility 0.22s }
  .filters-open #filters { translate: 0 0; visibility: visible }
  .filters-open::after { content: ''; position: fixed; inset: 0; z-index: 8; background: rgb(11 18 24 / 45%) }
  #close-filters { position: sticky; bottom: 0; margin: 4px -16px 0; border-radius: 0; padding: 14px; justify-content: center; box-shadow: 0 -8px 16px var(--surface) }

  #map-pane { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto }
  #results { border-left: 0; border-top: 1px solid var(--line); max-height: 36dvh; transition: max-height 0.2s ease-out }
  #results.expanded { max-height: 62dvh }
  .results-head { display: flex; gap: 8px; padding: 8px 12px }
  .results-head select { flex: 1; min-width: 0 }
  #cards li { padding: 10px 12px }
  #legend { left: 8px; bottom: 8px; padding: 6px 9px; font-size: 0.74rem; cursor: pointer }
  #legend:not(.open) .row, #legend:not(.open) hr { display: none }
  #legend:not(.open)::before { content: 'Legenda'; font-weight: 650 }
  #legend i { width: 9px; height: 9px }
  #hint { top: 8px; width: calc(100% - 16px); justify-content: space-between }
  #hint span { font-size: 0.86rem }
  .maplibregl-ctrl-attrib { font-size: 10px }

  #table thead { display: none }
  #table, #table tbody { display: block }
  #table tbody tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 11px 14px; border-bottom: 1px solid var(--line-2) }
  #table td { display: none; padding: 0; border: 0; white-space: nowrap }
  #table td[data-col='category'] { display: block; order: 1; flex: 1 1 55%; font-weight: 650; overflow: hidden; text-overflow: ellipsis }
  #table td[data-col='price'] { display: block; order: 2; font-family: var(--display); font-size: 1.05rem; text-align: right }
  #table td[data-col='neighborhood'] { display: block; order: 3; flex: 1 1 55%; max-width: none; color: var(--ink-2) }
  #table td[data-col='price_m2'] { display: block; order: 4; color: var(--ink-2); text-align: right }
  #table td[data-col='price_m2']::after { content: '/m²' }
  #table td[data-col='area'], #table td[data-col='bedrooms'], #table td[data-col='parking'] { display: block; order: 5; color: var(--ink-2); font-size: 0.88rem }
  #table td[data-col='bedrooms']::after, #table td[data-col='parking']::after { content: ' ' attr(data-label); text-transform: lowercase }
  #table td[data-col='gap_pct'] { display: block; order: 6; margin-left: auto; font-size: 0.88rem }
  #table td[data-col='gap_pct']::after { content: ' vs modelo' ; color: var(--ink-3) }
  #table td[data-col='agency'] { display: block; order: 7; flex-basis: 100%; font-size: 0.84rem; color: var(--ink-3) }
  #table td[data-empty] { display: none }
  #table-pane .results-head { border-bottom: 1px solid var(--line-2) }

  #drawer { padding: 14px 16px 28px; border-left: 0; z-index: 7 }
  .figure-xl { font-size: 1.9rem }
  .page { padding: 18px 14px 32px }
  .page-head h2 { font-size: 1.7rem }
  .grid { grid-template-columns: 1fr }
  .gate { grid-template-columns: 1fr; grid-template-rows: 160px 1fr }
}

@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr 1fr }
  .bar-row { grid-template-columns: minmax(70px, 110px) 1fr auto; gap: 8px }
  .tiles { grid-template-columns: 1fr 1fr }
  .tile b { font-size: 1.35rem }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important }
}

.meter { height: 4px; border-radius: 99px; background: var(--line-2); overflow: hidden; margin-top: -6px }
.meter i { display: block; height: 100%; width: 0; background: var(--bad); transition: width 0.15s }
.meter i[data-level='mid'] { background: var(--warn) }
.meter i[data-level='high'] { background: var(--good) }
.invite { display: flex; gap: 10px; align-items: end; flex-wrap: wrap }
.invite .field { flex: 1 1 260px }
.invite .field input { max-width: none }
.link { display: grid; gap: 8px; padding: 12px; border-radius: 8px; background: var(--accent-wash) }
.copy { display: flex; gap: 8px }
.copy input { flex: 1; min-width: 0 }

.comparables {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.comparables span {
  color: var(--muted);
}
