/* LTAX ทีมเทส — โต๊ะทำงานของคนเทส: แถบเมนูบน, รายการเคสซ้าย / รายละเอียด+ฟอร์มรายงานขวา (มือถือซ้อนเป็นหน้าเดียว)
   สีหลัก = น้ำเงินหมึกตราราชการ / สีสถานะแยกจากสีหลัก: ผ่าน เขียว · บัค แดงอิฐ · ทดสอบไม่ได้ อำพัน · ยังไม่เทส เทา */
:root {
  --paper: #f4f6f9; --surface: #ffffff; --sunk: #eef1f6; --ink: #17202e; --muted: #5a6577; --line: #dce1e9;
  --accent: #2b4fa3; --accent-ink: #ffffff; --accent-soft: #e5ebf8;
  --pass: #1b7a52; --pass-soft: #e2f3ea; --bug: #bf3a2b; --bug-soft: #fbe8e5; --block: #a86400; --block-soft: #fbf0dc; --none: #98a1b0;
  --f-body: "IBM Plex Sans Thai", "Leelawadee UI", "Tahoma", sans-serif; --f-mono: "IBM Plex Mono", ui-monospace, "Consolas", monospace;
  --r: 8px; --shadow: 0 1px 2px rgb(20 30 50 / .06), 0 4px 14px rgb(20 30 50 / .06);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0f131a; --surface: #171c25; --sunk: #12161d; --ink: #e6eaf1; --muted: #9aa4b5; --line: #29313f;
  --accent: #8ea9f2; --accent-ink: #0f1626; --accent-soft: #1f2a44;
  --pass: #4fc48c; --pass-soft: #15291f; --bug: #f2786b; --bug-soft: #33191a; --block: #f0b65c; --block-soft: #30240f; --none: #5f6878;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0f131a; --surface: #171c25; --sunk: #12161d; --ink: #e6eaf1; --muted: #9aa4b5; --line: #29313f;
  --accent: #8ea9f2; --accent-ink: #0f1626; --accent-soft: #1f2a44;
  --pass: #4fc48c; --pass-soft: #15291f; --bug: #f2786b; --bug-soft: #33191a; --block: #f0b65c; --block-soft: #30240f; --none: #5f6878;
  --shadow: 0 1px 2px rgb(0 0 0 / .3); color-scheme: dark; }

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--paper); color: var(--ink); font: 15px/1.6 var(--f-body); -webkit-text-size-adjust: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.3; text-wrap: balance; margin: 0; }
.mono { font-family: var(--f-mono); font-size: .86em; letter-spacing: .01em; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }
.wrap { max-width: 1280px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.boot { padding: 40px 16px; text-align: center; color: var(--muted); }

/* แถบบน */
.top { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 16px; min-height: 56px; flex-wrap: wrap; padding-block: 6px; }
.brand { display: flex; align-items: baseline; gap: 8px; font-weight: 700; letter-spacing: .01em; }
.brand b { color: var(--accent); }
.brand small { font-weight: 500; color: var(--muted); font-size: 12px; }
/* แถบบน 2 ชั้น: ชั้นบน = ชื่อระบบ ตัวเลือก และผู้ใช้ / ชั้นล่าง = แท็บเมนูเต็มความกว้าง (กันแท็บตกบรรทัดทีละอัน) */
.tabs { display: flex; flex-wrap: wrap; gap: 2px; order: 10; flex: 1 1 100%; min-width: 0; border-top: 1px solid var(--line); padding-top: 4px; margin-top: -2px; }
.top .me { margin-left: auto; }
.prog-none { font-size: 12.5px; color: var(--muted); }
.prog-wrap { display: inline-flex; align-items: center; gap: 8px; }
.prog-pct { font-family: var(--f-mono); font-size: 12px; color: var(--muted); min-width: 34px; }
@media (max-width: 760px) {
  .top .wrap { gap: 8px; }
  .switch button { padding: 3px 9px; font-size: 13px; }
  .top .me { width: 100%; justify-content: flex-end; margin-left: 0; }
  .top .me .who { margin-right: auto; }
  .chip-btn { padding: 3px 10px; font-size: 12.5px; }
  .kpi { padding: 12px 14px; }
  .dcard { padding: 14px 14px; }
}
@media (max-width: 760px) { .tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; } .tabs::-webkit-scrollbar { display: none; } }
.tabs a { padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--muted); font-weight: 500; white-space: nowrap; }
.tabs a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
.tabs a .count { font-family: var(--f-mono); font-size: 12px; margin-left: 4px; }
.me { display: flex; align-items: center; gap: 8px; }
.me .who { font-weight: 600; }
.chip-btn { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 4px 12px; cursor: pointer; font-size: 13px; }
.chip-btn:hover { border-color: var(--accent); }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; padding: 2px; background: var(--sunk); flex: none; }
.switch button { border: 0; background: none; padding: 4px 12px; border-radius: 6px; cursor: pointer; font-size: 13.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.switch button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .12); font-weight: 600; }
.switch button.prod[aria-pressed="true"] { background: var(--bug); color: #fff; }
.banner.prod { background: var(--bug-soft); border-bottom: 2px solid var(--bug); }
.report.prod { border-color: var(--bug); }
.env-prod { color: var(--bug); font-weight: 700; }
.banner { background: var(--block-soft); color: var(--ink); font-size: 13px; }
.banner .wrap { padding-block: 6px; }

main.wrap { padding-block: 20px 60px; }

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 8px 16px; cursor: pointer; font-weight: 500; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.primary:disabled { opacity: .5; cursor: progress; }
.btn.small { padding: 4px 10px; font-size: 13px; }

/* สถานะ */
.pill { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; padding: 1px 10px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.pill.pass { background: var(--pass-soft); color: var(--pass); }
.pill.bug { background: var(--bug-soft); color: var(--bug); }
.pill.blocked { background: var(--block-soft); color: var(--block); }
.pill.none { background: var(--sunk); color: var(--muted); }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; background: var(--line); flex: none; }
.dot.pass { background: var(--pass); } .dot.bug { background: var(--bug); } .dot.blocked { background: var(--block); }
.dots { display: inline-flex; gap: 3px; }
.sev { font-size: 12px; font-weight: 600; padding: 0 8px; border-radius: 4px; border: 1px solid currentColor; }
.sev.critical { color: var(--bug); } .sev.high { color: var(--bug); } .sev.medium { color: var(--block); } .sev.low { color: var(--muted); }

/* login */
.auth { max-width: 420px; margin: 8vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px; box-shadow: var(--shadow); display: grid; gap: 14px; }
.auth h1 { font-size: 22px; }
.field { display: grid; gap: 4px; }
.field label { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input, .field textarea, .field select { width: 100%; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 9px 12px; }
.field textarea { min-height: 96px; resize: vertical; }
.err { color: var(--bug); font-size: 13px; }
.hint { color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.names { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.names button { padding: 14px 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 600; font-size: 16px; }
.names button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.names button:disabled { opacity: .4; cursor: not-allowed; }

/* วิธีทดสอบ */
.guide { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.guide article { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 28px 32px; max-width: 76ch; }
.guide article h1 { font-size: 26px; margin-bottom: 6px; }
.guide article h2 { font-size: 18px; margin: 28px 0 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.guide article p, .guide article li { max-width: 68ch; }
.guide article ol, .guide article ul { padding-left: 22px; display: grid; gap: 6px; }
.criteria { display: grid; gap: 8px; margin: 10px 0; }
.criteria div { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 12px; border-radius: var(--r); background: var(--sunk); }
.kbd { font-family: var(--f-mono); font-size: 12.5px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 6px; background: var(--surface); white-space: nowrap; }
.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px; display: grid; gap: 10px; position: sticky; top: 124px; }
.aside-card h3 { font-size: 15px; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: 14px; }
.facts dt { color: var(--muted); } .facts dd { margin: 0; font-weight: 500; overflow-wrap: anywhere; }

/* test case */
.board { display: grid; grid-template-columns: 250px minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; align-items: start; }
.mods { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px; display: grid; gap: 2px; }
.mods .grp { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; letter-spacing: .03em; color: var(--ink); font-weight: 700; padding: 12px 10px 4px; }
.mods .grp:first-child { padding-top: 6px; }
.mods .grp .mono { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.mods .grp:not(:first-child) { border-top: 1px solid var(--line); margin-top: 6px; }
.mods button { padding-left: 18px !important; }
.mods button { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; width: 100%; text-align: left; border: 0; background: none; padding: 9px 10px; border-radius: 8px; cursor: pointer; align-items: center; }
.mods button:hover { background: var(--sunk); }
.mods button[aria-pressed="true"] { background: var(--accent-soft); }
.mods button .t { font-size: 14px; font-weight: 500; }
.mods button .n { font-family: var(--f-mono); font-size: 12px; color: var(--muted); background: var(--sunk); border-radius: 999px; padding: 0 8px; }
.mods button[aria-pressed="true"] .t { color: var(--accent); font-weight: 600; }
.mods button[aria-pressed="true"] .n { background: var(--surface); }
.mods .bar { grid-column: 1 / -1; height: 4px; border-radius: 2px; background: var(--sunk); overflow: hidden; display: flex; }
.mods .bar i { display: block; height: 100%; }
.bar i.pass { background: var(--pass); } .bar i.bug { background: var(--bug); } .bar i.blocked { background: var(--block); }

.list { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.list-head { padding: 12px; display: grid; gap: 8px; border-bottom: 1px solid var(--line); }
.list-head input { width: 100%; border: 1px solid var(--line); border-radius: var(--r); padding: 7px 12px; background: var(--surface); }
.seg { display: flex; flex-wrap: wrap; gap: 4px; }
.seg button { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 2px 10px; font-size: 12.5px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.case-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; text-align: left; width: 100%; background: none; border-left: 3px solid transparent; border-right: 0; border-top: 0; }
.case-row:hover { background: var(--sunk); }
.case-row[aria-current="true"] { background: var(--accent-soft); border-left-color: var(--accent); }
.case-row .id { font-family: var(--f-mono); font-size: 12px; color: var(--muted); }
.case-row .nm { grid-column: 1 / -1; font-size: 14px; }
.case-row .right { display: flex; gap: 8px; align-items: center; }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.detail { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: grid; gap: 18px; position: sticky; top: 124px; max-height: calc(100vh - 140px); overflow: auto; }
.detail h2 { font-size: 19px; }
.detail .meta { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 13px; }
.back { display: none; }
.prep { background: var(--sunk); border-radius: var(--r); padding: 12px 14px; font-size: 14px; }
.prep summary { cursor: pointer; font-weight: 600; }
.prep ul { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 4px; }
.known { background: var(--block-soft); border-radius: var(--r); padding: 8px 12px; font-size: 13.5px; }
.sec-t { font-size: 12px; letter-spacing: .06em; font-weight: 700; color: var(--muted); margin-bottom: 6px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; counter-reset: s; }
.steps li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; align-items: start; counter-increment: s; padding: 4px 0; }
.steps li::before { content: counter(s); font-family: var(--f-mono); font-size: 12px; color: var(--muted); text-align: right; padding-top: 3px; }
.steps input { margin-top: 5px; width: 16px; height: 16px; accent-color: var(--accent); }
.steps li.done span { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--line); }
.expected { border-left: 3px solid var(--pass); padding: 6px 12px; background: var(--pass-soft); border-radius: 0 var(--r) var(--r) 0; }
.team-row { display: flex; flex-wrap: wrap; gap: 6px; }
.team-row span { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 10px 1px 7px; font-size: 13px; }

.report { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; background: var(--paper); }
.choice { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.choice button { border: 2px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 6px; cursor: pointer; font-weight: 600; display: grid; gap: 2px; }
.choice button small { font-weight: 400; color: var(--muted); font-size: 12px; }
.choice button.pass[aria-pressed="true"] { border-color: var(--pass); background: var(--pass-soft); color: var(--pass); }
.choice button.bug[aria-pressed="true"] { border-color: var(--bug); background: var(--bug-soft); color: var(--bug); }
.choice button.blocked[aria-pressed="true"] { border-color: var(--block); background: var(--block-soft); color: var(--block); }
.sevs { display: flex; flex-wrap: wrap; gap: 6px; }
.sevs label { border: 1px solid var(--line); border-radius: 999px; padding: 3px 12px; font-size: 13px; cursor: pointer; background: var(--surface); }
.sevs input { position: absolute; opacity: 0; pointer-events: none; }
.sevs label:has(input:checked) { border-color: var(--bug); color: var(--bug); font-weight: 600; }
.sevs label:has(input:focus-visible) { outline: 2px solid var(--accent); }
.drop { border: 2px dashed var(--line); border-radius: var(--r); padding: 14px; text-align: center; font-size: 13.5px; color: var(--muted); cursor: pointer; background: var(--surface); }
.drop.over { border-color: var(--accent); color: var(--accent); }
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; }
.thumb { position: relative; width: 92px; height: 70px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); background: var(--sunk); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.thumb button { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; cursor: pointer; font-size: 12px; line-height: 1; }
.thumb a { padding: 4px; text-align: center; overflow-wrap: anywhere; }

.history { display: grid; gap: 10px; }
.h-item { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 6px; }
.h-item .top-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.h-item p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }

/* บัค */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 6px 10px; }
.bugs { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 14px; }
.bug-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: grid; gap: 8px; align-content: start; }
.bug-card .hd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.bug-card h3 { font-size: 15px; font-weight: 600; }
.bug-card h3 a { color: inherit; text-decoration: none; } .bug-card h3 a:hover { color: var(--accent); }
.bug-card p { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; }
.bug-card .ft { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border-top: 1px solid var(--line); padding-top: 8px; font-size: 13px; }
.bug-card .ft select { border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; background: var(--surface); }
.retested { color: var(--pass); font-weight: 600; }

/* ภาพรวม */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 26px; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--muted); }
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13.5px; font-variant-numeric: tabular-nums; }
table.grid th, table.grid td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.grid th { font-size: 12px; color: var(--muted); font-weight: 600; background: var(--sunk); }
table.grid td.num { text-align: right; }
.prog { width: 120px; height: 8px; border-radius: 4px; background: var(--sunk); display: flex; overflow: hidden; }
.prog i { display: block; height: 100%; }
.cell-done { color: var(--pass); font-weight: 600; } .cell-part { color: var(--ink); } .cell-zero { color: var(--muted); }

