/* ============================================
   ЗаказУслуг.рф — Дизайн-система v2
   ============================================ */

/* Минимальная тач-зона 44×44px (WCAG / Apple HIG) */
.touch-target {
    min-height: 2.75rem;
    min-width: 2.75rem;
}

/* Шрифт: системный стек до загрузки Inter (меньше CLS) */
body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Юридические страницы — перенос длинных слов и таблиц */
.legal-prose {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.legal-doc-nav {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* Dropdown уведомлений на mobile — fixed, не обрезается родителем */
.notif-dropdown {
    overscroll-behavior: contain;
}

/* Пагинация: основные стили в Tailwind (.pagination-btn в app.css → tailwind.css) */
.pagination-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem;
}

/* Контейнеры не должны распирать viewport */
.layout-shell,
main {
    max-width: 100%;
}

/* Админ-таблицы: горизонтальный скролл только внутри обёртки */
@media (max-width: 767px) {
    .admin-content .responsive-table-wrap,
    .admin-content .overflow-x-auto {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
}

/* ---------- Поверхности (reading-mode) и шапка ---------- */
:root {
    /* Брейкпоинты (этап 4 — единая шкала с PLAN.md) */
    --bp-xs: 320px;
    --bp-sm: 576px;
    --bp-md: 768px;
    --bp-lg: 992px;
    --bp-xl: 1200px;
    --bp-xxl: 1400px;

    --surface-page: #F0EEEA;
    --surface-card: #F8F7F4;
    --surface-elevated: #FDFCFA;
    --surface-pure: #FFFFFF;
    --surface-border: #E8E4DD;
    --surface-muted: #ECEAE5;
    --site-header-h: 3.5rem; /* 56px — h-14 */
}
@media (min-width: 1024px) {
    :root { --site-header-h: 4rem; } /* 64px — lg:h-16 */
}

html {
    scroll-padding-top: var(--site-header-h);
    /* Глобальная защита от горизонтального сдвига страницы на мобильных.
       overflow-x: clip (а не hidden) НЕ ломает sticky-шапку и не создаёт
       лишний скролл-контейнер. */
    overflow-x: clip;
}

body {
    overflow-x: clip;
    max-width: 100%;
    /* Длинные неразрывные строки (ссылки, e-mail, ввод без пробелов)
       переносятся, а не распирают контейнер. */
    overflow-wrap: break-word;
}

/* iOS Safari зумит страницу при фокусе на поле с font-size < 16px и
   потом «дёргает» вьюпорт. Принудительно 16px на мобильных для всех
   полей ввода (визуальный размер на десктопе задаётся Tailwind-утилитами).
   !important — чтобы перебить text-sm на textarea (низкая специфичность). */
@media (max-width: 767px) {
    input:not([type=checkbox]):not([type=radio]):not([type=range]),
    select,
    textarea {
        font-size: 16px !important;
    }
}

.section-anchor {
    scroll-margin-top: var(--site-header-h);
}

/* ---------- Hero: первый экран под шапкой ---------- */
/* Мобиле: 2 колонки, независимый скролл + reveal; ПК: 3 колонки, поиск над сеткой. */
.home-v2-hero {
    --hero-chip-h: 3.25rem;
    --hero-chip-gap: 0.5rem;
    --hero-cats-max: 100%;
    background-color: #1d4ed8;
    background-image: linear-gradient(to bottom right, #2563eb, #1d4ed8, #1e3a8a);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: calc(100dvh - var(--site-header-h));
    min-height: calc(100svh - var(--site-header-h));
    box-sizing: border-box;
}

.home-v2-hero__inner {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.home-v2-hero__main {
    min-height: 0;
}

.home-v2-hero__search {
    width: 100%;
    max-width: var(--hero-cats-max);
}

.home-v2-hero-cats {
    position: relative;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: var(--hero-cats-max);
}

.home-v2-hero-cats__cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--hero-chip-gap);
    min-height: 0;
    width: 100%;
    flex: 1 1 auto;
}

.home-v2-hero-cats__col {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
}

.home-v2-hero-cats__track {
    display: flex;
    flex-direction: column;
    gap: var(--hero-chip-gap);
    width: 100%;
}

.home-v2-hero-cats__col--desk {
    display: none;
}

.home-v2-hero-cats__chip {
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    flex: 0 0 auto;
    width: 100%;
    height: var(--hero-chip-h);
    min-height: var(--hero-chip-h);
    max-height: var(--hero-chip-h);
    padding: 0.35rem 0.65rem;
    border-radius: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    text-align: center;
    overflow: hidden;
    transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease, opacity 0.35s ease, filter 0.35s ease;
}

.home-v2-hero-cats__chip-label {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    max-height: 2.4em;
    text-align: center;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.home-v2-hero-cats__chip:hover,
.home-v2-hero-cats__chip:focus-visible {
    background: rgba(255, 255, 255, 0.24);
    border-color: rgba(255, 255, 255, 0.4);
    outline: none;
}

.home-v2-hero-cats__chip:active {
    transform: scale(0.98);
}

@media (max-width: 639px) {
    .home-v2-hero {
        height: calc(100dvh - var(--site-header-h));
        height: calc(100svh - var(--site-header-h));
        max-height: calc(100dvh - var(--site-header-h));
        max-height: calc(100svh - var(--site-header-h));
        min-height: 0;
        overflow: hidden;
    }

    .home-v2-hero__inner {
        flex: 1 1 auto;
        height: 100%;
        max-height: 100%;
        min-height: 0;
        overflow: hidden;
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    }

    .home-v2-hero__main {
        flex: 1 1 auto;
        display: flex;
        flex-direction: column;
        min-height: 0;
        overflow: hidden;
    }

    .home-v2-hero__intro h1 {
        font-size: 1.35rem;
    }

    .home-v2-hero__search {
        flex: 0 0 auto;
    }

    .home-v2-hero-cats__cols {
        flex: 1 1 auto;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        overflow: hidden;
        align-items: stretch;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: minmax(0, 1fr);
    }

    .home-v2-hero-cats__col--desk {
        display: none !important;
    }

    /*
     * Независимые вертикальные карусели:
     * отступ от поиска, 4 ряда, бесконечный скролл + мягкая автодоводка (JS).
     * CSS scroll-snap ОТКЛЮЧЁН — он дергает при отпускании вместе с loop.
     */
    .home-v2-hero-cats {
        flex: 0 0 auto;
        margin-top: 1.85rem; /* заметный отступ от поиска */
        height: calc(var(--hero-chip-h) * 4 + var(--hero-chip-gap) * 3 + 0.7rem);
        max-height: calc(var(--hero-chip-h) * 4 + var(--hero-chip-gap) * 3 + 0.7rem);
        overflow: hidden;
    }

    .home-v2-hero-cats__cols {
        height: 100%;
        max-height: 100%;
    }

    .home-v2-hero-cats__col--carousel {
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
        overflow-x: hidden;
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
        touch-action: pan-y;
        scrollbar-width: none;
        padding: 0.15rem 0.15rem 0.25rem;
        isolation: isolate;
        scroll-snap-type: none;
        mask-image: linear-gradient(
            to bottom,
            transparent 0,
            #000 6%,
            #000 94%,
            transparent 100%
        );
        -webkit-mask-image: linear-gradient(
            to bottom,
            transparent 0,
            #000 6%,
            #000 94%,
            transparent 100%
        );
    }

    .home-v2-hero-cats__col--carousel::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    /* Во время жеста/инерции — без анимаций (иначе «дёрганье» при остановке) */
    .home-v2-hero-cats__col--carousel.is-scrolling .home-v2-hero-cats__chip,
    .home-v2-hero-cats__col--carousel.is-jumping .home-v2-hero-cats__chip {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }

    .home-v2-hero-cats__chip {
        opacity: 1;
        transform: none;
        filter: none;
        transform-origin: center center;
        transition:
            opacity 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            transform 0.4s cubic-bezier(0.22, 1, 0.36, 1),
            filter 0.3s ease,
            background-color 0.15s ease,
            border-color 0.15s ease;
    }

    /* Лёгкий settle-эффект только после остановки (не при скролле) */
    .home-v2-hero-cats__col--carousel.is-settled .home-v2-hero-cats__chip:not(.is-inview) {
        opacity: 0.45;
        transform: scale(0.97);
        filter: blur(0.6px);
    }

    .home-v2-hero-cats__col--carousel.is-settled .home-v2-hero-cats__chip.is-inview {
        opacity: 1;
        transform: scale(1);
        filter: none;
    }

    .home-v2-hero-cats__chip:active {
        transform: scale(0.97);
    }

    .home-v2-hero-roles {
        flex: 0 0 auto;
        margin-top: 0.65rem;
    }

    .home-v2-hero-roles a {
        padding: 0.65rem 0.7rem;
    }
}

@media (min-width: 640px) {
    .home-v2-hero {
        --hero-cats-max: 36rem;
    }

    .home-v2-hero__inner {
        flex: 0 1 auto;
        min-height: 0;
        overflow: visible;
    }

    .home-v2-hero__main {
        overflow: visible;
    }

    .home-v2-hero-cats {
        overflow: visible;
        flex: 0 0 auto;
        height: auto;
        max-height: none;
        margin-top: 1.75rem;
    }

    .home-v2-hero-cats__cols {
        max-width: var(--hero-cats-max);
        flex: 0 0 auto;
        height: auto;
        overflow: visible;
    }

    .home-v2-hero-cats__col,
    .home-v2-hero-cats__col--carousel {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
        mask-image: none !important;
        -webkit-mask-image: none !important;
        padding: 0;
        scroll-snap-type: none;
    }

    .home-v2-hero-cats__track {
        gap: var(--hero-chip-gap);
    }

    .home-v2-hero-cats__col--desk {
        display: none;
    }

    /* С ≥640px третья колонка ещё скрыта — не дублируем её чипы в A/B */
    .home-v2-hero-cats__chip--mobile-extra {
        display: none !important;
    }

    .home-v2-hero-cats__chip {
        opacity: 1;
        transform: none;
        filter: none;
        scroll-snap-align: none;
        transition: background-color 0.15s ease, border-color 0.15s ease;
    }
}

@media (min-width: 1024px) {
    .home-v2-hero {
        --hero-cats-max: 42rem;
        justify-content: center;
        height: auto;
        max-height: none;
        overflow: visible;
        min-height: calc(100dvh - var(--site-header-h));
        min-height: calc(100svh - var(--site-header-h));
    }

    .home-v2-hero__inner {
        flex: 1 1 auto;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        height: auto;
        max-height: none;
        overflow: visible;
    }

    .home-v2-hero-roles {
        width: 24rem;
        flex-shrink: 0;
    }

    .home-v2-hero-cats__cols {
        grid-template-columns: 1fr 1fr 1fr;
        max-width: var(--hero-cats-max);
        gap: 0.625rem;
    }

    .home-v2-hero-cats__col--desk {
        display: flex;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-v2-hero-cats__chip {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
}

/* Совместимость со старым preview-классом (если кэш) */
.home-preview-hero {
    background-color: #1d4ed8;
    background-image: linear-gradient(to bottom right, #2563eb, #1d4ed8, #1e3a8a);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: calc(100dvh - var(--site-header-h));
    min-height: calc(100svh - var(--site-header-h));
}

.home-preview-hero__inner {
    flex: 1 1 auto;
    width: 100%;
}

@media (min-width: 1024px) {
    .home-preview-hero-roles {
        width: 24rem;
        flex-shrink: 0;
    }
}

/* Address suggest list — в потоке, над клавиатурой через scroll */
.address-suggest-list {
    -webkit-overflow-scrolling: touch;
}

.hero-section {
    min-height: calc(100dvh - var(--site-header-h));
    min-height: calc(100svh - var(--site-header-h));
    display: flex;
    flex-direction: column;
}

.hero-section__inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1.5rem 1rem 1.5rem;
}

@media (min-width: 640px) {
    .hero-section__inner {
        padding: 1.75rem 1.5rem 2rem;
    }
}

@media (min-width: 1024px) {
    .hero-section__inner {
        padding: 2rem 1.5rem 2.25rem;
    }
}

@media (max-height: 680px) {
    .hero-section__inner {
        padding-top: 0.875rem;
        padding-bottom: 1rem;
    }
    .hero-section .hero-cta-panel {
        margin-top: 1.25rem !important;
    }
}

/* Hero CTA-карточки */
.hero-cta-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    overflow: hidden;
    border-radius: 1.125rem;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: var(--surface-pure);
    padding: 0.8125rem 0.875rem;
    text-align: left;
    box-shadow:
        0 8px 20px -6px rgba(0, 0, 0, 0.14),
        0 0 0 1px rgba(255, 255, 255, 0.28);
    transition:
        transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.25s ease,
        border-color 0.2s ease;
}

.hero-cta-card__content {
    position: relative;
    z-index: 1;
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.hero-cta-card__badge {
    display: block;
    max-width: 100%;
    overflow: hidden;
    border-radius: 0.375rem;
    padding: 0.125rem 0.4375rem;
    font-size: 0.625rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-transform: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hero-cta-card__badge.bg-emerald-100,
.hero-cta-card__badge.bg-amber-100,
.hero-cta-card__badge.bg-orange-100,
.hero-cta-card__badge.bg-sky-100 {
    box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.hero-cta-card__title {
    display: block;
    width: 100%;
    font-size: 0.9375rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111827;
}

.hero-cta-card__subtitle {
    display: -webkit-box;
    width: 100%;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 0.6875rem;
    font-weight: 500;
    line-height: 1.4;
    color: #6b7280;
}

.hero-cta-card__arrow {
    position: relative;
    z-index: 1;
    align-self: center;
    flex-shrink: 0;
}

.hero-cta-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.38);
    box-shadow:
        0 14px 28px -8px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(255, 255, 255, 0.42);
}

.hero-cta-card:active {
    transform: translateY(0) scale(0.985);
}

/* Главная CTA — акцент как слово «специалистов» в заголовке Hero (accent green) */
.hero-cta-card--primary {
    border: 2px solid rgba(74, 222, 128, 0.5);
    background: linear-gradient(145deg, #ffffff 0%, #f0fdf4 42%, #ffffff 100%);
    box-shadow:
        0 16px 36px -12px rgba(34, 197, 94, 0.28),
        0 0 0 1px rgba(255, 255, 255, 0.55),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

.hero-cta-card--primary:hover {
    transform: translateY(-3px);
    border-color: rgba(134, 239, 172, 0.85);
    box-shadow:
        0 22px 40px -12px rgba(34, 197, 94, 0.36),
        0 0 0 2px rgba(74, 222, 128, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 1);
}

.hero-cta-card--primary .hero-cta-card__glow {
    background: rgba(134, 239, 172, 0.45) !important;
    opacity: 0.65;
}

.hero-cta-card--primary .hero-cta-card__title {
    font-size: 1.0625rem;
    font-weight: 800;
    letter-spacing: -0.015em;
    color: #111827;
}

.hero-cta-card__icon--accent,
.hero-cta-card--primary .hero-cta-card__icon {
    background: linear-gradient(135deg, #86efac 0%, #4ade80 45%, #22c55e 100%) !important;
    color: #14532d;
    box-shadow: 0 6px 16px -4px rgba(22, 163, 74, 0.4);
}

.hero-cta-card__arrow--accent {
    align-self: center;
    flex-shrink: 0;
    transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 1px 2px rgba(34, 197, 94, 0.35));
}

.hero-cta-card--primary:hover .hero-cta-card__arrow--accent {
    transform: translateX(3px);
}

.hero-cta-card--primary:hover .hero-cta-card__icon {
    transform: scale(1.08);
}

.hero-cta-card__cta-pill {
    position: relative;
    z-index: 1;
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    align-self: center;
    gap: 0;
}

.hero-cta-card__cta-pill-label {
    display: none;
}

.hero-cta-card__glow {
    position: absolute;
    right: 0;
    top: 0;
    height: 4rem;
    width: 4rem;
    transform: translate(33%, -33%);
    border-radius: 9999px;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.hero-cta-card:hover .hero-cta-card__glow {
    opacity: 1;
}

.hero-cta-card__icon {
    position: relative;
    display: flex;
    height: 2.625rem;
    width: 2.625rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    border-radius: 0.625rem;
    color: #fff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.hero-cta-card:hover .hero-cta-card__icon {
    transform: scale(1.06);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

@media (min-width: 640px) {
    .hero-cta-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
        padding: 1rem 1.125rem 1.125rem;
        min-height: 9.25rem;
        border-radius: 1.25rem;
    }

    .hero-cta-card__content {
        gap: 0.3125rem;
        width: 100%;
    }

    .hero-cta-card__badge {
        font-size: 0.6875rem;
        padding: 0.1875rem 0.5rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
    }

    .hero-cta-card__title {
        font-size: 1rem;
    }

    .hero-cta-card__subtitle {
        font-size: 0.8125rem;
        -webkit-line-clamp: 3;
    }

    .hero-cta-card__icon {
        height: 2.5rem;
        width: 2.5rem;
    }
}

/* Hero — primary закреплён на mobile, пресеты — вертикальный scroll; сетка на desktop */
.hero-cta-panel {
    --hero-cta-row-h: 5.25rem;
    --hero-cta-gap: 0.625rem;
    position: relative;
    width: 100%;
    max-width: 72rem;
    margin-left: auto;
    margin-right: auto;
    margin-top: 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.hero-cta-panel__primary {
    flex-shrink: 0;
}

.hero-cta-panel__presets-label {
    margin: 0.625rem 0 0.4375rem;
    text-align: center;
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.72);
}

.hero-cta-panel__presets-label::before,
.hero-cta-panel__presets-label::after {
    content: '';
    display: inline-block;
    vertical-align: middle;
    width: 2rem;
    height: 1px;
    margin: 0 0.5rem;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.28));
}

.hero-cta-panel__presets-label::after {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.28), transparent);
}

.hero-cta-panel__presets {
    position: relative;
    flex-shrink: 1;
    min-height: 0;
    --hero-cta-marquee-duration: 32s;
}

.hero-cta-panel__marquee {
    overflow: hidden;
    max-height: calc(3.35 * var(--hero-cta-row-h) + 2.35 * var(--hero-cta-gap));
    -webkit-mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 10%,
        #000 90%,
        transparent 100%
    );
    mask-image: linear-gradient(
        to bottom,
        transparent 0%,
        #000 10%,
        #000 90%,
        transparent 100%
    );
}

.hero-cta-panel__presets--marquee .hero-cta-panel__marquee {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: auto;
    scrollbar-width: none;
    touch-action: pan-y;
}

.hero-cta-panel__presets--marquee .hero-cta-panel__marquee::-webkit-scrollbar {
    display: none;
}

.hero-cta-panel__marquee-track {
    display: flex;
    flex-direction: column;
}

.hero-cta-panel__list {
    display: flex;
    flex-direction: column;
    gap: var(--hero-cta-gap);
    flex-shrink: 0;
    padding: 0.125rem 0;
}

.hero-cta-panel__item {
    flex-shrink: 0;
    scroll-snap-align: start;
}

.hero-cta-panel__item .hero-cta-card {
    min-height: var(--hero-cta-row-h);
    width: 100%;
}

.hero-cta-panel__fade {
    pointer-events: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2.25rem;
    background: linear-gradient(to bottom, transparent, rgba(30, 58, 138, 0.55));
    border-radius: 0 0 0.75rem 0.75rem;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.hero-cta-panel__presets:not(:has(.hero-cta-panel__item:nth-child(4))) .hero-cta-panel__fade {
    opacity: 0;
}

/* Без primary — пресеты занимают всю высоту как раньше */
.hero-cta-panel:not(:has(.hero-cta-panel__primary)) .hero-cta-panel__marquee {
    max-height: calc(4.35 * var(--hero-cta-row-h) + 3.35 * var(--hero-cta-gap));
}

@media (prefers-reduced-motion: reduce) {
    .hero-cta-panel__presets--marquee .hero-cta-panel__marquee {
        overflow-y: auto;
        scroll-snap-type: y proximity;
        scroll-behavior: smooth;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hero-cta-panel__marquee-track > .hero-cta-panel__list[aria-hidden="true"] {
        display: none;
    }
}

@media (max-width: 639px) {
    .hero-cta-panel__item .hero-cta-card:has(.hero-cta-card__badge) {
        min-height: calc(var(--hero-cta-row-h) + 0.5rem);
    }

    .hero-cta-panel {
        margin-top: 1.25rem;
    }
}

@media (min-width: 640px) {
    .hero-cta-panel {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.875rem;
    }

    .hero-cta-panel__presets-label,
    .hero-cta-panel__fade {
        display: none;
    }

    .hero-cta-panel__primary {
        width: 100%;
        max-width: 42rem;
        margin-inline: auto;
    }

    .hero-cta-panel__primary .hero-cta-card--primary {
        flex-direction: row;
        align-items: center;
        gap: 1rem;
        min-height: 0;
        padding: 0.9375rem 1rem 0.9375rem 1.125rem;
        border-radius: 1rem;
    }

    .hero-cta-panel__primary .hero-cta-card--primary .hero-cta-card__content {
        flex: 1;
        min-width: 0;
    }

    .hero-cta-panel__primary .hero-cta-card--primary .hero-cta-card__title {
        display: -webkit-box;
        font-size: 1.0625rem;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .hero-cta-panel__primary .hero-cta-card--primary .hero-cta-card__subtitle {
        font-size: 0.8125rem;
        -webkit-line-clamp: 1;
    }

    .hero-cta-panel__primary .hero-cta-card__arrow--accent path {
        stroke: #ffffff;
    }

    .hero-cta-panel__primary .hero-cta-card--primary .hero-cta-card__icon {
        height: 3rem;
        width: 3rem;
        border-radius: 0.75rem;
    }

    .hero-cta-panel__primary .hero-cta-card__cta-pill {
        margin-left: auto;
        gap: 0.375rem;
        padding: 0.5rem 0.875rem 0.5rem 1rem;
        border-radius: 9999px;
        background: linear-gradient(135deg, #4ade80 0%, #22c55e 55%, #16a34a 100%);
        box-shadow:
            0 4px 14px -3px rgba(22, 163, 74, 0.45),
            inset 0 1px 0 rgba(255, 255, 255, 0.25);
        transition: transform 0.22s ease, box-shadow 0.22s ease;
    }

    .hero-cta-panel__primary .hero-cta-card__cta-pill-label {
        display: inline;
        font-size: 0.8125rem;
        font-weight: 700;
        letter-spacing: 0.01em;
        color: #fff;
        white-space: nowrap;
    }

    .hero-cta-panel__primary .hero-cta-card--primary:hover .hero-cta-card__cta-pill {
        transform: translateX(2px);
        box-shadow:
            0 6px 18px -3px rgba(22, 163, 74, 0.5),
            inset 0 1px 0 rgba(255, 255, 255, 0.3);
    }

    .hero-cta-panel__presets {
        display: block;
    }

    .hero-cta-panel__marquee {
        display: block;
        max-height: none;
        overflow: visible;
        -webkit-mask-image: none;
        mask-image: none;
    }

    .hero-cta-panel__marquee-track {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
        animation: none;
    }

    .hero-cta-panel__marquee-track > .hero-cta-panel__list[aria-hidden="true"] {
        display: none;
    }

    .hero-cta-panel__list {
        display: contents;
        padding: 0;
    }

    .hero-cta-panel__item .hero-cta-card {
        min-height: 9.25rem;
    }
}

@media (min-width: 1024px) {
    .hero-cta-panel__primary {
        max-width: 46rem;
    }

    .hero-cta-panel__marquee-track {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

/* --- Variant B (default): усиленная primary-карточка на mobile --- */
@media (max-width: 639px) {
    .hero-cta-panel--variant-b .hero-cta-panel__primary .hero-cta-card--primary {
        min-height: calc(var(--hero-cta-row-h) + 0.35rem);
    }

    .hero-cta-panel--variant-b .hero-cta-panel__primary .hero-cta-card--primary .hero-cta-card__title {
        font-size: 1.125rem;
    }
}

/* --- Variant A: accent-кнопка primary + компактные пресеты --- */
@media (max-width: 639px) {
    .hero-cta-panel--variant-a .hero-cta-panel__presets-label::before,
    .hero-cta-panel--variant-a .hero-cta-panel__presets-label::after {
        width: 1.25rem;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card {
        flex-direction: row;
        align-items: center;
        gap: 0.875rem;
        min-height: 3.375rem;
        padding: 0.875rem 1rem;
        border: none;
        background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 48%, #d97706 100%);
        box-shadow:
            0 10px 24px -6px rgba(180, 83, 9, 0.45),
            0 0 0 1px rgba(255, 255, 255, 0.22) inset;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card__glow,
    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card__arrow {
        display: none;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card__icon {
        height: 2.25rem;
        width: 2.25rem;
        border-radius: 0.5rem;
        background: rgba(255, 255, 255, 0.22) !important;
        box-shadow: none;
        color: #fff;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card__title {
        font-size: 1.0625rem;
        color: #fff;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card__subtitle {
        color: rgba(255, 255, 255, 0.88);
        -webkit-line-clamp: 1;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__primary .hero-cta-card:active {
        transform: scale(0.985);
        box-shadow:
            0 6px 16px -4px rgba(180, 83, 9, 0.4),
            0 0 0 1px rgba(255, 255, 255, 0.18) inset;
    }

    .hero-cta-panel--variant-a {
        --hero-cta-row-h: 4.75rem;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__presets .hero-cta-card {
        padding: 0.6875rem 0.75rem;
    }

    .hero-cta-panel--variant-a .hero-cta-panel__presets .hero-cta-card__subtitle {
        -webkit-line-clamp: 1;
    }
}

/* --- Variant C: glass primary + tray для пресетов --- */
@media (max-width: 639px) {
    .hero-cta-panel--variant-c .hero-cta-panel__presets-label {
        display: none;
    }

    .hero-cta-panel--variant-c .hero-cta-panel__primary .hero-cta-card {
        background: rgba(255, 255, 255, 0.94);
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
        border-color: rgba(255, 255, 255, 0.42);
        box-shadow:
            0 10px 26px -8px rgba(0, 0, 0, 0.2),
            inset 0 1px 0 rgba(255, 255, 255, 0.65);
    }

    .hero-cta-panel--variant-c .hero-cta-panel__presets {
        margin-top: 0.625rem;
        padding: 0.375rem;
        border-radius: 1.125rem;
        background: rgba(0, 0, 0, 0.12);
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
    }

    .hero-cta-panel--variant-c .hero-cta-panel__fade {
        border-radius: 0 0 0.875rem 0.875rem;
        background: linear-gradient(to bottom, transparent, rgba(15, 23, 42, 0.45));
    }
}

@media (min-width: 640px) {
    .hero-cta-panel--variant-c .hero-cta-panel__presets {
        margin-top: 0;
        padding: 0;
        border-radius: 0;
        background: transparent;
        backdrop-filter: none;
        box-shadow: none;
    }
}

/* Quick-order pages: без подвала, плавный скролл к форме из hero */
html:has(body.page-quick-order) {
    scroll-behavior: smooth;
}

body.page-quick-order {
    min-height: 100dvh;
}

body.page-quick-order main {
    padding-bottom: 1.25rem;
}

.order-form-section {
    scroll-margin-top: 4.5rem;
}

/* Быстрые разделы — hero (custom.css, без сборки Tailwind) */

/* Общая колонка: всё по центру (helper, property-care, spec, welding, pc) */
.section-hero__content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

.section-hero__title {
    width: 100%;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

.section-hero__subtitle {
    width: 100%;
    max-width: 42rem;
    margin-left: auto;
    margin-right: auto;
    text-wrap: pretty;
}

.section-hero__badge {
    max-width: min(100%, 36rem);
    justify-content: center;
    text-align: center;
    text-wrap: balance;
}

.section-hero__stats {
    width: 100%;
    max-width: 36rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-left: auto;
    margin-right: auto;
}

@media (min-width: 480px) {
    .section-hero__stats {
        grid-template-columns: repeat(auto-fit, minmax(7.25rem, 1fr));
        gap: 0.625rem;
    }
}

.section-hero__stat {
    display: flex;
    min-height: 3.75rem;
    min-width: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.section-hero__stat-value,
.section-hero__stat-label {
    width: 100%;
    text-wrap: balance;
}

.section-hero-form-cta {
    position: relative;
    z-index: 2;
    align-self: center;
    margin-top: 1.5rem;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    .section-hero-form-cta {
        margin-top: 2rem;
    }
}

.welding-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #431407 0%, #9a3412 42%, #450a0a 100%);
}

.pc-repair-hero {
    position: relative;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 48%, #1e1b4b 100%);
}

.quick-hero__glow {
    position: absolute;
    border-radius: 9999px;
    pointer-events: none;
    filter: blur(64px);
}

.quick-hero__glow--tr {
    top: -4rem;
    right: -2rem;
    width: 18rem;
    height: 18rem;
    background: rgba(251, 191, 36, 0.14);
}

.welding-hero .quick-hero__glow--bl {
    bottom: -3rem;
    left: -2rem;
    width: 14rem;
    height: 14rem;
    background: rgba(220, 38, 38, 0.12);
}

.pc-repair-hero .quick-hero__glow--tr {
    background: rgba(34, 211, 238, 0.12);
}

.pc-repair-hero .quick-hero__glow--bl {
    bottom: -3rem;
    left: -2rem;
    width: 14rem;
    height: 14rem;
    background: rgba(99, 102, 241, 0.12);
}

.tool-rental-hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #4c1d95 0%, #5b21b6 45%, #6d28d9 100%);
    color: #fff;
}

.tool-rental-hero .quick-hero__glow--tr {
    background: rgba(196, 181, 253, 0.14);
}

.tool-rental-hero .quick-hero__glow--bl {
    bottom: -3rem;
    left: -2rem;
    width: 14rem;
    height: 14rem;
    background: rgba(167, 139, 250, 0.12);
}

.quick-hero__accent--tool-rent {
    color: #c4b5fd;
}

body.dash-drawer-open {
    overflow: hidden;
}

.quick-hero__inner {
    position: relative;
    max-width: 56rem;
    margin: 0 auto;
    padding: 2.5rem 1rem 3.5rem;
}

@media (max-width: 359px) {
    .quick-hero__inner {
        padding: 2rem 0.875rem 3rem;
    }

    .quick-hero__title,
    .section-hero__title {
        font-size: 1.625rem;
        line-height: 1.2;
    }

    .quick-hero__badge,
    .section-hero__badge {
        font-size: 0.8125rem;
        padding: 0.35rem 0.75rem;
    }

    .section-hero__stats {
        gap: 0.375rem;
    }
}

@media (min-width: 640px) {
    .quick-hero__inner {
        padding: 3rem 1.5rem 4rem;
    }
}

@media (min-width: 1024px) {
    .quick-hero__inner {
        padding: 3.5rem 1.5rem 4.5rem;
    }
}

.quick-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(6px);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.92);
}

.quick-hero__title {
    font-size: 1.875rem;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .quick-hero__title {
        font-size: 2.25rem;
    }
}

@media (min-width: 1024px) {
    .quick-hero__title {
        font-size: 3rem;
    }
}

.quick-hero__accent--welding {
    color: #fbbf24;
}

.quick-hero__accent--pc {
    color: #67e8f9;
}

.quick-hero__subtitle {
    margin-bottom: 2rem;
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.82);
}

@media (min-width: 640px) {
    .quick-hero__subtitle {
        font-size: 1.125rem;
    }
}

.quick-hero__stats {
    /* layout: .section-hero__stats */
}

@media (min-width: 640px) {
    .quick-hero__stats {
        gap: 0.75rem;
    }
}

.quick-hero__stat {
    padding: 0.625rem 0.5rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(4px);
}

@media (min-width: 640px) {
    .quick-hero__stat {
        padding: 0.75rem;
    }
}

.quick-hero__stat-value {
    font-size: 1.125rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff;
}

@media (min-width: 640px) {
    .quick-hero__stat-value {
        font-size: 1.5rem;
    }
}

.quick-hero__stat-label {
    margin-top: 0.15rem;
    font-size: 0.625rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.72);
}

@media (min-width: 640px) {
    .quick-hero__stat-label {
        font-size: 0.75rem;
    }
}

.quick-hero__wave {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    color: var(--surface-page);
    line-height: 0;
}

.quick-hero__wave svg {
    display: block;
    width: 100%;
    height: 2rem;
}

@media (min-width: 640px) {
    .quick-hero__wave svg {
        height: 3rem;
    }
}

.hero-scroll-hint {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.25rem;
    margin-left: auto;
    margin-right: auto;
    height: 2rem;
    width: 2rem;
    border-radius: 9999px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
    animation: float 3s ease-in-out infinite;
}

.hero-scroll-hint:hover {
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    transform: translateY(2px);
}

@media (min-width: 640px) {
    .hero-scroll-hint {
        margin-top: 1.5rem;
    }
}

/* ---------- Секции главной: единый ритм отступов ---------- */
.home-section {
    padding-top: 2.25rem;
    padding-bottom: 2.25rem;
}

@media (min-width: 640px) {
    .home-section {
        padding-top: 3rem;
        padding-bottom: 3rem;
    }
}

@media (min-width: 1024px) {
    .home-section {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }
}

/* ---------- Ограничение строк ---------- */
.line-clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.line-clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Анимации ---------- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}
@keyframes slideInRight {
    from { opacity: 0; transform: translateX(30px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse-soft {
    0%, 100% { opacity: 1; }
    50%      { opacity: .65; }
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-8px); }
}
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
@keyframes countUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.animate-fadeInUp      { animation: fadeInUp .6s ease-out both; }
.animate-fadeIn        { animation: fadeIn .5s ease-out both; }
.animate-slideInRight  { animation: slideInRight .5s ease-out both; }
.animate-pulse-soft    { animation: pulse-soft 2s ease-in-out infinite; }
.animate-float         { animation: float 3s ease-in-out infinite; }
.animate-countUp       { animation: countUp .6s ease-out both; }

.delay-100 { animation-delay: .1s; }
.delay-200 { animation-delay: .2s; }
.delay-300 { animation-delay: .3s; }
.delay-400 { animation-delay: .4s; }
.delay-500 { animation-delay: .5s; }

/* ---------- Скроллбар ---------- */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #d1d5db; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

/* ---------- Фокус ---------- */
:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Карточки ---------- */
.card {
    transition: box-shadow .3s ease, transform .3s ease, border-color .3s ease;
}

/* ---------- Градиентный текст ---------- */
.text-gradient {
    background: linear-gradient(135deg, #2563eb 0%, #16a34a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ---------- Skeleton ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-muted) 25%, var(--surface-border) 50%, var(--surface-muted) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: 8px;
}

/* ---------- Стеклянный эффект ---------- */
.glass {
    background: color-mix(in srgb, var(--surface-elevated) 82%, transparent);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
}

/* ---------- Мобильное меню (overlay-панель) ---------- */
.mobile-menu-overlay {
    transition: opacity .25s ease;
}
.mobile-menu-panel {
    transition: transform .3s cubic-bezier(.4,0,.2,1);
}
.mobile-menu-root {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
}

/* Flash-сообщения: не обрезаются на 320px */
.flash-messages-wrap {
    max-width: 100%;
    overflow-x: clip;
}
.flash-message {
    word-break: break-word;
    overflow-wrap: anywhere;
}

/* Hero CTA: без горизонтального overflow на узких экранах */
.hero-cta-panel {
    overflow-x: clip;
    max-width: 100%;
}
.hero-cta-panel__marquee {
    max-width: 100%;
}
@media (max-width: 374px) {
    .hero-cta-card__title {
        font-size: 0.9rem;
    }
    .hero-cta-card__subtitle {
        font-size: 0.7rem;
    }
    .hero-cta-panel__presets-label {
        font-size: 0.625rem;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
    }
}

/* Отдельный чат (не ЛК): full-height на mobile */
@media (max-width: 1023px) {
    body:not(.chats-page) main > section.chat-page-root,
    body:not(.chats-page) main section:has(#chat-messages) {
        min-height: calc(100dvh - 3.5rem);
    }
}

/* ---------- Категория: hover-подсветка ---------- */
.category-card {
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 100%, rgba(37,99,235,.06), transparent 70%);
    opacity: 0;
    transition: opacity .3s;
}
.category-card:hover::before { opacity: 1; }

/* ---------- Счётчик шагов ---------- */
.step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px; height: 36px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37,99,235,.25);
}

/* ---------- Разделительная линия шагов ---------- */
.step-connector {
    position: absolute;
    top: 18px;
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
    height: 2px;
    background: linear-gradient(90deg, #bfdbfe, #bbf7d0);
}

/* ---------- Адаптив: таблицы ---------- */
@media (max-width: 640px) {
    table         { font-size: 13px; }
    table th,
    table td      { padding: 8px 10px; }

    .responsive-table-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

/* ---------- Адаптив: 320 px ---------- */
@media (max-width: 374px) {
    .btn-primary, .btn-secondary, .btn-accent { padding-left: 1rem; padding-right: 1rem; font-size: .875rem; }
    h1 { font-size: 1.5rem !important; }
    .card { border-radius: 0.75rem; }
    .input-field { padding: .625rem .75rem; font-size: .875rem; }
}

/* ---------- Разделы заявок: WhatsApp-style SVG-фоны ---------- */
.section-doodle-bg,
.helper-doodle-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.section-doodle-bg__svg,
.helper-doodle-bg__svg {
    display: block;
    width: 100%;
    height: 100%;
}
.section-doodle-bg--hero,
.helper-doodle-bg--hero {
    mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 72%, transparent 100%);
}
.section-doodle-bg--form,
.helper-doodle-bg--form {
    opacity: 0.85;
    mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
}
#order-create-page .section-doodle-bg--form {
    opacity: 1;
    mask-image: none;
    -webkit-mask-image: none;
}
.helper-submit-btn {
    background: linear-gradient(135deg, #44403c 0%, #292524 100%);
    box-shadow: 0 10px 24px -8px rgba(28, 25, 23, 0.45);
}
.helper-submit-btn:hover {
    background: linear-gradient(135deg, #57534e 0%, #1c1917 100%);
}

/* ---------- Степпер «+ / −» (форма подсобника и др.) ---------- */
.helper-stepper {
    display: grid;
    grid-template-columns: 2.75rem minmax(0, 1fr) 2.75rem;
    align-items: stretch;
    min-height: 3rem;
    overflow: hidden;
    border-radius: 0.75rem;
    background: var(--surface-pure);
}
@media (min-width: 640px) {
    .helper-stepper { min-height: 3.25rem; }
}
.helper-stepper__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.15s, color 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
}
.helper-stepper__btn:active { transform: scale(0.92); }
.helper-stepper__btn--violet { color: #7c3aed; }
.helper-stepper__btn--violet:hover { background: #f5f3ff; }
.helper-stepper__btn--emerald { color: #059669; }
.helper-stepper__btn--emerald:hover { background: #ecfdf5; }
.helper-stepper__btn--slate { color: #57534e; }
.helper-stepper__btn--slate:hover { background: #f5f5f4; }
.helper-stepper__value {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 0 0.25rem;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    font-size: 1.25rem;
    line-height: 1;
    color: #111827;
}
@media (min-width: 640px) {
    .helper-stepper__value { font-size: 1.5rem; }
}
.helper-stepper--violet { border: 1px solid #ddd6fe; }
.helper-stepper--violet .helper-stepper__value { border-left: 1px solid #ede9fe; border-right: 1px solid #ede9fe; }
.helper-stepper--emerald { border: 1px solid #a7f3d0; }
.helper-stepper--emerald .helper-stepper__value { border-left: 1px solid #d1fae5; border-right: 1px solid #d1fae5; }
.helper-stepper--slate { border: 1px solid #e7e5e4; }
.helper-stepper--slate .helper-stepper__value { border-left: 1px solid #f5f5f4; border-right: 1px solid #f5f5f4; color: #292524; }
.helper-stepper input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
.helper-stepper input[type="number"]::-webkit-outer-spin-button,
.helper-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
@media (max-width: 639px) {
    .helper-stepper {
        grid-template-columns: 3rem minmax(0, 1fr) 3rem;
        min-height: 3.125rem;
    }
    .helper-stepper__btn {
        min-height: 3.125rem;
    }
    .district-picker {
        min-width: 0;
        max-width: 100%;
    }
    .district-picker input[type="text"],
    .district-picker select,
    .district-picker__select {
        font-size: 1rem;
    }
}

/* ---------- Горизонтальный скролл-навигация (моб.) ---------- */
.scrollbar-hide { -ms-overflow-style: none; scrollbar-width: none; }
.scrollbar-hide::-webkit-scrollbar { display: none; }

/* ---------- Touch-friendly ---------- */
@media (hover: none) {
    .card:hover { transform: none !important; }
    .btn-primary:hover,
    .btn-secondary:hover { transform: none !important; }
}

/* ---------- Печать ---------- */
@media print {
    nav, footer, .btn-primary, .btn-secondary, .scroll-to-top { display: none !important; }
    .card { box-shadow: none !important; border: 1px solid #e5e7eb !important; }
    body { background: #fff !important; }
}

/* ---------- Создание заявки: только меню + форма на весь экран ----------
   Перебиваем Tailwind min-h-screen (100vh): в PWA standalone 100vh > видимая
   область — body растягивается, #order-wizard-nav уезжает вниз (см. chats-page). */
html.page-create-order,
body.page-create-order {
    min-height: var(--zu-vh, 100svh) !important;
    min-height: var(--zu-vh, 100dvh) !important;
    height: var(--zu-vh, 100svh) !important;
    height: var(--zu-vh, 100dvh) !important;
    max-height: var(--zu-vh, 100dvh) !important;
    overflow: hidden;
    background: var(--surface-page);
}
body.page-create-order {
    display: flex;
    flex-direction: column;
}
body.page-create-order nav {
    flex-shrink: 0;
}
body.page-create-order > main {
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    height: calc(var(--zu-vh, 100dvh) - var(--zu-site-nav-h, 3.5rem));
    max-height: calc(var(--zu-vh, 100dvh) - var(--zu-site-nav-h, 3.5rem));
}
body.page-create-order #order-create-page,
body.page-create-order .order-create-wrap,
body.page-create-order #order-create-card,
body.page-create-order #order-create-form,
body.page-create-order #order-wizard-body {
    min-height: 0;
}
body.page-create-order #order-create-page {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    overflow-x: clip;
}
body.page-create-order .order-create-wrap {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
body.page-create-order #order-create-card {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
body.page-create-order #order-create-form {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}
body.page-create-order #order-wizard-body {
    flex: 1 1 0;
    min-height: 0;
    overflow-x: clip;
    overflow-y: auto;
    position: relative;
    -webkit-overflow-scrolling: touch;
}
body.page-create-order #order-create-card,
body.page-create-order #order-wizard-body {
    overflow-x: clip;
}
body.page-create-order #order-wizard-body > [id^="order-section-"] {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
/* Неактивные шаги (absolute на sm+) не перехватывают клики */
@media (min-width: 640px) {
    body.page-create-order #order-wizard-body > [id^="order-section-"][style*="display: none"],
    body.page-create-order #order-wizard-body > [id^="order-section-"][hidden] {
        pointer-events: none !important;
    }
    body.page-create-order #order-wizard-body > [id^="order-section-"]:not([style*="display: none"]) {
        z-index: 2;
    }
}
/* Поля и списки подсказок — запас снизу под «Далее» + клавиатуру */
body.page-create-order #order-wizard-body input,
body.page-create-order #order-wizard-body textarea,
body.page-create-order #order-wizard-body select,
body.page-create-order #order-wizard-body .district-picker,
body.page-create-order #order-wizard-body .address-suggest,
body.page-create-order #order-wizard-body .service-suggest,
body.page-create-order #order-wizard-body .district-picker ul[role="listbox"],
body.page-create-order #order-wizard-body .address-suggest-list,
body.page-create-order #order-wizard-body .service-suggest-list {
    scroll-margin-top: 0.75rem;
    scroll-margin-bottom: calc(var(--zu-wizard-nav-h, 5rem) + 1.25rem);
}
/* Suggest-списки: высота под оставшееся место над nav/клавиатурой (--zu-suggest-max-h из JS) */
body.page-create-order #order-wizard-body .address-suggest-list,
body.page-create-order #order-wizard-body .service-suggest-list,
body.page-create-order #order-wizard-body .district-picker ul[role="listbox"],
body.page-create-order #order-wizard-body .district-picker__list {
    max-height: min(15rem, var(--zu-suggest-max-h, 15rem));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}
@media (min-width: 640px) {
    body.page-create-order #order-wizard-body .address-suggest-list,
    body.page-create-order #order-wizard-body .service-suggest-list {
        max-height: min(16rem, var(--zu-suggest-max-h, 16rem));
    }
}
/* Район/адрес: текст не вылезает за край, caret внутри поля */
body.page-create-order #order-wizard-body .district-picker,
body.page-create-order #order-wizard-body .address-suggest,
body.page-create-order #order-wizard-body .service-suggest {
    min-width: 0;
    max-width: 100%;
    overflow: visible;
}
body.page-create-order #order-wizard-body .district-picker__control,
body.page-create-order #order-wizard-body .address-suggest__control,
body.page-create-order #order-wizard-body .service-suggest__control {
    min-width: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
}
body.page-create-order #order-wizard-body .district-picker__input,
body.page-create-order #order-wizard-body .address-suggest__input,
body.page-create-order #order-wizard-body .service-suggest__control .input-field {
    min-width: 0 !important;
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    text-overflow: clip;
    white-space: nowrap;
}

.district-picker__select {
    -webkit-appearance: none;
    appearance: none;
    background-image: none;
    position: relative;
    z-index: 1;
    pointer-events: auto;
}
body.page-create-order #order-wizard-body .district-picker__select {
    overflow: visible !important;
    white-space: normal;
    pointer-events: auto !important;
}
/* ---------- Create-order: Quiet Focus ----------
   Рамка только на chrome поля (data-zu-field), не на весь блок со списком.
   Закрытие: «Готово», Enter, blur, select.
   Mobile Focus Stage: см. блок ниже (без #zu-field-focus-scrim). */
body.page-create-order #order-wizard-body {
    isolation: isolate;
}
#zu-field-focus-scrim {
    display: none !important;
}
body.page-create-order .zu-field-shell {
    position: relative;
    z-index: 1;
    border-radius: 0.75rem;
    transition: box-shadow 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}
body.page-create-order.zu-field-focus .zu-spotlight-dim {
    opacity: 0.78;
    transition: opacity 0.15s ease;
}
/* Обычные поля — лёгкая подсветка */
body.page-create-order.zu-field-focus .zu-field-shell.is-focused {
    z-index: 6;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.28);
}
/* Chrome района/адреса уже имеет свою рамку — без второй «коробки» */
body.page-create-order.zu-field-focus .district-picker__control.zu-field-shell.is-focused,
body.page-create-order.zu-field-focus .address-suggest__control.zu-field-shell.is-focused,
body.page-create-order.zu-field-focus .service-suggest__control.zu-field-shell.is-focused {
    z-index: 6;
    background: #fff;
    box-shadow: none;
}
body.page-create-order.zu-field-focus .district-picker__control.zu-field-shell.is-focused {
    border-color: #3b82f6;
}
@media (max-width: 639px) {
    body.page-create-order.zu-field-focus .zu-field-shell.is-focused > label,
    body.page-create-order.zu-field-focus .zu-field-shell.is-focused > legend,
    body.page-create-order.zu-field-focus .zu-field-shell.is-focused > h2 {
        padding-right: 0;
    }
    body.page-create-order.zu-field-focus .district-picker:has(.is-focused) > label,
    body.page-create-order.zu-field-focus .address-suggest:has(.is-focused) > label,
    body.page-create-order.zu-field-focus .service-suggest:has(.is-focused) > label {
        padding-right: 0;
        color: #1e3a8a;
    }
    /* Picker — позиционирующий контекст только для списка, не для «Готово». */
    body.page-create-order.zu-field-focus .district-picker:has(.is-focused),
    body.page-create-order.zu-field-focus .address-suggest:has(.is-focused),
    body.page-create-order.zu-field-focus .service-suggest:has(.is-focused) {
        position: relative;
    }
}
body.page-create-order.zu-field-focus .zu-field-shell.is-focused > label,
body.page-create-order.zu-field-focus .zu-field-shell.is-focused > legend,
body.page-create-order.zu-field-focus .zu-field-shell.is-focused > h2 {
    color: #1e3a8a;
}
/* Чип «Готово» — закрыть поле и убрать фокус-режим */
#zu-field-done-chip {
    display: none;
    position: absolute;
    top: -0.15rem;
    right: 0;
    z-index: 8;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 999px;
    background: #2563eb;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
body.page-create-order.zu-field-focus .zu-field-shell.is-focused #zu-field-done-chip {
    display: inline-flex;
}
    /* Для picker чип также находится в потоке сразу после control. */
@media (max-width: 639px) {
    body.page-create-order.zu-field-focus .district-picker > #zu-field-done-chip,
    body.page-create-order.zu-field-focus .address-suggest > #zu-field-done-chip,
    body.page-create-order.zu-field-focus .service-suggest > #zu-field-done-chip {
        display: inline-flex;
        top: auto;
        right: auto;
    }
}
@media (min-width: 640px) {
    body.page-create-order.zu-field-focus .zu-field-shell.is-focused #zu-field-done-chip {
        display: none;
    }
}
/* Focus ring только у «настоящих» input-field — не у прозрачного input в district */
body.page-create-order #order-wizard-body input.input-field:focus,
body.page-create-order #order-wizard-body select:focus,
body.page-create-order #order-wizard-body textarea:focus {
    border-color: #60a5fa !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    outline: none;
}
body.page-create-order #order-wizard-body .district-picker input:focus,
body.page-create-order #order-wizard-body .district-picker__input:focus {
    border-color: transparent !important;
    box-shadow: none !important;
    outline: none !important;
}
body.page-create-order #order-wizard-body textarea:focus {
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
@media (prefers-reduced-motion: reduce) {
    body.page-create-order .zu-field-shell,
    body.page-create-order.zu-field-focus .zu-spotlight-dim {
        transition: none !important;
    }
}

/* ---------- Create-order: Focus Stage (mobile only) ----------
   Скрываем/блюрим неактивный UI без absolute scrim-overlay.
   Активный корень — .is-focus-stage-root (поле + in-flow suggest). */
@media (max-width: 639px) {
    body.page-create-order.zu-focus-stage {
        background: #eaf2ff;
    }
    body.page-create-order.zu-focus-stage > nav {
        display: none !important;
    }
    body.page-create-order.zu-focus-stage > main {
        height: var(--zu-vh, 100dvh);
        max-height: var(--zu-vh, 100dvh);
    }
    body.page-create-order.zu-focus-stage #order-create-page,
    body.page-create-order.zu-focus-stage .order-create-wrap,
    body.page-create-order.zu-focus-stage #order-create-card,
    body.page-create-order.zu-focus-stage #order-create-form {
        background: rgba(226, 238, 255, 0.94);
    }
    body.page-create-order.zu-focus-stage .order-create-wrap {
        padding-top: 0;
        padding-bottom: 0;
    }
    body.page-create-order.zu-focus-stage #order-create-card {
        border-color: rgba(96, 165, 250, 0.3);
        border-radius: 0;
        box-shadow: none;
    }
    body.page-create-order.zu-focus-stage #order-wizard-body {
        background:
            radial-gradient(circle at 50% 0%, rgba(147, 197, 253, 0.34), transparent 68%),
            rgba(226, 238, 255, 0.96);
        scroll-padding-top: max(0.5rem, env(safe-area-inset-top));
    }
    body.page-create-order.zu-focus-stage #order-wizard-chrome {
        display: none;
        opacity: 0;
        pointer-events: none;
        user-select: none;
    }
    body.page-create-order.zu-focus-stage .order-step-heading {
        display: none !important;
    }
    body.page-create-order.zu-focus-stage .zu-focus-stage-hide {
        opacity: 0.2 !important;
        filter: blur(5px) saturate(0.8);
        pointer-events: none !important;
        user-select: none;
        transition: opacity 0.15s ease, filter 0.15s ease;
    }
    body.page-create-order.zu-focus-stage #order-wizard-body > [id^="order-section-"] {
        padding-top: max(0.5rem, env(safe-area-inset-top));
        padding-bottom: 0.75rem;
    }
    body.page-create-order.zu-focus-stage .is-focus-stage-root {
        position: relative;
        z-index: 12;
        opacity: 1 !important;
        filter: none !important;
        pointer-events: auto !important;
        visibility: visible !important;
        background: rgba(255, 255, 255, 0.98);
        border-radius: 1rem;
        box-shadow:
            0 0 0 1px rgba(59, 130, 246, 0.25),
            0 18px 48px rgba(30, 64, 175, 0.2);
        padding: 0.85rem 0.85rem 0.9rem;
        margin-left: -0.2rem;
        margin-right: -0.2rem;
    }
    body.page-create-order.zu-focus-stage .is-focus-stage-root .zu-spotlight-dim {
        opacity: 1;
        filter: none;
        pointer-events: auto;
    }
    /* Nav в потоке — приглушён, не fixed; после blur поля снова кликабелен */
    body.page-create-order.zu-focus-stage #order-wizard-nav {
        opacity: 0.14;
        pointer-events: none;
        filter: blur(6px) saturate(0.8);
        transition: opacity 0.15s ease, filter 0.15s ease;
    }
    body.page-create-order.zu-focus-stage.zu-kb-open #order-wizard-nav {
        opacity: 0.1;
    }
    body.page-create-order.zu-focus-stage .is-focus-stage-root #zu-field-done-chip,
    body.page-create-order.zu-focus-stage .is-focus-stage-root > #zu-field-done-chip {
        pointer-events: auto;
    }
    body.page-create-order.zu-focus-stage .zu-field-shell.is-focused > label,
    body.page-create-order.zu-focus-stage .zu-field-shell.is-focused > legend,
    body.page-create-order.zu-focus-stage .zu-field-shell.is-focused > h2,
    body.page-create-order.zu-focus-stage .address-suggest:has(.is-focused) > label,
    body.page-create-order.zu-focus-stage .service-suggest:has(.is-focused) > label {
        min-height: 0;
        padding-right: 0;
        margin-bottom: 0.35rem;
        color: #1e3a8a;
    }
    #zu-field-done-chip {
        position: static;
        top: auto;
        right: auto;
        width: 100%;
        min-width: 0;
        min-height: 3rem;
        margin-top: 0.75rem;
        margin-bottom: 0.25rem;
        padding: 0 1rem;
        border: 1px solid rgba(255, 255, 255, 0.5);
        border-radius: 0.8rem;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        font-size: 0.875rem;
        font-weight: 800;
        box-shadow: 0 7px 18px rgba(37, 99, 235, 0.3);
        touch-action: manipulation;
    }
    #zu-field-done-chip::before {
        content: "✓";
        margin-right: 0.4rem;
        font-size: 1rem;
        line-height: 1;
    }
    #zu-field-done-chip:active {
        transform: translateY(1px);
        box-shadow: 0 3px 10px rgba(37, 99, 235, 0.26);
    }
    body.page-create-order.zu-field-focus .address-suggest > #zu-field-done-chip,
    body.page-create-order.zu-field-focus .service-suggest > #zu-field-done-chip {
        top: auto;
        right: auto;
    }
}
@media (max-width: 639px) and (prefers-reduced-motion: reduce) {
    body.page-create-order.zu-focus-stage #order-wizard-chrome,
    body.page-create-order.zu-focus-stage .order-step-heading,
    body.page-create-order.zu-focus-stage .zu-focus-stage-hide,
    body.page-create-order.zu-focus-stage #order-wizard-nav {
        transition: none !important;
        filter: none !important;
    }
    body.page-create-order.zu-focus-stage #order-wizard-chrome,
    body.page-create-order.zu-focus-stage .order-step-heading,
    body.page-create-order.zu-focus-stage .zu-focus-stage-hide {
        opacity: 0.12 !important;
    }
}

