@import url("https://fonts.googleapis.com/css2?family=Geist:wght@400;500;700;800;900&display=swap");

:root {
  --page: #fbf7ef;
  --surface: #ffffff;
  --surface-mint: #eef8e7;
  --surface-soft: #f5f1e8;
  --surface-warm: #f8f4ea;
  --text: #141414;
  --text-muted: #5c5c5c;
  --line: rgba(20, 20, 20, 0.12);
  --line-strong: rgba(20, 20, 20, 0.2);
  --green: #9fe870;
  --green-dark: #163300;
  --green-deep: #0f5d3a;
  --danger: #d03238;
  --radius-8: 8px;
  --radius-16: 16px;
  --radius-24: 24px;
  --radius-32: 32px;
  --radius-40: 40px;
  --space-4: 4px;
  --space-8: 8px;
  --space-12: 12px;
  --space-16: 16px;
  --space-20: 20px;
  --space-24: 24px;
  --space-28: 28px;
  --space-32: 32px;
  --space-40: 40px;
  --space-48: 48px;
  --space-56: 56px;
  --shadow: 0 24px 48px rgba(20, 20, 20, 0.08);
  --ring: 0 0 0 1px rgba(20, 20, 20, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(159, 232, 112, 0.22), transparent 32%),
    radial-gradient(circle at bottom right, rgba(15, 93, 58, 0.08), transparent 24%),
    linear-gradient(180deg, #fbf7ef 0%, #f3eee2 100%);
  color: var(--text);
  font-family: "Geist", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  font-feature-settings: "calt" 1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

svg {
  display: block;
}

.page {
  max-width: 1240px;
  margin: 0 auto;
  padding: var(--space-20) var(--space-20) var(--space-48);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-20);
  padding: var(--space-12) var(--space-16);
  background: rgba(251, 247, 239, 0.9);
  backdrop-filter: blur(24px);
  border: 1px solid rgba(20, 20, 20, 0.08);
  border-radius: var(--radius-24);
  box-shadow: var(--ring);
}

.topbar--overview {
  padding-top: var(--space-12);
  padding-bottom: var(--space-12);
}

.topbar--overview .topnav {
  margin-left: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-8);
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-40);
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--green-dark);
  font-size: 20px;
  font-weight: 800;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.brand-kicker,
.eyebrow,
.section-index,
.stage-kicker,
.kpi-label,
.metric-context-title,
.plan-note-title,
.plan-chip,
.summary-pill,
.status-pill,
.donut-label,
.page-link-kicker,
.signal-label,
th {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-kicker,
.section-index,
.stage-kicker,
.kpi-label,
.metric-context-title,
.plan-note-title,
.donut-label,
.signal-label,
th {
  color: var(--text-muted);
}

.brand-title {
  font-size: 16px;
  font-weight: 700;
}

.topnav,
.action-stack,
.hero-actions,
.hero-meta,
.summary-pill-row,
.plan-chip-row,
.legend-row,
.page-link-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.topnav {
  justify-content: center;
}

.nav-pill,
.action-pill,
.status-pill,
.summary-pill,
.plan-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  border-radius: var(--radius-40);
  text-decoration: none;
}

.nav-pill {
  min-height: 36px;
  padding: 0 var(--space-12);
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
  font-size: 14px;
  font-weight: 500;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease;
}

.nav-pill:hover,
.action-pill:hover,
.page-link-card:hover,
.quick-link-card:hover {
  transform: translateY(-2px);
}

.nav-pill.active {
  background: var(--green);
  color: var(--green-dark);
}

.action-pill {
  min-height: 40px;
  padding: 0 var(--space-16);
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
}

.action-pill.primary {
  background: var(--green);
  color: var(--green-dark);
}

.action-pill.secondary {
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.hero-panel--dark .action-pill.secondary {
  background: rgba(255, 255, 255, 0.14);
  color: #f5f7f2;
  border-color: rgba(255, 255, 255, 0.12);
}

.action-pill.disabled {
  opacity: 0.6;
  pointer-events: none;
}

.status-pill,
.summary-pill,
.plan-chip {
  padding: var(--space-8) var(--space-12);
  border: 1px solid rgba(20, 20, 20, 0.08);
  background: rgba(255, 255, 255, 0.72);
}

.hero,
.hero-grid,
.two-col,
.plan-hero,
.plan-card-grid {
  display: grid;
  gap: var(--space-20);
}

.hero,
.hero-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  margin-bottom: var(--space-20);
}

