/* ============================================
   REAL ESTATE PILLAR v7.6 — Styles
   Elite Research Engine + Landing Redesign
   ============================================ */

/* ─── Industry Tiles (Landing Hero) ─────────────── */
.re-industry-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-bottom: 32px;
}
@media (max-width: 900px) { .re-industry-grid { grid-template-columns: 1fr; } }
.re-industry-tile {
  border-radius: 14px; overflow: hidden; cursor: pointer;
  background: var(--bg-surface); transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.re-industry-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
}
.re-industry-img {
  height: 180px; background-size: cover; background-position: center;
  position: relative;
}
.re-industry-img::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 60%;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
}
.re-industry-content { padding: 18px 20px; }
.re-industry-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--accent-gold); margin-bottom: 4px;
}
.re-industry-label.hot { color: var(--accent-red, #ef4444); }
.re-industry-label.blue { color: var(--accent-blue, #3b82f6); }
.re-industry-title {
  font-size: var(--text-md); font-weight: 700; color: var(--text-primary);
  margin-bottom: 8px; line-height: 1.35;
}
.re-industry-desc {
  font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5;
}

/* ─── Showcase Row (Examples + Deal Preview) ────── */
.re-showcase-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  margin-bottom: 36px;
}
@media (max-width: 800px) { .re-showcase-row { grid-template-columns: 1fr; } }
.re-showcase-section { display: flex; flex-direction: column; }
.re-example-card {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  border-radius: 12px; cursor: pointer; transition: background 0.15s;
}
.re-example-card:hover { background: var(--bg-surface-2); }
.re-example-icon { font-size: 22px; width: 36px; text-align: center; flex-shrink: 0; }
.re-example-body { flex: 1; min-width: 0; }
.re-example-label {
  font-size: var(--text-sm); font-weight: 600; color: var(--text-primary);
}
.re-example-desc {
  font-size: 11px; color: var(--text-muted); margin-top: 1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Deal Analyzer Preview */
.re-deal-preview {
  background: var(--bg-surface); border-radius: 14px; padding: 24px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.re-deal-preview:hover {
  transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}
.re-deal-preview-header {
  font-size: var(--text-md); font-weight: 700; color: var(--text-primary); margin-bottom: 6px;
}
.re-deal-preview-desc {
  font-size: var(--text-xs); color: var(--text-secondary); line-height: 1.5; margin-bottom: 16px;
}
.re-deal-preview-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px;
}
.re-deal-metric { text-align: center; }
.re-deal-metric-val {
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
}
.re-deal-metric-val.grade { font-size: 26px; }
.re-deal-metric-label {
  font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 2px;
}
.re-deal-preview-cta {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px; border-radius: 8px; background: var(--accent-gold); color: #000;
  font-size: var(--text-xs); font-weight: 700; transition: opacity 0.15s;
}
.re-deal-preview-cta:hover { opacity: 0.9; }

/* CookinCapital CTA */
.re-cookin-cta {
  display: flex; align-items: center; gap: 16px; padding: 18px 22px;
  border-radius: 12px; background: rgba(212,160,23,0.06); margin-top: 14px;
}
.re-cookin-logo { font-size: 28px; }
.re-cookin-body { flex: 1; }
.re-cookin-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-primary);
}
.re-cookin-desc {
  font-size: 11px; color: var(--text-secondary); margin-top: 2px;
}
.re-cookin-btn {
  padding: 8px 18px; border-radius: 8px; background: var(--accent-gold); color: #000;
  font-size: var(--text-xs); font-weight: 700; text-decoration: none;
  white-space: nowrap; transition: opacity 0.15s;
}
.re-cookin-btn:hover { opacity: 0.9; }

/* ─── Hero (legacy compat) ──────────────────────── */
.re-hero { padding: var(--space-6) 0; }
.re-hero-content { display: flex; align-items: center; gap: var(--space-5); }
.re-hero-title { font-size: var(--text-2xl); font-weight: 800; color: var(--text-primary); letter-spacing: -0.02em; }
.re-hero-subtitle { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-1); max-width: 560px; }

/* Tabs */
.re-tabs {
  display: flex; gap: var(--space-2); margin-bottom: var(--space-5);
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px;
}
.re-tabs::-webkit-scrollbar { display: none; }
.re-tab-btn {
  display: flex; align-items: center; gap: 8px; padding: 12px 20px;
  background: var(--bg-surface-2); color: var(--text-secondary);
  font-size: var(--text-xs); font-weight: 600; border: none; border-radius: 10px;
  cursor: pointer; white-space: nowrap; transition: all 0.15s ease;
}
.re-tab-btn:hover { background: var(--bg-surface-3); color: var(--text-primary); }
.re-tab-btn.active { background: var(--accent-gold); color: #000; }
.re-tab-btn.active svg { stroke: #000; }

/* Tab Panels */
.re-tab-panel { display: none; }
.re-tab-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* Search */
.re-search-bar { margin-bottom: var(--space-6); }
.re-search-input-wrap {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--bg-surface-2); border-radius: 12px;
  padding: 6px 8px 6px 14px; border: 1px solid var(--border-color); transition: border-color 0.15s;
}
.re-search-input-wrap:focus-within { border-color: var(--accent-gold); }
.re-search-input {
  flex: 1; background: none; border: none; color: var(--text-primary);
  font-size: var(--text-sm); outline: none; padding: 8px 0;
}
.re-search-btn {
  background: var(--accent-gold); color: #000; border: none; padding: 8px 20px;
  border-radius: 8px; font-weight: 700; font-size: var(--text-sm);
  cursor: pointer; white-space: nowrap; transition: opacity 0.15s;
}
.re-search-btn:hover { opacity: 0.9; }

.re-filters { display: flex; gap: var(--space-2); margin-top: var(--space-2); flex-wrap: wrap; }
.re-filter-select, .re-filter-input {
  background: var(--bg-surface-2); border: 1px solid var(--border-color);
  color: var(--text-secondary); border-radius: 8px; padding: 6px 12px;
  font-size: var(--text-xs); cursor: pointer; outline: none;
}
.re-filter-input { width: 100px; }
.re-filter-select:focus, .re-filter-input:focus { border-color: var(--accent-gold); }

/* Results Grid */
.re-results-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--space-3); font-size: var(--text-sm); color: var(--text-muted);
}
.re-property-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--space-5);
}
.re-property-card {
  background: var(--bg-surface-2); border-radius: 12px; overflow: hidden;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
}
.re-property-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }
.re-property-img {
  height: 180px; background-size: cover; background-position: center;
  background-color: var(--bg-surface-3); position: relative;
  display: flex; align-items: center; justify-content: center;
}
.re-no-img { background: var(--bg-surface-3); }
.re-property-status {
  position: absolute; top: 10px; left: 10px; background: rgba(0,0,0,0.7);
  color: var(--accent-green); font-size: 10px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px; text-transform: uppercase; letter-spacing: 0.05em;
}
.re-property-status.rental { color: var(--accent-blue); }
.re-property-body { padding: var(--space-4); }
.re-property-price { font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); }
.re-property-price.rental { color: var(--accent-blue); }
.re-property-addr { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 2px; }
.re-property-location { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }
.re-property-meta {
  display: flex; gap: var(--space-3); margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--text-muted);
}
.re-property-meta span { display: flex; align-items: center; gap: 4px; }

