/* 되받쓰 활용법(howtosue) — 공통 스타일 골격
   Yuja EDU 디자인 토큰(DESIGN.md)을 그대로 계승한다. rules/style.css와 동일 팔레트. */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

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

/* display 를 지정한 요소(.cta-link 등)에서도 hidden 속성이 확실히 먹도록 */
[hidden] { display: none !important; }

:root {
    --forest:    #142814;
    --forest-mid:#1E3D1E;
    --leaf:      #4CAA48;
    --leaf-deep: #2D7A29;
    --lemon:     #FFE135;
    --amber:     #F5C800;
    --trap-red:  #E53935;
    --safe-teal: #0F7B5C;
    --card-bg:   #FFFFFF;
    --page-bg:   #F7F6F3;
    --ink:       #1A1A1A;
    --charcoal:  #4B4945;
    --slate:     #6F6E69;
    --hairline:  #E8E7E4;
    --hairline-strong: #D3D1CB;
    --surface:   #F1F0EE;
    --leaf-tint: #E8F5E7;
    --r: 16px;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.01em;
    background-color: var(--page-bg);
    color: var(--ink);
    padding-top: 60px; /* 메인 헤더 높이 */
}
/* 데스크톱: 상단 고정 2단바(60+48). 모바일은 nav-mobile.css 가 하단으로 내리고 상단 여백 0. */
@media screen and (min-width: 769px) {
    body[data-nav="dual"] { padding-top: 108px; }
}

/* ── Header / Nav (site-wide 톤 재사용) ── */
.header-fixed {
    position: fixed; top: 0; left: 0; right: 0; z-index: 50;
    background-color: var(--forest);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
    height: 60px;
    display: flex; align-items: center; justify-content: center;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    display: flex; align-items: center; justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}
.nav-link:hover { background-color: rgba(255,255,255,0.10); color: #fff; }
.nav-link.active { color: var(--lemon); font-weight: 700; }
.nav-link svg { stroke: #fff; }

.nav-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.25); border-radius: 9999px; }

@media screen and (max-width: 560px) {
    .nav-link { padding: 8px 10px; font-size: 0.85rem; }
}

/* ── 섹션 서브네비 (활용법/가정통신문/지도서) ── */
.sub-header-fixed {
    position: fixed; top: 60px; left: 0; right: 0; z-index: 49;
    background-color: var(--forest-mid);
    height: 48px;
    display: flex; align-items: center; justify-content: center;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}
.sub-header-fixed .nav-container { gap: 8px; }
.subnav-link {
    padding: 6px 18px;
    border-radius: 9999px;
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.72);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: all 0.2s;
}
.subnav-link:hover { background: rgba(255,255,255,0.10); color: #fff; }
.subnav-link.active { background: var(--amber); color: var(--ink); box-shadow: 0 2px 8px rgba(245,200,0,0.35); }

/* ── 3차 메뉴바: 교사 전용 자료 바로가기 ── */
.teacher-subnav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 12px;
    background: var(--forest);
    border-radius: 12px;
    margin-bottom: 18px;
}
.t-nav-btn {
    flex: 1 1 auto;
    text-align: center;
    padding: 9px 14px;
    border-radius: 9999px;
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255,255,255,0.10);
    border: 1px solid rgba(255,255,255,0.18);
    text-decoration: none;
    transition: all 0.15s;
    white-space: nowrap;
}
.t-nav-btn:hover { background: var(--amber); color: var(--ink); border-color: var(--amber); }

/* ── Page shell ── */
.page-wrap {
    max-width: 880px;
    margin: 0 auto;
    padding: 32px 20px 64px;
}

/* ── Hero ── */
.hero {
    text-align: center;
    margin-bottom: 40px;
}
.hero h1 {
    font-size: clamp(1.7rem, 6vw, 2.3rem);
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
}
.hero p {
    color: var(--slate);
    font-size: 1rem;
    font-weight: 500;
}

/* ── Section heading ── */
.section-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--ink);
    margin: 56px 0 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title:first-of-type { margin-top: 0; }

