.credit-calculator {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    overflow: hidden;
    box-sizing: border-box;
}

.credit-calculator *,
.credit-calculator *::before,
.credit-calculator *::after {
    box-sizing: border-box;
}

.credit-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 430px);
    gap: 24px;
    align-items: start;
}

.credit-layout > * {
    min-width: 0;
}

.credit-card {
    width: 100%;
    min-width: 0;
    border: 1px solid #dfe3e7;
    border-radius: 14px;
    background-color: #fff;
    padding: 24px;
    box-shadow: 0 18px 42px -36px rgba(28, 37, 46, .48);
}

.credit-card-title {
    margin: 0 0 18px;
    color: #2f3b46;
    font-size: 1.15em;
    font-weight: 900;
    line-height: 1.35;
}

.credit-card .form-label {
    display: block;
    margin: 0 0 7px;
    color: #667482;
    font-size: .86em;
    font-weight: 900;
    line-height: 1.35;
    text-transform: uppercase;
}

.credit-card input,
.credit-card select,
.credit-card textarea,
.credit-card .form-control,
.credit-card .form-select {
    display: block;
    width: 100%;
    height: 46px;
    border: 1px solid #dfe3e7;
    border-radius: 8px;
    padding: 0 14px;
    background-color: #fff;
    color: #273340;
    font-family: inherit;
    font-size: 15px;
    line-height: 46px;
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.credit-card textarea {
    min-height: 96px;
    padding-top: 12px;
    padding-bottom: 12px;
    line-height: 1.5;
    resize: vertical;
}

.credit-card input:focus,
.credit-card select:focus,
.credit-card textarea:focus,
.credit-card .form-control:focus,
.credit-card .form-select:focus {
    outline: none;
    border-color: rgba(255, 72, 91, .5);
    background-color: #fff;
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .12);
}

.credit-card input::placeholder,
.credit-card textarea::placeholder {
    color: #a2a8ae;
}

