/* TopStock by Topcooling – สไตล์หลัก (ไม่พึ่งไลบรารี/ฟอนต์ออนไลน์)
   ธีม: เปลี่ยนค่าสีที่ตัวแปร --* ด้านล่าง; มืด = html[data-theme="dark"] */

:root{
  /* ===== แบรนด์ TopStock by Topcooling — เปลี่ยนไฟล์โลโก้ที่ "ที่เดียว" นี้ =====
     (favicon อ้างใน index.html อีก 1 จุด) ห้ามวาดใหม่/เปลี่ยนสีโลโก้ ใช้ไฟล์ที่อนุมัติเท่านั้น */
  --logo-mark:url("/_assets/de5fd09dd4f05778a2bb/brand/topcooling-mark-source-crop.png");      /* ไอคอนหกเหลี่ยม (วางบนแผ่นขาวเสมอ) */
  --logo-h:url("/_assets/44e8ca89520093fd3afc/brand/tc-logo-h.png");                           /* แนวนอน ตัวอักษรกรมท่า — ธีมสว่าง */
  --logo-h-white:url("/_assets/e2de6b37d923e8871576/brand/tc-logo-h-white.png");               /* แนวนอน ตัวอักษรขาว — ธีมมืด */

  --font: "Noto Sans Thai","Sarabun","Leelawadee UI","Thonburi","Tahoma",system-ui,-apple-system,"Segoe UI",sans-serif;
  --mono: ui-monospace,"SF Mono","Menlo","Consolas",monospace;

  /* สี CI: กรมท่า #0d2e4e · ขาว · ส้ม #e87424 (ใช้เฉพาะปุ่มหลัก/สถานะที่เลือก/จุดเน้น) */
  --navy:#0d2e4e; --accent:#e87424; --on-accent:#0d2e4e; --accent-h:#f08a3c;
  --side-bg:#0d2e4e; --side-text:#b9cadb; --side-hover:rgba(255,255,255,.09); --side-on:#ffffff;
  --bg:#f4f6f9; --surface:#ffffff; --surface-2:#eef2f6; --line:#dbe2ea; --line-strong:#b9c6d4;
  --text:#0d2e4e; --muted:#4a6078;           /* ตรวจ WCAG AA: text 13.8:1 · muted 6.5:1 */
  --primary:#0d2e4e; --primary-h:#123b63; --on-primary:#ffffff; --primary-soft:#e6edf4;
  --ok:#0b7a43;  --ok-bg:#e2f6ea;
  --warn:#8a5300; --warn-bg:#fff1d6;
  --danger:#b3261e; --danger-bg:#fde8e6;
  --info:#0d2e4e; --info-bg:#e6edf4;
  --shadow:0 1px 2px rgba(13,46,78,.07),0 4px 14px rgba(13,46,78,.07);
  --radius:12px; --radius-s:8px;
  --focus:0 0 0 3px rgba(232,116,36,.6);
  --side-w:232px; --tab-h:64px;
}
html[data-theme="dark"]{
  --side-bg:#0a2339; --side-text:#b9cadb; --side-hover:rgba(255,255,255,.08); --side-on:#ffffff;
  --bg:#071a2c; --surface:#0f2a44; --surface-2:#143555; --line:#254766; --line-strong:#3a5f82;
  --text:#e9f0f7; --muted:#a3b8cc;
  --primary:#a9cdf0; --primary-h:#c4ddf5; --on-primary:#0d2e4e; --primary-soft:#17395a;
  --ok:#5fd694;  --ok-bg:#12301f;
  --warn:#ffc15e; --warn-bg:#3a2a0b;
  --danger:#ff8f86; --danger-bg:#3d1714;
  --info:#a9cdf0; --info-bg:#17395a;
  --shadow:0 1px 2px rgba(0,0,0,.4),0 4px 14px rgba(0,0,0,.3);
  --focus:0 0 0 3px rgba(240,138,60,.7);
}

*{box-sizing:border-box}
[hidden]{display:none !important}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:16px;line-height:1.6;
  -webkit-font-smoothing:antialiased}
h1,h2,h3{line-height:1.35;margin:0;font-weight:700}
h1{font-size:1.5rem} h2{font-size:1.125rem} h3{font-size:1rem}
p{margin:0}
a{color:var(--primary)}
button,input,select,textarea{font:inherit;color:inherit}
.muted{color:var(--muted)} .small{font-size:.8125rem}
.num{font-variant-numeric:tabular-nums;text-align:right}
.mono{font-family:var(--mono);font-size:.9em}
.nowrap{white-space:nowrap}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.skip{position:absolute;left:8px;top:-60px;background:var(--primary);color:var(--on-primary);padding:8px 14px;border-radius:8px;z-index:100}
.skip:focus{top:8px}
:focus-visible{outline:none;box-shadow:var(--focus);border-radius:6px}
[tabindex="-1"]:focus,[tabindex="-1"]:focus-visible{box-shadow:none}
svg.ic{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:none}

/* ---------- โครง ---------- */
.shell{display:flex;min-height:100vh;min-height:100dvh}
.side{width:var(--side-w);flex:none;background:var(--side-bg);color:var(--side-text);border-right:1px solid rgba(255,255,255,.06);
  display:flex;flex-direction:column;padding:16px 12px;position:sticky;top:0;height:100vh;height:100dvh}
