/* One customer-site palette. Legacy page token families resolve here. */
:root {
  --site-bg:#F7F7F8;
  --site-surface:#FFFFFF;
  --site-soft:#F1F3F8;
  --site-tint:#F2F5FC;
  --site-text:#191D27;
  --site-muted:#626A79;
  --site-line:#DFE3EB;
  --site-accent:#002FA7;
  --site-accent-soft:#EBF0FE;
  --site-on-accent:#FFFFFF;
  --site-focus:#406BDB;
  --site-link:#002FA7;
  --site-strong:#191D27;
  --site-on-strong:#FFFFFF;
}
html[data-theme="dark"] {
  --site-bg:#101217;
  --site-surface:#191C24;
  --site-soft:#222733;
  --site-tint:#1C2435;
  --site-text:#F3F5FA;
  --site-muted:#AFB7C8;
  --site-line:#343B4B;
  --site-accent:#406BDB;
  --site-accent-soft:#233355;
  --site-on-accent:#FFFFFF;
  --site-focus:#96B1FF;
  --site-link:#96B1FF;
  --site-strong:#F3F5FA;
  --site-on-strong:#101217;
}
@media(prefers-color-scheme:dark) {
  html[data-theme="system"] {
    --site-bg:#101217; --site-surface:#191C24; --site-soft:#222733; --site-tint:#1C2435;
    --site-text:#F3F5FA; --site-muted:#AFB7C8; --site-line:#343B4B;
    --site-accent:#406BDB; --site-accent-soft:#233355; --site-on-accent:#FFFFFF;
    --site-focus:#96B1FF; --site-link:#96B1FF;
    --site-strong:#F3F5FA; --site-on-strong:#101217;
  }
}
html[data-theme] { background-color:var(--site-bg); }

/* Match the specificity of the former per-page dark-mode declarations.
   This mapping covers the storefront, documents, order and partner pages. */
html[data-theme] body.visual-sync-page,
html[data-theme] body:not(.visual-sync-page) {
  --vs-bg:var(--site-bg);
  --vs-panel:var(--site-surface);
  --vs-surface:var(--site-surface);
  --vs-surface-2:var(--site-soft);
  --vs-control:var(--site-soft);
  --vs-text:var(--site-text);
  --vs-muted:var(--site-muted);
  --vs-line:var(--site-line);
  --vs-soft:var(--site-soft);
  --vs-strong:var(--site-strong);
  --vs-strong-text:var(--site-on-strong);
  --theme-bg:var(--site-bg);
  --theme-panel:var(--site-surface);
  --theme-surface:var(--site-surface);
  --theme-panel-2:var(--site-soft);
  --theme-surface-2:var(--site-soft);
  --theme-control:var(--site-soft);
  --theme-text:var(--site-text);
  --theme-body-text:var(--site-text);
  --theme-muted:var(--site-muted);
  --theme-line:var(--site-line);
  --theme-strong:var(--site-strong);
  --theme-strong-text:var(--site-on-strong);
  --theme-button-text:var(--site-on-accent);
  --theme-gold:var(--site-link);
  --theme-gold-bright:var(--site-focus);
  --sf-bg:var(--site-bg);
  --sf-panel:var(--site-surface);
  --sf-soft:var(--site-soft);
  --sf-tint:var(--site-tint);
  --sf-text:var(--site-text);
  --sf-muted:var(--site-muted);
  --sf-line:var(--site-line);
  --sf-accent:var(--site-accent);
  --sf-focus:var(--site-focus);
  --ink:var(--site-text);
  --muted:var(--site-muted);
  --paper:var(--site-surface);
  --cream:var(--site-bg);
  --line:var(--site-line);
  --lime:var(--site-accent-soft);
  background-color:var(--site-bg)!important;
  background-image:none!important;
  color:var(--site-text)!important;
}

/* Header and footer share the canvas color on every route. */
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .site-header {
  background:var(--site-bg)!important;
  border-color:var(--site-line)!important;
  color:var(--site-text)!important;
}
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .footer {
  background:transparent!important;
  color:var(--site-text)!important;
}
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .footer :is(.logo-name,.footer-cols h3) { color:var(--site-text)!important; }
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .footer :is(.logo-sub,.footer-legal,.footer-bottom,.footer-cols a) { color:var(--site-muted)!important; }
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .footer-bottom { border-color:var(--site-line)!important; }
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) .site-main-nav .site-nav-link[aria-current="page"] {
  background:var(--site-accent-soft)!important;
  color:var(--site-link)!important;
}

/* Primary actions use one theme-aware accent; secondary actions stay neutral. */
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) :is(.site-recharge-action,.footer-partner a,.oc-btn,.submit,.button,.btn-dark,.pm-next,.pay-btn,.oc-redeem-action,.sc-btn:not(.sc-btn-ghost)) {
  background:var(--site-accent)!important;
  border-color:var(--site-accent)!important;
  color:var(--site-on-accent)!important;
}
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) :is(.oc-btn,.submit,.button,.pm-next,.pay-btn,.sc-btn):disabled {
  background:var(--site-soft)!important;
  border-color:var(--site-line)!important;
  color:var(--site-muted)!important;
  box-shadow:none!important;
  opacity:1;
}
html[data-theme] :is(body.visual-sync-page,body:not(.visual-sync-page)) :is(button,a,input,summary,[tabindex]):focus-visible {
  outline:3px solid var(--site-focus);
  outline-offset:3px;
}
html[data-theme] body.visual-sync-page :is(.field input,.share input,.withdraw input,.password-form input) {
  background:var(--site-soft)!important;
  border-color:var(--site-line)!important;
  color:var(--site-text)!important;
}
html[data-theme] body.visual-sync-page .field input:focus {
  border-color:var(--site-focus)!important;
  box-shadow:0 0 0 2px color-mix(in srgb,var(--site-focus) 24%,transparent)!important;
}
html[data-theme] body:not(.visual-sync-page) :is(.share input,.withdraw input,.withdraw-method,.password-form input,#logout) {
  background:var(--site-soft)!important;
  border-color:var(--site-line)!important;
  color:var(--site-text)!important;
}
html[data-theme] body:not(.visual-sync-page) :is(.metric small,.empty) { color:var(--site-muted)!important; }
html[data-theme] body:not(.visual-sync-page) .row { border-color:var(--site-line)!important; }
html[data-theme] body:not(.visual-sync-page) .track { background:var(--site-soft)!important; }
html[data-theme] body:not(.visual-sync-page) .track i { background:var(--site-accent)!important; }
