/* market-report.css — Neighbourhood Market Report v2 */
/* Loaded after index.html styles; overrides where needed. All new classes use mr- prefix. */

/* ── Topbar overrides ─────────────────────────────────────────────────────── */
#mr-name   { font-size: 20px !important; font-weight: 700; font-family: "Manrope", sans-serif; }
#mr-sector { font-size: 14px !important; color: #64748b; font-family: "Manrope", sans-serif; }

/* ── Tab strip — lighter, horizontally scrollable on mobile ──────────────── */
.mr-tabs {
  overflow-x: auto;
  flex-wrap: nowrap !important;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 14px;
  gap: 6px;
}
.mr-tabs::-webkit-scrollbar { display: none; }
.mr-tab {
  background: transparent !important;
  border-color: #e5e7eb !important;
  color: #64748b !important;
  font-weight: 600 !important;
  opacity: 0.75;
  flex-shrink: 0;
}
.mr-tab.active {
  background: var(--gc-green) !important;
  color: #fff !important;
  border-color: var(--gc-green) !important;
  opacity: 1;
}

/* ── Mr-body spacing ─────────────────────────────────────────────────────── */
.mr-body { gap: 0 !important; padding: 0 !important; }

/* ── Period label ────────────────────────────────────────────────────────── */
.mr-period {
  font-size: 11px;
  color: #9ca3af;
  text-align: center;
  font-family: "Manrope", sans-serif;
  padding: 10px 14px 0;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* M1 — Verdict                                                               */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m1 {
  background: #f7faf8;
  padding: 24px 20px 20px;
  border-bottom: 1px solid #e5e7eb;
}
.mr-m1-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}
.mr-m1-logo {
  height: 20px;
  width: auto;
  opacity: 0.65;
  flex-shrink: 0;
  margin-top: 4px;
}
.mr-condition-pill {
  display: inline-block;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 18px;
  border-radius: 24px;
  letter-spacing: 0.01em;
  box-shadow: 0 2px 10px rgba(0, 71, 62, 0.18);
}
.mr-pill-strong-sellers { background: #125740; color: #fff; }
.mr-pill-sellers        { background: #00473e; color: #fff; }
.mr-pill-balanced       { background: #0f766e; color: #fff; }
.mr-pill-buyers         { background: #d97706; color: #fff; box-shadow: 0 2px 10px rgba(217,119,6,0.22); }
.mr-pill-strong-buyers  { background: #b45309; color: #fff; box-shadow: 0 2px 10px rgba(180,83,9,0.22); }

.mr-summary-text {
  font-family: "Georgia", "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 400;
  line-height: 1.6;
  color: #1a2e28;
  margin: 0 0 10px;
}
.mr-tempo-note {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* M2 — Hero Tiles                                                            */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m2 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding: 14px 14px 16px;
  background: #fff;
}
.mr-m2-header {
  grid-column: 1 / -1;
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  padding-bottom: 4px;
}
.mr-hero-tile {
  background: #fff;
  border-radius: 12px;
  padding: 14px 8px 12px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}
.mr-hero-label {
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 6px;
  line-height: 1.3;
}
.mr-hero-value {
  font-family: "Manrope", sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  line-height: 1.1;
}
.mr-hero-badge {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  min-height: 16px;
  margin-top: 3px;
}
.mr-hero-sub {
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  color: #9ca3af;
  margin-top: 5px;
  line-height: 1.3;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* M3 — Trends                                                                */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m3 {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 20px 14px;
  border-top: 1px solid #e5e7eb;
}

/* Temperature gauge */
.mr-temp-gauge-section {}
.mr-gauge-subtext {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  color: #9ca3af;
  margin: 3px 0 10px;
  line-height: 1.4;
}
.mr-gauge-wrap { margin-top: 0; }
.mr-gauge-track {
  position: relative;
  height: 20px;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
}
.mr-gauge-zone {
  height: 100%;
  flex-shrink: 0;
}
.mr-gauge-needle-wrap {
  position: relative;
  height: 22px;
  margin-top: 0;
}
.mr-gauge-needle {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.mr-gauge-needle-line {
  width: 3px;
  height: 22px;
  background: #111827;
  border-radius: 0 0 2px 2px;
}
.mr-gauge-needle-line-dist {
  width: 2px;
  height: 16px;
  background: repeating-linear-gradient(
    to bottom,
    #64748b 0px, #64748b 3px,
    transparent 3px, transparent 5px
  );
}
.mr-gauge-needle-line-city {
  width: 2px;
  height: 16px;
  background: repeating-linear-gradient(
    to bottom,
    #94a3b8 0px, #94a3b8 3px,
    transparent 3px, transparent 5px
  );
}

/* Score legend row — no overlap possible */
.mr-gauge-scores {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  color: #374151;
}
.mr-gauge-score-nhood,
.mr-gauge-score-dist,
.mr-gauge-score-city {
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.mr-gauge-score-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  background: #111827;
  border-radius: 2px;
  flex-shrink: 0;
}
.mr-gauge-score-bar-dist {
  background: #64748b;
  width: 2px;
}
.mr-gauge-score-bar-city {
  background: #94a3b8;
  width: 2px;
}
.mr-gauge-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-family: "Manrope", sans-serif;
  font-size: 9px;
  color: #9ca3af;
}
.mr-gauge-legend {
  display: flex;
  gap: 16px;
  margin-top: 8px;
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 600;
}
.mr-gauge-leg::before { content: '●  '; font-size: 8px; }
.mr-gauge-leg-buyer    { color: #1E88E5; }
.mr-gauge-leg-balanced { color: #9ca3af; }
.mr-gauge-leg-seller   { color: #B71C1C; }

.mr-chart-price-wrap { height: 240px; }
.mr-section-label {
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* M4 — Supporting context                                                    */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m4 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 0 14px 20px;
  border-top: 1px solid #e5e7eb;
  padding-top: 16px;
}
.mr-support-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 10px 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
}
.mr-support-card .mr-section-label { margin-bottom: 8px; }
.mr-support-chart-wrap { height: 140px; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* M5 — Takeaway                                                              */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m5 {
  background: #f7faf8;
  padding: 40px 24px 36px;
  border-top: 1px solid #e5e7eb;
  border-bottom: 1px solid #e5e7eb;
}
.mr-takeaway-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}
.mr-takeaway-heading {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 8px;
}
.mr-takeaway-text {
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  color: #1a2e28;
  line-height: 1.65;
  margin: 0;
}
.mr-ctas {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.mr-cta-btn {
  flex: 1;
  font-family: "Manrope", sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding: 16px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 71, 62, 0.10);
  transition: opacity 0.15s, transform 0.1s;
  line-height: 1.2;
}
.mr-cta-btn:hover  { opacity: 0.88; }
.mr-cta-btn:active { transform: scale(0.98); }
.mr-cta-valuation  { background: #00473e; color: #fff; }
.mr-cta-buyer-call { background: #125740; color: #fff; }

.mr-updates-link {
  text-align: center;
  font-family: "Manrope", sans-serif;
  font-size: 13px;
}
.mr-updates-link a {
  color: #00473e;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 71, 62, 0.25);
  padding-bottom: 1px;
}
.mr-updates-link a:hover { border-bottom-color: #00473e; }

/* ══════════════════════════════════════════════════════════════════════════ */
/* M6 — Fine print                                                            */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-m6 {
  display: flex;
  flex-direction: column;
  padding: 4px 14px 8px;
}
.mr-details {
  border-bottom: 1px solid #f3f4f6;
}
.mr-details summary {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  padding: 10px 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.mr-details summary::-webkit-details-marker { display: none; }
.mr-details summary::before {
  content: '▸';
  font-size: 10px;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.mr-details[open] summary::before { transform: rotate(90deg); }
.mr-details-body {
  padding: 0 0 14px;
  /* strip interior backgrounds since they're now inside a fine-print section */
}
.mr-details-body #mr-creb-commentary,
.mr-details-body #mr-forecast,
.mr-details-body #mr-nhood-vs-city {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}

.mr-modal-footer {
  padding: 18px 0 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mr-footer-brand {
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  color: #9ca3af;
}
.mr-footer-brand a { color: #9ca3af; text-decoration: none; }
.mr-footer-brand a:hover { color: #64748b; }
.mr-footer-cta {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  color: #64748b;
  line-height: 1.5;
}
.mr-footer-cta a { color: #00473e; font-weight: 600; text-decoration: none; }
.mr-footer-cta a:hover { text-decoration: underline; }

/* ── Change badges (existing classes kept) ───────────────────────────────── */
.mr-chg-pos { color: #16a34a; font-weight: 700; }
.mr-chg-neg { color: #dc2626; font-weight: 700; }

/* ── No-data + loading states ────────────────────────────────────────────── */
#mr-no-data, .mr-loading {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
  font-size: 13px;
  font-family: "Manrope", sans-serif;
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* Mobile — 480px and below                                                   */
/* ══════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  #mr-name { font-size: 16px !important; }

  .mr-m1 { padding: 18px 14px 16px; }
  .mr-summary-text { font-size: 14px; }

  .mr-m2 {
    grid-template-columns: repeat(2, 1fr);
    padding: 12px 10px;
    gap: 6px;
  }
  .mr-hero-value { font-size: 18px; }

  .mr-m3 { padding: 16px 10px; }
  .mr-chart-price-wrap { height: 210px; }

  .mr-m4 {
    grid-template-columns: 1fr;
    padding: 12px 10px 16px;
    gap: 8px;
  }
  .mr-support-chart-wrap { height: 140px; }

  .mr-m5 { padding: 28px 16px 24px; }
  .mr-takeaway-blocks { grid-template-columns: 1fr; gap: 16px; }
  .mr-ctas { flex-direction: column; }
  .mr-cta-btn { width: 100%; }

  .mr-m6 { padding: 4px 10px 8px; }
}

/* ══════════════════════════════════════════════════════════════════════════ */
/* M6 — CREB commentary styles                                                 */
/* ══════════════════════════════════════════════════════════════════════════ */
.mr-commentary-label {
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #64748b;
  margin-bottom: 6px;
}
.mr-commentary-text {
  font-family: "Georgia", serif;
  font-size: 13px;
  line-height: 1.65;
  color: #1f2937;
  margin: 0 0 6px;
}
.mr-commentary-source {
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  color: #9ca3af;
  margin-bottom: 10px;
}

/* ── 12-month history accordion ─────────────────────────────────────────── */
.mr-hist-details {
  border-top: 1px solid #e5e7eb;
  margin-top: 4px;
}
.mr-hist-summary-toggle {
  font-family: "Manrope", sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  padding: 10px 0 8px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.mr-hist-summary-toggle::-webkit-details-marker { display: none; }
.mr-hist-summary-toggle::before {
  content: '▸';
  font-size: 10px;
  color: #9ca3af;
  transition: transform 0.15s;
  flex-shrink: 0;
}
.mr-hist-details[open] .mr-hist-summary-toggle::before { transform: rotate(90deg); }
.mr-hist-toggle-hint {
  font-weight: 400;
  color: #9ca3af;
  margin-left: 2px;
}
.mr-hist-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 520px;
  overflow-y: auto;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  margin-bottom: 10px;
}
.mr-hist-row {
  padding: 12px 14px 10px;
  border-bottom: 1px solid #f3f4f6;
}
.mr-hist-row:last-child { border-bottom: none; }
.mr-hist-period {
  font-family: "Manrope", sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 2px;
}
.mr-hist-headline {
  font-family: "Manrope", sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  margin-bottom: 4px;
  font-style: italic;
}
.mr-hist-summary {
  font-family: "Georgia", serif;
  font-size: 12px;
  line-height: 1.6;
  color: #374151;
  margin-bottom: 6px;
}
.mr-hist-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-family: "Manrope", sans-serif;
  font-size: 11px;
  color: #6b7280;
}
.mr-hist-stats strong { color: #111827; font-weight: 600; }
.mr-hist-stats em { font-style: normal; font-size: 10px; }
.mr-hist-pos { color: #16a34a; }
.mr-hist-neg { color: #dc2626; }
