/* Shared theme tokens for client components that have their own stylesheets.
   Keep third-party brand marks, photographs, QR codes and semantic alerts intact. */
:root {
    --client-theme-primary-soft: color-mix(in srgb, var(--site-primary) 12%, var(--site-surface));
    --client-theme-accent-soft: color-mix(in srgb, var(--site-accent) 11%, var(--site-surface));
    --client-theme-surface-soft: color-mix(in srgb, var(--site-background) 72%, var(--site-surface));
}

:where(.marketplace, .market-cart, .market-orders, .client-questions,
       .profile-page, .profile-password-page, .client-help,
       .payment-result, .certificate-payment-result, .legal-document-page,
       .email-confirmation-card) {
    color: var(--site-text) !important;
    font-family: var(--site-font-family) !important;
}

:where(.marketplace, .market-cart, .market-orders, .client-questions,
       .profile-page, .client-help, .locations-page, .client-gallery-page,
       .legal-document-page) {
    max-width: var(--site-content-max-width) !important;
}

/* Catalogue filters, basket and order management. */
.market-cart {
    --cart-accent: var(--site-primary) !important;
}

:where(.market-cart-item:not(.is-incompatible):not(.is-stock-shortage), .market-cart-summary,
       .market-address-modal > div, .market-search-select__options,
       .market-orders .order-card, .market-orders .order-settings,
       .market-orders .order-empty, .market-orders .order-cancel-dialog,
       .client-order-product, .market-filter-overlay > div,
       .market-filter-panel, .market-question-dialog) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

:where(.market-cart-item__image, .market-cart-address,
       .market-cart-summary__notice:not(.is-error),
       .order-product-review, .market-orders .order-history,
       .client-order-product__media, .market-search-select__options button:hover,
       .market-filter-select-wrap select) {
    background: var(--client-theme-surface-soft) !important;
}

:where(.market-cart-item, .market-cart-summary, .market-orders .order-card,
       .client-order-product) {
    box-shadow: var(--site-card-shadow) !important;
}

:where(.market-cart > header a, .market-cart-item__body small,
       .market-cart-item__price, .market-cart-summary__total strong,
       .market-cart-address button, .market-orders a,
       .order-product-review > summary, .market-filter-select-wrap label,
       .market-cart > header span) {
    color: var(--site-accent-readable) !important;
}

:where(.market-cart-item__body p, .market-cart-loader,
       .market-cart-item__remove, .market-cart-summary__delivery span,
       .order-products small, .order-settings small,
       .order-history ol, .order-lazy-loader span,
       .client-order-detail-heading > span, .client-order-product__meta small) {
    color: var(--site-muted-text) !important;
}

:where(.market-cart-item__check span, .market-cart-item__body input,
       .market-cart-summary select, .market-cart > header a,
       .market-filter-select-wrap select, .market-orders input,
       .market-orders select, .order-product-review textarea,
       .market-address-modal textarea) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

:where(.market-cart-item__check input:checked + span,
       .order-status-sections a[aria-current="page"]) {
    border-color: var(--site-primary) !important;
    background: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
}

:where(.market-cart-pay, .market-address-modal [data-save-address],
       .market-orders .order-primary) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.market-cart-pay, .market-address-modal [data-save-address],
       .market-orders .order-primary):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.market-cart-pay:disabled {
    opacity: .45;
}

:where(.market-orders button:not(.order-primary):not([class*="cancel"]):not([class*="danger"]):not([class*="refund"]),
       .order-status-sections a:not([aria-current="page"]),
       .market-search-select__options button,
       .market-filter-select-wrap select) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

:where(.market-orders button:not(.order-primary):not([class*="cancel"]):not([class*="danger"]):not([class*="refund"]),
       .order-status-sections a:not([aria-current="page"]),
       .market-search-select__options button):hover {
    border-color: var(--site-primary) !important;
    background: var(--client-theme-primary-soft) !important;
}

