
:root{
  color-scheme:light;
  --ground:#F1F4F3; --surface:#FFFFFF; --surface-2:#F7FAF9; --raised:#FFFFFF;
  --ink:#111A19; --ink-soft:#4E5C59; --ink-faint:#647370;
  --line:#DCE3E0; --line-soft:#EAF0ED;
  --accent:#0E5F5A; --accent-ink:#0A4642; --accent-soft:#DDEFEB; --accent-glow:rgba(14,95,90,.16);
  --ok:#136B45; --ok-bg:#DFF1E7;
  --mod:#8A5A05; --mod-bg:#FBF0DA;
  --hi:#A8420C; --hi-bg:#FCE9DE;
  --sev:#A32218; --sev-bg:#FBE5E2;
  --sans:"Noto Sans Thai","Sarabun","Leelawadee UI","Thonburi",-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
  --mono:ui-monospace,"Cascadia Mono","SF Mono",Consolas,"DejaVu Sans Mono",monospace;
  --r:14px;
  --shadow-1:0 1px 2px rgba(17,26,25,.05), 0 2px 8px -4px rgba(17,26,25,.10);
  --shadow-2:0 2px 6px rgba(17,26,25,.06), 0 14px 32px -18px rgba(17,26,25,.28);
  --ease:cubic-bezier(.22,.61,.36,1);
  --spring:cubic-bezier(.34,1.4,.5,1);
}
@media (prefers-color-scheme:dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --ground:#0B1211; --surface:#131B1A; --surface-2:#182221; --raised:#1B2624;
    --ink:#E9F0EE; --ink-soft:#9AA9A5; --ink-faint:#828F8B;
    --line:#243230; --line-soft:#1C2725;
    --accent:#5CC8BA; --accent-ink:#93DED3; --accent-soft:#123330; --accent-glow:rgba(92,200,186,.20);
    --ok:#5FD09A; --ok-bg:#0F2B20;
    --mod:#E3B265; --mod-bg:#2B2211;
    --hi:#F2A077; --hi-bg:#2E1D12;
    --sev:#F28B7E; --sev-bg:#2F1714;
    --shadow-1:0 1px 2px rgba(0,0,0,.5), 0 2px 8px -4px rgba(0,0,0,.6);
    --shadow-2:0 2px 6px rgba(0,0,0,.5), 0 14px 32px -18px rgba(0,0,0,.9);
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --ground:#0B1211; --surface:#131B1A; --surface-2:#182221; --raised:#1B2624;
  --ink:#E9F0EE; --ink-soft:#9AA9A5; --ink-faint:#828F8B;
  --line:#243230; --line-soft:#1C2725;
  --accent:#5CC8BA; --accent-ink:#93DED3; --accent-soft:#123330; --accent-glow:rgba(92,200,186,.20);
  --ok:#5FD09A; --ok-bg:#0F2B20;
  --mod:#E3B265; --mod-bg:#2B2211;
  --hi:#F2A077; --hi-bg:#2E1D12;
  --sev:#F28B7E; --sev-bg:#2F1714;
  --shadow-1:0 1px 2px rgba(0,0,0,.5), 0 2px 8px -4px rgba(0,0,0,.6);
  --shadow-2:0 2px 6px rgba(0,0,0,.5), 0 14px 32px -18px rgba(0,0,0,.9);
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--ground); color:var(--ink);
  font-family:var(--sans); font-size:16px; line-height:1.65; -webkit-font-smoothing:antialiased;
  transition:background-color .35s var(--ease), color .35s var(--ease);
}
h1,h2,h3,h4{text-wrap:balance; line-height:1.25; margin:0}
button{font:inherit; color:inherit}
/* ปุ่มที่พาไปหน้าอื่นถูกวาดเป็น <a href> จริง — Googlebot ไต่ตามลิงก์ ไม่กดปุ่ม
   แถมคนเปิดแท็บใหม่/คัดลอกที่อยู่ได้ ตัวอ่านหน้าจอก็บอกว่า "ลิงก์" ไม่ใช่ "ปุ่ม"
   :where() ทำให้กฎนี้ไม่มีน้ำหนัก คลาสเดิมของแต่ละปุ่มจึงชนะเหมือนตอนเป็น <button> */
:where(a[data-go], a[data-open], a[data-side]){display:inline-block; text-align:center; text-decoration:none;
  color:inherit; background:none; border:0; padding:0; cursor:pointer}
a{color:var(--accent); text-underline-offset:3px}
:focus-visible{outline:2px solid var(--accent); outline-offset:3px; border-radius:6px}
.wrap{max-width:min(1500px, 92vw); margin:0 auto; padding:0 20px}
/* คำโปรยใต้หัวเรื่อง: จอ 1900 เคยยาว 169 ตัวอักษรต่อบรรทัด สายตาไล่กลับผิดแถว */
.wrap > p{max-width:78ch}

/* ── motion ─────────────────────────────────────────── */
@keyframes rise{from{opacity:0; transform:translateY(14px)} to{opacity:1; transform:none}}
@keyframes fadein{from{opacity:0} to{opacity:1}}
@keyframes pop{0%{transform:scale(.94); opacity:0} 60%{transform:scale(1.02)} 100%{transform:scale(1); opacity:1}}
@keyframes sweep{from{transform:scaleX(0)} to{transform:scaleX(1)}}
.anim{animation:rise .5s var(--ease) both}
.stagger > *{animation:rise .5s var(--ease) both}
.stagger > *:nth-child(1){animation-delay:.02s} .stagger > *:nth-child(2){animation-delay:.05s}
.stagger > *:nth-child(3){animation-delay:.08s} .stagger > *:nth-child(4){animation-delay:.11s}
.stagger > *:nth-child(5){animation-delay:.14s} .stagger > *:nth-child(6){animation-delay:.17s}
.stagger > *:nth-child(7){animation-delay:.20s} .stagger > *:nth-child(8){animation-delay:.23s}
.stagger > *:nth-child(n+9){animation-delay:.26s}
@media (prefers-reduced-motion:reduce){
  *, *::before, *::after{animation:none !important; transition-duration:.01ms !important}
  html{scroll-behavior:auto}
}

/* ── scroll motion · เพิ่ม 8 ก.ย.69 ─────────────────────────────────────
   ทุกท่าแตะแค่ transform กับ opacity ไม่แตะ layout หน้าจึงไม่กระตุก (ไม่มี CLS)
   กฎกันหน้าขาว: สถานะซ่อนอยู่ใต้ .mo-on ซึ่ง JS เป็นคนใส่ให้ <html>
   ถ้า JS พังหรือถูกบล็อก เนื้อหายังเห็นครบเหมือนเดิม
   ถ้าเครื่องตั้ง "ลดการเคลื่อนไหว" ปิดทั้งชุด — JS ไม่ทำงาน + CSS บังคับให้เห็น */

/* ท่า 1 · ไถลงเข้ามาจากล่าง ไถขึ้นเข้ามาจากบน (JS ตั้ง --mo-from ตามทิศ) */
.mo-on [data-mo~="rise"]{
  opacity:0; transform:translate3d(0,var(--mo-from,28px),0);
  transition:opacity .6s var(--ease) var(--mo-d,0s), transform .68s var(--ease) var(--mo-d,0s);
}
.mo-on [data-mo~="rise"].mo-in{opacity:1; transform:none}

/* ท่า 2 · พาราแลกซ์ — JS เขียน transform เอง ไม่ต้องมี transition มาหน่วง */
.mo-on [data-mo~="par"]{will-change:transform}

/* ท่า 3 · การ์ดในกริดไล่กันมาเป็นคลื่นเฉียง
   ค่าหน่วงคำนวณตอนวาด (JS เขียน --mo-d) เพราะจำนวนคอลัมน์เปลี่ยนตามความกว้างจอ
   จะนับ nth-child ล่วงหน้าไม่ได้ */
.mo-on .grid > [data-mo]{--mo-from:22px}

/* ท่า 4 · ค่าผลลัพธ์เปลี่ยนแบบไม่กระชาก
   หน้าคำนวณวาดทับใหม่ทุกครั้งที่กรอกเลข ตัวเลขเดิมจึงถูกแทนที่ทันทีจนตามไม่ทันว่าเปลี่ยนไปเท่าไร
   ขยับเฉพาะตัวเลข ไม่ขยับกล่อง บรรทัดอื่นจึงไม่ถูกดัน */
.mo-on .rval{transition:opacity .2s var(--ease), transform .2s var(--ease)}
.mo-on .rval.mo-swap{opacity:.15; transform:translate3d(0,-6px,0)}

