.kc-site-search__retry {
    min-height: 44px;
    padding: 8px 16px;
    border: 1px solid #15549b;
    border-radius: 8px;
    background: #fff;
    color: #15549b;
    font: inherit;
    cursor: pointer;
}

/* Fill the contact column while retaining the original maximum embed width. */
#contact iframe[src*="yandex.ru/map-widget/"] {
    width: 100%;
    max-width: 700px;
}

/* The imported price grid may sit under a section with a different or absent anchor. */
#tm-main .uk-container > .uk-grid.tm-grid-expand.uk-child-width-1-1.uk-margin-xlarge:first-child:has(
    + .uk-grid.tm-grid-expand.uk-grid-small.uk-grid-margin-small .uk-text-primary,
    + .uk-grid.tm-grid-expand.uk-margin-medium + .uk-grid.tm-grid-expand.uk-grid-small.uk-grid-margin-small .uk-text-primary
) {
    margin-block-end: clamp(24px, 4vw, 48px) !important;
}

#tm-main :is(#obrasovanie, #obrasovanie > .uk-container) > .uk-grid-margin.uk-container.uk-container-small
    + .uk-grid.uk-margin-remove-vertical + .uk-margin-xlarge.uk-container.uk-container-small {
    margin-block-start: clamp(32px, 5vw, 64px) !important;
}

#tm-main > .uk-section-default.fs-section.uk-section:not([id]):has(+ #video):has(> .uk-container:only-child > .uk-grid:only-child > .uk-width-1-1:only-child > hr:only-child) {
    padding-block: clamp(16px, 2vw, 24px);
}

#tm-main #uhod .uk-panel.uk-text-lead + #page\#6.uk-margin-xlarge {
    margin-block-start: clamp(32px, 4vw, 56px) !important;
}

/* Keep the original UIkit tracks and size doctor cards by viewport, not by roster length. */
#tm-main .fs-grid .fs-load-more-container:has(> .fs-load-more-item .fs-grid-item-holder img.uk-border-circle) {
    --kc-doctor-card-width: 100%;
}

#tm-main .fs-grid .fs-load-more-container:has(> .fs-load-more-item .fs-grid-item-holder img.uk-border-circle)
    > .fs-load-more-item {
    width: var(--kc-doctor-card-width);
    min-width: 0;
}

@media (min-width: 640px) {
    #tm-main .fs-grid .fs-load-more-container:has(> .fs-load-more-item .fs-grid-item-holder img.uk-border-circle) {
        --kc-doctor-card-width: 50%;
    }

    /* The splinting carousel has a default grid gutter in its archived markup. */
    #tm-main .fs-grid .uk-slider-items.fs-load-more-container:not(.uk-grid-column-large):has(
        > .fs-load-more-item .fs-grid-item-holder img.uk-border-circle
    ) {
        margin-left: -40px;
    }

    #tm-main .fs-grid .uk-slider-items.fs-load-more-container:not(.uk-grid-column-large):has(
        > .fs-load-more-item .fs-grid-item-holder img.uk-border-circle
    ) > .fs-load-more-item {
        padding-left: 40px;
    }
}

@media (min-width: 960px) {
    #tm-main .fs-grid .fs-load-more-container:has(> .fs-load-more-item .fs-grid-item-holder img.uk-border-circle) {
        --kc-doctor-card-width: calc(100% / 3);
    }
}

@media (min-width: 640px) {
    .kc-doctor-profile-intro h1 br {
        display: none;
    }

    .kc-doctor-profile-intro .uk-subnav {
        justify-content: flex-start;
    }
}

/* Keep the visible clinic header in flow and leave UIkit's legacy header alone. */
html:has(.tm-page > :is(.hdr, .kc-error-nav)) {
    --kc-header-height: 152px;
    scroll-padding-block: calc(var(--kc-header-height) + 12px) var(--kc-bottom-clearance);
}