/* На мобиле секции не должны быть scroll-container: overflow-x:hidden
   ломает touch-скролл родителя (#order-wizard-body) на длинных пресетах. */
@media (max-width: 639px) {
    body.page-create-order #order-wizard-body {
        overflow-x: clip;
        overflow-y: auto !important;
        touch-action: pan-y;
    }
    body.page-create-order #order-wizard-body > [id^="order-section-"] {
        overflow: visible !important;
        height: auto !important;
        max-height: none !important;
    }
    /* Клавиатура: скрыть шапку без анимации высоты (иначе main/nav дёргаются) */
    body.page-create-order.zu-kb-open > nav {
        display: none !important;
    }
}
body.page-create-order #order-wizard-nav {
    flex-shrink: 0;
    position: relative;
    z-index: 45;
    background: rgba(249, 250, 251, 0.98);
    backdrop-filter: blur(8px);
    /* Не fixed: иначе WebKit клипы внутри overflow:hidden и «Далее» не нажимается */
}
/* На мобиле панель «Далее» непрозрачная — не «просвечивает» как фон поверх textarea */
@media (max-width: 639px) {
    body.page-create-order #order-wizard-nav {
        background: #f9fafb;
        backdrop-filter: none;
        border-top: 1px solid #e5e7eb;
        box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
        padding-left: max(0.75rem, env(safe-area-inset-left));
        padding-right: max(0.75rem, env(safe-area-inset-right));
        padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}
