:root {
  --bg: #e2eafb; --surface: #fbfcff; --ink: #1b2550; --muted: #55608c; --line: #c8d4f0;
  --side: #cbdcfc; --side-2: #c8c2f5; --side-ink: #1e3a8a;
  --accent: #4338ca; --accent-2: #2b8fe8; --accent-soft: #d6dfff; --accent-ink: #fff;
  --ok: #3f7a55; --ok-soft: #dcebdf; --warn: #a8690a; --warn-soft: #fbe7b8; --bad: #b3261e;
  --blue: #7c3aed; --blue-soft: #efe8fe; --amber: #f0b429;
  --shadow: 0 1px 0 #fff inset, 0 6px 18px rgba(50, 70, 150, .10);
  --display: "IBM Plex Sans Thai", "Leelawadee UI", sans-serif;
  --body: "Sarabun", "Leelawadee UI", sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.6; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.3; }
h1 { font-size: 1.4rem; } h2 { font-size: 1.35rem; } h3 { font-size: 1.05rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.grow { flex: 1 1 auto; }
.center { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }

/* ค่าฐานของช่องกรอกทุกช่อง (ทับได้ด้วยคลาส) */
:where(input, select, textarea, button) { font: inherit; color: inherit; }
:where(input, select, textarea) { width: 100%; padding: 8px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
:where(input, select, textarea):disabled { background: var(--bg); color: var(--ink); opacity: 1; }
:where(input, select, textarea, button, a):focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 2px; }
button { padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; white-space: nowrap; font-family: var(--display); font-weight: 600; font-size: .95rem; box-shadow: var(--shadow); }
button:hover { border-color: var(--accent-2); }
button.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); text-shadow: 0 1px 1px rgba(30, 30, 110, .35); }
button.primary:hover { filter: brightness(.96); }
button:disabled { opacity: .6; cursor: default; }
a { color: var(--accent); }

