/* Toronto storefront study — shared design system.
   One stylesheet for all five steps. Light/dark, no external fonts. */

:root {
  color-scheme: light;
  --page:        #f7f6f3;
  --surface:     #ffffff;
  --surface-2:   #f1efea;
  --ink:         #16150f;
  --ink-2:       #55534a;
  --ink-3:       #8a877c;
  --line:        #e3e0d7;
  --line-strong: #c9c5b8;
  --accent:      #1f6feb;
  --accent-soft: rgba(31, 111, 235, 0.10);
  --good:        #17803d;
  --good-soft:   rgba(23, 128, 61, 0.10);
  --warn:        #a86a00;
  --warn-soft:   rgba(168, 106, 0, 0.11);
  --bad:         #c02b2b;
  --bad-soft:    rgba(192, 43, 43, 0.10);
  --shadow:      0 1px 2px rgba(0,0,0,.05), 0 6px 20px rgba(0,0,0,.05);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page:        #100f0d;
    --surface:     #1a1917;
    --surface-2:   #23221f;
    --ink:         #f5f3ee;
    --ink-2:       #b8b4a8;
    --ink-3:       #837f74;
    --line:        #2e2c28;
    --line-strong: #45423c;
    --accent:      #5b9dff;
    --accent-soft: rgba(91, 157, 255, 0.14);
    --good:        #4ac877;
    --good-soft:   rgba(74, 200, 119, 0.13);
    --warn:        #e0a53f;
    --warn-soft:   rgba(224, 165, 63, 0.14);
    --bad:         #ff7a7a;
    --bad-soft:    rgba(255, 122, 122, 0.13);
    --shadow:      0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page:        #100f0d;
  --surface:     #1a1917;
  --surface-2:   #23221f;
  --ink:         #f5f3ee;
  --ink-2:       #b8b4a8;
  --ink-3:       #837f74;
  --line:        #2e2c28;
  --line-strong: #45423c;
  --accent:      #5b9dff;
  --accent-soft: rgba(91, 157, 255, 0.14);
  --good:        #4ac877;
  --good-soft:   rgba(74, 200, 119, 0.13);
  --warn:        #e0a53f;
  --warn-soft:   rgba(224, 165, 63, 0.14);
  --bad:         #ff7a7a;
  --bad-soft:    rgba(255, 122, 122, 0.13);
  --shadow:      0 1px 2px rgba(0,0,0,.4), 0 6px 20px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.25; margin: 0; font-weight: 640; letter-spacing: -0.011em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.2rem; }
h3 { font-size: 0.95rem; }
p  { margin: 0; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); }
.small { font-size: 0.82rem; }
.tiny  { font-size: 0.74rem; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 1480px; }
.wrap.narrow { max-width: 900px; }
.stack > * + * { margin-top: var(--gap, 14px); }

/* ---------- top bar + stepper ---------- */
.topbar {
  position: sticky; top: 0; z-index: 500;
  background: color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  min-height: 54px; flex-wrap: wrap;
}
.brand {
  font-weight: 680; font-size: 0.86rem; letter-spacing: -0.01em;
  text-decoration: none; color: var(--ink); white-space: nowrap;
}
.brand span { color: var(--ink-3); font-weight: 450; }

.stepper { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; flex: 1; }
.step-link {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 10px; border-radius: 7px;
  text-decoration: none; color: var(--ink-2);
  font-size: 0.82rem; white-space: nowrap;
}
.step-link:hover { background: var(--surface-2); color: var(--ink); }
.step-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ---------- selection chips ---------- */
.selections { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; align-self: center; }
.selections .sel-chip {
  display: inline-flex; align-items: center; gap: 6px;
  align-self: center; flex: 0 0 auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 999px;
  padding-top: 3px; padding-bottom: 3px; padding-left: 10px; padding-right: 5px;
  font-size: 0.76rem; line-height: 1.5; color: var(--ink-2); white-space: nowrap;
}
.sel-chip b { color: var(--ink); font-weight: 600; }
.sel-chip .x {
  border: 0; background: var(--surface-2); color: var(--ink-3);
  width: 17px; height: 17px; border-radius: 50%; cursor: pointer;
  font-size: 0.72rem; line-height: 1; padding: 0;
}
.sel-chip .x:hover { background: var(--bad-soft); color: var(--bad); }
.selections .sel-chip.empty { border-style: dashed; color: var(--ink-3); padding-right: 10px; }