body.page-create-order #order-create-form input,
body.page-create-order #order-create-form select,
body.page-create-order #order-create-form textarea {
    font-size: 1rem;
}
body.page-create-order .order-step-label {
    display: none;
}
body.page-create-order footer,
body.page-create-order .scroll-to-top {
    display: none !important;
}

/* ---------- Scene Wizard: полноэкранный режим (mobile + desktop) ---------- */
body.page-create-order.zu-scene-mode > nav {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    overflow: hidden !important;
    pointer-events: none !important;
}
body.page-create-order.zu-scene-mode {
    --zu-site-nav-h: 0px;
    background: #f4f7fb;
}
body.page-create-order.zu-scene-mode > main {
    height: var(--zu-vh, 100dvh) !important;
    max-height: var(--zu-vh, 100dvh) !important;
}
body.page-create-order.zu-scene-mode .order-create-wrap {
    max-width: 42rem;
    width: 100%;
}
body.page-create-order.zu-scene-mode #order-create-card {
    border-color: #dbeafe;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 18px 55px rgba(30, 64, 175, 0.1);
}
body.page-create-order.zu-scene-mode #order-wizard-chrome {
    border-color: #dbeafe;
    background: rgba(255, 255, 255, 0.96);
    padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
}
body.page-create-order.zu-scene-mode #order-wizard-chrome > *,
body.page-create-order.zu-scene-mode #order-wizard-nav > *,
body.page-create-order.zu-scene-mode #order-wizard-body > .order-scene {
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
}
body.page-create-order.zu-scene-mode #order-wizard-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding-bottom: 1.25rem;
    overflow-y: auto !important;
    background:
        radial-gradient(circle at 50% 0%, rgba(219, 234, 254, 0.48), transparent 46%),
        #fff;
}
body.page-create-order.zu-scene-mode .order-scene {
    box-sizing: border-box;
    width: 100%;
    max-width: 36rem;
    margin-left: auto;
    margin-right: auto;
    padding: 0.25rem 0 1rem;
}
body.page-create-order.zu-scene-mode .order-scene-title {
    margin: 0 0 1rem;
    font-size: clamp(1.25rem, 2.5vw, 1.5rem);
    font-weight: 800;
    line-height: 1.25;
    color: #1c1917;
    text-align: center;
    outline: none;
}
body.page-create-order.zu-scene-mode .order-scene .input-field,
body.page-create-order.zu-scene-mode .order-scene input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
body.page-create-order.zu-scene-mode .order-scene select,
body.page-create-order.zu-scene-mode .order-scene textarea {
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-height: 3.25rem;
    padding: 0.8rem 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.875rem;
    background: #fff;
    color: #1c1917;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
body.page-create-order.zu-scene-mode .order-scene textarea {
    min-height: 8.5rem;
    line-height: 1.55;
    resize: vertical;
}
body.page-create-order.zu-scene-mode .order-scene .order-contact-input {
    padding-left: 3.25rem !important;
}
body.page-create-order.zu-scene-mode .order-scene input:focus,
body.page-create-order.zu-scene-mode .order-scene select:focus,
body.page-create-order.zu-scene-mode .order-scene textarea:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14) !important;
    outline: none;
}
body.page-create-order.zu-scene-mode .order-choice-card {
    border-color: #dbe3ef;
    background-color: #fff;
    color: #292524;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
body.page-create-order.zu-scene-mode .order-choice-card:hover {
    border-color: #93c5fd;
    background-color: #eff6ff;
}
body.page-create-order.zu-scene-mode .order-choice-card[aria-pressed="true"],
body.page-create-order.zu-scene-mode [role="radio"][aria-checked="true"] > .order-choice-card,
body.page-create-order.zu-scene-mode label.order-choice-card:has(input:checked) {
    border-color: #3b82f6;
    background-color: #eff6ff;
    color: #1e3a8a;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.14), 0 8px 20px rgba(37, 99, 235, 0.08);
}
body.page-create-order.zu-scene-mode .order-choice-card:focus-visible,
body.page-create-order.zu-scene-mode .order-chip:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.25);
    outline-offset: 2px;
}
body.page-create-order.zu-scene-mode .order-chip {
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
body.page-create-order.zu-scene-mode .order-chip:hover {
    border-color: #60a5fa;
    background: #dbeafe;
}
body.page-create-order.zu-scene-mode .service-suggest-list button:hover,
body.page-create-order.zu-scene-mode .service-suggest-list button:focus-visible {
    background: #eff6ff;
    color: #1e3a8a;
    outline: none;
}
body.page-create-order.zu-scene-mode .order-preview-card,
body.page-create-order.zu-scene-mode .order-upload-card {
    box-shadow: 0 10px 30px rgba(30, 64, 175, 0.07);
}
body.page-create-order.zu-scene-mode .order-scene button,
body.page-create-order.zu-scene-mode #order-wizard-nav button {
    min-width: 0;
    text-align: center;
    overflow-wrap: anywhere;
}
body.page-create-order.zu-scene-mode #order-wizard-nav {
    position: relative;
    z-index: 5;
    border-color: #dbeafe;
    background: #fff;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -10px 32px rgba(30, 64, 175, 0.07);
}
body.page-create-order.zu-scene-mode #order-wizard-nav button {
    min-height: 50px;
}
body.page-create-order.zu-scene-mode .order-primary-action:focus-visible,
body.page-create-order.zu-scene-mode .order-secondary-action:focus-visible {
    outline: 3px solid rgba(59, 130, 246, 0.25);
    outline-offset: 2px;
}
body.page-create-order.zu-scene-mode #zu-field-done-chip {
    display: none !important;
}
body.page-create-order.zu-scene-mode.zu-focus-stage #order-wizard-nav,
body.page-create-order.zu-scene-mode.zu-focus-stage.zu-kb-open #order-wizard-nav {
    opacity: 1;
    filter: none;
    pointer-events: auto;
    background: #fff;
}
body.page-create-order.zu-scene-mode.zu-focus-stage #order-wizard-chrome {
    display: block;
    opacity: 1;
    pointer-events: auto;
    user-select: auto;
    padding-top: max(0.5rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.5rem;
}
body.page-create-order.zu-scene-mode.zu-focus-stage #order-wizard-chrome h1 {
    display: none;
}
body.page-create-order.zu-scene-mode.zu-focus-stage .order-scene-title.zu-focus-stage-hide {
    opacity: 1 !important;
    filter: none !important;
    visibility: visible !important;
}
@media (max-width: 479px) {
    body.page-create-order.zu-scene-mode .order-create-wrap {
        padding: 0 !important;
    }
    body.page-create-order.zu-scene-mode #order-create-card {
        border-right: 0;
        border-left: 0;
        border-radius: 0;
    }
    body.page-create-order.zu-scene-mode #order-wizard-chrome,
    body.page-create-order.zu-scene-mode #order-wizard-body,
    body.page-create-order.zu-scene-mode #order-wizard-nav {
        padding-left: max(1rem, env(safe-area-inset-left, 0px));
        padding-right: max(1rem, env(safe-area-inset-right, 0px));
    }
}
@media (min-width: 640px) {
    body.page-create-order.zu-scene-mode > main {
        height: var(--zu-vh, 100dvh) !important;
        max-height: var(--zu-vh, 100dvh) !important;
        overflow: hidden !important;
    }
    body.page-create-order.zu-scene-mode #order-wizard-body {
        justify-content: center;
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
        overflow-y: auto !important;
    }
    body.page-create-order.zu-scene-mode .order-scene {
        padding-top: 0.5rem;
    }
}
@media (prefers-reduced-motion: reduce) {
    body.page-create-order.zu-scene-mode #order-wizard-chrome .transition-all,
    body.page-create-order.zu-scene-mode .order-scene {
        transition: none !important;
    }
}

