/**
 * Mortgage Calculator Styles
 * 주택담보대출 계산기 전용 스타일
 * HTML 구조: tool-layout-split > tool-input-panel + tool-result-panel
 *
 * @package Zipper
 */

/* ===== 레이아웃 오버라이드 ===== */
.tool-section:has(.mlc-input-section) .tool-layout-split {
    grid-template-columns: 320px 1fr;
}

/* 입력 영역 컨테이너 - 모바일 overflow 방지 */
.tool-section:has(.mlc-input-section) .tool-layout-input {
    max-width: 100%;
    overflow: hidden;
    box-sizing: border-box;
}

@media (max-width: 900px) {
    .tool-section:has(.mlc-input-section) .tool-layout-split {
        grid-template-columns: 1fr;
    }
}

/* ===== 탭 UI ===== */
.mlc-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 16px;
}

.mlc-tab {
    padding: 10px 12px;
    font-size: 14px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}

.mlc-tab:hover {
    color: #2d2a26;
    background: rgba(255, 255, 255, 0.5);
}

.mlc-tab.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

.mlc-tab-content {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mlc-tab-pane {
    display: none;
}

.mlc-tab-pane.active {
    display: block;
}

/* ===== 입력 섹션 ===== */
.mlc-input-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-width: 100%;
    overflow: hidden;
}

.mlc-input-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-width: 100%;
}

.mlc-input-group label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
}

.mlc-input-group input,
.mlc-input-group select {
    padding: 11px 12px;
    font-size: 15px;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    background: #faf9f7;
    color: #2d2a26;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.mlc-input-group input:focus,
.mlc-input-group select:focus {
    outline: none;
    border-color: #d4af37;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.1);
    background: #fff;
}

.mlc-input-group input::placeholder {
    color: #a09a94;
}

.mlc-input-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* 간편 버튼 그룹 */
.mlc-quick-btns {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    max-width: 100%;
}

.mlc-quick-btn {
    padding: 8px 6px;
    font-size: 12px;
    font-weight: 500;
    color: #5f5a56;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.mlc-quick-btn:hover {
    border-color: #d4af37;
    background: #fff;
    color: #d4af37;
}

/* 금액 읽기 표시 */
.mlc-amount-display {
    font-size: 12px;
    color: #7a756d;
    font-weight: 500;
    margin-top: 4px;
    min-height: 18px;
}

/* 도움말 텍스트 */
.mlc-help-text {
    font-size: 12px;
    color: #a09a94;
    margin: 0;
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 4px;
}

.mlc-help-text i {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ===== 상환방식 옵션 ===== */
.mlc-repayment-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mlc-repayment-option {
    padding: 12px;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.mlc-repayment-option:hover {
    border-color: #d4af37;
    background: #fff;
}

.mlc-repayment-option.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.mlc-repayment-option input[type="radio"] {
    width: 16px;
    height: 16px;
    accent-color: #d4af37;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 2px;
}

.mlc-repayment-option > label {
    flex: 1;
    cursor: pointer;
}

.mlc-option-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 4px;
}

.mlc-option-desc {
    font-size: 12px;
    color: #7a756d;
    line-height: 1.4;
}

/* ===== 계산 버튼 ===== */
.mlc-calc-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 4px;
}

.mlc-calc-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.35);
}

.mlc-calc-btn:active {
    transform: translateY(0);
}

/* ===== 초기화/공유 버튼 ===== */
.mlc-action-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 16px;
    max-width: 100%;
}

.mlc-reset-btn,
.mlc-share-btn {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mlc-reset-btn {
    color: #7a756d;
    background: #fff;
    border: 1px solid #e8e4dc;
}

.mlc-reset-btn:hover {
    border-color: #d4af37;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.05);
}

.mlc-share-btn {
    color: #3498db;
    background: #fff;
    border: 1px solid #3498db;
}

.mlc-share-btn:hover {
    background: rgba(52, 152, 219, 0.08);
}

/* ===== 숨김 ===== */
.mlc-hidden {
    display: none !important;
}

/* ===== 대기 상태 ===== */
.mlc-waiting {
    text-align: center;
    padding: 40px 20px;
    color: #a09a94;
}

.mlc-waiting > i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #d4af37;
}

.mlc-waiting > p {
    font-size: 14px;
    margin-bottom: 16px;
}

.mlc-waiting-guide {
    text-align: left;
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 8px;
    padding: 14px;
    max-width: 400px;
    margin: 0 auto;
}

.mlc-waiting-guide .guide-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlc-waiting-guide .guide-title i {
    color: #d4af37;
}

.mlc-waiting-guide ul {
    margin: 0;
    padding-left: 18px;
}

.mlc-waiting-guide li {
    font-size: 12px;
    color: #5f5a56;
    margin-bottom: 4px;
    line-height: 1.5;
}

