﻿:root {
    /* Base visual settings */
    --font-main: "Manrope", "Segoe UI", sans-serif;
    --radius: 18px;
    --btn-radius: 12px;
    --shadow: 0 12px 28px rgba(44, 106, 168, 0.14);
    --panel-glow: rgba(105, 180, 240, 0.13);
    --panel-glow-soft: rgba(105, 180, 240, 0.09);
    --bg: #f4f8ff;
    --bg2: #eaf2ff;
    --text: #1d2b3a;
    --muted: #617488;
    --card: #ffffff;
    --border: #d5e1f0;
    --primary: #2f80ed;
    --primary-contrast: #ffffff;
    --accent: #87d0b0;
    --danger: #c94242;
    --warn: #d18a00;
    /* Order page spacing settings */
    --order-layout-gap: .72rem;
    --order-card-padding: .9rem;
    --order-mobile-card-padding: .72rem;
    --order-category-padding-y: .52rem;
    --order-category-padding-x: .65rem;
    --order-table-row-gap: .28rem;
    --order-inner-gap: .48rem;
    --order-table-cell-padding-y: .34rem;
    --order-table-cell-padding-x: .38rem;
    --order-cart-table-min-width: 940px;
    --order-cart-mobile-table-min-width: 560px;
    --order-cart-col-code: 6.8rem;
    --order-cart-col-name: 10.2rem;
    --order-cart-col-doctor: 13.4rem;
    --order-cart-col-unit: 5.8rem;
    --order-cart-col-price: 6.8rem;
    --order-cart-col-action: 5.6rem;
}

html[data-theme="soft"],
html[data-theme="aurora"] {
    --bg: #f4f8ff;
    --bg2: #eaf2ff;
    --text: #1d2b3a;
    --muted: #617488;
    --card: #ffffff;
    --border: #d5e1f0;
    --primary: #2f80ed;
    --accent: #87d0b0;
}

html[data-theme="graphite"] {
    --bg: #1d232d;
    --bg2: #252d39;
    --text: #e6edf7;
    --muted: #a9b6c8;
    --card: #2a3341;
    --border: #3b475b;
    --primary: #7f96b7;
    --accent: #8fa3bf;
    --shadow: 0 12px 28px rgba(10, 14, 20, 0.38);
    --panel-glow: rgba(114, 139, 170, 0.15);
    --panel-glow-soft: rgba(114, 139, 170, 0.09);
}

html[data-theme="black"] {
    --bg: #111317;
    --bg2: #181d24;
    --text: #f3f6fb;
    --muted: #a5b0c1;
    --card: #1f2530;
    --border: #323c4c;
    --primary: #90a7cc;
    --accent: #7f96b7;
    --shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
    --panel-glow: rgba(133, 157, 194, 0.13);
    --panel-glow-soft: rgba(133, 157, 194, 0.07);
}

html[data-theme="violet"] {
    --bg: #221b34;
    --bg2: #2b2440;
    --text: #f0ecff;
    --muted: #b7abdb;
    --card: #312a4a;
    --border: #463c67;
    --primary: #a68cff;
    --accent: #c4a9ff;
    --shadow: 0 12px 30px rgba(18, 10, 35, 0.42);
    --panel-glow: rgba(177, 149, 255, 0.14);
    --panel-glow-soft: rgba(177, 149, 255, 0.08);
}

html[data-theme="green"] {
    --bg: #1b2a24;
    --bg2: #21352d;
    --text: #e6f5ec;
    --muted: #a2c6b2;
    --card: #294136;
    --border: #3f5f51;
    --primary: #64b081;
    --accent: #8ed2a8;
    --shadow: 0 12px 30px rgba(9, 26, 17, 0.4);
    --panel-glow: rgba(112, 194, 146, 0.14);
    --panel-glow-soft: rgba(112, 194, 146, 0.08);
}

html[data-theme="mint"] {
    --bg: #effbf4;
    --bg2: #e4f5ec;
    --text: #1f3a2f;
    --muted: #5e7f70;
    --card: #ffffff;
    --border: #cde7d8;
    --primary: #4fb178;
    --accent: #8ad8a8;
    --shadow: 0 12px 28px rgba(49, 109, 77, 0.14);
    --panel-glow: rgba(123, 206, 160, 0.13);
    --panel-glow-soft: rgba(123, 206, 160, 0.08);
}

html[data-dark="1"] {
    --bg: #0f1a22;
    --bg2: #112534;
    --text: #dce8f7;
    --muted: #9fb1c4;
    --card: #132737;
    --border: #28465f;
    --primary: #62a3ff;
    --accent: #5ab9a3;
    --danger: #ff7777;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: var(--font-main);
    font-size: 1.06rem;
    background: radial-gradient(circle at 10% 10%, var(--bg2), var(--bg));
    color: var(--text);
}

.bg-pattern {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-pattern::before,
.bg-pattern::after {
    content: "";
    position: absolute;
    inset: 0;
}

.bg-pattern::before {
    inset: -10px;
    background-image:
        linear-gradient(
            140deg,
            color-mix(in srgb, var(--bg) 58%, transparent),
            color-mix(in srgb, var(--bg2) 44%, transparent)
        ),
        url("../images/background/main-bg.png");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(2.4px) saturate(1.12);
    transform: scale(1.01);
    opacity: 0.54;
}

.bg-pattern::after {
    background-image:
        radial-gradient(var(--panel-glow) 1px, transparent 1px),
        radial-gradient(var(--panel-glow-soft) 1px, transparent 1px);
    background-size: 28px 28px, 42px 42px;
    background-position: 0 0, 21px 21px;
    opacity: 0.24;
}

html[data-theme="graphite"] .bg-pattern::before,
html[data-theme="black"] .bg-pattern::before,
html[data-theme="violet"] .bg-pattern::before,
html[data-theme="green"] .bg-pattern::before {
    opacity: 0.38;
}

.container {
    width: min(1320px, calc(100% - 2rem));
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

.main-content.container {
    width: min(1460px, calc(100% - 2rem));
}

.site-header {
    position: sticky;
    top: 0;
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    background: color-mix(in oklab, var(--bg) 82%, transparent);
    z-index: 20;
    overflow: visible;
}

.site-header__topline {
    border-bottom: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 92%, var(--bg2));
}

.site-header__topline-inner {
    width: min(1460px, calc(100% - 2rem));
    margin: 0 auto;
    padding: .32rem 0;
    text-align: center;
    font-size: 1.38rem;
    font-weight: 800;
    line-height: 1.25;
    color: #000;
}

.site-header__topline-sub {
    display: block;
}

.header-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .55rem;
    padding: .9rem 0;
    overflow: visible;
}

.site-header .container.header-row {
    width: min(1460px, calc(100% - 2rem));
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
    white-space: nowrap;
    justify-self: start;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
}

.nav {
    display: flex;
    flex-wrap: wrap;
    gap: .72rem;
    min-width: 0;
    overflow-x: visible;
    overflow-y: visible;
    white-space: normal;
    scrollbar-width: none;
    padding-bottom: 0;
    justify-content: center;
    align-content: center;
    justify-self: center;
    margin-inline: auto;
    text-align: center;
    max-width: 100%;
}

.nav a,
.nav-dropdown > summary {
    color: var(--text);
    text-decoration: none;
    font-size: 1.08rem;
    font-weight: 600;
    flex: 0 0 auto;
}

.nav-dropdown {
    position: relative;
    flex: 0 0 auto;
}

.nav-dropdown > summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    cursor: pointer;
}

.nav-dropdown > summary::-webkit-details-marker {
    display: none;
}

.nav-dropdown > summary::after {
    content: "\25BE";
    font-size: .72rem;
    opacity: .75;
}

.nav-dropdown[open] > summary::after {
    content: "\25B4";
}

.nav-dropdown__menu {
    position: absolute;
    top: calc(100% + .35rem);
    left: 0;
    min-width: 15rem;
    display: grid;
    gap: .12rem;
    padding: .32rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    box-shadow: var(--shadow);
    z-index: 1200;
}

.nav-dropdown:not([open]) .nav-dropdown__menu {
    display: none;
}

.nav-dropdown__menu a {
    font-size: 1.08rem;
    font-weight: 600;
    padding: .48rem .62rem;
    border-radius: 8px;
}