/* ภาพรวมทีม (dashboard) — การ์ดเรียบ เส้นบาง สถานะใช้สีชุดเดียวกับทั้งแอป พร้อมป้ายข้อความ */
.dash { display: grid; gap: 16px; }
.dash-head h1 { font-size: 22px; }
.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; display: grid; gap: 2px; align-content: start; }
.kpi-l { font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: .03em; }
.kpi-v { font-size: 34px; line-height: 1.15; font-weight: 700; color: var(--ink); }
.kpi-v small { font-size: 18px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.kpi-s { font-size: 13px; color: var(--muted); }
.kpi-bar { height: 6px; border-radius: 3px; background: var(--sunk); margin-top: 8px; overflow: hidden; }
.kpi-bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.dash-grid { display: grid; gap: 16px; align-items: stretch; }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.g-1-1 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.dcard { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 18px 20px; display: grid; gap: 6px; align-content: start; min-width: 0; }
.dcard h2 { font-size: 15.5px; font-weight: 700; }
.dcard > .hint { margin: 0 0 6px; }
.dcard-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dcard summary { cursor: pointer; }
.lgd { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.lgd span { display: inline-flex; align-items: center; gap: 5px; }
.lgd i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; }
.donut { width: 160px; height: 160px; flex: none; }
.donut circle[data-tip] { cursor: default; }
.donut-big { font-size: 26px; font-weight: 700; fill: var(--ink); font-family: var(--f-body); }
.donut-sub { font-size: 11px; fill: var(--muted); font-family: var(--f-body); }
.dlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; min-width: 150px; }
.dlist li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 40px; gap: 8px; align-items: center; font-size: 14px; }
.dlist li i { width: 10px; height: 10px; border-radius: 3px; }
.dlist li b, .dlist .hint { text-align: right; font-variant-numeric: tabular-nums; }
.daily { width: 100%; height: auto; display: block; }
.daily .grid { stroke: var(--line); stroke-width: 1; }
.daily .base { stroke: var(--muted); stroke-width: 1; opacity: .5; }
.daily .ax { font-size: 10.5px; fill: var(--muted); font-family: var(--f-body); }
.daily .ax-empty { font-size: 13px; fill: var(--muted); font-family: var(--f-body); }
.daily g:hover rect:not([fill="transparent"]) { opacity: .85; }
.plist { display: grid; gap: 10px; }
.prow { display: grid; grid-template-columns: minmax(90px, 150px) minmax(0, 1fr) 64px; gap: 12px; align-items: center; }
.prow.muted-row { opacity: .55; }
.pname { display: grid; line-height: 1.3; min-width: 0; }
.pname b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pval { display: grid; text-align: right; line-height: 1.25; font-variant-numeric: tabular-nums; }
.hbar { height: 10px; border-radius: 5px; background: var(--sunk); display: flex; gap: 2px; overflow: hidden; }
.hbar.thin { height: 8px; }
.hbar i { display: block; height: 100%; }
.hbar i:last-child { border-radius: 0 5px 5px 0; }
.bugtag { font-size: 11.5px; color: var(--bug); font-weight: 600; }
.sevlist { display: grid; gap: 12px; margin-top: 4px; }
.sevrow { display: grid; grid-template-columns: 64px minmax(0, 1fr) 32px; gap: 10px; align-items: center; }
.sevrow .sev { text-align: center; }
.sevrow b { text-align: right; font-variant-numeric: tabular-nums; }
.rlist { display: grid; gap: 2px; }
.ritem { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 6px; border-radius: 8px; text-decoration: none; color: inherit; }
.ritem:hover { background: var(--sunk); }
.rmain { display: grid; min-width: 0; line-height: 1.35; }
.rmain b { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-ok { padding: 24px 0; text-align: center; color: var(--pass); font-weight: 600; }
#tip { position: fixed; z-index: 70; pointer-events: none; background: var(--ink); color: var(--surface); font-size: 12.5px; padding: 6px 10px; border-radius: 6px; box-shadow: var(--shadow); max-width: 280px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-1-2, .g-1-1 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .prow { grid-template-columns: minmax(70px, 100px) minmax(0, 1fr) 52px; gap: 8px; } .kpi-v { font-size: 28px; } }

/* เพิ่ม test case */
.admin { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.card-form { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; display: grid; gap: 14px; }
.card-form h2 { font-size: 18px; }
.newmod { border: 1px dashed var(--accent); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 10px; margin: 0; background: var(--accent-soft); }
.newmod legend { font-weight: 600; color: var(--accent); padding: 0 6px; font-size: 13px; }
.id-preview { background: var(--sunk); border-radius: var(--r); padding: 8px 12px; font-size: 14px; }
.switch button:disabled { opacity: .5; cursor: not-allowed; }
.form-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.form-foot { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); padding-block: 10px 2px; border-top: 1px solid var(--line); }
.stepno { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-size: 12px; margin-right: 6px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.tc-rows { display: grid; gap: 12px; }
.tc-row { border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--r); padding: 12px 14px; display: grid; gap: 10px; background: var(--paper); }
.tc-row-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tc-row-head .chip-btn { margin-left: auto; }
.tc-badge { font-family: var(--f-mono); font-weight: 700; font-size: 15px; background: var(--accent); color: var(--accent-ink); border-radius: 6px; padding: 2px 10px; letter-spacing: .03em; }
.tc-full { font-size: 12px; }
.add-row { justify-self: start; border-style: dashed; color: var(--accent); }
.cm-group { display: grid; gap: 4px; }
.cm-title { font-size: 13px; font-weight: 700; color: var(--muted); padding-top: 6px; }
.cm-item { display: flex; justify-content: space-between; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font-size: 14px; }
.cm-item.archived { opacity: .6; }
.cm-act { display: flex; gap: 6px; flex: none; }
.assigned { background: var(--accent-soft); color: var(--ink); border-radius: var(--r); padding: 10px 14px; margin: 8px 0 4px; font-size: 14.5px; }
.mpick { display: grid; gap: 10px; margin-top: 6px; }
.mp-scope { display: grid; gap: 6px; }
.mp-grp { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.mp-grp .hint { min-width: 92px; font-weight: 600; }
.mp-item { display: inline-flex; gap: 5px; align-items: center; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px 2px 7px; font-size: 13px; background: var(--surface); cursor: pointer; }
.mp-item:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.mp-item input { accent-color: var(--accent); }
.mem-mods { font-size: 13px; }
.mem-mods.unassigned b { color: var(--block); }
.mods-edit { border: 1px dashed var(--accent); border-radius: var(--r); padding: 10px; display: grid; gap: 8px; }
table.grid td.wrap-cell { white-space: normal; min-width: 120px; max-width: 220px; }
.mem { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; display: grid; gap: 4px; }
.mem.archived { opacity: .65; }
.mem-top { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.mem-act { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.invite { border: 1px solid var(--pass); background: var(--pass-soft); border-radius: var(--r); padding: 12px; display: grid; gap: 8px; }
.invite textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 8px; font: 13.5px/1.5 var(--f-body); background: var(--surface); resize: vertical; }
.chip-btn.danger { border-color: var(--bug); color: var(--bug); font-weight: 600; }
@media (max-width: 600px) { .two { grid-template-columns: minmax(0, 1fr); } .cm-item { flex-direction: column; align-items: stretch; } }
@media (max-width: 900px) { .admin { grid-template-columns: minmax(0, 1fr); } }

#lightbox { position: fixed; inset: 0; z-index: 50; background: rgb(8 10 15 / .88); display: grid; place-items: center; padding: max(16px, env(safe-area-inset-top, 0px)) 16px; }
#lightbox img { max-width: 100%; max-height: 92vh; border-radius: 6px; background: #fff; }
.lb-close { position: fixed; top: calc(12px + env(safe-area-inset-top, 0px)); right: calc(12px + env(safe-area-inset-right, 0px)); width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgb(255 255 255 / .15); color: #fff; font-size: 18px; cursor: pointer; }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom, 0px)); z-index: 60; background: var(--ink); color: var(--surface); padding: 10px 18px; border-radius: 999px; font-size: 14px; box-shadow: var(--shadow); max-width: calc(100% - 32px); }

@media (max-width: 1100px) {
  .board { grid-template-columns: 220px minmax(0, 1fr); }
  .board .detail { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 760px) {
  .guide { grid-template-columns: minmax(0, 1fr); }
  .guide article { padding: 20px 18px; }
  .aside-card { position: static; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .mods { position: static; max-height: none; display: flex; gap: 6px; overflow-x: auto; padding: 6px; }
  .mods .grp { display: none; }
  .mods button { width: auto; flex: none; white-space: nowrap; }
  .mods .bar { display: none; }
  .board.has-detail .mods, .board.has-detail .list { display: none; }
  .back { display: inline-flex; justify-self: start; }
  .criteria div { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .choice { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }
