/* Billing pages use isolated component styles, so map their surfaces explicitly. */
html[data-theme="light"] .billing-page {
    --billing-ink: var(--ui-ink);
    --billing-muted: var(--ui-muted);
    --billing-panel: var(--ui-panel);
    --billing-border: var(--ui-border);
    --billing-subtle: var(--ui-subtle);
    --billing-accent: var(--ui-action);
    --billing-action: var(--ui-action);
    --billing-current: var(--ui-action);
}
html[data-theme="light"] .checkout-page {
    --checkout-ink: var(--ui-ink);
    --checkout-muted: var(--ui-muted);
    --checkout-surface: var(--ui-panel);
    --checkout-border: var(--ui-border);
    --checkout-accent: var(--ui-action);
    --checkout-shadow: var(--ui-shadow);
}

html[data-theme="light"] :is(.billing-page, .confirmation-shell, .pricing-page) {
    color: var(--ui-ink);
}

html[data-theme="light"] :is(.billing-hero, .plan-card, .billing-trust > div,
    .confirmation-card, .subscription-summary) {
    background: var(--ui-panel);
    border-color: var(--ui-border);
    box-shadow: var(--ui-shadow);
}

html[data-theme="light"] :is(.billing-hero h1, .plan-heading h2, .plan-price strong,
    .subscription-banner strong) {
    color: var(--ui-ink);
}

html[data-theme="light"] :is(.billing-hero p, .billing-controls label,
    .subscription-banner p, .billing-loading, .plan-heading p, .plan-price span,
    .monthly-equivalent, .billing-trust span,
    .confirmation-brand small, .secure-label, .confirmation-state p,
    .subscription-summary span, .next-step-card p, .confirmation-footnote, .confirmation-footer) {
    color: var(--ui-muted);
}

html[data-theme="light"] .feature-list li { color: var(--ui-body); }

html[data-theme="light"] :is(.billing-eyebrow, .trial-note, .feature-list i,
    .billing-trust i,
    .confirmation-eyebrow, .confirmation-footer a, .subscription-summary .status-active) {
    color: var(--ui-action);
}

html[data-theme="light"] :is(.billing-controls select, .interval-switch) {
    border-color: var(--ui-border-strong);
    background: var(--ui-panel);
    color: var(--ui-ink);
    color-scheme: light;
}

html[data-theme="light"] .interval-switch button { color: var(--ui-body); }
html[data-theme="light"] .interval-switch button.active,
html[data-theme="light"] :is(.plan-action, .recommended-label) {
    background: var(--ui-action);
    border-color: var(--ui-action);
    color: #fff;
}
html[data-theme="light"] .interval-switch span { color: inherit; }
html[data-theme="light"] .plan-action:hover:not(:disabled) {
    background: var(--ui-action-hover);
    color: #fff;
}
html[data-theme="light"] .plan-action:disabled {
    background: var(--ui-subtle);
    border-color: var(--ui-border);
    color: var(--ui-muted);
}
html[data-theme="light"] .plan-card.recommended {
    border-color: var(--ui-action);
    box-shadow: 0 0 0 1px var(--ui-action);
}

html[data-theme="light"] .plan-card:not(.recommended) .plan-action:not(:disabled) {
    background: var(--ui-panel);
    color: var(--ui-action);
    border-color: var(--ui-border-strong);
}
html[data-theme="light"] .plan-card:not(.recommended) .plan-action:hover:not(:disabled) { background: var(--ui-selected); }
html[data-theme="light"] .recommended-label {
    background: var(--ui-selected);
    color: var(--ui-action);
    border-color: var(--ui-border-strong);
}
html[data-theme="light"] .plan-card.recommended .plan-icon {
    background: var(--ui-selected);
    color: var(--ui-action);
    border-color: var(--ui-border-strong);
}

html[data-theme="light"] :is(.subscription-banner, .subscription-icon, .subscription-status,
    .current-plan, .next-step-card, .confirmation-brand__mark) {
    background: var(--ui-selected);
    border-color: var(--ui-border-strong);
    color: var(--ui-action);
}
html[data-theme="light"] :is(.billing-message, .confirmation-warning) {
    background: var(--ui-warning-soft);
    border-color: var(--ui-icon-warning-border);
    color: var(--ui-warning);
}
html[data-theme="light"] .subscription-summary div + div { border-color: var(--ui-border); }

html[data-theme="light"] .confirmation-shell { background: var(--ui-canvas); }
html[data-theme="light"] .secondary-action {
    border-color: var(--ui-border-strong);
    color: var(--ui-action);
}
html[data-theme="light"] .secondary-action:hover { background: var(--ui-selected); }

/* Standalone pricing must use the document theme for every surface and text tone.
   Blazor can replace a class added to the page root while the catalogue loads. */
html[data-theme="light"] .pricing-page { background: var(--ui-canvas); }
html[data-theme="light"] .pricing-page :is(
    [class~="bg-[#020817]"], [class~="bg-slate-950/35"]) {
    background: var(--ui-canvas);
}
html[data-theme="light"] .pricing-page :is(
    [class~="bg-slate-900/80"], [class~="bg-slate-900/55"]) {
    background: var(--ui-panel);
}
html[data-theme="light"] .pricing-page [class~="bg-slate-700/80"] {
    background: var(--ui-border);
}
html[data-theme="light"] .pricing-page article {
    background: var(--ui-panel);
    border-color: var(--ui-border-strong);
    box-shadow: var(--ui-shadow);
}
html[data-theme="light"] .pricing-page select {
    background: var(--ui-panel);
    border-color: var(--ui-border-strong);
    color: var(--ui-ink);
}
html[data-theme="light"] .pricing-page :is(
    [class~="text-white"], [class~="text-slate-100"]) {
    color: var(--ui-ink);
}
html[data-theme="light"] .pricing-page :is(
    [class~="text-slate-300"], [class~="text-slate-300/90"]) {
    color: var(--ui-body);
}
html[data-theme="light"] .pricing-page :is(
    [class~="text-slate-400"], [class~="text-slate-500"]) {
    color: var(--ui-muted);
}
html[data-theme="light"] .pricing-page :is([class*="text-cyan-"], [class*="text-teal-"]) {
    color: var(--ui-action);
}
html[data-theme="light"] .pricing-page [class*="bg-gradient-to-r"]:not(.bg-clip-text) {
    background: var(--ui-action);
    color: #fff;
}
html[data-theme="light"] .pricing-page a[class*="bg-gradient-to-r"]:hover {
    background: var(--ui-action-hover);
}
html[data-theme="light"] .pricing-page a[class*="border-cyan-"] {
    background: var(--ui-subtle);
    border-color: var(--ui-border-strong);
}
html[data-theme="light"] .pricing-page a[class*="border-cyan-"]:hover {
    background: var(--ui-selected);
    border-color: var(--ui-action);
}
html[data-theme="light"] .pricing-page .bg-clip-text {
    background: none;
    color: var(--ui-action);
}
html[data-theme="light"] .pricing-page [class*="from-[#020817]"] {
    background: linear-gradient(to top, var(--ui-canvas), transparent);
}
html[data-theme="light"] .pricing-page :is(
    [class*="border-slate-700/"], [class*="border-slate-800/"], [class~="border-slate-800"]) {
    border-color: var(--ui-border);
}
