/* Шаг 2 конфигуратора (6.3б, PDL-60): об автомобиле, галерея, миниатюры, форма с вкладками.
   Перенос CSS блока U6 (landing/docs/tilda-blocks/Ver_4_dev/u6-gallery.html:3–947): галерея, характеристики,
   вкладки, «По телефону», согласие; с 7.3 (план PDL-96) — мессенджеры «В чате» и «Где открыть MAX» (U6:412–528),
   вкладка «ЛК покупателя», подсказка у «Далее» и плашка сбоя (U6:621–846, 874–912). Убран лайтбокс (в U6 не
   открывался). Значения U6 подобраны под content-box — он и включается внутри #uc-gallery-custom
   (site.css ставит border-box всей странице). */
#uc-gallery-custom *, #uc-gallery-custom *::before, #uc-gallery-custom *::after { box-sizing: content-box; }
#uc-gallery-custom .uc-calc-input { box-sizing: border-box; }

#uc-gallery-custom {
    max-width: min(1000px, 85vw);
    margin: 0 auto;
    width: 100%;
    padding: 45px 0 0;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* Главное фото */
.gal-main {
    position: relative;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
    aspect-ratio: 3/2;
    border-radius: 12px;
    background: #f5f5f5;
    overflow: hidden;
    margin-bottom: 6px;
}

/* Swiper внутри главного фото */
.uc-gal-swiper {
    width: 100%;
    height: 100%;
}
.uc-gal-swiper .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}
.uc-gal-swiper .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Кнопки навигации поверх фото */
.gal-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 40px;
    border-radius: 8px;
    border: 0.5px solid rgba(255,255,255,0.6);
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    z-index: 2;
    transition: background 0.15s;
}
.gal-nav-btn:hover { background: rgba(255,255,255,0.28); }
.gal-nav-btn.prev { left: 12px; }
.gal-nav-btn.next { right: 12px; }

/* Миниатюры */
.gal-thumbs {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    width: 80%;
    margin-left: auto;
    margin-right: auto;
}
.gal-thumb {
    aspect-ratio: 3/2;
    border-radius: 6px;
    background: #f5f5f5;
    background-size: cover;
    background-position: center;
    border: 0.5px solid #e0e0e0;
    cursor: pointer;
    transition: border-color 0.15s;
}
/* .gal-thumb.active { border: 1.5px solid #111; } */
.gal-thumb:hover { border-color: #bbb; }

/* ================================================================
   КВИЗ ШАГ 2: ХАРАКТЕРИСТИКИ + NAV
================================================================ */
.uc-specs-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    padding-bottom: 20px;
    border-bottom: 0.5px solid #efefef;
    margin-bottom: 20px;
}
.uc-selection-title {
    font-family: Arial, sans-serif;
    font-size: 18px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 12px;
}
.uc-specs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.uc-spec-card {
    background: #f5f5f5;
    border-radius: 8px;
    padding: 8px 14px;
}
.uc-spec-value {
    font-family: Arial, sans-serif;
    font-size: 16px;
    font-weight: 500;
    color: #111111;
    margin-bottom: 2px;
}
.uc-spec-label {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #888888;
}

/* Nav-кнопки шага 2 скоупятся под #uc-gallery-custom: шаг 1 (cards.css) объявляет те же классы. */
#uc-gallery-custom .uc-quiz-btn-next {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    border-radius: 6px;
    cursor: pointer;
    padding: 13px 32px;
    /* --uc-btn-next-bg и --uc-btn-next-text ставит шаблон site.html из оформления марки (PDL-360). */
    background: var(--uc-btn-next-bg, #2D5467);
    color: var(--uc-btn-next-text, #ffffff);
    border: none;
    white-space: nowrap;
}
/* nowrap: иначе «← НАЗАД» ломается на две строки на узких экранах */
#uc-gallery-custom .uc-quiz-btn-back {
    font-family: Arial, sans-serif;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.08em;
    border-radius: 6px;
    cursor: pointer;
    padding: 13px 24px;
    background: transparent;
    color: #1a1a1a;
    border: 0.5px solid #d0d0d0;
    white-space: nowrap;
}
/* Hover светлее базового на +10.4 пункта светлоты (та же дельта, что была
   у пары #1a1a1a → #333333); тон и насыщенность базового сохранены.
   Цвет кнопки намеренно отвязан от акцента #51565C плашки и плиток. */
#uc-gallery-custom .uc-quiz-btn-next:hover {
    background: var(--uc-btn-next-bg-hover, #3C728D);
}
#uc-gallery-custom .uc-quiz-btn-back:hover {
    border-color: #888888;
    background: #f8f8f8;
}

/* Обёртка для выравнивания контента (совпадает с .configurator в cards.css) */
.configurator {
    max-width: min(1000px, 85vw);
    margin: 0 auto;
}

