/* Public theme controls and the evening palette. Admin pages keep their own UI. */
.theme-toggle {
    position: fixed;
    right: max(var(--utility-edge, 9px), env(safe-area-inset-right, 0px));
    bottom: calc(var(--utility-edge, 9px) + env(safe-area-inset-bottom, 0px));
    z-index: 10008;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6em;
    min-height: var(--utility-height, 58px);
    max-width: calc(50vw - var(--utility-edge, 9px) * 2);
    padding: calc(var(--utility-font, 16px) * .5) calc(var(--utility-font, 16px) * .8);
    border: 3px solid var(--interactive-border-rest, rgba(92, 59, 109, .38));
    border-radius: calc(var(--utility-font, 16px) * .8);
    background: rgba(252, 249, 253, .94);
    color: #5c3b6d;
    box-shadow: 0 5px 16px rgba(92, 59, 109, .2);
    font: 800 var(--utility-font, 16px)/1.25 var(--font-primary, Arial, sans-serif);
    white-space: nowrap;
    cursor: pointer;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.theme-toggle:focus-visible {
    border-color: #5c3b6d;
    box-shadow: inset 0 0 0 3px #5c3b6d, 0 10px 24px rgba(92, 59, 109, .24);
    outline: none;
}

@media (hover: hover) and (pointer: fine) {
    .theme-toggle:hover {
        border-color: #5c3b6d;
        box-shadow: inset 0 0 0 3px #5c3b6d, 0 10px 24px rgba(92, 59, 109, .24);
        outline: none;
    }
}

.theme-toggle__icon {
    width: 1.35em;
    height: 1.35em;
    flex: 0 0 auto;
    color: #5c3b6d;
}

.theme-toggle__icon[hidden] { display: none !important; }
.privacy-settings-button--page-hidden { display: none !important; }

/* The privacy entry lives in Information on both desktop and phone. */
.clinic-mobile-privacy-slot {
    display: block;
    width: 100%;
    min-height: 46px;
}

html[data-external-content-consent="unset"] .clinic-mobile-privacy-slot {
    display: none;
}

.clinic-mobile-privacy-slot .privacy-settings-button--information-mobile {
    position: static !important;
    inset: auto !important;
    display: flex;
    width: min(100%, 440px);
    max-width: none !important;
    min-height: 52px;
    margin: 0 auto;
    padding: 8px 14px;
    border: 2px solid rgba(92, 59, 109, .38);
    border-radius: var(--ui-pill-radius, 999px);
    background: #fff;
    color: var(--accent-secondary, #5c3b6d);
    box-shadow: 0 3px 10px rgba(92, 59, 109, .12);
    font: 800 clamp(1.04rem, 1.65vw, 1.18rem)/1.1 var(--font-display, Arial, sans-serif) !important;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Reviews have no Information tab; keep privacy reachable in their header. */
body.reviews-page > .privacy-settings-button { display: none !important; }
.reviews-header__privacy {
    position: absolute;
    top: 19px;
    right: 20px;
    min-height: 40px;
    padding: 8px 12px;
    border: 2px solid rgba(92, 59, 109, .38);
    border-radius: 999px;
    background: #fff;
    color: #5c3b6d;
    font: 800 .8rem/1.2 var(--font-primary, Arial, sans-serif);
    cursor: pointer;
}
.reviews-header__privacy:focus-visible {
    border-color: #5c3b6d;
    outline: none;
}
@media (hover: hover) and (pointer: fine) {
    .reviews-header__privacy:hover {
        border-color: #5c3b6d;
        outline: none;
    }
}

@media (max-width: 768px) {
    .theme-toggle { display: none !important; }

    html.mobile-utility-controls-embedded .theme-toggle--homepage-mobile,
    html.mobile-utility-controls-embedded .theme-toggle--clinic-mobile {
        display: inline-flex !important;
    }

    .theme-toggle--homepage-mobile .theme-toggle__label,
    .theme-toggle--clinic-mobile .theme-toggle__label {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }

    .selection-arrow .selection-reviews-link,
    .selection-arrow .prestige-a11y-launcher--homepage-mobile,
    .selection-arrow .theme-toggle--homepage-mobile {
        box-sizing: border-box;
        width: min(100%, 200px) !important;
        min-width: 0;
        max-width: 200px !important;
        height: 46px;
        min-height: 46px;
        margin-inline: auto;
    }

    .selection-arrow .theme-toggle--homepage-mobile {
        position: static;
        inset: auto;
        padding: 7px;
        border-width: 2px;
        border-radius: var(--ui-pill-radius, 999px);
    }

    .selection-arrow .theme-toggle--homepage-mobile .theme-toggle__icon {
        width: 30px;
        height: 30px;
    }

    .clinic-header-bar .theme-toggle--clinic-mobile {
        position: absolute;
        top: 12px;
        right: 12px;
        bottom: auto;
        left: auto;
        display: inline-flex;
        width: 48px;
        min-width: 48px;
        max-width: 48px;
        height: 48px;
        min-height: 48px;
        padding: 7px;
        border-radius: 15px;
    }

    .clinic-header-bar .theme-toggle--clinic-mobile .theme-toggle__icon {
        width: 28px;
        height: 28px;
    }
}
html.prestige-mobile-device .theme-toggle:not(.theme-toggle--homepage-mobile):not(.theme-toggle--clinic-mobile) {
    display: none !important;
}

@media (max-width: 700px) {
    .reviews-header__privacy {
        position: static;
        display: block;
        width: fit-content;
        margin: 9px auto 0;
    }
}

html[data-theme="dark"] {
    --color-purple: #8e609d;
    --accent-secondary: #f7f1f8;
    --color-text-primary: #f7f1f8;
    --color-text-secondary: #d3c8d6;
    --text-main: #f7f1f8;
    --text-secondary: #d3c8d6;
    --ui-surface-90: rgba(40, 37, 47, .96);
    --ui-surface-border: #83758c;
    --ui-soft-purple-fill: #382f42;
    --interactive-border-rest: #927f9a;
    --interactive-border-hover: #d0a5de;
    --interactive-hover-shadow: 0 10px 24px rgba(0, 0, 0, .32);
    color-scheme: dark;
    background: #141322 url('/assets/images/bg-evening.webp') center / cover no-repeat !important;
}

html[data-theme="dark"] body { color: #f7f1f8; }
html[data-theme="dark"] body::before {
    background-color: #141322;
    background-image: url('/assets/images/bg-evening.webp');
}
html[data-theme="dark"] ::selection { background: #8e609d; color: #fff; }
html[data-theme="dark"] ::-moz-selection { background: #8e609d; color: #fff; }

html[data-theme="dark"] .header-island,
html[data-theme="dark"] .selection-arrow,
html[data-theme="dark"] .clinic-card,
html[data-theme="dark"] .clinic-header-bar,
html[data-theme="dark"] .clinic-service-card,
html[data-theme="dark"] .clinic-about-card,
html[data-theme="dark"] .clinic-specialists-card,
html[data-theme="dark"] .clinic-contacts-card,
html[data-theme="dark"] .specialist-card,
html[data-theme="dark"] .reviews-shell,
html[data-theme="dark"] .reviews-entry-modal__dialog {
    background: rgba(40, 37, 47, .96);
    border-color: #83758c;
    box-shadow: 0 16px 36px rgba(0, 0, 0, .28);
}
html[data-theme="dark"] .clinic-card { border-color: transparent; }
@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .clinic-card:hover { border-color: #d0a5de; }
}
html[data-theme="dark"] .reviews-entry-modal__dialog {
    background-image: url('/assets/images/bg-evening.webp');
}

html[data-theme="dark"] .logo img,
html[data-theme="dark"] .clinic-brand-logo {
    filter: brightness(0) saturate(100%) invert(85%) sepia(16%) saturate(483%) hue-rotate(238deg);
}
html[data-theme="dark"] .title-accent,
html[data-theme="dark"] .clinic-name,
html[data-theme="dark"] .clinic-about-brand-title,
html[data-theme="dark"] .clinic-about-section-title,
html[data-theme="dark"] .clinic-about-location-title,
html[data-theme="dark"] .clinic-about-technology-title,
html[data-theme="dark"] .clinic-about-gallery-title,
html[data-theme="dark"] .clinic-contacts-title,
html[data-theme="dark"] .reviews-header__title,
html[data-theme="dark"] .review-card__author,
html[data-theme="dark"] .review-card__specialist,
html[data-theme="dark"] .reviews-entry-modal__title {
    color: #e9d8ef;
}
html[data-theme="dark"] .title-line,
html[data-theme="dark"] .clinic-about-brand-subtitle,
html[data-theme="dark"] .clinic-contact-number,
html[data-theme="dark"] .clinic-contact-hours,
html[data-theme="dark"] .clinic-call-button { color: #f7f1f8; }
html[data-theme="dark"] .selection-text,
html[data-theme="dark"] .select-clinic-text {
    background: #3a3042;
    color: #e9d8ef;
}
html[data-theme="dark"] .selection-icon { color: #d5b6df; }

html[data-theme="dark"] .clinic-header-link,
html[data-theme="dark"] .selection-reviews-link,
html[data-theme="dark"] .reviews-entry-modal__action,
html[data-theme="dark"] .clinic-hours-panel,
html[data-theme="dark"] .service-tag,
html[data-theme="dark"] .clinic-service-heading,
html[data-theme="dark"] .clinic-service-item,
html[data-theme="dark"] .clinic-service-back,
html[data-theme="dark"] .clinic-service-price,
html[data-theme="dark"] .clinic-service-info-block,
html[data-theme="dark"] .clinic-service-info-text,
html[data-theme="dark"] .clinic-about-documents-toggle,
html[data-theme="dark"] .clinic-about-documents-link,
html[data-theme="dark"] .clinic-contacts-block,
html[data-theme="dark"] .clinic-about-location,
html[data-theme="dark"] .clinic-btn,
html[data-theme="dark"] .review-card,
html[data-theme="dark"] .form-input,
html[data-theme="dark"] .form-textarea,
html[data-theme="dark"] .custom-specialist-select__menu,
html[data-theme="dark"] .custom-specialist-select__option,
html[data-theme="dark"] .review-privacy-note,
html[data-theme="dark"] .service-link-tooltip {
    background: #342e3c;
    color: #f7f1f8;
    border-color: #927f9a;
}
html[data-theme="dark"] .clinic-brand-tooltip {
    background: #342e3c;
    color: #f7f1f8;
    border-color: #927f9a;
}
html[data-theme="dark"] .clinic-service-info-block--always-open {
    background: transparent;
    border-color: transparent;
}
html[data-theme="dark"] .clinic-service-heading {
    background: #382f42;
    color: #e9d8ef;
}
html[data-theme="dark"] .clinic-about-documents-toggle[aria-expanded="true"] {
    background: #382f42;
    color: #e9d8ef;
    border-color: #d0a5de;
}
html[data-theme="dark"] .clinic-mobile-privacy-slot .privacy-settings-button--information-mobile {
    background: #342e3c;
    color: #f7f1f8;
    border-color: #927f9a;
}

html[data-theme="dark"] .clinic-header-link.is-active,
html[data-theme="dark"][data-active-section="services"] .clinic-header-link[data-section="services"],
html[data-theme="dark"][data-active-section="specialists"] .clinic-header-link[data-section="specialists"],
html[data-theme="dark"][data-active-section="about"] .clinic-header-link[data-section="about"],
html[data-theme="dark"][data-active-section="contacts"] .clinic-header-link[data-section="contacts"],
html[data-theme="dark"] .clinic-service-item--interactive.is-active,
html[data-theme="dark"] .clinic-contact-panel,
html[data-theme="dark"] .category-tag,
html[data-theme="dark"] .clinic-btn.active,
html[data-theme="dark"] .submit-btn {
    background: #8e609d;
    border-color: #8e609d;
    color: #fff;
}
html[data-theme="dark"] .service-tag::before,
html[data-theme="dark"] .clinic-service-item::before { color: #ddcce3; }
html[data-theme="dark"] .clinic-service-item--interactive.is-active::before { color: #fff; }
html[data-theme="dark"] .clinic-about-text,
html[data-theme="dark"] .clinic-about-locations-intro,
html[data-theme="dark"] .clinic-about-locations-footer,
html[data-theme="dark"] .clinic-about-location-text,
html[data-theme="dark"] .clinic-about-technology-lead,
html[data-theme="dark"] .clinic-about-technology-description,
html[data-theme="dark"] .clinic-about-gallery-hint,
html[data-theme="dark"] .clinic-price-code,
html[data-theme="dark"] .review-card__meta,
html[data-theme="dark"] .review-card__text,
html[data-theme="dark"] .reviews-empty,
html[data-theme="dark"] .review-consent,
html[data-theme="dark"] .review-privacy-note { color: #d3c8d6; }
html[data-theme="dark"] .clinic-price-amount,
html[data-theme="dark"] .clinic-service-info-toggle.is-open,
html[data-theme="dark"] .clinic-service-price-link:focus-visible,
html[data-theme="dark"] .review-consent__details,
html[data-theme="dark"] .reviews-header__back { color: #e9d8ef; }
html[data-theme="dark"] .clinic-service-price-link:focus-visible { background: #483b51; }
@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .clinic-service-price-link:hover {
        color: #e9d8ef;
        background: #483b51;
    }
}

html[data-theme="dark"] .clinic-price-category,
html[data-theme="dark"] .clinic-price-subcategory {
    background: #2e2936;
    border-color: #927f9a;
}
html[data-theme="dark"] .clinic-price-row,
html[data-theme="dark"] .clinic-price-category-inner,
html[data-theme="dark"] .reviews-filter,
html[data-theme="dark"] .reviews-header { border-color: #6c5c74; }
html[data-theme="dark"] .clinic-price-category-toggle:focus-visible,
html[data-theme="dark"] .clinic-price-subcategory-toggle:focus-visible {
    color: #e9d8ef;
}
@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .clinic-price-category-toggle:hover,
    html[data-theme="dark"] .clinic-price-subcategory-toggle:hover { color: #e9d8ef; }
}
html[data-theme="dark"] .clinic-about-carousel-main { background: #342e3c; }
html[data-theme="dark"] .clinic-about-carousel-arrow,
html[data-theme="dark"] .clinic-about-lightbox-arrow { background: #8e609d; border-color: #8e609d; }
html[data-theme="dark"] .clinic-about-technology-media,
html[data-theme="dark"] .clinic-about-technology-image,
html[data-theme="dark"] .clinic-about-license-preview,
html[data-theme="dark"] .clinic-about-license-preview-image { background: #f7f1f8; }

html[data-theme="dark"] .form-input::placeholder,
html[data-theme="dark"] .form-textarea::placeholder { color: #b9adbe; }
html[data-theme="dark"] .custom-specialist-select__option.is-selected { color: #e9d8ef; border-color: #d0a5de; }
html[data-theme="dark"] .review-consent input { accent-color: #8e609d; }
html[data-theme="dark"] .stars-input label { color: #8b8290; }
html[data-theme="dark"] .stars-input input:checked ~ label { color: #d0a5de; }
@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .custom-specialist-select__option:hover { color: #e9d8ef; border-color: #d0a5de; }
    html[data-theme="dark"] .stars-input label:hover,
    html[data-theme="dark"] .stars-input label:hover ~ label { color: #d0a5de; }
}

html[data-theme="dark"] .prestige-a11y-launcher,
html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .reviews-header__privacy {
    background: #302b38;
    color: #f7f1f8;
    border-color: #927f9a;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
}
html[data-theme="dark"] .theme-toggle__icon { color: #d0a5de; }
html[data-theme="dark"] .theme-toggle:focus-visible,
html[data-theme="dark"] .reviews-header__privacy:focus-visible { border-color: #d0a5de; }
@media (hover: hover) and (pointer: fine) {
    html[data-theme="dark"] .theme-toggle:hover,
    html[data-theme="dark"] .reviews-header__privacy:hover { border-color: #d0a5de; }
}

html[data-theme="dark"] .privacy-consent__panel,
html[data-theme="dark"] .privacy-center__dialog,
html[data-theme="dark"] .prestige-a11y-prompt__dialog {
    background: #28252f;
    color: #f7f1f8;
    border-color: #927f9a;
}
html[data-theme="dark"] .privacy-consent__text,
html[data-theme="dark"] .privacy-consent__title,
html[data-theme="dark"] .privacy-center__title,
html[data-theme="dark"] .privacy-center__service h3,
html[data-theme="dark"] .privacy-center__policy h3,
html[data-theme="dark"] .privacy-center__section summary,
html[data-theme="dark"] .privacy-center__lead,
html[data-theme="dark"] .privacy-center__service p,
html[data-theme="dark"] .privacy-center__section-content,
html[data-theme="dark"] .prestige-a11y-prompt__dialog * { color: #f7f1f8; }
html[data-theme="dark"] .privacy-consent__link,
html[data-theme="dark"] .privacy-center__section-content a,
html[data-theme="dark"] .privacy-center__eyebrow,
html[data-theme="dark"] .privacy-center__status,
html[data-theme="dark"] .privacy-center__close,
html[data-theme="dark"] .privacy-center__button { color: #e9d8ef; }
html[data-theme="dark"] .privacy-center__service,
html[data-theme="dark"] .privacy-center__button,
html[data-theme="dark"] .privacy-center__status,
html[data-theme="dark"] .privacy-center__close { border-color: #927f9a; }
html[data-theme="dark"] .privacy-center__button--primary,
html[data-theme="dark"] .privacy-consent__button--allow,
html[data-theme="dark"] .prestige-a11y-prompt__enable {
    background: #8e609d;
    color: #fff;
}
html[data-theme="dark"] .privacy-center__section { border-color: #6c5c74; }
html[data-theme="dark"] .privacy-center__section:last-child { border-color: #6c5c74; }
html[data-theme="dark"] .local-info { background: #28252f; color: #f7f1f8; border-color: #927f9a; }
html[data-theme="dark"] .local-info h1,
html[data-theme="dark"] .local-info a { color: #e9d8ef; }

/* Mobile icons belong to the surrounding panel; keep only their outlines. */
@media (max-width: 768px) {
    html.mobile-utility-controls-embedded .selection-arrow .prestige-a11y-launcher--homepage-mobile,
    html.mobile-utility-controls-embedded .selection-arrow .theme-toggle--homepage-mobile,
    html.mobile-utility-controls-embedded .clinic-header-bar .prestige-a11y-launcher--clinic-mobile,
    html.mobile-utility-controls-embedded .clinic-header-bar .theme-toggle--clinic-mobile {
        background: transparent;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}
