/* ── Chart Containers (Zillow Typography + Elevation) ── */
.chart-wrap {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: var(--space-5);
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.chart-canvas { width: 100%; max-height: 280px; }
.chart-annotation {
  font-family: var(--font-number);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: var(--md-primary);
  margin-top: var(--space-2);
}
.chart-panel {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: var(--space-4);
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
}
.chart-panel h4 {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  margin-bottom: 2px;
}
.chart-sub {
  font-family: var(--font-ui);
  font-size: 11px;
  line-height: 16px;
  letter-spacing: 0.5px;
  color: #767676;
  margin-bottom: var(--space-3);
}
.chart-canvas-wrap { position: relative; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); align-items: stretch; }
.chart-row > div { display: flex; flex-direction: column; }
.chart-row > div .section-sub { min-height: 1.5em; }
.chart-row > div .chart-wrap { /* fixed height, no flex stretch */ }

/* ── Signal Bars — McKenzie institutional style ── */
.signal-bars {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
  overflow: hidden;
}
.signal-row {
  display: grid;
  grid-template-columns: 160px 1fr 48px;
  align-items: center;
  gap: var(--space-3);
  padding: 10px var(--space-4);
  border-bottom: 1px solid var(--md-outline-variant);
  transition: background 0.1s;
}
.signal-row:last-child { border-bottom: none; }
.signal-row:hover { background: #fafbfc; }
.signal-name-col {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.signal-name {
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  color: #2A2A33;
  letter-spacing: 0.1px;
}
.signal-bar-wrap {
  height: 6px;
  background: #f0f1f3;
  border-radius: 3px;
  overflow: hidden;
}
.signal-bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}
.signal-bar-fill.bullish { background: #00d4aa; }
.signal-bar-fill.bearish { background: #ef4444; }
.signal-bar-fill.neutral-sig { background: #c4c7cc; }
.signal-score {
  font-family: var(--font-number);
  font-size: 12px;
  line-height: 16px;
  font-weight: 600;
  color: var(--md-on-surface-variant);
  text-align: right;
  min-width: 40px;
}
.signal-lag {
  font-family: var(--font-ui);
  font-size: 10px;
  line-height: 14px;
  color: #b0b3b8;
  font-style: normal;
  letter-spacing: 0.2px;
}
.signal-direction-label {
  font-family: var(--font-ui);
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 2px 6px;
  border-radius: 3px;
  display: inline-block;
  align-self: flex-start;
}
.signal-direction-label.dir-bullish { background: rgba(0,212,170,0.10); color: #007a63; }
.signal-direction-label.dir-bearish { background: rgba(239,68,68,0.08); color: #b91c1c; }
.signal-direction-label.dir-neutral { background: #f0f1f3; color: #767676; }
.signal-summary-text {
  font-family: var(--font-ui);
  font-size: 13px;
  line-height: 20px;
  color: var(--md-on-surface-variant);
  margin-top: var(--space-3);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.signal-summary-count {
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 700;
}
.signal-missing-note {
  font-family: var(--font-ui);
  font-size: 11px;
  color: #b0b3b8;
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ── Valuation Risk Flags ── */
.valuation-flag {
  margin-top: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--m3-shape-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: 0.4px;
  font-weight: 500;
}
.valuation-flag.flag-amber { background: rgba(245,158,11,0.10); color: var(--color-amber); border: 1px solid rgba(245,158,11,0.25); }
.valuation-flag.flag-red { background: var(--md-error-container); color: var(--md-error); border: 1px solid rgba(239,68,68,0.20); }
.valuation-flag.flag-teal { background: rgba(0,212,170,0.08); color: var(--md-primary); border: 1px solid rgba(0,212,170,0.20); }

/* ── Financing Calculator ── */
.fin-controls { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-5); margin-bottom: var(--space-6); }
.fin-control {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: var(--space-6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.fin-control label {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #767676;
  display: block;
  margin-bottom: var(--space-2);
}
.fin-control .val-display {
  font-family: var(--font-number);
  font-size: 22px;
  line-height: 28px;
  font-weight: 600;
  color: #2A2A33;
  margin-bottom: var(--space-2);
}
.fin-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 4px;
  border-radius: 2px;
  background: var(--md-outline);
  outline: none;
}
.fin-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--md-primary);
  cursor: pointer;
  border: 2px solid #ffffff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
.dp-pills { display: flex; gap: var(--space-2); }
.dp-pill {
  flex: 1;
  padding: var(--space-2) 0;
  text-align: center;
  border-radius: var(--m3-shape-full);
  font-family: var(--font-number);
  font-size: 12px;
  line-height: 16px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--md-outline);
  background: #ffffff;
  color: #767676;
  transition: all 0.15s;
  min-height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dp-pill:hover { background: #f4f6f8; }
.dp-pill.active { background: rgba(0,212,170,0.10); border-color: var(--md-primary); color: var(--md-primary); }

/* Financing outputs */
.fin-outputs { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); }
.fin-metrics {
  background: #ffffff;
  border: none;
  border-radius: 8px;
  padding: var(--space-6);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.fin-metrics h4 {
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #767676;
  margin-bottom: var(--space-3);
}
.fm-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; min-height: 40px; }
.fm-row:last-child { border-bottom: none; }
.fm-row.fm-row-total { border-top: 2px solid #e5e7eb; padding-top: 10px; }
.fm-row.fm-row-total .fm-value { font-size: 16px; font-weight: 600; }
.fm-label { font-family: var(--font-ui); font-size: 13px; line-height: 16px; color: #767676; }
.fm-value { font-family: var(--font-number); font-size: 13px; line-height: 20px; font-weight: 500; color: #2A2A33; }
.fm-value.positive { color: #00d4aa; }
.fm-value.negative { color: #ef4444; }
.fm-value.warning { color: var(--color-amber); }

/* Rate sensitivity table */
.rate-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: var(--space-2); }
.rate-table th {
  text-align: right;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #767676;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: none;
}
.rate-table th:first-child { text-align: left; }
.rate-table td {
  padding: 10px 16px;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  color: #2A2A33;
}
.rate-table td:first-child { text-align: left; color: #767676; font-family: var(--font-ui); font-weight: 400; }
.rate-table tr:last-child td { border-bottom: none; }
.rate-table tr.current-row { background: #f8f9fa; }
.rate-table tr.current-row td { font-weight: 600; }
.rate-table tr.current-row td:first-child { border-left: 3px solid #00d4aa; padding-left: 13px; }

/* Scenario analysis table */
.scenario-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: var(--space-3); }
.scenario-table th {
  text-align: right;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: #767676;
  padding: 8px 16px;
  border-bottom: 1px solid #e5e7eb;
  background: none;
}
.scenario-table th:first-child { text-align: left; }
.scenario-table td {
  padding: 10px 16px;
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  text-align: right;
  border-bottom: 1px solid #f0f0f0;
  color: #2A2A33;
}
.scenario-table td:first-child { text-align: left; color: #767676; font-family: var(--font-ui); font-weight: 500; }
.scenario-table tr:last-child td { border-bottom: none; }
.scenario-table tr.scenario-base { background: #f8f9fa; }
.scenario-table tr.scenario-base td { font-weight: 600; }
.scenario-table tr.scenario-base td:first-child { border-left: 3px solid #00d4aa; padding-left: 13px; }
.scenario-table tr.scenario-severe td { color: #ef4444; }
.scenario-label { font-family: var(--font-ui); font-weight: 500; }

/* ── Four-Regime Badges (shared with map.css) ── */
.regime-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.regime-badge.tailwind {
  background: rgba(0,212,170,0.1);
  border: 1px solid rgba(0,212,170,0.3);
  color: var(--md-primary);
}
.regime-badge.neutral-regime {
  background: rgba(139,143,168,0.1);
  border: 1px solid rgba(139,143,168,0.3);
  color: var(--md-tertiary);
}
.regime-badge.headwind {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  color: #ef4444;
}
.regime-badge.distressed {
  background: rgba(153,27,27,0.15);
  border: 1px solid rgba(153,27,27,0.4);
  color: #991b1b;
}
.regime-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  .fin-controls { grid-template-columns: 1fr; }
  .fin-outputs { grid-template-columns: 1fr; }
  .chart-row { grid-template-columns: 1fr; }
  .signal-row { grid-template-columns: 120px 1fr 40px; }
}
