/* ==========================================================================
   /tax-account/limit/ 전용 스타일 — 연금저축+IRP 한도 계산기
   공통: tax-account-common.css 로드 후 이 파일 적용
   ========================================================================== */

/* 페이지 전용 제목 섹션 (breadcrumb-band 아래, 군인 패턴) */
.limit-title-section {
    background: #fff;
    padding: 28px 24px 24px;
    border-bottom: 1px solid #e2e8f0;
}
.limit-title-inner {
    max-width: 1240px;
    margin: 0 auto;
}
.limit-title-section h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
    letter-spacing: -0.025em;
    display: flex; align-items: center; gap: 10px;
    line-height: 1.3;
    word-break: keep-all;       /* 한글 단어 중간 꺾임 방지 */
    overflow-wrap: break-word;
    flex-wrap: wrap;            /* 좁을 때 자연 줄바꿈 */
}
.limit-title-section h1 .icon { color: var(--primary-color); }
.limit-title-section .subtitle {
    color: var(--text-sub);
    font-size: 1rem;
}

/* ─── 커뮤니티형 결과 구조 ─── */

/* 1단: 메인 추천 (행동 카드) */
.rec-main {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent) 100%);
    color: #fff;
    border-radius: 14px;
    padding: 20px 22px;
    margin-bottom: 14px;
    box-shadow: 0 8px 20px rgba(8, 145, 178, 0.18);
}
.rec-main .rec-label {
    font-size: 0.78rem;
    font-weight: 700;
    opacity: 0.9;
    letter-spacing: 0.03em;
    margin-bottom: 6px;
}
.rec-main .rec-action {
    font-size: 1.2rem;
    font-weight: 800;
    line-height: 1.35;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    word-break: keep-all;
}
.rec-main .rec-action b { font-weight: 900; }
.rec-main .rec-chunk { white-space: nowrap; }  /* 각 덩어리 내부 안 깨짐 → + 앞에서 줄바꿈 */
/* 예상 환급 / 최대 환급 2열 비교 */
.rec-main .rec-refund-grid {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 12px 10px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    backdrop-filter: blur(4px);
    gap: 8px;
}
.rec-main .rec-refund-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.rec-main .rec-refund-cell .r-label {
    font-size: 0.72rem;
    opacity: 0.85;
    font-weight: 600;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}
.rec-main .rec-refund-cell .r-value {
    font-size: 1.25rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}
.rec-main .rec-refund-cell.max .r-value {
    opacity: 0.75;
    font-size: 1.05rem;
}
.rec-main .rec-refund-divider {
    width: 1px;
    height: 36px;
    background: rgba(255, 255, 255, 0.35);
}

/* ─── 월 납입 플래너 테이블 (행동형 핵심) ─── */
.rec-main .rec-label {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rec-main .rec-label i {
    font-size: 1rem;
}
.rec-main .rec-planner-days {
    margin: 8px 0 14px;
    word-break: keep-all;
}
.rec-main .pl-days-main {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    line-height: 1.4;
    margin-bottom: 2px;
}
.rec-main .pl-days-main b {
    color: #fde68a;      /* amber-200 포인트 */
    font-weight: 800;
}
.rec-main .pl-days-sub {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}
.rec-main .pl-days-sub b {
    color: #fde68a;
    font-weight: 700;
}
.rec-main .rec-planner-table {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    padding: 14px 16px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 10px 14px;
    align-items: center;
}
.rec-main .rec-planner-row {
    display: contents;
}
.rec-main .rec-planner-row .pl-product {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}
.rec-main .rec-planner-row .pl-monthly {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.75);
    font-variant-numeric: tabular-nums;
    text-align: right;
}
.rec-main .rec-planner-row .pl-total {
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    text-align: right;
    min-width: 70px;
}
.rec-main .rec-planner-divider {
    grid-column: 1 / -1;
    height: 1px;
    background: rgba(255, 255, 255, 0.25);
    margin: 4px 0;
}
.rec-main .rec-planner-sum .pl-product,
.rec-main .rec-planner-sum .pl-monthly,
.rec-main .rec-planner-sum .pl-total {
    color: #fff;
    font-weight: 800;
    font-size: 0.95rem;
}