/* ── Intro cards (섹션 1) ── */
.intro-card {
    border-radius: var(--r);
    padding: 24px 26px;
    margin-bottom: 16px;
    line-height: 1.75;
    font-size: 0.98rem;
    color: var(--charcoal);
}
.intro-card.card-cream { background: #FAF9F7; }
.intro-card.card-mint  { background: #E8F5E7; }
.intro-card h3 {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 10px;
}
.intro-card p { margin-bottom: 10px; }
.intro-card p:last-child { margin-bottom: 0; }
.intro-card .quote-strong {
    display: block;
    font-weight: 700;
    font-size: 1.02rem;
    color: var(--ink);
    border-left: 4px solid var(--leaf-deep);
    padding: 4px 0 4px 14px;
    margin: 12px 0;
}
.trap-mark {
    color: var(--trap-red);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── 5단계 표 (섹션 2) ── */
.data-table-wrap {
    overflow-x: auto;
    border-radius: var(--r);
    border: 1px solid var(--hairline);
    background: var(--card-bg);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 520px;
    font-size: 0.92rem;
}
.data-table th, .data-table td {
    padding: 12px 14px;
    text-align: left;
    border-bottom: 1px solid var(--hairline);
}
.data-table thead th {
    background: var(--forest);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
}
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #F8FAF7; }
.stage-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px;
    border-radius: 50%;
    background: var(--leaf);
    color: #fff;
    font-weight: 800;
    font-size: 0.85rem;
}
.stage-func {
    display: inline-block;
    background: var(--leaf-deep);
    color: #fff;
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.78rem;
    font-weight: 700;
}

/* ── 인터랙티브 데모 카드 (섹션 2) ── */
.demo-card {
    background: var(--forest);
    border-radius: var(--r);
    padding: 28px 24px;
    margin-bottom: 40px;
    color: #fff;
}
.demo-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}
.demo-step:last-child { margin-bottom: 0; }
.demo-step-num {
    flex-shrink: 0;
    width: 28px; height: 28px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
    font-size: 0.9rem;
}
.demo-audio-btn {
    font-family: inherit;
    border: none;
    border-radius: 9999px;
    padding: 10px 20px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}
.demo-audio-btn:active { transform: scale(0.95); }
.demo-audio-btn.play { background: var(--amber); color: var(--ink); }
.demo-audio-btn.play:hover { background: var(--lemon); }
.demo-audio-btn.slow {
    background: transparent;
    border: 1.5px solid rgba(255,255,255,0.5);
    color: #fff;
}
.demo-audio-btn.slow.active { background: var(--leaf); border-color: var(--leaf); }
.demo-action-btn {
    font-family: inherit;
    border: none;
    border-radius: 9999px;
    padding: 8px 18px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    background: rgba(255,255,255,0.15);
    color: #fff;
    transition: background-color 0.15s, transform 0.15s;
}
.demo-action-btn:hover:not(:disabled) { background: rgba(255,255,255,0.28); }
.demo-action-btn:active:not(:disabled) { transform: scale(0.95); }
.demo-action-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.demo-word-row {
    display: flex;
    justify-content: center;
    gap: 14px;
    margin: 14px 0;
}
.demo-syl {
    font-size: 2rem;
    font-weight: 800;
    font-family: "Noto Serif KR", "Malgun Gothic", serif;
    padding: 6px 4px;
    border-bottom: 4px solid transparent;
    transition: transform 0.4s ease, border-color 0.3s ease;
    transform-style: preserve-3d;
}
.demo-syl.trap { border-color: var(--trap-red); color: #FFD9D7; }
.demo-syl.flipped { transform: rotateX(360deg); }

.demo-result {
    display: none;
    text-align: center;
    background: rgba(255,255,255,0.08);
    border-radius: 12px;
    padding: 14px 16px;
    margin-top: 14px;
    font-size: 0.92rem;
    line-height: 1.7;
}
.demo-result.show { display: block; }
.demo-result a {
    color: var(--lemon);
    font-weight: 700;
    text-decoration: none;
}
.demo-result a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
    .demo-syl { transition: none; }
}

/* ── 역할 선택기 (섹션 3) ── */
/* ── 역할 선택 게이트 (첫 화면, 스크롤 없이 화면에 자동 맞춤) ── */
#role-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: clamp(10px, 2.5vh, 26px);
    min-height: calc(100dvh - 124px);
    padding: clamp(8px, 2vh, 24px) 0;
    text-align: center;
}
.gate-title { font-size: clamp(1.3rem, 5.5vw, 2rem); font-weight: 800; color: var(--ink); }
.gate-sub { font-size: clamp(0.85rem, 3.4vw, 1rem); color: var(--slate); line-height: 1.6; }

