/* Shared theme tokens. Specific overrides cover the earlier fixed-color styles. */
:root{color-scheme:light;--theme-page:#fff;--theme-panel:#fff;--theme-soft:#f5f7fb;--theme-ink:#172b46;--theme-copy:#42536b;--theme-muted:#5e6f84;--theme-line:#d8e2ef;--theme-link:#245bd6}
:root[data-theme=dark]{color-scheme:dark;--theme-page:#0f1725;--theme-panel:#162235;--theme-soft:#1d2c42;--theme-ink:#e5edf8;--theme-copy:#c0cee1;--theme-muted:#a3b4cc;--theme-line:#354861;--theme-link:#8bb7ff;--bg:#1d2c42;--white:#162235;--panel:#162235;--panel2:#1d2c42;--border:#354861;--line:#354861;--border-focus:#8bb7ff;--text:#e5edf8;--text2:#c0cee1;--muted:#a3b4cc;--accent:#8bb7ff;--accent-hover:#aacaff;--accent-light:#213958;--green:#6ee7b7;--green-bg:#12382e;--green-border:#35735f;--red:#ffabab;--red-bg:#40252c;--red-border:#89505a;--amber:#f7d27c;--amber-bg:#3d321c;--amber-border:#806b37;--ok:#6ee7b7;--warn:#f7d27c;--bad:#ffabab}
.display-controls{display:flex;align-items:center;gap:10px;min-width:0}
.nav-inner .display-controls .language-switch{margin:0}
.theme-switch{position:relative;flex-shrink:0;line-height:1;max-width:160px}
.theme-switch[hidden]{display:none}
.theme-switch select{height:36px;max-width:100%;padding:0 23px 0 32px;border:1px solid var(--theme-line);border-radius:6px;background:var(--theme-panel);color:var(--theme-copy);font:13px 'Pport UI',system-ui,sans-serif;cursor:pointer}
.theme-icon{position:absolute;left:9px;top:9px;width:18px;height:18px;color:var(--theme-copy);pointer-events:none}
.theme-icon>*{display:none}
html[data-theme-choice=system] .theme-system,html[data-theme-choice=light] .theme-light,html[data-theme-choice=dark] .theme-dark{display:block}
.theme-switch select:focus-visible{outline:2px solid var(--theme-link);outline-offset:3px}
html[data-theme=dark] body{background:var(--theme-page);color:var(--theme-ink)}
html[data-theme=dark] :is(.nav,.sidebar,.tool-box,.auth,body>header,body>footer,.footer,.input,input,.chip,.language-switch select,.language-switch button,.panel select){background:var(--theme-panel);border-color:var(--theme-line);color:var(--theme-ink)}
html[data-theme=dark] :is(.nav-logo,.logo,.field-label,label,.sidebar-group h2,.cat-block h2,.footer-h,.doc-table td:first-child,.client-tool label,.utility-options label,#punyResult label,.port-usage-metrics dd,.board-limits dd){color:var(--theme-ink)}
html[data-theme=dark] :is(.nav-link,.sidebar a,.lead,.tool-page .lead,.doc p,.tool-page .doc p,.doc-list,.reading-guide li,.reading-guide h2,.contents-nav a,.faq-a,.kv dt,.field-hint,.tool-card-desc,.board-policy p,.board-own p,.board-compose p,.board-limits dt,.port-usage-metrics dt,.port-reset,.port-usage-summary,.port-usage>p,.port-limit-details,.client-tool .field-help,.sub,.recovery,.members,.session-note,.field .hint){color:var(--theme-copy)}
html[data-theme=dark] :is(.crumb a,.crumb ol,.nav-logo em,.logo small,.contents-label,.command-example figcaption,.port-presets-label,.port-scope,.related-label,.catalog-heading p,.sources h2,.sources a,.footer-col a,.footer-bottom,.footer-bottom a,.board-compose small,.board-list article p,.text-metrics dt){color:var(--theme-muted)}
html[data-theme=dark] .sources p{color:var(--theme-muted)!important}
html[data-theme=dark] :is(a,.back,.auth-context,.page-eyebrow,.board-policy summary,.port-limit-details summary,.label-row button,.text-metrics dd){color:var(--theme-link)}
html[data-theme=dark] :is(.btn,.submit){background:#245bd6;color:#fff;border-color:#477cdb}
html[data-theme=dark] :is(.btn,.submit):hover{background:#1b4ebc}
html[data-theme=dark] :is(.btn-sub,.btn.sub,.doc-table th,.note,.message,input[readonly],.board-compose details.board-policy,.size-result){background:var(--theme-soft);color:var(--theme-copy);border-color:var(--theme-line)}
html[data-theme=dark] :is(.btn-sub,.btn.sub):hover{background:#29405c;color:var(--theme-ink)}
html[data-theme=dark] :is(.sidebar a.active,.sidebar a:hover,.nav-link:hover,.chip:hover,.chip.on,.tool-card:hover){background:#213958;color:var(--theme-link)}
html[data-theme=dark] :is(.reading-guide,.catalog-heading,.cat-block h2,.tool-card,.table-wrap,.doc-table td,.doc-table th,.doc .doc-table tr,.faq details,.sources,.footer-bottom,.members,.board-policy,.board-own,.board-compose,.board-list,.board-list article,.board-admin-post,.text-metrics,#punyResult,.port-usage){border-color:var(--theme-line)}
html[data-theme=dark] :is(.input,input)::placeholder{color:var(--theme-muted)}
html[data-theme=dark] :is(.command-example pre,pre.cmd){background:#09111e;color:#dbeafe;border-color:var(--theme-line)}
html[data-theme=dark] .port-target{background:#163b70;color:#fff}
html[data-theme=dark] .port-target .field-label{color:#d9e6fb}
html[data-theme=dark] #ptResult{background:var(--theme-soft);border-color:var(--theme-line);border-left-color:var(--theme-link)}
html[data-theme=dark] #ptResult :is(.result-title,.port-result-target){color:var(--theme-ink)}
html[data-theme=dark] #ptResult summary{color:var(--theme-link)}
html[data-theme=dark] :is(#ptResult.ok,.msg.ok){background:var(--green-bg);border-color:var(--green-border);color:var(--green)}
html[data-theme=dark] :is(#ptResult.bad,.msg.err,.message.error,.size-no){background:var(--red-bg);border-color:var(--red-border);color:var(--red)}
html[data-theme=dark] :is(#ptResult.warn,.msg.warn,.notice){background:var(--amber-bg);border-color:var(--amber-border);color:var(--amber)}
html[data-theme=dark] #ptResult.ok .badge{color:var(--green)}html[data-theme=dark] #ptResult.bad .badge{color:var(--red)}html[data-theme=dark] #ptResult.warn .badge{color:var(--amber)}
html[data-theme=dark] .badge.ok{background:#14734a;color:#fff}html[data-theme=dark] .badge.bad{background:#a52727;color:#fff}html[data-theme=dark] .badge.warn{background:#805400;color:#fff}
html[data-theme=dark] .badge.info{background:#294b78;color:#e5edf8}
html[data-theme=dark] .size-ok{color:#a7caff}html[data-theme=dark] .port-quota-status{color:#ffabab!important}
html[data-theme=dark] .msg.info{background:#213958;color:#a7caff;border-color:var(--theme-line)}
html[data-theme=dark] .panel th{background:var(--theme-soft);color:var(--theme-copy)}
html[data-theme=dark] .doc .doc-table td::before{color:var(--theme-muted)}
html[data-theme=dark] :is(.listening-help h2,.listening-steps h3,.board-policy h2,.board-list h2,.board-own h2,.board-compose h2){color:var(--theme-ink)}
html[data-theme=dark] :is(.listening-help p,.listening-help li){color:var(--theme-copy)}
html[data-theme=dark] :is(.doc-steps,.doc-steps li){color:var(--theme-copy)}
html[data-theme=dark] a.btn{background:#245bd6;color:#fff}
html[data-theme=dark] :is(.listening-help summary,.listening-options summary){color:var(--theme-link)}
html[data-theme=dark] :is(.listening-command pre,.listening-options code,.listening-steps){background:var(--theme-soft);color:var(--theme-ink);border-color:var(--theme-line)}
html[data-theme=dark] :is(.listening-help,.listening-options){border-color:var(--theme-line)}
html[data-theme=dark] :is(.nav,header) :focus-visible{outline-color:var(--theme-link)}
@media(max-width:1100px){.theme-switch{width:38px}.theme-switch select{width:38px;padding:0;appearance:none;color:transparent}.theme-switch option{color:var(--theme-ink);background:var(--theme-panel)}.theme-icon{left:10px}.nav-inner{gap:14px}.nav-link{padding-left:9px;padding-right:9px}}
@media(max-width:800px){.nav-inner .display-controls{grid-column:2;grid-row:1;justify-self:end;gap:6px}.nav-inner .display-controls .language-switch select{max-width:120px}.nav-inner .display-controls .language-switch{flex-basis:auto}.login-header-actions{gap:8px}.login-header-actions .display-controls{gap:6px}.login-header-actions .language-switch select{max-width:115px}}
@media(max-width:360px){.nav-inner .display-controls .language-switch select{max-width:100px}.nav-inner{column-gap:6px}.nav-logo{font-size:17px;gap:5px}}