/* ---------- situation bar ---------- */
.situation { border-bottom: 1px solid var(--line); background: var(--surface); }
.situation-inner { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; padding: 12px 0; }
.field { display: flex; flex-direction: column; gap: 3px; }
.field label {
  font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
}
.field input, .field select {
  font-family: var(--mono); font-size: 0.88rem;
  padding: 7px 9px; border-radius: 7px; width: 122px;
  border: 1px solid var(--line-strong); background: var(--page); color: var(--ink);
}
.field input:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field.wide input, .field.wide select { width: 190px; }
.field-note { font-size: 0.7rem; color: var(--ink-3); }

.check-field {
  justify-content: flex-end;
  min-width: 0;
}
.check-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 16px;
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--ink-2);
  user-select: none;
}
.check-label input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  padding: 0;
  border-radius: 3px;
  accent-color: var(--accent);
  cursor: pointer;
}

.rev-field { min-width: 240px; flex: 1 1 240px; }
.rev-range-label {
  font-weight: 500;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink-2);
  margin-left: 6px;
}
.rev-slider {
  --rev-h: 24px;
  --rev-thumb: 14px;
  --rev-track: 4px;
  position: relative;
  height: var(--rev-h);
  margin-top: 4px;
  overflow: visible;
}
.rev-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: var(--rev-track);
  transform: translateY(-50%);
  border-radius: 99px;
  background: var(--line);
  pointer-events: none;
  z-index: 0;
}
.rev-track > i {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
}
.rev-slider input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  margin: 0;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
  outline: none !important;
  pointer-events: none;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  z-index: 1;
}
.rev-slider input[type="range"]:nth-of-type(1) { z-index: 2; }
.rev-slider input[type="range"]:nth-of-type(2) { z-index: 3; }
.rev-slider input[type="range"]:focus {
  outline: none !important;
  z-index: 4;
}
/* Full-height track so the thumb centers on the painted mid-line. */
.rev-slider input[type="range"]::-webkit-slider-runnable-track {
  height: var(--rev-h);
  background: transparent;
  border: none;
}
.rev-slider input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  pointer-events: auto;
  box-sizing: border-box;
  width: var(--rev-thumb);
  height: var(--rev-thumb);
  margin-top: calc((var(--rev-h) - var(--rev-thumb)) / 2);
  border-radius: 50%;
  border: 2px solid var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: pointer;
}
.rev-slider input[type="range"]:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.rev-slider input[type="range"]::-moz-range-track {
  height: var(--rev-track);
  background: transparent;
  border: none;
}
.rev-slider input[type="range"]::-moz-range-thumb {
  pointer-events: auto;
  box-sizing: border-box;
  width: var(--rev-thumb);
  height: var(--rev-thumb);
  border: 2px solid var(--accent);
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 30%, transparent);
  cursor: pointer;
}
.rev-slider input[type="range"]:focus::-moz-range-thumb {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}

/* ---------- generic surfaces ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: 18px;
}
.card.flush { padding: 0; overflow: hidden; }
.note {
  border-radius: 10px; padding: 12px 14px; font-size: 0.83rem; line-height: 1.55;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
}
.note.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.note.good { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.note.bad  { background: var(--bad-soft);  border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.note b { color: var(--ink); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.note li + li { margin-top: 3px; }

.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.section-head h2 { flex: none; }
.section-head .hint { font-size: 0.8rem; color: var(--ink-3); }
.eyebrow {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.09em;
  font-weight: 700; color: var(--ink-3);
}

/* ---------- chips / toggles ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  font-size: 0.79rem; padding: 5px 11px; border-radius: 999px; cursor: pointer;
  background: var(--surface); color: var(--ink-2);
  border: 1px solid var(--line-strong); user-select: none; white-space: nowrap;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }

.segmented {
  display: inline-flex; padding: 3px; gap: 3px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--line);
}
.segmented button {
  border: 0; background: transparent; cursor: pointer; color: var(--ink-2);
  font-size: 0.79rem; padding: 5px 12px; border-radius: 6px; font-family: inherit;
}
.segmented button[aria-pressed="true"] {
  background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow);
}

.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.85rem; font-family: inherit; padding: 8px 15px;
  border-radius: 8px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--ink-2); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ---------- tables ---------- */