.credit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.credit-actions .btn,
.credit-actions button,
.credit-actions input[type="button"],
.credit-actions input[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 18px;
    border: 1px solid var(--color-accent, #ff485b);
    border-radius: 8px;
    background-color: var(--color-accent, #ff485b);
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .15s ease;
}

.credit-actions .btn:hover,
.credit-actions button:hover,
.credit-actions input[type="button"]:hover,
.credit-actions input[type="submit"]:hover {
    border-color: var(--color-accent-dark, #e73b50);
    background-color: var(--color-accent-dark, #e73b50);
    color: #fff;
    text-decoration: none;
}

.credit-actions .btn:active,
.credit-actions button:active,
.credit-actions input[type="button"]:active,
.credit-actions input[type="submit"]:active {
    transform: translateY(1px);
}

.credit-actions .btn:focus,
.credit-actions button:focus,
.credit-actions input[type="button"]:focus,
.credit-actions input[type="submit"]:focus {
    outline: none;
}

.credit-actions .btn:focus-visible,
.credit-actions button:focus-visible,
.credit-actions input[type="button"]:focus-visible,
.credit-actions input[type="submit"]:focus-visible {
    box-shadow: 0 0 0 3px rgba(255, 72, 91, .14);
}

.credit-actions .btn-secondary,
.credit-actions .btn-light,
.credit-actions .btn-outline-secondary,
.credit-actions button[type="reset"] {
    border-color: #dfe3e7;
    background-color: #f4f5f7;
    color: #667482;
}

.credit-actions .btn-secondary:hover,
.credit-actions .btn-light:hover,
.credit-actions .btn-outline-secondary:hover,
.credit-actions button[type="reset"]:hover {
    border-color: rgba(255, 72, 91, .42);
    background-color: rgba(255, 72, 91, .08);
    color: var(--color-accent, #ff485b);
}

.credit-error {
    min-height: 20px;
    margin-top: 14px;
    color: var(--color-accent-dark, #e73b50);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.credit-result-card {
    position: static;
    align-self: start;
}

.credit-result-main {
    margin-bottom: 16px;
    padding: 18px;
    border: 1px solid rgba(255, 72, 91, .18);
    border-radius: 12px;
    background-color: rgba(255, 72, 91, .07);
    color: #2f3b46;
    font-size: 18px;
    font-weight: 900;
    line-height: 1.35;
}

.credit-result-list {
    overflow: hidden;
    border: 1px solid #dfe3e7;
    border-radius: 12px;
    background-color: #fff;
}

.credit-result-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 13px 15px;
    border-bottom: 1px solid #eceded;
}

.credit-result-row:last-child {
    border-bottom: 0;
}

.credit-result-row span {
    min-width: 0;
    color: #667482;
    line-height: 1.45;
}

.credit-result-row strong {
    flex: 0 0 auto;
    max-width: 55%;
    color: #222c38;
    font-weight: 900;
    line-height: 1.45;
    text-align: right;
    word-break: break-word;
}

.credit-result-row-accent strong {
    color: var(--color-accent-dark, #e73b50);
}

.credit-formula {
    margin-top: 16px;
    padding: 15px 16px;
    border: 1px solid #dfe3e7;
    border-radius: 12px;
    background-color: #f8f9fb;
    color: #4f5965;
    font-size: 14px;
    line-height: 1.6;
}

.credit-formula strong,
.credit-formula b {
    color: #2f3b46;
    font-weight: 900;
}

.credit-schedule-card {
    grid-column: 1 / -1;
}

.credit-schedule-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.credit-schedule-summary {
    color: #667482;
    font-size: 14px;
    line-height: 1.5;
    text-align: right;
}

.credit-table-wrap {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.credit-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
    font-size: 14px;
}

.credit-table th,
.credit-table td {
    padding: 10px 12px;
    border: 1px solid #dfe3e7;
    text-align: right;
    white-space: nowrap;
}

.credit-table th {
    background-color: #f8f9fb;
    color: #2f3b46;
    font-weight: 900;
}

.credit-table th:first-child,
.credit-table td:first-child {
    text-align: center;
}

.credit-table th:nth-child(2),
.credit-table td:nth-child(2) {
    text-align: left;
}

.credit-table tbody tr:nth-child(even) {
    background-color: #fbfbfc;
}

.credit-empty-row {
    text-align: center !important;
    color: #667482;
}

.credit-disclaimer {
    margin-top: 12px;
    color: #94999e;
    font-size: 13px;
    line-height: 1.5;
}

@media (max-width: 991px) {
    .credit-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .credit-result-card {
        position: static;
    }

    .credit-schedule-card {
        grid-column: auto;
    }
}

@media (max-width: 767px) {
    .credit-layout {
        gap: 18px;
    }

    .credit-card {
        padding: 18px;
        border-radius: 12px;
    }

    .credit-card-title {
        margin-bottom: 16px;
        font-size: 1.08em;
    }

    .credit-card input,
    .credit-card select,
    .credit-card textarea,
    .credit-card .form-control,
    .credit-card .form-select {
        height: 44px;
        border-radius: 7px;
        font-size: 14px;
        line-height: 44px;
    }

    .credit-actions {
        margin-top: 18px;
    }

    .credit-schedule-header {
        display: block;
    }

    .credit-schedule-summary {
        display: block;
        margin-top: 4px;
        text-align: left;
    }

    .credit-table {
        min-width: 680px;
        font-size: 13px;
    }

    .credit-table th,
    .credit-table td {
        padding: 8px 10px;
    }
}

@media (max-width: 575px) {
    .credit-card {
        padding: 16px;
        border-radius: 12px;
    }

    .credit-card-title {
        font-size: 1.06em;
        margin-bottom: 14px;
    }

    .credit-result-main {
        padding: 16px;
        font-size: 17px;
        word-break: break-word;
    }

    .credit-result-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 12px 14px;
    }

    .credit-result-row strong {
        max-width: 100%;
        text-align: left;
    }

    .credit-actions {
        flex-direction: column;
    }

    .credit-actions .btn,
    .credit-actions button,
    .credit-actions input[type="button"],
    .credit-actions input[type="submit"] {
        width: 100%;
        min-height: 44px;
    }

    .credit-formula {
        padding: 14px;
        font-size: 13px;
    }

    .credit-schedule-card {
        padding-left: 14px;
        padding-right: 14px;
    }

    .credit-table-wrap {
        overflow-x: visible;
    }

    .credit-table {
        width: 100%;
        min-width: 0;
        border-collapse: separate;
        border-spacing: 0 10px;
        font-size: 13px;
    }

    .credit-table thead {
        display: none;
    }

    .credit-table,
    .credit-table tbody,
    .credit-table tr,
    .credit-table td {
        display: block;
        width: 100%;
    }

    .credit-table tbody tr {
        border: 1px solid #dfe3e7;
        border-radius: 12px;
        background-color: #fff;
        padding: 10px 12px;
    }

    .credit-table tbody tr:nth-child(even) {
        background-color: #fff;
    }

    .credit-table td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 12px;
        padding: 7px 0;
        border: 0;
        text-align: right !important;
        white-space: normal;
    }

    .credit-table td::before {
        flex: 0 0 auto;
        max-width: 48%;
        color: #667482;
        font-weight: 900;
        line-height: 1.35;
        text-align: left;
    }

    .credit-table td:nth-child(1)::before {
        content: "№";
    }

    .credit-table td:nth-child(2)::before {
        content: "Дата платежа";
    }

    .credit-table td:nth-child(3)::before {
        content: "Платёж";
    }

    .credit-table td:nth-child(4)::before {
        content: "Основной долг";
    }

    .credit-table td:nth-child(5)::before {
        content: "Проценты";
    }

    .credit-table td:nth-child(6)::before {
        content: "Остаток долга";
    }

    .credit-empty-row {
        display: block !important;
        padding: 14px 0 !important;
        text-align: center !important;
    }

    .credit-empty-row::before {
        content: "" !important;
    }

    .credit-disclaimer {
        font-size: 12px;
    }
}

@media (max-width: 420px) {
    .credit-card {
        padding: 14px;
    }

    .credit-result-main {
        font-size: 16px;
    }

    .credit-table tbody tr {
        padding: 9px 10px;
    }

    .credit-table td {
        font-size: 12px;
    }

    .credit-table td::before {
        max-width: 45%;
    }
}