html:has(.tm-page > .kc-error-nav) {
    --kc-header-height: 64px;
}

.tm-page > :is(.hdr, .kc-error-nav) {
    position: sticky;
    top: 0;
    z-index: 980;
}

.tm-page > .hdr {
    top: calc(-1 * var(--kc-desktop-topbar-height, 0px));
}

.hdr .hdr-compact-actions {
    position: absolute;
    inset-block-start: 100%;
    inset-inline: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px clamp(12px, 2vw, 24px);
    padding: 4px 12px;
    visibility: hidden;
    background: #fff;
    border-bottom: 1px solid #dbe4ee;
}

.hdr.kc-header-compact .hdr-compact-actions {
    visibility: visible;
}

.hdr .hdr-compact-actions .hdr-info-block {
    min-height: 44px;
    gap: 8px;
}

.hdr .hdr-compact-actions .hdr-info-icon {
    width: 28px;
    height: 28px;
}

.hdr .hdr-compact-actions .hdr-info-sub {
    display: none;
}

.kc-error-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 12px;
    padding: 6px 12px;
    border-bottom: 1px solid #dbe4ee;
    background: #fff;
}

.kc-error-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: 6px;
    color: #15549b;
    overflow-wrap: anywhere;
}

/* Keep the independently owned notices in separate rows. */
html {
    --kc-verification-gap: max(8px, env(safe-area-inset-bottom));
    --kc-notice-stack: calc(var(--kc-cookie-height, 0px) + var(--kc-verification-clearance, 0px));
    --kc-bottom-clearance: calc(var(--kc-viewport-bottom, 0px) + var(--kc-notice-stack));
}

html:has(#sp-cookie-consent:not([data-kc-cookie-dismissed])) {
    --kc-verification-gap: 8px;
}

html.kc-verification-visible {
    --kc-verification-clearance: calc(var(--kc-verification-height) + var(--kc-verification-gap));
}

body {
    padding-bottom: var(--kc-bottom-clearance);
}

.tm-page #footer\#0 {
    display: none !important;
}

html.kc-keyboard-open :is(#sp-cookie-consent, .tm-cookie-banner.uk-notification-bottom-left),
body:has(.hdr-mobile-menu.is-open, .mega.is-visible, .uk-modal.uk-open, .kc-site-search[open], .djacc__panel--active) :is(#sp-cookie-consent, .tm-cookie-banner.uk-notification-bottom-left) {
    visibility: hidden;
}

html.kc-keyboard-open {
    --kc-bottom-clearance: var(--kc-viewport-bottom, 0px);
}

body #sp-cookie-consent.position-bottom {
    box-sizing: border-box;
    display: block;
    inset: auto 0 var(--kc-viewport-bottom, 0px);
    width: auto;
    min-height: 0;
    max-height: none;
    padding: 8px max(12px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    border: 1px solid #dbe4ee;
    border-radius: 12px 12px 0 0;
    background: #f8fafc;
    box-shadow: 0 -4px 24px rgb(24 52 82 / 12%);
    animation: none;
}

body #sp-cookie-consent.position-bottom > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 16px;
    max-width: 1200px;
    margin-inline: auto;
    padding: 0;
}

body #sp-cookie-consent.position-bottom :is(.sp-cookie-consent-content, .sp-cookie-consent-action) {
    max-width: 100%;
    margin: 0;
}

body #sp-cookie-consent.position-bottom .sp-cookie-consent-content {
    max-height: max(44px, 24vh);
    max-height: max(44px, 24dvh);
    overflow: auto;
    padding: 3px;
    color: #374151;
    font: inherit;
    font-size: max(14px, 0.875rem);
    line-height: 1.4;
    overflow-wrap: anywhere;
    overscroll-behavior-y: contain;
}

body #sp-cookie-consent.position-bottom .sp-cookie-consent-content a {
    font: inherit;
}