/* ท่า 6 · ปุ่มกลับขึ้นบน โผล่เมื่อไถพ้นหนึ่งจอครึ่ง
   บทความยาวสุด 29 เรื่อง ไถกลับเองบนมือถือคือลากนิ้วสิบกว่าครั้ง
   วางชิดขวา ไม่ทับ toast ที่อยู่กลางจอ */
.totop{
  position:fixed; right:16px; bottom:calc(16px + env(safe-area-inset-bottom)); z-index:35;
  width:44px; height:44px; border-radius:50%; display:grid; place-items:center; cursor:pointer;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-soft);
  box-shadow:var(--shadow-1);
  opacity:0; transform:translate3d(0,12px,0); pointer-events:none;
  transition:opacity .25s var(--ease), transform .25s var(--ease), color .2s, border-color .2s;
}
.totop.on{opacity:1; transform:none; pointer-events:auto}
.totop:hover{color:var(--accent); border-color:var(--accent)}
.totop svg{width:19px; height:19px; stroke:currentColor; fill:none; stroke-width:2.2}

/* ท่า 8 · กดแล้วยุบ — ตอบมือทันทีทั้งจอสัมผัสและเมาส์
   ของเดิมมีแต่ hover ซึ่งจอสัมผัสไม่มี กดการ์ดแล้วเงียบจนกว่าหน้าใหม่จะมา
   ใส่เฉพาะตัวที่มี transition transform อยู่แล้ว จึงไม่ต้องแตะกฎเดิม */
.calc-card:active, .door:active, .hotpill:active{transform:scale(.978)}

/* ท่า 5 · โผล่ทีละคำ — เปลี่ยนแค่ความทึบ ห้ามใส่ inline-block
   ภาษาไทยตัดบรรทัดกลางคำได้ ถ้าล็อกเป็นก้อนจะดันข้อความล้นจอแคบ */
.mo-on .mo-w{opacity:.18; transition:opacity .55s var(--ease) var(--mo-d,0s)}
.mo-on [data-mo~="words"].mo-in .mo-w{opacity:1}

/* ท่า 7 · แถบตัวเลขจริงบนหน้าแรก */
.homestats{
  display:grid; grid-template-columns:repeat(3,1fr); gap:10px;
  margin-top:26px; padding:18px 14px;
  background:var(--surface); border:1px solid var(--line); border-radius:var(--r);
}
.homestats div{text-align:center}
.homestats b{
  display:block; font-size:clamp(26px,5vw,34px); font-weight:750; line-height:1.1;
  letter-spacing:-.02em; color:var(--accent); font-variant-numeric:tabular-nums;
}
.homestats span{display:block; margin-top:4px; font-size:13px; color:var(--ink-soft)}

@media (prefers-reduced-motion:reduce){
  .mo-on [data-mo~="rise"]{opacity:1 !important; transform:none !important}
  .mo-on [data-mo~="par"]{transform:none !important}
  .mo-on .mo-w{opacity:1 !important}
  .rval.mo-swap{opacity:1 !important; transform:none !important}
  .calc-card:active, .door:active, .hotpill:active, .btn:active{transform:none !important}
  .totop{transition:none !important}
  .totop.on{transform:none !important}
}

/* ── header ─────────────────────────────────────────── */
header.bar{
  position:sticky; top:0; z-index:40; border-bottom:1px solid var(--line);
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter:saturate(1.6) blur(14px); -webkit-backdrop-filter:saturate(1.6) blur(14px);
}
.bar-in{display:flex; align-items:center; gap:12px; height:62px}
.brand{display:flex; align-items:center; gap:9px; font-weight:750; letter-spacing:-.025em; font-size:19px; text-decoration:none; color:var(--ink); flex:none}
.brand .mark{
  width:26px; height:26px; border-radius:8px; background:var(--accent); flex:none;
  display:grid; place-items:center; color:var(--surface); font-size:13px; font-weight:800;
  box-shadow:0 0 0 4px var(--accent-glow); transition:transform .4s var(--spring);
}
.brand:hover .mark{transform:rotate(-8deg) scale(1.06)}
:root[data-theme="dark"] .brand .mark, :root:not([data-theme="light"]) .brand .mark{color:#08110F}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .brand .mark{color:#fff}}
.brand em{font-style:normal; color:var(--ink-faint); font-weight:600}
.bar-sp{flex:1}
.searchbox{position:relative; flex:1; max-width:400px}
.searchbox input{
  width:100%; font:inherit; font-size:15px; padding:9px 14px 9px 36px; border-radius:999px;
  border:1px solid var(--line); background:var(--surface-2); color:var(--ink);
  transition:border-color .2s var(--ease), box-shadow .25s var(--ease), background-color .2s;
}
.searchbox input:focus{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-glow); outline:none}
.searchbox svg{position:absolute; left:12px; top:50%; transform:translateY(-50%); width:16px; height:16px; stroke:var(--ink-faint); fill:none; stroke-width:2}
.iconbtn{
  width:38px; height:38px; border-radius:11px; border:1px solid var(--line); background:var(--surface-2);
  display:grid; place-items:center; cursor:pointer; flex:none;
  transition:transform .25s var(--spring), border-color .2s, background-color .2s;
}
.iconbtn:hover{border-color:var(--accent); transform:translateY(-1px)}
.iconbtn:active{transform:scale(.94)}
.iconbtn svg{width:17px; height:17px; stroke:var(--ink-soft); fill:none; stroke-width:1.9; stroke-linecap:round}
.tag-mode{
  font-size:11.5px; letter-spacing:.05em; text-transform:uppercase; padding:5px 11px; border-radius:999px;
  border:1px solid var(--line); color:var(--ink-soft); background:var(--surface-2); white-space:nowrap;
}
.tag-mode.pro{color:var(--accent-ink); border-color:var(--accent); background:var(--accent-soft)}
@media (max-width:760px){ .searchbox{max-width:none} .tag-mode{display:none} }

/* ── ad slots ───────────────────────────────────────── */
.ad{
  border:1px dashed var(--line); border-radius:var(--r); background:var(--surface-2);
  display:grid; place-items:center; color:var(--ink-faint); font-size:12.5px; letter-spacing:.06em;
  margin:26px 0; overflow:hidden;
}
.ad.leader{min-height:100px; max-width:970px; margin-inline:auto}          /* 728x90 / responsive */
.ad.rect{min-height:260px; max-width:336px}            /* 300x250 */
.ad.foot{min-height:100px; margin-bottom:8px}
.ad span{opacity:1}
/* ซ่อนกล่องโฆษณาระหว่างรอ AdSense อนุมัติ (28 ก.ย.69)
   ก่อนหน้านี้คนเข้าเว็บเห็นกรอบประ 10 จุดเขียนว่า "พื้นที่โฆษณา" แต่ข้างในว่าง
   ผ่านรีวิวแล้วให้ลบบรรทัดล่างนี้ทิ้ง แล้วเปลี่ยน adSlot() ไปใช้ <ins class="adsbygoogle"> จริง */
.ad{display:none}


/* ── หน้าแรก: เครื่องมือที่ใช้ได้ทันที (8 ก.ย.69) ───────────────────── */
.quickcalc{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);
  padding:18px 16px 16px;margin:18px 0 0;box-shadow:var(--shadow-1)}
.quickcalc h2{font-size:19px;margin:0 0 3px}
.quickcalc .qsub{font-size:13.5px;color:var(--ink-soft);margin:0 0 14px}
.qrow{display:flex;gap:10px}
.qfield{flex:1}
.qfield label{display:block;font-size:12.5px;color:var(--ink-soft);margin-bottom:5px}
/* ห้ามใช้ opacity ลดความเข้ม — มันหารสีจนตกเกณฑ์ contrast (บทเรียนเดียวกับ .ad span)
   ใช้สีที่ผ่านเกณฑ์แล้วตรง ๆ แทน */
.qfield label span{color:var(--ink-faint)}
.qfield input{width:100%;font-size:19px;padding:11px 12px;border:1px solid var(--line);
  border-radius:12px;background:var(--surface-2);color:var(--ink);font-family:inherit}
.qfield input:focus{outline:2px solid var(--accent);outline-offset:1px}
.hq-out{margin-top:14px;padding:13px 14px;border-radius:14px;display:flex;align-items:center;
  gap:13px;border:1px solid var(--line);background:var(--surface-2)}