@media (max-width: 640px) {
    #uc-gallery-custom { max-width: 100%; padding-top: 30px; }
    .configurator { padding: 0 8px; max-width: 100%; }
    .uc-specs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
    .uc-specs::-webkit-scrollbar { display: none; }
    .uc-spec-card { flex-shrink: 0; border-radius: 7px; padding: 6px 11px; }
    .uc-spec-value { font-size: 15px; white-space: nowrap; }
    .uc-spec-label { font-size: 13px; white-space: nowrap; }

    /* Фейды для горизонтального скролла пиллсов */
    .uc-specs-scroll-wrap { position: relative; }
    .uc-specs-scroll-wrap::before,
    .uc-specs-scroll-wrap::after {
        content: '';
        position: absolute;
        top: 0;
        width: 36px;
        height: 100%;
        pointer-events: none;
        z-index: 1;
        transition: opacity 0.18s;
        opacity: 0;
    }
    .uc-specs-scroll-wrap::before {
        left: 0;
        background: linear-gradient(to left, transparent, #fff);
    }
    .uc-specs-scroll-wrap::after {
        right: 0;
        background: linear-gradient(to right, transparent, #fff);
    }
    .uc-specs-scroll-wrap.show-left::before  { opacity: 1; }
    .uc-specs-scroll-wrap.show-right::after  { opacity: 1; }
}

/* ================================================================
   АДАПТИВ
================================================================ */
@media (max-width: 640px) {
    .gal-main {
        width: 100vw;
        margin-left: calc((100% - 100vw) / 2);
        border-radius: 0;
    }
    .gal-nav-btn { width: 24px; height: 36px; border-radius: 6px; font-size: 14px; }
    .gal-thumbs { gap: 4px; width: 100%; margin-left: 0; margin-right: 0; }
    .gal-thumb { border-radius: 5px; }
}

/* ================================================================
   СЕКЦИЯ «РАСЧЁТ ЦЕНЫ» — ниже .gal-thumbs
   Спецификация из макета Шаг_3_-_Спецификация.html
================================================================ */
.uc-calc-section {
    margin-top: 20px;
    border-top: 0.5px solid #efefef;
    padding: 20px 0 45px;
}
/* Заголовок-«мостик» — как .bridge шага 1, но со своими классами и без отступа 28px. */
.uc-calc-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 0;
    margin-bottom: 10px;
}
.uc-calc-bridge-bar {
    width: 3px;
    height: 18px;
    background: #1a1a1a;
    border-radius: 2px;
    flex-shrink: 0;
}
.uc-calc-bridge-text {
    font-family: Arial, sans-serif;
    font-size: 18px;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
/* Вкладки «Способ связи»: таб-бар сверху + общее тело активной вкладки снизу,
   единая рамка на весь блок (замена прежних раздельных карточек-кнопок). */
.uc-calc-tabs {
    position: relative;      /* якорь для затухания таб-бара на мобайле */
    border: 0.5px solid #e0e0e0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    margin-bottom: 32px;
}
.uc-calc-tabbar {
    display: flex;
    background: #fafafa;
    border-bottom: 0.5px solid #e0e0e0;
    /* Три вкладки шире контейнера уже на планшете (641–990 px) — бар
       прокручивается на любой ширине; при запасе места прокрутки нет. */
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.uc-calc-tabbar::-webkit-scrollbar { display: none; }
.uc-calc-method-btn { flex-shrink: 0; }
.uc-calc-tabbar__filler { flex: 1; min-width: 0; }
.uc-calc-method-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    text-align: left;
    padding: 16px 22px;
    font-family: Arial, sans-serif;
    background: #fafafa;
    border: none;
    border-right: 0.5px solid #e0e0e0;
    margin-bottom: -0.5px;
    position: relative;
    cursor: pointer;
    transition: background 0.15s;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
.uc-calc-method-btn--narrow { min-width: 230px; }
.uc-calc-method-btn:hover { background: #f1f1f1; }
.uc-calc-method-btn.uc-calc-method-btn--active {
    background: #fff;
    box-shadow: inset 0 3px 0 #1a1a1a;
}
.uc-calc-method-btn.uc-calc-method-btn--active:hover { background: #fff; }
.uc-calc-method-emoji { font-size: 24px; line-height: 1; flex-shrink: 0; }
.uc-calc-method-name { display: block; font-size: 15px; font-weight: 600; color: #7a7a7a; }
.uc-calc-method-btn.uc-calc-method-btn--active .uc-calc-method-name { color: #1a1a1a; }
.uc-calc-method-desc { display: block; font-size: 12px; color: #8a8a8a; line-height: 1.45; }
.uc-calc-tabpanel { padding: 26px 24px 28px; background: #fff; }
.uc-calc-phone-section { margin-bottom: 0; }
.uc-calc-phone-hint {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #8a8a8a;
    margin: 0 0 18px;
    line-height: 1.5;
}
.uc-calc-phone-row { display: flex; gap: 16px; }
.uc-calc-phone-field { flex: 1; }
.uc-calc-phone-label {
    display: block;
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #888;
    margin-bottom: 5px;
}
.uc-calc-input {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid #e6e6e6;
    border-radius: 8px;
    font-family: Arial, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
    background: #fff;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
}
.uc-calc-input:focus { border-color: #1a1a1a; }
.uc-calc-input.uc-calc-input--error { border-color: #d00; }
.uc-calc-agreements { margin-top: 20px; margin-bottom: 0; }
.uc-calc-agr-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    cursor: pointer;
    font-family: Arial, sans-serif;
    font-size: 13px;
    color: #6a6a6a;
    line-height: 1.55;
}
.uc-calc-agr-item:last-child { margin-bottom: 0; }
.uc-calc-agr-check {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 1.5px solid #c4c4c4;
    border-radius: 4px;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s;
    margin-top: 1px;
    cursor: pointer;
}
.uc-calc-agr-item.uc-agr-checked .uc-calc-agr-check { border-color: #1a1a1a; }
/* Отказ из-за неотмеченного согласия. Скоупим под #uc-gallery-custom
   (правило про склейку CSS блоков из CLAUDE.md) и ставим ниже правила
   .uc-agr-checked: отмеченный пункт ошибочным не бывает, но если
   классы всё же окажутся вместе, красная рамка должна победить. */
#uc-gallery-custom .uc-calc-agr-item--error .uc-calc-agr-check { border-color: #d00; }
.uc-calc-agr-check::after {
    content: '';
    display: none;
    width: 11px;
    height: 6px;
    border-left: 2px solid #1a1a1a;
    border-bottom: 2px solid #1a1a1a;
    transform: rotate(-45deg) translateY(-2px);
}
.uc-calc-agr-item.uc-agr-checked .uc-calc-agr-check::after { display: block; }
.uc-calc-agr-text { flex: 1; }
.uc-calc-agr-text a { color: #8a8a8a; text-decoration: underline; text-underline-offset: 2px; }
.uc-calc-agr-text a:hover { color: #1a1a1a; }
/* Ссылки на попапы «Политика» и «Согласие» (site.js открывает <dialog> по data-dialog) */
#uc-gallery-custom .uc-calc-agr-text .link {
    background: none; border: 0; padding: 0; font: inherit; color: #8a8a8a; cursor: pointer;
    text-decoration: underline; text-underline-offset: 2px;
}
#uc-gallery-custom .uc-calc-agr-text .link:hover { color: #1a1a1a; }
/* Итог отправки: «Спасибо! Заявка принята», «Предпросмотр: заявка не создаётся», «Слишком много попыток». */
.uc-calc-result {
    display: none; margin-top: 16px; padding: 14px 16px; border-radius: 10px;
    background: #f5f5f5; border: 0.5px solid #e0e0e0;
    font-family: Arial, sans-serif; font-size: 14px; line-height: 1.5; color: #1a1a1a;
}
.uc-calc-result.--visible { display: block; }
.uc-calc-result b { display: block; }
.uc-calc-result a { color: inherit; font-weight: 700; }
#uc-gallery-custom .uc-calc-result [hidden] { display: none; }
.uc-calc-error {
    display: none;
    color: #d00;
    font-family: Arial, sans-serif;
    font-size: 13px;
    margin-top: 10px;
}
.uc-calc-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 36px;
}

/* ── «В чате»: карточки мессенджеров (U6:412–480) ── */
.uc-messenger-hint {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #8a8a8a;
    margin: 0 0 18px;
    line-height: 1.5;
}
.uc-messenger-list {
    display: flex;
    gap: 16px;
}
.uc-messenger-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 20px;
    border-radius: 12px;
    border: 0.5px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    width: 200px;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none; 
    -webkit-tap-highlight-color: transparent;
}
/* Активное состояние НЕ меняет ширину рамки: 0.5px → 2px сдвигали бы
   границы блока на 1.5px с каждой стороны, карточка «скакала» бы, а
   соседи по строке съезжали. Видимая рамка в 2px набирается неизменной
   0.5px-рамкой плюс внутренней тенью — box-shadow на раскладку не влияет
   и сам повторяет border-radius. Тот же приём уже используется во вкладках
   «Способ связи» (inset 0 3px 0). */
.uc-messenger-card.uc-messenger-card--active {
    border-color: #111;
    box-shadow: inset 0 0 0 1.5px #111;
}
.uc-messenger-icon {
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    display: block;
    object-fit: cover;
    border-radius: 14px;
}
.uc-messenger-icon--circle { border-radius: 50%; }
.uc-messenger-icon--site {
    background: #1a1a1a;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}
.uc-messenger-card-name {
    font-family: Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
}
.uc-messenger-card-desc {
    font-family: Arial, sans-serif;
    font-size: 12px;
    color: #8a8a8a;
    text-align: center;
    line-height: 1.45;
}
#uc-gallery-custom .uc-messenger-card[hidden] { display: none; }
#uc-gallery-custom .uc-messenger-icon--max { box-shadow: 0 4px 14px rgba(91,56,255,.22); }
#uc-gallery-custom .uc-messenger-icon--tg { box-shadow: 0 4px 14px rgba(41,162,220,.18); }

/* «Где открыть MAX» — только телефон (<= CALC_DESKTOP) и только при
   выбранной карточке MAX; показывает и прячет JS (ucSyncMaxMode), по
   тому же признаку ширины, что «На сайте». Значения макета
   uc-calc-mobile-390.html написаны под border-box, а Tilda навязывает
   content-box — сброс только на этих элементах. */
#uc-gallery-custom .uc-calc-maxmode,
#uc-gallery-custom .uc-calc-maxmode * { box-sizing: border-box; }
#uc-gallery-custom .uc-calc-maxmode {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    background: #fafafa;
    border: 0.5px solid #f0f0f0;
    border-radius: 10px;
    font-family: Arial, sans-serif;
}
#uc-gallery-custom .uc-calc-maxmode--show { display: flex; }
#uc-gallery-custom .uc-calc-maxmode__title { font-size: 13px; font-weight: 600; color: #1a1a1a; }
#uc-gallery-custom .uc-calc-maxmode__list { display: flex; gap: 8px; }
#uc-gallery-custom .uc-calc-maxmode__btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 10px;
    min-height: 52px;
    border-radius: 8px;
    border: 0.5px solid #e0e0e0;
    background: #fff;
    cursor: pointer;
    text-align: left;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
}
#uc-gallery-custom .uc-calc-maxmode__btn--active { border-color: #111; box-shadow: inset 0 0 0 1.5px #111; }
#uc-gallery-custom .uc-calc-maxmode__btn:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 2px; }
#uc-gallery-custom .uc-calc-maxmode__icon { font-size: 18px; line-height: 1; flex-shrink: 0; }
#uc-gallery-custom .uc-calc-maxmode__name { display: block; font-size: 13px; font-weight: 600; color: #7a7a7a; }
#uc-gallery-custom .uc-calc-maxmode__btn--active .uc-calc-maxmode__name { color: #1a1a1a; }
#uc-gallery-custom .uc-calc-maxmode__desc { display: block; font-size: 11px; color: #8a8a8a; line-height: 1.4; }
/* ── Вкладка «ЛК покупателя» (U6:621–846) ──
   Значения макета рассчитаны под border-box, а #uc-gallery-custom живёт под content-box (начало файла).
   Поэтому сброс — только под корнем этой панели и у обёртки подсказки кнопки. */
#uc-gallery-custom .uc-calc-lk,
#uc-gallery-custom .uc-calc-lk *,
#uc-gallery-custom .uc-calc-lk *::before,
#uc-gallery-custom .uc-calc-lk *::after,
#uc-gallery-custom .uc-calc-tipw,
#uc-gallery-custom .uc-calc-tipw * { box-sizing: border-box; }

#uc-gallery-custom .uc-calc-lk { font-family: Arial, sans-serif; color: #1a1a1a; }
#uc-gallery-custom .uc-calc-lk-hint { font-size: 14px; color: #8a8a8a; margin: 0 0 18px; line-height: 1.5; }

/* способ покупки */
#uc-gallery-custom .uc-calc-buys { display: flex; gap: 16px; margin-bottom: 28px; }
#uc-gallery-custom .uc-calc-buy {
    display: flex; flex-direction: column; align-items: center; gap: 12px;
    padding: 22px 20px; border-radius: 12px; border: 0.5px solid #e0e0e0;
    background: #fff; cursor: pointer; width: 220px;
    font-family: Arial, sans-serif; text-align: center;
    -webkit-appearance: none; appearance: none; -webkit-tap-highlight-color: transparent;
}
#uc-gallery-custom .uc-calc-buy--wide { width: 260px; }
/* Тот же приём, что у карточек мессенджеров: рамка не меняет ширину,
   выделение — внутренней тенью, соседи не съезжают. */
#uc-gallery-custom .uc-calc-buy--active { border-color: #111; box-shadow: inset 0 0 0 1.5px #111; }
#uc-gallery-custom .uc-calc-buy__icon {
    width: 56px; height: 56px; border-radius: 14px; background: #f2f3f4;
    display: flex; align-items: center; justify-content: center; gap: 3px;
    font-size: 28px; line-height: 1; box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
#uc-gallery-custom .uc-calc-buy__icon--duo { font-size: 19px; }
#uc-gallery-custom .uc-calc-buy__name { font-size: 15px; font-weight: 600; letter-spacing: 0.04em; color: #7a7a7a; }
#uc-gallery-custom .uc-calc-buy--active .uc-calc-buy__name { color: #1a1a1a; }
#uc-gallery-custom .uc-calc-buy__desc { font-size: 12px; color: #8a8a8a; line-height: 1.45; }

/* второй уровень */
#uc-gallery-custom .uc-calc-lvl2 { border-top: 0.5px solid #efefef; padding-top: 24px; }
#uc-gallery-custom .uc-calc-lvl2-block { display: none; }
#uc-gallery-custom .uc-calc-lvl2-block--show { display: block; }
#uc-gallery-custom .uc-calc-lvl2-block--show + .uc-calc-lvl2-block--show .uc-calc-lvl2-title { margin-top: 16px; }
#uc-gallery-custom .uc-calc-lvl2-title { font-size: 14px; color: #8a8a8a; margin: 0 0 14px; line-height: 1.5; }
#uc-gallery-custom .uc-calc-pane {
    background: #fafafa; border: 0.5px solid #f0f0f0; border-radius: 12px;
    padding: 20px; display: flex; flex-direction: column; gap: 16px;
}
/* Значения плашек — из макета, а он свёрстан под border-box (см.
   CLAUDE.md: Tilda навязывает content-box). Сброс только внутри
   плашек второго уровня — остальная вёрстка U6 настроена под content-box. */
#uc-gallery-custom .uc-calc-pane,
#uc-gallery-custom .uc-calc-pane * { box-sizing: border-box; }
/* Строка: подпись над полем, поля в ряд, низ по одной линии */
#uc-gallery-custom .uc-calc-v2row { display: flex; align-items: flex-end; gap: 32px; }
#uc-gallery-custom .uc-calc-v2col { display: flex; flex-direction: column; gap: 8px; }
#uc-gallery-custom .uc-calc-v2col--grow { flex: 1; min-width: 0; padding-bottom: 4px; }
#uc-gallery-custom .uc-calc-v2col--grow[hidden] { display: none; }
#uc-gallery-custom .uc-calc-v2label { display: block; font-size: 13px; font-weight: 600; color: #1a1a1a; line-height: normal; }
#uc-gallery-custom .uc-calc-note { display: flex; align-items: flex-start; gap: 8px; border-top: 0.5px solid #ececec; padding-top: 14px; }
#uc-gallery-custom .uc-calc-note__i {
    flex-shrink: 0; width: 16px; height: 16px; border-radius: 50%;
    background: #e4e8ea; color: #5c6b74; font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
#uc-gallery-custom .uc-calc-note__text { font-size: 13px; color: #6a6a6a; line-height: 1.5; }

/* ползунок: заливка дорожки — --uc-calc-fill, её выставляет JS */
#uc-gallery-custom .uc-calc-slider { flex: 1; min-width: 0; }
#uc-gallery-custom .uc-calc-range {
    -webkit-appearance: none; appearance: none; width: 100%; height: 24px;
    background: transparent; cursor: pointer; display: block; margin: 0; padding: 0;
}
#uc-gallery-custom .uc-calc-range::-webkit-slider-runnable-track {
    height: 4px; border-radius: 2px;
    background: linear-gradient(to right, #1a1a1a 0, #1a1a1a var(--uc-calc-fill, 0%), #ececec var(--uc-calc-fill, 0%), #ececec 100%);
}
#uc-gallery-custom .uc-calc-range::-moz-range-track { height: 4px; border-radius: 2px; background: #ececec; }
#uc-gallery-custom .uc-calc-range::-moz-range-progress { height: 4px; border-radius: 2px; background: #1a1a1a; }
#uc-gallery-custom .uc-calc-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 22px; height: 22px; margin-top: -9px; border-radius: 50%;
    background: #fff; border: 2px solid #1a1a1a; box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
#uc-gallery-custom .uc-calc-range::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid #1a1a1a;
    background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
#uc-gallery-custom .uc-calc-range:focus-visible { outline: 2px solid #1a1a1a; outline-offset: 4px; }
#uc-gallery-custom .uc-calc-range-ends { display: flex; justify-content: space-between; font-size: 12px; color: #999; margin-top: 2px; }

/* поле с суффиксом */
#uc-gallery-custom .uc-calc-field { position: relative; width: 218px; }
#uc-gallery-custom .uc-calc-field__input {
    width: 100%; padding: 13px 52px 13px 14px; border: 1px solid #e6e6e6; border-radius: 8px;
    font-family: Arial, sans-serif; font-size: 18px; font-weight: 600; color: #1a1a1a;
    background: #fff; outline: none; margin: 0;
}
#uc-gallery-custom .uc-calc-field__input:focus { border-color: #1a1a1a; }
#uc-gallery-custom .uc-calc-field__input::placeholder { color: #c0c0c0; font-weight: 600; }
#uc-gallery-custom .uc-calc-field__suffix {
    position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    font-size: 13px; font-weight: 600; color: #a0a0a0; pointer-events: none;
}

/* госномер */
#uc-gallery-custom .uc-calc-plate {
    display: inline-flex; align-items: stretch; border: 2px solid #111;
    border-radius: 8px; background: #fff; overflow: hidden;
}
#uc-gallery-custom .uc-calc-plate__main {
    width: 144px; border: none; outline: none; padding: 8px 10px; margin: 0; background: transparent;
    font-family: Arial, sans-serif; font-size: 24px; font-weight: 700; color: #111;
}
#uc-gallery-custom .uc-calc-plate__main::placeholder,
#uc-gallery-custom .uc-calc-plate__regnum::placeholder { color: #c8c8c8; }
#uc-gallery-custom .uc-calc-plate__sep { width: 2px; background: #111; }
#uc-gallery-custom .uc-calc-plate__region {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 4px 7px; gap: 1px;
}
#uc-gallery-custom .uc-calc-plate__regnum {
    width: 40px; border: none; outline: none; padding: 0; margin: 0; background: transparent; text-align: center;
    font-family: Arial, sans-serif; font-size: 18px; font-weight: 700; color: #111;
}
#uc-gallery-custom .uc-calc-plate:focus-within { box-shadow: 0 0 0 3px rgba(17,17,17,0.12); }
#uc-gallery-custom .uc-calc-plate__rus { display: flex; align-items: center; gap: 3px; }
#uc-gallery-custom .uc-calc-plate__rus span { font-size: 8px; font-weight: 700; letter-spacing: 0.08em; color: #111; }
#uc-gallery-custom .uc-calc-flag { display: flex; flex-direction: column; width: 10px; height: 6px; border: 0.5px solid #bbb; }
#uc-gallery-custom .uc-calc-flag i { flex: 1; }
#uc-gallery-custom .uc-calc-flag i:nth-child(1) { background: #fff; }
#uc-gallery-custom .uc-calc-flag i:nth-child(2) { background: #1e50a2; }
#uc-gallery-custom .uc-calc-flag i:nth-child(3) { background: #c8202f; }
#uc-gallery-custom .uc-calc-plate--err { border-color: #b3261e; }
#uc-gallery-custom .uc-calc-plate--err .uc-calc-plate__sep { background: #b3261e; }
#uc-gallery-custom .uc-calc-plate--err .uc-calc-plate__main,
#uc-gallery-custom .uc-calc-plate--err .uc-calc-plate__regnum { color: #b3261e; }
#uc-gallery-custom .uc-calc-ferr { margin: -6px 0 0; font-size: 13px; line-height: 1.5; color: #b3261e; font-weight: 600; }
#uc-gallery-custom .uc-calc-ferr[hidden] { display: none; }