/* ─── 환급 박스 (월 플래너 아래) ─── */
.rec-main .rec-refund-box {
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 12px;
}
.rec-main .rec-refund-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.rec-main .rr-label {
    font-size: 0.92rem;
    font-weight: 600;
    color: #fff;
}
.rec-main .rr-value {
    font-size: 1.35rem;
    font-weight: 800;
    color: #fff;
    font-variant-numeric: tabular-nums;
}
.rec-main .rec-refund-hint {
    margin-top: 6px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.78);
    letter-spacing: -0.01em;
}
/* 900 못 채울 때 조건부 힌트 (월 플래너 아래) */
.rec-main .rec-allocation-hint {
    margin-top: 10px;
    padding: 0 4px;
    text-align: left;
}
/* 모바일 */
@media (max-width: 480px) {
    .rec-main .rec-planner-table {
        gap: 8px 10px;
        padding: 12px 12px;
    }
    .rec-main .rec-planner-row .pl-monthly {
        font-size: 0.78rem;
    }
    .rec-main .rec-planner-row .pl-total {
        font-size: 0.88rem;
    }
    .rec-main .rr-value {
        font-size: 1.2rem;
    }
}

/* ─── ISA 보너스 분해 (이전금 있을 때만) ─── */
.rec-main .rec-breakdown {
    margin-top: 12px;
    padding: 10px 12px;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rec-main .rb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.92);
}
.rec-main .rb-row .rb-label i {
    font-size: 0.9rem;
    margin-right: 4px;
    color: #fde68a;           /* amber-200, ISA 구분색 */
}
.rec-main .rb-row .rb-value {
    font-weight: 700;
}
.rec-main .rb-row.rb-bonus .rb-value {
    color: #fde68a;           /* amber-200 — 보너스 강조 */
}

/* 진행률 바 (한도 활용도) */
.rec-main .rec-progress {
    margin-top: 10px;
}
.rec-main .rec-progress-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 6px;
}
.rec-main .rec-progress-fill {
    height: 100%;
    background: #fef3c7;
    border-radius: 3px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 12px rgba(254, 243, 199, 0.5);
}
.rec-main .rec-progress-label {
    font-size: 0.78rem;
    opacity: 0.95;
    line-height: 1.4;
    text-align: center;
}
.rec-main .rec-progress-label b {
    font-weight: 900;
    color: #fef3c7;
}
.rec-main .rec-sub {
    margin-top: 10px;
    font-size: 0.75rem;
    opacity: 0.85;
    text-align: right;
}

/* 2단: 이유 */
.rec-reason {
    background: #f8fafc;
    border-left: 3px solid var(--primary-color);
    border-radius: 0 10px 10px 0;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.9rem;
}
.rec-reason strong {
    display: block;
    color: var(--primary-dark);
    font-size: 0.82rem;
    margin-bottom: 6px;
    font-weight: 700;
}
.rec-reason ul {
    margin: 0;
    padding-left: 16px;
    color: #334155;
    line-height: 1.7;
}
.rec-reason li { margin-bottom: 2px; }

/* 360px 이하 — 긴 reason 한 줄에 들어오도록 자간·폰트 축소 */
@media (max-width: 480px) {
    .rec-reason {
        font-size: 0.85rem;
        padding: 10px 12px;
    }
    .rec-reason ul {
        padding-left: 14px;
        letter-spacing: -0.025em;
    }
    .rec-reason li {
        line-height: 1.6;
    }
}
@media (max-width: 360px) {
    .rec-reason {
        font-size: 0.82rem;
        padding: 9px 10px;
    }
    .rec-reason ul {
        padding-left: 12px;
        letter-spacing: -0.04em;       /* 강한 자간 축소 */
    }
    .rec-reason li {
        line-height: 1.55;
    }
}

/* 3단: 한도 상태 (덜 눈에 띄게) */
.limit-status {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
}
.limit-status .ls-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.85rem;
    color: var(--text-sub);
}
.limit-status .ls-row b {
    color: var(--text-main);
    font-weight: 700;
}

/* 4단: 시나리오 상세 (펼침) */
.scenarios-details {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
}
.scenarios-details > summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-dark);
    list-style: none;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.scenarios-details > summary::-webkit-details-marker { display: none; }
