/* Shared palette, loaded last on every operational and account screen. */
:root {
  --bg:#f7f8f5; --surface:#fff; --text:#151a15; --muted:#586255;
  --line:#dce2d6; --soft:#edf1e8; --brand:#182016; --copper:#456d10;
  --accent:#eef6d8; --success:#286244; --success-bg:#e8f3eb;
  --warning:#855614; --warning-bg:#fff1d8; --danger:#a03934; --danger-bg:#fcebea;
  --shadow:0 18px 65px #17373f14; --backdrop:#10130f70;
}
:root[data-theme=dark] {
  --bg:#10130f; --surface:#191d17; --text:#f3f5ee; --muted:#a5ae9d;
  --line:#30372a; --soft:#22281e; --brand:#172014; --copper:#c6f85c;
  --accent:#344221; --success:#a1d5b6; --success-bg:#223f30;
  --warning:#ebc98e; --warning-bg:#403721; --danger:#f3aba4; --danger-bg:#482b2b;
  --shadow:0 18px 65px #0003; --backdrop:#0009;
}
html,body { background:var(--bg); color:var(--text) }
html { scrollbar-color:var(--muted) var(--bg) }
::selection { background:var(--accent); color:var(--text) }
input,select,textarea { accent-color:var(--copper); caret-color:var(--text) }
:root input::placeholder,:root textarea::placeholder { color:var(--muted); opacity:1 }
input:autofill { background:var(--surface); color:var(--text) }
input:-webkit-autofill { -webkit-text-fill-color:var(--text); -webkit-box-shadow:0 0 0 1000px var(--surface) inset; caret-color:var(--text) }
option,optgroup { background:var(--surface); color:var(--text) }
dialog::backdrop { background:var(--backdrop) }
#toast { background:var(--surface); color:var(--text); border:1px solid var(--line) }

.auth-art,.shell .sidebar { background:var(--soft); color:var(--text); border-color:var(--line) }
.auth-art .brand,.shell .sidebar .brand,.auth-art h1,.shell .sidebar-foot strong { color:var(--text) }
.auth-art p,.auth-art .eyebrow,.shell .sidebar-foot,.shell .sidebar .nav-group,
.shell .nav-caption,.shell .account-chip small,.shell .workspace small,
.shell .sidebar-foot .btn { color:var(--muted) }
.shell .sidebar-foot,.shell .workspace,.shell .account-chip { border-color:var(--line) }
.shell .account-chip { background:var(--surface) }
.shell .account-chip .avatar { background:var(--accent); color:var(--copper); border-color:var(--line) }
.shell .nav a { color:var(--text) }
.shell .nav .nav-item:hover { background:var(--surface); color:var(--text) }
.shell .nav .nav-item svg { color:inherit }
.shell .nav .nav-item.active { background:var(--accent); color:var(--copper); box-shadow:none }
.shell .nav .nav-item.active svg { color:inherit }
.auth-art .brand span,.shell .sidebar .brand span { color:inherit }

/* Summary cards, receipts and live checkout previews share the active theme. */
.dash-primary,.buy-receipt,.collection-checkout-preview { background:var(--soft); color:var(--text); border-color:var(--line) }
.dash-primary .dash-amount,.buy-receipt .receive-value,.preview-amount { color:var(--copper) }
.dash-primary .dash-metric-label>span,.dash-primary .dash-metric-footer,
.receipt-heading>span:first-child,.receipt-label,.receipt-destination span,
.receipt-destination code,.receipt-footnote,.receipt-address,
.conversion-hero p,.buy-breakdown dt,.buy-confirm-heading p,
.preview-brand>span,.preview-merchant,.collection-checkout-preview>p,
.preview-amount-label,.preview-payment-method span,.preview-wallet-line { color:var(--muted) }
.dash-primary .dash-metric-footer,.receipt-destination,.conversion-hero,
.buy-confirm-heading,.preview-brand,.preview-brand>span,.preview-payment-method { border-color:var(--line) }
.receipt-destination { background:var(--surface) }
.buy-receipt h2,.buy-receipt .field label,.buy-breakdown dd,.buy-confirm-heading h3 { color:var(--text) }
.receipt-heading svg,.receipt-destination>svg,.buy-confirm-heading>span,
.quote-loading,.preview-payment-method>svg { color:var(--copper) }
.buy-receipt .field input { background:var(--surface); color:var(--text); border-color:var(--line) }
.buy-receipt .field input:focus-visible { outline-color:var(--copper) }
.buy-receipt .form-error { color:var(--danger) }
:root[data-theme] .collection-preview { background:var(--surface); border-color:var(--line) }
:root[data-theme] .preview-caption,:root[data-theme] .collection-after p { color:var(--muted) }
:root[data-theme] .collection-after strong { color:var(--text) }
:root[data-theme] .collection-after .collection-number { background:var(--soft); color:var(--muted); border-color:var(--line) }
.collection-checkout-preview .fee-disclosure,.buy-receipt .fee-disclosure {
  --fee-muted:var(--muted); --fee-line:var(--line);
  --fee-net-bg:var(--accent); --fee-net-text:var(--text); color:var(--text);
}
.collection-checkout-preview .fee-net small,.buy-receipt .fee-net small { color:var(--muted) }
.collection-checkout-preview .fee-unavailable,.fee-open-hint { color:var(--muted); border-color:var(--line) }

.dash-attention { background:var(--warning-bg); color:var(--warning) }
.dash-stage.done,.dash-payment-icon.done { background:var(--success-bg); color:var(--success) }
.dash-state.done { color:var(--success) }
.dash-state.alert,.dash-refresh-error { color:var(--warning) }
.payment-state.success { background:var(--success-bg); border-color:var(--success) }
.payment-state.attention { background:var(--warning-bg); border-color:var(--warning) }
.payment-state.success .state-symbol,.payment-journey .done .step-dot {
  background:var(--accent); color:var(--copper); border-color:var(--line);
}
.hx-ads-consent {
  position:fixed; z-index:2147483000; left:16px; right:16px; bottom:16px;
  max-width:760px; margin:auto; padding:18px; border:1px solid var(--line);
  border-radius:16px; background:var(--surface); color:var(--text); box-shadow:var(--shadow);
  display:grid; grid-template-columns:1fr auto; gap:14px 20px; align-items:center;
}
.hx-ads-consent p { margin:0; color:var(--muted); font-size:14px; line-height:1.55 }
.hx-ads-consent strong { color:var(--text) }
.hx-ads-consent-actions { display:flex; gap:9px; flex-wrap:wrap; justify-content:flex-end }
.hx-ads-consent button { min-height:42px; padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:var(--surface); color:var(--text); font:inherit; cursor:pointer }
.hx-ads-consent button[data-consent="grant"] { background:var(--copper); color:var(--bg); border-color:var(--copper); font-weight:700 }
@media(max-width:720px){.hx-ads-consent{grid-template-columns:1fr}.hx-ads-consent-actions{justify-content:stretch}.hx-ads-consent button{flex:1}}
/* Only machine-readable QR images keep a white scan surface in both themes. */
