html[data-theme="dark"] {
  color-scheme: dark;
  --dark: #e7edf0;
  --dark-2: #cbd5da;
  --bg: #11171b;
  --soft: #1a2227;
  --line: #39454c;
  --text: #e7edf0;
  --muted: #a4b0b7;
  --ui-border: #39454c;
}

html[data-theme="dark"] .admin-page {
  --admin-bg: #11171b;
  --admin-card: #1a2227;
  --admin-border: #39454c;
  --admin-text: #e7edf0;
  --admin-muted: #a4b0b7;
}

html[data-theme="dark"] body:not(.center) {
  background: #11171b !important;
  color: #e7edf0 !important;
}

html[data-theme="dark"] body:not(.center) :is(h1,h2,h3,h4,h5,h6,strong,label,legend) {
  color: #e7edf0;
}

html[data-theme="dark"] body:not(.center) :is(p,small,.field-hint,.settings-section-description,.settings-page-heading p) {
  color: #a4b0b7;
}

html[data-theme="dark"] .navbar:not(.admin-page .navbar),
html[data-theme="dark"] .admin-page .navbar {
  background: #151d22 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] .navbar .brand-name,
html[data-theme="dark"] .navbar .nav-links a,
html[data-theme="dark"] .navbar .nav-links a.logout {
  color: #d7e0e4 !important;
}

html[data-theme="dark"] .navbar .nav-links a:hover,
html[data-theme="dark"] .navbar .nav-links a.active,
html[data-theme="dark"] .navbar .nav-links a.settings-nav-button {
  background: #263138 !important;
  color: #fff !important;
  border-color: #46545c !important;
}

html[data-theme="dark"] .customer-profile-modal,
html[data-theme="dark"] .customer-profile-modal .customer-profile-details > div,
html[data-theme="dark"] .customer-profile-modal .customer-profile-heading,
html[data-theme="dark"] .customer-profile-modal .customer-profile-details,
html[data-theme="dark"] .customer-profile-modal .customer-profile-addresses,
html[data-theme="dark"] .customer-profile-modal .customer-profile-avatar {
  background-color: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] .customer-profile-modal .customer-profile-heading h2,
html[data-theme="dark"] .customer-profile-modal .customer-profile-heading p,
html[data-theme="dark"] .customer-profile-modal .customer-profile-details dt,
html[data-theme="dark"] .customer-profile-modal .customer-profile-details dd,
html[data-theme="dark"] .customer-profile-modal .customer-profile-addresses p,
html[data-theme="dark"] .customer-profile-modal .customer-profile-avatar span {
  color: #e7edf0 !important;
}

html[data-theme="dark"] .customer-profile-modal .customer-profile-details dt {
  color: #a4b0b7 !important;
}

html[data-theme="dark"] .customer-profile-modal .customer-profile-avatar {
  background: #263138 !important;
  border: 1px solid #39454c !important;
}

html[data-theme="dark"] :is(
  .card,.profile-card,.settings-section,.settings-sidebar,.settings-security-page,
  .settings-account-subsection,.security-card,.dashboard-card,.dashboard-top-card,
  .inventory-item,.inventory-header,.policy-card,.product-card,.order-card,
  .cart-items-section,.cart-summary,.tx-stat-card,.tx-table-card,
  .conversation-card,.chat-panel,.chat-sidebar,.chat-input-area,
  .design-sidebar-panel,.design-preview-panel,.design-card,.auth-panel,.login-card,
  .modal-content,.settings-account-information,.settings-profile-overview,
  .settings-form-row,.settings-contact-row,.settings-password-status
) {
  background-color: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
  box-shadow: none;
}

html[data-theme="dark"] :is(
  .daily-income-board,.recent-orders-board,.analytics-kpi,.analytics-panel,
  .analytics-more,.material-kpis article,.material-table-wrap,.shared-stock-chip,
  .recovery-request-row,.store-filter-panel,.store-empty-state,.customer-card
) {
  background-color: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
  box-shadow: none;
}

html[data-theme="dark"] .admin-page :is(
  .dashboard-card,.daily-income-board,.recent-orders-board,.analytics-kpi,
  .analytics-panel,.analytics-more,.table-tools,.inventory-item,.order-card,
  .tx-stat-card,.tx-table-card,.material-kpis article,.material-table-wrap,
  .shared-stock-chip,.recovery-request-row,.order-items,.daily-income-total,
  .daily-income-track,.daily-income-stats>div,.search-bar
) {
  background-color: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
  box-shadow: none;
}

html[data-theme="dark"] .admin-page.admin-dashboard main.container :is(.dashboard-summary-grid,.dashboard-pipeline-grid) .dashboard-card {
  background: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] .admin-page.admin-dashboard main.container :is(.dashboard-summary-grid,.dashboard-pipeline-grid) .dashboard-card strong {
  color: #e7edf0 !important;
}

html[data-theme="dark"] .admin-page :is(
  .dashboard-card-label,.analytics-kpi span,.analytics-kpi small,
  .analytics-panel-heading p,.daily-income-heading p,.daily-income-total>span,
  .daily-income-trend-heading,.daily-income-day-value,.daily-income-day-label,
  .daily-income-stats span,.admin-section-title span,.recent-order-main span,
  .recent-order-row>span,.inventory-item p,.material-kpis span,.material-table td
) {
  color: #a4b0b7 !important;
}

html[data-theme="dark"] .admin-page :is(
  .daily-income-total,.daily-income-track,.order-items,.search-bar,
  .analytics-more>summary:before,.material-table th,.material-local-notice,
  .shared-stock-chip,.material-form-grid input,.material-form-grid select,
  .bulk-request-form input,.bulk-request-form select,.bulk-request-form textarea
) {
  background-color: #202a30 !important;
  border-color: #39454c !important;
  color: #d7e0e4 !important;
}

html[data-theme="dark"] .admin-page :is(.dashboard-card strong,.daily-income-total>strong,.material-kpis strong) {
  color: #e7edf0 !important;
}

html[data-theme="dark"] .admin-page :is(.daily-income-stats,.recent-order-row,.order-action) {
  border-color: #39454c !important;
}

html[data-theme="dark"] :is(
  .product-grid,.product-card.product-list-row,.cart-item-card,.order-details,
  .customer-order-details,.order-design-assets,.order-detail-grid>div,
  .tx-expanded>div,.settings-account-subsection,.settings-profile-overview,
  .settings-account-information,.settings-form-row,.settings-contact-row,
  .settings-page-heading,.settings-section,.settings-nav-group
) {
  border-color: #39454c !important;
}

html[data-theme="dark"] :is(input,select,textarea,.search-box input,.chat-input-area textarea) {
  background-color: #11171b !important;
  color: #e7edf0 !important;
  border-color: #46545c !important;
}

html[data-theme="dark"] :is(input,textarea)::placeholder {
  color: #87959d !important;
}

html[data-theme="dark"] :is(input,select,textarea):focus {
  border-color: #d98250 !important;
  box-shadow: 0 0 0 3px rgba(217,130,80,.2) !important;
}

html[data-theme="dark"] :is(th,.tx-table-header,.table-tools,.selected-address-preview,.order-detail-grid>div,.tx-expanded>div) {
  background-color: #202a30 !important;
  color: #d7e0e4 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] :is(td,.tx-table-row,.customer-order-mini,.login-session-record,.security-activity-row,.customer-order-section-heading) {
  color: #d7e0e4 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] :is(.settings-nav-group a,.settings-sidebar nav a,.settings-contact-current,.settings-verification,.settings-profile-overview-copy>span,.login-session-record p,.login-session-record-heading strong,.security-activity-row strong) {
  color: #c5d0d5 !important;
}

html[data-theme="dark"] :is(.settings-nav-group a:hover,.settings-nav-group a:focus-visible,.settings-nav-group a[aria-current="page"],.settings-sidebar nav a:hover) {
  background: #2a2522 !important;
  color: #ffb182 !important;
  border-left-color: #e87942 !important;
}

html[data-theme="dark"] :is(.secondary-btn,.edit-profile-btn,.change-password-btn,.settings-inline-action,.settings-photo-action) {
  background-color: #202a30 !important;
  color: #e7edf0 !important;
  border-color: #46545c !important;
}

html[data-theme="dark"] .studio-page .inspector-order {
  background: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] .studio-page .inspector-order-price span,
html[data-theme="dark"] .studio-page .inspector-order-price strong,
html[data-theme="dark"] .studio-page .studio-terms {
  color: #e7edf0 !important;
}

html[data-theme="dark"] .studio-page .studio-terms input {
  accent-color: #e87942;
}

html[data-theme="dark"] .studio-page .secondary-btn {
  background: #202a30 !important;
  color: #e7edf0 !important;
  border-color: #46545c !important;
}

html[data-theme="dark"] :is(.primary-btn,.checkout-btn,.add-to-cart-btn,.settings-save-button) {
  background-color: #d9652b !important;
  color: #fff !important;
  border-color: #d9652b !important;
}

html[data-theme="dark"] :is(.modal,.system-help-modal,.help-modal) {
  background-color: rgba(0,0,0,.72) !important;
}

html[data-theme="dark"] :is(.modal-content,.system-help-card,.help-modal-content) {
  background-color: #1a2227 !important;
  color: #e7edf0 !important;
  border-color: #39454c !important;
}

html[data-theme="dark"] .settings-page-heading .settings-eyebrow,
html[data-theme="dark"] .settings-overview-kicker,
html[data-theme="dark"] .settings-account-information>h3 {
  color: #d99570 !important;
}

html[data-theme="dark"] .settings-profile-avatar {
  background: #263138 !important;
  color: #e7edf0 !important;
  border-color: #46545c !important;
}

html[data-theme="dark"] .jams-theme-toggle {
  border-color: #46545c;
  background: #202a30;
  color: #e7edf0;
}

html[data-theme="dark"] .jams-theme-toggle:hover {
  background: #2a363e;
}

html[data-theme="dark"] .theme-switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}

