.rcalc-shell {
    width: 980px;
    max-width: calc(100vw - 40px);
    min-width: 0;
    margin: 20px auto 0;
    background: #f7f9ff;
    border: 1px solid #dce4ff;
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 10px 30px rgba(10, 35, 85, 0.08);
}

.head-calculator-section {
    padding: 8px 0 0;
}

.head-content {
    align-items: flex-start;
}

@media (min-width: 1201px) {
    .head-content {
        justify-content: space-between;
        align-items: center;
        text-align: left;
        gap: 36px;
    }

    .head-text {
        flex: 1 1 56%;
        max-width: 56%;
        margin-left: 0;
        padding-left: clamp(16px, 2.2vw, 36px);
    }

    .head-image {
        flex: 1 1 44%;
        max-width: 44%;
        margin: 0;
        text-align: right;
    }
}

.rcalc-heading {
    margin: 0 0 14px;
    font-weight: 700;
    font-size: 20px;
    color: #15213b;
}

.rcalc-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(300px, 320px);
    gap: 14px;
    align-items: flex-start;
}

.rcalc-left {
    flex: 1 1 68%;
    min-width: 0;
}

.rcalc-right {
    min-width: 0;
    background:
        radial-gradient(circle at 14% 0%, rgba(117, 209, 244, 0.34), transparent 38%),
        linear-gradient(160deg, #ffffff 0%, #f4fbff 48%, #e7f6ff 100%);
    border: 1px solid rgba(70, 162, 214, 0.28);
    border-radius: 18px;
    padding: 16px;
    position: sticky;
    top: 12px;
    box-shadow: 0 22px 48px rgba(70, 162, 214, 0.18);
    color: #24324c;
    overflow: hidden;
    text-align: center;
}

.rcalc-section {
    margin-bottom: 14px;
}

.rcalc-subhead {
    margin: 0 0 10px;
    font-size: 17px;
    color: #1b2d59;
}

.rcalc-chip-grid {
    gap: 8px;
}

.rcalc-chip {
    gap: 8px;
    border: 1px solid #d6e1ff;
    padding: 8px 12px;
    background: #f7faff;
    font-size: 13px;
    color: #203668;
    flex: 1 1 220px;
}

.rcalc-table-wrap {
    overflow: hidden;
}

.rcalc-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
}

.rcalc-table th,
.rcalc-table td {
    border-bottom: 1px solid #e2e9ff;
    padding: 10px 6px;
    text-align: left;
    font-size: 13px;
}

.rcalc-table th:nth-child(1),
.rcalc-table td:nth-child(1) { width: 20%; }
.rcalc-table th:nth-child(2),
.rcalc-table td:nth-child(2) { width: 10%; }
.rcalc-table th:nth-child(3),
.rcalc-table td:nth-child(3) { width: 36%; }
.rcalc-table th:nth-child(4),
.rcalc-table td:nth-child(4) { width: 20%; }

.rcalc-table th {
    color: #455b8e;
    font-weight: 700;
    background: #f5f8ff;
}

.rcalc-row-hidden {
    display: none;
}

.rcalc-table td input[type="number"] {
    width: 100%;
    max-width: 78px;
    min-width: 52px;
    border: 1px solid #c9d5fa;
    border-radius: 9px;
    padding: 7px 8px;
    font-size: 13px;
}

.rcalc-routine-btns {
    gap: 4px;
}

.rcalc-routine-btn {
    flex: 1;
    border: 1px solid #d0daff;
    border-radius: 7px;
    padding: 5px 4px;
    font-size: 12px;
    font-weight: 600;
    color: #5a72a8;
    background: #f3f6ff;
    cursor: pointer;
    transition: background 0.12s, color 0.12s, border-color 0.12s;
    white-space: nowrap;
}

.rcalc-routine-btn.is-active {
    background: #2d67f4;
    border-color: #2d67f4;
    color: #fff;
}

.rcalc-routine-btn:focus-visible,
.rcalc-factor-tab:focus-visible,
.rcalc-cta-btn:focus-visible,
.rcalc-quality-option:focus-within {
    outline: 3px solid rgba(45, 103, 244, 0.25);
    outline-offset: 2px;
}

.rcalc-factors-layout {
    gap: 12px;
}

.rcalc-factors-tabs {
    flex-direction: column;
    gap: 6px;
    flex: 0 0 170px;
}

.rcalc-factor-tab {
    border: 1px solid #cdd9fd;
    background: #eef3ff;
    color: #1a3a79;
    border-radius: 10px;
    padding: 10px;
    text-align: left;
    cursor: pointer;
}

.rcalc-factor-tab.is-active {
    background: #2d67f4;
    border-color: #2b63ec;
    color: #fff;
}

.rcalc-factor-tab[hidden] {
    display: none;
}

