/**
 * 스마트 FIRE 계산기 공통 스타일
 * 반응형 디자인 및 사용자 친화적 인터페이스
 */

/* 컨테이너 기본 스타일 */
.sfc-container {
    max-width: 800px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    font-family: 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
    line-height: 1.6;
}

/* 헤더 섹션 */
.sfc-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.sfc-header h3 {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.sfc-description {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
}

/* 입력 섹션 */
.sfc-input-section {
    margin-bottom: 30px;
}

.sfc-input-group {
    margin-bottom: 25px;
}

.sfc-label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 16px;
    position: relative;
}

.sfc-tooltip {
    display: inline-block;
    width: 20px;
    height: 20px;
    background: #3498db;
    color: white;
    border-radius: 50%;
    text-align: center;
    font-size: 12px;
    line-height: 20px;
    margin-left: 8px;
    cursor: help;
    transition: background-color 0.3s ease;
}

.sfc-tooltip:hover {
    background: #2980b9;
}

.sfc-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.sfc-input {
    width: 100%;
    padding: 15px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 500;
    color: #2c3e50;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.sfc-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.2);
}

.sfc-unit {
    position: absolute;
    right: 20px;
    color: #7f8c8d;
    font-weight: 600;
    pointer-events: none;
}

/* 버튼 그룹 */
.sfc-button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.sfc-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.sfc-btn-primary {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
}

.sfc-btn-primary:hover {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.sfc-btn-secondary {
    background: #ecf0f1;
    color: #34495e;
    border: 2px solid #bdc3c7;
}

.sfc-btn-secondary:hover {
    background: #d5dbdb;
    border-color: #95a5a6;
    transform: translateY(-2px);
}

.sfc-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* 결과 섹션 */
.sfc-results {
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-radius: 12px;
    border: 1px solid #e9ecef;
    animation: fadeInUp 0.5s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sfc-result-header h4 {
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 25px 0;
    text-align: center;
}

/* 주요 결과 */
.sfc-result-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.sfc-result-item {
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    text-align: center;
    border: 1px solid #f0f0f0;
}

.sfc-result-item.sfc-highlight {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
    border: none;
}

.sfc-result-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    opacity: 0.8;
}

.sfc-result-value {
    display: block;
    font-size: 24px;
    font-weight: 700;
}

/* 상세 내역 */
.sfc-result-details h5 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 20px 0;
}

.sfc-breakdown {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.sfc-breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.sfc-breakdown-item:hover {
    background-color: #f8f9fa;
}

.sfc-breakdown-item:last-child {
    border-bottom: none;
}

.sfc-breakdown-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-weight: 700;
    font-size: 18px;
}

/* 공식 섹션 */
.sfc-formula-section {
    margin-top: 30px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 4px solid #3498db;
}