.nav-dropdown__menu a:hover {
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

.actions {
    display: flex;
    align-items: center;
    gap: .45rem;
    flex-wrap: nowrap;
    justify-content: flex-end;
    min-width: max-content;
    justify-self: end;
}

.appointment-header-btn {
    white-space: nowrap;
    min-height: 2.2rem;
}

.actions form.inline {
    margin: 0;
    display: inline-flex;
    align-items: center;
}

.header-cart-link {
    position: relative;
}

.header-cart-link--with-badge {
    padding-right: 1.45rem;
}

.header-cart-link__badge {
    position: absolute;
    top: .18rem;
    right: .24rem;
    min-width: 1.05rem;
    height: 1.05rem;
    padding: 0 .26rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #c63b3b 70%, var(--border));
    background: color-mix(in srgb, #de4747 86%, var(--card));
    color: #fff;
    font-size: .68rem;
    line-height: 1;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.main-content {
    flex: 1 0 auto;
    padding: 1.25rem 0 2rem;
}

.breadcrumbs {
    margin: 0 0 .75rem;
    padding: .34rem .6rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    display: inline-flex;
    width: fit-content;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: center;
    gap: .36rem;
    font-size: .92rem;
}

.breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
}

.breadcrumbs a:hover {
    color: var(--text);
}

.breadcrumbs__sep {
    color: color-mix(in srgb, var(--muted) 70%, transparent);
}

.breadcrumbs [aria-current="page"] {
    color: var(--text);
    font-weight: 700;
}

.site-footer {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    margin-top: 0;
    padding: .9rem 0 1rem;
    color: var(--muted);
}

.btn,
button,
input,
select,
textarea {
    font: inherit;
}

.btn {
    text-decoration: none;
    border: 1px solid transparent;
    padding: .58rem .92rem;
    border-radius: var(--btn-radius);
    cursor: pointer;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: .4rem;
}

.btn-solid {
    background: var(--primary);
    color: var(--primary-contrast);
}

.btn-soft {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
}

.btn-ghost {
    background: var(--primary);
    color: var(--primary-contrast);
    border-color: var(--primary);
}

.theme-btn {
    border: 1px solid var(--border);
    background: var(--card);
    color: var(--text);
    padding: .5rem .75rem;
    border-radius: var(--btn-radius);
    cursor: pointer;
}

[data-theme-switcher] {
    display: none !important;
}

.theme-icon-btn {
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 1.1rem;
    line-height: 1;
}

.city-widget {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: .08rem .65rem;
    align-items: center;
    padding: .38rem 2.7rem .38rem .62rem;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    min-width: 220px;
    font-weight: 400;
    position: relative;
}

@media (min-width: 981px) and (max-width: 1260px) {
    .header-row {
        grid-template-columns: auto auto;
        grid-template-areas:
            "brand actions"
            "nav nav";
        row-gap: .5rem;
    }

    .brand {
        grid-area: brand;
    }

    .actions {
        grid-area: actions;
        justify-self: end;
    }

    .nav {
        grid-area: nav;
        justify-self: center;
        justify-content: center;
        padding-bottom: .2rem;
    }
}

@media (min-width: 761px) and (max-width: 980px) {
    .header-row {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }

    .nav {
        width: 100%;
        justify-content: center;
        justify-self: center;
    }
}

.city-widget__city {
    grid-column: 1 / -1;
    font-weight: 400;
    line-height: 1.1;
}

.city-widget__date,
.city-widget__time,
.city-widget__weather {
    color: var(--muted);
    font-size: .79rem;
    line-height: 1.2;
    font-weight: 400;
}

.city-widget__date {
    display: inline-block;
    width: 10ch;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.city-widget__time {
    display: inline-block;
    width: 8ch;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.city-widget__weather {
    grid-column: 1 / -1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 1.2em;
}

.city-widget__theme {
    position: absolute;
    top: .35rem;
    right: .35rem;
    width: 1.9rem;
    height: 1.9rem;
    padding: 0;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
}

.city-widget--staff {
    margin-top: .45rem;
    margin-bottom: .75rem;
    min-width: 0;
}

.card {
    background: var(--card);
    border: 1px solid color-mix(in srgb, var(--border) 56%, var(--text) 44%);
    border-radius: var(--radius);
    padding: 1.05rem;
    box-shadow:
        var(--shadow),
        inset 0 0 0 1px color-mix(in srgb, var(--border) 58%, transparent);
    animation: fadeUp .45s ease both;
}

.hero {
    display: grid;
    grid-template-columns: 1.2fr .8fr;
    gap: 1rem;
}

html[data-theme="aurora"] .hero {
    background: linear-gradient(
        140deg,
        color-mix(in srgb, var(--card) 92%, var(--bg2)),
        color-mix(in srgb, var(--accent) 20%, var(--card))
    );
}

html[data-theme="graphite"] .hero {
    background: linear-gradient(
        140deg,
        color-mix(in srgb, var(--card) 92%, var(--bg2)),
        color-mix(in srgb, var(--primary) 16%, var(--card))
    );
}

html[data-theme="warm"] .hero {
    background: linear-gradient(
        140deg,
        color-mix(in srgb, var(--card) 90%, var(--bg2)),
        color-mix(in srgb, var(--accent) 24%, var(--card))
    );
}

.hero.hero-showcase {
    --hero-showcase-height: 520px;
    grid-template-columns: minmax(0, .92fr) minmax(0, 1.08fr);
    align-items: stretch;
    gap: .85rem;
}

.hero-panel {
    display: grid;
    grid-template-rows: auto 1fr;
    gap: .6rem;
    min-height: 0;
    height: 100%;
    min-width: 0;
    overflow: hidden;
    position: relative;
    z-index: 0;
    border: 1.35px solid color-mix(in srgb, var(--border) 68%, var(--text) 32%);
    border-radius: 16px;
    padding: .65rem;
    background: color-mix(in srgb, var(--card) 97%, var(--bg2));
    box-shadow:
        0 10px 24px color-mix(in srgb, var(--text) 12%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--border) 60%, transparent);
}

.hero-panel--promo,
.hero-panel--doctor {
    min-height: var(--hero-showcase-height);
}

.hero-panel > .hero-slider,
.hero-panel > .hero-empty {
    min-height: 0;
    height: 100%;
}

.hero-panel--promo .hero-slider__viewport,
.hero-panel--doctor .hero-slider__viewport {
    min-height: var(--hero-showcase-height);
    height: 100%;
}

/* Keep showcase cards visually equal regardless of uploaded promo image size. */
@media (min-width: 761px) {
    .hero.hero-showcase .hero-panel--promo .hero-slider__viewport,
    .hero.hero-showcase .hero-panel--doctor .hero-slider__viewport {
        height: var(--hero-showcase-height);
        min-height: var(--hero-showcase-height);
    }

    .hero.hero-showcase .hero-panel--promo .hero-slider__track,
    .hero.hero-showcase .hero-panel--promo .hero-slide--promo,
    .hero.hero-showcase .hero-panel--promo .hero-slide__media,
    .hero.hero-showcase .hero-panel--promo .hero-slide__media--placeholder {
        height: var(--hero-showcase-height);
        min-height: var(--hero-showcase-height);
    }
}

.hero-panel__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .6rem;
    min-height: 2.25rem;
    min-width: 0;
}

.hero-panel__head h2 {
    margin: 0;
    font-size: 1.32rem;
    min-width: 0;
}

.hero-panel__head a {
    font-size: .92rem;
}

.hero-slider {
    display: grid;
    gap: .45rem;
    height: 100%;
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.hero-slider__viewport {
    position: relative;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1.4px solid color-mix(in srgb, var(--border) 64%, var(--text) 36%);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    box-shadow:
        inset 0 0 0 1px color-mix(in srgb, var(--text) 8%, transparent),
        0 4px 12px color-mix(in srgb, var(--text) 8%, transparent);
}

.hero-slider__track {
    display: flex;
    width: 100%;
    max-width: 100%;
    transition: transform .34s ease;
    align-items: stretch;
    height: 100%;
    min-width: 0;
    will-change: transform;
}

.hero-slide {
    flex: 0 0 100%;
    min-width: 100%;
    min-height: 0;
    height: 100%;
    overflow: hidden;
}

.hero-slide--promo {
    position: relative;
    display: block;
    min-height: 100%;
    height: 100%;
    text-decoration: none;
}

.hero-slide__media {
    width: 100%;
    height: 100%;
    min-height: 520px;
    object-fit: cover;
    display: block;
}

.hero-slide__media--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: 1.2rem;
    background: color-mix(in srgb, var(--card) 82%, var(--bg2));
}

.hero-slide__overlay {
    position: absolute;
    left: .75rem;
    right: .75rem;
    bottom: .75rem;
    display: grid;
    gap: .25rem;
    padding: .58rem .62rem;
    border-radius: 10px;
    border: 1px solid color-mix(in srgb, var(--border) 80%, transparent);
    background: color-mix(in srgb, var(--bg) 85%, transparent);
    backdrop-filter: blur(4px);
}

.hero-slide__overlay h3,
.hero-slide__overlay p {
    margin: 0;
}

.hero-slide__overlay h3 {
    font-size: 1.04rem;
}

.hero-slide__overlay p {
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.35;
}

.hero-slide--doctor {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: .62rem;
    padding: .7rem;
    min-height: 0;
    height: 100%;
    align-content: start;
    overflow: hidden;
    border: 1.2px solid color-mix(in srgb, var(--border) 60%, var(--text) 40%);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 98%, var(--bg2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 44%, transparent);
}

.hero-slide__doctor-head {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    min-height: 0;
    max-height: none;
    height: 100%;
    align-self: stretch;
    min-width: 0;
    overflow: hidden;
    border: 1.2px solid color-mix(in srgb, var(--border) 62%, var(--text) 38%);
    border-radius: 12px;
    padding: 0;
    background: color-mix(in srgb, var(--card) 98%, var(--bg2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 40%, transparent);
}

.hero-slide__doctor-photo {
    display: block;
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 100%;
    min-height: 100%;
    max-height: none;
    object-fit: cover;
    object-position: center top;
    align-self: stretch;
    justify-self: stretch;
    border-radius: 11px 0 0 11px;
    border: 0;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.hero-slide__doctor-photo--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    background: color-mix(in srgb, var(--card) 82%, var(--bg2));
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 100%;
    min-height: 100%;
    max-height: none;
    border-radius: 11px 0 0 11px;
}

.hero-slide__doctor-meta {
    display: grid;
    gap: .2rem;
    align-content: start;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    padding: .56rem .56rem .56rem .72rem;
    max-height: 100%;
}

.hero-slide__doctor-meta h3,
.hero-slide__doctor-meta p {
    margin: 0;
}

.hero-slide__doctor-meta h3 {
    font-size: 1.02rem;
    color: #000;
}

.hero-slide__doctor-meta p {
    color: #1f2937;
    font-size: .9rem;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-slide__doctor-meta p strong {
    color: #1f2937;
}

.hero-slide__doctor-meta p.hero-slide__doctor-availability,
.hero-slide__doctor-meta p.hero-slide__doctor-availability--free {
    color: #c62828;
}

.hero-slide__doctor-meta p.hero-slide__doctor-availability--busy {
    color: #000;
}

.hero-slide__doctor-meta p.hero-slide__doctor-reception-note {
    color: #3b82f6;
}

.hero-slide__doctor-availability {
    margin-top: .08rem;
    font-weight: 700;
    color: #c62828;
}

.hero-slide__doctor-availability--free {
    color: #c62828;
}

.hero-slide__doctor-availability--busy {
    color: #000;
}

.hero-slide__doctor-schedule {
    display: grid;
    gap: .24rem;
    margin-top: .22rem;
    min-width: 0;
}

.hero-slide__doctor-schedule-title {
    margin: 0;
    font-size: .82rem;
    color: #000;
}

.hero-slide__doctor-slots {
    display: flex;
    flex-wrap: wrap;
    gap: .24rem;
    max-width: 100%;
}

.hero-slide__doctor-services-title {
    margin: .32rem 0 .12rem;
    font-size: .82rem;
    font-weight: 700;
    color: #1f2937;
}

.hero-slide__doctor-services {
    display: flex;
    flex-wrap: wrap;
    gap: .24rem;
    margin-top: 0;
    max-width: 100%;
}

.hero-slide__doctor-service {
    display: inline-flex;
    align-items: center;
    min-height: 1.38rem;
    max-width: 100%;
    padding: .08rem .4rem;
    border-radius: var(--btn-radius);
    border: 1px solid #c3ccd7;
    background: #eef2f6;
    color: #111;
    font-size: .74rem;
    font-weight: 700;
    line-height: 1.16;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-slide__doctor-service--link {
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.hero-slide__doctor-service--link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
}

.hero-slide__doctor-service--link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 34%, transparent);
}

.hero-slide__doctor-service--muted {
    border-color: #b9c3ce;
    background: #e3e9f0;
    color: #2b3642;
}

.hero-panel--doctor .hero-panel__head h2 {
    font-weight: 700;
    color: var(--text);
}

.hero-panel--doctor .hero-panel__head a {
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--text);
}

.hero-panel--doctor .hero-slide__doctor-meta h3 {
    font-size: 1.08rem;
    line-height: 1.28;
    font-weight: 700;
}

.hero-panel--doctor .hero-slide__doctor-meta p {
    font-size: .98rem;
    line-height: 1.32;
    font-weight: 500;
}

.hero-panel--doctor .hero-slide__doctor-meta p strong,
.hero-panel--doctor .hero-slide__doctor-schedule-title {
    font-weight: 600;
}

@media (min-width: 981px) {
    .hero-slide__doctor-service {
        font-size: .84rem;
        line-height: 1.2;
        padding: .14rem .52rem;
    }
}

.hero-slide__doctor-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    padding: .12rem .45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    font-size: .76rem;
    font-weight: 700;
}

.hero-slide__doctor-slot--link {
    cursor: pointer;
    transition: transform .14s ease, border-color .14s ease, box-shadow .14s ease;
}

.hero-slide__doctor-slot--link:hover {
    transform: translateY(-1px);
    border-color: color-mix(in srgb, var(--accent) 58%, var(--border));
}

.hero-slide__doctor-slot--link:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 34%, transparent);
}

