#shtaket .shtaket-catalog-controls {
    margin: 24px 0;
    padding: 20px;
    border: 1px solid #e0dbe8;
    border-radius: 12px;
    background: #fff;
}

#shtaket .shtaket-catalog-controls h3 {
    margin: 0 0 18px;
}

#shtaket .shtaket-catalog-top {
    max-width: 610px;
}

#shtaket .shtaket-catalog-field {
    display: flex;
    flex-direction: column;
    gap: 7px;
    min-width: 0;
}

#shtaket .shtaket-catalog-field>span,
#shtaket .shtaket-catalog-field-title {
    font-size: 16px;
    font-weight: 500;
}

#shtaket .shtaket-catalog-field select {
    width: 100%;
    min-height: 46px;
    padding: 9px 12px;
    border: 1px solid #c9c5cd;
    border-radius: 10px;
    background: #fff;
}

#shtaket .shtaket-catalog-field select:disabled {
    color: #9b95a1;
    background: #f6f5f7;
    cursor: not-allowed;
}

#shtaket .shtaket-color-section {
    margin-top: 20px;
}

#shtaket .shtaket-catalog-field-title {
    margin-bottom: 10px;
}

#shtaket .shtaket-color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
    gap: 12px;
    width: 100%;
}

#shtaket .shtaket-color-grid.is-disabled {
    display: block;
}

#shtaket .shtaket-color-empty {
    padding: 16px 18px;
    border: 1px dashed #d8d2df;
    border-radius: 10px;
    color: #958d9d;
    background: #faf9fb;
}

#shtaket .shtaket-color-card {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
    min-height: 88px;
    padding: 12px 14px;
    border: 1px solid #d9d3df;
    border-radius: 12px;
    background: #fff;
    color: #1f1b22;
    text-align: left;
    cursor: pointer;
    transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

#shtaket .shtaket-color-card:hover {
    border-color: #8a62aa;
    box-shadow: 0 2px 8px rgba(82, 49, 107, .08);
}

#shtaket .shtaket-color-card.is-selected {
    border: 2px solid #724b9a;
    padding: 11px 13px;
    background: #fbf9fd;
}

#shtaket .shtaket-color-card-image {
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    object-fit: contain;
    object-position: center;
}

#shtaket .shtaket-color-card-image-empty {
    display: block;
    border: 1px solid #e1dce5;
    border-radius: 8px;
    background: #f6f5f7;
}

#shtaket .shtaket-color-card-label {
    display: block;
    min-width: 0;
    font-size: 16px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

#shtaket .shtaket-thickness-section {
    max-width: 420px;
    margin-top: 20px;
    margin-bottom: 14px;
}

#shtaket .shtaket-thickness-section .shtaket-catalog-muted {
    margin: 6px 0 0;
}

#shtaket .shtaket-catalog-muted {
    color: #8c8496;
    font-size: 14px;
    margin-bottom: 12px;
}

#shtaket .shtaket-catalog-alert {
    margin: 12px 0;
    padding: 10px 12px;
    border-radius: 8px;
}

#shtaket .shtaket-catalog-alert-danger {
    background: #fff0f0;
    color: #a02020;
}

#shtaket .shtaket-catalog-alert-info {
    background: #f3eff8;
    color: #5f447c;
}

#shtaket .shtaket-catalog-alert-success {
    background: #edf8ef;
    color: #26733a;
}

#shtaket .shtaket-result-card {
    margin-top: 24px;
}

#shtaket .shtaket-result-table td,
#shtaket .shtaket-result-table th {
    vertical-align: top;
}

#shtaket .shtaket-result-table small {
    display: block;
    margin-top: 4px;
    color: #8b8491;
}

#shtaket .shtaket-length-breakdown {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px dashed #ddd5e4;
}

#shtaket .shtaket-length-title {
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #5f5864;
}

#shtaket .shtaket-length-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(170px, 1fr));
    gap: 6px 14px;
    max-width: 560px;
}

#shtaket .shtaket-length-item {
    display: grid;
    grid-template-columns: minmax(72px, auto) 1fr;
    align-items: center;
    gap: 12px;
    min-height: 34px;
    padding: 6px 10px;
    border: 1px solid #ebe6ef;
    border-radius: 7px;
    background: #faf9fb;
    font-size: 14px;
}