.hq-out.hq-empty{display:block;font-size:14px;color:var(--ink-soft)}
.hq-out.normal{background:var(--accent-soft);border-color:var(--accent)}
.hq-num{font-size:30px;font-weight:800;line-height:1;color:var(--accent-ink)}
.hq-out.mod .hq-num,.hq-out.high .hq-num,.hq-out.sev .hq-num{color:var(--ink)}
.hq-txt{font-size:14px;line-height:1.4;color:var(--ink)}
.hq-txt span{display:block;margin-top:3px;font-size:12px;color:var(--ink-soft)}
.qmore{margin:11px 0 0}
.qmore button, .qmore a[data-go]{background:none;border:0;padding:0;font:inherit;font-size:13.5px;font-weight:600;
  color:var(--accent-ink);cursor:pointer;text-align:left}
.qmore button:hover, .qmore a[data-go]:hover{text-decoration:underline}
/* กรอบยอดนิยม — สีของตัวเองเพื่อให้แยกออกจากประตูฝั่งบุคลากรตั้งแต่กวาดตา */
.popular{margin-top:16px;padding:16px 14px 14px;border-radius:var(--r);
  background:var(--accent-soft);border:1px solid var(--accent)}
.pop-head{margin-bottom:12px}
.pop-badge{display:inline-block;font-size:11px;font-weight:800;letter-spacing:.1em;
  padding:4px 9px;border-radius:999px;background:var(--accent);color:#fff;margin-bottom:7px}
.pop-head h2{font-size:19px;margin:0 0 2px;color:var(--ink)}
.pop-head p{font-size:13px;color:var(--ink-soft);margin:0}
.shortcuts{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:9px}
.sc{display:flex;gap:10px;align-items:flex-start;padding:12px 12px;border:1px solid var(--line);
  border-radius:14px;background:var(--surface);text-align:left;font:inherit;cursor:pointer}
.sc:hover{border-color:var(--accent);transform:translateY(-2px)}
.sc-n{flex:0 0 auto;width:22px;height:22px;border-radius:7px;background:var(--accent-soft);
  color:var(--accent-ink);font-size:12px;font-weight:800;display:flex;align-items:center;
  justify-content:center;margin-top:1px}
.sc-b{flex:1;min-width:0}
.sc b{display:block;font-size:14.5px;color:var(--ink);margin-bottom:3px}
.sc-b > span{display:block;font-size:12px;color:var(--ink-soft);line-height:1.45}
/* 2 คอลัมน์ตลอด — 4 ใบเรียงเดี่ยวทำให้หน้าแรกยาวขึ้นอีกครึ่งจอโดยไม่ได้อะไรเพิ่ม */
@media (max-width:400px){ .sc b{font-size:13.5px} .sc span{font-size:11.5px} }
/* ── hero / doors ───────────────────────────────────── */
.hero{padding:64px 0 6px}
.hero .kicker{
  display:inline-flex; align-items:center; gap:7px; font-size:12.5px; letter-spacing:.08em;
  text-transform:uppercase; color:var(--accent-ink); background:var(--accent-soft);
  padding:5px 12px; border-radius:999px; border:1px solid var(--accent);
}
.hero h1{font-size:clamp(32px,5.4vw,50px); letter-spacing:-.035em; margin-top:18px}
.hero h1 .hl{position:relative; white-space:nowrap}
.hero h1 .hl::after{
  content:''; position:absolute; left:0; right:0; bottom:.08em; height:.30em; background:var(--accent-soft);
  z-index:-1; transform-origin:left; animation:sweep .7s .35s var(--ease) both; border-radius:3px;
}
.hero p{margin:16px 0 0; font-size:18px; color:var(--ink-soft); max-width:60ch}

/* ค้นหาจากหน้าแรก */
/* หน้าบทความ 2 คอลัมน์ — เนื้อหา + อ่านต่อ
   จำกัดความกว้างตัวอักษรไว้ราว 74ch เพราะบรรทัดที่ยาวเกินคนจะไล่สายตากลับ
   มาต้นบรรทัดผิดแถว ที่ว่างที่เหลือให้คอลัมน์ขวากินไป ไม่ใช่ยืดตัวหนังสือออก */
.artlayout{display:grid; grid-template-columns:minmax(0,1fr) 296px; gap:44px;
  align-items:start; max-width:min(1240px, 100%); margin:0 auto}
.artlayout .article{max-width:74ch; margin-left:0; margin-right:0}
@media(max-width:1000px){
  .artlayout{grid-template-columns:minmax(0,1fr); gap:0; max-width:none}
  .artlayout .article{max-width:74ch; margin-left:auto; margin-right:auto}
}
.morearts{position:sticky; top:84px; background:var(--surface-2);
  border:1px solid var(--line); border-radius:14px; padding:16px 16px 12px}
@media(max-width:1000px){
  .morearts{position:static; margin:30px auto 0; max-width:74ch}
}
.ma-head{font-size:12px; font-weight:700; letter-spacing:.09em; text-transform:uppercase;
  color:var(--ink-faint); margin-bottom:10px}
.ma-item{display:block; width:100%; text-align:right; font:inherit; cursor:pointer;
  background:none; border:0; border-top:1px solid var(--line-soft); padding:11px 0}
.ma-item:first-of-type{border-top:0; padding-top:2px}
.ma-cat{display:block; font-size:11.5px; color:var(--ink-faint); margin-bottom:3px}
.ma-title{display:block; font-size:14.5px; line-height:1.55; color:var(--ink); font-weight:600}
.ma-item:hover .ma-title{color:var(--accent)}
.ma-all{width:100%; font:inherit; font-size:13px; cursor:pointer; margin-top:10px;
  padding:9px 10px; border-radius:9px; background:var(--surface);
  border:1px solid var(--line); color:var(--ink-soft)}
.ma-all:hover{border-color:var(--accent); color:var(--accent)}
.likebar.lb-top{margin:0 0 18px; padding-top:0; border-top:0;
  border-bottom:1px solid var(--line-soft); padding-bottom:16px}
.likebar{display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin:26px 0 4px;
  padding-top:18px; border-top:1px solid var(--line-soft)}
.likebtn{display:inline-flex; align-items:center; gap:8px; font:inherit; font-size:15px; font-weight:600;
  padding:10px 18px; min-height:44px; border-radius:999px; cursor:pointer;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-soft);
  transition:border-color .2s, color .2s, background .2s}
.likebtn svg{width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:2; stroke-linejoin:round}
.likebtn:hover{border-color:var(--accent); color:var(--accent)}
.likebtn.on{border-color:var(--accent); color:var(--accent); background:var(--accent-glow); cursor:default}
.likebtn.on svg{fill:currentColor}
.likebtn .lb-n{font-variant-numeric:tabular-nums; font-weight:750}
.likebtn .lb-n:not(:empty){margin-left:2px; padding-left:9px; border-left:1px solid var(--line)}
.lb-hint{font-size:12.5px; color:var(--ink-faint)}
@media(max-width:520px){ .lb-hint{display:none} }
.sharetoast{
  position:fixed; left:50%; bottom:26px; transform:translateX(-50%) translateY(8px);
  background:var(--ink); color:var(--surface); padding:11px 18px; border-radius:999px;
  font-size:14.5px; font-weight:600; box-shadow:var(--shadow-2); z-index:9999;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s;
  max-width:90vw; text-align:center;
}
.sharetoast.show{opacity:1; transform:translateX(-50%) translateY(0)}
/* ช่องค้นหา + ปุ่มคอมเมนต์ อยู่แถวเดียวกัน · จอแคบปุ่มตกลงมาเต็มความกว้าง */
.hrow{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:26px}
.hsearch{position:relative; flex:1 1 340px; max-width:600px}
.fb-trigger{
  font:inherit; font-size:14.5px; white-space:nowrap; cursor:pointer;
  padding:14px 18px; border-radius:16px; flex:0 1 auto;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-soft);
  box-shadow:var(--shadow-1); transition:border-color .2s, color .2s;
}
.fb-trigger:hover{border-color:var(--accent); color:var(--accent)}
.fb-trigger.on{border-color:var(--accent); color:var(--accent); background:var(--accent-glow)}
@media(max-width:640px){ .fb-trigger{flex:1 1 100%; text-align:center} }
.hsearch input{
  width:100%; font:inherit; font-size:17px; padding:15px 20px 15px 50px; border-radius:16px;
  border:1px solid var(--line); background:var(--surface); color:var(--ink); box-shadow:var(--shadow-1);
  transition:border-color .2s, box-shadow .28s var(--ease);
}
.hsearch input:focus{border-color:var(--accent); box-shadow:0 0 0 5px var(--accent-glow); outline:none}
.hsearch > svg{position:absolute; left:18px; top:50%; transform:translateY(-50%); width:19px; height:19px; stroke:var(--ink-faint); fill:none; stroke-width:2}
.hres{margin-top:10px; border:1px solid var(--line); border-radius:16px; background:var(--surface); overflow:hidden; box-shadow:var(--shadow-2); animation:rise .3s var(--ease) both}
.hres button, .hres a[data-go]{
  display:flex; width:100%; text-align:right; gap:10px; align-items:baseline; justify-content:flex-end;
  padding:12px 18px; background:none; border:0; border-bottom:1px solid var(--line-soft); cursor:pointer;
  transition:background-color .18s;
}
.hres button:last-child, .hres a[data-go]:last-child{border-bottom:0}
.hres button:hover, .hres a[data-go]:hover{background:var(--accent-soft)}
.hres .hn{font-weight:650; font-size:15.5px}
.hres .ht{font-size:13.5px; color:var(--ink-soft); flex:1; text-align:right}
.hres .hside{font-size:11px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-faint); border:1px solid var(--line); border-radius:999px; padding:1px 8px; white-space:nowrap}
.hres .none{padding:16px 18px; color:var(--ink-faint); font-size:14.5px}
/* กล่องผู้ช่วย — แยกให้เห็นชัดว่าเป็นคนละชั้นกับผลค้นหาปกติ */
.hai{border-bottom:1px solid var(--line); background:var(--accent-soft); padding:12px 18px 4px}
.hai .hailab{display:inline-block; font-size:11px; letter-spacing:.05em; color:var(--accent); border:1px solid var(--accent); border-radius:999px; padding:1px 9px}
.hai .haiq{margin:9px 0 3px; font-size:13.5px; color:var(--ink-soft)}
.hai button{background:none; padding-left:0; padding-right:0}
.hai button:hover{background:none; opacity:.72}
.hai .hainote{padding:9px 0 11px; font-size:12px; color:var(--ink-faint); line-height:1.65}
.hai .none{padding:11px 0}

