:root { color-scheme: dark; }
:root[data-theme="light"] {
  color-scheme: light;
  --bg-app: #f7f7f7;
  --bg-sidebar: #ffffff;
  --bg-header: #ffffff;
  --bg-card: #ffffff;
  --bg-card-hover: #f5f5f5;
  --bg-icon-chip: #f0f0f0;
  --border-subtle: #eaeaea;
  --border-strong: #d9d9d9;
  --text-primary: #262626;
  --text-secondary: #525252;
  --text-muted: #737373;
  --accent: #f97316;
  --accent-soft: #fff3e8;
  --accent-border: #fb923c;
}
.header-actions { display: flex; align-items: center; gap: 8px; }
.theme-toggle { min-height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: 10px; background: var(--bg-card); color: var(--text-primary); font: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.theme-toggle:hover { background: var(--bg-card-hover); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.login-theme-toggle { position: fixed; top: 16px; right: 16px; z-index: 20; }
[data-theme="light"] .page-header { background: rgba(255,255,255,.94); }
[data-theme="light"] .brand-mark { background: var(--bg-icon-chip); }
[data-theme="light"] .placement-engagement { background: var(--bg-card); }
[data-theme="light"] .placement-conversation > header h3,
[data-theme="light"] .placement-comment-body strong,
[data-theme="light"] .placement-comment-composer b { color: var(--text-primary); }
[data-theme="light"] .placement-comment-body p { color: var(--text-secondary); }
[data-theme="light"] .placement-comment-composer { background: var(--bg-sidebar); }
[data-theme="light"] .placement-comment-composer p,
[data-theme="light"] .placement-conversation > header button { background: var(--bg-icon-chip); color: var(--text-secondary); }
[data-theme="light"] .placement-conversation > header button:hover { background: var(--bg-card-hover); }
[data-theme="light"] .placement-engagement-grid span { color: #15803d; }
[data-theme="light"] .settings-dropdown button,
[data-theme="light"] .settings-message.error,
[data-theme="light"] .narrative-execute-error { color: #b91c1c; }
[data-theme="light"] .submit { color: #fff; }

[data-theme="light"] :is(.header-nav, .nav-item.active, .settings-trigger, .theme-toggle, .logout) { background: var(--bg-card-hover); box-shadow: none; }
[data-theme="light"] :is(.narrative-stage, .narrative-setup, .narrative-compose, .settings-card, .ticket-list-card, .input-card, .report-form-card, .content-preview) { box-shadow: 0 2px 10px rgba(0,0,0,.025); }
[data-theme="light"] :is(.analyze-form input, .report-form input, .report-form select, .narrative-field input, .settings-card input, .field input, .narrative-comment-bubble, .narrative-caption, .narrative-platforms, .placement-comment-composer, .placement-comment-composer p) { background: var(--bg-card-hover); }
[data-theme="light"] :is(.narrative-objective, .narrative-account, .narrative-platform-option, .booster-action-card) { background: var(--bg-card); }
[data-theme="light"] :is(.narrative-objective, .narrative-account, .narrative-platform-option, .booster-action-card):hover { background: var(--bg-card-hover); }
[data-theme="light"] :is(.narrative-objective, .narrative-account, .narrative-platform-option, .booster-action-card).is-selected { background: var(--bg-card-hover); border-color: var(--accent-border); }
[data-theme="light"] :is(.narrative-eyebrow, .report-page-kicker, .narrative-platform-option.is-selected, .narrative-platform-benefits li::before, .narrative-comment-avatar, .narrative-ticket-caret, .recent-sidebar-toggle, .showcase h1 span, .eyebrow) { color: #b54708; }
[data-theme="light"] :is(.analyze-form button, .narrative-next, .settings-submit, .submit) { color: #fff; }
[data-theme="light"] :is(.analyze-form button, .narrative-next, .settings-submit):disabled { color: var(--text-muted); }
[data-theme="light"] .ticket-table .narrative-ticket-detail > td { background: var(--bg-card-hover); }

.theme-toggle { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; flex: none; }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-toggle .theme-moon, [data-theme="light"] .theme-toggle .theme-sun { display: none; }
[data-theme="light"] .theme-toggle .theme-moon { display: block; }

.theme-toggle, .theme-toggle:hover, [data-theme="light"] .theme-toggle { background: transparent; border: 0; box-shadow: none; }
.theme-toggle .theme-sun { color: #f5c542; }
.theme-toggle .theme-moon { color: #87909e; }
.theme-toggle:hover svg { opacity: .8; }