/* «Далее» неактивна на вид: не disabled (иначе нет наведения, фокуса
   и подсказки), а aria-disabled. Цвет — из макета. */
#uc-gallery-custom .uc-quiz-btn-next.uc-quiz-btn-next--inactive,
#uc-gallery-custom .uc-quiz-btn-next.uc-quiz-btn-next--inactive:hover {
    background: #c7d0d4;
    cursor: not-allowed;
}
#uc-gallery-custom .uc-calc-tipw { position: relative; display: inline-flex; }
#uc-gallery-custom .uc-calc-tip {
    position: absolute; right: 0; bottom: calc(100% + 10px);
    background: #1a1a1a; color: #fff; font-family: Arial, sans-serif;
    font-size: 13px; line-height: 1.4; padding: 8px 12px; border-radius: 6px; white-space: nowrap;
    opacity: 0; visibility: hidden; transform: translateY(4px);
    transition: opacity .15s, transform .15s, visibility .15s;
    z-index: 5; pointer-events: none;
}
#uc-gallery-custom .uc-calc-tip::after {
    content: ''; position: absolute; right: 28px; top: 100%;
    border: 6px solid transparent; border-top-color: #1a1a1a;
}
#uc-gallery-custom .uc-calc-tipw.is-inactive:hover .uc-calc-tip,
#uc-gallery-custom .uc-calc-tipw.is-inactive .uc-quiz-btn-next:focus-visible + .uc-calc-tip,
#uc-gallery-custom .uc-calc-tipw.is-inactive .uc-calc-tip--open {
    opacity: 1; visibility: visible; transform: none;
}
/* Ожидание после «Далее» во вкладке ЛК (кадр 4): кнопка со спиннером,
   без дополнительного текста; вкладки, поля, способ покупки, согласие
   и «Назад» недоступны. Спиннер — тот же, что у «ОТПРАВКА…». */