.rcalc-factors-content {
    flex: 1 1 auto;
    border: 1px solid #dce5ff;
    border-radius: 12px;
    padding: 12px;
    background: #fbfcff;
}

.rcalc-factor-pane {
    display: none;
}

.rcalc-factor-pane.is-active {
    display: block;
}

.rcalc-factor-pane label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 13px;
    color: #283a63;
}

.rcalc-quality-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.rcalc-revenue-select {
    width: 100%;
    border: 1px solid #c9d5fa;
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    color: #203668;
    background: #fff;
}

.rcalc-factor-group-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    color: #355a99;
}

.rcalc-quality-option {
    position: relative;
    flex-direction: column;
    gap: 4px;
    border: 2px solid #d6e1ff;
    border-radius: 12px;
    padding: 10px 12px;
    background: #f7faff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}

.rcalc-quality-option:has(input:checked) {
    border-color: #2d67f4;
    background: #edf3ff;
}

.rcalc-quality-option input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.rcalc-quality-title {
    font-size: 13px;
    font-weight: 700;
    color: #1b2d59;
}

.rcalc-quality-desc {
    font-size: 12px;
    color: #5a6c94;
    line-height: 1.35;
}

.rcalc-result-kicker {
    margin: 0 0 14px;
    border: 1px solid rgba(70, 162, 214, 0.22);
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.72);
    color: var(--btn-hover);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

#routineCalculator .rcalc-result-kicker {
    font-size: 12px;
}

/* ── Loss highlight ── */
.rcalc-result-loss-label {
    margin: 0 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--btn-hover);
    letter-spacing: 0.07em;
}

#routineCalculator .rcalc-result-loss-label {
    font-size: 11px;
}

.rcalc-result-loss-value {
    margin: 0;
    font-size: clamp(19px, 1.55vw, 24px);
    font-weight: 800;
    color: var(--main-color);
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 12px 32px rgba(70, 162, 214, 0.2);
}

.rcalc-result-loss-sub {
    margin: 7px 0 0;
    font-size: 14px;
    color: var(--color-text);
}

#routineCalculator .rcalc-result-loss-sub {
    font-size: 14px;
}

/* ── Section divider ── */
.rcalc-result-divider {
    gap: 8px;
    margin: 16px 0 12px;
    font-size: 11px;
    font-weight: 700;
    color: var(--btn-hover);
    letter-spacing: 0.07em;
}

.rcalc-result-divider::before,
.rcalc-result-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(70, 162, 214, 0.18);
}

/* ── Gains list ── */
.rcalc-result-gains {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 14px;
}

.rcalc-gain-row {
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(70, 162, 214, 0.16);
    border-radius: 13px;
    padding: 11px 12px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: 0 10px 22px rgba(70, 162, 214, 0.08);
}

.rcalc-result-loss-card {
    margin-bottom: 10px;
}

.rcalc-gain-body {
    flex: 1;
    text-align: center;
}

.rcalc-gain-label {
    margin: 0 0 2px;
    font-size: 11px;
    font-weight: 700;
    color: var(--btn-hover);
    letter-spacing: 0.07em;
}

.rcalc-gain-value {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #24324c;
    line-height: 1.25;
}

.rcalc-gain-sub {
    margin: 2px 0 0;
    font-size: 13px;
    color: var(--color-text);
}

#routineCalculator .rcalc-gain-label {
    font-size: 11px;
    margin: 0 0 2px;
}

#routineCalculator .rcalc-gain-value {
    font-size: 14px;
    line-height: 1.25;
    margin: 0;
}

#routineCalculator .rcalc-gain-sub {
    font-size: 13px;
    margin: 2px 0 0;
}

.rcalc-result-note {
    margin: 0 0 12px;
    border-top: 1px solid rgba(70, 162, 214, 0.16);
    padding-top: 12px;
    font-size: 11px;
    line-height: 1.5;
    color: var(--color-text);
}

#routineCalculator .rcalc-result-note {
    font-size: 13px;
}

.rcalc-tip {
    margin: 0 0 12px;
    color: #506079;
    font-size: 12px;
}

#routineCalculator .rcalc-tip {
    font-size: 14px;
}

.rcalc-tip strong {
    color: var(--main-color);
}

