@layer reset, base, map, controls, panel, responsive, redesign, executive, lightmap;

@layer reset {
  *, *::before, *::after { box-sizing: border-box; }
  html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
  body, h1, h2, h3, p { margin: 0; }
  button, select { font: inherit; }
  button, a, select { -webkit-tap-highlight-color: transparent; }
  button { color: inherit; }
  a { color: inherit; text-decoration: none; }
}

/* Province preview: actual province data, flat visual hierarchy, no source KPI. */
.overview-glance-section { display: grid; gap: 18px; }
.overview-heading > span { font-size: 24px; letter-spacing: -.02em; }
.overview-heading > small { font-size: 12px; }
.province-kpi-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.province-kpi {
  min-width: 0;
  min-height: 142px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 17px;
  border: 1px solid #dce4de;
  color: #152a20;
  text-align: left;
  background: #fff;
  border-radius: 14px;
  cursor: pointer;
}
.province-kpi:hover { border-color: #79a28a; background: #f7faf8; }
.province-kpi:focus-visible,
.overview-districts button:focus-visible,
.overview-full-cta:focus-visible { outline: 3px solid rgba(43, 112, 76, .25); outline-offset: 2px; }
.province-kpi > span { color: #53665b; font-size: 12px; font-weight: 760; line-height: 1.35; }
.province-kpi > strong { margin-top: auto; color: #173f2c; font-size: 42px; line-height: .95; font-variant-numeric: tabular-nums; letter-spacing: -.04em; }
.province-kpi > small { margin-top: 9px; color: #718078; font-size: 10px; line-height: 1.35; }

.overview-viz-card { min-width: 0; padding: 18px; border: 1px solid #dce4de; background: #fff; border-radius: 14px; }
.overview-viz-card > header { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.overview-viz-card h3 { margin: 0; color: #1a3025; font-size: 15px; line-height: 1.35; }
.overview-viz-card header small { color: #738078; font-size: 10px; line-height: 1.4; text-align: right; }
.overview-viz-card[hidden], .overview-viz-grid[hidden], .overview-funding[hidden] { display: none; }

.overview-flow-card { padding: 19px 18px 17px; }
.overview-flow {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding-top: 4px;
}
.overview-flow::before { content: ""; position: absolute; top: 10px; right: 9%; left: 9%; height: 2px; background: #d6e0d9; }
.overview-flow-node { position: relative; z-index: 1; min-width: 0; padding: 0 5px; text-align: center; }
.overview-flow-node > i { display: block; width: 14px; height: 14px; margin: 0 auto 11px; border: 3px solid #fff; background: #2d704d; border-radius: 50%; box-shadow: 0 0 0 1px #2d704d; }
.overview-flow-node.is-missing > i { background: #d6ddd8; box-shadow: 0 0 0 1px #9eaaa2; }
.overview-flow-node > strong { display: block; color: #183b2a; font-size: 25px; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -.03em; }
.overview-flow-node > span { display: block; margin-top: 7px; color: #33483d; font-size: 10px; font-weight: 720; line-height: 1.3; }
.overview-flow-node > small { display: block; margin-top: 2px; color: #7c8981; font-size: 8px; }

.overview-viz-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.overview-bars { display: grid; gap: 11px; }
.overview-bar-row { display: grid; grid-template-columns: minmax(92px, 1.1fr) minmax(70px, 1fr) auto; align-items: center; gap: 9px; }
.overview-bar-row > span { color: #42564a; font-size: 10px; line-height: 1.3; }
.overview-bar-row > i { height: 7px; overflow: hidden; background: #e7ece8; border-radius: 99px; }
.overview-bar-row > i > b { display: block; height: 100%; background: #2d704d; border-radius: inherit; }
.overview-bar-row > strong { min-width: 48px; color: #213a2c; font-size: 10px; font-variant-numeric: tabular-nums; text-align: right; }

.overview-geography > header { margin-bottom: 11px; }
.overview-geography > header > strong { color: #1a4d34; font-size: 22px; font-variant-numeric: tabular-nums; }
.overview-districts { display: flex; flex-wrap: wrap; gap: 7px; }
.overview-districts button { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid #dce4de; color: #3c5145; background: #f8faf8; border-radius: 9px; cursor: pointer; }
.overview-districts button:hover { border-color: #7aa48c; background: #f1f6f2; }
.overview-districts button span { font-size: 10px; }
.overview-districts button strong { color: #1e4d35; font-size: 11px; font-variant-numeric: tabular-nums; }

.overview-funding { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 3px 16px; padding: 16px 18px; border-left: 3px solid #b36b34; background: #faf7f3; border-radius: 4px 12px 12px 4px; }
.overview-funding > span { color: #5d655f; font-size: 11px; font-weight: 720; }
.overview-funding > strong { grid-row: span 2; color: #653b1f; font-size: 22px; font-variant-numeric: tabular-nums; }
.overview-funding > small { color: #8a7464; font-size: 9px; }

.overview-full-cta {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  color: #f4faf6;
  text-decoration: none;
  background: #183e2c;
  border-radius: 12px;
}
.overview-full-cta strong, .overview-full-cta small { display: block; }
.overview-full-cta strong { font-size: 14px; }
.overview-full-cta small { margin-top: 4px; color: #bdd2c4; font-size: 10px; }
.overview-full-cta b { flex: 0 0 auto; color: #c8e2d1; font-size: 10px; }
.overview-full-cta:hover { background: #21543b; }

.f4-country-panel {
  position: absolute;
  z-index: 18;
  top: 88px;
  right: 18px;
  bottom: 26px;
  width: min(700px, calc(100vw - 40px));
  overflow: auto;
  padding: 34px 36px 36px;
  border: 1px solid var(--hairline, #d8dfd9);
  background: #fafbf8;
  border-radius: 22px;
  box-shadow: 0 24px 80px rgba(16, 26, 20, 0.18);
}
.f4-country-panel[hidden] { display: none; }
.f4-board-toggle {
  position: absolute;
  z-index: 16;
  top: 174px;
  right: 26px;
  padding: 13px 16px;
  border: 1px solid #d8dfd9;
  background: #fafbf8;
  color: #173428;
  border-radius: 14px;
  box-shadow: 0 14px 44px rgba(16, 26, 20, 0.14);
  cursor: pointer;
  font-size: 13px;
  font-weight: 850;
}
.f4-board-toggle[hidden] { display: none; }
.f4-board-toggle:hover { color: #f4f6f2; background: #14231b; }
.f4-country-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
}
.f4-country-panel h2,
.f4-country-panel h3 { margin: 0; color: #172f24; line-height: 1.25; }
.f4-country-panel h2 { font-size: clamp(38px, 4vw, 58px); line-height: 1.02; letter-spacing: 0; }
.f4-country-panel header p { margin-top: 8px; color: #5c6c63; font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.f4-country-panel header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 20px;
  color: #1d6445;
  font-size: 13px;
  font-weight: 850;
}
.f4-country-panel header span i {
  width: 10px;
  height: 10px;
  background: #1d6b4b;
  border-radius: 999px;
}
.f4-country-panel > header button {
  position: fixed;
  z-index: 20;
  top: 116px;
  right: 46px;
  width: 58px;
  height: 58px;
  border: 0;
  background: rgba(20, 29, 24, 0.06);
  border-radius: 16px;
  cursor: pointer;
  color: #52615a;
  font-size: 32px;
  font-weight: 750;
  line-height: 1;
}
.f4-country-panel > header button:hover { color: #f4f6f2; background: #14231b; }
.f4-country-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 34px;
  padding: 5px;
  border: 1px solid #d8dfd9;
  background: rgba(20, 29, 24, 0.045);
  border-radius: 16px;
}
.f4-country-tabs button {
  min-width: 0;
  padding: 14px 10px;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: #5d6d64;
  border-radius: 12px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.f4-country-tabs button.active { color: #f4f6f2; background: #14231b; }
.f4-tab-panel[hidden] { display: none; }
.f4-tab-panel.active { display: block; }
.f4-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}
.f4-section-heading strong { color: #173428; font-size: 25px; line-height: 1.25; }
.f4-section-heading small { color: #68756d; font-size: 12px; font-weight: 750; text-align: right; }
.f4-card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.f4-country-panel .f4-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.f4-country-panel .province-kpi {
  min-height: 156px;
  padding: 18px 20px;
  border-color: #dde5de;
  border-radius: 16px;
}
.f4-country-panel .province-kpi > strong { font-size: 44px; }
.f4-country-panel .province-kpi > span { font-size: 13px; }
.f4-kpi[disabled] { cursor: default; }
.f4-kpi[disabled]:hover { border-color: #dce4de; background: #fff; }
.f4-economic-table-wrap {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 15px;
  border: 1px solid #dfe6df;
  background: #fff;
  border-radius: 14px;
}
.f4-economic-table-wrap[hidden] { display: none; }
.f4-economic-table-wrap header {
  display: grid;
  gap: 4px;
}
.f4-economic-table-wrap header strong {
  color: #173428;
  font-size: 14px;
  line-height: 1.35;
}
.f4-economic-table-wrap header small {
  color: #68756d;
  font-size: 11px;
  font-weight: 720;
  line-height: 1.45;
}
.f4-economic-table-scroll { overflow-x: auto; }
.f4-economic-table {
  width: 100%;
  min-width: 520px;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.35;
}
.f4-economic-table th,
.f4-economic-table td {
  padding: 10px 8px;
  border-bottom: 1px solid #e3e9e4;
  text-align: right;
  white-space: nowrap;
}
.f4-economic-table thead th {
  color: #5c6c63;
  font-weight: 850;
}
.f4-economic-table th:first-child,
.f4-economic-table td:first-child {
  text-align: left;
}
.f4-economic-table tbody th {
  color: #173f2c;
  font-weight: 850;
}
.f4-economic-table tbody tr:first-child {
  background: #f6f8f4;
}
.f4-economic-table tbody td {
  color: #36473d;
  font-weight: 760;
}
.f4-economic-table tbody td strong {
  color: #173f2c;
  font-weight: 900;
}
.f4-notes {
  display: grid;
  gap: 6px;
  margin: 18px 0 0;
  padding: 14px 16px;
  color: #65736a;
  background: rgba(20, 29, 24, 0.035);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.45;
}
.f4-list-panel { margin-top: 20px; padding-top: 20px; border-top: 1px solid #e1e7e2; }
.f4-list-panel[hidden] { display: none; }
.f4-list-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.f4-list-panel input {
  min-width: 220px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid #dce4de;
  background: #fff;
  border-radius: 11px;
  color: #20352a;
}
.f4-list-summary { margin-bottom: 9px; color: #66776c; font-size: 11px; font-weight: 700; }
.f4-record-list { display: grid; gap: 9px; }
.f4-record-card {
  display: grid;
  gap: 6px;
  padding: 13px;
  border: 1px solid #dfe6df;
  background: #fff;
  border-radius: 12px;
}
.f4-record-card header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.f4-record-card strong { color: #173f2c; font-size: 13px; line-height: 1.45; }
.f4-record-card header span { flex: 0 0 auto; color: #68766d; font-size: 10px; font-weight: 800; }
.f4-record-card p { color: #415349; font-size: 11px; line-height: 1.5; }
.f4-record-card small { color: #77857c; font-size: 10px; line-height: 1.45; }
.f4-record-card a { justify-self: start; margin-top: 2px; color: #1c6445; font-size: 11px; font-weight: 800; }
.f4-record-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 2px 0 0;
}
.f4-record-metrics div {
  padding: 8px 9px;
  border: 1px solid #e2e9e3;
  border-radius: 9px;
  background: #f8faf8;
}
.f4-record-metrics dt {
  margin-bottom: 2px;
  color: #5d6d63;
  font-size: 9px;
  font-weight: 800;
}
.f4-record-metrics dd {
  margin: 0;
  color: #173f2c;
  font-size: 11px;
  font-weight: 800;
}
.f4-policy-window {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(240px, 1.1fr);
  gap: 16px;
  padding: 22px;
  border: 1px solid #dce5de;
  background: #fff;
  border-radius: 18px;
}
.f4-policy-main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 190px;
}
.f4-policy-main span,
.f4-fund-summary span { color: #5c6c63; font-size: 15px; font-weight: 850; }
.f4-policy-main strong {
  margin-top: 20px;
  color: #17412d;
  font-size: clamp(72px, 8vw, 112px);
  line-height: 0.9;
}
.f4-policy-main small,
.f4-fund-summary small { color: #6d7a72; font-size: 12px; font-weight: 700; line-height: 1.5; }
.f4-policy-chart {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}
.f4-donut {
  position: relative;
  width: 150px;
  aspect-ratio: 1;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(20, 29, 24, 0.08);
}
.f4-donut::after {
  position: absolute;
  inset: 34px;
  content: "";
  background: #fff;
  border-radius: inherit;
  box-shadow: 0 0 0 1px rgba(20, 29, 24, 0.06);
}
.f4-status-legend {
  display: grid;
  gap: 9px;
}
.f4-status-legend p {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #526159;
  font-size: 11px;
  font-weight: 750;
}
.f4-status-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}
.f4-status-legend strong {
  color: #173f2c;
  font-size: 11px;
  white-space: nowrap;
}
.f4-fund-summary {
  grid-column: 1 / -1;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid #e0e7e1;
  background: #f6f8f4;
  border-radius: 13px;
}
.f4-fund-summary strong {
  color: #173f2c;
  font-size: 30px;
  line-height: 1.1;
}
.f4-source-grid {
  display: grid;
  gap: 9px;
  margin-top: 14px;
}
.f4-source-grid article {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #dfe6df;
  background: #fff;
  border-radius: 11px;
}
.f4-source-grid span {
  color: #5c6c63;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}
.f4-source-grid strong {
  overflow-wrap: anywhere;
  color: #173f2c;
  font-size: 11px;
  line-height: 1.45;
}

@media (max-width: 720px) {
  .overview-viz-grid { grid-template-columns: 1fr; }
  .overview-flow { overflow-x: auto; grid-template-columns: repeat(5, minmax(108px, 1fr)); padding-bottom: 8px; }
  .overview-flow::before { right: 54px; left: 54px; }
  .f4-country-panel { top: 74px; right: 10px; bottom: 76px; left: 10px; width: auto; padding: 24px 20px; }
  .f4-country-panel > header button { top: 94px; right: 30px; width: 54px; height: 54px; }
  .f4-country-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: 14px; }
  .f4-section-heading { align-items: flex-start; flex-direction: column; gap: 4px; }
  .f4-section-heading small { text-align: left; }
  .f4-list-panel > header { align-items: stretch; flex-direction: column; }
  .f4-list-panel input { width: 100%; }
  .f4-policy-window,
  .f4-policy-chart { grid-template-columns: 1fr; }
  .f4-donut { width: 132px; }
}

@media (max-width: 430px) {
  .overview-heading > span { font-size: 21px; }
  .province-kpi { min-height: 125px; padding: 13px 10px; }
  .province-kpi > span { font-size: 10px; }
  .province-kpi > strong { font-size: 31px; }
  .province-kpi > small { font-size: 8px; }
  .overview-viz-card { padding: 15px; }
  .overview-viz-card > header { align-items: flex-start; flex-direction: column; gap: 3px; }
  .overview-viz-card header small { text-align: left; }
  .overview-bar-row { grid-template-columns: minmax(90px, 1fr) minmax(56px, .8fr) auto; }
  .overview-funding { grid-template-columns: 1fr; }
  .overview-funding > strong { grid-row: auto; font-size: 20px; }
  .overview-full-cta { align-items: flex-start; flex-direction: column; gap: 8px; }
  .f4-card-grid { grid-template-columns: 1fr; }
}

/* Executive readability pass: summary-first layouts, visible values on every
   chart, equal-height cards, and responsive navigation that never clips. */
@layer uiux2026 {
  .mobile-label { display: none; }

  .province-panel {
    width: min(700px, calc(100vw - 40px));
    top: 84px;
    right: 18px;
    bottom: 18px;
  }
  .panel-content, .panel-stage { font-size: 15px; }
  .panel-section { padding: 26px 28px; }
  .section-heading { align-items: flex-start; gap: 16px; }
  .section-heading > span {
    overflow: visible;
    white-space: normal;
    text-overflow: clip;
    font-size: 18px;
    line-height: 1.35;
  }
  .section-heading > small {
    max-width: 270px;
    font-size: 12px;
    line-height: 1.5;
  }

  .panel-tabs {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    margin: 0 20px 14px;
    overflow: visible;
    border-radius: 14px;
  }
  .panel-tabs button {
    width: auto;
    min-width: 0;
    min-height: 44px;
    padding: 7px 9px;
    white-space: normal;
    line-height: 1.25;
    border-radius: 10px;
    font-size: 13px;
  }
  .panel-tabs button span { display: block; }

  .pillar-grid { align-items: stretch; }
  .pillar-card {
    min-height: 190px;
    padding: 18px;
    border-radius: 16px;
  }
  .pillar-card > strong { font-size: 38px; }
  .pillar-card > small { min-height: 42px; font-size: 13px; line-height: 1.55; }
  .pillar-kicker { font-size: 12px; }
  .pillar-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    margin-top: auto;
  }
  .pillar-facts-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pillar-facts > span {
    min-width: 0;
    padding: 8px 6px;
    background: #f1f4f0;
    border-radius: 10px;
    text-align: center;
  }
  .pillar-facts b, .pillar-facts small { display: block; }
  .pillar-facts b {
    overflow: hidden;
    color: var(--ink-strong);
    font-size: 13px;
    font-weight: 780;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .pillar-facts small { margin-top: 3px; color: var(--ink-soft); font-size: 9px; line-height: 1.3; }
  .pillar-gauge {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 7px;
    width: 100%;
    margin: 3px 0 9px;
  }
  .pillar-gauge i { height: 8px; overflow: hidden; background: #efe4d8; border-radius: 99px; }
  .pillar-gauge i b { display: block; height: 100%; background: #cf7638; border-radius: inherit; }
  .pillar-gauge span { color: var(--ink-soft); font-size: 9px; font-variant-numeric: tabular-nums; }
  .pillar-status-note {
    width: 100%;
    margin: auto 0 0;
    padding: 9px 10px;
    color: #7a542e;
    background: #fbf1e5;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 650;
    text-align: center;
  }

  .decision-chain {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    overflow: visible;
    padding-bottom: 0;
  }
  .decision-stage {
    display: flex;
    min-width: 0;
    min-height: 176px;
    flex-direction: column;
    padding: 13px 12px;
  }
  .decision-stage > header { align-items: flex-start; }
  .decision-stage > header span { font-size: 12px; }
  .decision-stage > header small { font-size: 10px; }
  .decision-stage-metrics { gap: 7px; }
  .decision-stage-metrics span { font-size: 10px; }
  .decision-stage-metrics strong { font-size: 13px; }
  .decision-stage > footer {
    display: -webkit-box;
    overflow: hidden;
    margin-top: auto;
    padding-top: 9px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 10px;
  }

  .research-stats { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .research-stats article { min-height: 112px; justify-content: flex-start; padding: 15px; }
  .research-stats strong { font-size: 31px; }
  .research-stats span {
    overflow: visible;
    min-height: 36px;
    white-space: normal;
    text-overflow: clip;
    font-size: 13px;
    line-height: 1.4;
  }
  .research-stats small { font-size: 11px; }
  .research-block h4 { font-size: 15px; line-height: 1.45; }
  .research-bar-row { grid-template-columns: minmax(100px, 0.9fr) minmax(92px, 1.2fr) auto; }
  .research-bar-row > span, .research-bar-row > strong { font-size: 12px; }
  .research-bar-row > i { height: 9px; }

  .people-overview-section { background: #f3f7f3; }
  .people-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
    gap: 8px;
  }
  .people-stats article {
    min-height: 106px;
    padding: 14px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 14px;
  }
  .people-stats strong { display: block; color: var(--ink-strong); font-size: 29px; line-height: 1; font-variant-numeric: tabular-nums; }
  .people-stats span { display: block; margin-top: 8px; color: #344b40; font-size: 12px; font-weight: 700; line-height: 1.35; }
  .people-stats small { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 10px; }
  .people-breakdown { margin-top: 10px; padding: 15px; border: 1px solid var(--hairline); background: #fff; border-radius: 14px; }
  .people-breakdown > header { display: flex; justify-content: space-between; gap: 12px; align-items: baseline; }
  .people-breakdown h4 { margin: 0; color: var(--ink-strong); font-size: 14px; }
  .people-breakdown header span { color: var(--ink-soft); font-size: 11px; }
  .people-bars { display: grid; gap: 9px; margin-top: 13px; }
  .people-bar-row { display: grid; grid-template-columns: minmax(100px, .9fr) minmax(110px, 1.2fr) auto; align-items: center; gap: 10px; }
  .people-bar-row > span { color: #40564c; font-size: 12px; }
  .people-bar-row > i { height: 9px; overflow: hidden; background: #dce5de; border-radius: 99px; }
  .people-bar-row > i b { display: block; height: 100%; background: #2d8060; border-radius: inherit; }
  .people-bar-row > strong { color: var(--ink-strong); font-size: 12px; font-variant-numeric: tabular-nums; }

  .data-card h3 { font-size: 18px; }
  .data-card > p, .culture-card > div > p { font-size: 14px; line-height: 1.6; }
  .data-card footer span, .data-card footer a { font-size: 12px; }

  .executive-dimension { padding: 20px; }
  .executive-dimension > header span { font-size: 21px; }
  .executive-dimension > header p { max-width: 560px; font-size: 14px; line-height: 1.6; }
  .clean-breakdown { padding: 17px; }
  .clean-breakdown h4 { font-size: 15px; }
  .clean-bar-row { grid-template-columns: minmax(120px, .9fr) minmax(120px, 1.2fr) minmax(74px, auto); }
  .clean-bar-row > span, .clean-bar-row > strong { font-size: 12.5px; }
  .clean-bar-row > strong { text-align: right; white-space: nowrap; }
  .clean-bar-row > i { height: 9px; }
  .trend-bars > div small { color: #42584d; font-size: 9px; font-weight: 700; }
  .dimension-evidence { margin-top: 15px; border: 1px solid var(--hairline); border-radius: 12px; }
  .dimension-evidence > summary {
    padding: 12px 14px;
    color: #285f45;
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
    list-style: none;
  }
  .dimension-evidence > summary::-webkit-details-marker { display: none; }
  .dimension-evidence > summary::after { content: "＋"; float: right; color: var(--ink-soft); }
  .dimension-evidence[open] > summary::after { content: "−"; }
  .dimension-evidence .dimension-highlights { margin: 0; padding: 0 12px 12px; }

  .quality-overview-card {
    display: grid;
    grid-template-columns: 116px minmax(0, 1fr);
    gap: 20px;
    align-items: center;
    padding: 18px;
    border: 1px solid #e4c8b1;
    background: #fffaf5;
    border-radius: 16px;
  }
  .quality-ring {
    position: relative;
    display: grid;
    width: 108px;
    aspect-ratio: 1;
    place-items: center;
    background: conic-gradient(#b4551d var(--quality-progress), #e3e7e2 0);
    border-radius: 50%;
  }
  .quality-ring::before { content: ""; position: absolute; inset: 11px; background: #fffaf5; border-radius: 50%; }
  .quality-ring > span { position: relative; z-index: 1; text-align: center; }
  .quality-ring strong, .quality-ring small { display: block; }
  .quality-ring strong { color: var(--ink-strong); font-size: 24px; line-height: 1; font-variant-numeric: tabular-nums; }
  .quality-ring small { margin-top: 5px; color: var(--ink-soft); font-size: 10px; }
  .quality-status-badge { display: inline-flex; padding: 5px 9px; color: #8a451d; background: #f8e7d9; border-radius: 99px; font-size: 10px; font-weight: 800; }
  .quality-status-copy h3 { margin: 8px 0 0; color: var(--ink-strong); font-size: 22px; line-height: 1.25; }
  .quality-status-copy p { margin-top: 7px; color: #5f5146; font-size: 13px; line-height: 1.6; }
  .quality-mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
  .quality-mini-stats article { min-width: 0; min-height: 104px; padding: 14px; border: 1px solid var(--hairline); background: #fff; border-radius: 13px; }
  .quality-mini-stats strong { display: block; color: var(--ink-strong); font-size: 23px; line-height: 1.25; font-variant-numeric: tabular-nums; }
  .quality-mini-stats span { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
  .quality-mini-stats small { display: block; margin-top: 3px; color: #758179; font-size: 9px; }
  .quality-mini-stats i { display: block; height: 7px; margin-top: 9px; overflow: hidden; background: #e0e6e1; border-radius: 99px; }
  .quality-mini-stats i b { display: block; height: 100%; background: #2d8060; border-radius: inherit; }
  .quality-rules { margin: 10px 0 0; padding: 0; border: 1px solid var(--hairline); background: #fff; border-radius: 12px; }
  .quality-rules > summary { padding: 12px 14px; color: #334d40; cursor: pointer; font-size: 12px; font-weight: 750; list-style: none; }
  .quality-rules > summary::-webkit-details-marker { display: none; }
  .quality-rules > summary::after { content: "＋"; float: right; }
  .quality-rules[open] > summary::after { content: "−"; }
  .quality-rules ul { margin: 0; padding: 0 18px 14px 34px; font-size: 12px; line-height: 1.65; }

  .province-sources { gap: 9px; }
  .source-row { display: block; overflow: hidden; border: 1px solid var(--hairline); background: #fff; border-radius: 14px; }
  .source-row > summary {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 11px;
    min-height: 74px;
    padding: 11px 13px;
    cursor: pointer;
    list-style: none;
  }
  .source-row > summary::-webkit-details-marker { display: none; }
  .source-summary-copy { min-width: 0; }
  .source-summary-copy strong, .source-summary-copy small, .source-count strong, .source-count small { display: block; }
  .source-summary-copy strong { overflow: hidden; color: var(--ink-strong); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .source-summary-copy small { margin-top: 4px; color: var(--ink-soft); font-size: 10px; line-height: 1.4; }
  .source-count { min-width: 58px; text-align: right; }
  .source-count strong { color: var(--ink-strong); font-size: 17px; font-variant-numeric: tabular-nums; }
  .source-count small { color: var(--ink-soft); font-size: 9px; }
  .source-chevron { color: var(--ink-soft); font-size: 9px; font-style: normal; font-weight: 650; }
  .source-row .source-detail { display: block; padding: 4px 14px 14px 62px; border-top: 1px solid #edf0ed; }
  .source-detail p { margin-top: 8px; font-size: 11.5px; line-height: 1.55; }
  .source-detail .source-note { padding: 9px 10px; }
  .source-link { display: inline-flex; min-height: 36px; align-items: center; margin-top: 10px; padding: 0 12px; color: #fff; background: var(--green); border-radius: 9px; font-size: 11px; font-weight: 750; }

  @media (min-width: 1080px) {
    body.panel-open .mode-dock {
      left: calc((100vw - min(700px, 100vw - 20px) - 18px) / 2);
      max-width: calc(100vw - min(700px, 100vw - 20px) - 60px);
    }
  }

  @media (max-width: 720px) {
    .map-header {
      inset: 10px 10px auto;
      grid-template-columns: 48px minmax(0, 1fr) 50px;
      gap: 7px;
    }
    .brand { width: 48px; min-height: 50px; padding: 7px; justify-content: center; border-radius: 13px; }
    .brand > span:last-child { display: none; }
    .brand-mark { width: 34px; height: 34px; }
    .province-picker { min-height: 50px; padding: 6px 10px; gap: 8px; border-radius: 13px; }
    .picker-dot { width: 8px; height: 8px; box-shadow: none; }
    .picker-copy small { display: none; }
    .picker-copy strong { margin-top: 0; font-size: 13px; }
    .picker-chevron { font-size: 17px; }
    .header-meta { gap: 0; }
    .header-meta .live-state, .header-meta .api-docs-link { display: none; }
    .header-meta .insights-link { min-width: 50px; min-height: 50px; justify-content: center; padding: 0 7px; border-radius: 13px; font-size: 12px; }
    .desktop-label { display: none; }
    .mobile-label { display: inline; }

    .province-panel { inset: auto 7px 7px; width: auto; height: min(92dvh, 900px); border-radius: 18px; }
    .panel-head { min-height: 54px; padding: 10px 12px 5px 20px; }
    .province-hero { gap: 10px; padding: 3px 20px 16px; }
    .province-title-block h1 { font-size: 34px; }
    .hero-chip { min-height: 32px; padding: 0 11px; font-size: 11px; }

    .panel-tabs {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 4px;
      margin: 0 12px 12px;
      padding: 4px;
      overflow: visible;
      border-radius: 14px;
    }
    .panel-tabs button { min-height: 40px; padding: 6px 5px; font-size: 12px; }
    .panel-tabs button:nth-child(-n + 3) { grid-column: span 2; }
    .panel-tabs button:nth-child(n + 4) { grid-column: span 3; }

    .panel-section { padding: 21px 18px; }
    .section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
    .section-heading > span { font-size: 17px; }
    .section-heading > small { max-width: none; text-align: left; font-size: 11px; }

    .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .pillar-card { min-height: 178px; padding: 14px; }
    .pillar-card:nth-child(3) { grid-column: 1 / -1; min-height: 166px; }
    .pillar-card > strong { font-size: 32px; }
    .pillar-card > small { min-height: 38px; font-size: 12px; }
    .pillar-kicker { font-size: 10.5px; }
    .pillar-facts { gap: 4px; }
    .pillar-facts > span { padding: 7px 3px; }
    .pillar-facts b { font-size: 12px; }
    .pillar-facts small { font-size: 9px; }

    .decision-chain { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
    .decision-stage { min-height: 152px; }
    .decision-stage:last-child { grid-column: 1 / -1; min-height: 112px; }

    .research-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .research-stats article { min-height: 104px; }
    .research-stats article:last-child { grid-column: 1 / -1; }
    .research-stats span { min-height: 0; font-size: 12px; }
    .research-grid { grid-template-columns: 1fr; }

    .people-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .people-stats article { min-height: 98px; }
    .people-bar-row { grid-template-columns: minmax(92px, .9fr) minmax(78px, 1.2fr) auto; gap: 7px; }

    .executive-dimension { padding: 17px; }
    .executive-dimension > header span { font-size: 19px; }
    .executive-dimension > header p { font-size: 13px; }
    .clean-bar-row { grid-template-columns: minmax(96px, .9fr) minmax(72px, 1.1fr) minmax(66px, auto); gap: 7px; }
    .clean-bar-row > span, .clean-bar-row > strong { font-size: 11px; }
    .evidence-stage { display: block; width: fit-content; margin: 5px 0 0; }

    .quality-overview-card { grid-template-columns: 88px minmax(0, 1fr); gap: 14px; padding: 15px; }
    .quality-ring { width: 84px; }
    .quality-ring::before { inset: 9px; }
    .quality-ring strong { font-size: 19px; }
    .quality-status-copy h3 { font-size: 19px; }
    .quality-status-copy p { font-size: 11.5px; }
    .quality-mini-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .quality-mini-stats article:last-child { grid-column: 1 / -1; min-height: 88px; }
    .quality-mini-stats strong { font-size: 20px; }

    .source-row > summary { grid-template-columns: auto minmax(0, 1fr) auto; gap: 9px; }
    .source-count { display: none; }
    .source-summary-copy strong { font-size: 13px; }
    .source-row .source-detail { padding-left: 14px; }
  }

  @media (max-width: 360px) {
    .pillar-grid { grid-template-columns: 1fr; }
    .pillar-card:nth-child(3) { grid-column: auto; }
    .decision-chain { grid-template-columns: 1fr; }
    .decision-stage:last-child { grid-column: auto; }
  }
}

@layer executive {
  .tourism-section { background: #f7f7f2; }
  .tourism-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
  .tourism-facts article { min-width: 0; padding: 13px; border: 1px solid #d8e1da; border-radius: 13px; background: #fff; }
  .tourism-facts span { display: block; color: #4e6157; font-size: 11px; font-weight: 650; }
  .tourism-facts strong { display: block; margin-top: 5px; color: #16372a; font-size: 24px; line-height: 1; }
  .tourism-content { display: grid; gap: 14px; }
  .tourism-block { padding: 16px; border: 1px solid #d8e1da; border-radius: 16px; background: #fff; }
  .tourism-block > header { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
  .tourism-block h3 { color: #132d23; font-size: 16px; line-height: 1.35; }
  .tourism-block header span { color: #53665c; font-size: 11px; }
  .tourism-place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .tourism-place { display: grid; grid-template-columns: 66px minmax(0, 1fr); gap: 11px; min-width: 0; padding: 9px; background: #f1f4ef; border-radius: 13px; }
  .tourism-place img { width: 66px; height: 66px; object-fit: cover; border-radius: 10px; background: #e1e8e2; }
  .tourism-place > div { min-width: 0; }
  .tourism-place span { color: #2b684e; font-size: 10px; font-weight: 750; }
  .tourism-place strong { display: block; margin-top: 3px; color: #142d23; font-size: 13px; line-height: 1.35; }
  .tourism-place p { margin-top: 4px; color: #4e6258; font-size: 11px; line-height: 1.45; }
  .schedule-list { display: grid; gap: 7px; }
  .schedule-row { display: grid; grid-template-columns: 50px minmax(0, 1fr) auto; gap: 10px; align-items: center; min-height: 58px; padding: 9px 11px; border: 1px solid #e0e6e1; border-radius: 12px; }
  .schedule-row time { color: #174c37; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
  .schedule-row div { min-width: 0; }
  .schedule-row div strong, .schedule-row div span { display: block; }
  .schedule-row div strong { color: #183127; font-size: 12px; }
  .schedule-row div span { margin-top: 2px; color: #53665c; font-size: 10px; overflow-wrap: anywhere; }
  .schedule-row b { color: #2d5544; font-size: 11px; white-space: nowrap; }
  .tram-row { background: #f1f7f1; }
  .transport-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .transport-tags span { padding: 6px 9px; color: #355548; background: #e8eee8; border-radius: 99px; font-size: 10px; }
  .station-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tourism-station { min-width: 0; padding: 11px; background: #f2f5f1; border-radius: 11px; }
  .tourism-station strong, .tourism-station span { display: block; }
  .tourism-station strong { color: #183127; font-size: 12px; line-height: 1.4; }
  .tourism-station span { margin-top: 4px; color: #52665c; font-size: 10px; }
  .tourism-source-link { display: inline-flex; min-height: 42px; align-items: center; justify-content: center; padding: 10px 14px; color: #f6fff9; background: #174d37; border-radius: 12px; font-size: 12px; font-weight: 750; }

  @media (max-width: 720px) {
    .tourism-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tourism-facts span { font-size: 12px; }
    .tourism-place-grid, .station-grid { grid-template-columns: 1fr; }
    .tourism-place strong { font-size: 14px; }
    .tourism-place p, .schedule-row div span, .tourism-station span { font-size: 12px; }
    .schedule-row div strong, .tourism-station strong { font-size: 13px; }
  }

  @media (max-width: 420px) {
    .schedule-row { grid-template-columns: 46px minmax(0, 1fr); }
    .schedule-row b { grid-column: 2; }
  }
}

@layer base {
  :root {
    --night: #06110e;
    --night-soft: #0b1915;
    --panel: #f4f4ef;
    --panel-soft: #e9ece5;
    --ink: #10211b;
    --muted: #65746f;
    --line: rgba(227, 252, 241, 0.16);
    --line-light: rgba(14, 40, 31, 0.12);
    --mint: #72efad;
    --mint-soft: #bcffd7;
    --amber: #f4cf72;
    --coral: #ff8168;
    --violet: #b7a0ff;
    --sky: #75cdfa;
    --shadow: 0 28px 90px rgba(0, 8, 6, 0.34);
    --radius: 24px;
    color-scheme: dark;
  }

  body {
    min-width: 320px;
    background: var(--night);
    color: #f5faf7;
    font-family: Inter, "Noto Sans Thai", "Leelawadee UI", system-ui, -apple-system, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    text-rendering: optimizeLegibility;
  }

  ::selection { background: var(--mint); color: var(--night); }

  .skip-link {
    position: fixed;
    top: -60px;
    left: 18px;
    z-index: 1000;
    padding: 10px 14px;
    background: var(--mint);
    color: var(--night);
    font-weight: 800;
    border-radius: 10px;
  }
  .skip-link:focus { top: 12px; }

  button:focus-visible, select:focus-visible, a:focus-visible {
    outline: 3px solid rgba(114, 239, 173, 0.72);
    outline-offset: 3px;
  }
}

@layer map {
  .atlas-shell { position: relative; width: 100%; height: 100%; isolation: isolate; background: var(--night); }

  #provinceMap.province-map {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    z-index: 0;
  }

  .map-texture {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.16;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.12'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
  }

  .maplibregl-map { font: inherit; }
  .maplibregl-canvas { outline: none; }
  .maplibregl-ctrl-bottom-right { right: 18px; bottom: 16px; opacity: 0.7; }
  .maplibregl-ctrl-attrib { color: rgba(235, 248, 242, 0.7); background: rgba(5, 15, 12, 0.66); }
  .maplibregl-ctrl-attrib a { color: #d7f9e8; }
  .maplibregl-ctrl-group {
    border: 1px solid var(--line);
    border-radius: 13px;
    overflow: hidden;
    background: rgba(7, 20, 16, 0.86);
    box-shadow: none;
  }
  .maplibregl-ctrl-group button { filter: invert(1); opacity: 0.76; }
  .maplibregl-ctrl-group button + button { border-top-color: rgba(255,255,255,0.12); }

  .province-map-label {
    appearance: none;
    border: 0;
    padding: 2px 5px;
    color: rgba(239, 255, 248, 0.82);
    background: rgba(4, 16, 12, 0.52);
    border-radius: 5px;
    font-size: 10px;
    font-weight: 750;
    line-height: 1.1;
    white-space: nowrap;
    cursor: pointer;
    text-shadow: 0 1px 4px rgba(0,0,0,0.9);
    transition: color 160ms ease, background 160ms ease, transform 160ms ease, opacity 160ms ease;
  }
  .province-map-label:hover, .province-map-label.is-active {
    color: var(--night);
    background: var(--mint);
    transform: scale(1.08);
  }
  .province-map-label.is-secondary { opacity: 0; pointer-events: none; }

  .map-fallback {
    position: absolute;
    inset: 50% auto auto 50%;
    z-index: 20;
    width: min(360px, calc(100vw - 32px));
    padding: 24px;
    transform: translate(-50%, -50%);
    background: var(--panel);
    color: var(--ink);
    border-radius: 20px;
    text-align: center;
    box-shadow: var(--shadow);
  }
  .map-fallback strong { display: block; font-size: 18px; }
  .map-fallback p { margin-top: 6px; color: var(--muted); }
}

@layer controls {
  .map-header {
    position: fixed;
    inset: 18px 22px auto;
    z-index: 30;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) minmax(300px, 430px) minmax(210px, 1fr);
    align-items: center;
    gap: 18px;
    pointer-events: none;
  }

  .map-header > * { pointer-events: auto; }

  .brand {
    justify-self: start;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 8px 14px 8px 9px;
    border: 1px solid var(--line);
    background: rgba(6, 18, 14, 0.82);
    border-radius: 16px;
    backdrop-filter: blur(18px);
    box-shadow: 0 10px 40px rgba(0, 8, 5, 0.2);
  }
  .brand-mark {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 3px;
    padding: 7px;
    border-radius: 10px;
    background: var(--mint);
    transform: rotate(-3deg);
  }
  .brand-mark i { width: 5px; display: block; background: var(--night); border-radius: 3px 3px 1px 1px; }
  .brand-mark i:nth-child(1) { height: 9px; }
  .brand-mark i:nth-child(2) { height: 18px; }
  .brand-mark i:nth-child(3) { height: 13px; }
  .brand > span:last-child { display: flex; flex-direction: column; line-height: 1.08; }
  .brand strong { font-size: 16px; letter-spacing: 0.08em; }
  .brand small { margin-top: 4px; color: rgba(226, 245, 236, 0.58); font-size: 8px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }

  .province-picker {
    position: relative;
    justify-self: center;
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    border: 1px solid rgba(203, 255, 230, 0.23);
    background: rgba(7, 22, 17, 0.9);
    border-radius: 18px;
    backdrop-filter: blur(22px);
    box-shadow: 0 16px 54px rgba(0, 8, 5, 0.28);
  }
  .picker-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 0 6px rgba(114, 239, 173, 0.1); }
  .picker-copy { display: flex; min-width: 0; flex-direction: column; line-height: 1.2; }
  .picker-copy small { color: rgba(217, 242, 230, 0.52); font-size: 9px; font-weight: 800; letter-spacing: 0.11em; text-transform: uppercase; }
  .picker-copy strong { margin-top: 4px; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .province-picker select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
  }
  .picker-chevron { color: var(--mint); font-size: 22px; line-height: 1; }

  .header-meta {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .live-state, .header-meta a {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 13px;
    border: 1px solid var(--line);
    background: rgba(7, 20, 16, 0.82);
    border-radius: 13px;
    backdrop-filter: blur(16px);
    font-size: 11px;
    font-weight: 800;
  }
  .live-state i { width: 7px; height: 7px; background: var(--mint); border-radius: 50%; box-shadow: 0 0 0 5px rgba(114, 239, 173, 0.08); }
  .header-meta a { color: var(--night); background: var(--mint); border-color: var(--mint); }
  .header-meta .insights-link { color: #e8f6ee; background: rgba(7, 20, 16, 0.82); border-color: var(--line); }

  .map-prompt {
    position: fixed;
    top: 98px;
    left: 50%;
    z-index: 15;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 14px 10px 11px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    background: rgba(5, 17, 13, 0.74);
    border-radius: 13px;
    backdrop-filter: blur(16px);
    transition: opacity 220ms ease, transform 220ms ease;
    pointer-events: none;
  }
  .map-prompt.is-hidden { opacity: 0; transform: translate(-50%, -8px); }
  .prompt-pointer { position: relative; width: 25px; height: 25px; border: 1px solid rgba(114, 239, 173, 0.42); border-radius: 50%; }
  .prompt-pointer::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--mint); }
  .prompt-pointer::after { content: ""; position: absolute; left: 17px; top: 17px; width: 7px; height: 1px; background: var(--mint); transform: rotate(45deg); transform-origin: left; }
  .map-prompt div { display: flex; flex-direction: column; line-height: 1.25; }
  .map-prompt strong { font-size: 12px; }
  .map-prompt small { color: rgba(220, 242, 231, 0.58); font-size: 10px; }

  .map-actions {
    position: fixed;
    left: 22px;
    bottom: 96px;
    z-index: 18;
    display: flex;
    gap: 8px;
  }
  .map-actions button {
    min-height: 42px;
    border: 1px solid var(--line);
    background: rgba(6, 19, 15, 0.84);
    color: rgba(240, 255, 248, 0.82);
    border-radius: 13px;
    backdrop-filter: blur(16px);
    cursor: pointer;
  }
  #togglePoints { display: inline-flex; align-items: center; gap: 8px; padding: 0 13px; font-size: 11px; font-weight: 750; }
  #togglePoints span { width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--amber); }
  #togglePoints[aria-pressed="true"] { color: var(--night); background: var(--amber); border-color: var(--amber); }
  #togglePoints[aria-pressed="true"] span { background: var(--night); border-color: var(--night); }

  .layer-dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 4px;
    min-height: 62px;
    padding: 7px;
    transform: translateX(-50%);
    border: 1px solid var(--line);
    background: rgba(6, 19, 15, 0.9);
    border-radius: 18px;
    backdrop-filter: blur(24px);
    box-shadow: 0 16px 60px rgba(0, 7, 5, 0.32);
  }
  .dock-label { padding: 0 10px; color: rgba(223, 245, 234, 0.48); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
  .layer-dock button {
    min-height: 46px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: rgba(230, 247, 239, 0.64);
    border-radius: 12px;
    cursor: pointer;
    font-size: 11px;
    font-weight: 750;
  }
  .layer-dock button i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
  .layer-dock button.active { color: var(--night); background: var(--mint); }
  .dock-scale { display: none; }

  .toast {
    position: fixed;
    left: 50%;
    bottom: 100px;
    z-index: 100;
    padding: 10px 15px;
    transform: translate(-50%, 12px);
    border: 1px solid var(--line);
    background: #11261f;
    color: #effcf6;
    border-radius: 12px;
    box-shadow: var(--shadow);
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease, transform 180ms ease;
    font-size: 12px;
    font-weight: 700;
  }
  .toast.show { opacity: 1; transform: translate(-50%, 0); }
}

@layer panel {
  .province-panel {
    position: fixed;
    top: 92px;
    right: 22px;
    bottom: 22px;
    z-index: 40;
    width: min(560px, calc(100vw - 44px));
    overflow: hidden;
    transform: translateX(calc(100% + 40px));
    border: 1px solid rgba(255,255,255,0.56);
    background: var(--panel);
    color: var(--ink);
    border-radius: 26px;
    box-shadow: var(--shadow);
    transition: transform 360ms cubic-bezier(.22,.8,.24,1);
  }
  .province-panel.is-open { transform: translateX(0); }

  .panel-content { height: 100%; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(20,52,41,0.25) transparent; }
  .panel-content::-webkit-scrollbar { width: 7px; }
  .panel-content::-webkit-scrollbar-thumb { background: rgba(20,52,41,0.22); border-radius: 10px; }

  .panel-head {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 76px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px 10px 22px;
    background: rgba(244, 244, 239, 0.94);
    backdrop-filter: blur(16px);
  }
  .panel-head > div { display: flex; align-items: center; gap: 9px; }
  .api-chip { display: inline-flex; align-items: center; gap: 6px; color: #19704b; font-size: 9px; font-weight: 850; letter-spacing: 0.07em; text-transform: uppercase; }
  .api-chip i { width: 7px; height: 7px; border-radius: 50%; background: #35c77d; box-shadow: 0 0 0 5px rgba(53,199,125,0.1); }
  #provinceMeta { padding-left: 9px; border-left: 1px solid var(--line-light); color: var(--muted); font-size: 10px; }
  .panel-close { width: 40px; height: 40px; border: 0; background: #e2e6df; color: #41534d; border-radius: 50%; cursor: pointer; font-size: 24px; line-height: 1; }
  .panel-close:hover { background: var(--ink); color: white; }

  .province-title-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 10px 24px 24px;
  }
  .province-title-block h1 { max-width: 310px; font-size: clamp(34px, 4vw, 54px); line-height: 0.98; letter-spacing: -0.045em; }
  .province-title-block p { margin-top: 8px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }
  .coverage-ring {
    flex: 0 0 auto;
    width: 82px;
    height: 82px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border: 8px solid var(--mint);
    border-radius: 50%;
    background: #e5eee7;
    line-height: 1.05;
  }
  .coverage-ring strong { font-size: 19px; }
  .coverage-ring span { margin-top: 4px; color: var(--muted); font-size: 8px; font-weight: 750; }

  .executive-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 0 24px 22px;
    border: 1px solid var(--line-light);
    border-radius: 16px;
    overflow: hidden;
  }
  .executive-strip article { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 11px 13px; background: #edf0e9; }
  .executive-strip article + article { border-left: 1px solid var(--line-light); }
  .executive-strip strong { font-size: 17px; }
  .executive-strip span { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.25; }

  .panel-section { padding: 22px 24px; border-top: 1px solid var(--line-light); }
  .section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 14px; }
  .section-heading > span { font-size: 13px; font-weight: 850; }
  .section-heading small { color: var(--muted); font-size: 9px; text-align: right; }

  .decision-section { background: #eef2eb; }
  .decision-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .decision-card { min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid #cdd8cf; background: #f9fbf6; border-radius: 16px; transition: transform 160ms ease, border-color 160ms ease; }
  .decision-card:hover { transform: translateY(-2px); border-color: #6fab8d; }
  .decision-card > span { color: #456057; font-size: 11px; font-weight: 750; line-height: 1.35; }
  .decision-card > strong { margin: 13px 0 7px; color: #0f3025; font-size: clamp(24px, 3vw, 34px); line-height: 1; letter-spacing: -0.04em; }
  .decision-card > small { color: #698078; font-size: 9px; }
  .empty-data { grid-column: 1 / -1; display: flex; flex-direction: column; gap: 5px; padding: 17px; border: 1px dashed #bcc9bf; border-radius: 14px; }
  .empty-data strong { font-size: 12px; }
  .empty-data span { color: var(--muted); font-size: 10px; }

  .record-list { display: flex; flex-direction: column; gap: 10px; }
  .data-card { padding: 15px; border: 1px solid var(--line-light); background: #fbfbf7; border-radius: 16px; }
  .record-kicker { display: flex; flex-wrap: wrap; gap: 6px; }
  .record-kicker span { padding: 4px 7px; color: #32594b; background: #e1eee6; border-radius: 999px; font-size: 8px; font-weight: 850; }
  .data-card h3 { margin-top: 10px; font-size: 15px; line-height: 1.35; letter-spacing: -0.015em; }
  .data-card > p, .culture-card > div > p { margin-top: 7px; color: #566a63; font-size: 10px; line-height: 1.55; }
  .data-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
  .data-card dl div { padding: 8px; background: #eef1eb; border-radius: 9px; }
  .data-card dt { color: #708078; font-size: 7px; font-weight: 800; text-transform: uppercase; }
  .data-card dd { margin: 4px 0 0; font-size: 9px; line-height: 1.35; }
  .data-card footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 13px; padding-top: 10px; border-top: 1px solid var(--line-light); }
  .data-card footer span { min-width: 0; color: #60726b; font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .data-card footer a { flex: 0 0 auto; color: #145b40; font-size: 9px; font-weight: 850; }
  .culture-card { display: grid; grid-template-columns: 82px 1fr; gap: 13px; }
  .culture-card > img { width: 82px; height: 82px; object-fit: cover; border-radius: 12px; background: #dfe5df; }
  .culture-card > div { min-width: 0; }
  .culture-card h3 { margin-top: 8px; }

  .all-data-list, .dataset-body { display: flex; flex-direction: column; gap: 8px; }
  .dataset-detail, .resource-detail { border: 1px solid var(--line-light); background: #fbfbf7; border-radius: 14px; overflow: hidden; }
  .dataset-detail > summary, .resource-detail > summary { list-style: none; cursor: pointer; }
  .dataset-detail > summary::-webkit-details-marker, .resource-detail > summary::-webkit-details-marker { display: none; }
  .dataset-detail > summary { display: flex; justify-content: space-between; gap: 12px; padding: 13px 14px; background: #e9eee8; }
  .dataset-detail > summary span { font-size: 11px; font-weight: 850; }
  .dataset-detail > summary small { color: var(--muted); font-size: 8px; text-align: right; }
  .dataset-body { padding: 10px; }
  .resource-detail > summary { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 10px 11px; }
  .resource-detail > summary span { max-width: 66%; font-size: 10px; font-weight: 750; }
  .resource-detail > summary small { color: var(--muted); font-size: 8px; text-align: right; }
  .resource-detail[open] > summary { border-bottom: 1px solid var(--line-light); background: #f3f5f0; }
  .resource-body { padding: 10px; }
  .resource-body > a { display: inline-block; margin-top: 9px; color: #145b40; font-size: 9px; font-weight: 850; }
  .raw-value-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; padding: 8px 0; }
  .raw-value-row + .raw-value-row { border-top: 1px dashed var(--line-light); }
  .raw-value-row span, .sra-values span { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px 7px; background: #eef1eb; border-radius: 8px; }
  .raw-value-row small, .sra-values small { color: #718078; font-size: 7px; overflow-wrap: anywhere; }
  .raw-value-row strong, .sra-values strong { font-size: 9px; overflow-wrap: anywhere; }
  .sra-values { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dataset-body > p, .registry-links p { color: var(--muted); font-size: 10px; line-height: 1.5; }
  .registry-links > span { display: flex; justify-content: space-between; padding: 8px 9px; background: #eef1eb; border-radius: 8px; font-size: 9px; }

  .metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .metric-card { position: relative; min-height: 118px; display: flex; flex-direction: column; justify-content: space-between; padding: 15px; border: 1px solid var(--line-light); background: #e9ede6; border-radius: 16px; overflow: hidden; }
  .metric-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--metric-color, var(--mint)); }
  .metric-card.wide { grid-column: 1 / -1; min-height: 94px; }
  .metric-card > span { max-width: 150px; color: #53655e; font-size: 10px; font-weight: 700; line-height: 1.35; }
  .metric-card div { display: flex; align-items: baseline; gap: 6px; }
  .metric-card strong { font-size: 28px; line-height: 1; letter-spacing: -0.04em; }
  .metric-card small { color: var(--muted); font-size: 9px; }
  .metric-card .missing { color: #87938e; font-size: 17px; letter-spacing: 0; }

  .dimension-list { display: flex; flex-direction: column; gap: 11px; }
  .dimension-row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; padding: 9px 11px; background: #e9ede6; border-radius: 10px; font-size: 10px; }
  .dimension-row > span { color: #455851; font-weight: 700; }
  .dimension-row strong { text-align: right; font-size: 11px; }

  .province-sources { display: flex; flex-direction: column; gap: 8px; }
  .source-row { min-height: 66px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 11px; padding: 10px 11px; border: 1px solid var(--line-light); background: #fbfbf7; border-radius: 14px; }
  .source-mode { min-width: 54px; padding: 5px 7px; color: #146440; background: #d7f4e2; border-radius: 7px; text-align: center; font-size: 8px; font-weight: 900; letter-spacing: 0.04em; text-transform: uppercase; }
  .source-mode.snapshot { color: #665321; background: #f3e8c4; }
  .source-row div { min-width: 0; display: flex; flex-direction: column; }
  .source-row strong { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .source-row small { margin-top: 4px; color: var(--muted); font-size: 8px; }
  .source-row > a { width: 30px; height: 30px; display: grid; place-items: center; background: #e9eee8; border-radius: 50%; font-size: 12px; }
  .source-row > a:hover { color: var(--night); background: var(--mint); }
  .source-row.not_province_scoped, .source-row.source_has_no_record_for_province { opacity: 0.67; }

  .panel-footer {
    min-height: 88px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 18px 24px 24px;
    border-top: 1px solid var(--line-light);
  }
  .panel-footer > div { display: flex; align-items: center; gap: 10px; }
  .candidate-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 0 6px rgba(244,207,114,0.14); }
  .panel-footer p { display: flex; flex-direction: column; }
  .panel-footer p strong { font-size: 10px; }
  .panel-footer p small { color: var(--muted); font-size: 8px; }
  .panel-footer > a { padding: 9px 11px; color: #164c39; background: #d8eee1; border-radius: 10px; font-size: 9px; font-weight: 850; }

  .panel-loading { height: 100%; padding: 28px; }
  .panel-loading span { display: block; margin-bottom: 14px; background: #dde2dc; border-radius: 12px; animation: pulse 1.1s ease-in-out infinite alternate; }
  .panel-loading span:nth-child(1) { width: 45%; height: 18px; }
  .panel-loading span:nth-child(2) { width: 72%; height: 58px; }
  .panel-loading span:nth-child(3) { width: 100%; height: 150px; }
  .panel-loading span:nth-child(4) { width: 100%; height: 210px; }

  .panel-error { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 34px; text-align: center; }
  .panel-error[hidden] { display: none; }
  .panel-error strong { font-size: 20px; }
  .panel-error p { margin-top: 6px; color: var(--muted); }
  .panel-error button { margin-top: 18px; padding: 10px 16px; border: 0; background: var(--mint); color: var(--night); border-radius: 10px; cursor: pointer; font-weight: 800; }

  @keyframes pulse { from { opacity: 0.48; } to { opacity: 1; } }
}

@layer responsive {
  @media (max-width: 980px) {
    .map-header { grid-template-columns: auto minmax(260px, 1fr) auto; }
    .brand > span:last-child { display: none; }
    .brand { padding-right: 9px; }
    .live-state { display: none; }
    .layer-dock button { padding: 0 9px; }
    .dock-label { display: none; }
  }

  @media (max-width: 720px) {
    .map-header {
      inset: 12px 12px auto;
      grid-template-columns: auto 1fr auto;
      gap: 8px;
    }
    .brand { min-height: 48px; border-radius: 14px; }
    .brand-mark { width: 31px; height: 31px; }
    .province-picker { min-width: 0; min-height: 50px; padding: 6px 10px; border-radius: 14px; }
    .picker-copy small { display: none; }
    .picker-copy strong { margin: 0; font-size: 11px; }
    .picker-dot { width: 8px; height: 8px; }
    .header-meta a { min-height: 46px; padding: 0 11px; }
    .map-prompt { top: 78px; max-width: calc(100vw - 30px); width: max-content; }
    .map-prompt small { display: none; }

    .map-actions { left: 12px; bottom: 86px; }
    #togglePoints { padding: 0 10px; }

    .layer-dock {
      left: 10px;
      right: 10px;
      bottom: 10px;
      width: auto;
      min-height: 58px;
      justify-content: space-between;
      transform: none;
      overflow-x: auto;
      scrollbar-width: none;
      border-radius: 16px;
    }
    .layer-dock::-webkit-scrollbar { display: none; }
    .layer-dock button { flex: 0 0 auto; min-width: 58px; min-height: 43px; flex-direction: column; justify-content: center; gap: 3px; padding: 4px 8px; font-size: 9px; }
    .layer-dock button i { width: 5px; height: 5px; }

    .province-panel {
      top: auto;
      right: 8px;
      bottom: 8px;
      left: 8px;
      width: auto;
      height: min(84vh, 760px);
      transform: translateY(calc(100% + 18px));
      border-radius: 24px;
    }
    .province-panel.is-open { transform: translateY(0); }
    .panel-head { min-height: 62px; padding-top: 8px; }
    .panel-head::before { content: ""; position: absolute; top: 7px; left: 50%; width: 38px; height: 4px; transform: translateX(-50%); background: #ccd3cc; border-radius: 4px; }
    .province-title-block { padding: 7px 20px 18px; }
    .province-title-block h1 { font-size: 38px; }
    .coverage-ring { width: 72px; height: 72px; border-width: 7px; }
    .executive-strip { margin: 0 20px 18px; }
    .executive-strip article { min-height: 64px; padding: 9px; }
    .executive-strip strong { font-size: 14px; }
    .panel-section { padding: 18px 20px; }
    .panel-footer { padding: 16px 20px 22px; }
    body.panel-open .map-prompt, body.panel-open .map-actions, body.panel-open .layer-dock { opacity: 0; pointer-events: none; }
  }

  @media (max-width: 420px) {
    .header-meta a { width: 46px; padding: 0; justify-content: center; font-size: 0; }
    .header-meta a span { font-size: 14px; }
    .picker-copy strong { max-width: 150px; }
    .decision-grid { grid-template-columns: 1fr; }
    .decision-card { min-height: 104px; }
    .data-card dl { grid-template-columns: 1fr; }
    .culture-card { grid-template-columns: 64px 1fr; }
    .culture-card > img { width: 64px; height: 64px; }
    .source-row { grid-template-columns: 48px 1fr auto; }
  }

  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }
}

@layer redesign {
  body {
    font-family: "Anuphan", "Noto Sans Thai", system-ui, sans-serif;
    font-size: 16px;
    font-weight: 500;
  }

  .province-map-label {
    padding: 3px 7px;
    border: 1px solid rgba(218, 255, 238, 0.16);
    background: rgba(4, 17, 13, 0.72);
    border-radius: 999px;
    font-family: inherit;
    font-size: 10px;
    font-weight: 650;
    letter-spacing: 0;
    box-shadow: 0 5px 16px rgba(0, 7, 5, 0.2);
  }
  .province-map-label[data-richness="4"],
  .province-map-label[data-richness="5"] {
    color: #effff7;
    border-color: rgba(116, 235, 173, 0.42);
    background: rgba(13, 53, 39, 0.86);
    font-size: 11px;
    font-weight: 750;
  }
  .province-map-label.is-hovered,
  .province-map-label.is-active {
    color: #07130f;
    background: #f4cf72;
    border-color: #fff0b8;
    transform: translateY(-2px) scale(1.05);
  }

  .evidence-legend {
    position: fixed;
    left: 22px;
    bottom: 20px;
    z-index: 18;
    width: 290px;
    padding: 14px 15px;
    border: 1px solid rgba(212, 255, 234, 0.14);
    background: rgba(5, 19, 14, 0.86);
    border-radius: 16px;
    backdrop-filter: blur(22px);
    box-shadow: 0 16px 54px rgba(0, 7, 5, 0.25);
  }
  .evidence-legend > div { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
  .evidence-legend strong { font-size: 12px; font-weight: 750; }
  .evidence-legend small { color: rgba(223, 244, 234, 0.5); font-size: 9px; }
  .evidence-legend ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin: 10px 0 0; padding: 0; list-style: none; }
  .evidence-legend li { display: flex; align-items: center; gap: 5px; color: rgba(232, 248, 240, 0.68); font-size: 9px; white-space: nowrap; }
  .evidence-legend i { width: 16px; height: 7px; border-radius: 999px; background: #18352b; }
  .evidence-legend i[data-level="medium"] { background: #21523f; }
  .evidence-legend i[data-level="good"] { background: #2f7859; }
  .evidence-legend i[data-level="high"] { background: #75e7ab; }
  .map-actions { bottom: 112px; }

  .evidence-popup .maplibregl-popup-content {
    min-width: 148px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 13px;
    border: 1px solid rgba(196, 255, 225, 0.22);
    background: rgba(5, 20, 15, 0.94);
    color: #f2fff8;
    border-radius: 13px;
    box-shadow: 0 16px 44px rgba(0, 5, 3, 0.36);
    font-family: inherit;
  }
  .evidence-popup strong { font-size: 13px; }
  .evidence-popup span { color: #8cf1ba; font-size: 11px; }
  .evidence-popup small { color: rgba(232, 247, 239, 0.52); font-size: 9px; }
  .evidence-popup .maplibregl-popup-tip { border-top-color: rgba(5, 20, 15, 0.94); }

  .province-panel {
    top: 76px;
    right: 18px;
    bottom: 18px;
    width: min(620px, calc(100vw - 36px));
    border: 1px solid rgba(255, 255, 255, 0.7);
    background: #f6f7f2;
    border-radius: 28px;
    box-shadow: 0 32px 110px rgba(0, 8, 5, 0.42);
  }
  .panel-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .panel-head {
    position: relative;
    flex: 0 0 auto;
    min-height: 62px;
    padding: 12px 16px 8px 24px;
    background: transparent;
  }
  .api-chip { font-size: 10px; letter-spacing: 0.08em; }
  #provinceMeta { font-size: 11px; }
  .panel-close {
    width: 38px;
    height: 38px;
    background: #e6e9e2;
    font-size: 22px;
    transition: transform 160ms ease, background 160ms ease, color 160ms ease;
  }
  .panel-close:hover { transform: rotate(5deg); }

  .province-hero {
    flex: 0 0 auto;
    min-height: 122px;
    padding: 8px 24px 22px;
    gap: 24px;
  }
  .province-title-block h1 {
    max-width: 360px;
    font-size: clamp(40px, 4vw, 58px);
    font-weight: 750;
    line-height: 0.98;
  }
  .province-title-block p { margin-top: 9px; font-size: 12px; font-weight: 650; }
  .coverage-summary {
    flex: 0 0 154px;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 14px 16px;
    border: 1px solid #cce4d5;
    background: linear-gradient(145deg, #e4f8eb, #f5faf5);
    border-radius: 18px;
  }
  .coverage-summary > span { color: #4c675c; font-size: 10px; font-weight: 650; }
  .coverage-summary strong { margin-top: 5px; color: #103c2b; font-size: 26px; line-height: 1; }
  .coverage-summary small { margin-top: 6px; color: #72857c; font-size: 9px; }

  .panel-tabs {
    flex: 0 0 auto;
    display: flex;
    gap: 5px;
    padding: 6px 10px;
    border-top: 1px solid #dfe5dd;
    border-bottom: 1px solid #dfe5dd;
    background: #eef1eb;
  }
  .panel-tabs button {
    flex: 1 1 auto;
    min-height: 42px;
    padding: 0 10px;
    border: 0;
    background: transparent;
    color: #66776f;
    border-radius: 11px;
    cursor: pointer;
    font-family: inherit;
    font-size: 11px;
    font-weight: 650;
    white-space: nowrap;
    transition: color 160ms ease, background 160ms ease, box-shadow 160ms ease;
  }
  .panel-tabs button:hover { color: #14392b; background: rgba(255, 255, 255, 0.6); }
  .panel-tabs button.active {
    color: #0b2e21;
    background: #fff;
    box-shadow: 0 4px 16px rgba(21, 57, 43, 0.08);
  }

  .panel-stage {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: #bdc9c0 transparent;
  }
  .panel-view { min-height: 100%; animation: panel-view-in 240ms ease both; }
  .panel-view[hidden] { display: none; }
  @keyframes panel-view-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
  .panel-section { padding: 24px; border-top: 0; }
  .panel-section + .panel-section { border-top: 1px solid #dfe5dd; }
  .section-heading { margin-bottom: 16px; align-items: center; }
  .section-heading > span { color: #142d24; font-size: 16px; font-weight: 750; }
  .section-heading small { max-width: 220px; font-size: 10px; line-height: 1.45; }

  .decision-section { background: #edf3ed; }
  .decision-grid { gap: 10px; }
  .decision-card {
    position: relative;
    min-height: 132px;
    padding: 17px;
    border-color: #d0dbd2;
    background: rgba(255, 255, 252, 0.9);
    border-radius: 17px;
    box-shadow: 0 7px 24px rgba(20, 53, 41, 0.035);
  }
  .decision-card::after { content: none; }
  .decision-card:hover { transform: translateY(-3px); border-color: #75af91; box-shadow: 0 14px 32px rgba(20, 74, 51, 0.09); }
  .decision-card > span { max-width: 82%; font-size: 12px; font-weight: 650; }
  .decision-card > strong { margin: 16px 0 8px; font-size: clamp(27px, 3vw, 36px); font-weight: 750; }
  .decision-card > small { font-size: 10px; }

  .briefing-section { background: #f8f8f4; }
  .briefing-narrative { display: flex; flex-direction: column; border: 1px solid #dde4dc; border-radius: 18px; overflow: hidden; }
  .briefing-fact { display: grid; grid-template-columns: 34px 1fr; gap: 12px; padding: 15px 16px; background: #fff; }
  .briefing-fact + .briefing-fact { border-top: 1px solid #e2e7e0; }
  .briefing-fact > span { color: #3d8c67; font-size: 11px; font-weight: 750; }
  .briefing-fact small { color: #718078; font-size: 10px; font-weight: 650; }
  .briefing-fact p { margin-top: 4px; color: #1c352b; font-size: 13px; font-weight: 550; line-height: 1.55; }

  .record-list { gap: 12px; }
  .data-card {
    padding: 17px;
    border-color: #dce3dc;
    background: #fff;
    border-radius: 17px;
    box-shadow: 0 5px 20px rgba(15, 47, 35, 0.035);
    transition: transform 170ms ease, border-color 170ms ease, box-shadow 170ms ease;
  }
  .data-card:hover { transform: translateY(-2px); border-color: #9fbea9; box-shadow: 0 12px 28px rgba(15, 60, 42, 0.07); }
  .record-kicker span { padding: 5px 8px; font-size: 9px; }
  .data-card h3 { margin-top: 11px; color: #152e24; font-size: 16px; font-weight: 700; }
  .data-card > p, .culture-card > div > p { margin-top: 8px; font-size: 12px; line-height: 1.6; }
  .data-card dl { gap: 8px; }
  .data-card dt { font-size: 8px; }
  .data-card dd { font-size: 11px; }
  .data-card footer span, .data-card footer a { font-size: 10px; }

  .collection-tools { margin: -2px 0 14px; }
  .collection-tools label { display: flex; flex-direction: column; gap: 6px; }
  .collection-tools label > span { color: #607168; font-size: 10px; font-weight: 650; }
  .collection-tools input {
    width: 100%;
    min-height: 44px;
    padding: 0 13px;
    border: 1px solid #d6ded6;
    background: #fff;
    color: #173127;
    border-radius: 12px;
    font: inherit;
    font-size: 12px;
    outline: none;
  }
  .collection-tools input:focus { border-color: #4e9f78; box-shadow: 0 0 0 3px rgba(78, 159, 120, 0.12); }
  .load-more {
    width: 100%;
    min-height: 44px;
    margin-top: 12px;
    border: 1px solid #cbd8ce;
    background: #eef4ee;
    color: #1d503b;
    border-radius: 12px;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    font-weight: 700;
  }

  .all-data-list { gap: 12px; }
  .dimension-intro {
    padding: 20px;
    color: #effbf4;
    background: linear-gradient(135deg, #103a2a, #1f6046);
    border-radius: 19px;
  }
  .dimension-intro > span { color: #8ce9b7; font-size: 9px; font-weight: 750; letter-spacing: 0.1em; text-transform: uppercase; }
  .dimension-intro h3 { margin-top: 7px; font-size: 19px; font-weight: 700; }
  .dimension-intro p { margin-top: 7px; color: rgba(235, 251, 242, 0.7); font-size: 11px; line-height: 1.55; }
  .dimension-category {
    border: 1px solid #dae2da;
    background: #fff;
    border-radius: 17px;
    overflow: hidden;
  }
  .dimension-category > summary {
    min-height: 64px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 13px 16px;
    cursor: pointer;
    list-style: none;
  }
  .dimension-category > summary::-webkit-details-marker { display: none; }
  .dimension-category > summary div { display: flex; min-width: 0; flex-direction: column; }
  .dimension-category > summary strong { color: #183328; font-size: 13px; font-weight: 700; }
  .dimension-category > summary small { margin-top: 3px; color: #73827b; font-size: 10px; }
  .dimension-category > summary > span { color: #668078; transition: transform 160ms ease; }
  .dimension-category[open] > summary > span { transform: rotate(180deg); }
  .dimension-category[open] > summary { background: #eef2ec; }
  .dimension-category-body { display: flex; flex-direction: column; gap: 11px; padding: 11px; border-top: 1px solid #e1e7e0; }
  .dimension-card { padding: 16px; border: 1px solid #e0e6df; background: #fbfcf9; border-radius: 14px; }
  .dimension-card > header { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
  .dimension-card > header > div { min-width: 0; }
  .dimension-card > header span { color: #398061; font-size: 9px; font-weight: 700; }
  .dimension-card > header h3 { margin-top: 4px; color: #1b3329; font-size: 14px; line-height: 1.4; }
  .dimension-card > header em { flex: 0 0 auto; padding: 5px 7px; color: #62746c; background: #edf1eb; border-radius: 7px; font-size: 8px; font-style: normal; }
  .dimension-card > p { margin-top: 7px; color: #66766f; font-size: 11px; line-height: 1.5; }
  .dimension-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
  .dimension-chips span { padding: 4px 7px; color: #3d624f; background: #e6f0e9; border-radius: 999px; font-size: 8px; font-weight: 650; }
  .dimension-card > footer { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; padding-top: 11px; border-top: 1px solid #e2e7e1; }
  .dimension-card > footer span { color: #829089; font-size: 9px; }
  .dimension-card > footer a { color: #2b7253; font-size: 9px; font-weight: 700; }

  .interpreted-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 12px; }
  .interpreted-metrics > div { min-width: 0; padding: 10px; background: #edf2ec; border-radius: 10px; }
  .interpreted-metrics small { display: block; color: #708078; font-size: 9px; line-height: 1.35; }
  .interpreted-metrics strong { display: block; margin-top: 5px; color: #16382a; font-size: 13px; overflow-wrap: anywhere; }
  .dimension-note { color: #77857e; font-size: 10px; }

  .mini-chart { margin-top: 13px; padding: 12px; border: 1px solid #e0e6df; background: #fff; border-radius: 12px; }
  .mini-chart-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 9px; }
  .mini-chart-head span { color: #29483b; font-size: 10px; font-weight: 700; }
  .mini-chart-head small { color: #849089; font-size: 8px; }
  .mini-bars { display: flex; flex-direction: column; gap: 6px; }
  .mini-bars > div { display: grid; grid-template-columns: 62px 1fr 72px; align-items: center; gap: 7px; }
  .mini-bars span { color: #6b7972; font-size: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .mini-bars i { height: 6px; background: #e6ece6; border-radius: 99px; overflow: hidden; }
  .mini-bars b { display: block; height: 100%; background: linear-gradient(90deg, #55b783, #72e9aa); border-radius: inherit; }
  .mini-bars strong { color: #315343; font-size: 8px; text-align: right; }

  .resource-explorer { margin-top: 12px; border: 1px solid #dce4dc; background: #fff; border-radius: 12px; overflow: hidden; }
  .resource-explorer > summary { display: flex; justify-content: space-between; padding: 10px 12px; color: #315c48; cursor: pointer; font-size: 10px; font-weight: 700; list-style: none; }
  .resource-explorer > summary::-webkit-details-marker { display: none; }
  .resource-explorer[open] > summary { background: #edf3ee; }
  .resource-explorer-body { padding: 12px; border-top: 1px solid #e1e7e1; }
  .resource-explorer-body label { display: flex; flex-direction: column; gap: 5px; }
  .resource-explorer-body label > span { color: #6d7d75; font-size: 9px; }
  .resource-explorer-body select {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid #d3ddd5;
    background: #fff;
    color: #1b392c;
    border-radius: 9px;
    font: inherit;
    font-size: 10px;
  }
  .data-absence { padding: 16px; border: 1px dashed #bdccc1; background: #f7f8f4; border-radius: 12px; }
  .data-absence strong { color: #354b42; font-size: 12px; }
  .data-absence p { margin-top: 5px; color: #76837d; font-size: 10px; }

  .province-sources { gap: 10px; }
  .source-row { min-height: 72px; padding: 12px; border-color: #dce4dc; background: #fff; }
  .source-mode { min-width: 58px; padding: 6px 8px; font-size: 9px; }
  .source-row strong { font-size: 12px; }
  .source-row small { font-size: 10px; line-height: 1.4; }
  .panel-footer { min-height: auto; margin: 0 24px 24px; padding: 16px; border: 1px solid #dce4dc; background: #edf1eb; border-radius: 14px; }
  .panel-footer p strong { font-size: 11px; }
  .panel-footer p small { font-size: 9px; }
  .panel-footer > a { font-size: 10px; }

  @media (max-width: 720px) {
    .evidence-legend {
      left: 12px;
      bottom: 14px;
      width: 240px;
      padding: 11px 12px;
    }
    .evidence-legend > div small { display: none; }
    .evidence-legend ol { margin-top: 7px; }
    .map-actions { bottom: 90px; }
    .province-panel {
      top: auto;
      right: 7px;
      bottom: 7px;
      left: 7px;
      width: auto;
      height: min(87vh, 820px);
      border-radius: 25px;
    }
    .panel-head { min-height: 56px; padding: 10px 14px 6px 20px; }
    .province-hero { min-height: 104px; padding: 5px 20px 17px; }
    .province-title-block h1 { font-size: 38px; }
    .coverage-summary { flex-basis: 132px; padding: 11px 12px; }
    .coverage-summary strong { font-size: 22px; }
    .panel-tabs { overflow-x: auto; scrollbar-width: none; }
    .panel-tabs::-webkit-scrollbar { display: none; }
    .panel-tabs button { flex: 0 0 auto; min-height: 40px; padding: 0 13px; }
    .panel-section { padding: 20px; }
    .section-heading > span { font-size: 15px; }
    .decision-card { min-height: 124px; }
    .panel-footer { margin: 0 20px 20px; }
    body.panel-open .map-prompt,
    body.panel-open .map-actions,
    body.panel-open .evidence-legend { opacity: 0; pointer-events: none; }
  }

  @media (max-width: 460px) {
    .province-hero { align-items: flex-end; }
    .coverage-summary { flex-basis: 116px; }
    .coverage-summary > span { font-size: 9px; }
    .coverage-summary small { display: none; }
    .decision-grid { grid-template-columns: 1fr; }
    .decision-card { min-height: 112px; }
    .interpreted-metrics { grid-template-columns: 1fr; }
    .dimension-card > header { flex-direction: column; }
    .mini-bars > div { grid-template-columns: 52px 1fr 64px; }
    .culture-card { grid-template-columns: 68px 1fr; }
    .culture-card > img { width: 68px; height: 68px; }
  }
}

/* MapLibre ships unlayered positioning rules, so this final unlayered override keeps the WebGL canvas full viewport. */
#provinceMap.province-map {
  position: absolute;
  inset: 0;
  width: auto;
  height: auto;
}

#provinceName:focus { outline: none; }

@layer executive {
  .province-panel {
    width: min(640px, calc(100vw - 20px));
    color: #10251d;
    background: #f6f7f3;
    color-scheme: light;
  }

  .panel-content { min-width: 0; background: #f6f7f3; }
  .panel-stage,
  .panel-view,
  .panel-section,
  .executive-dimension,
  .clean-metric-list,
  .clean-metric { min-width: 0; max-width: 100%; }
  .panel-stage { overflow-x: hidden; }
  .panel-head { min-height: 64px; padding: 12px 20px 8px 26px; }
  .panel-head p { color: #52645b; font-size: 13px; }
  .api-chip { font-size: 11px; letter-spacing: 0.04em; }
  .panel-close { width: 44px; height: 44px; font-size: 25px; }

  .province-hero { min-height: 128px; padding: 8px 26px 22px; }
  .province-title-block h1 { color: #10251d; font-size: clamp(40px, 4.2vw, 54px); line-height: 1.08; }
  .province-title-block p { margin-top: 6px; color: #52645b; font-size: 14px; }
  .coverage-summary {
    flex-basis: 164px;
    min-height: 88px;
    padding: 13px 15px;
    border: 1px solid #cdd8d0;
    background: #eef3ed;
    border-radius: 16px;
  }
  .coverage-summary > span { color: #52645b; font-size: 12px; }
  .coverage-summary strong { margin: 6px 0 3px; color: #174f39; font-size: 16px; line-height: 1.25; letter-spacing: 0; }
  .coverage-summary small { color: #52645b; font-size: 12px; }

  .panel-tabs { min-height: 52px; padding: 5px 14px; border-color: #d8dfd9; background: #f6f7f3; }
  .panel-tabs button { min-height: 42px; padding: 0 16px; color: #52645b; font-size: 14px; font-weight: 650; }
  .panel-tabs button.active { color: #10251d; background: #fff; box-shadow: inset 0 0 0 1px #cad5cd; }
  .panel-tabs button:focus-visible,
  .panel-close:focus-visible,
  .load-more:focus-visible,
  .collection-tools input:focus-visible { outline: 3px solid #61b58a; outline-offset: 2px; }

  .panel-section { padding: 26px; }
  .section-heading { margin-bottom: 15px; }
  .section-heading > span { color: #10251d; font-size: 18px; font-weight: 750; }
  .section-heading > small { color: #52645b; font-size: 12px; }

  .executive-overview { padding-bottom: 18px; background: #f6f7f3; }
  .briefing-narrative { gap: 10px; }
  .briefing-fact {
    display: grid;
    grid-template-columns: 10px 1fr;
    gap: 12px;
    padding: 16px;
    border: 1px solid #d8dfd9;
    background: #fff;
    border-radius: 14px;
  }
  .briefing-fact > i { width: 8px; height: 8px; margin-top: 5px; background: #b44b2d; border-radius: 50%; }
  .briefing-fact small { display: block; color: #7b3421; font-size: 13px; font-weight: 750; }
  .briefing-fact p { margin-top: 4px; color: #203a2f; font-size: 16px; line-height: 1.55; }

  .decision-section { padding-top: 18px; background: #eef2ed; }
  .decision-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .decision-card {
    min-height: 108px;
    padding: 15px;
    border: 1px solid #d3ddd5;
    background: #fff;
    border-radius: 14px;
  }
  .decision-card:hover { transform: none; border-color: #9eb7a7; box-shadow: none; }
  .decision-card > span { max-width: none; color: #52645b; font-size: 12px; line-height: 1.45; }
  .decision-card > strong { margin: 11px 0 5px; color: #10251d; font-size: clamp(24px, 2.7vw, 32px); }
  .decision-card > small { color: #66786f; font-size: 11px; }

  .dimension-summary-list { display: flex; flex-direction: column; gap: 14px; }
  .executive-dimension {
    padding: 20px;
    border: 1px solid #d7dfd8;
    background: #fff;
    border-radius: 18px;
  }
  .executive-dimension > header { padding-bottom: 16px; border-bottom: 1px solid #e1e7e2; }
  .executive-dimension > header span { color: #10251d; font-size: 19px; font-weight: 760; }
  .executive-dimension > header p { margin-top: 7px; color: #40564c; font-size: 14px; line-height: 1.55; }

  .clean-metric-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 16px; }
  .clean-metric {
    padding: 14px;
    border: 1px solid #dce3dd;
    background: #f7f9f6;
    border-radius: 13px;
  }
  .clean-metric.is-attention { border-color: #e1b4a4; background: #fff7f3; }
  .clean-metric-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
  .clean-metric-head span { color: #40564c; font-size: 13px; line-height: 1.4; }
  .clean-metric-head strong { flex: 0 0 auto; color: #10251d; font-size: 23px; line-height: 1; }
  .clean-metric > p { margin-top: 9px; color: #4f6259; font-size: 13px; line-height: 1.45; }
  .clean-metric.is-attention > p { color: #7b3421; font-weight: 650; }
  .comparison-track { position: relative; height: 6px; margin: 13px 4px 10px; background: #d7e0d9; border-radius: 999px; }
  .comparison-track .benchmark-marker { position: absolute; top: -4px; width: 2px; height: 14px; background: #40564c; transform: translateX(-50%); }
  .comparison-track .value-marker { position: absolute; top: -5px; width: 16px; height: 16px; border: 3px solid #fff; background: #176747; border-radius: 50%; box-shadow: 0 0 0 1px #176747; transform: translateX(-50%); }
  .clean-metric.is-attention .comparison-track .value-marker { background: #a94327; box-shadow: 0 0 0 1px #a94327; }
  .clean-metric > small { color: #52645b; font-size: 11px; }

  .clean-breakdown { margin-top: 14px; padding: 15px; background: #f3f6f2; border-radius: 13px; }
  .clean-breakdown h4 { color: #223d31; font-size: 14px; font-weight: 700; }
  .clean-breakdown > small { display: block; margin-top: 10px; color: #52645b; font-size: 11px; }
  .clean-bars { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
  .clean-bar-row { display: grid; grid-template-columns: minmax(108px, 0.9fr) minmax(110px, 1.1fr) auto; align-items: center; gap: 10px; }
  .clean-bar-row > span { min-width: 0; color: #40564c; font-size: 12px; line-height: 1.35; }
  .clean-bar-row > i { height: 7px; overflow: hidden; background: #d9e2db; border-radius: 99px; }
  .clean-bar-row > i b { display: block; height: 100%; background: #2d8060; border-radius: inherit; }
  .clean-bar-row > strong { color: #223d31; font-size: 12px; }

  .trend-breakdown { position: relative; }
  .trend-breakdown > strong { position: absolute; top: 14px; right: 15px; color: #174f39; font-size: 15px; }
  .trend-bars { display: flex; align-items: flex-end; gap: 7px; height: 92px; margin-top: 14px; }
  .trend-bars > div { display: flex; flex: 1; height: 100%; flex-direction: column; justify-content: flex-end; align-items: center; gap: 5px; }
  .trend-bars i { display: block; width: min(30px, 70%); min-height: 10px; background: #2d8060; border-radius: 5px 5px 2px 2px; }
  .trend-bars span { color: #52645b; font-size: 10px; }

  .dimension-highlights { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 14px; }
  .dimension-highlights article { min-width: 0; padding: 14px; border: 1px solid #dce3dd; border-radius: 13px; }
  .dimension-highlights span { color: #286247; font-size: 11px; font-weight: 700; }
  .dimension-highlights strong { display: block; margin-top: 5px; color: #10251d; font-size: 14px; line-height: 1.45; }
  .dimension-highlights p { margin-top: 6px; color: #52645b; font-size: 12px; line-height: 1.5; }
  .dimension-highlights small { display: block; margin-top: 6px; color: #66786f; font-size: 11px; }
  .missing-dimensions { padding: 13px 15px; color: #52645b; background: #ecefeb; border-radius: 12px; font-size: 13px; line-height: 1.5; }

  .portfolio-loading { display: grid; gap: 11px; padding: 26px; }
  .portfolio-loading[hidden] { display: none; }
  .portfolio-loading span { height: 92px; background: #e4e9e4; border-radius: 14px; animation: pulse 1.1s ease-in-out infinite alternate; }
  .portfolio-empty { margin: 26px; padding: 18px; color: #52645b; background: #ecefeb; border-radius: 14px; font-size: 14px; text-align: center; }
  .portfolio-empty[hidden] { display: none; }

  .data-card h3 { font-size: 17px; line-height: 1.45; }
  .data-card p { font-size: 14px; line-height: 1.6; }
  .record-kicker span { font-size: 11px; }
  .data-card footer span,
  .data-card footer a { font-size: 12px; }
  .collection-tools input { min-height: 46px; font-size: 15px; }
  .load-more { min-height: 46px; font-size: 14px; }

  .source-row { min-height: 76px; }
  .source-mode { font-size: 10px; }
  .source-row strong { font-size: 14px; }
  .source-row small { margin-top: 4px; color: #52645b; font-size: 12px; line-height: 1.45; }
  .source-row > a { min-width: 42px; min-height: 42px; display: grid; place-items: center; color: #215b42; font-size: 12px; font-weight: 700; }
  .panel-footer p strong { font-size: 13px; }
  .panel-footer p small { font-size: 11px; }
  .panel-footer > a { min-height: 42px; display: inline-flex; align-items: center; font-size: 12px; }
  .empty-data strong { font-size: 14px; }
  .empty-data span { font-size: 12px; }

  @media (max-width: 720px) {
    .province-panel { width: auto; height: min(92dvh, 860px); }
    .panel-head { min-height: 58px; padding: 10px 12px 5px 20px; }
    .province-hero { min-height: 112px; align-items: stretch; flex-direction: column; gap: 12px; padding: 6px 20px 17px; }
    .province-title-block h1 { font-size: clamp(35px, 10vw, 46px); }
    .coverage-summary { width: 100%; min-height: 72px; flex-basis: auto; }
    .panel-tabs { padding-inline: 10px; }
    .panel-tabs button { min-height: 44px; padding-inline: 14px; font-size: 13px; }
    .panel-section { padding: 21px 20px; }
    .section-heading > span { font-size: 17px; }
    .briefing-fact p { font-size: 15px; }
    .decision-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .decision-card { min-height: 102px; padding: 13px; }
    .decision-card > strong { font-size: 24px; }
    .executive-dimension { padding: 17px; border-radius: 16px; }
    .executive-dimension > header span { font-size: 18px; }
    .clean-metric-list { grid-template-columns: 1fr; }
    .clean-metric-head { flex-direction: column; gap: 7px; }
    .clean-metric-head span { min-width: 0; overflow-wrap: anywhere; }
  }

  @media (max-width: 480px) {
    .province-hero { align-items: stretch; flex-direction: column; gap: 12px; }
    .coverage-summary { width: 100%; min-height: 72px; flex-basis: auto; padding: 11px 13px; }
    .coverage-summary strong { font-size: 14px; }
    .coverage-summary small { display: block; font-size: 10px; }
    .decision-grid { grid-template-columns: 1fr; }
    .decision-card { min-height: 94px; }
    .dimension-highlights { grid-template-columns: 1fr; }
    .clean-metric-head { flex-direction: column; gap: 7px; }
    .clean-metric-head span { min-width: 0; overflow-wrap: anywhere; }
    .clean-bar-row { grid-template-columns: minmax(98px, 0.9fr) minmax(92px, 1.1fr) auto; gap: 8px; }
  }
}

/* Light flat map shell: keeps the executive panel design, swaps the dark 3D
   canvas for a clean 2D choropleth that is easier for general users to read. */
@layer lightmap {
  :root {
    --paper: #edf1ec;
    --card: rgba(255, 255, 255, 0.9);
    --card-strong: #ffffff;
    --card-border: #d7dfd7;
    --ink-strong: #10251d;
    --ink-soft: #52645b;
    --green: #176747;
    --green-deep: #0f4a32;
    --gold: #e39b17;
    color-scheme: light;
  }

  body { background: var(--paper); color: var(--ink-strong); }
  ::selection { background: #bfe6d0; color: var(--ink-strong); }
  .atlas-shell { background: var(--paper); }
  .map-texture { display: none; }

  button:focus-visible, select:focus-visible, a:focus-visible {
    outline: 3px solid rgba(23, 103, 71, 0.55);
    outline-offset: 3px;
  }
  .skip-link { background: var(--green-deep); color: #fff; }

  .maplibregl-ctrl-attrib { color: #5d6d64; background: rgba(255, 255, 255, 0.72); }
  .maplibregl-ctrl-attrib a { color: #2c5c46; }
  .maplibregl-ctrl-group { border-color: var(--card-border); background: var(--card-strong); }
  .maplibregl-ctrl-group button { filter: none; opacity: 0.85; }
  .maplibregl-ctrl-group button + button { border-top-color: #e4e9e3; }

  .brand {
    border-color: var(--card-border);
    background: var(--card);
    box-shadow: 0 10px 34px rgba(19, 48, 36, 0.1);
    backdrop-filter: blur(14px);
  }
  .brand strong { color: var(--ink-strong); }
  .brand small { color: var(--ink-soft); }
  .brand-mark { background: var(--green); transform: none; border-radius: 11px; }
  .brand-mark i { background: #eafff3; }

  .province-picker {
    border-color: var(--card-border);
    background: var(--card);
    box-shadow: 0 14px 44px rgba(19, 48, 36, 0.13);
  }
  .picker-dot { background: var(--green); box-shadow: 0 0 0 6px rgba(23, 103, 71, 0.1); }
  .picker-copy small { color: var(--ink-soft); }
  .picker-copy strong { color: var(--ink-strong); }
  .picker-chevron { color: var(--green); }

  .live-state, .header-meta a {
    border-color: var(--card-border);
    background: var(--card);
    color: var(--ink-strong);
  }
  .live-state i { background: var(--green); box-shadow: 0 0 0 5px rgba(23, 103, 71, 0.1); }
  .header-meta a { color: #f4fbf6; background: var(--green-deep); border-color: var(--green-deep); }
  .header-meta .insights-link { color: var(--ink-strong); background: var(--card); border-color: var(--card-border); }

  .map-prompt {
    border-color: var(--card-border);
    background: var(--card);
    color: var(--ink-strong);
    box-shadow: 0 10px 30px rgba(19, 48, 36, 0.1);
  }
  .map-prompt small { color: var(--ink-soft); }
  .prompt-pointer { border-color: rgba(23, 103, 71, 0.4); }
  .prompt-pointer::before, .prompt-pointer::after { background: var(--green); }

  .map-actions button {
    border-color: var(--card-border);
    background: var(--card);
    color: var(--ink-strong);
    box-shadow: 0 8px 24px rgba(19, 48, 36, 0.08);
  }
  #togglePoints span { border-color: var(--gold); }
  #togglePoints[aria-pressed="true"] { color: #fff; background: var(--gold); border-color: var(--gold); }
  #togglePoints[aria-pressed="true"] span { background: #fff; border-color: #fff; }

  .evidence-legend {
    border-color: var(--card-border);
    background: var(--card);
    box-shadow: 0 12px 40px rgba(19, 48, 36, 0.12);
  }
  .evidence-legend strong { color: var(--ink-strong); }
  .evidence-legend small, .evidence-legend li { color: var(--ink-soft); }
  .evidence-legend i { background: #cfe4d4; }
  .evidence-legend i[data-level="medium"] { background: #a9d3b8; }
  .evidence-legend i[data-level="good"] { background: #54a578; }
  .evidence-legend i[data-level="high"] { background: #176747; }

  .province-map-label {
    padding: 4px 9px;
    color: var(--ink-strong);
    border: 1px solid rgba(23, 103, 71, 0.18);
    background: rgba(255, 255, 255, 0.88);
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    text-shadow: none;
    box-shadow: 0 4px 14px rgba(19, 48, 36, 0.14);
  }
  .province-map-label[data-richness="4"],
  .province-map-label[data-richness="5"],
  .province-map-label[data-richness="6"],
  .province-map-label[data-richness="7"],
  .province-map-label[data-richness="8"],
  .province-map-label[data-richness="9"] {
    color: #0d3b28;
    border-color: rgba(23, 103, 71, 0.35);
    background: rgba(255, 255, 255, 0.96);
    font-size: 11px;
  }
  .province-map-label:hover, .province-map-label.is-hovered, .province-map-label.is-active {
    color: #fff;
    background: var(--green-deep);
    border-color: var(--green-deep);
    transform: translateY(-2px) scale(1.06);
  }

  .evidence-popup .maplibregl-popup-content {
    border: 1px solid var(--card-border);
    background: var(--card-strong);
    color: var(--ink-strong);
    box-shadow: 0 14px 40px rgba(19, 48, 36, 0.16);
  }
  .evidence-popup strong { color: var(--ink-strong); }
  .evidence-popup span { color: var(--green); }
  .evidence-popup small { color: var(--ink-soft); }
  .evidence-popup .maplibregl-popup-tip { border-top-color: var(--card-strong); }

  .toast {
    border-color: var(--card-border);
    background: var(--ink-strong);
    color: #f2f8f4;
  }

  .map-fallback { box-shadow: 0 24px 70px rgba(19, 48, 36, 0.2); }

  .province-panel { box-shadow: 0 30px 90px rgba(15, 42, 30, 0.22); border-color: rgba(255, 255, 255, 0.9); }

  .panel-tabs button { padding: 0 12px; font-size: 13px; }

  /* Executive research portfolio */
  .research-section { padding-top: 20px; background: #f6f7f3; }
  .research-section .section-heading { flex-direction: column; align-items: flex-start; gap: 4px; }
  .research-section .section-heading small { max-width: none; text-align: left; }
  .research-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; }
  .research-stats article {
    min-width: 0;
    padding: 13px;
    border: 1px solid #d3ddd5;
    background: #fff;
    border-radius: 14px;
  }
  .research-stats span { display: block; color: var(--ink-soft); font-size: 11px; font-weight: 650; line-height: 1.3; }
  .research-stats strong { display: block; margin-top: 7px; color: var(--ink-strong); font-size: 26px; line-height: 1; letter-spacing: -0.02em; }
  .research-stats small { display: block; margin-top: 4px; color: #66786f; font-size: 10px; }

  .research-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
  .research-block { min-width: 0; margin-top: 12px; padding: 15px; border: 1px solid #dce3dd; background: #fff; border-radius: 14px; }
  .research-grid .research-block { margin-top: 0; }
  .research-block h4 { color: #223d31; font-size: 13px; font-weight: 750; }
  .research-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
  .research-bar-row { display: grid; grid-template-columns: minmax(76px, 0.9fr) minmax(64px, 1.1fr) auto; align-items: center; gap: 8px; }
  .research-bar-row > span { min-width: 0; color: #40564c; font-size: 11px; line-height: 1.35; overflow-wrap: anywhere; }
  .research-bar-row > i { height: 7px; overflow: hidden; background: #dfe7e0; border-radius: 99px; }
  .research-bar-row > i b { display: block; height: 100%; background: var(--green); border-radius: inherit; }
  .research-bar-row > strong { color: #223d31; font-size: 11px; white-space: nowrap; }

  .district-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
  .district-chip {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    min-height: 46px;
    padding: 7px 11px;
    border: 1px solid #cfdbd2;
    background: #f2f6f2;
    border-radius: 11px;
    cursor: pointer;
    text-align: left;
    transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
  }
  .district-chip:hover { background: #e2efe6; border-color: #74a98c; transform: translateY(-1px); }
  .district-chip strong { color: #14392b; font-size: 12px; font-weight: 750; }
  .district-chip span { color: var(--ink-soft); font-size: 10px; }

  .funding-block .funding-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: 12px; }
  .funding-grid article { min-width: 0; padding: 11px; background: #f2f6f2; border-radius: 11px; }
  .funding-grid span { display: block; color: var(--ink-soft); font-size: 10px; line-height: 1.35; }
  .funding-grid strong { display: block; margin-top: 6px; color: var(--ink-strong); font-size: 17px; line-height: 1; overflow-wrap: anywhere; }
  .funding-grid small { display: block; margin-top: 3px; color: #66786f; font-size: 9px; }
  .funding-note { display: block; margin-top: 10px; color: #77857e; font-size: 10px; line-height: 1.5; }

  .research-gaps { margin-top: 12px; border: 1px dashed #c3d0c6; background: #f6f8f4; border-radius: 12px; }
  .research-gaps summary { padding: 11px 13px; color: #52645b; cursor: pointer; font-size: 11px; font-weight: 650; list-style: none; }
  .research-gaps summary::-webkit-details-marker { display: none; }
  .research-gaps ul { margin: 0; padding: 0 16px 12px 28px; color: #66786f; font-size: 11px; line-height: 1.6; }

  .project-tools { display: flex; flex-direction: column; gap: 10px; }
  .project-tools .filter-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .project-tools .filter-row label { display: flex; flex-direction: column; gap: 5px; }
  .project-tools .filter-row label > span { color: #607168; font-size: 10px; font-weight: 650; }
  .project-tools select {
    width: 100%;
    min-height: 44px;
    padding: 0 11px;
    border: 1px solid #d6ded6;
    background: #fff;
    color: #173127;
    border-radius: 12px;
    font: inherit;
    font-size: 13px;
  }
  .project-tools select:focus-visible { outline: 3px solid #61b58a; outline-offset: 2px; }

  .project-people { display: flex; flex-direction: column; gap: 2px; margin-top: 9px; padding: 10px 12px; background: #eef4ef; border-radius: 11px; }
  .project-people span { color: #607168; font-size: 10px; font-weight: 650; }
  .project-people strong { color: #14392b; font-size: 13px; font-weight: 700; line-height: 1.4; }

  @media (max-width: 720px) {
    .research-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .research-grid { grid-template-columns: 1fr; }
    .funding-block .funding-grid { grid-template-columns: 1fr; }
    .panel-tabs button { font-size: 12.5px; }
  }

  @media (max-width: 460px) {
    .project-tools .filter-row { grid-template-columns: 1fr; }
  }
}

/* Region-first drill, executive map lenses, and 2026 panel polish. */
@layer lightmap {
  /* Region pills on the country view */
  .region-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    padding: 9px 16px;
    border: 1px solid rgba(23, 103, 71, 0.22);
    background: rgba(255, 255, 255, 0.94);
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 8px 26px rgba(19, 48, 36, 0.16);
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
  }
  .region-label[hidden] { display: none; }
  .region-label:hover { background: var(--green-deep); border-color: var(--green-deep); transform: scale(1.06); }
  .region-label strong { color: var(--ink-strong); font-size: 13px; font-weight: 800; white-space: nowrap; }
  .region-label span { color: var(--ink-soft); font-size: 10px; white-space: nowrap; }
  .region-label:hover strong, .region-label:hover span { color: #fff; }

  #backToCountry {
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    font-size: 12px;
    font-weight: 750;
    color: #fff;
    background: var(--green-deep);
    border-color: var(--green-deep);
  }
  #backToCountry[hidden] { display: none; }

  /* Map mode dock */
  .mode-dock {
    position: fixed;
    left: 50%;
    bottom: 18px;
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 3px;
    min-height: 56px;
    padding: 6px;
    transform: translateX(-50%);
    border: 1px solid var(--card-border);
    background: var(--card);
    border-radius: 999px;
    backdrop-filter: blur(18px);
    box-shadow: 0 14px 44px rgba(19, 48, 36, 0.14);
  }
  .mode-dock .dock-label { padding: 0 8px 0 12px; color: var(--ink-soft); font-size: 9px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
  .mode-dock button {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 13px;
    border: 0;
    background: transparent;
    color: var(--ink-soft);
    border-radius: 999px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    transition: color 150ms ease, background 150ms ease;
  }
  .mode-dock button i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.75; }
  .mode-dock button:hover { color: var(--ink-strong); background: rgba(255, 255, 255, 0.85); }
  .mode-dock button.active { color: #fff; background: var(--green-deep); }
  .mode-dock button.active i { opacity: 1; }
  .mode-dock [data-map-mode="projects"] i { background: #2e7d51; }
  .mode-dock [data-map-mode="sra"] i { background: #c96a2c; }
  .mode-dock [data-map-mode="innovation"] i { background: #3a78a8; }
  .mode-dock [data-map-mode="coverage"] i { background: #54a578; }
  .mode-dock [data-map-mode="f4"] i { background: #8060b8; }
  .mode-dock button.active[data-map-mode] i { background: #fff; }

  .evidence-legend ol { grid-template-columns: repeat(2, 1fr); gap: 6px; }
  .evidence-legend li { font-size: 10px; }
  .evidence-legend i { flex: 0 0 auto; }

  /* Hero: name + chips, no boxy ring */
  .province-hero { min-height: 0; flex-direction: column; align-items: stretch; gap: 12px; padding: 4px 26px 20px; }
  .hero-text { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
  .province-title-block h1 { font-size: clamp(32px, 3.4vw, 44px); line-height: 1.06; }
  .province-title-block p { margin: 0; font-size: 13px; white-space: nowrap; }
  .hero-chips { display: flex; flex-wrap: wrap; gap: 7px; }
  .hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid #dbe2db;
    background: #fff;
    border-radius: 999px;
    color: var(--ink-soft);
    font-size: 12px;
    font-weight: 650;
    white-space: nowrap;
  }
  /* Segmented tabs 2026 */
  .panel-tabs {
    min-height: 0;
    margin: 0 20px 14px;
    padding: 4px;
    border: 1px solid #dfe6df;
    border-top: 1px solid #dfe6df;
    background: #eaefe9;
    border-radius: 999px;
    gap: 2px;
  }
  .panel-tabs button {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12.5px;
    white-space: nowrap;
  }
  .panel-tabs button.active {
    color: #fff;
    background: var(--green-deep);
    box-shadow: 0 6px 18px rgba(15, 74, 50, 0.28);
  }
  .panel-tabs button:hover:not(.active) { color: var(--ink-strong); background: rgba(255, 255, 255, 0.75); }

  /* Stat cards: number-first, single-line labels */
  .research-stats article { display: flex; flex-direction: column; padding: 14px 13px; border: 1px solid #e2e8e1; border-radius: 16px; }
  .research-stats strong { order: 1; margin: 0; font-size: 27px; font-weight: 780; font-variant-numeric: tabular-nums; }
  .research-stats span { order: 2; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .research-stats small { order: 3; margin-top: 1px; }

  .funding-grid strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
  .decision-card > strong { font-variant-numeric: tabular-nums; }
  .record-kicker span { white-space: nowrap; }
  .research-bar-row > strong, .clean-bar-row > strong { font-variant-numeric: tabular-nums; }
  .section-heading > span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .source-row small { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

  /* Unify card language across sections */
  .executive-dimension, .data-card, .research-block, .clean-metric, .decision-card { border-color: #e3e9e2; box-shadow: none; }
  .data-card:hover { box-shadow: 0 10px 26px rgba(15, 60, 42, 0.08); }
  .panel-footer { border-radius: 16px; }

  @media (max-width: 980px) {
    .mode-dock { max-width: calc(100vw - 20px); overflow-x: auto; scrollbar-width: none; border-radius: 20px; }
    .mode-dock::-webkit-scrollbar { display: none; }
    .mode-dock .dock-label { display: none; }
    .mode-dock button { flex: 0 0 auto; }
  }

  @media (max-width: 720px) {
    .mode-dock { left: 10px; right: 10px; bottom: 10px; transform: none; justify-content: flex-start; }
    .map-actions { left: auto; right: 12px; bottom: 84px; }
    .evidence-legend { bottom: 76px; width: 216px; }
    .region-label { padding: 7px 12px; }
    .region-label strong { font-size: 12px; }
    .province-hero { padding: 2px 20px 16px; }
    .panel-tabs { margin: 0 14px 12px; overflow-x: auto; scrollbar-width: none; }
    .panel-tabs::-webkit-scrollbar { display: none; }
    .panel-tabs button { flex: 0 0 auto; min-height: 42px; padding: 0 13px; }
    body.panel-open .mode-dock { opacity: 0; pointer-events: none; }
  }
}

/* Premium editorial pass: restrained ink-and-ivory chrome, region-only
   country view, selection drawn as outline instead of a paint-over. */
@layer lightmap {
  :root {
    --paper: #f1f2ed;
    --ink-strong: #141d18;
    --ink-soft: #5a675f;
    --green: #17573f;
    --green-deep: #123f2e;
    --hairline: rgba(20, 29, 24, 0.12);
    --card: rgba(255, 255, 255, 0.92);
  }

  body { background: var(--paper); }
  .atlas-shell { background: var(--paper); }

  /* Region chips: single-line, ink, quiet until hovered */
  .region-label {
    flex-direction: row;
    align-items: baseline;
    gap: 7px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(20, 29, 24, 0.88);
    border-radius: 10px;
    box-shadow: 0 6px 22px rgba(16, 26, 20, 0.22);
    backdrop-filter: blur(6px);
  }
  .region-label strong { color: #f4f6f2; font-size: 13px; font-weight: 700; letter-spacing: 0.01em; }
  .region-label span { color: rgba(233, 240, 233, 0.55); font-size: 11px; font-variant-numeric: tabular-nums; }
  .region-label:hover, .region-label.is-hovered {
    background: #f4f6f2;
    border-color: rgba(20, 29, 24, 0.2);
    transform: translateY(-1px);
  }
  .region-label:hover strong, .region-label.is-hovered strong { color: var(--ink-strong); }
  .region-label:hover span, .region-label.is-hovered span { color: var(--ink-soft); }

  /* Header: straighten the brand, hairline surfaces */
  .brand { border-color: var(--hairline); background: var(--card); border-radius: 12px; box-shadow: 0 4px 18px rgba(16, 26, 20, 0.08); }
  .brand-mark { background: var(--ink-strong); border-radius: 8px; transform: none; }
  .brand-mark i { background: #8fe0b6; }
  .brand strong { letter-spacing: 0.05em; }
  .province-picker { border-color: var(--hairline); background: var(--card); border-radius: 12px; box-shadow: 0 8px 30px rgba(16, 26, 20, 0.1); }
  .picker-dot { background: var(--green); box-shadow: none; }
  .picker-chevron { color: var(--ink-soft); font-size: 18px; }
  .live-state, .header-meta a { border-color: var(--hairline); background: var(--card); border-radius: 10px; }
  .header-meta a { color: #f4f6f2; background: var(--ink-strong); border-color: var(--ink-strong); }
  .header-meta .insights-link { color: var(--ink-strong); background: var(--card); border-color: var(--hairline); }
  .live-state i { background: var(--green); box-shadow: none; }

  /* Prompt: quiet caption, no gimmick pointer */
  .map-prompt { padding: 9px 14px; border-color: var(--hairline); background: var(--card); border-radius: 10px; box-shadow: 0 4px 16px rgba(16, 26, 20, 0.07); }
  .prompt-pointer { display: none; }
  .map-prompt strong { font-size: 12px; font-weight: 700; }
  .map-prompt small { color: var(--ink-soft); }

  .map-actions button { border-color: var(--hairline); background: var(--card); border-radius: 10px; box-shadow: 0 4px 16px rgba(16, 26, 20, 0.07); }
  #backToCountry { color: #f4f6f2; background: var(--ink-strong); border-color: var(--ink-strong); }
  #backToCountry[hidden] { display: none; }

  /* Mode dock: ink active state, squared geometry */
  .mode-dock { min-height: 52px; padding: 5px; border-color: var(--hairline); background: var(--card); border-radius: 14px; box-shadow: 0 10px 34px rgba(16, 26, 20, 0.12); }
  .mode-dock .dock-label { color: var(--ink-soft); }
  .mode-dock button { min-height: 40px; border-radius: 10px; font-size: 12px; }
  .mode-dock button:hover { background: rgba(20, 29, 24, 0.05); }
  .mode-dock button.active { color: #f4f6f2; background: var(--ink-strong); }
  .mode-dock button i { width: 7px; height: 7px; }

  /* Legend: hairline card, square swatches */
  .evidence-legend { width: 264px; padding: 13px 14px; border-color: var(--hairline); background: var(--card); border-radius: 12px; box-shadow: 0 8px 28px rgba(16, 26, 20, 0.1); }
  .evidence-legend strong { color: var(--ink-strong); font-size: 12px; }
  .evidence-legend small { color: var(--ink-soft); }
  .evidence-legend ol { margin-top: 9px; gap: 5px 10px; }
  .evidence-legend li { color: var(--ink-soft); font-size: 10px; }
  .evidence-legend i { width: 11px; height: 11px; border-radius: 3px; }

  .evidence-popup .maplibregl-popup-content { border-color: var(--hairline); border-radius: 10px; box-shadow: 0 10px 30px rgba(16, 26, 20, 0.16); }
  .evidence-popup span { color: var(--green); font-weight: 650; }

  .province-map-label { border-color: var(--hairline); background: rgba(255, 255, 255, 0.92); border-radius: 8px; box-shadow: 0 2px 10px rgba(16, 26, 20, 0.1); }
  .province-map-label:hover, .province-map-label.is-hovered, .province-map-label.is-active {
    color: #f4f6f2;
    background: var(--ink-strong);
    border-color: var(--ink-strong);
    transform: translateY(-1px);
  }

  /* Panel: squarer, calmer, single accent */
  .province-panel { border: 1px solid var(--hairline); background: #f7f8f4; border-radius: 20px; box-shadow: 0 24px 80px rgba(16, 26, 20, 0.18); }
  .panel-content { background: #f7f8f4; }
  .panel-head { padding-top: 14px; }
  .api-chip { color: var(--green); }
  .api-chip i { background: var(--green); box-shadow: none; }
  .panel-close { background: rgba(20, 29, 24, 0.06); border-radius: 12px; }
  .panel-close:hover { background: var(--ink-strong); transform: none; }

  .province-title-block h1 { color: var(--ink-strong); letter-spacing: -0.03em; }
  .hero-chip { border-color: var(--hairline); border-radius: 10px; }
  .panel-tabs { border: 1px solid var(--hairline); background: rgba(20, 29, 24, 0.045); border-radius: 12px; }
  .panel-tabs button { border-radius: 9px; }
  .panel-tabs button.active { color: #f4f6f2; background: var(--ink-strong); box-shadow: none; }
  .panel-tabs button:hover:not(.active) { color: var(--ink-strong); background: rgba(255, 255, 255, 0.85); }

  .panel-section { padding: 24px 26px; }
  .research-section, .briefing-section, .executive-overview { background: transparent; }
  .decision-section { background: rgba(20, 29, 24, 0.035); }
  .section-heading > span { font-size: 15px; letter-spacing: -0.01em; }
  .section-heading small { color: var(--ink-soft); }

  .research-stats article, .research-block, .executive-dimension, .data-card, .clean-metric, .decision-card {
    border: 1px solid var(--hairline);
    border-radius: 14px;
    box-shadow: none;
  }
  .research-stats strong { font-size: 25px; letter-spacing: -0.02em; }
  .research-stats span, .funding-grid span, .decision-card > span { color: var(--ink-soft); }
  .research-bar-row > i b { background: var(--green); }
  .district-chip { border: 1px solid var(--hairline); background: #fff; border-radius: 10px; }
  .district-chip:hover { background: var(--ink-strong); border-color: var(--ink-strong); transform: none; }
  .district-chip:hover strong, .district-chip:hover span { color: #f4f6f2; }
  .funding-grid article { background: rgba(20, 29, 24, 0.04); border-radius: 10px; }
  .research-gaps { border-color: var(--hairline); }

  .data-card:hover { transform: none; border-color: rgba(20, 29, 24, 0.28); box-shadow: none; }
  .decision-card:hover { border-color: rgba(20, 29, 24, 0.28); }
  .project-people { background: rgba(23, 87, 63, 0.07); border-radius: 10px; }
  .record-kicker span { color: var(--green); background: rgba(23, 87, 63, 0.09); }
  .load-more, .panel-footer > a { border-radius: 10px; }
  .panel-footer { border: 1px solid var(--hairline); background: rgba(20, 29, 24, 0.035); }
  .briefing-fact { border-color: var(--hairline); border-radius: 12px; }
  .source-row { border-color: var(--hairline); border-radius: 12px; }
  .tourism-block, .tourism-facts article { border-color: var(--hairline); }

  @media (max-width: 720px) {
    .region-label { padding: 7px 11px; }
    .region-label strong { font-size: 12px; }
    .province-panel { border-radius: 18px; }
  }
}

/* The shell tracks the dynamic viewport so mobile URL bars never push the
   map taller than the visible screen. */
@layer lightmap {
  @supports (height: 100dvh) {
    .atlas-shell { height: 100dvh; }
  }
}

/* Thai typography pass: Thai script carries stacked vowels and tone marks,
   so negative tracking and tight line-heights make it look crushed. Zero
   tracking on Thai text, roomier line-heights, and readable sizes for the
   tourism/culture cards that still used 10px type. */
@layer lightmap {
  .province-title-block h1 { letter-spacing: 0; }
  .data-card h3 { letter-spacing: 0; line-height: 1.55; }
  .section-heading > span { letter-spacing: 0; }
  .decision-card > strong, .research-stats strong { letter-spacing: 0; }
  .briefing-fact p { line-height: 1.65; }
  .executive-dimension > header p { line-height: 1.65; }

  .tourism-block h3 { font-size: 15px; line-height: 1.5; }
  .tourism-block header span { font-size: 12px; }
  .tourism-facts span { font-size: 12px; line-height: 1.5; }
  .tourism-facts strong { font-size: 22px; }
  .tourism-place { grid-template-columns: 72px minmax(0, 1fr); gap: 12px; padding: 11px; }
  .tourism-place img { width: 72px; height: 72px; }
  .tourism-place span { font-size: 11px; }
  .tourism-place strong { margin-top: 4px; font-size: 14px; line-height: 1.5; }
  .tourism-place p { margin-top: 5px; font-size: 12px; line-height: 1.6; }
  .schedule-row { min-height: 62px; padding: 11px 13px; gap: 12px; }
  .schedule-row time { font-size: 15px; }
  .schedule-row div strong { font-size: 13px; line-height: 1.5; }
  .schedule-row div span { margin-top: 3px; font-size: 11.5px; line-height: 1.55; }
  .schedule-row b { font-size: 12px; }
  .tourism-station { padding: 12px; }
  .tourism-station strong { font-size: 13px; line-height: 1.5; }
  .tourism-station span { margin-top: 4px; font-size: 11.5px; }
  .transport-tags span { padding: 7px 11px; font-size: 11.5px; line-height: 1.4; }
  .tourism-source-link { font-size: 13px; }

  .culture-card { grid-template-columns: 76px 1fr; gap: 13px; }
  .culture-card > img { width: 76px; height: 76px; }
  .culture-card > div > p { font-size: 13px; line-height: 1.6; }
  .collection-tools label > span { font-size: 11px; }

  @media (max-width: 720px) {
    .tourism-place strong { font-size: 15px; }
    .tourism-place p, .schedule-row div span, .tourism-station span { font-size: 12.5px; }
  }
}

/* Overlay layout pass: the actions row and the legend used to be two fixed
   elements aiming at the same corner and overlapped whenever the legend grew;
   they now stack inside one .map-corner column. The mode dock also moves out
   of the province panel's way instead of being buried under it. */
@layer lightmap {
  .map-corner {
    position: fixed;
    left: 22px;
    bottom: 20px;
    z-index: 18;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    pointer-events: none;
    transition: bottom 220ms ease, opacity 200ms ease;
  }
  .map-corner > * { pointer-events: auto; }
  .map-actions { position: static; z-index: auto; }
  .evidence-legend {
    position: static;
    width: 264px;
    max-width: calc(100vw - 44px);
  }
  .evidence-legend > div { display: block; }
  .evidence-legend > div small { display: block; margin-top: 3px; line-height: 1.45; }

  .mode-dock { transition: left 240ms ease, opacity 200ms ease; }

  /* Desktop with the panel open: the panel owns the right side, so the dock
     recenters inside the strip of map that stays visible and the legend
     yields (its colors are hidden behind the panel anyway). */
  @media (min-width: 1080px) {
    body.panel-open .mode-dock {
      left: calc((100vw - min(640px, 100vw - 20px) - 18px) / 2);
      max-width: calc(100vw - min(640px, 100vw - 20px) - 60px);
      overflow-x: auto;
      scrollbar-width: none;
    }
    body.panel-open .mode-dock::-webkit-scrollbar { display: none; }
  }
  @media (min-width: 721px) and (max-width: 1079px) {
    body.panel-open .mode-dock { opacity: 0; pointer-events: none; }
  }
  @media (min-width: 721px) {
    body.panel-open .evidence-legend { display: none; }
    body.panel-open .map-corner { bottom: 84px; }
    .province-panel { top: 84px; }
  }

  /* Narrower desktops: the centered dock slides toward the left corner
     column, so lift the column above the dock instead of letting them cross. */
  @media (min-width: 721px) and (max-width: 1159px) {
    .map-corner { bottom: 84px; }
  }

  @media (max-width: 720px) {
    .map-corner { left: 12px; bottom: 74px; gap: 8px; }
    .evidence-legend { width: min(264px, calc(100vw - 24px)); }
    body.panel-open .map-corner { opacity: 0; pointer-events: none; }
  }
}

/* Executive overview additions: three-pillar cards, PPPConnext poverty
   households, municipal city conditions, and housing dataset links. Thai
   text keeps zero tracking and roomy line-heights throughout. */
@layer lightmap {
  .pillars-section { padding-top: 20px; }
  .pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .pillar-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    min-width: 0;
    padding: 16px 15px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--ink-strong);
    transition: border-color 150ms ease;
  }
  .pillar-card:hover { border-color: rgba(20, 29, 24, 0.35); }
  .pillar-card:focus-visible { outline: 3px solid #61b58a; outline-offset: 2px; }
  .pillar-kicker { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-soft); font-size: 11px; font-weight: 750; letter-spacing: 0; }
  .pillar-kicker i { width: 8px; height: 8px; border-radius: 50%; }
  .pillar-projects .pillar-kicker i { background: #2e7d51; }
  .pillar-sra .pillar-kicker i { background: #c96a2c; }
  .pillar-innovation .pillar-kicker i { background: #3a78a8; }
  .pillar-card > strong { font-size: 30px; font-weight: 780; line-height: 1.1; font-variant-numeric: tabular-nums; letter-spacing: 0; }
  .pillar-card > small { color: var(--ink-soft); font-size: 11.5px; line-height: 1.5; }
  .pillar-card ul { display: flex; flex-direction: column; gap: 4px; margin: 4px 0 0; padding: 0; list-style: none; }
  .pillar-card li { color: #40564c; font-size: 11.5px; line-height: 1.55; }
  .pillar-scores { display: flex; flex-direction: column; gap: 5px; width: 100%; margin-top: 6px; }
  .pillar-score-row { display: grid; grid-template-columns: minmax(88px, 1fr) minmax(36px, 1.1fr) auto; align-items: center; gap: 7px; }
  .pillar-score-row span { color: #40564c; font-size: 11px; line-height: 1.45; }
  .pillar-score-row i { height: 6px; overflow: hidden; background: #efe6da; border-radius: 99px; }
  .pillar-score-row i b { display: block; height: 100%; background: #dd8a4a; border-radius: inherit; }
  .pillar-score-row strong { font-size: 11px; font-variant-numeric: tabular-nums; }
  .pillar-score-row.is-weakest span { color: #8a3d10; font-weight: 750; }
  .pillar-score-row.is-weakest i b { background: #b4551d; }
  .pillar-flag { margin: 6px 0 0; padding: 6px 9px; background: rgba(180, 85, 29, 0.09); border-radius: 8px; color: #8a3d10; font-size: 11px; line-height: 1.5; }
  .pillar-note { margin: 4px 0 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.55; }
  .pillar-na { color: var(--ink-soft); }

  .poverty-section { background: rgba(180, 85, 29, 0.05); }
  .poverty-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .poverty-stats article { padding: 13px; border: 1px solid var(--hairline); background: #fff; border-radius: 12px; }
  .poverty-stats span { display: block; color: var(--ink-soft); font-size: 11px; line-height: 1.4; }
  .poverty-stats strong { display: block; margin-top: 5px; font-size: 24px; font-weight: 780; font-variant-numeric: tabular-nums; letter-spacing: 0; }
  .poverty-rows { display: flex; flex-direction: column; gap: 7px; margin-top: 12px; }
  .poverty-row { display: grid; grid-template-columns: minmax(118px, 0.9fr) minmax(52px, 1.2fr) auto; align-items: center; gap: 8px; }
  .poverty-row span { color: #40564c; font-size: 11.5px; line-height: 1.5; }
  .poverty-row i { height: 8px; overflow: hidden; background: #ece6dc; border-radius: 99px; }
  .poverty-row i b { display: block; height: 100%; border-radius: inherit; }
  .poverty-row strong { font-size: 11.5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
  .poverty-row strong small { color: var(--ink-soft); font-size: 10px; }
  .poverty-benchmark { margin: 12px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.6; }
  .poverty-benchmark a { color: var(--green); font-weight: 700; }

  .city-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
  .city-card dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px 10px; margin: 10px 0 0; }
  .city-card dt { color: var(--ink-soft); font-size: 10.5px; line-height: 1.4; }
  .city-card dd { margin: 2px 0 0; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }

  .housing-links { display: flex; flex-direction: column; gap: 8px; }
  .housing-spatial-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 9px;
    margin-bottom: 12px;
  }
  .housing-spatial-kpis article {
    padding: 14px;
    border: 1px solid var(--hairline);
    background: linear-gradient(145deg, #fff 0%, #f4f7f2 100%);
    border-radius: 14px;
  }
  .housing-spatial-kpis span,
  .housing-spatial-kpis small { display: block; color: var(--ink-soft); font-size: 10.5px; line-height: 1.45; }
  .housing-spatial-kpis strong { display: block; margin: 6px 0 3px; font-size: 23px; font-variant-numeric: tabular-nums; }
  .housing-spatial-chart {
    margin-bottom: 12px;
    padding: 14px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 14px;
  }
  .housing-spatial-chart header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
  .housing-spatial-chart header strong { font-size: 12.5px; }
  .housing-spatial-chart header small { color: var(--ink-soft); font-size: 10.5px; }
  .housing-bar { display: grid; grid-template-columns: minmax(88px, .8fr) minmax(100px, 2fr) 54px; align-items: center; gap: 9px; margin-top: 7px; }
  .housing-bar span, .housing-bar strong { font-size: 11px; }
  .housing-bar strong { text-align: right; font-variant-numeric: tabular-nums; }
  .housing-bar i { height: 8px; overflow: hidden; background: #ece6dc; border-radius: 99px; }
  .housing-bar i b { display: block; height: 100%; background: linear-gradient(90deg, #e99b62, #d57555); border-radius: inherit; }
  .housing-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 56px;
    padding: 10px 13px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 12px;
  }
  .housing-link strong { display: block; font-size: 12.5px; line-height: 1.5; }
  .housing-link small { display: block; margin-top: 2px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
  .housing-link a { flex: 0 0 auto; padding: 8px 13px; background: var(--ink-strong); color: #f4f6f2; border-radius: 9px; font-size: 11px; font-weight: 750; text-decoration: none; }

  @media (max-width: 720px) {
    .pillar-grid { grid-template-columns: 1fr; }
    .housing-spatial-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .housing-spatial-chart header { display: block; }
    .housing-spatial-chart header small { display: block; margin-top: 3px; }
  }
}

@layer lightmap {
  .housing-more { margin: 4px 0 0; color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
}

/* Cards whose source record has no image span the full card width instead
   of being squeezed into the reserved image column. */
@layer lightmap {
  .culture-card.no-image { grid-template-columns: minmax(0, 1fr); }
  .culture-card.no-image h3 { margin-top: 6px; }
  .tourism-place.no-image { grid-template-columns: minmax(0, 1fr); }
}

/* Province decision audit: semantic stages, provisional project groups,
   SRA activity, and field-level data quality. */
@layer lightmap {
  .section-method-note {
    margin: -4px 0 14px;
    padding: 9px 11px;
    border-left: 3px solid #d29a64;
    background: #fbf4eb;
    color: #6c5038;
    font-size: 11px;
    line-height: 1.6;
  }
  .metric-na { color: var(--ink-soft) !important; }

  .decision-chain {
    display: grid;
    grid-template-columns: repeat(5, minmax(128px, 1fr));
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }
  .decision-stage {
    min-width: 128px;
    padding: 11px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 12px;
  }
  .decision-stage > header { display: flex; align-items: center; gap: 8px; }
  .decision-stage > header > i {
    width: 23px;
    height: 23px;
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    background: #e6eee8;
    border-radius: 50%;
    color: #245b42;
    font-size: 10px;
    font-style: normal;
    font-weight: 800;
  }
  .decision-stage > header span { display: block; color: var(--ink-strong); font-size: 11.5px; font-weight: 750; line-height: 1.4; }
  .decision-stage > header small { display: block; margin-top: 1px; color: var(--ink-soft); font-size: 9px; }
  .decision-stage.status-not_available > header > i { background: #eceeeb; color: #7b837d; }
  .decision-stage.status-limited > header > i { background: #f5e8d8; color: #98521f; }
  .decision-stage-metrics { display: flex; flex-direction: column; gap: 5px; margin-top: 10px; }
  .decision-stage-metrics p { margin: 0; }
  .decision-stage-metrics span { display: block; color: var(--ink-soft); font-size: 9px; line-height: 1.35; }
  .decision-stage-metrics strong { display: block; margin-top: 2px; color: var(--ink-strong); font-size: 12px; line-height: 1.35; }
  .decision-stage-empty { color: #98a098; font-size: 18px; }
  .decision-stage > footer { margin-top: 9px; color: #64736a; font-size: 9.5px; line-height: 1.5; }

  .research-stats { grid-template-columns: repeat(auto-fit, minmax(106px, 1fr)); }
  .funding-warning {
    margin: 9px 0 0;
    padding: 8px 10px;
    background: #fff1e7;
    border-radius: 8px;
    color: #8b481f;
    font-size: 10.5px;
    line-height: 1.55;
  }
  .project-record-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
  .project-record-stats > span { padding: 6px 8px; background: #edf3ee; border-radius: 8px; color: #40564c; font-size: 10.5px; }
  .project-record-stats strong { color: #173f2d; font-variant-numeric: tabular-nums; }
  .project-geography { display: grid; gap: 3px; margin: 10px 0 0; }
  .project-geography span { color: var(--ink-soft); font-size: 10px; }
  .project-geography strong { font-size: 11.5px; font-weight: 600; line-height: 1.6; }
  .project-data-gap { margin: 9px 0 0; padding: 7px 9px; background: #f4f4f1; border-radius: 8px; color: #68726c; font-size: 10.5px; line-height: 1.5; }
  .project-participants { margin-top: 9px; border-top: 1px solid var(--hairline); }
  .project-participants summary { padding: 9px 0 4px; color: #285f45; cursor: pointer; font-size: 10.5px; font-weight: 700; }
  .project-participants ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; margin: 5px 0 3px; padding-left: 18px; }
  .project-participants li { color: #506259; font-size: 10.5px; line-height: 1.45; }

  .sra-area-section { background: #fcf7f1; }
  .sra-area-summary, .sra-project-metrics, .quality-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(125px, 1fr)); gap: 8px; }
  .sra-area-summary article, .sra-project-metrics article, .quality-stats article {
    padding: 11px;
    border: 1px solid var(--hairline);
    background: #fff;
    border-radius: 11px;
  }
  .sra-area-summary span, .sra-project-metrics span, .quality-stats span { display: block; color: var(--ink-soft); font-size: 10px; line-height: 1.45; }
  .sra-area-summary strong, .sra-project-metrics strong, .quality-stats strong { display: block; margin-top: 5px; color: var(--ink-strong); font-size: 20px; line-height: 1.2; font-variant-numeric: tabular-nums; }
  .sra-area-summary small, .sra-project-metrics small, .quality-stats small { display: block; margin-top: 3px; color: #64736a; font-size: 9px; line-height: 1.45; }
  .sra-area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-top: 10px; }
  .sra-detail-block { margin-top: 10px; padding: 12px; border: 1px solid var(--hairline); background: #fff; border-radius: 12px; }
  .sra-area-grid .sra-detail-block { height: 100%; margin-top: 0; }
  .sra-detail-block h4 { margin: 0 0 9px; color: #3f4f47; font-size: 11.5px; }
  .sra-table { display: flex; flex-direction: column; gap: 5px; }
  .sra-table p { display: grid; grid-template-columns: minmax(76px, 1fr) repeat(3, auto); align-items: center; gap: 7px; margin: 0; padding-bottom: 5px; border-bottom: 1px solid #edf0ec; }
  .sra-table p:last-child { border-bottom: 0; }
  .sra-table strong, .sra-table span { font-size: 9.5px; line-height: 1.4; }
  .sra-table span { color: #5f6f66; text-align: right; white-space: nowrap; }

  .evidence-stage { display: inline-flex; margin-left: 7px; padding: 3px 6px; background: #e8eee9; border-radius: 99px; color: #426252; font-size: 8.5px; font-weight: 700; vertical-align: middle; }
  .evidence-stage.stage-input { background: #f5e9d9; color: #8e5629; }
  .evidence-stage.stage-output { background: #e6eef6; color: #315f86; }

  .quality-stats article.is-warning { border-color: #e9b48c; background: #fff7f0; }
  .quality-stats article.is-warning strong { color: #9a4e1d; }
  .quality-alert { margin: 10px 0 0; padding: 10px 12px; border-left: 3px solid #b4551d; background: #fff2e8; color: #75401f; font-size: 11px; line-height: 1.6; }
  .quality-rules { margin: 10px 0 0; padding-left: 19px; color: #4f6157; font-size: 10.5px; line-height: 1.65; }
  .source-row { align-items: start; }
  .source-row .source-detail { gap: 2px; }
  .source-row .source-detail > small { display: block; overflow: visible; -webkit-line-clamp: unset; }
  .source-detail p { margin: 4px 0 0; color: #5c6c63; font-size: 9.5px; line-height: 1.45; overflow-wrap: anywhere; }
  .source-detail p > span { display: inline; margin-right: 5px; color: #2f4439; font-weight: 700; }
  .source-detail .source-note { margin-top: 6px; padding: 6px 8px; background: #f2f4f0; border-radius: 7px; }

  @media (max-width: 720px) {
    .decision-chain { grid-template-columns: repeat(5, minmax(150px, 1fr)); }
    .sra-area-grid { grid-template-columns: 1fr; }
    .sra-table p { grid-template-columns: minmax(86px, 1fr) auto; }
    .sra-table p span:nth-of-type(n+2) { display: none; }
    .project-participants ul { grid-template-columns: 1fr; }
  }
}

/* Disaster tracking section */
.disaster-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.disaster-summary article {
  padding: 10px 12px;
  background: #fff5f5;
  border: 1px solid #f0c4c4;
  border-radius: 8px;
}

/* F1 poverty-eradication journey: country overview, region drilldown and a
   province view backed only by reviewed public artifacts. */
@layer lightmap {
  .mode-dock [data-map-mode="f1"] i { background: #c45f24; }

  .f1-country-panel {
    position: fixed;
    top: 92px;
    right: 22px;
    bottom: 84px;
    z-index: 32;
    width: min(470px, calc(100vw - 44px));
    overflow-y: auto;
    overscroll-behavior: contain;
    border: 1px solid rgba(255, 255, 255, 0.72);
    background: #f8f7f2;
    color: var(--ink-strong);
    border-radius: 24px;
    box-shadow: 0 24px 70px rgba(24, 32, 26, 0.2);
    scrollbar-width: thin;
  }
  .f1-country-panel[hidden] { display: none; }
  .f1-country-head {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 13px;
    border-bottom: 1px solid var(--hairline);
    background: rgba(248, 247, 242, 0.96);
    backdrop-filter: blur(18px);
  }
  .f1-kicker {
    display: inline-flex;
    min-height: 25px;
    align-items: center;
    padding: 0 9px;
    color: #fff8ef;
    background: #a84d18;
    border-radius: 7px;
    font-size: 10px;
    font-weight: 800;
  }
  .f1-country-head h2 { margin: 7px 0 0; font-size: 25px; line-height: 1.2; }
  .f1-country-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.5; }
  .f1-country-head > button {
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
    border: 1px solid var(--hairline);
    background: #fff;
    color: var(--ink-strong);
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    font-size: 21px;
  }
  :is(.f1-flow, .f4-flow) { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 10px 20px 6px; }
  :is(.f1-flow, .f4-flow) span { display: flex; align-items: center; gap: 6px; color: #66736b; font-size: 11.5px; line-height: 1.35; }
  :is(.f1-flow, .f4-flow) b { width: 22px; height: 22px; display: grid; place-items: center; flex: 0 0 auto; background: #e8e9e3; border-radius: 50%; font-size: 9px; }
  :is(.f1-flow, .f4-flow) span.active { color: #8f441a; font-weight: 750; }
  :is(.f1-flow, .f4-flow) span.active b { color: #fff; background: #b4551d; }
  .f1-country-loading { margin: 18px 22px; padding: 18px; color: var(--ink-soft); background: #fff; border: 1px solid var(--hairline); border-radius: 14px; font-size: 12px; text-align: center; }
  .f1-country-content { padding: 6px 20px 20px; }
  .f1-country-kpis, .f1-province-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .f1-country-kpis button, .f1-province-kpis button {
    min-width: 0;
    min-height: 104px;
    padding: 10px;
    border: 1px solid #dedfd8;
    background: #fff;
    color: var(--ink-strong);
    border-radius: 13px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
  }
  .f1-country-kpis button:hover, .f1-province-kpis button:hover { border-color: #c2764b; transform: translateY(-1px); }
  .f1-country-kpis button.active, .f1-province-kpis button.active { border-color: #b4551d; background: #fff6ee; box-shadow: inset 0 0 0 1px rgba(180, 85, 29, 0.15); }
  .f1-country-kpis button.is-missing, .f1-province-kpis button.is-missing { background: #f0f1ed; color: #69726c; }
  .f1-country-kpis button > span, .f1-province-kpis button > span { display: flex; align-items: center; gap: 7px; min-height: 30px; color: #46574e; font-size: 12px; line-height: 1.4; }
  .f1-country-kpis button > span b, .f1-province-kpis button > span b { color: #9b4719; font-size: 10px; }
  .f1-country-kpis button > strong, .f1-province-kpis button > strong { display: block; margin-top: 6px; font-size: 21px; line-height: 1.15; font-variant-numeric: tabular-nums; }
  .f1-country-kpis button > small, .f1-province-kpis button > small { display: block; margin-top: 5px; color: #5d6b63; font-size: 11px; line-height: 1.45; }

  .f1-country-detail, .f1-province-detail { margin-top: 12px; padding: 16px; border: 1px solid #dedfd8; background: #fff; border-radius: 14px; outline: none; }
  .f1-country-detail > header, .f1-province-detail > header { display: flex; align-items: baseline; gap: 8px; margin-bottom: 11px; }
  .f1-country-detail > header span, .f1-province-detail > header span { color: #9b4719; font-size: 11px; font-weight: 800; }
  .f1-country-detail > header h3, .f1-province-detail > header h3 { margin: 0; font-size: 17px; line-height: 1.4; }
  .f1-country-detail > p, .f1-province-detail > p { margin: 10px 0 0; color: #526159; font-size: 12.5px; line-height: 1.65; }
  .f1-country-content > footer { display: flex; flex-direction: column; gap: 4px; margin-top: 12px; padding: 12px 13px; border-left: 3px solid #b4551d; background: #f7eee5; color: #684b39; font-size: 11px; line-height: 1.55; }
  .f1-country-content > footer strong { font-size: 11.5px; }

  .f1-area-list { display: grid; gap: 6px; margin-top: 11px; }
  .f1-area-list button { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 5px 10px; min-height: 43px; padding: 8px 10px; border: 1px solid var(--hairline); background: #f7f8f4; color: var(--ink-strong); border-radius: 9px; cursor: pointer; font: inherit; text-align: left; }
  .f1-area-list button span { font-size: 12px; font-weight: 700; }
  .f1-area-list button strong { color: #7f3e1b; font-size: 11px; }
  .f1-area-list button > i { grid-column: 1 / -1; height: 7px; overflow: hidden; background: #e5e7e1; border-radius: 99px; }
  .f1-area-list button > i b { display: block; height: 100%; background: #c76b34; border-radius: inherit; }
  .f1-area-list button.score-hard > i b,
  .f1-score-list .score-hard i b,
  .f1-capital-chart .score-hard i b { background: #b34b3f; }
  .f1-area-list button.score-difficult > i b,
  .f1-score-list .score-difficult i b,
  .f1-capital-chart .score-difficult i b { background: #c76b34; }
  .f1-area-list button.score-fair > i b,
  .f1-score-list .score-fair i b,
  .f1-capital-chart .score-fair i b { background: #4a7d6a; }
  .f1-area-list button.score-good > i b,
  .f1-score-list .score-good i b,
  .f1-capital-chart .score-good i b { background: #2f7a56; }
  .f1-area-list button.score-missing > i b { background: #b8beb9; }
  .f1-detail-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 7px; }
  .f1-detail-stats article { min-width: 0; padding: 10px; border: 1px solid #e3e5df; background: #fafbf8; border-radius: 10px; }
  .f1-detail-stats article.is-missing { background: #f0f1ed; }
  .f1-detail-stats article.is-zero { background: #f6f7f3; }
  .f1-detail-stats article.is-zero strong { color: #68746d; }
  .f1-detail-stats span, .f1-detail-stats small { display: block; color: #5b6a62; font-size: 11px; line-height: 1.45; }
  .f1-detail-stats strong { display: block; margin: 5px 0 3px; overflow-wrap: anywhere; font-size: 18px; line-height: 1.25; font-variant-numeric: tabular-nums; }

  .f1-province-loading { margin: 22px; padding: 20px; border: 1px solid var(--hairline); background: #fff; border-radius: 14px; color: var(--ink-soft); text-align: center; }
  .province-panel.f1-only .panel-tabs { display: none; }
  .province-panel.f1-only .province-title-block { padding-bottom: 14px; }
  .f1-province-toolbar {
    position: sticky;
    top: 0;
    z-index: 8;
    padding: 12px 18px 10px;
    border-bottom: 1px solid #d9ded8;
    background: rgba(247, 248, 244, 0.97);
    box-shadow: 0 8px 18px rgba(22, 38, 29, 0.06);
    backdrop-filter: blur(16px);
  }
  .f1-province-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 9px; }
  .f1-province-heading strong { color: #263a30; font-size: 13px; line-height: 1.4; }
  .f1-province-heading small { color: #67736c; font-size: 11px; line-height: 1.4; text-align: right; }
  .f1-province-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 1px 1px 5px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }
  .f1-province-tabs button {
    min-width: 118px;
    min-height: 54px;
    flex: 0 0 auto;
    padding: 8px 10px;
    border: 1px solid #d8ddd7;
    background: #fff;
    color: #405249;
    border-radius: 10px;
    cursor: pointer;
    font: inherit;
    text-align: left;
    scroll-snap-align: start;
  }
  .f1-province-tabs button strong { display: block; font-size: 11.5px; line-height: 1.5; }
  .f1-province-tabs button small { display: block; margin-top: 2px; color: #718078; font-size: 9.5px; line-height: 1.45; }
  .f1-province-tabs button:hover { border-color: #b85d29; }
  .f1-province-tabs button.active { border-color: #173d2f; background: #173d2f; color: #fff; box-shadow: 0 6px 14px rgba(23, 61, 47, 0.16); }
  .f1-province-tabs button.active small { color: #dce9e2; }
  .f1-province-tabs button.is-missing:not(.active) { background: #f1f2ee; color: #6e7772; }
  .f1-province-detail { margin: 0; padding: 20px; border-width: 0 0 1px; border-radius: 0; }
  .f1-province-content .panel-section { border-bottom: 1px solid var(--hairline); }
  .f1-score-list { display: grid; gap: 8px; }
  .f1-score-list > div { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(90px, 1.4fr) 38px; align-items: center; gap: 8px; }
  .f1-score-list span, .f1-score-list strong { font-size: 11.5px; }
  .f1-score-list i { height: 9px; overflow: hidden; background: #eee5da; border-radius: 99px; }
  .f1-score-list i b { display: block; height: 100%; background: #c76b34; border-radius: inherit; }
  .f1-ratio-chart, .f1-trend-chart, .f1-assistance-chart { margin-top: 14px; padding-top: 12px; border-top: 1px solid #e7e9e3; }
  .f1-ratio-chart > header, .f1-trend-chart > header, .f1-assistance-chart > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
  .f1-ratio-chart > header strong, .f1-trend-chart > header strong, .f1-assistance-chart > header strong { font-size: 12.5px; }
  .f1-ratio-chart > header small, .f1-trend-chart > header small, .f1-assistance-chart > header small { color: #647168; font-size: 10.5px; line-height: 1.4; text-align: right; }
  .f1-ratio-chart > div { margin-top: 10px; }
  .f1-ratio-chart p, .f1-assistance-chart article p { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 5px; }
  .f1-ratio-chart p span, .f1-ratio-chart p strong, .f1-assistance-chart article p strong, .f1-assistance-chart article p span { font-size: 11px; line-height: 1.4; }
  .f1-ratio-chart i, .f1-assistance-chart article > i, .f1-bar-line i { display: block; height: 9px; overflow: hidden; background: #ece7df; border-radius: 99px; }
  .f1-ratio-chart i b, .f1-assistance-chart article > i b { display: block; height: 100%; background: #c76b34; border-radius: inherit; }
  .f1-ratio-chart div > small, .f1-assistance-chart article > small { display: block; margin-top: 6px; color: #5d6b63; font-size: 10.5px; line-height: 1.45; }
  .f1-chart-legend { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 8px; }
  .f1-chart-legend span { display: inline-flex; align-items: center; gap: 5px; color: #5d6b63; font-size: 10.5px; }
  .f1-chart-legend span::before { width: 9px; height: 9px; content: ""; border-radius: 2px; }
  .f1-chart-legend .is-om::before { background: #c76b34; }
  .f1-chart-legend .is-chain::before { background: #367858; }
  .f1-trend-chart article { padding: 9px 0; border-bottom: 1px solid #eceee9; }
  .f1-chart-year { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
  .f1-chart-year strong { font-size: 12px; }
  .f1-chart-year small { color: #5e6d64; font-size: 10.5px; }
  .f1-bar-line { display: grid; grid-template-columns: 58px minmax(80px, 1fr) 32px; align-items: center; gap: 7px; margin-top: 6px; }
  .f1-bar-line span, .f1-bar-line strong { font-size: 10.5px; }
  .f1-bar-line strong { text-align: right; font-variant-numeric: tabular-nums; }
  .f1-bar-line i b { display: block; height: 100%; border-radius: inherit; }
  .f1-bar-line.is-om i b { background: #c76b34; }
  .f1-bar-line.is-chain i b { background: #367858; }
  .f1-assistance-chart article { padding: 9px 0; border-bottom: 1px solid #eceee9; }
  .f1-subsection { margin-top: 15px; }
  .f1-subsection:first-of-type { margin-top: 0; }
  .f1-subsection > header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
  .f1-subsection > header h4 { margin: 0; color: #263a30; font-size: 13px; line-height: 1.45; }
  .f1-subsection > header small { color: #647168; font-size: 10.5px; line-height: 1.4; text-align: right; }
  .f1-target-list { display: grid; gap: 9px; margin-top: 11px; }
  .f1-target-list article { padding: 9px 10px; background: #f8f9f5; border-radius: 9px; }
  .f1-target-list p { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
  .f1-target-list p strong, .f1-target-list p span { font-size: 11px; }
  .f1-target-list article > i, .f1-capital-chart article > i { display: block; height: 9px; overflow: hidden; background: #ece7df; border-radius: 99px; }
  .f1-target-list article > i b { display: block; height: 100%; background: #367858; border-radius: inherit; }
  .f1-target-list small { display: block; margin-top: 6px; color: #5d6b63; font-size: 10.5px; line-height: 1.45; }
  .f1-target-list article.is-zero { background: #f1f2ee; }
  .f1-capital-chart { display: grid; gap: 10px; }
  .f1-capital-chart article { padding: 9px 0; border-bottom: 1px solid #eceee9; }
  .f1-capital-chart article > div { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
  .f1-capital-chart span, .f1-capital-chart strong { font-size: 11px; line-height: 1.4; }
  .f1-capital-chart article > i b { display: block; height: 100%; background: #c76b34; border-radius: inherit; }
  .f1-capital-chart small { display: block; margin-top: 6px; color: #5d6b63; font-size: 10.5px; }
  .f1-year-list, .f1-dimension-list { display: grid; gap: 4px; margin-top: 12px; }
  .f1-year-list p, .f1-dimension-list p { display: grid; grid-template-columns: minmax(74px, 1fr) repeat(3, auto); gap: 9px; margin: 0; padding: 7px 0; border-bottom: 1px solid #eceee9; }
  .f1-year-list strong, .f1-year-list span, .f1-dimension-list strong, .f1-dimension-list span { font-size: 9.5px; line-height: 1.45; }
  .f1-year-list span, .f1-dimension-list span { color: #617067; text-align: right; white-space: nowrap; }
  .f1-limit-note { padding: 10px 11px; background: #f2f3ef; border-radius: 9px; }
  .f1-plain-note, .f1-coverage-note { margin: 12px 0 0; color: #526159; font-size: 12px; line-height: 1.6; }
  .f1-coverage-note { padding: 10px 12px; background: #f6efe7; border-left: 3px solid #b4551d; border-radius: 8px; }
  .f1-inline-loading { padding: 28px 18px; color: #5f6d65; background: #f5f6f2; border-radius: 12px; font-size: 12px; text-align: center; }
  .f1-area-group { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; padding: 13px 14px; background: #f6efe7; border-radius: 11px; }
  .f1-area-group span { color: #6b5a4b; font-size: 11px; }
  .f1-area-group strong { color: #783c1c; font-size: 13px; }
  .f1-count-chart { margin-top: 15px; padding: 13px; border: 1px solid #e1e5df; background: #fafbf8; border-radius: 12px; }
  .f1-count-chart > header { margin-bottom: 8px; }
  .f1-count-chart > header strong { font-size: 12.5px; }
  .f1-count-chart article { padding: 8px 0; border-bottom: 1px solid #e8ebe6; }
  .f1-count-chart article:last-child { border-bottom: 0; }
  .f1-count-chart p { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 5px; }
  .f1-count-chart p span, .f1-count-chart p strong { font-size: 11px; line-height: 1.4; }
  .f1-count-chart article > i { display: block; height: 8px; overflow: hidden; background: #e7eae5; border-radius: 99px; }
  .f1-count-chart article > i b { display: block; height: 100%; background: #bf652f; border-radius: inherit; }
  .f1-count-chart article > small { display: block; margin-top: 5px; color: #6a776f; font-size: 10px; }
  .f1-district-list { display: grid; gap: 8px; margin-top: 12px; }
  .f1-district-card { overflow: hidden; border: 1px solid #dce1dc; background: #fff; border-radius: 12px; }
  .f1-district-card > summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; padding: 10px 14px; cursor: pointer; list-style: none; }
  .f1-district-card > summary::-webkit-details-marker { display: none; }
  .f1-district-card > summary::after { content: "+"; width: 25px; height: 25px; display: grid; place-items: center; flex: 0 0 auto; background: #edf1ec; border-radius: 7px; font-size: 16px; }
  .f1-district-card[open] > summary::after { content: "−"; }
  .f1-district-card > summary > span:first-child { min-width: 0; flex: 1 1 auto; }
  .f1-district-card > summary > span:nth-child(2) { flex: 0 0 auto; text-align: right; }
  .f1-district-card summary strong, .f1-district-card summary b { display: block; color: #263a30; font-size: 12px; line-height: 1.4; }
  .f1-district-card summary small { display: block; margin-top: 3px; color: #6a776f; font-size: 9.5px; line-height: 1.35; }
  .f1-district-card summary small.is-target { color: #9b4719; font-weight: 700; }
  .f1-district-body { padding: 14px; border-top: 1px solid #e3e7e2; background: #fafbf8; }
  .f1-tambon-block { margin-top: 14px; }
  .f1-tambon-block > summary { padding: 11px 12px; background: #eef2ed; border-radius: 9px; cursor: pointer; color: #30473b; font-size: 11px; font-weight: 750; line-height: 1.45; }
  .f1-tambon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; margin-top: 8px; }
  .f1-tambon-grid article { min-width: 0; padding: 10px; border: 1px solid #e0e4df; background: #fff; border-radius: 9px; }
  .f1-tambon-grid article.is-missing { background: #f2f3ef; }
  .f1-tambon-grid header { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
  .f1-tambon-grid header strong { overflow-wrap: anywhere; font-size: 10.5px; line-height: 1.4; }
  .f1-tambon-grid header small { color: #7a847e; font-size: 8.5px; }
  .f1-tambon-grid p { display: flex; flex-wrap: wrap; gap: 4px 9px; margin: 7px 0 0; color: #526159; font-size: 9.5px; line-height: 1.45; }
  .f1-tambon-grid p.f1-tambon-extra { color: #6c7871; font-size: 8.8px; }
  .f1-tambon-grid footer { display: grid; gap: 3px; margin-top: 6px; color: #8a4824; font-size: 9px; line-height: 1.45; }
  .f1-model-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .f1-model-grid article { padding: 12px; border: 1px solid #e0e4df; background: #fafbf8; border-radius: 10px; }
  .f1-model-grid article > strong { display: block; font-size: 11.5px; line-height: 1.45; }
  .f1-model-grid p { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 7px 0 0; color: #5f6d65; font-size: 10px; }
  .f1-model-grid article > small { display: block; margin-top: 5px; color: #6a776f; font-size: 9.5px; line-height: 1.45; }
  .f1-transition-list { margin-top: 16px; padding: 13px; border: 1px solid #e0e4df; background: #fafbf8; border-radius: 12px; }
  .f1-transition-list > header { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
  .f1-transition-list > header strong { font-size: 12.5px; }
  .f1-transition-list > header small { color: #6b7870; font-size: 10px; }
  .f1-transition-list article { padding: 9px 0; border-bottom: 1px solid #e7eae5; }
  .f1-transition-list article:last-child { border-bottom: 0; }
  .f1-transition-list p { display: flex; justify-content: space-between; gap: 10px; margin: 0 0 6px; }
  .f1-transition-list p strong, .f1-transition-list p span { font-size: 10.5px; }
  .f1-transition-bar { display: flex; height: 9px; overflow: hidden; background: #e7eae5; border-radius: 99px; }
  .f1-transition-bar .improved { background: #398260; }
  .f1-transition-bar .unchanged { background: #bfc6c0; }
  .f1-transition-bar .declined { background: #c46345; }
  .f1-transition-list article > small { display: block; margin-top: 6px; color: #647168; font-size: 9.5px; line-height: 1.45; }
  .f1-dimension-details { display: grid; gap: 8px; }
  .f1-dimension-details > details { border: 1px solid #dde2dc; background: #fff; border-radius: 11px; }
  .f1-dimension-details > details.is-missing { background: #f3f4f0; }
  .f1-dimension-details > details > summary, .f1-indicator-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; cursor: pointer; list-style: none; }
  .f1-dimension-details summary::-webkit-details-marker { display: none; }
  .f1-dimension-details summary strong { font-size: 11.5px; line-height: 1.4; }
  .f1-dimension-details summary span { color: #6a776f; font-size: 9.5px; }
  .f1-dimension-details > details > div { padding: 0 9px 9px; }
  .f1-indicator-section { margin-top: 6px; border: 1px solid #e7eae6; background: #fafbf8; border-radius: 9px; }
  .f1-indicator-items { display: grid; gap: 1px; padding: 0 10px 9px; }
  .f1-indicator-items article { padding: 8px 0; border-top: 1px solid #e8ebe7; }
  .f1-indicator-items article header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
  .f1-indicator-items article header span { min-width: 0; font-size: 10px; line-height: 1.45; }
  .f1-indicator-items article header strong { flex: 0 0 auto; font-size: 10px; }
  .f1-indicator-levels { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin-top: 7px; }
  .f1-indicator-levels span { padding: 5px; color: #69766e; background: #eef1ed; border-radius: 6px; font-size: 8px; line-height: 1.35; text-align: center; }
  .f1-indicator-levels b { display: block; color: #34483d; font-size: 10px; }
  .f1-data-period { margin: 0 0 11px; padding: 8px 10px; color: #5d493b; background: #f6efe7; border-radius: 8px; font-size: 10.5px; font-weight: 700; }
  .f1-source-note h3 { margin: 0; font-size: 13px; }
  .f1-source-note p, .f1-source-note small { display: block; margin: 6px 0 0; color: var(--ink-soft); font-size: 11.5px; line-height: 1.55; }
  .f1-source-note > div { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
  .f1-source-note a { display: inline-flex; min-height: 40px; align-items: center; padding: 0 13px; color: #fff; background: #183d2f; border-radius: 9px; font-size: 11px; font-weight: 750; text-decoration: none; }
  .f1-empty-state { margin: 4px 0; padding: 24px 18px; border: 1px dashed #c7cbc4; background: #f5f6f2; border-radius: 14px; text-align: center; }
  .f1-empty-state strong { display: block; color: #34483d; font-size: 15px; line-height: 1.45; }
  .f1-empty-state p { margin: 6px 0 0; color: #66736b; font-size: 12px; line-height: 1.55; }

  @media (min-width: 1080px) {
    body.f1-country-open .mode-dock {
      left: calc((100vw - min(470px, 100vw - 44px) - 22px) / 2);
      max-width: calc(100vw - min(470px, 100vw - 44px) - 56px);
      overflow-x: auto;
      scrollbar-width: none;
    }
  }

  @media (max-width: 720px) {
    .f1-country-panel { top: auto; right: 7px; bottom: 72px; left: 7px; width: auto; height: min(68dvh, 720px); border-radius: 18px; }
    .f1-country-head { padding: 16px 16px 12px; }
    .f1-country-head h2 { font-size: 24px; }
    :is(.f1-flow, .f4-flow) { padding: 10px 16px 6px; }
    .f1-country-content { padding: 6px 16px 18px; }
    .f1-country-kpis button, .f1-province-kpis button { min-height: 100px; padding: 9px; }
    .f1-country-kpis button > strong, .f1-province-kpis button > strong { font-size: 19px; }
    .f1-ratio-chart > header, .f1-trend-chart > header, .f1-assistance-chart > header { align-items: flex-start; flex-direction: column; gap: 2px; }
    .f1-ratio-chart > header small, .f1-trend-chart > header small, .f1-assistance-chart > header small { text-align: left; }
    .f1-subsection > header { align-items: flex-start; flex-direction: column; gap: 2px; }
    .f1-subsection > header small { text-align: left; }
    .f1-year-list p, .f1-dimension-list p { grid-template-columns: minmax(84px, 1fr) auto; }
    .f1-year-list p span:nth-of-type(n+2), .f1-dimension-list p span:nth-of-type(n+2) { display: none; }
    .f1-province-toolbar { padding: 10px 12px 8px; }
    .f1-province-heading { align-items: flex-start; flex-direction: column; gap: 2px; }
    .f1-province-heading small { text-align: left; }
    .f1-province-tabs button { min-width: 108px; min-height: 52px; }
    .f1-province-detail { padding: 16px 14px; }
    .f1-detail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .f1-tambon-grid, .f1-model-grid { grid-template-columns: 1fr; }
    .f1-indicator-levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .f1-district-card > summary { align-items: flex-start; }
    body.f1-country-open .map-corner { opacity: 0; pointer-events: none; }
  }
}
.disaster-summary span {
  display: block;
  color: #754040;
  font-size: 10px;
  line-height: 1.4;
}
.disaster-summary strong {
  display: block;
  margin-top: 4px;
  color: #8b1a1a;
  font-size: 18px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.disaster-source-list {
  display: grid;
  gap: 10px;
}
.disaster-source-card {
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 11px 12px;
  background: #fafafa;
}
.disaster-source-card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.disaster-source-card header strong {
  display: block;
  font-size: 14px;
  color: #333;
  line-height: 1.35;
}
.disaster-source-card header small {
  display: block;
  margin-top: 2px;
  color: #8d5656;
  font-size: 10px;
  line-height: 1.45;
}
.disaster-source-card header > span {
  flex: 0 0 auto;
  padding: 4px 7px;
  border-radius: 999px;
  background: #f5e4e4;
  color: #8b1a1a;
  font-size: 10.5px;
  font-weight: 750;
}
.disaster-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 9px;
}
.disaster-tags span {
  padding: 4px 6px;
  border-radius: 6px;
  background: #f0eeee;
  color: #5f5a5a;
  font-size: 9.5px;
}

.disaster-insights {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 11px;
}

.disaster-insight-block {
  min-width: 0;
  padding: 10px;
  border: 1px solid #eadada;
  border-radius: 8px;
  background: #fff;
}

.disaster-insight-block h4 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: #333b37;
  font-size: 11.5px;
  line-height: 1.35;
}

.disaster-insight-block h4 span {
  color: #7b8580;
  font-size: 9.5px;
  font-weight: 650;
}

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

.disaster-metrics article {
  min-width: 0;
  padding: 10px;
  border: 1px solid #eadada;
  border-radius: 8px;
  background: #fff;
}

.disaster-metrics span {
  display: block;
  color: #7c6767;
  font-size: 9.5px;
  line-height: 1.35;
}

.disaster-metrics strong {
  display: block;
  margin-top: 4px;
  color: #8b1a1a;
  font-size: 18px;
  line-height: 1.15;
}

.disaster-metrics small {
  display: block;
  margin-top: 2px;
  color: #7b8580;
  font-size: 9px;
}

.disaster-bars {
  display: grid;
  gap: 7px;
}

.disaster-bars p {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) minmax(76px, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.disaster-bars p span {
  min-width: 0;
  color: #485550;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.disaster-bars p i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #f0e3e3;
}

.disaster-bars p b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #ba4c4c;
}

.disaster-bars p strong {
  color: #414d48;
  font-size: 10px;
  line-height: 1;
  white-space: nowrap;
}

.disaster-trend-list {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding: 2px 2px 8px;
  -webkit-overflow-scrolling: touch;
}

.disaster-trend {
  flex: 0 0 min(360px, 84vw);
  min-width: 0;
  padding: 9px;
  border: 1px solid #eee2e2;
  border-radius: 7px;
  background: #fffafa;
  scroll-snap-align: start;
}

.disaster-trend-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.disaster-trend-head > div {
  min-width: 0;
}

.disaster-trend-head button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d8bcbc;
  border-radius: 7px;
  background: #fff;
  color: #8b1a1a;
  cursor: pointer;
  font: inherit;
  font-size: 10px;
  font-weight: 750;
}

.disaster-trend-head button:hover {
  border-color: #b94949;
  background: #fff4f4;
}

.disaster-trend strong {
  display: block;
  color: #333b37;
  font-size: 10.5px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.disaster-trend small {
  display: block;
  color: #8b1a1a;
  font-size: 10px;
  line-height: 1.3;
  white-space: nowrap;
}

.disaster-chart-frame {
  position: relative;
  width: 100%;
  height: 108px;
  margin-top: 8px;
}

.disaster-chart-frame canvas {
  width: 100% !important;
  height: 100% !important;
}

.disaster-trend-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 2px;
}

.disaster-trend-axis span {
  color: #7b8580;
  font-size: 8.5px;
}

.disaster-latest-grid {
  display: flex;
  gap: 8px;
  margin-top: 9px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  padding-bottom: 7px;
  -webkit-overflow-scrolling: touch;
}

.disaster-latest-grid article {
  flex: 0 0 148px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #eee2e2;
  border-radius: 7px;
  background: #fffafa;
  scroll-snap-align: start;
}

.disaster-latest-grid span {
  display: block;
  color: #4b5550;
  font-size: 10px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.disaster-latest-grid strong {
  display: inline-block;
  margin-top: 5px;
  color: #8b1a1a;
  font-size: 16px;
  line-height: 1.15;
}

.disaster-latest-grid small {
  margin-left: 4px;
  color: #7b8580;
  font-size: 9px;
}

.station-history-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(24, 31, 28, 0.42);
}

.station-history-modal[hidden] {
  display: none;
}

.station-history-dialog {
  width: min(900px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  overflow: auto;
  padding: 16px;
  border: 1px solid #e5cccc;
  border-radius: 8px;
  background: #fffafa;
  box-shadow: 0 26px 80px rgba(28, 22, 20, 0.3);
}

.station-history-dialog header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.station-history-dialog header span {
  display: block;
  color: #8b1a1a;
  font-size: 10px;
  font-weight: 800;
}

.station-history-dialog h3 {
  margin: 3px 0 0;
  color: #303835;
  font-size: 22px;
  line-height: 1.25;
}

.station-history-dialog header small {
  display: block;
  margin-top: 4px;
  color: #66736e;
  font-size: 11px;
}

.station-history-dialog header button {
  width: 36px;
  height: 36px;
  border: 1px solid #dec5c5;
  border-radius: 7px;
  background: #fff;
  color: #8b1a1a;
  cursor: pointer;
  font: inherit;
  font-size: 20px;
  font-weight: 700;
}

.station-history-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 14px;
}

.station-history-controls button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #d8bcbc;
  border-radius: 7px;
  background: #fff;
  color: #7a4f4f;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 750;
}

.station-history-controls button.active {
  border-color: #8b1a1a;
  background: #8b1a1a;
  color: #fff;
}

.station-history-chart {
  position: relative;
  height: min(460px, 52vh);
  margin-top: 14px;
  padding: 10px;
  border: 1px solid #eadada;
  border-radius: 8px;
  background: #fff;
}

.station-history-chart canvas {
  width: 100% !important;
  height: 100% !important;
}

#stationHistoryMessage {
  margin: 10px 0 0;
  color: #786464;
  font-size: 12px;
  line-height: 1.55;
}

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

.disaster-station-grid article,
.disaster-highlights article {
  min-width: 0;
  padding: 9px;
  border: 1px solid #eee2e2;
  border-radius: 7px;
  background: #fffafa;
}

.disaster-station-grid strong,
.disaster-highlights strong {
  display: block;
  color: #303835;
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.disaster-station-grid span {
  display: inline-flex;
  width: fit-content;
  margin-top: 6px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #edf4ef;
  color: #266546;
  font-size: 9px;
  font-weight: 750;
}

.disaster-station-grid small,
.disaster-highlights small {
  display: block;
  margin-top: 6px;
  color: #64716c;
  font-size: 9.5px;
  line-height: 1.45;
}

.disaster-highlights {
  display: grid;
  gap: 7px;
}

.disaster-records {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.disaster-record {
  background: white;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 8px;
}
.disaster-record > strong {
  display: block;
  color: #2d3330;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.disaster-record dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(92px, 1fr));
  gap: 5px 8px;
  margin: 7px 0 0;
}
.disaster-record dl div {
  min-width: 0;
}
.disaster-record dt {
  color: #8a8f8b;
  font-size: 9px;
  line-height: 1.35;
}
.disaster-record dd {
  margin: 2px 0 0;
  color: #4b5550;
  font-size: 10.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.disaster-more {
  margin: 8px 0 0;
  text-align: left;
  font-size: 12px;
  color: #888;
}

/* F1 is a focused workflow. The generic province menu must not take space. */
.province-panel.f1-only #provincePanelTabs {
  display: none !important;
}

/* Department architecture: one clear workspace at a time. */
.department-dock {
  width: min(860px, calc(100vw - 36px));
  justify-content: center;
}

.department-dock button {
  min-width: 126px;
  justify-content: center;
  padding: 7px 15px;
  line-height: 1.2;
}

.department-dock button > span {
  display: grid;
  gap: 2px;
  text-align: left;
}

.department-dock button strong,
.department-dock button small {
  display: block;
}

.department-dock button strong {
  color: inherit;
  font-size: 12px;
  font-weight: 800;
}

.department-dock button small {
  color: #738078;
  font-size: 9px;
  font-weight: 600;
}

.department-dock button.active small {
  color: rgba(255, 255, 255, 0.68);
}

.workspace-panel {
  position: fixed;
  top: 92px;
  right: 22px;
  bottom: 84px;
  z-index: 32;
  width: min(430px, calc(100vw - 44px));
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: #f8f7f2;
  color: var(--ink-strong);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(24, 32, 26, 0.18);
}

.workspace-panel[hidden] {
  display: none;
}

.workspace-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 20px;
  border-bottom: 1px solid var(--hairline);
}

.workspace-panel-head span {
  color: #9a4d22;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.workspace-panel-head h2 {
  margin: 6px 0 0;
  font-size: 25px;
  line-height: 1.2;
}

.workspace-panel-head p {
  margin: 7px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.workspace-panel-head button {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border: 0;
  background: rgba(20, 29, 24, 0.07);
  border-radius: 10px;
  color: var(--ink-strong);
  cursor: pointer;
  font: 22px/1 inherit;
}

.workspace-panel-body {
  padding: 20px;
}

.workspace-empty,
.department-province-card {
  padding: 24px;
  border: 1px solid #dfe3dd;
  background: #fff;
  border-radius: 16px;
}

.workspace-empty > span,
.department-province-card > span {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  padding: 0 9px;
  color: #426252;
  background: #e8eee9;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 800;
}

.workspace-empty h3,
.department-province-card h2 {
  margin: 15px 0 0;
  color: var(--ink-strong);
  font-size: 20px;
  line-height: 1.45;
}

.workspace-empty p,
.department-province-card p,
.workspace-hint {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.executive-country-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.executive-country-kpis article {
  min-width: 0;
  padding: 15px;
  border: 1px solid #dfe3dd;
  background: #fff;
  border-radius: 13px;
}

.executive-country-kpis strong {
  display: block;
  color: #173f2d;
  font-size: 25px;
  font-variant-numeric: tabular-nums;
}

.executive-country-kpis span {
  display: block;
  margin-top: 6px;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.45;
}

.workspace-hint {
  padding: 12px 14px;
  background: #edf2ed;
  border-radius: 10px;
}

.department-province-empty {
  padding: 24px 26px;
}

.province-panel.department-only .province-hero {
  padding-bottom: 16px;
}

@media (min-width: 1080px) {
  body.workspace-panel-open .mode-dock {
    left: calc((100vw - min(430px, 100vw - 44px) - 22px) / 2);
    max-width: calc(100vw - min(430px, 100vw - 44px) - 56px);
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (max-width: 980px) {
  .department-dock {
    width: auto;
    justify-content: flex-start;
  }

  .department-dock button {
    min-width: 112px;
  }
}

@media (max-width: 720px) {
  .department-dock button {
    min-width: 96px;
    padding-inline: 11px;
  }

  .department-dock button small {
    display: none;
  }

  .workspace-panel {
    top: auto;
    right: 7px;
    bottom: 72px;
    left: 7px;
    width: auto;
    max-height: min(58dvh, 560px);
    border-radius: 18px;
  }

  .workspace-panel-head,
  .workspace-panel-body {
    padding: 16px;
  }

  .workspace-panel-head h2 {
    font-size: 22px;
  }

  .department-province-empty {
    padding: 16px 14px;
  }

  body.workspace-panel-open .map-corner {
    opacity: 0;
    pointer-events: none;
  }
}

/* F4 keeps its original data views and follows the same shell as F1. */
.f4-country-panel {
  position: fixed;
  top: 92px;
  right: 22px;
  bottom: 84px;
  z-index: 32;
  width: min(620px, calc(100vw - 44px));
  padding: 0;
  border-color: rgba(255, 255, 255, 0.72);
  background: #f8f7f2;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24, 32, 26, 0.2);
  scrollbar-width: thin;
}

.f4-country-panel > header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 108px;
  margin: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(248, 247, 242, 0.96);
  backdrop-filter: blur(18px);
}

.f4-country-panel header span {
  margin-bottom: 8px;
  color: #9a4d22;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.f4-country-panel header span i {
  width: 7px;
  height: 7px;
  background: #8060b8;
}

.f4-country-panel h2 {
  font-size: 28px;
  line-height: 1.15;
}

.f4-country-panel header p {
  margin-top: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.f4-country-panel > header button {
  position: static;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 10px;
  font-size: 22px;
}

.f4-country-tabs {
  position: sticky;
  top: 108px;
  z-index: 2;
  display: flex;
  gap: 5px;
  margin: 0;
  padding: 9px 20px;
  overflow-x: auto;
  border: 0;
  border-bottom: 1px solid var(--hairline);
  background: rgba(248, 247, 242, 0.96);
  border-radius: 0;
  scrollbar-width: none;
}

.f4-country-tabs::-webkit-scrollbar {
  display: none;
}

.f4-country-tabs button {
  min-height: 38px;
  flex: 0 0 auto;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 11px;
}

.f4-tab-panel {
  padding: 20px;
}

.f4-section-heading {
  margin-bottom: 14px;
}

.f4-section-heading strong {
  font-size: 17px;
}

.f4-country-panel .province-kpi {
  min-height: 126px;
  padding: 15px 16px;
  border-radius: 13px;
}

.f4-country-panel .province-kpi > strong {
  font-size: 34px;
}

.f4-country-panel .province-kpi > span {
  font-size: 11px;
}

.f4-policy-main strong {
  font-size: clamp(54px, 6vw, 82px);
}

.f4-board-toggle {
  position: fixed;
  top: 112px;
  right: 24px;
  z-index: 31;
}

@media (min-width: 1080px) {
  body.f4-country-open .mode-dock {
    left: calc((100vw - min(620px, 100vw - 44px) - 22px) / 2);
    max-width: calc(100vw - min(620px, 100vw - 44px) - 56px);
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (max-width: 720px) {
  .f4-country-panel {
    top: auto;
    right: 7px;
    bottom: 72px;
    left: 7px;
    width: auto;
    height: min(68dvh, 720px);
    padding: 0;
    border-radius: 18px;
  }

  .f4-country-panel > header {
    min-height: 98px;
    padding: 16px;
  }

  .f4-country-panel > header button {
    position: static;
    width: 36px;
    height: 36px;
  }

  .f4-country-tabs {
    top: 98px;
    display: flex;
    grid-template-columns: none;
    padding: 8px 16px;
    border-radius: 0;
  }

  .f4-tab-panel {
    padding: 16px;
  }

  .f4-policy-window {
    padding: 16px;
  }

  body.f4-country-open .map-corner {
    opacity: 0;
    pointer-events: none;
  }
}

/* Shared department pattern for F1, F4 and the future F2/F3 workspaces. */
.department-panel {
  --department-accent: #285d46;
  --department-accent-strong: #173d2f;
  --department-accent-soft: #edf3ef;
  top: 92px;
  right: 22px;
  bottom: 84px;
  width: min(620px, calc(100vw - 44px));
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: #f8f7f2;
  color: var(--ink-strong);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24, 32, 26, 0.2);
  scrollbar-width: thin;
}

.department-panel--f1 {
  --department-accent: #b4551d;
  --department-accent-strong: #8d3e14;
  --department-accent-soft: #fff3e8;
}

.department-panel--f2 {
  --department-accent: #2f6f86;
  --department-accent-strong: #24576a;
  --department-accent-soft: #eaf3f6;
}

.department-panel--f3 {
  --department-accent: #287464;
  --department-accent-strong: #1e594d;
  --department-accent-soft: #e8f3f0;
}

.department-panel--f4 {
  --department-accent: #7654b5;
  --department-accent-strong: #5c3d95;
  --department-accent-soft: #f2edfa;
}

.department-panel--executive {
  --department-accent: #285d46;
  --department-accent-strong: #173d2f;
  --department-accent-soft: #edf3ef;
}

.department-board-toggle {
  position: fixed;
  top: 112px;
  right: 24px;
  z-index: 31;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid #d8dfd9;
  background: #fff;
  color: #234438;
  border-radius: 12px;
  box-shadow: 0 14px 44px rgba(16, 26, 20, 0.14);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
}

.department-board-toggle[hidden] {
  display: none;
}

.f1-board-toggle {
  color: #8d3e14;
}

.f4-board-toggle {
  color: #5c3d95;
}

.department-board-toggle:hover {
  color: #fff;
  background: #173d2f;
}

.department-panel > .department-panel-head {
  position: sticky;
  top: 0;
  z-index: 4;
  min-height: 116px;
  height: 116px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(248, 247, 242, 0.97);
  backdrop-filter: blur(18px);
}

.department-panel-head > div {
  min-width: 0;
}

.department-panel-head h2,
.f4-country-panel .department-panel-head h2,
.workspace-panel .department-panel-head h2 {
  margin: 7px 0 0;
  color: var(--ink-strong);
  font-size: 27px;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.department-panel-head p,
.f4-country-panel .department-panel-head p,
.workspace-panel .department-panel-head p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.department-kicker,
.f1-kicker,
.workspace-panel-head > div > span {
  min-height: 25px;
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 0 9px;
  color: #fff;
  background: var(--department-accent);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0;
}

.department-panel--f4 .department-panel-head p {
  display: inline-block;
}

.department-panel--f4 .department-kicker {
  margin: 0;
  color: #fff;
  background: var(--department-accent);
}

.department-panel--f4 .department-scope {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 4px 0 0 7px;
  padding: 0 7px;
  color: var(--department-accent-strong);
  background: var(--department-accent-soft);
  border-radius: 999px;
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0;
  vertical-align: middle;
}

.department-panel--f4 .department-scope i {
  width: 6px;
  height: 6px;
  background: var(--department-accent);
  border-radius: 50%;
}

.department-panel > .department-panel-head > button,
.workspace-panel .department-panel-head > button {
  position: static;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink-strong);
  border-radius: 10px;
  cursor: pointer;
  font: 21px/1 inherit;
}

.department-panel > .department-panel-head > button:hover,
.workspace-panel .department-panel-head > button:hover {
  border-color: var(--department-accent);
  color: var(--department-accent-strong);
  background: var(--department-accent-soft);
}

.department-flow {
  min-height: 48px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(248, 247, 242, 0.96);
}

.department-flow span {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #68756e;
  font-size: 11px;
  line-height: 1.35;
}

.department-flow b {
  width: 23px;
  height: 23px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #68756e;
  background: #e8eae5;
  border-radius: 50%;
  font-size: 9px;
}

.department-flow span.active {
  color: var(--department-accent-strong);
  font-weight: 750;
}

.department-flow span.active b {
  color: #fff;
  background: var(--department-accent);
}

.department-kpi-grid,
.f4-country-panel .department-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.department-kpi-card,
.f1-country-kpis .department-kpi-card,
.f4-country-panel .department-kpi-card {
  min-width: 0;
  min-height: 116px;
  padding: 14px 15px;
  border: 1px solid #dcded8;
  background: #fff;
  color: var(--ink-strong);
  border-radius: 14px;
  text-align: left;
}

.department-kpi-card > span,
.f1-country-kpis .department-kpi-card > span,
.f4-country-panel .department-kpi-card > span {
  min-height: 30px;
  display: flex;
  align-items: flex-start;
  color: #4f6057;
  font-size: 11.5px;
  font-weight: 730;
  line-height: 1.4;
}

.department-kpi-card > strong,
.f1-country-kpis .department-kpi-card > strong,
.f4-country-panel .department-kpi-card > strong {
  display: block;
  margin-top: 8px;
  color: #1c3026;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -0.025em;
  font-variant-numeric: tabular-nums;
}

.department-kpi-card > small,
.f1-country-kpis .department-kpi-card > small,
.f4-country-panel .department-kpi-card > small {
  display: block;
  margin-top: 7px;
  color: #68756e;
  font-size: 10.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.department-kpi-card:not([disabled]):hover {
  border-color: var(--department-accent);
  background: var(--department-accent-soft);
  transform: translateY(-1px);
}

.department-panel--f1 .department-kpi-card.active {
  border-color: var(--department-accent);
  background: var(--department-accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--department-accent) 20%, transparent);
}

.department-detail-card,
.f1-country-detail {
  margin-top: 12px;
  padding: 17px;
  border: 1px solid #dcded8;
  background: #fff;
  border-radius: 14px;
}

.f1-country-content,
.f4-tab-panel,
.workspace-panel-body {
  padding: 18px 20px 20px;
}

.f1-country-content > footer {
  border-left-color: var(--department-accent);
  background: var(--department-accent-soft);
}

.f4-country-tabs {
  position: sticky;
  top: 116px;
  z-index: 3;
  gap: 5px;
  margin: 0;
  padding: 9px 20px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(248, 247, 242, 0.97);
}

.f4-country-tabs button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 9px;
  font-size: 11px;
}

.department-panel--f4 .f4-country-tabs button.active {
  color: #fff;
  background: var(--department-accent-strong);
}

.f4-section-heading {
  margin-bottom: 14px;
}

.f4-section-heading strong {
  color: var(--ink-strong);
  font-size: 17px;
}

.f4-list-panel,
.f4-policy-window,
.f4-record-card,
.f4-source-grid article {
  border-color: #dcded8;
  border-radius: 14px;
}

.f4-record-card a {
  color: var(--department-accent-strong);
}

.workspace-panel {
  width: min(620px, calc(100vw - 44px));
}

.workspace-panel-head {
  border-bottom: 1px solid var(--hairline);
}

/* F1 province drilldown uses the same panel footprint as the country views. */
.province-panel.f1-only {
  top: 92px;
  right: 22px;
  bottom: 84px;
  width: min(620px, calc(100vw - 44px));
  border: 1px solid rgba(255, 255, 255, 0.76);
  background: #f8f7f2;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(24, 32, 26, 0.2);
}

.province-panel[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

.province-panel.is-open[aria-hidden="false"] {
  visibility: visible;
}

.province-panel.f1-only .panel-head {
  padding: 16px 20px 4px;
  border: 0;
  background: #f8f7f2;
}

.province-panel.f1-only .api-chip {
  color: #8d3e14;
  background: #fff3e8;
}

.province-panel.f1-only .api-chip i {
  background: #b4551d;
}

.province-panel.f1-only .panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--hairline);
  background: #fff;
  color: var(--ink-strong);
  border-radius: 10px;
}

.province-panel.f1-only .province-title-block {
  padding: 4px 20px 16px;
  border-bottom: 1px solid var(--hairline);
  background: #f8f7f2;
}

.province-panel.f1-only #provinceName {
  font-size: 38px;
  line-height: 1.1;
}

.province-panel.f1-only .f1-province-toolbar {
  padding: 12px 20px 10px;
}

.province-panel.f1-only .f1-province-tabs button.active {
  border-color: #8d3e14;
  color: #fff;
  background: #8d3e14;
  box-shadow: 0 6px 14px rgba(141, 62, 20, 0.18);
}

.province-panel.f1-only .f1-province-tabs button.active small {
  color: #fff0e5;
}

@media (min-width: 1080px) {
  body.f1-country-open .mode-dock,
  body.f4-country-open .mode-dock,
  body.workspace-panel-open .mode-dock,
  body.panel-open .mode-dock {
    left: calc((100vw - min(620px, 100vw - 44px) - 22px) / 2);
    max-width: calc(100vw - min(620px, 100vw - 44px) - 56px);
    overflow-x: auto;
    scrollbar-width: none;
  }
}

@media (max-width: 720px) {
  .department-panel,
  .workspace-panel,
  .province-panel.f1-only {
    top: auto;
    right: 7px;
    bottom: 72px;
    left: 7px;
    width: auto;
    height: min(68dvh, 720px);
    max-height: none;
    border-radius: 18px;
  }

  .department-board-toggle {
    top: 72px;
    right: 12px;
  }

  .department-panel > .department-panel-head {
    min-height: 112px;
    height: 112px;
    padding: 16px;
  }

  .department-panel-head h2,
  .f4-country-panel .department-panel-head h2,
  .workspace-panel .department-panel-head h2 {
    font-size: 25px;
  }

  .department-flow {
    min-height: 46px;
    padding: 9px 16px;
  }

  .department-flow span {
    gap: 5px;
    font-size: 10px;
  }

  .department-flow b {
    width: 21px;
    height: 21px;
  }

  .f1-country-content,
  .f4-tab-panel,
  .workspace-panel-body {
    padding: 14px 16px 18px;
  }

  .department-kpi-grid,
  .f4-country-panel .department-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .department-kpi-card,
  .f1-country-kpis .department-kpi-card,
  .f4-country-panel .department-kpi-card {
    min-height: 108px;
    padding: 12px 13px;
  }

  .department-kpi-card > span,
  .f1-country-kpis .department-kpi-card > span,
  .f4-country-panel .department-kpi-card > span {
    min-height: 28px;
    font-size: 10.5px;
  }

  .department-kpi-card > strong,
  .f1-country-kpis .department-kpi-card > strong,
  .f4-country-panel .department-kpi-card > strong {
    font-size: 26px;
  }

  .department-kpi-card > small,
  .f1-country-kpis .department-kpi-card > small,
  .f4-country-panel .department-kpi-card > small {
    font-size: 9px;
  }

  .f4-country-tabs {
    top: 112px;
    padding: 8px 16px;
  }

  .province-panel.f1-only .panel-head {
    padding: 14px 16px 4px;
  }

  .province-panel.f1-only .province-title-block {
    padding: 4px 16px 14px;
  }

  .province-panel.f1-only #provinceName {
    font-size: 31px;
  }

  .province-panel.f1-only .f1-province-toolbar {
    padding: 10px 14px 8px;
  }

  body.f1-province-open .mode-dock {
    opacity: 1;
    pointer-events: auto;
  }
}

/* Desktop map controls: keep the four departments readable while a data
   panel is open. The prompt follows the visible map area, not the viewport. */
.department-dock button {
  --department-tab-accent: #285d46;
  position: relative;
  transition: color 160ms ease, background-color 160ms ease,
    box-shadow 160ms ease, transform 160ms ease;
}

.department-dock button::before {
  content: "";
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  background: var(--department-tab-accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--department-tab-accent) 12%, transparent);
}

.department-dock button[data-map-mode="f1"] { --department-tab-accent: #b4551d; }
.department-dock button[data-map-mode="f2"] { --department-tab-accent: #356f9f; }
.department-dock button[data-map-mode="f3"] { --department-tab-accent: #27766d; }
.department-dock button[data-map-mode="f4"] { --department-tab-accent: #7652a8; }
.department-dock button[data-map-mode="executive"] { --department-tab-accent: #285d46; }

.department-dock button.active {
  background: var(--department-tab-accent);
  box-shadow: 0 7px 18px color-mix(in srgb, var(--department-tab-accent) 24%, transparent);
}

.department-dock button.active::before {
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.18);
}

.department-dock button:hover {
  transform: translateY(-1px);
}

.mode-dock {
  transition: left 240ms ease, right 240ms ease, bottom 240ms ease,
    width 240ms ease, max-width 240ms ease, transform 240ms ease,
    opacity 200ms ease;
}

.map-prompt {
  transition: left 240ms ease, opacity 200ms ease, transform 200ms ease;
}

@media (min-width: 721px) {
  body.f1-country-open .mode-dock,
  body.f4-country-open .mode-dock,
  body.workspace-panel-open .mode-dock,
  body.panel-open .mode-dock {
    left: 50%;
    right: auto;
    bottom: 18px;
    width: min(860px, calc(100vw - 36px));
    max-width: calc(100vw - 36px);
    overflow-x: auto;
    opacity: 1;
    pointer-events: auto;
    transform: translateX(-50%);
    scrollbar-width: none;
  }

  body.f1-country-open .mode-dock::-webkit-scrollbar,
  body.f4-country-open .mode-dock::-webkit-scrollbar,
  body.workspace-panel-open .mode-dock::-webkit-scrollbar,
  body.panel-open .mode-dock::-webkit-scrollbar {
    display: none;
  }

  body.f1-country-open .map-prompt,
  body.f4-country-open .map-prompt,
  body.workspace-panel-open .map-prompt,
  body.panel-open .map-prompt {
    left: calc((100vw - min(620px, 100vw - 44px) - 22px) / 2);
  }

  body.f1-country-open .map-corner,
  body.f4-country-open .map-corner,
  body.workspace-panel-open .map-corner,
  body.panel-open .map-corner {
    bottom: 84px;
  }
}

@media (min-width: 721px) and (max-width: 949px) {
  body.f1-country-open .map-corner,
  body.f4-country-open .map-corner,
  body.workspace-panel-open .map-corner,
  body.panel-open .map-corner {
    opacity: 0;
    pointer-events: none;
  }
}

@media (min-width: 721px) and (max-width: 899px) {
  body.f1-country-open .map-prompt,
  body.f4-country-open .map-prompt,
  body.workspace-panel-open .map-prompt,
  body.panel-open .map-prompt {
    opacity: 0;
    pointer-events: none;
  }
}

/* Mobile map-first flow: choose a department, then choose an area. */
@media (max-width: 720px) {
  .map-header {
    inset: 10px 10px auto;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 7px;
  }

  .header-meta,
  .map-prompt {
    display: none;
  }

  .brand {
    min-width: 48px;
    min-height: 48px;
    padding: 6px;
  }

  .province-picker {
    min-height: 48px;
    padding-inline: 10px;
  }

  .picker-copy strong {
    max-width: none;
    font-size: 11px;
  }

  .department-board-toggle {
    top: 72px;
    right: 10px;
    min-height: 36px;
    max-width: calc(100vw - 20px);
    padding: 0 11px;
    border-radius: 10px;
    font-size: 10.5px;
  }

  .workspace-board-toggle[data-workspace-mode="f2"] { color: #24576a; }
  .workspace-board-toggle[data-workspace-mode="f3"] { color: #1e594d; }
  .workspace-board-toggle[data-workspace-mode="executive"] { color: #173d2f; }

  .department-dock,
  .mode-dock.department-dock {
    left: 8px;
    right: 8px;
    bottom: 8px;
    width: auto;
    max-width: none;
    min-height: 52px;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    padding: 4px;
    overflow: visible;
    transform: none;
    border-radius: 14px;
  }

  .department-dock button,
  .mode-dock.department-dock button {
    min-width: 0;
    min-height: 42px;
    justify-content: center;
    gap: 4px;
    padding: 0 4px;
    border-radius: 10px;
  }

  .department-dock button::before {
    width: 6px;
    height: 6px;
  }

  .department-dock button > span {
    display: block;
    min-width: 0;
    text-align: center;
  }

  .department-dock button strong {
    overflow: hidden;
    font-size: 10px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .map-corner {
    left: 10px;
    bottom: 68px;
    gap: 6px;
  }

  .map-actions button {
    min-height: 36px;
    padding-inline: 10px;
    font-size: 10px;
  }

  .evidence-legend {
    width: min(194px, calc(100vw - 20px));
    padding: 11px;
    border-radius: 13px;
  }

  .evidence-legend > div small {
    display: none;
  }

  .evidence-legend strong {
    font-size: 10.5px;
    line-height: 1.4;
  }

  .evidence-legend ol {
    gap: 5px 8px;
    margin-top: 8px;
  }

  .evidence-legend li {
    font-size: 8.5px;
  }

  .region-label {
    gap: 5px;
    padding: 5px 9px;
  }

  .region-label strong {
    font-size: 10.5px;
  }

  .region-label span {
    font-size: 8.5px;
  }

  .department-panel,
  .workspace-panel,
  .province-panel.f1-only,
  .f4-country-panel {
    right: 8px;
    bottom: 64px;
    left: 8px;
    width: auto;
    height: min(72dvh, 720px);
    border-radius: 20px;
  }

  .department-panel > .department-panel-head,
  .f4-country-panel > .department-panel-head,
  .workspace-panel > .department-panel-head {
    min-height: 86px;
    height: auto;
    padding: 20px 14px 12px;
  }

  .department-panel > .department-panel-head::before {
    content: "";
    position: absolute;
    top: 7px;
    left: 50%;
    width: 36px;
    height: 4px;
    transform: translateX(-50%);
    background: #ccd3cc;
    border-radius: 99px;
  }

  .department-panel-head h2,
  .f4-country-panel .department-panel-head h2,
  .workspace-panel .department-panel-head h2 {
    margin-top: 5px;
    font-size: 22px;
  }

  .department-panel > .department-panel-head > button,
  .workspace-panel .department-panel-head > button {
    width: 34px;
    height: 34px;
  }

  .department-flow {
    display: none;
  }

  .f1-country-content,
  .f4-tab-panel,
  .workspace-panel-body {
    padding: 12px 14px 16px;
  }

  .f4-country-tabs {
    position: static;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 5px;
    padding: 8px 14px;
    overflow: visible;
  }

  .f4-country-tabs button {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    padding: 6px 8px;
    font-size: 10px;
    line-height: 1.35;
    white-space: normal;
  }

  .department-kpi-card,
  .f1-country-kpis .department-kpi-card,
  .f4-country-panel .department-kpi-card {
    min-height: 100px;
    padding: 11px 12px;
  }
}

@media (max-width: 350px) {
  .department-dock button strong {
    font-size: 9px;
  }

  .department-kpi-grid,
  .f4-country-panel .department-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   F1 readability pass (2026-09-02)
   Wide screens: the tab cards become a sticky rail on the left of the sheet,
   the breadcrumb row is the only sticky chrome and the header is shorter.
   Charts: segmented level bars, column charts and metric rows replace the
   long stacked bar lists. Kept unlayered so it beats the layered F1 rules.
   ========================================================================== */
.f1-province-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 9px;
}

.f1-province-heading small {
  flex: 0 1 auto;
  min-width: 0;
  color: #67736c;
  font-size: 11px;
  line-height: 1.4;
  text-align: right;
}

:is(.f1-crumbs, .department-crumbs) {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 0;
  min-width: 0;
}

:is(.f1-crumbs, .department-crumbs) button,
:is(.f1-crumbs, .department-crumbs) > span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 1px 9px 0;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.3;
}

:is(.f1-crumbs, .department-crumbs) button {
  border: 1px solid #d8ddd7;
  background: #fff;
  color: #263a30;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
}

:is(.f1-crumbs, .department-crumbs) button:hover {
  border-color: #8d3e14;
  color: #8d3e14;
}

:is(.f1-crumbs, .department-crumbs) > span {
  color: #8d3e14;
  background: #fff3e8;
}

:is(.f1-crumbs, .department-crumbs) i {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  margin: 0 6px 0 5px;
  border-right: 1.5px solid #9aa59e;
  border-bottom: 1.5px solid #9aa59e;
  transform: rotate(-45deg);
}

/* Country panel: shorter number cards, the detail card comes into view sooner. */
.f1-kpi-hint {
  margin: 0 0 8px;
  color: #68756e;
  font-size: 11px;
  line-height: 1.5;
}

.f1-country-kpis .department-kpi-card {
  min-height: 0;
  padding: 11px 13px;
}

.f1-country-kpis .department-kpi-card > span {
  min-height: 0;
}

.f1-country-kpis .department-kpi-card > strong {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: 0;
}

.f1-country-kpis .department-kpi-card > small {
  margin-top: 5px;
}

/* Country panel steps are buttons: step 1 takes you back to the country. */
:is(.f1-flow, .f4-flow) button {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: none;
  color: #68756e;
  font: inherit;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  cursor: default;
}

:is(.f1-flow, .f4-flow) button:not(:disabled) {
  cursor: pointer;
}

:is(.f1-flow, .f4-flow) button:disabled {
  opacity: 1;
}

:is(.f1-flow, .f4-flow) button.active {
  color: var(--department-accent-strong);
  font-weight: 750;
}

:is(.f1-flow, .f4-flow) button.active b {
  color: #fff;
  background: var(--department-accent);
}

:is(.f1-flow, .f4-flow) button.is-link {
  color: #263a30;
  text-decoration: underline;
  text-decoration-color: #b8beb9;
  text-underline-offset: 3px;
}

:is(.f1-flow, .f4-flow) button.is-link:hover {
  color: var(--department-accent-strong);
  text-decoration-color: currentColor;
}

/* Segmented level bars (well-being levels, gender). */
.f1-level-list {
  display: grid;
  gap: 12px;
}

.f1-level-bar p {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 6px;
}

.f1-level-bar p strong,
.f1-level-bar p span {
  font-size: 11.5px;
  line-height: 1.4;
}

.f1-level-bar p span {
  color: #5d6b63;
}

.f1-level-track {
  display: flex;
  height: 12px;
  overflow: hidden;
  background: #ece7df;
  border-radius: 99px;
}

.f1-level-track i {
  display: block;
  height: 100%;
  background: #b8beb9;
}

.f1-level-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 7px 0 0;
  padding: 0;
  list-style: none;
}

.f1-level-legend li {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  color: #5d6b63;
  font-size: 10.5px;
  line-height: 1.4;
}

.f1-level-legend li::before {
  content: "";
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  align-self: center;
  background: #b8beb9;
  border-radius: 2px;
}

.f1-level-legend b {
  color: #263a30;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.f1-level-legend small {
  font-size: 10px;
}

.f1-level-track .lv1, .f1-level-legend .lv1::before, .f1-indicator-levels .lv1 b { background: #b34b3f; }
.f1-level-track .lv2, .f1-level-legend .lv2::before, .f1-indicator-levels .lv2 b { background: #c76b34; }
.f1-level-track .lv3, .f1-level-legend .lv3::before, .f1-indicator-levels .lv3 b { background: #4a7d6a; }
.f1-level-track .lv4, .f1-level-legend .lv4::before, .f1-indicator-levels .lv4 b { background: #2f7a56; }
.f1-level-track .is-male, .f1-level-legend .is-male::before { background: #4a6f9c; }
.f1-level-track .is-female, .f1-level-legend .is-female::before { background: #b0567a; }
.f1-level-track .is-other, .f1-level-legend .is-other::before { background: #b8beb9; }

.f1-indicator-levels span b {
  display: inline-block;
  min-width: 34px;
  margin-bottom: 3px;
  padding: 1px 6px;
  color: #fff;
  border-radius: 6px;
}

/* Column charts (values by year). */
.f1-column-chart {
  margin-top: 15px;
  padding: 13px;
  border: 1px solid #e1e5df;
  background: #fafbf8;
  border-radius: 12px;
}

.f1-column-chart > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.f1-column-chart > header strong {
  font-size: 12.5px;
}

.f1-column-chart > header small {
  color: #647168;
  font-size: 10.5px;
  line-height: 1.4;
  text-align: right;
}

.f1-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 6px;
  margin-top: 20px;
}

.f1-col-group {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.f1-col-bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 3px;
  height: 104px;
  padding: 0 2px;
  border-bottom: 1px solid #d9ded8;
}

.f1-col-bars i {
  position: relative;
  display: block;
  flex: 1 1 0;
  max-width: 28px;
  min-height: 2px;
  background: #c76b34;
  border-radius: 3px 3px 0 0;
}

.f1-col-bars i.is-empty {
  background: #d9ded8;
}

.f1-col-bars i b {
  position: absolute;
  bottom: 100%;
  left: 50%;
  padding-bottom: 2px;
  transform: translateX(-50%);
  color: #34483d;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.f1-col-bars i.is-om { background: #c76b34; }
.f1-col-bars i.is-chain { background: #367858; }
.f1-col-bars i.is-money { background: #7a5c3a; }
.f1-col-bars i.is-households { background: #4a7d6a; }
.f1-chart-legend .is-money::before { background: #7a5c3a; }
.f1-chart-legend .is-households::before { background: #4a7d6a; }

.f1-col-group > span {
  color: #5d6b63;
  font-size: 10.5px;
  line-height: 1.3;
  text-align: center;
}

/* Metric rows: this year, last year, change and target in one line. */
.f1-metric-list {
  display: grid;
  gap: 6px;
}

.f1-metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 4px 12px;
  padding: 10px 12px;
  border: 1px solid #e3e5df;
  background: #fafbf8;
  border-radius: 10px;
}

.f1-metric-row.is-missing {
  background: #f0f1ed;
}

.f1-metric-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.f1-metric-main span {
  color: #5b6a62;
  font-size: 11px;
  line-height: 1.4;
}

.f1-metric-main strong {
  font-size: 18px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.f1-metric-main strong small {
  color: #5b6a62;
  font-size: 10.5px;
  font-weight: 600;
}

.f1-metric-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
}

.f1-metric-side span {
  color: #5d6b63;
  font-size: 10.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.f1-metric-side .is-up { color: #2f7a56; font-weight: 700; }
.f1-metric-side .is-down { color: #b34b3f; font-weight: 700; }
.f1-metric-side .is-flat { color: #68756e; }

.f1-metric-target {
  grid-column: 1 / -1;
}

.f1-metric-target i {
  display: block;
  height: 7px;
  overflow: hidden;
  background: #e7eae5;
  border-radius: 99px;
}

.f1-metric-target i b {
  display: block;
  height: 100%;
  background: #367858;
  border-radius: inherit;
}

.f1-metric-target small {
  display: block;
  margin-top: 4px;
  color: #5d6b63;
  font-size: 10px;
  line-height: 1.4;
}

.f1-progress-rows div > p strong {
  color: #5d6b63;
  font-weight: 600;
}

/* Other target provinces of the same region, at the end of the sheet. */
:is(.f1-province-switch, .department-province-switch) {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
}

:is(.f1-province-switch, .department-province-switch) > span {
  display: block;
  margin-bottom: 7px;
  color: #5d6b63;
  font-size: 11px;
  line-height: 1.4;
}

:is(.f1-province-switch, .department-province-switch) > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

:is(.f1-province-switch, .department-province-switch) button {
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid #d8ddd7;
  background: #fff;
  color: #263a30;
  border-radius: 999px;
  cursor: pointer;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
}

:is(.f1-province-switch, .department-province-switch) button:hover {
  border-color: #8d3e14;
  color: #8d3e14;
}

/* Wide screens: shorter header, tab rail on the left, content on the right. */
@media (min-width: 721px) {
  .province-panel.f1-only .panel-head {
    padding: 12px 20px 0;
  }

  .province-panel.f1-only .province-title-block {
    padding: 2px 20px 12px;
  }

  .province-panel.f1-only #provinceName {
    font-size: 30px;
    line-height: 1.3;
  }

  .province-panel.f1-only .f1-province-content {
    display: grid;
    grid-template-columns: 176px minmax(0, 1fr);
    align-items: start;
  }

  .province-panel.f1-only .f1-province-toolbar {
    display: contents;
  }

  .province-panel.f1-only .f1-province-heading {
    grid-column: 1 / -1;
    position: sticky;
    top: 0;
    z-index: 8;
    margin: 0;
    padding: 8px 20px;
    border-bottom: 1px solid #d9ded8;
    background: rgba(247, 248, 244, 0.97);
    backdrop-filter: blur(16px);
  }

  .province-panel.f1-only .f1-province-tabs {
    grid-column: 1;
    grid-row: 2 / span 2;
    position: sticky;
    top: 43px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    box-sizing: border-box;
    max-height: calc(100vh - 396px);
    padding: 12px 6px 12px 14px;
    overflow: hidden auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scroll-snap-type: none;
  }

  .province-panel.f1-only .f1-province-tabs button {
    flex: 0 0 auto;
  }

  .province-panel.f1-only .f1-province-tabs button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 54px;
    padding: 8px 12px;
    border-radius: 10px;
  }

  .province-panel.f1-only .f1-province-tabs button strong {
    font-size: 12px;
    line-height: 1.5;
  }

  .province-panel.f1-only .f1-province-tabs button small {
    margin-top: 1px;
    font-size: 10.5px;
    line-height: 1.45;
  }

  .province-panel.f1-only .f1-province-detail {
    grid-column: 2;
    padding: 14px 20px 18px 10px;
  }

  .province-panel.f1-only .f1-source-note {
    grid-column: 2;
    padding: 14px 20px 20px 10px;
  }
}

/* Four stat cards beside the rail read better as two by two than three plus one. */
@media (min-width: 721px) {
  .province-panel.f1-only .f1-detail-stats:has(> article:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Thai headings and text values in the F1 country panel need the same leading as the rest. */
.department-panel.f1-country-panel header h2 {
  line-height: 1.3;
}

.f1-country-kpis .department-kpi-card strong .metric-na {
  font-size: 18px;
  line-height: 1.3;
}

/* The switcher lives inside the source note, whose direct div children are laid out as chip rows. */
.f1-source-note > :is(.f1-province-switch, .department-province-switch) {
  display: grid;
  flex-wrap: nowrap;
}
