/* Конфигуратор модульного дивана: слева сцена (3D / чертёж), справа панель; на мобильных — друг под другом.
   Основа — стили конфигуратора выключателей (electro.css): инструменты, плитки, кружки, чертёж, смета */
.sofacfg {
    grid-template-columns: minmax(0, 1fr) 380px;
    color: var(--color-whte, #fff);
}

/* Липкая колонка, высота сцены и плашка итога — общие (configurator-kit/kit.css: .cfg-view, .cfg-stage, .cfg-deal) */
.sofacfg__stage {
    border-radius: 32px;
    overflow: hidden;
    background:
        radial-gradient(ellipse at 50% 70%, rgba(255, 236, 210, .16), transparent 62%),
        linear-gradient(180deg, #3a3633 0%, #1f1d1b 100%);
    border: 1px solid rgba(255, 255, 255, .08);
    transition: background .6s;
}

.sofacfg__stage.is-night {
    background:
        radial-gradient(ellipse at 50% 75%, rgba(255, 170, 90, .08), transparent 55%),
        linear-gradient(180deg, #121110 0%, #080707 100%);
}

/* Чертёж: синяя «калька» с сеткой */
.sofacfg__stage.is-2d {
    background:
        linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 24px 24px,
        linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px) 0 0 / 24px 24px,
        #17324d;
}

.sofacfg__stage > canvas {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    display: block;
    cursor: grab;
    touch-action: none;
}

.sofacfg__stage > canvas:active {
    cursor: grabbing;
}

.sofacfg__stage.is-2d > canvas,
html.has-site-cursor .sofacfg__stage.is-2d > canvas {
    cursor: default !important;
}

.sofacfg__loader {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    transition: opacity .4s;
}

.sofacfg__loader span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, .15);
    border-top-color: var(--color-alt, #97bf74);
    animation: sofacfg-spin 1s linear infinite;
}

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

.sofacfg--ready .sofacfg__loader {
    opacity: 0;
    pointer-events: none;
}

.sofacfg__nogl {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    bottom: 56px;
    padding: 0 24px;
    text-align: center;
    color: rgba(255, 255, 255, .7);
}

.sofacfg--nogl .sofacfg__nogl {
    display: block;
}

.sofacfg--nogl .sofacfg__tools,
.sofacfg--nogl .sofacfg__loader {
    display: none;
}

/* Панель инструментов на сцене */
.sofacfg__tools {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sofacfg__tool {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(0, 0, 0, .3);
    color: #fff;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, opacity .2s;
}

.sofacfg__tool:hover:not(:disabled, .is-off) {
    border-color: var(--color-alt, #97bf74);
    background: rgba(0, 0, 0, .5);
}

.sofacfg__tool.is-active,
.sofacfg__tool.is-active:hover:not(:disabled) {
    background: var(--color-alt, #97bf74);
    border-color: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__tool:disabled,
.sofacfg__tool.is-off {
    opacity: .35;
    cursor: default;
}

.sofacfg__mode {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .2);
    background: rgba(0, 0, 0, .3);
}

.sofacfg__mode button {
    min-width: 34px;
    padding: 7px 12px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.sofacfg__mode button.is-active {
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__icon-sun,
.sofacfg__tool--night.is-active .sofacfg__icon-moon {
    display: none;
}

.sofacfg__tool--night.is-active .sofacfg__icon-sun {
    display: block;
}

@keyframes sofacfg-pulse {
    50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--st) 10%, transparent); }
}

@keyframes sofacfg-fade {
    from { opacity: 0; transform: translateY(-4px); }
}

/* Подпись детали под курсором */
.sofacfg__tip {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 4;
    max-width: 260px;
    padding: 6px 10px;
    border-radius: 10px;
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(0, 0, 0, .3);
}

.sofacfg__tip[hidden] {
    display: none;
}

.sofacfg__hint {
    position: absolute;
    left: 20px;
    bottom: 16px;
    z-index: 2;
    max-width: calc(100% - 40px);
    font-size: 13px;
    line-height: 1.35;
    color: rgba(255, 255, 255, .45);
    pointer-events: none;
}

/* Лист чертежа: подписи видов, размеры, выноски и штамп поверх холста */
.sofacfg__sheet {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
}

.sofacfg__sheet[hidden] {
    display: none;
}

.sofacfg__dim,
.sofacfg__mark,
.sofacfg__caption {
    position: absolute;
    left: 0;
    top: 0;
}

.sofacfg__caption {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: rgba(232, 241, 255, .75);
    white-space: nowrap;
}

.sofacfg__dim {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.sofacfg__mark {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    box-shadow: 0 0 0 2px #17324d;
}

.sofacfg__stamp {
    position: absolute;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 14px;
    border: 1px solid rgba(232, 241, 255, .6);
    font-size: 12px;
    line-height: 1.3;
    color: rgba(232, 241, 255, .9);
}

.sofacfg__stamp[hidden] {
    display: none;
}

/* Строки штампа не переносятся: на снимке каждая рисуется одной строкой */
.sofacfg__stamp > *,
.sofacfg__legend > * {
    white-space: nowrap;
}

.sofacfg__stamp.is-compact {
    gap: 1px;
    padding: 5px 7px;
    font-size: 9px;
    line-height: 1.25;
}

.sofacfg__legend {
    display: flex;
    flex-direction: column;
    gap: 1px;
    padding: 4px 0;
    border-block: 1px solid rgba(232, 241, 255, .25);
}

.sofacfg__legend:empty,
.sofacfg__legend[hidden],
.sofacfg__mark[hidden] {
    display: none;
}

/* Панель */
.sofacfg__panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 22px;
    border-radius: 28px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: #1d1f1d;
}

.sofacfg__group {
    min-width: 0;
    border-radius: 18px;
    transition: box-shadow .3s, background .3s;
}

/* Деталь выбрали на сцене — раздел коротко подсвечивается */
.sofacfg__group.is-flash {
    animation: sofacfg-flash-sec 1.4s ease-out;
}

@keyframes sofacfg-flash-sec {
    0%, 30% { box-shadow: 0 0 0 10px rgba(151, 191, 116, .18); background: rgba(151, 191, 116, .18); }
    100% { box-shadow: 0 0 0 10px rgba(151, 191, 116, 0); background: rgba(151, 191, 116, 0); }
}

.sofacfg__head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.sofacfg__label {
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--color-alt, #97bf74);
}

.sofacfg__sublabel {
    margin: 4px 0 6px;
    font-size: 12px;
    color: rgba(255, 255, 255, .55);
}

.sofacfg__sublabel ~ .sofacfg__sublabel {
    margin-top: 12px;
}

.sofacfg__note {
    min-width: 0;
    overflow: hidden;
    font-size: 12px;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, .55);
}

.sofacfg__meta {
    margin-top: 10px;
    font-size: 12px;
    line-height: 1.4;
    color: rgba(255, 255, 255, .55);
}

/* Карточки каталога «снимок + название + характеристики» в один ряд, что не влезло — свайпом */
.sofacfg__cards {
    display: flex;
    gap: 8px;
    margin: -2px;
    padding: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
}

.sofacfg__cards::-webkit-scrollbar {
    display: none;
}

/* Стрелка прокрутки ряда — на середине снимка (kit.css: .cfg-arrow) */
.cfg-rail:has(> .sofacfg__cards) {
    --cfg-arrow-top: 21px;
}

.sofacfg__card {
    flex: 0 0 104px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    scroll-snap-align: start;
    cursor: pointer;
}

.sofacfg__card[hidden] {
    display: none;
}

.sofacfg__card-img {
    position: relative;
    display: block;
    aspect-ratio: 4 / 3;
    margin-bottom: 3px;
    border-radius: 14px;
    overflow: hidden;
    background: linear-gradient(#f1f3f0, #d9ddd6);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12);
    transition: box-shadow .2s, opacity .2s;
}

.sofacfg__card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sofacfg__card-img::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 0 var(--color-alt, #97bf74);
    transition: box-shadow .2s;
}

.sofacfg__card:hover .sofacfg__card-img::after {
    box-shadow: inset 0 0 0 2px var(--color-alt, #97bf74);
}

.sofacfg__card.is-active .sofacfg__card-img::after {
    box-shadow: inset 0 0 0 3px var(--color-alt, #97bf74);
}

.sofacfg__card-name {
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}

.sofacfg__card.is-active .sofacfg__card-name {
    color: var(--color-alt, #97bf74);
}

.sofacfg__card-sub {
    font-size: 11px;
    line-height: 1.25;
    color: rgba(255, 255, 255, .5);
}

.sofacfg__card-sub.is-why {
    color: #ff8a8e;
}

/* Недоступный вариант: приглушён, причина — вместо характеристик */
.sofacfg__card.is-off {
    cursor: not-allowed;
}

.sofacfg__card.is-off .sofacfg__card-img {
    opacity: .4;
}

.sofacfg__card.is-off:hover .sofacfg__card-img::after {
    box-shadow: none;
}

.sofacfg__row {
    display: flex;
    gap: 14px;
    margin-top: 8px;
}

.sofacfg__link {
    padding: 0;
    border: 0;
    background: none;
    color: rgba(255, 255, 255, .6);
    font: inherit;
    font-size: 12px;
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, .25);
    text-underline-offset: 3px;
    cursor: pointer;
}

.sofacfg__link:hover {
    color: var(--color-alt, #97bf74);
}

/* Подтверждение замен при смене корпуса или платы */
.sofacfg__confirm {
    margin-top: 10px;
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(242, 184, 75, .12);
    border: 1px solid rgba(242, 184, 75, .4);
    font-size: 13px;
    line-height: 1.4;
    animation: sofacfg-fade .25s ease-out;
}

.sofacfg__confirm[hidden] {
    display: none;
}

.sofacfg__confirm ul {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 10px;
    padding: 0;
    list-style: none;
}

.sofacfg__confirm li span {
    font-weight: 600;
}

.sofacfg__confirm li em {
    font-style: normal;
    color: #ff8a8e;
}

.sofacfg__confirm li small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, .55);
}

.sofacfg__confirm-btns {
    display: flex;
    gap: 6px;
}

.sofacfg__btn {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.sofacfg__btn--ok {
    border-color: var(--color-alt, #97bf74);
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

/* Сегменты и кружки отделок */
.sofacfg__seg {
    display: flex;
    gap: 4px;
    padding: 4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .06);
}

.sofacfg__opt {
    flex: 1 1 auto;
    padding: 8px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.sofacfg__opt:hover {
    background: rgba(255, 255, 255, .08);
}

.sofacfg__opt.is-active {
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__swatches {
    display: flex;
    gap: 8px;
}

.sofacfg__swatch {
    width: 32px;
    height: 32px;
    flex: none;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--sw);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), 0 0 12px color-mix(in srgb, var(--sw) 55%, transparent);
    outline: 2px solid transparent;
    outline-offset: 3px;
    cursor: pointer;
    transition: outline-color .2s, transform .15s;
}

.sofacfg__swatch:hover {
    transform: scale(1.08);
}

.sofacfg__swatch.is-active {
    outline-color: var(--color-alt, #97bf74);
}

/* Смета */
.sofacfg__spec {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.sofacfg__spec td {
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    vertical-align: top;
}

.sofacfg__spec td small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    line-height: 1.3;
    color: rgba(255, 255, 255, .5);
}

.sofacfg__spec td + td {
    padding-left: 12px;
    text-align: right;
    white-space: nowrap;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* Низ широкой сцены занят плашкой итога — подсказка уходит в левый верхний угол */
@container (min-width: 900px) {
    .sofacfg__hint {
        top: 20px;
        left: 20px;
        right: auto;
        bottom: auto;
        max-width: min(340px, calc(100% - 520px));
        text-align: left;
    }

}

@media (max-width: 1024px) {
    .sofacfg {
        grid-template-columns: minmax(0, 1fr);
    }

}

/* Телефон: сцена, кнопки разделов и итог — в один экран; панель — окном поверх кнопок (kit.css: .cfg-panel) */
@media (max-width: 600px) {
    .sofacfg .sofacfg__stage {
        aspect-ratio: 1 / .88;
        border-radius: 20px;
    }

    .sofacfg__hint {
        display: none;
    }

    .sofacfg__tools {
        top: 10px;
        right: 10px;
        gap: 4px;
    }

    .sofacfg__tool {
        width: 34px;
        height: 34px;
    }

    .sofacfg__tool svg {
        width: 18px;
        height: 18px;
    }

    .sofacfg__mode button {
        padding: 6px 9px;
        font-size: 12px;
    }

    .sofacfg__panel .sofacfg__card {
        flex-basis: 120px;
    }

    /* Подпись справа в шапке раздела — левее крестика окна */
    .sofacfg__head {
        padding-right: 44px;
    }

    .sofacfg__panel .sofacfg__swatches {
        gap: 12px;
        margin-block: -9px;
        padding-block: 9px;
    }

    .sofacfg__panel .sofacfg__swatch {
        width: 46px;
        height: 46px;
    }

    .sofacfg__dim {
        padding: 1px 4px;
        font-size: 9px;
    }

    .sofacfg__caption {
        font-size: 9px;
    }

    .sofacfg__mark {
        width: 16px;
        height: 16px;
        font-size: 9px;
    }

    /* Вкладки: три в ряд; у «Питания» и проблемных разделов — цветная точка */
    .sofacfg .cfg-tab {
        position: relative;
    }

    .sofacfg .cfg-tab--main {
        padding: 7px 4px 6px;
    }

    .sofacfg .cfg-tab-ico {
        height: 22px;
    }

    .sofacfg .cfg-tab-ico svg {
        width: 24px;
        height: 22px;
    }

    .sofacfg .cfg-tab-sw {
        width: 20px;
        height: 20px;
    }

}

/* На чертеже подписи видов говорят сами за себя — подсказку прячем, чтобы не спорила со штампом */
.sofacfg__stage.is-2d .sofacfg__hint {
    display: none;
}

/* ---------- Своё: плитки, схема сверху, «+» на сцене, меню модулей, спальное место, опции ---------- */

/* Плитки «схема + подпись»: готовые сборки, модули, подлокотники, ножки, ткани */
.sofacfg__tiles {
    display: flex;
    gap: 6px;
    margin: -2px;
    padding: 2px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.sofacfg__tiles::-webkit-scrollbar {
    display: none;
}

.sofacfg__tile {
    flex: 0 0 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    padding: 8px 4px 7px;
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 14px;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: background .2s, border-color .2s, color .2s, opacity .2s;
}

.sofacfg__tile > svg {
    width: 40px;
    height: 32px;
}

.sofacfg__tile small {
    font-size: 11px;
    line-height: 1.2;
    text-align: center;
    opacity: .75;
}

.sofacfg__tile:hover:not(:disabled) {
    border-color: var(--color-alt, #97bf74);
}

.sofacfg__tile.is-active {
    background: var(--color-alt, #97bf74);
    border-color: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__tile.is-active small {
    opacity: 1;
}

.sofacfg__tile:disabled {
    opacity: .3;
    cursor: not-allowed;
}

.sofacfg__tile--plan {
    flex-basis: 84px;
}

.sofacfg__tile--plan > span {
    display: grid;
    place-items: center;
    height: 38px;
}

/* Схема сверху: сиденья, спинки (плотнее), подлокотники */
.sofa-plan {
    display: block;
    overflow: visible;
}

.sofa-plan__seat {
    fill: currentColor;
    fill-opacity: .12;
}

.sofa-plan__back,
.sofa-plan__arm {
    fill: currentColor;
    fill-opacity: .45;
    stroke-width: .8;
}

.sofa-plan__mod.is-sel .sofa-plan__seat {
    fill: var(--color-alt, #97bf74);
    fill-opacity: .4;
    stroke: var(--color-alt, #97bf74);
}

.sofacfg__tile.is-active .sofa-plan__mod.is-sel .sofa-plan__seat {
    fill: currentColor;
    stroke: currentColor;
    fill-opacity: .12;
}

.sofacfg__plan {
    display: grid;
    place-items: center;
    min-height: 120px;
    margin-bottom: 8px;
    padding: 12px;
    border-radius: 16px;
    background: rgba(255, 255, 255, .05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}

.sofacfg__plan .sofa-plan {
    width: 100%;
    height: auto;
    max-height: 170px;
}

.sofacfg__plan [data-sofa-mod] {
    cursor: pointer;
}

.sofacfg__plan [data-sofa-mod]:hover .sofa-plan__seat {
    fill-opacity: .28;
}

.sofacfg__dims {
    margin-left: 6px;
    color: rgba(255, 255, 255, .85);
    font-variant-numeric: tabular-nums;
}

.sofacfg__selbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
}

.sofacfg__selbar span {
    color: rgba(255, 255, 255, .8);
}

.sofacfg__link:disabled {
    opacity: .35;
    cursor: default;
}

.sofacfg__row {
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.sofacfg__row .sofacfg__btn {
    flex: 1 1 0;
}

.sofacfg__btn:hover:not(:disabled, .is-off) {
    border-color: var(--color-alt, #97bf74);
    color: var(--color-alt, #97bf74);
}

.sofacfg__btn:disabled,
.sofacfg__btn.is-off {
    opacity: .35;
    cursor: default;
}

.sofacfg__btn.is-active {
    border-color: var(--color-alt, #97bf74);
    color: var(--color-alt, #97bf74);
}

.sofacfg__meta[hidden] {
    display: none;
}

.sofacfg__meta.is-warn {
    color: #f2b84b;
}

/* Ткани: кружок с рисунком ткани в текущем цвете */
.sofacfg__tile--fabric {
    flex: 1 0 64px;
}

.sofacfg__fabric-sw {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--sw, #888) var(--tex, none) center / 180% auto;
    background-blend-mode: multiply;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .25), inset 0 -3px 6px rgba(0, 0, 0, .25);
}

.sofacfg__label--sub {
    margin-top: 14px;
}

.sofacfg__seg + .sofacfg__label,
.sofacfg__tiles + .sofacfg__label,
.cfg-rail + .sofacfg__label,
.sofacfg__meta + .sofacfg__label {
    margin-top: 14px;
}

.sofacfg__sublabel:first-of-type {
    margin-top: 0;
}

.sofacfg__seg {
    margin-top: 10px;
}

.sofacfg__label + .sofacfg__seg {
    margin-top: 0;
}

.sofacfg__opt:disabled {
    opacity: .35;
    cursor: default;
    background: transparent;
}

.sofacfg__swatches {
    margin: -7px -7px;
    padding: 7px 7px;
    overflow-x: auto;
    scrollbar-width: none;
}

.sofacfg__swatches::-webkit-scrollbar {
    display: none;
}

.sofacfg__swatch[hidden] {
    display: none !important;
}

.sofacfg__swatch {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 0 -3px 6px rgba(0, 0, 0, .18);
}

/* Металл и дерево декора — с бликом */
.sofacfg__swatch--metal {
    background: radial-gradient(circle at 32% 28%, rgba(255, 255, 255, .85), transparent 38%), linear-gradient(135deg, var(--sw), color-mix(in srgb, var(--sw) 55%, #000));
}

.sofacfg__swatch--wood {
    background: repeating-linear-gradient(100deg, var(--sw) 0 3px, color-mix(in srgb, var(--sw) 82%, #000) 3px 4px, var(--sw) 4px 7px);
}

.sofacfg__swatches--small {
    gap: 6px;
    margin-top: 2px;
    padding-left: 44px;
}

.sofacfg__swatches--small .sofacfg__swatch {
    width: 24px;
    height: 24px;
}

.sofacfg__swatches--small[hidden] {
    display: none;
}

/* Опции — кнопки с «плюсиком»; у ящика и спального места — кнопка анимации */
.sofacfg__opts {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sofacfg__optcard {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    padding: 8px 10px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, .12);
    transition: border-color .2s, background .2s;
}

.sofacfg__optcard.is-on {
    border-color: rgba(151, 191, 116, .55);
    background: rgba(151, 191, 116, .08);
}

.sofacfg__plusopt {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sofacfg__plusopt i {
    position: relative;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, .25);
    transition: background .2s, border-color .2s, transform .25s;
}

.sofacfg__plusopt i::before,
.sofacfg__plusopt i::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 12px;
    height: 2px;
    margin: -1px 0 0 -6px;
    border-radius: 1px;
    background: currentColor;
    transition: transform .25s;
}

.sofacfg__plusopt i::after {
    transform: rotate(90deg);
}

.sofacfg__plusopt.is-active i {
    background: var(--color-alt, #97bf74);
    border-color: var(--color-alt, #97bf74);
    color: #1d1f1d;
    transform: rotate(45deg);
}

.sofacfg__plusopt:hover i {
    border-color: var(--color-alt, #97bf74);
}

.sofacfg__plusopt b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
}

.sofacfg__plusopt small {
    display: block;
    font-size: 11px;
    line-height: 1.3;
    color: rgba(255, 255, 255, .5);
}

.sofacfg__play {
    flex: none;
    padding: 6px 12px;
    border: 1px solid var(--color-alt, #97bf74);
    border-radius: 999px;
    background: transparent;
    color: var(--color-alt, #97bf74);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.sofacfg__play:hover,
.sofacfg__play.is-active {
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__play[hidden] {
    display: none;
}

/* ---------- Поверх сцены ---------- */

.sofacfg__overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    overflow: hidden;
    pointer-events: none;
}

.sofacfg__stage.is-2d .sofacfg__overlay {
    display: none;
}

/* «+» у краёв дивана — пульсирующая зелёная кнопка */
.sofacfg__plus {
    position: absolute;
    left: 0;
    top: 0;
    width: 44px;
    height: 44px;
    margin: -22px 0 0 -22px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .35);
    pointer-events: auto;
    cursor: pointer;
    animation: sofacfg-ring 2.4s ease-out infinite;
    transition: transform .15s, opacity .25s;
}

.sofacfg__plus:hover,
.sofacfg__plus.is-open {
    animation: none;
    box-shadow: 0 0 0 6px rgba(151, 191, 116, .3), 0 6px 18px rgba(0, 0, 0, .35);
}

.sofacfg__plus[hidden] {
    display: none;
}

.sofacfg__plus.is-far {
    opacity: 0;
    pointer-events: none;
}

@keyframes sofacfg-ring {
    0% { box-shadow: 0 0 0 0 rgba(151, 191, 116, .55), 0 6px 18px rgba(0, 0, 0, .35); }
    70%, 100% { box-shadow: 0 0 0 14px rgba(151, 191, 116, 0), 0 6px 18px rgba(0, 0, 0, .35); }
}

/* Плашка выбранного модуля над ним */
.sofacfg__chip {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 4px 4px 12px;
    border-radius: 999px;
    background: rgba(29, 31, 29, .88);
    border: 1px solid rgba(151, 191, 116, .6);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: auto;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}

.sofacfg__chip[hidden] {
    display: none;
}

.sofacfg__chip span {
    margin-right: 6px;
}

.sofacfg__chip button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    cursor: pointer;
}

.sofacfg__chip button:hover:not(:disabled) {
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__chip button:disabled {
    opacity: .3;
    cursor: default;
}

/* Меню модулей: добавить или заменить */
.sofacfg__menu {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 6;
    width: 250px;
    padding: 8px;
    border-radius: 18px;
    background: #262325;
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
    animation: sofacfg-fade .2s ease-out;
}

.sofacfg__menu[hidden] {
    display: none;
}

.sofacfg__menu-title {
    padding: 4px 8px 8px;
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--color-alt, #97bf74);
}

.sofacfg__menu-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-height: 340px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
}

.sofa-plan__split {
    stroke-opacity: .6;
    stroke-dasharray: 2 2;
}

.sofacfg__menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.sofacfg__menu-item:hover:not(:disabled) {
    background: rgba(151, 191, 116, .18);
}

.sofacfg__menu-item:disabled {
    opacity: .35;
    cursor: not-allowed;
}

.sofacfg__menu-item.is-active {
    box-shadow: inset 0 0 0 1px var(--color-alt, #97bf74);
}

.sofacfg__menu-ico {
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, .06);
}

.sofacfg__menu-item b {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.sofacfg__menu-item small {
    display: block;
    font-size: 11px;
    color: rgba(255, 255, 255, .5);
}

.sofacfg__menu-why {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 12px;
    line-height: 1.35;
    color: #f2b84b;
}

/* Подписи в 3D: габариты, спальное место */
.sofacfg__labels > * {
    position: absolute;
    left: 0;
    top: 0;
    white-space: nowrap;
}

.sofacfg__label3d {
    padding: 2px 7px;
    border-radius: 6px;
    background: rgba(29, 31, 29, .78);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    transition: opacity .3s;
}

.sofacfg__label3d--mod {
    background: rgba(29, 31, 29, .55);
    font-weight: 600;
    color: rgba(255, 255, 255, .85);
}

.sofacfg__label3d--bed {
    background: var(--color-alt, #97bf74);
    color: #1d1f1d;
}

.sofacfg__bed {
    padding: 6px 12px;
    border-radius: 12px;
    background: rgba(151, 191, 116, .92);
    color: #1d1f1d;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .3);
    transition: opacity .3s;
}

.sofacfg__bed b {
    display: block;
    font-size: 17px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.sofacfg__labels [hidden] {
    display: none;
}

.sofacfg__dim--bed {
    background: #f2d27a;
}

@media (max-width: 600px) {
    .sofacfg__panel .sofacfg__tile {
        flex-basis: 84px;
    }

    .sofacfg__plus {
        width: 38px;
        height: 38px;
        margin: -19px 0 0 -19px;
    }

    .sofacfg__menu {
        width: 230px;
    }

    .sofacfg__label3d {
        font-size: 10px;
    }

    .sofacfg__bed {
        padding: 4px 9px;
        font-size: 11px;
    }

    .sofacfg__bed b {
        font-size: 14px;
    }

    .sofacfg__plan .sofa-plan {
        max-height: 120px;
    }
}

/* Смена кадра: копия прежнего кадра поверх сцены размывается и растворяется */
.sofacfg__fade {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
}

.sofacfg__hint {
    color: rgba(255, 255, 255, .6);
    text-shadow: 0 1px 6px rgba(0, 0, 0, .35);
}

.sofacfg__hint[hidden] {
    display: none;
}

.sofacfg__hint:has(.sofacfg__hint-close) {
    padding-right: 20px;
}

.sofacfg__hint-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    position: absolute;
    top: -1px;
    right: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: rgba(255, 255, 255, .7);
    cursor: pointer;
    pointer-events: auto;
    transition: background .2s, color .2s;
}

.sofacfg__hint-close:hover {
    background: rgba(255, 255, 255, .22);
    color: #fff;
}

/* Подлокотники на схеме — выбираются как модули; столешница столика — деревом */
.sofa-plan__wood {
    fill: #b88d5e;
    fill-opacity: .55;
    stroke-width: .6;
}

.sofacfg__plan [data-sofa-armpick] {
    cursor: pointer;
}

.sofacfg__plan [data-sofa-armpick]:hover .sofa-plan__arm {
    fill-opacity: .7;
}

.sofa-plan__mod.is-sel .sofa-plan__arm {
    fill: var(--color-alt, #97bf74);
    fill-opacity: .8;
    stroke: var(--color-alt, #97bf74);
}

/* Куда можно поставить опцию — мигает */
.sofa-plan__mod.is-blink .sofa-plan__seat,
.sofa-plan__mod.is-blink .sofa-plan__arm {
    stroke: var(--color-alt, #97bf74);
    animation: sofa-blink .7s ease-in-out 3, sofa-blink-rest .1s 2.1s forwards;
}

@keyframes sofa-blink {
    0%, 100% { fill: currentColor; fill-opacity: .12; }
    50% { fill: var(--color-alt, #97bf74); fill-opacity: .75; }
}

@keyframes sofa-blink-rest {
    to { fill: var(--color-alt, #97bf74); fill-opacity: .3; }
}

.sofacfg__menu-item[hidden],
.sofacfg__menu-sub[hidden],
.sofacfg__play[hidden],
.sofacfg__optcard[hidden] {
    display: none;
}

.sofacfg__menu-sub {
    margin-top: 6px;
    padding: 8px 8px 4px;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}

.sofacfg__menu-ico svg {
    color: rgba(255, 255, 255, .85);
}

/* Опция не подходит выбранному модулю: приглушена, нажатие — подсветить подходящие */
.sofacfg__optcard.is-na .sofacfg__plusopt b {
    color: rgba(255, 255, 255, .6);
}

.sofacfg__optcard.is-na .sofacfg__plusopt i {
    border-style: dashed;
}

.sofacfg__optcard.is-pick {
    border-color: var(--color-alt, #97bf74);
    box-shadow: 0 0 0 3px rgba(151, 191, 116, .18);
}

.sofacfg__opts + .sofacfg__meta,
.sofacfg__meta + .sofacfg__sublabel {
    margin-top: 10px;
}

[data-sofa-optcard] + [data-sofa-optcard] {
    margin-top: 0;
}

/* Опции в меню шестерёнки: кружок-галочка */
.sofacfg__menu-check {
    position: relative;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0 4px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .35);
    transition: background .2s, border-color .2s;
}

.sofacfg__menu-check::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid #1d1f1d;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
}

.sofacfg__menu-item--opt.is-active {
    box-shadow: none;
}

.sofacfg__menu-item--opt.is-active .sofacfg__menu-check {
    background: var(--color-alt, #97bf74);
    border-color: var(--color-alt, #97bf74);
}

.sofacfg__menu-item--opt.is-active .sofacfg__menu-check::after {
    opacity: 1;
}

.sofacfg__menu-why.is-info {
    color: rgba(255, 255, 255, .6);
}

.sofacfg__chip button.is-open {
    background: rgba(151, 191, 116, .25);
}

/* Слои поверх 3D: подписи размеров — ниже, «+» и плашка выбранного — над ними (меню и подсказка — ещё выше) */
.sofacfg__labels > * {
    z-index: 0;
}

.sofacfg__plus {
    z-index: 2;
}

.sofacfg__chip {
    z-index: 3;
}

/* ▶ на плашке: запустить анимацию механизма выбранного модуля; когда открыто — «вернуть» */
.sofacfg__chip button.sofacfg__chip-play {
    color: var(--color-alt, #97bf74);
}

.sofacfg__chip-play .sofacfg__icon-back,
.sofacfg__chip-play.is-on .sofacfg__icon-play {
    display: none;
}

.sofacfg__chip-play.is-on .sofacfg__icon-back {
    display: block;
}

.sofacfg__chip button[hidden] {
    display: none;
}

/* Название цвета справа в подписи ряда («ЦВЕТ ……… Дуб») — плавающее: подпись его замыкает, иначе ряд кружков
   под ней сужается до свободного места рядом с ним и обрезается справа */
.sofacfg__label--sub {
    display: flow-root;
}

/* Пояснение «почему ничего не поставить» — под заголовком меню */
.sofacfg__menu-title + .sofacfg__menu-why {
    margin: -4px 0 6px;
}

/* Подсказка у неактивной кнопки: почему она не работает */
.sofacfg__off-tip {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    max-width: 280px;
    padding: 9px 12px;
    border-radius: 10px;
    background: #1d1f1d;
    border: 1px solid rgba(255, 255, 255, .14);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
    opacity: 0;
    transition: opacity .15s;
}

.sofacfg__off-tip.is-on {
    opacity: 1;
}
