/* 청년 계산기 — 위: /military/styles.css 그대로(올리브·파랑 값만 변수로). 아래: 초록 변수 + 청년 전용 부품 */
/* ==========================================
   군인 계산기 공통 CSS
   - 네비게이션, 레이아웃, 폼, 버튼 등 공통 요소
   ========================================== */

@charset "UTF-8";

:root {
    --primary-color: #0d6efd;
    --primary-hover: #0b5ed7;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fb;
    --bg-tertiary: #f9fafb;
    --text-primary: #333333;
    --text-secondary: #6b7280;
    --text-tertiary: #4b5563;
    --border-primary: #e5e7eb;
    --border-secondary: #d1d5db;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
    --transition-fast: 150ms ease;
    --transition-base: 200ms ease;
    --transition-slow: 300ms ease;
    --global-nav-bg: #1e293b;
    --global-nav-text: #ffffff;
    
    /* 군인 테마 컬러 */
    --military-green: #4a5f4e;
    --military-gold: #fbbf24;
    --military-khaki: #8b7355;
    --tab-active-bg: #e8f5e9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    /* 모바일 터치 최적화 */
    touch-action: manipulation;
    overflow-x: hidden;
    -webkit-tap-highlight-color: transparent;
}

/* ==========================================
   브레드크럼
   ========================================== */
.breadcrumb {
    background: var(--bg-primary);
    padding: 0.4375rem 0;
    font-size: 0.6875rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-primary);
}

.breadcrumb-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-base);
}

.breadcrumb a:hover {
    color: var(--military-green);
}

.breadcrumb-separator {
    margin: 0 0.4375rem;
    color: var(--text-secondary);
}

/* ==========================================
   메인 타이틀 섹션
   ========================================== */
.main-title-section {
    background: var(--bg-primary);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-primary);
}

.main-title-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
}

.main-title {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0 0 0.875rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.625rem;
    line-height: 1.3;
}

.title-icon {
    font-size: 2rem;
    display: inline-block;
    animation: bounce 2s infinite;
}

.main-subtitle {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
    line-height: 1.5;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* ==========================================
   레이아웃
   ========================================== */
.main-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1.75rem;
    padding: 1.75rem 1.5rem;
}

.calculator-wrapper {
    width: 380px;
    flex-shrink: 0;
    position: sticky;
    top: 72px;
    max-height: calc(100vh - 90px);
}

.calculator-card {
    background: var(--bg-primary);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    height: calc(100vh - 90px);
    display: flex;
    flex-direction: column;
}

/* 계산기 헤더 */
.calculator-header.compact {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.625rem;
    border-bottom: 1px solid var(--border-primary);
}

.author-info {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
}

.author-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    overflow: hidden;
    background: var(--bg-tertiary);
    border: 2px solid var(--border-primary);
    flex-shrink: 0;
}

.avatar-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--military-green);
    color: white;
    font-weight: 700;
    font-size: 11px;
}

.author-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.update-badge {
    font-size: 0.6875rem;
    color: var(--text-secondary);
    background: var(--bg-tertiary);
    padding: 0.3125rem 0.625rem;
    border-radius: 16px;
    border: 1px solid var(--border-primary);
    font-weight: 500;
    white-space: nowrap;
}

.calculator-body {
    background: var(--bg-primary);
    padding: 0.875rem;
    overflow-y: auto;
    flex: 1;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

/* ==========================================
   탭 스타일 개선 (링크형)
   ========================================== */
.calculator-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    margin-bottom: 1.25rem;
    background: var(--bg-tertiary);
    padding: 4px;
    border-radius: 8px;
}

.tab-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.25rem;
    background: var(--bg-primary);
    border: none;
    border-radius: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-base);
    position: relative;
    gap: 3px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.tab-link:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.tab-link.active {
    background: var(--tab-active-bg);
    box-shadow: 0 2px 8px rgba(74, 95, 78, 0.15);
}

.tab-link.active .tab-text-top {
    color: var(--military-green);
    font-weight: 800;
}

.tab-link.active .tab-text-bottom {
    color: var(--military-green);
    font-weight: 600;
}

.tab-text-top {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
}

.tab-text-bottom {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.2;
}

/* ==========================================
   폼 스타일
   ========================================== */
.calculator-form {
    display: flex;
    flex-direction: column;
}

.form-row, .form-row-group {
    margin-bottom: 1rem;
}

.form-row-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
}

.form-col {
    display: flex;
    flex-direction: column;
}