.theme-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.theme-switch-track {
  position: relative;
  display: block;
  width: 44px;
  height: 26px;
  border: 1px solid #aeb8bf;
  border-radius: 20px;
  background: #e8edf0;
  transition: background-color .18s ease, border-color .18s ease;
}

.theme-switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  content: "";
  transition: transform .18s ease;
}

.theme-switch input:checked + .theme-switch-track {
  background: #d9652b;
  border-color: #d9652b;
}

.theme-switch input:checked + .theme-switch-track::after {
  transform: translateX(18px);
}

.theme-switch input:focus-visible + .theme-switch-track {
  outline: 3px solid rgba(217,101,43,.35);
  outline-offset: 2px;
}

html[data-theme="dark"] .theme-switch-track {
  background: #354149;
  border-color: #596971;
}

html[data-theme="dark"] .theme-switch input:checked + .theme-switch-track {
  background: #d9652b;
  border-color: #d9652b;
}

/* Atelier tokens also cover the newly unified component surfaces. */
html[data-theme="dark"] {
 --lux-bg: #171916; --lux-bg-strong: #252720; --lux-panel: #22251f;
 --lux-surface: #22251f; --lux-surface-alt: #2a2d26; --lux-line: #3c4036;
 --lux-line-strong: #575c4e; --lux-ink: #efeee7; --lux-text: #efeee7; --lux-muted: #b5b7aa;
 --lux-accent: #c5b496; --lux-accent-strong: #d7be94; --lux-orange-strong: #edaa7d;
 --surface-page: #171916; --surface-card: #22251f; --surface-border: #3c4036;
 --text: #efeee7; --muted: #b5b7aa; --bg: #171916; --line: #3c4036; --soft: #2a2d26;
 --store-paper: #171916; --store-panel: #22251f; --store-ink: #efeee7; --store-muted: #b5b7aa; --store-line: #3c4036;
}
html[data-theme="dark"] .workspace-kicker { color: #b5b7aa; border-color: #3c4036; }
html[data-theme="dark"] .workspace-kicker > span:first-child { color: #edaa7d; }
html[data-theme="dark"] body:not(.admin-page) .navbar .nav-links > a.active { color: #ffc294 !important; background: #49392c !important; }
html[data-theme="dark"] :is(.storefront-page .store-hero,.storefront-page .store-process,.help-center-contact,.help-center-question,.daily-income-board,.recent-orders-board,.chat-sidebar,.chat-panel) { background: #22251f !important; border-color: #3c4036 !important; color: #efeee7; }
html[data-theme="dark"] body.help-center-page .help-center-question summary { color: var(--lux-text, #efeee7) !important; }
html[data-theme="dark"] body.help-center-page .help-center-question p { color: var(--lux-muted, #b5b7aa) !important; }
html[data-theme="dark"] .storefront-page .store-hero { --hero-blend-base: #22251f; --hero-blend-paper: #383a32; }
html[data-theme="dark"] .storefront-page .store-hero-copy > p { color: #b5b7aa; }
html[data-theme="dark"] .storefront-page .store-hero h1 em { color: #edaa7d; }
html[data-theme="dark"] body.admin-page :is(th,.tx-table-header) { background: #2a2d26; color: #b5b7aa; }
html[data-theme="dark"] body.admin-page tbody tr:hover { background: #2a2d26; }
html[data-theme="dark"] body.auth-page.center { background: radial-gradient(ellipse at top,#3d3b30,transparent 60%),#171916; color: #efeee7; }
html[data-theme="dark"] .auth-page :is(.auth-panel,.email-action-shell) { background: #22251f; color: #efeee7; }
html[data-theme="dark"] .auth-page :is(.auth-intro h1,.email-action-shell h1,.auth-field > span:first-child) { color: #efeee7; }
html[data-theme="dark"] .auth-page :is(.auth-subtitle,.auth-footer) { color: #b5b7aa; }
html[data-theme="dark"] .auth-page :is(.auth-field input,.auth-google-button) { background: #171916; border-color: #575c4e; color: #efeee7; }
html[data-theme="dark"] .auth-page .auth-kicker { color: #edaa7d; }
html[data-theme="dark"] .studio-page .editor-stage { background: radial-gradient(ellipse at 50% 34%,#44463d,#262921); border-color: #575c4e; }
html[data-theme="dark"] .studio-page :is(.side-tab,.mode-btn).active { background: #49392c; color: #ffc294; border-color: #8b6144; }
html[data-theme="dark"] .studio-page .design-policy-notice { background: #353025; border-color: #675639; }
html[data-theme="dark"] body.admin-page .chat-messages { background: #171916; }

html[data-theme="dark"] .auth-page :is(.auth-muted-link,.auth-footer a) { color: #edaa7d; }
html[data-theme="dark"] .auth-page .password-toggle { background: #2a2d26; color: #ddd9cf; border-color: #575c4e; }
html[data-theme="dark"] .storefront-page :is(.store-eyebrow,.store-art-label) { color: #e0b391; }

html[data-theme="dark"] .studio-page { --studio-bg: #171916; --panel-bg: #22251f; --panel-soft: #2a2d26; --line-strong: #575c4e; --template-bg: #262921; }
html[data-theme="dark"] .studio-page .studio-top { background: rgb(23 25 22 / 97%); border-color: #3c4036; }
html[data-theme="dark"] .studio-page :is(.design-policy-copy,.design-policy-copy strong,.design-policy-dismiss) { color: #e6cfab; }
html[data-theme="dark"] .studio-page :is(.tool-btn,.mode-btn,.side-tab,.mini-btn,.studio-close-btn,.canvas-toolbar-mode,.editor-hint,.layer-header,.layer-item) { background-color: #2a2d26; color: #dfe1d7; border-color: #575c4e; }
html[data-theme="dark"] .studio-page :is(.side-tab,.mode-btn).active { background-color: #49392c; color: #ffc294; }
html[data-theme="dark"] .studio-page :is(.tool-section-title,.editor-hint strong) { color: #c5b496; }

/* Editorial theme keeps sections open in dark mode as well. */
html[data-theme="dark"] body.editorial-ui :is(.settings-account-subsection,.settings-form-row,.settings-contact-row,.settings-profile-overview,.settings-account-information,.inventory-header,.dashboard-top-card) { background: transparent !important; box-shadow: none !important; }
html[data-theme="dark"] body.editorial-ui.admin-page.admin-dashboard main.container :is(.dashboard-summary-grid,.dashboard-pipeline-grid) .dashboard-card { background: transparent !important; }
html[data-theme="dark"] body.editorial-ui.admin-page :is(.daily-income-total,.shared-stock-chip,.daily-income-stats>div) { background: transparent !important; }
html[data-theme="dark"] body.editorial-ui .navbar .nav-links a.active { background: transparent !important; color: #edaa7d !important; }
html[data-theme="dark"] body.editorial-ui .editorial-section-index { color: #edaa7d; }
html[data-theme="dark"] body.editorial-ui.auth-page .auth-panel { background: var(--bg) !important; }
html[data-theme="dark"] body.editorial-ui.auth-page .auth-editorial-copy > p { color: #fffaf2; }
html[data-theme="dark"] body.editorial-ui.auth-page .auth-editorial-copy em { color: #e5ad83; }
html[data-theme="dark"] body.editorial-ui.email-action-page .email-action-shell { background: transparent !important; }
html[data-theme="dark"] body.editorial-ui.studio-page :is(.studio-top,.studio-inspector,.ai-panel,.preview-panel,.studio-tools) { background: var(--bg); }
html[data-theme="dark"] body.editorial-ui.studio-page .editor-stage { background: radial-gradient(ellipse,#383c31,#24281f); }

/* Low light depth uses the same grouped surfaces as the light theme. */
html[data-theme="dark"] {
 --depth-surface: var(--surface-card);
 --depth-line: #3a4035;
 --depth-soft: 0 1px 2px rgb(0 0 0 / 15%), 0 12px 30px -20px rgb(0 0 0 / 45%);
 --depth-raised: 0 2px 5px -2px rgb(0 0 0 / 20%), 0 22px 48px -28px rgb(0 0 0 / 55%);
 --depth-control: inset 0 1px 2px rgb(0 0 0 / 10%), 0 1px 0 rgb(255 255 255 / 3%);
 --depth-page-wash: radial-gradient(ellipse at 10% 0, rgb(183 165 140 / 4%), transparent 50%);
}
html[data-theme="dark"] body.editorial-ui.cart-page .cart-summary,
html[data-theme="dark"] body.editorial-ui .bulk-workspace > .bulk-order-summary,
html[data-theme="dark"] body.editorial-ui.account-page .settings-sidebar,
html[data-theme="dark"] body.editorial-ui.account-page .settings-content > .settings-section,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-card,
html[data-theme="dark"] body.editorial-ui main.container > .policy-card {
 background: var(--depth-surface) !important; border-color: var(--depth-line) !important; box-shadow: var(--depth-soft) !important;
}
html[data-theme="dark"] body.editorial-ui .bulk-design-options { background: var(--depth-surface); border-color: var(--depth-line); }
html[data-theme="dark"] body.editorial-ui .bulk-design-option.active { background: var(--soft); color: var(--lux-orange-strong); }

/* Deep graphite palette with warm atelier accents and clear text contrast. */
html[data-theme="dark"] {
  color-scheme: dark;
  --lux-bg: #0b0d10;
  --lux-bg-strong: #12151a;
  --lux-panel: #171a20;
  --lux-surface: #1b1f26;
  --lux-surface-alt: #222730;
  --lux-line: #343b46;
  --lux-line-strong: #4a5360;
  --lux-ink: #f3f1ec;
  --lux-text: #e8e7e3;
  --lux-muted: #a7afb9;
  --lux-accent: #d3b28e;
  --lux-accent-strong: #e2c39f;
  --lux-orange: #e47b45;
  --lux-orange-strong: #f1a576;
  --lux-success: #74c69d;
  --lux-warning: #e6bd70;
  --lux-error: #f08a82;
  --bg: var(--lux-bg);
  --soft: var(--lux-surface-alt);
  --line: var(--lux-line);
  --text: var(--lux-text);
  --muted: var(--lux-muted);
  --ui-border: var(--lux-line);
  --dark: var(--lux-ink);
  --dark-2: #c9cbd0;
  --orange: var(--lux-orange);
  --orange-2: #bd5830;
  --surface-page: var(--lux-bg);
  --surface-card: var(--lux-panel);
  --surface-border: var(--lux-line);
  --surface-shadow: 0 18px 42px -24px rgb(0 0 0 / 88%), 0 4px 14px rgb(0 0 0 / 38%);
  --surface-shadow-raised: 0 34px 80px -30px rgb(0 0 0 / 96%), 0 12px 30px -18px rgb(0 0 0 / 75%);
  --depth-surface: var(--lux-panel);
  --depth-line: #303741;
  --depth-soft: 0 12px 28px -16px rgb(0 0 0 / 80%), 0 3px 8px rgb(0 0 0 / 35%);
  --depth-raised: 0 28px 64px -26px rgb(0 0 0 / 94%), 0 8px 20px -12px rgb(0 0 0 / 72%);
  --depth-control: inset 0 1px 2px rgb(0 0 0 / 38%), 0 1px 0 rgb(255 255 255 / 5%);
  --depth-page-wash: radial-gradient(ellipse at 50% -18%, rgb(196 126 80 / 12%), transparent 58%);
  --lux-shadow-soft: var(--depth-soft);
  --lux-shadow-card: var(--surface-shadow);
  --lux-shadow-lift: var(--surface-shadow-raised);
  --shadow: var(--surface-shadow);
  --shadow-sm: var(--depth-soft);
  --store-paper: var(--lux-bg);
  --store-panel: var(--lux-panel);
  --store-ink: var(--lux-ink);
  --store-muted: var(--lux-muted);
  --store-line: var(--lux-line);
}

html[data-theme="dark"] body,
html[data-theme="dark"] body:not(.center) {
  background-color: var(--lux-bg) !important;
  background-image: var(--depth-page-wash) !important;
  color: var(--lux-text) !important;
}

html[data-theme="dark"] body :is(h1, h2, h3, h4, h5, h6, strong, legend) {
  color: var(--lux-ink);
}

html[data-theme="dark"] body :is(p, small, .field-hint, .muted, .settings-section-description, .settings-page-heading p) {
  color: var(--lux-muted);
}

html[data-theme="dark"] body :is(label, .field-label, .control-label) {
  color: #d7dbe0;
}

html[data-theme="dark"] body a:not(.primary-btn):not(.checkout-btn):not(.add-to-cart-btn) {
  color: var(--lux-orange-strong);
}

html[data-theme="dark"] :is(
  .card, .profile-card, .settings-section, .settings-sidebar, .settings-security-page,
  .settings-account-subsection, .security-card, .dashboard-card, .dashboard-top-card,
  .inventory-item, .inventory-header, .policy-card, .product-card, .order-card,
  .cart-items-section, .cart-summary, .tx-stat-card, .tx-table-card,
  .conversation-card, .chat-panel, .chat-sidebar, .chat-input-area,
  .design-sidebar-panel, .design-preview-panel, .design-card, .auth-panel, .login-card,
  .modal-content, .settings-account-information, .settings-profile-overview,
  .settings-form-row, .settings-contact-row, .settings-password-status,
  .daily-income-board, .recent-orders-board, .analytics-kpi, .analytics-panel,
  .analytics-more, .material-kpis article, .material-table-wrap,
  .shared-stock-chip, .recovery-request-row, .store-filter-panel,
  .store-empty-state, .customer-card, .help-center-contact, .help-center-question
) {
  background-color: var(--lux-panel) !important;
  color: var(--lux-text) !important;
  border-color: var(--lux-line) !important;
  box-shadow: var(--surface-shadow) !important;
}

html[data-theme="dark"] :is(
  input, select, textarea, .search-box input, .chat-input-area textarea,
  .material-form-grid input, .material-form-grid select,
  .bulk-request-form input, .bulk-request-form select, .bulk-request-form textarea
) {
  background-color: #101318 !important;
  color: var(--lux-ink) !important;
  border-color: var(--lux-line-strong) !important;
  box-shadow: var(--depth-control);
}

html[data-theme="dark"] :is(input, textarea)::placeholder {
  color: #929ba6 !important;
}

html[data-theme="dark"] :is(input, select, textarea):focus {
  border-color: var(--lux-orange) !important;
  box-shadow: 0 0 0 3px rgb(228 123 69 / 22%), 0 8px 24px -12px rgb(0 0 0 / 90%) !important;
}

html[data-theme="dark"] :is(
  th, .tx-table-header, .table-tools, .selected-address-preview,
  .order-detail-grid > div, .tx-expanded > div
) {
  background-color: #20252d !important;
  color: #dce0e5 !important;
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] :is(
  td, .tx-table-row, .customer-order-mini, .login-session-record,
  .security-activity-row, .customer-order-section-heading
) {
  color: #d5d9de !important;
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] .navbar,
html[data-theme="dark"] .admin-page .navbar {
  background: rgb(16 19 24 / 94%) !important;
  border-color: var(--lux-line) !important;
  box-shadow: 0 16px 38px -24px rgb(0 0 0 / 95%), 0 3px 10px rgb(0 0 0 / 48%) !important;
  backdrop-filter: blur(18px);
}

html[data-theme="dark"] .navbar :is(.brand-name, .nav-links a, .nav-links a.logout) {
  color: #d8dce1 !important;
}

html[data-theme="dark"] .navbar .nav-links a.active,
html[data-theme="dark"] .navbar .nav-links a:hover,
html[data-theme="dark"] .navbar .nav-links a.settings-nav-button {
  color: #ffc294 !important;
}

html[data-theme="dark"] :is(.primary-btn, .checkout-btn, .add-to-cart-btn, .settings-save-button) {
  background: linear-gradient(145deg, #ed8950, #c45b33) !important;
  color: #fffaf5 !important;
  border-color: #ee9868 !important;
  box-shadow: 0 10px 24px -12px rgb(228 123 69 / 72%), 0 5px 14px -10px rgb(0 0 0 / 90%) !important;
}

html[data-theme="dark"] :is(.secondary-btn, .edit-profile-btn, .change-password-btn, .settings-inline-action, .settings-photo-action) {
  background: #222730 !important;
  color: #e6e8eb !important;
  border-color: #48515d !important;
  box-shadow: 0 8px 18px -14px rgb(0 0 0 / 92%) !important;
}

html[data-theme="dark"] :is(.modal, .system-help-modal, .help-modal) {
  background: rgb(3 5 8 / 78%) !important;
  backdrop-filter: blur(8px);
}

html[data-theme="dark"] :is(.modal-content, .system-help-card, .help-modal-content) {
  background: #191d23 !important;
  color: var(--lux-text) !important;
  border-color: var(--lux-line-strong) !important;
  box-shadow: 0 36px 100px -28px rgb(0 0 0 / 98%), 0 12px 32px -18px rgb(0 0 0 / 88%) !important;
}

html[data-theme="dark"] body.auth-page.center {
  background:
    radial-gradient(ellipse at 50% -12%, rgb(196 126 80 / 16%), transparent 48%),
    linear-gradient(155deg, #101318, #080a0d 72%) !important;
  color: var(--lux-text) !important;
}

html[data-theme="dark"] .auth-page :is(.auth-panel, .email-action-shell) {
  background: #171a20 !important;
  color: var(--lux-text) !important;
  border-color: var(--lux-line) !important;
  box-shadow: 0 36px 90px -38px rgb(0 0 0 / 98%), 0 12px 36px -24px rgb(0 0 0 / 88%) !important;
}

html[data-theme="dark"] .auth-page :is(.auth-intro h1, .email-action-shell h1, .auth-field > span:first-child) {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page {
  --studio-bg: #0b0d10;
  --panel-bg: #171a20;
  --panel-soft: #222730;
  --line-strong: #4a5360;
  --template-bg: #14171c;
}

html[data-theme="dark"] .studio-page :is(.studio-top, .studio-inspector, .ai-panel, .preview-panel, .studio-tools) {
  background: rgb(18 21 26 / 96%) !important;
  border-color: var(--lux-line) !important;
  box-shadow: var(--surface-shadow) !important;
}

html[data-theme="dark"] .studio-page .editor-stage {
  background: radial-gradient(ellipse at 50% 32%, #31343b 0, #1a1d23 48%, #101216 100%) !important;
  border-color: #4a5360 !important;
  box-shadow: inset 0 2px 18px rgb(0 0 0 / 58%), 0 24px 54px -30px rgb(0 0 0 / 95%) !important;
}

html[data-theme="dark"] .studio-page #dropZone[data-side]::after {
  background:
    linear-gradient(#101216, #101216) left top / var(--focus-gutter) 100% no-repeat,
    linear-gradient(#101216, #101216) right top / var(--focus-gutter) 100% no-repeat;
}

html[data-theme="dark"] .studio-page :is(.product-meta, .product-fabric-note, .editor-hint) {
  color: var(--lux-muted) !important;
}

html[data-theme="dark"] .studio-page .product-meta {
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] .studio-page .product-fabric-note {
  background: var(--lux-surface-alt) !important;
  border-left-color: var(--lux-orange) !important;
  color: var(--lux-muted) !important;
}

html[data-theme="dark"] .studio-page .product-meta :is(strong, span),
html[data-theme="dark"] .studio-page .product-fabric-note strong {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page .help-modal .help-card {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
  box-shadow: var(--surface-shadow-raised) !important;
}

html[data-theme="dark"] .studio-page .help-card :is(h2, .eyebrow, .help-step b) {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page .help-card p {
  color: var(--lux-muted) !important;
}

html[data-theme="dark"] .studio-page .help-step {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line) !important;
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page .help-card .icon-button {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page .system-help-card {
  background: var(--lux-panel) !important;
  border: 1px solid var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
  box-shadow: var(--surface-shadow-raised) !important;
}

html[data-theme="dark"] .studio-page .system-help-head h2,
html[data-theme="dark"] .studio-page .system-help-head .eyebrow,
html[data-theme="dark"] .studio-page .system-help-grid b {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page .system-help-head p,
html[data-theme="dark"] .studio-page .system-help-grid p {
  color: var(--lux-muted) !important;
}

html[data-theme="dark"] .studio-page .system-help-grid > div {
  display: flex;
  min-height: 84px;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  box-sizing: border-box;
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] .studio-page .system-help-grid b {
  margin-bottom: 0;
}

html[data-theme="dark"] .studio-page .system-help-close {
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
  cursor: pointer;
}

html[data-theme="dark"] #systemTutorialModal .system-help-card {
  background-color: #171a20 !important;
  border-color: #4a5360 !important;
  color: #f3f1ec !important;
}

html[data-theme="dark"] #systemTutorialModal .system-help-head h2,
html[data-theme="dark"] #systemTutorialModal .system-help-grid b {
  color: #f3f1ec !important;
}

html[data-theme="dark"] #systemTutorialModal .system-help-head p,
html[data-theme="dark"] #systemTutorialModal .system-help-grid p {
  color: #a7afb9 !important;
}

html[data-theme="dark"] #systemTutorialModal .system-help-grid > div {
  background-color: #222730 !important;
  border-color: #343b46 !important;
}

html[data-theme="dark"] #systemTutorialModal .system-help-close {
  position: relative;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  background-color: #222730 !important;
  border-color: #4a5360 !important;
  color: #f3f1ec !important;
  font-size: 0 !important;
}

html[data-theme="dark"] #systemTutorialModal .system-help-close::before {
  content: "×";
  color: #f3f1ec;
  font-size: 1.4rem;
  line-height: 1;
}

html[data-theme="dark"] .studio-page .editor-hint {
  background: rgb(18 21 26 / 94%) !important;
  border-color: var(--lux-line-strong) !important;
}

html[data-theme="dark"] .studio-page .editor-stage.edit-mode .preview-badge {
  background: #222730 !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page #livePreviewSection {
  background: rgb(18 21 26 / 98%) !important;
  border-color: var(--lux-line-strong) !important;
  box-shadow: var(--surface-shadow-raised) !important;
  color: var(--lux-ink);
}

html[data-theme="dark"] .studio-page #livePreviewSection .studio-live-preview-heading :is(span, strong) {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page #livePreviewSection .studio-live-preview-heading::after {
  color: var(--lux-muted);
}

html[data-theme="dark"] .studio-page #livePreviewSection .studio-live-preview-heading button {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .studio-page #livePreviewSection .preview-3d {
  background: radial-gradient(ellipse at 50% 38%, #343943 0, #1b1f26 70%, #12151a 100%) !important;
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] .studio-page #livePreviewSection :is(.preview-badge, .preview-tip) {
  background: rgb(18 21 26 / 92%);
  border-color: var(--lux-line-strong);
  color: var(--lux-ink);
}

html[data-theme="dark"] .orders-page .customer-order-group {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line) !important;
  color: var(--lux-ink);
  box-shadow: var(--depth-soft) !important;
}

html[data-theme="dark"] .orders-page .customer-order-group:hover {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line-strong) !important;
  box-shadow: var(--depth-raised) !important;
}

html[data-theme="dark"] .orders-page .customer-order-summary {
  border-color: var(--lux-line) !important;
}

html[data-theme="dark"] .orders-page .customer-order-summary-toggle {
  background: transparent !important;
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .orders-page .customer-order-summary-toggle:hover {
  background: var(--lux-surface-alt) !important;
}

html[data-theme="dark"] .orders-page :is(.customer-order-name, .customer-order-latest, .customer-order-latest strong) {
  color: var(--lux-ink) !important;
}

html[data-theme="dark"] .orders-page :is(.customer-order-meta, .customer-order-side-row) {
  color: var(--lux-muted) !important;
}

html[data-theme="dark"] .jams-theme-toggle {
  background: #1b1f26 !important;
  color: #f1c59f !important;
  border-color: #515a66 !important;
  box-shadow: 0 14px 34px -16px rgb(0 0 0 / 92%), 0 4px 12px rgb(0 0 0 / 48%) !important;
}

html[data-theme="dark"] .storefront-page .store-support .support-form {
  background: var(--lux-panel, #171a20) !important;
  color: var(--lux-ink, #f3f1ec) !important;
  border-color: var(--lux-line-strong, #46505d) !important;
  box-shadow: var(--depth-soft) !important;
}

html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info {
  background: var(--lux-panel) !important;
  color: var(--lux-ink) !important;
  border-color: var(--lux-line) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page :is(.customer-info-heading,.customer-info-list>div) {
  border-color: var(--lux-line) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info-title strong,
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info-list dd {
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page :is(.customer-info-title small,.customer-info-list dt,.customer-info-empty) {
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info-icon {
  background: #35261f !important;
  color: #ffb182 !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info-toggle {
  background: var(--lux-surface-alt) !important;
  color: var(--lux-ink) !important;
  border-color: var(--lux-line-strong) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .customer-info-toggle:hover {
  background: #35261f !important;
  color: #ffb182 !important;
  border-color: #9c5e3d !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-chat-card {
  background: var(--lux-panel) !important;
  color: var(--lux-ink) !important;
  border-color: var(--lux-line-strong) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-chat-card>strong {
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-chat-card :is(p,small,figcaption) {
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-chat-card a:not(.panel-action) {
  color: #ffb182 !important;
}
html[data-theme="dark"] body.editorial-ui.account-page #passwordSettings .settings-password-status {
  padding-inline: 18px;
  border: 1px solid var(--lux-line);
  border-radius: 6px;
}

html[data-theme="dark"] .storefront-page .store-support .support-form :is(input, textarea) {
  background: #101318 !important;
  color: var(--lux-ink, #f3f1ec) !important;
  border-color: var(--lux-line-strong, #46505d) !important;
}

html[data-theme="dark"] .storefront-page .store-support .support-form :is(input, textarea)::placeholder {
  color: #a7afb9;
  opacity: 1;
}

html[data-theme="dark"] .storefront-page .store-support .support-form :is(input, textarea):focus-visible {
  outline: 2px solid #f29a67;
  outline-offset: 2px;
}

html[data-theme="dark"] .storefront-page .store-support .support-form input[readonly] {
  background: var(--lux-surface-alt) !important;
  color: var(--lux-ink) !important;
  border-color: var(--lux-line-strong) !important;
}

html[data-theme="dark"] .storefront-page .store-support .support-form-note {
  color: var(--lux-muted) !important;
}

/* Admin support dialogs and multi-design summaries need their own dark surfaces. */
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-modal .confirm-card {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
  box-shadow: var(--surface-shadow-raised) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-card :is(h2, label, strong) {
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-card :is(p, small, .field-hint) {
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-card .bulk-quote-design-breakdown {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-card .bulk-quote-design-breakdown :is(strong, p) {
  color: var(--lux-ink) !important;
  border-color: var(--lux-line) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .confirm-card .panel-action {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-design-variant-card {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-design-variant-card .bulk-design-thumbnail {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line-strong) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-design-variant-card .bulk-design-description :is(strong, span) {
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-design-variant-card .bulk-design-description small {
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.editorial-ui.admin-page.support-desk-page .chat-messages .bulk-design-description .bulk-design-product-name {
  color: var(--lux-ink) !important;
}

/* Customer chat shares the same readable surfaces for request and quote cards. */
html[data-theme="dark"] body.help-center-page :is(.bulk-chat-card, .bulk-customer-design-variant, .bulk-customer-design-gallery figure, .bulk-payment-actions) {
  background: var(--lux-panel) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-chat-card :is(strong, p, small, figcaption) {
  color: var(--lux-muted) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-chat-card > strong,
html[data-theme="dark"] body.help-center-page .bulk-customer-design-variant :is(strong, .bulk-customer-product-name) {
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-customer-design-variant,
html[data-theme="dark"] body.help-center-page .bulk-customer-design-gallery,
html[data-theme="dark"] body.help-center-page .bulk-payment-actions {
  border-color: var(--lux-line) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-customer-design-gallery img,
html[data-theme="dark"] body.help-center-page .bulk-customer-design-variant img {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-quote-actions .attach-chat-btn,
html[data-theme="dark"] body.help-center-page .bulk-payment-actions button {
  background: var(--lux-surface-alt) !important;
  border-color: var(--lux-line-strong) !important;
  color: var(--lux-ink) !important;
}
html[data-theme="dark"] body.help-center-page .bulk-quote-status {
  background: #35261f !important;
  color: #ffc294 !important;
}
/* Match the editorial studio's light-mode layout; theme changes only surfaces. */
html[data-theme="dark"] body.editorial-ui.studio-page {
  background: var(--lux-bg) !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(.studio-top,.studio-inspector,.studio-tools,.preview-panel,.ai-panel,.design-policy-notice) {
  background: transparent !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(.inspector-content,.product-meta,.layer-panel,.layer-header,.inspector-order) {
  background: transparent !important;
  box-shadow: none !important;
  border-color: var(--line) !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(.tool-btn,.studio-close-btn,.side-tab,.mode-btn) {
  background: transparent;
  color: var(--text);
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(.side-tabs,.canvas-toolbar-mode) {
  background: #1b1e23;
  border-color: var(--line);
  box-shadow: none;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(.side-tab,.mode-btn).active {
  background: #272b32;
  color: var(--text);
  box-shadow: inset 0 -2px var(--lux-orange);
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(#btnUpload,.primary-btn) {
  background: #30343a !important;
  color: #f4f4f5 !important;
  border-color: #464b54 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page :is(#btnUpload,.primary-btn):hover {
  background: #3b4048 !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .secondary-btn {
  background: transparent !important;
  border-color: #464b54 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .tool-icon {
  background: #242830;
  color: var(--lux-orange);
}
html[data-theme="dark"] body.editorial-ui.studio-page .product-fabric-note {
  background: transparent !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .design-policy-notice {
  border-left-color: var(--lux-orange);
}
html[data-theme="dark"] body.editorial-ui.studio-page #livePreviewSection {
  background: var(--bg) !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .editor-stage {
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page #activeSideLabel {
  background: #242830;
  color: var(--muted);
}
/* Keep the floating zoom/download toolbar legible on the dark canvas. */
html[data-theme="dark"] body.editorial-ui.studio-page .editor-bottom {
  background: #1b1e23;
  color: #f1f3f5;
  border-color: #464b54;
  box-shadow: 0 6px 20px rgb(0 0 0 / 28%);
}
html[data-theme="dark"] body.editorial-ui.studio-page .editor-bottom :is(.mini-btn,.secondary-btn,#zoomChip) {
  background: transparent !important;
  color: #f1f3f5 !important;
  border-color: #515965 !important;
  box-shadow: none !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .editor-bottom :is(.mini-btn,.secondary-btn):hover:not(:disabled) {
  background: #303640 !important;
}
html[data-theme="dark"] body.editorial-ui.studio-page .editor-bottom :is(.mini-btn,.secondary-btn):focus-visible {
  outline: 2px solid #f1a576;
  outline-offset: 2px;
}
html[data-theme="dark"] body.editorial-ui.studio-page .editor-bottom button:disabled {
  color: #a7afb9 !important;
  opacity: 1;
}

html[data-theme="dark"] body.editorial-ui.studio-page .studio-top {
  background: #050607 !important;
  border-bottom: 1px solid rgb(255 255 255 / 9%) !important;
  box-shadow: 0 10px 28px rgb(0 0 0 / 42%), 0 1px 0 rgb(255 255 255 / 4%) !important;
}

/* Keep the storefront product and size-guide dialogs readable in dark mode. */
html[data-theme="dark"] body.storefront-page #productModal .modal-content {
  background: #191d23 !important;
  color: #edf0f2 !important;
  border-color: #424a55 !important;
}

html[data-theme="dark"] body.storefront-page #productModal :is(.modal-title, .modal-price, .modal-description) {
  color: #edf0f2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-price {
  color: #f0a173 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-image {
  background-color: #242932 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .product-fabric-note {
  background: #242932 !important;
  border-left-color: #e77b49 !important;
  color: #c5cbd2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .product-fabric-note strong,
html[data-theme="dark"] body.storefront-page #productModal .option-label {
  color: #edf0f2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .size-help-text {
  color: #b9c0c9 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-size-row {
  background: #222730 !important;
  border-color: #424a55 !important;
  color: #edf0f2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-size-row :is(strong, span) {
  color: #edf0f2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-size-row span {
  color: #aeb7c2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .modal-size-qty {
  background: #101318 !important;
  color: #f3f4f6 !important;
  border-color: #56606c !important;
}

html[data-theme="dark"] body.storefront-page #productModal .stock-availability {
  color: #75d5a2 !important;
}

html[data-theme="dark"] body.storefront-page #productModal .size-guide-trigger {
  background: #222730 !important;
  color: #edf0f2 !important;
  border-color: #56606c !important;
}

html[data-theme="dark"] body.storefront-page #productModal .size-guide-trigger:hover {
  background: #303640 !important;
}

html[data-theme="dark"] body.storefront-page :is(#productModal, #sizeGuideModal) .modal-close {
  position: sticky !important;
  top: 10px;
  z-index: 30;
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  margin: -10px 0 -44px auto;
  padding: 0;
  border: 1px solid #f2a274 !important;
  border-radius: 50% !important;
  background: #bf4f24 !important;
  color: #fff !important;
  font-size: 1.65rem;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 6px 18px rgb(0 0 0 / 48%);
  cursor: pointer;
}

html[data-theme="dark"] body.storefront-page :is(#productModal, #sizeGuideModal) .modal-close:hover {
  background: #df6b38 !important;
}

html[data-theme="dark"] body.storefront-page :is(#productModal, #sizeGuideModal) .modal-close:focus-visible,
html[data-theme="dark"] body.storefront-page #productModal .size-guide-trigger:focus-visible {
  outline: 3px solid #ffd0af !important;
  outline-offset: 3px;
}

html[data-theme="dark"] body.storefront-page #sizeGuideModal .size-guide-content {
  background: #191d23 !important;
  color: #edf0f2 !important;
  border: 1px solid #424a55;
}

html[data-theme="dark"] body.storefront-page #sizeGuideModal .size-guide-content h2 {
  color: #edf0f2 !important;
}

/* Customer order details need their own dark surfaces, not the light defaults. */
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-expanded-details {
  border-color: var(--depth-line) !important;
}

html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-detail-panel,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-items-detail {
  border-color: var(--depth-line) !important;
  background: var(--depth-surface) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-detail-panel h4,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-items-detail h4,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-items-detail li > strong,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-detail-panel dd {
  color: var(--text) !important;
}

html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-detail-panel dt,
html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-items-detail li > span {
  color: var(--muted) !important;
}

html[data-theme="dark"] body.editorial-ui .my-orders-page .my-order-items-detail li {
  border-color: var(--depth-line) !important;
}

html[data-theme="dark"] body.editorial-ui.admin-page .order-row-disclosure[open] > summary {
  background: var(--depth-surface, var(--surface-card)) !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
  box-shadow: none !important;
}

html[data-theme="dark"] body.editorial-ui.auth-page .auth-form .auth-forgot-password {
  color: var(--lux-orange-strong) !important;
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--lux-orange-strong) 65%, transparent);
  text-underline-offset: 3px;
}

html[data-theme="dark"] body.editorial-ui.auth-page .auth-divider > span {
  background: var(--lux-panel, #171a20) !important;
  color: var(--lux-muted, #a7afb9) !important;
}

/* Transaction rows use a white light-theme fill when opened or hovered. */
html[data-theme="dark"] body.editorial-ui.admin-page .tx-record {
  border-color: var(--depth-line) !important;
}

html[data-theme="dark"] body.editorial-ui.admin-page .tx-record > .tx-table-row {
  background: transparent !important;
  color: var(--text) !important;
  border-color: var(--line) !important;
}

html[data-theme="dark"] body.editorial-ui.admin-page .tx-record[open] > .tx-table-row {
  background: var(--depth-surface, var(--surface-card)) !important;
}

/* Keep elevated content dark on hover; older light-theme selectors set white fills. */
@media (hover: hover) {
  html[data-theme="dark"] body.editorial-ui :is(
    .customer-order-group:hover,
    .customer-order-summary-toggle:hover,
    .order-row-disclosure > summary:hover,
    .order-row-disclosure[open] > summary:hover,
    .tx-record:hover > .tx-table-row,
    .tx-record[open] > .tx-table-row:hover,
    .order-card:hover,
    .inventory-item:hover,
    .customer-list-row:hover,
    .dashboard-recent-row:hover,
    .analytics-kpi:hover,
    .conversation-card:hover,
    .store-product-card:hover,
    .product-card:hover,
    .bulk-product-choice:hover,
    .design-card:hover,
    .my-order-card:hover,
    .cart-item-card:hover
  ) {
    background: var(--depth-surface, var(--surface-card)) !important;
    color: var(--text) !important;
    box-shadow: var(--depth-raised, var(--depth-soft)) !important;
  }

  html[data-theme="dark"] body.editorial-ui .order-row-disclosure > summary:hover {
    border-radius: 4px;
  }
}
