/* ตรวจมาตรฐานสถานี — ออกแบบสำหรับใช้กลางแจ้งบนมือถือ: ตัวหนังสือชัด ปุ่มใหญ่ สีตัดกันสูง */
:root {
  color-scheme: light;
  --bg: #edf1f2;
  --surface: #ffffff;
  --ink: #0f2a35;
  --muted: #566b74;
  --line: #d3dcdf;
  --primary: #0b5c74;
  --primary-ink: #ffffff;
  --primary-soft: #e1eef2;
  --mark: #f5b800;          /* สีเส้นจราจรบนลาน: ใช้กับสิ่งที่ "กำลังทำอยู่" */
  --mark-soft: #fff5d1;
  --pass: #16794c;
  --pass-soft: #e2f3ea;
  --fail: #c2362b;
  --fail-soft: #fbe6e3;
  --radius: 14px;
  --bar-h: 60px;
  --font: "IBM Plex Sans Thai Looped", "Leelawadee UI", "Thonburi", "Noto Sans Thai", "Loma", system-ui, sans-serif;
  --font-head: "IBM Plex Sans Thai", "Leelawadee UI", "Thonburi", "Noto Sans Thai", "Loma", system-ui, sans-serif;
}

* { box-sizing: border-box; }
/* องค์ประกอบที่ถูกซ่อน (hidden) ต้องซ่อนจริงเสมอ แม้ class ของมันจะกำหนด display ไว้ */
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.6 var(--font);
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}
body.no-nav { padding-bottom: 24px; }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.3; margin: 0; }
h1 { font-size: 20px; font-weight: 600; }
h2 { font-size: 17px; font-weight: 600; }
h3 { font-size: 15px; font-weight: 600; }
p { margin: 0; }
a { color: var(--primary); }
img { max-width: 100%; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.num { font-family: var(--font-head); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }

/* ---------- โครงหน้า ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--primary); color: var(--primary-ink);
  padding: env(safe-area-inset-top) 16px 0;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
}
.topbar h1 { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar a { color: inherit; text-decoration: none; }
.topbar .back { display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px; border-radius: 50%; }
.topbar .who {
  font-size: 13.5px; line-height: 1.25; text-align: right; max-width: 45%;
  padding: 6px 10px; border-radius: 10px; background: rgba(255,255,255,.14);
}
.topbar .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-mark { flex: none; display: grid; place-items: center; height: 38px; max-width: 96px; padding: 4px 6px; border-radius: 9px; background: #fff; }
.brand-mark img { display: block; max-height: 30px; max-width: 84px; width: auto; height: auto; object-fit: contain; }
/* โลโก้ไม่มีกรอบสีขาว (ตั้งที่ จัดการ -> รูปแบบและโลโก้) */
body.logo-bare .brand-mark, body.logo-bare .login-head .brand-logo, body.logo-bare .bp-head .brand-logo { background: transparent; padding-left: 0; padding-right: 0; }
body.logo-bare .brand-mark img { max-height: 36px; max-width: 96px; }
/* โลโก้ธุรกิจกลางแถบด้านบน (หน้าแรก): 3 คอลัมน์เท่ากันซ้าย-ขวา โลโก้จึงอยู่กึ่งกลางจอเสมอ ชื่อผู้ใช้ยาวจะถูกตัดด้วย … */
.topbar .who .role { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar.has-center { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); }
.topbar.has-center .brand-mark { grid-column: 1; justify-self: start; max-width: 100%; }
.topbar.has-center .brand-mark img { max-width: 100%; }
.topbar.has-center h1.biz-center { grid-column: 2; display: flex; align-items: center; justify-content: center; max-width: min(34vw, 280px); }
.topbar.has-center .who { grid-column: 3; justify-self: end; max-width: 100%; min-width: 0; }
.topbar.has-center .who .role { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar h1.biz-center img { display: block; max-height: calc(var(--bar-h) - 16px); max-width: 100%; width: auto; height: auto; object-fit: contain; }
.topbar h1.biz-center span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar h1.biz-center a { display: flex; align-items: center; justify-content: center; min-width: 0; max-width: 100%; }
.biz-preview { margin: 0 -16px; }
.biz-preview .topbar { position: relative; z-index: 0; border-radius: 0; }
.biz-thumb { flex: none; display: grid; place-items: center; width: 48px; height: 32px; }
.biz-thumb img { max-width: 48px; max-height: 32px; object-fit: contain; }
.wrap { max-width: 600px; margin: 0 auto; padding: 16px; }
.wrap.wide { max-width: 1120px; }
.stack > * + * { margin-top: 14px; }
.section-title { margin: 22px 2px 8px; }
.row { display: flex; align-items: center; gap: 10px; }
.row .grow { flex: 1; min-width: 0; }
.wrap-row { display: flex; flex-wrap: wrap; gap: 8px; }

.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabs a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 9px 4px 8px; min-height: 60px; text-decoration: none;
  color: var(--muted); font-size: 12.5px; font-weight: 500;
}
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current="page"] { color: var(--primary); font-weight: 600; box-shadow: inset 0 3px 0 var(--primary); }