/* ปุ่มสลับหน่วย — อยู่ตรงที่ป้ายหน่วยเคยอยู่ ให้เห็นว่ากดได้ */
.ubtn{font:inherit; font-size:11.5px; letter-spacing:.03em; color:var(--accent);
  background:var(--accent-soft); border:1px solid transparent; border-radius:999px;
  padding:1px 9px; margin-right:6px; cursor:pointer; transition:border-color .18s}
.ubtn:hover{border-color:var(--accent)}
.ubtn span{opacity:.65; margin-right:4px}

/* ปุ่ม "คนอื่นกำลังเปิด" ใต้ช่องค้นหา
   ชื่อคลาสขึ้นต้น hot/dsc เพราะ .pill กับ .pills เป็นของตารางวาร์ฟารินอยู่แล้ว */
.hotrow{display:flex; flex-wrap:wrap; gap:8px; margin-top:14px; align-items:center; justify-content:flex-end}
.hotrow .hothead{font-size:12px; color:var(--ink-faint); margin-left:2px}
.hotpill{display:inline-flex; align-items:center; gap:7px; font:inherit; font-size:14px; font-weight:600;
  background:var(--accent); color:#fff; border:0; border-radius:12px; padding:9px 14px; cursor:pointer;
  transition:opacity .18s, transform .18s var(--ease)}
.hotpill:hover{opacity:.88; transform:translateY(-1px)}
.hotpill svg{width:15px; height:15px; stroke:currentColor; fill:none; stroke-width:2; opacity:.85}

/* กล่องค้นพบท้ายหน้าแรก — ของใหม่ / ใช้บ่อย / อ่านมาก */
.discover{display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-top:34px}
@media (max-width:860px){.discover{grid-template-columns:1fr}}
.dsc{background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:20px 18px}
.dsc h3{font-size:13px; letter-spacing:.06em; color:var(--ink-faint); margin:0 0 12px; font-weight:650}
.dsc ol{list-style:none; counter-reset:r; margin:0; padding:0; display:grid; gap:4px}
.dsc li{counter-increment:r}
.dsc button, .dsc a[data-go]{display:grid; gap:2px; width:100%; text-align:right; font:inherit; background:none; border:0;
  border-radius:10px; padding:8px 10px; cursor:pointer; color:var(--ink); transition:background-color .18s}
.dsc button:hover, .dsc a[data-go]:hover{background:var(--accent-soft)}
.dsc .dscn{font-size:14.5px; font-weight:600; line-height:1.45}
.dsc .dscn::before{content:counter(r) '. '; color:var(--ink-faint); font-weight:500}
.dsc .dscd{font-size:12.5px; color:var(--ink-soft); line-height:1.5}

/* Related Calculators — ชื่อพร้อมคำอธิบายหนึ่งบรรทัด */
.nx button, .nx a[data-go]{align-items:flex-start; min-width:0}
.nx .nxk{margin-top:2px}
.nx .nxt{display:flex; flex-direction:column; gap:2px; min-width:0; overflow-wrap:anywhere}
.nx .nxn{font-weight:650}
.nx .nxd{font-size:12.5px; color:var(--ink-soft); line-height:1.5}