@media (min-width: 640px) {
    body.page-create-order > main {
        height: auto;
        max-height: none;
    }
    body.page-create-order #order-wizard-body {
        overflow: hidden;
    }
}

@media (display-mode: standalone), (display-mode: fullscreen) {
    html.page-create-order,
    body.page-create-order {
        min-height: var(--zu-vh, 100dvh) !important;
        height: var(--zu-vh, 100dvh) !important;
        max-height: var(--zu-vh, 100dvh) !important;
    }
}

@media (max-width: 389px) {
    body.page-create-order #order-create-form #deadline {
        padding-left: 2.5rem;
    }
    body.page-create-order #order-create-form label[for="deadline"] + .relative > span {
        font-size: 0.75rem;
        left: 0.65rem;
    }
}

/* ---------- Создание заявки: компактные блоки на мобильном ---------- */
@media (max-width: 639px) {
    body.page-create-order .order-create-wrap {
        padding-top: 0;
        padding-bottom: 0;
    }
    body.page-create-order #order-create-card {
        border-radius: 0.75rem;
    }
    /* Nav в потоке flex (не fixed) — body уже = visualViewport над клавиатурой */
    body.page-create-order #order-wizard-body {
        padding-bottom: 0.75rem;
    }
    body.page-create-order #order-wizard-body > [id^="order-section-"] {
        position: relative !important;
        inset: auto !important;
        min-height: 0;
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
        background: transparent !important;
    }
    /* Гостевой блок (личный кабинет) — внутри шага 3 */
    body.page-create-order .order-guest-account-wrap > div {
        margin-top: 0 !important;
        padding-top: 0 !important;
        border-top: 0 !important;
    }
    body.page-create-order .order-guest-account-wrap > div > .flex.items-center.gap-3 {
        margin-bottom: 0.75rem !important;
    }
    body.page-create-order .order-guest-account-wrap > div > .flex.items-center.gap-3 .w-9.h-9 {
        width: 2rem !important;
        height: 2rem !important;
        border-radius: 0.625rem !important;
    }
    body.page-create-order .order-guest-account-wrap > div > .flex.items-center.gap-3 .w-9.h-9 svg {
        width: 1rem !important;
        height: 1rem !important;
    }
    body.page-create-order .order-guest-account-wrap > div > .flex.items-center.gap-3 h3 {
        font-size: 0.95rem !important;
    }
    body.page-create-order .order-guest-account-wrap > div > .flex.items-center.gap-3 p {
        display: none !important;
    }
    body.page-create-order .order-guest-account-wrap input {
        padding-top: 0.75rem !important;
        padding-bottom: 0.75rem !important;
    }
    body.page-create-order .order-guest-account-wrap .mb-4 { margin-bottom: 0.75rem !important; }
    body.page-create-order .order-guest-account-wrap .gap-4 { gap: 0.625rem !important; }
    body.page-create-order .order-guest-account-wrap label { margin-bottom: 0.375rem !important; }
    body.page-create-order .order-guest-account-wrap > div > p.mt-3 { margin-top: 0.625rem !important; }

    /* Шаг 4: компактный dropzone, чтобы умещался без скролла */
    body.page-create-order #order-section-4 .border-dashed > div.py-10,
    body.page-create-order #order-section-4 .border-dashed > div.py-12 {
        padding-top: 1.75rem !important;
        padding-bottom: 1.75rem !important;
    }
}

