/* SOMPHONG — ธีม "ฟ้าเช้า 09:09" (27 ต.ค. 2569 · แนว 03 ที่คุณอัสนีเลือกจากการสำรวจดีไซน์ด้วย oil-ui 26 ต.ค.)
   ฟ้าเช้าไล่สี ไม่มีกรอบ · ทุกหน้าเปิดด้วยตัวอักษร Prompt ขนาดใหญ่ + ดวงอาทิตย์วงเดียวด้านหลัง · การ์ดขาวมุมมน 1 ใบต่อจอ ·
   ปุ่มแคปซูล (ส้ม = หลัก, ขอบหมึก = รอง) · แถบล่างลอยทรงแคปซูล · ชื่อเหรียญที่ยังไม่เปิดเป็น "ชิปหมอก" (เส้นประ) และ "หมอกจาง" ตอนเปิด
   กติกา: ไม่เว้นระยะตัวอักษรภาษาไทย (letter-spacing ใช้กับ .word/.sym อักษรอังกฤษเท่านั้น) · ตัวอักษรเล็ก ≥ 4.5:1 ·
   พื้นที่กดหลัก ≥ 44 px · คะแนนไม่ใช้สีแดง · ชื่อเหรียญที่ยังไม่เปิดไม่มีอะไรบอกใบ้ (ชิปกว้างเท่ากันทุกแถว) */
:root {
  color-scheme: light;
  --sky-0: #E9F1FA; --sky-1: #F7FAFD; --white: #FFFFFF;
  --ink: #0E1A2B; --ink-2: #3C4C61; --muted: #536579;
  --sun: #F08A3C; --sun-dark: #E67E2F; --sun-soft: #FFD3AE; --select: #D9E8F7; --rule: #C9D7E6; --disabled: #8FA3B8; --chip: #EEF4FB;
  --error: #B3331F; --error-bg: #FBE9E4;
  --line-green: #06a548;
  --font: 'Noto Sans Thai Looped', 'Noto Sans Thai', system-ui, sans-serif; --head: 'Prompt', 'Noto Sans Thai', system-ui, sans-serif;
  --shadow: 0 14px 36px rgba(14, 26, 43, .09);
  --radius: 20px; --radius-m: 14px; --radius-s: 12px;
  /* ขอบหน้า (--pl/--pr) · ขอบของบล็อก (--gl/--gr = ขอบหน้า เว้นแต่อยู่ในคอลัมน์บนจอกว้าง) · ความกว้างหน้า (--page-max ตามขนาดจอ → --page ตามชนิดหน้า) */
  --pl: max(20px, env(safe-area-inset-left, 0px)); --pr: max(20px, env(safe-area-inset-right, 0px)); --gl: var(--pl); --gr: var(--pr);
  --page-max: 480px;
  --nav-h: 56px; --bar-h: 84px;
  --anchor-top: calc(var(--nav-h) + 12px);   /* เผื่อความสูงแถบบนเมื่อกระโดดไปยังจุดในหน้า (#pay · #keep · #delete) — หัวข้อไม่ถูกแถบบัง */
  --ease-out: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }            /* ข้อ A: สไตล์ปุ่ม (display) ต้องไม่ทับคำสั่งซ่อน */
html { -webkit-text-size-adjust: 100%; }
html, body { overflow-x: hidden; overflow-x: clip; }   /* ดวงอาทิตย์ล้นขอบคอลัมน์ได้ แต่ไม่ทำให้เลื่อนแนวนอน */
body { margin: 0; min-height: 100vh; background: linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 60%, var(--white) 100%) fixed; color: var(--ink); font-family: var(--font); font-size: 16px; font-weight: 400; line-height: 1.6; font-variant-numeric: tabular-nums; }
a { color: var(--ink); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--sun-dark); }
b { font-weight: 600; }
small { font-size: .88em; color: var(--muted); }
h1, h2, h3, h4 { font-family: var(--head); line-height: 1.2; text-wrap: balance; margin: 0 0 10px; color: var(--ink); }
h1 { font-weight: 700; font-size: 40px; line-height: 1.1; }
h1.giant { font-size: clamp(64px, 21vw, 84px); line-height: 1.06; }
h1 em { font-style: normal; color: var(--sun); }
h2 { font-weight: 600; font-size: 24px; }
h3 { font-weight: 600; font-size: 17px; line-height: 1.4; }
h4 { font-weight: 600; font-size: 15px; }
p { margin: 0 0 10px; }
.lead { font-size: 15px; color: var(--ink-2); max-width: 30em; }
.tiny { font-size: 13.5px; color: var(--muted); margin: 8px 0 0; line-height: 1.6; }
.small { font-size: 14px; color: var(--ink-2); }
.center { text-align: center; }
.nowrap, .nw { white-space: nowrap; }
a.tlink { display: inline-block; padding: 10px 0; }
.num, .score, .price, .amount, .verify .ref b, .others .n { font-family: var(--head); font-weight: 600; white-space: nowrap; }
.ico { display: inline-block; vertical-align: middle; flex: none; }

/* ---------- โครงหน้า: คอลัมน์กลางกว้าง --page บนฟ้าเช้า (มือถือ 480 · จอกว้างขึ้นดูส่วน "ปรับตามขนาดจอ" ท้ายไฟล์) ---------- */
body { --page: min(var(--page-max), 640px); }                 /* หน้าทั่วไป (ตรวจสอบ/ไม่พบ/ส่งสลิป/ล็อกอิน): คอลัมน์แคบอ่านง่ายทุกขนาดจอ */
body.landing, body.formpage, body.respage { --page: var(--page-max); }
body.doc { --page: min(var(--page-max), 820px); }
body.admin { --page: 100vw; }
header.nav { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px; height: var(--nav-h); margin: 0; padding: 0 max(var(--pr), calc((100% - var(--page)) / 2 + var(--pr))) 0 max(var(--pl), calc((100% - var(--page)) / 2 + var(--pl))); background: rgba(233, 241, 250, .82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); min-height: 44px; }
.brand .sunmark { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #FFE3C6, var(--sun) 70%); box-shadow: 0 0 0 2px rgba(240, 138, 60, .25); flex: none; }
.brand .word { font-family: var(--head); font-weight: 600; font-size: 14px; letter-spacing: .2em; }
header.nav nav { display: flex; align-items: center; gap: 6px; }
header.nav nav a { color: var(--ink-2); text-decoration: none; font-size: 14px; padding: 12px 6px; min-height: 44px; display: inline-flex; align-items: center; }
header.nav nav a:hover { color: var(--ink); }
header.nav nav a.navbtn, .navbtn { display: inline-flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 2px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none; }
.navbtn .ico { width: 14px; height: 14px; }
main.wrap { position: relative; max-width: var(--page); margin: 0 auto; padding: 0 0 40px; }
body.has-bar main.wrap { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.pad { padding-left: var(--gl); padding-right: var(--gr); }
footer.foot { position: relative; max-width: var(--page); margin: 26px auto 0; padding: 22px var(--gr) 30px var(--gl); border-top: 1px solid var(--rule); color: var(--muted); font-size: 13px; line-height: 1.6; }
body.has-bar footer.foot { padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px) + 20px); }
footer.foot p { margin: 8px 0 0; }
footer.foot .links { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 14px; }
footer.foot .links a { color: var(--ink-2); min-height: 44px; display: inline-flex; align-items: center; }
footer.foot .disc { color: var(--ink-2); }
footer.foot .mail { font-family: var(--head); font-size: 13px; color: var(--ink-2); }

