.hatch-calc {
    color: #333;
    font-size: 16px;
    line-height: 1.45;
}

.hatch-calc__lead {
    margin: 0 0 22px;
    max-width: 760px;
    color: #555;
}

.hatch-calc__title {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

.hatch-calc__grid {
    display: grid;
    grid-template-columns: minmax(280px, 1fr) minmax(220px, 1fr);
    gap: 28px 36px;
    padding: 22px 22px 8px;
    background: #f6f6f6;
    border-radius: 12px;
}

.hatch-calc__block-title {
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.hatch-calc__field {
    display: grid;
    grid-template-columns: 1fr 88px 36px;
    gap: 8px;
    align-items: center;
    margin-bottom: 12px;
}

.hatch-calc__field span:last-child {
    color: #777;
}

.hatch-calc input[type="text"] {
    width: 100%;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    background: #fff;
    font: inherit;
}

.hatch-calc__scheme {
    position: relative;
    width: 160px;
    height: 160px;
    margin: 8px 0 18px;
    background: url(/pokupatelyam/kalkulyator/square.png) no-repeat 0 0;
    color: #999;
    font-size: 12px;
    line-height: 1;
}

.hatch-calc__scheme-w,
.hatch-calc__scheme-h {
    position: absolute;
    z-index: 1;
    display: block;
    text-align: center;
}

.hatch-calc__scheme-w {
    top: -1px;
    left: 38px;
    width: 56px;
}

.hatch-calc__scheme-h {
    top: 88px;
    right: -22px;
    width: 48px;
}

.hatch-calc__canvas-wrap {
    overflow: hidden;
}

.hatch-calc__canvas-wrap canvas {
    display: block;
    max-width: 100%;
    height: auto;
}

.hatch-calc form > .btn {
    margin: 6px 0 18px;
}

.hatch-calc__error {
    margin: 0 0 16px;
    color: #c0392b;
}

.hatch-calc__results {
    margin-top: 28px;
}

.hatch-calc__card {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto auto;
    gap: 16px;
    align-items: center;
    padding: 16px 0;
    border-top: 1px solid #e6e6e6;
}

.hatch-calc__card--custom {
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.hatch-calc__photo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
}

.hatch-calc__photo img {
    max-width: 72px;
    max-height: 72px;
    object-fit: contain;
}

.hatch-calc__name {
    color: #222;
    font-weight: 700;
    text-decoration: none;
}

.hatch-calc__name:hover {
    color: #fd9c12;
}

.hatch-calc__size {
    margin-top: 4px;
    color: #777;
    font-size: 14px;
}

.hatch-calc__price {
    font-size: 20px;
    font-weight: 700;
    white-space: nowrap;
}

.hatch-calc__card .btn {
    justify-self: end;
    white-space: nowrap;
}

.hatch-calc__empty a {
    color: #fd9c12;
}

.hatch-calc [hidden] {
    display: none !important;
}

.hatch-calc-modal[hidden] {
    display: none !important;
}

.hatch-calc-modal {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hatch-calc-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .45);
}

.hatch-calc-modal__dialog {
    position: relative;
    z-index: 1;
    width: min(520px, calc(100% - 32px));
    max-height: calc(100vh - 40px);
    margin: 0;
    padding: 28px 24px 24px;
    overflow: auto;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, .2);
}

.hatch-calc-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    color: #666;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.hatch-calc-modal__title {
    margin: 0 0 8px;
    font-size: 22px;
}

.hatch-calc-modal__meta {
    margin: 0 0 16px;
    color: #666;
}

.hatch-calc-modal form {
    display: grid;
    gap: 12px;
}

.hatch-calc-modal label {
    display: grid;
    gap: 6px;
    color: #333;
    font-size: 14px;
}

.hatch-calc-modal input:not([type="checkbox"]) {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid #d7d7d7;
    border-radius: 6px;
    font: inherit;
}

.hatch-calc-modal__checks {
    display: grid;
    gap: 15px;
}

.hatch-calc-modal__checks label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.hatch-calc-modal__checks input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex: 0 0 auto;
}

.hatch-calc-modal__error {
    margin: 0;
    color: #c0392b;
}

.hatch-calc-modal__ok {
    margin: 28px 8px 12px;
    text-align: center;
    font-size: 18px;
    line-height: 1.45;
}

.hatch-calc-modal__dialog.is-sent > :not(.hatch-calc-modal__close):not(.hatch-calc-modal__ok) {
    display: none !important;
}

@media (max-width: 860px) {
    .hatch-calc__grid,
    .hatch-calc__card {
        grid-template-columns: 1fr;
    }

    .hatch-calc__field {
        grid-template-columns: 1fr 76px 32px;
    }
}