.rcalc-cta-wrap {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.rcalc-cta-btn {
    min-width: 0;
    border: 0;
    border-radius: 12px;
    padding: 11px 13px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    line-height: 1.2;
}

.rcalc-cta-btn-primary {
    background: linear-gradient(135deg, var(--main-color), var(--secondary-color));
    color: #fff;
    flex: 1 1 auto;
    box-shadow: 0 14px 28px rgba(70, 162, 214, 0.24);
}

.rcalc-cta-btn-light {
    background: rgba(255, 255, 255, 0.72);
    color: var(--btn-hover);
    border: 1px solid rgba(70, 162, 214, 0.22);
    flex: 1 1 auto;
}

.head-calculator-wrap {
    display: grid;
    grid-template-columns: minmax(0, 2.35fr) minmax(300px, 1fr);
    gap: 28px;
    align-items: start;
    width: min(100%, 1450px);
    margin: 20px auto 0;
}

.head-calculator-wrap .rcalc-shell {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.head-solution-copy {
    min-width: 0;
    text-align: left;
    padding-top: 12px;
}

.head-solution-copy h2 {
    margin: 0 0 18px;
    font-size: clamp(22px, 1.8vw, 30px);
    font-weight: 700;
    line-height: 1.24;
    color: var(--main-color);
}

.head-solution-copy h2 br {
    display: none;
}

.head-solution-copy p {
    margin: 0;
    font-size: clamp(14px, 1.1vw, 18px);
    font-weight: 500;
    line-height: 1.55;
    color: var(--color-text);
}

.head-solution-copy .sec1-items {
    margin-top: 20px;
    max-width: none;
    gap: 18px;
}

.head-solution-copy .sec1-item {
    gap: 12px;
}

.head-solution-copy .sec1-img {
    width: 54px;
    height: 54px;
    padding: 13px;
}

.head-solution-copy .sec1-item h4 {
    margin: 0 0 6px;
    font-size: 16px;
}

.head-solution-copy .sec1-item p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

@media (max-width: 1200px) {
    .head-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .head-text {
        max-width: 100%;
        margin-left: 0;
    }

    .head-image {
        max-width: 680px;
        margin: 0 auto 18px;
        text-align: center;
    }

    .head-image img {
        margin: 0 auto;
    }

    .head-solution-copy .sec1-items {
        margin: 20px auto 0;
        max-width: 680px;
    }
}

@media (max-width: 1320px) {
    .head-calculator-wrap {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .head-solution-copy {
        text-align: center;
        padding-top: 0;
    }
}

@media (max-width: 1200px) {
    .rcalc-shell {
        max-width: 100%;
    }

    .rcalc-layout {
        grid-template-columns: 1fr;
    }

    .rcalc-right {
        width: 100%;
        min-width: 0;
        position: static;
    }

    .rcalc-result-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 700px) {
    .rcalc-shell {
        margin-top: 16px;
        padding: 14px;
        border-radius: 14px;
    }

    .rcalc-heading {
        font-size: 18px;
    }

    .rcalc-subhead {
        font-size: 18px;
        text-align: left;
    }

    .rcalc-shell,
    .rcalc-left,
    .rcalc-section {
        text-align: left;
    }

    .rcalc-chip-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .rcalc-chip {
        flex: initial;
        width: 100%;
    }

    .rcalc-chip-grid .rcalc-chip:last-child {
        grid-column: 1 / -1;
    }

    .rcalc-chip,
    .rcalc-factor-pane label,
    .rcalc-factor-tab,
    .rcalc-tip {
        font-size: 15px;
    }

    .rcalc-table thead {
        display: none;
    }

    .rcalc-table tbody {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .rcalc-table tr.rcalc-row-hidden {
        display: none;
    }

    .rcalc-table tr {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        border: 1px solid #dce5ff;
        border-radius: 12px;
        padding: 10px;
        background: #fff;
    }

    .rcalc-table td {
        display: flex;
        flex-direction: column;
        border: 0;
        padding: 0;
        min-width: calc(50% - 4px);
        flex: 1 1 calc(50% - 4px);
    }

    .rcalc-table td:first-child {
        min-width: 100%;
        flex-basis: 100%;
        font-size: 16px;
        font-weight: 700;
        color: #1f3f7c;
    }

    .rcalc-table td:nth-child(2)::before { content: "Сотрудников"; }
    .rcalc-table td:nth-child(3)::before { content: "Сколько рутины"; }
    .rcalc-table td:nth-child(4)::before { content: "Зарплата, тыс. ₽/мес"; }

    .rcalc-table td::before {
        font-size: 13px;
        color: #60739f;
        margin-bottom: 4px;
    }

    .rcalc-quality-grid {
        grid-template-columns: 1fr;
    }

    .rcalc-table td input[type="number"] {
        max-width: none;
        font-size: 15px;
    }

    .rcalc-factors-layout {
        flex-direction: column;
    }

    .rcalc-factors-tabs {
        flex-direction: row;
        flex-wrap: wrap;
        flex: initial;
    }

    .rcalc-factor-tab {
        flex: 1 1 calc(50% - 4px);
        text-align: center;
    }

    .rcalc-result-loss-value {
        font-size: 19px;
    }

    .rcalc-gain-value {
        font-size: 16px;
    }

    .rcalc-cta-btn {
        min-height: 42px;
        font-size: 16px;
    }
}