#shtaket .shtaket-length-value {
    white-space: nowrap;
    color: #302b34;
}

#shtaket .shtaket-length-count {
    text-align: right;
    white-space: nowrap;
    margin-left: 10px;
}

#shtaket .shtaket-text-row {
    color: #777080;
}

#shtaket .shtaket-total {
    margin: 14px 0 20px;
    font-size: 20px;
    font-weight: 700;
    text-align: right;
}

#shtaket .shtaket-manager-form {
    margin-top: 22px;
    padding: 18px;
    border: 1px solid #e1dce7;
    border-radius: 12px;
}

#shtaket .shtaket-contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    gap: 14px;
    margin: 14px 0;
}

#shtaket .shtaket-contact-grid label {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#shtaket .shtaket-contact-grid input {
    min-height: 42px;
    padding: 8px 12px;
    border: 1px solid #c9c5cd;
    border-radius: 10px;
}

#shtaket .shtaket-contact-grid b,
#shtaket .calc-consent b {
    color: #c32828;
}

#shtaket .shtaket-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

#shtaket .shtaket-legacy-hidden {
    display: none !important;
}

@media (max-width: 991px) {
    #shtaket .shtaket-color-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

@media (max-width: 767px) {
    #shtaket .shtaket-catalog-controls {
        padding: 16px;
    }

    #shtaket .shtaket-catalog-top,
    #shtaket .shtaket-thickness-section {
        max-width: none;
    }

    #shtaket .shtaket-color-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 9px;
    }

    #shtaket .shtaket-color-card {
        min-height: 82px;
        padding: 10px;
        gap: 9px;
    }

    #shtaket .shtaket-color-card.is-selected {
        padding: 9px;
    }

    #shtaket .shtaket-color-card-image {
        flex-basis: 48px;
        width: 48px;
        height: 48px;
    }

    #shtaket .shtaket-color-card-label {
        font-size: 14px;
    }

    #shtaket .shtaket-length-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
    }

    #shtaket .shtaket-contact-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 430px) {
    #shtaket .shtaket-color-grid {
        grid-template-columns: 1fr;
    }
}

#shtaket .shtaket-krep-section {
    max-width: 420px;
    margin-top: 14px;
    margin-bottom: 16px;
}

#shtaket .shtaket-krep-legacy-hidden {
    display: none !important;
}

#shtaket .calc-consent input[type="checkbox"] {
    -webkit-appearance: checkbox !important;
    appearance: auto !important;
    display: inline-block !important;
    position: static !important;
    opacity: 1 !important;
    visibility: visible !important;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px !important;
    margin: 2px 0 0 0 !important;
    padding: 0 !important;
    clip: auto !important;
    clip-path: none !important;
    transform: none !important;
    flex: 0 0 18px !important;
}

#shtaket .calc-consent label {
    display: flex !important;
    align-items: flex-start !important;
    gap: 9px !important;
}

/* =========================================================
   ШТАКЕТНИК — АДАПТИВ СТАРОГО КАЛЬКУЛЯТОРА
   ========================================================= */

