/* way2tolet tenant map.
   Brand tokens from assets/brand/README.md: Deep Teal, Bright Teal, Ochre,
   Ink, Paper. Industrial borrows a slate at the same lightness. */
/* The panel, counter and suggestion list are toggled with the `hidden`
   attribute. Their own display rules would otherwise outrank the browser's
   default for hidden, drawing an empty panel before any pin is clicked. */
[hidden] { display: none !important; }

:root {
  --teal: #0E6E5E;
  --teal-bright: #2FBEA2;
  --ochre: #B8701A;
  --ochre-deep: #96590F;
  --slate: #3A5A7A;
  --ink: #0B1D19;
  --paper: #F4F7F5;
  --muted: #5C6B66;
  --faint: #8B9B96;
  --line: #DDE5E1;
  --shadow: 0 2px 12px rgba(11, 29, 25, 0.11);
  --shadow-lg: 0 10px 40px rgba(11, 29, 25, 0.24);
  --radius: 11px;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #E6EDE8; }
button { font: inherit; }

#map { position: fixed; inset: 0; z-index: 0; background: #E6EDE8; }
/* Leaflet's default attribution is fine; keep it legible on the light basemap. */
.leaflet-control-attribution { font-size: 9px; color: var(--muted); background: rgba(255,255,255,.82); }
.leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: var(--ink); }

/* ---- floating top bar -------------------------------------------------- */
.topbar {
  position: fixed; z-index: 1000; left: 16px; right: 16px; top: 16px;
  display: flex; align-items: flex-start; gap: 12px; pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 46px; height: 46px; border-radius: var(--radius); background: var(--ink); box-shadow: var(--shadow);
}
.search {
  position: relative; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  width: min(460px, 100%); min-height: 46px; padding: 0 14px;
  border-radius: var(--radius); background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow);
}
.search__icon { color: var(--muted); flex-shrink: 0; }
.search__chips { display: flex; gap: 6px; }
.search__chips:empty { display: none; }
.area-chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 9px;
  border: 0; border-radius: 6px; background: #E3F0EC; color: var(--teal); font-size: 13px; font-weight: 600; cursor: pointer;
}
.area-chip:hover { background: #d5e8e1; }
.search__input {
  flex: 1 1 120px; min-width: 120px; height: 44px; border: 0; outline: 0; font: inherit; font-size: 14px; color: var(--ink); background: transparent;
}
.search__input::placeholder { color: var(--faint); }
.suggestions {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); margin: 0; padding: 6px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg);
}
.suggestions li {
  display: flex; flex-direction: column; gap: 1px; padding: 9px 10px; border-radius: 8px; cursor: pointer;
}
.suggestions li:hover, .suggestions li[aria-selected="true"] { background: var(--paper); }
.suggestions .s-primary { font-size: 14px; font-weight: 500; }
.suggestions .s-primary b { color: var(--teal); }
.suggestions .s-secondary { font-size: 11.5px; color: var(--muted); }
.suggestions .s-empty { color: var(--muted); font-size: 13px; cursor: default; }
.count {
  display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 15px; flex-shrink: 0;
  border-radius: var(--radius); background: var(--ink); color: var(--paper); box-shadow: var(--shadow); font-size: 13.5px;
}
.count strong { font-weight: 600; }
.count span { color: #8FA8A2; font-size: 12px; }

/* ---- kind chips ---------------------------------------------------------- */
.chips {
  position: fixed; z-index: 1000; left: 74px; top: 74px; display: flex; flex-wrap: wrap; gap: 7px; max-width: min(820px, calc(100% - 90px));
}
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink);
  font-size: 12.5px; font-weight: 500; cursor: pointer; box-shadow: 0 1px 5px rgba(11,29,25,.08); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); font-weight: 600; }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; }