.scenarios-details > summary::after {
    content: '▸';
    margin-left: auto;
    font-size: 0.85rem;
    color: var(--text-sub);
    transition: transform 0.2s;
}
.scenarios-details[open] > summary::after { transform: rotate(90deg); }
.scenarios-inner { padding-top: 12px; }
.scenarios-note {
    font-size: 0.82rem;
    color: var(--text-sub);
    margin-bottom: 10px;
    line-height: 1.5;
}

/* 결과 — 3시나리오 비교 (400px 왼쪽 컬럼 대응 — compact) */
.scenario-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-top: 14px;
}
.scenario-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 9px;
    padding: 10px 6px;
    text-align: center;
    min-width: 0;
}
.scenario-card.best {
    border-color: var(--primary-color);
    background: var(--primary-light);
}
.scenario-card .sc-label {
    font-size: 0.72rem;
    color: var(--text-sub);
    margin-bottom: 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.scenario-card.best .sc-label { color: var(--primary-dark); }
.scenario-card .sc-split {
    font-size: 0.72rem;
    color: #475569;
    margin-bottom: 6px;
}
.scenario-card .sc-refund {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-main);
    word-break: keep-all;
}
.scenario-card.best .sc-refund { color: var(--primary-dark); }

/* 추천 배분 박스 */
.split-recommend {
    background: #fff;
    border: 1px dashed var(--primary-border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-top: 14px;
}
.split-recommend .sr-head {
    font-size: 0.85rem;
    color: var(--primary-dark);
    font-weight: 700;
    margin-bottom: 8px;
}
.split-recommend .sr-row {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 0.95rem;
    border-bottom: 1px dashed #e2e8f0;
}
.split-recommend .sr-row:last-of-type { border-bottom: none; }
.split-recommend .sr-row b { color: var(--text-main); }

/* 매달 vs 연말 박스 */
.timing-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-top: 14px;
    font-size: 0.88rem;
    color: #78350f;
    line-height: 1.6;
}
.timing-box strong { color: #92400e; }

/* 가이드 페이지 H2 */
.guide-section {
    background: #fff;
    border-radius: 14px;
    padding: 24px 28px;
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid rgba(8, 145, 178, 0.08);
}
.guide-section h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-light);
    /* 한글 가독성 표준 (사이트 구조.md A-8) */
    word-break: keep-all;
    letter-spacing: -0.02em;
    line-height: 1.35;
}
.guide-section h3 {
    word-break: keep-all;
    letter-spacing: -0.02em;
    line-height: 1.4;
}
.guide-section p {
    color: #334155;
    line-height: 1.8;
    margin-bottom: 12px;
    /* 한글 가독성 표준 */
    word-break: keep-all;
    letter-spacing: -0.01em;
}
.guide-section ul {
    margin: 10px 0 14px 0;
    padding-left: 18px;
    color: #334155;
}
.guide-section ul li {
    margin-bottom: 8px;
    line-height: 1.7;
    /* 한글 가독성 표준 */
    word-break: keep-all;
    letter-spacing: -0.01em;
}
.guide-section strong { color: var(--text-main); }

.warning-box {
    background: #fef3c7;
    border: 1px solid #fbbf24;
    border-radius: 8px;
    padding: 14px 18px;
    margin: 14px 0;
    color: #92400e;
    font-size: 0.93rem;
    line-height: 1.7;
}
.warning-box strong { color: #78350f; }

.info-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 8px 8px 0;
    padding: 12px 16px;
    margin: 12px 0;
    color: #0f172a;
    font-size: 0.92rem;
    line-height: 1.7;
}

/* .ta-advanced 공통 스타일은 tax-account-common.css 로 이전됨 */