/* Card inline actions */
.re-card-actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); }

/* ═══ COMPARABLES PANEL ═══ */
.re-comps-header { margin-bottom: var(--space-4); }
.re-comps-address {
  font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); margin-bottom: var(--space-2);
}
.re-comps-actions-bar { display: flex; gap: var(--space-2); }
.re-val-rent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin-bottom: var(--space-6); }
.re-val-card {
  background: var(--bg-surface-2); border-radius: 14px; padding: var(--space-5);
}
.re-val-card-title {
  font-size: var(--text-xs); font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-2);
}
.re-val-main-value { font-size: var(--text-2xl); font-weight: 900; color: var(--accent-gold); }
.re-val-main-value.rent { color: var(--accent-green); }
.re-val-main-value span { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); }
.re-val-range { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.re-val-ppsf { font-size: var(--text-sm); color: var(--text-secondary); margin-top: 4px; font-weight: 600; }
.re-val-detail { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }
.re-val-empty { font-size: var(--text-sm); color: var(--text-muted); padding: var(--space-4) 0; }

/* 1% Rule badge */
.re-val-rule {
  display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3);
  padding: 8px 12px; border-radius: 8px; font-size: var(--text-xs);
}
.re-val-rule.pass { background: rgba(34,197,94,0.1); }
.re-val-rule.fail { background: rgba(239,68,68,0.1); }
.re-val-rule-label { color: var(--text-secondary); font-weight: 600; }
.re-val-rule-value { color: var(--text-primary); font-weight: 800; font-size: var(--text-sm); }
.re-val-rule-badge {
  margin-left: auto; padding: 2px 8px; border-radius: 4px;
  font-weight: 800; font-size: 10px; letter-spacing: 0.05em;
}
.re-val-rule.pass .re-val-rule-badge { background: var(--accent-green); color: #000; }
.re-val-rule.fail .re-val-rule-badge { background: var(--accent-red); color: #fff; }

/* Comparable cards */
.re-comps-section { margin-bottom: var(--space-5); }
.re-comps-section-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-secondary);
  margin-bottom: var(--space-3); text-transform: uppercase; letter-spacing: 0.04em;
}
.re-comps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-4); }
.re-comp-card {
  background: var(--bg-surface-2); border-radius: 12px; padding: var(--space-4);
  transition: transform 0.15s;
}
.re-comp-card:hover { transform: translateY(-1px); }
.re-comp-label {
  font-size: 10px; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px;
}
.re-comp-price { font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); }
.re-comp-addr { font-size: var(--text-xs); color: var(--text-secondary); margin-top: 4px; }
.re-comp-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: 6px;
  font-size: var(--text-xs); color: var(--text-muted);
}
.re-comp-detail {
  display: flex; gap: var(--space-2); margin-top: 4px;
  font-size: 10px; color: var(--text-faint);
}