/* ---------- Safe-area для iOS ---------- */
@supports (padding: env(safe-area-inset-bottom)) {
    body.page-create-order #order-wizard-nav {
        padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    }
    footer { padding-bottom: calc(1rem + env(safe-area-inset-bottom)); }
}

/* ---------- Админка: компактный масштаб контента ----------
   Уменьшаем только область вкладок (.admin-content), боковое меню и
   мобильную навигацию не трогаем. zoom масштабирует и текст, и отступы
   пропорционально, поэтому адаптивная сетка не ломается. На мобильных
   (где контент и так стекается) масштаб остаётся 1. */
@media (min-width: 1024px) {
    .admin-content {
        zoom: 0.9;
    }
}
@media (min-width: 1536px) {
    .admin-content {
        zoom: 0.85;
    }
}
/* Fallback для браузеров без поддержки zoom (старый Firefox) —
   нормальный масштаб, без поломок верстки. */
@supports not (zoom: 1) {
    .admin-content {
        zoom: normal;
    }
}

/* ---------- Плавный переход при load ---------- */
body {
    opacity: 1;
}

/* ---------- Страница чатов: без скролла страницы на мобильных ---------- */
@media (max-width: 1023px) {
    /* Как page-create-order: html+body ровно visualViewport (--zu-vh в px). */
    html:has(body.chats-page),
    body.chats-page {
        overflow: hidden;
        min-height: var(--zu-vh, 100svh) !important;
        min-height: var(--zu-vh, 100dvh) !important;
        height: var(--zu-vh, 100svh) !important;
        height: var(--zu-vh, 100dvh) !important;
        max-height: var(--zu-vh, 100dvh) !important;
    }

    body.chats-page {
        display: flex !important;
        flex-direction: column !important;
        padding-bottom: 0 !important;
    }

    body.chats-page.zu-kb-open {
        padding-bottom: 0 !important;
    }

    body.chats-page > main {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        height: calc(var(--zu-vh, 100dvh) - var(--zu-site-nav-h, 3.5rem));
        max-height: calc(var(--zu-vh, 100dvh) - var(--zu-site-nav-h, 3.5rem));
    }

    body.chats-page .dash-shell--chats {
        flex: 1 1 0;
        min-height: 0 !important;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        padding-top: 0.25rem;
        padding-bottom: 0;
        border-bottom: none;
    }

    body.chats-page.chats-thread-open .dash-shell--chats {
        padding-top: 0;
    }

    body.chats-page .dash-shell--chats > .relative.mx-auto {
        flex: 1 1 0;
        min-height: 0;
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: none;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    body.chats-page.chats-thread-open .dash-shell--chats > .relative.mx-auto {
        padding-left: 0;
        padding-right: 0;
    }

    body.chats-page .dash-shell--chats > .relative.mx-auto > .flex.flex-col {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        gap: 0;
    }

    /* Колонка контента ЛК (после mobile-nav / aside) */
    body.chats-page .dash-shell--chats > .relative.mx-auto > .flex.flex-col > .min-w-0.flex-1 {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.chats-page.chats-thread-open .dash-mobile-nav {
        display: none !important;
    }

    body.chats-page .dash-chats-root {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
    }

    /* На мобильном grid → flex-колонка: единственная видимая колонка
       (список ИЛИ открытый диалог) занимает всю высоту, composer не
       уезжает за нижний край. */
    body.chats-page .dash-chats-grid {
        display: flex;
        flex-direction: column;
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        gap: 0;
    }

    body.chats-page .dash-chats-list-col,
    body.chats-page .dash-chats-panel-col {
        flex: 1 1 0;
        min-height: 0;
        overflow: hidden;
        display: flex;
        flex-direction: column;
    }

    body.chats-page .chat-widget--dock {
        flex: 1 1 0;
        min-height: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    body.chats-page.chats-thread-open .chat-widget--dock {
        border-left: 0;
        border-right: 0;
        border-bottom: 0;
        /* Место под fixed-composer */
        padding-bottom: var(--zu-chat-composer-h, 4.75rem);
    }

    /*
     * Composer: fixed к низу visualViewport (клавиатура / адресная строка).
     * sticky внутри overflow:hidden часто обрезается — fixed надёжнее.
     */
    body.chats-page.chats-thread-open .chat-widget--dock > .chat-composer {
        position: fixed;
        left: 0;
        right: 0;
        bottom: max(0px, var(--zu-keyboard-inset, 0px));
        z-index: 45;
        background: #fff;
        flex-shrink: 0;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
        padding-bottom: max(0.625rem, env(safe-area-inset-bottom, 0px));
    }

    /* Список диалогов (без open thread): composer не fixed */
    body.chats-page:not(.chats-thread-open) .chat-widget--dock > .chat-composer {
        position: sticky;
        bottom: 0;
        z-index: 20;
        background: #fff;
        flex-shrink: 0;
    }
}

@media (min-width: 1024px) {
    /* Десктоп ЛК: фиксированная высота колонок, скролл внутри чата */
    body.chats-page .dash-chats-grid {
        height: min(72vh, 680px);
        max-height: min(72vh, 680px);
        min-height: 420px;
    }

    body.chats-page .dash-chats-list-col,
    body.chats-page .dash-chats-panel-col {
        height: 100%;
        max-height: 100%;
        min-height: 0;
    }

    body.chats-page .dash-chats-list-col > div {
        height: 100%;
        max-height: 100%;
    }

    body.chats-page .dash-chats-list-col ul {
        max-height: none;
    }
}

/* Встроенный чат без dock (админка и др.): явный скролл ленты */
@media (min-width: 1024px) {
    .chat-widget:not(.chat-widget--dock) .chat-scroll-pane {
        max-height: min(48dvh, 460px) !important;
        min-height: 260px;
    }

    .admin-messages-layout .chat-widget:not(.chat-widget--dock) .chat-scroll-pane {
        max-height: min(36dvh, 380px) !important;
        min-height: 220px;
    }

    .admin-messages-layout {
        align-items: stretch;
    }

    .admin-messages-layout > div:first-child {
        max-height: min(72vh, 640px);
    }

    .admin-messages-layout > div:first-child .flex-1.overflow-y-auto {
        max-height: min(52dvh, 480px);
    }
}

/* ===== Admin shell PWA ===== */
.admin-shell-body {
    min-height: 100dvh;
}

.admin-shell-body--nav-open {
    overflow: hidden;
    overscroll-behavior: none;
}

.admin-drawer {
    position: fixed;
    inset: 0;
    z-index: 90;
    pointer-events: none;
    visibility: hidden;
}

.admin-drawer.is-open {
    pointer-events: auto;
    visibility: visible;
}

.admin-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.admin-drawer.is-open .admin-drawer__backdrop {
    opacity: 1;
}

.admin-drawer__panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(19.5rem, 88vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1c1917;
    box-shadow: 12px 0 32px rgba(15, 23, 42, 0.28);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    will-change: transform;
}

.admin-drawer.is-open .admin-drawer__panel {
    transform: translateX(0);
}

.admin-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 0.85rem 0.75rem;
    border-bottom: 1px solid #e8e4dd;
    flex-shrink: 0;
}

.admin-drawer__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.2;
}

.admin-drawer__sub {
    margin: 0.15rem 0 0;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
}

.admin-drawer__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 0.75rem;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    flex-shrink: 0;
}

