/* ScaleEdges appearance
   Loaded on every platform page: the workspace, and the public site (home,
   features, marketplace, documentation, blog…) whose own dark rules live in
   marketing-dark.css. Public seller sites never receive this stylesheet or the
   data-dashboard-theme attribute. */

/* Appearance picker (shared by light and dark dashboard themes). */
.dashboard-theme-form { padding: clamp(1rem, 3vw, 1.5rem); }
.dashboard-theme-form-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  margin-bottom: 1.25rem;
}
.dashboard-theme-form-head .card-title { display: flex; align-items: center; gap: .5rem; margin-bottom: .25rem; }
.dashboard-theme-form-head .card-title .icon { width: 19px; height: 19px; color: var(--primary); }
.dashboard-theme-form-head p { max-width: 650px; margin: 0; }
.dashboard-theme-save-status {
  display: inline-flex; flex: none; align-items: center; min-height: 28px; padding: .25rem .6rem;
  border-radius: 999px; color: var(--muted); background: color-mix(in srgb, var(--border) 52%, transparent);
  font-size: .72rem; font-weight: 750;
}
.dashboard-theme-save-status:empty { visibility: hidden; }
.dashboard-theme-save-status.is-saving::before {
  width: 10px; height: 10px; margin-right: .35rem; border: 2px solid currentColor;
  border-right-color: transparent; border-radius: 50%; content: ''; animation: dashboardThemeSpin .7s linear infinite;
}
.dashboard-theme-save-status.is-saved { color: var(--green); background: var(--green-bg); }
.dashboard-theme-save-status.is-error { color: var(--red); background: var(--red-bg); }
.dashboard-theme-options {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .9rem;
  min-width: 0; margin: 0; padding: 0; border: 0;
}
.dashboard-theme-option {
  position: relative; display: grid; min-width: 0; overflow: hidden;
  border: 1px solid var(--border); border-radius: 14px; background: var(--card);
  cursor: pointer; transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.dashboard-theme-option:hover { border-color: color-mix(in srgb, var(--primary) 48%, var(--border)); transform: translateY(-2px); }
.dashboard-theme-option:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 30%, transparent); outline-offset: 2px; }
.dashboard-theme-option:has(input:checked) {
  border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 10px 26px color-mix(in srgb, var(--primary) 14%, transparent);
}
.dashboard-theme-option > input { position: absolute; width: 1px !important; height: 1px; opacity: 0; pointer-events: none; }
.dashboard-theme-preview {
  position: relative; display: block; height: 112px; overflow: hidden;
  border-bottom: 1px solid var(--border); background: #f6f7fb;
}
.dashboard-theme-preview-nav { position: absolute; inset: 0 0 auto; height: 23px; background: #fff; border-bottom: 1px solid #e2e5ee; }
.dashboard-theme-preview-nav::before {
  position: absolute; top: 7px; left: 9px; width: 22px; height: 8px; border-radius: 4px;
  background: #5b68e3; content: '';
}
.dashboard-theme-preview-side { position: absolute; top: 30px; bottom: 8px; left: 8px; width: 29px; border-radius: 5px; background: #e9ebf4; }
.dashboard-theme-preview-card {
  position: absolute; top: 31px; right: 9px; width: calc(100% - 54px); height: 31px;
  border: 1px solid #e2e5ee; border-radius: 6px; background: #fff; box-shadow: 0 3px 8px rgb(34 40 70 / 6%);
}
.dashboard-theme-preview-card::before {
  position: absolute; top: 8px; left: 8px; width: 42%; height: 4px; border-radius: 3px; background: #c5cad8; content: '';
}
.dashboard-theme-preview-card-small { top: 70px; width: calc((100% - 62px) / 2); height: 31px; }
.dashboard-theme-preview-dark { background: #0b0f19; }
.dashboard-theme-preview-dark .dashboard-theme-preview-nav { border-color: #2a3346; background: #151b29; }
.dashboard-theme-preview-dark .dashboard-theme-preview-side { background: #20283a; }
.dashboard-theme-preview-dark .dashboard-theme-preview-card { border-color: #303a4f; background: #171e2d; box-shadow: none; }
.dashboard-theme-preview-dark .dashboard-theme-preview-card::before { background: #69758d; }
.dashboard-theme-preview-system::after {
  position: absolute; inset: 0 0 0 50%; background: #0b0f19; content: ''; clip-path: polygon(18% 0, 100% 0, 100% 100%, 0 100%);
}
.dashboard-theme-preview-system .dashboard-theme-preview-nav,
.dashboard-theme-preview-system .dashboard-theme-preview-side,
.dashboard-theme-preview-system .dashboard-theme-preview-card { z-index: 1; }
.dashboard-theme-preview-system::before {
  position: absolute; z-index: 2; top: 0; bottom: 0; left: 50%; width: 1px; background: rgba(127, 137, 160, .45);
  content: ''; transform: rotate(9deg); transform-origin: center;
}
.dashboard-theme-option-copy { display: grid; gap: .15rem; padding: .8rem .85rem .9rem; }
.dashboard-theme-option-title { display: flex; align-items: center; gap: .4rem; color: var(--text); font-size: .86rem; }
.dashboard-theme-option-title .icon { width: 15px; height: 15px; color: var(--primary); }
.dashboard-theme-option-copy small { color: var(--muted); font-size: .7rem; }
/* Always rendered over the dark preview tile, so its palette is fixed rather
   than themed: dark-on-dark was unreadable in both dashboard themes. */
.dashboard-theme-energy-badge {
  position: absolute; z-index: 2; right: 8px; bottom: 6px; display: flex; align-items: center; gap: .3rem;
  padding: .15rem .4rem; border: 1px solid rgba(110, 231, 183, .35); border-radius: 999px;
  color: #a7f3d0; background: #064e3b; font-size: .6rem; font-weight: 650; line-height: 1.5; white-space: nowrap;
}
.dashboard-theme-energy-badge .icon { flex: none; width: 11px; height: 11px; stroke-width: 2.2; }
.dashboard-theme-option-check {
  position: absolute; z-index: 3; top: 8px; right: 8px; display: grid; width: 22px; height: 22px;
  place-items: center; border: 1px solid var(--border); border-radius: 50%; color: transparent; background: var(--card);
}
.dashboard-theme-option-check .icon { width: 13px; height: 13px; }
.dashboard-theme-option:has(input:checked) .dashboard-theme-option-check { color: #fff; border-color: var(--primary); background: var(--primary); }
.dashboard-theme-save { margin-top: 1rem; }
@keyframes dashboardThemeSpin { to { transform: rotate(360deg); } }
@media (max-width: 720px) {
  .dashboard-theme-options { grid-template-columns: 1fr; }
  .dashboard-theme-option { grid-template-columns: 128px minmax(0, 1fr); align-items: center; }
  .dashboard-theme-preview { height: 92px; border-right: 1px solid var(--border); border-bottom: 0; }
  .dashboard-theme-form-head { flex-direction: column; }
}
@media (max-width: 430px) {
  .dashboard-theme-option { grid-template-columns: 104px minmax(0, 1fr); }
}

/* Dark palette. These tokens cover the majority of dashboard components. */
html[data-dashboard-theme="dark"] {
  --primary: #818cf8;
  --primary-dark: #6975e8;
  --bg: #0b0f19;
  --card: #151b29;
  --text: #eef2ff;
  --muted: #9aa5bb;
  --border: #2d374a;
  --green: #6bd6a0;
  --green-bg: #17382b;
  --red: #ff9188;
  --red-bright: #ff7068;
  --red-bg: #3d2024;
  --theme-primary: #818cf8;
  --theme-secondary: #6975e8;
  --theme-bg: #0b0f19;
  --theme-card: #151b29;
  --theme-text: #eef2ff;
  --theme-muted: #9aa5bb;
  --theme-border: #2d374a;
  --theme-h1: #f7f8ff;
  --theme-h2: #f1f4ff;
  --theme-btn-secondary: #1c2434;
  --theme-btn-tertiary: #242d3e;
  --theme-btn-secondary-hover: #273247;
  --theme-btn-tertiary-hover: #303a4f;
  --surface-1: #151b29;
  --surface-2: #1b2332;
  --surface-3: #222b3d;
  --surface-hover: #242e42;
  --dashboard-grid: #313b50;
  --analytics-map-low: #34415d;
  --analytics-map-high: #aeb7ff;
}

html[data-dashboard-theme="dark"] body.dashboard-shell {
  color: var(--text); background: var(--bg);
}
/* Plain form fields and code: the same on the workspace and the public site. */
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(input, select, textarea) { color: var(--text); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(input, select, textarea)::placeholder { color: #748097; opacity: 1; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(input[type="text"], input[type="email"], input[type="password"], input[type="url"], input[type="search"], input[type="number"], input[type="date"], input[type="tel"], select, textarea) {
  border-color: var(--border); background-color: var(--card);
}
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(select) { color-scheme: dark; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) code { color: #dbe2ff; background: #242d3e; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) pre:not(.platform-markdown pre) { color: #e7ebff; background: #101522; border-color: var(--border); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) hr { border-color: var(--border); }

/* Navigation, menus and overlays. A signed-in seller keeps this navigation
   on the public pages too, hence both shells. */
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav {
  border-bottom-color: rgba(145, 157, 190, .16); background: rgba(15, 20, 31, .92);
  box-shadow: 0 8px 30px rgba(0, 0, 0, .22);
}
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-brand { color: #e1e8f5; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-brand > span > span { color: #9aabff; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav-links > a { color: #b9c2d6; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav-links > a:hover,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav-links > a.active { color: #aeb6ff; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav-links > .dashboard-store-link,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-notification-toggle,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-lumia-toggle,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-menu-toggle {
  color: #cbd3ff; border-color: #364159; background: #1a2231; box-shadow: 0 5px 16px rgba(0, 0, 0, .2);
}
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-menu-toggle span { background: #bfc7ff; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-notification-toggle:hover,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-notification-menu.open .dashboard-notification-toggle,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-lumia-toggle:hover,
html[data-dashboard-theme="dark"] body.lumia-chat-open:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-lumia-toggle {
  color: #d9deff; border-color: #606dae; background: #252d48;
}
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-nav .dashboard-notification-badge { border-color: #0f141f; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(.avatar-dropdown, .dashboard-notification-panel, .publish-menu, .dashboard-product-menu, .gallery-picker-dialog) {
  color: var(--text); border-color: var(--border); background: var(--card); box-shadow: 0 22px 60px rgba(0, 0, 0, .44);
}
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(.avatar-dropdown-head, .avatar-store-switcher, .dashboard-notification-head, .dashboard-notification-foot) { border-color: var(--border); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(.avatar-store-option:hover, .avatar-store-option.active, .avatar-dropdown-item:hover) { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .avatar-store-option-icon { color: #aeb7ff; background: #293250; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .avatar-store-option-icon.has-logo { background: #fff; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .avatar-plan-badge { color: #bdc6d8; background: #273043; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .avatar-plan-badge.is-premium { color: #79dfaa; background: #17382b; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-head > a,
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-foot { background: var(--surface-2); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-item { border-color: var(--border); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-item:hover { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-item.is-unread { background: #202944; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-content > span { color: #b1bbcf; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-content time { color: #7f8aa1; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .dashboard-notification-empty > span { background: #252e4e; }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) .modal-overlay { background: rgba(2, 5, 12, .72); }
html[data-dashboard-theme="dark"] body:is(.dashboard-shell, .marketing-shell) :where(.modal-box, .getting-started-modal .modal-box, .security-pin-dialog) {
  color: var(--text); border-color: var(--border); background: var(--card); box-shadow: 0 28px 90px rgba(0, 0, 0, .56);
}

/* Reusable dashboard surfaces. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(
  .card, .stat-card, .table, .empty-state, .pricing-card, .product-card,
  .period-bar, .analytics-depth, .analytics-card, .utm-panel,
  .communication-panel, .integration-service-card, .questions-intro,
  .gallery-page-tools, .gallery-picker-toolbar, .gallery-storage-card,
  .subscriber-import-dialog, .sales-import-panel, .follower-manager,
  .vat-registration-row
) { color: var(--text); border-color: var(--border); background-color: var(--card); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.table th, .billing-table th, .team-permission-matrix thead th) {
  color: var(--muted); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.table td, .table th, .billing-table td, .billing-table th) { border-color: var(--border); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.btn:not(.btn-primary):not(.btn-danger), button.integration-filter) {
  color: var(--text); border-color: var(--border); background-color: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.btn:not(.btn-primary):not(.btn-danger):hover, button.integration-filter:hover) { background-color: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .btn-primary { background-color: #5b68e3; }
html[data-dashboard-theme="dark"] body.dashboard-shell .btn-primary:hover { background-color: #4a56c2; }
/* Carte « Start writing » : le léger dégradé bleu de Lumia, sombre ici. */
html[data-dashboard-theme="dark"] body.dashboard-shell .blog-quick-card {
  border-color: var(--lumia-line); background: var(--lumia-gradient);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.badge-gray, .billing-status, .billing-payment-status, .team-role-pill) {
  color: #bdc6d8; background: #273043;
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.alert-error, .analytics-ai-error) { color: #ffaaa4; border-color: #6a3438; background: #3b2024; }
html[data-dashboard-theme="dark"] body.dashboard-shell .alert-info { color: #a9c9ff; border-color: #304b72; background: #172b47; }
html[data-dashboard-theme="dark"] body.dashboard-shell .alert-warning { color: #f4ce82; border-color: #68552d; background: #382e1b; }

/* Sélection multiple et édition groupée des tableaux Followers / Customers. */
html[data-dashboard-theme="dark"] body.dashboard-shell .table-bulk-bar {
  border-color: #3c3f7a; background: #1d2138;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .table-bulk-scope {
  color: #c3c9ff; background: #242a49;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .table-bulk-warning {
  color: #f4ce82; border-color: #68552d; background: #382e1b;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .customer-audience-warning { color: #f4ce82; }
html[data-dashboard-theme="dark"] body.dashboard-shell .table th.is-sortable .table-sort { color: inherit; }
html[data-dashboard-theme="dark"] body.dashboard-shell .table th.is-sortable .table-sort:hover,
html[data-dashboard-theme="dark"] body.dashboard-shell .table th[aria-sort] .table-sort { color: #aeb7ff; }

/* Dashboard overview. */
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-page {
  --dashboard-ink: #f1f4ff; --dashboard-indigo: #aeb6ff;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-welcome-copy > p { color: #aeb8cd; }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-welcome-copy > p strong { color: #e5e9f5; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-metric-card, .dashboard-section-card) {
  border-color: var(--border); background: var(--card); box-shadow: 0 14px 42px rgba(0, 0, 0, .18);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-metric-label, .dashboard-metric-detail, .dashboard-product-copy span, .dashboard-blog-copy span, .dashboard-pagination-summary, .dashboard-product-empty p) { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-copy > a, .dashboard-blog-copy > a, .dashboard-pagination-summary strong) { color: var(--text); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-row, .dashboard-blog-row, .dashboard-product-list, .dashboard-blog-list, .dashboard-pagination) { border-color: var(--border); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-more > summary, .dashboard-pagination-page, .dashboard-pagination-arrow, .dashboard-blog-view) {
  color: #c1c9dc; border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-more > summary:hover, .dashboard-pagination-page:hover, .dashboard-pagination-arrow:hover:not(:disabled), .dashboard-blog-view:hover) {
  color: #cbd1ff; border-color: #59658c; background: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-pagination-page.is-current { color: #fff; border-color: #5b68e3; background: #5b68e3; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-menu button:hover, .dashboard-quick-grid > a:hover) { color: #cbd1ff; background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-quick-grid > a { color: var(--text); border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-menu a, .dashboard-product-menu button:not(.is-danger)) { color: #d5daf0; }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-menu a:hover { color: #cbd1ff; background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-menu button.is-danger { color: #ff9b94; }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-menu button.is-danger:hover { background: #3b2024; }
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-tool { color: #c3cadb; background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-tool:hover { color: #cbd1ff; background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-remove:hover { color: #ff9b94; background: #3b2024; }
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-progress-track { background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-progress-track > span {
  background: #eef2ff; box-shadow: 0 0 10px rgba(238, 242, 255, .28);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.getting-started, .dashboard-product-empty) {
  border-color: #35405b; background: radial-gradient(circle at 92% -20%, rgba(129, 140, 248, .16), transparent 36%), linear-gradient(145deg, #171e2d, #121826);
  box-shadow: 0 14px 42px rgba(0, 0, 0, .2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-secondary-action {
  color: #d5daf0; border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-secondary-action:hover {
  color: #dfe3ff; border-color: #59658c; background: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-metric {
  border-color: var(--border); background: var(--card); box-shadow: 0 12px 34px rgba(0, 0, 0, .2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-metric > div span,
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-metric > small { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-metric::after { opacity: .16; }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-bento-card {
  border-color: var(--border); background: var(--card); box-shadow: 0 14px 42px rgba(0, 0, 0, .2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-row:hover, .dashboard-blog-row:hover) { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-kpis > span { background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-kpis strong { color: var(--text); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-card-link, .dashboard-product-edit, .dashboard-product-more > summary) {
  color: #c1c9dc; border-color: var(--border); background: var(--surface-2);
}
/* Après la règle ci-dessus, de même spécificité : sinon le survol ne change rien. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-card-link:hover, .dashboard-product-edit:hover, .dashboard-product-more > summary:hover, .dashboard-product-more[open] > summary) {
  color: #cbd1ff; border-color: #59658c; background: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-sort {
  color: #c1c9dc; border-color: var(--border); background-color: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-all-products-count { color: #cbd1ff; background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-search input {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-search input:focus {
  border-color: #59658c; background: var(--card); box-shadow: 0 0 0 3px rgba(129, 140, 248, .18);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-search-icon, .dashboard-product-search-clear, .dashboard-product-no-results) { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-search input::placeholder { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-product-search-clear:hover) { color: #cbd1ff; background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-product-no-results strong { color: var(--text); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-blog-nudge, .dashboard-order-insight, .dashboard-suggestion-unavailable) {
  color: var(--muted); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-order-insight strong, .dashboard-blog-nudge-link) { color: #d5dbea; }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-ai-card { background: var(--lumia-gradient); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-ai-copy p, .dashboard-ai-card > small, .dashboard-suggestion-head p) { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-suggestion-success { background: var(--green-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-suggestion-success strong { color: var(--green); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-suggestion-frame {
  filter: invert(1) hue-rotate(180deg);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.getting-started-step, a.getting-started-step:hover) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
/* Survol des étapes : à peine plus clair que la carte. Les règles claires des
   étapes terminées (fond #f3f3f5) sont plus spécifiques que :where(), d'où les
   sélecteurs complets ici. */
html[data-dashboard-theme="dark"] body.dashboard-shell a.getting-started-step:hover,
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-step-static:hover {
  border-color: #3b4763; background: var(--surface-hover); box-shadow: 0 12px 28px rgba(0, 0, 0, .28);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-step.is-complete {
  color: var(--muted); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell a.getting-started-step.is-complete:hover,
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-step-static.is-complete:hover {
  color: var(--muted); border-color: #3b4763; background: var(--surface-hover); box-shadow: none;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .getting-started-step::before {
  background: linear-gradient(115deg, transparent 30%, rgba(255, 255, 255, .06) 48%, transparent 66%);
}

/* Settings workspace and appearance. */
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-page {
  --settings-ink: #f0f3ff; --settings-subtle: #9ca7bc; --settings-line: #2d374a; --settings-soft: #1c2434;
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.settings-store-preview, .settings-sidebar .settings-search input, .settings-tab-icon, .settings-workspace .card, .settings-submit-bar) {
  color: var(--text); border-color: var(--border); background: var(--card);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-tabs .tab-btn { color: #aeb8cc; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-tabs .tab-btn:hover { color: #ccd2ff; background: #202940; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-tabs .tab-btn.active { color: #d7dcff; background: #283250; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-tab-copy small,
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-tabs .tab-btn.active .settings-tab-copy small { color: #909bb4; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-nav-label { color: #7f899e; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-store-context > span { color: #b6beff; background: #26304d; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.settings-workspace .toggle-field, .provider-row, .api-key-metadata > div, .team-permission-field) { border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-workspace .toggle-field:hover { border-color: #526083; background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-security-summary { color: #f2c777; background: #3a301c; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-security-summary.is-protected { color: var(--green); background: var(--green-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-theme-preview-system { background: #f6f7fb; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-workspace .settings-layout .card:not(.api-settings-hero):not(.blog-quick-card),
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-workspace > .tab-panel .card:not(.api-settings-hero):not(.blog-quick-card) {
  color: var(--text); border-color: var(--border); background: var(--card); box-shadow: 0 7px 24px rgba(0, 0, 0, .16);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-workspace :where(input[type='text'], input[type='email'], input[type='password'], input[type='url'], input[type='number'], select, textarea) {
  color: var(--text); border-color: var(--border); background: var(--card);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.adaptive-rounding-groups fieldset, .price-ending-option span, .redirect-url-input) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .redirect-url-base { border-color: var(--border); background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .integration-filter.is-active span { color: #c8cfff; background: #293250; }

/* Google Sheets panel. Its light-mode greens are hard-coded while the text
   inside follows the theme tokens, so dark mode rendered white on white. */
html[data-dashboard-theme="dark"] body.dashboard-shell .google-sheets-connection-summary {
  color: var(--text); border-color: #2c5b45; background: var(--green-bg);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.google-sheets-file-icon, .google-sheets-steps li > span) {
  color: var(--green); background: #1e4433;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .google-sheets-queue-note { color: #f0b429 !important; }

/* Sales, communication, marketing, gallery and editors. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.sales-tabs, .editor-section-tabs, .media-gallery-tabs, .communication-tabs) {
  border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.sales-tabs button, .editor-section-tabs button, .media-gallery-tabs button, .communication-tabs button) { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.sales-tabs button.active, .editor-section-tabs button.active, .media-gallery-tabs button.active, .communication-tabs button.active) {
  color: #d9ddff; background: #2a3451;
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(
  .sales-order-card, .sales-customer-card, .sales-review-card, .coupon-card,
  .upsell-card, .tracked-link-card, .collection-product-row,
  .question-item, .gallery-page-item, .gallery-picker-item,
  .subscriber-row, .integration-service-card[open]
) { color: var(--text); border-color: var(--border); background: var(--card); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.sales-order-card:hover, .sales-customer-card:hover, .subscriber-row:hover, .gallery-page-item:hover) { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.product-cover, .table-thumb.placeholder, .gallery-image-placeholder, .dashboard-product-thumb) { background-color: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.editor-toolbar, .editor-sidebar, .product-editor-nav, .article-writing-card, .collection-form-tabs) { border-color: var(--border); background-color: var(--card); }
/* Editor.js peint ses popovers (menu +, commandes /, réglages de bloc, barre
   de sélection) à partir de variables posées sur .ce-popover et
   .ce-inline-toolbar : les redéfinir suffit, et évite de colorer les
   enveloppes vides qui dessinaient un fond derrière le bouton +. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-popover, .ce-inline-toolbar) {
  --color-border: var(--border);
  --color-shadow: rgba(0, 0, 0, .55);
  --color-background: var(--se-surface);
  --color-text-primary: var(--text);
  --color-text-secondary: var(--muted);
  --color-border-icon: var(--border);
  --color-border-icon-disabled: var(--border);
  --color-text-icon-active: #aeb6ff;
  --color-background-icon-active: rgba(129, 140, 248, .2);
  --color-background-item-focus: rgba(129, 140, 248, .16);
  --color-shadow-item-focus: transparent;
  --color-background-item-hover: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-toolbar__plus, .ce-toolbar__settings-btn) {
  color: var(--muted); border-color: transparent; background-color: transparent; box-shadow: none;
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-toolbar__plus:hover, .ce-toolbar__plus--active, .ce-toolbar__settings-btn:hover, .ce-toolbar__settings-btn--active) {
  color: var(--text); background-color: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-conversion-toolbar, .codex-editor .cdx-search-field) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-popover-item:hover, .ce-inline-tool:hover, .ce-inline-toolbar__dropdown:hover, .cdx-settings-button:hover) { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-popover__nothing-found-message, .cdx-search-field__icon svg) { color: var(--muted); }
html[data-dashboard-theme="dark"] body.dashboard-shell .codex-editor .cdx-search-field__input,
html[data-dashboard-theme="dark"] body.dashboard-shell .ce-popover .cdx-search-field__input {
  border-color: transparent; background-color: transparent; box-shadow: none;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .ct::before,
html[data-dashboard-theme="dark"] body.dashboard-shell .ct::after { background-color: #2a3346; }
html[data-dashboard-theme="dark"] body.dashboard-shell .codex-editor ::selection { color: #fff; background-color: rgba(129, 140, 248, .42); }
html[data-dashboard-theme="dark"] body.dashboard-shell .codex-editor ::-moz-selection { color: #fff; background-color: rgba(129, 140, 248, .42); }
html[data-dashboard-theme="dark"] body.dashboard-shell .ce-block--selected .ce-block__content { background: rgba(129, 140, 248, .14); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.ce-paragraph, .ce-header, .cdx-input) { color: var(--text); }
html[data-dashboard-theme="dark"] body.dashboard-shell .cdx-input { border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.uppy-Dashboard-inner, .uppy-DashboardContent-bar, .uppy-Dashboard-AddFiles) { color: var(--text); border-color: var(--border); background: var(--card); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(
  .subscriber-source-choice, .subscriber-file-drop, .subscriber-file-name,
  .sales-import-history, .sales-import-history-list article,
  .sales-import-product-group, .sales-import-product-card,
  .sales-import-product-card > .sales-import-product-row,
  .sales-import-summary-grid article, .sales-import-advanced,
  .sales-import-order-meta div
) { color: var(--text); border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(
  .subscriber-preview-table th, .sales-import-product-group > header,
  .sales-import-variation-list
) { color: var(--muted); border-color: var(--border); background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .subscriber-source-brand { background: #fff; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.questions-intro, .questions-dependent-field, .questions-required) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .questions-intro-icon { background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .collection-form-tabs { background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .collection-form-tabs .editor-section-tab.active { color: var(--text); background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.product-type-lock, .checkout-add-choice) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.checkout-add-choice:hover) { background: var(--surface-hover); }

/* Builder chrome only. Preview canvases keep their own seller-site themes. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.builder-toolbar, .builder-sidebar, .builder-panel, .checkout-builder-toolbar, .checkout-builder-panel) {
  color: var(--text); border-color: var(--border); background: var(--card);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.builder-panel-head, .builder-sidebar-tabs, .checkout-layout-switch, .builder-add-menu, .block-settings-panel) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.builder-toolbar button:not(.btn-primary), .checkout-builder-toolbar button:not(.btn-primary), .builder-sidebar button:not(.btn-primary)) {
  color: var(--text); border-color: var(--border); background-color: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .builder-preview-devices .btn.is-active {
  color: #d9ddff; background-color: var(--surface-3);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .checkout-builder-preview-wrap { background: #111722; }
html[data-dashboard-theme="dark"] body.dashboard-shell .builder-preview-wrap {
  border-color: var(--border); background-color: #111722;
  background-image: linear-gradient(45deg, #1b2332 25%, transparent 25%, transparent 75%, #1b2332 75%), linear-gradient(45deg, #1b2332 25%, transparent 25%, transparent 75%, #1b2332 75%);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.publish-item:hover, .checkout-layout-switch button.is-active) {
  color: #d9ddff; border-color: #59658c; background: var(--surface-hover);
}

/* Live stats cards below the Analytics AI panel. */
html[data-dashboard-theme="dark"] body.dashboard-shell .live-stats-card-now .stat-value { color: #aeb7ff; }
/* L'éclat de mise à jour repart vers la surface sombre, pas vers le blanc. */
html[data-dashboard-theme="dark"] body.dashboard-shell .live-stats-card.is-live-updated {
  animation-name: live-stats-flash-dark;
}
@keyframes live-stats-flash-dark {
  0% { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 22%, var(--card)); }
  100% { border-color: var(--border); background: var(--card); }
}

/* Analytics surfaces and map controls. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.analytics-empty-notice, .analytics-ai-response, .analytics-ai-insight, .analytics-depth-body, .funnel-track) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .article-ai-launch-row {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.analytics-ai-summary, .analytics-ai-evidence, .analytics-ai-action p) { color: #b4bdd0; }
html[data-dashboard-theme="dark"] body.dashboard-shell .analytics-ai-insight { background: rgba(27, 35, 50, .9); }
html[data-dashboard-theme="dark"] body.dashboard-shell .analytics-ai-demo-badge { color: #ffd98a; background: #3a2f17; }
html[data-dashboard-theme="dark"] body.dashboard-shell .analytics-ai-card.is-open .analytics-ai-launch-row { border-bottom-color: var(--border); }
html[data-dashboard-theme="dark"] body.dashboard-shell .analytics-depth { background: linear-gradient(145deg, #171d2d, #131927); }
html[data-dashboard-theme="dark"] body.dashboard-shell .analytics-depth-body { border-color: var(--border); }
html[data-dashboard-theme="dark"] body.dashboard-shell .jvm-container { background-color: transparent; }
html[data-dashboard-theme="dark"] body.dashboard-shell .churn-at-risk .stat-value { color: #f7b27a; }
html[data-dashboard-theme="dark"] body.dashboard-shell .churn-split-involuntary { background: #a78bfa; }
html[data-dashboard-theme="dark"] body.dashboard-shell .jvm-tooltip { color: var(--text); border: 1px solid var(--border); background: var(--surface-3); }

/* Team tables, assistant and remaining panels. */
html[data-dashboard-theme="dark"] body.dashboard-shell .team-permission-matrix tbody th { color: var(--text); background: var(--card); }
html[data-dashboard-theme="dark"] body.dashboard-shell .team-permission-field.is-locked { background: #171d29; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.team-avatar, .team-store-mark) { color: #b8c0ff; background: #293250; }
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-chat { box-shadow: 0 30px 90px rgba(0, 0, 0, .52); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.lumia-panel, .lumia-typing, .lumia-action-card, .lumia-composer, .lumia-action-controls) {
  color: var(--text); border-color: var(--border); background: var(--card);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-message-assistant:not(.lumia-welcome) .lumia-message-content > p { box-shadow: none; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.lumia-body, .lumia-action-preview, .lumia-action-field) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.lumia-action-field, .lumia-composer) { box-shadow: none; }
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-voice-cancel:hover { color: #ffb4ab; background: rgba(229, 72, 77, .16); }
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-voice.is-error .lumia-voice-status { color: #ffb4ab; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.lumia-suggestion, .lumia-action-card button:not(.btn-primary)) { color: var(--text); border-color: var(--border); background: var(--surface-2); }

/* Preserve status meaning with dark, accessible tints. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.badge-green, .billing-status.is-active, .billing-payment-status.status-paid, .team-owner-label, .team-access-badge.is-full) { color: #79dfaa; background: #17382b; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.badge-yellow, .team-access-badge.is-view, .dashboard-notification-type-login) { color: #f1c979; background: #3a301c; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-notification-type, .team-access-badge.is-none) { color: #b7c0ff; background: #293250; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-notification-type-sale) { color: #79dfaa; background: #17382b; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-notification-type-security, .session-mark) { color: #a8b6ff; background: #232a49; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.session-row.is-current .session-mark) { color: #79dfaa; background: #17382b; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.dashboard-notification-type-account_warning, .dashboard-notification-item.is-warning) { color: #ffaaa4; background: #3b2024; }

@media (max-width: 1180px) {
  html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-nav-links {
    border-color: #303a50; background: rgba(18, 24, 37, .99); box-shadow: 0 25px 45px rgba(0, 0, 0, .42);
  }
  html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-nav-links > a:hover,
  html[data-dashboard-theme="dark"] body.dashboard-shell .dashboard-nav-links > a.active { color: #d7dcff; background: #252e48; }
}
@media (prefers-reduced-motion: reduce) {
  .dashboard-theme-option, .dashboard-theme-save-status.is-saving::before { transition: none; animation: none; }
}

/* ---------------------------------------------------------------------------
   Surfaces claires restées codées en dur. Les canevas d'aperçu (site, checkout,
   panier, cadeau, vignettes de blocs) gardent volontairement leur fond clair :
   ils rendent la boutique publique, pas le chrome du tableau de bord.
   --------------------------------------------------------------------------- */

/* Éditeur de produit : formulaire, types, bundles, redirections. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(
  .cover-preview, .advanced, .check-item:hover, .toggle-field,
  .redirect-rule-head, .redirect-empty, .redirect-flow-arrow small,
  .bundle-suggestion, .product-type-option.is-locked,
  .custom-domain-current, .list-editor-item, .block-item.block-fixed
) { color: var(--text); border-color: var(--border); background: var(--surface-2); }
/* Interrupteur des programmes Marketing : posé à plat dans sa section. */
html[data-dashboard-theme="dark"] body.dashboard-shell .program-switch.toggle-field { background: transparent; }
html[data-dashboard-theme="dark"] body.dashboard-shell .redirect-rule {
  border-color: var(--border); background: linear-gradient(145deg, var(--surface-2), var(--card));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .bundle-suggestion {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--border));
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary) 16%, var(--surface-2)), var(--surface-2));
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.redirect-empty-icon, .product-type-icon, .sales-import-product-count) {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface-3));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .bundle-product-option.is-selected {
  background: color-mix(in srgb, var(--primary) 14%, var(--card));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .bundle-product-media {
  background: color-mix(in srgb, var(--primary) 18%, var(--surface-3));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .save-status { color: var(--text); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .save-status.error { color: var(--red); background: var(--red-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.promo-code, .builder-rich-content code) { color: #dbe2ff; background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .license-editor-field :where(input, textarea) {
  color: var(--text); border-color: var(--border); background: var(--card);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .article-tag-chip {
  background: color-mix(in srgb, var(--tag-color) 22%, var(--surface-2));
}

/* Menus Editor.js posés au-dessus de l'éditeur de produit ou d'article. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.pe-picker, .pe-settings-btn:hover, .ai-block) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .pe-settings-summary {
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
  background: linear-gradient(135deg, color-mix(in srgb, var(--primary) 18%, var(--surface-2)), var(--card));
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.divider-settings-heading > svg, .divider-style-option.is-active) {
  background: color-mix(in srgb, var(--primary) 22%, var(--surface-3));
}

/* Website builder : recherche et onglets du sélecteur de blocs. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.add-menu-search, .add-menu-tabs) {
  color: var(--text); border-color: var(--border); background: var(--surface-3);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .add-menu-search:focus-within {
  border-color: var(--primary); background: var(--card);
}

/* Imports de ventes et d'abonnés. */
html[data-dashboard-theme="dark"] body.dashboard-shell .subscriber-file-drop { border-color: #4a5170; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.subscriber-file-drop:hover, .subscriber-file-drop.is-dragging, .subscriber-file-drop.has-file) {
  border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface-2));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-import-dialog .subscriber-import-progress {
  border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-import-dialog .subscriber-import-actions {
  background: color-mix(in srgb, var(--card) 97%, transparent); box-shadow: 0 -8px 20px rgba(0, 0, 0, .28);
}

/* Paramètres : sécurité, code PIN et raccourcis. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.settings-pin-digits input, .security-pin-digits input) {
  color: var(--text); border-color: var(--border); background: var(--surface-2);
}
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.settings-pin-digits input:focus, .security-pin-digits input:focus) {
  border-color: var(--primary); background: var(--surface-3);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .security-pin-digits.is-invalid input { border-color: #d3626f; background: #3b2024; }
html[data-dashboard-theme="dark"] body.dashboard-shell .settings-action-icon { color: #b8c0ff; background: #293250; }

/* Assistant Lumia : modale de quota (couleurs : jetons --lumia-* de style.css). */
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-live-badge { color: var(--green); border-color: var(--border); background: var(--green-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .lumia-quota-modal { box-shadow: 0 28px 80px rgba(0, 0, 0, .55); }

/* Boîte à outils de texte : la barre de sélection, ses menus et ses panneaux
   suivent le thème du tableau de bord. Les couches flottantes vivent sur
   <body>, donc les variables suffisent — pas besoin de dupliquer les règles. */
html[data-dashboard-theme="dark"] {
  --se-surface: #1a2130;
  --se-surface-soft: #232c3d;
  --se-border: #33405a;
  --se-text: #eef2ff;
  --se-muted: #9aa5bb;
  --se-shadow: 0 22px 52px -18px rgba(0, 0, 0, .72), 0 2px 10px rgba(0, 0, 0, .4);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .se-swatch--letter { background: var(--se-surface-soft); }
html[data-dashboard-theme="dark"] body.dashboard-shell .builder-rich-content mark { color: #1d1d2b; }
html[data-dashboard-theme="dark"] body.dashboard-shell .builder-rich-content code { background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .ce-toolbar__settings-btn svg { color: var(--muted); }

/* Marketing : liens suivis et cartes d'affiliés. Ces blocs figent des blancs
   et des dégradés clairs, invisibles en thème sombre. */
html[data-dashboard-theme="dark"] body.dashboard-shell .tracked-link-preview {
  border-color: #3a4463;
  background: linear-gradient(135deg, #1e2438, var(--surface-2));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .tracked-link-preview code { color: #c3c9ff; }

html[data-dashboard-theme="dark"] body.dashboard-shell .affiliate-card {
  box-shadow: 0 8px 22px rgba(0, 0, 0, .28);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .affiliate-card:hover {
  box-shadow: 0 14px 32px rgba(0, 0, 0, .4);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .affiliate-card.is-pending {
  background: linear-gradient(170deg, #1e2338, var(--card));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .alert-warning {
  background: #3a2b16;
  border-color: #6b5423;
  color: #f0c48a;
}

/* Sales : compteurs d'onglets, survol des lignes et encart de livraison des
   giveaways. Ces trois blocs figent des gris tres clairs. */
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-tab-count {
  background: var(--surface-3);
  color: #c4ccdd;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-tab.active .sales-tab-count {
  background: #29325a;
  color: #c3c9ff;
}
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-table tbody tr:hover td {
  background: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .giveaway-delivery-note {
  background: color-mix(in srgb, var(--primary) 10%, var(--surface-2));
  border-color: color-mix(in srgb, var(--primary) 30%, var(--border));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .giveaway-explainer li > span {
  background: #29325a;
}

/* Boutons « danger » : leur fond de base est le gris clair de .btn. */
html[data-dashboard-theme="dark"] body.dashboard-shell .btn-danger:not(.modal-actions .btn-danger) {
  color: var(--red); border-color: #6a3438; background-color: var(--red-bg);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .btn-danger:not(.modal-actions .btn-danger):hover {
  color: #ffb3ad; border-color: #86434a; background-color: #4a262b;
}

/* Éditeur de produit : fermeture de la pop-up de type de produit. */
html[data-dashboard-theme="dark"] body.dashboard-shell .product-type-modal-close:hover { color: var(--text); background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .product-type-lock { background: var(--surface-3); }

/* Communication : menu de ligne, fiche follower et import. */
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.follower-row-menu button:hover, .follower-row-menu button:focus-visible) {
  background: var(--surface-hover);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-row-menu .follower-menu-danger:hover { background: var(--red-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-state.is-active { color: var(--green); background: var(--green-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-state.is-blocked { color: var(--red); background: var(--red-bg); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-feedback:not(.is-error) { color: var(--green); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-advanced { border-color: var(--border); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-advanced.is-open { box-shadow: 0 12px 30px rgba(0, 0, 0, .28); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-manager-advanced-toggle:hover { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-advanced-toggle-icon { color: #c3c9ff; background: #29325a; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.follower-advanced-card) { border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-advanced-card.is-danger {
  border-color: #5a2e33; background: color-mix(in srgb, var(--red-bg) 55%, var(--surface-2));
}
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-advanced-icon { color: #c3c9ff; background: #29325a; }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-advanced-card.is-danger .follower-advanced-icon { color: var(--red); background: #4a262b; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.follower-duration-chips button) { color: var(--text); border-color: var(--border); background: var(--card); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-duration-chips button:hover { background: var(--surface-hover); }
html[data-dashboard-theme="dark"] body.dashboard-shell .follower-duration-chips button.is-active { color: #d9ddff; border-color: #59658c; background: #2a3451; }
html[data-dashboard-theme="dark"] body.dashboard-shell .subscriber-import-head { border-color: var(--border); background: color-mix(in srgb, var(--card) 96%, transparent); }
html[data-dashboard-theme="dark"] body.dashboard-shell .subscriber-import-progress i { color: var(--muted); border-color: var(--border); background: var(--surface-2); }
html[data-dashboard-theme="dark"] body.dashboard-shell .subscriber-import-progress span.active { color: #c3c9ff; background: #242c47; }
html[data-dashboard-theme="dark"] body.dashboard-shell :where(.subscriber-import-progress span.active i, .subscriber-import-progress span.complete i) {
  color: #fff; border-color: var(--primary-dark); background: var(--primary-dark);
}
html[data-dashboard-theme="dark"] body.dashboard-shell .sales-import-dialog .subscriber-import-progress { background: var(--surface-2); }

/* Image editor: the segmented crop-shape control keeps a raised active chip. */
html[data-dashboard-theme="dark"] body.dashboard-shell .image-editor-ratios button.is-active { background: var(--surface-3); }
html[data-dashboard-theme="dark"] body.dashboard-shell .image-editor-dialog { background: var(--surface-2); }
