/* Appearance changes only: the light palette remains the default. */
:root { color-scheme:light; }
:root[data-theme="dark"] {
  color-scheme:dark;
  --bg:#101722;
  --surface:#182333;
  --ink:#e3eaf4;
  --muted:#a3b1c4;
  --primary:#a8bfdc;
  --primary-hover:#bfd0e7;
  --primary-fill:#3c6190;
  --line:#2a384c;
  --soft:#24354f;
  --subtle-bg:#141e2c;
  --sidebar-bg:#141e2c;
  --selected-bg:#24354f;
  --count-bg:#304666;
  --muted-light:#8b9cb3;
  --ink-secondary:#c3d0e2;
  --chart-secondary:#6685ad;
  --focus-ring:#81a5d7;
  --success:#86bba4;
  --action-error:#efa38f;
  --action-error-bg:#3a2828;
  --scrollbar-thumb:#45556b;
  --scrollbar-thumb-hover:#687d99;
}

.account-menu .appearance-menu-item { border-top:1px solid var(--line);border-radius:0;margin-top:4px;padding-top:14px; }
.appearance-menu-item>span:first-of-type { flex:1; }
.appearance-switch { position:relative;display:inline-block;width:30px;height:18px;flex:0 0 30px;border-radius:12px;background:var(--line); }
.appearance-switch::after { content:'';position:absolute;width:12px;height:12px;top:3px;left:3px;border-radius:50%;background:var(--surface);transition:transform .15s; }
[aria-checked="true"] .appearance-switch { background:var(--primary); }
[aria-checked="true"] .appearance-switch::after { transform:translateX(12px);background:var(--bg); }
@media(prefers-reduced-motion:reduce){.appearance-switch::after{transition:none}}

/* Bright text and a separate filled-action tone keep both contrast levels clear. */
[data-theme="dark"] .btn.primary { background:var(--primary-fill);border-color:var(--primary-fill);color:#f4f7fc; }
[data-theme="dark"] .btn.primary:hover { background:#4b73a6;border-color:#4b73a6; }
[data-theme="dark"] .btn.primary:disabled { opacity:.5; }
[data-theme="dark"] .avatar { border-color:var(--surface); }
[data-theme="dark"] .brand-symbol { content:url('/brand-monogram-dark.svg'); }
[data-theme="dark"] .brand-name { color:#eef2f8; }
[data-theme="dark"] .account-menu,[data-theme="dark"] .system-select-menu { box-shadow:0 12px 32px #0005,0 2px 6px #0003; }
[data-theme="dark"] .scrim { background:#030813a6; }
[data-theme="dark"] .sidebar.mobile-open+.sidebar-backdrop { background:#030813a6; }
[data-theme="dark"] .drawer { box-shadow:-10px 0 50px #0005; }
[data-theme="dark"] .badge.pause,[data-theme="dark"] .badge.review,[data-theme="dark"] .rec-icon.pause { background:#332d23;color:#dbc08f;border-color:#53462e; }
[data-theme="dark"] .badge.media,[data-theme="dark"] .rec-icon.media { background:#2c2840;color:#beb0d9;border-color:#403650; }
[data-theme="dark"] .badge.green,[data-theme="dark"] .tracking-status.is-ready { background:#203b31;color:var(--success);border-color:#355745; }
[data-theme="dark"] .badge.error,[data-theme="dark"] .queue-error { background:var(--action-error-bg);color:var(--action-error);border-color:#62403a; }
[data-theme="dark"] .history-icon.failed,[data-theme="dark"] .alert { background:#332d23;color:#dbc08f;border-color:#53462e; }
[data-theme="dark"] .form-error,[data-theme="dark"] .offer-field-error { color:var(--action-error); }
[data-theme="dark"] .error-text { color:var(--action-error)!important; }
[data-theme="dark"] .offer-form [aria-invalid="true"] { border-color:var(--action-error); }
[data-theme="dark"] .integration-logo { background:var(--soft);color:var(--primary); }
[data-theme="dark"] .integration-logo.shopify { background:#293b28;color:#afca7b; }
[data-theme="dark"] .campaign-status-switch { background:#4b5666; }
[data-theme="dark"] .campaign-status-switch[aria-checked="true"] { background:var(--primary-fill); }
[data-theme="dark"] .product-image-main,[data-theme="dark"] .product-image-remove { background:var(--surface); }
[data-theme="dark"] .product-image-add { border-color:var(--line); }
[data-theme="dark"] .product-image-add:hover { border-color:var(--primary); }
[data-theme="dark"] #business-setup { --nb-fill:var(--primary-fill);--nb-on:#f4f7fc;--nb-green-bg:#203b31;--nb-error:var(--action-error); }
[data-theme="dark"] #business-setup .nb-primary:hover { background:#4b73a6;border-color:#4b73a6; }
[data-theme="dark"] .tracking-drawer [aria-invalid=true] { border-color:var(--action-error); }