label {
    display: block;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.4375rem;
    line-height: 1.3;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
    width: 100%;
    padding: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border-primary);
    border-radius: 5px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: border-color var(--transition-base);
    height: 40px;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
    background-size: 1.1em;
    padding-right: 2.25rem;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--military-green);
    box-shadow: 0 0 0 2px rgba(74, 95, 78, 0.2);
}

/* 날짜 입력 스타일 */
.date-input-wrapper {
    position: relative;
}

.date-input {
    font-family: monospace;
    letter-spacing: 1px;
}

/* 체크박스 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.8125rem;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

/* 에러 메시지 */
.error-message {
    color: var(--danger-color);
    font-size: 0.6875rem;
    margin-top: 0.1875rem;
    display: none;
    line-height: 1.3;
}

.error-message.show {
    display: block;
}

/* ==========================================
   버튼 스타일
   ========================================== */
.button-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    grid-template-areas:
        "share pdf"
        "share calculate";
    gap: 6px;
    margin-top: 1.25rem;
    height: 80px;
}

/* 계산 결과 후 3개 버튼 레이아웃 */
.button-grid.after-calculation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-areas: none;
    gap: 6px;
    height: auto;
}

.button-grid.after-calculation .btn {
    grid-area: unset;
}

/* 계산 결과 후 결과복사 버튼 - 올리브색 */
.after-calculation .copy-btn,
.after-calculation .pdf-btn {
    background: var(--military-green);  /* 진한 올리브색(국방색) */
    border-color: var(--primary-hover);
    color: white;
}

.after-calculation .copy-btn:hover,
.after-calculation .pdf-btn:hover {
    background: var(--primary-hover);
    border-color: #2a3f2e;
    color: white;
}