#uc-gallery-custom .uc-quiz-btn-next.uc-quiz-btn-next--lk-busy,
#uc-gallery-custom .uc-quiz-btn-next.uc-quiz-btn-next--lk-busy:hover {
    background: var(--uc-btn-next-bg, #2D5467);
    cursor: default;
}
#uc-gallery-custom .uc-quiz-btn-next--lk-busy::before {
    content: '';
    display: inline-block;
    width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: uc-btn-spin 0.7s linear infinite;
}
#uc-gallery-custom .uc-calc-locked { opacity: .5; pointer-events: none; }

/* Сбой открытия кабинета (кадр 5): одна плашка на все причины. */
#uc-gallery-custom .uc-calc-fail {
    display: flex; gap: 12px; margin-top: 28px; padding: 16px 18px;
    background: #fdf4f3; border: 0.5px solid #f0d3cf; border-radius: 12px;
    font-family: Arial, sans-serif; box-sizing: border-box;
}
#uc-gallery-custom .uc-calc-fail[hidden] { display: none; }
#uc-gallery-custom .uc-calc-fail__i {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    background: #b3261e; color: #fff; font-size: 13px; font-weight: 700;
    display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
#uc-gallery-custom .uc-calc-fail__body { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#uc-gallery-custom .uc-calc-fail__text { font-size: 14px; line-height: 1.5; color: #1a1a1a; outline: none; }
#uc-gallery-custom .uc-calc-fail__text b { display: block; }
#uc-gallery-custom .uc-calc-fail__alts { display: flex; flex-wrap: wrap; gap: 8px; }
#uc-gallery-custom .uc-calc-alt {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px;
    border: 0.5px solid #d0d0d0; border-radius: 8px; background: #fff;
    font-family: Arial, sans-serif; font-size: 13px; font-weight: 600; color: #1a1a1a;
    cursor: pointer; box-sizing: border-box;
}
#uc-gallery-custom .uc-calc-alt:hover { border-color: #888; }
#uc-gallery-custom .uc-calc-alt span { font-size: 16px; line-height: 1; }
#uc-gallery-custom .uc-calc-fail + .uc-calc-nav { margin-top: 20px; }
@media (max-width: 640px) {
    #uc-gallery-custom .uc-calc-fail { margin: 0 0 16px; padding: 14px; }
    #uc-gallery-custom .uc-calc-fail__text { font-size: 13px; }
    #uc-gallery-custom .uc-calc-alt { flex: 1; justify-content: center; padding: 11px 10px; min-height: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    #uc-gallery-custom .uc-calc-tip { transition: none; }
}
@keyframes uc-btn-spin { to { transform: rotate(360deg); } }
#uc-gallery-custom .uc-calc-alt[hidden] { display: none; }
#uc-gallery-custom .uc-quiz-btn-next.uc-quiz-btn-next--busy { opacity: .7; cursor: default; }

