:root {
  --ink: #17201d;
  --muted: #5b665f;
  --paper: #ffffff;
  --soft: #f3f7f4;
  --line: #d9e2dd;
  --green: #2f7d54;
  --cyan: #0b7a88;
  --red: #c64632;
  --gold: #d6a928;
  --shadow: 0 18px 50px rgba(23, 32, 29, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Tahoma, "Noto Sans Thai", "Segoe UI", sans-serif;
  line-height: 1.7;
}

img {
  display: block;
  max-width: 100%;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px clamp(18px, 5vw, 64px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(217, 226, 221, 0.85);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
  font-weight: 700;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: clamp(5px, 0.8vw, 9px);
  min-width: 0;
}

.brand-mark img {
  width: auto;
  height: clamp(30px, 3.6vw, 46px);
  max-width: clamp(34px, 4.8vw, 58px);
  object-fit: contain;
}

.brand-title {
  min-width: 0;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-nav a {
  padding: 10px 14px;
  border-radius: 8px;
  color: #314139;
  font-size: 0.95rem;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--paper);
  background: var(--cyan);
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--ink);
}

.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 78vh;
  padding: 96px clamp(18px, 7vw, 92px) 90px;
  color: #fff;
  background-image: url("รูปภาพประกอบโครงการ/LINE_ALBUM_ลงพื้นที่ แม่ยาวคุยกับเกษตร (15768)_250718_1.jpg");
  background-position: center;
  background-size: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(16, 31, 25, 0.82), rgba(16, 31, 25, 0.48) 56%, rgba(16, 31, 25, 0.2)),
    linear-gradient(0deg, rgba(16, 31, 25, 0.55), rgba(16, 31, 25, 0.05) 40%);
}

.hero-content {
  position: relative;
  width: min(860px, 100%);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--cyan);
  font-size: 0.92rem;
  font-weight: 800;
}

.hero .eyebrow {
  color: #a7f0e5;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 920px;
  margin: 0;
  font-size: clamp(1.75rem, 4.8vw, 3.4rem);
  line-height: 1.16;
}

h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2.1rem);
  line-height: 1.25;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.18rem;
  line-height: 1.35;
}

.hero-lead {
  max-width: 760px;
  margin: 22px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(0.95rem, 1.4vw, 1.15rem);
}

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

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

.button.primary {
  border-color: var(--gold);
  color: var(--ink);
  background: var(--gold);
}

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

.quick-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border-bottom: 1px solid var(--line);
}

.quick-stats article {
  padding: 26px clamp(18px, 3vw, 34px);
  background: var(--paper);
}

.stat-value {
  display: block;
  color: var(--green);
  font-size: clamp(1.4rem, 2.6vw, 2rem);
  font-weight: 900;
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.95rem;
}

.section {
  padding: 86px clamp(18px, 6vw, 78px);
}

.section-tinted {
  background: var(--soft);
}

.section-heading {
  width: min(900px, 100%);
  margin-bottom: 36px;
}

.section-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 36px;
  align-items: stretch;
}

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

.path-step,
.activity-card,
.kpi,
.chart-panel,
.controls,
.dashboard-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.path-step {
  padding: 24px;
}

.path-step span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

.path-step:nth-child(2) span {
  background: var(--cyan);
}

.path-step:nth-child(3) span {
  background: var(--red);
}

.path-step:nth-child(4) span {
  background: var(--gold);
  color: var(--ink);
}

.path-step p {
  margin: 0;
  color: var(--muted);
}

