/* Revessel QMS — all page styles (was the <style> block in index.html, split v347) */
:root{
  --navy:#3A1F8F; --steel:#2457E6; --frame:#8A96A3; --divider:#D5DBE1;
  --ground:#E4E8EE; --surface:#FFFFFF; --surface-2:#EEF2F6; --ink:#1C2530; --muted:#556170;
  --primary:#3A1F8F; --primary-ink:#FFFFFF; --link:#2457E6;
  --ok:#1F6FB2; --bad:#C62828; --pending:#6B7785; --hold:#F2C230; --hold-ink:#1C2530; --ok-bg:#1F6FB2; --bad-bg:#C62828;
  --role-super:#3A1F8F; --role-admin:#2457E6; --role-user:#4A5563;
  --focus:#7A2FE0;
  --sans:"IBM Plex Sans",-apple-system,"Segoe UI",Roboto,"Microsoft YaHei","PingFang SC",sans-serif;
  --cond:"IBM Plex Sans Condensed","IBM Plex Sans","Arial Narrow",sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,Consolas,monospace;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme:dark;
    --frame:#51637A; --divider:#2A3749; --ground:#0E1520; --surface:#162131; --surface-2:#1C293B;
    --ink:#E7ECF2; --muted:#9BA8B7; --primary:#5B3FD0; --primary-ink:#FFFFFF; --link:#8FB0FF;
    --ok:#4A90DA; --bad:#E5483E; --pending:#8C97A5; --ok-bg:#1F6FB2; --bad-bg:#C62828;
    --role-super:#6A4BE0; --role-admin:#2457E6; --role-user:#6B7785; --focus:#B58CFF;
  }
}
:root[data-theme="dark"]{
  color-scheme:dark;
  --frame:#51637A; --divider:#2A3749; --ground:#0E1520; --surface:#162131; --surface-2:#1C293B;
  --ink:#E7ECF2; --muted:#9BA8B7; --primary:#5B3FD0; --primary-ink:#FFFFFF; --link:#8FB0FF;
  --ok:#4A90DA; --bad:#E5483E; --pending:#8C97A5; --ok-bg:#1F6FB2; --bad-bg:#C62828;
  --role-super:#6A4BE0; --role-admin:#2457E6; --role-user:#6B7785; --focus:#B58CFF;
}
*{box-sizing:border-box}
[hidden]{display:none!important}
body{background:var(--ground);color:var(--ink);font-family:var(--sans);font-size:14px;line-height:1.5}
button,input,select{font:inherit;color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}

/* ---------- top bar ---------- */
.topbar{position:sticky;top:env(safe-area-inset-top,0px);z-index:5;background:#3A1F8F;color:#fff;border-bottom:3px solid #2457E6}
/* v284/v285: top bar photo (Revessel tank farm) under a navy wash — like revessel.my hero. Home adds a band (#hmHero) under the bar so it reads as one tall bar; hdrBg() lines the two backgrounds up */
:root{--hdr-img:url("../img/header.jpg?v=202611190610")}
.topbar,.hm-hero{background-color:#2A2E33;background-image:linear-gradient(90deg,rgba(12,14,16,.88) 0%,rgba(12,14,16,.55) 35%,rgba(12,14,16,.15) 70%,rgba(12,14,16,.25) 100%),var(--hdr-img);   /* v307: "Clear" — photo in its own colours, dark only behind the text on the left */background-size:100% 100%,108% auto;background-repeat:no-repeat;background-position:0 0,center 0}
.topbar,.hm-hero{text-shadow:0 1px 3px rgba(0,0,0,.65)}.topbar .zoomer,.topbar .whoami{background:rgba(12,14,16,.38);border-radius:8px}.topbar .whoami{padding:2px 6px}
.hm-hero{height:150px;border-bottom:3px solid #2457E6;color:#fff;display:flex;align-items:flex-end}
.hm-hero-in{max-width:1180px;width:100%;margin:0 auto;padding:0 16px 22px}
.hm-kick{font-size:12px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:#D5DBE1;display:flex;align-items:center;gap:8px;margin-bottom:6px}
.hm-red{color:#FF4B4B;white-space:nowrap}
.hm-dot{width:8px;height:8px;border-radius:50%;background:#2457E6;box-shadow:0 0 0 3px rgba(36,87,230,.35);flex:none}
.hm-slogan{font-family:var(--cond);font-weight:700;font-size:34px;line-height:1.1;letter-spacing:.01em;text-shadow:0 2px 12px rgba(0,0,0,.45)}
/* v287: Home — bigger logo + company name */
body.on-home .brand-logo{width:56px;height:56px;border-radius:8px}
body.on-home .brand-logo.round{border-radius:50%}   /* v305: keep the Logo shape setting (Round) on Home too */
body.on-home .brand-name{font-size:24px}
body.on-home .brand-sub{font-size:12px}
.hm-hero[hidden]{display:none}
body.on-home .topbar{border-bottom-color:transparent;border-bottom-width:0}
@media (max-width:820px){ .hm-hero{height:112px} .hm-hero-in{padding:0 16px 14px} .hm-kick{font-size:10.5px;letter-spacing:.1em;margin-bottom:4px} .hm-slogan{font-size:clamp(19px,5.6vw,26px)}
  body.on-home .brand{flex:1 1 0;min-width:0} body.on-home .brand-logo{width:46px;height:46px} body.on-home .brand-name{font-size:24px} }
.topbar-in{max-width:1180px;margin:0 auto;padding:10px 16px;display:flex;align-items:center;gap:14px;flex-wrap:wrap}
.brand{display:flex;align-items:center;gap:12px;min-width:0;flex:1}
.brand-logo{position:relative;width:42px;height:42px;border-radius:6px;background:#fff;display:grid;place-items:center;overflow:hidden;flex:none}
.brand-logo img{position:absolute;inset:3px;width:calc(100% - 6px);height:calc(100% - 6px);max-width:none;object-fit:contain}
.brand-logo span{font-family:var(--cond);font-weight:700;color:#3A1F8F;font-size:16px}
.brand-text{min-width:0}
.brand-name{font-family:var(--cond);font-weight:700;font-size:17px;letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.brand-sub{font-size:11px;letter-spacing:.14em;text-transform:uppercase;opacity:.8}
.whoami{display:flex;align-items:center;gap:10px;font-size:13px}
.whoami img{width:28px;height:28px;border-radius:50%}
.whoami .who-name{max-width:160px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.zoomer{display:flex;align-items:stretch;border:1px solid rgba(255,255,255,.55);border-radius:5px;overflow:hidden}
.zoomer button{background:transparent;color:#fff;border:0;min-width:40px;min-height:34px;padding:0 8px;cursor:pointer;font-family:var(--cond);font-weight:700;font-size:14px;font-variant-numeric:tabular-nums}
.zoomer button.big{font-size:17px}
.zoomer button span{font-size:12px;margin-left:1px}
.zoomer button + button{border-left:1px solid rgba(255,255,255,.35)}
@media (hover:hover){ .zoomer button:hover{background:rgba(255,255,255,.14)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.zoomer button[disabled]{opacity:.4;cursor:not-allowed}
.zoomer .zreset{font-family:var(--sans);font-size:12px;min-width:52px}
.drawer-zoom{display:none}
/* page name strip: stays under the top bar once the page title has scrolled away */
.page-strip{position:absolute;left:0;right:0;top:calc(100% + 3px);background:var(--surface);border-bottom:1px solid var(--divider);box-shadow:0 4px 12px rgba(10,20,35,.12);z-index:1}
.ps-in{max-width:1180px;margin:0 auto;padding:7px 16px;display:flex;align-items:baseline;gap:8px;min-width:0;color:var(--ink)}
@media (max-width:560px){ .ps-in{padding-inline:12px;gap:6px} .ps-g{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis} }
.ps-g{font-family:var(--cond);font-weight:700;font-size:11.5px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.ps-sep{color:var(--frame);font-weight:700}
.ps-f{font-family:var(--cond);font-weight:700;font-size:15px;color:var(--link);white-space:nowrap}
@media (min-width:821px){
  nav.side{transition:top .15s}
  body.strip-on nav.side{top:calc(env(safe-area-inset-top,0px) + 124px);max-height:calc(100vh / var(--z,1) - env(safe-area-inset-top,0px) - 136px)}
}
.ps-t{font-family:var(--cond);font-weight:700;font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
.whoami{position:relative}
.who-btn{background:none;border:0;padding:0;margin:0;cursor:default;display:inline-flex;border-radius:4px}
.who-tip{position:absolute;top:calc(100% + 10px);right:0;z-index:30;min-width:150px;max-width:220px;background:#fff;color:#1C2530;border:2px solid #3A1F8F;border-radius:6px;padding:8px 10px;box-shadow:0 8px 24px rgba(10,20,35,.3);display:flex;flex-direction:column;align-items:flex-start;gap:5px}
.who-tip::before{content:"";position:absolute;top:-8px;right:12px;width:12px;height:12px;background:#fff;border-left:2px solid #3A1F8F;border-top:2px solid #3A1F8F;transform:rotate(45deg)}
.who-tip .wt-k{font-size:10.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#556170}
.who-tip .wt-n{font-size:13px;font-weight:600;overflow-wrap:anywhere}
.who-tip .role-badge .rl{display:inline!important}
.who-tip .role-badge{box-shadow:none}
.who-tip .role-client{border-color:#1C2530}
.topbar .role-badge{box-shadow:0 0 0 1px rgba(255,255,255,.55)}

/* ---------- layout ---------- */
.shell{max-width:1180px;margin:0 auto;padding-inline:16px;padding-block:20px 60px;display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;align-items:start}
nav.side{position:sticky;top:calc(env(safe-area-inset-top,0px) + 84px);display:flex;flex-direction:column;gap:2px}
@media (min-width:821px){
  /* long menu scrolls on its own when the cursor is over it; the page stays put */
  nav.side{max-height:calc(100vh / var(--z,1) - env(safe-area-inset-top,0px) - 96px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;-ms-overflow-style:none;padding-bottom:12px}
  nav.side::-webkit-scrollbar{display:none;width:0;height:0}
}
nav.side a{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:6px;color:var(--ink);text-decoration:none;font-weight:500;border-left:3px solid transparent}
@media (hover:hover){ nav.side a:hover{background:var(--surface-2)} }
nav.side a[aria-current="page"]{background:var(--surface);border-left-color:var(--steel);color:var(--ink);font-weight:600;box-shadow:0 1px 0 var(--divider)}
nav.side a svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8}
.nav-group-head{display:flex;align-items:center;gap:10px;width:100%;padding:9px 12px;border:0;background:var(--navy);color:#fff;border-radius:6px;cursor:pointer;font-family:var(--cond);font-weight:700;font-size:13px;letter-spacing:.12em;text-transform:uppercase;text-align:left}
@media (hover:hover){ .nav-group-head:hover{filter:brightness(1.15)} }
.nav-group-head svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.nav-group-head span{flex:1}
.rail-toggle{display:flex;align-items:center;gap:10px;width:100%;padding:7px 12px;margin-bottom:6px;border:1px solid var(--divider);background:var(--surface);color:var(--muted);border-radius:6px;cursor:pointer;font-size:12.5px;font-weight:600;text-align:left}
@media (hover:hover){ .rail-toggle:hover{color:var(--ink);border-color:var(--frame)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.rail-toggle svg{width:17px;height:17px;flex:none;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.rail-toggle .nl{flex:1}
.shell{transition:grid-template-columns .18s}
.shell.rail{grid-template-columns:58px minmax(0,1fr)}
.shell.rail nav.side .nl,.shell.rail nav.side .chev{display:none}
.shell.rail nav.side a,.shell.rail .nav-group-head,.shell.rail .rail-toggle{justify-content:center;padding-left:0;padding-right:0}
.shell.rail nav.side a{border-left-width:3px}
.shell.rail .rail-toggle .dir{display:block;transform:rotate(180deg)}
.shell.rail .rail-toggle > svg:first-child{display:none}
.shell.rail .nav-group{margin-left:0;padding-left:0;border-left:0;padding-top:6px}
.nav-group.closed{display:none}
nav.side a svg{width:18px;height:18px}
@media (prefers-reduced-motion:reduce){.shell{transition:none}}
.nav-group-head .chev{transition:transform .15s}
.nav-group-head[aria-expanded="false"] .chev{transform:rotate(-90deg)}
.nav-group{display:flex;flex-direction:column;gap:2px;padding:4px 0 0 8px;margin-left:12px;border-left:2px solid var(--divider)}
.nav-group[hidden]{display:none}
@media (prefers-reduced-motion:reduce){.nav-group-head .chev{transition:none}}
.nav-label{font-size:11px;text-transform:uppercase;letter-spacing:.12em;color:var(--muted);padding:4px 12px 8px}
.menu-btn{display:none;width:40px;height:40px;flex:none;align-items:center;justify-content:center;border:1px solid rgba(255,255,255,.55);border-radius:6px;background:transparent;color:#fff;cursor:pointer}
.menu-btn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round}
.nav-backdrop{display:none}
.drawer-head{display:none}
.sub-short{display:none}
@media (max-width:820px){
  .shell,.shell.rail{grid-template-columns:minmax(0,1fr);gap:14px}
  main{min-width:0}
  .menu-btn{display:inline-flex}
  nav.side{position:fixed;top:0;left:0;bottom:0;z-index:40;width:min(290px,86vw);background:var(--ground);border-right:1px solid var(--divider);
    padding:12px 12px calc(env(safe-area-inset-bottom,0px) + 16px);border-top:env(safe-area-inset-top,0px) solid var(--ground);overflow-y:auto;
    transform:translateX(-105%);visibility:hidden;transition:transform .2s ease,visibility .2s;box-shadow:0 0 40px rgba(10,20,35,.3)}
  body.menu-open nav.side{transform:none;visibility:visible}
  .nav-backdrop{display:block;position:fixed;inset:0;z-index:35;background:rgba(10,20,35,.45);opacity:0;pointer-events:none;transition:opacity .2s}
  body.menu-open .nav-backdrop{opacity:1;pointer-events:auto}
  .drawer-head{display:flex;align-items:center;justify-content:space-between;padding:4px 4px 12px;margin-bottom:8px;border-bottom:1px solid var(--divider);font-family:var(--cond);font-weight:700;font-size:15px;color:var(--ink)}
  .drawer-head button{width:36px;height:36px;border:1px solid var(--divider);border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer;display:grid;place-items:center}
  .drawer-head svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
  nav.side .rail-toggle{display:none}
  .shell.rail nav.side .nl,.shell.rail nav.side .chev{display:inline}
  .shell.rail nav.side a,.shell.rail .nav-group-head{justify-content:flex-start;padding:9px 12px}
  .shell.rail .nav-group{margin-left:12px;padding:4px 0 0 8px;border-left:2px solid var(--divider)}
  nav.side a{padding:11px 12px}
  .whoami .who-name{display:none}
}
@media (max-width:560px){
  .topbar-in{gap:8px;padding-inline:12px}
  .brand{gap:8px}
  .brand-logo{width:36px;height:36px}
  .brand-name{font-size:15px}
  .sub-long{display:none}.sub-short{display:inline}
  .top-zoom{display:none}
  .drawer-zoom{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:0 4px 12px;margin-bottom:10px;border-bottom:1px solid var(--divider);font-size:13px;font-weight:600;color:var(--muted)}
  .drawer-zoom .zoomer{border-color:var(--frame);background:var(--navy)}
  .whoami .role-badge .rl{display:none}
  .whoami .role-badge{padding:4px 7px}
  .who-btn{cursor:pointer;padding:4px;margin:-4px}
  .who-tip .role-badge{padding:3px 9px}
  .whoami img{display:none}
}
@media (prefers-reduced-motion:reduce){nav.side,.nav-backdrop{transition:none}}


/* ---------- phone fit ---------- */
html,body{max-width:100%;overflow-x:clip}
.ro-val,.person .pn,td{overflow-wrap:anywhere}
@media (max-width:820px){
  /* iOS zooms the page when a field under 16px is tapped; keep fields at 16px */
  .inp,select.inp,input,select,textarea{font-size:16px}
  .inp.mono{font-size:15px}
}
@media (max-width:560px){
  .shell{padding-block:14px 48px;gap:12px}
  h1{font-size:22px}
  .lede{font-size:13.5px}
  .page-head{margin-bottom:12px}
  .panel-head{padding:10px 14px}
  .panel-body{padding:14px}
  .panel + .panel{margin-top:12px}
  .fields{gap:12px}
  .role-cards{gap:10px}
  .tgl{min-width:64px;font-size:11px;padding:3px 6px}
  .matrix th:not(:first-child),.matrix td:not(:first-child){width:72px}
  .matrix td,.matrix th{padding:6px 5px}
  .matrix thead{display:none}
  .matrix,.matrix tbody{display:block}
  .matrix tr{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;padding:10px 0;border-bottom:1px solid var(--divider)}
  .matrix tr.grp{display:block;padding:0;border:0}
  .matrix tr.grp td{display:block;padding:7px 8px}
  .matrix td{display:flex;flex-direction:column;align-items:flex-start;gap:4px;padding:0!important;border:0;width:auto!important}
  .matrix td:first-child{grid-column:1 / -1;min-width:0;font-weight:600}
  .matrix td:nth-child(2){display:none}
  .matrix td:nth-child(n+3)::before{content:attr(data-role);font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
  .matrix .tgl{width:100%;min-width:0}
  /* only your own role: permission name left, Yes / No right */
  .matrix.one tr{grid-template-columns:minmax(0,1fr) auto;align-items:center}
  .matrix.one td:first-child{grid-column:1}
  .matrix.one td:nth-child(2){display:flex}
  .matrix.one td:nth-child(n+2)::before{display:none}
  .matrix.one .tgl{width:auto;min-width:64px}
  .savebar{padding:8px 10px}
  .savebar .btn{padding:8px 10px}
  .steps{padding-left:18px}
  .rule-row{flex-direction:column;gap:2px}
  /* tables become stacked cards */
  table.stack thead{display:none}
  table.stack,table.stack tbody{display:block}
  table.stack tr{display:grid;gap:6px 8px;padding:10px 0;border-bottom:1px solid var(--divider)}
  table.stack tr:last-child{border-bottom:0}
  table.stack td{display:block;padding:0;border:0;min-width:0}
  .stack-personnel tr{grid-template-columns:minmax(0,1fr) 96px 36px}
  .stack-personnel td:first-child{grid-column:1 / -1}
  .stack-personnel td:first-child .inp{font-weight:600}
  .stack-holiday tr{grid-template-columns:minmax(0,1fr) 36px}
  .stack-holiday td:nth-child(2){grid-column:1;grid-row:2}
  .stack-holiday td:nth-child(3){grid-column:2;grid-row:1 / span 2;align-self:center}
  .stack-people tr{grid-template-columns:minmax(0,1fr) auto}
  .stack-people td:nth-child(1){grid-column:1}
  .stack-people td:nth-child(5){grid-column:2;grid-row:1;align-self:center}
  .stack-people td:nth-child(2){grid-column:1 / -1}
  .stack-people td:nth-child(3){grid-column:1 / -1;font-size:13px;color:var(--muted)}
  .stack-people td:nth-child(4){display:none}
  table.stack td[colspan]{grid-column:1 / -1}
}
#companyGroups{margin-bottom:16px}
@media (max-width:560px){#companyGroups{margin-bottom:12px}}
/* ---------- forms ---------- */
.nav-section{display:flex;flex-direction:column;gap:2px;margin-top:10px}
/* v264: an open menu group's heading stays on top while its links scroll under it (menu scrolls on its own) */
.nav-section > .nav-group-head{position:sticky;top:0;z-index:2;box-shadow:0 -6px 0 var(--ground)}
@media (max-width:820px){ .nav-section > .nav-group-head{top:-12px} }   /* v312: drawer scroll area now starts below the safe area (border), so headings stick right at its top — never float mid-menu */
nav.side a.nav-home{margin-bottom:0}
/* Home link looks like the navy group headings (Projects, Forms, ...) */
nav.side a.nav-home,nav.side a.nav-home[aria-current="page"]{background:var(--navy);color:#fff;border-left:0;box-shadow:none;border-radius:6px;padding:9px 12px;font-family:var(--cond);font-weight:700;font-size:13px;letter-spacing:.12em;text-transform:uppercase}
@media (hover:hover){ nav.side a.nav-home:hover{background:var(--navy);filter:brightness(1.15)} }
nav.side a.nav-home svg{width:17px;height:17px;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.shell.rail nav.side a.nav-home{padding-left:0;padding-right:0}
nav.side a .cnt.warn{background:var(--hold);color:var(--hold-ink);font-weight:700}
.shell.rail nav.side a{position:relative}
.shell.rail nav.side a .cnt.warn:not([hidden]){display:block;position:absolute;top:2px;right:4px;padding:0 5px;line-height:15px;font-size:10px}
nav.side a .cnt{margin-left:auto;font-size:11px;font-weight:600;color:var(--muted);font-variant-numeric:tabular-nums;background:var(--surface-2);border-radius:10px;padding:0 7px;line-height:18px}
.shell.rail nav.side a .cnt{display:none}
.forms-tools{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.search-wrap{position:relative;flex:1 1 260px;max-width:480px}
#formFoldBtn,.fold-btn{margin-left:auto}

.cl-group .panel-head .letter{display:inline-grid;place-items:center;width:28px;height:28px;border-radius:5px;background:var(--navy);color:#fff;font-family:var(--cond);font-weight:700;font-size:15px;flex:none}
.cl-group + .cl-group{margin-top:10px}
.search-wrap svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);width:17px;height:17px;fill:none;stroke:var(--muted);stroke-width:2;stroke-linecap:round;pointer-events:none}
.search-wrap .inp{padding-left:34px}
.forms-panel + .forms-panel{margin-top:12px}
.forms-panel .panel-head h2 .hc{font-weight:600;color:var(--muted);letter-spacing:.04em;margin-left:6px}
.forms-panel .panel-head .dept-ico{width:18px;height:18px;flex:none;fill:none;stroke:var(--steel);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.forms-panel .panel-head{justify-content:flex-start;gap:10px}
table.forms th.c-no,table.forms td.c-no{width:52px;color:var(--muted);font-variant-numeric:tabular-nums}
table.forms td.c-fno{white-space:nowrap}
table.forms .fno{font-family:var(--mono);font-weight:500;font-size:13px}
.fcode{display:inline-block;margin-left:6px;font-size:10.5px;font-weight:700;letter-spacing:.06em;border:1.5px solid var(--steel);color:var(--link);border-radius:3px;padding:0 5px;vertical-align:1px}
table.forms td.c-rev{white-space:nowrap;font-family:var(--mono);font-size:12.5px}
table.forms td.c-date{white-space:nowrap;color:var(--muted);font-variant-numeric:tabular-nums}
table.forms td.c-act{white-space:nowrap;text-align:right;width:1%}
table.forms td.c-act .btn{min-height:30px;padding:5px 10px}
table.forms tr.recent td.c-date{color:var(--ink);font-weight:600}
/* v598: Forms › Edit opens under the form's own row */
table.forms tr.f-edrow > td{padding:6px 0 10px;background:transparent}
table.forms tr.f-edrow .panel.fe-inl{margin:0!important;box-shadow:0 2px 10px rgba(15,30,50,.12)}
table.forms tr.f-edrow .panel.fe-inl > .panel-head{position:static}
table.forms tr.f-editing > td{background:var(--surface-2)}
table.forms tr.f-editing td.c-fno .fno{color:var(--link)}
@media (max-width:820px){ table.stack-forms tr.f-edrow{display:block;padding:0;border:0;background:transparent} table.stack-forms tr.f-edrow > td{display:block;padding:0 0 10px} }
.f-empty{padding:14px 0;color:var(--muted)}
/* v311: attachment / sub-form (QC002a, QC002b, QC005a, PUR010-1…) nested under its parent form */
table.forms tr.f-child td{border-top-color:transparent}
table.forms tr.f-child td.c-fno{padding-left:26px}
table.forms tr.f-child .f-tree{font-family:var(--mono);color:var(--frame);margin-right:6px;font-weight:600}
table.forms tr.f-child td.c-title{color:var(--ink)}
/* v651 (Kah Poh): sub form no. = same size as the main forms (was 12.5px) */
.fe-actions{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end;margin-top:14px}
.fe-actions .left{margin-right:auto}
.fe-err{color:#C62828;font-weight:600;font-size:13px;margin-top:8px}
@media (max-width:560px){
  .forms-tools .btn{width:auto;flex:1 1 0;min-width:0;justify-content:center;white-space:nowrap}   /* v167: buttons side by side, share one row */
  .forms-tools .search-wrap{flex:1 1 100%;width:100%}
  .search-wrap{max-width:none}
  .stack-forms tr{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);grid-template-areas:"fno rev date" "title title title" "bar bar bar"}   /* v313: form no. | Rev (centre) | date (right) on one row */
  /* v314/v315: phone — Portal badge · Open form · Att. n (left) and Edit · Delete (right) on ONE row (td.c-bar); description alone above it */
  .stack-forms td.c-title{display:contents}
  table.stack-forms td.c-title .f-tt{grid-area:title;font-weight:500}
  table.stack-forms td.c-title .f-portal,table.stack-forms td.c-act{display:none!important}
  table.stack-forms td.c-bar{grid-area:bar;display:flex!important;align-items:center;gap:5px;flex-wrap:wrap}
  table.stack-forms td.c-bar .fb-l,table.stack-forms td.c-bar .fb-r{display:flex;align-items:center;gap:5px}
  table.stack-forms td.c-bar .fb-r{margin-left:auto}
  table.stack-forms .f-pb2{display:none}
  table.stack-forms .f-pbadge{font-size:9.5px;letter-spacing:.03em;padding:1px 4px;white-space:nowrap}
  table.stack-forms td.c-bar .btn{min-height:32px!important;padding:3px 6px!important;font-size:12px!important;gap:4px;white-space:nowrap}
  table.stack-forms td.c-bar .btn svg{display:none}
  table.stack-forms td.c-bar,table.stack-forms td.c-bar .fb-l,table.stack-forms td.c-bar .fb-r{gap:4px}
  .stack-forms td.c-no{display:none}
  .stack-forms td.c-fno{grid-area:fno}
  .stack-forms td.c-rev{grid-area:rev;align-self:center;justify-self:center;text-align:center}
  .stack-forms td.c-title{grid-area:title;font-weight:500}
  .stack-forms td.c-date{grid-area:date;align-self:center;justify-self:end;text-align:right;font-size:13px}
  .stack-forms td.c-act{grid-area:act;text-align:right;width:auto;justify-self:end}
  .stack-forms td.c-act:empty{display:none}
  .stack-forms tr.f-child{margin-left:22px;padding-top:8px}   /* v311: sub-form card indented under its parent */
  table.forms tr.f-child td.c-fno{padding-left:0}
  table.forms tr.has-child{border-bottom-color:transparent}
}

/* ---------- clients ---------- */
table.clients .cno{font-family:var(--mono);font-size:12.5px;white-space:nowrap}
.btn-sm{min-height:28px!important;padding:4px 10px!important;font-size:12.5px}
.act-row{display:flex;gap:5px;justify-content:flex-end;flex-wrap:nowrap}
table.cl-main{table-layout:fixed}
table.cl-main col.w-name{width:44%} table.cl-main col.w-addr{width:56%} table.cl-main col.w-ph{width:168px} table.cl-main col.w-term{width:84px} table.cl-main col.w-act{width:92px}
table.cl-main .act-row{flex-direction:column;align-items:stretch;gap:4px}
table.cl-main .act-row .btn{justify-content:center}
table.cl-main td.c-ph{white-space:nowrap}
table.cl-main td{vertical-align:middle;padding:9px 10px}
table.cl-main th.th-act{text-align:right}
@media (hover:hover){ table.cl-main tbody tr:hover td{background:var(--surface-2)} }
table.cl-main .cname{line-height:1.3}
table.cl-main .cmeta{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
table.cl-main .cmeta .cno{font-size:12px}
table.cl-main .caddr{font-size:13px;line-height:1.45}
table.cl-main td.c-act{width:auto}

table.cl-main .cmeta span{white-space:nowrap}
@media (max-width:560px){ table.stack colgroup{display:none} table.cl-main td{padding:0} .stack-clients tr{grid-template-areas:"name name" "addr addr" "ph term" "act act"!important;grid-template-columns:minmax(0,1fr) auto!important} .stack-clients td.c-act{justify-self:stretch!important;align-self:center!important;width:auto!important;padding-top:4px!important} .stack-clients .act-row,table.cl-main.stack-clients .act-row{flex-direction:row;justify-content:flex-start} table.cl-main{table-layout:auto} .act-row{flex-wrap:wrap} table.cl-main th.th-act{text-align:left} }
table.clients .cname{font-weight:600}
table.clients .caddr{color:var(--muted);font-size:13px;line-height:1.4}
table.clients td.c-ph{white-space:nowrap;font-variant-numeric:tabular-nums;font-size:13px}
table.clients td.c-ph div + div{color:var(--muted)}
table.clients td.c-term{white-space:nowrap;font-size:13px}
table.clients td.c-act{white-space:nowrap;text-align:right;width:1%}
table.clients td.c-act .btn{min-height:30px;padding:5px 10px}
.imp-sum{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.imp-sum .status{font-size:12px}
.imp-note{font-size:13px;color:var(--muted);margin:0 0 10px}
.imp-prog{font-weight:600}
@media (max-width:560px){
  .stack-clients tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name act" "addr addr" "ph term"}
  .stack-clients td.c-name{grid-area:name}
  .stack-clients td.c-act{grid-area:act;width:auto;justify-self:end;align-self:start}
  .stack-clients td.c-addr{grid-area:addr}
  .stack-clients td.c-ph{grid-area:ph}
  .stack-clients td.c-term{grid-area:term;justify-self:end;align-self:end}
}

/* ---------- client details ---------- */
.ci-alert{border:2px solid var(--hold)!important}
.ci-alert .panel-head{background:var(--hold);color:var(--hold-ink);border-bottom:0;border-radius:6px 6px 0 0}
.ci-alert .panel-head h2{color:var(--hold-ink)}
.ci-row{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1.4fr) auto;gap:10px 14px;align-items:center;padding:12px 0;border-bottom:1px solid var(--divider)}
.ci-row:last-child{border-bottom:0}
.ci-why{font-size:12.5px;color:var(--muted);margin-top:2px}
.ci-why b{color:var(--ink)}
.ci-pick{display:flex;flex-direction:column;gap:4px}
.ci-pick .sugg{font-size:12px;color:var(--link);font-weight:600}
.ci-btns{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.ci-btns .btn{min-height:32px;padding:6px 10px}
.sf{display:inline-block;margin-left:6px;font-size:11.5px;font-weight:700;letter-spacing:.06em;background:var(--navy);color:#fff;border-radius:3px;padding:1px 6px;vertical-align:1px}
table.ci td{vertical-align:top}
table.ci .lbl{display:none}
table.ci td.c-act{white-space:nowrap;text-align:right;width:1%}
table.ci td.c-act .btn{min-height:30px;padding:5px 10px}
.ubs-box{background:var(--surface-2);border:1px solid var(--divider);border-radius:6px;padding:10px 12px;font-size:13px;line-height:1.5}
.ubs-box{width:100%}
.ubs-box .ubs-name{font-family:var(--cond);font-weight:700;font-size:18px;line-height:1.3;color:var(--ink);overflow-wrap:anywhere}   /* v119: client name larger */
.ubs-box .ubs-no{font-family:var(--mono);font-size:13.5px;font-weight:500;color:var(--muted);margin-left:8px;white-space:nowrap}
.ubs-box .ubs-addr{font-size:14px;margin-top:3px;overflow-wrap:anywhere}
.ubs-box .t{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin-bottom:4px}
.linkbtn{background:none;border:0;padding:0;color:var(--link);font-weight:600;cursor:pointer;font-size:12.5px;text-decoration:underline}
/* client logo */
.cl-logo-row{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px 18px;align-items:start}
.cl-logo-box{position:relative;width:100%;max-width:100%;aspect-ratio:3/2;border:2px dashed var(--frame);border-radius:8px;overflow:hidden;display:grid;place-items:center;text-align:center;padding:10px;
  background-color:#fff;background-image:linear-gradient(45deg,#EEF2F6 25%,transparent 25%,transparent 75%,#EEF2F6 75%),linear-gradient(45deg,#EEF2F6 25%,transparent 25%,transparent 75%,#EEF2F6 75%);background-size:14px 14px;background-position:0 0,7px 7px}
.cl-logo-box.has{border-style:solid;border-color:var(--divider)}
.cl-logo-box.drag{border-color:var(--steel);border-style:solid}
.cl-logo-box img{position:absolute;inset:10%;width:80%;height:80%;max-width:none;object-fit:contain}
.cl-logo-box .empty-msg{color:#556170;font-size:12.5px;background:#fff;padding:6px 10px;border-radius:6px;line-height:1.35}
.cl-logo-side{display:flex;flex-direction:column;gap:10px;min-width:0}
.cl-logo-side .brand-actions{margin-top:0}
.cl-logo-tips{margin:0;padding-left:18px;font-size:12.5px;color:var(--muted);display:flex;flex-direction:column;gap:3px}
.cl-logo-tips b{color:var(--ink);font-weight:600}
.cl-logo-state{display:inline-flex;align-items:center;gap:6px;font-size:12px;font-weight:700;letter-spacing:.04em}
.clogo{display:inline-grid;place-items:center;width:40px;height:30px;flex:none;border:1px solid var(--divider);border-radius:4px;background:#fff;overflow:hidden;vertical-align:middle}
.clogo img{display:block;width:100%;height:100%;max-width:none;object-fit:contain;padding:2px}
.cname-wrap{display:flex;align-items:center;gap:10px;min-width:0}
.cname-wrap > div{min-width:0}
@media (max-width:620px){ .cl-logo-row{grid-template-columns:1fr} .cl-logo-box{max-width:260px} }
@media (max-width:700px){ .ci-row{grid-template-columns:1fr} .ci-btns{justify-content:flex-start} }
@media (max-width:560px){
  .stack-ci tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name act" "pic pic" "own own" "ag ag"}
  .stack-ci td.c-name{grid-area:name} .stack-ci td.c-act{grid-area:act;width:auto;justify-self:end}
  .stack-ci td.c-pic{grid-area:pic} .stack-ci td.c-own{grid-area:own} .stack-ci td.c-ag{grid-area:ag}
  table.ci .lbl{display:inline;color:var(--muted);font-size:12px;margin-right:4px}
}

/* ---------- collapsible panels ---------- */
.panel-head[data-dec]{cursor:pointer;user-select:none;-webkit-user-select:none}
@media (hover:hover){ .panel-head[data-dec]:hover h2{color:var(--ink)} }   /* v596: mouse only — on touch the colour stuck after a drag */
.panel-head .pchev{width:18px;height:18px;flex:none;fill:none;stroke:var(--muted);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s;margin-left:auto}
.panel-head[data-dec] > h2{flex:1 1 auto}
.panel-head[data-dec]{flex-wrap:nowrap}
.panel-head[data-dec] > .meta,.panel-head[data-dec] > span:not(.pchev){flex:0 1 auto;text-align:right}
.panel.collapsed > .panel-head .pchev{transform:rotate(-90deg)}
.panel.collapsed > :not(.panel-head){display:none!important}
.panel.collapsed > .panel-head{border-bottom:0}
@media (max-width:820px){.panel-head[data-dec] > .meta,.panel-head[data-dec] > span.meta{display:none}.panel-head[data-dec]{min-height:48px}}
@media (prefers-reduced-motion:reduce){.panel-head .pchev{transition:none}}

/* ---------- page head ---------- */
.page-head{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:16px}
h1{font-family:var(--cond);font-weight:700;font-size:26px;line-height:1.15;margin:0;text-wrap:balance}
.lede{color:var(--muted);margin:4px 0 0}
/* v120: title + lede block takes the full width, so a long lede runs to the right edge (same as the panels below) */
.page-head > div:first-child{flex:1 1 320px;min-width:0}
/* the small count / "Updated" line sits at the top right, level with the page title, so it no longer squeezes the lede */
@media (min-width:561px){ .page-head{position:relative} .page-head > .meta{position:absolute;right:0;top:8px} .page-head > div:first-child h1{padding-right:190px} }
h2{font-family:var(--cond);font-weight:600;font-size:13px;letter-spacing:.12em;text-transform:uppercase;margin:0;color:var(--muted)}

.panel{background:var(--surface);border:1px solid var(--divider);border-radius:8px}
.panel + .panel{margin-top:16px}
.panel-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 18px;border-bottom:1px solid var(--divider);flex-wrap:wrap}
.panel-body{padding:18px}
/* panel headings stay at the top while you scroll through that panel; the next panel's heading pushes it away (v103) */
#main .panel > .panel-head{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px));z-index:4;/* v979: above every frozen sub heading inside the panel (they slide BEHIND it) */background:var(--surface);border-radius:8px 8px 0 0}
#main .panel.collapsed > .panel-head{border-radius:8px}
#main .pj-note > .panel-head,#main .ci-alert > .panel-head{background:var(--hold)}
/* desktop (v104): table column headings also stay on top, just under their panel heading, until the next panel pushes them away */
@media (min-width:821px){
  #main .panel .table-wrap{overflow:visible}
  #main .panel table > thead th{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px) + var(--ph,49px));z-index:2;background:var(--surface);border-bottom:0;box-shadow:inset 0 -2px 0 var(--divider)}
  /* v107: Item details job headings (and their column headings) don't stay on top on desktop — phone only */
  #view-items .it-panel > .panel-head{position:static}
  #view-items .it-panel table > thead th{position:static}
}

/* ---------- forms ---------- */
.fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px}
.fields .span2{grid-column:1/-1}
@media (max-width:620px){.fields{grid-template-columns:1fr}}
.field label{display:block;font-size:12px;font-weight:600;color:var(--muted);margin-bottom:5px}
.field .hint{font-weight:400;color:var(--muted);opacity:.85}
.inp{width:100%;padding:8px 10px;border:1px solid var(--frame);border-radius:5px;background:var(--surface);min-height:36px}
@media (hover:hover){ .inp:hover{border-color:var(--steel)} }   /* v606: mouse only — on touch it stuck while dragging */
.inp:focus{outline:2px solid var(--focus);outline-offset:0;border-color:var(--steel)}
.inp.bad,.inp.bad:hover,.inp.bad:focus{border:2px solid #C62828;outline:2px solid #C62828;outline-offset:0}   /* v122: required field missing */
.inp.mono{font-family:var(--mono);font-size:13px}
.ro-val{padding:8px 0 7px;border-bottom:1px solid var(--divider);min-height:36px;word-break:break-word}
.ro-val.empty{color:var(--muted);font-style:italic}

.table-wrap{overflow-x:auto}
table{width:100%;border-collapse:collapse;font-size:13.5px}
th{text-align:left;font-size:11.5px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:8px 10px;border-bottom:2px solid var(--divider);white-space:nowrap}
td{padding:6px 10px;border-bottom:1px solid var(--divider);vertical-align:middle}
td .inp{min-height:34px}
tr:last-child td{border-bottom:none}
.num{font-variant-numeric:tabular-nums}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;gap:7px;padding:8px 14px;border-radius:5px;border:1px solid transparent;font-weight:600;cursor:pointer;min-height:36px;line-height:1.1;white-space:nowrap}
.btn svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2}
.btn-primary{background:var(--primary);color:var(--primary-ink)}
@media (hover:hover){ .btn-primary:hover{filter:brightness(1.15)} }   /* v606: mouse only — on touch it stuck while dragging */
.btn-secondary{background:var(--surface);color:var(--link);border-color:var(--steel)}
@media (hover:hover){ .btn-secondary:hover{background:var(--surface-2)} }   /* v606: mouse only — on touch it stuck while dragging */
.btn-danger{background:#C62828;color:#fff}
.btn-quiet{background:transparent;color:var(--muted);border-color:var(--divider)}
@media (hover:hover){ .btn-quiet:hover{color:var(--ink);border-color:var(--frame)} }   /* v606: mouse only — on touch it stuck while dragging */
.btn[disabled]{opacity:.5;cursor:not-allowed}
.icon-btn{width:32px;height:32px;display:inline-grid;place-items:center;border-radius:5px;border:1px solid var(--divider);background:var(--surface);cursor:pointer;color:var(--muted)}
@media (hover:hover){ .icon-btn:hover{color:#C62828;border-color:#C62828} }   /* v606: mouse only — on touch it stuck while dragging */
.icon-btn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:2.2}

/* ---------- badges ---------- */
.role-badge{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:4px;font-size:11.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;white-space:nowrap;line-height:1.5}
.role-super{background:var(--role-super);color:#fff}
.role-admin{background:var(--role-admin);color:#fff}
.role-user{background:var(--role-user);color:#fff}
.role-pending{background:var(--hold);color:var(--hold-ink)}
.role-select{appearance:none;-webkit-appearance:none;font:inherit;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;border-radius:4px;padding:5px 30px 5px 10px;min-height:32px;cursor:pointer;border:2px solid transparent;
}
select.role-select{background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 15px) 50%,calc(100% - 10px) 50%;background-size:5px 5px;background-repeat:no-repeat}
.role-select option{background:var(--surface);color:var(--ink);text-transform:none;font-weight:500;letter-spacing:0}
.role-select.role-client{padding:5px 30px 5px 10px}
.role-client{background:var(--surface);color:var(--ink);border:2px solid var(--ink);padding:1px 7px}
.status{display:inline-flex;align-items:center;gap:6px;padding:3px 9px;border-radius:4px;font-size:11.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}
.st-ok{background:var(--ok-bg);color:#fff}.st-bad{background:var(--bad-bg);color:#fff}.st-pend{background:var(--pending);color:#fff}.st-hold{background:var(--hold);color:var(--hold-ink)}

/* ---------- save bar ---------- */
.savebar{position:sticky;bottom:calc(env(safe-area-inset-bottom,0px) + 12px);margin-top:16px;display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--steel);border-radius:8px;padding:10px 14px;box-shadow:0 6px 20px rgba(15,30,50,.15)}
.savebar .msg{display:flex;align-items:center;gap:8px;font-weight:500}
.savebar .dot{width:9px;height:9px;border-radius:50%;background:var(--hold);box-shadow:0 0 0 2px var(--ink) inset}
.meta{font-size:12px;color:var(--muted)}

/* ---------- notices ---------- */
.notice{display:flex;gap:10px;align-items:flex-start;padding:12px 14px;border-radius:6px;border:1px solid var(--divider);background:var(--surface-2);font-size:13.5px;margin-bottom:16px}
.notice svg{width:18px;height:18px;flex:none;stroke:var(--steel);fill:none;stroke-width:2;margin-top:1px}
.notice strong{font-weight:600}

/* ---------- branding ---------- */
.brand-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
@media (max-width:700px){.brand-grid{grid-template-columns:1fr}}
.brand-grid{align-items:start}
.brand-grid > .panel{margin-top:0!important;display:flex;flex-direction:column}
.brand-grid > .panel > .panel-body{flex:1;display:flex;flex-direction:column}
.brand-grid .dropzone{width:100%}
.brand-grid .brand-actions{margin-top:auto;padding-top:12px}
.dropzone{border:2px dashed var(--frame);border-radius:8px;aspect-ratio:16/9;max-width:100%;display:grid;place-items:center;text-align:center;padding:14px;position:relative;
  background-color:var(--surface);background-image:linear-gradient(45deg,var(--surface-2) 25%,transparent 25%,transparent 75%,var(--surface-2) 75%),linear-gradient(45deg,var(--surface-2) 25%,transparent 25%,transparent 75%,var(--surface-2) 75%);background-size:16px 16px;background-position:0 0,8px 8px}
.dropzone.drag{border-color:var(--steel);border-style:solid}
.dropzone{overflow:hidden}
.dropzone img{position:absolute;inset:10%;width:80%;height:80%;max-width:none;object-fit:contain}
.dropzone .empty-msg{color:var(--muted);font-size:13px;background:var(--surface);padding:8px 12px;border-radius:6px}
.brand-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px;align-items:center}
.confirm-row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:8px 10px;border:1px solid #C62828;border-radius:6px;background:var(--surface)}
.confirm-row span{font-weight:500}
/* logo shape: square / round */
.shape-pick{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:12px}
.shape-pick .sp-k{font-size:12.5px;font-weight:600;color:var(--muted)}
.shape-seg{display:inline-flex;border:1px solid var(--frame);border-radius:6px;overflow:hidden}
.shape-seg button{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border:0;background:var(--surface);color:var(--ink);cursor:pointer;font-weight:600;font-size:13px}
.shape-seg button + button{border-left:1px solid var(--frame)}
@media (hover:hover){ .shape-seg button:hover{background:var(--surface-2)} }   /* v606: mouse only — on touch it stuck while dragging */
.shape-seg button[aria-pressed="true"]{background:var(--navy);color:#fff}
.shape-seg button[disabled]{cursor:not-allowed;opacity:.55}
.shape-seg .ico{width:14px;height:14px;border:2px solid currentColor;flex:none}
.shape-seg .ico.sq{border-radius:2px}.shape-seg .ico.rd{border-radius:50%}
.dropzone .round-frame{position:absolute;left:50%;top:50%;height:84%;aspect-ratio:1/1;transform:translate(-50%,-50%);border-radius:50%;background:#fff;border:2px solid var(--divider);overflow:hidden}
.dropzone .round-frame img{inset:4%;width:92%;height:92%}
.brand-logo.round{border-radius:50%}
.brand-logo.round img{inset:2px;width:calc(100% - 4px);height:calc(100% - 4px)}
.doc-logo.round img{width:64px;height:64px}
/* v252 round stamp */
.doc-body .stamp.round{border-radius:50%;border:1px solid #D5DBE1}.doc-body .stamp.round img{object-fit:cover;border-radius:50%}
img.stamp-rd{border-radius:50%;object-fit:cover;aspect-ratio:1/1}
.qs-stamp img.stamp-rd{width:88px;height:88px;max-width:none;max-height:none}
.mp-sv img.stamp-rd{width:80px;height:80px;max-width:none;max-height:none}

/* report header preview */
.doc-preview{background:#fff;color:#1C2530;border:1px solid #8A96A3;border-radius:2px;max-width:100%;overflow-x:auto;font-family:"IBM Plex Sans",Arial,sans-serif}
.doc-head{display:grid;grid-template-columns:96px minmax(0,1fr) 190px;min-width:560px;border-bottom:2px solid #3A1F8F}
.doc-head > div{padding:10px 12px}
.doc-logo{display:grid;place-items:center;border-right:1px solid #D5DBE1}
.doc-logo img{display:block;width:76px;height:64px;max-width:none;object-fit:contain}
.doc-logo .ph{width:64px;height:56px;border:1px dashed #8A96A3;display:grid;place-items:center;font-size:10px;color:#6B7785}
.doc-co .n{font-family:"IBM Plex Sans Condensed",Arial,sans-serif;font-weight:700;font-size:16px;color:#3A1F8F}
.doc-co .n small{font-weight:600;font-size:13px;color:#1C2530;margin-left:6px}
.doc-co .l{font-size:11px;line-height:1.45;color:#3A4553}
.doc-ref{border-left:1px solid #D5DBE1;font-size:11px}
.doc-ref .t{font-family:"IBM Plex Sans Condensed",Arial,sans-serif;font-weight:700;font-size:13px;color:#3A1F8F;line-height:1.2;margin-bottom:6px}
.doc-ref dl{display:grid;grid-template-columns:auto 1fr;gap:1px 8px;margin:0}
.doc-ref dt{color:#6B7785}.doc-ref dd{margin:0;font-family:"IBM Plex Mono",monospace;font-size:10.5px}
.doc-body{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:10px 12px;min-width:560px;font-size:11px;color:#556170}
.doc-body .stamp{width:62px;height:62px;display:grid;place-items:center}
.doc-body .stamp{position:relative;overflow:hidden}
.doc-body .stamp img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain;opacity:.92}

/* ---------- users ---------- */
.person{display:flex;align-items:center;gap:10px;min-width:0}
.person img{width:30px;height:30px;border-radius:50%;flex:none}
.person .pn{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.person .pe{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.you{font-size:10.5px;font-weight:700;letter-spacing:.08em;color:var(--muted);border:1px solid var(--frame);border-radius:3px;padding:0 4px;margin-left:6px}
.add-grid{display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1.3fr) auto;gap:10px;align-items:end}
@media (max-width:760px){.add-grid{grid-template-columns:1fr}}
.search-box{position:relative}
.steps{margin:0;padding-left:22px;display:flex;flex-direction:column;gap:12px;max-width:72ch}
.steps li{padding-left:4px}
.steps b{font-weight:600}
.step-opts{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.rule-box{margin-top:8px;border:1px solid var(--frame);border-radius:6px;background:var(--surface-2);display:flex;flex-direction:column}
.rule-row{display:flex;gap:12px;padding:8px 12px;font-size:13px;align-items:baseline}
.rule-row + .rule-row{border-top:1px solid var(--divider)}
.rule-who{flex:none;width:86px;font-weight:700;font-size:11.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--ink)}
.step-opts span{border:1px solid var(--frame);border-radius:4px;padding:3px 9px;font-size:13px;background:var(--surface-2)}
.alt-search{margin-top:18px;border-top:1px solid var(--divider);padding-top:12px}
.alt-search summary{cursor:pointer;color:var(--link);font-weight:500}
.results{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--frame);border-radius:6px;box-shadow:0 8px 24px rgba(15,30,50,.18);z-index:4;max-height:280px;overflow:auto}
.results button{display:flex;width:100%;text-align:left;gap:10px;align-items:center;padding:8px 10px;border:0;background:none;cursor:pointer;border-bottom:1px solid var(--divider)}
.results button:focus-visible{background:var(--surface-2)} @media (hover:hover){ .results button:hover{background:var(--surface-2)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.results .none{padding:10px;color:var(--muted);font-size:13px}
.picked{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 8px;border:1px solid var(--steel);border-radius:5px;min-height:36px}

/* ---------- permission matrix ---------- */
.matrix th:not(:first-child),.matrix td:not(:first-child){text-align:center;width:120px}
.matrix td:first-child{font-weight:500}
.matrix .grp td{background:var(--surface-2);font-size:11.5px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--muted)}
.yes{display:inline-flex;align-items:center;gap:5px;font-weight:700;font-size:12px;color:var(--ok)}
.yes::before{content:"✓";display:inline-grid;place-items:center;width:18px;height:18px;border-radius:3px;background:var(--ok-bg);color:#fff;font-size:12px}
.lim{display:inline-flex;align-items:center;gap:5px;font-weight:600;font-size:12px;color:var(--ink)}
.lim::before{content:"◐";font-size:15px;line-height:1}
.no{color:var(--muted);font-weight:500;font-size:12px}
.no::before{content:"— "}
.tgl{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:92px;min-height:30px;padding:3px 10px;border-radius:4px;font-size:12px;font-weight:700;letter-spacing:.04em;border:2px solid transparent;font-family:inherit;line-height:1.2}
.tgl.on{background:var(--ok-bg);color:#fff}
.tgl.off{background:var(--surface);color:var(--muted);border-color:var(--frame)}
button.tgl{cursor:pointer}
@media (hover:hover){ button.tgl.off:hover{border-color:var(--steel);color:var(--ink)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
@media (hover:hover){ button.tgl.on:hover{filter:brightness(1.12)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
button.tgl.changed{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--hold)}
.fixed{display:inline-flex;align-items:center;gap:4px;font-size:12px;font-weight:700;color:var(--ink);letter-spacing:.04em}
.fixed::before{content:"";width:10px;height:10px;border:2px solid currentColor;border-radius:2px;background:linear-gradient(currentColor,currentColor) center/4px 4px no-repeat}
.fixed.na{color:var(--muted);font-weight:600}
.fixed.no-fixed{color:var(--muted);font-weight:600}
.perm-legend{display:flex;gap:12px;flex-wrap:wrap;align-items:center;padding:6px 0 10px;border-bottom:1px solid var(--divider);margin-bottom:4px}
.perm-actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center;justify-content:flex-end;margin-top:12px}
.perm-actions:empty{display:none}
.perm-actions .msg{margin-right:auto;display:flex;align-items:center;gap:8px;font-weight:500}
.soon{font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);border:1px dashed var(--frame);border-radius:3px;padding:0 5px;margin-left:6px}
.role-cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-bottom:16px}
@media (max-width:960px){.role-cards{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media (max-width:480px){.role-cards{grid-template-columns:1fr}}
.role-card{background:var(--surface);border:1px solid var(--divider);border-radius:8px;padding:14px;display:flex;flex-direction:column;gap:8px}
.role-card p{margin:0;font-size:13px;color:var(--muted)}
.role-card .share{font-size:12px;border-top:1px solid var(--divider);padding-top:8px;margin-top:auto}
.role-card .share b{color:var(--ink)}
.role-cards.one{grid-template-columns:minmax(0,420px)}
/* report status colours: every badge the same size (4 across, 2 x 2 on phone) */
.status-legend{display:grid;grid-template-columns:repeat(4,minmax(0,150px));gap:10px}
.status-legend .status{justify-content:center;padding:6px 10px;font-size:12px}
@media (max-width:560px){ .status-legend{grid-template-columns:repeat(2,minmax(0,1fr))} }

/* ---------- public holiday (v135) ---------- */
.ph-years{display:inline-flex;border:1px solid var(--frame);border-radius:6px;overflow:hidden}
.ph-years button{min-height:40px;min-width:78px;padding:0 16px;border:0;background:var(--surface);color:var(--ink);cursor:pointer;font-family:var(--cond);font-weight:700;font-size:15px;font-variant-numeric:tabular-nums}
.ph-years button + button{border-left:1px solid var(--frame)}
@media (hover:hover){ .ph-years button:hover{background:var(--surface-2)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.ph-years button[aria-pressed="true"]{background:var(--navy);color:#fff}
.ph-years button .sub{display:block;font-family:var(--sans);font-weight:600;font-size:11px;letter-spacing:.08em;text-transform:uppercase;opacity:.8;margin-top:-2px}
.ph-tag{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;border:1.5px solid transparent}
.ph-national{background:var(--navy);color:#fff}
.ph-state{background:var(--steel);color:#fff}
.ph-replace{background:var(--surface);color:var(--ink);border-color:var(--ink)}
.ph-extra{background:var(--surface);color:var(--link);border-color:var(--steel)}
.ph-event{background:var(--hold);color:var(--hold-ink)}
table.ph td{vertical-align:middle;padding:8px 10px}
table.ph td.c-date{white-space:nowrap;font-family:var(--mono);font-size:13.5px;width:1%}
table.ph td.c-day{white-space:nowrap;width:1%;color:var(--muted)}
table.ph td.c-day.we{color:var(--ink);font-weight:600}
table.ph .hname{font-weight:600}
table.ph .hnote{font-size:13px;color:var(--muted);margin-top:2px}
table.ph .moon{color:var(--link);font-weight:700;margin-left:3px}
table.ph tr.past td.c-date,table.ph tr.past td.c-day,table.ph tr.past .hname{color:var(--muted);font-weight:500}
table.ph tr.next td{background:var(--surface-2)}
table.ph td.c-type{width:34%}
table.ph .ph-wd{display:none}
table.ph td.c-act{white-space:nowrap;width:1%;text-align:right}
table.ph td.c-act .act-row{justify-content:flex-end;flex-direction:row}
/* company holiday (v147) */
.sh-sum{display:flex;align-items:center;gap:10px 14px;flex-wrap:wrap;background:var(--surface);border:1px solid var(--divider);border-left:4px solid var(--navy);border-radius:8px;padding:10px 14px;margin-bottom:14px}
.sh-sum .n{font-family:var(--cond);font-weight:700;font-size:20px}
.sh-sum .k{font-size:13px;color:var(--muted)}
.sh-list{display:flex;flex-direction:column}
.sh-row{display:grid;grid-template-columns:28px 86px 44px minmax(0,1fr) auto;gap:4px 10px;align-items:center;padding:9px 0;border-bottom:1px solid var(--divider)}
.sh-row:last-child{border-bottom:0}
.sh-row input{width:20px;height:20px;margin:0;accent-color:#3A1F8F;cursor:pointer}
.sh-lock,.sh-empty{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:4px;font-size:13px;font-weight:700;line-height:1}
.sh-lock{background:#3A1F8F;color:#fff}
/* v167: phone — toolbar action buttons share one row (Kah Poh: buttons must not take too much space on phone) */
@media (max-width:820px){
  #view-orgchart .forms-tools #ocAddDept,#view-orgchart .forms-tools #ocFoldBtn{width:auto;flex:1 1 0;min-width:0;padding-left:8px;padding-right:8px;white-space:nowrap}
}
.sort-bar{display:flex;align-items:center;flex-wrap:wrap;gap:6px 18px;background:var(--surface);border:1px solid var(--divider);border-radius:8px;padding:9px 14px;margin-bottom:10px;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.sort-bar .sb-l{color:var(--muted)}
.sort-bar .pj-sort{min-height:30px}
.sort-bar.sb-phone{display:none}
@media (max-width:820px){ .sort-bar.sb-phone{display:flex} .sort-bar{gap:6px 14px;padding:8px 12px} .sort-bar .pj-sort{min-height:36px} }
/* v175 production details */
.pd-sec{}
table.it tr.pd-tr > td.c-pd{padding:0 0 8px 0;border-top:0}
table.it tr:has(+ tr.pd-tr) > td{border-bottom:0}
.pd-h{display:flex;align-items:center;gap:10px;width:100%;background:none;border:0;padding:6px 0;cursor:pointer;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);text-align:left;min-height:36px}
@media (hover:hover){ .pd-h:hover{color:var(--ink)} }.pd-n{font-weight:500;letter-spacing:0;text-transform:none;font-size:12.5px}
.pd-chev{width:18px;height:18px;margin-left:auto;fill:none;stroke:currentColor;stroke-width:2;transition:transform .15s}.pd-sec.open .pd-chev{transform:rotate(180deg)}
.pd-in{border-left:4px solid var(--steel);padding-left:10px;margin-top:4px}
.pd-card{border:1px solid var(--divider);border-radius:6px;padding:10px 12px;background:var(--surface)}
.pd-card + .pd-card{margin-top:8px}.pd-card.on{border-color:var(--steel);border-width:2px}
.pd-ch{display:flex;align-items:center;gap:10px;justify-content:space-between;margin-bottom:6px}.pd-it{font-weight:700;color:#3A1F8F;font-size:14px}
.pd-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 20px}
.pd-f{display:grid;grid-template-columns:var(--pdl,112px) minmax(0,1fr);gap:6px 6px;align-items:baseline;padding:3px 0;border-bottom:1px dashed var(--divider)}
.pd-l{font-size:12.5px;font-weight:600;color:var(--muted)}.pd-v{font-size:14px;color:var(--ink);font-weight:600;overflow-wrap:anywhere}.pd-v.mut{color:var(--muted);font-weight:400}
.pd-src{white-space:nowrap;display:inline-block;margin-left:6px;font-size:11px;font-weight:600;color:#fff;background:#6B7785;border-radius:3px;padding:1px 5px;vertical-align:1px}
.pd-form{display:flex;flex-direction:column;gap:6px}.pd-row{display:grid;grid-template-columns:170px minmax(0,1fr);gap:8px;align-items:center}
.pd-row .inp{font-size:16px;max-width:420px;width:100%}.pd-row .md-dt{max-width:170px!important}
.pd-acts{display:flex;gap:8px;justify-content:flex-end;margin-top:6px}
/* v195 phone: while an item's Production details is open, its item box stays on top (under the sticky headings) */
@media (max-width:820px){
  .table-wrap:has(> table.stack-it){overflow:visible}
  table.stack-it tr.it-frz{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px) + var(--ph,49px));z-index:2;background:var(--surface);box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
  table.stack-it tbody.it-g tr.pd-tr:last-child{border-bottom:1px solid var(--divider)}
  table.stack-it tbody.it-g:last-child tr.pd-tr:last-child{border-bottom:0}
}
/* v196 phone: date boxes sit on the right of their title */
@media (max-width:820px){ .pd-row.pd-rd{grid-template-columns:minmax(0,1fr) 150px;gap:10px;align-items:start} .pd-row.pd-rd > .pd-l{padding-top:12px;white-space:nowrap} .pd-row.pd-rd .md-date{min-width:0} .pd-row.pd-rd .md-dt{width:100%} }
/* v197 phone: the grey note (e.g. "PO date: 07-07-2026") sits under the title, date box alone on the right */
@media (max-width:820px){ .pd-row.pd-rd{grid-template-areas:"l b" "h b" "e e";row-gap:0;margin-bottom:6px} .pd-row.pd-rd > .pd-l{grid-area:l} .pd-row.pd-rd > .md-date{display:contents}
  .pd-row.pd-rd .md-dt{grid-area:b;align-self:start} .pd-row.pd-rd .md-hint{grid-area:h;font-size:12.5px;line-height:1.35;margin-top:2px} .pd-row.pd-rd .md-hint .hs,.pd-row.pd-rd .md-hint .hv{display:block;white-space:nowrap} .pd-row.pd-rd > .pd-l{padding-top:2px} .pd-row.pd-rd .md-err{grid-area:e;margin-top:4px} }
.cap-row{display:grid;grid-template-columns:minmax(0,1fr) 18px minmax(0,1fr) 36px;gap:8px;align-items:center;margin-top:6px}
.cap-row.cap-hd{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.05em;margin-top:2px}
.cap-ar{color:var(--muted);font-weight:700;text-align:center}
.gen-f{max-width:420px}.gen-ex{margin:10px 0 0;font-size:15px}.gen-ex code{font-family:var(--mono,monospace);background:var(--ground,#F5F7FA);border:1px solid var(--divider,#D5DBE1);border-radius:4px;padding:1px 6px}
.cap-mod{display:flex;align-items:center;gap:6px;min-width:0}.cap-mod .inp{flex:1;min-width:0}.cap-mod b{min-width:0;overflow-wrap:anywhere}
.cap-link{flex:none;font-size:11.5px;font-weight:700;color:#1e3a5f;background:#dbe6f3;border:1px solid #9fb6d1;border-radius:999px;padding:1px 8px;white-space:nowrap}.cap-link[hidden]{display:none}
@media (max-width:820px){ .cap-row{grid-template-columns:minmax(0,1fr) 12px minmax(0,1.15fr) 36px;gap:5px} .cap-row .inp{font-size:16px;padding-left:8px;padding-right:8px} .cap-mod{flex-wrap:wrap;gap:4px} .cap-mod .inp{flex:1 1 100%} }
.md-acts{display:flex;gap:8px;justify-content:flex-end;padding-top:12px}.md-acts .qc-back2{margin-right:auto}
.md-saved{margin-top:14px}.md-create{margin-bottom:14px}
.md-sv{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"t a" "m a";gap:2px 12px;align-items:center;padding:10px 0;border-bottom:1px solid var(--divider)}
.md-sv:last-child{border-bottom:0}.md-sv.on{background:var(--surface-2);margin:0 -10px;padding:10px;border-radius:6px}
.md-sv-t{grid-area:t;display:flex;flex-wrap:wrap;gap:4px 12px;align-items:center;font-weight:600}.md-sv-t .fno{font-family:var(--mono)}
.md-sv-m{grid-area:m;font-size:13px;color:var(--muted)}.md-sv-a{grid-area:a;display:flex;gap:6px}
.md-editing{border-color:var(--steel);border-width:2px}
@media (max-width:820px){ .md-acts .btn{flex:1 1 0;justify-content:center;min-width:0;white-space:normal;text-align:center;padding-left:6px;padding-right:6px;gap:5px} .md-acts{gap:6px}   /* v237: buttons stay inside the box (long labels wrap) */ .md-sv{grid-template-columns:minmax(0,1fr);grid-template-areas:"t" "m" "a"} .md-sv-a{margin-top:6px} }
.toc-fixed{display:flex;flex-wrap:wrap;gap:4px 14px;align-items:baseline;padding:8px 0;border-bottom:2px solid var(--divider);font-weight:600;color:var(--muted)}.toc-fixed .k{font-weight:400;font-size:12.5px}
.toc-r{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:6px 0;border-bottom:1px solid var(--divider);font-size:14px}
.toc-r.lv1{padding-left:20px}.toc-r.lv2{padding-left:40px}.toc-r.head.lv1,.toc-r.head.lv2{padding-left:10px}
.toc-r.head{background:var(--surface-2);border-left:4px solid var(--steel);padding-left:10px;padding-right:8px;margin-top:6px;border-radius:4px}.toc-r.head.lv1{margin-left:20px}.toc-r.head.lv2{margin-left:40px}.toc-r.head .toc-t{font-weight:700;color:var(--ink);font-size:14.5px}   /* v211: section headings = shaded band, dark text (readable in light + dark) */
@media (max-width:820px){ .toc-r.head.lv1{margin-left:14px}.toc-r.head.lv2{margin-left:28px} }
.toc-f{display:flex;gap:8px;align-items:center;justify-content:flex-end;white-space:nowrap}.toc-f .mono{font-family:var(--mono);font-size:13px}
.toc-ok{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:3px;background:var(--ok-bg);color:#fff;font-size:12px;font-weight:700}
.toc-nf{font-size:11.5px;padding:2px 6px}   /* v761: was 10.5px */
.toc-ed{display:flex;flex-direction:column;gap:6px}
.toc-er{display:grid;grid-template-columns:72px minmax(0,1fr) 120px auto;gap:6px;align-items:center;padding-left:calc(var(--lv,0)*18px)}
.toc-lv,.toc-ac{display:flex;gap:4px;align-items:center}
@media (max-width:820px){ .toc-r.lv1{padding-left:14px}.toc-r.lv2{padding-left:28px}
  .toc-er{grid-template-columns:minmax(0,1fr) 96px;grid-template-areas:"t f" "l a";border:1px solid var(--divider);border-radius:6px;padding:8px;margin-left:calc(var(--lv,0)*12px)}
  .toc-er .toc-ti{grid-area:t}.toc-er .toc-fn{grid-area:f}.toc-er .toc-lv{grid-area:l}.toc-er .toc-ac{grid-area:a;justify-content:flex-end}
  .toc-er .inp{font-size:16px} .toc-er .icon-btn{min-width:36px;min-height:36px} .toc-er .toc-fn .inp{padding-left:6px;padding-right:6px} }
.md-tabs{margin:0 0 12px;display:flex}.md-tabs button{flex:1 1 0}
.md-tocsum{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center;padding:8px 0;border-bottom:2px solid var(--divider);font-size:14px}.md-tocsum .n{font-weight:700}.md-onlyused{margin-left:auto}
.md-tr{grid-template-columns:24px 24px minmax(0,1fr) 36px 44px;column-gap:6px;cursor:default}   /* v1182 (Kah Poh): the hand only on the tick box (and buttons) — the line itself does not tick */
.md-tr .md-cb{cursor:pointer}
.md-pv{width:36px;height:32px;padding:0;display:inline-grid;place-items:center;border:1px solid var(--steel);border-radius:6px;background:var(--surface);color:var(--steel);cursor:pointer}.md-pv svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}@media (hover:hover){ .md-pv:hover{background:var(--steel);color:#fff} }
.md-tr.md-fx{color:var(--muted);cursor:default}
.md-tr .md-cb{width:22px;height:22px;margin:0;accent-color:#3A1F8F}
.md-sec{font-family:var(--mono);font-size:12px;font-weight:600;color:var(--ink);letter-spacing:-.03em;white-space:nowrap;overflow:visible}   /* v243: narrow column; long numbers (3.1.1) run into the indent of their sub-row */
.md-fno{font-family:var(--mono);font-size:12px;color:var(--muted);margin-right:8px;white-space:nowrap}
.md-sh{text-align:center;font-size:13px;color:var(--muted)}
.md-shi{width:44px;text-align:center;min-height:32px;padding:3px 2px}
.md-shi.md-auto{display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--divider);border-radius:6px;background:var(--surface-2);color:var(--ink);font-family:var(--mono);font-weight:600;cursor:default}
.md-tr:not(.inc):not(.md-fx) .toc-t{color:var(--muted)}
.md-toc .toc-r.lv1{padding-left:0}.md-toc .toc-r.lv2{padding-left:0}.md-toc .toc-r.lv1 .toc-t{padding-left:16px}.md-toc .toc-r.lv2 .toc-t{padding-left:32px}
.md-toc .toc-r.head{margin-left:0!important;padding-left:6px}
@media (max-width:820px){ .md-tr{grid-template-columns:24px 20px minmax(0,1fr) 34px 40px;gap:6px 4px} .md-pv{width:34px;height:34px} .md-shi{width:40px;font-size:16px;min-height:34px} .md-toc .toc-r.lv1 .toc-t{padding-left:10px}.md-toc .toc-r.lv2 .toc-t{padding-left:20px} }
.md-open{margin-left:10px;min-height:30px!important;padding:3px 10px!important;vertical-align:middle}
.cf-ov{position:fixed;inset:0;z-index:90;background:rgba(10,20,35,.55);display:grid;place-items:center;padding:16px}
.cf-box{background:var(--surface);color:var(--ink);border:2px solid #3A1F8F;border-radius:10px;padding:18px;max-width:420px;width:100%;box-shadow:0 12px 40px rgba(0,0,0,.35)}
.cf-t{font-family:var(--cond);font-weight:700;font-size:18px;margin-bottom:8px}.cf-box p{margin:0 0 8px;font-size:15px}.cf-box .k{color:var(--muted);font-size:13.5px}
.cf-acts{display:flex;gap:8px;justify-content:flex-end;margin-top:12px}.cf-acts .btn{flex:1 1 0;justify-content:center}
.qc-top{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:12px}.qc-top .k{color:var(--muted);font-weight:600}
.qc-addr div{font-weight:600}
.qc-h{margin:14px 0 6px;font-weight:600}
.qc-checks{display:flex;flex-direction:column;gap:2px;margin-bottom:12px}
.qc-ck{display:flex;width:fit-content;max-width:100%;align-items:center;gap:10px;font-size:15px;min-height:36px;cursor:pointer}   /* v1097 (Kah Poh): tap area = box + text only, not the empty space */.qc-ck input{width:22px;height:22px;margin:0;accent-color:#3A1F8F}
table.qc-items th,table.qc-items td{padding:6px 8px}table.qc-items td:first-child,table.qc-items th:first-child{width:48px}table.qc-items td:last-child,table.qc-items th:last-child{width:110px;text-align:right}
.qc-rem{margin-top:12px;display:flex;flex-direction:column;gap:4px}.qc-rem textarea{font-size:15px;font-family:var(--sans);line-height:1.45}
.qc-sign{display:grid;grid-template-columns:1fr 1fr;gap:10px 24px;margin-top:12px}.qc-st{font-weight:700;margin:6px 0 2px}
@media (max-width:820px){ .qc-sign{grid-template-columns:1fr} .qc-rem textarea{font-size:16px} }
/* v225: sign-off boxes — Name / Date caption close to its box, box uses the full width */
.qc-sign .md-row{grid-template-columns:52px 12px minmax(0,1fr)}
.qc-sign .md-v .inp{max-width:none}
.qc-sign .md-date .md-dt{flex:1 1 140px;max-width:none!important}
@media (max-width:820px){ .qc-sign .md-row{grid-template-columns:52px minmax(0,1fr);gap:0 8px;align-items:center} .qc-sign .md-row .md-l{font-size:13px} }
/* A4 sheet for QC forms (794 x 1123 px) */
.qc-sheet{position:absolute;left:0;top:0;width:794px;height:1123px;transform-origin:0 0;background:#fff;color:#000;box-shadow:0 4px 18px rgba(0,0,0,.35);padding:40px 44px;box-sizing:border-box;font-family:"Times New Roman",Times,serif;font-size:15px;display:flex;flex-direction:column}
.qc-sheet *{box-sizing:border-box}.qc-sheet > *{flex:none}.qc-sheet > .qs-signs{flex:1 1 auto;align-items:end}
.qs-head{display:grid;grid-template-columns:76px 1fr 160px;border:1.5px solid #000;align-items:stretch}
.qs-logo{display:grid;place-items:center;padding:6px}.qs-logo img{max-width:60px;max-height:56px;object-fit:contain}
.qs-tt{padding:8px 4px}.qs-co{font-weight:700;font-size:16px}.qs-ti{font-weight:700;font-size:21px;letter-spacing:.01em}
.qs-ref{border-left:1.5px solid #000;display:flex;flex-direction:column;justify-content:center;align-items:center;font-weight:700;font-size:14px;gap:8px}
.qs-info{display:grid;grid-template-columns:1fr 250px;gap:0 18px;border:1.5px solid #000;border-top:0;padding:12px 6px 14px}
.qs-l{display:grid;grid-template-columns:72px 12px 1fr;align-items:end;margin-top:6px}.qs-k{font-size:14px}.qs-v{border-bottom:1px solid #000;min-height:20px;font-size:14px}.qs-v.b{font-weight:700}
.qs-right .qs-l{grid-template-columns:78px 12px 1fr}.qs-right{padding-top:46px}
.qs-la{align-items:start}.qs-la .qs-k,.qs-la .qs-c{padding-top:4px}.qs-addr{border-bottom:0}.qs-addr div{border-bottom:1px solid #000;min-height:22px;padding-top:2px}
.qs-mid{border:1.5px solid #000;border-top:0;padding:14px 0 10px}
.qs-intro{text-align:center;margin-bottom:10px}
.qs-ck{display:grid;grid-template-columns:150px 1fr;align-items:center;margin:7px 0}.qs-box{justify-self:end;margin-right:56px;width:20px;height:18px;border:1px solid #000;display:grid;place-items:center;font-size:14px;line-height:1}
.qs-tb{width:100%;border-collapse:collapse;font-size:14px}.qs-tb th,.qs-tb td{border:1.5px solid #000;padding:3px 6px;height:28px;color:#000;background:#fff;text-transform:none;letter-spacing:0;font-size:14px}
.qs-tb th{font-weight:700;text-align:center}.qc-sheet .qs-tb tr:last-child td{border-bottom:1.5px solid #000}.qs-tb td:first-child{width:80px;text-align:center}.qs-tb td:last-child{width:130px;text-align:center}.qs-tb th:first-child{width:80px}.qs-tb th:last-child{width:130px}
.qs-rem{display:grid;grid-template-columns:86px 1fr;gap:4px;margin-top:22px;font-size:14.5px}
.qs-signs{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:auto;padding:0 10px 10px}
.qs-sg{display:flex;flex-direction:column;align-items:stretch}.qs-stamp{height:96px;display:grid;place-items:center}.qs-stamp img{max-height:92px;max-width:110px;object-fit:contain;opacity:.92}
.qs-sl{border-top:1px solid #000;margin:0 10px}.qs-sc{text-align:center;margin:2px 0 8px}
.qs-sn{display:grid;grid-template-columns:60px 1fr;gap:6px;margin:6px 0}.qs-sn span:first-child{text-align:right}.qs-u{border-bottom:1px solid #000;text-align:center;min-height:20px}
.mp-wrap{margin:0 auto;display:flex;flex-direction:column;gap:14px}
.mp-slot{position:relative;overflow:hidden}
.mp-page::before{content:"";position:absolute;inset:16px;border:1.5px dashed #2457E6;pointer-events:none}
.mp-page{padding:44px 52px}
.mp-logos{display:flex;justify-content:space-between;align-items:center;height:78px}.mp-logos img{max-height:74px;max-width:180px;object-fit:contain}
.mp-co{text-align:center;font-weight:700;font-size:22px;margin-top:6px}.mp-addr{text-align:center;font-size:12.5px;line-height:1.4;padding:0 40px}
.mp-title{text-align:center;font-weight:700;font-size:18px;text-decoration:underline;margin:16px 0 18px}
.mp-fields{display:flex;flex-direction:column;gap:13px;font-size:13.5px}.mp-f{display:grid;grid-template-columns:200px 14px 1fr}
.mp-sign{display:grid;grid-template-columns:110px 14px 1fr 1fr 1fr;gap:14px 10px;margin-top:30px;font-size:12.5px;align-items:end}
.mp-sh{text-align:center}.mp-sv{border-bottom:1px solid #000;text-align:center;min-height:20px}.mp-sv img{max-height:84px;max-width:96px;object-fit:contain;opacity:.92}
.mp-tf{gap:6px;margin-bottom:14px}.mp-tf .mp-f{grid-template-columns:170px 14px 1fr}.mp-tf b{border-bottom:1px solid #000}
.mp-tt{width:100%;border-collapse:collapse;font-size:13px}.mp-tt th,.mp-tt td{border:1px solid #000;padding:3px 6px;color:#000;background:#fff;text-transform:none;letter-spacing:0;font-size:13px;height:24px}
.mp-tt th{font-weight:400;text-align:center}.mp-tt td:nth-child(n+2){text-align:center;width:80px}.mp-tt th:nth-child(n+2){width:80px}.qc-sheet .mp-tt tr:last-child td{border-bottom:1px solid #000}
.mp-total{text-align:right;margin-top:10px;font-size:14px}
.mp-sec{align-items:center;text-align:center}.mp-secno{font-weight:700;font-size:40px;margin-top:40px}.mp-sect{font-weight:700;font-size:24px;margin-top:50px;padding:0 60px;line-height:1.3}
.mp-end{font-weight:700;font-size:24px;margin-top:150px}
.mp-hold-in{margin:auto;text-align:center;border:2px dashed #8A96A3;border-radius:10px;padding:40px 30px;width:80%;color:#333}
.mp-hold-f{font-weight:700;font-size:18px}.mp-hold-t{font-size:22px;font-weight:700;margin:10px 0}.mp-hold-n{font-size:17px}.mp-hold-k{font-size:13px;color:#6B7785;margin-top:14px;font-family:Arial,sans-serif}
.md-foldall{min-width:128px;justify-content:center}
/* v241 MDR signing parties */
.md-subh{margin:16px 0 2px;padding-top:12px;border-top:2px solid var(--divider);font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.q8-ct{align-self:center;font-weight:600;padding:0 4px}.q8-ct[hidden]{display:none}
.md-jobrow{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.md-sign{display:flex;gap:8px;flex-wrap:wrap}.md-sign .inp{flex:1 1 200px;min-width:0;max-width:none}.md-sign select.inp{flex:1 1 100%}
/* v253 QC008 Material Traceability Record — A4 landscape sheet (1123 x 794) */
.qc-sheet.q8-sheet{width:1123px;height:794px;padding:30px 30px 44px;font-size:14px}
.q8-head{display:grid;grid-template-columns:74px 1fr 150px;border:1.5px solid #000;border-bottom:0}   /* v1144 (Kah Poh): the form no. / MDR Section box is more compact (was 190px) — standard for every landscape form */
.q8-logo{display:grid;place-items:center;padding:4px}.q8-logo img{max-width:58px;max-height:50px;object-fit:contain}
.q8-tt{padding:5px 4px}.q8-co{font-weight:700;font-size:14px}.q8-ti{font-weight:700;font-size:21px;letter-spacing:.01em;line-height:1.2}
.q8-ref{border-left:1.5px solid #000;display:flex;flex-direction:column;justify-content:center;align-items:flex-end;padding:4px 8px;font-weight:700;font-size:13px;gap:4px}
.q8-info{display:grid;grid-template-columns:1.05fr 1.45fr 1.05fr 1.05fr;border:1.5px solid #000}
.q8-c{display:flex;flex-direction:column;border-right:1px solid #000}
.q8-kv{display:grid;grid-template-columns:92px 12px minmax(0,1fr);align-items:center;padding:2px 6px;min-height:28px;border-bottom:1px solid #000}.q8-kv:last-child{border-bottom:0}.q8-kv b{overflow-wrap:anywhere}
.q8-sg{position:relative;border-right:1px solid #000;padding:3px 6px;min-height:84px}.q8-sg:last-child{border-right:0}
.q8-sgk{font-size:13.5px}.q8-st{position:absolute;inset:0;display:grid;place-items:center;pointer-events:none}.q8-st img{max-height:76px;max-width:120px;object-fit:contain;opacity:.92}
.q8-st img.stamp-rd{width:76px;height:76px;max-width:none}
.q8-sgn{position:absolute;left:6px;right:6px;bottom:3px;font-size:13px;line-height:1.2}
.qc-sheet > .q8-draw,.mf-fr > .q8-draw{flex:1 1 auto;min-height:0;border:1.5px solid #000;border-top:0;display:flex;flex-direction:column;padding:10px 14px 8px}
.q8-img{flex:1 1 auto;position:relative;min-height:0}.q8-img img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain}
.q8-none{position:absolute;inset:0;display:grid;place-items:center;color:#8A96A3;font-family:Arial,sans-serif;font-size:15px}
.q8-leg{font-size:13.5px;line-height:1.35;padding-top:4px}
/* v301 QC002b Mill Certificates sheet (A4 portrait) */
.qc-sheet.q2b-sheet{padding:30px 34px 34px}
/* v331 QC016 results — compact rows, captions once */
.q16-rl{display:flex;flex-direction:column;margin:8px 0 4px;border:1px solid var(--divider);border-radius:6px;background:var(--surface)}
.q16-r{display:grid;grid-template-columns:30px minmax(80px,1fr) 118px 96px 196px minmax(110px,1.4fr) 36px;gap:6px;align-items:center;padding:5px 8px;border-top:1px solid var(--divider)}
.q16-r:first-child{border-top:0}
.q16-rh .ph-only{display:none}
@media (max-width:820px){ .q16-rh .ph-only{display:inline} .q16-rh .dk-only{display:none} }
.q16-rh{font-size:12.5px;font-weight:600;color:var(--muted);padding-top:7px;padding-bottom:5px}
.q16-r .inp{min-height:38px;padding:5px 8px;width:100%;min-width:0}.q16-r select.inp{padding-right:4px}
.q16-c-no{text-align:center;color:var(--muted)}.q16-r .q16-c-del{width:34px;height:34px}
.q16-r .q16-seg{gap:4px}.q16-r .q16-sb{min-height:38px;padding:0 8px;font-size:13.5px;flex:1 1 0}
@media (max-width:820px){
  .q16-r{grid-template-columns:20px minmax(0,1fr) 84px 58px 32px;grid-template-areas:"no joint proc len del" ". ev ev rmk rmk";row-gap:5px;padding:6px}
  .q16-rh{grid-template-areas:"no joint proc len del" ". ev ev rmk rmk";row-gap:2px}
  .q16-c-no{grid-area:no}.q16-c-joint{grid-area:joint}.q16-c-proc{grid-area:proc}.q16-c-len{grid-area:len}.q16-c-del{grid-area:del}.q16-c-ev{grid-area:ev}.q16-c-rmk{grid-area:rmk}
  .q16-r .q16-c-ev{min-width:0}.q16-r .q16-sb{padding:0 4px;font-size:13px}
  .q16-r .inp{padding:5px 6px} .q16-r .q16-c-del{width:32px;height:32px}
}
/* v333 QC016a Dye Penetrant Inspection Map (A4 portrait) */
.q16a-info{display:grid;grid-template-columns:1.25fr 1fr .85fr;grid-template-rows:repeat(3,30px) 30px;border:1.5px solid #000;border-top:0;font-size:14px}
.q16a-kv{display:grid;grid-template-columns:96px 12px minmax(0,1fr);align-items:center;padding:0 6px;border-bottom:1px solid #000;border-right:1px solid #000;grid-column:1}
.q16a-kv.r1{grid-row:1}.q16a-kv.r2{grid-row:2}.q16a-kv.r3{grid-row:3}.q16a-kv.r4{grid-row:4;grid-column:1 / 3;border-bottom:0}
.q16a-sg{position:relative;padding:3px 6px;border-bottom:1px solid #000;grid-row:1 / 4}.q16a-p{grid-column:2;border-right:1px solid #000}.q16a-r{grid-column:3}
.q16a-sgn{position:absolute;left:6px;right:6px;bottom:3px;font-size:13px;line-height:1.2;text-align:center}
.q16a-sh{grid-column:3;grid-row:4;display:flex;gap:5px;align-items:center;justify-content:flex-end;padding:0 8px;border-left:1px solid #000}
.q2b-frame > .q16a-draw{flex:1 1 auto;min-height:0;position:relative;border:1.5px solid #000;border-top:0}
.q16a-draw img{position:absolute;inset:10px;width:calc(100% - 20px);height:calc(100% - 20px);object-fit:contain;display:block}.q16a-draw .q8-none{position:absolute;inset:0;display:grid;place-items:center}
/* v324 QC016 Dye Penetrant Inspection Report (A4 portrait, same frame as QC002b) */
.q16-ti{font-size:20px;text-transform:uppercase}
.q16-dh{display:flex;justify-content:space-between;align-items:baseline;margin-bottom:6px}.q16-dh .q2b-dt{margin:0}
.q16-desc .q2b-dl{grid-template-columns:270px 1fr;line-height:1.3}
.q16-info{border:1.5px solid #000;border-top:0;padding:8px 10px 6px;font-size:14px}
.q16-ir{display:grid;grid-template-columns:350px 14px 1fr;align-items:end;margin-bottom:9px}
.q16-ik{white-space:nowrap}.q16-ic{text-align:center}
.q16-iv{display:flex;gap:14px;border-bottom:1px solid #000;min-height:19px;padding-left:4px}
.q16-dates{grid-template-columns:350px 26px 1fr;align-items:start}.q16-dn{display:flex;flex-direction:column;gap:5px;text-align:right;padding-right:4px}.q16-dv{display:flex;flex-direction:column;gap:5px}
.q16-dtt{margin:4px 0 3px}
.q16-det{display:grid;grid-template-columns:1fr 1fr;gap:0 22px;font-size:13.5px}.q16-dcol{display:grid;grid-template-columns:150px 1fr;gap:2px 10px;align-content:start}
.q16-dl{white-space:nowrap}.q16-dv2{border-bottom:1px solid #000;font-weight:700;min-height:18px}
.q16-rt{font-weight:700;font-size:14px;padding:6px 0 0 2px;border-left:1.5px solid #000;border-right:1.5px solid #000}
.qc-sheet .q16-tb{border-top:1.5px solid #000}
.qc-sheet table.q16-tb th{line-height:15px;height:auto;padding:1px 4px;font-weight:400}
.qc-sheet .q16-tb td{height:18.5px}
.q16-tb th:first-child,.q16-tb td:first-child{width:62px}.q16-tb th:last-child,.q16-tb td:last-child{width:150px}.qc-sheet .q16-tb td.q16-ck{font-size:15px;width:72px}
.q16-sig{flex:1 1 auto;display:grid;grid-template-columns:1fr 1fr;border:1.5px solid #000;border-top:0;font-size:14px}
.q16-sc{display:flex;flex-direction:column;padding:10px 10px 6px}
.q16-st{flex:1 1 auto;min-height:56px;display:flex;align-items:center;justify-content:center}.q16-st img{max-height:84px;max-width:110px;object-fit:contain;opacity:.92}.q16-st img.stamp-rd{width:84px;height:84px;max-width:none}
.q16-sl{border-top:1px solid #000;margin:0 10px 0 70px}.q16-sn{display:grid;grid-template-columns:58px 1fr;gap:6px;margin-top:4px}.q16-sn span:first-child{text-align:right}
/* editor */
.q16-dp{display:flex;flex-wrap:wrap;gap:8px;align-items:flex-start}.q16-dp > .inp{flex:1 1 140px;min-width:0}
.q2-grid.q16-grid .q16-joint,.q2-grid.q16-grid .q16-proc{flex:1 1 90px}.q2-grid.q16-grid .q16-len{flex:0 0 96px}.q2-grid.q16-grid .q16-rmk{flex:2 1 140px}.q2-grid.q16-grid .q16-ev{flex:0 0 auto}
.q16-insg{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:8px 0 4px;align-items:end}.q16-insg.q16-ins3{grid-template-columns:2fr 1fr 1fr;margin-top:10px}
.q16-insg .q2-f label{font-size:13px;text-transform:none;letter-spacing:0}
.q16-insg .q16-dp{flex-wrap:nowrap;gap:6px}.q16-insg .q16-dp .md-date{flex:0 0 auto}.q16-insg .q16-dp .md-dt{width:calc(10ch + 26px);max-width:none}.q16-insg .q16-dp > .inp{flex:1 1 0;min-width:0}
@media (max-width:820px){ .q16-insg{grid-template-columns:1fr} .q16-insg.q16-ins3{grid-template-columns:1fr 1fr} .q16-insg.q16-ins3 .q16-iname{grid-column:1 / -1} }
.q16-detg{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:8px 0 4px}.q16-detc{display:flex;flex-direction:column;gap:10px;min-width:0}.q16-detg .q2-f label{font-size:13px;text-transform:none;letter-spacing:0}
.q16-evl{font-size:12.5px;font-weight:600;color:var(--muted)}
.q16-seg{display:flex;gap:6px}.q16-sb{min-height:44px;padding:0 12px;border-radius:6px;border:1.5px solid var(--frame);background:var(--surface);color:var(--ink);font-weight:700;font-size:14px;cursor:pointer;white-space:nowrap}
.q16-sb.q16-acc.on{background:#1F6FB2;border-color:#1F6FB2;color:#fff}.q16-sb.q16-rej.on{background:#C62828;border-color:#C62828;color:#fff}
@media (max-width:820px){ .q2-grid.q16-grid .q16-joint,.q2-grid.q16-grid .q16-proc{flex:1 1 40%} .q2-grid.q16-grid .q16-rmk{flex:1 1 100%} }
@media (max-width:560px){ .q16-it .q2-ih .q8-ac{flex-direction:row} .q2-grid.q16-grid .q16-len{flex:0 0 84px} .q2-grid.q16-grid .q16-ev{flex:1 1 0;min-width:0} .q16-seg .q16-sb{flex:1 1 0;padding:0 6px;min-width:0} }

/* v317: mill certificate copy page (portrait 794×1123 or landscape 1123×794) — the image as big as the page allows, room for the MDR footer */
.qc-sheet.q2b-cert{padding:0}.qc-sheet.pg-land{width:1123px;height:794px}
.q2b-cimg{flex:1;min-height:0;display:flex;align-items:center;justify-content:center}.q2b-cimg img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.q2b-frame{flex:1 1 auto;display:flex;flex-direction:column;border:1.5px solid #000;padding:6px}
.q2b-frame > *{flex:none}
.q2b-head{border:1.5px solid #000}.q2b-ti{font-size:20px}
.q2b-cp{border:1.5px solid #000;border-top:0;padding:4px 8px 6px}
.q2b-cl{display:grid;grid-template-columns:84px 1fr;white-space:nowrap;align-items:end;margin-top:3px;font-size:14px}.q2b-ck{text-align:right;padding-right:6px}.q2b-cv{border-bottom:1px solid #000;font-weight:700;min-height:18px;width:85%}
.q2b-desc{border:1.5px solid #000;border-top:0;padding:8px 8px 12px;font-size:14px}
.q2b-dt{font-weight:700;margin-bottom:8px}
.q2b-dl{display:grid;grid-template-columns:250px 1fr;gap:6px;line-height:1.35}.q2b-dk{text-align:right}
.q2b-tb{width:100%;border-collapse:collapse;font-size:14px;border:1.5px solid #000;border-top:0}
.qc-sheet .q2b-tb th,.qc-sheet .q2b-tb td{border:1px solid #000;padding:0 6px;height:18.5px;line-height:17px;text-align:center;color:#000;background:#fff;text-transform:none;letter-spacing:0;font-size:14px}
.qc-sheet .q2b-tb th{font-weight:700}
.q2b-tb th:first-child,.q2b-tb td:first-child{width:62px}.q2b-tb th:last-child,.q2b-tb td:last-child{width:96px}
.qc-sheet .q2b-tb .q2b-tot td:first-child{text-align:right;width:auto}
.q2b-rep{flex:1 1 auto;display:flex;flex-direction:column;border:1.5px solid #000;border-top:0;padding:10px 8px 6px;font-size:14px}
.q2b-rk{font-weight:700}.q2b-st{flex:1 1 auto;min-height:60px;display:flex;align-items:center;padding-left:200px}.q2b-st img{max-height:84px;max-width:110px;object-fit:contain;opacity:.92}.q2b-st img.stamp-rd{width:84px;height:84px;max-width:none}
.q2b-sl{border-top:1px solid #000;width:230px;margin-left:70px}
.q2b-sn{display:grid;grid-template-columns:62px 1fr;gap:6px;margin-top:4px}.q2b-sn span:first-child{text-align:right}
/* QC002b editor list */
.q2b-ed{width:100%;border-collapse:collapse;margin:6px 0 4px;font-size:15px}.q2b-ed th,.q2b-ed td{border-bottom:1px solid var(--divider);padding:6px 8px;text-align:left}.q2b-ed th{font-size:12.5px;color:var(--muted);text-transform:uppercase;letter-spacing:.05em}
.q2b-ed td:first-child,.q2b-ed th:first-child{width:52px}.q2b-ed td:nth-child(4),.q2b-ed th:nth-child(4){width:70px;text-align:center}
@media (min-width:561px){ .q2b-ed td.q2b-tl{text-align:right} .q2b-ed td.q2b-tv{width:70px;text-align:center} }   /* v321: desktop — Pages centred, total under the Pages column, caption right next to it */.q2b-ed .q2b-cpc{width:190px;text-align:right}
/* v319: Insert / inserted pages per certificate line */
.q2b-cpw{display:inline-flex;align-items:center;gap:4px;justify-content:flex-end}.q2b-chip{min-height:32px;padding:3px 9px;border-radius:5px;border:1.5px solid var(--steel);background:var(--steel);color:#fff;font-weight:700;font-size:13px;cursor:pointer;white-space:nowrap}.q2b-chip.warn{background:#F2C230;border-color:#F2C230;color:#1C2530}.q2b-cpw .icon-btn{width:32px;height:32px}.q2b-ins{white-space:nowrap}.q2b-edt td{font-weight:700}
@media (max-width:560px){ .q2b-ed,.q2b-ed tbody{display:block;width:100%} .q2b-ed thead{display:none} .q2b-ed tr{display:grid;grid-template-columns:30px minmax(0,1fr) minmax(0,1fr) 34px;gap:6px;border-bottom:1px solid var(--divider);padding:6px 0} .q2b-ed td,.q2b-ed td:first-child,.q2b-ed td:last-child{border:0;padding:2px 0;width:auto;overflow-wrap:anywhere;font-size:14.5px} .q2b-ed td:last-child{text-align:right} .q2b-ed .q2b-edt{grid-template-columns:minmax(0,1fr) 60px} }
@media (max-width:560px){ .q2b-ed td:nth-child(4){text-align:right;width:auto} .q2b-ed td.q2b-cpc{grid-column:2 / -1;text-align:right;width:auto;padding-top:0} .q2b-ed .q2b-edt td.q2b-cpc{display:none} }   /* v319: Insert / pages on its own line under the certificate */
/* v302 remove confirmation */
.rm-ask{position:fixed;z-index:220;box-sizing:border-box;width:280px;max-width:calc(100vw - 16px);background:var(--surface,#fff);border:2px solid #C62828;border-radius:10px;box-shadow:0 10px 28px rgba(28,37,48,.28);padding:8px;display:flex;flex-direction:column;gap:8px}
.rm-q{margin:0;padding:0 2px;font-weight:700;color:var(--ink,#1C2530);font-size:14.5px;line-height:1.3;overflow-wrap:anywhere}   /* v1173 (Kah Poh: "the message box is not full, don't know what it wants to say"): the WHOLE question shows (was cut after 2 lines with …) */
.rm-b{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:0}
.rm-b .btn{min-height:42px;font-size:15px;padding:0 10px;justify-content:center;width:100%;margin:0}.rm-b .btn svg{width:16px;height:16px}
/* v291 photo viewer */
.pv-thumb{padding:0;cursor:zoom-in;font:inherit}@media (hover:hover){ .pv-thumb:hover{border-color:var(--link,#2457E6);box-shadow:0 0 0 2px rgba(36,87,230,.25)} }
.pv-ov{position:fixed;inset:0;z-index:200;background:rgba(15,18,22,.88);display:flex;flex-direction:column}
.pv-top{display:flex;align-items:center;gap:10px;padding:10px 14px;padding-top:calc(10px + env(safe-area-inset-top,0px));color:#fff}
.pv-cap{flex:1;min-width:0;font-weight:600;font-size:15px;overflow-wrap:anywhere}
.pv-x{width:44px;height:44px;border-radius:8px;border:1px solid rgba(255,255,255,.5);background:rgba(255,255,255,.08);color:#fff;display:grid;place-items:center;cursor:pointer;flex:none}.pv-x svg{width:20px;height:20px;stroke:currentColor}
.pv-stage{flex:1 1 0;min-height:0;display:flex;flex-direction:column;gap:10px;align-items:center;justify-content:center;overflow:hidden;padding:8px 14px calc(14px + env(safe-area-inset-bottom,0px))}
.pv-img{display:block;width:auto;height:auto;max-width:100%;max-height:calc(100vh - 100px);max-height:calc(100dvh - 100px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));min-height:0;flex:0 1 auto;object-fit:contain;background:#fff;border-radius:4px;box-shadow:0 8px 30px rgba(0,0,0,.5)}
.pv-heat{position:relative;z-index:2;flex:none;display:flex;align-items:baseline;gap:10px;background:#fff;color:#1C2530;border-radius:8px;padding:8px 16px;box-shadow:0 4px 16px rgba(0,0,0,.4);max-width:100%}.pv-heat[hidden]{display:none}
.pv-hk{font-size:13px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:#3A1F8F;white-space:nowrap}.pv-heat b{font-size:24px;letter-spacing:.04em;overflow-wrap:anywhere}
.pv-zoom{display:flex;align-items:center;border:1px solid rgba(255,255,255,.5);border-radius:8px;overflow:hidden;flex:none}
.pv-zb{min-width:44px;height:44px;border:0;background:rgba(255,255,255,.08);color:#fff;font-size:22px;font-weight:700;cursor:pointer;padding:0 8px}.pv-zb+.pv-zb{border-left:1px solid rgba(255,255,255,.35)}
.pv-zb:disabled{opacity:.35;cursor:default}.pv-pct{font-size:14px;min-width:62px}
.pv-img{touch-action:none;user-select:none;-webkit-user-select:none;transform-origin:center center;cursor:zoom-in;will-change:transform}.pv-img.zoomed{cursor:grab}
.pv-stage{touch-action:none}
@media (max-width:560px){ .pv-cap{font-size:13.5px} .pv-zb{min-width:40px} .pv-pct{min-width:54px} }
.pv-nav{position:absolute;top:50%;transform:translateY(-50%);width:48px;height:64px;border:0;border-radius:8px;background:rgba(31,58,95,.85);color:#fff;font-size:34px;line-height:1;cursor:pointer}
.pv-nav:disabled{opacity:.3;cursor:default}.pv-prev{left:10px}.pv-next{right:10px}
/* v289 QC002a sheet + editor */
.q2a-c .q8-kv{flex:1 1 auto}
.qc-sheet > .q2a-draw,.mf-fr > .q2a-draw{padding:2px}.q2a-draw .q8-img img{object-fit:fill}   /* v294: whole photo stretched to fill the box exactly (ratio not kept, nothing cut) */
.q2a-it{border:1px solid var(--divider);border-radius:6px;background:var(--surface);padding:8px 10px}
.q2a-body{display:grid;grid-template-columns:120px minmax(0,1fr);gap:12px;align-items:start;margin-top:4px}
.q2a-th{width:120px;height:84px}
.q2a-grid .q2a-mat{flex:2 1 0}.q2a-grid .q2a-heat{flex:2 1 0}.q2a-grid .q2a-src{flex:2 1 0}
.q2a-it .q2-ih .q8-ac{flex-direction:row}
@media (max-width:560px){ .q2a-body{grid-template-columns:84px minmax(0,1fr)} .q2a-th{width:84px;height:60px} .q2-grid.q2a-grid .q2-f{flex:1 1 100%} .q2a-it .q2-ih .q8-ac{flex-direction:row} }
/* QC008 editor: drawing sheets */
/* v267 QC002 Material Inspection Report (A4 landscape sheet + MDR form) */
.qc-sheet.q2-sheet{padding:24px 26px 40px;font-size:14px}
.q2-frame{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;border:3px double #000;padding:3px}
.q2-head{display:grid;grid-template-columns:74px 1fr 330px 170px;border:1.5px solid #000}
.q2-rep{border-left:1.5px solid #000;display:flex;align-items:center;gap:10px;padding:4px 12px;font-size:14px}.q2-rep b{font-size:15px}
.q2-info{display:grid;grid-template-columns:1fr 1fr;gap:0 60px;border:1.5px solid #000;border-top:0;padding:4px 24px 6px}
.q2-ln{display:grid;grid-template-columns:132px 1fr;align-items:end;min-height:27px}.q2-ln .k{text-align:right;padding-right:6px;white-space:nowrap}.q2-ln .v{border-bottom:1px solid #000;padding:0 4px;min-height:21px;overflow-wrap:anywhere}
.q2-tb{width:100%;border-collapse:collapse;table-layout:fixed;border:1.5px solid #000;border-top:0}
.q2-tb th,.q2-tb td{border:1px solid #000;text-align:center;vertical-align:middle;padding:1px 3px;line-height:1.15;overflow-wrap:anywhere}
.qc-sheet .q2-tb th{font-weight:400;font-size:14px;height:21px;text-transform:none;letter-spacing:0;color:#000;background:none;position:static;box-shadow:none;font-family:inherit;white-space:normal}.q2-tb th.q2-pg{font-size:13.5px}
.qc-sheet .q2-tb td{height:34px;font-size:14px;color:#000;background:none}.q2-tb td.q2-cert{font-size:13px}
.qc-sheet .q2-tb tr:last-child td{border-bottom:1.5px solid #000}
.q2-rvc{position:relative;overflow:visible}
.q2-stamp{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:-1;pointer-events:none}   /* v271: stamp sits behind the table lines and text */
.q2-stamp img{max-width:96px;max-height:100px;object-fit:contain;opacity:.92}.q2-stamp img.stamp-rd{width:98px;height:98px;max-width:none;max-height:none}
.q2-cal{border:1.5px solid #000;border-top:0;padding:4px 10px 8px;flex:1 1 auto}
.q2-calh{text-decoration:underline;font-size:14px;margin-bottom:4px}
.q2-calg{display:grid;grid-template-columns:1fr 1fr;gap:6px 40px;padding-left:30px}
.q2-calr{display:grid;grid-template-columns:24px 230px 170px;align-items:center;gap:6px;font-size:14px}.q2-calr .u{border-bottom:1px solid #000;min-height:20px;padding:0 4px}
.q2-calr .q2-box{width:22px;height:22px;border:1px solid #000;display:grid;place-items:center;font-size:15px}
/* form in the MDR */
.q2-list{display:flex;flex-direction:column;gap:10px;margin:8px 0}
.q2-it{border:1px solid var(--divider);border-radius:6px;background:var(--surface);padding:8px 10px}
.q2-ih{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.q2-grid{display:flex;flex-wrap:wrap;gap:8px 10px}.q2-br{flex-basis:100%;height:0}.q2-f{position:relative}.wide-tip{position:absolute;top:100%;z-index:6;margin-top:2px;padding:5px 8px;background:#3A1F8F;color:#fff;border-radius:6px;font-size:14px;line-height:1.35;overflow-wrap:anywhere;box-shadow:0 4px 14px rgba(28,37,48,.25)}.wide-tip[hidden]{display:none}.q2-f .inp.wide{position:relative;z-index:5;max-width:none;flex:none;box-shadow:0 4px 14px rgba(28,37,48,.18)}.q2-grid .q2-qty label,.q2-grid .q2-page label{white-space:nowrap;overflow:visible}
.q2-grid .q2-f{flex:2 1 0}.q2-grid .q2-desc{flex-grow:3}.q2-grid .q2-rmk{flex-grow:4}.q2-grid .q2-qty,.q2-grid .q2-page{flex:0 0 38px}.q2-grid .q2-d{flex:0 0 auto}.q2-grid .q2-qty .inp,.q2-grid .q2-page .inp{padding-left:2px;padding-right:2px;text-align:center}.q2-grid .q2-f.q2-d .md-dt{flex:0 0 auto;width:calc(10ch + 14px);padding-left:4px;padding-right:4px;letter-spacing:0;font-variant-numeric:tabular-nums}
.q2-f{display:flex;flex-direction:column;gap:3px;min-width:0}.q2-f label{font-size:12.5px;font-weight:600;color:var(--muted)}.q2-f .inp{width:100%;min-width:0}
.q2-f.q2-d .md-date{display:flex;gap:6px;flex-wrap:nowrap;align-items:center}.q2-f.q2-d .md-dt{flex:1 1 auto;min-width:0;width:auto}.q2-f.q2-d .md-date .btn{flex:none;padding-left:10px;padding-right:10px}.q2-f.q2-d .md-err{display:none}
.q2-calf{display:grid;grid-template-columns:1fr 1fr;gap:6px 18px;margin:6px 0 4px}
.q2-calrow{display:grid;grid-template-columns:minmax(0,1fr) 150px;align-items:center;gap:8px}.q2-calrow .inp:disabled{opacity:.45}
@media (max-width:820px){ .q2-br{display:none} .q2-grid .q2-f{flex:1 1 40%} .q2-grid .q2-qty,.q2-grid .q2-page{flex:0 0 40px} .q2-grid .q2-d{flex:0 0 auto} .q2-calf{grid-template-columns:1fr} }
@media (max-width:420px){ .q2-calrow{grid-template-columns:minmax(0,1fr) 120px} }
.q8-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.q8-it{display:grid;grid-template-columns:96px minmax(0,1fr) auto;gap:10px;align-items:center;border:1px solid var(--divider);border-radius:6px;padding:6px;background:var(--surface)}
.q8-th{width:96px;height:68px;background:#fff;border:1px solid var(--divider);border-radius:4px;overflow:hidden;display:grid;place-items:center}.q8-th img{width:100%;height:100%;object-fit:contain}
.q8-nm{font-weight:600;overflow-wrap:anywhere}.q8-sn{font-size:12.5px;color:var(--muted)}
.q8-ac{display:flex;gap:4px}.q8-ac .icon-btn{width:36px;height:36px;font-weight:700}
.q8-add{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:6px 0 4px}.q8-busy{font-weight:600;color:var(--muted)}
@media (max-width:560px){ .q8-it{grid-template-columns:72px minmax(0,1fr) auto} .q8-th{width:72px;height:52px} .q8-ac{flex-direction:column} .q8-ac .icon-btn{width:34px;height:30px} }

/* v240 MDR pages: cleaner, report-style design (header + footer with page no., no dashed frame, sans-serif) */
.mp-page::before{display:none}
.mp-page{font-family:Arial,Helvetica,sans-serif;padding:84px 56px 70px;color:#1C2530}
.mp-page.mp-cover{padding-top:46px}
.mp-hd{position:absolute;top:26px;left:56px;right:56px;display:flex;align-items:center;gap:10px;padding-bottom:7px;border-bottom:2px solid #3A1F8F;font-size:11px;color:#556170}
.mp-hd img{height:26px;max-width:70px;object-fit:contain}.mp-hd b{color:#3A1F8F;font-size:12.5px;letter-spacing:.02em}.mp-hd .r{margin-left:auto;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#3A1F8F}
.mp-ft{position:absolute;bottom:20px;left:44px;right:44px;display:flex;justify-content:space-between;gap:12px;padding-top:6px;border-top:1px solid #C9D1DA;font-family:Arial,Helvetica,sans-serif;font-size:10.5px;color:#556170}
.mp-page .mp-ft{left:56px;right:56px}.mp-ft b{color:#1C2530}
.mp-cover .mp-co{font-size:24px;color:#3A1F8F;letter-spacing:.02em;margin-top:10px}
.mp-cover .mp-addr{font-size:12px;color:#3A4553;padding:0 20px}.mp-addr + .mp-addr{margin-top:2px}
.mp-band{margin:22px 0 26px;background:#3A1F8F;color:#fff;text-align:center;font-weight:700;font-size:20px;letter-spacing:.12em;padding:12px 10px;border-radius:2px}
.mp-cover .mp-fields{gap:15px;font-size:13.5px;padding:0 8px}.mp-cover .mp-f > span:first-child{color:#556170;font-weight:700;font-size:12px;letter-spacing:.04em;padding-top:1px}
.mp-cover .mp-f b{border-bottom:1px solid #D5DBE1;padding-bottom:3px}
.mp-cover .mp-sign{margin-top:auto;margin-bottom:10px;border:1px solid #C9D1DA;padding:14px 14px 16px;border-radius:2px;font-size:11.5px}
.mp-cover .mp-sh{font-weight:700;color:#3A1F8F;letter-spacing:.04em}.mp-cover .mp-sk{font-weight:700;color:#556170}
.mp-cover .mp-sv{border-bottom:1px solid #8A96A3}
.mp-h2{font-weight:700;font-size:19px;color:#3A1F8F;letter-spacing:.1em;margin:4px 0 14px;padding-bottom:8px;border-bottom:1px solid #D5DBE1}
.mp-toc .mp-tf{background:#F5F7FA;border:1px solid #D5DBE1;padding:10px 14px;margin-bottom:16px;font-size:12.5px}.mp-toc .mp-tf b{border-bottom:0}.mp-toc .mp-tf .mp-f > span:first-child{color:#556170;font-weight:700}
.mp-toc .mp-tt th{background:#3A1F8F;color:#fff;font-weight:700;font-size:11.5px;letter-spacing:.05em;border:1px solid #3A1F8F;height:28px}
.mp-toc .mp-tt td{border:0;border-bottom:1px solid #D5DBE1;font-size:12.5px;height:26px}.qc-sheet.mp-toc .mp-tt tr:last-child td{border-bottom:2px solid #3A1F8F}
.mp-toc .mp-tt tr.l0 td{font-weight:700}.mp-toc .mp-tt tr.fx td{color:#556170}.mp-toc .mp-tt td:nth-child(n+2){font-variant-numeric:tabular-nums}
.mp-toc .mp-total{font-size:13px;margin-top:12px}.mp-toc .mp-total b{font-size:15px;color:#3A1F8F}
.qc-sheet.mp-sec{justify-content:center;align-items:center;text-align:center}
.mp-sec .mp-secno{margin:0;font-size:22px;letter-spacing:.3em;color:#556170}.mp-secln{width:70px;height:3px;background:#3A1F8F;margin:18px auto}
.mp-sec .mp-sect{margin:0;font-size:28px;color:#3A1F8F;padding:0 40px}
.mp-sec .mp-end{margin:0;display:flex;align-items:center;gap:16px;width:100%;font-size:18px;letter-spacing:.3em;color:#3A1F8F}
.mp-end::before,.mp-end::after{content:"";flex:1;height:2px;background:#3A1F8F}
#formEditor .fe-actions{flex-wrap:nowrap}
@media (max-width:620px){ #formEditor .fe-actions .btn{flex:1 1 0;min-width:0;justify-content:center;white-space:normal;text-align:center;padding-left:6px;padding-right:6px} }
.fe-pair .md-dt{max-width:none!important}
.fe-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:14px 18px}
.fe-pair .inp{min-width:0;width:100%;height:44px}
.fe-pair input[type=date]{-webkit-appearance:none;appearance:none;display:block;min-height:40px;text-align:left}
@media (max-width:620px){ .fe-pair{gap:10px} }
.qf-note{background:var(--hold);color:var(--hold-ink);font-weight:700;border-radius:5px;padding:6px 10px;margin-bottom:6px}
.qf-new{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;justify-content:space-between}.qf-new .btn{background:#fff}
.qf-rev{border:2px solid #3A1F8F;border-radius:8px;padding:12px 14px;margin-top:12px;background:var(--surface)}
.qf-rt{font-weight:700;font-size:16px}.qf-rl{margin:6px 0 10px;padding-left:20px}
.qf-opts{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:6px}
.qf-opt{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;padding:10px 12px;border:2px solid var(--frame);border-radius:6px;background:var(--surface);color:var(--ink);cursor:pointer;font:inherit;min-height:56px}
.qf-opt.on{border-color:#3A1F8F;background:#3A1F8F;color:#fff}
.qf-sug{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;background:#fff;color:#3A1F8F;border:1.5px solid #3A1F8F;border-radius:3px;padding:0 6px}
.qf-rev .md-acts .btn{flex:1 1 0;min-width:0;justify-content:center;white-space:normal;text-align:center;padding-left:8px!important;padding-right:8px!important}
@media (max-width:820px){ .qf-opts{grid-template-columns:1fr} }
.qf-ckr{display:grid;grid-template-columns:22px minmax(0,1fr) 36px 36px;gap:8px;align-items:center;margin:3px 0}.qf-ckr input[type=checkbox]{width:20px;height:20px;margin:0;accent-color:#3A1F8F}
.qc-h .inp{font-size:16px}
.f-portal{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center;margin-top:5px}
table.forms td.c-bar{display:none}
.f-kids{border:1.5px solid var(--steel)!important;color:var(--link);background:var(--surface)}
.f-kids.on{background:var(--steel);color:#fff}
.f-pbadge{font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;color:#fff;background:var(--navy);border-radius:3px;padding:1px 6px}
.f-tplh{border-top:2px solid var(--divider);padding-top:12px;margin-top:4px}.f-tplt{font-weight:700;font-size:15px}
@media (max-width:820px){ .md-tocsum .md-onlyused{margin-left:0} .md-foldall{margin-left:auto;min-height:40px!important} }
/* v246 TOC master: frozen action bar + grouped cards (same look as the MDR TOC tab) */
.toc-bar{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px) + var(--ph,49px));z-index:2;background:var(--surface);display:flex;gap:8px;align-items:center;padding:8px 0;margin-bottom:6px;border-bottom:2px solid var(--divider)}
.toc-bar .sp{flex:1}
@media (max-width:560px){ .toc-bar .btn{flex:0 1 auto;padding-left:9px!important;padding-right:9px!important} .toc-bar .sp{flex:1 1 0} }
.te-g{border-radius:8px;overflow:hidden;background:var(--surface)}
.te-g0{border:2px solid #3A1F8F;margin:10px 0}.te-g1{border:1.5px solid #2457E6;margin:8px 6px 10px;border-radius:6px}
.toc-list .te-g > .toc-r{padding-left:10px;padding-right:10px;margin:0!important;border-radius:0}.toc-list .te-g > .toc-r:last-child{border-bottom:0}
.toc-list .te-g > .toc-r.head{border-left:0;padding:8px 10px}
.toc-list .te-g0 > .toc-r.head{background:#3A1F8F}.toc-list .te-g0 > .toc-r.head .toc-t{color:#fff}.toc-list .te-g0 > .toc-r.head .mono{color:#C9D6E6}
.toc-list .te-g1 > .toc-r.head{background:var(--surface-2);border-bottom:1px solid #2457E6}
.toc-list .te-g .toc-r.lv1:not(.head){padding-left:18px}.toc-list .te-g .toc-r.lv2:not(.head){padding-left:26px}
.toc-ed .te-g .toc-er{border:0;border-bottom:1px solid var(--divider);border-radius:0;margin:0!important;padding:8px!important}
.toc-ed .te-g > .toc-er:last-child{border-bottom:0}
.toc-ed .te-g0 > .toc-er:first-child{background:#3A1F8F}.toc-ed .te-g1 > .toc-er:first-child{background:var(--surface-2);border-bottom:1px solid #2457E6}
.toc-ed .te-g0 > .toc-er:first-child .inp{border-color:#fff}
/* v247 TOC master view: form no. column in front, badge right, cards fold, cards wider so columns line up */
.tv-fold{display:flex;justify-content:flex-end;padding:6px 0 4px}
.toc-view .toc-r{grid-template-columns:50px minmax(0,1fr) auto;gap:6px;padding-left:0!important;padding-right:0}
.toc-view .toc-r .toc-t{padding-left:0}.toc-view .toc-fn{font-family:var(--mono);font-size:12.5px;letter-spacing:-.02em;color:var(--muted);white-space:nowrap}
.toc-view .toc-f{justify-self:end;display:flex;align-items:center;gap:8px}.toc-view .tv-chev{margin-left:0}
.toc-view .te-g0{margin:10px -10px}.toc-view .te-g1{margin:6px 0 8px}
.toc-view .te-g0 > .toc-r{padding-left:8px!important;padding-right:8px!important}
.toc-view .te-g1 > .toc-r{padding-left:6.5px!important;padding-right:6.5px!important}
.toc-view .te-g .toc-r.lv1:not(.head),.toc-view .te-g .toc-r.lv2:not(.head){padding-left:8px!important}
.toc-view .te-g1 .toc-r:not(.head){padding-left:6.5px!important}
.toc-view .te-g0 > .toc-r.head .toc-fn{color:#C9D6E6}
.toc-view .te-g:not(.open) > .toc-r.head{border-bottom:0}
.tv-chev{display:inline-flex;align-items:center;gap:5px;margin-left:8px;padding:2px 6px;border:1px solid currentColor;border-radius:5px;vertical-align:middle}
.tv-chev svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:2.2;transform:rotate(-90deg);transition:transform .15s}.tv-chev.on svg{transform:none}
.tv-cnt{font-family:var(--mono);font-size:12px;font-weight:600}
.toc-view .te-g0 > .toc-r.head .tv-chev{color:#fff}.toc-view .te-g1 > .toc-r.head .tv-chev{color:var(--ink)}
.toc-view .te-g0 > .toc-r.head .toc-ok{box-shadow:0 0 0 1.5px #fff}
/* v249 TOC master summary: compact */
.toc-sum{padding:8px 12px;gap:2px;margin-bottom:10px}.toc-sum .row{flex-wrap:nowrap;gap:8px}
.toc-sum .n{font-size:17px}.toc-sum .status{font-size:11px;padding:2px 7px;white-space:nowrap}
.toc-sum .ts-edit{margin-left:auto}.toc-sum .k{font-size:12.5px}
/* v245: summary bar on ONE line (desktop + phone): "1 form · 5 pages" | Used only | Expand all */
.md-tocsum{flex-wrap:nowrap;gap:10px;padding:6px 0;font-size:14px;white-space:nowrap}
.md-tocsum .n{font-weight:600}.md-tocsum .n b{font-weight:700}
.md-tocsum .md-onlyused{margin-left:auto!important;font-size:13.5px;min-height:34px;gap:6px}.md-tocsum .md-onlyused input{width:18px;height:18px}
.md-tocsum .md-foldall{margin-left:0!important;min-width:0;min-height:34px!important;padding:4px 9px!important;font-size:13px;gap:4px}
.md-tocsum .md-foldall svg{display:none}
/* v220 MDR TOC grouping: main group = navy card, sub-group = blue card inside it */
.md-g{border-radius:8px;overflow:hidden;background:var(--surface)}
.md-g0{border:2px solid #3A1F8F;margin:12px 0}
.md-g1{border:1.5px solid #2457E6;margin:8px 8px 10px;border-radius:6px}
.md-g > .toc-r{padding-left:8px;padding-right:8px}
.md-g > .toc-r:last-child{border-bottom:0}
.md-g > .toc-r.head{margin:0!important;border-radius:0;border-left:0;padding:8px}
.md-g0 > .toc-r.head{background:#3A1F8F;color:#fff;border-bottom:0}
.md-g0 > .toc-r.head .toc-t,.md-g0 > .toc-r.head .md-sec{color:#fff!important}
.md-g0 > .toc-r.head .md-fno{color:#C9D6E6}
.md-g0 > .toc-r.head .md-chev{background:transparent;border-color:#fff;color:#fff}
.md-g0 > .toc-r.head .md-cnt{color:#fff}
.md-g0 > .toc-r.head .md-cnt.has{background:#fff;color:#3A1F8F}
.md-g0 > .toc-r.head .md-cb{accent-color:#2457E6}
.md-g1 > .toc-r.head{background:var(--surface-2);border-bottom:1px solid #2457E6}
.md-g1 > .toc-r.head .toc-t{color:var(--ink)}
.md-g1:not(.open) > .toc-r.head{border-bottom:0}
.md-g0.open{box-shadow:0 2px 8px rgba(15,30,50,.12)}
.md-toc .md-g .toc-r.lv1 .toc-t{padding-left:4px}.md-toc .md-g .toc-r.lv2 .toc-t{padding-left:8px}
@media (max-width:820px){ .md-g1{margin:6px 4px 8px} .md-g > .toc-r{padding-left:6px;padding-right:6px} }
/* v244: group cards wider (stick out 10px each side) so every tick box and Pg box lines up in one column with the plain rows */
.md-toc .md-g0{margin:12px -10px}
.md-toc .md-g1{margin:6px 0 8px;border-width:1.5px}
.md-toc .md-g0 > .toc-r,.md-toc .md-g0 > .toc-r.head{padding-left:8px!important;padding-right:8px!important}
.md-toc .md-g1 > .toc-r,.md-toc .md-g1 > .toc-r.head{padding-left:6.5px!important;padding-right:6.5px!important}
.md-toc .md-g .toc-r.lv1 .toc-t{padding-left:6px}.md-toc .md-g .toc-r.lv2 .toc-t{padding-left:18px}   /* room for long section numbers (4.1.1) */
.md-chev{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:6px;margin-left:10px;vertical-align:middle;padding:2px 6px;border-radius:5px;border:1px solid var(--frame);background:var(--surface)}
.md-chev svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;transition:transform .15s;transform:rotate(-90deg)}.md-chev.on svg{transform:none}
.md-cnt{font-family:var(--mono);font-size:12px;font-weight:600;color:var(--muted)}.md-cnt.has{color:#fff;background:var(--ok-bg);border-radius:3px;padding:0 4px}
.pd-top-acts{display:none}.pd-top-acts .pd-acts{margin-top:0}
@media (max-width:820px){ .pd-top-acts{display:flex} .pd-bot-acts{display:none} }
@media (max-width:820px){ .stack-it tr.pd-tr{display:block;padding:0 0 8px;border-bottom:1px solid var(--divider)} .stack-it tr:has(+ tr.pd-tr){border-bottom:0} .stack-it td.c-pd{display:block} .pd-grid{grid-template-columns:minmax(0,1fr)} .pd-f{grid-template-columns:var(--pdl,112px) minmax(0,1fr)} .pd-row{grid-template-columns:minmax(0,1fr);gap:3px} }
/* v170 MDR form */
.md-form{display:flex;flex-direction:column}
.md-row{display:grid;grid-template-columns:200px 14px minmax(0,1fr);align-items:center;gap:0 6px;padding:8px 0;border-bottom:1px solid var(--divider)}
.md-row:last-child{border-bottom:0}
.md-l{font-weight:600;color:var(--ink);font-size:14.5px;text-transform:uppercase;letter-spacing:.02em}
.md-c{color:var(--muted);font-weight:700}
.md-v{min-width:0}.md-v .inp{width:100%;max-width:480px;font-size:16px}
.md-t{font-weight:700;color:var(--ink);font-size:15.5px}.md-t.mut{font-weight:500;color:var(--muted)}
.md-num{max-width:140px!important}
.md-date{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.md-date .inp{max-width:200px}
.md-hint{font-size:13px;color:var(--muted)}
.md-dt{max-width:170px!important;font-variant-numeric:tabular-nums}.md-dt.bad{border-color:#C62828;outline-color:#C62828}
.md-err{flex-basis:100%;color:#C62828;font-weight:700;font-size:13px}
@media (max-width:820px){
  .md-row{grid-template-columns:minmax(0,1fr);gap:4px}
  .md-c{display:none}
  .md-l{font-size:12.5px;color:var(--muted)}
  .md-date .inp{flex:1 1 0;min-width:0;max-width:none}
  .md-hint{flex-basis:100%}
}
/* v163 organization chart */
.oc-vacchk{padding:0 12px;border:1px solid var(--frame);border-radius:6px;background:var(--surface);min-height:40px!important;font-weight:600!important}
.oc-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;padding:4px 0 4px}
.oc-tree{display:inline-block;min-width:100%}
.ocs-area .oc-tree{min-width:0}
.oc-tree ul{display:flex;justify-content:center;margin:0;padding:22px 0 0;position:relative}
.oc-tree ul.oc-root{padding-top:0}
.oc-tree li{list-style:none;position:relative;padding:22px 6px 0;display:flex;flex-direction:column;align-items:center}
.oc-tree li::before,.oc-tree li::after{content:"";position:absolute;top:0;right:50%;width:50%;height:22px;border-top:2px solid #8A96A3}
.oc-tree li::after{right:auto;left:50%;border-left:2px solid #8A96A3}
.oc-tree li:only-child::before,.oc-tree li:only-child::after{display:none}
.oc-tree li:only-child{padding-top:0}
.oc-tree ul ul>li:only-child{padding-top:0}
.oc-tree li:first-child::before,.oc-tree li:last-child::after{border:0}
.oc-tree li:last-child::before{border-right:2px solid #8A96A3}
.oc-tree ul ul::before{content:"";position:absolute;top:0;left:50%;height:22px;border-left:2px solid #8A96A3}
.oc-tree ul.oc-root>li{padding-top:0}.oc-tree ul.oc-root>li::before,.oc-tree ul.oc-root>li::after{display:none}
.oc-box{width:150px;border:2px solid #3A1F8F;border-radius:6px;background:#fff;overflow:hidden;text-align:center}
.oc-pos{background:#3A1F8F;color:#fff;font-weight:700;font-size:13px;line-height:1.25;padding:6px 6px}
.oc-nm{padding:7px 6px;font-size:13.5px;color:#1C2530;line-height:1.3}
.oc-sc{display:inline-block;margin-left:5px;font-size:10.5px;font-weight:700;border:1.5px solid #2457E6;color:#2457E6;border-radius:3px;padding:0 4px;vertical-align:1px}
.oc-box.vac{border-style:dashed;border-color:#6B7785}.oc-box.vac .oc-pos{background:#6B7785}.oc-box.vac .oc-nm{color:#4A5563;font-weight:600}
.oc-list{display:flex;flex-direction:column}
.oc-li{margin-left:calc(var(--d)*18px);padding:9px 12px;border-left:3px solid #3A1F8F;border-bottom:1px solid var(--divider);background:var(--surface)}
.oc-li .p{font-weight:700;color:#3A1F8F;font-size:14.5px}.oc-li .n{font-size:14px;color:var(--ink)}
.oc-li.vac{border-left:3px dashed #6B7785}.oc-li.vac .p{color:#4A5563}.oc-li.vac .n{color:#4A5563;font-weight:600}
.oc-ed{display:flex;flex-direction:column;gap:6px}
.oc-er{display:grid;grid-template-columns:78px minmax(0,1.3fr) minmax(0,1.2fr) 70px minmax(0,1.4fr) auto;gap:8px;align-items:center}
.oc-er.hd{font-size:12px;font-weight:700;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.oc-er .c-pos{display:flex;align-items:center;gap:4px}
.oc-er .inp{width:100%}.oc-er .c-ac{display:flex;gap:4px;align-items:center}
@media (max-width:820px){
  .oc-er.hd{display:none}
  .oc-er{grid-template-columns:minmax(0,1fr) 84px;grid-template-areas:"l l" "p p" "n s" "r r" "a a";border:1px solid var(--divider);border-radius:6px;padding:10px;background:var(--surface)}
  .oc-er .c-ld{grid-area:l}
  .oc-er .c-pos{grid-area:p}.oc-er .c-nm{grid-area:n}.oc-er .c-sc{grid-area:s}.oc-er .c-rt{grid-area:r}.oc-er .c-ac{grid-area:a;justify-content:flex-end}
  .oc-er .inp{font-size:16px}
  .oc-er .icon-btn{min-width:40px;min-height:40px}
}
.oc-sheet{position:absolute;left:0;top:0;width:1123px;height:794px;transform-origin:0 0;background:#fff;color:#1C2530;box-shadow:0 4px 18px rgba(0,0,0,.35);padding:36px 44px 30px;box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;display:flex;flex-direction:column}
.oc-wrap .oc-sheet{box-shadow:0 4px 18px rgba(0,0,0,.35)}
.ocs-lh{display:flex;align-items:center;gap:16px}.ocs-lh img{height:62px;max-width:120px;object-fit:contain}
.ocs-co{font-size:21px;font-weight:700;color:#3A1F8F}.ocs-rg{font-size:11.5px;color:#556170;margin-top:2px}
.ocs-meta{margin-left:auto;text-align:right;font-size:12px;color:#556170;line-height:1.5}.ocs-t{font-size:20px;font-weight:700;color:#3A1F8F;letter-spacing:.04em}
.ocs-rule{height:3px;background:#3A1F8F;margin:12px 0 18px}
.ocs-area{flex:1;position:relative;overflow:hidden}.ocs-area .oc-tree{position:absolute;left:0;top:0}
.ocs-foot{display:flex;align-items:flex-end;justify-content:space-between;font-size:11.5px;color:#1C2530;margin-top:8px}
.ocs-sign .l{width:220px;height:1px;background:#1C2530;margin-bottom:5px}.ocs-gen{color:#556170;font-size:10.5px}
.oc-dept{background:#2457E6;color:#fff;font-size:10.5px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;padding:4px 6px}
.oc-box.vac .oc-dept{background:#4A5563}
.oc-dh{display:flex;align-items:baseline;gap:10px;margin:14px 0 4px;padding:6px 10px;background:#3A1F8F;color:#fff;border-radius:5px;font-weight:700;font-size:14px;letter-spacing:.04em;text-transform:uppercase}
.oc-dh:first-child{margin-top:0}.oc-dh .c{margin-left:auto;font-size:12px;font-weight:600;text-transform:none;letter-spacing:0;opacity:.9}
.oc-li .r{font-size:12.5px;color:var(--muted);margin-top:2px}.oc-lead{color:#2457E6}
.oc-dhd{display:flex;gap:8px;align-items:center}.oc-foot{margin-top:12px;display:flex;gap:8px;flex-wrap:wrap;align-items:center}.oc-foot .sp{flex:1}
.oc-dp .panel-head .oc-editbtn{flex:none;margin-left:8px}.oc-dname{flex:1;font-weight:700;font-size:16px}.oc-acts{display:flex;gap:4px}
.oc-er .c-ld{display:inline-flex;align-items:center;gap:6px;font-size:13px;font-weight:600;color:var(--ink);cursor:pointer;white-space:nowrap}.oc-er .c-ld input{width:18px;height:18px;accent-color:#3A1F8F;margin:0}
.oc-er .c-ld .t.off{color:var(--muted);font-weight:500}
.oc-bad{display:block;margin-top:4px;background:#F2C230;color:#1C2530;font-size:12px;font-weight:700;border-radius:4px;padding:3px 6px}
.oc-off{display:block;font-size:12px;color:#4A5563;font-weight:600;margin-top:3px}
/* v159 memo preview */
body.memo-open{overflow:hidden}
/* v399: PDF preview / Save PDF ignore the A−/A+ text size (body zoom) — a zoomed page made the PDF writer read wrong positions, so on phone the header (logo + company name) fell off the PDF */
body.memo-open{zoom:1!important}
.memo-ov{position:fixed;inset:0;z-index:80;background:rgba(10,20,35,.6);display:flex;flex-direction:column}
.memo-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;padding:10px 16px;padding-top:max(10px,env(safe-area-inset-top));background:#3A1F8F;color:#fff}
.memo-tt{display:flex;flex-direction:column;min-width:0}.memo-tt b{font-size:16px}.memo-tt span{font-size:13px;opacity:.85;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.memo-acts{display:flex;gap:8px;margin-left:auto}
.memo-bar .btn-secondary{background:transparent;color:#fff;border-color:#fff}
.memo-bar .btn-primary{background:#fff;color:#3A1F8F;border-color:#fff}
.memo-bar .btn-primary svg{stroke:#3A1F8F}
.memo-stage{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;padding:12px;padding-bottom:max(12px,env(safe-area-inset-bottom))}
.memo-wrap{margin:0 auto;position:relative}
.memo-sheet{position:absolute;left:0;top:0;width:794px;min-height:1123px;transform-origin:0 0;background:#fff;color:#1C2530;box-shadow:0 4px 18px rgba(0,0,0,.35);padding:60px 68px 70px;box-sizing:border-box;font-family:Helvetica,Arial,sans-serif;font-size:14px;line-height:1.45}
.mm-lh{display:flex;gap:26px;align-items:flex-start}.mm-logo{height:113px;max-width:208px;object-fit:contain}
.mm-name{color:#3A1F8F;font-weight:700;font-size:28px;line-height:1.2;margin:6px 0 8px}.mm-hl{color:#556170;font-size:12px;line-height:1.4}
.mm-rule{height:3px;background:#3A1F8F;margin:10px 0 26px}
.mm-title{color:#3A1F8F;font-weight:700;font-size:24px;margin-bottom:12px}
.mm-meta{display:grid;grid-template-columns:83px 15px 1fr;row-gap:4px}.mm-meta b{font-weight:700}.mm-meta .sub{font-weight:700}
.mm-thin{height:1px;background:#D5DBE1;margin:8px 0 22px}
.mm-intro{margin:0 0 14px}
.mm-tb{width:100%;border-collapse:collapse;font-size:13.3px;border-bottom:1px solid #D5DBE1}
.mm-tb th{background:#3A1F8F;color:#fff;text-align:left;padding:7px 8px;font-weight:700;text-transform:none;letter-spacing:0;font-size:13.3px;border:0}
.mm-tb th,.mm-tb td{border:0!important;box-shadow:none!important}
.mm-tb td{border-bottom:0;font-size:13.3px;color:#1C2530;background:#fff}
.mm-tb td{padding:5px 8px}.mm-tb tbody tr:nth-child(even) td{background:#EEF2F6}
.mm-tb th:first-child,.mm-tb td:first-child{width:45px}.mm-tb th:nth-child(2),.mm-tb td:nth-child(2){width:113px}.mm-tb th:nth-child(3),.mm-tb td:nth-child(3){width:98px}
.mm-tb tbody tr:last-child td{border-bottom:1px solid #D5DBE1}
.mm-total{text-align:right;font-weight:700;margin:8px 0 16px}
.mm-nh{font-weight:700}.mm-moon{color:#2457E6;font-weight:700;margin-left:3px}.mm-mnote{margin-top:2px}.mm-notes{margin:4px 0 0;padding-left:18px}
.mm-sign{margin-top:48px;font-size:12.7px}.mm-line{width:227px;height:1px;background:#1C2530;margin-bottom:6px}
.mm-foot{position:absolute;right:68px;bottom:22px;font-size:10.7px;color:#556170}
@media (max-width:820px){.memo-bar .btn{min-height:44px}}
/* v411 (Kah Poh): phone PDF preview top bar compact — title + file name on the left, Close / Save PDF on the same row */
@media (max-width:560px){
  .memo-bar{flex-wrap:nowrap;gap:8px;padding:6px 10px;padding-top:max(6px,env(safe-area-inset-top))}
  .memo-tt{flex:1 1 auto}
  .memo-tt b{font-size:14px;line-height:1.25;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .memo-tt span{font-size:11.5px;line-height:1.25}
  .memo-acts{gap:6px;flex:none}
  .memo-bar .btn{min-height:36px;padding:6px 10px;font-size:14px;gap:5px}
  .memo-bar .btn svg{width:16px;height:16px}
}

.sh-empty{border:2px solid var(--frame);background:var(--surface)}
.sh-row .d{font-family:var(--mono);font-size:13.5px;white-space:nowrap}
.sh-row .w{color:var(--muted);font-size:13.5px}
.sh-row .w.we{color:var(--ink);font-weight:600}
.sh-row .nm{font-weight:500;min-width:0;overflow-wrap:anywhere}
.sh-row .nt{display:block;font-size:12.5px;color:var(--muted);font-weight:400}
.sh-row.off .nm,.sh-row.off .d{color:var(--muted)}
.sh-tag{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:4px;font-size:11px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap;border:1.5px solid transparent}
.sh-law{background:var(--navy);color:#fff}
.sh-s8{background:var(--surface);color:var(--link);border-color:var(--steel)}
.sh-pick{background:var(--steel);color:#fff}
.sh-extra{background:var(--surface);color:var(--ink);border-color:var(--ink)}
.sh-sum .row{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;width:100%}
.sh-sum{flex-direction:column;align-items:flex-start}
.sh-sum .acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
.sh-sum .rj{font-size:13px;color:var(--bad);font-weight:600}
.ap-row{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr) auto auto;gap:6px 14px;align-items:center;padding:12px 0;border-bottom:1px solid var(--divider)}
.ap-row:last-child{border-bottom:0}
.ap-row .t{font-weight:600}
.ap-row .m{font-size:13px;color:var(--muted)}
.ap-row .a{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.ap-rj{grid-column:1/-1;display:flex;gap:8px;flex-wrap:wrap;align-items:center}
.ap-rj .inp{flex:1 1 220px}
/* v155 phone: one column — title, sent/approved lines, badge, buttons, each full width */
@media (max-width:820px){ .ap-row{grid-template-columns:minmax(0,1fr);gap:6px} .ap-row > .status{justify-self:start} .ap-row .a{justify-content:flex-start} .ap-row .a:empty{display:none} }
.sh-short{background:var(--hold);color:var(--hold-ink);border-radius:4px;padding:1px 7px;letter-spacing:.06em}
.sh-frow{display:grid;grid-template-columns:86px minmax(0,1fr);grid-template-areas:"d nm" "w t";gap:2px 14px;align-items:start;padding:10px 0;border-bottom:1px solid var(--divider)}
.sh-frow:last-child{border-bottom:0}
.sh-frow .d{grid-area:d;font-family:var(--mono);font-size:13.5px;white-space:nowrap}
.sh-frow .w{grid-area:w;color:var(--muted);font-size:13.5px}
.sh-frow .w.we{color:var(--ink);font-weight:600}
.sh-frow .nm{grid-area:nm;font-weight:500;overflow-wrap:anywhere}
.sh-frow .t{grid-area:t}
.sh-frow.off .d,.sh-frow.off .nm{color:var(--muted)}
.sh-note{font-size:13px;color:var(--muted);margin:0 0 8px}
.sh-add{display:grid;grid-template-columns:170px minmax(0,1fr) auto;gap:8px;align-items:end;margin-top:10px}
@media (max-width:560px){
  /* v149 phone: tick · date · weekday · name on ONE row; any badge goes under the name */
  .sh-row{grid-template-columns:24px 66px 32px minmax(0,1fr);grid-template-areas:"c d w nm" ". . . t";gap:2px 8px}
  .sh-row > :nth-child(1){grid-area:c} .sh-row .d{grid-area:d;font-size:13px} .sh-row .w{grid-area:w;font-size:13px}
  .sh-row .nm{grid-area:nm} .sh-row > :nth-child(5){grid-area:t;justify-self:start}
  .sh-row > span:empty:nth-child(5){display:none}
  .sh-add{grid-template-columns:1fr}
}
.ph-status{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin:-4px 0 14px;font-size:13.5px}
.ph-status .ph-stxt{color:var(--muted)}
.ph-scope{display:flex;gap:8px 18px;flex-wrap:wrap;margin-bottom:8px}
.ph-scope label,.ph-stbox label,.ph-moonchk{display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500;color:var(--ink);cursor:pointer;min-height:32px}
.ph-scope input,.ph-stbox input,.ph-moonchk input{width:18px;height:18px;margin:0;accent-color:#3A1F8F}
.ph-stbox{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:2px 12px;padding:8px 12px;border:1px solid var(--divider);border-radius:6px;background:var(--surface-2)}
@media (max-width:700px){ .ph-stbox{grid-template-columns:repeat(2,minmax(0,1fr))} }
label.ph-moonchk{display:flex}
.ph-chk{display:inline-flex;align-items:center;gap:8px;margin-left:auto;font-size:14px;font-weight:600;color:var(--ink);cursor:pointer;user-select:none;-webkit-user-select:none;min-height:32px}
.ph-chk input{width:20px;height:20px;margin:0;accent-color:#3A1F8F;cursor:pointer}
table.ph .ph-st{font-size:13.5px;color:var(--ink)}
table.ph .ph-st b{font-weight:600}
table.ph td.c-act{white-space:nowrap;text-align:right;width:1%}
.ph-src{font-size:12.5px;color:var(--muted);margin-top:8px}
.ph-src a{color:var(--link)}
@media (max-width:560px){
  .forms-tools .ph-years{width:100%} .ph-years button{flex:1;min-width:0;padding:0 6px}
  table.ph td{padding:0}
  /* v138 phone card: date over weekday on the left; holiday name beside the date, states under the name */
  table.stack-ph tr{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"date name" "date type" "act act";gap:2px 14px;align-items:start}
  table.stack-ph td.c-act{grid-area:act;width:auto;text-align:left;padding-top:6px!important} table.stack-ph td.c-act .act-row{justify-content:flex-start}
  .stack-ph td.c-date{grid-area:date} table.stack-ph td.c-day{display:none}
  table.stack-ph .ph-wd{display:block;font-family:var(--sans);font-size:13.5px;color:var(--muted);margin-top:2px}
  table.stack-ph .ph-wd.we{color:var(--ink);font-weight:600}
  .stack-ph td.c-name{grid-area:name} .stack-ph td.c-type{grid-area:type;padding-top:2px!important}
  table.ph td.c-date,table.ph td.c-day,table.ph td.c-type{width:auto}
}
/* ---------- toast ---------- */
.toast{position:fixed;left:50%;bottom:calc(env(safe-area-inset-bottom,0px) + 20px);transform:translateX(-50%);background:#1C2530;color:#fff;padding:10px 16px;border-radius:6px;font-weight:500;display:flex;gap:8px;align-items:center;z-index:20;box-shadow:0 8px 24px rgba(0,0,0,.25);max-width:calc(100% - 32px)}
.toast.err{background:#C62828}
@media (prefers-reduced-motion:no-preference){.toast{animation:up .18s ease-out}@keyframes up{from{transform:translate(-50%,8px);opacity:.4}}}
/* ---------- projects ---------- */
.pj-sel{width:auto;flex:0 0 auto;min-width:130px}
/* toolbars keep a fixed layout: labels changing (Collapse/Expand, Sync/Syncing) never resize the search box */
@media (min-width:561px){
  .forms-tools .search-wrap{flex:0 1 360px}
  #view-projects .search-wrap{flex:0 1 300px}
  .forms-tools .fold-btn,#formFoldBtn{min-width:132px;justify-content:center}
  #pjRefresh{min-width:158px;justify-content:center}
}
.pj-stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:14px}
.pj-stat{background:var(--surface);border:1px solid var(--divider);border-radius:8px;padding:10px 14px;min-width:0;color:var(--ink);font:inherit;text-align:left}
button.pj-stat{cursor:pointer;border-width:2px;border-color:var(--frame)}
@media (hover:hover){ button.pj-stat:hover{border-color:var(--steel)} }   /* v606: mouse only — on touch it stuck while dragging */
button.pj-stat.on{background:var(--navy);border-color:var(--navy);color:#fff}
button.pj-stat.on .k{color:#fff}
button.pj-stat.late{border-color:var(--bad)}
button.pj-stat.late:not(.on) .v{color:var(--bad)}
button.pj-stat.late.on{background:var(--bad-bg);border-color:var(--bad-bg)}
table.pj .pj-late{margin-top:4px}
table.pj .del-line{white-space:nowrap}
table.pj .del-line .pj-late{display:inline-block;margin:0 0 0 6px;vertical-align:1px}
@media (min-width:821px){ table.pj .del-line .pj-late{display:block;margin:4px 0 0} }   /* v176: desktop — date on top, late badge below */
table.pj .pj-late .status{font-size:11px;padding:1px 6px;letter-spacing:.03em}
@media (min-width:561px){
  .pj-stats{display:flex;flex-wrap:nowrap;gap:8px}
  .pj-stat{flex:1 1 0;min-width:0;padding:6px 10px;border-radius:6px}
  .pj-stat .k{font-size:10.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .pj-stat .v{font-size:18px;margin-top:1px;line-height:1.2}
}
@media (min-width:561px){ .pj-stat.money{flex-grow:1.5} }
@media (min-width:561px) and (max-width:720px){ .pj-stat .v{font-size:13.5px} .pj-stat{padding:5px 7px} .pj-stats{gap:6px} }
@media (min-width:821px) and (max-width:1020px){ .pj-stat .v{font-size:15.5px} .pj-stat{padding:5px 8px} }
.pj-stat .k{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.pj-stat .v{font-family:var(--cond);font-weight:700;font-size:22px;font-variant-numeric:tabular-nums;line-height:1.25;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.pj-stat.money{border-left:4px solid var(--navy)}
.pj-stat .v small{font-size:13px;font-weight:600;color:var(--muted);margin-right:3px}
table.pj td{vertical-align:top;padding:9px 10px}
@media (hover:hover){ table.pj > tbody > tr:not(.pj-xrow):hover > td{background:var(--surface-2)} }   /* v778 (Kah Poh): only the row under the cursor — never the rows inside an open items box */   /* v596: mouse only — on touch the colour stuck after a drag */
table.pj .fno{font-family:var(--mono);font-weight:600;font-size:13.5px;white-space:nowrap}
table.pj .cname{font-weight:600;line-height:1.3}
table.pj .cmeta{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
table.pj .mono{font-family:var(--mono);font-size:12.5px}
table.pj th.c-amt,table.pj td.c-amt,table.pj th.c-bill,table.pj td.c-bill{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}
table.pj td.c-st,table.pj td.c-del{white-space:nowrap}
table.pj .lbl{display:none}
table.pj th.c-bill,table.pj td.c-bill{width:72px;padding-left:4px}
table.pj th.c-amt,table.pj td.c-amt{width:138px}
.pj-sort{all:unset;cursor:pointer;display:inline-flex;align-items:center;gap:5px;font:inherit;color:inherit;letter-spacing:inherit;text-transform:inherit}
.pj-sort{padding:3px 7px;margin:-3px -7px;border-radius:4px}.pj-sort .ar{font-size:10px;color:#556170}@media (hover:hover){ .pj-sort:hover{color:var(--ink);background:var(--divider)} }
.pj-sort.on,.pj-sort.on:hover{background:#3A1F8F;color:#fff}.pj-sort.on .ar{color:#fff;font-size:11px}   /* v187: sorted heading = solid navy label, white text */
.pj-sort:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
@media (min-width:821px){ table.pj th.c-amt,table.pj td.c-amt{width:112px;padding-left:12px} table.pj td.c-del{width:1%} table.pj td.c-client{width:auto} }   /* v177: desktop — PO column only as wide as the amount (no gap after Delivery) */
table.pj td.c-client{min-width:150px}
table.pj .pj-th2{font-size:10.5px;font-weight:700;letter-spacing:.04em;color:var(--bad);margin-top:1px}
table.pj .pj-unb .lbl{font-weight:400}
table.pj .pj-unb{font-size:12px;font-weight:700;color:var(--bad);margin-top:3px}
table.pj .pj-bp{font-weight:700}
table.pj .pj-up{font-size:12px;color:var(--muted);margin-top:3px}
.pj-note{border:2px solid var(--hold);margin-bottom:14px}
.pj-note .panel-head{background:var(--hold);color:var(--hold-ink);border-bottom:0;border-radius:6px 6px 0 0}
.pj-note .panel-head h2{color:var(--hold-ink)}
.pj-note p{margin:0 0 10px}
.pj-link{color:var(--link);font-weight:600}
@media (max-width:560px){
  .forms-tools .pj-sel{flex:1 1 40%;min-width:0}
  /* v181: phone — the two selects share row 2, the buttons (Sync from Drive · Change file · Expand all) share row 3 */
  .forms-tools .pj-sel{flex:1 1 calc(50% - 5px)}
  #view-projects .forms-tools .btn{padding-left:6px;padding-right:6px;font-size:13.5px;gap:5px} #pjRefresh svg{display:none}
  .pj-stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .pj-stat{padding:8px 10px}
  .pj-stat .v{font-size:17px}
  table.pj td{padding:0}
  /* phone card (v101): job no + "n items" | status · client · PO no + PO date | PIC · Delivery + badge | QC (PIC/QC left-aligned block on the right) · amounts */
  .stack-pj tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"job st" "client client" "po pic" "del pic" "amt bill"}
  .stack-pj td.c-job{grid-area:job;align-self:center} .stack-pj td.c-st{grid-area:st;justify-self:end;align-self:center}
  .stack-pj td.c-job .fno{display:inline} .stack-pj td.c-job .it-link{margin:0 0 0 10px}
  .stack-pj td.c-client{grid-area:client} .stack-pj td.c-po{grid-area:po}
  .stack-pj td.c-po{display:flex;align-items:baseline;padding-right:14px} .stack-pj td.c-po .cmeta{margin:0 0 0 auto;padding-left:10px}   /* PO no. left, PO date at the right edge, next to PIC */
  .stack-pj td.c-pic{grid-area:pic;justify-self:end;text-align:left}
  .stack-pj td.c-del{grid-area:del} .stack-pj td.c-del .pj-late{display:inline-block;margin:0 0 0 8px;vertical-align:1px}
  table.stack-pj td.c-amt{grid-area:amt;text-align:left} table.stack-pj td.c-bill{grid-area:bill;justify-self:end;text-align:right}
  table.pj .lbl{display:inline;color:var(--muted);font-size:12px;margin-right:4px}
  /* phone cards: drop the fixed desktop column widths so Billed / Unbilled % never get cut off */
  table.stack-pj td.c-amt,table.stack-pj td.c-bill{width:auto;padding-left:0}
  table.stack-pj td.c-bill{min-width:max-content}
  table.stack-pj td.c-amt{white-space:normal;overflow-wrap:normal}
}
/* ---------- item details ---------- */
#view-items .search-wrap{flex:0 1 300px}
@media (max-width:560px){ #view-items .search-wrap{flex:1 1 100%} }
.it-panel + .it-panel{margin-top:10px}
/* opened job: steel line down the left of its items, same as the item box on the Project list */
.it-panel > .panel-body{border-left:4px solid var(--steel);border-bottom-left-radius:7px}
.it-panel .panel-head{justify-content:flex-start;gap:10px}
.it-panel .panel-head h2{text-transform:none;letter-spacing:0;font-family:var(--sans);font-size:14px;font-weight:600;color:var(--ink);display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;min-width:0}
.it-panel .panel-head h2 .fno{font-family:var(--mono);font-weight:600;font-size:14px}
.it-panel .panel-head h2 .cl{overflow-wrap:anywhere}
.it-panel .panel-head h2 .po{font-weight:500;color:var(--muted);font-size:12.5px}
.it-panel .panel-head .status{flex:none;white-space:nowrap}
table.it td{vertical-align:top;padding:8px 10px}
table.it .mono{font-family:var(--mono);font-size:12.5px;overflow-wrap:anywhere}
table.it .cmeta{font-size:12.5px;color:var(--muted);margin-top:2px;line-height:1.35}
table.it .dsc{font-weight:500}
table.it td.c-no,table.it th.c-no{width:34px;white-space:nowrap;color:var(--muted);font-variant-numeric:tabular-nums}
table.it td.c-qty,table.it th.c-qty{white-space:nowrap;text-align:center;font-variant-numeric:tabular-nums}
table.it td.c-del,table.it td.c-adel{white-space:nowrap;font-variant-numeric:tabular-nums}
table.it td.c-up,table.it th.c-up,table.it td.c-tot,table.it th.c-tot{white-space:nowrap;text-align:right;font-variant-numeric:tabular-nums}
table.it .rev{color:var(--link);font-weight:600}
table.it .lbl{display:none}
table.it .ino{display:none}
table.it td.c-adel .pj-late{margin-top:0;display:inline-block}
table.it .pj-late .status{font-size:11px;padding:1px 6px;letter-spacing:.03em}
.it-foot{display:flex;flex-wrap:wrap;gap:8px 16px;justify-content:flex-end;align-items:center;border-top:2px solid var(--divider);margin-top:4px;padding-top:8px;font-size:13px}
.it-foot b{font-variant-numeric:tabular-nums}
/* job picker: dropdown of ongoing jobs beside the search box */
.pick-btn{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:34px;height:30px;border:0;border-left:1px solid var(--divider);background:transparent;color:var(--muted);cursor:pointer;display:grid;place-items:center;border-radius:0 4px 4px 0}
.pick-btn[aria-expanded="true"]{color:var(--link)} @media (hover:hover){ .pick-btn:hover{color:var(--link)} }
.pick-btn svg{position:static;transform:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;pointer-events:none}
/* our own ✕ clear button on every search box (the built-in one differs per phone/browser) */
.search-wrap input[type="search"]::-webkit-search-cancel-button{display:none;-webkit-appearance:none}
.search-wrap .inp{padding-right:40px}
.search-wrap.has-pick .inp{padding-right:76px}
.clr-btn{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:32px;height:30px;border:0;background:transparent;color:var(--muted);cursor:pointer;display:grid;place-items:center;border-radius:4px}
.search-wrap.has-pick .clr-btn{right:40px}
@media (hover:hover){ .clr-btn:hover{color:var(--bad)} }   /* v606: mouse only — on touch it stuck while dragging */
.clr-btn svg{position:static;transform:none;width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;pointer-events:none}
.pick-list{position:absolute;left:0;right:0;top:calc(100% + 4px);background:var(--surface);border:1px solid var(--frame);border-radius:6px;box-shadow:0 8px 24px rgba(15,30,50,.18);z-index:6;max-height:300px;overflow:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
.pick-list button{display:flex;width:100%;gap:10px;align-items:baseline;text-align:left;padding:9px 12px;border:0;border-bottom:1px solid var(--divider);background:none;cursor:pointer;color:var(--ink);font:inherit}
.pick-list button:focus-visible{background:var(--surface-2)} @media (hover:hover){ .pick-list button:hover{background:var(--surface-2)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.pick-list .pj{font-family:var(--mono);font-weight:600;font-size:13px;flex:none}
.pick-list .pc{font-size:13px;min-width:0;overflow-wrap:anywhere}
.pick-list .pall{font-weight:600;color:var(--link)}
.pick-list .none{padding:10px 12px;color:var(--muted);font-size:13px}
.btn-flag{background:var(--surface);color:var(--ink);border:2px solid var(--hold);min-width:150px;justify-content:center}
@media (hover:hover){ .btn-flag:hover{background:var(--surface-2)} }   /* v606: mouse only — on touch it stuck while dragging */
.btn-flag.on{background:var(--hold);color:var(--hold-ink);border-color:var(--hold)}
.it-link{display:inline-block;margin-top:3px;font-size:12px;font-weight:600;color:var(--link);text-decoration:none;white-space:nowrap}
@media (hover:hover){ .it-link:hover{text-decoration:underline} }
button.it-link{background:none;border:0;padding:2px 0;cursor:pointer;font-family:inherit}
button.it-link.on{color:var(--ink)}
table.pj tr.pj-xrow > td,table.pj tbody tr.pj-xrow:hover > td{background:var(--surface-2);padding:6px 10px 12px}
@media (hover:hover){ table.pj tr.pj-xrow table > tbody > tr:hover > td{background:var(--surface-2)} }   /* v778: inside the items box, the item row OR its production details bar under the cursor lights up — only that one */
.pj-xbox{background:var(--surface);border:1px solid var(--divider);border-left:4px solid var(--steel);border-radius:6px;padding:4px 12px 8px}
table.pj tr:has(+ tr.pj-xrow) > td{border-bottom:0}
/* v111 phone: an opened job = one card like Item details — job details on top, items below with the blue left line; almost full width of the year box */
@media (max-width:560px){
  table.stack-pj{border-collapse:separate;border-spacing:0}   /* collapsed-border tables never paint row borders */
  #pjBody .table-wrap{overflow:visible}   /* cards never need side-scroll on phone; overflow here was clipping the card edges and the blue line */
  table.stack-pj tr.pj-open{margin:8px -10px 0;padding:10px 10px 12px;border:1px solid var(--frame);border-bottom:1px solid var(--divider);border-radius:8px 8px 0 0;background:var(--surface)}
  table.pj tr.pj-xrow{display:block;margin:0 -10px 10px;padding:0;border:1px solid var(--frame);border-top:0;border-left:4px solid var(--steel);border-radius:0 0 8px 8px;background:var(--surface)}
  table.pj tr.pj-xrow > td,table.pj tbody tr.pj-xrow:hover > td{padding:0;background:transparent!important}   /* same on touch (hover) — no squeeze */
  table.pj tbody tr.pj-open:hover > td{background:transparent}
  .pj-xbox{margin:0;padding:4px 10px 8px;border:0;border-radius:0;background:transparent}
}
@media (max-width:560px){
  table.it td{padding:0}
  .stack-it tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"desc desc" "tag qty" "del adel" "up tot" "rem rem"}
  .stack-it td.c-no{grid-area:no;justify-self:end} .stack-it td.c-desc{grid-area:desc} .stack-it td.c-tag{grid-area:tag}
  .stack-it td.c-qty{grid-area:qty;text-align:left} .stack-it td.c-del{grid-area:del;justify-self:end;text-align:right}
  .stack-it td.c-adel{grid-area:adel;justify-self:end;text-align:right} .stack-it td.c-up{grid-area:up;text-align:left} .stack-it td.c-tot{grid-area:tot;justify-self:end}
  .stack-it td.c-rem{grid-area:rem}
  table.it.stack-it td.c-up{text-align:left;justify-self:start}
  /* v106 phone rows: Tag | Qty (right) · Delivery (left) | Act. delivery (right) */
  table.it.stack-it td.c-qty{text-align:right;justify-self:end} table.it.stack-it td.c-del{text-align:left;justify-self:start}
  table.it.stack-it td.c-adel{text-align:right;justify-self:end}
  table.it .lbl{display:inline;color:var(--muted);font-size:12px;margin-right:4px}
  table.it.stack-it td.c-no{display:none} table.it .ino{display:inline}   /* phone (v105): item no. before the description, e.g. "1. Tank", description uses the full width */
  .it-foot{justify-content:flex-start}
  .it-foot > .status.st-ok{margin-left:auto}   /* phone (v113): "Matches PO" badge on the right */
}
/* ---------- home (opening page) ---------- */
.hm-date{font-family:var(--cond);font-weight:600;font-size:13px;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin:0 0 2px}
.hm-tiles{display:grid;grid-template-columns:repeat(auto-fit,minmax(170px,1fr));gap:10px;margin-bottom:16px}
.hm-tile{display:flex;flex-direction:column;gap:2px;background:var(--surface);border:2px solid var(--divider);border-radius:8px;padding:10px 14px;color:var(--ink);min-width:0}
.hm-tile .k{font-size:11px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.hm-tile .v{font-family:var(--cond);font-weight:700;font-size:24px;line-height:1.2;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.hm-tile .s{font-size:12px;color:var(--muted)}
.hm-tile.bad{border-color:var(--bad)} .hm-tile.bad .v{color:var(--bad)}
.hm-grid{display:grid;grid-template-columns:minmax(0,1.6fr) minmax(0,1fr);gap:16px;align-items:start}
.hm-grid > .panel{margin-top:0!important}
.hm-links{display:grid;grid-template-columns:1fr;gap:8px}
.hm-link{display:flex;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--divider);border-radius:6px;color:var(--ink);text-decoration:none;font-weight:600}
@media (hover:hover){ .hm-link:hover{border-color:var(--steel);background:var(--surface-2)} }
.hm-link svg{width:18px;height:18px;flex:none;fill:none;stroke:var(--steel);stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.hm-link .d{display:block;font-size:12px;font-weight:400;color:var(--muted)}
.hm-link.hm-soon{border-style:dashed;cursor:default;color:var(--muted)}
@media (hover:hover){ .hm-link.hm-soon:hover{background:none;border-color:var(--divider)} }
table.hm-due td{vertical-align:middle;padding:8px 10px}
table.hm-due tbody tr{cursor:pointer}
@media (hover:hover){ table.hm-due tbody tr:hover td{background:var(--surface-2)} }
table.hm-due .fno{font-family:var(--mono);font-weight:600;font-size:13px;white-space:nowrap}
table.hm-due td.c-date{font-variant-numeric:tabular-nums}
table.hm-due td.c-date > div:first-child{white-space:nowrap}
table.hm-due .hm-sub{font-size:12px;color:var(--muted)}
table.hm-due .hm-th2{font-size:10.5px;font-weight:600;letter-spacing:.04em;color:var(--muted);text-transform:none;margin-top:1px}
table.hm-due .ph-only{display:none}
.hm-st{flex-direction:column;align-items:center;gap:0;line-height:1.2;min-width:92px;padding:4px 9px}
.hm-st .b2{font-size:10.5px;letter-spacing:.04em}
@media (max-width:560px){
  table.hm-due .ph-only{display:inline} table.hm-due .dk-only{display:none}
  .hm-st{flex-direction:row;gap:5px;min-width:0;padding:3px 9px}
  .hm-st .b2{font-size:inherit;letter-spacing:inherit}
}
table.hm-due td.c-client{min-width:0}
table.hm-due th:last-child,table.hm-due td.c-st{padding-right:2px}
table.hm-due td.c-st{text-align:right;white-space:nowrap}
.hm-more{margin:10px 0 0;font-size:13px}
@media (min-width:561px){ .hm-tiles{display:flex;flex-wrap:nowrap;gap:8px} .hm-tile{flex:1 1 0;padding:8px 10px} .hm-tile .k{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:10.5px} .hm-tile .s{font-size:11.5px;line-height:1.3} }
@media (min-width:561px) and (max-width:1020px){ .hm-tile .v{font-size:19px} .hm-tile .s{display:none} }
@media (max-width:900px){ .hm-grid{grid-template-columns:1fr} }
@media (max-width:560px){
  .hm-tiles{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .hm-tile{padding:8px 10px} .hm-tile .v{font-size:20px}
  table.hm-due td{padding:0}
  .stack-due tr{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"job st" "client client" "date date"}
  .stack-due td.c-job{grid-area:job} .stack-due td.c-st{grid-area:st;justify-self:end}
  .stack-due td.c-client{grid-area:client} .stack-due td.c-date{grid-area:date;font-size:13px;color:var(--muted)}
}
.muted{color:var(--muted)}
/* ---------- portal terms mode (v125, Super Admin / Admin): each part of the page shows its name ---------- */
.nav-check{display:flex;align-items:center;gap:10px;padding:9px 12px;border-radius:6px;color:var(--ink);font-weight:500;cursor:pointer;border:1px dashed var(--frame);margin-top:6px;user-select:none;-webkit-user-select:none}
@media (hover:hover){ .nav-check:hover{background:var(--surface-2)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.nav-check input{width:18px;height:18px;margin:0;accent-color:#2457E6;flex:none;cursor:pointer}
.shell.rail .nav-check{justify-content:center;padding-left:0;padding-right:0}
.shell.rail .nav-check .nl{display:none}
body.terms-on [data-term]{outline:2px dashed #2457E6;outline-offset:2px}
body.terms-on [data-term]::before{content:attr(data-term);position:absolute;top:-9px;left:6px;z-index:6;pointer-events:none;display:inline-block;margin:0;padding:1px 6px;border-radius:3px;background:#2457E6;color:#fff;font:700 10px/1.5 var(--sans);letter-spacing:.06em;text-transform:uppercase;white-space:nowrap;vertical-align:middle;text-indent:0}
body.terms-on .lede,body.terms-on .page-head > .meta{font-size:0!important;min-height:18px}
body.terms-on .lede *{display:none}
body.terms-on .page-head > .meta::before{font-size:10px}
.shell.rail nav.side [data-term]::before{display:none}
/* v127: round "terms off" button, bottom-left, only while portal terms are shown */
.terms-off{position:fixed;left:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 20px);z-index:16;width:48px;height:48px;border-radius:50%;border:2px solid #fff;background:#2457E6;color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 18px rgba(10,20,35,.35)}
.terms-off[hidden]{display:none}
@media (hover:hover){ .terms-off:hover{filter:brightness(1.15)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.terms-off.counting{width:auto;padding:0 16px 0 12px;border-radius:24px;background:#3A1F8F;grid-auto-flow:column;gap:6px;font:600 15px/1 var(--sans)}
.terms-off .cd{min-width:20px;height:18px;padding:0 3px;border-radius:9px;background:#fff;color:#3A1F8F;display:inline-grid;place-items:center;font:700 11px/1 var(--sans);font-variant-numeric:tabular-nums}
.terms-off svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.shell.rail nav.side[data-term]::before{display:none}
body.terms-on .topbar-in[data-term]::before{top:1px}
body.terms-on .forms-tools[data-term]::before,body.terms-on .page-head > .meta[data-term]::before,body.terms-on #foldFab[data-term]::before{left:auto;right:4px}
body.terms-on #foldFab[data-term]::before{top:-20px;right:0}
body.terms-on th[data-term]::before{top:3px;left:auto;right:4px}
body.terms-on .panel-body[data-term]::before{top:2px;left:auto;right:6px}
body.terms-on h1[data-term]::before{top:-15px;left:0}
body.terms-on #nav[data-term]{padding-top:18px}
body.terms-on #nav[data-term]::before{top:2px}
body.terms-on .lede[data-term],body.terms-on .page-head > .meta[data-term]{min-height:16px;margin-top:10px}
@media (max-width:820px){ body.terms-on td[data-term]::before{content:attr(data-term-ph)} }
/* ---------- client records (v121) ---------- */
.cr-rec{padding:12px 0;border-bottom:1px solid var(--divider)}
.cr-rec:last-child{border-bottom:0}
.cr-top{display:flex;align-items:flex-start;gap:10px;flex-wrap:wrap}
.cr-title{font-weight:600;font-size:15px;flex:1 1 220px;min-width:0;overflow-wrap:anywhere}
.cr-date{font-size:13.5px;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.cr-cat{display:inline-flex;align-items:center;gap:5px;padding:2px 8px;border-radius:4px;border:1.5px solid var(--steel);color:var(--link);background:var(--surface);font-size:11.5px;font-weight:700;letter-spacing:.05em;text-transform:uppercase;white-space:nowrap}
.cr-meta{font-size:13.5px;color:var(--muted);margin-top:3px}
.cr-meta .job{font-family:var(--mono);color:var(--ink);font-weight:600}
.cr-text{margin-top:6px;font-size:14.5px;white-space:pre-wrap;overflow-wrap:anywhere}
.cr-files{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.cr-file{display:inline-flex;align-items:center;gap:8px;max-width:100%;padding:5px 10px 5px 5px;border:1px solid var(--divider);border-radius:6px;background:var(--surface-2);color:var(--ink);text-decoration:none;font-size:13px}
@media (hover:hover){ .cr-file:hover{border-color:var(--steel)} }
.cr-file .th{width:44px;height:44px;flex:none;border-radius:4px;overflow:hidden;background:#fff;display:grid;place-items:center;border:1px solid var(--divider)}
.cr-file .th img{width:100%;height:100%;max-width:none;object-fit:cover}
.cr-file .th b{font-size:11px;letter-spacing:.06em;color:#fff;background:var(--bad-bg);padding:2px 4px;border-radius:3px}
.cr-file .nm{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:240px}
.cr-file .sz{color:var(--muted);font-size:12px;white-space:nowrap}
.cr-file button{border:0;background:none;color:var(--muted);cursor:pointer;padding:4px;display:grid;place-items:center}
@media (hover:hover){ .cr-file button:hover{color:var(--bad)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.cr-file button svg{width:14px;height:14px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
.cr-acts{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}
.cr-drop{border:2px dashed var(--frame);border-radius:8px;padding:12px;text-align:center;color:var(--muted);font-size:13px}
.cr-drop.drag{border-color:var(--steel);border-style:solid}
.cr-link{margin-left:0}
@media (max-width:560px){ .cr-file .nm{max-width:170px} .cr-date{margin-left:auto} }
/* floating Collapse-all: appears once the page's own Collapse all button has scrolled out of sight */
.fold-fab{position:fixed;right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 20px);z-index:15;display:flex;flex-direction:column;align-items:flex-end;gap:8px}
.ff-btn{width:48px;height:48px;border-radius:50%;border:2px solid #fff;background:#3A1F8F;color:#fff;display:grid;place-items:center;cursor:pointer;box-shadow:0 6px 18px rgba(10,20,35,.35)}
@media (hover:hover){ .ff-btn:hover{filter:brightness(1.15)} }   /* v606: mouse only — on touch it stuck while dragging */
.ff-btn[aria-expanded="true"]{background:#2457E6}
.ff-row{display:flex;gap:10px;align-items:center}
.ff-btn[hidden]{display:none}
.ff-btn.ff-back{width:auto;padding:0 18px 0 12px;border-radius:24px;grid-auto-flow:column;gap:4px;font:600 15px/1 var(--sans)}   /* v115 "‹ Back" pill; v116 sits left of the round button */
.ff-btn svg,.ff-pop svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ff-pop{background:var(--surface);border:2px solid #3A1F8F;border-radius:8px;padding:8px;box-shadow:0 8px 24px rgba(10,20,35,.3)}
.ff-pop .btn{min-height:40px;white-space:nowrap}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}
/* list text sizes (v99 phone, v100 desktop too): one set of sizes for both, so changes apply everywhere */
@media all{
  table.pj,table.it,table.clients,table.forms,table.hm-due{font-size:14.5px}
  table.pj .cmeta,table.it .cmeta,table.cl-main .cmeta,table.clients .cmeta{font-size:13.5px}
  table.pj .mono,table.it .mono,table.clients .cno,table.cl-main .cmeta .cno,table.forms td.c-rev{font-size:13.5px}
  table.pj .lbl,table.it .lbl,table.ci .lbl{font-size:13px}
  table.clients .caddr,table.cl-main .caddr,table.clients td.c-ph,table.clients td.c-term{font-size:14px}
  table.forms .fno,table.stack-forms td.c-date,table.stack-due td.c-date{font-size:14px}
  table.hm-due .hm-sub,table.pj .pj-unb,table.pj .pj-up{font-size:13px}
  table.pj .fno{font-size:14.5px}
}

/* v335 RULE — standard MDR form page (QC002, QC002a, QC002b, QC008, QC016, QC016a and every new form):
   page margins 24 top / 26 sides / 52 bottom; ONE outer 1.5px line + 4px gap + the form's own 1.5px box = 2 lines (v336);
   MDR footer (job · page no.) sits UNDER the frame (bottom 16px, same side margins) — never inside or touching it. */
.qc-sheet.q8-sheet,.qc-sheet.q2b-sheet{padding:24px 26px 52px}
.q2-frame,.q2b-frame{border:1.5px solid #000;padding:4px}   /* v336: 2 lines only = this outer line + the form box */
.mf-fr > *{flex:none}
.qc-sheet.q8-sheet > .mp-ft,.qc-sheet.q2b-sheet > .mp-ft{left:26px;right:26px;bottom:16px}

/* v337 TOC PDF: Total Pages number sits in the NO. OF SHEETS column (centred), caption right next to it */
.qc-sheet.mp-toc .mp-tt tfoot tr.mp-tot td{border:0;height:30px;padding-top:8px;font-size:13px;color:#1C2530;background:#fff}
.qc-sheet.mp-toc .mp-tt tfoot tr.mp-tot td:first-child{text-align:right;width:auto;padding-right:4px}
.qc-sheet.mp-toc .mp-tt tfoot tr.mp-tot td:last-child{text-align:center}.mp-toc .mp-tt tr.mp-tot b{font-size:15px;color:#3A1F8F}

/* v338 RULE: every company stamp sits CENTRED on its signing line — the stamp box has exactly the line's width / margins */
.q2b-st{padding-left:0;width:230px;margin-left:70px;justify-content:center}
.q16-st{margin:0 10px 0 70px}

/* v339 QC016 PDF inspection lines: one grid — label | no. (1 / 2) | : | value; all colons in one column */
.q16-ig{display:grid;grid-template-columns:max-content 14px 16px 1fr;align-items:end;row-gap:9px;margin-bottom:9px}
.q16-ig .q16-in{text-align:right}.q16-ig .q16-ic{text-align:center}.q16-ig .q16-ik{padding-right:6px}

/* v341 QC016: the stamp must not make the page taller (it pushed the frame over the MDR footer) — fixed signing area, stamp drawn over it, centred on the line */
.q16-st{flex:none;height:58px;min-height:0;position:relative;display:block}
.q16-st img{position:absolute;left:50%;top:50%;transform:translate(-50%,-62%)}

/* v342 Saved MDR row: Generate MDR / Edit / Delete bigger (desktop + phone); phone = one row, equal widths */
.md-sv-a{gap:8px}
.md-sv-a .btn.btn-sm{min-height:42px!important;padding:8px 16px!important;font-size:15px;gap:7px}
.md-sv-a .btn.btn-sm svg{width:18px;height:18px}
@media (max-width:820px){ .md-sv-a{margin-top:8px} .md-sv-a .btn.btn-sm{flex:1 1 0;min-width:0;justify-content:center;padding:8px 6px!important;white-space:nowrap} .md-sv-a .btn.btn-sm.btn-primary{flex:1.9 1 0} .md-sv-a .btn.btn-sm.btn-primary svg{display:none} }
@media (max-width:380px){ .md-sv-a .btn.btn-sm{font-size:14px} .md-sv-a .btn.btn-sm svg{display:none} }

/* v343 RULE: every company stamp is a BACKGROUND — drawn behind lines and text (like QC002 v271). The sheet is its own stacking layer (z-index 0) so the stamp stays above the white page. */
.qc-sheet{z-index:0}
.qs-stamp img,.q8-st img,.q2b-st img,.mp-sv img{position:relative;z-index:-1}
.q16-st img{z-index:-1}
.q8-st,.q2b-st,.q16-st,.qs-stamp{pointer-events:none}
/* stamp straddles its signing line (line + name drawn over it) */
.qs-stamp img,.q2b-st img{transform:translateY(30px)}
.mp-sv img{transform:translateY(22px)}

/* v344 QC016a top section = Kah Poh's ISO form: columns ≈ 51% | 27% | 22%; bottom line = RV's Dwg / PO NO. in the left column only, "Sheet : k of n" spans Prepared + Reviewed, right-aligned */
.q16a-info{grid-template-columns:51fr 27fr 22fr}
.q16a-kv.r4{grid-column:1;border-right:1px solid #000}
.q16a-sh{grid-column:2 / 4;border-left:0;padding-right:12px}

/* v350: MDR TOC — locked tick (row has a saved form or a typed Pg no.; can't be unticked) */
.md-cbw{display:inline-grid;place-items:center;width:22px;height:22px;position:relative}
.md-lk{display:inline-grid;place-items:center;width:22px;height:22px;border-radius:4px;background:#3A1F8F;color:#fff;font-size:14px;font-weight:700;line-height:1;cursor:not-allowed;position:relative}
.md-lk[hidden]{display:none}
.md-lki{position:absolute;right:-6px;bottom:-6px;width:13px;height:13px;border-radius:50%;background:#fff;border:1.5px solid #3A1F8F;display:grid;place-items:center}
.md-lki svg{width:8px;height:8px;stroke:#3A1F8F;fill:none;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.md-g0 > .toc-r.head .md-lk{background:#2457E6}
.toast.warn{background:#F2C230;color:#1C2530;border-color:#C99A00}
/* v351: MDR TOC — Preview PDF + Remove form side by side */
.md-tr{grid-template-columns:24px 24px minmax(0,1fr) auto 44px}
.md-pvw{display:inline-flex;gap:6px;justify-self:end}
.md-rmf{width:36px;height:32px;padding:0;display:inline-grid;place-items:center;border:1px solid #C62828;border-radius:6px;background:var(--surface);color:#C62828;cursor:pointer}
.md-rmf svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
@media (hover:hover){ .md-rmf:hover{background:#C62828;color:#fff} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
@media (max-width:820px){ .md-tr{grid-template-columns:24px 20px minmax(0,1fr) auto 40px} .md-rmf{width:34px;height:34px} .md-pvw{gap:4px} }
/* v352 PICTURE SHEET MASTER (QC008, QC002a, QC016a + new picture forms) — info block 4 rows fixed height, rows share it evenly; values bold, captions normal */
.ps-info{display:grid;border:1.5px solid #000;height:112px;font-size:14px;flex:none}
.ps-l .ps-info{grid-template-columns:1.05fr 1.45fr 1.25fr 1.25fr}   /* v410: Prepared By starts at the page centre; Prepared / Reviewed share the right half evenly */
.ps-p .ps-info{grid-template-columns:2fr 1fr 1fr;border-top:0}   /* v410: same rule as landscape */
.ps-col{display:grid;grid-template-columns:max-content 12px minmax(0,1fr);border-right:1px solid #000;min-width:0}
.ps-k,.ps-c,.ps-v{display:flex;align-items:center;border-bottom:1px solid #000;min-width:0}
.ps-k{padding:0 0 0 6px;white-space:nowrap}
.ps-c{justify-content:center}
.ps-v{padding:0 6px 0 2px;overflow-wrap:anywhere;line-height:1.15}
.ps-k.ps-last,.ps-c.ps-last,.ps-v.ps-last{border-bottom:0}
.ps-sg{position:relative;border-right:1px solid #000;padding:3px 6px;min-width:0}
.ps-sg:last-child{border-right:0}
.ps-sgk{font-size:13.5px}
.ps-sgn{position:absolute;left:6px;right:6px;bottom:4px;font-size:13px;line-height:1.25}
.ps-p .ps-sgn{text-align:center}
.mf-fr > .ps-draw,.q2b-frame > .ps-draw{flex:1 1 auto;min-height:0;border:1.5px solid #000;border-top:0;display:flex;flex-direction:column;padding:10px 14px 8px}
.mf-fr > .ps-draw.ps-fill,.q2b-frame > .ps-draw.ps-fill{padding:2px}
.ps-img{flex:1 1 auto;position:relative;min-height:0}
.ps-img img{position:absolute;inset:0;width:100%;height:100%;max-width:none;object-fit:contain}
.ps-fill .ps-img img{object-fit:fill}
.ps-sh{text-align:right;font-size:14px;padding:0 2px 6px}
.ps-fill .ps-sh{padding:4px 12px 4px}
.ps-leg{font-size:13.5px;line-height:1.35;padding-top:4px;flex:none}
.ps-fill .ps-leg{padding:4px 12px 2px}
.ps-p .qs-ti.ps-ti{font-size:20px}
/* v353: FORMS menu — "Form list" fold (All forms + departments) + Master sheets page */
.nav-sub-head{display:flex;align-items:center;gap:10px;width:100%;padding:11px 12px;border:0;background:none;border-radius:6px;color:var(--ink);font:inherit;font-weight:600;cursor:pointer;text-align:left;border-left:3px solid transparent}
@media (hover:hover){ .nav-sub-head:hover{background:var(--surface-2)} }
.nav-sub-head svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.nav-sub-head .nl{flex:1}
.nav-sub-head .cnt{font-size:11px;font-weight:600;color:var(--muted);background:var(--surface-2);border-radius:10px;padding:0 7px;line-height:18px}
.nav-sub-head .chev{width:16px;height:16px;transition:transform .15s}
.nav-sub-head[aria-expanded="false"] .chev{transform:rotate(-90deg)}
.nav-sub{display:flex;flex-direction:column;gap:2px;margin-left:12px;padding-left:6px;border-left:2px solid var(--divider)}
.nav-sub[hidden]{display:none}
.shell.rail .nav-sub-head .cnt{display:none}
.ms-grid{display:grid;grid-template-columns:1.42fr 1fr;gap:16px;align-items:start}
.ms-fig{margin:0;display:flex;flex-direction:column;gap:6px;min-width:0}
.ms-fig figcaption{display:flex;gap:8px;align-items:baseline}
.ms-fig figcaption span{color:var(--muted);font-size:13px}
.ms-view{display:block;width:100%;padding:0;border:1px solid var(--frame);border-radius:6px;background:#fff;cursor:zoom-in;overflow:hidden}
.ms-box{position:relative;width:100%;overflow:hidden}
.ms-box > .qc-sheet{box-shadow:none}
.ms-acts{display:flex;justify-content:flex-end;margin:10px 0 4px}
.ms-h{font-family:var(--cond);font-size:15px;margin:18px 0 6px;color:var(--ink)}
.ms-ul{margin:0;padding-left:20px;line-height:1.55}
.ms-tb td{vertical-align:top}
.ms-link{display:grid;gap:8px}
.ms-lg{display:grid;grid-template-columns:minmax(0,260px) minmax(0,1fr);gap:10px}
@media (max-width:820px){ .ms-grid{grid-template-columns:1fr} .ms-lg{grid-template-columns:1fr;gap:2px} }
.ms-tb td:nth-child(2),.ms-tb td:nth-child(5){white-space:nowrap}
@media (max-width:820px){ .ms-tb td[data-l]:not(:first-child)::before{content:attr(data-l) " : ";color:var(--muted);font-size:12.5px;font-weight:600} .ms-tb td:nth-child(2),.ms-tb td:nth-child(5){white-space:normal} }
/* v355 (Kah Poh): portrait picture sheets — the picture runs right up to the info block; "Sheet : k of n" sits over the top-right corner of the picture */
.q2b-frame > .ps-draw{position:relative;padding-top:4px}
.ps-p .ps-sh{position:absolute;top:6px;right:12px;z-index:1;padding:0}
.ps-p .ps-img img{object-position:50% 0%}
.md-hcov{margin-left:auto;flex:none}
/* v358 Master sheets: rules bigger, sample sheets behind a button, forms list in its own folded panel */
#msBody .ms-ul{font-size:16px;line-height:1.6}
#msBody .ms-ul li{margin:2px 0}
#msBody .ms-h{font-size:16.5px}
#msBody .ms-acts{justify-content:flex-start;flex-wrap:wrap;gap:8px;margin:16px 0 10px}
#msBody .ms-tg svg{transition:transform .15s}
#msBody .ms-tg[aria-expanded="true"] svg{transform:rotate(180deg)}
#msBody .ms-grid[hidden]{display:none}
#msBody .panel-body > .ms-h:first-child{margin-top:0}
@media (max-width:560px){ #msBody .ms-acts .btn{flex:1 1 0;min-width:0;white-space:normal;line-height:1.25;padding-left:8px;padding-right:8px;font-size:14px} #msBody .ms-acts .btn svg{display:none} }
/* v359 Paste clipping beside Add PDF or photo */
.q8-tip{font-size:13px;color:var(--muted)}
@media (max-width:820px){ .q8-tip{display:none} }
@media (max-width:560px){ .q8-add > .btn{flex:1 1 0;min-width:0;white-space:normal;line-height:1.25;padding-left:8px;padding-right:8px} }
/* v360 Screen clipping: waiting note */
.q8-wait{display:flex;flex-wrap:wrap;gap:4px 10px;align-items:baseline;margin:6px 0 4px;padding:8px 12px;border-radius:6px;background:#F2C230;color:#1C2530;font-size:14px}
/* v361 source tag on sheet thumbnails: ▤ PDF / ▣ PHOTO / ✂ CLIPPING */
.q8-th{position:relative}
.fk-src{position:absolute;left:3px;bottom:3px;padding:1px 5px;border-radius:4px;font-size:10px;font-weight:700;letter-spacing:.04em;line-height:15px;white-space:nowrap;pointer-events:none;color:#fff;box-shadow:0 0 0 1px #fff}
.fk-src[hidden]{display:none}
.fk-src-pdf{background:#3A1F8F}
.fk-src-photo{background:#2457E6}
.fk-src-clip{background:#1C2530}
/* v363 pictures per sheet (1 / 4 / 9): sheet grid + editor cards */
.ps-multi .ps-grid{display:grid;gap:8px}
.ps-cell{position:relative;min-width:0;min-height:0}
.ps-grid .ps-cell img{object-fit:contain!important;object-position:50% 50%!important}
.ps-sc .q2-ih{justify-content:flex-start;flex-wrap:wrap}
.ps-seg{display:inline-flex;align-items:center;gap:4px;margin-left:auto}
.ps-segl{font-size:12.5px;color:var(--muted);margin-right:2px;white-space:nowrap}
.ps-sb{min-width:34px;height:30px;padding:0 8px;border:1.5px solid var(--steel);background:var(--surface);color:var(--steel);border-radius:6px;font:inherit;font-weight:700;cursor:pointer}
.ps-sb.on{background:var(--navy);border-color:var(--navy);color:#fff}
.ps-sc .q2-ih .q8-ac{flex-direction:row}
.ps-sc .q2-ih .q8-ac{margin-left:10px}
.ps-sc .q2-ih > b + .q8-ac{margin-left:auto}
.ps-one{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;align-items:center;margin-top:4px}
.ps-tg{display:grid;grid-template-columns:repeat(var(--c),minmax(0,130px));gap:10px;margin:6px 0 8px}
.ps-tc{display:flex;flex-direction:column;gap:4px;min-width:0}
.ps-tc .q8-th{width:100%;height:88px}
.ps-tb{display:flex;gap:4px;justify-content:center}
.ps-tb .icon-btn{width:32px;height:30px}
.ps-tslot{border:1.5px dashed var(--frame);border-radius:4px;height:88px;display:grid;place-items:center;color:var(--muted);font-size:12.5px}
.ps-sc-m .q2a-grid{margin-top:2px}
@media (max-width:560px){ .ps-tg{grid-template-columns:repeat(var(--c),minmax(0,1fr));gap:8px} .ps-tc .q8-th,.ps-tslot{height:64px} .ps-tb .icon-btn{width:28px;height:28px} .ps-one{grid-template-columns:72px minmax(0,1fr)} .ps-one .q8-th{width:72px;height:52px} .ps-seg{margin-left:0;order:3;flex:1 1 100%} .ps-sc .q2-ih .q8-ac{margin-left:auto} }
/* v364: compact sheet cards; QC002a grid pictures fill their box; portrait sheet no. on a white label */
.ps-gfill .ps-cell img{object-fit:fill!important}
.ps-tg{grid-template-columns:repeat(auto-fill,130px);gap:8px 10px;margin:4px 0 2px}
.ps-tc .q8-th{height:84px}
.ps-tslot{height:84px}
.ps-tb .icon-btn{width:30px;height:26px}
.ps-sc .q2-ih{margin-bottom:2px}
.ps-sc1{display:grid;grid-template-columns:96px minmax(0,1fr);gap:12px;align-items:center;padding:6px 8px}
.ps-1i{display:flex;flex-wrap:wrap;align-items:center;gap:4px 14px;min-width:0}
.ps-1i > b{flex:none}
.ps-1i .q8-nm{flex:1 1 160px;min-width:0;font-weight:500;color:var(--muted);font-size:13.5px}
.ps-1i .ps-seg{margin-left:0}
.ps-1i > .q8-ac{flex-direction:row;margin-left:0}
.ps-p .ps-sh{background:#fff;border:1px solid #000;padding:1px 8px;line-height:1.3}
@media (max-width:560px){ .ps-tg{grid-template-columns:repeat(auto-fill,minmax(70px,1fr));gap:6px} .ps-tc .q8-th,.ps-tslot{height:58px} .ps-tb .icon-btn{width:24px;height:26px} .ps-tb{gap:2px}
  .ps-tg{grid-template-columns:repeat(4,minmax(0,1fr))}
  .ps-sc1{grid-template-columns:72px minmax(0,1fr);gap:8px} .ps-sc1 .q8-th{width:72px;height:52px} .ps-1i{gap:4px 6px} .ps-1i .q8-nm{flex:1 1 100%;order:-1;margin-top:-2px} .ps-1i > b{order:-2;flex:1 1 100%} .ps-1i .ps-segl{display:none} .ps-1i .ps-seg{order:0;flex:none} .ps-1i > .q8-ac{margin-left:auto;flex-direction:row} .ps-1i > .q8-ac .icon-btn{width:30px;height:30px} }
/* v366 MDR TOC tab: Cover details · Generate MDR · Cancel in the panel heading */
.md-hacts{display:flex;gap:6px;margin-left:auto;flex:none;align-items:center}
.md-hacts .md-hcov{margin-left:0}
@media (max-width:560px){ .panel-head:has(> .md-hacts){flex-wrap:wrap;row-gap:6px} .md-hacts{flex:1 1 100%;margin-left:0} .md-hacts .btn{flex:1 1 0;min-width:0;padding-left:6px;padding-right:6px;white-space:nowrap;justify-content:center;text-align:center} /* v408: text centred in each button (Cancel was left) */ .md-hacts .btn svg{display:none} }
/* v367 Cover details also in the TOC tab bottom row */
@media (max-width:560px){ .md-acts .md-bcov svg{display:none} }
/* v368 Layout switch on picture forms */
.ps-lay{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px}
.ps-lay .ps-seg{margin-left:0}
.ps-lb{padding:0 12px;height:34px}
.ps-layn{font-size:13px;font-weight:600;color:#1C2530;background:#F2C230;border-radius:4px;padding:2px 8px}
/* v369: TOC row of the form just closed; picture-box shape letter on the per-sheet buttons */
.md-tr.md-last{background:#F2C230 !important;color:#1C2530;box-shadow:inset 4px 0 0 #3A1F8F;border-radius:4px}
.md-tr.md-last .md-fno,.md-tr.md-last .md-sec{color:#1C2530}
.md-lastb{display:inline-block;margin-left:8px;padding:1px 7px;border-radius:4px;background:#3A1F8F;color:#fff;font-size:11.5px;font-weight:700;letter-spacing:.02em;white-space:nowrap;vertical-align:1px}
.ps-sb small{font-size:10.5px;font-weight:700;margin-left:1px;opacity:.85}
.ps-sb{min-width:38px}
/* v371 sheet card: Per sheet buttons on the right, ↑ ↓ ✕ right under them */
.ps-sc .q2-ih{flex-wrap:nowrap;align-items:flex-start}
.ps-rc{display:flex;flex-direction:column;align-items:flex-end;gap:6px;margin-left:auto;flex:none}
.ps-rc .ps-seg{margin-left:0!important;order:0!important;flex:none!important}
.ps-rc > .q8-ac{flex-direction:row!important;margin-left:0!important}
.ps-1i{flex-wrap:nowrap;align-items:center;gap:8px 14px}
.ps-1l{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:2px}
.ps-1l .q8-nm{flex:none;order:0!important;margin:0!important}
.ps-1l > b{order:0!important;flex:none!important}
@media (max-width:560px){
  .ps-sc .q2-ih{flex-wrap:wrap;row-gap:6px}
  .ps-sc .q2-ih > b{flex:1 1 100%}
  .ps-1i{flex-wrap:wrap;gap:6px}
  .ps-1l{flex:1 1 100%}
  .ps-rc .ps-segl{display:none}
  .ps-rc > .q8-ac .icon-btn{width:32px;height:30px}
  .ps-1i .ps-rc{flex:1 1 100%;min-width:0}
  .ps-rc .ps-seg{gap:3px;flex-wrap:nowrap}
  .ps-rc .ps-sb{min-width:0;padding:0 5px;height:30px} }
/* v372 sheet card with a picture group (2+ per sheet): Per sheet + ↑ ↓ ✕ side by side in ONE row at the top */
.ps-sc-m .ps-rc{flex-direction:row;align-items:center;gap:10px}
.ps-sc-m .q2-ih{align-items:center}
@media (max-width:560px){ .ps-sc-m .ps-rc{flex:1 1 100%;justify-content:flex-end;gap:8px} .ps-sc-m .ps-rc > .q8-ac{gap:3px} .ps-sc-m .ps-rc > .q8-ac .icon-btn{width:30px} }
/* v373 every sheet card the same: Per sheet + ↑ ↓ ✕ in ONE row (also 1-picture cards) */
.ps-rc{flex-direction:row;align-items:center;gap:10px}
.ps-sc .q2-ih,.ps-1i{align-items:center}
@media (max-width:560px){ .ps-rc{flex:1 1 100%;justify-content:flex-end;gap:8px} .ps-rc > .q8-ac{gap:3px} .ps-rc > .q8-ac .icon-btn{width:30px} }
@media (max-width:560px){ .ps-sc1 > .ps-1i{display:contents} .ps-sc1 > .ps-1i > .ps-rc{grid-column:1 / -1} .ps-sc1{row-gap:6px} }
/* v374 scale matrix: stretched photo in a grid box */
.ps-grid .ps-cell img.ps-ff{object-fit:fill!important}
/* v376 Master sheets: photo scale matrix */
.mx-box{display:grid;grid-template-columns:1fr 1fr;gap:14px 20px}
.mx-w{min-width:0}
.mx-t{font-weight:700;font-size:14.5px;margin-bottom:6px;color:var(--ink)}
table.mx{width:100%;border-collapse:collapse;table-layout:fixed;font-size:13.5px}
table.mx th,table.mx td{border:1px solid var(--divider);padding:5px 4px;text-align:center;vertical-align:middle}
table.mx thead th{background:var(--surface-2);font-weight:700;color:var(--ink);font-size:15px;text-transform:none;letter-spacing:0}
table.mx thead th small{font-size:11px;font-weight:700;margin-left:1px}
table.mx thead th:first-child,table.mx tbody th{width:96px;text-align:left;font-size:12.5px;font-weight:600;color:var(--muted);text-transform:none;letter-spacing:0}
table.mx tbody th{color:var(--ink);font-size:13.5px}
.mx-c{display:inline-flex;flex-direction:column;align-items:center;gap:1px;min-width:52px;padding:3px 4px;border:1.5px solid #3A1F8F;border-radius:5px;background:#fff;color:#3A1F8F;line-height:1.15}
.mx-c b{font-size:13px;white-space:nowrap}
.mx-c small{font-size:10.5px;font-weight:600}
.mx-c.mx-f{background:#3A1F8F;color:#fff}
.mx-key{grid-column:1 / -1;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;font-size:13.5px;color:var(--muted)}
.mx-key .mx-c{margin-left:6px}
.mx-key .mx-c:first-child{margin-left:0}
@media (max-width:820px){ .mx-box{grid-template-columns:1fr} }
@media (max-width:560px){ table.mx{font-size:12px} table.mx thead th:first-child,table.mx tbody th{width:64px;font-size:11.5px} table.mx th,table.mx td{padding:4px 2px} .mx-c{min-width:0;width:100%;padding:3px 1px} .mx-c b{font-size:11px} .mx-c small{font-size:9.5px} .mx-key{font-size:12.5px} }
@media (max-width:560px){ .mx-key .mx-c{width:auto;min-width:52px;padding:3px 4px} .mx-key .mx-c b{font-size:12px} }
/* v377 matrix: tables stacked (more room), chips sized to their cell — never wider than the cell */
.mx-box{grid-template-columns:1fr;max-width:760px}
table.mx td{padding:4px}
table.mx td .mx-c{box-sizing:border-box;width:100%;min-width:0;max-width:96px;padding:3px 2px;overflow:hidden}
table.mx td .mx-c b,table.mx td .mx-c small{max-width:100%;overflow:hidden;text-overflow:clip}
@media (max-width:560px){ table.mx td{padding:3px 2px} table.mx td .mx-c b{font-size:10.5px;letter-spacing:-.2px} }
/* v377 phone: turned matrix table */
table.mx.mx-ph{display:none}
@media (max-width:560px){ table.mx:not(.mx-ph){display:none} table.mx.mx-ph{display:table}
  table.mx.mx-ph thead th{font-size:13px;text-align:center} table.mx.mx-ph thead th:first-child{width:76px;text-align:left}
  table.mx.mx-ph tbody th{width:76px;font-size:16px;font-weight:700} table.mx.mx-ph tbody th small{font-size:11.5px;margin-left:1px}
  table.mx.mx-ph td{padding:4px 6px} table.mx.mx-ph td .mx-c{max-width:none;flex-direction:row;justify-content:center;gap:8px;padding:5px 6px}
  table.mx.mx-ph td .mx-c b{font-size:13.5px;letter-spacing:0} table.mx.mx-ph td .mx-c small{font-size:12px} }
@media (max-width:560px){ table.mx.mx-ph td .mx-c{flex-direction:column;gap:1px;padding:4px 4px;overflow:visible} table.mx.mx-ph td .mx-c b,table.mx.mx-ph td .mx-c small{overflow:visible;white-space:nowrap} table.mx.mx-ph tbody th,table.mx.mx-ph thead th:first-child{width:64px} table.mx.mx-ph thead th{white-space:normal;line-height:1.2} }
/* v378 sheet card tick: Whole photo (no stretch) */
.ps-wh{display:inline-flex;align-items:center;gap:6px;font-size:13.5px;font-weight:500;color:var(--ink);margin:0 0 0 12px;white-space:nowrap;cursor:pointer}
.ps-wh input{width:18px;height:18px;margin:0;accent-color:#3A1F8F}
.ps-1l .ps-wh{margin:4px 0 0}
@media (max-width:560px){ .ps-sc .q2-ih > .ps-wh{margin:0;flex:1 1 100%;order:1} .ps-sc .q2-ih > .ps-rc{order:2} }
/* v379 Whole photo tick on every sheet card: fixed-on version (sizes that never stretch) */
.ps-wh-on{cursor:default}
.ps-whb{display:inline-grid;place-items:center;width:18px;height:18px;border-radius:3px;background:#3A1F8F;color:#fff;font-size:12px;font-weight:700;line-height:1}
/* v381 1-photo sheet unticked "Whole photo" → stretched */
.ps-img img.ps-ff{object-fit:fill!important}
/* v383 Ratio tick = lock icon (closed = locked, open = unlocked) */
.ps-wh .ps-lkin{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.ps-wh{position:relative;gap:6px}
.ps-lk{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:6px;border:2px solid #8A96A3;background:#fff;color:#6B7785}
.ps-lk svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.ps-lk .lk-c{display:none}
.ps-wh .ps-lkin:checked ~ .ps-lk{background:#3A1F8F;border-color:#3A1F8F;color:#fff}
.ps-wh .ps-lkin:checked ~ .ps-lk .lk-c{display:block}
.ps-wh .ps-lkin:checked ~ .ps-lk .lk-o{display:none}
.ps-wh .ps-lkin:focus-visible ~ .ps-lk{outline:3px solid #2457E6;outline-offset:2px}
/* v384 Ratio lock: in the button row (size buttons · lock · arrows), locked = steel blue (not navy like the chosen size) */
.ps-rc > .ps-wh{margin:0!important;order:0!important;flex:none!important;gap:5px}
.ps-wh .ps-lkin:checked ~ .ps-lk{background:#2457E6;border-color:#2457E6;color:#fff}
@media (max-width:560px){ .ps-rc > .ps-wh .ps-whl{display:none} .ps-rc > .ps-wh .ps-lk{width:30px;height:30px} }
/* v393 form title that can switch to its short form */
.fk-ht{display:block}

/* v402–v406 (Kah Poh): phone MDR TOC tab — compact rows.
   v406 layout: LEFT column = section no. on top, tick box under it. Next column = form no. (same place on every row, used or not).
   Used row with a portal form: line 1 = section · form no. · Open form · PDF · ✕ · Pg; line 2 = tick · form name. Other rows: tick · form no. + name. */
@media (max-width:560px){
  .md-toc .toc-r{padding-top:3px;padding-bottom:3px;font-size:14px;line-height:1.3}
  .md-toc .toc-r{grid-template-columns:36px minmax(0,1fr) auto auto;gap:2px 4px;align-items:center}
  .md-toc > .toc-r{padding-left:10px;padding-right:10px}
  .md-toc .toc-r > .md-sec{grid-column:1;grid-row:1;font-size:11.5px;overflow:hidden;align-self:end}
  .md-toc .toc-r > .md-sec:empty{display:none}
  .md-toc .toc-r > :first-child{grid-column:1;grid-row:2;justify-self:start;align-self:start}
  .md-toc .toc-r:has(> .md-sec:empty) > :first-child{grid-row:1;align-self:center}
  .md-toc .toc-r > .toc-t{grid-column:2;grid-row:1 / span 2;align-self:center;padding-left:0!important}
  .md-toc .toc-r:has(> .md-sec:empty) > .toc-t{grid-row:1}
  .md-toc .toc-r > .md-pvw{grid-column:3;grid-row:1 / span 2}
  .md-toc .toc-r > .md-shi,.md-toc .toc-r > .md-sh{grid-column:4;grid-row:1 / span 2}
  .md-toc .toc-r > span:empty:not(:first-child):not(.md-sec){display:none}
  .md-toc .toc-r:has(> .md-sh:last-child){grid-template-columns:36px minmax(0,1fr)}
  .md-toc .toc-t > .md-fno{margin-right:6px}
  .md-toc .toc-r.head .toc-t{font-size:14px;line-height:1.3}
  /* used row with a portal form: 2 lines */
  .md-toc .md-tr.md-2l{grid-template-columns:36px auto minmax(0,1fr) auto auto auto;gap:2px 3px}
  .md-toc .md-tr.md-2l > .md-sec{align-self:center}
  .md-toc .md-tr.md-2l > :first-child{align-self:start;margin-top:2px}
  .md-toc .md-tr.md-2l > .md-fno{grid-column:2;grid-row:1;margin-right:0;font-size:12px;color:var(--ink);font-weight:600}
  .md-toc .md-tr.md-2l > .md-open{grid-column:4;grid-row:1;justify-self:end;min-width:0;padding:2px 5px!important;font-size:12px;gap:2px;white-space:nowrap}
  .md-toc .md-tr.md-2l > .md-pvw{grid-column:5;grid-row:1;gap:3px}
  .md-toc .md-tr.md-2l > .md-pvw .md-pv,.md-toc .md-tr.md-2l > .md-pvw .md-rmf{width:28px;height:28px}
  .md-toc .md-tr.md-2l > .md-shi,.md-toc .md-tr.md-2l > .md-sh{grid-column:6;grid-row:1;width:32px;min-height:28px}
  .md-toc .md-tr.md-2l > .toc-t{grid-column:2 / -1;grid-row:2}
  /* sizes / spacing */
  .md-toc .md-open{min-height:28px!important;padding:2px 9px!important;font-size:13px}
  .md-toc .md-pv,.md-toc .md-rmf{width:32px;height:30px}
  .md-toc .md-shi{min-height:30px;width:40px}
  .md-toc .md-g0{margin:8px 0}
  .md-toc .md-g1{margin:4px 0 6px}
  .md-toc .md-g > .toc-r.head{padding-top:5px;padding-bottom:5px}
  .md-toc .md-chev{margin-left:6px;padding:1px 5px}
  /* v409 (Kah Poh): group heading — the n/m ▸ box sits at the far right of the heading */
  .md-toc .toc-r.head > .toc-t{display:flex;align-items:center;gap:0 6px;min-width:0}
  .md-toc .toc-r.head > .toc-t > .md-chev{margin-left:auto;flex:none}
}

/* v412 (Kah Poh): phone — QC002 (and every .q2-it material / item box) ↑ ↓ ✕ in ONE row, not a column (the ≤560px .q8-ac column rule is for QC008 photo cards only) */
@media (max-width:560px){
  .q2-it > .q2-ih > .q8-ac{flex-direction:row;gap:4px}
  .q2-it > .q2-ih > .q8-ac .icon-btn{width:34px;height:32px}
}

/* v413 (Kah Poh): phone — swipe left / right on a long box (Heat No., Cert. No. …) to read it without tapping (wofPeek, 03-projects.js) */
.wof-peek{display:none}
@media (max-width:820px){
  .wof-peek.on{display:block;position:absolute;z-index:4;box-sizing:border-box;margin:0;white-space:nowrap;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain;touch-action:pan-x pan-y;scrollbar-width:none;cursor:text}
  .wof-peek.on::-webkit-scrollbar{display:none}
}

/* v414 (Kah Poh): QC002 date boxes (Revessel date / Client's rep. date) fit the date — no empty space on the right. Was 10ch + 14px (110px at 16px); "dd-mm-yyyy" = 91px in IBM Plex 16px → 5.75em + 14px (≈106px), padding 3px, text centred so the small gap is equal both sides */
.q2-grid .q2-f.q2-d .md-dt{width:calc(5.75em + 14px);padding-left:3px;padding-right:3px;text-align:center}

/* v415 (Kah Poh): phone picture sheet cards — the button row (sizes · lock · ↑ ↓ ✕) is centred on the card; when the phone is too narrow it sticks out EQUALLY left and right (was: only on the right) */
@media (max-width:560px){
  .ps-sc .ps-rc{justify-content:center;min-width:0}
  .ps-sc1 > .ps-1i > .ps-rc{width:100%;max-width:100%;justify-self:stretch}
}

/* v418 (Kah Poh): phone MDR TOC tab — heading buttons hidden until the Cover details | TOC tabs scroll away (mdHactsSync, 06-mdr.js); then they float just under the sticky heading */
@media (max-width:820px){
  .md-editing > .panel-head > .md-hacts.md-float{position:absolute;left:0;right:0;top:100%;margin:0;padding:6px 14px 8px;background:var(--surface);border-bottom:1px solid var(--divider);box-shadow:0 4px 8px -4px rgba(28,37,48,.3)}
  .md-editing > .panel-head > .md-hacts.md-hoff{display:none}
}

/* v419: 3rd step of the (Attachment) title rule — name line + "(Attachment)" line (fkHeadTxt) */
.fk-ht1{display:block}

/* v421 (Kah Poh): MDR cover page — Revessel logo (left) about 1.3× bigger (74 → 96px high, 180 → 234px wide max); client logo (right) unchanged */
.mp-logos{height:100px}
.mp-logos > img:first-child{max-height:96px;max-width:234px}

/* v424 (Kah Poh): desktop too — MDR TOC tab heading buttons hidden until the Cover details | TOC tabs scroll away; kept in place (visibility) so the heading doesn't change size. Phone still uses the v418 float / display:none */
.md-editing > .panel-head > .md-hacts.md-hoff{visibility:hidden}

/* v426: QC022 ready-remark buttons (selected = navy, like the size buttons) */
.q22-rbs{display:flex;gap:6px;flex-wrap:wrap;margin:2px 0 4px}
.q22-rbs .q22-rb.on{background:#3A1F8F;border-color:#3A1F8F;color:#fff}
@media (max-width:560px){ .q22-rbs{flex-wrap:nowrap} .q22-rbs .q22-rb{flex:1 1 0;min-width:0;padding-left:4px;padding-right:4px;justify-content:center;text-align:center;white-space:normal;line-height:1.15;font-size:12.5px} }

/* v427 (Kah Poh): QC022 ready-remark buttons on the same line as "Remarks", at the right */
.q22-rh{display:flex;align-items:center;gap:8px}
.q22-rh > .md-l{flex:none}
.q22-rh > .q22-rbs{margin:0 0 0 auto;justify-content:flex-end}
@media (max-width:560px){ .q22-rh > .q22-rbs{flex:1 1 auto;min-width:0;gap:4px} }

/* v428 (Kah Poh): desktop MDR TOC tab — form no. in ONE column for every level (sub forms no longer pushed in); wider section column; names line up after the form no. (sub-level names still step in a little) */
@media (min-width:561px){
  .md-toc .md-tr{grid-template-columns:24px 44px minmax(0,1fr) 36px 44px}
  .md-toc .toc-r.lv1 .toc-t,.md-toc .toc-r.lv2 .toc-t,.md-toc .md-g .toc-r.lv1 .toc-t,.md-toc .md-g .toc-r.lv2 .toc-t{padding-left:0}
  .md-toc .md-tr .toc-t > .md-fno{display:inline-block;width:62px;margin-right:8px;vertical-align:baseline}
  .md-toc .md-tr.lv1:not(.head) .toc-t > .md-fno{margin-right:20px}
  .md-toc .md-tr.lv2:not(.head) .toc-t > .md-fno{margin-right:32px}
}
@media (max-width:560px){ .md-toc .md-fno:empty{display:none} }   /* v428: phone keeps its v402–v406 layout */

/* v430: QC013a Overall Dimension Report (Attachment) — QC002b layout; Drawing No. column narrower than Description */
.qc-sheet .q13a-tb thead th:nth-child(2){width:150px}
/* v432: Attachment List master — typed lines (al-typed): ✕ column; phone keeps 4 columns */
.al-ed .al-dc{width:44px;text-align:right}
@media (min-width:561px){ .al-typed td:nth-child(2) .inp{max-width:200px} }
@media (max-width:560px){ .al-typed td.q2b-cpc{grid-column:2 / 4} .al-typed td.al-dc{grid-column:4;text-align:right} .al-typed .q2b-edt td.al-dc{display:none} }

/* v434 (Kah Poh): photo date caption under the photo (picture sheet master) */
.ps-img.ps-hasdt,.ps-cell.ps-hasdt{display:flex;flex-direction:column}
.ps-hasdt > .ps-pic{flex:1 1 auto;position:relative;min-height:0}
.ps-hasdt > .ps-dt{flex:none;font-size:11px;line-height:1.3;text-align:center;padding-top:2px;color:#1C2530}
.ps-edt{font-size:12px;color:var(--muted);margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ps-tc > .ps-edt{text-align:center;font-size:11px}

/* v436 (Kah Poh): photo date inside the photo, bottom-right, solid dark label (raised layer → drawn over the photo in the PDF, v429) */
.ps-ntag{position:absolute;left:6px;top:6px;z-index:2;background:#3A1F8F;color:#fff;font-size:13px;font-weight:700;line-height:1.2;min-width:22px;text-align:center;padding:2px 6px;border-radius:3px;pointer-events:none}   /* v591 photo number */
.ps-dtag{position:absolute;right:6px;bottom:6px;z-index:2;background:#1C2530;color:#fff;font-size:12px;font-weight:700;line-height:1.25;padding:2px 7px;border-radius:3px;white-space:nowrap;letter-spacing:.02em;pointer-events:none}

/* v437 (Kah Poh): Saved MDR search box at the top of the list */
.md-sv-q{margin:6px 0 4px;max-width:520px}
@media (max-width:820px){ .md-sv-q{max-width:none} }

/* v439 (Kah Poh): Copy TOC from a saved MDR (only while the TOC is empty) */
.md-tcopy{border:1.5px solid #2457E6;border-left-width:4px;border-radius:6px;padding:12px 14px;margin:10px 0 12px;background:var(--surface)}
.md-tc-h{display:flex;flex-direction:column;gap:2px;margin-bottom:8px}.md-tc-h b{font-size:15px}.md-tc-h .muted{font-size:13.5px}
.md-tc-r{display:flex;gap:8px;align-items:center}.md-tc-r .inp{flex:1 1 auto;min-width:0}.md-tc-r .btn{flex:none;justify-content:center}
.md-tc-pg{margin-top:8px;font-size:13.5px}
#mdTcSel.bad{border:2px solid #C62828}
@media (max-width:560px){ .md-tc-r{flex-wrap:wrap} .md-tc-r .inp{flex:1 1 100%} .md-tc-r .btn{flex:1 1 100%} }

/* v440 (Kah Poh): MDR lock */
.status.md-lkb{background:#3A1F8F;color:#fff;display:inline-flex;align-items:center;gap:4px}
.status.md-lkb svg,.md-sv-a .btn svg{flex:none}
.status.md-lkb svg{width:12px;height:12px;fill:none;stroke:currentColor;stroke-width:2.4}
.md-sv.md-sv-lk{border-left:4px solid #3A1F8F;padding-left:10px}
.md-ur-rj{color:#C62828;font-weight:600;margin-top:2px}
.md-ur{grid-column:1/-1;display:flex;gap:8px;align-items:center;margin-top:8px}.md-ur .inp{flex:1 1 auto;min-width:0}.md-ur .inp.bad{border:2px solid #C62828}
@media (max-width:560px){ .md-ur{flex-wrap:wrap} .md-ur .inp{flex:1 1 100%} .md-ur .btn{flex:1 1 0;justify-content:center} }

/* v442: Actual delivery locked by an MDR / MDR delivery date from Production details */
.pd-src.pd-lk,.md-hint.pd-lk{background:#3A1F8F;color:#fff;padding:1px 6px;border-radius:3px;font-weight:600}
.md-t.md-pdact{font-weight:700}

/* v447 (Kah Poh): phone Saved MDR buttons — 4 buttons (Generate · Edit · Lock · Delete) or 2 (Generate · Request unlock) always fit, text never cut */
@media (max-width:820px){
  .md-sv-a{gap:6px}
  .md-sv-a .btn.btn-sm{flex:1 1 0;min-width:0;padding:6px 4px!important;font-size:14px;white-space:normal;line-height:1.15;text-align:center;justify-content:center}
  .md-sv-a .btn.btn-sm svg{display:none}
  .md-sv-a .btn.btn-sm.btn-primary{flex:2.2 1 0}
  .md-sv-lk .md-sv-a .btn.btn-sm{flex:1 1 0}
}

/* v448 (Kah Poh): phone — "Locked" badge becomes a lock icon between Generate MDR and Request unlock (desktop keeps the badge) */
.md-svlk{display:none}
@media (max-width:820px){
  .md-sv-t .status.md-lkb{display:none}
  .md-svlk{display:grid;place-items:center;flex:0 0 42px;height:42px;border-radius:6px;background:#3A1F8F;color:#fff}
  .md-svlk svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
}

/* v451 (Kah Poh): the short message at the bottom (toast) never blocks taps — on phone it covered "‹ Back to TOC" for ~3 s (e.g. after Copy TOC) */
.toast{pointer-events:none}

/* v455 (Kah Poh): phone — MDR TOC tab bottom buttons as a tidy 2×2 grid, one-line labels:
   Save changes | Generate MDR (top) · ‹ Cover details | Cancel (below). Save hidden → Generate MDR takes the full top row. */
@media (max-width:560px){
  .md-acts.md-acts-toc{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .md-acts.md-acts-toc .btn{width:100%;min-width:0;min-height:42px;white-space:nowrap;justify-content:center;padding-left:6px;padding-right:6px;font-size:15px}
  .md-acts.md-acts-toc #mdSave{order:1}.md-acts.md-acts-toc .md-gen{order:2}.md-acts.md-acts-toc .md-bcov{order:3}.md-acts.md-acts-toc .md-cancel{order:4}
  .md-acts.md-acts-toc:has(#mdSave[hidden]) .md-gen{grid-column:1/-1}
  .md-acts.md-acts-toc .btn svg{display:inline-block;width:16px;height:16px}
}
/* v456: MDR form bottom buttons on phone — add-files row + Back/Save/Preview row on the same 2-column grid; Save full width on top; Back to TOC quiet grey */
@media (max-width:560px){
  .q8-add{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:10px 0 6px}
  .q8-add > .btn{width:100%;min-width:0;min-height:44px;white-space:nowrap;justify-content:center;font-size:15px;padding-left:6px;padding-right:6px}
  .q8-add > .q8-busy{grid-column:1/-1}
  .md-acts:has(.qc-back2){display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px;padding-top:14px;border-top:1px solid var(--divider)}
  .md-acts:has(.qc-back2) .btn{width:100%;min-width:0;min-height:44px;margin:0;white-space:nowrap;justify-content:center;font-size:15px;padding-left:6px;padding-right:6px;gap:6px}
  .md-acts:has(.qc-back2) .btn-primary{grid-column:1/-1;order:-1}
  .md-acts:has(.qc-back2) .qc-back2{background:var(--surface-2);color:var(--ink);border-color:var(--divider)}
  .md-acts:has(.qc-back2) .btn svg,.q8-add > .btn svg{display:inline-block;width:16px;height:16px;flex:none}
}
/* v459: MDR Cover details bottom row (editing) — Lock MDR button; phone 2×2: Save changes | Generate MDR / Lock MDR | Cancel */
.md-acts .md-lock svg{width:16px;height:16px}
@media (max-width:560px){
  .md-acts.md-acts-cov{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .md-acts.md-acts-cov .btn{width:100%;min-width:0;min-height:42px;white-space:nowrap;justify-content:center;padding-left:6px;padding-right:6px;font-size:15px}
  .md-acts.md-acts-cov #mdSave{order:1}.md-acts.md-acts-cov .md-gen{order:2}.md-acts.md-acts-cov .md-lock{order:3}.md-acts.md-acts-cov .md-cancel{order:4}
  .md-acts.md-acts-cov:has(#mdSave[hidden]) .md-gen{grid-column:1/-1}
  .md-acts.md-acts-cov .btn svg{display:inline-block;width:16px;height:16px}
}
/* v460 (Kah Poh): phone Saved MDR — lock icon at the TOP-RIGHT corner of the locked row (was between Generate MDR and Request unlock) */
@media (max-width:820px){
  .md-sv.md-sv-lk{position:relative}
  .md-sv.md-sv-lk .md-sv-t,.md-sv.md-sv-lk .md-sv-m{padding-right:44px}
  .md-sv.md-sv-lk .md-svlk{position:absolute;top:10px;right:0;width:34px;height:34px;flex:none}
  .md-sv.md-sv-lk .md-svlk svg{width:18px;height:18px}
}
/* v461: SOP pages — info rows, flow chart (nodes + arrows), rules */
.sop-info{display:grid;gap:8px}
.sop-row{display:grid;grid-template-columns:84px minmax(0,1fr);gap:10px;font-size:15px;line-height:1.45}
.sop-row b{color:var(--navy)}
.sop-key{display:flex;flex-wrap:wrap;gap:6px 14px;margin:0 0 14px;font-size:13px;color:var(--muted)}
.sop-kc{display:inline-flex;align-items:center;gap:5px;font-weight:600}
.sop-kc > span{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:4px;background:var(--navy);color:#fff;font-size:12px}
.sop-kc:nth-child(2) > span{background:var(--steel)}
.sop-kc:nth-child(3) > span{background:#6B7785}
.sop-kc.sop-kd > span{background:#F2C230;color:#1C2530}
.sop-flow{--mw:340px;display:flex;flex-direction:column;align-items:flex-start}
.sop-chain{display:flex;flex-direction:column;align-items:stretch;min-width:0}
.sop-n{position:relative;width:var(--mw);max-width:100%;box-sizing:border-box;padding:10px 14px;border:2px solid var(--navy);border-radius:8px;background:var(--surface);color:var(--ink);text-align:center}
.sop-chain .sop-n{width:100%}
.sop-tx{font-weight:700;font-size:15px;line-height:1.3}
.sop-sub{font-size:13px;line-height:1.4;color:var(--muted);margin-top:3px}
.sop-who{display:inline-flex;align-items:center;gap:4px;margin-bottom:5px;padding:1px 8px;border-radius:4px;background:var(--navy);color:#fff;font-size:11.5px;font-weight:700;letter-spacing:.02em;text-transform:uppercase}
.sop-w-appr{border-color:var(--steel)}.sop-w-appr .sop-who{background:var(--steel)}
.sop-w-sys{border-color:#6B7785;background:var(--surface-2)}.sop-w-sys .sop-who{background:#6B7785}
.sop-start,.sop-end{background:var(--navy);color:#fff;border-radius:22px}
.sop-start .sop-sub,.sop-end .sop-sub{color:#DCE4EE}
.sop-end.sop-bad{background:#C62828;border-color:#C62828}.sop-end.sop-bad .sop-sub{color:#fff}
.sop-dec{background:#F2C230;border-color:#1C2530;color:#1C2530}
.sop-dec .sop-sub{color:#1C2530}
.sop-dec .sop-who{background:#1C2530;color:#F2C230}
.sop-go{display:inline-block;margin-top:6px;font-size:13px;font-weight:700;color:var(--link);text-decoration:none}
.sop-start .sop-go,.sop-end .sop-go{color:#fff}
.sop-ar{position:relative;width:var(--mw);max-width:100%;height:30px}
.sop-chain .sop-ar{width:100%}
.sop-ar::before{content:"";position:absolute;left:50%;top:0;bottom:7px;border-left:2px solid var(--sopln);transform:translateX(-1px)}
.sop-ar::after{content:"";position:absolute;left:50%;bottom:0;transform:translateX(-6px);border:6px solid transparent;border-top:8px solid var(--sopln);border-bottom:0}
.sop-lb{position:absolute;left:calc(50% + 10px);top:6px;padding:0 7px;border-radius:4px;background:#1C2530;color:#fff;font-size:12px;font-weight:700;line-height:18px}
.sop-ar.sop-ok .sop-lb{background:var(--steel)}.sop-ar.sop-bad .sop-lb{background:#C62828}
.sop-blk{display:grid;grid-template-columns:var(--mw) minmax(0,1fr);align-items:start;width:100%}
.sop-blk > .sop-dec{grid-column:1}
.sop-side{display:grid;grid-template-columns:62px minmax(0,320px);align-items:start}
.sop-side > .sop-chain,.sop-side > .sop-back{grid-column:2}
.sop-ar.sop-sidear{width:62px;height:auto;margin-top:26px}
.sop-ar.sop-sidear::before{left:0;right:8px;top:0;bottom:auto;border-left:0;border-top:2px solid var(--sopln);transform:translateY(-1px)}
.sop-ar.sop-sidear::after{left:auto;right:0;top:0;bottom:auto;transform:translateY(-6px);border:6px solid transparent;border-left:8px solid var(--sopln);border-right:0}
.sop-ar.sop-sidear .sop-lb{left:10px;top:-24px}
.sop-back{margin-top:6px;font-size:13px;font-weight:700;color:var(--navy);text-align:center}
.sop-split{grid-column:1/-1;display:grid;grid-template-columns:repeat(2,minmax(0,170px));gap:12px;margin-top:0}
.sop-col{display:flex;flex-direction:column;min-width:0}
.sop-col > .sop-ar{width:100%}
.sop-rules{margin:0;padding-left:20px;display:grid;gap:6px;font-size:15px;line-height:1.45}
@media (max-width:820px){
  .sop-flow{--mw:100%}
  .sop-blk{grid-template-columns:minmax(0,1fr)}
  .sop-side{grid-template-columns:minmax(0,1fr);margin:0 0 0 18px;padding:0 0 4px 12px;border-left:3px dashed var(--steel)}
  .sop-side > .sop-chain,.sop-side > .sop-back{grid-column:1}
  .sop-ar.sop-sidear{width:100%;height:30px;margin-top:0}
  .sop-ar.sop-sidear::before{left:50%;right:auto;top:0;bottom:7px;border-top:0;border-left:2px solid var(--sopln);transform:translateX(-1px)}
  .sop-ar.sop-sidear::after{left:50%;right:auto;top:auto;bottom:0;transform:translateX(-6px);border:6px solid transparent;border-top:8px solid var(--sopln);border-bottom:0}
  .sop-ar.sop-sidear .sop-lb{left:calc(50% + 10px);top:6px}
  .sop-split{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .sop-row{grid-template-columns:70px minmax(0,1fr)}
}
.sop-dcol{grid-column:1;display:flex;flex-direction:column;align-self:stretch;width:var(--mw);max-width:100%}
.sop-vl{flex:1;width:2px;background:var(--sopln);margin:0 auto}
.sop-chain .sop-split{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
@media (max-width:820px){ .sop-vl{display:none} }
/* v462: SOP notes hidden until the node is tapped (ⓘ corner mark); Show all notes button */
.sop-n.sop-has{cursor:pointer;padding-right:30px;padding-left:30px}
.sop-n.sop-has:not(.open) .sop-sub{display:none}
.sop-n.sop-has:focus-visible{outline:3px solid var(--steel);outline-offset:2px}
.sop-i{position:absolute;top:6px;right:6px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;font:700 12px/1 Georgia,serif;font-style:italic;background:var(--steel);color:#fff}
.sop-start .sop-i,.sop-end .sop-i{background:#fff;color:var(--navy)}
.sop-end.sop-bad .sop-i{color:#C62828}
.sop-dec .sop-i{background:#1C2530;color:#F2C230}
.sop-n.open .sop-i{background:#1C2530;color:#fff}
.sop-dec.open .sop-i{background:#fff;color:#1C2530}
.sop-hint{margin:0 0 8px;font-size:13px;color:var(--muted)}
.panel-head .sop-all{margin-left:auto}
/* v463 (Kah Poh): SOP boxes fit their text (centred on the flow line) */
.sop-flow{display:grid;grid-template-columns:var(--mw) minmax(0,1fr);justify-items:stretch}
.sop-flow > *{grid-column:1}
.sop-flow > .sop-blk{grid-column:1/-1}
.sop-n,.sop-chain .sop-n{width:fit-content;min-width:150px;max-width:100%}
.sop-flow > .sop-n{justify-self:center;max-width:var(--mw)}
.sop-chain{align-items:center}
.sop-chain .sop-ar,.sop-chain .sop-back{width:100%}
.sop-blk > .sop-dec{justify-self:center}
.sop-dcol{align-items:stretch}
.sop-drow{display:flex;align-items:flex-start}
.sop-drow::before{content:"";flex:1 1 0}
.sop-drow > .sop-dec{flex:none;max-width:calc(100% - 24px)}
.sop-dln{flex:1 1 0;border-top:2px solid var(--sopln);margin-top:26px}
.sop-col{align-items:stretch}
@media (max-width:820px){
  .sop-flow{grid-template-columns:minmax(0,1fr)}
  .sop-dln{border-top:0}
}
.sop-side{grid-template-columns:62px max-content}
.sop-side > .sop-chain{max-width:340px}
.sop-split .sop-n{min-width:0;width:100%}
@media (max-width:820px){ .sop-side{grid-template-columns:minmax(0,1fr)} .sop-side > .sop-chain{max-width:none} .sop-n,.sop-chain .sop-n{min-width:130px} .sop-split .sop-n{min-width:0} }
/* v464 (Kah Poh, iPhone): SOP phone branch lines properly joined — side branch (No) drops straight down from the decision;
   main path (Yes) leaves the decision's left side, runs down the left margin and joins the next arrow; "Back to the question" = loop on the right into the decision */
.sop-yl,.sop-bl{display:none}
@media (max-width:820px){
  .sop-blk.sop-hasside{position:relative}
  .sop-hasside .sop-dcol{margin:0 18px 0 26px;width:auto}
  .sop-hasside .sop-drow::before{display:none}
  .sop-hasside .sop-drow > .sop-dec{flex:1 1 auto;max-width:none;width:auto;position:relative;z-index:1}
  .sop-hasside .sop-side{margin:0 18px 0 26px;padding:0 8px 8px;border-left:0;background:var(--surface-2);border-radius:0 0 8px 8px}
  .sop-hasside .sop-side > .sop-ar.sop-sidear{margin-top:0}
  .sop-yl{display:block;position:absolute;left:9px;top:30px;bottom:-1px;width:calc(50% - 9px);border:2px solid var(--sopln);border-right:0;border-radius:6px 0 0 6px;pointer-events:none}
  .sop-yl .sop-lb{left:-9px;top:50%;transform:translate(-2px,-50%)}
  .sop-bl{display:block;position:absolute;right:4px;top:30px;bottom:18px;width:14px;border:2px solid var(--sopln);border-left:0;border-radius:0 6px 6px 0;pointer-events:none}
  .sop-bl::after{content:"";position:absolute;left:-2px;top:-7px;border:6px solid transparent;border-right:8px solid var(--sopln);border-left:0;transform:translateX(-6px)}
  .sop-hasside .sop-back{text-align:right;padding-right:6px}
  .sop-ar.sop-after .sop-lb{display:none}
  .sop-ar.sop-after::before{top:-1px}
}
/* v465 (Kah Poh): SOP — Yes / No / Back labels sit ON the line, centred; every arrow joins a box (split fork, side branch, back loop) */
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.sop-lb{left:50%;top:50%;transform:translate(-50%,-50%);white-space:nowrap;z-index:2}
.sop-ar:has(.sop-lb){height:42px}
.sop-ar.sop-sidear .sop-lb{left:50%;top:0;transform:translate(-50%,-50%)}
.sop-back{display:none}
/* split fork: stem from the decision, bar across, then down into each end box */
.sop-blk.sop-hassplit{grid-template-columns:minmax(0,1fr)}
.sop-split{--g:10px;gap:var(--g);position:relative;padding-top:14px}
.sop-split::before{content:"";position:absolute;left:50%;top:0;height:14px;border-left:2px solid var(--sopln);transform:translateX(-1px)}
.sop-split::after{content:"";position:absolute;top:13px;left:calc(25% - var(--g) / 4 - 1px);right:calc(25% - var(--g) / 4 - 1px);border-top:2px solid var(--sopln)}
.sop-chain .sop-split{grid-template-columns:repeat(2,minmax(0,1fr))}
.sop-col > .sop-ar::before{top:-1px}
/* back loop (desktop): from the branch box's right side, up above the decision, left into the line entering it */
.sop-bl2{display:none}
@media (min-width:821px){
  .sop-side{position:relative}
  .sop-side > .sop-chain{overflow:hidden;padding-top:0}
  .sop-side > .sop-chain > .sop-n:first-child{overflow:visible}
  .sop-side > .sop-chain > .sop-n:first-child::before{content:"";position:absolute;right:100%;top:24px;width:400px;border-top:2px solid var(--sopln);margin-right:8px}
  .sop-side > .sop-chain > .sop-n:first-child::after{content:"";position:absolute;right:100%;top:19px;border:6px solid transparent;border-left:8px solid var(--sopln);border-right:0;margin-right:2px}
  .sop-ar.sop-sidear::after{display:none}
  .sop-ar.sop-sidear::before{right:0}
  .sop-bl2{display:block;position:absolute;top:-21px;height:47px;left:calc(var(--mw) / -2 - 1px);right:-22px;border:2px solid var(--sopln);border-left:0;border-bottom:0;border-radius:0 8px 0 0;pointer-events:none}
  .sop-bl2::after{content:"";position:absolute;right:0;bottom:-2px;width:22px;border-top:2px solid var(--sopln)}
  .sop-bl2 .sop-lb{left:auto;right:28%;top:-1px}
  .sop-side:has(.sop-bl2){margin-right:26px}
}
@media (max-width:820px){
  .sop-split{--g:8px}
  .sop-dln{display:none}
  .sop-hasside .sop-dcol,.sop-hasside .sop-side{margin-left:32px;margin-right:30px}
  .sop-yl{left:16px;width:calc(50% - 16px)}
  .sop-yl .sop-lb{left:-1px;top:50%;transform:translate(-50%,-50%)}
  .sop-bl{right:14px;width:16px;bottom:22px}
  .sop-bl::after{left:0;top:-7px;transform:none;border-right:8px solid var(--sopln);border-left:0}
  .sop-bl .sop-lb{left:auto;right:-1px;top:50%;transform:translate(50%,-50%)}
  .sop-hasside .sop-side{padding-bottom:14px}
}
@media (min-width:821px){
  .sop-side{justify-self:start}
  .sop-bl2::before{content:"";position:absolute;left:10px;top:-7px;border:6px solid transparent;border-right:8px solid var(--sopln);border-left:0}
}
@media (max-width:820px){
  .sop-hasside .sop-dcol,.sop-hasside .sop-side{margin-right:42px}
  .sop-bl{right:24px;width:18px}
  .sop-ar.sop-sidear{height:42px}
  .sop-ar.sop-sidear .sop-lb{top:50%}
}
@media (max-width:820px){
  .sop-blk:has(.sop-bl) .sop-side{padding-left:0;padding-right:0}
  .sop-blk:has(.sop-bl) .sop-side > .sop-chain > .sop-n{width:100%}
  .sop-bl{bottom:46px}
}
/* v466 (Kah Poh): SOP boxes fit EXACTLY to their words — no min width, tight padding, ⓘ moved onto the top-right corner (outside the text area) */
.sop-n,.sop-chain .sop-n,.sop-n.sop-has{min-width:0;padding:8px 12px}
.sop-i{top:-9px;right:-9px;box-shadow:0 0 0 2px var(--surface);z-index:2}
.sop-split .sop-n{width:fit-content;max-width:100%;align-self:center}
.sop-col > .sop-chain{align-items:center}
@media (max-width:820px){
  .sop-n,.sop-chain .sop-n{min-width:0}
  .sop-hasside .sop-drow{justify-content:center}
  .sop-hasside .sop-drow > .sop-dec{flex:none;width:fit-content;max-width:100%}
  .sop-blk:has(.sop-bl) .sop-side > .sop-chain > .sop-n{width:fit-content}
  .sop-hasside .sop-side .sop-n{position:relative;z-index:1}
  .sop-bl{left:50%;width:auto;right:24px}
  .sop-bl::after{left:auto;right:6px}
}
.sop-start .sop-i,.sop-end .sop-i,.sop-end.sop-bad .sop-i{background:var(--steel);color:#fff}
@media (min-width:821px){ .sop-side > .sop-chain{overflow:visible;clip-path:inset(-14px -14px -14px 0)} }
/* v467: view-only bar (page opened from an SOP link) */
.sopv-bar{display:flex;align-items:center;gap:8px;margin:0 0 12px;padding:9px 14px;border-radius:6px;background:#F2C230;color:#1C2530;font-size:14px;line-height:1.35}
.sopv-bar b{font-weight:800}
.sopv-ic{font-size:16px}
.sopv-off{opacity:.4;cursor:not-allowed!important}
/* v469 (Kah Poh, iPhone): labels never touch a box — Yes/No of the left path sit on its BOTTOM line (below the grey panel); Back loop moved further right */
@media (max-width:820px){
  .sop-blk.sop-hasside{padding-bottom:18px}
  .sop-yl .sop-lb{left:50%;top:auto;bottom:-1px;transform:translate(-50%,50%)}
  .sop-hasside .sop-dcol,.sop-hasside .sop-side{margin-right:58px}
  .sop-bl{right:30px;bottom:64px}
}
@media (max-width:820px){
  .sop-hasside .sop-dcol,.sop-hasside .sop-side{margin-right:10px}
  .sop-blk:has(.sop-bl) .sop-dcol,.sop-blk:has(.sop-bl) .sop-side{margin-right:58px}
  .sop-split .sop-n{overflow-wrap:break-word;hyphens:auto}
}
/* v470: SOP side branch that REJOINS the main path (side.join) — line from the branch box down and back into the main line */
.sop-jn{display:none}
@media (min-width:821px){
  .sop-blk:has(.sop-jn){padding-bottom:22px}
  .sop-jn{display:block;position:absolute;top:100%;height:22px;left:calc(var(--mw) / -2 - 1px);right:calc((100% - 62px) / 2 - 1px);border:2px solid var(--sopln);border-top:0;border-left:0;border-radius:0 0 8px 0;pointer-events:none}
  .sop-side:has(.sop-jn){position:relative}
  .sop-blk:has(.sop-jn) .sop-vl{margin-bottom:-22px}
}
@media (max-width:820px){
  .sop-blk:has(.sop-jn) .sop-dcol,.sop-blk:has(.sop-jn) .sop-side{margin-right:32px}
  .sop-jn{display:block;width:2px;height:32px;margin:0 auto -32px;background:var(--sopln);position:relative;z-index:0}
}
@media (min-width:821px){
  .sop-vl{position:relative}
  .sop-vl .sop-lb{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
  .sop-blk:has(.sop-jn) .sop-vl{min-height:30px}
  .sop-ar.sop-afterj .sop-lb{display:none}
  .sop-ar.sop-afterj{height:30px}
}
@media (min-width:821px){
  .sop-blk:has(.sop-jn){padding-bottom:0}
  .sop-blk:has(.sop-jn) .sop-vl{min-height:0;height:44px;flex:none;margin-bottom:0}
  .sop-blk:has(.sop-jn) .sop-dcol{align-self:start}
  .sop-jn{height:auto;bottom:-44px;top:auto}
  .sop-side:has(.sop-jn){align-self:stretch}
}
@media (min-width:821px){
  .sop-side:has(.sop-jn){align-self:stretch;align-items:stretch}
  .sop-side:has(.sop-jn) > .sop-chain::after{content:"";flex:1 1 auto;min-height:8px;width:2px;background:var(--sopln);align-self:center}
  .sop-jn{top:auto;bottom:0;height:0;border:0;border-bottom:2px solid var(--sopln);border-radius:0}
}
@media (max-width:820px){
  .sop-blk:has(.sop-bl) .sop-dcol,.sop-blk:has(.sop-bl) .sop-side{margin-right:74px}
  .sop-bl{right:34px}
}
/* v471: SOP flash on the button a step talks about */
.sopv-hl{opacity:1!important;position:relative;z-index:3;outline:3px solid #F2C230;outline-offset:3px;animation:sopFlash .8s ease-in-out 0s 5}
@keyframes sopFlash{0%,100%{box-shadow:0 0 0 0 rgba(242,194,48,0)}50%{box-shadow:0 0 0 9px rgba(242,194,48,.85)}}
/* v472 (Kah Poh): desktop flow lines easier to see — 3px lines, bigger arrow heads, pure black */
@media (min-width:821px){
  .sop-flow{--ln:var(--sopln)}
  .sop-ar::before{border-left:3px solid var(--ln);transform:translateX(-1.5px)}
  .sop-ar::after{transform:translateX(-8px);border-width:10px 8px 0;border-style:solid;border-color:var(--ln) transparent transparent}
  .sop-dln{border-top:3px solid var(--ln);margin-top:25px}
  .sop-vl{width:3px;background:var(--ln)}
  .sop-ar.sop-sidear::before{border-left:0;border-top:3px solid var(--ln);transform:translateY(-1.5px)}
  .sop-split::before{border-left:3px solid var(--ln);transform:translateX(-1.5px)}
  .sop-split::after{border-top:3px solid var(--ln)}
  .sop-side > .sop-chain > .sop-n:first-child::before{border-top:3px solid var(--ln);top:23px}
  .sop-side > .sop-chain > .sop-n:first-child::after{top:17px;border-width:8px 0 8px 10px;border-color:transparent transparent transparent var(--ln)}
  .sop-bl2{border-width:3px;border-color:var(--ln)}
  .sop-bl2::after{border-top:3px solid var(--ln)}
  .sop-bl2::before{top:-9px;border-width:8px 10px 8px 0;border-color:transparent var(--ln) transparent transparent}
  .sop-jn{border-bottom:3px solid var(--ln)}
  .sop-side:has(.sop-jn) > .sop-chain::after{width:3px;background:var(--ln)}
}
@media (min-width:821px){ .sop-dln{margin-top:24.5px} }
@media (min-width:821px){ .sop-dln{margin-top:24px} .sop-ar.sop-sidear::before{transform:none;top:-2px} }
@media (min-width:821px){ .sop-side > .sop-chain > .sop-n:first-child::before{top:24px} .sop-side > .sop-chain > .sop-n:first-child::after{top:18px} }
@media (min-width:821px){ .sop-side > .sop-chain > .sop-n:first-child::before{top:22px} .sop-side > .sop-chain > .sop-n:first-child::after{top:16px} }

/* v473 (Kah Poh uses dark mode): SOP lines / boxes follow the theme — dark = light lines, light-blue box frames, light label chips */
:root{--sopln:#0E141B}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){--sopln:#C9D3DE} }
:root[data-theme="dark"]{--sopln:#C9D3DE}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sop-n:not(.sop-dec):not(.sop-start):not(.sop-end){border-color:#7FB0EA} :root:not([data-theme="light"]) .sop-w-sys{border-color:#9BA8B7} :root:not([data-theme="light"]) .sop-start,:root:not([data-theme="light"]) .sop-end:not(.sop-bad){background:#2457E6;border-color:#2457E6} :root:not([data-theme="light"]) .sop-lb{background:#E7ECF2;color:#0E1520} :root:not([data-theme="light"]) .sop-i{box-shadow:0 0 0 2px var(--surface)} }
:root[data-theme="dark"] .sop-n:not(.sop-dec):not(.sop-start):not(.sop-end){border-color:#7FB0EA}
:root[data-theme="dark"] .sop-w-sys{border-color:#9BA8B7}
:root[data-theme="dark"] .sop-start,:root[data-theme="dark"] .sop-end:not(.sop-bad){background:#2457E6;border-color:#2457E6}
:root[data-theme="dark"] .sop-lb{background:#E7ECF2;color:#0E1520}
.sop-ar.sop-ok .sop-lb{background:var(--steel)!important;color:#fff!important}.sop-ar.sop-bad .sop-lb{background:#C62828!important;color:#fff!important}
/* v475: QC002 — Read with AI (parts from QC008) panel + per-row pick */
.q2-ai{margin:14px 0 6px;padding:12px 14px;border:2px solid var(--steel);border-left-width:5px;border-radius:8px;background:var(--surface)}
.q2-ai-h{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 10px;margin-bottom:8px}
.q2-ai-h b{font-size:15px;color:var(--ink)}
.q2-ai-sub{font-size:13px;color:var(--muted)}
.q2-ai-acts{display:flex;flex-wrap:wrap;gap:8px}
.q2-ai-acts .btn svg{width:17px;height:17px}
.q2-ai-busy{display:flex;align-items:center;gap:10px;font-weight:600;color:var(--ink)}
.q2-ai-busy .btn{margin-left:auto}
.q2-ai-spin{width:18px;height:18px;border-radius:50%;border:3px solid var(--divider);border-top-color:var(--steel);animation:q2spin .9s linear infinite;flex:none}
@keyframes q2spin{to{transform:rotate(360deg)}}
.q2-ai-list{display:grid;gap:4px;margin-top:10px}
.q2-ai-p{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;padding:6px 8px;border-radius:6px;background:var(--surface-2);font-size:14px}
.q2-ai-no{font-family:var(--mono);font-weight:700;min-width:2.2em;color:var(--navy)}
.q2-ai-d{font-weight:600;flex:1 1 12em}
.q2-ai-m,.q2-ai-hn,.q2-ai-q{font-family:var(--mono);font-size:13px}
.q2-ai-note{margin:8px 0 0;font-size:13px;color:var(--muted)}
.q2-pickw{margin:4px 0 6px}
.q2-pick{width:100%;font-size:16px;border-color:var(--steel)}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .q2-ai-no{color:#7FB0EA} }
:root[data-theme="dark"] .q2-ai-no{color:#7FB0EA}
@media (max-width:560px){ .q2-ai-acts .btn{flex:1 1 0;min-width:0;justify-content:center;white-space:nowrap;padding-left:6px;padding-right:6px} .q2-ai-p{font-size:13.5px} }
@media (max-width:560px){ .q2-ai-acts{flex-direction:column} .q2-ai-acts .btn{flex:none;width:100%;min-height:44px} }
/* v478: QC002 pick list sits on the row-number line */
.q2-ih{display:flex;align-items:center;gap:8px}
.q2-ih > .q2-pick{flex:1 1 auto;min-width:0;width:auto;height:36px;padding:4px 8px;font-size:16px;text-overflow:ellipsis}
.q2-ih > .q8-ac{margin-left:auto;flex:none}
.q2-none{margin:6px 0;color:var(--muted);font-size:14px}
.q2-ih > b{white-space:nowrap;flex:none}
/* v479 (Kah Poh): desktop Saved MDR — button columns line up: Generate MDR same width on every row; Edit + Delete together = Request unlock width (Edit left edge / Delete right edge match it) */
@media (min-width:821px){
  .md-sv-a{display:grid;grid-template-columns:170px 106px 106px;gap:8px;justify-content:end}
  .md-sv-a .btn.btn-sm{width:100%;min-width:0;justify-content:center;padding-left:8px!important;padding-right:8px!important}
  .md-sv-lk .md-sv-a{grid-template-columns:170px 220px}
  .md-sv-a .md-svlk{display:none}
}
/* v480 (Kah Poh): Request unlock = Generate MDR width (170); Edit + Delete still span the same 170 below it */
@media (min-width:821px){
  .md-sv-a{grid-template-columns:170px 81px 81px}
  .md-sv-lk .md-sv-a{grid-template-columns:170px 170px}
  .md-sv-a .btn.btn-sm{padding-left:6px!important;padding-right:6px!important;gap:5px}
}
/* v482 (Kah Poh): phone — Read with AI + Add all as rows side by side in one row */
@media (max-width:560px){
  .q2-ai-acts{flex-direction:row;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .q2-ai-acts .btn{width:100%;min-width:0;min-height:44px;padding-left:4px;padding-right:4px;gap:5px;font-size:14.5px;white-space:nowrap;justify-content:center}
  .q2-ai-acts .btn:only-child{grid-column:1/-1}
  .q2-ai-acts .btn svg{width:15px;height:15px}
}
.q2-ai-acts .q2-s{display:none}
@media (max-width:560px){ .q2-ai-acts .q2-l{display:none} .q2-ai-acts .q2-s{display:inline} }
/* v483: QC002 Received date after the delivery date */
.inp.md-dt.q2-late{background:#F2C230;color:#1C2530;border-color:#1C2530;font-weight:700}
.q2-late-n{display:block;margin-top:3px;font-size:12.5px;font-weight:700;color:var(--ink)}
.q2-late-n::first-letter{color:#B8860B}
.inp.md-dt.q2-late{font-weight:400}
.q2-rvDate .md-date{flex-wrap:wrap}
.q2-late-n{flex:0 0 100%;width:0;min-width:100%;white-space:normal;line-height:1.25}
.q2-late-n{display:block;width:auto;min-width:0;flex:none;margin-top:4px}.q2-late-n[hidden]{display:none}
.q2-rcv{min-width:0}.q2-rcv .q2-late-n{width:0;min-width:100%;font-size:12px}
/* v484: QC002 material rows fold — summary line when folded */
.q2-subh{display:flex;align-items:center;gap:10px}
.q2-subh .q2-foldall{margin-left:auto}
.q2-tg{display:inline-flex;align-items:center;gap:4px;flex:none;padding:4px 4px 4px 0;border:0;background:none;color:var(--ink);font:inherit;cursor:pointer}
.q2-tg svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;transition:transform .15s}
.q2-tg[aria-expanded="false"] svg{transform:rotate(-90deg)}
.q2-tg b{white-space:nowrap}
.q2-sumw{flex:1 1 auto;min-width:0;cursor:pointer}
.q2-sum{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;font-size:14px;line-height:1.3}
.q2-sum-d{font-weight:600}
.q2-sum-x{font-family:var(--mono);font-size:13px;color:var(--muted)}
.q2-sum-late{font-size:12px;font-weight:800;padding:0 6px;border-radius:4px;background:#F2C230;color:#1C2530}
.q2-it.fold{padding-top:8px;padding-bottom:8px}
.q2-it.fold .q2-ih{margin-bottom:0;align-items:flex-start}
.q2-it.fold .q8-ac{align-self:center}
@media (max-width:560px){
  .q2-sum{display:block}
  .q2-sum-d{display:block}
  .q2-sum-x{display:inline}
  .q2-sum-late{display:inline-block;margin-top:3px}
  .q2-it.fold .q8-ac{display:none}
}
/* v485 (Kah Poh): folded row — details always on the line UNDER the description (desktop too) */
.q2-sum{display:block}
.q2-sum-d{display:block}
.q2-sum-x{display:inline}
.q2-sum-late{display:inline-block;margin:3px 0 0 8px}
@media (max-width:560px){ .q2-sum-late{margin-left:0} .q2-sum-x + .q2-sum-late{margin-left:6px} }
/* v486: AI panel — buttons right on the heading line; list folds */
.q2-ai-h{align-items:center;margin-bottom:0}
.q2-ai-h .q2-ai-acts{margin-left:auto}
.q2-ai .q2-ai-busy{margin-top:8px}
.q2-ai-tg b{font-size:15px}
@media (max-width:560px){
  .q2-ai-h{flex-wrap:wrap}
  .q2-ai-h .q2-ai-acts{flex:1 0 100%;margin-left:0;margin-top:8px}
}

/* v487: TOC master — 3 badges (built / not built / no form); phone summary may wrap */
@media (max-width:560px){.toc-sum .row{flex-wrap:wrap;row-gap:6px}}
.toc-view .toc-nf{white-space:nowrap}

/* v488: QC002b — HN list from QC008 + Read mill certs with AI */
.q2b-ai .q2-ai-note{margin:2px 0 0}
.q2b-sw{display:flex;justify-content:flex-end;margin-top:6px}
.q2b-ai-b{display:inline-flex;margin-top:6px;font-size:11.5px;padding:2px 7px;white-space:nowrap}
.q2b-cpc .q2b-ai-b{margin-left:6px}
@media (max-width:560px){ .q2b-cpc .q2b-ai-b{margin-left:0} }

/* v489: QC002b HN badge on the same line as the page chip / + / ✕ (and the row ✕) */
.q2b-cpw .q2b-ai-b{margin:0 4px 0 0;min-height:32px;align-items:center;box-sizing:border-box}
.al-typed .q2b-cpc{width:auto;white-space:nowrap}
.al-typed td.al-dc{vertical-align:middle}
.q2b-ai-b .q2b-bs{display:none}
@media (max-width:560px){ .q2b-ai-b .q2b-bl{display:none} .q2b-ai-b .q2b-bs{display:inline} .al-typed td.q2b-cpc,.al-typed td.al-dc{align-self:center} }

/* v489: SOP desktop — a longer side branch that rejoins: main line runs all the way down to the join line */
@media (min-width:821px){ .sop-blk:has(.sop-jn) .sop-dcol{align-self:stretch;display:flex;flex-direction:column} .sop-blk:has(.sop-jn) .sop-vl{flex:1 1 auto;height:auto;min-height:44px} }

/* v490: QC002b batch insert — 3 buttons; unmatched certs line */
.q2b-acts3 .btn-primary svg{width:17px;height:17px}
.q2b-un{margin:8px 0 0;font-size:13.5px;line-height:1.4;color:var(--ink)}
.q2b-un .status{font-size:11.5px;padding:2px 7px;margin-right:4px}
@media (max-width:560px){ .q2-ai-acts.q2b-acts3 .btn-primary{grid-column:1/-1} }

/* v491: Attachment List — Remove pages (page ✕) vs Remove line (bin) look different */
.q2b-cpw .icon-btn svg,.al-dc .icon-btn svg{width:20px;height:20px;stroke-width:2}
.al-dc .icon-btn{color:var(--bad,#C62828);border-color:#C62828}

/* v492: AI result message right under the AI buttons (QC002 / QC002b) */
.ai-say{display:flex;align-items:flex-start;gap:8px;margin:2px 0 8px;padding:8px 8px 8px 12px;border-radius:6px;font-size:14px;line-height:1.35;font-weight:600}
.ai-say-ok{background:#1F6FB2;color:#fff}
.ai-say-bad{background:#C62828;color:#fff}
.ai-say-warn{background:#F2C230;color:#1C2530}
.ai-say-i{flex:none;font-weight:800}
.ai-say-t{flex:1;min-width:0;overflow-wrap:anywhere}
.ai-say-x{flex:none;width:28px;height:28px;margin:-4px -2px -4px 0;display:grid;place-items:center;border:0;border-radius:4px;background:transparent;color:inherit;cursor:pointer}
.ai-say-x svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round}
@media (hover:hover){ .ai-say-x:hover{background:rgba(0,0,0,.15)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */

/* v494: AI message box fits its text (not full width); colours by type kept */
.ai-say{display:flex;width:fit-content;max-width:100%;padding:6px 12px;gap:6px;align-items:center;box-sizing:border-box}
.ai-say-t{flex:0 1 auto}
.q2-ai-h + .ai-say{margin-left:auto}
.ai-say{margin-top:6px}
/* message box = same dark look as the bottom message (toast); type shown by a coloured icon chip */
.ai-say-ok,.ai-say-bad,.ai-say-warn{background:#1C2530;color:#fff}
.ai-say-i{display:inline-grid;place-items:center;width:20px;height:20px;border-radius:4px;font-size:12px}
.ai-say-ok .ai-say-i{background:#1F6FB2;color:#fff}
.ai-say-bad .ai-say-i{background:#C62828;color:#fff}
.ai-say-warn .ai-say-i{background:#F2C230;color:#1C2530}

/* v495: QC002 parts list read from QC002b — cert no. + pages per part */
.q2-ai-c{font-family:var(--mono);font-size:13px;font-weight:700;color:var(--ink)}
.q2-ai-nc{font-size:11px;padding:1px 6px}
@media (max-width:560px){ .q2-ai-p .q2-ai-d{flex:1 0 70%} .q2-ai-p .q2-ai-c{flex-basis:100%} }

/* v496: parts list (QC002 from QC008 / QC002b) = ONE line: No. Description (bold) · material · HN · Qty · Cert — wraps only when too long */
.q2-ai-p{display:block;line-height:1.55}
.q2-ai-p > span{display:inline}
.q2-ai-p .q2-ai-no{display:inline-block;min-width:0;margin-right:6px}
.q2-ai-p .q2-ai-d{flex:none;font-weight:700}
.q2-ai-p > span + span:not(.q2-ai-d):not(.q2-ai-nc)::before{content:" · ";font-family:var(--sans,inherit);color:var(--muted);font-weight:800;font-size:1.3em;line-height:0}
.q2-ai-p .q2-ai-c{font-weight:400;flex-basis:auto}
.q2-ai-p .q2-ai-nc{display:inline-block;margin-left:8px;vertical-align:1px}
@media (max-width:560px){ .q2-ai-p .q2-ai-d{flex:none} .q2-ai-p .q2-ai-c{flex-basis:auto} }

/* v498: SOP — a split decision on the MAIN path (e.g. Company Holiday "Approved?") stays in the main column on desktop; fork drops taller so Yes / No labels have room */
@media (min-width:821px){ .sop-flow > .sop-blk.sop-hassplit{grid-column:1;width:var(--mw);max-width:100%;justify-items:center} .sop-flow > .sop-blk.sop-hassplit > .sop-split{grid-template-columns:repeat(2,minmax(0,1fr));width:100%} }
.sop-split .sop-col > .sop-ar{height:56px}
/* v498: labelled arrows taller — label sits clear of the arrow head and the boxes */
.sop-ar:not(.sop-sidear):has(.sop-lb){height:54px}
.sop-ar:not(.sop-sidear):has(.sop-lb) .sop-lb{top:42%}
.sop-split .sop-col > .sop-ar{height:58px}
@media (max-width:820px){ .sop-ar.sop-sidear{height:54px} .sop-ar.sop-sidear .sop-lb{top:42%} }
/* v498: side-branch arrow head always shown (was clipped when the first box sat at the chain edge) */
@media (min-width:821px){ .sop-side > .sop-chain{clip-path:inset(-14px -14px -14px -12px)} }
@media (min-width:821px){ .sop-ar.sop-sidear .sop-lb{left:calc(50% - 12px)} }
@media (min-width:821px){ .sop-dln{min-width:30px} }

/* v500: SOP — linked button names, ⚠ Unclear flag, open questions */
.sop-bn{font-weight:700}
.sop-n .sop-unc,.sop-n .sop-brk{display:inline-flex;margin:0 0 5px 6px;font-size:11.5px;padding:1px 7px;vertical-align:top}
.sop-q{color:var(--ink)}
.sop-q b{color:inherit}
.sop-qp .panel-head .status{margin-left:auto}
.sop-ql li b{font-weight:700}
.sop-qn{margin-left:8px;font-size:12px}
.sop-mq{display:inline-flex;align-items:center;justify-content:center;margin-left:6px;width:18px;height:18px;border-radius:4px;background:#F2C230;color:#1C2530;font-size:11px;font-weight:700;line-height:1;vertical-align:1px}

/* v502: Production details — MDR required tick before Edit */
.pd-mdrrow{justify-content:flex-start}
.pd-mdrrow .btn{margin-left:auto}
.pd-mdr input:disabled{cursor:default}

/* v503: AI message right under the tapped button, pointer up to it */
.ai-say.ai-say-at{position:relative;margin-top:10px;margin-right:0}
.q2-ai-h + .ai-say.ai-say-at{margin-left:0}
.ai-say.ai-say-at::before{content:"";position:absolute;top:-7px;left:var(--ax,50%);margin-left:-7px;border:7px solid transparent;border-top:0;border-bottom-color:#1C2530}
.q2-ai-acts > .ai-say.ai-say-in{grid-column:1/-1;flex-basis:100%;justify-self:start;align-self:start;margin-top:4px;margin-bottom:2px}

/* v504: attachment list Insert — "Reading …" floats under the button, nothing pushed */
td.al-busycell{position:relative;overflow:visible}
.al-busy-pop{position:absolute;top:calc(100% - 2px);right:6px;z-index:6;display:flex;align-items:center;gap:8px;width:max-content;max-width:min(320px,calc(100vw - 48px));padding:6px 12px;border-radius:6px;background:#1C2530;color:#fff;font-size:13.5px;font-weight:600;line-height:1.3;white-space:normal;text-align:left;box-shadow:0 4px 12px rgba(0,0,0,.18)}
.al-busy-pop::before{content:"";position:absolute;top:-7px;right:22px;border:7px solid transparent;border-top:0;border-bottom-color:#1C2530}
.al-busy-pop .q2-ai-spin{flex:none;border-color:rgba(255,255,255,.35);border-top-color:#fff}
@media (max-width:560px){ .q2b-ed tr:has(> td.al-busycell){position:relative} td.al-busycell{position:static} .al-busy-pop{top:calc(100% - 4px);left:4px;right:4px;width:auto;max-width:none} .al-busy-pop::before{right:76px} }

/* v506: QC002a Insert photos with AI + sheet badge */
.q2a-ai{margin-top:12px}
.q2-ih .q2a-b{margin-left:8px;font-size:12px;padding:2px 8px;white-space:nowrap}
@media (max-width:560px){ .q2-ih .q2a-b{margin-left:6px;font-size:11.5px} }

/* v507: QC002a Insert photos with AI in the Add row (phone: own full row under Add | Screen clipping) */
@media (max-width:560px){ .q8-add > .q2a-aibtn{grid-column:1/-1;order:3} .q8-add > .q8-busy{order:4} }

/* v508: AI messages float (never push the table / form) */
.ai-say.ai-say-fl{position:absolute;z-index:8;margin:0!important;width:max-content;max-width:calc(100% - 16px);box-shadow:0 4px 14px rgba(0,0,0,.22)}

/* v524/v525 (Kah Poh): DESKTOP only — on the HOME page only, top bar logo, company name and "QMS" 1.3× bigger (other pages unchanged) */
@media (min-width:821px){
  body.on-home .brand-logo{width:73px;height:73px}
  body.on-home .brand-name{font-size:31px}
  body.on-home .brand-sub{font-size:15.6px}
  body.on-home .topbar-in{height:76px}   /* v526: bar keeps its old height (56px logo + 2×10px) — the bigger logo / name use the padding space */
}

/* v528 (Kah Poh): wide screens — the round Collapse all / Back buttons sit at the bottom-right of the PORTAL (1180px wide, centred), not the far right of the screen */
@media (min-width:1213px){ .fold-fab{right:calc((100vw - 1180px) / 2 + 16px)} }

/* v529 (Kah Poh): AI reads run in the background — chip bottom-left on every page, TOC row label, note on a form whose result came while away */
.ai-chip{position:fixed;left:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 20px);z-index:16;display:flex;flex-direction:column;gap:6px;max-width:min(440px,calc(100vw - 96px));pointer-events:none}
.ai-chip-r{pointer-events:auto;display:flex;align-items:center;gap:8px;background:#1C2530;color:#fff;border-radius:18px;padding:7px 8px 7px 12px;font-size:13px;line-height:1.3;box-shadow:0 4px 14px rgba(0,0,0,.22)}
.ai-chip-r .q2-ai-spin{flex:none;border-color:rgba(255,255,255,.35);border-top-color:#fff}
.ai-chip-t{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ai-chip-m{opacity:.85}
.ai-chip-i{flex:none;display:inline-grid;place-items:center;width:20px;height:20px;border-radius:50%;font-weight:700;font-size:12px;background:#1F6FB2;color:#fff}
.ai-chip-r.bad .ai-chip-i{background:#C62828}
.ai-chip-x{flex:none;width:28px;height:28px;border-radius:50%;border:1px solid rgba(255,255,255,.45);background:transparent;color:#fff;font-size:11px;cursor:pointer}
@media (hover:hover){ .ai-chip-x:hover{background:rgba(255,255,255,.12)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.md-open.md-open-ai.pend{background:#F2C230;border-color:#F2C230;color:#1C2530;font-weight:700}
.md-open.md-open-ai.busy{border-color:#2457E6;color:#2457E6;font-weight:700}
.ai-away{margin:0 0 12px;display:flex;flex-wrap:wrap;align-items:center;gap:6px;font-size:14px}
@media (max-width:560px){ .ai-chip{left:12px;max-width:calc(100vw - 84px)} .ai-chip-r{font-size:12.5px} }
@media (min-width:1213px){ .ai-chip{left:calc((100vw - 1180px) / 2 + 16px)} }
body:has(#toastHost .toast) .ai-chip{bottom:calc(env(safe-area-inset-bottom,0px) + 78px);transition:bottom .15s}   /* v529: chip steps up while a message shows */
@media (max-width:560px){ body:has(#toastHost .toast) .ai-chip{bottom:calc(env(safe-area-inset-bottom,0px) + 104px)} }

/* v530 (Kah Poh): Equipment details — one PO item split into several equipment */
.pd-eq{border-left:4px solid #2457E6}
.pd-eqh{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 12px;margin:0 0 8px;padding-bottom:6px;border-bottom:1px solid var(--divider)}
.pd-eqn{color:#3A1F8F;font-size:14px}
.pd-eqd{font-weight:600;color:var(--ink)}.pd-eqd.mut{color:#8A6D00;font-weight:600}
.pd-eqm{font-size:13px;color:var(--muted)}.pd-eqm b{color:var(--ink);font-weight:600}
.pd-eqx{margin-left:4px}
.pd-addeq{display:flex;flex-wrap:wrap;align-items:center;gap:6px 12px;margin-top:10px}
.pd-addeq .muted{font-size:13px}
.it-eqn{color:#2457E6;font-weight:600}
@media (max-width:560px){ .pd-eqh{flex-direction:column;gap:2px} .pd-addeq .btn{width:100%;justify-content:center} }
:root[data-theme="dark"] .pd-eqn{color:#7FB0EA} @media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .pd-eqn{color:#7FB0EA} :root:not([data-theme="light"]) .pd-eqd.mut{color:#F2C230} }

/* v532 (Kah Poh): Production / Equipment details edit form fits one screen — desktop 2 columns, Item description full width, Qty short */
@media (min-width:821px){
  .pd-form.pd-cmp{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:28px;row-gap:6px}
  .pd-cmp .pd-row{grid-template-columns:128px minmax(0,1fr)}
  .pd-cmp .pd-row .inp{max-width:none}
  .pd-cmp .pd-row .md-dt{max-width:150px!important}
  .pd-cmp .pd-k-eqDesc{grid-column:1/-1}
  .pd-cmp .pd-k-eqQty .inp{max-width:120px}
  .pd-cmp .pd-row .md-hint{font-size:12.5px}
  .pd-cmp .pd-bot-acts{grid-column:1/-1}
}
.pd-cmp .pd-k-eqQty .inp{max-width:120px}
@media (max-width:820px){ .pd-form.pd-cmp{display:grid;grid-template-columns:minmax(0,1fr) 104px;column-gap:10px;row-gap:6px} .pd-cmp > *{grid-column:1/-1;min-width:0}
  .pd-cmp > .pd-k-eqTag{grid-column:1} .pd-cmp > .pd-k-eqQty{grid-column:2} .pd-cmp .pd-k-eqQty .inp{max-width:none} }   /* v532 phone: Tag / Dwg no. + Qty side by side */
@media (min-width:821px){   /* v533 (Kah Poh): the 4 date boxes smaller, "PO date: …" hint on the right of the box (one line) */
  .pd-cmp .pd-rd .md-date{display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
  .pd-cmp .pd-rd .md-dt{width:140px!important;max-width:140px!important;flex:none;padding-left:8px;padding-right:6px}
  .pd-cmp .pd-rd .md-hint{margin:0;font-size:12px;line-height:1.3;min-width:0}
  .pd-cmp .pd-rd .md-hint .hv,.pd-cmp .pd-rd .md-hint .hs{white-space:nowrap}
  .pd-cmp .pd-rd .md-err{flex-basis:100%}
}

/* v534 (Kah Poh): equipment cards fold — tap the header */
.pd-eqtog{cursor:pointer;user-select:none;border-radius:4px}
@media (hover:hover){ .pd-eqtog:hover .pd-eqn{text-decoration:underline} }   /* v545: phone kept the underline after a tap (sticky hover) */
.pd-eqtog:focus-visible{outline:2px solid #2457E6;outline-offset:2px}
.pd-eqchev{width:16px;height:16px;flex:none;align-self:center;fill:none;stroke:#3A1F8F;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.pd-fold .pd-eqchev{transform:rotate(-90deg)}
.pd-card.pd-fold .pd-eqh{margin:0;padding-bottom:0;border-bottom:0}
/* v534 phone grid replaced by v540 */
:root[data-theme="dark"] .pd-eqchev{stroke:#7FB0EA} @media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .pd-eqchev{stroke:#7FB0EA} }

/* v535 (Kah Poh): fold / unfold all equipment — double-arrow button in the Equipment details bar */
.pd-hbar{display:flex;align-items:center;gap:6px}.pd-hbar > .pd-h{flex:1;min-width:0}
.pd-foldall{flex:none;width:34px;height:34px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #8A96A3;border-radius:6px;background:var(--surface);color:#3A1F8F;cursor:pointer}
@media (hover:hover){ .pd-foldall:hover{border-color:#2457E6;color:#2457E6} }   /* v606: mouse only — on touch it stuck while dragging */.pd-foldall:focus-visible{outline:2px solid #2457E6;outline-offset:2px}
.pd-foldall svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.4;stroke-linecap:round;stroke-linejoin:round}
:root[data-theme="dark"] .pd-foldall{color:#7FB0EA} @media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .pd-foldall{color:#7FB0EA} }

/* v540 (Kah Poh): phone — "Equip.1" + description on one row, Tag / Dwg · Qty (and ⚠) below */
.pd-eqn-s{display:none}
@media (max-width:560px){
  .pd-eqn-l{display:none}.pd-eqn-s{display:inline}
  .pd-eqh,.pd-eqtog{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;row-gap:2px;align-items:baseline;flex-direction:initial}
  .pd-eqh > *{grid-column:1/-1}
  .pd-eqh > .pd-eqn{grid-column:1;white-space:nowrap}
  .pd-eqh > .pd-eqd{grid-column:2;min-width:0;overflow-wrap:anywhere}
  .pd-eqtog{grid-template-columns:auto auto minmax(0,1fr)}
  .pd-eqtog > *{grid-column:2/-1}
  .pd-eqtog > .pd-eqchev{grid-column:1;grid-row:1;align-self:center}
  .pd-eqtog > .pd-eqn{grid-column:2;grid-row:1}
  .pd-eqtog > .pd-eqd{grid-column:3;grid-row:1}
}

/* v541 (Kah Poh): phone — "Equip.1" not bold */
@media (max-width:560px){ .pd-eqn .pd-eqn-s{font-weight:400} }

/* v542 (Kah Poh): phone item card — "Tag / Dwg no.:" + value use the whole row up to Qty */
@media (max-width:560px){
  table.it.stack-it td.c-tag{grid-area:auto;grid-row:2;grid-column:1 / -1;min-width:0;overflow-wrap:anywhere;padding-right:64px}   /* spans under the wide right column; Qty sits on top at the right */
  table.it.stack-it td.c-qty{grid-area:auto;grid-row:2;grid-column:2;align-self:start}
  table.it.stack-it td.c-tag .lbl{white-space:nowrap} }

/* v546 (Kah Poh): Clients › Production details (per client ticks) + hidden-values hint */
.pds-card{margin:0 0 8px;padding:0;overflow:hidden}
.pds-h{display:flex;align-items:center;gap:6px 12px;flex-wrap:wrap;width:100%;min-height:48px;padding:10px 14px;background:none;border:0;text-align:left;cursor:pointer;color:var(--ink);font:inherit}
@media (hover:hover){ .pds-h:hover .pds-n{color:#2457E6} }   /* v560: no blue flash when a finger scrolls over it (phone) */
.pds-h{-webkit-tap-highlight-color:transparent}
.pds-n{font-weight:700;font-size:15px}
.pds-j{color:var(--muted);font-size:13px}
.pds-st{margin-left:auto}
.pds-h .pd-chev{margin-left:4px}
.pds-card.open .pd-chev{transform:rotate(180deg)}
.pds-b{padding:4px 14px 14px;border-top:1px solid var(--divider)}
.pds-g{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 24px;padding:10px 0}
.pds-f{display:flex;align-items:center;gap:8px;min-height:40px;font-size:15px;cursor:pointer}
.pds-o{color:var(--muted);font-size:12.5px}
.pds-acts{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px}
.pds-cap{margin-left:auto;font-size:13px;color:#2457E6}
.pds-note{font-size:13px;margin:8px 0 0}
@media (max-width:560px){ .pds-g{grid-template-columns:1fr} .pds-st{margin-left:0} .pds-cap{margin-left:0;width:100%} }
.pd-hid{background:none;border:0;padding:6px 0;margin:0;font:inherit;font-size:13px;color:var(--muted);cursor:pointer;text-align:left;min-height:32px}
@media (hover:hover){ .pd-hid:hover{color:#2457E6;text-decoration:underline} }
.pd-hid-in{display:block;margin-top:6px}
.pd-hidpop{position:fixed;z-index:220;box-sizing:border-box;width:320px;max-width:calc(100vw - 16px);max-height:70vh;overflow:auto;background:var(--surface,#fff);border:2px solid #3A1F8F;border-radius:10px;box-shadow:0 10px 28px rgba(28,37,48,.28);padding:10px 12px;display:flex;flex-direction:column;gap:4px}
.pd-hidt{font-weight:700;color:#3A1F8F;margin-bottom:2px}
.pd-hidg{font-weight:700;font-size:13px;margin-top:6px;color:var(--ink)}
.pd-hidr{display:grid;grid-template-columns:minmax(0,46%) minmax(0,1fr);gap:8px;font-size:14px;padding:3px 0;border-bottom:1px dashed var(--divider)}
.pd-hidr > span:last-child{font-weight:600;overflow-wrap:anywhere}
.pd-hidn{font-size:12px;color:var(--muted);margin-top:6px}
.pd-hidpop .rm-b{display:flex;justify-content:flex-end;margin-top:4px}
/* v547 (Kah Poh): A–Z / Z–A button beside the search box (phone too) */
#view-pdshow .forms-tools{display:flex;flex-wrap:nowrap;align-items:center;gap:8px}
#view-pdshow .forms-tools .search-wrap{flex:1;min-width:0}
#view-pdshow .pds-sort{flex:none;width:auto;white-space:nowrap}

/* v549 (Kah Poh): "⚠ Completed · MDR not locked" badge (Project list client cell + Item details job head) */
.pj-mdrw{margin-top:4px}
.pj-mdrb{white-space:nowrap}
/* v552: phone — search on its own row, A–Z + Ongoing / All clients side by side below */
@media (max-width:560px){ #view-pdshow .forms-tools{flex-wrap:wrap} #view-pdshow .forms-tools .search-wrap{flex:1 1 100%} #view-pdshow .pds-sort{flex:1 1 0;justify-content:center} }

/* v553: Tag no. / Client Drawing no. ticks (Production details page) */
.pds-sub{margin:4px 0 0;padding-top:10px;border-top:1px dashed var(--divider);font-size:13px;color:var(--muted)}
.pds-sub b{color:var(--ink)}
.pds-tg{padding-top:4px}
@media (max-width:820px){ .pd-form.pd-cmp{grid-auto-flow:row dense} }   /* v554: Qty fills the gap beside Tag no. (Client Dwg no. full width) */
/* v557 (Kah Poh): Clients › Production details ticks more compact (this page only) */
.pds-g{grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:0 18px;padding:6px 0}
.pds-f{min-height:32px;font-size:14px;gap:7px}
.pds-f input{width:18px;height:18px}
.pds-o{font-size:12px}
.pds-b{padding:2px 14px 10px}
.pds-sub{margin:2px 0 0;padding-top:6px}
.pds-acts{margin-top:6px}
.pds-note{margin:6px 0 0;font-size:12.5px}
@media (max-width:560px){ .pds-g{grid-template-columns:repeat(2,minmax(0,1fr));gap:0 10px} .pds-f{min-height:36px;font-size:14px;line-height:1.25} }
.pds-f input{flex:none}

/* v558: Production details page — "Show in item box" on top, data boxes below */
.pds-sec{margin:6px 0 4px;padding:6px 10px;border:1px solid var(--divider);border-radius:6px;background:var(--ground,#F5F7FA)}
.pds-sh{font-size:13px;font-weight:700;color:var(--ink);margin:2px 0}
.pds-sh b{color:#3A1F8F}
.pds-sh2{margin-top:8px}
/* v559 (Kah Poh): phone — Production details client card: name + chevron on top, jobs left / status badge bottom right */
@media (max-width:560px){
  .pds-h{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:6px 10px}
  .pds-h .pds-n{grid-column:1;grid-row:1}
  .pds-h .pd-chev{grid-column:2;grid-row:1;margin-left:0}
  .pds-h .pds-j{grid-column:1;grid-row:2}
  .pds-h .pds-st{grid-column:2;grid-row:2;justify-self:end;margin-left:0}
}
@media (max-width:560px){
  .pds-h{position:relative}
  .pds-h .pds-n{grid-column:1/-1;padding-right:26px}
  .pds-h .pd-chev{position:absolute;right:14px;top:14px}
}
@media (max-width:560px){ .pds-h .pd-chev{top:11px} }

/* v562 (Kah Poh): ⓘ after a page title → tap shows / hides the page note (lede) */
.lede-i{display:inline-flex;align-items:center;justify-content:center;width:24px;height:24px;margin-left:6px;vertical-align:middle;border-radius:50%;border:2px solid var(--link,#2457E6);background:var(--surface,#fff);color:var(--link,#2457E6);font:700 13px/1 Georgia,"Times New Roman",serif;font-style:italic;cursor:pointer;padding:0}
.lede-i.on{background:#2457E6;color:#fff}
.lede-i:focus-visible{outline:2px solid #3A1F8F;outline-offset:2px}

/* v563 (Kah Poh): page note (lede) behind ⓘ on every page, bigger text */
.lede.ld-off{display:none}
.lede{font-size:16px;line-height:1.5;color:var(--ink);opacity:.85}
@media (max-width:820px){ .lede{font-size:15px} }
.ph-title{display:flex;align-items:center;gap:8px;min-width:0}
.ph-title > h1{min-width:0}
@media (min-width:561px){ .page-head > div:first-child .ph-title{padding-right:190px} .page-head > div:first-child .ph-title > h1{padding-right:0} }
.lede-i{margin-left:0;flex:none}
.ph-title:has(+ .lede[hidden]) .lede-i{display:none}

/* v564 (Kah Poh): Item details job head — "⚠ Completed - outstanding MDR" sits in the title: next to it on desktop, own line on phone (no more squeezed client name) */
.it-mdrw{display:inline-block;margin-left:10px;vertical-align:middle}
.it-mdrw .pj-mdrb{font-size:11px}
@media (max-width:560px){ .it-mdrw{display:block;margin:6px 0 0} }

/* v566 (Kah Poh): phone — modified caption box lines up with the Original box; (PO Link) badge sits inside the box, bottom-right */
@media (max-width:820px){ .cap-mod{position:relative;flex-wrap:nowrap} .cap-mod .inp{flex:1 1 auto}
  .cap-mod:has(.cap-link:not([hidden])) .inp{padding-right:56px}
  .cap-mod .cap-link{position:absolute;right:4px;bottom:3px;font-size:9.5px;line-height:1.3;padding:0 5px;pointer-events:none}
  .cap-mod b+.cap-link{position:static} }

/* v569 (Kah Poh): long title wraps to 2 lines → the ⓘ sits right after the last word, not on the far right */
.ph-title{display:block}
.ph-title > h1{display:inline}
.ph-title > .lede-i{display:inline-flex;margin-left:8px;vertical-align:.12em;position:relative;top:-1px}
.ph-title:has(+ .lede[hidden]) .lede-i{display:none}

/* v571: Client details list without Owner */
@media (max-width:560px){ .stack-ci tr{grid-template-areas:"name act" "pic pic" "ag ag"} }

/* v574 (Kah Poh): unsaved-changes bar stays in front of the group bars when scrolling; phone: buttons always inside the box */
.savebar{z-index:4;box-sizing:border-box;max-width:100%}
@media (max-width:820px){ .savebar > div:last-child{flex:1 1 100%;min-width:0}
  .savebar > div:last-child .btn{min-width:0;white-space:normal;text-align:center;justify-content:center}
  .savebar > div:last-child .btn-primary{flex:1 1 auto} }

/* v576 (Kah Poh): phone — number boxes (reg. no., short code, phones, short names) 16px so iPhone doesn't zoom in (no more dragging sideways) */
@media (max-width:820px){ .inp.mono{font-size:16px} }
/* v576: phone — Discard / Save box sits right below the box being edited */
.savebar.sb-in{position:static;grid-column:1/-1;margin:4px 0 6px;box-shadow:0 2px 8px rgba(15,30,50,.12)}

/* ---------- v590 Projects › Schedule — v595: FAB006 layout on Chart B (DHTMLX); Chart A (Frappe) removed ---------- */
:root{--sch-prog:#2457E6;--sch-done:#3A1F8F;--sch-late:#C62828;
  --sch-bp:#C3CBD4;--sch-bc:#3A1F8F;--sch-ba:#2457E6;--sch-bo:#C62828;--sch-band:#3A1F8F;--sch-band-ink:#fff;--sch-off:rgba(107,119,133,.16);--sch-hol:rgba(242,194,48,.75);--sch-tdyc:rgba(198,40,40,.08)}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){--sch-done:#9EC3EE;--sch-done-ink:#1C2530;--sch-bp:#55616E;--sch-bc:#E4E8EE;--sch-band:#2A4A75;--sch-off:rgba(213,219,225,.10);--sch-hol:rgba(242,194,48,.6);--sch-tdyc:rgba(239,83,80,.14)} }
:root[data-theme="dark"]{--sch-done:#9EC3EE;--sch-done-ink:#1C2530;--sch-bp:#55616E;--sch-bc:#E4E8EE;--sch-band:#2A4A75;--sch-off:rgba(213,219,225,.10);--sch-hol:rgba(242,194,48,.6);--sch-tdyc:rgba(239,83,80,.14)}
/* v593: the chart takes the portal's own colours (light + dark) */
.sch-b{--dhx-gantt-container-background:var(--surface);--dhx-gantt-container-color:var(--ink);--dhx-gantt-grid-scale-background:var(--surface-2);--dhx-gantt-grid-scale-color:var(--ink);--dhx-gantt-timeline-scale-background:var(--surface-2);--dhx-gantt-timeline-scale-color:var(--ink);--dhx-gantt-grid-body-background:var(--surface);--dhx-gantt-task-row-background:var(--surface);--dhx-gantt-task-row-background--odd:var(--surface);--dhx-gantt-base-colors-background:var(--surface);--dhx-gantt-base-colors-background-alt:var(--surface-2);--dhx-gantt-base-colors-border:var(--divider);--dhx-gantt-base-colors-border-light:var(--divider);--dhx-gantt-base-colors-text-base:var(--ink);--dhx-gantt-base-colors-text-light:var(--muted);--dhx-gantt-base-colors-icons:var(--muted);--dhx-gantt-base-colors-select:var(--surface-2);--dhx-gantt-base-colors-hover-color:var(--surface-2)}
.sch-b .gantt_container,.sch-b .gantt_grid,.sch-b .gantt_task,.sch-b .gantt_data_area,.sch-b .gantt_grid_data,.sch-b .gantt_task_bg{background:var(--surface);color:var(--ink)}
.sch-b .gantt_row,.sch-b .gantt_task_row{background:var(--surface)}
.sch-b .gantt_row.gantt_selected,.sch-b .gantt_task_row.gantt_selected{background:var(--surface-2)}
@media (hover:hover){ .sch-b .gantt_row:hover{background:var(--surface-2)} }
.sch-b .gantt_grid_scale,.sch-b .gantt_task_scale,.sch-b .gantt_scale_line,.sch-b .gantt_scale_cell{background:var(--surface-2);color:var(--ink);border-color:var(--divider)}
.sch-b .gantt_cell,.sch-b .gantt_tree_content,.sch-b .gantt_grid_head_cell{color:var(--ink)}
.sch-b .gantt_task_cell,.sch-b .gantt_row,.sch-b .gantt_task_row,.sch-b .gantt_grid_head_cell{border-color:var(--divider)}
.sch-b .gantt_grid_scale,.sch-b .gantt_task_scale{font-weight:600;color:var(--ink)}
.sch-b .gantt_grid_head_cell{line-height:1.15!important;display:inline-flex!important;vertical-align:top;flex-direction:column;align-items:center;justify-content:center;white-space:normal;font-size:12px;height:100%}
.sch-b .gantt_grid_head_cell small{display:block;font-weight:500;color:var(--muted);font-size:10px}
.sch-b .gantt_cell{font-size:13px}
.sch-2l{display:flex;flex-direction:column;line-height:1.2;font-size:12px;font-variant-numeric:tabular-nums}
/* job band (like the FAB006 job row) */
.sch-b .gantt_grid_data .gantt_row.sch-band,.sch-b .gantt_grid_data .gantt_row.sch-band:hover,.sch-b .gantt_grid_data .gantt_row.sch-band.gantt_selected{background:var(--sch-band)}
.sch-b .gantt_row.sch-band .gantt_cell,.sch-b .gantt_row.sch-band .gantt_tree_content,.sch-b .gantt_row.sch-band .gantt_tree_icon{color:var(--sch-band-ink)}
.sch-b .gantt_row.sch-band .gantt_tree_icon{filter:brightness(0) invert(1)}
.sch-b .gantt_row.sch-band .sch-gsub{font-weight:500;opacity:.85}
.sch-b .gantt_task_row.sch-band-t{background:var(--surface-2)}
/* time line cells: Sunday / Company Holiday / today (Day view) */
.sch-b .gantt_task_cell.sch-sun{background:var(--sch-off)}
.sch-b .gantt_task_cell.sch-hol{background:repeating-linear-gradient(135deg,var(--sch-hol) 0 3px,transparent 3px 7px)}   /* stripes: never mistaken for the grey Sunday */
.sch-b .gantt_task_cell.sch-tdy{background:var(--sch-tdyc)}
.sch-b .gantt_scale_cell.sch-sun{color:#C62828;font-weight:700}
.sch-b .gantt_scale_cell.sch-hol{background:#F2C230;color:#1C2530;font-weight:700}
.sch-b .gantt_scale_cell.sch-tdy{background:#C62828;color:#fff;font-weight:700}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sch-b .gantt_scale_cell.sch-sun{color:#FF8A80} }
:root[data-theme="dark"] .sch-b .gantt_scale_cell.sch-sun{color:#FF8A80}
/* bars: hidden tap bar + our own layer (Plan, % Complete, Actual, past Plan delivery) */
.sch-b .gantt_task_line.sch-hit{background:transparent;border:none;box-shadow:none}
.sch-b .gantt_task_line.sch-hit .gantt_task_content{position:absolute;inset:0;overflow:visible;padding:0;line-height:normal}
.sch-b .gantt_task_line.sch-hit .gantt_task_content>div{position:absolute;border-radius:2px}
.sch-bp{background:var(--sch-bp)} .sch-bc{background:var(--sch-bc)} .sch-ba{background:var(--sch-ba)} .sch-bo{background:var(--sch-bo)}
.sch-negc{display:inline-block;min-width:34px;padding:1px 6px;border-radius:3px;background:#C62828;color:#fff;font-weight:700}
.sch-neg{color:#C62828;font-weight:700}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sch-neg{color:#FF8A80} }
:root[data-theme="dark"] .sch-neg{color:#FF8A80}
.sch-b .sch-today-ln{position:absolute;top:0;width:2px;margin-left:-1px;background:var(--sch-late);z-index:2;pointer-events:none}
.sch-dx{width:100%;font-family:var(--sans)}
/* tools + legend */
.sch-tools{align-items:center}
.sch-segs{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.sch-seg button{min-width:0;padding:0 14px;font-size:14px}
.sch-clw{display:flex;gap:8px;align-items:center}
.sch-cl{min-width:180px;max-width:280px}
.sch-pdf{white-space:nowrap}
.sch-legend{display:flex;flex-wrap:wrap;align-items:center;gap:6px 16px;margin:0 0 10px;font-size:13px;font-weight:600}
.sch-lg{display:inline-flex;align-items:center;gap:6px}
.sch-lg i{display:inline-block;width:22px;height:9px;border-radius:2px;font-style:normal}
.sch-lg-plan i{background:var(--sch-bp)} .sch-lg-pct i{background:var(--sch-bc)} .sch-lg-act i{background:var(--sch-ba)} .sch-lg-over i{background:var(--sch-bo)}
.sch-lg-tdy i{width:2px;height:14px;background:var(--sch-late)}
.sch-lg-sun i,.sch-lg-hol i{width:14px;height:14px;box-shadow:inset 0 0 0 1px var(--divider)} .sch-lg-sun i{background:var(--sch-off)} .sch-lg-hol i{background:repeating-linear-gradient(135deg,var(--sch-hol) 0 3px,transparent 3px 7px)}
.sch-lg-neg i{width:auto;height:auto;padding:1px 5px;background:#C62828;color:#fff;font-size:11px;font-weight:700}
.sch-chart{background:var(--surface);border:1px solid var(--divider);border-radius:8px;overflow:hidden;max-width:100%}
.sch-wait{margin:0;padding:24px 16px}
.sch-none{margin:10px 2px 0}
.status.st-prog{background:var(--sch-prog);color:#fff;border-color:var(--sch-prog)}
.sch-card{margin-top:12px}
.sch-ch{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.sch-ch b{font-size:16px} .sch-ch .icon-btn{margin-left:auto}
.sch-sub{color:var(--muted);margin:-2px 0 8px}
.sch-l{display:grid;grid-template-columns:110px 1fr;gap:8px;padding:5px 0;border-top:1px solid var(--divider)}
.sch-k{color:var(--muted);font-weight:600}
.sch-acts{margin-top:10px}
@media (max-width:560px){
  .sch-segs{width:100%;display:grid;grid-template-columns:1fr 1fr;gap:8px} .sch-seg{display:flex;width:100%} .sch-seg button{flex:1;padding:0 4px;min-width:0}
  #schLvl,#schScale,.sch-clw{grid-column:1/-1} .sch-cl{flex:1;min-width:0;max-width:none}
  .sch-legend{gap:6px 10px;font-size:12px}
  .sch-l{grid-template-columns:84px 1fr}
}
/* v595 FAB006 PDF page (A4 landscape, fixed print colours) */
.fab6-sheet{padding:30px;font-family:Arial,"Liberation Sans",sans-serif;color:#000;display:flex;flex-direction:column}
.fab6-head{display:flex;align-items:center;gap:14px;border:1.5px solid #000;padding:8px 12px;height:74px;box-sizing:border-box}
.fab6-logo,.fab6-clogo{width:120px;height:56px;display:flex;align-items:center;justify-content:center}
.fab6-logo img,.fab6-clogo img{max-width:100%;max-height:100%;object-fit:contain}
.fab6-tt{flex:1;text-align:center}
.fab6-co{font-size:13px;font-weight:700}
.fab6-ti{font-size:20px;font-weight:700;letter-spacing:.5px;margin-top:2px}
.fab6-ref{width:130px;text-align:right;font-size:11px;line-height:1.5}
.fab6-info{display:flex;flex-wrap:wrap;gap:4px 22px;padding:8px 2px;font-size:11px}
.fab6-kv{display:flex;gap:5px} .fab6-kv span:first-child{color:#333}
.fab6-tbl{border:1px solid #000;flex:0 0 auto}
.fab6-r{display:flex;height:22px;border-top:1px solid #8A96A3;font-size:9.5px}
.fab6-r:first-child{border-top:none}
.fab6-hr{height:34px;background:#D5DBE1;font-weight:700;font-size:9px;border-bottom:1px solid #000}
.fab6-c{box-sizing:border-box;padding:0 3px;border-right:1px solid #8A96A3;display:flex;align-items:center;justify-content:center;text-align:center;overflow:hidden;white-space:nowrap;line-height:1.1}
.fab6-hr .fab6-c{white-space:normal}
.fab6-c-job{justify-content:flex-start;text-align:left}
.fab6-band{background:#3A1F8F;color:#fff;font-weight:700}
.fab6-band .fab6-c{border-right-color:#5A7290}
.fab6-neg{background:#C62828;color:#fff;font-weight:700}
.fab6-tl{position:relative;flex:0 0 auto;height:100%;overflow:hidden;background:#fff}
.fab6-band .fab6-tl{background:#E4E8EE}
.fab6-tlh{position:relative;height:100%;overflow:hidden}
.fab6-t1,.fab6-t2{position:absolute;box-sizing:border-box;display:flex;align-items:center;justify-content:center;overflow:hidden;white-space:nowrap;border-left:1px solid #8A96A3;font-size:8.5px}
.fab6-t1{top:0;height:17px;border-bottom:1px solid #8A96A3}
.fab6-t2{top:17px;height:17px;font-weight:500}
.fab6-t2.fab6-sun{color:#C62828;font-weight:700}
.fab6-t2.fab6-hol{background:#F2C230}
.fab6-t2.fab6-tdyh{background:#C62828;color:#fff}
.fab6-sh{position:absolute;top:0;bottom:0}
.fab6-sh-sun{background:#E4E8EE} .fab6-sh-hol{background:#FBE9A6}
.fab6-vl{position:absolute;top:0;bottom:0;width:1px;background:#D5DBE1}   /* a fill, not a border → bars are drawn over it in the PDF */
.fab6-tdy{position:absolute;top:0;bottom:0;width:0;border-left:1.5px solid #C62828}
.fab6-bp,.fab6-bc,.fab6-ba,.fab6-bo{position:absolute}
.fab6-bp{background:#B8C2CC} .fab6-bc{background:#3A1F8F} .fab6-ba{background:#2457E6} .fab6-bo{background:#C62828}
.fab6-foot{display:flex;flex-wrap:wrap;gap:4px 16px;align-items:center;margin-top:auto;padding-top:8px;font-size:9.5px}
.fab6-lg{display:inline-flex;align-items:center;gap:5px}
.fab6-lg i{display:inline-block;position:relative;width:18px;height:7px}
.fab6-lg i.fab6-sh-sun,.fab6-lg i.fab6-sh-hol{width:10px;height:10px;border:1px solid #8A96A3}
.fab6-lg i.fab6-tdy-k{width:0;height:12px;border-left:1.5px solid #C62828}
.fab6-lg i.fab6-neg-k{width:12px;height:10px;background:#C62828}

/* v592 Show in Schedule tick (Clients › Production details) */
.pds-schs{margin-bottom:10px}
.pds-sc{white-space:nowrap}
@media (max-width:560px){ .pds-sc{grid-column:1/-1;justify-self:start} }

/* v599 (Kah Poh, phone): Form list — Edit / Delete hidden in the row; tap the row → floating box .f-actpop */
.f-actpop{border-color:var(--steel,#2457E6);width:300px}
.f-actpop .fa-h{display:flex;align-items:baseline;gap:8px;padding:0 2px}
.f-actpop .fa-h .fno{font-family:var(--mono);font-weight:700;font-size:15px;color:var(--ink,#1C2530)}
.f-actpop .fa-rev{font-size:13px;color:var(--muted,#6B7785)}
.f-actpop .fa-t{padding:0 2px;font-size:14.5px;line-height:1.3;color:var(--ink,#1C2530);overflow:hidden;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow-wrap:anywhere}
.f-actpop .fa-del{color:#C62828;border-color:#C62828}
.f-actpop .fa-del svg{stroke:#C62828}
@media (max-width:560px){
  table.stack-forms td.c-bar .fb-r{display:none!important}
  table.stack-forms tr.f-tapr{cursor:pointer;-webkit-tap-highlight-color:transparent}
  table.stack-forms tr.f-tapon{outline:0;background:var(--surface-2,#EEF2F6)!important;box-shadow:inset 4px 0 0 var(--steel,#2457E6);border-radius:8px;margin-left:-10px;margin-right:-10px;padding-left:14px!important;padding-right:10px!important}   /* v600: tapped row = shaded card + steel left bar (was a thin square outline) */
  table.stack-forms tr.f-tapon td{background:transparent!important}
  .table-wrap:has(> table.stack-forms){overflow:visible}   /* v600: let the tapped-row card reach past the list edge */
  table.stack-forms td.c-bar:not(:has(.fb-l > *)){display:none!important}
}

/* v601 (Kah Poh): Client list on phone follows the long-list rule — Details / Edit / Delete hidden in the card; tap the card → .f-actpop */
.f-actpop .fa-nm{font-weight:700;font-size:15px;color:var(--ink,#1C2530);line-height:1.3;overflow-wrap:anywhere}
.f-actpop .rm-b.fa-b3{grid-template-columns:1fr 1fr 1fr}
.f-actpop .rm-b.fa-b3 .btn{padding:0 6px}
.f-actpop .rm-b.fa-b1{grid-template-columns:1fr}
@media (max-width:560px){
  table.stack-clients td.c-act{display:none!important}
  .stack-clients tr{grid-template-areas:"name name" "addr addr" "ph term"!important}
  table.stack-clients tr.f-tapr{cursor:pointer;-webkit-tap-highlight-color:transparent}
  table.stack-clients tr.f-tapon{outline:0;background:var(--surface-2,#EEF2F6)!important;box-shadow:inset 4px 0 0 var(--steel,#2457E6);border-radius:8px;margin-left:-10px;margin-right:-10px;padding-left:14px!important;padding-right:10px!important}
  table.stack-clients tr.f-tapon td{background:transparent!important}
  .table-wrap:has(> table.stack-clients){overflow:visible}
}

/* v602: buttons whose label sits in span.bl never spill out of the box — the label shortens with … instead */
.btn > .bl{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media (max-width:560px){ .forms-tools .btn{min-width:0;overflow:hidden} }
@media (max-width:560px){
  /* v602 (Kah Poh): Client list toolbar — 3 buttons on one row: each as wide as its words, no small icons, label never spills */
  #view-clients .forms-tools .btn{flex:1 1 auto;padding-left:8px!important;padding-right:8px!important;gap:0}
  #view-clients .forms-tools .btn > svg{display:none}
}

/* v606: no grey tap flash on buttons / tiles while dragging on touch screens */
button,.btn,select{-webkit-tap-highlight-color:transparent}
/* v607 (Kah Poh, phone: "drag to bottom → top bar jumps up & down"): iPhone's rubber-band bounce at the page end moved the sticky top bar.
   No bounce on the page itself (inner scroll boxes keep their own). Needs iOS 16+. */
html,body{overscroll-behavior-y:none}

/* v609: portal terms labels on the newer parts */
body.terms-on .rm-ask[data-term]::before,body.terms-on .toast[data-term]::before,body.terms-on .ai-say[data-term]::before{top:-11px}
body.terms-on .btn[data-term]::before,body.terms-on .icon-btn[data-term]::before{top:-12px;left:2px}
body.terms-on #nav a .cnt[data-term]::before{left:auto;right:0;top:-14px}
body.terms-on .nav-sub-head[data-term]::before,body.terms-on .top-zoom[data-term]::before{top:-12px}
body.terms-on .gantt_container[data-term]::before{top:2px;left:auto;right:6px}
body.terms-on .btn-quiet[data-term]::before{top:auto;bottom:-13px}
body.terms-on .top-zoom[data-term]::before{top:8px;bottom:auto;left:auto;right:calc(100% + 6px)}
body.terms-on #foldFab[data-term]::before{top:-36px}
body.terms-on #foldBack[data-term]::before{top:-16px;left:0;right:auto}
body.terms-on .top-zoom[data-term]{overflow:visible}

/* v611: Forms records (own forms, e.g. FAB005a) */
.fh-recs > .panel-head{display:flex;align-items:center;gap:10px}
.fh-recs > .panel-head .fh-add{margin-left:auto}
.fh-new{border:2px solid var(--steel,#2457E6);margin:0 0 12px}
table.fh-tb .fh-it{display:block;font-size:12.5px;color:var(--muted)}
@media (max-width:560px){ table.fh-tb td.c-act{display:none!important} table.fh-tb tr.f-tapr{cursor:pointer;-webkit-tap-highlight-color:transparent}
  table.fh-tb tr.f-tapon{outline:0;background:var(--surface-2,#EEF2F6)!important;box-shadow:inset 4px 0 0 var(--steel,#2457E6);border-radius:8px} }
/* v612: equipment Copy sits right before Edit; confirm boxes with a navy action (Copy, Lock) get a navy frame — red frame stays for remove / delete */
.pd-mdrrow:has(.pd-copy){justify-content:flex-start}
.pd-mdrrow .pd-copy{margin-left:auto;margin-right:6px}
.rm-ask:not(.f-actpop):has(.rm-b .btn-primary){border-color:var(--navy,#3A1F8F)}
.pd-mdrrow .pd-copy + .btn{margin-left:0}

/* v613–v615 (Kah Poh): Production / Equipment details edit — Save / Cancel are FLOATING buttons (.pd-float on body, bottom-right, no bar),
   always on screen while a card is in edit. In-card Save / Cancel hidden. Round fold button hidden, toast lifted while editing. */
.pd-card.on .pd-form{padding-bottom:64px}
.pd-card.on .pd-top-acts,.pd-card.on .pd-bot-acts{display:none!important}
.pd-float{position:fixed;z-index:30;font-family:var(--sans);right:16px;bottom:calc(env(safe-area-inset-bottom,0px) + 18px);display:flex;gap:10px;pointer-events:none}
.pd-float .btn{pointer-events:auto;min-height:46px;padding:0 20px;border-radius:23px;font-size:16px;box-shadow:0 6px 18px rgba(10,20,35,.32)}
.pd-float .btn-secondary{background:#fff;border:2px solid var(--steel,#2457E6)}
@media (min-width:1213px){ .pd-float{right:calc((100vw - 1180px) / 2 + 16px)} }
html:not(:has(section:not([hidden]) .pd-card.on)) .pd-float{display:none!important}
body:has(section:not([hidden]) .pd-card.on) .fold-fab{display:none!important}
body:has(section:not([hidden]) .pd-card.on) .toast{bottom:calc(env(safe-area-inset-bottom,0px) + 84px)}

/* v616 (Kah Poh, phone): Item details — the item row stays frozen while its production / equipment details are open, but UNFREEZES while an item / equipment is in Edit */
@media (max-width:820px){ body:has(section:not([hidden]) .pd-card.on) table.stack-it tr.it-frz{position:static!important;box-shadow:none!important} }

/* v618 (Kah Poh): iPhone keyboard up → floating Save / Cancel placed by page position just above the keyboard (pdFloatPos) */
.pd-float.kb{position:absolute;bottom:auto}

/* v620–v622 (Kah Poh, phone): iPhone keyboard kept covering floating buttons → phone pins the card heading (Equipment n · description · Tag no. · Qty)
   + Save / Cancel together at the TOP (.pd-pin, sticky right under the top bar). While editing, the job panel heading and the item row UNFREEZE.
   Floating buttons stay for computer only. */
@media (max-width:820px){
  .pd-float{display:none!important}
  body:has(section:not([hidden]) .pd-card.on) #main .panel > .panel-head{position:static!important}   /* v623: Project list too */
  body:has(section:not([hidden]) .pd-card.on) #main .panel table > thead th{position:static!important}
  .pd-card.on .pd-pin{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px));z-index:3;margin:-10px -12px 10px;padding:8px 10px;background:var(--surface,#fff);
    border-bottom:2px solid var(--steel,#2457E6);box-shadow:0 4px 8px -4px rgba(28,37,48,.35);border-radius:4px 4px 0 0}
  .pd-card.on .pd-pin .pd-eqh{margin:0 0 6px;padding:0 0 6px}
  .pd-card.on .pd-top-acts{display:flex!important;align-items:center;justify-content:flex-end;margin:0;padding:0}
  .pd-card.on .pd-top-acts > span:first-child{display:none}
  .pd-card.on .pd-top-acts .pd-acts{display:flex;gap:10px;flex-direction:row-reverse;flex:none;margin-top:0}
  .pd-card.on .pd-top-acts .btn{min-height:42px;padding:0 20px;font-size:16px;white-space:nowrap}
  .pd-card.on .pd-form{padding-bottom:4px}   /* v629 (Kah Poh): no empty space after the last box (v624 had 45vh) */
}

/* v639: every "while editing" rule above only counts the card on the page you are on (a hidden page can keep an old edit card) */


/* v644 (Kah Poh, computer): Save / Cancel sit where Edit was (top right of the card being edited), no floating buttons */
@media (min-width:821px){
  .pd-card.on .pd-top-acts{display:flex!important;align-items:center;justify-content:flex-end;margin:0 0 8px;padding:0}
  .pd-card.on .pd-top-acts > span:first-child{display:none}
  .pd-card.on .pd-top-acts .pd-acts{display:flex;gap:8px;flex-direction:row-reverse;margin-top:0}
  .pd-card.on .pd-form{padding-bottom:4px}
}

/* v645 TAG GROUP step 1: tag count under the Tag no. box; Qty read-only when it follows the tags */
.pd-tagcnt{display:block;font-weight:600;color:var(--ink,#1C2530)}
.inp.pd-ro{background:var(--surface-2,#EEF1F5);color:var(--ink,#1C2530);cursor:default}

/* v648 (Kah Poh, desktop): the side menu moved down 40px each time the page-name strip appeared (body.strip-on) — e.g. while editing Production / Equipment
   details the page scrolls and the strip shows. Now the menu always sticks at the strip-on spot, so the strip showing / hiding never moves it. */
@media (min-width:821px){
  nav.side, body.strip-on nav.side{top:calc(env(safe-area-inset-top,0px) + 124px);max-height:calc(100vh / var(--z,1) - env(safe-area-inset-top,0px) - 136px);transition:none}
}

/* v652: picture form — linked row typed over (FAB005a) */
.ps-ovh{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:4px}
.ps-ovh:empty{display:none}

/* v653 (Kah Poh): picture note — inside the photo, top, right of the photo number; real DOM + z-index for the PDF writer */
.ps-note{position:absolute;left:6px;top:6px;right:6px;z-index:2;background:#1C2530;color:#fff;font-size:12px;font-weight:700;line-height:1.3;padding:2px 7px;border-radius:3px;
  white-space:normal;overflow-wrap:anywhere;pointer-events:none;width:fit-content;max-width:none}
.ps-notebtn{min-height:32px}.ps-notebtn.on{background:var(--steel,#2457E6);color:#fff;border-color:var(--steel,#2457E6)}
.ps-notebtn svg{width:14px;height:14px;stroke:currentColor;fill:none;stroke-width:1.8}
.ps-notes{margin-top:10px;padding:10px;border:1px solid var(--divider);border-radius:6px;background:var(--surface-2,#EEF1F5);display:grid;gap:8px}
.ps-notes-h{font-size:13px;font-weight:600;color:var(--muted)}
.ps-nrow{display:grid;grid-template-columns:auto minmax(0,1fr);gap:8px;align-items:center}
.ps-nno{min-width:26px;text-align:center;font-weight:700;background:#3A1F8F;color:#fff;border-radius:3px;padding:2px 6px;font-size:13px}
.ps-sc1 .ps-notes{grid-column:1/-1;flex:1 1 100%;width:100%}

/* v654: picture notes in a floating box (navy frame) */
.ps-npop{width:360px;border-color:var(--navy,#3A1F8F);gap:10px;padding:10px}
.ps-npop-h{font-weight:700;display:flex;flex-direction:column;gap:2px}.ps-npop-h small{font-weight:500;color:var(--muted);font-size:12.5px}
.ps-npop-l{display:grid;gap:8px;max-height:min(52vh,420px);overflow:auto}

/* v655: note box copy-from-above button on the right */
.ps-nrow.ps-nrow3{grid-template-columns:auto minmax(0,1fr) 40px}
.ps-ncp{width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center}
.ps-ncp svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8}
.ps-ncp0{width:40px}
.ps-ncp,.ps-ncp:hover,.ps-ncp:focus,.ps-ncp:focus-visible,.ps-ncp:active{color:var(--link,#2457E6)!important;border-color:var(--steel,#2457E6)!important;background:var(--surface,#fff)!important}

/* v656 (Kah Poh, phone): sheet card buttons ran past the card → 2 rows: sizes on top (full width, evenly spread), lock · Note · ↑ ↓ ✕ below.
   Note button on phone = pencil icon + count only. Desktop: "Note · 2". */
.ps-notebtn .ps-ncnt::before{content:"· "}
@media (max-width:560px){
  .ps-rc{flex-wrap:wrap!important;justify-content:flex-start!important;row-gap:8px;max-width:100%}
  .ps-rc > .ps-seg{flex:1 1 100%!important;display:flex!important;order:0!important}
  .ps-rc > .ps-seg .ps-sb{flex:1 1 0;min-width:0}
  .ps-rc > .ps-wh{order:1}
  .ps-rc > .ps-notebtn{order:2;gap:4px;padding:0 10px}
  .ps-rc > .q8-ac{order:3;margin-left:auto!important}
  .ps-notebtn .ps-ntx{display:none}
  .ps-notebtn .ps-ncnt::before{content:""}
}

/* v657 (Kah Poh, phone): bottom row = 5 even buttons — 🔒 Ratio · ✎ Note · 1 · ↑ · ↓ · ✕ ; sizes stay full width on top. Desktop: lock icon only (v385), "Note · n". */
.ps-whx{display:none}
@media (max-width:560px){
  .ps-rc{display:grid!important;grid-template-columns:minmax(0,1.7fr) minmax(0,1.7fr) repeat(3,minmax(0,1fr));gap:8px 6px!important;width:100%}
  .ps-rc > .ps-wh{order:1!important} .ps-rc > .ps-notebtn{order:2!important} .ps-rc > .q8-ac > .icon-btn{order:3!important}
  .ps-rc > .ps-seg{grid-column:1 / -1}
  .ps-rc > .q8-ac{display:contents!important}
  .ps-rc > .ps-wh,.ps-rc > .ps-notebtn,.ps-rc > .q8-ac > .icon-btn{width:100%!important;min-width:0;height:40px!important;min-height:40px;margin:0!important;justify-content:center;display:inline-flex;align-items:center;gap:4px;box-sizing:border-box}
  /* the whole label is the button: unlocked = white with grey frame, locked = steel with white icon + text (same look as v384 lock box) */
  .ps-rc > .ps-wh{border:2px solid #8A96A3;border-radius:6px;padding:0 4px;background:#fff;color:#6B7785}
  .ps-rc > .ps-wh:has(.ps-lkin:checked){background:#2457E6;border-color:#2457E6;color:#fff}
  .ps-rc > .ps-wh .ps-lk,.ps-rc > .ps-wh .ps-lkin:checked ~ .ps-lk{width:auto;height:auto;border:0;background:transparent;color:inherit}
  .ps-whx{display:inline;font-size:13px;font-weight:700}
  .ps-rc > .ps-notebtn{padding:0 4px;font-size:13px;white-space:nowrap}
  .ps-notebtn .ps-ntx{display:inline}
  .ps-notebtn .ps-ncnt::before{content:"· "}
}
.ps-notebtn svg{flex:none;width:16px;height:16px}

/* v658 (Kah Poh): picture sheet cards fold like Equipment details — chevron + "Sheet k of n" is the toggle; folded = title row only (+ picture count);
   double-arrow on the Progress photos heading folds / unfolds all. Phone: chevron sits in the title row above the 2 button rows. */
.ps-subh{display:flex;align-items:center;gap:10px;justify-content:space-between}
.ps-sht{display:inline-flex;align-items:center;gap:8px;cursor:pointer;min-height:32px;-webkit-tap-highlight-color:transparent}
.ps-sht:focus-visible{outline:2px solid #2457E6;outline-offset:2px;border-radius:4px}
.ps-fold .pd-eqchev{transform:rotate(-90deg)}
.ps-fsum{font-size:13px;color:var(--muted);font-weight:500}
.ps-sc.ps-fold{display:block!important}
.ps-sc.ps-fold > :not(.q2-ih):not(.ps-1i){display:none!important}
.ps-sc.ps-fold .ps-rc{display:none!important}
.ps-sc.ps-fold .ps-1l > :not(.ps-sht){display:none!important}
@media (max-width:560px){ .ps-sht{flex:1 1 100%} }

/* v660 (Kah Poh, desktop): folding a sheet / any section made the page short enough that the right scroll bar came and went → page width changed
   by the scroll bar width → the centred layout (side menu too) jumped sideways. Reserve the scroll bar space always. */
html{scrollbar-gutter:stable}

/* v662: note box — picture of the box in use beside the boxes (desktop) / above them (phone) */
.ps-npop{width:640px}
.ps-npop-m{display:grid;grid-template-columns:240px minmax(0,1fr);gap:12px;align-items:start}
.ps-npv{position:relative;border:1px solid var(--divider);border-radius:6px;background:#1C2530;display:flex;align-items:center;justify-content:center;height:200px;overflow:hidden}
.ps-npv img{width:100%;height:100%;object-fit:fill;display:block}   /* v663 (Kah Poh): fill the whole box, ratio not kept */
.ps-npv-no{position:absolute;left:6px;top:6px;background:#3A1F8F;color:#fff;font-size:13px;font-weight:700;padding:2px 7px;border-radius:3px}
.ps-nrow.on .ps-nno{background:#2457E6}
@media (max-width:700px){ .ps-npop{width:360px} .ps-npop-m{grid-template-columns:1fr} .ps-npv{height:150px} }

/* v665 (Kah Poh, phone): note box = ONE photo + ONE box at a time; swipe the photo (or ‹ ›) for the next / previous photo; "2 / 6" on the photo */
.ps-npv-nav{display:none}
@media (max-width:700px){
  .ps-npop.ps-npone .ps-nrow:not(.on){display:none}
  .ps-npop.ps-npone .ps-npv{height:220px;touch-action:pan-y}
  .ps-npop.ps-npone .ps-npop-l{max-height:none;overflow:visible}
  .ps-npop.ps-npone .ps-npv-nav{display:flex;position:absolute;top:50%;transform:translateY(-50%);width:36px;height:44px;align-items:center;justify-content:center;
    background:rgba(28,37,48,.72);color:#fff;border:0;border-radius:6px;font-size:24px;font-weight:700;line-height:1;cursor:pointer}
  .ps-npop.ps-npone .ps-npv-nav:disabled{opacity:.25}
  .ps-npv-p{left:6px}.ps-npv-n{right:6px}
  .ps-npop.ps-npone .ps-npop-hint{display:block}
}
.ps-npop-hint{display:none;font-size:12.5px;color:var(--muted);text-align:center;margin-top:-4px}

/* v667 (Kah Poh, iPhone): note box while typing = compact at the very top so the typing box sits above the keyboard */
@media (max-width:700px){
  .ps-npop.kb{gap:8px;padding:8px}
  .ps-npop.kb .ps-npop-h,.ps-npop.kb .ps-npop-hint{display:none!important}
  .ps-npop.kb{overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y;-webkit-overflow-scrolling:touch}   /* v670: full-size photo; box scrolls to Save / Cancel */
  .ps-npop.kb .rm-b .btn{min-height:40px}
}

/* v668: page frozen behind the note box on phone */
@media (max-width:700px){ html.ps-lock,html.ps-lock body{overscroll-behavior:none;touch-action:none} .ps-npop{overscroll-behavior:contain;touch-action:pan-x} .ps-npop input{touch-action:auto} }
@media (max-width:700px){ .ps-npop.kb > *{flex-shrink:0} }

/* v675 (Kah Poh, phone): caption + value on ONE line for short rows (Layout buttons, linked Job No.) */
@media (max-width:820px){
  .md-row.md-inl{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}   /* no room (big text) → the value drops under the caption */
  .md-row.md-inl > .md-l{white-space:nowrap}
  .md-row.md-inl > .md-v{flex:1 1 auto;display:flex;justify-content:flex-end;text-align:right;min-width:0}
  .md-row.md-inl .ps-lay{justify-content:flex-end}
  .md-row.md-inl .ps-lb{padding:0 8px;white-space:nowrap;font-size:13px}
  .md-row.md-inl .ps-ldef{display:none}   /* phone: no room for "(default)" — shown on desktop only */
  .md-row.md-inl .ps-seg{gap:4px}
}

/* v678 (Kah Poh): Attachment heading — full words on desktop, short form on phone */
.ps-sf{display:none}
@media (max-width:820px){ .ps-subh .ps-lf{display:none} .ps-subh .ps-sf{display:inline} }
/* v679 (Kah Poh): top bar + Home banner photo slides every 3 s (header.jpg → header2 → header3). Each photo = one .hdr-sl inside .hdr-bg, behind the content. */
.topbar,.hm-hero{background-image:none}
.hm-hero{position:relative}
.hdr-bg{position:absolute;inset:0;overflow:hidden;pointer-events:none;z-index:0}
.hdr-trk{display:flex;height:100%;width:100%;transition:transform .7s ease;will-change:transform}
.hdr-trk.nt{transition:none}
.hdr-sl{flex:0 0 100%;height:100%;background-color:#2A2E33;background-size:100% 100%,108% auto;background-repeat:no-repeat;background-position:0 0,center 0}
.topbar > .topbar-in,.hm-hero > .hm-hero-in{position:relative;z-index:1}   /* v686: .page-strip left out — it must stay position:absolute (v679 made it relative → it pushed the page down 39px when it appeared = the "jump") */
@media (prefers-reduced-motion:reduce){ .hdr-trk{transition:none} }

/* v687 (Kah Poh): Production / Equipment details tick — phone label "MDR" only */
.pd-mdrs{display:none}
@media (max-width:820px){ .pd-mdr .pd-mdrf{display:none} .pd-mdr .pd-mdrs{display:inline} }

/* ---------- v688 (Kah Poh): Site photos (supervisor) ---------- */
.role-sup{background:#8A96A3;color:#1C2530}
.sp-list{display:flex;flex-direction:column;gap:10px}
.sp-job{background:var(--surface);border:1px solid var(--divider);border-radius:8px;overflow:hidden}
.sp-jh{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"t chev" "d chev" "m chev" "c chev";gap:2px 10px;width:100%;text-align:left;background:none;border:0;padding:12px 14px;cursor:pointer;color:var(--ink)}
.sp-jt{grid-area:t;font-size:15px}
.sp-jt b{font-family:var(--mono);font-weight:600}
.sp-ji{color:var(--muted)}
.sp-jd{grid-area:d;font-weight:600}
.sp-jm{grid-area:m;font-size:13px;color:var(--muted)}
.sp-jc{grid-area:c;font-size:13px;color:var(--link);font-weight:600}   /* v815 audit: --link (same steel in light, lighter in dark — was 2.8:1 on dark) */
.sp-chev{grid-area:chev;align-self:center;width:22px;height:22px;fill:none;stroke:var(--frame);stroke-width:2;stroke-linecap:round;stroke-linejoin:round;transition:transform .15s}
.sp-job.on .sp-chev{transform:rotate(180deg)}
.sp-job.on > .sp-jh{border-bottom:1px solid var(--divider);background:var(--surface-2)}
.sp-forms{border-left:4px solid var(--steel);padding:2px 0}
.sp-f{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;padding:10px 14px;border-bottom:1px solid var(--divider)}
.sp-f:last-child{border-bottom:0}
.sp-fl{flex:1 1 260px;min-width:0;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}
.sp-fi{display:flex;flex-direction:column;min-width:0;flex:1 1 180px}
.sp-fno{font-family:var(--mono);font-weight:600}
.sp-fn{font-size:13px}
.sp-fc{font-size:12.5px;color:var(--muted)}
.sp-none{font-size:13px;color:var(--muted)}
.sp-fa{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.sp-fa .btn svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.sp-rj{flex-basis:100%;color:var(--bad);font-weight:600;font-size:13px}
.sp-ur{flex-basis:100%;display:flex;gap:8px}
.sp-ur .inp{flex:1;min-width:0;font-size:16px}
@media (max-width:820px){
  .sp-f{padding:10px 12px}
  .sp-fa{flex-basis:100%;justify-content:stretch}
  .sp-fa .btn{flex:1;justify-content:center;min-height:42px}
}

/* ---------- v690 (Kah Poh): Super Admin "View as" ---------- */
.who-tip.wt-sa{min-width:200px}
.wt-as{margin-top:8px;padding-top:8px;border-top:1px solid var(--divider);display:flex;flex-direction:column;gap:4px}
.wt-ab{display:flex;align-items:center;background:none;border:2px solid transparent;border-radius:6px;padding:4px;cursor:pointer;text-align:left}
.wt-ab.on{border-color:var(--steel)}
.wt-ab .role-badge .rl{display:inline!important}
.who-btn.who-as .role-badge{box-shadow:0 0 0 3px #F2C230}
.va-bar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px;background:#F2C230;color:#1C2530;border-radius:6px;padding:8px 12px;margin:0 0 12px;font-size:14px}
.who-btn.who-sa{cursor:pointer}
/* v694: My jobs card head = stacked lines (supervisor / QC line added), chevron on the right */
.sp-jh{display:flex;flex-direction:column;align-items:flex-start;gap:2px;position:relative;padding-right:46px}
.sp-chev{position:absolute;right:14px;top:50%;transform:translateY(-50%)}
.sp-job.on .sp-chev{transform:translateY(-50%) rotate(180deg)}
.fe-fill{display:flex;gap:18px;flex-wrap:wrap;padding:4px 0}
.wt-staff{display:flex;flex-direction:column;gap:4px;padding:4px;border:2px solid transparent;border-radius:6px}
.wt-staff.on{border-color:var(--steel)}
.wt-sel{font-size:16px;padding:4px 8px;min-height:34px;width:100%}
.oc-link{font-size:16px;max-width:220px}
/* v695 (Kah Poh): View as Staff picker readable (the tip is always white, also in dark mode) */
.who-tip .wt-sel{background:#fff;color:#1C2530;border:1px solid #8A96A3;border-radius:6px}
.who-tip .wt-sel option{background:#fff;color:#1C2530}
.who-tip .wt-staff .role-badge{align-self:flex-start}
.who-tip .role-client{background:#fff;color:#1C2530;border:2px solid #1C2530}
.who-tip .role-user{background:#4A5563;color:#fff}
.who-tip .role-admin{background:#2457E6;color:#fff}
.who-tip .role-super{background:#3A1F8F;color:#fff}
/* v697 (Kah Poh): Org Chart fixed positions + Users & roles chart-entry links */
.oc-er .c-pos{display:flex;flex-direction:column;gap:4px;min-width:0}
.oc-er .c-pos .oc-fn{font-size:13px}
.oc-er .c-pos.oc-fixed .oc-fn{font-weight:600;color:var(--link)}
.oc-links{display:flex;flex-direction:column;gap:6px;min-width:0}
.oc-chip{display:flex;align-items:center;gap:6px;justify-content:space-between;border:1px solid var(--frame);border-radius:6px;padding:3px 4px 3px 8px;background:var(--surface);color:var(--ink);font-size:13px;line-height:1.3}
.oc-chip > span{min-width:0;overflow-wrap:anywhere}
.oc-chip .oc-chx{flex:none;width:28px;height:28px;min-height:28px}
@media (max-width:820px){ .oc-er .c-pos .oc-fn{font-size:16px} }

/* v699 (Kah Poh, desktop): the menu row now reaches the page end (bottom space moved from .shell into #main) so the sticky menu is never pulled up at the end */
@media (min-width:821px){ .shell{padding-bottom:0} #main{padding-bottom:60px} }

/* v700 (Kah Poh): Phone view (desktop, Super Admin) */
.phv-btn{display:inline-flex;align-items:center;justify-content:center;min-width:40px;min-height:36px;border:1px solid rgba(255,255,255,.55);border-radius:5px;background:rgba(12,14,16,.38);color:#fff;cursor:pointer;margin-left:6px}
.phv-btn svg{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:1.8}
.phv-btn.on{background:#fff;color:var(--navy)}
.phv-btn[hidden]{display:none}
.phv-ov{position:fixed;top:72px;right:16px;bottom:16px;z-index:60;width:406px;display:flex;flex-direction:column;background:var(--navy);border-radius:18px;padding:6px 8px 8px;box-shadow:0 8px 40px rgba(10,20,35,.45)}
.phv-bar{display:flex;align-items:center;gap:8px;color:#fff;padding:2px 4px 6px;font-size:13px}
.phv-bar .phv-w{color:#C9D3DE;font-size:12px}.phv-bar .phv-sp{flex:1}
.phv-ib{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border:0;border-radius:6px;background:rgba(255,255,255,.14);color:#fff;font-size:16px;cursor:pointer}
.phv-ib svg{width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2}
.phv-frame{flex:1;width:390px;border:0;border-radius:12px;background:#fff}
@media (max-width:820px){ .phv-btn,.phv-ov{display:none!important} }
@media (min-width:821px){ body.phv-open .shell{max-width:none;margin:0 438px 0 0} }   /* desktop page moves left of the phone frame */

/* v702 (Kah Poh): Clients › Production details — Equipment caption boxes */
.pds-eqg{display:grid;grid-template-columns:repeat(2,minmax(0,220px));gap:8px 12px;margin-top:6px}
.pds-eqg label{display:flex;flex-direction:column;gap:3px;font-size:12px;color:var(--muted);font-weight:600}
.pds-eqg .inp{font-size:16px}
.pds-eqx{font-size:12.5px;margin-top:6px}
@media (max-width:560px){ .pds-eqg{grid-template-columns:1fr 1fr} }

/* v708 (Kah Poh): Projects › Job forms */
.jf-ch{font-family:var(--cond);font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:8px 2px -2px}
.jf-ch:first-child{margin-top:0}

/* v709 (Kah Poh): Job forms — job line in one row (Job No. · PO · Client, wraps); form rows with a bigger title, less empty space */
.jf-jl{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 0;font-size:15px;line-height:1.35}
.jf-jl > *,.jf-fm > *{white-space:nowrap}
.jf-jl > .jf-cl{white-space:normal}
.jf-jl > *:not(:last-child)::after,.jf-fm > *:not(:last-child)::after{content:"·";margin:0 8px;color:var(--frame);font-weight:800;font-size:1.3em;line-height:0}
.jf-fm{display:flex;flex-wrap:wrap}
.jf-jn{font-family:var(--mono);font-weight:600}
.jf-po{font-weight:600}
.jf-cl{color:var(--ink)}
.jf-f{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px 16px;padding:12px 14px;border-bottom:1px solid var(--divider)}
.jf-f:last-child{border-bottom:0}
.jf-fi{min-width:0;display:flex;flex-direction:column;gap:3px}
.jf-ft{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 10px;font-size:16px;line-height:1.3}
.jf-fno{font-family:var(--mono);font-weight:700;color:var(--navy)}
.jf-fn{font-weight:600;color:var(--ink)}
.jf-fm{font-size:13.5px;color:var(--muted)}
.jf-fa{display:flex;gap:8px}
.jf-fa .btn{min-width:84px;justify-content:center}
:root[data-theme="dark"] .jf-fno{color:#7FB0EA}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .jf-fno{color:#7FB0EA} }
@media (max-width:820px){ .jf-f{grid-template-columns:1fr;padding:12px} .jf-fa .btn{flex:1;min-height:42px} }

/* v712 (Kah Poh): Supplier › 3rd Party Inspector */
.tpi-nm{font-size:16px;font-weight:700;color:var(--ink)}
.tpi-exp{margin-top:4px}
.tpi-b{border-left:4px solid var(--steel);padding:12px 14px;display:flex;flex-direction:column;gap:14px}
.tpi-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 18px}
.tpi-kv{display:grid;grid-template-columns:80px minmax(0,1fr);gap:8px;font-size:14px}
.tpi-kv .k{color:var(--muted);font-size:13px}
.tpi-kv span:last-child,.tpi-kv a{white-space:pre-line;overflow-wrap:anywhere}
.tpi-sh{font-family:var(--cond);font-weight:700;font-size:13px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted);margin:0 0 6px}
.tpi-ct{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:14px;padding:4px 0}
.tpi-kh{font-size:13px;font-weight:700;color:var(--navy);margin:8px 0 4px}
:root[data-theme="dark"] .tpi-kh{color:#7FB0EA}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .tpi-kh{color:#7FB0EA} }
.tpi-doc{display:flex;align-items:center;gap:12px;padding:8px 10px;border:1px solid var(--divider);border-radius:8px;margin-bottom:6px;color:var(--ink);text-decoration:none;background:var(--surface)}
@media (hover:hover){ .tpi-doc:hover{border-color:var(--steel)} }
.tpi-dt{flex:none;width:38px;height:38px;border-radius:6px;background:var(--navy);color:#fff;font:700 11px var(--cond);display:flex;align-items:center;justify-content:center;text-decoration:none}
.tpi-di{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.tpi-di b{font-size:15px;overflow-wrap:anywhere}
.tpi-dm{display:flex;flex-wrap:wrap;font-size:13px;color:var(--muted)}
.tpi-dm > *{white-space:nowrap}
.tpi-dm > *:not(:last-child)::after{content:"·";margin:0 8px;color:var(--frame);font-weight:800;font-size:1.3em;line-height:0}
.tpi-acts{display:flex;gap:8px;justify-content:flex-end}
.tpi-cr{display:grid;grid-template-columns:1.3fr 1fr 1fr 1.3fr 36px;gap:6px;margin-bottom:6px;align-items:center}
.tpi-dr{display:grid;grid-template-columns:38px minmax(0,1fr) 36px;gap:10px;align-items:start;padding:8px 0;border-bottom:1px solid var(--divider)}
.tpi-dg{display:grid;grid-template-columns:2fr 1.2fr 1fr 1fr 1fr;gap:6px}
.tpi-cr .inp,.tpi-dg .inp{font-size:16px;min-width:0}
@media (max-width:820px){
  .tpi-grid{grid-template-columns:1fr}
  .tpi-cr{grid-template-columns:1fr 1fr 36px}
  .tpi-cr > .icon-btn{grid-row:1 / span 2;grid-column:3}
  .tpi-dg{grid-template-columns:1fr 1fr}
  .tpi-dg > :first-child{grid-column:1 / -1}
  .tpi-acts .btn{flex:1;justify-content:center;min-height:42px}
}
#tpiEditor textarea{font-family:var(--sans);font-size:16px}
.tpi-kv a,.tpi-ct a{color:var(--link)}

/* v713: document viewer inside the portal */
button.tpi-doc{width:100%;text-align:left;font:inherit;cursor:pointer}
button.tpi-dt{border:0;cursor:pointer}
.tpi-ov{position:fixed;inset:0;z-index:300;background:#1C2530;display:flex;flex-direction:column}
.tpi-vbar{display:flex;align-items:center;gap:10px;padding:calc(env(safe-area-inset-top,0px) + 10px) 14px 10px;background:var(--navy);color:#fff}
.tpi-vt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:15px}
.tpi-vx{color:#fff;background:rgba(255,255,255,.14)}
.tpi-vp{flex:1;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;padding:14px;display:flex;flex-direction:column;align-items:center;gap:6px}
.tpi-pg{display:block;width:100%;max-width:900px;height:auto;background:#fff;box-shadow:0 2px 12px rgba(0,0,0,.4)}
.tpi-pn{color:#C9D3DE;font-size:12px;margin-bottom:10px}
.tpi-vl{color:#fff;background:var(--surface);color:var(--ink);padding:16px;border-radius:8px;margin-top:20px}
html.tpi-lock,html.tpi-lock body{overflow:hidden}
.tpi-vs{background:#fff;color:var(--navy);border-color:#fff}
button.cr-file{font:inherit;cursor:pointer;text-align:left}
/* v716: rail tooltip (menu hidden) */
.rail-tip{position:fixed;z-index:80;background:var(--navy);color:#fff;font:600 13px var(--sans);padding:6px 10px;border-radius:6px;white-space:nowrap;pointer-events:none;box-shadow:0 4px 14px rgba(10,20,35,.3)}
.rail-tip::before{content:"";position:absolute;left:-5px;top:50%;margin-top:-5px;border:5px solid transparent;border-left:0;border-right-color:var(--navy)}
.rail-tip[hidden]{display:none}
/* v717 ED006 Heavy Lifting Procedure — editor + A4 sheets (Times, like Kah Poh's PDF) */
.e6-u{display:flex;align-items:center;gap:8px}.e6-u .inp{max-width:160px}.e6-ut{color:var(--muted);font-size:14px;white-space:nowrap}
.e6-calc{font-variant-numeric:tabular-nums;background:var(--surface-2,rgba(127,127,127,.08));border-radius:6px;padding:4px 8px;display:inline-block}
.e6-calc.e6-ok{color:#fff;background:#1d5fd1;font-weight:700}.e6-calc.e6-bad{color:#fff;background:#c62828;font-weight:700}
.e6-fix{margin:4px 0 0}
.e6-at{border-collapse:collapse;font-size:14px}.e6-at th,.e6-at td{border:1px solid var(--divider);padding:3px 10px;text-align:center}.e6-at tr.e6-on td{background:rgba(29,95,209,.14);font-weight:700}
.e6-cbar{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.e6-chart{display:flex;flex-wrap:wrap;gap:10px;margin-top:10px}.e6-cp{display:flex;align-items:flex-start;gap:2px}
.e6-ct{border:1px solid var(--divider);border-radius:6px;padding:0;background:#fff;cursor:pointer;position:relative;width:74px;height:96px;overflow:hidden}
.e6-ct img{width:100%;height:100%;object-fit:contain;display:block}.e6-ct span{position:absolute;left:3px;bottom:3px;background:rgba(0,0,0,.6);color:#fff;font-size:11px;padding:0 4px;border-radius:3px}
.e6-sgr{display:grid;grid-template-columns:130px 1fr;gap:6px 12px;align-items:start;margin:8px 0}.e6-sgl{font-weight:600;padding-top:8px}
.e6-sgf{display:grid;grid-template-columns:1fr 1fr;gap:6px}.e6-sgf .md-date{grid-column:1/-1}
@media (max-width:640px){.e6-sgr{grid-template-columns:1fr}.e6-sgl{padding-top:0}.e6-sgf{grid-template-columns:1fr}}
.qc-sheet.e6-sheet{padding:34px 40px 28px;font-size:14px;line-height:1.28}
.e6-hd{display:flex;justify-content:space-between;align-items:flex-end}
.e6-hl img{height:58px;display:block;margin-bottom:2px}.e6-co{font-weight:700;font-size:13px}
.e6-hr{text-align:right;display:flex;flex-direction:column;align-items:flex-end}.e6-hr img{height:46px;max-width:150px;object-fit:contain;display:block;margin-bottom:2px}.e6-no{font-size:13px}
.e6-ti{text-align:center;font-weight:700;font-size:20px;margin:2px 0 12px}
.qc-sheet > .e6-bd{flex:1 1 auto;min-height:0;overflow:hidden}
.e6-ft{text-align:center;font-size:13px;padding-top:6px}
.e6-h{font-weight:700;margin:9px 0 4px}
.e6-info{margin-bottom:4px}.e6-kv{display:grid;grid-template-columns:150px 1fr;gap:8px;margin:1px 0}.e6-kk{white-space:nowrap}
.e6-kv3{grid-template-columns:150px 170px 1fr auto}
.e6-pi{display:grid;grid-template-columns:20px 1fr;margin:2px 0 3px}.e6-pp{margin-top:1px}.e6-ps{margin:1px 0 0 18px}.e6-psi{display:grid;grid-template-columns:18px 1fr}
.e6-gd{display:grid;grid-template-columns:150px 1fr;gap:6px;margin:2px 0 2px 18px}.e6-gv{background:#c6d9f1;padding:0 6px;min-height:18px}
.e6-l{display:grid;grid-template-columns:1fr 150px;column-gap:10px;align-items:end;margin:3px 0 3px 18px}
.e6-l.i1{margin-left:36px}.e6-l.i2{margin-left:54px}.e6-l.i3{margin-left:72px}.e6-l.sp{margin-top:9px;margin-bottom:9px}
.e6-l > .e6-lk:only-child{grid-column:1/-1}
.e6-note{grid-column:1/2;font-size:13px;padding-left:12px}
.e6-rn,.e6-rn2{grid-column:2/3;text-align:center;font-size:12.5px;font-style:italic;line-height:1.1}
.e6-okr{grid-column:2/3;text-align:center}
.e6-v{display:flex;justify-content:center;gap:4px;border-bottom:1px solid #000;min-height:18px;padding:0 4px;white-space:nowrap}
.e6-v.b{background:#c6d9f1}.e6-v.c .e6-vv{color:#1a3ec8}.e6-v.w{white-space:normal;text-align:center}
.e6-l:has(.e6-v.w){grid-template-columns:1fr 230px}
.e6-v.k{justify-content:flex-start}.e6-v.k .e6-vv{flex:1;text-align:center}.e6-v.k .e6-vu{width:34px}
.e6-v.s{min-width:96px}
.e6-pos{display:flex;gap:46px;margin:2px 0 4px 72px}.e6-po{display:flex;align-items:center;gap:8px}
.e6-tk{display:inline-flex;width:56px;height:17px;border:1px solid #000;align-items:center;justify-content:center;font-size:13px;line-height:1}
.e6-sh{font-weight:700;text-decoration:underline;margin:6px 0 2px 18px}.e6-sh2{font-weight:700;margin:6px 0 2px 18px}
.e6-tks{display:grid;grid-template-columns:1fr 1fr;gap:0 30px;margin:0 0 3px 72px}.e6-tc .e6-tr{display:grid;grid-template-columns:1fr 64px;align-items:center;margin:1px 0}
.e6-tks:has(> :only-child){grid-template-columns:1fr 1fr}
.e6-two{display:grid;grid-template-columns:1fr 1fr;gap:20px}.e6-two .e6-l{margin-left:0}.e6-two .e6-l{grid-template-columns:1fr 100px}
.e6-atw{display:grid;grid-template-columns:200px 1fr;align-items:start;margin:2px 0 3px 54px}.e6-atl{padding-top:20px}
.e6-atb{border-collapse:collapse;font-size:13.5px}.e6-atb th{font-weight:400;padding:0 8px}
.e6-atb td{border:1px solid #000;padding:0 10px;text-align:center;min-width:70px}.e6-atb td.e6-mn{border:0;text-align:right;min-width:0;padding-right:4px}.e6-atb td.e6-ck{border:0;min-width:24px}
.e6-atb tr.on td:not(.e6-mn):not(.e6-ck){background:#c6d9f1}
.e6-tx{margin:1px 0 1px 36px}.e6-tx.i1{margin-left:36px}.e6-it{font-style:italic;font-size:13px;color:#1a3ec8}.e6-desc{white-space:pre-wrap}
.e6-shk{display:flex;align-items:end;gap:10px;margin:3px 0 1px 18px}.e6-shk .e6-v{min-width:70px}
.e6-frac{display:flex;align-items:center;gap:12px;margin:2px 0 0 70px}.e6-fr{display:flex;flex-direction:column;align-items:center;min-width:140px}
.e6-fn{border-bottom:1px solid #000;width:100%;text-align:center}.e6-fn.c,.e6-fd.c{color:#1a3ec8}
.e6-frac2{display:flex;gap:12px;align-items:end;margin:2px 0 0 296px}.e6-pc{border-bottom:1px solid #000;min-width:80px;text-align:center}
.e6-cu{display:grid;grid-template-columns:1fr 150px;column-gap:10px;margin:2px 0 6px 54px}.e6-cu > div{display:grid;grid-template-columns:200px 60px 20px;align-items:end;grid-column:1}
.e6-cu .e6-uv{border-bottom:1px solid #000;text-align:center}.e6-cu > .e6-okb{grid-column:2;grid-row:2;align-self:end}
.e6-okb{display:block;background:#0b1fe0;color:#fff;font-weight:700;text-align:center;min-height:18px}.e6-okb.bad{background:#c62828}.e6-okb.e6-okn{background:transparent}
.e6-wal{float:right;padding-right:6px;font-style:italic}
.e6-ks{margin:0 0 2px 54px}.e6-ks > div{display:grid;grid-template-columns:330px 110px;align-items:end;margin:1px 0}.e6-ks .e6-v{justify-content:center}
.e6-lh{margin:8px 0 2px 18px}.e6-li{display:grid;grid-template-columns:34px 1fr;margin:1px 0 2px 36px}.e6-lkk{white-space:nowrap}
.e6-sghd{display:grid;grid-template-columns:1fr 170px 120px;gap:30px;margin:10px 0 18px}.e6-sghd span{text-align:center}
.e6-sgrow{display:grid;grid-template-columns:1fr 170px 120px;gap:30px;align-items:end;margin:0 0 30px 4px;min-height:34px}
.e6-sgnm{font-size:13px;margin-top:2px;padding-left:16px}.e6-sgs{border-bottom:1px solid #000;height:20px}.e6-sgd{border-bottom:1px solid #000;height:20px;text-align:center}
.e6-sgk{margin:0 0 12px}
.qc-sheet .e6-atb th{text-transform:none;color:#000;letter-spacing:0;font-size:13.5px;border:0;background:none;padding:0 8px;height:auto;line-height:1.3}
.qc-sheet .e6-atb td{height:auto;line-height:1.3}
.e6-two.i2{margin-left:72px}
.e6-sheet .e6-tk{height:16px}.e6-tc .e6-tr{margin:0}
.e6-lw{display:inline-block;background:#F2C230;color:#1C2530;font-weight:700;font-size:14px;padding:3px 8px;border-radius:6px;white-space:nowrap}.e6-lw[hidden]{display:none}
.e6-u{flex-wrap:wrap}
.e6-wr{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.e6-at+.e6-lw,div > .e6-lw:first-child{margin-bottom:6px}
/* v720 ED006 form screen: collapsible sections + number levels */
.e6-all{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:4px 0 10px}
.e6-sec{border:1px solid var(--divider);border-radius:10px;margin:0 0 10px;overflow:hidden}
.e6-sech{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%;padding:12px 14px;background:#3A1F8F;color:#fff;border:0;cursor:pointer;font:inherit;font-weight:700;font-size:15px;text-align:left;min-height:46px}
.e6-sech .e6-chev{flex:none;transition:transform .15s}.e6-sech[aria-expanded="false"] .e6-chev{transform:rotate(-90deg)}
.e6-sb{padding:6px 14px 12px}.e6-sb[hidden]{display:none}
.e6-hrow{font-weight:700;margin:14px 0 2px;padding-bottom:4px;border-bottom:1px solid var(--divider)}
.e6-sub{font-weight:700;text-decoration:underline;margin:14px 0 2px;color:#3A1F8F}
:root[data-theme="dark"] .e6-sub{color:#9cc0ec}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .e6-sub{color:#9cc0ec}}
.e6-sb .md-row.e6-lv1,.e6-hrow.e6-lv1,.e6-fix.e6-lv1{margin-left:22px}
.e6-sb .md-row.e6-lv2,.e6-hrow.e6-lv2,.e6-fix.e6-lv2{margin-left:44px}
.e6-fix.e6-lv3{margin-left:66px}
.e6-sb .md-row.e6-lv1{border-left:3px solid #D5DBE1;padding-left:10px}.e6-sb .md-row.e6-lv2{border-left:3px solid #8A96A3;padding-left:10px}
.e6-fix{margin-top:2px}
@media (max-width:640px){.e6-sb{padding:4px 10px 10px}.e6-sb .md-row.e6-lv1,.e6-hrow.e6-lv1,.e6-fix.e6-lv1{margin-left:10px}.e6-sb .md-row.e6-lv2,.e6-hrow.e6-lv2,.e6-fix.e6-lv2{margin-left:20px}.e6-fix.e6-lv3{margin-left:30px}}
/* G / H sheets */
.e6-gw{margin:4px 0 8px 18px}.e6-gt{font-weight:400;margin-bottom:4px}
.e6-gw{display:grid;grid-template-columns:90px 1fr 1fr;gap:0 18px}.e6-gt{grid-row:1}
.e6-gi{display:grid;grid-template-columns:22px 1fr;margin:1px 0}
.e6-hi{display:grid;grid-template-columns:1fr 90px;margin:1px 0;gap:8px}.e6-hv{text-align:center;border-bottom:1px solid #000}
.qc-sheet .e6-sk{flex:1 1 auto;min-height:600px;border:1px solid #000;margin-top:6px}
.e6-bd:has(.e6-sk){display:flex;flex-direction:column}
.e6-sech .e6-chev{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2}.e6-sech .e6-st{flex:1}
.e6-sb .md-l{text-transform:none;letter-spacing:0;font-size:14.5px}
.e6-sb textarea.inp{font-family:inherit}@media (max-width:640px){.e6-at th,.e6-at td{padding:3px 5px}}
/* v721 ED006: buttons on the panel heading · wrapped label lines start under the text */
.panel-head.e6-ph{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.e6-ph .e6-all{margin:0;flex-wrap:nowrap}
.e6-nl{display:inline-grid;grid-template-columns:auto 1fr;column-gap:.35em;align-items:start}
.e6-hrow .e6-nl{display:grid}
/* v725 ED006: policy pop-up, sketch, sling size row */
.e6-ov{position:fixed;inset:0;z-index:300;background:rgba(28,37,48,.55);display:flex;align-items:center;justify-content:center;padding:16px}
.e6-box{background:var(--surface,#fff);color:var(--ink,#1C2530);border-radius:12px;max-width:760px;width:100%;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 10px 40px rgba(0,0,0,.35)}
.e6-boxh{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:12px 16px;border-bottom:1px solid var(--divider)}.e6-boxh b{font-size:17px}
.e6-pol{overflow:auto;padding:12px 16px 18px;font-size:15px;line-height:1.5}.e6-pol .e6-pi{grid-template-columns:24px 1fr;margin:0 0 10px}.e6-pol .e6-psi{grid-template-columns:22px 1fr;margin-top:3px}
.e6-skt{width:120px;height:90px}
.qc-sheet .e6-sk.on{display:flex;align-items:center;justify-content:center;padding:4px;overflow:hidden}.qc-sheet .e6-sk.on img{max-width:100%;max-height:100%;object-fit:contain;display:block}
.e6-dl{display:flex;flex-wrap:wrap;gap:10px 22px}.e6-dl > div{display:flex;align-items:center;gap:10px}.e6-dlk{font-size:14px;font-weight:600;white-space:nowrap;min-width:84px}
.e6-dl .e6-u .inp{max-width:120px}
.e6-two.i1{margin-left:36px}
.qc-sheet .e6-sk.on{position:relative;display:block;padding:0;overflow:hidden}.qc-sheet .e6-sk.on img{position:absolute;left:4px;top:4px;width:calc(100% - 8px);height:calc(100% - 8px);object-fit:contain;max-width:none;max-height:none;display:block}   /* v726: px size set by e6Sk (ratio kept) */
/* v728 ED006 phone: number box on the caption's row */
@media (max-width:820px){
 .e6-sb .md-row.e6-inl{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 10px}
 .e6-sb .md-row.e6-inl > .md-c{display:none}
 .e6-sb .md-row.e6-inl > .md-v{justify-self:end}
 .e6-sb .md-row.e6-inl .e6-u{flex-wrap:nowrap;gap:6px}
 .e6-sb .md-row.e6-inl .e6-u .inp,.e6-sb .md-row.e6-inl input.e6-num{width:100px;max-width:100px}
 .e6-sb .md-row.e6-inl .e6-ut{min-width:30px}
 .e6-sb .md-row.e6-inl .md-hint{max-width:150px;text-align:right}
 .e6-sb .md-row.e6-inl .e6-lw{white-space:normal;font-size:12.5px}
}
@media (max-width:820px){ .e6-sb .md-row.e6-inl > .md-v{text-align:right} .e6-sb .md-row.e6-inl .e6-wr{justify-content:flex-end} }
/* v730 (Kah Poh): phone number box just wide enough for 9999.9 */
@media (max-width:820px){ .e6-sb .md-row.e6-inl .e6-u .inp,.e6-sb .md-row.e6-inl input.e6-num{width:78px;max-width:78px;min-width:0;padding-left:8px;padding-right:8px;text-align:right} }
/* v731 ED006: row notes on their own line · number boxes line up */
.e6-sb .md-row > .md-hint.e6-rh{grid-column:3;margin-top:2px}
@media (max-width:820px){
 .e6-sb .md-row.e6-inl > .md-hint.e6-rh{grid-column:1/-1;max-width:none;text-align:left;margin-top:0;line-height:1.35}
 .e6-sb .md-row.e6-inl .e6-ut{min-width:34px;text-align:left}
}
/* v732 ED006: caption note (under the caption) + value note (under the box), like the PDF */
.e6-cn{display:block;font-size:12.5px;font-weight:400;color:var(--muted);line-height:1.35;margin-top:2px}
.e6-vn{font-size:12.5px;color:var(--muted);line-height:1.3;margin-top:2px}
.e6-sb .md-row > .e6-n2:empty{display:none}
.e6-sb .md-row > .e6-cn.e6-n2{grid-column:1;margin-top:0}
.e6-sb .md-row > .e6-vn.e6-n2{grid-column:3;margin-top:0}
@media (max-width:820px){
 /* phone: value note right under the box (own line, doesn't widen the box column), then the caption note on its own full line */
 .e6-sb .md-row.e6-inl > .e6-vn.e6-n2{grid-column:1/-1;grid-row:2;justify-self:end;text-align:right;padding-right:40px}
 .e6-sb .md-row.e6-inl > .e6-cn.e6-n2{grid-column:1/-1;grid-row:3}
 .e6-sb .md-row.e6-inl > .e6-vn.e6-n2:empty + *{grid-row:2}
}
/* v733 ED006: short lists (load position, sling angle) as wide as box + unit, lined up with the number boxes */
.e6-sb select.e6-ssel{width:160px;max-width:160px}
@media (max-width:820px){ .e6-sb .md-row.e6-inl select.e6-ssel{width:118px;max-width:118px;padding-left:8px;padding-right:26px;text-align:right;text-align-last:right} }
/* v734 ED006 phone: hanging indent — box / list / text / notes start after the caption number */
.e6-ot{color:var(--muted);font-weight:500}
@media (max-width:820px){
 .e6-sb .md-row:not(.e6-inl) > .md-v{margin-left:var(--ni,0px)}
 .e6-sb .md-row > .md-hint.e6-rh,.e6-sb .md-row > .e6-cn.e6-n2{margin-left:var(--ni,0px)}
 .e6-dl{flex-direction:column;gap:8px;width:100%}
 .e6-dl > div{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:10px;width:100%}
 .e6-dl .e6-dlk{font-weight:600;min-width:0}
 .e6-dl .e6-u{flex-wrap:nowrap;gap:6px}
 .e6-dl .e6-u .inp{width:78px;max-width:78px;padding-left:8px;padding-right:8px;text-align:right}
 .e6-dl .e6-ut{min-width:34px}
}
/* v739 ED006 phone: Auto fold tick on the panel heading */
.e6-af{display:inline-flex;align-items:center;gap:6px;font-size:14px;font-weight:600;color:var(--ink);padding:4px 6px;cursor:pointer;white-space:nowrap}
.e6-af input{width:20px;height:20px;margin:0;accent-color:#3A1F8F}
.e6-ph .e6-all{flex-wrap:wrap}
/* v740 ED006: L. Lift Procedures pop-up */
.e6-pol .e6-pg{margin:0 0 14px}.e6-pol .e6-pgt{font-weight:700;margin:0 0 6px}.e6-pg .e6-pi{grid-template-columns:34px 1fr;margin:0 0 6px}.e6-pg .e6-pi b{font-weight:600}
/* v743 Login log */
.ll-tools{margin:0 0 12px}
.ll-row{display:flex;flex-wrap:wrap;align-items:end;gap:10px 16px}
.ll-u select{min-width:220px}
.ll-q{display:flex;flex-wrap:wrap;gap:6px}
.ll-d{display:flex;gap:10px;flex-wrap:wrap}.ll-dt{display:flex;flex-direction:column;gap:2px;font-size:13px;color:var(--muted);font-weight:600}.ll-dt .inp{width:140px}
table.ll-tb{width:100%;border-collapse:collapse}
table.ll-tb th{text-align:left;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);padding:6px 8px;border-bottom:2px solid var(--divider)}
table.ll-tb td{padding:9px 8px;border-bottom:1px solid var(--divider);vertical-align:top;font-variant-numeric:tabular-nums}
.ll-sub{font-size:12.5px;color:var(--muted)}
.ll-b{display:inline-block;padding:3px 9px;border-radius:6px;font-weight:700;font-size:13px;color:#fff;white-space:nowrap}
.ll-b.ll-on{background:#1F6FB2}.ll-b.ll-out{background:#3A1F8F}.ll-b.ll-to{background:#6B7785}.ll-b.ll-rv{background:#C62828}
@media (max-width:820px){
 .ll-u,.ll-u select{width:100%;min-width:0}
 table.ll-tb thead{display:none} table.ll-tb,table.ll-tb tbody{display:block}
 table.ll-tb tr{display:grid;grid-template-columns:1fr 1fr;gap:6px 12px;padding:12px 0;border-bottom:1px solid var(--divider)}
 table.ll-tb td{display:block;padding:0;border:0}
 table.ll-tb td::before{content:attr(data-l);display:block;font-size:12px;font-weight:600;color:var(--muted)}
 table.ll-tb td.ll-c-u{grid-column:1/-1}table.ll-tb td.ll-c-u::before{display:none}
}
/* v744 Staff home: My jobs tiles */
.hm-jobs{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;margin:0 0 12px}
.hm-job{display:flex;flex-direction:column;align-items:flex-start;gap:3px;text-align:left;padding:14px 14px 12px;border:1px solid var(--divider);border-left:5px solid #3A1F8F;border-radius:10px;background:var(--surface);color:var(--ink);cursor:pointer;font:inherit;min-height:112px}
.hm-job:focus-visible{border-color:#2457E6;box-shadow:0 2px 10px rgba(31,58,95,.15)} @media (hover:hover){ .hm-job:hover{border-color:#2457E6;box-shadow:0 2px 10px rgba(31,58,95,.15)} }   /* v761: hover only with a mouse (no stuck highlight after a tap on iPhone) */
.hm-jn{font-family:var(--mono,ui-monospace,monospace);font-weight:700;font-size:18px;letter-spacing:.02em}
.hm-jpo{font-size:14px;font-weight:600;color:var(--ink)}
.hm-jc{font-size:14px;font-weight:700;color:#2457E6}
.hm-jf{font-size:12.5px;color:var(--muted);margin-top:auto}
.hm-how{display:inline-flex;align-items:center;gap:8px;font-weight:600;color:var(--link,#2457E6);text-decoration:none;font-size:14px}.hm-how svg{width:20px;height:20px}
@media (max-width:560px){ .hm-jobs{grid-template-columns:1fr 1fr;gap:10px} .hm-job{min-height:104px;padding:12px} .hm-jn{font-size:17px} }
.hm-how svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linejoin:round}
/* v745 My jobs: job tiles → one job page (big, simple for site people) */
.sp-top{margin:0 0 12px}.sp-bot{margin:14px 0 0}
.sp-back{min-height:46px;font-size:16px;font-weight:700;padding:0 18px}.sp-back svg{width:20px;height:20px}
.sp-jhd{border-left:6px solid #3A1F8F}
.sp-jhn{font-family:var(--mono);font-weight:700;font-size:24px;letter-spacing:.02em}
.sp-jhc{font-weight:700;font-size:16px;color:#2457E6;margin-top:2px}
.sp-jhm{font-size:14px;color:var(--muted);margin-top:2px}
.sp-prog{display:flex;flex-wrap:wrap;gap:6px;margin-top:10px}
.sp-pb{display:inline-block;padding:4px 10px;border-radius:6px;font-weight:700;font-size:13.5px;color:#fff}
.sp-pb.sp-p0{background:#6B7785}.sp-pb.sp-p1{background:#F2C230;color:#1C2530}.sp-pb.sp-p2{background:#1F6FB2}
.sp-item{margin-top:12px}
.sp-ih{padding:12px 16px;border-bottom:1px solid var(--divider);background:var(--surface-2)}
.sp-it{font-weight:700;font-size:16px}.sp-im{font-size:13.5px;color:var(--muted);margin-top:2px}
.sp-big .sp-f{padding:14px 16px;gap:10px 14px}
.sp-big .sp-fno{font-size:16px}.sp-big .sp-fn{font-size:15.5px;font-weight:600}
.sp-big .sp-fa .btn{min-height:44px;font-size:15px;padding:0 16px}
@media (max-width:820px){ .sp-big .sp-fa{flex-basis:100%} .sp-big .sp-fa .btn{flex:1 1 auto;justify-content:center} .sp-back{width:100%;justify-content:center} }
.sp-big .sp-fa .btn.btn-sm{min-height:44px;font-size:15px}
/* v746 My jobs form card: badge on the form no. row (right) */
.sp-fi{flex:1 1 auto;min-width:0}
.sp-ftop{display:flex;align-items:center;justify-content:space-between;gap:10px;width:100%}
.sp-ftop .status,.sp-ftop .sp-none{flex:none}
.sp-fl{flex:1 1 260px}
/* v747 photo viewer: Heat No. bar above the photo (not over it) */
.pv-hbar{flex:none;display:flex;justify-content:center;padding:0 14px 6px;position:relative;z-index:3}
.pv-hbar:has(> .pv-heat[hidden]){display:none}
.pv-hbar .pv-heat{box-shadow:none;padding:6px 14px}
@media (max-width:560px){ .pv-hbar .pv-heat b{font-size:20px} }
/* v748b (Kah Poh): back to the previous TOC row layout — only the PDF preview button is wider (height kept) */
@media (max-width:560px){ .md-toc .md-tr.md-2l > .md-pvw .md-pv{width:42px;height:28px} }
/* v749 phone: short read-only form header values next to the caption */
@media (max-width:820px){
  .md-row.fk-inl,.md-row.md-inl.fk-inl{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:baseline;gap:4px 12px}
  .md-row.fk-inl > .md-v{display:block;justify-content:flex-start;text-align:left}
  .md-row.fk-inl > .md-l{font-size:13px}
  .md-row.fk-inl > .md-v{min-width:0}
}

/* v750 (Kah Poh): QC022 Date — on phone the caption, a smaller date box and Today sit in one row */
@media (max-width:820px){ .md-row.q22-drow{grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:4px 12px}
  .md-row.q22-drow > .md-v{display:flex;justify-content:flex-start}
  .md-row.q22-drow .md-date{flex-wrap:wrap;justify-content:flex-start;gap:6px}
  .md-row.q22-drow .md-date .inp.md-dt{flex:0 0 auto;width:calc(10ch + 28px);max-width:none!important;padding-left:10px;padding-right:10px}
  .md-row.q22-drow .md-date .btn{flex:none;padding-left:12px;padding-right:12px}
  .md-row.q22-drow .md-err{text-align:left} }

/* v757 (Kah Poh): picture no. on sheet-card thumbnails (same look as .ps-ntag on the sheet) */
.q8-th .ps-tno{position:absolute;left:3px;top:3px;z-index:2;background:#3A1F8F;color:#fff;font-size:12px;font-weight:700;line-height:1.2;min-width:18px;text-align:center;padding:1px 5px;border-radius:3px;pointer-events:none;box-shadow:0 0 0 1px #fff}

/* v760 (Kah Poh): MDR Cover details on phone — read-only values beside the caption (below only when too long); date box small, same row as the caption */
@media (max-width:820px){
  .md-cov .md-row.md-cvi{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:12px;row-gap:2px}
  .md-cov .md-row.md-cvi > .md-l{flex:none}
  .md-cov .md-row.md-cvi > .md-v{flex:0 1 auto;min-width:0}
  .md-cov .md-row.md-drow{grid-template-columns:max-content minmax(0,1fr);align-items:start;gap:4px 12px}
  .md-cov .md-row.md-drow > .md-l{padding-top:13px}
  .md-cov .md-row.md-drow .md-date{justify-content:flex-start;gap:6px}
  .md-cov .md-row.md-drow .md-date .inp.md-dt{flex:0 0 auto;width:calc(10ch + 28px);max-width:none!important;padding-left:10px;padding-right:10px}
  .md-cov .md-row.md-drow .md-date .btn{flex:none;padding-left:12px;padding-right:12px}
  .md-cov .md-row.md-drow .md-date > .md-t{padding-top:9px}
}

/* v761 (Kah Poh, style check 24 Oct) */
/* 1 dark mode: SOP Purpose / Who / When captions readable */
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sop-row b{color:var(--link)} }
:root[data-theme="dark"] .sop-row b{color:var(--link)}
/* 2 dark mode: ○ grey badges keep the strong grey (white text readable) */
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){--pending:#6B7785} }
:root[data-theme="dark"]{--pending:#6B7785}
/* 3 QC022 signing dates (phone): small date box, starts under the Name box */
@media (max-width:820px){ .qc-sign .md-date .md-dt{flex:0 0 auto;width:calc(10ch + 28px);max-width:none!important;padding-left:10px;padding-right:10px} }
/* 7 MDR Cover / TOC bottom buttons (phone): Save hidden → the 3 buttons in ONE row */
@media (max-width:560px){
  .md-acts.md-acts-cov:has(#mdSave[hidden]),.md-acts.md-acts-toc:has(#mdSave[hidden]){grid-template-columns:minmax(0,1.3fr) minmax(0,1.2fr) minmax(0,.8fr);gap:6px}
  .md-acts.md-acts-cov:has(#mdSave[hidden]) .md-gen,.md-acts.md-acts-toc:has(#mdSave[hidden]) .md-gen{grid-column:auto}
  .md-acts.md-acts-cov:has(#mdSave[hidden]) .btn,.md-acts.md-acts-toc:has(#mdSave[hidden]) .btn{font-size:14px;padding-left:4px;padding-right:4px}
  .md-acts.md-acts-cov:has(#mdSave[hidden]) .btn svg,.md-acts.md-acts-toc:has(#mdSave[hidden]) .btn svg{display:none}
}
/* v762 (Kah Poh, style check #8): Client list toolbar on phone — search on its own row, the buttons ALWAYS share one row (also at A+); a long label shortens with … */
@media (max-width:560px){
  #view-clients .forms-tools{display:grid;grid-template-columns:repeat(3,minmax(0,auto));gap:8px}
  #view-clients .forms-tools > .search-wrap{grid-column:1/-1}
  #view-clients .forms-tools > .btn{width:100%;margin-left:0}
}

/* v763 → v764 (Kah Poh): phone Client details follows the long-list rule — Edit / Delete hidden in the card; tap the card → .f-actpop (same as Client list v601) */
@media (max-width:560px){
  table.stack-ci td.c-act{display:none!important}
  .stack-ci tr{grid-template-areas:"name name" "pic pic" "ag ag"!important}
  table.stack-ci tr.f-tapr{cursor:pointer;-webkit-tap-highlight-color:transparent}
  table.stack-ci tr.f-tapon{outline:0;background:var(--surface-2,#EEF2F6)!important;box-shadow:inset 4px 0 0 var(--steel,#2457E6);border-radius:8px;margin-left:-10px;margin-right:-10px;padding-left:14px!important;padding-right:10px!important}
  table.stack-ci tr.f-tapon td{background:transparent!important}
  .table-wrap:has(> table.stack-ci){overflow:visible}
}
/* v765 → v766 (Kah Poh: "too big, PIC & Inspector in a line"): phone Client details card — PIC left | Inspector right on ONE line under the name; captions inline, PIC title after the name, no divider lines */
@media (max-width:560px){
  .stack-ci tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;grid-template-areas:"name name" "pic ag"!important;column-gap:12px}   /* v767: Inspector starts at the centre */
  .stack-ci td.c-pic,.stack-ci td.c-ag{min-width:0;overflow-wrap:anywhere;padding-top:2px!important;font-size:13.5px;line-height:1.35}
  .stack-ci td.c-ag{text-align:left}
  .stack-ci td.c-pic .caddr{display:inline;font-size:inherit;color:var(--muted)}
  .stack-ci td.c-pic .caddr::before{content:" · ";font-weight:800;font-size:1.3em;line-height:0}
}

/* v768 (Kah Poh, PHONE CARDS rule): (1) Home › Deliveries to watch — "Delivery …" left | "n items not delivered" from the card centre, 1 line;
   (2) Client list + import preview — Phone / Fax / Contact & Term columns removed (JS); phone card = name · address;
   (4) Public Holiday — date + weekday on 1 line (like Company Holiday) */
@media (max-width:560px){
  table.stack-due td.c-date{display:grid!important;grid-template-columns:minmax(max-content,1fr) minmax(0,1fr);column-gap:12px;align-items:baseline}
  table.stack-due td.c-date .hm-sub{font-size:inherit;margin:0}
  .stack-clients tr{grid-template-areas:"name name" "addr addr"!important}
  table.stack-ph tr{grid-template-columns:auto minmax(0,1fr);grid-template-areas:"date name" ". type" "act act"}
  table.stack-ph .ph-wd{display:inline-block;margin:0 0 0 10px;min-width:2.4em}
}

/* v769 (Kah Poh): Approvals decided card — line 2 = solid badge (✓ Approved / ✓ Unlocked / ✕ Rejected + date) then "by …" */
.ap-row .ap-dec{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;margin-top:4px}

/* v771 (Kah Poh): Approvals — Waiting rows: Approve / Reject same size, bigger; reason box = full-width box + Reject | Cancel row.
   Phone (≤820px): buttons 2 equal halves, 44px, 1 row; Reject | Cancel the same. */
.ap-row .a .btn,.ap-rj .btn{min-width:128px;justify-content:center}
.ap-rj{margin-top:4px}
@media (max-width:820px){
  .ap-row .a:not(:empty){display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:2px}
  .ap-row .a .btn,.ap-rj .btn{min-width:0;min-height:44px;font-size:15px;padding:8px 10px}
  .ap-rj{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  .ap-rj .inp{grid-column:1/-1;font-size:16px}
}

/* v774b (Kah Poh): zoom buttons on every form / MDR PDF preview (pagesOverlay) — same look as the photo viewer's − 100% +, floating bottom-centre */
.mp-zoom{position:absolute;left:50%;transform:translateX(-50%);bottom:calc(16px + env(safe-area-inset-bottom,0px));z-index:5;background:#3A1F8F;border-color:#fff;box-shadow:0 4px 14px rgba(0,0,0,.35)}
.mp-zoom .pv-zb{background:transparent}
.memo-ov:has(.mp-zoom) .memo-stage{padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}

/* v776 (Kah Poh): JOB DETAILS box (per PO) at the top of the Project list items box — Project title + Project location */
.jd-box{margin:6px 0 10px;padding:8px 12px 10px;background:var(--surface-2,#F5F7FA);border:1px solid var(--divider);border-radius:6px}
.jd-h{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:4px}
.jd-t{font-family:var(--cond);font-weight:700;font-size:12.5px;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}
.jd-kv{display:grid;grid-template-columns:130px minmax(0,1fr);gap:8px;padding:2px 0;font-size:14px}
.jd-k{color:var(--muted)} .jd-v{white-space:pre-line;overflow-wrap:anywhere} .jd-hint{color:var(--muted);font-size:12.5px}
.jd-l{display:block;font-weight:600;font-size:13px;margin:8px 0 4px} .jd-box .inp{width:100%;max-width:640px;box-sizing:border-box;font-family:inherit}
.jd-note{font-size:12.5px;color:var(--muted);margin-top:3px}
.jd-acts{display:flex;gap:8px;margin-top:10px}
@media (max-width:820px){ .jd-box{margin:4px 0 8px;padding:8px 10px} .jd-kv{grid-template-columns:max-content minmax(0,1fr);font-size:14px} .jd-box .inp{font-size:16px}
  .jd-acts{display:grid;grid-template-columns:1fr 1fr} .jd-acts .btn{min-height:44px;justify-content:center} }

/* v780 (Kah Poh): Client field setup — Close row at the bottom of the open client card (others hidden) */
.pds-close{display:flex;justify-content:center;margin:12px -14px -10px;padding:10px 14px;border-top:1px solid var(--divider);background:var(--surface-2)}
.pds-close .btn{min-width:160px;justify-content:center;gap:6px}
.pds-close .btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
@media (max-width:820px){ .pds-close .btn{width:100%;min-height:44px;font-size:15px} }
/* v781 (Kah Poh): JOB DEFAULT box (whole PO) + "✎ Own" on item / equipment cards */
.pjd-sub{font-family:inherit;font-weight:500;font-size:12.5px;letter-spacing:0;text-transform:none}
.pjd-grid{display:grid;grid-template-columns:max-content minmax(0,1fr) max-content minmax(0,1fr);gap:6px 12px;align-items:center;margin-top:4px}
.pjd-grid .jd-l{margin:0}
.pjd-c .inp{width:100%;max-width:none}
.pjd-c .inp.md-dt{width:calc(10ch + 28px)}
.pjd-box .jd-kv{grid-template-columns:170px minmax(0,1fr)}
.pd-src.pd-own{background:#2457E6}
.pd-jdn{font-size:12.5px;color:var(--muted);margin:4px 0 0;padding:0 2px}
.pd-usedef{border:0;background:none;padding:0 2px;font:inherit;font-weight:600;color:var(--link);cursor:pointer;white-space:nowrap}
@media (hover:hover){ .pd-usedef:hover{text-decoration:underline} }
.md-hint.pd-jdh .hs{color:var(--ink)}
@media (max-width:1000px){ .pjd-grid{grid-template-columns:max-content minmax(0,1fr)} }
@media (max-width:820px){ .pjd-grid{grid-template-columns:minmax(0,42%) minmax(0,1fr);gap:6px 10px} .pjd-box .jd-kv{grid-template-columns:max-content minmax(0,1fr)} .pjd-c .inp{font-size:16px} }
/* v782 (Kah Poh): ↑ / ↓ move buttons (Job default ↔ per item / equipment), ⚠ Common badge, per-item chips, value pick list */
.pd-mv{display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;margin-right:6px;padding:0;border:1.5px solid var(--steel,#2457E6);border-radius:4px;background:var(--surface);color:var(--link);font:700 15px/1 inherit;cursor:pointer;vertical-align:middle;flex:none}
@media (hover:hover){ .pd-mv:hover{background:var(--steel,#2457E6);color:#fff} }
.pd-row .pd-l{display:flex;align-items:center}
.pd-src.pd-common{background:#F2C230;color:#1C2530}
.pjd-l{display:flex;align-items:center}
.pjd-ind{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin-top:8px;font-size:13px}
.pjd-indk{color:var(--muted)}
.pjd-chip{border:1px solid var(--frame,#8A96A3);border-radius:12px;padding:1px 9px;background:var(--surface)}
.pjd-cm{background:#F2C230;color:#1C2530;border-radius:3px;padding:0 3px;margin-left:4px;font-size:11px}
.pd-pick{display:flex;flex-direction:column;gap:4px;margin:6px 0 10px;max-height:40vh;overflow:auto}
.pd-pick-o{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--divider);border-radius:5px;cursor:pointer;font-size:14px}
.pd-pick-o input{width:18px;height:18px;flex:none}
@media (max-width:820px){ .pd-mv{width:32px;height:32px} }
/* v783 (Kah Poh): "Save or Cancel first" floating note · Job default view in 2 columns (Production details layout) */
.pd-busy{position:fixed;z-index:9000;max-width:min(320px,calc(100vw - 16px));padding:7px 11px;border-radius:6px;background:#F2C230;color:#1C2530;font-size:14px;font-weight:600;line-height:1.3;box-shadow:0 4px 14px rgba(0,0,0,.25);pointer-events:none}
.pjd-vg{margin-top:2px}
/* v784 (Kah Poh): Job default folds (starts closed) · desktop caption column wide enough for "Construction material" on one line */
.pjd-tog{display:flex;align-items:center;gap:6px;flex:1;min-width:0;min-height:30px;padding:0;border:0;background:none;color:inherit;font:inherit;text-align:left;cursor:pointer}
.pjd-tog .pd-chev{width:18px;height:18px;flex:none;margin-left:auto;fill:none;stroke:var(--muted);stroke-width:2;transition:transform .15s}
.pjd-box.open .pjd-tog .pd-chev{transform:rotate(180deg)}
.pjd-box:not(.open){padding-bottom:8px}
.pjd-box:not(.open) .jd-h{margin-bottom:0}
@media (min-width:821px){ .pd-grid{--pdl:150px} .pd-grid .pd-l{white-space:nowrap} }

/* v786 (Kah Poh, phone): Job default Edit = Production details Edit layout — caption on its own row, box full width under it;
   dates: caption | small box on one row. ⚠ Common badge in Production / Equipment details Edit sits BELOW the box. */
@media (max-width:820px){
  .pjd-grid{grid-template-columns:minmax(0,1fr) 150px;gap:3px 10px}
  .pjd-grid > .pjd-l{grid-column:1/-1;margin-top:5px}
  .pjd-grid > .pjd-c{grid-column:1/-1;margin-bottom:4px}
  .pjd-grid > .pjd-l.pjd-ld{grid-column:1;margin:5px 0 4px}
  .pjd-grid > .pjd-c.pjd-cd{grid-column:2;margin:5px 0 4px}
  .pjd-c.pjd-cd .inp.md-dt{width:100%}
}
/* v787 (Kah Poh, phone): ⚠ Common on the caption row, right side (replaces v786 "below the box"); desktop keeps it beside the box.
   Pending ↑ / ↓ move (done on Save): steel tag + ↺ Undo. */
.pd-cm-l{display:none}
@media (max-width:820px){ .pd-cm-b{display:none} .pd-row .pd-l > .pd-cm-l{display:inline-block;margin-left:auto} }
.pd-src.pd-mvtag{background:#2457E6;color:#fff;white-space:normal}
.pjd-c.pjd-mvp{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}
.pd-row.pd-mvp .md-date{flex-wrap:wrap}

/* v788 (Kah Poh): Job default / Job details Edit = Production details style — pencil Edit, Cancel + Save in the heading (Save hidden until a change).
   Desktop 2-column Production / Equipment details Edit: boxes in one row line up at the top even when one has a note under it ("Project list: …"). */
.jd-h .jd-hacts{margin-top:0;flex:none}
.pjd-box.jd-ed .pjd-tog{flex:1}
@media (max-width:820px){ .jd-h .jd-hacts .btn{min-height:42px;padding:0 18px;font-size:16px;white-space:nowrap} }
@media (min-width:821px){ .pd-cmp .pd-row{align-items:start} .pd-cmp .pd-row > .pd-l{min-height:var(--pd-bh,42px)} }
/* v788: while editing, the Job default heading = title + Cancel / Save only (no fold arrow; phone also drops the " · all items & …" note) */
.pjd-box.jd-ed .pjd-tog .pd-chev{display:none}
@media (max-width:820px){ .pjd-box.jd-ed .pjd-sub{display:none} .jd-box.jd-ed .jd-h .jd-t{white-space:nowrap} }

/* v789 (Kah Poh): read-only rows in Production / Equipment details Edit (🔒 MDR Actual delivery, 🔒 PO link) line up with their caption —
   desktop: value centred on the 42px box line; phone: caption | value + tag in the box column (150px), like the date rows. Job details folds like the Job default. */
@media (min-width:821px){ .pd-cmp .pd-row > .md-date{min-height:var(--pd-bh,42px)} }
@media (max-width:820px){ .pd-row.pd-lkrow{grid-template-columns:minmax(0,1fr) 150px;gap:10px;align-items:center;margin:4px 0 6px}
  .pd-row.pd-lkrow .md-date{flex-wrap:wrap;gap:4px 8px} .pd-row.pd-lkrow > .pd-l{white-space:nowrap} }
.jd-box.jd-fold .jd-h > .pjd-tog{flex:1}
.jd-box.jd-fold.open .pjd-tog .pd-chev{transform:rotate(180deg)}
.jd-box.jd-fold:not(.open){padding-bottom:8px}
.jd-box.jd-fold:not(.open) .jd-h{margin-bottom:0}
.jd-box.jd-fold.jd-ed .pjd-tog .pd-chev{display:none}
@media (max-width:820px){ .pd-row.pd-lkrow .md-date > *{flex:none;width:auto;max-width:100%} .jd-h .pjd-tog{min-width:0} .jd-h .pjd-tog .jd-t{min-width:0} }
/* v792 (Kah Poh): Project list "n items ▾" (expand items) = same size as the job's PO row values (13.5px) */
table.pj .it-link{font-size:13.5px}

/* v793 (Kah Poh): Job default inside the Job details box — one heading, one Edit; parts stacked with a thin divider */
.pjd-emb{margin-top:6px}
.jd-vg + .pjd-emb, .jd-egrid + .pjd-emb{margin-top:8px;padding-top:8px;border-top:1px solid var(--divider)}
.jd-v{white-space:pre-line}
@media (min-width:1001px){ .jd-box .pjd-grid{grid-template-columns:190px minmax(0,1fr) 190px minmax(0,1fr)} }
.jd-box:has(.pjd-emb .pd-mv) .jd-egrid > .pjd-l{padding-left:32px}
/* v795 (Kah Poh, phone): long equipment name — FOLDED card shows it on 1 line with "…"; tap the card heading (opens it) → full name. View only. */
@media (max-width:820px){ .pd-card.pd-fold .pd-eqtog > .pd-eqd{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;overflow-wrap:normal} }

/* v796 (Kah Poh, phone): one-open job — Close row at the bottom of the open job (Projects › Project list items box / Projects › Item details job panel); same look as Client field setup (.pds-close) */
.one-close{display:flex;justify-content:center;padding:10px 14px;border-top:1px solid var(--divider);background:var(--surface-2)}
.one-close.oc-pj{margin:10px -10px -8px}
.one-close.oc-it{margin:12px -14px -14px;border-radius:0 0 8px 8px}
.one-close .btn{width:100%;min-height:44px;font-size:15px;justify-content:center;gap:6px}
.one-close .btn svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
/* v797 (Kah Poh, phone): one job open → the search / filter row, status tiles and sort bar are hidden too (only the job, its year bar and Close show) */
@media (max-width:820px){ #view-projects.one-on .forms-tools, #view-projects.one-on #pjStats, #view-items.one-on .forms-tools{display:none} }
/* v798 (Kah Poh, phone): one job open → its PO year bar is hidden too (only the job + Close show) */
@media (max-width:820px){ #view-projects.one-on #pjBody .cl-group > .panel-head{display:none} }
/* v799 (Kah Poh, phone): one job open → no round Collapse all / Move to top button bottom-right (Close at the job's bottom does the job) */
@media (max-width:820px){ body:has(#view-projects.one-on:not([hidden])) #foldFab, body:has(#view-items.one-on:not([hidden])) #foldFab{display:none!important} }
/* v800 (Kah Poh, desktop): Job details Edit — Project title, then Project location under it, each across the full row (End user stays half) */
@media (min-width:1001px){ .jd-egrid > .jd-l.jd-wide{grid-column:1} .jd-egrid > .pjd-c.jd-wide{grid-column:2/-1} .jd-egrid > .pjd-c.jd-wide .inp{max-width:none} }
/* v801 (Kah Poh): Project location note is the box's 2nd placeholder line — on phone it wraps, so the box is 3 lines tall */
@media (max-width:820px){ .jd-egrid textarea#jd_loc{min-height:92px} }
/* v802 (Kah Poh, desktop): Job details / Production / Equipment details view — value starts right after its caption (caption column = its widest caption, not a fixed 150px), so long values (address) get more room */
@media (min-width:821px){ @supports (grid-template-columns:subgrid){
  .pd-grid{grid-template-columns:max-content minmax(0,1fr) 20px max-content minmax(0,1fr);column-gap:0}
  .pd-grid > .pd-f{grid-column:1/span 2;grid-template-columns:subgrid;column-gap:0}
  .pd-grid > .pd-f:nth-child(even){grid-column:4/span 2}
  .pd-grid > .pd-f > .pd-l{padding-right:12px}
} }
@media (min-width:821px){ @supports (grid-template-columns:subgrid){
  .pd-grid > .pd-f.jd-wide{grid-column:1/-1} .pd-grid > .pd-f.jd-wide > .pd-v{grid-column:2/-1}   /* v802: Project title & location full row (as in Edit, v800) */
  .jd-box .pd-grid{grid-template-columns:minmax(var(--jc1,0px),max-content) minmax(0,1fr) 20px minmax(var(--jc2,0px),max-content) minmax(0,1fr)}
} }
/* ===== v803 (Kah Poh): FAB005 Progress Claim — editor + A4 sheet ===== */
.f5-b{font-weight:700;white-space:nowrap}
.status.f5-b-draft{background:#6B7785;color:#fff;border-color:#6B7785}
.status.f5-b-sub{background:#fff;color:#2457E6;border:2px solid #2457E6}
.status.f5-b-cert{background:#1F6FB2;color:#fff;border-color:#1F6FB2}
.status.f5-b-paid{background:#3A1F8F;color:#fff;border-color:#3A1F8F}
.f5-rt{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px}.f5-rt.f5-old > b{color:var(--muted)}.f5-sup{font-size:12.5px;color:var(--muted);font-style:italic}
.f5-seg{display:flex;flex-wrap:wrap;gap:6px}
.f5-sb{min-height:40px;padding:6px 12px;border-radius:6px;border:1.5px solid var(--slate,#8A96A3);background:var(--surface,#fff);color:var(--ink);font:inherit;font-weight:600;cursor:pointer}
.f5-sb.on.f5-sb-draft{background:#6B7785;border-color:#6B7785;color:#fff}
.f5-sb.on.f5-sb-sub{background:#fff;border:2.5px solid #2457E6;color:#2457E6;box-shadow:inset 0 0 0 1px #2457E6}
.f5-sb.on.f5-sb-cert{background:#1F6FB2;border-color:#1F6FB2;color:#fff}
.f5-sb.on.f5-sb-paid{background:#3A1F8F;border-color:#3A1F8F;color:#fff}
.f5-u{display:flex;align-items:center;gap:6px}.f5-u .inp{max-width:200px}.f5-ut{color:var(--muted);font-size:14px;white-space:nowrap}
input.f5-amt{text-align:right;font-variant-numeric:tabular-nums}input.f5-num{max-width:90px;text-align:right}
.f5-cn{display:flex;align-items:center;gap:8px}.f5-cn input.f5-num{width:70px}
.f5-calc{font-variant-numeric:tabular-nums;background:var(--surface-2,rgba(127,127,127,.08));border-radius:6px;padding:4px 8px;display:inline-block}
.f5-vh .md-hint{margin-top:3px}
.f5-note{margin:6px 0;display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.f5-warns{display:flex;flex-wrap:wrap;gap:6px;margin:8px 0}
@media (max-width:820px){
  .md-row.f5-inl{grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:4px 10px}
  .md-row.f5-inl > .md-c{display:none}
  .md-row.f5-inl > .md-v{justify-self:end;text-align:right}
  .md-row.f5-inl .f5-u{justify-content:flex-end}.md-row.f5-inl .f5-u .inp{width:150px;max-width:150px}
  .md-row.f5-inl .f5-vh{display:contents}
  .md-row.f5-inl .f5-vh > .md-hint{grid-column:1/-1;grid-row:2;justify-self:start;text-align:left}
  .md-row.f5-inl > .md-v:has(.f5-vh){display:contents}
  .md-row.f5-inl .f5-vh > :first-child{grid-column:2;grid-row:1;justify-self:end}
}
/* sheet — real DOM only (sharp PDF writer) */
.qc-sheet.f5-sheet{padding:40px 50px 40px;font-family:Arial,"Liberation Sans",Helvetica,sans-serif;font-size:13px;line-height:1.3}
.f5-hd{display:flex;align-items:flex-start;gap:14px}
.f5-lg img{height:62px;max-width:150px;object-fit:contain;display:block}
.f5-co{flex:1 1 auto;font-size:11.5px}.f5-cn1{font-weight:700;font-size:15px;margin-bottom:2px}
.f5-no{font-size:11.5px;white-space:nowrap}
.f5-ti{text-align:center;font-weight:700;font-size:20px;margin-top:26px;letter-spacing:.04em}
.f5-sti{text-align:center;font-weight:700;font-size:13.5px;margin:4px 0 16px}
.f5-b1{display:grid;grid-template-columns:200px 14px minmax(0,1fr);border:1.5px solid #000;padding:8px 12px;row-gap:5px}
.f5-k{font-size:12.5px}.f5-v{font-weight:700;font-size:12.5px}.f5-k.f5-pt,.f5-v.f5-pt{min-height:34px;margin-bottom:6px}
table.f5-b2{width:100%;border-collapse:collapse;margin-top:14px;border:1.5px solid #000;font-size:12.5px}
table.f5-b2 th{border:1px solid #000;border-bottom:1.5px solid #000;padding:5px 6px;font-weight:700;text-align:center;background:#fff;color:#000}
table.f5-b2 td{padding:7px 6px;vertical-align:top;border-left:1px solid #000;border-right:1px solid #000}
table.f5-b2 td.f5-rm{border-right:0;width:34px;text-align:left;padding-right:0}
table.f5-b2 td.f5-am{border-left:0;width:130px;text-align:right;font-variant-numeric:tabular-nums}
table.f5-b2 .f5-it{width:56px;text-align:center}
table.f5-b2 tr.f5-sum td,table.f5-b2 tr.f5-sum2 td{font-weight:700}
table.f5-b2 tr.f5-sum td.f5-am,table.f5-b2 tr.f5-sum2 td.f5-am{border-top:1px solid #000}
table.f5-b2 tr.f5-ital td.f5-ds{font-style:italic}
table.f5-b2 tr td:empty{height:14px}
table.f5-b2 tr.f5-tot td{border:1.5px solid #000;font-weight:700;padding:8px 6px;vertical-align:middle}
table.f5-b2 tr.f5-tot td.f5-rm{border-right:0}table.f5-b2 tr.f5-tot td.f5-am{border-left:0}
.f5-wd{font-weight:700;font-style:italic;margin-top:10px;font-size:13px}
.f5-sig{display:grid;grid-template-columns:1fr 1fr;gap:40px;margin-top:46px}
.f5-sgk{font-weight:700}
.f5-sgs{position:relative;height:96px}
.f5-sgl{position:absolute;left:0;right:0;bottom:0;border-top:1px solid #000}
.f5-stp{position:absolute;left:calc(50% - 45px);bottom:3px;width:90px;height:90px;z-index:-1;display:flex;align-items:center;justify-content:center}
.f5-stp img{max-width:90px;max-height:90px;object-fit:contain;opacity:.92}.f5-stp img.stamp-rd{width:88px;height:88px;max-width:none;max-height:none}
.f5-sgr{display:grid;grid-template-columns:62px 12px minmax(0,1fr);margin-top:5px;font-size:12.5px}
table.f5-b2 tbody td{border-top:0;border-bottom:0;background:#fff;color:#000}
.f5-seg{display:grid;grid-template-columns:repeat(4,max-content)}.f5-sb{min-width:120px}
@media (max-width:820px){ .f5-seg{grid-template-columns:1fr 1fr;width:100%} .f5-sb{min-width:0}
  .md-row.f5-inl .md-date{display:flex;align-items:center;gap:6px;justify-content:flex-end;flex-wrap:wrap}
  .md-row.f5-inl .md-date input.md-dt{width:calc(10ch + 28px);max-width:calc(10ch + 28px);min-width:0}
  .md-row.f5-inl .f5-u input.f5-pct,.md-row.f5-inl input.f5-num{width:78px;max-width:78px}
  .md-row.f5-inl > .md-v:has(.f5-seg){display:block;grid-column:1/-1;justify-self:stretch} }
.jf-fa:has(> :nth-child(4)){display:grid;grid-template-columns:repeat(4,auto)}
@media (max-width:820px){ .jf-fa:has(> :nth-child(4)){grid-template-columns:1fr 1fr} .jf-f{min-width:0} .jf-fi{min-width:0} }
/* v804 */
.f5-sb:disabled{opacity:1;color:var(--muted);border-style:dashed;cursor:not-allowed}
.f5-nrev{margin-left:8px}
.f5-rv{min-width:1.5em}
/* v805 FAB005 flow */
.f5-top{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px;padding:10px 0 12px;border-bottom:1px solid var(--divider)}
.f5-top .f5-cn{gap:8px}.f5-big{font-size:20px;font-variant-numeric:tabular-nums}
.f5-seg .f5-sb:disabled{opacity:1}
.f5-hist{margin-top:14px}.f5-hh{font-weight:700;margin:0 0 6px}
table.f5-ht{width:100%;border-collapse:collapse;font-size:14px}
table.f5-ht th{text-align:left;font-size:12.5px;color:var(--muted);padding:6px 8px;border-bottom:1px solid var(--divider)}
table.f5-ht td{padding:8px;border-bottom:1px solid var(--divider);vertical-align:middle}
table.f5-ht td.f5-ha{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}
table.f5-ht tr.f5-me td{background:var(--surface-2,#EEF2F6)}table.f5-ht tr.f5-me td:first-child{box-shadow:inset 4px 0 0 #2457E6}
table.f5-ht .md-date input.md-dt{width:calc(10ch + 28px)}
@media (max-width:820px){
  table.f5-ht thead{display:none} table.f5-ht,table.f5-ht tbody,table.f5-ht tr,table.f5-ht td{display:block;width:100%}
  table.f5-ht tr{display:grid;grid-template-columns:1fr 1fr;gap:4px 10px;padding:10px;border:1px solid var(--divider);border-radius:8px;margin-bottom:8px}
  table.f5-ht tr.f5-me{box-shadow:inset 4px 0 0 #2457E6;background:var(--surface-2,#EEF2F6)} table.f5-ht tr.f5-me td{background:none} table.f5-ht tr.f5-me td:first-child{box-shadow:none}
  table.f5-ht td{border:0;padding:0;font-size:13.5px} table.f5-ht td::before{content:attr(data-l) ": ";color:var(--muted)}
  table.f5-ht td.f5-ha{text-align:left} table.f5-ht td.f5-hp{grid-column:1/-1;display:flex;align-items:center;gap:8px}
  .f5-top .f5-newc{width:100%;justify-content:center}
}
@media (max-width:820px){ .f5-stbox .f5-seg{grid-template-columns:repeat(3,1fr)} .f5-stbox .f5-sb{padding:6px 4px;font-size:14px} table.f5-ht td{white-space:normal} table.f5-ht td.f5-hp::before{white-space:nowrap} }
/* v806 Revised = deep yellow, dark text (needs submitting again) */
.status.f5-b-rev{background:#F2C230;color:#1C2530;border-color:#F2C230}
.f5-sb.on.f5-sb-rev{background:#F2C230;border-color:#F2C230;color:#1C2530}
.f5-top .status.f5-b{font-size:13px;padding:4px 10px}
/* v807 RM inside the amount box; claim log */
.f5-rmin{position:relative;display:block;max-width:200px}.f5-rmin .f5-rmt{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:15px;pointer-events:none}
.f5-rmin input.f5-amt{padding-left:42px;width:100%;max-width:200px}
@media (max-width:820px){ .md-row.f5-inl .f5-rmin{width:170px;max-width:170px} .md-row.f5-inl .f5-rmin input.f5-amt{width:170px;max-width:170px} }
table.f5-ht tr.f5-oldr td{color:var(--muted)} table.f5-ht td.f5-hpdf{text-align:right;width:1%}
@media (max-width:820px){ table.f5-ht td.f5-hpdf{grid-column:1/-1;text-align:left;width:auto} table.f5-ht td.f5-hpdf::before{content:none} table.f5-ht td.f5-hpdf .btn{width:100%;justify-content:center} }
/* v808 claim log: one line per row on desktop */
@media (min-width:821px){ table.f5-ht td{white-space:nowrap} table.f5-ht .md-date{display:flex;flex-wrap:nowrap;align-items:center;gap:6px} table.f5-ht .md-date .btn{min-height:36px;padding:4px 10px} }

/* v809 (Kah Poh): "From …" source notes removed from forms — an empty note takes no space */
.md-hint:empty{display:none}

/* v810 (Kah Poh): FAB005 Valuation notes AFTER the box / value — desktop on the same line; phone under the value, right side */
.f5-vh.f5-aft{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px}
.f5-vh.f5-aft > .md-hint{margin:0;flex-basis:auto}
@media (max-width:820px){
  .md-row.f5-inl .f5-vh.f5-aft > .md-hint{grid-column:2;justify-self:end;text-align:right}
}


/* v812 (Kah Poh): FAB005 values & boxes all start at ONE left line (phone: fixed value column, left-aligned; v811 padding undone) */
@media (max-width:820px){
  .md-row.f5-inl{grid-template-columns:minmax(0,1fr) 180px;column-gap:8px}   /* v813: 180 = date box + Today; leaves room for long caption words */
  .md-row.f5-inl .md-date input.md-dt{width:126px;max-width:126px;padding-left:6px;padding-right:6px}   /* v817: full dd-mm-yyyy fits (was 116 → cut) */
  .md-row.f5-inl .md-date .btn{padding-left:8px;padding-right:8px}
  .md-row.f5-inl .md-date{flex-wrap:nowrap}
  .md-row.f5-inl > .md-v{justify-self:start;text-align:left}
  .md-row.f5-inl .f5-vh > :first-child{justify-self:start}
  .md-row.f5-inl .f5-u{justify-content:flex-start}
  .md-row.f5-inl .md-date{justify-content:flex-start}
  .md-row.f5-inl .f5-vh.f5-aft > .md-hint{justify-self:start;text-align:left}
}

/* v813 (Kah Poh): numbered captions — wrapped line lines up with the text, not the number */
.f5-nl{display:flex;gap:.4em}.f5-nl > .f5-nn{flex:none}   /* v814: own class (f5-no is the PDF sheet's 11.5px class) */
/* v814 (Kah Poh): grey worked-out value — its TEXT lines up with plain values (Original contract sum); the grey box sticks out left */
.md-form .md-t.f5-calc{margin-left:-8px}

/* v815 (audit): FAB005 at A+ text size the fixed 180px value column crushed the captions (overlap). When the form is narrower than
   caption 117px + value 180px, rows stack: caption on top, value / box under it, all on one left line. Measured on the form itself (container). */
.md-form:has(> .md-row.f5-inl){container-type:inline-size;container-name:f5form}
@container f5form (max-width:300px){
  .md-row.f5-inl{grid-template-columns:minmax(0,1fr)!important}
  .md-row.f5-inl > .md-l, .md-row.f5-inl > .md-v, .md-row.f5-inl .f5-vh > :first-child, .md-row.f5-inl .f5-vh > .md-hint{grid-column:1/-1!important;justify-self:start!important;text-align:left!important}
  .md-row.f5-inl .f5-vh > :first-child{grid-row:2}
  .md-row.f5-inl .f5-vh > .md-hint{grid-row:3}
  .md-row.f5-inl > .md-v:not(:has(.f5-vh)){grid-row:2}
}

/* v816 (Kah Poh): FAB005 text rows — too long for 1 line beside the caption → value goes below, left */
@media (max-width:820px){
.md-row.f5-inl.f5-below{grid-template-columns:minmax(0,1fr)!important}
.md-row.f5-inl.f5-below > .md-c{display:none}
.md-row.f5-inl.f5-below > .md-v{grid-column:1/-1!important;justify-self:start!important;text-align:left!important}
}

/* v817 (Kah Poh): every date box shows the full dd-mm-yyyy — FAB005 claims log Paid date box never narrower than the date (A+ too); Today wraps under if no room */
input.md-dt[id^="f5Pd_"]{min-width:calc(10ch + 24px)!important}
td .md-date:has(input[id^="f5Pd_"]){flex-wrap:wrap}
/* v817: Supplier › 3rd Party Inspector edit — date boxes never narrower than the full date; fields wrap to the next row when the card is narrow (phone, A+) */
@media (max-width:820px){ .tpi-dg{grid-template-columns:repeat(auto-fit,minmax(calc(10ch + 26px),1fr))} }
.tpi-dg input.md-dt{min-width:calc(10ch + 24px)}

/* v818 (Kah Poh): FAB005a Claim No. — picture-sheet value after the Job No. (master jobX), picker + ⚠ badge, FAB005 claim log Attachment button */
.ps-jv{display:flex;flex-wrap:wrap;align-items:baseline;column-gap:16px;min-width:0}
.ps-jx{white-space:nowrap}
.ps-jxk{font-weight:400;margin-right:5px}
.f5a-pick{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;min-width:0}
.f5a-pick .f5a-sel{width:auto;max-width:100%;min-width:0}
.f5a-pick .f5a-b{white-space:normal}
.f5a-pick .f5a-h{margin:0}
table.fh-tb .fh-tag{margin-right:2px}
table.f5-ht td.f5-hpdf .btn+.btn{margin-left:6px}
table.f5-ht td.f5-hpdf .btn svg{width:15px;height:15px}
@media (max-width:820px){ table.f5-ht td.f5-hpdf{display:flex;gap:6px} table.f5-ht td.f5-hpdf .btn{flex:1 1 0;width:auto} table.f5-ht td.f5-hpdf .btn+.btn{margin-left:0} }
/* v819 (Kah Poh): FAB005 claim log — paid date + Today and the row buttons on one line (desktop) */
@media (min-width:821px){ table.f5-ht td.f5-hp .md-date{flex-wrap:nowrap} table.f5-ht td.f5-hpdf{white-space:nowrap} }
/* v819 (Kah Poh): phone — Cancel shares the top row with Save (Save | Cancel), then Back | Preview PDF */
@media (max-width:820px){ .md-acts:has(.qc-back2):has(.qc-cancel:not([hidden])) .btn-primary{grid-column:auto} .md-acts:has(.qc-back2) .qc-cancel{order:-1} }
/* v821 (Kah Poh): FAB005 status buttons that do nothing when tapped → plain cursor (current Submitted / Certified, disabled, Draft / Revised with nothing to save) */
.f5-sb.f5-idle,.f5-sb:disabled,.f5-sb.on.f5-sb-sub,.f5-sb.on.f5-sb-cert,.f5-sb.on.f5-sb-paid{cursor:default}
/* v822 (Kah Poh): FAB005 Claims of this job — fits the box with million amounts: tighter cells, smaller badge, small paid date box, short "Att." button */
.f5-hist .table-wrap{overflow-x:auto}
table.f5-ht .f5-as{display:none}
@media (min-width:821px){
  table.f5-ht th,table.f5-ht td{padding-left:6px;padding-right:6px}
  table.f5-ht th{font-size:12px}
  table.f5-ht .f5-b{font-size:11.5px;padding:3px 7px}
  table.f5-ht td.f5-hp .md-date{gap:4px}
  table.f5-ht td.f5-hp input.md-dt{width:calc(10ch + 14px);padding:4px 6px;min-height:32px;font-size:14px}
  table.f5-ht td.f5-hp .md-date .btn{min-height:32px;padding:3px 7px;font-size:13px}
  table.f5-ht td.f5-hpdf .btn{padding:4px 8px;min-height:32px}
  table.f5-ht td.f5-hpdf .btn+.btn{margin-left:4px}
  table.f5-ht .f5-al{display:none} table.f5-ht .f5-as{display:inline}
  table.f5-ht td.f5-ha{width:1%}
}
@media (min-width:821px){
  .f5-hist{container-type:inline-size}
  @container (max-width:860px){
    table.f5-ht td:first-child{white-space:normal}
    table.f5-ht td.f5-hp .md-date{flex-wrap:wrap;width:calc(10ch + 14px)}
    table.f5-ht td.f5-hp .md-date .btn{width:100%;justify-content:center}
    table.f5-ht td.f5-hpdf .btn{display:flex;width:100%;justify-content:center} table.f5-ht td.f5-hpdf .btn+.btn{margin:4px 0 0}
  }
}
/* v823 (Kah Poh): once Certified, ➤ Submitted does nothing → plain cursor */
.f5-seg:has(.f5-sb-cert.on) .f5-sb-sub{cursor:default}
/* v824 (Kah Poh): FAB005 — date box + Today together = the amount box width; Retention box = the date box width */
.md-form:has(#f5VDt) .md-row .md-date{display:grid;grid-template-columns:minmax(0,1fr) 64px;gap:6px;width:200px;max-width:200px;justify-content:stretch}
.md-form:has(#f5VDt) .md-row .md-date > :not(input):not(.btn){grid-column:1/-1}
.md-form:has(#f5VDt) .md-row .md-date input.md-dt{width:100%;max-width:none;min-width:0}
.md-form:has(#f5VDt) .md-row .md-date .btn{width:64px;padding-left:4px;padding-right:4px;justify-content:center}
.md-form:has(#f5VDt) .md-row input.f5-pct{width:130px;max-width:130px}
@media (max-width:820px){
  .md-form:has(#f5VDt) .md-row .md-date{grid-template-columns:minmax(0,1fr) 54px;width:170px;max-width:170px}
  .md-form:has(#f5VDt) .md-row .md-date .btn{width:54px}
  .md-form:has(#f5VDt) .md-row .md-date input.md-dt{padding-left:6px;padding-right:6px}
  .md-form:has(#f5VDt) .md-row input.f5-pct,.md-row.f5-inl .f5-u input.f5-pct{width:110px;max-width:110px}
}
/* v824 (Kah Poh): Claims of this job — Today, Att. and PDF share the space evenly */
@media (min-width:821px){
  table.f5-ht td.f5-hp .md-date{display:grid;grid-template-columns:minmax(0,1fr) 60px;width:170px}
  table.f5-ht td.f5-hp input.md-dt{width:100%}
  table.f5-ht td.f5-hp .md-date .btn,table.f5-ht td.f5-hpdf .btn{width:60px;justify-content:center;padding-left:4px;padding-right:4px}
  table.f5-ht td.f5-hpdf .btn{display:inline-flex}
}
@media (min-width:821px){ @container (max-width:860px){ table.f5-ht td.f5-hp .md-date{grid-template-columns:1fr;width:100px} table.f5-ht td.f5-hp .md-date .btn{width:100%} table.f5-ht td.f5-hpdf .btn{width:100%} } }
/* v824: Job forms — FAB005a attachment rows under their FAB005 (indented, steel left line, paperclip) */
.jf-f.jf-kid{margin-left:22px;border-left:4px solid #2457E6;padding-left:10px}
.jf-kid .jf-ft{display:flex;align-items:center;gap:6px}
.jf-kid svg.jf-clip{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:2;color:var(--link)}
@media (max-width:820px){ .jf-f.jf-kid{margin-left:12px} }
/* v824b: phone — the full dd-mm-yyyy must show → amount boxes 184, date 126 + Today 52; log buttons 72px so the paperclip shows */
@media (max-width:820px){
  .md-form:has(#f5VDt) .md-row.f5-inl .f5-rmin,.md-form:has(#f5VDt) .md-row.f5-inl .f5-rmin input.f5-amt{width:184px;max-width:184px}
  .md-form:has(#f5VDt) .md-row .md-date{grid-template-columns:minmax(0,1fr) 52px;width:184px;max-width:184px}
  .md-form:has(#f5VDt) .md-row .md-date .btn{width:52px;padding-left:2px;padding-right:2px}
  .md-form:has(#f5VDt) .md-row input.f5-pct,.md-form:has(#f5VDt) .md-row.f5-inl .f5-u input.f5-pct{width:126px;max-width:126px}
}
@media (min-width:821px){
  table.f5-ht td.f5-hp .md-date{grid-template-columns:minmax(0,1fr) 72px;width:190px}
  table.f5-ht td.f5-hp .md-date .btn,table.f5-ht td.f5-hpdf .btn{width:72px}
}
@media (min-width:821px){
  table.f5-ht td.f5-hp .md-date{grid-template-columns:minmax(0,1fr) 66px;width:180px}
  table.f5-ht td.f5-hp .md-date .btn,table.f5-ht td.f5-hpdf .btn{width:66px;padding-left:3px;padding-right:3px;gap:4px}
}
@media (min-width:821px){ @container (max-width:860px){ table.f5-ht td.f5-hp .md-date{grid-template-columns:1fr;width:100px} table.f5-ht td.f5-hp .md-date .btn{width:100%} table.f5-ht td.f5-hpdf .btn{display:flex;width:66px} } }
/* v825 (Kah Poh): Job forms — "📎 Att. n ▾" toggle on the FAB005 row (attachments start folded) */
.jf-katt{display:inline-flex;align-items:center;gap:5px;margin-top:6px;padding:4px 10px;min-height:32px;border:1.5px solid #2457E6;border-radius:6px;background:var(--surface,#fff);color:var(--link);font:inherit;font-size:13.5px;font-weight:600;cursor:pointer}
.jf-katt svg{width:15px;height:15px;stroke:currentColor;fill:none;stroke-width:2}
.jf-katt .jf-kch{transition:transform .15s}.jf-katt[aria-expanded="true"] .jf-kch{transform:rotate(180deg)}
/* v825 (Kah Poh): Claims of this job on PHONE — tidy card: claim no. | status badge; Submitted | Certified; Amount; Paid date (certified only); buttons */
@media (max-width:820px){
  table.f5-ht tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:6px 10px;padding:10px 12px}
  table.f5-ht td:nth-child(1)::before,table.f5-ht td:nth-child(2)::before{content:none}
  table.f5-ht td:nth-child(1){font-size:15.5px;align-self:center}
  table.f5-ht td:nth-child(2){justify-self:end;align-self:center}
  table.f5-ht td:nth-child(2) .f5-b{font-size:12px;padding:3px 8px}
  table.f5-ht td:nth-child(3),table.f5-ht td:nth-child(4){font-size:13px}
  table.f5-ht td:nth-child(4){text-align:right}
  table.f5-ht td.f5-ha{grid-column:1/-1;font-size:15px;font-weight:700;color:var(--ink)}
  table.f5-ht td.f5-ha::before{font-weight:400}
  table.f5-ht tr.f5-oldr td.f5-ha{color:var(--muted);font-weight:600}
  table.f5-ht td.f5-hp.f5-hp0{display:none}
  table.f5-ht td.f5-hp{grid-column:1/-1;display:flex;align-items:center;gap:8px;padding-top:4px;border-top:1px solid var(--divider)}
  table.f5-ht td.f5-hp .md-date{display:grid;grid-template-columns:126px 64px;gap:6px;flex-wrap:nowrap}
  table.f5-ht td.f5-hp input.md-dt{width:126px;max-width:126px;padding-left:6px;padding-right:6px}
  table.f5-ht td.f5-hp .md-date .btn{width:64px;padding-left:4px;padding-right:4px;justify-content:center}
  table.f5-ht td.f5-hpdf{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}
  table.f5-ht td.f5-hpdf .btn{width:100%;min-height:38px}
  table.f5-ht td.f5-hpdf .btn:only-child{grid-column:2}
}
.jf-katt{align-self:flex-start;width:auto;justify-self:start}
@media (max-width:820px){ table.f5-ht td:nth-child(2){text-align:right;width:auto} }
/* v826 (Kah Poh): Job forms — Att. toggle UNDER Open / PDF / Delete; phone: as tall as Open, from Open to PDF */
.jf-fa:has(> .jf-katt){display:grid;grid-template-columns:repeat(3,auto);justify-content:end}
.jf-fa > .jf-katt{grid-column:1/3;grid-row:2;margin-top:0;justify-content:center}
@media (max-width:820px){ .jf-fa:has(> .jf-katt){grid-template-columns:repeat(3,minmax(0,1fr));justify-content:stretch} .jf-fa > .jf-katt{min-height:42px;width:100%} }
/* v826: Claims of this job — fold bar */
.f5-hhb{display:flex;align-items:center;justify-content:space-between;width:100%;background:none;border:0;border-bottom:1px solid var(--divider);padding:6px 0;font:inherit;font-weight:700;color:var(--ink);cursor:pointer;text-align:left}
.f5-hhb svg.f5-hch{width:18px;height:18px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s}
.f5-hhb[aria-expanded="true"] svg.f5-hch{transform:rotate(180deg)}
.jf-fa > .jf-katt{width:100%;justify-self:stretch;min-height:36px}
/* v827 (Kah Poh): busy cursor while uploading; busy text gets the portal spinner */
html.rv-busy,html.rv-busy *{cursor:progress!important}
.q8-busy{display:inline-flex;align-items:center;gap:6px}
/* v827: Job forms — "Attachment" toggle spans under Open, PDF & Delete on desktop (phone: Open → PDF) */
@media (min-width:821px){ .jf-fa > .jf-katt{grid-column:1/-1} }
/* v828 (Kah Poh): desktop Job forms — Attachment sits BEFORE Open, same row, own size */
@media (min-width:821px){ .jf-fa:has(> .jf-katt){display:flex;align-items:center;gap:8px} .jf-fa > .jf-katt{order:-1;width:auto;grid-column:auto;grid-row:auto;margin:0;min-height:0;align-self:stretch;padding:4px 12px} }
/* v830: FAB005 Total recommended can hold the cursor after the last Valuation box */
#f5Tot:focus{outline:2px solid #2457E6;outline-offset:2px}
/* v831 (Kah Poh): Capture screen — crop overlay */
.fk-cov{position:fixed;inset:0;z-index:9000;background:rgba(15,22,32,.92);display:flex;flex-direction:column}
.fk-cbar{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;padding:10px 14px;background:#3A1F8F;color:#fff}
.fk-cbar b{font-size:15px}
.fk-cacts{display:flex;gap:8px;flex-wrap:wrap}.fk-cacts .fk-ccx{color:#fff;border-color:rgba(255,255,255,.5);background:transparent}
.fk-cst{position:relative;flex:1;min-height:0;display:flex;align-items:center;justify-content:center;padding:14px;cursor:crosshair;user-select:none;touch-action:none}
.fk-cimg{max-width:100%;max-height:100%;object-fit:contain;display:block;pointer-events:none;box-shadow:0 0 0 1px rgba(255,255,255,.3)}
.fk-cbox{position:absolute;border:2px solid #fff;outline:2px dashed #2457E6;background:rgba(36,87,230,.12);box-shadow:0 0 0 9999px rgba(0,0,0,.45);pointer-events:none}
.fk-cst{overflow:hidden}.fk-cbar{position:relative;z-index:2}.fk-cov{background:#0F1620}
.fk-cacts .btn-primary{background:#2457E6;border-color:#fff;color:#fff}.fk-cacts .btn-primary:disabled{opacity:.55}
/* v833 (Kah Poh): FAB005 claim log — desktop: header "Amount (RM)", no RM in the cells (phone keeps "Amount: RM …"); buttons on one middle line (PDF no longer drops) */
table.f5-ht .f5-rmh{display:none}
@media (min-width:821px){ table.f5-ht .f5-rmh{display:inline} table.f5-ht td.f5-ha .f5-rmp{display:none} table.f5-ht td .btn,table.f5-ht td .md-date{vertical-align:middle} table.f5-ht td.f5-hpdf .btn{vertical-align:middle} }
/* v833 (Kah Poh): phone — these notes run across caption & value (own line under both): Adjusted contract sum, Retention, % of contract claimed */
@media (max-width:820px){
  .md-row.f5-inl.f5-wn > .md-v,.md-row.f5-inl.f5-wn .f5-vh{display:contents}
  .md-row.f5-inl.f5-wn .f5-vh > .md-hint{grid-column:1/-1;justify-self:stretch;text-align:left;margin-top:2px}
}
/* v835 (Kah Poh): Claims of this job — folded bar shows the last claim no.; PHONE card: Amount | PDF on one row, Paid date row = small box + Today + 📎 icon */
.f5-hlast{font-weight:500;color:var(--muted)}
@media (max-width:820px){
  table.f5-ht td.f5-ha{grid-column:1;grid-row:3;align-self:center}
  table.f5-ht td.f5-hpdf{grid-column:2;grid-row:3;display:flex;justify-content:flex-end;align-items:center;gap:6px}
  table.f5-ht td.f5-hpdf .btn{flex:none;width:auto;min-width:64px;min-height:36px}
  table.f5-ht td.f5-hpdf .btn:only-child{grid-column:auto}
  table.f5-ht td.f5-hp{grid-row:4;flex-wrap:nowrap;gap:6px}
  table.f5-ht td.f5-hp .md-date{grid-template-columns:120px 54px;gap:6px}
  table.f5-ht td.f5-hp input.md-dt{width:120px;max-width:120px;padding-left:5px;padding-right:5px;min-height:36px}
  table.f5-ht td.f5-hp .md-date .btn{width:54px;min-height:36px;padding-left:2px;padding-right:2px}
  table.f5-ht td.f5-hp > .f5-att{flex:none;width:40px;min-width:40px;min-height:36px;padding:0;justify-content:center;margin-left:auto}
  table.f5-ht td.f5-hp > .f5-att .f5-al,table.f5-ht td.f5-hp > .f5-att .f5-as{display:none}
  table.f5-ht td.f5-hpdf .f5-att .f5-al{display:none} table.f5-ht td.f5-hpdf .f5-att .f5-as{display:inline}
}
@media (max-width:820px){
  table.f5-ht tr{grid-template-columns:minmax(0,1fr) auto}
  table.f5-ht td.f5-ha{white-space:normal}
  table.f5-ht td:nth-child(3){white-space:nowrap}
  table.f5-ht td:nth-child(4){white-space:nowrap}
  table.f5-ht td.f5-hp{flex-wrap:wrap;row-gap:6px}
  table.f5-ht td.f5-hp::before{flex:1 0 auto}
  table.f5-ht td .f5-att{width:40px;min-width:40px;padding:0;justify-content:center}
  table.f5-ht td .f5-att .f5-al,table.f5-ht td .f5-att .f5-as{display:none!important}
  .f5-hhb > span{min-width:0}
}
/* v835b: phone claim card = flex rows (wraps safely at A+): No. | badge · Submitted | Certified · Amount | 📎 PDF · Paid date + Today + 📎 */
@media (max-width:820px){
  table.f5-ht tr{display:flex!important;flex-wrap:wrap;align-items:center;gap:6px 10px}
  table.f5-ht td{width:auto!important;min-width:0}
  table.f5-ht td:nth-child(1){flex:1 0 50%;max-width:none}
  table.f5-ht td:nth-child(2){flex:0 0 auto;margin-left:auto}
  table.f5-ht td:nth-child(3){flex:1 0 50%;white-space:nowrap}
  table.f5-ht td:nth-child(4){flex:1 0 auto;text-align:right;white-space:nowrap}
  table.f5-ht td.f5-ha{flex:1 1 auto;white-space:nowrap}
  table.f5-ht td.f5-hpdf{flex:0 0 auto;margin-left:auto}
  table.f5-ht td.f5-hp{flex:1 0 100%}
  table.f5-ht td.f5-hp > .f5-att{margin-left:0}
}
@media (max-width:820px){
  table.f5-ht td{order:1} table.f5-ht td.f5-hpdf{order:2} table.f5-ht td.f5-hp{order:3}
  table.f5-ht td.f5-hp::before{flex:none}
  table.f5-ht td.f5-hp .md-date{flex:none}
  table.f5-ht td .btn.f5-att{width:40px;min-width:40px;flex:none}
}
@media (max-width:820px){ table.f5-ht td.f5-hp::before{content:"Paid: "} table.f5-ht td.f5-hp{gap:6px} }
/* v836 (Kah Poh): phone 📎 = icon + short form "Att." / "+ Att.", same height as Today */
@media (max-width:820px){
  table.f5-ht td .btn.f5-att{width:auto;min-width:0;padding:0 8px;gap:4px}
  table.f5-ht td .btn.f5-att .f5-as{display:inline!important}
  table.f5-ht td.f5-hp input.md-dt,table.f5-ht td.f5-hp .md-date .btn,table.f5-ht td .btn.f5-att,table.f5-ht td.f5-hpdf .btn{height:38px;min-height:38px;box-sizing:border-box}
}
@media (max-width:820px){
  table.f5-ht td.f5-hp{gap:5px}
  table.f5-ht td.f5-hp .md-date{grid-template-columns:118px 52px;gap:5px}
  table.f5-ht td.f5-hp input.md-dt{width:118px;max-width:118px;padding-left:4px;padding-right:4px}
  table.f5-ht td.f5-hp .md-date .btn{width:52px}
  table.f5-ht td .btn.f5-att{padding:0 6px;gap:3px}
}
/* v837 (Kah Poh): Claims of this job — when open, its bar stays on top (under the form heading) while scrolling through the log */
.f5-hhb[aria-expanded="true"]{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px) + var(--ph,49px));z-index:2;background:var(--surface,#fff);box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
/* v838 (Kah Poh, phone): Today, Att. and PDF = same size (66px); Att. on the paid row lines up under PDF on the right; date box takes the rest */
@media (max-width:820px){
  table.f5-ht td.f5-hpdf .btn,table.f5-ht td .btn.f5-att,table.f5-ht td.f5-hp .md-date .btn{width:66px!important;min-width:66px!important;flex:0 0 66px;padding-left:2px!important;padding-right:2px!important;font-size:14px;justify-content:center}
  table.f5-ht td.f5-hp .md-date{flex:1 1 auto;display:grid;grid-template-columns:minmax(0,1fr) 66px;gap:5px;min-width:0}
  table.f5-ht td.f5-hp input.md-dt{width:100%!important;max-width:none!important;min-width:0}
  table.f5-ht td.f5-hp > .f5-att{margin-left:0}
}
@media (max-width:820px){ table.f5-ht td.f5-hp{flex-wrap:nowrap} table.f5-ht td.f5-hp .md-date{flex:1 1 0!important;width:auto!important;max-width:none!important} table.f5-ht td.f5-hp > .f5-att{flex:0 0 66px} }
@media (max-width:820px){
  table.f5-ht td.f5-hpdf .btn,table.f5-ht td .btn.f5-att,table.f5-ht td.f5-hp .md-date .btn{width:60px!important;min-width:60px!important;flex:0 0 60px}
  table.f5-ht td.f5-hp > .f5-att{flex:0 0 60px}
  table.f5-ht td.f5-hp .md-date{grid-template-columns:minmax(0,1fr) 60px;gap:4px}
  table.f5-ht td.f5-hp{gap:4px}
  table.f5-ht td .btn.f5-att{gap:2px}
}

/* v840 (Kah Poh, iPhone): while a form box has the cursor, extra space under the page so it can scroll past the keyboard to Cancel / Save (fk keyboard pad, 07) */
html.rv-kb main{padding-bottom:var(--rvkb,50vh)!important}

/* v848 (Kah Poh, phone): EXPAND BOX — while typing, a single-line box becomes a growing box (rv-xta, 10-home-shell) so a long value shows in full */
.inp.rv-xon{outline:2px solid var(--focus);outline-offset:0;border-color:var(--steel)}   /* v851: the box being typed in (its pop-up sits above it) */
textarea.inp.rv-xta{position:fixed;z-index:9500;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.35;box-sizing:border-box;font-family:inherit;margin:0;border:2px solid var(--steel);box-shadow:0 6px 20px rgba(15,30,50,.28);max-width:none}   /* v851 pop-up */
.rv-xpk{position:fixed;z-index:9500;pointer-events:none;box-sizing:border-box;padding:6px 10px;background:var(--surface);color:var(--ink);border:2px solid var(--steel);border-radius:6px;box-shadow:0 6px 20px rgba(15,30,50,.28);line-height:1.35;white-space:pre-wrap;overflow-wrap:anywhere}.rv-xpk[hidden]{display:none}   /* v1326 desktop: full value of a long box, under it while it has the cursor */

/* v849 (Kah Poh, phone): Equipment details edit — Qty box sized for 2 digits (64px; A+ still fits) & lined up with the Tag No. box
   (both rows start at the top; Qty column = its own width; note "= # of tags" on one line) */
@media (max-width:820px){
  .pd-form.pd-cmp{grid-template-columns:minmax(0,1fr) 80px}
  .pd-cmp > .pd-k-eqTag,.pd-cmp > .pd-k-eqQty{align-self:start;align-content:start}
  .pd-cmp .pd-k-eqQty .inp{width:64px;max-width:64px}
  .pd-cmp .pd-k-eqQty .pd-qtyauto{white-space:nowrap}
}

/* v853 (Kah Poh, computer): hand drag in every PDF preview */
@media (hover:hover) and (pointer:fine){ .memo-stage{cursor:grab} .memo-stage.pv-grabbing{cursor:grabbing;user-select:none} .memo-stage button,.memo-stage a{cursor:pointer} }

/* v854 (Kah Poh, desktop): Home / top bar photos zoomed out a bit — 100% of the width (was 108%; smaller would leave bare sides) */
@media (min-width:821px){ .hdr-sl{background-size:100% 100%,100% auto} }   /* v1094: back to 100% (Kah Poh tried 88% in v1093 — "go back") */

/* v856 (Kah Poh): FAB005 PDF status stamp (Submitted / Certified + date), top-right under the form no., clear of the title */
.f5-stamp{position:absolute;top:96px;right:50px;z-index:1;border:2px solid #3A1F8F;border-radius:6px;padding:5px 12px;color:#3A1F8F;font-size:11.5px;line-height:1.45;text-align:left;white-space:nowrap}
.f5-stamp.f5-stamp-c{border-color:#1F6FB2;color:#1F6FB2}
.f5-stamp .f5-sl b{display:inline-block;min-width:76px;letter-spacing:.06em}

/* v864 (Kah Poh): ED006 PDF — sentences justified (both edges straight); the last line of each stays left. The sharp PDF writer (08) keeps the spacing. */
.e6-sheet .e6-pi > :last-child,.e6-sheet .e6-pp,.e6-sheet .e6-psi > :last-child,.e6-sheet .e6-tx,.e6-sheet .e6-note,.e6-sheet .e6-lk:only-child{text-align:justify}

/* v865 (Kah Poh): open form heading — form no. as before, the form name (description) bold */
.panel-head h2 .fh-tt{font-weight:800;color:var(--ink)}

/* v866 (Kah Poh): Supplier › Job documents editor — tick boxes of the form (e.g. 16. Chemical composition) */
.tpj-grp{margin-bottom:-4px}.tpj-grp label{font-weight:700}
.field.tpj-tick{display:flex;align-items:center;gap:10px;min-height:40px;cursor:pointer}.field.tpj-tick input{width:22px;height:22px;margin:0;accent-color:var(--steel)}

/* v867 (Kah Poh): Projects › Job file — section headings inside a job (Our forms / 3rd party / MDR) + the "+ New for <job>" picker */
.jf-sh{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--muted,#5b6673);margin:12px 0 4px;padding-top:8px;border-top:1px solid var(--divider)}
.sp-forms > .jf-sh:first-of-type{border-top:0;margin-top:4px;padding-top:0}
.pm-sdw{display:flex;gap:8px;align-items:center}.pm-sdw>.inp{flex:1 1 auto;min-width:0}.pm-sdw>.btn{flex:0 0 auto;white-space:nowrap}@media (max-width:560px){ .pm-sdw{flex-wrap:wrap}.pm-sdw>.btn{margin-left:auto} }   /* v1321 Part Map: Copy client description */
/* v1313 rule 52: the 3rd party request form part inside its QC form (QC030) */
.tpj-req{margin:6px 0 10px}.tpj-req-add{margin:2px 8px 2px 0}
.tpj-req-g{display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;margin:8px 0 6px}.tpj-req-g .q2-f{min-width:0}.tpj-req-g .q2-f label{display:block;font-size:13px;font-weight:600;color:var(--muted);text-transform:none;letter-spacing:0;margin-bottom:3px}
.tpj-req-g .q2-f .inp{width:100%}.tpj-req-w,.tpj-req-gh{grid-column:1/-1}.tpj-req-gh{font-size:13px;font-weight:700;color:var(--muted);margin-top:4px}
.tpj-req-tick{display:flex;align-items:center;gap:8px;min-height:36px;font-size:15px;cursor:pointer}.tpj-req-tick input{width:20px;height:20px;flex:0 0 auto}
.tpj-req-ns{display:block;margin:6px 0 2px;white-space:normal;text-transform:none;letter-spacing:0;font-size:13.5px;line-height:1.35;padding:6px 10px}.tpj-req-ns[hidden]{display:none}
.tpj-req-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
@media (max-width:560px){ .tpj-req-g{grid-template-columns:1fr} }
/* v1312: Job file › Construction Dwg — one folded line per item */
.jf-dwg-g{display:flex;align-items:center;gap:8px;width:100%;margin:4px 0 0;padding:8px 14px;min-height:40px;border:0;border-top:1px solid var(--divider);background:var(--surface-2);color:var(--ink);font:inherit;font-size:14px;text-align:left;cursor:pointer}
.jf-dwg-g svg{flex:0 0 auto;width:16px;height:16px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .15s;transform:rotate(-90deg)}.jf-dwg-g[aria-expanded="true"] svg{transform:none}
.jf-dwg-gn{flex:1 1 auto;min-width:0;font-weight:700;overflow-wrap:anywhere}.jf-dwg-gc{flex:0 0 auto;color:var(--link);font-weight:600;font-size:13px;white-space:nowrap}
.jf-sh.jf-dwh{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.jf-sh.jf-dwh .btn{text-transform:none;letter-spacing:0}   /* v1310: Job file › Construction Dwg section + its link */
.jf-nb{display:flex;justify-content:flex-end;margin:2px 0 4px}.jf-nb .jf-new{width:auto;max-width:100%;font-weight:600;color:var(--link,#2457E6)}
@media (max-width:820px){ .jf-nb .jf-new{width:100%} }

/* v868 · v869 (Kah Poh): Supplier › 3rd Party Inspector — Fill for a job on the RIGHT of its form's row */
.tpi-drow{display:flex;align-items:center;gap:8px;margin-bottom:6px}.tpi-drow > .tpi-doc{margin-bottom:0}.tpi-drow > .tpi-doc{flex:1 1 auto;min-width:0}.tpi-drow > .tpi-fill{flex:0 0 auto;white-space:nowrap}

/* v870: MDR edit — Cancel reads ‹ Back until something changes */
.md-cancel.md-back svg,#mdHeadCancel.md-back svg{width:15px;height:15px;display:inline-block;vertical-align:-2px;margin-right:2px}

/* v872: Procurement › Purchase — stock code maker */
.stk-f{max-width:640px}
.stk-res{display:flex;align-items:baseline;gap:10px;margin-top:14px;padding-top:12px;border-top:1px solid var(--divider)}
.stk-rl{font-size:13px;color:var(--muted,#5b6673);font-weight:600}.stk-code{font-family:var(--mono);font-size:20px;letter-spacing:.06em}

/* v875: the portal's own drop-down list (Alt+↓ on a list box, computer) */
.xsel-l{position:fixed;z-index:9600;overflow:auto;background:var(--surface,#fff);color:var(--ink,#1C2530);border:1px solid var(--steel,#2457E6);border-radius:6px;box-shadow:0 8px 24px rgba(15,30,50,.25);padding:4px 0;font-size:15px;max-width:min(560px,96vw)}
.xsel-o{padding:6px 12px;cursor:default;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.xsel-o.on{background:var(--steel,#2457E6);color:#fff}.xsel-o.dis{color:var(--muted,#8A96A3)}
.xsel-g{padding:6px 10px 2px;font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted,#5b6673)}

/* v877 (Kah Poh): stock code rows — Caption | list box | its code, one row each (desktop + phone) */
.stk-rows{display:flex;flex-direction:column;gap:8px;max-width:680px}
.stk-row{display:grid;grid-template-columns:96px minmax(0,1fr) 48px;align-items:center;gap:10px}
.stk-l{font-size:13px;font-weight:700;color:var(--ink)}
.stk-c{font-family:var(--mono);font-size:16px;letter-spacing:.05em;text-align:left}.stk-c.stk-nc{color:#C62828}
@media (max-width:820px){ .stk-row{grid-template-columns:76px minmax(0,1fr) 40px;gap:8px} }

/* v880 stock code: UBS rules + code length */
.stk-len{margin-left:auto;font-size:13px;font-weight:700;color:var(--muted,#5b6673);font-variant-numeric:tabular-nums}
.stk-len.stk-over{color:#fff;background:#C62828;border-radius:4px;padding:2px 8px}
.stk-len.stk-over::before{content:"✕ Over · "}
.stk-rules{margin-top:14px;padding:10px 12px;border:1px solid var(--divider,#D5DBE1);border-radius:6px;font-size:14px;max-width:680px}
.stk-rules ol{margin:6px 0 0;padding-left:22px}.stk-rules li{margin:2px 0}
.stk-rl-list{margin:0;padding-left:22px;font-size:15px;line-height:1.5}.stk-rl-list li{margin:4px 0}

/* v883 Stock Code: categories & types tree */
.sc-tools{display:flex;gap:10px;align-items:center;margin-bottom:12px}.sc-tools .inp{flex:1;min-width:0;max-width:420px}
.sc-tree{display:flex;flex-direction:column;gap:6px}
.sc-cat{border:1px solid var(--divider,#D5DBE1);border-radius:6px;background:var(--surface,#fff)}
.sc-cat>summary{display:flex;align-items:center;gap:10px;padding:10px 12px;cursor:pointer;font-weight:600;list-style:none}
.sc-cat>summary::-webkit-details-marker{display:none}
.sc-cat>summary::before{content:"›";font-size:18px;line-height:1;transition:transform .15s;color:var(--muted,#5b6673)}
.sc-cat[open]>summary::before{transform:rotate(90deg)}
.sc-cnt{margin-left:auto;font-size:13px;font-weight:600;color:var(--muted,#5b6673);white-space:nowrap}
.sc-body{border-top:1px solid var(--divider,#D5DBE1);padding:4px 0}
.sc-r{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px;padding:5px 12px 5px calc(12px + (var(--lv) - 1) * 22px);font-size:14px}
.sc-r+.sc-r{border-top:1px solid var(--divider,#D5DBE1)}
.sc-r.sc-hit .sc-n{font-weight:700;text-decoration:underline;text-decoration-color:#2457E6;text-underline-offset:3px}
.sc-c{font-family:var(--mono);min-width:30px;font-size:14px}
.sc-c.sc-nc{font-family:inherit;font-size:12px;background:#F2C230;color:#1C2530;border-radius:4px;padding:1px 6px;white-space:nowrap}
.sc-l{font-size:12px;color:var(--muted,#5b6673);white-space:nowrap}
.sc-f{font-family:var(--mono);font-size:13px;color:var(--muted,#5b6673);white-space:nowrap}
@media (max-width:820px){ .sc-r{grid-template-columns:auto minmax(0,1fr) auto;padding-left:calc(10px + (var(--lv) - 1) * 14px);padding-right:10px}.sc-l{display:none} }
.sc-r[style*="--lv:1"] .sc-n,.sc-r[style*="--lv: 1"] .sc-n{font-weight:700}   /* v1019 (Kah Poh: "Pipes & Fittings is not bold"): the browser rewrites style="--lv:1" as "--lv: 1" once JS touches the style (frozen heading) → match both */

/* v884 stock code: Standard + no I / O */
.stk-c.stk-io{color:#C62828;text-decoration:underline wavy #C62828;text-underline-offset:4px}
.stk-iob{font-size:12px;font-weight:700;background:#F2C230;color:#1C2530;border-radius:4px;padding:2px 8px;white-space:nowrap}
.sc-c.sc-io{color:#C62828;text-decoration:underline wavy #C62828;text-underline-offset:3px}
.sc-c.sc-io::after{content:" ⚠";font-family:var(--font,inherit);text-decoration:none;display:inline-block}
.sc-std{display:flex;flex-direction:column;border:1px solid var(--divider,#D5DBE1);border-radius:6px;max-width:680px}
.sc-std .sc-r{grid-template-columns:96px minmax(0,1fr) auto}
.stk-c{overflow-wrap:anywhere;line-height:1.15}
@media (max-width:820px){ .stk-c{font-size:14px} .sc-std .sc-r{grid-template-columns:84px minmax(0,1fr) auto} .sc-cnt{white-space:normal;text-align:right;max-width:46%} .sc-cat>summary .sc-n{min-width:0} }
@media (max-width:820px){ .sc-std .sc-l{display:inline;white-space:normal;text-align:right} }

/* v886 stock code: Materials panel */
.sc-warn{display:inline-block;margin-left:8px;font-size:12px;font-weight:700;background:#F2C230;color:#1C2530;border-radius:4px;padding:1px 6px}
.sc-mr .sc-c{min-width:64px}
.sc-note{margin:0 0 10px;font-size:13px}
@media (max-width:820px){ .sc-mr{grid-template-columns:64px minmax(0,1fr) auto} .sc-mr .sc-l{display:inline} .sc-warn{margin-left:0;margin-top:3px} .sc-mr .sc-n{display:flex;flex-wrap:wrap;gap:2px 6px;align-items:center} }

/* v887 stock code: stainless material codes panel */
.sc-gfs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px}
.sc-gf{min-height:36px;padding:6px 12px;font-size:13px;font-weight:600;background:var(--surface,#fff);color:var(--ink);border:1px solid #8A96A3;border-radius:6px}
.sc-gf.on{background:#3A1F8F;color:#fff;border-color:#3A1F8F}
.sc-gr{grid-template-columns:44px minmax(0,1fr) auto auto}
.sc-b{display:inline-block;font-size:12px;font-weight:700;border-radius:4px;padding:2px 8px;white-space:nowrap;color:#fff}
.sc-b-use{background:#1F6FB2}.sc-b-res{background:#6B7785}.sc-b-np{background:#F2C230;color:#1C2530}
@media (max-width:820px){ .sc-gr{grid-template-columns:40px minmax(0,1fr) auto} .sc-gr .sc-f{display:none} .sc-gf{flex:1 1 calc(50% - 6px);justify-content:center} }

/* v888 not-placed grades: kind sub-headings, UNS as code */
.sc-kh{padding:8px 12px 4px;font-size:12px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--muted,#5b6673);border-top:1px solid var(--divider,#D5DBE1);background:var(--surface-2,#F5F7FA)}
.sc-kh:first-child{border-top:0}
.sc-np{grid-template-columns:72px minmax(0,1fr) auto auto}
.sc-uns{font-size:13px}
@media (max-width:820px){ .sc-np{grid-template-columns:66px minmax(0,1fr) auto} }
.sc-nn{font-size:13px;font-weight:400;color:var(--muted,#5b6673);font-style:italic}

/* v889 material codes: examples / notes line under the name */
.sc-ex{display:block;font-size:12px;font-weight:400;color:var(--muted,#5b6673);margin-top:2px}

/* v891: foldable sub-headings in Material codes */
.sc-kf{border-top:1px solid var(--divider,#D5DBE1)}
.sc-kf:first-child{border-top:0}
.sc-kf>summary.sc-kh{display:flex;align-items:baseline;gap:8px;cursor:pointer;list-style:none;border-top:0;padding:10px 12px;min-height:44px;box-sizing:border-box}
.sc-kf>summary.sc-kh::-webkit-details-marker{display:none}
.sc-kf>summary.sc-kh::before{content:"›";font-size:16px;line-height:1;transition:transform .15s;flex:none}
.sc-kf[open]>summary.sc-kh::before{transform:rotate(90deg)}
.sc-kt{flex:1;min-width:0}
.sc-kc{flex:none;text-transform:none;letter-spacing:0;font-weight:600;white-space:nowrap}
@media (max-width:820px){ .sc-kc{white-space:normal;text-align:right;max-width:40%} }

/* v894: Reserved ⇄ In use toggle */
.sc-tog{border:0;cursor:pointer;font:inherit;font-size:12px;font-weight:700;min-height:36px;padding:6px 10px;border-radius:6px;white-space:nowrap}
.sc-tog:focus-visible{outline:3px solid #3A1F8F;outline-offset:2px}
.sc-tog.sc-arm{background:#F2C230;color:#1C2530}
.stk-hint{margin:10px 0 0;font-size:14px}
@media (max-width:820px){ .sc-tog{min-height:44px} }
/* v895 (Kah Poh comment "move this selection a bit to the right, easy to spot"): in a drop-down list with section headings
   (e.g. Purchase › Material), the choices sit indented under their heading; headings get a divider line and stay on top while scrolling */
.xsel-g~.xsel-o{padding-left:30px}
.xsel-g{position:sticky;top:-4px;z-index:1;background:var(--surface-2,#F5F7FA);border-top:1px solid var(--divider,#D5DBE1);padding:7px 10px 5px;color:var(--navy,#3A1F8F)}
.xsel-g:first-child{border-top:0}

/* v896: foldable types in Categories & types */
.sc-tf>summary.sc-tsum{list-style:none;cursor:pointer}
.sc-tf>summary.sc-tsum::-webkit-details-marker{display:none}
.sc-tf>summary.sc-tsum .sc-c::before{content:"›";display:inline-block;width:12px;margin-left:-16px;transition:transform .15s;color:var(--muted,#5b6673)}
.sc-tf[open]>summary.sc-tsum .sc-c::before{transform:rotate(90deg)}
.sc-tc{font-weight:400;color:var(--muted,#5b6673);font-size:13px}
.sc-tf+.sc-r,.sc-r+.sc-tf,.sc-tf+.sc-tf,.sc-tf>summary+.sc-r,.sc-tf>summary+.sc-tf{border-top:1px solid var(--divider,#D5DBE1)}
.sc-ttree .sc-r{padding-left:calc(28px + (var(--lv) - 1) * 44px)}
@media (max-width:820px){ .sc-ttree .sc-r{padding-left:calc(26px + (var(--lv) - 1) * 26px)} }

/* v897: point-to-check badges in Categories & types (yellow = fix, blue = proposed new type) */
.sc-fl{display:inline-block;margin-left:8px;font-size:12px;font-weight:700;line-height:1.3;padding:2px 8px;border-radius:4px;white-space:nowrap;vertical-align:1px}
.sc-fl-fix{background:#F2C230;color:#1C2530}
.sc-fl-new{background:#2457E6;color:#fff}
.sc-cat>summary .sc-fl{flex:none;margin-left:0}
.sc-flx{color:#1C2530}
.sc-prop{background:#F5F7FA}
.sc-prop .sc-c,.sc-prop .sc-f{font-style:italic;color:#2457E6}
@media (max-width:820px){ .sc-fl{white-space:normal} }

/* v898: Points box (A B C D …) + letter chip in badges */
.sc-pts{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:8px;margin:0 0 12px}
.sc-pt{display:grid;grid-template-columns:auto 1fr;grid-template-rows:auto auto;column-gap:10px;align-items:center;text-align:left;font:inherit;cursor:pointer;background:var(--surface,#fff);border:2px solid #F2C230;border-radius:8px;padding:8px 10px;min-height:56px;color:#1C2530}
.sc-pt.on{border-color:#3A1F8F;box-shadow:0 0 0 2px #3A1F8F inset}
.sc-pt.all-done{border-color:#1F6FB2}
.sc-pt:focus-visible{outline:3px solid #3A1F8F;outline-offset:2px}
.sc-ptl{grid-row:1/3;display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:6px;background:#F2C230;color:#1C2530;font-size:18px}
.sc-pt.all-done .sc-ptl{background:#1F6FB2;color:#fff}
.sc-ptt{font-weight:700;font-size:14px;line-height:1.25}
.sc-ptc{font-size:12px;color:var(--muted,#5b6673)}
.sc-flt{display:inline-block;min-width:16px;margin-right:6px;padding:0 4px;border-radius:3px;background:#1C2530;color:#fff;text-align:center}
.sc-fl-new .sc-flt{background:#fff;color:#2457E6}
.sc-fl-done{background:#1F6FB2;color:#fff}
.sc-fl-done .sc-flt{background:#fff;color:#1F6FB2}
@media (max-width:820px){ .sc-pts{grid-template-columns:1fr 1fr} .sc-pt{min-height:60px} }
@media (max-width:820px){ .sc-tools{flex-wrap:wrap} .sc-tools .inp{flex:1 1 100%;min-width:0} }

/* v899: old (don't use) type */
.sc-fl-old{background:#6B7785;color:#fff}
/* v901 (Kah Poh comment: dark desktop — list headings hard to read): drop-down section headings + Stock Code points use theme colours */
.xsel-g{color:var(--ink,#1C2530);background:var(--surface-2,#EEF2F6)}
.sc-flx{color:var(--ink,#1C2530)}
.sc-prop{background:var(--surface-2,#EEF2F6)}
.sc-pt{color:var(--ink,#1C2530)}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-prop .sc-c,:root:not([data-theme="light"]) .sc-prop .sc-f{color:#7FB0EA} }
:root[data-theme="dark"] .sc-prop .sc-c,:root[data-theme="dark"] .sc-prop .sc-f{color:#7FB0EA}
/* v902 (Kah Poh "don't use the same colour as the list"): section headings get their own solid band — grey band + dark text (light mode), slate band + dark text (dark mode); choices stay plain, picked choice stays steel blue */
.xsel-g{background:#D5DBE1;color:#1C2530;font-weight:800;border-top:2px solid #8A96A3}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .xsel-g{background:#8A96A3;color:#0E1520;border-top-color:#C9D3DE} }
:root[data-theme="dark"] .xsel-g{background:#8A96A3;color:#0E1520;border-top-color:#C9D3DE}
/* v911 allowed materials per type (Stock Code › Categories & types) */
.sc-ml{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:4px;font-size:12.5px;font-weight:400}
.sc-mlk{font-weight:700;color:var(--navy,#3A1F8F)}
.sc-mli{color:var(--muted,#5b6673)}
.sc-mc{display:inline-block;background:#2457E6;color:#fff;border-radius:4px;padding:1px 7px;font-weight:600;white-space:nowrap}
.sc-med{font:inherit;font-size:12.5px;font-weight:700;color:#2457E6;background:none;border:1px solid #2457E6;border-radius:5px;padding:2px 8px;cursor:pointer;min-height:28px}
.sc-med.sc-med-on{visibility:hidden}   /* v1021 (Kah Poh): while its editor is open the ✎ button is hidden — the frozen heading has the ✕ (space kept, nothing jumps) */
.sc-med-box{margin:6px 12px 10px calc(12px + (var(--lv,1)) * 22px);border:2px solid #2457E6;border-radius:8px;padding:10px 12px;background:var(--surface,#fff)}
.sc-mehd{display:flex;flex-wrap:wrap;gap:8px;align-items:baseline;font-size:15px}
.sc-mecnt{font-size:13px;color:var(--muted,#5b6673);white-space:nowrap}   /* v1018: "✓ 1" never splits */
.sc-mebody{display:grid;gap:4px;margin:6px 0}
.sc-mef>summary{cursor:pointer;padding:8px 6px;min-height:40px;box-sizing:border-box;border-top:1px solid var(--divider,#D5DBE1)}
.sc-mecn{color:#2457E6;font-weight:700;white-space:nowrap}
.sc-mecb{display:flex;align-items:center;gap:8px;padding:5px 6px 5px 22px;font-size:14px;min-height:36px;box-sizing:border-box;cursor:pointer}
.sc-mecb input{width:20px;height:20px;flex:none}
.sc-megrp{padding-left:10px;font-weight:700;color:var(--navy,#3A1F8F);border-top:1px dashed var(--divider,#D5DBE1)}
.sc-meall{padding-left:6px;font-weight:700}
.sc-meact{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
@media (max-width:820px){ .sc-med-box{margin-left:8px;margin-right:8px} .sc-med{min-height:36px} }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-mlk,:root:not([data-theme="light"]) .sc-megrp{color:#9DBBE0} :root:not([data-theme="light"]) .sc-med,:root:not([data-theme="light"]) .sc-mecn{color:#8FB6EA;border-color:#8FB6EA} }
:root[data-theme="dark"] .sc-mlk,:root[data-theme="dark"] .sc-megrp{color:#9DBBE0}
:root[data-theme="dark"] .sc-med,:root[data-theme="dark"] .sc-mecn{color:#8FB6EA;border-color:#8FB6EA}
/* v912 Material line folds */
.sc-mlt{display:inline-flex;align-items:center;gap:6px;font:inherit;background:none;border:0;padding:4px 2px;cursor:pointer;min-height:32px;color:inherit}
.sc-mla{display:inline-block;transition:transform .15s;font-size:15px;color:var(--muted,#5b6673)}
.sc-ml.on .sc-mla{transform:rotate(90deg)}
.sc-ml .sc-mcs{display:none}
.sc-ml.on .sc-mcs{display:contents}
@media (max-width:820px){ .sc-mlt{min-height:40px} }
/* v914 material editor: group folds with a tick box on the heading */
.sc-meg>summary.sc-megs{display:flex;align-items:center;flex-wrap:wrap;gap:6px;cursor:pointer;padding:6px 6px 6px 10px;min-height:40px;box-sizing:border-box;border-top:1px dashed var(--divider,#D5DBE1);color:var(--navy,#3A1F8F)}
.sc-meg>summary.sc-megs input{width:20px;height:20px;flex:none;margin:0}
.sc-meg>summary.sc-megs::after{content:"›";margin-left:auto;font-size:16px;transition:transform .15s;color:var(--muted,#5b6673)}
.sc-meg[open]>summary.sc-megs::after{transform:rotate(90deg)}
.sc-meg .sc-mecb{padding-left:40px}
.sc-mecc{color:var(--muted,#5b6673);font-weight:400}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-meg>summary.sc-megs{color:#9DBBE0} }
:root[data-theme="dark"] .sc-meg>summary.sc-megs{color:#9DBBE0}
.sc-meonly{padding-left:6px;font-weight:700;border:1px solid var(--divider,#D5DBE1);border-radius:6px;margin:4px 0;width:max-content;max-width:100%}
/* v916 status badge on each material line in the picker */
.sc-mecb .sc-b{margin-left:auto;flex:none}
.sc-mecb>span:nth-child(2){flex:1;min-width:0}
.sc-mehid{font-size:13px;background:#F2C230;color:#1C2530;border-radius:6px;padding:6px 10px;margin:4px 0}
/* v917 in-use view: flat groups (heading + codes, no fold) */
.sc-megflat>.sc-megs{display:flex;align-items:center;flex-wrap:wrap;gap:6px;padding:6px 6px 6px 10px;min-height:40px;box-sizing:border-box;border-top:1px dashed var(--divider,#D5DBE1);color:var(--navy,#3A1F8F);cursor:pointer}
.sc-megflat>.sc-megs input{width:20px;height:20px;flex:none;margin:0}
.sc-megflat .sc-mecb{padding-left:40px}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-megflat>.sc-megs{color:#9DBBE0} }
:root[data-theme="dark"] .sc-megflat>.sc-megs{color:#9DBBE0}
/* v919 (Kah Poh "make the grouping view easy to see like the project list"): an opened group = one card — header band on top, its rows below with the steel-blue left line (same as Project list › opened job) */
.sc-cat[open]{border-color:var(--frame,#8A96A3)}
.sc-cat[open]>summary{background:var(--surface-2,#F5F7FA);border-radius:6px 6px 0 0}
.sc-cat[open]>.sc-body{border-left:4px solid var(--steel,#2457E6);border-bottom-left-radius:6px}
.sc-cat[open]>summary{background-image:linear-gradient(var(--steel,#2457E6),var(--steel,#2457E6));background-size:4px 100%;background-repeat:no-repeat}   /* v1048 (Kah Poh circle): the blue bar also runs beside the category heading */
.sc-ttree .sc-tf[open]{margin:6px 8px 8px;border:1px solid var(--frame,#8A96A3);border-left:4px solid var(--steel,#2457E6);border-radius:6px;background:var(--surface,#fff)}
.sc-ttree .sc-tf[open]>summary{background:var(--surface-2,#F5F7FA);border-radius:2px 6px 0 0}
.sc-ttree .sc-tf[open]>summary+.sc-r,.sc-ttree .sc-tf[open]>summary+.sc-tf{border-top:1px solid var(--divider,#D5DBE1)}
.sc-kf[open]{margin:4px 8px 8px;border:1px solid var(--frame,#8A96A3);border-left:4px solid var(--steel,#2457E6);border-radius:6px}
.sc-kf[open]>summary.sc-kh{background:var(--surface-2,#F5F7FA)}
@media (max-width:820px){ .sc-ttree .sc-tf[open],.sc-kf[open]{margin:4px 2px 6px} .sc-cat>summary .sc-ml{font-size:12px} }
@media (max-width:820px){ .sc-medl{display:none} .sc-r .sc-med{min-width:40px;min-height:36px;padding:2px 10px} .sc-ml{margin-top:2px} }
/* v920 ✎ button = own column right of the name, before the full code; bigger icon */
.sc-ttree .sc-r{grid-template-columns:auto minmax(0,1fr) auto auto auto}
@media (max-width:820px){ .sc-ttree .sc-r{grid-template-columns:auto minmax(0,1fr) auto auto} }
.sc-r .sc-med{font-size:20px;line-height:1;display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:44px;min-height:40px;padding:4px 10px}
.sc-r .sc-med .sc-medl{font-size:13px}
.sc-medx{display:block;min-width:44px}
/* v923 compact category rows */
.sc-ttree .sc-cat>summary{gap:8px;padding:8px 10px}
.sc-ttree .sc-cat>summary .sc-n{display:flex;flex-direction:column;gap:2px;flex:1;min-width:0}
.sc-cfl{font-size:12.5px;font-weight:500;color:var(--muted,#5b6673);letter-spacing:.2px}
.sc-cfl b{color:var(--steel,#2457E6);font-weight:800}
.sc-ttree .sc-cat>summary .sc-cnt{white-space:nowrap;font-size:13px}
.sc-cfb{flex:none;font-size:20px;min-width:44px;min-height:40px;display:inline-flex;align-items:center;justify-content:center}
@media (max-width:820px){ .sc-ttree .sc-cat>summary .sc-cnt{max-width:none} .sc-ttree .sc-cat>summary .sc-fl{white-space:nowrap;font-size:11.5px;padding:2px 6px} }
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-cfl b{color:#8FB6EA} }
:root[data-theme="dark"] .sc-cfl b{color:#8FB6EA}
.sc-cmeta{display:flex;flex-wrap:wrap;align-items:center;gap:4px 8px;font-weight:500}
.sc-cmeta .sc-cnt{margin:0;text-align:left;max-width:none;color:var(--muted,#5b6673)}
.sc-cmeta .sc-fl{margin-left:0}
.sc-cnm{font-weight:700}
.sc-cfl b{letter-spacing:2px}
/* v925 frozen headings of open groups (top set by stkStick) */
#scBody .sc-stk{position:sticky;z-index:2;background:var(--surface-2,#EEF2F6);box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
#scBody .sc-med-box>.sc-mehd.sc-stk{background:var(--surface,#fff);margin:0 -12px;padding:8px 12px}
#scBody details.sc-mef[open]>summary.sc-stk,#scBody details.sc-meg[open]>summary.sc-stk{background:var(--surface,#fff)}
#scBody .sc-stk.sc-stk-under{visibility:hidden}
/* v926 picker header = the type row (code · name · full code · ✕) */
.sc-meht{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px}
.sc-mehn{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:15px}
.sc-mehs{font-size:13px;color:var(--muted,#5b6673);font-weight:500}
.sc-mehs .sc-mecnt{font-size:13px}
.sc-mex{font-size:18px;min-width:40px;min-height:40px}
/* v928 frozen category = one slim line (families + count hidden while frozen) */
#scBody details.sc-cat>summary.sc-stk-now{padding-top:6px;padding-bottom:6px}
#scBody details.sc-cat>summary.sc-stk-now .sc-cfl,#scBody details.sc-cat>summary.sc-stk-now .sc-cmeta{display:none}
#scBody details.sc-cat>summary.sc-stk-now .sc-cfb{min-height:32px;font-size:17px}
/* v929 (Kah Poh "the name goes across; the button moves down beside Families & types"): category heading on a grid */
.sc-ttree .sc-cat>summary{display:grid;grid-template-columns:auto auto minmax(0,1fr) auto;grid-template-areas:"ch code name name" "ch code fam btn" "ch code meta btn";align-items:center;column-gap:10px;row-gap:2px}
.sc-ttree .sc-cat>summary::before{grid-area:ch}
.sc-ttree .sc-cat>summary>.sc-c{grid-area:code}
.sc-ttree .sc-cat>summary>.sc-n{display:contents}
.sc-ttree .sc-cat>summary .sc-cnm{grid-area:name}
.sc-ttree .sc-cat>summary .sc-cfl{grid-area:fam}
.sc-ttree .sc-cat>summary .sc-cmeta{grid-area:meta}
.sc-ttree .sc-cat>summary>.sc-cfb{grid-area:btn;align-self:center}
#scBody .sc-ttree details.sc-cat>summary.sc-stk-now{grid-template-areas:"ch code name btn"}
@media (max-width:820px){ .sc-cfl b{letter-spacing:.5px} }
/* v930 (Kah Poh "same for types: name on top; icon box rectangular; one row with Material · 3 and the code") */
.sc-ttree .sc-r{grid-template-columns:auto minmax(0,1fr) auto auto auto;grid-template-areas:"code name name name name" "code mat lvl full btn";row-gap:2px}   /* v956 (Kah Poh comment): ✎ Material at the far right, code left of it (desktop; phone already v953) */
.sc-ttree .sc-r>.sc-c{grid-area:code}
.sc-ttree .sc-r>.sc-n{display:contents}
.sc-ttree .sc-r .sc-tnm{grid-area:name;min-width:0}
.sc-ttree .sc-r .sc-ml{grid-area:mat;margin-top:0}
.sc-ttree .sc-r>.sc-med,.sc-ttree .sc-r>.sc-medx{grid-area:btn}
.sc-ttree .sc-r>.sc-l{grid-area:lvl}
.sc-ttree .sc-r>.sc-f{grid-area:full}
.sc-ttree .sc-r>.sc-med,.sc-ttree .sc-r>.sc-spw>.sc-spe{min-width:64px;min-height:32px;padding:2px 12px;font-size:17px}
.sc-ttree .sc-r .sc-ml.on .sc-mcs{display:flex;flex-wrap:wrap;gap:4px;width:100%}
@media (max-width:820px){ .sc-ttree .sc-r{grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"code name name name" "code mat btn full"} }
.sc-ttree .sc-r .sc-mlt{white-space:nowrap}.sc-ttree .sc-r .sc-mli{font-size:12px}
/* v931 picker: Save bar only when changed, stuck to the bottom of the screen */
.sc-med-box>.sc-meact{position:sticky;bottom:calc(env(safe-area-inset-bottom,0px) + 10px);z-index:4;align-items:center;background:var(--surface,#fff);border:2px solid #2457E6;border-radius:8px;padding:8px 10px;box-shadow:0 6px 16px rgba(28,37,48,.25)}
.sc-med-box>.sc-meact[hidden]{display:none}
.sc-mebn{font-weight:700;color:var(--navy,#3A1F8F)}
.sc-meclr{margin-top:6px}
/* v932 picker header: name across on top; Material · n picked · code · ✕ in one row */
.sc-meht{grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"code name name btn" "code sub full full";row-gap:2px}   /* v1029 (Kah Poh): ✕ up on the name row, caption (+ i) left & code right on the 2nd row — was 4 things on one line */
.sc-meht>.sc-c{grid-area:code}
.sc-meht>.sc-mehnm{grid-area:name;font-size:15px}
.sc-mehnm .sc-mehsub{font-weight:400}   /* v1016: caption behind the dot = normal weight */
.sc-meht>.sc-mehs{grid-area:sub}
.sc-meht>.sc-f{grid-area:full;justify-self:end}
.sc-meht>.sc-mex{grid-area:btn;min-width:56px;min-height:32px;font-size:16px}
.sc-mehd-min .sc-meht{grid-template-areas:"sub sub full btn"}
.sc-mehs>.sc-pni{margin-left:8px}   /* v1029 i beside the caption */
.sc-picknote{margin:6px 0 4px}
.sc-mehd-min .sc-meht>.sc-c{display:none}
/* v936: category ✎ Families header = name | ✕ on one row */
.sc-meht.sc-meht-cat{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"name btn"}

/* v937 style check (Kah Poh "audit & style check, do according to my style") */
.sc-mehd>.sc-meht{flex:1 1 100%;min-width:0}   /* ✕ at the right end of the picker / families header (desktop had it next to the name) */
.sc-mebn{color:var(--ink,#1C2530)}   /* "Changed —" readable in dark mode */
.sc-mc.sc-mc-off{background:#6B7785;color:#fff}   /* pick not offered in Purchase (reserved / hold / family off) */
.sc-cfl{text-wrap:balance}   /* family letters wrap evenly, no single letter left alone */
.sc-tf>summary.sc-tsum .sc-c::before{margin-left:-18px;margin-right:6px}
@media (max-width:820px){
  .sc-ttree .sc-r{column-gap:6px}
  .sc-ttree .sc-r>.sc-med,.sc-ttree .sc-r>.sc-spw>.sc-spe{min-width:44px;padding:2px 8px}
  .sc-ttree .sc-r>.sc-f{font-size:12px}
  .sc-ttree .sc-r .sc-mlt{font-size:12.5px}
  .sc-gfs{display:grid;grid-template-columns:1fr 1fr}
  .sc-gf{white-space:normal;line-height:1.2}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary{display:grid;grid-template-columns:auto auto minmax(0,1fr);grid-template-areas:"ch code name" "ch code cnt";column-gap:10px;row-gap:2px}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary::before{grid-area:ch}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary>.sc-c{grid-area:code}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary>.sc-n{grid-area:name;min-width:0}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary>.sc-cnt{grid-area:cnt;margin:0;text-align:left;max-width:none;white-space:normal}
  .sc-tree:not(.sc-ttree)>details.sc-cat>summary>.sc-fl{grid-column:3;justify-self:start}
  /* deeper type rows (inside an open type): name | ✎ on top, Material · n | code below — room for the Material toggle */
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum){grid-template-areas:"code name name btn" "code mat mat full"}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-f{justify-self:end}
  .lede-i{position:relative}
  .lede-i::after{content:"";position:absolute;inset:-10px}   /* bigger tap area, same look */
}
/* v938 "i" button on a panel heading (Material codes note) */
.sc-h2i{display:flex;align-items:center;gap:8px}
.sc-h2i>.lede-i{margin-left:0;flex:none;text-transform:none;letter-spacing:0}
.sc-gnote ul{margin:0 0 12px;padding-left:18px}
.sc-gnote li{margin:0 0 4px}
.panel.collapsed .sc-h2i>.lede-i{display:none}   /* v939: "i" hidden while the panel is folded */
/* v940 product form */
.sc-mefm{margin:2px 0 8px;font-size:13px}
.sc-tfm{color:var(--muted,#5b6673)}
/* v947 (Kah Poh, phone screenshot "sub sub item"): rows inside an open type — code pushed left (more room for the name), name on its own top line,
   then "Material · n ›" | ✎ (smaller) | full code in ONE row; opened chips run full width underneath */
@media (max-width:820px){
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum){padding-left:calc(26px + (var(--lv) - 2) * 10px);column-gap:6px;row-gap:4px;
    grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"code name name name" "code mat btn full" "code chips chips chips"}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-c{align-self:start;padding-top:1px}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-ml:not(.sc-mli){display:contents}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-ml:not(.sc-mli)>.sc-mlt{grid-area:mat;justify-self:start;align-self:center;padding-right:4px;white-space:normal;text-align:left;min-width:0}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-ml:not(.sc-mli)>.sc-mcs{grid-area:chips}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-mli{grid-area:mat;align-self:center}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-med,.sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-spw>.sc-spe{min-height:30px;min-width:40px;padding:0 8px;font-size:15px;align-self:center;justify-self:end}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-medx{align-self:center;justify-self:end}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-f{align-self:center;justify-self:end}
}
/* v949 (Kah Poh screenshot: Pipe Holder / Clamp Union with sub-types sat further right than Sanitary Pipe / End Cap): a sub-type that has its own
   sub-types (fold row) gets the SAME layout & left edge as one without — code at the same left (chevron in front of it), name on top,
   Material · n | ✎ | code below. Open nested box: no side margin, so its heading stays in line with its neighbours. */
@media (max-width:820px){
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum{padding-left:calc(26px + (var(--lv) - 2) * 10px);column-gap:6px;row-gap:4px;
    grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"code name name name" "code mat btn full" "code chips chips chips"}
  .sc-ttree .sc-tf .sc-tf[open]{margin-left:2px;margin-right:2px}   /* v1041 (Kah Poh): white gap between the blue lines smaller */
  .sc-ttree .sc-tf .sc-tf[open]>summary.sc-tsum{padding-left:calc(20px + (var(--lv) - 2) * 10px)}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-c{align-self:start;padding-top:1px}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-ml:not(.sc-mli){display:contents}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-ml:not(.sc-mli)>.sc-mlt{grid-area:mat;justify-self:start;align-self:center;padding-right:4px;white-space:normal;text-align:left;min-width:0}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-ml:not(.sc-mli)>.sc-mcs{grid-area:chips}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-mli{grid-area:mat;align-self:center}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-med,.sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-spw>.sc-spe{min-height:30px;min-width:40px;padding:0 8px;font-size:15px;align-self:center;justify-self:end}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-medx{align-self:center;justify-self:end}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-f{align-self:center;justify-self:end}
}
/* v950 (Kah Poh "line overlap, make it compact & easy view"): open sub-box keeps a 6px gap from the outer blue line (no double line);
   chevron sits clear of the box line; inherited "Material: as …" on ONE line (… if long); rows a bit tighter */
@media (max-width:820px){
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum),.sc-ttree .sc-tf .sc-tf>summary.sc-tsum{padding-top:7px;padding-bottom:7px;row-gap:2px}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-c::before{margin-left:-15px;margin-right:3px;width:12px}
  .sc-ttree .sc-tf .sc-r .sc-mli{min-width:0;font-size:12.5px}
  .sc-ttree .sc-tf .sc-r>.sc-med,.sc-ttree .sc-tf .sc-r>.sc-spw>.sc-spe{min-height:28px}
}
@media (max-width:820px){ .sc-ttree .sc-tf .sc-r>.sc-f,.sc-ttree .sc-tf .sc-tf>summary>.sc-f{font-size:11.5px} }   /* v950: a little more room for Material */
/* v950: bigger text size (A+ and up) on phone — not enough width for 3 items: the full code moves up to the name row (right), Material | ✎ below */
@media (max-width:820px){
  body[style*="zoom"] .sc-ttree .sc-tf .sc-r:not(.sc-tsum),body[style*="zoom"] .sc-ttree .sc-tf .sc-tf>summary.sc-tsum{grid-template-areas:"code name name full" "code mat mat btn" "code chips chips chips"}
  body[style*="zoom"] .sc-ttree .sc-tf .sc-r>.sc-f,body[style*="zoom"] .sc-ttree .sc-tf .sc-tf>summary>.sc-f{align-self:start;padding-top:2px}
}
/* v951 (Kah Poh "all sub sub sub left line gap, make it even"): every nested open box sits the SAME 6px inside the blue line above it (was 4px, then 6px) */
@media (max-width:820px){ .sc-ttree .sc-tf[open],.sc-kf[open]{margin-left:2px;margin-right:2px} }   /* v1041 gap 6 → 2 */
/* v952 (Kah Poh "align the E, E0, E1"): an open type's heading code lines up with its sub-types' codes — top-level rows (in the category body)
   40px, the open top-level heading 30px (its box adds 10), sub-type rows 30px (+14 per deeper level), an open sub-type heading 20px (its box adds 10) */
@media (max-width:820px){
  .sc-ttree .sc-body>.sc-r,.sc-ttree .sc-body>.sc-tf>summary.sc-tsum{padding-left:36px}   /* v1049: closed top-level row = open heading (30 + its box 2 margin + 4 line = 36); was 40 since the v1041 margin change */
  .sc-ttree .sc-body>.sc-tf[open]>summary.sc-tsum{padding-left:30px}
}
/* v953 (Kah Poh "material buttons align on the right side, the code on the left of it"): phone type rows — ✎ always at the far right,
   full code just before it; open boxes no right margin so every ✎ lines up down the page (left 6px gaps unchanged) */
@media (max-width:820px){
  .sc-ttree .sc-r,.sc-ttree .sc-tf .sc-r:not(.sc-tsum),.sc-ttree .sc-tf .sc-tf>summary.sc-tsum{grid-template-columns:auto minmax(0,1fr) auto auto;grid-template-areas:"code name name name" "code mat full btn" "code chips chips chips"}
  .sc-ttree .sc-r>.sc-f{justify-self:end}
  .sc-ttree .sc-r>.sc-med,.sc-ttree .sc-r>.sc-medx{justify-self:end}
  .sc-ttree .sc-tf[open],.sc-kf[open],.sc-ttree .sc-tf .sc-tf[open]{margin-right:0}
  .sc-ttree .sc-r{padding-right:10px}
  body[style*="zoom"] .sc-ttree .sc-tf .sc-r:not(.sc-tsum),body[style*="zoom"] .sc-ttree .sc-tf .sc-tf>summary.sc-tsum{grid-template-areas:"code name name full" "code mat mat btn" "code chips chips chips"}
}
/* v957 (Kah Poh, desktop: "03 › E — E0, E1 … move a bit left; E0 has no sub, E1 has sub — align the E"): step 44 → 32px per level, and every open
   sub-type box (margin 8 + steel line 4 = 12px) is taken back from the padding, so codes of rows with & without sub-types sit on one line */
@media (min-width:821px){
  .sc-ttree .sc-r{padding-left:calc(28px + (var(--lv) - 1) * 32px)}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum),.sc-ttree .sc-tf .sc-tf>summary.sc-tsum{padding-left:calc(28px + (var(--lv) - 1) * 32px - (var(--lv) - 2) * 12px)}
  .sc-ttree .sc-tf .sc-tf[open]>summary.sc-tsum{padding-left:calc(28px + (var(--lv) - 1) * 32px - (var(--lv) - 1) * 12px)}
}
/* v958: category ✎ gets the caption "Families" on desktop — same look as ✎ Material */
.sc-cfb{gap:4px;padding:2px 12px;font-size:17px;line-height:1}
.sc-cfb .sc-medl{font-size:13px}
/* v959 SPEC + NO MATERIAL (Stock Code) */
.sc-mnone{display:inline-block;background:#6B7785;color:#fff;font-weight:700;font-size:12px;border-radius:4px;padding:1px 7px;line-height:1.5}
.sc-menone{margin:2px 0 8px;padding:8px 10px;border:1px solid var(--divider,#D5DBE1);border-radius:6px;background:var(--surface-2,#F5F7FA)}
.sc-menone .sc-mecb{padding:0;min-height:32px}
.sc-menone .sc-ni{margin-left:8px;vertical-align:middle}
.sc-menote{margin:4px 0 2px 28px;font-size:13.5px;line-height:1.4;color:var(--muted,#5b6673)}
/* v1023: one icon per ✎ editor button (Families / Material / Spec & Finishing) */
.sc-med .sc-ico{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;vertical-align:-4px;flex:none}
.sc-spl{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px;margin-top:4px;font-size:12px;font-weight:400}
.sc-spc{display:inline-block;border:1px solid #2457E6;color:#2457E6;border-radius:4px;padding:0 6px;line-height:1.6;font-weight:600;white-space:nowrap}
.sc-spc.sc-spi{border-color:var(--frame,#8A96A3);color:var(--muted,#5b6673);font-weight:500}
.sc-spb{font:inherit;font-size:12px;font-weight:700;color:#2457E6;background:none;border:1px dashed #2457E6;border-radius:4px;padding:0 8px;min-height:24px;cursor:pointer}
.sc-spl-0 .sc-spb{border-color:var(--frame,#8A96A3);color:var(--muted,#5b6673)}
.sc-spbody{display:flex;flex-direction:column;gap:10px}
.sc-spr{display:grid;grid-template-columns:64px minmax(0,1fr);gap:4px 10px;align-items:center}
.sc-spr>div{grid-column:2}
.sc-spk{font-weight:700;font-size:13px}
.sc-spo{margin:0;font-size:12.5px;color:var(--muted,#5b6673);line-height:1.5}
.sc-spdraft{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:0 0 10px;font-size:13px}
.sc-spnote{margin:6px 12px}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sc-spc:not(.sc-spi),:root:not([data-theme="light"]) .sc-spb{color:#8FB6EA;border-color:#8FB6EA} }
:root[data-theme="dark"] .sc-spc:not(.sc-spi),:root[data-theme="dark"] .sc-spb{color:#8FB6EA;border-color:#8FB6EA}
@media (max-width:820px){ .sc-spb{min-height:32px;padding:0 10px} .sc-spr{grid-template-columns:52px minmax(0,1fr)} }
/* v960: Spec lists › "Which types have spec" table (phone → cards) */
.sc-sptab{width:calc(100% - 24px);margin:4px 12px 10px;border-collapse:collapse;font-size:13px}
.sc-sptab th{text-align:left;font-size:12px;color:var(--muted,#5b6673);font-weight:700;padding:6px 8px;border-bottom:2px solid var(--divider,#D5DBE1)}
.sc-sptab td{padding:6px 8px;border-bottom:1px solid var(--divider,#D5DBE1);vertical-align:top}
.sc-sptab tr.sc-sptc td{background:var(--surface-2,#F5F7FA);font-weight:600;padding-top:8px}
.sc-sptab .sc-sptf code{font-weight:700;white-space:nowrap}
.sc-sptab td.sc-sptu{color:var(--muted,#5b6673)}
.sc-sptab td.sc-sptn{color:var(--muted,#5b6673)}
.sc-sptk{display:none}
.sc-spnone{margin:0 12px 10px;font-size:13px}
@media (max-width:820px){
  .sc-sptab,.sc-sptab tbody,.sc-sptab tr,.sc-sptab td{display:block;width:auto}
  .sc-sptab{margin:4px 8px 10px}
  .sc-sptab thead{display:none}
  .sc-sptab tr{border-bottom:1px solid var(--divider,#D5DBE1);padding:6px 4px;display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:10px}
  .sc-sptab tr.sc-sptc{display:block;padding:0}
  .sc-sptab td{border:0;padding:1px 0}
  .sc-sptab td.sc-sptf{grid-row:1/span 5}
  .sc-sptab td:not(.sc-sptf){grid-column:2}
  .sc-sptab tr.sc-sptc td{padding:6px 8px}
  .sc-sptk{display:inline;color:var(--muted,#5b6673);font-size:12px}
  .sc-spnone{margin:0 8px 10px}
}

/* v961 Finishing: "Stainless only / Carbon steel only" tag on a finishing list option; Finishing row in the ✎ Spec & finishing editor */
.sc-fnfor{margin-left:6px;font-size:11.5px;vertical-align:1px}
.sc-spr.sc-fnr{padding-top:10px;border-top:1px solid var(--divider,#D5DBE1)}
@media (max-width:820px){ .sc-spr.sc-fnr{grid-template-columns:minmax(0,1fr)} .sc-spr.sc-fnr>div{grid-column:1} }
/* v964: Purchase — type with no material list: note under the boxes */
.stk-nolist{margin:10px 0 0;font-size:13.5px;line-height:1.6}
.stk-nolist .sc-b{margin-right:8px}
.stk-nolist a{color:var(--link,#2457E6);font-weight:600}

/* v967: "Which types have spec & finishing" — gap below it when folded (it sits outside the list stack), inner category folds */
details.sc-spwt:not([open]){margin-bottom:6px}
.sc-spwl{margin:4px 0 8px}

/* v968 (Kah Poh): type row — Spec line under the Material line, Finishing line under it, ✎ Spec on the Finishing line in the ✎ Material column, same size */
.sc-ttree .sc-r>.sc-spw{grid-column:2/-1;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:10px;row-gap:4px;align-items:center;margin-top:4px}
.sc-ttree .sc-r>.sc-spw>.sc-spl{margin-top:0;grid-column:1}
.sc-ttree .sc-r>.sc-spw>.sc-spl-s{grid-row:1}
.sc-ttree .sc-r>.sc-spw>.sc-spl-f{grid-row:2}
.sc-ttree .sc-r>.sc-spw>.sc-spe{grid-column:2;grid-row:2;justify-self:end}
.sc-ttree .sc-r>.sc-spw>.sc-spl-s:only-child,.sc-ttree .sc-r>.sc-spw>.sc-spl-f:empty{min-height:0}
@media (min-width:821px){ .sc-ttree .sc-r>.sc-med,.sc-ttree .sc-r>.sc-spw>.sc-spe{min-width:104px} }   /* v968: ✎ Material & ✎ Spec same width on desktop */
/* v969 (Kah Poh "reduce the big gap, make it compact"): type rows — Material toggle no taller than the ✎ button, tighter Spec / Finishing lines */
.sc-ttree .sc-r .sc-mlt,.sc-ttree .sc-r .sc-ml:not(.sc-mli)>.sc-mlt{min-height:28px;padding-top:0;padding-bottom:0}
.sc-ttree .sc-r>.sc-spw{margin-top:2px;row-gap:3px}
.sc-ttree .sc-r>.sc-spw .sc-spc{line-height:1.45}
@media (max-width:820px){ .sc-ttree .sc-r{row-gap:1px} }

/* v970 (Kah Poh): ✎ Material group heading — tick box | one flowing text line; wrapped lines start under the text, never under the box */
.sc-meg>summary.sc-megs,.sc-megflat>.sc-megs{flex-wrap:nowrap;align-items:flex-start}
.sc-meg>summary.sc-megs input,.sc-megflat>.sc-megs input{margin-top:1px}
.sc-megt{flex:1 1 auto;min-width:0;line-height:1.4}
.sc-megt>*{display:inline}

/* v994 Projects › New Project — v999: compact (boxes sized to what goes in them) */
.nwp-three{flex:1 1 100%;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 14px}
@media (max-width:560px){ .nwp-three{grid-template-columns:1fr} }.nwp-file{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.nwp-fn{overflow-wrap:anywhere;color:var(--ink)}
.nwp-act{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}
.nwp-save{justify-content:flex-end}
.nwp-msg{margin-top:12px;padding:9px 12px;border-radius:6px;border:1px solid var(--divider);background:var(--surface-2);color:var(--ink);font-weight:500}
.nwp-msg.warn{background:#F2C230;color:#1C2530;border-color:#C99A00}
.nwp-note{display:block;margin-top:4px;font-size:13.5px;color:var(--muted,var(--ink))}
.nwp-items{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.nwp-item{border:1px solid var(--divider);border-left:4px solid var(--steel);border-radius:6px;padding:10px 12px;background:var(--surface)}
.nwp-itop{display:flex;justify-content:space-between;align-items:center;margin-bottom:8px}
.nwp-list{display:flex;flex-direction:column;gap:6px}
.nwp-li{display:flex;gap:10px;align-items:center;flex-wrap:wrap;padding:6px 0;border-bottom:1px solid var(--divider)}
.nwp-delb{margin-left:auto}
.nwp-li{flex-wrap:nowrap}.nwp-li > span:not(.status):not(.muted){flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
@media (max-width:560px){ .nwp-li{flex-wrap:wrap} }
.nwp-act{align-items:center}.nwp-act .nwp-msg{margin:0}.nwp-act #nwpRead{display:inline-flex;align-items:center;gap:6px}.nwp-act #nwpRead .al-aiico svg{width:18px;height:18px}


/* v1010 New Project = FAB005-style kit rows (md-row) */
.nwp-jrow{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.nwp-jrow .nwp-note{margin:0}
.nwp-amtv{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.nwp-amtv .nwp-note{margin:0}
.md-v .inp.nwp-job{width:104px;max-width:104px}.md-v .inp.nwp-s{width:84px;max-width:84px}.md-v .inp.nwp-m{width:150px;max-width:150px}.md-v .inp.nwp-t{width:176px;max-width:176px}.md-v .inp.nwp-p{width:196px;max-width:196px}
#nwpForm .md-row{padding:6px 0}
@media (max-width:820px){ #nwpForm .md-row.md-inl .md-v select.inp{max-width:66vw;min-width:0} #nwpForm .md-row.md-inl .nwp-amtv{align-items:flex-end} #nwpForm .md-row.md-inl .nwp-file{justify-content:flex-end} #nwpForm .nwp-item{padding:6px 10px} }

/* v1012 New Project — group 2 (his mock): one panel, bands, heading actions, Today, unit inside amount boxes, messages under their button */
#nwpForm > .panel > .panel-head{flex-wrap:wrap;align-items:center}
#nwpForm > .panel > .panel-head h2{flex:1 1 auto}
.nwp-band{background:var(--surface-2);border-top:1px solid var(--divider);border-bottom:1px solid var(--divider);padding:6px 12px;margin:10px -16px 0;font-size:12.5px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.nwp-band:first-child{margin-top:0}
.nwp-btns{display:flex;gap:8px;flex-wrap:wrap;flex:0 0 auto}
.nwp-rmw{position:relative;display:block;width:150px}.nwp-rmw .nwp-rmt{position:absolute;left:10px;top:50%;transform:translateY(-50%);color:var(--muted);font-size:15px;pointer-events:none}
.md-v .nwp-rmw .inp{width:100%;max-width:none;padding-left:44px;text-align:right;font-variant-numeric:tabular-nums}.nwp-rmw3 .inp{padding-left:52px!important}
#nwpForm .md-date .inp.md-dt{width:138px;max-width:138px;flex:0 0 auto}
@media (max-width:820px){
  .nwp-band{margin-left:-12px;margin-right:-12px}
  #nwpForm .md-l{text-transform:none;letter-spacing:0;font-size:13.5px;color:var(--ink);font-weight:600}
  #nwpForm .md-row.md-inl{flex-wrap:nowrap}
  #nwpForm .md-row.md-inl .md-date{flex-wrap:nowrap}
  #nwpForm .md-row.md-inl .md-date .inp.md-dt{width:132px;max-width:132px;flex:0 0 auto;padding-left:8px;padding-right:6px}
  #nwpForm .md-row.md-inl .md-date .btn{padding-left:10px;padding-right:10px;flex:0 0 auto}
  #nwpForm .md-row.md-inl .md-err{display:none}
}

/* v1013 New Project — fixes: nothing covers a box; messages float; long pick-lists wide */
body:has(#view-newproject:not([hidden])) #foldFab{display:none!important}   /* the round Back / Move-to-top button hides while this form is open */
.nwp-act{flex-direction:row;flex-wrap:wrap;align-items:center;gap:8px 10px}
.nwp-act .nwp-msg{position:static;margin:0;flex:0 1 auto;min-width:0;padding:3px 8px;font-size:13px;line-height:1.25;white-space:normal}   /* beside the button; no room → wraps to its own line under it */
#nwpForm > .panel > .panel-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;grid-template-areas:"t m a";align-items:center;gap:6px 10px}
#nwpForm > .panel > .panel-head h2{grid-area:t;flex:none}#nwpForm > .panel > .panel-head #nwpBar{grid-area:a}
.nwp-hmsg{grid-area:m;justify-self:start;align-self:center;margin:0;padding:2px 8px;font-size:12.5px;line-height:1.2;max-width:100%;max-height:34px;overflow:hidden;white-space:normal;box-sizing:border-box}   /* in the heading, beside the buttons; no room (phone) → its own line under them */
@media (max-width:820px){ #nwpForm > .panel > .panel-head{grid-template-columns:minmax(0,1fr) auto;grid-template-areas:"t a"} .nwp-hmsg{grid-area:t;justify-self:stretch;font-size:12.5px;line-height:1.2} #nwpForm > .panel > .panel-head:has(.nwp-hmsg:not([hidden])) h2{visibility:hidden} #nwpForm > .panel > .panel-head{min-height:46px} }   /* phone: the message takes the title's place (same cell) → the heading never grows */
#nwpForm .md-v .nwp-pick select.inp{width:100%;max-width:480px}
.nwp-pick{min-width:0}.nwp-pos{display:none;font-size:13px;color:var(--muted);margin-top:3px;min-height:1px}
@media (max-width:820px){ .nwp-pos{display:block} }
.nwp-clv{display:flex;flex-direction:column;gap:4px;align-items:flex-start;max-width:480px}.nwp-clv .inp{width:100%}.nwp-clnote:empty{display:none}
#nwpForm > .panel > .panel-head{min-height:46px}

/* v1016 phone: while the AI chip (bottom-left) is up, the page gets empty space at its end so every box can scroll above the chip */
@media (max-width:820px){ body:has(#aiChip) main{padding-bottom:calc(env(safe-area-inset-bottom,0px) + 120px)} }

/* v1017 phone with text size A+ (rv_zoom 125): the form is narrower → short rows STACK (caption on top, value under) like FAB005 (v815) instead of cutting the caption */
#nwpForm .md-form{container-type:inline-size;container-name:nwpform}
@container nwpform (max-width:300px){
  #nwpForm .md-row.md-inl{display:grid;grid-template-columns:minmax(0,1fr);gap:4px}
  #nwpForm .md-row.md-inl > .md-c{display:none}
  #nwpForm .md-row.md-inl > .md-v{justify-self:start;text-align:left}
  #nwpForm .md-row.md-inl .nwp-amtv{align-items:flex-start}
  #nwpForm .md-row.md-inl .nwp-file{justify-content:flex-start}
  #nwpForm .md-row.md-inl .nwp-jrow{justify-content:flex-start}
}

/* v1018 phone: Qty | Unit in the same row (two halves); A+ (narrow form) → stacked again */
.nwp-qu{display:contents}
@media (max-width:820px){ .nwp-qu{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 14px} .nwp-qu > .md-row{min-width:0} .nwp-qu .md-v .inp.nwp-s{width:78px;max-width:78px} }
@container nwpform (max-width:300px){ .nwp-qu{grid-template-columns:minmax(0,1fr)} }

/* v1020 NUMBER BOX (phone): the see-through type=number box over a numeric box while typing */
.rv-nbx{position:fixed;z-index:30;margin:0;box-sizing:border-box;background:transparent;border:0;outline:0;box-shadow:none;-moz-appearance:textfield;appearance:textfield}
.rv-nbx::-webkit-outer-spin-button,.rv-nbx::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.rv-non{color:transparent!important;-webkit-text-fill-color:transparent;caret-color:transparent}
.rv-non:disabled{opacity:1;background:var(--surface);-webkit-text-fill-color:transparent}
/* v1017: centre dot (·) = separator between different values — bold & a little bigger everywhere on screen (JS wraps it: rvDots in 01-core) */
.rv-dot{font-weight:800;font-size:1.3em;line-height:0;margin:0 -.07em}   /* v1039 (Kah Poh): less space before & after the dot — the spaces around " · " in the text stay, the dot pulls them in */

/* v1030 Rules panel › material list matrix (Category · Type 1 · Type 2) */
.sc-mx{margin-top:14px;padding-top:10px;border-top:1px solid var(--divider,#D5DBE1)}
.sc-mxh{margin:0 0 4px;font-size:15px;font-weight:700;color:var(--ink,#1C2530)}   /* v1042: navy was invisible in dark mode */
.sc-mxp{margin:0 0 8px;font-size:13.5px;line-height:1.4}
.sc-mxtab{width:100%;border-collapse:collapse;font-size:13.5px}
.sc-mxtab th{text-align:left;font-size:12px;color:var(--muted,#5b6673);font-weight:700;padding:6px 8px;border-bottom:2px solid var(--divider,#D5DBE1)}
.sc-mxtab td{padding:6px 8px;border-bottom:1px solid var(--divider,#D5DBE1);vertical-align:top}
@media (max-width:820px){
  .sc-mxtab,.sc-mxtab tbody,.sc-mxtab tr,.sc-mxtab td{display:block;width:auto}
  .sc-mxtab thead{display:none}
  .sc-mxtab tr{padding:6px 2px;border-bottom:1px solid var(--divider,#D5DBE1)}
  .sc-mxtab td{border:0;padding:1px 0}
  .sc-mxtab td::before{content:attr(data-k) ": ";color:var(--muted,#5b6673);font-size:12.5px}
  .sc-mxtab td:last-child::before{content:"→ ";color:var(--muted,#5b6673)}
}
.sc-mxtab td.sc-mxn{width:34px;color:var(--ink,#1C2530)}   /* v1033 row number */
@media (max-width:820px){ .sc-mxtab td.sc-mxn{width:auto;padding-bottom:2px} .sc-mxtab td.sc-mxn::before{content:"Row ";font-weight:400} }
/* v1036 / v1037 tick directly under the code number (same column, same left edge) */
.sc-ttree .sc-r>.sc-cw{grid-area:code;display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.sc-ttree .sc-tf .sc-r:not(.sc-tsum)>.sc-cw,.sc-ttree .sc-tf .sc-tf>summary.sc-tsum>.sc-cw{align-self:start;padding-top:1px}
.sc-bkw{position:relative;display:inline-flex;align-items:center;justify-content:flex-start;margin:0;padding:0;cursor:pointer}
.sc-bkw::after{content:"";position:absolute;inset:-8px -6px}   /* v1051: -10 → -6 sideways so the tap area no longer reaches the fold arrow */
.sc-bk{width:20px;height:20px;margin:0;accent-color:#1F6FB2;cursor:pointer}
.sc-bk:disabled{cursor:default;opacity:.7}
@media (hover:hover){ .sc-bkw:hover .sc-bk:not(:disabled){outline:2px solid #2457E6;outline-offset:2px} }
rv-w{display:inline}   /* v1040 keeps text · text as ONE flex item (see rvDots) */
.sc-ttree .sc-r>.sc-cw>.sc-c{min-width:0}   /* v1041 (Kah Poh): code → caption gap smaller — the code column is only as wide as the code (or the tick) */
/* v1043 frozen TYPE line = one slim line on phone (code + name) — see stkStuck */
@media (max-width:820px){
  #scBody .sc-ttree summary.sc-stk-slim{padding-top:7px;padding-bottom:6px;row-gap:0;min-height:0}
  #scBody .sc-ttree summary.sc-stk-slim .sc-ml,#scBody .sc-ttree summary.sc-stk-slim .sc-spw,#scBody .sc-ttree summary.sc-stk-slim .sc-med,#scBody .sc-ttree summary.sc-stk-slim .sc-medx,#scBody .sc-ttree summary.sc-stk-slim .sc-f,#scBody .sc-ttree summary.sc-stk-slim .sc-l,#scBody .sc-ttree summary.sc-stk-slim .sc-tnm>span{display:none}
  /* v1048 (Kah Poh: the code & caption must already sit where the slim line has them): the tick keeps its column width (so the caption stays put) but takes no height */
  #scBody .sc-ttree summary.sc-stk-slim .sc-bkw{height:0;overflow:hidden;visibility:hidden}
  .sc-ttree .sc-body>.sc-tf>summary.sc-tsum{padding-top:7px}
  .sc-ttree .sc-body>.sc-tf>summary.sc-tsum>.sc-cw{align-self:start;padding-top:1px}   /* type 1 (E): code on the NAME row (was centred over all rows) */
}
#scBody .sc-stk-clip{overflow:hidden}   /* v1045 frozen line shrinking bit by bit (stkCollapse) */
/* v1046 (Kah Poh: "make the divider clearer for the header"): every frozen line (category + type) gets a clear slate line under it — stacked lines (03 / E / E1) are easy to tell apart */
#scBody .sc-ttree details[open]>summary.sc-stk{border-bottom:1px solid var(--frame,#8A96A3)}
#scBody details.sc-cat[open]>summary.sc-stk{background-image:linear-gradient(var(--steel,#2457E6),var(--steel,#2457E6));background-size:4px 100%;background-repeat:no-repeat}   /* v1048: the blue bar also beside the FROZEN category heading */
/* v1050 (Kah Poh 1 Nov, "limit space in phone — no child indent; the blueprint must be clear"): PHONE — every level (category, type 1, type 2, sub-type rows, sub-sub rows; open or closed)
   has its arrow, code, tick and caption on ONE vertical line each. Code at 76px from the category body (= the top-level rows); each nested open box adds 6px (2 margin + 4 line),
   so the padding gets 6px less per level. Arrow always 18px before the code, code column 20px + 6px gap → caption. Test t34.js. */
@media (max-width:820px){
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum){padding-left:calc(30px - (var(--lv) - 2) * 6px)}
  .sc-ttree .sc-tf .sc-tf>summary.sc-tsum{padding-left:calc(30px - (var(--lv) - 2) * 6px)}
  .sc-ttree .sc-tf .sc-tf[open]>summary.sc-tsum{padding-left:calc(24px - (var(--lv) - 2) * 6px)}
  #scBody .sc-ttree summary.sc-tsum .sc-c::before{margin-left:-18px;margin-right:6px;width:12px}
  .sc-ttree .sc-r>.sc-cw{min-width:20px}
  #scBody .sc-ttree .sc-cat>summary{grid-template-columns:12px 20px minmax(0,1fr) auto;column-gap:6px;padding-left:22px}
}
/* v1052 (Kah Poh 1 Nov, Tank details photo: "blue not covering the header & gap like categories" — Stock Code pattern, kahpoh-style §14.3.1 + §13.5):
   (1) an OPEN box's 4px steel bar also runs beside its heading — Production / Equipment details bar, Item details job heading, Job file job heading, Project list job card (phone);
   (2) phone: nested blue lines 2px apart (job line › details line › equipment card line); desktop keeps a 6px gap. Heading text keeps its place open / closed (closed = same room, no bar). */
.pd-sec{border-left:4px solid transparent}
.pd-sec.open{border-left-color:var(--steel)}
.pd-sec > .pd-hbar{padding-left:6px}
.pd-sec > .pd-in{border-left:0;padding-left:6px}
.pj-xbox .pd-sec{margin-left:-6px}
.it-panel .pd-sec{margin-left:-12px}
.it-panel:not(.collapsed) > .panel-head{box-shadow:inset 4px 0 0 var(--steel)}
.sp-job.on > .sp-jh{box-shadow:inset 4px 0 0 var(--steel)}
@media (max-width:820px){
  .pd-sec > .pd-in{padding-left:2px}
  .pj-xbox .pd-sec{margin-left:-8px}
  .it-panel .pd-sec{margin-left:-16px}
  table.stack-pj tr.pj-open{border-left:4px solid var(--steel);padding-left:7px}
  /* v1053 (Kah Poh video: "the child line can be seen while pulled up"): the FROZEN item row reaches left to the job line (white strip),
     so the details line & tank card lines slide fully BEHIND it (Stock Code: a frozen line covers its children's bars) */
  .pj-xbox table.stack-it tr.it-frz{box-shadow:-10px 0 0 0 var(--surface),0 3px 6px -3px rgba(28,37,48,.35)}
  .it-panel table.stack-it tr.it-frz{box-shadow:-18px 0 0 0 var(--surface),0 3px 6px -3px rgba(28,37,48,.35)}
}

/* v1055 (Kah Poh 1 Nov, iPhone shots): (1) Stock Code › Standards on phone — code column was 84px (name far right, "America" ran into "e.g."): code | name | e.g. note, note wraps on the right;
   (2) Spec / Finishing list option badges (Only M80 … / Only G10 …) wrap INSIDE the box (were nowrap → ran off the edge);
   (3) list note with more than 1 sentence = first sentence + blue i (stkListNote). */
@media (max-width:820px){ .sc-std .sc-r{grid-template-columns:22px auto minmax(0,1fr);column-gap:12px} .sc-std .sc-l{min-width:0;overflow-wrap:anywhere} }
.sc-n .sc-fnfor{white-space:normal;max-width:100%;box-sizing:border-box;overflow-wrap:anywhere}
.sc-lnw .sc-ln1{margin-bottom:0} .sc-lnw .sc-ln1 .lede-i{vertical-align:middle;margin-left:2px}
/* v1056: header note > 2 lines → blue i in its caption, only while that heading is open (stkN2) */
.sc-n2i{flex:none;margin-left:6px;text-transform:none;letter-spacing:0;vertical-align:middle}
details:not([open])>summary .sc-n2i,.panel.collapsed .sc-n2i{display:none}
.sc-n2c{display:flex;align-items:center;flex-wrap:wrap;gap:0 2px}
/* v1084 MATERIAL FLOW: ✎ Material source line "Allowed from F1 · n" + "All families" tick; row badge; Rules Matrix 1 PDF button */
.sc-mesrc{display:flex;align-items:center;flex-wrap:wrap;gap:4px 12px;margin:2px 0 6px;font-size:13.5px}
.sc-mesrt{font-weight:700;color:var(--ink,#1C2530)}
.sc-mesrc .sc-meall{padding:0 8px;min-height:36px;border:1px solid var(--divider,#D5DBE1);border-radius:6px;font-weight:600}
.sc-ml .sc-allf{flex:none;margin:0;font-size:12px;line-height:1.45;white-space:nowrap}   /* v1088 (Kah Poh): a box like "Finishing as E", on its own line, same left edge */
.sc-ml .sc-allbr{flex-basis:100%;height:0}
.sc-mxpdf{display:inline-flex;align-items:center;gap:6px;margin-top:2px}
.sc-mxpdf .sc-ico{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2}
/* v1088 (Kah Poh): phone rows are a grid (the material line is display:contents) → the "⚠ All families" box sits in the same column as "Finishing as E" */
@media (max-width:820px){
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-ml:not(.sc-mli)>.sc-allf,.sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-ml:not(.sc-mli)>.sc-allf{grid-column:2/-1;justify-self:start}
  .sc-ttree .sc-tf .sc-r:not(.sc-tsum) .sc-ml:not(.sc-mli)>.sc-allbr,.sc-ttree .sc-tf .sc-tf>summary.sc-tsum .sc-ml:not(.sc-mli)>.sc-allbr{display:none}
}
/* v1089: Type 1 of a "no material" category — "Families S C" / "No material" + ✎ Families on its own line in the name area */
.sc-tfw{display:flex;align-items:center;flex-wrap:wrap;gap:4px 8px;margin-top:4px;font-size:12.5px}
.sc-tfw .sc-tfl{color:var(--muted,#5b6673)}
.sc-tfw .sc-tfb{min-height:32px;padding:2px 10px}
@media (max-width:820px){ .sc-tfw .sc-tfb{min-width:40px;min-height:36px} }

/* v1095 QC030 Positive Material Identification Report (Kah Poh 4 Nov) — sheet = QC016 frame; editor cards like QC016 rows */
.q30-ti{font-size:18px}
.q30-info .q16-dcol{grid-template-columns:170px 1fr}
.q30-info .q16-det{row-gap:3px}
.qc-sheet table.q30-tb{table-layout:fixed}
.qc-sheet table.q30-tb th,.qc-sheet table.q30-tb td{font-size:13px;padding:0 3px;width:auto}
.q30-tb col.q30-w-no{width:32px}.q30-tb col.q30-w-part{width:118px}.q30-tb col.q30-w-heat{width:92px}.q30-tb col.q30-w-mat{width:84px}.q30-tb col.q30-w-sp{width:36px}.q30-tb col.q30-w-res{width:72px}   /* v1099 (Kah Poh): narrower fixed columns → element columns wider (limits not congested) */
.qc-sheet .q30-tb td.q30-l{text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.qc-sheet .q30-tb td.q30-res{font-weight:700;white-space:nowrap}
.q30-con{border:1.5px solid #000;border-top:0;padding:6px 10px;font-size:13.5px;display:flex;flex-direction:column;gap:4px}
.q30-cr{display:grid;grid-template-columns:110px 1fr;gap:6px;min-height:18px}
/* editor */
.q30-elf{max-width:420px;margin:8px 0 4px}.q30-elf .q2-f label{font-size:13px;text-transform:none;letter-spacing:0}
.q30-ll,.q30-rl{display:flex;flex-direction:column;margin:8px 0 4px;border:1px solid var(--divider);border-radius:6px;background:var(--surface)}
.q30-lc,.q30-rc{display:flex;flex-direction:column;gap:6px;padding:8px;border-top:1px solid var(--divider)}
.q30-lc:first-child,.q30-rc:first-child{border-top:0}
.q30-lh{display:grid;grid-template-columns:24px minmax(0,1fr) 36px;gap:6px;align-items:center}
.q30-rh{display:grid;grid-template-columns:24px minmax(0,1.6fr) minmax(0,1.2fr) 64px 36px;gap:6px;align-items:center}
.q30-no{text-align:center;color:var(--muted)}
.q30-lc .inp,.q30-rc .inp{min-height:38px;padding:5px 8px;width:100%;min-width:0}
.q30-lc .icon-btn,.q30-rc .icon-btn{width:34px;height:34px}
.q30-rv{display:flex;gap:10px;align-items:flex-end;padding-left:30px;flex-wrap:wrap}
.q30-eg{display:flex;gap:8px;flex-wrap:wrap;flex:1 1 auto;min-width:0}
.q30-lc .q30-eg{padding-left:30px}
.q30-ec{display:flex;flex-direction:column;gap:2px;flex:0 0 auto}
.q30-es{font-size:12.5px;font-weight:600;color:var(--muted)}
.q30-rc .q30-n{width:78px}
.q30-mm{display:flex;align-items:center;gap:4px}.q30-lc .q30-n{width:72px}.q30-to{color:var(--muted)}
.q30-seg{flex:0 0 auto}.q30-seg .q16-sb{min-height:38px}
.q30-sec{border:1px solid var(--divider);border-left:4px solid var(--steel);border-radius:6px;background:var(--surface);margin:8px 0 10px;padding-bottom:6px}
.q30-sec > .q30-lc{border-top:0}
.q30-sh{display:flex;align-items:center;gap:8px;width:calc(100% - 38px);margin:6px 0 0 30px;padding:6px 8px;border:0;border-radius:6px;background:var(--surface-2,transparent);color:var(--muted);font:inherit;font-size:12.5px;font-weight:600;text-transform:uppercase;letter-spacing:.04em;cursor:pointer;text-align:left}
.q30-sh .status{text-transform:none;letter-spacing:0}
.q30-chev{margin-left:auto;display:inline-flex;transition:transform .15s}.q30-chev svg{width:18px;height:18px}.q30-chev.on{transform:rotate(180deg)}
.q30-lf{display:flex;align-items:center;gap:8px;padding:8px}.q30-lf .btn{flex:none}
.q30-mdone{margin:2px 0 0 30px;align-self:flex-start}
.q30-subh{display:flex;align-items:center;justify-content:space-between;gap:8px}.q30-fa{flex:none;text-transform:none;letter-spacing:0}
.q30-sec .q30-rl{margin:4px 8px 4px 30px}
.q30-adds{margin:6px 8px 4px 30px}
@media (max-width:820px){ .q30-sec .q30-rl,.q30-adds{margin-left:8px} .q30-sh{margin-left:8px;width:calc(100% - 16px)} .q30-lf{flex-wrap:wrap} .q30-lf .q30-rs{flex:1 1 calc(100% - 40px)} .q30-lf .btn{margin-left:auto} .q30-mdone{margin-left:28px} }
.q30-rf{display:flex;align-items:center;gap:8px;padding:8px;border-top:1px solid var(--divider)}.q30-rf:first-child{border-top:0}
.q30-rs{flex:1 1 auto;min-width:0;font-size:14px;line-height:1.35}.q30-rf .status{flex:none}.q30-rf .btn{flex:none}
.q30-done{flex:0 0 auto;margin-left:auto}
@media (max-width:820px){ .q30-rf{flex-wrap:wrap;row-gap:6px} .q30-rs{flex:1 1 calc(100% - 40px)} .q30-rf .status{margin-left:30px} .q30-rf .btn{margin-left:auto} .q30-done{flex:1 1 100%} }
.q30-ai{position:relative}.q30-ai .q2-ai-busy{margin:0 0 8px}
.q30-att .q30-aib{margin-left:4px}
.q30-att{display:flex;align-items:center;gap:8px;margin:4px 0 8px;flex-wrap:wrap}
.q30-busy{display:flex;align-items:center;gap:8px;font-size:14px}
@media (max-width:820px){
  .q30-rh > .q30-no{grid-area:no}.q30-rh > input:nth-of-type(1){grid-area:part}.q30-rh > input:nth-of-type(2){grid-area:heat}.q30-rh > .q30-sp{grid-area:sp;width:100%}.q30-rh > .icon-btn{grid-area:del}
  .q30-rh{grid-template-columns:22px minmax(0,1fr) 64px 34px;grid-template-areas:"no part part del" ". heat sp sp"}
  .q30-rv,.q30-lc .q30-eg{padding-left:28px}
  .q30-eg{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}
  .q30-rc .q30-n{width:100%}
  .q30-lc .q30-eg{grid-template-columns:repeat(2,minmax(0,1fr))}.q30-lc .q30-n{width:100%;min-width:0;padding:5px 3px;text-align:center}.q30-mm{min-width:0}.q30-to{flex:none}
  .q30-seg{flex:1 1 100%}.q30-seg .q16-sb{flex:1 1 0}
}
@media (max-width:560px){ .q30-detg{grid-template-columns:1fr} }
.qc-sheet .q30-tb tr.q30-lim td{white-space:nowrap;font-weight:700}.qc-sheet .q30-tb tr.q30-lim td.q30-l{font-weight:400}   /* v1101: limits bold, as the 3rd party report */

.md-subh .lede-i{margin-left:8px;width:22px;height:22px;text-transform:none;letter-spacing:0}   /* v1108: "i" after a form section heading */
/* v1109 QC030 TEST RESULTS = refer to the attached 3rd party report + overall result (no results table) */
.q30-res{flex:1 1 auto;border:1.5px solid #000;border-top:0;padding:8px 10px 10px;font-size:14px;display:flex;flex-direction:column;gap:6px}
.q30-res .q30-cr{grid-template-columns:125px 1fr}.q30-big{font-size:15px;letter-spacing:.04em}
.qs-stamp img{transform:translateY(-2px)}   /* v1115 (Kah Poh): QC022 stamps sit ABOVE the signing line (were pushed down 30px over the line & title) */
/* v1117 QC032 Angle Inspection Report (A4 landscape, 4 × 12 nozzles) */
.q32-info{display:grid;grid-template-columns:1.35fr 1fr .9fr;border:1.5px solid #000;border-top:0;font-size:13px}
.q32-info>div{display:grid;grid-template-columns:auto 10px 1fr;row-gap:3px;align-content:start;padding:6px 10px;border-right:1px solid #000}.q32-info>div:last-child{border-right:0}
/* v1126: QC032 header holds Client & Item beside the title; info box = 3 compact rows */
.q8-tt.q32-tt{display:grid;grid-template-columns:auto minmax(0,1fr);gap:14px;align-items:center}
.q32-hkv{display:grid;grid-template-columns:auto 10px minmax(0,1fr);row-gap:2px;font-size:13px;justify-self:stretch;max-width:100%;border:1.5px solid #000;padding:3px 8px;line-height:1.3}   /* v1127 (Kah Poh comment): Client / Item boxed, takes all the width beside the title, long item name wraps */
.qc-sheet .q32-info{grid-template-columns:minmax(0,1fr) minmax(0,1.1fr) minmax(0,1fr);justify-content:stretch}   /* v1166 (Kah Poh): 1st & 3rd box even, the centre box 10% bigger */.qc-sheet .q32-info>div{row-gap:0;padding:3px 10px;line-height:1.35}
.q32-k{white-space:nowrap}.q32-c{text-align:center}.q32-v{overflow-wrap:anywhere}
.qc-sheet table.q32-tb{width:100%;border-collapse:collapse;border:1.5px solid #000;border-top:0;table-layout:fixed}
.qc-sheet .q32-tb th,.qc-sheet .q32-tb td{border:1px solid #000;text-align:center;padding:0 3px;height:21px;font-size:13.5px;color:#000;background:#fff}
.qc-sheet .q32-tb th{font-weight:700;font-size:11.5px;line-height:13px;padding:3px 1px;height:auto;text-transform:none;letter-spacing:0;white-space:nowrap}
.qc-sheet .q32-tb tr > :nth-child(4n){border-right:1.5px solid #000}.qc-sheet .q32-tb td.q32-no{font-weight:700}.qc-sheet .q32-tb td.q32-rm{text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.qc-sheet .q32-tb td.q32-rs.ng{font-weight:700}
.q32-sg{flex:1 1 auto;display:grid;grid-template-columns:1fr 1fr;border:1.5px solid #000;border-top:0;font-size:13px}
.q32-sb{display:flex;flex-direction:column;padding:6px 10px;border-right:1px solid #000}.q32-sb:last-child{border-right:0}
.q32-st{flex:1 1 auto;min-height:40px;position:relative;pointer-events:none}.q32-st img{position:absolute;left:50%;bottom:-4px;transform:translateX(-50%);max-height:70px;max-width:96px;object-fit:contain;opacity:.92;z-index:-1}.q32-st img.stamp-rd{width:70px;height:70px}
.q32-sl{border-top:1px solid #000;margin:0 6px 2px 60px}.q32-sn{display:grid;grid-template-columns:110px 1fr;gap:4px;min-height:17px}.q32-sn span:first-child{text-align:right}
/* editor */
.q32-note{font-size:12.5px;color:var(--muted)}
.q32-cnt{display:flex;gap:10px;align-items:flex-end;margin:8px 0 4px}.q32-cnt .q2-f{flex:0 1 260px}.q32-cnt .q2-f label{font-size:13px;text-transform:none;letter-spacing:0}
.q32-rl{display:flex;flex-direction:column;margin:8px 0 4px;border:1px solid var(--divider);border-radius:6px;background:var(--surface)}
.q32-r{display:grid;grid-template-columns:90px 120px 92px minmax(120px,1fr) 36px;gap:6px;align-items:center;padding:5px 8px;border-top:1px solid var(--divider)}.q32-r:first-child{border-top:0}
.q32-rh{font-size:12.5px;font-weight:600;color:var(--muted)}
.q32-r .inp{min-height:38px;padding:5px 8px;width:100%;min-width:0}.q32-r .q32-c-del{width:34px;height:34px}.q32-r .status{justify-content:center}
@media (max-width:820px){ .q32-r{grid-template-columns:64px 1fr 76px 34px;grid-template-areas:"no m res del" "rmk rmk rmk rmk";row-gap:5px} .q32-rh{grid-template-areas:"no m res del"}
  .q32-c-no{grid-area:no}.q32-c-m{grid-area:m}.q32-c-res{grid-area:res}.q32-c-del{grid-area:del}.q32-c-rmk{grid-area:rmk} .q32-rh .q32-c-rmk{display:none} .q32-r .inp{padding:5px 6px} }
@media (max-width:560px){ .q32-detg{grid-template-columns:1fr} }
/* v1118 QC032 sketch area (as the original sheet): up to 3 pictures side by side between the info block & the table */
.q32-sk{display:flex;gap:10px;align-items:center;justify-content:space-around;height:178px;border:1.5px solid #000;border-top:0;padding:6px 10px}
.q32-sk.q32-sk0{height:120px}
.q32-ski{flex:1 1 0;min-width:0;height:100%;position:relative}.q32-ski img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.q32-skl{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:4px 0 8px}
/* v1118 fit the page with the sketch: smaller info block, sketch 150px, rows 20px, compact signing */
.q32-info{font-size:12.5px}.q32-info>div{row-gap:1px;padding:4px 10px}
.q32-sk{height:150px}
.qc-sheet .q32-tb td{height:20px}
.q32-sb{padding:4px 10px}.q32-st{min-height:34px}.q32-st img{max-height:62px;max-width:84px}.q32-st img.stamp-rd{width:62px;height:62px}.q32-sn{min-height:16px;font-size:12.5px}
.q32-sk{height:136px}.qc-sheet .q32-tb td{height:19px}.qc-sheet .q32-tb th{padding:2px 1px}
/* v1120 QC032 (Kah Poh, as his original): header line back, compact signing row, sketch fills the rest in 3 equal boxes */
.q32-info{border-top:1.5px solid #000}
.q32-sk{flex:1 1 auto;height:auto;min-height:120px;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;align-items:stretch;justify-content:stretch}
.q32-ski{height:auto;min-height:0}
.q32-sg{flex:none;grid-template-columns:1fr 1fr}
.q32-sb{display:flex;flex-direction:row;align-items:flex-start;gap:10px;padding:4px 10px 5px;min-height:0}
.q32-sx{display:flex;flex-direction:column;gap:1px;font-size:12.5px;line-height:15px}.q32-sx > b{font-weight:400}
.q32-sb .q32-sn{display:grid;grid-template-columns:auto 1fr;gap:4px;min-height:15px;padding-left:12px}.q32-sb .q32-sn span:first-child{text-align:left}.q32-sa{min-width:42px}
.q32-sb .q32-st{flex:0 0 auto;width:72px;min-height:66px;position:relative;margin-left:auto;margin-right:30%}
.q32-sb .q32-st img{left:50%;top:50%;bottom:auto;transform:translate(-50%,-50%);max-height:64px;max-width:72px}.q32-sb .q32-st img.stamp-rd{width:64px;height:64px}
.qc-sheet .q32-tb td{height:21px}
/* v1121 QC032 (Kah Poh): "Sheet k of n" in the last sketch box top-right (info block 1 row shorter → more sketch) */
.q32-ski .q32-shn{position:absolute;top:0;right:0;font-size:13px;background:#fff;padding:0 2px;z-index:2}
.q32-sk{padding-top:4px}
/* v1127 (Kah Poh): QC032 company stamp bigger, moved left, right beside the name */
.q32-sb{gap:4px}.q32-sb .q32-st{width:92px;min-height:78px;margin-left:0;margin-right:auto}
.q32-sb .q32-st img{max-height:84px;max-width:92px}.q32-sb .q32-st img.stamp-rd{width:84px;height:84px}
/* v1127b (Kah Poh): QC032 Client / Item = ONE line cell like the form no. / MDR section cell (just a divider line, full header height, no frame) */
.q8-tt.q32-tt{padding:0 0 0 4px;align-items:stretch}.q32-tt0{align-self:center;padding:5px 0}
.q32-hkv{border:0;border-left:1px solid #000;padding:0 10px 0 26px;align-content:center;align-self:stretch;margin:0}
/* v1127 QC032 "Insert photo with AI" beside Set list — phone: the count box on its own row, the 2 buttons side by side under it */
@media (max-width:820px){.q32-cnt{flex-wrap:wrap}.q32-cnt .q2-f{flex:1 1 100%}.q32-cnt .btn{flex:1 1 0;justify-content:center}}
/* v1129b QC032a: ⚠ badge on a sheet whose photo the AI was unsure about (psmChkBadge, 07) */
.ps-chk{cursor:pointer;border:0;font:inherit;font-weight:700;margin-left:8px;max-width:100%;text-align:left;white-space:normal}
/* v1135 QC032 Nozzles heading = fold button that looks like the other sub headings (caps, same weight) */
.md-subh .q32-fold{font:inherit;text-transform:inherit;letter-spacing:inherit;color:inherit;font-weight:inherit;padding:0;background:none;border:0;display:inline-flex;align-items:center;gap:6px;cursor:pointer}
.md-subh .q32-fold b{font:inherit;font-weight:inherit;text-transform:inherit;letter-spacing:inherit}
.md-subh .q32-fold svg{width:16px;height:16px;transition:transform .15s}.md-subh .q32-fold[aria-expanded="false"] svg{transform:rotate(-90deg)}
.md-subh .q32-fold{text-align:left}.md-subh .q32-fold b{white-space:normal}
/* v1136 a heading line with a fold button is clickable on the whole line */
.md-subh:has(button[aria-expanded]:not(.lede-i)),.q2-ai-h:has(button[aria-expanded]),.q2-ih:has([role=button][aria-expanded]),.ps-subh:has(button[aria-expanded]:not(.lede-i)){cursor:pointer}
/* v1137 TABLE FORM master — sample sheets (js/07c-table-master.js); same look as QC032 */
.tf-info{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.1fr) minmax(0,1fr);border:1.5px solid #000;font-size:13px}   /* v1140: the line UNDER the header is part of the standard (was border-top:0 → it overrode QC032's own and the PDF lost the line) */
.tf-info>div{display:grid;grid-template-columns:auto 10px 1fr;row-gap:2px;align-content:start;padding:5px 10px;border-right:1px solid #000;line-height:1.35}.tf-info>div:last-child{border-right:0}
.tf-info.tf-info-p{grid-template-columns:1fr 1fr;font-size:12.5px}
.tf-k{white-space:nowrap}.tf-c{text-align:center}.tf-v{overflow-wrap:anywhere}
.qc-sheet table.tf-tb{width:100%;border-collapse:collapse;border:1.5px solid #000;border-top:0;table-layout:fixed}
.qc-sheet .tf-tb th,.qc-sheet .tf-tb td{border:1px solid #000;text-align:center;padding:0 3px;height:21px;font-size:13px;color:#000;background:#fff}
.qc-sheet .tf-tb th{font-weight:700;font-size:11.5px;line-height:13px;padding:3px 1px;height:auto}
.qc-sheet .tf-land .tf-tb tr>:nth-child(4n),.qc-sheet.tf-land .tf-tb tr>:nth-child(4n){border-right:1.5px solid #000}
.qc-sheet .tf-tb td.tf-no{font-weight:700}.qc-sheet .tf-tb td.tf-ng{font-weight:700}
.tf-sg{display:grid;grid-template-columns:1fr 1fr;border:1.5px solid #000;border-top:0;font-size:13px;margin-top:auto}
.tf-sb{display:flex;flex-direction:row;gap:4px;align-items:flex-start;padding:5px 10px;border-right:1px solid #000;min-height:84px}.tf-sb:last-child{border-right:0}
.tf-sx{display:flex;flex-direction:column;gap:1px;line-height:15px}.tf-sx>b{font-weight:400}.tf-sx>div{padding-left:12px}
.tf-sn{display:grid;grid-template-columns:auto 1fr;gap:4px}.tf-sa{min-width:42px}   /* v1328 (Kah Poh 16 Nov FAB009 PDF "the signing section, improve it"): "Name : value" with a gap & the values lined up — the QC032 master look, every table form */
.qc-sheet .f9-sg{border-top:1.5px solid #000}
.qc-sheet .f9-st{width:96px;min-height:84px;margin:-2px 0}.qc-sheet .f9-st img{height:88px;width:auto;max-height:88px;max-width:96px}   /* v1334 (Kah Poh 17 Nov: "for FAB009, the company stamp, make it bigger that can fit in the box too"): the stamp = the full height of the signing box */   /* v1328 FAB009: the signing box sits apart from the table (TOTAL line + free space) → closed on top */
.tf-st{position:relative;flex:0 0 auto;width:80px;min-height:70px;pointer-events:none}.tf-st img{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-height:74px;max-width:80px;object-fit:contain;opacity:.92;z-index:-1}
.qc-sheet.tf-port .tf-tb td,.qc-sheet.tf-port .tf-tb th{font-size:12.5px}
.tf-sk{display:grid;grid-template-columns:1fr 1fr 1fr;border:1.5px solid #000;border-top:0;flex:1 1 auto;min-height:110px}.tf-ski{border-right:1px solid #000;display:grid;place-items:center;color:#8A96A3;font-size:12px}.tf-ski:last-child{border-right:0}
.tf-cfg{background:var(--surface-2,#F1F4F8);border:1px solid var(--divider,#D5DBE1);border-radius:6px;padding:10px 12px;font:12px/1.5 "IBM Plex Mono",ui-monospace,monospace;overflow-x:auto;white-space:pre;margin:0 0 8px;color:var(--ink,#1C2530)}
/* v1139 QC032 photos to check: thumbnail + the boxes for what could not be read */
.q32-pcs{margin:6px 0}.q32-pc{display:flex;gap:10px;align-items:center;border:1px solid var(--divider,#D5DBE1);border-left:4px solid var(--steel,#2457E6);border-radius:6px;padding:8px;margin:6px 0;background:var(--surface,#fff)}
.q32-pct{flex:0 0 auto;width:84px;height:84px;padding:0;overflow:hidden;position:relative}.q32-pct img{width:100%;height:100%;object-fit:cover;display:block}
.q32-pcb{flex:1 1 auto;min-width:0;display:grid;grid-template-columns:1fr 1fr;gap:6px 10px}.q32-pcr{display:flex;flex-direction:column;gap:2px;min-width:0}.q32-pcr label{font-size:12.5px;color:var(--muted,#6B7785)}.q32-pcr .inp{width:100%}
.q32-pcw{grid-column:1/-1}
/* v1139b every AI busy row: the Stop button comes FIRST (before the spinner) — Kah Poh */
.q2-ai-busy .btn{order:-1;margin-left:0}
.q32-pcw{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.q32-pcs-save{margin-left:auto}
/* v1140 (Kah Poh, R0124 PDF: "some line is missing, not connected"): the line under the header is back (.tf-info) and the 3 sketch boxes are real boxes —
   no gap, no padding, a divider line full height between them (touches the info block's line above & the table's line below) */
.q32-sk,.tf-sk{padding:0;gap:0}.q32-ski+.q32-ski,.tf-ski+.tf-ski{border-left:1px solid #000}
/* v1140 picture sheet: continuous numbering button beside the collapse all button */
.ps-hbtns{display:inline-flex;gap:6px;align-items:center;margin-left:auto}.ps-subh{display:flex;align-items:center}
.ps-cn svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2}.ps-cn.on{background:var(--steel,#2457E6);color:#fff;border-color:var(--steel,#2457E6)}
/* v1141 QC032 sketches: thumbnails on desktop (chips stay on phone) + the default-sketch buttons */
.q32-skth{display:flex;gap:12px;flex-wrap:wrap;margin:6px 0 8px}.q32-skt{display:flex;flex-direction:column;align-items:center;gap:4px}
.q32-skti{position:relative;width:170px;height:120px;padding:0;overflow:hidden;background:#fff}.q32-skti img{width:100%;height:100%;object-fit:contain;display:block}
.q32-skdef{display:flex;gap:10px;flex-wrap:wrap;margin:8px 0}
@media (min-width:821px){.q32-skl{display:none}}
@media (max-width:820px){.q32-skth{display:none}.q32-skdef .btn{flex:1 1 auto;justify-content:center}}
/* v1143 table form settings = ONE compact grid (n boxes per row on desktop, one column on phone) */
.tf-sgrid{display:grid;grid-template-columns:repeat(var(--tf-g,4),minmax(0,1fr));gap:8px 14px;align-items:start;margin:4px 0 8px}
.tf-sgrid .q2-f{min-width:0}.tf-sgrid .q2-f .inp{width:100%}.tf-sgrid .q16-dp{max-width:100%}
@media (max-width:820px){.tf-sgrid{grid-template-columns:1fr}}

/* v1144 (Kah Poh): landscape TABLE FORM header — the Client / Item No. block starts at the CENTRE of the page (sheet 1123px: frame centre 531px − logo column 74px = 457px for the title) */
.q8-tt.q32-tt,.q8-tt.tf-tt{display:grid;grid-template-columns:457px minmax(0,1fr);gap:0;padding:0;align-items:stretch}
.q32-tt0,.tf-tt0{align-self:center;padding:5px 0 5px 4px}.q32-hkv,.tf-hkv{padding:0 10px;margin:0;border:0;border-left:1px solid #000;align-content:center;align-self:stretch}
.tf-hkv{display:grid;grid-template-columns:auto 10px minmax(0,1fr);row-gap:2px;font-size:13px;line-height:1.3}

/* v1148: size-format badge beside a box label */
.size-bdg{margin-left:6px;font-size:10px;padding:1px 6px;vertical-align:1px;font-weight:600}

/* v1155: Own Format master — the 4 types as readable blocks (same on desktop & phone) */
.of-types{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:10px;margin-bottom:8px}
.of-ty{border:1px solid var(--divider);border-radius:6px;padding:10px 12px;display:grid;gap:4px;align-content:start;background:var(--surface)}
.of-tn{font-size:15px;color:var(--ink)}.of-tr{display:grid;grid-template-columns:76px minmax(0,1fr);gap:8px;font-size:13px;line-height:1.45;overflow-wrap:anywhere}.of-tl{color:var(--muted);font-weight:600}
.of-p{margin:0 0 10px;max-width:90ch;line-height:1.55}

/* v1161: Production details edit card open on phone → fixed room at the bottom of the page (never toggled, so the page does not jump); the last boxes can scroll to the middle */
@media (max-width:820px){ body:has(.pd-card.on) main{padding-bottom:max(var(--rvkb,0px),28vh)} }   /* v1163 (Kah Poh: "too much, just enough to cover the keyboard"): 28vh = the keyboard's height on his iPhone (keyboard top at 73% of the page height → 27%) */

/* v1167: MDR cover — signing date beside each signing party */
.md-sgd{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.md-sgf{font-size:12.5px;color:var(--muted)}

/* v1174: QC002b unmatched mill cert card — thumbnails + Cert. No. + line pick */
.q2b-unc{display:flex;gap:12px;align-items:flex-start;flex-wrap:wrap;border:1.5px solid var(--hold,#F2C230);border-radius:8px;padding:10px;margin:8px 0;background:var(--surface)}
.q2b-unthw{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.q2b-unthb{padding:0;border:1px solid var(--frame);border-radius:4px;background:#fff;cursor:zoom-in;line-height:0}.q2b-unthb img{width:92px;height:auto;max-height:120px;object-fit:contain;display:block}.q2b-unmore{font-weight:700;color:var(--muted)}
.q2b-unf{display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 10px;align-items:center;flex:1 1 260px;min-width:0}.q2b-unf label{font-size:13px;font-weight:600;color:var(--muted)}.q2b-unf .btn{grid-column:1/-1;justify-self:start}

/* v1176: Procurement › Mill Cert Register */
.mcr-tb .mcr-tr{cursor:pointer}.mcr-tb .mcr-tr.on>td{background:var(--surface-2)}@media (hover:hover){ .mcr-tb .mcr-tr:hover>td{background:var(--surface-2)} }
.mcr-hn{font-family:var(--mono);font-weight:700;overflow-wrap:anywhere}.mcr-tb td{vertical-align:top}.mcr-d{padding:6px 2px 4px}.mcr-notes{margin:8px 0 0;max-width:90ch;line-height:1.5}.mcr-pob{margin-left:auto}
@media (max-width:820px){ .mcr-tb tr.mcr-dt{display:block} .mcr-tb tr.mcr-dt>td{display:block;padding:0 4px 10px} .mcr-tb tr.mcr-dt>td::before{display:none} }
/* v1176b: Mill Cert Register — PO heading on ONE line (desktop): PO · supplier · n lines … badge; phone: each line = card (Heat No. + Check on top, then the rest with labels) */
@media (min-width:821px){ .mcr-card>.sp-jh{flex-direction:row;align-items:center;flex-wrap:wrap;gap:4px 14px} .mcr-card>.sp-jh .tpi-nm{font-size:16px} .mcr-card>.sp-jh .sp-jm,.mcr-card>.sp-jh .sp-jc{font-size:13.5px} }
@media (max-width:820px){ .mcr-tb tr.mcr-tr{grid-template-columns:minmax(0,1fr) auto;padding:10px 4px;gap:4px 10px}
  .mcr-tb tr.mcr-tr>td{grid-column:1/-1;font-size:14px} .mcr-tb tr.mcr-tr>td[data-l]::before{content:attr(data-l) " : ";color:var(--muted);font-size:12.5px;font-weight:600}
  .mcr-tb tr.mcr-tr>td.mcr-hn{grid-column:1;grid-row:1;font-size:16px} .mcr-tb tr.mcr-tr>td.mcr-hn::before{content:"HN ";font-family:var(--sans)}
  .mcr-tb tr.mcr-tr>td:last-child{grid-column:2;grid-row:1;align-self:start} .mcr-tb tr.mcr-tr>td:last-child::before{display:none}
  .mcr-tb tr.mcr-tr>td .cmeta{display:inline;margin-left:6px} }

/* v1178: QC002 card — From Mill Cert Register */
.q2-mcr{display:flex;align-items:center;gap:8px;flex-wrap:wrap;flex-basis:100%}.q2-mcrl{display:flex;flex-direction:column;align-items:flex-start;gap:4px;flex-basis:100%}.q2-mcrh{font-size:13px;color:var(--muted);font-weight:600}.q2-mcro{text-align:left;white-space:normal;height:auto;min-height:36px}
.q2-subh .q2-mcrall{margin-left:auto}.q2-subh .q2-mcrall+.q2-foldall{margin-left:8px}
@media (max-width:820px){ .q2-mcrall .q2-l{display:none} } @media (min-width:821px){ .q2-mcrall .q2-s{display:none} }
.q2-subh>span:first-child{white-space:nowrap}
/* v1180: HN typo checks — QC002b near-match line + Heat No. box note (Mill Cert Register) */
.q2b-near{display:grid;gap:6px;flex-basis:100%}.q2b-nr{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13.5px}
.mcr-hint{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin-top:4px;font-size:13px;flex-basis:100%}.mcr-hint .mcr-hq{color:var(--muted)}.mcr-hb{font-family:var(--mono);font-weight:700}
.q2b-off{white-space:nowrap}
.md-typo{margin-left:6px;font-size:10.5px;padding:1px 6px;vertical-align:1px}
/* v1187 (Kah Poh photo: "the badge covers the SOP step"): a side branch with a LONG label (e.g. "No · ⚠ No HN match", class sop-sw) gets a wider arrow (150px) so the label never runs over the step box; its join line follows the wider arrow (desktop) */
@media (min-width:821px){ .sop-side.sop-sw{grid-template-columns:150px minmax(0,320px)} .sop-side.sop-sw .sop-ar.sop-sidear{width:150px} .sop-side.sop-sw .sop-jn{right:calc((100% - 150px) / 2 - 1px)} }
.md-typo .mt-r{display:none}.md-tr.md-last .md-typo{background:#C62828;color:#fff;border-color:#C62828}.md-tr.md-last .md-typo .mt-y{display:none}.md-tr.md-last .md-typo .mt-r{display:inline}   /* v1188: HN typo badge red only on the yellow just-closed line */

/* v1192: "Moving files to Drive · n of N" chip — same look as the AI chip, one line above it */
.gm-chip{bottom:calc(env(safe-area-inset-bottom,0px) + 72px)}
body:has(#toastHost .toast) .gm-chip{bottom:calc(env(safe-area-inset-bottom,0px) + 130px)}

/* v1193: Mill Cert Register ↔ Drive mill cert */
.mcr-cert{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:10px;padding-top:10px;border-top:1px solid var(--divider)}
.mcr-cn{font-size:13px;color:var(--muted)}
.mcr-pdf{white-space:nowrap}
.mcr-from{white-space:nowrap}
.mcr-from .q2b-bs{display:none}
@media (max-width:560px){ .mcr-from .q2b-bl{display:none} .mcr-from .q2b-bs{display:inline} }
/* v1195 (Kah Poh, iPhone Claude app screenshot): the band ABOVE the sticky top bar (behind the Claude app's own buttons = safe-area-inset-top)
   showed the page scrolling underneath ("TOC (MDR Table of Content)" heading behind the Claude buttons) → a solid band in the page colour covers it */
.topbar::before{content:"";position:absolute;left:0;right:0;bottom:100%;height:env(safe-area-inset-top,0px);background:var(--ground);pointer-events:none}

/* v1198: the preview does its OWN pinch & double tap — the phone's page zoom / double-tap zoom is switched off inside it (it took the taps, so "double tap = original size" did nothing) */
.memo-ov .memo-stage{touch-action:pan-x pan-y}

/* v1200: QC002b — HN in more than 1 mill cert → pick list on the line */
.mcr-pick{min-height:32px;font-size:13px;width:128px;max-width:128px;padding:0 6px;border-color:var(--hold,#F2C230)}
@media (max-width:560px){ .mcr-pick{width:96px;max-width:96px;font-size:16px} }

/* v1201: QC002b line — "⚠ HN typo? <cert HN>" + Fix HN beside the pages chip */
.q2b-typo{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}

/* v1202: QC002b "✓ Reg. found" (+ From register / Pick cert) */
.mcr-regw{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap}

/* v1204: the portal's own caption for [data-tip] (badges) — the browser title tip doesn't show in the Claude app */
.rv-tip{position:fixed;z-index:120;max-width:min(340px,calc(100vw - 16px));background:var(--navy,#1C2530);color:#fff;font:500 13px/1.4 var(--sans);padding:7px 10px;border-radius:6px;pointer-events:none;box-shadow:0 4px 14px rgba(10,20,35,.3);white-space:normal}
.rv-tip[hidden]{display:none}
[data-tip]{cursor:help}
button[data-tip]:not(:disabled),a[data-tip],select[data-tip],label[data-tip],[role="button"][data-tip]{cursor:pointer}   /* v1284 (Kah Poh photo "why desktop button show question mark?"): a tip on a BUTTON keeps the hand — the ? cursor is only for plain text / badges with a tip */
/* v1204: QC002b tick badges ✓ HN & ✓ REG. — the SAME size */
.q2b-tk{min-width:64px;justify-content:center;text-align:center}
/* v1205 (Kah Poh comment: "make this box & button compact in desktop") — QC002b "HN list from QC008" box: one line (heading left, 3 smaller buttons right), less padding */
@media (min-width:561px){
  .q2b-ai{padding:8px 12px;margin:10px 0 4px}
  .q2b-ai .q2-ai-h{flex-wrap:wrap;gap:6px 8px}
  .q2b-ai .q2-ai-h > b{white-space:nowrap}
  .q2b-ai .q2-ai-sub{font-size:12.5px;white-space:nowrap}
  .q2b-ai .q2-ai-acts{flex-wrap:wrap;justify-content:flex-end;gap:6px}
  .q2b-ai .q2-ai-acts .btn{min-height:34px;padding:0 11px;font-size:13.5px;white-space:nowrap}
  .q2b-ai .q2-ai-acts .btn svg{width:15px;height:15px}
}

/* v1206: QC008 "✓ Sketch corrected" before the sketch changed — greyed (still tappable: it says what to do first) */
.btn.q8-typo-wait{opacity:.5}

/* v1208: QC002 calibration — "Default" tick box on the right of the heading (only the box ticks) */
.q2-calhd{display:flex;align-items:center;justify-content:space-between;gap:10px}
.q2-caldef{display:inline-flex;align-items:center;gap:6px;text-transform:none;letter-spacing:0;font-weight:600;font-size:13px;color:var(--ink);cursor:default}
.q2-caldef input{width:18px;height:18px;margin:0;cursor:pointer;accent-color:var(--steel)}
@media (max-width:560px){ .q2-caldef input{width:22px;height:22px} }

/* v1209 (Kah Poh): QC002 Received date AFTER the MDR delivery date → the box is RED (was yellow); folded row: red "✕ After delivery" badge */
.inp.md-dt.q2-late{background:#C62828;color:#fff;border-color:#8E1B1B;font-weight:400}
.q2-late-n{color:#C62828}
.q2-late-n::first-letter{color:#C62828}
:root[data-theme="dark"] .q2-late-n{color:#FF8A80}
@media (prefers-color-scheme:dark){ :root:not([data-theme="light"]) .q2-late-n{color:#FF8A80} }
.q2-sum-late.status{font-size:11.5px;padding:1px 7px;background:#C62828;color:#fff}

/* v1210: QC002 "✕ After delivery" — desktop: right after the description; phone: under it */
.q2-sum-d .q2-sum-late.q2-late-dk{margin:0 0 0 10px;vertical-align:1px}
.q2-sum-late.q2-late-ph{display:none}
@media (max-width:560px){ .q2-sum-late.q2-late-dk{display:none} .q2-sum-late.q2-late-ph{display:inline-block} }
/* v1215 (Kah Poh 8 Nov: "on phone the date boxes in QC002 are just nice, tight fit — make it standard for all in phone"):
   EVERY date box on phone = the QC002 size: just the date (dd-mm-yyyy), centred, small side padding. Desktop unchanged. */
@media (max-width:560px){
  input.inp.md-dt,.inp.md-dt{width:calc(5.75em + 14px)!important;max-width:calc(5.75em + 14px)!important;min-width:0!important;flex:0 0 auto!important;padding-left:3px!important;padding-right:3px!important;text-align:center}
}

/* v1216: table-form list heading buttons (From register · Collapse all) — desktop right of the heading, phone on their own line under it */
.tf-hacts{display:inline-flex;align-items:center;gap:8px;margin-left:auto;text-transform:none;letter-spacing:0}
@media (max-width:560px){ .md-subh:has(> .tf-hacts){flex-wrap:wrap;row-gap:8px} .md-subh > .tf-hacts{flex:0 0 100%;margin-left:0;justify-content:space-between} }
/* v1217 (Kah Poh iPhone screenshot QC002a "thumbnail has problems — check all that have thumbnail"): on phone the photo grid kept 4 columns (v1808 rule) even inside
   the narrow photo column of a 1-photo sheet card (QC002a q2a-body, QC008 / QC016a / QC032a ps-sc1) → each photo cell 14–17 px wide, buttons spilling out of the card.
   Inside those narrow columns the photo grid is ONE column; the column is 96 px so ‹ › ✕ fit under the photo. */
@media (max-width:560px){
  .q2a-body{grid-template-columns:96px minmax(0,1fr)!important}
  .ps-sc1{grid-template-columns:96px minmax(0,1fr)!important}
  .q2a-body .ps-tg,.ps-sc1 .ps-tg{grid-template-columns:minmax(0,1fr)!important}
  .q2a-body .ps-tc .q8-th,.ps-sc1 .ps-tc .q8-th{width:100%!important;height:68px!important}
  .q2a-body .ps-tb,.ps-sc1 .ps-tb{justify-content:center;flex-wrap:nowrap}
}

/* v1218: QC002b merged badge "✓ REG. & HN"; the portal caption keeps its line break */
.rv-tip{white-space:pre-line}

/* v1219: phone — picture-sheet values as one sentence; tap = the boxes to edit */
.psm-wrap{display:flex;flex-direction:column;gap:8px;min-width:0}
.psm-sum{display:flex;align-items:flex-start;justify-content:space-between;gap:8px;width:100%;text-align:left;font:600 15px/1.4 var(--sans);color:var(--ink);background:var(--surface);border:1px solid var(--divider);border-radius:6px;padding:8px 10px;cursor:pointer}
.psm-sum .psm-st{min-width:0;overflow-wrap:anywhere}
.psm-sum svg{flex:none;width:16px;height:16px;margin-top:3px;stroke:var(--link);fill:none;stroke-width:2}
.psm-sum[aria-expanded="true"]{border-color:var(--steel)}
.psm-wrap > [hidden]{display:none!important}
/* v1221 (Kah Poh iPhone QC002a: "when not in edit make it a row, when edit then only stack it"): sheet card with ONE photo & the sentence showing →
   photo | sentence on top, then ONE row under them: ‹ › ✕ + "Taken dd-mm-yyyy hh:mm" (the photo's own date line, a duplicate, hidden).
   While the boxes are open (editing) → the stacked column as before. */
@media (max-width:560px){
  .q2a-body:has(.psm-sum:not([hidden])):has(.ps-tg > .ps-tc:only-child){grid-template-rows:auto auto;row-gap:8px;align-items:center}
  .q2a-body:has(.psm-sum:not([hidden])):has(.ps-tg > .ps-tc:only-child) > div:first-child,
  .q2a-body:has(.psm-sum:not([hidden])) .ps-tg:has(> .ps-tc:only-child),
  .q2a-body:has(.psm-sum:not([hidden])) .ps-tg > .ps-tc:only-child{display:contents}
  .q2a-body:has(.psm-sum:not([hidden])) .ps-tc:only-child > .q8-th{grid-column:1;grid-row:1}
  .q2a-body:has(.psm-sum:not([hidden])) > .psm-wrap{grid-column:2;grid-row:1}
  .q2a-body:has(.psm-sum:not([hidden])) .ps-tc:only-child > .ps-edt{display:none}
  .q2a-body:has(.psm-sum:not([hidden])) .ps-tc:only-child > .ps-tb{grid-column:1;grid-row:2;justify-content:flex-start}
  .q2a-body:has(.psm-sum:not([hidden])) > div:first-child > .ps-edt{grid-column:2;grid-row:2;white-space:nowrap;overflow:visible;text-overflow:clip;font-size:12.5px;text-align:left;align-self:center}
}
/* v1222 (Kah Poh iPhone QC002a: "move this badge right after Sheet 1 of 3, in a row"): on phone the sheet title took the whole line (v3159) → the ✓ HN READ /
   ✕ … badge (and the ⚠ Check badge) dropped to their own line. Title now only as wide as it is; the badges follow it on the same line; the buttons row wraps under. */
@media (max-width:560px){
  .ps-sc .q2-ih > .ps-sht:has(~ .q2a-b, ~ .ps-chk){flex:0 1 auto}
  .ps-sc .q2-ih > .q2a-b,.ps-sc .q2-ih > .ps-chk{align-self:center;margin-left:4px}
  .ps-sc .q2-ih > .ps-rc{flex:1 1 100%}
}

/* v1223 (Kah Poh: "button size ok, just make the arrow bigger; 1 picture in a line → up & down, more than 1 → left & right"): picture move buttons keep their size,
   the chevron is bigger; a photo grid laid out in ONE column (js psmArrowDir) turns the same chevron 90° → ˄ ˅. */
.ps-tb .icon-btn{padding:0;display:inline-grid;place-items:center}
.ps-tb .icon-btn > svg{display:block;margin:0}
.ps-tb .ps-mv svg.ps-ar{width:20px;height:20px;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round}
/* v1225 (Kah Poh iPhone QC008: "arrows & cross not in the centre of the button"): the arrows are drawn chevrons (no text glyph = no font offset), button padding 0.
   ("arrow under the thumbnail, description on the right — like QC002a"): phone, 1-photo sheet without sheet values (QC008, QC016a, QC032a …) →
   row 1: photo | Sheet k of n + name · row 2: ˄ ˅ ✕ | Taken date · then the size / Ratio / Note buttons. The date line under the photo is the one shown (no duplicate). */
@media (max-width:560px){
  .ps-sc1 > .ps-tg:has(> .ps-tc:only-child),.ps-sc1 > .ps-tg > .ps-tc:only-child{display:contents}
  .ps-sc1 .ps-tc:only-child > .q8-th{grid-column:1;grid-row:1}
  .ps-sc1:has(.ps-tc:only-child) > .ps-1i > .ps-1l{grid-column:2;grid-row:1}
  .ps-sc1:has(.ps-tc:only-child > .ps-edt) .ps-1l > .ps-edt{display:none}
  .ps-sc1 .ps-tc:only-child > .ps-tb{grid-column:1;grid-row:2;justify-content:flex-start}
  .ps-sc1 .ps-tc:only-child > .ps-edt{grid-column:2;grid-row:2;align-self:center;text-align:left;font-size:12.5px;margin:0}
  .ps-sc1 .ps-tc:only-child > .ps-edt::before{content:"Taken "}
  .ps-sc1:has(.ps-tc:only-child) > .ps-1i > .ps-rc{grid-column:1 / -1;grid-row:3}
}
/* v1226 (Kah Poh iPhone QC002a, boxes open): the date showed twice (under the photo AND "Taken 12-08-2…" cut short in the 96 px column) → while editing only the photo's own date line */
@media (max-width:560px){ .q2a-body:not(:has(.psm-sum:not([hidden]))):has(.ps-tc:only-child > .ps-edt) > div:first-child > .ps-edt{display:none} }
/* v1235 (Kah Poh iPhone: "make those 3 buttons the same width as the thumbnail, equal size"): phone — the ˄ ˅ ✕ row under a picture is exactly the picture's width,
   3 equal buttons (every picture form, every sheet size). Desktop unchanged. */
/* v1236 (Kah Poh: "desktop same rule?" — yes): the same on desktop & every width */
.ps-tc > .ps-tb{display:flex;width:100%;justify-self:stretch;gap:4px;justify-content:stretch;flex-wrap:nowrap;box-sizing:border-box}
.ps-tc > .ps-tb > .icon-btn{flex:1 1 0;width:auto!important;min-width:0;height:30px}
/* v1236: desktop too — the 1-photo sheet showed the date twice (under the photo AND "Taken 07-11-2026 …" cut short) → only the photo's own date line */
@media (min-width:561px){ .q2a-body:has(.ps-tc:only-child > .ps-edt) > div:first-child > .ps-edt{display:none} }
/* v1239: 1-photo sheet with no sheet values (QC008 type) = the QC002a card: heading on top, then photo | name; phone: ‹ › ✕ under the photo | "Taken …" beside them */
.ps-nb > .ps-nm1{min-width:0;align-self:center}
.ps-nb > .ps-nm1 .q8-nm{font-weight:500;color:var(--muted);font-size:14px;overflow-wrap:anywhere}
@media (max-width:560px){
  .q2a-body.ps-nb:has(.ps-tg > .ps-tc:only-child){grid-template-rows:auto auto;row-gap:8px;align-items:center}
  .q2a-body.ps-nb:has(.ps-tg > .ps-tc:only-child) > div:first-child,
  .q2a-body.ps-nb .ps-tg:has(> .ps-tc:only-child),
  .q2a-body.ps-nb .ps-tg > .ps-tc:only-child{display:contents}
  .q2a-body.ps-nb .ps-tc:only-child > .q8-th{grid-column:1;grid-row:1}
  .q2a-body.ps-nb > .ps-nm1{grid-column:2;grid-row:1}
  .q2a-body.ps-nb:has(> div:first-child > .ps-edt) .ps-tc:only-child > .ps-edt{display:none}
  .q2a-body.ps-nb .ps-tc:only-child > .ps-tb{grid-column:1;grid-row:2}
  .q2a-body.ps-nb > div:first-child > .ps-edt{display:block!important;grid-column:2;grid-row:2;white-space:nowrap;overflow:visible;text-overflow:clip;font-size:12.5px;text-align:left;align-self:center;margin:0}
}
@media (min-width:561px){ .q2a-body{grid-template-columns:130px minmax(0,1fr)} }   /* v1239: the photo cell is 130 px — the column was 120 px, so the text touched the photo */
/* v1240 (Kah Poh: "make the arrow & cross icons inside the same size"): ‹ › ✕ under a picture — every icon 20 px, same line weight */
.ps-tb .icon-btn > svg{width:20px!important;height:20px!important;stroke-width:2.4!important;stroke-linecap:round;stroke-linejoin:round}
/* v1241: ↑ ↓ ✕ move / remove buttons everywhere = drawn icons, same size & weight (sheet heading ↑ ↓ ✕ slightly bigger on phone, all 3 the same) */
.icon-btn > svg{stroke-linecap:round;stroke-linejoin:round}
@media (max-width:560px){ .ps-rc .q8-ac > .icon-btn > svg{width:18px;height:18px;stroke-width:2.2} }
/* v1242 rule 30: dates after the MDR delivery date — photo date in red, badges on the sheet title & the TOC row */
.ps-edt.ps-late{color:var(--bad)!important;font-weight:700}
.ps-lateb{align-self:center;margin-left:4px}
.md-late{margin-left:6px;vertical-align:middle;font-size:11.5px}
/* v1243 (Kah Poh): "After delivery" badges YELLOW (⚠); on the TOC line just closed (yellow highlight) → RED (✕), like the HN typo badge. Section heading badge only while the section is folded. */
.md-g.open > .md-tr > .toc-t > .md-late-g,.md-g.open > .md-tr .md-late-g{display:none}
.md-late{font-size:10.5px}
/* v1245 (Kah Poh: "attachment sheet — move the stamp above the line"): picture sheets (Attachment) — the stamp sits in the room BETWEEN "Prepared By :" and the name lines,
   never over the name (portrait names take 2 lines and the stamp covered them). Landscape & portrait. */
.ps-sg{display:flex;flex-direction:column}
.ps-sg > .q8-st{position:static;inset:auto;flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;overflow:hidden;padding:1px 0}
.ps-sg > .q8-st img{max-height:100%;height:auto}
.ps-sg > .q8-st img.stamp-rd{height:100%;width:auto;max-height:76px}
.ps-sg > .ps-sgn{position:static;margin-top:auto;padding-bottom:1px}
/* v1247 (Kah Poh: "move the Back to left"): MDR Cover details / TOC — nothing changed → the button reads "‹ Back" and sits FIRST (left), like every other Back in the portal
   (Back to TOC, Back to Forms …). After a change it reads "Cancel" and goes back to its place on the right (Save changes · … · Cancel). */
.md-acts > .md-cancel.md-back{order:-1;margin-left:0;margin-right:auto}
.md-hacts > .md-back{order:-1}   /* v1247: the top bar of an MDR being edited (desktop TOC) — Back first too */
@media (max-width:560px){ .md-acts.md-acts-cov:has(#mdSave[hidden]),.md-acts.md-acts-toc:has(#mdSave[hidden]){grid-template-columns:minmax(0,.8fr) minmax(0,1.3fr) minmax(0,1.2fr)} }   /* v1247: Back first → the narrow column first */
/* v1251 file viewer (View mill cert / TPI / job documents) = the same top bar & zoom as every PDF preview (rule 23 & 34) */
.tpi-ov .tpi-vt{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tpi-ov .memo-tt{min-width:0;flex:1 1 auto}
.tpi-vp{align-items:flex-start!important;touch-action:pan-x pan-y;padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))!important}
.tpi-pg{width:calc(min(100%, 900px) * var(--tz,1))!important;max-width:none!important;margin-inline:auto}
.tpi-vp > .tpi-pn,.tpi-vp > .tpi-vl{margin-inline:auto}
/* v1252 (Kah Poh comment): Mill Cert Register — open line details COMPACT: 3 columns on desktop (2 on tablet, 1 on phone), short captions,
   tight rows; mill cert box & Edit / Delete on one row */
.mcr-d{padding:4px 2px 2px}
.mcr-d .tpi-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:2px 18px}
.mcr-d .tpi-kv{grid-template-columns:84px minmax(0,1fr);gap:6px;font-size:13.5px;line-height:1.35}
.mcr-d .tpi-kv .k{font-size:12.5px}
.mcr-d .mcr-notes{margin:6px 0 0;font-size:13.5px;line-height:1.4}
.mcr-drow{display:flex;align-items:center;gap:8px 12px;flex-wrap:wrap;margin-top:6px}
.mcr-drow > .mcr-cert{flex:1 1 auto;min-width:0;margin:0;padding-top:6px}
.mcr-drow > .tpi-acts{margin-left:auto}
.mcr-drow .tpi-acts .btn{min-height:34px;padding-top:4px;padding-bottom:4px}
@media (max-width:1100px){ .mcr-d .tpi-grid{grid-template-columns:repeat(2,minmax(0,1fr))} }
@media (max-width:560px){ .mcr-d .tpi-grid{grid-template-columns:1fr;gap:1px} .mcr-d .tpi-kv{grid-template-columns:92px minmax(0,1fr)} .mcr-drow > .tpi-acts{flex:1 1 100%} .mcr-drow .tpi-acts .btn{min-height:40px} }
/* ===== v1253 (Kah Poh 11 Nov): Procurement › Part Map · Clients › Client BOM · Forms › FAB009 Production Order List ===== */
.pm-tb .pm-tr{cursor:pointer}.pm-tb .pm-tr.on>td{background:var(--surface-2)}@media (hover:hover){ .pm-tb .pm-tr:hover>td{background:var(--surface-2)} }
.pm-tb td,.cb-tb td{vertical-align:top}.pm-ref,.pm-code,.cb-ref,.cb-code{font-family:var(--mono);font-weight:700;overflow-wrap:anywhere}
.pm-used{margin:2px 0 6px;font-size:13.5px;line-height:1.4}
.cb-tb .cb-no{color:var(--muted);width:34px}.cb-tb .cb-qty,.cb-tb .cb-unit,.cb-tb th.cb-thq{white-space:nowrap}.cb-tb .cb-qu{display:none}   /* v1308: Qty | Unit columns; the heading never stacks */.cb-src{margin-left:6px;font-size:12px;padding:1px 6px;vertical-align:1px}
.cb-tb tr.cb-rv>td{background:var(--surface-2)}
.cb-bdg{display:inline-flex;gap:6px;flex-wrap:wrap;align-items:center}
.cb-v{padding:8px 10px 10px}.cb-who{margin:0 0 6px;font-size:13px;color:var(--muted);display:flex;flex-wrap:wrap;gap:6px;align-items:center}
.cb-acts{margin-top:10px;flex-wrap:wrap}
.cb-hh{margin-top:12px}.cb-hist{display:flex;flex-direction:column;gap:4px;padding:4px 0 2px}
.cb-hl{display:flex;flex-wrap:wrap;gap:4px 10px;font-size:13.5px;line-height:1.4;padding:3px 0;border-bottom:1px solid var(--divider)}.cb-why{flex-basis:100%;padding-left:2px}
.cb-old{align-self:flex-start;margin-top:4px}.cb-old>svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2;transition:transform .15s}.cb-old[aria-expanded="true"]>svg{transform:rotate(180deg)}
.cb-ed{padding:8px 10px 12px}
.cb-el{display:flex;flex-direction:column;border:1px solid var(--divider);border-radius:6px;background:var(--surface);margin:6px 0 4px}
/* v1309 (Kah Poh photo 16 Nov "not inline with its column"): the last column was "auto" → the heading row (empty last cell) & the line rows (buttons) shared the room differently, every heading sat ~70px right of its box. Now a FIXED last column: all rows have the same columns. */
.cb-er{display:grid;grid-template-columns:28px 150px minmax(150px,1fr) 62px 64px 104px minmax(150px,.8fr) 118px;grid-template-areas:"no ref desc qty unit src code ac" ". more more more more more more more";gap:5px 6px;align-items:center;padding:6px 8px;border-top:1px solid var(--divider)}
.cb-per{display:block;font-size:11px;font-weight:600;line-height:1.2;white-space:nowrap;text-transform:none;letter-spacing:0}
.cb-er:first-child{border-top:0}.cb-er .cb-c-a{justify-self:end}.cb-erh{align-items:end;font-size:12.5px;font-weight:700;color:var(--muted);grid-template-areas:"no ref desc qty unit src code ac"}
.cb-er .inp{min-height:38px;padding:5px 8px;width:100%;min-width:0}
.cb-c-no{grid-area:no;text-align:center;color:var(--muted)}.cb-c-ref{grid-area:ref;font-family:var(--mono)}.cb-c-desc{grid-area:desc}.cb-c-qty{grid-area:qty}.cb-c-unit{grid-area:unit}.cb-c-src{grid-area:src}.cb-c-code{grid-area:code;min-width:0;overflow-wrap:anywhere}.cb-c-ac{grid-area:ac}
.cb-c-more{grid-area:more;display:flex;gap:8px;align-items:center}.cb-c-more .cb-c-note{flex:1 1 auto}
.cb-uns{display:inline-flex;align-items:center;gap:6px;width:fit-content;font-size:13.5px;white-space:nowrap}
.cb-whyf{margin-top:10px}
@media (max-width:820px){
  .cb-erh{display:none}
  .cb-er{grid-template-columns:22px minmax(0,1fr) 64px 58px;grid-template-areas:"no ref ref ac" "no desc desc desc" "no qty unit src" "no code code code" "no more more more";padding:8px 6px}
  .cb-c-src{min-width:0}.cb-c-ac{justify-self:end}
  .pm-tb tr.pm-tr,.cb-tb tr.cb-tr{padding:10px 4px;gap:3px 10px}
  .pm-tb tr>td[data-l]::before,.cb-tb tr>td[data-l]::before{content:attr(data-l) " : ";color:var(--muted);font-size:12.5px;font-weight:600;font-family:var(--sans)}
  .cb-tb tr>td.cb-no,.cb-tb tr>td.cb-unit{display:none}.cb-tb .cb-qu{display:inline}
  .cb-tb tr.cb-tr,.pm-tb tr.pm-tr{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  .cb-tb tr.cb-tr>td,.pm-tb tr.pm-tr>td{grid-column:1/-1;font-size:14px}
  .cb-tb tr.cb-tr>td.cb-ref,.pm-tb tr.pm-tr>td.pm-ref{grid-column:1;grid-row:1}.cb-tb tr.cb-tr>td.cb-qty{grid-column:2;grid-row:1}
  .pm-tb tr.pm-tr>td.pm-code{grid-column:2;grid-row:1}
  .cb-tb tr.cb-tr>td.cb-ref,.pm-tb tr.pm-tr>td.pm-ref{font-size:15.5px}.cb-tb tr.cb-tr>td.cb-ref::before,.pm-tb tr.pm-tr>td.pm-ref::before{display:none}
  .pm-tb tr.pm-tr>td.pm-code::before{content:"Code : "}
  .cb-card .cb-bdg,.cb-card .mcr-pob{margin-left:0}
  #view-partmap .forms-tools > #pmFlt{flex:1 1 100%}
  #view-partmap .forms-tools > .btn,#view-clientbom .forms-tools > .btn{flex:1 1 0}
  .pm-tb tr.pm-dt,.pm-tb tr.pm-dt>td{display:block;padding:0 4px 10px}.pm-tb tr.pm-dt>td::before{display:none}
}
/* FAB009 list (table engine) */
/* v1335 FAB010 Work Order — LINE TABLE (rows style): desktop one line a row; phone 3 lines: Item No. · Qty / Description / Plan · Actual · Remark (captions shown on phone) */
/* v1338 SH001 Method Statement & JSA — editor & sheets */
.sh-acts{display:grid;grid-template-columns:repeat(auto-fill,minmax(250px,1fr));gap:8px 16px;margin:6px 0 4px}.sh-tk{display:flex;align-items:flex-start;gap:8px}.sh-tk input{width:20px;height:20px;flex:none;margin-top:1px}
.sh-inb{display:flex;gap:8px;align-items:center}.sh-inb>.inp{flex:1 1 auto;min-width:0}.sh-inb>.btn{flex:none;white-space:nowrap}.sh-lead{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 6px;margin-top:6px;font-size:14px;line-height:1.35}.sh-lead .status{font-size:12px}
.sh-aisay{display:flex;flex-wrap:wrap;gap:4px 6px;align-items:baseline;margin:2px 0 6px;font-size:14px}
.sh-golinks{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px;margin:6px 0}.sh-golinks .md-hint{margin:0}
.sh-msh{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:12px 0 4px}.sh-ta{width:100%;min-height:120px;line-height:1.4}
.sh-who{display:flex;gap:8px;flex-wrap:wrap}.sh-who>*{flex:1 1 200px;min-width:0}.sh-bd{font-size:12px;padding:1px 6px}.sh-sumb{display:inline-flex;align-items:center;gap:4px;flex-wrap:wrap}
.sh-revs{display:flex;flex-direction:column;gap:6px;margin:6px 0}.sh-rev{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.qc-sheet.sh-sheet{font-size:11px;line-height:1.3}.qc-sheet.sh-sheet h2,.qc-sheet.sh-sheet h3,.qc-sheet.sh-sheet h4,.qc-sheet.sh-sheet th,.qc-sheet.sh-sheet td,.qc-sheet.sh-sheet b{text-transform:none;letter-spacing:0}.qc-sheet.sh-sheet .sh-fr{min-height:0}.qc-sheet .sh-bd{flex:1 1 auto;min-height:0;overflow:hidden;display:flex;flex-direction:column;gap:5px;padding:4px 6px}
.qc-sheet .sh-hd{display:flex;justify-content:space-between;gap:10px;border-bottom:1px solid #000;padding:2px 4px 5px;margin-bottom:4px}.qc-sheet .sh-hl{display:flex;gap:8px;align-items:center}.qc-sheet .sh-hl img{height:38px;width:auto}
.qc-sheet .sh-hs{font-size:9.5px}.qc-sheet .sh-hr{text-align:right;font-size:10px}.qc-sheet .sh-ft{text-align:right;font-size:9.5px;padding-top:4px}
.qc-sheet .sh-ti{font-size:16px;margin:2px 0;text-align:center}.qc-sheet .sh-h2{font-size:13px;margin:6px 0 1px}.qc-sheet .sh-h3{font-size:11.5px;margin:4px 0 1px}.qc-sheet .sh-p{margin:0}.qc-sheet .sh-co{font-size:10px;text-align:center}
.qc-sheet .sh-ul{margin:0;padding-left:4px}.qc-sheet .sh-li{display:flex;gap:6px;margin:0 0 1px}.qc-sheet .sh-dot{flex:none;width:8px}.qc-sheet .sh-tb{width:100%;border-collapse:collapse;font-size:10.5px}.qc-sheet .sh-tb th,.qc-sheet .sh-tb td{border:1px solid #000;padding:2px 4px;vertical-align:top;text-align:left}
.qc-sheet .sh-tb th{font-weight:700}.qc-sheet .sh-kv td:first-child{width:24%;font-weight:700}.qc-sheet .sh-jsa{font-size:9.5px}.qc-sheet .sh-jsa td:nth-child(1),.qc-sheet .sh-jsa td:nth-child(5),.qc-sheet .sh-jsa td:nth-child(6){text-align:center}
.qc-sheet .sh-ls{width:auto}.qc-sheet .sh-sg td{height:26px}.qc-sheet .sh-att{font-size:10px;margin-top:4px}
.q2-grid .sj-cf-a,.q2-grid .sj-cf-h,.q2-grid .sj-cf-e,.q2-grid .sj-cf-c{flex:1 1 100%}.q2-grid .sj-cf-pic{flex:1 1 200px}
.q2-grid .sj-cf-l,.q2-grid .sj-cf-s,.q2-grid .sj-cf-rl,.q2-grid .sj-cf-rs{flex:0 0 76px}.q2-grid .sj-cf-risk,.q2-grid .sj-cf-res{flex:1 1 110px}
@media (max-width:560px){ .sh-acts{grid-template-columns:1fr} } @media (max-width:820px){ .q2-grid .sj-cf-a,.q2-grid .sj-cf-h,.q2-grid .sj-cf-e,.q2-grid .sj-cf-c,.q2-grid .sj-cf-pic{flex:1 1 100%} .q2-grid .sj-cf-l,.q2-grid .sj-cf-s,.q2-grid .sj-cf-rl,.q2-grid .sj-cf-rs{flex:0 0 72px} .q2-grid .sj-cf-risk,.q2-grid .sj-cf-res{flex:1 1 90px} }
.f10-rl{display:flex;flex-direction:column;margin:8px 0 4px;border:1px solid var(--divider);border-radius:6px;background:var(--surface)}
.f10-r{display:grid;grid-template-columns:30px 150px minmax(120px,1fr) 70px 104px 104px 170px 0;gap:6px;align-items:center;padding:6px 8px;border-top:1px solid var(--divider)}
.f10-r:first-child{border-top:0}.f10-rh{font-size:12.5px;font-weight:700;color:var(--muted)}
.f10-r .inp{min-height:38px;padding:5px 6px;width:100%;min-width:0}.f10-r .tf-calc{min-width:0;overflow-wrap:anywhere}.f10-c-t{font-family:var(--mono)}.f10-c-n{text-align:center;color:var(--muted)}.f10-c-q,.f10-c-pd,.f10-c-ad{text-align:center}
.f10-iss{display:flex;flex-wrap:wrap;gap:8px 18px;align-items:center;margin:6px 0 10px}.f10-tk{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.f10-tk input{width:20px;height:20px}.f10-oth{flex:1 1 260px}
.qc-sheet .f10-iw{display:flex;gap:10px;justify-content:flex-start;font-size:11px;padding:4px 6px;border:1px solid #000;border-top:0}.qc-sheet .f10-sg{border-top:1.5px solid #000}.qc-sheet .f10-st{width:96px;min-height:84px;margin:-2px 0}.qc-sheet .f10-st img{height:88px;width:auto;max-height:88px;max-width:96px}   /* same signing as FAB009 (v1328 / v1334) */.qc-sheet .f10-iw b{text-align:left;font-weight:400}
@media (max-width:820px){
  .f10-rh{display:none}
  .f10-r{grid-template-columns:22px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);grid-template-areas:"n t t q" "n d d d" "n pd ad rmk";padding:8px 6px}
  .f10-r>.f10-c-n{grid-area:n}.f10-r>.f10-c-t{grid-area:t}.f10-r>.f10-c-d{grid-area:d}.f10-r>.f10-c-q{grid-area:q}.f10-r>.f10-c-pd{grid-area:pd}.f10-r>.f10-c-ad{grid-area:ad}.f10-r>.f10-c-rmk{grid-area:rmk}.f10-r>.f10-c-del{display:none}
  .f10-r>.f10-c-q,.f10-r>.f10-c-pd,.f10-r>.f10-c-ad{text-align:left;font-size:13.5px}.f10-r>.f10-c-q::before,.f10-r>.f10-c-pd::before,.f10-r>.f10-c-ad::before{content:attr(data-l);display:block;font-size:11.5px;font-weight:600;color:var(--muted)}
  .f10-r>.f10-c-d{font-weight:600} .f10-r>.f10-c-n{align-self:start} .f10-r{align-items:start} }
.f9-rl{display:flex;flex-direction:column;margin:8px 0 4px;border:1px solid var(--divider);border-radius:6px;background:var(--surface)}
.f9-r{display:grid;grid-template-columns:26px 128px 128px minmax(100px,1fr) 58px 128px 92px 88px 34px;gap:6px;align-items:center;padding:5px 8px;border-top:1px solid var(--divider)}
.f9-r:first-child{border-top:0}.f9-rh{font-size:12.5px;font-weight:700;color:var(--muted)}
.f9-r .inp{min-height:38px;padding:5px 6px;width:100%;min-width:0}.f9-c-a,.f9-c-b{font-family:var(--mono)}@media (min-width:821px){ .f9-r .f9-c-a,.f9-r .f9-c-b{font-size:14px} }
.f9-c-n{text-align:center;color:var(--muted)}.f9-c-q{text-align:center}.f9-c-up{text-align:right}   /* v1327 (Kah Poh 16 Nov comment: "put the Qty caption & value at center") */
.f9-c-amt{text-align:right;font-weight:700;font-variant-numeric:tabular-nums}
.f9-r .f9-c-del{width:34px;height:34px}
/* v1332 FAB009 foldable cards (engine cards style, QC002 look): box widths in one open card */
.q2-grid .f9-cf-a,.q2-grid .f9-cf-b{flex:0 1 120px}.q2-grid .f9-cf-d{flex:1 1 140px}.q2-grid .f9-cf-q{flex:0 0 60px}.q2-grid .f9-cf-st{flex:0 0 auto}.q2-grid .f9-cf-up{flex:0 1 110px}.q2-grid .f9-cf-amt{flex:0 1 96px}
.q2-grid .f9-cf-st .f9-seg{min-height:38px}.tf-cv{display:flex;align-items:center;min-height:38px;font-weight:700;font-variant-numeric:tabular-nums}
@media (max-width:820px){ .q2-grid .f9-cf-a,.q2-grid .f9-cf-b,.q2-grid .f9-cf-d{flex:1 1 100%} .q2-grid .f9-cf-q{flex:0 0 72px} .q2-grid .f9-cf-up,.q2-grid .f9-cf-amt{flex:1 1 30%} .q2-grid .f9-cf-st{flex:1 1 180px} .q2-grid .f9-cf-st .f9-ch{flex:1 1 0} }
.f9-seg{display:flex;gap:4px}.f9-ch{flex:1 1 0;min-height:38px;padding:0 6px;border-radius:6px;border:1.5px solid var(--frame);background:var(--surface);color:var(--ink);font-weight:700;font-size:13.5px;cursor:pointer;white-space:nowrap}
.f9-ch.f9-ok.on{background:#1F6FB2;border-color:#1F6FB2;color:#fff}.f9-ch.f9-buy.on{background:#C62828;border-color:#C62828;color:#fff}
.tf-foot{margin:6px 2px 0;text-align:right;font-weight:700}
.f9-bom{display:flex;flex-direction:column;gap:6px;margin:4px 0 8px}.f9-bl{display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px}.f9-bt{font-size:14px}
@media (max-width:820px){
  .f9-rh{display:none}
  .f9-r{grid-template-columns:22px minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) 34px;grid-template-areas:"n a a a del" "n b b b b" "n d d d d" "n q up amt amt" "n st st st st";padding:8px 6px}
  .f9-r>.f9-c-n{grid-area:n}.f9-r>.f9-c-a{grid-area:a}.f9-r>.f9-c-b{grid-area:b}.f9-r>.f9-c-d{grid-area:d}.f9-r>.f9-c-q{grid-area:q}.f9-r>.f9-c-st{grid-area:st}.f9-r>.f9-c-up{grid-area:up}.f9-r>.f9-c-amt{grid-area:amt;align-self:center}.f9-r>.f9-c-del{grid-area:del}
}
/* FAB009 sheet */
.qc-sheet .f9-tb td{font-size:11.5px;line-height:1.25;padding:1px 4px}.qc-sheet .f9-tb td.f9-num{text-align:right}.qc-sheet .f9-tb td.f9-ctr{text-align:center}.qc-sheet .f9-tb td.f9-left{text-align:left}
.qc-sheet .f10-tb td{font-size:11.5px;line-height:1.25;padding:1px 4px}.qc-sheet .f10-tb td.f10-num{text-align:right}.qc-sheet .f10-tb td.f10-ctr{text-align:center}.qc-sheet .f10-tb td.f10-left{text-align:left}   /* v1335 FAB010 = FAB009 sheet look */
.f9-tot{display:flex;justify-content:flex-end;gap:14px;font-size:11px;padding:4px 6px;border:1px solid #000;border-top:0}.f9-tot b{min-width:90px;text-align:right}
/* v1255 Client BOM grouped by client */
.cb-groups{display:flex;flex-direction:column;gap:14px}
.cb-gh{display:flex;align-items:center;flex-wrap:wrap;gap:4px 10px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--divider);border-left:4px solid var(--steel);border-radius:8px;padding:10px 12px;cursor:pointer;color:var(--ink);font:inherit}
.cb-gn{font-size:16px}.cb-gc{font-size:13px;color:var(--link);font-weight:600}
.cb-gchev{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round;transform:rotate(-90deg);transition:transform .15s}.cb-gh[aria-expanded="true"] .cb-gchev{transform:none}
.cb-gl{margin:8px 0 0 10px;padding-left:8px;border-left:2px solid var(--divider)}
@media (max-width:820px){ .cb-gl{margin-left:4px;padding-left:4px} }

/* v1256 (Kah Poh 12 Nov, design review — approved "1 2 3"):
   1 · white-text badges use the DEEP blue / red in dark mode too (--ok-bg / --bad-bg; the lighter --ok / --bad stay for coloured TEXT on dark) — white text ≥ 4.5:1
   2 · Schedule: a company-holiday Sunday heading = dark text on the yellow (the pink Sunday colour was unreadable on it)
   3 · phone: small buttons (.btn-sm, 28px) get a bigger INVISIBLE tap area (≥ 44px tall), same look */
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]) .sch-b .gantt_scale_cell.sch-sun.sch-hol{color:#1C2530} }
:root[data-theme="dark"] .sch-b .gantt_scale_cell.sch-sun.sch-hol{color:#1C2530}
@media (max-width:820px){ .btn-sm{position:relative} .btn-sm::after{content:"";position:absolute;left:0;right:0;top:-8px;bottom:-8px} }
/* v1258 Client BOM editor: Add line · Cancel · Save on one row (phone too) */
.cb-foot{display:flex;align-items:center;gap:8px;margin-top:8px;flex-wrap:nowrap}
.cb-foot>.fe-actions{margin:0 0 0 auto;padding:0;border:0;display:flex;gap:8px;flex-wrap:nowrap}
@media (max-width:560px){ .cb-foot>.btn,.cb-foot>.fe-actions>.btn{flex:1 1 0;min-width:0;justify-content:center;padding-left:8px;padding-right:8px} .cb-foot>.fe-actions{flex:2 1 0;margin:0} }
/* v1264 Client BOM & Part Map FROZEN LINES (Stock Code method, §14.3): client line + open card line pinned, shrink to slim, stack, slide behind at the end */
#main .sp-job{overflow:visible}
#main .sp-job>.sp-jh{border-radius:7px 7px 0 0}#main .sp-job:not(.on)>.sp-jh{border-radius:7px}
#main .fl-stk{position:sticky;box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
#main .cb-gh.fl-stk{background:var(--surface)}
#main .sp-jh.fl-stk{background:var(--surface-2)}
#main .fl-stk.sc-stk-clip{overflow:hidden}
/* slim = one line: client name + count · card: item no. / section name (badges & lines count hidden) */
#main .cb-gh.fl-stk.sc-stk-now{padding-top:6px;padding-bottom:6px;flex-wrap:nowrap}
#main .cb-gh.fl-stk.sc-stk-now>.status{display:none}
#main .cb-gh.fl-stk.sc-stk-now .cb-gn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
#main .cb-gh.fl-stk.sc-stk-now .cb-gc{white-space:nowrap}
#main .sp-jh.fl-stk.sc-stk-slim{padding-top:6px;padding-bottom:6px;min-height:0}
#main .sp-jh.fl-stk.sc-stk-slim>:not(.tpi-nm):not(.sp-chev){display:none}
@media (max-width:820px){ #main .cb-gh.fl-stk.sc-stk-now .cb-gc{display:none} }
/* v1265: room under the list so an opened box's bottom can always be lifted above the round button (rule §7.1) */
#cbBody,#pmBody,#mcrBody,#jfBody,#tpiBody,#pdsBody{padding-bottom:84px}
/* v1266 (Kah Poh screenshot "where is the side bar colour line?", rule §7.13): an OPEN box's 4px blue bar runs from its heading DOWN TO ITS END — every card of this
   kind (Client BOM, Part Map, Mill Cert Register, 3rd Party Inspector, Job file), not only beside the heading. Client groups: the bar of the client line continues
   down the whole group (phone: nested bars 2px apart). */
.sp-job.on{border-left:4px solid var(--steel)}
.sp-job.on > .sp-jh{box-shadow:none}

.cb-grp.on > .cb-gl{margin-left:0;padding-left:6px;border-left:4px solid var(--steel)}
.cb-grp.on > .cb-gh{border-bottom-left-radius:0}
@media (max-width:820px){ .cb-grp.on > .cb-gl{padding-left:2px} }
/* v1267 RULE 38 fold list kit — Client field setup cards: open card = blue bar down the whole card, slim pinned line = client name */
#pdsBody .pds-card.open{border-left:4px solid var(--steel)}
#main .pds-h.fl-stk{background:var(--surface);box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
#main .pds-h.fl-stk.sc-stk-slim{padding-top:6px;padding-bottom:6px;min-height:0}
#main .pds-h.fl-stk.sc-stk-slim>:not(.pds-n):not(.pd-chev){display:none}
/* v1267 rule 38 P4: the fold kit keeps a closed heading in place itself — the browser's own scroll anchoring would move it again (8px on phone) */
#cbBody,#pmBody,#mcrBody,#jfBody,#tpiBody,#pdsBody{overflow-anchor:none}
/* v1267 rule 38 — TOC master: open group = blue bar down the whole group; pinned section line keeps its colour */
.toc-list .te-g.open{border-left:4px solid var(--steel);border-top-left-radius:0;border-bottom-left-radius:0}
#main .toc-r.head.fl-stk{box-shadow:0 3px 6px -3px rgba(28,37,48,.35)}
.toc-list .te-g{overflow:visible}
/* v1268 rule 38 P8 (Kah Poh 12 Nov "if you think the standard is important, make it"): Project list year panels — an OPEN panel gets the blue bar beside
   its heading AND down the whole panel (heading inset + body border, like Item details) */
#pjBody .panel:not(.collapsed):not([data-nocollapse]) > .panel-head{box-shadow:inset 4px 0 0 var(--steel)}
#pjBody .panel:not(.collapsed):not([data-nocollapse]) > .panel-body{border-left:4px solid var(--steel)}
/* v1269 (Kah Poh phone screenshot "make it more compact"): Client BOM line editor on phone — ↑ ↓ ✕ in ONE row beside the part no. (was 3 high),
   Qty | Unit | From in one row, stock code + ⚠ Unsure + note in one row; smaller gaps. Boxes stay 16px (no iPhone zoom). */
@media (max-width:820px){
  .cb-er{grid-template-columns:18px 62px 64px minmax(0,1fr) 104px;grid-template-areas:"no ref ref ref ac" "no desc desc desc desc" "no qty unit src src" "no code code more more";gap:4px 5px;padding:6px 4px}
  .cb-er .inp{min-height:36px;padding:4px 7px}
  .cb-c-ac{display:flex;flex-direction:row;gap:3px;justify-self:end}
  .cb-c-ac .icon-btn{width:32px;height:34px;min-height:0}
  .cb-c-code{align-self:center;font-size:13px}
  .cb-c-more{gap:5px;min-width:0}.cb-c-more .cb-uns{font-size:13px;gap:4px}.cb-c-more .cb-c-note{min-width:0}
}
.cb-same{color:var(--muted);font-size:12.5px;white-space:nowrap}   /* v1269: our stock code = the client no. (most lines) → short note; a different code is written out */
@media (max-width:820px){ .cb-c-code{font-size:12.5px;overflow-wrap:anywhere} }
/* v1270 (Kah Poh screenshot "line break"): the client group's blue bar runs UNBROKEN from its heading into its list — no gap between them
   (the gap moves inside the list as padding) — Client BOM & Part Map */
.cb-grp.on > .cb-gl{margin-top:0;padding-top:8px}
.cb-grp.on > .cb-gh{border-bottom-left-radius:0;border-bottom-right-radius:0}
/* v1271 (Kah Poh phone screenshot "this 2 line gap big, make it smaller with our standard width"): Project list on phone — the open job's bar sits 2px
   from the open year panel's bar (rule §7.13 / 38: nested bars 2px apart); the job's text stays where it was */
@media (max-width:820px){
  #pjBody .panel:not(.collapsed) table.stack-pj tr.pj-open{margin-left:-16px;padding-left:13px}
  #pjBody .panel:not(.collapsed) table.pj tr.pj-xrow{margin-left:-16px}
}
/* v1278 Design › Construction Dwg (09m-design) — list = Client BOM parts (.cb-grp › .sp-job); only its own small bits here */
.cd-file{display:flex;align-items:center;flex-wrap:wrap;gap:6px 10px}
.cd-more{padding:8px 10px 10px}
.cd-tb td.c-act{white-space:nowrap}
/* v1307: the drawing editor opens IN its line's place (job card), not above the list */
/* v1310 rule 48 (kit, 03b-foldkit flEdIn): ANY page — the editor of a saved line sits in that line's place */
.fl-editing{display:none!important}
tr.fl-edrow>td{padding:6px 0!important;border:0!important;white-space:normal;background:none!important}
.fl-ed-in>.panel{margin:0}
#main .fl-ed-in .panel > .panel-head{position:static}   /* v1311 (Kah Poh photo 16 Nov "the edit page is covering the top section"): a panel heading is normally PINNED under the top bar — inside a list that pinned it over the group lines & over its own first boxes. An editor in its line has a heading that scrolls with it. */
@media (max-width:820px){ table.stack tr.fl-edrow,table.stack tr.fl-edrow>td{display:block!important;width:100%;padding:4px 0!important} table.stack tr.fl-edrow>td::before{content:none!important} }
.cd-tb td[data-l="Date"],.cd-tb td[data-l="Rev"],.cd-tb td[data-l="File"]{white-space:nowrap}   /* v1306: the date in full on ONE line (was stacked), the Drive badge too */
@media (max-width:820px){ .cd-tb td.c-act .act-row{justify-content:flex-start}
  /* phone card: Dwg No. · Title on top, "Rev 0 · Date 13-11-26" on ONE line, file, buttons */
  .cd-tb tr.cd-tr{display:flex;flex-wrap:wrap;gap:2px 12px;align-items:baseline}
  .cd-tb tr.cd-tr>td{padding:1px 0;border:0;width:auto}
  .cd-tb tr.cd-tr>td[data-l="Dwg No."],.cd-tb tr.cd-tr>td[data-l="Title"],.cd-tb tr.cd-tr>td[data-l="File"],.cd-tb tr.cd-tr>td.c-act{flex:1 1 100%}
  .cd-tb tr.cd-tr>td[data-l="Rev"]::before{content:"Rev ";color:var(--muted)}
  .cd-tb tr.cd-tr>td[data-l="Date"]::before{content:"Date ";color:var(--muted)}
  .cd-tb tr.cd-tr>td.c-act{padding-top:4px} }
/* v1279 Construction Dwg editor: one box per attached file (AI fills Dwg No. · Title · Rev · Dwg date) */
.cd-items{display:grid;gap:8px;margin:10px 0 4px}
.cd-it{border:1px solid var(--divider);border-left:4px solid var(--steel);border-radius:8px;padding:8px 10px;background:var(--surface)}
.cd-ih{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-bottom:6px}.cd-in{overflow-wrap:anywhere;min-width:0}.cd-irm{margin-left:auto}
.cd-ig{display:grid;grid-template-columns:minmax(120px,1fr) minmax(160px,2fr) 76px 160px;gap:6px 8px;align-items:end}
.cd-if{min-width:0}.cd-if label{display:block;font-size:12.5px;font-weight:700;color:var(--muted);margin-bottom:2px}.cd-if .inp{width:100%;min-width:0}
.cd-aib{margin:0}
@media (max-width:820px){ .cd-ig{grid-template-columns:76px minmax(0,1fr)}.cd-f-no,.cd-f-ti{grid-column:1 / -1} }
.cd-if.cd-f-dt .inp{width:100%!important;min-width:0;max-width:180px}
@media (max-width:820px){ .cd-ig{grid-template-columns:64px minmax(0,1fr)}.cd-if.cd-f-dt .inp{max-width:none} }
/* v1280 (Kah Poh photo, Job file desktop: "the side line is overlapping"): the open card draws the ONE side bar (rule 38, v1267) — the body inside must not draw a 2nd one
   beside it (.sp-forms had its own 4px bar → 8px wide) & the section captions (OUR FORMS · MDR) start in line with the rows, not on the bar. */
.sp-job.on > .sp-forms,.sp-job.on > .tpi-b{border-left:0}   /* + 3rd Party Inspector (found by t109 P8double) */
.sp-forms > .jf-sh{padding-left:14px;padding-right:14px}
@media (max-width:820px){ .sp-forms > .jf-sh{padding-left:12px;padding-right:12px} }
@media (max-width:820px){ .pm-tb tr.pm-tr{padding-left:10px;padding-right:10px} }   /* v1280: Part Map phone rows — text clear of the side bar (was 4px from it; t109 P8text) */
.cd-sort{margin:8px 10px 0;border:0;padding:4px 4px;background:transparent}   /* v1281 phone: Sort by Dwg No. / Title inside the job card */
/* v1282 Client BOM editor: the job's construction drawings to tick (each = a BOM line) */
.cb-dw{display:grid;gap:2px;margin:0 0 10px;padding:8px 10px;border:1px solid var(--divider);border-radius:8px;background:var(--surface)}
.cb-dw>.btn{justify-self:start;margin-bottom:4px}
.cb-dwl{display:flex;align-items:baseline;flex-wrap:wrap;gap:2px 10px;width:fit-content;max-width:100%;padding:6px 4px;min-height:36px;cursor:pointer}
.cb-dwl input{flex:none;width:18px;height:18px;align-self:center;margin:0}.cb-dwn{font-family:var(--mono);overflow-wrap:anywhere}.cb-dwt{overflow-wrap:anywhere}
.cb-dwv{margin-left:8px;min-height:26px;padding:1px 8px}.cb-job{margin-top:2px}
@media (max-width:820px){ .cb-dwl{min-height:44px} }
@media (max-width:820px){ .cd-tb tr.cd-tr{padding:10px 12px} }   /* v1282: Construction Dwg phone rows clear of the side bar (rule 38 one bar / no text on the bar) */
@media (hover:hover) and (pointer:fine){ .tpi-vp{cursor:grab} .tpi-vp.pv-grabbing{cursor:grabbing;user-select:none} }   /* v1283: hand drag in the file viewer, like every PDF preview */
@media (max-width:820px){ .mcr-tb tr.mcr-tr{padding-left:10px;padding-right:10px} .mcr-tb tr.mcr-dt>td{padding-left:10px;padding-right:10px} }   /* v1283: Mill Cert Register phone rows clear of the side bar (t109 P8text) */
/* v1287 (Kah Poh phone sketch, Client BOM line editor): the line No. sits at the TOP (beside the part no.), the 3 rows under it start at the LEFT edge;
   Qty · Unit · From small with ⚠ To check NEXT TO From; stock code + a BIGGER Note box on the last row. (.cb-c-more = display:contents → its 2 parts are grid cells) */
@media (max-width:820px){
  .cb-er{grid-template-columns:20px 27px 42px minmax(0,1fr) 6px 93px;grid-template-areas:"no ref ref ref ac ac" "desc desc desc desc desc desc" "qty qty unit src src chk" "code code code note note note";gap:4px 5px;padding:6px 6px}
  .cb-c-no{align-self:center}
  .cb-c-more{display:contents}
  .cb-c-more .cb-uns{grid-area:chk;justify-self:end;font-size:12.5px;gap:3px;min-height:36px}
  .cb-c-more .cb-c-note{grid-area:note;min-width:0;width:100%}
  .cb-er .cb-c-src{padding-right:2px}
  .cb-er .cb-c-qty,.cb-er .cb-c-unit{padding-left:5px;padding-right:4px}
}
/* v1288 (Kah Poh: "bold the list no.; qty box in same column, confusing"): the line No. is a solid chip — it can't be read as a value of the boxes under it */
@media (max-width:820px){
  .cb-er:not(.cb-erh) .cb-c-no{align-self:center;justify-self:start;min-width:22px;height:22px;padding:0 5px;border-radius:11px;background:var(--steel);color:#fff;font-weight:800;font-size:13px;line-height:22px;text-align:center}
  .cb-er{grid-template-columns:24px 23px 42px minmax(0,1fr) 6px 93px}
}
@media (min-width:821px){ .cb-er:not(.cb-erh) .cb-c-no{font-weight:800;color:var(--ink)} }
/* v1289: keyboard room on EVERY page while typing on a phone / tablet (07-form-kit rv-kb2) — the bottom rows & buttons can be scrolled above the keyboard */
html.rv-kb2:not(.rv-kb) main{padding-bottom:max(var(--rvkb2,0px),28vh)!important}
/* v1290 Construction Dwg: a job with several items → a caption per item inside the job card */
.cd-ush{color:var(--ink);text-transform:none;letter-spacing:0;font-size:14px}.cd-usc{color:var(--muted);font-weight:600}.cd-ul{font-weight:700;color:var(--ink)}
.cb-taken{grid-column:1/-1;margin:0}   /* v1293 Client BOM › New BOM: "not listed — already has a BOM" note */
.cb-dwi{display:inline-flex;flex-wrap:wrap;align-items:center;gap:4px 6px}   /* v1298: Dwg button + "drawing changed" badges on a BOM line */
.cd-inbom{margin-left:8px}   /* v1298 Construction Dwg: this drawing is used by a Client BOM line */
/* v1300 RULE 46: a value that can't be changed = caption + bold value on one line (never a greyed box) — fkLocked (07-form-kit) */
.fk-locks{grid-column:1/-1;display:grid;gap:0;margin:0 0 4px}
.fk-lock{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 12px;padding:8px 0;border-bottom:1px solid var(--divider)}
.fk-lock:last-child{border-bottom:0}
.fk-lk{font-size:12px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--muted);white-space:nowrap}
.fk-lv{font-weight:700;color:var(--ink);overflow-wrap:anywhere;min-width:0;white-space:pre-line}.fk-lv.mut{color:var(--muted);font-weight:400}
/* v1345 HR › Staff (js/09n-hr.js) — cards = the 3rd Party Inspector look (sp-job / tpi-*) */
.hr-imp{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin:0 0 12px;padding:8px 12px;border-radius:8px;background:var(--hold);color:var(--hold-ink);font-size:14px}
.hr-imp .btn{margin-left:auto}
.hr-eh{font-weight:700;font-size:15px;margin:10px 0 -2px;padding-bottom:3px;border-bottom:1px solid var(--line,#D5DBE1)}
#hrsDept{width:auto;max-width:100%}
.oc-stnm{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 8px;padding:6px 2px}
.oc-stlk{font-size:13px;color:var(--link);white-space:nowrap}
.hr-ochint{margin-top:4px}
.oc-stsc{display:inline-block;padding:6px 2px}
/* v1352 staff photo — Staff Profile card / editor & Organization Chart box */
.hr-ph{display:flex;align-items:flex-end;gap:10px;margin:2px 0 6px}.hr-ph img{width:84px;height:104px;object-fit:cover;border-radius:6px;border:1px solid var(--line,#D5DBE1)}
.hr-phrow{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.hr-phimg{width:56px;height:70px;object-fit:cover;border-radius:5px;border:1px solid var(--line,#D5DBE1)}
.hr-phtk{display:inline-flex;align-items:center;gap:6px;width:fit-content;margin-top:6px;font-size:14px}.hr-phtk input{cursor:pointer}
.oc-ph{padding:6px 0 0;background:#fff}.oc-ph img{width:48px;height:60px;object-fit:cover;border-radius:4px;display:block;margin:0 auto}
/* v1353 Staff Profile editor: heading + Cancel / Save pinned under the top bar (also when the editor sits in its line — overrides the v1311 static rule for THIS editor only) */
#main .panel.hr-edp > .panel-head.hr-edh,#main .fl-ed-in .panel.hr-edp > .panel-head.hr-edh{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px));z-index:4;background:var(--surface,#fff);display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;box-shadow:0 3px 6px -4px rgba(28,35,48,.35)}
.hr-edh h2{flex:1 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hr-edh .hr-edacts{margin:0;flex:0 0 auto}
.hr-edh .hr-ederr{flex:1 1 100%;margin:0}
/* v1354 landing between Staff Profile & Organization Chart */
.oc-li .n .oc-stlk{margin-left:8px;font-size:13px;font-weight:600}
.oc-li.oc-hit{background:rgba(36,87,230,.14);transition:background .6s}
/* v1355 (Kah Poh 17 Nov: "in SH001, pin the header while scroll down"): an OPEN section heading (A. … G.) stays pinned right under the form heading
   (top bar › form heading › section heading) while its section scrolls; at the end of the section it slides away behind the form heading. */
.e6-sec.sh-sec{overflow:visible}
.e6-sec.sh-sec > .e6-sech{border-radius:9px 9px 0 0}.e6-sec.sh-sec > .e6-sech[aria-expanded="false"]{border-radius:9px}
#main .e6-sec.sh-sec > .e6-sech[aria-expanded="true"]{position:sticky;top:calc(env(safe-area-inset-top,0px) + var(--hdr,64px) + var(--ph,49px));z-index:3;box-shadow:0 3px 6px -3px rgba(28,35,48,.35)}
.sh-subc{display:grid;grid-template-columns:1fr 1fr;gap:8px}@media (max-width:560px){.sh-subc{grid-template-columns:1fr}}
.sh-subh{margin-top:12px}
.sh-subco{display:flex;flex-direction:column;gap:6px}
.qc-sheet .sh-jsa{table-layout:fixed;width:100%}.qc-sheet .sh-jsa td:nth-child(7),.qc-sheet .sh-jsa td:nth-child(9){white-space:nowrap}   /* v1360 risk / residual on one line */
/* v1361 (Kah Poh 18 Nov, SH001 PDF: "the title colour is not black, looks grey … the font size in report is small"): SH001 sheets had picked up the SCREEN heading
   style (grey #556170, IBM Plex) & 9.5–10.5px text. Now = the report standard of every other form (FAB009 / FAB010 / QC): black, Times New Roman, title 21px bold,
   text 12px, tables 11.5px, JSA 10.5px. Guard: t129. */
.qc-sheet.sh-sheet,.qc-sheet.sh-sheet *{color:#000}
.qc-sheet.sh-sheet h1,.qc-sheet.sh-sheet h2,.qc-sheet.sh-sheet h3,.qc-sheet.sh-sheet h4,.qc-sheet.sh-sheet th,.qc-sheet.sh-sheet .sh-ti,.qc-sheet.sh-sheet .sh-h2,.qc-sheet.sh-sheet .sh-h3{font-family:inherit}
.qc-sheet.sh-sheet{font-size:12px}
.qc-sheet.sh-sheet .sh-ti{font-size:21px;font-weight:700}
.qc-sheet.sh-sheet .sh-h2{font-size:14px;font-weight:700}.qc-sheet.sh-sheet .sh-h3{font-size:12.5px;font-weight:700}
.qc-sheet.sh-sheet .sh-co{font-size:11px}
.qc-sheet.sh-sheet .sh-tb{font-size:11.5px}.qc-sheet.sh-sheet .sh-tb th{font-size:11.5px}
.qc-sheet.sh-sheet .sh-jsa,.qc-sheet.sh-sheet .sh-jsa th{font-size:10.5px}
.qc-sheet.sh-sheet .sh-att{font-size:11.5px}
/* v1362 (Kah Poh 18 Nov: "still feel the text size in SH001 PDF is small — use the font size like our forms"): = the sheet standard (.qc-sheet 15px · QC tables .qs-tb 14px):
   text & tables 14px, section headings 16px / 14.5px bold, title 21px bold, JSA (landscape) 14px like .q8-sheet. */
.qc-sheet.sh-sheet{font-size:14px;line-height:1.3}
.qc-sheet.sh-sheet .sh-h2{font-size:16px}.qc-sheet.sh-sheet .sh-h3{font-size:14.5px}
.qc-sheet.sh-sheet .sh-co{font-size:13px}.qc-sheet.sh-sheet .sh-att{font-size:13px}
.qc-sheet.sh-sheet .sh-tb,.qc-sheet.sh-sheet .sh-tb th{font-size:14px}
.qc-sheet.sh-sheet .sh-jsa,.qc-sheet.sh-sheet .sh-jsa th{font-size:14px}
.qc-sheet.sh-sheet .sh-bd{font-size:14px}   /* v1362: the body wrapper held bullets / paragraphs at 12px */
.qc-sheet.sh-sheet .sh-jsa th{white-space:normal;overflow-wrap:anywhere}   /* v1362: "Residual risk (L×S)" wraps inside its column, never over PIC */
/* v1365 (Kah Poh 18 Nov SH001 PDF): header = company name + reg. no. on one line, address below · all text JUSTIFIED, no hyphen breaks · abbreviations table */
.qc-sheet .sh-hn{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}.qc-sheet .sh-hreg{font-size:11px}
.qc-sheet.sh-sheet .sh-p,.qc-sheet.sh-sheet .sh-li > span:last-child{text-align:justify;hyphens:none;-webkit-hyphens:none}
/* v1371 (his "for text in table, no need to be justify, e.g. 2.3"): table text is LEFT-aligned (rule 4f) */
.qc-sheet.sh-sheet .sh-tb td{text-align:left;hyphens:none;-webkit-hyphens:none}
.qc-sheet.sh-sheet .sh-jsa td:nth-child(1),.qc-sheet.sh-sheet .sh-jsa td:nth-child(5),.qc-sheet.sh-sheet .sh-jsa td:nth-child(6){text-align:center}
.qc-sheet.sh-sheet .sh-abbr td:first-child{width:18%;font-weight:700;text-align:left}
/* v1366 SH001 2.1 roles: Name column wide enough for "Mr Wong Kah Poh" & "+60 12-251 5918" on one line each; names left-aligned (justify spread the phone) */
.qc-sheet.sh-sheet .sh-roles{table-layout:fixed}.qc-sheet.sh-sheet .sh-roles td:nth-child(1){width:30%}.qc-sheet.sh-sheet .sh-roles td:nth-child(2){width:26%;text-align:left}
.qc-sheet.sh-sheet .sh-tel{white-space:nowrap}
.qc-sheet.sh-sheet .sh-roles th:nth-child(1),.qc-sheet.sh-sheet .sh-roles td:nth-child(1){width:31%;text-align:left}.qc-sheet.sh-sheet .sh-roles th:nth-child(2),.qc-sheet.sh-sheet .sh-roles td:nth-child(2){width:24%;text-align:left}.qc-sheet.sh-sheet .sh-roles th:nth-child(3){width:45%}
/* v1367 SH001 portal heading tag "PDF 2.1" = where the section prints */
.sh-pdfref{flex:none;margin-left:auto;margin-right:8px;font-size:12px;font-weight:600;padding:1px 7px;border-radius:10px;background:rgba(255,255,255,.18);color:inherit;white-space:nowrap}
.md-subh .sh-pdfref{background:rgba(128,128,128,.18);color:inherit;margin-left:8px}
/* v1367: narrow JSA columns (Activity · Hazard · Possible effect · PIC) left-aligned — justify left big gaps in a few words; Control measures stays justified */
.qc-sheet.sh-sheet .sh-jsa td:nth-child(2),.qc-sheet.sh-sheet .sh-jsa td:nth-child(3),.qc-sheet.sh-sheet .sh-jsa td:nth-child(4),.qc-sheet.sh-sheet .sh-jsa td:nth-child(10){text-align:left}
/* v1368 SH001 Contents (page 1) */
.qc-sheet.sh-sheet .sh-toc td{border:0;border-bottom:1px dotted #999;padding:2px 4px;text-align:left}.qc-sheet.sh-sheet .sh-toc{border:0}.qc-sheet.sh-sheet .sh-toc .sh-tocp{width:60px;text-align:right}
/* v1372 (his "for L & S column & value, make it center"): every L / S column — heading & numbers — centred (JSA & the L / S table) */
.qc-sheet.sh-sheet .sh-jsa th:nth-child(5),.qc-sheet.sh-sheet .sh-jsa th:nth-child(6),.qc-sheet.sh-sheet .sh-ls th:nth-child(1),.qc-sheet.sh-sheet .sh-ls th:nth-child(3),.qc-sheet.sh-sheet .sh-ls td:nth-child(1),.qc-sheet.sh-sheet .sh-ls td:nth-child(3){text-align:center}
/* v1372 (his "review & approval: signature & date at center — this is a signing box, make the box height higher") */
.qc-sheet.sh-sheet .sh-sg td{height:64px;vertical-align:middle}.qc-sheet.sh-sheet .sh-sg th:nth-child(4),.qc-sheet.sh-sheet .sh-sg th:nth-child(5),.qc-sheet.sh-sheet .sh-sg td:nth-child(4),.qc-sheet.sh-sheet .sh-sg td:nth-child(5){text-align:center}.qc-sheet.sh-sheet .sh-sg th:nth-child(4){width:24%}.qc-sheet.sh-sheet .sh-sg th:nth-child(5){width:14%}

/* ===== v1373 REPORT STANDARD (Kah Poh 18 Nov: "a standard format for the general items across the 4 types") — the ONE place for title · company name · logo · font · footer of
   EVERY printed sheet. Values = RP_STD in js/07f-report-std.js (Forms › Master sheets › Report standard); t133 checks every form against it. Change both together. ===== */
.qc-sheet,.qc-sheet.f5-sheet,.qc-sheet.fab6-sheet{font-family:"Times New Roman",Times,serif}
.qc-sheet :is(.q8-ti,.qs-ti,.e6-ti,.f5-ti,.sh-ti){font-size:21px !important;font-weight:700 !important;text-transform:uppercase !important;color:#000 !important}
.qc-sheet :is(.q8-co,.qs-co,.e6-co,.f5-cn1,.sh-hn > b){font-size:16px !important;font-weight:700;color:#000}
.qc-sheet :is(.q8-logo,.qs-logo,.e6-hl,.f5-lg,.sh-hl) > img{height:56px !important;max-height:56px !important;width:auto}
.qc-sheet .rp-ft{display:flex;justify-content:space-between;gap:12px;font-size:11px !important;text-align:left;color:#000}
.qc-sheet .qs-head{grid-template-columns:76px 1fr 140px}   /* v1373: 21px UPPERCASE titles need the room (QC030 "POSITIVE MATERIAL IDENTIFICATION REPORT" on one line); "MDR Section 2.4" still fits */
.qc-sheet .q32-shn{color:#000}   /* v1373: "Sheet : k of n" black like every printed text (it took the sketch-box hint grey) */
/* v1374 (Kah Poh 18 Nov "4b all 14px"): FAB005 body text 14px like the report standard (was 12.5 / 13px; header address & stamp unchanged) */
.qc-sheet.f5-sheet{font-size:14px}.qc-sheet.f5-sheet .f5-ti{margin-top:16px}.qc-sheet.f5-sheet :is(.f5-sti,.f5-k,.f5-c,.f5-v,.f5-it,.f5-ds,.f5-rm,.f5-am,.f5-wd,.f5-sgk,.f5-sgr,th){font-size:14px !important}
.qc-sheet.f5-sheet table.f5-b2 td.f5-rm{width:40px;white-space:nowrap}   /* v1374: "RM" stays on one line at 14px (total row broke it "R / M") */
.qc-sheet .rp-no{white-space:nowrap;font-size:12px;font-weight:700}   /* v1375: the document no. line in the top-right box */
/* v1375 (Kah Poh 18 Nov "4b 2 use 14px"): FAB009 / FAB010 text 14px like the report standard (were the QC032 dense sizes 13 / 11.5px; QC032 stays dense) */
.qc-sheet :is(.f9-k,.f9-sa,.f10-k,.f10-sa){font-size:14px !important}
.qc-sheet :is(.f9-tb,.f10-tb) :is(td,th){font-size:14px !important}.qc-sheet :is(.f9-tot,.f10-iw){font-size:14px !important}
.qc-sheet .q8-head{grid-template-columns:74px 1fr 170px}.qc-sheet :is(.q8-ref,.qs-ref) > div{white-space:nowrap}.qc-sheet :is(.q8-ref,.qs-ref) > div:nth-child(2){font-size:12.5px}   /* v1375: the document no. on ONE line in the top-right box (RV-R0119-02-POL-01 Rev.0) */
.qc-sheet :is(.f9-tb,.f10-tb) th{line-height:1.15 !important;letter-spacing:0 !important}   /* v1375: 2-line headings ("PLAN / DELIVERY DATE") do not overlap at 14px */
.qc-sheet .qs-head .qs-tt{padding-top:3px;padding-bottom:3px}.qc-sheet .qs-head .qs-ti{line-height:1.15}.qc-sheet .qs-head .qs-ref > div{line-height:1.25}   /* v1376 (audit): the 21px title / 3-line top-right box made the header taller → QC002B & QC016 page 1 ran 14 / 5px past the page; tighter header spacing keeps every page inside */
/* v1382 (Kah Poh 19 Nov photo: "put the badge button in a line"): the hint & its jump button stay on ONE line — the hint wraps beside the button, the button never drops below */
.sh-golinks{flex-wrap:nowrap}.sh-golinks .md-hint{flex:1 1 auto;min-width:0}.sh-golinks .sh-go{flex:none}
.e6-sech .sh-secw{flex:none;margin-left:auto;margin-right:6px;font-size:12px;padding:2px 8px}.e6-sech .sh-secw + .sh-pdfref{margin-left:0}   /* v1382: ⚠ check on a section heading */
/* v1383 Clients › Add New Client */
.cn-ai{border:1px dashed var(--frame);border-radius:8px;padding:10px 12px;margin:0 0 12px}.cn-ait{margin-bottom:6px}.cn-aib{display:flex;flex-wrap:wrap;align-items:center;gap:6px 8px}.cn-fn{font-size:13px;color:var(--muted);word-break:break-all}
.cn-dup{margin:6px 0 0}
.cn-or{margin-top:10px;padding-top:10px;border-top:1px dashed var(--frame)}.cn-orl{font-weight:700}.cn-or textarea{margin:6px 0}   /* v1384 paste box */
.cn-ait{display:flex;flex-wrap:wrap;align-items:center;gap:4px 6px}.cn-tipw{display:contents}.cn-tipn{flex:1 1 100%;margin:2px 0 0}   /* v1388 the hint behind the "i" opens on its own line */