/* ═══ DISTRESSED DEALS ═══ */
.re-distressed-controls { margin-bottom: var(--space-4); }
.re-distressed-chips { display: flex; gap: var(--space-2); margin-bottom: var(--space-3); flex-wrap: wrap; }
.re-distressed-chip {
  padding: 10px 20px; background: var(--bg-surface-2); border: 1px solid var(--border-color);
  color: var(--text-secondary); border-radius: 20px; font-size: var(--text-xs); font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.re-distressed-chip:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.re-distressed-chip.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }

.re-distressed-filters { display: flex; gap: var(--space-2); align-items: center; }

.re-distressed-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4); margin-bottom: var(--space-5);
}
.re-stat-card { background: var(--bg-surface-2); border-radius: 12px; padding: var(--space-4); text-align: center; }
.re-stat-value { font-size: var(--text-xl); font-weight: 800; }
.re-stat-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

.re-distressed-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: var(--space-5); }

.re-distressed-card {
  background: var(--bg-surface-2); border-radius: 12px; overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.re-distressed-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

/* Distressed image */
.re-distressed-img {
  height: 160px; background-size: cover; background-position: center;
  position: relative; display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px;
}

/* Type row (no image fallback) */
.re-distressed-type-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px var(--space-3) 0;
}

/* Type badge */
.re-distressed-type-badge {
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 4px 10px; border-radius: 4px;
}
.re-distressed-type-badge.foreclosure { background: rgba(239,68,68,0.85); color: #fff; }
.re-distressed-type-badge.pre_foreclosure { background: rgba(245,158,11,0.85); color: #000; }
.re-distressed-type-badge.tax_lien { background: rgba(139,92,246,0.85); color: #fff; }
.re-distressed-type-badge.nod { background: rgba(59,130,246,0.85); color: #fff; }

.re-distressed-status-badge {
  font-size: 10px; font-weight: 700; padding: 4px 10px; border-radius: 4px;
  background: rgba(0,0,0,0.7); color: var(--accent-green);
}

.re-distressed-body { padding: var(--space-4) var(--space-5); }
.re-distressed-price { font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); }

/* KPI rows */
.re-distressed-kpi {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: var(--text-xs);
}
.re-kpi-label { color: var(--text-muted); }
.re-kpi-value { color: var(--text-primary); font-weight: 700; }
.re-kpi-value.red { color: var(--accent-red); }
.re-distressed-kpi.good .re-kpi-value { color: var(--accent-green); }
.re-distressed-kpi.warn .re-kpi-value { color: var(--accent-amber); }

.re-distressed-discount {
  font-size: var(--text-xs); color: var(--accent-green); font-weight: 700; margin-top: 2px;
}

.re-distressed-addr { font-size: var(--text-sm); color: var(--text-secondary); margin-top: var(--space-2); }
.re-distressed-location { font-size: var(--text-xs); color: var(--text-muted); }

.re-distressed-specs {
  display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2);
  font-size: var(--text-xs); color: var(--text-muted);
}
.re-distressed-specs span {
  background: var(--bg-surface-3); padding: 2px 8px; border-radius: 4px;
}

.re-distressed-actions {
  display: flex; gap: var(--space-2); padding: var(--space-2) var(--space-5) var(--space-4);
}

/* Buttons */
.re-btn-sm {
  padding: 6px 14px; background: var(--accent-gold); color: #000;
  border: none; border-radius: 6px; font-size: var(--text-xs); font-weight: 700;
  cursor: pointer; transition: opacity 0.15s; white-space: nowrap;
}
.re-btn-sm:hover { opacity: 0.9; }
.re-btn-sm.accent-green { background: var(--accent-green); }
.re-btn-sm.outline {
  background: transparent; color: var(--text-secondary); border: 1px solid var(--border-color);
}
.re-btn-sm.outline:hover { border-color: var(--accent-gold); color: var(--text-primary); }

/* ═══ DEAL CALCULATOR ═══ */
.calc-form {
  background: var(--bg-surface-2); border-radius: 14px; padding: var(--space-6);
}
.calc-form-title { font-size: var(--text-lg); font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.calc-form-subtitle { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); }
.calc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); }
.calc-field { display: flex; flex-direction: column; gap: 4px; }
.calc-field.full { grid-column: 1 / -1; }
.calc-field label { font-size: var(--text-xs); font-weight: 600; color: var(--text-secondary); }
.calc-field input {
  background: var(--bg-surface-3); border: 1px solid var(--border-color);
  color: var(--text-primary); border-radius: 8px; padding: 8px 12px;
  font-size: var(--text-sm); outline: none; transition: border-color 0.15s;
}
.calc-field input:focus { border-color: var(--accent-gold); }
.calc-field input::placeholder { color: var(--text-faint); }