/* Таб-бар прокручивается только по горизонтали. При overflow-x: auto
   браузер вычисляет overflow-y тоже в auto, а кнопки нарочно заходят
   на нижнюю рамку бара (margin-bottom -0.5px) — у бара появляется
   вертикальный ход в полпикселя. Колесо и трекпад над баром захватывал
   он, а не страница: содержимое бара сдвигалось вверх, верхняя полоса
   активной вкладки срезалась (замер 2026-10-08, план 2026-10-08-001).
   hidden — не clip: при прокручиваемой оси x clip всё равно станет hidden. */
#uc-gallery-custom .uc-calc-tabbar { overflow-y: hidden; }

/* Затухание у края прокручиваемого таб-бара: подсказывает, что за
   краем есть вкладки. Классы is-fit / is-mid / is-end и высоту бара
   (--uc-tabbar-h: под content-box она больше, чем в макете) ставит JS
   по прокрутке и размеру. */
#uc-gallery-custom .uc-calc-tabs::before,
#uc-gallery-custom .uc-calc-tabs::after {
    content: ''; position: absolute; top: 0; height: var(--uc-tabbar-h, 58px); width: 28px;
    pointer-events: none; z-index: 1; transition: opacity .2s;
}
#uc-gallery-custom .uc-calc-tabs::after { right: 0; background: linear-gradient(to right, rgba(250,250,250,0), #fafafa); }
#uc-gallery-custom .uc-calc-tabs::before { left: 0; background: linear-gradient(to left, rgba(250,250,250,0), #fafafa); opacity: 0; }
#uc-gallery-custom .uc-calc-tabs.is-end::after { opacity: 0; }
#uc-gallery-custom .uc-calc-tabs.is-mid::before,
#uc-gallery-custom .uc-calc-tabs.is-end::before { opacity: 1; }
#uc-gallery-custom .uc-calc-tabs.is-fit::before,
#uc-gallery-custom .uc-calc-tabs.is-fit::after { opacity: 0; }

