/* ==============================================================
   McCann + Co — Evaluation Dashboard (client-facing report)
   Extends css/styles.css tokens. Light-only: this is a print-
   friendly deliverable, matching the Seller Intelligence report.
   Chart series: active #005daa · sold #c0392b (CVD-validated,
   ΔE 19.9 protan). Pinned to js/charts.js `const C` — keep in step.
   ============================================================== */

:root {
  --cat-active: #005daa;
  --cat-sold: #c0392b;
  --chart-h: 240px;
}

body.report { background: var(--page); }

.sample-banner {
  display: block;
  text-align: center;
  background: var(--accent);
  color: #fff;
  font-size: .82rem;
  font-weight: 600;
  padding: 10px var(--pad);
  text-decoration: none;
}
.sample-banner:hover { text-decoration: underline; }

.rpt-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px var(--pad);
  border-bottom: 1px solid var(--grid);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 40;
}
.rpt-top .btn { padding: 10px 20px; font-size: .85rem; }

.rpt { max-width: 1160px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--pad) 60px; }

/* header */
.rpt-head__eyebrow { font-size: .78rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.rpt-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.7rem); }
.rpt-head .sub { color: var(--ink-2); margin-top: 6px; font-size: .95rem; }
.facts {
  display: flex; flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}
.fact {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: 999px;
  font-size: .8rem;
  color: var(--ink-2);
  padding: 7px 14px;
}
.fact b { color: var(--ink); font-weight: 600; }
.fact--cap { text-transform: capitalize; }

/* sections */
.rpt section { padding: 0; margin-top: clamp(28px, 4vw, 44px); }
.rpt .sechead h2 { font-size: clamp(1.25rem, 2.4vw, 1.7rem); }
.rpt .sechead p { margin-top: 6px; font-size: .88rem; }
.sechead__lede--nowrap { white-space: nowrap; }
.rpt .sechead p.sechead__lede--wide { max-width: 700px; }
@media (max-width: 760px) {
  .sechead__lede--nowrap { white-space: normal; }
}

/* ---------- hero: positioning band + stat tiles ---------- */

.band-card {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 36px);
}
.band-card .lbl { font-size: .78rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.band-nums {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 10px 0 6px;
}
.band-nums .mid {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  font-weight: 500;
  letter-spacing: -.03em;
  color: var(--accent);
}
.band-nums .lohi { font-size: .95rem; color: var(--ink-2); }
.band-note { font-size: .78rem; color: var(--ink-3); max-width: 745px; margin: 14px auto 0; text-align: center; }

.band-viz { margin-top: 20px; }
.band-viz svg { width: 100%; height: auto; display: block; }

.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 14px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.tile .lbl { font-size: .68rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.tile b {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2.2vw, 1.65rem);
  font-weight: 500;
  margin-top: 6px;
}
.tile .sub { font-size: .72rem; color: var(--ink-3); margin-top: 3px; }

/* ---------- pricing strategies ---------- */

.strats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 20px; }
.strat {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 22px;
  position: relative;
}
.strat--hot { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.strat .k { font-size: .72rem; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.strat--hot .k { color: var(--accent); }
.strat b {
  display: block;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 500;
  margin: 8px 0 8px;
}
.strat p { font-size: .82rem; color: var(--ink-2); }
.strat__cta { display: inline-block; margin-top: 10px; font-size: .82rem; font-weight: 600; color: var(--accent); text-decoration: underline; }
.strat .pick {
  position: absolute; top: 14px; right: 16px;
  background: var(--accent); color: #fff;
  font-size: .64rem; font-weight: 600; letter-spacing: .05em;
  border-radius: 999px; padding: 3px 10px;
}

/* ---------- charts ---------- */

.charts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 20px; }
.chart-card {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 20px 20px 12px;
  min-width: 0;
}
.chart-card.wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .charts { grid-template-columns: 1fr; } }
.chart-card h3 { font-size: .98rem; margin-bottom: 2px; }
.chart-card .sub { font-size: .78rem; color: var(--ink-3); margin-bottom: 12px; }
.chart-card svg { width: 100%; height: auto; display: block; }

