:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  color: #17304c;
  background: #f5f7fa;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  --ink: #17304c;
  --ink-soft: #586c81;
  --muted: #7c8ca0;
  --line: #dce3eb;
  --line-strong: #c8d3df;
  --blue: #1d5cba;
  --blue-dark: #154d9e;
  --blue-pale: #eaf2ff;
  --surface: #fff;
  --surface-soft: #f7f9fc;
  --shadow: 0 8px 26px rgba(17, 44, 74, .11);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; }
body { min-width: 840px; overflow: hidden; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); }
button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #8ab8ff; outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); border: 0; white-space: nowrap; }

.app-shell { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; min-height: 620px; }
.topbar { z-index: 1200; display: flex; align-items: center; gap: 26px; flex: 0 0 76px; padding: 0 28px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 2px 10px rgba(15, 44, 80, .04); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: 0 0 205px; color: var(--ink); white-space: nowrap; }
.brand-mark { display: grid; place-items: center; width: 41px; height: 41px; border-radius: 11px; background: #e6f1ff; color: var(--blue); }
.brand-mark svg { width: 27px; height: 27px; }
.brand-type { display: grid; gap: 0; line-height: 1.05; letter-spacing: -.025em; }
.brand-type strong { font-size: 16px; font-weight: 800; }
.brand-type span { color: var(--blue); font-size: 14px; font-weight: 750; }
.search-box { display: flex; align-items: center; gap: 10px; height: 44px; width: min(540px, 100%); min-width: 280px; padding: 0 5px 0 13px; border: 1px solid var(--line-strong); border-radius: 9px; box-shadow: 0 1px 2px rgba(11, 37, 70, .04); background: var(--surface); }
.search-box:focus-within { border-color: #6da3ef; box-shadow: 0 0 0 3px #cfe2ff; }
.search-icon { width: 20px; height: 20px; flex: none; color: #75869b; }
.search-box input { min-width: 0; flex: 1; padding: 0; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box input::placeholder { color: #8190a2; }
.search-submit, .button.primary { border: 1px solid var(--blue); border-radius: 7px; background: var(--blue); color: white; font-weight: 750; }
.search-submit { height: 34px; padding: 0 16px; font-size: 12px; }
.search-submit:hover, .button.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.topbar-right { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex: 1; white-space: nowrap; }
.source-badge { display: inline-flex; align-items: center; gap: 7px; padding: 8px 10px; border: 1px solid #d6e8dd; border-radius: 100px; background: #f3fbf5; color: #31734c; font-size: 11px; font-weight: 700; }
.source-dot { width: 6px; height: 6px; border-radius: 50%; background: #36a567; box-shadow: 0 0 0 3px #d6f0df; }
.about-link { color: var(--ink-soft); text-decoration: none; font-size: 12px; font-weight: 650; }
.about-link:hover { color: var(--blue); }

.filterbar { z-index: 1100; flex: 0 0 auto; min-height: 66px; background: var(--surface); border-bottom: 1px solid var(--line); }
.filterbar-main { display: flex; align-items: center; gap: 9px; padding: 11px 22px; overflow-x: auto; scrollbar-width: thin; }
.filter-intro { margin-right: 1px; color: var(--muted); font-size: 11px; font-weight: 750; text-transform: uppercase; letter-spacing: .1em; }
.filter-chip, .select-chip, .filter-pair { display: inline-flex; align-items: center; height: 40px; flex: none; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); font-size: 12px; font-weight: 700; white-space: nowrap; }
.filter-chip { justify-content: center; gap: 7px; padding: 0 12px; }
.fixed-chip { border-color: #b9d2fb; background: var(--blue-pale); color: var(--blue-dark); }
.checkbox-chip { cursor: pointer; }
.checkbox-chip:hover, .select-chip:hover, .more-filters summary:hover, .map-action:hover { border-color: #9cbadf; }
.checkbox-chip input { width: 15px; height: 15px; margin: 0; accent-color: var(--blue); }
.checkbox-chip:has(input:checked) { border-color: #8ab5ed; background: #eef5ff; color: var(--blue-dark); }
.filter-pair { gap: 8px; padding: 0 10px; }
.filter-caption { color: var(--ink-soft); font-size: 11px; }
.filter-pair input { width: 72px; padding: 5px 0; border: 0; outline: 0; color: var(--ink); font-size: 12px; }
.filter-pair input::placeholder { color: #8a99a9; }
.filter-pair input::-webkit-inner-spin-button, .filter-pair input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.range-dash { color: #9aa9ba; }
.select-chip select { height: 100%; max-width: 175px; padding: 0 11px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 12px; font-weight: 700; cursor: pointer; }
.unavailable-chip { border-style: dashed; background: #f8fafc; color: #8b98a8; }
.unavailable-chip span { color: #8b98a8; font-size: 14px; }
.more-filters { position: relative; flex: none; }
.more-filters summary { list-style: none; cursor: pointer; }
.more-filters summary::-webkit-details-marker { display: none; }
.more-filters[open] summary { border-color: #95b9e8; background: var(--blue-pale); color: var(--blue-dark); }
.more-panel { position: fixed; top: 134px; right: 20px; z-index: 3000; display: grid; gap: 8px; width: 285px; padding: 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); white-space: normal; }
.more-panel strong { font-size: 14px; }
.more-panel p { margin: 0 0 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.more-panel label { display: flex; justify-content: space-between; margin-top: 4px; color: var(--ink); font-size: 11px; font-weight: 700; }
.more-panel label span { color: var(--muted); font-weight: 500; }
.more-panel input { width: 100%; height: 36px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 7px; background: white; color: var(--ink); font-size: 12px; }
.button { min-height: 37px; padding: 0 14px; font-size: 12px; }
.more-panel .button { margin-top: 8px; }

.workspace { display: grid; grid-template-columns: minmax(430px, 56fr) minmax(410px, 44fr); flex: 1; min-height: 0; overflow: hidden; }
.map-pane { position: relative; min-width: 0; height: 100%; overflow: hidden; background: #e6eced; }
#map { width: 100%; height: 100%; background: #e1e9e7; }
.map-pane .leaflet-container { font: inherit; }
.map-pane .leaflet-control-zoom { margin-top: 82px; border: 1px solid #d1dae4; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 9px rgba(22, 52, 83, .12); }
.map-pane .leaflet-control-zoom a { color: var(--ink); border-color: var(--line); }
.map-pane .leaflet-control-attribution { padding: 2px 5px; background: rgba(255,255,255,.82); font-size: 9px; }
.map-top-controls { position: absolute; top: 16px; left: 50%; z-index: 800; display: flex; gap: 8px; transform: translateX(-50%); white-space: nowrap; }
.map-action { height: 36px; padding: 0 15px; border: 1px solid #c8d4df; border-radius: 8px; background: white; box-shadow: 0 3px 12px rgba(17, 49, 83, .13); color: var(--ink); font-size: 11px; font-weight: 750; }
.map-action.primary { border-color: var(--blue); background: var(--blue); color: white; }
.map-action.primary:hover { background: var(--blue-dark); }
.map-bottom-controls { position: absolute; right: 16px; bottom: 16px; left: 16px; z-index: 800; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; pointer-events: none; }
.map-status { max-width: 330px; padding: 8px 11px; border: 1px solid rgba(211, 221, 230, .8); border-radius: 7px; background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(17, 49, 83, .11); color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
.map-credit { max-width: 260px; padding: 4px 6px; border-radius: 3px; background: rgba(255,255,255,.85); color: #5e7184; text-align: right; font-size: 8px; }
.price-pin { display: inline-flex; align-items: center; justify-content: center; min-width: 48px; height: 28px; padding: 0 7px; border: 1px solid #f4ffff; border-radius: 7px; background: #fff; box-shadow: 0 2px 9px rgba(19, 48, 76, .25); color: var(--ink); font-size: 10px; font-weight: 800; white-space: nowrap; }
.price-pin:hover, .price-pin.selected { border-color: #a1c4fc; background: var(--blue); color: white; transform: scale(1.08); }
.leaflet-div-icon { background: transparent; border: 0; }

.results-pane { min-width: 0; height: 100%; overflow-y: auto; background: var(--surface-soft); border-left: 1px solid var(--line); scrollbar-width: thin; }
.results-heading { padding: 26px 27px 18px; background: white; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.results-heading h1 { margin: 0; color: var(--ink); font-size: clamp(20px, 2vw, 27px); font-weight: 800; line-height: 1.1; letter-spacing: -.035em; }
.results-description { margin: 9px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.results-meta { display: flex; align-items: end; justify-content: space-between; gap: 15px; margin-top: 22px; }
.results-meta strong { color: var(--ink); font-size: 12px; }
.results-meta label { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 11px; }
.results-meta select { max-width: 177px; height: 32px; padding: 0 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: white; color: var(--ink); font-size: 11px; font-weight: 650; }
.data-notice { display: flex; gap: 10px; margin: 18px 22px 3px; padding: 10px 12px; border: 1px solid #d9e6f7; border-radius: 8px; background: #eff6ff; color: #3f5e7f; }
.notice-icon { display: grid; place-items: center; flex: 0 0 16px; width: 16px; height: 16px; border-radius: 50%; background: #bdd8fb; color: #1c5aaa; font-size: 11px; font-weight: 800; }
.data-notice p { margin: 0; font-size: 10px; line-height: 1.45; }
.data-notice strong { color: #254a78; }
.results-list { display: grid; align-content: start; gap: 12px; padding: 16px 22px 22px; }
.property-card { display: grid; grid-template-columns: 112px minmax(0,1fr); gap: 14px; width: 100%; min-height: 140px; padding: 10px; border: 1px solid #dde5ee; border-radius: 11px; background: white; box-shadow: 0 2px 9px rgba(20, 52, 82, .045); color: var(--ink); text-align: left; transition: border-color .15s, transform .15s, box-shadow .15s; }
.property-card:hover, .property-card.selected { border-color: #91b9ed; box-shadow: 0 6px 18px rgba(31, 83, 140, .13); transform: translateY(-1px); }
.property-thumb, .property-visual { display: grid; place-items: center; min-width: 0; min-height: 120px; border-radius: 7px; background: linear-gradient(155deg,#c6d7e8,#e4ebf1 62%,#c3d4e0); color: #6486a6; overflow: hidden; }
.property-thumb svg, .property-visual svg { width: 48px; height: 48px; opacity: .66; }
.property-visual { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 10px 5px; }
.property-visual-icon { color: #5985ad; font-family: Georgia, serif; font-size: 48px; font-weight: 400; line-height: 1; }
.property-visual .property-badge { max-width: 100%; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.property-card-body, .property-body { display: grid; align-content: start; min-width: 0; padding: 4px 3px 1px 0; }
.property-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 7px; }
.property-value, .property-price { color: #132c49; font-size: 20px; font-weight: 850; letter-spacing: -.035em; }
.property-tag, .property-badge { padding: 5px 6px; border-radius: 5px; background: #e9f3fd; color: #245f9f; font-size: 9px; font-weight: 750; white-space: nowrap; }
.property-price-label { color: var(--muted); font-size: 10px; font-weight: 650; }
.property-address { margin-top: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); font-size: 12px; font-weight: 750; }
.property-place { margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
.property-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 13px; color: #566e84; font-size: 10px; }
.property-facts b { color: var(--ink); }
.property-sale, .property-meta { margin-top: 10px; color: var(--muted); font-size: 10px; }
.empty-state { padding: 46px 28px; border: 1px dashed #cbd8e6; border-radius: 12px; background: white; text-align: center; }
.empty-state strong { display: block; margin-bottom: 8px; font-size: 16px; }
.empty-state p { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
.loading-placeholder { display: grid; gap: 12px; }
.loading-placeholder span { display: block; height: 142px; border: 1px solid #e8edf2; border-radius: 11px; background: linear-gradient(100deg,#eef2f6,#fff 45%,#eef2f6 70%); background-size: 250% 100%; animation: shimmer 1.7s linear infinite; }
@keyframes shimmer { from { background-position: 130% 0; } to { background-position: -130% 0; } }
.results-footer { margin: 1px 22px 20px; padding: 12px 2px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 9px; line-height: 1.5; }
.results-footer a { color: #4b76ae; }

.detail-panel { position: absolute; top: 143px; right: 0; bottom: 0; z-index: 2200; width: min(510px, 48vw); overflow: auto; border-left: 1px solid var(--line-strong); background: white; box-shadow: -12px 0 28px rgba(18, 43, 72, .17); }
.detail-panel-head { position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between; height: 52px; padding: 0 22px; border-bottom: 1px solid var(--line); background: rgba(255,255,255,.97); color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.icon-button { display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); font-size: 22px; line-height: 1; }
.icon-button:hover { background: var(--blue-pale); }
.detail-content { padding: 24px; }
.detail-content h2, .detail-title { margin: 0 0 5px; color: var(--ink); font-size: 24px; letter-spacing: -.035em; }
.detail-hero { display: block; }
.detail-overline { display: block; margin-bottom: 11px; color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .13em; }
.detail-value-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0 0 24px; }
.detail-stat { display: grid; align-content: start; gap: 6px; min-width: 0; padding: 12px; border: 1px solid #e7edf4; border-radius: 8px; background: var(--surface-soft); }
.detail-stat small { display: block; color: var(--muted); font-size: 10px; line-height: 1.35; }
.detail-stat strong { display: block; color: var(--ink); font-size: 14px; line-height: 1.2; overflow-wrap: anywhere; }
.detail-value-row .detail-stat strong { font-size: 19px; letter-spacing: -.025em; }
.detail-subtitle { color: var(--ink-soft); font-size: 12px; }
.detail-kicker { color: var(--blue); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.detail-hero { margin-bottom: 23px; padding: 20px; border: 1px solid #d9e6f5; border-radius: 12px; background: linear-gradient(140deg,#f0f6ff,#fff); }
.estimate-label { color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.estimate-value { margin: 7px 0 4px; color: var(--blue-dark); font-size: 32px; font-weight: 850; letter-spacing: -.055em; }
.estimate-range { color: var(--ink-soft); font-size: 11px; }
.estimate-note { margin: 12px 0 0; color: #56738e; font-size: 10px; line-height: 1.55; }
.estimate-hero { display: grid; gap: 6px; margin: 10px 0 16px; padding: 20px; border: 1px solid #cfe0f7; border-radius: 11px; background: linear-gradient(145deg, #edf5ff, #fff); }
.estimate-hero .estimate-value { display: block; margin: 0; line-height: 1.1; }
.estimate-hero .estimate-range { display: block; margin-top: 2px; color: #365d84; font-size: 12px; font-weight: 650; }
.estimate-confidence { display: inline-flex; justify-self: start; margin-top: 8px; padding: 5px 8px; border: 1px solid #cbdff8; border-radius: 100px; background: #f5f9ff; color: #375c82; font-size: 10px; font-weight: 700; }
.estimate-method, .estimate-unavailable { margin: 12px 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.estimate-unavailable { padding: 13px; border: 1px solid #e5e9ef; border-radius: 8px; background: var(--surface-soft); }
.estimate-loading { color: var(--ink-soft); font-size: 11px; }
.detail-section h4 { margin: 22px 0 6px; color: var(--ink); font-size: 12px; }
.detail-section { margin: 22px 0; padding-top: 21px; border-top: 1px solid var(--line); }
.detail-section h3 { margin: 0 0 13px; font-size: 15px; }
.detail-grid, .detail-stat-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.detail-fact { padding: 11px; border-radius: 8px; background: var(--surface-soft); }
.detail-fact span { display: block; color: var(--muted); font-size: 10px; }
.detail-fact strong { display: block; margin-top: 4px; color: var(--ink); font-size: 12px; }
.comp-list { margin: 0; padding: 0; list-style: none; }
.comp-row { display: grid; grid-template-columns: minmax(0,1fr) auto; grid-template-areas: "name price" "meta price"; align-items: center; gap: 4px 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 11px; }
.comp-row strong { grid-area: name; min-width: 0; color: var(--ink); font-weight: 750; line-height: 1.35; }
.comp-row > span { grid-area: price; color: var(--ink); font-weight: 800; white-space: nowrap; }
.comp-row small { grid-area: meta; color: var(--muted); font-size: 10px; line-height: 1.35; }
.estimate-limitations { margin-top: 17px; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft); }
.estimate-limitations summary { color: var(--blue); font-size: 11px; font-weight: 750; cursor: pointer; }
.estimate-limitations p { margin: 10px 0 0; color: var(--ink-soft); font-size: 10px; line-height: 1.5; }
.source-link { display: inline-block; margin-top: 4px; font-size: 11px; font-weight: 700; text-decoration: none; }
.source-link:hover { text-decoration: underline; }
.detail-disclaimer { padding: 11px; border: 1px solid #f0e5cb; border-radius: 8px; background: #fff9ed; color: #806b4b; font-size: 10px; line-height: 1.5; }
.toast { position: absolute; right: 24px; bottom: 22px; z-index: 4000; max-width: 390px; padding: 12px 15px; border-radius: 9px; background: #1b3550; box-shadow: 0 8px 26px rgba(13, 34, 57, .27); color: white; font-size: 12px; line-height: 1.45; }

@media (max-width: 1180px) {
  .topbar { gap: 13px; padding: 0 16px; }
  .brand { flex-basis: 174px; }
  .topbar-right { gap: 8px; }
  .source-badge { display: none; }
  .workspace { grid-template-columns: minmax(390px, 52fr) minmax(390px, 48fr); }
  .results-heading { padding: 22px 20px 16px; }
  .results-list { padding: 16px 15px; }
  .data-notice { margin-right: 15px; margin-left: 15px; }
}

@media (max-width: 960px) {
  .topbar { flex-basis: 68px; }
  .brand { flex-basis: 146px; }
  .brand-type strong { font-size: 13px; }
  .brand-type span { font-size: 12px; }
  .brand-mark { width: 35px; height: 35px; }
  .about-link { display: none; }
  .workspace { grid-template-columns: minmax(370px, 50fr) minmax(370px, 50fr); }
  .property-card { grid-template-columns: 90px minmax(0,1fr); gap: 10px; }
  .property-thumb, .property-visual { min-height: 118px; }
  .detail-panel { top: 135px; width: min(485px, 52vw); }
  .more-panel { top: 127px; }
}