/* ===== 메인 결과 (월 상환액) ===== */
.mlc-main-result {
    position: relative;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    margin-bottom: 16px;
}

.mlc-main-label {
    font-size: 14px;
    color: #7a756d;
    margin-bottom: 8px;
}

.mlc-main-value {
    font-size: 48px;
    font-weight: 700;
    color: #d4af37;
    line-height: 1;
    margin-bottom: 4px;
}

.mlc-main-value .unit {
    font-size: 22px;
    font-weight: 600;
    color: #b8860b;
    margin-left: 4px;
}

.mlc-rate-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 16px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: rgba(122, 117, 109, 0.15);
    margin-top: 8px;
}

/* 복사 버튼 */
.mlc-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(184, 134, 11, 0.2);
    color: #b8860b;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.mlc-copy-btn:hover {
    background: rgba(184, 134, 11, 0.3);
}

.mlc-copy-btn.copied {
    background: #27ae60;
    color: #fff;
}

/* ===== 상세 정보 카드 ===== */
.mlc-detail-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.mlc-detail-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.2s;
}

.mlc-detail-card:hover {
    border-color: #d4af37;
    box-shadow: 0 2px 8px rgba(212, 175, 55, 0.12);
}

.mlc-detail-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mlc-detail-label i {
    color: #d4af37;
}

.mlc-detail-value {
    font-size: 24px;
    font-weight: 700;
    color: #2d2a26;
}

.mlc-detail-value .unit {
    font-size: 14px;
    font-weight: 500;
    color: #7a756d;
}

.mlc-detail-card.highlight {
    background: rgba(212, 175, 55, 0.08);
    border-color: rgba(212, 175, 55, 0.3);
}

.mlc-detail-card.highlight .mlc-detail-label {
    color: #d4af37;
}

.mlc-detail-card.highlight .mlc-detail-label i {
    color: #d4af37;
}

.mlc-detail-card.highlight .mlc-detail-value {
    color: #d4af37;
}

/* ===== 비교 섹션 ===== */
.mlc-comparison-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.mlc-comparison-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlc-comparison-title i {
    color: #d4af37;
}

.mlc-comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mlc-comparison-table th,
.mlc-comparison-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.mlc-comparison-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
    position: sticky;
    top: 0;
}

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

.mlc-comparison-table td {
    color: #2d2a26;
}

.mlc-comparison-table tr.current td {
    background: rgba(212, 175, 55, 0.08);
    color: #d4af37;
    font-weight: 600;
}

.mlc-comparison-table tr:hover:not(.current) {
    background: #faf9f7;
}

/* ===== 스케줄 섹션 ===== */
.mlc-schedule-section {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: 0 1px 4px rgba(45, 42, 38, 0.06);
}

.mlc-schedule-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.mlc-schedule-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlc-schedule-title i {
    color: #d4af37;
}