.main-col{flex:1;min-width:0;display:flex;flex-direction:column}
main{width:100%;max-width:1180px;margin:0 auto;padding:24px 28px 48px;outline:none}
.topbar{display:none}
.brand{display:flex;align-items:center;gap:10px;font-weight:700;font-size:1.125rem;text-decoration:none;color:var(--side-on);padding:6px 8px;margin-bottom:14px}
.brand-ic{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--primary);color:var(--on-primary)}
.brand-mark{display:grid;place-items:center;width:42px;height:42px;border-radius:11px;background:#fff;flex:none;box-shadow:0 1px 3px rgba(0,0,0,.25)}
.brand-mark i{display:block;width:26px;height:28px;background:var(--logo-mark) center/contain no-repeat}
.brand-t{display:flex;flex-direction:column;line-height:1.15} .brand-t b{font-size:1.25rem;letter-spacing:.2px} .brand-t small{font-size:.75rem;font-weight:500;color:var(--side-text)}
.logo-h{display:block;width:192px;height:38px;max-width:100%;background:var(--logo-h) left center/contain no-repeat} html[data-theme="dark"] .logo-h{background-image:var(--logo-h-white)}
.side-by{font-size:.75rem;color:var(--side-text);text-align:center;padding:4px 0 0;opacity:.85}
.nav{display:flex;flex-direction:column;gap:4px}
.nav a{display:flex;align-items:center;gap:12px;padding:11px 12px;border-radius:var(--radius-s);color:var(--side-text);text-decoration:none;font-weight:600;min-height:44px}
.nav a:hover{background:var(--side-hover);color:var(--side-on)}
.nav a[aria-current="page"]{background:rgba(255,255,255,.13);color:var(--side-on);box-shadow:inset 3px 0 0 var(--accent)}
.side-foot{margin-top:auto;display:flex;flex-direction:column;gap:10px}

/* ---------- ปุ่ม/ฟอร์ม ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:8px 16px;border-radius:var(--radius-s);
  border:1px solid var(--line-strong);background:var(--surface);cursor:pointer;font-weight:600;text-decoration:none;color:var(--text);white-space:nowrap}
.btn:hover{background:var(--surface-2)}
.btn:disabled{opacity:.5;cursor:not-allowed}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:700}
.btn.primary:hover{background:var(--accent-h);border-color:var(--accent-h)}
.btn.navy{background:var(--primary);border-color:var(--primary);color:var(--on-primary)}
.btn.danger{background:var(--danger);border-color:var(--danger);color:#fff}
html[data-theme="dark"] .btn.danger{color:#2b0603}
.btn.ghost{border-color:transparent;background:transparent}
.btn.ghost:hover{background:var(--surface-2)}
.btn.icon-only{padding:8px;min-width:44px}
.btn.block{width:100%;justify-content:flex-start}
.btn.lg{min-height:56px;font-size:1.125rem;padding:12px 22px}

.field{display:flex;flex-direction:column;gap:6px;font-weight:600;font-size:.9375rem;min-width:0}
.field .hint{font-weight:400;color:var(--muted);font-size:.8125rem}
input:not([type=radio]):not([type=checkbox]),select,textarea{width:100%;min-height:44px;padding:9px 12px;border:1px solid var(--line-strong);
  border-radius:var(--radius-s);background:var(--surface);font-weight:400}
input::placeholder{color:var(--muted);opacity:.8}
input:focus,select:focus,textarea:focus{outline:none;border-color:var(--primary);box-shadow:var(--focus)}
.input-row{display:flex;gap:8px}
.input-row>input{flex:1}
.grid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.err{color:var(--danger);font-weight:600;min-height:1.6em}
.err:empty{min-height:0}

/* ---------- การ์ด/หัวข้อ ---------- */
.page-head{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:18px}
.page-head h1:focus{outline:none}
.page-head .sub{color:var(--muted)}
.actions{display:flex;gap:8px;flex-wrap:wrap}
.box{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);box-shadow:var(--shadow);padding:18px}
.box+.box{margin-top:16px}
.box-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;flex-wrap:wrap}
.cols{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);gap:16px;align-items:start}
.cols .box+.box{margin-top:0}
.cols>*,.stack>*{min-width:0}
.stack{display:flex;flex-direction:column;gap:16px}
.stack>.box+.box{margin-top:0}

.kpis{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:14px;margin-bottom:16px}
.kpi{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:16px 18px;box-shadow:var(--shadow);display:block;text-decoration:none;color:inherit}
a.kpi:hover{border-color:var(--primary)}
.kpi .lbl{color:var(--muted);font-size:.875rem;font-weight:600;display:flex;align-items:center;gap:6px}
.kpi .val{font-size:1.75rem;font-weight:800;line-height:1.3;font-variant-numeric:tabular-nums;margin-top:2px}
.kpi.warn .val{color:var(--warn)} .kpi.danger .val{color:var(--danger)}

/* ---------- ป้าย/แท็ก ---------- */
.pill{display:inline-flex;align-items:center;gap:5px;padding:1px 10px;border-radius:99px;font-size:.8125rem;font-weight:700;white-space:nowrap}
.pill.ok{background:var(--ok-bg);color:var(--ok)}
.pill.warn{background:var(--warn-bg);color:var(--warn)}
.pill.danger{background:var(--danger-bg);color:var(--danger)}
.pill.info{background:var(--info-bg);color:var(--info)}
.pill .ic{width:14px;height:14px}
.pos{color:var(--ok);font-weight:700} .neg{color:var(--danger);font-weight:700}

/* ---------- ตาราง ---------- */
.tbl-wrap{overflow-x:auto;margin:0 -4px}
table{width:100%;border-collapse:collapse}
th,td{padding:10px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
th{font-size:.8125rem;color:var(--muted);font-weight:700;background:var(--surface-2);position:sticky;top:0;white-space:nowrap}
th.num,td.num{text-align:right}
tbody tr:hover{background:var(--surface-2)}
tr.row-link{cursor:pointer}
td a.name,.list a.name{color:var(--text);font-weight:600;text-decoration:none}
td a.name:hover,.list a.name:hover{text-decoration:underline;color:var(--primary)}
.empty{padding:28px 10px;text-align:center;color:var(--muted)}

.sku-m{display:none}

/* ---------- ค้นหา/ชิป ---------- */
.toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:14px}
.search{position:relative;flex:1;min-width:220px}
.search .ic{position:absolute;left:12px;top:50%;transform:translateY(-50%);color:var(--muted);pointer-events:none}
.search input{padding-left:40px !important}
.chips{display:flex;gap:6px;flex-wrap:wrap}
.chip{min-height:40px;padding:6px 14px;border-radius:99px;border:1px solid var(--line-strong);background:var(--surface);cursor:pointer;font-weight:600;color:var(--muted)}
.chip[aria-pressed="true"]{background:var(--primary-soft);border-color:var(--primary);color:var(--primary)}