.two-col,
.plan-hero,
.plan-card-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.hero-panel,
.section-card,
.stat-card,
.stage,
.table-card,
.plan-banner,
.plan-card,
.page-link-card {
  background: var(--surface);
  border-radius: var(--radius-24);
  box-shadow: var(--ring), var(--shadow);
}

.hero-panel,
.section-card,
.stage,
.table-card,
.plan-card,
.plan-banner {
  padding: var(--space-20);
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::before {
  content: "";
  position: absolute;
  inset: auto -40px -72px auto;
  width: 176px;
  height: 176px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(159, 232, 112, 0.4), rgba(159, 232, 112, 0));
  pointer-events: none;
}

.hero-panel--dark {
  background: linear-gradient(140deg, #141414 0%, #173320 100%);
  color: #f5f7f2;
}

.overview-hero-panel .hero-copy h1 {
  font-size: clamp(36px, 5.5vw, 60px);
}

.hero-panel--dark .eyebrow,
.hero-panel--dark .hero-copy p,
.hero-panel--dark .section-note,
.hero-panel--dark .status-pill,
.hero-panel--dark .status-pill span {
  color: rgba(245, 247, 242, 0.84);
}

.hero-panel--dark .status-pill {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.12);
}

/* Force-refresh button — resets <button> defaults, inherits pill look */
.status-pill--refresh {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: background 200ms, color 200ms, opacity 200ms, transform 180ms ease;
}

.status-pill--refresh:hover:not(:disabled) {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
}

.status-pill--refresh:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
}

.status-pill--refresh.loading {
  background: rgba(255, 255, 255, 0.22);
  animation: pill-pulse 1s ease-in-out infinite;
}

.status-pill--refresh.success {
  background: rgba(159, 232, 112, 0.22);
  color: #9fe870;
  border-color: rgba(159, 232, 112, 0.3);
}

.status-pill--refresh.error {
  background: rgba(255, 100, 80, 0.18);
  color: #ffb3a3;
  border-color: rgba(255, 100, 80, 0.25);
}

@keyframes pill-pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.hero-copy h1,
.section-title,
.stage-title,
.page-link-title,
.plan-title,
.plan-card-title,
.donut-value,
.ledger-banner-title {
  margin: var(--space-12) 0 0;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-copy h1 {
  font-size: clamp(32px, 4.6vw, 48px);
  line-height: 0.96;
}

.hero-copy .accent {
  color: var(--green);
}

.hero-copy p,
.section-note,
.page-link-copy,
.plan-copy,
.plan-card-copy,
.review-copy,
.stage-subtitle,
.footer-note,
.quick-link-copy,
.overview-fact-copy,
.signal-copy,
.quick-link-meta,
.table-subtext,
.metric-context,
.plan-table td span,
.plan-kpi-table td span {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-muted);
  line-height: 1.5;
}

.hero-highlight {
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-mint) 100%);
}

.overview-hub-panel {
  display: grid;
  align-content: start;
}

.highlight-value {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.04;
  letter-spacing: -0.04em;
  font-weight: 900;
}

.highlight-grid,
.stat-grid,
.mini-grid,
.review-grid,
.plan-visual-grid {
  display: grid;
  gap: var(--space-12);
}

