/* Mobile refinancing parity with the current service landing template. */
.refinance-mobile-hero,
.calc-summary-label-mobile,
.calc-mobile-note,
.schedule-label-mobile {
    display: none;
}

html.schedule-modal-open,
body.schedule-modal-open {
    overflow: hidden !important;
    overscroll-behavior: none;
}

body.schedule-modal-open {
    position: fixed;
    width: 100%;
}

.schedule-mode-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.schedule-mode-label {
    color: #4a5a51;
    font-size: 12px;
    font-weight: 700;
}

.schedule-mode-switch {
    display: grid;
    flex: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
    border: 1px solid #d2ddd5;
    border-radius: 9px;
    background: #fff;
}

.schedule-mode-button {
    min-height: 34px;
    padding: 6px 10px;
    color: #26372d;
    font-size: 11px;
    font-weight: 700;
}

.schedule-mode-button.is-active {
    background: #13a749;
    color: #fff;
}

@media (max-width: 1279px) {
    header.header > nav {
        position: relative;
    }

    header.header > nav .links {
        position: fixed !important;
        top: var(--refinance-mobile-menu-top, 53px);
        right: 0;
        bottom: 0;
        left: 0;
        z-index: 260 !important;
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
        padding: 14px 14px max(14px, env(safe-area-inset-bottom));
        background: #0f1713 !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
        isolation: isolate;
    }

    header.header > nav .links > div {
        min-height: calc(100dvh - var(--refinance-mobile-menu-top, 53px));
        gap: 12px;
    }

    html.refinance-mobile-menu-open,
    body.refinance-mobile-menu-open {
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body.refinance-mobile-menu-open {
        position: fixed;
        width: 100%;
    }
}

@media (max-width: 767px) {
    html {
        overflow-x: hidden;
        scrollbar-width: none;
    }

    html::-webkit-scrollbar {
        display: none;
        width: 0;
        height: 0;
    }

    body {
        width: 100%;
        max-width: 100%;
        padding-top: var(--refinance-mobile-menu-top, 53px);
        overflow-x: hidden;
    }

    header.header {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        left: 0 !important;
        z-index: 120 !important;
        width: auto;
        max-width: none;
        box-sizing: border-box;
        background: #fff !important;
        -webkit-backdrop-filter: none !important;
        backdrop-filter: none !important;
    }

    header.header > nav {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    header.header > nav > div:first-child {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    header.header .logo {
        width: 115px !important;
    }

    header.header .burger {
        display: flex;
        width: 36px;
        height: 36px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        padding: 0 !important;
    }

    header.header .burger .bar1,
    header.header .burger .bar2,
    header.header .burger .bar3 {
        width: 22px !important;
        height: 3px !important;
        margin-top: 2px !important;
        margin-bottom: 2px !important;
    }

    #refinance-hero {
        display: block !important;
        min-height: 0 !important;
        margin-top: 0 !important;
        padding: 0 !important;
    }

    #refinance-hero .ref-hero-backdrop {
        background-position: center;
    }

    #refinance-hero .ref-hero-shell {
        display: block;
        width: 100%;
        max-width: none;
        min-height: 0;
        margin: 0;
        padding: 14px 12px 10px !important;
    }

    #refinance-hero .ref-hero-desktop-content {
        display: none !important;
    }

    #refinance-hero .refinance-mobile-hero {
        display: block;
        width: 100%;
        max-width: none;
        margin: 0 auto;
        padding: 0;
        text-align: center;
    }

    #refinance-hero .refinance-mobile-service-title {
        display: flex;
        width: min(100%, 350px);
        max-width: 100%;
        align-items: center;
        justify-content: center;
        margin: 0 auto;
        border: 1px solid rgba(19, 167, 73, 0.45);
        border-radius: 999px;
        background: rgba(19, 167, 73, 0.12);
        padding: 9px 14px;
        color: #2ee391;
        font-size: 12px;
        font-weight: 600;
        line-height: 1.3;
        letter-spacing: 0.01em;
        text-align: center;
    }

    #refinance-hero .mobile-hero-calc-slot {
        display: block;
        width: 100%;
        max-width: 100%;
        margin-top: 10px;
    }

    #refinance-hero .refinance-mobile-after-calc {
        display: block;
        max-width: 430px;
        margin: 10px auto 0;
        color: rgba(255, 255, 255, 0.82);
        font-size: 12px;
        line-height: 1.45;
        text-align: left;
    }

    #refinance-hero .refinance-mobile-next-link {
        display: inline-flex;
        width: min(100%, 430px);
        min-height: 40px;
        align-items: center;
        justify-content: center;
        margin: 10px auto 0;
        border: 1px solid rgba(255, 255, 255, 0.35);
        border-radius: 12px;
        background: #0b120f;
        padding: 8px 16px;
        color: #fff;
        font-size: 13px;
        font-weight: 600;
    }

    #refinance-calc.mobile-hero-calc-section {
        margin: 0 !important;
        padding: 10px 0 20px !important;
        border: 0 !important;
        background: transparent !important;
    }

    #refinance-calc.mobile-hero-calc-section > div {
        max-width: 100% !important;
        padding: 0 !important;
    }

    #refinance-calc.mobile-hero-calc-section .mobile-calc-intro {
        display: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .mobile-calc-body-wrap {
        margin-top: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .home-calculator-card {
        width: calc(100vw - 36px) !important;
        max-width: 430px;
        margin: 0 auto !important;
        box-sizing: border-box;
        border: 1px solid rgba(36, 190, 96, 0.22);
        border-radius: 34px;
        background:
            radial-gradient(circle at 18% 10%, rgba(38, 203, 99, 0.16) 0%, rgba(38, 203, 99, 0) 34%),
            linear-gradient(180deg, #06110c 0%, #0a1711 48%, #0f2419 100%);
        padding: 0 !important;
        box-shadow: 0 22px 46px rgba(0, 0, 0, 0.28);
        animation: none;
        opacity: 1;
        transform: none;
    }

    #refinance-calc.mobile-hero-calc-section .home-calculator-head,
    #refinance-calc.mobile-hero-calc-section .calc-modern-head,
    #refinance-calc.mobile-hero-calc-section .calc-modern-tabs {
        display: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern-main {
        border: 0;
        border-radius: 34px;
        background: transparent;
        padding: 30px 20px 22px;
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern-body {
        display: block;
        gap: 0;
    }

    #refinance-calc.mobile-hero-calc-section .calc-form-block {
        display: grid;
        grid-template-columns: 1fr !important;
        gap: 24px;
    }

    #refinance-calc.mobile-hero-calc-section .calc-field-block {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 8px 10px;
        height: auto;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
    }

    #refinance-calc.mobile-hero-calc-section .calc-field-label {
        margin: 0;
        color: #f4fff7;
        font-size: 16px;
        font-weight: 800;
        line-height: 1.18;
        white-space: nowrap;
    }

    #refinance-calc.mobile-hero-calc-section .calc-value-row {
        justify-self: end;
        gap: 5px;
        margin: 0;
    }

    #refinance-calc.mobile-hero-calc-section .calc-value-row span {
        color: #f4fff7;
        font-size: 13px !important;
        font-weight: 800;
        line-height: 1.1;
    }

    #refinance-calc.mobile-hero-calc-section .calc-value-input {
        width: auto;
        min-width: 0;
        max-width: 82px;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
        color: #f4fff7;
        text-align: right;
        font-size: 14px !important;
        font-weight: 800;
        line-height: 1.1;
        box-shadow: none;
    }

    #refinance-calc.mobile-hero-calc-section .calc-value-input-short {
        max-width: 54px;
    }

    #refinance-calc.mobile-hero-calc-section .calc-currency-mark {
        display: inline-flex !important;
        font-size: 0 !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-currency-mark::after {
        content: "руб.";
        font-size: 13px !important;
        font-weight: 800;
        line-height: 1.1;
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern input[type="range"] {
        grid-column: 1 / -1;
        height: 8px;
        margin-top: 5px;
        background: rgba(225, 245, 231, 0.22);
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern input[type="range"]::-webkit-slider-runnable-track {
        height: 8px;
        background: rgba(225, 245, 231, 0.22);
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern input[type="range"]::-webkit-slider-thumb {
        width: 22px;
        height: 22px;
        margin-top: -7px;
        border: 0;
        background: #14b84f;
        box-shadow: 0 8px 18px rgba(20, 184, 79, 0.34);
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern input[type="range"]::-moz-range-track {
        height: 8px;
        background: rgba(225, 245, 231, 0.22);
    }

    #refinance-calc.mobile-hero-calc-section .calc-modern input[type="range"]::-moz-range-thumb {
        width: 22px;
        height: 22px;
        border: 0;
        background: #14b84f;
        box-shadow: 0 8px 18px rgba(20, 184, 79, 0.34);
    }

    #refinance-calc.mobile-hero-calc-section .calc-range-limits {
        grid-column: 1 / -1;
        display: flex;
        justify-content: space-between;
        gap: 14px;
        margin-top: 6px;
        color: rgba(244, 255, 247, 0.72);
        font-size: 11px !important;
        font-weight: 700;
        line-height: 1.2;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-grid {
        display: grid;
        grid-template-columns: 1fr !important;
        width: 100%;
        gap: 9px;
        margin-top: 26px;
        border-top: 1px solid rgba(36, 190, 96, 0.24);
        padding-top: 22px;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-item--rate,
    #refinance-calc.mobile-hero-calc-section .calc-summary-item--payment,
    #refinance-calc.mobile-hero-calc-section .calc-summary-item--interest {
        display: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-item--total,
    #refinance-calc.mobile-hero-calc-section .calc-summary-item--return-date {
        display: flex !important;
        flex-direction: row !important;
        width: 100%;
        min-height: 0;
        align-items: baseline;
        justify-content: space-between;
        gap: 16px;
        border: 0;
        border-radius: 0;
        background: transparent;
        padding: 0;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-label-desktop,
    #refinance-calc.mobile-hero-calc-section .calc-summary-item--total > span:not(.calc-summary-label-mobile) {
        display: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-label-mobile {
        display: inline !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-item span {
        color: #f4fff7;
        font-size: 13px !important;
        font-weight: 700;
        line-height: 1.25;
        text-transform: none;
    }

    #refinance-calc.mobile-hero-calc-section .calc-summary-item strong {
        flex: 0 0 auto;
        color: #fff;
        font-size: 15px !important;
        font-weight: 900;
        line-height: 1.2;
        text-align: right;
    }

    #refinance-calc.mobile-hero-calc-section .calc-actions-row {
        display: grid !important;
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 22px;
    }

    #refinance-calc.mobile-hero-calc-section .calc-actions-row .calc-link {
        display: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-actions-row .schedule-btn {
        display: inline-flex !important;
        width: 100% !important;
        min-height: 46px !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        margin: 0 !important;
        border: 1px solid rgba(46, 227, 145, 0.4) !important;
        border-radius: 10px !important;
        background: rgba(255, 255, 255, 0.06) !important;
        padding: 0 14px !important;
        color: #f4fff7 !important;
        font-size: 13px !important;
        font-weight: 800 !important;
        line-height: 1.1 !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
    }

    #refinance-calc.mobile-hero-calc-section .calc-actions-row #openModal3 {
        display: inline-flex;
        width: 100%;
        min-height: 54px;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        background: #13a749;
        padding: 0 18px;
        color: #fff;
        font-size: 15px !important;
        font-weight: 800;
        line-height: 1.1;
        box-shadow: 0 14px 26px rgba(19, 167, 73, 0.3);
    }

    #refinance-calc.mobile-hero-calc-section .calc-actions-row #openModal3::after {
        content: " \00BB";
    }

    #refinance-calc.mobile-hero-calc-section .schedule-btn__icon {
        display: inline-flex !important;
        width: 22px !important;
        height: 22px !important;
        align-items: center;
        justify-content: center;
    }

    #refinance-calc.mobile-hero-calc-section .schedule-btn__icon img {
        width: 20px !important;
        height: 20px !important;
        object-fit: contain;
    }

    #refinance-calc.mobile-hero-calc-section .calc-mobile-note {
        display: block;
        max-width: 330px;
        margin: 18px auto 0;
        color: rgba(244, 255, 247, 0.62);
        text-align: center;
        font-size: 10px !important;
        font-weight: 700;
        line-height: 1.45;
    }

    footer > .border-t > div > div {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        width: 100%;
        gap: 8px;
    }

    footer > .border-t .money-cta-button {
        width: 100%;
        max-width: 100%;
        white-space: normal;
    }

    .scroll-button {
        right: 12px !important;
        left: 12px !important;
        width: auto !important;
        max-width: calc(100% - 24px);
        box-sizing: border-box;
    }

    #scheduleModal {
        padding: 4px;
    }

    #scheduleModal .calc-modal-dialog {
        width: calc(100vw - 8px);
        max-width: 380px;
        max-height: calc(100dvh - 24px);
        padding: 12px;
        border-radius: 14px;
        overflow: hidden;
    }

    #scheduleModal .schedule-modal-heading {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 86px;
        align-items: center;
        gap: 12px;
        margin-bottom: 12px;
    }

    #scheduleModal .calc-modal-title {
        padding-bottom: 6px;
        border-bottom: 1px dashed rgba(66, 85, 74, 0.24);
        font-size: 16px !important;
        line-height: 1.15 !important;
    }

    #scheduleModal .calc-modal-close-btn {
        width: 100%;
        min-height: 40px;
        padding: 6px 12px;
        border: 1px solid rgba(31, 45, 35, 0.18);
        border-radius: 9px;
        font-size: 11px;
        font-weight: 800;
    }

    #scheduleModal .schedule-mode-row {
        display: grid;
        grid-template-columns: 62px minmax(0, 1fr);
        gap: 8px;
        margin-bottom: 8px;
    }

    #scheduleModal .schedule-mode-label,
    #scheduleModal .schedule-mode-button,
    #scheduleModal .calc-modal-dialog > p {
        font-size: 9px !important;
    }

    #scheduleModal .schedule-mode-button {
        min-height: 30px;
        padding: 4px 6px;
    }

    #scheduleModal .calc-modal-dialog > p {
        margin-bottom: 8px;
        line-height: 1.4;
    }

    #scheduleContent {
        max-height: calc(100dvh - 220px);
        overflow-x: hidden;
        border-radius: 8px;
        font-size: 10px !important;
    }

    #scheduleContent .schedule-table {
        width: 100%;
        table-layout: fixed;
        font-size: 10px;
        line-height: 1.2;
    }

    #scheduleContent .schedule-label-full {
        display: none;
    }

    #scheduleContent .schedule-label-mobile {
        display: inline;
    }

    #scheduleContent .schedule-table th,
    #scheduleContent .schedule-table td {
        overflow: hidden;
        padding: 7px 2px;
        text-overflow: clip;
        white-space: nowrap;
    }

    #scheduleContent .schedule-table thead th {
        font-size: 9px;
        letter-spacing: 0;
    }

    #scheduleContent .schedule-table th:nth-child(1),
    #scheduleContent .schedule-table td:nth-child(1) {
        width: 7%;
        text-align: center;
    }

    #scheduleContent .schedule-table th:nth-child(2),
    #scheduleContent .schedule-table td:nth-child(2) {
        width: 25%;
    }

    #scheduleContent .schedule-table th:nth-child(3),
    #scheduleContent .schedule-table td:nth-child(3) {
        width: 19%;
    }

    #scheduleContent .schedule-table th:nth-child(4),
    #scheduleContent .schedule-table td:nth-child(4) {
        width: 16%;
    }

    #scheduleContent .schedule-table th:nth-child(5),
    #scheduleContent .schedule-table td:nth-child(5) {
        width: 14%;
    }

    #scheduleContent .schedule-table th:nth-child(6),
    #scheduleContent .schedule-table td:nth-child(6) {
        width: 19%;
    }
}
