.calc {
    display: grid;
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: 40px;
    align-items: start;
}
.calc__head {
    margin-bottom: 32px;
}
.calc__title {
    font-size: 40px;
    line-height: 1.15;
    letter-spacing: -0.02em;
}
.calc__form {
    counter-reset: calc-step;
}
.calc__group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}
.calc__group + .calc__group {
    margin-top: 36px;
}
.calc__legend {
    display: flex;
    float: none;
    align-items: center;
    gap: 12px;
    width: 100%;
    margin: 0 0 16px;
    padding: 0;
    color: var(--text);
    font-size: 19px;
    font-weight: 600;
    line-height: 1.3;
}
.calc__legend::before {
    content: counter(calc-step);
    counter-increment: calc-step;
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--card);
    color: var(--orange);
    font-size: 15px;
}
.calc__legend + * {
    clear: none;
}

.calc__types {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}
.calc-type,
.calc-choice {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}
.calc-type__input,
.calc-choice__input,
.calc-option__input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
}
.calc-type__body,
.calc-choice__body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    height: 100%;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
    transition: border-color 0.2s ease, background-color 0.2s ease;
}
.calc-type__name,
.calc-choice__name {
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}
.calc-type__price {
    color: var(--body);
    font-size: 14px;
    line-height: 20px;
    white-space: nowrap;
}
.calc-type:hover .calc-type__body,
.calc-choice:hover .calc-choice__body {
    border-color: var(--border-hover);
}
.calc-type__input:checked + .calc-type__body,
.calc-choice__input:checked + .calc-choice__body {
    border-color: var(--orange);
    background: radial-gradient(120% 120% at 100% 0%, rgba(253, 115, 4, 0.14), transparent 60%), var(--card);
}
.calc-type__input:checked + .calc-type__body .calc-type__price {
    color: var(--orange);
}
.calc-type__input:focus-visible + .calc-type__body,
.calc-choice__input:focus-visible + .calc-choice__body,
.calc-option__input:focus-visible ~ .calc-option__box {
    outline: 2px solid var(--text);
    outline-offset: 2px;
}

.calc__options {
    border-top: 1px solid var(--line);
}
.calc-option {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) auto;
    column-gap: 14px;
    align-items: center;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
    cursor: pointer;
}
.calc-option--count {
    grid-template-columns: minmax(0, 1fr) auto;
    cursor: default;
}
.calc-option__box {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--border);
    border-radius: 8px;
    background: var(--card);
    color: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.calc-option__check {
    width: 20px;
    height: 20px;
}
.calc-option__input:checked ~ .calc-option__box {
    border-color: var(--orange);
    background: var(--orange);
    color: #fff;
}
.calc-option:hover .calc-option__input:not(:disabled):not(:checked) ~ .calc-option__box {
    border-color: var(--border-hover);
}
.calc-option__text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.calc-option__name {
    margin: 0;
    color: var(--text);
    font-size: 16px;
    font-weight: 600;
    line-height: 22px;
}
.calc-option__note {
    margin-top: 2px;
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}
.calc-option__hint {
    color: var(--body);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    text-align: right;
    white-space: nowrap;
}
.calc-option--count .calc-option__hint {
    margin-top: 4px;
    text-align: left;
}
.calc-option.is-included {
    cursor: default;
}
.calc-option.is-included .calc-option__box {
    border-color: rgba(84, 204, 6, 0.6);
    background: rgba(84, 204, 6, 0.16);
    color: var(--green);
}
.calc-option.is-included .calc-option__hint {
    color: var(--green);
}
.calc-option.is-off {
    cursor: not-allowed;
}
.calc-option.is-off .calc-option__box,
.calc-option.is-off .calc-option__name,
.calc-option.is-off .stepper {
    opacity: 0.4;
}
.calc-option.is-off .calc-option__hint {
    color: var(--muted);
    font-weight: 500;
}
.calc-option[data-calc-option="booking"] .calc-option__hint {
    color: var(--green);
}

.stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}
.stepper__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: var(--radius-sm);
    background: none;
    color: var(--text);
    transition: color 0.2s ease;
}
.stepper__button:hover:not(:disabled) {
    color: var(--orange);
}
.stepper__button:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: -2px;
}
.stepper__icon {
    width: 18px;
    height: 18px;
}
.stepper__input {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--text);
    font-size: 17px;
    font-weight: 600;
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}
.stepper__input::-webkit-outer-spin-button,
.stepper__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}
.stepper__input:focus {
    outline: none;
}
.stepper:focus-within {
    border-color: var(--orange);
}

.calc__choices {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 10px;
}
.calc-choice__note {
    color: var(--muted);
    font-size: 14px;
    line-height: 20px;
}
.calc-choice__hint {
    margin-top: auto;
    padding-top: 8px;
    color: var(--body);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}
.calc-choice__input:checked + .calc-choice__body .calc-choice__hint {
    color: var(--orange);
}

.calc__bar {
    display: none;
}

.calc__aside {
    position: sticky;
    top: 24px;
}
.calc-result {
    padding: 32px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0)), var(--card);
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.35);
    scroll-margin-top: 20px;
}
.calc-result__label {
    color: var(--muted);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}