body #sp-cookie-consent.position-bottom .sp-cookie-allow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: #047857;
    box-shadow: none;
    color: #fff;
    font: inherit;
    font-size: max(14px, 0.875rem);
    font-weight: 650;
    line-height: 1.35;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

body #sp-cookie-consent.position-bottom .sp-cookie-allow:hover {
    background: #065f46;
    transform: none;
}

#sp-cookie-consent :is(a, button):focus-visible,
.tm-cookie-banner.uk-notification-bottom-left button:focus-visible,
.tm-cookie-banner.uk-notification-bottom-left a:focus-visible {
    outline: 2px solid #075ac1;
    outline-offset: 2px;
}

body > .tm-cookie-banner.uk-notification-bottom-left {
    position: fixed;
    inset: auto max(8px, env(safe-area-inset-right)) auto max(8px, env(safe-area-inset-left));
    bottom: calc(var(--kc-viewport-bottom, 0px) + var(--kc-cookie-height, 0px) + var(--kc-verification-gap)) !important;
    width: auto;
    max-width: 680px;
    max-height: none;
    margin: 0;
    border-radius: 12px;
    box-shadow: 0 -4px 24px rgb(24 52 82 / 12%);
}

body > .tm-cookie-banner.uk-notification-bottom-left .uk-notification-message {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px 16px;
    min-height: 0;
    margin: 0;
    padding: 8px 12px;
    border: 1px solid #dbe4ee;
    border-radius: inherit;
    background: #f8fafc;
    color: #374151;
    font: inherit;
    font-size: max(14px, 0.875rem);
    line-height: 1.4;
}

body > .tm-cookie-banner.uk-notification-bottom-left p {
    flex: 1 1 14rem;
    max-width: 100%;
    margin: 0;
    color: inherit;
    font: inherit;
    overflow-wrap: anywhere;
}

body > .tm-cookie-banner.uk-notification-bottom-left p.uk-margin-small-top {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0 !important;
}

body > .tm-cookie-banner.uk-notification-bottom-left .uk-button {
    min-height: 44px;
    margin: 0 !important;
    padding: 8px 12px;
    font: inherit;
    font-weight: 650;
    line-height: 1.35;
    white-space: normal;
}

body > .tm-cookie-banner.uk-notification-bottom-left .uk-button-primary {
    background: #15549b;
    color: #fff;
}

body > .tm-cookie-banner.uk-notification-bottom-left .uk-button-default {
    border-color: #8296ac;
    background: #fff;
    color: #374151;
}

/* Keep the existing header readable as the desktop row approaches the mobile breakpoint. */
.hdr .hdr-info {
    min-width: 0;
}

.hdr .hdr-ya-text,
.hdr .hdr-info-sub {
    color: #536075;
    font-size: 14px;
    line-height: 1.35;
    white-space: normal;
}

.hdr .hdr-yandex {
    max-width: 210px;
}

.hdr .hdr-info-block {
    min-width: 0;
}

.hdr .hdr-info-main {
    white-space: normal;
    overflow-wrap: anywhere;
}

.hdr a[href^="tel:"] .hdr-info-main {
    white-space: nowrap;
}

.hdr .hdr-socials,
.hdr .hdr-djacc-slot,
.hdr .hdr-cta {
    flex: none;
}

.hdr .hdr-search,
.hdr .hdr-mobile-bottom button[data-kc-search] {
    min-width: 44px;
    min-height: 44px;
}

.hdr .hdr-mobile-max {
    display: none;
}

.hdr :is(a, button):focus-visible,
.kc-error-nav a:focus-visible,
.kc-site-search :is(a, button, input):focus-visible {
    outline: 2px solid #075ac1;
    outline-offset: 3px;
}

.uk-breadcrumb > * > :is(a, span) {
    font-size: max(14px, 0.875rem);
    line-height: 1.4;
}

.uk-breadcrumb > * > a {
    color: #536075;
}

.hero-pg-breadcrumbs {
    flex-wrap: wrap;
}

#tm-main .hero-diag-breadcrumbs :is(a, .sep, .current) {
    font-size: max(14px, 0.875rem);
    line-height: 1.4;
}

#tm-main .hero-diag-breadcrumbs :is(a, .sep) {
    color: #536075;
}

.hero-pg-breadcrumbs a,
.hero-pg-breadcrumbs span.sep,
.hero-pg-breadcrumbs span.current,
.hero-pg-rating span,
.form-custom-checkbox {
    font-size: 14px;
    line-height: 1.4;
}

.hero-pg-breadcrumbs a,
.hero-pg-breadcrumbs span.sep {
    color: #536075;
}

.hero-pg-breadcrumbs span.current {
    color: #15549b;
}

.form-custom-checkbox {
    color: #f0f5fa;
}

.form-custom-input::placeholder {
    color: #5f697a;
    opacity: 1;
}

:where([data-kc-heading-block="p"], [data-kc-heading-block="div"]) {
    display: block;
}

:where([data-kc-heading-block="p"]) {
    margin: 0 0 20px;
}

* + :where([data-kc-heading-block="p"]) {
    margin-top: 20px;
}

/* The second services section shares the original card presentation. */
#services-2 .el-image {
    transition: all 0.3s ease;
}

#services-2 .el-image:hover {
    transform: translateY(-20px);
}

#services-2 .el-title {
    font-weight: 500;
}

