:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --ink: #13201d;
  --muted: #667873;
  --line: #dce6e2;
  --panel: #ffffff;
  --panel-soft: #eef8f3;
  --green: #15a36f;
  --green-deep: #056246;
  --teal: #0b95a3;
  --gold: #f3a61d;
  --coral: #f26d4f;
  --red: #d75546;
  --blue: #2367d1;
  --shadow: 0 24px 70px rgba(18, 42, 55, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, #f6fbff 0, var(--bg) 420px),
    var(--bg);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 6vw;
  border-bottom: 1px solid rgba(5, 98, 70, 0.1);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 800;
}

.brand-mark {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background:
    linear-gradient(135deg, transparent 42%, #ffffff 42% 56%, transparent 56%),
    linear-gradient(135deg, var(--green), var(--teal) 55%, var(--gold));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.nav a:hover {
  background: rgba(21, 163, 111, 0.1);
  color: var(--green-deep);
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  display: grid;
  align-items: end;
  overflow: hidden;
  padding: 0 6vw 8vh;
  background: #dff3ee;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 44, 40, 0.78), rgba(7, 88, 78, 0.48) 46%, rgba(35, 103, 209, 0.16)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(243, 166, 29, 0.18));
}

.hero-visual {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(129, 172, 176, 0.48), rgba(13, 66, 55, 0.18)),
    url("data:image/svg+xml,%3Csvg width='1600' height='900' viewBox='0 0 1600 900' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1600' height='900' fill='%23d6e5dd'/%3E%3Cpath d='M0 620 C260 540 420 660 680 590 C940 520 1110 570 1600 470 L1600 900 L0 900 Z' fill='%2374a99b'/%3E%3Cpath d='M0 690 C240 630 390 730 650 670 C910 610 1110 660 1600 580 L1600 900 L0 900 Z' fill='%235b8f83'/%3E%3Cpath d='M120 540 h55 v250 h-55zM205 480 h74v310h-74zM315 430h88v360h-88zM450 500h58v290h-58zM545 380h105v410H545zM690 460h82v330h-82zM820 330h96v460h-96zM960 420h78v370h-78zM1085 360h116v430h-116zM1240 500h90v290h-90zM1370 390h112v400h-112z' fill='%232d5f57'/%3E%3Cpath d='M145 560h10v190h-10zM230 510h12v235h-12zM350 460h12v280h-12zM583 410h14v330h-14zM858 360h13v380h-13zM1130 390h14v350h-14zM1415 420h13v320h-13z' fill='%2387bdb1' opacity='.75'/%3E%3C/svg%3E");
  background-size: cover;
  background-position: center;
}

.map-grid {
  position: absolute;
  inset: auto 0 0 0;
  height: 36%;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.16) 1px, transparent 1px);
  background-size: 72px 72px;
  transform: perspective(500px) rotateX(58deg) scale(1.4);
  transform-origin: bottom;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 860px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: #bff7e7;
}

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

h1 {
  margin-bottom: 20px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 1.04;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.16;
}

h3 {
  margin-bottom: 10px;
  font-size: 20px;
  line-height: 1.25;
}

.hero-copy {
  max-width: 680px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

.buyer-focus {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: -6px 0 18px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  backdrop-filter: blur(10px);
}

.buyer-focus strong {
  color: #ffe4a3;
  font-size: 14px;
}

.buyer-focus span {
  color: rgba(255, 255, 255, 0.84);
  font-size: 13px;
  font-weight: 700;
}

.hero-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 24px;
}

.hero-proof span {
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.update-indicator {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  max-width: 100%;
  margin: -8px 0 22px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  background: rgba(10, 44, 38, 0.56);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
  color: #fff;
}

.update-dot {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
  background: #8ff0b7;
  box-shadow: 0 0 0 6px rgba(143, 240, 183, 0.18);
}

.update-indicator div {
  display: grid;
  gap: 3px;
}

.update-indicator strong {
  font-size: 14px;
  line-height: 1.2;
}

.update-indicator span:not(.update-dot) {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  font-weight: 800;
}

.button.primary {
  border-color: #fff;
  background: #fff;
  color: var(--green-deep);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.metrics-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px 6vw;
  background: #fff;
  border-bottom: 1px solid var(--line);
}

.metric-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid rgba(21, 163, 111, 0.14);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f7fcfa);
  box-shadow: 0 16px 38px rgba(18, 42, 55, 0.08);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: linear-gradient(180deg, var(--green), var(--teal), var(--gold));
}