.calc-result__price {
    margin-top: 6px;
    color: var(--orange);
    font-size: 40px;
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-variant-numeric: tabular-nums;
}
.calc-result__time {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--text);
    font-size: 16px;
    line-height: 22px;
}
.calc-result__time-icon {
    flex: none;
    width: 18px;
    height: 18px;
    color: var(--muted);
}
.calc-result__monthly {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 4px 12px;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    background: rgba(84, 204, 6, 0.1);
    font-size: 15px;
    line-height: 22px;
}
.calc-result__monthly strong {
    color: var(--green);
}
.calc-result__lines {
    margin-top: 20px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.calc-result__line {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    color: var(--body);
    font-size: 15px;
    line-height: 22px;
}
.calc-result__amount {
    flex: none;
    color: var(--text);
    font-weight: 600;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.calc-result__split {
    margin-top: 18px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.02);
}
.calc-result__split-title {
    margin-bottom: 6px;
    color: var(--text);
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
}
.calc-result__split-note {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.5;
}
.calc-result__free {
    margin-top: 16px;
    font-size: 14px;
    line-height: 1.55;
}
.calc-result__actions {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}
.calc-result__note {
    margin-top: 14px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.pay-rows {
    margin: 0;
}
.pay-rows__row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2px 16px;
    padding: 6px 0;
    font-size: 15px;
    line-height: 22px;
}
.pay-rows__row dt {
    color: var(--body);
    font-weight: 400;
    white-space: nowrap;
}
.pay-rows__row dd {
    margin: 0 0 0 auto;
    color: var(--text);
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.calc--compact {
    gap: 48px;
    align-items: center;
}
.calc--compact .calc__group + .calc__group {
    margin-top: 28px;
}
.calc--compact .calc__options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    border-top: 0;
}
.calc--compact .calc-option {
    grid-template-columns: 26px minmax(0, 1fr);
    row-gap: 2px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--card);
}
.calc--compact .calc-option__note {
    display: none;
}
.calc--compact .calc-option__hint {
    grid-column: 2;
    font-size: 13px;
    text-align: left;
}
.calc--compact .calc-option__input:checked ~ .calc-option__text .calc-option__name {
    color: var(--text);
}
.calc--compact .calc-result {
    box-shadow: none;
}
.calc--compact .calc__bar {
    display: none;
}

@media (max-width: 1199.98px) {
    .calc {
        gap: 28px;
    }
    .calc__types {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .calc-result {
        padding: 28px;
    }
    .calc-result__price {
        font-size: 34px;
    }
    .calc__title {
        font-size: 34px;
    }
}

@media (max-width: 991.98px) {
    .calc,
    .calc--compact {
        grid-template-columns: minmax(0, 1fr);
        gap: 28px;
    }
    .calc__types {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .calc__aside {
        position: static;
    }
    .calc__bar {
        position: sticky;
        bottom: 12px;
        z-index: 5;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 24px;
        padding: 14px 18px;
        border: 1px solid rgba(253, 115, 4, 0.55);
        border-radius: var(--radius-sm);
        background: #1b1b1c;
        box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
        color: var(--text);
    }
    .calc__bar-label {
        color: var(--body);
        font-size: 14px;
        font-weight: 600;
    }
    .calc__bar-price {
        color: var(--orange);
        font-size: 18px;
        font-weight: 700;
        white-space: nowrap;
        font-variant-numeric: tabular-nums;
    }
}

@media (max-width: 767.98px) {
    .calc__head {
        margin-bottom: 24px;
    }
    .calc__title {
        font-size: 28px;
        line-height: 1.2;
    }
    .calc__legend {
        font-size: 17px;
    }
    .calc__legend::before {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
    .calc__group + .calc__group {
        margin-top: 28px;
    }
    .calc__types {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .calc-type__body,
    .calc-choice__body {
        padding: 12px 14px;
    }
    .calc-type__name,
    .calc-choice__name {
        font-size: 15px;
        line-height: 20px;
    }
    .calc-type__price {
        font-size: 13px;
        white-space: normal;
    }
    .calc-option {
        grid-template-columns: 24px minmax(0, 1fr);
        column-gap: 12px;
        row-gap: 2px;
        align-items: start;
    }
    .calc-option--count {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }
    .calc-option__box {
        width: 24px;
        height: 24px;
    }
    .calc-option__hint {
        grid-column: 2;
        font-size: 13px;
        text-align: left;
    }
    .calc-option--count .calc-option__hint {
        grid-column: auto;
    }
    .calc-option__name {
        font-size: 15px;
        line-height: 22px;
    }
    .calc-option__note {
        font-size: 13px;
        line-height: 18px;
    }
    .stepper__button,
    .stepper__input {
        width: 40px;
        height: 40px;
    }
    .calc__choices {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .calc--compact .calc__options {
        grid-template-columns: minmax(0, 1fr);
        gap: 8px;
    }
    .calc--compact .calc-option {
        padding: 12px 14px;
    }
    .calc-result {
        padding: 22px 20px;
        border-radius: var(--radius-md);
        box-shadow: none;
    }
    .calc-result__price {
        font-size: 30px;
    }
    .calc-result__line,
    .pay-rows__row {
        font-size: 14px;
    }
    .calc-result__split {
        padding: 14px 16px;
    }
    .calc-result .pay-rows__row {
        display: grid;
        gap: 0;
        padding: 6px 0;
    }
    .calc-result .pay-rows__row dt {
        font-size: 13px;
        line-height: 18px;
    }
    .calc-result .pay-rows__row dd {
        margin: 0;
        font-size: 15px;
        text-align: left;
    }
}

@media (prefers-reduced-motion: reduce) {
    .calc-type__body,
    .calc-choice__body,
    .calc-option__box,
    .stepper__button {
        transition: none;
    }
}