.hero-section .hero-badge {
    background: linear-gradient(135deg, #1755bd, #08649e);
}

@media (960px < width < 1320px) {
    .hdr .hdr-topbar {
        padding-block: 12px;
    }

    .hdr .hdr-container {
        padding-inline: 20px;
    }

    .hdr .hdr-top-row {
        display: grid;
        grid-template-columns: 104px minmax(0, 1fr) max-content max-content max-content;
        column-gap: 14px;
        row-gap: 8px;
    }

    .hdr .hdr-top-row > .hdr-logo {
        grid-column: 1;
        grid-row: 1 / span 2;
    }

    .hdr .hdr-top-row > .hdr-info {
        display: grid;
        grid-column: 2 / -1;
        grid-row: 1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-inline-start: 0;
    }

    .hdr .hdr-top-row > .hdr-socials {
        grid-column: 2;
        grid-row: 2;
        justify-self: end;
    }

    .hdr .hdr-top-row > .hdr-search {
        grid-column: 3;
        grid-row: 2;
    }

    .hdr .hdr-top-row > .hdr-djacc-slot {
        grid-column: 4;
        grid-row: 2;
    }

    .hdr .hdr-top-row > .hdr-cta {
        grid-column: 5;
        grid-row: 2;
        justify-self: end;
    }

    .hdr .hdr-djacc-slot .djacc {
        padding: 0 !important;
    }

    .hdr .hdr-nav-row {
        flex-wrap: wrap;
        column-gap: 12px;
    }

    .hdr .hdr-nav {
        flex-wrap: wrap;
    }

    .hdr .hdr-nav > li > a {
        padding-inline: clamp(6px, 0.68vw, 10px);
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .hdr .hdr-promo {
        max-width: 100%;
        white-space: normal;
    }

    .hero-section .hero-grid {
        gap: 24px;
    }

    .hero-section .hero-content {
        padding-inline-start: clamp(20px, 4.5vw, 60px);
    }

    .hero-section .hero-title {
        font-size: clamp(32px, 3.45vw, 40px) !important;
        text-wrap: balance;
    }

    .hero-section .hero-title br {
        display: none;
    }

    .hero-section .hero-image {
        min-width: 0;
    }

    .hero-section .hero-badge {
        right: auto;
        left: 0;
        bottom: clamp(112px, 12vw, 164px);
        width: 104px;
        height: 104px;
        font-size: 16px;
    }
}

@media (max-width: 960px) {
    html:has(.tm-page > .hdr) {
        --kc-header-height: 73px;
    }

    html.kc-header-drawer-open {
        overflow: hidden;
    }

    .hdr .hdr-compact-actions {
        display: none;
    }

    .hdr .hdr-mobile .hdr-container {
        padding-inline: clamp(12px, 5vw, 30px);
    }

    .hdr .hdr-mobile-menu {
        box-sizing: border-box;
        inset: 0;
        width: auto;
        height: auto;
        padding-block-end: calc(24px + env(safe-area-inset-bottom));
        overscroll-behavior-y: contain;
        scroll-padding-block-start: 84px;
    }

    .hdr .hdr-mobile-menu :is(.mob-cat-link, .mob-sub a) {
        overflow-wrap: anywhere;
    }

    .hero-section .hero-badge {
        left: max(-10px, -4%);
        width: 86px;
        height: 86px;
        font-size: 14px;
    }

    .hero-pg-features li {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    /* The left tracks mirror the two contact targets to keep the logo centered. */
    .hdr .hdr-mobile-row:has(> .hdr-mobile-max) {
        display: grid;
        grid-template-columns: 44px minmax(48px, 1fr) minmax(0, 84px) minmax(48px, 1fr) 44px;
    }

    .hdr .hdr-mobile-logo:has(+ .hdr-mobile-max) {
        grid-column: 3;
        min-inline-size: 0;
    }

    .hdr .hdr-mobile-logo:has(+ .hdr-mobile-max) img {
        width: auto;
        height: auto;
        max-inline-size: 100%;
        max-block-size: 48px;
    }

    .hdr .hdr-mobile-max {
        grid-column: 4;
        display: grid;
        place-items: center;
        justify-self: end;
        inline-size: 44px;
        block-size: 44px;
        margin-inline-end: 4px;
    }

    .hdr .hdr-mobile-max + .hdr-mobile-phone {
        grid-column: 5;
    }

    #tm-main :is(.uk-subnav-divider:has(> li > a[href="#prot.impl"]), .el-nav.uk-subnav-pill[uk-switcher]) {
        gap: 6px 12px;
        margin-inline: 0;
    }

    #tm-main :is(.uk-subnav-divider:has(> li > a[href="#prot.impl"]), .el-nav.uk-subnav-pill[uk-switcher]) > li {
        box-sizing: border-box;
        min-width: 0;
        max-width: 100%;
        padding-inline: 0;
    }

    #tm-main :is(.uk-subnav-divider:has(> li > a[href="#prot.impl"]), .el-nav.uk-subnav-pill[uk-switcher]) > li > a {
        box-sizing: border-box;
        min-width: 0;
        min-height: 44px;
        max-width: 100%;
        padding-block: 10px;
        font-size: max(16px, 1rem);
        line-height: 1.4;
        text-align: center;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #tm-main .uk-subnav-divider:has(> li > a[href="#prot.impl"]) > li::before {
        display: none;
    }

    #tm-main .uk-grid-match.uk-child-width-1-2.uk-child-width-1-3\@s .el-item.uk-width-medium.uk-panel .uk-padding-small {
        padding-inline: 4px;
    }

    #tm-main .uk-grid-match.uk-child-width-1-2.uk-child-width-1-3\@s .el-item.uk-width-medium.uk-panel .el-title.uk-h5.uk-link-heading {
        font-size: max(14px, 0.875rem);
        line-height: 1.4;
        overflow-wrap: anywhere;
        hyphens: auto;
    }

    body #sp-cookie-consent.position-bottom > div {
        grid-template-columns: minmax(0, 1fr);
    }

    .kc-short-viewport body #sp-cookie-consent.position-bottom > div {
        grid-template-columns: minmax(0, 1fr) auto;
    }
}