.feature-image {
  min-height: 100%;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.feature-image img {
  width: 100%;
  height: calc(100% - 44px);
  min-height: 360px;
  object-fit: cover;
}

.feature-image figcaption {
  min-height: 44px;
  padding: clamp(8px, 1.2vw, 12px) clamp(10px, 1.6vw, 16px);
  color: var(--muted);
  background: #fff;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.55;
}

.stakeholder-band {
  margin-top: 30px;
  padding: 26px;
  border-left: 6px solid var(--cyan);
  background: #eef8f6;
}

.stakeholder-band h3 {
  margin-bottom: 12px;
}

.stakeholder-band ul {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stakeholder-band li {
  padding: 8px 12px;
  border: 1px solid #b8deda;
  border-radius: 8px;
  background: #fff;
}

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

.activity-card {
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(23, 32, 29, 0.08);
}

.activity-card img {
  width: 100%;
  height: 230px;
  object-fit: cover;
}

.activity-card div {
  padding: 22px;
}

.activity-index {
  margin: 0 0 8px;
  color: var(--red);
  font-weight: 900;
}

.activity-card p {
  color: var(--muted);
}

.activity-card ul {
  padding-left: 18px;
  margin: 14px 0 0;
}

.activity-card li {
  margin: 6px 0;
}

.outcome-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.outcome-strip span {
  padding: 10px 14px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-weight: 800;
}

.outcome-strip span:nth-child(2) {
  background: var(--cyan);
}

.outcome-strip span:nth-child(3) {
  background: var(--red);
}

.outcome-strip span:nth-child(4) {
  background: #6d6f25;
}

.outcome-strip span:nth-child(5) {
  color: var(--ink);
  background: var(--gold);
}

.fieldwork-section {
  background: #fbfcfb;
}

.fieldwork-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
  gap: 20px;
  align-items: stretch;
}

.visit-highlight,
.photo-mosaic figure,
.photo-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 32, 29, 0.08);
}

.visit-highlight {
  display: grid;
  grid-template-rows: minmax(360px, 1fr) auto;
}

.visit-highlight img,
.photo-mosaic img,
.photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.visit-highlight figcaption,
.photo-mosaic figcaption,
.photo-card figcaption {
  color: var(--muted);
  background: #fff;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.55;
}

.visit-highlight figcaption {
  padding: clamp(12px, 1.8vw, 18px) clamp(14px, 2vw, 20px);
}

.visit-highlight figcaption span {
  display: block;
  margin-bottom: 4px;
  color: var(--green);
  font-weight: 900;
  font-size: clamp(0.82rem, 1.1vw, 0.95rem);
}

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

.photo-mosaic figure {
  display: grid;
  grid-template-columns: minmax(120px, 0.92fr) minmax(130px, 1fr);
  min-height: 160px;
}

.photo-mosaic figcaption {
  display: grid;
  align-content: center;
  padding: clamp(10px, 1.4vw, 16px);
  color: var(--ink);
  font-weight: 700;
  font-size: clamp(0.78rem, 1.1vw, 0.9rem);
  line-height: 1.5;
  overflow-wrap: anywhere;
}

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

.visit-timeline article {
  padding: 22px;
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: var(--soft);
}

.visit-timeline article:nth-child(2) {
  border-color: var(--cyan);
}

.visit-timeline article:nth-child(3) {
  border-color: var(--red);
}

.visit-timeline span {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--cyan);
  font-weight: 900;
}

.visit-timeline p {
  margin: 0;
  color: var(--muted);
}

.gallery-group {
  margin-top: 34px;
}

.gallery-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.gallery-heading .eyebrow,
.gallery-heading h3 {
  margin: 0;
}

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

.photo-card {
  display: grid;
  grid-template-rows: 220px auto;
}