.calc-analyze-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; margin-top: var(--space-4); padding: 12px;
  background: var(--accent-gold); color: #000; border: none; border-radius: 10px;
  font-size: var(--text-sm); font-weight: 800; cursor: pointer; transition: opacity 0.15s;
}
.calc-analyze-btn:hover { opacity: 0.9; }

/* Calculator Results */
.calc-results { margin-top: var(--space-4); animation: fadeIn 0.3s ease; }
.calc-results-header { display: flex; align-items: center; gap: var(--space-4); margin-bottom: var(--space-4); }
.calc-grade {
  width: 64px; height: 64px; display: flex; align-items: center; justify-content: center;
  font-size: var(--text-2xl); font-weight: 900; border-radius: 14px; flex-shrink: 0;
}
.calc-verdict-wrap { flex: 1; }
.calc-verdict { font-size: var(--text-lg); font-weight: 700; color: var(--text-primary); }

/* Deal badges */
.calc-badges { display: flex; gap: var(--space-2); margin-top: var(--space-1); flex-wrap: wrap; }
.calc-badge {
  padding: 3px 10px; border-radius: 4px; font-size: 10px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
}
.calc-badge.pass { background: rgba(34,197,94,0.15); color: var(--accent-green); }
.calc-badge.fail { background: rgba(239,68,68,0.15); color: var(--accent-red); }

.calc-metrics {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-3); margin-bottom: var(--space-4);
}
.calc-metric { background: var(--bg-surface-2); border-radius: 10px; padding: var(--space-3); text-align: center; }
.calc-metric.positive .calc-metric-value { color: var(--accent-green); }
.calc-metric.negative .calc-metric-value { color: var(--accent-red); }
.calc-metric-value { font-size: var(--text-lg); font-weight: 800; }
.calc-metric-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 4px; }

