/* VetOnDuty — สไตล์ทั้งเว็บ (Mobile-first, ไม่มีการเลื่อนซ้าย-ขวาระดับหน้า) */
@font-face { font-family: "Kanit"; font-weight: 400; font-display: swap; src: url(fonts/kanit-thai-400-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-weight: 400; font-display: swap; src: url(fonts/kanit-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Kanit"; font-weight: 500; font-display: swap; src: url(fonts/kanit-thai-500-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-weight: 500; font-display: swap; src: url(fonts/kanit-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Kanit"; font-weight: 600; font-display: swap; src: url(fonts/kanit-thai-600-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Kanit"; font-weight: 600; font-display: swap; src: url(fonts/kanit-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Sarabun"; font-weight: 400; font-display: swap; src: url(fonts/sarabun-thai-400-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-weight: 400; font-display: swap; src: url(fonts/sarabun-latin-400-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Sarabun"; font-weight: 500; font-display: swap; src: url(fonts/sarabun-thai-500-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-weight: 500; font-display: swap; src: url(fonts/sarabun-latin-500-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }
@font-face { font-family: "Sarabun"; font-weight: 600; font-display: swap; src: url(fonts/sarabun-thai-600-normal.woff2) format("woff2"); unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: "Sarabun"; font-weight: 600; font-display: swap; src: url(fonts/sarabun-latin-600-normal.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+2215; }

:root {
  --ink: #10324c;
  --ink-2: #46586a;
  --paper: #eef4f9;
  --card: #ffffff;
  --line: #d6e2ec;
  --line-2: #b9c9d8;
  --brand: #1b6ca8;
  --brand-2: #155a8e;
  --brand-soft: #e3eef7;
  --amber: #ffb020;
  --amber-2: #f2a20c;
  --amber-soft: #fff3d6;
  --night: #5b3f9e;
  --night-soft: #e8e3f5;
  --strip-night: #dbe5ee;
  --day-soft: #fbeccd;
  --ok: #1a7350;
  --ok-soft: #dff1e8;
  --bad: #ad2f2c;
  --bad-soft: #f9e3e1;
  --line-green: #06c755;
  --display: "Kanit", "Sarabun", system-ui, sans-serif;
  --body: "Sarabun", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r: 20px;
  --r-s: 14px;
  --pad: 16px;
  --nav-h: 66px;
  --top-h: 61px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
/* แถบบนติดอยู่ที่ขอบจอ (sticky): การเลื่อนไปยัง #ตำแหน่ง ช่องที่ได้โฟกัส หรือ scrollIntoView ต้องเว้นที่ให้แถบบน ไม่เช่นนั้นเป้าหมายจะถูกบัง */
html { font-size: 106.25%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--top-h) + 12px); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.65 var(--body); overflow-wrap: anywhere; min-height: 100vh; min-height: 100dvh; }
body.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
img, svg { max-width: 100%; }
a { color: var(--brand-2); text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 500; line-height: 1.35; margin: 0; }
h1 { font-size: 1.5rem; color: var(--brand); }
h1::after { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--amber); margin-top: 8px; }
h2 { font-size: 1.125rem; color: var(--brand); }
h3 { font-size: 1.0625rem; }
b, strong { font-weight: 600; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--card); padding: 8px 12px; z-index: 50; }
.skip:focus { left: 8px; top: 8px; }
.ic { flex: none; }
.ic.xs { width: 16px; height: 16px; }

/* ---------- แถบบน / เมนู ---------- */
.top { background: var(--card); color: var(--ink); position: sticky; top: 0; z-index: 20; border-bottom: 1px solid var(--line); }
.top::before { content: ""; display: block; height: 5px; background: linear-gradient(90deg, #216da6, #1d8985); }
.top-in { max-width: 1080px; margin: 0 auto; padding: 5px var(--pad); min-height: 55px; display: flex; align-items: center; gap: 12px; }
.brand { display: block; flex: none; padding: 6px 0; }
.brand img { display: block; width: 171px; height: 32px; max-width: none; }
.top-nav { display: none; }
.top-act { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.bell { position: relative; color: var(--brand); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; }
.bell b { position: absolute; top: 3px; right: 0; background: var(--amber); color: var(--ink); font: 600 .6875rem/1 var(--body); padding: 3px 5px; border-radius: 9px; min-width: 18px; text-align: center; }
.pill-link { display: flex; align-items: center; gap: 4px; color: var(--brand); text-decoration: none; font: 500 .875rem/1.4 var(--display); padding: 6px 10px; border: 1.5px solid var(--line-2); border-radius: 999px; min-height: 40px; }
.pill-link .ic { width: 18px; height: 18px; }
.bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--card); border-radius: 22px 22px 0 0; box-shadow: 0 -1px 0 var(--line), 0 -6px 18px rgb(16 50 76 / .07); display: flex; padding: 0 4px env(safe-area-inset-bottom); }
.bottom a { flex: 1 1 0; min-width: 0; height: calc(var(--nav-h) - 12px); margin: 6px 2px; border-radius: 16px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: var(--ink-2); text-decoration: none; font: 400 .6875rem/1.3 var(--display); }
.bottom a.on { color: var(--brand); font-weight: 500; background: var(--paper); }
.bottom a.on .ic { stroke-width: 2.3; }

/* ---------- โครงเนื้อหา ---------- */
main { max-width: 680px; margin: 0 auto; padding: 20px var(--pad) 32px; display: flex; flex-direction: column; gap: 16px; }
main.wide { max-width: 1080px; }
main.bare { max-width: none; padding: 0; gap: 0; }
main > *, .card > *, .block > * { min-width: 0; }
.lead { color: var(--ink-2); }
.hint { color: var(--ink-2); font-size: .875rem; line-height: 1.55; }
.pre { white-space: pre-wrap; }
.backlink { display: inline-flex; align-items: center; gap: 2px; color: var(--brand-2); text-decoration: none; font-size: .9375rem; align-self: flex-start; min-height: 32px; }
.backlink .ic { width: 18px; height: 18px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px var(--pad); display: flex; flex-direction: column; gap: 14px; }
.card.narrow { max-width: 460px; width: 100%; margin: 16px auto 0; }
.card.center { text-align: center; align-items: stretch; }
.block { display: flex; flex-direction: column; gap: 10px; }
.block > h2 { margin-top: 6px; }
.headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split { display: flex; flex-direction: column; gap: 16px; }
.split > * { min-width: 0; }
.split > div { display: flex; flex-direction: column; gap: 12px; }
.results { display: flex; flex-direction: column; gap: 10px; }
.count { color: var(--ink-2); font-size: .875rem; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- ปุ่ม ---------- */
.btn { appearance: none; border: 1.5px solid var(--amber); background: var(--amber); color: var(--ink); font: 500 1rem/1.2 var(--display); min-height: 48px; padding: 10px 22px; border-radius: 999px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 8px; }
.btn:hover { background: var(--amber-2); border-color: var(--amber-2); }
.btn:active { transform: translateY(1px); }
.btn.ghost { background: var(--card); color: var(--brand); border-color: var(--brand); }
.btn.ghost:hover { border-color: var(--brand-2); background: var(--brand-soft); }
.btn.sm { min-height: 40px; padding: 6px 16px; font-size: .9375rem; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.bad:hover { background: #8f2522; border-color: #8f2522; }
.btn.line { background: var(--line-green); border-color: var(--line-green); color: #fff; }
.btn.line:hover { filter: brightness(.94); }
.btn.google { background: #fff; border-color: #747775; color: #1f1f1f; gap: 10px; }
.btn.google:hover { background: #f2f5f8; border-color: #747775; }
.btn.google .gmark { flex: none; }
.brk { overflow-wrap: anywhere; }
.card > h3 { margin-top: 6px; }
.btn[disabled] { opacity: .55; cursor: progress; }
.top .btn.sm { background: var(--card); color: var(--brand); border-color: var(--brand); }
.top .btn.sm:hover { background: var(--brand-soft); }
button.link { appearance: none; background: none; border: 0; padding: 8px 4px; font: inherit; color: var(--brand-2); text-decoration: underline; cursor: pointer; }
button.link.bad { color: var(--bad); }

/* ---------- สถานะ / แจ้งเตือนในหน้า ---------- */
.statusbar { border-bottom: 1px solid var(--line); background: var(--card); }
.statusbar-in { max-width: 1080px; margin: 0 auto; padding: 10px var(--pad); display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; border-left: 5px solid var(--brand); }
.statusbar strong { font-family: var(--display); font-weight: 500; }
.statusbar p { font-size: .875rem; color: var(--ink-2); }
.statusbar.critical { background: var(--bad-soft); }
.statusbar.critical .statusbar-in { border-left-color: var(--bad); }
.statusbar.action { background: var(--amber-soft); }
.statusbar.action .statusbar-in, .statusbar.time .statusbar-in { border-left-color: var(--amber); }
.statusbar.progress { background: var(--night-soft); }
.statusbar.progress .statusbar-in { border-left-color: var(--night); }
.flash { max-width: 680px; margin: 12px auto 0; padding: 10px 16px; border-radius: var(--r-s); background: var(--ok-soft); color: #0e4a33; font-weight: 600; width: calc(100% - 2 * var(--pad)); }
.flash.bad { background: var(--bad-soft); color: #7c1f1d; }
.flash.warn { background: var(--amber-soft); color: var(--ink); }
form .flash { margin: 0; width: 100%; }
/* ข้อความแจ้งผลที่ app.js ย้ายมาไว้เหนือส่วนที่ผู้ใช้เพิ่งทำรายการ (หน้าเปิดมาพร้อม #ตำแหน่ง หรือฟอร์มที่ส่งไม่ผ่าน): กว้างเท่าเนื้อหารอบข้าง */
main .flash.near, body.adm main .flash.near { width: auto; max-width: none; margin: 0; }
main .flash.near.lone { margin-bottom: 12px; }
.note { border-left: 4px solid var(--night); background: var(--night-soft); padding: 10px 14px; border-radius: 0 var(--r-s) var(--r-s) 0; display: flex; flex-direction: column; gap: 4px; }
.note.act { border-color: var(--amber); background: var(--amber-soft); }
.note.ok { border-color: var(--ok); background: var(--ok-soft); }
.note.bad { border-color: var(--bad); background: var(--bad-soft); }
.note p { font-size: .9375rem; }
.badge { display: inline-block; font: 500 .8125rem/1.3 var(--display); padding: 3px 11px; border-radius: 999px; background: #e7ecf1; color: var(--ink-2); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: #0e4a33; }
.badge.done { background: var(--brand); color: #fff; }
.badge.wait { background: var(--night-soft); color: #38246f; }
.badge.act { background: var(--amber); color: var(--ink); }
.badge.bad { background: var(--bad-soft); color: #7c1f1d; }
/* ข้อความเครื่องหมายบางแบบยาว (เช่น วุฒิเฉพาะทางจากต่างประเทศ + ชื่อสาขา): ให้ขึ้นบรรทัดใหม่ได้ ไม่ดันหน้าจอกว้างเกิน */
.vmark { display: inline-flex; align-items: flex-start; gap: 4px; max-width: 100%; color: var(--brand); font: 600 .8125rem/1.3 var(--body); overflow-wrap: anywhere; }
.vmark .ic { flex: none; margin-top: 1px; }
.empty { text-align: center; padding: 40px 12px; display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--ink-2); }
.empty h1::after, .card.center h1::after { margin-inline: auto; }

/* ---------- ใบเวร (ticket) ---------- */
.ticket { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.ticket-main { display: flex; flex-direction: column; gap: 7px; padding: 16px 18px 18px; color: inherit; text-decoration: none; min-width: 0; }
.ticket-main:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.ticket-top { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; flex-wrap: wrap; }
.datepill { display: inline-flex; align-items: center; min-height: 30px; padding: 3px 13px; border-radius: 999px; background: var(--brand); color: #fff; font: 500 .8125rem/1.3 var(--display); white-space: nowrap; }
.dateblock { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 12px 4px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); text-align: center; }
.dateblock .dow { font: 500 .8125rem/1.3 var(--display); }
.dateblock .day { font: 600 1.75rem/1 var(--display); color: var(--ink); }
.dateblock .mon { font-size: .75rem; }
.place { display: flex; align-items: flex-start; gap: 4px; color: var(--ink-2); font-size: .875rem; }
.place .ic { margin-top: 3px; }
.time { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.time b { font: 500 1.0625rem/1.3 var(--display); color: var(--brand); font-variant-numeric: tabular-nums; }
.time span { font-size: .875rem; color: var(--ink-2); }
.strip { display: block; width: 100%; height: 10px; }
.strip-night { fill: var(--strip-night); }
.strip-day { fill: var(--day-soft); }
.strip-on { fill: var(--brand); }
.strip-scale { display: flex; justify-content: space-between; font-size: .6875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; margin-top: -2px; }
.pay { white-space: nowrap; font-size: .875rem; color: var(--ink-2); }
.pay b { font: 600 1.1875rem/1.2 var(--display); color: var(--ink); }
.pay .plus { color: var(--ok); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags span { font-size: .8125rem; padding: 1px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2); }
.tags span.plus { border-color: transparent; background: var(--ok-soft); color: #0e4a33; font-weight: 600; }
.ticket-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--line); font-size: .8125rem; color: var(--ink-2); }
.sample-label { color: var(--ink-2); font-size: .875rem; }

/* ---------- รายละเอียดงาน ---------- */
.jobdetail { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); display: flex; flex-direction: column; gap: 14px; }
.jobdetail section { display: flex; flex-direction: column; gap: 4px; }
.jobhead { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; align-items: start; }
.jobhead > div:last-child { display: flex; flex-direction: column; gap: 4px; }
.marks-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.jobtime { display: flex; flex-direction: column; gap: 6px; }
.jobtime .time b { font-size: 1.375rem; }
.jobhead h1::after { display: none; }
.jobtime .strip { height: 16px; }
.paybig { white-space: normal; font-size: 1rem; }
.paybig b { font: 600 1.75rem/1.2 var(--display); }
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div { display: grid; grid-template-columns: minmax(96px, 34%) minmax(0, 1fr); gap: 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.kv dt { color: var(--ink-2); font-size: .875rem; }
.kv dd { margin: 0; }
.kv.compact > div { padding: 4px 0; border: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; counter-reset: st; }
.steps li { counter-increment: st; display: flex; align-items: center; gap: 6px; font-size: .875rem; color: var(--ink-2); padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); }
.steps li::before { content: counter(st); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: #e7ecf1; font: 600 .75rem/1 var(--body); }
.steps li.done { color: var(--brand); border-color: var(--brand-soft); background: var(--brand-soft); }
.steps li.done::before { content: "✓"; background: var(--brand); color: #fff; }
.steps li.now { color: var(--ink); border-color: var(--amber); font-weight: 600; }
.steps li.now::before { background: var(--amber); color: var(--ink); }
.where { padding: 12px 14px; background: var(--brand-soft); border-radius: var(--r-s); }
.quote { border-left: 3px solid var(--line); padding-left: 10px; color: var(--ink-2); }

/* ---------- รายการ ---------- */
.rows { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.rows > li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.rows > li:first-child { border-top: 0; }
.rows > li > a:first-child, .rows > li > div:first-child { flex: 1 1 200px; min-width: 0; color: inherit; text-decoration: none; display: flex; flex-direction: column; gap: 2px; }
.rows > li > a:first-child:hover b { text-decoration: underline; }
.rows > li > span { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.rows p { font-size: .9375rem; color: var(--ink-2); }
.rows time { font-size: .8125rem; color: var(--ink-2); }
.rows li.lv-action, .rows li.lv-critical { box-shadow: inset 4px 0 0 var(--amber); }
.notis li.new { background: var(--amber-soft); }
.notis li.pr-CRITICAL { box-shadow: inset 4px 0 0 var(--bad); }
.notis li.pr-ACTION { box-shadow: inset 4px 0 0 var(--amber); }
.menu { list-style: none; margin: 0; padding: 0; }
.menu a { display: flex; justify-content: space-between; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); min-height: 48px; align-items: center; }
.menu a span { color: var(--ink-2); font-size: .875rem; text-align: right; }
.who { display: flex; align-items: center; gap: 14px; }
.who img, .avatar { width: 56px; height: 56px; border-radius: 50%; flex: none; object-fit: cover; background: var(--brand-soft); display: grid; place-items: center; color: var(--brand); }
.applicants { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.applicant { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.applicant-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.applicant-head b { font: 500 1.0625rem/1.3 var(--display); }
.docs { list-style: none; margin: 0; padding: 0; }
.docs li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.docs li a { flex: 1 1 160px; min-width: 0; }
.docs li span { font-size: .8125rem; color: var(--ink-2); }
.docview { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
.docview img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.docview figcaption { font-size: .8125rem; color: var(--ink-2); }
.tbl { width: 100%; border-collapse: separate; border-spacing: 0; border-radius: var(--r-s); overflow: hidden; background: var(--card); border: 1px solid var(--line); table-layout: fixed; }
.tbl tr:first-child > * { border-top: 0; }
.tbl th, .tbl td { text-align: left; padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; font-weight: 400; }
.tbl th { color: var(--ink-2); width: 45%; font-size: .9375rem; }
.tbl td { font-weight: 600; }

/* ---------- ฟอร์ม ---------- */
form { margin: 0; }
form.card, .filters { display: flex; flex-direction: column; gap: 14px; }
.filters { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: var(--pad); }
form.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
form.inline .f { flex: 1 1 160px; }
.f { display: flex; flex-direction: column; gap: 5px; border: 0; padding: 0; margin: 0; min-width: 0; }
.f label, .f legend { font-weight: 600; font-size: .9375rem; padding: 0; }
.f label i, .f legend i { font-style: normal; font-weight: 400; color: var(--ink-2); font-size: .8125rem; }
input[type="text"], input[type="tel"], input[type="email"], input[type="number"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], select, textarea {
  width: 100%; min-width: 0; font: 400 1rem/1.4 var(--body); color: var(--ink); background: #fff; border: 1.5px solid var(--line-2); border-radius: var(--r-s); padding: 11px 14px; min-height: 48px; appearance: none; }
select { background-image: linear-gradient(45deg, transparent 50%, var(--ink-2) 50%), linear-gradient(135deg, var(--ink-2) 50%, transparent 50%); background-position: calc(100% - 19px) 21px, calc(100% - 13px) 21px; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 36px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.55; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 1px; border-color: var(--brand); border-radius: var(--r-s); }
.f.bad input, .f.bad select, .f.bad textarea { border-color: var(--bad); }
.err { color: var(--bad); font-size: .875rem; font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: 10px; min-height: 44px; padding: 8px 0; cursor: pointer; }
.check input { width: 22px; height: 22px; flex: none; margin: 2px 0 0; accent-color: var(--brand); }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { cursor: pointer; }
.chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.chip span { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 16px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); font: 400 .9375rem/1.3 var(--display); }
.chip input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.chip input:focus-visible + span { outline: 3px solid var(--brand-2); outline-offset: 2px; }
details { border-top: 1px solid var(--line); }
details > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--brand); min-height: 48px; display: flex; align-items: center; list-style: none; gap: 8px; }
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; margin-left: auto; font: 500 1.25rem/1 var(--display); }
details[open] > summary::after { content: "–"; }
details[open] { display: flex; flex-direction: column; gap: 14px; padding-bottom: 6px; }
details.danger > summary { color: var(--bad); }
details.danger form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
details.danger form .f { align-self: stretch; }
.rolepick { display: flex; flex-direction: column; gap: 10px; }
.rolecard { display: flex; align-items: flex-start; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line-2); border-radius: var(--r); cursor: pointer; background: #fff; }
.rolecard input { width: 22px; height: 22px; margin-top: 3px; accent-color: var(--brand); flex: none; }
.rolecard span { display: flex; flex-direction: column; }
.rolecard b { font: 500 1.0625rem/1.4 var(--display); }
.rolecard i { font-style: normal; color: var(--ink-2); font-size: .9375rem; }
.rolecard:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.rolecard.off { opacity: .55; cursor: not-allowed; }
.upload { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.upload .f { align-self: stretch; }
.upload-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-self: stretch; }
.pick { position: relative; display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 14px; border: 1.5px solid var(--line-2); border-radius: var(--r-s); background: var(--card); color: var(--brand); font: 500 1rem/1.2 var(--display); cursor: pointer; text-align: center; }
.pick:hover { border-color: var(--brand); background: var(--brand-soft); }
.pick:active { transform: translateY(1px); }
.pick:focus-within { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.pick input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pick .ic { width: 22px; height: 22px; flex: none; }
.pick.main { grid-column: 1 / -1; justify-content: flex-start; gap: 14px; min-height: 72px; padding: 12px 16px; border-color: var(--amber); background: var(--amber); color: var(--ink); text-align: left; }
.pick.main:hover { border-color: var(--amber-2); background: var(--amber-2); }
.pick-ic { flex: none; display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--brand); }
.pick-ic .ic { width: 24px; height: 24px; }
.pick-t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pick-t b { font: 600 1.125rem/1.2 var(--display); }
.pick-t small { font: 400 .875rem/1.35 var(--body); color: var(--ink); }
/* v0.13.0: เครื่องมือ รูป และระบบของสถานที่ทำงาน */
.wpgallery { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin: 4px 0 12px; }
.wpg-item { position: relative; display: block; overflow: hidden; border-radius: var(--r-s); background: var(--paper); aspect-ratio: 1 / 1; }
.wpg-item.cover { grid-column: 1 / -1; aspect-ratio: 4 / 3; }
.wpg-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wpg-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 4px 8px; background: rgb(11 34 51 / .62); color: #fff; font-size: .8125rem; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv.equip dd { min-width: 0; }
.eqlist { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0; padding: 0; list-style: none; }
.eqlist li:not(:last-child)::after { content: "·"; margin: 0 6px; color: var(--ink-2); }
.facsum { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); }
.facsum-img { flex: none; display: block; width: 72px; height: 72px; overflow: hidden; border-radius: 10px; background: var(--paper); }
.facsum-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.facsum > div { min-width: 0; }
.facsum p { margin: 0; }
.facsum-eq { font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.placecard .facsum { margin: 8px 0; }
.wpphotos { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin: 8px 0 12px; padding: 0; list-style: none; }
.wpphotos li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-s); background: var(--card); }
.wpphotos li > a { display: block; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 10px; background: var(--paper); }
.wpphotos li img { display: block; width: 100%; height: 100%; object-fit: cover; }
.wpphotos .hidden-by-staff img { opacity: .45; }
.wpp-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.wpp-body p { margin: 0; }
.wpp-body .row { gap: 8px; }
.wpp-cap { display: flex; gap: 6px; align-items: center; min-width: 0; }
.wpp-cap input { flex: 1 1 auto; min-width: 0; }
.wpp-cap .btn { flex: none; white-space: nowrap; }
.wpg-no { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 999px; background: rgb(11 34 51 / .72); color: #fff; font: 500 .8125rem/24px var(--display); text-align: center; }
.pinrow .wpphotos { margin-top: 8px; }
.photo-upload { display: flex; flex-direction: column; gap: 10px; align-items: stretch; margin: 4px 0 18px; }
.photo-upload.busy .pick { opacity: .6; pointer-events: none; }
.photo-rules ul { margin: 6px 0; padding-left: 20px; }
/* v0.13.1: แท็บตามกลุ่มเครื่องมือ + การ์ดรายการ */
.eqtabs { margin: 8px 0 12px; min-width: 0; }
.tabbar { display: flex; gap: 6px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; padding: 2px 2px 8px; margin: 0 -2px; border-bottom: 1px solid var(--line); }
.tabbar::-webkit-scrollbar { display: none; }
.tabbar [role="tab"] { appearance: none; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--card); color: var(--ink); font: 500 .9375rem/1.2 var(--display); white-space: nowrap; cursor: pointer; }
.tabbar [role="tab"][aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }
.tabbar [role="tab"]:focus-visible { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.tabcount { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--ink); font: 600 .75rem/20px var(--display); text-align: center; }
.tabpanel { padding-top: 10px; }
.tabpanel-h { margin: 12px 0 6px; font: 500 1rem/1.4 var(--display); }
html.js .tabpanel:not(.on) { display: none; }
html.js .tabpanel-h { display: none; }
html:not(.js) .tabbar { display: none; }
.equip-filter .tabpanel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
html.js .equip-filter .tabpanel:not(.on) { display: none; }
.equip-filter .tabpanel-h { grid-column: 1 / -1; }
.eqcard { position: relative; display: flex; align-items: center; min-height: 52px; cursor: pointer; }
.eqcard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.eqcard span { flex: 1; display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 8px 12px 8px 38px; border: 1.5px solid var(--line); border-radius: var(--r-s); background: var(--card); font: 400 .9375rem/1.35 var(--display); overflow-wrap: anywhere; position: relative; }
.eqcard span::before { content: ""; position: absolute; left: 12px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border: 1.5px solid var(--line-2); border-radius: 5px; background: #fff; }
.eqcard input:checked + span { border-color: var(--brand); background: var(--brand-soft); font-weight: 500; }
.eqcard input:checked + span::before { border-color: var(--brand); background: var(--brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; }
.eqcard input:focus-visible + span { outline: 3px solid var(--brand-2); outline-offset: 2px; }
.facility-edit .tabpanel { display: flex; flex-direction: column; gap: 8px; }
html.js .facility-edit .tabpanel:not(.on) { display: none; }
.facility-edit .eq { display: flex; flex-direction: column; gap: 6px; }
.facility-edit .eq input.eq-model { margin-left: 38px; width: calc(100% - 38px); }
@supports selector(:has(*)) { .eq:not(:has(input[type="checkbox"]:checked)) input.eq-model { display: none; } }
/* v0.13.1: หน้าตั้งค่าระบบ — การ์ดกลุ่ม */
.setsearch { max-width: 520px; margin: 0 0 12px; }
.setcards a { position: relative; }
.setchanged { color: var(--bad) !important; font-weight: 500; }
.setgroup { margin: 0 0 14px; }
.setgroup-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.setgroup-head h2 { margin: 0; }
.setitem { margin: 0 0 4px; }
html:not(.js) .setidx, html:not(.js) [data-set-back] { display: none; }
html.js form[data-settings] .setgroup:not(.on) { display: none; }
html.js form[data-settings].ingroup .setidx { display: none; }
html.js form[data-settings].searching .setcards { display: none; }
html.js form[data-settings].searching .setgroup.hit { display: block; }
html.js form[data-settings].searching [data-set-back] { display: none; }
html.js form[data-settings].searching .setitem.miss { display: none; }
html.js form[data-settings]:not(.ingroup):not(.searching) .setsave { display: none; }
html.js form[data-settings].ingroup .setgroup.on { padding-bottom: 40px; }
form[data-settings] .setsave { position: sticky; bottom: 12px; z-index: 2; box-shadow: 0 6px 18px rgb(16 50 76 / .18); }
.equip-filter { margin: 8px 0; }
.equip-filter fieldset { margin: 8px 0 0; }
.report-photo { display: block; width: 100%; max-width: 320px; height: auto; border-radius: var(--r-s); }
@media (min-width: 720px) { .wpphotos { grid-template-columns: repeat(2, minmax(0, 1fr)); } .wpgallery { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.pick.cam { display: none; }
.pick.file { grid-column: 1 / -1; }
@media (hover: none) and (pointer: coarse) { .pick.cam { display: flex; } .pick.file { grid-column: auto; } }
.upload.busy .pick { opacity: .55; pointer-events: none; }
/* กล้องแบบมีกรอบนำ (บัตรประชาชน ใบอนุญาต): ปุ่มหลักเปิดกล้อง ปุ่มรองสองปุ่มแนบรูป/ไฟล์ PDF; ช่องกล้องของเครื่องซ่อนไว้ใช้เป็นทางสำรอง */
button.pick { appearance: none; width: 100%; cursor: pointer; }
.pick.half { grid-column: auto; }
.pick-native { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
dialog.cam { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #0b2233; color: #fff; overflow: hidden; }
dialog.cam[open] { display: flex; flex-direction: column; }
dialog.cam::backdrop { background: #0b2233; }
.cam-view { position: relative; flex: 1 1 auto; min-height: 0; min-width: 0; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center; overflow: hidden; background: #000; margin-top: env(safe-area-inset-top); }
.cam-view video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cam-frame { position: relative; border-radius: 14px; box-shadow: 0 0 0 100vmax rgb(11 34 51 / .62); outline: 2px solid rgb(255 255 255 / .75); outline-offset: 0; }
.cam-frame i { position: absolute; width: 30px; height: 30px; border: 0 solid var(--amber); }
.cam-frame i:nth-child(1) { top: -3px; left: -3px; border-top-width: 5px; border-left-width: 5px; border-top-left-radius: 14px; }
.cam-frame i:nth-child(2) { top: -3px; right: -3px; border-top-width: 5px; border-right-width: 5px; border-top-right-radius: 14px; }
.cam-frame i:nth-child(3) { bottom: -3px; left: -3px; border-bottom-width: 5px; border-left-width: 5px; border-bottom-left-radius: 14px; }
.cam-frame i:nth-child(4) { bottom: -3px; right: -3px; border-bottom-width: 5px; border-right-width: 5px; border-bottom-right-radius: 14px; }
.cam-shot { position: relative; max-width: calc(100% - 24px); max-height: calc(100% - 24px); border-radius: 10px; background: #fff; }
.cam-view [hidden] { display: none; }
.cam-focus { position: absolute; width: 64px; height: 64px; margin: -32px 0 0 -32px; border: 2px solid var(--amber); border-radius: 50%; pointer-events: none; }
.cam-focus.on { animation: cam-focus .5s ease-out; }
@keyframes cam-focus { from { transform: scale(1.5); opacity: .4; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .cam-focus.on { animation: none; } }
.cam-debug { position: absolute; top: 6px; left: 6px; right: 6px; margin: 0; padding: 6px 8px; border-radius: 8px; background: rgb(0 0 0 / .72); color: #fff; font: 400 11px/1.4 ui-monospace, monospace; white-space: pre-wrap; overflow-wrap: anywhere; user-select: text; pointer-events: none; }
.cam-tip { flex: none; min-height: 1.5em; margin: 0; padding: 10px 16px 4px; text-align: center; font: 400 .9375rem/1.5 var(--body); color: #fff; }
.cam-shapes { flex: none; display: flex; justify-content: center; gap: 8px; padding: 6px 12px 0; }
.cam-shape { appearance: none; min-height: 40px; padding: 6px 14px; border: 1.5px solid rgb(255 255 255 / .45); border-radius: 999px; background: transparent; color: #fff; font: 500 .875rem/1.3 var(--display); cursor: pointer; }
.cam-shape[aria-pressed="true"] { background: #fff; border-color: #fff; color: var(--ink); }
.cam-alt { appearance: none; align-self: center; min-height: 44px; margin-top: 2px; padding: 6px 12px; border: 0; background: none; color: #fff; font: 400 .875rem/1.4 var(--body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.cam-side { flex: none; display: flex; flex-direction: column; min-width: 0; }
.cam-bar { flex: none; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; gap: 10px; min-height: 96px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
.cam-bar > :first-child { justify-self: start; }
.cam-bar > .go { justify-self: end; }
.cam-b { appearance: none; min-height: 48px; padding: 10px 20px; border: 1.5px solid rgb(255 255 255 / .55); border-radius: 999px; background: transparent; color: #fff; font: 500 1rem/1.2 var(--display); cursor: pointer; }
.cam-b.go { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.cam-snap { appearance: none; flex: none; width: 72px; height: 72px; border: 5px solid #fff; border-radius: 50%; background: var(--amber); cursor: pointer; }
.cam-snap:active { transform: scale(.94); }
.cam-err { flex: 1 1 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px 20px; text-align: center; }
.cam-err p { max-width: 34ch; font-size: 1rem; line-height: 1.6; }
dialog.cam :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
dialog.cam [hidden] { display: none !important; }
/* v0.12.2: ตัวแสดงเอกสารในหน้าเว็บ (PDF/รูป) — เต็มจอ พื้นเข้มเหมือนกล้องถ่ายเอกสาร เลื่อนดูได้ทั้งแนวตั้งและแนวนอนภายในพื้นที่เอกสารเท่านั้น */
dialog.viewer { position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; border-radius: 0; background: #0b2233; color: #fff; overflow: hidden; }
dialog.viewer[open] { display: flex; flex-direction: column; }
dialog.viewer::backdrop { background: #0b2233; }
.viewer-bar { flex: none; display: flex; align-items: center; gap: 8px; min-width: 0; padding: calc(8px + env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 8px max(12px, env(safe-area-inset-left)); }
.viewer-name { flex: 1 1 auto; min-width: 0; margin: 0; font: 500 1rem/1.3 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer-tools { flex: none; display: flex; gap: 6px; }
.viewer-b { appearance: none; width: 44px; height: 44px; padding: 0; border: 1.5px solid rgb(255 255 255 / .45); border-radius: 50%; background: transparent; color: #fff; font: 500 1.375rem/1 var(--display); cursor: pointer; }
.viewer-b.x { background: #fff; border-color: #fff; color: var(--ink); }
.viewer-b:disabled { opacity: .35; cursor: default; }
.viewer-body { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 12px 0; text-align: center; background: #000; }
.viewer-page { display: block; margin: 0 auto 12px; background: #fff; color: var(--ink); }
.viewer-page canvas { display: block; width: 100%; height: 100%; }
.viewer-imgbox { position: relative; margin: 0 auto; }
.viewer-img { position: absolute; left: 50%; top: 50%; max-width: none; background: #fff; transform-origin: center; }
.viewer-msg { max-width: 36ch; margin: 24px auto; padding: 0 16px; font-size: 1rem; line-height: 1.6; color: #fff; }
.viewer-foot { flex: none; display: flex; justify-content: center; padding: 6px 16px calc(8px + env(safe-area-inset-bottom)); }
.viewer-direct { display: inline-flex; align-items: center; min-height: 44px; color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.viewer-live { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
dialog.viewer :focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
/* มือถือถือแนวนอน: ย้ายปุ่มไปไว้ด้านข้าง ให้ภาพจากกล้องได้ความสูงเต็มจอ (กรอบบัตรใหญ่ขึ้นและได้รูปละเอียดกว่า) */
@media (orientation: landscape) and (max-height: 540px) {
  dialog.cam[open] { flex-direction: row; }
  .cam-view { margin-top: 0; margin-left: env(safe-area-inset-left); }
  .cam-side { width: min(44%, 320px); justify-content: center; overflow-y: auto; padding-right: env(safe-area-inset-right); }
  .cam-shapes { flex-wrap: wrap; }
  .cam-bar { display: flex; flex-wrap: wrap; justify-content: center; min-height: 0; }
}

.steph { display: flex; align-items: center; gap: 10px; margin-top: 10px; padding-top: 16px; border-top: 1px solid var(--line); }
.card > h1 + .steph, .card > p + .steph { margin-top: 4px; }
.steph > span { flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; font: 600 .9375rem/1 var(--display); }
.signbox .lbl { font-weight: 600; font-size: .9375rem; }
.signpad { display: block; width: 100%; max-width: 640px; aspect-ratio: 640 / 220; height: auto; background: #fff; border: 1.5px dashed var(--line-2); border-radius: var(--r-s); touch-action: none; cursor: crosshair; }
.signimg { max-width: 100%; height: auto; background: #fff; border: 1px solid var(--line); border-radius: var(--r-s); }
.bedate-row { display: grid; grid-template-columns: minmax(74px, .7fr) minmax(0, 1.6fr) minmax(96px, 1fr); gap: 8px; }
.bedate-row select { min-width: 0; }
/* จอแคบ: ชื่อเดือนภาษาไทยยาว ให้วันกับเดือนอยู่แถวบน ปีอยู่แถวล่าง ไม่อย่างนั้นช่องเดือนเหลือที่ให้ตัวอักษรตัวเดียว */
@media (max-width: 399px) { .bedate-row { grid-template-columns: minmax(74px, .6fr) minmax(0, 1.4fr); } .bedate-row > :nth-child(3) { grid-column: 1 / -1; } }
.upload-msg:empty { display: none; }
.upload-msg { font-size: .9375rem; font-weight: 600; }
.upload-msg.bad { color: var(--bad); }

/* ---------- หน้าแรก ---------- */
.hero { background: var(--card); }
.hero-in { max-width: 1080px; margin: 0 auto; padding: 28px var(--pad) 0; display: grid; gap: 28px; }
.hero-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero h1 { font-size: 2rem; font-weight: 600; line-height: 1.35; }
.hero h1::after { width: 56px; height: 5px; margin-top: 12px; }
.hero-copy > p { color: var(--ink-2); max-width: 34em; }
.hero-act { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.hero-act .btn { flex: 1 1 100%; min-height: 54px; font-size: 1.0625rem; }
.hero-tickets { display: flex; flex-direction: column; gap: 12px; min-width: 0; background: var(--paper); margin: 0 calc(-1 * var(--pad)); padding: 24px var(--pad) 28px; }
.band { background: var(--card); }
.band h2 { font-size: 1.3125rem; }
.band h2::after { content: ""; display: block; width: 44px; height: 4px; border-radius: 2px; background: var(--amber); margin-top: 8px; }
.band-in { max-width: 1080px; margin: 0 auto; padding: 36px var(--pad); display: flex; flex-direction: column; gap: 18px; }
.band-in.two { display: grid; gap: 32px; }
.band-in.two > div { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.band.alt { background: var(--paper); }
.how { margin: 0; padding: 0; list-style: none; counter-reset: how; display: flex; flex-direction: column; gap: 12px; }
.how li { counter-increment: how; display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: 12px; color: var(--ink-2); }
.how li::before { content: counter(how); grid-row: span 2; width: 32px; height: 32px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font: 500 .9375rem/1 var(--display); }
.how li b { color: var(--ink); display: block; }
.marks { margin: 0; display: grid; gap: 16px; }
.marks > div { display: flex; flex-direction: column; gap: 4px; }
.marks dd { margin: 0; color: var(--ink-2); }
.foot { background: linear-gradient(296deg, #216da6, #1a7f7b); }
.foot .band-in { flex-direction: row; flex-wrap: wrap; gap: 8px 20px; padding-top: 22px; padding-bottom: 30px; font-size: .9375rem; }
.foot a { color: #fff; }
.foot .ver { margin: 0 0 0 auto; color: #fff; }
.ver { margin: 8px 0 0; text-align: center; font-size: .8125rem; color: var(--ink-2); }
.foot a:focus-visible { outline-color: #fff; }
.prose { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 20px var(--pad); display: flex; flex-direction: column; gap: 12px; }
.prose p { white-space: pre-wrap; max-width: 68ch; }

/* ---------- แอดมิน ---------- */
/* Admin Console: ส่วนหัวสีน้ำเงินเข้ม (โลโก้ชุด on-dark) แยกจากพื้นที่ผู้ใช้
   จอกว้าง (1024px ขึ้นไป) = แถบข้างค้างอยู่ด้านซ้าย, จอแคบ = แถบเดียว (ปุ่มเมนู + ชื่อหน้า) เปิดลิ้นชักเมนู
   เมนูในแถบข้างและในลิ้นชักใช้สไตล์ชุดเดียวกัน (.amenu) */
.top.adm { background: var(--ink); color: #fff; border-bottom-color: var(--ink); }
.top.adm::before { background: var(--amber); }
.top.adm .top-in { max-width: none; }
.adm-tag { display: none; flex: none; padding: 3px 10px; border: 1px solid rgb(255 255 255 / .4); border-radius: 999px; color: #fff; font: 500 .8125rem/1.3 var(--display); white-space: nowrap; }
.adm-search { display: none; }
.adm-exit { display: none; align-items: center; gap: 4px; min-height: 40px; padding: 6px 14px 6px 8px; border: 1.5px solid rgb(255 255 255 / .4); border-radius: 999px; color: #fff; text-decoration: none; font: 500 .875rem/1.3 var(--display); white-space: nowrap; }
.adm-exit .ic { width: 18px; height: 18px; }
.adm-exit:hover, .top.adm .bell:hover { background: rgb(255 255 255 / .12); }
.top.adm .bell { color: #fff; }
.top.adm .acct-btn { background: transparent; border-color: rgb(255 255 255 / .4); color: #fff; }
.top.adm .acct-btn[aria-expanded="true"] { border-color: #fff; }
.top.adm .brand:focus-visible, .top.adm .top-act > a:focus-visible, .top.adm .acct-btn:focus-visible { outline-color: #fff; }
@media (min-width: 480px) { .adm-tag { display: inline-block; } }
.adm-main { min-width: 0; }
.adm-side { display: none; }
.cnt { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--ink); font: 600 .75rem/20px var(--display); text-align: center; }
.amenu { display: flex; flex-direction: column; }
.amenu ul { list-style: none; margin: 0; padding: 0; }
.amenu h3 { display: flex; align-items: center; gap: 8px; margin: 14px 0 2px; padding: 0 8px; font: 500 .8125rem/1.3 var(--display); color: var(--ink-2); }
.amenu h3 .ic { flex: none; width: 18px; height: 18px; color: var(--brand); }
.amenu a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; padding: 8px 10px 8px 34px; border-radius: 10px; color: var(--ink); text-decoration: none; font: 400 1rem/1.35 var(--display); }
.amenu a:hover { background: var(--brand-soft); }
.amenu a.on { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.amenu-solo { margin-top: 10px; }
.amenu-solo a { justify-content: flex-start; gap: 8px; padding-left: 8px; font-weight: 500; }
.amenu-solo a .ic { flex: none; width: 18px; height: 18px; color: var(--brand); }
.amenu-solo a .cnt { margin-left: auto; }
.amenu > :last-child { margin-bottom: 14px; }
.amenu-exit { display: flex; align-items: center; gap: 6px; min-height: 48px; margin: auto -10px 0; padding: 8px 18px; border-top: 1px solid var(--line); background: var(--card); color: var(--brand-2); text-decoration: none; font: 400 1rem/1.35 var(--display); }
.amenu-exit:hover { background: var(--brand-soft); }
.amenu-exit .ic { flex: none; width: 20px; height: 20px; }
.anav { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); }
.anav-m { display: flex; align-items: center; gap: 2px; min-height: 52px; padding: 1px 12px 1px 2px; }
.anav-open, .adrawer-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--brand); cursor: pointer; }
.anav-open:hover, .adrawer-x:hover { background: var(--brand-soft); }
.anav-w { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.anav-w small { font: 500 .6875rem/1.3 var(--display); color: var(--ink-2); }
.anav-title { min-width: 0; font: 500 1.0625rem/1.35 var(--display); color: var(--brand); }
a.anav-title { display: flex; align-items: center; gap: 2px; min-height: 30px; margin-left: -6px; text-decoration: none; }
a.anav-title .ic { flex: none; width: 20px; height: 20px; }
.adrawer { position: fixed; inset: 0 auto 0 0; width: min(88vw, 320px); height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--card); color: var(--ink); overflow: hidden auto; overscroll-behavior: contain; border-radius: 0 var(--r) var(--r) 0; box-shadow: 8px 0 28px rgb(16 50 76 / .16); }
.adrawer::backdrop { background: rgb(16 50 76 / .42); }
/* เบราว์เซอร์ที่ยังไม่รู้จัก <dialog> จะไม่ซ่อนให้เอง */
.adrawer:not([open]) { display: none; }
.adrawer-in { display: flex; flex-direction: column; min-height: 100%; padding: 0 10px env(safe-area-inset-bottom) calc(10px + env(safe-area-inset-left)); }
.adrawer-top { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; margin: 0 -10px; padding: env(safe-area-inset-top) 6px 0 18px; background: var(--ink); color: #fff; }
.adrawer-top h2 { font-size: 1rem; color: #fff; }
.adrawer-top .adrawer-x { color: #fff; }
.adrawer-top .adrawer-x:hover { background: rgb(255 255 255 / .12); }
.adrawer-top .adrawer-x:focus-visible { outline-color: #fff; }
html.noscroll { overflow: hidden; }
body.ws main { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: .9375rem; color: var(--ink-2); }
.crumbs li + li::before { content: "›"; margin-right: 6px; color: var(--line-2); }
.crumbs [aria-current] { color: var(--ink); }
@media (max-width: 1023.98px) {
  /* ชื่อหน้าอยู่บนแถบแล้ว จึงซ่อนหัวเรื่องซ้ำจากสายตา (โปรแกรมอ่านหน้าจอยังอ่านได้) และใช้ลิงก์กลับบนแถบแทน breadcrumb */
  .anav.exact ~ h1, .anav.exact ~ .phead h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .anav ~ .crumbs { display: none; }
  html:not(.js) .anav-open, html:not(.js) .adrawer-top { display: none; }
  html:not(.js) .adrawer { display: block; position: static; width: auto; height: auto; box-shadow: none; border-top: 1px solid var(--line); border-radius: 0 0 var(--r-s) var(--r-s); }
}
@media (min-width: 1024px) {
  .adm-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); align-items: start; }
  .adm-side { display: flex; flex-direction: column; position: sticky; top: var(--top-h); height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); padding: 2px 10px 0; background: var(--card); border-right: 1px solid var(--line); overflow: hidden auto; overscroll-behavior: contain; }
  .adm-side .amenu a { min-height: 36px; padding-top: 5px; padding-bottom: 5px; font-size: .9375rem; }
  .adm-side .amenu h3 { margin-top: 12px; }
  .adm-side .amenu-solo { margin-top: 8px; }
  /* แถบข้างทำหน้าที่แทนแถบชื่อหน้าและลิ้นชักของจอแคบ */
  .anav { display: none; }
  body.adm main.wide { max-width: 1160px; padding-left: 32px; padding-right: 32px; }
  body.adm .flash { max-width: 1096px; width: calc(100% - 64px); }
  .adm-exit { display: inline-flex; }
  .adm-search { display: flex; align-items: center; gap: 8px; flex: 0 1 400px; min-width: 0; margin-left: 20px; padding: 0 14px; min-height: 40px; border: 1px solid rgb(255 255 255 / .28); border-radius: 999px; background: rgb(255 255 255 / .1); color: #fff; }
  .adm-search:focus-within { background: #fff; color: var(--ink); border-color: #fff; outline: 3px solid var(--amber); outline-offset: 2px; }
  .adm-search .ic { flex: none; width: 18px; height: 18px; }
  .adm-search input { flex: 1; min-width: 0; height: 38px; min-height: 0; padding: 0; border: 0; border-radius: 0; outline: 0; box-shadow: none; background: none; color: inherit; font: 400 .9375rem/1.3 var(--body); }
  .adm-search input::placeholder { color: rgb(255 255 255 / .78); opacity: 1; }
  .adm-search:focus-within input::placeholder { color: var(--ink-2); }
}
@media (prefers-reduced-motion: no-preference) {
  .adrawer[open] { animation: adrawer-in .18s ease-out; }
  .adrawer[open]::backdrop { animation: fade-in .18s ease-out; }
  .adrawer[data-closing] { animation: adrawer-out .16s ease-in forwards; }
  .adrawer[data-closing]::backdrop { animation: fade-out .16s ease-in forwards; }
}
@keyframes anav-in { from { opacity: 0; transform: translateY(-4px); } }
@keyframes adrawer-in { from { transform: translateX(-100%); } }
@keyframes adrawer-out { to { transform: translateX(-100%); } }
/* หัวหน้า: ชื่อหน้า + ปุ่มหลักของหน้า */
.phead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.phead > div { flex: 1 1 260px; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.phead .btn { gap: 6px; }
.phead .btn .ic { width: 18px; height: 18px; }
.row-act { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.dim { color: var(--ink-2); font-weight: 400; }
/* ข้อมูลหลัก: หน้ารวมชุดข้อมูล (การ์ดจัดกลุ่ม) และตารางรายการ (จอแคบแสดงเป็นการ์ดต่อรายการ) */
.mfind { max-width: 420px; }
.mcards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 232px), 1fr)); gap: 10px; }
.mcards a { display: flex; flex-direction: column; gap: 2px; height: 100%; min-height: 72px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.mcards a:hover { border-color: var(--brand); }
.mcards b { font: 500 1rem/1.4 var(--display); }
.mcards span { font-size: .875rem; color: var(--ink-2); }
.mcards i { font-style: normal; }
.mbar { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; align-items: end; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); }
.mbar a.link { align-self: center; padding: 8px 4px; white-space: nowrap; }
@media (min-width: 720px) { .mbar { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) auto auto; } }
.mtbl-wrap { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.mtbl { width: 100%; border-collapse: collapse; }
.mtbl th, .mtbl td { padding: 10px 14px; text-align: left; vertical-align: middle; border-top: 1px solid var(--line); font-weight: 400; }
.mtbl thead th { border-top: 0; background: var(--paper); color: var(--ink-2); font: 500 .8125rem/1.4 var(--display); white-space: nowrap; }
.mtbl tbody th { font-weight: 600; }
.mtbl .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mtbl code, .medit code { font: 400 .8125rem/1.4 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--paper); padding: 2px 6px; border-radius: 6px; overflow-wrap: anywhere; }
.mtbl .act { text-align: right; white-space: nowrap; }
.mtbl .act form { display: inline; margin: 0; }
.mtbl .act > * + * { margin-left: 6px; }
.mtbl tr.off th { color: var(--ink-2); }
@media (min-width: 720px) { .mtbl th, .mtbl td { padding: 7px 14px; } .mtbl .btn.sm { min-height: 34px; padding: 4px 14px; font-size: .875rem; } }
@media (max-width: 719.98px) {
  .mtbl, .mtbl tbody { display: block; }
  .mtbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .mtbl tr { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 12px 14px; border-top: 1px solid var(--line); }
  .mtbl tbody tr:first-child { border-top: 0; }
  .mtbl th, .mtbl td { display: block; padding: 0; border: 0; }
  .mtbl tbody th { flex: 1 1 100%; font-size: 1rem; }
  .mtbl td[data-l]::before { content: attr(data-l) " "; margin-right: 4px; color: var(--ink-2); font-size: .8125rem; font-weight: 400; }
  .mtbl td.num { text-align: left; }
  .mtbl td.act { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; text-align: left; }
  .mtbl .act > * + * { margin-left: 0; }
}
/* รายการทางเข้า (หน้ารวมตั้งค่าส่วนตัว): ทั้งแถวกดได้ */
.rows.nav > li { padding: 0; }
.rows.nav > li > a:first-child { flex: 1 1 auto; flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 12px 14px; }
.rows.nav > li > a > div { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.rows.nav > li > a:hover { background: var(--paper); }
.rows.nav .ic { flex: none; width: 18px; height: 18px; color: var(--line-2); }
/* แถบทางเข้าที่วางในหน้าฟอร์ม (เช่น ยืนยันวุฒิเฉพาะทาง ในหน้าข้อมูลวิชาชีพ): เห็นได้ทันทีโดยไม่ต้องกางส่วนที่พับ */
.rows.nav.plink > li > a:first-child { background: var(--brand-soft); border-radius: inherit; }
.rows.nav.plink > li > a > div { flex: 1 1 auto; }
.rows.nav.plink .badge { flex: none; }
.rows.nav.plink .ic { color: var(--brand); }
@keyframes fade-in { from { opacity: 0; } }
@keyframes fade-out { to { opacity: 0; } }
/* แท็บย่อยภายในหน้า (รายงาน: รอพิจารณา/ตัดสินแล้ว, ข้อมูลหลัก: ชุดข้อมูล) */
.adminnav { display: flex; flex-wrap: wrap; gap: 6px; }
.adminnav a { padding: 7px 16px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--ink); background: var(--card); font: 400 .9375rem/1.3 var(--display); min-height: 40px; display: inline-flex; align-items: center; }
.adminnav a.on { background: var(--ink); color: #fff; border-color: var(--ink); font-weight: 500; }
.adminnav.sub a.on { background: var(--brand); border-color: var(--brand); }
/* การ์ดตัวเลขสรุปในหน้าภาพรวม: ตัวเลขเด่น ป้ายชื่อตัดบรรทัดได้ */
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.stats > li > * { position: relative; display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 2px; height: 100%; padding: 10px 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink); text-decoration: none; }
.stat-n { font: 600 1.5rem/1.25 var(--display); color: var(--brand); font-variant-numeric: tabular-nums; }
.stat-l { font-size: .875rem; line-height: 1.45; color: var(--ink-2); }
.stats a::after { content: "›"; position: absolute; top: 8px; right: 12px; font: 400 1.125rem/1.25 var(--body); color: var(--line-2); }
.stats a:hover { border-color: var(--brand); }
.stats a:hover::after { color: var(--brand); }
.stats .due > * { background: var(--amber-soft); border-color: var(--amber); }
.stats .due .stat-n, .stats .due .stat-l { color: var(--ink); }
.stats .due a::after { color: var(--ink); }
@media (min-width: 560px) { .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.log .pre { font-size: .8125rem; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); z-index: 30; max-width: calc(100% - 32px); }

/* ---------- จอกว้าง ---------- */
@media (min-width: 720px) {
  :root { --pad: 24px; }
  h1 { font-size: 1.75rem; }
  .hero h1 { font-size: 2.75rem; }
  .hero-in { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; padding-top: 52px; padding-bottom: 56px; gap: 48px; }
  .hero-act .btn { flex: 0 1 auto; }
  .hero-tickets { margin: 0; padding: 24px; border-radius: 28px; }
  .band-in.two { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
  .marks { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 40px; }
  .split { display: grid; grid-template-columns: 300px minmax(0, 1fr); align-items: start; gap: 24px; }
  .split.even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* หน้าตรวจเอกสาร: ลำดับใน HTML คือ ข้อมูล → เอกสาร → ผลการตรวจ (ลำดับที่จอแคบใช้) จอกว้างวางเอกสารไว้คอลัมน์ขวาตลอดความสูง */
  .split.vsplit { grid-template-rows: auto 1fr; grid-template-areas: "info docs" "act docs"; }
  .vsplit > .v-info { grid-area: info; }
  .vsplit > .v-docs { grid-area: docs; }
  .vsplit > .v-act { grid-area: act; }
  .split .filters { position: sticky; top: 78px; }
}
@media (min-width: 900px) {
  body.has-nav { padding-bottom: 0; }
  .bottom { display: none; }
  .top-nav { display: flex; gap: 4px; margin-left: 20px; }
  .top-nav a { display: flex; align-items: center; gap: 6px; color: var(--ink); text-decoration: none; padding: 8px 14px; border-radius: 999px; font: 400 .9375rem/1.3 var(--display); white-space: nowrap; }
  .top-nav a .ic { width: 20px; height: 20px; }
  .top-nav a.on { color: var(--brand); background: var(--brand-soft); font-weight: 500; }
  .toast { bottom: 20px; }
}
@media (max-width: 419px) { .pill-link span { display: none; } }
/* จอกว้างช่วงแคบ (900–1079px): ย่อระยะเมนูบนไม่ให้ข้อความตัดกลางคำ */
@media (min-width: 900px) and (max-width: 1079px) { .top-nav { gap: 0; margin-left: 8px; } .top-nav a { padding: 8px 9px; gap: 5px; } .top-in { gap: 8px; } }
/* เมนูบัญชีที่แถบบน: โปรไฟล์ ตั้งค่าส่วนตัว บัญชีและความปลอดภัย ทางเข้า Admin Console (เฉพาะผู้มีสิทธิ์) ออกจากระบบ */
.acct { position: relative; }
.acct-btn { display: flex; align-items: center; gap: 2px; min-height: 44px; padding: 3px 6px 3px 3px; border: 1.5px solid var(--line-2); border-radius: 999px; background: var(--card); color: var(--brand); cursor: pointer; }
.acct-btn .chev { width: 16px; height: 16px; }
.acct-btn[aria-expanded="true"] { border-color: var(--brand); }
.acct-btn[aria-expanded="true"] .chev { transform: rotate(180deg); }
.av { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand); }
.av .ic { width: 20px; height: 20px; }
.av.lg { width: 44px; height: 44px; }
.acct-dd { display: none; position: absolute; top: calc(100% + 8px); right: 0; z-index: 25; width: min(320px, calc(100vw - 24px)); max-height: calc(100vh - var(--top-h) - 16px); max-height: calc(100dvh - var(--top-h) - 16px); overflow: hidden auto; padding: 6px; background: var(--card); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r-s); box-shadow: 0 10px 28px rgb(16 50 76 / .13); }
.acct.open .acct-dd, html:not(.js) .acct:focus-within .acct-dd { display: block; }
.acct-who { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; padding: 10px 10px 12px; border-bottom: 1px solid var(--line); }
.acct-who > div { min-width: 0; display: flex; flex-direction: column; }
.acct-who b { font: 500 1rem/1.35 var(--display); }
.acct-who > div > span { font-size: .8125rem; line-height: 1.45; color: var(--ink-2); }
.acct-dd ul { list-style: none; margin: 0; padding: 0; }
.acct-dd form { margin: 0; }
.acct-h { margin: 6px 0 0; padding: 8px 12px 2px; border-top: 1px solid var(--line); font: 400 .8125rem/1.3 var(--body); color: var(--ink-2); }
.acct-sep { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.acct-it { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 44px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--ink); font: 400 .9375rem/1.35 var(--display); text-align: left; text-decoration: none; cursor: pointer; }
.acct-it:hover { background: var(--brand-soft); }
.acct-it > .ic { flex: none; width: 20px; height: 20px; color: var(--ink-2); }
.acct-it > span { flex: 1; min-width: 0; }
.acct-it > .go { width: 18px; height: 18px; color: var(--line-2); }
.acct-it.on { color: var(--brand); font-weight: 500; }
.acct-it.on > .ic, .acct-it.on > .go { color: var(--brand); }
.acct-it.door { padding: 10px; background: var(--brand-soft); }
.acct-it.door:hover { box-shadow: inset 0 0 0 1.5px var(--brand); }
.acct-it.door > .ic, .acct-it.door > .go { color: var(--brand); }
.acct-it.door b { display: block; font-weight: 500; }
.acct-it.door small { display: block; font: 400 .8125rem/1.45 var(--body); color: var(--ink-2); }
@media (prefers-reduced-motion: no-preference) { .acct-btn .chev { transition: transform .15s ease; } .acct.open .acct-dd { animation: anav-in .14s ease-out; } }
@media (max-width: 359px) {
  .acct-btn { padding: 3px; }
  .acct-btn .chev { display: none; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 1.75rem; }
  .top-in { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .top .btn.sm { padding: 6px 12px; }
}
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: background-color .15s, border-color .15s, transform .05s; }
  .flash { animation: drop .25s ease-out; }
  @keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
}
@media print { .top, .bottom, .statusbar, .btn { display: none !important; } body { background: #fff; } }

/* ================= v0.2: แผนที่งาน ================= */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
body.mappage { overflow: hidden; padding-bottom: 0; }
body.mappage main { display: block; }
.mapwrap { position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--top-h) - var(--nav-h)); height: calc(100dvh - var(--top-h) - var(--nav-h) - env(safe-area-inset-bottom)); }
.mapbar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--line); z-index: 7; position: relative; }
.mapbar > select { flex: 1 1 0; min-width: 0; min-height: 40px; border-radius: 999px; padding: 6px 28px 6px 12px; font-size: max(16px, .9375rem); text-overflow: ellipsis; background-position: calc(100% - 15px) 17px, calc(100% - 9px) 17px; }
.mapbar .btn { flex: none; padding: 6px 12px; position: relative; }
.mapbar .btn .ic { width: 20px; height: 20px; }
.mapbar .btn b { position: absolute; top: -6px; right: -6px; background: var(--amber); color: var(--ink); border-radius: 9px; min-width: 18px; padding: 2px 4px; font: 600 .6875rem/1 var(--body); }
.mapstage { position: relative; flex: 1 1 0; min-height: 0; }
#map { position: absolute; inset: 0; z-index: 0; background: #dde5ec; font: inherit; }
#searcharea { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; box-shadow: 0 2px 8px rgb(16 50 76 / .3); white-space: nowrap; }
.mapnote { position: absolute; left: 10px; top: 10px; max-width: calc(100% - 70px); z-index: 4; background: var(--card); padding: 6px 10px; border-radius: 8px; font-size: .875rem; box-shadow: 0 1px 4px rgb(16 50 76 / .25); }
.mapnote:empty { display: none; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 6; background: var(--card); border: 1px solid var(--line); border-bottom: 0; border-radius: 24px 24px 0 0; display: flex; flex-direction: column; box-shadow: 0 -2px 10px rgb(16 50 76 / .12); }
.sheet[data-state="collapsed"] { height: 60px; }
.sheet[data-state="half"] { height: 46%; }
.sheet[data-state="full"] { height: calc(100% - 58px); }
.sheet-handle { appearance: none; border: 0; background: none; font: inherit; color: inherit; width: 100%; padding: 8px 14px 10px; display: grid; grid-template-columns: 1fr auto; row-gap: 4px; align-items: center; text-align: left; cursor: grab; touch-action: none; flex: none; }
.sheet-handle i { grid-column: 1 / -1; justify-self: center; width: 40px; height: 4px; border-radius: 2px; background: var(--line-2); }
.sheet-handle span { font: 500 1rem/1.3 var(--display); }
.sheet-handle em { font-style: normal; font-size: .8125rem; color: var(--ink-2); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px 10px; flex: none; }
.sheet-head > div { display: flex; flex-direction: column; min-width: 0; }
.sheet-head span { font-size: .8125rem; color: var(--ink-2); }
.sheet-head[hidden] { display: none; }
.sheet-body { flex: 1 1 0; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; padding: 2px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.sheet-body > * { flex: none; }
.sheet[data-state="collapsed"] .sheet-body, .sheet[data-state="collapsed"] .sheet-head { display: none; }
/* กล่องชวนลงทะเบียนในแถบรายการของแผนที่ (หน้าแรกของผู้ที่ยังไม่เข้าสู่ระบบ) */
.sheet-join { gap: 6px; }
.sheet-join strong { font: 500 1rem/1.35 var(--display); color: var(--ink); }
.sheet-join p { margin: 0; }
.sheet-join .row { margin-top: 2px; }
.sheet-join .sheet-join-links { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .8125rem; line-height: 1.5; }
.sheet-join .sheet-join-links a { color: var(--ink-2); }
.pin { background: var(--brand); color: #fff; border: 2.5px solid #fff; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 1px 5px rgb(0 0 0 / .4); }
.pin b { font: 600 .875rem/1 var(--display); }
.pin.on { background: var(--amber); color: var(--ink); }
.pin.approx { border-style: dashed; }
.pin.many { background: var(--ink); border-color: var(--amber); }
.pin.many b { font-size: 1rem; }
.pin.one { background: none; border: 0; box-shadow: none; }
.pin.one b { display: block; width: 28px; height: 28px; background: var(--amber); border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); box-shadow: 0 1px 5px rgb(0 0 0 / .45); }
.radius-ring { stroke: var(--brand); stroke-width: 2; fill: var(--brand); fill-opacity: .07; }
.me-dot { stroke: #fff; stroke-width: 3; fill: #1d6fd8; fill-opacity: 1; }
.me-halo { stroke: none; fill: #1d6fd8; fill-opacity: .2; }
.pinmap { height: 320px; border-radius: 16px; border: 1px solid var(--line); z-index: 0; position: relative; }
.leaflet-container { font-family: var(--body); }
.leaflet-control-attribution { font-size: .6875rem; }
dialog { border: 0; padding: 0; border-radius: 24px; width: min(480px, calc(100% - 24px)); max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px); color: inherit; background: var(--card); }
dialog::backdrop { background: rgb(16 50 76 / .5); }
.dialog-in { padding: 20px 16px; display: flex; flex-direction: column; gap: 14px; }
/* หน้าต่างที่เนื้อหายาวกว่าจอ (ตัวกรองแผนที่บนมือถือ): หัวข้อพร้อมปุ่มปิด และแถวปุ่มด้านล่าง ติดอยู่กับขอบหน้าต่างระหว่างเลื่อน ปุ่ม "ดูผลลัพธ์" จึงกดได้เสมอ */
.dialog-top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: -20px -16px 0; padding: 8px 8px 8px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.dialog-x { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: none; color: var(--brand); cursor: pointer; }
.dialog-x:hover { background: var(--brand-soft); }
.dialog-act { position: sticky; bottom: 0; z-index: 2; margin: 0 -16px -20px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--line); }
dialog:has(.dialog-top) { scroll-padding: 68px 0 84px; }
/* v0.13.1: กล่องการแจ้งเตือนจากกระดิ่ง — มือถือ = แผ่นเลื่อนขึ้นจากด้านล่าง, จอกว้าง = กล่องใต้กระดิ่ง */
dialog.notipop { position: fixed; inset: auto 0 0 0; width: 100%; max-width: none; max-height: 82vh; max-height: 82dvh; margin: 0; border-radius: 24px 24px 0 0; display: none; flex-direction: column; overflow: hidden; }
dialog.notipop[open] { display: flex; }
dialog.notipop::backdrop { background: rgb(16 50 76 / .4); }
.notipop-top { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); }
.notipop-top h2 { margin: 0; font-size: 1.125rem; }
.notipop-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
.notipop-body .notis { margin: 0; border-radius: 0; box-shadow: none; border: 0; }
.notipop-body .notis > li { padding: 0; }
.notipop-body .notis li > a, .notipop-body .notis li > div { padding: 10px 16px; gap: 1px; }
.notipop-body .notis p, .notipop-body .notis b { margin: 0; line-height: 1.45; }
.notipop-msg { margin: 16px; }
.notipop-foot { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  dialog.notipop { inset: var(--noti-top, 72px) var(--noti-right, 16px) auto auto; width: 400px; max-height: min(560px, calc(100vh - var(--noti-top, 72px) - 16px)); border-radius: var(--r); box-shadow: 0 18px 48px rgb(16 50 76 / .22); }
  dialog.notipop::backdrop { background: transparent; }
}
/* ป้ายแนะนำเมื่อเปิดเว็บครั้งแรก และหน้า "วิธีใช้งาน" (เนื้อหาเดียวกัน) */
dialog.intro:not([open]) { display: none; }
dialog.intro { width: min(520px, calc(100% - 24px)); }
.intro .intro-lead { margin: 0; color: var(--ink-2); }
.intro .intro-sec { display: flex; flex-direction: column; gap: 10px; }
.intro .intro-sec > p { margin: 0; }
.intro h3, .intro h4 { margin: 0; }
dialog.intro h3 { font-size: 1.0625rem; }
.intro h4, .card.intro h3 { font-size: .9375rem; color: var(--ink-2); font-weight: 600; }
.intro .how { gap: 10px; }
.intro .how li { align-items: center; min-height: 32px; }
.card.intro { display: flex; flex-direction: column; gap: 16px; }
.card.intro > h1 { margin: 0; }
.card.intro h2 { margin: 0; }
/* จอมือถือ: ให้ช่องจังหวัดกว้างพอแสดงคำว่า "ทั่วประเทศ" ครบ โดยย่อปุ่มข้าง ๆ ก่อน */
@media (max-width: 459px) { .mapbar { gap: 6px; padding-left: 10px; padding-right: 10px; } .mapbar .btn { padding: 6px 10px; gap: 5px; } }
@media (max-width: 409px) { .mapbar #nearme span { display: none; } }
@media (max-width: 359px) { .mapbar .btn span { display: none; } }
@media (min-width: 720px) {
  .mapwrap { display: grid; grid-template-columns: minmax(0, 1fr) 380px; grid-template-rows: auto minmax(0, 1fr); }
  .mapbar { grid-column: 1 / -1; padding: 8px 24px; }
  .mapbar > select { flex: 0 1 260px; }
  .mapstage { grid-column: 1; grid-row: 2; }
  .sheet, .sheet[data-state] { position: static; grid-column: 2; grid-row: 2; height: auto; border-radius: 0; border: 0; border-left: 1px solid var(--line); box-shadow: none; min-height: 0; }
  .sheet[data-state="collapsed"] .sheet-body { display: flex; }
  .sheet[data-state="collapsed"] .sheet-head:not([hidden]) { display: flex; }
  .sheet-handle { cursor: default; padding-top: 14px; }
  .sheet-handle i, .sheet-handle em { display: none; }
}
/* ผู้ที่ยังไม่เข้าสู่ระบบไม่มีแถบเมนูล่าง: แผนที่ใช้พื้นที่ถึงขอบจอ (ไม่เหลือแถบว่างใต้แผนที่ของหน้าแรก) */
body.mappage:not(.has-nav) .mapwrap { height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h) - env(safe-area-inset-bottom)); }
@media (min-width: 900px) { .mapwrap, body.mappage:not(.has-nav) .mapwrap { height: calc(100vh - var(--top-h)); height: calc(100dvh - var(--top-h)); } }
@media (prefers-reduced-motion: no-preference) { .sheet { transition: height .22s ease; } .sheet.dragging { transition: none; } }

/* ================= v0.2: ปฏิทิน ================= */
.calsplit { align-items: start; }
.cal { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cal-nav h2 { text-align: center; flex: 1 1 0; color: var(--ink); }
.cal-nav .btn { padding: 6px 10px; }
.flip .ic { transform: rotate(180deg); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { text-align: center; font-size: .75rem; color: var(--ink-2); padding: 2px 0 4px; }
.cal-cell { min-height: 50px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; text-decoration: none; color: var(--ink); background: var(--paper); border: 1.5px solid transparent; }
.cal-cell.off { background: none; }
.cal-cell b { font: 500 .9375rem/1 var(--display); font-variant-numeric: tabular-nums; }
.cal-cell.today b { background: var(--ink); color: #fff; border-radius: 999px; padding: 4px 7px; }
.cal-cell.sel { border-color: var(--brand); background: var(--brand-soft); }
a.cal-cell:hover { border-color: var(--line-2); }
.dots { display: flex; gap: 3px; min-height: 7px; }
.dots i, .legend i, .avrow i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; background: #9aa7b3; }
i.k-confirmed { background: var(--brand); }
i.k-selected, i.k-waiting { background: var(--amber); }
i.k-applied { background: var(--night); }
i.k-open { background: var(--ok); }
i.k-avail { background: #fff; box-shadow: inset 0 0 0 2px var(--ok); }
i.k-unavail { background: #fff; box-shadow: inset 0 0 0 2px #7d8b98; border-radius: 2px; }
i.k-completed { background: #9aa7b3; }
i.k-cancelled, i.k-unfilled { background: var(--bad); }
i.k-noshow { background: transparent; box-shadow: inset 0 0 0 2px var(--bad); }
i.k-draft { background: #fff; box-shadow: inset 0 0 0 2px var(--night); }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .75rem; color: var(--ink-2); }
.legend li { display: inline-flex; align-items: center; gap: 5px; }
#agenda { display: flex; flex-direction: column; gap: 10px; }
.avrow { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); }
.card-details { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 0 var(--pad); }
.card-details[open] { padding-bottom: 14px; }
.card-details > form { display: flex; flex-direction: column; gap: 14px; }
.card-details > summary { flex-wrap: wrap; }

/* ================= v0.2: คะแนน รีวิว ข้อความ ================= */
.scoreline { display: inline-flex; flex-wrap: wrap; gap: 4px 12px; align-items: center; }
.score b { font: 600 1.125rem/1 var(--display); }
.score i, .stars i { font-style: normal; font-size: .8125rem; color: var(--ink-2); }
.stars { color: #9a5b00; white-space: nowrap; font-weight: 600; }
.review { border-top: 1px solid var(--line); padding-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.why { font-size: .8125rem; color: var(--ok); font-weight: 600; }
.thread { display: flex; flex-direction: column; gap: 8px; }
.msg { align-self: flex-start; max-width: 88%; background: var(--card); border: 1px solid var(--line); border-radius: 12px 12px 12px 3px; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.msg.mine { align-self: flex-end; background: var(--brand-soft); border-color: var(--brand-soft); border-radius: 12px 12px 3px 12px; }
.msg span { font-size: .75rem; color: var(--ink-2); }
.bigcode { font: 600 1.75rem/1.2 var(--display); letter-spacing: .08em; font-variant-numeric: tabular-nums; }
.pinrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: var(--paper); border-radius: var(--r-s); }
.pinrow > div { flex: 1 1 180px; min-width: 0; }
.flagctl { display: flex; gap: 8px; align-items: center; flex: 0 1 300px; }
.flagctl select { min-height: 40px; padding-top: 6px; padding-bottom: 6px; background-position: calc(100% - 17px) 17px, calc(100% - 11px) 17px; }
.flagctl input { width: 76px; flex: none; min-height: 40px; padding: 6px 8px; }
.card.narrow-left { max-width: 460px; }
input[readonly] { background: var(--paper); }

/* ---------- ข้อมูลเพิ่มเติมและการรับข่าวสาร ---------- */
.pair { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 12px; }
@media (min-width: 400px) { .pair { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.consent-text { font-size: .9375rem; line-height: 1.6; padding: 10px 14px; background: var(--night-soft); border-radius: var(--r-s); overflow-wrap: anywhere; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-items: start; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.grid-2 > .card { margin: 0; }
.tbl.tally th { width: 68%; overflow-wrap: anywhere; }
.tbl.tally td { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl.tally small, .stat-l small { font-weight: 400; color: var(--ink-2); font-size: .8125rem; }
/* ชวนเพื่อนและแต้มสะสม (v0.10.0) */
.copyrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.copyrow > input { flex: 1 1 220px; min-width: 0; }
.share-act > .btn { flex: 1 1 160px; }
.refcode { font: 600 1.0625rem/1.3 var(--display); letter-spacing: .08em; white-space: nowrap; }
.pts { font: 600 1.0625rem/1.3 var(--display); font-variant-numeric: tabular-nums; color: var(--ok); white-space: nowrap; }
.pts.neg { color: var(--ink-2); }
.board { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-s); overflow: hidden; }
.board > li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); }
.board > li:first-child { border-top: 0; }
.board > li.me { background: var(--brand-soft); }
.board-r { flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center; background: var(--paper); font: 600 .9375rem/1 var(--display); font-variant-numeric: tabular-nums; }
.board > li:first-child .board-r { background: var(--amber); color: var(--ink); }
.board-n { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.board-n i { font-style: normal; font-size: .8125rem; color: var(--brand); border: 1px solid var(--brand); border-radius: 999px; padding: 0 8px; margin-left: 4px; white-space: nowrap; }
.board > li > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.invite-why { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; text-align: left; }
.invite-why > li { padding: 10px 12px; background: var(--paper); border-radius: var(--r-s); font-size: .9375rem; }
.invite-why b { display: block; }
@media (min-width: 720px) { .pstats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
/* แผนที่: สถานประกอบการที่ตรวจแล้วแต่ยังไม่มีเวรเปิดรับ (v0.10.0) — เล็กกว่าหมุดเวร ไม่มีตัวเลข และใช้สีเขียวของ "ตรวจแล้ว" */
.pin.place { background: #fff; border: 2.5px solid var(--ok); }
.pin.place b { display: block; width: 9px; height: 9px; border-radius: 2px; background: var(--ok); }
.pin.place.on { background: var(--amber); border-color: var(--ink); }
.pin.place.on b { background: var(--ink); }
.pin.many.place { background: #fff; color: var(--ok); border: 2.5px solid var(--ok); }
.pin.many.place b { width: auto; height: auto; background: none; border-radius: 0; font: 600 .8125rem/1 var(--display); }
.idle { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; }
.idle h3 { display: flex; align-items: center; gap: 8px; font-size: .9375rem; }
.idle h3 .pin { flex: none; width: 20px; height: 20px; box-shadow: none; }
.placerow { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; min-height: 48px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-s); color: var(--ink); font: inherit; cursor: pointer; }
.placerow:hover { border-color: var(--ok); }
.placerow b { overflow-wrap: anywhere; }
.placerow span { font-size: .8125rem; color: var(--ink-2); }
.placecard { display: flex; flex-direction: column; gap: 10px; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); }
.placecard dd { overflow-wrap: anywhere; }
/* ปุ่มลอยช่องทางติดตาม (v0.10.0): มุมขวาล่าง เหนือแถบเมนูของมือถือ ต่ำกว่าข้อความแจ้งอัปเดต (.toast) และหน้าต่างทุกแบบ */
.fab { position: fixed; right: max(14px, env(safe-area-inset-right)); bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 19; }
body.has-nav .fab { bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom)); }
.fab > summary { list-style: none; width: 52px; height: 52px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; cursor: pointer; box-shadow: 0 2px 10px rgb(16 50 76 / .3); border: 2px solid #fff; }
.fab > summary::-webkit-details-marker { display: none; }
.fab > summary::after, .fab[open] > summary::after { content: none; }
.fab > summary { padding: 0; min-height: 0; gap: 0; }
body.has-fab main:not(.bare) { padding-bottom: 84px; }
body.has-fab .foot { padding-bottom: 84px; }
.fab > summary:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.fab > summary .ic { width: 26px; height: 26px; }
.fab .fab-x { display: none; }
.fab[open] > summary { background: var(--ink); }
.fab[open] > summary > .ic { display: none; }
.fab[open] .fab-x { display: grid; }
.fab > ul { list-style: none; margin: 0; padding: 0; position: absolute; right: 0; bottom: calc(100% + 10px); display: flex; flex-direction: column; gap: 8px; align-items: flex-end; width: max-content; max-width: calc(100vw - 28px); }
.fab-it { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px 8px 16px; border-radius: 999px; background: var(--card); color: var(--ink); border: 1px solid var(--line); box-shadow: 0 2px 10px rgb(16 50 76 / .18); text-decoration: none; }
.fab-it > span { display: flex; flex-direction: column; min-width: 0; text-align: right; line-height: 1.3; }
.fab-it b { font: 500 .9375rem/1.3 var(--display); }
.fab-it small { font-size: .75rem; color: var(--ink-2); }
.fab-it .ic { flex: none; width: 34px; height: 34px; padding: 7px; border-radius: 50%; background: var(--ink); color: #fff; }
.fab-it.oa .ic, .fab-it.chat .ic { background: var(--line-green); }
.fab-it:hover { border-color: var(--brand); }
@media (min-width: 900px) { body.has-nav .fab { bottom: calc(16px + env(safe-area-inset-bottom)); } }
@media print { .fab { display: none; } }
details.fab, details.fab[open] { border: 0; display: block; padding: 0; }
/* จอเตี้ย (มือถือแนวนอน): รายการของปุ่มลอยเรียงไปทางซ้ายของปุ่ม จะได้ไม่ล้นขึ้นไปใต้ส่วนหัว */
@media (max-height: 460px) { .fab > ul { right: 62px; bottom: 0; flex-direction: row; flex-wrap: wrap-reverse; justify-content: flex-end; max-width: calc(100vw - 90px); } }
/* ปุ่มที่หน้าตาเป็นลิงก์ (ใช้ในข้อความ เช่น ลบการเชื่อมโยงกับผู้ชวน) */
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; cursor: pointer; min-height: 32px; text-align: left; }
.sheet-head .btn { flex: none; white-space: nowrap; }

/* ================= v0.10.2: การเคลื่อนไหว (คุณทัสเลือก 11/10/2569: เปลี่ยนหน้าแบบจางสลับเร็ว ๆ จังหวะเร็ว กระชับ ราว 0.15–0.2 วินาที) =================
   ทุกอย่างในส่วนนี้เป็นการแสดงผลล้วน ๆ ไม่เปลี่ยนโครงหน้า ลำดับ หรือการทำงาน: เบราว์เซอร์ที่ไม่รู้จักคำสั่งใดจะข้ามคำสั่งนั้นและทำงานแบบเดิม
   ผู้ที่ตั้งเครื่องไว้ว่า "ลดการเคลื่อนไหว" จะไม่เห็นการเคลื่อนไหวใดเลย (ทุกกฎอยู่ใน prefers-reduced-motion: no-preference) */
:root { --t-fast: .12s; --t: .16s; --t-slow: .2s; --ease: cubic-bezier(.2, .7, .2, 1); }
/* แก้ระยะห่างในส่วนพับ (ไม่เกี่ยวกับการเคลื่อนไหว มีผลกับทุกคน): Chrome/Edge/Android รุ่นใหม่ (131+) ห่อเนื้อหาของ <details> ไว้ในกล่อง ::details-content
   ระยะห่าง 14px ที่ตั้งไว้กับ details[open] จึงไม่ถึงช่องกรอกข้างใน ทำให้ช่องติดกัน (Safari ยังแสดงถูก) — ตั้งระยะห่างที่กล่องเนื้อหาด้วย ให้ทุกเบราว์เซอร์เหมือนกัน */
@supports selector(::details-content) {
  details:not(.fab)::details-content { display: flex; flex-direction: column; gap: 14px; }
}
@media (prefers-reduced-motion: no-preference) {
  /* 1) เปลี่ยนหน้า: หน้าเก่าจางออก หน้าใหม่จางเข้า (ไม่กะพริบขาว) แถบบน เมนูล่าง แถบข้างของ Admin Console และปุ่มลอย อยู่นิ่งระหว่างเปลี่ยนหน้า
        ใช้ได้กับ Chrome/Edge/Android 126 ขึ้นไป และ Safari/iPhone 18.2 ขึ้นไป รุ่นเก่ากว่านั้นเปลี่ยนหน้าแบบเดิม */
  @view-transition { navigation: auto; }
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation-duration: .18s; animation-timing-function: ease; }
  .top { view-transition-name: vod-top; }
  .bottom { view-transition-name: vod-bottom; }
  .adm-side { view-transition-name: vod-side; }
  .fab { view-transition-name: vod-fab; }
  /* เลื่อนภายในหน้าแบบนุ่ม — เปิดหลังหน้าโหลดเสร็จ (app.js ใส่ class) หน้าที่เปิดมาพร้อม #ตำแหน่ง จึงไปถึงจุดนั้นทันทีเหมือนเดิม ไม่ต้องรอเลื่อน */
  html.smooth { scroll-behavior: smooth; }

  /* 2) หน้าต่างป๊อปอัป (ตัวกรองแผนที่ ฯลฯ): ลอยขึ้นพร้อมจางเข้า และจางออกตอนปิด — ลิ้นชักของ Admin Console มีการเคลื่อนไหวของตัวเองอยู่แล้ว
        กล้องถ่ายเอกสารเป็นเต็มจอ จึงจางเข้าอย่างเดียว และปิดทันที (กล้องหยุดทำงานทันทีที่ปิด) */
  dialog:not(.adrawer, .cam)[open] { transition: opacity var(--t) ease, transform var(--t) var(--ease); }
  dialog:not(.adrawer, .cam)[open]::backdrop { transition: opacity var(--t) ease; }
  @starting-style {
    dialog:not(.adrawer, .cam)[open] { opacity: 0; transform: translateY(10px) scale(.985); }
    dialog:not(.adrawer, .cam)[open]::backdrop { opacity: 0; }
  }
  /* จางออกตอนปิด: เฉพาะเบราว์เซอร์ที่คงหน้าต่างไว้ชั้นบนสุดระหว่างจางได้ (overlay) — ที่อื่นปิดทันทีเหมือนเดิม ไม่เช่นนั้นหน้าต่างจะหล่นไปอยู่ผิดที่ชั่วครู่ */
  @supports (overlay: auto) {
    dialog:not(.adrawer, .cam) { opacity: 0; transform: translateY(10px) scale(.985); transition: opacity var(--t) ease, transform var(--t) var(--ease), overlay var(--t) allow-discrete, display var(--t) allow-discrete; }
    dialog:not(.adrawer, .cam)[open] { opacity: 1; transform: none; transition: opacity var(--t) ease, transform var(--t) var(--ease), overlay var(--t) allow-discrete, display var(--t) allow-discrete; }
    dialog:not(.adrawer, .cam)::backdrop { opacity: 0; transition: opacity var(--t) ease, overlay var(--t) allow-discrete, display var(--t) allow-discrete; }
    dialog:not(.adrawer, .cam)[open]::backdrop { opacity: 1; transition: opacity var(--t) ease, overlay var(--t) allow-discrete, display var(--t) allow-discrete; }
  }
  dialog.cam[open] { animation: fade-in var(--t) ease-out; }

  /* 3) ส่วนที่พับ-กางได้: เนื้อหาค่อย ๆ ปรากฏ (ทุกเบราว์เซอร์) และความสูงค่อย ๆ เปลี่ยนทั้งตอนกางและพับ (เบราว์เซอร์ที่รองรับ) */
  details:not(.fab)[open] > :not(summary) { animation: reveal var(--t-slow) ease-out; }
  @supports selector(::details-content) and (interpolate-size: allow-keywords) {
    /* กล่องของส่วนพับต้องเป็นแบบเดียวกันทั้งตอนพับและตอนกาง (เดิมเปลี่ยนเป็น flex เฉพาะตอนกาง ซึ่งทำให้เบราว์เซอร์ข้ามการเคลื่อนไหวตอนกาง) ระยะห่างใต้หัวข้อจึงค่อย ๆ เปิดแทน */
    details:not(.fab) { interpolate-size: allow-keywords; display: flex; flex-direction: column; gap: 0; transition: gap var(--t-slow) var(--ease), padding-bottom var(--t-slow) var(--ease); }
    details:not(.fab)[open] { gap: 14px; }
    details:not(.fab)::details-content { block-size: 0; min-block-size: 0; flex: none; overflow: clip; overflow-clip-margin: 8px; transition: block-size var(--t-slow) var(--ease), content-visibility var(--t-slow) allow-discrete; }
    details:not(.fab)[open]::details-content { block-size: auto; }
  }

  /* 4) ปุ่มลอยมุมขวาล่าง: กดแล้วยุบเล็กน้อย รายการลิงก์ลอยขึ้นทีละรายการจากใกล้ปุ่ม และจางลงตอนปิด (data-closing ใส่โดย app.js ชั่วครู่ก่อนปิดจริง) */
  .fab > summary { transition: background-color var(--t) ease, transform var(--t-fast) var(--ease), box-shadow var(--t) ease; }
  .fab > summary:hover { box-shadow: 0 4px 16px rgb(16 50 76 / .32); }
  .fab > summary:active { transform: scale(.92); }
  .fab[open] .fab-x { animation: fab-x var(--t-slow) var(--ease); }
  .fab[open] > ul > li { animation: fab-in var(--t-slow) var(--ease) backwards; }
  .fab[open] > ul > li:nth-last-child(2) { animation-delay: .035s; }
  .fab[open] > ul > li:nth-last-child(3) { animation-delay: .07s; }
  .fab[open] > ul > li:nth-last-child(n+4) { animation-delay: .105s; }
  .fab[data-closing] > ul > li:nth-last-child(n) { animation: fab-out var(--t-fast) ease-in forwards; }
  .fab-it { transition: border-color var(--t) ease, background-color var(--t) ease, transform var(--t-fast) var(--ease); }
  .fab-it:active { transform: scale(.97); }

  /* 5) ปุ่ม ลิงก์ เมนู และช่องกรอก: สีและเส้นขอบเปลี่ยนอย่างนุ่มนวล ปุ่มยุบเล็กน้อยตอนแตะ (กรอบโฟกัสของแป้นพิมพ์ยังขึ้นทันทีเหมือนเดิม) */
  .btn { transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease, box-shadow var(--t) ease, filter var(--t) ease, transform var(--t-fast) var(--ease); }
  .btn:active { transform: translateY(1px) scale(.98); }
  a, summary, .acct-it, .acct-btn, .bell, .chip span, .rolecard, .stats > li > *, .adminnav a, .amenu a, .menu a, .rows.nav > li > a, .rows > li, .ticket,
  input, select, textarea { transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease, box-shadow var(--t) ease; }
  .bottom a { transition: background-color var(--t) ease, color var(--t) ease, transform var(--t-fast) var(--ease); }
  .bottom a:active { transform: scale(.94); }
  .rows.nav > li > a:active, .menu a:active, .acct-it:active { background-color: var(--brand-soft); }
  .chip span, .rolecard { transition: background-color var(--t) ease, border-color var(--t) ease, color var(--t) ease, transform var(--t-fast) var(--ease); }
  .chip:active span, .rolecard:active { transform: scale(.98); }

  /* 6) ข้อความที่โผล่ขึ้นมาเอง */
  .toast { animation: toast-in var(--t-slow) var(--ease); }
}
/* ปุ่มแจ้ง "มีความเคลื่อนไหวใหม่" จัดกึ่งกลางด้วย transform: ตอนกดต้องคงตำแหน่งเดิม (เดิมกฎของ .btn:active ทับ ทำให้ปุ่มขยับไปทางขวาตอนแตะ) */
.btn.toast:active { transform: translateX(-50%); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
@keyframes fab-in { from { opacity: 0; transform: translateY(10px) scale(.96); } }
@keyframes fab-out { to { opacity: 0; transform: translateY(8px) scale(.97); } }
@keyframes fab-x { from { opacity: 0; transform: rotate(-90deg) scale(.6); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 10px); } }

/* ================= v0.11.0: สถานที่ที่ยังไม่ได้ลงทะเบียนบนแผนที่ — หมุดสีเทา เล็กกว่าหมุดเวรและหมุดสถานที่ที่ตรวจแล้ว ไม่มีสีของเครื่องหมายยืนยัน ================= */
.pin.unreg { background: #fff; border: 2px solid #7d8b99; box-shadow: 0 1px 3px rgb(0 0 0 / .3); }
.pin.unreg b { display: block; width: 7px; height: 7px; border-radius: 50%; background: #7d8b99; }
.pin.unreg.on { background: var(--amber); border-color: var(--ink); }
.pin.unreg.on b { background: var(--ink); }
.pin.many.unreg { background: #eef1f4; color: var(--ink-2); border: 2px solid #7d8b99; }
.pin.many.unreg b { width: auto; height: auto; background: none; border-radius: 0; font: 600 .75rem/1 var(--display); }
.placerow.unreg:hover { border-color: #7d8b99; }
.placecard.unreg .row { display: flex; flex-wrap: wrap; gap: 8px; }
.placecard.unreg .row .btn { flex: 1 1 200px; }
textarea[data-copy] { font: 400 .8125rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* ---------- v0.14.0: เตรียมเปิดประกาศ / ขั้นถัดไป / หน้าหางาน ---------- */
.count-top { margin: 0 0 8px; font-weight: 600; color: var(--ink); }
.ready-sec h2 { margin-top: 0; }
.ready-sec .upload { margin-top: 8px; }
ul.rows.fixes { margin: 8px 0 0; }
ul.rows.fixes li { gap: 12px; }
.menu-h { font-size: .9375rem; margin: 16px 0 4px; color: var(--ink-2); }
.join-entry { flex-wrap: nowrap; gap: 8px; margin: 6px 0; }
.join-entry .btn { white-space: nowrap; }
details.docuse > summary { cursor: pointer; list-style: none; }
details.docuse > summary::-webkit-details-marker { display: none; }
details.docuse > summary strong::after { content: ' ›'; }
details.docuse[open] > summary strong::after { content: ''; }
.submit-box { margin-top: 12px; scroll-margin-top: 80px; }
#submit { scroll-margin-top: 80px; }
.next-step .note p:last-child { margin-bottom: 0; }
[data-no-jobs] ul.rows { text-align: left; margin-top: 12px; }
@media (max-width: 719px) {
  /* หน้าหางานบนมือถือ: จังหวัดกับการเรียงอยู่แถวเดียวกัน ตัวกรองอื่นพับไว้ */
  .filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 12px; padding: 12px; }
  .filters > details, .filters > .row { grid-column: 1 / -1; }
  .filters > .row { margin-top: 4px; }
}

/* ---------- v0.14.2: ตรวจสถานที่และผู้แทนในหน้าเดียว ---------- */
.rep-review { margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line); }
.rep-review .rep-card { margin: 0 0 12px; }
.rep-card h3 { margin: 0 0 8px; font-size: 1rem; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rep-card .tbl, .rep-review > .tbl { margin-bottom: 8px; }
fieldset[data-also] { margin-top: 8px; }

/* ---------- v0.14.3: เครื่องมือวาง/แก้หมุด ---------- */
.gmap-box { margin: 12px 0; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.gmap-box > label { display: block; margin-bottom: 6px; }
.gmap-row { display: flex; gap: 8px; align-items: stretch; }
.gmap-row input { flex: 1 1 auto; min-width: 0; font-size: max(16px, 1rem); }
.gmap-row .btn { flex: 0 0 auto; white-space: nowrap; }
.gmap-box .howto h3, .help-pin .howto h3 { font-size: 1rem; margin: 12px 0 4px; }
.gmap-box .howto ol, .help-pin ol { padding-left: 1.25em; margin: 4px 0 8px; }
.pin-tools { flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.pin.old { opacity: .45; }
.pin.old b { display: block; width: 22px; height: 22px; background: var(--ink-2); border: 2px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); }
.pin.old { background: none; border: 0; box-shadow: none; }
ul.rows.pin-checks { margin: 12px 0; }
section[data-reg-pin] h2 { margin-top: 0; }