.doors{display:grid; grid-template-columns:repeat(auto-fit,minmax(320px,1fr)); gap:16px; margin-top:34px}
@media (max-width:760px){.doors{grid-template-columns:1fr}}
.door{
  position:relative; overflow:hidden; text-align:right; cursor:pointer;
  background:var(--surface); border:1px solid var(--line); border-radius:20px; padding:30px 26px 26px;
  display:flex; flex-direction:column; gap:9px;
  transition:transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.door::before{
  content:''; position:absolute; inset:0 0 auto 0; height:3px; transform:scaleX(0); transform-origin:right;
  background:var(--accent); transition:transform .4s var(--ease);
}
.door:hover{transform:translateY(-3px); box-shadow:var(--shadow-2); border-color:var(--accent)}
.door:hover::before{transform:scaleX(1)}
.door .eyebrow{font-size:11.5px; letter-spacing:.11em; text-transform:uppercase; color:var(--ink-faint)}
.door h2{font-size:25px; letter-spacing:-.025em}
.door p{margin:0; color:var(--ink-soft); font-size:15px}
.door .go{margin-top:8px; color:var(--accent); font-weight:650; font-size:15px; display:inline-flex; align-items:center; gap:6px; justify-content:flex-start}
.door:hover .go{gap:10px}
.door .go span{transition:margin .3s var(--ease)}

/* ── list / cards ───────────────────────────────────── */
.crumb{font-size:14px; color:var(--ink-soft); padding-top:24px; display:flex; gap:7px; flex-wrap:wrap; align-items:center}
.crumb button, .crumb a[data-go]{background:none; border:0; color:var(--accent); cursor:pointer; padding:0; font:inherit}
.sec-head{display:flex; align-items:flex-end; gap:14px; flex-wrap:wrap; margin:26px 0 16px}
.sec-head h1{font-size:30px; letter-spacing:-.03em}
.sec-head p{margin:0; color:var(--ink-soft); font-size:15.5px}
.count{font-family:var(--mono); font-size:13px; color:var(--ink-faint); background:var(--surface-2); border:1px solid var(--line); border-radius:999px; padding:3px 11px}

.chips{display:flex; gap:8px; overflow-x:auto; padding:4px 0 12px; scrollbar-width:none}
.chips::-webkit-scrollbar{display:none}
.chip{
  flex:none; font-size:13.5px; padding:7px 14px; border-radius:999px; cursor:pointer; white-space:nowrap;
  border:1px solid var(--line); background:var(--surface); color:var(--ink-soft);
  transition:all .22s var(--ease);
}
.chip:hover{border-color:var(--accent); color:var(--accent)}
.chip[aria-pressed=true]{background:var(--accent); border-color:var(--accent); color:var(--surface); font-weight:650}
:root[data-theme="dark"] .chip[aria-pressed=true], :root:not([data-theme="light"]) .chip[aria-pressed=true]{color:#08110F}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .chip[aria-pressed=true]{color:#fff}}

.grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(268px,1fr)); gap:12px}
.calc-card{
  position:relative; text-align:right; cursor:pointer; background:var(--surface); font:inherit; color:inherit;
  border:1px solid var(--line); border-radius:var(--r); padding:16px 46px 14px 16px; width:100%;
  display:flex; flex-direction:column; gap:5px;
  transition:transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.calc-card:hover{transform:translateY(-2px); border-color:var(--accent); box-shadow:var(--shadow-1)}
.calc-card .cc-top{display:flex; align-items:baseline; gap:8px}
.calc-card h3{font-size:16.5px; letter-spacing:-.01em; flex:1}
.calc-card .cc-th{font-size:13.5px; color:var(--ink-soft)}
.calc-card .cc-desc{font-size:13.5px; color:var(--ink-faint); line-height:1.55}
.cat-dot{width:7px; height:7px; border-radius:50%; background:var(--accent); flex:none; margin-top:7px}
.star{
  position:absolute; top:6px; left:6px; width:44px; height:44px; border-radius:10px; border:0;
  background:none; cursor:pointer; display:grid; place-items:center; opacity:.4; z-index:2;
  transition:opacity .2s, transform .3s var(--spring), background-color .2s;
}
.star:focus-visible{background:var(--accent-soft)}
.star:hover{opacity:.8; transform:scale(1.12)}
.star.on{opacity:1}
.star svg{width:16px; height:16px; stroke:var(--ink-faint); fill:none; stroke-width:1.8}
.star.on svg{stroke:var(--mod); fill:var(--mod)}
.empty{padding:44px 20px; text-align:center; color:var(--ink-faint); border:1px dashed var(--line); border-radius:var(--r)}

/* ── calculator page ────────────────────────────────── */
.calc-wrap{display:grid; grid-template-columns:minmax(300px,1fr) minmax(0,2.2fr); gap:20px; margin-top:20px; align-items:start}
    .calc-wrap > :nth-child(n+3){grid-column:1 / -1}
@media (max-width:900px){.calc-wrap{grid-template-columns:1fr}}
.panel{background:var(--surface); border:1px solid var(--line); border-radius:var(--r); padding:22px; box-shadow:var(--shadow-1)}
.panel > h2{font-size:12px; letter-spacing:.09em; text-transform:uppercase; color:var(--ink-faint); font-weight:650; margin-bottom:16px}
.field{display:flex; flex-direction:column; gap:6px; margin-bottom:15px}
.field label{font-size:14px; font-weight:600; display:flex; justify-content:space-between; gap:10px; align-items:baseline}
.field .u{font-family:var(--mono); font-size:12px; color:var(--ink-faint); font-weight:400}
.field .hint{font-size:12.5px; color:var(--ink-faint); display:block; max-width:74ch}
/* ใช้ text + inputmode=decimal ไม่ใช่ type=number — type=number คืน selectionStart เป็น null
   ทำให้กู้ตำแหน่งเคอร์เซอร์หลังวาดใหม่ไม่ได้ พิมพ์เลขหลายหลักแล้วโฟกัสหลุด */
.numin, select{
  font:inherit; font-size:16px; padding:10px 13px; border:1px solid var(--line); border-radius:10px;
  background:var(--surface-2); color:var(--ink); width:100%;
  transition:border-color .2s, box-shadow .25s var(--ease);
}
.numin{font-family:var(--mono); font-variant-numeric:tabular-nums}
.numin:focus, select:focus{border-color:var(--accent); box-shadow:0 0 0 4px var(--accent-glow); outline:none}
.numin.bad{border-color:var(--sev); background:var(--sev-bg)}
.warnbox{border:1px solid var(--sev); background:var(--sev-bg); color:var(--sev); border-radius:var(--r); padding:16px 18px; font-size:15px; line-height:1.6}
.warnbox b{display:block; margin-bottom:4px}
.rowbtns{display:flex; gap:8px; flex-wrap:wrap; margin-top:4px}
.rowbtns .btn{margin-top:0; padding:9px 16px; font-size:14px}
.switch{
  display:flex; align-items:center; justify-content:space-between; gap:12px; cursor:pointer;
  padding:11px 13px; border:1px solid var(--line); border-radius:10px; background:var(--surface-2);
  margin-bottom:9px; font-size:14.5px; transition:border-color .2s, background-color .2s;
}
.switch:hover{border-color:var(--accent)}
.switch input{position:absolute; opacity:0; pointer-events:none}
.switch .track{
  width:40px; height:23px; border-radius:999px; background:var(--line); position:relative; flex:none;
  transition:background-color .25s var(--ease);
}
.switch .track::after{
  content:''; position:absolute; top:3px; right:3px; width:17px; height:17px; border-radius:50%;
  background:var(--surface); box-shadow:0 1px 3px rgba(0,0,0,.3);
  transition:transform .28s var(--spring);
}
.switch input:checked + .track{background:var(--accent)}
.switch input:checked + .track::after{transform:translateX(-17px)}
.switch .pts{font-family:var(--mono); font-size:12px; color:var(--ink-faint); margin-left:auto}

/* result */
.result{
  border-radius:var(--r); padding:22px; border:1px solid var(--line); background:var(--surface-2);
  animation:pop .4s var(--ease) both;
}
.result .rlabel{font-size:12px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint)}
.result .rval{
  font-family:var(--mono); font-size:clamp(38px,7vw,54px); font-weight:700; letter-spacing:-.04em;
  font-variant-numeric:tabular-nums; line-height:1.1; margin-top:4px;
}
.result .rval small{font-size:.42em; font-weight:500; color:var(--ink-soft); letter-spacing:0}
.result .rtext{margin:12px 0 0; font-size:15.5px; line-height:1.65; max-width:74ch}
.result.normal{border-color:var(--ok); background:var(--ok-bg)} .result.normal .rval{color:var(--ok)}
.result.low{border-color:var(--mod); background:var(--mod-bg)}  .result.low .rval{color:var(--mod)}
.result.mod{border-color:var(--mod); background:var(--mod-bg)}  .result.mod .rval{color:var(--mod)}
/* .hi เป็นชื่อระดับที่เครื่องมือ 7 ตัวส่งออกมาจริง (PREVENT · PF ratio · NIHSS ·
   driving pressure · Vd/Vt · PPV · SOFA) แต่ CSS มีแค่ .high มาตลอด
   ผลคือระดับ "ปานกลาง/สูง" ของเครื่องมือเหล่านั้นแสดงแบบไม่มีสีเลย
   เติม .hi เป็นชื่อพ้องแทนการไล่แก้ 7 จุด — พบและแก้ 1 ก.ย.69 */
.result.high,.result.hi{border-color:var(--hi); background:var(--hi-bg)}
.result.high .rval,.result.hi .rval{color:var(--hi)}
.result.sev{border-color:var(--sev); background:var(--sev-bg)}  .result.sev .rval{color:var(--sev)}
.extras{display:flex; flex-wrap:wrap; gap:10px; margin-top:16px}
.extra{background:var(--surface); border:1px solid var(--line); border-radius:10px; padding:9px 13px; flex:1 1 300px; max-width:520px}
.extra .k{font-size:11.5px; letter-spacing:.05em; text-transform:uppercase; color:var(--ink-faint)}
.extra .v{font-family:var(--mono); font-size:16px; font-variant-numeric:tabular-nums; margin-top:2px}
.fb{margin:14px 0 4px; padding:18px 18px; background:var(--surface-2);
  border:1px solid var(--line); border-radius:14px}
.fb-sub{margin:6px 0 14px; font-size:14px; color:var(--ink-soft); line-height:1.6}
.fb-who{display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px}
.fb-chip{font:inherit; font-size:14px; padding:8px 15px; border-radius:999px; cursor:pointer;
  background:var(--surface); border:1px solid var(--line); color:var(--ink-soft)}
