/* Dark appearance: semantic states and contrast follow the same workspace. */
.theme-toggle { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:38px; padding:8px 11px; border:1px solid var(--line); border-radius:6px; color:var(--text); background:var(--surface); font-size:11px; font-weight:550; white-space:nowrap; }
.theme-toggle > span:first-child { font-size:17px; line-height:1; }
.auth-page > .theme-toggle { position:absolute; top:22px; right:24px; }
:root[data-theme="dark"] {
 --bg:#111821; --surface:#18222f; --surface-2:#233042; --line:#354459;
 --text:#e9eff7; --muted:#afbdce; --teal:#9abfe9; --purple:#a6b4c8;
 --danger:#ffa0aa; --warning:#efc78a; --shadow:0 2px 8px #0002;
 color-scheme:dark;
}
[data-theme="dark"] body,[data-theme="dark"] .auth-page { background:var(--bg); color:var(--text); }
[data-theme="dark"] .workspace-app .topbar,[data-theme="dark"] .workspace-app .tabs { background:#15202c; }
[data-theme="dark"] .brand-mark { background:#365779; color:#f4f8ff; }
[data-theme="dark"] .tab.active { background:#263b53; color:#c3ddfa; box-shadow:inset 3px 0 #a3c4ed; }
[data-theme="dark"] .tab:hover { background:#243346; color:#d6e6fa; }
[data-theme="dark"] .tab-count { background:#2c425c; color:#e0edfe; }
[data-theme="dark"] .section-card,[data-theme="dark"] .metric-card,[data-theme="dark"] .table-card,[data-theme="dark"] .form-card,[data-theme="dark"] .integration-card,[data-theme="dark"] .column-picker,[data-theme="dark"] .financial-details,[data-theme="dark"] .saved-funnel,[data-theme="dark"] .funnel-builder,[data-theme="dark"] .template-card,
[data-theme="dark"] .plain-result,[data-theme="dark"] .plain-result[data-result="negative"],[data-theme="dark"] .plain-result[data-result="attention"],[data-theme="dark"] .analysis-scope,[data-theme="dark"] .future-card,[data-theme="dark"] .financial-details-heading,[data-theme="dark"] .metric-card.featured,[data-theme="dark"] .metric-card.featured[data-result="negative"],
[data-theme="dark"] .onboarding-strip,[data-theme="dark"] .dictionary-card,[data-theme="dark"] .workspace-item,[data-theme="dark"] .workspace-item.active,[data-theme="dark"] .decision-alert,[data-theme="dark"] .feedback-admin-item,[data-theme="dark"] .auth-card {
 background:var(--surface); border-color:var(--line);
}
[data-theme="dark"] input,[data-theme="dark"] select,[data-theme="dark"] textarea,[data-theme="dark"] .auth-card input,[data-theme="dark"] .account-settings-row select,[data-theme="dark"] .feedback-dialog select,[data-theme="dark"] .feedback-dialog textarea,[data-theme="dark"] .admin-actions select,[data-theme="dark"] #adminCustomers select,[data-theme="dark"] .feedback-admin-item select {
 background:#15202c; color:var(--text); border-color:#4a5b72; color-scheme:dark;
}
[data-theme="dark"] input::placeholder,[data-theme="dark"] textarea::placeholder { color:#9cacc0; }
[data-theme="dark"] .button-primary { background:#426fa2; color:#fff; }
[data-theme="dark"] .button-primary:hover { background:#4d7eb4; }
[data-theme="dark"] .button-secondary,[data-theme="dark"] .user-menu-button,[data-theme="dark"] .question-options button { background:#213045; color:var(--text); border-color:#475b75; }
[data-theme="dark"] .theme-toggle { background:#263b53; border-color:#7495bb; color:#e0edff; }
[data-theme="dark"] .text-button,[data-theme="dark"] .analysis-evidence summary,[data-theme="dark"] .auth-text-button,[data-theme="dark"] .consent-check a,[data-theme="dark"] .legal-card a { color:#b3d3fb; }
[data-theme="dark"] .data-condition,[data-theme="dark"] .analysis-answer,[data-theme="dark"] .simple-decision,[data-theme="dark"] .plain-result[data-result="negative"] .simple-decision,[data-theme="dark"] .plain-result[data-result="attention"] .simple-decision,
[data-theme="dark"] .onboarding-steps button,[data-theme="dark"] .recommended-history,[data-theme="dark"] .credential-path,[data-theme="dark"] .platform-purpose,[data-theme="dark"] .hotmart-difference,[data-theme="dark"] .webhook-box,[data-theme="dark"] .fee-policy,[data-theme="dark"] .scope-note,[data-theme="dark"] .cost-rule-note,[data-theme="dark"] .tab-guide,
[data-theme="dark"] .funnel > div,[data-theme="dark"] .funnel-progress button,[data-theme="dark"] .funnel-wizard-panel,[data-theme="dark"] .funnel-step-row,[data-theme="dark"] .plan-options article,[data-theme="dark"] .admin-summary article,[data-theme="dark"] .dialog-block,[data-theme="dark"] .auth-tabs {
 background:#202d3d; border-color:var(--line);
}
[data-theme="dark"] .workspace-switcher select { background:#233247; color:var(--text); }
[data-theme="dark"] .data-condition { border-left-color:#7f9cbd; }
[data-theme="dark"] .data-condition summary { color:#e0e9f6; }
[data-theme="dark"] .analysis-label { color:#adc1d9; }
[data-theme="dark"] .analysis-context { border-left-color:#7b99bc; }
[data-theme="dark"] .info-button { color:#c1d8f4; border-color:#7690af; }
[data-theme="dark"] .question-options button[aria-pressed="true"] { color:#fff; background:#426fa2; border-color:#7ba0ca; }
[data-theme="dark"] .source-badge,[data-theme="dark"] .plain-result-badge,[data-theme="dark"] .status-chip,[data-theme="dark"] .recommended-badge { background:#273a50; color:#c6dcf6; border-color:#4a6280; }
[data-theme="dark"] .money-flow .money-result > strong,[data-theme="dark"] .plain-result[data-result="positive"] .money-result strong,[data-theme="dark"] .metric-card.featured strong,[data-theme="dark"] .positive,[data-theme="dark"] .positive-text,[data-theme="dark"] .calculation .total { color:#80dab6; }
[data-theme="dark"] .plain-result[data-result="negative"] .money-result > strong,[data-theme="dark"] .metric-card.featured[data-result="negative"] strong { color:#ffa0aa; }
[data-theme="dark"] .plain-result[data-result="attention"] .money-result > strong { color:#efc78a; }
[data-theme="dark"] .plain-result[data-result="positive"] .plain-result-badge,[data-theme="dark"] .status-chip.positive,[data-theme="dark"] .access-pill,[data-theme="dark"] .access-pill.active { background:#1c3c34; color:#9ae0c3; border-color:#3e6d5d; }
[data-theme="dark"] .plain-result[data-result="negative"] .plain-result-badge,[data-theme="dark"] .access-pill.blocked { background:#452934; color:#ffb9c2; border-color:#79515f; }
[data-theme="dark"] .plain-result[data-result="attention"] .plain-result-badge { background:#403624; color:#f6d9a8; border-color:#796747; }
[data-theme="dark"] .simple-order-math > span,[data-theme="dark"] .plain-explanation { background:transparent; }
[data-theme="dark"] .beta-advanced > summary { color:#b3d3fb; }
[data-theme="dark"] .bar.revenue,[data-theme="dark"] .chart-legend span::before { background:#8fb4d9; }
[data-theme="dark"] .bar.spend,[data-theme="dark"] .chart-legend span:last-child::before { background:#526c88; }
[data-theme="dark"] th { background:#253447; color:#d2e0f0; }
[data-theme="dark"] .table-info { color:#d2e0f0; }
[data-theme="dark"] .table-scroll { scrollbar-color:#59718d #18222f; }
[data-theme="dark"] .direct-connect-box,[data-theme="dark"] .plan-options article.recommended,[data-theme="dark"] .plan-banner { background:#23364b; border-color:#547294; }
[data-theme="dark"] .feedback-launcher,[data-theme="dark"] .decision-alert i { background:#24364c; color:#d3e5fd; border-color:#6b87a8; }
[data-theme="dark"] dialog,[data-theme="dark"] .plan-dialog,[data-theme="dark"] .feedback-dialog { background:#18222f; color:var(--text); border-color:#4a5e76; }
[data-theme="dark"] dialog::backdrop { background:#050a12bd; }
[data-theme="dark"] .auth-tabs button.active { background:#344d6a; color:#fff; }
[data-theme="dark"] .plan-card > strong { color:#b3d3fb; }
[data-theme="dark"] .toast { color:#fff; background:#34567f; border-color:#6385ae; }
[data-theme="dark"] .data-warning,[data-theme="dark"] .auth-notice { background:#3c3323; color:#efdaad; border-color:#796747; }
[data-theme="dark"] .auth-notice strong { color:#efdaad; }
@media(max-width:900px){[data-theme="dark"] .tab.active{box-shadow:inset 0 -2px #a3c4ed;}}
@media(max-width:560px){.auth-page > .theme-toggle{top:14px;right:14px;}.auth-page .auth-shell{padding-top:72px;}.top-actions .theme-toggle{min-height:38px;}}
[data-theme="dark"] .goal-badge[data-reached="true"] { color:#a3e2c8; background:#1c3c34; border-color:#477561; }
@media(min-width:901px) and (max-width:1200px){.top-actions #masterShortcut,.top-actions #accountShortcut{display:none;}}
.goal-plan-link { margin-top:16px; }