.admin-drawer__close:hover {
    background: #e2e8f0;
}

.admin-drawer__nav {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0.55rem 1rem;
}

.admin-drawer__group {
    margin: 0.65rem 0.55rem 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #94a3b8;
}

.admin-drawer__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 44px;
    padding: 0.55rem 0.7rem;
    border-radius: 0.75rem;
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.admin-drawer__link:hover {
    background: #f8fafc;
    color: #0f172a;
}

.admin-drawer__link.is-active {
    background: #0f172a;
    color: #fff;
    font-weight: 600;
}

.admin-drawer__link.is-active .admin-drawer__icon {
    color: #fff;
}

.admin-drawer__link--muted {
    margin-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
    border-radius: 0.75rem 0.75rem 0 0;
    color: #94a3b8;
}

.admin-drawer__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    color: #94a3b8;
    flex-shrink: 0;
}

.admin-drawer__label {
    flex: 1;
    min-width: 0;
}

.admin-drawer__badge {
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    line-height: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.admin-topbar {
    overflow: visible;
}

.admin-topbar__icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    border-radius: 0.75rem;
    color: #cbd5e1;
    background: transparent;
    border: 0;
    cursor: pointer;
}

.admin-topbar__icon-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.admin-topbar__badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

.admin-topbar__user-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    max-width: 10rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.75rem;
    color: #e2e8f0;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
}