@media (max-width: 640px) {
    .uc-calc-title { padding: 10px 0; margin-bottom: 20px; }
    .uc-calc-bridge-bar { height: 16px; }
    .uc-calc-bridge-text { font-size: 16px; }
    .uc-calc-tabs { margin-bottom: 24px; }
    .uc-calc-tabbar__filler { display: none; }
    /* Три вкладки в 390 px не делятся поровну — таб-бар прокручивается
       (макет uc-calc-lk-mockup.html), подписи в одну строку. */
    .uc-calc-method-btn { flex: 0 0 auto; min-width: 0; padding: 13px 14px; min-height: 58px; gap: 8px; }
    .uc-calc-method-btn--narrow { min-width: 0; }
    .uc-calc-method-btn:last-of-type { border-right: none; }
    .uc-calc-method-emoji { font-size: 22px; }
    .uc-calc-method-name { font-size: 14px; white-space: nowrap; }
    .uc-calc-method-desc { font-size: 11px; white-space: nowrap; }
    .uc-calc-tabpanel { padding: 16px 12px 18px; }
    .uc-calc-agr-item { font-size: 12px; margin-bottom: 24px; }
    .uc-calc-agr-check { width: 18px; height: 18px; }
    .uc-calc-phone-row { flex-direction: column; gap: 10px; }
    .uc-calc-input { font-size: 14px; padding: 11px 12px; }
    .uc-calc-phone-label { font-size: 11px; }
    .uc-calc-phone-section { margin-bottom: 0; }
    .uc-calc-phone-hint { font-size: 13px; margin-bottom: 14px; }
    .uc-messenger-list { gap: 10px; }
    .uc-messenger-card { width: auto; flex: 1; padding: 16px 10px; gap: 10px; }
    .uc-messenger-icon { width: 48px; height: 48px; }
    .uc-messenger-icon--site { width: 48px; height: 48px; }
    .uc-messenger-card-name { font-size: 18px; }
    .uc-messenger-card-desc { font-size: 11px; }
    .uc-messenger-hint { font-size: 13px; margin-bottom: 14px; }
}

