/* Shared palette has higher specificity than OS-only defaults and legacy skins. */
:root[data-theme] { color-scheme:light; --ink:#172b44; --muted:#526579; --line:#dce4ea; --teal:#0c756c; --accent:#147d73; --bg:#f5f7fa; --white:#fff; --shadow:0 8px 28px rgba(23,43,68,.04); --soft:#eaf4f1; --soft-line:#aaccc2; --soft-ink:#3c5f54; --warning:#fff7e6; --warning-line:#ecd9b4; --warning-ink:#74531d; --field:#fbfcfd; --field-line:#cbd5df; --quiet:#edf2f5; --hover:#f7faf9; --error:#a33131; --danger:#fff0ed; --primary-hover:#095e57; }
:root[data-theme="dark"] { color-scheme:dark; --ink:#e7edf4; --muted:#b0becd; --line:#35485b; --teal:#72d3bc; --accent:#72d3bc; --bg:#0e1923; --white:#15222d; --shadow:none; --soft:#1d3533; --soft-line:#3b625b; --soft-ink:#c0dfd5; --warning:#382c18; --warning-line:#765f35; --warning-ink:#f0d19c; --field:#101e2a; --field-line:#536779; --quiet:#233543; --hover:#1b303d; --error:#ffaaa2; --danger:#432926; --primary-hover:#93e3cf; }
.display-preferences { display:flex; align-items:center; justify-self:end; gap:10px; min-width:0; max-width:100%; }
.theme-toggle { display:inline-grid; place-items:center; flex:0 0 44px; width:44px; height:44px; padding:0; border:1px solid var(--line); border-radius:8px; background:var(--white); color:var(--ink); font-size:24px; line-height:1; cursor:pointer; }
.theme-toggle:hover { background:var(--soft); }
.theme-toggle:focus-visible { outline:3px solid var(--teal); outline-offset:3px; }
.theme-status { position:fixed; z-index:1000; inset:auto 16px 16px; max-width:680px; margin:auto; padding:12px 20px; border:1px solid var(--warning-line); border-radius:8px; color:var(--warning-ink); background:var(--warning); font-size:14px; overflow-wrap:anywhere; }
@media(max-width:1100px) { .site-header-inner > .display-preferences { grid-column:2; grid-row:1; } }
@media(max-width:640px) { .display-preferences { gap:8px; } }
/* Limit legacy fixed-color replacements to the extension dashboard. */
:root[data-theme] .extension-dashboard { background:var(--bg); color:var(--ink); }
:root[data-theme] .extension-dashboard :is(.card,.summary-card,.footer-card,.store-card,.results-card,.empty-state,.theme-toggle) { background:var(--white); border-color:var(--line); }
:root[data-theme] .extension-dashboard :is(input,textarea,select,.advanced,.collector-help) { background:var(--field); color:var(--ink); border-color:var(--field-line); color-scheme:inherit; }
:root[data-theme] .extension-dashboard :is(th,.empty-icon,.seed-badge,.small-tag) { background:var(--quiet); color:var(--muted); }
:root[data-theme] .extension-dashboard :is(.best,.tab-import-btn,.status-chip.ok) { background:var(--soft); border-color:var(--soft-line); color:var(--soft-ink); }
:root[data-theme] .extension-dashboard :is(.status-chip.bad) { background:var(--danger)!important; color:var(--error)!important; border-color:var(--error)!important; }
:root[data-theme] .extension-dashboard :is(.status-chip.blocked,.context-warning) { background:var(--warning); color:var(--warning-ink); border-color:var(--warning-line); }
:root[data-theme] .extension-dashboard :is(.actions button,.speed-presets button,.cid-tools button,.fileBtn,.open-btn,.btn-back) { background:var(--white); color:var(--teal); border-color:var(--line); }
:root[data-theme] .extension-dashboard .actions .primary { background:var(--teal); color:var(--white); border-color:var(--teal); }
:root[data-theme] .extension-dashboard .actions .primary:hover:not(:disabled) { background:var(--primary-hover); border-color:var(--primary-hover); }
:root[data-theme] .extension-dashboard :is(.retry-btn,.open-btn,.btn-back,.tab-import-btn):hover:not(:disabled) { background:var(--soft)!important; }
:root[data-theme] .extension-dashboard :is(.error-msg,.mini,.stop-btn) { color:var(--error)!important; }
:root[data-theme] .extension-dashboard :is(.brand,.intro h1,h2,h3,.route-name,.summary-card strong,.price) { color:var(--ink); }
:root[data-theme] .extension-dashboard :is(.badge,.brand small,.cid-src,.cid-region,.cid-num,.footer-line,.muted,.field-help,.store-breakdown) { color:var(--muted); }
:root[data-theme] .extension-dashboard tbody tr:hover { background:var(--hover); }
:root[data-theme] .extension-dashboard .result-toolbar select { color-scheme:inherit; }

:root[data-theme] { color:var(--ink); background:var(--bg); }
:root[data-theme] .extension-dashboard :is(.steps,.result-note,.failure-reason,.notice strong,summary,td:first-child) { color:var(--muted); }
:root[data-theme] .extension-dashboard :is(.steps li>span,.summary-card.accent,.count-pill,.empty-state>span,.speed-presets button[aria-pressed="true"],.translation-unavailable) { background:var(--soft); color:var(--soft-ink); border-color:var(--soft-line); }
:root[data-theme] .extension-dashboard :is(pre,.progress) { background:var(--quiet); color:var(--ink); }
:root[data-theme] .extension-dashboard :is(.best-route,.best .saving) { color:var(--soft-ink); }
:root[data-theme] .extension-dashboard :is(textarea,input)::placeholder { color:var(--muted); opacity:1; }
:root[data-theme] .extension-dashboard :is(.status[data-kind="error"],.actions #stopBtn) { color:var(--error); }
:root[data-theme] .extension-dashboard.is-running .stop-btn:not(:disabled) { background:var(--danger)!important; color:var(--error)!important; border-color:var(--error)!important; }
:root[data-theme] .extension-dashboard textarea[aria-invalid="true"] { border-color:var(--error)!important; }
:root[data-theme] .extension-dashboard :is(.actions button,.speed-presets button,.fileBtn,.cid-tools button):hover:not(:disabled) { background:var(--soft); border-color:var(--soft-line); }
:root[data-theme] .extension-dashboard .skip-link { background:var(--white); color:var(--ink); }
@media(max-width:640px) { .extension-dashboard .topbar { height:auto; min-height:94px; flex-wrap:wrap; padding-block:12px; } .extension-dashboard .topbar .badge { flex-basis:100%; } .extension-dashboard .topbar .display-preferences { margin-inline-start:auto; } .extension-dashboard .topbar .language-picker select { width:116px; } }

/* Shared outlined theme controls and aligned extension header. */
.theme-toggle [data-theme-icon][hidden]{display:none}
.theme-symbol{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;transition:transform .18s ease}
.theme-symbol-sun{display:none}
.theme-toggle[data-mode="dark"] .theme-symbol-moon{display:none}
.theme-toggle[data-mode="dark"] .theme-symbol-sun{display:block}
.theme-toggle:hover .theme-symbol{transform:rotate(-10deg)}
.extension-dashboard .topbar{display:flex;justify-content:space-between;gap:20px;flex-wrap:wrap}
.dashboard-brand-group{display:flex;align-items:center;gap:12px;min-width:0}
.extension-dashboard .topbar>.display-preferences{margin-inline-start:auto;flex-shrink:0}
.comparison-tabs{display:flex;flex-wrap:wrap;gap:8px;border-bottom:1px solid var(--line);padding-block:8px 12px}
.comparison-tabs a{display:inline-flex;align-items:center;min-height:44px;padding:8px 14px;border-radius:8px;color:var(--muted);text-decoration:none}
.comparison-tabs a[aria-current="page"]{background:var(--soft);color:var(--teal);font-weight:600}
.comparison-tabs a:hover{background:var(--soft)}
.comparison-tabs a:focus-visible{outline:3px solid var(--teal);outline-offset:2px}
.storage-note{display:flex;align-items:center;gap:8px;color:var(--muted);font-size:12px;margin:12px 0}
@media(prefers-reduced-motion:reduce){.theme-symbol{transition:none}.theme-toggle:hover .theme-symbol{transform:none}}

/* One header mark size across the site and extension; preserve the artwork. */
:root{--brand-mark-size:48px}
.site-header .logo img,.extension-dashboard .brand-icon{width:var(--brand-mark-size);height:var(--brand-mark-size);flex-shrink:0}

/* One visual language for the public pages and installed comparison screen. */
:root[data-theme] body{font-family:system-ui,-apple-system,"Segoe UI",Roboto,"Noto Sans",sans-serif;line-height:1.6}
:root[data-theme] :is(button,input,textarea,select){font-family:inherit}
:root[data-theme] :is(.btn-primary,.btn-secondary,.btn-open,.btn-install,.extension-dashboard .actions button,.extension-dashboard .fileBtn){border-radius:10px;min-height:44px;line-height:1.5}
:root[data-theme] :is(button,a,input,textarea,select,summary):focus-visible{outline:3px solid var(--teal);outline-offset:3px}
:root[data-theme] button:disabled{cursor:not-allowed}
:root[data-theme] .extension-support{margin-top:24px;padding:20px;border:1px solid var(--line);border-radius:12px;background:var(--white)}
:root[data-theme] .extension-status{display:grid;grid-template-columns:minmax(0,1fr);min-block-size:0;gap:0;align-items:start}
:root[data-theme] .extension-status>:is(.install-hint,.connection-copy-reserve){grid-area:1/1;margin:0;font-size:14px;line-height:1.7;overflow-wrap:anywhere}
/* Translated inert copies reserve the tallest normal state without a fixed height. */
:root[data-theme] .connection-copy-reserve{visibility:hidden;pointer-events:none;user-select:none}
:root[data-theme] .install-hint{line-height:1.7;overflow-wrap:anywhere}
:root[data-theme] .extension-tools{gap:8px 16px;margin-top:12px;align-items:center}
:root[data-theme] :is(.extension-tools .btn-manual-small,.extension-tools .manual-toggle){padding:8px 12px;border:1px solid var(--line);border-radius:10px;background:var(--white);color:var(--teal);text-decoration:none}
:root[data-theme] :is(.extension-tools .btn-manual-small,.extension-tools .manual-toggle):hover{background:var(--soft);border-color:var(--soft-line)}
:root[data-theme] .manual-steps{padding:16px;margin-top:16px;background:var(--field);border-color:var(--line);border-radius:10px}
:root[data-theme] .code-copy{display:flex;align-items:center;flex-wrap:wrap;gap:12px}
:root[data-theme] .code-copy code{min-width:0;overflow-wrap:anywhere;color:var(--ink)}
:root[data-theme] .code-copy button{min-height:44px;border:1px solid var(--line);border-radius:10px;background:var(--white);color:var(--teal)}
:root[data-theme] :is(.site-footer,.extension-dashboard .footer-card){color:var(--muted);background:var(--white);border-color:var(--line)}
:root[data-theme] .extension-dashboard .footer-card{margin-top:32px;padding:24px;border:1px solid var(--line);border-radius:12px;box-shadow:none}
:root[data-theme] .extension-dashboard .footer-card .notice{padding:0;background:transparent;border:0}
:root[data-theme] .extension-dashboard .footer-card .notice strong{display:block;color:var(--ink);font-size:16px;font-weight:600}
:root[data-theme] .extension-dashboard .footer-card .notice p{margin:8px 0 0;font-size:14px;line-height:1.8;color:var(--muted)}
:root[data-theme] .extension-dashboard .collector-help{margin-top:20px;padding:16px;background:var(--field);border:1px solid var(--line);border-radius:10px}
:root[data-theme] .extension-dashboard .collector-help summary{min-height:44px;align-content:center;color:var(--ink);font-size:14px;font-weight:600;cursor:pointer}
:root[data-theme] .extension-dashboard .collector-help pre{margin:12px 0 0;padding:12px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:12px;border-radius:8px;background:var(--quiet);color:var(--ink)}
:root[data-theme] .extension-dashboard .footer-line{display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:12px 24px;margin-top:20px;padding-top:16px;border-top:1px solid var(--line);font-size:14px}
:root[data-theme] :is(.footer-brand,.site-footer-inner>span:first-child){font-weight:600;color:var(--ink)}
:root[data-theme] .footer-links{display:flex;align-items:center;flex-wrap:wrap;gap:8px 20px}
:root[data-theme] :is(.footer-line,.site-footer) a{display:inline-flex;align-items:center;min-height:44px;color:var(--teal);text-underline-offset:4px;overflow-wrap:anywhere}
@media(max-width:640px){:root[data-theme] .extension-support{padding:16px}:root[data-theme] .extension-dashboard .footer-card{padding:20px;margin-top:24px}:root[data-theme] .extension-dashboard .footer-line{align-items:flex-start;flex-direction:column}:root[data-theme] .extension-tools>*{max-width:100%;white-space:normal}}

/* Comparison controls: stable state hierarchy, readable results and touch targets. */
:root[data-theme] .extension-dashboard :is(.section-title,.url-input-header,.result-toolbar){gap:12px 16px;flex-wrap:wrap}
:root[data-theme] .extension-dashboard :is(.card,.summary-card){border-radius:12px;box-shadow:none}
:root[data-theme] .extension-dashboard :is(textarea,input:not([type="checkbox"]),select){border-radius:10px;font-size:16px;line-height:1.5}
:root[data-theme] .extension-dashboard textarea{resize:vertical;overflow-wrap:anywhere;min-height:96px}
:root[data-theme] .extension-dashboard .speed-presets{display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding-block:16px;margin:0;border-bottom:1px solid var(--line)}
:root[data-theme] .extension-dashboard .speed-presets button[aria-pressed="true"]{border-color:var(--teal);background:var(--soft);color:var(--soft-ink);box-shadow:inset 0 0 0 1px var(--teal)}
:root[data-theme] .extension-dashboard :is(.advanced,.store-tools){margin-top:20px;border:1px solid var(--line);border-radius:10px;padding:12px 16px;background:var(--field)}
:root[data-theme] .extension-dashboard :is(.advanced,.store-tools)>summary{min-height:44px;align-content:center;color:var(--ink);font-weight:600;cursor:pointer}
:root[data-theme] .extension-dashboard .grid4{gap:16px}
:root[data-theme] .extension-dashboard .check-field{line-height:1.7;gap:8px}
:root[data-theme] .extension-dashboard .check-field input{flex-shrink:0;accent-color:var(--teal)}
:root[data-theme] .extension-dashboard :is(.progress-heading,.scan-timing,.price,.summary-card strong){font-variant-numeric:tabular-nums}
:root[data-theme] .extension-dashboard .progress{background:var(--quiet);border-radius:999px;overflow:hidden}
:root[data-theme] .extension-dashboard #progressBar{background:var(--teal);border-radius:inherit}
:root[data-theme] .extension-dashboard #status{padding:12px 16px;margin-top:16px;border:1px solid var(--line);border-radius:10px;background:var(--field);color:var(--muted);line-height:1.7;overflow-wrap:anywhere}
:root[data-theme] .extension-dashboard #status:empty{display:none}
:root[data-theme] .extension-dashboard #status[data-kind="error"]{background:var(--danger);border-color:var(--error);color:var(--error)}
:root[data-theme] .extension-dashboard .error-msg{padding:10px 12px;border-inline-start:3px solid var(--error);border-radius:6px;background:var(--danger);line-height:1.7;overflow-wrap:anywhere}
:root[data-theme] .extension-dashboard :is(.result-note,.context-warning){line-height:1.8}
:root[data-theme] .extension-dashboard .result-toolbar{padding-block:12px;border-bottom:1px solid var(--line)}
:root[data-theme] .extension-dashboard .text-btn{min-height:44px;padding:8px 12px;border:1px solid var(--line);border-radius:10px;color:var(--teal);background:var(--white)}
:root[data-theme] .extension-dashboard :is(.price-kind,.failure-reason){font-size:13px;line-height:1.6;overflow-wrap:anywhere}
:root[data-theme] .extension-dashboard .status-chip{border-radius:8px;line-height:1.5}
:root[data-theme] .extension-dashboard .table-wrap:focus-visible{outline:3px solid var(--teal);outline-offset:3px}
@media(max-width:640px){:root[data-theme] .extension-dashboard .scan-actions{margin-inline-start:0;width:100%}:root[data-theme] .extension-dashboard .scan-actions button{min-width:0;white-space:normal}:root[data-theme] .extension-dashboard .scan-timing{display:flex;flex-direction:column;align-items:flex-start;gap:4px}:root[data-theme] .extension-dashboard .result-toolbar>*{max-width:100%}:root[data-theme] .extension-dashboard .summary-card strong{overflow-wrap:anywhere}}

/* Native selects keep platform menus, keyboard navigation and touch pickers. */
:root[data-theme] :is(.language-picker select,.input-row select,.result-navigation select,.extension-dashboard select){min-height:44px;max-width:100%;padding:10px 12px;border:1px solid var(--field-line);border-radius:10px;background-color:var(--field);color:var(--ink);font-family:inherit;font-size:16px;line-height:1.5;color-scheme:inherit;box-shadow:none;cursor:pointer}
:root[data-theme] :is(.language-picker select,.input-row select,.result-navigation select,.extension-dashboard select):hover:not(:disabled){border-color:var(--teal);background-color:var(--hover)}
:root[data-theme] :is(.language-picker select,.input-row select,.result-navigation select,.extension-dashboard select):focus-visible{border-color:var(--teal);outline:3px solid var(--teal);outline-offset:3px}
:root[data-theme] select:disabled{cursor:not-allowed;opacity:.65}
:root[data-theme] select option{background-color:var(--white);color:var(--ink)}
:root[data-theme] .language-picker{gap:8px;color:var(--muted);font-size:13px;line-height:1.5}
:root[data-theme] .extension-dashboard :is(.currency-field,.country-picker label,.result-toolbar label){gap:8px;line-height:1.5}
@media(max-width:640px){:root[data-theme] .extension-dashboard :is(.currency-field select,.country-picker select){width:100%}:root[data-theme] .language-picker select{min-width:0;max-width:100%}}

/* Preserve the manual form's 48px controls above shared 44px minimums. */
:root[data-theme] .input-card .input-row :is(select,.btn-primary){min-height:48px}