/* ---------- พื้นผิว ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 0; overflow: hidden; }
.list > * { display: block; padding: 14px 16px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.list > *:first-child { border-top: 0; }
a.list-row:active, .list > a:active { background: var(--primary-soft); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.flash { padding: 12px 14px; border-radius: 12px; font-weight: 500; border: 1px solid; }
.flash.ok { background: var(--pass-soft); border-color: #b5dcc7; color: #0d5132; }
.flash.error { background: var(--fail-soft); border-color: #efbcb6; color: #8c2219; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  padding: 2px 9px; border-radius: 99px; font-size: 13px; font-weight: 600;
  background: var(--primary-soft); color: var(--primary);
}
.badge.doing { background: var(--mark-soft); color: #6b4e00; }
.badge.pass { background: var(--pass-soft); color: #0d5132; }
.badge.fail { background: var(--fail-soft); color: #8c2219; }
.badge.off { background: #e6eaec; color: var(--muted); }

/* ---------- ปุ่มและฟอร์ม ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 18px; border-radius: 12px; border: 1.5px solid transparent;
  font: 600 16px/1.3 var(--font-head); text-decoration: none; cursor: pointer;
  background: var(--primary); color: var(--primary-ink);
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn.block { display: flex; width: 100%; }
.btn.big { min-height: 60px; font-size: 18px; }
.btn.ghost { background: var(--surface); color: var(--primary); border-color: var(--primary); }
.btn.quiet { background: transparent; color: var(--primary); min-height: 44px; padding: 8px 12px; }
.btn.danger { background: var(--surface); color: var(--fail); border-color: var(--fail); }
.btn[disabled] { background: #c9d3d7; color: #f4f7f8; border-color: transparent; cursor: not-allowed; }

label.field { display: block; }
label.field > span, .field-label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 5px; }
.hint { font-size: 13.5px; color: var(--muted); margin-top: 5px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 10px;
  border: 1.5px solid #a9b8be; background: var(--surface); color: var(--ink);
  font: 16px/1.5 var(--font);
}
textarea { min-height: 84px; resize: vertical; }
code { font-size: .88em; padding: 1px 5px; border-radius: 5px; background: rgba(0,0,0,.06); overflow-wrap: anywhere; }
input:focus, select:focus, textarea:focus { outline: 3px solid var(--mark); outline-offset: 1px; border-color: var(--primary); }
.check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 500; }
.check input { width: 22px; height: 22px; accent-color: var(--primary); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ---------- แถบผลรายข้อ: 1 ช่อง = 1 หัวข้อ เว้นช่องไฟตามหมวด ---------- */
.strip { display: flex; align-items: center; gap: 2px; height: 22px; }
.strip i { flex: 1; min-width: 3px; height: 12px; border-radius: 2px; background: #cfd8dc; }
.strip i.pass { background: var(--pass); }
.strip i.fail { background: var(--fail); height: 22px; }           /* ข้อไม่ผ่านสูงกว่า: ไม่พึ่งสีอย่างเดียว */
.strip i.na { background: transparent; box-shadow: inset 0 0 0 1.5px #93a4ab; }
.strip i.gap { flex: 0 0 5px; min-width: 5px; background: transparent; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend .strip { width: 14px; }

.insp-row .top { display: flex; align-items: baseline; gap: 8px; }
.insp-row .top b { flex: 1; min-width: 0; font-family: var(--font-head); font-weight: 600; }
.insp-row .meta { font-size: 13.5px; color: var(--muted); margin: 1px 0 7px; }
.insp-row .tail { display: flex; justify-content: space-between; gap: 8px; font-size: 13.5px; margin-top: 5px; color: var(--muted); }
.insp-row .tail strong { color: var(--ink); }

/* ---------- เข้าสู่ระบบ ---------- */
body.login-page { min-height: 100dvh; display: flex; flex-direction: column; background: var(--primary); padding: 0; }
.login-head { color: var(--primary-ink); padding: calc(44px + env(safe-area-inset-top)) 24px 30px; text-align: center; }
.login-head .brand-logo { display: inline-grid; place-items: center; padding: 10px 14px; margin-bottom: 16px; border-radius: 14px; background: #fff; }
.login-head .brand-logo img { display: block; max-height: 64px; max-width: 220px; width: auto; height: auto; object-fit: contain; }
.login-head .org { font-weight: 600; opacity: .95; margin: 0 0 4px; }
.login-head .lane { width: 56px; height: 6px; background: var(--mark); border-radius: 3px; margin: 0 auto 18px; }
.login-head h1 { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.login-head p { opacity: .85; margin-top: 6px; }
.login-body { flex: 1; background: var(--bg); border-radius: 22px 22px 0 0; padding: 26px 20px 32px; }
.login-body form { max-width: 440px; margin: 0 auto; }

/* ---------- เช็กอิน ---------- */
.locator { border-radius: var(--radius); padding: 18px 16px; background: var(--surface); border: 1.5px solid var(--line); }
.locator[data-state=found] { border-color: var(--pass); background: var(--pass-soft); }
.locator[data-state=outside], .locator[data-state=error] { border-color: var(--fail); background: var(--fail-soft); }
.locator[data-state=choose] { border-color: var(--mark); background: var(--mark-soft); }
.site-pick .stack-s { display: grid; gap: 8px; }
.site-pick .site {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px;
  border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; text-align: left; cursor: pointer;
}
.site-pick .site i { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid #a9b8be; background: var(--surface); }
.site-pick .site span { min-width: 0; }
.site-pick .site b { display: block; font: 600 16px/1.3 var(--font-head); overflow-wrap: anywhere; }
.site-pick .site small { display: block; font-size: 13.5px; color: var(--muted); }
.site-pick .site[aria-checked=true] { border-color: var(--primary); background: var(--primary-soft); }
.site-pick .site[aria-checked=true] i { border-color: var(--primary); background: var(--primary); box-shadow: inset 0 0 0 4px var(--surface); }
.site-pick .site:focus-visible { outline: 3px solid var(--mark); outline-offset: 2px; }
.locator .state { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.locator .branch { font: 700 26px/1.25 var(--font-head); margin: 6px 0 4px; overflow-wrap: anywhere; }
.locator .detail { font-size: 14.5px; color: var(--muted); }
.pulse { width: 12px; height: 12px; border-radius: 50%; background: var(--mark); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .pulse { animation: pulse 1.2s ease-in-out infinite; }
  @keyframes pulse { 50% { transform: scale(.55); opacity: .5; } }
}
.shot { position: relative; border-radius: var(--radius); overflow: hidden; background: #dfe6e9; border: 1.5px dashed #93a4ab; }
.shot.has { border-style: solid; border-color: var(--line); }
.shot img { display: block; width: 100%; max-height: 52vh; object-fit: cover; }
.shot label { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 170px; padding: 20px; cursor: pointer; font: 600 17px var(--font-head); color: var(--primary); text-align: center; }
.shot label svg { width: 44px; height: 44px; }
.shot.has label { min-height: 0; flex-direction: row; padding: 12px; font-size: 15px; background: var(--surface); }
.shot.has label svg { width: 22px; height: 22px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* ---------- checklist ---------- */
.progress { position: sticky; top: calc(var(--bar-h) + env(safe-area-inset-top)); z-index: 15; background: var(--bg); padding: 10px 16px 10px; margin: -16px -16px 6px; border-bottom: 1px solid var(--line); }
.progress .line { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; margin-bottom: 4px; }
.progress .line b { font: 600 16px var(--font-head); }
.cat-title { margin: 22px 2px 10px; font: 600 16px/1.35 var(--font-head); color: var(--primary); }
.item { background: var(--surface); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 14px; scroll-margin-top: 140px; }
.item + .item { margin-top: 10px; }
.item[data-result=pass] { border-left: 6px solid var(--pass); }
.item[data-result=fail] { border-left: 6px solid var(--fail); }
.item[data-result=na] { border-left: 6px solid #93a4ab; }
.item.missing { border-color: var(--fail); box-shadow: 0 0 0 3px var(--fail-soft); }
.item .q { display: flex; gap: 10px; align-items: flex-start; }
.item .q .no { flex: none; min-width: 30px; height: 30px; padding: 0 6px; border-radius: 8px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font: 600 15px var(--font-head); }
.item .q p { font-weight: 500; line-height: 1.5; padding-top: 2px; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; border: 0; padding: 0; }
.choices label { position: relative; }
.choices input { position: absolute; opacity: 0; inset: 0; }
.choices span {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 50px; border-radius: 11px; border: 1.5px solid #a9b8be; background: var(--surface);
  font: 600 16px var(--font-head); color: var(--ink); cursor: pointer;
}
.choices span svg { width: 18px; height: 18px; }
.choices input:focus-visible + span { outline: 3px solid var(--mark); outline-offset: 2px; }
.choices input[value=pass]:checked + span { background: var(--pass); border-color: var(--pass); color: #fff; }
.choices input[value=fail]:checked + span { background: var(--fail); border-color: var(--fail); color: #fff; }
.choices input[value=na]:checked + span { background: #566b74; border-color: #566b74; color: #fff; }
.item .extra { margin-top: 12px; }
.item .extra > * + * { margin-top: 10px; }
.item .need { font-size: 13.5px; color: var(--muted); }
.item.missing .need { font-weight: 600; color: var(--fail); }
.item .saved { font-size: 13px; color: var(--muted); min-height: 20px; margin-top: 6px; text-align: right; }
.item .saved.err { color: var(--fail); font-weight: 600; }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumbs:empty { display: none; }
.thumb { position: relative; width: 76px; height: 76px; border-radius: 10px; overflow: hidden; background: #dfe6e9; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button { position: absolute; top: 0; right: 0; width: 30px; height: 30px; border: 0; border-radius: 0 0 0 10px; background: rgba(15,42,53,.82); color: #fff; font-size: 17px; line-height: 1; cursor: pointer; }
.thumb.loading::after { content: "กำลังส่ง…"; position: absolute; inset: 0; display: grid; place-items: center; background: rgba(255,255,255,.8); font-size: 12px; font-weight: 600; }
.mini { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); font: 600 14.5px var(--font-head); color: var(--primary); cursor: pointer; }
.mini svg { width: 20px; height: 20px; }
.submit-bar { margin-top: 22px; }

/* ---------- ผลการตรวจ (อ่านอย่างเดียว) ---------- */
.result-row { padding: 12px 16px; border-top: 1px solid var(--line); }
.result-row:first-child { border-top: 0; }
.result-row .q { display: flex; gap: 10px; align-items: flex-start; }
.result-row .q .no { flex: none; min-width: 26px; font: 600 15px var(--font-head); color: var(--muted); }
.result-row .q p { flex: 1; }
.result-row .more { margin: 8px 0 0 36px; font-size: 14.5px; }
.result-row .more > * + * { margin-top: 8px; }
.note { background: var(--bg); border-radius: 8px; padding: 8px 10px; white-space: pre-wrap; overflow-wrap: anywhere; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; font-size: 14.5px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }
.score-big { font: 700 40px/1 var(--font-head); }

/* ---------- รายงาน ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters .seg { display: inline-flex; border: 1.5px solid var(--primary); border-radius: 11px; overflow: hidden; }
.filters .seg button { min-height: 44px; padding: 6px 14px; border: 0; background: var(--surface); color: var(--primary); font: 600 14.5px var(--font-head); cursor: pointer; }
.filters .seg button + button { border-left: 1.5px solid var(--primary); }
.filters .seg button[aria-pressed=true] { background: var(--primary); color: #fff; }
.filters select, .filters input[type=date] { width: auto; min-height: 44px; }
.filters .dates { display: flex; align-items: center; gap: 8px; }
.filters .dates input { flex: 1; min-width: 0; }
@media (max-width: 640px) {
  .filters > * { flex: 1 1 100%; }
  .filters .seg button { flex: 1; padding: 6px 6px; white-space: nowrap; }
  .filters select { width: 100%; }
  .filters > .badge { flex: 0 0 auto; }
}
.live { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--muted); }
.live .pulse { width: 9px; height: 9px; background: var(--pass); }
.live.stale .pulse { background: var(--fail); animation: none; }
.hero { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 14px; }
.hero .figure { font: 700 52px/1 var(--font-head); }
.hero .figure small { font-size: 24px; font-weight: 600; color: var(--muted); }
.meter { height: 10px; border-radius: 5px; background: var(--primary-soft); overflow: hidden; margin-top: 12px; }
.meter i { display: block; height: 100%; background: var(--primary); border-radius: 5px; transition: width .4s; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .label { font-size: 13.5px; color: var(--muted); }
.tile .value { font: 600 28px/1.2 var(--font-head); }
.tile .value small { font-size: 15px; font-weight: 500; color: var(--muted); }
.bars > div + div { margin-top: 12px; }
.bars .name { font-size: 14.5px; display: flex; gap: 8px; }
.bars .name span { flex: 1; }
.bars .name b { font-family: var(--font-head); white-space: nowrap; }
.bars .track { height: 8px; margin-top: 4px; background: var(--fail-soft); border-radius: 4px; }
.bars .track i { display: block; height: 100%; min-width: 4px; background: var(--fail); border-radius: 4px; }
.bd { margin: 8px -16px -16px; }
.bd .bd-row { display: block; width: 100%; padding: 12px 16px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; font: inherit; text-align: left; text-decoration: none; }
.bd button.bd-row, .bd a.bd-row { cursor: pointer; }
.bd button.bd-row:active, .bd a.bd-row:active { background: var(--primary-soft); }
.bd .top { display: flex; align-items: baseline; gap: 8px; }
.bd .top b { font-family: var(--font-head); font-weight: 600; }
.bd .top .num { margin-left: auto; font-weight: 600; white-space: nowrap; }
.bd .top .num.none { color: var(--fail); }
.bd .meter { height: 6px; margin-top: 6px; }
.bd .meta { margin-top: 5px; font-size: 13.5px; color: var(--muted); }
.btn.del { color: var(--fail); }
/* หน้ารูปแบบและโลโก้ */
.brand-preview { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }
.bp-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 16px; background: var(--primary); color: var(--primary-ink); }
.bp-head .brand-logo { display: inline-grid; place-items: center; padding: 6px 10px; margin-bottom: 8px; border-radius: 10px; background: #fff; }
.bp-head .brand-logo img { display: block; max-height: 40px; max-width: 160px; width: auto; height: auto; object-fit: contain; }
.bp-head .org { font-size: 13.5px; font-weight: 600; }
.bp-head b { font: 700 20px/1.3 var(--font-head); }
.bp-head span { font-size: 14px; opacity: .9; }
.bp-body { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--bg); }
.bp-body .btn { pointer-events: none; }
.bp-chip { padding: 6px 12px; border-radius: 99px; background: var(--mark); color: var(--mark-ink); font: 600 14px var(--font-head); }
.logo-box { flex: none; display: grid; place-items: center; width: 140px; height: 84px; padding: 8px; border-radius: 12px; border: 1.5px dashed #a9b8be; background: #fff; }
.logo-box img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preset { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; padding: 4px 12px 4px 8px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--surface); font: 500 14px var(--font); color: var(--ink); cursor: pointer; }
.preset i { width: 16px; height: 16px; border-radius: 50%; }
.preset i + i { margin: 0 4px 0 -8px; box-shadow: 0 0 0 2px var(--surface); }
.color-pick { display: flex; gap: 8px; }
.color-pick input[type=color] { flex: none; width: 52px; height: 48px; padding: 2px; border: 1.5px solid #a9b8be; border-radius: 10px; background: var(--surface); }
.color-pick input[type=text] { min-width: 0; font-family: var(--font-head); }
.list > .pick { display: flex; align-items: center; gap: 14px; padding: 0 0 0 16px; }
.pick > input[type=checkbox] { flex: none; width: 24px; height: 24px; accent-color: var(--primary); }
.pick > a { display: block; padding: 14px 16px 14px 0; color: inherit; text-decoration: none; min-width: 0; }
.btn.danger[disabled] { background: var(--surface); color: #a9b8be; border-color: #c9d3d7; }
details.card summary { cursor: pointer; font: 600 16px var(--font-head); min-height: 28px; }
details.card[open] summary { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips span { background: var(--bg); border-radius: 8px; padding: 3px 9px; font-size: 14px; }
.report-grid { display: grid; gap: 14px; }
@media (min-width: 900px) {
  .report-grid { grid-template-columns: minmax(0, 5fr) minmax(0, 4fr); align-items: start; }
  .tiles { grid-template-columns: repeat(4, 1fr); }
  body.has-nav-desktop { padding-bottom: 76px; }
}

/* ---------- แอดมิน ---------- */
.menu a { display: flex; align-items: center; gap: 14px; }
.menu a .count { font: 600 22px var(--font-head); min-width: 44px; text-align: center; color: var(--primary); }
.menu a .chev { margin-left: auto; color: var(--muted); }
.menu a .count svg { width: 26px; height: 26px; vertical-align: middle; }
/* แท็บเลือกธุรกิจ (หน้าหัวข้อการตรวจ) */
.biz-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.biz-tabs a { display: inline-flex; align-items: center; min-height: 40px; padding: 6px 14px; border: 1.5px solid var(--primary);
  border-radius: 999px; color: var(--primary); font: 600 14.5px var(--font-head); text-decoration: none; }
.biz-tabs a[aria-current=page] { background: var(--primary); color: var(--primary-ink); }
.biz-tag { display: inline-block; padding: 1px 8px; border-radius: 6px; background: var(--primary-soft); color: var(--primary);
  font-size: 12.5px; font-weight: 600; vertical-align: 1px; }
/* ประวัติการแก้ไข */
.audit .when { font-size: 13.5px; color: var(--muted); }
.audit .what { margin-top: 4px; overflow-wrap: anywhere; }
.badge.act-create { background: var(--pass-soft); color: #0d5132; }
.badge.act-delete { background: var(--fail-soft); color: #8c2219; }
.badge.act-update, .badge.act-password { background: var(--mark-soft); color: #6b4e00; }
.brand-swatch::before { content: ""; display: inline-block; width: 26px; height: 26px; border-radius: 8px; background: var(--sw); vertical-align: middle; }
.coords { font-family: var(--font-head); font-variant-numeric: tabular-nums; }

.done-overlay { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 24px; background: rgba(15,42,53,.55); }
.done-card { width: 100%; max-width: 320px; padding: 28px 20px; border-radius: 20px; background: var(--surface); text-align: center; }
.done-card h2 { font-size: 22px; margin: 12px 0 4px; }
.done-mark { width: 64px; height: 64px; margin: 0 auto; border-radius: 50%; display: grid; place-items: center; background: var(--pass); color: #fff; font-size: 36px; font-weight: 700; line-height: 1; }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: 560px; margin: 0 auto; padding: 12px 16px; border-radius: 12px;
  background: var(--ink); color: #fff; font-weight: 500; text-align: center;
}
.toast.error { background: var(--fail); }

/* ---------- งานแจ้งซ่อม ---------- */
.ticket-row .meta, .timeline .when { font-size: 13.5px; color: var(--muted); margin-top: 3px; }
.ticket-row .small { margin-top: 2px; }
.timeline .what { margin-top: 4px; overflow-wrap: anywhere; }
.timeline .thumbs { margin-top: 8px; }
.late { color: var(--fail); }
.ticket-link { font-weight: 600; }
.filters .seg a.seg-link { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 14px; color: var(--primary);
  background: var(--surface); font: 600 14.5px var(--font-head); text-decoration: none; white-space: nowrap; }
.filters .seg a.seg-link + a.seg-link { border-left: 1.5px solid var(--primary); }
.filters .seg a.seg-link[aria-current=page] { background: var(--primary); color: var(--primary-ink); }