.photo-card figcaption {
  min-height: 52px;
  padding: clamp(9px, 1.2vw, 13px) clamp(10px, 1.4vw, 14px);
  font-weight: 700;
  font-size: clamp(0.78rem, 1.1vw, 0.88rem);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-section {
  background: #eef4f0;
  padding: 24px clamp(12px, 2vw, 28px);
}

.dashboard-board {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  padding: clamp(10px, 1.4vw, 18px);
  border: 1px solid #cbdad2;
  border-radius: 8px;
  background: #f8fbf9;
  box-shadow: var(--shadow);
}

.dashboard-hero {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  padding: clamp(14px, 2vw, 22px);
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(120deg, #17201d, #2f7d54 66%, #0b7a88);
}

.dashboard-hero .eyebrow {
  color: #a7f0e5;
}

.dashboard-hero h2 {
  color: #fff;
}

.dashboard-hero p {
  max-width: 760px;
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.5;
}

.dashboard-status {
  display: grid;
  align-content: center;
  min-width: 150px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-status span,
.dashboard-status small {
  color: rgba(255, 255, 255, 0.82);
}

.dashboard-status strong {
  display: block;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1.1;
}

.dashboard-note {
  margin: 10px 0;
  padding: 10px 12px;
  background: #fff9df;
}

.dashboard-note.compact {
  font-size: 0.86rem;
  line-height: 1.45;
}

.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 10px;
}

.kpi {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  padding: 12px 14px;
}

.kpi::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  background: var(--green);
}

.kpi span,
.kpi small {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.kpi strong {
  display: block;
  margin: 8px 0 5px;
  color: var(--green);
  font-size: 1.34rem;
  line-height: 1.18;
}

.metric-cyan::before {
  background: var(--cyan);
}

.metric-cyan strong {
  color: var(--cyan);
}

.metric-red::before {
  background: var(--red);
}

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

.metric-gold {
  background: #fff9df;
}

.metric-gold::before {
  background: var(--gold);
}

.metric-gold strong {
  color: #846500;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.8fr) minmax(360px, 1.5fr) minmax(260px, 0.86fr);
  gap: 10px;
  align-items: stretch;
}

.dashboard-assumption-row {
  display: grid;
  grid-template-columns: minmax(280px, 0.68fr) minmax(560px, 1.32fr);
  gap: 10px;
  align-items: stretch;
  margin-top: 10px;
}

.dashboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 10px 30px rgba(23, 32, 29, 0.08);
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-head h3 {
  margin-bottom: 3px;
}

.card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.gauge-card,
.impact-card,
.activity-table-card,
.chart-panel,
.controls {
  padding: 12px;
}

.gauge-card {
  display: grid;
  align-content: start;
}

#sroiStatus {
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #fff;
  background: var(--green);
  border-radius: 8px;
  font-size: 0.84rem;
  font-weight: 800;
}

.sroi-gauge {
  width: min(190px, 100%);
  aspect-ratio: 1;
  margin: 8px auto 10px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(var(--cyan) 0 var(--score), #e4ece7 var(--score) 100%);
}

.sroi-gauge div {
  display: grid;
  place-items: center;
  width: 62%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}

.sroi-gauge strong {
  color: var(--cyan);
  font-size: 2rem;
  line-height: 1;
}

.sroi-gauge span {
  color: var(--muted);
  font-weight: 800;
}

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

.gauge-summary div {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.gauge-summary span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.gauge-summary strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 0.9rem;
}

.chart-panel {
  min-width: 0;
}

.chart-panel canvas {
  width: 100%;
  height: clamp(210px, 30vh, 300px);
}

.impact-card {
  display: grid;
  align-content: start;
  gap: 12px;
}

.impact-meter {
  display: grid;
  gap: 6px;
}

.impact-meter > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: baseline;
}

.impact-meter span {
  color: var(--muted);
  font-size: 0.82rem;
}

.impact-meter strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.meter-track {
  overflow: hidden;
  height: 12px;
  border-radius: 999px;
  background: #e4ece7;
}

.meter-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
  transition: width 180ms ease;
}

#healthBar {
  background: var(--cyan);
}

#environmentBar {
  background: var(--red);
}

.controls {
  display: grid;
  gap: 9px;
  align-content: start;
}