.highlight-grid,
.mini-grid,
.plan-visual-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-card {
  padding: var(--space-16);
  background: linear-gradient(180deg, #ffffff 0%, #f8f5ee 100%);
  border-radius: var(--radius-16);
}

.stat-card.featured {
  background: linear-gradient(180deg, #141414 0%, #193622 100%);
  color: #f5f7f2;
}

.stat-card.featured .kpi-label,
.stat-card.featured .metric-context,
.stat-card.featured .delta {
  color: rgba(245, 247, 242, 0.84);
}

.stat-value,
.metric-emphasis,
.bar-value,
.meter-value,
.ledger-total,
.plan-table .strong-number,
.plan-kpi-table strong,
.chart-total {
  font-size: clamp(24px, 2.8vw, 32px);
  line-height: 0.96;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.delta {
  margin-top: var(--space-8);
  min-height: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.positive {
  color: var(--green-deep);
}

.negative {
  color: var(--danger);
}

.section-card {
  margin-bottom: var(--space-16);
}

.section-head,
.stage-head,
.chart-header-line,
.ledger-banner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-16);
}

.section-title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1;
}

.page-link-grid,
.deck-grid {
  display: grid;
  gap: var(--space-12);
}

.page-link-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.page-link-card {
  display: grid;
  align-content: start;
  gap: var(--space-8);
  min-height: 200px;
  padding: var(--space-16);
  border-radius: var(--radius-16);
  text-decoration: none;
}

.page-link-card.dark {
  background: linear-gradient(140deg, #141414 0%, #173320 100%);
  color: #f5f7f2;
}

.page-link-card.dark .page-link-copy,
.page-link-card.dark .page-link-meta,
.page-link-card.dark .page-link-kicker {
  color: rgba(245, 247, 242, 0.84);
}

.page-link-title,
.quick-link-title {
  font-size: 20px;
  line-height: 1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.page-link-copy,
.quick-link-copy {
  margin: 0;
}

.page-link-meta,
.quick-link-meta {
  margin-top: auto;
  font-size: 14px;
  font-weight: 500;
}

.overview-link-stack,
.overview-fact-list,
.overview-signal-grid {
  display: grid;
  gap: var(--space-8);
}

.overview-link-stack,
.overview-fact-list {
  margin-top: var(--space-12);
}

.quick-link-card,
.signal-card,
.overview-fact-row,
.mini-card,
.review-column,
.meter-card,
.plan-note-item,
.table-wrap,
.plan-card {
  border-radius: var(--radius-16);
}

.quick-link-card,
.mini-card,
.signal-card,
.plan-note-item,
.overview-fact-row,
.meter-card {
  background: var(--surface-warm);
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.08);
}

.quick-link-card {
  display: grid;
  gap: var(--space-8);
  padding: var(--space-12) var(--space-16);
  text-decoration: none;
  transition: transform 180ms ease, background 180ms ease;
}

.quick-link-card.dark {
  background: linear-gradient(140deg, #141414 0%, #173320 100%);
  color: #f5f7f2;
}

.quick-link-card.dark .quick-link-copy,
.quick-link-card.dark .quick-link-meta,
.quick-link-card.dark .page-link-kicker {
  color: rgba(245, 247, 242, 0.84);
}

.quick-link-head {
  display: flex;
  align-items: center;
  gap: var(--space-12);
}

.quick-link-copy-block {
  display: grid;
  gap: var(--space-4);
}

.ui-icon-bound {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-16);
  display: grid;
  place-items: center;
  flex: none;
  background: rgba(20, 20, 20, 0.06);
  color: var(--text);
}

.quick-link-card.dark .ui-icon-bound,
.hero-panel--dark .ui-icon-bound {
  background: rgba(255, 255, 255, 0.14);
  color: #f5f7f2;
}

.ui-icon {
  width: 20px;
  height: 20px;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.overview-fact-row,
.mini-card,
.signal-card,
.meter-card,
.plan-note-item {
  padding: var(--space-12);
}

.overview-fact-top,
.meter-top,
.bar-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-12);
}

.overview-fact-value {
  font-size: 20px;
  line-height: 1.1;
  font-weight: 700;
  text-align: right;
}

.overview-fact-copy {
  margin-top: var(--space-8);
}

.overview-quick-read {
  align-items: start;
}

.overview-signal-grid {
  grid-template-columns: 1fr;
}

.signal-card.attention {
  background: linear-gradient(180deg, #fff8e7 0%, #f5ebd0 100%);
}

.signal-copy {
  margin: var(--space-8) 0 var(--space-12);
  color: var(--text);
}

.signal-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-8);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  color: var(--green-deep);
}

.signal-link::after {
  content: "›";
  font-size: 20px;
  line-height: 1;
}

.review-column,
.table-wrap,
.plan-card {
  background: var(--surface-soft);
}

.deck-grid {
  grid-template-columns: repeat(12, minmax(0, 1fr));
}

.stage {
  min-height: 216px;
}

.stage.wide {
  grid-column: span 8;
}

.stage.medium {
  grid-column: span 7;
}

.stage.narrow {
  grid-column: span 4;
}

.chart-shell {
  min-height: 208px;
}

