/* hatyai.css — ส่วนเพิ่มของชุดหน้าน้ำท่วมหาดใหญ่ (hatyai.html · hatyai-data.html · hatyai-source.html)
   ต่อจาก ../../css/style.css → ../../css/floodmap.css → usecases.css · เพิ่มเฉพาะคลาส hy-* กับป้าย uc-tag-* ชุดใหม่
   ส่วนที่ปรับของเดิมอยู่ใต้ .hy-page เท่านั้น · สี/ความกว้างจากข้อมูลตั้งผ่าน data-w / data-bg / data-flex (HY.U.paint) ไม่ใช้ style ในแท็ก */
.hy-page :focus-visible{outline:3px solid var(--oran);outline-offset:2px}
.hy-page .fm-map:focus-visible,.hy-tbl :focus-visible{outline-offset:-3px}
.hy-page .uc-alert{margin-left:var(--g);margin-right:var(--g)}
.hy-page .fm-jump,.hy-seg,.hy-subnav{flex-wrap:wrap;border-radius:21px}
.hy-page .fm-table{border:0}
.hy-page [data-sel]{cursor:pointer}
.hy-page .fm-intro h1{font-size:clamp(30px,3.5vw,54px)}
.hy-page .uc-groups button:disabled{opacity:.45;cursor:default;background:none}
.hy-page code{font-family:ui-monospace,Consolas,monospace;font-size:.92em}
.hy-sec a:not([class]),.hy-card a:not([class]),.hy-cap a{color:var(--blue);border-bottom:1px solid currentColor}