.calc-section-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-secondary);
  margin-bottom: var(--space-2); margin-top: var(--space-2);
}
.calc-expenses { background: var(--bg-surface-2); border-radius: 10px; padding: var(--space-3); margin-bottom: var(--space-3); }
.calc-expense-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: var(--text-sm); color: var(--text-secondary); border-bottom: 1px solid var(--border-color);
}
.calc-expense-row:last-child { border-bottom: none; }
.calc-expense-row.total {
  font-weight: 700; color: var(--text-primary);
  border-top: 2px solid var(--border-color); margin-top: var(--space-1); padding-top: var(--space-2);
}
.calc-expense-row.income { color: var(--accent-green); font-weight: 600; }
.calc-expense-row.profit { color: var(--accent-green); font-weight: 800; font-size: var(--text-base); }
.calc-expense-row.loss { color: var(--accent-red); font-weight: 800; font-size: var(--text-base); }

/* ═══ MARKET DATA ═══ */
.re-market-search {
  display: flex; gap: var(--space-2); margin-bottom: var(--space-4); align-items: center;
}
.re-market-input {
  flex: 1; background: var(--bg-surface-2); border: 1px solid var(--border-color);
  color: var(--text-primary); border-radius: 8px; padding: 8px 14px;
  font-size: var(--text-sm); outline: none;
}
.re-market-input:focus { border-color: var(--accent-gold); }
.re-market-input::placeholder { color: var(--text-faint); }

.re-market-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-4); margin-bottom: var(--space-5);
}
.re-market-card { background: var(--bg-surface-2); border-radius: 12px; padding: var(--space-4); }
.re-market-card-label { font-size: var(--text-xs); color: var(--text-muted); font-weight: 600; }
.re-market-card-value { font-size: var(--text-xl); font-weight: 800; color: var(--text-primary); margin-top: 4px; }
.re-market-card-change { font-size: var(--text-xs); font-weight: 700; margin-top: 4px; }
.re-market-card-change.up { color: var(--accent-green); }
.re-market-card-change.down { color: var(--accent-red); }

.re-market-section-title {
  font-size: var(--text-sm); font-weight: 700; color: var(--text-secondary);
  margin: var(--space-4) 0 var(--space-2); text-transform: uppercase; letter-spacing: 0.05em;
}

/* Market history */
.re-market-history {
  background: var(--bg-surface-2); border-radius: 10px; padding: var(--space-3);
  max-height: 300px; overflow-y: auto; margin-bottom: var(--space-4);
}
.re-history-row {
  display: flex; justify-content: space-between; padding: 6px 0;
  font-size: var(--text-xs); color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}
.re-history-row:last-child { border-bottom: none; }
.re-history-date { color: var(--text-muted); }
.re-history-val { font-weight: 700; color: var(--text-primary); }
.re-history-val.rent { color: var(--accent-green); }

.re-market-total {
  font-size: var(--text-sm); color: var(--text-muted); margin-top: var(--space-3); text-align: center;
}
.re-market-total strong { color: var(--text-primary); }

.re-distressed-summary-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-4);
}
.re-summary-card {
  background: var(--bg-surface-2); border-radius: 12px; padding: var(--space-4);
  text-align: center; cursor: pointer; transition: transform 0.15s;
}
.re-summary-card:hover { transform: translateY(-2px); }
.re-summary-count { font-size: var(--text-xl); font-weight: 800; margin-top: 4px; }
.re-summary-label { font-size: var(--text-xs); color: var(--text-muted); margin-top: 2px; }