@media (max-width: 375px) and (min-height: 500px) and (orientation: portrait) {
    /* Preserve the full text width when a short portrait viewport can fit both rows. */
    .kc-short-viewport body #sp-cookie-consent.position-bottom > div {
        grid-template-columns: minmax(0, 1fr);
    }

    .kc-short-viewport body #sp-cookie-consent.position-bottom .sp-cookie-consent-content {
        max-height: max(44px, 32vh);
        max-height: max(44px, 32dvh);
    }
}

#modal-form.uk-modal {
    --kc-booking-viewport: 100vh;
    --kc-booking-viewport: 100dvh;
    --kc-booking-gutter-top: max(12px, env(safe-area-inset-top));
    --kc-booking-gutter-bottom: max(12px, env(safe-area-inset-bottom));
    padding-block: var(--kc-booking-gutter-top) var(--kc-booking-gutter-bottom);
    padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right));
}

#modal-form .form-custom {
    min-height: 0;
    max-height: calc(var(--kc-booking-viewport) - var(--kc-booking-gutter-top) - var(--kc-booking-gutter-bottom));
}

#modal-form .form-custom-content {
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    justify-content: start;
    padding: 66px clamp(16px, 4vw, 48px) 24px;
    scroll-padding-block: 66px 12px;
}

#modal-form .form-custom-content > * {
    flex-shrink: 0;
}

#modal-form .form-custom-image img {
    max-height: min(36vh, 400px);
    object-fit: contain;
    object-position: center bottom;
}

#modal-form .form-custom-close.uk-close {
    display: grid !important;
    place-items: center;
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    background: #fff;
    color: #15549b;
}

#modal-form .form-custom-close:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

#modal-form.kc-booking-short .form-custom-image {
    width: min(25%, 140px);
    min-width: 90px;
    align-self: center;
}

#modal-form.kc-booking-short .form-custom-image img {
    display: none;
}

#modal-form.kc-booking-short .form-custom-badge {
    position: static;
    width: auto;
    height: auto;
    padding: 8px;
    margin: 8px;
    border-radius: 10px;
    font-size: 14px;
}

.kc-site-search {
    box-sizing: border-box;
    width: min(640px, calc(100vw - 32px));
    max-width: none;
    max-height: 88vh;
    max-height: 88dvh;
    margin: auto;
    padding: clamp(16px, 3vw, 28px);
    overflow-y: auto;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 20px 60px rgb(24 52 82 / 24%);
}

.kc-site-search::backdrop {
    background: rgb(14 34 56 / 56%);
}

.kc-site-search:not([open]) {
    display: none;
}

.kc-site-search__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-block-end: 12px;
}

.kc-site-search__header h2 {
    margin: 0;
    font-size: clamp(20px, 4vw, 26px);
    line-height: 1.25;
    color: inherit;
}

.kc-site-search__close {
    flex: none;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: #edf3fa;
    color: #16375b;
    font: inherit;
    font-size: 24px;
    cursor: pointer;
}

.kc-site-search__input {
    box-sizing: border-box;
    width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid #8296ac;
    border-radius: 8px;
    background: #fff;
    color: inherit;
    font: inherit;
    font-size: 16px;
}

.kc-site-search__status {
    margin: 12px 0 0;
    color: #536075;
    font-size: 14px;
}

.kc-site-search__status:empty,
.kc-site-search__results:empty {
    margin: 0;
}

.kc-site-search__results {
    margin: 8px 0 0;
    padding: 0;
    list-style: none;
}

.kc-site-search__result {
    display: block;
    padding: 12px 4px;
    border-bottom: 1px solid #dbe4ee;
    color: #15549b;
    font-size: 16px;
    line-height: 1.4;
    text-decoration: none;
    overflow-wrap: anywhere;
}

.kc-site-search__result:hover {
    text-decoration: underline;
}

.kc-site-search__result small {
    display: block;
    margin-block-start: 4px;
    color: #536075;
    font-size: 14px;
}
