:root {
  color-scheme: light;
  --ink: #141517;
  --muted: #50545d;
  --paper: #f7f5f1;
  --panel: #fff;
  --navy: #141517;
  --navy-2: #2f55b7;
  --line: #deddd9;
  --blue: #2f55b7;
  --blue-dark: #24479f;
  --shadow: 0 18px 55px rgba(20, 21, 23, .18);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; background: var(--paper); color: var(--ink); }
body { font-size: 16px; }
button, input, select { font: inherit; }
button, select, input { min-height: 44px; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); width: 100%; min-width: 0; height: 100dvh; }
.topbar { position: relative; z-index: 700; display: block; width: 100%; min-width: 0; background: #fff; color: var(--ink); box-shadow: 0 2px 0 rgba(20, 21, 23, .16); }
.topbar-main { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 72px; padding: 10px 18px; }
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 180px; }
.brand-logo { display: block; width: 180px; height: auto; max-height: 36px; object-fit: contain; object-position: left center; }
.brand h1 { margin: 0; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1rem; font-weight: 400; letter-spacing: -.02em; }
.sync-state { margin-top: 2px; color: var(--muted); opacity: .78; font-size: .78rem; }
.sync-state.waiting { color: var(--blue); opacity: 1; }
.metrics { display: flex; align-items: stretch; gap: 1px; flex: 0 0 auto; }
.metric { min-width: 0; padding: 5px 9px; border-left: 1px solid var(--line); white-space: nowrap; }
.metric strong { display: block; font-size: 1rem; line-height: 1.2; }
.metric span { color: var(--muted); opacity: .82; font-size: .74rem; }
.filterbar { position: relative; z-index: 650; display: grid; flex: 1 1 auto; min-width: 0; grid-template-columns: minmax(145px, 1fr) minmax(150px, 190px) auto; gap: 6px; padding: 0; background: #fff; }
.search-wrap { position: relative; min-width: 0; }
.search-wrap svg { position: absolute; left: 13px; top: 13px; width: 18px; height: 18px; color: #748592; pointer-events: none; }
.search-wrap input { padding-left: 40px; }
.field-control { width: 100%; height: 44px; padding: 0 12px; border: 1px solid #bfc4cf; border-radius: 10px; background: #fff; color: var(--ink); }
.filterbar .field-control { min-width: 0; font-size: .875rem; padding-right: 7px; }
.filterbar .button { font-size: .875rem; padding: 0 12px; }
.top-actions { display: flex; flex-shrink: 0; gap: 6px; }
.top-actions .button { white-space: nowrap; padding: 0 10px; }
.website-link { white-space: nowrap; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px; background: #fff; color: var(--ink); font-weight: 750; text-decoration: none; }
.button:hover { background: #f0f2f8; }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.map-button:focus-visible, .segmented button:focus-visible, .icon-button:focus-visible, .group-card:focus-visible, #map:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.button.primary { background: var(--blue); color: #fff; }
.button.primary:hover { background: var(--blue-dark); }
.button.quiet { background: transparent; color: var(--blue-dark); border-color: rgba(47, 85, 183, .3); }
.button.quiet:hover { background: rgba(47, 85, 183, .08); }
.button:disabled { opacity: .5; cursor: not-allowed; }

.map-wrap { position: relative; min-width: 0; min-height: 0; }
.map-policy-links { position: absolute; z-index: 540; bottom: 12px; left: 12px; display: flex; gap: 4px; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 3px 12px rgba(20,21,23,.1); }
.map-policy-links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 10px; color: var(--blue-dark); font-size: .78rem; font-weight: 700; text-decoration: none; }
.map-policy-links a:hover { text-decoration: underline; }
#map { width: 100%; height: 100%; background: #e5e8ed; }
.map-tools { position: absolute; z-index: 550; top: 12px; left: 12px; display: flex; gap: 8px; pointer-events: none; }
.map-tools > * { pointer-events: auto; }
.segmented { display: flex; padding: 3px; border: 1px solid rgba(20, 21, 23, .2); border-radius: 11px; background: rgba(255, 255, 255, .96); box-shadow: 0 4px 18px rgba(20, 21, 23, .14); }
.segmented button { min-height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #454b57; font-weight: 750; }
.segmented button[aria-pressed="true"] { background: var(--blue); color: #fff; }
.map-button { min-height: 44px; padding: 0 13px; border: 1px solid rgba(20, 21, 23, .2); border-radius: 11px; background: rgba(255, 255, 255, .96); color: var(--ink); font-weight: 750; box-shadow: 0 4px 18px rgba(20, 21, 23, .14); }
.map-button:hover { background: #fff; }
.map-hint { position: absolute; z-index: 540; top: 66px; left: 12px; max-width: min(420px, calc(100% - 24px)); margin: 0; padding: 8px 11px; border: 1px solid rgba(20, 21, 23, .12); border-radius: 10px; background: rgba(255, 255, 255, .94); color: #454b57; font-size: .78rem; line-height: 1.4; box-shadow: 0 4px 18px rgba(20, 21, 23, .1); pointer-events: none; }
.map-error { position: absolute; z-index: 560; top: 66px; right: 12px; max-width: min(420px, calc(100% - 24px)); margin: 0; padding: 11px 13px; border: 1px solid #e4c98b; border-radius: 12px; background: #fffdf4; color: #66552b; line-height: 1.45; box-shadow: var(--shadow); }
.empty-map { position: absolute; z-index: 540; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(90%, 390px); padding: 22px; text-align: center; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .97); box-shadow: var(--shadow); }
.empty-map h2 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 400; }
.empty-map p { margin: 0 0 14px; color: var(--muted); line-height: 1.45; }

.property-panel { position: absolute; z-index: 620; top: 12px; right: 12px; bottom: 12px; width: min(390px, calc(100% - 24px)); display: flex; flex-direction: column; border: 1px solid rgba(20, 21, 23, .14); border-radius: 18px; background: #fff; box-shadow: var(--shadow); overflow: hidden; }
.panel-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px 18px 14px; border-bottom: 1px solid var(--line); }
.panel-head-copy { min-width: 0; flex: 1; }
.eyebrow { margin: 0 0 4px; color: var(--blue-dark); font-size: .76rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.panel-head h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 400; letter-spacing: -.025em; overflow-wrap: anywhere; }
.icon-button { width: 44px; min-width: 44px; height: 44px; border: 0; border-radius: 10px; background: #f0f2f7; color: var(--ink); font-size: 1.35rem; }
.icon-button:hover { background: #e8ebf3; }
.panel-body { min-height: 0; padding: 18px; overflow: auto; overscroll-behavior: contain; }
.subtle { color: var(--muted); line-height: 1.5; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 18px 0; }
.detail-box { min-width: 0; padding: 12px; border-radius: 11px; background: #f3f4f7; }
.detail-box span { display: block; margin-bottom: 4px; color: var(--muted); font-size: .76rem; }
.detail-box strong { display: block; overflow-wrap: anywhere; font-size: .94rem; }
.panel-note { margin: 8px 0 20px; padding-top: 15px; border-top: 1px solid var(--line); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.panel-note a { color: var(--blue-dark); text-decoration: underline; text-underline-offset: 2px; }
.group-list { display: grid; gap: 10px; }
.group-card { width: 100%; min-height: 0; padding: 13px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
.group-card:hover { border-color: #93a6d4; background: #f8f9fd; }
.group-card strong, .group-card span { display: block; }
.group-card span { margin-top: 4px; color: var(--muted); font-size: .85rem; }

.property-pin { background: transparent; border: 0; }
.property-pin svg { display: block; overflow: visible; filter: drop-shadow(0 3px 3px rgba(20, 21, 23, .28)); }
.property-pin.marker-selected svg, .marker-selected .property-pin svg { filter: drop-shadow(0 0 0 #fff) drop-shadow(0 4px 6px rgba(20, 21, 23, .4)); transform: translateY(-2px); }
.leaflet-tooltip { max-width: min(280px, calc(100vw - 32px)); white-space: normal; overflow-wrap: anywhere; }
.leaflet-tooltip.property-tooltip { padding: 0; border: 0; border-radius: 12px; box-shadow: 0 10px 35px rgba(16,33,47,.22); overflow: hidden; }
.property-tooltip::before { display: none; }
.tooltip-card { width: 260px; padding: 13px; color: var(--ink); }
.tooltip-card strong, .tooltip-card span { display: block; }
.tooltip-card strong { margin-bottom: 5px; }
.tooltip-card span { margin-top: 3px; color: var(--muted); font-size: .82rem; white-space: normal; }
.leaflet-control-attribution { max-width: calc(100vw - 20px); font-size: 11px; }
.leaflet-bottom { bottom: 6px; }
body.panel-open .leaflet-right { right: 410px; }

@media (max-width: 1199px) {
  .topbar-main { display: grid; grid-template-columns: 185px minmax(0, 1fr) auto; grid-template-areas: "brand metrics actions" "filters filters filters"; min-height: 0; padding: 9px 12px; gap: 8px 10px; }
  .brand { grid-area: brand; min-width: 0; }
  .brand-logo { width: min(100%, 180px); max-height: 36px; }
  .sync-state { max-width: 150px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  .metrics { grid-area: metrics; margin-left: auto; }
  .metric { padding: 3px 9px; }
  .metric strong { font-size: .9rem; }
  .metric span { font-size: .68rem; }
  .filterbar { grid-area: filters; grid-template-columns: minmax(130px, 1fr) minmax(150px, 190px) auto; }
  .top-actions { grid-area: actions; }
}
@media (max-width: 900px) {
  .topbar-main { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand actions" "metrics metrics" "filters filters"; gap: 7px 8px; padding: 8px 10px 9px; }
  .brand { flex-direction: row; align-items: center; gap: 8px; overflow: hidden; }
  .brand-logo { width: min(170px, 46vw); max-height: 32px; flex: 0 1 auto; }
  .brand > div { min-width: 0; }
  .brand h1 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sync-state { max-width: 140px; }
  .top-actions { justify-content: flex-end; gap: 5px; }
  .top-actions .button { min-width: 44px; padding: 0 10px; }
  .metrics { grid-area: metrics; width: 100%; border-top: 1px solid var(--line); padding-top: 5px; }
  .metric { flex: 1 1 0; min-width: 0; padding: 1px 8px; border-left: 1px solid var(--line); }
  .metric:first-child { border-left: 0; }
  .metric strong { font-size: .86rem; }
  .metric span { font-size: .68rem; white-space: normal; }
  .filterbar { width: 100%; grid-template-columns: minmax(0, 1fr) minmax(140px, .85fr) auto; gap: 6px; }
  .map-tools { top: 9px; left: 9px; right: 9px; }
  .map-button { margin-left: auto; }
  body.panel-open .map-hint { display: none; }
  .property-panel { top: auto; left: 8px; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); width: auto; max-height: min(46dvh, calc(100% - 80px)); border-radius: 18px; }
  .panel-head { padding: 14px 16px 11px; }
  .panel-body { padding: 15px 16px max(18px, env(safe-area-inset-bottom)); }
  body.panel-open .leaflet-right { right: 0; }
  body.panel-open .leaflet-bottom { bottom: min(47dvh, 410px); }
}
@media (max-width: 560px) {
  .brand > div { display: none; }
  .brand-logo { width: min(170px, 46vw); max-height: 30px; }
  .top-actions .button { padding: 0 8px; font-size: .84rem; }
  .filterbar { grid-template-columns: minmax(0, 1fr) auto; }
  .filterbar .search-wrap { grid-column: 1 / -1; }
  .filterbar .button { grid-column: 2; }
  .field-control { padding-right: 5px; }
  .map-tools { top: 8px; left: 8px; right: 8px; gap: 6px; }
  .segmented { max-width: calc(100% - 115px); }
  .segmented button { padding: 0 9px; }
  .map-button { padding: 0 10px; white-space: nowrap; }
  .map-hint { top: 62px; left: 8px; max-width: calc(100% - 16px); font-size: .72rem; }
  .map-error { top: 62px; left: 8px; right: 8px; max-width: none; }
  .detail-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .property-panel { max-height: min(46dvh, calc(100% - 80px)); }
}
@media (max-width: 380px) {
  .top-actions { gap: 4px; }
  .top-actions .button { padding: 0 6px; font-size: .78rem; }
  .metric { padding-right: 5px; padding-left: 5px; }
  .filterbar { grid-template-columns: minmax(0, 1fr) auto; }
  .filterbar .button { padding: 0 7px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

