/* Public client pages: finish the legacy palette migration without tinting media. */
:root {
    --client-public-surface-ink: var(--site-surface-ink, var(--site-text));
    --client-public-background-ink: var(--site-background-ink, var(--site-text));
}

/* News feed, article copy and comments. */
.site-content :where(.vk-post, .article-page, .comment, .comment-form) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.site-content :where(.vk-post-meta, .vk-text, .vk-comment-count,
        .comment-date, .comment-text, .card-body p, .article-rich-text,
        .article-rich-text p, .article-rich-text p strong,
        .article-rich-text li, .like-count, .comment-count) {
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.vk-date, .vk-footer > span) {
    color: var(--site-muted-surface-ink) !important;
}

.site-content :where(.vk-open, .card-body a, .article-rich-text a,
        .comment-actions button, .comment-cancel-btn) {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.vk-like-btn, .vk-comment-btn, .comment-actions button,
        .comment-cancel-btn, .article-rich-text code,
        .comment-avatar-placeholder) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content :where(.vk-like-btn, .vk-comment-btn, .comment-actions button,
        .comment-cancel-btn):hover {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .article-rich-text blockquote {
    border-left-color: var(--site-accent) !important;
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.comment-form input[type="text"],
        .comment-form textarea) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.site-content :where(.comment-form button[type="submit"],
        .comment-save-btn) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

/* Services, detailed service content and the masters catalogue. */
.site-content :where(.services-hero, .category-info, .service-card,
        .service-card-info, .benefit-card, .master-card,
        .service-public-review, .master-card-empty) {
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.masters-heading h1, .courses-hero h1,
        .locations-heading h1, .locations-heading p,
        .locations-list-heading h2) {
    color: var(--client-public-background-ink) !important;
}

.site-content :where(.category-info h2, .service-body h3,
        .master-card h2, .service-card-info .info-row .value) {
    color: var(--client-public-surface-ink) !important;
}

.site-content .service-content > h1 {
    color: var(--client-public-background-ink) !important;
}

.site-content :where(.service-content > .service-text,
        .service-content > .service-text p,
        .service-reviews__heading h2,
        .service-reviews__feedback:not(.is-error)) {
    color: var(--client-public-background-ink) !important;
}

.site-content .service-card-info .info-row .value {
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.category-info p, .service-body p,
        .service-bottom > div:first-child, .service-text,
        .service-description, .service-public-review > p,
        .master-card-empty, .service-reviews__feedback:not(.is-error)) {
    color: var(--client-public-surface-ink) !important;
}

.site-content .service-card .service-bottom > div:first-child span {
    color: var(--site-muted-surface-ink) !important;
}

.site-content .service-card .discount-badge,
.site-content .service-card .discount-badge [data-discount-value] {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.old-price, .service-public-review__author time,
        .service-card-info .info-row .label) {
    color: var(--site-muted-surface-ink) !important;
}

.site-content .service-card-info .info-row .label {
    color: var(--site-muted-surface-ink) !important;
}

.site-content :where(.new-price, .service-reviews__heading span,
        .masters-heading > span, .service-public-review__stars .is-active) {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.public-service-placeholder, .service-image-placeholder,
        .master-card-photo-placeholder, .service-reviews__empty) {
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content .master-card-empty {
    border-color: var(--site-border) !important;
    background: var(--site-surface) !important;
}

.master-about-modal :where(.master-about-details,
        .master-about-facts dd, .master-about-description p,
        .master-about-loading) {
    color: var(--client-public-surface-ink) !important;
}

.master-about-modal :where(.master-about-facts div,
        .master-about-close) {
    border-color: var(--site-border) !important;
}

.master-about-overlay .master-about-modal .master-about-details h2,
.master-about-overlay .master-about-modal .master-about-facts dd,
.master-about-overlay .master-about-modal .master-about-description h3 {
    color: var(--site-surface-ink) !important;
}

.master-about-overlay .master-about-modal .master-about-facts dt,
.master-about-overlay .master-about-modal .master-about-description p {
    color: var(--site-muted-surface-ink) !important;
}

.site-content :where(.service-reviews__loader button,
        .service-reviews__arrow, .slider-arrow) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

/* The master booking dialog is mounted outside .site-content. */
.master-booking-overlay :where(.master-booking-modal, .master-booking-flow,
        .master-booking-success) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.master-booking-overlay .master-booking-flow-heading h3,
.master-booking-overlay .master-booking-step:not(.master-booking-certificate) .master-booking-step-title h4 {
    color: var(--site-surface-ink) !important;
}

.master-booking-overlay .master-booking-certificate .master-booking-step-title h4,
.master-booking-overlay .master-booking-certificate .master-booking-certificate-divider,
.master-booking-overlay .master-booking-certificate > p {
    color: var(--site-background-ink) !important;
}

.master-booking-overlay :where(.master-booking-step-number,
        .master-service-option.is-selected,
        .master-booking-date-button.is-selected,
        .master-prepayment-summary, .master-booking-certificate,
        .master-booking-certificate-note) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.master-booking-overlay :where(.master-booking-step-number,
        .master-service-category, .master-booking-success > span,
        .master-prepayment-summary a,
        .master-booking-certificate-separator) {
    color: var(--site-accent-readable) !important;
}

.master-booking-overlay :where(.master-service-option,
        .master-booking-date-button, .master-booking-slot,
        .master-booking-certificate select,
        .master-booking-certificate input) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.master-booking-overlay :where(.master-service-option.is-selected,
        .master-booking-date-button.is-selected) {
    border-color: var(--site-primary) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.master-booking-overlay :where(.master-service-meta,
        .master-service-price, .master-service-old-price,
        .master-booking-placeholder, .master-booking-empty,
        .master-booking-certificate > p) {
    color: var(--client-public-surface-ink) !important;
}

.master-booking-overlay :where(.master-booking-slot.is-selected,
        .master-prepayment-actions button:last-child,
        .master-booking-success .master-booking-submit) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

/* Training catalogue, course documents and detail/cancellation dialogs. */
.site-content :where(.courses-page, .courses-tabs button:not(.active),
        .courses-tabs a, .course-card, .course-documents,
        .course-document, .course-document summary,
        .course-document__content, .course-card__venue,
        .course-card__curator, .course-card__payment-summary,
        .course-countdown, .courses-empty) {
    color: var(--client-public-surface-ink) !important;
}

.site-content .courses-page {
    color: var(--client-public-background-ink) !important;
}

.site-content :where(.course-card h2, .course-card__price strong,
        .course-card__curator strong) {
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.course-card__description,
        .course-card__description p) {
    color: var(--site-muted-surface-ink) !important;
}

.site-content :where(.course-document, .course-card__venue,
        .course-card__payment-summary, .course-countdown) {
    border-color: var(--site-border) !important;
    background: var(--site-surface) !important;
}

.site-content .course-documents > header h2 {
    color: var(--site-surface-ink) !important;
}

.site-content .course-documents > header p {
    color: var(--site-muted-surface-ink) !important;
}

.site-content :where(.course-document__content small,
        .course-card__venue small, .course-card__curator small,
        .course-card__duration, .course-card__prepayment,
        .course-refund-form small) {
    color: var(--client-public-surface-ink) !important;
}

.site-content :where(.course-document summary span,
        .course-document summary span::before,
        .course-document summary span::after) {
    background: var(--site-accent) !important;
}

.site-content :where(.course-card__media, .course-card__placeholder) {
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content :where(.course-card__meta, .course-card__price,
        .course-card__curator strong, .course-card__prepayment strong,
        .course-countdown strong) {
    color: var(--client-public-surface-ink) !important;
}

.course-details-modal__dialog :where(.course-details__body,
        .course-details__description, .course-details__curator,
        .course-details__curator strong) {
    color: var(--client-public-surface-ink) !important;
}

.course-details-modal__dialog .course-details__description p,
.course-details-modal__dialog .course-details__curator small {
    color: var(--site-muted-surface-ink) !important;
}

.course-details-modal__dialog :where(.course-details__facts > div,
        .course-details__facts span, .course-details__facts strong) {
    color: var(--client-public-background-ink) !important;
}

.course-client-cancel-modal__dialog :where(h2, p) {
    color: var(--client-public-surface-ink) !important;
}

.course-client-cancel-modal__dialog :where(.course-client-cancel-modal__close,
        .course-client-cancel-modal__actions > button:first-child) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.site-content :where(.course-refund-form, .courses-messages > div,
        .course-payment-result) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

/* Locations: map chrome, location cards and their badges. */
.site-content :where(.locations-map-label,
        .locations-map-toolbar strong, .locations-map-fallback,
        .location-card-content, .location-card-content h3,
        .location-card-address, .location-card-content p,
        .locations-empty, .locations-empty h3) {
    color: var(--client-public-surface-ink) !important;
}

.site-content .locations-heading > strong {
    color: var(--client-public-background-ink) !important;
}

.site-content :where(.locations-map-card, .location-card, .locations-empty) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .location-card.is-map-target {
    border-color: var(--site-primary) !important;
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--site-primary) 25%, transparent),
        var(--site-card-shadow) !important;
}

.site-content :where(.locations-map-frame, .locations-map-fallback,
        .location-card-hours) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content :where(.location-card-hours small,
        .location-card-hours strong) {
    color: var(--client-public-background-ink) !important;
}

.site-content .location-card-city {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .location-card-address svg {
    stroke: var(--site-accent-readable) !important;
}

.site-content :where(.location-card-link, .locations-map-fallback span,
        .locations-empty > span) {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.locations-route-link, .locations-route-link:hover) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

/* Booking policy, waitlist and consent are visible from public flows. */
.site-content .client-booking-rules__header h1 {
    color: var(--client-public-background-ink) !important;
}

.site-content .client-booking-rules__header p {
    color: var(--client-public-background-ink) !important;
}

.site-content :where(.client-booking-rule-card,
        .client-booking-rule-card h2,
        .client-booking-rule-card__text,
        .client-booking-rule-card__text p,
        .client-booking-rule-card__text strong) {
    color: var(--client-public-surface-ink) !important;
}

.site-content .client-booking-rule-card__icon {
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.booking-waitlist-dialog :where(header > span, .booking-waitlist-open,
        .booking-waitlist-time-control b, .booking-waitlist-notice strong) {
    color: var(--site-accent-readable) !important;
}

.booking-waitlist-dialog :where(.booking-waitlist-checkbox,
        .booking-waitlist-time-control, .booking-waitlist-notice,
        .booking-payment-details, .booking-payment-provider,
        .booking-certificate-section, .booking-certificate-note) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.booking-waitlist-dialog :where(header p, .booking-waitlist-notice p,
        .booking-waitlist-checkbox-copy small,
        .booking-waitlist-time-part > small) {
    color: var(--client-public-surface-ink) !important;
}

.booking-waitlist-dialog .booking-waitlist-checkbox input:checked + .booking-waitlist-switch {
    background: var(--site-primary) !important;
}

.booking-content :where(.booking-payment-heading strong,
        .booking-payment-details strong, .booking-payment-offer,
        .booking-certificate-toggle, .booking-certificate-hint) {
    color: var(--client-public-surface-ink) !important;
}

.booking-content :where(.booking-payment-provider,
        .booking-payment-details, .booking-payment-notice,
        .booking-certificate-section, .booking-price-request-note) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.booking-content :where(.booking-payment-kicker,
        .booking-payment-timer strong,
        .booking-price-request-note strong,
        .booking-certificate-separator) {
    color: var(--site-accent-readable) !important;
}

.booking-consent-modal__dialog :where(.booking-consent-heading,
        .booking-consent-heading p, .booking-consent-body) {
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.booking-consent-modal__dialog :where(.booking-consent-progress,
        .booking-consent-heading > span) {
    color: var(--site-accent-readable) !important;
}

.booking-consent-modal__dialog :where(.booking-consent-badge,
        .booking-consent-badge.is-optional) {
    border-color: var(--site-border) !important;
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}

.booking-consent-modal__dialog :where(.booking-consent-decline,
        .booking-consent-close) {
    border-color: var(--site-border) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
}

.booking-consent-modal__dialog .booking-consent-accept {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

/* Gallery labels and legal text; keep photographs, map tiles and video darkrooms unchanged. */
.site-content :where(.client-gallery-folder,
        .client-gallery-heading > span, .client-gallery-current > span,
        .client-gallery-loader) {
    color: var(--site-accent-readable) !important;
}

.site-content .client-gallery-heading h1 {
    color: var(--client-public-background-ink) !important;
}

/* Help catalogue cards and its hero sit on a solid themed surface. */
.site-content .client-help__hero,
.site-content .client-help-card,
.site-content .client-help__empty {
    border-color: var(--site-border) !important;
    color: var(--site-surface-ink) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .client-help__hero h1,
.site-content .client-help-card h2,
.site-content .client-help__empty strong {
    color: var(--site-surface-ink) !important;
}

.site-content .client-help__hero p,
.site-content .client-help-card p,
.site-content .client-help__empty p {
    color: var(--site-muted-surface-ink) !important;
}

.site-content .client-help-card__kind {
    border-color: var(--site-border) !important;
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content .client-gallery-folder.is-active .client-gallery-folder-all {
    border-color: var(--site-primary) !important;
}

.site-content .legal-document-heading {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--client-public-surface-ink) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .legal-document-heading span {
    color: var(--site-accent-readable) !important;
}

.site-content .legal-document-heading h1 {
    color: var(--client-public-surface-ink) !important;
}

.site-content .legal-document-text {
    color: var(--client-public-background-ink) !important;
    background: var(--site-background) !important;
}
/* The legal-document return action follows the primary action palette. */
.site-content .legal-document-back {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .legal-document-back:hover {
    border-color: var(--site-primary-hover) !important;
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}
