/* Present — ทันสมัย เรียบง่าย มีมิติ */
@font-face { font-family: 'Plex Thai'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-thai-400-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-thai-500-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-thai-600-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-thai-700-normal.woff2) format('woff2'); unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC; }
@font-face { font-family: 'Plex Thai'; font-weight: 400; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Plex Thai'; font-weight: 500; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Plex Thai'; font-weight: 600; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-latin-600-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }
@font-face { font-family: 'Plex Thai'; font-weight: 700; font-display: swap; src: url(/fonts/ibm-plex-sans-thai-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+2000-206F, U+20AC, U+2122; }

:root {
  --bg: #f3f5f8;
  --bg-2: #eaeef4;
  --surface: #ffffff;
  --ink: #0f1f3d;
  --ink-2: #3d4b66;
  --muted: #6b7890;
  --line: #e1e6ee;
  --line-2: #cfd7e3;
  --accent: #1d4ed8;
  --accent-2: #173fae;
  --accent-soft: #e8eefc;
  --ok: #0b7a55;
  --ok-soft: #e3f4ed;
  --warn: #9a5b00;
  --warn-soft: #fdf1dc;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-1: 0 1px 2px rgba(15, 31, 61, .05), 0 2px 6px rgba(15, 31, 61, .05);
  --shadow-2: 0 2px 4px rgba(15, 31, 61, .06), 0 10px 24px rgba(15, 31, 61, .09);
  --shadow-3: 0 12px 40px rgba(15, 31, 61, .18);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --font: 'Plex Thai', 'Noto Sans Thai', 'Sukhumvit Set', 'Leelawadee UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
h1, h2, h3 { line-height: 1.3; margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.skip { position: absolute; left: 12px; top: -48px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
#main:focus { outline: none; }
.noscript { padding: 24px; text-align: center; }

/* ---------- แถบบน ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(243, 245, 248, .86); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1040px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 20px; }
.wordmark { font-weight: 700; font-size: 1.3rem; letter-spacing: -.02em; color: var(--ink); text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.wordmark img { width: 40px; height: 40px; display: block; flex: none; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.tabs a { padding: 6px 14px; border-radius: 9px; color: var(--ink-2); text-decoration: none; font-weight: 500; font-size: .95rem; transition: background .15s, color .15s, box-shadow .15s; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }

main { width: 100%; max-width: 1040px; margin: 0 auto; padding: 20px 16px 48px; flex: 1 0 auto; }

/* ---------- เครดิตท้ายเว็บ ---------- */
.site-footer { border-top: 1px solid var(--line); text-align: center; color: var(--ink-2); font-size: .88rem; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
.site-footer p { margin: 0 auto; max-width: 1040px; display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.site-footer img { width: 28px; height: 28px; flex: none; }
/* มือถือ: เว้นที่ให้ปุ่ม “ส่งงาน” ที่ลอยอยู่ด้านล่าง */
@media (max-width: 720px) { body:has(.fab-bar) .site-footer { padding-bottom: calc(96px + env(safe-area-inset-bottom)); } }

/* ---------- ปุ่ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 16px; border-radius: 11px; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--ink); font-weight: 500; cursor: pointer; text-decoration: none;
  box-shadow: var(--shadow-1); transition: transform .12s var(--ease), box-shadow .15s, background .15s, border-color .15s;
  -webkit-tap-highlight-color: transparent; white-space: nowrap;
}
.btn:hover { border-color: #b9c4d4; box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(1px) scale(.98); box-shadow: var(--shadow-1); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-dark:hover { background: #1c2f55; border-color: #1c2f55; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #95190f; }
.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--ink-2); }
.btn-ghost:hover { background: var(--bg-2); box-shadow: none; border-color: transparent; }
.btn-sm { min-height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 9px; }
.btn-lg { min-height: 52px; padding: 0 22px; font-size: 1.05rem; border-radius: 13px; }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-block { width: 100%; }
.icon-btn { width: 40px; min-height: 40px; padding: 0; }

/* ---------- การ์ด / ส่วนหัว ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 8px 0 16px; flex-wrap: wrap; }
.page-head h1 { font-size: 1.55rem; letter-spacing: -.01em; }
.page-head p { margin: 2px 0 0; color: var(--muted); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }

/* ---------- เลือกวัน ---------- */
.datebar { display: flex; gap: 8px; align-items: center; overflow-x: auto; padding: 2px 2px 10px; margin-bottom: 6px; scrollbar-width: thin; }
.chip {
  flex: none; border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px; padding: 6px 14px;
  font-size: .92rem; cursor: pointer; color: var(--ink-2); transition: all .15s; display: inline-flex; gap: 6px; align-items: center;
}
.chip:hover { border-color: #aab6c8; color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .count { font-size: .78rem; background: var(--bg-2); color: var(--ink-2); border-radius: 999px; padding: 0 7px; }
.chip[aria-pressed="true"] .count { background: rgba(255,255,255,.18); color: #fff; }
.date-input { position: relative; flex: none; }
.date-input input { border: 1px dashed var(--line-2); background: transparent; border-radius: 999px; padding: 5px 12px; color: var(--ink-2); font-size: .92rem; min-height: 36px; }

/* ---------- การ์ดห้อง (แนวยาว) ---------- */
.room-list { display: grid; gap: 12px; }
.room-card {
  display: grid; grid-template-columns: 112px 1fr auto; align-items: center; gap: 18px;
  padding: 16px 18px; text-decoration: none; color: inherit;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s;
}
.room-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--line-2); }
.room-card:active { transform: translateY(0); }
.room-time { border-right: 1px solid var(--line); padding-right: 14px; }
.room-time .t { font-size: 1.35rem; font-weight: 600; letter-spacing: -.01em; }
.room-time .t2 { color: var(--muted); font-size: .88rem; }
.room-main h2 { font-size: 1.1rem; font-weight: 600; }
.room-main .meta { color: var(--ink-2); display: flex; gap: 12px; flex-wrap: wrap; font-size: .93rem; margin-top: 2px; }
.room-main .meta span { display: inline-flex; gap: 5px; align-items: center; }
.room-main .meta svg { width: 15px; height: 15px; color: var(--muted); }
.room-go { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.room-go svg { width: 20px; height: 20px; transition: transform .18s var(--ease); }
.room-card:hover .room-go svg { transform: translateX(3px); color: var(--accent); }

.badge { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 500; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: var(--bg-2); color: var(--ink-2); }
.badge-plain::before { display: none; }

.empty { text-align: center; padding: 48px 20px; }
.empty .art { width: 72px; height: 72px; margin: 0 auto 14px; border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-2); display: grid; place-items: center; color: var(--accent); transform: rotate(-6deg); }
.empty .art svg { width: 34px; height: 34px; }
.empty h2 { font-size: 1.2rem; }
.empty p { color: var(--muted); margin: 6px 0 18px; }

/* ---------- ฟอร์ม ---------- */
.form { display: grid; gap: 16px; padding: 22px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.field label, .field .label { font-weight: 500; font-size: .95rem; }
.field .hint { color: var(--muted); font-size: .85rem; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 12px; }
input[type="text"], input[type="url"], input[type="date"], input[type="time"], input[type="password"], input[type="search"], textarea {
  width: 100%; min-height: 46px; padding: 10px 13px; border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: #fbfcfe; transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea { min-height: 84px; resize: vertical; }
input:hover, textarea:hover { border-color: #b3bfd0; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 4px rgba(29, 78, 216, .14); }
.pin-input { letter-spacing: .6em; font-size: 1.4rem !important; text-align: center; font-weight: 600; max-width: 220px; }
.form-error { color: var(--danger); background: var(--danger-soft); padding: 10px 12px; border-radius: 10px; font-size: .93rem; }
.notice { display: flex; gap: 10px; align-items: flex-start; background: var(--warn-soft); color: #6b4000; padding: 10px 12px; border-radius: 10px; font-size: .9rem; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 2px; }
.notice.info { background: var(--accent-soft); color: #1b347d; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- หน้าห้อง ---------- */
.room-hero { padding: 20px 22px; display: grid; gap: 14px; position: relative; overflow: hidden; }
.room-hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 200px; height: 200px; border-radius: 50%; background: radial-gradient(closest-side, rgba(29,78,216,.10), transparent); pointer-events: none; }
.room-hero .crumb { font-size: .88rem; color: var(--muted); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.room-hero h1 { font-size: 1.6rem; letter-spacing: -.01em; }
.room-hero .when { display: flex; gap: 16px; flex-wrap: wrap; color: var(--ink-2); }
.room-hero .when span { display: inline-flex; gap: 6px; align-items: center; }
.room-hero .when svg { width: 17px; height: 17px; color: var(--muted); }
.room-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--bg-2); padding: 1px 8px; border-radius: 6px; font-size: .85rem; letter-spacing: .04em; }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 10px; flex-wrap: wrap; }
.section-head h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.section-head .count { color: var(--muted); font-weight: 400; font-size: .95rem; }

/* ---------- แถบแจ้งงานใหม่ ---------- */
.new-banner {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  background: var(--ink); color: #fff; border: 0; border-radius: 12px; padding: 10px 14px; margin-bottom: 10px;
  font-weight: 500; cursor: pointer; box-shadow: var(--shadow-2); animation: drop .3s var(--ease);
}
.new-banner:hover { background: #1c2f55; }
.new-banner svg { width: 18px; height: 18px; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ---------- คิว ---------- */
.queue { display: grid; gap: 10px; }
.q-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; padding: 14px 16px; align-items: start; }
.q-item.is-hidden { opacity: .55; background: repeating-linear-gradient(-45deg, #fff, #fff 10px, #f6f8fb 10px, #f6f8fb 20px); }
.q-seq { width: 40px; height: 40px; border-radius: 11px; background: var(--bg-2); display: grid; place-items: center; font-weight: 700; color: var(--ink-2); }
.q-body h3 { font-size: 1.05rem; font-weight: 600; overflow-wrap: anywhere; }
.q-sub { color: var(--muted); font-size: .88rem; display: flex; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.q-types { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.type { display: inline-flex; align-items: center; gap: 5px; font-size: .8rem; padding: 2px 9px; border-radius: 7px; background: var(--bg-2); color: var(--ink-2); font-weight: 500; }
.type svg { width: 14px; height: 14px; }
.type-pdf { background: #fdecea; color: #a1261b; }
.type-slides { background: #fff0e0; color: #9a4a00; }
.type-video { background: #efe9fd; color: #5b32b5; }
.type-image { background: #e4f5ee; color: #11714e; }
.type-doc { background: #e7effd; color: #1f4aa8; }
.type-sheet { background: #e6f4e6; color: #2a6b2a; }
.type-link { background: #e6f2f8; color: #135f80; }
.type-audio { background: #fbe9f3; color: #8f2a63; }
.q-files { display: grid; gap: 6px; margin-top: 10px; }
.q-file { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfe; flex-wrap: wrap; }
.q-file .name { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font-size: .93rem; }
.q-file .size { color: var(--muted); font-size: .82rem; }
.q-file .acts { display: flex; gap: 6px; }
.q-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }

/* ---------- แถบโหมดคุมฉาย ---------- */
.admin-bar {
  margin-top: 14px; padding: 12px 14px; border-radius: var(--radius); background: var(--ink); color: #e9eefb;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap; box-shadow: var(--shadow-2);
}
.admin-bar .who { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-right: auto; }
.admin-bar .who small { font-weight: 400; color: #aab7d4; }
.admin-bar .btn { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.16); color: #fff; box-shadow: none; }
.admin-bar .btn:hover { background: rgba(255,255,255,.16); }
.admin-bar .btn-danger { background: #c4372b; border-color: #c4372b; }
.admin-bar .btn-danger:hover { background: #a82c21; }
.role-badge { font-size: .74rem; font-weight: 600; background: #fde68a; color: #5b3d00; border-radius: 999px; padding: 1px 9px; }
.lock-dot { width: 9px; height: 9px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 4px rgba(74,222,128,.18); }

/* ---------- แถบส่งงานบนมือถือ ---------- */
.fab-bar { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: linear-gradient(to top, var(--bg) 70%, rgba(243,245,248,0)); z-index: 15; display: none; }
@media (max-width: 720px) { .fab-bar { display: block; } .hide-mobile { display: none !important; } }

/* ---------- กล่องโต้ตอบ ---------- */
dialog { border: 0; padding: 0; border-radius: 18px; box-shadow: var(--shadow-3); width: min(560px, calc(100vw - 24px)); max-height: calc(100vh - 32px); background: var(--surface); color: var(--ink); }
dialog::backdrop { background: rgba(15, 31, 61, .42); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .22s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
.dlg-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 0 20px; gap: 10px; }
.dlg-head h2 { font-size: 1.2rem; }
.dlg-body { padding: 14px 20px 20px; display: grid; gap: 14px; }
.dlg-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 0 20px 20px; flex-wrap: wrap; }
@media (max-width: 720px) {
  dialog.sheet { width: 100vw; max-width: 100vw; max-height: 92vh; margin: auto 0 0; border-radius: 20px 20px 0 0; }
  dialog.sheet[open] { animation: sheet .26s var(--ease); }
  @keyframes sheet { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
}

/* QR เต็มจอ */
dialog.qr-dialog { width: min(760px, calc(100vw - 24px)); }
.qr-wrap { display: grid; justify-items: center; gap: 14px; padding: 8px 24px 28px; text-align: center; }
.qr-box { background: #fff; padding: 18px; border-radius: 18px; border: 1px solid var(--line); box-shadow: var(--shadow-2); width: min(62vh, 80vw, 520px); aspect-ratio: 1; animation: grow .35s var(--ease); }
.qr-box svg { width: 100%; height: 100%; display: block; }
@keyframes grow { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }
.qr-wrap h2 { font-size: clamp(1.3rem, 3vw, 2rem); }
.qr-wrap .when { font-size: clamp(1rem, 2vw, 1.25rem); color: var(--ink-2); }
.qr-wrap .url { font-family: ui-monospace, Menlo, monospace; font-size: .95rem; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- ส่งงาน: ไฟล์ + progress ---------- */
.drop {
  border: 1.5px dashed var(--line-2); border-radius: 14px; padding: 18px; text-align: center; background: #fbfcfe;
  transition: border-color .15s, background .15s; cursor: pointer; display: grid; gap: 4px; justify-items: center;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 28px; height: 28px; color: var(--accent); }
.drop strong { font-weight: 600; }
.drop small { color: var(--muted); }
.file-list { display: grid; gap: 8px; }
.file-row { border: 1px solid var(--line); border-radius: 11px; padding: 9px 11px; display: grid; gap: 6px; background: #fff; }
.file-row .top { display: flex; align-items: center; gap: 8px; }
.file-row .fname { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .93rem; }
.file-row .fsize { color: var(--muted); font-size: .8rem; }
.file-row .state { font-size: .82rem; color: var(--muted); }
.file-row .state.err { color: var(--danger); }
.file-row .state.ok { color: var(--ok); }
.bar { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; }
.bar > i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), #4f7df0); border-radius: 99px; transform-origin: left; transform: scaleX(0); transition: transform .45s var(--ease); }
.bar.done > i { background: var(--ok); }
.bar.err > i { background: var(--danger); }
.link-rows { display: grid; gap: 8px; }
.link-row { display: flex; gap: 8px; }
.link-row input { flex: 1; }
.limits { color: var(--muted); font-size: .85rem; }
.success { text-align: center; padding: 10px 0; display: grid; justify-items: center; gap: 8px; }
.success .tick { width: 64px; height: 64px; border-radius: 50%; background: var(--ok-soft); color: var(--ok); display: grid; place-items: center; animation: grow .35s var(--ease); }
.success .tick svg { width: 32px; height: 32px; }

/* ---------- ประวัติ ---------- */
.log { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 50vh; overflow: auto; }
.log li { display: flex; gap: 12px; padding: 8px 4px; border-bottom: 1px solid var(--line); font-size: .93rem; }
.log time { color: var(--muted); min-width: 120px; font-size: .85rem; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow-3); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s var(--ease); z-index: 60; display: flex; align-items: center; gap: 8px; max-width: calc(100vw - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 18px; height: 18px; color: #4ade80; }
@media (max-width: 720px) { .toast { bottom: 96px; } }

.closed { text-align: center; padding: 40px 20px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.35); border-top-color: #fff; animation: spin .8s linear infinite; }
.spinner.dark { border-color: var(--line-2); border-top-color: var(--accent); }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { height: 86px; border-radius: var(--radius); background: linear-gradient(90deg, var(--bg-2), #f6f8fb, var(--bg-2)); background-size: 200% 100%; }
.muted { color: var(--muted); }
.paused-note { margin-top: 2px; }

@media (max-width: 720px) {
  .topbar-inner { gap: 10px; padding: 8px 12px; }
  .wordmark { font-size: 1.15rem; }
  .tabs a { padding: 6px 10px; font-size: .9rem; }
  main { padding: 14px 12px 120px; }
  .room-card { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 14px; }
  .room-time { border: 0; padding: 0; grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  .room-time .t { font-size: 1.1rem; }
  .row2, .row3 { grid-template-columns: 1fr; }
  .form { padding: 16px; }
  .room-hero { padding: 16px; }
  .room-hero h1 { font-size: 1.35rem; }
  .room-hero .when { gap: 2px 14px; }
  .q-item { grid-template-columns: 34px 1fr; gap: 10px; padding: 12px; }
  .q-seq { width: 32px; height: 32px; border-radius: 9px; font-size: .9rem; }
  .q-side { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .spinner { animation: none; border-top-color: transparent; }
}

@media print { .topbar, .fab-bar, .admin-bar { display: none; } }

/* ---------- ประเภทงานที่ห้องรับ ---------- */
.accept-field { border: 0; padding: 0; margin: 0; min-width: 0; }
.accept-field legend { font-weight: 500; font-size: .95rem; padding: 0; margin-bottom: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; background: var(--surface); transition: border-color .15s, background .15s; }
.check input { width: 18px; height: 18px; margin: 3px 0 0; accent-color: var(--accent); flex: none; box-shadow: none; }
.check > span { display: grid; gap: 1px; }
.check strong { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.check strong svg { width: 16px; height: 16px; color: var(--ink-2); }
.check small { color: var(--muted); font-size: .84rem; }
.check:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.check:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(29, 78, 216, .14); }
.check-all { border-style: dashed; }
.accept-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: .88rem; margin-top: 10px; }
.acc-chip { display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-2); font-weight: 500; }
.acc-chip svg { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .check { transition: none; } }

/* ---------- หน้าเอกสาร (นโยบายความเป็นส่วนตัว) ---------- */
.prose { padding: 28px clamp(18px, 4vw, 40px); max-width: 760px; }
.prose h1 { font-size: 1.6rem; margin-bottom: 4px; }
.prose h2 { font-size: 1.12rem; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--ink-2); }
.prose ul { padding-left: 1.2em; margin: 8px 0; display: grid; gap: 6px; }
.prose code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; background: var(--bg-2); padding: 1px 6px; border-radius: 5px; font-size: .88em; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 28px 0 0; }
.footer-links { margin-top: 6px !important; font-size: .84rem; }
.footer-links a { color: var(--ink-2); }