.card { background: var(--surface); border: 2px solid #fff; border-radius: 24px; padding: 22px; box-shadow: var(--shadow); }
.login { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 12px; }
.msg { min-height: 1.6em; font-size: .95rem; color: var(--ok); }
.msg.bad { color: var(--bad); }

/* ── โครงหน้า: เมนูซ้าย + เนื้อหา ── */
#app { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: 100vh; }
#app.navhide { grid-template-columns: minmax(0, 1fr); }
#app.navhide .side { display: none; }
.side { position: sticky; top: 12px; height: calc(100vh - 24px); margin: 12px 0 12px 12px; padding: 18px 14px; display: flex; flex-direction: column; gap: 6px; background: linear-gradient(180deg, var(--side), var(--side-2)); border-radius: 26px; color: var(--side-ink); box-shadow: 0 6px 18px rgba(60, 80, 160, .15); overflow-y: auto; }
.brand { display: flex; align-items: center; gap: 12px; padding: 4px 6px 16px; text-decoration: none; color: var(--side-ink); }
.brand .logo { flex: 0 0 auto; width: 54px; height: 54px; border-radius: 18px; object-fit: cover; border: 2px solid #fff; display: grid; place-items: center; background: #fff; color: #fff; font-family: var(--display); font-weight: 700; font-size: 1.2rem; box-shadow: 0 4px 10px rgba(79, 70, 229, .28); }
.brand b { display: block; font-family: var(--display); font-size: 1rem; line-height: 1.25; }
.brand small { display: block; font-size: .8rem; color: #5a6a9a; }
.nav { display: flex; flex-direction: column; gap: 4px; }
.nav .item { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-radius: 16px; font-family: var(--display); font-weight: 600; font-size: .98rem; white-space: nowrap; color: var(--side-ink); text-decoration: none; }
.nav .item svg { flex: 0 0 auto; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a.item:hover { background: rgba(255, 255, 255, .45); }
.nav .item.on { background: var(--surface); box-shadow: 0 4px 12px rgba(60, 80, 160, .18); }
.nav .item.soon { color: #6f7fb0; cursor: default; }
.nav .item.soon em { margin-left: auto; font-style: normal; font-family: var(--body); font-weight: 400; font-size: .72rem; padding: 1px 8px; border-radius: 999px; background: rgba(255, 255, 255, .55); white-space: nowrap; }
.navhead { padding: 12px 12px 4px; font-family: var(--display); font-weight: 700; font-size: .75rem; letter-spacing: .05em; color: #6f7fb0; }
.sidefoot { margin-top: auto; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .6); display: flex; flex-direction: column; gap: 8px; }
.sidefoot #who { font-size: .85rem; color: #46558a; padding: 0 6px; overflow-wrap: anywhere; }
.sidefoot button { width: 100%; }
.scrim { display: none; }

.main { min-width: 0; padding: 12px 20px 28px; display: flex; flex-direction: column; gap: 16px; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 18px; background: var(--surface); border: 2px solid #fff; border-radius: 22px; box-shadow: var(--shadow); }
.top .burger { padding: 6px 10px; border: 0; background: none; box-shadow: none; font-size: 1.3rem; line-height: 1; }
.top b { display: block; font-family: var(--display); font-size: 1.05rem; line-height: 1.3; }
.top small { display: block; font-size: .82rem; color: var(--muted); }
.page { display: flex; flex-direction: column; gap: 16px; }

/* ── หน้าหลัก: การ์ดเลือกงาน ── */
#app.home, #app.home.navhide { grid-template-columns: minmax(0, 1fr); }
#app.home .side, #app.home .burger, #app.home .scrim { display: none !important; }
#app.home .main { max-width: 1280px; width: 100%; margin: 0 auto; }
.hello { padding: 6px 4px 0; }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.app { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 24px 20px 0; text-align: center; text-decoration: none; color: var(--ink); white-space: normal; font-family: var(--body); font-weight: 400; cursor: pointer; transition: transform .12s; }
a.app:hover, button.app:hover { transform: translateY(-2px); border-color: #fff; box-shadow: 0 1px 0 #fff inset, 0 10px 24px rgba(50, 70, 150, .16); }
.app b { font-family: var(--display); font-size: 1.1rem; margin-top: 12px; }
.app small { font-size: .85rem; color: var(--muted); min-height: 1.6em; }
.app .go { align-self: stretch; margin-top: 14px; padding: 12px 0; border-top: 1px solid var(--line); font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--accent); }
.appico { width: 58px; height: 58px; border-radius: 18px; display: grid; place-items: center; color: #fff; box-shadow: 0 6px 14px rgba(50, 70, 150, .22); }
.appico svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.appico.c1 { background: linear-gradient(135deg, var(--accent-2), var(--accent)); }
.appico.c2 { background: linear-gradient(135deg, #a78bfa, #7c3aed); }
.appico.c3 { background: linear-gradient(135deg, #aab4d4, #7a86ad); }
.appico.c4 { background: linear-gradient(135deg, #f7cf5a, #e9a11a); }
.app.soon { cursor: default; opacity: .7; }
.app.soon .go { color: var(--muted); }

.hero { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; background: linear-gradient(120deg, #e3edff, var(--surface) 60%); }
.hero .txt { flex: 1 1 320px; min-width: 0; }
.tag { display: inline-block; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); color: #1e40af; font-family: var(--display); font-weight: 700; font-size: .78rem; letter-spacing: .04em; margin-bottom: 6px; }
.hero .filters { display: flex; flex-direction: column; gap: 8px; flex: 0 1 340px; }
.hero .filters .row { display: flex; gap: 8px; align-items: center; }
.hero .filters label { margin: 0; white-space: nowrap; }
.hero .filters :where(input, select) { border-radius: 999px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stat { padding: 16px 18px; border-left: 4px solid var(--c); }
.stat span { display: block; font-size: .9rem; color: var(--muted); }
.stat b { display: block; font-family: var(--display); font-size: 1.7rem; line-height: 1.4; color: var(--c); font-variant-numeric: tabular-nums; }
.stat small { display: block; font-size: .8rem; color: var(--muted); }
.stat.s1 { --c: var(--ok); } .stat.s2 { --c: var(--accent); } .stat.s3 { --c: #b8851f; } .stat.s4 { --c: var(--blue); background: linear-gradient(120deg, var(--surface), var(--blue-soft)); }

.bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bar label { margin: 0; }
.check { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); font-size: 1rem; }
.check input { width: auto; accent-color: var(--accent); }
.cardhead { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.cardhead h3 { color: #1e40af; }

.tablewrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-family: var(--display); font-size: .88rem; font-weight: 600; color: var(--muted); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: rgba(255, 255, 255, .6); }
td a { font-weight: 600; text-decoration: none; }
#ovTable td:nth-child(3) { min-width: 240px; }
td a:hover { text-decoration: underline; }
.num { text-align: right; white-space: nowrap; }
.mono { white-space: nowrap; }
td.warn { color: var(--warn); font-weight: 600; }
td.ok { color: var(--ok); }
td.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.pill { display: inline-block; padding: 1px 12px; border-radius: 999px; font-family: var(--display); font-weight: 600; font-size: .8rem; white-space: nowrap; }
.pill.ok { background: var(--ok-soft); color: #2c5c3e; }
.pill.warn { background: var(--warn-soft); color: #7a4b00; }
a.pill.info { background: var(--accent-soft, #d6dfff); color: var(--accent, #4338ca); margin-left: 6px; text-decoration: none; white-space: nowrap; }
a.pill.info:hover { text-decoration: underline; }

/* ── ตารางกรอกเงินได้รายเดือน ── */
.cardhead label { margin: 0; white-space: nowrap; }
select.auto { width: auto; border-radius: 999px; }
.paygrid th, .paygrid td { padding: 6px 6px; vertical-align: middle; }
.paygrid th:not(:nth-child(2)), .paygrid td:not(:nth-child(2)) { text-align: right; white-space: nowrap; }
.paygrid .stick { position: sticky; left: 0; z-index: 1; background: var(--surface); min-width: 200px; white-space: nowrap; }
.paygrid .carry { background: rgba(227, 236, 245, .55); }
.paygrid .tot { font-weight: 600; }
.paygrid tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
.paygrid input.cell { width: 104px; padding: 5px 8px; border-radius: 8px; text-align: right; font-variant-numeric: tabular-nums; }
.paygrid input.cell.dirty { background: var(--warn-soft); }
.paygrid input.cell.bad { border-color: var(--bad); background: #fde4e1; }
.hint { font-size: .88rem; margin-top: 8px; }

/* ── หน้านำเข้า ── */
#impTable td, #batTable td { vertical-align: middle; }
#impTable td.check input { width: 18px; height: 18px; }
#impTable select { min-width: 220px; padding: 5px 10px; border-radius: 10px; }
#impTable tr.dim td { color: var(--muted); }
#impTable td:last-child { min-width: 260px; font-size: .9rem; }
#impTable td:last-child .muted { font-size: .85rem; }
.hero .filters input[type=file] { padding: 6px 10px; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.grid .wide { grid-column: span 2; }
.grid .full { grid-column: 1 / -1; }
.actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
dialog { border: 2px solid #fff; border-radius: 24px; padding: 22px; width: min(680px, calc(100vw - 32px)); color: var(--ink); background: var(--surface); box-shadow: 0 20px 50px rgba(30, 40, 90, .3); }
dialog::backdrop { background: rgba(23, 37, 84, .45); }

@media (max-width: 1000px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 800px) {
  #app, #app.navhide { grid-template-columns: minmax(0, 1fr); }
  .side, #app.navhide .side { display: none; position: fixed; z-index: 20; top: 0; left: 0; height: 100vh; width: 264px; margin: 0; border-radius: 0 26px 26px 0; }
  #app.navshow .side { display: flex; }
  #app.navshow .scrim { display: block; position: fixed; inset: 0; z-index: 10; background: rgba(23, 37, 84, .4); }
  .main { padding: 10px 16px 24px; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .grid .wide { grid-column: auto; }
  .stats { gap: 10px; }
  .stat b { font-size: 1.35rem; }
}

/* ── 50 ทวิ · ภ.ง.ด.1ก ── */
.docopts { display: flex; gap: 14px 28px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.docopts input[type=date] { width: auto; border-radius: 999px; }
.warnlist { margin: 0 0 12px; padding: 10px 14px 10px 32px; border-radius: 16px; background: var(--warn-soft); color: #7a4b00; font-size: .95rem; }
.warnlist:empty { display: none; }
#docTable tfoot td { font-weight: 600; border-top: 2px solid var(--line); border-bottom: 0; }
tr.rowlink { cursor: pointer; }
tr.rowlink:hover td { background: var(--accent-soft); }
tr.rowlink button { padding: 4px 14px; white-space: nowrap; }

/* ── แท็บในหน้านำเข้า + ตารางไฟล์รายเดือน ── */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tabs button { font-family: var(--display); font-weight: 600; }
.tabs button.on { background: var(--surface); border-color: var(--accent); color: var(--accent); box-shadow: 0 4px 12px rgba(60, 80, 160, .14); }
input.auto { width: auto; }
#imTable td { vertical-align: middle; }
#imTable td.check input { width: 18px; height: 18px; }
#imTable tr.dim td { color: var(--muted); }
#imTable td:last-child { min-width: 300px; font-size: .9rem; }
#imTable td:last-child .muted { font-size: .85rem; }
#imTable td:last-child .bad { color: var(--bad); }

/* วิธีใช้ไฟล์ยื่นออนไลน์ */
.rdhelp { margin-top: 12px; }
.rdhelp summary { cursor: pointer; font-weight: 600; }
.rdhelp ol { margin: 8px 0; padding-left: 22px; line-height: 1.7; }

/* รูปลายเซ็น/ตราประทับในข้อมูลบริษัท */
.imgslot .imgbox { height: 110px; border: 1px dashed #c9ced6; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin: 4px 0 8px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 0 0 / 16px 16px; }
.imgslot .imgbox img { max-width: 92%; max-height: 96px; }
.imgslot input[type=file] { max-width: 220px; }

/* โลโก้ */
.loginlogo { display: block; width: 210px; height: 210px; margin: 0 auto 4px; border-radius: 28px; }
.login h1 { text-align: center; color: #1e3a8a; }
.hello { display: flex; align-items: center; gap: 16px; }
.hello img { width: 92px; height: 92px; border-radius: 26px; border: 3px solid #fff; box-shadow: var(--shadow); }
h2 { color: #1e3a8a; }

/* หน้าบริษัท: สรุปรายเดือน + รายคนของเดือน */
.pmstats { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 14px; }
.linkbtn { padding: 2px 4px; border: 0; background: none; box-shadow: none; color: var(--accent); text-decoration: underline; font-weight: 600; font-size: 1rem; }
.linkbtn:hover { color: var(--blue); }
#pmTable td, #pmTable th { padding: 9px 10px; }
#pmTable .carryrow td { background: rgba(227, 236, 245, .55); }
.paygrid .sumcol { background: var(--accent-soft); font-weight: 600; }
#payMonthBox .cardhead, #payYearBox .cardhead { margin-bottom: 8px; }
@media (max-width: 720px) { .pmstats { grid-template-columns: 1fr; } }

/* การ์ดลายเซ็นและตราประทับ: 2 ช่องเท่ากัน */
.cardhead .sub { font-size: .88rem; margin-top: 2px; }
.imgpair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
#fsCard .imgpair { margin-top: 16px; }
.imgpair .imgslot b { display: block; font-family: var(--display); margin-bottom: 6px; }
.imgpair .imgslot .imgbox { height: 180px; border-radius: 16px; margin: 0 0 10px; }
.imgpair .imgslot .imgbox img { max-width: 88%; max-height: 156px; }
@media (max-width: 720px) { .imgpair { grid-template-columns: 1fr; } }
.imgpair .imgslot input[type=file] { max-width: none; width: auto; flex: 1 1 320px; }
.imgpair .imgslot .actions { flex-wrap: wrap; }

/* สถานะตรวจ (หน้ายื่นรายเดือน + สรุปรายเดือนหน้าบริษัท) */
.checkrow { display: flex; gap: 10px 12px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
#pmTable td:last-child, #pmTable th:last-child { text-align: left; }

/* หน้าล็อกอิน: ช่องใส่รหัส 6 หลัก */
#loginCodeBox { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 1px solid rgba(60, 80, 160, .15); }
#loginCodeBox[hidden] { display: none; }
#loginCode { font-size: 1.4rem; letter-spacing: .35em; text-align: center; }
#loginCodeBox p { margin: 0; text-align: center; }

/* หน้าตั้งค่าสำนักงาน */
.btnlink { display: inline-block; padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid rgba(60, 80, 160, .2); color: var(--accent); font-weight: 600; text-decoration: none; }
#setTable tr.off td { color: #8b93a7; }

/* หน้ารวม: แถบ 12 เดือนต่อบริษัท */
.mstrip { display: inline-flex; gap: 3px; vertical-align: middle; }
.mdot { display: inline-block; width: 13px; height: 13px; border-radius: 4px; background: #e3e8f3; border: 1px solid #cdd5e6; vertical-align: middle; }
.mdot.data { background: #f6c453; border-color: #d89c1d; }
.mdot.ok { background: #4fae78; border-color: #2f8a57; }
.legend .mdot { margin: 0 4px 0 10px; }
.legend .mdot:first-child { margin-left: 0; }
.loginlead { text-align: center; margin: 0; }

/* รายรับ */
.nav > div { display: flex; flex-direction: column; gap: inherit; }
.nav > div[hidden] { display: none; }
.pill.bad { background: #fde2e2; color: #9b1c1c; }
.pill.off { background: #e8ebf3; color: #5b6478; }
tr.void td { color: var(--muted); }
tr.void td:nth-child(2) { text-decoration: line-through; }
td.acts { white-space: nowrap; text-align: right; }
td.acts button { margin-left: 6px; }
.linetable td { padding: 4px 6px; vertical-align: middle; }
.linetable input, .linetable select { width: 100%; min-width: 0; }
.linetable td.num input { text-align: right; }
.linetable th:nth-child(2) { width: 46%; }
.linefoot { display: flex; align-items: center; gap: 12px; }
#vIncWht .hero .filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; flex: 0 1 520px; }
table.sumfoot tfoot td, #whTable tfoot td { font-weight: 600; border-top: 2px solid var(--line); padding-top: 10px; }
/* หน้าต่างค่าบริการประจำ: กว้างพอให้ช่องเดือนเริ่ม/หยุดอ่านออกเต็มคำ */
#feeDlg { width: min(940px, calc(100vw - 32px)); }
#fdTable { table-layout: fixed; width: 100%; min-width: 760px; }
#fdTable th:nth-child(1) { width: 36px; }
#fdTable th:nth-child(2) { width: auto; }
#fdTable th:nth-child(3) { width: 130px; }
#fdTable th:nth-child(4), #fdTable th:nth-child(5) { width: 160px; }
#fdTable th:nth-child(6) { width: 70px; }
#fdTable th { white-space: nowrap; }
.total { font-family: var(--display); font-weight: 700; color: #1e3a8a; margin: 0; }
.feelist { margin: 0; padding: 0; list-style: none; }
.feelist li.ended { color: var(--muted); }
.cardhead .row { display: flex; align-items: center; gap: 8px; }
.cardhead .row label { margin: 0; white-space: nowrap; }
.cardhead .row select { width: auto; border-radius: 999px; }
td.zero { color: var(--muted); }
/* ใบแจ้งหนี้ครั้งเดียว: มีช่อง จำนวน · หน่วย · ราคาต่อหน่วย */
#invDlg { width: min(940px, calc(100vw - 32px)); }
#ivTable { table-layout: fixed; width: 100%; min-width: 760px; }
#ivTable th:nth-child(1) { width: 36px; }
#ivTable th:nth-child(2) { width: auto; }
#ivTable th:nth-child(3) { width: 80px; }
#ivTable th:nth-child(4) { width: 100px; }
#ivTable th:nth-child(5), #ivTable th:nth-child(6) { width: 130px; }
#ivTable th:nth-child(7) { width: 70px; }
#ivTable th { white-space: nowrap; }
#ivTable td.lt { text-align: right; font-variant-numeric: tabular-nums; }
button.mini { padding: 2px 10px; font-size: .82rem; margin-left: 6px; }
.pill.sent { margin-left: 6px; }
.small { font-size: .82rem; }
/* ปุ่ม ⋯ ในแถว + เมนูคำสั่ง */
button.more { padding: 6px 12px; font-size: 1.15rem; line-height: 1; letter-spacing: 1px; }
.rowmenu { position: fixed; z-index: 50; min-width: 190px; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 14px 34px rgba(30, 40, 90, .22); }
.rowmenu button { border: 0; box-shadow: none; background: transparent; border-radius: 10px; padding: 9px 14px; text-align: left; font-weight: 500; }
.rowmenu button:hover, .rowmenu button:focus-visible { background: var(--bg); outline: none; }
.rowmenu button.danger { color: #b3261e; }
td.acts .muted { margin-right: 4px; }
/* ตารางใบแจ้งหนี้ / ใบเสร็จ: เลขที่ วันที่ ยอดเงิน ไม่ตัดบรรทัด · ชื่อบริษัทกับรายการรับความกว้างที่เหลือ */
#incTable th, #rcTable th { white-space: nowrap; }
#incTable td:nth-child(2), #incTable td:nth-child(3), #incTable td:nth-child(6), #incTable td:nth-child(7),
#rcTable td:nth-child(2), #rcTable td:nth-child(3), #rcTable td:nth-child(5), #rcTable td:nth-child(6), #rcTable td:nth-child(7), #rcTable td:nth-child(8) { white-space: nowrap; }
#incTable td:nth-child(4), #incTable td:nth-child(5), #rcTable td:nth-child(4) { min-width: 150px; }
#incTable td, #rcTable td { vertical-align: middle; }
#incTable td:nth-child(8) .pill { display: inline-block; margin: 2px 6px 2px 0; }
#incTable td.acts, #rcTable td.acts { width: 1%; }
/* จอแคบ ตารางเลื่อนข้างได้ แต่คอลัมน์ปุ่มเกาะขอบขวาไว้เสมอ */
#incTable td:nth-child(4), #incTable td:nth-child(5), #rcTable td:nth-child(4) { min-width: 120px; }
#incTable td.acts, #rcTable td.acts, #incTable tbody tr:hover td.acts, #rcTable tbody tr:hover td.acts { position: sticky; right: 0; background: var(--surface); }
#incTable td.acts, #rcTable td.acts { box-shadow: -10px 0 10px -10px rgba(30, 40, 90, .18); }
/* หน้าแรก: ระบบที่กำลังจะมี (ยังเข้าไม่ได้) */
.soonhead { margin: 26px 4px 12px; font-family: var(--display); font-size: 1rem; color: var(--muted); }
.app.soon { border-style: dashed; border-color: var(--line); box-shadow: none; }
.app.soon .go { display: flex; align-items: center; justify-content: center; gap: 6px; }
.app.soon .lock svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; display: block; }
/* เครื่องมือ: รวมลิงก์ */
.appico.c5 { background: linear-gradient(135deg, #5fd4c4, #1f9e8f); }
a.btnlink.primary { background: linear-gradient(135deg, var(--accent-2), var(--accent)); border-color: transparent; color: var(--accent-ink); text-shadow: 0 1px 1px rgba(30, 30, 110, .35); font-family: var(--display); font-size: .95rem; box-shadow: var(--shadow); white-space: nowrap; }
#tlTable td { vertical-align: middle; }
#tlTable td:nth-child(3) a { font-weight: 600; }
#tlTable td.acts { width: 1%; white-space: nowrap; }
#tlTable td.acts .btnlink { margin-right: 6px; }
#tlTable th:first-child, #tlTable td:first-child { width: 48px; }
#tlTable td:nth-child(2) { width: 160px; }
#bkTable { max-width: 560px; }
#bkTable th:first-child, #bkTable td:first-child { width: 48px; }
#bkTable th:last-child { text-align: right; }

/* ตั้งค่า › ตั้งค่าเอกสาร (spec §8.17): ฟอร์มซ้าย · ตัวอย่าง PDF ขวา */
.dswrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.dsblock { margin-bottom: 20px; }
.dsblock > b { display: block; font-family: var(--display); margin-bottom: 6px; }
.dsblock .dsgap { margin-top: 10px; }
.dsblock .checkrow { margin-bottom: 0; gap: 8px 18px; }
.dsform .imgslot .imgbox { height: 130px; border-radius: 16px; padding: 0 12px; text-align: center; }
.dsform .imgslot .imgbox img { max-height: 110px; }
.dsform .imgslot input[type=file] { max-width: none; flex: 1 1 240px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.swatch { width: 36px; height: 36px; padding: 0; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.swatch.on { box-shadow: 0 0 0 3px var(--accent); }
.swatch:disabled { cursor: default; opacity: .75; }
.swatch.on:disabled { opacity: 1; }
#dsColor { width: 56px; height: 36px; padding: 2px; border-radius: 10px; }
.dsprev { position: sticky; top: 16px; }
.dsprev .actions { margin-bottom: 10px; }
#dsFrame { width: 100%; aspect-ratio: 210 / 297; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
@media (max-width: 980px) { .dswrap { grid-template-columns: 1fr; } .dsprev { position: static; } }
@media (max-width: 720px) { .grid.two { grid-template-columns: 1fr; } }

/* ตัวเลขในตารางสรุปที่กดแล้วไปเมนูของแบบนั้น (spec §7.32) */
.numlink { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.numlink:hover { color: var(--blue); }

/* ผู้ดูแลระบบกลาง (spec §15.6) */
#plDlg fieldset { border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px 10px; margin: 0; }
#plDlg legend { padding: 0 6px; font-weight: 600; }
#plMods label.chk { display: flex; align-items: flex-start; justify-content: flex-start; gap: 10px; padding: 6px 0; font-weight: 400; cursor: pointer; text-align: left; }
#plMods label.chk input { width: auto; flex: none; margin: 4px 0 0; }
#plMods label.chk span { flex: 1; }
#homePlan { margin-top: 2px; font-size: .85rem; }
#homeSus { border-color: #f3c4c4; background: #fff6f6; }
/* แถว บริษัทสูงสุด · ใช้ได้ถึง · สถานะ — กว้างเท่ากันเต็มแถว (เพิ่มสำนักงาน = 2 ช่อง · แก้ไข = 3 ช่อง) */
#plDlg .plRow { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 12px 14px; align-items: start; }
#plDlg .plRow > div[hidden] { display: none; }
#plDlg .plRow input, #plDlg .plRow select { width: 100%; height: 44px; box-sizing: border-box; margin: 0; }
#plDlg .plRow label { display: block; line-height: 1.5; }
@media (max-width: 800px) { #plDlg .plRow { grid-auto-flow: row; } }

/* หน้าตาเว็บต่อสำนักงาน (spec §15.13) */
.byline { display: block; text-align: center; font-size: .75rem; color: var(--muted); opacity: .85; }
.brlogo { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 72px; }
.brlogo img { width: 72px; height: 72px; object-fit: contain; border-radius: 16px; background: #fff; border: 1px solid var(--line); }
.btnlike { display: inline-block; padding: 8px 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-family: var(--display); font-weight: 600; font-size: .95rem; color: var(--ink); margin: 0; }
.brand .logo.custom { object-fit: contain; }
.loginlogo.custom { object-fit: contain; width: 160px; height: 160px; }
.brand .logo.initial { background: linear-gradient(135deg, var(--accent-2), var(--accent)); font-size: 1.5rem; }

/* รหัสผ่าน + ทดลองใช้ (spec §16) */
#loginMode, #trialBackBtn { align-self: center; font-size: .9rem; }
.trialcta { display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.trialcta button { width: 100%; }
.trialform { max-width: 520px; }
#trialFields { display: flex; flex-direction: column; gap: 6px; }
#trialFields button { margin-top: 8px; }
.loginlogo.small { width: 120px; height: 120px; }
#tpText { font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.pluser { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pluser span { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }

/* หน้าแรกแนะนำระบบ (ที่อยู่กลาง · ยังไม่เข้าระบบ) */
#landing { max-width: 1120px; margin: 0 auto; padding: 16px 16px 40px; }
.lnav { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; }
.lbrand { display: flex; align-items: center; gap: 10px; font-family: var(--display); color: var(--side-ink); }
.lbrand img { border-radius: 12px; }
.lhero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 28px; align-items: center; padding: 28px 0 12px; }
.lhero h1 { font-size: clamp(1.7rem, 4vw, 2.6rem); margin: 10px 0 12px; color: var(--ink); }
.lhero p { font-size: 1.05rem; }
.lcta { display: flex; gap: 12px; flex-wrap: wrap; margin: 20px 0 8px; }
.lcta button { padding: 12px 24px; font-size: 1rem; }
.lsmall { font-size: .9rem; }
.lart { width: 100%; max-width: 340px; height: auto; justify-self: center; border-radius: 32px; }
.lsec { margin-top: 36px; }
.lsec > h2 { text-align: center; margin-bottom: 18px; }
.lgrid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.lfeat h3 { margin: 12px 0 6px; }
.lfeat ul { margin: 0; padding-left: 18px; color: var(--muted); }
.lfeat li { margin: 4px 0; }
.lgrid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.lwhy { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 20px; background: var(--surface); border: 2px solid #fff; box-shadow: var(--shadow); }
.lwhy svg { width: 30px; height: 30px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lwhy b { font-family: var(--display); }
.lwhy span { color: var(--muted); font-size: .92rem; }
.lsteps { text-align: center; }
.lsteps ol { list-style: none; counter-reset: st; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0; margin: 18px 0 20px; }
.lsteps li { counter-increment: st; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lsteps li::before { content: counter(st); display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; font-family: var(--display); font-weight: 700; }
.lsteps li span { color: var(--muted); font-size: .92rem; }
.lsteps button { padding: 12px 28px; font-size: 1rem; }
.lfoot { text-align: center; margin-top: 36px; font-size: .85rem; }
@media (max-width: 800px) {
  .lhero { grid-template-columns: 1fr; text-align: center; }
  .lcta { justify-content: center; }
  .lart { max-width: 220px; grid-row: 1; }
  .lgrid3, .lsteps ol { grid-template-columns: 1fr; }
  .lgrid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lbrand b { font-size: .95rem; }
}
.app { position: relative; }
.newbadge { position: absolute; top: 12px; right: 12px; padding: 2px 10px; border-radius: 999px; background: var(--bad); color: #fff; font-family: var(--display); font-weight: 600; font-size: .8rem; }
.rsmode { border: 1px solid var(--line); border-radius: 16px; padding: 10px 14px; margin: 12px 0; }
.rsmode legend { padding: 0 6px; font-weight: 600; }
.rsopt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; cursor: pointer; }
.rsopt input { margin-top: 5px; flex: none; }
.rsopt span { display: flex; flex-direction: column; }
.rsconfirm { margin: 0 0 12px; max-width: 520px; }
.rsconfirm input { width: 100%; }
#rsRunBtn.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.rsopt input[type="radio"] { width: auto; min-width: 0; height: auto; padding: 0; margin: 5px 0 0; flex: none; }
.rsopt span { flex: 1; min-width: 0; }
/* วิดีโอแนะนำ (spec §16.7) */
dialog.viddlg { width: min(1100px, calc(100vw - 24px)); padding: 14px; }
.vidhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.vidhead h3 { margin: 0; }
#vidPlayer { display: block; width: 100%; aspect-ratio: 16 / 9; background: #10153a; border-radius: 14px; }
.homeintro { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* ปุ่มเข้าสู่ระบบหน้าแรก: ทึบกรมท่า ให้เด่น (17 พ.ย. 69 พี่กี้ขอ) */
button.lnLogin { background: var(--ink); color: #fff; border-color: var(--ink); text-shadow: none; }
button.lnLogin:hover { background: #2a3770; border-color: #2a3770; }
.lnav button.lnLogin { padding: 9px 22px; }
/* วิดีโอฝังหน้าแรก (spec §16.8) */
.lvidbox { position: relative; max-width: 960px; margin: 0 auto; border-radius: 22px; overflow: hidden; box-shadow: 0 14px 40px rgba(50, 70, 150, .22); border: 3px solid #fff; background: #eef2fd; }
#lvid { display: block; width: 100%; aspect-ratio: 16 / 9; background: #eef2fd; }
.lvidsound { position: absolute; right: 14px; bottom: 14px; padding: 10px 20px; font-size: 1rem; box-shadow: 0 6px 18px rgba(30, 40, 110, .35); }
@media (max-width: 640px) { .lvidsound { right: 8px; bottom: 8px; padding: 7px 12px; font-size: .85rem; } .lvidbox { border-radius: 14px; } }

/* ── ยืนยันยอดสรรพากร (spec §17) ── */
dialog.wide { width: min(1100px, calc(100vw - 24px)); }
#rdTable tr.click { cursor: pointer; }
#rdTable td.num small, #rdTable td small { white-space: nowrap; }
#rdDetBody table td.num, #rdDetBody table th.num { text-align: right; font-variant-numeric: tabular-nums; }
#rdDetBody tr.diffrow td { background: #fde2e2; color: #9b1c1c; font-weight: 600; }
#rdDetBody h4 { margin: 18px 0 6px; }
button.link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: underline; cursor: pointer; font: inherit; }
table.rdgrid { min-width: 720px; }
table.rdgrid th, table.rdgrid td.c { text-align: center; padding: 4px; }
table.rdgrid tbody th { text-align: left; white-space: nowrap; font-weight: 600; }
button.rdc { min-width: 34px; padding: 3px 8px; border-radius: 999px; border: 0; font-weight: 700; cursor: pointer; }
button.rdc.ok { background: var(--ok-soft); color: #2c5c3e; }
button.rdc.bad { background: #fde2e2; color: #9b1c1c; }
button.rdc.warn { background: var(--warn-soft); color: #7a4b00; }
button.rdc.off { background: #eef0f5; color: #8a93a6; }

/* โหมดช่วยเหลือ (spec §18) */
.supportbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 10px 0 0; padding: 10px 16px; border-radius: 16px; background: var(--warn-soft); color: #5a3a00; border: 2px solid var(--warn); font-weight: 600; }
.supportbar span { flex: 1 1 260px; }
.supportbar button { background: #fff; }

/* LINE OA (spec §19) */
.slipthumb { width: 56px; height: 72px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line, #ddd); display: block; }
/* ตัวอย่างการ์ด LINE ก่อนส่ง (line-ui.js flexHtml) */
.lsprev { background: #8cabd9; border-radius: 12px; padding: 14px; display: flex; justify-content: center; }
.fx-bubble { background: #fff; color: #333; border-radius: 16px; width: 290px; max-width: 100%; overflow: hidden; font-family: Sarabun, sans-serif; box-shadow: 0 1px 3px #0002; }
.fx-body { padding: 16px; } .fx-foot { padding: 0 16px 16px; }
.fx-box.v { display: flex; flex-direction: column; gap: 4px; } .fx-box.h { display: flex; gap: 8px; }
.fx-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.4; }
.fx-sep { border-top: 1px solid #e5e5e5; margin-top: 8px; }
.fx-btn { text-align: center; border-radius: 8px; padding: 9px; font-weight: 600; background: #eee; color: #333; }
.fx-btn.primary { background: #2f4fa8; color: #fff; }
#lineSendDlg { width: min(460px, calc(100vw - 32px)); }
.slipthumb.pdf { display: grid; place-items: center; font-weight: 700; color: #b42318; background: #fff4f2; font-size: .85rem; }
.linkcode { font-size: 2.4rem; font-weight: 700; letter-spacing: .3em; text-align: center; margin: 8px 0; }
.navbadge { display: inline-block; min-width: 1.4em; padding: 0 .4em; margin-left: 4px; border-radius: 999px; background: #e03131; color: #fff; font-size: .75rem; line-height: 1.4em; text-align: center; }
label.check { display: flex; gap: 8px; align-items: flex-start; margin: 6px 0; font-weight: normal; }
label.check input { width: auto; margin-top: 3px; }
#slTable select { min-width: 250px; }

/* เอกสารลูกค้า (spec §19.7) */
#csTypes label.chk, #cdTypeDlg label.chk { display: flex; align-items: flex-start; gap: 10px; padding: 4px 0; font-weight: 400; cursor: pointer; text-align: left; }
#csTypes label.chk input, #cdTypeDlg label.chk input { width: auto; flex: none; margin: 4px 0 0; }
#cdTable th.cdh { text-align: center; font-size: .8rem; min-width: 76px; }
#cdTable td.cd { text-align: center; }
#cdTable td.co { cursor: pointer; }
#cdTable td.co:hover b { color: var(--accent); text-decoration: underline; }
.cdc { display: inline-block; min-width: 52px; border-radius: 8px; padding: 1px 8px; font-size: .8rem; font-family: var(--display); font-weight: 600; white-space: nowrap; }
.cdc.ok { background: var(--ok-soft); color: #2c5c3e; }
.cdc.miss { background: #fde2e2; color: #9b1c1c; }
.cdc.none { background: #e8ebf3; color: #5b6478; }
.cdc.na { color: #a0a8bd; }
#cdCoDlg h4 { margin: 8px 0 0; }
#ccTable td ul { margin: 0; padding-left: 18px; }
#ccTable td li { overflow-wrap: anywhere; }
.chkcell { display: inline-flex; align-items: center; gap: 4px; font-weight: 400; }
.chkcell input { width: auto; margin: 0; }

/* ── ติดตามงานบัญชี (spec §20) ── */
.wkc { display: inline-flex; align-items: center; gap: 4px; min-width: 84px; justify-content: center; border-radius: 8px; padding: 2px 8px; font-size: .8rem; font-family: var(--display); font-weight: 600; white-space: nowrap; border: 1px solid var(--line); background: #fff; color: var(--muted); box-shadow: none; line-height: 1.6; }
button.wkc { cursor: pointer; }
button.wkc:hover { filter: brightness(.96); outline: 2px solid var(--accent-soft); }
.wkc.todo { background: #fff; color: var(--muted); }
.wkc.doing { background: #dbe7ff; color: #1f4fa8; border-color: transparent; }
.wkc.done { background: var(--ok-soft); color: #2c5c3e; border-color: transparent; }
.wkc.near { background: var(--warn-soft); color: #7a4b00; border-color: transparent; }
.wkc.late { background: #fde2e2; color: #9b1c1c; border-color: transparent; }
.wkc.none { background: #e8ebf3; color: #6b7389; border-color: transparent; font-weight: 400; }
.wksys { display: inline-block; font-size: .68rem; padding: 0 5px; border-radius: 5px; background: var(--blue); color: #fff; font-weight: 600; margin-left: 4px; vertical-align: 1px; }
.wklegend { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.wklegend .wkc { min-width: 0; padding: 0 8px; }
.wktable th.wkh { white-space: nowrap; }
.wktable th.wkh small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.wktable td.wk { white-space: nowrap; }
.wktable td.wk small.wkdue { display: block; font-size: .72rem; }
.wktable td.co { cursor: pointer; min-width: 220px; }
.wktable td.co:hover b { color: var(--accent); text-decoration: underline; }
.wktable small.bad { color: var(--bad); font-weight: 600; }
.wksteps { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.wksteps li { display: grid; grid-template-columns: 16px auto 1fr; gap: 8px; align-items: center; color: var(--muted); }
.wksteps li small { text-align: right; }
.wksteps li .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--line); }
.wksteps li.on { color: var(--ink); }
.wksteps li.on .dot { background: var(--ok); }
.wkfye { display: flex; gap: 8px; }
.wkfye select:first-child { flex: 0 0 76px; }
.wkfye select:last-child { flex: 1 1 auto; min-width: 136px; }
.wknoacct { grid-column: 1 / -1; margin-bottom: 4px; }
.wknomonth { display: inline-flex; font-family: inherit; font-weight: 600; color: var(--accent); }
#wkCoDlg { width: min(880px, calc(100vw - 32px)); }
.wkpicks { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 12px; }
.wkpicks .wkpickhead { grid-column: 1 / -1; margin-top: 6px; font-family: var(--display); }
.wkpicks label.chk, #wkTaskDlg label.chk { display: flex; align-items: flex-start; gap: 8px; padding: 3px 0; font-weight: 400; cursor: pointer; text-align: left; color: var(--ink); }
.wkpicks label.chk input, #wkTaskDlg label.chk input { width: auto; flex: none; margin: 4px 0 0; }
[data-panel="info"] label.chk { display: flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; align-self: end; padding-bottom: 10px; }
[data-panel="info"] label.chk input { width: auto; flex: none; margin: 0; }
.wkdue { display: grid; gap: 4px; }
.wkrow { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.wkrow select { margin-top: 2px; }
/* ปฏิทินกลาง + CPD (spec §21) */
.wkcal { table-layout: fixed; min-width: 760px; }
.wkcal th { text-align: center; }
.wkcal td { vertical-align: top; height: 92px; padding: 4px; border: 1px solid var(--line); }
.wkcal td.off { background: #f5f6fa; }
.wkcal td.hol { background: #fdeeee; }
.wkcal td.today { outline: 2px solid var(--accent); outline-offset: -2px; }
.wkcal .dn { font-family: var(--display); font-weight: 700; font-size: .85rem; color: var(--muted); }
.wkcal .hn, .wkhol { display: block; font-size: .72rem; color: #9b1c1c; line-height: 1.3; }
.wkhol { display: inline; background: #fdeeee; border-radius: 6px; padding: 0 6px; }
.wkcal .ev { display: block; font-size: .72rem; color: #5b3fa0; line-height: 1.3; }
.wkcal button.wkc { display: flex; width: 100%; min-width: 0; margin-top: 3px; font-size: .72rem; padding: 1px 4px; white-space: normal; text-align: left; justify-content: space-between; }
.wkcal button.wkc.sel { outline: 2px solid var(--accent); }
.wkwhy { background: #f3f5fb; border-radius: 8px; padding: 6px 10px; }
#caHolYear { width: auto; min-width: 110px; }

/* ── ติดตามงานสอบบัญชี (spec §23) ── */
.austages { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.austages button { font-family: var(--display); font-weight: 600; font-size: .85rem; padding: 4px 12px; }
.austages button b { margin-left: 6px; font-variant-numeric: tabular-nums; }
.austages button.on { border-color: var(--accent); color: var(--accent); }
.wktable td.wk .wkc.au { min-width: 64px; }
.autag { display: inline-block; font-size: .72rem; padding: 0 7px; border-radius: 999px; background: var(--warn-soft); color: #7a4b00; margin-left: 4px; font-weight: 600; }
.autag.cancel { background: #e8ebf3; color: #6b7389; }
.autag.empty { background: #dbe7ff; color: #1f4fa8; }
dialog.audlg { width: min(980px, 96vw); }
.audlg h4 { margin: 14px 0 6px; font-family: var(--display); }
.ad2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.ad2 > div { min-width: 0; }
.adadd { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 6px 0 8px; }
.adadd input { flex: 1 1 200px; min-width: 0; }
#adStepTable td small { display: block; color: var(--muted); font-size: .74rem; }
#adStepTable input[type=date] { max-width: 160px; }
#adFinTable input { max-width: 170px; text-align: right; }
#auTable td.co { min-width: 240px; }
#auTable td:last-child .wkc { white-space: nowrap; }
