/* ===== ภาษาการออกแบบกลางของ PGH — ใช้ร่วมกันทั้ง PGH MOBILE และระบบผลตรวจ =====

   ต้นฉบับเพียงไฟล์เดียวของหน้าตาระบบ แก้ที่นี่ที่เดียวแล้วเปลี่ยนทั้งสองระบบ
   เนื้อหาส่วนใหญ่ยกมาจาก PGH MOBILE ตรง ๆ เพราะเป็นระบบที่คนใช้งานอยู่จริง
   ระบบผลตรวจต้องปรับตามให้เหมือน ไม่ใช่ให้ PGH MOBILE ปรับมาหา

   PGH MOBILE รวมไฟล์นี้เข้าไปตอน build (build.sh)
   ระบบผลตรวจเรียกผ่าน <link href="/static/pgh-ui.css">

   ฟอนต์ไม่ได้อยู่ในนี้ เพราะสองระบบส่งฟอนต์คนละวิธี
   PGH MOBILE ฝังไว้ในไฟล์เดียวเพื่อให้เปิดแบบออฟไลน์ได้
   ระบบผลตรวจโหลดจาก /static/fonts/ เพื่อให้เบราว์เซอร์แคชไว้ใช้ซ้ำ           */

:root {
  /* ชุดสีอ้างอิงหน้าตาโปรแกรม PEAK — ม่วงเป็นสีหลัก น้ำเงินไว้กับลิงก์ เขียวน้ำทะเลไว้กับปุ่มยืนยัน */
  --brand: #5b5bd6; --brand-2: #eeeefc;
  --link: #2f7ff0; --link-2: #eaf3ff;
  --teal: #34c6bb; --coral: #f4785c;
  --navy: #2f3452;                 /* กล่องยอดรวม พื้นเข้มตัดกับตัวเลขขาว */
  --bg: #f3f5fd; --panel: #fff; --soft: #f5f6fb;
  --ink: #2b2f42; --muted: #7b8194; --line: #e6e9f2;
  --ok: #16a34a; --bad: #e5484d; --warn: #d97706;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(43,47,66,.05), 0 6px 16px rgba(43,47,66,.05);
  --head-h: 46px;                  /* ใช้คู่กับ sticky ให้แถบสีเลื่อนพ้นจอ เหลือแถบเมนูขาวค้างไว้ */
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "LINE Seed Sans TH", "LINESeedSansTH", "LINE Seed Sans", "LINESeedSans",
    "IBM Plex Sans Thai", "Noto Sans Thai", "Sarabun", -apple-system, "Helvetica Neue", sans-serif;
  font-size: 14px; line-height: 1.5;
}
h1, h2, h3 { margin: 0; font-weight: 600; }

/* ---- แถบบน: แถบสีไล่ระดับ + การ์ดเมนูขาวลอยอยู่บนแถบสี ---- */
/* topbar ยึดไว้ที่ค่าติดลบเท่าความสูงหัวเรื่อง เลื่อนหน้าลงแล้วหัวเรื่องจะไหลพ้นจอ
   เหลือการ์ดเมนูขาวค้างที่ขอบบน แบบเดียวกับ PEAK */