.metric-label,
.metric-unit,
.metric-change {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.metric-card strong {
  display: block;
  margin: 6px 0 2px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1;
  color: var(--green-deep);
}

.metric-change {
  margin-top: 12px;
}

.metric-change.up {
  color: var(--green);
}

.metric-change.down {
  color: var(--red);
}

.section {
  padding: 88px 6vw;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-note {
  max-width: 360px;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 14px;
}

.section-note.wide {
  max-width: 840px;
  margin: -12px 0 22px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 18px;
}

.panel,
.scenario,
.signal {
  border: 1px solid rgba(14, 113, 93, 0.13);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel {
  padding: 24px;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.panel-head h3 {
  margin-bottom: 0;
}

.panel-head span {
  color: var(--muted);
  font-size: 13px;
}

.panel-head .data-status {
  display: block;
  margin-top: 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.chart-panel {
  overflow: hidden;
}

.chart-panel,
.district-trend-panel,
.district-table-panel,
.submarket-panel,
.evidence-panel {
  background: linear-gradient(180deg, #ffffff, #fbfefd);
}

canvas {
  width: 100%;
  min-height: 260px;
  display: block;
}

.chart-canvas-wrap {
  position: relative;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 132px;
  padding: 9px 10px;
  border: 1px solid rgba(20, 32, 30, 0.12);
  border-radius: 8px;
  background: rgba(20, 32, 30, 0.92);
  box-shadow: 0 14px 34px rgba(20, 32, 30, 0.22);
  color: #fff;
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  transform: translate(-50%, calc(-100% - 12px));
  white-space: nowrap;
}

.chart-tooltip strong {
  display: block;
  font-size: 14px;
}

.chart-tooltip span {
  color: rgba(255, 255, 255, 0.72);
}

#districtTrendChart {
  min-height: 220px;
}

.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.segment {
  min-width: 64px;
  min-height: 36px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.segment.active {
  background: var(--green);
  color: #fff;
}

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

.range-control {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.range-button {
  min-height: 36px;
  padding: 0 11px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.range-button.active {
  background: var(--blue);
  color: #fff;
}

.insight-list {
  display: grid;
  gap: 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.insight-list li {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.insight-list li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.insight-list strong {
  color: var(--ink);
}

.district-tools {
  display: grid;
  grid-template-columns: repeat(3, max-content);
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eef6f2;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.district-sort {
  position: relative;
  min-height: 36px;
  padding: 0 14px 0 26px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 900;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.district-sort::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #aeb9b4;
  transform: translateY(-50%);
}

.district-sort.active {
  border-color: rgba(20, 87, 71, 0.26);
  background: linear-gradient(180deg, var(--green), var(--teal));
  color: #fff;
  box-shadow: 0 10px 22px rgba(31, 122, 92, 0.22);
}

.district-sort.active::before {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.24);
}

.district-sort-status {
  grid-column: 1 / -1;
  padding: 6px 8px 2px;
  color: var(--green-deep);
  font-size: 12px;
  font-weight: 900;
}

.district-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 18px;
}

.district-summary-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(21, 163, 111, 0.15);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #f4fbff);
  box-shadow: 0 14px 34px rgba(18, 42, 55, 0.07);
}

.district-summary-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.district-summary-card strong {
  display: block;
  margin-top: 6px;
  font-size: 28px;
  line-height: 1.1;
  color: var(--green-deep);
}

.district-summary-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.district-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.district-trend-panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.district-trend-panel .panel-head.compact {
  margin-bottom: 14px;
}

.district-picker-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px;
  border: 1px solid rgba(14, 113, 93, 0.11);
  border-radius: 8px;
  background: #f7fbfa;
}

.district-picker-row > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.district-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.district-trend-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(14, 113, 93, 0.11);
}

.district-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
}

.district-legend-item span {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: var(--line-color);
}

.district-legend-item.active {
  border-color: rgba(31, 122, 92, 0.18);
  background: #f7fbfa;
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--green);
}

.district-pick {
  min-height: 32px;
  padding: 0 10px 0 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  position: relative;
  white-space: nowrap;
}

.district-pick::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 50%;
  width: 8px;
  height: 8px;
  border: 1px solid #aeb9b4;
  border-radius: 50%;
  background: #fff;
  transform: translateY(-50%);
}

.district-pick.selected {
  border-color: var(--green);
  background: #eef8f4;
  color: var(--green-deep);
}

.district-pick.selected::before {
  border-color: var(--green);
  background: var(--green);
}

.district-pick.focus {
  border-color: var(--teal);
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(31, 122, 92, 0.2);
}

.district-pick.focus::before {
  border-color: #fff;
  background: #fff;
}

.district-table-panel {
  overflow: hidden;
}

.submarket-panel {
  position: sticky;
  top: 88px;
}

.district-table {
  display: grid;
  gap: 2px;
}

.district-table-head,
.district-table-row {
  display: grid;
  grid-template-columns: 42px 92px minmax(180px, 1fr) 92px minmax(180px, 1.25fr);
  gap: 12px;
  align-items: center;
}

.district-table-head {
  padding: 0 12px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.district-table-row {
  min-height: 64px;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: #f7fbfa;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.district-table-row:hover,
.district-table-row.active {
  border-color: rgba(31, 122, 92, 0.32);
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(18, 42, 55, 0.08);
}

.district-table-row.active .rank-badge {
  background: var(--green);
  color: #ffffff;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(35, 103, 209, 0.1);
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.district-main-name {
  font-weight: 900;
}

.district-tier {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.district-price-cell {
  min-width: 0;
}

.district-price-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 900;
}

.bar-track {
  height: 9px;
  border-radius: 999px;
  background: #e5ebe2;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--green), var(--teal), var(--gold));
}

.change-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 72px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(31, 122, 92, 0.1);
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.change-pill.down {
  background: rgba(181, 82, 70, 0.1);
  color: var(--red);
}

.district-driver-cell {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.district-readout {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 18px;
  margin-top: 18px;
}

.district-note p {
  color: var(--muted);
}

.panel-head.compact {
  margin-bottom: 12px;
}

.submarket-list {
  display: grid;
  gap: 10px;
}

.district-focus-card {
  padding: 16px;
  border: 1px solid rgba(31, 122, 92, 0.18);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, #edf8f4);
}

.district-focus-card strong {
  display: block;
  margin-top: 4px;
  color: var(--green-deep);
  font-size: 24px;
  line-height: 1.1;
}

.district-focus-card p,
.district-focus-card small {
  display: block;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.district-focus-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.submarket-row {
  display: grid;
  grid-template-columns: 72px minmax(80px, 1fr);
  gap: 6px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.submarket-row + .submarket-row {
  margin-top: 8px;
}

.submarket-row:last-child {
  border-bottom: 1px solid var(--line);
}

.submarket-meta {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.submarket-area,
.submarket-change {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.submarket-name {
  font-weight: 900;
}

.submarket-price {
  color: var(--ink);
  text-align: left;
  font-weight: 900;
}

.submarket-change {
  text-align: right;
}

.market-news {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.market-news li {
  color: var(--muted);
}

.market-news strong {
  color: var(--ink);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-row span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff7e7;
  color: var(--green-deep);
  font-size: 13px;
  font-weight: 800;
}

.forecast {
  background:
    linear-gradient(180deg, #effbf7, #fff9ed);
}

.forecast-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(0, 1.5fr);
  gap: 18px;
  align-items: stretch;
}

.forecast-model {
  box-shadow: none;
  background: linear-gradient(180deg, #ffffff, #f1fbf7);
}

.model-kicker {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.forecast-model p {
  color: var(--muted);
}

.model-weight {
  margin: 22px 0;
  padding: 16px;
  border: 1px solid rgba(31, 122, 92, 0.18);
  border-radius: 8px;
  background: rgba(21, 163, 111, 0.08);
}

.model-weight span {
  display: block;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.model-weight strong {
  display: block;
  margin: 3px 0 6px;
  font-size: 20px;
}

.model-weight p {
  margin-bottom: 0;
  font-size: 13px;
}

.signal-stack {
  display: grid;
  gap: 8px;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

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

.signal-row strong {
  color: var(--ink);
  text-align: right;
}

.scenario-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario {
  display: grid;
  grid-template-rows: auto minmax(150px, auto) auto 1fr;
  align-content: stretch;
  min-height: 430px;
  padding: 20px;
  box-shadow: none;
  background: linear-gradient(180deg, #ffffff, #fbfefd);
}

.scenario-label {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.scenario-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 34px;
  margin-bottom: 12px;
}

.scenario-body {
  display: grid;
  align-content: start;
}

.scenario-body h3 {
  min-height: 52px;
  margin-bottom: 10px;
}

.scenario p,
.signal p,
.risk-note {
  color: var(--muted);
}

.scenario p {
  font-size: 14px;
  line-height: 1.55;
}

.scenario-weight {
  display: grid;
  gap: 8px;
  margin: 16px 0 0;
  padding: 12px 0 14px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.scenario-weight span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.scenario-detail {
  display: grid;
  gap: 10px;
  align-content: start;
  margin: 14px 0 0;
}

.scenario-detail div {
  min-height: 78px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.scenario-detail dt {
  margin-bottom: 3px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.scenario-detail dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

meter {
  width: 100%;
  height: 12px;
  margin: 0;
}

.probability {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(242, 109, 79, 0.12);
  color: #9c3523;
  font-size: 14px;
  font-weight: 900;
}

.forecast-method-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.evidence-panel {
  margin-top: 18px;
  box-shadow: none;
}

.evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.evidence-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfa;
}

.evidence-card h4 {
  margin: 0;
  font-size: 15px;
}

.evidence-card p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.evidence-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  grid-column: 1 / -1;
}

.evidence-meta span,
.evidence-impact {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.evidence-meta span {
  background: #fff;
  color: var(--muted);
}

.evidence-impact {
  align-self: start;
  background: rgba(31, 122, 92, 0.1);
  color: var(--green);
}

.evidence-impact.watch {
  background: rgba(187, 138, 46, 0.14);
  color: var(--gold);
}

.evidence-impact.risk {
  background: rgba(181, 82, 70, 0.11);
  color: var(--red);
}

.method-chip {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.method-chip span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.method-chip strong {
  display: block;
  margin-top: 4px;
}

.method-chip p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.risk-note {
  max-width: 860px;
  margin: 20px 0 0;
  font-size: 14px;
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.signal {
  padding: 22px;
}

.signal span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: rgba(35, 103, 209, 0.1);
  color: var(--blue);
  font-weight: 900;
}

.source-list {
  display: grid;
  gap: 10px;
}

.source-list a {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--green-deep);
  font-weight: 800;
}

.source-list a:hover {
  border-color: rgba(21, 163, 111, 0.45);
  background: #f6fffb;
}

.source-health {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 18px;
}

.weekly-update-block {
  margin-top: 28px;
  padding: 22px;
  border: 1px solid rgba(21, 163, 111, 0.24);
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(21, 163, 111, 0.08), rgba(255, 255, 255, 0.92));
}

.weekly-update-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 16px;
}

.weekly-update-heading span {
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.weekly-update-heading h3 {
  margin-top: 4px;
  color: var(--ink);
  font-size: 24px;
}

.weekly-update-heading p {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
}

.weekly-update-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.weekly-update-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
}

.weekly-update-card span {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.weekly-update-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 17px;
}

.weekly-update-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.source-health-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.source-health-card span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.source-health-card strong {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 18px;
}

.source-health-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px 6vw;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 980px) {
  .metrics-band,
  .scenario-grid,
  .signal-grid,
  .source-health {
    grid-template-columns: repeat(2, 1fr);
  }

  .dashboard-grid,
  .district-analysis-grid,
  .district-readout,
  .forecast-shell {
    grid-template-columns: 1fr;
  }

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

  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .weekly-update-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .scenario-grid {
    grid-template-columns: 1fr;
  }

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

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

  .district-table-panel {
    overflow-x: auto;
  }

  .district-table {
    min-width: 760px;
  }
}

@media (max-width: 680px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
    padding-top: 14px;
    padding-bottom: 12px;
  }

  .nav {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .hero {
    min-height: calc(100vh - 118px);
    padding-bottom: 7vh;
  }

  .metrics-band,
  .scenario-grid,
  .signal-grid,
  .source-health {
    grid-template-columns: 1fr;
  }

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

  .metric-card {
    padding: 24px 6vw;
  }

  .section {
    padding: 64px 6vw;
  }

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

  .chart-controls {
    justify-content: flex-start;
    width: 100%;
  }

  .range-control,
  .segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  .district-tools {
    width: 100%;
    overflow-x: auto;
    grid-template-columns: repeat(3, max-content);
  }

  .district-picker {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(72px, max-content);
    grid-template-columns: none;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  .district-pick {
    white-space: nowrap;
  }

  .district-sort {
    white-space: nowrap;
  }

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

  .submarket-row {
    grid-template-columns: 64px 1fr;
  }
}
