/* =========================================================
   Sabah Forestry Strategic Dashboard
   Design System — Modern Government Strategic Intelligence
   ========================================================= */

:root {
  /* Canvas & surfaces */
  --canvas: #f5f7f6;
  --surface: #ffffff;
  --surface-muted: #f8faf9;
  --border: #dde5e1;
  --border-strong: #c8d4ce;

  /* Brand */
  --primary-dark: #163f32;
  --primary: #245b47;
  --primary-mid: #39765c;
  --soft-green: #eaf2ee;
  --very-soft-green: #f3f7f5;

  /* Accent */
  --gold: #b79247;
  --soft-gold: #f6f0e3;

  /* Text */
  --text: #173b31;
  --text-secondary: #66756f;
  --text-muted: #89948f;

  /* Status */
  --success: #3f7d55;
  --warning: #c48a32;
  --danger: #b95757;
  --info: #4e7d91;

  /* Chart palette */
  --chart-primary: #2e6650;
  --chart-secondary: #7fa18f;
  --chart-tertiary: #b8cac0;
  --chart-highlight: #b79247;
  --chart-muted: #d4ddd8;

  /* Legacy aliases used in markup */
  --forest-deep: var(--primary-dark);
  --forest-mid: var(--primary);
  --forest-muted: var(--primary-mid);
  --forest-soft: var(--soft-green);

  /* Elevation & shape */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 2px 8px rgba(22, 63, 50, 0.06);
  --radius-control: 8px;
  --radius: 12px;
  --radius-lg: 14px;

  /* Type */
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --font-display: var(--font);
  --font-body: var(--font);

  /* Layout */
  --gutter: clamp(16px, 2.5vw, 48px);
  --max: none;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-7: 32px;
  --space-8: 40px;
  --space-9: 48px;
  --ease: ease;
  --duration: 180ms;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-y: scroll;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--canvas);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}

a:hover {
  color: var(--primary-dark);
}

.shell {
  width: 100%;
  max-width: none;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.shell--narrow {
  width: min(100%, 1520px);
}

/* ——— Global header ——— */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary-dark);
  color: #fff;
  transition: box-shadow var(--duration) var(--ease);
}

.site-header.is-scrolled {
  box-shadow: 0 4px 16px rgba(22, 63, 50, 0.18);
}

.site-header__bar {
  display: flex;
  align-items: center;
  padding: 14px 0 12px;
}