@media (max-width: 640px) {
    #uc-gallery-custom .uc-calc-lk-hint { font-size: 13px; margin-bottom: 12px; }
    #uc-gallery-custom .uc-calc-lk-hint-tail { display: none; }
    #uc-gallery-custom .uc-calc-buys { flex-direction: column; gap: 8px; margin-bottom: 20px; }
    #uc-gallery-custom .uc-calc-buy {
        flex-direction: row; align-items: center; gap: 12px; width: auto;
        padding: 12px 14px; border-radius: 10px; text-align: left;
    }
    #uc-gallery-custom .uc-calc-buy__icon { width: 38px; height: 38px; border-radius: 10px; font-size: 19px; box-shadow: none; flex-shrink: 0; }
    #uc-gallery-custom .uc-calc-buy__icon--duo { font-size: 13px; gap: 2px; }
    #uc-gallery-custom .uc-calc-buy__name { flex: 1; min-width: 0; font-size: 14px; }
    #uc-gallery-custom .uc-calc-buy__desc { display: none; }
    #uc-gallery-custom .uc-calc-lvl2 { padding-top: 18px; }
    #uc-gallery-custom .uc-calc-lvl2-title { font-size: 13px; margin-bottom: 10px; }
    #uc-gallery-custom .uc-calc-pane { padding: 16px 14px; gap: 16px; }
    #uc-gallery-custom .uc-calc-v2row { flex-direction: column; align-items: stretch; gap: 16px; }
    #uc-gallery-custom .uc-calc-v2col--grow { padding-bottom: 0; }
    #uc-gallery-custom .uc-calc-plate { align-self: flex-start; }
    /* Ошибка номера — сразу под номером, а не под пробегом: строка
       распадается на элементы плашки, порядок задаётся order */
    #uc-gallery-custom #uc-calc-lk-car .uc-calc-v2row { display: contents; }
    #uc-gallery-custom #uc-calc-lk-car .uc-calc-v2col:first-child { order: 1; }
    #uc-gallery-custom #uc-calc-lk-car .uc-calc-ferr { order: 2; }
    #uc-gallery-custom #uc-calc-lk-car .uc-calc-v2col + .uc-calc-v2col { order: 3; }
    #uc-gallery-custom #uc-calc-lk-car .uc-calc-note { order: 4; }
    #uc-gallery-custom .uc-calc-note { padding-top: 12px; }
    #uc-gallery-custom .uc-calc-note__text { font-size: 12px; }
    #uc-gallery-custom .uc-calc-range { height: 28px; }
    #uc-gallery-custom .uc-calc-range::-webkit-slider-thumb { width: 26px; height: 26px; margin-top: -11px; }
    #uc-gallery-custom .uc-calc-range::-moz-range-thumb { width: 26px; height: 26px; }
    #uc-gallery-custom .uc-calc-range-ends { font-size: 11px; }
    #uc-gallery-custom .uc-calc-field { width: auto; }
    #uc-gallery-custom .uc-calc-field__input { padding: 12px 48px 12px 12px; font-size: 17px; }
    #uc-gallery-custom .uc-calc-field__suffix { right: 12px; font-size: 12px; }
    #uc-gallery-custom .uc-calc-plate__main { width: 128px; padding: 8px 9px; font-size: 22px; }
    #uc-gallery-custom .uc-calc-plate__regnum { width: 38px; font-size: 16px; }
    #uc-gallery-custom .uc-calc-plate__region { padding: 4px 6px; }
    #uc-gallery-custom .uc-calc-ferr { margin: -4px 0 0; font-size: 12px; }
    #uc-gallery-custom .uc-calc-tip { font-size: 12px; }
}