.admin-topbar__user-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.admin-topbar__avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    flex-shrink: 0;
}

.admin-topbar__user-meta {
    display: none;
    min-width: 0;
}

.admin-topbar__user-name {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-topbar__user-role {
    display: block;
    font-size: 10px;
    color: #94a3b8;
}

.admin-notif-panel,
.admin-user-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.35rem);
    z-index: 80;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #1c1917;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.22);
}

.admin-notif-panel {
    width: min(20rem, calc(100vw - 1.5rem));
    max-height: min(70vh, 24rem);
}

.admin-notif-panel__head {
    border-bottom: 1px solid #f1f5f9;
    padding: 0.55rem 0.85rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: #64748b;
}

.admin-notif-panel__list {
    max-height: min(60vh, 18rem);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.admin-notif-panel__empty {
    margin: 0;
    padding: 1rem 0.85rem;
    font-size: 0.875rem;
    color: #94a3b8;
}

.admin-notif-panel__item {
    display: block;
    padding: 0.7rem 0.85rem;
    border-bottom: 1px solid #f8fafc;
    text-decoration: none;
    color: inherit;
}

.admin-notif-panel__item:hover,
.admin-notif-panel__item.is-unread {
    background: #f8fafc;
}

.admin-notif-panel__title {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #0f172a;
    line-height: 1.35;
}

.admin-notif-panel__msg {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.admin-user-menu {
    width: 13rem;
    padding: 0.25rem 0;
}

.admin-user-menu__item {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 44px;
    padding: 0 0.85rem;
    border: 0;
    background: transparent;
    color: #334155;
    font-size: 0.875rem;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}

.admin-user-menu__item:hover {
    background: #f8fafc;
}

.admin-user-menu__item--danger {
    color: #dc2626;
}

.admin-user-menu__item--danger:hover {
    background: #fef2f2;
}

.admin-user-menu__form {
    border-top: 1px solid #f1f5f9;
    margin-top: 0.15rem;
    padding-top: 0.15rem;
}

#admin-pwa-install-banner {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 70;
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    bottom: calc(4.25rem + env(safe-area-inset-bottom));
}

.admin-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 0.25rem 0.35rem calc(0.35rem + env(safe-area-inset-bottom));
    background: #0f172a;
    border-top: 1px solid rgba(148, 163, 184, 0.25);
}

