/* 모든 요소의 너비 계산에 테두리와 패딩을 포함시킵니다 */
*, *::before, *::after {
    box-sizing: border-box;
}
/* [1] 기출판다 브랜드 테마 컬러 설정 */
:root { 
    --main: #2D3748;    /* 판다 차콜 블랙 */
    --bg: #F3F4F6; 
    --dark: #1F2937; 
    --success: #059669; /* 대나무 그린 */
    --accent: #10B981;  /* 보조 그린 */
}

body { margin: 0; font-family: 'Pretendard', sans-serif; background: var(--bg); overflow: hidden; }

/* [2] 메뉴(서비스 선택) 화면 스타일 */
#menu-screen {
    position: fixed; inset: 0; background: var(--bg);
    display: flex; align-items: center; justify-content: center; z-index: 150;
    overflow-y: auto; padding: 20px;
    /* 모바일 안전 영역 대응 */
    padding-top: calc(20px + env(safe-area-inset-top)); 
}
.menu-container { 
    text-align: center; 
    width: 100%; 
    max-width: 1500px;
}
.menu-title { font-size: clamp(24px, 4vw, 32px); font-weight: 800; color: var(--dark); margin-bottom: 40px; }

.card-wrapper { 
    display: flex; 
    gap: 20px; 
    justify-content: center; 
    align-items: stretch;
}

.menu-card {
    background: white; 
    flex: 1; 
    min-width: 250px; 
    max-width: 320px; 
    padding: 40px 20px; 
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05); 
    transition: all 0.3s;
    position: relative; 
    display: flex; 
    flex-direction: column; 
    align-items: center;
    border: 2px solid transparent;
}

/* 모바일 대응: 메뉴 카드 세로 정렬 */
@media (max-width: 850px) {
    .card-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .menu-card {
        width: 100%;
        max-width: 400px;
    }
}