/* 게이트 활성 시: 첫 화면이 스크롤 없이 딱 맞도록 페이지 패딩 제거 */
body.gate-active .page-wrap { padding: 0; }

.role-picker {
    display: flex;
    flex-direction: column;
    gap: clamp(10px, 2vh, 16px);
    width: min(420px, 92vw);
}
.role-btn {
    display: flex;
    flex-direction: row;      /* 아이콘 좌 · 텍스트 우 */
    align-items: center;
    gap: clamp(12px, 3.5vw, 18px);
    padding: clamp(12px, 2.4vh, 20px) clamp(16px, 5vw, 26px);
    border-radius: var(--r);
    border: 1.5px solid var(--hairline);
    background: var(--card-bg);
    cursor: pointer;
    font-family: inherit;
    box-shadow: rgba(15,15,15,0.04) 0px 2px 8px;
    transition: transform 0.18s cubic-bezier(0.34,1.56,0.64,1), border-color 0.2s, box-shadow 0.2s;
}
.role-btn:hover {
    transform: translateY(-2px);
    border-color: var(--leaf);
    box-shadow: rgba(15,15,15,0.10) 0px 8px 20px;
}
.role-btn .role-icon { font-size: clamp(1.6rem, 6vw, 2.1rem); line-height: 1; flex-shrink: 0; }
.role-btn .role-label { font-weight: 800; font-size: clamp(1rem, 4vw, 1.15rem); color: var(--ink); }

/* 화면이 낮을 때(가로 모드 등): 역할 버튼을 가로 3열로 눕혀 세로 높이를 줄인다 */
@media (max-height: 520px) {
    #role-gate { gap: clamp(6px, 2vh, 12px); min-height: calc(100dvh - 118px); }
    .gate-title { font-size: 1.2rem; }
    .gate-sub { font-size: 0.85rem; }
    .role-picker { flex-direction: row; width: min(700px, 96vw); }
    .role-btn { flex: 1; padding: 10px 12px; }
    .role-btn .role-icon { font-size: 1.6rem; }
    .role-btn .role-label { font-size: 0.95rem; }
}

.role-picker.collapsed { display: none; }