.fb-chip:hover{border-color:var(--brand)}
.fb-chip.on{background:var(--brand); border-color:var(--brand); color:#fff; font-weight:600}
.fb textarea{width:100%; box-sizing:border-box; font:inherit; font-size:15px; line-height:1.6;
  padding:11px 13px; border:1px solid var(--line); border-radius:10px; resize:vertical;
  background:var(--surface); color:var(--ink)}
.fb textarea:focus{outline:2px solid var(--brand); outline-offset:1px; border-color:var(--brand)}
.fb-row{display:flex; align-items:center; justify-content:space-between; gap:12px;
  flex-wrap:wrap; margin-top:10px}
.fb-note{font-size:12.5px; color:var(--ink-faint); line-height:1.5; flex:1 1 220px}
.fb-note b{color:var(--sev)}
.fb-msg{margin:10px 0 0; font-size:14px; color:var(--ok); min-height:1.2em}
.fb-msg.bad{color:var(--sev)}
.whatis{margin:14px 0 4px; padding:14px 16px; background:var(--surface-2);
  border:1px solid var(--line); border-radius:10px}
.whatis summary{font-weight:650; font-size:15px; cursor:pointer; color:var(--ink)}
.whatis p{margin:10px 0 0; font-size:14.5px; line-height:1.7; color:var(--ink-soft); max-width:78ch}
.refs{margin-top:20px; padding-top:15px; border-top:1px solid var(--line-soft); font-size:12.5px; color:var(--ink-faint); line-height:1.7; max-width:86ch; overflow-wrap:anywhere}
.refs b{display:block; text-transform:uppercase; letter-spacing:.07em; font-size:11px; margin-bottom:6px; font-weight:650}
.note{font-size:14px; line-height:1.65; color:var(--ink-soft); border-right:3px solid var(--line); padding-right:14px; margin-top:16px; max-width:76ch}
.note strong{color:var(--ink)}

/* ── บทความ ── ตั้งค่าให้อ่านยาวสบายตา ไม่ใช่หน้าจอเครื่องมือ */
.article{max-width:68ch; margin:26px auto 0; font-size:17.5px; line-height:1.9}
.article h1{font-size:clamp(27px,4.4vw,36px); letter-spacing:-.03em; margin-bottom:8px}
.article h2{font-size:22px; letter-spacing:-.02em; margin:38px 0 2px}
.artfig{margin:18px 0 6px}
/* บล็อกคำอธิบายยาวใต้เครื่องมือ ใช้ typography ของบทความ แต่ชิดซ้ายในคอลัมน์เครื่องมือ */
.calcnote{margin:30px 0 0; max-width:68ch}
.calcnote h2:first-child{margin-top:0}
.artfig img{width:100%; height:auto; display:block; border-radius:14px; background:var(--surface)}
.article p{margin:16px 0 0; color:var(--ink)}
.article > p:first-of-type:not(.byline){font-size:19px; color:var(--ink-soft); line-height:1.75}
.article ul{margin:14px 0 0; padding-right:22px}
.article li{margin-bottom:9px; overflow-wrap:anywhere}
.article strong{font-weight:650}
.article table{width:100%; border-collapse:collapse; font-size:15.5px; margin:18px 0 0; display:block; overflow-x:auto; contain:inline-size}
.article th, .article td{padding:10px 12px; border-bottom:1px solid var(--line-soft); text-align:left; vertical-align:top}
.article th{font-size:13px; color:var(--ink-faint); text-transform:uppercase; letter-spacing:.05em; white-space:nowrap}
.article .callout{
  border-right:3px solid var(--sev); background:var(--sev-bg); border-radius:0 12px 12px 0;
  padding:18px 20px; margin:26px 0 0; font-size:16.5px; line-height:1.75;
}
.article .callout p:first-child{margin-top:0}
.article .refs{margin-top:44px; padding-top:22px; border-top:1px solid var(--line)}
.article .refs h2{font-size:14px; text-transform:uppercase; letter-spacing:.08em; color:var(--ink-faint); margin:0 0 10px}
.article .refs ul{padding-right:20px}
.article .refs li{font-size:14px; color:var(--ink-soft); line-height:1.65; margin-bottom:8px}
.article .byline{margin-top:32px; padding-top:16px; border-top:1px solid var(--line-soft); font-size:13.5px; color:var(--ink-faint); line-height:1.7}

/* ── แถบความคืบหน้าการอ่าน (เฉพาะหน้าบทความ) ─────────────────────────
   เกาะขอบล่างของแถบหัวที่ sticky อยู่แล้ว จึงไม่ต้องเพิ่มชั้น fixed อีกชั้น
   ใช้ scaleX ไม่ใช่ width เพราะ width บังคับให้คำนวณ layout ใหม่ทุกเฟรมที่ไถ
   ไม่ปิดตอน "ลดการเคลื่อนไหว" — อันนี้คือบอกตำแหน่งว่าเหลืออีกเท่าไร ไม่ใช่ลูกเล่น */
.rprog{position:absolute; left:0; right:0; bottom:-1px; height:2px;
  display:none; overflow:hidden; pointer-events:none}
.rprog i{display:block; height:100%; background:var(--accent);
  transform:scaleX(0); transform-origin:left center}

/* ── หัวบทความ: พื้นหลังไถช้ากว่าตัวหนังสือ ──
   ขยับเฉพาะชั้นพื้นหลัง ตัวอักษรอยู่กับที่
   ถ้าไถหัวเรื่องเอง มันจะไหลลงไปทับย่อหน้าแรก (h1 margin-bottom แค่ 8px) */
.arthero{position:relative; overflow:hidden; border-radius:16px;
  margin:8px 0 0; padding:24px 20px 18px}
.arthero > h1{position:relative; margin-top:0}
/* เผื่อขอบไว้ 70% ของความสูงกล่องทั้งบนและล่าง
   วัดได้ว่าชั้นนี้ไถลงไปไกลสุด 52px ตอนที่คนยังมองเห็นกล่อง
   ถ้าเผื่อน้อยกว่านั้น ขอบบนของ gradient จะหลุดเข้ามาในกล่อง
   แล้วเห็นเป็นแถบโปร่งพาดหัวเรื่อง (overflow:hidden ตัดของที่ล้น แต่เติมของที่ขาดไม่ได้) */
.arthero-bg{position:absolute; left:0; right:0; top:-70%; height:240%; z-index:0;
  background:linear-gradient(160deg, var(--accent-soft), transparent 70%)}

/* gate + legal */
/* แผ่นทับ ไม่ใช่การแทนที่ — ลิสต์เครื่องมือยังอยู่ครบใต้แผ่นเบลอ
   backdrop-filter ทำให้ของข้างหลังอ่านไม่ออกโดยไม่ต้องแตะ #app เลย
   เบราว์เซอร์ที่ไม่รองรับได้พื้นทึบแทน — ยังกั้นได้เหมือนเดิม */
.gate-wrap{position:fixed; inset:0; z-index:80; display:grid; place-items:center; padding:20px;
  background:rgba(18,22,30,.42); backdrop-filter:blur(7px); -webkit-backdrop-filter:blur(7px);
  overscroll-behavior:contain; animation:fadein .3s var(--ease) both}
.gate{background:var(--surface); border:1px solid var(--line); border-radius:18px; padding:30px; width:100%; max-width:660px; max-height:calc(100dvh - 40px); overflow-y:auto; box-shadow:var(--shadow-2)}
.gate h2{font-size:22px; letter-spacing:-.02em}
.gate ul{margin:16px 0 0; padding-right:20px; color:var(--ink-soft); font-size:15px; line-height:1.85}
.btn{
  font-weight:650; font-size:15px; padding:12px 22px; border-radius:11px; cursor:pointer; margin-top:22px;
  background:var(--accent); border:1px solid var(--accent); color:var(--surface);
  transition:transform .22s var(--spring), box-shadow .25s, filter .2s;
}
.btn:hover{transform:translateY(-2px); box-shadow:0 8px 22px -10px var(--accent)}
.btn:active{transform:scale(.97)}
/* :not(.ghost) สำคัญ — ไม่งั้นกฎ (0,3,0) นี้ทับสีของปุ่ม ghost (0,2,0) จนตัวอักษรหายไปกับพื้น */
:root[data-theme="dark"] .btn:not(.ghost), :root:not([data-theme="light"]) .btn:not(.ghost){color:#08110F}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .btn:not(.ghost){color:#fff}}
.btn.ghost{background:var(--surface-2); color:var(--ink); border-color:var(--ink-faint)}
.btn.ghost:hover{border-color:var(--accent); color:var(--accent); background:var(--accent-soft); box-shadow:none}
.legal{max-width:70ch; padding-top:30px}
.legal h1{font-size:29px; letter-spacing:-.025em}
.legal h2{font-size:17px; margin-top:28px}
.legal p,.legal li{color:var(--ink-soft); font-size:15.5px; line-height:1.75}
.legal ul{padding-right:20px}

footer.foot{border-top:1px solid var(--line); margin-top:56px; padding:26px 0 44px; background:var(--surface); color:var(--ink-soft); font-size:13.5px}
.foot-row{display:flex; flex-wrap:wrap; gap:10px 22px; align-items:center}
.foot-nav{display:flex; flex-wrap:wrap; gap:10px 22px; align-items:center; margin-bottom:14px; font-weight:600}
.foot button, .foot a{background:none; border:0; color:var(--ink-soft); cursor:pointer; font:inherit; padding:5px 0; text-decoration:none}
.foot button:hover, .foot a:hover{color:var(--accent)}
.foot p{margin:14px 0 0; max-width:74ch; line-height:1.65}
.hnav{display:flex; gap:18px; align-items:center; flex:none}
.hnav a{color:var(--ink-soft); text-decoration:none; font-weight:600; font-size:14.5px; white-space:nowrap}
.hnav a:hover{color:var(--accent)}
@media(max-width:720px){.hnav{display:none}}


/* จำค่าพื้นฐาน + ชวนใช้เครื่องมือถัดไป */
.pfnote{display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; font-size:12.5px; line-height:1.5;
  color:var(--ink-faint); border:1px dashed var(--line); border-radius:10px; padding:8px 11px; margin-bottom:16px}
.pfnote button{background:none; border:none; padding:0; font:inherit; color:var(--accent-ink);
  cursor:pointer; text-decoration:underline; text-underline-offset:2px}
.nextup{margin-top:24px; border-top:1px solid var(--line); padding-top:18px}
.nextup>b{display:block; font-size:11px; letter-spacing:.09em; text-transform:uppercase;
  color:var(--ink-faint); margin-bottom:11px}
.nx{display:grid; gap:8px; grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.nx button, .nx a[data-go]{display:flex; align-items:center; gap:10px; width:100%; text-align:left; font:inherit; font-size:14.5px;
  color:var(--ink); background:var(--surface); border:1px solid var(--line); border-radius:12px; padding:11px 13px;
  cursor:pointer; transition:border-color .18s var(--ease), transform .18s var(--ease)}
.nx button:hover, .nx a[data-go]:hover{border-color:var(--accent); transform:translateX(2px)}
.nx .nxk{flex:none; font-size:11px; letter-spacing:.05em; color:var(--ink-faint);
  border:1px solid var(--line); border-radius:999px; padding:2px 8px}
@media (prefers-reduced-motion:reduce){ .nx button, .nx a[data-go]{transition:none} .nx button:hover, .nx a[data-go]:hover{transform:none} }

/* warfarin regimen bits */
.regimen{border:1px solid var(--line); border-radius:12px; padding:14px; margin-bottom:12px; background:var(--surface-2); animation:rise .4s var(--ease) both}
.regimen.pick{border-color:var(--accent); background:var(--surface); box-shadow:var(--shadow-1)}
.reg-head{display:flex; flex-wrap:wrap; align-items:baseline; gap:8px 14px; margin-bottom:10px}
.reg-rank{font-size:11px; letter-spacing:.08em; text-transform:uppercase; color:var(--ink-faint); border:1px solid var(--line); border-radius:999px; padding:2px 9px}
.regimen.pick .reg-rank{color:var(--accent-ink); border-color:var(--accent); background:var(--accent-soft)}
.reg-mg{font-family:var(--mono); font-size:16px; font-variant-numeric:tabular-nums; font-weight:650}
.reg-diff{font-size:12.5px; color:var(--ink-faint); margin-right:auto}
.reg-say{margin:10px 0 0; font-size:14.5px; line-height:1.6}
.strip{display:grid; grid-template-columns:repeat(7,1fr); gap:6px}
.day{border:1px solid var(--line); border-radius:10px; padding:9px 3px 7px; text-align:center; background:var(--surface)}
.day .dname{font-size:12px; color:var(--ink-faint)}
.day .pills{display:flex; flex-wrap:wrap; justify-content:center; align-items:center; gap:3px; min-height:32px; margin:4px 0 2px}
.day .mg{font-family:var(--mono); font-size:13px; font-variant-numeric:tabular-nums}
.day.hold{background:var(--sev-bg); border-color:var(--sev)}
.day.hold .mg{color:var(--sev)}
/* สีเม็ดวาร์ฟารินตามของจริง — 1 มก. ส้ม / 3 มก. ฟ้า / 5 มก. ชมพู
   ใช้ตัวแปรต่อเม็ด เพื่อให้ .half หยิบสีเดียวกันไปทำครึ่งวงกลมได้ */
.pill{width:14px; height:14px; border-radius:50%; flex:none;
      border:1.5px solid var(--pill-line,var(--accent)); background:var(--pill-bg,var(--accent))}
.pill.s1{--pill-bg:#F09A33; --pill-line:#B26A0F}
.pill.s3{--pill-bg:#57A7E6; --pill-line:#2A6DA6}
.pill.s5{--pill-bg:#F08DB4; --pill-line:#BD5582}
.pill.half{background:linear-gradient(90deg,var(--pill-bg,var(--accent)) 0 50%, transparent 50% 100%)}
.pill.none{border-style:dashed; border-color:var(--line); background:none}
.pill-key{display:flex; flex-wrap:wrap; gap:6px 18px; margin:0 0 12px; font-size:13px; color:var(--ink-soft)}
.pill-key>span{display:inline-flex; align-items:center; gap:6px}
.stgrid{display:grid; grid-template-columns:repeat(3,1fr); gap:8px}
.stbox{position:relative; display:flex; flex-direction:column; align-items:center; gap:4px;
       padding:10px 6px; border:1px solid var(--line); border-radius:10px; background:var(--surface);
       cursor:pointer; transition:border-color .16s var(--ease), background .16s var(--ease)}
.stbox:hover{border-color:var(--ink-faint)}
.stbox.on{border-color:var(--accent); background:var(--accent-soft)}
.stbox input{position:absolute; opacity:0; width:1px; height:1px; pointer-events:none}
.stbox input:focus-visible+.pill{outline:2px solid var(--accent); outline-offset:3px}
.stbox .stlab{font-size:14px; font-weight:650}
.stbox .stsub{font-size:11.5px; color:var(--ink-faint)}
.copybox{display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-top:14px; padding:12px 14px; border:1px dashed var(--line); border-radius:10px; background:var(--surface-2)}
.copybox code{font-family:var(--mono); font-size:13px; line-height:1.6; flex:1; min-width:200px; color:var(--ink-soft); word-break:break-word}
.copybox .btn{padding:8px 14px; font-size:14px; margin:0}

/* ตรวจสุขภาพ 2 นาที — แถบขั้นตอน + การ์ดสรุป */
.ckbar{display:flex; gap:6px; margin:0 0 18px; overflow-x:auto; padding-bottom:2px}
.ckbar>*{flex:1 1 0; min-width:104px; display:flex; align-items:center; gap:8px; text-align:left;
         padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface);
         font:inherit; color:var(--ink-faint); cursor:pointer;
         transition:border-color .16s var(--ease), background .16s var(--ease), color .16s var(--ease)}
.ckbar>div{cursor:default}
.ckstep b{display:grid; place-items:center; flex:none; width:22px; height:22px; border-radius:50%;
          background:var(--surface-2); color:var(--ink-faint); font-size:12.5px; font-weight:700}
.ckstep span{font-size:12.5px; line-height:1.35; font-weight:600}
.ckstep.done{color:var(--ink-soft)}
.ckstep.done b{background:var(--accent-soft); color:var(--accent-ink)}
.ckstep.now{border-color:var(--accent); background:var(--accent-soft); color:var(--accent-ink)}
.ckstep.now b{background:var(--accent); color:#fff}
.cksum{margin-bottom:18px}
.cktodo{margin:0; padding-left:20px; display:flex; flex-direction:column; gap:9px; font-size:15px; line-height:1.65}
.cktodo li{padding-left:2px}
.btn[disabled]{opacity:.45; cursor:not-allowed}
@media (max-width:640px){ .ckstep span{display:none} .ckbar>*{min-width:0; flex:1 1 auto; justify-content:center} }

/* ── มาสคอตหมอเมดดี้บนหัวหน้าแรก ────────────────────────────────
   ซ่อนบนจอแคบ เพราะเหนือช่องค้นหามีที่จำกัด บนมือถือช่องค้นหาต้องมาก่อน */
.hero-top{display:flex; align-items:center; gap:30px}
.hero-top>.hero-lead{flex:1 1 auto; min-width:0}
.hero-mascot{flex:0 0 auto; line-height:0}
/* จอแคบ: ไม่ซ่อน แต่ย่อแล้วยกขึ้นก่อนหัวเรื่อง มือถือมีสัดส่วนของมันเอง
   ไม่ใช่เอาของจอคอมมาบีบใส่ */
@media (max-width:860px){
  .hero-top{flex-direction:column; align-items:flex-start; gap:12px}
  .hero-mascot{order:-1}
  .hero-mascot svg{width:122px; height:140px}
}


/* กล่องค้นหาไม่เจอ — มาสคอตอยู่ซ้าย ข้อความอยู่ขวาตามแนวเดิมของรายการผล */
.hres .none-fig{display:flex; align-items:center; gap:14px}
.hres .nf-art{flex:0 0 auto; line-height:0}
/* หัวคอลัมน์อ่านต่อ — รายการข้างล่างชิดขวา หัวเรื่องจึงอยู่ขวา มาสคอตอยู่ซ้าย */
.ma-headrow{display:flex; align-items:center; justify-content:space-between;
  gap:10px; margin-bottom:10px}
.ma-headrow .ma-head{margin-bottom:0}
.ma-fig{flex:0 0 auto; line-height:0}
/* ตัวเดินตามตอนไถหน้า — ตำแหน่งกับขนาดคำนวณด้วย JS จากที่ว่างจริง
   z-index ต่ำกว่าแถบหัว (40) และปุ่มกลับขึ้นบน (35) ทั้งไม่รับคลิก
   เพราะเป็นของประดับ ห้ามไปขวางปุ่มที่คนตั้งใจกด */
.mwalk{position:fixed; top:0; right:0; z-index:30; line-height:0; pointer-events:none;
  opacity:0; transition:opacity .3s var(--ease)}
.mwalk.mw-on{opacity:1}
@media (prefers-reduced-motion:reduce){ .mwalk{display:none !important} }

/* ── รูปร่างและท่าทางของมาสคอต — ต้นทาง _v2/mascot.js ── */
:root{--m-skin:#C6EADC;--m-line:#12332E;--m-accent:#0E5F5A;--m-blush:#F2A79E;--m-scrub:#2E8C82}
.mascot{overflow:visible;display:block}
.mascot .m-arm-l,.mascot .m-arm-r,.mascot .m-leg-l,.mascot .m-leg-r{transform-box:fill-box;transform-origin:50% 5.5px}
.mascot .m-head{transform-box:fill-box;transform-origin:50% 96%}
.mascot .m-eyes{transform-box:fill-box;transform-origin:50% 50%;animation:m-blink 5.2s ease-in-out infinite}
.mascot .m-lamp{transform-box:fill-box;transform-origin:50% 50%;animation:m-lampglow 3s ease-in-out infinite}
.mascot .m-shadow{transform-box:fill-box;transform-origin:50% 50%}
.mascot-hi .m-fig{animation:m-bob 3.4s ease-in-out infinite}
.mascot-hi .m-shadow{animation:m-shadow 3.4s ease-in-out infinite}
.mascot-hi .m-arm-r{animation:m-wave 4.6s ease-in-out infinite}
.mascot-hi .m-arm-l{animation:m-swing-l 3.4s ease-in-out infinite}
.mascot-hi .m-leg-l{animation:m-shift-l 3.4s ease-in-out infinite}
.mascot-hi .m-leg-r{animation:m-shift-r 3.4s ease-in-out infinite}
.mascot-hi .m-head{animation:m-tilt 4.6s ease-in-out infinite}
.mascot-walk .m-fig{animation:m-bob2 .9s ease-in-out infinite}
.mascot-walk .m-shadow{animation:m-shadow .9s ease-in-out infinite}
.mascot-walk .m-leg-l{animation:m-step-a .9s ease-in-out infinite}
.mascot-walk .m-leg-r{animation:m-step-b .9s ease-in-out infinite}
.mascot-walk .m-arm-l{animation:m-swing-b .9s ease-in-out infinite}
.mascot-walk .m-arm-r{animation:m-swing-a .9s ease-in-out infinite}
.mascot-think .m-fig{animation:m-bob 4.2s ease-in-out infinite}
.mascot-think .m-arm-l{animation:m-tap 1.8s ease-in-out infinite}
.mascot-think .m-arm-r{animation:m-swing-r 4.2s ease-in-out infinite}
.mascot-think .m-head{transform:rotate(-5deg)}
.mascot-think .m-leg-l{animation:m-shift-l 4.2s ease-in-out infinite}
.mascot-happy .m-fig{animation:m-hop 1.3s ease-in-out infinite}
.mascot-happy .m-shadow{animation:m-shadow-hop 1.3s ease-in-out infinite}
.mascot-happy .m-arm-l{animation:m-cheer-l 1.3s ease-in-out infinite}
.mascot-happy .m-arm-r{animation:m-cheer-r 1.3s ease-in-out infinite}
.mascot-happy .m-leg-l{animation:m-tuck-l 1.3s ease-in-out infinite}
.mascot-happy .m-leg-r{animation:m-tuck-r 1.3s ease-in-out infinite}
.mascot-care .m-fig{animation:m-bob 4.6s ease-in-out infinite}
.mascot-care .m-arm-r{animation:m-reach 3.6s ease-in-out infinite}
.mascot-care .m-arm-l{animation:m-swing-l 4.6s ease-in-out infinite}
.mascot-care .m-head{transform:rotate(-7deg)}
@keyframes m-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3.5px)}}
@keyframes m-bob2{0%,50%,100%{transform:translateY(0)}25%,75%{transform:translateY(-3px)}}
@keyframes m-hop{0%,55%,100%{transform:translateY(0)}25%{transform:translateY(-13px)}}
@keyframes m-shadow{0%,100%{transform:scaleX(1);opacity:.9}50%{transform:scaleX(.88);opacity:.6}}
@keyframes m-shadow-hop{0%,55%,100%{transform:scaleX(1);opacity:.9}25%{transform:scaleX(.7);opacity:.4}}
@keyframes m-blink{0%,90%,100%{transform:scaleY(1)}94%,96%{transform:scaleY(.08)}}
@keyframes m-lampglow{0%,100%{opacity:1}50%{opacity:.5}}
@keyframes m-tilt{0%,52%,100%{transform:rotate(0)}12%,44%{transform:rotate(-5deg)}}
@keyframes m-swing-l{0%,100%{transform:rotate(5deg)}50%{transform:rotate(-6deg)}}
@keyframes m-swing-r{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(6deg)}}
@keyframes m-shift-l{0%,100%{transform:rotate(2deg)}50%{transform:rotate(-1deg)}}
@keyframes m-shift-r{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(1deg)}}
@keyframes m-wave{0%{transform:rotate(-5deg)}7%{transform:rotate(-136deg)}14%{transform:rotate(-158deg)}21%{transform:rotate(-132deg)}28%{transform:rotate(-158deg)}35%{transform:rotate(-132deg)}44%{transform:rotate(-152deg)}54%,100%{transform:rotate(-5deg)}}
@keyframes m-step-a{0%,100%{transform:rotate(24deg)}50%{transform:rotate(-24deg)}}
@keyframes m-step-b{0%,100%{transform:rotate(-24deg)}50%{transform:rotate(24deg)}}
@keyframes m-swing-a{0%,100%{transform:rotate(-19deg)}50%{transform:rotate(19deg)}}
@keyframes m-swing-b{0%,100%{transform:rotate(19deg)}50%{transform:rotate(-19deg)}}
@keyframes m-tap{0%,100%{transform:rotate(-118deg)}50%{transform:rotate(-127deg)}}
@keyframes m-cheer-l{0%,100%{transform:rotate(156deg)}50%{transform:rotate(172deg)}}
@keyframes m-cheer-r{0%,100%{transform:rotate(-156deg)}50%{transform:rotate(-172deg)}}
@keyframes m-tuck-l{0%,55%,100%{transform:rotate(0)}25%{transform:rotate(14deg)}}
@keyframes m-tuck-r{0%,55%,100%{transform:rotate(0)}25%{transform:rotate(-14deg)}}
@keyframes m-reach{0%,100%{transform:rotate(-8deg)}35%,75%{transform:rotate(-74deg)}}
@media (prefers-reduced-motion:reduce){
.mascot *{animation:none!important}
.mascot-hi .m-arm-r{transform:rotate(-145deg)}.mascot-hi .m-arm-l{transform:rotate(5deg)}
.mascot-walk .m-leg-l{transform:rotate(21deg)}.mascot-walk .m-leg-r{transform:rotate(-21deg)}
.mascot-walk .m-arm-l{transform:rotate(-16deg)}.mascot-walk .m-arm-r{transform:rotate(16deg)}
.mascot-think .m-arm-l{transform:rotate(-121deg)}
.mascot-happy .m-arm-l{transform:rotate(164deg)}.mascot-happy .m-arm-r{transform:rotate(-164deg)}
.mascot-care .m-arm-r{transform:rotate(-74deg)}
}
