/* Theme controls remain available on the workspace, dashboard, and mobile header. */
:root{--warning:#efaa8c}
.topbar{gap:24px}



select:focus-visible,summary:focus-visible{outline:2px solid var(--mint);outline-offset:3px}

/* Light surfaces and dark green accents retain the component color families. */
:root[data-theme="light"]{color-scheme:light;--bg:#f4f7f5;--panel:#ffffff;--line:#d3dfd8;--text:#192f26;--muted:#53685e;--mint:#176b46;--orange:#955519;--warning:#b45309;--surface:#edf3ef;--tint:#e4f2e9;--border:#b7cbc0;--danger:#a33128}
:root[data-theme="light"] button:hover{filter:brightness(.96)}
:root[data-theme="light"] .nav.active{color:var(--text)}
:root[data-theme="light"] .topbar{background:var(--panel)}
:root[data-theme="light"] .beta{border-color:var(--border)}
:root[data-theme="light"] .avatar{background:var(--surface);border-color:var(--border);color:var(--text)}
:root[data-theme="light"] .quiet{border-color:var(--border);color:var(--text);background:var(--panel)}
:root[data-theme="light"] :is(.breadcrumb strong,.panel-label,h3,.tray-heading strong,.field-label,.results-placeholder h3){color:var(--text)}
:root[data-theme="light"] :is(.breadcrumb span,.panel-label>span,.brief-copy,.requirements li>span,.requirements small,.hint-box p,.toolbar-actions button,.chip,.canvas-instruction,.canvas-bottom,.canvas-bottom button,.tray-heading>span,.simulation-bar div div>span,.terminal-icon,.field-label span,.traffic-number small,.range-labels,.metrics span,.metrics strong small,.metrics>small,.results-placeholder p,.result-legend,.model-note,.model-note button,footer,.score-row small,.result-stats small,.config-description,.connection-list,.close-dialog){color:var(--muted)}
:root[data-theme="light"] .status-dot,:root[data-theme="light"] .node-indicator{background:var(--mint)}
:root[data-theme="light"] .scenario-art{background:radial-gradient(ellipse at center,#f7faf2,#e7f1e8);border-color:var(--line)}
:root[data-theme="light"] .ticket{box-shadow:5px 7px 0 #a7c8ac}
:root[data-theme="light"] .ticket:before,:root[data-theme="light"] .ticket:after{background:#e7f1e8}
:root[data-theme="light"] .art-star{color:var(--orange)}
:root[data-theme="light"] .tag{background:#fff2dd;border-color:#dbc29a;color:#805012}
:root[data-theme="light"] .tag.muted{background:#eaf0f8;border-color:#bbcadf;color:#39577c}
:root[data-theme="light"] .round-switch button{color:var(--muted);border-color:var(--border);background:var(--panel)}
:root[data-theme="light"] .round-switch button.active{background:var(--tint);border-color:var(--mint);color:var(--mint)}
:root[data-theme="light"] .round-switch button.complete{color:var(--mint)}
:root[data-theme="light"] .hint-box{background:#edf6ef;border-color:#bfd7c5}
:root[data-theme="light"] :is(.canvas-toolbar,.component-tray,.simulation-bar){background:var(--surface)}
:root[data-theme="light"] .chip{border-color:var(--border)}
:root[data-theme="light"] .canvas{background-color:#f8fbf9;background-image:radial-gradient(#c9d8cf 1px,transparent 1px)}
:root[data-theme="light"] .edge{stroke:#5b7568}
:root[data-theme="light"] #edges marker path{stroke:#5b7568}
:root[data-theme="light"] .edge-group:hover .edge{stroke:var(--danger)}
:root[data-theme="light"] .running .edge{stroke:var(--mint)}
:root[data-theme="light"] .edge-label{fill:#425e50;stroke:#f8fbf9}
:root[data-theme="light"] .node{background:#edf4ff;border-color:#9bb6d6;box-shadow:0 5px 16px #19372912}
:root[data-theme="light"] .node small{color:#48616f}
:root[data-theme="light"] .component-icon{background:#dbe9fa;color:#285e96}
:root[data-theme="light"] .node.purple{background:#f2edfc;border-color:#bba6d6}
:root[data-theme="light"] .purple .component-icon{background:#e5d9f6;color:#64428b}
:root[data-theme="light"] .node.orange{background:#fff2e7;border-color:#d6b392}
:root[data-theme="light"] .orange .component-icon{background:#f8e0c8;color:#935117}
:root[data-theme="light"] .node.pink{background:#fbeef8;border-color:#d6acd0}
:root[data-theme="light"] .pink .component-icon{background:#f2dcef;color:#8d3d80}
:root[data-theme="light"] .node.yellow{background:#fff9df;border-color:#c9bd87}
:root[data-theme="light"] .yellow .component-icon{background:#f3e9bb;color:#7a6211}
:root[data-theme="light"] .node.teal{background:#e9f7f3;border-color:#98c6b8}
:root[data-theme="light"] .teal .component-icon{background:#d2ebe3;color:#206950}
:root[data-theme="light"] .port{background:var(--panel);border-color:#7c9588;color:var(--text)}
:root[data-theme="light"] .port.active{background:var(--mint);color:#fff;border-color:var(--mint);box-shadow:0 0 0 5px #176b461c}
:root[data-theme="light"] .canvas-bottom>div{background:var(--panel);border-color:var(--line)}
:root[data-theme="light"] .palette button{background:var(--panel);border-color:var(--border)}
:root[data-theme="light"] .palette button>span:last-child{color:var(--text)}
:root[data-theme="light"] .palette .component-icon{background:transparent}
:root[data-theme="light"] .primary{background:var(--mint);border-color:var(--mint);color:#fff}
:root[data-theme="light"] .budget-track{background:#dce8e0}
:root[data-theme="light"] .radar{border-color:var(--border);background:radial-gradient(#d8eddf,#f4f8f5)}
:root[data-theme="light"] .radar:before{border-color:#b6d3bf}
:root[data-theme="light"] .radar span{color:var(--mint)}
:root[data-theme="light"] .toast{background:#e3f2e8;border-color:#96bca2;box-shadow:0 4px 18px #19372912}
:root[data-theme="light"] .result-stats>div{background:var(--surface);border-color:var(--line)}
:root[data-theme="light"] .feedback{background:#fff6e6;border-color:#dbc49d}
:root[data-theme="light"] .feedback strong{color:#805012}
:root[data-theme="light"] .feedback p{color:#725525}
:root[data-theme="light"] .feedback.bad{background:#fff0ed;border-color:#dfb1a9}
:root[data-theme="light"] .feedback.bad strong,:root[data-theme="light"] .feedback.bad p{color:var(--danger)}
:root[data-theme="light"] .feedback.good{background:#eaf5ee;border-color:#a8cbb3}
:root[data-theme="light"] .feedback.good strong{color:var(--mint)}
:root[data-theme="light"] .feedback.good p{color:#386346}
:root[data-theme="light"] .stepper{border-color:var(--border)}
:root[data-theme="light"] :is(.delete-button,.connection-list button,.design-card-actions button[data-delete]){color:var(--danger);border-color:#d0a099}
:root[data-theme="light"] .stale{color:#805012}
:root[data-theme="light"] dialog{background:var(--panel);border-color:var(--border);box-shadow:0 24px 90px #19372933}
:root[data-theme="light"] dialog::backdrop{background:#20382a55}
:root[data-theme="light"] dialog p,:root[data-theme="light"] dialog li{color:var(--muted)}
:root[data-theme="light"] dialog li strong{color:var(--text)}
:root[data-theme="light"] .model-detail{background:var(--surface)}
:root[data-theme="light"] .tutorial-header{background:radial-gradient(ellipse at top right,#dbeee1,transparent 65%)}
:root[data-theme="light"] .tutorial-nav{background:var(--surface)}
:root[data-theme="light"] .tutorial-nav button,:root[data-theme="light"] .tutorial-nav button>span:first-child{color:var(--muted)}
:root[data-theme="light"] .tutorial-nav button.active{background:var(--tint);border-color:#adcfb8;color:var(--mint)}
:root[data-theme="light"] .tutorial-nav button.active>span:first-child{color:var(--mint)}
:root[data-theme="light"] .tutorial-content .tutorial-intro,:root[data-theme="light"] .tutorial-actions li{color:var(--muted)}
:root[data-theme="light"] .tutorial-diagram{background:#f0f7f2;border-color:var(--line)}
:root[data-theme="light"] .diagram-node{background:var(--panel);border-color:var(--border);color:var(--text)}
:root[data-theme="light"] .diagram-arrow{color:var(--mint)}
:root[data-theme="light"] .tutorial-actions li:before{background:var(--tint);border-color:var(--border)}
:root[data-theme="light"] .tutorial-reason{background:var(--surface);border-color:var(--mint)}
:root[data-theme="light"] .tutorial-reason>strong,:root[data-theme="light"] .tutorial-checkpoint strong{color:var(--mint)}
:root[data-theme="light"] .tutorial-reason p,:root[data-theme="light"] .tutorial-checkpoint p{color:var(--muted)}
:root[data-theme="light"] .tutorial-try{background:var(--tint);border-color:var(--border)}
:root[data-theme="light"] .tutorial-safe,:root[data-theme="light"] .tutorial-footer>span{color:var(--muted)}
:root[data-theme="light"] .tutorial-highlight{box-shadow:0 0 0 7px #176b4614!important}
:root[data-theme="light"] .tutorial-coach{background:#eaf5ee;border-color:#96bca2;box-shadow:0 10px 45px #19372926}
:root[data-theme="light"] .tutorial-coach p,:root[data-theme="light"] .coach-close{color:var(--muted)}
:root[data-theme="light"] .account-login{color:var(--text)}
:root[data-theme="light"] :is(.account-signup,.account-tier,.save-design-button){background:var(--tint);border-color:#adcfb8}
:root[data-theme="light"] .auth-tabs button{color:var(--muted)}
:root[data-theme="light"] .auth-tabs button.active{color:var(--mint)}
:root[data-theme="light"] .account-dialog label{color:var(--text)}
:root[data-theme="light"] .account-dialog input:not([type=checkbox]){background:#f9fcfa;color:var(--text);border-color:var(--border)}
:root[data-theme="light"] .account-dialog input::placeholder{color:#62766b}
:root[data-theme="light"] .account-dialog .form-help,:root[data-theme="light"] .account-dialog .account-footnote,:root[data-theme="light"] .profile-heading p{color:var(--muted)}
:root[data-theme="light"] .form-error{background:#fff0ed;border-color:#dfb1a9;color:var(--danger)!important}
:root[data-theme="light"] .tier-card{background:linear-gradient(120deg,#e0f0e5,#f4faf6);border-color:#b1cdbb}
:root[data-theme="light"] .tier-emblem{background:#d4e8db;border-color:#9dbda8}
:root[data-theme="light"] .tier-card p,:root[data-theme="light"] .profile-points small{color:var(--muted)}
:root[data-theme="light"] .tier-progress{background:#d5e5db}
:root[data-theme="light"] .profile-stats>div{background:var(--surface);border-color:var(--line)}
:root[data-theme="light"] .profile-stats span{color:var(--muted)}
:root[data-theme="light"] .tier-explainer{background:#f0f7f2;border-color:var(--line)}
:root[data-theme="light"] .tier-explainer summary{color:var(--text)}
:root[data-theme="light"] .tier-explainer>p,:root[data-theme="light"] .tier-explainer small{color:var(--muted)}
:root[data-theme="light"] .tier-explainer>div>span{color:var(--muted);border-color:var(--border)}
:root[data-theme="light"] .tier-explainer .current{color:var(--mint);border-color:var(--mint);background:var(--tint)}
:root[data-theme="light"] .design-card{background:var(--surface);border-color:var(--line)}
:root[data-theme="light"] .design-card-icon,:root[data-theme="light"] .empty-library>span{color:var(--mint)}
:root[data-theme="light"] .design-card p,:root[data-theme="light"] .design-card small,:root[data-theme="light"] .empty-library p{color:var(--muted)}
:root[data-theme="light"] .empty-library{border-color:var(--border)}
:root[data-theme="light"] .verified-history>div,:root[data-theme="light"] .verified-history small,:root[data-theme="light"] .verified-history>p{color:var(--muted)}
:root[data-theme="light"] .completion-dialog{background:radial-gradient(ellipse at top,#e1f3e7,transparent 65%),var(--panel)}
:root[data-theme="light"] .completion-symbol{background:#d9eee0;border-color:#98c4a6;box-shadow:0 0 0 9px #176b4609}
:root[data-theme="light"] .completion-dialog>p{color:var(--muted)}
:root[data-theme="light"] .completion-alert{background:#e9f5ed;border-color:#adcfb8}
:root[data-theme="light"] .completion-metrics strong small,:root[data-theme="light"] .completion-metrics div>span,:root[data-theme="light"] .completion-review{color:var(--muted)}
:root[data-theme="light"] .dashboard-heading p,:root[data-theme="light"] .dashboard-section-heading p{color:var(--muted)}
:root[data-theme="light"] .dashboard-summary>div{background:#eaf3ed;border-color:var(--line)}
:root[data-theme="light"] .dashboard-summary span{color:var(--muted)}
:root[data-theme="light"] .dashboard-summary strong{color:var(--text)}
:root[data-theme="light"] .dashboard-task{background:var(--panel);border-color:var(--line)}
:root[data-theme="light"] .dashboard-task.completed{background:linear-gradient(145deg,#eaf5ee,#fff);border-color:#9cbea6}
:root[data-theme="light"] .task-status{color:var(--muted);border-color:var(--border)}
:root[data-theme="light"] .completed .task-status{color:var(--mint);background:var(--tint);border-color:#9cbea6}
:root[data-theme="light"] .task-round{color:var(--muted)}
:root[data-theme="light"] .dashboard-task h3{color:var(--text)}
:root[data-theme="light"] .dashboard-task p{color:var(--muted)}
:root[data-theme="light"] .task-constraints{color:var(--muted);border-color:var(--line)}
:root[data-theme="light"] .dashboard-finished{background:var(--tint);border-color:var(--border)}
:root[data-theme="light"] .dashboard-finished p{color:var(--muted)}
:root[data-theme="light"] :is(.problem-picker select,.catalog-tools select,.catalog-tools input,.component-setting){background:#f9fcfa;border-color:var(--border);color:var(--text)}
:root[data-theme="light"] .mission-workload{background:#edf6f0;color:#355f47}
@media(max-width:650px){.topbar{gap:12px}}
/* Invitations use the same green accents in both appearance modes. */
:root[data-theme="light"] :is(.share-challenge-button,.share-email,.shared-invite){background:var(--tint);border-color:#adcfb8;color:var(--mint)}
:root[data-theme="light"] .share-dialog input{background:#f9fcfa;border-color:var(--border);color:var(--text)}
:root[data-theme="light"] .share-platforms a{background:var(--surface);border-color:var(--border);color:var(--text)}
:root[data-theme="light"] .shared-invite p{color:var(--muted)}
:root[data-theme="light"] .share-dialog .share-local-notice{background:#fff6e6;border-color:#dbc49d;color:#725525}
:root[data-theme="light"] .share-platforms a:hover,:root[data-theme="light"] .share-email:hover{filter:brightness(.96)}