.role-picked-bar {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: var(--slate);
}
.role-picked-bar.show { display: flex; }
.role-picked-bar button {
    font-family: inherit;
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 9999px;
    padding: 4px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--leaf-deep);
    cursor: pointer;
}
.role-picked-bar button:hover { background: var(--leaf-tint, #E8F5E7); }

.tab-panel[hidden] { display: none; }

/* ── 콘텐츠 카드 (역할별 탭 공통) ── */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    padding: 20px 22px;
    margin-bottom: 14px;
}
.content-card h4 {
    font-size: 1.02rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.content-card p {
    color: var(--charcoal);
    line-height: 1.7;
    font-size: 0.95rem;
}
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 10px;
    padding: 7px 16px;
    border-radius: 9999px;
    background: var(--leaf);
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    text-decoration: none;
    transition: background-color 0.15s;
}
.cta-link:hover { background: var(--leaf-deep); }

/* ── 학생 탭: 오늘의 학습 체크리스트 ── */
.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    padding: 16px 20px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background-color 0.2s, border-color 0.2s;
}
.checklist-item:hover { border-color: var(--leaf); }
.checklist-item.done {
    background: var(--leaf-tint, #E8F5E7);
    border-color: var(--leaf);
}
.checklist-item .check-box {
    flex-shrink: 0;
    width: 26px; height: 26px;
    border-radius: 50%;
    border: 2px solid var(--hairline-strong, #D3D1CB);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem;
    transition: transform 0.25s cubic-bezier(0.34,1.56,0.64,1), background-color 0.2s, border-color 0.2s;
}
.checklist-item.done .check-box {
    background: var(--leaf);
    border-color: var(--leaf);
    color: #fff;
    transform: scale(1.1);
}
.checklist-item .check-title { font-weight: 700; color: var(--ink); margin-bottom: 2px; }
.checklist-item .check-body { font-size: 0.88rem; color: var(--slate); line-height: 1.55; }
.checklist-item .check-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 2px;
}
.checklist-item .check-title-row .check-title { margin-bottom: 0; }
.checklist-item .check-cta { margin-top: 0; flex-shrink: 0; white-space: nowrap; }

.checklist-progress-wrap {
    background: var(--hairline);
    border-radius: 9999px;
    height: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}
.checklist-progress-fill {
    height: 100%;
    background: var(--leaf);
    border-radius: 9999px;
    width: 0%;
    transition: width 0.3s ease;
}
.checklist-complete-banner {
    display: none;
    background: var(--forest);
    color: #fff;
    border-radius: var(--r);
    padding: 18px 20px;
    text-align: center;
    font-weight: 700;
    margin-bottom: 16px;
}
.checklist-complete-banner.show { display: block; }
.checklist-complete-banner .cta-link { background: var(--amber); color: var(--ink); }
.checklist-complete-banner .cta-link:hover { background: var(--lemon); }

/* ── 경고/하지말것 카드 ── */
.warn-card {
    background: #FDECEA;
    border: 1px solid #F5C6C2;
    border-radius: var(--r);
    padding: 20px 22px;
    margin-bottom: 14px;
}
.warn-card h4 { color: var(--trap-red); font-weight: 800; margin-bottom: 8px; }
.warn-card ul { list-style: none; color: var(--charcoal); font-size: 0.92rem; line-height: 1.9; }

/* ── 아코디언 (details/summary 네이티브) ── */
.accordion-item {
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    margin-bottom: 10px;
    overflow: hidden;
}
.accordion-item summary {
    padding: 16px 20px;
    font-weight: 700;
    color: var(--ink);
    cursor: pointer;
    list-style: none;
}
.accordion-item summary::-webkit-details-marker { display: none; }
.accordion-item summary::before {
    content: '▸';
    display: inline-block;
    margin-right: 8px;
    color: var(--leaf);
    transition: transform 0.2s;
}
.accordion-item[open] summary::before { transform: rotate(90deg); }
.accordion-item .accordion-body {
    padding: 0 20px 18px;
    color: var(--charcoal);
    font-size: 0.92rem;
    line-height: 1.8;
    white-space: pre-line;
}

/* ── 진단표 (섹션 4) ── */
.diag-table { min-width: 0; } /* 5단계/비교표와 달리 좁아도 되므로 강제 min-width 해제 */
.diag-goto-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 5px 12px;
    border-radius: 9999px;
    background: var(--leaf);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s;
}
.diag-goto-btn:hover { background: var(--leaf-deep); }

/* ── 다음 할 일 CTA (섹션 6) ── */
.next-cta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 32px;
}
.next-cta-row .cta-link { margin-top: 0; background: var(--forest); }
.next-cta-row .cta-link:hover { background: var(--forest-mid); }

/* ── 인쇄 요약본 / 공유 버튼 행 ── */
.print-share-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 8px;
}

/* 화면에서는 숨기고, 인쇄 요약 모드에서만 보이는 라벨 */
.print-only-label { display: none; }

/* ── 인쇄: 3개 탭 모두 펼침 (기본 전체 인쇄) ── */
@media print {
    .role-picker, .role-picked-bar, .print-share-row { display: none !important; }
    .tab-panel[hidden] { display: block !important; }
    .header-fixed, .site-footer { display: none !important; }
    body { padding-top: 0; }
}

/* ── 인쇄: 학부모용 안내 1장 요약 모드 (print-summary-btn으로 진입) ── */
@media print {
    body.print-summary .hero,
    body.print-summary #demo-card,
    body.print-summary #panel-student,
    body.print-summary #panel-teacher,
    body.print-summary #section-diag,
    body.print-summary #section-faq,
    body.print-summary #section-next {
        display: none !important;
    }
    body.print-summary #panel-parent { display: block !important; }
    body.print-summary #panel-parent > .content-card { display: none !important; }
    body.print-summary .print-only-label { display: flex !important; margin-top: 28px; }
}

/* ══════════════════════════════════════
   가정통신문 생성기 (letter.html)
══════════════════════════════════════ */

/* ── 입력 폼 ── */
.letter-form {
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: var(--r);
    padding: 22px 24px;
    margin-bottom: 24px;
}
.letter-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 14px 16px;
    margin-bottom: 14px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field label { font-size: 0.8rem; font-weight: 700; color: var(--charcoal); }
