/* Theme controls use the same layout on every page. Images and QR remain unchanged. */
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:40px;padding:8px 12px;border:1px solid var(--line);border-radius:99px;background:transparent;color:var(--ink);font-size:12px;white-space:nowrap;flex-shrink:0}
.theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}.theme-sun{display:none}[data-theme=dark] .theme-sun{display:block}[data-theme=dark] .theme-moon{display:none}
header .wrap{column-gap:18px}header nav{margin-left:auto}.visit-meter{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:18px;font-size:11px}.visit-meter .visit-value{font-size:13px;font-weight:700;color:var(--ink);font-variant-numeric:tabular-nums;margin-left:6px}.visit-meter #visits-status:not(:empty){flex-basis:100%;margin:0;color:var(--muted)}
@media(max-width:580px){header .brand{order:1}header .theme-toggle{order:2;margin-left:auto}header nav{order:3;margin-left:0}.theme-toggle{min-height:36px;padding:6px 11px;font-size:11px}.visit-meter{gap:12px}}
html[data-theme=dark]{color-scheme:dark;--ink:#e6e9f3;--muted:#a6aec2;--green:#c0b9f6;--bg:#141824;--line:#343c50;--soft:#2a2c43;--surface:#1d2332;--surface-alt:#252c3d;--input:#171e2c}
html[data-theme=dark] body{background:var(--bg);color:var(--ink)}
html[data-theme=dark] :is(header,footer){background:#171c29;border-color:var(--line)}
html[data-theme=dark] :is(.hub-card,.panel,.work-panel,.article,.article details,.related a,.batch-settings,.photo-row,.export-bar,.queue-empty,.work-options,.team-card,dialog#photo-preview){background:var(--surface);border-color:var(--line);color:var(--ink);box-shadow:none}
html[data-theme=dark] :is(.tool-heading p,.hub-card p,.article p,.article li,.legal p,.field,.note,.tool-kicker,.tool-breadcrumb,.tool-assurance,.work-status,.calc-result dt,.source-box strong,.article summary,.category,.card-bottom,.section-description,.section-kicker,.search-shortcuts,.hub-note,.result-caption,.original-name,.photo-info p,.dropzone p,.queue-head p,.export-bar p,.setting-title span,.run-panel p,.team-card ul,.stage-label,.stage-dot,.party-welcome p,.board-hint,.deal-caption,.team-waiting,.winner p,.winner>span){color:var(--muted)}
html[data-theme=dark] :is(.field input,.field select,.field textarea,.large-input,.large-input[readonly],.recipe-table input:not([type=checkbox]),.recipe-saved input,.recipe-saved select,.search input,.work-options select){background:var(--input);color:var(--ink);border-color:#414a62}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#919ab1;opacity:1}
html[data-theme=dark] :is(.field input:focus,.field select:focus,.field textarea:focus,.large-input:focus){background:#1c2436;border-color:#a89ee9}
html[data-theme=dark] :is(.secondary,.more-tools .secondary,.chip,.detail-fav,.suggest-banner a,nav a:last-child,.work-presets button,.preset-row button,.photo-row-actions button,.party-nav a){background:var(--surface-alt);border-color:var(--line);color:#d1d6e7}
html[data-theme=dark] :is(.chip.active,.detail-fav.on,.party-nav a[aria-current]){background:#413958;border-color:#8274aa;color:#f2ecff}
html[data-theme=dark] :is(.primary,.party .party-run){background:#7164b2;border-color:#8a7bc9;color:#fff}
html[data-theme=dark] .primary:hover:not(:disabled){background:#8273c9}
html[data-theme=dark] :is(.text-button,.hub-card .fav,.hub-card .fav.on){color:#c9bcf3}
html[data-theme=dark] .hub-card:hover{border-color:#8b80b7;box-shadow:0 5px 18px #0002}
html[data-theme=dark] :is(.source-box,.recipe-saved,.suggest-banner,.suggest-guide,.suggest-pending,.empty,.benefit-strip,.batch-steps,.name-example,.run-panel,.output-panel,.result,.batch-summary,.queue-head h2 span,.detail-icon,.tool-icon,.card-arrow,.search kbd,.hub-count,.step-dot){background:var(--surface-alt);border-color:var(--line);color:#c6c8e1}
html[data-theme=dark] .hub-hero h1 span{background:linear-gradient(transparent 89%,#35584e 89%,#35584e 98%,transparent 98%)}
html[data-theme=dark] .quick-start{background:#242c46;border:1px solid #3c4667;box-shadow:0 16px 30px #0002}
html[data-theme=dark] :is(.tool-assurance,.hub-filterbar,.work-panel-head,.calc-result dl>div,.calc-result .actions,.article details,.setting-section,.recipe-table td,.recipe-table th,.calc-table td,.stage-heading){border-color:var(--line)}
html[data-theme=dark] .calc-result .big{background:#2b3655;color:#f3f5ff}
html[data-theme=dark] .calc-result dd{color:#e3e8f8}
html[data-theme=dark] :is(.calc-table th,.recipe-table th){background:#252e42;color:#c5ccdf}
html[data-theme=dark] :is(.recipe-scaled,.batch-summary span,.batch-summary p){color:#a8d3c3}
html[data-theme=dark] :is(.dropzone,#qr-placeholder){background:#202638;border-color:#675c89;color:#b9b3d2}
html[data-theme=dark] .dropzone.dragging{background:#34304c;border-color:#b1a3dc}
html[data-theme=dark] .batch-steps b{background:#343a50;color:#e1d9fb}
html[data-theme=dark] :is(.batch-alert,.file-status){background:#243e36;color:#bee4cc}
html[data-theme=dark] :is(.error,.warning,.inline-warning,.photo-error,.calc-result .big.error){color:#ffc2b5!important}
html[data-theme=dark] :is(.runtime-notice,.batch-alert.warning,.unmet .file-status,.error .file-status,.calc-result .big.error){background:#422e2d;border-color:#75524b;color:#ffd6bd}
html[data-theme=dark] .party .party-stage{background:#1e2231;border-color:#3d344b}
html[data-theme=dark] :is(.party-tip,.winner,.deal-station){background:#2b273c;border-color:#4a405f;color:#d2c1df}
html[data-theme=dark] :is(.party-welcome h2,.winner strong){color:#ddc7ef}
html[data-theme=dark] .wheel-legend span{background:#292a3d;color:#ded6eb}
html[data-theme=dark] .team-card h3{color:#453e55}
html[data-theme=dark] .ladder-labels button{background:#393047;color:#ecddf7;border-color:#6d5e80}
html[data-theme=dark] .ladder-labels .revealed{background:#3c5149;color:#daf0df}
html[data-theme=dark] .ladder-svg{background:#fffdfb;border-radius:10px}
html[data-theme=dark] .ladder-result-row{border-color:var(--line);background:#282d40;color:#e5dced}
html[data-theme=dark] a:focus-visible,html[data-theme=dark] button:focus-visible,html[data-theme=dark] input:focus-visible,html[data-theme=dark] textarea:focus-visible,html[data-theme=dark] select:focus-visible,html[data-theme=dark] summary:focus-visible{outline-color:#e3c68b}
@media(max-width:580px){html[data-theme=dark] .recipe-table tr{background:var(--surface);border-color:var(--line)}html[data-theme=dark] .recipe-table td:nth-child(5){background:#283d37;color:#c6e9d8}}

html[data-theme=dark] :is(.eyebrow,.brand small,.party-result){color:#b8b2d2}
html[data-theme=dark] :is(.party-result-actions button,.party-reveal-controls button){background:#3c334e!important;border-color:#6f5b83!important;color:#e0cfee!important}
html[data-theme=dark] .suggest-frame{background:#fff;color-scheme:light;border-radius:12px}