.topbar { position: sticky; top: calc(-1 * var(--head-h)); z-index: 30;
  background: linear-gradient(94deg, #7b5cf0 0%, #5b8def 36%, #35b6e8 70%, #4fd6c9 100%); }

header { height: var(--head-h); display: flex; gap: 12px; align-items: center;
  padding: 0 18px; color: #fff; }
header .brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
/* โลโก้เป็นสีน้ำเงินสองเฉด วางบนแถบไล่สีตรง ๆ จะจม จึงรองด้วยแผ่นขาว */
.brand-mark { width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: #fff; border: 1px solid rgba(255,255,255,.5);
  display: grid; place-items: center; padding: 3px; }
.brand-mark svg { width: 100%; height: 100%; display: block; }
.brand-text { font-weight: 600; font-size: 14px; line-height: 1.25; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-text small { display: block; font-weight: 400; font-size: 11px; opacity: .8; }
header .spacer { flex: 1; }
header .btn.ghost { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.34);
  color: #fff; }
header .btn.ghost:hover { background: rgba(255,255,255,.28); }
.userchip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px;
  background: var(--brand-2); color: var(--brand); padding: 5px 11px; border-radius: 999px; white-space: nowrap; }
.userchip b { font-weight: 600; }
.userchip em { font-style: normal; }
.userchip em::before { content: ' · '; }

/* การ์ดขาวที่รวมแถบเมนูกับแถบเครื่องมือไว้ด้วยกัน มุมบนโค้งให้เห็นแถบสีลอดออกมา */
.navcard { max-width: 1440px; margin: 0 auto; background: var(--panel);
  border-radius: 14px 14px 0 0; box-shadow: 0 3px 12px rgba(43,47,66,.09); }

/* ใช้ขึ้นบรรทัดใหม่แทนการเลื่อนซ้ายขวา เพราะ overflow จะไปตัดเมนูย่อยที่กางลงมาขาด */
nav.tabs { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; background: var(--panel);
  border-bottom: 1px solid var(--line); border-radius: 14px 14px 0 0; }
.menu { position: relative; }
.menu[hidden] { display: none; }

/* หัวเมนูบนแถบ ใช้หน้าตาเดียวกันทั้งเมนูกลุ่มและเมนูที่มีหน้าเดียว */
.menu-btn { display: flex; align-items: center; gap: 7px; padding: 10px 14px 9px;
  border: 0; background: none; cursor: pointer; font-size: 13.5px; color: var(--muted);
  border-radius: 12px 12px 0 0; white-space: nowrap; font-family: inherit;
  transition: background .15s, color .15s; }
.menu-btn i { display: flex; color: #a6abbd; transition: color .15s; }
/* เมนูที่เป็นลิงก์ข้ามเว็บ ต้องดูเหมือนปุ่มเมนูอื่นทุกประการ */
a.menu-btn { text-decoration: none; }
.menu-btn .chev { margin-left: -1px; opacity: .7; transition: transform .15s; }
.menu-btn:hover { color: var(--ink); background: var(--soft); }
.menu.open > .menu-btn, .menu.active > .menu-btn, .menu-btn.active {
  color: var(--ink); background: var(--soft); font-weight: 600; }
.menu.open > .menu-btn i, .menu.active > .menu-btn i, .menu-btn.active i { color: var(--brand); }
.menu.open > .menu-btn .chev { transform: rotate(180deg); }

/* เมนูย่อยกางลงมาเป็นการ์ดขาว ทับเนื้อหาด้านล่าง */
.submenu { display: none; position: absolute; top: 100%; left: 4px; z-index: 40;
  min-width: 232px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(43,47,66,.16); padding: 6px;
  flex-direction: column; gap: 2px; }
.menu.open .submenu { display: flex; }
.submenu .tab { display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 11px; border: 0; background: none; cursor: pointer; font-size: 13.5px;
  color: var(--ink); border-radius: 8px; white-space: nowrap; font-family: inherit;
  text-align: left; transition: background .15s, color .15s; }
.submenu .tab i { display: flex; color: #a6abbd; transition: color .15s; }
.submenu .tab:hover { background: var(--soft); }
.submenu .tab.active { background: var(--brand-2); color: var(--brand); font-weight: 600; }
.submenu .tab.active i { color: var(--brand); }
.submenu .tab[hidden] { display: none; }

.workbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
  padding: 7px 14px; background: var(--panel); }
.workbar .spacer { flex: 1; }
.workbar select { max-width: 340px; border-radius: 999px; padding: 5px 14px; }
.workbar .btn { padding: 6px 14px; }

main { padding: 18px 20px 96px; max-width: 1440px; margin: 0 auto; }

/* แถบปุ่มติดขอบล่างตามแบบ PEAK ชื่องานอยู่ซ้าย ปุ่มที่ใช้บ่อยอยู่ขวา */
.actionbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 11px 22px; background: var(--panel); border-top: 1px solid var(--line);
  box-shadow: 0 -3px 12px rgba(43,47,66,.09); }
.actionbar .spacer { flex: 1; }
.actionbar-title { font-size: 13.5px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 46vw; }

/* ---- ปุ่ม: ทรงแคปซูลตามแบบ PEAK ---- */
.btn { font-family: inherit; font-size: 13px; font-weight: 600; padding: 8px 16px;
  border-radius: 999px; border: 1px solid var(--brand); background: var(--brand);
  color: #fff; cursor: pointer; white-space: nowrap; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(1.06); }
.btn.ghost { background: #fff; color: var(--link); border-color: var(--link); font-weight: 500; }
.btn.ghost:hover { background: var(--link-2); }
.btn.go { background: var(--teal); border-color: var(--teal); }      /* ปุ่มยืนยัน/บันทึก */
.btn.coral { background: var(--coral); border-color: var(--coral); } /* ปุ่มพิมพ์เอกสาร */
.btn.tiny { padding: 4px 11px; font-size: 12px; }
.btn.danger { border-color: #f0c4c2; background: #fff; color: var(--bad); font-weight: 500; }
.btn.danger:hover { background: #fdeceb; }
.btn:disabled { opacity: .4; cursor: default; }

/* ---- ฟอร์ม ---- */
.grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 16px;
  background: var(--panel); padding: 22px; border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow); }
.grid .sec { grid-column: 1 / -1; }
/* หัวข้อย่อยแบบ PEAK: จุดสีนำหน้า ตัวหนาสีเข้ม ไม่ใช้เส้นคาดหนา */
h3.sec { display: flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 700;
  color: var(--ink); letter-spacing: 0; border-bottom: 1px solid var(--line);
  padding-bottom: 9px; margin-top: 10px; }
h3.sec::before { content: ''; width: 9px; height: 9px; border-radius: 50%;
  background: var(--brand); flex: none; }
h3.sec.nomargin { margin-top: 0; border: 0; padding: 0; }

/* ช่องกรอกแบบ PEAK: ป้ายชื่อตัวเล็กอยู่ในกรอบเดียวกับค่า ไม่ลอยอยู่ด้านนอก */
.f { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.f.wide { grid-column: 1 / -1; }
.f > span { font-size: 11.5px; color: var(--muted); line-height: 1.35; }
.f:has(> input), .f:has(> select), .f:has(> textarea) {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 7px 13px 8px; }
.f:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-2); }
.f > input, .f > select, .f > textarea {
  border: 0; padding: 0; border-radius: 0; background: none; font-size: 14px; }
.f > input:focus, .f > select:focus, .f > textarea:focus { outline: 0; box-shadow: none; }

input, select, textarea {
  font-family: inherit; font-size: 14px; padding: 7px 11px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff; color: var(--ink); width: 100%; min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-2); }

/* ตัวอักษรใบ้ในช่องวันที่ (dd/mm/yyyy) เบราว์เซอร์วาดเอง เปลี่ยนข้อความไม่ได้
   แต่จัดสไตล์ได้ผ่าน pseudo-element ทำเป็นตัวพิมพ์ใหญ่จะอ่านง่ายกว่า
   ค่าที่กรอกแล้วเป็นตัวเลขล้วน จึงไม่ได้รับผลกระทบ
   ใช้ได้กับ Chrome Edge Safari รวมทั้งบน iOS ส่วน Firefox จะยังเป็นตัวเล็กตามเดิม */
input[type="date"]::-webkit-datetime-edit,
input[type="time"]::-webkit-datetime-edit,
input[type="datetime-local"]::-webkit-datetime-edit,
input[type="month"]::-webkit-datetime-edit { text-transform: uppercase; }
textarea { resize: vertical; line-height: 1.6; }
/* ---- ช่องกรอกมาตรฐาน OMNICHECK: หน้าตาเดียวกันทุกระบบปฏิบัติการและเบราว์เซอร์ ----
   ปิดสไตล์ของเครื่อง (macOS/Windows/Android/iOS วาดไม่เหมือนกัน) แล้ววาดเองตามสีของระบบ */
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"]),
select, textarea { -webkit-appearance: none; appearance: none; box-shadow: none; }
input, select, textarea { color-scheme: light; -webkit-tap-highlight-color: transparent; }
::placeholder { color: #a3a9bb; opacity: 1; }
input:disabled, select:disabled, textarea:disabled { background: var(--soft); color: var(--muted); cursor: not-allowed; }
input[readonly]:not([data-date]) { background: var(--soft); }
/* ลูกศรเลื่อนตัวเลข / ปุ่มล้างช่องค้นหา / ปุ่มเปิดรหัสผ่านของ Edge ต่างกันทุกเครื่อง ซ่อนทั้งหมด */
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
input[type="number"]::-webkit-inner-spin-button, input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; display: none; }
input::-ms-reveal, input::-ms-clear { display: none; }
input::-webkit-calendar-picker-indicator { display: none !important; }
input::-webkit-contacts-auto-fill-button, input::-webkit-credentials-auto-fill-button { visibility: hidden; position: absolute; right: 0; }
/* ข้อความที่เบราว์เซอร์เติมให้อัตโนมัติ ไม่ให้พื้นเหลือง/ฟ้าของเครื่องทับสีระบบ */
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus, select:-webkit-autofill {
  -webkit-text-fill-color: var(--ink); -webkit-box-shadow: 0 0 0 40px #fff inset; caret-color: var(--ink); }
/* ดรอปดาวน์: ลูกศรของระบบ ไม่ใช้ลูกศรของเครื่อง */
select { cursor: pointer; padding-right: 32px !important; text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75 6 6.25l4.5-4.5' fill='none' stroke='%235b5bd6' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 12px 8px; }
.f > select { padding-right: 24px !important; background-position: right 4px center; }
select.open { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-2); }
select::-ms-expand { display: none; }
select option { color: var(--ink); background: #fff; }
/* ช่องวันที่/เวลา: ไอคอนของระบบ */
input[data-date], input[data-time] { cursor: pointer; padding-right: 32px; background-repeat: no-repeat; background-position: right 11px center; background-size: 15px 15px; }
input[data-date] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8194' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3.5' y='5' width='17' height='15.5' rx='3'/%3E%3Cpath d='M3.5 10h17M8 3v4M16 3v4'/%3E%3C/svg%3E"); }
input[data-time] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237b8194' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M12 7.5V12l3 2'/%3E%3C/svg%3E"); }
.f > input[data-date], .f > input[data-time] { padding-right: 24px; background-position: right 3px center; }

input.sm { max-width: 110px; } input.xs2 { max-width: 72px; } select.sm { max-width: 150px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border: 1px solid var(--line);
  border-radius: 999px; background: #fff; cursor: pointer; font-size: 13px; }
.chip input { width: auto; margin: 0; accent-color: var(--brand); }
.chip:has(input:checked) { background: var(--brand-2); border-color: var(--brand); color: var(--brand); font-weight: 600; }
label.chk { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
label.chk input { width: auto; accent-color: var(--brand); }

/* ประกาศ row ไว้ตรง ๆ เพราะกล่องนี้มักถูกใช้คู่กับ .f ซึ่งตั้ง column ไว้
   ไม่งั้นปุ่มสามอันจะเรียงลงมากินความสูงบนจอคอมโดยไม่จำเป็น (บนมือถือมีกฎ column ของตัวเอง) */
.inline-actions { display: flex; flex-direction: row; gap: 8px; align-items: center;
  flex-wrap: wrap; }
.f.inline-actions { justify-content: center; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap; margin: 18px 0 8px; }
.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; align-items: start; }
/* ช่องในกริดมี min-width auto มาแต่เดิม ตารางกว้าง ๆ ข้างในจึงดันคอลัมน์ให้กว้างเกินจอ
   ตั้งเป็น 0 เพื่อให้ .scroll-x ข้างในทำหน้าที่เลื่อนแทนการดันทั้งหน้า */
.cols2 > * { min-width: 0; }
.scroll-x { overflow-x: auto; }
.total { font-weight: 600; color: var(--brand); font-size: 13px; }
.hint { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.hint.ok { color: var(--ok); }

/* ---- ตาราง ---- */
table.tbl { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
table.tbl th { background: var(--soft); font-weight: 600; font-size: 12px; color: var(--muted);
  text-align: left; padding: 10px 11px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.tbl td { padding: 6px 11px; border-bottom: 1px solid #f0f2f8; vertical-align: middle; }
table.tbl tbody tr:hover td { background: #fbfbfe; }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tr.dim { opacity: .45; }
table.tbl td input, table.tbl td select { padding: 4px 6px; font-size: 13px; }
.mid { text-align: center; } .right { text-align: right; }
.muted { color: var(--muted); } .bold { font-weight: 700; }
.warn { color: var(--warn); } td.warn { font-weight: 600; }
.badge { display: inline-block; background: var(--brand-2); color: var(--brand); border-radius: 999px;
  padding: 0 7px; font-size: 11px; font-weight: 700; }
.rolecell { font-weight: 600; white-space: nowrap; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11px;
  background: var(--soft); color: var(--muted); white-space: nowrap; }
.tag.in, .tag.return { background: #e6f5ec; color: var(--ok); }
.tag.issue, .tag.waste { background: #fdecea; color: var(--bad); }
.tag.adjust { background: #fdf3e2; color: var(--warn); }
.tag.warn { background: #fdf3e2; color: var(--warn); }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--panel); border: 0; border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column-reverse;
  gap: 3px; }
.stat b { display: block; font-size: 26px; color: var(--ink); font-weight: 700;
  font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat span { font-size: 12px; color: var(--muted); }
.stat.bad b { color: var(--bad); }

/* ---- แจ้งเตือน ---- */
.toast { position: fixed; bottom: 78px; left: 50%; transform: translate(-50%, 20px);
  background: #17212f; color: #fff; padding: 9px 18px; border-radius: 999px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: .2s; z-index: 100; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); }


/* ===== ส่วนที่ระบบผลตรวจใช้ =====
   เขียนด้วยโทเค็นชุดเดียวกับข้างบน จะได้กลมกลืนกัน และ PGH MOBILE หยิบไปใช้ได้ด้วย */

/* กล่องเนื้อหา — เทียบเท่า .grid แต่ไม่บังคับเป็นตาราง 4 ช่อง */
.card { background: var(--panel); padding: 22px; border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }
.card > strong { display: block; margin-bottom: 4px; font-size: 15px; }

/* แท็บของระบบผลตรวจเป็นลิงก์ เพราะเปลี่ยนหน้าจริง ไม่ใช่สลับในหน้าเดียวแบบ PGH MOBILE
   หน้าตาต้องออกมาเหมือน .tab ทุกประการ */
/* :not(.menu-btn) สำคัญมาก — PGH MOBILE มีลิงก์ที่ใช้หน้าตาปุ่มเมนูอยู่ใน nav.tabs ด้วย
   ถ้าไม่กันไว้ กฎนี้จะไปทับ .menu-btn จนไอคอนกับข้อความหลุดคนละบรรทัด */
nav.tabs a:not(.menu-btn) {
  padding: 12px 14px; border: 0; background: none; cursor: pointer; font-size: 14px;
  color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap;
  font-family: inherit; text-decoration: none; display: inline-block;
  transition: color .15s, border-color .15s; }
nav.tabs a:not(.menu-btn):hover { color: var(--ink); }
nav.tabs a:not(.menu-btn).active { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }

/* ตารางแบบหัวข้อ–ค่า ใช้ในหน้ารายละเอียด */
table.kv th { width: 230px; }

/* กล่องข้อความผลลัพธ์ในหน้า — คู่กับ .toast ที่เป็นข้อความลอยชั่วคราว */
.msg { padding: 11px 14px; border-radius: 10px; margin-bottom: 14px; font-size: 13.5px; }
.msg.ok  { background: #e9f7ee; border: 1px solid #bfe6cd; color: var(--ok); }
.msg.err { background: #fdecea; border: 1px solid #f4c9c7; color: var(--bad); }
.msg.warn{ background: #fdf3e2; border: 1px solid #f0dfae; color: #8a5d10; }

.tag.ok { background: #e6f5ec; color: var(--ok); }
.tag.bad { background: #fdecea; color: var(--bad); }

/* ฟอร์มแนวนอน — ช่องกรอกไม่ควรยืดเต็มความกว้าง */
form.inline { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
form.inline input, form.inline select { width: auto; max-width: 340px; }
input[type=checkbox], input[type=radio] { width: auto; min-width: 0; accent-color: var(--brand); }

code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 12px;
  background: var(--soft); border-radius: 5px; padding: 1px 5px; }
a { color: var(--link); }
h1 { font-size: 20px; }

/* จอสัมผัส: select ไม่รับการแตะเอง (กันเมนูของ iOS/Android) — ระบบเปิดเมนูของตัวเองจากตำแหน่งที่แตะ */
@media (pointer: coarse) { select:not([multiple]):not([disabled]) { pointer-events: none; } }

/* ชื่อระบบบนแถบบน: ตัวอักษร OMNICHECK ตัวโตเว้นระยะ แทนโลโก้ */
.brand-word { font-weight: 700; font-size: 25px; letter-spacing: .2em; line-height: 1; color: #fff; white-space: nowrap; text-shadow: 0 1px 2px rgba(20, 20, 60, .18); }
@media (max-width: 640px) { .brand-word { font-size: 15px; letter-spacing: .1em; } }
@media (max-width: 440px) { .brand-word { font-size: 13px; letter-spacing: .05em; } }

/* ท้ายหน้า: ชื่อระบบ ลิขสิทธิ์ Last updated */
.appfoot { max-width: 1440px; margin: 0 auto; padding: 18px 20px 110px; text-align: center; color: var(--muted); font-size: 12px; line-height: 1.7; border-top: 1px solid var(--line); }
.appfoot .af-name { color: var(--ink, inherit); font-size: 13px; }
.appfoot .linkbtn { background: none; border: 0; padding: 0; color: var(--brand); font: inherit; cursor: pointer; text-decoration: underline; }
@media print { .appfoot { display: none; } }
.appfoot details { margin-top: 2px; }
.appfoot summary { cursor: pointer; color: var(--brand); text-decoration: underline; display: inline; }
.appfoot .af-notice { text-align: left; max-width: 860px; margin: 8px auto 0; font-size: 11.5px; }
.appfoot .af-notice div { padding: 2px 0; }