.controls label {
  display: grid;
  gap: 4px;
  color: #314139;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}

.controls input {
  width: 100%;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #fbfdfc;
  font: inherit;
}

.controls input:focus {
  outline: 3px solid rgba(11, 122, 136, 0.18);
  border-color: var(--cyan);
}

.adjustment-table {
  display: grid;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.table-row {
  display: grid;
  grid-template-columns: minmax(180px, 1.45fr) repeat(4, minmax(104px, 1fr));
  min-width: 640px;
}

.table-row span {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: #fff;
  font-size: 0.84rem;
  line-height: 1.35;
  white-space: nowrap;
}

.table-row span:last-child {
  border-right: 0;
}

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

.table-head span {
  color: #fff;
  background: var(--ink);
  font-weight: 800;
}

.powerbi-page {
  background: #f7faf8;
}

.powerbi-hero {
  min-height: clamp(360px, 44vw, 540px);
  padding: 82px clamp(18px, 6vw, 78px) 40px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(23, 32, 29, 0.9), rgba(47, 125, 84, 0.76)),
    url("รูปภาพประกอบโครงการ/ืา่า่าสท.jpg") center 42% / cover no-repeat;
}

.powerbi-hero > div {
  width: min(920px, 100%);
}

.powerbi-hero .eyebrow {
  color: #a7f0e5;
}

.powerbi-hero h1 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.powerbi-hero p:last-child {
  max-width: 760px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.powerbi-shell {
  padding: 26px clamp(14px, 3vw, 36px) 80px;
}

.powerbi-menu {
  position: sticky;
  top: 72px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.powerbi-menu a {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #314139;
  background: var(--soft);
  font-size: 0.9rem;
  font-weight: 800;
  text-align: center;
  line-height: 1.35;
}

.powerbi-menu a:hover,
.powerbi-menu a:focus-visible {
  color: #fff;
  background: var(--green);
}

.powerbi-frame-wrap {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid #cbdad2;
  border-radius: 8px;
  background: #edf4f0;
  box-shadow: var(--shadow);
}

.powerbi-frame-wrap iframe {
  width: 100%;
  height: min(74vh, 780px);
  min-height: 620px;
  border: 0;
  background: #fff;
}

.powerbi-empty {
  position: absolute;
  inset: 0;
  display: none;
  place-content: center;
  gap: 8px;
  padding: 24px;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(243, 247, 244, 0.9)),
    repeating-linear-gradient(45deg, rgba(47, 125, 84, 0.08) 0 10px, rgba(11, 122, 136, 0.08) 10px 20px);
  text-align: center;
}

.powerbi-frame-wrap.is-empty .powerbi-empty {
  display: grid;
}

.powerbi-empty strong {
  color: var(--ink);
  font-size: 1.35rem;
}

.powerbi-empty code {
  color: var(--red);
  font-weight: 800;
}

.powerbi-section-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.powerbi-section-grid article {
  scroll-margin-top: 150px;
  min-height: 180px;
  padding: 18px;
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 32, 29, 0.08);
}

.powerbi-section-grid article:nth-child(2) {
  border-color: var(--cyan);
}

.powerbi-section-grid article:nth-child(3) {
  border-color: var(--gold);
}

.powerbi-section-grid article:nth-child(4) {
  border-color: var(--red);
}

.powerbi-section-grid article:nth-child(5) {
  border-color: #6d6f25;
}

.powerbi-section-grid span {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--green);
  font-weight: 900;
}

.powerbi-section-grid article:nth-child(2) span {
  background: var(--cyan);
}

.powerbi-section-grid article:nth-child(3) span {
  color: var(--ink);
  background: var(--gold);
}

.powerbi-section-grid article:nth-child(4) span {
  background: var(--red);
}

.powerbi-section-grid article:nth-child(5) span {
  background: #6d6f25;
}

.powerbi-section-grid h2 {
  font-size: 1.08rem;
}

.powerbi-section-grid p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.researchers-page {
  background: #f7faf8;
}

.researchers-hero {
  min-height: clamp(360px, 48vw, 560px);
  padding: 86px clamp(18px, 6vw, 78px) 48px;
  display: flex;
  align-items: center;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(23, 32, 29, 0.92), rgba(11, 122, 136, 0.72)),
    url("รูปลงพื้นที่/LINE_ALBUM_ลงพื้นที่ 20-22 พ.ย. 68_260419_1.jpg") center 42% / cover no-repeat;
}

.researchers-hero > div {
  width: min(920px, 100%);
}

.researchers-hero .eyebrow {
  color: #a7f0e5;
}

.researchers-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4rem);
}

.researchers-hero p:last-child {
  max-width: 820px;
  margin: 18px 0 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.08rem;
}

.researchers-section {
  padding: 76px clamp(18px, 6vw, 78px);
}

.lead-researcher {
  width: min(760px, 100%);
  margin-bottom: 34px;
}

.researcher-group {
  margin-top: 34px;
}