/* ---- pins ----------------------------------------------------------------- */
.pin {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px 6px 7px; border-radius: 18px;
  background: #fff; color: var(--ink); border: 1.5px solid var(--line); box-shadow: 0 3px 11px rgba(11,29,25,.22);
  font: 600 12.5px 'IBM Plex Sans', system-ui, sans-serif; white-space: nowrap; cursor: pointer; transform: translate(-50%, -100%);
}
.pin .glyph {
  display: inline-flex; align-items: center; justify-content: center; width: 19px; height: 19px; border-radius: 50%;
  color: #fff; font: 700 9.5px 'IBM Plex Mono', monospace;
}
.pin--DOMESTIC .glyph { background: var(--teal); }     .pin--DOMESTIC { border-color: #CFDCD7; }
.pin--COMMERCIAL .glyph { background: var(--ochre); }  .pin--COMMERCIAL { border-color: #E6D2B6; }
.pin--INDUSTRIAL .glyph { background: var(--slate); }  .pin--INDUSTRIAL { border-color: #C9D6E2; }
.pin--selected { background: var(--ink); color: #fff; border-color: #fff; box-shadow: 0 0 0 7px rgba(11,29,25,.16), 0 6px 18px rgba(11,29,25,.3); }
.pin--selected .glyph { background: var(--teal-bright); color: var(--ink); }
.cluster {
  display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%;
  background: rgba(14,110,94,.94); color: #fff; font: 600 14px 'IBM Plex Sans', system-ui, sans-serif;
  box-shadow: 0 0 0 7px rgba(14,110,94,.15); cursor: pointer; transform: translate(-50%, -50%);
}
.leaflet-marker-icon.pin, .leaflet-marker-icon.cluster { width: auto !important; height: auto !important; }

/* ---- hint & panel --------------------------------------------------------- */
.hint {
  position: fixed; z-index: 1000; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 9px 16px; border-radius: 22px; background: rgba(11,29,25,.9); color: var(--paper); font-size: 12.5px; box-shadow: 0 4px 16px rgba(11,29,25,.28);
}
.panel {
  position: fixed; z-index: 1100; right: 16px; top: 16px; bottom: 16px; width: min(436px, calc(100% - 32px));
  display: flex; flex-direction: column; border-radius: 15px; background: #fff; box-shadow: var(--shadow-lg); overflow: hidden;
}
.panel__hero { position: relative; height: 200px; flex-shrink: 0; background: #E3F0EC; }
.panel__hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.panel__badges { position: absolute; left: 14px; top: 13px; display: flex; gap: 6px; }
.badge { font-size: 10px; font-weight: 600; letter-spacing: .05em; padding: 4px 9px; border-radius: 5px; }
.badge--teal { background: var(--teal); color: #fff; }
.badge--white { background: rgba(255,255,255,.94); color: var(--ink); }
.panel__close {
  position: absolute; right: 13px; top: 13px; width: 32px; height: 32px; border: 0; border-radius: 9px; cursor: pointer;
  background: rgba(255,255,255,.94); box-shadow: 0 2px 8px rgba(11,29,25,.16); display: grid; place-items: center;
}
.panel__body { display: flex; flex-direction: column; gap: 14px; padding: 16px 18px; overflow: auto; }
.price { display: flex; align-items: baseline; gap: 6px; }
.price strong { font-size: 25px; font-weight: 600; letter-spacing: -.03em; }
.price span, .sub { font-size: 12.5px; color: var(--muted); }
.panel h2 { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 9px; }
.fact { display: flex; flex-direction: column; gap: 2px; padding: 9px 11px; border-radius: 9px; background: var(--paper); }
.fact small { font-size: 10px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.fact span { font-size: 13px; font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.tag { font-size: 11px; font-weight: 500; padding: 4px 9px; border-radius: 6px; border: 1px solid #E1E9E5; color: #40514C; }
.gate {
  display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 9px; background: var(--paper); border: 1px dashed #CFDCD7;
  font-size: 11.5px; color: var(--muted);
}
.actions { display: flex; gap: 9px; margin-top: auto; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 46px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 13.5px; font-weight: 600; cursor: pointer;
}
.btn--primary { flex: 1; background: var(--teal); border-color: var(--teal); color: #fff; }
.toast {
  position: fixed; z-index: 1200; left: 50%; bottom: 26px; transform: translateX(-50%);
  padding: 10px 16px; border-radius: 10px; background: #8F2A22; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg);
}

@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; }
  .count { display: none; }
  .chips { left: 16px; top: 132px; }
  .panel { left: 16px; top: auto; height: 70vh; width: auto; }
}
