/* Dim (Asphalt): keep brand accents for borders, tracks and fills, but use
   independently legible colours for text/icons on dark surfaces. The theme
   class lives on <html>; never apply this palette to Light or Obsidian. */
html.glam-asphalt {
  --store-dim-text-blue: #A9C9FF;
  --store-dim-text-indigo: #C5BBFF;
  --store-dim-text-green: #A8E8B7;
  --store-dim-text-pink: #FFADC9;

  /* Shared tokens carry the fix into Storefront, Simulator, product sub-tabs,
     Library, account headings and both quick/full admin settings. */
  --store-subtab-active-color: var(--store-dim-text-blue);
  --store-admin-storefront-switch-state-color: var(--store-dim-text-blue);
  --store-admin-analytics-switch-state-color: var(--store-dim-text-blue);
  --store-account-settings-appearance-heading-color: var(--store-dim-text-blue);
  --store-account-settings-security-heading-color: var(--store-dim-text-indigo);
  --store-library-help-info-heading-color: var(--store-dim-text-blue);
  --store-admin-products-save-all-hover-color: var(--store-dim-text-blue);

  /* Inactive analytics are still informative, not inaccessible or hidden.
     Keep them visually subordinate without fading figures into the page. */
  --store-admin-analytics-irrelevant-opacity: .90;
  --store-admin-analytics-switch-disabled-opacity: .76;
}

/* Admin rail, top-level and nested navigation. The existing dark-blue
   background, active underline, sidebar rule and focus ring do not change. */
html.glam-asphalt .store-admin-tab:is(.is-active, [aria-selected="true"], :hover, :focus-visible),
html.glam-asphalt .store-admin-storefront-subtab:is(.is-active, [aria-selected="true"], :hover, :focus-visible),
html.glam-asphalt .store-simulation-tab:is(.is-active, :hover, :focus-visible),
html.glam-asphalt .store-quick-admin-scope-tab.is-active,
html.glam-asphalt .store-admin-analytics-sort-button:is(:hover, :focus-visible) {
  color: var(--store-dim-text-blue);
}

/* Scope notices, product/role badges, and outline-only controls.
   Hover-filled buttons retain their original white foregrounds. */
html.glam-asphalt .store-admin-analytics-note strong,
html.glam-asphalt .store-admin-analytics-note .store-admin-info-note-close,
html.glam-asphalt .store-library-explainer .store-admin-info-note-close,
html.glam-asphalt .store-admin-product-status-featured,
html.glam-asphalt .store-admin-user-role[data-role="owner"],
html.glam-asphalt .store-admin-product-toggle:not(:hover):not(:focus-visible),
html.glam-asphalt .store-admin-info-button:not(:hover):not(:focus-visible),
html.glam-asphalt .store-admin-product-info-button:not(:hover):not(:focus-visible) {
  color: var(--store-dim-text-blue);
}

/* Labels and figures use brighter text while cards, filters and chart
   controls keep their distinct blue/purple/green/pink outlines and fills. */
html.glam-asphalt .store-admin-analytics-top-controls
.store-admin-field:has([data-admin-analytics-product-filter]) label,
html.glam-asphalt .store-admin-analytics-card[data-analytics-card="catalog"] :is(strong, span) {
  color: var(--store-dim-text-indigo);
}

html.glam-asphalt .store-admin-analytics-top-controls
.store-admin-field:has([data-admin-analytics-time-filter]) label,
html.glam-asphalt .store-admin-analytics-card[data-analytics-card="revenue"] :is(strong, span) {
  color: var(--store-dim-text-green);
}

html.glam-asphalt .store-admin-analytics-card[data-analytics-card="sales"] :is(strong, span) {
  color: var(--store-dim-text-pink);
}

html.glam-asphalt .store-admin-analytics-card[data-analytics-card="downloads"] :is(strong, span) {
  color: var(--store-dim-text-green);
}

/* Segmented choices: only inactive labels need light-on-dark treatment.
   Checked segments still have a solid accent fill with white text. */
html.glam-asphalt .store-admin-analytics-type-order-segment
input[value="default"]:not(:checked) + span {
  color: #D2E0F3;
}

html.glam-asphalt .store-admin-analytics-type-order-segment
input[value="paid"]:not(:checked) + span {
  color: var(--store-dim-text-pink);
}

html.glam-asphalt .store-admin-analytics-type-order-segment
input[value="free"]:not(:checked) + span {
  color: var(--store-dim-text-green);
}

/* The custom-select accent is also used for the selected option's colour.
   Lighten only the text, preserving the blue/green accent of each dropdown. */
html.glam-asphalt .store-custom-select-option.is-selected {
  color: color-mix(in srgb, var(--store-custom-select-accent, var(--store-dark-blue)) 48%, white);
}

/* Outlined links and buttons on a dark surface, including Library, policies,
   downloads and the Quick Analytics footer. Do not affect filled buttons or
   the themed book links, which already have dedicated dark-mode colours. */
html.glam-asphalt .store-library-help-action-primary:is(:hover, :focus-visible),
html.glam-asphalt .store-policy-tabs a:is(:hover, :focus-visible):not([aria-selected="true"]),
html.glam-asphalt .store-admin-file-apply:is(:hover, :focus-visible):not(:disabled),
html.glam-asphalt .store-quick-analytics-footer a:hover {
  color: var(--store-dim-text-blue);
}
