/* Modo oscuro: paleta y superficies. Los colores políticos permanecen intactos. */
html[data-theme="dark"] { color-scheme: dark; --ink:#e5edf8; --muted:#afbdd0; --paper:#0d1625; --line:#34445c; --white:#1a293d; --accent:#7898ff; background:var(--paper); }
.theme-toggle [data-theme-icon]{font-size:21px;line-height:1;width:19px;text-align:center}
html[data-theme="dark"] body {color:var(--ink)}
html[data-theme="dark"] :is(.sidebar,.shell-navigation){background:#0b1422}
html[data-theme="dark"] :is(.topbar,.interface-context){background:#142236;border-color:#304057;color:#b7c5d8}
html[data-theme="dark"] .interface-context strong{color:#e0eaff}
html[data-theme="dark"] :is(.v3-home-start,.v3-home-scenarios,.v3-library-list,.editor-toolbar,.editor-jump,.panel,.v3-card,.v3-ready-section,.v3-summary-card,.v3-ready-overview,.operation-card,.operation-resource,.operation-shortcuts button,.operation-extra details,.v3-debate-player,.v3-debate-card,.v3-debate-result,.v3-debate-guide,.v3-debate-quick,.government-content .political-card,.government-content .government-rating-card,.government-content .cabinet-editor,.government-content .territorial-coalitions,.government-content .territorial-coalition-editor,.government-content .national-local-effects,.government-content .v3-territorial-results,.government-content .parliament-panel,.v3-results-panel,.v3-territorial-results,.v3-parliament,.district-scrutiny,.v3-coalitions,.territorial-coalition-distribution,.v3-election-facts>div,.game-tool-dialog fieldset,.game-tool-dialog details,.game-tool-dialog .poll-table-wrap,.tool-control-grid,.history-filters,.history-chart-card,.internal-faction,.party-logo-card){background:#1a293d;border-color:#34465f;color:#e5edf8}
html[data-theme="dark"] :is(.v3-start-actions .action-card,.v3-editor-link,.editor-item,.v3-ready .ready-player-switch,.v3-ready .ready-leadership,.v3-ready .ready-participants,.v3-ready .ready-electoral-rules,.v3-ready .electoral-coalition-panel,.v3-ready .coalition-reception,.v3-ready .ready-participant-grid label,.v3-ready .coalition-check-grid label,.v3-ready .electoral-coalition-card,.operation-plan,.operation-notice,.operation-reply-grid button,.v3-debate-opening,.debate-strategy,.debate-reply-grid button,.v3-debate-transcript,.government-party-choice,.government-content .poll-table-wrap,.primary-candidate,.negotiation-order li,.government-impact-row,.territorial-result-highlight,.vote-chart,.v3-next,.game-tool-dialog .tool-header,.game-tool-dialog .tool-check-grid label,.game-tool-dialog .regional-party-option,.game-tool-dialog .transfer-area-scope label,.tool-simulation .transfer-area-scope,.tool-cohesion){background:#23344b;border-color:#3a4d67;color:#e5edf8}
html[data-theme="dark"] :is(.v3-start-actions .v3-start-primary,.v3-resume,.v3-library-help,.v3-ready .ready-general-total,.operation-tactic:has(input:checked),.operation-critical-choices label:has(input:checked),.v3-debate-opening:has(input:checked),.negotiation-order li.active,.negotiation-programme,.government-rule-note,.autonomy-note,.investiture-previous-result,.government-seat-summary>div,.government-seat-summary>small,.negotiation-territorial-result>details>summary,.v3-results-table tr.player-result-row){background:#263a59;border-color:#4f6fa9;color:#dbe7ff}
html[data-theme="dark"] :is(.v3-setup,.v3-ready,.operation-workspace,.v3-election,.government-page,.game-tool-dialog,.v3-results-table,.operation-title h1,.operation-tactic-copy strong,.v3-election h1,.v3-election h2,.v3-territorial-results h2,.v3-ballot-name>b,.v3-debate legend,.v3-debate-card h3,.v3-debate blockquote,.game-tool-dialog .poll-table td,.vote-chart p){color:#e5edf8}
html[data-theme="dark"] :is(.v3-page-heading p,.v3-section-heading p,.operation-title p,.operation-tactic-copy small,.operation-plan label,.operation-critical>label,.operation-event label,.v3-ready label,.v3-ready legend,.v3-field,.editor-field,.editor-jump>a,.v3-debate-selectors label,.v3-debate-card>p,.v3-debate-result p,.v3-debate-note p,.v3-debate-transcript small,.game-tool-dialog label,.game-tool-dialog p,.game-tool-dialog details>summary,.game-tool-dialog fieldset legend,.seat-majority-label,.seat-chart-legend,.vote-chart-legend,.vote-chart small,.v3-coalitions summary,.district-scrutiny-heading>b){color:#bac8da}
html[data-theme="dark"] :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]),select,textarea){background:#101d2e;color:#edf4ff;border-color:#4a607d}
html[data-theme="dark"] :is(.secondary-button,.operation-secondary,.election-vote-toggle,.v3-ready-nav a,.ballot-choice,.game-tool-dialog .tool-header button,.game-tool-dialog button.secondary-button,.game-tool-dialog .internal-status-buttons button){background:#24364f;color:#e2ecfb;border-color:#4a607d}
html[data-theme="dark"] :is(.ballot-choice.selected,.ballot-choice[aria-pressed="true"],.game-tool-dialog .internal-status-buttons .selected){background:#4568d8;border-color:#7898ff;color:#fff}
html[data-theme="dark"] :is(.v3-card-heading>span,.v3-home-badge,.v3-resume-icon,.v3-library-icon,.v3-action-icon,.v3-step,.operation-shortcut-icon,.operation-tactic-icon,.v3-scenario-flag){background:#2c4162;color:#adc2ff}
html[data-theme="dark"] :is(.v3-start-primary .v3-action-icon){background:#4568d8;color:#fff}
html[data-theme="dark"] :is(.v3-scenario-row:hover,.v3-ready-nav a:hover,.editor-jump>a:hover){background:#283d59}
html[data-theme="dark"] :is(.v3-scenario-row,.v3-scenario-list,.v3-library-item,.v3-results-table td,.government-content .poll-table td,.game-tool-dialog .poll-table td){border-color:#34465f}
html[data-theme="dark"] :is(.government-content .poll-table th,.game-tool-dialog .poll-table th){background:#22344c;color:#b6c6dc}
html[data-theme="dark"] .game-tool-dialog{background:#142236;color:#e5edf8;border-color:#425875}
html[data-theme="dark"] .seat-majority-marker{background:#fff;border-color:#1a293d;box-shadow:0 0 0 1px #fff}
html[data-theme="dark"] :is(.v3-day-intro h1,.v3-live-main h1,.v3-final-hero h1){color:white}
html[data-theme="dark"] .party-logo:not(.party-logo-fallback){background:#fff}
html[data-theme="dark"] details{background:#1a293d;border-color:#3a4d67;color:#e5edf8}
html[data-theme="dark"] :is(.v3-metrics,.v3-metrics>div){background:#263951;border-color:#40536d}
html[data-theme="dark"] :is(.v3-metrics span,.v3-summary-card p,.v3-territory-description,.v3-setup .majority-marker,.v3-setup .government-members strong,.v3-setup .party-row-name small,.v3-setup .constituency-census){color:#b1bfd1}
html[data-theme="dark"] :is(.v3-disclosure>summary,.v3-setup .majority-marker b){color:#e5edf8}
html[data-theme="dark"] :is(.v3-setup .party-row,.v3-setup .government-members>div,.v3-setup .constituency-row){border-color:#3a4d67}
html[data-theme="dark"] :is(.campaign-primary,.start-button,.primary-button,.save-territory,.editor-primary){background:#345de1;border-color:#345de1;color:#fff}
html[data-theme="dark"] .operation-workspace :is(h1,h2,h3,legend){color:#e5edf8}
html[data-theme="dark"] .operation-workspace :is(p,small){color:#b6c5d8}
html[data-theme="dark"] .operation-plan .operation-area-note{background:#304463;color:#d5e2f5;border-color:#6d8cc9}
html[data-theme="dark"] .operation-tactic:has(input:checked) .operation-tactic-icon{background:#385889;color:#d5e2ff}
html[data-theme="dark"] :is(.operation-tactic,.operation-critical-choices label){border-color:#40536d}
html[data-theme="dark"] :is(.phase-chip,.v3-page-count){background:#263a59;color:#c3d3ed;border-color:#435a78}
/* Formación de gobierno y tablas compactas. */
html[data-theme="dark"] .government-content :is(h1,h2,h3,h4,legend,summary,.government-party-name strong,.negotiation-response strong,.v3-stage-context h2,.cabinet-office strong){color:#e5edf8}
html[data-theme="dark"] .government-content :is(p,label,small,.government-party-name small,.v3-stage-context p,.negotiation-programme span,.government-seat-summary>div span,.government-rule-note,.election-intro){color:#becde0}
html[data-theme="dark"] .government-content :is(.v3-stage-context,.government-seat-summary,.negotiation-programme,.negotiation-territorial-result>details>summary,.government-rule-note,.government-success-note,.territorial-performance-scale){background:#233750;border-color:#405771;color:#d7e5f5}
html[data-theme="dark"] .government-content :is(.government-seat-summary>div,.government-seat-summary>small,.negotiation-territorial-result>details>summary){background:#2a405c;color:#e5edf8}
html[data-theme="dark"] .government-content :is(.government-seat-summary strong,.negotiation-programme b){color:#f0f6ff}
html[data-theme="dark"] .government-content :is(.negotiation-order li,.negotiation-response,.cabinet-office,.government-party-choice){border-color:#405771}
html[data-theme="dark"] .government-content :is(.campaign-primary,.ballot-choice.selected,.ballot-choice[aria-pressed=true]){color:#fff}
html[data-theme="dark"] .referendum-tally span{background:#244b40;color:#e5fff4}
html[data-theme="dark"] .referendum-tally span:nth-child(2){background:#5a3039;color:#ffeded}
html[data-theme="dark"] .referendum-tally span:nth-child(3){background:#584923;color:#fff4d2}
html[data-theme="dark"] .referendum-tiles>div{background:#263951}
html[data-theme="dark"] .government-content :is(.v3-stage-party strong,.v3-stage-party span,.v3-stage-party small,.v3-stage-context-cycle,.v3-stage-header p,.section-kicker,.v3-stage-header .v3-kicker){color:#c2d2e8}
html[data-theme="dark"] .government-content .v3-results-table th{background:#233750;color:#c0d0e4}