.btn {
    border: 1px solid var(--border-primary);
    border-radius: 5px;
    background: var(--bg-primary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8125rem;
    font-weight: 500;
    gap: 6px;
    padding: 0.625rem 0.875rem;
    min-height: 38px;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    line-height: 1.3;
}

.btn:hover {
    border-color: var(--border-secondary);
    background: var(--bg-tertiary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn svg {
    width: 14px;
    height: 14px;
}

.share-btn {
    grid-area: share;
    background: #fff7ed;
    border-color: #fed7aa;
    color: #ea580c;
}

.calculate-btn {
    grid-area: calculate;
    background: var(--military-green);
    color: #fff;
    border-color: var(--military-green);
    font-weight: 600;
}

.calculate-btn:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
}

.reset-btn,
.pdf-btn {
    grid-area: pdf;
    background: #fef3c7;
    border-color: #fde68a;
    color: #d97706;
}

.pdf-btn:hover,
.reset-btn:hover {
    background: #fde68a;
}

.copy-btn {
    background: var(--military-green) !important;  /* 진한 올리브색 */
    border-color: var(--primary-hover) !important;
    color: white !important;
}
.copy-btn:hover {
    background: var(--primary-hover) !important;  /* 호버시 더 진한색 */
    border-color: #2a3f2e !important;
}


/* ==========================================
   결과 표시
   ========================================== */
.result-container {
    margin-top: 0.875rem;
}

.result-card {
    background: var(--bg-tertiary);
    border-radius: 10px;
    padding: 0.875rem;
    border: 1px solid var(--border-primary);
    margin-bottom: 0.625rem;
}

.result-card h3 {
    font-size: 1rem;
    margin-bottom: 0.625rem;
    text-align: center;
    color: var(--text-primary);
    line-height: 1.3;
}

.result-total-top {
    background: linear-gradient(135deg, var(--military-green), var(--primary-hover));
    color: #fff;
    padding: 16px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 8px;
    position: relative;
}

.total-label {
    display: block;
    font-size: 0.8125rem;
    opacity: 0.9;
    margin-bottom: 6px;
    word-break: keep-all;
    line-height: 1.3;
}

.total-amount {
    display: block;
    font-size: 1.625rem;
    font-weight: 700;
    word-break: keep-all;
    line-height: 1.2;
}

.total-subtitle {
    display: block;
    font-size: 0.75rem;
    opacity: 0.85;
    margin-top: 6px;
    line-height: 1.3;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.4375rem 0;
    border-bottom: 1px solid var(--border-primary);
    word-break: keep-all;
    font-size: 0.8125rem;
}

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

.result-item.primary {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 10px 0;
}

.result-item.highlight {
    background: #e3f2fd;
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 0.9375rem;
    font-weight: 700;
    border: none;
    word-break: keep-all;
}

/* ==========================================
   정보 메시지
   ========================================== */
.info-message {
    background: #f0f9ff;
    border: 1px solid #0ea5e9;
    padding: 10px 12px;
    border-radius: 6px;
    margin: 10px 0;
    font-size: 0.8125rem;
    color: #0c4a6e;
    line-height: 1.4;
}

.info-message.warning {
    background: #fef3c7;
    border-color: #fbbf24;
    color: #d97706;
}

.info-message.success {
    background: #d1fae5;
    border-color: #10b981;
    color: #059669;
}

/* ==========================================
   차트 컨테이너
   ========================================== */
.chart-container {
    margin: 1.25rem 0;
    background: var(--bg-primary);
    border-radius: 6px;
    padding: 0.875rem;
    border: 1px solid var(--border-primary);
}

.chart-container h4 {
    font-size: 0.8125rem;
    color: var(--text-primary);
    margin-bottom: 0.875rem;
    text-align: center;
    line-height: 1.3;
}

.chart-wrapper {
    position: relative;
    height: 180px;
}

/* 막대 차트 스타일 */
.comparison-chart {
    margin-top: 15px;
}

.chart-item {
    margin-bottom: 15px;
}

.chart-label {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.chart-bar-wrapper {
    position: relative;
    background: var(--bg-tertiary);
    height: 30px;
    border-radius: 5px;
    overflow: hidden;
}

.chart-bar {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, var(--military-green), #5a7f5e);
    border-radius: 5px;
    transition: width 0.8s ease;
    display: flex;
    align-items: center;
    padding-left: 10px;
}

.chart-bar span {
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.chart-bar.current {
    background: linear-gradient(90deg, #0ea5e9, #0284c7);
}

/* ==========================================
   가이드 영역
   ========================================== */
.guide-wrapper {
    flex: 1;
    background: var(--bg-primary);
    border-radius: 14px;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    min-height: 360px;
    min-width: 0;
}

.guide-content > h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-primary);
    line-height: 1.3;
}

.guide-section {
    margin-bottom: 2.5rem;
}

.guide-section h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #1f2937;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e5e7eb;
    line-height: 1.4;
}

.guide-section h4 {
    font-size: 1.1rem;
    margin: 1.5rem 0 0.75rem;
    color: #374151;
    font-weight: 600;
    line-height: 1.4;
}

/* ==========================================
   Typography 시스템 (가독성 최적화)
   ========================================== */
.guide-section p {
    line-height: 1.8;
    margin-bottom: 1.25rem;
    color: #374151;
    word-break: keep-all;
    letter-spacing: -0.01em;
}

.guide-section ul,
.guide-section ol {
    margin: 1rem 0 1.5rem;
    padding-left: 1.25rem;
}

.guide-section li {
    line-height: 1.8;
    margin-bottom: 0.5rem;
    color: #374151;
    word-break: keep-all;
}

.guide-section strong {
    font-weight: 600;
    color: #1f2937;
}

/* 테이블 스타일 (가독성 개선) */
.table-wrapper {
    overflow-x: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.salary-table {
   width: 100%;
   border-collapse: collapse;
   margin: 0;
   font-size: 0.95rem;
}

.salary-table th {
   padding: 14px 16px;
   text-align: left;
   background: var(--military-green);
   color: white;
   font-weight: 600;
   white-space: nowrap;
}

.salary-table td {
   padding: 14px 16px;
   border-bottom: 1px solid #e5e7eb;
   color: #374151;
}

/* 표 줄무늬 */
.salary-table tbody tr:nth-child(even) {
   background: #f8fafc;
}

.salary-table tbody tr:hover {
   background: #f1f5f9;
}

/* 인라인 테이블도 동일 적용 */
.guide-section table {
   width: 100%;
   border-collapse: collapse;
   margin: 1.5rem 0;
   font-size: 0.95rem;
   border-radius: 8px;
   border: 1px solid #e5e7eb;
}

.guide-section table th {
   padding: 14px 16px;
   text-align: left;
   background: #f1f5f9;
   color: #1f2937;
   font-weight: 600;
   border-bottom: 2px solid #e5e7eb;
   white-space: nowrap;
}

.guide-section table td {
   padding: 12px 16px;
   border-bottom: 1px solid #e5e7eb;
   color: #374151;
   line-height: 1.6;
}

.guide-section table tbody tr:nth-child(even) {
   background: #f8fafc;
}

.guide-section table tbody tr:hover {
   background: #f1f5f9;
}

/* salary-table */
.salary-table {
   width: 100%;
   border-collapse: collapse;
   margin: 1.5rem 0;
   font-size: 0.95rem;
   border: 1px solid #e5e7eb;
   border-radius: 8px;
}

/* ==========================================
   공유 모달
   ========================================== */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.share-modal-content {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 0;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    animation: modalSlideIn 0.3s ease-out;
    border: 1px solid var(--border-primary);
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px) scale(0.95);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.share-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-primary);
}

.share-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.close-modal {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-secondary);
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all var(--transition-base);
    line-height: 1;
}