/* ---------- แถบแท่ง ---------- */
.bars{display:flex;flex-direction:column;gap:10px;list-style:none;margin:0;padding:0}
.bar-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;font-size:.9375rem}
.bar-row .track{grid-column:1/-1;height:8px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.bar-row .fill{display:block;height:100%;background:var(--primary);border-radius:99px}
.list{list-style:none;margin:0;padding:0}
.list li{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.list li:last-child{border-bottom:0}
.list .t{min-width:0}.list .t b{display:block;overflow:hidden;text-overflow:ellipsis}

/* ---------- ฟอร์มรับ/จ่าย ---------- */
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;border:0;padding:0;margin:0 0 16px}
.seg legend{font-weight:600;margin-bottom:6px;padding:0}
.seg label{position:relative;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;min-height:64px;padding:8px;
  border:2px solid var(--line-strong);border-radius:var(--radius);background:var(--surface);cursor:pointer;font-weight:700;text-align:center}
.seg input{position:absolute;opacity:0;inset:0;cursor:pointer;min-height:0}
.seg label:has(input:checked){border-color:var(--primary);background:var(--primary-soft);color:var(--primary)}
.seg label:has(input:focus-visible){box-shadow:var(--focus)}
.seg.t-receipt label:has(input:checked){border-color:var(--ok);background:var(--ok-bg);color:var(--ok)}
.seg.t-issue label:has(input:checked){border-color:var(--danger);background:var(--danger-bg);color:var(--danger)}
.seg .ic{width:22px;height:22px}
.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.form-grid .full{grid-column:1/-1}
.suggest{position:relative}
.sug-list{position:absolute;z-index:20;left:0;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--line-strong);border-radius:var(--radius-s);
  box-shadow:var(--shadow);max-height:300px;overflow:auto;list-style:none;margin:0;padding:4px}
.sug-list li{padding:9px 12px;border-radius:6px;cursor:pointer;display:flex;justify-content:space-between;gap:10px}
.sug-list li[aria-selected="true"],.sug-list li:hover{background:var(--primary-soft)}
.picked{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:12px 14px;border-radius:var(--radius);
  background:var(--surface-2);border:1px dashed var(--line-strong);margin-top:10px}
.picked .big{font-size:1.5rem;font-weight:800;font-variant-numeric:tabular-nums;line-height:1.2}
.stepper{display:flex;gap:8px}
.stepper input{text-align:center;font-weight:700;font-size:1.25rem}
.stepper .btn{min-width:52px;font-size:1.25rem}
.preview{padding:10px 14px;border-radius:var(--radius-s);background:var(--info-bg);color:var(--info);font-weight:600}
.preview.bad{background:var(--danger-bg);color:var(--danger)}
.subtabs{display:flex;gap:6px;margin-bottom:10px}

/* ---------- นับสต็อค ---------- */
.count-input{font-size:2rem !important;font-weight:800;text-align:center;min-height:64px !important}
.counted{display:flex;flex-direction:column;gap:8px;list-style:none;margin:0;padding:0}
.counted li{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:10px;align-items:center;padding:10px 12px;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface)}
.counted .diff{min-width:64px;text-align:right;font-weight:800;font-variant-numeric:tabular-nums}
.switch{display:flex;align-items:center;gap:10px;font-weight:600;min-height:44px;cursor:pointer}
.switch input{width:22px;height:22px;accent-color:var(--primary)}

