/* Shared neutral gray surfaces for every application document. Light mode and
   custom accent choices retain their own palette. */
html[data-theme="dark"]{
  color-scheme:dark;
  --bg:#181818;--side:#202020;--panel:#202020;--panel-2:#282828;--panel2:#282828;
  --panel-3:#1b1b1b;--chip:#303030;--field:#1b1b1b;--hover:#383838;
  --text:#eeeeee;--muted:var(--text-muted);--muted-2:var(--text-muted);
  --line:rgba(255,255,255,.09);--line-soft:rgba(255,255,255,.06);
}
html[data-theme="dark"]:is([data-accent="green"],:not([data-accent])){
  --accent:#69ce5f;--accent-strong:#69ce5f;--accent-text:#69ce5f;
  --accent-soft:rgba(105,206,95,.16);--green:#69ce5f;--green-dim:rgba(105,206,95,.14);
  --action-bg:var(--accent);--action-hover:color-mix(in srgb,var(--accent) 88%,#000);--action-text:#0f1a0d;
  --count-bg:#69ce5f;--action-count-text:#19241d;--focus-color:#69ce5f;
}
html[data-theme="dark"] body{background:var(--bg);color:var(--text)}
html[data-theme="dark"] .sidebar{background:var(--side)}
html[data-theme="dark"] .topbar{background:var(--panel-2)}
html[data-theme="dark"] :is(.ui-menu,.notification-menu,.pb-select-menu,.product-filter-popover){background:var(--panel)}
html[data-theme="dark"] #user-menu{background:var(--panel)}
html[data-theme="dark"] :is(#notification-menu,#mobile-notification-menu,.notification-menu-head,.notification-filters){background:var(--panel)}
html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--muted)!important;opacity:1}
html[data-theme="dark"] #user-menu .ui-menu-row:focus-visible{outline-width:2px;outline-offset:-2px}
html[data-theme="dark"] .product-page-btn.active{background:var(--hover)!important;color:var(--text)!important;border-color:var(--muted)}
html[data-theme="dark"] .account-status-pill.ok{background:var(--accent-soft);color:var(--accent-text)}
html[data-theme="dark"] .ops-amount.negative{color:var(--danger,#f17a71)!important}
html[data-theme="dark"] .ops-platform-ggsel .ops-platform-tag{color:var(--accent-text)}
html[data-theme="dark"] .ops-platform-ggsel .ops-platform-tag b{background:var(--chip);color:var(--accent-text)}
html[data-theme="dark"] .badge.b-warn{color:var(--warning,#e2ad55)}
html[data-theme="dark"] .ops-error{background:#352525;color:var(--danger,#f17a71)}
html[data-theme="dark"] #product-edit-modal .variant-mode-option:has(input:checked) b{color:var(--text)!important}
html[data-theme="dark"] .variant-preview.bad{color:var(--danger,#f17a71)}
html[data-theme="dark"] #product-edit-modal .product-card-options-help{background:#4f4f4f;color:var(--text)!important}
html[data-theme="dark"] #product-edit-modal .product-card-options-help:focus-visible{outline:2px solid var(--text);outline-offset:2px}
html[data-theme="dark"] #product-edit-modal :is(.product-card-options-status.error,.product-card-option-variant button){color:var(--danger,#f17a71)}
html[data-theme="dark"] #product-edit-modal .product-card-options-status.ok{color:var(--accent-text,var(--accent-strong))}
html[data-theme="dark"].product-editor-page #product-edit-modal .product-edit-wizard-steps>i.completed,
html[data-theme="dark"].product-editor-page #product-edit-modal[data-product-edit-step="2"] .product-edit-wizard-steps>i:nth-of-type(1),
html[data-theme="dark"].product-editor-page #product-edit-modal[data-product-edit-step="3"] .product-edit-wizard-steps>i,
html[data-theme="dark"].product-editor-page #product-edit-modal .product-edit-wizard-steps::after{background:var(--accent)!important}
html[data-theme="dark"].product-editor-page #product-edit-modal .product-content-date-sort:focus-visible{outline-color:var(--focus-color,var(--accent))}
html[data-theme="dark"] #product-edit-modal.pe-workspace-design .pe-control-help button>span{background:#4f4f4f;color:#eee}
html[data-theme="dark"] .pbm-badge{background:#bd392f;color:#fff}
html[data-theme="dark"] .pbm-row.danger{color:#f07770}
html[data-theme="dark"] .pbm-row.danger .pbm-i{stroke:#f07770}
/* Authentication documents intentionally load no dashboard/application code. */
html[data-theme="dark"] .auth{background:var(--panel)}
html[data-theme="dark"] .auth input{background:var(--field)}
html[data-theme="dark"] .auth :is(.lang-switch,.hint){background:var(--panel-2)}
html[data-theme="dark"] .auth :is(button:not(.link-btn):not(.ghost-btn):not([aria-pressed="false"]),.lang-switch button[aria-pressed="true"]){background:var(--action-bg);color:var(--action-text)}
html[data-theme="dark"] .auth :is(button:not(.link-btn):not(.ghost-btn):not([aria-pressed="false"]),.lang-switch button[aria-pressed="true"]):hover{background:var(--action-hover)}
/* Semantic positives follow the same accent in sections with legacy fixed
   greens; marketplace brand marks and warning/error colours stay distinct. */
html[data-theme="dark"] :is(.analytics-positive,.analytics-account-diff.positive,.analytics-account-value.positive,.legacy-change-price.ok,.ops-amount.positive,.ops-stat.success strong,.ops-kicker){color:var(--accent-text,var(--accent-strong))!important}
html[data-theme="dark"] :is(.ops-primary,.commerce-option-add){background:var(--action-bg);color:var(--action-text)}
html[data-theme="dark"] .ops-primary:hover{background:var(--action-hover)}
/* Save, Add product and GGsel Load retain green surfaces in dark mode.
   Local tokens also cover later editor/mobile rules and hover states. */
html[data-theme="dark"] .btn:is([data-pb-onclick^="save"],.product-add-button,.product-load-button,.action-load,[data-i18n="commerce.saveNext"],#quick-start-action){
  --action-bg:var(--accent);--action-hover:color-mix(in srgb,var(--accent) 88%,#000);
  --blue-action-bg:var(--action-bg);--blue-action-hover:var(--action-hover);--blue-action-text:var(--action-text);
  background:var(--action-bg)!important;border-color:var(--action-bg)!important;color:var(--action-text)!important;
}
html[data-theme="dark"] .btn:is([data-pb-onclick^="save"],.product-add-button,.product-load-button,.action-load,[data-i18n="commerce.saveNext"],#quick-start-action):hover{background:var(--action-hover)!important;border-color:var(--action-hover)!important;color:var(--action-text)!important}
/* Run controls are semantic actions, not generic primary buttons. The running
   topbar trigger opens Manage and remains neutral; only its Start state is green. */
html[data-theme="light"] :is(.account-actions .btn.action-run,.account-run-actions .btn.action-run,#btn-start.primary,#quick-start-action,.accounts-command-summary .command-summary-action>.btn.primary),
html[data-theme="dark"] :is(.account-actions .btn.action-run,.account-run-actions .btn.action-run,#btn-start.primary,#quick-start-action,.accounts-command-summary .command-summary-action>.btn.primary){
  --action-bg:var(--accent);--action-hover:color-mix(in srgb,var(--accent) 88%,#000);
  background:var(--action-bg)!important;border-color:var(--action-bg)!important;color:var(--action-text)!important;
}
html[data-theme="light"] :is(.account-actions .btn.action-stop,.account-run-actions .btn.action-stop,#quick-stop-action,#quick-stop-all,.accounts-command-summary .command-summary-action>.btn.secondary),
html[data-theme="dark"] :is(.account-actions .btn.action-stop,.account-run-actions .btn.action-stop,#quick-stop-action,#quick-stop-all,.accounts-command-summary .command-summary-action>.btn.secondary){
  --action-bg:#bd392f;--action-hover:#a92f27;--action-text:#fff;
  background:var(--action-bg)!important;border-color:var(--action-bg)!important;color:var(--action-text)!important;
}
html[data-theme="light"] :is(.account-actions .btn.action-run,.account-run-actions .btn.action-run,#btn-start.primary,#quick-start-action,.accounts-command-summary .command-summary-action>.btn.primary,.account-actions .btn.action-stop,.account-run-actions .btn.action-stop,#quick-stop-action,#quick-stop-all,.accounts-command-summary .command-summary-action>.btn.secondary):hover,
html[data-theme="dark"] :is(.account-actions .btn.action-run,.account-run-actions .btn.action-run,#btn-start.primary,#quick-start-action,.accounts-command-summary .command-summary-action>.btn.primary,.account-actions .btn.action-stop,.account-run-actions .btn.action-stop,#quick-stop-action,#quick-stop-all,.accounts-command-summary .command-summary-action>.btn.secondary):hover{
  background:var(--action-hover)!important;border-color:var(--action-hover)!important;color:var(--action-text)!important;
}
html[data-theme="dark"] :is(.sidebar #commerce-nav-badge,#pbn-chats-badge){--commerce-unread-badge-bg:#69ce5f;--commerce-unread-badge-text:#19241d}
html[data-theme="dark"] #dynamic-sections .product-view-menu .product-filter-count[id$="-view-count"]{--count-bg:#69ce5f;--action-count-text:#19241d;background:var(--accent)!important;color:#19241d!important}
html[data-theme="dark"] :is(.ops-status:not(.refunded),.ops-review-face:not(.bad),.ops-detail-review:not(.bad)){
  background:var(--accent-soft);color:var(--accent-text,var(--accent-strong));
}
/* Zero/idle chat account counters: --text-muted on the #303030 chip is 4.3:1. */
html[data-theme="dark"] .commerce-chat-platform-filter button .commerce-chat-account-count:not(.has-unread){color:#b8b8b8}
