:root { color-scheme: light; }
.theme-toggle { position:fixed; right:24px; bottom:calc(24px + env(safe-area-inset-bottom, 0px)); z-index:1200; display:inline-flex; align-items:center; justify-content:center; gap:.7rem; min-height:54px; padding:.85rem 1.25rem; border:2px solid #c8bdff; border-radius:99px; background:#5140a6; color:#fff; box-shadow:0 8px 28px rgba(30,20,70,.3); font:inherit; font-size:.95rem; font-weight:800; cursor:pointer; }
.theme-toggle i { font-size:1.15rem; }
.theme-toggle:hover { background:#403080; border-color:#e1daff; }
html[data-theme="dark"] .theme-toggle { background:#ddd5ff; color:#241b49; border-color:#a795ef; }
html[data-theme="dark"] .theme-toggle:hover { background:#eee9ff; }
.scroll-to-top { bottom:6.5rem; }
.theme-toggle:focus-visible { outline:3px solid var(--accent); outline-offset:3px; }
html[data-theme="dark"] { color-scheme:dark; --accent:#b3a5ff; --accent-dark:#c9bfff; --accent-soft:#302b49; --ink:#edf0f7; --muted:#b0b9cb; --canvas:#11151e; --panel:#1b2230; --border:#354055; --card-shadow:0 12px 32px rgba(0,0,0,.18); --card-shadow-hover:0 20px 42px rgba(0,0,0,.28); }
/* Match the base theme's two-ID wrapper selector so its white background cannot win. */
html[data-theme="dark"], html[data-theme="dark"] body, html[data-theme="dark"] #wrapper #content-wrapper { background:var(--canvas); color:var(--ink); }
html[data-theme="dark"] .topbar { background:rgba(27,34,48,.96) !important; border-color:var(--border); }
html[data-theme="dark"] .topbar:before { color:var(--ink); }
html[data-theme="dark"] #accordionSidebar { background:var(--panel); border-color:var(--border); }
html[data-theme="dark"] .analysis-intro { background:linear-gradient(118deg,#1b2230,#28253e); border-color:var(--border); }
html[data-theme="dark"] .analysis-form { background:#161d29; border-color:var(--border); }
html[data-theme="dark"] .analysis-form label { color:var(--ink); }
html[data-theme="dark"] .analysis-form .form-control { background:#111722; color:var(--ink); border-color:var(--border); }
html[data-theme="dark"] .form-control::placeholder { color:#9aa7bc; opacity:1; }
html[data-theme="dark"] .metric-card, html[data-theme="dark"] .chart-card, html[data-theme="dark"] .section-card, html[data-theme="dark"] .story-step, html[data-theme="dark"] .result-placeholder, html[data-theme="dark"] .maps-summary, html[data-theme="dark"] .social-accounts-table tbody tr { background:var(--panel); color:var(--ink); border-color:var(--border); }
html[data-theme="dark"] .card-header, html[data-theme="dark"] .analysis-results .card-header, html[data-theme="dark"] .analysis-results .row > [class*="col-"] { background:var(--panel); border-color:var(--border); }
html[data-theme="dark"] .social-platform, html[data-theme="dark"] .table { color:var(--ink); }
html[data-theme="dark"] .social-metrics > div, html[data-theme="dark"] .maps-review-count { background:#283246; color:var(--ink); }
html[data-theme="dark"] .social-metrics strong, html[data-theme="dark"] .social-accounts-table thead th, html[data-theme="dark"] .maps-business-address, html[data-theme="dark"] .metric-label, html[data-theme="dark"] .metric-meta { color:var(--muted); }
html[data-theme="dark"] .metric-icon, html[data-theme="dark"] .result-placeholder > i, html[data-theme="dark"] .platform-pill, html[data-theme="dark"] .profile-link { background:var(--accent-soft); color:var(--accent); border-color:var(--border); }
html[data-theme="dark"] .section-kicker, html[data-theme="dark"] .maps-open-link { color:var(--accent); }
html[data-theme="dark"] .story-block:before { color:#30394b; }
html[data-theme="dark"] .progress { background:#30394b; }
html[data-theme="dark"] .maps-rating-block, html[data-theme="dark"] .sticky-footer { border-color:var(--border); }
html[data-theme="dark"] .btn-accent { background:#7962db; border-color:#7962db; color:#fff; }
html[data-theme="dark"] .btn-accent:hover { background:#6953c7; border-color:#6953c7; }
html[data-theme="dark"] .analysis-status.is-error { color:#ffaaa4; }
html[data-theme="dark"] .analysis-status.is-success, html[data-theme="dark"] .metric-trend { color:#85d5ae; }
html[data-theme="dark"] a.text-primary, html[data-theme="dark"] .text-primary { color:var(--accent) !important; }
@media (max-width:575.98px) { .theme-toggle { right:16px; bottom:calc(16px + env(safe-area-inset-bottom, 0px)); min-height:50px; padding:.7rem 1rem; font-size:.88rem; } .topbar:before { font-size:.65rem; letter-spacing:.05em; } }