.hero-slide__doctor-slot--free {
    background: color-mix(in srgb, #1ea560 20%, var(--card));
    border-color: color-mix(in srgb, #1ea560 60%, var(--border));
    color: color-mix(in srgb, #0f723f 86%, var(--text));
}

.hero-slide__doctor-slot--occupied {
    background: color-mix(in srgb, #d35353 14%, var(--card));
    border-color: color-mix(in srgb, #d35353 52%, var(--border));
    color: color-mix(in srgb, #8d2626 86%, var(--text));
}

.hero-slide__doctor-slot--frozen {
    background: color-mix(in srgb, #a0a8b8 20%, var(--card));
    border-color: color-mix(in srgb, #a0a8b8 54%, var(--border));
    color: color-mix(in srgb, #4e5768 86%, var(--text));
    text-decoration: line-through;
}

.hero-slide__doctor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin-top: auto;
    align-self: end;
}

@media (max-width: 980px) {
    .hero-slide__doctor-head {
        grid-template-columns: 265px minmax(0, 1fr);
        min-height: 0;
        max-height: none;
        height: 100%;
    }

    .hero-slide__doctor-photo {
        width: 265px;
        min-width: 265px;
        max-width: 265px;
        height: 100%;
        min-height: 100%;
        max-height: none;
    }

    .hero-slide__doctor-photo--placeholder {
        width: 265px;
        min-width: 265px;
        max-width: 265px;
        height: 100%;
        min-height: 100%;
        max-height: none;
    }

}

@media (max-width: 640px) {
    .hero-slide__doctor-head {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        max-height: none;
        height: auto;
    }

    .hero-slide__doctor-photo {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 220px;
        max-height: none;
        aspect-ratio: 4 / 3;
        object-fit: contain;
        object-position: center;
        border-radius: 10px;
    }

    .hero-slide__doctor-photo--placeholder {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 220px;
        max-height: none;
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 10px;
    }

    .hero-slide__doctor-meta {
        min-height: 0;
        max-height: none;
    }
}

.hero-slide--review {
    display: grid;
    grid-template-rows: auto auto 1fr auto;
    gap: .35rem;
    padding: .7rem;
    align-content: start;
}

.hero-slide--review-standalone {
    flex: none;
    grid-template-rows: auto auto auto auto;
    height: auto;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
}

.review-doctor-head {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    align-items: center;
    gap: .65rem;
    min-height: 96px;
    min-width: 0;
    overflow: hidden;
}

.review-doctor-photo,
.review-card__doctor-photo {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    margin: 0;
    border-radius: 12px;
    border: 1px solid var(--border);
    object-fit: contain;
    object-position: center;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.review-doctor-photo--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .75rem;
}

.review-doctor-meta {
    display: grid;
    gap: .2rem;
    align-content: start;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.review-doctor-meta h3,
.review-doctor-meta p {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-slide--review h3,
.hero-slide--review p,
.hero-slide--review small {
    margin: 0;
}

.hero-slide--review p,
.hero-slide--review small {
    color: var(--muted);
}

.hero-slider--reviews .hero-slide--review {
    min-height: 240px;
    height: 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding-bottom: 1.4rem;
    overflow: hidden;
}

.hero-slider--reviews .hero-slide--review > p,
.hero-slider--reviews .hero-slide--review > small {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.hero-slider--reviews .hero-slide--review > p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hero-slider--reviews .hero-slider__arrow {
    display: none;
}

.hero-slider--reviews .hero-slider__dots {
    bottom: .45rem;
}

.hero-slider__controls {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.hero-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--primary) 20%, var(--card));
    color: var(--text);
    cursor: pointer;
    pointer-events: auto;
    opacity: 0;
    transition: opacity .22s ease, box-shadow .22s ease, background-color .22s ease;
}

.hero-slider:hover .hero-slider__arrow,
.hero-slider:focus-within .hero-slider__arrow {
    opacity: 1;
}

.hero-slider__arrow:hover,
.hero-slider__arrow:focus-visible {
    background: color-mix(in srgb, var(--primary) 34%, var(--card));
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 35%, transparent);
    outline: 0;
}

.hero-slider__arrow[data-hero-slider-prev] {
    left: .5rem;
}

.hero-slider__arrow[data-hero-slider-next] {
    right: .5rem;
}

.hero-slider__dots {
    display: flex;
    gap: .28rem;
    align-items: center;
    position: absolute;
    left: 50%;
    bottom: .5rem;
    transform: translateX(-50%);
    pointer-events: auto;
}

@media (hover: none) {
    .hero-slider__arrow {
        opacity: 1;
    }
}

.hero-slider__dot {
    width: .5rem;
    height: .5rem;
    border-radius: 999px;
    border: 0;
    background: color-mix(in srgb, var(--border) 80%, var(--muted));
    cursor: pointer;
}

.hero-slider__dot.is-active {
    background: var(--primary);
}

.hero-empty {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem;
    min-height: var(--hero-showcase-height);
    display: grid;
    align-content: start;
    color: var(--text);
    background: color-mix(in srgb, var(--card) 97%, var(--bg2));
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 45%, transparent);
}

.callback-reviews-card {
    padding: .85rem;
}

.callback-reviews-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: .8rem;
}

.callback-reviews-grid__callback,
.callback-reviews-grid__reviews {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .75rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    min-width: 0;
}

.callback-reviews-grid__callback .checkbox {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .55rem;
}

.callback-reviews-grid__callback .checkbox input {
    width: auto;
    margin-top: .14rem;
}

.hero-slider--reviews {
    min-width: 0;
    max-width: 100%;
    height: auto;
    align-self: start;
}

.hero-slider--reviews .hero-slider__viewport {
    overflow: hidden;
    height: 240px;
    min-height: 240px;
}

.hero-slider--reviews .hero-slider__track {
    display: flex;
    flex-wrap: nowrap !important;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 0 !important;
    transform: translateX(0%) !important;
}

.hero-slider--reviews .hero-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
}

.hero-slider--reviews .hero-slide {
    display: none;
}

.hero-slider--reviews .hero-slide:first-child,
.hero-slider--reviews .hero-slide.is-active {
    display: grid;
}

.callback-reviews-grid__callback h2,
.callback-reviews-grid__reviews h2 {
    margin: 0;
}

.callback-form-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .68rem;
}

.callback-form-grid--compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.section-head--compact {
    margin-top: 0;
}

.legal-warning p {
    margin: .35rem 0;
}

.row {
    display: flex;
    flex-wrap: wrap;
    gap: .65rem;
    align-items: center;
}

.order-composition-head {
    justify-content: flex-start;
    gap: 10ch;
}

.stack {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.big-number {
    font-size: 1.5rem;
    font-weight: 700;
}

.section-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: .7rem;
    margin-top: 1.2rem;
    margin-bottom: .8rem;
}

.section-head--staff-search {
    justify-content: flex-start;
    align-items: flex-start;
    gap: .55rem;
}

.section-head--staff-search > h1 {
    flex: 1 0 100%;
}

.section-head--staff-search > :is(.inline-form, .row) {
    flex: 0 1 auto;
    justify-content: flex-start;
}

tr.row-openable td {
    cursor: pointer;
}

tr.row-openable:hover td {
    background: color-mix(in srgb, var(--primary) 7%, var(--card));
}

tr.row-openable--new-order td {
    background: color-mix(in srgb, #2f9a58 18%, var(--card));
}

tr.row-openable--new-order:hover td {
    background: color-mix(in srgb, #2f9a58 26%, var(--card));
}

.staff-table-actions {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    flex-wrap: wrap;
}

.staff-copy-list {
    display: grid;
    gap: .28rem;
}

.staff-copy-field {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: .35rem;
}

.staff-copy-field__actions {
    display: inline-flex;
    align-items: center;
    gap: .26rem;
}

.staff-copy-field__label {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
}

.staff-copy-field__value {
    min-width: 0;
    overflow-wrap: anywhere;
}

.staff-copy-field__input {
    min-width: 0;
}

.cabinet-inline-input[readonly] {
    border-color: color-mix(in srgb, var(--border) 88%, transparent);
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
    color: var(--text);
}

.cabinet-passport-hint {
    margin-top: 0;
    margin-bottom: .35rem;
}

.staff-copy-list small {
    color: var(--muted);
}

.staff-copy-field .btn-icon-copy {
    width: 1.9rem;
    height: 1.9rem;
    min-width: 1.9rem;
    border-radius: 8px;
}

.btn-icon-copy {
    position: relative;
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    color: var(--text);
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, transform .12s ease;
}

.btn-icon-copy::before,
.btn-icon-copy::after {
    content: "";
    position: absolute;
    border: 1.6px solid color-mix(in srgb, var(--text) 82%, var(--primary) 18%);
    border-radius: 3px;
}

.btn-icon-copy::before {
    width: .72rem;
    height: .88rem;
    top: .56rem;
    left: .82rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
}

.btn-icon-copy::after {
    width: .72rem;
    height: .88rem;
    top: .72rem;
    left: .64rem;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.btn-icon-copy:hover {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

.btn-icon-copy:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 72%, transparent);
    outline-offset: 1px;
}

.btn-icon-copy:active {
    transform: scale(.97);
}

.btn-icon-copy.is-copied {
    border-color: color-mix(in srgb, #2f9a58 58%, var(--border));
    background: color-mix(in srgb, #2f9a58 16%, var(--card));
}

.btn-icon-copy.is-copied::before,
.btn-icon-copy.is-copied::after {
    border-color: color-mix(in srgb, #2f9a58 74%, var(--text) 26%);
}

.btn-icon-edit {
    width: 2.2rem;
    height: 2.2rem;
    min-width: 2.2rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    color: var(--text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: border-color .16s ease, background-color .16s ease, transform .12s ease;
}

.btn-icon-edit::before {
    content: "✎";
    font-size: .95rem;
    line-height: 1;
}

.btn-icon-edit:hover {
    border-color: color-mix(in srgb, var(--primary) 55%, var(--border));
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
}

.btn-icon-edit:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 72%, transparent);
    outline-offset: 1px;
}

.btn-icon-edit:active {
    transform: scale(.97);
}

.btn-icon-edit.is-active {
    border-color: color-mix(in srgb, #2f9a58 58%, var(--border));
    background: color-mix(in srgb, #2f9a58 16%, var(--card));
}

.staff-search-form {
    width: min(920px, 100%);
    flex-wrap: wrap;
}

.staff-search-form input[type="text"],
.staff-search-form input[type="search"] {
    flex: 1 1 420px;
    min-width: 280px;
}

.staff-search-form select {
    width: auto;
    min-width: 150px;
    flex: 0 0 auto;
}

.staff-search-row {
    align-items: center;
    width: min(1180px, 100%);
}

@media (max-width: 1180px) {
    .hero.hero-showcase {
        --hero-showcase-height: 440px;
    }

    .hero.hero-showcase {
        grid-template-columns: 1fr;
    }

    .hero-panel--promo,
    .hero-panel--doctor {
        min-height: var(--hero-showcase-height);
    }

    .hero-panel--promo .hero-slider__viewport,
    .hero-panel--doctor .hero-slider__viewport {
        min-height: var(--hero-showcase-height);
    }

    .hero.hero-showcase .hero-slide--promo {
        min-height: 100%;
    }

    .hero.hero-showcase .hero-slide__media {
        min-height: 440px;
    }

    .hero.hero-showcase .hero-slide--doctor {
        min-height: 100%;
    }

    .callback-reviews-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .hero.hero-showcase {
        --hero-showcase-height: 300px;
    }

    .hero-panel--promo,
    .hero-panel--doctor {
        min-height: var(--hero-showcase-height);
    }

    .hero-panel--promo .hero-slider__viewport,
    .hero-panel--doctor .hero-slider__viewport {
        min-height: var(--hero-showcase-height);
    }

    .hero.hero-showcase .hero-slide--promo {
        min-height: 100%;
    }

    .hero.hero-showcase .hero-slide__media {
        min-height: 300px;
    }

    .hero.hero-showcase .hero-slide--doctor {
        min-height: 100%;
    }

    .hero-panel--doctor .hero-slider__controls {
        position: static;
        inset: auto;
        z-index: auto;
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        margin-top: .42rem;
    }

    .hero-panel--doctor .hero-slider__arrow {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        width: 2rem;
        height: 2rem;
        opacity: 1;
        flex: 0 0 auto;
    }

    .hero-panel--doctor .hero-slider__dots {
        position: static;
        left: auto;
        bottom: auto;
        transform: none;
        margin: 0 .12rem;
    }
}

@media (max-width: 900px) {
    .staff-search-form {
        width: 100%;
    }

    .staff-search-form input[type="text"],
    .staff-search-form input[type="search"],
    .staff-search-form select,
    .staff-search-form .btn,
    .staff-search-form a.btn {
        flex: 1 1 100%;
        width: 100%;
    }
}

@media (max-width: 980px) {
    .hero-panel--doctor .hero-slider__controls {
        position: static;
        inset: auto;
        z-index: auto;
        pointer-events: auto;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: .5rem;
        margin-top: .42rem;
    }

    .hero-panel--doctor .hero-slider__arrow {
        position: static;
        top: auto;
        left: auto;
        right: auto;
        transform: none;
        width: 2rem;
        height: 2rem;
        opacity: 1;
        flex: 0 0 auto;
    }

    .hero-panel--doctor .hero-slider__dots {
        position: static;
        left: auto;
        bottom: auto;
        transform: none;
        margin: 0 .12rem;
    }
}

@media (max-width: 980px) {
    .actions > .appointment-header-btn {
        grid-column: span 2;
    }

    .cookie-banner {
        left: .5rem;
        right: .5rem;
        bottom: .5rem;
        padding: .5rem .55rem;
        gap: .45rem;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__accept {
        width: 100%;
    }
}

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .85rem;
    align-items: stretch;
}

.cards-grid > .card {
    height: 100%;
}

.order-show-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
}

.order-show-overview__card {
    height: 100%;
    min-height: 260px;
}

@media (max-width: 980px) {
    .order-show-overview {
        grid-template-columns: 1fr;
    }

    .order-show-overview__card {
        min-height: 0;
    }
}

.badge {
    display: inline-block;
    border-radius: 999px;
    padding: .22rem .55rem;
    background: color-mix(in srgb, var(--accent) 34%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 44%, var(--border));
    color: var(--text);
    font-size: .8rem;
    margin-bottom: .35rem;
}

.card-media {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: .55rem;
    background: color-mix(in srgb, var(--card) 86%, var(--bg2));
}

.news-media {
    width: 100%;
    max-height: 460px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 86%, var(--bg2));
}

.news-media-preview {
    display: grid;
    gap: .45rem;
}

.news-admin-list {
    gap: .75rem;
}

.news-edit-item {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .55rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.news-edit-item > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .2rem;
}

.news-edit-item > summary::-webkit-details-marker {
    display: none;
}

.news-edit-title {
    display: grid;
    gap: .2rem;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    color: var(--muted);
    font-size: .9rem;
    letter-spacing: .03em;
}

.inline,
.inline-form {
    display: inline-flex;
    gap: .55rem;
    align-items: center;
}

.page-search-form {
    width: min(840px, 100%);
    margin: 0 auto .9rem;
    justify-content: center;
    flex-wrap: wrap;
}

.content-flow {
    display: grid;
    gap: 1rem;
    align-content: start;
}

.content-flow > .mt-16 {
    margin-top: 0;
}

.content-flow > .page-search-form {
    display: flex;
    margin: 0 auto;
}

.section-head > .page-search-form {
    flex: 1 0 100%;
}

.page-search-form input[type="text"] {
    flex: 1 1 520px;
    min-width: 320px;
}

.page-search-form .btn {
    white-space: nowrap;
}

.auth-wrap {
    display: grid;
    place-items: center;
    min-height: 70vh;
}

.auth-card {
    width: min(580px, 100%);
}

input,
select,
textarea {
    width: 100%;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
    color: var(--text);
    border: 1px solid color-mix(in srgb, var(--border) 52%, var(--text) 48%);
    padding: .58rem .7rem;
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--border) 55%, transparent);
    transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: color-mix(in srgb, var(--primary) 56%, var(--text) 44%);
    box-shadow:
        0 0 0 2px color-mix(in srgb, var(--primary) 20%, transparent),
        inset 0 0 0 1px color-mix(in srgb, var(--primary) 44%, var(--border));
    background: color-mix(in srgb, var(--card) 98%, #fff 2%);
}

textarea {
    resize: vertical;
    max-width: 100%;
}

input::placeholder,
textarea::placeholder {
    color: color-mix(in srgb, var(--text) 60%, transparent);
    opacity: 1;
}

label {
    display: grid;
    gap: .35rem;
    color: color-mix(in srgb, var(--text) 92%, transparent);
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .7rem;
}

legend {
    padding: 0 .2rem;
}

.checkbox {
    display: flex;
    align-items: center;
    gap: .55rem;
}

.checkbox input {
    width: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .94rem;
    table-layout: fixed;
}

th,
td {
    text-align: left;
    padding: .55rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

th {
    font-weight: 700;
}


.th-unit {
    display: block;
    margin-top: .12rem;
    font-size: .86em;
    line-height: 1.05;
}

td form,
td details,
td .btn,
td .inline {
    max-width: 100%;
}

td details summary {
    cursor: pointer;
    overflow-wrap: anywhere;
}

td form {
    margin: 0;
}

td .inline,
td .inline-form {
    flex-wrap: wrap;
}

.card {
    overflow: hidden;
}

.staff-main .card {
    overflow-x: auto;
}

.staff-main table {
    min-width: 100%;
}

.list {
    margin: 0;
    padding-left: 1.2rem;
}

.list li {
    margin-bottom: .45rem;
}

.appointment-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: .85rem;
    margin-top: .85rem;
    align-items: stretch;
}

.appointment-layout > .card {
    min-width: 0;
    align-self: stretch;
    height: 100%;
    animation: none;
    transform: none;
    opacity: 1;
}

.appointment-filters {
    display: grid;
    gap: .7rem;
}

.appointment-filters__head {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .6rem;
    align-items: start;
}

.appointment-filters .w-full {
    min-width: 0;
    align-content: start;
}

.appointment-filters .w-full > .muted {
    display: block;
    min-height: 1.2rem;
}

.appointment-filters .btn {
    justify-self: stretch;
}

#appointment-doctor-select,
#appointment-doctor-select option {
    font-weight: 700;
    color: #1f2937;
}

/* Rule 29: uniform vertical spacing between neighboring blocks/cards */
.gap-29 + .gap-29,
.appointment-gap-29 + .appointment-gap-29 {
    margin-top: 1rem;
}

.appointment-main-feedback {
    margin: .3rem 0 0;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .48rem .62rem;
    font-weight: 600;
    line-height: 1.35;
}

.appointment-main-feedback--info {
    border-color: color-mix(in srgb, var(--primary) 46%, var(--border));
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
    color: color-mix(in srgb, var(--text) 84%, var(--primary));
}

.appointment-main-feedback--success {
    border-color: color-mix(in srgb, #1f8d4f 66%, var(--border));
    background: color-mix(in srgb, #23a65d 16%, var(--card));
    color: color-mix(in srgb, #195c36 76%, var(--text));
}

.appointment-main-feedback--error {
    border-color: color-mix(in srgb, #c63b3b 70%, var(--border));
    background: color-mix(in srgb, #de4747 16%, var(--card));
    color: color-mix(in srgb, #7a1d1d 72%, var(--text));
}

.appointment-howto {
    margin-top: 0;
}

.appointment-howto__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
}

.appointment-howto__summary::-webkit-details-marker {
    display: none;
}

.appointment-howto__summary h2 {
    margin: 0;
}

.appointment-howto__content {
    margin-top: .6rem;
}

.appointment-howto__content p {
    margin: 0;
}

.appointment-date-picker {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .58rem .62rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    display: grid;
    gap: .48rem;
}

.appointment-date-picker__title {
    font-weight: 700;
}

.appointment-date-picker--inline {
    margin-top: .2rem;
}

.appointment-date-grid--links {
    max-height: none;
}

#appointment-slots[aria-busy="true"] {
    opacity: .72;
    pointer-events: none;
}

.appointment-date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
    gap: .4rem;
    max-height: 195px;
    overflow: auto;
    padding-right: .08rem;
}

.appointment-date-chip {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .45rem .3rem;
    min-height: 3.4rem;
    text-align: center;
    cursor: pointer;
    display: grid;
    gap: .06rem;
    justify-items: center;
    align-content: center;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.appointment-date-chip:hover {
    transform: translateY(-1px);
}

.appointment-date-chip input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.appointment-date-chip.is-active {
    border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
    background: color-mix(in srgb, var(--primary) 18%, var(--card));
}

.appointment-date-chip--link {
    text-decoration: none;
    color: inherit;
}

.appointment-date-chip__day {
    font-weight: 700;
    line-height: 1.1;
}

.appointment-date-chip__weekday {
    color: var(--muted);
    font-size: .82rem;
    line-height: 1;
}

.appointment-slot-legend {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.appointment-slot-legend__item {
    border-radius: 999px;
    padding: .16rem .55rem;
    border: 1px solid var(--border);
    font-size: .82rem;
    font-weight: 600;
}

.appointment-slot-legend__item--free {
    border-color: color-mix(in srgb, #1f8d4f 70%, var(--border));
    background: color-mix(in srgb, #23a65d 28%, var(--card));
}

.appointment-slot-legend__item--occupied {
    border-color: color-mix(in srgb, #c63b3b 72%, var(--border));
    background: color-mix(in srgb, #de4747 26%, var(--card));
}

.appointment-slot-legend__item--frozen {
    border-color: color-mix(in srgb, #6f7682 66%, var(--border));
    background: color-mix(in srgb, #8b93a0 26%, var(--card));
}

.appointment-slot-legend--compact {
    margin-top: -.16rem;
    gap: .3rem;
}

.appointment-slots-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .45rem;
    max-height: 320px;
    overflow: auto;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .5rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.appointment-slot-item {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .42rem .58rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}

.appointment-slot-item input[type="radio"] {
    width: auto;
    margin: 0;
}

.appointment-slot-item__content {
    display: grid;
    gap: .08rem;
    min-width: 0;
}

.appointment-slot-item__time {
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.appointment-slot-item__status {
    font-size: .84rem;
    color: var(--muted);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.appointment-slot-item--free {
    border-color: color-mix(in srgb, #1f8d4f 74%, var(--border));
    background: color-mix(in srgb, #23a65d 24%, var(--card));
}

.appointment-slot-item--occupied {
    border-color: color-mix(in srgb, #c63b3b 74%, var(--border));
    background: color-mix(in srgb, #de4747 24%, var(--card));
}

.appointment-slot-item--frozen {
    border-style: dashed;
    border-color: color-mix(in srgb, #6f7682 74%, var(--border));
    background: color-mix(in srgb, #8b93a0 24%, var(--card));
}

.appointment-slot-item.is-disabled {
    opacity: .9;
}

.appointment-slot-item__cross {
    position: absolute;
    inset: 5px;
    pointer-events: none;
}

.appointment-slot-item__cross::before,
.appointment-slot-item__cross::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 1px);
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, #8a8f99 82%, transparent);
}

.appointment-slot-item__cross::before {
    transform: rotate(18deg);
}

.appointment-slot-item__cross::after {
    transform: rotate(-18deg);
}

.appointment-draft-card p {
    margin: .22rem 0;
}

.order-appointment-box {
    margin-top: .7rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .62rem .72rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.order-appointment-box h3 {
    margin: 0 0 .35rem;
}

.order-appointment-box p {
    margin: .22rem 0;
}

.order-datetime-alert {
    display: inline-block;
    margin-left: .24rem;
    padding: .08rem .4rem;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--danger) 52%, var(--border));
    background: color-mix(in srgb, var(--danger) 12%, var(--card));
    color: color-mix(in srgb, var(--danger) 88%, #7f1515);
    font-weight: 800;
}

.order-queue-alert {
    display: inline-block;
    margin-left: .24rem;
    padding: .08rem .4rem;
    border-radius: 8px;
    border: 1px solid color-mix(in srgb, var(--danger) 52%, var(--border));
    background: color-mix(in srgb, var(--danger) 12%, var(--card));
    color: color-mix(in srgb, var(--danger) 88%, #7f1515);
    font-weight: 800;
}

.preparation-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.doctor-public-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: .9rem;
}

.appointment-specialty-section {
    display: grid;
    gap: .7rem;
}

.appointment-specialty-title {
    margin: 0;
}

.appointment-specialty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .75rem;
    align-items: stretch;
}

.appointment-doctor-card {
    display: grid;
    gap: .65rem;
    align-items: start;
    min-width: 0;
}

.appointment-doctor-card__summary {
    display: grid;
    gap: .65rem;
    min-width: 0;
}

.appointment-doctor-card__head {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: .55rem;
    align-items: center;
}

.appointment-doctor-card__photo {
    width: 72px;
    height: 72px;
    display: block;
    border: 1px solid var(--border);
    border-radius: 12px;
    object-fit: contain;
    object-position: center;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.appointment-doctor-card__photo--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .78rem;
}

.appointment-doctor-card__meta {
    display: grid;
    gap: .16rem;
}

.appointment-doctor-card__meta h3,
.appointment-doctor-card__meta p {
    margin: 0;
}

.appointment-doctor-card__today {
    display: grid;
    gap: .35rem;
}

.appointment-doctor-card__calendar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .45rem;
}

.appointment-doctor-card__calendar > .btn {
    justify-self: stretch;
    width: 100%;
}

.appointment-specialty-grid > .appointment-doctor-card--calendar-open {
    grid-column: 1 / -1;
    grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
    gap: .75rem;
}

.appointment-doctor-card--calendar-open > .appointment-doctor-card__summary {
    grid-column: 1;
}

.appointment-doctor-card--calendar-open > .appointment-calendar-panel {
    grid-column: 2;
    width: 100%;
    align-self: start;
}

@media (max-width: 980px) {
    .appointment-specialty-grid > .appointment-doctor-card--calendar-open {
        grid-column: auto;
        grid-template-columns: minmax(0, 1fr);
    }

    .appointment-doctor-card--calendar-open > .appointment-doctor-card__summary,
    .appointment-doctor-card--calendar-open > .appointment-calendar-panel {
        grid-column: 1;
    }
}

.appointment-doctor-profile__head {
    display: grid;
    grid-template-columns: clamp(190px, 20vw, 270px) minmax(0, 1fr);
    gap: .95rem;
    align-items: start;
}

.appointment-doctor-profile__photo {
    display: block;
    width: 100%;
    height: auto;
    justify-self: start;
    border-radius: 14px;
    border: 1px solid var(--border);
    object-fit: contain;
    object-position: center center;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.appointment-doctor-profile__photo--placeholder {
    display: grid;
    place-items: center;
    min-height: 300px;
    color: var(--muted);
    font-size: .78rem;
}

.appointment-doctor-profile__meta {
    min-width: 0;
}

.appointment-doctor-profile__meta h2 {
    margin-top: 0;
    font-size: clamp(1.18rem, 1.35vw, 1.46rem);
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.appointment-doctor-profile__extra {
    margin-top: .72rem;
    display: grid;
    gap: .56rem;
}

.appointment-doctor-profile__bio {
    margin: 0;
    line-height: 1.45;
}

.appointment-doctor-profile__services {
    margin: 0;
}

.appointment-doctor-profile__services-empty {
    margin: .42rem 0 0;
}

.appointment-today-grid {
    grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
}

.appointment-calendar-panel {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .58rem .62rem;
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
    display: grid;
    gap: .55rem;
}

.appointment-calendar-date-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(88px, 1fr));
    gap: .34rem;
}

.appointment-calendar-date-nav {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: .34rem;
    align-items: stretch;
}

.appointment-calendar-date-nav .appointment-calendar-date-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.appointment-calendar-date-nav__arrow {
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
    color: var(--text);
    border-radius: 10px;
    min-width: 2.2rem;
    padding: 0 .35rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.appointment-calendar-date-nav__arrow:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.appointment-calendar-date-chip {
    border: 1px solid color-mix(in srgb, #1ea560 52%, var(--border));
    background: color-mix(in srgb, #1ea560 14%, var(--card));
    color: color-mix(in srgb, #0f723f 86%, var(--text));
    border-radius: 10px;
    padding: .36rem .45rem;
    display: grid;
    gap: .1rem;
    justify-items: start;
    cursor: pointer;
    font-weight: 700;
}

.appointment-calendar-date-chip.is-active {
    background: color-mix(in srgb, #1ea560 26%, var(--card));
    box-shadow: 0 0 0 2px color-mix(in srgb, #1ea560 28%, transparent);
}

.appointment-calendar-date-chip__day {
    font-size: .88rem;
    line-height: 1.1;
}

.appointment-calendar-date-chip__weekday {
    font-size: .74rem;
    line-height: 1.1;
}

.appointment-calendar-panel[hidden] {
    display: none !important;
}

.appointment-calendar-backdrop[hidden] {
    display: none !important;
}

.appointment-calendar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(7, 14, 28, .42);
    backdrop-filter: blur(2px);
}

.appointment-calendar-panel[data-popup-open="1"] {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: min(720px, calc(100vw - 1.2rem));
    max-height: calc(100vh - 2rem);
    margin: 0 !important;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    z-index: 1210;
}

.appointment-calendar-panel__dialog {
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--card);
    box-shadow: 0 24px 42px color-mix(in srgb, var(--ink) 18%, transparent);
    display: grid;
    gap: .55rem;
    padding: .68rem;
    max-height: calc(100vh - 2.2rem);
    overflow: auto;
}

.appointment-calendar-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .45rem;
}

.appointment-calendar-panel__head h4 {
    margin: 0;
    font-size: .98rem;
}

.appointment-calendar-panel__close {
    min-width: 2.15rem;
    min-height: 2.15rem;
    line-height: 1;
    font-size: 1.2rem;
    padding: 0;
}

.appointment-calendar-panel__message {
    margin: 0;
    padding: .42rem .56rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    font-weight: 600;
    font-size: .92rem;
}

.appointment-calendar-panel__message.is-info {
    background: color-mix(in srgb, var(--accent) 10%, var(--card));
    border-color: color-mix(in srgb, var(--accent) 36%, var(--border));
    color: color-mix(in srgb, var(--text) 84%, var(--accent));
}

.appointment-calendar-panel__message.is-success {
    background: color-mix(in srgb, var(--ok) 13%, var(--card));
    border-color: color-mix(in srgb, var(--ok) 44%, var(--border));
    color: color-mix(in srgb, var(--ok) 85%, var(--text));
}

.appointment-calendar-panel__message.is-error {
    background: color-mix(in srgb, var(--danger) 11%, var(--card));
    border-color: color-mix(in srgb, var(--danger) 44%, var(--border));
    color: color-mix(in srgb, var(--danger) 88%, #7f1515);
}

.appointment-calendar-pane {
    display: none;
}

.appointment-calendar-pane.is-active {
    display: block;
}

.appointment-calendar-pane__label {
    margin: 0 0 .38rem;
    font-weight: 700;
    color: var(--muted);
}

input[data-calendar-date-input] {
    width: 16ch;
    min-width: 14ch;
    max-width: 100%;
    justify-self: start;
}

.appointment-calendar-grid {
    grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
}

.appointment-calendar-slot-btn {
    appearance: none;
    -webkit-appearance: none;
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 2.7rem;
    width: 100%;
    padding: .3rem .45rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    color: var(--text);
    display: grid;
    gap: .02rem;
    text-align: left;
    cursor: pointer;
}

.appointment-calendar-slot-btn small {
    font-size: .76rem;
    color: color-mix(in srgb, var(--text) 80%, transparent);
}

.appointment-calendar-slot-btn--free {
    border-color: color-mix(in srgb, #1f8d4f 74%, var(--border));
    background: color-mix(in srgb, #23a65d 24%, var(--card));
}

.appointment-calendar-slot-btn--occupied {
    border-color: color-mix(in srgb, #c63b3b 74%, var(--border));
    background: color-mix(in srgb, #de4747 24%, var(--card));
}

.appointment-calendar-slot-btn--frozen {
    border-style: dashed;
    border-color: color-mix(in srgb, #6f7682 74%, var(--border));
    background: color-mix(in srgb, #8b93a0 24%, var(--card));
}

.appointment-calendar-slot-btn.is-active {
    box-shadow: 0 0 0 2px color-mix(in srgb, #1f8d4f 28%, transparent);
}

.appointment-calendar-slot-btn--occupied.is-active {
    box-shadow: 0 0 0 2px color-mix(in srgb, #c63b3b 30%, transparent);
}

.appointment-calendar-slot-btn--frozen.is-active {
    box-shadow: 0 0 0 2px color-mix(in srgb, #6f7682 30%, transparent);
}

.appointment-calendar-slot-btn:disabled {
    cursor: not-allowed;
}

.appointment-calendar-slot-btn__cross {
    position: absolute;
    inset: 4px;
    pointer-events: none;
}

.appointment-calendar-slot-btn__cross::before,
.appointment-calendar-slot-btn__cross::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 1px);
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, #6f7682 88%, transparent);
}

.appointment-calendar-slot-btn__cross::before {
    transform: rotate(16deg);
}

.appointment-calendar-slot-btn__cross::after {
    transform: rotate(-16deg);
}

#appointment-slots {
    scroll-margin-top: 7.4rem;
}

#appointment-doctor-info {
    scroll-margin-top: 7.4rem;
}

@media (max-width: 700px) {
    .appointment-calendar-panel[data-popup-open="1"] {
        width: calc(100vw - .8rem);
        max-height: calc(100vh - 1rem);
    }

    .appointment-calendar-panel__dialog {
        max-height: calc(100vh - 1.4rem);
        padding: .58rem;
    }
}

.doctor-card-public {
    display: grid;
    gap: .75rem;
    min-width: 0;
    overflow: hidden;
}

.doctor-card-public__top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: .58rem;
    align-items: start;
    min-width: 0;
}

.doctor-card-public__photo-wrap {
    width: 250px;
    min-width: 250px;
    height: 340px;
    min-height: 340px;
    max-height: 340px;
    padding: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    background: color-mix(in srgb, var(--card) 86%, var(--bg2));
    display: grid;
    place-items: stretch;
    justify-self: start;
}

.doctor-card-public__photo {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 0;
    border: 0;
    object-fit: cover;
    object-position: center center;
    background: color-mix(in srgb, var(--card) 88%, var(--bg2));
}

.doctor-card-public__photo--placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 100%;
    padding: .6rem;
    border: 1px dashed color-mix(in srgb, var(--border) 66%, var(--text) 34%);
    border-radius: 0;
    font-size: .88rem;
    color: var(--muted);
}

.doctor-card-public__meta {
    display: grid;
    gap: .4rem;
    min-width: 0;
    align-content: start;
}

.doctor-card-public__meta h2 {
    margin: 0 0 .2rem;
    font-size: 1.12rem;
}

.doctor-card-public__meta p {
    margin: 0;
    padding: .45rem .58rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
    overflow-wrap: anywhere;
    word-break: break-word;
    line-height: 1.35;
}

.doctor-card-public__meta p strong {
    color: var(--text);
}

.doctor-card-public__meta p span {
    color: var(--text);
}

.doctor-card-public__bio {
    margin: 0;
    color: var(--text);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    min-width: 0;
}

.doctor-card-public__meta .doctor-card-public__bio {
    white-space: normal;
}

.doctor-card-public__meta .doctor-card-public__bio span {
    white-space: pre-line;
}

.doctor-card-public__services strong,
.doctor-card-public__schedule strong {
    display: block;
    margin-bottom: .35rem;
}

.doctor-card-public__services,
.doctor-card-public__schedule {
    min-width: 0;
}

.doctor-services-disclosure {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .45rem .52rem;
    background: color-mix(in srgb, var(--card) 92%, var(--bg2));
}

.doctor-services-disclosure__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    text-align: center;
    font-weight: 700;
    position: relative;
    padding-right: 1rem;
}

.doctor-services-disclosure__summary::-webkit-details-marker {
    display: none;
}

.doctor-services-disclosure__summary::after {
    content: "";
    width: .42rem;
    height: .42rem;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-65%) rotate(45deg);
    transition: transform .16s ease;
}

.doctor-services-disclosure:not([open]) .doctor-services-disclosure__summary::after {
    transform: translateY(-50%) rotate(-45deg);
}

.doctor-services-disclosure__summary small {
    color: var(--muted);
    font-weight: 600;
}

.doctor-services-disclosure .doctor-service-tags {
    margin-top: .45rem;
}

.doctor-service-tags {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: .35rem;
}

.doctor-service-tags li {
    border: 1px solid #c3ccd7;
    border-radius: 10px;
    padding: .24rem .5rem;
    font-size: .82rem;
    font-weight: 700;
    background: #eef2f6;
    color: #111;
    overflow: hidden;
    min-width: 0;
}

.doctor-service-tags__item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: .5rem;
    min-width: 0;
}

.doctor-service-tags__meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .45rem;
}

.doctor-service-tags__name {
    display: block;
    color: #111;
    font-weight: 700;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal !important;
    max-width: 100%;
}

.doctor-service-price {
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
    white-space: nowrap;
}

.doctor-service-code,
.service-code-inline {
    display: inline-block;
}

.service-price-inline {
    margin: .35rem 0 0;
    color: var(--text);
    font-size: 1rem;
    font-weight: 400;
}

.service-price-inline strong {
    font-weight: 800;
    color: #1f2937;
    font-size: 1.08rem;
}

.doctor-service-code summary,
.service-code-inline summary {
    cursor: pointer;
    list-style: none;
    color: var(--muted);
    font-size: .84rem;
    font-weight: 700;
}

.doctor-service-code summary::-webkit-details-marker,
.service-code-inline summary::-webkit-details-marker {
    display: none;
}

.doctor-service-code span,
.service-code-inline span {
    display: inline-block;
    margin-top: .22rem;
    color: var(--text);
    font-size: .88rem;
    font-variant-numeric: tabular-nums;
}

.doctor-schedule-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .45rem;
}

.doctor-schedule-day {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .42rem .52rem;
    background: color-mix(in srgb, var(--card) 92%, var(--bg2));
}

.doctor-schedule-day__date {
    font-weight: 700;
    margin-bottom: .12rem;
}

.doctor-schedule-day__times {
    font-size: .88rem;
}

.doctor-public-schedule {
    display: grid;
    gap: .45rem;
}

.doctor-public-schedule__dates {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.doctor-date-pill {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    color: inherit;
    padding: .45rem .3rem;
    min-height: 3.4rem;
    text-align: center;
    display: grid;
    gap: .06rem;
    justify-items: center;
    align-content: center;
    min-width: 84px;
    cursor: pointer;
    transition: border-color .15s ease, background .15s ease, transform .12s ease;
}

.doctor-date-pill:hover {
    transform: translateY(-1px);
}

.doctor-date-pill span {
    font-weight: 700;
    line-height: 1.1;
}

.doctor-date-pill small {
    font-size: .82rem;
    line-height: 1;
    color: var(--muted);
}

.doctor-date-pill.is-active {
    border-color: color-mix(in srgb, var(--primary) 58%, var(--border));
    background: color-mix(in srgb, var(--primary) 18%, var(--card));
}

.doctor-time-pane {
    display: none;
}

.doctor-time-pane.is-active {
    display: block;
}

.doctor-time-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: .35rem;
}

.doctor-slot-btn {
    position: relative;
    border: 1px solid var(--border);
    border-radius: 10px;
    min-height: 2.7rem;
    padding: .3rem .45rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    color: var(--text);
    display: grid;
    text-decoration: none;
    gap: .02rem;
}

.doctor-slot-btn small {
    font-size: .76rem;
    color: color-mix(in srgb, var(--text) 80%, transparent);
}

.doctor-slot-btn--free {
    border-color: color-mix(in srgb, #1f8d4f 74%, var(--border));
    background: color-mix(in srgb, #23a65d 24%, var(--card));
    cursor: pointer;
}

.doctor-slot-btn--occupied {
    border-color: color-mix(in srgb, #c63b3b 74%, var(--border));
    background: color-mix(in srgb, #de4747 24%, var(--card));
}

.doctor-slot-btn--frozen {
    border-style: dashed;
    border-color: color-mix(in srgb, #6f7682 74%, var(--border));
    background: color-mix(in srgb, #8b93a0 24%, var(--card));
}

.doctor-slot-btn__cross {
    position: absolute;
    inset: 4px;
    pointer-events: none;
}

.doctor-slot-btn__cross::before,
.doctor-slot-btn__cross::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: calc(50% - 1px);
    height: 2px;
    border-radius: 999px;
    background: color-mix(in srgb, #6f7682 88%, transparent);
}

.doctor-slot-btn__cross::before {
    transform: rotate(16deg);
}

.doctor-slot-btn__cross::after {
    transform: rotate(-16deg);
}

.auth-required-modal[hidden] {
    display: none !important;
}

.auth-required-modal {
    position: fixed;
    inset: 0;
    z-index: 95;
    display: grid;
    place-items: center;
    padding: max(14px, env(safe-area-inset-top)) 14px max(14px, env(safe-area-inset-bottom));
    overflow-y: auto;
}

.auth-required-modal__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 48%, transparent);
}

.auth-required-modal__dialog {
    position: relative;
    margin: 0;
    width: min(92vw, 470px);
    max-width: 470px;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .9rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    box-shadow: 0 16px 40px color-mix(in srgb, #000 20%, transparent);
}

.auth-required-modal__dialog h3 {
    margin-top: 0;
}

body.modal-open,
body.is-loading {
    overflow: hidden;
}

.global-loader[hidden] {
    display: none !important;
}

.global-loader {
    position: fixed;
    inset: 0;
    z-index: 120;
}

.global-loader__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 38%, transparent);
}

.global-loader__dialog {
    position: relative;
    margin: 38vh auto 0;
    width: min(90vw, 300px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .8rem .9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .55rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    box-shadow: 0 12px 28px color-mix(in srgb, #000 22%, transparent);
    font-weight: 600;
}

.global-loader__spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px solid color-mix(in srgb, var(--primary) 25%, var(--border));
    border-top-color: color-mix(in srgb, var(--primary) 90%, #fff);
    animation: loaderSpin .65s linear infinite;
}

@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.appointment-modal[hidden] {
    display: none !important;
}

.appointment-modal {
    position: fixed;
    inset: 0;
    z-index: 105;
}

.appointment-modal__backdrop {
    position: absolute;
    inset: 0;
    background: color-mix(in srgb, #000 42%, transparent);
}

.appointment-modal__dialog {
    position: relative;
    margin: min(9vh, 78px) auto 0;
    width: min(94vw, 560px);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: .95rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    box-shadow: 0 20px 42px color-mix(in srgb, #000 26%, transparent);
}

.appointment-modal__dialog h3 {
    margin-top: 0;
    margin-bottom: .35rem;
}

/* Fallbacks for browsers without color-mix() support */
@supports not (color: color-mix(in srgb, black 50%, white)) {
    .site-header {
        background: var(--bg);
    }

    .site-header__topline,
    .city-widget,
    .card,
    .hero-panel,
    .hero-slider__viewport,
    .hero-slide--doctor,
    .hero-slide__doctor-head,
    .hero-slide__overlay,
    .appointment-modal__dialog,
    .auth-required-modal__dialog,
    .global-loader__dialog,
    .cookie-banner {
        background: var(--card);
    }

    .card,
    .hero-panel,
    .hero-slider__viewport,
    .hero-slide--doctor,
    .hero-slide__doctor-head,
    .appointment-modal__dialog,
    .auth-required-modal__dialog,
    .global-loader__dialog,
    .cookie-banner {
        border: 1px solid var(--border);
    }

    .hero-slide__overlay {
        border: 1px solid var(--border);
        background: var(--bg);
    }

    .auth-required-modal__backdrop {
        background: rgba(0, 0, 0, .48);
    }

    .global-loader__backdrop {
        background: rgba(0, 0, 0, .38);
    }

    .appointment-modal__backdrop {
        background: rgba(0, 0, 0, .42);
    }

    .auth-required-modal__dialog {
        box-shadow: 0 16px 40px rgba(0, 0, 0, .20);
    }

    .global-loader__dialog {
        box-shadow: 0 12px 28px rgba(0, 0, 0, .22);
    }

    .appointment-modal__dialog {
        box-shadow: 0 20px 42px rgba(0, 0, 0, .26);
    }

    .cookie-banner {
        box-shadow: 0 10px 26px rgba(0, 0, 0, .18);
    }

    .global-loader__spinner {
        border: 2px solid var(--border);
        border-top-color: var(--primary);
    }

    input,
    select,
    textarea {
        background: var(--card);
        color: var(--text);
        border: 1px solid var(--border);
        box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .02);
    }

    input:focus,
    select:focus,
    textarea:focus {
        border-color: var(--primary);
        box-shadow: 0 0 0 2px rgba(37, 107, 220, .20);
        background: var(--card);
    }

    input::placeholder,
    textarea::placeholder {
        color: var(--muted);
        opacity: 1;
    }

    label {
        color: var(--text);
    }
}

.cookie-banner[hidden] {
    display: none !important;
}

.cookie-banner {
    position: fixed;
    left: 1rem;
    right: 1rem;
    bottom: .8rem;
    z-index: 92;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
    box-shadow: 0 10px 26px color-mix(in srgb, #000 18%, transparent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .6rem .72rem;
}

.cookie-banner__text {
    font-size: .87rem;
    color: var(--muted);
    line-height: 1.4;
}

.cookie-banner__text a {
    color: var(--text);
}

.cookie-banner__accept {
    flex: 0 0 auto;
    min-width: 3.2rem;
}

@media (max-width: 980px) {
    .actions > .appointment-header-btn {
        grid-column: span 2;
    }

    .cookie-banner {
        left: .5rem;
        right: .5rem;
        bottom: .5rem;
        padding: .5rem .55rem;
        gap: .45rem;
        flex-direction: column;
        align-items: stretch;
    }

    .cookie-banner__accept {
        width: 100%;
    }
}

.staff-doctor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: .75rem;
    margin-top: .7rem;
}

.staff-weekdays {
    gap: .4rem;
}

.staff-weekdays .checkbox {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .22rem .42rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.staff-schedule-days-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: .42rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .5rem;
    max-height: 320px;
    overflow: auto;
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
}

.staff-schedule-day-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .3rem .42rem;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .2rem .35rem;
}

.staff-schedule-day-item .muted {
    width: 100%;
    font-size: .83rem;
}

.staff-schedule-select-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.staff-schedule-select-btn {
    min-height: 2rem;
    padding: .32rem .66rem;
    font-size: .88rem;
}

.staff-search-form input[type="text"],
.staff-search-form input[type="search"] {
    color: var(--text);
    font-size: 1rem;
    border-width: 1px;
}

.staff-search-form input[type="text"]::placeholder,
.staff-search-form input[type="search"]::placeholder {
    color: color-mix(in srgb, var(--text) 70%, transparent);
}

@media (max-width: 760px) {
    .doctor-card-public__top {
        grid-template-columns: 1fr;
    }

    .doctor-card-public__photo-wrap {
        width: min(100%, 250px);
        min-width: min(100%, 250px);
        height: auto;
        min-height: 0;
        max-height: none;
        aspect-ratio: 250 / 340;
    }

    .doctor-card-public__photo {
        width: 100%;
        height: 100%;
    }

    .doctor-card-public__photo--placeholder {
        width: 100%;
        min-height: 100%;
    }

    .appointment-doctor-profile__head {
        grid-template-columns: 1fr;
    }

    .appointment-doctor-profile__photo {
        width: min(100%, 340px);
        justify-self: start;
    }

    .staff-doctor-grid {
        grid-template-columns: 1fr;
    }
}

.flash-wrap {
    display: grid;
    gap: .45rem;
    margin-bottom: .9rem;
}

.flash {
    padding: .65rem .75rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    line-height: 1.35;
}

.flash-success {
    background: color-mix(in srgb, #2c9f66 30%, var(--card));
    border-color: color-mix(in srgb, #2c9f66 58%, var(--border));
}

.flash-error {
    background: color-mix(in srgb, #ce4c4c 16%, transparent);
}

.flash-warning {
    background: color-mix(in srgb, #d6a93d 18%, transparent);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    color: var(--text);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1rem;
    padding: 0;
}

.accordion-content {
    display: none;
}

.accordion.open .accordion-content {
    margin-top: .8rem;
    display: block;
}

.services-patient-hint + .services-accordion-stack {
    margin-top: .7rem;
}

.contacts-disclosure {
    margin-top: .85rem;
}

.contacts-disclosure__summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.contacts-disclosure__summary::-webkit-details-marker {
    display: none;
}

.contacts-disclosure__toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    min-width: 6.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: .2rem .58rem;
    background: color-mix(in srgb, var(--primary) 10%, transparent);
    font-size: .85rem;
    font-weight: 600;
    color: var(--muted);
}

.contacts-disclosure__arrow::before {
    content: "";
    display: inline-block;
    width: .46rem;
    height: .46rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transform-origin: center;
}

.contacts-disclosure .contacts-disclosure__text--closed {
    display: none;
}

.contacts-disclosure:not([open]) .contacts-disclosure__arrow::before {
    transform: rotate(-45deg);
}

.contacts-disclosure:not([open]) .contacts-disclosure__text--open {
    display: none;
}

.contacts-disclosure:not([open]) .contacts-disclosure__text--closed {
    display: inline;
}

.contacts-disclosure__content {
    margin-top: .8rem;
    display: grid;
    gap: .75rem;
}

.contacts-accordion__link {
    margin: 0;
    display: flex;
    justify-content: flex-end;
}

.contacts-disclosure .contact-manager,
.contacts-disclosure .contacts-grid {
    margin: 0;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: .7rem;
}

.gallery-grid img {
    width: 100%;
    height: 145px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.map-frame {
    width: 100%;
    min-height: 240px;
    border: 0;
    border-radius: 12px;
}

.contact-manager {
    margin-bottom: .9rem;
}

.contact-manager-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: .6rem;
}

.contacts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: .85rem;
    align-items: stretch;
    grid-auto-rows: 1fr;
}

.contacts-grid .branch-card {
    display: grid;
    grid-template-rows: minmax(4.2rem, auto) minmax(6rem, auto) 3rem 220px;
    align-content: stretch;
    gap: .7rem;
    height: 100%;
    min-height: 0;
}

.branch-card__head {
    min-height: 4.2rem;
    display: flex;
    align-items: flex-start;
}

.branch-card__title {
    margin: 0;
    line-height: 1.35;
    font-size: 1.05rem;
}

.branch-card__meta {
    display: grid;
    gap: .45rem;
    align-content: start;
    min-height: 6rem;
}

.branch-card__line {
    margin: 0;
    line-height: 1.45;
}

.branch-card__actions {
    margin-top: 0;
    min-height: 3rem;
    display: flex;
    align-items: center;
}

.branch-card__map-btn {
    width: 100%;
}

.branch-card__map-wrap {
    width: 100%;
    height: 220px;
    min-height: 220px;
    margin-top: 0;
    border-radius: 12px;
    overflow: hidden;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
}

.branch-card__map-preview {
    display: block;
    width: 100%;
    height: 100%;
}

.branch-card__map-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 100%;
    object-fit: cover;
    border-radius: 0;
}

.mt-6 {
    margin-top: .6rem;
}

.mt-16 {
    margin-top: 1rem;
}

.cabinet-profile-stack {
    display: grid;
    gap: .85rem;
    margin-bottom: .85rem;
}

.cabinet-overview-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.cabinet-tile h2 {
    margin-top: 0;
}

.compact-list {
    padding-left: 1rem;
}

.compact-list li {
    margin-bottom: .65rem;
}

.cabinet-order-history-link {
    display: block;
    color: inherit;
    text-decoration: none;
    border-radius: 8px;
    padding: .24rem .35rem;
    margin: -.24rem -.35rem;
    transition: background-color .2s ease;
}

.cabinet-order-history-link:hover,
.cabinet-order-history-link:focus-visible {
    background: color-mix(in srgb, var(--primary) 12%, var(--card));
    text-decoration: none;
}

.order-card-new {
    border-color: color-mix(in srgb, var(--primary) 45%, var(--border));
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 18%, transparent);
}

.order-new-badge {
    margin-left: .5rem;
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .14rem .45rem;
    border-radius: 999px;
    border: 1px solid color-mix(in srgb, #2c9f66 58%, var(--border));
    background: color-mix(in srgb, #2c9f66 20%, var(--card));
    color: #1f6e46;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .01em;
    vertical-align: middle;
    text-transform: lowercase;
}

.order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(520px, 1.1fr);
    gap: var(--order-layout-gap);
    align-items: start;
}

.order-mobile-tabs,
.order-mobile-cta {
    display: none;
}

.order-mobile-tabs__btn {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.order-catalog {
    min-height: 100%;
    width: 100%;
}

.order-catalog,
.order-cart {
    padding: var(--order-card-padding);
}

.order-category {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: var(--order-category-padding-y) var(--order-category-padding-x);
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.order-category__summary {
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .55rem;
    font-weight: 600;
}

.order-category__summary::-webkit-details-marker {
    display: none;
}

.order-service-list {
    margin-top: .6rem;
    display: grid;
    gap: .55rem;
}

.order-service-item {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: .65rem;
    display: flex;
    justify-content: space-between;
    gap: .7rem;
    align-items: flex-start;
    background: var(--card);
}

.order-service-item h3 {
    margin: 0 0 .35rem;
    font-size: 1rem;
}

.order-price-line {
    margin: .35rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: .55rem 1.1rem;
}

.order-sidebar {
    position: sticky;
    top: 88px;
}

.order-cart h2 {
    margin-top: 0;
}

.order-cart-total-box {
    margin: .14rem 0 .62rem;
    padding: .52rem .62rem;
    border: 1px solid color-mix(in srgb, var(--primary) 28%, var(--border));
    border-radius: 12px;
    background: color-mix(in srgb, var(--primary) 10%, var(--card));
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .45rem;
}

.order-cart-total-label {
    color: var(--muted);
    font-size: .92rem;
    font-weight: 600;
}

.order-cart-total-value {
    font-size: 1.08rem;
    font-weight: 800;
    letter-spacing: .01em;
    font-variant-numeric: tabular-nums;
}

.order-cart-table-wrap table {
    min-width: var(--order-cart-table-min-width);
}

.order-cart-table {
    border-collapse: separate;
    border-spacing: 0 var(--order-table-row-gap);
    table-layout: fixed;
    width: 100%;
    min-width: 100%;
}

.order-cart-table thead th {
    border-bottom: 1px solid var(--border);
}

.order-catalog .services-table-wrap :is(th, td),
.order-cart-table :is(th, td) {
    padding: var(--order-table-cell-padding-y) var(--order-table-cell-padding-x);
}

.order-cart-table :is(th, td):nth-child(2) {
    width: var(--order-cart-col-name);
    min-width: var(--order-cart-col-name);
    max-width: var(--order-cart-col-name);
}

.order-cart-table :is(th, td):nth-child(1) {
    width: var(--order-cart-col-code);
    min-width: var(--order-cart-col-code);
    max-width: var(--order-cart-col-code);
}

.order-cart-table :is(th, td):nth-child(3) {
    width: var(--order-cart-col-unit);
    min-width: var(--order-cart-col-unit);
    max-width: var(--order-cart-col-unit);
}

.order-cart-table :is(th, td):nth-child(5) {
    width: var(--order-cart-col-action);
    min-width: var(--order-cart-col-action);
    max-width: var(--order-cart-col-action);
    white-space: nowrap;
}

.order-cart-table :is(td):nth-child(2),
.order-catalog .services-table-wrap :is(td):nth-child(2) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.order-cart-table :is(td):nth-child(2) strong,
.order-catalog .services-table-wrap :is(td):nth-child(2) strong {
    display: block;
    line-height: 1.35;
    hyphens: auto;
}

.order-cart-table :is(th, td):nth-child(4) {
    width: var(--order-cart-col-price);
    min-width: var(--order-cart-col-price);
    max-width: var(--order-cart-col-price);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Cart includes assigned doctor column for each service. */
.order-cart-table :is(th, td):nth-child(3) {
    width: var(--order-cart-col-doctor);
    min-width: var(--order-cart-col-doctor);
    max-width: var(--order-cart-col-doctor);
}

.order-cart-table :is(th, td):nth-child(4) {
    width: var(--order-cart-col-unit);
    min-width: var(--order-cart-col-unit);
    max-width: var(--order-cart-col-unit);
}

.order-cart-table :is(th, td):nth-child(5) {
    width: var(--order-cart-col-price);
    min-width: var(--order-cart-col-price);
    max-width: var(--order-cart-col-price);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.order-cart-table :is(th, td):nth-child(6) {
    width: var(--order-cart-col-action);
    min-width: var(--order-cart-col-action);
    max-width: var(--order-cart-col-action);
    white-space: nowrap;
}

.order-cart-table :is(td):nth-child(3) {
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.order-service-doctor-form {
    margin: 0;
}

.order-service-doctor-form select {
    width: 100%;
}

.order-cart-table tbody tr td {
    background: color-mix(in srgb, var(--primary) 6%, var(--card));
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.order-cart-table tbody tr td:first-child {
    border-left: 1px solid var(--border);
    border-radius: 10px 0 0 10px;
}

.order-cart-table tbody tr td:last-child {
    border-right: 1px solid var(--border);
    border-radius: 0 10px 10px 0;
}

.order-options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--order-inner-gap);
}

.services-table-wrap {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}

.services-table-top-scroll {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: .2rem;
}

.services-table-top-scroll__inner {
    height: 1px;
}

.services-table-top-scroll--hidden {
    display: none;
}

.services-table-wrap table {
    min-width: 900px;
}

.order-catalog .services-table-wrap :is(th, td):nth-child(1) {
    width: 7.8rem;
    min-width: 7.8rem;
}

.order-catalog .services-table-wrap :is(th, td):nth-child(3) {
    width: 6.6rem;
    min-width: 6.6rem;
}

.order-catalog .services-table-wrap :is(th, td):nth-child(4),
.order-catalog .services-table-wrap :is(th, td):nth-child(5) {
    width: 7.4rem;
    min-width: 7.4rem;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.order-catalog .services-table-wrap :is(th, td):nth-child(6) {
    width: 6.8rem;
    min-width: 6.8rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .9rem;
    border: 1px solid var(--border);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--card) 96%, var(--bg2)),
        color-mix(in srgb, var(--primary) 10%, var(--card))
    );
    color: var(--text);
    border-radius: 999px;
    padding: .36rem .78rem .36rem .5rem;
    cursor: pointer;
    font-weight: 600;
    transition: transform .16s ease, box-shadow .2s ease, background .2s ease;
    box-shadow: 0 6px 14px color-mix(in srgb, var(--primary) 14%, transparent);
}

.back-link > span:first-child {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--primary) 16%, var(--card));
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    line-height: 1;
}

.back-link:hover {
    transform: translateY(-1px);
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--card) 92%, var(--bg2)),
        color-mix(in srgb, var(--primary) 16%, var(--card))
    );
}

.back-link:active {
    transform: translateY(0);
}

.back-link:focus-visible {
    outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent);
    outline-offset: 2px;
}

.prose {
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prose :where(p, li, a, span, strong, em, h1, h2, h3, h4, h5, h6, blockquote, div) {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.prose img,
.prose video,
.prose iframe {
    max-width: 100%;
    height: auto;
}

.prose table {
    display: block;
    width: 100%;
    overflow-x: auto;
    table-layout: auto;
}

.prose pre,
.prose code {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.divider {
    border-top: 1px solid var(--border);
    margin: .7rem 0;
}

.staff-body {
    overflow-x: hidden;
}

.staff-shell {
    display: grid;
    grid-template-columns: 280px 1fr;
    min-height: 100vh;
    position: relative;
    z-index: 2;
}

.staff-sidebar {
    border-right: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg2) 80%, transparent);
    padding: 1rem;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.staff-user-meta {
    margin-top: .45rem;
    display: grid;
    gap: .15rem;
}

.staff-user-meta p {
    margin: 0;
}

.staff-nav {
    display: grid;
    gap: .35rem;
    margin: 1rem 0;
}

.staff-nav a {
    text-decoration: none;
    color: var(--text);
    border: 1px solid transparent;
    border-radius: 10px;
    padding: .5rem .55rem;
    font-weight: 600;
}

.staff-nav__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.3rem;
    height: 1.3rem;
    margin-left: .35rem;
    border-radius: 999px;
    padding: 0 .36rem;
    font-size: .78rem;
    line-height: 1;
    background: color-mix(in srgb, var(--primary) 26%, var(--card));
    border: 1px solid color-mix(in srgb, var(--primary) 50%, var(--border));
}

.staff-nav a:hover {
    border-color: var(--border);
    background: color-mix(in srgb, var(--primary) 10%, transparent);
}

.staff-main {
    padding: 1rem;
    position: relative;
    z-index: 2;
}

.staff-main .cards-grid {
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
}

.staff-main .cards-grid.cards-grid--staff-services-top {
    grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
}

.staff-main .cards-grid.cards-grid--checkups {
    grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
}

.staff-main .cards-grid.cards-grid--staff-doctors-create {
    grid-template-columns: minmax(980px, 1fr);
    justify-content: start;
}

.staff-main .cards-grid.cards-grid--staff-doctors-create > .card {
    max-width: min(1400px, 100%);
}

.staff-pending-notice {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .7rem;
    margin: .75rem 0;
    border-left: 3px solid color-mix(in srgb, var(--primary) 70%, var(--border));
}

.staff-pending-notice__text {
    display: grid;
    gap: .16rem;
}

.staff-pending-notice__links {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35rem;
}

.staff-pending-notice__link {
    color: color-mix(in srgb, var(--primary) 84%, var(--text));
    text-decoration: none;
    font-weight: 700;
}

.staff-pending-notice__link:hover {
    text-decoration: underline;
}

.staff-main h1 {
    color: color-mix(in srgb, var(--text) 98%, transparent);
    font-weight: 800;
}

.staff-main .muted {
    color: color-mix(in srgb, var(--text) 70%, transparent);
}

.staff-main :is(input, select, textarea) {
    background: color-mix(in srgb, var(--card) 99%, #ffffff 1%);
    border-color: color-mix(in srgb, var(--border) 55%, var(--text) 45%);
    color: var(--text);
}

.staff-main :is(input, textarea)::placeholder {
    color: color-mix(in srgb, var(--text) 86%, transparent);
}

.staff-main .section-head--staff-search input[type="text"] {
    min-height: 2.65rem;
}

.appointment-filters :is(input, select),
.appointment-layout :is(input, select, textarea) {
    background: color-mix(in srgb, var(--card) 99%, #ffffff 1%);
    border-color: color-mix(in srgb, var(--border) 55%, var(--text) 45%);
    color: var(--text);
}

.appointment-filters input::placeholder,
.appointment-layout input::placeholder,
.appointment-layout textarea::placeholder {
    color: color-mix(in srgb, var(--text) 86%, transparent);
}

.appointment-filters :is(label, .muted),
.appointment-layout :is(label, .muted) {
    color: color-mix(in srgb, var(--text) 88%, transparent);
}

.service-checklist {
    border: 1px solid color-mix(in srgb, var(--border) 52%, var(--text) 48%);
    border-radius: 10px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    max-height: 340px;
    overflow: auto;
    padding: .36rem;
    display: grid;
    gap: .28rem;
}

.service-checklist--tall {
    max-height: 480px;
}

.staff-doctor-photo-preview {
    display: block;
    width: min(360px, 100%);
    margin: .18rem 0 .52rem;
    padding: .34rem;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    overflow: hidden;
}

.staff-doctor-photo-preview img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: clamp(220px, 34vh, 360px);
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
}

.staff-doctor-grid textarea[name="bio"] {
    min-height: 110px;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: pre-wrap;
    resize: vertical;
}

.staff-doctor-selected-services {
    display: grid;
    gap: .35rem;
    margin: .2rem 0 .5rem;
}

.service-checklist__item {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    padding: .34rem .42rem;
    cursor: pointer;
    margin: 0;
}

.service-checklist__item input[type="checkbox"] {
    width: auto;
    margin: .12rem 0 0;
    flex: 0 0 auto;
}

.service-checklist__item span {
    display: block;
    line-height: 1.28;
    color: var(--text);
}

.service-checklist__item.is-checked {
    border-color: color-mix(in srgb, var(--primary) 54%, var(--border));
    background: color-mix(in srgb, var(--primary) 14%, var(--card));
}

.service-checklist__item.is-hidden {
    display: none;
}

.field-block {
    display: grid;
    gap: .36rem;
}

.field-block__label {
    font-weight: 600;
    color: var(--text);
}

.w-full {
    width: 100%;
}

.main-content .card,
.staff-main .card {
    transform: translateY(8px);
    animation: fadeUp .4s ease forwards;
}

@keyframes fadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .callback-form-grid {
        grid-template-columns: 1fr;
    }

    .hero-doctors3d {
        padding: .55rem;
    }

    .hero-doctors3d__stage {
        height: auto;
        perspective: none;
        overflow: visible;
    }

    .hero-doctors3d__track {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: .55rem;
        transform: none !important;
        animation: none;
    }

    .hero-doctor-card {
        position: static;
        width: 100%;
        transform: none !important;
        box-shadow: var(--shadow);
    }

    .order-layout {
        grid-template-columns: 1fr;
    }

    .order-sidebar {
        position: static;
    }

    .staff-shell {
        grid-template-columns: 1fr;
    }

    .staff-main .cards-grid.cards-grid--staff-services-top,
    .staff-main .cards-grid.cards-grid--checkups,
    .staff-main .cards-grid.cards-grid--staff-doctors-create {
        grid-template-columns: 1fr;
    }

    .staff-sidebar {
        position: static;
        height: auto;
    }

    .appointment-layout {
        grid-template-columns: 1fr;
    }

    .appointment-filters__head {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .order-layout {
        display: block;
        gap: .75rem;
    }

    .order-page-with-mobile-cta {
        padding-bottom: 5.3rem;
    }

    .order-mobile-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
        margin: 0 0 .6rem;
        padding: .22rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    }

    .order-mobile-tabs__btn {
        border: 1px solid transparent;
        border-radius: 9px;
        background: transparent;
        color: var(--text);
        font-weight: 600;
        padding: .48rem .5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .28rem;
        min-height: 2.15rem;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease, transform .12s ease;
    }

    .order-mobile-tabs__btn.is-active {
        background: color-mix(in srgb, var(--primary) 18%, var(--card));
        border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
        box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 18%, transparent);
    }

    .order-mobile-tabs__btn:active {
        transform: scale(.985);
    }

    .order-mobile-tabs__count {
        border-radius: 999px;
        padding: .1rem .42rem;
        background: color-mix(in srgb, var(--primary) 20%, transparent);
        border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
        font-size: .78rem;
        line-height: 1;
    }

    .order-layout[data-active-tab="catalog"] [data-order-pane="cart"] {
        display: none;
    }

    .order-layout[data-active-tab="cart"] [data-order-pane="catalog"] {
        display: none;
    }

    .order-catalog,
    .order-cart {
        padding: var(--order-mobile-card-padding);
    }

    .order-mobile-cta {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding: .52rem .75rem calc(.52rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: color-mix(in srgb, var(--bg) 95%, transparent);
        backdrop-filter: blur(8px);
    }

    .order-mobile-cta .btn {
        min-height: 2.55rem;
        font-size: clamp(.88rem, 2.7vw, 1rem);
    }

    .order-catalog .services-table-top-scroll,
    .order-cart .services-table-top-scroll {
        display: none !important;
    }

    .order-catalog .services-table-wrap {
        overflow-x: visible;
    }

    .order-catalog .services-table-wrap table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0 .38rem;
    }

    .order-catalog .services-table-wrap thead {
        display: none;
    }

    .order-catalog .services-table-wrap tbody,
    .order-catalog .services-table-wrap tr,
    .order-catalog .services-table-wrap td {
        display: block;
        width: 100%;
    }

    .order-catalog .services-table-wrap tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: color-mix(in srgb, var(--primary) 5%, var(--card));
        padding: .5rem .55rem;
    }

    .order-catalog .services-table-wrap td {
        border: 0;
        padding: .16rem 0;
    }

    .order-catalog .services-table-wrap td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: .78rem;
        margin-bottom: .08rem;
    }

    .order-catalog .services-table-wrap td[data-label="Действие"] .btn {
        width: 100%;
    }

    .order-cart-table-wrap {
        overflow-x: auto;
    }

    .order-cart-table-wrap table {
        min-width: var(--order-cart-mobile-table-min-width);
    }

    .order-cart-table :is(th, td):nth-child(2) {
        width: clamp(9rem, 35vw, var(--order-cart-col-name));
        min-width: clamp(9rem, 35vw, var(--order-cart-col-name));
        max-width: clamp(9rem, 35vw, var(--order-cart-col-name));
    }
}

@media (max-width: 760px) {
    .site-header .container.header-row {
        width: 100%;
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .nav {
        display: none;
    }

    .header-row {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .42rem;
        align-items: stretch;
        justify-content: stretch;
    }

    .actions > .city-widget {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .actions > .btn,
    .actions > .theme-btn,
    .actions > form.inline .btn {
        width: 100%;
        min-height: 2.2rem;
    }

    .actions > form.inline {
        margin: 0;
        min-width: 0;
    }

    .actions > .theme-icon-btn {
        width: 100%;
        border-radius: 10px;
    }

    .actions .city-widget {
        grid-template-columns: max-content max-content 1fr;
        gap: .08rem .46rem;
        padding: .35rem .5rem;
    }

    .actions .city-widget__date,
    .actions .city-widget__time {
        min-width: 4.8rem;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .actions .city-widget__weather {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .city-widget {
        min-width: 100%;
    }

    .staff-main table {
        min-width: 100%;
    }

    .order-options-grid {
        grid-template-columns: 1fr;
    }

    .page-search-form {
        width: 100%;
    }

    .page-search-form input[type="text"] {
        min-width: 0;
        width: 100%;
    }

    .order-layout {
        display: block;
        gap: .75rem;
    }

    .order-page-with-mobile-cta {
        padding-bottom: 5.3rem;
    }

    .order-mobile-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .35rem;
        margin: 0 0 .6rem;
        padding: .22rem;
        border: 1px solid var(--border);
        border-radius: 12px;
        background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    }

    .order-mobile-tabs__btn {
        border: 1px solid transparent;
        border-radius: 9px;
        background: transparent;
        color: var(--text);
        font-weight: 600;
        padding: .48rem .5rem;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: .28rem;
        min-height: 2.15rem;
        cursor: pointer;
        transition: background .18s ease, border-color .18s ease, transform .12s ease;
    }

    .order-mobile-tabs__btn.is-active {
        background: color-mix(in srgb, var(--primary) 18%, var(--card));
        border-color: color-mix(in srgb, var(--primary) 42%, var(--border));
        box-shadow: 0 3px 10px color-mix(in srgb, var(--primary) 18%, transparent);
    }

    .order-mobile-tabs__btn:active {
        transform: scale(.985);
    }

    .order-mobile-tabs__count {
        border-radius: 999px;
        padding: .1rem .42rem;
        background: color-mix(in srgb, var(--primary) 20%, transparent);
        border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
        font-size: .78rem;
        line-height: 1;
    }

    .order-layout[data-active-tab="catalog"] [data-order-pane="cart"] {
        display: none;
    }

    .order-layout[data-active-tab="cart"] [data-order-pane="catalog"] {
        display: none;
    }

    .order-catalog,
    .order-cart {
        padding: var(--order-mobile-card-padding);
    }

    .order-mobile-cta {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 40;
        padding: .52rem .75rem calc(.52rem + env(safe-area-inset-bottom));
        border-top: 1px solid var(--border);
        background: color-mix(in srgb, var(--bg) 95%, transparent);
        backdrop-filter: blur(8px);
    }

    .order-mobile-cta .btn {
        min-height: 2.55rem;
    }

    .order-catalog .services-table-top-scroll,
    .order-cart .services-table-top-scroll {
        display: none !important;
    }

    .order-catalog .services-table-wrap {
        overflow-x: visible;
    }

    .order-catalog .services-table-wrap table {
        min-width: 0;
        width: 100%;
        table-layout: auto;
        border-collapse: separate;
        border-spacing: 0 .38rem;
    }

    .order-catalog .services-table-wrap thead {
        display: none;
    }

    .order-catalog .services-table-wrap tbody,
    .order-catalog .services-table-wrap tr,
    .order-catalog .services-table-wrap td {
        display: block;
        width: 100%;
    }

    .order-catalog .services-table-wrap tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: color-mix(in srgb, var(--primary) 5%, var(--card));
        padding: .5rem .55rem;
    }

    .order-catalog .services-table-wrap td {
        border: 0;
        padding: .16rem 0;
    }

    .order-catalog .services-table-wrap td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: .78rem;
        margin-bottom: .08rem;
    }

    .order-catalog .services-table-wrap td[data-label="Действие"] .btn {
        width: 100%;
    }

    .order-cart-table-wrap {
        overflow-x: auto;
    }

    .order-cart-table-wrap table {
        min-width: var(--order-cart-mobile-table-min-width);
    }

    .order-cart-table :is(th, td):nth-child(2) {
        width: clamp(9rem, 35vw, var(--order-cart-col-name));
        min-width: clamp(9rem, 35vw, var(--order-cart-col-name));
        max-width: clamp(9rem, 35vw, var(--order-cart-col-name));
    }

    .hero-doctors3d__track {
        grid-template-columns: 1fr;
    }
}

/* Enhanced mobile styles for order page */
@media (max-width: 980px) {
    html,
    body {
        overflow-x: hidden;
    }

    .main-content.container {
        width: min(100%, calc(100% - .9rem));
    }

    .site-header .container.header-row {
        width: 100%;
        padding-left: .5rem;
        padding-right: .5rem;
    }

    .header-row {
        display: flex;
        flex-wrap: wrap;
        align-items: stretch;
    }

    .actions {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: .42rem;
        align-items: stretch;
        justify-content: stretch;
    }

    .actions > .city-widget {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .actions > .btn,
    .actions > .theme-btn,
    .actions > form.inline .btn {
        width: 100%;
        min-height: 2.2rem;
    }

    .actions > form.inline {
        margin: 0;
        min-width: 0;
    }

    .actions > .theme-icon-btn {
        width: 100%;
        border-radius: 10px;
    }

    .actions .city-widget {
        grid-template-columns: max-content max-content 1fr;
        gap: .08rem .46rem;
        padding: .35rem .5rem;
        min-height: 3.3rem;
    }

    .actions .city-widget__date,
    .actions .city-widget__time {
        min-width: 4.8rem;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .actions .city-widget__weather {
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .order-layout {
        max-width: 100%;
    }

    .order-catalog,
    .order-cart {
        width: 100%;
        max-width: 100%;
    }

    .order-mobile-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: .34rem;
        padding: .28rem;
        border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
        border-radius: 14px;
        background: linear-gradient(
            135deg,
            color-mix(in srgb, var(--card) 94%, var(--bg2)),
            color-mix(in srgb, var(--primary) 8%, var(--card))
        );
        box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 12%, transparent);
    }

    .order-mobile-tabs__btn {
        appearance: none;
        -webkit-appearance: none;
        border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
        border-radius: 11px;
        background: color-mix(in srgb, var(--card) 94%, var(--bg2));
        color: var(--text);
        font-weight: 600;
        padding: .52rem .5rem;
        min-height: 2.2rem;
    }

    .order-mobile-tabs__btn.is-active {
        background: linear-gradient(
            135deg,
            color-mix(in srgb, var(--primary) 82%, white 18%),
            color-mix(in srgb, var(--primary) 66%, black 10%)
        );
        color: var(--primary-contrast);
        border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
        box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 30%, transparent);
    }

    .order-layout[data-active-tab="all"] [data-order-pane="catalog"],
    .order-layout[data-active-tab="all"] [data-order-pane="cart"] {
        display: block;
    }

    .order-catalog .services-table-wrap {
        overflow-x: auto !important;
        max-width: 100%;
    }

    .order-catalog .services-table-wrap table {
        min-width: 0 !important;
        width: 100% !important;
        table-layout: auto !important;
        border-collapse: separate !important;
        border-spacing: 0 .36rem !important;
        display: block;
    }

    .order-catalog .services-table-wrap thead {
        display: none !important;
    }

    .order-catalog .services-table-wrap tbody,
    .order-catalog .services-table-wrap tr,
    .order-catalog .services-table-wrap td {
        display: block !important;
        width: 100% !important;
        max-width: 100%;
    }

    .order-catalog .services-table-wrap tr {
        border: 1px solid var(--border);
        border-radius: 10px;
        background: color-mix(in srgb, var(--primary) 5%, var(--card));
        padding: .5rem .55rem;
    }

    .order-catalog .services-table-wrap td {
        border: 0 !important;
        padding: .16rem 0 !important;
    }

    .order-catalog .services-table-wrap td::before {
        content: attr(data-label);
        display: block;
        color: var(--muted);
        font-size: .78rem;
        margin-bottom: .08rem;
    }
}

/* Unified order view mode: desktop + mobile */
.order-view-title {
    margin: .2rem 0 .35rem;
    color: var(--muted);
    font-size: .88rem;
    font-weight: 600;
}

.order-mobile-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .34rem;
    margin: 0 0 .6rem;
    padding: .28rem;
    border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
    border-radius: 14px;
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--card) 94%, var(--bg2)),
        color-mix(in srgb, var(--primary) 8%, var(--card))
    );
    box-shadow: 0 8px 18px color-mix(in srgb, var(--primary) 12%, transparent);
}

.order-mobile-tabs__btn {
    appearance: none;
    -webkit-appearance: none;
    border: 1px solid color-mix(in srgb, var(--primary) 22%, var(--border));
    border-radius: 11px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    color: var(--text);
    font-weight: 600;
    padding: .52rem .5rem;
    min-height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .28rem;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .12s ease, box-shadow .18s ease;
}

.order-mobile-tabs__btn.is-active {
    background: linear-gradient(
        135deg,
        color-mix(in srgb, var(--primary) 82%, white 18%),
        color-mix(in srgb, var(--primary) 66%, black 10%)
    );
    color: var(--primary-contrast);
    border-color: color-mix(in srgb, var(--primary) 50%, var(--border));
    box-shadow: 0 7px 16px color-mix(in srgb, var(--primary) 30%, transparent);
}

.order-mobile-tabs__btn:active {
    transform: scale(.985);
}

.order-layout[data-active-tab="catalog"] {
    grid-template-columns: minmax(0, 1fr);
}

.order-layout[data-active-tab="cart"] {
    grid-template-columns: minmax(0, 1fr);
}

.order-layout[data-active-tab="catalog"] [data-order-pane="cart"] {
    display: none;
}

.order-layout[data-active-tab="cart"] [data-order-pane="catalog"] {
    display: none;
}

.order-layout[data-active-tab="all"] [data-order-pane="catalog"],
.order-layout[data-active-tab="all"] [data-order-pane="cart"] {
    display: block;
}

.order-catalog .services-table-top-scroll,
.order-cart .services-table-top-scroll {
    display: none !important;
}

.order-catalog .services-table-wrap,
.order-cart .services-table-wrap {
    overflow-x: auto !important;
    max-width: 100%;
}

.order-catalog .services-table-wrap table,
.order-cart .order-cart-table {
    min-width: 0 !important;
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: separate !important;
    border-spacing: 0 .36rem !important;
    display: block;
}

.order-catalog .services-table-wrap thead,
.order-cart .order-cart-table thead {
    display: none !important;
}

.order-catalog .services-table-wrap tbody,
.order-catalog .services-table-wrap tr,
.order-catalog .services-table-wrap td,
.order-cart .order-cart-table tbody,
.order-cart .order-cart-table tr,
.order-cart .order-cart-table td {
    display: block !important;
    width: 100% !important;
    max-width: 100%;
}

.order-catalog .services-table-wrap tr,
.order-cart .order-cart-table tr {
    border: 1px solid var(--border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--primary) 5%, var(--card));
    padding: .5rem .55rem;
}

.order-catalog .services-table-wrap td,
.order-cart .order-cart-table td {
    border: 0 !important;
    padding: .16rem 0 !important;
}

.order-catalog .services-table-wrap td::before,
.order-cart .order-cart-table td::before {
    content: attr(data-label);
    display: block;
    color: var(--muted);
    font-size: .78rem;
    margin-bottom: .08rem;
}

.order-catalog .services-table-wrap td[data-label="Действие"] .btn,
.order-cart .order-cart-table td[data-label="Действие"] .btn {
    width: 100%;
}

.order-catalog .services-table-wrap :is(th, td),
.order-cart .order-cart-table :is(th, td) {
    width: auto !important;
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
}

@media (max-width: 980px) {
    .main-content.container {
        width: min(100%, calc(100% - .9rem));
    }
}

/* Stabilized mobile top panel and mode switcher */
@media (max-width: 980px) {
    .actions .city-widget {
        min-height: 3.4rem;
    }

    .actions .city-widget__date {
        width: 10ch;
    }

    .actions .city-widget__time {
        width: 8ch;
    }

    .actions .city-widget__weather {
        display: block;
        height: 1.2em;
        line-height: 1.2;
    }

    .order-mobile-tabs {
        position: sticky;
        top: .35rem;
        z-index: 15;
    }
}

.review-image-preview {
    display: block;
    width: min(460px, 100%);
    max-height: 340px;
    object-fit: contain;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 90%, var(--bg2));
    margin: .45rem 0;
}

.review-card {
    display: grid;
    gap: .55rem;
}

.review-card__doctor {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    align-items: start;
    gap: .75rem;
    min-height: 104px;
    min-width: 0;
}

.review-card__doctor-photo--placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-size: .78rem;
}

.review-card__doctor-meta {
    display: grid;
    gap: .15rem;
    align-self: center;
    min-width: 0;
}

.review-card__doctor-meta h2,
.review-card__doctor-meta p {
    margin: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.review-doctor-meta h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.review-doctor-meta p {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

.checkup-list-card {
    display: grid;
    gap: .7rem;
}

.checkup-packages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: .75rem;
}

.checkup-card {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    min-height: 100%;
    background: color-mix(in srgb, var(--primary) 6%, var(--card));
    border: 1px solid var(--border);
}

.checkup-card h3,
.checkup-card p {
    margin: 0;
}

.checkup-card__services {
    margin: 0;
    padding-left: 1.1rem;
    display: grid;
    gap: .18rem;
    flex: 1 1 auto;
}

.checkup-card__actions {
    margin-top: auto;
    padding-top: .4rem;
}

.pagination-row {
    margin-top: .8rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: .55rem;
}

.pagination-row .is-disabled {
    pointer-events: none;
    opacity: .55;
}

.document-ordered-list {
    padding-left: 1.3rem;
}

.stats-rings {
    margin-top: .6rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: .7rem;
}

.stats-ring-card {
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: .7rem;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
}

.stats-ring-card h3 {
    margin: .55rem 0 .3rem;
    font-size: .95rem;
}

.stats-ring-card p {
    margin: 0;
}

.stats-ring {
    --ring-size: 118px;
    width: var(--ring-size);
    height: var(--ring-size);
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    background:
        radial-gradient(circle at 28% 25%, color-mix(in srgb, white 35%, transparent), transparent 42%),
        conic-gradient(var(--primary) calc(var(--ring) * 1%), color-mix(in srgb, var(--border) 88%, transparent) 0);
    box-shadow:
        inset 0 -8px 14px color-mix(in srgb, black 15%, transparent),
        inset 0 8px 10px color-mix(in srgb, white 22%, transparent),
        0 12px 18px color-mix(in srgb, var(--primary) 24%, transparent);
}

.stats-ring::before {
    content: "";
    position: absolute;
    inset: 16px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--card) 96%, var(--bg2));
    border: 1px solid color-mix(in srgb, var(--border) 86%, white 8%);
}

.stats-ring__value {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-weight: 700;
    font-size: 1.05rem;
    z-index: 1;
}

.stats-money-row {
    cursor: pointer;
}

.stats-money-row:hover td {
    background: color-mix(in srgb, var(--primary) 10%, var(--card));
}

.stats-money-row:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: -2px;
}

.stats-money-modal__dialog {
    position: relative;
    width: min(560px, 92vw);
}

.stats-money-modal__close {
    position: absolute;
    top: .5rem;
    right: .5rem;
    width: 2rem;
    height: 2rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: color-mix(in srgb, var(--card) 94%, var(--bg2));
    color: var(--text);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
}

.stats-money-modal__close:hover {
    background: color-mix(in srgb, var(--primary) 18%, var(--card));
}

.stats-money-modal__table {
    width: 100%;
    margin-top: .5rem;
}

.stats-money-modal__table td:first-child {
    color: var(--muted);
    width: 58%;
}

.stats-money-modal__table td:last-child {
    font-weight: 700;
    text-align: right;
}

.audit-entry {
    border: 1px solid var(--border);
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 95%, var(--bg2));
}

.audit-meta {
    margin-top: .35rem;
    display: grid;
    gap: .2rem;
}

.audit-meta p {
    margin: 0;
}

/* Patient cart: 5 columns
   Code | Service | Unit/doctor | Price | Action */
.order-cart-table :is(th, td):nth-child(3) {
    width: var(--order-cart-col-doctor);
    min-width: var(--order-cart-col-doctor);
    max-width: var(--order-cart-col-doctor);
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.order-cart-table :is(th, td):nth-child(4) {
    width: var(--order-cart-col-price);
    min-width: var(--order-cart-col-price);
    max-width: var(--order-cart-col-price);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.order-cart-table :is(th, td):nth-child(5) {
    width: var(--order-cart-col-action);
    min-width: var(--order-cart-col-action);
    max-width: var(--order-cart-col-action);
    white-space: nowrap;
}

.order-cart-table td[data-label="Ед. / врач"] {
    vertical-align: top;
}

/* Mobile hardening for home page blocks */
@media (max-width: 760px) {
    .site-header .container.header-row {
        width: 100%;
        padding-left: .45rem;
        padding-right: .45rem;
    }

    .site-header .header-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: .42rem;
        align-items: stretch;
    }

    .site-header .nav {
        display: none !important;
    }

    .site-header .actions {
        width: 100%;
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr;
        gap: .38rem;
        align-items: stretch;
        justify-content: stretch;
    }

    .site-header .actions > * {
        min-width: 0;
    }

    .site-header .actions > .city-widget {
        grid-column: 1 / -1;
        width: 100%;
        min-width: 0;
    }

    .site-header .actions > .btn,
    .site-header .actions > .theme-btn,
    .site-header .actions > form.inline,
    .site-header .actions > form.inline .btn {
        width: 100%;
        min-width: 0;
    }

    .site-header .actions > .appointment-header-btn {
        grid-column: 1 / -1;
    }

    .hero.hero-showcase {
        grid-template-columns: 1fr !important;
        gap: .62rem;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    .hero.hero-showcase .hero-panel {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        padding: .52rem;
    }

    .hero.hero-showcase .hero-panel__head {
        align-items: flex-start;
        gap: .34rem;
    }

    .hero.hero-showcase .hero-panel__head h2 {
        margin: 0;
        font-size: 1.04rem;
        line-height: 1.22;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hero.hero-showcase .hero-panel__head a {
        font-size: .88rem;
        overflow-wrap: anywhere;
    }

    .hero.hero-showcase .hero-slider__viewport,
    .hero.hero-showcase .hero-empty {
        min-height: 0 !important;
        height: auto;
    }

    .hero.hero-showcase .hero-slide--doctor {
        padding: .5rem;
        gap: .46rem;
        min-width: 0;
    }

    .hero.hero-showcase .hero-slide__doctor-head {
        grid-template-columns: 1fr;
        gap: .48rem;
        padding: .44rem;
        min-height: 0;
        max-height: none;
        height: auto;
        min-width: 0;
        overflow: hidden;
    }

    .hero.hero-showcase .hero-slide__doctor-photo {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        height: auto;
        min-height: 220px;
        max-height: none;
        aspect-ratio: 4 / 3;
        object-fit: contain;
        object-position: center;
        border-radius: 10px;
    }

    .hero.hero-showcase .hero-slide__doctor-photo--placeholder {
        width: 100%;
        min-width: 0;
        max-width: 100%;
        min-height: 220px;
        max-height: none;
        height: auto;
        aspect-ratio: 4 / 3;
        border-radius: 10px;
    }

    .hero.hero-showcase .hero-slide__doctor-meta {
        max-height: none;
        overflow: visible;
        padding-right: 0;
        min-width: 0;
    }

    .hero.hero-showcase .hero-slide__doctor-meta p,
    .hero.hero-showcase .hero-slide__overlay p {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .hero.hero-showcase .hero-slide__doctor-actions .btn {
        flex: 1 1 100%;
        width: 100%;
    }

    .hero.hero-showcase .hero-slide__media {
        min-height: 220px;
        height: auto;
    }

    .callback-reviews-card {
        padding: .62rem;
    }

    .callback-reviews-grid {
        grid-template-columns: 1fr;
        gap: .6rem;
    }

    .callback-reviews-grid__callback,
    .callback-reviews-grid__reviews {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        overflow: hidden;
        padding: .58rem;
    }

    .hero-slider--reviews .hero-slide--review {
        min-height: 220px;
        padding: .56rem;
    }

    .hero-slider--reviews .hero-slider__viewport {
        height: 220px;
        min-height: 220px;
    }

    .review-doctor-head {
        grid-template-columns: 84px minmax(0, 1fr);
        min-height: 84px;
        gap: .55rem;
    }

    .review-doctor-photo {
        width: 100%;
        height: 100%;
    }

    .review-doctor-meta {
        min-height: 0;
    }

    .review-card__doctor {
        grid-template-columns: 88px minmax(0, 1fr);
        min-height: 88px;
        gap: .62rem;
    }

    .review-card__doctor-photo {
        width: 100%;
        height: 100%;
    }

    .hero-slider--reviews .hero-slide--review > p {
        -webkit-line-clamp: 4;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .cards-grid > .card {
        min-width: 0;
    }
}