:where(.market-cart-summary__total, .order-products li,
       .order-history, .client-order-product__footer) {
    border-color: var(--site-border) !important;
}

.order-review-rating label:hover,
.order-review-rating label:hover ~ label,
.order-review-rating input:checked ~ label {
    color: var(--site-accent-readable) !important;
}

/* Profile, booking and client-side dialogs. */
:where(.profile-content, .profile-sidebar, .profile-document-card,
       .profile-password-card, .profile-login-link,
       .profile-calendar-sync__card, .profile-legal-documents-dialog,
       .booking-content, .booking-waitlist-dialog,
       .client-reschedule-modal__dialog, .appointment-review-dialog,
       .cancel-confirmation-dialog, .consent-modal__dialog,
       .course-client-cancel-modal__dialog, .course-contact-modal__dialog,
       .course-details-modal__dialog, .client-tutorial-popover,
       .client-tutorial-floating-help__panel,
       .payment-result, .certificate-payment-result,
       .certificate-redemption-dialog, .legal-document-page,
       .email-confirmation-card) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

:where(.profile-login-links-empty, .profile-max,
       .profile-calendar-sync__grid, .booking-payment-details,
       .booking-prepayment-summary, .booking-certificate-section,
       .booking-waitlist-time-control, .payment-result__details,
       .certificate-payment-result__details,
       .client-tutorial-popover__progress, .client-help__empty) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    background: var(--client-theme-surface-soft) !important;
}

:where(.profile-page, .profile-password-page, .booking-content,
       .booking-waitlist-dialog, .client-tutorial-popover,
       .payment-result, .certificate-payment-result,
       .legal-document-page) :where(h1, h2, h3, h4) {
    color: var(--site-text) !important;
    font-family: var(--site-heading-font-family) !important;
}

:where(.profile-page, .profile-password-page, .booking-content,
       .booking-waitlist-dialog, .client-tutorial-popover,
       .payment-result, .certificate-payment-result,
       .legal-document-page) :where(small, .subtitle, .profile-password-help,
       .booking-payment-note, .payment-result__details span) {
    color: var(--site-muted-text) !important;
}

:where(.profile-document-button, .profile-max-button:not(.profile-max-button--secondary),
       .profile-calendar-sync__primary, .booking-select-btn.selected,
       .booking-waitlist-submit, .client-reschedule-modal__submit,
       .appointment-review-submit, .client-tutorial-popover__actions .is-primary,
       .client-tutorial-floating-help__toggle, .certificate-redemption-submit,
       .payment-result__primary, .certificate-payment-result__actions a:first-child) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.profile-document-button, .profile-max-button:not(.profile-max-button--secondary),
       .profile-calendar-sync__primary, .booking-waitlist-submit,
       .client-reschedule-modal__submit, .appointment-review-submit,
       .client-tutorial-popover__actions .is-primary,
       .client-tutorial-floating-help__toggle, .certificate-redemption-submit,
       .payment-result__primary):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

:where(.profile-calendar-sync__secondary, .profile-max-button--secondary,
       .booking-prepayment-cancel, .booking-waitlist-close,
       .client-reschedule-modal__cancel, .payment-result__secondary,
       .certificate-redemption-close) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

/* Public content, location cards, help and documents. */
:where(.article-page, .vk-post, .comment, .comment-form,
       .benefit-card, .service-public-review, .locations-empty,
       .locations-list-section, .client-gallery-lightbox__content,
       .client-help-card, .course-details__body,
       .client-certificate-document, .client-certificate-code) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

:where(.article-page a, .comment-actions button,
       .locations-route-link, .legal-document-back,
       .client-help-card__kind, .course-card__eyebrow,
       .service-public-review__stars, .vk-pinned-badge) {
    color: var(--site-accent-readable) !important;
}