.mlc-download-btn {
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #217346;
    background: rgba(33, 115, 70, 0.1);
    border: 1px solid rgba(33, 115, 70, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.mlc-download-btn:hover {
    background: rgba(33, 115, 70, 0.2);
    border-color: #217346;
}

.mlc-download-btn i {
    font-size: 14px;
}

.mlc-table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    max-height: 500px;
}

.mlc-schedule-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.mlc-schedule-table th,
.mlc-schedule-table td {
    padding: 10px 8px;
    text-align: right;
    border-bottom: 1px solid #f0ede8;
}

.mlc-schedule-table th {
    background: #faf9f7;
    font-weight: 600;
    color: #5f5a56;
    font-size: 12px;
    position: sticky;
    top: 0;
}

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

.mlc-schedule-table td {
    color: #2d2a26;
}

.mlc-schedule-table tr:last-child td {
    border-bottom: none;
    font-weight: 600;
    background: rgba(212, 175, 55, 0.08);
    color: #d4af37;
}

.mlc-schedule-table tr:hover:not(:last-child) {
    background: #faf9f7;
}

/* ===== LTV/DTI 비율 카드 ===== */
.mlc-ratio-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.mlc-ratio-card {
    background: #fff;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.mlc-ratio-label {
    font-size: 13px;
    font-weight: 600;
    color: #5f5a56;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mlc-ratio-label i {
    color: #d4af37;
}

.mlc-ratio-value {
    font-size: 32px;
    font-weight: 700;
    color: #2d2a26;
    margin-bottom: 10px;
}

.mlc-ratio-bar {
    height: 8px;
    background: #e8e4dc;
    border-radius: 4px;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
}

.mlc-ratio-fill {
    height: 100%;
    background: #d4af37;
    border-radius: 4px;
    transition: width 0.3s ease;
}

.mlc-ratio-status {
    font-size: 12px;
    font-weight: 600;
    color: #7a756d;
}

.mlc-ratio-card.warning .mlc-ratio-value {
    color: #e67e22;
}

.mlc-ratio-card.warning .mlc-ratio-fill {
    background: #e67e22;
}

.mlc-ratio-card.danger .mlc-ratio-value {
    color: #e74c3c;
}

.mlc-ratio-card.danger .mlc-ratio-fill {
    background: #e74c3c;
}

/* ===== 안내문 ===== */
.mlc-notice {
    text-align: center;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
}

.mlc-notice p {
    font-size: 12px;
    color: #a09a94;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.mlc-notice i {
    color: #d4af37;
}

/* ===== 반응형 - 태블릿 ===== */
@media (max-width: 900px) {
    .mlc-tabs {
        grid-template-columns: 1fr 1fr;
    }

    .mlc-tab {
        padding: 10px 8px;
        font-size: 13px;
    }

    .mlc-input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mlc-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .mlc-ratio-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    /* 모바일 input overflow 방지 */
    .mlc-input-section,
    .mlc-tab-pane,
    .mlc-tab-content {
        max-width: 100%;
        overflow: hidden;
        box-sizing: border-box;
    }

    /* input-group에는 overflow: hidden 금지 (라벨/뱃지 잘림) */
    .mlc-input-group {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* radio/checkbox 제외 - width: 100% 적용 */
    .mlc-input-group input:not([type="radio"]):not([type="checkbox"]),
    .mlc-input-group select {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0;
        box-sizing: border-box !important;
    }
}

/* ===== 반응형 - 모바일 ===== */
@media (max-width: 768px) {
    .mlc-main-result {
        padding: 20px 16px;
    }

    .mlc-main-value {
        font-size: 40px;
    }

    .mlc-main-value .unit {
        font-size: 18px;
    }

    .mlc-detail-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .mlc-detail-card {
        padding: 14px 10px;
    }

    .mlc-detail-value {
        font-size: 20px;
    }

    .mlc-ratio-value {
        font-size: 28px;
    }
}

/* ===== 반응형 - 작은 모바일 ===== */
@media (max-width: 480px) {
    /* 전체 컨테이너 overflow 방지 */
    .tool-section,
    .tool-layout-split,
    .tool-layout-input,
    .tool-layout-result {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .mlc-input-row {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mlc-quick-btns {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }

    /* 탭 버튼 모바일 최적화 - 2x2 그리드 유지 */
    .mlc-tabs {
        grid-template-columns: 1fr 1fr;
        gap: 3px;
        padding: 3px;
    }

    .mlc-tab {
        padding: 8px 6px;
        font-size: 12px;
    }

    .mlc-main-value {
        font-size: 34px;
    }

    .mlc-main-value .unit {
        font-size: 16px;
    }

    .mlc-detail-cards {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .mlc-detail-card {
        display: flex;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        padding: 14px;
    }

    .mlc-detail-label {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .mlc-detail-value {
        font-size: 22px;
    }

    .mlc-ratio-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .mlc-ratio-value {
        font-size: 26px;
    }

    .mlc-schedule-table,
    .mlc-comparison-table {
        font-size: 11px;
    }

    .mlc-schedule-table th,
    .mlc-schedule-table td,
    .mlc-comparison-table th,
    .mlc-comparison-table td {
        padding: 8px 4px;
    }
}

/* ===== Additional Styles ===== */

/* Toggle Buttons */
.mlc-toggle-btns {
    display: flex;
    gap: 6px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

.mlc-toggle-btn {
    flex: 1;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.mlc-toggle-btn.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

/* Tab Description */
.mlc-tab-desc {
    font-size: 13px;
    color: #7a756d;
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    margin-bottom: 16px;
}

.mlc-tab-desc i {
    color: #d4af37;
    margin-right: 6px;
}

/* Condition Summary Badge */
.mlc-condition-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.12) 0%, rgba(184, 134, 11, 0.05) 100%);
    border: 1px solid rgba(212, 175, 55, 0.25);
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #5f5a56;
}

.mlc-condition-summary i {
    color: #d4af37;
    flex-shrink: 0;
}

.mlc-condition-summary strong {
    color: #d4af37;
    font-weight: 600;
}

/* Prepayment Repayment Type Buttons */
.mlc-prepay-type-btns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    background: #f5f3f0;
    border-radius: 8px;
    padding: 4px;
}

.mlc-prepay-type-btn {
    padding: 10px 8px;
    font-size: 13px;
    font-weight: 600;
    color: #7a756d;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: none;
    text-align: center;
    white-space: nowrap;
}

.mlc-prepay-type-btn:hover {
    color: #2d2a26;
    background: rgba(255, 255, 255, 0.6);
}

.mlc-prepay-type-btn.active {
    color: #fff;
    background: #d4af37;
    box-shadow: 0 2px 4px rgba(212, 175, 55, 0.3);
}

@media (max-width: 480px) {
    .mlc-condition-summary {
        padding: 8px 12px;
        font-size: 12px;
    }

    .mlc-condition-summary span {
        line-height: 1.4;
    }

    .mlc-prepay-type-btns {
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        padding: 3px;
    }

    .mlc-prepay-type-btn {
        padding: 8px 4px;
        font-size: 12px;
    }
}

/* Grace Notice */
.mlc-grace-notice {
    padding: 12px;
    background: rgba(212, 175, 55, 0.1);
    border-radius: 8px;
    font-size: 13px;
    color: #5f5a56;
    margin-top: 8px;
}

/* Grace Badge */
.mlc-grace-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #d4af37;
    background: rgba(212, 175, 55, 0.15);
    border-radius: 4px;
}

/* Active Row */
.mlc-active-row {
    background: rgba(212, 175, 55, 0.08) !important;
}

/* Compare Section */
.mlc-compare-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
}

.mlc-compare-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.mlc-compare-card {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.mlc-compare-card.active {
    border-color: #d4af37;
    background: rgba(212, 175, 55, 0.08);
}

.mlc-compare-header {
    margin-bottom: 12px;
}

.mlc-compare-type {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
}

.mlc-compare-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: #d4af37;
    border-radius: 4px;
    margin-left: 6px;
}

.mlc-compare-monthly,
.mlc-compare-total {
    margin-bottom: 8px;
}

.mlc-compare-label {
    font-size: 12px;
    color: #7a756d;
}

.mlc-compare-value {
    font-size: 18px;
    font-weight: 600;
    color: #2d2a26;
}

.mlc-compare-desc {
    font-size: 12px;
    color: #a09a94;
}

.mlc-compare-chart {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

.mlc-compare-chart-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
}

.mlc-compare-bars {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mlc-compare-bar-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mlc-compare-bar-label {
    width: 80px;
    font-size: 13px;
    color: #5f5a56;
}

.mlc-compare-bar-track {
    flex: 1;
    height: 24px;
    background: #e8e4dc;
    border-radius: 4px;
    overflow: hidden;
}

.mlc-compare-bar-fill {
    height: 100%;
    background: #d4af37;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    transition: width 0.3s;
}

/* Prepay Section */
.mlc-prepay-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
}

.mlc-prepay-comparison {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 16px;
    align-items: center;
}

.mlc-prepay-col {
    background: #faf9f7;
    border: 1px solid #e8e4dc;
    border-radius: 12px;
    padding: 16px;
}

.mlc-prepay-col-title {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 12px;
    text-align: center;
}

.mlc-prepay-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0ede8;
}

.mlc-prepay-item:last-child {
    border-bottom: none;
}

.mlc-prepay-label {
    font-size: 13px;
    color: #7a756d;
}

.mlc-prepay-value {
    font-size: 14px;
    font-weight: 600;
    color: #2d2a26;
}

.mlc-prepay-arrow {
    font-size: 24px;
    color: #d4af37;
}

.mlc-prepay-savings {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15) 0%, rgba(184, 134, 11, 0.15) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 16px;
    text-align: center;
}