.site-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.site-header__logo {
  width: 42px;
  height: 42px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.site-header__eyebrow {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(246, 240, 227, 0.88);
  font-weight: 600;
  line-height: 1.2;
}

.site-header__title {
  margin: 2px 0 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: #fff;
}

.tab-nav-wrap {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.tab-nav-wrap .shell {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.tab-nav {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px 12px;
  margin: 0;
  padding: 10px 0 14px;
  list-style: none;
  width: max-content;
  min-width: 100%;
}

.tab-nav li {
  flex: 0 0 auto;
}

.tab-nav a {
  display: block;
  padding: 8px 14px;
  color: rgba(255, 255, 255, 0.8);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.01em;
  line-height: 1.25;
  white-space: nowrap;
  touch-action: manipulation;
  transition:
    background var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.tab-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.tab-nav a.is-active {
  background: #fff;
  color: var(--primary-dark);
  font-weight: 600;
}

/* ——— Nav lock / section preloader ——— */
html.is-nav-locked .tab-nav a,
html.is-nav-locked .sub-nav__list a {
  cursor: wait;
  opacity: 0.55;
}

html.is-nav-locked .tab-nav a.is-active,
html.is-nav-locked .sub-nav__list a.is-active {
  opacity: 1;
}

.nav-preloader {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 72px 16px 24px;
  background: rgba(245, 247, 246, 0.72);
  backdrop-filter: blur(2px);
}

.nav-preloader[hidden] {
  display: none !important;
}

.main {
  position: relative;
  padding: var(--space-5) 0;
}

.nav-preloader__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-width: 160px;
  padding: 20px 24px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(22, 63, 50, 0.08);
}

.nav-preloader__spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(22, 63, 50, 0.15);
  border-top-color: var(--primary);
  animation: nav-spin 0.7s linear infinite;
}

.nav-preloader__text {
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
}

@keyframes nav-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ——— Main & module header ——— */

.page-intro {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.page-intro h2 {
  margin: 0;
  font-size: clamp(26px, 2vw, 30px);
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.page-intro p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 52rem;
  line-height: 1.55;
}

.page-intro p.page-intro__wide {
  max-width: none;
}

.page-intro__glance {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  max-width: 52rem;
  background: var(--soft-green);
  border-left: 3px solid var(--primary);
  border-radius: 0 var(--radius-control) var(--radius-control) 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
}

.period-banner {
  margin: 0 0 var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--soft-gold);
  border: 1px solid #e5d9b8;
  border-radius: var(--radius-control);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  max-width: 52rem;
}

.period-banner strong {
  color: var(--primary-dark);
  font-weight: 600;
}

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

.main .shell > .section:last-child {
  margin-bottom: 0;
}

.section--tight {
  margin-bottom: var(--space-5);
}

.section__title {
  margin: 0 0 var(--space-3);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.section__note {
  margin: 0 0 var(--space-4);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

.section__note--after {
  margin-top: var(--space-6);
  margin-bottom: var(--space-6);
}

.section__title + .section__note,
.section__subtitle + .section__note {
  margin-top: 0;
}

.section__title:has(+ .chart-grid) {
  margin-bottom: var(--space-6);
}

.section__note:has(+ .chart-block),
.section__note:has(+ .chart-grid),
.section__note:has(+ .kpi-grid),
.section__note:has(+ .ppa-chart-row),
.section__note:has(+ .programme-card),
.section__note:has(+ .programme-grid),
.section__note:has(+ .timeline),
.section__note:has(+ .data-table-wrap),
.section__note:has(+ .insight-panel),
.section__note:has(+ .tag-list),
.section__note:has(+ .fsp-flow),
.section__note:has(+ .ppm-focus) {
  margin-bottom: var(--space-6);
}

.ppm-focus {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-6);
}

.ppm-focus__card {
  margin: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.ppm-statewide {
  margin-top: var(--space-6);
}

.ppm-statewide__label {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stack-gap {
  margin-top: var(--space-6);
}

.stack-gap--sm {
  margin-top: var(--space-3);
}

/* ——— Internal / segmented nav (FSP) ——— */
.sub-nav {
  margin: 0 0 var(--space-6);
  padding-block: var(--space-5);
  border-bottom: 1px solid var(--border);
}

.page-intro:has(+ .sub-nav) {
  margin-bottom: 0;
}

.sub-nav--sticky {
  position: sticky;
  top: 72px;
  z-index: 40;
  display: flex;
  align-items: center;
  min-height: 60px;
  margin-bottom: var(--space-5);
  padding: 0;
  background: var(--canvas);
  border-bottom: 1px solid var(--border);
}

.fsp-page .section,
.fsp-page .section__title {
  scroll-margin-top: 140px;
}

.fit-kpi-row {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: 1fr;
}

.fit-kpi-row .kpi-card {
  height: 100%;
}

@media (min-width: 800px) {
  .fit-kpi-row {
    grid-template-columns: repeat(6, 1fr);
  }

  .fit-kpi-row .kpi-card:nth-child(-n+3) {
    grid-column: span 2;
  }

  .fit-kpi-row .kpi-card:nth-child(n+4) {
    grid-column: span 3;
  }
}

.fit-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.fit-section-head .section__title,
.fit-section-head .section__note {
  margin-bottom: 0;
}

.fit-section-head .section__note {
  margin-top: var(--space-2);
}

.fit-year-toggle {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  margin: 0;
}

.fit-year-toggle .btn.is-selected {
  background: var(--primary);
  color: #fff !important;
  border-color: var(--primary);
}

.sub-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.sub-nav__list li {
  display: flex;
  align-items: center;
}

.sub-nav__list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  line-height: 1;
  border-radius: var(--radius-control);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  touch-action: manipulation;
  transition:
    background var(--duration) var(--ease),
    border-color var(--duration) var(--ease),
    color var(--duration) var(--ease);
}

.sub-nav__list a:hover {
  background: var(--soft-green);
  border-color: var(--border-strong);
  color: var(--primary-dark);
}

.sub-nav__list a.is-active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ——— Cards & KPI ——— */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: var(--space-6);
}

.kpi-grid--primary {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.kpi-grid--two,
.kpi-grid--three {
  grid-template-columns: 1fr;
}

.kpi-grid--four,
.kpi-grid--five {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.kpi-grid--narrow {
  max-width: 280px;
}

.frm-figures {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .frm-figures {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }
}

@media (min-width: 700px) {
  .kpi-grid--two,
  .kpi-grid--three {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1100px) {
  .kpi-grid--primary {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid--three {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid--four {
    grid-template-columns: repeat(4, 1fr);
  }

  .kpi-grid--five {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid--six {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1400px) {
  .kpi-grid--primary {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid--five {
    grid-template-columns: repeat(3, 1fr);
  }

  .kpi-grid--four {
    grid-template-columns: repeat(4, 1fr);
  }

  .kpi-grid--six {
    grid-template-columns: repeat(6, 1fr);
  }

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

.kpi-card,
.theme-card,
.dash-card,
.rnd-block,
.chart-block,
.forins-card,
.programme-card,
.context-card,
.pending-state,
.detail-section,
.rnd-item,
.timeline {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

a.kpi-card {
  display: block;
  color: inherit;
}

a.kpi-card:hover {
  color: inherit;
}

.kpi-card {
  padding: var(--space-5) var(--space-6);
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.kpi-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.kpi-card--optional {
  border-color: #e5d9b8;
  background: var(--soft-gold);
}

.kpi-card--secondary {
  background: var(--surface-muted);
  padding: var(--space-4) var(--space-5);
}

.kpi-card--secondary:hover {
  box-shadow: var(--shadow-sm);
}

.kpi-card--secondary .kpi-card__value,
.kpi-card__value,
.ppa-portfolio-card__metrics dd,
.dash-metric__value,
.ppa-stat strong,
.ppa-util-line__head strong {
  font-size: 28px;
}

.kpi-card__label {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.35;
}

.kpi-card__value {
  margin: var(--space-3) 0 var(--space-2);
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.1;
  letter-spacing: -0.03em;
}

.kpi-card__unit {
  margin-left: 6px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
}

.kpi-card__support {
  margin: 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.kpi-card__definition {
  margin: var(--space-2) 0 0;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}

.kpi-card__context {
  margin: 6px 0 0;
  color: var(--text-secondary);
  line-height: 1.4;
}

.kpi-card__context,
.section__note,
.chart-block__subtitle {
  font-size: 14px;
}

/* ——— Layout bands ——— */
.layout-split,
.layout-band {
  display: grid;
  gap: var(--space-6);
}

.kpi-grid.fsp-kpi-primary {
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .kpi-grid.fsp-kpi-primary {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .kpi-grid.fsp-kpi-primary .kpi-card:nth-child(-n+3) {
    grid-column: span 2;
  }

  .kpi-grid.fsp-kpi-primary .kpi-card:nth-child(n+4) {
    grid-column: span 3;
  }
}

@media (min-width: 1100px) {
  .layout-split {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }

  .layout-band {
    grid-template-columns: 1.35fr 1fr;
    align-items: stretch;
  }
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-5);
}

.theme-card {
  padding: var(--space-5);
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.theme-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.theme-card h3 {
  margin: 0 0 var(--space-2);
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.theme-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 15px;
  flex: 1;
  line-height: 1.55;
}

.theme-card__link {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.rnd-block {
  padding: var(--space-6);
  height: 100%;
}

.rnd-block__title {
  margin: 0 0 var(--space-2);
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.rnd-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-3);
  margin-top: var(--space-4);
}

.rnd-item {
  background: var(--soft-green);
  border: none;
  box-shadow: none;
  border-radius: var(--radius-control);
  padding: var(--space-4);
}

.rnd-item h4 {
  margin: 0 0 var(--space-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.rnd-item p {
  margin: 4px 0;
  font-size: 15px;
  color: var(--text-secondary);
}

.rnd-item strong {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
}

.rnd-item__period {
  color: var(--text-secondary);
  font-size: 13px !important;
  margin-top: var(--space-2) !important;
}

.rnd-actions {
  margin-top: var(--space-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--primary-dark);
  color: #fff !important;
  font-size: 13px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: background var(--duration) var(--ease);
}

.btn:hover {
  background: var(--primary);
}

.btn--ghost {
  background: var(--surface);
  color: var(--primary-dark) !important;
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  background: var(--soft-green);
}

/* ——— Charts ——— */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: stretch;
}

.chart-grid--start {
  align-items: start;
}

.chart-grid--start > div > .chart-block {
  margin-top: 0;
}

.chart-grid > div {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chart-grid > div > .chart-block {
  margin-top: auto;
}

.chart-grid > .chart-block {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  height: auto;
  margin-top: 0 !important;
}

.chart-grid--start > .chart-block {
  align-self: start;
}

.chart-grid.chart-grid--match {
  grid-auto-rows: 420px;
}

.eft-chart-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  align-items: stretch;
  margin-top: 24px;
  margin-bottom: 0;
}

.eft-chart-row > .chart-block {
  height: 460px !important;
  min-height: 460px !important;
  max-height: 460px !important;
  margin: 0 !important;
  overflow: hidden !important;
  display: flex !important;
  flex-direction: column !important;
}

.eft-chart-row .chart-block__canvas-wrap,
.eft-chart-row canvas {
  height: 300px !important;
  min-height: 300px !important;
  max-height: 300px !important;
  flex: 0 0 300px !important;
  overflow: hidden !important;
}

.eft-chart-follow {
  margin-top: 8px;
  clear: both;
}

@media (max-width: 800px) {
  .eft-chart-row {
    grid-template-columns: 1fr;
  }
}

.fit-flow-pair {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: stretch;
}

.fit-flow-pair > .chart-block {
  display: flex !important;
  flex-direction: column !important;
  height: 420px !important;
  min-height: 420px !important;
  max-height: 420px !important;
  margin: 0 !important;
  overflow: hidden !important;
  box-sizing: border-box;
}

.fit-flow-pair > .chart-block .chart-block__header {
  flex: 0 0 4.75rem;
  height: 4.75rem;
  min-height: 4.75rem;
  max-height: 4.75rem;
  margin: 0;
  overflow: hidden;
}

.fit-flow-pair > .chart-block .chart-block__canvas-wrap,
.fit-flow-pair > .chart-block canvas {
  flex: 0 0 280px !important;
  height: 280px !important;
  min-height: 280px !important;
  max-height: 280px !important;
}

.insight-grid--match {
  align-items: stretch;
}

.insight-grid--match > .insight-panel {
  height: 100%;
  min-height: 7.5rem;
}

@media (min-width: 900px) {
  .fit-flow-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-grid.chart-grid--match > .chart-block {
  height: 420px;
  min-height: 0;
  max-height: 420px;
  overflow: hidden;
}

.chart-grid--match > .chart-block .chart-block__header {
  flex: 0 0 4.75rem;
  height: 4.75rem;
  min-height: 0;
  max-height: 4.75rem;
  overflow: hidden;
}

.chart-grid.chart-grid--match > .chart-block .chart-block__canvas-wrap {
  flex: 0 0 280px;
  height: 280px;
  min-height: 0;
  max-height: 280px;
  overflow: hidden;
}

.chart-grid.chart-grid--match > .chart-block canvas {
  width: 100% !important;
  height: 280px !important;
  max-height: 280px !important;
}

@media (min-width: 900px) {
  .chart-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-7);
  }

  .chart-grid--triple {
    grid-template-columns: repeat(3, 1fr);
  }
}

.kpi-grid + .chart-grid,
.chart-grid + .chart-grid,
.chart-grid + .chart-block,
.chart-block + .chart-block,
.chart-block + .data-table-wrap,
.chart-block + .tag-list,
.chart-block + .programme-grid,
.insight-panel + .chart-block,
.kpi-grid + .section__note,
.kpi-grid + .programme-card,
.kpi-grid + .tag-list,
.tag-list + [data-fsp-register],
.programme-card + .tag-list,
.programme-grid + .tag-list,
.timeline + .programme-grid,
.data-table-wrap + .tag-list,
.chart-grid + .stack-gap,
.stack-gap + .chart-grid,
.section > .kpi-grid + *,
.section > .chart-block + *,
.section > .programme-card + *,
.section > .programme-grid + *,
.section > .data-table-wrap + *,
.section > .insight-panel + *,
.section > .timeline + *,
.section > .tag-list + *,
.section > .ppm-focus + *,
.section > .layout-split + *,
.section > .eft-chart-row + *,
.section > .eft-chart-follow + *,
.section > .kpi-grid + .fsp-flow,
.chart-grid + ol.fpp-notes {
  margin-top: var(--space-6);
}

.chart-grid > .chart-block:only-child {
  grid-column: 1 / -1;
}

.chart-grid + .chart-grid,
.chart-grid + .data-table-wrap,
.section > .data-table-wrap + .chart-grid {
  margin-top: var(--space-7);
}

.fpp-register + .chart-grid {
  margin-top: var(--space-9);
}

.fpp-follow {
  padding-top: var(--space-8);
}

.chart-block {
  padding: var(--space-5);
  min-width: 0;
}

.chart-block--wide,
.chart-block--fluid {
  grid-column: 1 / -1;
}

.chart-grid--equal {
  align-items: stretch;
}

@media (min-width: 900px) {
  .chart-grid--equal {
    grid-template-rows: 520px;
  }
}

.chart-grid--equal > .chart-block {
  box-sizing: border-box;
  height: 520px !important;
  min-height: 520px !important;
  max-height: 520px !important;
  margin-top: 0 !important;
  overflow: hidden;
}

.chart-grid--equal > .chart-block .chart-block__header {
  flex: 0 0 5.5rem;
  height: 5.5rem;
  min-height: 5.5rem;
  max-height: 5.5rem;
  overflow: hidden;
}

.chart-grid--equal > .chart-block .chart-block__canvas-wrap {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
  max-height: none;
}

.chart-block__header {
  margin-bottom: var(--space-3);
}

.chart-block__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.chart-block__subtitle {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.45;
}

.chart-block__canvas-wrap {
  position: relative;
  height: 300px;
}

.chart-block__canvas-wrap canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.chart-block--tall .chart-block__canvas-wrap {
  height: 380px;
}

.chart-block--roles .chart-block__canvas-wrap {
  height: 640px;
}

.chart-block--short .chart-block__canvas-wrap {
  height: 240px;
}

.chart-block--strip .chart-block__canvas-wrap {
  height: 160px;
}

.chart-block--callout .chart-block__canvas-wrap {
  height: 360px;
}

.chart-block--fluid .chart-block__canvas-wrap {
  height: 420px;
}

.spp-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
  margin-bottom: var(--space-6);
}

.spp-metrics .insight-panel {
  margin: 0;
  padding: var(--space-5) var(--space-6);
}

@media (min-width: 800px) {
  .spp-metrics {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-6);
  }
}

.spp-rhk-chart .chart-block__canvas-wrap {
  height: 520px;
}

#spp-register-section .sfm-filters {
  margin-bottom: var(--space-4);
}

.spp-carousel__viewport {
  overflow: hidden;
}

.spp-carousel__track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  transition: transform 0.35s ease;
}

.spp-carousel__slide {
  flex: 0 0 100%;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  min-width: 0;
}

.spp-entity-card {
  margin: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.spp-entity-card__name {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}

.spp-entity-card__count {
  margin: var(--space-3) 0 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
  color: var(--primary-dark);
}

.spp-entity-card__meta {
  display: flex;
  justify-content: space-between;
  margin: var(--space-4) 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.spp-entity-card--zero .spp-entity-card__count {
  color: var(--text-muted);
}

.spp-carousel__bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.spp-carousel__btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--primary-dark);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.spp-carousel__btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.spp-carousel__status {
  margin: 0;
  min-width: 3.5rem;
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

/* ——— Insights ——— */
.insight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.insight-panel {
  background: var(--soft-green);
  border: 1px solid var(--border);
  border-left: 3px solid var(--primary-mid);
  border-radius: var(--radius-control);
  padding: var(--space-4) var(--space-5);
  box-shadow: none;
}

.insight-panel__title {
  margin: 0 0 var(--space-2);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--primary);
  font-weight: 700;
}

.insight-panel__text {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  line-height: 1.55;
}

.footnote {
  margin: var(--space-3) 0 0;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.context-card {
  padding: var(--space-5) var(--space-6);
  margin-bottom: var(--space-5);
}

.context-card strong {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.context-card p {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  max-width: 54rem;
  line-height: 1.5;
}

.detail-section {
  background: var(--surface-muted);
  padding: var(--space-5);
}

.detail-section h3 {
  margin: 0 0 var(--space-2);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.detail-section p {
  margin: 0 0 var(--space-4);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.staff-history {
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: 13px;
  color: var(--text-secondary);
}

.staff-history strong {
  color: var(--text);
}

/* ——— Status / badges ——— */
.badge,
.pending-state__badge,
.programme-card__badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.badge--gold,
.pending-state__badge {
  background: var(--soft-gold);
  color: #7a6218;
}

.pending-state {
  padding: var(--space-8) var(--space-7);
  width: 100%;
}

.pending-state h2 {
  margin: var(--space-4) 0 var(--space-3);
  font-size: clamp(24px, 2vw, 28px);
  font-weight: 700;
  color: var(--text);
}

.pending-state p {
  margin: 0;
  max-width: 44rem;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.pending-state p + p {
  margin-top: var(--space-3);
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: var(--space-4) 0 var(--space-5);
  color: var(--text-muted);
  font-size: 12px;
}

/* ——— Programme / project cards (FSP) ——— */
.programme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-6);
  align-items: stretch;
}

.programme-grid--uniform {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.programme-grid--pair {
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .programme-grid--pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.economy-centres {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  padding: var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

@media (min-width: 800px) {
  .economy-centres {
    grid-template-columns: 260px minmax(0, 1fr);
    align-items: center;
  }
}

.economy-centres__stat .kpi-card__value {
  margin: 8px 0;
  font-size: 40px;
  line-height: 1;
  color: var(--primary-dark);
}

.economy-centres__stat .kpi-card__context {
  margin: 0;
}

.economy-centres__group + .economy-centres__group {
  margin-top: var(--space-5);
}

.economy-centres__label {
  margin: 0 0 var(--space-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.climate-panel {
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.climate-panel__purpose {
  margin: 0 0 var(--space-5);
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.climate-panel .fsp-flow {
  margin: 0;
}

.climate-panel .fsp-flow li {
  margin-bottom: 0;
}

.climate-facts .programme-card {
  min-height: 0;
}

.programme-grid--dense {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ——— Overview Strategic Themes + R&D dash cards ——— */
.programme-grid.programme-grid--themes {
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

.programme-grid.programme-grid--rnd {
  grid-template-columns: 1fr;
  gap: 16px;
  align-items: stretch;
}

@media (min-width: 700px) {
  .programme-grid.programme-grid--themes {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 1100px) {
  .programme-grid.programme-grid--themes {
    grid-template-columns: repeat(3, 1fr);
  }
}

.dash-card {
  padding: 20px 18px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0;
  transition:
    border-color var(--duration) var(--ease),
    box-shadow var(--duration) var(--ease);
}

.dash-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.dash-card__title {
  margin: 0 0 16px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
  min-height: 1.3em;
}

/* Shared KPI row: equal columns on one level */
.dash-card__metrics {
  display: grid;
  gap: 0;
  align-items: start;
  flex: 1;
}

.dash-card--cols-1 .dash-card__metrics {
  grid-template-columns: 1fr;
}

.dash-card--cols-2 .dash-card__metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dash-card--cols-3 .dash-card__metrics {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dash-metric {
  min-width: 0;
}

.dash-card--cols-2 .dash-metric + .dash-metric,
.dash-card--cols-3 .dash-metric + .dash-metric {
  padding-left: 16px;
  margin-left: 16px;
  border-left: 1px solid var(--border);
}

.dash-metric__value {
  margin: 0;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
  word-break: normal;
}

.dash-metric__unit {
  margin-left: 5px;
  font-size: 0.65em;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0;
  white-space: nowrap;
}

.dash-metric__label {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.dash-metric__support,
.dash-metric__period,
.dash-card__period {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

.dash-card__period {
  margin-top: 12px;
}

.dash-card__link {
  display: inline-block;
  margin-top: auto;
  padding-top: 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}

.dash-card__link:hover {
  color: var(--primary-dark);
}

/* Stack KPI columns only on narrow screens */
@media (max-width: 699px) {
  .dash-card--cols-2 .dash-card__metrics,
  .dash-card--cols-3 .dash-card__metrics {
    grid-template-columns: 1fr;
    row-gap: 14px;
  }

  .dash-card--cols-2 .dash-metric + .dash-metric,
  .dash-card--cols-3 .dash-metric + .dash-metric {
    padding-left: 0;
    margin-left: 0;
    border-left: none;
    padding-top: 14px;
    border-top: 1px solid var(--border);
  }
}

.programme-card {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  height: 100%;
  min-height: 220px;
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.programme-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.programme-card__header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-3);
}

.programme-card__heading {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  min-width: 0;
}

.programme-card__badge {
  flex: 0 0 auto;
  margin-left: auto;
}

.programme-card__title {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.programme-card__meta {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.4;
}

.programme-card__list {
  margin: 0;
  padding-left: 18px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.45;
  flex: 1 1 auto;
}

.programme-card__footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.programme-card__note {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-control);
  background: var(--soft-gold);
  border: 1px solid #e5d9b8;
  color: #5c4a14;
  font-size: 13px;
  line-height: 1.45;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--soft-green);
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}

.tag--muted {
  background: var(--surface-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

/* ——— Timeline ——— */
.timeline {
  padding: var(--space-5) var(--space-6) var(--space-4);
}

.timeline__row {
  display: grid;
  grid-template-columns: minmax(160px, 220px) 1fr;
  gap: var(--space-4);
  align-items: center;
  margin-bottom: var(--space-4);
}

.timeline__label {
  display: grid;
  gap: 2px;
}

.timeline__label strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
}

.timeline__label span {
  font-size: 12px;
  color: var(--text-muted);
}

.timeline__track {
  position: relative;
  height: 28px;
  background: var(--very-soft-green);
  border-radius: var(--radius-control);
  overflow: hidden;
  border: 1px solid var(--border);
}

.timeline__bar {
  position: absolute;
  top: 5px;
  bottom: 5px;
  border-radius: 6px;
  background: var(--chart-primary);
  min-width: 12px;
}

.timeline__axis {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-2);
  padding-left: calc(min(220px, 100%) + var(--space-4));
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

/* ——— Tables (shared) ——— */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.data-table th,
.data-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.data-table th {
  background: var(--soft-green);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: bottom;
}

.data-table--years {
  min-width: 960px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table--years th,
.data-table--years td {
  border-bottom-color: var(--border-strong);
  border-left: 1px solid var(--border-strong);
  border-right: none;
  text-align: center;
  vertical-align: middle;
}

.data-table--years thead tr:first-child th:first-child,
.data-table--years tbody td:first-child {
  border-left: none;
}

.data-table--years thead th {
  text-transform: none;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: center;
  vertical-align: middle;
  padding: 10px 16px;
}

.data-table--years thead tr:first-child th[colspan] {
  font-size: 13px;
  border-bottom-color: var(--border-strong);
  border-left: 1px solid var(--border-strong);
}

.data-table--years thead tr:last-child th {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  padding-top: 8px;
  padding-bottom: 10px;
  border-left: 1px solid var(--border-strong);
}

.data-table--years td:nth-child(1) {
  width: 3.5rem;
  text-align: center;
}

.data-table--years td:nth-child(3),
.data-table--years td:nth-child(5),
.data-table--years td:nth-child(7) {
  width: 5.5rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.data-table--years td:nth-child(4),
.data-table--years td:nth-child(6),
.data-table--years td:nth-child(8) {
  min-width: 7rem;
}

.data-table td.is-num,
.data-table th.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table--rate {
  table-layout: fixed;
}

.data-table--rate th:last-child,
.data-table--rate td:last-child {
  width: 9.5rem;
}

.data-table--trade {
  table-layout: fixed;
}

.data-table--trade th:nth-child(2),
.data-table--trade td:nth-child(2) {
  width: 11rem;
}

.data-table--trade th:nth-child(3),
.data-table--trade td:nth-child(3) {
  width: 14rem;
}

.data-table--trade-share th:nth-child(4),
.data-table--trade-share td:nth-child(4) {
  width: 11rem;
}

.data-table--trade-pair {
  width: calc(100% - 11rem);
}

.data-table tr:last-child td {
  border-bottom: none;
}

/* ——— Responsive ——— */
@media (max-width: 720px) {
  .site-header__bar {
    padding: 12px 0 10px;
  }

  .page-intro {
    gap: var(--space-2);
  }

  .tab-nav {
    gap: 6px;
    padding: 8px 0 12px;
  }

  .tab-nav a {
    font-size: 12px;
    padding: 7px 12px;
  }

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

  .timeline__axis {
    padding-left: 0;
  }
}

/* ——— PPA refined layout ——— */
.page-intro__eyebrow {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
}

.section__subtitle {
  margin: 0 0 var(--space-2);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.data-table-wrap + .section__subtitle,
.chart-grid + .section__subtitle,
.data-table-wrap + p.fpp-notes {
  margin-top: var(--space-6);
}

.chart-grid--two {
  display: grid;
  gap: var(--space-5);
}

@media (min-width: 900px) {
  .chart-grid--two {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ppa-portfolio-grid {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .ppa-portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

a.ppa-portfolio-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a.ppa-portfolio-card:hover {
  border-color: var(--primary);
}

.ppa-portfolio-card,
.ppa-util-card {
  padding: 24px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ppa-portfolio-card__pie {
  height: 280px;
  margin: 0 0 8px;
}

.ppa-portfolio-card__metrics + .ppa-portfolio-card__pie {
  margin-top: var(--space-4);
}

.ppa-portfolio-card__pie canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.ppa-portfolio-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.ppa-portfolio-card__title,
.ppa-util-card__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
}

.ppa-portfolio-card__count {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
}

.ppa-portfolio-card__metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px 28px;
  margin: 0;
}

@media (max-width: 640px) {
  .ppa-portfolio-card__metrics {
    grid-template-columns: 1fr;
  }
}

.ppa-portfolio-card__metrics dt {
  margin: 0;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  font-weight: 600;
  line-height: 1.35;
}

.ppa-portfolio-card__metrics dd {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.util-bar {
  display: grid;
  gap: 6px;
}

.util-bar__track {
  height: 14px;
  border-radius: 999px;
  background: rgba(22, 63, 50, 0.12);
  overflow: hidden;
}

.util-bar__fill {
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}

.ppa-section-divider {
  margin: var(--space-6) 0;
  border: 0;
  border-top: 1px solid var(--border);
  height: 0;
}

.ppa-insight-split,
.ppa-data-quality {
  display: grid;
  gap: var(--space-6);
}

@media (min-width: 900px) {
  .ppa-insight-split,
  .ppa-data-quality {
    grid-template-columns: repeat(2, 1fr);
  }
}

.ppa-data-quality__item {
  padding: var(--space-4);
  background: var(--soft-green);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.ppa-data-quality__item h4 {
  margin: 0 0 var(--space-2);
  font-size: 14px;
  font-weight: 600;
}

.ppa-data-quality__item p {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.45;
}

.sub-nav--nested {
  margin: 0 0 var(--space-4);
  padding-block: 0;
  border-bottom: 0;
}

#d11,
#rp1,
#land,
#boats {
  scroll-margin-top: 96px;
}

.data-table-wrap {
  overflow-x: auto;
}

.ppa-kpi-secondary {
  margin-top: var(--space-6);
}

.kpi-grid + .chart-block,
.kpi-grid + .ppa-chart-row,
.section__note--after + .ppa-data-quality__item {
  margin-top: var(--space-6);
}

.ppa-chart-row {
  display: grid;
  gap: var(--space-6);
  align-items: stretch;
}

.ppa-chart-row > .chart-block {
  display: flex;
  flex-direction: column;
  height: 100%;
  margin: 0;
}

.ppa-chart-row--pie > .chart-block .chart-block__header {
  flex: 0 0 auto;
  min-height: 3.25rem;
}

.ppa-chart-row--pie > .chart-block .chart-block__canvas-wrap {
  flex: 1 1 auto;
  height: 380px;
  min-height: 380px;
}

@media (min-width: 960px) {
  .ppa-chart-row {
    grid-template-columns: minmax(0, 1fr) 280px;
  }

  .ppa-chart-row--pie {
    grid-template-columns: minmax(0, 1fr) minmax(520px, 0.85fr);
  }
}

.ppa-chart-with-stats {
  display: grid;
  gap: var(--space-4);
}

@media (min-width: 800px) {
  .ppa-chart-with-stats {
    grid-template-columns: minmax(0, 1fr) 160px;
    align-items: center;
  }
}

.ppa-stats {
  display: grid;
  gap: var(--space-3);
}

.ppa-stat span,
.ppa-util-line__head span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.ppa-stat strong,
.ppa-util-line__head strong {
  display: block;
  margin-top: 4px;
  font-size: 28px;
  color: var(--primary-dark);
}

.ppa-util-line {
  margin-bottom: var(--space-4);
}

.ppa-util-line__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-3);
  margin-bottom: 8px;
}

.fsp-register-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.fsp-register-head .section__title,
.fsp-register-head .section__note,
.fsp-register-head .fsp-filters {
  margin-bottom: 0;
}

.fsp-register-head .fsp-filters {
  margin-left: auto;
}

.fsp-register-head .fsp-filters input {
  min-width: 220px;
}

.ppa-filters,
.fsp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: var(--space-4);
}

.ppa-side-cards {
  display: grid;
  gap: 12px;
  align-content: start;
}

.ppa-filters input,
.ppa-filters select,
.ppa-filters button,
.fsp-filters input {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.fsp-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.fsp-flow li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 10px 8px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  font-weight: 600;
}

.fsp-flow li:not(:last-child)::after {
  content: "→";
  color: var(--primary);
  font-weight: 600;
}

.frm-structure {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.frm-structure li {
  position: relative;
}

.frm-metric {
  height: 100%;
  padding: var(--space-5) var(--space-6);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.frm-metric__label {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.frm-metric__value {
  margin: 8px 0 0;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--primary-dark);
}

.frm-metric__value span {
  margin-left: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.frm-metric__year {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.frm-structure li:not(:last-child)::after {
  content: "↓";
  display: block;
  margin-top: 8px;
  text-align: center;
  color: var(--primary);
  font-weight: 600;
}

@media (min-width: 800px) {
  .frm-structure {
    grid-template-columns: repeat(3, 1fr);
    gap: 36px;
  }

  .frm-structure li:not(:last-child)::after {
    position: absolute;
    top: 50%;
    right: -26px;
    margin: 0;
    transform: translateY(-50%) rotate(-90deg);
  }
}

.ppa-project__abbr,
.ppa-project__name,
.ppa-flag {
  display: block;
}

.ppa-project__abbr {
  font-weight: 700;
  color: var(--primary-dark);
}

.ppa-project__name {
  margin-top: 2px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.ppa-flag {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--warning);
}

.ppa-view {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
}

.sfm-overview {
  display: grid;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.sfm-overview__group {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  min-width: 0;
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sfm-overview__group .section__title {
  margin: 0;
  font-size: 16px;
}

.sfm-overview__group .section__note {
  margin: 0;
}

.sfm-overview__pair,
.sfm-overview__stats {
  display: grid;
  gap: var(--space-4);
}

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

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

.sfm-overview__group .kpi-card {
  height: 100%;
}

@media (min-width: 960px) {
  .sfm-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
  }
}

@media (max-width: 640px) {
  .sfm-overview__pair,
  .sfm-overview__stats {
    grid-template-columns: 1fr;
  }
}

#notes .sfm-points {
  display: grid;
  gap: 12px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

#notes .sfm-points li + li {
  margin-top: 0;
}

@media (min-width: 800px) {
  #notes .sfm-points {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.sfm-points {
  margin: 8px 0 0;
  padding-left: 1.2rem;
}

.sfm-points li + li {
  margin-top: 4px;
}

#overview,
#landscape,
#certification,
#community,
#tlas,
#insights,
#notes {
  scroll-margin-top: 96px;
}

#landscape .insight-grid,
#insights .insight-grid {
  gap: var(--space-6);
}

#tlas .context-card {
  margin-top: var(--space-6);
}

.sfm-map-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

#sfm-map .leaflet-tooltip.sfm-tip,
#frm-map .leaflet-tooltip.sfm-tip,
#sbs-map .leaflet-tooltip.sfm-tip {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-md);
  font-size: 13px;
  line-height: 1.4;
}

#sfm-map .leaflet-tooltip.sfm-tip strong,
#frm-map .leaflet-tooltip.sfm-tip strong,
#sbs-map .leaflet-tooltip.sfm-tip strong {
  display: block;
  margin-bottom: 2px;
  color: var(--primary-dark);
}

.sfm-map,
.frm-map {
  position: relative;
  z-index: 0;
  isolation: isolate;
  height: 560px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

#sbs-map.leaflet-container {
  height: 560px;
  background: #d5dbd8;
}

.frm-map-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.frm-map-panel,
.frm-map-side {
  min-width: 0;
}

.frm-map-search {
  display: block;
  margin-bottom: var(--space-3);
  font-size: 14px;
  font-weight: 600;
}

.frm-map-search input {
  display: block;
  width: 100%;
  margin-top: 6px;
  font: inherit;
  font-weight: 400;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--text);
}

.frm-map-list {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 560px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.frm-map-list button {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.frm-map-list button.is-selected {
  background: var(--soft-gold);
}

.frm-map-list__coord {
  color: var(--text-secondary);
  font-size: 13px;
}

@media (min-width: 900px) {
  .frm-map-layout {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(280px, 3fr);
    grid-template-rows: 560px;
    align-items: stretch;
  }

  .frm-map-panel,
  .frm-map-side {
    min-height: 0;
    height: 100%;
  }

  .frm-map-panel .frm-map {
    height: 100%;
    min-height: 0;
  }

  .frm-map-side {
    display: flex;
    flex-direction: column;
  }

  .frm-map-side .frm-map-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }
}

.sfm-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px 16px;
}

.sfm-filters label {
  display: grid;
  gap: 4px;
  flex: 1 1 150px;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sfm-filters select,
.sfm-filters input {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text);
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--surface);
  width: 100%;
}

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

.sfm-highlights__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.sfm-highlights__foot .section__note {
  margin: 0;
}

.sfm-live {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-4);
  margin: 0;
}

@media (min-width: 900px) {
  .sfm-live {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.sfm-live > div {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.sfm-live dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.sfm-live dd {
  margin: 4px 0 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.sfm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
}

.sfm-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border-radius: 50%;
  vertical-align: -1px;
}

.sfm-swatch--outside { background: #7fa18f; }
.sfm-swatch--inside { background: #163f32; }
.sfm-swatch--both { background: #b79247; }

#sfm-register tbody tr {
  cursor: pointer;
}

#sfm-register tbody tr:hover td {
  background: var(--surface-muted);
}

#sfm-register tbody tr:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

#sfm-register tr.is-selected td,
#sfm-register tr.is-selected:hover td {
  background: var(--soft-green);
}

#sfm-drawer.sfm-detail,
#latihan-course-drawer.sfm-detail {
  width: min(760px, calc(100vw - 32px));
  padding: 0;
  overflow: auto;
}

#latihan-course-drawer .latihan-course-body {
  padding: 16px 20px 20px;
}

#latihan-course-drawer .data-table-wrap {
  max-height: min(60vh, 560px);
  overflow: auto;
}

.sfm-detail__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.sfm-detail__bar .ppa-drawer__title {
  margin: 0;
  font-size: 20px;
}

.sfm-detail__bar form {
  margin: 0;
}

.sfm-detail__close {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-dark);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  padding: 6px 12px;
  cursor: pointer;
}

.sfm-detail__close:hover {
  background: var(--soft-green);
}

#sfm-drawer-body {
  padding: 4px 20px 20px;
}

.sfm-detail__heading {
  margin: 18px 0 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
}

.sfm-detail__form {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sfm-detail__row {
  display: grid;
  grid-template-columns: minmax(148px, 34%) minmax(0, 1fr);
}

.sfm-detail__row + .sfm-detail__row {
  border-top: 1px solid var(--border);
}

.sfm-detail__row dt,
.sfm-detail__row dd {
  margin: 0;
  padding: 10px 14px;
  font-size: 14px;
  line-height: 1.45;
}

.sfm-detail__row dt {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-muted);
  border-right: 1px solid var(--border);
}

.sfm-detail__row dd {
  color: var(--text);
  white-space: pre-wrap;
}

@media (max-width: 560px) {
  .sfm-detail__row {
    grid-template-columns: 1fr;
  }

  .sfm-detail__row dt {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
}

.sfm-th {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.sfm-funnel {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.sfm-funnel:hover,
.sfm-funnel.is-active {
  background: var(--soft-green);
  color: var(--primary-dark);
}

.sfm-funnel-pop {
  position: fixed;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 260px;
  max-height: 340px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-md);
}

.sfm-funnel-pop[hidden] {
  display: none;
}

.sfm-funnel-pop input[type="search"] {
  font: inherit;
  font-size: 14px;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
}

.sfm-funnel-list {
  overflow: auto;
  max-height: 220px;
  margin: 8px 0;
  display: grid;
  gap: 6px;
}

.sfm-funnel-list label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.35;
}

.sfm-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: var(--space-4);
}

.sfm-pager span {
  font-size: 14px;
  color: var(--text-secondary);
}

.ppa-drawer {
  width: min(680px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  color: var(--text);
}

.ppa-drawer::backdrop {
  background: rgba(22, 63, 50, 0.45);
}

.ppa-drawer__close {
  display: flex;
  justify-content: flex-end;
  margin: 0;
}

.ppa-drawer__title {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--primary-dark);
}

.ppa-drawer__facts {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
}

.ppa-drawer__facts dt {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.ppa-drawer__facts dd {
  margin: 4px 0 0;
  font-size: 15px;
  line-height: 1.45;
}

.ppa-drawer__scope-title {
  margin: 20px 0 8px;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--primary);
}

.ppa-scope {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.ppa-scope li,
.ppa-scope-block {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.chart-block--rank .chart-block__canvas-wrap {
  height: 560px;
}

.chart-block--compare .chart-block__canvas-wrap {
  height: 1120px;
}

.chart-block--marine .chart-block__canvas-wrap {
  height: 780px;
}

.chart-block--pair .chart-block__canvas-wrap {
  height: 760px;
}

.chart-block--projects .chart-block__canvas-wrap {
  height: 1560px;
}

.ppa-fold {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px 16px 16px;
}

.ppa-fold summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--primary);
}

.ppa-fold .section__title {
  margin-top: var(--space-4);
}

.fpp-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-4);
}

@media (max-width: 720px) {
  .fpp-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fpp-panel {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.chart-grid > .fpp-panel {
  align-self: start;
}

.fpp-panel--table {
  padding: 0;
  overflow: hidden;
}

.fpp-panel--table .data-table {
  border: 0;
  border-radius: 0;
}

.fpp-panel--table caption {
  caption-side: top;
  padding: 16px 14px 12px;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.fpp-panel--table .is-current td {
  font-weight: 700;
  color: var(--primary-dark);
}

.fpp-panel--table .is-current td:first-child {
  box-shadow: inset 3px 0 0 var(--primary);
}

.fpp-panel__title {
  margin: 0 0 var(--space-2);
  font-size: 16px;
  font-weight: 600;
}

.fpp-panel__value {
  margin: 0 0 var(--space-4);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fpp-register {
  margin-top: var(--space-4);
}

.fpp-register__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-3);
}

.fpp-register__bar .section__subtitle {
  margin: 0;
}

.fpp-register__year {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 14px;
  color: var(--text-secondary);
}

.fpp-register__year select {
  font: inherit;
  color: var(--text);
  padding: 0.25rem 0.5rem;
}

.fpp-carousel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
}

.fpp-carousel.is-single {
  grid-template-columns: minmax(0, 1fr);
}

.fpp-carousel__btn {
  width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: 50%;
}

.fpp-carousel__btn:disabled {
  opacity: 0.35;
}

.fpp-carousel__btn[hidden] {
  display: none;
}

.fpp-carousel__status {
  margin: var(--space-3) 0 0;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.fpp-carousel__status:empty {
  display: none;
}

.fpp-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
}

@media (min-width: 900px) {
  .fpp-cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.fpp-card__title {
  margin: 0 0 var(--space-3);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.fpp-card__label {
  display: block;
  margin-bottom: 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.fpp-card__meta {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.fpp-register__mark {
  color: var(--text-secondary);
  font-size: 13px;
}

ol.fpp-notes {
  margin: 0;
  padding-left: 1.2rem;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

ol.fpp-notes li + li {
  margin-top: var(--space-3);
}

p.fpp-notes {
  margin: 0 0 var(--space-3);
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.5;
}

/* ——— Kewangan ——— */
.kewangan-list {
  margin: var(--space-2) 0 var(--space-3);
  padding-left: 1.2rem;
}

.kewangan-list li {
  margin: 0.15rem 0;
}

.ppa-portfolio-card .insight-panel,
.ppa-portfolio-card + .insight-panel,
.ppa-portfolio-card + .chart-grid,
.chart-grid + .insight-panel,
.section .insight-panel + .chart-grid {
  margin-top: var(--space-5);
}

/* ——— FORiNS ——— */
.forins-photos {
  display: grid;
  gap: var(--space-6);
}

.forins-frame {
  margin: 0;
}

.forins-frame img {
  display: block;
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius);
}

.forins-frame figcaption {
  margin: var(--space-2) 0 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.4;
}

.forins-card {
  padding: var(--space-5) var(--space-6);
}

.forins-card__code {
  margin: 0 0 var(--space-3);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.forins-card__line {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin: 0 0 var(--space-2);
  color: var(--text-secondary);
  font-size: 14px;
}

.forins-card__line strong {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.forins-card__share {
  margin: var(--space-3) 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}

.forins-card__total {
  margin: var(--space-3) 0 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.forins-mix {
  display: flex;
  height: 28px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--chart-muted);
}

.forins-mix__seg--male {
  background: var(--primary-dark);
}

.forins-mix__seg--female {
  background: var(--gold);
}

.forins-mix__seg--gap {
  background: var(--chart-muted);
}

.forins-key {
  display: grid;
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.forins-key li {
  display: grid;
  grid-template-columns: 14px 1fr auto;
  gap: var(--space-2);
  align-items: center;
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
}

.forins-key strong {
  font-variant-numeric: tabular-nums;
}

.forins-key__swatch {
  width: 14px;
  height: 14px;
  border-radius: 3px;
}

.forins-key__swatch--male {
  background: var(--primary-dark);
}

.forins-key__swatch--female {
  background: var(--gold);
}

.forins-key__swatch--gap {
  background: var(--chart-muted);
  box-shadow: inset 0 0 0 1px var(--border-strong);
}

.forins-outcome .section__title {
  margin-top: 0;
}

.forins-outcome .insight-panel {
  margin-top: var(--space-5);
}

@media (min-width: 700px) {
  .forins-frame img {
    height: 240px;
  }
}

@media (min-width: 900px) {
  .forins-photos {
    grid-template-columns: repeat(3, 1fr);
  }
}

.section .kpi-grid + .section__subtitle {
  margin-top: var(--space-6);
}

@media (min-width: 1100px) {
  .forins-frame img {
    height: 280px;
  }
}

.rdc-kpis {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
  align-items: stretch;
}

.rdc-kpis .kpi-card__label {
  min-height: 2.7em;
}

.rdc-kpis .kpi-card__value {
  font-size: 28px;
}

.rdc-headline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-3);
  margin: 0 0 var(--space-4);
}

.rdc-headline strong {
  font-size: 32px;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.03em;
}

.rdc-headline span {
  color: var(--text-secondary);
  font-size: 15px;
}

.rdc-follow {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.rdc-totals {
  display: grid;
  grid-template-columns: 1fr;
  margin: 0;
}

.rdc-totals div {
  min-width: 0;
  padding: var(--space-4) var(--space-5);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
}

.rdc-totals div.is-partial {
  background: var(--surface-muted);
}

.rdc-totals span,
.rdc-ee-groups,
.rdc-notes {
  color: var(--text-secondary);
  font-size: 14px;
}

.rdc-totals strong {
  display: block;
  margin-top: var(--space-2);
  font-size: 22px;
  color: var(--primary-dark);
}

.rdc-follow__insight,
.rdc-follow__note {
  margin: 0;
  padding: var(--space-4) var(--space-5);
}

.rdc-follow__insight {
  border-left: 3px solid var(--primary);
  background: var(--soft-green);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.rdc-follow__note {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
  border-top: 1px solid var(--border);
}

@media (min-width: 700px) {
  .rdc-totals {
    grid-template-columns: repeat(3, 1fr);
  }

  .rdc-totals div {
    border-bottom: none;
    border-right: 1px solid var(--border);
  }

  .rdc-totals div:last-child {
    border-right: none;
  }
}

.rdc-ee-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin: 0 0 var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.rdc-ee-metrics span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.rdc-ee-metrics strong {
  display: block;
  margin-top: var(--space-2);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--primary-dark);
}

.rdc-ee-groups {
  margin: 0 0 var(--space-4);
  min-height: 1.4em;
}

.rdc-notes {
  margin: 0;
  padding-left: 18px;
  line-height: 1.55;
}

#rdc-overview,
#rdc-visitors,
#rdc-official,
#rdc-interns,
#rdc-education,
#rdc-events {
  scroll-margin-top: 88px;
}

@media (min-width: 700px) {
  .rdc-kpis {
    grid-template-columns: 1fr 1fr;
  }
}

@media (min-width: 1100px) {
  .rdc-kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

.kkp-flag {
  display: inline-block;
  margin-left: 6px;
  color: #c2414b;
  font-size: 12px;
  font-weight: 600;
}

.kkp-narrative {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

.sbs-crumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 0 0 8px;
}

.sbs-crumb button {
  border: 0;
  padding: 0;
  background: none;
  color: var(--primary);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
}

.sbs-drill {
  margin: 0;
  padding: 0;
  list-style: none;
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.sbs-drill button {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.sbs-drill button:hover {
  background: var(--soft-green);
}

.sbs-drill__empty {
  padding: 12px;
  color: var(--text-secondary);
}

.sbs-map-pending {
  display: grid;
  place-items: center;
  min-height: 180px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.sbs-map-pending p {
  margin: 0;
}

.sbs-popup {
  max-height: 280px;
  overflow: auto;
}

.sbs-popup dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 10px;
  margin: 8px 0 0;
}

.sbs-popup dl div {
  display: contents;
}

.sbs-popup dt {
  font-weight: 600;
}

.sbs-popup dd,
.sbs-popup__shared {
  margin: 0;
}