:where(.location-card-city, .location-card-hours,
       .client-gallery-heading > span, .client-help__hero p,
       .course-card__description, .client-certificate-card__meta,
       .comment-date, .vk-comment-count, .email-confirmation-card p) {
    color: var(--site-muted-text) !important;
}

:where(.locations-map-toolbar, .locations-map-fallback,
       .client-gallery-folder-all, .client-gallery-empty,
       .client-help__hero, .course-details__facts,
       .client-certificate-services, .legal-document-text) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    background: var(--client-theme-surface-soft) !important;
}

:where(.locations-route-link, .client-gallery-loader button,
       .client-help-card a, .course-details-button,
       .client-certificate-use-button, .comment-save-btn) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.locations-route-link, .client-gallery-loader button,
       .client-help-card a, .course-details-button,
       .client-certificate-use-button, .comment-save-btn):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

/* Headings, descriptions and controls in pages without theme-aware CSS. */
:where(.courses-hero > span, .course-documents > header > span,
       .client-certificates__header > span,
       .client-certificate-documents > header > span,
       .client-help__hero > span, .client-tutorial-popover__progress,
       .client-tutorial-floating-help__list article > span,
       .client-tutorial-waiting, .locations-eyebrow,
       .service-benefits .meta-item, .article-rich-text a) {
    color: var(--site-accent-readable) !important;
}

:where(.courses-hero p, .course-documents > header p,
       .client-certificates__header p,
       .client-certificate-documents > header p,
       .client-help-card p, .client-help__empty p,
       .client-tutorial-popover p, .client-tutorial-target-note p,
       .client-tutorial-floating-help__panel > header span,
       .client-tutorial-floating-help__list article > p,
       .client-tutorial-trigger-waiting small, .card-body p,
       .vk-text, .comment-text) {
    color: var(--site-muted-text) !important;
}

:where(.client-help-card h2, .client-help__empty strong,
       .client-tutorial-popover h2, .client-tutorial-target-note h3,
       .client-tutorial-floating-help__panel > header strong,
       .client-tutorial-floating-help__list article > strong,
       .card-body h3, .course-documents > header h2,
       .client-certificate-documents > header h2) {
    color: var(--site-text) !important;
    font-family: var(--site-heading-font-family) !important;
}

:where(.course-documents, .client-certificate-documents,
       .client-tutorial-target-note,
       .client-tutorial-floating-help__list article,
       .client-tutorial-trigger-waiting, .vk-post, .card) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.client-tutorial-floating-help__panel > header {
    border-color: var(--site-border) !important;
    background: var(--client-theme-surface-soft) !important;
}

:where(.client-tutorial-popover button:not(.is-primary),
       .client-tutorial-floating-help__panel > header button,
       .client-help-card button:not([disabled])) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

:where(.client-help-card button:not([disabled]),
       .client-tutorial-floating-help__list article > button,
       .client-tutorial-video-dialog__footer button) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.client-help-card button:not([disabled]),
       .client-tutorial-floating-help__list article > button,
       .client-tutorial-video-dialog__footer button):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.client-tutorial-popover.is-highlighted {
    border-color: var(--site-accent-readable) !important;
    outline-color: var(--site-accent-readable) !important;
    background: var(--client-theme-primary-soft) !important;
}

.client-tutorial-spotlight {
    border-color: var(--site-accent-readable) !important;
}