.table-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
table.data { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.data th, table.data td { padding: 8px 12px; text-align: left; white-space: nowrap; }
table.data thead th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--ink-3);
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700;
  border-bottom: 1px solid var(--line-strong);
}
table.data thead th.sortable { cursor: pointer; user-select: none; }
table.data thead th.sortable:hover { color: var(--ink); }
table.data thead th .arrow { opacity: .35; margin-left: 3px; }
table.data thead th[aria-sort] .arrow { opacity: 1; color: var(--accent); }
table.data tbody tr { border-top: 1px solid var(--line); }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.picked { background: var(--accent-soft); }
table.data td.r, table.data th.r { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
table.data td.name { white-space: normal; min-width: 210px; font-weight: 550; }
table.data .sub { display: block; font-size: 0.72rem; color: var(--ink-3); font-weight: 400; }
.sticky-head { max-height: 66vh; overflow-y: auto; }

/* ---------- stat tiles ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.tile .k {
  font-size: 0.67rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--ink-3); font-weight: 600;
}
.tile .v { font-size: 1.3rem; font-weight: 640; font-family: var(--mono); margin-top: 3px; letter-spacing: -0.02em; }
.tile .sub { font-size: 0.74rem; color: var(--ink-3); margin-top: 2px; }
.tile.good .v { color: var(--good); }
.tile.warn .v { color: var(--warn); }
.tile.bad  .v { color: var(--bad); }

/* ---------- verdict ---------- */
.verdict { display: flex; gap: 14px; align-items: flex-start; border-radius: 12px; padding: 15px 17px; border: 1px solid; }
.verdict .badge {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.07em;
  padding: 4px 10px; border-radius: 6px; white-space: nowrap;
}
.verdict.pass    { background: var(--good-soft); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.verdict.pass .badge    { background: var(--good); color: #fff; }
.verdict.caution { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.verdict.caution .badge { background: var(--warn); color: #fff; }
.verdict.fail    { background: var(--bad-soft);  border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.verdict.fail .badge    { background: var(--bad); color: #fff; }
.verdict.info    { background: var(--surface-2); border-color: var(--line); }
.verdict.info .badge    { background: var(--ink-3); color: var(--page); }
.verdict .body { font-size: 0.87rem; line-height: 1.5; }

.pill {
  display: inline-block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em;
  padding: 2px 7px; border-radius: 5px; text-transform: uppercase;
}
.pill.pass    { background: var(--good-soft); color: var(--good); }
.pill.ok      { background: var(--good-soft); color: var(--good); }
.pill.caution { background: var(--warn-soft); color: var(--warn); }
.pill.fail    { background: var(--bad-soft);  color: var(--bad); }
.pill.none    { background: var(--surface-2); color: var(--ink-3); }

/* ---------- bar (in-table proportion) ---------- */
.bar { position: relative; height: 5px; border-radius: 3px; background: var(--surface-2); min-width: 54px; margin-top: 4px; }
.bar > i { position: absolute; inset: 0 auto 0 0; border-radius: 3px; background: var(--accent); }
.bar > i.good { background: var(--good); }
.bar > i.warn { background: var(--warn); }
.bar > i.bad  { background: var(--bad); }

/* ---------- layout helpers ---------- */
.split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 16px; align-items: start; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
main { padding: 22px 0 80px; }
#honesty {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
  padding-bottom: 8px;
}

/* ---------- storefront explorer (home) ---------- */
.storefront-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.95fr);
  gap: 14px;
  align-items: start;
  min-height: 70vh;
}
.map-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.map-pane #map {
  height: min(52vh, 560px);
  min-height: 360px;
  border-radius: 12px;
}
.side-pane {
  display: flex;
  flex-direction: column;
  min-height: 0;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
}
/* Must beat .card.flush { overflow: hidden } so tall profiles scroll instead of clipping. */
.card.flush.insight-panel,
.insight-panel {
  flex: 1 1 auto;
  overflow: auto;
  max-height: calc(100vh - 24px);
  scrollbar-gutter: stable;
}
.insight-head { padding: 14px 16px 0; }
.insight-head h2 { font-size: 1.15rem; margin-top: 4px; }
.insight-body { padding: 4px 16px 28px; }
.insight-section {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.insight-section:first-child { border-top: 0; padding-top: 8px; }
.insight-section .eyebrow { margin-bottom: 8px; }
.profile-facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin: 0;
}
.profile-facts dt {
  margin: 0;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-3);
  font-weight: 600;
}
.profile-facts dd {
  margin: 2px 0 0;
  font-size: 0.84rem;
  font-variant-numeric: tabular-nums;
}
.profile-facts dd .sub {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 400;
}
.season-bars {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  align-items: end;
  height: 44px;
  margin: 8px 0 4px;
}
.season-bars span {
  display: block;
  border-radius: 3px 3px 1px 1px;
  background: color-mix(in srgb, var(--accent) 55%, var(--line));
  min-height: 4px;
}
.season-bars span.trough { background: var(--warn); }
.season-bars span.peak { background: var(--good); }
.season-labs {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3px;
  font-size: 0.58rem;
  color: var(--ink-3);
  text-align: center;
}
.list-pane {
  min-height: 220px;
  max-height: 340px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.list-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.shop-list {
  overflow-y: auto; flex: 1;
  padding-bottom: 12px;
  scrollbar-gutter: stable;
}
.shop-row {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 10px; align-items: center;
  width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line);
  background: transparent; color: inherit; font: inherit; cursor: pointer;
  padding: 10px 14px;
}
.shop-row:last-child { border-bottom: 0; margin-bottom: 4px; }
.shop-row:hover { background: var(--surface-2); }
.shop-row.picked { background: var(--accent-soft); }
.shop-dot { width: 9px; height: 9px; border-radius: 50%; }
.shop-dot.lease { border-radius: 2px; background: #c62828 !important; }
.shop-main { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.shop-name { font-weight: 600; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-meta { font-size: 0.72rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-net { font-size: 0.78rem; font-weight: 600; white-space: nowrap; }
.shop-net .k {
  display: block; font-size: 0.62rem; font-weight: 500; color: var(--ink-3);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.shop-net.good { color: var(--good); }
.shop-net.bad { color: var(--bad); }
.confidence-why {
  font-size: 0.78rem; color: var(--ink-2); margin: 0 0 12px;
  line-height: 1.45;
}
.band-sub.wide-warn { color: var(--warn); }

/* ---------- distribution charts ---------- */
.dist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.dist-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 12px 10px;
}
.dist-title {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}
.dist-bars { display: flex; flex-direction: column; gap: 5px; }
.dist-row {
  display: grid;
  grid-template-columns: minmax(72px, 0.9fr) 1fr 42px;
  gap: 8px;
  align-items: center;
}
.dist-lab {
  font-size: 0.72rem;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dist-track {
  height: 8px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}
.dist-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
}
.dist-fill.hist { background: color-mix(in srgb, var(--accent) 75%, var(--good)); }
.dist-n {
  font-size: 0.72rem;
  font-family: var(--mono);
  color: var(--ink-3);
  text-align: right;
}
.dot-swatch {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin: 0 4px 0 10px; vertical-align: middle;
}
.dot-swatch.mls { background: #1f6feb; margin-left: 0; }
.dot-swatch.osm { background: #7c3aed; }
.dot-swatch.vacant { background: #a86a00; }
.dot-swatch.none { background: #b0aaa0; margin-left: 0; }
.dot-swatch.lease {
  background: #c62828;
  border-radius: 2px;
}
.leaflet-marker-icon.lease-pin {
  background: #ff4d4d !important;
  border: 1.5px solid #f6f1e8 !important;
  border-radius: 2px !important;
  box-sizing: border-box;
}
.leaflet-marker-icon.lease-pin.is-selected {
  border: 2.5px solid #f6f1e8 !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.85);
}
.rev-legend {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 8px;
  vertical-align: middle;
}
.rev-ramp {
  display: inline-block;
  width: 72px;
  height: 8px;
  border-radius: 99px;
  background: linear-gradient(90deg, #c02b2b 0%, #e0a53f 35%, #4ab46e 70%, #17803d 100%);
  vertical-align: middle;
}
.cost-stack {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  margin: 0 0 8px;
}
.cost-stack th,
.cost-stack td {
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.cost-stack th.num,
.cost-stack td.num { text-align: right; font-variant-numeric: tabular-nums; }
.cost-stack th {
  color: var(--ink-3);
  font-weight: 500;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cost-stack tr.good td.num { color: var(--ok, #17803d); }
.cost-stack tr.bad td.num { color: var(--bad, #c02b2b); }
.cost-stack tr:last-child td { border-bottom: 0; font-weight: 600; }

.btn.small { padding: 6px 11px; font-size: 0.78rem; }
.loading { padding: 40px; text-align: center; color: var(--ink-3); font-size: 0.86rem; }
.empty { padding: 28px; text-align: center; color: var(--ink-3); font-size: 0.86rem; }

.page-head { margin-bottom: 18px; }
.page-head .lede { color: var(--ink-2); font-size: 0.95rem; margin-top: 6px; max-width: 76ch; }
.tour-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 0; }
.tour {
  display: inline-block;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--ink-2);
  text-decoration: none;
  background: var(--surface);
}
.tour:hover { border-color: var(--accent); color: var(--accent); }

.next-bar {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); flex-wrap: wrap;
}

/* ---------- map ---------- */
#map { height: 560px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); }
.leaflet-container { font: inherit; background: var(--surface-2) !important; }
.legend { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 0.72rem; color: var(--ink-3); }
.legend .sw { width: 30px; height: 11px; display: block; }
.legend .sw:first-of-type { border-radius: 3px 0 0 3px; }
.legend .sw:last-of-type { border-radius: 0 3px 3px 0; }
.fsa-label { font-weight: 700; font-family: var(--mono); }

@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .storefront-split { grid-template-columns: 1fr; min-height: 0; }
  .map-pane #map { height: 320px; min-height: 260px; }
  .side-pane { position: static; max-height: none; }
  .insight-panel { max-height: none; }
  .list-pane { max-height: 420px; }
  .profile-facts { grid-template-columns: 1fr 1fr; }
  #map { height: 400px; }
  .topbar-inner { min-height: 0; padding: 8px 0; }
}

/* ---------- explorer (shareable map home) ---------- */
body.explorer {
  --sans: "Figtree", system-ui, -apple-system, sans-serif;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --page: #0b0a09;
  --surface: rgba(18, 16, 14, 0.78);
  --surface-2: rgba(32, 28, 24, 0.88);
  --ink: #f6f1e8;
  --ink-2: #c9c0b2;
  --ink-3: #8d8578;
  --line: rgba(255, 244, 220, 0.10);
  --line-strong: rgba(255, 244, 220, 0.18);
  --accent: #e8b86d;
  --accent-soft: rgba(232, 184, 109, 0.16);
  --good: #7dcca0;
  --good-soft: rgba(125, 204, 160, 0.14);
  --warn: #e0a53f;
  --warn-soft: rgba(224, 165, 63, 0.14);
  --bad: #ff8a7a;
  --bad-soft: rgba(255, 138, 122, 0.14);
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  background: #0b0a09;
  overflow: hidden;
  height: 100dvh;
  font-family: var(--sans);
}
body.explorer .topbar {
  position: absolute;
  inset: 0 0 auto;
  height: 56px;
  background: linear-gradient(180deg, rgba(11, 10, 9, 0.72), transparent);
  border-bottom: 0;
  backdrop-filter: none;
}
body.explorer .topbar .wrap {
  max-width: none;
  padding: 0 18px;
}
body.explorer .topbar-inner {
  min-height: 56px;
  padding: 0;
}
body.explorer .brand span { display: none; }
body.explorer .stepper { opacity: 0.5; }
body.explorer .stepper:hover, body.explorer .stepper:focus-within { opacity: 1; }
body.explorer .step-link { color: rgba(246, 241, 232, 0.62); }
body.explorer .step-link[aria-current="page"] {
  background: rgba(232, 184, 109, 0.16);
  color: var(--accent);
}
body.explorer main { display: none; }

.explorer-stage {
  position: relative;
  height: 100dvh;
  overflow: hidden;
}
body.explorer #map {
  position: absolute;
  inset: 0;
  height: 100% !important;
  min-height: 0;
  border: 0;
  border-radius: 0;
  z-index: 0;
}
body.explorer .leaflet-control-attribution {
  background: rgba(11, 10, 9, 0.55) !important;
  color: #8d8578 !important;
  font-size: 0.62rem;
}
body.explorer .leaflet-bar a {
  background: rgba(18, 16, 14, 0.86);
  color: #f6f1e8;
  border-bottom-color: rgba(255, 244, 220, 0.12);
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.explorer-wash {
  pointer-events: none;
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(90% 55% at 8% 0%, rgba(11, 10, 9, 0.62), transparent 52%),
    linear-gradient(180deg, rgba(11, 10, 9, 0.28) 0%, transparent 18%);
}

.explorer-hud {
  position: absolute;
  z-index: 400;
  top: 72px;
  left: 18px;
  width: min(520px, calc(100vw - 36px));
  display: flex;
  flex-direction: column;
  gap: 14px;
  pointer-events: none;
  overflow: visible;
}
.explorer-hud > * { pointer-events: auto; }
.hud-intro { overflow: visible; }
.hud-intro h1 {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.85rem, 3.6vw, 3.15rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
  padding-top: 0.12em;
  max-width: 14ch;
  overflow: visible;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}
.hud-intro .lede {
  margin-top: 8px;
  color: var(--ink-2);
  font-size: 0.95rem;
  max-width: 38ch;
  text-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
body.explorer.has-shop .hud-intro h1,
body.explorer.has-street .hud-intro h1 { font-size: clamp(1.45rem, 2.4vw, 2.1rem); }

.destinations {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.destinations::-webkit-scrollbar { display: none; }
.dest {
  position: relative;
  flex: 0 0 auto;
  width: 168px;
  height: 108px;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: #fff;
  border: 1px solid rgba(255, 244, 220, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  background-size: cover;
  background-position: center;
}
.dest::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 20%, rgba(8, 6, 4, 0.82));
}
.dest-all {
  background-image: linear-gradient(165deg, #1c1814 0%, #3d3428 55%, #8a7350 100%);
}
.dest-kensington { background-image: url("backdrops/kensington.jpg"); }
.dest-queen { background-image: url("backdrops/queen-west.jpg"); }
.dest-ossington { background-image: url("backdrops/ossington.jpg"); }
.dest-little-italy { background-image: url("backdrops/little-italy.jpg"); }
.dest-chinatown { background-image: url("backdrops/chinatown.jpg"); }
.dest-annex { background-image: url("backdrops/annex.jpg"); }
.dest-yorkville { background-image: url("backdrops/yorkville.jpg"); }
.dest-leslieville { background-image: url("backdrops/leslieville.jpg"); }
.dest-king { background-image: url("backdrops/king-west.jpg"); }
.dest-koreatown { background-image: linear-gradient(160deg, #3a1c18, #c45a2a 70%); }
.dest-dundas { background-image: linear-gradient(160deg, #1a2430, #6b7c5a 75%); }
.dest-corktown { background-image: linear-gradient(160deg, #241810, #8a5a32 75%); }
.dest-name, .dest-sub {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 1;
}
.dest-name { bottom: 22px; font-weight: 700; font-size: 0.86rem; letter-spacing: -0.02em; }
.dest-sub { bottom: 8px; font-size: 0.64rem; color: rgba(255, 244, 220, 0.72); }
.dest:hover, .dest[aria-current="true"] {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.dest[aria-current="true"] { box-shadow: 0 0 0 1px var(--accent), 0 10px 28px rgba(0, 0, 0, 0.28); }

.hud-bar, .hud-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  padding: 8px;
  border-radius: 16px;
  background: rgba(16, 14, 12, 0.62);
  border: 1px solid rgba(255, 244, 220, 0.10);
  backdrop-filter: blur(16px) saturate(1.2);
}
.hud-more { padding-top: 4px; }
.hud-more[hidden] { display: none !important; }
body.explorer .hud-bar .field input,
body.explorer .hud-bar .field select,
body.explorer .hud-more .field input,
body.explorer .hud-more .field select {
  width: 100%;
  min-width: 0;
  background: rgba(8, 7, 6, 0.55);
  border-color: rgba(255, 244, 220, 0.16);
}
body.explorer .check-label { margin-top: 0; color: var(--ink-2); }
.hud-search { flex: 1 1 160px; }
.hud-bar .field.wide, .hud-more .field.wide { min-width: 120px; }
.explorer-footer {
  position: absolute;
  z-index: 400;
  left: 68px;
  right: 16px;
  bottom: 14px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}
body.explorer.has-shop .explorer-footer {
  right: calc(min(380px, 34vw) + 28px);
}
.explorer-footer > * { pointer-events: auto; }
.hud-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
  color: var(--ink-2);
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(16, 14, 12, 0.72);
  border: 1px solid rgba(255, 244, 220, 0.10);
  backdrop-filter: blur(14px);
}
.hud-meta #count b { color: var(--ink); }

.explorer-dock {
  position: absolute;
  z-index: 400;
  top: 70px;
  right: 16px;
  bottom: 16px;
  width: min(380px, 34vw);
  display: none;
  flex-direction: column;
  gap: 10px;
}
body.explorer.has-shop .explorer-dock {
  display: flex;
  bottom: auto;
  max-height: calc(100dvh - 88px);
}
body.explorer .explorer-list { display: none !important; }
body.explorer .explorer-sheet {
  flex: 1 1 auto;
  max-height: calc(100dvh - 88px);
  background: rgba(16, 14, 12, 0.78);
  border-color: rgba(255, 244, 220, 0.10);
  backdrop-filter: blur(18px) saturate(1.15);
  box-shadow: var(--shadow);
}
.insight-head { position: relative; padding-right: 44px; }
.sheet-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 244, 220, 0.08);
  color: var(--ink-2);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}
.sheet-close:hover { background: rgba(255, 244, 220, 0.16); color: var(--ink); }
.sheet-facts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0 0;
}
.sheet-fact .k {
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--ink-3);
}
.sheet-fact .v {
  font-size: 1.05rem;
  font-weight: 650;
  margin-top: 2px;
  letter-spacing: -0.02em;
}
.sheet-fact .v.bad { color: var(--bad); }
.sheet-fact .sub { font-size: 0.72rem; color: var(--ink-3); margin-top: 2px; }
.sheet-actions { margin-top: 14px; }
.sheet-more {
  margin: 4px 0 0;
  padding: 8px 0 4px;
  border-top: 1px solid var(--line);
}
.sheet-more summary {
  cursor: pointer;
  font-size: 0.78rem;
  color: var(--ink-3);
  list-style: none;
}
.sheet-more summary::-webkit-details-marker { display: none; }
.sheet-more[open] summary { margin-bottom: 10px; }
body.explorer .empty-explore {
  padding: 36px 28px;
  text-align: left;
}
body.explorer .empty-k {
  font-family: var(--display);
  font-size: 1.45rem;
  color: var(--ink);
  margin-bottom: 6px;
}
.takehome {
  margin: 14px 0 4px;
  padding: 12px 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(232, 184, 109, 0.14), rgba(232, 184, 109, 0.05));
  border: 1px solid rgba(232, 184, 109, 0.22);
}
.takehome-k {
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: var(--accent);
}
.takehome-v {
  font-family: var(--display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-top: 2px;
}
.takehome.bad .takehome-v { color: var(--bad); }
.takehome.good .takehome-v { color: var(--good); }
.takehome-sub { font-size: 0.76rem; color: var(--ink-3); margin-top: 4px; }

.explorer-about {
  position: relative;
  left: auto;
  bottom: auto;
  width: min(420px, 100%);
  color: var(--ink-2);
  flex: 0 1 auto;
}
.explorer-about summary {
  cursor: pointer;
  font-size: 0.74rem;
  color: var(--ink-3);
  list-style: none;
}
.explorer-about summary::-webkit-details-marker { display: none; }
.explorer-about[open] {
  max-height: min(46vh, 420px);
  overflow: auto;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(16, 14, 12, 0.88);
  border: 1px solid rgba(255, 244, 220, 0.10);
  backdrop-filter: blur(16px);
}
body.explorer #err {
  position: absolute;
  z-index: 500;
  top: 70px;
  left: 18px;
  width: min(480px, calc(100vw - 36px));
}

@media (max-width: 960px) {
  body.explorer { overflow: auto; height: auto; }
  .explorer-stage { height: 100dvh; min-height: 720px; }
  .explorer-hud {
    top: 72px;
    left: 12px;
    width: calc(100vw - 24px);
  }
  .dest { width: 148px; height: 92px; }
  .explorer-dock {
    top: auto;
    right: 12px;
    left: 12px;
    bottom: 12px;
    width: auto;
    max-height: 52vh;
  }
  .explorer-footer {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  body.explorer.has-shop .explorer-footer { display: none; }
  .explorer-about { display: none; }
  body.explorer.has-shop .hud-intro,
  body.explorer.has-street .destinations { display: none; }
}
