/* Product-only visual system. No data, prices or inventory semantics. */
:root { --product-canvas:#f5f7fb; --product-ink:#192436; --product-muted:#566579; --product-line:#dfe5ee; --product-accent:#365bd6; }
body:is(.product-experience-v9,.product-technology-v2,.erp-product-page,.product-intake-experience) { background:var(--product-canvas)!important; color:var(--product-ink); font-size:14px; line-height:1.55; }
body :is(button,input,select,textarea) { font-family:inherit; }
body :is(button,a,input,select,textarea,summary):focus-visible { outline:3px solid #365bd666; outline-offset:3px; }
body :is(.sidebar,.erp-sidebar) { background:#fff!important; border-right:1px solid var(--product-line)!important; box-shadow:none!important; }
body :is(.brand,.brand-block,.erp-brand) { background:transparent!important; box-shadow:none!important; border:0!important; border-radius:0!important; }
body :is(.brand-mark,.erp-brand-mark) { background:#192436!important; box-shadow:none!important; border-radius:9px!important; }
body :is(.topbar,.erp-topbar) { background:#fff!important; box-shadow:none!important; border-color:var(--product-line)!important; }
body :is(.topbar h1,.erp-page-head h1) { font-size:26px!important; line-height:1.3!important; letter-spacing:-.02em; }
body :is(.panel,.metric-card,.metric,.daily-workbench,.workbench-task,.workbench-shortcuts a,.cost-card-metric,.cost-detail-panel,.cost-card-hero,.cost-card-section,.form-card,.advanced-card) { border-radius:12px!important; box-shadow:none!important; border-color:var(--product-line)!important; }
body :is(.button,.row-button,.nav-item,.nav-subitem,.erp-nav-link) { border-radius:8px!important; }
body :is(.button.primary,.button.primary-action) { background:var(--product-accent)!important; border-color:var(--product-accent)!important; color:#fff!important; box-shadow:none!important; }
body :is(.panel-head h2,.section-heading h2) { font-size:17px; }
body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]):not([hidden]) { border-radius:8px; }
/* Native checks must never inherit full-width input rules. Keep hidden chip radios hidden. */
body input:is([type=checkbox],[type=radio]):not([hidden]) { width:18px!important; height:18px!important; min-width:18px!important; min-height:18px!important; max-width:18px!important; padding:0!important; flex:0 0 18px; vertical-align:middle; accent-color:var(--product-accent); }
body #supplyOfferModal .supply-customized-label { display:inline-flex; align-items:center; gap:8px; min-height:40px; }
body :is(.cost-card-metric,.cost-record-metric) > :is(span,small) { color:#526174!important; opacity:1!important; }
body :is(.cost-card-metric,.cost-record-metric) > strong { color:#192436!important; font-variant-numeric:tabular-nums; }
body :is(.cost-card-metric,.cost-record-metric):is(.primary,.highlight,.is-primary) > strong { color:#244fa6!important; }
body .cost-card-metric { padding:16px!important; background:#fff!important; }
body .cost-card-metric > span { font-size:13px!important; }
body .cost-card-metric > small { font-size:12px!important; }
body .cost-card-metric > strong { font-size:24px!important; }
body .cost-card-hero { background:#fff!important; }
body .cost-card-grid { gap:12px!important; }
body .data-table th, body .catalog-table th { color:#526174!important; background:#f8fafc!important; }
body .catalog-table td { word-break:normal!important; overflow-wrap:break-word!important; }
body .catalog-table td:is([data-label="分类"],[data-label="商品归属"],[data-label="状态"]) { white-space:nowrap!important; }
body .catalog-table td[data-label="该规格价格"] { white-space:nowrap; text-align:right; font-variant-numeric:tabular-nums; }
body .catalog-table .tag { white-space:nowrap; }
body .selected-product-chips { max-height:160px; overflow:auto; overscroll-behavior:contain; }
.product-selection-details > summary { min-height:36px; padding:8px 0; cursor:pointer; color:#365bd6; }
.product-workspace-switch { margin:4px 0 14px; padding:8px 10px; border:1px solid var(--product-line); border-radius:9px; background:#f8fafc; }
.product-workspace-switch > summary { min-height:28px; cursor:pointer; font-size:13px; font-weight:650; color:#344861; }
.product-workspace-switch nav { display:grid; gap:3px; padding-top:8px; }
.product-workspace-switch a { padding:8px 10px; border-radius:7px; text-decoration:none; color:#43536a; font-size:13px; }
.product-workspace-switch a:hover,.product-workspace-switch a[aria-current=page] { background:#eaf0ff; color:#254cb1; }
body .birthday-fold-image-button,body .birthday-fold-row .product-image-carousel { width:72px!important; height:72px!important; min-width:72px!important; }
body .birthday-fold-image-button img { width:100%; height:100%; object-fit:cover; }
body .birthday-fold-row > td { padding-top:14px!important; padding-bottom:14px!important; }
body .birthday-fold-card { gap:18px!important; padding:4px 0!important; }
body .birthday-fold-toggle strong { font-size:17px!important; line-height:1.4; }
body .birthday-fold-metric b { font-size:20px!important; }
body .birthday-size-list { gap:4px!important; }
body .birthday-size-list .size-chip { font-size:11px!important; padding:3px 6px!important; }
body .birthday-fold-side .row-button { min-height:34px!important; font-size:12px!important; box-shadow:none!important; }
body :is(.table-container,.table-shell) { overscroll-behavior-x:contain; }
body .erp-sidebar-foot { font-size:12px; }
@media(min-width:1001px) {
 body.product-experience-v9 .layout,body[data-product-experience="premium-v1"] .app-shell,.erp-layout { grid-template-columns:232px minmax(0,1fr)!important; }
 body :is(.sidebar,.erp-sidebar) { width:232px!important; padding:20px 14px!important; }
 body :is(.content,.erp-content) { padding:24px 28px 48px!important; }
 body .catalog-table { table-layout:auto!important; min-width:1050px!important; }
 body .catalog-table td:nth-child(2) { width:110px!important; max-width:130px!important; }
 body .catalog-table td:nth-child(3) { min-width:230px; }
 body .catalog-table td:is([data-label="分类"],[data-label="商品归属"]) { min-width:96px; }
 body .catalog-table td[data-label="规格 / 单位"] { min-width:125px; }
 body .catalog-table td[data-label="操作"] { min-width:165px; }
}
@media(max-width:1000px) {
 body :is(.content,.erp-content) { padding:20px 16px 40px!important; }
 body :is(.topbar h1,.erp-page-head h1) { font-size:23px!important; }
 body .catalog-table td:is([data-label="分类"],[data-label="商品归属"],[data-label="状态"]) { white-space:normal!important; }
 body .cost-card-grid { grid-template-columns:repeat(2,minmax(0,1fr))!important; }
}
@media(max-width:760px) {
 body .erp-sidebar { position:relative; height:auto; }
 body .erp-nav-link:not([data-mobile-primary]) { display:flex; }
 body .erp-nav { overflow-x:auto; }
 body .product-workspace-switch { margin:4px 0 8px; }
 body .product-workspace-switch nav { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body :is(.topbar,.erp-topbar) { padding:12px 16px!important; gap:10px!important; }
 body :is(.topbar h1,.erp-page-head h1) { font-size:22px!important; }
 body :is(.button,.row-button,.nav-item,.nav-subitem,.erp-nav-link) { min-height:40px; }
 body :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]) { font-size:max(16px, var(--inventory-text-control, 16px))!important; }
 body .birthday-fold-image-button,body .birthday-fold-row .product-image-carousel { width:64px!important; height:64px!important; min-width:64px!important; }
 body .birthday-fold-card { gap:10px!important; }
 body .birthday-fold-toggle strong { font-size:16px!important; }
 body .birthday-fold-metric b { font-size:18px!important; }
 body .cost-card-metric { min-width:0; padding:12px!important; }
 body .cost-card-metric > strong { font-size:22px!important; }
 body .selected-product-chips { max-height:120px; }
 body :is(.modal,.dialog) { max-width:calc(100vw - 20px)!important; }
 body :is(.modal-body,.dialog-body) { min-width:0; overflow-x:auto; }
 body .erp-page-actions { width:100%; }
 body .erp-page-actions .button { flex:1; }
 body .inventory-list-filters { gap:10px; }
}
/* Embedded intake: content defines row heights, never overlapping fixed grid slots. */
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience { overflow:auto!important; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience :is(.app,.page,.intake-main,main) { height:auto!important; overflow:visible!important; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm { height:auto!important; min-height:0!important; overflow:visible!important; grid-template-columns: minmax(0,1fr) minmax(0,1.5fr)!important; grid-template-rows:auto!important; align-items:start!important; gap:16px!important; padding-bottom:88px; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm > :is(.form-card,.advanced-card) { grid-column:auto!important; grid-row:auto!important; height:auto!important; max-height:none!important; min-height:0!important; overflow:visible!important; padding:18px!important; position:static!important; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm > .form-card:nth-of-type(2) { grid-column:2!important; grid-row:1 / span 3!important; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm > .advanced-card { grid-column:1/-1!important; }
html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience .layer-description-field textarea { min-height:140px!important; }
@media(max-width:760px) {
 html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm { display:flex!important; flex-direction:column; }
 html[data-mode="desktop"][data-entry-context="embedded"] body.product-intake-experience #recipeForm > * { width:100%; }
}
body.product-technology-v2[data-product-experience="premium-v1"] .topbar::before { display:none!important; }
body[data-product-experience="premium-v1"] .search-box { position:relative!important; display:block!important; min-height:40px!important; padding:0!important; }
body[data-product-experience="premium-v1"] .search-box > svg { position:absolute!important; left:13px!important; top:50%!important; transform:translateY(-50%); width:18px; height:18px; pointer-events:none; }
body[data-product-experience="premium-v1"] .search-box input { width:100%!important; min-height:40px!important; padding-left:40px!important; margin:0!important; }
body.product-intake-experience .section-heading h2 { font-size:17px!important; }
body.product-intake-experience :is(.field > span,.field-label,.field label) { font-size:13px!important; line-height:1.5!important; }
body.product-intake-experience :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]) { font-size:14px!important; }
body.product-intake-experience :is(.section-heading p,.field-hint,.chip-grid span,.size-row span) { font-size:12px!important; }
@media(max-width:760px) { body.product-intake-experience :is(input,select,textarea):not([type=checkbox]):not([type=radio]):not([type=file]) { font-size:16px!important; } }
body.product-experience-v9 .topbar::before { display:none!important; }
body.product-experience-v9 .collection-filters[aria-label="标准商品库筛选"] { display:grid!important; grid-template-columns:minmax(240px,2fr) minmax(150px,1fr) auto!important; gap:12px!important; }
.catalog-advanced-filters { grid-column:1/-1; grid-row:2; }
.catalog-advanced-filters > summary { cursor:pointer; color:#526174; min-height:36px; padding:6px 0; font-size:13px; }
.catalog-advanced-filters > div { display:grid; grid-template-columns:repeat(5,minmax(120px,1fr)); gap:12px; padding-top:8px; }
body .supply-offer-subsection { gap:10px!important; }
body .supply-offer-subsection > strong { flex-shrink:0; min-width:7em; }
@media(max-width:760px) {
 body.product-experience-v9 .brand { min-height:44px!important; margin:0 0 4px!important; padding:4px!important; }
 body.product-experience-v9 .sidebar { padding:8px 12px!important; }
 body.product-experience-v9 .brand-mark { width:30px!important; height:30px!important; flex-basis:30px!important; }
 body.product-experience-v9 .collection-filters[aria-label="标准商品库筛选"] { grid-template-columns:minmax(0,1fr)!important; }
 .catalog-advanced-filters { grid-row:auto; }
 .catalog-advanced-filters > div { grid-template-columns:repeat(2,minmax(0,1fr)); }
 body .supply-offer-subsection { flex-direction:column!important; align-items:flex-start!important; }
 body .supply-offer-subsection > strong { width:auto!important; }
}

body.product-technology-v2[data-product-workspace="cost"] #recipesView.view .table-toolbar.mobile-filter-toolbar .filter-row .search-box svg { position:absolute!important; left:13px!important; top:50%!important; transform:translateY(-50%)!important; }

/* Dialog headers and footers must not shrink into their own content. */
body .modal-backdrop { z-index:2000!important; }
body .modal-backdrop .modal-header, body .modal-backdrop .modal-footer { flex:0 0 auto!important; height:auto!important; max-height:none!important; }
body .modal-backdrop .modal-header h2 { overflow-wrap:anywhere; line-height:1.4!important; }
body .modal-backdrop .modal-body { min-height:0!important; overscroll-behavior:contain; }
body .sa-formula-preview { display:block; overflow-wrap:anywhere; white-space:pre-wrap; font-size:12px; line-height:1.6; color:#526174; margin-top:6px; }
@media(max-width:760px) {
 body .modal-backdrop { padding:10px!important; align-items:center!important; }
 body .modal-backdrop > .modal { margin:0!important; max-height:calc(100dvh - 20px)!important; width:100%!important; }
 body .modal-backdrop .modal-header { padding:14px 16px!important; gap:12px!important; align-items:flex-start!important; }
 body .modal-backdrop .modal-header > div { min-width:0; }
 body .modal-backdrop .modal-header h2 { font-size:18px!important; margin:0 0 6px!important; }
 body .modal-backdrop .modal-header p { font-size:12px!important; line-height:1.5!important; }
 body .modal-backdrop .modal-footer { padding:12px 16px max(12px,env(safe-area-inset-bottom))!important; flex-wrap:wrap!important; gap:10px!important; }
 body .modal-backdrop .modal-footer > div { display:flex; flex-wrap:wrap; gap:8px; min-width:0; }
 body .modal-backdrop .modal-footer button { min-height:44px!important; white-space:normal!important; line-height:1.4!important; }
 body #supplyArchiveModal .sa-heading { align-items:flex-start; flex-wrap:wrap; }
 body #supplyArchiveModal .sa-unit-actions { max-width:100%; justify-content:flex-start; }
 body #supplyArchiveModal .sa-unit-grid .sa-price { grid-column:1/-1; grid-row:auto; }
 body #supplyArchiveModal .sa-unit-grid .sa-price-cost { grid-row:2; }
 body #supplyArchiveModal .sa-unit-grid .sa-price-sale { grid-row:3; }
 body #supplyArchiveModal .sa-price > button { min-height:44px; width:100%; margin-top:8px; }
 body #supplyArchiveModal .sa-fx { width:44px; min-width:44px; height:44px; }
 body #supplyArchiveModal .sa-formula-actions { display:flex; flex-wrap:wrap; gap:8px; }
 body #costDetailModal[aria-hidden="false"] .table-container::before { content:"左右滑动查看完整明细"; display:block; position:sticky; left:0; width:max-content; max-width:100%; padding:8px 0; color:#526174; font-size:12px; }
 body #costDetailModal .cost-card-metric > strong { font-size:22px!important; overflow-wrap:anywhere; }
}

@media(max-width:760px) {
 body #costDetailModal .modal-footer { display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); }
 body #costDetailModal .modal-footer > :is(span,p), body #costDetailModal .modal-footer > button:last-child { grid-column:1/-1; }
 body #costDetailModal .modal-footer > button { width:100%!important; min-width:0!important; font-size:13px!important; padding:10px 8px!important; }
}
@media(max-width:760px) {
 body #costDetailModal .modal-footer > div { grid-column:1/-1; display:grid!important; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
 body #costDetailModal .modal-footer > div > button { min-width:0!important; width:100%!important; font-size:13px!important; padding:10px 8px!important; }
 body #costDetailModal .modal-footer > div > button:last-child { grid-column:1/-1; }
}

/* Loading is distinct from empty data; progress does not block navigation. */
.workspace-load-status { margin:12px 0; padding:12px 16px; border:1px solid #d9e2f5; border-radius:10px; background:#f0f5ff; color:#28466f; display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; }
.workspace-load-status[hidden], .issue-scan-progress[hidden] { display:none!important; }
.issue-scan-progress { flex-basis:100%; margin:0; font-size:12px; color:#526174; }
@media(max-width:760px) {
 body .erp-topbar { min-height:40px!important; padding:6px 12px!important; }
 body .erp-page-head { gap:10px!important; margin-bottom:14px!important; }
 body .erp-page-head h1 { margin:0!important; }
 body .erp-page-head p { margin:4px 0 0!important; font-size:var(--inventory-text-small, 14px); }
 body .metrics { gap:8px!important; margin:12px 0!important; }
 body .metrics article { padding:10px 12px!important; min-height:0!important; }
 body .metrics article strong { font-size:1.5rem; margin:2px 0!important; }
 body .metrics article small { font-size:var(--inventory-text-small, 14px); line-height:1.6; }
 body .panel-head { gap:10px!important; }
 body .panel-head :is(.head-actions,.panel-actions) { display:flex; flex-wrap:wrap; gap:8px; }
 body .panel-head :is(.head-actions,.panel-actions) > button { flex:1 1 auto; min-height:44px; }
 body .inventory-list-filters { gap:8px; }
 body[data-inventory-module=transfers] .erp-page-actions { position:static; width:100%; padding:0; background:transparent; border:0; box-shadow:none; }
 body[data-inventory-module=transfers] .erp-page-actions button { width:100%; min-height:44px; }
 body[data-inventory-module=transfers] main { padding-bottom:40px!important; }
 body .workspace-load-status { font-size:13px; padding:10px 12px; }
}

/* Inventory reading tokens take precedence over legacy 14px shell defaults. */
body.erp-product-page { font-size:var(--inventory-text-body, 16px); line-height:1.6; }
body.erp-product-page :is(.panel-head h2, .section-heading h2) { font-size:1.375rem; line-height:1.4; }
body.erp-product-page .erp-page-head h1 { font-size:1.75rem!important; line-height:1.35!important; }
body.erp-product-page :is(.erp-page-head p, .erp-sidebar-foot) { font-size:var(--inventory-text-small, 14px); }
body.erp-product-page .metrics article small { color:var(--muted, #526174); }
body.erp-product-page .product-workspace-switch :is(summary, a) { font-size:var(--inventory-text-small, 14px); min-height:44px; }
@media(max-width:760px) { body.erp-product-page :is(.button, .row-button, .erp-nav-link) { min-height:44px; } }
