:root {
  color-scheme: light;
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-soft: #f0f3f1;
  --ink: #171a1d;
  --muted: #65706f;
  --line: #d9dfdc;
  --buy: #08795b;
  --buy-soft: #dcefe8;
  --sell: #ba3f32;
  --sell-soft: #f4dfdc;
  --amber: #a66a10;
  --blue: #365fa8;
  --neutral: #79817f;
  --shadow: 0 12px 30px rgba(24, 31, 27, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(14px);
}

.identity {
  min-width: 210px;
}

.eyebrow,
.panel-kicker {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 17px;
  letter-spacing: 0;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.app-view[hidden] {
  display: none;
}

.view-switch {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.view-button {
  min-height: 38px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
}

.view-button.is-active {
  background: var(--ink);
  color: #ffffff;
}

.status-pill,
.action-button,
.segment {
  min-height: 38px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
}

.status-pill {
  display: flex;
  align-items: center;
  max-width: 320px;
  padding: 0 12px;
  color: var(--muted);
  border-radius: 8px;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.segments {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.segments[hidden] {
  display: none;
}

.segment {
  min-width: 54px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.segment.is-active {
  background: var(--ink);
  color: #ffffff;
}

.action-button {
  padding: 0 14px;
  border-radius: 8px;
  cursor: pointer;
}

.page {
  display: grid;
  gap: 16px;
  padding: 16px clamp(16px, 3vw, 34px) 32px;
}

.dashboard-guide {
  max-width: 980px;
  margin: -4px 0 -3px;
}

.dashboard-guide p {
  margin: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  opacity: 0.64;
}

.score-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.score-summary-card {
  min-height: 66px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.58);
}

.score-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.score-summary-card b {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.15;
}

.score-summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.28;
}

.score-summary-card.buy {
  border-color: #bddbd1;
  background: rgba(220, 239, 232, 0.6);
}

.score-summary-card.sell {
  border-color: #e4bfb9;
  background: rgba(244, 223, 220, 0.55);
}

.score-summary-card.warn {
  border-color: #e9d8bd;
  background: rgba(245, 234, 217, 0.58);
}

.analyst-body {
  display: grid;
  gap: 12px;
  padding: 14px 16px 16px;
}

.model-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.relationship-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 8px;
}

.relationship-card {
  min-height: 84px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.relationship-card.forecast {
  grid-column: span 2;
}

.relationship-card span {
  display: block;
  color: var(--muted);
  font-size: 8px;
  font-weight: 850;
  text-transform: uppercase;
}

.relationship-card b {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.15;
}

.relationship-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
}

.relationship-card.buy {
  border-color: #bddbd1;
  background: rgba(220, 239, 232, 0.58);
}

.relationship-card.sell {
  border-color: #e4bfb9;
  background: rgba(244, 223, 220, 0.52);
}

.relationship-card.warn {
  border-color: #e9d8bd;
  background: rgba(245, 234, 217, 0.58);
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 12px;
}

.metric-card,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.metric-card {
  min-height: 112px;
  padding: 14px;
}

.demand-panel {
  overflow: hidden;
}

.demand-head-actions {
  display: grid;
  gap: 7px;
  justify-items: end;
}

.daily-head-actions {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.mini-segments {
  display: inline-flex;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mini-segment {
  min-width: 42px;
  min-height: 30px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.mini-segment.is-active {
  background: var(--ink);
  color: #ffffff;
}

.demand-grid {
  display: grid;
  grid-template-columns: minmax(190px, 0.28fr) minmax(0, 1fr);
  gap: 12px;
  padding: 14px 16px 8px;
}

.demand-score-card {
  min-height: 138px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.demand-score-card.buy .metric-value {
  color: var(--buy);
}

.demand-score-card.sell .metric-value {
  color: var(--sell);
}

.demand-score-card.warn .metric-value {
  color: var(--amber);
}

.demand-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.demand-chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  gap: 12px;
  padding: 8px 16px 16px;
}

.demand-chart-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 342px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.demand-chart-wrap canvas {
  flex: 1;
  min-height: 230px;
  height: auto;
}

.chart-label-block {
  padding: 11px 14px 0;
}

.chart-label-block .metric-label {
  margin-bottom: 3px;
}

.chart-label-block h3,
.mini-section-head h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.15;
}

.chart-label-block > p:not(.metric-label) {
  max-width: 720px;
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.3;
  opacity: 0.7;
}

.chart-mini-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 8px;
  font-weight: 750;
}

.chart-mini-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.legend-line.dashed {
  height: 0;
  background: transparent;
  border-top: 2px dashed var(--blue);
}

.legend-line.applications-line {
  background: var(--ink);
}

.legend-line.purchase-line {
  background: var(--buy);
}

.legend-line.refinance-line {
  background: #7d4db3;
}

.demand-table-card {
  margin: 0 16px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.mini-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
}

.mini-section-head .metric-label {
  margin-bottom: 3px;
}

.mini-section-head p:last-child {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.32;
  opacity: 0.72;
}

.compact-table-scroll table {
  min-width: 860px;
}

.compact-table-scroll th,
.compact-table-scroll td {
  padding: 9px 10px;
  font-size: 11px;
}

.table-note {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 8px;
  line-height: 1.2;
  opacity: 0.72;
}

.trends-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.trends-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.trends-head .metric-label {
  margin: 0;
}

.trends-head a {
  color: var(--blue);
  font-size: 11px;
  font-weight: 750;
  text-decoration: none;
}

.trends-panel iframe {
  display: block;
  width: 100%;
  height: 228px;
  border: 0;
  background: #ffffff;
}

.trends-note {
  margin: 0;
  padding: 8px 12px 10px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  opacity: 0.7;
}

.metric-label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.metric-value {
  margin: 0;
  font-size: 24px;
  font-weight: 800;
  line-height: 1;
}

.metric-detail {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-help {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.66;
}

.metric-card.buy .metric-value,
.positive {
  color: var(--buy);
}

.metric-card.sell .metric-value,
.negative {
  color: var(--sell);
}

.metric-card.warn .metric-value {
  color: var(--amber);
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(310px, 0.7fr);
  gap: 16px;
}

.lower-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.panel-note {
  max-width: 620px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
  opacity: 0.68;
}

.tape-head-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.tape-price-readout {
  min-width: 184px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  text-align: right;
}

.tape-price-readout span,
.tape-price-readout small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.tape-price-readout span {
  font-weight: 800;
  text-transform: uppercase;
}

.tape-price-readout strong {
  display: block;
  margin-top: 3px;
  font-size: 22px;
  line-height: 1;
}

.tape-price-readout small {
  margin-top: 5px;
  font-weight: 700;
}

.legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
}

.legend-dot.buy {
  background: var(--buy);
}

.legend-dot.sell {
  background: var(--sell);
}

.legend-dot.prediction-dot {
  background: #fff;
  border: 2px solid var(--buy);
}

.legend-bar {
  width: 16px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.legend-bar.refi-index-bar {
  background: rgba(54, 95, 168, 0.72);
}

.legend-bar.refi-estimate-bar {
  background: rgba(166, 106, 16, 0.45);
  border: 1px solid rgba(166, 106, 16, 0.9);
}

.legend-bar.ck-cta-bar {
  background: rgba(54, 95, 168, 0.38);
  border: 1px solid rgba(54, 95, 168, 0.72);
}

.legend-bar.ck-link-bar {
  background: rgba(166, 106, 16, 0.34);
  border: 1px solid rgba(166, 106, 16, 0.76);
}

.legend-line {
  width: 18px;
  height: 2px;
  background: var(--blue);
  display: inline-block;
}

.legend-line.ck-score-line {
  background: var(--buy);
}

.legend-line.score-line {
  height: 0;
  background: transparent;
  border-top: 2px solid var(--blue);
}

.legend-line.ten-year {
  background: var(--blue);
}

.legend-line.thirty-year {
  background: var(--amber);
}

.legend-line.mortgage-rate {
  background: var(--sell);
}

.legend-line.volume-line {
  height: 0;
  background: transparent;
  border-top: 2px dashed var(--buy);
}

.legend-line.better-volume {
  border-color: var(--buy);
}

.legend-line.credit-karma-volume {
  border-color: #7d4db3;
}

.chart-wrap,
.mini-chart-wrap,
.session-chart-wrap,
.yield-chart-wrap {
  position: relative;
  width: 100%;
}

.chart-wrap {
  height: 480px;
}

.mini-chart-wrap {
  height: 245px;
}

.session-chart-wrap {
  height: 330px;
}

.yield-chart-wrap {
  height: 540px;
}

.ck-chart-wrap {
  position: relative;
  width: 100%;
  height: 390px;
}

.ck-chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.ck-score-block {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 0 16px 14px;
}

.ck-score-ring {
  width: 104px;
  height: 104px;
}

.ck-change-list {
  padding-top: 0;
}

.ck-change-list .readout-item {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.ck-change-list .readout-item strong {
  line-height: 1.2;
}

.ck-change-list .readout-item small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.66;
}

#ckRunSummary .score-summary-card b {
  font-size: 11px;
  line-height: 1.22;
}

.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-chip.buy {
  border-color: #bddbd1;
  background: var(--buy-soft);
  color: var(--buy);
}

.status-chip.sell {
  border-color: #e4bfb9;
  background: var(--sell-soft);
  color: var(--sell);
}

.status-chip.warn {
  border-color: #e9d8bd;
  background: rgba(245, 234, 217, 0.8);
  color: var(--amber);
}

.ck-source-list {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.ck-source-list a {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--ink);
  text-decoration: none;
}

.ck-source-list a:hover {
  border-color: #bddbd1;
  background: #edf7f2;
}

.ck-source-list span {
  font-size: 13px;
  font-weight: 800;
}

.ck-source-list small {
  color: var(--muted);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.refi-index-readout {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 8px;
  padding: 0 16px 12px;
}

.refi-index-readout .score-summary-card {
  min-height: 76px;
}

.refi-index-chart-wrap {
  position: relative;
  width: 100%;
  height: 385px;
  padding: 0 14px 16px;
}

.refi-index-chart-wrap canvas {
  width: 100%;
  height: 100%;
}

.yield-metric-strip {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

#yieldSummary {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.yield-panel .panel-head {
  align-items: flex-start;
}

.yield-rate-date {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.66;
}

.yield-readout-note {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  opacity: 0.72;
}

.delta-readout {
  border-top: 1px solid var(--line);
}

.delta-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.7fr);
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  background: var(--surface);
}

.delta-label {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.delta-main {
  margin: 0;
  font-size: 18px;
  font-weight: 850;
}

.delta-main span {
  margin-left: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.delta-summary.buy .delta-main {
  color: var(--buy);
}

.delta-summary.sell .delta-main {
  color: var(--sell);
}

.delta-small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
}

.delta-small b {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-tooltip {
  position: absolute;
  min-width: 190px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(24, 31, 27, 0.16);
  color: var(--ink);
  font-size: 12px;
  pointer-events: none;
  z-index: 5;
}

.chart-tooltip strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
}

.session-chart-tooltip {
  min-width: 230px;
}

.refi-chart-tooltip {
  min-width: 300px;
  max-width: 330px;
  line-height: 1.35;
}

.readout-panel {
  display: flex;
  flex-direction: column;
}

.score-block {
  display: grid;
  grid-template-columns: 124px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
}

.score-ring {
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  align-content: center;
  background:
    radial-gradient(circle at center, #ffffff 0 55%, transparent 56%),
    conic-gradient(var(--buy) 0deg, var(--buy) 0deg, var(--line) 0deg);
}

.score-ring span {
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
}

.score-ring small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.regime-label {
  margin-bottom: 8px;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.12;
}

.regime-copy {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.next-zone-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.next-zone-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 92px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.next-zone-card.buy {
  border-color: #bddbd1;
  background: var(--buy-soft);
}

.next-zone-card.sell {
  border-color: #e4bfb9;
  background: var(--sell-soft);
}

.next-zone-label {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.next-zone-price {
  margin: 0;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.1;
}

.next-zone-help {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.7;
}

.next-zone-score {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.7);
  font-size: 11px;
  font-weight: 850;
}

.readout-list {
  display: grid;
  gap: 0;
}

.readout-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
}

.readout-item:last-child {
  border-bottom: 0;
}

.readout-name {
  color: var(--muted);
  font-size: 13px;
}

.readout-help {
  max-width: 260px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
  opacity: 0.64;
}

.readout-value {
  font-weight: 800;
  text-align: right;
}

.zone-table {
  padding: 4px 0;
}

.zone-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 112px;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
}

.zone-row:last-child {
  border-bottom: 0;
}

.zone-price {
  font-weight: 850;
}

.zone-kind {
  font-size: 13px;
}

.zone-title {
  display: block;
  font-weight: 800;
}

.zone-kind small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.25;
}

.zone-kind .zone-signal-note {
  max-width: 660px;
  color: var(--ink);
  font-size: 9px;
  opacity: 0.58;
}

.zone-strength {
  display: grid;
  justify-items: center;
  justify-self: end;
  min-width: 96px;
  max-width: 108px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--surface-soft);
  text-align: center;
}

.zone-strength b {
  font-size: 14px;
  line-height: 1;
}

.zone-strength span {
  margin-top: 4px;
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  opacity: 0.72;
  line-height: 1.12;
}

.zone-row.buy .zone-strength {
  background: var(--buy-soft);
  color: var(--buy);
}

.zone-row.sell .zone-strength {
  background: var(--sell-soft);
  color: var(--sell);
}

.supply-map {
  display: grid;
}

.supply-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 62px;
  gap: 14px;
  align-items: center;
  min-height: 66px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}

.supply-row:last-child {
  border-bottom: 0;
}

body[data-view="valuation"] {
  background: #020706;
  color: #e9f2ef;
}

body[data-view="valuation"] .topbar {
  border-color: #101d19;
  background: rgba(2, 7, 6, 0.88);
}

body[data-view="valuation"] .eyebrow,
body[data-view="valuation"] .status-pill {
  color: #7d918c;
}

body[data-view="valuation"] .view-switch,
body[data-view="valuation"] .segments {
  border-color: #14231f;
  background: #06100e;
}

body[data-view="valuation"] .view-button,
body[data-view="valuation"] .segment {
  color: #91a39f;
}

body[data-view="valuation"] .view-button.is-active,
body[data-view="valuation"] .segment.is-active {
  background: #20d6b4;
  color: #01110d;
}

body[data-view="valuation"] .status-pill,
body[data-view="valuation"] .action-button {
  border-color: #14231f;
  background: #06100e;
  color: #d9e8e3;
}

.valuation-page {
  gap: 16px;
  padding-top: 0;
  background: #020706;
}

.valuation-intro {
  min-height: 58px;
  margin: 0 calc(clamp(16px, 3vw, 34px) * -1);
  padding: 11px clamp(16px, 3vw, 34px) 13px;
  border-top: 1px solid #101d19;
  border-bottom: 1px solid #101d19;
  background: #030b09;
}

.valuation-intro p {
  max-width: 1180px;
  margin: 0;
  color: #c8d8d3;
  font-size: 13px;
  line-height: 1.6;
}

.valuation-intro span {
  color: #20d6b4;
  font-weight: 850;
}

.valuation-shell {
  display: grid;
  grid-template-columns: minmax(330px, 0.43fr) minmax(0, 0.57fr);
  gap: 16px;
  min-height: 680px;
}

.valuation-left,
.valuation-main {
  min-width: 0;
}

.valuation-left {
  border-right: 1px solid rgba(32, 214, 180, 0.28);
  padding-right: 16px;
}

.case-stack,
.driver-stack,
.valuation-main {
  display: grid;
  gap: 10px;
}

.case-row,
.scenario-row {
  width: 100%;
  border: 1px solid #12231f;
  background: #030807;
  color: #e9f2ef;
  cursor: pointer;
}

.case-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 10px 13px;
  border-radius: 8px;
  text-align: left;
}

