/* MapleCRM UI kit (original, 2026-11-17). Warm neutral + maple red. */
:root{--red:#8f1d1d;--red-dark:#6f1414;--cream:#faf7f2;--ink:#1f2328;--muted:#6b7280;--line:#e5e1da;--card:#fff;--ok:#1f7a4d;--warn:#b45309;--bad:#b91c1c;--side:#f3efe8;--radius:10px;--brand-name:#0b6b72;--signed-in:#5fd411}
*{box-sizing:border-box}html,body{margin:0;padding:0}
body{font:15px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif;color:var(--ink);background:var(--cream)}
a{color:var(--red);text-decoration:none}a:hover{text-decoration:underline}
h1{font-size:24px;margin:0 0 6px}h2{font-size:18px;margin:0 0 10px}small,.muted{color:var(--muted)}
.btn{display:inline-flex;align-items:center;gap:6px;padding:8px 14px;border-radius:8px;border:1px solid var(--red);background:var(--red);color:#fff;font:inherit;cursor:pointer;white-space:nowrap}
.btn:hover{background:var(--red-dark);text-decoration:none}.btn-ghost{background:transparent;color:var(--red)}.btn-ghost:hover{background:#f6e9e9}
/* destructive actions: always red, filled on hover; every one asks for confirmation first */
.btn-danger{background:#fff;color:#b42318;border-color:#b42318}.btn-danger:hover{background:#b42318;color:#fff}
.btn-sm{padding:4px 10px;font-size:13px}.btn[disabled]{opacity:.5;cursor:default}
.input,select.input,textarea.input{width:100%;padding:9px 11px;border:1px solid var(--line);border-radius:8px;font:inherit;background:#fff;color:var(--ink)}
/* one height for every text input and dropdown (textareas keep their rows; compact table inputs are 32px) */
input.input,select.input,.input:not(textarea):not(div){height:40px;box-sizing:border-box}select.input{padding-top:0;padding-bottom:0}
.input:focus{outline:2px solid #e8b4b4;border-color:var(--red)}
label.f{display:block;font-size:13px;color:var(--muted);margin:10px 0 4px}
.hint{font-size:12px;color:var(--muted)}
.card{background:var(--card);border:1px solid var(--line);border-radius:var(--radius);padding:18px;margin-bottom:18px}
.grid{display:grid;gap:14px}.grid-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-4{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.kpi{background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:14px 16px}.kpi .n{font-size:28px;font-weight:600}.kpi .l{color:var(--muted);font-size:13px}
table.t{width:100%;border-collapse:collapse;font-size:14px}table.t th{text-align:left;font-weight:600;color:var(--muted);font-size:12px;text-transform:uppercase;letter-spacing:.03em;padding:8px 10px;border-bottom:1px solid var(--line)}
table.t td{padding:9px 10px;border-bottom:1px solid #f0ece5;vertical-align:top}table.t tr:hover td{background:#fbf8f3}
.chip{display:inline-block;padding:2px 9px;border-radius:999px;font-size:12px;background:#eee8df;color:#4b4b4b}.chip-ok{background:#def5e8;color:var(--ok)}.chip-bad{background:#fde4e4;color:var(--bad)}.chip-main{background:#f6e3e3;color:var(--red)}
.alert{padding:10px 14px;border-radius:8px;margin:10px 0;font-size:14px}.alert-bad{background:#fde4e4;color:#7a1a1a}.alert-ok{background:#def5e8;color:#135c38}
/* app layout */
.topbar{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:16px;height:56px;padding:0 18px;background:#fff;border-bottom:1px solid var(--line)}
.brand{display:flex;align-items:center;gap:8px;font-weight:700;font-size:18px;color:var(--red)}.brand:hover{text-decoration:none}
.brand-leaf{width:14px;height:14px;background:var(--red);clip-path:polygon(50% 0,62% 30%,88% 22%,78% 48%,100% 60%,72% 72%,80% 100%,50% 82%,20% 100%,28% 72%,0 60%,22% 48%,12% 22%,38% 30%);display:inline-block}
.topbar-org{color:var(--muted);font-size:14px}.topbar-right{margin-left:auto;display:flex;align-items:center;gap:14px}
.who{font-size:14px}.who small{display:block;font-size:12px;color:var(--muted);line-height:1.1}
.bell{position:relative;cursor:pointer}.bell-count{position:absolute;top:-6px;right:-10px;background:var(--red);color:#fff;font-size:10px;border-radius:999px;padding:1px 5px}
.menu-toggle{display:none;background:none;border:0;font-size:22px;cursor:pointer}
.layout{display:flex;min-height:calc(100vh - 56px - 44px)}
.sidenav{width:230px;flex:0 0 230px;background:#2b2f36;border-right:1px solid #22252b;padding:14px 0}
.sidenav a{display:block;padding:10px 20px;color:#d9dce2}.sidenav a:hover{background:#363b44;color:#fff;text-decoration:none}.sidenav a.active{background:#1f2227;color:#fff;border-right:3px solid #e0514c;font-weight:600}
.content{flex:1;min-width:0;padding:24px}
.footer{display:flex;justify-content:space-between;padding:12px 24px;font-size:13px;color:var(--muted);border-top:1px solid var(--line);background:#fff}
.pagebar{display:flex;align-items:center;gap:14px;flex-wrap:wrap;margin-bottom:16px}.pagebar .spacer{flex:1}
.modal-bg{position:fixed;inset:0;background:rgba(0,0,0,.35);display:flex;align-items:center;justify-content:center;z-index:50;padding:16px}
.modal{background:#fff;border-radius:12px;padding:22px;width:100%;max-width:520px;max-height:92vh;overflow:auto}
.modal h2{margin-top:0}.modal .actions{display:flex;justify-content:flex-end;gap:10px;margin-top:16px}
.org-head td{background:#f3efe8;font-weight:600}
@media (max-width:860px){.sidenav{position:fixed;left:-240px;top:56px;bottom:0;transition:left .2s;z-index:30}.sidenav.open{left:0}.menu-toggle{display:block}.topbar-org{display:none}.content{padding:16px}.who small{display:none}}
/* sign-in */
.login-wrap{min-height:100vh;display:grid;grid-template-columns:1fr 1fr}.login-brand{background:var(--red);color:#fff;padding:48px;display:flex;flex-direction:column;justify-content:center}
.login-brand h1{font-size:34px;margin:0 0 8px}.login-brand p{opacity:.9;max-width:420px}
.login-brand>.muted{color:#f0d9b7}
/* Original decorative artwork stays in flow, below the complete brand copy. */
.login-art{display:block;flex:none;width:100%;max-width:540px;height:auto;margin:28px auto 0}
.login-side{padding:48px;display:flex;flex-direction:column;justify-content:center;background:var(--cream)}
.cards{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(200px,1fr))}
.door{display:block;background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;color:var(--ink)}.door:hover{border-color:var(--red);text-decoration:none;box-shadow:0 4px 14px rgba(0,0,0,.06)}
.door b{display:block;font-size:17px;color:var(--red)}.door span{font-size:13px;color:var(--muted)}
.login-form{max-width:420px}.login-foot{margin-top:28px;font-size:12px;color:var(--muted)}
@media (max-width:760px){.login-wrap{grid-template-columns:1fr}.login-brand{padding:28px}.login-art{max-width:360px;margin-top:12px}.login-side{padding:28px}}
/* sign-in: password eye + captcha row */
.pw-wrap{position:relative}.pw-wrap .input{padding-right:44px}
.pw-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:none;border:0;color:var(--muted);cursor:pointer;padding:6px;line-height:0;border-radius:6px}.pw-toggle:hover{color:var(--red);background:#f6e9e9}
.pw-toggle .eye-closed{display:none}.pw-toggle[aria-pressed=true] .eye-open{display:none}.pw-toggle[aria-pressed=true] .eye-closed{display:block}
.captcha-row{display:flex;align-items:center;gap:8px}.captcha-img{flex:none;line-height:0}.captcha-img svg{display:block;width:168px;height:46px;border:1px solid var(--line);border-radius:8px}.captcha-row .input{flex:1;min-width:0}
/* shell: grouped sidebar + header dropdowns */
.nav-group{padding:6px 0 8px;border-bottom:1px solid #353a42}.nav-group:last-child{border-bottom:0}.nav-title{padding:8px 20px 4px;font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#8d93a0}
.sidenav a{display:flex;align-items:center;gap:8px;padding:7px 20px;font-size:14px}.nav-phase{margin-left:auto;font-size:10px;color:#c9cdd6;background:#444a55;border-radius:999px;padding:1px 6px}
.sidenav{overflow-y:auto}
.tb-dd{position:relative}.tb-dd summary{list-style:none;cursor:pointer}.tb-dd summary::-webkit-details-marker{display:none}
.tb-btn{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:8px;font-size:14px;color:var(--ink)}.tb-btn:hover{background:#f3efe8}
.tb-count{background:#e9e3d8;border-radius:999px;padding:0 7px;font-size:12px}
.tb-panel{position:absolute;top:36px;left:0;background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 10px 30px rgba(0,0,0,.08);padding:10px;z-index:40;min-width:260px;max-height:70vh;overflow:auto}
.tb-panel a{display:block;padding:5px 10px;border-radius:6px;color:var(--ink);font-size:14px}.tb-panel a:hover{background:#f6f2ea;text-decoration:none}
.tb-group{padding:4px 0}.tb-group-title{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);padding:4px 10px}
.tb-panel.tb-stats{display:grid;grid-template-columns:1fr;min-width:240px}.tb-stats a{display:flex;align-items:center;gap:8px}.tb-stats strong{margin-left:auto;font-variant-numeric:tabular-nums}.dot{width:8px;height:8px;border-radius:50%;display:inline-block}
.tb-panel:has(> .tb-group){columns:2;column-gap:10px;min-width:520px}.tb-group{break-inside:avoid}
.tb-clock{font-size:13px;color:var(--muted)}
@media (max-width:860px){.tb-clock,.topbar-org{display:none}.tb-panel:has(> .tb-group){columns:1;min-width:260px}}
/* orders */
.tabs{display:flex;gap:2px;border-bottom:1px solid #d9d2c5;margin-bottom:14px;flex-wrap:wrap;padding-left:2px}.tab{padding:9px 16px;color:var(--red);border:1px solid transparent;border-radius:7px 7px 0 0;margin-bottom:-1px;background:transparent;cursor:pointer}.tab:hover{text-decoration:none;border-color:#ebe5da #ebe5da #d9d2c5;background:rgba(255,255,255,.5)}.tab.active{color:var(--ink);background:#fff;border-color:#d9d2c5 #d9d2c5 #fff;font-weight:600}   /* Toggleable / Dynamic Tabs (Sunny 2026-11-21): boxed active tab, open bottom, others as links */
.order-cards{display:grid;gap:12px;grid-template-columns:repeat(auto-fill,minmax(360px,1fr))}
.order-card{display:flex;gap:12px;background:#fff;border:1px solid var(--line);border-radius:var(--radius);padding:12px;color:var(--ink)}.order-card:hover{text-decoration:none;border-color:#d8b4b4;box-shadow:0 4px 14px rgba(0,0,0,.05)}
.order-cover{width:110px;height:110px;object-fit:cover;border-radius:8px;flex:none;background:#f3efe8}.order-cover-empty{display:flex;align-items:center;justify-content:center;font-size:12px;color:var(--muted)}
.order-body{min-width:0;display:flex;flex-direction:column;gap:3px;font-size:13px}.order-title{font-size:16px;font-weight:600}.order-facts{font-size:13px}
.form-grid{display:grid;gap:0 16px;grid-template-columns:repeat(auto-fit,minmax(220px,1fr))}
/* order details */
.gallery{display:flex;gap:10px;flex-wrap:wrap}.gallery figure{margin:0;position:relative;width:150px}.gallery img{width:150px;height:150px;object-fit:cover;border-radius:8px;border:1px solid var(--line);display:block}
.gallery figure.cover img{outline:3px solid var(--red)}.gallery .g-actions{display:flex;gap:4px;margin-top:4px}.gallery .g-cover{position:absolute;top:6px;left:6px;background:var(--red);color:#fff;font-size:11px;padding:2px 7px;border-radius:999px}
.lines-table td input.input,.lines-table td select.input{padding:5px 7px;font-size:13px;height:32px}.lines-table th,.lines-table td{white-space:nowrap}.lines-wrap{overflow:auto}
.money-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fit,minmax(170px,1fr))}
.sales-table td.n,.sales-table th.n{text-align:right;font-variant-numeric:tabular-nums}
/* colour index */
.ci-search{display:flex;gap:10px;align-items:center;margin-bottom:14px;flex-wrap:wrap}.ci-search .input{max-width:420px}.ci-search input[type=color]{width:46px;height:40px;border:1px solid var(--line);border-radius:8px;background:#fff;padding:2px}
.ci-grid{display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}.swatch{border-radius:10px;padding:12px;min-height:110px;position:relative;font-size:12px;display:flex;flex-direction:column;gap:2px}.sw-code{font-weight:700;font-size:13px}.sw-hex{opacity:.85}.sw-copy{position:absolute;right:8px;bottom:8px;border:0;background:rgba(255,255,255,.7);color:#1f2328;border-radius:6px;padding:2px 7px;cursor:pointer;font-size:11px}
/* section tabs under the top bar */
.subbar{position:sticky;top:56px;z-index:19;display:flex;align-items:center;gap:2px;padding:0 18px;background:#fff;border-bottom:1px solid var(--line);overflow-x:auto;white-space:nowrap}
.subbar-title{font-size:12px;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-right:12px}
.subtab{display:inline-flex;align-items:center;gap:6px;padding:10px 12px;color:var(--ink);border-bottom:2px solid transparent;font-size:14px}.subtab:hover{text-decoration:none;background:#faf7f2}.subtab.active{border-bottom-color:var(--red);font-weight:600;color:var(--red)}
.subtab-action{margin-left:auto;color:var(--red);font-weight:600}
.layout{min-height:calc(100vh - 56px - 44px - 41px)}
@media (max-width:860px){.subbar{top:56px}.subbar-title{display:none}}
/* top bar right cluster (SunnyQms style) */
.tb-chip{display:inline-flex;align-items:center;gap:6px;background:#f1f3f6;border-radius:999px;padding:6px 12px;font-size:13px;color:#2b2f36}
.tb-device{display:inline-flex;align-items:center;gap:6px;font-size:13px;color:var(--muted)}
.tb-icon{display:inline-flex;align-items:center;justify-content:center;width:36px;height:36px;border-radius:10px;border:1px solid var(--line);color:#2b2f36;position:relative}.tb-icon:hover{background:#f6f2ea;text-decoration:none}
.tb-signout{color:var(--red);border-color:#e8c4c4}.tb-signout:hover{background:#fbe9e9}
.tb-user{display:inline-flex;align-items:center;gap:8px}.avatar{width:34px;height:34px;border-radius:50%;background:var(--red);color:#fff;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;object-fit:cover}
.bell-count{top:-6px;right:-6px}
@media (max-width:860px){.tb-device,.tb-user .who{display:none}}
.file-list{display:flex;flex-direction:column;gap:6px}
/* file rows: name (trimmed with …), kind, meta, actions always in the same column */
.file-row{display:grid;grid-template-columns:minmax(120px,1fr) auto minmax(0,auto) auto;align-items:center;gap:10px;font-size:14px}
.file-row .file-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.file-row .file-meta{color:var(--muted);font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.file-row .file-actions{display:inline-flex;gap:6px;justify-self:end;white-space:nowrap}
@media (max-width:700px){.file-row{grid-template-columns:minmax(0,1fr) auto}.file-row .file-meta{grid-column:1/-1}.file-row .file-actions{grid-column:1/-1;justify-self:start}}
.row-test td{background:#fff8e6}
/* page toolbars: filter, search and button share one height */
.pagebar .input,.pagebar select.input,.pagebar .btn:not(.btn-sm){height:40px;box-sizing:border-box}
.profile-head{display:flex;gap:18px;align-items:flex-start;flex-wrap:wrap}.avatar-big{width:120px;height:120px;border-radius:50%;object-fit:cover;display:block}.avatar-empty{background:var(--red);color:#fff;display:flex;align-items:center;justify-content:center;font-size:36px;font-weight:700}
.pw-toggle{font-size:16px}
/* assistant */
.ai-fab{position:fixed;right:22px;bottom:22px;width:56px;height:56px;border-radius:50%;border:0;box-shadow:0 8px 24px rgba(0,0,0,.25);cursor:pointer;z-index:60;display:flex;align-items:center;justify-content:center;transition:transform .15s}.ai-fab:hover{transform:scale(1.06)}.ai-fab.open{transform:rotate(90deg)}
.ai-panel{position:fixed;right:22px;bottom:90px;width:380px;max-width:calc(100vw - 32px);height:560px;max-height:calc(100vh - 120px);background:#fff;border-radius:14px;box-shadow:0 18px 50px rgba(0,0,0,.25);display:flex;flex-direction:column;z-index:60;overflow:hidden;animation:ai-in .18s ease-out}.ai-panel[hidden]{display:none}
@keyframes ai-in{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:none}}
.ai-head{display:flex;align-items:center;gap:8px;padding:10px 14px;color:#fff;font-weight:600}.ai-title{display:flex;align-items:center;gap:8px}.ai-dot{width:9px;height:9px;border-radius:50%;background:#7CFC9A;animation:ai-pulse 1.8s infinite}
@keyframes ai-pulse{0%{box-shadow:0 0 0 0 rgba(124,252,154,.6)}70%{box-shadow:0 0 0 8px rgba(124,252,154,0)}100%{box-shadow:0 0 0 0 rgba(124,252,154,0)}}
.ai-x{background:rgba(255,255,255,.18);border:0;color:#fff;border-radius:8px;padding:4px 9px;cursor:pointer;font-size:14px}.ai-x:hover{background:rgba(255,255,255,.3)}
.ai-log{flex:1;overflow:auto;padding:14px;background:#faf7f2;display:flex;flex-direction:column;gap:10px}
.ai-msg{display:flex;gap:8px;align-items:flex-end;max-width:92%}.ai-user{align-self:flex-end;flex-direction:row-reverse}
.ai-avatar{width:26px;height:26px;border-radius:50%;color:#fff;font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;flex:none}
.ai-bubble{background:#fff;border:1px solid var(--line);border-radius:14px;padding:9px 12px;font-size:14px;line-height:1.45;box-shadow:0 1px 2px rgba(0,0,0,.04)}.ai-user .ai-bubble{background:#efe4e4;border-color:#e6cfcf}
.ai-p{margin:0}.ai-ul{margin:4px 0 0 18px;padding:0}.ai-abuse .ai-bubble{border-color:#e8b4b4}.ai-error .ai-bubble{color:var(--bad)}
.ai-typing{display:inline-flex;gap:4px;padding:12px 14px}.ai-typing span{width:7px;height:7px;border-radius:50%;background:#9a9a9a;animation:ai-bounce 1.2s infinite}.ai-typing span:nth-child(2){animation-delay:.15s}.ai-typing span:nth-child(3){animation-delay:.3s}
@keyframes ai-bounce{0%,80%,100%{transform:translateY(0);opacity:.5}40%{transform:translateY(-6px);opacity:1}}
.ai-foot{display:flex;gap:8px;padding:10px;border-top:1px solid var(--line);background:#fff}.ai-input{flex:1;resize:none;border:1px solid var(--line);border-radius:10px;padding:8px 10px;font:inherit}.ai-send{border:0;color:#fff;border-radius:10px;padding:0 16px;cursor:pointer;font:inherit}.ai-send[disabled]{opacity:.5}
@media (max-width:600px){.ai-panel{right:8px;bottom:84px;height:70vh}}
.login-logo{display:block;width:300px;max-width:80%;height:auto;margin-bottom:18px}.brand-mark{width:30px;height:30px;border-radius:8px}

/* inline file links in list rows (tests: view + download) */
.file-links{display:flex;flex-wrap:wrap;gap:4px 8px;max-width:260px}
.file-link{display:inline-flex;align-items:center;gap:3px;font-size:12px;white-space:nowrap}
.file-link a{text-decoration:none}
.file-link a:first-child{color:var(--accent,#9b1c1c);border-bottom:1px dotted currentColor}
.file-link .dl{color:var(--muted,#6b7280);font-size:13px;padding:0 2px}
.file-link .dl:hover{color:var(--accent,#9b1c1c)}

/* password rule checklist */
.pw-rules{list-style:none;margin:6px 0 10px;padding:0;display:flex;flex-wrap:wrap;gap:4px 12px;font-size:12px;color:var(--muted,#6b7280)}
.pw-rules li::before{content:'○ ';color:#b0b4ba}
.pw-rules.touched li::before{content:'✗ ';color:#b42318}
.pw-rules.touched li.ok{color:#1a7f37}.pw-rules.touched li.ok::before{content:'✓ ';color:#1a7f37}

/* tests: result chip + small edit icon */
.result-cell{white-space:nowrap}
.result-cell .chip{vertical-align:middle}
.icon-btn{background:none;border:0;cursor:pointer;color:var(--muted,#6b7280);font-size:14px;padding:2px 5px;margin-left:4px;border-radius:6px;line-height:1;vertical-align:middle}
.icon-btn:hover{color:var(--red,#9b1c1c);background:#f6e9e9}

/* list pager */
.pager{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0 2px;font-size:13px}
.pager .btn[disabled]{opacity:.45;cursor:default}

/* independent scrolling: the left menu keeps its own scrollbar under the sticky headers; the page scrolls on its own.
   --hdr = top bar + section tabs height (set by app.js, fallback 97px). */
:root{--hdr:97px}
@media (min-width:861px){
  .layout{align-items:flex-start}
  .sidenav{position:sticky;top:var(--hdr);height:calc(100vh - var(--hdr));overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#4a505b #2b2f36}
  .sidenav::-webkit-scrollbar{width:8px}.sidenav::-webkit-scrollbar-thumb{background:#4a505b;border-radius:8px}.sidenav::-webkit-scrollbar-track{background:#2b2f36}
}
@media (max-width:860px){.sidenav{overscroll-behavior:contain}}

.row-actions{display:inline-flex;align-items:center;gap:2px;white-space:nowrap}
.icon-btn.icon-danger{color:#b42318}.icon-btn.icon-danger:hover{background:#fde4e4}

/* file type badges */
.ficon{display:inline-flex;align-items:center;justify-content:center;min-width:30px;height:18px;padding:0 4px;border-radius:4px;font-size:10px;font-weight:700;letter-spacing:.04em;color:#fff;background:#6b7280;vertical-align:middle;line-height:1}
.ficon.ficon-svg{background:none;padding:0;min-width:0;height:auto;border-radius:0;line-height:0}.ficon-svg svg{display:block}.ficon-pdf{background:#c62828}.ficon-img{background:#2e7d32}.ficon-xls{background:#1b7f3b}.ficon-csv{background:#4d7c0f}.ficon-doc{background:#1d4ed8}.ficon-zip{background:#8a6d1f}
.file-row .file-name{display:inline-flex;align-items:center;gap:6px}.file-row .file-name a{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

/* segmented toggle + chip groups */
.seg{display:inline-flex;border:1px solid var(--line);border-radius:8px;overflow:hidden;height:40px}
.seg-btn{background:#fff;border:0;padding:0 14px;font:inherit;color:var(--muted);cursor:pointer}.seg-btn.active{background:var(--red);color:#fff}.seg-btn:not(.active):hover{background:#f6e9e9;color:var(--red)}
td.chips{white-space:normal}td.chips .chip{margin:1px 3px 1px 0}

/* buyer contacts: company cards (SunnyQms list_buyers layout) */
.contact-cards{display:flex;flex-direction:column;gap:14px}
.contact-card{background:#fff;border:1px solid var(--line);border-radius:12px;overflow:hidden}
.cc-head{display:flex;align-items:center;gap:12px;padding:12px 16px;border-bottom:1px solid var(--line);background:#fbf9f6}
.cc-avatar{width:44px;height:44px;border-radius:10px;background:#eee8df;color:#4b4b4b;display:flex;align-items:center;justify-content:center;font-weight:700;font-size:16px;flex:none}
.cc-name{font-weight:700;font-size:16px;color:var(--ink)}.cc-meta{display:flex;gap:14px;flex-wrap:wrap;font-size:13px;color:var(--muted);margin-top:2px}
.cc-row{display:grid;grid-template-columns:minmax(160px,1.2fr) minmax(200px,1.5fr) minmax(160px,1.2fr) auto;gap:10px 16px;padding:12px 16px;border-bottom:1px solid #f0ece6;align-items:start;font-size:14px}
.cc-row:last-child{border-bottom:0}.cc-row.inactive{opacity:.55}
.cc-person{font-weight:600;font-size:15px}.cc-contact a,.cc-where a{text-decoration:none}.cc-contact div,.cc-where div{line-height:1.6}
.cc-actions{display:inline-flex;gap:4px;justify-self:end}
@media (max-width:860px){.cc-row{grid-template-columns:1fr 1fr}.cc-actions{grid-column:1/-1;justify-self:start}}

.cc-body{padding:10px 16px}.cc-brief{margin:0;max-height:3.2em;overflow:hidden;color:#3b3b3b;font-size:14px;line-height:1.6}.cc-brief.open{max-height:none}.cc-brief-wrap{display:flex;flex-direction:column;align-items:flex-start;gap:4px}
.cc-notes{font-size:13px;color:var(--muted);margin-top:6px;white-space:pre-wrap}

/* KPI tiles + filter bar (buyer contacts) */
.kpi-row{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-bottom:16px}
.kpi-tile{display:flex;align-items:center;gap:14px;background:#fff;border:1px solid var(--line);border-radius:12px;padding:16px 18px}
.kpi-ico{width:48px;height:48px;border-radius:10px;background:#eef1f6;display:flex;align-items:center;justify-content:center;font-size:22px;flex:none}
.kpi-n{font-size:26px;font-weight:700;line-height:1.1}.kpi-l{color:var(--muted);font-size:13px;margin-top:2px}
.filter-bar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:12px 14px;margin-bottom:14px}.filter-bar .input{max-width:360px}

.svg-icon{display:inline-flex;vertical-align:middle;line-height:0}.icon-btn .svg-icon svg{width:16px;height:16px}
.icon-btn{color:#5b6472}.icon-btn:hover{color:var(--red)}.icon-btn.icon-danger{color:#b42318}

.cc-who{display:flex;gap:10px;align-items:flex-start}
.contact-avatar{width:40px;height:40px;border-radius:50%;object-fit:cover;flex:none;background:#eee8df}.contact-avatar.initials{display:flex;align-items:center;justify-content:center;font-weight:700;font-size:13px;color:#4b4b4b}
.contact-avatar.lg{width:72px;height:72px;font-size:20px}
.icon-btn.icon-danger:hover{background:#b42318;color:#fff}

/* tooltips: every icon button / small control with a title shows it on hover (rule in CLAUDE.md) */
.icon-btn{position:relative}
.icon-btn[data-tip]:focus-visible::after,.icon-btn[data-tip]:hover::after{content:attr(data-tip);position:absolute;left:50%;top:calc(100% + 6px);transform:translateX(-50%);background:#1f2328;color:#fff;font-size:12px;line-height:1.3;padding:5px 8px;border-radius:6px;white-space:nowrap;z-index:50;pointer-events:none;box-shadow:0 4px 14px rgba(0,0,0,.18)}
.icon-btn[data-tip]:focus-visible::before,.icon-btn[data-tip]:hover::before{content:'';position:absolute;left:50%;top:100%;transform:translateX(-50%);border:6px solid transparent;border-bottom-color:#1f2328;z-index:51}
.cc-brands{display:flex;flex-wrap:wrap;gap:4px;align-items:center;margin-bottom:6px}

.icon-btn.icon-ok{color:#1a7f37}.icon-btn.icon-ok:hover{background:#1a7f37;color:#fff}

/* retailer tree: brands → people */
.tree{list-style:none;margin:0;padding:0}.tree-brand{border-top:1px solid #f0ece6;padding:6px 0}.tree-brand:first-child{border-top:0}
.tree-row{display:flex;align-items:center;gap:8px;font-size:14px}.tree-toggle{background:none;border:0;cursor:pointer;color:var(--muted);width:18px;font-size:14px;padding:0}
.tree-kids{list-style:none;margin:4px 0 0 26px;padding:0;border-left:2px solid #eee8df}.tree-kids.tree-flat{margin:0;border-left:0}.tree-kids.tree-flat>.tree-person{padding-left:0}
.tree-person{display:flex;align-items:center;gap:8px;padding:4px 0 4px 12px;font-size:13.5px}.tree-person.inactive{opacity:.55}.tp-name{font-weight:600}.tp-mail{text-decoration:none}
.contact-avatar.sm{width:26px;height:26px;font-size:10px}

.cc-head .spacer,.tree-row .spacer,.tree-person .spacer,.filter-bar .spacer{flex:1}.cc-head .cc-actions{margin-left:8px}

.file-chips{display:flex;flex-direction:column;gap:4px;max-width:260px}.file-chip{display:inline-flex;align-items:center;gap:4px;font-size:12px;white-space:nowrap;max-width:100%}.file-chip-name{overflow:hidden;text-overflow:ellipsis;max-width:150px;display:inline-block;vertical-align:middle}.file-chip .icon-btn{width:26px;height:26px;flex:none}

.bell-dd summary{list-style:none;cursor:pointer}.bell-dd summary::-webkit-details-marker{display:none}.bell-menu{left:auto;right:0;min-width:360px;max-width:440px;max-height:70vh;overflow:auto;padding:4px 0}.bell-menu a{padding:0;border-radius:0}.bell-head{display:flex;align-items:center;gap:8px;padding:8px 12px;border-bottom:1px solid var(--line)}.bell-item{display:flex;gap:8px;align-items:flex-start;padding:8px 12px;color:inherit;border-bottom:1px solid var(--line)}.bell-item:hover{background:#f6f2ea;text-decoration:none}.bell-item.read{opacity:.65}.bell-text{display:flex;flex-direction:column;gap:2px;font-size:13px}.bell-all{display:block;padding:8px 12px;font-size:13px}

.ticker{display:flex;align-items:center;gap:10px;background:#fff6e0;border-bottom:1px solid #f0dcb0;padding:4px 16px;font-size:13px;overflow:hidden}.ticker[hidden]{display:none}.ticker-label{font-weight:600;color:#7a5a00;flex:none}.ticker-viewport{flex:1;overflow:hidden;white-space:nowrap}.ticker-viewport.static{white-space:normal}.ticker-viewport.static .ticker-track{transform:none!important;white-space:normal;display:block}.ticker-viewport.static .ticker-item{white-space:normal;margin-right:18px}.ticker-track{display:inline-block;white-space:nowrap;will-change:transform}.ticker-item{display:inline-flex;align-items:center;gap:6px;margin-right:36px}.ticker-dot{width:7px;height:7px;border-radius:50%;background:var(--red);display:inline-block}.ticker-dot.ticker-hol{background:#2b7a3b}.ticker-x{border:0;background:none;color:#7a5a00;cursor:pointer;font-size:14px;padding:0 4px}.ticker-manage{flex:none;color:#7a5a00;text-decoration:none}
@media print{.ticker{display:none}}
.table-bar{display:flex;justify-content:flex-end;align-items:center;gap:8px;margin-bottom:10px}
/* Public invitation page (pending step 3) */
.invite-page{background:var(--bg,#f6f3ee);min-height:100vh;margin:0}
.invite-wrap{max-width:460px;margin:0 auto;padding:56px 16px}
.invite-card{padding:28px}
.invite-card h1{font-size:22px;margin:6px 0 8px}
.invite-brand{display:flex;align-items:center;gap:8px;font-weight:700;color:var(--brand,#8f1d1d);font-size:18px}
.invite-card form .input{width:100%;box-sizing:border-box}
.invite-error{color:#b42318;min-height:18px;margin-top:8px;font-size:14px}
.invite-foot{text-align:center;font-size:12px;margin-top:16px}
/* Styles master (pending step 4): facts grid in the detail view */
.facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(220px,1fr));gap:10px 18px;margin-top:12px}
.fact .hint{margin:0 0 2px}
/* two-column grids fill the page width; one column on phones (a spanning child kept empty auto-fit columns alive) */
@media (max-width:860px){.grid-2{grid-template-columns:minmax(0,1fr)}}
.profile-head>#account{flex:1;min-width:260px}
/* Assistant box resize handles: left edge, top edge, top-left corner (hidden on phones, where the box is fixed) */
.ai-rs{position:absolute;z-index:2;touch-action:none}.ai-rs-l{left:0;top:14px;bottom:0;width:7px;cursor:ew-resize}.ai-rs-t{top:0;left:14px;right:90px;height:7px;cursor:ns-resize}.ai-rs-tl{left:0;top:0;width:16px;height:16px;cursor:nwse-resize}
.ai-rs-l:hover,.ai-rs-t:hover,.ai-rs-tl:hover{background:rgba(255,255,255,.35)}.ai-rs-l:hover{background:rgba(0,0,0,.08)}
@media (max-width:600px){.ai-rs{display:none}}
.ai-input::placeholder{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ai-head .spacer{flex:1}   /* Clear and × sit at the top right of the chat box */
/* Assistant footer: language choice on the left, brand line on the right */
.ai-bottom{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-top:1px solid var(--line);background:#fff;flex-wrap:wrap}
.ai-langs{display:flex;gap:2px}.ai-lang{border:0;background:transparent;border-radius:6px;padding:5px 9px;font:inherit;font-size:12px;font-weight:600;color:#667;cursor:pointer}
.ai-lang:hover{background:#f1ece4}.ai-lang.on{background:#e9dfd0;color:#1c2540}.ai-lang:focus-visible{outline:2px solid #1c2540;outline-offset:1px}
.ai-brand{font-size:11.5px;color:#556;white-space:nowrap}.ai-brand b{color:#1c2540}.ai-brand .gold{color:#8a6a1f}.ai-brand .red{color:#a32222}
/* Open chat: the round button hides and the box sits where the button was (its bottom edge) */
.ai-fab.open{display:none}.ai-panel{bottom:22px;max-height:calc(100vh - 44px)}
@media (max-width:600px){.ai-panel{bottom:8px;height:calc(100vh - 80px)}}
/* Assistant replies: key terms, money, lists, tables, typing cursor */
.ai-rich .ai-p{margin:0 0 6px}.ai-rich .ai-p:last-child{margin-bottom:0}.ai-key{font-weight:650}.ai-money{color:#15803d;font-weight:650;white-space:nowrap}.ai-ref{font-weight:650;color:#1c2540;white-space:nowrap}
.ai-list{margin:4px 0 6px}.ai-li{display:flex;gap:7px;margin:2px 0}.ai-mark{flex:none;font-weight:650;min-width:14px}
.ai-table-wrap{overflow-x:auto;margin:6px 0;max-width:100%}.ai-table{border-collapse:collapse;width:100%;font-size:12.5px}
.ai-table th,.ai-table td{border:1px solid var(--line);padding:4px 7px;vertical-align:top;text-align:left}.ai-table th{background:#f4efe8;font-weight:650;white-space:nowrap}
.ai-table td.ai-num{text-align:right;white-space:nowrap;font-variant-numeric:tabular-nums}.ai-table tbody tr:nth-child(even) td{background:#fbf9f6}
.ai-msg.ai-assistant:has(.ai-table){max-width:100%}
.ai-cursor{display:inline-block;width:2px;height:1em;margin-left:2px;vertical-align:-2px;background:currentColor;animation:ai-blink 1s steps(2,start) infinite}
@keyframes ai-blink{to{visibility:hidden}}
@media (prefers-reduced-motion:reduce){.ai-cursor{display:none}}
.sd-docs{display:flex;flex-direction:column;gap:4px}.sd-doc{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
/* Share-with-buyer switch on the shipment page */
.share-switch{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;cursor:pointer;padding:5px 10px;border:1px solid var(--line);border-radius:999px;background:#fff}
.share-switch input{position:absolute;opacity:0;width:1px;height:1px}.share-track{width:34px;height:18px;border-radius:999px;background:#c9c3ba;position:relative;transition:background .15s;flex:none}
.share-track::after{content:"";position:absolute;top:2px;left:2px;width:14px;height:14px;border-radius:50%;background:#fff;transition:left .15s}
.share-switch.on{border-color:#15803d;color:#15803d}.share-switch.on .share-track{background:#15803d}.share-switch.on .share-track::after{left:18px}
.share-switch:has(input:focus-visible){outline:2px solid #1c2540;outline-offset:2px}.share-switch:has(input:disabled){opacity:.6;cursor:default}
.tree-note{list-style:none;margin:2px 0 8px 34px}.tp-more{white-space:nowrap}
.ch-title{font-size:11px;text-transform:uppercase;letter-spacing:.4px;color:var(--muted);margin:8px 0 3px}.ch-title:first-child{margin-top:0}.ch-row{margin:3px 0 6px}.ch-also{margin:2px 0 0 12px;font-size:13px}.tp-more-empty{opacity:.55}
.ch-earlier{margin-left:32px}
.tree-brand-name{border:0;background:transparent;padding:0;font:inherit;color:inherit;cursor:pointer;display:inline-flex;align-items:center;gap:4px}.tree-brand-name:hover strong{text-decoration:underline}.tree-about{margin:2px 0 6px 28px;color:#555;font-size:13.5px;max-width:900px}
/* the page never shifts sideways when a list gets shorter or longer (scrollbar space is always reserved) */
html{scrollbar-gutter:stable}
/* Popups (Codex UI review 2026-11-18): the page behind stays still, the popup fades in, scrolls inside itself */
html.modal-open{overflow:hidden}
.modal{max-height:calc(100vh - 32px);max-height:calc(100dvh - 32px);overscroll-behavior:contain;outline:0;animation:mc-pop .16s ease-out}
.modal-bg{animation:mc-fade .16s ease-out;overscroll-behavior:contain}
@keyframes mc-pop{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}@keyframes mc-fade{from{opacity:0}to{opacity:1}}
@media (prefers-reduced-motion:reduce){.modal,.modal-bg{animation:none}}
html.modal-open .ai-fab,html.modal-open .ai-panel{z-index:40}   /* the assistant never sits on top of a popup */
.contact-card.cc-current{outline:2px solid var(--red,#8f1d1d);outline-offset:-2px}
.ticker.ticker-reserved{display:flex;min-height:29px;box-sizing:border-box}.ticker.ticker-reserved[hidden]{display:none}
/* Order status report: numbers right-aligned, totals row, clean print */
.osr th.n,.osr td.n{text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap}.osr tfoot td{font-weight:650;border-top:2px solid var(--line);background:#faf7f2}.osr-notes{margin-top:10px;font-size:13px}
@media print{.no-print,.subbar,.ai-fab,.ai-panel{display:none!important}.osr{font-size:10.5px}.osr th,.osr td{padding:3px 6px}.osr a{color:inherit;text-decoration:none}.osr thead{display:table-header-group}.osr tr{break-inside:avoid}}
/* Printing any page: only the content, no menu / header / footer chrome */
@media print{.topbar,.sidenav,.subbar,.menu-toggle,footer,.ticker{display:none!important}.layout{display:block}.content{padding:0!important}body{background:#fff}.card{border:0;box-shadow:none;padding:0;margin:0 0 8px}.lines-wrap{overflow:visible}html{scrollbar-gutter:auto}@page{margin:12mm}}
/* Payment report per order: history rows, balance / overpaid emphasis */
.opr-histrow>td{background:#faf7f2;padding:6px 10px 10px 28px}.opr-hist{font-size:12.5px}.opr-hist th,.opr-hist td{padding:3px 8px}.opr-due{color:#b42318;font-weight:650}.opr-over{color:#15803d;font-weight:650}
.print-only{display:none}@media print{.print-only{display:inline}.opr-histrow>td{background:#fff;padding-left:14px}.opr tr{break-inside:avoid}}

/* 2026-11-18 UI sweep: row actions stay on one line, chips never break inside, totals rows are marked, order heading lines */
.row-actions{display:inline-flex;flex-wrap:nowrap;align-items:center;gap:6px;white-space:nowrap}.row-actions>*{flex:none}
.row-actions .icon-btn,table.t td>.icon-btn{width:30px;height:30px;padding:0;margin-left:0;display:inline-flex;align-items:center;justify-content:center}
.row-actions .btn-sm{height:30px;display:inline-flex;align-items:center;box-sizing:border-box}
table.t td.td-actions,table.t td:has(>.btn),table.t td:has(>.icon-btn),table.t td:has(>span>.btn){white-space:nowrap;width:1%}
table.t td:has(>.btn)>.btn+.btn,table.t td:has(>.btn)>.btn+.icon-btn{margin-left:6px}
.chip{white-space:nowrap}
table.t tr.total-row td,table.t tfoot tr:first-child td,.osr tfoot tr:first-child td{border-top:2px solid #a39a8c}
table.t tr.total-row td,table.t tfoot td{font-weight:650;background:#faf7f2}table.t tr.total-row:hover td{background:#faf7f2}
.head-lines{line-height:1.35}.head-lines>div{margin:0}
.kpi-tile.kpi-ok{border-color:#bfe5cf;background:#f3fbf6}.kpi-tile.kpi-ok .kpi-n{color:var(--ok)}.kpi-tile.kpi-ok .kpi-ico{background:#def5e8;color:var(--ok)}
/* 2026-11-18 popups that hold a table get room for it (Sunny: quantities-per-size popup clipped the order line).
   A width set by the page itself (style.maxWidth) still wins. */
.modal:has(table){max-width:min(920px,calc(100vw - 32px))}
.modal table.t td:first-child,.modal table.t th:first-child{padding-left:0}
.alert{white-space:pre-line}
/* 2026-11-18 popup system (Codex popup audit + Claude review): title and close button stay at the top, the action row
   at the bottom, only the body scrolls; five sizes capped to the window; the first column of an editable table stays
   in view while it scrolls sideways; fixed two-column grids stack on a phone. */
.modal{max-width:min(560px,calc(100vw - 32px));display:flex;flex-direction:column;padding:0;overflow:hidden}
.modal-sm{max-width:min(420px,calc(100vw - 32px))}.modal-md{max-width:min(760px,calc(100vw - 32px))}.modal-lg{max-width:min(1000px,calc(100vw - 32px))}.modal-xl{max-width:min(1320px,calc(100vw - 32px))}
.modal:has(table){max-width:min(920px,calc(100vw - 32px))}.modal.modal-md:has(table){max-width:min(760px,calc(100vw - 32px))}.modal.modal-lg{max-width:min(1000px,calc(100vw - 32px))}.modal.modal-xl{max-width:min(1320px,calc(100vw - 32px))}.modal.modal-xxl{max-width:min(1680px,calc(100vw - 32px))}
.modal-head{display:flex;align-items:flex-start;gap:12px;padding:18px 22px 10px;flex:none}
.modal-head h2{margin:0;flex:1;min-width:0;overflow-wrap:anywhere;white-space:normal;line-height:1.3}
.modal-x{flex:none;width:32px;height:32px;border:0;border-radius:8px;background:transparent;color:var(--muted,#6b7280);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;margin:-4px -8px 0 0}
.modal-x:hover,.modal-x:focus-visible{background:#f1ece4;color:#1f2430}
.modal-body{padding:2px 22px 6px;overflow:auto;flex:1 1 auto;min-height:0;overscroll-behavior:contain}
.modal .actions{flex:none;margin:0;padding:12px 22px 16px;border-top:1px solid var(--line,#e6e0d6);background:#fff}
.modal .lines-table td:first-child:not([colspan]),.modal .lines-table th:first-child:not([colspan]){position:sticky;left:0;z-index:1;background:#fff}
.modal .lines-table td,.modal .lines-table th{padding-left:5px;padding-right:5px}
.modal table.t:not(.lines-table) td:first-child{white-space:normal}
@media(max-width:560px){.modal .grid,.modal .form-grid{grid-template-columns:minmax(0,1fr) !important}.modal-head{padding:14px 16px 8px}.modal-body{padding:2px 16px 6px}.modal .actions{padding:10px 16px 14px}}
table.t td{font-variant-numeric:tabular-nums}
table.t td.num,table.t th.num{text-align:right}table.t td.num{white-space:nowrap}
/* 2026-11-18 phone header (second UI pass): on narrow screens the header keeps menu, logo, Go to, bell, avatar and
   sign-out on one line; the clock, device, organisation and name move out (the name is on My profile, the time in
   the footer); dropdown panels open full width under the header instead of running off the screen. */
@media(max-width:760px){
  .topbar{gap:6px;padding-left:8px;padding-right:8px;flex-wrap:nowrap}
  .topbar .tb-clock,.topbar .tb-device,.topbar .topbar-org,.topbar .tb-user .tb-user-text,.topbar .tb-user>div,.topbar .tb-user>span:not(.avatar){display:none}
  .topbar .brand{font-size:0;gap:0}.topbar .brand-mark{width:26px;height:26px}
  .topbar-right{margin-left:auto;gap:4px;min-width:0}
  .topbar .tb-btn{white-space:nowrap;padding-left:8px;padding-right:8px}
  .topbar .tb-dd{position:static}
  .topbar .tb-dd>.tb-panel,.topbar .bell-dd>*:not(summary){position:fixed;left:8px;right:8px;top:56px;width:auto;max-width:none;max-height:calc(100vh - 72px);overflow:auto;columns:1}
}
@media(max-width:760px){.card>table.t,.card>div>table.t:only-child{display:block;max-width:100%;overflow-x:auto}}
.chip-warn{background:#fdf1d8;color:#8a5a00}.alert-warn{background:#fdf1d8;color:#6b4500}
table.t tr.row-selected td{background:#fbf3e8}
.bad-text{color:var(--bad)}
table.t tr.group-row td{background:#f4efe7;border-top:2px solid #e2dbcf;padding-top:9px;padding-bottom:9px}
/* 2026-11-19 type-to-filter dropdown (MC.combo) */
.combo{position:relative}
.combo .combo-input{padding-right:36px;cursor:text;text-overflow:ellipsis}
.combo .combo-input:disabled{cursor:not-allowed}
.combo-caret{position:absolute;right:6px;top:50%;transform:translateY(-50%);width:28px;height:28px;border:0;background:transparent;color:var(--muted,#6b7280);display:inline-flex;align-items:center;justify-content:center;border-radius:6px;cursor:pointer}
.combo.open .combo-caret{transform:translateY(-50%) rotate(180deg)}
.combo-list{position:absolute;z-index:70;left:0;right:0;top:calc(100% + 4px);background:#fff;border:1px solid var(--line);border-radius:10px;box-shadow:0 12px 30px rgba(0,0,0,.12);max-height:280px;overflow:auto;padding:4px;min-width:220px}
.combo-opt{padding:8px 10px;border-radius:7px;cursor:pointer;font-size:14px;line-height:1.3}
.combo-opt.active{background:#f4efe7}.combo-opt:hover{background:#f7f3ec}.combo-opt.sel{font-weight:650}.combo-opt.dis{opacity:.45;cursor:default}
.combo-opt mark{background:#fde9c7;color:inherit;border-radius:3px;padding:0 1px}
.combo-group{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted,#6b7280);padding:9px 10px 3px}
.combo-none{padding:10px;color:var(--muted,#6b7280);font-size:14px}

.tree-seen{list-style:none;margin:-4px 0 6px 46px;font-size:11.5px;line-height:1.5;color:var(--muted)}
.chan-tag{display:inline-flex;align-items:center;border:1px solid #d8c9a8;background:#fbf5e6;color:#7a5a12;border-radius:999px;padding:1px 8px;font-size:11.5px;font-weight:600;line-height:18px;letter-spacing:.01em;vertical-align:middle;font-family:inherit}
button.chan-tag{cursor:pointer}button.chan-tag:hover{border-color:var(--red);color:var(--red)}
.chan-tag.inherited{background:transparent;border-style:dashed;font-weight:500}.chan-tag.empty{background:transparent;border-style:dashed;color:var(--muted);font-weight:500}
.seen-more{border:0;background:none;color:var(--ok);font-weight:600;font-size:11.5px;cursor:pointer;padding:0}.seen-more:hover{text-decoration:underline}.seen-older{margin-top:2px}
/* Retailer accounts / Buyer contacts hero (2026-11-19): full width of the page area, linens on the right, title on the calm left */
.rt-hero{position:relative;margin:-24px -24px 14px;overflow:hidden;background:#f3ece2;border-bottom:1px solid var(--line)}
.rt-hero img{display:block;width:100%;height:clamp(140px,17vw,260px);object-fit:cover;object-position:72% 45%}
.rt-hero::after{content:"";position:absolute;inset:0 40% 0 0;background:linear-gradient(90deg,rgba(250,247,242,.92) 0%,rgba(250,247,242,.75) 60%,rgba(250,247,242,0) 100%);pointer-events:none}
.rt-hero-text{position:absolute;z-index:1;left:clamp(16px,3vw,40px);top:50%;transform:translateY(-50%);max-width:min(38%,440px)}
.rt-hero-title{font-size:clamp(24px,3vw,40px);font-weight:800;color:#8f1d1d;letter-spacing:-.01em;line-height:1.05;margin:0}
.rt-hero-sub{margin-top:6px;font-size:clamp(13px,1.25vw,16px);color:#4a3f36}
@media (max-width:860px){.rt-hero{margin:-16px -16px 12px}.rt-hero-text{max-width:72%;background:rgba(250,247,242,.88);padding:8px 12px;border-radius:10px}}
@media print{.rt-hero{display:none}}
.prod-tags{display:inline-flex;gap:4px;vertical-align:middle}.prod-tags.editable{cursor:pointer}
.prod-tag{display:inline-flex;border-radius:999px;padding:1px 8px;font-size:11.5px;font-weight:600;line-height:18px;border:1px solid transparent}
.prod-tag.prod-bedding{background:#e8f1ea;color:#256b3a;border-color:#bcd8c3}.prod-tag.prod-garments{background:#e9eef8;color:#2c4f8f;border-color:#c3d0ea}
.prod-tag.empty{border:1px dashed var(--line);color:var(--muted);font-weight:500}.prod-tags.editable:hover .prod-tag{border-color:var(--red)}
.card-btn{width:26px;height:26px;color:var(--red);vertical-align:middle;margin-left:2px}
.card-photo-wrap{display:flex;justify-content:center;align-items:center;background:#f3efe8;border-radius:10px;padding:12px;min-height:240px;overflow:hidden}
.card-photo{max-width:100%;max-height:70vh;border-radius:6px;box-shadow:0 2px 12px rgba(0,0,0,.12);transition:transform .2s}.card-photo.sideways{max-width:70vh;max-height:100%}
.cc-avatar.cc-logo{background:#fff;border:1px solid var(--line);padding:4px;overflow:hidden}.cc-avatar.cc-logo img{width:100%;height:100%;object-fit:contain;display:block}.logo-prev{width:64px;height:64px;object-fit:contain;border:1px solid var(--line);border-radius:10px;background:#fff;padding:4px}
/* 2026-11-20 presence: "Online" header panel, pop-ups, history; sign-out is a POST form */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.tb-signout-form{display:inline-flex;margin:0}button.tb-icon{background:none;cursor:pointer;font:inherit;padding:0}
.presence-count{background:#1f7a4d}
.presence-menu{min-width:400px;max-width:440px}
.pr-head{gap:4px;flex-wrap:wrap}.pr-tab,.pr-filter{min-height:36px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:4px 10px;font:inherit;font-size:13px;cursor:pointer;color:inherit}
.pr-tab.active,.pr-filter.active{background:#1f2937;color:#fff;border-color:#1f2937}.pr-tab:focus-visible,.pr-filter:focus-visible,.pr-x:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.pr-pop{display:inline-flex;align-items:center;gap:4px;cursor:pointer;min-height:36px}
.pr-filters{display:flex;gap:6px;padding:8px 12px;border-bottom:1px solid var(--line)}
.pr-row{display:flex;gap:10px;align-items:flex-start;padding:9px 12px;border-bottom:1px solid var(--line)}.pr-main{display:flex;flex-direction:column;gap:2px;font-size:13px;min-width:0}
.pr-name{display:flex;align-items:center;gap:6px;flex-wrap:wrap}.pr-state{font-size:11px;color:#1f7a4d;font-weight:600}
.pr-av{flex:0 0 32px;height:32px;border-radius:50%;background:#ede7da;color:#5b4a2c;display:inline-flex;align-items:center;justify-content:center;font-size:12px;font-weight:700}
.pr-dot{display:inline-block;width:9px;height:9px;border-radius:50%;flex:0 0 9px;margin-top:4px}.pr-dot.on{background:#1f7a4d}.pr-dot.off{background:#9ca3af}
.pr-name .pr-dot{margin-top:0}.pr-empty{padding:14px 12px}.pr-warn{padding:8px 12px;background:#fff7e6;color:#8a5a00;font-size:13px;border-bottom:1px solid var(--line)}
.pr-foot{display:flex;align-items:center;gap:8px;padding:0 0 0 12px}.pr-foot .bell-all{margin-left:auto;white-space:nowrap}
.pr-toasts{position:fixed;right:16px;bottom:16px;z-index:1200;display:flex;flex-direction:column;gap:8px;max-width:min(360px,calc(100vw - 32px))}
.pr-toast{display:flex;gap:10px;align-items:flex-start;background:#fff;border:1px solid var(--line);border-left:4px solid #1f7a4d;border-radius:10px;padding:10px 12px;box-shadow:0 8px 24px rgba(0,0,0,.12);animation:prIn .25s ease-out}
.pr-toast.off{border-left-color:#9ca3af}.pr-x{margin-left:auto;background:none;border:0;font-size:18px;line-height:1;cursor:pointer;color:#6b7280;min-width:32px;min-height:32px}
@keyframes prIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@media (prefers-reduced-motion:reduce){.pr-toast{animation:none}}
.pr-hist-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-bottom:10px}.pr-hist-bar .input{width:auto;min-width:150px}.pr-hist-bar label.f{margin:0}
.pr-pager{display:flex;align-items:center;gap:8px;margin:10px 0}
@media (max-width:640px){.presence-menu{min-width:0}.pr-toasts{left:16px;right:16px;max-width:none}}
/* 2026-11-20 assistant audit: character counter, retry, phone keyboard */
.ai-count{font-size:11px;color:#6b7280;text-align:right;padding:0 12px 4px}.ai-retry{margin-top:6px;border:1px solid var(--line);background:#fff;border-radius:8px;padding:4px 12px;cursor:pointer;font:inherit;min-height:32px}
.ai-input{min-width:0}.ai-send{flex:0 0 auto;min-height:44px}
@supports (height:100dvh){.ai-panel{max-height:calc(100dvh - 44px)}@media (max-width:600px){.ai-panel{height:calc(100dvh - 80px)}}}
/* 2026-11-20 sortable table headings (click to sort, again to reverse) */
.th-sort{background:none;border:0;padding:0;font:inherit;color:inherit;text-transform:inherit;letter-spacing:inherit;cursor:pointer;white-space:nowrap;min-height:28px}.th-sort:hover,.th-sort.on{color:var(--red)}.th-sort:focus-visible{outline:2px solid #2563eb;outline-offset:2px}.th-arrow{opacity:.55}.th-sort.on .th-arrow{opacity:1}
/* 2026-11-20 "Find a page" box at the top of the left menu */
.nav-search{position:relative;margin:4px 14px 10px;color:#8d93a0}.nav-search svg{position:absolute;left:10px;top:50%;transform:translateY(-50%);pointer-events:none}
.nav-search input{width:100%;box-sizing:border-box;height:36px;padding:0 10px 0 32px;border-radius:9px;border:1px solid #444a55;background:#22252b;color:#fff;font:inherit;font-size:13px}
.nav-search input::placeholder{color:#8d93a0}.nav-search input:focus{outline:none;border-color:#e0514c;box-shadow:0 0 0 2px rgba(224,81,76,.25)}
/* Sunny 2026-11-27: the menu search stays at the top while the menu scrolls under it (the side menu is its own scroll box) */
.sidenav{padding-top:0}.sidenav .nav-search{position:sticky;top:0;z-index:3;margin:0 0 6px;padding:14px 14px 8px;background:inherit}.sidenav .nav-search svg{left:24px;top:calc(50% + 3px)}   /* no padding above the stuck box, or menu items show through the gap */
.nav-none{padding:6px 20px 10px;color:#8d93a0;font-size:13px}.sidenav a[hidden],.nav-group[hidden]{display:none}
.nav-hit{background:#f5c542;color:#1f2227;border-radius:3px;padding:0 1px}.sidenav a.nav-first{background:#363b44;color:#fff}.sidenav a:focus-visible{outline:2px solid #e0514c;outline-offset:-2px}
/* 2026-11-20 Costing: product sub-tabs under the country tabs */
.cost-prods{display:flex;flex-wrap:wrap;gap:8px;margin:4px 0 14px}.cost-prod{display:inline-flex;align-items:center;min-height:36px;padding:0 16px;border:1px solid var(--line);border-radius:999px;background:#fff;color:inherit;font-size:14px}
.cost-prod:hover{text-decoration:none;border-color:#c9b99a}.cost-prod.active{background:#8f1d1d;border-color:#8f1d1d;color:#fff;font-weight:600}.cost-prod:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
/* 2026-11-20 Costing worksheet (China · Quilt first). Design: Codex + Claude (research/costing/codex-ui.md) */
.cost-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:0 0 12px}.cost-picker{max-width:520px;min-width:260px}
.cost-status{display:inline-flex;flex-wrap:wrap;gap:6px;align-items:center}.cost-err{color:var(--bad);font-size:13px}
.cost-photo-box{display:flex;flex-direction:column;gap:8px;align-items:stretch}.cost-photo{width:100%;height:200px;object-fit:contain;background:#faf7f2;border:1px solid var(--line);border-radius:10px;display:block}
.cost-photo-none{display:flex;align-items:center;justify-content:center;color:#8d8577;font-size:13px;text-align:center;padding:10px}.cost-upload{position:relative;text-align:center;cursor:pointer}
.cost-sizes{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-bottom:10px;font-size:13px}.cost-size-chip{background:#f6f2ea;border:1px solid var(--line);border-radius:999px;padding:3px 10px}.cost-size-chip.on{background:#8f1d1d;color:#fff;border-color:#8f1d1d}
.cost-matrix-wrap{overflow:auto;max-height:78vh;border:1px solid var(--line);border-radius:10px}
.cost-matrix{border-collapse:separate;border-spacing:0;min-width:100%;font-size:13px}.cost-matrix th,.cost-matrix td{padding:5px 6px;border-bottom:1px solid #efe9df;vertical-align:top;background:#fff}
.cost-matrix thead th{position:sticky;top:0;z-index:2;background:#f7f3ec}.cost-matrix thead tr:nth-child(2) th{top:44px}.cost-matrix th small,.cost-en{display:block;font-size:11px;color:#7a7368;font-weight:400}
.cost-matrix .cost-item{position:sticky;left:0;z-index:1;min-width:230px;max-width:280px;text-align:left;background:#fff;border-right:1px solid #e6dfd2}.cost-matrix thead .cost-item{z-index:3;background:#f7f3ec}
.cost-size-head{text-align:center;border-left:1px solid #e6dfd2}.cost-size-head div{font-weight:700}
.cost-group th{background:#f3ede3!important;font-weight:700;text-align:left;position:sticky;left:0}.cost-zh{font-weight:600;font-size:14px}.cost-item-top{display:flex;align-items:center;gap:6px}
.cost-edit{margin-left:auto}.cost-mat{font-size:12px;color:#3d3a35;margin-top:2px}.cost-meta{font-size:11px;color:#7a7368;margin-top:2px;display:flex;flex-wrap:wrap;gap:4px;align-items:center}.cost-meta .chip{font-size:10px;padding:0 6px}
.cost-in{width:72px;height:30px;border:1px solid #d9d1c3;border-radius:6px;padding:0 6px;text-align:right;font:inherit;background:#fffdf9}.cost-in:focus{outline:2px solid #2563eb;outline-offset:0;border-color:#2563eb}.cost-in::placeholder{color:#9b9384}
.cost-src{font-size:10px;color:#7a7368;margin-top:2px;white-space:nowrap}.cost-src-factory{color:#1f7a4d}.cost-src-manual{color:#8a5a00;font-weight:600}.cost-src-auto{color:#2563eb}
.cost-sug,.cost-why{border:0;background:none;color:#2563eb;cursor:pointer;font-size:10px;padding:0 2px}.cost-why{font-weight:700}
.cost-amt{font-variant-numeric:tabular-nums;white-space:nowrap}.cost-missing{color:var(--bad);font-weight:600;font-size:12px}.cost-na{color:#b3ab9d;text-align:center;font-size:12px}
.cost-row-off th,.cost-row-off td{opacity:.55}
.cost-foot .cost-total th,.cost-foot .cost-total td{background:#faf7f2;border-top:1px solid #e6dfd2}.cost-final th,.cost-final td{background:#f6e9e9!important;font-size:15px}
.cost-pctw{display:flex;align-items:center;gap:4px;font-size:11px;color:#7a7368;margin-top:4px;flex-wrap:wrap}.cost-pct{width:60px}.cost-base{width:auto;text-align:left}
.cost-foot-tools{display:flex;flex-wrap:wrap;gap:10px;align-items:center;margin-top:10px}.cost-hist ul{margin:8px 0 0;padding-left:18px;font-size:13px}.cost-hist summary{cursor:pointer;font-weight:600}
@media (max-width:760px){.cost-matrix .cost-item{min-width:150px;max-width:170px}.cost-size-chip{cursor:pointer;min-height:32px;display:inline-flex;align-items:center}.cost-in{width:64px;height:36px}}
.cost-matrix tbody th,.cost-matrix tfoot th{text-transform:none;letter-spacing:normal;font-weight:400;color:inherit;font-size:13px}.cost-matrix tbody th .cost-zh{font-weight:600}.cost-group th{text-transform:uppercase!important;letter-spacing:.04em!important;font-size:12px!important}
/* 2026-11-20 grid lines (Sunny): grey lines on every row and column, a darker line where each size starts */
.cost-matrix th,.cost-matrix td{border-right:1px solid #e2dccf;border-bottom:1px solid #e2dccf}.cost-matrix .cost-gs{border-left:2px solid #a8a092}
.cost-matrix thead th{border-bottom:1px solid #cfc7b8}.cost-matrix .cost-item{border-right:2px solid #a8a092}.cost-matrix tbody tr:hover td,.cost-matrix tbody tr:hover th{background:#fbf8f2}
.cost-group th,.cost-group td{border-top:1px solid #cfc7b8;background:#f3ede3!important}
/* 2026-11-20 costing: fabric average, cutting plan flags, width check, sets */
.cost-calc{font-size:10px;white-space:nowrap}.cost-diff{color:#1f7a4d;font-size:10px}.cost-diff.hi{color:var(--bad);font-weight:600}
.cost-flag{font-size:10px;color:#7a7368;white-space:nowrap}.cost-flag.warn{color:#8a5a00;font-weight:600}.cost-flag.bad{color:var(--bad);font-weight:600}
.cost-wcheck{margin-left:auto}.cost-wcheck+.cost-edit{margin-left:0}
.cost-wtable td.best{background:#def5e8}.cost-wtable td.join{color:var(--bad)}.cost-wtable .cur{outline:2px solid #2563eb;outline-offset:-2px}
.cost-sets{margin-top:14px}.cost-sets h3{margin:0 0 8px}

/* Costing UI pass 2 (Codex review research/costing/codex-ui2.md + Claude, 2026-11-20): header grid, sub-product tabs,
   construction fields in a 4-column grid with Chinese over English labels, settings in fieldsets, set prices. */
.cost-subs{display:flex;flex-wrap:wrap;gap:6px;margin:-4px 0 14px}
.cost-sub{display:inline-flex;flex-direction:column;align-items:flex-start;justify-content:center;min-height:40px;padding:4px 14px;border:1px solid var(--line);border-radius:8px;background:#fff;color:inherit;font:inherit;font-size:13px;cursor:pointer;line-height:1.25}
.cost-sub small{font-size:11px;color:#7a7368}.cost-sub:hover{border-color:#c9b99a}.cost-sub.active{border-color:#8f1d1d;background:#fbeeee;color:#8f1d1d;font-weight:600;box-shadow:inset 0 -2px 0 #8f1d1d}
.cost-sub:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.cost-toolbar{gap:8px;margin-bottom:10px}.cost-picker{flex:1 1 300px;min-width:0;max-width:520px}.cost-actions{display:flex;gap:8px;margin-left:auto}
.cost-note{margin:0 0 10px}
.cost-head{display:grid;grid-template-columns:minmax(0,1fr) 160px;gap:16px;align-items:start;padding:14px}
.cost-head-fields{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;align-items:end;min-width:0}
.cost-span2{grid-column:span 2}.cost-span3{grid-column:span 3}.cost-span4{grid-column:1/-1}
.cost-head .cost-field .input{height:40px}.cost-head textarea.input{height:auto;min-height:40px}
.cost-photo{height:150px}.cost-photo-box .btn{justify-content:center;white-space:normal;font-size:12px}
.cost-options,.cost-sheet{padding:14px;margin-bottom:12px}
.cost-options>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:8px}.cost-options>summary::-webkit-details-marker{display:none}
.cost-options>summary::before{content:'▸';color:#8f1d1d;font-size:13px}.cost-options[open]>summary::before{content:'▾'}
.cost-options>summary h2{margin:0;font-size:17px}
.cost-opts{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;margin-top:12px}
.cost-field{display:flex;flex-direction:column;gap:5px;min-width:0;font-size:12px;color:#555}
.cost-label{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 6px;line-height:1.3;font-weight:600;color:#3d3a35;font-size:13px}
.cost-label small{font-size:12px;font-weight:400;color:#7a7368}
.cost-control,.cost-ta{display:block;position:relative;min-width:0}
.cost-field .input{display:block;width:100%;min-width:0;max-width:none;height:40px;min-height:40px;flex:none;font-size:14px}
.cost-number{text-align:right;font-variant-numeric:tabular-nums}
.cost-control.has-unit .input{padding-right:64px}
.cost-unit{position:absolute;right:10px;top:0;height:40px;display:flex;align-items:center;font-size:12px;color:#7a7368;pointer-events:none}
.cost-more{margin-top:14px;border-top:1px solid var(--line);padding-top:10px}.cost-more>summary{cursor:pointer;color:var(--red);font-size:13px}
.cost-settings{display:grid;grid-template-columns:2fr 1.2fr 1fr;gap:12px;margin-top:12px}
.cost-fs{margin:0;padding:12px;min-width:0;border:1px solid var(--line);border-radius:8px}.cost-fs legend{padding:0 5px;font-size:13px;font-weight:650}
.cost-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.cost-fs:last-child .cost-fields{grid-template-columns:1fr}
.cost-fs>.hint{margin:9px 0 0;white-space:normal}
.cost-sets{margin-top:16px;border-top:2px solid #a8a092;padding-top:12px}.cost-sets-head{display:flex;align-items:center;gap:8px;margin-bottom:8px}.cost-sets-head h3{margin:0}
.cost-set-table td,.cost-set-table th{vertical-align:top}.cost-set-price{font-size:15px}
.cost-sets-edit .cost-set-qty{width:76px;height:40px;text-align:right}.cost-sets-edit th small{display:block;font-size:11px;font-weight:400;color:#7a7368;text-transform:none;letter-spacing:0}
.cost-set-example td{background:#f4f2ee!important;color:#8d8577;font-style:italic}.cost-set-example small{display:block;font-size:11px}
.cost-set-exq{display:inline-block;min-width:60px;padding:8px 10px;border:1px dashed #cfc7b8;border-radius:8px;text-align:right;color:#8d8577}
.cost-set-add{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin-top:10px}
@media (max-width:1100px){.cost-opts{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-settings{grid-template-columns:1fr}}
@media (max-width:760px){.cost-head{grid-template-columns:minmax(0,1fr) 90px}.cost-head-fields{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-span3{grid-column:1/-1}.cost-photo{height:90px}
  .cost-toolbar .cost-picker{max-width:none;flex-basis:100%}.cost-actions{width:100%;justify-content:flex-end}}
@media (max-width:540px){.cost-opts,.cost-fields{grid-template-columns:1fr}.cost-head-fields{grid-template-columns:1fr}.cost-span2,.cost-span3{grid-column:1/-1}}
.cost-req-miss .input{border-color:#e3a8a8;background:#fffafa}.cost-req-miss>span:first-child{color:#8f1d1d}
.cost-head .combo .combo-list{z-index:30}
.cost-settings:has(>.cost-fs:nth-child(2):last-child){grid-template-columns:2fr 1fr}
.cost-head .cost-field textarea.input{height:auto;min-height:62px}.cost-set-table tbody th{text-transform:none;letter-spacing:0;font-size:13px;color:inherit}
.cost-note{background:#eef4ff;border:1px solid #c7d7f5;color:#1e3a6b;border-radius:8px;padding:10px 12px;font-size:13px}
/* darker grey grid (Sunny 2026-11-20): rows and columns easy to follow, size groups darker still */
.cost-matrix th,.cost-matrix td{border-right:1px solid #c2bdb4;border-bottom:1px solid #c2bdb4}.cost-matrix thead th{border-bottom:1px solid #a9a39a}
.cost-matrix .cost-gs{border-left:2px solid #7f7a72}.cost-matrix .cost-item{border-right:2px solid #7f7a72}.cost-group th,.cost-group td{border-top:1px solid #a9a39a}
.cost-matrix-wrap{border-color:#a9a39a}
.linkbtn{background:none;border:0;padding:0;font:inherit;color:#8f1d1d;text-align:left;cursor:pointer;text-decoration:underline;text-underline-offset:2px}.linkbtn:hover{color:#5f1010}
.cost-hist>summary{cursor:pointer;font-weight:600}.cost-vers td{vertical-align:top}.cost-vers .chip{margin-left:6px}.cost-vers-prices{font-size:12px;white-space:nowrap}
.cost-vfacts th{width:170px;text-align:left;font-weight:600;color:#555}.cost-vset td{background:#faf7f2}
/* Costing from China (Old · History) — library of old factory costings (2026-11-20) */
.cost-library>.hint{margin:0 0 10px}
.cost-lib-filters{padding:14px;margin-bottom:14px}.cost-lib-row{display:grid;grid-template-columns:minmax(0,2fr) repeat(7,minmax(0,1fr));gap:10px;align-items:end}
.cost-lib-count{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-top:10px;font-size:13px;color:#555}
.cost-lib-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:14px}
.cost-lib-card{display:flex;flex-direction:column;gap:5px;text-align:left;padding:12px;background:#fff;color:inherit;font:inherit;border:1px solid var(--line);border-radius:10px;cursor:pointer;min-width:0}
.cost-lib-card:hover{border-color:#8f1d1d;box-shadow:0 2px 10px rgba(0,0,0,.06)}.cost-lib-card:focus-visible{outline:2px solid #2563eb;outline-offset:2px}
.cost-lib-card img,.cost-lib-nophoto{width:100%;height:170px;object-fit:contain;background:#faf7f2;border-radius:6px}
.cost-lib-nophoto{display:grid;place-items:center;color:#8d8577;font-size:12px;text-align:center;padding:10px}
.cost-lib-card strong{font-size:14px;line-height:1.3;overflow-wrap:anywhere}.cost-lib-card span,.cost-lib-card small{font-size:12px;color:#6b665d}
.cost-lib-prices{border-top:1px solid #efe9df;padding-top:6px;margin-top:2px;font-size:12px}.cost-lib-prices>div{display:flex;justify-content:space-between;gap:8px}.cost-lib-prices b{font-variant-numeric:tabular-nums;white-space:nowrap}
.cost-lib-pager{display:flex;align-items:center;justify-content:center;gap:14px;margin:16px 0}
.cost-lib-photos{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px}.cost-lib-photos img{height:150px;width:auto;max-width:260px;object-fit:cover;border-radius:6px;border:1px solid var(--line)}
.cost-htable{font-size:12px;border-collapse:separate;border-spacing:0}.cost-htable th,.cost-htable td{border-right:1px solid #c2bdb4;border-bottom:1px solid #c2bdb4;padding:4px 6px;vertical-align:top}
.cost-htable tbody th{text-align:left;font-weight:600;min-width:150px;text-transform:none;letter-spacing:0;color:inherit}.cost-htable .cost-size-head{border-left:2px solid #7f7a72}
.cost-hrow-summary th,.cost-hrow-summary td{background:#f6f4f0;color:#6b665d;font-style:italic}.cost-hrow-mpl_note th,.cost-hrow-mpl_note td{background:#fff7e6;color:#8a5a00}
.cost-hsum th,.cost-hsum td{background:#faf7f2}.cost-htable .cost-final th,.cost-htable .cost-final td{background:#f6e9e9}
@media (max-width:1100px){.cost-lib-row{grid-template-columns:repeat(3,minmax(0,1fr))}.cost-lib-q{grid-column:1/-1}}
@media (max-width:540px){.cost-lib-row{grid-template-columns:repeat(2,minmax(0,1fr))}.cost-lib-grid{grid-template-columns:1fr 1fr}.cost-lib-card img,.cost-lib-nophoto{height:120px}}
/* Freight & landed cost (2026-11-21) */
.cost-freight{padding:14px;margin-bottom:12px}.cost-freight>summary{cursor:pointer;list-style:none;display:flex;align-items:center;gap:10px;flex-wrap:wrap}.cost-freight>summary::-webkit-details-marker{display:none}
.cost-freight>summary::before{content:'▸';color:#8f1d1d;font-size:13px}.cost-freight[open]>summary::before{content:'▾'}.cost-freight>summary h2{margin:0;font-size:17px}
.cost-pack-h{margin:16px 0 8px;font-size:14px}.cost-pack td,.cost-pack th{vertical-align:top}.cost-pack .cost-in{width:64px}.cost-dims{white-space:nowrap}.cost-dims .cost-in{width:54px}
.cost-matrix .cost-frt th,.cost-matrix .cost-frt td{background:#fbfaf7;font-size:12px}
.cost-matrix .cost-cif th,.cost-matrix .cost-cif td{background:#eef4ff!important;border-top:2px solid #6b8fd6;font-size:14px}
.cost-matrix .cost-landed th,.cost-matrix .cost-landed td{background:#fdf6e3!important;border-top:2px solid #b08a2e;font-size:15px}
.cost-size-chip{font:inherit;color:inherit}button.cost-size-chip{cursor:pointer;min-height:40px;border:1px solid var(--line);gap:6px}button.cost-size-chip.on{background:#8f1d1d;color:#fff;border-color:#8f1d1d}
.cost-lib-ver{display:inline-flex;align-items:center;gap:6px;font-size:13px;cursor:pointer}.cost-lib-card .chip{align-self:flex-start}
.cost-lib-versions{margin:10px 0;padding:10px 12px;border:1px solid var(--line);border-radius:8px;background:#faf7f2;font-size:13px}.cost-lib-versions ul{margin:6px 0 0;padding-left:18px}.cost-lib-versions li{margin:3px 0}
.cost-lib-docs{margin:4px 0 8px;font-size:13px}.cost-lib-docs summary{cursor:pointer;color:#6b665d}.cost-lib-docs img{height:90px}
/* Old · History — buyer POs of a style (queue job 1, 2026-11-21): latest PO beside the old costing, PO history, one PO */
.cost-lib-top{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.15fr);gap:16px;align-items:start;margin-bottom:12px}
@media (max-width:900px){.cost-lib-top{grid-template-columns:minmax(0,1fr)}}
.oh-side{display:flex;flex-direction:column;gap:12px;min-width:0}
.oh-po{padding:12px 14px;min-width:0}.oh-po h3{margin:0 0 6px;font-size:15px}
.oh-po-head{display:flex;flex-direction:column;gap:2px;font-size:13px;margin-bottom:8px}.oh-po-head .chip{margin-top:4px}
.oh-po-no{font-weight:700;font-size:14px}
.oh-po-table th,.oh-po-table td,.oh-hist th,.oh-hist td,.oh-lines th,.oh-lines td,.oh-docs th,.oh-docs td{padding:6px 8px;font-size:13px;vertical-align:top}
.oh-po-table td.num,.oh-hist td.num,.oh-lines td.num,.oh-docs td.num{white-space:nowrap;font-variant-numeric:tabular-nums}
.oh-chg{font-size:11px;font-weight:700}.oh-up{color:#b45309}.oh-down{color:#1d4ed8}.oh-same,.oh-basis{color:#8d8577}
.oh-sub{font-size:11px;color:var(--muted);white-space:nowrap}
.oh-was{font-size:12px;color:#b45309}
.oh-changed td{background:#fffbeb}
.oh-old td{opacity:.62}
.oh-revs{display:flex;flex-wrap:wrap;gap:6px;align-items:center;margin:6px 0 10px}
.oh-warn{margin:6px 0;font-size:12px}.oh-warn summary{cursor:pointer;display:flex;flex-wrap:wrap;gap:4px;align-items:center}.oh-warn ul{margin:6px 0 0 18px;padding:0}
.cost-lib-ordered{border-style:dashed}
.cost-lib-orderart{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px}.cost-lib-orderart .svg-icon{color:#b8ac98}
.cost-lib-po{display:flex;justify-content:space-between;gap:8px;font-size:12px;border-top:1px dashed #e6ded2;padding-top:6px;margin-top:2px}.cost-lib-po b{white-space:nowrap}
.cost-sub-note{margin:-4px 0 10px;font-size:12.5px}
/* Developments: factories & quotes (2026-11-21) */
.dev-table th.dev-fcol{min-width:170px;vertical-align:top;font-weight:600}.dev-table td{vertical-align:top}.dev-table .num{white-space:nowrap}
.dev-optstart td{border-top:2px solid #e6ded2}.dev-opt{font-weight:600;font-size:13px;max-width:320px;white-space:normal}
.dev-low{color:var(--ok);font-weight:700;font-size:12px}.dev-acts{display:flex;flex-direction:column;gap:4px;align-items:flex-start}.dev-brief{margin-top:8px}.dev-brief textarea{width:100%;margin:6px 0}
.dev-item-acts{display:inline-flex;gap:2px;margin-left:6px;vertical-align:middle}.dev-item-acts .icon-btn{width:26px;height:26px}
.dev-size{white-space:nowrap;min-width:110px}.dev-size strong{font-size:14px}.dev-size .muted{font-size:12px}
.dev-sub{white-space:nowrap;font-variant-numeric:tabular-nums}.dev-answer{min-width:140px}
/* Line form: remarks on its own line under each row (Sunny 2026-11-21) */
.lines-table tr.line-edit-row td{border-bottom:0;padding-bottom:4px}
.lines-table tr.line-edit-rem td{padding-top:0;padding-bottom:12px}
.lines-table tr.line-edit-rem .f{display:block;margin:0 0 4px}
/* Movable pop-ups (Sunny 2026-11-21): the title bar is the handle; the backdrop lightens while moving */
.modal-head.modal-drag{cursor:move;user-select:none;-webkit-user-select:none;touch-action:none}
.modal-head.modal-drag .modal-x{cursor:pointer}
.modal-bg.modal-moving{background:rgba(0,0,0,.12)}
/* Line remarks under the line in the size & colour lines table (Sunny 2026-11-21) */
.lines-table tr.line-has-rem td{border-bottom:0}
.lines-table tr.line-rem-row td{padding-top:0;color:#4b5563;font-size:13px;white-space:normal}
.lines-table tr.line-rem-row .line-rem-cap{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:#8f1d1d;font-weight:600;margin-right:4px}
/* Line pop-up: which order it is (Sunny 2026-11-21) */
.line-ctx{display:flex;flex-wrap:wrap;gap:6px 22px;margin:-4px 0 10px;font-size:14px}
.line-ctx .line-ctx-k{color:#6b7280}
/* Line remarks: grows with the text, can be stretched; line breaks kept in the lines table (Sunny 2026-11-21) */
textarea.line-remarks{min-height:40px;resize:vertical;overflow-y:auto;line-height:1.45;padding-top:9px;padding-bottom:9px}
.lines-table tr.line-rem-row td span:last-child{white-space:pre-wrap}
/* Long sub-sizes: one item per line (Sunny 2026-11-21) */
.size-lines{display:inline-block;white-space:normal;line-height:1.45}.size-lines .size-part{white-space:nowrap}
/* Master data: dictionary search (Sunny 2026-11-21) */
#dicts a.dict-first{background:#fbf3e9;border-radius:6px;padding-left:6px!important;margin-left:-6px}
/* Order status report with buyer + factory prices: smaller type so it fits on a landscape page (Sunny 2026-11-21) */
table.osr-two{font-size:13px}table.osr-two th,table.osr-two td{padding-left:6px;padding-right:6px}
@media print{table.osr-two{font-size:9px}}
table.osr td.osr-ref{white-space:nowrap}
/* Order status report: size & colour lines under each order (Sunny 2026-11-21) */
table.osr tr.osr-lines-row > td{padding:0 0 12px 24px;border-top:0;background:transparent}
table.osr-lines{width:auto;font-size:13px;margin:0;border-left:3px solid #efe6d8}
table.osr-lines th{font-size:10.5px;padding:4px 10px;background:#faf6ef}table.osr-lines td{padding:4px 10px}
.osr-toggle{display:inline-flex;align-items:center;gap:6px;font-size:14px;white-space:nowrap}
@media print{table.osr-lines{font-size:8.5px}table.osr tr.osr-lines-row > td{padding-left:12px}}
/* Wide tables (Sunny 2026-11-21: "sliding bar overlapping"): room under the table so the horizontal scrollbar
   (drawn over the content on macOS) never covers the last row / totals; a thin visible bar where supported */
.lines-wrap{padding-bottom:16px;scrollbar-width:thin}
.lines-wrap::-webkit-scrollbar{height:10px}.lines-wrap::-webkit-scrollbar-thumb{background:#c9c1b4;border-radius:6px}.lines-wrap::-webkit-scrollbar-track{background:#f4efe7;border-radius:6px}
@media print{.lines-wrap{padding-bottom:0}}
/* Order status report, compact layout (Sunny 2026-11-21: "proper sizes … text clearly visible, enough space") */
table.osr{font-size:14px}
table.osr th{white-space:nowrap;font-size:11px;letter-spacing:.03em}
table.osr td{vertical-align:top;padding-top:10px;padding-bottom:10px}
table.osr td.n,table.osr th.n{white-space:nowrap}
table.osr td.osr-ref{white-space:nowrap;line-height:1.5}
table.osr .osr-refline{white-space:nowrap}
table.osr .osr-reflab{display:inline-block;min-width:78px;font-size:11px;color:#8a8175;text-transform:uppercase;letter-spacing:.03em;margin-right:6px}
table.osr td.osr-val .osr-v{white-space:nowrap;line-height:1.5}
table.osr td.osr-val .osr-v small{color:#8a8175;font-size:11px}
table.osr td.osr-val .osr-v-factory{color:#5b5348}
table.osr tbody tr.osr-order td.osr-cust{min-width:150px}
/* Print: landscape, whole width on Letter / A4, headings on every page, no order split across pages */
@media print{
  table.osr{width:100%;font-size:8.5px;page-break-inside:auto}
  table.osr th{font-size:7.5px;padding:3px 4px}
  table.osr td{padding:3px 4px}
  table.osr thead{display:table-header-group}table.osr tfoot{display:table-row-group}
  table.osr tr{page-break-inside:avoid;break-inside:avoid}
  table.osr .osr-reflab{min-width:44px;font-size:7px}
  table.osr td.osr-val .osr-v small{font-size:7px}
  table.osr tbody tr.osr-order td:first-child{min-width:0}
  table.osr-lines{font-size:7.5px}table.osr-lines th{font-size:6.5px;padding:2px 4px}table.osr-lines td{padding:2px 4px}
  .osr-notes{font-size:8px}
}
table.osr tbody tr.osr-order > td:last-child{white-space:nowrap}
table.osr tbody tr.osr-order > td:nth-child(2){min-width:110px}
@media print{table.osr tbody tr.osr-order > td:nth-child(2){min-width:0}}
/* Each order (style) block starts under a clear dividing line (Sunny 2026-11-21) */
table.osr tbody tr.osr-order:not(:first-child) > td{border-top:2px solid #b9ad9b}
table.osr tbody tr.osr-lines-row > td{border-bottom:0}
@media print{table.osr tbody tr.osr-order:not(:first-child) > td{border-top:1.5px solid #555}}
/* print sizes tuned on a Letter / A4 landscape page (full width, readable): Sunny 2026-11-21 */
@media print{
  table.osr{font-size:10.5px}table.osr th{font-size:8.5px;padding:4px 5px}table.osr td{padding:4px 5px}
  table.osr .osr-reflab{font-size:7.5px;min-width:52px}table.osr td.osr-val .osr-v small{font-size:7.5px}
  table.osr-lines{font-size:9.5px}table.osr-lines th{font-size:7.5px;padding:3px 5px}table.osr-lines td{padding:3px 5px}
  .osr-notes{font-size:9px}
}
/* Row lines (Sunny 2026-11-21: "neat grey lines, light and dark, so each style follows properly"):
   light grey inside a style (order row → its size lines → each line), dark grey where the next style starts */
table.osr > tbody > tr > td{border-top:0;border-bottom:1px solid #e6e0d6}
table.osr > tbody > tr.osr-order:not(:first-child) > td{border-top:2px solid #6f685e}
table.osr > tbody > tr.osr-lines-row > td{border-bottom:0}
table.osr-lines td,table.osr-lines th{border-bottom:1px solid #ece7df}
table.osr-lines tr:last-child td{border-bottom:0}
table.osr > tfoot > tr:first-child > td{border-top:2px solid #6f685e}
@media print{
  table.osr > tbody > tr > td{border-bottom:.6px solid #c8c8c8}
  table.osr > tbody > tr.osr-order:not(:first-child) > td{border-top:1.4px solid #333}
  table.osr-lines td,table.osr-lines th{border-bottom:.5px solid #d6d6d6}
  table.osr > tfoot > tr:first-child > td{border-top:1.4px solid #333}
}
table.osr .osr-refvals{display:inline-block;vertical-align:top}
/* Order references (Sunny 2026-11-21): MPL order no. on top, Buyer PO no. under it */
.order-refs .order-ref{white-space:nowrap}.order-refs .order-ref-po{font-size:12.5px;color:#6b6358}
.order-refs .order-ref-lab{font-size:11px;color:#8a8175;text-transform:uppercase;letter-spacing:.03em}
/* Short headings with tooltips (Sunny 2026-11-21) */
abbr.th-abbr{text-decoration:underline dotted #b9ad9b;text-underline-offset:3px;cursor:help}
.col-key{font-size:12px;color:#8a8175;margin-top:8px}
@media print{abbr.th-abbr{text-decoration:none}.col-key{font-size:8px;color:#555}}
/* Upload progress (Sunny 2026-11-21) */
.upbar{display:flex;align-items:center;gap:8px;margin-top:6px}.upbar[hidden]{display:none}
.upbar-track{flex:1;height:8px;background:#efe8dc;border-radius:6px;overflow:hidden}.upbar-fill{height:100%;width:0;background:#8f1d1d;transition:width .15s}
.upbar-txt{font-size:12px;color:#6b6358;min-width:56px;text-align:right;font-variant-numeric:tabular-nums}

/* Order status report: product photo in the style cell (Sunny 2026-11-21; Codex layout advice) */
.osr-style{min-width:210px}.osr-style .osr-photo{float:left;width:64px;height:64px;object-fit:contain;background:#fff;border:1px solid #e6ded2;border-radius:6px;margin:0 8px 2px 0}
@media print{.osr-style .osr-photo{float:none;display:block;width:12mm;height:12mm;margin:0 0 1mm 0;border-radius:2px}}

.order-cover-preview{filter:blur(6px);transform:scale(1.02)}.order-cover{transition:filter .25s}

/* Label description wraps onto 3–4 lines instead of one long line (Sunny 2026-11-21) */
.osr-label{max-width:240px;min-width:160px;white-space:normal;word-break:break-word;line-height:1.35}
@media print{.osr-label{max-width:55mm}}

/* Bell rows by kind (Sunny 2026-11-21) */
.bell-menu .bell-item{display:flex;gap:10px;align-items:flex-start;padding:10px 14px 10px 12px;border-left:4px solid var(--bk,#c9c2b6);border-bottom:1px solid #f0ebe3;text-decoration:none;color:inherit;background:#fff}
.bell-menu .bell-item:hover{background:#faf6ef}.bell-menu .bell-item.read{opacity:.62}
.bell-ico{flex:none;width:30px;height:30px;border-radius:50%;display:flex;align-items:center;justify-content:center;background:var(--bkbg,#f1ede6);color:var(--bk,#6b6458)}
.bell-text{display:flex;flex-direction:column;gap:2px;min-width:0}.bell-kind{display:flex;gap:6px;align-items:center;font-size:11px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--bk,#6b6458)}
.bell-ago{margin-left:auto;font-weight:400;text-transform:none;letter-spacing:0;color:#8a8375}.bell-urgent{background:#b42318;color:#fff;border-radius:8px;padding:0 6px;font-size:10px}
.bell-title{font-size:14px;line-height:1.35;color:#1f2430}.bell-title strong{font-weight:700}.bell-body{font-size:12px;color:#6b7280;line-height:1.35}
.bk-dev{--bk:#6d28d9;--bkbg:#f1eafe}.bk-order{--bk:#1d4ed8;--bkbg:#e8effd}.bk-appt{--bk:#047857;--bkbg:#e4f5ee}.bk-follow{--bk:#b45309;--bkbg:#fdf1e0}
.bk-exp{--bk:#b42318;--bkbg:#fdeceb}.bk-appr{--bk:#0e7490;--bkbg:#e3f4f7}.bk-misc{--bk:#6b6458;--bkbg:#f1ede6}

/* Sr. column: as narrow as its number, left (Sunny 2026-11-21) */
.osr th:first-child,.osr tbody tr.osr-order td.osr-sr,.osr td.osr-sr.num{width:1%;min-width:0;white-space:nowrap;text-align:left !important;padding-right:10px}
table.osr tbody tr.osr-order > td.osr-style{min-width:240px}
@media print{table.osr tbody tr.osr-order > td.osr-style{min-width:0}}

/* Assistant product cards (Sunny 2026-11-21) */
.ai-card{margin-top:10px;border:1px solid #e6ded2;border-radius:10px;background:#fffdf9;padding:10px;display:flex;flex-direction:column;gap:8px;font-size:13px}
.ai-card-head{display:flex;gap:10px;align-items:flex-start}.ai-card-photo{width:72px;height:72px;object-fit:contain;background:#fff;border:1px solid #eee5d8;border-radius:8px;flex:none}
.ai-card-title{font-weight:700;font-size:14px;color:#8c1c1c;text-decoration:none}.ai-card-no{font-size:12px;color:#6b7280;margin:2px 0 4px}
.ai-card-status,.ai-q{display:inline-block;border-radius:10px;padding:1px 8px;font-size:11px;font-weight:600}
.ai-q-ok{background:#e4f5ee;color:#047857}.ai-q-bad{background:#fdeceb;color:#b42318}.ai-q-open{background:#fdf1e0;color:#b45309}
.ai-card-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px 12px}.ai-card-k{display:block;font-size:11px;color:#8a8375;text-transform:uppercase;letter-spacing:.03em}
.ai-card-items{width:100%;border-collapse:collapse}.ai-card-items td{padding:4px 6px;border-top:1px solid #f0ebe3;vertical-align:top}.ai-card-qty{white-space:nowrap;color:#6b7280}
.ai-card-more{font-size:12px;color:#6b7280}.ai-card-open{font-size:12px;font-weight:600;color:#8c1c1c;text-decoration:none;align-self:flex-start}

/* Assistant thinking card (same as dagar_rental, Sunny 2026-11-21) */
.ai-thinking{min-width:220px;background:#fff;border:1px solid #e6ded2;border-radius:16px;border-bottom-left-radius:6px;padding:.65rem .85rem}
.ai-thinking-title{font-size:11px;font-weight:600;color:#8a8375;margin-bottom:.35rem}.ai-thinking ul{list-style:none;padding:0;margin:0}
.ai-thinking li{display:flex;align-items:center;gap:.5rem;font-size:13px;margin-top:.2rem}.ai-thinking li.done{color:#8a8375}.ai-thinking .ai-tick{color:#16a34a;display:inline-flex}
.ai-ping{position:relative;width:14px;height:14px;display:grid;place-items:center;flex-shrink:0}
.ai-ping::before{content:"";position:absolute;inset:0;border-radius:50%;background:rgba(140,28,28,.28);animation:ai-ping 1s cubic-bezier(0,0,.2,1) infinite}
.ai-ping::after{content:"";width:8px;height:8px;border-radius:50%;background:#8c1c1c;position:relative}
@keyframes ai-ping{75%,100%{transform:scale(2);opacity:0}}
.ai-shimmer{background:linear-gradient(90deg,#8c1c1c,#d97706,#8c1c1c);background-size:200% 100%;-webkit-background-clip:text;background-clip:text;color:transparent;animation:ai-shimmer 2.4s linear infinite}
.ai-shimmer-fast{animation-duration:1.2s}@keyframes ai-shimmer{0%{background-position:0% 50%}100%{background-position:200% 50%}}
@media (prefers-reduced-motion:reduce){.ai-shimmer,.ai-ping::before{animation:none}}

/* packing list / invoice popups: long text wraps so the lines fit without sideways scrolling (Sunny 2026-11-21) */
.modal .lines-table td.wrap-cell{white-space:normal;min-width:120px;max-width:180px}.modal .lines-table td:nth-child(2){white-space:normal;min-width:140px;max-width:220px}
.modal .lines-table td:nth-child(2) .hint{white-space:normal}

/* full-width remark rows under a line never stick to the left edge (they hid the first columns' text) */
.modal .lines-table tr.line-rem-row td:first-child,.lines-table tr.line-rem-row td:first-child{position:static}

/* order lines: long label descriptions wrap so the table fits without sideways scrolling (Sunny 2026-11-21) */
.lines-table td.wrap,.lines-table td .wrap{white-space:normal;min-width:160px;max-width:260px}

/* On / off toggle (Sunny 2026-11-21): green dot = active, red dot = inactive */
.tgl{display:inline-flex;align-items:center;gap:6px;height:28px;padding:0 10px 0 4px;border:1px solid #d9d2c6;border-radius:999px;background:#fbf8f3;cursor:pointer;font-size:12px;font-weight:600;color:#7f1d1d;white-space:nowrap}
.tgl .tgl-dot{width:18px;height:18px;border-radius:50%;background:#dc2626;box-shadow:0 0 0 3px #fee2e2 inset;transition:transform .15s}
.tgl.on{color:#166534;background:#f0fdf4;border-color:#bbf7d0;padding:0 4px 0 10px;flex-direction:row-reverse}
.tgl.on .tgl-dot{background:#16a34a;box-shadow:0 0 0 3px #dcfce7 inset}
.tgl:hover{filter:brightness(.97)}.tgl:focus-visible{outline:2px solid #8f1d1d;outline-offset:2px}.tgl[disabled]{opacity:.6;cursor:wait}
.row-acts{display:flex;gap:4px;align-items:center;justify-content:flex-end}

/* order context strip under every popup title (style photo · style name · MPL order no.) */
.modal-ctx{display:flex;align-items:center;gap:10px;margin:0 22px 8px;padding:6px 10px;border:1px solid #eee5d6;border-radius:10px;background:#fbf8f3;flex:none}
.modal-ctx-img{width:44px;height:44px;border-radius:8px;object-fit:cover;flex:none;background:#efe9df}
.modal-ctx-noimg{display:flex;align-items:center;justify-content:center;font-size:10px;color:#8b8478}
.modal-ctx-style{font-weight:700;font-size:13px;line-height:1.3}.modal-ctx-no{font-size:12px;color:#6b6457}

/* Buyer POs page: column headers of each PO block in a darker grey (Sunny 2026-11-21) */
.po-block .lines-table thead th{color:#374151}

/* compact filter controls (Buyer PO planning and other filter bars) */
.input.input-sm,select.input.input-sm{height:34px;padding:4px 10px;font-size:14px;min-width:0}
/* order page size & colour lines: tighter cells so 4 money columns + actions fit one screen (Sunny 2026-11-21) */
.lines-table.order-lines th,.lines-table.order-lines td{padding-left:6px;padding-right:6px}.lines-table.order-lines td.wrap{min-width:120px;max-width:220px}
.lines-table.order-lines .tgl-text{display:none}
.lines-table.order-lines td:first-child:not([colspan]){white-space:normal;min-width:80px;max-width:110px}
/* Buyer PO documents card on the order page: tiles (Sunny 2026-11-21) */
.doc-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(330px,1fr));gap:8px;margin-top:10px;max-height:360px;overflow:auto;padding-right:4px}
.doc-tile{display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;padding:8px 10px;background:#fff;min-width:0}
.doc-tile:hover{border-color:#c9b9a3;background:#fcfaf6}
.doc-tile .ficon{flex:none}
.doc-main{flex:1;min-width:0}.doc-name{display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.doc-meta{font-size:12px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.doc-acts{display:inline-flex;gap:2px;flex:none}
.page-photo{display:block;flex:none;border-radius:10px;overflow:hidden;border:1px solid var(--line);background:#f6f1e8}.page-photo img{width:100%;height:100%;object-fit:cover;display:block}.page-photo-none{display:flex;align-items:center;justify-content:center;font-size:11px;color:var(--muted)}
.sum-scroll{max-height:290px;overflow:auto;border:1px solid var(--line);border-radius:10px}.sum-scroll table{margin:0}.sum-scroll thead th{position:sticky;top:0;z-index:2;background:#fff}.sum-scroll tfoot td{position:sticky;bottom:0;z-index:2;background:#f4efe7;box-shadow:0 -2px 0 #e2dbcf}
.tabs.tabs-sub{margin-top:-6px}.tabs.tabs-sub .tab{padding:6px 13px;font-size:14px}   /* sub-tabs under main tabs (same Toggleable / Dynamic style, smaller) */
.pick-list{margin-top:10px;max-height:52vh;overflow:auto;display:flex;flex-direction:column;gap:6px;padding:2px}
.pick-card{display:flex;align-items:center;gap:12px;width:100%;text-align:left;background:#fff;border:1px solid var(--line);border-radius:10px;padding:8px 12px;cursor:pointer;font:inherit;color:inherit}
.pick-card:hover{border-color:#c9b9a3;background:#fcfaf6}.pick-card.on{border-color:var(--red);box-shadow:0 0 0 2px rgba(143,29,29,.12);background:#fdf6f3}
.pick-card img,.pick-noimg{width:48px;height:48px;border-radius:8px;object-fit:cover;flex:none;border:1px solid var(--line)}.pick-noimg{display:flex;align-items:center;justify-content:center;font-size:10px;color:var(--muted);background:#f6f1e8}
.pick-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:1px}.pick-main span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pick-val{white-space:nowrap;font-weight:600}.pick-dot{width:16px;height:16px;border-radius:50%;border:2px solid #c9c2b6;flex:none}.pick-card.on .pick-dot{border-color:var(--red);background:radial-gradient(var(--red) 45%,transparent 50%)}
.orders-table tr.order-row{cursor:pointer}.orders-table tr.order-row:hover td{background:#fbf8f3}.orders-table td{vertical-align:middle}
/* Buyer POs print view (Sunny 2026-11-22): only #printArea prints; grey row lines so tables read clearly on paper */
#printArea{display:none}
@media print{
  body.print-bpo > *:not(#printArea){display:none !important}
  body.print-bpo #printArea{display:block;font-size:10.5px;color:#111;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  #printArea .pa-head{border-bottom:2px solid #8f1d1d;padding-bottom:4px;margin-bottom:8px}
  #printArea button,#printArea select,#printArea input,#printArea .row-acts,#printArea .icon-btn,#printArea .spacer,#printArea .btn{display:none !important}
  #printArea tfoot{display:table-row-group}   /* the total prints once, after the last row */
  #printArea thead{display:table-header-group}
  #printArea .sum-scroll{max-height:none !important;overflow:visible !important;border:0}
  #printArea thead th,#printArea tfoot td{position:static !important}
  #printArea table{border-collapse:collapse;width:100%;border:1px solid #9a9a9a}
  #printArea th,#printArea td{border-bottom:1px solid #9a9a9a !important;padding:3px 5px !important}
  #printArea .po-block{break-inside:avoid;border:1px solid #9a9a9a !important;margin:8px 0 !important}
  #printArea a{color:#111;text-decoration:none}
  #printArea .lines-wrap{overflow:visible !important}#printArea th,#printArea td{white-space:normal !important;min-width:0 !important;max-width:none !important;font-size:9.5px}#printArea td.num,#printArea th.num,#printArea td.num div,#printArea td.num strong{white-space:nowrap !important}   /* 1,080 SET stays on one line */
}
.sum-more{display:inline-flex;align-items:center;gap:4px;margin-left:8px;border:1px solid var(--line);background:#fff;border-radius:999px;padding:2px 10px 2px 6px;font-size:12px;color:var(--red);cursor:pointer;animation:sumBob 1.6s ease-in-out 3}.sum-more .svg-icon{display:inline-flex}.sum-more.at-end{opacity:.35}@keyframes sumBob{50%{transform:translateY(3px)}}@media print{.sum-more{display:none}}
.po-list .tgl-text{display:none}.po-list td{padding-left:8px;padding-right:8px}   /* MPL purchase orders list: dot-only toggle, tighter cells */
.ai-clip{flex:0 0 auto;min-height:44px;width:40px;border:1px solid var(--line);background:#fff;border-radius:10px;color:#6b6b6b;cursor:pointer;display:inline-flex;align-items:center;justify-content:center}.ai-clip:hover{color:var(--red);border-color:var(--red)}.ai-clip[disabled]{opacity:.5}
.ai-flag{border:0;background:none;padding:0 2px;font:inherit;font-size:12px;font-weight:650;cursor:help;white-space:nowrap}.ai-flag-red{color:#b42318}.ai-flag-amber{color:#b45309}.ai-flag:focus-visible{outline:2px solid #b42318;outline-offset:2px;border-radius:4px}
.ai-flag-card{position:absolute;z-index:3000;background:#1f2328;color:#f6f6f6;border-radius:10px;padding:10px 12px;box-shadow:0 10px 30px rgba(0,0,0,.25);font-size:13px;line-height:1.45}.ai-flag-head{font-weight:700;margin-bottom:4px;color:#fff}.ai-flag-card ul{margin:0 0 4px 16px;padding:0}.ai-flag-card li{margin:2px 0}.ai-flag-card li.lv-red{color:#ffb4ab}.ai-flag-card li.lv-amber{color:#fcd9a0}.ai-flag-note{margin-top:4px}.ai-flag-foot{margin-top:6px;font-size:11px;color:#b9bec7}
.t td .chip{white-space:normal}
/* Packing lines editor + view (Sunny 2026-11-22: clear header, hairline grey row lines, total row under the table) */
.pk-table{border-collapse:collapse;width:100%}
.pk-table thead th{background:#f3f0ea;color:#1f2328;font-weight:700;font-size:12px;letter-spacing:.02em;text-transform:uppercase;border-bottom:2px solid #cfc7b8;padding:9px 6px;white-space:nowrap;text-align:left}
.pk-table tbody td{border-bottom:1px solid #e4e0d8;padding:6px;vertical-align:middle}
.pk-table tbody tr:hover td{background:#fcfbf8}
.pk-table input.auto-filled{color:#1d4ed8;font-weight:650;background:#eef4ff;border-color:#9db8f5}   /* filled by "Fill Automatic CTN's" (Sunny 2026-11-22) */
.pk-table tfoot td{background:#f3f0ea;font-weight:700;color:#1f2328;border-top:2px solid #cfc7b8;padding:9px 6px;white-space:nowrap}
.pk-table .num{text-align:right}
.pk-table tr.group-row td{background:#f3f0ea;font-weight:700;border-top:2px solid #cfc7b8;border-bottom:0}
.pk-table td{white-space:nowrap}.pk-table input.input{min-width:70px}.pk-table select.input{min-width:96px}
.pk-table input[type=number].input{min-width:80px}
.modal-err .alert,.alert{white-space:pre-line}
.pk-table.hide-dest .dest-col,.pk-table.hide-cont .cont-col{display:none}.pk-table select.input[name=package_type]{min-width:84px;width:84px}

.stale-note{margin-top:5px;padding:5px 9px;border-radius:6px;background:#fff4e5;border:1px solid #f5c27a;color:#92400e;font-size:12.5px;font-weight:600}   /* "changed since Rev. n" (Sunny 2026-11-22) */

/* Plan shipments tabs 2–6 (Sunny 2026-11-23): the table scrolls inside the page and its header row (SHIPMENT · BUYER POS …) stays on top */
.queue-scroll{max-height:calc(100vh - 240px);overflow:auto;border:1px solid var(--line, #e4e0d8);border-radius:8px}
.queue-t thead th{position:sticky;top:0;z-index:2;background:#f3f0ea;box-shadow:0 1px 0 #d9d4cc}
.queue-t th.sortable{cursor:pointer;user-select:none;white-space:nowrap}.queue-t th.sortable:hover{color:#8f1d1d}.queue-t th .sort-ar{color:#8f1d1d;font-size:11px}   /* sortable headings (Sunny 2026-11-23) */
/* Order status report: one block per style — a new page per style when printed, never split (Sunny 2026-11-23) */
table.osr-fixed{table-layout:fixed;width:100%}
table.osr-fixed > thead th,table.osr-fixed > thead th *{white-space:normal;overflow-wrap:normal;vertical-align:bottom}
table.osr-fixed td.osr-ref,table.osr-fixed td.osr-ref *{white-space:normal;overflow-wrap:anywhere}
table.osr-fixed > tbody > tr > td{overflow-wrap:break-word}
@media screen{table.osr-cont > thead{display:none}.osr-block + .osr-block table.osr-fixed > tbody > tr:first-child > td{border-top:1.5px solid #d8ccb8}}
@media print{.osr-block + .osr-block{break-before:page;page-break-before:always}table.osr-lines tr{break-inside:avoid;page-break-inside:avoid}table.osr-foot{break-inside:avoid;page-break-inside:avoid}table.osr-foot > thead{display:none}}
/* Order status report lines: same column widths in every style; the heading repeated on top of each option block (Sunny 2026-11-23) */
table.osr-lines-fixed{table-layout:fixed;width:100%}
table.osr-lines-fixed td,table.osr-lines-fixed th{overflow-wrap:break-word}
table.osr-lines-fixed th{white-space:normal}
table.osr-lines tbody tr.osr-subhead th{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:#6b7280;background:#faf6ef;padding:8px 10px;text-align:left;border-top:0}
table.osr-lines tbody tr.osr-subhead th.n{text-align:right}
@media print{table.osr-lines tbody tr.osr-subhead th{font-size:7.5px;padding:3px 6px}table.osr-lines tr.osr-subhead{break-after:avoid;page-break-after:avoid}}
/* report: second-currency line and small notes scale with the print font (Sunny 2026-11-23: overlapping text in the PDF) */
.osr-alt{font-size:12px;font-weight:400}
@media print{.osr-alt{font-size:.92em}table.osr-lines .hint,table.osr-lines td.hint{font-size:1em}table.osr-lines td,table.osr-lines th{padding:3px 4px}table.osr-lines-fixed th{white-space:normal;overflow-wrap:normal;hyphens:none;line-height:1.15}}

/* AI price · detailed costing popup (Sunny 2026-11-23): Print prints only the costing */
.ai-costing-head{border-bottom:2px solid #8f1d1d;padding-bottom:6px;margin-bottom:8px}.ai-costing-price{font-size:18px;margin:6px 0 10px}.ai-costing-price .hint{font-size:12px}.ai-how{max-width:420px;white-space:normal}
#aiPrintArea{display:none}
@media print{body.print-ai > *:not(#aiPrintArea){display:none !important}body.print-ai #aiPrintArea{display:block;font-size:11px;color:#111}#aiPrintArea table{width:100%;border-collapse:collapse}#aiPrintArea th,#aiPrintArea td{border-bottom:1px solid #bbb;padding:3px 6px;text-align:left;vertical-align:top}#aiPrintArea .num{text-align:right}#aiPrintArea tr{break-inside:avoid}#aiPrintArea .lines-wrap{overflow:visible}}

/* "Agentic AI Powered" badge + "What the AI will do" remarks in AI popups (Sunny 2026-11-24) */
.ai-badge{display:inline-flex;align-items:center;gap:5px;margin-left:auto;margin-right:12px;padding:4px 10px;border-radius:999px;background:linear-gradient(90deg,#7c1d1d,#b45309);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap}
.ai-remarks{margin-right:auto;max-width:62%;text-align:left;font-size:12.5px;color:#5b5348}.ai-remarks ol{margin:4px 0 0 18px;padding:0}.ai-remarks li{margin:1px 0}
@media (max-width:900px){.ai-remarks{max-width:100%;flex-basis:100%;margin-bottom:8px}}
.actions:has(.ai-remarks){align-items:flex-end}

/* AI switched off (Sunny 2026-11-24): AI buttons stay visible but inactive, with the reason as tooltip */
.ai-off, .ai-off:hover { opacity: .45; cursor: not-allowed; filter: grayscale(1); pointer-events: auto; }
a.ai-off { pointer-events: none; }

/* Order status report, running / shipped orders (Sunny 2026-11-24): the size-line headings may wrap (they overlapped), the TNA bar and
   the buyer PO schedule under each order. The Developments report does not use these classes. */
table.osr-lines-order th{white-space:normal;line-height:1.25;vertical-align:bottom;overflow-wrap:anywhere}
table.osr-lines-order th.n{white-space:normal;text-align:right}
table.osr tr.osr-extra-row > td{padding:6px 0 8px 24px}
.osr-tna{display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;margin:2px 0 6px}
.osr-tna-lab{font-size:11px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);font-weight:600}
.osr-tna-track{flex:0 1 260px;min-width:140px;height:10px;border-radius:999px;background:#ece6db;overflow:hidden;border:1px solid var(--line)}
.osr-tna-fill{height:100%;background:#1f7a4d;border-radius:999px}.osr-tna-fill.late{background:#b45309}
.osr-tna-pct{min-width:42px}.osr-tna-next{color:var(--muted)}.osr-tna-late{color:#b42318;font-weight:600}
table.osr table.osr-pos,table.osr-pos{width:auto;min-width:min(760px,100%);font-size:13px;margin:0 0 4px;border-left:3px solid #d9e4ef}
table.osr-pos td:first-child{white-space:nowrap}
table.osr-lines-order th,table.osr-lines-order td{padding-left:6px;padding-right:6px}
table.osr-pos th{font-size:10.5px;padding:4px 10px;background:#f4f7fb}table.osr-pos td{padding:4px 10px}
@media print{.osr-tna{font-size:8.5px;gap:6px}.osr-tna-track{height:6px;flex-basis:120px;-webkit-print-color-adjust:exact;print-color-adjust:exact}.osr-tna-fill{-webkit-print-color-adjust:exact;print-color-adjust:exact}table.osr-pos{font-size:8px}table.osr-pos th{font-size:7px;padding:2px 4px}table.osr-pos td{padding:2px 4px}table.osr tr.osr-extra-row > td{padding-left:12px}}

/* Old customer prices (Sunny 2026-11-24): the heading row must stand apart from the lines — shaded, bold, a strong rule under it, and it
   stays in view while the list scrolls; every second line is lightly tinted; order totals are set off. Tokens only (themes). */
table.op-table thead th{background:var(--side);color:var(--ink);font-weight:700;font-size:11.5px;letter-spacing:.03em;padding:10px;border-bottom:2px solid var(--muted);position:sticky;top:0;z-index:1;white-space:nowrap}
table.op-table tbody td{padding:8px 10px}
table.op-table tbody tr:nth-child(even):not(.total-row):not(.colour-total) td{background:color-mix(in srgb,var(--side) 45%,transparent)}
table.op-table tbody tr.total-row td{background:var(--side);font-weight:650;border-top:1px solid var(--muted);border-bottom:2px solid var(--line)}

table.op-table tr.colour-break > td { border-top: 2px solid var(--line); }   /* old prices: a new colour inside the same order */
table.op-table tbody tr.style-heading > th{padding:12px 10px;text-align:left;background:var(--side);color:var(--ink);border-top:2px solid var(--muted);border-bottom:1px solid var(--line)}
table.op-table tbody tr.buyer-order-heading > th{padding:9px 10px;text-align:left;background:color-mix(in srgb,var(--side) 45%,transparent);color:var(--ink);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
table.op-table tbody tr.order-column-headings > th{background:var(--side);color:var(--ink);font-weight:700;font-size:11.5px;letter-spacing:.03em;padding:10px;border-bottom:2px solid var(--muted);white-space:nowrap}
table.op-table tbody tr.colour-total > td{background:color-mix(in srgb,var(--side) 65%,transparent);font-weight:600;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}

/* TNA for buyer / factory logins: steps the other side updates are inactive */
tr.tna-locked > td { background: #f4f2ee; color: #8a8580; }
tr.tna-locked > td strong { color: #8a8580; font-weight: 500; }
tr.tna-locked .chip { opacity: .6; }

/* service providers: long address / notes fold to at most three lines; the full text is in the tooltip */
.sp-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; }

/* reliability stars */
.star-btn { border: 0; background: none; padding: 0 1px; font-size: 18px; line-height: 1; color: #c9c2b8; cursor: pointer; }
.star-btn.on { color: #d99a00; }
.star-btn:disabled { cursor: default; }
.star-btn:not(:disabled):hover { color: #b97f00; }

.icon-btn.pin-on { color: #b3261e; }   /* a company pinned to the MPL Forwarder / MPL Brokerage list */

/* service providers: sticky table heading on wide screens (the wrapper must not scroll for it to stick to the page) */
@media (min-width: 1200px) {
  .lines-wrap.sp-sticky { overflow: visible; }
  .lines-wrap.sp-sticky thead th { position: sticky; top: var(--sp-top, 100px); z-index: 5; background: var(--card, #fff); box-shadow: 0 1px 0 var(--line); }
}

.route-no { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; background: var(--brand, #8b1e1e); color: #fff; font-weight: 700; }

.sp-logo { width: 26px; height: 26px; object-fit: contain; border-radius: 5px; background: #fff; border: 1px solid var(--line); vertical-align: middle; margin-right: 8px; }

/* client tabs on MPL Shipping Routes: green dot = route saved for the client, hollow = not saved (shows the general route) */
.route-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #b9b2a7; margin-right: 7px; vertical-align: baseline; }
.route-dot.on { background: #16a34a; border-color: #16a34a; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* maps (trial): forwarder / broker offices and the lanes of MPL Shipping Routes */
.sp-map { width: 100%; border-radius: 10px; border: 1px solid var(--line); background: #dfe9f2; z-index: 0; }
.map-key { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: -1px; }
.map-key.ring { background: #1f6feb; outline: 3px solid #111; outline-offset: -1px; }
.leaflet-tooltip.map-stop { font-weight: 600; font-size: 12px; padding: 2px 6px; }

.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; } @media (max-width: 1300px) { .map-grid { grid-template-columns: 1fr; } }
.map-label-wrap { width: 0 !important; height: 0 !important; }
.map-label-wrap .map-names { position: absolute; left: 0; top: 0; width: 240px; box-sizing: border-box; font-size: 11.5px; line-height: 16px; padding: 3px 7px; border-radius: 6px; border: 1px solid #8c857b; box-shadow: 0 1px 4px rgba(0,0,0,.2); color: #1d1d1f; background: #fff; }
.map-label-wrap .map-names > div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-label-wrap.right .map-names { left: auto; right: 0; }
.map-names .map-city { font-weight: 700; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; color: #6b655d; }
/* Forwarders: row controls end at the right edge on company and contact rows alike; Quotes column; freight quotes popup (2026-11-24) */
table.t td.sp-acts { text-align: right; white-space: nowrap; width: 1%; }
table.t td.sp-quotes { white-space: nowrap; width: 1%; }
.row-actions .icon-btn:has(.hint) { width: auto; padding: 0 5px; }
.pq-expired { color: var(--bad); font-weight: 600; }
.pq-sur ul { margin: 4px 0 8px 18px; }
.pq-calc { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.pq-calc .pq-grid { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.pq-result { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.pq-result .pq-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.pq-result .pq-head strong { font-size: 22px; color: var(--ink); }
.pq-result h4 { margin: 10px 0 4px; font-size: 13px; }
.pq-two { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 900px) { .pq-two { grid-template-columns: 1fr; } .pq-calc .pq-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* forwarder quotes: best-way card, AI advice, one table per container size (2026-11-24) */
.pq-best { border: 1px solid var(--line); border-left: 4px solid var(--ok, #15803d); background: var(--card); border-radius: 10px; padding: 10px 14px; margin: 6px 0; }
.pq-best-main { display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap; margin: 2px 0; font-size: 15px; }
.pq-best-fig { font-size: 20px; font-weight: 700; color: var(--ok, #15803d); }
.pq-advice { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 14px; margin: 6px 0; background: var(--card); line-height: 1.5; }
.pq-lane { margin: 16px 0 4px; font-size: 15px; }
.pq-group { margin: 6px 0 10px; }
.pq-group-title { font-weight: 600; font-size: 13px; padding: 4px 0; color: var(--muted, #6b7280); text-transform: none; }
.pq-group table.t thead th { background: var(--bg-soft, rgba(120, 120, 120, .10)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding-top: 8px; padding-bottom: 8px; color: var(--ink); }
.pq-group table.t thead th:first-child { padding-left: 10px; } .pq-group table.t tbody td:first-child { padding-left: 10px; }
.pq-best { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.pq-best-left { flex: 1 1 420px; min-width: 0; }
.pq-best-calc { flex: 1 1 380px; border-left: 1px solid var(--line); padding-left: 18px; }
.pq-best-calc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.pq-best-calc td { padding: 3px 6px 3px 0; vertical-align: top; white-space: normal; }
.pq-best-calc td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pq-best-calc tr.pq-last td { border-top: 1px solid var(--line); font-weight: 700; color: var(--ok, #15803d); padding-top: 5px; }
.pq-others { margin: 6px 0; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); font-size: 13px; }
.pq-client { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: var(--card); }
.pq-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin-top: 6px; }
.pq-step { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; }
.pq-step-on { border-color: var(--ok, #15803d); box-shadow: inset 3px 0 0 var(--ok, #15803d); }
.pq-step-off { opacity: .55; }
.pq-ship { align-items: end; }
.pq-ship .pq-calc-btn { display: flex; align-items: flex-end; padding-bottom: 1px; }
.pq-ship .pq-calc-btn .btn { height: 40px; }
.route-rates-row > td { border-top: 0 !important; padding-top: 0 !important; }
.route-rates { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; background: var(--card); margin: 0 0 8px; }
.route-rates-none { padding: 6px 12px; font-size: 13px; }
.route-rates-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
/* routes page: freight rates table (2026-11-24) */
.rr-table td { vertical-align: top; padding-top: 10px; padding-bottom: 10px; }
.rr-table .rr-name { min-width: 230px; white-space: normal; }
.rr-table .rr-name a { font-weight: 600; white-space: nowrap; }
.rr-table .rr-rate { white-space: nowrap; min-width: 96px; }
.rr-fig { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rr-table .rr-fees { min-width: 230px; white-space: nowrap; }
.rr-table .rr-other { min-width: 210px; }
.rr-table .rr-valid { white-space: nowrap; min-width: 120px; }
.rr-list { list-style: none; margin: 4px 0 0; padding: 0; font-size: 12.5px; color: var(--muted, #6b7280); }
.rr-list li { display: flex; justify-content: space-between; gap: 14px; padding: 1px 0; white-space: nowrap; }
.route-rates { max-width: calc(100vw - 400px); overflow-x: auto; white-space: normal; }
.route-rates .hint, .route-rates .alert { white-space: normal; }
.rr-table .rr-name { min-width: 200px; } .rr-table .rr-fees { min-width: 200px; } .rr-table .rr-other { min-width: 170px; } .rr-table .rr-valid { min-width: 110px; }
@media (max-width: 900px) { .route-rates { max-width: calc(100vw - 60px); } }
.rr-table .rr-name { min-width: 170px; } .rr-table .rr-name a { white-space: normal; } .rr-table .rr-fees { min-width: 185px; } .rr-table .rr-other { min-width: 150px; } .rr-table .rr-rate { min-width: 84px; }
.rr-table th, .rr-table td { padding-left: 8px; padding-right: 8px; }
.pq-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin: -2px 0 8px; }
.pq-packinfo { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin: 2px 0 6px; }
.ai-dl{display:flex;gap:8px;align-items:center;margin-top:8px;padding-top:6px;border-top:1px solid var(--line);font-size:12px}
.ai-dl-lbl{color:var(--muted,#6b7280)}
.ai-dl-btn{display:inline-flex;align-items:center;gap:4px;border:1px solid var(--line);background:var(--card);color:var(--ink);border-radius:6px;padding:3px 8px;font-size:12px;cursor:pointer}
.ai-dl-btn:hover{border-color:var(--brand,#8b1e1e);color:var(--brand,#8b1e1e)}.ai-dl-btn:disabled{opacity:.5;cursor:wait}.ai-dl-bad{border-color:var(--bad,#b91c1c);color:var(--bad,#b91c1c)}
.ai-dl-btn .ficon{font-size:9px;padding:1px 3px}.ai-dl-btn .ficon.ficon-svg{padding:0}
.ai-dl-hint{font-size:12px;color:var(--muted,#6b7280);margin-top:4px;white-space:normal}
/* a popup that allows the assistant beside it (MC.modal opts.chatBeside): the chat button and panel sit above the overlay */
html.modal-open:has(.modal-bg.modal-chat-ok) .ai-fab{z-index:70}
html.modal-open:has(.modal-bg.modal-chat-ok) .ai-panel{z-index:71}
.pq-best-note{font-size:13px;margin:2px 0 4px;white-space:normal;color:var(--ink)}
.ai-table td.ai-photo{padding:4px;width:84px}.ai-table td.ai-photo img{width:76px;height:76px;object-fit:cover;border-radius:6px;display:block;border:1px solid var(--line)}
.ai-table.ai-grouped td.ai-merge,.ai-table.ai-grouped td.ai-photo{background:var(--card)}.ai-table.ai-grouped tbody tr.ai-group td{border-top:2px solid var(--muted)}.ai-table.ai-grouped td{line-height:1.35}
.ai-table .ai-kind{display:inline-block;padding:1px 9px;border-radius:999px;font-weight:650;font-size:11.5px;white-space:nowrap;border:1px solid currentColor}
.ai-table tr.ai-k-running .ai-kind,.ai-table tr.ai-k-running td strong.ai-key{color:#1f7a4d!important}
.ai-table tr.ai-k-dev .ai-kind,.ai-table tr.ai-k-dev td strong.ai-key{color:#1d5fa8!important}
.ai-table tr.ai-k-shipped .ai-kind,.ai-table tr.ai-k-shipped td strong.ai-key{color:#6b4fa0!important}
.ai-count{font:inherit;font-weight:700;cursor:pointer;border:1px solid currentColor;border-radius:999px;padding:0 8px;background:transparent;line-height:1.5}
.ai-count:hover{background:currentColor}.ai-count:hover{color:#fff!important;background:#333}
.ai-count-running{color:#1f7a4d}.ai-count-dev{color:#1d5fa8}.ai-count-shipped{color:#6b4fa0}
.ai-count-running:hover{background:#1f7a4d}.ai-count-dev:hover{background:#1d5fa8}.ai-count-shipped:hover{background:#6b4fa0}
.ai-table tr.ai-kind-head td{font-weight:700;font-size:13px;padding:7px 7px 5px;background:var(--side)!important;border-top:2px solid var(--muted)}
.ai-table tr.ai-kind-head.ai-k-running td{color:#1f7a4d}.ai-table tr.ai-kind-head.ai-k-dev td{color:#1d5fa8}.ai-table tr.ai-kind-head.ai-k-shipped td{color:#6b4fa0}
.ai-table.ai-kinds tbody tr:not(.ai-kind-head) td{background:var(--card)}
.ai-col{display:flex;flex-direction:column;min-width:0;max-width:100%;position:relative}.ai-msg.ai-user .ai-col{align-items:flex-end}
.ai-col>.ai-bubble{padding-bottom:22px;min-width:150px}
.ai-time{position:absolute;right:12px;bottom:5px;font-size:10.5px;color:var(--muted);white-space:nowrap;pointer-events:none}
.ai-msg.ai-user .ai-time{color:rgba(255,255,255,.82)}
.ai-break{display:flex;align-items:center;gap:8px;color:var(--muted);font-style:italic;margin-top:8px}
.ai-chai{width:26px;height:26px;flex:none;fill:none;stroke:#8a5a2b;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.ai-chai .ai-cup{fill:#fff7ec}.ai-chai .ai-tea{fill:#c98a4b;stroke:none}
.ai-chai .ai-steam{stroke:#b9a892;stroke-width:1.5;animation:ai-steam 2.2s ease-in-out infinite}.ai-chai .ai-steam.s2{animation-delay:.5s}.ai-chai .ai-steam.s3{animation-delay:1s}
@keyframes ai-steam{0%{opacity:0;transform:translateY(3px)}40%{opacity:.9}100%{opacity:0;transform:translateY(-4px)}}
@media (prefers-reduced-motion:reduce){.ai-chai .ai-steam{animation:none;opacity:.7}}
.ai-rate{display:flex;gap:4px;align-items:center;margin-top:6px}.ai-rate-btn{border:1px solid var(--line);background:var(--card);border-radius:8px;padding:3px 7px;cursor:pointer;color:var(--muted);line-height:0}
.ai-rate-btn:hover{color:var(--ink)}.ai-rate-btn.on-up{color:#1f7a4d;border-color:#1f7a4d}.ai-rate-btn.on-down{color:#b91c1c;border-color:#b91c1c}.ai-rate-said{font-size:11.5px;color:var(--muted);margin-left:4px}

/* Development comparison design trial (Sunny 2026-11-26). Screen only: the issued/printed report keeps its layout. */
@media screen{
  #orRoot.osr-compare-view{--osr-soft:color-mix(in srgb,var(--ink) 3%,var(--card));--osr-low:color-mix(in srgb,var(--ok) 7%,var(--card))}
  #orRoot.osr-compare-view>.pagebar{margin-bottom:18px}
  #orRoot.osr-compare-view>.pagebar h1{font-size:26px;letter-spacing:-.025em}
  #orRoot.osr-compare-view>.pagebar .muted{font-size:13px;line-height:1.7}
  #orRoot.osr-compare-view>.filter-bar{padding:16px;gap:8px;border-radius:12px;margin-bottom:22px}
  #orRoot.osr-compare-view>.filter-bar .input{font-size:13px;height:36px}
  #orRoot.osr-compare-view>.filter-bar input[type=date]{max-width:138px!important}
  #orRoot.osr-compare-view .osr-export-actions{margin-left:auto;flex-shrink:0}
  #orRoot.osr-compare-view>.filter-bar .btn{font-size:13px;padding:7px 12px}
  #orRoot.osr-compare-view .osr-toggle{font-size:12px;padding:6px 8px;border:1px solid var(--line);border-radius:6px;background:var(--osr-soft);gap:5px}
  #orRoot.osr-compare-view .osr-toggle input{accent-color:var(--red);margin:0}
  #orRoot.osr-compare-view>.osr-report{padding:0;border:0;background:transparent;box-shadow:none}
  #orRoot.osr-compare-view>.osr-report>.lines-wrap{overflow:visible;padding-bottom:0}
  #orRoot.osr-compare-view .osr-block{background:var(--card);border:1px solid var(--line);border-radius:12px;margin-bottom:24px;box-shadow:0 2px 5px rgb(0 0 0 / 3%);min-width:0}
  #orRoot.osr-compare-view .osr-product-header{display:flex;align-items:center;gap:16px;padding:20px;border-bottom:1px solid var(--line)}
  #orRoot.osr-compare-view .osr-product-thumb{display:flex;align-items:center;justify-content:center;flex:0 0 80px;width:80px;height:80px;border:1px solid var(--line);border-radius:9px;background:var(--osr-soft);color:var(--muted);font-size:24px}
  #orRoot.osr-compare-view .osr-product-thumb img{display:block;width:72px;height:72px;object-fit:contain;border-radius:6px}
  #orRoot.osr-compare-view .osr-product-info{flex:1;min-width:0}
  #orRoot.osr-compare-view .osr-product-eyebrow{font-size:10px;font-weight:650;text-transform:uppercase;letter-spacing:.09em;color:var(--muted);margin-bottom:4px}
  #orRoot.osr-compare-view .osr-product-info h2{font-size:19px;line-height:1.35;letter-spacing:-.015em;margin:0 0 5px}
  #orRoot.osr-compare-view .osr-product-customer{font-size:12px;color:var(--muted);line-height:1.5}
  #orRoot.osr-compare-view .osr-product-meta{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:9px;font-size:11px;color:var(--muted)}
  #orRoot.osr-compare-view .osr-category{border:1px solid var(--line);border-radius:4px;background:var(--osr-soft);padding:2px 7px;color:var(--ink)}
  #orRoot.osr-compare-view .osr-product-reference{flex:0 1 240px;text-align:right;font-size:12px;min-width:0;overflow-wrap:anywhere}
  #orRoot.osr-compare-view .osr-product-reference>span{display:block;font-size:10px;text-transform:uppercase;letter-spacing:.07em;color:var(--muted);margin-bottom:4px}
  #orRoot.osr-compare-view .osr-product-reference a{font-weight:600}
  #orRoot.osr-compare-view .osr-comparison-block>table.osr>thead,#orRoot.osr-compare-view .osr-comparison-block>table.osr>tbody>.osr-order{display:none}
  #orRoot.osr-compare-view table.osr>tbody>.osr-lines-row>td{padding:18px;border:0;border-radius:0 0 12px 12px;background:transparent}
  #orRoot.osr-compare-view .osr-opt{margin:0 0 18px!important;border:1px solid var(--line);border-radius:8px;overflow:hidden;background:var(--card)}
  #orRoot.osr-compare-view .osr-opt:last-of-type{margin-bottom:12px!important}
  #orRoot.osr-compare-view .osr-opt-title{display:flex;align-items:baseline;gap:9px;margin:0!important;padding:12px 14px;background:var(--osr-soft);border-bottom:1px solid var(--line);font-size:12px;font-weight:500;line-height:1.65!important;color:var(--ink)}
  #orRoot.osr-compare-view .osr-opt-title>strong{flex-shrink:0;font-size:11px;letter-spacing:.05em;background:color-mix(in srgb,var(--red) 9%,var(--card));color:var(--ink);border:1px solid color-mix(in srgb,var(--red) 20%,var(--line));padding:3px 7px;border-radius:4px}
  #orRoot.osr-compare-view .osr-opt-title>span{min-width:0;overflow-wrap:anywhere}
  #orRoot.osr-compare-view .osr-option-scroll{overflow-x:auto;scrollbar-width:thin;scrollbar-color:var(--muted) var(--side)}
  #orRoot.osr-compare-view .osr-option-scroll>table.osr-lines{min-width:var(--osr-option-width);margin:0;border-left:0;background:var(--card);font-size:13px}
  #orRoot.osr-compare-view table.osr-lines thead th{padding:10px 12px;font-size:11px;letter-spacing:.055em;white-space:normal!important;overflow-wrap:normal;line-height:1.35;background:var(--side)!important;color:var(--ink)!important;vertical-align:middle;border-bottom:1px solid var(--line)}
  #orRoot.osr-compare-view table.osr-lines tbody td{padding:13px 12px;border-bottom:1px solid var(--line);line-height:1.5;background:var(--card);vertical-align:top}
  #orRoot.osr-compare-view table.osr-lines tbody tr:nth-child(even):not(.total-row)>td{background:var(--osr-soft)}
  #orRoot.osr-compare-view table.osr-lines tbody tr:not(.total-row):hover>td{background:color-mix(in srgb,var(--red) 3%,var(--card))}
  #orRoot.osr-compare-view table.osr-lines td.n,#orRoot.osr-compare-view table.osr-lines th.n{font-variant-numeric:tabular-nums}
  #orRoot.osr-compare-view .osr-factory-price>div:first-child{font-size:14px;font-weight:650;letter-spacing:-.01em}
  #orRoot.osr-compare-view table.osr-lines td.osr-price-low{color:var(--ok)!important;background:var(--osr-low)!important;box-shadow:inset 2px 0 0 color-mix(in srgb,var(--ok) 28%,transparent)}
  #orRoot.osr-compare-view .osr-alt{font-size:11px;line-height:1.55}
  #orRoot.osr-compare-view .osr-factory-price .osr-alt{margin-top:3px}
  #orRoot.osr-compare-view .osr-price-pending{font-style:italic;font-size:11px}
  #orRoot.osr-compare-view .osr-lowest{white-space:normal}
  #orRoot.osr-compare-view .osr-lowest>strong{display:block;font-size:12px;font-weight:650;color:var(--ok);margin-bottom:3px}
  #orRoot.osr-compare-view .osr-lowest>.muted{font-size:11px;line-height:1.5;font-weight:400}
  #orRoot.osr-compare-view table.osr-lines .osr-option-total>td{padding:13px 12px;background:var(--side)!important;border-top:2px solid color-mix(in srgb,var(--ink) 18%,var(--line));border-bottom:0;font-weight:650}
  #orRoot.osr-compare-view .osr-option-total .n>div:first-child{font-size:13px}
  #orRoot.osr-compare-view .osr-option-total .osr-alt{font-weight:400}
  #orRoot.osr-compare-view .osr-lines-row>td>.hint{font-size:10.5px;line-height:1.7;color:var(--muted);padding:0 2px}
  #orRoot.osr-compare-view .osr-foot{background:var(--card);border:1px solid var(--line);border-radius:8px;overflow:hidden}
  #orRoot.osr-compare-view .osr-notes{font-size:11px;line-height:1.7;margin:14px 2px}
}
@media screen and (max-width:760px){
  #orRoot.osr-compare-view .osr-product-header{padding:14px;gap:12px;flex-wrap:wrap}
  #orRoot.osr-compare-view .osr-product-thumb{flex-basis:64px;width:64px;height:64px}
  #orRoot.osr-compare-view .osr-product-thumb img{width:58px;height:58px}
  #orRoot.osr-compare-view .osr-product-info h2{font-size:16px}
  #orRoot.osr-compare-view .osr-product-reference{flex:1 0 100%;text-align:left;padding-top:10px;border-top:1px solid var(--line)}
  #orRoot.osr-compare-view .osr-product-reference>span{display:inline;margin-right:8px}
  #orRoot.osr-compare-view .osr-product-meta{gap:8px}
  #orRoot.osr-compare-view table.osr>tbody>.osr-lines-row>td{padding:10px}
  #orRoot.osr-compare-view .osr-opt-title{flex-wrap:wrap;gap:5px;padding:10px}
  #orRoot.osr-compare-view .osr-opt-title>span{flex-basis:100%}
  #orRoot.osr-compare-view>.filter-bar{padding:12px;gap:6px}
  #orRoot.osr-compare-view>.filter-bar .input:not([type=date]){flex:1 1 calc(50% - 6px);max-width:100%!important;min-width:0}
  #orRoot.osr-compare-view>.filter-bar input[name=q]{flex-basis:100%!important}
  #orRoot.osr-compare-view>.filter-bar input[type=date]{max-width:118px!important;font-size:11px}
  #orRoot.osr-compare-view>.filter-bar>span.muted{font-size:11px}
  #orRoot.osr-compare-view .osr-export-actions{flex-basis:100%;justify-content:flex-end;margin-top:6px}
  #orRoot.osr-compare-view>.filter-bar .osr-toggle{white-space:normal}
}

/* A company's former name beside its name (Sunny 2026-12-02: LinkedIn blue, bold) — retailer list, card, group trees */
.former-name { color: #0A66C2; font-weight: 400; } .former-name b { font-weight: 700; }

/* retailer BRAND names (Sunny 2026-12-02): their own colour, so a brand reads apart from a company (red link) and a former name (blue) */
.brand-name{color:var(--brand-name)}
/* a person who has ever signed in to MapleCRM: parrot-green line under the name (Sunny 2026-12-02) */
.signed-in{border-bottom:3px solid var(--signed-in);padding-bottom:1px}
/* assistant: cutting plan drawn as one metre of fabric (Sunny 2026-12-03) */
.ai-marker-wrap{margin:6px 0 10px;max-width:460px}.ai-marker{width:100%;height:auto;color:var(--muted,#888)}.ai-marker .mk-roll{fill:var(--card,#fff);stroke:var(--ink,#333);stroke-width:.4}.ai-marker .mk-sel{fill:var(--line,#ddd)}.ai-marker .mk-panel{fill:#dbeafe;stroke:#1d4ed8;stroke-width:.35}.ai-marker .mk-back{fill:#dcfce7;stroke:#15803d}.ai-marker .mk-waste{stroke:none}.ai-marker .mk-txt{fill:#1f2937;font-weight:600}.ai-marker .mk-dim{fill:var(--ink,#333)}.ai-marker-wrap figcaption{font-size:12px;color:var(--muted,#666);margin-top:2px}
/* contacts who moved company (2026-12-02): closed records greyed, chips with the other company's logo, the Company path in Details */
.tree-person.moved,.cc-row.moved{opacity:.65}
.mv-chip{display:inline-flex;align-items:center;gap:3px}.mv-chip img{width:18px;height:18px;margin:0 2px;padding:1px}
.mv-path{display:flex;flex-wrap:wrap;align-items:center;gap:2px;white-space:normal}.mv-step{display:inline-flex;align-items:center;gap:4px;padding:2px 6px;border-radius:6px}.mv-step.mv-here{background:var(--card-2,var(--bg-2,#f3f1ec));outline:1px solid var(--line)}
.mv-logins{max-width:560px}.mv-login{display:block;margin:4px 0;cursor:pointer}