.mlc-prepay-savings i {
    font-size: 24px;
    color: #d4af37;
}

.mlc-prepay-savings span {
    font-size: 15px;
    color: #5f5a56;
}

.mlc-prepay-savings .mlc-prepay-value {
    font-size: 24px;
    font-weight: 700;
    color: #d4af37;
}

/* Ratio Section Additional */
.mlc-ratio-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d2a26;
    margin-bottom: 16px;
}

.mlc-ratio-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.mlc-ratio-bar-fill {
    height: 100%;
    background: #27ae60;
    border-radius: 4px;
    transition: width 0.3s;
}

.mlc-ratio-bar-fill.warning {
    background: #f39c12;
}

.mlc-ratio-bar-fill.danger {
    background: #e74c3c;
}

.mlc-ratio-desc {
    font-size: 12px;
    color: #7a756d;
    margin-top: 8px;
}

.mlc-ratio-notice {
    padding: 12px;
    background: #faf9f7;
    border-radius: 8px;
    font-size: 13px;
    color: #5f5a56;
    margin-top: 16px;
}

/* Responsive additions */
@media (max-width: 768px) {
    .mlc-compare-cards {
        grid-template-columns: 1fr;
    }

    .mlc-prepay-comparison {
        grid-template-columns: 1fr;
    }

    .mlc-prepay-arrow {
        transform: rotate(90deg);
        text-align: center;
    }
}

/* Excel button guard */
.tool-btn-excel {
  background: #59ab79;
  border-color: #59ab79;
}

.tool-btn-excel:hover,
.tool-btn-excel:focus-visible {
  background: #4f9f70;
  border-color: #4f9f70;
}