.legend { display: flex; gap: 16px; font-size: .75rem; color: var(--ink-2); margin: 8px 0 2px; flex-wrap: wrap; }
.legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* data table behind each chart (accessibility / print) */
details.tbl { margin-top: 8px; border-top: 1px solid var(--surface-2); }
details.tbl summary {
  font-size: .72rem; color: var(--ink-3);
  padding: 8px 0; cursor: pointer; list-style: none;
}
details.tbl summary::before { content: "▸ "; }
details.tbl[open] summary::before { content: "▾ "; }
details.tbl table { width: 100%; border-collapse: collapse; font-size: .76rem; margin-bottom: 8px; }
details.tbl th, details.tbl td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--surface-2); }
details.tbl th { color: var(--ink-3); font-weight: 600; }
details.tbl td.num, details.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* shared tooltip */
#tip {
  position: fixed;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  font-size: .74rem;
  line-height: 1.45;
  border-radius: 8px;
  padding: 8px 11px;
  z-index: 90;
  opacity: 0;
  transition: opacity .08s;
  max-width: 260px;
}
#tip b { font-weight: 600; }
#tip.on { opacity: 1; }

/* ---------- map ---------- */

#map {
  height: 420px;
  border-radius: var(--radius);
  border: 1px solid var(--grid);
  margin-top: 20px;
  z-index: 1;
}
.map-legend { margin-top: 10px; }

/* ---------- comp tables ---------- */

.comp-card {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
  overflow-x: auto;
}
.comp-card h3 { font-size: 1rem; margin-bottom: 12px; }
.comp-tbl { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 640px; }
.comp-tbl th, .comp-tbl td { padding: 9px 10px; border-bottom: 1px solid var(--surface-2); text-align: left; white-space: nowrap; }
.comp-tbl th { font-size: .68rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--accent); }
.comp-tbl td.num, .comp-tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.comp-tbl td.pos-cell { text-align: center; }
.comp-tbl tr:last-child td { border-bottom: 0; }
.comp-card .crit {
  font-size: .74rem;
  color: var(--ink-3);
  margin: -4px 0 14px;
}
.comp-card .crit span { color: var(--ink-2); font-weight: 500; }

tr.row-hidden { display: none; }

.more-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  background: var(--surface-2);
  border: 1px solid var(--grid);
  border-radius: 999px;
  padding: 11px 18px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
}
.more-btn:hover { background: var(--accent-soft); border-color: var(--accent); }

.pos { font-size: .7rem; font-weight: 600; border-radius: 999px; padding: 3px 9px; }
.pos--above { background: #fdeaea; color: #a32c2c; }
.pos--market { background: var(--surface-2); color: var(--ink-2); }
.pos--below { background: #e6f2e9; color: #1c7c43; }

/* ---------- neighbourhood intelligence ---------- */

.cards2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;   /* the shorter card shouldn't stretch to match */
}
@media (max-width: 760px) { .cards2 { grid-template-columns: 1fr; } }

.tiles--tight { margin-top: 0; margin-bottom: 16px; }
.tiles--tight .tile { padding: 12px 14px; }
.tiles--tight .tile b { font-size: 1.25rem; }

.plainlist { list-style: none; }
.plainlist li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--surface-2);
  font-size: .87rem;
}
.plainlist li:last-child { border-bottom: 0; }
.plainlist .nm { font-weight: 500; }
.plainlist .meta { color: var(--ink-3); font-size: .78rem; }
.plainlist .dist { color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }

.tree-note {
  font-size: .82rem;
  color: var(--ink-2);
  border-top: 1px solid var(--surface-2);
  padding-top: 14px;
  margin-top: 4px;
}
.tree-note b { color: var(--ink); }

/* ---------- workings + CTA + footer ---------- */

.workings {
  background: var(--surface);
  border: 1px solid var(--grid);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 20px;
  font-size: .84rem;
  color: var(--ink-2);
}
.workings h3 { font-size: .95rem; color: var(--ink); margin-bottom: 10px; }
.workings li { margin: 6px 0 6px 18px; }

.cta-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  background: var(--accent);
  color: #fff;
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-top: 28px;
}
.cta-banner-text { font-size: .95rem; max-width: 58ch; }
.cta-banner-btn {
  background: #fff;
  color: var(--accent);
  font-weight: 600;
  font-size: .9rem;
  border-radius: 999px;
  padding: 12px 24px;
  white-space: nowrap;
}

.rpt-foot { font-size: .74rem; color: var(--ink-3); margin-top: 28px; }
.rpt-foot p + p { margin-top: 6px; }

/* ---------- print ---------- */

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rpt-top { position: static; }
  .rpt-top .btn, .cta-banner, .sample-banner { display: none; }
  .chart-card, .tile, .band-card, .comp-card, .strat { break-inside: avoid; border-color: #ccc; }
  #map { display: none; }
  details.tbl { display: none; }
  /* A printed report is the seller's record — it carries every comp. */
  tr.row-hidden { display: table-row; }
  .more-btn { display: none; }
  body { background: #fff; }
}
