/* หน้าตาแบบเว็บซีรีส์แม่น้ำสาย (ai-care-research.re-groups.com = เว็บ_แม่น้ำสาย/sai-river-home.html)
   ทับ glass.css + glass-pages.css ทุกหน้า: หัวเว็บโลโก้คู่, ปุ่มและการ์ดมุมตัด, หัวหน้าแบบ EP, ฟอนต์ Oswald/Kanit
   คำนำหน้า html[data-theme] ทำให้ชนะกฎ [data-theme="light"] .ig-page ... ของ glass.css โดยไม่ต้องใช้ !important */

:root {
  --s-bg: #f6f7f3; --s-surface: #fff; --s-surface2: #f9faf6;
  --s-line: rgba(52,42,30,.22); --s-line-strong: rgba(52,42,30,.38); --s-line2: rgba(52,42,30,.11);
  --s-ink: #221e19; --s-ink2: #352f27; --s-muted: #524a3f; --s-dim: #685f52;
  --s-acc: #b34812; --s-acc2: #963b0d; --s-acc-soft: rgba(179,72,18,.10); --s-on-acc: #fff8f1;
  --s-topbar: rgba(246,247,243,.95); --s-hero-a: #ece8f4; --s-hero-b: #f6f1e7;
  --s-en: "Oswald", "Arial Narrow", sans-serif;
}
:root[data-theme="dark"] {
  --s-bg: #0b0c29; --s-surface: #101238; --s-surface2: #151845;
  --s-line: rgba(220,214,255,.18); --s-line-strong: rgba(220,214,255,.34); --s-line2: rgba(220,214,255,.09);
  --s-ink: #f4eee3; --s-ink2: #dcd6ea; --s-muted: #b5b1ce; --s-dim: #9490b5;
  --s-acc: #f29a3f; --s-acc2: #d97a2b; --s-acc-soft: rgba(242,154,63,.15); --s-on-acc: #1d0e02;
  --s-topbar: linear-gradient(#090a22, rgba(9,10,34,.90)); --s-hero-a: #16173f; --s-hero-b: #0b0c29;
}

/* โทนหลักของหน้า (ตัวแปรเดิมของ glass.css ชี้มาที่ชุดใหม่) */
html[data-theme] .ig-page {
  --deep: var(--s-bg); --deep-2: var(--s-surface); --ink: var(--s-ink); --dim: var(--s-muted);
  --line: var(--s-line); --glass: var(--s-surface2); --go: var(--s-acc); --accent: var(--s-acc);
  background-color: var(--s-bg); color: var(--s-ink);
  background-image: radial-gradient(circle at 46% 3%, rgba(255,180,95,.30) 0, rgba(245,160,90,.11) 14%, transparent 34%), linear-gradient(180deg, #f7f8f4 0%, #f4f6f0 55%, #eef1e8 100%);
  background-attachment: fixed;
}
html[data-theme] .ig-page ::selection { background: rgba(196,88,28,.22); color: var(--s-ink); }

/* ความกว้างเนื้อหาเท่าหัวเว็บ (เว็บสาย: --content-w 1180px ขอบข้าง 24px, จอมือถือ 16px) ขอบซ้ายขวาจึงตรงกันทั้งหน้า */
html[data-theme] .ig-page .mo-wrap, html[data-theme] .ig-page .gl-main .mo-wrap { width: min(1132px, 100% - 48px); }
@media (max-width: 640px) { html[data-theme] .ig-page .mo-wrap, html[data-theme] .ig-page .gl-main .mo-wrap { width: calc(100% - 32px); } }

/* ----- หัวเว็บ ----- */
html[data-theme] .ig-page .site-header { background: var(--s-topbar); border-bottom: 1px solid var(--s-line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
html[data-theme] .ig-page .header-inner { min-height: 68px; max-width: 1180px; width: 100%; padding: 0 24px; gap: 16px; }
html[data-theme] .ig-page .brand { gap: 13px; font: inherit; color: var(--s-ink); flex: none; }
html[data-theme] .ig-page .brand-logo { width: 44px; height: 44px; padding: 2px; background: #fff; border-radius: 50%; object-fit: contain; flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.12; }
.brand-text b { font: 700 19px var(--s-en); letter-spacing: .04em; color: var(--s-ink); }
.brand-text small { font: 400 12px var(--f-head); color: var(--s-muted); }
/* ชื่อเฉพาะหน้า (safety-map.php): ชื่อแผนที่ภาษาไทยยาว ใช้ฟอนต์ไทย ตัดเป็น 2 บรรทัดได้ */
.brand-text--page { min-width: 0; max-width: 560px; }
.brand-text--page b { font: 700 16px/1.3 var(--f-head); letter-spacing: 0; white-space: normal; }
.brand-text--page small { font-size: 11.5px; line-height: 1.35; margin-top: 2px; white-space: normal; overflow-wrap: anywhere; }
.brand:has(.brand-text--page) { min-width: 0; flex: 1 1 auto; }
/* มือถือ: บรรทัดรองของชื่อแผนที่ไม่เกิน 2 บรรทัด แถบบนจะได้ไม่สูงเกิน */
@media (max-width: 760px) { .brand-text--page small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; } }

/* เมนู: ตัวอังกฤษ Oswald หนา + ไทยตัวเล็ก ชิดขวา ไม่มีพื้นหลังแคปซูล */
html[data-theme] .ig-page .site-nav { margin-left: auto; gap: 6px; --nav-hover: var(--s-acc-soft); --nav-panel: var(--s-surface); --nav-line: var(--s-line); --nav-on: var(--s-acc); --nav-ic: var(--s-acc); --nav-ink: var(--s-ink); --nav-dim: var(--s-muted); }
html[data-theme] .ig-page .site-nav > a, html[data-theme] .ig-page .nav-dd > summary { padding: 4px 6px; min-height: 44px; border-radius: 4px; background: none; color: var(--s-ink); gap: 4px; }
.site-nav > a > .nav-ic { display: none; }
.nav-lbl { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.nav-lbl b { font: 700 13.5px var(--s-en); letter-spacing: .05em; }
.nav-lbl small { font: 400 11px var(--f-head); color: var(--s-muted); }
html[data-theme] .ig-page .site-nav > a:hover, html[data-theme] .ig-page .nav-dd > summary:hover, html[data-theme] .ig-page .nav-dd[open] > summary { background: none; color: var(--s-acc); }
.site-nav > a:hover small, .nav-dd > summary:hover small, .nav-dd[open] > summary small { color: var(--s-acc); }
html[data-theme] .ig-page .site-nav > a[aria-current="page"], html[data-theme] .ig-page .nav-dd.is-current > summary { background: none; color: var(--s-acc); box-shadow: inset 0 -2px 0 var(--s-acc); }
html[data-theme] .ig-page .nav-panel { border-radius: 0; border: 1px solid var(--s-line); border-top: 3px solid var(--s-acc); box-shadow: 0 18px 40px -24px rgba(30,20,40,.45); }
html[data-theme] .ig-page .nav-panel a { border-radius: 0; }
html[data-theme] .ig-page .nav-toggle { border-radius: 0; background: var(--s-surface2); border-color: var(--s-line-strong); color: var(--s-ink); min-height: 44px; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }

/* ปุ่มสลับโทน: ปุ่มกลมพระจันทร์/ดวงอาทิตย์ */
html[data-theme] .ig-page .ig-theme { width: 38px; height: 38px; min-height: 0; padding: 0; justify-content: center; border-radius: 50%; border: 1px solid transparent; background: #161845; color: #ffd86b; box-shadow: 0 2px 8px rgba(22,24,69,.18); transition: transform .15s, box-shadow .15s; }
html[data-theme="dark"] .ig-page .ig-theme { background: #f1edd5; color: #1b1c45; box-shadow: 0 0 16px rgba(241,237,213,.3); }
html[data-theme] .ig-page .ig-theme:hover { transform: scale(1.06); box-shadow: 0 0 0 2px var(--s-acc); }
.ig-theme svg { width: 18px; height: 18px; }
.ig-theme #theme-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 1179px) {
  html[data-theme] .ig-page .site-nav { background: var(--s-surface); border: 1px solid var(--s-line); }
  .nav-lbl { flex-direction: row; align-items: baseline; gap: 10px; }
  html[data-theme] .ig-page .site-nav > a, html[data-theme] .ig-page .nav-dd > summary { padding: 10px 6px; }
}
@media (max-width: 640px) {
  html[data-theme] .ig-page .header-inner { min-height: 60px; padding: 0 16px; }
  html[data-theme] .ig-page .brand { gap: 9px; }
  html[data-theme] .ig-page .brand-logo { width: 36px; height: 36px; }
  .brand-text b { font-size: 15.5px; }
}
@media (max-width: 400px) { html[data-theme] .ig-page .brand-logo + .brand-logo { display: none; } }

/* ----- หัวหน้าเนื้อหา (แบบหัว EP) ----- */
html[data-theme] .ig-page .gl-hero { padding: 44px 0 56px; border-bottom: 1px solid var(--s-line2); }
html[data-theme] .ig-page .gl-hero-sky { background: radial-gradient(120% 90% at 70% 10%, var(--s-hero-a), var(--s-hero-b)); }
html[data-theme] .ig-page .gl-hero-sky::after { display: none; }
html[data-theme] .ig-page .gl-kicker, html[data-theme] .ig-page .mo-kicker { font: 600 14px/1.4 var(--s-en); letter-spacing: .05em; text-transform: uppercase; color: var(--s-acc); }   /* เว็บสายใช้ .22em กับหัวอังกฤษ แต่หัวของเว็บนี้เป็นภาษาไทย ระยะกว้างทำให้อ่านยาก */
html[data-theme] .ig-page .gl-title { font: 600 clamp(32px, 4.4vw, 56px)/1.15 var(--f-head); letter-spacing: 0; margin: 10px 0 14px; }
html[data-theme] .ig-page .gl-lede { font: 400 clamp(17px, 1.9vw, 20px)/1.55 var(--f-head); color: var(--s-ink2); max-width: 34em; }

/* ----- ส่วนเนื้อหา ----- */
html[data-theme] .ig-page .gl-sec { padding: 64px 0; }
html[data-theme] .ig-page .gl-sec + .gl-sec { border-top-color: var(--s-line2); }
html[data-theme] .ig-page .gl-sec--tint { background: var(--s-surface2); }
html[data-theme] .ig-page .gl-h2, html[data-theme] .ig-page .mo-h2 { font: 600 clamp(24px, 3vw, 34px)/1.25 var(--f-head); }
html[data-theme] .ig-page .gl-h3 { font: 600 clamp(19px, 2.2vw, 22px)/1.35 var(--f-head); }
html[data-theme] .ig-page .gl-intro { color: var(--s-muted); }
html[data-theme] .ig-page .gl-main a:not(.btn) { color: var(--s-acc); }

/* ----- การ์ด: แผงเรียบมุมตัด แทนกระจก ----- */
html[data-theme] .ig-page .glass { background: var(--s-surface); border: 1px solid var(--s-line); border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
html[data-theme] .ig-page .gl-card, html[data-theme] .ig-page .ig-story-card { border-top: 3px solid var(--s-acc); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
html[data-theme] .ig-page a.gl-card:hover { background: var(--s-surface2); border-color: var(--s-acc); }
html[data-theme] .ig-page .gl-card p { color: var(--s-muted); }
html[data-theme] .ig-page .gl-card-n { font: 700 15px var(--s-en); letter-spacing: .18em; color: var(--s-acc); }
html[data-theme] .ig-page .gl-card img { border-radius: 0; }
html[data-theme] .ig-page .gl-table-wrap { border-radius: 0; }
html[data-theme] .ig-page .gl-stat { border-top-color: var(--s-line-strong); }
html[data-theme] .ig-page .gl-stat dd { font: 600 2rem/1.2 var(--f-head); }

/* ----- ปุ่มมุมตัด ----- */
html[data-theme] .ig-page .btn { min-height: 44px; padding: 0 20px; border-radius: 0; font: 500 15px var(--f-head); border: 1px solid var(--s-line-strong); color: var(--s-ink); background: var(--s-surface2); box-shadow: none; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); transform: none; }
html[data-theme] .ig-page .btn:hover { border-color: var(--s-acc); color: var(--s-acc); background: var(--s-acc-soft); box-shadow: none; }
html[data-theme] .ig-page .btn--go { background: var(--s-acc); border-color: var(--s-acc); color: var(--s-on-acc); }
html[data-theme] .ig-page .btn--go:hover { background: var(--s-acc2); color: var(--s-on-acc); }
html[data-theme] .ig-page .btn--ghost[aria-pressed="true"] { background: var(--s-acc); border-color: var(--s-acc); color: var(--s-on-acc); }

/* ----- ท้ายเว็บ ----- */
html[data-theme] .ig-page .site-footer { background: var(--s-bg); border-top: 1px solid var(--s-line); color: var(--s-ink); }
html[data-theme] .ig-page .site-footer strong { font-family: var(--f-head); }
html[data-theme] .ig-page .site-footer a, html[data-theme] .ig-page .site-footer .muted { color: var(--s-muted); }
html[data-theme] .ig-page .site-footer a:hover { color: var(--s-acc); }
html[data-theme] .ig-page .footer-bottom { border-top-color: var(--s-line); }

/* ----- หน้าแรก: แถบโลโก้ภาคี (เหมือน .sr-logos ของเว็บแม่น้ำสาย) และคำตอบเรื่องน้ำอยู่ในจอแรก ----- */
.sr-logos { container-type: inline-size; }
.sr-in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px 20px; }
.sr-in > div { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.sr-in .sr-left { justify-content: flex-end; }
.sr-in .sr-right { justify-content: flex-start; }
.sr-in .sr-label { font: 600 13px/1.3 var(--f-head); color: var(--s-muted); letter-spacing: .04em; text-align: center; white-space: nowrap; }
.sr-in img { height: 36px; width: auto; display: block; }
.sr-in img[src$="rise.png"] { height: 24px; }
html[data-theme="dark"] .sr-in img { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
@container (max-width: 600px) { .sr-in { gap: 6px 12px; } .sr-in > div { gap: 6px 10px; } .sr-in img { height: 30px; } .sr-in img[src$="rise.png"] { height: 20px; } }
@container (max-width: 430px) { .sr-in { grid-template-columns: 1fr; } .sr-in .sr-label { order: -1; } .sr-in .sr-left, .sr-in .sr-right { justify-content: center; } }

/* จอแรก (Layout A): 2 คอลัมน์ใหญ่ (คำตอบซ้าย | แผนที่ 3D กว้างขวา) + แถบการ์ดผลวิจัย 4 ใบแนวนอนด้านล่าง */
html[data-theme] .ig-page .mo-hero { padding: 14px 0 44px; }
html[data-theme] .ig-page .mo-hero-grid {
  grid-template-columns: minmax(0, .86fr) minmax(0, 1.14fr);
  grid-template-areas:
    "copy  logos"
    "copy  world"
    "board world"
    "shelf shelf";
  grid-template-rows: auto auto 1fr auto;
  gap: 0 36px;
  align-items: start;
}
html[data-theme] .ig-page .mo-hero-copy { grid-area: copy; padding: 4px 0 0; }
html[data-theme] .ig-page .mo-hero-grid > .sr-logos { grid-area: logos; padding: 2px 0 6px; }
html[data-theme] .ig-page .mo-hero-grid > .ig-world { grid-area: world; height: 430px; margin-bottom: 76px; }
html[data-theme] .ig-page .ig-world .ig-scene-caption { bottom: -36px; }
html[data-theme] .ig-page .ig-world .ig-follow { bottom: -76px; }
html[data-theme] .ig-page .mo-title { font-size: clamp(2.45rem, 3.5vw, 3.35rem); line-height: 1.13; margin-bottom: 8px; }
html[data-theme] .ig-page .mo-title .w { display: inline; }
html[data-theme] .ig-page .mo-title .w:last-child { display: block; }
html[data-theme] .ig-page .mo-lede { font-size: .98rem; line-height: 1.55; margin: 0 0 12px; }
html[data-theme] .ig-page .mo-lede br { display: none; }
html[data-theme] .ig-page .ig-hero-actions { margin: 0 0 4px; }
html[data-theme] .ig-page .mo-hero-copy .ig-place { display: none; }

/* กล่องคำตอบในคอลัมน์ซ้าย: 3 คำตอบเรียงเป็นแถว ไม่มีกรอบซ้อน เหลือเส้นคั่นบนสีอิฐ */
html[data-theme] .ig-page .mo-hero-grid > .ig-board {
  grid-area: board; margin-top: 12px; padding: 14px 0 0;
  background: none; border: 0; border-top: 3px solid var(--s-acc); clip-path: none; box-shadow: none;
}
html[data-theme] .ig-page .ig-board-head h2 { font: 600 1.35rem/1.3 var(--f-head); }
html[data-theme] .ig-page .ig-board .ig-date { margin: 3px 0 8px; font-size: .9rem; color: var(--s-muted); }
html[data-theme] .ig-page .ig-board .answers { display: block; margin-bottom: 10px; }
html[data-theme] .ig-page .ig-board .answers .answer { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px 14px; padding: 10px 0; background: none; border: 0; clip-path: none; }
html[data-theme] .ig-page .ig-board .answers .answer:first-child { padding-left: 0; }
html[data-theme] .ig-page .ig-board .answers .answer + .answer { border-left: 0; border-top: 1px solid var(--s-line); }
html[data-theme] .ig-page .ig-board .answer-q { font: 600 1.08rem/1.3 var(--f-head); color: var(--s-ink); margin: 0; }
html[data-theme] .ig-page .ig-board .answer-v { font-size: .88rem; color: var(--s-muted); margin: 0; font-variant-numeric: tabular-nums; }
html[data-theme] .ig-page .ig-board .slots { display: none; }
html[data-theme] .ig-page .ig-board .mo-actions { padding-top: 12px; margin-bottom: 8px; gap: 8px 10px; }
html[data-theme] .ig-page .ig-board .btn { min-height: 44px; font-size: .92rem; padding: 0 18px; }
html[data-theme] .ig-page .ig-board .mo-note { font-size: .8rem; line-height: 1.48; margin: 0; }

/* ป้ายสถานะ 3 แถว: พื้นสีอ่อน + ขอบบาง + ไอคอน SVG แยกตามระดับ (อ่านชัดทั้งโทนสว่างและโทนมืด) */
html[data-theme="light"] .ig-page .ig-board .answer[data-level="ok"]   { --c: #0f6b4a; --c-bg: rgba(15, 115, 80, .11); --c-bd: rgba(15, 115, 80, .34); }
html[data-theme="light"] .ig-page .ig-board .answer[data-level="warn"] { --c: #8a5300; --c-bg: rgba(180, 115, 0, .12); --c-bd: rgba(180, 115, 0, .38); }
html[data-theme="light"] .ig-page .ig-board .answer[data-level="bad"]  { --c: #b41824; --c-bg: rgba(193, 18, 31, .10); --c-bd: rgba(193, 18, 31, .34); }
html[data-theme="dark"]  .ig-page .ig-board .answer[data-level="ok"]   { --c: #7be0a0; --c-bg: rgba(121, 196, 125, .15); --c-bd: rgba(121, 196, 125, .38); }
html[data-theme="dark"]  .ig-page .ig-board .answer[data-level="warn"] { --c: #f7c36a; --c-bg: rgba(242, 180, 90, .16); --c-bd: rgba(242, 180, 90, .42); }
html[data-theme="dark"]  .ig-page .ig-board .answer[data-level="bad"]  { --c: #ff8575; --c-bg: rgba(255, 107, 87, .16); --c-bd: rgba(255, 107, 87, .42); }
html[data-theme] .ig-page .ig-board .answer[data-level="wait"] { --c: var(--s-muted); --c-bg: var(--s-surface2); --c-bd: var(--s-line); }
html[data-theme] .ig-page .ig-board .answer-a {
  grid-row: 1 / 3; grid-column: 2; align-self: center; margin: 0;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--c-bd, var(--s-line));
  background: var(--c-bg, transparent);
  color: var(--c, var(--s-ink));
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
html[data-theme] .ig-page .ig-board .answer-a strong {
  font: 600 1.32rem/1.15 var(--f-head); color: var(--c, var(--s-ink)); white-space: nowrap;
}
html[data-theme] .ig-page .ig-board .answer[data-level="wait"] .answer-a strong { font-size: .95rem; }
.st-ic { display: none; flex: none; }
.answer[data-level="ok"] .st-ic--ok,
.answer[data-level="warn"] .st-ic--warn,
.answer[data-level="bad"] .st-ic--bad { display: block; }

/* ปุ่ม Digital Twin: มุมขวาล่างของแผนที่ · โหมด 2 มิติ เคอร์เซอร์เป็นกากบาท */
.ig-twin { position: absolute; right: 0; bottom: 16px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border: 1px solid var(--s-acc); background: var(--s-surface); color: var(--s-acc); font: 600 13px var(--f-head); cursor: pointer; clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 9px, 100% 100%, 0 100%); }
.ig-twin:hover, .ig-twin[aria-pressed="true"] { background: var(--s-acc); color: var(--s-on-acc); }
.kok3d-on .ig-world.is-twin, .kok3d-on .ig-world.is-twin:active { cursor: crosshair; }
/* ปุ่มหยุดการเคลื่อนไหว: มุมซ้ายบนของแผนที่ ใต้แถบโลโก้ */
html[data-theme] .ig-page .ig-world .ig-pause { top: 0; bottom: auto; left: 0; z-index: 4; }
@media (max-width: 1099px) {
  html[data-theme] .ig-page .mo-hero-grid { grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr); gap: 0 24px; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-world { height: 410px; }
}
@media (max-width: 760px) {
  html[data-theme] .ig-page .mo-hero-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "logos" "copy" "board" "world"; grid-template-rows: none; gap: 0; }
  html[data-theme] .ig-page .mo-hero-grid > .sr-logos { padding: 2px 0 4px; }
  html[data-theme] .ig-page .sr-in img { height: 26px; }
  html[data-theme] .ig-page .sr-in img[src$="rise.png"] { height: 18px; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-board { margin-top: 12px; }
  html[data-theme] .ig-page .ig-board .answer-a strong { font-size: 1.18rem; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-world { height: 360px; margin: 24px 0 156px; }
  /* ปุ่ม Digital Twin อยู่ใต้แผนที่บนมือถือ (kok-terrain.css) คำอธิบายกับลิงก์จึงเลื่อนลงอีก */
  html[data-theme] .ig-page .ig-world .ig-scene-caption { bottom: -100px; }
  html[data-theme] .ig-page .ig-world .ig-follow { bottom: -144px; }
}

/* ----- หน้าแรก: ชิ้นที่มีคลาส glass แต่ออกแบบไว้แบบไม่มีกรอบ (กฎ .glass ด้านบนทำให้เป็นกล่องขาวไม่มีระยะข้าง) ----- */
/* "เซ็นเซอร์บอกแค่ตัวเลข" 4 ขั้น: การ์ดมุมตัดแถบบนสีเดียวกับการ์ดอื่นของเว็บ */
html[data-theme] .ig-page .step { padding: 22px 24px 24px; border-top: 3px solid var(--s-acc); clip-path: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%); }
html[data-theme] .ig-page .step-n { font: 700 15px/1 var(--s-en); letter-spacing: .18em; color: var(--s-acc); margin-bottom: 12px; }
html[data-theme] .ig-page .step span:last-child { color: var(--s-muted); }
/* คำตอบ 3 ด้านในกล่องคำตอบ: คอลัมน์เรียบคั่นด้วยเส้น ไม่ใช่กล่องซ้อนกล่อง */
html[data-theme] .ig-page .answers .answer { background: none; border: 0; clip-path: none; padding: 0 24px; }
html[data-theme] .ig-page .answers .answer:first-child { padding-left: 0; }
html[data-theme] .ig-page .answers .answer + .answer { border-left: 1px solid var(--s-line); }
@media (max-width: 760px) {
  html[data-theme] .ig-page .step { display: grid; grid-template-columns: 40px 1fr; gap: 4px 12px; padding: 18px 18px 20px; }
  html[data-theme] .ig-page .step-n { grid-row: span 2; margin: 2px 0 0; }
  html[data-theme] .ig-page .answers .answer { padding: 16px 0; }
  html[data-theme] .ig-page .answers .answer + .answer { border-left: 0; border-top: 1px solid var(--s-line); }
}

/* ----- ชิ้นที่ยังโค้งมนแบบกระจก: ให้เป็นแผงเรียบแบบเดียวกับการ์ดอื่น ----- */
/* กล่องหัว "ตามตะกอนหนึ่งเม็ด" (หน้าแรก) ทั้งสองโทน */
html[data-theme] .ig-page .ig-journey-head { width: fit-content; max-width: 100%; padding: 24px 28px; border-radius: 0; background: var(--s-surface); border: 1px solid var(--s-line); box-shadow: none; }
html[data-theme] .ig-page .ig-journey-head > :last-child { margin-bottom: 0; }
@media (max-width: 640px) { html[data-theme] .ig-page .ig-journey-head { padding: 20px 18px; } }
/* กล่องกราฟ (หน้าแม่น้ำกก) */
html[data-theme] .ig-page.gl-river .r-chart-box { border-radius: 0; background: var(--s-surface); border: 1px solid var(--s-line); box-shadow: none; }
/* การ์ดผลวิจัย 4 ใบ (#known .fact) ทั้งสองโทน: กรอบสี่เหลี่ยมมุมคมแบบ Blueprint ไม่มีเงาลอย พื้นโปร่งเบลอ (glass.css ตั้งมุมโค้ง 16px ด้วย id จึงต้องใช้ #known ด้วย) */
html[data-theme] .ig-page #known .fact { border-radius: 0; background: var(--s-surface); border: 1px solid var(--s-line); box-shadow: none; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); clip-path: none; transition: border-color 120ms linear; }
html[data-theme="light"] .ig-page #known .fact { background: rgba(255, 255, 255, .78); }
html[data-theme="dark"] .ig-page #known .fact { background: rgba(16, 18, 56, .68); }
html[data-theme] .ig-page #known .fact:hover { border-color: var(--s-acc); }
html[data-theme="dark"] .ig-page .ig-illustration-note { border-radius: 0; margin-left: 0; max-width: 100%; }

/* ----- ท้องฟ้ากลางคืนในโทนมืด: ดาว 3 ชั้น (เล็กจาง / กลาง / สว่าง) + ทางช้างเผือกจาง ๆ ติดกับจอ (ไม่เลื่อนตามหน้า) ----- */
html[data-theme="dark"] .ig-page {
  background-image: radial-gradient(0.8px 0.8px at 82px 38px, rgba(255,255,255,.55), transparent), radial-gradient(0.6px 0.6px at 18px 137px, rgba(255,240,215,.5), transparent), radial-gradient(0.7px 0.7px at 14px 129px, rgba(255,255,255,.55), transparent), radial-gradient(0.6px 0.6px at 111px 107px, rgba(255,255,255,.55), transparent), radial-gradient(0.6px 0.6px at 141px 108px, rgba(255,240,215,.5), transparent), radial-gradient(0.9px 0.9px at 31px 57px, rgba(255,240,215,.5), transparent), radial-gradient(0.8px 0.8px at 15px 147px, rgba(255,255,255,.55), transparent), radial-gradient(0.8px 0.8px at 56px 11px, rgba(255,255,255,.55), transparent), radial-gradient(0.7px 0.7px at 74px 107px, rgba(255,255,255,.55), transparent), radial-gradient(1.2px 1.2px at 292px 157px, rgba(255,236,200,.75), transparent), radial-gradient(1.2px 1.2px at 92px 52px, rgba(255,236,200,.75), transparent), radial-gradient(0.9px 0.9px at 96px 190px, rgba(255,236,200,.75), transparent), radial-gradient(0.9px 0.9px at 32px 288px, rgba(255,255,255,.8), transparent), radial-gradient(1.1px 1.1px at 254px 272px, rgba(200,215,255,.75), transparent), radial-gradient(1.1px 1.1px at 238px 232px, rgba(255,255,255,.8), transparent), radial-gradient(0.9px 0.9px at 92px 124px, rgba(200,215,255,.75), transparent), radial-gradient(1.9px 1.9px at 537px 253px, rgba(255,240,210,.95), transparent), radial-gradient(1.8px 1.8px at 459px 147px, #fff, transparent), radial-gradient(1.7px 1.7px at 120px 262px, rgba(220,230,255,.95), transparent), radial-gradient(1.7px 1.7px at 155px 250px, rgba(255,240,210,.95), transparent),
    linear-gradient(115deg, transparent 30%, rgba(150,130,220,.07) 45%, rgba(190,170,255,.10) 52%, rgba(150,130,220,.06) 60%, transparent 72%),
    radial-gradient(ellipse 45% 35% at 22% 18%, rgba(98,66,160,.22), transparent 70%),
    radial-gradient(ellipse 40% 30% at 85% 75%, rgba(60,80,170,.16), transparent 70%),
    linear-gradient(180deg, #050619 0%, #0b0c29 55%, #131340 100%);
  background-size: 211px 173px, 211px 173px, 211px 173px, 211px 173px, 211px 173px, 211px 173px, 211px 173px, 211px 173px, 211px 173px, 347px 293px, 347px 293px, 347px 293px, 347px 293px, 347px 293px, 347px 293px, 347px 293px, 587px 461px, 587px 461px, 587px 461px, 587px 461px, auto, auto, auto, auto;
  background-attachment: fixed;
}
/* ดาวกะพริบชั้นบน (ปิดเองเมื่อเครื่องตั้งลดการเคลื่อนไหว) */
html[data-theme="dark"] .ig-page::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(1.5px 1.5px at 39px 285px, rgba(220,230,255,.95), transparent), radial-gradient(1.4px 1.4px at 174px 355px, rgba(220,230,255,.95), transparent), radial-gradient(1.2px 1.2px at 296px 233px, #fff, transparent), radial-gradient(1.6px 1.6px at 138px 242px, #fff, transparent), radial-gradient(1.6px 1.6px at 31px 374px, rgba(255,240,210,.95), transparent), radial-gradient(1.7px 1.7px at 295px 348px, rgba(220,230,255,.95), transparent); background-size: 433px 379px, 433px 379px, 433px 379px, 433px 379px, 433px 379px, 433px 379px; animation: sky-twinkle 5s ease-in-out infinite alternate; }
@keyframes sky-twinkle { from { opacity: .25; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { html[data-theme="dark"] .ig-page::before { animation: none; opacity: .7; } }
/* ส่วนที่เคยทาสีทึบทับฟ้า: ให้โปร่งจนเห็นดาว (หนึ่งปีที่ผ่านมา ยังค่อนข้างทึบ เพราะโมเดล 3 มิติลอยผ่านด้านหลังบนจอใหญ่) */
html[data-theme="dark"] .ig-page .mo-sky { background: radial-gradient(ellipse at 76% 26%, rgba(40,44,120,.35) 0%, transparent 60%); }
html[data-theme="dark"] .ig-page .mo-sky::after { background: none; }
html[data-theme="dark"] .ig-page .gl-hero-sky { background: radial-gradient(120% 90% at 70% 10%, rgba(40,42,110,.45), transparent 70%); }
html[data-theme="dark"] .ig-page #known { background: linear-gradient(0deg, rgba(8,9,34,.9) 15%, rgba(8,9,34,.84) 85%, transparent); }
html[data-theme="dark"] .ig-page .mo-how { background: rgba(16,18,56,.5); }
html[data-theme="dark"] .ig-page .gl-sec--tint { background: rgba(21,24,69,.5); }
html[data-theme="dark"] .ig-page .site-footer { background: rgba(5,6,25,.72); }

/* ----- แถบการ์ดผลวิจัย 4 ใบแนวนอน (เริ่มใต้คู่คำตอบ-แผนที่ แล้วบินเข้าส่วน "หนึ่งปีที่ผ่านมา" เมื่อเลื่อน) ----- */
html[data-theme] .ig-page .mo-hero-grid > .ig-card-shelf {
  grid-area: shelf; grid-column: 1 / -1; justify-self: stretch; align-self: start;
  width: 100%; margin: 20px 0 0; z-index: 2;
}
.ig-shelf-head {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 6px 16px; padding-top: 14px; margin-bottom: 12px; border-top: 1px solid var(--s-line);
}
.ig-shelf-head span { font: 600 .95rem/1.3 var(--f-head); color: var(--s-ink2); }
.ig-shelf-head small { font: 400 .8rem/1.3 var(--f-head); color: var(--s-dim); }
html[data-theme] .ig-page .mo-hero-grid > .ig-card-shelf .ig-card-origin { height: 195px; }
@media (max-width: 760px) {
  html[data-theme] .ig-page .mo-hero-grid > .ig-card-shelf { display: none; }
}

/* ทำให้ .ig-flight-card (การ์ดที่บินจากชั้นวาง) หน้าตาเดียวกับ #known .fact (กรอบ Blueprint มุม 0 คงสีเดิม) */
html[data-theme] .ig-page .ig-flight-card {
  border-radius: 0; background: var(--s-surface); border: 1px solid var(--s-line); box-shadow: none;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  padding: 18px 20px; gap: 4px; clip-path: none;
  transition: border-color 120ms linear;
}
html[data-theme="light"] .ig-page .ig-flight-card { background: rgba(255, 255, 255, .78); }
html[data-theme="dark"] .ig-page .ig-flight-card { background: rgba(16, 18, 56, .68); }
html[data-theme] .ig-page .ig-flight-card:hover { border-color: var(--s-acc); }
html[data-theme] .ig-page .ig-flight-card .tag { font-size: .78rem; padding: 3px 10px; }
html[data-theme] .ig-page .ig-flight-card b { font: 600 1.18rem/1.3 var(--f-head); margin-top: 8px; color: var(--s-ink); }
html[data-theme] .ig-page .ig-flight-card span:last-child { font-size: .88rem; line-height: 1.48; color: var(--s-muted); }
html[data-theme] .ig-page #known { padding-top: 84px; }
html[data-theme] .ig-page #known .fact { padding: 18px 20px; gap: 4px; }
html[data-theme] .ig-page #known .fact .tag { font-size: .78rem; padding: 3px 10px; }
html[data-theme] .ig-page #known .fact b { font: 600 1.18rem/1.3 var(--f-head); margin-top: 8px; }
html[data-theme] .ig-page #known .fact span:last-child { font-size: .88rem; line-height: 1.48; }

/* ซ่อนแถบเมนูลอย .dock ช่วงอยู่บนสุดของหน้าแรก เพื่อไม่ให้บังเนื้อหาจอแรกบนโน้ตบุ๊ก/มือถือ */
html[data-theme] .ig-page .dock {
  transition: opacity .28s ease, translate .32s cubic-bezier(.16, 1, .3, 1);
}
html[data-theme] .ig-page .dock.is-hidden {
  opacity: 0;
  translate: -50% calc(100% + 28px);
  pointer-events: none;
}

/* ----- ปุ่มเปิดแผนที่ 2 มิติ (Digital Twin): ปุ่มหลักสีเต็ม กลางล่างแผนที่ บอกให้รู้ว่ากดแล้วได้อะไร · เต้นเบา ๆ จนกว่าจะกดครั้งแรก ----- */
html[data-theme] .ig-page .ig-world .ig-twin { left: auto; right: 0; bottom: 12px; translate: none; min-height: 56px; padding: 8px 22px 8px 16px; gap: 10px;
  background: var(--s-acc); border: 0; color: var(--s-on-acc); font: 600 16px/1.2 var(--f-head); text-align: left; white-space: nowrap;
  box-shadow: 0 10px 26px -10px rgb(150 50 10 / .6); clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 0 100%); }
html[data-theme] .ig-page .ig-world .ig-twin small { display: block; font: 400 12.5px/1.3 var(--f-head); opacity: .9; }
html[data-theme] .ig-page .ig-world .ig-twin:hover { background: var(--s-acc2); color: var(--s-on-acc); }
html[data-theme] .ig-page .ig-world .ig-twin[aria-pressed="true"] { background: var(--s-surface); color: var(--s-acc); border: 2px solid var(--s-acc); min-height: 48px; }
.ig-twin:not(.was-used) { animation: twin-call 2.4s ease-in-out infinite; }
@keyframes twin-call { 0%, 100% { box-shadow: 0 10px 26px -10px rgb(150 50 10 / .6), 0 0 0 0 rgb(214 110 40 / .45); } 50% { box-shadow: 0 10px 26px -10px rgb(150 50 10 / .6), 0 0 0 10px rgb(214 110 40 / 0); } }
@media (prefers-reduced-motion: reduce) { .ig-twin:not(.was-used) { animation: none; } }
@media (max-width: 760px) { html[data-theme] .ig-page .ig-world .ig-twin { left: 50%; right: auto; translate: -50% 0; bottom: -62px; font-size: 15px; } html[data-theme] .ig-page .ig-world .ig-twin small { font-size: 11.5px; } }

/* ----- เส้นโยงจากป้ายจุดที่เลือกบนแผนที่ ไปที่คำตอบเรื่องน้ำวันนี้ (kok-terrain.js วาดทุกเฟรม) ----- */
.kok3d-link { position: fixed; inset: 0; width: 100vw; height: 100vh; z-index: 25; pointer-events: none; overflow: visible; }
.kok3d-link path { fill: none; }
.kok3d-link .halo { stroke: var(--s-bg); stroke-width: 6; opacity: .85; }
.kok3d-link .ln { stroke: var(--s-acc); stroke-width: 2.2; stroke-dasharray: 7 5; }
.kok3d-link .end { fill: var(--s-acc); stroke: var(--s-bg); stroke-width: 2.5; }
.kok3d-link .start { fill: #b34812; stroke: #fff; stroke-width: 2; }

/* ----- หน้าแรก จอเตี้ย (โน้ตบุ๊ก): บีบหัวหน้าให้แถบการ์ดผลวิจัยขึ้นมาอ่านได้ในจอแรก ไม่ซ่อนอะไร แค่ชิดขึ้น ----- */
@media (min-width: 761px) and (max-height: 900px) {
  html[data-theme] .ig-page .mo-hero { padding: 15px 0 24px; }
  html[data-theme] .ig-page .mo-title { font-size: clamp(2.2rem, 3.2vw, 2.9rem); margin-bottom: 6px; }
  html[data-theme] .ig-page .mo-lede { font-size: .95rem; line-height: 1.5; margin-bottom: 8px; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-board { margin-top: 10px; padding-top: 10px; }
  html[data-theme] .ig-page .ig-board-head h2 { font-size: 1.25rem; }
  html[data-theme] .ig-page .ig-board .ig-date { font-size: .85rem; margin: 2px 0 4px; }
  html[data-theme] .ig-page .ig-board .answers .answer { padding: 7px 0; }
  html[data-theme] .ig-page .ig-board .answer-q { font-size: 1.02rem; }
  html[data-theme] .ig-page .ig-board .answer-v { font-size: .85rem; }
  html[data-theme] .ig-page .ig-board .answer-a strong { font-size: 1.5rem; }
  html[data-theme] .ig-page .ig-board .mo-actions { padding-top: 8px; margin-bottom: 4px; }
  html[data-theme] .ig-page .ig-board .btn { min-height: 40px; font-size: .9rem; }
  html[data-theme] .ig-page .ig-board .mo-note { font-size: .78rem; line-height: 1.4; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-world { height: 430px; margin-bottom: 84px; }
  html[data-theme] .ig-page .ig-world .ig-scene-caption { bottom: -40px; font-size: .7rem; }
  html[data-theme] .ig-page .ig-world .ig-follow { bottom: -78px; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-card-shelf { margin-top: 6px; }
  .ig-shelf-head { padding-top: 8px; margin-bottom: 8px; }
}
@media (min-width: 761px) and (max-height: 800px) {
  html[data-theme] .ig-page .mo-title { font-size: clamp(2.1rem, 3vw, 2.6rem); }
  html[data-theme] .ig-page .ig-board .answers .answer { padding: 5px 0; }
  html[data-theme] .ig-page .ig-board .answer-a strong { font-size: 1.4rem; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-world { height: 390px; margin-bottom: 80px; }
}
@media (min-width: 761px) and (max-height: 720px) {
  html[data-theme] .ig-page .mo-hero { padding: 4px 0 16px; }
  html[data-theme] .ig-page .mo-title { font-size: clamp(1.8rem, 2.6vw, 2.2rem); margin-bottom: 4px; }
  html[data-theme] .ig-page .mo-lede { font-size: .88rem; line-height: 1.45; margin-bottom: 4px; }
  html[data-theme] .ig-page .ig-board-head h2 { font-size: 1.1rem; }
  html[data-theme] .ig-page .ig-board .ig-date { font-size: .8rem; }
  html[data-theme] .ig-page .ig-board .answers .answer { padding: 3px 0; }
  html[data-theme] .ig-page .ig-board .answer-q { font-size: .95rem; }
  html[data-theme] .ig-page .ig-board .answer-v { font-size: .8rem; }
  html[data-theme] .ig-page .ig-board .answer-a strong { font-size: 1.2rem; }
  html[data-theme] .ig-page .ig-board .btn { min-height: 36px; padding: 0 12px; font-size: .85rem; }
  html[data-theme] .ig-page .ig-board .mo-note { font-size: .72rem; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-world { height: 330px; margin-bottom: 74px; }
  html[data-theme] .ig-page .ig-world .ig-twin { min-height: 46px; font-size: 14px; }
  html[data-theme] .ig-page .ig-world .ig-twin small { display: none; }
  html[data-theme] .ig-page .mo-hero-grid > .sr-logos .sr-in img { height: 26px; }
  html[data-theme] .ig-page .mo-hero-grid > .ig-card-shelf .ig-card-origin { height: 165px; }
  .ig-shelf-head { margin-bottom: 26px; }   /* the flying cards start ~18px above the shelf box here: keep them off the heading */
}

/* ----- หน้าแรก (แผนที่ตรงกลาง + บล็อก Blueprint ขนาบซ้ายขวา คงโทนสีเดิมของเว็บทั้งหมด) ----- */
html[data-theme] .ig-page .mo-hero { padding-top: 15px; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center {
  grid-template-columns: 236px minmax(0, 1fr) 236px;
  grid-template-areas:
    "top   top   top"
    "left  world right"
    "left  below right"
    "shelf shelf shelf";
  grid-template-rows: auto auto 1fr auto;
  gap: 12px 18px;
  align-items: start;
}
.ig-hero-top {
  grid-area: top;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  grid-template-areas:
    "copy logos"
    "copy actions";
  gap: 4px 24px;
  align-items: start;
  width: 100%;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--s-line);
}
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .mo-hero-copy { grid-area: copy; padding: 2px 0 0; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title { font-size: clamp(2.15rem, 3.1vw, 3rem); line-height: 1.15; margin-bottom: 6px; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title .w { display: inline-block; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title .w:last-child { display: inline-block; margin-left: .18em; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-lede { font-size: .95rem; line-height: 1.5; max-width: 54ch; margin: 0; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .sr-logos { grid-area: logos; width: 100%; padding: 2px 0 0; justify-self: end; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .ig-hero-actions { grid-area: actions; justify-self: end; align-self: end; justify-content: flex-end; margin: 8px 0 0; gap: 10px; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .ig-hero-actions .btn { min-height: 40px; padding: 0 18px; font-size: .92rem; border-radius: 0; clip-path: none; }

/* แผนที่ตรงกลางบนพื้นกริดร่างแบบ Blueprint (ใช้สี --s-line2 เดิมของระบบ ไม่เปลี่ยนสี) */
html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-world {
  grid-area: world;
  width: 100%;
  height: 392px;
  margin: 4px 0 66px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background-image:
    linear-gradient(var(--s-line2) 1px, transparent 1px),
    linear-gradient(90deg, var(--s-line2) 1px, transparent 1px);
  background-size: 32px 32px;
}
html[data-theme] .ig-page:has(.is-map-center) .kok3d-fly { border-radius: 0; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-scene-caption { bottom: -36px; font-size: .69rem; line-height: 1.25; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-follow { bottom: -64px; min-height: 26px; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-card-shelf { margin: 8px 0 0; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-card-origin {
  border-radius: 0;
  clip-path: none;
  box-shadow: none;
  border: 1px solid var(--s-line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 120ms linear;
}
html[data-theme="light"] .ig-page .mo-hero-grid.is-map-center .ig-card-origin { background: rgba(255, 255, 255, .78); }
html[data-theme="dark"] .ig-page .mo-hero-grid.is-map-center .ig-card-origin { background: rgba(16, 18, 56, .68); }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-card-origin:hover { border-color: var(--s-acc); }

/* คอลัมน์ซ้าย-ขวาขนาบข้างแผนที่ (ซ้าย: ลงเล่นน้ำ + เกษตร, ขวา: ปลาและสัตว์หน้าดิน + ปุ่มเปิดแผนที่ 2 มิติ) */
.ig-stage-left,
.ig-stage-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-self: center;
  margin-bottom: 60px;
}
.ig-stage-left  { grid-area: left; }
.ig-stage-right { grid-area: right; }

/* บล็อกการ์ดสไตล์ Blueprint ตาม design.md (คมขอบ 0px, ไม่มีเงา, เส้นประเทคนิค, รหัส FIG. บนพื้นสีเดิม) */
.bp-card {
  display: flex;
  flex-direction: column;
  padding: 12px 16px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  box-shadow: none;
  background: var(--s-surface);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: border-color 120ms linear;
}
html[data-theme="light"] .bp-card { background: rgba(255, 255, 255, .78); }
html[data-theme="dark"] .bp-card  { background: rgba(16, 18, 56, .68); }
.bp-card:hover { border-color: var(--s-acc); }
.bp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--s-line);
}
.bp-fig {
  font: 600 .7rem/1 var(--s-en);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--s-acc);
}
.bp-dim {
  font: 500 .66rem/1 var(--s-en);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--s-dim);
  font-variant-numeric: tabular-nums;
}
.qa-title { margin: 0; font: 600 1.02rem/1.28 var(--f-head); color: var(--s-ink); }
.qa-sub   { margin: 4px 0 0; font: 400 .78rem/1.45 var(--f-head); color: var(--s-muted); }
.qa-foot {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--s-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.qa-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 10px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background: var(--s-surface2);
  font: 600 .82rem/1.35 var(--f-head);
  color: var(--s-muted);
  white-space: normal;
}
html[data-theme="light"] .qa-item[data-level="ok"] .qa-badge   { color: #0f6b4a; background: rgba(15, 115, 80, .11); border-color: rgba(15, 115, 80, .34); }
html[data-theme="light"] .qa-item[data-level="warn"] .qa-badge { color: #8a5300; background: rgba(180, 115, 0, .12); border-color: rgba(180, 115, 0, .38); }
html[data-theme="light"] .qa-item[data-level="bad"] .qa-badge  { color: #b41824; background: rgba(193, 18, 31, .10); border-color: rgba(193, 18, 31, .34); }
html[data-theme="dark"] .qa-item[data-level="ok"] .qa-badge    { color: #7be0a0; background: rgba(121, 196, 125, .15); border-color: rgba(121, 196, 125, .38); }
html[data-theme="dark"] .qa-item[data-level="warn"] .qa-badge  { color: #f7c36a; background: rgba(242, 180, 90, .16); border-color: rgba(242, 180, 90, .42); }
html[data-theme="dark"] .qa-item[data-level="bad"] .qa-badge   { color: #ff8575; background: rgba(255, 107, 87, .16); border-color: rgba(255, 107, 87, .42); }
html[data-theme] .ig-page .mo .qa-line-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 36px;
  padding: 0 12px;
  border-radius: 0;
  clip-path: none;
  background: #0b6e35;
  color: #fff;
  font: 600 .84rem var(--f-head);
  text-decoration: none;
  transition: background-color 120ms linear;
}
html[data-theme] .ig-page .mo .qa-line-btn:hover { background: #085529; color: #fff; }

/* ปุ่มเปิดแผนที่ 2 มิติใต้บล็อกขวา (FIG. 03): ทรง Blueprint 0px ไม่มีเงาลอย */
html[data-theme] .ig-page .ig-stage-right .bp-twin {
  position: static;
  inset: auto;
  translate: none;
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 0;
  clip-path: none;
  box-shadow: none;
  border: 1px solid var(--s-acc);
  background: var(--s-acc);
  color: var(--s-on-acc);
  font: 600 .94rem/1.2 var(--f-head);
  text-align: left;
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear, border-color 120ms linear;
}
html[data-theme] .ig-page .ig-stage-right .bp-twin svg { flex: none; }
html[data-theme] .ig-page .ig-stage-right .bp-twin small { display: block; font: 400 .71rem/1.28 var(--f-head); opacity: .92; margin-top: 2px; }
html[data-theme] .ig-page .ig-stage-right .bp-twin:hover { background: var(--s-acc2); color: var(--s-on-acc); }
html[data-theme] .ig-page .ig-stage-right .bp-twin[aria-pressed="true"] { background: var(--s-surface); color: var(--s-acc); border: 1.5px solid var(--s-acc); }
html[data-theme] .ig-page .ig-stage-right .bp-twin:not(.was-used) { animation: twin-bp-call 2.4s ease-in-out infinite; }
@keyframes twin-bp-call {
  0%, 100% { outline: 0 solid transparent; }
  50% { outline: 3px solid color-mix(in srgb, var(--s-acc) 45%, transparent); outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  html[data-theme] .ig-page .ig-stage-right .bp-twin:not(.was-used) { animation: none; }
}

@media (min-width: 1025px) and (max-width: 1320px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center {
    grid-template-columns: 228px minmax(0, 1fr) 228px;
    gap: 12px 16px;
  }
}
@media (min-width: 761px) and (max-height: 900px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title { font-size: clamp(1.95rem, 2.9vw, 2.7rem); margin-bottom: 4px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-world { height: 360px; margin: 4px 0 60px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-scene-caption { bottom: -35px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-follow { bottom: -60px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-card-shelf { margin-top: 6px; }
}
@media (min-width: 761px) and (max-height: 760px) {
  html[data-theme] .ig-page .mo-hero { padding: 15px 0 18px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top { padding-bottom: 8px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title { font-size: clamp(1.85rem, 2.6vw, 2.3rem); }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-lede { font-size: .88rem; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-world { height: 294px; margin: 2px 0 54px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-scene-caption { bottom: -33px; font-size: .65rem; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-follow { bottom: -55px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-left,
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-right { gap: 8px; margin-bottom: 50px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .bp-card { padding: 10px 12px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .bp-head { padding-bottom: 6px; margin-bottom: 6px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .qa-foot { margin-top: 8px; padding-top: 6px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-shelf-head { margin-bottom: 8px; padding-top: 10px; }
}
@media (min-width: 761px) and (max-width: 1024px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "top   top"
      "world world"
      "below below"
      "left  right"
      "shelf shelf";
    gap: 14px 16px;
  }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "logos logos"
      "copy  actions";
    gap: 8px 18px;
  }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .sr-logos { justify-self: start; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .ig-hero-actions { align-self: center; margin-top: 0; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-world { height: 360px; margin: 4px 0 48px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-left,
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-right { align-self: stretch; margin-bottom: 0; }
}
@media (min-width: 761px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title { white-space: nowrap; }
}
@media (max-width: 760px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "top" "below" "world" "right" "left";
    grid-template-rows: none;
    gap: 12px 0;
  }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "logos" "copy" "actions";
    gap: 8px 0;
    padding-bottom: 10px;
  }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .mo-title { font-size: clamp(1.85rem, 8vw, 2.55rem); }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .sr-logos { justify-self: start; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top > .ig-hero-actions { justify-self: start; justify-content: flex-start; margin: 4px 0 0; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ig-world { height: 340px; margin: 4px 0 66px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-scene-caption { bottom: -36px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-world .ig-follow { bottom: -64px; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-left,
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-right { margin: 0; }
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-right .bp-twin { order: -1; }
}

/* ----- หน้าแรก: ไม้วัดระดับน้ำด้านซ้าย (คัดจาก gl-kok-river.css ให้หน้าตาเหมือนหน้าแม่น้ำกก / EP1) (เว็บ_แม่น้ำสาย/sai-3d.css .gauge-rail): ข้อ 1 อยู่บน
   แต่ละขีดมีเลข + ชื่อไทย + ชื่ออังกฤษ น้ำไหลลงจากบนตามส่วนที่อ่าน ส่วนที่อ่านอยู่มีแถบสีด้านซ้าย ----- */
.home-gauge { --g-rail: 175px; }
.home-gauge .r-rail { position: fixed; left: 0; top: var(--head, 0px); bottom: 0; width: var(--g-rail); z-index: 20; display: flex; flex-direction: column;
    padding: 14px 0 14px 8px; background: var(--s-surface); border-right: 1px solid var(--s-line); user-select: none; transition: top .25s ease; }
.home-gauge .gauge-plate { position: relative; display: flex; flex-direction: column; width: 100%; height: 100%; background: var(--s-bg); border: 1.5px solid var(--s-line); border-right: 0; border-radius: 6px 0 0 6px; }
/* ขีดไม้บรรทัดจาง ๆ ตามขอบซ้าย */
.home-gauge .gauge-plate::before { content: ""; position: absolute; inset: 0 auto 0 6px; width: 18px; z-index: 1; pointer-events: none;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='40'%3E%3Cg fill='%23a5461a' opacity='0.22'%3E%3Crect x='0' y='0' width='3' height='40'/%3E%3Crect x='0' y='0' width='14' height='3'/%3E%3Crect x='0' y='10' width='8' height='2'/%3E%3Crect x='0' y='20' width='14' height='3'/%3E%3Crect x='0' y='30' width='8' height='2'/%3E%3C/g%3E%3C/svg%3E") left top / 18px 40px repeat-y; }
[data-theme="dark"] .home-gauge .gauge-plate::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='40'%3E%3Cg fill='%234fb3ff' opacity='0.25'%3E%3Crect x='0' y='0' width='3' height='40'/%3E%3Crect x='0' y='0' width='14' height='3'/%3E%3Crect x='0' y='10' width='8' height='2'/%3E%3Crect x='0' y='20' width='14' height='3'/%3E%3Crect x='0' y='30' width='8' height='2'/%3E%3C/g%3E%3C/svg%3E"); }
/* น้ำ: แถบแคบตามขีดไม้บรรทัด ลงจากบนตามส่วนที่อ่าน */
.home-gauge .gauge-water { position: absolute; left: 0; top: 0; width: 42px; height: calc(max(var(--level, 0), .06) * 100%); z-index: 2; pointer-events: none;
    background: linear-gradient(180deg, rgb(165 70 26 / .18) 0%, rgb(14 116 144 / .35) 100%); border-right: 1px solid var(--s-line2); border-bottom: 2.5px solid var(--s-acc);
    box-shadow: 0 3px 10px rgb(14 116 144 / .3); transition: height .35s cubic-bezier(.2, .8, .2, 1); }
[data-theme="dark"] .home-gauge .gauge-water { background: linear-gradient(180deg, rgb(227 136 51 / .22) 0%, rgb(56 189 248 / .38) 100%); box-shadow: 0 3px 12px rgb(79 179 255 / .45); }
.home-gauge .gauge-marks { position: relative; z-index: 3; display: flex; flex-direction: column; height: 100%; margin: 0; padding: 0; list-style: none; }
.home-gauge .gauge-marks li { flex: 1; display: flex; align-items: center; min-height: 0; border-bottom: 1px solid var(--s-line2); }
.home-gauge .gauge-marks li:last-child { border-bottom: 0; }
.home-gauge .gauge-marks a { position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 100%; padding: 0 10px 0 14px; overflow: hidden; text-decoration: none; color: var(--s-muted) !important; transition: color .2s, background .2s; }
.home-gauge .gauge-marks a:hover, .home-gauge .gauge-marks a:focus-visible { background: var(--s-acc-soft); }
.home-gauge .mark-num { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 26px; height: 22px; border-radius: 4px; font: 700 13.5px/1 var(--s-en); letter-spacing: .5px; color: var(--s-muted); background: rgb(0 0 0 / .05); transition: all .25s ease; }
[data-theme="dark"] .home-gauge .mark-num { background: rgb(255 255 255 / .07); }
.home-gauge .mark-info { display: flex; flex-direction: column; min-width: 0; overflow: hidden; line-height: 1.15; }
.home-gauge .mark-th { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 500 12px var(--f-head); letter-spacing: -.01em; color: var(--s-ink2); transition: color .2s; }
.home-gauge .mark-en { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 600 9px var(--s-en); letter-spacing: .05em; text-transform: uppercase; color: var(--s-muted); transition: color .2s; }
.home-gauge .gauge-marks a.is-under .mark-num { color: var(--s-ink); font-weight: 600; background: rgb(165 70 26 / .12); }
.home-gauge .gauge-marks a.is-active { background: var(--s-acc-soft); border-left: 3px solid var(--s-acc); }
.home-gauge .gauge-marks a.is-active .mark-num { background: var(--s-acc); color: var(--s-on-acc); box-shadow: 0 2px 8px rgb(165 70 26 / .35); transform: scale(1.05); }
.home-gauge .gauge-marks a.is-active .mark-th, .home-gauge .gauge-marks a.is-active .mark-en { color: var(--s-acc); font-weight: 700; }
/* ซ่อนไม้วัดตอนอยู่หัวหน้า เลื่อนพ้นหัวหน้าแล้วค่อยเลื่อนเข้ามาจากซ้าย (kok-river.js ใส่ body.rail-open) */
@media (min-width: 901px) {
    .home-gauge .r-rail { transform: translateX(-101%); opacity: 0; visibility: hidden; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, visibility 0s .45s, top .25s ease; }
    .home-gauge.rail-open .r-rail { transform: none; opacity: 1; visibility: visible; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, visibility 0s, top .25s ease; }
}
@media (prefers-reduced-motion: reduce) { .home-gauge .r-rail { transition: none !important; } }
/* ซ่อนไม้วัดตอนอยู่หัวหน้า เลื่อนพ้นหัวหน้าแล้วค่อยเลื่อนเข้ามาจากซ้าย (kok-river.js ใส่ body.rail-open) */
@media (min-width: 901px) {
    .home-gauge .r-rail { transform: translateX(-101%); opacity: 0; visibility: hidden; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, visibility 0s .45s, top .25s ease; }
    .home-gauge.rail-open .r-rail { transform: none; opacity: 1; visibility: visible; transition: transform .45s cubic-bezier(.2, .8, .2, 1), opacity .3s ease, visibility 0s, top .25s ease; }
}
@media (prefers-reduced-motion: reduce) { .home-gauge .r-rail { transition: none !important; } }
/* เนื้อหาเว้นที่ให้ไม้วัด 175px: จอกว้างพอ ขอบยังตรงหัวเว็บ (1132px กลางจอ) จอแคบกว่านั้นขอบซ้ายขยับหลบ */
@media (min-width: 901px) { html[data-theme] .ig-page.home-gauge .mo-wrap { width: min(1132px, 100% - var(--g-rail) - 48px); margin-left: max(var(--g-rail) + 24px, (100% - 1132px) / 2); margin-right: auto; } }
/* จอแคบ: แถบเลขแนวนอนติดใต้หัวเว็บ (ไม้วัดอยู่ท้ายหน้าใน DOM จึงใช้ fixed แทน sticky) โผล่เมื่อพ้นหัวหน้า */
@media (max-width: 900px) {
  .home-gauge .r-rail { position: fixed; left: 0; right: 0; top: var(--head, 0px); bottom: auto; width: auto; height: 46px; padding: 0; border-right: 0; border-bottom: 1px solid var(--s-line);
    transform: translateY(-110%); opacity: 0; visibility: hidden; transition: transform .35s ease, opacity .25s ease, visibility 0s .35s, top .25s ease; }
  .home-gauge.rail-open .r-rail { transform: none; opacity: 1; visibility: visible; transition: transform .35s ease, opacity .25s ease, visibility 0s, top .25s ease; }
  .home-gauge .gauge-plate { border: 0; border-radius: 0; }
  .home-gauge .gauge-plate::before { display: none; }
  .home-gauge .gauge-water { top: auto; bottom: 0; width: calc(max(var(--level, 0), .06) * 100%); height: 3px; border: 0; box-shadow: none; background: var(--s-acc); transition: width .35s ease; }
  .home-gauge .gauge-marks { flex-direction: row; }
  .home-gauge .gauge-marks li { border-bottom: 0; border-right: 1px solid var(--s-line2); }
  .home-gauge .gauge-marks li:last-child { border-right: 0; }
  .home-gauge .gauge-marks a { justify-content: center; gap: 6px; padding: 0 4px; }
  .home-gauge .gauge-marks a.is-active { border-left: 0; }
  .home-gauge .mark-en { display: none; }
  .home-gauge .mark-th { font-size: 11.5px; }
}
@media (max-width: 400px) { .home-gauge .mark-num { display: none; } }

/* ----- หน้าแม่น้ำสาย (sai-river.php) ----- */
.gl-sai .sai-figure { margin: 0; }
.gl-sai .sai-figure img { width: 100%; height: auto; display: block; border: 1px solid var(--s-line); }
.gl-sai .sai-figure figcaption { margin-top: 8px; font-size: .78rem; color: var(--s-dim); text-align: right; }
.gl-sai .sai-eps > li { display: flex; }
.gl-sai .sai-ep { width: 100%; text-decoration: none; color: var(--s-ink); padding: 0 0 22px; gap: 8px; }
.gl-sai .sai-ep > img { aspect-ratio: 2.6 / 1; object-fit: cover; margin-bottom: 8px; }
.gl-sai .sai-ep > :not(img) { margin-inline: 22px; }
.gl-sai .sai-ep .gl-card-n i { font: 600 13px var(--f-head); letter-spacing: 0; font-style: normal; color: var(--s-dim); }
.gl-sai .sai-ep .gl-h3 { color: var(--s-ink); }
.gl-sai .sai-bullets { margin: 4px 22px 6px; padding: 0; list-style: none; display: grid; gap: 5px; color: var(--s-ink2); font-size: .95rem; }
.gl-sai .sai-bullets li { position: relative; padding-left: 18px; }
.gl-sai .sai-bullets li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 7px; height: 7px; background: var(--s-acc); clip-path: polygon(0 0, 100% 50%, 0 100%); }
.gl-sai .sai-more { margin-top: auto; font: 600 15px var(--f-head); color: var(--s-acc); }
.gl-sai a.sai-ep:hover .sai-more { text-decoration: underline; }

/* ----- หน้าแรก: อินโฟกราฟิกภาพตัดขวาง (Option 4) แทนฉาก WebGL ไถจอ · ดีไซน์ Blueprint 0px คงโทนสีเดิม ----- */
html[data-theme] .ig-page .ig-journey.is-cross-section {
  padding: 52px 0 64px;
  --cs-earth: rgba(165, 70, 26, .06);
  --cs-water: rgba(14, 116, 144, .18);
  --cs-water-ink: #0e7490;
  --cs-flood: rgba(14, 116, 144, .11);
  --cs-sed-bg: rgba(146, 64, 14, .20);
  --cs-sed-line: rgba(146, 64, 14, .46);
  --cs-ok-ink: #0b6e35;
  --cs-tag-bg: rgba(255, 255, 255, .92);
  --cs-hit-active: rgba(165, 70, 26, .045);
}
html[data-theme="dark"] .ig-page .ig-journey.is-cross-section {
  --cs-earth: rgba(79, 179, 255, .07);
  --cs-water: rgba(56, 189, 248, .22);
  --cs-water-ink: #5ec5ff;
  --cs-flood: rgba(56, 189, 248, .12);
  --cs-sed-bg: rgba(242, 180, 90, .20);
  --cs-sed-line: rgba(242, 180, 90, .52);
  --cs-ok-ink: #7be0a0;
  --cs-tag-bg: rgba(16, 18, 56, .90);
  --cs-hit-active: rgba(79, 179, 255, .065);
}
html[data-theme] .ig-page .ig-journey.is-cross-section .ig-journey-intro { padding: 0 0 14px; }
.cs-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--s-line);
}
html[data-theme] .ig-page .cs-heading .mo-kicker { margin: 0 0 4px; }
html[data-theme] .ig-page .cs-heading .mo-h2 { max-width: none; margin: 0 0 6px; font-size: clamp(1.65rem, 2.7vw, 2.3rem); line-height: 1.2; }
.cs-lede { margin: 0; max-width: 66ch; font: 400 .9rem/1.55 var(--f-head); color: var(--s-muted); }

.cs-controls { display: inline-flex; gap: 8px; flex: none; }
.cs-step-btn {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background: var(--s-surface);
  color: var(--s-ink);
  font: 600 .84rem var(--f-head);
  cursor: pointer;
  transition: border-color 120ms linear, color 120ms linear, background-color 120ms linear;
}
.cs-step-btn:hover:not(:disabled) { border-color: var(--s-acc); color: var(--s-acc); }
.cs-step-btn:disabled { opacity: .42; cursor: not-allowed; }

.cs-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.cs-tab {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 10px 14px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background: var(--s-surface);
  color: var(--s-ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms linear, background-color 120ms linear;
}
html[data-theme="light"] .cs-tab { background: rgba(255, 255, 255, .72); }
html[data-theme="dark"] .cs-tab  { background: rgba(16, 18, 56, .62); }
.cs-tab b { font: 600 .92rem/1.3 var(--f-head); color: var(--s-ink); }
.cs-tab:hover { border-color: var(--s-acc); }
.cs-tab.is-active {
  border-color: var(--s-acc);
  box-shadow: inset 0 2px 0 var(--s-acc);
  background: var(--s-surface);
}
html[data-theme="dark"] .cs-tab.is-active { background: rgba(21, 24, 69, .86); }

.cs-stage {
  padding: 12px 16px 14px;
  background-image:
    linear-gradient(var(--s-line2) 1px, transparent 1px),
    linear-gradient(90deg, var(--s-line2) 1px, transparent 1px);
  background-size: 32px 32px;
}
.cs-svg-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cs-svg { display: block; width: 100%; height: auto; }

/* SVG styling using existing theme palette */
.cs-svg .cs-earth { fill: var(--cs-earth); }
.cs-svg .cs-terrain-line { fill: none; stroke: var(--s-ink); stroke-width: 1.8; }
.cs-svg .cs-guides line { stroke: var(--s-line); stroke-width: 1; stroke-dasharray: 4 4; }
.cs-svg .cs-hit { fill: transparent; stroke: transparent; stroke-width: 1.5; transition: fill 120ms linear, stroke 120ms linear; }
.cs-svg .cs-zone { cursor: pointer; opacity: .58; transition: opacity 120ms linear; }
.cs-svg .cs-zone:hover,
.cs-svg .cs-zone:focus-visible,
.cs-svg .cs-zone.is-active { opacity: 1; outline: none; }
.cs-svg .cs-zone.is-active .cs-hit { fill: var(--cs-hit-active); stroke: var(--s-acc); stroke-dasharray: 5 3; }

.cs-svg .cs-zcode { font: 600 10.5px/1 var(--s-en); letter-spacing: .12em; fill: var(--s-acc); }
.cs-svg .cs-ztitle { font: 600 13.5px/1.2 var(--f-head); fill: var(--s-ink); }
.cs-svg .cs-label-sm { font: 500 11.5px/1.2 var(--f-head); fill: var(--s-ink); }
.cs-svg .cs-dim-txt { font: 500 11px/1.2 var(--f-head); fill: var(--s-muted); }
.cs-svg .cs-note-acc { font: 600 11px/1.2 var(--f-head); fill: var(--s-acc); }
.cs-svg .cs-note-ok { font: 600 11px/1.2 var(--f-head); fill: var(--cs-ok-ink); }

.cs-svg .cs-tag-box { fill: var(--cs-tag-bg); stroke: var(--s-line); stroke-width: 1; }
.cs-svg .cs-tag-txt { font: 600 10.5px/1.2 var(--f-head); fill: var(--s-ink); }
.cs-svg .cs-border-line { stroke: var(--s-muted); stroke-width: 1.4; stroke-dasharray: 4 3; }
.cs-svg .cs-water-fill { fill: var(--cs-water); }
.cs-svg .cs-water-top { stroke: var(--cs-water-ink); stroke-width: 1.8; }
.cs-svg .cs-sed-fill { fill: url(#cs-sed-hatch); stroke: var(--cs-sed-line); stroke-width: 1; }
.cs-svg .cs-flood-fill { fill: var(--cs-flood); }
.cs-svg .cs-flood-line { stroke: var(--cs-water-ink); stroke-width: 1.4; stroke-dasharray: 6 4; }
.cs-svg .cs-flow-water { fill: none; stroke: var(--cs-water-ink); stroke-width: 1.6; }
.cs-svg .cs-flow-acc,
.cs-svg .cs-drop-acc { fill: none; stroke: var(--s-acc); stroke-width: 1.6; stroke-dasharray: 4 3; }
.cs-svg .cs-flow-ok { fill: none; stroke: var(--cs-ok-ink); stroke-width: 1.8; }
.cs-svg .cs-dot { fill: var(--s-acc); }
.cs-svg .cs-veg line,
.cs-svg .cs-veg path { fill: none; stroke: var(--cs-ok-ink); stroke-width: 1.8; stroke-linecap: round; }

.cs-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.cs-card { cursor: pointer; }
.cs-card.is-active {
  border-color: var(--s-acc);
  box-shadow: inset 0 2px 0 var(--s-acc);
}
.cs-card-title { margin: 0 0 6px; font: 600 1rem/1.3 var(--f-head); color: var(--s-ink); }
.cs-card-body { margin: 0; font: 400 .84rem/1.55 var(--f-head); color: var(--s-muted); }
.cs-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--s-line);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
}
html[data-theme] .ig-page .mo .cs-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: .82rem;
  border-radius: 0;
  clip-path: none;
  justify-content: center;
}
html[data-theme] .ig-page .mo .cs-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 600 .8rem/1.3 var(--f-head);
  color: var(--s-acc);
  text-decoration: none;
}
html[data-theme] .ig-page .mo .cs-link:hover { text-decoration: underline; }
.cs-source { margin: 12px 0 0; font: 400 .76rem/1.45 var(--f-head); color: var(--s-dim); }

@media (max-width: 1024px) {
  .cs-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  html[data-theme] .ig-page .ig-journey.is-cross-section { padding: 36px 0 48px; }
  .cs-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cs-svg { min-width: 720px; }
  .cs-cards { grid-template-columns: minmax(0, 1fr); }
}

/* ----- 3D Cutaway Diorama (#cs-3d-wrap) สไตล์ EP4 บนชุดสี Blueprint เดิม ----- */
#river-journey.has-3d .cs-svg-wrap { display: none; }
#river-journey.has-3d .cs3d-wrap { display: block; }
.cs3d-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.cs3d-views { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.cs3d-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background: var(--s-surface);
  color: var(--s-ink);
  font: 600 .8rem var(--f-head);
  cursor: pointer;
  transition: border-color 120ms linear, background-color 120ms linear, color 120ms linear;
}
.cs3d-btn:hover { border-color: var(--s-acc); color: var(--s-acc); }
.cs3d-btn.is-active { background: var(--s-acc); color: var(--s-on-acc); border-color: var(--s-acc); }
.cs3d-play { min-width: 38px; padding: 0 10px; }

.cs3d-viewport {
  position: relative;
  height: 410px;
  overflow: hidden;
  border: 1px solid var(--s-line);
  background: transparent;
}
.cs3d-viewport canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; }
.cs3d-viewport canvas:active { cursor: grabbing; }
.cs3d-labels { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.cs3d-lbl {
  position: absolute;
  left: 0;
  top: 0;
  translate: -50% calc(-100% - 14px);
  padding: 3px 8px;
  border-radius: 0;
  border: 1px solid var(--s-line);
  background: rgba(255, 255, 255, .90);
  color: #1d2420;
  font: 600 11.5px/1.25 var(--f-head);
  white-space: nowrap;
  backdrop-filter: blur(6px);
}
html[data-theme="dark"] .cs3d-lbl {
  background: rgba(11, 12, 41, .88);
  color: var(--s-ink);
  border-color: var(--s-line);
}
.cs3d-lbl::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  translate: -50% 0;
  width: 1px;
  height: 12px;
  background: var(--s-acc);
}
.cs3d-lbl.is-border { border-style: dashed; border-color: #d97706; }
.cs3d-lbl.is-flood  { border-color: #0e7490; color: #0e7490; }
html[data-theme="dark"] .cs3d-lbl.is-flood { border-color: #5ec5ff; color: #5ec5ff; }
.cs3d-lbl.is-ok     { border-color: #0b6e35; color: #0b6e35; }
html[data-theme="dark"] .cs3d-lbl.is-ok { border-color: #7be0a0; color: #7be0a0; }
.cs3d-lbl.is-warn   { border-color: #b41824; color: #b41824; }
html[data-theme="dark"] .cs3d-lbl.is-warn { border-color: #ff8575; color: #ff8575; }

.cs3d-hint {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 3px 8px;
  border: 1px solid var(--s-line);
  background: rgba(255, 255, 255, .82);
  color: var(--s-dim);
  font: 500 .72rem/1.2 var(--f-head);
  pointer-events: none;
}
html[data-theme="dark"] .cs3d-hint { background: rgba(11, 12, 41, .82); }

.cs3d-bottom-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--s-line);
}
.cs3d-seg { display: inline-flex; border: 1px solid var(--s-line); }
.cs3d-seg-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 0;
  background: var(--s-surface);
  color: var(--s-ink);
  font: 600 .78rem var(--f-head);
  cursor: pointer;
  transition: background-color 120ms linear, color 120ms linear;
}
.cs3d-seg-btn + .cs3d-seg-btn { border-left: 1px solid var(--s-line); }
.cs3d-seg-btn.is-active { background: var(--s-acc); color: var(--s-on-acc); }
.cs3d-checks { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.cs3d-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font: 500 .8rem var(--f-head);
  color: var(--s-ink);
  cursor: pointer;
}
.cs3d-check input { accent-color: var(--s-acc); width: 15px; height: 15px; cursor: pointer; }
.cs3d-status {
  padding: 4px 10px;
  border: 1px solid var(--s-line);
  font: 600 .78rem/1.3 var(--f-head);
}
html[data-theme="light"] .cs3d-status[data-level="ok"]   { color: #0f6b4a; background: rgba(15, 115, 80, .10); border-color: rgba(15, 115, 80, .34); }
html[data-theme="light"] .cs3d-status[data-level="warn"] { color: #b41824; background: rgba(193, 18, 31, .10); border-color: rgba(193, 18, 31, .34); }
html[data-theme="dark"] .cs3d-status[data-level="ok"]    { color: #7be0a0; background: rgba(121, 196, 125, .14); border-color: rgba(121, 196, 125, .36); }
html[data-theme="dark"] .cs3d-status[data-level="warn"]  { color: #ff8575; background: rgba(255, 107, 87, .16); border-color: rgba(255, 107, 87, .40); }

@media (max-width: 1024px) {
  .cs3d-viewport { height: 350px; }
}
@media (max-width: 760px) {
  .cs3d-viewport { height: 290px; }
  .cs3d-hint { display: none; }
  .cs3d-lbl { font-size: 10.5px; padding: 2px 6px; }
}

/* ----- หน้าแรก (ประชุม 25 พ.ย. 2569): แถบโลโก้ใหญ่ด้านบน · คำตอบรวม + 7 กิจกรรม (board.js) · เซ็นเซอร์ + Digital Twin ----- */
.ig-logo-banner { padding: 6px 0 2px; }
/* sizes as the old logo strip (.sr-in img above): 36 px, RISE 24 px; 30/20 on phones; 26/18 on short screens */
.sr-banner .sr-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 22px;
  padding: 4px 0 8px; border-bottom: 1px dashed var(--s-line); }
.sr-banner .sr-row img { height: 36px; width: auto; display: block; }
.sr-banner .sr-row img[src$="rise.png"] { height: 24px; }
html[data-theme="dark"] .sr-banner .sr-row img { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
@media (max-width: 760px) { .sr-banner .sr-row img { height: 30px; } .sr-banner .sr-row img[src$="rise.png"] { height: 20px; } .sr-banner .sr-row { gap: 6px 14px; } }
@media (min-width: 761px) and (max-height: 760px) { .sr-banner .sr-row img { height: 26px; } .sr-banner .sr-row img[src$="rise.png"] { height: 18px; } .sr-banner .sr-row { padding: 2px 0 6px; } }
/* โลโก้ย้ายออกจากหัวเรื่อง: หัวเรื่องเหลือ ข้อความ | ปุ่ม */
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top { grid-template-areas: "copy actions"; grid-template-columns: minmax(0, 1fr) auto; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-lede-main { font-weight: 600; color: var(--s-ink); font-size: 1.05rem; margin-bottom: 2px; }
@media (max-width: 760px) {
  html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top { grid-template-areas: "copy" "actions"; grid-template-columns: minmax(0, 1fr); }
}

/* กล่องคำตอบ: คำตอบรวมด้านบน แล้ว 7 กิจกรรม (คำตัดสิน + ค่าที่ตัดสิน + ที่มาเกณฑ์) */
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-left { align-self: start; margin-bottom: 0; }
/* คอลัมน์ขวา (ผลตรวจเนื้อปลา + เปิดแผนที่ 2 มิติ) ชิดขอบบน ไม่เลื่อนลงตามความสูงกล่องซ้าย (ผู้ใช้ 28 พ.ย. 2569) · จอแท็บเล็ต/มือถือใช้กฎของตัวเอง */
@media (min-width: 1025px) { html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-stage-right { align-self: start; margin-bottom: 0; } }
.ans-board h2.bp-fig { margin: 0; font-size: .74rem; }
.ans-place { margin: 0 0 6px; font: 400 .74rem/1.4 var(--f-head); color: var(--s-muted); }
.ans-overall { margin: 0 0 6px; padding: 6px 9px; border: 1px solid var(--s-line); background: var(--s-surface2); font: 400 .8rem/1.4 var(--f-head); color: var(--s-ink); }
.ans-overall p { margin: 0; font-size: .78rem; line-height: 1.35; }
.ans-overall p + p { margin-top: 3px; }
.ans-overall b { font-weight: 700; margin-right: 4px; }
.ans-list { list-style: none; margin: 0; padding: 0; }
.ans-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 8px; align-items: baseline; padding: 3px 0; border-top: 1px dashed var(--s-line); }
.ans-q { font: 600 .82rem/1.3 var(--f-head); color: var(--s-ink); }
.ans-a { font: 700 .82rem/1.3 var(--f-head); text-align: right; overflow-wrap: break-word; }
.ans-list > li:not(.ans-faq) { grid-template-columns: minmax(5em, 1fr) minmax(0, 1.65fr); }
/* เกณฑ์ v2 มีคำตัดสินยาว ("ใช้ได้ ควรพักน้ำให้ตกตะกอนก่อน"): คำตอบขึ้นบรรทัดใหม่ได้ ชื่อกิจกรรมไม่ถูกบีบ */
.ans-faq .ans-a { white-space: normal; text-align: right; }
/* FAQ: กดแถวกิจกรรมเพื่อเปิดดูค่าที่ผ่าน/ไม่ผ่าน (board.js .ans-faq) */
.ans-list li.ans-faq { display: block; padding: 0; }
.ans-faq > details > summary { display: grid; grid-template-columns: minmax(6.5em, 1fr) minmax(0, 1.4fr) 10px; gap: 0 8px; align-items: baseline; padding: 3px 0; cursor: pointer; list-style: none; }
.ans-faq > details > summary::-webkit-details-marker { display: none; }
.ans-faq > details > summary::after { content: ""; grid-column: 3; grid-row: 1; align-self: center; width: 6px; height: 6px; border-right: 2px solid var(--s-acc); border-bottom: 2px solid var(--s-acc); transform: rotate(45deg); transition: transform .15s; }
.ans-faq details[open] > summary::after { transform: rotate(-135deg); }
.ans-faq > details > summary:hover .ans-q { color: var(--s-acc); }
.ans-faq > details > summary:focus-visible { outline: 2px solid var(--s-acc); outline-offset: 2px; }
.ans-more { padding: 0 0 6px 2px; }
.ans-more .wc-checks { font: 400 .72rem/1.4 var(--f-head); margin-top: 0; }
.ans-more-note { margin: 4px 0 0; font: 400 .7rem/1.4 var(--f-head); color: var(--s-dim); }
.ans-more :is(.wc-turb, .wc-note, .wc-est, .wc-why) { font-family: var(--f-head); font-size: .72rem; }
@media (prefers-reduced-motion: reduce) { .ans-faq > details > summary::after { transition: none; } }
.ans-why { grid-column: 1 / -1; font: 400 .66rem/1.3 var(--f-head); color: var(--s-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* reason lines that carry advice (turbid water / wait for the province to confirm, 27 Nov 2569) must be readable in full */
.ans-why.ans-why--note { white-space: normal; overflow: visible; }
.ans-note { margin: 6px 0 0; padding-top: 6px; border-top: 1px dashed var(--s-line); font: 400 .68rem/1.4 var(--f-head); color: var(--s-muted); }
.ans-note b { color: var(--s-ink); }
html[data-theme="light"] .ans-board [data-level="ok"] > :is(b, .ans-a)   { color: #0f6b4a; }
html[data-theme="light"] .ans-board [data-level="warn"] > :is(b, .ans-a) { color: #8a5300; }
html[data-theme="light"] .ans-board [data-level="bad"] > :is(b, .ans-a)  { color: #b41824; }
html[data-theme="dark"] .ans-board [data-level="ok"] > :is(b, .ans-a)    { color: #7be0a0; }
html[data-theme="dark"] .ans-board [data-level="warn"] > :is(b, .ans-a)  { color: #f7c36a; }
html[data-theme="dark"] .ans-board [data-level="bad"] > :is(b, .ans-a)   { color: #ff8575; }
@media (min-width: 761px) and (max-height: 760px) { .ans-list li { padding: 2px 0; } .ans-why { font-size: .62rem; } }

@media (max-width: 760px) {
  html[data-theme] .home-gauge .header-inner { gap: 8px; padding-inline: 10px; }
  html[data-theme] .home-gauge .brand { flex: 1 1 auto; min-width: 0; white-space: normal; }
  .home-gauge .brand-text { min-width: 0; overflow-wrap: anywhere; }
  html[data-theme] .home-gauge .nav-toggle { flex: none; min-width: 44px; }
  html[data-theme] .home-gauge .ig-theme { width: 44px; height: 44px; }
  html[data-theme] .home-gauge .mo .qa-line-btn { min-height: 44px; }
  .home-gauge .ans-place, .home-gauge .ans-note, .home-gauge .qa-sub,
  .home-gauge .ans-why, .home-gauge .at-src { font-size: .9375rem; line-height: 1.5; white-space: normal; }
}
/* the 7-row board needs a little more width than the old cards */
@media (min-width: 1025px) { html[data-theme] .ig-page .mo-hero-grid.is-map-center { grid-template-columns: 262px minmax(0, 1fr) 236px; } }

/* เซ็นเซอร์ + Digital Twin ต่างจากเซ็นเซอร์ทั่วไป: สองช่องเทียบกัน ตัวใหญ่ อ่านง่าย */
.ig-why-twin .twin-vs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
.ig-why-twin .twin-col { padding: 20px 22px; border: 1px solid var(--s-line); border-radius: 0; }
.ig-why-twin .twin-col b { display: block; font: 700 1.25rem/1.3 var(--f-head); color: var(--s-ink); margin-bottom: 8px; }
.ig-why-twin .twin-col p { margin: 0; font: 400 1.08rem/1.6 var(--f-head); color: var(--s-muted); }
.ig-why-twin .twin-col strong { color: var(--s-ink); }
.ig-why-twin .twin-col.is-ours { border: 2px solid var(--s-acc); }
.ig-why-twin .twin-col.is-ours b { color: var(--s-acc); }
@media (max-width: 760px) { .ig-why-twin .twin-vs { grid-template-columns: 1fr; } }
/* ท้ายเว็บ: แถบโลโก้ภาคี/ผู้สนับสนุน */
.footer-partners { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--s-line); }
.footer-partners .sr-banner .sr-row { border-bottom: 0; padding: 6px 0; }
/* phone: the answer comes right after the heading, before the map */
@media (max-width: 760px) { html[data-theme] .ig-page .mo-hero-grid.is-map-center { grid-template-areas: "top" "below" "left" "world" "right"; } }
/* คำตอบรวมใต้แผนที่ (index.php .ans-overall--world): ตัวใหญ่กว่าในกล่องซ้าย อยู่ในคอลัมน์กลางใต้คำบรรยายแผนที่ */
html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ans-overall--world { grid-area: below; align-self: start; margin: 0; padding: 12px 16px; font-size: 1rem; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ans-overall--world p { font-size: 1rem; line-height: 1.55; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center > .ans-overall--world p + p { margin-top: 6px; }

/* ----- หัวเว็บ: โลโก้ อว. · RISE Fund · สกสว. · จ.เชียงราย ก่อนแบรนด์ AI-CARE (ประชุม 25 พ.ย. 2569, includes/header.php) ----- */
.hdr-partners { display: flex; align-items: center; gap: 10px; flex: none; padding-right: 0; margin-right: -3px; }   /* ช่องว่างถึงโลโก้ ม.นเรศวร = 13px เท่าช่องระหว่างโลโก้แบรนด์ (ผู้ใช้ 28 พ.ย. 2569) */
/* เส้นแบ่งหลัง สกสว. (ผู้ให้ทุน | หน่วยงานร่วม) แทนเส้นท้ายกลุ่มโลโก้ (ผู้ใช้ 28 พ.ย. 2569) */
.hdr-sep { flex: none; width: 1px; align-self: stretch; min-height: 30px; background: var(--s-line); margin: 0 2px; }
.hdr-partners img { height: 34px; width: auto; display: block; }
.hdr-partners img.is-wide { height: 22px; }
html[data-theme="dark"] .hdr-partners img { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
/* desktop with the full menu: a little smaller so the row fits in 1180 px */
@media (min-width: 1180px) and (max-width: 1365px) { .hdr-partners { gap: 8px; padding-right: 0; } .hdr-partners img { height: 30px; } .hdr-partners img.is-wide { height: 19px; } }
/* phones: the logos take their own row at the top of the header */
@media (max-width: 760px) {
  html[data-theme] .ig-page .header-inner { flex-wrap: wrap; gap: 0 8px; }
  .hdr-partners { order: -1; flex: 1 0 100%; justify-content: center; gap: 16px; padding: 6px 0; border-right: 0; border-bottom: 1px dashed var(--s-line); }
  .hdr-partners img { height: 28px; } .hdr-partners img.is-wide { height: 18px; }
  /* second row: brand shrinks so menu + theme button stay beside it on every page (wrap would push the button to a 3rd row) */
  html[data-theme] .ig-page .brand { flex: 1 1 0; min-width: 0; }
  html[data-theme] .ig-page .brand-text { min-width: 0; }
  html[data-theme] .ig-page .brand-text b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
.ig-logo-banner:empty { display: none; }

/* หน้าแม่น้ำกก / แม่น้ำสาย: รายละเอียดจุดที่แตะบนแผนที่ อยู่ใต้แผนที่ (assets/js/kok-river.js showMapInfo ← map/3d.js) */
.r-map-info { position: relative; margin: 10px 0 0; padding: 14px 44px 14px 16px; border: 1px solid var(--s-line); border-left: 3px solid var(--s-acc); background: var(--s-surface); color: var(--s-ink); }
.r-map-info[hidden] { display: none; }
.r-map-info-x { position: absolute; top: 6px; right: 6px; width: 36px; height: 36px; border: 0; background: none; color: var(--s-muted); font-size: 22px; line-height: 1; cursor: pointer; }
.r-map-info-x:hover { color: var(--s-acc); }
.r-map-info .pop-kind { display: block; font: 600 .74rem/1.4 var(--f-head); letter-spacing: .02em; color: var(--s-acc); }
.r-map-info .pop h3 { margin: 4px 0 6px; font: 600 1.05rem/1.35 var(--f-head); color: var(--s-ink); }
.r-map-info .pop p { margin: 0; font: 400 .88rem/1.7 var(--f-head); color: var(--s-muted); }
.r-map-info .pop b { color: var(--s-ink); }
.r-map-info .pop-verdicts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 2px 14px; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--s-line); font: 400 .86rem/1.5 var(--f-head); }
.r-map-info .pop-verdicts b { grid-column: 1 / -1; }
.r-map-info .pop-verdicts [data-lv] { font-weight: 600; }
html[data-theme="light"] .r-map-info [data-lv="ok"] { color: #0f6b4a; } html[data-theme="light"] .r-map-info [data-lv="warn"] { color: #8a5300; } html[data-theme="light"] .r-map-info [data-lv="bad"] { color: #b41824; }
html[data-theme="dark"] .r-map-info [data-lv="ok"] { color: #7be0a0; } html[data-theme="dark"] .r-map-info [data-lv="warn"] { color: #f7c36a; } html[data-theme="dark"] .r-map-info [data-lv="bad"] { color: #ff8575; }

/* ----- หน้าแนวทางการแก้ไข (solutions.php) ----- */
.sol-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
@media (max-width: 1024px) { .sol-cats { grid-template-columns: 1fr; } }
.sol-cat { display: flex; flex-direction: column; gap: 8px; }
.sol-cat .gl-h3 { margin-top: 6px; font-size: 1rem; }
.sol-goal { margin: 0; font-weight: 600; color: var(--s-acc); }
.sol-res { list-style: none; margin: 0; padding: 0; }
.sol-res li { display: grid; gap: 2px; padding: 8px 0 8px 12px; border-top: 1px dashed var(--s-line); border-left: 3px solid var(--s-line); }
.sol-res li b { font-weight: 600; color: var(--s-ink); }
.sol-res li span { font-size: .92rem; color: var(--s-muted); }
html[data-theme="light"] .sol-res li[data-level="ok"] { border-left-color: #0f6b4a; } html[data-theme="light"] .sol-res li[data-level="warn"] { border-left-color: #b47300; } html[data-theme="light"] .sol-res li[data-level="bad"] { border-left-color: #b41824; }
html[data-theme="dark"] .sol-res li[data-level="ok"] { border-left-color: #7be0a0; } html[data-theme="dark"] .sol-res li[data-level="warn"] { border-left-color: #f7c36a; } html[data-theme="dark"] .sol-res li[data-level="bad"] { border-left-color: #ff8575; }
.sol-sum, .sol-kok { margin: 0; font-size: .95rem; }
.sol-kok { margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--s-line); color: var(--s-muted); }
.sol-lessons { list-style: none; padding: 0; }
.sol-limits { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 24px; margin: 18px 0; }
.sol-limits dt { font-weight: 600; color: var(--s-ink); }
.sol-limits dd { margin: 4px 0 0; color: var(--s-muted); }
.sol-cat .gl-card-n { letter-spacing: .02em; } .sol-cat .gl-card-n i { font-style: normal; }

/* ----- หน้าใช้น้ำ กินปลาให้ปลอดภัย (health.php) ----- */
.hl-quick { list-style: none; padding: 0; }
.hl-quick li { border-left: 4px solid var(--s-line); }
.hl-a { margin: 4px 0 8px; font: 700 1.15rem/1.3 var(--f-head); }
html[data-theme="light"] .hl-quick [data-level="ok"] { border-left-color: #0f6b4a; } html[data-theme="light"] .hl-quick [data-level="ok"] .hl-a { color: #0f6b4a; }
html[data-theme="light"] .hl-quick [data-level="warn"] { border-left-color: #b47300; } html[data-theme="light"] .hl-quick [data-level="warn"] .hl-a { color: #8a5300; }
html[data-theme="light"] .hl-quick [data-level="bad"] { border-left-color: #b41824; } html[data-theme="light"] .hl-quick [data-level="bad"] .hl-a { color: #b41824; }
html[data-theme="dark"] .hl-quick [data-level="ok"] { border-left-color: #7be0a0; } html[data-theme="dark"] .hl-quick [data-level="ok"] .hl-a { color: #7be0a0; }
html[data-theme="dark"] .hl-quick [data-level="warn"] { border-left-color: #f7c36a; } html[data-theme="dark"] .hl-quick [data-level="warn"] .hl-a { color: #f7c36a; }
html[data-theme="dark"] .hl-quick [data-level="bad"] { border-left-color: #ff8575; } html[data-theme="dark"] .hl-quick [data-level="bad"] .hl-a { color: #ff8575; }
.hl-list { margin: 10px 0 0; padding-left: 1.2em; }
.hl-list li { margin: 6px 0; line-height: 1.65; }
.hl-src li { font-size: .92rem; color: var(--s-muted); }
.hl-ev-title { margin-top: 26px; }
.hl-ev { margin: 12px 0; padding: 0; list-style: none; counter-reset: ev; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.hl-ev li { counter-increment: ev; padding: 12px 14px; border: 1px solid var(--s-line); background: var(--s-surface); display: grid; gap: 4px; }
.hl-ev li::before { content: counter(ev); font: 700 1.3rem/1 var(--s-en); color: var(--s-acc); }
.hl-ev b { color: var(--s-ink); } .hl-ev span { font-size: .9rem; color: var(--s-muted); }
/* หน้าเอกสารอ้างอิง (references.php) */
.ref-list { margin: 14px 0 0; padding-left: 1.6em; }
.ref-list li { margin: 8px 0; line-height: 1.65; color: var(--s-ink); overflow-wrap: anywhere; }
.ref-list a { font-size: .9em; }

/* ตารางรายพื้นที่: ป้าย "น้ำดิบจากแม่น้ำโดยไม่ผ่านการบำบัด" ยาว ให้หัวคอลัมน์ขึ้นบรรทัดใหม่ได้ ไม่ตัดคำ */
html[data-theme] .at-table thead th { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.3; vertical-align: bottom; }

/* ----- แก้ตามผลตรวจของบอท 27 พ.ย. 2569 ----- */
/* เมนูมือถือ: หัวเว็บสูงขึ้นจากแถวโลโก้ (87px) แผงเมนูต้องเริ่มใต้หัวเว็บ ไม่ใช่ 64px ตายตัว (style.css) */
@media (max-width: 1179px) { html[data-theme] .ig-page .site-nav { top: 100%; } }
html[data-theme] .ig-page .header-inner { position: relative; }
/* มือถือ หน้าแม่น้ำกก/สาย: กล่อง "ค่าที่ดูบนกราฟ" ชิดซ้าย ไม่ซ้อนใต้ปุ่มมุมจอ (corner-nav) */
@media (max-width: 640px) {
  html[data-theme] .gl-river .r-param-dock { left: 12px; right: auto; translate: none; transform: none; max-width: calc(100vw - 190px); }
  html[data-theme] .gl-river .r-param-dock > span, html[data-theme] .gl-river .r-param-dock label > span { display: none; }
  html[data-theme] .gl-river .r-param-dock select { max-width: 100%; }
}

/* หน้าแรก: การ์ดผลวิจัย 4 ใบแสดงในชั้นการ์ดของ hero แล้ว (glass-scroll.js) ส่วน #known จึงไม่แสดงซ้ำ */
#known.has-shelf .facts { display: none; }
#known.has-shelf .why { margin-top: 8px; border-top: 0; padding-top: 0; }

/* หน้าแรก: ระหว่างรอแบบจำลอง 3 มิติ (โหลดเมื่อช่องแผนที่เข้าจอ) บอกผู้ใช้ว่ากำลังโหลด */
html.will-3d body:not(.kok3d-on) .ig-world::before { content: "กำลังโหลดแผนที่ 3 มิติ…"; position: absolute; inset: 0; display: grid; place-items: center; font: 400 .9rem var(--f-head); color: var(--s-muted); pointer-events: none; }

/* หน้าแม่น้ำกก มือถือ: กราฟค่าตามเวลามีคำอธิบายหลายบรรทัด (แบบจำลอง / ค่าตอนนี้ / คพ.) ให้กล่องสูงพอ */
@media (max-width: 640px) { html[data-theme] .gl-river #part-2 .r-chart-box, html[data-theme] .gl-river #part-3 .r-chart-box { height: 400px; } }

/* ----- หน้าแรกแบบหน้าสรุป 3 เรื่อง: น้ำ · ปลา · พืช (ประชุม 28 พ.ย. 2569 · index.php .hub-*) ----- */
html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top.hub-top { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "copy logos" "banners banners" "head head"; gap: 14px 24px; align-items: end; }
.hub-logos { grid-area: logos; display: flex; align-items: center; gap: 10px; margin: 0; font: 500 .82rem/1 var(--f-head); color: var(--s-muted); }
.hub-logos img { width: 44px; height: 44px; object-fit: contain; }
html[data-theme="dark"] .hub-logos img { filter: drop-shadow(0 0 .6px #fff) drop-shadow(0 0 .6px #fff); }
@media (max-width: 900px) { html[data-theme] .ig-page .mo-hero-grid.is-map-center .ig-hero-top.hub-top { grid-template-columns: minmax(0, 1fr); grid-template-areas: "copy" "logos" "banners" "head"; gap: 12px 0; } .hub-logos img { width: 38px; height: 38px; } }
.hub-top > .mo-hero-copy { grid-area: copy; }
html[data-theme] .ig-page .mo-hero-grid.is-map-center .hub-title { font-size: clamp(1.75rem, 3vw, 2.7rem); white-space: normal; }
.hub-banners { grid-area: banners; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.hub-banner { display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--s-line); border-top: 4px solid var(--hub-c, var(--s-acc)); background: var(--s-surface); }
.hub-banner[data-k="water"] { --hub-c: #1d6fa5; } .hub-banner[data-k="fish"] { --hub-c: #0f766e; } .hub-banner[data-k="crop"] { --hub-c: #6b7d12; }
html[data-theme="dark"] .hub-banner[data-k="water"] { --hub-c: #5fb4e6; } html[data-theme="dark"] .hub-banner[data-k="fish"] { --hub-c: #4fd1c0; } html[data-theme="dark"] .hub-banner[data-k="crop"] { --hub-c: #c2d44e; }
html[data-theme] .ig-page .hub-main { flex: 1; display: grid; align-content: start; gap: 4px; padding: 14px 16px 12px; text-decoration: none; color: var(--s-ink); }
.hub-no { font: 700 13px/1 var(--s-en); letter-spacing: .12em; color: var(--hub-c, var(--s-acc)); }
html[data-theme] .ig-page .hub-main b { font: 600 1.14rem/1.3 var(--f-head); color: var(--s-ink); }
.hub-desc { font: 400 .88rem/1.45 var(--f-head); color: var(--s-muted); }
.hub-go { margin-top: 6px; font: 600 .92rem/1.2 var(--f-head); color: var(--s-acc); }
html[data-theme] .ig-page .hub-main:hover b { color: var(--s-acc); }
html[data-theme] .ig-page .hub-short { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 16px; border-top: 1px dashed var(--s-line); font: 600 .88rem/1.2 var(--f-head); color: var(--s-ink); text-decoration: none; }
.hub-short:hover { background: var(--s-acc-soft); color: var(--s-acc); }
.hub-main:focus-visible, .hub-short:focus-visible { outline: 2px solid var(--s-acc); outline-offset: -2px; }
.hub-head { grid-area: head; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 18px; padding-top: 8px; scroll-margin-top: 92px; }
.hub-h2 { margin: 0; font: 600 clamp(1.4rem, 2.4vw, 1.95rem)/1.25 var(--f-head); color: var(--s-ink); }
.hub-clock { margin: 0; font: 500 .95rem/1.4 var(--f-head); color: var(--s-muted); font-variant-numeric: tabular-nums; }
.hub-clock a { color: var(--s-acc); }
.hub-sec { scroll-margin-top: 76px; }
.hub-sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 14px; }
.hub-sec-lede { margin: 6px 0 0; max-width: 72ch; font: 400 1rem/1.55 var(--f-head); color: var(--s-muted); }
.hub-frame { display: block; width: 100%; height: 560px; border: 0; background: transparent; }
@media (max-width: 760px) {
  .hub-banners { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .hub-main { padding: 12px 14px 10px; } .hub-short { padding: 8px 14px; }
  .hub-sec-head .btn { width: 100%; justify-content: center; }
}

/* กล่องเข้าสู่ระบบแทนแผนที่ปลา/พืช (includes/member-login.php · ผู้ใช้ 28 พ.ย. 2569) */
.ml-page { display: grid; place-items: center; min-height: calc(100dvh - var(--head, 96px) - 120px); padding: 32px 16px; }
.ml-box { display: grid; place-items: center; padding: 32px 16px; border: 1px solid var(--s-line); background: var(--s-surface2); }
.ml-form { display: grid; gap: 12px; width: 100%; max-width: 360px; padding: 24px; border: 1px solid var(--s-line); background: var(--s-surface); color: var(--s-ink); }
.ml-title { display: flex; align-items: center; gap: 8px; margin: 0; font: 700 1.1rem/1.35 var(--f-head); color: var(--s-ink); }
.ml-title svg { flex: none; color: var(--s-acc); }
.ml-lede { margin: 0 0 4px; color: var(--s-muted); font-size: .95rem; }
.ml-form label { display: grid; gap: 4px; font-size: .95rem; color: var(--s-ink2); }
.ml-form input { min-height: 44px; padding: 8px 10px; border: 1px solid var(--s-line-strong); border-radius: 0; background: var(--s-surface); color: var(--s-ink); font: inherit; }
.ml-form input:focus-visible { outline: 2px solid var(--s-acc); outline-offset: 1px; }
.ml-form .btn { justify-content: center; min-height: 44px; }
.ml-form button:disabled { opacity: .6; cursor: wait; }
.ml-msg { margin: 0; min-height: 1.4em; color: var(--s-acc2); font-size: .95rem; }

/* ปุ่มดึงค่าเซนเซอร์ล่าสุด ต่อท้ายบรรทัดเวลาข้อมูล (kok-river.js · ผู้ใช้ 29 พ.ย. 2569) หน้าแม่น้ำกกและแม่น้ำสาย */
.kr-refresh { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; margin: 8px 8px 0 0; padding: 6px 12px; border: 1px solid var(--s-line-strong); border-radius: 0; background: var(--s-surface); color: var(--s-acc); font: 600 .85rem/1.2 var(--f-head); cursor: pointer; }
.kr-refresh:hover { background: var(--s-acc-soft); }
.kr-refresh:focus-visible { outline: 2px solid var(--s-acc); outline-offset: 2px; }
.kr-refresh:disabled { opacity: .65; cursor: wait; }
.kr-refresh-msg { display: inline-block; margin-top: 8px; font: 400 .85rem/1.3 var(--f-head); color: var(--s-muted); }

/* ตัวเลือกพื้นที่ในกล่องคำตอบหน้าแรก (index.php #ans-area · ประชุม 28 พ.ย. 2569) */
.ans-pick { display: grid; gap: 3px; margin: 6px 0 4px; font: 600 .74rem/1.3 var(--f-head); color: var(--s-muted); }
.ans-pick select { min-height: 40px; padding: 6px 8px; border: 1px solid var(--s-line-strong); border-radius: 0; background: var(--s-surface); color: var(--s-ink); font: 500 .9rem/1.3 var(--f-head); }
.ans-pick select:focus-visible { outline: 2px solid var(--s-acc); outline-offset: 1px; }
/* ปุ่ม ＋ ที่มาของเกณฑ์: ให้เห็นชัด (อาจารย์ ประชุมเชียงราย 28 พ.ย. 2569: "ใส่ตัวบวกให้กดออกมาได้ ใหญ่ ๆ เลย") */
.wc-why > summary { display: flex !important; align-items: center; gap: 6px; min-height: 36px !important; padding: 4px 10px; border: 1px solid var(--s-line-strong); background: var(--s-surface); color: var(--s-acc); font-size: 1.05em; }
.wc-why > summary::before { font-size: 1.35em; font-weight: 700; line-height: 1; }
.wc-why > summary:hover { background: var(--s-acc-soft); }
.wc-why > summary:focus-visible { outline: 2px solid var(--s-acc); outline-offset: 1px; }
.wc-why[open] > summary { margin-bottom: 6px; }

/* ท้ายเว็บ (ผู้ใช้ 29 พ.ย. 2569: ตัวหนังสือไม่สมมาตรกับส่วนอื่น): กว้างและขอบซ้ายขวาเท่าเนื้อหา (.mo-wrap) · ขนาดตัวหนังสือชุดเดียว · เมนูแยกหมวดเหมือนเมนูบน */
html[data-theme] .ig-page .site-footer { padding: 36px 0 20px; font: 400 .95rem/1.6 var(--f-head); }
html[data-theme] .ig-page .site-footer .container { width: min(1132px, 100% - 48px); }
html[data-theme] .ig-page .footer-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 2.6fr) minmax(0, 1.15fr); gap: 28px 40px; align-items: start; }
html[data-theme] .ig-page .footer-grid strong { display: block; margin: 0 0 8px; font: 600 1rem/1.4 var(--f-head); color: var(--s-ink); }
html[data-theme] .ig-page .site-footer p { margin: 0 0 8px; font-size: inherit; line-height: 1.6; }
html[data-theme] .ig-page .site-footer ul { columns: auto; margin: 0; display: grid; gap: 4px; }
html[data-theme] .ig-page .site-footer li a { display: inline-block; padding: 2px 0; font-size: inherit; line-height: 1.45; }
.footer-menu { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px 28px; align-items: start; }
@media (min-width: 1100px) { .footer-menu { grid-template-columns: .8fr 1.5fr 1.1fr .9fr; } html[data-theme] .ig-page .footer-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 3fr) minmax(0, 1.1fr); gap: 28px 36px; } }
html[data-theme] .ig-page .site-footer ul.footer-menu-flat { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 20px; }
.footer-partners:not(:has(*)) { display: none; }
html[data-theme] .ig-page .footer-bottom { margin-top: 22px; padding-top: 14px; font-size: .85rem; }
html[data-theme] .ig-page .site-footer .visitor-counter { margin-top: 14px; padding-top: 14px; border-top-color: var(--s-line); font-size: .9rem; color: var(--s-muted); }
@media (max-width: 900px) { html[data-theme] .ig-page .footer-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { html[data-theme] .ig-page .site-footer .container { width: calc(100% - 32px); } .footer-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* หน้าแรก: ที่ว่าง 104px ใต้ท้ายเว็บเคยเว้นไว้ให้แถบลอยด้านล่างของเทมเพลตเดิม (glass.css .ig-page) ซึ่งหน้านี้ไม่มีแล้ว (ผู้ใช้ 29 พ.ย. 2569) */
html[data-theme] body.ig-page.home-gauge { padding-bottom: 0; }