/* 경고/안내 박스 (결과 영역 내) */
.warn-box {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.88rem;
    line-height: 1.6;
    word-break: keep-all;
    letter-spacing: -0.01em;
}
.warn-box .warn-line {
    color: #78350f;
    padding: 3px 0;
    word-break: keep-all;
}
/* 메인 줄 (초과까지 한 줄) + 서브 줄 (분산 추천 별도) 구조 */
.warn-box .warn-line .w-main {
    display: block;
    white-space: nowrap;          /* "초과" 까지 강제 한 줄 */
    overflow: hidden;
    text-overflow: ellipsis;
}
.warn-box .warn-line .w-sub {
    display: block;
    margin-top: 2px;
    font-size: 0.85rem;
    color: #92400e;
}
/* 480px 이하 — 메인 줄도 자간 축소로 한 줄 유지 */
@media (max-width: 480px) {
    .warn-box {
        font-size: 0.82rem;
        padding: 10px 12px;
        letter-spacing: -0.025em;
    }
    .warn-box .warn-line .w-main {
        letter-spacing: -0.03em;
    }
    .warn-box .warn-line .w-sub {
        font-size: 0.78rem;
        letter-spacing: -0.02em;
    }
}
@media (max-width: 360px) {
    .warn-box {
        font-size: 0.78rem;
        padding: 9px 10px;
    }
    .warn-box .warn-line .w-main {
        letter-spacing: -0.045em;    /* 강한 축소로 한 줄 유지 */
        font-size: 0.76rem;
    }
    .warn-box .warn-line .w-sub {
        font-size: 0.74rem;
    }
}
.warn-box .warn-line + .warn-line {
    border-top: 1px dashed #fde68a;
    margin-top: 3px;
    padding-top: 6px;
}
.warn-box .warn-line a {
    color: var(--primary-dark);
    font-weight: 600;
    text-decoration: underline;
}

/* 한도 구조 치트시트 (결과 하단, 재계산 버튼 위 · 참고용 · SEO 크롤 OK) */
.limit-cheatsheet {
    width: 100%;
    margin: 18px 0 14px;
    border-collapse: collapse;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    font-size: 0.85rem;
}
.limit-cheatsheet caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 8px 2px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-sub);
    letter-spacing: -0.01em;
}
.limit-cheatsheet th,
.limit-cheatsheet td {
    padding: 9px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
    word-break: keep-all;
    letter-spacing: -0.01em;
}
.limit-cheatsheet tr:last-child th,
.limit-cheatsheet tr:last-child td {
    border-bottom: none;
}
.limit-cheatsheet th {
    color: var(--primary-dark);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    width: 30%;
    font-size: 0.9rem;
}
.limit-cheatsheet td {
    color: #475569;
    line-height: 1.5;
}
@media (max-width: 480px) {
    .limit-cheatsheet { font-size: 0.8rem; }
    .limit-cheatsheet caption { font-size: 0.78rem; }
    .limit-cheatsheet th,
    .limit-cheatsheet td { padding: 8px 10px; letter-spacing: -0.02em; }
    .limit-cheatsheet th { font-size: 0.85rem; }
}
@media (max-width: 360px) {
    .limit-cheatsheet th,
    .limit-cheatsheet td { font-size: 0.76rem; padding: 7px 8px; letter-spacing: -0.025em; }
}

/* 모바일 — 군인 계산기 패턴 */
@media (max-width: 768px) {
    .limit-title-section { padding: 20px 16px 18px; }
    .limit-title-section h1 { font-size: 1.5rem; }
    .scenario-grid { grid-template-columns: 1fr; gap: 10px; }
    .guide-section { padding: 20px 18px; border-radius: 12px; }
}

@media (max-width: 480px) {
    .limit-title-section h1 { font-size: 1.4rem; letter-spacing: -0.03em; }
    .limit-title-section .subtitle { font-size: 0.92rem; }
    .guide-section h2 {
        font-size: 1.15rem;
        letter-spacing: -0.025em;
        padding-left: 1.8ch;
        text-indent: -1.8ch;          /* 번호 hanging indent */
    }
    .guide-section h3 { font-size: 1.05rem; letter-spacing: -0.025em; }
    .guide-section p,
    .guide-section ul li {
        font-size: 0.95rem;
        line-height: 1.75;
        letter-spacing: -0.02em;
    }
    .scenario-card { padding: 12px 10px; }
}
@media (max-width: 350px) {
    .guide-section h2 { letter-spacing: -0.035em; font-size: 1.08rem; }
    .guide-section p,
    .guide-section ul li { letter-spacing: -0.025em; font-size: 0.92rem; }
}