.researcher-group-head {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.researcher-group-head .eyebrow,
.researcher-group-head h2 {
  margin: 0;
}

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

.researcher-card {
  min-height: 150px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(23, 32, 29, 0.08);
}

.researcher-card h3 {
  margin-bottom: 10px;
}

.researcher-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.lead-card {
  min-height: 0;
  border-top-color: var(--gold);
  background: #fff9df;
}

.researcher-role {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
  background: var(--gold);
  font-size: 0.86rem;
  font-weight: 900;
}

/* ─── Footer ─────────────────────────────────────────── */
.site-footer {
  background: #17201d;
  color: #c8d5cf;
  padding: clamp(40px, 6vw, 72px) clamp(18px, 5vw, 64px) 28px;
  margin-top: 0;
}

.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  gap: 32px;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-brand-mark img {
  height: 40px;
  width: auto;
  opacity: 0.9;
  background: #ffffff;
  border-radius: 4px;
  padding: 3px 6px;
}

.footer-tagline {
  font-weight: 700;
  font-size: 1rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.footer-body {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-project {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.7;
  color: #e0eae4;
}

.footer-org {
  margin: 0;
  font-size: 0.85rem;
  color: #8ea89a;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 20px;
}

.footer-nav a {
  color: #a8c2b6;
  font-size: 0.88rem;
  transition: color 0.2s;
}

.footer-nav a:hover {
  color: #ffffff;
}

.footer-copy {
  margin: 0;
  font-size: 0.78rem;
  color: #5a7068;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 16px;
  text-align: center;
}


@media (max-width: 1080px) {
  .quick-stats,
  .activity-grid,
  .dashboard-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .detail-layout,
  .fieldwork-showcase,
  .dashboard-grid,
  .dashboard-assumption-row {
    grid-template-columns: 1fr;
  }

  .visit-timeline,
  .gallery-grid,
  .researcher-grid,
  .powerbi-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (min-width: 1081px) and (max-height: 820px) {
  .dashboard-section {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .dashboard-hero {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .dashboard-hero p,
  .dashboard-note,
  .kpi small,
  .card-head p {
    display: none;
  }

  .kpi {
    min-height: 82px;
  }

  .sroi-gauge {
    width: min(150px, 100%);
  }

  .chart-panel canvas {
    height: 230px;
  }
}

@media (min-width: 761px) and (max-width: 1320px) {
  .site-header {
    gap: 12px;
  }

  .brand-title {
    display: none;
  }

  .brand-mark img {
    height: 34px;
    max-width: 42px;
  }

  .site-nav a {
    padding: 9px 10px;
    font-size: 0.9rem;
  }

  .powerbi-menu {
    top: 72px;
  }

  .powerbi-hero {
    min-height: 420px;
    background:
      linear-gradient(90deg, rgba(23, 32, 29, 0.88), rgba(47, 125, 84, 0.64)),
      url("รูปภาพประกอบโครงการ/ืา่า่าสท.jpg") center center / cover no-repeat;
  }

  .researchers-hero {
    min-height: 430px;
    background:
      linear-gradient(90deg, rgba(23, 32, 29, 0.9), rgba(11, 122, 136, 0.66)),
      url("รูปลงพื้นที่/LINE_ALBUM_ลงพื้นที่ 20-22 พ.ย. 68_260419_1.jpg") center center / cover no-repeat;
  }
}

@media (max-width: 760px) {
  .site-header {
    min-height: 64px;
    gap: 12px;
  }

  .nav-toggle {
    display: block;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    gap: 4px;
    padding: 3px 4px;
  }

  .brand-mark img {
    height: 30px;
    max-width: 38px;
  }

  .brand-title {
    max-width: 38vw;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.92rem;
  }

  .site-nav {
    position: absolute;
    top: 64px;
    right: 18px;
    left: 18px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .site-nav.open {
    display: flex;
  }

  .hero {
    min-height: 76vh;
    padding-top: 76px;
    padding-bottom: 72px;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.65rem;
  }

  .hero-lead {
    font-size: 1rem;
  }

  .quick-stats,
  .impact-path,
  .activity-grid,
  .visit-timeline,
  .gallery-grid,
  .researcher-grid,
  .powerbi-section-grid,
  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .powerbi-hero {
    padding-top: 70px;
    min-height: 520px;
    align-items: flex-end;
    background:
      linear-gradient(0deg, rgba(23, 32, 29, 0.92), rgba(23, 32, 29, 0.58) 58%, rgba(23, 32, 29, 0.22)),
      url("รูปภาพประกอบโครงการ/ืา่า่าสท.jpg") center top / auto 100% no-repeat;
  }

  .powerbi-hero h1 {
    font-size: 2rem;
  }

  .powerbi-hero p:last-child {
    font-size: 1rem;
  }

  .researchers-hero {
    padding-top: 70px;
    min-height: 520px;
    align-items: flex-end;
    background:
      linear-gradient(0deg, rgba(23, 32, 29, 0.92), rgba(23, 32, 29, 0.58) 58%, rgba(23, 32, 29, 0.22)),
      url("รูปลงพื้นที่/LINE_ALBUM_ลงพื้นที่ 20-22 พ.ย. 68_260419_1.jpg") center top / auto 100% no-repeat;
  }

  .researchers-hero h1 {
    font-size: 2.25rem;
  }

  .researchers-hero p:last-child {
    font-size: 1rem;
  }

  .powerbi-menu {
    position: static;
    grid-template-columns: 1fr;
  }

  .powerbi-frame-wrap,
  .powerbi-frame-wrap iframe {
    min-height: 480px;
  }

  .powerbi-frame-wrap iframe {
    height: 70vh;
  }

  .visit-highlight {
    grid-template-rows: 260px auto;
  }

  .photo-mosaic figure {
    grid-template-columns: 1fr;
    grid-template-rows: 180px auto;
  }

  /* figcaption on mobile */
  .visit-highlight figcaption,
  .photo-card figcaption,
  .feature-image figcaption,
  .photo-mosaic figcaption {
    font-size: 0.82rem;
    line-height: 1.5;
  }

  .photo-card figcaption,
  .feature-image figcaption {
    min-height: 40px;
  }

  .photo-mosaic figcaption {
    padding: 10px 12px;
  }

  .visit-highlight figcaption span {
    font-size: 0.86rem;
  }

  .photo-card {
    grid-template-rows: 230px auto;
  }

  .gallery-heading {
    display: block;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .section {
    padding-top: 64px;
    padding-bottom: 64px;
  }

  .dashboard-section {
    padding: 12px;
  }

  .dashboard-board {
    padding: 10px;
  }

  .dashboard-status {
    min-width: 0;
  }

  .chart-panel canvas {
    height: 220px;
  }

  .feature-image img {
    min-height: 260px;
  }

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

  /* controls: allow label text to wrap on small screens */
  .controls label {
    white-space: normal;
  }

  /* gauge summary: single column on mobile */
  .gauge-summary {
    grid-template-columns: 1fr;
  }

  /* kpi font size */
  .kpi strong {
    font-size: 1.1rem;
  }

  /* footer logos smaller on mobile */
  .footer-brand-mark img {
    height: 30px;
  }

  /* dashboard hero gap */
  .dashboard-hero {
    gap: 10px;
  }
}

/* ─── Very small screens (≤ 480px) ───────────────────── */
@media (max-width: 480px) {
  .hero {
    min-height: 60vh;
    padding-left: 18px;
    padding-right: 18px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .button {
    width: 100%;
    text-align: center;
  }

  .quick-stats article {
    padding: 18px;
  }

  .section {
    padding-top: 48px;
    padding-bottom: 48px;
  }

  .activity-card img {
    height: 180px;
  }

  .photo-card {
    grid-template-rows: 180px auto;
  }

  /* figcaption smallest screens */
  .visit-highlight figcaption,
  .photo-card figcaption,
  .feature-image figcaption,
  .photo-mosaic figcaption {
    font-size: 0.78rem;
    padding: 8px 10px;
  }

  .visit-highlight figcaption span {
    font-size: 0.82rem;
  }

  .dashboard-board {
    padding: 8px;
  }

  .dashboard-kpis {
    grid-template-columns: 1fr;
  }

  .chart-panel canvas {
    height: 200px;
  }

  .sroi-gauge {
    width: min(160px, 100%);
  }

  .footer-brand {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-brand-mark {
    flex-wrap: wrap;
  }

  .footer-tagline {
    font-size: 0.9rem;
  }

  .powerbi-menu {
    grid-template-columns: 1fr;
  }
}