/* ---------- Dialog / Toast ---------- */
dialog{border:1px solid var(--line-strong);border-radius:16px;padding:0;background:var(--surface);color:var(--text);width:min(560px,calc(100vw - 24px));max-height:calc(100dvh - 24px);box-shadow:0 20px 60px rgba(0,0,0,.35)}
dialog::backdrop{background:rgba(8,12,22,.55)}
.dlg-body{padding:20px;display:flex;flex-direction:column;gap:14px}
.dlg-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.dlg-foot{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.scan-box{position:relative;background:#000;border-radius:var(--radius);overflow:hidden;aspect-ratio:4/3}
.scan-box video{width:100%;height:100%;object-fit:cover;display:block}
.scan-frame{position:absolute;inset:18% 10%;border:3px solid #fff;border-radius:14px;box-shadow:0 0 0 999px rgba(0,0,0,.35)}
.toasts{position:fixed;z-index:200;right:16px;bottom:16px;display:flex;flex-direction:column;gap:8px;max-width:min(420px,calc(100vw - 32px))}
.toast{padding:12px 16px;border-radius:var(--radius-s);background:var(--text);color:var(--bg);box-shadow:var(--shadow);font-weight:600;animation:in .18s ease-out}
.toast.ok{background:var(--ok);color:#fff} .toast.bad{background:var(--danger);color:#fff}
html[data-theme="dark"] .toast.ok{color:#04210f} html[data-theme="dark"] .toast.bad{color:#2b0603}
@keyframes in{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.loading{padding:40px;text-align:center;color:var(--muted)}
.back{display:inline-flex;align-items:center;gap:6px;text-decoration:none;font-weight:600;margin-bottom:8px;min-height:36px}

/* ---------- v2 (ช่องรอฟีเจอร์ใหม่) ---------- */
[data-v2]{display:none}
body.v2-on [data-v2]{display:flex}

/* ---------- แท็บเล็ต/มือถือ ---------- */
.tabbar{display:none}
@media (max-width:1000px){ .cols{grid-template-columns:1fr} }

@media (max-width:820px){
  .shell{display:block}
  .side{display:none}
  .tabbar{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:50;background:var(--surface);border-top:1px solid var(--line);padding:6px 6px calc(6px + env(safe-area-inset-bottom));gap:2px}
  .tabbar a,.tabbar button{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:6px 2px;min-height:52px;border-radius:10px;border:0;background:transparent;
    color:var(--muted);font-size:.75rem;font-weight:600;text-decoration:none;cursor:pointer}
  .tabbar a[aria-current="page"]{background:var(--primary-soft);color:var(--primary)}
  .topbar{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;background:var(--surface);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:40}
  .topbar .brand{margin:0}
  main{padding:16px 14px calc(var(--tab-h) + 28px + env(safe-area-inset-bottom))}
  h1{font-size:1.3125rem}
  .toasts{left:12px;right:12px;bottom:calc(var(--tab-h) + 14px + env(safe-area-inset-bottom));max-width:none}
  .grid2,.form-grid{grid-template-columns:1fr}
  .kpis{grid-template-columns:repeat(2,1fr)}
  .kpi .val{font-size:1.5rem}
  .box{padding:14px}

  /* ตารางสินค้า → การ์ดบนมือถือ */
  table.rt thead{display:none}
  table.rt,table.rt tbody,table.rt tr,table.rt td{display:block;width:100%}
  table.rt tr{display:grid;grid-template-columns:1fr auto;gap:2px 10px;padding:12px 4px;border-bottom:1px solid var(--line)}
  table.rt td{border:0;padding:0;text-align:left}
  table.rt td.num{text-align:right}
  table.rt td[data-label]::before{content:attr(data-label) " ";color:var(--muted);font-size:.8125rem}
  .sku-m{display:block}
  table.rt td.c-main{grid-column:1;grid-row:1;font-weight:600}
  table.rt td.c-side{grid-column:2;grid-row:1}
  table.rt td.c-wide{grid-column:1/-1}
  table.rt td.c-hide{display:none}
}
@media (max-width:420px){ .seg label{min-height:72px;font-size:.9375rem} }
@media (prefers-reduced-motion:reduce){ *{animation:none !important;transition:none !important} }
@media print{ .side,.topbar,.toasts,.actions,.toolbar{display:none !important} main{padding:0} body{background:#fff} }

/* ================= v2 เพิ่มเติม ================= */
.pre{white-space:pre-line}
.stack-s{display:flex;flex-direction:column;gap:14px}
hr{border:0;border-top:1px solid var(--line);margin:12px 0}
.notice{padding:10px 14px;border-radius:var(--radius-s);background:var(--info-bg);color:var(--info);font-weight:600}
.notice.ok{background:var(--ok-bg);color:var(--ok)} .notice.bad{background:var(--danger-bg);color:var(--danger)}
.auth{min-height:100vh;min-height:100dvh;display:grid;place-items:center;padding:20px;background:var(--bg)}
.auth[hidden]{display:none}
.auth-card{width:min(440px,100%);background:var(--surface);border:1px solid var(--line);border-radius:16px;box-shadow:var(--shadow);padding:26px;display:flex;flex-direction:column;gap:14px}
.auth-brand{display:flex;align-items:center;gap:12px} .auth-brand h1{font-size:1.4rem}
.auth-foot{display:flex;justify-content:flex-end;margin-top:4px}
details summary{cursor:pointer;font-weight:600;min-height:36px;display:flex;align-items:center}
.whoami{display:flex;align-items:center;gap:10px;padding:8px 10px}
.who-ic{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;background:var(--primary-soft);color:var(--primary);flex:none}
.who-t{display:flex;flex-direction:column;line-height:1.3;min-width:0} .who-t b{overflow:hidden;text-overflow:ellipsis}
.menu-list{display:flex;flex-direction:column;gap:4px}
.menu-list a{display:flex;align-items:center;gap:12px;padding:12px;border-radius:var(--radius-s);color:var(--text);text-decoration:none;font-weight:600;min-height:48px}
.menu-list a:hover{background:var(--surface-2)}
dialog.dlg{width:min(560px,calc(100vw - 20px))} dialog.dlg.wide{width:min(900px,calc(100vw - 20px))}
.dlg-content{display:flex;flex-direction:column;gap:12px;overflow:auto;max-height:calc(100dvh - 220px)}
dialog .grid2 .full,dialog .form-grid .full{grid-column:1/-1}
.field.inline{flex-direction:row;align-items:center;gap:8px;font-weight:600;font-size:.875rem;white-space:nowrap}
.field.inline input,.field.inline select{width:auto;min-width:130px}
select.auto{width:auto;min-width:150px}
fieldset.field{border:0;padding:0;margin:0} fieldset.field legend{padding:0;margin-bottom:6px;font-weight:600}
.pager{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:12px}
table.plain th,table.plain td{white-space:nowrap}
table.plain td:first-child{white-space:normal;min-width:150px}
tr.sub td{color:var(--muted);font-size:.8125rem;background:var(--surface-2)}
tr.stale{background:var(--danger-bg)}
.clip{display:inline-block;max-width:340px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;vertical-align:bottom}
.sel li{cursor:pointer;padding-left:8px;padding-right:8px;border-radius:var(--radius-s)}
.sel li:hover{background:var(--surface-2)} .sel li.on{background:var(--primary-soft)}
.progress-wrap{display:flex;align-items:center;gap:12px;margin-bottom:12px}
.progress{flex:1;height:10px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.progress span{display:block;height:100%;width:0;background:var(--ok);border-radius:99px;transition:width .2s}
.counted .cl{grid-template-columns:minmax(0,1fr) auto}
.cl.done{border-color:var(--ok)}
.cl-in{display:flex;align-items:center;gap:8px}
.cl-in input{width:120px;text-align:center;font-size:1.25rem;font-weight:700;min-height:52px}
.cl-ok{width:22px;color:var(--ok);display:inline-grid;place-items:center}
@media (max-width:820px){
  .field.inline{flex-direction:column;align-items:stretch;white-space:normal} .field.inline input,.field.inline select{width:100%}
  .toolbar .field.inline{flex:1;min-width:140px} select.auto{width:100%}
  .cl-in input{width:104px}
  .clip{max-width:100%}
  .pager{flex-direction:column;align-items:stretch}
}

/* ================= V3: แผนผังคลัง / กราฟ / ตัวช่วย / ห้องเย็น / ล็อกฟีเจอร์ ================= */
:root{
  --hm-n:#e3e8f1; --hm-a:#9be0b4; --hm-b:#cfe9a4; --hm-c:#ffd77a; --hm-d:#ffb069; --hm-e:#f2766b;
  --c1:#0d2e4e; --c2:#16a34a; --c3:#f59e0b; --c4:#dc2626; --c5:#7c3aed; --c6:#0d9488;
  --cold:#0ea5e9;
}
html[data-theme="dark"]{
  --hm-n:#27324b; --hm-a:#2e8a58; --hm-b:#5a8a2e; --hm-c:#b08a1d; --hm-d:#bf6628; --hm-e:#c2413a;
  --c1:#7db4e8; --c2:#4ade80; --c3:#fbbf24; --c4:#ff8f86; --c5:#b794ff; --c6:#2dd4bf; --cold:#38bdf8;
}
.minus{display:block;width:14px;height:2.5px;border-radius:2px;background:currentColor}
.sw{display:inline-block;width:14px;height:14px;border-radius:4px;margin-right:6px;vertical-align:-2px;border:1px solid var(--line-strong)}
.sw.hm-n{background:var(--hm-n)}.sw.hm-a{background:var(--hm-a)}.sw.hm-b{background:var(--hm-b)}.sw.hm-c{background:var(--hm-c)}.sw.hm-d{background:var(--hm-d)}.sw.hm-e{background:var(--hm-e)}
.legend.inline{display:flex;gap:6px 16px;flex-wrap:wrap;list-style:none;margin:12px 0 0;padding:0;font-size:.8125rem;color:var(--muted)}
.legend li{display:flex;align-items:center}

/* ---- แผนผัง ---- */
.map-toolbar{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin-bottom:12px}
.map-split{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:14px;align-items:start}
.map-root{min-width:0}
.map-side{border:1px solid var(--line);border-radius:var(--radius);padding:14px;max-height:620px;overflow:auto;background:var(--surface)}
.map-side h3{margin-bottom:6px} .map-side h4{margin:14px 0 4px;font-size:.9375rem}
.side-head{display:flex;gap:10px;align-items:center;margin-bottom:10px} .side-head>div{flex:1;min-width:0}
.side-head .ti{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:var(--primary-soft);color:var(--primary);flex:none}
.meter{height:10px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden;margin:6px 0}
.meter span{display:block;height:100%;background:linear-gradient(90deg,var(--c2),var(--c3));border-radius:99px}
.hint-box{display:flex;gap:10px;padding:12px;border-radius:var(--radius-s);background:var(--surface-2);margin-top:12px;color:var(--muted)}
.list.rows li{align-items:flex-start;cursor:grab} .list.rows li.dragging{opacity:.4}
.list li.clickable{cursor:pointer;border-radius:8px;padding-left:6px;padding-right:6px} .list li.clickable:hover{background:var(--surface-2)}
.list .t span{display:block;font-size:.8125rem}
.floor-wrap{position:relative;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2);overflow:hidden}
.floor{display:block;width:100%;height:clamp(320px,56vh,600px);touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;background:var(--surface-2)}
.floor:active{cursor:grabbing}
.floor-ctl{position:absolute;right:10px;top:10px;display:flex;flex-direction:column;gap:6px}
.floor-ctl .btn{min-height:40px;min-width:40px;background:var(--surface);box-shadow:var(--shadow)}
.floor .gridbg{fill:var(--surface);stroke:var(--line);stroke-width:.06}
.floor .gridline{fill:none;stroke:var(--line);stroke-width:.04}
.mi{cursor:pointer}
.mi .base{fill:var(--surface);stroke:var(--line-strong);stroke-width:.07}
.mi-zone .base{fill:var(--primary);fill-opacity:.06;stroke:var(--primary);stroke-opacity:.45;stroke-dasharray:.35 .25}
.mi-cold .base{fill:var(--cold);fill-opacity:.13;stroke:var(--cold);stroke-opacity:.8;stroke-dasharray:.35 .25;stroke-width:.1}
.mi-door .base{fill:var(--c3);fill-opacity:.35;stroke:var(--c3)} .mi-door .arrow{fill:none;stroke:var(--text);stroke-width:.14;stroke-linecap:round;stroke-linejoin:round}
.mi-label .ghost{fill:none;stroke:none}
.mi .cellseg.hm-n{fill:var(--hm-n)}.mi .cellseg.hm-a{fill:var(--hm-a)}.mi .cellseg.hm-b{fill:var(--hm-b)}.mi .cellseg.hm-c{fill:var(--hm-c)}.mi .cellseg.hm-d{fill:var(--hm-d)}.mi .cellseg.hm-e{fill:var(--hm-e)}
.floor.prev .seg{fill:var(--primary-soft);stroke:var(--primary);stroke-opacity:.35;stroke-width:.06}
.mi text{pointer-events:none;fill:var(--text);paint-order:stroke;stroke:var(--surface);stroke-width:.14px;stroke-linejoin:round}
.mi .zl{font-size:1.05px;font-weight:700} .mi .zs{font-size:.8px;fill:var(--muted)} .mi .bl{font-size:.85px;font-weight:700} .mi .bt{font-size:.72px;font-weight:600}
.mi .rl{font-size:.9px;font-weight:700} .mi .rs{font-size:.7px;fill:var(--muted)} .mi .ml{font-size:1px;font-weight:600;fill:var(--muted)}
.mi:hover .base{stroke:var(--primary);stroke-width:.14}
.mi.sel .base{stroke:var(--primary);stroke-width:.24;stroke-dasharray:none;filter:drop-shadow(0 0 .35px var(--primary))}
.mi.hl .base{stroke:#e11d48;stroke-width:.3;stroke-dasharray:none;animation:hl 1.1s ease-in-out infinite alternate}
@keyframes hl{from{stroke-opacity:1}to{stroke-opacity:.25}}
.mi.dim{opacity:.22}
.mi.drop .base{stroke:var(--ok);stroke-width:.35}
.tbadge rect{fill:var(--ok)} .tbadge.warn rect{fill:var(--c3)} .tbadge.alarm rect,.tbadge.offline rect{fill:var(--c4)} .tbadge text.tt{font-size:.85px;font-weight:700;fill:#fff;stroke:none}
.hnd{fill:var(--primary);stroke:#fff;stroke-width:.1;cursor:nwse-resize}
.move-banner{display:flex;gap:10px;align-items:center;flex-wrap:wrap;background:var(--warn-bg);color:var(--warn)}

/* ---- ตัวช่วยเริ่มต้น / ล็อก / ห้องเย็น ---- */
.onb{border-color:var(--primary);background:linear-gradient(180deg,var(--primary-soft),var(--surface) 60%)}
.onb-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:12px}
.onb-list li{display:flex;gap:12px;align-items:flex-start;padding:12px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--line)}
.onb-list li.done{opacity:.7}
.onb .n{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--primary);color:var(--on-primary);font-weight:800}
.onb li.done .n{background:var(--ok);color:#fff}
.box.locked{display:flex;gap:16px;align-items:flex-start;background:repeating-linear-gradient(135deg,var(--surface),var(--surface) 10px,var(--surface-2) 10px,var(--surface-2) 20px);border-style:dashed}
.lock-ic{display:grid;place-items:center;width:46px;height:46px;border-radius:12px;background:var(--warn-bg);color:var(--warn);flex:none}
.box.soft{background:var(--surface-2);box-shadow:none}
.cold-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:12px;margin-top:10px}
.cold-card{border:1px solid var(--line);border-radius:var(--radius);padding:14px;background:var(--surface-2);display:flex;flex-direction:column;gap:4px}
.cold-card.alarm,.cold-card.offline{border-color:var(--danger);background:var(--danger-bg)} .cold-card.warn{border-color:var(--warn)}
.cold-head{display:flex;justify-content:space-between;align-items:center;gap:8px}
.cold-temp{font-size:2.4rem;font-weight:800;line-height:1.1;font-variant-numeric:tabular-nums} .cold-temp span{font-size:1.1rem;font-weight:600;color:var(--muted);margin-left:2px}
.spark{width:100%;height:44px;display:block} .spark path{fill:none;stroke:var(--cold);stroke-width:1.6;vector-effect:non-scaling-stroke} .spark.alarm path{stroke:var(--danger)} .spark.warn path{stroke:var(--c3)}
.ch-band{fill:var(--ok);opacity:.14}
.cold-mini{padding:10px;border-radius:var(--radius-s);background:var(--surface-2);margin:8px 0;display:flex;flex-direction:column;gap:2px} .cold-mini b{font-size:1.4rem}
.empty-state{text-align:center;padding:36px 16px;display:flex;flex-direction:column;align-items:center;gap:8px} .empty-state svg.ic{width:42px;height:42px;color:var(--muted)}
.drag-tip{position:absolute;right:10px;bottom:8px;font-size:.75rem;color:var(--muted);background:var(--surface);padding:2px 8px;border-radius:99px;border:1px solid var(--line)}

/* ---- ตัวช่วยตั้งผัง ---- */
dialog.wizard{width:min(1040px,calc(100vw - 20px))}
.steps{display:flex;gap:6px;list-style:none;margin:0 0 6px;padding:0;flex-wrap:wrap}
.steps li{display:flex;align-items:center;gap:8px;padding:6px 12px 6px 6px;border-radius:99px;background:var(--surface-2);color:var(--muted);font-weight:600;font-size:.875rem}
.steps li .n{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:var(--line-strong);color:var(--text);font-size:.8125rem;font-weight:800}
.steps li.on{background:var(--primary-soft);color:var(--primary)} .steps li.on .n{background:var(--primary);color:var(--on-primary)}
.steps li.done .n{background:var(--ok);color:#fff} .steps svg{width:14px;height:14px}
.wz-h{font-size:1.25rem;margin-top:4px}
.tpl-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));gap:12px;margin:12px 0}
.tpl{position:relative;display:flex;flex-direction:column;gap:6px;padding:10px;border:2px solid var(--line);border-radius:var(--radius);cursor:pointer;background:var(--surface)}
.tpl:hover{border-color:var(--primary)} .tpl.on{border-color:var(--primary);background:var(--primary-soft)}
.tpl input{position:absolute;opacity:0;inset:0;cursor:pointer;min-height:0;width:100%}
.tpl:has(input:focus-visible){box-shadow:var(--focus)}
.tpl-img{height:130px;border-radius:var(--radius-s);background:var(--surface-2);overflow:hidden;display:grid;place-items:center}
.tpl-img .floor,.wz-prev .floor{height:100%;width:100%;cursor:default;background:transparent}
.gloss{margin:6px 0} .gloss summary{gap:8px} .gloss dl{display:grid;grid-template-columns:auto 1fr;gap:6px 14px;margin:8px 0}
.gloss dt{display:flex;gap:6px;align-items:center;font-weight:700} .gloss dd{margin:0;color:var(--muted)}
.wz-split{display:grid;grid-template-columns:minmax(0,380px) minmax(0,1fr);gap:18px;margin:10px 0}
.wz-ctl{display:flex;flex-direction:column;gap:14px}
.wz-prev{position:relative;min-height:300px;height:340px;border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2);overflow:hidden}
.stepper-row{display:flex;flex-direction:column;gap:6px}
.stepper-row label{display:flex;flex-direction:column}
.stepper-row .stepper input{width:90px;flex:none;text-align:center;font-weight:800;font-size:1.25rem}
.range{padding:0 !important;min-height:28px !important;accent-color:var(--primary);border:0 !important;background:transparent !important}
.wz-hnd rect{fill:var(--primary);stroke:#fff;stroke-width:.15;cursor:nwse-resize}
.wz-nav{margin-top:8px;border-top:1px solid var(--line);padding-top:12px}
.checks{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px} .checks li{display:flex;gap:8px;align-items:flex-start}
.checks svg{flex:none;color:var(--ok);margin-top:3px}

/* ---- กราฟ ---- */
.chart{width:100%;height:auto;display:block}
.ch-g{stroke:var(--line);stroke-width:1} .ch-t{fill:var(--muted);font-size:11px} .ch-t.lbl{fill:var(--text);font-size:12px} .ch-t.val{fill:var(--text);font-weight:700}
.ch-line{fill:none;stroke-width:2.2;stroke-linejoin:round;stroke-linecap:round} .ch-line.dashed{stroke-dasharray:5 4}
.ch-area{opacity:.16} .ch-hit{fill:transparent;cursor:pointer} .ch-hit:hover{fill:rgba(128,128,128,.12)}
.ch-bar,.ch-seg{cursor:pointer} .ch-bar:hover,.ch-seg:hover{opacity:.82}
.ch-ct{fill:var(--text);font-size:20px;font-weight:800} .ch-empty{stroke:var(--line)} .ch-ref{stroke:var(--muted);stroke-dasharray:4 4;stroke-width:1}
.donut{display:flex;gap:16px;align-items:center;flex-wrap:wrap} .donut-svg{width:180px;flex:none}
.legend{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;flex:1;min-width:160px}
.legend li{display:flex;align-items:center;gap:6px;cursor:default} .legend li b{margin-left:auto}
.legend:not(.inline) .sw{margin:0}
.chart-card .box-head .actions .btn{min-height:36px;padding:4px 10px}
.range-chips{margin-bottom:14px}

@media (max-width:1000px){ .map-split{grid-template-columns:1fr} .map-side{max-height:none} .wz-split{grid-template-columns:1fr} .wz-prev{height:260px} }
@media (max-width:820px){ .floor{height:clamp(280px,48vh,460px)} .box.locked{flex-direction:column} .tpl-grid{grid-template-columns:repeat(2,1fr)} .tpl-img{height:100px} }
@media (pointer:coarse){ .drag-tip{display:none} }
@media print{ .map-toolbar,.map-side,.floor-ctl{display:none !important} }

.cold-card .btn{align-self:flex-start}

.legend.inline{flex-direction:row;align-items:center}

.wz-nav{position:sticky;bottom:-1px;background:var(--surface);z-index:2;padding-bottom:4px}
dialog.wizard .dlg-content{max-height:calc(100dvh - 150px)}
@media (max-width:820px){ dialog.wizard{width:calc(100vw - 12px);max-height:calc(100dvh - 12px)} .tpl{padding:8px} .tpl b{font-size:.9375rem} }

@media (max-width:1000px){ .wz-split .wz-prev{order:-1;height:210px;min-height:0;position:sticky;top:0;z-index:3;background:var(--surface-2);box-shadow:var(--shadow)} .wz-prev .drag-tip{display:none} }

/* ---- TopStock: ปรับให้เข้า CI ---- */
.side .btn.ghost{color:var(--side-text)} .side .btn.ghost:hover{background:var(--side-hover);color:var(--side-on)}
.side .muted{color:var(--side-text)}
.whoami{color:var(--side-on)} .whoami .who-ic{background:rgba(255,255,255,.14);color:#fff}
.chip[aria-pressed="true"]{background:var(--primary-soft);border-color:var(--accent);color:var(--primary);box-shadow:inset 0 -2px 0 var(--accent)}
.seg label:has(input:checked){border-color:var(--accent);background:var(--primary-soft);color:var(--primary)}
.btn:focus-visible,.chip:focus-visible{outline:2px solid var(--accent);outline-offset:1px}
.skip{background:var(--accent);color:var(--on-accent)}
.kpi:hover{border-color:var(--accent)} a.kpi:hover{border-color:var(--accent)}
.steps li.on{background:var(--primary-soft);color:var(--primary);box-shadow:inset 0 -2px 0 var(--accent)}
.steps li.on .n{background:var(--accent);color:var(--on-accent)}
.tpl.on{border-color:var(--accent)} .tpl:hover{border-color:var(--accent)}
.onb{border-color:var(--accent);background:linear-gradient(180deg,var(--primary-soft),var(--surface) 60%)}
.onb .n{background:var(--accent);color:var(--on-accent)}
.progress span,.meter span{background:linear-gradient(90deg,var(--c2),var(--c3))}
.auth{background:linear-gradient(180deg,var(--side-bg) 0,var(--side-bg) 38vh,var(--bg) 38vh)}
.auth-card{box-shadow:0 10px 40px rgba(0,0,0,.25)}
.auth-title{display:flex;flex-direction:column;gap:2px}
.auth-title h1{font-size:1.6rem;color:var(--text)} .auth-title small{color:var(--muted);font-weight:600}
.auth-plate{background:#fff;border-radius:12px;padding:10px 14px;display:flex;align-items:center;gap:12px}
@media (max-width:820px){
  .topbar{background:var(--side-bg);border-bottom:1px solid rgba(255,255,255,.08)}
  .topbar .brand{color:var(--side-on)} .topbar .btn.ghost{color:var(--side-text)}
  .tabbar a[aria-current="page"]{background:var(--primary-soft);color:var(--primary);box-shadow:inset 0 3px 0 var(--accent)}
}
.side .brand-t small{display:none}
.auth-plate{background:transparent;padding:0}
.tpl:hover{border-color:var(--primary)} .tpl:has(input:focus-visible){border-color:var(--primary)} .tpl.on:hover,.tpl.on{border-color:var(--accent)}

.plan-name{font-size:2rem;font-weight:800;color:var(--text);margin-bottom:8px}
.quota{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px} .qt{display:flex;justify-content:space-between;gap:10px}
table.plans th.cur,table.plans td.cur{background:var(--primary-soft)} table.plans td{text-align:center} table.plans td:first-child{text-align:left} table.plans th{text-align:center;vertical-align:top} table.plans th:first-child{text-align:left}
.notice ul{margin:4px 0 0;padding-left:20px} .notice.warn{background:var(--warn-bg);color:var(--warn)}
details.box summary{font-weight:700}

/* ===== โหมดแก้ไขผัง ===== */
.edit-bar{position:sticky;top:0;z-index:5;background:var(--surface);border:2px solid var(--primary);border-radius:var(--radius);padding:10px 12px;margin:10px 0;display:grid;gap:8px;box-shadow:var(--shadow)}
.edit-bar .eb-row{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.edit-bar .eb-sp{flex:1}
.edit-bar .eb-title{display:flex;gap:6px;align-items:center;color:var(--navy,var(--text))}
.edit-bar .btn[disabled]{opacity:.45;cursor:not-allowed}
.floor .gridline{stroke:var(--line);stroke-width:.04;fill:none}
.floor [data-id].editing-sel>rect:first-child{stroke:var(--primary);stroke-width:.2}
@media (max-width:820px){.edit-bar{position:static}}
[hidden]{display:none!important}

/* ===== หน้ากราฟวิเคราะห์ ===== */
.an-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,460px),1fr));gap:16px;align-items:start}
.an-grid .chart-card{margin:0}
.an-grid .chart-body{min-height:120px}
.kpi-row{display:flex;gap:20px;flex-wrap:wrap;margin:4px 0 10px}
.kpi-row>div{display:grid}.kpi-row b{font-size:1.25rem}.kpi-row .neg{color:var(--danger)}
.seg{display:inline-flex;gap:4px}
.chip.sm{min-height:32px;padding:2px 10px;font-size:.85rem}
.abc-sum{display:flex;gap:14px;flex-wrap:wrap;list-style:none;padding:0;margin:0 0 8px}
.abc-sum li{display:flex;gap:6px;align-items:center}
.cls{display:inline-grid;place-items:center;width:24px;height:24px;border-radius:6px;font-weight:700;color:#0d2e4e}
.cls-A{background:var(--c1);color:#fff}.cls-B{background:var(--c3)}.cls-C{background:var(--c4)}
table.mini{width:100%;border-collapse:collapse;margin-top:8px;font-size:.92rem}
table.mini th,table.mini td{padding:6px 8px;border-bottom:1px solid var(--line);text-align:left}
table.mini .num,table.mini th.num{text-align:right;font-variant-numeric:tabular-nums}
.chart-body .ch-bar,.chart-body .ch-seg,.chart-body .ch-row{cursor:pointer}
.temp-row+.temp-row{margin-top:10px}

/* ===== devices/labels (fork) ===== */
.dev-group h2{display:flex;align-items:center;gap:8px;margin-bottom:10px}
.dev-list{list-style:none;margin:0;padding:0}
.dev-row{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr) auto;gap:8px 16px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}
.dev-row:first-child{border-top:0}
.dev-name{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.dev-stat{display:grid;gap:2px;justify-items:start}
.dev-act{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.dev-res{grid-column:1/-1;margin:0;padding:8px 10px;border-radius:var(--radius-s);background:var(--surface-2)}
.dev-res.ok{background:var(--ok-bg);color:var(--ok)} .dev-res.bad{background:var(--danger-bg);color:var(--danger);white-space:pre-line}
.dev-quota{margin-bottom:12px}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
.seg-tabs{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px}
.lbl-sub{margin-top:8px} .lbl-scroll{max-height:320px;overflow:auto}
.lbl-how{margin-top:16px;border-top:1px solid var(--line);padding-top:12px;display:grid;gap:14px}
.lbl-opt{padding:12px;border:1px solid var(--line);border-radius:var(--radius-s);display:grid;gap:10px;align-content:start}
.lbl-opt h4{margin:0;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.lbl-frame{width:100%;height:62vh;border:1px solid var(--line);border-radius:var(--radius-s);background:#e9e9e9}
.ok-msg{color:var(--ok);font-weight:700;margin:0}
.sc-box{display:grid;gap:10px;padding:14px;border:1px solid var(--line);border-radius:var(--radius-s);background:var(--surface-2);margin:10px 0}
.sc-w{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;min-height:56px}
.sc-num{font:700 2.6rem/1 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-variant-numeric:tabular-nums}
.sc-unit{font-size:1.2rem;color:var(--muted)}
.sc-btns{display:flex;gap:8px;flex-wrap:wrap}
.sc-res{padding:10px 0}.sc-qty{font-size:2rem;font-variant-numeric:tabular-nums}
.cl-in [data-scale]{min-height:52px;padding:0 10px}
.stepper [data-scale]{white-space:nowrap}
.seg.dev-type label.locked{opacity:.55}
@media (max-width:700px){.dev-row{grid-template-columns:1fr}.dev-act{justify-content:flex-start}.cl-in [data-scale] span:not([data-ic]){display:none}}
.dq-line{display:flex;gap:12px;align-items:baseline;flex-wrap:wrap;margin-bottom:8px}
.dq-bar{height:8px;border-radius:2px;background:var(--surface-2);border:1px solid var(--line);overflow:hidden}
.dq-bar i{display:block;height:100%;background:var(--primary)}