.close-modal:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
}

.share-button {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 0.75rem;
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    background: var(--bg-primary);
    font-size: 0.875rem;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-base);
    font-family: inherit;
    text-decoration: none;
    min-height: 80px;
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 공유 버튼 플랫폼별 색상 */
.share-button.kakao {
    border-color: #fee500;
    color: #3a1d1d;
    background: #fffbeb;
}

.share-button.facebook {
    border-color: #1877f2;
    color: #1877f2;
}

.share-button.twitter {
    border-color: #1DA1F2;
    color: #1DA1F2;
}

.share-button.blog {
    border-color: #03c75a;
    color: #03c75a;
}

.share-button.copy-link {
    grid-column: 1 / -1;
    flex-direction: row;
    border-color: var(--military-green);
    color: var(--military-green);
    background: rgba(74, 95, 78, 0.04);
    min-height: 50px;
}

/* 토스트 메시지 */
.toast-message {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 0.875rem;
    z-index: 2000;
    opacity: 0;
    transition: all 0.3s ease;
}

.toast-message.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* 툴팁 */
.tooltip {
    position: relative;
    display: inline-block;
    margin-left: 5px;
    cursor: help;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: #333;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 8px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    margin-left: -100px;
    font-size: 0.75rem;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* 복무 상태 표시 */
.service-status {
    background: var(--bg-tertiary);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.service-status.active {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #4caf50;
}

/* ==========================================
   반응형 디자인
   ========================================== */
@media (max-width: 768px) {
    body {
        font-size: 14px;
        line-height: 1.65;
    }

    .main-wrapper {
        flex-direction: column;
        padding: 0;
        gap: 0;
    }
    
    .calculator-wrapper {
        width: 100%;
        position: relative;
        top: 0;
        max-height: none;
        margin-bottom: 1.5rem;
    }
    
    .calculator-card {
        height: auto;
        border-radius: 0;
        box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    }

     .guide-wrapper h2,
    .guide-content > h2 {
        font-size: 18px;
        white-space: nomal;
        word-break: keep-all;  /* 한글 단어 단위 줄바꿈 추가 */
        line-height: 1.3;  /* 줄 간격 추가 */
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* 텍스트 가독성 개선 */
    .guide-section p,
    .guide-section li {
        word-break: keep-all;
        line-height: 1.7;
    }
   
    .guide-wrapper {
        border-radius: 0;
        padding: 1.25rem;
        margin-top: 0;
        border-top: 6px solid var(--bg-secondary);
    }

     table td, table th {
        padding: 10px 8px;
        font-size: 13px;
    }
   
    /* 모바일에서도 가로 배치 유지 */
    .form-row-group {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    
    .chart-wrapper {
        height: 140px;
    }
    
    .button-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas: 
            "share pdf"
            "calculate calculate";
        gap: 0.4375rem;
        margin-top: 1rem;
        height: auto;
    }
    
    .main-title {
        font-size: 1.5rem;
        flex-direction: row;
        gap: 0.4375rem;
    }
    
    .title-icon {
        font-size: 1.375rem;
    }
    
    .total-amount {
        font-size: 1.375rem;
    }
    
    .tab-text-top {
        font-size: 0.875rem;
    }
    
    .tab-text-bottom {
        font-size: 0.6875rem;
    }
    
    /* 탭 스타일 모바일 조정 */
    .calculator-tabs {
        gap: 2px;
        padding: 2px;
    }
    
    .tab-link {
        padding: 0.625rem 0.125rem;
    }
}
/* ==========================================
   푸터 (Footer)
   ========================================== */
.footer {
    background: var(--bg-secondary, #f8fafc);
    border-top: 1px solid var(--border-primary, #e2e8f0);
    padding: 2rem 1rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-container {
    max-width: 900px;
    margin: 0 auto;
}

.footer-brand {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin-bottom: 0.5rem;
}

.footer-info {
    font-size: 0.9rem;
    color: var(--text-secondary, #64748b);
    margin-bottom: 0.5rem;
}

.footer-contact a {
    color: var(--primary-color, #3b82f6);
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-contact a:hover {
    text-decoration: underline;
}

.footer-copy {
    font-size: 0.85rem;
    color: var(--text-tertiary, #94a3b8);
    margin-top: 1rem;
}

@media (max-width: 480px) {
    /* 기본 typography */
    body {
        font-size: 15px;
        line-height: 1.7;
    }
    
    /* 메인 타이틀 */
    .main-title-section h1,
    .calculator-header h1 {
        font-size: 1.5rem;
    }
    
    /* 가이드 영역 */
    .guide-wrapper {
        padding: 1rem;
    }
    
    .guide-content > h2 {
        font-size: 1.35rem;
        margin-bottom: 1rem;
    }
    
    .guide-section {
        margin-bottom: 2rem;
    }
    
    .guide-section h3 {
        font-size: 1.15rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }
    
    .guide-section h4 {
        font-size: 1rem;
        margin: 1.25rem 0 0.5rem;
    }
    
    .guide-section p {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 1rem;
    }
    
    .guide-section li {
        font-size: 0.95rem;
        line-height: 1.75;
        margin-bottom: 0.4rem;
    }
    
    /* 테이블 모바일 최적화 - 가로스크롤 */

    .salary-table,
    .guide-section table {
        font-size: 0.85rem;
        min-width: 320px;
    }
    
    .salary-table th,
    .salary-table td,
    .guide-section table th,
    .guide-section table td {
        padding: 10px 12px;
        white-space: nowrap;
    }
    
    /* 계산기 영역 */
    .calculator-body {
        padding: 0.75rem;
    }
    
    .calculator-header {
        padding: 0.5rem 0.75rem;
    }
    
    /* 결과 영역 */
    .result-total-top {
        padding: 1rem;
    }
    
    .total-amount {
        font-size: 1.75rem;
    }
    
    /* 푸터 */
    .footer {
        padding: 1.5rem 1rem;
    }
    
    .footer-brand {
        font-size: 1rem;
    }
    
    .footer-info,
    .footer-contact a {
        font-size: 0.85rem;
    }
}

/* W42-01 S-01: cluster blog link block (approved link-block design) */
.cluster-links { background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 16px 18px; margin: 16px 0 8px; }
.cluster-links h3 { margin: 0 0 12px; color: #1d4ed8; font-size: 0.95rem; line-height: 1.4; }
.cluster-links a { display: block; padding: 11px 12px; margin-bottom: 8px; background: #f8fafc; border-radius: 8px; text-decoration: none; color: #1e3a8a; font-weight: 600; font-size: 0.9em; line-height: 1.45; }
.cluster-links a:last-child { margin-bottom: 0; }
.cluster-links a:hover { background: #eff6ff; }
.cluster-links a small { display: block; color: #666; font-weight: 400; font-size: 13px; margin-top: 2px; line-height: 1.5; }
@media (max-width: 768px) {
  .cluster-links { padding: 14px 14px; margin: 14px 0 6px; }
  .cluster-links a { padding: 11px 12px; font-size: 15px; }
}

/* ===== 청년: 초록 변수 덮어쓰기 ===== */
:root{--primary-color:#047857;--primary-hover:#065f46;--military-green:#047857;--tab-active-bg:#ecfdf5;--primary-soft:#ecfdf5}
.error-message:not(:empty){display:block}
/* 청년 전용 부품 — 크기는 군인 입력칸(40px·0.875rem·5px)에 맞춤 */
.input-unit{position:relative}
.input-unit input{padding-right:2.75rem}
.unit{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);color:var(--text-secondary);font-size:.875rem}
.chips{display:flex;gap:6px;margin-top:6px;flex-wrap:wrap}.chips-top{margin:0 0 6px}
.chip{min-height:38px;padding:0 .7rem;border:1px solid var(--border-primary);border-radius:5px;background:var(--bg-primary);font-size:.8125rem;color:var(--text-primary);cursor:pointer;font-family:inherit}
.seg{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}
.seg label{display:flex;align-items:center;justify-content:center;height:40px;border:1px solid var(--border-primary);border-radius:5px;font-size:.875rem;font-weight:400;margin:0;text-align:center;line-height:1.25;cursor:pointer;padding:0 .25rem;word-break:keep-all;position:relative}
.seg input{position:absolute;opacity:0;width:1px;height:1px}
.seg input:checked+span{color:var(--primary-color);font-weight:600}
.seg label:has(input:checked){border-color:var(--primary-color);background:var(--tab-active-bg)}
.seg input:focus-visible+span{outline:2px solid var(--primary-color);outline-offset:2px}
details.optional-fields{border:1px solid var(--border-primary);border-radius:5px;margin:.75rem 0 0}
details.optional-fields>summary{height:40px;display:flex;align-items:center;padding:0 .625rem;cursor:pointer;font-size:.8125rem;font-weight:600;list-style:none}
details.optional-fields>summary::-webkit-details-marker{display:none}
details.optional-fields>summary::after{content:"+";margin-left:auto}
details.optional-fields[open]>summary::after{content:"−"}
.opt-body{padding:0 .625rem .625rem}
.opt-note{font-size:.75rem;color:var(--text-secondary);margin:.5rem 0 0}
.btn-sub{min-height:38px;width:100%;margin-top:.5rem}
.share-msg{font-size:.75rem;color:var(--primary-color);margin-top:.25rem}
.share-msg:empty{display:none}
.yf-table td{text-align:right;font-weight:600}
.yf-est{display:inline-block;font-size:.75rem;font-weight:700;color:#92400e;background:#fef3c7;border-radius:4px;padding:0 4px}
.yf-compare{margin:.75rem 0;font-size:.875rem}.yf-compare p{margin:.25rem 0}
.yf-basis,.yf-warn,.yf-asof{font-size:.75rem;color:var(--text-secondary);margin:.4rem 0}
.yf-warn{color:#92400e}
.cmp-table td,.cmp-table th{text-align:right}.cmp-table td:first-child,.cmp-table th:first-child{text-align:left}
.win{color:var(--primary-color);font-weight:700}
.calculator-form select{display:block}
/* ===== 모바일 규칙 크기(TEMPLATE): 입력·버튼·breadcrumb만. 나머지는 /military/salary/ 그대로 ===== */
.calculator-form input[type=text],.calculator-form input[type=number],.calculator-form select{font-size:16px;height:48px;min-height:48px}
.unit{font-size:.9375rem}
.seg label{height:48px;min-height:48px}
.chip{min-height:44px;min-width:44px}
details.optional-fields{margin:0 0 .25rem}
details.optional-fields>summary{height:48px;min-height:48px;font-size:.9375rem}
.button-grid{height:auto;grid-template-rows:auto auto}
.button-grid .share-btn,.button-grid .reset-btn{min-height:48px;height:48px}
.button-grid .calculate-btn{min-height:52px;height:52px}
.breadcrumb,.breadcrumb-container,.breadcrumb a,.breadcrumb span{font-size:12px}
/* ===== check_mobile 맞춤: 계산 버튼 먼저(입력 바로 아래)·닫힌 선택칸은 숨김·헤더 글자 12px·900 이하 sticky 끔 ===== */
.button-grid{grid-template-areas:"calculate calculate" "share pdf";margin-top:.75rem}
details.optional-fields>.opt-body{display:none}
details.optional-fields[open]>.opt-body{display:block}
.btn-sub{min-height:44px}
.calculator-header .update-badge{font-size:12px}
@media (max-width:900px){.calculator-wrapper{position:static}}
/* 키보드 여백(≤120px)·12px 하한 */
.calculator-form .form-row:has(+details.optional-fields),.calculator-form .form-row-group:has(+details.optional-fields){margin-bottom:.5rem}
details.optional-fields{margin:0}
.button-grid{margin-top:.5rem}
.tab-text-bottom{font-size:12px}

/* 가이드 표 모바일(≤390px): 가로 넘침 없이 줄바꿈 (2026-10-17) */
@media (max-width: 390px) {
    .guide-section .table-container { overflow-x: visible; padding: 0; }
    .guide-section .salary-table,
    .guide-section table {
        min-width: 0; width: 100%; margin: 0; table-layout: auto;
        font-size: 12px;
    }
    .guide-section .salary-table th,
    .guide-section .salary-table td,
    .guide-section table th,
    .guide-section table td {
        white-space: normal; word-break: keep-all; overflow-wrap: normal;
        padding: 8px 5px; font-size: 12px; line-height: 1.45;
    }
}

/* 공식 출처 캡처 (2026-10-17) */
.src-figure { margin: 1.25rem 0; max-width: 100%; }
.src-figure img { display: block; width: 100%; max-width: 900px; height: auto; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; }
.src-figure figcaption { margin-top: 6px; font-size: 12px; line-height: 1.5; color: #64748b; word-break: keep-all; }