.case-row.is-active {
  border-color: rgba(32, 214, 180, 0.86);
  background: #061512;
}

.case-row.base.is-active,
.scenario-row.base.is-active {
  box-shadow: inset 0 0 0 1px rgba(32, 214, 180, 0.18);
}

.case-dot,
.scenario-row i,
.valuation-legend i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.case-row.bear .case-dot,
.scenario-row.bear i,
.valuation-legend i.bear {
  background: #ff5e69;
}

.case-row.base .case-dot,
.scenario-row.base i,
.valuation-legend i.base {
  background: #20d6b4;
}

.case-row.bull .case-dot,
.scenario-row.bull i,
.valuation-legend i.bull {
  background: #4ecb71;
}

.case-copy strong,
.case-price strong {
  display: block;
  font-size: 13px;
  line-height: 1.1;
}

.case-copy small,
.case-price small {
  display: block;
  margin-top: 4px;
  color: #718780;
  font-size: 10px;
  line-height: 1.2;
}

.case-price {
  text-align: right;
}

.case-price strong {
  font-size: 15px;
}

.driver-tools {
  display: flex;
  justify-content: flex-end;
  min-height: 28px;
  margin: 2px 0 -2px;
}

.valuation-reset {
  border: 0;
  background: transparent;
  color: #7d918c;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  cursor: pointer;
}