.form-field input[type="text"],
.form-field input[type="number"],
.form-field input[type="date"],
.form-field select {
    font-family: inherit;
    font-size: 0.92rem;
    padding: 9px 12px;
    border: 1px solid var(--hairline-strong);
    border-radius: 8px;
    background: var(--card-bg);
    color: var(--ink);
}
.form-field input:focus, .form-field select:focus {
    outline: none;
    border-color: var(--leaf);
}
.level-range-field { display: flex; align-items: center; gap: 8px; }
.level-range-field select { flex: 1; }
.form-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--charcoal);
    font-weight: 600;
}
.form-checkbox-row input { width: 18px; height: 18px; accent-color: var(--leaf); }

.letter-form .letter-actions {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--hairline);
}

/* ── A4 미리보기 ── */
.a4-container-outer {
    display: flex;
    justify-content: center;
    padding: 12px 0 24px;
    overflow: hidden;
}
#a4-scale-wrapper {
    transform-origin: top center;
    transition: transform 0.15s;
    flex-shrink: 0;
}
#a4-preview {
    width: 794px;
    min-width: 794px;
    height: 1123px;
    background: #ffffff;
    box-shadow: 0 4px 25px rgba(0,0,0,0.12);
    border: 1px solid var(--hairline);
    padding: 40px 46px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    color: #1A1A1A;
    cursor: zoom-in;
    transition: box-shadow 0.2s;
    font-family: "Pretendard Variable", Pretendard, sans-serif;
}
#a4-preview:hover { box-shadow: 0 8px 40px rgba(20,40,20,0.18); }