@media (max-width: 767px) {

    /* Не даём старому Vue-калькулятору расширять страницу */
    #shtaket,
    #shtaket #app,
    #shtaket .app-main-container,
    #shtaket .app-container,
    #shtaket .content-wrapper,
    #shtaket .CalcContainer {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box;
    }

    #shtaket .app-container {
        height: auto !important;
        min-height: 0 !important;
    }

    #shtaket .ShtaketSection {
        margin: 20px 0 !important;
    }


    /* ---------------------------------------------------------
       Основной блок:
       сначала изображение забора, потом настройки
       --------------------------------------------------------- */

    #shtaket .CalcContainer > .card-body,
    #shtaket .CalcContainer .row.card-body {
        display: flex !important;
        flex-direction: column !important;

        width: 100% !important;
        margin: 0 !important;
        padding: 12px !important;
    }

    #shtaket .CalcSection {
        order: 1;

        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        padding: 0 !important;
    }

    #shtaket .CalcForm {
        order: 2;

        flex: 0 0 100% !important;
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        height: auto !important;
        padding: 18px 0 0 !important;
    }


    /* ---------------------------------------------------------
       Картинка / SVG забора
       --------------------------------------------------------- */

    #shtaket .SectionContainer {
        position: static !important;
        top: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        padding: 0 !important;
    }

    #shtaket .CalcSection svg {
        display: block;

        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 420px !important;

        margin: 0 auto;
    }



    #shtaket .PresetSelector {
        display: grid !important;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 7px;

        width: 100%;
        margin-bottom: 15px;
    }

    #shtaket .ShtaketFigureSel {
        width: 100% !important;
        min-width: 0 !important;
        flex: none !important;
    }

    #shtaket .ShtaketFigureSel label {
        display: block;
        width: 100%;
        margin: 0;
        font-size: 11px;
        line-height: 1.2;
    }

    #shtaket .ShtaketFigureSel label img {
        display: block;
        width: 100%;
        max-width: 100%;
        height: 42px;
        object-fit: contain;
    }



    #shtaket .CalcForm hr {
        margin: 15px 0;
    }

    #shtaket .CalcForm .form-group,
    #shtaket .CalcForm .input-group {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    #shtaket .CalcForm .input-group {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;

        margin-bottom: 16px !important;
    }

    #shtaket .CalcForm .input-group > label {
        display: block !important;

        width: 100% !important;
        max-width: 100% !important;

        margin: 0 0 8px !important;

        white-space: normal !important;
        overflow-wrap: break-word;
        line-height: 1.35;
    }



    #shtaket .CalcForm .input-group > .d-flex {
        display: flex !important;
        flex-direction: row !important;
        align-items: stretch !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
    }

    #shtaket .CalcForm .input-group .flex-grow-1 {
        display: flex !important;
        align-items: center;
        justify-content: center;

        min-width: 0 !important;
        min-height: 44px;

        text-align: center;
    }

    #shtaket .CalcForm .bootstrap-touchspin-injected {
        flex: 0 0 48px !important;
        width: 48px !important;
    }

    #shtaket .CalcForm .bootstrap-touchspin-injected .btn {
        display: flex;
        align-items: center;
        justify-content: center;

        width: 48px !important;
        min-width: 48px !important;
        height: 44px !important;

        padding: 0 !important;
        margin: 0 !important;

        font-size: 20px;
    }

    #shtaket .CalcForm input.form-control,
    #shtaket .CalcForm input.count,
    #shtaket .CalcForm input.touchspin {
        width: 100% !important;
        min-width: 0 !important;
        max-width: none !important;
        height: 44px !important;

        margin: 0 !important;
        padding: 0 8px !important;

        text-align: center !important;
    }



    #shtaket .CalcForm .my-touchspin {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;

        width: 100% !important;
        max-width: 100% !important;

        margin-bottom: 14px !important;
    }

    #shtaket .CalcForm .my-touchspin label {
        width: 100% !important;
        margin-bottom: 7px !important;
        white-space: normal !important;
    }

    #shtaket .CalcForm .my-touchspin input {
        width: 100% !important;
        max-width: 100% !important;
        flex-basis: auto !important;
    }

    #shtaket .CalcForm .custom-range {
        display: block;
        width: 100% !important;
        max-width: 100% !important;
        margin: 8px 0 16px;
    }



    #shtaket .ShtaketType {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;

        width: 100%;
    }

    #shtaket .ShtaketType > [class*="col-"] {
        flex: none !important;

        width: 100% !important;
        max-width: 100% !important;

        padding: 0 !important;
    }

    #shtaket .ShtaketType img {
        display: block;

        width: 100% !important;
        max-width: 100% !important;
        height: 150px !important;

        object-fit: contain;
    }



    #shtaket .shtaket-result-card {
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

    #shtaket .table-responsive {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #shtaket .shtaket-result-table {
        min-width: 620px;
    }

    #shtaket .shtaket-actions {
        flex-direction: column;
    }

    #shtaket .shtaket-actions .btn,
    #shtaket .shtaket-actions button {
        width: 100%;
        max-width: 100%;
    }


    #shtaket .shtaket-manager-form,
    #shtaket .shtaket-contact-grid,
    #shtaket .shtaket-contact-grid input {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}


@media (max-width: 430px) {

    #shtaket .PresetSelector {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #shtaket .ShtaketType {
        grid-template-columns: 1fr;
    }

    #shtaket .CalcContainer .card-body {
        padding: 8px !important;
    }

    #shtaket .CalcSection svg {
        max-height: 330px !important;
    }
}