.valuation-reset:hover {
  color: #20d6b4;
}

.driver-card {
  padding: 14px;
  border: 1px solid #0f1c18;
  border-radius: 8px;
  background: #05100e;
}

.driver-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.driver-head label {
  color: #dce8e4;
  font-size: 13px;
  font-weight: 800;
}

.driver-number {
  width: 82px;
  min-height: 34px;
  border: 1px solid #14231f;
  border-radius: 8px;
  background: #020706;
  color: #e9f2ef;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.driver-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 52px;
  align-items: center;
  gap: 14px;
  margin-top: 13px;
}

.driver-control input[type="range"] {
  width: 100%;
  accent-color: #20d6b4;
}

.driver-control span {
  color: #8ea29d;
  font-size: 11px;
  font-weight: 800;
  text-align: right;
}

.driver-card details {
  margin-top: 12px;
}

.driver-card summary {
  width: max-content;
  color: #20d6b4;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  cursor: pointer;
}

.driver-card details p {
  max-width: 520px;
  margin: 8px 0 0;
  color: #7d918c;
  font-size: 10px;
  line-height: 1.45;
}

.scenario-table,
.valuation-chart-card {
  border: 1px solid #101d19;
  border-radius: 8px;
  background: #030807;
  overflow: hidden;
}