/* ═══ SHARED ═══ */
.re-loading {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-8); color: var(--text-muted); font-size: var(--text-sm);
}
.re-spinner {
  width: 24px; height: 24px; border: 2px solid var(--border-color);
  border-top-color: var(--accent-gold); border-radius: 50%; animation: spin 0.6s linear infinite;
}
.re-empty {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
  padding: var(--space-10); color: var(--text-muted); text-align: center; font-size: var(--text-sm);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 768px) {
  .re-hero-content { flex-direction: column; text-align: center; }
  .re-val-rent-grid { grid-template-columns: 1fr; }
  .re-distressed-stats { grid-template-columns: repeat(2, 1fr); }
  .re-market-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-metrics { grid-template-columns: repeat(2, 1fr); }
  .re-distressed-summary-grid { grid-template-columns: repeat(2, 1fr); }
  .re-property-grid { grid-template-columns: 1fr; }
  .re-comps-grid { grid-template-columns: 1fr; }
  .re-distressed-grid { grid-template-columns: 1fr; }
  .re-comps-actions-bar { flex-direction: column; }
  .re-distressed-filters { flex-wrap: wrap; }
}
@media (max-width: 480px) {
  .calc-grid { grid-template-columns: 1fr; }
  .re-distressed-stats { grid-template-columns: 1fr 1fr; }
  .calc-metrics { grid-template-columns: 1fr 1fr; }
}

/* ═══ v8.0 — New 4-Tab Components ═══════════════════════════════════ */

/* Hero */
.re-hero {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 24px; gap: 16px;
}
.re-hero-title { font-size: 22px; font-weight: 800; color: var(--text-primary); margin-bottom: 4px; }
.re-hero-sub { font-size: 13px; color: var(--text-secondary); max-width: 440px; }
.re-hero-stats { display: flex; gap: 20px; flex-shrink: 0; }
.re-hero-stat { text-align: center; }
.re-hero-stat-val { font-size: 20px; font-weight: 800; color: var(--accent-gold); }
.re-hero-stat-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }

/* Mode toggle (Sale / Distressed) */
.re-mode-bar {
  display: flex; gap: 8px; margin-bottom: 16px;
}
.re-mode-btn {
  padding: 8px 20px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-surface-2); color: var(--text-secondary);
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s;
}
.re-mode-btn:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.re-mode-btn.active { background: var(--accent-gold); color: #000; border-color: var(--accent-gold); }

/* Source badge */
.re-src-badge, .re-source-badge {
  display: inline-block; font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 2px 6px; border-radius: 4px;
  background: rgba(245,158,11,0.12); color: var(--accent-gold);
  margin-left: 6px; vertical-align: middle;
}

/* Back button */
.re-back-btn {
  background: none; border: 1px solid var(--border-color); color: var(--text-secondary);
  padding: 6px 14px; border-radius: 8px; font-size: 12px; cursor: pointer;
  margin-bottom: 16px; transition: all 0.15s;
}
.re-back-btn:hover { border-color: var(--accent-gold); color: var(--text-primary); }

/* Zillow second opinion */
.re-zillow-opinion {
  margin-top: 10px; padding: 8px 12px; border-radius: 8px;
  background: rgba(59,130,246,0.08); font-size: 12px; color: var(--text-secondary);
}

/* Portfolio */
.re-portfolio-header {
  font-size: 13px; color: var(--text-muted); margin-bottom: 16px;
}
.re-portfolio-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px;
}
.re-portfolio-card {
  background: var(--bg-surface); border-radius: 14px; padding: 16px;
  border: 1px solid var(--border-color); transition: border-color 0.15s;
}
.re-portfolio-card:hover { border-color: rgba(245,158,11,0.3); }
.re-portfolio-card-header {
  display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.re-btn-delete {
  background: none; border: none; color: var(--text-faint); font-size: 14px;
  cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: color 0.15s;
}
.re-btn-delete:hover { color: var(--accent-red, #ef4444); }
.re-portfolio-notes {
  font-size: 11px; color: var(--text-muted); font-style: italic;
  margin: 8px 0; padding: 8px; background: var(--bg-surface-2); border-radius: 6px;
}

/* Deal Analyzer */
.calc-save-btn {
  margin-top: 16px; width: 100%; padding: 12px; border: none; border-radius: 10px;
  background: rgba(245,158,11,0.12); color: var(--accent-gold);
  font-size: 13px; font-weight: 700; cursor: pointer; transition: background 0.15s;
}
.calc-save-btn:hover { background: rgba(245,158,11,0.2); }
.calc-verdict {
  text-align: center; padding: 20px; border-radius: 12px;
  border: 2px solid; margin-bottom: 20px;
}
.calc-verdict-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.calc-verdict-value { font-size: 28px; font-weight: 800; margin-top: 4px; }
.calc-metrics-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
.calc-metric-card {
  background: var(--bg-surface-2); border-radius: 10px; padding: 14px; text-align: center;
}
.calc-metric-val { font-size: 20px; font-weight: 800; }
.calc-metric-label { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 4px; }
.calc-breakdown {
  background: var(--bg-surface-2); border-radius: 12px; padding: 16px; margin-bottom: 16px;
}
.calc-breakdown-title { font-size: 12px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; }
.calc-breakdown-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 6px 0; font-size: 13px; border-bottom: 1px solid var(--border-color);
}
.calc-breakdown-row:last-child { border-bottom: none; }
.calc-breakdown-row.total { font-weight: 700; margin-top: 4px; }
.calc-breakdown-row .green { color: var(--accent-green); }
.calc-breakdown-row .red { color: var(--accent-red, #ef4444); }
.calc-summary-row { display: flex; gap: 12px; }
.calc-summary-item {
  flex: 1; background: var(--bg-surface-2); border-radius: 10px; padding: 12px;
  text-align: center; font-size: 11px; color: var(--text-muted);
}
.calc-summary-item strong { display: block; font-size: 14px; color: var(--text-primary); margin-top: 4px; }

/* Chat */
.re-chat-container {
  display: flex; flex-direction: column; height: 500px;
}
.re-chat-header { padding-bottom: 12px; border-bottom: 1px solid var(--border-color); margin-bottom: 12px; }
.re-chat-title { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.re-chat-subtitle { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.re-chat-suggestions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.re-chat-suggestion {
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border-color);
  background: var(--bg-surface-2); color: var(--text-secondary);
  font-size: 11px; cursor: pointer; transition: all 0.15s;
}
.re-chat-suggestion:hover { border-color: var(--accent-gold); color: var(--text-primary); }
.re-chat-messages {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px;
  padding: 4px 0; margin-bottom: 12px;
}
.re-chat-bubble {
  max-width: 82%; padding: 10px 14px; border-radius: 12px;
  font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
}
.re-chat-bubble.user {
  background: var(--accent-gold); color: #000; align-self: flex-end; border-radius: 12px 12px 2px 12px;
}
.re-chat-bubble.assistant {
  background: var(--bg-surface-2); color: var(--text-primary); align-self: flex-start; border-radius: 12px 12px 12px 2px;
}
.re-chat-bubble.loading { padding: 14px 20px; }
.re-spinner-sm {
  width: 16px; height: 16px; border: 2px solid var(--border-color);
  border-top-color: var(--accent-gold); border-radius: 50%; animation: spin 0.6s linear infinite;
}
.re-chat-input-bar {
  display: flex; gap: 8px; padding: 10px; border-radius: 12px;
  background: var(--bg-surface-2); border: 1px solid var(--border-color); transition: border-color 0.15s;
}
.re-chat-input-bar:focus-within { border-color: var(--accent-gold); }
.re-chat-input {
  flex: 1; background: none; border: none; color: var(--text-primary);
  font-size: 13px; outline: none;
}
.re-chat-send-btn {
  background: var(--accent-gold); color: #000; border: none;
  width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; cursor: pointer; flex-shrink: 0; transition: opacity 0.15s;
}
.re-chat-send-btn:hover { opacity: 0.85; }

/* Toast */
.re-toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--bg-surface); color: var(--text-primary); border: 1px solid var(--border-color);
  padding: 10px 20px; border-radius: 10px; font-size: 13px; font-weight: 500;
  opacity: 0; transition: all 0.25s; z-index: 9999; white-space: nowrap;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}
.re-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* Responsive v8 */
@media (max-width: 768px) {
  .re-hero { flex-direction: column; align-items: flex-start; }
  .re-hero-stats { gap: 12px; }
  .calc-metrics-grid { grid-template-columns: repeat(2, 1fr); }
  .calc-summary-row { flex-direction: column; }
  .re-portfolio-grid { grid-template-columns: 1fr; }
  .re-chat-container { height: 420px; }
}
@media (max-width: 480px) {
  .calc-metrics-grid { grid-template-columns: 1fr 1fr; }
}