.letter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid #1A1A1A;
    padding-bottom: 11px;
    margin-bottom: 11px;
}
.letter-logo { height: 62px; width: auto; flex-shrink: 0; object-fit: contain; }
.letter-header-text { flex: 1; min-width: 0; }
.letter-school { font-size: 12.5px; font-weight: 700; color: #4B4945; }
.letter-title { font-size: 26px; font-weight: 900; letter-spacing: 0.02em; margin: 3px 0; display: flex; align-items: center; gap: 9px; }
.letter-title-sub {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: var(--leaf);
    padding: 3px 10px;
    border-radius: 999px;
    letter-spacing: -0.01em;
}
.letter-meta { font-size: 12px; color: #6F6E69; font-weight: 600; }
#qr-code-box {
    width: 68px; height: 68px;
    border: 1px dashed #9CA3AF;
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    background: #F9FAFB;
    flex-shrink: 0;
    overflow: hidden;
}
#qr-code-box img { width: 100%; height: 100%; object-fit: contain; }
#qr-code-box span { font-size: 10px; color: #9CA3AF; font-weight: 700; }

.letter-strap {
    background: linear-gradient(135deg, var(--forest), var(--forest-mid));
    color: #fff;
    font-weight: 800;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 8px;
    margin-bottom: 14px;
}

.letter-body { flex: 1; font-size: 12.5px; line-height: 1.62; }
.letter-salute { font-weight: 700; margin-bottom: 5px; }
.letter-body > p { margin-bottom: 9px; }
.letter-quote {
    border-left: 3px solid var(--leaf-deep);
    background: var(--leaf-tint, #E8F5E7);
    padding: 8px 14px;
    font-weight: 700;
    font-size: 12.5px;
    color: var(--ink);
    border-radius: 0 6px 6px 0;
    margin-bottom: 10px;
}
.letter-why {
    background: #FAFAF3;
    border: 1.5px solid var(--leaf);
    border-radius: 10px;
    padding: 11px 15px 2px;
}
.letter-why h4 { color: var(--leaf-deep); }
.letter-why p { margin-bottom: 8px; }
.letter-why .letter-quote {
    border-left: none;
    background: #fff;
    box-shadow: inset 0 0 0 1px var(--hairline);
    text-align: center;
    font-size: 13px;
    padding: 8px 14px;
}
.letter-highlight-box {
    background: var(--leaf-tint, #E8F5E7);
    border-radius: 8px;
    padding: 9px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1A1A1A;
    margin-bottom: 13px;
}
.letter-section { margin-bottom: 11px; }
.letter-section h4 { font-size: 13px; font-weight: 800; margin-bottom: 6px; }
.letter-section ol { padding-left: 19px; margin-bottom: 7px; }
.letter-section li { margin-bottom: 3px; }
.letter-note {
    background: #FEFCE8;
    border-left: 3px solid var(--amber);
    padding: 7px 11px;
    font-size: 11.5px;
    color: #4B4945;
    border-radius: 0 6px 6px 0;
}

/* ── 5단계 학습법 스트립 ── */
.step-strip {
    display: flex;
    align-items: center;
    gap: 4px;
}
.step-chip {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: var(--leaf-tint, #E8F5E7);
    border-radius: 8px;
    padding: 8px 5px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink);
    white-space: nowrap;
    text-align: center;
}
.step-chip.highlight { background: var(--leaf); color: #fff; }
.step-num {
    display: inline-flex; align-items: center; justify-content: center;
    width: 17px; height: 17px;
    border-radius: 50%;
    background: var(--leaf);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
    flex-shrink: 0;
}
.step-chip.highlight .step-num { background: #fff; color: var(--leaf-deep); }
.step-arrow { color: var(--slate); font-size: 12px; flex-shrink: 0; }

/* ── 이렇게 말해 주세요 표 ── */
.talk-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.talk-table tr:not(:last-child) td { border-bottom: 1px dashed var(--hairline); }
.talk-table td { padding: 6px 4px; }
.talk-no { color: #B91C1C; text-decoration: line-through; opacity: 0.85; white-space: nowrap; }
.talk-arrow { color: var(--slate); text-align: center; width: 24px; }
.talk-yes { color: var(--leaf-deep); font-weight: 700; }

.letter-meta-row {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    font-size: 12px;
    color: var(--charcoal);
}
.letter-meta-row strong { color: var(--ink); margin-right: 4px; }

/* ── 혜택 3카드 ── */
.benefit-row { display: flex; gap: 10px; }
.benefit-item {
    flex: 1;
    text-align: center;
    background: var(--card-bg);
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 10px 6px;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.4;
}
.benefit-icon { display: block; font-size: 20px; margin-bottom: 4px; }

.letter-footer {
    text-align: right;
    font-weight: 700;
    font-size: 13px;
    border-top: 1px solid var(--hairline);
    padding-top: 12px;
    margin-top: auto;
}

/* ── 액션 바 ── */
.letter-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
}
.btn-action {
    font-family: inherit;
    display: flex; align-items: center; gap: 6px;
    padding: 12px 22px;
    border-radius: 9999px;
    border: none;
    font-weight: 700;
    font-size: 0.92rem;
    cursor: pointer;
    transition: transform 0.15s, background-color 0.15s;
}
.btn-action:active { transform: scale(0.95); }
.btn-action.primary { background: var(--amber); color: var(--ink); }
.btn-action.primary:hover { background: var(--lemon); }
.btn-action.secondary { background: var(--card-bg); color: var(--ink); border: 1px solid var(--hairline-strong); }
.btn-action.secondary:hover { background: var(--surface); }

/* 모바일: A4 폭에 맞춰 자동 축소 */
@media screen and (max-width: 860px) {
    .a4-container-outer {
        height: calc(1123px * var(--a4-scale, 1) + 24px);
    }
    #a4-scale-wrapper { transform: scale(var(--a4-scale, 1)); }
}

/* ── 확대 모달 ── */
#letter-preview-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
#letter-preview-modal.open { display: flex; }
#letter-modal-scale-wrapper { transform-origin: center; }
#letter-modal-close {
    position: fixed; top: 16px; right: 16px;
    width: 40px; height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
}

/* ── 인쇄 ── */
@media print {
    @page { size: A4 portrait; margin: 0mm !important; }
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
    body { padding: 0 !important; background: #fff !important; }
    .header-fixed, .site-footer, .no-print, #letter-preview-modal { display: none !important; }
    .a4-container-outer { padding: 0 !important; overflow: visible !important; height: auto !important; }
    #a4-scale-wrapper { transform: none !important; }
    #a4-preview {
        border: none !important;
        box-shadow: none !important;
        margin: 0 !important;
        position: absolute;
        top: 0; left: 0;
    }
}

/* ── Footer (site-wide 톤 재사용) ── */
.site-footer {
    background: var(--forest);
    padding: 24px;
    text-align: center;
    margin-top: 40px;
}
.site-footer p {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
}