/* ดวงอาทิตย์ 09:09 — วงเดียว อยู่หลังตัวอักษรหัวเรื่อง */
.sun { position: absolute; top: 30px; right: -120px; width: 320px; height: 320px; border-radius: 50%; background: radial-gradient(circle at 42% 42%, #FFE3C6 0%, #FBC59A 38%, rgba(240, 138, 60, .18) 62%, rgba(240, 138, 60, 0) 72%); pointer-events: none; z-index: 0; animation: rise .9s var(--ease-out) both; }
.sun::after { content: ''; position: absolute; inset: 60px; border-radius: 50%; border: 1px solid rgba(240, 138, 60, .55); }
.sun.sm { top: 10px; right: -150px; width: 260px; height: 260px; }
@keyframes rise { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.hd { position: relative; z-index: 1; padding: 18px var(--gr) 8px var(--gl); }
.hd .lead { margin: 8px 0 0; }
.hd h1 { margin: 0; }
.step { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); margin: 0 0 8px; }
.step b { font-family: var(--head); font-weight: 600; font-size: 13px; color: var(--ink); background: var(--select); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.rhead > .step { padding-top: 14px; margin-bottom: -6px; }
.sec.s-again { padding-top: 8px; }
.chart { position: relative; z-index: 1; padding: 10px var(--gr) 12px var(--gl); font-size: 15px; color: var(--ink-2); line-height: 1.5; }
.chart b { color: var(--ink); }
.chart .born { display: block; color: var(--ink); font-weight: 500; }
.chart a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; margin: -12px -2px; }

/* ---------- ปุ่มแคปซูล ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 0 22px; border-radius: 999px; border: 2px solid var(--sun); background: var(--sun); color: var(--ink); font-family: var(--head); font-weight: 600; font-size: 16px; line-height: 1.2; text-decoration: none; white-space: nowrap; cursor: pointer; text-align: center; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { background: var(--sun-dark); border-color: var(--sun-dark); color: var(--ink); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--sun); border-color: var(--sun); }
.btn.alt, .btn.line, .btn.ghost, .btn.warn, .btn.provider.google, .btn.small:not(.primary) { background: transparent; border-color: var(--ink); color: var(--ink); font-weight: 500; }
.btn.alt:hover, .btn.line:hover, .btn.ghost:hover, .btn.small:not(.primary):hover { background: var(--select); border-color: var(--ink); }
.btn.ghost { border-color: var(--rule); color: var(--ink-2); }
.btn.warn, .btn.warn.small { border-color: var(--sun); color: var(--ink-2); font-weight: 500; }
.btn.warn:hover { background: var(--sun-soft); }
.btn.big, .btn.wide { display: flex; width: 100%; min-height: 54px; font-size: 17px; }
.btn.small, .btn.sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn.line .ico { color: var(--line-green); }
.btn[disabled] { background: var(--select); border-color: var(--select); color: var(--disabled); cursor: default; transform: none; }
.btn.busy, .btn.busy[disabled] { background: var(--sun); border-color: var(--sun); color: var(--ink); cursor: wait; }
.btn.busy::before { content: ''; width: 16px; height: 16px; border: 2px solid var(--ink); border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; flex: 0 0 16px; }
.btn.danger { background: transparent; color: var(--error); border-color: var(--error); font-weight: 500; }
.btn.danger:hover { background: var(--error-bg); border-color: var(--error); color: var(--error); }
.btn:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, button:focus-visible, a:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.actions .btn { flex: 1 1 150px; }
.actions.stack .btn { flex: 1 1 100%; }
.linkbtn { color: var(--ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; font: inherit; font-size: inherit; min-height: 44px; display: inline-flex; align-items: center; cursor: pointer; }

/* ---------- การ์ดขาว ---------- */
.card { position: relative; margin: 16px var(--gr) 0 var(--gl); background: var(--white); border: 0; border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.card h3 { font-size: 16px; margin-bottom: 4px; }
.card > p, .card .tiny { font-size: 14px; color: var(--ink-2); margin: 4px 0 0; }
.card .actions { margin-top: 12px; }
.card .actions .btn { min-height: 44px; font-size: 15px; }
.alert { padding: 10px 14px; border-radius: var(--radius-s); background: var(--error-bg); color: var(--error); font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
.alert .btn { margin-top: 8px; }
.err { color: var(--error); font-size: 14px; margin-top: 6px; }
.field.err select, .field.err input[type=text], .field.err input[type=email], .field.err .seg { border-color: var(--error); }
.ok { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.ok .ico { width: 18px; height: 18px; color: var(--sun); }
.pill { display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--select); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.pill.lo, .low .pill { background: var(--chip); color: var(--muted); }
.sec { position: relative; padding: 26px var(--gr) 6px var(--gl); }
.sec h2 { font-size: 24px; }
.sec > p { font-size: 15px; color: var(--ink-2); margin: 8px 0 0; }
.list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 10px; }
.list li { display: grid; grid-template-columns: 36px 1fr; padding: 12px 14px; border-radius: var(--radius-m); background: rgba(255, 255, 255, .75); font-size: 15px; color: var(--ink); line-height: 1.5; }
.list li b { font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--sun); line-height: 1.5; }

/* ---------- ชิปหมอก (ชื่อเหรียญที่ยังไม่เปิด — ค่าจริงไม่ถูกส่งมาหน้าเว็บ) และการเปิดชื่อ ---------- */
.seal { display: inline-flex; align-items: center; gap: 8px; min-height: 30px; padding: 0 12px; border-radius: 999px; background: var(--chip); border: 1px dashed var(--rule); font-size: 14px; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.seal i { width: 8px; height: 8px; border-radius: 50%; background: var(--rule); }
.seal .ico { color: var(--ink-2); }
.coin { display: inline-block; max-width: 100%; font-family: var(--head); font-weight: 600; font-size: 17px; color: var(--ink); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coin .sym { font-weight: 600; letter-spacing: .02em; }
.coin .nm { font-family: var(--font); font-weight: 400; color: var(--ink-2); font-size: 14px; }
.fog { display: inline-block; }
.result.reveal .fog { animation: defog .9s ease var(--d, 0s) both; }
@keyframes defog { from { filter: blur(10px); opacity: .2; } to { filter: blur(0); opacity: 1; } }

/* ---------- หน้าแรก ---------- */
.landing .hd { padding-top: 22px; }
.landing .s-cta { padding-top: 20px; }
.doc .s-cta { padding-top: 18px; }
.hero-cta { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- การ์ดอันดับ 1 + แถวอันดับ 2–30 ---------- */
.top { position: relative; z-index: 1; margin: 14px var(--gr) 0 var(--gl); background: var(--white); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); }
.top .kicker { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 10px; font-size: 12.5px; color: var(--muted); }
.top .kicker > * { white-space: nowrap; }
.top .kicker b { font-weight: 500; color: var(--ink-2); }
.top .big { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 4px; }
.top .num.score { font-size: 64px; line-height: 1; color: var(--ink); }
.top .num.score small { font-family: var(--font); font-weight: 400; font-size: 14px; color: var(--muted); margin-left: 4px; }
.ring { width: 72px; height: 72px; flex: 0 0 72px; }
.ring circle { fill: none; stroke-width: 6; }
.ring .track { stroke: var(--select); }
.ring .arc { stroke: var(--sun); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .9s var(--ease-out); }
.top .who { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.top h3 { margin: 14px 0 0; }
.reasons { list-style: none; margin: 6px 0 0; padding: 0; }
.reasons li { position: relative; padding-left: 16px; font-size: 15px; color: var(--ink); margin-top: 6px; line-height: 1.55; }
.reasons li::before { content: ''; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
.reasons.sm li { font-size: 14.5px; color: var(--ink-2); }
.caution, .cau { margin: 10px 0 0; font-size: 14px; color: var(--muted); line-height: 1.55; }
.caution b, .cau b { font-weight: 500; color: var(--ink-2); }
.fine { margin: 14px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
/* ที่มาของคะแนนแบบหยาบ (หลังชำระ): 5 มิติ × 3 ระดับ — ไม่มีตัวเลขย่อย */
.dims { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule); }
.dims .dh { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.dims ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.dims li { display: grid; grid-template-columns: 1fr auto 64px; align-items: center; gap: 10px; font-size: 13.5px; color: var(--ink-2); min-height: 24px; }
.dims .dn { color: var(--ink); }
.dims .dots { display: inline-flex; gap: 3px; }
.dims .dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--select); }
.dims .l1 .dots i:nth-child(1), .dims .l2 .dots i:nth-child(-n+2), .dims .l3 .dots i { background: var(--sun); }
.dims .dw { font-size: 12.5px; color: var(--muted); text-align: right; }
.dims .l3 .dw { color: var(--ink); }
.lrow .in .dims { border-top-color: var(--rule); }
.card.how h3 { font-size: 17px; }
.dimlist { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; counter-reset: dim; }
.dimlist li { display: grid; grid-template-columns: 28px 1fr; gap: 0 8px; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.dimlist li::before { counter-increment: dim; content: counter(dim); font-family: var(--head); font-weight: 600; color: var(--sun); grid-row: span 2; }
.dimlist li b { color: var(--ink); font-weight: 600; }
.dimlist li span { display: block; }
.top .alert { margin: 14px 0 0; }
.paidrow { position: relative; z-index: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 4px var(--gr) 8px var(--gl); font-size: 14px; color: var(--ink-2); }
.paidrow .ok { font-size: 15px; }
.paidrow .actions { flex: 1 1 100%; }
.paidrow .actions .btn { min-height: 44px; font-size: 14.5px; }
.spinner { width: 20px; height: 20px; border: 2px solid var(--rule); border-top-color: var(--sun); border-radius: 50%; animation: spin 1s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }
.rows { position: relative; margin: 16px var(--gr) 0 var(--gl); background: var(--white); border-radius: var(--radius); padding: 6px 0 4px; box-shadow: var(--shadow); }
.rows .lh { display: flex; justify-content: space-between; align-items: center; min-height: 36px; padding: 6px 20px 4px; font-size: 13px; color: var(--muted); }
.rows .lh h2 { font-size: 13px; font-weight: 500; color: var(--muted); margin: 0; }
.lrow { border-top: 1px solid var(--rule); }
.lrow summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 34px 1fr 64px; align-items: center; min-height: 60px; padding: 10px 20px; }
.lrow summary::-webkit-details-marker { display: none; }
.rank { font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--ink-2); line-height: 1; }
.lrow .name { min-width: 0; padding-right: 8px; }
.tier { display: block; font-size: 13px; color: var(--ink-2); margin-top: 4px; line-height: 1.3; }
.tier .x { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.tier .x::before { content: 'ดูเหตุผล'; }
.lrow[open] .tier .x::before { content: 'ซ่อนเหตุผล'; }
.lrow .score { text-align: right; font-size: 22px; color: var(--ink); line-height: 1; }
.lrow .score small { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--muted); }
.lrow.low .score { color: var(--muted); }
.lrow .in { padding: 12px 20px 14px 54px; background: var(--chip); }
.lrow .in h4 { margin: 0; }
.lrow[open] summary { background: var(--chip); }
.rows + .sec { padding-top: 22px; }

/* ---------- แถบล่างลอย: กดแล้วสร้าง QR ทันที (ข้อ D) ---------- */
.stickybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; justify-content: center; pointer-events: none; margin: 0; padding: 0 12px calc(12px + env(safe-area-inset-bottom, 0px)); }
.stickybar .in { pointer-events: auto; width: 100%; max-width: 456px; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 10px 10px 18px; background: var(--white); border-radius: 999px; box-shadow: 0 14px 36px rgba(14, 26, 43, .16); }
.stickybar .t { font-family: var(--head); font-size: 15px; font-weight: 600; color: var(--ink); line-height: 1.25; min-width: 0; text-wrap: balance; }
.stickybar .t small { display: block; font-family: var(--font); font-weight: 400; font-size: 12.5px; color: var(--ink-2); }
.stickybar .btn { flex: 0 0 auto; min-width: 140px; min-height: 50px; }

/* ---------- การ์ดบันทึกลิงก์ส่วนตัว (ลิงก์ = กุญแจ) — ข้อ F, H ---------- */
.card.keep { display: grid; gap: 8px; scroll-margin-top: var(--anchor-top); }
.keep-text { display: grid; gap: 2px; }
.keep-text b { font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--ink); }
.keep-text small { font-size: 14px; color: var(--ink-2); }
.keep-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.keep-actions .btn { flex: 1 1 140px; min-height: 44px; font-size: 15px; padding: 0 14px; }
.keep-actions .btn.copied { border-color: var(--sun); background: var(--sun-soft); }
.sharebtns-wrap { padding-top: 14px; }
.card.done { display: grid; gap: 10px; }
.done-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.done-head > div { display: grid; gap: 2px; }
.done-head b { font-family: var(--head); font-size: 17px; }

/* ---------- ฟอร์ม ---------- */
.formcard { position: relative; z-index: 1; margin: 14px var(--gr) 0 var(--gl); background: var(--white); border-radius: var(--radius); padding: 6px 20px 20px; box-shadow: var(--shadow); }
.formcard .alert { margin: 16px 0 0; }
.field { margin-top: 18px; }
.field > label, .field > .label { display: block; font-family: var(--head); font-weight: 600; font-size: 15px; color: var(--ink); margin-bottom: 6px; }
.field > label small, .field > .label small { font-family: var(--font); font-weight: 400; color: var(--muted); font-size: 13px; }
.fieldnote { margin: 8px 0 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
/* โรงพยาบาลที่เกิด: ช่องพิมพ์ค้นหา + รายการใต้ช่อง (9 พ.ย. 2569) */
.combo { position: relative; }
.combo-list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 30; margin: 0; padding: 6px; list-style: none; background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius-s); box-shadow: var(--shadow); max-height: 300px; overflow-y: auto; }
.combo-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; min-height: 44px; padding: 9px 12px; border-radius: 9px; font-size: 15px; line-height: 1.4; color: var(--ink); cursor: pointer; }
.combo-list li:hover, .combo-list li[aria-selected="true"] { background: var(--select); }
.combo-list li small { font-size: 13px; color: var(--muted); }
.combo-list li.none { color: var(--muted); font-size: 14px; cursor: default; }
.combo-list li.none:hover { background: transparent; }
input[type=text], input[type=email], input[type=time], select, input[type=search], input[type=number], input[type=date], input[type=password] { display: block; width: 100%; min-height: 48px; background: var(--white); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 0 14px; font: inherit; font-size: 16px; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px var(--select); }
input:disabled { opacity: .45; }
select { appearance: none; -webkit-appearance: none; padding-right: 36px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2 5l5 5 5-5' fill='none' stroke='%230E1A2B' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.grid3 { display: grid; grid-template-columns: minmax(0, .68fr) minmax(0, 1.4fr) minmax(0, 1fr); gap: 8px; }   /* วัน : เดือน : ปี = ตามความกว้างตัวอักษรจริง (31 · พฤศจิกายน · ปี พ.ศ.) */
.grid3 select { padding-left: 10px; padding-right: 24px; background-position: right 8px center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
@media (max-width: 460px) { .grid2 { grid-template-columns: 1fr; } }
.timepick { display: grid; grid-template-columns: minmax(0, 2.1fr) auto minmax(64px, 1fr) auto; gap: 8px; align-items: center; }   /* ชั่วโมงยาวสุด "11 · สิบเอ็ดโมง" ต้องไม่ถูกตัดบนจอ 320 */
.timepick select { padding-left: 12px; padding-right: 28px; background-position: right 9px center; }
.timepick .sep { font-family: var(--head); font-size: 20px; color: var(--muted); }
.timepick .unit { font-size: 14px; color: var(--ink-2); }
.check, .field > label.check { display: flex; gap: 12px; align-items: flex-start; font-family: var(--font); font-weight: 400; font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--ink); flex: 0 0 22px; }
.consent { margin: 18px 0 0; padding: 0; border: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 4px; border-radius: 999px; background: var(--chip); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 999px; text-align: center; padding: 0 8px; font-size: 15px; color: var(--ink-2); cursor: pointer; }
.seg input:checked + span { background: var(--ink); color: var(--white); font-weight: 500; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -4px; }
.hp { position: absolute; left: -9999px; top: -9999px; height: 0; overflow: hidden; }
.form-submit { margin-top: 22px; }
.form-submit .tiny { text-align: center; margin-top: 12px; }

/* คำมั่นเรื่องข้อมูลเกิด — แถบโปร่งใต้หัวเรื่อง กดอ่านเพิ่มได้ (ข้อ G) */
.pledge { position: relative; z-index: 1; margin: 14px var(--gr) 0 var(--gl); border-radius: var(--radius-m); background: rgba(255, 255, 255, .7); font-size: 14px; color: var(--ink-2); line-height: 1.5; }
.pledge summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 14px; }
.pledge summary::-webkit-details-marker { display: none; }
.pledge summary .ico { color: var(--sun); width: 16px; height: 16px; }
.pledge summary b { flex: 1; font-weight: 500; color: var(--ink); }
.pledge summary .more { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.pledge[open] summary .more { display: none; }
.pledge .body { padding: 0 14px 12px 40px; }
.pledge ul { margin: 0 0 6px; padding-left: 18px; display: grid; gap: 4px; }

/* หน้ารอผูกดวง (แสดงทับฟอร์มระหว่างส่ง) */
.proc { position: fixed; inset: 0; z-index: 30; background: linear-gradient(180deg, var(--sky-0) 0%, var(--sky-1) 60%, var(--white) 100%); padding: calc(48px + env(safe-area-inset-top, 0px)) var(--gr) 48px var(--gl); }
.proc .in { max-width: 440px; margin: 0 auto; }
.proc h2 { font-size: 32px; }
.proc .lines { margin-top: 18px; background: var(--white); border-radius: var(--radius); padding: 6px 20px; box-shadow: var(--shadow); }
.proc .ln, .sc-lines .ln { display: flex; align-items: center; gap: 12px; min-height: 48px; font-size: 15px; color: var(--muted); border-top: 1px solid var(--rule); transition: color .25s; }
.proc .ln:first-child, .sc-lines .ln:first-child { border-top: 0; }
.proc .ln i, .sc-lines .ln i { width: 20px; height: 20px; border: 2px solid var(--rule); border-radius: 50%; flex: 0 0 20px; display: inline-flex; align-items: center; justify-content: center; }
.proc .ln.done, .sc-lines .ln.done { color: var(--ink); }
.proc .ln.done i, .sc-lines .ln.done i { border-color: var(--sun); background: var(--sun); }
.proc .ln.done i::after, .sc-lines .ln.done i::after { content: ''; width: 6px; height: 10px; border: solid var(--ink); border-width: 0 2px 2px 0; transform: translateY(-1px) rotate(45deg); }
.proc .ln.now, .sc-lines .ln.now { color: var(--ink-2); }
.proc .ln.now i, .sc-lines .ln.now i { border-color: var(--sun); border-right-color: transparent; animation: spin .9s linear infinite; }

/* ---------- ชำระเงิน ---------- */
.paycard { position: relative; z-index: 1; scroll-margin-top: var(--anchor-top); margin: 14px var(--gr) 0 var(--gl); background: var(--white); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.qrbox { display: grid; gap: 10px; justify-items: center; }
.qrbox .step { justify-content: center; margin: 0; }
.qrbox img { width: 220px; max-width: 80vw; height: auto; border: 1px solid var(--rule); border-radius: 16px; padding: 8px; background: #fff; }
.amount { display: flex; align-items: baseline; justify-content: center; gap: 6px; font-size: 36px; color: var(--ink); line-height: 1; }
.amount small { font-family: var(--font); font-weight: 400; font-size: 14px; color: var(--ink-2); }
.qrbox b { font-weight: 600; }
.qrbox .tiny { margin: 0; max-width: 30em; }
.qrbox .receiver b { color: var(--ink); }
.kv { width: 100%; max-width: 30em; display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); font-size: 14px; color: var(--ink-2); text-align: left; }
.kv b { font-weight: 500; color: var(--ink); }
.inapp { margin: 0; padding: 10px 14px; border-radius: var(--radius-s); background: var(--sun-soft); color: var(--ink); font-size: 14px; text-align: left; max-width: 30em; }
.paypaths { display: grid; width: 100%; max-width: 30em; text-align: left; }
.paypath { display: grid; gap: 2px; padding: 12px 0; border-top: 1px solid var(--rule); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.paypath b { font-family: var(--head); color: var(--ink); font-size: 15px; }
.paysteps { list-style: none; margin: 6px auto 0; padding: 0; width: 100%; max-width: 30em; text-align: left; display: grid; gap: 10px; }
.paysteps li { display: grid; grid-template-columns: 36px 1fr; padding: 12px 14px; border-radius: var(--radius-m); background: var(--chip); font-size: 15px; line-height: 1.5; color: var(--ink); }
.paysteps .n { font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--sun); }
.waiting { color: var(--ink-2); font-size: 15px; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%, 100% { opacity: .5 } 50% { opacity: 1 } }
.mockbox { margin-top: 4px; }
.slipform { width: 100%; max-width: 30em; display: grid; gap: 10px; text-align: left; padding-top: 14px; border-top: 1px solid var(--rule); }
.slipform .label { font-family: var(--head); font-size: 15px; font-weight: 600; color: var(--ink); }
.slipform .label small { font-family: var(--font); font-weight: 400; }
.filebtn { cursor: pointer; position: relative; overflow: hidden; }
.filebtn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.slipform .checking { margin-top: 0; text-align: center; }
.slipform.busy .filebtn, .slipform.busy .slipsubmit { opacity: .5; pointer-events: none; }
#sliperror { text-align: left; max-width: 30em; margin: 0; }

/* ---------- ส่งสลิปจากมือถือ (6 พ.ย. 2569) — QR ส่งสลิปต้องดูต่างจาก QR ชำระเงิน: เล็กกว่า อยู่ในกรอบเส้นประ มีคำกำกับ ---------- */
.handoff { width: 100%; max-width: 30em; display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: start; text-align: left; margin-top: 4px; padding: 14px; border: 2px dashed var(--rule); border-radius: var(--radius-m); background: var(--sky-1); }
.qrbox .handoff img.hqr { width: 136px; max-width: 136px; height: 136px; padding: 4px; border: 1px solid var(--rule); border-radius: 10px; background: #fff; }
.handoff .htext { display: grid; gap: 6px; font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.handoff .htext > b { font-family: var(--head); font-weight: 600; font-size: 16px; color: var(--ink); line-height: 1.35; }
.handoff ol { margin: 0; padding-left: 20px; display: grid; gap: 2px; }
.handoff ol small { font-size: 13px; }
.handoff .btn { justify-self: start; margin-top: 2px; }
.handoff .btn.copied { border-color: var(--sun); background: var(--sun-soft); }
@media (max-width: 420px) { .handoff { grid-template-columns: 1fr; justify-items: center; } .handoff .htext { justify-self: stretch; } }
.handoff-more { width: 100%; max-width: 30em; text-align: left; border-top: 1px solid var(--rule); }
.handoff-more summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; font-size: 14.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.handoff-more summary::-webkit-details-marker { display: none; }
.handoff-more[open] summary { text-decoration: none; font-weight: 600; }
.handoff-more .htext > b { display: none; }                  /* หัวข้อซ้ำกับแถบที่กดเปิดอยู่แล้ว */
.slipm { position: relative; z-index: 1; }
.slipm .hd .step { margin-bottom: 12px; }
.slipm .slipcard { display: grid; gap: 10px; }
.slipm .slipcard .amount { justify-content: flex-start; }
.slipm .slipcard .kv { max-width: none; }
.slipm .slipform { max-width: none; }
.slipdone { display: grid; gap: 8px; justify-items: start; }
.slipdone h1 { font-size: 32px; margin: 6px 0 0; }
.slipdone .lead { margin: 0; }
.okmark { display: inline-grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--sun); color: var(--ink); }

/* ---------- หน้าตรวจสลิป (13 พ.ย. 2569) — app.js แสดงแทนเนื้อหาของหน้าทันทีที่เลือกรูปสลิป (หน้าผล + หน้าส่งสลิปจากมือถือ)
   ภาษาเดียวกับ "กำลังผูกดวงกำเนิด": หัวเรื่อง Prompt + การ์ดขาวของแถวขั้นตอน (.ln ว่าง → กำลังทำ → เสร็จ) เพิ่มสถานะ "ไม่ผ่าน" และวงความคืบหน้า
   วงเติมทีละขั้นตามผลจริง (ไม่เดินตามเวลา) · ผ่านแล้ววงกลายเป็นเครื่องหมายดวงอาทิตย์ของแบรนด์พร้อมเครื่องหมายถูก ---------- */
body.sc-open main.wrap > :not(.slipcheck):not(.sun) { display: none; }
body.sc-open header.nav .navkeep { display: none; }                 /* ปุ่มบันทึกลิงก์ของหน้าผล: ระหว่างตรวจสลิปยังไม่ใช่เวลาของมัน (หน้าผลหลังชำระมีให้) */
.slipcheck { position: relative; z-index: 1; }
.slipcheck .hd { padding-top: 20px; padding-bottom: 0; }
.slipcheck .hd .step { flex-wrap: wrap; row-gap: 4px; margin-bottom: 18px; }
.sc-dial { position: relative; display: block; width: 64px; height: 64px; }
.sc-dial > svg { display: block; width: 64px; height: 64px; }
.sc-dial > svg circle { fill: none; stroke-width: 5; }
.sc-dial .track { stroke: var(--select); }
.sc-dial .arc { stroke: var(--sun); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; stroke-dasharray: 169.65; stroke-dashoffset: 169.65; transition: stroke-dashoffset .6s var(--ease-out), stroke .25s; }
.slipcheck[data-p="1"] .arc { stroke-dashoffset: 113.1; }
.slipcheck[data-p="2"] .arc { stroke-dashoffset: 56.55; }
.slipcheck[data-p="3"] .arc { stroke-dashoffset: 0; }
.sc-dial .core { position: absolute; inset: 12px; border-radius: 50%; display: grid; place-items: center; color: var(--ink-2); transition: background-color .25s, color .25s; }
.sc-dial .g { grid-area: 1 / 1; width: 24px; height: 24px; opacity: 0; transform: scale(.6); transition: opacity .18s, transform .3s var(--ease-out); }
.sc-dial .g-slip { opacity: 1; transform: none; }
.slipcheck[data-state="passed"] .g-slip, .slipcheck[data-state="failed"] .g-slip { opacity: 0; transform: scale(.6); }
.slipcheck[data-state="passed"] .g-ok, .slipcheck[data-state="failed"] .g-no { opacity: 1; transform: none; }
.slipcheck[data-state="passed"] .sc-dial .core { background: var(--sun); color: var(--ink); animation: sc-pop .42s var(--ease-out); }
.slipcheck[data-state="passed"] .g-ok path { stroke-dasharray: 20; stroke-dashoffset: 20; animation: sc-draw .32s var(--ease-out) .14s forwards; }
.slipcheck[data-state="failed"] .sc-dial .core { background: var(--error-bg); color: var(--error); }
.slipcheck[data-state="failed"] .sc-dial .arc, .slipcheck[data-state="unknown"] .sc-dial .arc { stroke: var(--rule); }
.sc-say { margin-top: 14px; }
.slipcheck h1 { font-size: 32px; margin: 0; }
.slipcheck h1:focus { outline: none; }
.slipcheck .hd .lead { margin: 6px 0 0; min-height: 3.2em; max-width: 26em; text-wrap: pretty; }       /* จองที่ 2 บรรทัด — ข้อความเปลี่ยนแล้วแถวขั้นตอนไม่ขยับ */
.sc-say.sc-swap > * { animation: sc-in .3s var(--ease-out) both; }
.sc-lines { list-style: none; margin: 12px var(--gr) 0 var(--gl); padding: 6px 20px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); }
.sc-lines .ln { padding: 8px 0; line-height: 1.45; }
.sc-lines .ln > span:not(.sc-st) { flex: 1; }
.sc-pct { margin-left: 4px; font-family: var(--head); font-weight: 600; color: var(--ink-2); }
.sc-lines .ln.done i { animation: sc-pop .3s var(--ease-out); }
.sc-lines .ln.fail { color: var(--ink); }
.sc-lines .ln.fail i { position: relative; border-color: var(--error); background: var(--error-bg); }
.sc-lines .ln.fail i::before, .sc-lines .ln.fail i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; border-radius: 1px; background: var(--error); transform: rotate(45deg); }
.sc-lines .ln.fail i::after { transform: rotate(-45deg); }
.sc-lines .ln.ask i { border-style: dashed; border-color: var(--disabled); }
.sc-st { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sc-msg { margin: 14px var(--gr) 0 var(--gl); font-size: 15px; line-height: 1.55; text-wrap: pretty; animation: sc-in .3s var(--ease-out) both; }
.sc-actions { display: grid; gap: 10px; margin: 16px var(--gr) 0 var(--gl); }
.sc-actions > * { animation: sc-in .3s var(--ease-out) both; }
.slipcheck > .tiny { margin: 12px var(--gr) 0 var(--gl); }
.slipcheck.enter .hd { animation: sc-in .42s var(--ease-out) both; }
.slipcheck.enter .sc-lines { animation: sc-in .42s var(--ease-out) .06s both; }
.slipcheck.enter .ln { animation: sc-in .36s var(--ease-out) calc(.12s + var(--i, 0) * .05s) both; }
.slipcheck.enter > .tiny { animation: sc-in .36s var(--ease-out) .3s both; }
@keyframes sc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sc-pop { 0% { transform: scale(.7); } 60% { transform: scale(1.1); } 100% { transform: scale(1); } }
@keyframes sc-draw { to { stroke-dashoffset: 0; } }
@media (min-width: 720px) {
  .slipcheck { max-width: 560px; margin: 0 auto; }
  .slipcheck .hd { padding-top: 36px; }
  .slipcheck h1 { font-size: 36px; }
}
/* จอเตี้ย (สูง ≤660px — มือถือเครื่องเล็ก · เบราว์เซอร์ในแอป / จอกว้างที่สูง ≤700px — โน้ตบุ๊ก 1366×768 · 1280×720): ลดช่องว่างแนวตั้ง
   เพื่อให้สาเหตุและปุ่ม "เลือกรูปสลิปใหม่" อยู่ในจอแรกเมื่อสลิปไม่ผ่าน (เดิมปุ่มตกขอบล่าง 30–100px) · จอที่สูงกว่านี้คงระยะเดิมทุกค่า
   ต้องอยู่หลังกฎ ≥720 ด้านบน (v18.4) */
@media (max-height: 660px), (min-width: 720px) and (max-height: 700px) {
  .slipcheck .hd { padding-top: 8px; }
  .slipcheck .hd .step { margin-bottom: 10px; }
  .sc-say { margin-top: 8px; }
  .slipcheck[data-state="failed"] .hd .lead, .slipcheck[data-state="unknown"] .hd .lead { min-height: 0; }   /* สถานะที่มีข้อความสาเหตุ + ปุ่มอยู่ด้านล่าง: ไม่ต้องจองบรรทัดที่สอง */
  .sc-lines { margin-top: 8px; padding-top: 4px; padding-bottom: 4px; }
  .sc-lines .ln { min-height: 40px; padding: 4px 0; }
  .sc-msg { margin-top: 10px; }
  .sc-actions { margin-top: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .slipcheck, .slipcheck * { animation: none !important; transition: none !important; }
  .slipcheck[data-state="passed"] .g-ok path { stroke-dashoffset: 0; }
}
@media (prefers-reduced-motion: reduce) { .waiting, .spinner, .sun, .fog, .btn.busy::before, .proc .ln.now i { animation: none !important; } .ring .arc { transition: none; } }

/* ---------- เนื้อหา / แอดมิน ---------- */
.prose p { color: var(--ink-2); font-size: 15px; }
.prose p b { color: var(--ink); }
.prose h1 { font-size: 30px; }
.prose h2 { margin-top: 26px; padding-top: 14px; border-top: 1px solid var(--rule); color: var(--ink); font-size: 20px; }
.prose h1 + p { margin-top: 0; }
.tblwrap { overflow-x: auto; }
@media (max-width: 560px) {                                   /* ตารางอธิบาย: จอแคบเรียงเป็นบล็อก หัวข้ออยู่บนคำอธิบาย */
  table.tbl.stack, table.tbl.stack tbody, table.tbl.stack tr, table.tbl.stack td { display: block; width: 100%; }
  table.tbl.stack tr:first-child { display: none; }
  table.tbl.stack td { border: none; padding: 2px 0; }
  table.tbl.stack td:first-child { font-family: var(--head); font-size: 17px; padding-top: 14px; color: var(--ink); }
  table.tbl.stack tr { border-bottom: 1px solid var(--rule); padding-bottom: 12px; }
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
table.tbl th, table.tbl td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--rule); vertical-align: top; }
table.tbl th { color: var(--muted); font-weight: 500; font-size: 13px; }
.admin .actions form { margin: 2px 2px 2px 0; }
.admin .actions .btn { flex: none; }
.cardhead form.inline { display: flex; gap: 8px; align-items: center; }
.cardhead form.inline input { width: 280px; min-height: 40px; padding: 8px 12px; font-size: 15px; }
.admin main.wrap { max-width: none; }
.pill.st-delivered, .pill.st-pending, .pill.st-paid, .pill.st-failed, .pill.st-expired, .pill.st-paid_no_file, .pill.st-draft, .pill.st-purged, .hint .pill { height: auto; margin: 0; padding: 1px 8px; border: 1px solid var(--rule); border-radius: 999px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; }
.pill.st-delivered { color: var(--ink); border-color: var(--sun); } .pill.st-pending, .pill.st-paid { color: var(--ink-2); border-color: var(--ink-2); } .pill.st-failed, .pill.st-expired, .pill.st-paid_no_file { color: var(--error); border-color: var(--error); }
.cardhead { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.cardhead h1, .cardhead h2 { margin: 0; }
.ref { font-size: 14px; color: var(--muted); }
.hint { color: var(--muted); font-size: 14px; }

/* แชร์ */
.sharebox .btn { display: flex; width: 100%; margin-top: 12px; }
.sharebox .claim { margin-top: 10px; text-align: center; }
.share { position: relative; z-index: 1; padding-top: 14px; }
.share .cardimg { display: block; width: calc(100% - var(--gl) - var(--gr)); max-width: 420px; height: auto; margin: 0 auto; border-radius: var(--radius-m); box-shadow: var(--shadow); }
.sharebtns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.share .cta { text-align: center; }
.share .cta h2 { font-size: 28px; }
.share .cta p { color: var(--ink-2); font-size: 15px; }
.share .headline { font-family: var(--head); font-weight: 600; font-size: 17px; color: var(--ink); margin: 0; }

/* ตรวจสอบรายงาน / ล็อกอิน / บัญชี */
.verify .ref { font-size: 16px; }
.verify .ref b { font-size: 22px; }
.verify .done { padding: 12px 14px; border-radius: var(--radius-s); background: var(--chip); }
.providers { display: grid; gap: 10px; margin-top: 16px; }
.provider.line { background: #06c755; border-color: #06c755; color: #0b1f12; font-weight: 600; }
.provider.line:hover { background: #05b04c; border-color: #05b04c; color: #0b1f12; }
.myorder { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--rule); }
.myorder b { font-family: var(--head); }
.recover { margin-top: 4px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--chip); display: grid; gap: 6px; font-size: 15px; color: var(--ink-2); }
.recover b { color: var(--ink); }
.recover ol { margin: 0; padding-left: 20px; display: grid; gap: 4px; }

/* แอดมิน: สถิติ */
.tabs { display: flex; gap: 6px; font-size: 14px; }
.tabs a { color: var(--muted); text-decoration: none; padding: 6px 12px; border-radius: 999px; border: 1px solid transparent; min-height: 44px; display: inline-flex; align-items: center; }
.tabs a.on { border-color: var(--sun); color: var(--ink); }
table.stats td.good { color: var(--ink); font-weight: 600; }
table.stats td.bad { color: var(--error); font-weight: 600; }
table.stats tr.total td { background: var(--chip); font-weight: 600; }
.spendform { display: grid; grid-template-columns: 150px 1fr 110px 1fr auto; gap: 8px; align-items: center; margin: 8px 0 6px; }
.spendform input { min-height: 40px; padding: 8px 10px; font-size: 14px; }
@media (max-width: 720px) { .spendform { grid-template-columns: 1fr 1fr; } }
code { background: var(--chip); border: 1px solid var(--rule); padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* ---------- ความเป็นส่วนตัว + ลบข้อมูลเอง ---------- */
.sec.privacy { scroll-margin-top: var(--anchor-top); }
.privacy h2 { font-size: 20px; }
.tick { list-style: none; padding: 0; margin: 10px 0 0; color: var(--ink-2); font-size: 15px; display: grid; gap: 6px; }
.tick li { padding-left: 16px; position: relative; line-height: 1.55; }
.tick li::before { content: ''; position: absolute; left: 0; top: 11px; width: 6px; height: 6px; border-radius: 50%; background: var(--sun); }
details.del { margin-top: 12px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
details.del summary { cursor: pointer; color: var(--error); font-size: 15px; list-style: none; display: flex; align-items: center; min-height: 48px; }
details.del summary::-webkit-details-marker { display: none; }
details.del .delbox { margin: 4px 0 14px; padding: 14px 16px; border-radius: var(--radius-m); background: var(--white); border: 1px solid var(--error); box-shadow: var(--shadow); }
details.del .delbox h3 { color: var(--error); margin-bottom: 4px; }
details.del form { margin-top: 4px; display: grid; gap: 10px; justify-items: start; }
details.del .check { font-size: 15px; color: var(--ink); }
.privacy-page h1 { font-size: 27px; }
.privacy-page .lead { font-size: 15.5px; }
.privacy-page ol, .privacy-page ul { padding-left: 20px; color: var(--ink-2); font-size: 15px; display: grid; gap: 6px; }
.privacy-page td { font-size: 14px; }

/* ==================================================================================================================
   ปรับตามขนาดจอ (11 พ.ย. 2569 · คำขอคุณอัสนี: "ให้แอพแสดงผลให้เหมาะสมกับหน้าจอนั้น ๆ") — ดีไซน์ฟ้าเช้าเดิมทุกอย่าง
   (สี ฟอนต์ องค์ประกอบ ถ้อยคำ) เปลี่ยนเฉพาะการจัดวางตามพื้นที่จอ
     ฐาน (ด้านบนทั้งไฟล์) = มือถือ คอลัมน์เดียว · ≤359 มือถือเล็ก/ตั้งตัวอักษรใหญ่ · ≥600 มือถือจอใหญ่/แท็บเล็ตเล็ก ·
     ≥720 แท็บเล็ต · ≥900 คอม (สองคอลัมน์) · ≥1200 / ≥1536 จอกว้าง · จอเตี้ย (มือถือแนวนอน)
   หลัก: (1) ความกว้างหน้า = --page ตั้งตามชนิดหน้าที่ body  (2) ขอบของบล็อก = --gl/--gr ในคอลัมน์ลดฝั่งที่ชนกันเหลือ 14px
         (3) ลำดับใน HTML = ลำดับบนมือถือเสมอ จอกว้างจัดคอลัมน์ด้วย grid (ลำดับอ่าน/ลำดับ Tab ไม่สลับ)
         (4) ไม่ใช้ letter-spacing กับข้อความไทย · พื้นที่กด ≥ 44px ทุกขนาดจอ
   ================================================================================================================== */

.only-wide { display: none; }                                     /* คำบอกตำแหน่งที่ต่างกันตามการจัดวาง เช่น QR "ด้านล่าง" (มือถือ) / "ด้านขวา" (จอกว้าง) */

/* ---------- ≤359: มือถือเล็ก (iPhone SE รุ่นแรก · iPhone ที่ตั้ง "ขยายการแสดงผล" · Android เล็ก) ---------- */
@media (max-width: 359px) {
  :root { --pl: max(14px, env(safe-area-inset-left, 0px)); --pr: max(14px, env(safe-area-inset-right, 0px)); }
  .card, .top, .paycard { padding-left: 16px; padding-right: 16px; }
  .formcard { padding-left: 14px; padding-right: 14px; }
  .grid3 { gap: 6px; }
  .rows .lh, .lrow summary { padding-left: 16px; padding-right: 16px; }
  .lrow .in { padding-left: 16px; padding-right: 16px; }
  .stickybar .in { padding-left: 16px; gap: 8px; }
  .stickybar .btn { min-width: 0; padding: 0 16px; }
  .dims li { grid-template-columns: 1fr auto 56px; gap: 8px; }
}
@media (max-width: 369px) { .stickybar .opt { display: none; } }        /* แถบล่างบนจอแคบ: เหลือ "5 อันดับ · 99 บาท" บรรทัดเดียว */

/* ---------- ≥600: มือถือจอใหญ่ / แท็บเล็ตเล็ก — คอลัมน์เดียวกว้างขึ้น การ์ดโปร่งขึ้น ---------- */
@media (min-width: 600px) {
  :root { --page-max: 560px; }
  .card, .top, .paycard { padding: 22px 26px; }
  .formcard { padding: 8px 26px 26px; }
  .rows .lh, .lrow summary { padding-left: 26px; padding-right: 26px; }
  .lrow .in { padding: 14px 26px 16px 60px; }
  .hd { padding-top: 26px; }
  .landing .hd { padding-top: 30px; }
  .stickybar .in { max-width: 520px; }
}

/* ---------- ≥720 (และมือถือแนวนอน): แท็บเล็ต — หน้าแรกและหน้าแชร์เป็นสองคอลัมน์ ---------- */
@media (min-width: 720px), (min-width: 600px) and (max-height: 500px) {
  body.landing { --page: max(var(--page-max), 720px); }
  .landing main.wrap { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); column-gap: 28px; align-items: center; }
  .landing .hd { grid-column: 1; grid-row: 1; --gr: 0px; padding-top: 34px; padding-bottom: 30px; }
  .landing .top { grid-column: 2; grid-row: 1; --gl: 0px; margin-top: 0; }
  .landing .sec { grid-column: 1 / -1; }
  .landing h1.giant { font-size: clamp(48px, min(11.4vw, 15vh), 92px); }
  .landing .sun { top: 6px; right: auto; left: calc(54.5% - 190px); width: 380px; height: 380px; }
  .landing .sun::after { inset: 72px; }
}
@media (min-width: 720px) {
  :root { --page-max: 640px; }
  h1 { font-size: clamp(40px, 5.2vw, 60px); }
  .hd .lead { font-size: 16px; max-width: 32em; }
  .sec h2 { font-size: 26px; }
  /* หน้าแชร์: การ์ดซ้าย ปุ่มและคำชวนขวา */
  body.sharepage { --page: min(max(var(--page-max), 720px), 940px); }
  .sharepage .share { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: 1fr auto auto 1fr; column-gap: 32px; padding: 30px var(--gr) 0 var(--gl); }
  .sharepage .share .cardimg { grid-column: 1; grid-row: 1 / -1; width: 100%; max-width: none; margin: 0; }
  .sharepage .share .sharebtns-wrap { grid-column: 2; grid-row: 2; padding: 0; }
  .sharepage .share .cta { grid-column: 2; grid-row: 3; margin: 18px 0 0; }
  .sharepage .share .cta .btn { margin-top: 8px; }
  /* หน้าเนื้อหา: บรรทัดอ่านสบายขึ้น */
  .doc .card.prose { padding: 30px 40px 34px; }
  .doc .prose p, .doc .privacy-page ol, .doc .privacy-page ul { font-size: 16px; line-height: 1.75; }
  .doc .prose h2 { font-size: 22px; margin-top: 30px; padding-top: 18px; }
  .doc .prose .lead { font-size: 17px; max-width: none; }
  .doc table.tbl, .doc .privacy-page td { font-size: 15px; }
  .doc table.tbl.stack td:nth-child(2), .doc table.tbl.stack td:nth-child(3) { white-space: nowrap; }
  .doc .dimlist li { font-size: 15px; }
  .doc .s-cta .btn.wide, .landing .s-cta .btn.wide { max-width: 380px; }
  .landing .sec.s-cta { text-align: center; }
  .landing .s-cta .btn.wide { display: inline-flex; }
}

/* ---------- ≥900: คอม / แท็บเล็ตแนวนอน — สองคอลัมน์ ---------- */
@media (min-width: 900px) {
  :root { --page-max: 1040px; --pl: max(32px, env(safe-area-inset-left, 0px)); --pr: max(32px, env(safe-area-inset-right, 0px)); --nav-h: 64px; --radius: 24px; }
  .brand .word { font-size: 15px; }
  .brand .sunmark { width: 20px; height: 20px; }
  header.nav nav a { font-size: 15px; padding-left: 10px; padding-right: 10px; }
  .hd { padding-top: 40px; }
  .hd .lead { font-size: 17px; }
  .sec h2 { font-size: 30px; }
  .card, .top, .paycard { padding: 26px 30px; }
  .rows .lh, .lrow summary { padding-left: 30px; padding-right: 30px; }
  .lrow .in { padding: 14px 30px 18px 64px; }
  .stickybar .in { max-width: 560px; padding-left: 26px; }
  .stickybar .t { font-size: 16px; }
  .stickybar .t small { font-size: 13.5px; }
  .proc { display: grid; align-content: center; padding-top: 48px; }
  .proc .in { width: 100%; max-width: 480px; }

  /* หน้าแรก: ตัวอักษรยักษ์ซ้าย · การ์ดตัวอย่างขวา · ช่วงถัดไป = หัวข้อซ้าย เนื้อหาขวา */
  .landing main.wrap { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); column-gap: 56px; }
  .landing .hd { padding-top: clamp(28px, 7vh, 84px); padding-bottom: clamp(28px, 7vh, 84px); }
  .landing h1.giant { font-size: clamp(72px, min(9.6vw, 17vh), 148px); }
  .landing .hd .lead { font-size: 18px; max-width: 29em; margin-top: 18px; }
  .landing .hero-cta { margin-top: 28px; gap: 18px; }
  .landing .hero-cta .btn { min-height: 58px; padding: 0 34px; font-size: 18px; }
  .landing .hero-cta .small { font-size: 15px; }
  .landing .sun { top: clamp(0px, 4vh, 48px); left: calc(55.5% - 270px); width: 540px; height: 540px; }
  .landing .sun::after { inset: 102px; }
  .landing .top { padding: 28px 32px 30px; }
  .landing .top .kicker { font-size: 13.5px; }
  .landing .top .num.score { font-size: 88px; }
  .landing .top .num.score small { font-size: 16px; }
  .landing .top .ring { width: 96px; height: 96px; flex-basis: 96px; }
  .landing .top .who { margin-top: 16px; }
  .landing .top .seal { min-height: 34px; font-size: 15px; }
  .landing .top .pill { height: 34px; font-size: 14px; }
  .landing .top p.small { font-size: 15px; line-height: 1.65; }
  .landing .sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 40px; align-items: start; padding-top: 52px; }
  .landing .sec > h2 { grid-column: 1; margin: 6px 0 0; font-size: 32px; }
  .landing .sec > .list, .landing .sec > p { grid-column: 2; margin-top: 0; }
  .landing .sec > p { font-size: 17px; line-height: 1.75; max-width: 38em; }
  .landing .sec > p.tiny { font-size: 14.5px; margin-top: 10px; }
  .landing .sec .list { gap: 12px; }
  .landing .sec .list li { grid-template-columns: 44px 1fr; padding: 16px 20px; font-size: 16px; line-height: 1.6; }
  .landing .sec .list li b { font-size: 20px; }
  .landing .sec.s-cta { display: block; text-align: center; padding-top: 60px; padding-bottom: 12px; }
  .landing .s-cta .btn.wide { display: inline-flex; width: auto; min-width: 340px; min-height: 60px; padding: 0 44px; font-size: 18px; }

  /* ฟอร์ม: หัวเรื่อง + คำมั่นข้อมูลค้างอยู่ซ้าย · การ์ดฟอร์มขวา */
  .formpage main.wrap { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); align-items: start; }
  .formpage .intro { grid-column: 1; --gr: 28px; position: sticky; top: var(--nav-h); padding-bottom: 20px; }
  .formpage .intro .hd { padding-top: 52px; }
  .formpage .formcard { grid-column: 2; --gl: 14px; margin-top: 40px; padding: 12px 34px 34px; }
  .formpage .field { margin-top: 22px; }
  .formpage .sun.sm { top: 14px; right: auto; left: calc(45.4% - 250px); width: 350px; height: 350px; }
  .formpage .sun.sm::after { inset: 68px; }
  .formpage .pledge .body { padding-bottom: 14px; }

  /* หน้าผล: ซ้าย = อันดับ 1 + บันทึกลิงก์ + ความเป็นส่วนตัว · ขวา = อันดับ 2–5 + ที่มาของคะแนน + แชร์
     แถวที่ 3 เป็น 1fr: กลุ่มที่กินสองแถว (rcol-b) ไม่ดันแถวของ rcol-a ให้สูงขึ้น → สองคอลัมน์ไหลอิสระ ไม่มีช่องโหว่ */
  .respage .result { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto 1fr; align-items: start; }
  .respage .rhead { grid-column: 1 / -1; grid-row: 1; padding-top: 8px; }
  .respage .rhead > .card { max-width: 640px; }
  .respage .rcol-a { grid-column: 1; grid-row: 2; --gr: 14px; }
  .respage .rcol-b { grid-column: 2; grid-row: 2 / span 2; --gl: 14px; }
  .respage .rcol-c { grid-column: 1; grid-row: 3; --gr: 14px; }
  .respage .rcol-b > .rows { margin-top: 14px; }
  .respage .chart { font-size: 16px; }
  .respage .chart > b:first-child { display: block; font-family: var(--head); font-weight: 600; font-size: 28px; line-height: 1.2; margin-bottom: 4px; }
  .respage .top1 .num.score { font-size: 80px; }
  .respage .top1 .ring { width: 88px; height: 88px; flex-basis: 88px; }
  .respage .top1 h3 { font-size: 19px; margin-top: 16px; }
  .respage .reasons li { font-size: 15.5px; }
  .respage .sun.sm { top: -8px; right: -70px; width: 320px; height: 320px; }
  .respage .only-narrow { display: none; }
  .respage .only-wide { display: inline; }
  /* รอชำระ: ซ้าย = อันดับ 1 → อันดับ 2–5 → คำอธิบาย · ขวา = QR/สลิป + บันทึกลิงก์ (เห็น QR ตั้งแต่จอแรก ไม่ต้องเลื่อน) */
  .respage .result[data-status="pending"] { grid-template-rows: auto auto auto 1fr; }
  .respage .result[data-status="pending"] .rcol-a { display: contents; }
  .respage .result[data-status="pending"] .top1 { grid-column: 1; grid-row: 2; }
  .respage .result[data-status="pending"] .rside { grid-column: 2; grid-row: 2 / span 3; --gl: 14px; --gr: var(--pr); }
  .respage .result[data-status="pending"] .rcol-b { grid-column: 1; grid-row: 3; --gl: var(--pl); --gr: 14px; }
  .respage .result[data-status="pending"] .rcol-c { grid-row: 4; }
  .respage .result[data-status="pending"] .rcol-b > .rows { margin-top: 16px; }

  /* หน้าเนื้อหา */
  .doc .hd { padding-top: 48px; }
  .doc .card.prose { padding: 38px 52px 42px; }

  /* ท้ายหน้า: ลิงก์ซ้าย คำเตือนขวา */
  footer.foot { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 48px; align-items: start; margin-top: 48px; padding-top: 28px; padding-bottom: 36px; font-size: 14px; }
  footer.foot > * { grid-column: 1; }
  footer.foot .disc { grid-column: 2; grid-row: 1 / span 3; margin: 6px 0 0; line-height: 1.7; }
  footer.foot .links { gap: 4px 22px; font-size: 15px; }
  footer.foot .mail { font-size: 14px; }
  .admin footer.foot, body:not(.landing):not(.formpage):not(.respage):not(.doc):not(.sharepage) footer.foot { display: block; }
}
@media (min-width: 1200px) { :root { --page-max: 1120px; } }
@media (min-width: 1536px) { :root { --page-max: 1200px; } }

/* ---------- จอเตี้ย (มือถือแนวนอน): คืนพื้นที่ให้เนื้อหา — แถบบนไม่ค้าง แถบล่างบางลง หัวเรื่องย่อตามความสูงจอ ---------- */
@media (max-height: 500px) and (min-width: 560px) {
  :root { --bar-h: 70px; --anchor-top: 12px; }             /* แถบบนไม่ตรึงแล้ว ไม่ต้องเผื่อ */
  header.nav { position: static; }
  .stickybar .in { min-height: 58px; padding-top: 6px; padding-bottom: 6px; }
  .stickybar .btn { min-height: 46px; }
  h1.giant { font-size: clamp(44px, 15vh, 84px); }
  h1.giant br:nth-of-type(2) { display: none; }                     /* "ดวงคุณ / เหรียญไหน?" สองบรรทัด — ปุ่มหลักอยู่ในจอแรกแม้จอสูงแค่ ~310px */
  .landing .hd { padding-top: 8px; padding-bottom: 10px; }
  .landing .hd .lead { margin-top: 6px; }
  .landing .hero-cta { margin-top: 10px; }
  .landing .sun { top: -10px; width: 300px; height: 300px; left: calc(54.5% - 150px); }
  .landing .sun::after { inset: 56px; }
  .formpage .intro { position: static; }
}

/* ---------- แอดมินบนมือถือ: ช่องค้นหา/ฟอร์มไม่ล้นจอ ---------- */
@media (max-width: 719px) {
  .cardhead form.inline { flex: 1 1 100%; min-width: 0; }
  .cardhead form.inline input { width: auto; flex: 1 1 0; min-width: 0; }
  .spendform input { min-width: 0; }
  .admin .tabs { flex-wrap: wrap; }
  /* ตารางออเดอร์: หนึ่งออเดอร์ = หนึ่งบล็อก ป้ายกำกับอยู่ซ้าย ปุ่มจัดการอยู่ล่าง (ไม่ต้องเลื่อนตารางไปทางขวาเพื่อกดยืนยันจ่าย) */
  table.tbl.orders, table.tbl.orders tbody, table.tbl.orders tr, table.tbl.orders td { display: block; width: 100%; }
  table.tbl.orders tr:first-child { display: none; }
  table.tbl.orders tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  table.tbl.orders td { position: relative; min-height: 26px; padding: 3px 0 3px 92px; border: 0; overflow-wrap: anywhere; }
  table.tbl.orders td::before { content: attr(data-l); position: absolute; left: 0; top: 4px; color: var(--muted); font-size: 13px; }
  table.tbl.orders td:empty { display: none; }
  table.tbl.orders td.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 0; }
  table.tbl.orders td.actions::before { display: none; }
  table.tbl.orders td.actions:empty { display: none; }
  .admin table.stats th, .admin table.stats td { white-space: nowrap; }
}