.menu-card.active:hover {
    transform: translateY(-10px);
    border-color: var(--success);
    box-shadow: 0 20px 40px rgba(5, 150, 105, 0.15);
    cursor: pointer;
}
.menu-card.disabled {
    opacity: 0.6; background: #fcfcfc; filter: grayscale(0.8); cursor: not-allowed;
}
.lock-tag {
    position: absolute; top: 20px; right: 20px; background: #eee;
    font-size: 12px; padding: 4px 10px; border-radius: 20px; color: #777; font-weight: bold;
}
.card-icon { font-size: 60px; margin-bottom: 25px; }
.menu-card h3 { margin: 0 0 15px 0; color: var(--dark); font-size: 22px; }
.menu-card p { color: #666; line-height: 1.6; margin-bottom: 30px; font-size: 15px; }
.start-btn {
    margin-top: auto; padding: 12px 30px; background: var(--main);
    color: white; border: none; border-radius: 12px; font-weight: bold; font-size: 16px;
    transition: 0.2s;
}
.menu-card.active:hover .start-btn { background: var(--success); }

/* [3] 메인 에디터 헤더 스타일 (로고-사용자 정보 분리) */
header { 
    background: white; 
    padding: 15px 30px; 
    display: flex !important; 
    justify-content: space-between !important; 
    align-items: center; 
    border-bottom: 1px solid #E5E7EB; 
    width: 100%;
    box-sizing: border-box;
    
    /* ▼▼▼ [수정] 모바일 상단 노치(Safe Area) 대응 ▼▼▼ */
    padding-top: calc(15px + env(safe-area-inset-top));
}

.logo { 
    font-size: 20px; 
    font-weight: 800; 
    color: var(--dark); 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    transition: opacity 0.2s;
    user-select: none;
}
.logo:hover { opacity: 0.7; }
.logo span { color: var(--success); }

.user-info { display: flex; align-items: center; gap: 15px; font-weight: 500; color: var(--dark); }
.btn-mini { padding: 4px 12px; border: 1px solid #ddd; background: white; border-radius: 6px; cursor: pointer; font-size: 12px; transition: 0.2s; }
.btn-mini:hover { background: #f3f4f6; }

/* [4] 에디터 레이아웃 및 컨테이너 */
#app-screen { 
    display: flex; 
    flex-direction: column; 
    height: 100vh;
    /* ▼▼▼ [수정] 모바일 브라우저 주소창 대응 (Dynamic Viewport Height) ▼▼▼ */
    height: 100dvh; 
}
.container { flex: 1; display: flex; overflow: hidden; }
.editor-main { flex: 1; background: #E5E5E5; position: relative; overflow: auto; display: flex; flex-direction: column; align-items: center; padding: 20px; }
.sidebar { width: 360px; background: white; border-left: 1px solid #E5E7EB; display: flex; flex-direction: column; z-index: 10; box-shadow: -2px 0 10px rgba(0,0,0,0.05); }

/* [5] 탭 메뉴 스타일 */
.tabs { display: flex; background: #fff; border-bottom: 1px solid #ddd; }
.tab { flex: 1; padding: 12px 5px; text-align: center; font-size: 14px; font-weight: 600; color: #888; cursor: pointer; border-bottom: 2px solid transparent; transition: 0.2s; }
.tab:hover { background: #f9f9f9; color: var(--success); }
.tab.active { color: var(--success); border-bottom: 2px solid var(--success); background: #F0FDF4; }
.tab-content { padding: 20px; display: none; flex: 1; flex-direction: column; overflow-y: auto; height: calc(100vh - 120px); }
.tab-content.active { display: flex; }

/* [6] 편집 도구 및 슬라이더 */
#drop-zone { position: absolute; inset: 20px; border: 3px dashed #9CA3AF; border-radius: 20px; display: flex; justify-content: center; align-items: center; cursor: pointer; transition: 0.2s; background: rgba(255,255,255,0.6); }
#drop-zone:hover { border-color: var(--success); background: rgba(5, 150, 105, 0.05); }
.msg { text-align: center; color: #6B7280; } .msg .icon { font-size: 48px; margin-bottom: 10px; }

.page-wrap { position: relative; margin-bottom: 30px; box-shadow: 0 4px 20px rgba(0,0,0,0.1); background: white; max-width: 900px; width: 100%; }
.base-canvas { display: block; max-width: 100%; height: auto !important; }
.overlay { position: absolute; top: 0; left: 0; touch-action: none; width: 100%; height: 100%; }
.page-badge { position: absolute; top: -25px; left: 0; font-weight: bold; color: #666; font-size: 14px; background: rgba(255,255,255,0.8); padding: 2px 8px; border-radius: 4px; }

.range-box { display: flex; gap: 5px; margin-top: 5px; }
.range-box input { flex: 1; padding: 6px; font-size: 13px; border: 1px solid #ddd; border-radius: 4px; }
.range-box button { padding: 6px 12px; background: var(--main); color: white; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.tool-group label {
    display: block;      /* 인라인 요소를 블록으로 변경해 여백이 먹히게 함 */
    margin-bottom: 15px; /* 버튼과의 간격 조절 */
    font-weight: bold;
    color: var(--dark);
}
.tool-btn { width: 100%; padding: 14px; margin-bottom: 8px; border: 1px solid #E5E7EB; background: white; border-radius: 8px; cursor: pointer; text-align: left; font-size: 15px; display: flex; justify-content: space-between; align-items: center; transition: 0.2s; }
.tool-btn:hover { background: #F3F4F6; transform: translateY(-1px); }
.tool-btn.active { border-color: var(--success); background: #F0FDF4; color: var(--success); font-weight: 700; box-shadow: 0 2px 4px rgba(5, 150, 105, 0.1); }
.tool-btn.danger { color: #EF4444; border-color: #FECACA; }
.tool-btn.danger.active { background: #FEF2F2; border-color: #EF4444; }

.slider-box { display: flex; align-items: center; gap: 10px; padding: 10px; background: #F9FAFB; border-radius: 8px; margin-bottom: 10px; font-size: 13px; transition: 0.3s; }
.slider-box input { flex: 1; cursor: pointer; }
.badge { font-size: 11px; background: #E5E7EB; color: #6B7280; padding: 2px 6px; border-radius: 4px; }
.tool-btn.active .badge { background: #BBF7D0; color: var(--success); }

/* [7] 지우개 미리보기 가이드 */
#eraser-guide {
    position: fixed; border: 2px solid #FF784E; border-radius: 50%; pointer-events: none;
    z-index: 9999; display: none; transform: translate(-50%, -50%); background: rgba(255, 120, 78, 0.1);
}

/* [8] 하단 변환 액션 영역 */
.action-box { margin-top: auto; border-top: 1px solid #E5E7EB; padding-top: 20px; padding-bottom: 20px;}
#btn-process { width: 100%; padding: 18px; background: var(--main); color: white; border: none; border-radius: 12px; font-weight: 800; font-size: 18px; cursor: pointer; box-shadow: 0 4px 15px rgba(45, 55, 72, 0.3); transition: 0.2s; }
#btn-process:hover { background: var(--success); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(5, 150, 105, 0.3); }
#btn-process:disabled { background: #D1D5DB; cursor: not-allowed; box-shadow: none; transform: none; }
#status-msg { margin-top: 10px; text-align: center; font-size: 14px; font-weight: bold; min-height: 20px; color: var(--success); }

/* [9] AI 리포트 및 작업 기록 스타일 */
.ai-summary-box { background: #F0FDF4; border: 1px solid #BBF7D0; padding: 20px; border-radius: 12px; margin-bottom: 15px; text-align: center; }
.ai-summary-box h3 { margin: 0 0 5px 0; color: #166534; font-size: 16px; }
.ai-summary-box p { margin: 0; color: #15803D; font-weight: bold; font-size: 24px; }
.ai-list { list-style: none; padding: 0; margin: 0; }
.ai-list li { padding: 10px; border-bottom: 1px solid #eee; font-size: 13px; color: #333; line-height: 1.4; }

.history-item { padding: 15px; border-bottom: 1px solid #eee; transition: background 0.2s; }
.history-item:hover { background: #f9fafb; }
.history-item .status { font-size: 12px; display: inline-block; padding: 2px 8px; border-radius: 4px; background: #FEF3C7; color: #D97706; margin-top: 5px; font-weight: bold; }
.history-item .status.completed { background: #D1FAE5; color: #059669; }

/* [10] 모달 및 팝업 스타일 */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: flex; align-items: center; justify-content: center; z-index: 2000; animation: fadeIn 0.3s; }
.modal-content { background: white; width: 400px; padding: 40px; border-radius: 20px; text-align: center; box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1); animation: slideUp 0.3s; }
.modal-icon { font-size: 60px; margin-bottom: 20px; }
.modal h2 { margin: 0 0 10px 0; color: var(--dark); }

.big-download-button { display: block; width: 100%; padding: 20px; background: var(--success); color: white; text-decoration: none; font-size: 20px; font-weight: bold; border-radius: 12px; box-shadow: 0 4px 15px rgba(5, 150, 105, 0.3); transition: 0.2s; margin-bottom: 15px; box-sizing: border-box; }
.big-download-button:hover { background: #047857; transform: translateY(-3px); box-shadow: 0 8px 20px rgba(5, 150, 105, 0.4); }
.close-btn { background: white; border: 1px solid #ddd; padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: bold; color: #666; }

/* [11] 로그인 화면 스타일 */
#login-screen { 
    position: fixed; inset: 0; background: var(--main); 
    display: flex; justify-content: center; align-items: center; 
    z-index: 200; 
    /* 모바일 안전 영역 대응 */
    padding-top: calc(20px + env(safe-area-inset-top));
}
.login-box { background: white; padding: 40px; border-radius: 24px; width: 320px; text-align: center; box-shadow: 0 20px 50px rgba(0,0,0,0.3); }
.login-box h2 { color: var(--main); margin-bottom: 25px; font-weight: 800; font-size: 24px; }
.login-box input { width: 100%; padding: 14px; margin: 8px 0; border: 1px solid #E5E7EB; border-radius: 12px; box-sizing: border-box; font-size: 15px; outline: none; transition: border 0.2s; }
.login-box input:focus { border-color: var(--success); }
.login-box button { width: 100%; padding: 14px; background: var(--success); color: white; border: none; border-radius: 12px; font-weight: bold; cursor: pointer; margin-top: 15px; font-size: 16px; transition: 0.2s; }
.login-box button:hover { background: #047857; transform: translateY(-2px); }

/* [12] 로딩 스피너 및 애니메이션 */
#loading-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 300; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; }
.spinner { width: 50px; height: 50px; border: 5px solid rgba(255,255,255,0.3); border-top-color: var(--success); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* [13] 모바일 반응형 최종 보완 */
@media (max-width: 768px) {
    body { overflow: auto; }
    .container { flex-direction: column; height: auto; }
    .editor-main { width: 100%; height: 60vh; padding: 10px; box-sizing: border-box;}
    .sidebar { width: 100%; height: 40vh; border-left: none; border-top: 1px solid #E5E7EB; }
    .tab-content { height: calc(40vh - 50px); }
    #eraser-guide { display: none !important; }

    /* ▼▼▼ [수정] 모바일 메뉴/로그인 화면 잘림 방지 (Flex-Start) ▼▼▼ */
    #menu-screen, #login-screen {
        align-items: flex-start !important;
        padding-top: calc(60px + env(safe-area-inset-top)); /* 위쪽 여백 충분히 확보 */
    }
    
    /* ▼▼▼ [수정] 헤더 노치 대응 추가 보정 ▼▼▼ */
    header {
        padding: 15px 20px !important;
        padding-top: calc(15px + env(safe-area-inset-top)) !important;
    }
}
/* 769px 이상의 화면(데스크탑)에서만 글씨 크기 축소 */
@media (min-width: 769px) {
    /* 1. 상단 로고 및 사용자 정보 */
    .logo {
        font-size: 20px !important; /* 기존 20px에서 축소 */
    }
    .user-info {
        font-size: 15px;
    }
    .btn-mini {
        font-size: 11px;
    }

    /* 2. 사이드바 탭 메뉴 */
    .tab {
        font-size: 12px !important; /* 기존 14px에서 축소 */
    }

    /* 3. 편집 도구 버튼 및 단축키 배지 */
    .tool-btn {
        font-size: 13px !important; /* 기존 15px에서 축소 */
        padding: 10px 12px;
    }
    .badge {
        font-size: 9px !important; /* 기존 11px에서 축소 */
    }

    /* 4. 지우개 크기 슬라이더 텍스트 */
    .slider-box {
        font-size: 12px; /* 기존 13px에서 축소 */
    }

    /* 5. 하단 변환 시작 버튼 */
    #btn-process {
        font-size: 16px !important; /* 기존 18px에서 축소 */
        padding: 14px;
    }

    /* 6. 파일 정보 및 안내 문구 */
    .file-info-box span,
    .range-box input,
    #status-msg {
        font-size: 12px;
    }
    /* 1. 작업 기록 전체 아이템 여백 줄이기 */
    .history-item {
        padding: 10px 15px !important; /* 기존 15px에서 축소 */
    }

    /* 2. 파일명 (예: 분포중.pdf) */
    .history-item div:first-child {
        font-size: 13px !important; 
    }

    /* 3. 날짜 (예: 2026-01-29...) */
    .history-item div:nth-child(2) {
        font-size: 10px !important; /* main.js의 12px을 무시하고 10px로 */
    }

    /* 4. 상태 태그 (completed) */
    .history-item .status {
        font-size: 10px !important;
        padding: 1px 6px !important;
    }

    /* 5. 다운로드 버튼 */
    .history-item a {
        font-size: 11px !important;
        margin-top: 3px !important;
    }
}
/* 작업 기록 새로고침 버튼 - 기출판다 그린으로 변경 */
.btn-refresh {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    background-color: var(--success) !important; /* 초록색 강제 적용 */
    color: white !important;
    border: none !important;
    border-radius: 8px;
    font-weight: bold;
    font-size: 13px; /* 글씨 크기도 살짝 줄임 */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}

.btn-refresh:hover {
    background-color: #047857 !important; /* 마우스 올리면 더 진한 초록 */
}
/* style.css 맨 마지막에 추가 */
.pagination-container {
    display: flex;
    justify-content: center;
    gap: 5px;
    padding: 20px 0;
}

.page-btn {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.page-btn:hover {
    background: #f3f4f6;
    border-color: var(--success);
    color: var(--success);
}

.page-btn.active {
    background: var(--success); /* 기출판다 그린 */
    color: white;
    border-color: var(--success);
    font-weight: bold;
}
/* [수정] 도구 버튼 텍스트 디자인 강제 적용 */
.text-group {
    display: flex !important;           /* 플렉스 박스 강제 적용 */
    flex-direction: column !important;  /* 무조건 세로 정렬 */
    align-items: flex-start !important; /* 왼쪽 정렬 */
    justify-content: center;
    gap: 4px;                           /* 제목과 설명 사이 간격 */
}

.main-text {
    display: block !important;
    font-size: 15px !important;
    font-weight: bold;
    line-height: 1.2;
}

.sub-text {
    display: block !important;
    font-size: 11px !important;
    color: #9CA3AF; 
    font-weight: normal !important;
    line-height: 1.2;
}

/* 활성화(Active) 상태일 때 디자인 */
.tool-btn.active .sub-text {
    color: #059669 !important; /* 활성화 시 설명글도 초록색 */
    opacity: 0.9;
}

/* 페이지 삭제(위험) 버튼 활성화 시 */
.tool-btn.danger.active .sub-text {
    color: #EF4444 !important;
}

/* 버튼 높이 유동적으로 변경 */
.tool-btn {
    height: auto !important;
    min-height: 60px; /* 최소 높이 확보 */
}
/* 메인 화면 가이드 스타일 */
#drop-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F8FAFC; /* 배경색을 아주 연한 회색으로 변경 */
    border: 2px dashed #CBD5E1;
    border-radius: 16px;
    transition: all 0.3s ease;
    cursor: pointer;
    padding: 40px;
}

#drop-zone:hover {
    border-color: #10B981;
    background: #F0FDF4;
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}

.guide-content {
    text-align: center;
    width: 100%;
    max-width: 800px;
}

.guide-title {
    font-size: 1.8rem;
    color: #1E293B;
    margin-bottom: 40px;
    font-weight: 700;
}

.step-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-bottom: 50px;
}

.step-card {
    background: white;
    padding: 25px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    width: 180px;
    transition: transform 0.2s;
}

.step-card:hover {
    transform: translateY(-5px);
}

.step-icon {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.step-card h4 {
    margin: 0 0 10px 0;
    color: #334155;
    font-size: 1.1rem;
}

.step-card p {
    font-size: 0.85rem;
    color: #64748B;
    line-height: 1.4;
    margin: 0;
}

.step-arrow {
    font-size: 1.5rem;
    color: #CBD5E1;
    font-weight: bold;
}

.upload-cta-btn {
    background: none;         /* 초록색 배경 삭제 */
    color: #475569;           /* 글자색을 차분한 진회색으로 변경 */
    border: none;             /* 테두리 삭제 */
    padding: 10px 20px;       /* 여백 조정 */
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: none;         /* 초록색 광채(그림자) 삭제 */
    transition: color 0.2s;
}

.upload-btn-area:hover .upload-cta-btn {
    background: transparent !important; /* 호버 시 배경색 안 보이게 */
    color: #059669 !important;          /* 마우스 올리면 글자색만 포인트 컬러로 변경 */
}

.sub-msg {
    margin-top: 15px;
    color: #94A3B8;
    font-size: 0.9rem;
}

/* 반응형 처리: 화면 작아지면 세로로 배치 */
@media (max-width: 768px) {
    .step-container {
        flex-direction: column;
        gap: 15px;
    }
    .step-arrow {
        transform: rotate(90deg);
    }
    .step-card {
        width: 100%;
    }

    /* ▼▼▼ [새로 추가된 코드] ▼▼▼ */
    #drop-zone {
        position: relative !important; 
        inset: auto !important;       
        width: 100%;                  
        height: auto !important;       
        min-height: 300px;             
        padding: 20px !important;     
        margin-bottom: 20px;          
    }

    .guide-title {
        font-size: 1.4rem;             
        margin-bottom: 20px;
    }

    .step-card {
        padding: 15px;                 
        width: 100%;                   
    }
    
    .editor-main {
        display: block;                
        overflow-y: auto;              
        -webkit-overflow-scrolling: touch;
    }
    /* ▲▲▲ [여기까지 추가] ▲▲▲ */

} /* 여기가 미디어 쿼리의 끝입니다 */

/* 펜 굵기 동그라미 버튼 */
.pen-dot {
    background: #F1F5F9;
    border: 2px solid #CBD5E1;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* 동그라미 안의 검은 점 (실제 펜 심 느낌) */
.pen-dot div {
    background: #333;
    border-radius: 50%;
}

.pen-dot:hover {
    border-color: #3B82F6;
    background: #EFF6FF;
}

/* 펜 모드가 활성화되었을 때, 선택된 굵기 표시 */
.pen-dot.active {
    border-color: #3B82F6; /* 파란 테두리 */
    background: #DBEAFE;
    transform: scale(1.1);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}
/* 되돌리기 안내문 위치 및 간격 설정 */
.undo-guide {
    margin-top: 30px !important;  /* 이 숫자를 20 -> 30 -> 40으로 키울수록 간격이 넓어집니다 */
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 5px;           /* 왼쪽 정렬을 맞추기 위한 약간의 여백 */
}/* 1. 이모지 공통 스타일 (한 칸 아래로 내리고 크기 키우기) */
/* 1. 이모지 공통 스타일 (크기 및 위치) */
.card-emoji {
    display: block;      /* 한 줄 밑으로 내리기 */
    font-size: 3rem;     /* 크기를 좀 더 시원하게 키웠습니다 */
    margin-top: 12px;    /* 텍스트와의 간격 */
    line-height: 1;
}

/* 2. 하마 전용: 좌우로 흔들거리는 애니메이션 */
@keyframes hama-swing {
    0%, 100% {
        transform: translateX(0) rotate(0deg);
    }
    25% {
        transform: translateX(-8px) rotate(-5deg); /* 왼쪽으로 이동 + 살짝 기울임 */
    }
    75% {
        transform: translateX(8px) rotate(5deg);  /* 오른쪽으로 이동 + 살짝 기울임 */
    }
}

/* 3. 하마에게만 좌우 애니메이션 적용 */
.hama-moving {
    display: inline-block; /* 애니메이션 성능 및 회전을 위해 block보다 inline-block 권장 */
    animation: hama-swing 2s infinite ease-in-out;
}
/* (참고) 게와 소는 .card-emoji 클래스만 있으므로 크기만 커지고 움직이지 않습니다. */
/* =========================================
   [추가] 모바일/태블릿 왼쪽 문제영역(editor-main) 스크롤바 강제 표시
   ========================================= */
.editor-main {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
}

.editor-main::-webkit-scrollbar {
    width: 12px; /* 터치하기 쉽도록 살짝 더 넓게 */
    background-color: transparent;
    -webkit-appearance: none;
    display: block !important; /* 모바일 숨김 방지 핵심 */
}

.editor-main::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.3); /* 스크롤바 색상 (회색) */
    border-radius: 10px;
    background-clip: padding-box;
    border: 3px solid #E5E5E5; /* 배경과 자연스럽게 어우러지는 여백 효과 */
}

.editor-main::-webkit-scrollbar-track {
    background-color: transparent; /* 트랙은 투명하게 */
}
/* [14] 새 작업 시작 버튼 (이본님의 기존 스타일 변수 활용) */
.btn-new-task {
    width: 100%;
    margin-top: 12px;
    padding: 12px;
    background: white;
    color: var(--main); /* 주신 파일의 차콜 블랙 */
    border: 1px solid #E5E7EB;
    border-radius: 12px; /* 변환 버튼과 동일한 라운딩 */
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.2s ease;
}

.btn-new-task:hover {
    background: #F9FAFB;
    border-color: var(--accent); /* 호버 시 보조 그린으로 강조 */
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn-new-task .main-text {
    font-size: 14px; /* 기존 탭 메뉴와 맞춘 크기 */
    font-weight: 800;
}

.btn-new-task .sub-text {
    font-size: 11px;
    color: #9CA3AF;
    font-weight: normal;
}

.btn-new-task:hover .sub-text {
    color: var(--success); /* 호버 시 대나무 그린으로 변경 */
}
/* =========================================
   [마이페이지] 세련된 포인트 충전 카드 UI
   ========================================= */
.charge-grid {
    display: grid;
    /* 3칸씩 배치하되, 화면이 좁아지면 자동으로 줄바꿈 되도록 반응형 적용 */
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); 
    gap: 20px;
    margin-top: 20px;
}

.charge-card {
    position: relative;
    background: #fff;
    border: 2px solid #E5E7EB; /* 연한 회색 테두리 */
    border-radius: 16px;
    padding: 35px 20px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.02);
    overflow: hidden;
}

/* 마우스 올렸을 때 애니메이션 (기출판다 그린 활용) */
.charge-card:hover {
    border-color: var(--success); 
    transform: translateY(-5px);
    box-shadow: 0 12px 24px rgba(5, 150, 105, 0.15); 
}

/* BEST 추천 카드 전용 디자인 */
.charge-card.popular {
    border-color: var(--success);
    background: #F0FDF4; /* 아주 연한 초록색 배경 */
}

.popular-badge {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    background: var(--success);
    color: white;
    padding: 6px 16px;
    font-size: 13px;
    font-weight: bold;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
    letter-spacing: 1px;
    box-shadow: 0 2px 8px rgba(5, 150, 105, 0.3);
}

.point-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.point-amount {
    font-size: 26px;
    font-weight: 900;
    color: var(--dark);
    margin: 0;
    letter-spacing: -0.5px;
}

.krw-amount {
    display: inline-block;
    margin-top: 12px;
    padding: 6px 16px;
    background: var(--bg);
    color: #475569;
    border-radius: 20px;
    font-size: 15px;
    font-weight: 600;
}

/* 추천 카드의 가격표 색상 반전 */
.charge-card.popular .krw-amount {
    background: #D1FAE5;
    color: #065F46;
}

.vat-text {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #9CA3AF;
}
/* =========================================
   [추가] 기출판다 Pro 오답노트 전용 워터마크 (영문 GichulPandA 빽빽하게!)
   ========================================= */
.watermark-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* 마우스 클릭이나 드래그는 그대로 통과 */
    z-index: 10;
    
    /* 🚀 영문이라 암호화 없이 바로 적용! 캔버스 크기를 150x150으로 좁혀서 아주 촘촘하게 도배합니다 */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Ctext x='5' y='80' transform='rotate(-30 75 75)' fill='rgba(0,0,0,0.15)' font-size='22' font-weight='bold' font-family='sans-serif'%3EGichulPandA%3C/text%3E%3C/svg%3E");
    background-repeat: repeat;
}
/* =========================================
   [추가] 오답노트 2단 인쇄용 특수 레이아웃
   ========================================= */
@media print {
    /* 1. 화면에 보이는 UI 전부 숨김 */
    body * { visibility: hidden; }
    #print-area, #print-area * { visibility: visible; }
    
    /* 2. 인쇄 도화지 위치 최상단으로 재조정 */
    #print-area { position: absolute; left: 0; top: 0; width: 100%; padding: 10px; }
    
    /* 3. 2단 편집 레이아웃 (반으로 가르기) */
    .print-2col {
        column-count: 2;
        column-gap: 40px;
        column-rule: 1px dashed #ccc;
    }
    
    /* 4. 문항이 다음 페이지로 넘어갈 때 잘림 방지 (핵심!) */
    .print-item {
        break-inside: avoid;
        margin-bottom: 30px;
    }
    
    /* 5. 이미지 비율 유지 */
    .print-item img {
        max-width: 100%;
        height: auto;
    }
    
    /* 혹시 모를 배경 및 불필요 요소 강제 삭제 */
    .stepper, .filter-section, .bottom-actions, header, .note-container {
        display: none !important;
    }
}