/* Shared appearance layer. Loaded last on every public page. */
:root {color-scheme:light}
.theme-toggle {display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:44px;min-height:44px;padding:10px 13px;flex-shrink:0;border:1px solid var(--line,#273c262c);border-radius:28px;background:transparent;color:var(--ink,#142019);font:600 12px/1 Archivo,Arial,sans-serif;cursor:pointer;white-space:nowrap}
.theme-toggle:hover {background:#71826716}
.theme-toggle:focus-visible {outline:2px solid var(--blue,#315cd7);outline-offset:4px}
.theme-toggle svg {width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round;flex:none}
.theme-toggle .theme-sun {display:none}
[data-theme=dark] .theme-toggle .theme-sun {display:block}
[data-theme=dark] .theme-toggle .theme-moon {display:none}
.theme-toggle[hidden] {display:none}
.error-header {display:flex;align-items:center;justify-content:space-between;gap:20px}

:root[data-theme=dark] {
 color-scheme:dark;
 --wall:#101914;--plate:#1a2920;--panel:#1a2920;--ink:#e6eddf;
 --mute:#a7b5a3;--muted:#a7b5a3;--line:#9ab58c30;
 --blue:#7da2ff;--green:#9bc57e;--lime:#d0ee87;
 --dark:#121f18;--dark2:#203126;--dark-mute:#a7b5a3;
 --surface:#203126;--surface-hover:#2b4030;--field:#132219;
 --positive:#b5db92;--negative:#ffaaa0;--warning:#eac18b;
 background:var(--wall);color:var(--ink);
}
[data-theme=dark] body {background:var(--wall);color:var(--ink)}
[data-theme=dark] ::selection {background:#315cd7;color:#fff}
[data-theme=dark] :is(.brand span,.wordmark .brand-dot) {color:#477bff}
[data-theme=dark] :is(header nav,.site-header nav) {background:var(--surface);border-color:var(--line)}
[data-theme=dark] nav [aria-current] {background:#354932;color:var(--ink)}
[data-theme=dark] :is(.button.solid,.button.dark,.button.primary,.button.lime,.route-review,.noscript-note) {background:var(--lime);border-color:var(--lime);color:#162018}
[data-theme=dark] :is(.button.solid,.button.dark,.button.primary,.button.lime,.route-review):hover:not(:disabled) {background:#e1f6b4;border-color:#e1f6b4}
[data-theme=dark] .button.quiet {background:var(--surface-hover);border-color:var(--line);color:var(--ink)}
[data-theme=dark] :is(.skip,.skip-link) {background:var(--lime);color:#162018}
[data-theme=dark] :is(.intro h1 em,.discovery h1 em) {color:#a9c69a}
[data-theme=dark] :is(.lede,.compare-heading>p:last-child,.limit-content p,.help-items p,footer p) {color:var(--muted)}
[data-theme=dark] :is(input,select,textarea) {background:var(--field);color:var(--ink);border-color:#87a77b4d}
[data-theme=dark] :is(input,select,textarea)::placeholder {color:#9bab94}
[data-theme=dark] :is(input,select,textarea):focus {border-color:var(--blue);background:#1a2c20}
[data-theme=dark] :is(input[type=checkbox],input[type=radio]) {accent-color:var(--lime)}
[data-theme=dark] :is(label,.picker-label) {color:var(--muted)}
[data-theme=dark] :is(.text-link,.project-links a,.detail-actions>a) {border-color:#9db58f66}
[data-theme=dark] :is(dialog,.panel,.search-panel,.trade-panel,.methodology article,.connection,.live-access,.radar-card) {background:var(--panel);border-color:var(--line)}
[data-theme=dark] dialog {color:var(--ink);box-shadow:0 30px 100px #0008}
[data-theme=dark] dialog::backdrop {background:#020905b3}
[data-theme=dark] :is(.dialog-close,.wallet-choice,.modal-choice,.slip-options button,.compare-card) {background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme=dark] :is(.wallet-choice,.modal-choice,.slip-options button):hover {background:var(--surface-hover)}
[data-theme=dark] :is(.close-modal,.modal-copy,.modal-row span,.modal-choice small,.picker-help) {color:var(--muted)}
[data-theme=dark] :is(.modal-row,.chart-area,.chart-table td,.chart-table th) {border-color:var(--line)}
[data-theme=dark] :is(.slip-options button[aria-pressed=true],.type-tabs button[aria-pressed=true],.type-tabs button[aria-pressed=true]:hover) {background:var(--lime);border-color:var(--lime);color:#162018}
[data-theme=dark] :is(.modal-notice,.stock-asset-note,.swap-explanation,.transaction-activity) {background:#263922;border-color:#b4d78833;color:#d0e1bb}
[data-theme=dark] :is(.header-social a:hover,.quick-tokens button:hover,.target-presets button:hover,.type-tabs button:hover,.detail-actions>a:hover,.project-links a:hover) {background:var(--surface-hover);color:var(--ink)}

/* Swap and token selection. Keep charts and the original 3D materials intact. */
[data-theme=dark] :is(.trade-panel .amount-card,.trade-panel .receive-card,.token-button,.scene-fallback button) {background:var(--field);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .amount-row input {background:transparent}
[data-theme=dark] :is(.trade-head,.trade-head .mono,.field-top,.field-bottom,.field-bottom button,.route-empty,.route-hop,.route-result small,.route-gross,.quote-details,.preview-note,.snapshot,.source-row small,.source-status,.coverage-panel,.trade-detail button,.asset-label small,.path-label b,.comparison-note,.bar-heading small,.size-control label,.watchlist>span) {color:var(--muted)}
[data-theme=dark] .quote-details strong {color:var(--ink)}
[data-theme=dark] :is(.route-shortcuts button,.field-top #load-balance) {color:var(--blue)}
[data-theme=dark] :is(.reverse-row button,.trade-detail button,.route-option,.source-row) {border-color:var(--line)}
[data-theme=dark] .reverse-row span {background:var(--line)}
[data-theme=dark] .reverse-row button {background:var(--surface);color:var(--ink)}
[data-theme=dark] .route-option {background:var(--surface);color:var(--ink)}
[data-theme=dark] .route-option.selected {background:#203143;border-color:#7da2ff8c}
[data-theme=dark] .route-option:hover {border-color:var(--blue)}
[data-theme=dark] .route-option .radio {border-color:#8ba07c}
[data-theme=dark] .route-option.selected .radio {border-color:var(--blue);background:#102438}
[data-theme=dark] .route-name em {background:#accf811a;color:#c0d9a5}
[data-theme=dark] .route-option.selected .route-name em {background:#7da2ff21;color:#bfd2ff}
[data-theme=dark] .path-label {background:#1d2c23ed;border-color:var(--line);color:var(--ink);box-shadow:0 3px 15px #0002}
[data-theme=dark] .path-label.active {background:#21322d;border-color:#7da2ff7a}
[data-theme=dark] :is(.compare-section,.limits-section,.help-section) {background:#142119}
[data-theme=dark] .comparison .route-empty {background:var(--panel);border-color:var(--line)}
[data-theme=dark] .bar-track {background:#30432f}
[data-theme=dark] .bar-fill {background:#6d8757}
[data-theme=dark] .comparison-row.active .bar-fill {background:#6893fb}
[data-theme=dark] :is(.browse-stocks,.route-picker-input,.stock-search,#report-text) {background:var(--surface);border-color:var(--line);color:var(--ink)}
[data-theme=dark] .browse-stocks:hover {background:var(--surface-hover)}
[data-theme=dark] :is(.browse-stocks small,.stock-picker-meta,.stock-picker-intro,.stock-picker-note,.stock-empty,.stock-asset-note p,.stock-asset-note p a,.stock-picker-note a,.custom-token-details summary,.token-choice small,.token-choice .picker-contract,.route-summary-note,.swap-token-note,.swap-contracts,.swap-loading,.swap-review-pair span,.transaction-activity small) {color:var(--muted)}
[data-theme=dark] :is(.asset-categories,.ranking-switch) {background:var(--field);border-color:var(--line)}
[data-theme=dark] .ranking-switch button {color:var(--muted)}
[data-theme=dark] .ranking-switch button[aria-pressed=true] {background:#344b2c;color:#edf4e6}
[data-theme=dark] .asset-categories button {color:var(--muted)}
[data-theme=dark] .asset-categories button[aria-pressed=true] {background:#334b2f;color:var(--ink)}
[data-theme=dark] .token-choice[aria-pressed=true] {background:#203143;border-color:var(--blue)}
[data-theme=dark] .token-choice.stock-choice>.stock-avatar {background:#30432b;color:#d3e1c6;border-color:var(--line)}
[data-theme=dark] :is(.swap-steps,.swap-review-pair>div,.custom-token-details,.stock-asset-note>div>a span) {border-color:var(--line)}
[data-theme=dark] .swap-review-pair>div {background:var(--surface)}
[data-theme=dark] .swap-review-pair>div:last-child {background:#2b4026}
[data-theme=dark] .swap-steps>span {color:var(--muted)}
[data-theme=dark] .swap-steps .current {color:var(--lime)}
[data-theme=dark] .swap-steps .current b {background:var(--lime);color:#162018}
[data-theme=dark] :is(.swap-message,.source-status.quoted) {color:var(--positive)}
[data-theme=dark] :is(.success-mark,.failure-mark) {color:#162018}

/* Radar: the control panels, forms and account dialogs use the same surfaces. */
[data-theme=dark] .mode-switch {background:var(--field);border-color:var(--line)}
[data-theme=dark] .mode-switch input:checked+span {background:#344b2c;color:#eaf0e1}
[data-theme=dark] .mcap-preview {background:#b6d68a0a;border-color:var(--line)}
[data-theme=dark] .connection-icon {background:var(--surface);border-color:var(--line)}
[data-theme=dark] .connection-icon svg {stroke:#b7d798}
[data-theme=dark] :is(.connection>p:not(.micro),.included,.live-copy p,.free-line p,.access-details) {color:var(--muted)}
[data-theme=dark] .live-badge {color:var(--lime);border-color:#b2d78155}
[data-theme=dark] .free-line>span {background:#b0c29c19}
[data-theme=dark] .watch-explainer {color:var(--muted)}
[data-theme=dark] #message {background:#2b4228;color:#d7e9c1}

/* Earn: preserve its red risk flags and readable comparison overlays. */
[data-theme=dark] :is(.watches,.opportunities,.quote-panel) {background:var(--dark);border-color:#9ab58c30}
[data-theme=dark] :is(.detail-flags span,.screening-notice.is-included) {background:#d9b5810d;color:var(--warning);border-color:#d9b58144}
[data-theme=dark] .detail-flags span.high-risk {background:#f47e7812;color:#ffaaa5;border-color:#f47e7877}
[data-theme=dark] :is(.compare-card .high-risk-rate,.compare-flags .high-risk,.extended-index .high-risk-rate) {color:#ffaaa5}
[data-theme=dark] :is(.extended-index>p,.discovery-row small,.protocol-directory summary span,.coverage-row small) {color:var(--muted)}
[data-theme=dark] :is(.extended-index input,.protocol-directory input) {background:var(--field);color:var(--ink);border-color:var(--line)}
[data-theme=dark] :is(.discovery-row,.coverage-row) {border-color:var(--line)}
[data-theme=dark] .coverage-state {color:var(--warning)}
[data-theme=dark] .coverage-state.connected {color:var(--positive)}
[data-theme=dark] .extended-index .detail-button {color:var(--ink);border-color:var(--line)}
[data-theme=dark] .extended-index .detail-button:hover {background:var(--surface-hover)}

/* Errors must remain distinct on dark surfaces. */
[data-theme=dark] :is(#form-message,#message.error,#page-message) {background:#3b2b23;color:#ffd0ae;border-color:#bf916157}
[data-theme=dark] :is(.preview-note.error,.source-error,.source-status.unavailable,.swap-message.error,.quote-details .impact-high) {color:var(--negative)}
[data-theme=dark] :is(.snapshot .stale,.source-status.partial) {color:var(--warning)}
[data-theme=dark] :is(.asset-results,.route-options,#discovery-list,#coverage-list) {scrollbar-color:#627858 transparent}
[data-theme=dark] .error-header~main p {color:var(--muted)}

/* Compact header placement never hides the appearance control. */
.site-header .header-actions {gap:10px}
@media(min-width:801px) and (max-width:1320px) {
 .site-header .network {display:none}
 .site-header {gap:14px}
 .site-header nav {gap:2px;padding-inline:8px}
 .site-header nav a {padding-inline:8px}
 .site-header .header-social a {padding-inline:10px}
}
@media(max-width:1100px) {
 .theme-toggle {width:44px;padding:10px}
 .theme-toggle [data-theme-label] {display:none}
 body>header:not(.site-header) {gap:14px}
}
@media(max-width:800px) {
 .site-header {grid-template-columns:minmax(0,1fr) auto}
 .site-header .header-actions {gap:6px}
 .site-header nav a {padding-inline:10px}
}
@media(max-width:560px) {
 body>header:not(.site-header) {flex-wrap:wrap;gap:12px}
 body>header:not(.site-header) .brand {order:0}
 body>header:not(.site-header) .theme-toggle {order:1;margin-left:auto}
 body>header:not(.site-header) nav {order:2;width:100%;margin:0;justify-content:space-between}
 body>header:not(.site-header) nav a {flex:1;text-align:center;padding:9px 12px}
 body>header:not(.site-header) #wallet {order:3}
}

/* Compact, theme-aware DEX Screener mark next to the existing social links. */
.social-links a.dex-link {width:44px;min-height:44px;padding:10px;flex:none}
.dex-icon {display:block;width:20px;height:22px;background:currentColor;mask:url('/dexscreener.svg') center/contain no-repeat;-webkit-mask:url('/dexscreener.svg') center/contain no-repeat}
@media(max-width:560px) {
 .site-header .header-social {gap:5px}
 .site-header .header-social a {padding-inline:10px;font-size:11px}
 .site-header .header-social .dex-link {padding:10px}
 .site-header nav a {padding-inline:8px}
}
@media(max-width:380px) {
 .site-header:has(nav a[href="/token/"]) nav {grid-column:1/-1;grid-row:2}
 .site-header:has(nav a[href="/token/"]) .header-social {grid-column:1/-1;grid-row:3;justify-self:start}
}
