/*
 * Saudiah service contrast guard
 * Shared, layout-safe colour corrections for service heroes and interactive controls.
 */
.sa-service-main :where(button,a,[role="button"],[role="tab"],[role="radio"]):focus-visible{
    outline:3px solid #f59e0b!important;
    outline-offset:3px!important;
}

.sa-service-tool-hero__header{
    color:var(--sa-text,#172033);
}
.sa-service-tool-hero__copy h1{
    color:var(--sa-text,#172033)!important;
}
.sa-service-tool-hero__copy>p{
    color:var(--sa-muted,#59677a)!important;
}
.sa-service-tool-hero__eyebrow{
    color:var(--sa-accent-2,#174f82)!important;
}
.sa-service-tool-hero__actions .sa-ghost-button{
    border-color:#cbd5e1!important;
    background:#fff!important;
    color:#24364a!important;
}
.sa-service-tool-hero__actions .sa-ghost-button:hover{
    border-color:var(--sa-accent,#2563eb)!important;
    background:var(--sa-accent-soft,#eff6ff)!important;
    color:var(--sa-accent-2,#174f82)!important;
}

/* Known solid actions: keep their labels readable regardless of a service accent. */
.sa-tool-content :where(
    .sa-button--primary,.sa-primary-button,.sa-primary-action,.sa-button--download,
    .sa-age-submit,.sa-date-submit,.sa-gregorian-submit,.sa-hijri-submit,
    .sa-money-submit,.sa-number-submit,.sa-period-submit,.sa-qr-submit,
    .sa-franco-submit,.sa-hiero-submit,.sa-sadaka-submit,.cvb-submit,.pgc-submit,
    .sat-btn--primary,.pdfx-primary-action,.fm-primary
){
    color:#fff!important;
}
.sa-tool-content :where(
    .sa-button--primary,.sa-primary-button,.sa-primary-action,.sa-button--download,
    .sa-age-submit,.sa-date-submit,.sa-gregorian-submit,.sa-hijri-submit,
    .sa-money-submit,.sa-number-submit,.sa-period-submit,.sa-qr-submit,
    .sa-franco-submit,.sa-hiero-submit,.sa-sadaka-submit,.cvb-submit,.pgc-submit,
    .sat-btn--primary,.pdfx-primary-action,.fm-primary
) :where(i,span,strong,b,small){
    color:inherit!important;
}

/* Applied only by the WCAG checker when the computed colour actually fails. */
.sa-contrast-auto-light{
    color:#fff!important;
    text-shadow:0 1px 2px rgba(0,0,0,.24);
}
.sa-contrast-auto-dark{
    color:#111827!important;
    text-shadow:none!important;
}
.sa-contrast-auto-light :where(i,span,strong,b,small,em),
.sa-contrast-auto-dark :where(i,span,strong,b,small,em){
    color:inherit!important;
}

/* Keep the universal aftercare card away from the surrounding card edges. */
.sa-service-main .sa-tool-aftercare{
    margin:9px 5px 12px!important;
    border:1px solid var(--sa-line,#dce3ea)!important;
    border-radius:16px!important;
}

/* Added only when the runtime audit finds text smaller than a usable floor. */
.sa-font-auto-readable{
    font-size:12px!important;
    line-height:1.55!important;
}
.sa-font-auto-support{
    font-size:11.5px!important;
    line-height:1.65!important;
}

[data-theme="dark"] .sa-service-tool-hero__header{
    color:#f1f5f9;
}
[data-theme="dark"] .sa-service-tool-hero__copy h1{
    color:#f8fafc!important;
}
[data-theme="dark"] .sa-service-tool-hero__copy>p{
    color:#c0cad7!important;
}
[data-theme="dark"] .sa-service-tool-hero__eyebrow{
    color:#bfdbfe!important;
}
[data-theme="dark"] .sa-service-tool-hero__actions .sa-ghost-button{
    border-color:#475569!important;
    background:#111827!important;
    color:#f1f5f9!important;
}

@media (prefers-reduced-motion:reduce){
    .sa-service-main :where(button,a,[role="button"],[role="tab"],[role="radio"]){
        transition:none!important;
    }
}

@media(max-width:640px){
    .sa-service-main .sa-tool-aftercare{margin:8px 5px 12px!important}
}
