:root[data-theme=light]{color-scheme:light;--bg:#f5f7fa;--panel:#fff;--line:#dce3eb;--ink:#17202e;--muted:#596b80;--accent:#087c59;--blue:#315fcc;--bad:#b42332;--mint:#087c59;--ground:#f5f7fa!important;--surface:#fff!important;--surface2:#edf2f7!important;--raise:#fff!important;--ink2:#475569!important;--ink3:#64748b!important;--line2:#ccd6e2!important;--ally:#285fbb!important;--allyBg:#e6efff!important;--foe:#b42332!important;--foeBg:#fff0f1!important;--gold:#956514!important;--good:#087c59!important;--warn:#956514!important;--shadow:0 2px 12px #1b30400b!important}
[data-theme=light] .main-shell header{background:#fff}
[data-theme=light] :is(label,.breadcrumb strong,.subtle,.finding-list){color:#334155}
[data-theme=light] :is(input,select,textarea,.photo-json){background:#f8fafc;color:#17202e;border-color:#ccd6e2}
[data-theme=light] :is(.subtle,.action-list button,.filters button){background:#edf2f7;color:#26364a;border-color:#dce3eb}
[data-theme=light] :is(th,.visual-panel,.visual-tabs button,.round-tile){background:#fff;color:#334155;border-color:#dce3eb}
[data-theme=light] th{background:#edf2f7;color:#526379}
[data-theme=light] :is(.tag,.filters .selected,.visual-tabs button.selected,.round-tile.selected,.round-tile:hover){background:#e1f4eb;color:#086342;border-color:#8ecbb0}
[data-theme=light] :is(.visual-stat>span,.visual-stat small,.opponent-total>span,.opponent-search,.stat small,.upload-path small){color:#596b80}
[data-theme=light] :is(.visual-roster summary,.opponent-detail summary){color:#087c59}
[data-theme=light] :is(.bar,.stage-track,.member-meter){background:#dce4ee}
[data-theme=light] .loss{color:#b42332}
[data-theme=light] .notice{background:#e8f6ee;border-color:#a5d5b9;color:#17553b}
[data-theme=light] .notice.failure{background:#fff0f1;border-color:#e4abb2;color:#a82030}
[data-theme=light] .upload-area{background:#edf7f4;border-color:#a2c8bc}
[data-theme=light] .primary{color:#fff}
[data-theme=light] :is(.visual-roster,.visual-members>div,.opponent-detail,.upload-file-list li){border-color:#dce3eb}
[data-theme=light] .auth-story{color:#eef3fa;--accent:#79dfb5}
/* Keep navigation distinct while the working area becomes white. */
[data-theme=light] .sidebar{--ink:#eaf0f7;--muted:#a6b5c8;--accent:#79dfb5;color:#eaf0f7;border-color:#273344}
[data-theme=light] .sidebar .subbrand{color:#a6b5c8}
[data-theme-toggle]{white-space:nowrap;min-height:34px}
.theme-standalone{position:fixed;right:16px;bottom:16px;z-index:100;background:var(--surface);color:var(--ink);border:1px solid var(--line2);border-radius:8px;padding:9px 14px;cursor:pointer}
@media(max-width:600px){.user-controls{gap:8px;flex-wrap:wrap}.user-controls [data-theme-toggle]{padding:6px 8px;font-size:11px}}
/* Tailwind cards and SVG labels must follow the active palette too. */
[data-theme=light] .tw-bg-panel{background-color:#fff}
[data-theme=light] .tw-border-line{border-color:#dce3eb}
[data-theme=light] :is(.round-score small,.visual-bar-row small){color:#596b80}
[data-theme=light] .visual-badge{background:#edf2f7;color:#475569}
[data-theme=light] .visual-badge.good{background:#dcf3e7;color:#087448}
[data-theme=light] .visual-badge.bad{background:#fce5e8;color:#ac2032}
[data-theme=light] .visual-badge.amber{background:#fff0ce;color:#865c0a}
[data-theme=light] .chart-grid{stroke:#d5deea}
[data-theme=light] .chart-label{fill:#596b80}
[data-theme=light] .chart-value{fill:#087448}
[data-theme=light] .visual-track{background:#dce4ee}
[data-theme=light] .visual-track .mint,[data-theme=light] .member-meter i{background:#268863}
.result-actions{display:flex;flex-wrap:wrap;gap:10px;align-items:center;padding:0 0 18px;margin:0 0 18px;border-bottom:1px solid var(--line)}
.result-actions>.subtle{display:inline-flex;align-items:center;justify-content:center;margin:0;min-height:40px;text-align:center;text-decoration:none;line-height:1.4}
@media(max-width:600px){.result-actions>.subtle{flex:1 1 100%;width:100%}}

#job-summary .result-stage-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin:16px 0}
#job-summary .result-stage-grid .upload-stage{padding:12px;margin:0;min-width:0}
#job-summary .result-stage-grid .stage-heading{gap:8px;align-items:start}
#job-summary .result-stage-grid h3{font-size:13px;margin:0}
#job-summary .result-stage-grid .stage-track{height:6px;margin:12px 0 8px}
#job-summary .result-stage-grid p{font-size:12px;margin:0}
.result-photo-list{max-height:320px;overflow:auto}
.result-photo-list td,.result-photo-list th{padding:10px 12px}
.result-history-notice{padding:12px;margin-bottom:16px;border:1px solid var(--line);border-radius:8px;color:var(--muted);font-size:13px}
.result-history-notice button{margin-left:12px}
@media(max-width:850px){#job-summary .result-stage-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:420px){#job-summary .result-stage-grid{grid-template-columns:1fr}}

.photo-status-board{max-width:510px;margin:12px 0 20px}
.photo-status-legend{display:flex;flex-wrap:wrap;gap:8px 16px;margin-bottom:12px;font-size:12px;color:var(--ink)}
.photo-status-legend>span{display:inline-flex;align-items:center;gap:5px}
.photo-status-legend i{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:4px;font-style:normal;font-weight:700}
.photo-status-grid{display:grid;grid-template-columns:repeat(auto-fill,44px);gap:7px}
.photo-status-cell{width:44px;height:44px;min-height:44px;padding:3px;border:2px solid transparent;border-radius:7px;display:flex;flex-direction:column;align-items:center;justify-content:center;cursor:pointer;font-size:12px;line-height:1.15}
.photo-status-cell b{font-size:13px}.photo-status-cell span{font-size:11px}
.photo-status-cell:focus-visible,.photo-status-cell[aria-pressed=true]{outline:2px solid var(--ink);outline-offset:2px}
.photo-state-done{background:#087b59;color:#fff}
.photo-state-review{background:#f6c453;color:#3a2800}
.photo-state-failed{background:#bd3047;color:#fff}
.photo-state-running{background:#3267b8;color:#fff}
.photo-state-pending{background:#dce3eb;color:#334155}
.photo-state-duplicate{background:#7654a0;color:#fff}
.photo-status-detail{min-height:20px;overflow-wrap:anywhere;margin:12px 0 0}

.pipeline-step>summary{cursor:pointer;list-style:none}
.pipeline-step>summary::-webkit-details-marker{display:none}
.pipeline-step>summary [data-stage-title]::before{content:'▸ ';color:var(--muted)}
.pipeline-step[open]>summary [data-stage-title]::before{content:'▾ '}
.pipeline-step>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.stage-log{white-space:pre-wrap;overflow-wrap:anywhere;font:12px/1.7 ui-monospace,monospace;background:var(--surface);color:var(--ink);border:1px solid var(--line);border-radius:6px;padding:12px;margin:0 0 12px;max-height:260px;overflow:auto}