.scenario-head,
.scenario-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(100px, 0.72fr) minmax(100px, 0.7fr) minmax(82px, 0.48fr);
  align-items: center;
  gap: 12px;
}

.scenario-head {
  min-height: 31px;
  padding: 0 16px;
  border-bottom: 1px solid #101d19;
  color: #7d918c;
  font-size: 8px;
  font-weight: 850;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.scenario-head span:first-child {
  grid-column: 2;
}

.scenario-row {
  min-height: 55px;
  padding: 0 16px;
  border-width: 0 0 1px;
  border-radius: 0;
  text-align: left;
}

.scenario-row:last-child {
  border-bottom: 0;
}

.scenario-row.is-active {
  background: rgba(32, 214, 180, 0.08);
}

.scenario-row span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #a5b8b2;
  font-size: 11px;
  font-weight: 850;
}

.scenario-row strong {
  font-size: 15px;
}

.scenario-footnote {
  margin: 0;
  padding: 10px 16px 13px;
  border-top: 1px solid #101d19;
  color: #5f746e;
  font-size: 10px;
  line-height: 1.35;
}

.valuation-chart-card {
  min-height: 386px;
}

.valuation-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 16px 0;
}

.valuation-kicker {
  margin: 0 0 9px;
  color: #dce8e4;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.valuation-chart-head h2 {
  color: #e9f2ef;
}

