/* ============================================================
   kits-app.css — «как приложение» для страниц готовых комплектов
   (охранная сигнализация, тревожная кнопка, антипотоп, видеонаблюдение,
   домофоны) и калькулятора.
   Смартфон: компактные карточки-строки, стеклянная панель шагов над нижним меню.
   Компьютер: только модальные окна, вёрстка шагов как была.
   Подключается последним, поверх стилей страниц.
   ============================================================ */

:root {
  --ka-green: #4cac26;
  --ka-green-2: #56bd2d;
  --ka-green-soft: #f1f9ec;
  --ka-ink: #0d0f0e;
  --ka-mute: #6b716d;
  --ka-line: rgba(13, 15, 14, .08);
  --ka-card: #fff;
  --ka-radius: 18px;
  --ka-bar-h: 148px; /* высота панели шагов на смартфоне */
}

/* ---------- Смартфон ---------- */
@media (max-width: 768px) {

  /* --- заголовок шага --- */
  html body:not(#ka) .page .header-container,
  html body:not(#ka) .step-content > .page-header {
    padding-top: 8px;
  }
  html body:not(#ka) .page .header-container .header-left > span,
  html body:not(#ka) .step-content .page-step {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
    color: var(--ka-green);
  }
  html body:not(#ka) .page .header-container h1,
  html body:not(#ka) .step-content .page-title {
    font-size: 24px; line-height: 1.2; letter-spacing: -.01em; margin-top: 4px;
  }

  /* --- карточки выбора: строки как в приложении --- */
  html body:not(#ka) #page1 .card-container,
  html body:not(#ka) #step1 .selection-cards {
    display: flex !important; flex-direction: column; align-items: stretch !important; gap: 10px;
    width: auto !important; max-width: none !important;
    padding: 4px 16px 0 !important; margin: 0 !important;
  }
  html body:not(#ka) #step1 .selection-cards { padding: 4px 12px 0 !important; } /* в линию с заголовком шага */
  html body:not(#ka) #page1 .card,
  html body:not(#ka) #step1 .selection-card {
    position: relative;
    display: grid !important; grid-template-columns: 52px 1fr; align-items: center; gap: 14px;
    width: 100% !important; max-width: none !important; box-sizing: border-box;
    height: auto !important; min-height: 76px;
    margin: 0 !important; padding: 12px 16px 12px 12px !important;
    background: var(--ka-card); border-radius: var(--ka-radius) !important; border: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
    transition: background .2s ease, transform .12s ease;
    -webkit-tap-highlight-color: transparent;
  }
  html body:not(#ka) #page1 .card:active,
  html body:not(#ka) #step1 .selection-card:active { transform: scale(.985); }
  html body:not(#ka) #page1 .card::before, html body:not(#ka) #page1 .card::after,
  html body:not(#ka) #step1 .selection-card .card-header { display: none !important; }

  /* иконка-иллюстрация в квадрате */
  html body:not(#ka) #page1 .card img,
  html body:not(#ka) #step1 .selection-card .card-icon {
    grid-row: 1; grid-column: 1;
    width: 52px !important; height: 52px !important; margin: 0 !important; padding: 6px;
    box-sizing: border-box; border-radius: 14px; background: #f4f5f4; object-fit: contain;
    display: flex; align-items: center; justify-content: center;
  }
  html body:not(#ka) #step1 .selection-card .card-icon svg,
  html body:not(#ka) #step1 .selection-card .card-icon img { width: 100% !important; height: 100% !important; }

  html body:not(#ka) #page1 .card .card-content,
  html body:not(#ka) #step1 .selection-card .card-bottom {
    grid-column: 2; display: flex !important; align-items: center; justify-content: space-between; gap: 12px;
    padding: 0 !important; margin: 0 !important; width: auto !important; position: static !important;
  }
  html body:not(#ka) #page1 .card .card-content span,
  html body:not(#ka) #step1 .selection-card .card-bottom > :first-child {
    font-size: 16px !important; font-weight: 600; line-height: 1.25; color: var(--ka-ink);
  }

  /* выбранная карточка */
  html body:not(#ka) #page1 .card.selected,
  html body:not(#ka) #step1 .selection-card.selected,
  html body:not(#ka) #step1 .selection-card.active {
    background: var(--ka-green-soft) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
  }

  /* --- комплекты, шаг 2: планировки комнат — сетка 2 колонки --- */
  html body:not(#ka) #step2 .selection-cards {
    gap: 10px !important; padding: 0 12px !important; margin: 0 0 16px !important; width: 100% !important; box-sizing: border-box;
    grid-template-columns: 1fr 1fr !important;
  }
  html body:not(#ka) #step2 .selection-card {
    flex-direction: column; align-items: stretch !important; height: auto !important; min-height: 0 !important;
    padding: 12px !important; border: 0 !important; border-radius: var(--ka-radius) !important;
    background: var(--ka-card) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
    transition: background .2s ease, transform .12s ease; -webkit-tap-highlight-color: transparent;
  }
  html body:not(#ka) #step2 .selection-card:active { transform: scale(.97); }
  html body:not(#ka) #step2 .selection-card.selected,
  html body:not(#ka) #step2 .selection-card.active { background: var(--ka-green-soft) !important; }
  html body:not(#ka) #step2 .selection-card .card-header { display: none !important; }
  html body:not(#ka) #step2 .selection-card .card-icon {
    width: 100% !important; height: auto !important; aspect-ratio: 4 / 3; margin: 0 !important;
    border-radius: 12px !important; background: #f6f7f6; display: flex; align-items: center; justify-content: center;
  }
  html body:not(#ka) #step2 .selection-card.selected .card-icon,
  html body:not(#ka) #step2 .selection-card.active .card-icon { background: #fff; }
  html body:not(#ka) #step2 .selection-card .card-icon img { width: 78% !important; height: 78% !important; object-fit: contain; }
  html body:not(#ka) #step2 .selection-card .card-bottom {
    display: flex !important; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 2px 0 !important; position: static !important;
  }
  html body:not(#ka) #step2 .selection-card .card-title { font-size: 15px !important; font-weight: 600; color: var(--ka-ink) !important; }
  html body:not(#ka) #step2 .selection-card .card-selection-indicator { width: 24px !important; height: 24px !important; flex: none; }

  /* --- видеонаблюдение / домофоны, шаг 1: раскрывающиеся системы --- */
  html body:not(#ka) .video-kits-container.step-content,
  html body:not(#ka) .domofon-kits-container.step-content { padding-top: 16px !important; padding-left: 12px !important; padding-right: 12px !important; }
  html body:not(#ka) .step-content .page-header { margin-bottom: 16px !important; }
  html body:not(#ka) .system-selection { gap: 10px !important; margin: 0 0 16px !important; }
  html body:not(#ka) .system-card {
    border: 0 !important; border-radius: var(--ka-radius) !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
  }
  html body:not(#ka) .system-card-header { padding: 18px 18px !important; border: 0 !important; }
  html body:not(#ka) .system-card-header h3 { font-size: 16px !important; font-weight: 600; }
  html body:not(#ka) .system-options { padding: 0 8px 8px !important; display: flex; flex-direction: column; gap: 6px; }
  html body:not(#ka) .system-options .option-item {
    margin: 0 !important; padding: 14px 12px !important; border-radius: 14px !important; background: #f6f7f6;
    transition: background .2s ease, transform .12s ease; -webkit-tap-highlight-color: transparent;
  }
  html body:not(#ka) .system-options .option-item:active { transform: scale(.985); }
  html body:not(#ka) .system-options .option-item:has(input:checked) { background: var(--ka-green-soft) !important; }
  html body:not(#ka) .system-options .option-label { font-size: 15px !important; font-weight: 600; color: var(--ka-ink); }

  /* --- калькулятор, шаг 2: типы сигнализации (множественный выбор) --- */
  html body:not(#ka) .step2-wrapper {
    display: flex !important; flex-direction: column; gap: 10px !important;
    width: auto !important; max-width: none !important; margin: 4px 16px 0 !important; padding: 0 !important;
  }
  html body:not(#ka) .step2-card {
    display: flex !important; align-items: center; gap: 14px;
    width: 100% !important; box-sizing: border-box; margin: 0 !important; padding: 16px !important;
    border-radius: var(--ka-radius) !important; border: 0 !important; background: var(--ka-card) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important; transition: background .2s ease, transform .12s ease;
  }
  html body:not(#ka) .step2-card:active { transform: scale(.985); }
  html body:not(#ka) .step2-card.selected { background: var(--ka-green-soft) !important; }
  html body:not(#ka) .step2-card .step2-checkbox {
    flex: none; width: 24px !important; height: 24px !important; border-radius: 8px !important; margin: 0 !important;
  }
  html body:not(#ka) .step2-card h3 { font-size: 16px !important; line-height: 1.25; margin: 0 0 3px !important; }
  html body:not(#ka) .step2-card p { font-size: 13px !important; line-height: 1.4; margin: 0 !important; color: var(--ka-mute); }

  /* --- калькулятор, шаг 3: параметры объекта (счётчики и опции) --- */
  html body:not(#ka) .page .step-3 { display: block !important; }
  html body:not(#ka) .step-3-container {
    display: flex !important; flex-direction: column; gap: 10px !important;
    width: auto !important; margin: 4px 16px 0 !important; padding: 0 !important;
  }
  html body:not(#ka) .step-3-card {
    display: grid !important; grid-template-columns: 1fr auto; align-items: center; gap: 12px !important;
    width: 100% !important; box-sizing: border-box; margin: 0 !important; padding: 14px 14px 14px 16px !important;
    border-radius: var(--ka-radius) !important; border: 0 !important; background: var(--ka-card) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important; transition: background .2s ease, transform .12s ease;
  }
  html body:not(#ka) .step-3-card[onclick]:active { transform: scale(.985); }
  html body:not(#ka) .step-3-card.active { background: var(--ka-green-soft) !important; }
  html body:not(#ka) .step-3-card-content { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding: 0 !important; }
  html body:not(#ka) .step-3-card-header { display: flex; align-items: center; gap: 8px; margin: 0 !important; }
  html body:not(#ka) .step-3-card-header img { width: 20px !important; height: 20px !important; flex: none; margin: 0 !important; }
  html body:not(#ka) .step-3-card-title { font-size: 16px !important; font-weight: 600; line-height: 1.25; color: var(--ka-ink); }
  html body:not(#ka) .step-3-card-subtitle { font-size: 12.5px !important; line-height: 1.4; color: var(--ka-mute) !important; margin: 0 !important; }

  /* счётчик − 0 + : компактная капсула справа */
  html body:not(#ka) .step-3-counter {
    display: flex !important; align-items: center; gap: 2px !important;
    width: auto !important; margin: 0 !important; padding: 3px !important;
    border-radius: 999px !important; background: #f2f3f2 !important;
  }
  html body:not(#ka) .step-3-counter button {
    width: 34px !important; height: 34px !important; padding: 0 !important; border-radius: 50% !important;
    background: #fff !important; color: var(--ka-ink) !important; font-size: 20px !important; line-height: 1;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .08); -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease;
  }
  html body:not(#ka) .step-3-counter button:active { transform: scale(.9); }
  html body:not(#ka) .step-3-counter input {
    width: 30px !important; height: 34px !important; padding: 0 !important; border: 0 !important;
    background: transparent !important; font-size: 17px !important; color: var(--ka-ink) !important;
  }

  /* флажок опции */
  html body:not(#ka) .step-3-checkbox {
    width: 24px !important; height: 24px !important; border-radius: 8px !important; box-sizing: border-box;
    border: 1.6px solid #c9cdca !important; background: #fff center / 14px no-repeat !important;
    transition: background-color .2s ease, border-color .2s ease;
  }
  html body:not(#ka) .step-3-checkbox.active {
    border-color: var(--ka-green) !important; background-color: var(--ka-green) !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") !important;
  }
  html body:not(#ka) .step-3-checkbox.active::after { display: none !important; }

  html body:not(#ka) .step-3-section-title {
    margin: 14px 4px 0 !important; padding: 0 !important;
    font-size: 12px !important; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ka-mute);
  }

  /* --- калькулятор, шаг 4: проверка параметров --- */
  html body:not(#ka) #page4 .header-container { background: transparent !important; }
  html body:not(#ka) #page4 .header-container .header-left > span {
    text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 500; color: var(--ka-mute);
  }
  html body:not(#ka) .step-4-page-container { background: transparent !important; padding: 4px 16px 0 !important; }
  html body:not(#ka) .step-4-layout-wrapper { gap: 10px !important; }
  html body:not(#ka) .step-4-left-section,
  html body:not(#ka) .step-4-right-section {
    padding: 16px !important; border-radius: var(--ka-radius) !important; border: 0 !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important; background: var(--ka-card) !important;
  }
  html body:not(#ka) .step-4-title {
    margin: 0 0 10px !important; font-size: 12px !important; font-weight: 600; letter-spacing: .02em;
    text-transform: uppercase; color: var(--ka-mute) !important;
  }
  html body:not(#ka) .step-4-left-section .step-4-title ~ .step-4-title { margin-top: 16px !important; }
  html body:not(#ka) .step-4-button-group { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
  html body:not(#ka) .step-4-custom-button {
    height: 36px; padding: 0 14px !important; border-radius: 999px !important; border: 0 !important;
    background: var(--ka-green-soft) !important; color: #2f7a12 !important; font-size: 14px !important; font-weight: 600;
  }
  html body:not(#ka) .step-4-characteristic-row {
    align-items: center; justify-content: space-between; padding: 10px 0 !important;
    border-bottom: 1px solid var(--ka-line) !important;
  }
  html body:not(#ka) .step-4-characteristic-row:last-child { border-bottom: 0 !important; padding-bottom: 0 !important; }
  html body:not(#ka) .step-4-label { font-size: 16px !important; color: var(--ka-ink) !important; }
  html body:not(#ka) .step-4-input-group { display: flex; align-items: center; gap: 6px; }
  html body:not(#ka) .step-4-number-input {
    width: 44px !important; height: 36px; padding: 0 !important; border: 0 !important; border-radius: 10px !important;
    background: #f2f3f2 !important; color: var(--ka-ink) !important; font-size: 16px !important; font-weight: 600; text-align: center;
  }
  html body:not(#ka) .step-4-number-input.editable { background: #fff !important; box-shadow: inset 0 0 0 1.5px var(--ka-green) !important; }
  html body:not(#ka) .step-4-edit-button {
    width: 36px !important; height: 36px !important; display: grid !important; place-items: center;
    border-radius: 50% !important; background: transparent !important;
  }
  html body:not(#ka) .step-4-edit-button img { width: 18px; height: 18px; opacity: .55; }

  /* --- калькулятор, результат: готовые комплекты --- */
  html body:not(#ka) #page5 .header-bar { position: static !important; padding: 8px 16px 6px !important; background: transparent !important; box-shadow: none !important; }
  html body:not(#ka) #page5 .header-top { margin: 0 0 8px !important; }
  html body:not(#ka) #page5 .header-top .back-button {
    display: inline-flex !important; align-items: center; width: auto !important; height: 36px !important;
    padding: 0 14px !important; margin: 0 !important; border: 0 !important; border-radius: 999px !important;
    background: rgba(13, 15, 14, .05) !important; color: var(--ka-ink) !important; font-size: 14px !important; font-weight: 600;
  }
  html body:not(#ka) #page5 .header-title { font-size: 24px !important; line-height: 1.2 !important; margin: 0 0 4px !important; }

  /* фильтр сигнализаций — лента чипов с прокруткой вбок */
  html body:not(#ka) #page5 .signal-filter-wrapper {
    width: auto !important; margin: 12px -16px 0 !important; padding: 0 16px 2px !important;
    overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  html body:not(#ka) #page5 .signal-filter-wrapper::-webkit-scrollbar { display: none; }
  html body:not(#ka) #page5 .signal-filter { display: flex !important; flex-wrap: nowrap !important; gap: 6px !important; width: max-content; }
  html body:not(#ka) #page5 .signal-button {
    flex: none; display: inline-flex !important; align-items: center; gap: 6px; height: 36px; white-space: nowrap;
    padding: 0 14px 0 10px !important; border-radius: 999px !important; border: 0 !important;
    background: #fff !important; color: var(--ka-ink) !important; font-size: 13px !important; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
  }
  html body:not(#ka) #page5 .signal-button.active { background: var(--ka-ink) !important; color: #fff !important; }

  /* карточка комплекта */
  html body:not(#ka) #page5 .product-container-wrapper {
    display: flex !important; flex-direction: column; gap: 12px; padding: 10px 12px 0 !important; margin: 0 !important;
  }
  html body:not(#ka) #page5 .single-product-container {
    width: auto !important; margin: 0 !important; padding: 16px 12px 14px !important;
    border: 0 !important; border-radius: 22px !important; background: var(--ka-card) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
  }
  html body:not(#ka) #page5 .kit-header {
    padding: 0 4px 4px !important; margin: 0 !important; border: 0 !important; background: transparent !important;
  }
  html body:not(#ka) #page5 .kit-label { font-size: 18px !important; font-weight: 700; color: var(--ka-ink) !important; }
  html body:not(#ka) #page5 .product-header-product { margin: 0 !important; padding: 0 !important; }
  html body:not(#ka) #page5 .product-divider { display: none !important; }
  html body:not(#ka) #page5 .product-category-title {
    margin: 14px 4px 8px !important; font-size: 12px !important; font-weight: 600; letter-spacing: .02em;
    text-transform: uppercase; color: var(--ka-mute) !important;
  }

  /* устройство — строка списка:
       [фото] название ............ цена
       [фото] описание ............ 2 шт
       ─────────────────────────────────
       ● ○ цвет            Заменить ⇆  🗑   */
  html body:not(#ka) #page5 .single-product-item {
    display: grid !important; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-rows: minmax(27px, auto) minmax(27px, auto) auto;
    gap: 2px 12px !important;
    align-items: start; margin: 0 0 8px !important; padding: 12px !important;
    border: 0 !important; border-radius: 18px !important; background: #f6f7f6 !important;
  }
  /* обёртки разметки не мешают сетке — их дети встают прямо в строки карточки */
  html body:not(#ka) #page5 .product-item-content,
  html body:not(#ka) #page5 .product-item-header,
  html body:not(#ka) #page5 .product-item-name-wrapper { display: contents !important; }

  html body:not(#ka) #page5 .product-item-image {
    grid-column: 1; grid-row: 1 / span 2; align-self: center;
    width: 56px !important; height: 56px !important; margin: 0 !important; padding: 4px; box-sizing: border-box;
    border-radius: 14px !important; background: #fff !important; overflow: hidden;
  }
  html body:not(#ka) #page5 .product-item-image img { width: 100% !important; height: 100% !important; object-fit: contain; border-radius: 0 !important; }
  html body:not(#ka) #page5 .product-item-name {
    grid-column: 2; grid-row: 1; align-self: end; margin: 0 !important;
    font-size: 15px !important; font-weight: 600; line-height: 1.25 !important; color: var(--ka-ink) !important;
    overflow-wrap: anywhere;
  }
  html body:not(#ka) #page5 .product-item-price {
    grid-column: 3; grid-row: 1; align-self: end; justify-self: end; margin: 0 !important;
    font-size: 15px !important; font-weight: 700; line-height: 1.25; white-space: nowrap; color: var(--ka-ink) !important;
  }
  html body:not(#ka) #page5 .product-item-description {
    grid-column: 2; grid-row: 2; align-self: start; margin: 0 !important;
    font-size: 13px !important; line-height: 1.35; color: var(--ka-mute) !important;
  }
  html body:not(#ka) #page5 .product-item-quantity {
    grid-column: 3; grid-row: 2; align-self: start; justify-self: end; margin: 2px 0 0 !important;
    padding: 2px 8px !important; border: 0 !important; border-radius: 999px !important; white-space: nowrap;
    background: var(--ka-green-soft) !important; color: #2f7a12 !important; font-size: 12px !important; font-weight: 600; line-height: 1.4;
  }

  /* нижняя полоса действий */
  html body:not(#ka) #page5 .product-item-footer {
    grid-column: 1 / -1; grid-row: 3; display: flex !important; align-items: center; gap: 8px;
    margin: 10px 0 0 !important; padding: 8px 0 0 !important; border-top: 1px solid rgba(13, 15, 14, .07);
  }
  html body:not(#ka) #page5 .product-item-footer .device-color-selector { display: flex; gap: 8px; margin: 0 !important; }
  html body:not(#ka) #page5 .product-item-footer .color-option { width: 24px !important; height: 24px !important; cursor: pointer; }
  html body:not(#ka) #page5 .product-item-footer .replace-btn {
    margin: 0 0 0 auto !important; height: 34px; padding: 0 14px !important; border: 0 !important; border-radius: 999px !important;
    display: inline-flex !important; align-items: center; gap: 6px;
    background: #fff !important; color: var(--ka-ink) !important; font-size: 13px !important; font-weight: 600;
  }
  html body:not(#ka) #page5 .product-item-delete {
    flex: none; width: 34px !important; height: 34px !important; margin: 0 !important; padding: 0 !important;
    display: inline-grid !important; place-items: center; border-radius: 50% !important; background: #fff !important;
  }
  html body:not(#ka) #page5 .product-item-delete img { width: 18px !important; height: 18px !important; }
  /* только корзина — без отдельной полосы, маленькой кнопкой справа */
  html body:not(#ka) #page5 .product-item-footer:has(> .product-item-delete:only-child) {
    grid-column: 2 / -1; justify-content: flex-end; margin: 4px 0 0 !important; padding: 0 !important; border-top: 0;
  }
  /* заглушки «Не предусмотрено» — обычная строка по центру */
  html body:not(#ka) #page5 .single-product-item:has(> .product-info) {
    display: flex !important; align-items: center; justify-content: center; min-height: 0; padding: 14px !important;
  }
  html body:not(#ka) #page5 .single-product-item > .product-info p { font-size: 13px !important; color: var(--ka-mute) !important; }
  /* если «Заменить» нет — корзина всё равно справа */
  html body:not(#ka) #page5 .product-item-footer > .product-item-delete:first-child,
  html body:not(#ka) #page5 .product-item-footer > .device-color-selector + .product-item-delete { margin-left: auto !important; }

  html body:not(#ka) #page5 .dotted-button { display: inline-flex !important; margin: 2px 0 14px !important; }

  /* итог и покупка */
  html body:not(#ka) #page5 .total-price {
    display: flex !important; align-items: baseline; justify-content: space-between; gap: 10px;
    flex-direction: row !important; flex-wrap: wrap; width: auto !important;
    margin: 12px 0 0 !important; padding: 14px 4px 0 !important; border: 0 !important; border-top: 1px solid var(--ka-line) !important;
    border-radius: 0 !important; background: transparent !important; box-shadow: none !important;
  }
  html body:not(#ka) #page5 .total-price h2 { margin: 0 !important; font-size: 14px !important; font-weight: 500; color: var(--ka-mute) !important; }
  html body:not(#ka) #page5 .total-price-value { font-size: 24px !important; font-weight: 700; color: var(--ka-ink) !important; white-space: nowrap; }
  html body:not(#ka) #page5 .single-product-container .buy-button {
    display: flex !important; align-items: center; justify-content: center; width: 100% !important; height: 52px !important;
    margin: 12px 0 0 !important; padding: 0 !important; border: 0 !important; border-radius: 999px !important;
    background: var(--ka-green) !important; color: #fff !important; font-size: 16px !important; font-weight: 600; box-shadow: none !important;
  }
  html body:not(#ka) #page5 .single-product-container .buy-button:active { transform: scale(.98); }

  /* --- комплекты, шаг 3: готовые наборы --- */
  html body:not(#ka) .room-selector .room-button {
    min-width: 42px; height: 40px !important; padding: 0 12px !important; border: 0 !important; border-radius: 12px !important;
    background: #fff !important; color: var(--ka-ink) !important; font-size: 15px !important; font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important; transition: background .2s ease, transform .12s ease;
  }
  html body:not(#ka) .room-selector .room-button:active { transform: scale(.94); }
  html body:not(#ka) .room-selector .room-button.active { background: var(--ka-ink) !important; color: #fff !important; }

  html body:not(#ka) .kit-panel {
    padding: 16px 12px 14px !important; border: 0 !important; border-radius: 22px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important;
  }
  html body:not(#ka) .kit-panel .kit-header { margin: 0 4px 14px !important; }
  html body:not(#ka) .kit-panel .kit-badge { font-size: 18px !important; font-weight: 700; text-decoration: none !important; color: var(--ka-ink) !important; }
  html body:not(#ka) .kit-panel .filter-badge { padding: 5px 10px !important; font-size: 12px !important; background: #f2f3f2 !important; }
  html body:not(#ka) .kit-panel .devices-list { gap: 8px !important; margin-bottom: 4px !important; }

  /* устройство: картинка слева, под названием — цвет и «Заменить» в одну строку */
  html body:not(#ka) .kit-panel .device-item {
    padding: 10px !important; border: 0 !important; border-radius: 16px !important; background: #f6f7f6 !important;
  }
  html body:not(#ka) .kit-panel .device-item:has(> .device-info) {
    display: grid !important; grid-template-columns: 56px auto 1fr; gap: 0 12px !important; align-items: center; padding: 12px !important;
  }
  /* линия-разделитель над полосой действий */
  html body:not(#ka) .kit-panel .device-item:has(> .device-info):has(> .device-color-actions, > .device-replace-actions)::before {
    content: ""; grid-row: 2; grid-column: 1 / -1; align-self: start; height: 0; margin-top: 10px;
    border-top: 1px solid rgba(13, 15, 14, .07);
  }
  /* видеонаблюдение / домофоны: картинка + текст в строку */
  html body:not(#ka) .kit-panel .device-item-info { display: flex !important; align-items: flex-start; gap: 12px; min-width: 0; }
  html body:not(#ka) .kit-panel .device-text,
  html body:not(#ka) .kit-panel .storage-text { flex: 1 1 auto; min-width: 0; }
  html body:not(#ka) .kit-panel .device-name-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
  html body:not(#ka) .kit-panel .quantity-badge {
    padding: 2px 8px !important; border: 0 !important; border-radius: 999px !important;
    background: var(--ka-green-soft) !important; color: #2f7a12 !important; font-size: 12px !important; font-weight: 600;
  }
  html body:not(#ka) .kit-panel .device-item:has(> .device-info) > .device-icon { grid-row: 1; grid-column: 1; align-self: center; }
  html body:not(#ka) .kit-panel .device-item .device-icon {
    flex: none;
    width: 56px !important; height: 56px !important; padding: 4px; box-sizing: border-box;
    border-radius: 12px; background: #fff; object-fit: contain;
  }
  html body:not(#ka) .kit-panel .device-item .device-info { grid-row: 1; grid-column: 2 / -1; align-self: center; padding: 0 !important; min-width: 0; }
  html body:not(#ka) .kit-panel .device-item .device-name-wrapper { width: auto !important; flex-wrap: wrap; gap: 4px 6px; }
  html body:not(#ka) .kit-panel .device-item .device-name { font-size: 15px !important; font-weight: 600; color: var(--ka-ink) !important; }
  html body:not(#ka) .kit-panel .device-item .device-desc { width: auto !important; font-size: 13px !important; color: var(--ka-mute) !important; }
  html body:not(#ka) .kit-panel .device-item .device-color-actions,
  html body:not(#ka) .kit-panel .device-item .device-replace-actions {
    position: static !important; top: auto !important; right: auto !important; bottom: auto !important; grid-row: 2;
  }
  html body:not(#ka) .kit-panel .device-item .device-color-actions { grid-column: 1 / 3; margin-top: 18px; }
  html body:not(#ka) .kit-panel .device-item .device-replace-actions { grid-column: 3; justify-self: end; margin-top: 18px; }
  html body:not(#ka) .kit-panel .device-item .device-color-selector { display: flex; gap: 8px; }
  html body:not(#ka) .kit-panel .device-item .color-option { width: 24px !important; height: 24px !important; }
  html body:not(#ka) .kit-panel .device-item .device-replace {
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px !important; border: 0 !important;
    border-radius: 999px !important; background: #fff !important; color: var(--ka-ink) !important; font-size: 13px !important; font-weight: 600;
  }

  html body:not(#ka) .kit-panel .kit-footer { padding: 14px 4px 0 !important; margin-top: 12px !important; border-top: 1px solid var(--ka-line) !important; gap: 12px !important; }
  html body:not(#ka) .kit-panel .kit-footer .total-price {
    flex-direction: row !important; align-items: baseline; justify-content: space-between; width: 100% !important; gap: 10px;
  }
  html body:not(#ka) .kit-panel .total-label { font-size: 14px !important; color: var(--ka-mute) !important; }
  html body:not(#ka) .kit-panel .total-value { font-size: 24px !important; font-weight: 700; color: var(--ka-ink) !important; white-space: nowrap; }
  html body:not(#ka) .kit-panel .kit-footer .buy-button,
  html body:not(#ka) .kit-panel .kit-buttons .buy-button {
    height: 52px !important; padding: 0 20px !important; border: 0 !important; border-radius: 999px !important;
    background: var(--ka-green) !important; color: #fff !important; font-size: 16px !important; font-weight: 600; box-shadow: none !important;
  }
  html body:not(#ka) .kit-card { border: 0 !important; border-radius: 22px !important; box-shadow: 0 1px 3px rgba(0, 0, 0, .06) !important; }
  html body:not(#ka) .kit-card .kit-price {
    display: flex !important; flex-direction: row !important; align-items: baseline; justify-content: space-between; gap: 10px; width: 100%;
  }
  html body:not(#ka) .kit-card .price-label { font-size: 14px !important; color: var(--ka-mute) !important; }
  html body:not(#ka) .kit-card .price-value { font-size: 24px !important; font-weight: 700; color: var(--ka-ink) !important; white-space: nowrap; }
  html body:not(#ka) .kit-card .kit-buttons .buy-button {
    height: 52px !important; padding: 0 20px !important; border: 0 !important; border-radius: 999px !important;
    background: var(--ka-green) !important; color: #fff !important; font-size: 16px !important; font-weight: 600; box-shadow: none !important;
  }
  html body:not(#ka) .kit-card .kit-buttons .details-button {
    height: 52px !important; border: 0 !important; border-radius: 999px !important;
    background: rgba(13, 15, 14, .06) !important; color: var(--ka-ink) !important; font-size: 16px !important; font-weight: 600;
  }
  html body:not(#ka) .kit-card .kit-buttons,
  html body:not(#ka) .kit-panel .kit-buttons { display: flex !important; flex-direction: row !important; gap: 8px; width: 100%; }
  html body:not(#ka) .kit-panel .kit-buttons > *, html body:not(#ka) .kit-card .kit-buttons > * { flex: 1 1 0; width: auto !important; }
  html body:not(#ka) .kit-panel .kit-buttons > .buy-button, html body:not(#ka) .kit-card .kit-buttons > .buy-button { flex-grow: 1.4; }
  html body:not(#ka) .kit-panel .kit-buttons .details-button {
    height: 52px !important; border: 0 !important; border-radius: 999px !important;
    background: rgba(13, 15, 14, .06) !important; color: var(--ka-ink) !important; font-size: 16px !important; font-weight: 600;
  }

  /* --- панель шагов: стеклянная карточка над нижним меню --- */
  html body:not(#ka) .navigation-container,
  html body:not(#ka) .navigation {
    position: fixed !important; z-index: 1000;
    left: 12px !important; right: 12px !important; top: auto !important;
    bottom: calc(12px + env(safe-area-inset-bottom)) !important;
    width: auto !important; margin: 0 !important; padding: 12px !important;
    border-radius: 22px !important;
    background: rgba(255, 255, 255, .97) !important;
    -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .12) !important;
  }
  html body:not(#ka) .navigation .navigation-content { padding: 0 !important; display: flex; flex-direction: column; gap: 10px; }
  html body:not(#ka) .navigation-container { display: flex !important; flex-direction: column; gap: 10px; }

  /* прогресс сверху: тонкие сегменты + «Шаг N из M» */
  html body:not(#ka) .navigation-container .progress-section,
  html body:not(#ka) .navigation .progress-section {
    order: -1; display: flex !important; flex-direction: column !important; align-items: stretch; gap: 6px;
    align-self: stretch; width: 100% !important; max-width: none !important; box-sizing: border-box;
    margin: 0 !important; padding: 0 2px !important;
  }
  html body:not(#ka) .navigation-container .progress-steps,
  html body:not(#ka) .navigation .progress-steps {
    flex: none !important; display: flex !important; gap: 4px; width: 100% !important; margin: 0 !important;
  }
  html body:not(#ka) .navigation-container .progress-step,
  html body:not(#ka) .navigation .progress-step {
    flex: 1 1 0 !important; min-width: 16px; height: 4px !important; border-radius: 4px; width: auto !important;
    display: block !important;
  }
  html body:not(#ka) .navigation-container .progress-text,
  html body:not(#ka) .navigation .progress-text {
    flex: none; margin: 0 !important; padding: 0 !important; background: none !important; text-align: center;
    font-size: 12px; font-weight: 600; line-height: 1.2; color: var(--ka-mute); white-space: nowrap;
  }

  /* кнопки */
  html body:not(#ka) .navigation-container .buttons-wrapper,
  html body:not(#ka) .navigation .nav-buttons {
    display: flex !important; gap: 8px; align-self: stretch; width: 100% !important; max-width: none !important; margin: 0 !important;
  }
  html body:not(#ka) .navigation-container .nav-button,
  html body:not(#ka) .navigation .nav-button {
    height: 50px !important; border-radius: 999px !important; margin: 0 !important;
    font-size: 16px !important; font-weight: 600; letter-spacing: 0;
    transition: background .2s ease, transform .12s ease, box-shadow .2s ease;
  }
  html body:not(#ka) .navigation-container .nav-button:active,
  html body:not(#ka) .navigation .nav-button:active { transform: scale(.97); }
  html body:not(#ka) .navigation-container .back-button,
  html body:not(#ka) .navigation .nav-button.back {
    flex: 1 1 0 !important; width: auto !important;
    background: rgba(13, 15, 14, .05) !important; color: var(--ka-ink) !important; border: 0 !important;
  }
  html body:not(#ka) .navigation-container .next-button,
  html body:not(#ka) .navigation .nav-button.next {
    flex: 1 1 0 !important; width: auto !important; border: 0 !important; box-shadow: none !important;
  }
  /* активная «Далее» — зелёная, как главные кнопки сайта */
  html body:not(#ka) .navigation-container .next-button.active,
  html body:not(#ka) .navigation .nav-button.next.active,
  html body:not(#ka) .navigation .nav-button.next:not(:disabled):not(.disabled):not(.inactive) {
    background: var(--ka-green) !important; color: #fff !important;
  }

  /* место под панель, чтобы она не закрывала контент; шаг занимает весь экран, как в приложении */
  html body:not(#ka) .page.active,
  html body:not(#ka) .step-content {
    padding-bottom: calc(var(--ka-bar-h) + 36px) !important;
    min-height: calc(100vh - 61px); min-height: calc(100dvh - 61px); box-sizing: border-box;
  }

  /* на шагах выбора нижнее меню убираем — его место занимает панель шагов;
     на странице с готовыми комплектами (панели шагов нет) меню возвращается */
  html body:not(#ka) .navigation.hidden { display: none !important; }
  html body:has(.page.active .navigation-container) .appbar,
  html body:has(.navigation:not(.hidden):not([style*="display: none"])) .appbar { display: none !important; }
  html body:has(.page.active .navigation-container) .pcn-footer::after,
  html body:has(.navigation:not(.hidden):not([style*="display: none"])) .pcn-footer::after { height: calc(var(--ka-bar-h) + 24px) !important; }
}

/* ---------- Плавающая панель «Итого + Купить» (js/kits-app.js) ---------- */
.ka-buybar { display: none; }
@media (max-width: 768px) {
  .ka-buybar {
    position: fixed; z-index: 1000; left: 12px; right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom));
    display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 16px; box-sizing: border-box;
    border-radius: 22px; background: rgba(255, 255, 255, .97);
    -webkit-backdrop-filter: blur(18px) saturate(1.8); backdrop-filter: blur(18px) saturate(1.8);
    box-shadow: 0 10px 30px rgba(0, 0, 0, .14);
    font-family: Gilroy, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    opacity: 0; transform: translateY(14px); pointer-events: none;
    transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
  }
  .ka-buybar.is-on { opacity: 1; transform: none; pointer-events: auto; }
  .ka-buybar__info { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
  .ka-buybar__name { font-size: 12px; font-weight: 600; color: #6b716d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ka-buybar__total { font-size: 19px; font-weight: 700; color: #0d0f0e; white-space: nowrap; }
  .ka-buybar__month { font-size: 11.5px; font-weight: 600; color: #3d8f1d; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ka-buybar__month:empty { display: none; }
  .ka-buybar__btn {
    flex: none; height: 48px; padding: 0 26px; border: 0; border-radius: 999px; cursor: pointer;
    background: #4cac26; color: #fff; font: inherit; font-size: 16px; font-weight: 600;
    -webkit-tap-highlight-color: transparent; transition: transform .12s ease, background .2s ease;
  }
  .ka-buybar__btn:active { transform: scale(.96); background: #449b22; }
}
@media (prefers-reduced-motion: reduce) { .ka-buybar { transition: none; } }

/* платёж в месяц под итогом комплекта */
html body:not(#ka) .ka-permonth {
  margin: 4px 4px 0; text-align: right; font-size: 13px; font-weight: 600; color: #3d8f1d;
}
html body:not(#ka) .ka-permonth:empty { display: none; }

/* ---------- Модальные окна: замена, добавление, заказ, подробнее ---------- */
@keyframes ka-pop { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ka-sheet { from { transform: translateY(100%); } to { transform: none; } }
@keyframes ka-fade { from { opacity: 0; } to { opacity: 1; } }

html body:not(#ka) .replace-modal-overlay,
html body:not(#ka) .add-device-modal-overlay,
html body:not(#ka) .order-modal-overlay,
html body:not(#ka) .details-modal-overlay {
  background: rgba(13, 15, 14, .45) !important;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px) !important;
  animation: ka-fade .25s ease both;
}
html body:not(#ka) .replace-modal-content,
html body:not(#ka) .add-device-modal-content,
html body:not(#ka) .order-modal-content,
html body:not(#ka) .details-modal-content {
  border-radius: 28px !important; border: 0 !important; overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .28) !important;
  animation: ka-pop .32s cubic-bezier(.2, .8, .2, 1) both;
}

/* шапка и подвал без линий — воздух вместо рамок */
html body:not(#ka) .replace-modal-header,
html body:not(#ka) .add-device-modal-header { padding: 26px 28px 12px !important; border: 0 !important; }
html body:not(#ka) .replace-modal-title,
html body:not(#ka) .add-device-modal-title { font-size: 22px !important; font-weight: 700; letter-spacing: -.01em; color: #0d0f0e !important; }
html body:not(#ka) .replace-modal-icon,
html body:not(#ka) .add-device-modal-icon {
  display: inline-grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 50%;
  background: #f1f9ec; color: #3d8f1d !important; font-size: 16px !important;
}
html body:not(#ka) .replace-modal-subtitle,
html body:not(#ka) .add-device-modal-subtitle { color: #6b716d !important; font-size: 14px !important; }
html body:not(#ka) .replace-modal-body,
html body:not(#ka) .add-device-modal-body { padding: 8px 28px 12px !important; }
html body:not(#ka) .replace-devices-list,
html body:not(#ka) .add-devices-list { gap: 8px !important; }

/* карточки устройств в окне: фон вместо обводки */
html body:not(#ka) .replace-device-card,
html body:not(#ka) .add-device-card {
  border: 0 !important; border-radius: 18px !important; background: #f6f7f6 !important; box-shadow: none !important;
  padding: 12px 14px !important; gap: 14px !important; transition: background .2s ease, transform .12s ease !important;
  -webkit-tap-highlight-color: transparent;
}
html body:not(#ka) .replace-device-card:hover,
html body:not(#ka) .add-device-card:hover { background: #eff1ef !important; }
html body:not(#ka) .replace-device-card:active,
html body:not(#ka) .add-device-card:active { transform: scale(.985); }
html body:not(#ka) .replace-device-card.selected,
html body:not(#ka) .add-device-card.selected { background: #f1f9ec !important; }
html body:not(#ka) .replace-device-icon,
html body:not(#ka) .add-device-icon {
  width: 56px !important; height: 56px !important; padding: 6px; box-sizing: border-box;
  border-radius: 14px; background: #fff; object-fit: contain;
}
html body:not(#ka) .replace-device-name,
html body:not(#ka) .add-device-name { font-size: 15px !important; font-weight: 600; color: #0d0f0e !important; }
html body:not(#ka) .replace-device-desc,
html body:not(#ka) .add-device-desc { font-size: 13px !important; color: #6b716d !important; }
html body:not(#ka) .replace-device-check { width: 26px !important; height: 26px !important; }
html body:not(#ka) .replace-device-check svg { width: 26px; height: 26px; }
html body:not(#ka) .add-device-checkbox-label { border-radius: 8px !important; }
html body:not(#ka) .add-device-quantity-input { border-radius: 10px !important; }

html body:not(#ka) .replace-modal-footer,
html body:not(#ka) .add-device-modal-footer {
  padding: 14px 28px 24px !important; border: 0 !important; gap: 8px !important;
  box-shadow: 0 -1px 0 rgba(13, 15, 14, .06);
}
html body:not(#ka) .replace-modal-btn,
html body:not(#ka) .add-device-modal-btn {
  height: 48px; padding: 0 26px !important; border: 0 !important; border-radius: 999px !important;
  font-size: 15px !important; font-weight: 600; transition: background .2s ease, transform .12s ease !important;
}
html body:not(#ka) .replace-modal-btn:active,
html body:not(#ka) .add-device-modal-btn:active { transform: scale(.97); }
html body:not(#ka) .replace-btn-back,
html body:not(#ka) .add-device-btn-back { background: rgba(13, 15, 14, .06) !important; color: #0d0f0e !important; }
html body:not(#ka) .replace-btn-next,
html body:not(#ka) .add-device-btn-next { background: #4cac26 !important; color: #fff !important; }
html body:not(#ka) .replace-btn-next:disabled,
html body:not(#ka) .add-device-btn-next:disabled { background: rgba(13, 15, 14, .08) !important; color: rgba(13, 15, 14, .35) !important; opacity: 1 !important; }

/* окно «Подробнее» */
html body:not(#ka) .details-header { border-bottom: 0 !important; box-shadow: 0 1px 0 rgba(13, 15, 14, .06); }
html body:not(#ka) .details-close {
  flex: none; width: 36px !important; height: 36px !important; display: grid !important; place-items: center; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important; background: rgba(13, 15, 14, .06) !important; color: #0d0f0e !important; font-size: 22px !important; line-height: 1;
}
html body:not(#ka) .details-body { overscroll-behavior: contain; }

/* окно заказа */
html body:not(#ka) .order-header { border-bottom: 0 !important; box-shadow: 0 1px 0 rgba(13, 15, 14, .06); }
html body:not(#ka) .order-back-link {
  display: inline-flex !important; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px;
  background: rgba(13, 15, 14, .05); color: #0d0f0e !important; font-weight: 600 !important;
}
html body:not(#ka) .order-right-column { border-left-color: rgba(13, 15, 14, .06) !important; }
html body:not(#ka) .order-kit-select-wrapper,
html body:not(#ka) .order-price-block,
html body:not(#ka) .order-info-box { border: 0 !important; border-radius: 18px !important; }
html body:not(#ka) .order-kit-select-wrapper,
html body:not(#ka) .order-price-block { background: #f6f7f6 !important; }
html body:not(#ka) .order-info-box { background: #f1f9ec !important; }
html body:not(#ka) .order-form-field input { border-radius: 14px !important; }
html body:not(#ka) .order-submit-btn,
html body:not(#ka) .order-payment-select-btn { border-radius: 999px !important; min-height: 52px; box-shadow: none !important; }

/* ---------- Модальные окна на смартфоне: шторка снизу ---------- */
@media (max-width: 768px) {
  html body:not(#ka) .replace-modal,
  html body:not(#ka) .add-device-modal,
  html body:not(#ka) .order-modal,
  html body:not(#ka) .details-modal { align-items: flex-end !important; overflow: hidden !important; }

  html body:not(#ka) .replace-modal-content,
  html body:not(#ka) .add-device-modal-content,
  html body:not(#ka) .order-modal-content,
  html body:not(#ka) .details-modal-content {
    width: 100% !important; max-width: none !important; margin: 0 !important;
    height: auto !important; max-height: 92vh !important; max-height: 92dvh !important;
    border-radius: 28px 28px 0 0 !important;
    display: flex !important; flex-direction: column;
    animation: ka-sheet .38s cubic-bezier(.2, .8, .2, 1) both;
  }
  /* «ручка» шторки */
  html body:not(#ka) .replace-modal-content::before,
  html body:not(#ka) .add-device-modal-content::before,
  html body:not(#ka) .order-modal-content::before,
  html body:not(#ka) .details-modal-content::before {
    content: ""; position: absolute; z-index: 2; top: 8px; left: 50%; width: 40px; height: 5px; margin-left: -20px;
    border-radius: 3px; background: rgba(13, 15, 14, .15);
  }

  html body:not(#ka) .replace-modal-header,
  html body:not(#ka) .add-device-modal-header { padding: 26px 20px 10px !important; flex: none; }
  html body:not(#ka) .replace-modal-title,
  html body:not(#ka) .add-device-modal-title { font-size: 20px !important; }
  html body:not(#ka) .replace-modal-body,
  html body:not(#ka) .add-device-modal-body { padding: 6px 16px 12px !important; overscroll-behavior: contain; }
  html body:not(#ka) .replace-modal-footer,
  html body:not(#ka) .add-device-modal-footer {
    flex: none; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)) !important;
  }
  /* количество выбранного устройства — отдельной строкой под названием */
  html body:not(#ka) .add-device-card { flex-wrap: wrap; }
  html body:not(#ka) .add-device-quantity { flex: 1 0 100%; justify-content: flex-end; margin-top: -4px; }
  html body:not(#ka) .add-device-quantity-input { width: 64px !important; height: 36px; border: 0 !important; background: #fff !important; font-size: 16px !important; }
  html body:not(#ka) .add-device-modal-title { font-size: 19px !important; }
  html body:not(#ka) .replace-modal-btn,
  html body:not(#ka) .add-device-modal-btn { height: 52px; font-size: 16px !important; }
  html body:not(#ka) .replace-btn-back,
  html body:not(#ka) .add-device-btn-back { flex: 1 1 0; }
  html body:not(#ka) .replace-btn-next,
  html body:not(#ka) .add-device-btn-next { flex: 2 1 0; }

  /* заказ: одна прокрутка на всё окно вместо двух вложенных */
  html body:not(#ka) .order-header { flex: none; padding: 22px 16px 10px !important; }
  html body:not(#ka) .order-modal-content > .order-body {
    display: block !important; flex: 1 1 auto; min-height: 0; overflow-y: auto !important;
    overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  }
  html body:not(#ka) .order-modal-content > .order-body[style*="display: none"] { display: none !important; }
  html body:not(#ka) .order-details-section,
  html body:not(#ka) .order-right-column { overflow: visible !important; padding: 16px !important; }
  html body:not(#ka) .order-right-column { padding-bottom: calc(20px + env(safe-area-inset-bottom)) !important; }
}
@media (prefers-reduced-motion: reduce) {
  html body:not(#ka) .replace-modal-content, html body:not(#ka) .add-device-modal-content,
  html body:not(#ka) .order-modal-content, html body:not(#ka) .details-modal-content,
  html body:not(#ka) .replace-modal-overlay, html body:not(#ka) .add-device-modal-overlay,
  html body:not(#ka) .order-modal-overlay, html body:not(#ka) .details-modal-overlay { animation: none !important; }
}

/* ---------- Открыто меню из шапки: плавающие панели уходят, меню их перекрывает ---------- */
body.pcn-menu-open .ka-buybar,
html body.pcn-menu-open:not(#ka) .navigation,
html body.pcn-menu-open:not(#ka) .navigation-container {
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