.admin-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.15rem;
    min-height: 3rem;
    width: 100%;
    padding: 0.35rem 0.25rem;
    border: 0;
    border-radius: 0.75rem;
    background: transparent;
    color: #94a3b8;
    font: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.admin-bottom-nav__item.is-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
}

.admin-bottom-nav__badge {
    position: absolute;
    top: -0.35rem;
    right: -0.55rem;
    min-width: 1rem;
    height: 1rem;
    padding: 0 0.25rem;
    border-radius: 999px;
    background: #ef4444;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    line-height: 1rem;
    text-align: center;
}

@media (max-width: 1023px) {
    .admin-notif-panel,
    .admin-user-menu {
        position: fixed;
        left: 0.75rem;
        right: 0.75rem;
        width: auto;
        top: calc(env(safe-area-inset-top, 0px) + 3.6rem);
    }

    .admin-user-menu {
        left: auto;
        width: min(13rem, calc(100vw - 1.5rem));
    }
}

@media (min-width: 640px) {
    .admin-topbar__user-meta {
        display: block;
    }

    .admin-topbar__user-btn {
        max-width: 14rem;
    }
}

@media (min-width: 1024px) {
    .admin-shell-main {
        padding-bottom: 0 !important;
    }

    #admin-pwa-install-banner {
        bottom: 1rem !important;
    }

    .admin-bottom-nav {
        display: none;
    }
}

/* ============================================================
   Registration Scene Wizard
   ============================================================ */
body.page-register {
    min-height: var(--zu-vh, 100dvh);
    overflow: hidden;
    background:
        radial-gradient(circle at 12% 8%, rgba(59, 130, 246, 0.12), transparent 34rem),
        radial-gradient(circle at 88% 92%, rgba(37, 99, 235, 0.09), transparent 30rem),
        #f5f8fc;
}

body.page-register > nav,
body.page-register > footer {
    display: none !important;
}

body.page-register > main {
    display: flex;
    min-height: 0;
    height: var(--zu-vh, 100dvh);
}

body.page-register .flash-messages-wrap {
    position: fixed;
    z-index: 80;
    top: max(0.75rem, env(safe-area-inset-top));
    left: 50%;
    width: min(92vw, 36rem);
    margin: 0;
    padding: 0;
    transform: translateX(-50%);
}

.register-wizard-shell {
    display: flex;
    min-width: 0;
    min-height: 0;
    width: 100%;
    padding: 1rem;
    align-items: center;
    justify-content: center;
}

.register-wizard-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    width: min(100%, 42rem);
    height: min(52rem, calc(var(--zu-vh, 100dvh) - 2rem));
    overflow: hidden;
    border: 1px solid rgba(203, 213, 225, 0.85);
    border-radius: 1.5rem;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.14);
}

.register-wizard-chrome {
    position: relative;
    z-index: 5;
    display: flex;
    min-height: 4.5rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1.25rem 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.96);
}

.register-icon-button {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 0.9rem;
    background: #fff;
    color: #334155;
    transition: border-color 160ms ease, color 160ms ease, background 160ms ease;
}

.register-icon-button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.register-wizard-body {
    min-height: 0;
    flex: 1 1 auto;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
}

.register-scene-axis {
    display: flex;
    min-height: 100%;
    align-items: center;
    justify-content: center;
}

.register-scene {
    width: min(100%, 36rem);
    margin: auto;
    padding: clamp(1.5rem, 4vh, 3rem) clamp(1rem, 4vw, 2rem);
}

.register-scene-title {
    margin: 0 auto;
    max-width: 32rem;
    color: #111827;
    font-size: clamp(1.55rem, 4vw, 2.15rem);
    font-weight: 800;
    line-height: 1.16;
    letter-spacing: -0.025em;
    text-align: center;
    text-wrap: balance;
}

.register-scene-lead {
    max-width: 31rem;
    margin: 0.8rem auto 1.5rem;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.55;
    text-align: center;
    text-wrap: balance;
}

.register-field-shell {
    width: min(100%, 30rem);
    margin-inline: auto;
}

.register-input,
body.page-register .register-scene select {
    width: 100%;
    min-height: 3.25rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.95rem;
    background: #f8fafc;
    padding: 0.78rem 1rem;
    color: #111827;
    font-size: 1rem;
    line-height: 1.35;
    outline: none;
    transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.register-input-icon {
    padding-left: 3.25rem !important;
}

.register-input:focus,
body.page-register .register-scene select:focus {
    border-color: #3b82f6;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.14);
}

.register-input[readonly] {
    cursor: default;
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.register-password-toggle {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    min-height: 2.25rem;
    padding: 0 0.5rem;
    transform: translateY(-50%);
    border-radius: 0.6rem;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
}

.register-choice-card {
    display: flex;
    min-height: 7.5rem;
    align-items: flex-start;
    gap: 0.9rem;
    padding: 1.1rem;
    border: 2px solid #e2e8f0;
    border-radius: 1.15rem;
    background: #fff;
    color: inherit;
    transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.register-choice-card:hover {
    border-color: #93c5fd;
    background: #f8fbff;
    transform: translateY(-1px);
}

.register-choice-card.is-active {
    border-color: #2563eb;
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.register-choice-icon {
    display: inline-flex;
    width: 2.75rem;
    height: 2.75rem;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    border-radius: 0.85rem;
    background: #eff6ff;
    font-size: 1.2rem;
}

.register-info-card {
    display: flex;
    width: min(100%, 30rem);
    margin-inline: auto;
    gap: 1rem;
    padding: 1.25rem;
    border: 1px solid #bfdbfe;
    border-radius: 1.15rem;
    background: linear-gradient(145deg, #eff6ff, #fff);
}

.register-consent-card {
    display: flex;
    min-height: 3.5rem;
    cursor: pointer;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.95rem;
    background: #f8fafc;
    color: #334155;
    font-size: 0.9rem;
    line-height: 1.45;
    transition: border-color 160ms ease, background 160ms ease;
}

.register-consent-card:hover {
    border-color: #93c5fd;
    background: #f0f7ff;
}

.register-legal-link {
    color: #2563eb;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: #bfdbfe;
    text-underline-offset: 2px;
}

.register-review-card {
    width: min(100%, 30rem);
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid #dbeafe;
    border-radius: 1.1rem;
    background: #f8fbff;
}

.register-review-card > div {
    display: grid;
    grid-template-columns: minmax(6rem, 0.8fr) minmax(0, 1.2fr);
    gap: 1rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e5edf8;
}

.register-review-card > div:last-child {
    border-bottom: 0;
}

.register-review-card dt {
    color: #64748b;
    font-size: 0.82rem;
    font-weight: 600;
}

.register-review-card dd {
    min-width: 0;
    overflow-wrap: anywhere;
    color: #172554;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: right;
}

.register-wizard-nav {
    z-index: 5;
    flex: 0 0 auto;
    padding: 0.8rem 1.25rem max(0.8rem, env(safe-area-inset-bottom));
    border-top: 1px solid #e5e7eb;
    background: rgba(255, 255, 255, 0.97);
}

.register-primary-action,
.register-secondary-action {
    display: inline-flex;
    min-height: 3rem;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 0.9rem;
    padding: 0.7rem 1rem;
    font-size: 0.95rem;
    font-weight: 750;
    transition: transform 150ms ease, background 150ms ease, opacity 150ms ease;
}

.register-primary-action {
    border: 1px solid #1d4ed8;
    background: #2563eb;
    color: #fff;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.22);
}

.register-primary-action:hover {
    background: #1d4ed8;
}

.register-primary-action:active {
    transform: scale(0.99);
}

.register-primary-action:disabled {
    cursor: wait;
    opacity: 0.65;
}

.register-secondary-action {
    min-width: 6.5rem;
    border: 1px solid #cbd5e1;
    background: #fff;
    color: #475569;
}

.register-secondary-action:hover {
    background: #f8fafc;
}

.register-spinner {
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.45);
    border-top-color: #fff;
    border-radius: 999px;
    animation: zu-register-spin 0.7s linear infinite;
}

@keyframes zu-register-spin {
    to {
        transform: rotate(360deg);
    }
}

body.page-register .register-scene [data-exec-cat-picker] {
    max-height: min(20rem, 45vh);
}

body.page-register .register-scene [data-exec-cat-picker] input {
    accent-color: #2563eb;
}

body.page-register .register-scene [data-exec-cat-picker] > div {
    border-color: #dbeafe;
}

@media (max-width: 639px) {
    .register-wizard-shell {
        padding: 0;
    }

    .register-wizard-card {
        width: 100%;
        height: var(--zu-vh, 100dvh);
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }

    .register-wizard-chrome {
        min-height: 4rem;
        padding: max(0.5rem, env(safe-area-inset-top)) 0.8rem 0.7rem;
    }

    .register-scene {
        padding: 1.25rem 1rem 1.5rem;
    }

    .register-scene-title {
        font-size: clamp(1.45rem, 7vw, 1.8rem);
    }

    .register-scene-lead {
        margin-bottom: 1.2rem;
    }

    .register-choice-card {
        min-height: 6rem;
        padding: 0.9rem;
    }

    .register-wizard-nav {
        padding: 0.65rem 0.8rem max(0.65rem, env(safe-area-inset-bottom));
    }

    .register-secondary-action {
        min-width: 5.5rem;
    }

    .register-input,
    body.page-register .register-scene select {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .register-choice-card,
    .register-primary-action,
    .register-input,
    body.page-register .register-scene select {
        transition: none;
    }

    .register-spinner {
        animation-duration: 1.4s;
    }
}