.valuation-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  color: #81948f;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.valuation-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.valuation-chart-wrap {
  position: relative;
  height: 510px;
  margin-top: 8px;
}

.valuation-chart-wrap canvas {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
}

.valuation-watermark {
  position: absolute;
  z-index: 1;
  left: 18%;
  top: 23%;
  display: flex;
  align-items: center;
  gap: 13px;
  color: rgba(239, 247, 244, 0.88);
  font-size: clamp(44px, 6vw, 74px);
  font-weight: 750;
  pointer-events: none;
}

.betr-mark {
  display: grid;
  place-items: center;
  width: 0.95em;
  height: 0.95em;
  border: 0.08em solid currentColor;
  border-radius: 50%;
  font-size: 0.6em;
  font-weight: 900;
}

.supply-range strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.supply-range span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.supply-detail p {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

.supply-detail small {
  display: block;
  max-width: 720px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.25;
}

.supply-detail .supply-signal-note {
  color: var(--ink);
  opacity: 0.62;
}

.supply-meta {
  display: grid;
  justify-items: center;
  justify-self: end;
  min-width: 84px;
  max-width: 92px;
  padding: 6px 7px;
  border-radius: 8px;
  background: var(--surface-soft);
  text-align: center;
}

.supply-row.sell .supply-meta {
  background: var(--sell-soft);
  color: var(--sell);
}

.supply-row.warn .supply-meta {
  background: #f5ead9;
  color: var(--amber);
}

.supply-meta b {
  font-size: 13px;
  line-height: 1;
}

.supply-meta span {
  margin-top: 3px;
  font-size: 7px;
  font-weight: 850;
  text-transform: uppercase;
  opacity: 0.75;
  line-height: 1.15;
}

.empty-state {
  padding: 18px 16px;
  color: var(--muted);
  font-size: 13px;
}

.table-scroll {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 13px;
}

th:first-child,
td:first-child,
th:last-child,
td:last-child {
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

.bias-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 118px;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--neutral);
  font-size: 12px;
  font-weight: 800;
}

