/* Loaded last so the saved appearance consistently wins on every module. */
:root {
  --appearance-font-scale: 1;
  --appearance-space-scale: 1;
  --appearance-control-height: 36px;
  --appearance-row-y: 11px;
  --appearance-card-gap: 14px;
}

html[data-density="1"] {
  --appearance-space-scale: .78;
  --appearance-control-height: 32px;
  --appearance-row-y: 7px;
  --appearance-card-gap: 9px;
}

html[data-density="2"] {
  --appearance-space-scale: 1;
  --appearance-control-height: 38px;
  --appearance-row-y: 12px;
  --appearance-card-gap: 14px;
}

/* Most legacy modules use fixed pixels. These rules make the display settings
   authoritative without scaling the entire canvas or breaking widths. */
html body {
  font-size: calc(14px * var(--appearance-font-scale)) !important;
}

html body :is(button, input, select, textarea, label, legend, summary) {
  font-size: calc(12px * var(--appearance-font-scale)) !important;
}

html body :is(p, td, li, dt, dd) {
  font-size: calc(12px * var(--appearance-font-scale)) !important;
}

html body :is(th, small, time, code, output) {
  font-size: calc(10px * var(--appearance-font-scale)) !important;
}

html body :is(h1, .page-title, .bc-head h1, .ops-head h1, .mgmt-head h1, .asset-topbar h1) {
  font-size: calc(26px * var(--appearance-font-scale)) !important;
}

html body :is(h2, .card-heading h2, .bc-card h2, .asset-list-head h2) {
  font-size: calc(16px * var(--appearance-font-scale)) !important;
}

html body h3 {
  font-size: calc(14px * var(--appearance-font-scale)) !important;
}

html body :is(
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]),
  select, textarea, button, .bc-primary, .bc-secondary, .mgmt-button,
  .ops-primary, .ops-secondary
) {
  min-height: var(--appearance-control-height) !important;
}

html body :is(
  table th, table td, .mgmt-table th, .mgmt-table td,
  .bc-table-wrap th, .bc-table-wrap td
) {
  padding-top: var(--appearance-row-y) !important;
  padding-bottom: var(--appearance-row-y) !important;
}

html body :is(
  .kol-workbench, .influencer-page-v2, .product-admin-page,
  .product-fetch-center, .materials-workbench, .shipping-saas-page,
  .settlement-center, .pt-page, .mr-full, .data-quality-page,
  .import-record-page, .backup-page, .ct-page, .mgmt-page, .ops-page, .bc-page
) {
  gap: var(--appearance-card-gap) !important;
}

html[data-density="1"] body :is(
  .mgmt-card, .ops-card, .faith-card, .bc-card, .kol-card,
  .asset-section-card, .asset-overview-card, .kpi-card, .stitch-card
) {
  border-radius: 6px !important;
}

html[data-density="1"] body :is(
  .bc-kpis article, .api-kpis article, .kol-kpi-card, .kpi-card,
  .faith-kpis article, .asset-focus-card
) {
  min-height: 76px !important;
  padding: 10px 12px !important;
}

html[data-density="1"] body :is(
  .bc-card-head, .card-heading, .asset-list-head, .asset-section-title
) {
  min-height: 42px !important;
  padding-top: 7px !important;
  padding-bottom: 7px !important;
}

html[data-density="1"] body :is(
  .outreach-row, .asset-influencer-row, .feature-list article,
  .scheduled-job-list article
) {
  min-height: 0 !important;
  padding-top: 8px !important;
  padding-bottom: 8px !important;
}

html[data-density="2"] body :is(
  .bc-kpis article, .api-kpis article, .kol-kpi-card, .kpi-card,
  .faith-kpis article, .asset-focus-card
) {
  padding-top: 16px !important;
  padding-bottom: 16px !important;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
  background: #0f1623 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  .app-shell, .page, #main-content, .stitch-main, .stitch-shell,
  .ops-page, .mgmt-page, .admin-v25, .settings-grid, .kol-page-shell,
  .collaboration-page, .dashboard-page, .content-wrap, .main-content,
  .bc-page, .influencer-page-v2
) {
  background-color: #0f1623 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  .faith-card, .ops-card, .mgmt-card, .kol-card, .panel, .card,
  .dashboard-block, .stitch-card, .table-card, .save-bar,
  .detail-drawer, .kpi-card, .kol-kpi-card, .bc-card,
  .bc-kpis article, .asset-section-card, .asset-overview-card
) {
  background-color: #172033 !important;
  border-color: #334155 !important;
  color: #eef2f7 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] :is(
  h1, h2, h3, h4, strong, b, label, legend, output,
  .page-title, .card-heading h2, .ops-head h1, .reference-head h1
) {
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  p, small, .page-eyebrow, .breadcrumb, .cell-sub,
  .faith-card > p, .ops-head p, .reference-head p
) {
  color: #aab5c5 !important;
}

