/* Shared interaction accent. Business/status colors and page photography stay local. */
@media screen {
    :root {
        --apple-accent: #0066cc;
        --apple-focus: #007aff;
        --apple-selected: #0066cc;
        --apple-on-selected: #fff;
        --apple-field: #fff;
        --apple-menu: #f9f9fb;
        --apple-menu-glass: rgb(249 249 251 / 94%);
        --apple-menu-sheen: rgb(255 255 255 / 8%);
        --apple-rim: rgb(255 255 255 / 80%);
        --apple-shadow: rgb(17 17 26 / 16%);
        --apple-ink: #1d1d1f;
        --apple-muted: #626268;
        --apple-line: #86868b;
        --apple-hover: #e8f0fc;
        --apple-action: #0066cc;
        --apple-action-hover: #0055b3;
        --apple-action-pressed: #00458f;
        --apple-action-border: #0066cc;
        --apple-link: #004b99;
    }
    html[data-esr-theme="dark"], body:has(.engagement-entry), body.engagement-entry,
    html[data-esr-theme="dark"] .public-page.booking-confirmation-page,
    html body .public-page:is(.network-app, .public-compact, .public-home-surface),
    .public-page .public-mobile-menu > nav {
        --apple-accent: #0a84ff;
        --apple-focus: #64b5ff;
        --apple-selected: #0071e3;
        --apple-field: #202022;
        --apple-menu: #18181b;
        --apple-menu-glass: rgb(16 16 19 / 91%);
        --apple-menu-sheen: rgb(255 255 255 / 1.5%);
        --apple-rim: rgb(255 255 255 / 22%);
        --apple-shadow: rgb(0 0 0 / 32%);
        --apple-ink: #f5f5f7;
        --apple-muted: #b6b6bd;
        --apple-line: #86868b;
        --apple-hover: #263b55;
        --apple-action: #0071e3;
        --apple-action-hover: #0066cc;
        --apple-action-pressed: #0055b3;
        --apple-action-border: #64b5ff;
        --apple-link: #8bc3ff;
    }
    /* Signed-in visitors still see the public pages in their own light palette. */
    html[data-esr-theme] .public-page {
        --apple-accent: #0066cc;
        --apple-focus: #007aff;
        --apple-selected: #0066cc;
        --apple-field: #fff;
        --apple-menu: #f9f9fb;
        --apple-menu-glass: rgb(249 249 251 / 94%);
        --apple-menu-sheen: rgb(255 255 255 / 8%);
        --apple-rim: rgb(255 255 255 / 80%);
        --apple-shadow: rgb(17 17 26 / 16%);
        --apple-ink: #1d1d1f;
        --apple-muted: #626268;
        --apple-line: #86868b;
        --apple-hover: #e8f0fc;
        --apple-action: #0066cc;
        --apple-action-hover: #0055b3;
        --apple-action-pressed: #00458f;
        --apple-action-border: #0066cc;
        --apple-link: #004b99;
    }
    html body.esr-workspace.esr-reading:not(:has(.public-page)) {
        --appearance-blue: var(--apple-accent);
        --appearance-focus: var(--apple-focus);
        --workspace-blue: var(--apple-accent);
    }
    /* Late, narrow overrides of the historical red/white/green form accents. */
    html body input:is([type="checkbox"], [type="radio"], [type="range"]) {
        accent-color: var(--apple-accent) !important;
    }
    html body :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
        outline: 2px solid var(--apple-focus) !important;
        outline-offset: 3px;
    }
    html body :is(input, textarea)::selection { color: #fff; background: #0066cc; }
    html body :is(input:not([type]), input:is([type="text"], [type="email"], [type="tel"], [type="password"], [type="search"], [type="url"], [type="number"], [type="date"], [type="time"], [type="month"], [type="datetime-local"]), select, textarea) {
        border-radius: 8px !important;
        box-shadow: inset 0 1px 2px #0000000a, 0 1px 0 #ffffff0a;
        transition: border-color 140ms ease, box-shadow 140ms ease;
    }
    html body :is(input, select, textarea):focus-visible:not([aria-invalid="true"]):not(.is-invalid):not(:user-invalid) {
        border-color: var(--apple-focus);
    }
    /* The border and message keep their error hue even with a blue focus ring. */
    html body :is(input, select, textarea)[aria-invalid="true"] { border-color: var(--app-red, #ac2921) !important; }
    html body :is(input, select, textarea):disabled { cursor: not-allowed; }
    html body :is(input, textarea)[readonly] { cursor: default; }
    html body .auth-form .password-visibility-toggle[aria-pressed="true"] {
        color: var(--apple-on-selected) !important; background: var(--apple-selected) !important;
        border-radius: 6px;
    }

    html body .esr-setting-switch[aria-checked="true"] .esr-setting-switch__track {
        background: var(--apple-accent); border-color: var(--apple-accent);
    }
    html body .esr-setting-switch__track {
        box-shadow: inset 0 1px 2px #0003, inset 0 -1px 0 #ffffff1f;
    }
    html body .esr-setting-switch[aria-checked="true"] .esr-setting-switch__track {
        box-shadow: inset 0 1px 0 #ffffff52, inset 0 -1px 2px #0003, 0 1px 2px #0002;
    }
    html body .esr-setting-switch__track::after {
        box-shadow: 0 1px 3px #0005, inset 0 1px 0 #fff, inset 0 -1px 1px #0002;
    }
    html body .esr-setting-switch[aria-checked="true"] .esr-setting-switch__track::after { background: #fff; }
    html body .esr-setting-switch:disabled:not([aria-busy="true"]) .esr-setting-switch__track { opacity: .65; }

    html body :is(.auth-space-link.is-selected, .auth-space-link[aria-current="page"]) {
        color: var(--apple-ink); background: var(--apple-hover); border-color: var(--apple-accent);
        box-shadow: inset 0 0 0 1px var(--apple-accent);
    }
    html body .auth-space-link.is-selected .auth-space-monogram { background: var(--apple-selected); color: var(--apple-on-selected); }
    html body .auth-space-context { border-left-color: var(--apple-accent); }
    html body .candidate-mandate .candidate-mandate__choice input:checked + span,
    html body.esr-workspace.esr-reading .workspace-clients__workbench .candidate-mandate .candidate-mandate__choice input:checked + span {
        color: var(--apple-on-selected); background: var(--apple-selected);
    }
    html body .candidate-mandate .candidate-mandate__choice input:focus-visible + span,
    html body.esr-workspace.esr-reading .workspace-clients__workbench .candidate-mandate .candidate-mandate__choice input:focus-visible + span {
        outline: 2px solid var(--apple-focus); outline-offset: -4px;
    }
    html body :is(.booking-offer, .booking-gearbox):has(input:checked) {
        color: var(--apple-ink); border-color: var(--apple-accent); background: var(--apple-hover);
        box-shadow: inset 0 0 0 1px var(--apple-accent);
    }

    /* Reflections sit on the edges, leaving labels on a stable, readable color. */
    html body :is(.auth-space-link.is-selected .auth-space-monogram,
        .auth-form .password-visibility-toggle[aria-pressed="true"],
        .candidate-mandate .candidate-mandate__choice input:checked + span) {
        box-shadow: inset 0 1px 0 #ffffff52, inset 0 -1px 0 #0003;
    }
    html body :is(.public-primary, .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
        .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)) {
        border-radius: 999px;
        box-shadow: inset 0 1px 0 #ffffff99, inset 0 -1px 0 #00000014, 0 2px 5px #00000014;
    }

    /* Actions share one blue in every journey. Never recolor status badges,
       planning events or third-party sign-in branding. */
    html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
        .primary-link, .rdv-help-agent-input button,
        .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
        .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)) {
        --apple-control-fill: var(--apple-action);
        color: var(--apple-on-selected) !important;
        background: var(--apple-control-fill) !important;
        border-color: var(--apple-action-border) !important;
        box-shadow: inset 0 0 0 1px var(--apple-action-border), inset 0 1px 0 #ffffff52;
        transition: background-color 140ms ease, box-shadow 140ms ease;
    }
    @media (hover: hover) and (pointer: fine) {
        html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
            .primary-link, .rdv-help-agent-input button,
            .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
            .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):hover {
            --apple-control-fill: var(--apple-action-hover);
            box-shadow: inset 0 0 0 1px var(--apple-action-border), 0 2px 6px #0003;
        }
    }
    html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
        .primary-link, .rdv-help-agent-input button,
        .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
        .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):is(:active, [aria-pressed="true"]) {
        --apple-control-fill: var(--apple-action-pressed);
        box-shadow: inset 0 0 0 1px var(--apple-action-border), inset 0 2px 4px #0005;
    }
    html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
        .primary-link, .rdv-help-agent-input button,
        .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
        .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)):is(:disabled, [aria-disabled="true"], [aria-busy="true"]) {
        color: var(--apple-muted) !important;
        background: var(--apple-field) !important;
        border-color: var(--apple-line) !important;
        box-shadow: inset 0 0 0 1px var(--apple-line);
        cursor: not-allowed;
    }
    html body :is(.public-primary, .checkout-primary, .primary-link, .rdv-help-agent-input button)[aria-busy="true"] { cursor: progress; }

    /* Secondary actions keep their layout and surface; their interaction is blue. */
    html body .engagement-entry .auth-form button.quiet-button {
        color: var(--apple-link) !important; background: transparent !important;
    }
    html body :is(.public-text-link, .public-back-link, .booking-ticket-top > a,
        .booking-back, .booking-alternative > span, .qualification-status button,
        .booking-edit-form button, .booking-login-link a) { color: var(--apple-link) !important; }
    html body :is(.public-secondary, .network-app__secondary, .public-home-controls > button,
        .engagement-entry .auth-form button.quiet-button,
        .public-nav a, .public-mobile-menu > summary, .public-profile-menu > summary,
        .public-profile-menu > div a):is(:focus-visible, :active, [aria-current="page"]),
    html body :is(.public-mobile-menu, .public-profile-menu)[open] > summary {
        color: var(--apple-on-selected) !important;
        background: var(--apple-selected) !important;
        border-color: var(--apple-selected) !important;
    }
    @media (hover: hover) and (pointer: fine) {
        html body :is(.public-secondary, .network-app__secondary, .public-home-controls > button,
        .engagement-entry .auth-form button.quiet-button,
            .public-nav a, .public-mobile-menu > summary, .public-profile-menu > summary,
            .public-profile-menu > div a):not(:disabled):not([aria-disabled="true"]):hover {
            color: var(--apple-on-selected) !important;
            background: var(--apple-selected) !important;
            border-color: var(--apple-selected) !important;
        }
        html body :is(.public-text-link, .public-back-link, .booking-ticket-top > a,
            .booking-back, .qualification-status button, .booking-edit-form button,
            .booking-login-link a):not(:disabled):not([aria-disabled="true"]):hover {
            color: var(--apple-link) !important;
            text-decoration: underline;
            text-decoration-thickness: 2px;
            text-underline-offset: .2em;
        }
        html body :is(.booking-alternative, .booking-offer, .booking-gearbox):not(:has(input:disabled)):hover { border-color: var(--apple-focus); }
    }
    html body .segmented-choice input:checked + span {
        color: var(--apple-on-selected) !important;
        background: var(--apple-selected) !important;
    }
    html body .segmented-choice input:focus-visible + span { outline: 2px solid var(--apple-focus); outline-offset: 2px; }

    /* Functional menus only: opaque fallback, then glass with a tested tint. */
    html body :is(.workspace-profile-options,
        .esr-app-account > .app-header-actions, .esr-app-more > div,
        .public-mobile-menu > nav, .direction-search__suggestions,
        .candidate-search__results, .client-lookup__results) {
        color: var(--apple-ink) !important; background: var(--apple-menu) !important;
        border-color: var(--apple-line); border-radius: 14px;
        box-shadow: 0 16px 40px var(--apple-shadow), 0 2px 7px #00000012,
            inset 0 1px 0 var(--apple-rim), inset 0 -1px 0 #0000000f;
    }
    html body .direction-search__form:focus-within { outline: 2px solid var(--apple-focus); outline-offset: 3px; }
    html body :is(.candidate-search__results, .client-lookup__results) [role="option"] { color: var(--apple-ink); }
    html body :is(.direction-search__result small, .candidate-search__results span, .client-lookup__results span) { color: var(--apple-muted) !important; }
    html body :is(.workspace-profile-options, .esr-app-more-panel, .esr-app-account > .app-header-actions, .public-mobile-links) :is(a, button) {
        color: var(--apple-ink) !important;
    }
    html body :is(.workspace-profile-options, .esr-app-more-panel, .esr-app-account > .app-header-actions, .public-mobile-links) :is(a, button):is(:hover, :focus-visible, [aria-current="true"], [aria-current="page"]) {
        color: var(--apple-on-selected) !important; background: var(--apple-selected) !important; border-radius: 6px;
        box-shadow: inset 0 1px 0 #ffffff52, inset 0 -1px 0 #0003;
    }
    html body :is(.direction-search__result, .candidate-search__results [role="option"], .client-lookup__results [role="option"])[aria-selected="true"] {
        color: var(--apple-on-selected) !important; background: var(--apple-selected) !important;
        outline-color: var(--apple-selected); text-decoration: none;
        box-shadow: inset 0 1px 0 #ffffff52, inset 0 -1px 0 #0003;
    }
    html body.esr-workspace.esr-reading .direction-search__result[aria-selected="true"] { color: var(--apple-on-selected); background: var(--apple-selected); }
    html body :is(.direction-search__result, .candidate-search__results [role="option"], .client-lookup__results [role="option"])[aria-selected="true"] :is(small, span, strong) { color: inherit !important; }
    @media (hover: hover) and (pointer: fine) {
        html body :is(.direction-search__result, .candidate-search__results [role="option"], .client-lookup__results [role="option"]):hover {
            background: var(--apple-hover); color: var(--apple-ink);
        }
        html body :is(.direction-search__result, .candidate-search__results [role="option"], .client-lookup__results [role="option"])[aria-selected="true"]:hover {
            background: var(--apple-selected); color: var(--apple-on-selected);
        }
    }
    @supports ((backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px))) {
        html body :is(.workspace-profile-options,
            .esr-app-account > .app-header-actions, .esr-app-more > div, .public-mobile-menu > nav,
            .direction-search__suggestions, .candidate-search__results, .client-lookup__results) {
            background: linear-gradient(155deg, var(--apple-menu-sheen), transparent 65%), var(--apple-menu-glass) !important;
            -webkit-backdrop-filter: blur(24px) saturate(135%);
            backdrop-filter: blur(24px) saturate(135%);
        }
    }
    @media (prefers-reduced-transparency: reduce) {
        html body :is(.workspace-profile-options,
            .esr-app-account > .app-header-actions, .esr-app-more > div, .public-mobile-menu > nav,
            .direction-search__suggestions, .candidate-search__results, .client-lookup__results) {
            background: var(--apple-menu) !important; -webkit-backdrop-filter: none; backdrop-filter: none;
        }
    }
    @media (prefers-reduced-motion: reduce) {
        html body :is(input, select, textarea, button, .public-primary, .checkout-primary,
            .network-app__primary, .next-date-action, .primary-link) { transition: none !important; }
    }
    @media (forced-colors: active) {
        html body :is(.public-secondary, .network-app__secondary, .public-home-controls > button,
        .engagement-entry .auth-form button.quiet-button,
            .public-nav a, .public-mobile-menu > summary, .public-profile-menu > summary,
            .public-profile-menu > div a):not(:disabled):not([aria-disabled="true"]):is(:hover, :focus-visible, :active, [aria-current="page"]),
        html body :is(.public-mobile-menu, .public-profile-menu)[open] > summary {
            color: HighlightText !important; background: Highlight !important; border-color: Highlight !important;
        }
        html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
            .primary-link, .rdv-help-agent-input button,
            .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
            .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)) {
            --apple-muted: GrayText; --apple-field: ButtonFace; --apple-line: GrayText;
            color: ButtonText !important; background: ButtonFace !important;
            border: 1px solid ButtonText !important; box-shadow: none !important;
        }
        html body :is(.public-primary, .network-app__primary, .next-date-action, .checkout-primary,
        .public-home-surface .public-availability-list .public-text-link,
            .primary-link, .rdv-help-agent-input button,
            .engagement-entry.account-entry button[type="submit"]:not(.quiet-button),
            .engagement-entry.auth-shell .auth-form button[type="submit"]:not(.quiet-button)):not(:disabled):not([aria-disabled="true"]):not([aria-busy="true"]):is(:active, [aria-pressed="true"]) {
            color: HighlightText !important; background: Highlight !important; border-color: Highlight !important;
        }
        html body :is(.public-text-link, .public-back-link, .booking-ticket-top > a,
            .booking-back, .booking-alternative > span, .qualification-status button,
            .booking-edit-form button, .booking-login-link a) { color: LinkText !important; }
        html body .segmented-choice input:checked + span { color: HighlightText !important; background: Highlight !important; }
        html body .segmented-choice input:focus-visible + span { outline-color: Highlight; }
        html body :is(input, select, textarea, .public-primary, .engagement-entry button[type="submit"]:not(.quiet-button),
            .esr-setting-switch__track,
            .auth-space-monogram, .password-visibility-toggle,
            .candidate-mandate__choice span, .direction-search__result,
            .candidate-search__results [role="option"], .client-lookup__results [role="option"]) { box-shadow: none !important; }
        html body .esr-setting-switch__track::after { box-shadow: none !important; }
        html body input:is([type="checkbox"], [type="radio"], [type="range"]) { accent-color: auto !important; }
        html body :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible { outline-color: Highlight !important; }
        html body .esr-setting-switch[aria-checked="true"] .esr-setting-switch__track { background: Highlight; border-color: Highlight; }
        html body .esr-setting-switch[aria-checked="true"] .esr-setting-switch__track::after { background: HighlightText; }
        html body .auth-form .password-visibility-toggle[aria-pressed="true"] { color: HighlightText !important; background: Highlight !important; }
        html body :is(.workspace-profile-options, .esr-app-account > .app-header-actions, .esr-app-more > div,
            .public-mobile-menu > nav, .direction-search__suggestions, .candidate-search__results, .client-lookup__results) {
            color: CanvasText !important; background: Canvas !important; border-color: ButtonText;
            box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
        }
        html body :is(.workspace-profile-options, .esr-app-more-panel, .esr-app-account > .app-header-actions, .public-mobile-links) :is(a, button) { color: LinkText !important; }
        html body :is(.direction-search__result small, .candidate-search__results span, .client-lookup__results span) { color: CanvasText !important; }
        html body :is(input, select, textarea)[aria-invalid="true"] { border-color: CanvasText !important; }
        html body :is(.auth-space-link.is-selected, .auth-space-link[aria-current="page"], .candidate-mandate .candidate-mandate__choice input:checked + span,
            .direction-search__result[aria-selected="true"], .candidate-search__results [aria-selected="true"], .client-lookup__results [aria-selected="true"]) {
            color: HighlightText !important; background: Highlight !important; border-color: Highlight; box-shadow: none;
        }
        html body :is(.workspace-profile-options, .esr-app-more-panel, .esr-app-account > .app-header-actions, .public-mobile-links) :is(a, button):is(:hover, :focus-visible, [aria-current="true"], [aria-current="page"]) {
            color: HighlightText !important; background: Highlight !important; box-shadow: none;
        }
    }
}