.bias-pill.buy {
  background: var(--buy-soft);
  color: var(--buy);
}

.bias-pill.sell {
  background: var(--sell-soft);
  color: var(--sell);
}

.bias-pill.warn {
  background: rgba(245, 234, 217, 0.9);
  color: var(--amber);
}

.data-stamp {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.error-panel {
  padding: 14px 16px;
  border: 1px solid #e2b3ad;
  border-radius: 8px;
  background: #fff1ef;
  color: #8f281f;
  font-size: 14px;
}

@media (max-width: 1180px) {
  .metric-strip {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .workspace-grid,
  .lower-grid,
  .demand-grid,
  .demand-chart-grid {
    grid-template-columns: 1fr;
  }

  .valuation-shell {
    grid-template-columns: 1fr;
  }

  .valuation-left {
    border-right: 0;
    border-bottom: 1px solid rgba(32, 214, 180, 0.24);
    padding-right: 0;
    padding-bottom: 16px;
  }

  .relationship-card.forecast {
    grid-column: span 1;
  }

  .demand-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar {
    justify-content: flex-start;
  }

  .status-pill {
    width: 100%;
    max-width: none;
  }

  .segments {
    flex: 1 1 100%;
    flex-wrap: wrap;
  }

  .view-switch {
    width: 100%;
  }

  .view-button {
    flex: 1;
    min-width: 0;
    white-space: normal;
  }

  .segment {
    flex: 1;
    min-width: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-summary {
    grid-template-columns: 1fr;
  }

  .demand-summary {
    grid-template-columns: 1fr;
  }

  .demand-chart-wrap {
    height: 360px;
  }

  .trends-panel iframe {
    height: 250px;
  }

  .chart-wrap {
    height: 410px;
  }

  .session-chart-wrap {
    height: 360px;
  }

  .yield-chart-wrap {
    height: 430px;
  }

  .ck-chart-wrap {
    height: 330px;
  }

  .refi-index-chart-wrap {
    height: 360px;
    padding: 0 8px 14px;
  }

  .legend {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .tape-head-actions {
    width: 100%;
    justify-items: start;
  }

  .tape-price-readout {
    width: 100%;
    text-align: left;
  }

  .demand-head-actions {
    justify-items: start;
  }

  .daily-head-actions {
    justify-items: start;
  }

  .valuation-chart-wrap {
    height: 390px;
  }

  .scenario-head,
  .scenario-row {
    grid-template-columns: minmax(86px, 1fr) minmax(74px, 0.74fr) minmax(74px, 0.68fr) minmax(62px, 0.5fr);
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
  }

  .scenario-head {
    letter-spacing: 0.08em;
  }

  .scenario-row strong {
    font-size: 13px;
  }

  .valuation-chart-head {
    display: grid;
  }

  .mini-section-head {
    display: block;
  }

  .mini-section-head p:last-child {
    margin-top: 7px;
  }

  .mini-segments {
    width: 100%;
  }

  .mini-segment {
    flex: 1;
  }

  .delta-summary {
    grid-template-columns: 1fr;
  }

  .supply-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .supply-meta {
    justify-self: start;
  }
}

@media (max-width: 520px) {
  .metric-strip,
  .yield-metric-strip {
    grid-template-columns: 1fr;
  }

  .case-row {
    grid-template-columns: 14px minmax(0, 1fr);
  }

  .case-price {
    grid-column: 2;
    text-align: left;
  }

  .driver-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .driver-number {
    width: 100%;
  }

  .scenario-head {
    display: none;
  }

  .scenario-row {
    grid-template-columns: 1fr 1fr;
    min-height: 76px;
  }

  .scenario-row span {
    grid-column: 1 / -1;
  }

  .valuation-watermark {
    left: 14%;
    top: 30%;
  }

  .score-block {
    grid-template-columns: 1fr;
  }

  .next-zone-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 104px;
    height: 104px;
  }

  .zone-row {
    grid-template-columns: 1fr;
  }

  .zone-strength {
    justify-self: start;
  }
}