html[data-theme="dark"] :is(input, select, textarea, button.ops-secondary) {
  background-color: #111a29 !important;
  border-color: #435168 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] .appearance-reference .visual-themes span {
  background: #111a29 !important;
  border-color: #526078 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] .appearance-reference .visual-themes input:checked + span {
  background: #18345d !important;
  border-color: var(--op-blue, #6f98ff) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--op-blue, #6f98ff) 30%, transparent) !important;
}

html[data-theme="dark"] .appearance-reference .nav-choice {
  background: #111a29 !important;
  border-color: #435168 !important;
}

html[data-theme="dark"] .appearance-reference .nav-choice.active {
  background: #18345d !important;
  border-color: var(--op-blue, #6f98ff) !important;
}

html[data-theme="dark"] table th {
  background: #111a29 !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] table td {
  background: #172033 !important;
  border-color: #334155 !important;
  color: #d8e0ea !important;
}

html[data-theme="dark"] a:not(.side-nav a):not(.mgmt-button):not(.ops-primary) {
  color: #8eb0ff;
}

/* Business centers: every light surface must switch together with its text. */
html[data-theme="dark"] .bc-page {
  background: #0f1623 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  .bc-filter, .bc-kpis article, .bc-card, .email-connection-bar,
  .email-connection-bar.ready, .template-list article, .timeline > div,
  .outreach-row details, .review-actions details, .recipient-picker,
  .new-recipient-row, .batch-recipient-entry, .existing-recipient-entry,
  .recipient-import-box, .send-timing, .recipient-file-button,
  .outreach-trend-metrics a, .outreach-trend-dialog,
  .outreach-trend-dialog-summary, .outreach-trend-dialog-summary div
) {
  background: #172033 !important;
  border-color: #334155 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  .bc-head h1, .bc-card h2, .bc-card b, .bc-card strong,
  .bc-kpis strong, .outreach-person b, .new-recipient-head b,
  .template-list b, .template-list strong
) {
  color: #eef2f7 !important;
}

html[data-theme="dark"] :is(
  .bc-head p, .bc-eyebrow, .bc-card p, .bc-card span, .bc-card small,
  .bc-kpis span, .bc-kpis small, .email-connection-bar span,
  .new-recipient-head small, .template-list span, .template-list p,
  .timeline time, .timeline small, .recipient-import-box small
) {
  color: #aab5c5 !important;
}

html[data-theme="dark"] .bc-page :is(input, select, textarea) {
  background: #111a29 !important;
  border-color: #526078 !important;
  color: #eef2f7 !important;
}

html[data-theme="dark"] .bc-page :is(input, textarea)::placeholder {
  color: #78869b !important;
}

html[data-theme="dark"] .bc-secondary {
  background: #172033 !important;
  border-color: #526078 !important;
  color: #9db7ff !important;
}

html[data-theme="dark"] .bc-primary {
  background: var(--op-blue, #2563eb) !important;
  border-color: var(--op-blue, #2563eb) !important;
  color: #fff !important;
}

html[data-theme="dark"] .recipient-count,
html[data-theme="dark"] .outreach-kpi-drawer .kpi-detail-toolbar {
  background: #111a29 !important;
  color: #cbd5e1 !important;
}

/* Influencer library rows and filters. */
html[data-theme="dark"] :is(
  .influencer-page-v2 .asset-filter-panel,
  .influencer-page-v2 .asset-influencer-row,
  .influencer-page-v2 .asset-pool-card,
  .influencer-page-v2 .asset-focus-card,
  .influencer-page-v2 .asset-view-table,
  .influencer-page-v2 .asset-list-wrap,
  .influencer-page-v2 .asset-card-list
) {
  background: #172033 !important;
  border-color: #334155 !important;
  color: #eef2f7 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-influencer-row {
  border-bottom-color: #334155 !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-col {
  background: transparent !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .influencer-page-v2 :is(
  .asset-influencer-row strong, .asset-influencer-row b,
  .asset-col.profile strong, .asset-pool-card h3
) {
  color: #eef2f7 !important;
}

html[data-theme="dark"] .influencer-page-v2 :is(
  .asset-influencer-row span, .asset-influencer-row small,
  .asset-col.profile p, .asset-pool-card p
) {
  color: #9eabc0 !important;
}

html[data-theme="dark"] .influencer-page-v2 :is(
  .asset-filter-panel input, .asset-filter-panel select,
  .asset-more-filter summary
) {
  background: #111a29 !important;
  border-color: #526078 !important;
  color: #eef2f7 !important;
}

/* Dark-mode detail polish: readable hierarchy and reliable controls. */
html[data-theme="dark"] .bc-page :is(label, legend) {
  color: #cbd5e1 !important;
}

html[data-theme="dark"] .bc-page :is(input, select, textarea):focus {
  border-color: #6f98ff !important;
  box-shadow: 0 0 0 3px rgba(111, 152, 255, .16) !important;
  outline: none !important;
}

html[data-theme="dark"] .bc-page :is(input[type="checkbox"], input[type="radio"]) {
  accent-color: var(--op-blue, #6f98ff);
  background: #111a29 !important;
  border-color: #718096 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] .bc-card > h2,
html[data-theme="dark"] .bc-form-card > h2,
html[data-theme="dark"] .bc-card-head,
html[data-theme="dark"] .template-library-head {
  background: #192438 !important;
  border-color: #334155 !important;
}

html[data-theme="dark"] .outreach-compose-grid > .bc-card {
  box-shadow: 0 1px 0 rgba(255,255,255,.025), 0 10px 30px rgba(0,0,0,.12) !important;
}

html[data-theme="dark"] .bc-kpis article {
  background: linear-gradient(145deg, #192438, #172033) !important;
}

html[data-theme="dark"] .bc-kpis article:hover,
html[data-theme="dark"] .outreach-kpis article:focus-visible {
  border-color: #5874a5 !important;
  box-shadow: 0 8px 22px rgba(0,0,0,.18) !important;
}

html[data-theme="dark"] :is(.batch-recipient-entry, .existing-recipient-entry) > summary,
html[data-theme="dark"] .outreach-row summary {
  color: #9db7ff !important;
}

html[data-theme="dark"] :is(.batch-recipient-entry, .existing-recipient-entry)[open] > summary,
html[data-theme="dark"] .outreach-row details[open] > summary {
  background: #1c2940 !important;
  border-bottom: 1px solid #334155 !important;
}

html[data-theme="dark"] .recipient-import-box {
  background: #15243b !important;
  border-color: #5874a5 !important;
}

html[data-theme="dark"] .new-recipient-row {
  background: #111a29 !important;
}

html[data-theme="dark"] .recipient-remove {
  color: #8391a6 !important;
}

html[data-theme="dark"] .recipient-remove:hover {
  color: #ff7b72 !important;
}

html[data-theme="dark"] .email-connection-bar.ready {
  background: #122b28 !important;
  border-color: #28685a !important;
}

html[data-theme="dark"] .email-connection-bar:not(.ready) {
  background: #302817 !important;
  border-color: #80672b !important;
}

html[data-theme="dark"] .bc-status.ok {
  background: #12372c !important;
  color: #70e1ad !important;
}

html[data-theme="dark"] .bc-status.warn {
  background: #3a2b16 !important;
  color: #ffc56d !important;
}

html[data-theme="dark"] .reply-chip {
  background: #2d2450 !important;
  color: #c4b5fd !important;
}

html[data-theme="dark"] .asset-card-list .state-pill,
html[data-theme="dark"] .influencer-page-v2 .state-pill {
  border-color: transparent !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-influencer-row:hover {
  background: #1c2940 !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-row-actions a {
  background: #245fd9 !important;
  color: #fff !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-row-actions a:hover {
  background: #3974eb !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-tabs {
  border-color: #334155 !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-tabs a {
  color: #aab5c5 !important;
}

html[data-theme="dark"] .influencer-page-v2 .asset-tabs a.active {
  background: #1d3264 !important;
  color: #a9c1ff !important;
}

html[data-theme="dark"] ::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

html[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #111a29;
}

html[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #435168;
  border: 2px solid #111a29;
  border-radius: 999px;
}

/* Dark mode completion layer: all application modules share the same surfaces. */
html[data-theme="dark"] {
  --ui-bg: #0b1220;
  --ui-card: #131d2e;
  --ui-text: #edf2f8;
  --ui-muted: #a3afc0;
  --ui-subtle: #7f8da3;
  --ui-line: #2d3a4f;
  --ui-line-strong: #435168;
  --ui-primary-soft: #18345d;
  color-scheme: dark;
}

html[data-theme="dark"] body :is(.sidebar, #global-sidebar, .stitch-sidebar, .side-user) {
  background: #101a2a !important;
  border-color: #2d3a4f !important;
  color: #cbd5e1 !important;
}

html[data-theme="dark"] body :is(.app-topbar, #global-topbar, .stitch-topbar, .topbar) {
  background: #101a2a !important;
  border-color: #2d3a4f !important;
  color: #edf2f8 !important;
}

html[data-theme="dark"] body :is(.brand-copy strong, .side-user, .app-account b, .account-copy b) {
  color: #edf2f8 !important;
}

html[data-theme="dark"] body :is(.side-nav a, .nav-placeholder, .account-copy small, .app-account small) {
  color: #a3afc0 !important;
}

html[data-theme="dark"] body .side-nav a:hover {
  background: #1a2940 !important;
  color: #a9c1ff !important;
}

html[data-theme="dark"] body :is(.app-search, .account-menu-panel, .create-menu-panel, .unified-row-more > div) {
  background: #131d2e !important;
  border-color: #344258 !important;
  color: #edf2f8 !important;
}

html[data-theme="dark"] body :is(
  .product-admin-page, .product-fetch-center, .materials-workbench,
  .shipping-saas-page, .settlement-center, .pt-page, .mr-full,
  .data-quality-page, .import-record-page, .backup-page, .ct-page,
  .calendar-page, .team-page, .accounts-page, .dashboard-page,
  .kol-workbench, .asset-page, .influencer-detail-page
) {
  background: #0b1220 !important;
  color: #edf2f8 !important;
}

html[data-theme="dark"] body :is(
  .pa-list-card, .pa-detail-panel, .pa-card, .pa-product-row,
  .asset-filter-panel, .asset-main, .asset-card, .asset-table-wrap,
  .ship-panel, .ship-card, .shipment-kpi, .settle-card, .settle-kpi,
  .settle-list-shell, .pt-card, .pt-health, .pt-stat, .pt-stats-visual,
  .mrf-card, .mrf-kpis article, .quality-overview article,
  .import-summary-grid article, .backup-card, .ct-card, .calendar-card,
  .team-card, .account-card, .product-picker-results, .product-picker-selection,
  .import-workflow-card, .preview-panel, .edit-form, .data-table,
  .detail-panel, .summary-card, .filter-panel
) {
  background: #131d2e !important;
  border-color: #2d3a4f !important;
  color: #edf2f8 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body :is(
  .pa-product-row:hover, .pa-product-row.active, tbody tr:hover td,
  .pt-priority-list a:hover, .main-style-list article:hover
) {
  background: #19263a !important;
}

html[data-theme="dark"] body :is(
  input, select, textarea, .unified-filter-bar, .active-filter-chips,
  .pa-toolbar, .pt-filter, .filter-bar, .toolbar, .search-field
) {
  background-color: #0f1827 !important;
  border-color: #435168 !important;
  color: #edf2f8 !important;
}

html[data-theme="dark"] body :is(input, textarea)::placeholder {
  color: #738198 !important;
}

html[data-theme="dark"] body :is(dialog, .mgmt-dialog, .ship-return-dialog, .outreach-trend-dialog) {
  background: #131d2e !important;
  border-color: #435168 !important;
  color: #edf2f8 !important;
}

html[data-theme="dark"] body dialog::backdrop {
  background: rgba(2, 6, 15, .72) !important;
}

html[data-theme="dark"] body :is(.empty-state, .empty-cell, .mgmt-empty, .pa-detail-empty) {
  color: #8e9bb0 !important;
}

html[data-theme="dark"] body :is(.pt-progress, .pt-overview-track, progress) {
  background: #26354b !important;
}

html[data-theme="dark"] body img {
  filter: brightness(.92) contrast(1.02);
}

/* Large font settings stay usable: tables scroll instead of crushing columns. */
html[style*="--appearance-font-scale: 1.2"] body :is(
  .table-wrap, .reference-table-scroll, .pt-table-scroll, .mgmt-table-wrap,
  .asset-table-wrap, .pa-table-wrap, .ship-table-wrap, .settle-list-main
) {
  overflow-x: auto !important;
}

/* Business rules use a larger ERP settings scale for legibility. */
.jst-rules-page .page-eyebrow{font-size:11px!important}.jst-rules-page .jst-settings-menu button{font-size:13px!important}.jst-rules-page .jst-settings-pane h2{font-size:19px!important}.jst-rules-page .jst-setting-row>div>b{font-size:14px!important}.jst-rules-page .jst-setting-row>div>small,.jst-rules-page .jst-number>span{font-size:11px!important}.jst-rules-page .jst-switch span{font-size:12px!important}.jst-rules-page button{font-size:13px!important}.jst-rules-page .jst-number input{font-size:15px!important}

html body :is(.table-wrap, .reference-table-scroll, .pt-table-scroll, .mgmt-table-wrap) table {
  width: 100%;
}

/* Verified page-by-page dark overrides. Legacy page bundles contain highly
   specific white surfaces, so keep this layer at the end of the cascade. */
html[data-theme="dark"] body main#main-content :is(input, select, textarea) {
  background-color: #0f1827 !important;
  border-color: #435168 !important;
  color: #edf2f8 !important;
}

/* Global file picker: consistent upload control across every business module. */
body main#main-content input[type="file"] {
  box-sizing: border-box;
  width: 100%;
  min-height: 42px;
  padding: 4px 7px 4px 5px;
  color: #667085;
  background: #f8fafc;
  border: 1px solid #cfd9e7;
  border-radius: 8px;
  cursor: pointer;
  font: 12px/32px Inter, "Microsoft YaHei", sans-serif;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

body main#main-content input[type="file"]::file-selector-button {
  height: 32px;
  margin-right: 10px;
  padding: 0 13px 0 34px;
  color: #1558d6;
  background-color: #eaf2ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%231558d6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 12px center;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font: 700 12px/32px Inter, "Microsoft YaHei", sans-serif;
  transition: color .15s, background-color .15s;
}

body main#main-content input[type="file"]:hover {
  border-color: #8eb2f2;
  background: #f4f8ff;
}

body main#main-content input[type="file"]:hover::file-selector-button {
  color: #fff;
  background-color: #2563eb;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4'/%3E%3Cpolyline points='17 8 12 3 7 8'/%3E%3Cline x1='12' y1='3' x2='12' y2='15'/%3E%3C/svg%3E");
}

body main#main-content input[type="file"]:focus-visible {
  outline: 0;
  border-color: #528bff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

html[data-theme="dark"] body main#main-content input[type="file"] {
  color: #b8c3d3;
  background: #111c2c !important;
  border-color: #435168 !important;
}

html[data-theme="dark"] body main#main-content input[type="file"]::file-selector-button {
  color: #b9d3ff;
  background-color: #1d3150;
}

/* Shared filter-bar rhythm applied to the material library. */
body:has(.materials-workbench) .material-filter-card {
  display: grid !important;
  gap: 12px !important;
  padding: 14px 16px !important;
}

body:has(.materials-workbench) .material-filter-card .filter-grid {
  display: grid !important;
  align-items: end !important;
  gap: 12px !important;
  width: 100%;
}

body:has(.materials-workbench) .material-filter-card .first-row {
  grid-template-columns: minmax(210px, 1.35fr) minmax(170px, 1fr) minmax(170px, 1fr) minmax(140px, .8fr) minmax(140px, .8fr) !important;
}

body:has(.materials-workbench) .material-filter-card .second-row {
  grid-template-columns: repeat(4, minmax(130px, .78fr)) minmax(155px, .92fr) minmax(155px, .92fr) 144px !important;
}

body:has(.materials-workbench) .material-filter-card label {
  display: grid !important;
  grid-template-rows: 18px 38px !important;
  gap: 5px !important;
  min-width: 0;
  margin: 0 !important;
  color: #475467 !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  line-height: 18px !important;
}

body:has(.materials-workbench) .material-filter-card :is(input, select) {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  height: 38px !important;
  margin: 0 !important;
  border-radius: 7px !important;
  font-size: 13px !important;
}

body:has(.materials-workbench) .material-filter-card .filter-buttons {
  display: grid !important;
  grid-template-columns: 58px 78px !important;
  align-items: end !important;
  gap: 8px !important;
  height: 38px;
}

body:has(.materials-workbench) .material-filter-card .filter-buttons :is(a, button) {
  box-sizing: border-box !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 100% !important;
  height: 38px !important;
  min-height: 38px !important;
  margin: 0 !important;
  padding: 0 10px !important;
  border-radius: 7px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
}

@media (max-width: 1180px) {
  body:has(.materials-workbench) .material-filter-card :is(.first-row, .second-row) {
    grid-template-columns: repeat(2, minmax(180px, 1fr)) !important;
  }
}

html[data-theme="dark"] body main#main-content :is(
  .stitch-scroll, .dashboard-date-custom-fields, .dashboard-date-current,
  .trend-console-period, .trend-filter-form, .trend-summary-item,
  .plan-item, .month-execution-item, .alert-box, .risk,
  .calendar-overview, .calendar-overview article, .calendar-type-summary,
  .calendar-upcoming, .calendar-day,
  .kol-kpi-grid, .kol-tabs, .bulk-action-bar, .kol-table-scroll,
  .kol-pager, .collaboration-monthly-trend,
  .asset-top-page-size, .asset-filter-more-grid,
  .pt-health-progress, .pt-overview-bar, .pt-period-card,
  .pt-matrix-head, .pt-main-style-list article,
  .ship-metric, .ship-mini-pager, .ship-detail-drawer, .ship-drawer-btn,
  .settle-month-picker, .flow-stage, .settle-risk-list a, .bulk-bar,
  .pa-pagination, .pa-baby-detail, .pa-baby-detail > div,
  .pf-process, .pf-process article, .pf-stat-grid article, .pf-entry-btn,
  .materials-titlebar, .materials-kpis article, .materials-shortcuts a,
  .material-card, .materials-pager, .pending-panel, .product-gap-card,
  .mrf-next, .mrf-chart, .mrf-funnel, .mrf-mode-bars, .mrf-cost-bars,
  .mrf-risk-list a, .mrf-action-grid article,
  .import-form, .import-upload-zone,
  .quality-tabs, .info
) {
  background: #131d2e !important;
  border-color: #2d3a4f !important;
  color: #edf2f8 !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body main#main-content :is(
  .kol-table-scroll th, .pt-matrix-head, .pa-baby-detail > div,
  .effect-row, .pf-entry-info p
) {
  background: #182438 !important;
  border-color: #344258 !important;
}

html[data-theme="dark"] body main#main-content :is(
  .metrics-toggle, .asset-light-btn, .bc-secondary, .mgmt-button.secondary,
  .mgmt-button.danger, .pa-filter-panel button:not(.primary),
  .materials-secondary, .ship-drawer-btn
) {
  background: #182438 !important;
  border-color: #435168 !important;
  color: #dbe6f5 !important;
}

html[data-theme="dark"] body main#main-content :is(
  .calendar-day.outside, .state-pill.muted, .active-filter-chips,
  .settlement-data-row.selected
) {
  background: #101a2a !important;
  color: #aab6c8 !important;
}