.chart-svg {
  width: 100%;
  height: 160px;
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  gap: var(--space-8);
  margin-top: var(--space-8);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

.bar-stack,
.meter-stack,
.review-grid,
.plan-note-list {
  display: grid;
  gap: var(--space-16);
}

.meter-label,
.bar-label {
  font-size: 14px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.meter-value,
.bar-value {
  font-size: 20px;
}

.meter-track,
.bar-track {
  width: 100%;
  height: 12px;
  margin-top: var(--space-12);
  background: rgba(20, 20, 20, 0.08);
  border-radius: var(--radius-8);
  overflow: hidden;
}

.meter-fill,
.bar-fill {
  height: 100%;
  border-radius: var(--radius-8);
  background: linear-gradient(90deg, var(--green) 0%, #71c944 100%);
}

.review-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.review-column:nth-child(2) {
  background: linear-gradient(180deg, #ffffff 0%, #eef8e7 100%);
}

.review-column:nth-child(3) {
  background: linear-gradient(180deg, #141414 0%, #173320 100%);
  color: #f5f7f2;
}

.review-column:nth-child(3) .review-title,
.review-column:nth-child(3) li,
.review-column:nth-child(3) .review-copy {
  color: #f5f7f2;
}

.review-title {
  margin: 0 0 var(--space-12);
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.review-copy {
  margin: 0 0 var(--space-12);
}

.review-column ul {
  margin: 0;
  padding-left: var(--space-20);
}

.review-column li + li {
  margin-top: var(--space-8);
}

.table-wrap,
.plan-card {
  overflow: hidden;
}

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

.ledger-banner,
.plan-banner {
  align-items: center;
  padding: var(--space-16) var(--space-20);
}

.ledger-banner {
  display: flex;
  justify-content: space-between;
  gap: var(--space-16);
  margin-bottom: var(--space-12);
  background: linear-gradient(135deg, #0f5d3a 0%, #0d7a4a 100%);
  color: #ffffff;
  border-radius: var(--radius-16);
}

.ledger-banner-copy,
.plan-copy {
  color: rgba(255, 255, 255, 0.84);
}

.ledger-banner-title,
.plan-title {
  font-size: clamp(24px, 3vw, 32px);
  line-height: 0.96;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-16) var(--space-12);
  border-bottom: 1px solid rgba(20, 20, 20, 0.08);
  text-align: left;
  vertical-align: top;
}

.striped tbody tr:nth-child(odd) {
  background: rgba(223, 244, 209, 0.34);
}

.metric-name,
.plan-table td strong,
.plan-kpi-table td strong {
  font-weight: 700;
}

.metric-context,
.plan-table td span,
.plan-kpi-table td span,
.table-subtext {
  display: block;
  margin-top: var(--space-4);
  font-size: 14px;
}

.donut-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-16);
}

.donut-shell {
  position: relative;
  width: min(224px, 100%);
  aspect-ratio: 1;
  border-radius: 50%;
}

.donut-shell::after {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(20, 20, 20, 0.06);
}

.donut-center {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0 var(--space-40);
}

.donut-value {
  font-size: 24px;
}

.plan-month-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: var(--space-12);
  align-items: end;
  min-height: 224px;
}

.plan-month-column {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--space-8);
  min-height: 100%;
}

.plan-month-bar {
  width: 100%;
  min-height: 40px;
  border-radius: 16px 16px 8px 8px;
  background: linear-gradient(180deg, var(--green) 0%, #0f5d3a 100%);
}

.plan-month-label,
.plan-month-value {
  font-size: 14px;
}

.plan-month-label {
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
}

.plan-month-value {
  font-weight: 700;
}

.plan-total-row td {
  font-weight: 900;
  background: rgba(15, 93, 58, 0.1);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 144px;
  border-radius: var(--radius-16);
  background: var(--surface-soft);
  color: var(--text-muted);
  font-size: 16px;
  font-weight: 500;
}

.footer-note {
  margin-top: var(--space-24);
  text-align: center;
}

@media (max-width: 1180px) {
  .hero,
  .hero-grid,
  .two-col,
  .plan-hero,
  .plan-card-grid,
  .page-link-grid,
  .stat-grid,
  .review-grid,
  .highlight-grid,
  .mini-grid,
  .plan-visual-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hero,
  .hero-grid,
  .plan-hero,
  .plan-card-grid,
  .overview-quick-read {
    grid-template-columns: 1fr;
  }

  .stage.wide,
  .stage.medium,
  .stage.narrow {
    grid-column: span 12;
  }
}

@media (max-width: 860px) {
  .topbar,
  .section-head,
  .stage-head,
  .chart-header-line,
  .ledger-banner,
  .overview-fact-top,
  .quick-link-head,
  .meter-top,
  .bar-top {
    flex-direction: column;
    align-items: flex-start;
  }

  .page {
    padding-left: var(--space-16);
    padding-right: var(--space-16);
  }

  .page-link-grid,
  .stat-grid,
  .review-grid,
  .highlight-grid,
  .mini-grid,
  .plan-visual-grid,
  .plan-month-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1,
  .overview-hero-panel .hero-copy h1 {
    font-size: clamp(32px, 10vw, 48px);
  }

  .section-card,
  .hero-panel,
  .stage,
  .table-card,
  .plan-card,
  .plan-banner {
    padding: var(--space-16);
  }
}