/* ----- ป้ายที่มาของตัวเลข (ต่อจาก uc-tag-real / uc-tag-sim) · เส้นประ = ไม่ได้วัดตรง ----- */
.hy-page .uc-tag{display:inline-block;vertical-align:middle}
.uc-tag-calc{background:#e3f4f1;color:#0b6e5f}
.uc-tag-est{background:#fff0e3;color:#b25400;border:1px dashed #f0a566}
.uc-tag-infer{background:#f3eefc;color:#5b3aa8;border:1px dashed #b9a2e6}
.uc-tag-stage{background:#f3f5f9;color:#34465f;border:1px dashed #c3ccd9}
.hy-c-sim{color:#b25400}
.hy-c-infer{color:#5b3aa8}
.hy-c-muted{color:var(--muted)}
.hy-nd{display:inline-block;padding:0 8px;border:1px dashed #c3ccd9;border-radius:999px;font:400 11.5px/1.7 Anuphan,sans-serif;color:var(--muted)}

/* ----- แถบนำทางระหว่างหน้าในชุด (แทนเมนูบนที่ซ่อนเมื่อจอแคบ) ----- */
.hy-subnav{display:flex;width:fit-content;margin:0 var(--g)}
.hy-subnav a{display:inline-flex;align-items:center;min-height:34px;padding:0 15px;border-radius:999px;font-size:13px;color:var(--ink2);white-space:nowrap}
.hy-subnav a:hover{background:var(--soft)}
.hy-subnav a.on{background:var(--navy);color:#fff}

/* ----- คำบรรยายใต้แผนที่ · การ์ดฉากถัดไป ----- */
.hy-cap{margin:10px 0 0;padding:8px 14px;min-height:40px;border-radius:10px;background:var(--soft);font-size:14px;line-height:1.7;color:var(--ink2)}
.hy-cap:empty{background:none}
.hy-cap b{color:var(--navy);font-weight:600}
.hy-cap.cav{background:#fff6ea;color:#7a4a12}
.hy-next{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:40px;margin:10px 0 0;padding:8px 14px;border:1px solid var(--line);border-left:3px solid var(--gc);border-radius:0 12px 12px 0;font-size:14px;font-weight:600;color:var(--navy)}
.hy-next:hover{background:var(--soft)}
.hy-next small{margin-right:6px;font-size:12.5px;font-weight:400;color:var(--muted)}

/* ----- การ์ดของชุมชน/ตำบล/ผืนน้ำที่เลือก ----- */
.hy-card{min-width:0;margin:0 0 14px;padding:14px 16px;border:1px solid var(--line);border-radius:12px;font-size:13px;line-height:1.6;color:var(--ink2)}
.hy-card h3{margin:0;font-size:16px;font-weight:600;line-height:1.45;color:var(--navy)}
.hy-card h4{margin:12px 0 4px;font:700 12px Anuphan,sans-serif;letter-spacing:.3px;color:var(--muted)}
.hy-sub{margin:0;font-size:12.5px;color:var(--muted)}
.hy-empty{margin:0;font-size:13.5px;color:var(--muted)}
.hy-kv{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 12px;margin:0;font-size:12.5px}
.hy-kv dt{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;min-width:0}
.hy-kv dd{margin:0;text-align:right;font:600 12.5px Anuphan,sans-serif;color:var(--navy)}
.hy-kv .hy-bar{grid-column:1/-1;width:100%;height:4px;margin:0}
.hy-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:12px}

/* ----- ช่องค้นหาชุมชน ----- */
.hy-search{position:relative;flex:1 1 220px;min-width:0;max-width:340px}
.hy-search::before{content:"";position:absolute;left:13px;top:50%;width:9px;height:9px;margin-top:-8px;border:2px solid var(--muted);border-radius:50%;pointer-events:none}
.hy-search::after{content:"";position:absolute;left:23px;top:50%;width:7px;height:2px;margin-top:5px;background:var(--muted);transform:rotate(45deg);pointer-events:none}
.hy-search input{width:100%;min-height:36px;padding:6px 14px 6px 38px;border:1px solid var(--line);border-radius:999px;background:#fff;font:inherit;font-size:14px;color:var(--navy);-webkit-appearance:none;appearance:none}
.hy-search input::placeholder{color:var(--muted)}
.hy-search input:focus-visible{outline-offset:1px}
.hy-hits{position:absolute;left:0;top:calc(100% + 4px);z-index:1100;width:max(100%,280px);max-width:88vw;max-height:300px;overflow:auto;margin:0;padding:4px;list-style:none;background:#fff;border:1px solid var(--line);border-radius:12px}
.hy-hits button,.hy-hits [role=option]{display:block;width:100%;min-height:34px;padding:6px 10px;border:0;border-radius:8px;background:none;text-align:left;font-size:13px;line-height:1.5;color:var(--ink2);cursor:pointer}
.hy-hits button:hover,.hy-hits [role=option]:hover,.hy-hits .on,.hy-hits [aria-selected=true]{background:var(--soft);color:var(--navy)}
.hy-hits small,.hy-btn small,.hy-rk small{color:var(--muted)}
.hy-count{font-size:12px;color:var(--muted)}

/* ----- ชิปตัวกรอง/สลับชั้นข้อมูล · ปุ่มเม็ดยา · ตัวเลือกแบบแบ่งส่วนที่ตัดบรรทัดได้ ----- */
.hy-chips,.hy-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.hy-tools{gap:8px 12px;margin:0 0 10px}
.hy-chip,.hy-btn{display:inline-flex;align-items:center;gap:6px;min-height:34px;padding:4px 12px;border:1px solid var(--line);border-radius:999px;background:#fff;font-size:12.5px;line-height:1.4;color:var(--ink2);white-space:nowrap}
button.hy-chip,.hy-btn{cursor:pointer}
button.hy-chip:hover{border-color:var(--navy)}
.hy-chip.on,.hy-chip[aria-pressed=true],.hy-btn.pri{background:var(--navy);border-color:var(--navy);color:#fff}
span.hy-chip{min-height:0}
.hy-chip b{font:600 12.5px Anuphan,sans-serif}
.hy-btn{padding:6px 14px;font-size:13px}
.hy-btn:hover{background:var(--soft)}
.hy-btn.pri:hover{background:#17376a}
.hy-btn.pri small{color:#cbd8e9}
.hy-seg button{min-height:34px}
.hy-lab{display:block;margin-bottom:4px;font-size:13px;color:var(--ink2)}

/* ----- แถบจัดอันดับ (HY.U.rowsRank) · แถบในเซลล์ · ตารางย่อ ----- */
.hy-page .rd-row s,.hy-bar s{width:0}
.hy-rank{gap:0}
.hy-rk{grid-template-columns:22px minmax(0,40%) 1fr 78px;width:100%;min-height:27px}
.hy-rk>b{font:700 11px Anuphan,sans-serif;text-align:right;color:var(--muted)}
button.hy-rk{min-height:34px;padding:0;border:0;background:none;text-align:left;cursor:pointer}
button.hy-rk:hover i{color:var(--navy);text-decoration:underline}
.hy-rk.cur{border-radius:6px;background:var(--soft)}
.hy-rk.cur i,.hy-rk.cur em{font-weight:700;color:var(--navy)}
.hy-bar{display:inline-block;width:54px;height:9px;margin-right:8px;border-radius:5px;background:#eef1f6;overflow:hidden;vertical-align:middle}
.hy-bar s{display:block;height:100%;border-radius:5px;background:var(--navy)}
.hy-tw{overflow-x:auto}
.hy-page .rd-tbl .l{text-align:left;white-space:normal}
.hy-page .rd-tbl .sum td{border-top:1px solid var(--line);font-weight:600;color:var(--navy)}
.hy-page .rd-tbl .cur td{background:var(--soft)}
.hy-page tr[data-sel]>*{height:34px}

/* ----- กราฟ SVG และสัญลักษณ์ (hy-charts.js) ----- */
.hy-sw{flex:none;vertical-align:-2px}
.hy-hatch{display:inline-block;width:14px;height:14px;border:1px dashed #c3ccd9;border-radius:4px;background:repeating-linear-gradient(45deg,#aeb9cc 0 1.5px,transparent 1.5px 4.5px);vertical-align:-2px}
.hy-page .lg-sw{display:inline-flex;align-items:center;gap:7px}
.hy-keys{display:flex;flex-wrap:wrap;gap:4px 14px;margin-top:6px;font-size:12px}
.hy-page .uc-read .fm-stack,.hy-page .uc-read .fm-chart{margin-top:8px}
.rd-spark .hy-tl{font-size:10.5px;fill:var(--ink2)}
.rd-spark .hy-tn{fill:var(--navy);font-weight:700}
.rd-spark .hy-to{fill:#b25400;font-weight:700}
.rd-spark .hy-tb{fill:#c7371f}

/* ----- ตารางครบทุกแถว: หัวตารางและคอลัมน์แรกค้างขณะเลื่อน ----- */
.hy-tbl-wrap{max-height:clamp(360px,60vh,640px);overflow:auto;border:1px solid var(--line);border-radius:10px}
.hy-tbl{width:100%;border-collapse:separate;border-spacing:0;font-size:12.5px}
.hy-tbl th,.hy-tbl td{height:36px;padding:5px 10px;border-bottom:1px solid #edf0f5;background:#fff;text-align:left;white-space:nowrap}
.hy-tbl .num{text-align:right;font-family:Anuphan,sans-serif;font-variant-numeric:tabular-nums}
.hy-tbl .wrap{white-space:normal;min-width:220px}
.hy-tbl thead th{position:sticky;top:0;z-index:2;font-weight:600;color:var(--navy);box-shadow:0 1px 0 var(--line)}
.hy-tbl th button{display:inline-flex;align-items:center;gap:4px;width:calc(100% + 20px);min-height:36px;margin:-5px -10px;padding:5px 10px;border:0;background:none;font-weight:600;white-space:nowrap;cursor:pointer}
.hy-tbl th.num button{justify-content:flex-end}
.hy-tbl th button::after{content:"▾";font-size:10px;color:#c3ccd9}
.hy-tbl th[aria-sort=ascending] button::after{content:"▴";color:var(--navy)}
.hy-tbl th[aria-sort=descending] button::after{color:var(--navy)}
.hy-tbl th:first-child,.hy-tbl td:first-child{position:sticky;left:0;z-index:1;max-width:min(52vw,280px);overflow:hidden;text-overflow:ellipsis;box-shadow:1px 0 0 var(--line)}
.hy-tbl thead th:first-child{z-index:3;box-shadow:1px 0 0 var(--line),0 1px 0 var(--line)}
.hy-tbl tr[tabindex]{cursor:pointer}
.hy-tbl tbody tr:hover>*,.hy-tbl tr.on>*{background:var(--soft)}
.hy-tbl tr.on>*{font-weight:600;color:var(--navy)}
.hy-tbl tr.on>:first-child{box-shadow:inset 3px 0 0 var(--gc),1px 0 0 var(--line)}
.hy-tbl tfoot td{position:sticky;bottom:0;z-index:2;border-top:1px solid var(--line);border-bottom:0;background:#f1f5fa;font-weight:600;color:var(--navy)}
.hy-ok{color:#1b5e20}
.hy-warn{color:#b25400}
.hy-bad{font-weight:600;color:#a52714}

/* ----- หน้าตาราง: แผนที่ซ้าย ตารางขวา ----- */
.hy-browser{grid-template-columns:minmax(300px,38%) minmax(0,1fr)}
.hy-browser>*{min-width:0}
.hy-browser .fm-mapwrap{height:clamp(320px,46vh,520px)}
.hy-browser .fm-panel{display:block}
.hy-browser .fm-tabs{grid-template-columns:repeat(5,1fr)}

/* ----- ส่วนเนื้อหาของหน้าตารางและหน้าที่มา ----- */
.hy-sec{margin-top:26px;padding:44px var(--g) 30px;border-top:1px solid var(--line)}
.hy-sec>h2{margin:0 0 8px}
.hy-sec>p{max-width:820px;margin:0 0 20px;font-size:14.5px;color:var(--ink2)}
.hy-sec h3{margin:26px 0 10px;font-size:18px;font-weight:600}
.hy-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px 24px}
.hy-grid>*{min-width:0;margin:0}
.hy-steps{margin:0;padding:0 0 0 16px;list-style:none;border-left:2px solid var(--line);font-size:13.5px;color:var(--ink2)}
.hy-steps li{position:relative;padding:0 0 14px 6px;line-height:1.65}
.hy-steps li::before{content:"";position:absolute;left:-22px;top:.5em;width:6px;height:6px;border:2px solid var(--blue);border-radius:50%;background:#fff}
.hy-steps b{display:block;font:600 12px Anuphan,sans-serif;color:var(--muted)}
.hy-code{display:block;padding:10px 14px;border-radius:10px;background:var(--soft);font:12.5px/1.7 ui-monospace,Consolas,monospace;color:var(--navy);white-space:pre;overflow:auto}

/* ----- จอกว้าง: คอลัมน์แผนที่ของหน้าตารางค้างบนจอและเลื่อนภายในได้ ----- */
@media(min-width:1181px){
  .hy-browser>:first-child{position:sticky;top:12px;max-height:calc(100vh - 24px);margin:-5px;padding:5px;overflow:auto}
}
@media(max-width:1180px){
  .hy-browser{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:650px){
  .hy-subnav{margin:0 5%}
  .hy-cap{min-height:64px}
  .hy-page .uc-alert{margin-left:5%;margin-right:5%}
  .hy-sec{padding-left:5%;padding-right:5%}
  .hy-grid{grid-template-columns:minmax(0,1fr)}
  .hy-search{flex-basis:100%;max-width:none}
  .hy-browser .fm-tabs{grid-template-columns:repeat(3,1fr)}
  .hy-browser .fm-mapwrap{height:clamp(280px,44vh,420px)}
}
/* การเคลื่อนไหวของ CSS มีเฉพาะเมื่อผู้ใช้ไม่ได้ขอลดการเคลื่อนไหว */
@media(prefers-reduced-motion:no-preference){
  .hy-next,.hy-chip,.hy-btn,.hy-subnav a,.hy-hits button{transition:background-color .15s,border-color .15s,color .15s}
}
/* ===== [scenes] กฎเพิ่มของฉาก 02–21 — เพิ่มใต้บรรทัดนี้เท่านั้น ===== */
.hy-page .uc-read .hy-sh{margin:12px 0 4px;font:700 12px Anuphan,sans-serif;letter-spacing:.3px;color:var(--muted)}
/* ===== [data-page] กฎเพิ่มของหน้า hatyai-data.html — เพิ่มใต้บรรทัดนี้เท่านั้น ===== */
.hy-page .hy-browser{--gc:var(--oran)}
.hy-page .hy-lay{margin-bottom:10px}
.hy-page .hy-browser .hy-card{margin:14px 0 0}
.hy-page .hy-browser .fm-legend{min-height:0}
.hy-page .hy-tbl-wrap{scroll-padding:48px 0 40px}
.hy-page .hy-h{display:block;line-height:1.35;text-align:left}
.hy-page .hy-tbl th.num .hy-h{text-align:right}
.hy-page .hy-h small{display:block;max-width:168px;overflow:hidden;text-overflow:ellipsis;font-size:11px;font-weight:400;color:var(--muted)}
.hy-page .hy-h .uc-tag,.hy-page .hy-kv .uc-tag{margin-left:4px;padding:2px 6px;font-size:10px}
.hy-page .hy-tbl tbody th{font-weight:500}
.hy-page .hy-tbl tfoot small{font-weight:400;color:var(--muted)}
.hy-page .hy-tbl tfoot td:first-child{z-index:3}
.hy-page .hy-tbl td .hy-bar{width:40px}
.hy-page .hy-tbl tr:focus-visible>*{background:var(--soft);box-shadow:inset 0 2px 0 var(--oran),inset 0 -2px 0 var(--oran)}
.hy-page .hy-kv dt span:not(.uc-tag){color:var(--muted)}
.hy-page .hy-browser .hy-kv{grid-template-columns:minmax(40%,1fr) auto}
.hy-page .hy-kv .w{grid-column:1/-1;text-align:left}
.hy-page .hy-grp summary{margin:12px 0 4px;cursor:pointer}
.hy-page .hy-grp h4{display:inline;margin:0}
.hy-page .hy-grp small{font-weight:400}
.hy-page .hy-foot{margin-top:8px}
.hy-page .hy-fig h3{margin:0;font-size:15px}
.hy-page .hy-dl{margin:0 0 14px;padding-left:18px;font-size:14px;line-height:1.9;color:var(--ink2)}
/* ===== [source-page] กฎเพิ่มของหน้า hatyai-source.html — เพิ่มใต้บรรทัดนี้เท่านั้น ===== */
/* หน้าที่มา: แถบสถานะและสารบัญ · การ์ดชั้นข้อมูล (สองคอลัมน์เมื่อการ์ดกว้างพอ) · ตารางเต็มความสูง · ขั้นตอนที่ทำด้วยมือ (จุดสีส้ม) · คำสั่งยาวตัดบรรทัดได้ */
.hy-page .hy-src-load{margin:0 var(--g);padding:10px 14px;border-radius:10px;background:var(--soft);font-size:14px;color:var(--ink2)}
.hy-page .hy-src-toc{margin:14px var(--g) 0}
.hy-page .hy-src-note{max-width:820px;margin:8px 0 0;font-size:12.5px;color:var(--muted)}
.hy-page .hy-sec h3 small,.hy-page .hy-src-sub h4 small,.hy-page .hy-src-u,.hy-page .hy-src-chips small{font-size:12.5px;font-weight:400;color:var(--muted)}
.hy-page .hy-src-u{display:block}
.hy-page .hy-src-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 24px;align-items:start}
.hy-page .hy-src-grid>*{margin:0}
.hy-page .hy-src-card h3{margin:0;font-size:16px}
.hy-page .hy-src-card .hy-kv,.hy-page .hy-src-card .hy-tw,.hy-page .hy-src-sub .hy-kv{max-width:480px}
.hy-page .hy-src-card dd,.hy-page .hy-src-path,.hy-page .hy-src-cmd,.hy-page .hy-src-txt{overflow-wrap:anywhere}
.hy-page .hy-src-path{margin:6px 0 0;color:var(--navy)}
.hy-page .hy-src-card .hy-kv+.hy-sub,.hy-page .hy-src-card .hy-sub+.hy-sub,.hy-page .hy-src-card .hy-tw+.hy-sub{margin-top:6px}
.hy-page .hy-src-sub{max-width:900px;margin:0 0 18px}
.hy-page .hy-src-sub h4{margin:20px 0 4px;font-size:14.5px;font-weight:600}
.hy-page .hy-src-sub>p:not([class]){margin:14px 0 6px;font-size:14.5px;color:var(--ink2)}
.hy-page .hy-src-sub th{white-space:normal}
.hy-page .hy-src-mx{max-width:520px}
.hy-page .hy-src-lin .hy-steps,.hy-page .hy-src-lin .uc-cav{max-width:980px}
.hy-page .hy-src-full{max-height:none}
.hy-page .hy-src-t tbody th{font-weight:400}
.hy-page .hy-src-in{white-space:normal;min-width:130px}
.hy-page .hy-src-chips{margin-bottom:14px}
.hy-page .hy-src-chips .hy-chip{white-space:normal;border-radius:12px}
.hy-page .hy-src-th,.hy-page .hy-src-txt,.hy-page .hy-src-cmd{display:block}
.hy-page .hy-src-cmd{margin-top:3px;padding:6px 10px;border-radius:8px;background:var(--soft);font-size:12px;line-height:1.6;white-space:pre-wrap;color:var(--navy)}
.hy-page .hy-src-hand::before{border-color:#b25400;background:#fff0e3}
@media(min-width:1181px),(min-width:700px) and (max-width:900px){
  .hy-page .hy-src-two{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:0 24px;align-items:start}
}
@media(min-width:1181px){
  .hy-page .hy-src-cols{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 32px;align-items:start;max-width:none}
}
@media(max-width:900px){
  .hy-page .hy-src-grid{grid-template-columns:minmax(0,1fr)}
}
@media(max-width:650px){
  .hy-page .hy-src-load,.hy-page .hy-src-toc{margin-left:5%;margin-right:5%}
}