.client-tutorial-popover__timer {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

/* Product catalogue: category tiles, prices, filters and sorting. */
:where(.market-category-tile, .market-media-placeholder,
       .market-breadcrumbs, .market-card__availability,
       .market-card__price del, .market-price del,
       .market-detail__description > p, .market-filter-empty,
       .market-filter-options label > small,
       .market-filter-panel > header small) {
    color: var(--site-muted-text) !important;
}

:where(.market-card__price strong, .market-price strong,
       .market-price small, .market-breadcrumbs a,
       .market-empty > span, .market-category-toggle,
       .market-detail__reviews > header > strong b) {
    color: var(--site-accent-readable) !important;
}

.market-filter-group summary::after {
    color: var(--site-accent-readable) !important;
}

:where(.market-category-tile:hover, .market-filter-options label:hover,
       .market-sort-options label:hover,
       .market-filter-button:hover, .market-sort-button:hover,
       .market-cart-stepper button:hover) {
    border-color: var(--site-border) !important;
    background: var(--client-theme-primary-soft) !important;
}

:where(.market-category-tile[aria-current="page"],
       .market-filter-button.is-active,
       .market-favorite-button.is-active,
       .market-category-tile__favorites) {
    border-color: var(--site-primary) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

:where(.market-category-tile__image, .market-card__media,
       .market-detail__thumbs button, .market-filter-empty,
       .market-sort-panel, .market-filter-panel) {
    border-color: var(--site-border) !important;
    background: var(--client-theme-surface-soft) !important;
}

:where(.market-sort-panel, .market-filter-panel) {
    border-radius: var(--site-card-radius) !important;
    box-shadow: var(--site-card-shadow) !important;
}

:where(.market-category-toggle, .market-favorite-button,
       .market-filter-panel > header button,
       .market-sort-panel > header button) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
}

:where(.market-card__discount, .market-price > b,
       .market-count-badge, .market-filter-button > span,
       .market-filter-group summary b,
       .market-filter-options input:checked + .market-filter-check) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.market-filter-check, .market-search input,
       .market-filter-select-wrap select) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

.market-search svg {
    stroke: var(--site-muted-text) !important;
}

.market-search input:focus {
    border-color: var(--site-primary) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--site-primary) 20%, transparent) !important;
}

:where(.market-filter-panel > header, .market-filter-group,
       .market-filter-panel footer, .market-sort-panel > header,
       .market-cart-stepper strong) {
    border-color: var(--site-border) !important;
}

.market-filter-panel footer {
    background: var(--site-surface) !important;
}

/* Booking choices, certificates, questions and auxiliary client overlays. */
:where(.master-booking-certificate, .master-booking-placeholder,
       .master-booking-date-button, .master-booking-slot,
       .master-service-option, .booking-waitlist-field,
       .booking-certificate-toggle, .client-reschedule-modal__fields,
       .client-certificate-refund-form, .certificate-redemption-service,
       .client-question-summary, .client-questions-hero,
       .client-payment-method-list > button,
       .appointment-calendar-sync__actions) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

:where(.master-booking-date-button:hover, .master-booking-slot:hover,
       .master-service-option:hover, .booking-certificate-toggle:hover,
       .client-payment-method-list > button:hover) {
    border-color: var(--site-primary) !important;
    background: var(--client-theme-primary-soft) !important;
}

:where(.master-booking-date-button.selected,
       .master-booking-slot.selected,
       .master-service-option.selected,
       .flatpickr-day.selected,
       .flatpickr-day.startRange,
       .flatpickr-day.endRange) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

:where(.booking-certificate-description,
       .client-certificate-description,
       .certificate-redemption-message:not(.is-error),
       .client-certificates__message:not(.is-error),
       .service-text, .service-public-review__author,
       .appointment-service, .client-question-summary small) {
    color: var(--site-muted-text) !important;
}

:where(.booking-certificate-divider,
       .master-booking-certificate-divider,
       .client-reschedule-modal__fields,
       .client-certificate-refund-form) {
    border-color: var(--site-border) !important;
}

:where(.consent-link, .service-history-reschedule-button,
       .market-pagination a, .client-gallery-lightbox__close,
       .article-lightbox-close, .consent-modal__close,
       .photo-editor__ratio) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
}

:where(.service-history-reschedule-button, .market-pagination a):hover {
    border-color: var(--site-primary) !important;
    background: var(--client-theme-primary-soft) !important;
}

