:root {
  --navy: #14213d; --navy-2: #1d2d50; --ink: #1b1f24; --muted: #6b7280; --line: #e5e7eb;
  --bg: #f6f7f9; --card: #fff; --accent: #2563eb; --ok: #15803d; --bad: #b91c1c; --warn: #a16207;
  --soil: #e5484d; --waste: #22b26b;
  font-family: "Sarabun", "Noto Sans Thai", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 15px; }
.top { height: 48px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--navy); color: #fff; }
.top .tag { font-size: 12px; background: #fbbf24; color: #1f2937; border-radius: 4px; padding: 2px 6px; }
.top .muted { color: #cbd5e1; font-size: 13px; }
.grow { flex: 1; }
.muted { color: var(--muted); }
.layout { display: grid; grid-template-columns: 210px 1fr 380px; height: calc(100vh - 48px); }
.steps { background: var(--navy-2); color: #cbd5e1; padding: 14px 0; }
.steps button { all: unset; display: flex; gap: 10px; align-items: center; width: 100%; padding: 10px 16px; cursor: pointer; font-size: 14px; box-sizing: border-box; }
.steps button[disabled] { opacity: .45; cursor: default; }
.steps button.on { background: rgba(255,255,255,.1); color: #fff; box-shadow: inset 3px 0 #fbbf24; }
.steps .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; background: rgba(255,255,255,.12); }
.steps .done .n { background: #22c55e; color: #052e16; }
.stage { overflow: auto; display: grid; place-items: start center; padding: 14px; }
.canvas-wrap { position: relative; }
#cv { display: block; max-height: calc(100vh - 80px); max-width: 100%; height: auto; background: #111; border-radius: 6px; cursor: crosshair; }
.empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; border: 2px dashed #94a3b8; border-radius: 8px; background: #fff; min-width: 520px; min-height: 420px; }
.empty.drag { border-color: var(--accent); background: #eff6ff; }
.panel { background: var(--card); border-left: 1px solid var(--line); padding: 18px; overflow: auto; }
.panel h1 { font-size: 20px; margin: 0 0 6px; }
.panel p { margin: 6px 0 12px; line-height: 1.5; }
.main-btn { width: 100%; padding: 12px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 16px; font-family: inherit; cursor: pointer; margin-top: 12px; }
.main-btn[disabled] { background: #94a3b8; cursor: default; }
.sub-btn { padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: inherit; font-size: 14px; cursor: pointer; }
.row { display: flex; gap: 8px; align-items: center; margin: 8px 0; flex-wrap: wrap; }
.row label { min-width: 60px; }
.row input, .row select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; font-size: 15px; width: 90px; }
.palette { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.palette button { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-family: inherit; font-size: 14px; cursor: pointer; text-align: left; display: flex; gap: 6px; align-items: center; }
.palette button.on { border-color: var(--accent); background: #eff6ff; }
.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.count { margin-left: auto; color: var(--muted); font-size: 13px; }
.hint { font-size: 13px; color: var(--muted); background: #f8fafc; border-radius: 6px; padding: 8px 10px; }
.big { font-size: 28px; font-weight: 700; }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0; }
.kpi { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.kpi .v { font-size: 20px; font-weight: 700; }
.kpi .l { font-size: 12px; color: var(--muted); }
table { width: 100%; border-collapse: collapse; font-size: 13px; margin: 6px 0 12px; }
th, td { text-align: left; padding: 5px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 500; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.chip { font-size: 12px; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.chip.pass { background: #dcfce7; color: var(--ok); }
.chip.fail { background: #fee2e2; color: var(--bad); }
.chip.notModeled { background: #fef3c7; color: var(--warn); }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: var(--muted); margin: 8px 0; }
.legend i { display: inline-block; width: 18px; height: 4px; vertical-align: middle; margin-right: 4px; }
details { margin: 8px 0; font-size: 13px; }
details li { margin: 3px 0; }
.err { color: var(--bad); background: #fef2f2; border-radius: 6px; padding: 8px 10px; }

.chip.notChecked { background: #e5e7eb; color: #374151; }
.seg { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 8px 0 4px; }
.seg button { flex: 1; padding: 8px; border: 0; background: #fff; font-family: inherit; font-size: 14px; cursor: pointer; }
.seg button.on { background: var(--navy); color: #fff; }
.stage { position: relative; }
.bim { position: absolute; inset: 14px; display: grid; grid-template-rows: auto 1fr; background: #f4f5f7; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.bim[hidden], .canvas-wrap[hidden] { display: none; }
.bim-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--line); font-size: 13px; }
.bim-bar button { padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; font-family: inherit; cursor: pointer; }
.bim-bar label { display: inline-flex; gap: 4px; align-items: center; margin-left: 6px; }
#bim-cv { width: 100%; height: 100%; display: block; min-height: 0; }
.bim-info { position: absolute; left: 12px; bottom: 12px; right: 12px; background: #fff; border-radius: 6px; padding: 8px 12px; box-shadow: 0 1px 4px rgba(0,0,0,.15); font-size: 13px; }

.small { font-size: 12px; }
.auto-row { display: flex; gap: 10px; align-items: center; margin: 8px 0 10px; }
.auto-btn { padding: 9px 14px; border: 1px solid #f59e0b; border-radius: 8px; background: #fffbeb; color: #92400e; font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.auto-btn:hover { background: #fef3c7; }
.sub-btn.wide { width: 100%; margin-top: 8px; }
.card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin: 10px 0; background: #fcfcfd; }
.tag2 { font-size: 11px; background: #eef2ff; color: #3730a3; border-radius: 4px; padding: 1px 6px; }
.note { border-left: 3px solid #f59e0b; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 10px 0; }
.tabs button { padding: 7px 10px; border: 0; border-bottom: 2px solid transparent; background: none; font-family: inherit; font-size: 14px; cursor: pointer; color: var(--muted); }
.tabs button.on { color: var(--ink); border-bottom-color: var(--navy); font-weight: 600; }
tr.chosen td { background: #fef9c3; font-weight: 600; }
ol.order { padding-left: 20px; }
ol.order li { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px; margin: 4px 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.mini { padding: 2px 8px; margin-left: 4px; border: 1px solid var(--line); border-radius: 4px; background: #fff; cursor: pointer; }
.conflict { color: var(--bad); font-size: 12px; }
.wide-in { flex: 1; width: auto !important; }
table.req input, table.req select { width: 72px; padding: 4px; border: 1px solid var(--line); border-radius: 4px; font-family: inherit; }
.card.ask { border-color: #2563eb; background: #eff6ff; }
.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: thin; } .tabs button { white-space: nowrap; flex: none; }
.bim-bar .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.bim-bar button.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.bim { grid-template-rows: auto auto 1fr; }
.bim-sun { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 6px 10px; background: #fffbeb; border-bottom: 1px solid var(--line); font-size: 13px; }
.bim-sun[hidden], .walk-pad[hidden] { display: none; }
.bim-sun input[type=number] { width: 86px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; }
.bim-sun .grow { flex: 1; display: flex; gap: 6px; align-items: center; } .bim-sun .grow input { flex: 1; }
.bim-sun button { padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-family: inherit; }
.walk-pad { position: absolute; right: 16px; bottom: 70px; display: grid; gap: 4px; justify-items: center; }
.walk-pad button { width: 44px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 16px; cursor: pointer; }
.walk-pad button[data-walk=u], .walk-pad button[data-walk=d] { width: 96px; font-size: 13px; font-family: inherit; }
.walk-pad div { display: flex; gap: 4px; }
.bar { height: 10px; background: #60a5fa; border-radius: 3px; }
td.up { color: var(--bad); } td.down { color: var(--ok); }
table input[type=number] { width: 100px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; }
/* ล็อกแถวของกริด: ผืน 3 มิติอยู่แถว 1fr เสมอ (ไม่งั้นตอนซ่อนแถบแดด ผืนจะตกไปแถว auto แล้วเตี้ย) */
.bim-bar { grid-row: 1; } .bim-sun { grid-row: 2; } #bim-cv { grid-row: 3; }
/* แผนที่ที่ตั้งจริง — อยู่ช่องเดียวกับผืน 3 มิติ (ซ้อนกัน) */
.bim-map { grid-row: 3; grid-column: 1; position: relative; min-height: 0; background: #eceff1; }
#bim-cv { grid-column: 1; }
.bim-map[hidden], .bim-bar label[hidden], .map-card [hidden] { display: none !important; }
.bim-bar .grow { flex: 1; }
.map-cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.map-cv.pin { cursor: crosshair; }
.map-card { position: absolute; left: 12px; top: 12px; width: 330px; background: #fff; border-radius: 8px; padding: 12px; box-shadow: 0 2px 8px rgba(0,0,0,.18); font-size: 13px; display: grid; gap: 8px; }
.map-card b { font-size: 15px; }
.map-card .row { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.map-card .row input[type=range] { flex: 1; min-width: 80px; }
.map-card input[type=number] { width: 78px; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; }
.map-card select { padding: 3px 5px; font-family: inherit; }
.map-card button, .map-card .filebtn { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; cursor: pointer; font-family: inherit; font-size: 13px; }
.map-card button.on { background: #fff4e6; border-color: #e8590c; }
.map-card .map-go { padding: 10px; background: var(--navy); color: #fff; border-color: var(--navy); font-size: 15px; font-weight: 600; }
.map-msg { position: absolute; left: 360px; right: 70px; top: 12px; background: #fff8db; border: 1px solid #f0c36d; border-radius: 6px; padding: 8px 12px; font-size: 13px; }
.map-msg[hidden], .map-attr[hidden] { display: none; }
.map-attr { position: absolute; right: 8px; bottom: 58px; background: rgba(255,255,255,.85); padding: 2px 6px; font-size: 11px; color: #333; border-radius: 3px; text-decoration: none; }
/* โหมดนำเสนอ: เจ้าของบ้านเห็นแค่บ้าน — ไม่มีแผงงานวิศวกรรม */
body.presenting .top, body.presenting .steps, body.presenting .panel { display: none; }
body.presenting .layout { grid-template-columns: 1fr; height: 100vh; }
body.presenting .bim-bar [data-v], body.presenting #bim-fit, body.presenting .bim-bar .sep, body.presenting [data-mode=mep], body.presenting .bim-bar label { display: none; }
/* ผลทดสอบผู้ใช้: ตัวเลขไม่ตัดบรรทัด · สรุปลงนาม 3 ตัว · ปุ่มหันในโหมดเดินเป็นคำ */
.num, td.num { white-space: nowrap; }
.kpis.three { grid-template-columns: 1fr 1fr 1fr; }
.kpi.bad .v { color: var(--bad, #c92a2a); } .kpi.warn .v { color: #b7791f; }
.walk-pad button[data-walk=l], .walk-pad button[data-walk=r] { width: 64px; font-size: 13px; font-family: inherit; }
.bim-bar select { padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; font-family: inherit; background: #fff; }
.bim-info .warn { color: #c92a2a; }
/* หน้าราคาสำหรับ owner (สองตัวเลข) */
.bim-cost { grid-row: 3; grid-column: 1; position: relative; display: grid; place-items: center; background: #f8fafc; }
.bim-cost[hidden], .walk-hud[hidden] { display: none; }
.cost-card { text-align: center; background: #fff; border-radius: 14px; padding: 28px 56px; box-shadow: 0 2px 12px rgba(0,0,0,.08); }
.cost-card .l { font-size: 18px; color: var(--muted); margin-top: 14px; }
.cost-card .v { font-size: 48px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cost-card .v.over { color: #c92a2a; } .cost-card .v.under { color: #2b8a3e; }
.cost-card .tag-assume { margin: 18px 0 0; padding: 6px 12px; background: #fff4e6; border-radius: 6px; color: #9c4400; font-size: 14px; }
/* ห้องที่ยืนอยู่ + แปลนย่อ ตอนเดินในบ้าน */
.walk-hud { grid-row: 3; grid-column: 1; align-self: start; justify-self: start; margin: 12px; position: relative; z-index: 2; display: grid; gap: 6px; }
.walk-hud b { background: rgba(20,33,61,.85); color: #fff; padding: 4px 10px; border-radius: 6px; font-size: 15px; justify-self: start; }
.walk-hud b:empty { display: none; }
.walk-hud canvas { width: 170px; height: 170px; border-radius: 8px; box-shadow: 0 1px 4px rgba(0,0,0,.2); }
/* โหมดนำเสนอ: ไม่มีช่องตั้งค่า · ปุ่มราคาแสดงเฉพาะตอนนำเสนอ · ป้าย "ร่าง" เสมอ */
.p-only { display: none; }
body.presenting .p-only { display: inline-block; }
body.presenting .setup, body.presenting .bim-bar select, body.presenting .map-card .row { display: none !important; }
body.presenting::after { content: 'ร่าง'; position: fixed; top: 16px; left: -40px; transform: rotate(-45deg); background: #e8590c; color: #fff; padding: 4px 52px; font-weight: 700; font-size: 13px; z-index: 50; pointer-events: none; }
.card { overflow-x: auto; } .card table { font-size: 13px; }
.map-card .grow { flex: 1; min-width: 0; padding: 3px 5px; border: 1px solid var(--line); border-radius: 4px; } .map-card .small { font-size: 11.5px; line-height: 1.4; }

.map-results { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow: auto; margin: 4px 0; }
.map-results button { text-align: left; font-size: 12px; line-height: 1.35; padding: 6px 8px; }
.mini.on { background: #1f2937; color: #fff; border-color: #1f2937; }

.file-row { border-top: 1px solid var(--line); padding: 6px 0; }
.file-row:first-of-type { border-top: 0; }
.milestones summary { cursor: pointer; }
.ms-sum span { margin-left: 6px; font-weight: 600; }
.ms-sum .ok, .ms-list li.ok .ico { color: #2f9e44; }
.ms-sum .part, .ms-list li.part .ico { color: #e8590c; }
.ms-sum .miss, .ms-list li.miss .ico { color: #e03131; }
.ms-list { list-style: none; margin: 8px 0 0; padding: 0; }
.ms-list li { display: flex; gap: 8px; padding: 4px 0; border-top: 1px solid var(--line); }
.ms-list .ico { font-weight: 700; width: 14px; flex: none; }
.needs .ok { color: #2f9e44; font-weight: 700; } .needs .miss, .file-row .miss { color: #e03131; font-weight: 600; } .needs td { vertical-align: top; }

/* ───────────── ธีมองค์กร (Construction System) ─────────────
   หลัก: พื้นหลังเทาอ่อน · การ์ดขาวขอบบาง เงาเบา · สีกรมท่าเป็นโครง · น้ำเงินเฉพาะการกระทำหลัก · สถานะสีเขียว/เหลือง/แดงเท่านั้น
   ฟอนต์ระบบ (ติดตั้งภายในไม่โหลดฟอนต์จากเน็ต) */
:root {
  --navy: #0f1b33; --navy-2: #16243f; --navy-3: #1f3157; --accent: #2457d6; --accent-2: #1d4ab8;
  --bg: #f3f5f8; --line: #e3e7ee; --ink: #172033; --muted: #66707f;
  --ok-bg: #e7f6ec; --ok-ink: #17703a; --warn-bg: #fff4e0; --warn-ink: #9a5b00; --bad-bg: #fde8e8; --bad-ink: #b42318;
  --radius: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
  font-family: -apple-system, "Segoe UI", "Leelawadee UI", "Noto Sans Thai", "Sarabun", Thonburi, system-ui, sans-serif;
}
body { font-size: 14px; -webkit-font-smoothing: antialiased; }
.top { height: 56px; gap: 18px; padding: 0 20px; background: var(--navy); box-shadow: 0 1px 0 rgba(255,255,255,.06); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand .logo { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: linear-gradient(135deg, #3b82f6, #2457d6); color: #fff; font-weight: 800; font-size: 13px; letter-spacing: .5px; }
.brand b { display: block; font-size: 14px; line-height: 1.1; }
.brand small { display: block; font-size: 11px; color: #9fb0cc; }
.crumbs { display: flex; gap: 8px; align-items: center; color: #9fb0cc; font-size: 13px; padding-left: 18px; border-left: 1px solid rgba(255,255,255,.12); }
.crumbs b { color: #fff; font-weight: 600; }
.crumbs .sep { opacity: .5; }
.env { font-size: 12px; color: #fde68a; border: 1px solid rgba(253,230,138,.35); border-radius: 999px; padding: 3px 10px; }
.layout { grid-template-columns: 232px 1fr 360px; height: calc(100vh - 56px); }
.steps { background: var(--navy-2); padding: 16px 10px; }
.nav-head { display: flex; justify-content: space-between; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: #8193b2; padding: 0 8px 6px; }
.nav-meter { height: 4px; border-radius: 4px; background: rgba(255,255,255,.08); margin: 0 8px 12px; overflow: hidden; }
.nav-meter span { display: block; height: 100%; background: #34d399; }
.steps button { border-radius: 8px; padding: 9px 10px; margin: 2px 0; font-size: 13.5px; color: #c9d4e6; }
.steps button:not([disabled]):hover { background: rgba(255,255,255,.06); }
.steps button.on { background: var(--navy-3); color: #fff; box-shadow: inset 3px 0 #60a5fa; }
.steps .n { width: 24px; height: 24px; font-weight: 600; }
.steps .done .n { background: #34d399; color: #053321; }
.panel { padding: 20px; background: #fff; }
.panel h1 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.eyebrow { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.card { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); padding: 14px; margin: 12px 0; }
.main-btn { border-radius: 8px; font-weight: 600; font-size: 15px; padding: 12px 14px; box-shadow: 0 1px 2px rgba(36,87,214,.3); transition: background .15s; }
.main-btn:hover:not([disabled]) { background: var(--accent-2); }
.sub-btn { border-radius: 8px; font-weight: 500; padding: 7px 12px; }
.sub-btn:hover { background: #f5f7fb; border-color: #cfd6e2; }
.sub-btn.wide { width: 100%; margin-top: 8px; }
.icon-btn { border: 1px solid transparent; background: none; border-radius: 6px; cursor: pointer; padding: 5px 7px; opacity: .65; }
.icon-btn:hover { background: var(--bad-bg); opacity: 1; }
.link-btn { all: unset; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); font-weight: 600; margin: 8px 0; }
.field input { font: inherit; font-size: 14px; font-weight: 400; color: var(--ink); padding: 9px 11px; border: 1px solid #cfd6e2; border-radius: 8px; background: #fff; }
.field input:focus, .files select:focus { outline: 2px solid #bfd3ff; border-color: var(--accent); }
.chip { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 999px; background: #eef1f6; color: #475467; font-weight: 600; white-space: nowrap; }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.meter { margin: 14px 0 8px; }
.meter-bar { height: 8px; border-radius: 8px; background: #edf0f5; overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #10b981); }
.kv { display: grid; grid-template-columns: 1fr auto; gap: 6px 10px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 10px 0; font-size: 13px; color: var(--muted); }
.kv b { color: var(--ink); text-align: right; }
.warn-t { color: var(--warn-ink) !important; }
.help { border-top: 1px solid var(--line); padding: 10px 0 0; margin-top: 12px; }
.help summary { cursor: pointer; font-size: 13px; color: #344054; font-weight: 600; }
.help table td { padding: 5px 4px; border-bottom: 1px solid #f0f2f6; vertical-align: top; }

/* หน้ากลางขั้นแรก */
.stage { place-items: start stretch; padding: 24px 28px; }
.intake { max-width: 1120px; width: 100%; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 18px; }
.page-head h2 { font-size: 24px; margin: 4px 0 6px; letter-spacing: -.02em; }
.page-head p { margin: 0; max-width: 620px; }
.page-head .proj { min-width: 300px; margin: 0; }
.req-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.req { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; border-top: 3px solid #d0d7e2; }
.req.ok { border-top-color: #10b981; }
.req.miss { border-top-color: #e5484d; }
.req-top { display: flex; justify-content: space-between; align-items: center; }
.req-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; background: #eef3ff; color: var(--accent); font-size: 17px; }
.pill { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: #eef1f6; color: #475467; }
.pill-req { background: #fde8e8; color: var(--bad-ink); }
.req-title { font-weight: 700; font-size: 15px; margin-top: 4px; }
.req-use { color: #475467; font-size: 13px; line-height: 1.45; flex: 1; }
.req-fmt { color: var(--muted); font-size: 12px; }
.req-st { font-size: 12.5px; font-weight: 600; padding-top: 8px; border-top: 1px dashed var(--line); color: #667085; word-break: break-word; }
.req.ok .req-st { color: var(--ok-ink); }
.req.miss .req-st { color: var(--bad-ink); }
.drop { margin: 18px 0; border: 2px dashed #b8c4d8; border-radius: 14px; background: #fbfcfe; padding: 26px; text-align: center; display: grid; gap: 8px; justify-items: center; transition: all .15s; }
.drop.over { border-color: var(--accent); background: #eef3ff; }
.drop-ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: #eef3ff; color: var(--accent); font-size: 22px; }
.drop b { font-size: 15px; }
.table-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.table-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
table.files { width: 100%; border-collapse: collapse; }
.files th { text-align: left; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); font-weight: 700; padding: 9px 16px; background: #f8fafc; border-bottom: 1px solid var(--line); }
.files td { padding: 11px 16px; border-bottom: 1px solid #eef1f5; vertical-align: top; }
.files tr:last-child td { border-bottom: 0; }
.files tr:hover td { background: #fafbfd; }
.files .fname { font-weight: 600; word-break: break-all; }
.files select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid #cfd6e2; border-radius: 7px; background: #fff; }
.files details summary { cursor: pointer; color: var(--accent); font-size: 12px; margin-top: 4px; }
.files .acts { white-space: nowrap; text-align: right; }
@media (max-width: 1400px) { .req-grid { grid-template-columns: repeat(2, 1fr); } }
.layer-pick { border: 1px solid #f5c26b; background: #fffaf0; margin-bottom: 16px; }
.layer-pick h3 { margin: 4px 0 6px; font-size: 17px; }
.lpick-prev { margin: 10px 0; } .lpick-prev canvas { width: 100%; display: block; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.layer-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 10px 0; }
.layer-grid label { display: flex; gap: 6px; align-items: center; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; }
.layer-grid label.on { border-color: var(--accent); background: #eef3ff; }
.layer-grid label.op { opacity: .6; cursor: default; background: #f6f7f9; }
.layer-pick .main-btn { width: auto; margin-top: 0; }
.upd { position: fixed; top: 64px; left: 50%; transform: translateX(-50%); z-index: 50; background: #1d4ab8; color: #fff; padding: 9px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 14px; }
.upd button { margin-left: 8px; border: 0; border-radius: 6px; padding: 4px 10px; font: inherit; font-weight: 600; cursor: pointer; }
.view-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 10px 0; }
.view-card { border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 8px; display: grid; gap: 6px; justify-items: start; }
.view-card.on { border-color: var(--accent); box-shadow: 0 0 0 2px #dbe6ff; }
.view-card svg { background: #f8fafc; border-radius: 6px; width: 100%; }
.view-card select { font: inherit; font-size: 13px; padding: 5px 8px; border: 1px solid #cfd6e2; border-radius: 7px; }
.ocr-list input { width: 100%; min-width: 9em; }
.ocr-list td { padding: 2px 4px; vertical-align: middle; }

/* ── ระยะงาน (docs/61 · UX S-stage-ui) ── */
.stagehost { display: flex; gap: 6px; align-items: center; }
.stage-badge, .stage-bell { all: unset; cursor: pointer; font-size: 13px; color: #e2e8f0; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); border-radius: 999px; padding: 4px 12px; white-space: nowrap; max-width: 46vw; overflow: hidden; text-overflow: ellipsis; }
.stage-badge b { color: #fff; } .stage-badge .sb-k { color: #9fb0cc; }
.stage-bell { position: relative; padding: 4px 10px; } .stage-bell .n { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; border-radius: 999px; font-size: 11px; min-width: 16px; text-align: center; padding: 0 4px; }
.drawer { position: fixed; top: 56px; right: 0; bottom: 0; width: min(420px, 100vw); background: #fff; border-left: 1px solid var(--line); box-shadow: -8px 0 24px rgba(16,24,40,.12); padding: 14px 16px; overflow: auto; z-index: 40; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 15px; }
.icon-btn { border: 0; background: none; cursor: pointer; font-size: 16px; min-width: 32px; min-height: 32px; }
.track { list-style: none; padding: 0; margin: 8px 0; } .track li { border-left: 3px solid var(--line); padding: 6px 10px; margin: 0 0 4px; }
.track .t-current { border-left-color: var(--accent); background: #f5f8ff; } .track .t-done { border-left-color: #22c55e; } .track .t-todo { opacity: .8; }
.t-h { display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: baseline; } .t-i { width: 16px; display: inline-block; }
.gate { list-style: none; padding: 0; margin: 6px 0; } .gi { display: flex; gap: 6px; padding: 3px 0; font-size: 13px; line-height: 1.4; }
.gi-i { width: 16px; flex: none; font-weight: 700; } .gi.fail .gi-i { color: var(--bad-ink, #b42318); } .gi.warn .gi-i { color: var(--warn-ink, #9a5b00); } .gi.ok .gi-i { color: var(--ok-ink, #17703a); }
.link-btn { border: 0; background: none; color: var(--accent); cursor: pointer; padding: 0; font: inherit; text-decoration: underline; }
.inbox { list-style: none; padding: 0; } .inbox .ib { all: unset; display: flex; flex-direction: column; gap: 2px; width: 100%; box-sizing: border-box; padding: 10px; border: 1px solid var(--line); border-radius: 8px; margin: 0 0 6px; cursor: pointer; min-height: 44px; }
.stg-form { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); width: min(520px, calc(100vw - 16px)); max-height: 80vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(16,24,40,.25); padding: 14px 16px; z-index: 50; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; } .chip-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; min-height: 32px; } .chip-btn.on { background: var(--navy); color: #fff; border-color: var(--navy); }
.rev-st { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 4px; }
.st { font-size: 12px; border-radius: 999px; padding: 1px 8px; background: #eef2f7; color: #334155; } .st-shared { background: #e0ecff; color: #1d4ab8; } .st-published { background: var(--ok-bg, #e7f6ec); color: var(--ok-ink, #17703a); } .st-archived { background: #f1f1f1; color: #888; text-decoration: line-through; }
.mini.strong { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg.sub { margin-top: -4px; } .seg.sub button { font-size: 13px; padding: 6px; }
.issue-draft { background: var(--warn-bg, #fff4e0); border-radius: 6px; padding: 6px 8px; } p.ok { color: var(--ok-ink, #17703a); }
.steps .done.warn .n { background: #f59e0b; color: #1f2937; }
.feas-entry { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 10px 0; }
.feas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; width: 100%; } .feas-grid .card { margin: 0; }
.feas-grid .row { flex-wrap: wrap; } .field { display: flex; flex-direction: column; gap: 2px; font-size: 13px; margin: 4px 0; } .field input, .field select, .field textarea { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
.zf { flex: 1; min-width: 140px; } .zf > label.small { display: flex; gap: 4px; align-items: center; color: var(--muted); margin: 0 0 6px; }
.opt { display: flex; gap: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; margin: 8px 0; cursor: pointer; } .opt.on { border-color: var(--accent); background: #f5f8ff; } .opt.bad { border-style: dashed; } .opt .big { font-size: 18px; font-weight: 700; margin: 2px 0; }
.bid-wrap { overflow-x: auto; } table.bids td.bc input { width: 7.5em; text-align: right; font: inherit; border: 1px solid var(--line); border-radius: 4px; padding: 2px 4px; }
td.bc.high { background: #fff4d6; } td.bc.low { background: #fff4d6; } td.bc.missing { background: #fde8e8; color: #b42318; }
.site-list { display: flex; flex-direction: column; gap: 6px; width: 100%; } .site-row { border: 1px solid var(--line); border-radius: 10px; background: #fff; } .site-row.late { border-color: #f59e0b; }
.site-head { all: unset; display: block; box-sizing: border-box; width: 100%; padding: 12px; cursor: pointer; min-height: 44px; } .site-body { padding: 0 12px 12px; }
.abcd { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 8px 0; } .abcd .big { display: flex; flex-direction: column; align-items: center; min-height: 56px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; cursor: pointer; } .abcd .big b { font-size: 18px; }
.c-A { border-color: #22c55e !important; } .c-B { border-color: #84cc16 !important; } .c-C { border-color: #f59e0b !important; } .c-D { border-color: #ef4444 !important; }
.sub-btn.big { min-height: 44px; } .row.wrap { flex-wrap: wrap; }
.prog-row { display: grid; grid-template-columns: 1fr 8em auto; gap: 6px; align-items: center; padding: 10px 12px; } .prog-row input { min-height: 40px; font: inherit; padding: 4px 8px; border: 1px solid var(--line); border-radius: 6px; text-align: right; }
@media (max-width: 760px) { .stage-badge .sb-v { display: none; } .prog-row { grid-template-columns: 1fr 6.5em; } .prog-row .mini { grid-column: span 2; min-height: 36px; } .abcd { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) {
  body.site .layout { grid-template-columns: 1fr; height: auto; } body.site .steps, body.site .panel { display: none; }
  body.site .top { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; } body.site .brand small, body.site .crumbs, body.site .env { display: none; }
  body.site .stage { padding: 10px; } body.site .page-head { flex-direction: column; align-items: stretch; gap: 8px; } body.site .kpis { grid-template-columns: repeat(2, 1fr); }
}
.sub-btn.big { font-size: 15px; }
body.site .layout { grid-template-columns: 210px 1fr; } body.site .panel { display: none; }
.faded { opacity: .55; } .opt.faded { background: #fafafa; }
.warn-card { border-color: #f59e0b !important; background: var(--warn-bg, #fff4e0) !important; }
.lg { display: inline-block; width: 12px; height: 12px; border-radius: 2px; vertical-align: middle; } .lg.high { background: #fff4d6; border: 1px solid #f59e0b; } .lg.missing { background: #fde8e8; border: 1px solid #ef4444; }
.sticky-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); padding: 8px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 5; } .sticky-bar .main-btn { width: auto; flex: 1; margin: 0; min-height: 48px; }
.stack { display: flex; flex-direction: column; gap: 8px; } .stack input, .stack select { min-height: 44px; font: inherit; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; }
.kpi.alert { border-color: #ef4444; background: #fde8e8; } .site-row.ret { border-color: #f59e0b; } .site-row.over { border-left: 4px solid #f59e0b; }
.inbox .go { color: var(--accent); white-space: nowrap; } table.claim { max-width: 420px; } table.claim td { padding: 3px 8px; }
@media (max-width: 760px) { body.site .layout { grid-template-columns: 1fr; } }
.sched { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin: 8px 0; } .sched .big { font-size: 20px; font-weight: 700; }

/* ── S-ui-clean (UX 4 พ.ย. 2569): enterprise ไม่รก — คำตอบบรรทัดเดียว · ตัวเลข ≤ 3 · ประเด็นพับ · ปุ่มหลักติดล่าง ── */
:root { --fs-title: 20px; --fs-sec: 15px; --fs-body: 14px; --fs-2: 13px; --fs-cap: 12px; --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 24px;
  --amber: #a16207; --amber-bg: #fffbeb; --amber-line: #f5d58a; --red: #b91c1c; --red-bg: #fef2f2; --red-line: #f3b4b4; --green: #15803d; --green-bg: #f0fdf4; }
.panel { font-size: var(--fs-body); line-height: 1.5; padding: 20px 20px 0; } .panel h1 { font-size: var(--fs-title); font-weight: 600; margin-bottom: var(--sp-3); }
.num, .kv, .k .kv, td.num, .kpi .v { font-variant-numeric: tabular-nums; }
.card { box-shadow: none; } .small, .muted.small { font-size: var(--fs-2); }
.env { color: #cbd5e1; border-color: rgba(255,255,255,.25); background: none; }
/* คำตอบบรรทัดเดียว */
.verdict { display: flex; gap: 10px; align-items: flex-start; border: 1px solid var(--line); border-left-width: 4px; border-radius: 8px; padding: 10px 12px; margin: 0 0 var(--sp-3); background: #fff; }
.verdict .v-i { font-weight: 700; width: 16px; } .verdict .v-b { flex: 1; } .verdict .v-r { font-size: var(--fs-2); color: var(--muted); margin-top: 2px; }
.v-fail { border-left-color: var(--red); background: var(--red-bg); } .v-fail .v-i { color: var(--red); }
.v-warn { border-left-color: #d97706; background: var(--amber-bg); } .v-warn .v-i { color: var(--amber); }
.v-ok { border-left-color: var(--green); } .v-ok .v-i { color: var(--green); }
/* ตัวเลขเด่น ≤ 3 */
.kpi3 { display: grid; margin: 0 0 var(--sp-3); }
.kpi3 .k { padding: 2px 10px; border-left: 1px solid var(--line); min-width: 0; } .kpi3 .k:first-child { border-left: 0; padding-left: 0; }
.kpi3 .kn { font-size: 18px; font-weight: 700; color: var(--navy); line-height: 1.25; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; } .kpi3 .hero .kn { font-size: 22px; }
.kpi3 .kl { font-size: var(--fs-cap); color: var(--muted); } .kpi3 .kw { font-size: var(--fs-cap); color: var(--muted); }
.kpi3 .muted .kn { color: #94a3b8; font-size: 17px; }
/* ประเด็นพับตามระดับ */
.issues { margin: 0 0 var(--sp-3); } .is-g { margin: 0 0 6px; } .is-g ul { list-style: none; margin: 0; padding: 0; }
.is-h { font-size: var(--fs-cap); font-weight: 600; text-transform: none; color: var(--muted); padding: 4px 0; cursor: default; }
.is-h.fail { color: var(--red); } .is-h.warn { color: var(--amber); } summary.is-h { cursor: pointer; } summary.is-h.ok { color: var(--green); }
.is { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-top: 1px solid #f0f2f6; font-size: var(--fs-2); }
.is-i { width: 14px; flex: none; font-weight: 700; } .is-fail .is-i { color: var(--red); } .is-warn .is-i { color: var(--amber); } .is-ok .is-i { color: var(--green); }
.is-b { flex: 1; min-width: 0; } .is-b summary { cursor: pointer; } .is-d { color: var(--muted); padding: 4px 0 0; } .is-a { flex: none; }
.is-more > summary, .fold > summary { cursor: pointer; color: var(--accent); font-size: var(--fs-2); padding: 4px 0; }
.fold { margin: 6px 0; }
/* แท็บ + ตัวสลับย่อยเล็ก */
.sticky-tabs { position: sticky; top: -20px; background: #fff; z-index: 6; margin-top: 0; }
.pills { display: inline-flex; gap: 2px; background: #f1f4f8; border-radius: 8px; padding: 2px; margin: 0 0 var(--sp-3); }
.pills button { border: 0; background: none; font: inherit; font-size: var(--fs-2); padding: 4px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); }
.pills button.on { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16,24,40,.08); font-weight: 600; }
/* แถบร่างบาง */
.draftbar { font-size: var(--fs-2); color: var(--amber); border: 1px solid var(--amber-line); background: var(--amber-bg); border-radius: 6px; padding: 4px 10px; margin: 0 0 var(--sp-3); }
.draftbar summary { cursor: pointer; } .draftbar.ok { color: var(--green); border-color: #bbf7d0; background: var(--green-bg); }
/* ปุ่มหลักติดล่างแผง + เมนูดาวน์โหลด */
.main-bar { position: sticky; bottom: 0; background: #fff; border-top: 1px solid var(--line); margin: var(--sp-4) -20px 0; padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; z-index: 6; }
.main-bar .main-btn { width: auto; flex: 1; margin: 0; min-height: 40px; } .main-bar .mb-c { width: 100%; font-size: var(--fs-cap); color: var(--muted); }
.dl { position: relative; } .dl > summary { list-style: none; } .dl > summary::-webkit-details-marker { display: none; }
.dl-m { position: absolute; bottom: 44px; right: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.15); padding: 6px; display: flex; flex-direction: column; gap: 4px; min-width: 200px; }
/* ข้อมูลทางเทคนิค */
.tech { margin: var(--sp-4) 0 0; } .tech > summary { cursor: pointer; font-size: var(--fs-cap); color: var(--muted); }
/* ตัวสลับมุมมองบนผืนงาน */
.stage { position: relative; } .viewbar { position: fixed; bottom: 20px; right: 384px; z-index: 8; display: inline-flex; gap: 2px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 2px; }
.viewbar button { border: 0; background: none; font: inherit; font-size: var(--fs-2); padding: 5px 10px; border-radius: 6px; cursor: pointer; color: var(--muted); } .viewbar button.on { background: var(--navy); color: #fff; }
.layer-pop { position: relative; } .layer-pop > summary { list-style: none; cursor: pointer; padding: 5px 10px; border: 1px solid var(--line); border-radius: 6px; font-size: var(--fs-2); background: #fff; }
.layer-pop .lp-m { position: absolute; top: 34px; left: 0; z-index: 10; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(16,24,40,.15); padding: 8px 12px; display: flex; flex-direction: column; gap: 6px; min-width: 170px; font-size: var(--fs-2); }
.bim-help { display: inline-grid; place-items: center; width: 24px; height: 24px; border: 1px solid var(--line); border-radius: 50%; color: var(--muted); font-size: 12px; cursor: help; }
.bim-info:empty { display: none; }
.drop.compact { padding: 16px 18px; min-height: 0; text-align: left; display: block; } .drop.compact > div { margin: 2px 0; }
.req-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0 16px; }
.req-chip { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: #fff; display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; min-height: 56px; }
.req-chip .rc-n { font-weight: 600; font-size: var(--fs-2); flex: 1; } .req-chip .rc-st { width: 100%; font-size: var(--fs-cap); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.req-chip.ok { border-left: 3px solid var(--green); } .req-chip.ok .rc-st { color: var(--green); } .req-chip.miss { border-left: 3px solid var(--red); } .req-chip.miss .rc-st { color: var(--red); }
@media (max-width: 900px) { .req-row { grid-template-columns: repeat(2, 1fr); } }
.sum-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; margin: 4px 0 12px; }
.sc { font-size: var(--fs-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; background: #fff; } .sc.zero { color: #94a3b8; } .sc.bad { border-color: var(--red-line); background: var(--red-bg); color: var(--red); } .sc.warn { border-color: var(--amber-line); background: var(--amber-bg); color: var(--amber); }
.main-btn.inline { width: auto; margin: 0; padding: 8px 14px; min-height: 40px; }
.site-row { border-left-width: 1px; } .site-row.late { border-color: var(--line); box-shadow: inset 3px 0 var(--red); } .site-row.ret { border-color: var(--line); box-shadow: inset 3px 0 #d97706; } .site-row.over { border-left: 1px solid var(--line); box-shadow: inset 3px 0 #d97706; }
body.site .steps { display: none; } body.site .layout { grid-template-columns: 1fr; }

/* S-ui-clean-check: ซ่อนจริงเมื่อ hidden (display ของคลาสทับ [hidden]) · ตัวเลขเงินไม่ตัดกลาง */
.viewbar[hidden], .drawer[hidden] { display: none !important; }
.kpi3 .kn { overflow-wrap: normal; white-space: nowrap; } .kpi3 .k { overflow: hidden; }
.pills button { white-space: nowrap; }
.money-line { font-size: var(--fs-2); margin: 0 0 var(--sp-3); font-variant-numeric: tabular-nums; } .money-line.muted b { color: #94a3b8; }

/* ── โครงหน้าจอ B+C (docs/42 · docs/62): ฟอนต์ IBM Plex Sans Thai · แถบบนขาว · แถบข้าง navy = ระยะของโครงการ · แถบขั้นตอนเหนือผืนงาน ── */
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 400; font-display: swap; src: url('/shared/fonts/IBMPlexSansThai-Regular.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 500; font-display: swap; src: url('/shared/fonts/IBMPlexSansThai-Medium.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 600; font-display: swap; src: url('/shared/fonts/IBMPlexSansThai-SemiBold.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans Thai'; font-weight: 700; font-display: swap; src: url('/shared/fonts/IBMPlexSansThai-Bold.woff2') format('woff2'); }
:root { --navy: #0d2c48; --navy-2: #0d2c48; --navy-3: rgba(255,255,255,.16); --accent: #0f4c81; --accent-2: #0b3a63; --bg: #f4f6f8; --line: #e2e8f0; --ink: #0f172a; --muted: #5b6b80;
  font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, sans-serif; }
body, button, input, select, textarea { font-family: 'IBM Plex Sans Thai', 'Noto Sans Thai', system-ui, sans-serif; }
.top { background: #fff; color: var(--ink); border-bottom: 1px solid var(--line); box-shadow: none; height: 52px; gap: 14px; padding: 0 16px; }
.brand .logo { background: var(--navy); border-radius: 6px; } .brand b { color: var(--ink); font-weight: 600; } .brand small { display: none; }
.proj-sel { border: 1px solid #cbd5e1; background: #fff; border-radius: 8px; padding: 5px 10px; font: inherit; color: var(--ink); cursor: pointer; white-space: nowrap; } .proj-sel small { color: var(--muted); }
.wsbar { display: inline-flex; gap: 2px; background: #f1f5f9; border-radius: 8px; padding: 2px; }
.wsbar button { border: 0; background: none; font: inherit; font-size: 13.5px; padding: 5px 12px; border-radius: 6px; color: #475569; cursor: pointer; white-space: nowrap; }
.wsbar button.on { background: #fff; color: var(--accent); font-weight: 600; box-shadow: 0 1px 2px rgba(15,23,42,.08); } .wsbar button[disabled] { color: #94a3b8; cursor: not-allowed; }
.stage-bell { color: var(--ink); background: #fff; border-color: var(--line); }
.env { color: #5b6b80; border-color: var(--line); }
.layout { grid-template-columns: 236px 1fr 380px; height: calc(100vh - 52px); }
.steps { background: var(--navy); padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow: auto; }
.steps .nav-grp { font-size: 12px; color: #8fa6bb; padding: 10px 10px 4px; }
.steps button { border-radius: 8px; padding: 8px 10px; margin: 0; font-size: 14px; color: #d5e0ea; }
.steps button.on { background: rgba(255,255,255,.16); color: #fff; box-shadow: inset 3px 0 #7fb2e5; }
.steps .n { width: 22px; height: 22px; border: 1.5px solid #8fa6bb; background: none; font-size: 11px; }
.steps .done .n { background: #2b5f8f; border-color: #2b5f8f; color: #fff; } .steps .n.cur { background: #fff; border-color: #fff; color: var(--navy); font-weight: 700; }
.steps .cnt { margin-left: auto; background: #c2410c; color: #fff; border-radius: 999px; font-size: 11px; padding: 0 7px; }
.steps .nav-foot { margin-top: auto; padding: 10px; color: #8fa6bb; border-top: 1px solid rgba(255,255,255,.12); }
.stepper { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 0 0 12px; width: 100%; }
.stepper .sp-t { font-size: 13px; color: var(--muted); margin-right: 4px; font-weight: 600; }
.stepper button { all: unset; display: inline-flex; gap: 6px; align-items: center; font-size: 13px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: #475569; cursor: pointer; }
.stepper button[disabled] { opacity: .5; cursor: default; } .stepper button.done { background: #e6eef6; color: #0f4c81; border-color: transparent; } .stepper button.done.warn { background: #fdf1d8; color: #7a4a00; }
.stepper button.on { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 600; } .stepper .n { font-size: 11px; }
.home-wrap .drawer-head { display: none; } .home-wrap { max-width: 760px; }
.main-btn { background: var(--accent); } .main-btn:hover:not([disabled]) { background: var(--accent-2); }
.verdict.v-fail { border-left-color: #c2410c; background: #fff1e8; } .verdict.v-fail .v-i { color: #c2410c; } .is-h.fail, .is-fail .is-i { color: #c2410c; }
body.site .layout { grid-template-columns: 236px 1fr; }
body.site .steps { display: flex; } /* แถบข้างอยู่ทุกหน้า (docs/62) — กฎเก่าบรรทัดบนซ่อนไว้ ทำให้เนื้อหาตกไปช่องแถบข้าง */
@media (max-width: 760px) { body.site .layout { grid-template-columns: 1fr; } body.site .steps { display: none; } .wsbar, .env { display: none; } }

/* พื้นที่ผู้บริหาร + ERP (docs/62) — ตารางพอร์ต · ป้ายแหล่งตัวเลข · ตัวเลขไม่ตัดกลาง */
table.pf { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 8px 0 4px; }
table.pf th { text-align: left; font-weight: 600; color: #475569; font-size: 12.5px; border-bottom: 1px solid var(--line); padding: 6px 8px; white-space: nowrap; }
table.pf td { border-bottom: 1px solid #eef2f6; padding: 7px 8px; vertical-align: top; }
table.pf .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; } table.pf td.bad { color: #c2410c; font-weight: 600; }
table.pf tr:hover td { background: #f8fafc; }
.lnk { all: unset; color: var(--accent, #0f4c81); cursor: pointer; font-weight: 500; } .lnk:hover { text-decoration: underline; }
.src { display: inline-block; font-size: 10.5px; font-weight: 600; padding: 0 5px; border-radius: 4px; background: #e2e8f0; color: #334155; vertical-align: 1px; margin-left: 4px; }
.ph-r { display: flex; gap: 12px; align-items: center; }
.stage { align-content: start; } /* แถวว่างของกริดไม่ยืด (หน้าผู้บริหารเคยมีช่องว่างบนสุด) */
/* ร่าง: จอแบ่ง กระดาษซ้าย · บ้าน 3 มิติขวา (S-hand) */
.stage.split .canvas-wrap { width: calc(50% - 8px); }
.stage.split .bim { left: calc(50% + 8px); }
.pen-hint { background: #eef4fb; border-left: 3px solid var(--accent, #0f4c81); padding: 6px 8px; border-radius: 4px; }
#cv { touch-action: none; -webkit-user-select: none; user-select: none; } /* iPad: ลากนิ้ว/ปากกา = วาด ไม่ใช่เลื่อนหน้า */
.type-chips { flex-wrap: wrap; gap: 6px; } .type-chips .chip { cursor: pointer; padding: 8px 12px; min-height: 40px; } .type-chips .chip.on { background: var(--navy, #12355b); color: #fff; } /* iPad: ปุ่มใหญ่พอสำหรับนิ้ว */

/* S-ui-ref: แถบผลงานจริงเทียบแผน (พอร์ตผู้บริหาร) */
.pbar { position: relative; height: 8px; min-width: 120px; background: #e2e8f0; border-radius: 4px; margin: 4px 0 2px; }
.pbar i { position: absolute; left: 0; top: 0; bottom: 0; background: #0f4c81; border-radius: 4px; }
.pbar.late i { background: #c2410c; }
.pbar b { position: absolute; top: -3px; width: 2px; height: 14px; background: #0f172a; margin-left: -1px; }
.q-tbl td, .q-tbl th { padding: 4px 6px; } details.inl { display: inline; } details.inl summary { display: inline; cursor: pointer; color: #0f4c81; }
.file-btn { cursor: pointer; display: inline-block; }
/* S-ui-ref: ชุดแบบ 3 คอลัมน์ (รายการแผ่น · แผ่น · ประวัติฉบับ) */
.sheetset { position: absolute; inset: 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sheetset[hidden] { display: none; }
.ss { display: grid; grid-template-columns: 220px 1fr 260px; height: 100%; }
.ss-list, .ss-info { overflow: auto; padding: 10px; background: #f8fafc; }
.ss-list { border-right: 1px solid var(--line); } .ss-info { border-left: 1px solid var(--line); }
.ss-h { font-weight: 600; font-size: 13px; margin: 10px 0 6px; } .ss-grp { font-size: 11.5px; color: var(--muted); margin: 10px 0 4px; text-transform: uppercase; }
.ss-it { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 38px 1fr; gap: 2px 6px; width: 100%; padding: 7px 8px; border-radius: 6px; font-size: 13px; }
.ss-it:hover { background: #eef2f6; } .ss-it.on { background: #e0ecf7; box-shadow: inset 3px 0 0 #0f4c81; }
.ss-it .ss-no { font-weight: 700; color: #0f4c81; } .ss-it .chip { grid-column: 2; justify-self: start; font-size: 11px; }
.ss-view { display: grid; grid-template-rows: auto 1fr; min-width: 0; }
.ss-bar { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--line); }
.ss-sheet { overflow: auto; padding: 12px; } .ss-sheet svg { max-width: 100%; height: auto; }
.ss-no-big { font-size: 26px; font-weight: 700; color: #0f4c81; } .ss-info table td { padding: 3px 4px; vertical-align: top; }
.ss-rev { border-left: 2px solid #cbd5e1; padding: 2px 0 8px 8px; margin: 4px 0; }
/* S-ui-ref: สไลด์เทียบฉบับบนผัง */
.rs { margin: 10px 0; } .rs-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.rs-svg { width: 100%; max-height: 360px; background: #fff; border: 1px solid var(--line); border-radius: 6px; display: block; }
.rs input[type=range] { width: 100%; margin: 4px 0; }
.rs-c { display: inline-block; padding: 0 6px; border-radius: 4px; font-size: 11.5px; } .rs-added { background: #bbf7d0; } .rs-removed { background: #fecaca; } .rs-resized { background: #fed7aa; } .rs-renamed { background: #dbeafe; }
/* S-ui-ref: แผง X-Ray งานระบบ */
.bim-xr { position: absolute; top: 52px; right: 12px; width: 240px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; box-shadow: 0 4px 14px rgba(16,24,40,.12); z-index: 5; }
.xr-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.xr-s { display: grid; grid-template-columns: auto 12px 1fr auto; gap: 6px; align-items: center; padding: 2px 0; cursor: pointer; } .xr-s i { width: 12px; height: 4px; border-radius: 2px; } .xr-s span { color: var(--muted); font-variant-numeric: tabular-nums; }
.xr-c { display: block; margin-top: 6px; } .xr-c select { width: 100%; font: inherit; font-size: 12px; } .xr-f { margin-top: 6px; color: var(--muted); font-size: 11.5px; } .bim-xr .warn { color: #c2410c; }
.q-tbl td:nth-child(2) { white-space: nowrap; }
.ss-info { padding-bottom: 64px; } .ss-list { padding-bottom: 64px; }
/* S-ui-ref: ตัวสลับมุมมองอยู่บนหัวผืนงาน (UX: เดิมลอยมุมขวาล่าง ทับคอลัมน์ประวัติ) */
.stage.has-vb .viewbar { position: absolute; top: 14px; bottom: auto; right: auto; left: 50%; transform: translateX(-50%); box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.stage.has-vb .bim, .stage.has-vb .sheetset { top: 56px; } .stage.has-vb { padding-top: 56px; }
.ss-info, .ss-list { padding-bottom: 10px; }
.xr-s em { grid-column: 3 / 5; font-style: normal; font-size: 11px; color: var(--muted); margin-top: -2px; }
.rc-leg { position: absolute; top: 52px; left: 12px; background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; max-width: 420px; z-index: 5; }
.rc-leg i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 3px 0 8px; vertical-align: -1px; }
.rev-list { width: 100%; } .rev-list td:first-child { width: 62%; } .rev-list td.num { white-space: normal; font-size: 12.5px; }
.undo-row { gap: 6px; align-items: center; margin: 4px 0 8px; } .auto-report { border-left: 4px solid #c2410c; } .auto-report ol { margin: 6px 0 6px 18px; padding: 0; }
/* S-usab: เริ่มใหม่ · แถบขั้นค้าง */
.hdr-btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 6px 12px; font: inherit; font-size: 13px; cursor: pointer; margin-left: 8px; }
.ask-bg { position: fixed; inset: 0; background: rgba(15,23,42,.35); z-index: 100; display: grid; place-items: center; }
.ask-box { background: #fff; border-radius: 12px; padding: 18px 20px; width: min(520px, 92vw); box-shadow: 0 20px 50px rgba(16,24,40,.25); } .ask-box h3 { margin: 0 0 8px; } .ask-box ul { margin: 6px 0 12px 18px; padding: 0; }
.stepper button.stale .n { background: #fff7ed; color: #c2410c; }
/* S-ui-qa: มาตรฐานฟอร์ม (ผู้ใช้ 5 พ.ย.: เยื้องไปเยื้องมา ข้อความตกหล่น) — ช่องในแถวกว้างเท่ากัน เต็มช่อง · ป้ายช่องติ๊กบรรทัดเดียว · คำอธิบายใต้ช่อง ไม่ยัดใน placeholder */
input, select, textarea { box-sizing: border-box; max-width: 100%; }
.field > input:not([type=checkbox]):not([type=radio]), .field > select, .field > textarea { width: 100%; min-height: 36px; }
.row > .field, .row > .zf { flex: 1 1 0; min-width: 0; }
.field { min-width: 0; }
.zf { display: flex; flex-direction: column; } .zf > label.small { white-space: nowrap; font-size: 12px; margin: 2px 0 8px; }
.field-hint { display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.35; }
label.small:has(> input[type=checkbox]) { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 900px) { .feas-grid { grid-template-columns: 1fr; } .row > .field, .row > .zf { flex: 1 1 140px; } }
/* S-ui-qa: ทุกขนาดจอ (ผู้ใช้ 5 พ.ย.: "พิจารณาใช้ devices ด้วย") — ไม่มีหน้าเลื่อนแนวนอน · แถบข้างพับเป็น ☰ เมื่อจอแคบ · ตารางเลื่อนในกรอบตัวเอง */
.row:has(> .field), .row:has(> .zf) { align-items: flex-end; }
#bim-view { min-width: 120px; }
.nav-toggle { display: none; }
table.pf, .pf-wrap { max-width: 100%; }
@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .layout { grid-template-columns: 1fr 340px; }
  .layout > .steps { position: fixed; left: 0; top: 56px; bottom: 0; width: 260px; z-index: 60; transform: translateX(-100%); transition: transform .15s; box-shadow: 4px 0 20px rgba(0,0,0,.2); }
  body.nav-open .layout > .steps { transform: none; }
  body.site .layout { grid-template-columns: 1fr; }
  .top { overflow-x: auto; } .top .env { display: none; }
  table.pf { display: block; overflow-x: auto; white-space: nowrap; }
}
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; height: auto; }
  .layout > .stage { min-height: 62vh; } .layout > .panel { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .wsbar { display: none; } .proj-sel { max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .page-head { flex-direction: column; align-items: stretch; gap: 8px; } .kpi3 { grid-template-columns: 1fr !important; }
  .ss { grid-template-columns: 1fr; } .ss-list, .ss-info { max-height: 40vh; }
}
.stage { grid-template-columns: minmax(0, 1fr); } .stage > *, .intake > * { min-width: 0; } .page-head > div { min-width: 0; } .page-head h2 { overflow-wrap: anywhere; }
@media (max-width: 1100px) { .wsbar button { padding: 4px 8px; font-size: 12.5px; } .proj-sel { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .top { flex-wrap: wrap; height: auto; row-gap: 6px; } }
@media (max-width: 760px) { .proj-sel small { display: none; } .intake .card { overflow-x: auto; } }
.row:has(> .zf) { align-items: flex-start; } .row:has(> .zf) .field { justify-content: flex-start; }
.zf > label.small { justify-content: flex-start; } .zf input[type=checkbox], label.small > input[type=checkbox] { flex: 0 0 auto; width: auto; margin: 0; }
.page-head { flex-wrap: wrap; } .page-head > .sub-btn, .page-head .ph-r > button, .page-head > button { white-space: nowrap; flex: 0 0 auto; }
.stepper { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: thin; } .stepper button { flex: 0 0 auto; white-space: nowrap; }
.stepper .sp-t { white-space: nowrap; flex: 0 0 auto; }
.stepper { min-height: 44px; flex-shrink: 0; position: relative; z-index: 2; } /* overflow-x ทำให้แถวกริดหดเหลือ 0 แล้วกระดาษทับ (UX อาวุโส S-ui-qa) */
/* โครงการ (S-swteam): ตัวเลือกโครงการ · ฟอร์มสร้าง · จุดเริ่ม 3 ทาง */
.ask-box.pj-box { width: min(760px, 94vw); max-height: 86vh; overflow: auto; }
.pj-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pj-tools { align-items: flex-end; } .pj-tools .field { flex: 1; }
.pj-starts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 8px 0; }
.pj-start { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px; border: 1px solid #d0d5dd; border-radius: 10px; background: #fff; cursor: pointer; min-height: 96px; }
.pj-start:hover, .pj-start:focus-visible { border-color: #1f3a68; box-shadow: 0 0 0 3px rgba(31,58,104,.12); }
.pj-start b { font-size: 15px; } .pj-start .chip { margin-top: auto; }
.pj-list tr.on td { background: #f2f6fc; }
.chip.warnc { background: #fff4e5; color: #9a5b00; border-color: #f5c27a; }
.pj-work .row { align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin: 6px 0; }
@media (max-width: 760px) { .pj-starts { grid-template-columns: minmax(0, 1fr); } .pj-start { min-height: 0; } }
.nav-ws { display: none; } @media (max-width: 760px) { .nav-ws { display: block; padding-bottom: 6px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 6px; } }
/* แถบขั้นเห็นครบทุกขั้นบนจอ > 760 (S-swteam: ขั้น 5–7 หลุดขอบเลื่อนบนแล็ปท็อป/iPad) — ตัดเป็น 2 บรรทัดแทนเลื่อน · มือถือยังเลื่อนแนวนอน */
@media (min-width: 761px) { .stepper { flex-wrap: wrap !important; overflow: visible; row-gap: 6px; height: auto; } .stepper button { padding: 4px 9px; } }
/* ตารางทุกตัวเลื่อนในกรอบของตัวเองบนจอแคบ ไม่ดันหน้า · รายชื่อโครงการบนมือถือเหลือ ชื่อ + แก้ล่าสุด */
@media (max-width: 1100px) { table.pf { display: block; overflow-x: auto; max-width: 100%; } }
.pj-list .lnk { white-space: normal; text-align: left; overflow-wrap: anywhere; }
@media (max-width: 760px) { .pj-list th:nth-child(2), .pj-list td:nth-child(2), .pj-list th:nth-child(3), .pj-list td:nth-child(3) { display: none; } .pj-list { display: table !important; } }
.feas-grid .row > .field, .feas-grid .row > .zf { flex: 1 1 0; min-width: 104px; } /* ช่องในแถวเดียวกันกว้างเท่ากัน (S-ui-qa) */
/* ทั้งวงงาน (แผงขวาศูนย์งาน) */
ol.loop { list-style: none; margin: 8px 0; padding: 0; } ol.loop li { display: flex; gap: 10px; padding: 7px 0; border-bottom: 1px solid #eef2f6; align-items: flex-start; }
.lp-n { flex: 0 0 22px; height: 22px; border-radius: 50%; background: #eef2f6; color: #475569; font-size: 12px; display: grid; place-items: center; font-weight: 600; }
.lp-done .lp-n { background: #e6eef6; color: #0f4c81; } .lp-current .lp-n { background: var(--accent); color: #fff; } .lp-off { opacity: .55; }

/* ── S-auth: เมนูผู้ใช้ ── */
.me-menu { position: relative; }
.me-menu > summary { list-style: none; cursor: pointer; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.me-menu > summary::-webkit-details-marker { display: none; }
.me-menu .me-m { position: absolute; right: 0; top: calc(100% + 6px); z-index: 60; background: #fff; color: #1d2a38; border: 1px solid #d5dce4; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.18); padding: 10px 12px; min-width: 200px; display: flex; flex-direction: column; gap: 4px; }
.me-menu .me-m .link-btn { text-align: left; min-height: 36px; }
tr.warnrow td { background: #fff6e5; }
@media (max-width: 760px) { .me-menu > summary small { display: none; } .me-menu > summary { max-width: 110px; } }

/* ── S-permit: เอกสารยื่นขออนุญาต ── */
.pm-tabs { margin: 12px 0; }
.pm-card h3 { margin: 0 0 8px; font-size: 15px; }
.pm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px 12px; align-items: end; }
.pm-grid .field { display: flex; flex-direction: column; min-width: 0; }
.pm-grid .field input, .pm-grid .field select { width: 100%; box-sizing: border-box; }
.pm-grid .chk { grid-column: 1 / -1; }
.pm-docs td { vertical-align: top; }
.pm-docs .pm-act { white-space: normal; min-width: 150px; }
.pm-docs .pm-act > * { margin: 2px 4px 2px 0; }
.pm-docs tr.pm-miss .pm-st { color: #b42318; font-weight: 600; }
.pm-docs tr.pm-sign .pm-st { color: #9a6700; font-weight: 600; }
.pm-docs tr.pm-ok .pm-st { color: #1a7f37; font-weight: 600; }
.pm-up { cursor: pointer; display: inline-flex; align-items: center; }
.pm-orders { padding-left: 0; list-style: none; }
.pm-fine { margin-top: 16px; }
.pm-prev { position: fixed; inset: 0; z-index: 80; background: rgba(15,39,66,.6); display: flex; flex-direction: column; }
.pm-prev-bar { display: flex; gap: 8px; align-items: center; padding: 10px 16px; background: #fff; border-bottom: 1px solid #d5dce4; }
.pm-paper { overflow: auto; padding: 20px; flex: 1; }
.pm-page { background: #fff; color: #000; max-width: 210mm; margin: 0 auto 20px; padding: 18mm 18mm 14mm; box-sizing: border-box; font: 15px/1.9 'Sarabun', 'Noto Sans Thai', serif; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.pm-page .pm-t { text-align: center; font-size: 18px; margin: 0 0 14px; }
.pm-page .pm-r { text-align: right; }
.pm-page .pm-ind { text-indent: 2.5em; }
.pm-page .pm-c { text-align: center; }
.pm-page .pm-note { font-size: 12px; color: #444; }
.pm-page .pm-draft { font-size: 11px; color: #666; border-top: 1px solid #bbb; margin-top: 24px; padding-top: 6px; }
.pm-page .sig { margin: 26px 0 0 45%; line-height: 2; }
.pm-page .pm-idx { width: 100%; border-collapse: collapse; font-size: 13px; }
.pm-page .pm-idx td, .pm-page .pm-idx th { border: 1px solid #999; padding: 3px 6px; text-align: left; }
.pm-page u { text-decoration: none; border-bottom: 1px dotted #000; }
@media (max-width: 760px) { .pm-paper { padding: 8px; } .pm-page { padding: 14px; font-size: 14px; } .pm-page .sig { margin-left: 10%; } .pm-docs .pm-act { min-width: 0; } }
@media print {
  body.pm-printing > *:not(.layout), body.pm-printing .layout > *:not(.stage), body.pm-printing .stage > *:not(.intake), body.pm-printing .intake > *:not(.pm-prev) { display: none !important; }
  body.pm-printing .pm-prev { position: static; background: none; }
  body.pm-printing .pm-prev-bar { display: none; }
  body.pm-printing .pm-paper { overflow: visible; padding: 0; }
  body.pm-printing .pm-page { box-shadow: none; margin: 0; max-width: none; page-break-after: always; }
}
.me-menu .me-m .small.muted { color: #5b6b7c; }
.pm-docs .pm-st { white-space: nowrap; }
@media (max-width: 760px) {
  table.pf.pm-docs { display: block; overflow: visible; }
  .pm-docs thead { display: none; }
  .pm-docs tbody, .pm-docs tr, .pm-docs td { display: block; width: auto; }
  .pm-docs tr { border-bottom: 1px solid var(--line, #e3e8ee); padding: 10px 0; }
  .pm-docs td { border: 0 !important; padding: 2px 0 !important; text-align: left !important; }
  .pm-docs td.num { display: none; }
}
.me-menu > summary { max-width: 150px; }
#restart { white-space: nowrap; flex-shrink: 0; }
@media (max-width: 1366px) { .top .env { display: none; } }
@media (max-width: 1240px) { .top { flex-wrap: wrap; height: auto; row-gap: 6px; } .proj-sel { max-width: 32vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .wsbar button { padding: 4px 8px; font-size: 12.5px; } }
.stage.has-sp .bim, .stage.has-sp .sheetset, .stage.has-sp.has-vb .bim, .stage.has-sp.has-vb .sheetset { top: var(--sp-h, 58px); }

/* ── S-pieces: ถอดรายชิ้น ── */
.pc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.pc-cat { all: unset; cursor: pointer; border: 1px solid var(--line, #d5dce4); border-radius: 8px; padding: 6px 9px; font-size: 13px; background: #fff; display: flex; flex-direction: column; min-width: 96px; }
.pc-cat span { font-size: 11.5px; color: #64748b; }
.pc-cat.on { border-color: #173a63; background: #eef3f9; box-shadow: inset 0 0 0 1px #173a63; }
.pc-t tbody tr { cursor: pointer; }
.pc-t tbody tr.on td { background: #fff7e6; }
.pc-t tr.pc-sum td { font-weight: 600; background: #f6f8fa; cursor: default; }
.pc-t td { vertical-align: top; }
.pc-m { padding-left: 18px; } .pc-m li { margin: 6px 0; }
.pc-k .kn { font-size: 18px; }
.resume-bar { background: #e8f3ec; border: 1px solid #9cd3ad; border-left: 4px solid #1a7f37; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; }
.resume-bar .row { margin-top: 6px; gap: 8px; }
@media (max-width: 1366px) { .top { flex-wrap: wrap; height: auto; row-gap: 6px; } }
#helpbtn { white-space: nowrap; flex-shrink: 0; }
/* ── S-service: ชนิดงานในแถบข้าง ── */
.steps .svc-sel { width: calc(100% - 16px); margin: 2px 8px 6px; padding: 6px 8px; border-radius: 6px; border: 1px solid rgba(255,255,255,.25); background: rgba(255,255,255,.08); color: #fff; font: inherit; font-size: 13.5px; }
.steps .svc-sel option { color: #1d2a38; }
.steps .svc-name { margin: 2px 12px 6px; color: #fff; }
.steps .svc-warn { margin: 0 12px 6px; color: #fcd58b; }
.steps .nav-more { margin: 8px 8px 0; color: rgba(255,255,255,.7); font-size: 13px; }
.steps .nav-more summary { cursor: pointer; padding: 4px; }
.pj-svc select { width: 100%; }
@media (max-width: 1600px) { .top .env { display: none; } }

/* แผงงานระบบ/การ์ดแผนที่ย่อได้ (ผู้ใช้ 5 พ.ย.: "บังไปหมด") */
.bim-xr[hidden] { display: none !important; }
.bim-xr.min > :not(.xr-h) { display: none !important; }
.bim-xr.min { width: auto; }
.map-card.min > :not(.mc-h) { display: none !important; }
.map-card.min { width: auto; }
.map-card .mc-h { display: flex; gap: 6px; align-items: flex-start; justify-content: space-between; }
.map-card .mc-h button { padding: 0 8px; line-height: 22px; }

/* เมนูหลังคารายผืน (S-roof-masses) */
.roof-pop .rp-m { min-width: 300px; display: grid; gap: 6px; }
.roof-pop .rp-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.roof-pop select { font: inherit; font-size: 13px; padding: 2px 4px; }
