/* Shared appearance switch for trainee, operator, results, and admin pages. */
.theme-toggle{display:inline-flex;align-items:center;gap:7px;min-height:36px;flex:none}
.theme-toggle-icon{font-size:18px;line-height:1}
.theme-toggle-label{font-size:11px}
@media(max-width:700px){.theme-toggle{width:38px;min-width:38px;padding:7px}.theme-toggle-label{display:none}}

:root[data-theme="dark"]{
  --bg:#141b23;--surface:#1e2832;--ink:#ecf1f3;--muted:#aebcc6;--line:#394752;
  --accent:#d8eb7f;--green:#91d8ab;--green-bg:#213b34;
  --orange:#f1c080;--orange-bg:#433426;--red:#f0a19f;--red-bg:#432c31;
  background:var(--bg);color:var(--ink);
}
:root[data-theme="dark"] body{background:var(--bg);color:var(--ink)}
:root[data-theme="dark"] .sidebar,:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .card{background:var(--surface);color:var(--ink)}
:root[data-theme="dark"] .topbar,:root[data-theme="dark"] .sidebar{border-color:var(--line)}
:root[data-theme="dark"] .navigation>a{color:#c4d0d7}
:root[data-theme="dark"] .navigation>a:hover{background:#2b3a37;color:#f3f7f7}
:root[data-theme="dark"] .navigation>a.active{background:var(--accent);color:#293223}
:root[data-theme="dark"] .nav-count{background:#34414b;color:#e9f0f2}
:root[data-theme="dark"] .navigation>a.active .nav-count{background:#b8d367;color:#253019}
:root[data-theme="dark"] .workspace,:root[data-theme="dark"] .profile{border-color:var(--line)}
:root[data-theme="dark"] .workspace-icon,:root[data-theme="dark"] .avatar{background:#2a3842;border-color:var(--line);color:#d4e0e5}
:root[data-theme="dark"] .workspace div>span,:root[data-theme="dark"] .profile div>span,:root[data-theme="dark"] .local-note,:root[data-theme="dark"] .local-note p{color:var(--muted)}
:root[data-theme="dark"] .breadcrumbs,:root[data-theme="dark"] .breadcrumbs strong,:root[data-theme="dark"] .page-subtitle,:root[data-theme="dark"] .eyebrow,:root[data-theme="dark"] .section-kicker{color:var(--muted)}
:root[data-theme="dark"] .environment{background:#27372f;border-color:#415843;color:#c8e2b9}
:root[data-theme="dark"] .button,:root[data-theme="dark"] button:not(.primary):not(.drop-zone):not(.details-button):not(.copy-button):not(.icon-button):not(.text-button){background:#293540;border-color:#465561;color:#eaf0f2}
:root[data-theme="dark"] .button:hover,:root[data-theme="dark"] button:not(.primary):not(.drop-zone):not(.details-button):not(.copy-button):not(.icon-button):not(.text-button):hover{background:#35444e}
:root[data-theme="dark"] .button.primary,:root[data-theme="dark"] button.primary{background:var(--accent);border-color:#c6de69;color:#27311e}
:root[data-theme="dark"] .button.primary:hover,:root[data-theme="dark"] button.primary:hover{background:#cbe46d}
:root[data-theme="dark"] .text-button,:root[data-theme="dark"] .page-back,:root[data-theme="dark"] .dashboard-history-link{color:#c8e58d}
:root[data-theme="dark"] .text-button:hover,:root[data-theme="dark"] .page-back:hover,:root[data-theme="dark"] .dashboard-history-link:hover{color:#edffbf}
:root[data-theme="dark"] input:not([type="checkbox"]):not([type="file"]),:root[data-theme="dark"] select,:root[data-theme="dark"] textarea{background:#18212a;border:1px solid var(--line);color:var(--ink)}
:root[data-theme="dark"] input::placeholder,:root[data-theme="dark"] textarea::placeholder{color:#91a1ab}
:root[data-theme="dark"] option{background:#1e2832;color:var(--ink)}
:root[data-theme="dark"] .login-form label,:root[data-theme="dark"] .operator-create label,:root[data-theme="dark"] .operator-reset label,:root[data-theme="dark"] .operator-add label,:root[data-theme="dark"] .group-filters label{color:#dce6ea}
:root[data-theme="dark"] .mode-bar,:root[data-theme="dark"] #page-guide .mode-bar,:root[data-theme="dark"] .demo-bar{background:#28372e;border-color:#405944;color:#d7e8d0}
:root[data-theme="dark"] .mode-bar [aria-pressed="true"]{background:#465c34;border-color:#84a75f;color:#f0ffd5}
:root[data-theme="dark"] .demo-bar>div:first-child,:root[data-theme="dark"] .demo-label{color:#d5e6c0}
:root[data-theme="dark"] .demo-label{background:#314337;border-color:#526d4c}
:root[data-theme="dark"] .alert.error-alert,:root[data-theme="dark"] .technical-error{background:var(--red-bg);border-color:#755055;color:#ffd0cb}
:root[data-theme="dark"] .attempt-label,:root[data-theme="dark"] #account-panel p,:root[data-theme="dark"] .context-next>span{color:var(--muted)}
:root[data-theme="dark"] .workspace-context{border-left-color:var(--accent)}
:root[data-theme="dark"] .workspace-context #context-environment{color:#c4d4aa}
:root[data-theme="dark"] .dashboard-intro,:root[data-theme="dark"] .task-hero{background:linear-gradient(112deg,#303d2c,#1e2832 82%)}
:root[data-theme="dark"] .dashboard-intro p,:root[data-theme="dark"] .dashboard-description,:root[data-theme="dark"] .task-hero>p,:root[data-theme="dark"] .task-hero>p#task-description,:root[data-theme="dark"] .task-workflow p,:root[data-theme="dark"] .task-criteria-intro{color:#c5d0cb}
:root[data-theme="dark"] .dashboard-total,:root[data-theme="dark"] .task-tags span,:root[data-theme="dark"] .task-target-banner,:root[data-theme="dark"] .task-workflow>div{background:#26342e;border-color:#4c6245;color:#e5f0db!important}
:root[data-theme="dark"] .task-description-label,:root[data-theme="dark"] .task-workflow span,:root[data-theme="dark"] .dashboard-criteria li strong{color:#cbe68d}
:root[data-theme="dark"] .dashboard-namespace,:root[data-theme="dark"] .task-criteria-heading span,:root[data-theme="dark"] .criteria b{background:#2d3c2e;color:#d4eba5}
:root[data-theme="dark"] .dashboard-status{background:#33404b;color:#d2dce2}
:root[data-theme="dark"] .dashboard-status.in_progress{background:var(--orange-bg);color:var(--orange)}
:root[data-theme="dark"] .dashboard-status.completed{background:var(--green-bg);color:var(--green)}
:root[data-theme="dark"] .task-label,:root[data-theme="dark"] .task-requirements dt,:root[data-theme="dark"] .check-values dt{color:#abbac3}
:root[data-theme="dark"] .task-requirements dd,:root[data-theme="dark"] .check-values dd{color:#e4efed}
:root[data-theme="dark"] .body-copy,:root[data-theme="dark"] .solution-explainer,:root[data-theme="dark"] .solution-dropzone-copy span,:root[data-theme="dark"] .solution-formats,:root[data-theme="dark"] .solution-selected>div span{color:var(--muted)}
:root[data-theme="dark"] .solution-details,:root[data-theme="dark"] .solution-panel{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .solution-limit,:root[data-theme="dark"] .solution-icon,:root[data-theme="dark"] .solution-file-icon{background:#35452f;border-color:#506949;color:#d1e9a3}
:root[data-theme="dark"] .solution-dropzone,:root[data-theme="dark"] .solution-dropzone.is-ready{background:linear-gradient(145deg,#26352c,#222f2a);border-color:#638258}
:root[data-theme="dark"] .solution-dropzone.is-dragover{background:#364c32}
:root[data-theme="dark"] .solution-selected{background:#26362b;border-color:#496344}
:root[data-theme="dark"] .solution-status{color:#c9e2a3}
:root[data-theme="dark"] .empty-state h2,:root[data-theme="dark"] .empty-state h3{color:var(--ink)}
:root[data-theme="dark"] .score-ring>div{background:var(--surface)}
:root[data-theme="dark"] .environment-card code,:root[data-theme="dark"] .subtle-count{background:#2b3843;border-color:var(--line);color:#dce7ec}
:root[data-theme="dark"] .summary-content p,:root[data-theme="dark"] .summary-meta,:root[data-theme="dark"] .environment-card dt,:root[data-theme="dark"] .checks-heading p,:root[data-theme="dark"] .check-name p,:root[data-theme="dark"] .history-info p{color:var(--muted)}
:root[data-theme="dark"] .checks-table-header,:root[data-theme="dark"] .checks-footer{background:#26313b;color:#b7c5cd;border-color:var(--line)}
:root[data-theme="dark"] .check-row{border-color:var(--line)}
:root[data-theme="dark"] .check-points small,:root[data-theme="dark"] .details-button{color:#bdc9ce}
:root[data-theme="dark"] .tip-card{background:#29372d;border-color:#465b40}
:root[data-theme="dark"] .tip-card p,:root[data-theme="dark"] .tip-card .section-kicker{color:#b9cbb4}
:root[data-theme="dark"] .tip-icon,:root[data-theme="dark"] .upload-circle{background:#364b38;color:#d2e5a9}
:root[data-theme="dark"] .drop-zone{border-color:#5d6d79;color:var(--ink)}
:root[data-theme="dark"] .drop-zone:hover,:root[data-theme="dark"] .drop-zone.dragover{background:#2a3a31;border-color:#a4bd75}
:root[data-theme="dark"] .drop-zone>span:not(.upload-circle),:root[data-theme="dark"] .drop-zone small,:root[data-theme="dark"] .drop-zone u{color:#bacbd2}
:root[data-theme="dark"] .guide-intro p,:root[data-theme="dark"] .guide-steps p,:root[data-theme="dark"] .status-guide p{color:var(--muted)}
:root[data-theme="dark"] dialog{background:var(--surface);border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] dialog pre{background:#141d26;color:#dce7e9}
:root[data-theme="dark"] dialog::backdrop{background:#080e16ba}
:root[data-theme="dark"] .operator-page .operator-nav{background:#29372f;border-color:#465a44}
:root[data-theme="dark"] .operator-page .operator-nav>a{color:#ccdabf}
:root[data-theme="dark"] .operator-page .operator-nav>a:hover{background:#374a39;color:#f3f9ec}
:root[data-theme="dark"] .operator-page .operator-nav>a[aria-current="page"]{background:var(--accent);color:#27311e}
:root[data-theme="dark"] .operator-page #notice,:root[data-theme="dark"] .operator-page .section-heading p,:root[data-theme="dark"] .operator-directory-meta,:root[data-theme="dark"] .operator-progress span,:root[data-theme="dark"] .operator-task-values,:root[data-theme="dark"] .operator-task-id,:root[data-theme="dark"] .operator-last{color:var(--muted)}
:root[data-theme="dark"] .operator-directory-row:hover{background:#28372e;border-color:#648153}
:root[data-theme="dark"] .operator-namespace,:root[data-theme="dark"] .directory-arrow{color:#cae29a}
:root[data-theme="dark"] .operator-user .user-count,:root[data-theme="dark"] .operator-environment{background:#2b3a31;border-color:#4c6348;color:#dfedda}
:root[data-theme="dark"] .operator-environment p,:root[data-theme="dark"] .operator-environment-pods{color:#c6d5cb!important}
:root[data-theme="dark"] .operator-environment-preview{background:#223129;border-color:#67845b}
:root[data-theme="dark"] .operator-task,:root[data-theme="dark"] .operator-reset{border-color:var(--line)}
:root[data-theme="dark"] .operator-page .button.subtle{background:#28353f;border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .group-filters select,:root[data-theme="dark"] .group-table select{background:#18212a;border-color:var(--line);color:var(--ink)}
:root[data-theme="dark"] .group-table th,:root[data-theme="dark"] .group-table td{border-color:var(--line)}
:root[data-theme="dark"] .group-report #report-meta,:root[data-theme="dark"] .group-table td small{color:var(--muted)}
:root[data-theme="dark"] .group-check{border-color:var(--line)}
:root[data-theme="dark"] .admin-page fieldset,:root[data-theme="dark"] .admin-page input:not([type="checkbox"]),:root[data-theme="dark"] .admin-page select,:root[data-theme="dark"] .admin-page textarea{border-color:var(--line)}
:root[data-theme="dark"] .page-footer{color:#a5b2bc}
:root[data-theme="dark"] .linux-machine-status{background:#2b3a31;color:var(--muted)}
:root[data-theme="dark"] .linux-machine-status.connected{background:var(--green-bg);color:var(--green)}
:root[data-theme="dark"] .linux-machine-status.unreachable,:root[data-theme="dark"] .linux-machine-status.authentication_failed,:root[data-theme="dark"] .linux-machine-status.host_key_error,:root[data-theme="dark"] .linux-machine-status.configuration_error{background:var(--orange-bg);color:var(--orange)}
@media(max-width:700px){
  .operator-page .topbar>span,.admin-page .topbar>span{display:none}
  .operator-page .topbar .theme-toggle,.admin-page .topbar .theme-toggle{margin-left:auto}
}