.booking-consent-badge {
    border-color: var(--site-border) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

/* The feed and rich-text editor output must use the saved palette too. */
.site-content :where(.article-rich-text, .article-rich-text p,
       .article-rich-text li, .vk-post .vk-content) {
    color: var(--site-text) !important;
    font-family: var(--site-font-family) !important;
}

.site-content :where(.vk-header, .vk-footer, .comment-date,
       .comment-info, .article-rich-text blockquote) {
    color: var(--site-muted-text) !important;
}

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

.site-content :where(.vk-like-btn, .vk-comment-count,
       .comment-actions button, .article-rich-text pre,
       .article-rich-text code) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-text) !important;
    background: var(--client-theme-surface-soft) !important;
}

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

.site-content .vk-pinned-badge {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

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

/* Text within cards, location details and catalogue controls. */
.site-content :where(.services-page h2, .services-page h3,
       .masters-page h1, .masters-page h2,
       .client-certificates h1, .client-certificates h2,
       .courses-page h1, .courses-page h2,
       .locations-page h1, .locations-page h3) {
    color: var(--site-text) !important;
    font-family: var(--site-heading-font-family) !important;
}

.site-content :where(.old-price, .client-certificate-description,
       .client-certificate-description p, .client-certificates__tabs a:not(.active),
       .courses-tabs a:not(.active), .courses-tabs button:not(.active),
       .course-card__curator small, .locations-heading p,
       .locations-map-label, .locations-map-fallback p,
       .location-card-content p, .market-card__description,
       .market-card__meta span) {
    color: var(--site-muted-text) !important;
}

.site-content :where(.new-price, .service-discount-countdown,
       .master-card-about, .client-certificate-card__image span,
       .location-card-link, .location-card-link span,
       .locations-map-fallback span, .market-category-tile__image,
       .market-card__rating span) {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.course-card__price, .course-card__price strong,
       .course-card__curator span, .client-certificate-card__meta strong,
       .market-card__rating strong, .locations-map-fallback strong) {
    color: var(--site-text) !important;
}

.site-content :where(.slider-arrow, .market-card__media,
       .market-card__media a) {
    color: var(--site-accent-readable) !important;
}

.site-content .market-category-tile {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content :where(.market-category-tile__image,
       .market-card__media, .client-certificate-card__image) {
    border-radius: var(--site-input-radius) !important;
}

/* Authentication screens are client pages and should not keep default gold/gray. */
.site-content :where(.subtitle, .form-help, .form-hint,
       .login-card small, .register-card small) {
    color: var(--site-muted-text) !important;
}

.site-content :where(.login-card a, .register-card a,
       .password-reset-card a, .toggle-password) {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.service-bottom span, .social-auth__divider span,
       .master-booking-flow p) {
    color: var(--site-muted-text) !important;
}

.site-content :where(.course-card__curator strong,
       .locations-map-toolbar strong) {
    color: var(--site-text) !important;
}

.site-content :where(.slider-arrow, .master-card-about,
       .market-filter-button, .market-sort-button,
       .market-cart-link, .input-box) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
}

.site-content :where(.master-card-about, .market-filter-button,
       .market-sort-button, .market-cart-link):hover {
    border-color: var(--site-primary) !important;
    background: var(--client-theme-primary-soft) !important;
}

.site-content :where(.public-service-placeholder, .locations-map-frame,
       .location-card-image, .login-site-image) {
    background: var(--client-theme-surface-soft) !important;
}

.site-content .client-certificate-description button {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .client-certificate-description button:hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.site-content :where(.discount-badge, .market-card__rating) {
    border-color: var(--site-border) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

/* Product and service detail pages have additional panels beyond list cards. */
.site-content :where(.market-detail__main-media,
       .market-detail__buy-box, .market-receiving,
       .market-detail__description, .market-detail__lazy-panel,
       .market-detail__feedback, .market-review-card,
       .market-question-card) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content :where(.market-cart-stepper,
       .market-question-card__question,
       .market-question-card__answer) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-text) !important;
    background: var(--client-theme-surface-soft) !important;
}

.site-content :where(.market-detail__panel-arrow,
       .market-detail__video-thumb.is-active,
       .service-reviews__arrow) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
}

