/* ── Local market tabs (detail page: Sold / Rent / Mortgage) ──
   Marks use brand pine + ink only: verdict colours stay reserved for the
   fair-price signal. */

.hs-market-tabs {
  display: flex;
  gap: 4px;
  box-shadow: inset 0 -1px 0 var(--line);
  margin-bottom: 20px;
  overflow-x: auto;
  overflow-y: hidden;
}
.hs-market-tab {
  flex-shrink: 0;
  padding: 10px 14px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font-family: 'Hanken Grotesk', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: var(--slate);
  cursor: pointer;
}
.hs-market-tab:hover { color: var(--ink); }
.hs-market-tab.active { color: var(--action); border-bottom-color: var(--action); }
.hs-market-tab:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.hs-market-panel:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }

.hs-market-intro { font-size: 14px; color: var(--slate); margin-bottom: 14px; }
.hs-market-subhead { font-size: 16px; margin: 28px 0 12px; }

/* ── Shared-axis strip chart ── */
.hs-mkt {
  --mkt-cols: 108px minmax(0, 1fr) 84px 128px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px 18px 12px;
  margin-bottom: 12px;
}

.hs-mkt-head,
.hs-mkt-row,
.hs-mkt-axis {
  display: grid;
  grid-template-columns: var(--mkt-cols);
  column-gap: 16px;
  align-items: center;
}

.hs-mkt-head {
  padding: 10px 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slate);
}
.hs-mkt-col-num { text-align: right; }

.hs-mkt-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}
.hs-mkt-key span { display: inline-flex; align-items: center; gap: 6px; }
.hs-mkt-key i { display: inline-block; flex-shrink: 0; }
.hs-mkt-key-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); opacity: .7; }
.hs-mkt-key-band { width: 16px; height: 10px; border-radius: 2px; background: rgba(23, 58, 47, .12); }
.hs-mkt-key-median { width: 2px; height: 12px; background: var(--ink); }
.hs-mkt-key-marker { width: 9px; height: 9px; border: 2px solid var(--ink); background: var(--surface); transform: rotate(45deg); }

.hs-mkt-row {
  min-height: 52px;
  border-top: 1px solid var(--line);
}
.hs-mkt-row.is-own {
  margin: 0 -18px;
  padding: 0 18px;
  background: var(--paper);
}
.hs-mkt-row.is-empty { min-height: 40px; }

.hs-mkt-label { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.hs-mkt-own {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 500;
  color: var(--slate);
  white-space: nowrap;
}
.hs-mkt-own::before { content: '● '; color: var(--ink); font-size: 8px; vertical-align: 1px; }

.hs-mkt-strip { position: relative; height: 40px; }
/* Inset so dots and ticks at either end of the axis aren't clipped */
.hs-mkt-track,
.hs-mkt-axis-track { position: absolute; top: 0; bottom: 0; left: 6px; right: 6px; }

.hs-mkt-grid { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--line); }
.hs-mkt-band {
  position: absolute;
  top: 6px;
  bottom: 6px;
  border-radius: 3px;
  background: rgba(23, 58, 47, .12);
}
.hs-mkt-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  margin: -4px 0 0 -4px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .7;
  box-shadow: 0 0 0 1.5px var(--surface);
}
.hs-mkt-dot:hover { opacity: 1; }
.hs-mkt-median {
  position: absolute;
  top: 2px;
  bottom: 2px;
  width: 2px;
  margin-left: -1px;
  background: var(--ink);
}
.hs-mkt-marker {
  position: absolute;
  top: 50%;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border: 2px solid var(--ink);
  background: var(--surface);
  transform: rotate(45deg);
}

.hs-mkt-median-val { text-align: right; font-size: 15px; font-weight: 600; color: var(--ink); }
.hs-mkt-m-lbl { display: none; }
.hs-mkt-range { text-align: right; line-height: 1.3; }
.hs-mkt-range .num { display: block; font-size: 13px; color: var(--ink); }
.hs-mkt-range small { font-size: 11px; color: var(--slate); }

.hs-mkt-empty { grid-column: 2 / -1; font-size: 13px; color: var(--slate); }

.hs-mkt-axis { border-top: 1px solid var(--line); padding-top: 6px; }
.hs-mkt-axis-track { position: relative; grid-column: 2; height: 16px; left: auto; right: auto; margin: 0 6px; }
.hs-mkt-axis-track span {
  position: absolute;
  transform: translateX(-50%);
  font-size: 11px;
  color: var(--slate);
  white-space: nowrap;
}

/* Mobile: label + median on one line, strip full width beneath */
@media (max-width: 575px) {
  .hs-mkt { padding: 4px 14px 10px; }
  .hs-mkt-head { grid-template-columns: 1fr; }
  .hs-mkt-head .hs-mkt-col-label,
  .hs-mkt-head .hs-mkt-col-num { display: none; }
  .hs-mkt-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "label median" "strip strip" "range range";
    row-gap: 4px;
    padding: 10px 0;
  }
  .hs-mkt-row.is-own { margin: 0 -14px; padding: 10px 14px; }
  .hs-mkt-row.is-empty { grid-template-areas: "label empty"; }
  .hs-mkt-label { grid-area: label; }
  .hs-mkt-strip { grid-area: strip; }
  .hs-mkt-median-val { grid-area: median; }
  .hs-mkt-m-lbl { display: inline; font-family: 'Hanken Grotesk', sans-serif; font-size: 11px; font-weight: 400; color: var(--slate); }
  .hs-mkt-range { grid-area: range; text-align: left; }
  .hs-mkt-range .num { display: inline; margin-right: 6px; }
  .hs-mkt-empty { grid-area: empty; grid-column: auto; text-align: right; }
  .hs-mkt-axis { grid-template-columns: 1fr; }
  .hs-mkt-axis-track { grid-column: 1; }
}