.sfc-formula-section h5 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.sfc-formula p {
    margin: 10px 0;
    font-family: 'Courier New', monospace;
    background: white;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

/* 면책조항 */
.sfc-disclaimer {
    margin-top: 25px;
    padding: 20px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    color: #856404;
}

.sfc-disclaimer p {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* 로딩 스피너 */
.sfc-loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

.sfc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 에러 메시지 */
.sfc-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    animation: shake 0.5s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.sfc-error-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sfc-error-icon {
    font-size: 20px;
}

.sfc-error-text {
    font-weight: 500;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .sfc-container {
        margin: 10px;
        padding: 20px;
    }
    
    .sfc-header h3 {
        font-size: 24px;
    }
    
    .sfc-description {
        font-size: 14px;
    }
    
    .sfc-result-main {
        grid-template-columns: 1fr;
    }
    
    .sfc-button-group {
        flex-direction: column;
        align-items: center;
    }
    
    .sfc-btn {
        width: 100%;
        max-width: 250px;
    }
    
    .sfc-breakdown-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .sfc-breakdown-total {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* ===== Korean Tax Calculator (korean-tax-calculator.php) ===== */
.sfc-korean-tax {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.calculator-header {
    text-align: center;
    margin-bottom: 30px;
}

.risk-warning {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.risk-warning ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.input-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.input-wrapper {
    display: flex;
    align-items: center;
}

.input-wrapper input {
    flex: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}

.input-wrapper .unit {
    margin-left: 10px;
    color: #666;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.button-group button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-calculate {
    background: #4CAF50;
    color: white;
}

.btn-calculate:hover { background: #45a049; }

.btn-example { background: #2196F3; color: white; }

.btn-reset { background: #f44336; color: white; }

.summary-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.summary-card h4 { margin: 0 0 10px 0; color: #666; font-size: 14px; }
.summary-card .amount { font-size: 28px; font-weight: bold; color: #4CAF50; margin: 10px 0; }

.breakdown-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.breakdown-table th,
.breakdown-table td { padding: 12px; text-align: right; border-bottom: 1px solid #eee; }
.breakdown-table th:first-child,
.breakdown-table td:first-child { text-align: left; }
.breakdown-table .deduction { color: #d32f2f; }
.breakdown-table .total { background: #f5f5f5; font-weight: bold; }

.loading { text-align: center; padding: 40px; }
.spinner { width: 50px; height: 50px; border: 5px solid #f3f3f3; border-top: 5px solid #4CAF50; border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto; }
@keyframes spin { 0% { transform: rotate(0deg);} 100% { transform: rotate(360deg);} }

.tooltip { cursor: help; color: #2196F3; }

/* ===== FIRE Calculator: Math Insights ===== */
.math-insights {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-top: 30px;
}

.math-box, .budget-box, .insight-box {
    background: #ffffff;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    padding: 16px;
    margin-top: 12px;
}

.math-box code {
    display: inline-block;
    background: #111827;
    color: #e5e7eb;
    padding: 6px 10px;
    border-radius: 6px;
    margin: 6px 0 10px 0;
}

.math-box .vars { margin: 8px 0 4px 18px; }
.calc-result { font-weight: bold; color: #111827; }
.source-note { color: #6b7280; font-size: 12px; margin-top: 8px; }

/* Details section */
.details-box {
    background: #ffffff;
    border: 1px dashed #cbd5e1;
    border-radius: 10px;
    padding: 16px;
    margin-top: 12px;
}
.input-hint { display: block; margin-top: 5px; color: #999; font-size: 13px; }

/* 세율 구간 테이블 */
.tax-brackets-section { background: white; padding: 25px; border-radius: 10px; margin-top: 30px; box-shadow: 0 2px 10px rgba(0,0,0,0.1); }
.brackets-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.brackets-table th { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; padding: 15px; text-align: left; font-weight: 600; }
.brackets-table td { padding: 12px 15px; border-bottom: 1px solid #f0f0f0; }
.brackets-table tr:hover { background: #f8f9fa; }
.brackets-table .current-bracket { background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%); border-left: 4px solid #2196F3; font-weight: 600; }
.brackets-table .applied-bracket { background: #f5f5f5; }
.highlight-column { text-align: center !important; }
.badge { display: inline-block; padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge.current { background: #2196F3; color: white; }
.badge.applied { background: #4CAF50; color: white; }
.badge.not-applied { background: #e0e0e0; color: #999; }

/* 계산 상세 카드 */
.tax-calculation-detail { margin-top: 30px; }
.calculation-card { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); padding: 25px; border-radius: 15px; box-shadow: 0 4px 15px rgba(0,0,0,0.1); }
.calculation-card h5 { margin: 0 0 20px 0; color: #333; font-size: 18px; }
.calc-step { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.3); }
.calc-step:last-child { border-bottom: none; }
.calc-step.result { margin-top: 10px; padding-top: 15px; border-top: 2px solid #2196F3; font-size: 18px; font-weight: bold; color: #2196F3; }
.step-label { color: #666; }
.step-value { font-weight: 600; color: #333; }

@media (max-width: 768px) {
    .summary-cards { grid-template-columns: 1fr; }
    .button-group { flex-direction: column; }
    .brackets-table { font-size: 14px; }
    .brackets-table th,
    .brackets-table td { padding: 8px; }
}

/* ===== Debt Advisor (debt-advisor.php) ===== */
.sfc-debt-advisor { max-width: 1200px; margin: 0 auto; padding: 20px; }
.rule-explanation { background: #e8f5e9; padding: 20px; border-radius: 10px; margin-bottom: 20px; }
.rule-formula { background: #fff; padding: 15px; border-radius: 5px; margin: 10px 0; text-align: center; font-size: 16px; }
.debt-item { background: #f5f5f5; padding: 15px; border-radius: 8px; margin-bottom: 15px; }
.debt-item h4 { margin: 0 0 15px 0; display: flex; justify-content: space-between; align-items: center; }
.btn-remove { background: #f44336; color: #fff; border: none; padding: 5px 10px; border-radius: 3px; cursor: pointer; font-size: 12px; }
.btn-add-debt { background: #2196F3; color: #fff; border: none; padding: 10px 20px; border-radius: 5px; cursor: pointer; margin-top: 10px; }
.decision-summary { margin-bottom: 30px; }
.decision-card { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: #fff; padding: 20px; border-radius: 10px; text-align: center; }

/* ===== Investment Simulator (investment-simulator.php) ===== */
.sfc-investment-sim { max-width: 1200px; margin: 0 auto; padding: 20px; }
.risk-warning.critical { background: #ffebee; border-left: 4px solid #f44336; padding: 15px; margin-bottom: 20px; border-radius: 5px; }
.risk-warning.critical strong { color: #d32f2f; }
.sfc-investment-sim .input-row { display: flex; gap: 20px; margin-bottom: 20px; }
.sfc-investment-sim .input-row .input-group { flex: 1; }
.portfolio-info { background: #e3f2fd; padding: 20px; border-radius: 10px; margin: 20px 0; }
.portfolio-allocation { display: flex; gap: 20px; margin: 15px 0; }
.allocation-item { flex: 1; background: #fff; padding: 10px; border-radius: 5px; display: flex; justify-content: space-between; }
.performance-metrics { background: #fff; padding: 20px; border-radius: 10px; margin-bottom: 30px; }
.metrics-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; margin-top: 15px; }
.metric { display: flex; justify-content: space-between; padding: 10px; background: #f5f5f5; border-radius: 5px; }
.metric label { color: #666; }
.metric span { font-weight: bold; color: #4CAF50; }
.holding-period-analysis { background: #fff; padding: 20px; border-radius: 10px; margin-top: 30px; }
.analysis-table { width: 100%; margin-top: 15px; border-collapse: collapse; }
.analysis-table th, .analysis-table td { padding: 12px; text-align: center; border-bottom: 1px solid #eee; }
.risk-high { color: #f44336; font-weight: bold; }
.risk-medium { color: #ff9800; font-weight: bold; }
.risk-low { color: #4caf50; font-weight: bold; }
.risk-very-low { color: #2196f3; font-weight: bold; }
.crisis-scenarios { background: #fff3cd; padding: 20px; border-radius: 10px; margin-top: 30px; }
.scenario-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 15px; margin-top: 15px; }
.scenario-card { background: #fff; padding: 15px; border-radius: 8px; border: 1px solid #ffc107; }
.scenario-card h5 { margin: 0 0 10px 0; color: #f57c00; }
.scenario-card .loss { color: #d32f2f; font-weight: bold; }
.scenario-card .recovery { color: #f57c00; font-weight: bold; }
.scenario-card .final { color: #4caf50; font-weight: bold; }
.yearly-breakdown { margin-top: 30px; }
.table-controls { margin: 15px 0; }
.yearly-table { width: 100%; border-collapse: collapse; margin-top: 15px; }
.yearly-table th, .yearly-table td { padding: 10px; text-align: right; border-bottom: 1px solid #eee; }
.yearly-table th:first-child, .yearly-table td:first-child { text-align: left; }
.inflation-impact { background: #fce4ec; padding: 20px; border-radius: 10px; margin-top: 30px; }
.inflation-result { text-align: center; margin: 20px 0; }
.future-cost { font-size: 36px; font-weight: bold; color: #d32f2f; }
.inflation-note { background: #fff; padding: 15px; border-radius: 5px; margin-top: 15px; border-left: 3px solid #ff5252; }
@media (max-width: 768px) {
  .sfc-investment-sim .input-row { flex-direction: column; }
  .scenario-cards { grid-template-columns: 1fr; }
}

/* ===== 통합 탭 UI ===== */
.pfc-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 16px;
}

.pfc-tab-button {
    background: #eef2ff;
    color: #334155;
    border: 1px solid #e5e7eb;
    border-radius: 9999px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
}

.pfc-tab-button.active {
    background: #4f46e5;
    color: white;
    border-color: #4f46e5;
}

.pfc-tab-panel {
    display: none;
}

.pfc-tab-panel.active {
    display: block;
}

/* 포트폴리오 차트 성능 최적화 */
.sfc-portfolio .chart-section {
    contain: layout paint size;
    will-change: transform;
}
.sfc-portfolio #sfc-allocation-chart {
    display: block;
    will-change: transform;
    image-rendering: optimizeSpeed;
}

@media (max-width: 480px) {
    .sfc-container {
        padding: 15px;
    }
    
    .sfc-input {
        font-size: 16px; /* iOS 확대 방지 */
    }
    
    .sfc-result-value {
        font-size: 20px;
    }
    
    .sfc-formula p {
        font-size: 12px;
        padding: 10px;
    }
}

/* 다크 테마 (선택사항) */
.sfc-container[data-theme="dark"] {
    background: #2c3e50;
    color: #ecf0f1;
}

.sfc-container[data-theme="dark"] .sfc-input {
    background: #34495e;
    border-color: #4a6741;
    color: #ecf0f1;
}

.sfc-container[data-theme="dark"] .sfc-results {
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border-color: #4a6741;
}

.sfc-container[data-theme="dark"] .sfc-result-item {
    background: #34495e;
    border-color: #4a6741;
    color: #ecf0f1;
}

/* 접근성 개선 */
.sfc-container *:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* 프린트 스타일 */
@media print {
    .sfc-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .sfc-btn, .sfc-loading {
        display: none;
    }
    
    .sfc-results {
        background: white !important;
    }
}

/* ===============================================
   한국형 세후소득 계산기 추가 스타일
   =============================================== */

/* 세율 구간 테이블 스타일 */
.tax-brackets-section {
    background: white;
    padding: 25px;
    border-radius: 10px;
    margin-top: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.brackets-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.brackets-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.brackets-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
}

.brackets-table tr:hover {
    background: #f8f9fa;
    transition: background 0.3s ease;
}

.brackets-table .current-bracket {
    background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%);
    border-left: 4px solid #2196F3;
    font-weight: 600;
    animation: highlight 0.5s ease;
}

@keyframes highlight {
    0% { background-color: #ffeb3b; }
    100% { background: linear-gradient(90deg, #e3f2fd 0%, #fff 100%); }
}

.brackets-table .applied-bracket {
    background: #f5f5f5;
}

.highlight-column {
    text-align: center !important;
}

/* 배지 스타일 */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge.current {
    background: #2196F3;
    color: white;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
}

.badge.applied {
    background: #4CAF50;
    color: white;
}

.badge.not-applied {
    background: #e0e0e0;
    color: #999;
}

/* 세금 계산 상세 카드 */
.tax-calculation-detail {
    margin-top: 30px;
}

.calculation-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
    color: white;
    position: relative;
    overflow: hidden;
}

.calculation-card::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calculation-card h5 {
    margin: 0 0 25px 0;
    color: white;
    font-size: 20px;
    position: relative;
    z-index: 1;
}

.calc-step {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    position: relative;
    z-index: 1;
}

.calc-step:last-child {
    border-bottom: none;
}

.calc-step.result {
    margin-top: 15px;
    padding-top: 20px;
    border-top: 2px solid rgba(255,255,255,0.5);
    font-size: 20px;
    font-weight: bold;
}

.step-label {
    color: rgba(255,255,255,0.9);
    font-weight: 500;
}

.step-value {
    font-weight: 700;
    color: white;
}

.calc-step.result .step-value {
    color: #ffd700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
}

/* 입력 힌트 */
.input-hint {
    display: block;
    margin-top: 5px;
    color: #999;
    font-size: 13px;
    font-style: italic;
}

/* 개선된 버튼 스타일 */
.btn-calculate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-calculate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-reset {
    background: #f44336;
    color: white;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* 반응형 디자인 개선 */
@media (max-width: 768px) {
    .calculation-card {
        padding: 20px;
    }
    
    .calc-step {
        flex-direction: column;
        text-align: left;
    }
    
    .step-value {
        margin-top: 5px;
        font-size: 16px;
    }
    
    .brackets-table {
        font-size: 14px;
    }
    
    .brackets-table th,
    .brackets-table td {
        padding: 8px;
    }
    
    .badge {
        font-size: 10px;
        padding: 3px 8px;
    }
}
.budget-playbook {
    margin-top: 32px;
}

.budget-playbook h4 {
    margin-bottom: 16px;
}

.playbook-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.playbook-card {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.playbook-card h5 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.playbook-card ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.playbook-card ul li {
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 14px;
}

.playbook-card.checklist {
    background: #f5f8ff;
    border-color: #d4e2ff;
}

.playbook-card.checklist ul li::marker {
    color: #3f51b5;
}

@media (max-width: 768px) {
    .playbook-card {
        padding: 14px;
    }
}
.investment-insights {
    margin-top: 32px;
}

.investment-insights h4 {
    margin-bottom: 16px;
}

.insight-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.insight-card {
    background: #ffffff;
    border: 1px solid #e6e6e6;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04);
}

.insight-card h5 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.insight-card ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

.insight-card ul li {
    margin-bottom: 6px;
    line-height: 1.5;
    font-size: 14px;
}

.insight-card code {
    display: inline-block;
    background: #f4f6fb;
    padding: 2px 6px;
    border-radius: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}

.insight-note {
    margin-top: 8px;
    font-size: 13px;
    color: #4a5568;
}

@media (max-width: 768px) {
    .insight-card {
        padding: 14px;
    }
}
.loss-probability-formula {
    margin-top: 20px;
    padding: 16px;
    background: #fbfcff;
    border: 1px solid #e0e6ff;
    border-radius: 12px;
}

.loss-probability-formula h5 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 16px;
    font-weight: 600;
}

.loss-probability-formula code {
    display: inline-block;
    margin-bottom: 8px;
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
}

.loss-probability-formula ul {
    margin: 0 0 12px 18px;
    padding: 0;
    list-style: disc;
}

.loss-probability-formula ul li {
    font-size: 14px;
    margin-bottom: 4px;
    line-height: 1.5;
}

.loss-probability-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.loss-probability-table th,
.loss-probability-table td {
    border: 1px solid #e4e7f5;
    padding: 8px 10px;
    text-align: center;
}

.loss-probability-table thead th {
    background: #f0f3ff;
    font-weight: 600;
}

@media (max-width: 768px) {
    .loss-probability-formula {
        padding: 12px;
    }
}
.formula-explain {
    margin-top: 16px;
    padding-left: 18px;
}

.formula-explain ol {
    margin: 0;
    padding-left: 20px;
}

.formula-explain ol li {
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.6;
}

.formula-note {
    margin-top: 10px;
    font-size: 13px;
    color: #5b6474;
}
.drawdown-explain {
    margin-top: 18px;
    padding: 16px;
    background: #fff8f8;
    border: 1px solid #ffd6d6;
    border-radius: 12px;
}

.drawdown-explain h5 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 16px;
    font-weight: 600;
}

.drawdown-explain code {
    display: inline-block;
    background: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 4px;
}

.drawdown-note {
    margin-top: 8px;
    font-size: 13px;
    color: #8a3c3c;
}