html[data-theme="dark"] body main#main-content :is(
  .pt-overview-bar.risk, .alert-heading, td.name-cell, td.op-cell
) {
  background: #2a211b !important;
  border-color: #574333 !important;
}

/* Unified chart language: continuous lines/areas without decorative dot rows. */
body :is(.token-chart,.trend-chart,.outreach-trend-chart,.kpi-detail-chart,.collaboration-monthly-trend,.pt-trend-sample,.settle-daily-trend,.settle-trend-chart,.mrf-chart) circle:not(.outreach-trend-hit){display:none!important}
body :is(.token-chart,.trend-chart,.outreach-trend-chart,.kpi-detail-chart,.collaboration-monthly-trend,.pt-trend-sample,.settle-daily-trend,.settle-trend-chart,.mrf-chart) polyline{stroke-linecap:round!important;stroke-linejoin:round!important}
.token-chart-empty-clean{align-items:center;display:flex!important;flex-direction:column;gap:7px;inset:0;justify-content:center;top:0!important;width:auto!important}.token-chart-empty-clean span{color:#667085;font-size:14px;font-weight:700}.token-chart-empty-clean small{color:#98a2b3;font-size:12px}

/* Monthly review dark-mode readability audit. */
html[data-theme="dark"] body:has(.mr-full),html[data-theme="dark"] body:has(.mr-full) .page,html[data-theme="dark"] .mr-full{background:#0b1220!important;color:#edf2f8!important}
html[data-theme="dark"] .mr-full :is(.mrf-head,.mrf-hero,.mrf-kpis article,.mrf-card,.mrf-next,.mrf-chart,.mrf-funnel,.mrf-rank,.mrf-risk-list a,.mrf-decision-list article,.mrf-mode-bars,.mrf-cost-bars){background:#131d2e!important;border-color:#2d3a4f!important;color:#edf2f8!important;box-shadow:none!important}
html[data-theme="dark"] .mr-full .mrf-conclusion{background:transparent!important;color:#edf2f8!important}
html[data-theme="dark"] .mr-full :is(h1,h2,h3,strong,.mrf-conclusion b,.mrf-funnel strong,.mrf-mode-bars strong,.mrf-cost-row strong,.mrf-mini-table td){color:#f1f5f9!important}
html[data-theme="dark"] .mr-full :is(p,li,.mrf-conclusion p,.mrf-next ol,.mrf-kpis em,.mrf-card-head span,.mrf-legend span,.mrf-funnel span,.mrf-mode-bars span,.mrf-cost-row span,.mrf-risk-list span,.mrf-rank span,.mrf-rank small){color:#b7c2d2!important}
html[data-theme="dark"] .mr-full :is(.mrf-kpis span,.mrf-actions label,.mrf-mini-table th,small,em){color:#94a3b8!important}
html[data-theme="dark"] .mr-full :is(.mrf-funnel b,.mrf-mode-bars b,.mrf-cost-row b){background:#28364b!important}
html[data-theme="dark"] .mr-full .mrf-mini-table th{background:#182438!important;border-color:#344258!important}
html[data-theme="dark"] .mr-full .mrf-mini-table td{background:#131d2e!important;border-color:#2d3a4f!important}
html[data-theme="dark"] .mr-full :is(.mrf-actions input,.mrf-actions a){background:#0f1827!important;border-color:#435168!important;color:#dbe6f5!important}

/* Full-site dark audit: neutralize legacy light table cells and large blocks. */
html[data-theme="dark"] body main#main-content :is(table,thead,tbody,tr,th,td){border-color:#2d3a4f!important;color:#dbe4f0!important}
html[data-theme="dark"] body main#main-content :is(table,tbody,tr,td){background-color:#131d2e!important}
html[data-theme="dark"] body main#main-content th{background-color:#182438!important;color:#aebbd0!important}
html[data-theme="dark"] body main#main-content tr:hover td{background-color:#19283d!important}
html[data-theme="dark"] body main#main-content tr.selected td,
html[data-theme="dark"] body main#main-content tr.active td{background-color:#1b3151!important}
html[data-theme="dark"] body main#main-content :is(td.name-cell,td.product-line-cell,td.op-cell.sticky-op,span.product-line-cell){background-color:#182438!important;color:#dbe4f0!important}

/* Collaboration product actions share one visual baseline. */
.data-table td.action-row.op-cell {
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 10px !important;
  min-height: 56px;
}
.data-table td.action-row.op-cell > form {
  align-items: center;
  display: inline-flex;
  margin: 0 !important;
}
.data-table td.action-row.op-cell > a,
.data-table td.action-row.op-cell > button,
.data-table td.action-row.op-cell > form > button {
  align-items: center;
  box-sizing: border-box;
  display: inline-flex;
  height: 30px;
  line-height: 30px !important;
  margin: 0 !important;
  padding-block: 0 !important;
  vertical-align: middle;
}

/* Jushuitan-style product replacement modal. */
.collaboration-product-swap-dialog {
  border: 0;
  border-radius: 12px;
  box-shadow: 0 24px 72px rgba(15, 23, 42, .22);
  margin: auto;
  max-height: min(620px, calc(100vh - 48px));
  overflow: visible;
  padding: 0;
  width: min(780px, calc(100vw - 48px));
}
.collaboration-product-swap-dialog::backdrop {
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(2px);
}
.collaboration-product-swap-dialog .collaboration-product-swap {
  border: 0 !important;
  border-radius: 12px !important;
  box-shadow: none !important;
  margin: 0;
  max-width: none;
  overflow: visible;
  width: 100%;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header {
  min-height: 60px;
  padding: 12px 18px;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header strong {
  color: #172033;
  font-size: 16px;
}
.collaboration-product-swap-dialog .collaboration-product-swap > .product-picker {
  padding: 14px 18px;
}
.collaboration-product-swap-dialog .product-picker-results {
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields {
  grid-template-columns: 130px minmax(240px, 1fr) !important;
  padding: 14px 18px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > footer {
  gap: 10px;
  padding: 12px 18px;
}
html[data-theme="dark"] .collaboration-product-swap-dialog,
html[data-theme="dark"] .collaboration-product-swap-dialog .collaboration-product-swap {
  background: #131d2e !important;
  color: #dbe4f0;
}
html[data-theme="dark"] .collaboration-product-swap-dialog .collaboration-product-swap > header strong {
  color: #f3f6fb;
}
@media (max-width: 700px) {
  .collaboration-product-swap-dialog { width: calc(100vw - 24px); }
  .collaboration-product-swap-dialog .collaboration-product-swap-fields { grid-template-columns: 1fr !important; }
}

.product-swap-popup-page {
  background: #f3f6fa;
  color: #172033;
  margin: 0;
  min-width: 720px;
  padding: 24px;
}
.product-swap-popup-shell {
  background: #fff;
  border: 1px solid #d8e0eb;
  border-radius: 10px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, .10);
  margin: 0 auto;
  max-width: 920px;
  overflow: visible;
}
.product-swap-popup-shell > header {
  align-items: center;
  border-bottom: 1px solid #e8edf4;
  display: flex;
  justify-content: space-between;
  padding: 18px 22px;
}
.product-swap-popup-shell > header h1 { font-size: 20px; margin: 0 0 5px; }
.product-swap-popup-shell > header p { color: #667085; font-size: 12px; margin: 0; }
.product-swap-popup-shell > header button { background: transparent; border: 0; color: #667085; font-size: 22px; height: 32px; padding: 0; width: 32px; }
.product-swap-popup-shell > .alert { margin: 16px 20px 0; }
.product-swap-popup-shell .collaboration-product-swap { border: 0 !important; box-shadow: none !important; margin: 0; max-width: none; }
.product-swap-popup-shell .collaboration-product-swap > .product-picker { border-bottom: 1px solid #edf1f5; padding: 20px 22px; }
.product-swap-popup-shell .product-picker-results { max-height: 330px; overflow-y: auto; z-index: 20; }
.product-swap-popup-shell .collaboration-product-swap-fields { grid-template-columns: 160px minmax(300px,1fr) !important; padding: 18px 22px !important; }
.product-swap-popup-shell .collaboration-product-swap > footer { gap: 10px; justify-content: flex-end; padding: 14px 22px; }

/* Compact swap component: clear search hierarchy and in-flow result list. */
.collaboration-product-swap-dialog .product-picker {
  display: grid;
  gap: 10px;
  position: relative;
}
.collaboration-product-swap-dialog .product-picker-search {
  color: #344054;
  display: grid !important;
  font-size: 12px;
  font-weight: 650;
  gap: 7px !important;
  margin: 0;
}
.collaboration-product-swap-dialog .product-picker-search::before { content: none !important; }
.collaboration-product-swap-dialog .product-picker-search input {
  background: #fff !important;
  border: 1px solid #b9c6d8 !important;
  border-radius: 7px !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04) !important;
  color: #172033 !important;
  font-size: 13px !important;
  height: 42px !important;
  line-height: 40px !important;
  outline: none;
  padding: 0 13px 0 38px !important;
  width: 100%;
}
.collaboration-product-swap-dialog .product-picker-search::after {
  color: #7b8a9d;
  content: "⌕";
  font-size: 20px;
  font-weight: 400;
  left: 12px;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  top: 31px;
}
.collaboration-product-swap-dialog .product-picker-search:focus-within input {
  border-color: #3478e5 !important;
  box-shadow: 0 0 0 3px rgba(52, 120, 229, .12) !important;
}
.collaboration-product-swap-dialog .product-picker-results {
  background: #fff !important;
  border: 1px solid #d8e0eb !important;
  border-radius: 8px !important;
  box-shadow: none !important;
  left: auto !important;
  margin: 0 !important;
  max-height: 250px !important;
  overflow-y: auto !important;
  padding: 4px !important;
  position: static !important;
  right: auto !important;
  top: auto !important;
}
.collaboration-product-swap-dialog .product-picker-result {
  border-bottom: 1px solid #edf1f5 !important;
  border-radius: 5px !important;
  gap: 11px !important;
  grid-template-columns: 46px minmax(0, 1fr) !important;
  min-height: 58px;
  padding: 7px 9px !important;
}
.collaboration-product-swap-dialog .product-picker-result:last-child { border-bottom: 0 !important; }
.collaboration-product-swap-dialog .product-picker-result-image { border-radius: 5px !important; height: 44px !important; width: 44px !important; }
.collaboration-product-swap-dialog .product-picker-result-copy strong { color: #26354a; font-size: 12px; font-weight: 650; }
.collaboration-product-swap-dialog .product-picker-result-copy span { color: #78879a; font-size: 11px; }
.collaboration-product-swap-dialog .product-picker-selected { margin: 0 !important; }
.collaboration-product-swap-dialog .product-picker-selection {
  background: #f5f8fc !important;
  border: 1px solid #cfdbea !important;
  border-radius: 8px !important;
  grid-template-columns: minmax(200px, 1fr) minmax(180px, 250px) auto !important;
  min-height: 58px !important;
  padding: 9px 10px !important;
}

/* Keep the same clean form language as “添加合作商品”, inside a modal. */
.collaboration-product-swap-dialog { width: min(820px, calc(100vw - 48px)); }
.collaboration-product-swap-dialog .collaboration-product-swap > .product-picker {
  overflow: visible;
  padding: 18px 20px !important;
}
.collaboration-product-swap-dialog .product-picker-search {
  font-size: 13px !important;
  font-weight: 500 !important;
  gap: 8px !important;
}
.collaboration-product-swap-dialog .product-picker-search::after { content: none !important; }
.collaboration-product-swap-dialog .product-picker-search input {
  border-color: #c9d5e5 !important;
  border-radius: 7px !important;
  height: 42px !important;
  padding: 0 12px !important;
}
.collaboration-product-swap-dialog .product-picker-results {
  box-shadow: 0 14px 36px rgba(15, 23, 42, .14) !important;
  left: 20px !important;
  margin: 0 !important;
  max-height: 260px !important;
  position: absolute !important;
  right: 20px !important;
  top: 82px !important;
  z-index: 1000 !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields {
  display: grid !important;
  gap: 14px !important;
  grid-template-columns: 1fr !important;
  padding: 18px 20px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields label {
  color: #475467;
  display: grid;
  font-size: 13px;
  gap: 7px;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields input {
  height: 42px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields textarea {
  border: 1px solid #c9d5e5;
  border-radius: 7px;
  font: inherit;
  min-height: 82px;
  padding: 10px 12px;
  resize: vertical;
  width: 100%;
}
.collaboration-product-swap-dialog .collaboration-product-swap > footer {
  justify-content: flex-start !important;
  padding: 14px 20px 18px !important;
}

/* Add-product dialog stays airy: results scroll inside the form, never over actions. */
.collaboration-product-swap-dialog[data-product-add-dialog] .product-picker-results {
  box-shadow: none !important;
  left: auto !important;
  margin-top: 2px !important;
  max-height: 176px !important;
  position: static !important;
  right: auto !important;
  top: auto !important;
}
.collaboration-product-swap-dialog[data-product-add-dialog] .product-picker-result {
  min-height: 54px !important;
  padding-block: 6px !important;
}
.collaboration-product-swap-dialog[data-product-add-dialog] .collaboration-product-swap-fields {
  border-top: 0 !important;
  padding-top: 16px !important;
}
.collaboration-product-swap-dialog[data-product-add-dialog] .collaboration-product-swap > footer {
  background: #fafbfd;
  border-top: 1px solid #edf1f5;
  flex-shrink: 0;
}

/* Lightweight product dialog — quiet surfaces, generous whitespace. */
.collaboration-product-swap-dialog {
  background: #fff !important;
  border: 0 !important;
  border-radius: 14px !important;
  box-shadow: 0 18px 50px rgba(27, 39, 60, .16) !important;
  width: min(720px, calc(100vw - 40px)) !important;
}
.collaboration-product-swap-dialog::backdrop {
  background: rgba(30, 41, 59, .32) !important;
  backdrop-filter: blur(1.5px);
}
.collaboration-product-swap-dialog .collaboration-product-swap {
  background: #fff !important;
  border-radius: 14px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header {
  border-bottom: 0 !important;
  min-height: auto !important;
  padding: 20px 22px 12px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header strong {
  color: #182230 !important;
  font-size: 17px !important;
  font-weight: 650 !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header span {
  color: #8793a3 !important;
  font-size: 11px !important;
  margin-top: 3px;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header > button {
  border-radius: 50% !important;
  color: #98a2b3 !important;
  height: 30px !important;
  min-height: 30px !important;
  width: 30px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > header > button:hover { background: #f4f6f8 !important; }
.collaboration-product-swap-dialog .collaboration-product-swap > .product-picker {
  border-bottom: 0 !important;
  gap: 9px !important;
  padding: 12px 22px 14px !important;
}
.collaboration-product-swap-dialog .product-picker-search {
  color: #596579 !important;
  font-size: 12px !important;
}
.collaboration-product-swap-dialog .product-picker-search input {
  background: #f7f9fc !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  box-shadow: none !important;
  height: 44px !important;
  padding-inline: 14px !important;
}
.collaboration-product-swap-dialog .product-picker-search:focus-within input {
  background: #fff !important;
  border-color: #9dbbea !important;
  box-shadow: 0 0 0 3px rgba(45, 112, 214, .08) !important;
}
.collaboration-product-swap-dialog .product-picker-results {
  background: #fff !important;
  border: 1px solid #eef1f5 !important;
  border-radius: 10px !important;
  padding: 5px !important;
}
.collaboration-product-swap-dialog .product-picker-result {
  border: 0 !important;
  border-radius: 8px !important;
  margin: 1px 0;
  min-height: 56px !important;
  padding: 7px 9px !important;
}
.collaboration-product-swap-dialog .product-picker-result:hover { background: #f5f8fc !important; }
.collaboration-product-swap-dialog .product-picker-result-image {
  background: #f1f3f6 !important;
  border-radius: 7px !important;
}
.collaboration-product-swap-dialog .product-picker-selection {
  background: #f7f9fc !important;
  border: 0 !important;
  border-radius: 9px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields {
  border: 0 !important;
  gap: 13px !important;
  padding: 10px 22px 20px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields label { color: #596579 !important; font-size: 12px !important; }
.collaboration-product-swap-dialog .collaboration-product-swap-fields :is(input, textarea) {
  background: #f7f9fc !important;
  border: 1px solid transparent !important;
  border-radius: 9px !important;
  box-shadow: none !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap-fields :is(input, textarea):focus {
  background: #fff !important;
  border-color: #9dbbea !important;
  outline: 0;
}
.collaboration-product-swap-dialog .collaboration-product-swap > footer {
  background: #fff !important;
  border-top: 1px solid #f0f2f5 !important;
  gap: 9px !important;
  justify-content: flex-end !important;
  padding: 13px 22px 16px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > footer button {
  border-radius: 8px !important;
  height: 36px !important;
  padding-inline: 15px !important;
}
.collaboration-product-swap-dialog .collaboration-product-swap > footer .secondary {
  background: #fff !important;
  border: 1px solid #dfe4ea !important;
  color: #4b5565 !important;
}
html[data-theme="dark"] body main#main-content :is(.product-line-copy,.product-short-text,.api-name,td a){color:#a9c1ff!important}

html[data-theme="dark"] body main#main-content :is(a:not([class]),button:not([class]),summary:not([class])){background-color:#182438!important;border-color:#435168!important;color:#dbe6f5!important}
html[data-theme="dark"] body main#main-content :is(
  .calendar-focus-strip,.calendar-month-grid,.calendar-key-event,.ct-secondary.month-current,
  .pt-trend,.pt-pager,.pt-btn.ghost,.pt-page article:not([class]),
  .ship-ghost-btn,.shipping-saas-page form:not([class]),
  .settlement-center label:not([class]),.settlement-center a:not([class]),
  .settlement-center a.red,.settlement-center a.orange,.settlement-center a.green,
  .settlement-center a.blue,.settlement-center a.purple,.settlement-center a.violet,
  .settlement-center a.amber,.settlement-center .ghost-action,.settle-detail-panel,
  .settle-detail-panel .detail-title,.settle-detail-panel .detail-status,
  .pa-missing-box,.product-admin-page div:not([class]),.product-admin-page .wide,
  .pf-btn.ghost,.product-fetch-center article.blue,.product-fetch-center article.green,
  .product-fetch-center article.orange,.product-fetch-center p:not([class]),
  .materials-workbench article:not([class]),.materials-workbench a:not([class]),
  .materials-workbench label:not([class]),.materials-workbench div:not([class]),
  .backup-help
){background:#131d2e!important;border-color:#344258!important;color:#dbe4f0!important;box-shadow:none!important}

html[data-theme="dark"] body main#main-content :is(.state-pill.success,.status-pill.ok){background:#13352d!important;color:#72e0b1!important}
html[data-theme="dark"] body main#main-content :is(.state-pill.warning,.status-pill.warn){background:#3b2b16!important;color:#f8c26a!important}
html[data-theme="dark"] body main#main-content :is(.icon-action.restore,.icon-action.purge){background:#182438!important;border-color:#435168!important}
html[data-theme="dark"] body main#main-content :is(.kpi-value,.alert-heading){color:#edf2f8!important}

/* Final named remnants found by the full-page visual scan. */
html[data-theme="dark"] body :is(.dashboard-workbench-v3,.stitch-scroll) :is(label,a.kpi-card,div.segmented,span.compare,.funnel-note,a:not([class]),span:not([class])){background-color:#131d2e!important;border-color:#344258!important;color:#dbe4f0!important}
html[data-theme="dark"] body main#main-content .kol-workbench :is(a.active,div:not([class])){background-color:#182438!important;border-color:#435168!important;color:#a9c1ff!important}
html[data-theme="dark"] body main#main-content .influencer-page-v2 a:not([class]){background-color:#182438!important;border-color:#435168!important;color:#a9c1ff!important}
html[data-theme="dark"] body main#main-content .pt-page a.action{background-color:#182438!important;border-color:#435168!important;color:#a9c1ff!important}
html[data-theme="dark"] body main#main-content .shipping-saas-page button.danger{background-color:#281c22!important;border-color:#713545!important;color:#ff9eae!important}
html[data-theme="dark"] body main#main-content .settlement-center :is(a:not([class]),div:not([class])){background-color:#131d2e!important;border-color:#344258!important;color:#dbe4f0!important}
html[data-theme="dark"] body main#main-content .materials-workbench :is(a:not([class]),a.active,.fabric-fold,.asset-object){background-color:#182438!important;border-color:#435168!important;color:#dbe4f0!important}
html[data-theme="dark"][data-theme-choice] body main a:not([class]){background:#182438!important;border-color:#435168!important;color:#a9c1ff!important;box-shadow:none!important}
/* Legacy templates may not set data-theme-choice; keep their plain links dark too. */
html[data-theme="dark"] body main a:not([class]){background:#182438!important;border-color:#435168!important;color:#a9c1ff!important;box-shadow:none!important}
html[data-theme="dark"] body #main-content a:not([class]),
html[data-theme="dark"] body .page a:not([class]){background:#182438!important;border-color:#435168!important;color:#a9c1ff!important;box-shadow:none!important}

/* Wide workspaces: use the available canvas instead of leaving a large 1500px gutter. */
@media (min-width:1201px){
  body .page>:is(
    .kol-workbench,
    .influencer-page-v2,
    .product-admin-page,
    .product-fetch-center,
    .materials-workbench,
    .shipping-saas-page,
    .settlement-center,
    .pt-page,
    .mr-full,
    .data-quality-page,
    .import-record-page,
    .backup-page,
    .ct-page,
    .mgmt-page,
    .bc-page
  ){
    width:100%!important;
    max-width:none!important;
    margin-left:0!important;
    margin-right:0!important;
    padding-left:20px!important;
    padding-right:20px!important;
  }
}

/* Keep row action popovers above the following table rows and sticky cells. */
body main#main-content table tbody tr:has(.unified-row-more[open]){
  position:relative!important;
  z-index:80!important;
}
body main#main-content table tbody tr:has(.unified-row-more[open])>td{
  position:relative!important;
  z-index:81!important;
  overflow:visible!important;
}
body main#main-content .unified-row-more[open]{
  position:relative!important;
  z-index:100!important;
}
body main#main-content .unified-row-more[open]>div{
  z-index:101!important;
}
.mrf-chart svg text{fill:#8793a6;font:10px "Microsoft YaHei",sans-serif}
.mrf-trend-empty{min-height:230px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;color:#667085;text-align:center}
.mrf-trend-empty strong{color:#344054;font-size:14px}.mrf-trend-empty span{font-size:12px}
html[data-theme="dark"] .mrf-trend-empty strong{color:#edf2f8!important}

/* Monthly review: quieter report surface with color reserved for real status. */
html:not([data-theme="dark"]) body:has(.mr-full){background:#f7f8fa!important}
html:not([data-theme="dark"]) .mr-full :is(.mrf-hero,.mrf-card,.mrf-kpis article){
  background:#fff!important;
  border-color:#e3e7ee!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) .mr-full :is(
  .mrf-next,.mrf-chart,.mrf-funnel,.mrf-rank,.mrf-mode-bars,.mrf-cost-bars
){background:transparent!important;border-color:#e8ebf0!important;box-shadow:none!important}
html:not([data-theme="dark"]) .mr-full :is(.mrf-risk-list a,.mrf-decision-list article){
  background:#fff!important;
  border:0!important;
  border-bottom:1px solid #edf0f4!important;
  border-radius:0!important;
  box-shadow:none!important;
}
html:not([data-theme="dark"]) .mr-full :is(.mrf-risk-list a,.mrf-decision-list article):last-child{border-bottom:0!important}
html:not([data-theme="dark"]) .mr-full .mrf-section-label{color:#667085!important}
html:not([data-theme="dark"]) .mr-full :is(.mrf-funnel b,.mrf-mode-bars b,.mrf-cost-row b){background:#edf1f5!important}
html:not([data-theme="dark"]) .mr-full .mrf-kpis article:is(.warn,.good,.money){background:#fff!important;border-color:#e3e7ee!important}

.influencer-picker-field{position:relative;z-index:12}.influencer-picker{position:relative}.influencer-picker>[data-influencer-select]{display:none!important}
.influencer-picker-results{position:absolute;top:calc(100% + 6px);left:0;z-index:120;width:min(520px,calc(100vw - 40px));max-height:360px;padding:6px;overflow:auto;border:1px solid #d8e0ec;border-radius:9px;background:#fff;box-shadow:0 16px 40px rgba(15,23,42,.16)}
.influencer-picker-results>button{width:100%;min-height:62px;padding:8px 10px;display:grid;grid-template-columns:40px minmax(0,1fr) auto;gap:10px;align-items:center;border:0;border-radius:7px;background:#fff;color:#172033;text-align:left;cursor:pointer}
.influencer-picker-results>button:hover,.influencer-picker-results>button.is-selected{background:#f2f6fd}.influencer-picker-avatar{width:38px;height:38px;display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#e9eef7;color:#45628f;font-weight:700}.influencer-picker-avatar img{width:100%;height:100%;object-fit:cover}.influencer-picker-copy,.influencer-picker-price{display:grid;gap:3px}.influencer-picker-copy small,.influencer-picker-price small{color:#7b8798;font-size:11px}.influencer-picker-price{text-align:right}.influencer-picker-price b{font-size:12px}.influencer-picker-results>p{margin:0;padding:24px;color:#7b8798;text-align:center}
html[data-theme="dark"] .influencer-picker-results{background:#131d2e;border-color:#344258}.influencer-picker-results>button{box-shadow:none!important}html[data-theme="dark"] .influencer-picker-results>button{background:#131d2e!important;color:#edf2f8!important}html[data-theme="dark"] .influencer-picker-results>button:hover,html[data-theme="dark"] .influencer-picker-results>button.is-selected{background:#1b2a40!important}
.settlement-dropzone{position:relative;cursor:pointer}.settlement-dropzone-body{min-height:108px;padding:18px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:5px;border:1px dashed #9fb4d3;border-radius:8px;background:#f8fafd;text-align:center;transition:border-color .16s,background .16s}.settlement-dropzone-body b{color:#344054;font-size:13px}.settlement-dropzone-body small{color:#7b8798;font-size:11px}.settlement-dropzone-body em{margin-top:5px;color:#2563eb;font-size:11px;font-style:normal}.settlement-dropzone>[data-dropzone-input]{position:absolute!important;width:1px!important;height:1px!important;min-height:1px!important;opacity:0!important;pointer-events:none}.settlement-dropzone.is-dragging .settlement-dropzone-body{border-color:#2563eb;background:#eef5ff}.settlement-dropzone.has-file .settlement-dropzone-body{border-style:solid;border-color:#8fc6aa;background:#f5fbf7}.settlement-dropzone.has-file .settlement-dropzone-body b{color:#087443}html[data-theme="dark"] .settlement-dropzone-body{background:#101a2a;border-color:#435168}html[data-theme="dark"] .settlement-dropzone-body b{color:#edf2f8}

.collaboration-product-swap-row>td{padding:0!important;background:#f7faff!important}.collaboration-product-swap{position:relative;padding:16px;display:grid;gap:12px;border:1px solid #8bb4f3;border-radius:8px;background:#fff}.collaboration-product-swap>header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.collaboration-product-swap>header div{display:grid;gap:4px}.collaboration-product-swap>header span{color:#667085;font-size:11px}.collaboration-product-swap>header>button{width:28px;height:28px;min-height:28px;padding:0;border:0;background:transparent;font-size:20px}.collaboration-product-swap .product-picker-results{z-index:130}.collaboration-product-swap-fields{display:grid;grid-template-columns:180px 120px minmax(220px,1fr);gap:10px}.collaboration-product-swap-fields label{display:grid;gap:5px;color:#667085;font-size:11px}.collaboration-product-swap>footer{display:flex;gap:8px}.collaboration-product-swap>footer button{min-height:34px}.collaboration-product-swap>footer button[type="submit"]{border-color:#2563eb;background:#2563eb;color:#fff}@media(max-width:760px){.collaboration-product-swap-fields{grid-template-columns:1fr}}html[data-theme="dark"] .collaboration-product-swap-row>td,html[data-theme="dark"] .collaboration-product-swap{background:#131d2e!important;border-color:#435f87!important}

.settlement-collaboration-field{position:relative;z-index:30}.settlement-collaboration-picker{position:relative}.settlement-collaboration-picker>[data-settlement-collaboration]{position:absolute!important;width:1px!important;height:1px!important;min-height:1px!important;opacity:0!important;pointer-events:none}.settlement-collaboration-trigger{width:100%;min-height:44px!important;padding:0 13px!important;display:flex!important;align-items:center!important;justify-content:space-between!important;border:1px solid #cfd8e6!important;border-radius:7px!important;background:#fff!important;color:#344054!important;text-align:left!important}.settlement-collaboration-trigger i{color:#7b8798;font-style:normal}.settlement-collaboration-panel{position:absolute;top:calc(100% + 6px);left:0;z-index:160;width:100%;padding:10px;border:1px solid #d8e0ec;border-radius:10px;background:#fff;box-shadow:0 18px 46px rgba(15,23,42,.17)}.settlement-collaboration-panel>input{height:40px;margin-bottom:8px}.settlement-collaboration-results{max-height:420px;display:grid;gap:4px;overflow:auto}.settlement-collaboration-results>button{width:100%;min-height:76px;padding:10px;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:11px;align-items:center;border:0;border-radius:8px;background:#fff;color:#172033;text-align:left;cursor:pointer}.settlement-collaboration-results>button:hover,.settlement-collaboration-results>button.is-selected{background:#f1f6fd}.settlement-collaboration-avatar{width:42px;height:42px;display:grid;place-items:center;overflow:hidden;border-radius:50%;background:#e9eef7;color:#45628f;font-weight:700}.settlement-collaboration-avatar img{width:100%;height:100%;object-fit:cover}.settlement-collaboration-copy{min-width:0;display:grid;gap:3px}.settlement-collaboration-copy small,.settlement-collaboration-copy em,.settlement-collaboration-money small{color:#7b8798;font-size:11px;font-style:normal}.settlement-collaboration-copy em{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.settlement-collaboration-money{display:grid;gap:4px;text-align:right}.settlement-collaboration-results>p{margin:0;padding:30px;color:#7b8798;text-align:center}html[data-theme="dark"] .settlement-collaboration-trigger,html[data-theme="dark"] .settlement-collaboration-panel,html[data-theme="dark"] .settlement-collaboration-results>button{background:#131d2e!important;border-color:#344258!important;color:#edf2f8!important}html[data-theme="dark"] .settlement-collaboration-results>button:hover,html[data-theme="dark"] .settlement-collaboration-results>button.is-selected{background:#1b2a40!important}

.collaboration-head-actions{align-items:center!important;gap:8px!important}.collaboration-head-actions>a,.collaboration-head-actions button{box-sizing:border-box!important;height:38px!important;min-height:38px!important;margin:0!important;padding:0 14px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;line-height:1!important}.collaboration-head-actions form{height:38px!important;display:flex!important;align-items:center!important}.collaboration-head-actions .collaboration-danger-button{border:1px solid #efc4c1!important;border-radius:7px!important;background:#fff!important;color:#c4322b!important;font-size:13px!important;font-weight:550!important;box-shadow:none!important}.collaboration-head-actions .collaboration-danger-button:hover{border-color:#d92d20!important;background:#fff6f5!important}
.collaboration-product-swap-row>td{padding:12px 14px 16px!important;background:#f4f7fb!important}.collaboration-product-swap{max-width:1120px;margin:0 auto;padding:0!important;gap:0!important;overflow:visible;border:1px solid #d6dfec!important;border-radius:10px!important;background:#fff!important;box-shadow:0 8px 24px rgba(15,23,42,.07)}.collaboration-product-swap>header{min-height:58px;padding:12px 16px;align-items:center!important;border-bottom:1px solid #e8edf4}.collaboration-product-swap>header strong{font-size:15px}.collaboration-product-swap>header span{font-size:12px!important}.collaboration-product-swap>header>button{border-radius:6px!important;color:#667085!important}.collaboration-product-swap>header>button:hover{background:#f1f4f8!important}.collaboration-product-swap>.product-picker{padding:14px 16px;border-bottom:1px solid #edf1f5}.collaboration-product-swap .product-picker-search{gap:7px}.collaboration-product-swap .product-picker-search:before{content:"选择替换商品";color:#344054;font-size:12px;font-weight:650}.collaboration-product-swap .product-picker-search input{height:40px!important}.collaboration-product-swap .product-picker-selected{margin-top:10px}.collaboration-product-swap .product-picker-selection{min-height:64px;padding:10px 12px!important;grid-template-columns:minmax(240px,1fr) minmax(220px,320px) auto!important;border-color:#d8e4f3!important;border-radius:8px!important;background:#f7faff!important}.collaboration-product-swap .product-picker-selection-copy strong{font-size:13px}.collaboration-product-swap .product-picker-selection select{height:38px!important}.collaboration-product-swap-fields{padding:14px 16px!important;grid-template-columns:180px 120px minmax(260px,1fr)!important;border-bottom:1px solid #edf1f5}.collaboration-product-swap-fields :is(input,select){height:38px!important}.collaboration-product-swap>footer{padding:12px 16px;justify-content:flex-end;background:#fafbfd}.collaboration-product-swap>footer button{height:36px!important;min-height:36px!important;padding:0 14px!important;border-radius:7px!important}@media(max-width:760px){.collaboration-product-swap{max-width:none}.collaboration-product-swap-fields,.collaboration-product-swap .product-picker-selection{grid-template-columns:1fr!important}}

@media (max-width:700px){
  html body .dashboard-workbench-v3 .dashboard-date-presets{
    display:flex!important;
    width:100%!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    -webkit-overflow-scrolling:touch;
    padding-bottom:4px!important;
  }
  html body .dashboard-workbench-v3 .dashboard-date-presets>a,
  html body .dashboard-workbench-v3 .dashboard-date-custom>summary{
    align-items:center!important;
    box-sizing:border-box!important;
    display:inline-flex!important;
    flex:0 0 auto!important;
    min-height:40px!important;
    height:40px!important;
    line-height:40px!important;
  }
}

.settlement-dropzone-head{align-items:center;display:flex;justify-content:space-between}
.settlement-dropzone-head button{background:#fff;border:1px solid #cbd5e1;border-radius:6px;color:#0452cc;cursor:pointer;font-size:11px;padding:5px 10px}
.settlement-dropzone-head button:disabled{color:#94a3b8;cursor:not-allowed}
.dropzone-preview-content iframe{border:0;height:min(76vh,760px);width:min(86vw,1000px)}
html[data-theme="dark"] .settlement-dropzone-head button{background:#162235;border-color:#435168;color:#93c5fd}
.dropzone-preview-dialog{background:#fff;border:0;border-radius:12px;box-shadow:0 24px 70px #0f172a55;margin:auto;max-height:88vh;max-width:min(760px,90vw);padding:0;width:max-content}.dropzone-preview-dialog::backdrop{background:#0f172a99}.dropzone-preview-dialog header{align-items:center;border-bottom:1px solid #e2e8f0;display:flex;justify-content:space-between;padding:12px 16px}.dropzone-preview-dialog header strong{font-size:14px}.dropzone-preview-dialog header button{align-items:center;background:#f1f5f9;border:0;border-radius:50%;color:#475569;cursor:pointer;display:flex;font-size:22px;height:32px;justify-content:center;width:32px}.dropzone-preview-dialog>div{align-items:center;display:flex;justify-content:center;max-height:calc(88vh - 58px);min-height:240px;min-width:320px;padding:18px}.dropzone-preview-dialog img{display:block;max-height:calc(88vh - 94px);max-width:min(700px,84vw);object-fit:contain}html[data-theme="dark"] .dropzone-preview-dialog{background:#111827;color:#f8fafc}html[data-theme="dark"] .dropzone-preview-dialog header{border-color:#334155}
.settlement-form-page .settlement-amount-field{justify-self:start;width:min(100%,300px)}