.site-content .market-primary-action {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .market-primary-action:hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.site-content .market-detail__buy-box .market-primary-action {
    border-color: var(--site-border) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

.site-content .market-detail__buy-box .market-primary-action:hover {
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-primary-soft) !important;
}

.site-content :where(.market-review-stars,
       .market-review-stars .is-active,
       .service-reviews__heading strong) {
    color: var(--site-accent-readable) !important;
}

/* Keep the body-size control effective in copy with fixed legacy px sizes. */
.site-content :where(.article-rich-text, .vk-content,
       .article-rich-text p, .article-rich-text li) {
    font-size: var(--site-font-size) !important;
    line-height: var(--site-line-height) !important;
}

.site-content :where(.vk-header, .vk-footer,
       .market-card__description, .client-certificate-description,
       .course-card__description, .location-card-content p) {
    font-size: calc(var(--site-font-size) * .8125) !important;
    line-height: var(--site-line-height) !important;
}

/* Master profile and booking dialogs live outside .site-content. */
.site-content .master-card-book,
.master-booking-overlay .master-booking-submit:not(:disabled) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .master-card-book:hover,
.master-booking-overlay .master-booking-submit:not(:disabled):hover {
    border-color: var(--site-primary-hover) !important;
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.master-about-modal,
.master-booking-modal {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
    font-family: var(--site-font-family) !important;
}

.master-about-photo-wrap {
    border-radius: var(--site-card-radius) 0 0 var(--site-card-radius) !important;
}

.master-about-close,
.master-booking-close {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.master-about-close:hover,
.master-booking-close:hover {
    background: var(--client-theme-accent-soft) !important;
}

.master-about-kicker,
.master-about-facts a,
.master-about-description h3 {
    color: var(--site-accent-readable) !important;
}

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

.master-about-facts dt,
.master-about-description p,
.master-about-loading,
.master-booking-loading {
    color: var(--site-muted-text) !important;
}

.master-about-facts dd {
    color: var(--site-text) !important;
}

.master-about-experience {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.master-booking-date-button:disabled {
    border-color: var(--site-border) !important;
    color: var(--site-muted-text) !important;
    background: var(--client-theme-surface-soft) !important;
}

@media (max-width: 600px) {
    .master-about-photo-wrap {
        border-radius: var(--site-card-radius) var(--site-card-radius) 0 0 !important;
    }
}

/* Detailed service: price, description and public reviews. */
.site-content :where(.service-card-info, .service-reviews__empty) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .service-image img {
    border-radius: var(--site-card-radius) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .service-reviews {
    border-color: var(--site-border) !important;
}

.site-content .service-text {
    color: var(--site-muted-text) !important;
    font-size: var(--site-font-size) !important;
    line-height: var(--site-line-height) !important;
}

.site-content :where(.service-reviews__heading > strong,
       .service-reviews__loader button) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--client-theme-accent-soft) !important;
}

.site-content :where(.service-reviews__empty,
       .service-reviews__feedback:not(.is-error),
       .service-public-review__author time,
       .service-public-review > p) {
    color: var(--site-muted-text) !important;
}

.site-content .service-public-review__author strong {
    color: var(--site-text) !important;
}

.site-content .service-public-review__stars .is-active {
    color: var(--site-accent-readable) !important;
}

/* Profile sections must use the same surface, border, type and button tokens. */
.profile-page :where(.profile-login-links, .profile-calendar-sync,
       .profile-max, .profile-login-link, .profile-calendar-sync__card) {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.profile-page :where(.profile-login-links-heading > p,
       .profile-login-link-content p, .profile-login-link-content small,
       .profile-calendar-sync header p:last-child,
       .profile-calendar-sync__card p, .profile-max > div > p:last-child,
       .profile-calendar-sync__unavailable,
       .profile-login-link-unavailable) {
    color: var(--site-muted-text) !important;
}

.profile-page .profile-section-kicker {
    color: var(--site-accent-readable) !important;
}

.profile-page :where(.profile-login-link-unavailable,
       .profile-calendar-sync__unavailable) {
    border-radius: var(--site-input-radius) !important;
    background: var(--client-theme-surface-soft) !important;
}

.profile-page :where(.profile-security-button, .profile-login-link > a,
       .profile-legal-documents-open) {
    border-color: var(--site-primary) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.profile-page :where(.profile-security-button, .profile-login-link > a,
       .profile-legal-documents-open):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

.profile-page .profile-login-link-unlink {
    border-radius: var(--site-button-radius) !important;
}

.profile-page .profile-legal-documents-action {
    border-color: var(--site-border) !important;
}

.profile-legal-documents-dialog .profile-legal-documents-close {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-accent-readable) !important;
    background: var(--site-surface) !important;
}

.profile-legal-documents-dialog .profile-legal-documents-heading > span {
    color: var(--site-accent-readable) !important;
}

.profile-legal-documents-dialog .profile-legal-documents-heading p {
    color: var(--site-muted-text) !important;
}

.profile-legal-documents-dialog .profile-legal-document {
    border-color: var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-text) !important;
    background: var(--site-surface) !important;
}

/* Legacy copy and status chips still carried hard-coded gold, green and gray. */
.site-content :where(.public-service-placeholder, .course-card__placeholder,
       .client-certificate-salon, .course-card__duration,
       .course-card__prepayment, .course-card__payment-summary,
       .course-countdown, .course-details__facts span,
       .course-details__description p, .course-details__curator small,
       .courses-empty, .courses-messages > div,
       .client-certificate-refund-form small,
       .market-review-card time, .market-detail__address-row > b) {
    color: var(--site-muted-text) !important;
}

.site-content .public-category-toggle-icon {
    color: var(--site-accent-readable) !important;
}

.site-content :where(.course-card__prepayment strong,
       .course-card__payment-summary strong, .course-countdown strong,
       .course-details__facts strong, .course-details__curator strong,
       .course-payment-result) {
    color: var(--site-text) !important;
}

.site-content :where(.course-card__payment-summary, .course-countdown,
       .courses-empty, .courses-messages > div, .course-payment-result) {
    border-color: var(--site-border) !important;
    background: var(--client-theme-surface-soft) !important;
}

.site-content .master-experience-badge {
    border-color: var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.market-detail__availability-chip,
       .market-detail__address-row > b, .market-detail__addresses b,
       .client-certificate-status, .client-certificate-card__paid,
       .client-certificate-card__sold, .course-card__joined,
       .course-card__closed, .course-countdown--progress,
       .service-history-status, .service-history-review-state,
       .operation-status, .order-status, .order-review-state,
       .client-order-payment, .profile-document-status,
       .profile-login-link-state, .profile-email-state,
       .profile-calendar-sync__state, .booking-consent-status,
       .master-booking-status) {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-text) !important;
    background: var(--client-theme-primary-soft) !important;
}

.site-content :where(.market-detail__availability-chip.is-available,
       .market-detail__address-row > b.is-available,
       .market-detail__addresses b.is-available,
       .client-certificate-status--unused, .client-certificate-card__paid,
       .course-card__joined, .service-history-status--completed,
       .operation-status--succeeded, .order-status--issued,
       .client-order-payment--paid) {
    background: var(--client-theme-accent-soft) !important;
}

.site-content :where(.market-detail__availability-chip::before,
       .market-detail__availability-chip.is-available::before) {
    background: var(--site-accent) !important;
    box-shadow: 0 0 0 3px var(--client-theme-accent-soft) !important;
}

.site-content :where(.market-detail__social-proof a span,
       .market-review-stars .is-active, .order-review-state > span) {
    color: var(--site-accent-readable) !important;
}

/* Certificate prices and labels are rendered over images and coloured cards. */
.site-content .client-certificate-card__image {
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content .client-certificate-card__image strong,
.site-content .client-certificate-card__limited,
.site-content .client-certificate-card__paid,
.site-content .client-certificate-card__sold {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content .client-certificate-card__body,
.site-content .client-certificate-card h2,
.site-content .client-certificate-card__meta strong {
    color: var(--site-surface-ink) !important;
}

.site-content .client-certificate-card__body form button,
.site-content .client-certificate-description button {
    color: var(--site-primary-contrast) !important;
}

/* The catalogue browser and search bar had independent white/purple styles. */
.site-content :where(.market-category-browser, .market-search) {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-card-radius) !important;
    color: var(--site-surface-ink) !important;
    background: var(--site-surface) !important;
    box-shadow: var(--site-card-shadow) !important;
}

.site-content .market-category-tile {
    border-color: var(--site-border) !important;
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content .market-category-tile[aria-current="page"] {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.market-category-tile__image,
       .market-category-tile__all, .market-category-tile__favorites) {
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content :where(.market-search input, .market-filter-range__fields input) {
    border: 1px solid var(--site-border) !important;
    color: var(--site-surface-ink) !important;
    background: var(--site-surface) !important;
}

.site-content :where(.market-search button, .market-add-cart,
       .market-sort-submit, .market-question-submit, .market-question-add) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.market-search button, .market-add-cart,
       .market-sort-submit, .market-question-submit, .market-question-add):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}

/* Gallery labels remain legible over photos but now use the chosen palette. */
.site-content .client-gallery-folder-all {
    border-color: var(--site-border) !important;
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

.site-content .client-gallery-item-folder {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-hover-ink) !important;
    background: var(--site-primary-hover) !important;
}

/* History status and payment chips no longer use fixed success/error colours. */
.site-content :where(.service-history-status, .service-history-payment,
       .service-history-review-state, .operation-status,
       .order-status, .order-review-state, .client-order-payment) {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-button-radius) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.service-history-count, .service-history-card,
       .operation-history-count, .operation-receipt) {
    color: var(--site-surface-ink) !important;
}

/* Course details dialog and its nested cards must not retain beige copy. */
.course-details-modal__dialog,
.course-details__body {
    color: var(--site-surface-ink) !important;
    background: var(--site-surface) !important;
}

.course-details__body :where(h2, h3, strong) {
    color: var(--site-surface-ink) !important;
}

.course-details__facts > div {
    border: 1px solid var(--site-border) !important;
    border-radius: var(--site-input-radius) !important;
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

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

.course-details__media,
.course-details__media-stage,
.course-details__media-thumbnail {
    border-color: var(--site-border) !important;
    background: var(--site-background) !important;
}

.course-details__placeholder {
    color: var(--site-background-ink) !important;
}

.course-details-modal__close {
    border-color: var(--site-border) !important;
    color: var(--site-surface-ink) !important;
    background: var(--site-surface) !important;
}

.site-content .course-card__type,
.course-details__body .course-card__type {
    border-color: var(--site-border) !important;
    color: var(--site-background-ink) !important;
    background: var(--site-background) !important;
}

/* Secondary-looking action buttons should not hide the chosen text colour. */
.site-content :where(.slider-arrow, .master-card-about,
       .market-filter-button, .market-cart-link) {
    border-color: var(--site-primary) !important;
    color: var(--site-primary-contrast) !important;
    background: var(--site-primary) !important;
}

.site-content :where(.slider-arrow, .master-card-about,
       .market-filter-button, .market-cart-link):hover {
    color: var(--site-primary-hover-contrast) !important;
    background: var(--site-primary-hover) !important;
}
