@media screen and (min-width: 769px) {
    .sub-menu-text {
        display: none;
    }
    .container-lg {
        max-width: 1320px;
        min-width: 1320px;
    }
    .navbar,
    .gin-dev-banner {
        min-width: 1320px;
    }
    .mobile {
        display: none !important;
    }
}
@media screen and (max-width: 768px) {
    .desktop {
        display: none !important;
    }
}

/* 세로 스크롤바 공간을 항상 예약해, 페이지 내용 길이(스크롤바 유무)와 무관하게 가용 폭을 일정하게
   유지한다. 이게 없으면 짧은 목록(스크롤바 없음)과 긴 상세(스크롤바 있음)의 폭이 달라져, 폴더 패널이
   컨테이너 밖으로 뜨는/도킹되는 판정과 위치가 페이지마다 어긋난다. */
html {
    scrollbar-gutter: stable;
}

/* 개발서버 표시 띠 (base.html, is_development일 때만 렌더). navbar 색을 바꾸는 대신
   페이지 최상단 빗금 띠로만 구분해, 개발서버에서도 프로덕션과 같은 화면을 보게 한다. */
.gin-dev-banner {
    background-color: #d9480f;
    background-image: repeating-linear-gradient(135deg,
        rgba(0, 0, 0, 0.18) 0 14px,
        rgba(0, 0, 0, 0) 14px 28px);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    padding: 8px 12px;
}
body {
    font-family: "KoPubWorld Dotum","Roboto","Apple SD Gothic Neo","Apple SD 산돌고딕 Neo",Helvetica,"맑은 고딕","malgun gothic","Microsoft NeoGothic","Droid sans",sans-serif;
    line-height: 1.6;
}

/* 결제 이력의 관리자 전용 환불 폼 (금액 입력 + 버튼 한 줄) */
.lms-refund-form {
    display: flex;
    gap: 4px;
    align-items: center;
}
.lms-refund-form input {
    width: 92px;
    padding: 2px 6px;
    font-size: 12px;
    border: 1px solid var(--gin-line);
    border-radius: 4px;
}

/* 대리 로그인 배너 (관리자가 사용자 계정으로 보는 중). 관리자 전용 UI라 노란색(amber) 계열. */
.gin-impersonate-bar {
    position: sticky;
    top: 0;
    /* 상단 메뉴의 드롭다운(Bootstrap .dropdown-menu, z-index 1000)보다 아래에 둔다. 배너가 메뉴 다음에
       오는 sticky 요소라 1030이면 프로필 드롭다운이 배너에 가려져 '내 정보 보기' 아래 항목을 못 누른다.
       본문의 sticky 요소(폴더 패널, 표 헤더 등)보다는 위여야 하므로 그 사이 값을 쓴다. */
    z-index: 990;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    align-items: center;
    justify-content: center;
    background: #fff3cd;
    border-bottom: 1px solid #ffe08a;
    color: #7a5200;
    font-size: 13px;
    line-height: 1.4;
    padding: 7px 12px;
}
.gin-impersonate-bar a {
    color: #7a5200;
    font-weight: 700;
    text-decoration: underline;
    white-space: nowrap;
}

/* 검색어와 겹치는 글자. 워크시트 목록(custom_filters.highlight_keyword)과
   문법뱅크 소분류 검색이 같은 노란 표시를 쓴다. */
.gin-search-hit {
    background-color: var(--gin-search-hit-bg);
    border-radius: 2px;
}

/* 전역 토스트 (gin_shared.js의 Gin.toast). 사이트 공용 알림. */
.gin-toast-container {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%);
    z-index: 100000;  /* 토스트는 항상 최상위: 알려진 최상위 모달/오버레이(syntax 모달 10000)보다 넉넉히 위 */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}
.gin-toast {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 90vw;
    background: #212529;
    color: #fff;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.9rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
}
.gin-toast.show { opacity: 1; transform: translateY(0); }
.gin-toast .gin-toast-text { overflow-wrap: anywhere; }
.gin-toast .gin-toast-icon { flex: none; }
.gin-toast.type-success .gin-toast-icon { color: #51cf66; }
.gin-toast.type-error .gin-toast-icon { color: #ff8787; }
.gin-toast.type-info .gin-toast-icon { color: #74c0fc; }
/* 주의(warning): 노란 바탕 + 검은 글씨. 지나치면 안 되는 안내용 (예: 삽화 오타는 오류 보상 대상이 아님) */
.gin-toast.type-warning { background: var(--gin-warn-row-bg); color: #664d03; border: 1px solid var(--gin-warn-row-bg-range); font-weight: 600; }
.gin-toast.type-warning .gin-toast-icon { color: var(--gin-warn-q); }
.gin-toast-action {
    margin-left: 4px;
    border: 1px solid #6c757d;
    background: transparent;
    color: #ffd43b;
    border-radius: 6px;
    padding: 3px 9px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    flex: none;
}
.gin-toast-action:hover { background: rgba(255, 255, 255, 0.1); }
/* 자동 닫힘 카운트다운 링 (남은 초 숫자 + 소진되는 도넛) */
.gin-toast-timer {
    position: relative;
    width: 24px;
    height: 24px;
    flex: none;
    margin-left: 2px;
}
.gin-toast-timer svg {
    width: 24px;
    height: 24px;
    transform: rotate(-90deg);  /* 반시계 소진 + 마지막 조각이 12시(위)에서 사라지게 (기본 3시 시작을 CCW로 90° 회전) */
}
.gin-toast-timer .track { fill: none; stroke: rgba(255, 255, 255, 0.22); stroke-width: 2; }
.gin-toast-timer .bar { fill: none; stroke: #ffd43b; stroke-width: 4; stroke-linecap: round; }
.gin-toast-timer-num {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
}
a {
    color: #1b1bd6;
}
/* 색 변수 단일 정의. 색을 바꾸려면 여기 한 곳만 수정하면 전역에 반영된다.
   네이밍: --gin-<용도>-<역할> (예: edit-bg, edit-border, sentence-a). */
:root {
    /* 기본 다크 (버튼/토글/테두리 등 검정 계열, Bootstrap dark와 동일) */
    --gin-dark: #212529;
    /* 브랜드 팔레트. 온라인 시스템(ECHO)과 같은 색을 쓴다 (navbar, 이용권 구매 페이지).
       mint = 강조(액티브 언더라인/배지), mint-deep = 흰 배경 위 민트 텍스트,
       mint-surface = 연한 민트 면(hover/칩), ink = 본문 검정, line = 헤어라인 테두리. */
    --gin-mint: #00d9c0;
    --gin-mint-deep: #00a396;
    --gin-mint-surface: #eff5f5;
    --gin-ink: #0e141b;
    --gin-ink-soft: #3d4550;
    --gin-ink-muted: #69727c;
    --gin-line: #d5dfe0;
    --gin-line-soft: #e4ebec;
    /* 검색어 하이라이트 (워크시트 목록 highlight_keyword 태그 + 문법뱅크 소분류 검색 공용) */
    --gin-search-hit-bg: #ffe082;
    /* 비활성(disabled) 툴바 버튼 흐림 정도 (worksheet 탐색기 이동/삭제 + 지문 DB 편집기 이름변경/삭제 공용) */
    --gin-btn-disabled-opacity: 0.25;
    /* 접힌 세로 레일(서랍 손잡이) 공용 치수/색 (지문 DB .pdb-rail + 문서 탐색기 폴더 패널 접힘 공용) */
    --gin-rail-width: 30px;
    --gin-rail-bg: #f8f9fa;
    /* 편집/선택(포커스) 셀 강조: jexcel 편집 셀, edit_document contenteditable 포커스 공용 */
    --gin-edit-bg: #f5f9ff;
    --gin-edit-border: #2684ff;
    /* '문장별 보기' 문장 번갈아 색 (gin_shared.js renderSplitSentences). 검정/파랑 2색 번갈이. */
    --gin-sentence-a: #1a1a1a;  /* 검정 */
    --gin-sentence-b: #1971c2;  /* 파랑 */
    /* 경고 강조 (마침표 뒤 공백 누락 등) */
    --gin-warn-bg: #ffe3e3;
    --gin-warn-fg: #c92a2a;
    --gin-warn-row-bg: #fff3cd;  /* 경고 있는 행 전체 배경 (alert-warning 톤) */
    --gin-warn-row-bg-range: #ffe69c;  /* 경고 행에서 선택 '범위 내' 비활성 셀: 짙은 노랑(회색 대응) */
    --gin-warn-q: #f08c00;       /* 경고 행번호 물음표 (warning amber) */
}
.content {
    --gin-fs: 14px;
    --gin-fs-sm: 13px;
    --gin-fs-xs: 12px;
    --gin-fs-lg: 15px;
    --gin-fs-xl: 17px;
    font-family: "Spoqa Han Sans Neo";
    font-size: var(--gin-fs);
    line-height: 25px;
    padding-top: 10px;
    padding-bottom: 10px;
}
/* 본문을 navbar에 딱 붙인다 (홈처럼 상단이 전면 히어로인 페이지용, base.html의 content_class 블록) */
.content.flush-top {
    padding-top: 0;
}
.content.flush-top > .messages:empty {
    display: none;
}
.table > :not(caption) > * > * {
    padding: 6px;
}

.nav-link {text-align: center;}
.nav-item {
    text-decoration: none;
    font-size: 16px;
    font-weight: 900;
    color: #646566;
    padding: 3px 10px;
    border-radius: 50px;
    cursor: pointer;
    transition: background-color 0.15s;
}
.nav-item.active {
    background-color: var(--gin-dark);
}
.nav-item.active a {
    color: white !important;
}
.nav-item a:hover{
    text-decoration: none;
}
.btn:hover{
    text-decoration: none;
}
.dropdown-menu {
    --bs-dropdown-item-padding-y: 8px;
    --bs-dropdown-link-active-bg: var(--gin-dark);
}
.btn {
    /* border-radius: 50px;
    --bs-btn-padding-x: 14px; */
    --bs-btn-font-size: var(--gin-fs);
}
a {
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

div.worksheet-list.mobile {
    font-size: var(--gin-fs);
    margin-bottom: 10px;
}
div.worksheet-list.mobile .table-row {
    border: 1px solid var(--bs-border-color);
    padding: 5px 10px;
}
div.worksheet-list.mobile .table-row .cell-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}
div.worksheet-list.mobile .caption {
    font-size: var(--gin-fs-xs);
    color: var(--bs-gray-600);
}

.worksheet-list tr {
    border-width: 1px;
}

/* worksheet index: 파일 탐색기 느낌 목록 (워크시트 행 + worksheet_folder_panel JS가 삽입하는 폴더 행).
   지문 DB 탐색기 타일(.passagedb-tile)과 동일하게 행마다 테두리 카드로 구분한다 */
.ws-filelist {
    display: flex;
    flex-direction: column;
    gap: 0;  /* 순서가 무의미(드래그로 사이 끼워넣기 없음)하므로 파일 탐색기처럼 붙여서 조밀하게 */
    margin-bottom: 12px;
    font-size: var(--gin-fs);
    /* 개별 카드 대신 하나의 프레임 안에 행을 쌓고, 행 사이는 구분선(각 행 border-bottom)으로 */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}
.ws-file-row {
    display: flex;
    align-items: center;
    gap: 10px;
    /* 폴더 카드(1줄)와 워크시트 카드(제목+메타 2줄)의 높이를 동일하게: 두 줄 콘텐츠 높이보다
       살짝 큰 공통 min-height + 세로 중앙 정렬로, 두 카드 모두 이 높이로 클램프된다 */
    min-height: 48px;
    padding: 4px 12px;
    border-bottom: 1px solid #dee2e6;  /* 행 사이 구분선 (마지막 행은 아래에서 제거) */
    background: #fff;
    cursor: pointer;
}
.ws-file-row:last-child {
    border-bottom: none;
}
/* 행 전체가 링크인 화면(작성내역처럼 JS 선택/드래그가 없는 목록)용: 링크 기본 스타일을 지운다 */
a.ws-file-row {
    text-decoration: none;
    color: inherit;
}
.ws-file-empty {
    cursor: default;
    color: #868e96;
    justify-content: center;
}
.ws-file-row:hover {
    background: #f8f9fa;
}
/* 휴지통 뷰: 워크시트 카드는 열 수 없으므로 클릭 커서 제거 (체크박스로 선택만) */
.ws-filelist.ws-trash-view .ws-file-row[data-worksheet-id] { cursor: default; }
/* 선택 체크박스 컬럼 (아이콘 왼쪽). 셀 전체 높이 어디를 눌러도 토글되도록 넓은 히트 영역 */
.ws-file-check {
    flex: none;
    align-self: stretch;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    margin: -5px 4px -5px -6px;  /* 카드 세로 패딩까지 덮어 히트 영역 확장 */
    cursor: pointer;
}
.ws-file-check.ws-file-check-empty { cursor: default; }
.ws-file-check-box {
    width: 17px;
    height: 17px;
    border: 1.5px solid #adb5bd;
    border-radius: 4px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.ws-file-check:hover .ws-file-check-box { border-color: #0d6efd; }
.ws-file-row.selected .ws-file-check-box {
    background: #0d6efd;
    border-color: #0d6efd;
}
.ws-file-row.selected .ws-file-check-box::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: translateY(-1px) rotate(45deg);
}
.ws-file-icon {
    font-size: 1.25rem;
    color: #868e96;
    flex: none;
}
.ws-file-folder .ws-file-icon {
    color: #ffc107;
}
.ws-file-trash .ws-file-icon {
    color: #868e96;  /* 휴지통은 회색 (일반 폴더의 노랑과 구분) */
}
.ws-file-up .ws-file-title {
    color: #495057;
    font-weight: 500;
}
.ws-file-folder .ws-file-title {
    font-weight: 500;
}
.ws-file-main {
    flex: 1 1 auto;
    min-width: 0;
}
.ws-file-title {
    color: #212529;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ws-file-title a {
    text-decoration: none;
}
.ws-file-meta {
    font-size: var(--gin-fs-xs);
    color: #868e96;
    display: flex;
    align-items: center;  /* 뱃지 등 flex 아이템이 줄 높이만큼 세로로 늘어나지 않게 */
    gap: 10px;
    line-height: 1.3;
    margin-top: 3px;  /* 제목 줄과의 간격 */
    /* 폭이 줄어도 카드 세로 크기가 일정하도록 한 줄 유지, 넘치면 잘라낸다 (줄바꿈 금지) */
    flex-wrap: nowrap;
    overflow: hidden;
}
.ws-file-meta > span {
    white-space: nowrap;
    flex-shrink: 0;
}
.ws-file-right {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
}
/* 휴대폰: 버튼 줄이 화면 밖으로 넘치지 않게 (긴 버튼 '우리 학교 맞춤 유형 만들기 (25문항 · 125p)'가 오른쪽으로 삐져나갔다) */
@media (max-width: 576px) {
    /* 상세 화면 경로 줄에만 (목록 행의 상태 배지 칸도 .ws-file-right라, 전체에 걸면 목록 제목이 반 토막 났다) */
    #ws_folder_breadcrumb .ws-file-right { flex: 1 1 100%; min-width: 0; justify-content: flex-start; }
    #ws_folder_breadcrumb .ws-file-right .btn { white-space: normal; max-width: 100%; text-align: left; }
}
.ws-file-empty {
    color: #868e96;
    text-align: center;
    padding: 24px 0;
}
/* 선택 툴바 비활성 버튼 흐림: 지문 DB 편집기(#passagedb_toolbar .btn:disabled)와 같은 정도로 통일 */
#ws_move_btn:disabled,
#ws_delete_btn:disabled { opacity: var(--gin-btn-disabled-opacity); }
.ws-file-search-result {
    font-size: 0.85rem;
    margin-top: 2px;
}

/* worksheet detail 상단 메타. 폴더 패널이 있으면 breadcrumb 바 안으로 JS가 옮겨 붙이고,
   없으면(비로그인 등) 이 자리에 제목 줄과 함께 단독 박스로 표시된다 */
/* breadcrumb 바 아래 별도로 표시하는 문서 메타 정보 (제작 완료·#id·타입·작성자·날짜) */
.ws-detail-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: var(--gin-fs-sm);  /* edit_document의 meta(.worksheet-caption)와 동일 크기 */
    color: #868e96;
    margin: -2px 2px 12px;
}
/* detail breadcrumb은 meta가 밖으로 빠져 path가 바의 직접 자식 → 남는 폭을 채워 버튼을 오른쪽으로 민다 */
#ws_folder_breadcrumb > .wsfolder-breadcrumb-path { flex: 1 1 auto; min-width: 0; }

.ws-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}
.ws-detail-header .ws-detail-header-main {
    flex: 1 1 auto;
    min-width: 0;
}
.ws-detail-header .wsfolder-extra-title {
    font-weight: 600;
    margin-bottom: 2px;
}
#ws_folder_breadcrumb .ws-detail-header {
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    border-radius: 0;
}
.top-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.top-btns .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--gin-fs);
    padding: 5px 14px;
    border-radius: 6px;
}
.top-btns-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
/* ─── 입력 안내 (details/summary) ─── */
.form-guide {
    border: 1px solid #d1ecf1;
    border-radius: 6px;
    background: #f0f9fc;
    margin-bottom: 12px;
    font-size: var(--gin-fs-sm);
}
/* 저장→생성 2단계 흐름 안내 (새 문서 폼 상단) */
.form-flow-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 4px 0 12px;
    padding: 8px 12px;
    background: #f0f7ff;
    border: 1px solid #d0e3ff;
    border-radius: 8px;
    font-size: var(--gin-fs-sm);
    color: #495057;
}
.form-flow-step { display: inline-flex; align-items: center; gap: 6px; }
.form-flow-step.active { color: #0d6efd; font-weight: 600; }
.form-flow-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #adb5bd;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
}
.form-flow-step.active .form-flow-num { background: #0d6efd; }
.form-flow-arrow { color: #adb5bd; }
/* 예시로 채우기 / 결과 예시 보기 버튼 줄 (입력 그리드 위) */
/* 입력 안내 박스 하단의 예시 버튼 footer (안내 목록과 점선으로 구분해 한 덩어리로) */
.form-hint-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #cfe6ee;
}
.form-hint-footer .btn .bi { color: inherit; }  /* 버튼 아이콘은 form-hint .bi(청록) 대신 버튼 색을 따름 */
.form-example-hint { font-size: var(--gin-fs-sm); color: #868e96; }
/* 상위 탭: 지문 입력 / 문서 생성 설정 / PDF 출력 설정 (한 번에 하나만 보여준다).
   그리드 툴바(nav-tabs.grid-toolbar-tabs)와 구분되도록 underline형 primary 탭으로 스타일 */
.nav-tabs.form-main-tabs {
    margin-bottom: 14px;
    border-bottom: 2px solid #dee2e6;
    gap: 2px;
    flex-wrap: wrap;
    /* breadcrumb 바로 아래에 sticky (스크롤해도 탭 전환이 항상 가능) */
    position: sticky;
    top: var(--wsfolder-breadcrumb-height, 39px);
    z-index: 11;  /* breadcrumb(50) 아래, 그리드 툴바(9)·시트 헤더 위 */
    background: #fff;
}
.nav-tabs.form-main-tabs .nav-link {
    font-weight: 600;
    color: #6c757d;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    padding: 8px 6px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.nav-tabs.form-main-tabs .nav-link:hover { color: var(--gin-dark); border-bottom-color: #ced4da; }
.nav-tabs.form-main-tabs .nav-link.active {
    color: var(--gin-dark);
    background: transparent;
    border-bottom-color: var(--gin-dark);
}
/* 문서 생성 설정 탭의 실시간 차감 포인트 견적 배지 */
/* 폼 메인 탭 라벨의 배지 (지문 입력 개수 / 문서 생성 설정 차감 포인트). 모양은 공유하고 색만 구분 */
.cfg-tab-point-badge,
.cfg-tab-count-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 7px;
    font-size: 0.72rem;
    font-weight: 700;
    border-radius: 10px;
    vertical-align: middle;
}
.cfg-tab-point-badge {  /* 포인트 차감: 주의를 끄는 amber */
    color: #b45309;
    background: #fff3cd;
    border: 1px solid #ffe69c;
}
.cfg-tab-count-badge {  /* 입력 개수: 정보성이라 중립 회색 */
    color: #495057;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
}
/* 폼 안내/힌트 박스 공용 스타일 (지문 입력 안내 + PDF 출력 설정 안내 등 통일). */
.form-hint {
    font-size: var(--gin-fs-sm);
    color: #495057;
    background: #f0f9fc;
    border: 1px solid #d1ecf1;
    border-radius: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
}
.form-hint .bi { color: #4da3c7; }
.form-hint-title { font-weight: 600; margin-bottom: 2px; }
/* 접이식 안내 박스 (제목줄 클릭으로 body 토글, 상태는 localStorage) */
.form-hint-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}
.form-hint-toggle .form-hint-title { margin-bottom: 0; }
/* 클릭 가능한 헤더임을 hover로 표시 (제목 밑줄 + caret 진하게) */
.form-hint-toggle:hover .form-hint-title { text-decoration: underline; text-underline-offset: 3px; }
.form-hint-toggle:hover .form-hint-caret { color: var(--gin-dark); }
.form-hint-caret { flex: none; font-size: 0.85em; transition: transform 0.15s, color 0.12s; }
.form-hint-collapsible.collapsed .form-hint-caret { transform: rotate(180deg); }
.form-hint-collapsible .form-hint-body { margin-top: 4px; }
/* 안내 문단은 낱말 중간에서 끊기지 않게 ('같은 학교 · 학년 · 과목 기 / 출이'처럼 잘리던 것) */
.form-hint-body { word-break: keep-all; text-wrap: pretty; }
.form-hint-collapsible.collapsed .form-hint-body { display: none; }
.form-hint ul { margin: 0; padding-left: 1.25em; }
.form-hint li { margin: 2px 0; }
.form-guide summary {
    cursor: pointer;
    padding: 8px 14px;
    font-weight: 600;
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 6px;
    user-select: none;
}
.form-guide summary:hover {
    background: #e2f2f7;
}
.form-guide[open] summary {
    border-bottom: 1px solid #d1ecf1;
}
.form-guide ul {
    margin: 0;
    padding: 10px 14px 10px 32px;
    line-height: 1.8;
}
.form-guide kbd {
    font-size: 11px;
    padding: 1px 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
    background: #f8f8f8;
    color: #333;
    font-family: inherit;
}

/* ─── 폼 툴바 (worksheet_form) ─── */
.form-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f6f6f6;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 10px;
    position: sticky;
    top: 39px;  /* sticky breadcrumb(#ws_folder_breadcrumb, 높이 39px) 아래에 쌓이도록 */
    z-index: 10;  /* breadcrumb(z-index 50)보다 낮게 */
}
.form-toolbar .btn,
.grid-toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--gin-fs);
    padding: 5px 12px;
    border-radius: 6px;
}
.form-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}
.form-toolbar-label {
    font-size: var(--gin-fs);
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    padding: 5px 12px;
    background: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 6px;
}
.form-toolbar-title {
    display: inline-block;
    min-width: 240px;
    max-width: 400px;
    font-size: var(--gin-fs);
    padding: 4px 10px;
}
.form-toolbar-right {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}
.form-toolbar-count {
    font-size: var(--gin-fs);
    font-weight: 500;
    color: #495057;
    white-space: nowrap;
}
/* worksheet_form: 제목 입력이 breadcrumb의 현재 세그먼트 자리에 들어간다 (detail의 제목 위치와 대칭).
   폴더 패널 JS(attach_extra_meta)가 이 요소를 경로 끝으로 옮긴다. */
.wsfolder-extra-current.wsfolder-form-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 400;  /* breadcrumb-current의 bold를 끊어 입력창은 일반 굵기 */
}
.wsfolder-extra-current.wsfolder-form-title > .bi { flex: none; }
.wsfolder-form-title .form-toolbar-title {
    flex: 1 1 auto;
    min-width: 160px;
    max-width: 460px;
    /* detail의 제목 텍스트(현재 세그먼트)와 같은 줄높이로 만들어 breadcrumb 세로 크기를 detail과 일치시킨다.
       테두리/세로 패딩이 있으면 텍스트보다 커지므로, 테두리 없이 옅은 배경으로 입력창임을 표시한다. */
    height: auto;
    padding: 0 8px;
    margin: 0;
    font-size: 1.1rem;  /* 현재 세그먼트(제목) 크기와 일치 */
    font-weight: 500;
    line-height: 1.2;
    color: #212529;
    border: none;
    border-radius: 5px;
    /* breadcrumb 회색 배경과 대비되게 흰 배경 + 테두리(box-shadow라 레이아웃 높이엔 영향 없음 → detail과 높이 유지) */
    background: #fff;
    box-shadow: inset 0 0 0 1px #b6bfc9;
}
.wsfolder-form-title .form-toolbar-title::placeholder { color: #adb5bd; font-weight: 400; }
.wsfolder-form-title .form-toolbar-title:focus {
    outline: none;
    box-shadow: inset 0 0 0 1px #0d6efd, 0 0 0 3px rgba(13, 110, 253, 0.25);
}
/* 필수 입력 미입력 강조 (저장 시도 시 제목/입력 그리드 등에 붙임, 채우면 JS가 제거).
   inset 링은 overflow:clip 컨테이너 안에서도 안 잘리고, 바깥 glow로 주목도를 높인다. */
.gin-invalid-glow {
    border-color: #dc3545 !important;
    box-shadow: inset 0 0 0 1.5px #dc3545, 0 0 0 3px rgba(220, 53, 69, 0.18), 0 0 9px 1px rgba(220, 53, 69, 0.4) !important;
    animation: gin-invalid-glow-pulse 1s ease-in-out 2;
}
@keyframes gin-invalid-glow-pulse {
    50% { box-shadow: inset 0 0 0 1.5px #dc3545, 0 0 0 4px rgba(220, 53, 69, 0.28), 0 0 13px 3px rgba(220, 53, 69, 0.6) !important; }
}
/* 입력 그리드(jexcel): #spreadsheet(=.jexcel_container)는 inline-block+padding이라 박스가 표보다 크다.
   표를 감싸는 .jexcel_content에 빨간 테두리+glow를 줘서 그리드에 딱 맞게 표시 (컨테이너 레벨은 끔). */
#spreadsheet.gin-invalid-glow {
    box-shadow: none !important;
    outline: none !important;
    animation: none;
}
/* 표를 덮는 오버레이(::after)로 두껍고 진한 빨간 테두리+glow.
   sticky 표 헤더(z-index~10)는 위쪽 테두리를 가리므로 z-index를 그 위(20)로 올리고,
   pointer-events:none 으로 셀 클릭/편집은 그대로 통과시킨다. jexcel_content는 position:relative(기본). */
#spreadsheet.gin-invalid-glow .jexcel_content::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 20;
    pointer-events: none;
    border: 2px solid #dc3545;
    border-radius: 4px;
    box-shadow: 0 0 8px 2px rgba(220, 53, 69, 0.4);
    animation: gin-invalid-grid-pulse 1.1s ease-in-out 2;
}
@keyframes gin-invalid-grid-pulse {
    50% { box-shadow: 0 0 12px 3px rgba(220, 53, 69, 0.55); }
}
.form-toolbar-separator {
    width: 1px;
    height: 20px;
    background: #ced4da;
    flex-shrink: 0;
}
.form-toolbar .jexcel_toolbar_item,
.grid-toolbar .jexcel_toolbar_item {
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    font-size: 20px;
    color: #495057;
    user-select: none;
    transition: background 0.12s, color 0.12s;
}
.form-toolbar .jexcel_toolbar_item:hover,
.grid-toolbar .jexcel_toolbar_item:hover {
    background: #dee2e6;
    color: var(--gin-dark);
}
/* 툴바 버튼 안에 들어가는 물음표 도움말 아이콘 */
.form-toolbar .btn .btn-help-icon,
.grid-toolbar .btn .btn-help-icon {
    margin-left: 5px;
    color: #adb5bd;
    font-size: 0.95em;
    cursor: help;
    transition: color 0.12s;
}
.form-toolbar .btn .btn-help-icon:hover,
.grid-toolbar .btn .btn-help-icon:hover {
    color: inherit;
}

/* ─── 검색 바 (worksheet_index) ─── */
.search-bar {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 12px;
}
.search-bar-select {
    width: 130px;
    flex-shrink: 0;
    font-size: var(--gin-fs);
    border-radius: 6px 0 0 6px;
    border-right: none;
}
.search-bar-input {
    flex: 1;
    max-width: 220px;
    font-size: var(--gin-fs);
    border-radius: 0;
}
.search-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--gin-fs);
    padding: 5px 14px;
    border-radius: 0 6px 6px 0;
    white-space: nowrap;
}

.worksheet-raw-data {
    margin: 0;
    font-family: 'Courier New', Courier, monospace;
    font-size: var(--gin-fs-sm);
    line-height: 18px;
}
.worksheet-raw-data br {
    content: "";
    display: block;
    margin: 3px 0;
    border: 1px dashed #bbf;
}
.worksheet-title {
    font-weight: 700;
    font-size: var(--gin-fs-xl);
    line-height: 25px;
}
.worksheet-caption {
    display: flex;
    -webkit-box-align: center;
    align-items: center;
    gap: 4px;
    margin-top: 2px;

    font-size: var(--gin-fs-sm);
    font-weight: 400;
    line-height: 17px;
    color: var(--bs-gray-600);
}
.splitter {
    border-right: 1px solid var(--bs-gray-300);
    height: 12px;
}
.worksheet-heading {
    font-weight: 600;
    font-size: var(--gin-fs-lg);
    line-height: 25px;
}
.worksheet-subheading {
    font-weight: 500;
    font-size: var(--gin-fs-lg);
    line-height: 25px;
}
/* ─── worksheet-data 탭 UI ─── */
.worksheet-data .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: none;
    gap: 5px;
    padding: 6px 0 8px;
}
.worksheet-data .nav-tabs .nav-item {
    flex-shrink: 0;
    padding: 0;
    border-radius: 0;
    font-size: var(--gin-fs);
    font-weight: 500;
}
.worksheet-data .nav-tabs .nav-link {
    display: block;
    padding: 5px 14px;
    font-size: var(--gin-fs);
    font-weight: 500;
    color: #495057;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.worksheet-data .nav-tabs .nav-link:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: var(--gin-dark);
}
.worksheet-data .nav-tabs .nav-link.active {
    background: var(--gin-dark);
    border-color: var(--gin-dark);
    color: #fff;
    font-weight: 600;
}
.worksheet-data .nav-tabs .nav-link.nav-link-red-text {
    color: #c92a2a;
    background: #fff5f5;
    border-color: #ffc9c9;
    font-weight: 500;
}
.worksheet-data .nav-tabs .nav-link.nav-link-red-text:hover {
    background: #ffe3e3;
    border-color: #ffa8a8;
}
.worksheet-data .nav-tabs .nav-link.nav-link-red-text.active {
    background: #c92a2a;
    border-color: #c92a2a;
    color: #fff;
    font-weight: 600;
}
.worksheet-data .tab-content {
    /* 테두리 없음: 그리드/지문 DB 박스가 상단에 타이트하게 붙도록 프레임 제거.
       overflow:visible: 스크롤 컨테이너를 안 만들어 표 헤더 sticky가 페이지 기준으로 동작하고,
       미입력 강조(빨간 glow) 등 그리드 가장자리 효과가 잘리지 않는다. (둥근모서리 제거로 clip 불필요) */
    overflow: visible;
}
.worksheet-data .tab-content > .tab-pane > .table {
    margin-bottom: 0;
}
.worksheet-data .tab-content > .tab-pane > .spreadsheet {
    margin: 0;
}

/* ─── 어휘/문장 탭: 지문 선택 pill bar ─── */
.derived-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}
/* 전역 .nav-item(사이트 navbar용 padding)이 pill 간격을 벌리지 않도록 초기화 */
.derived-pills .nav-item {
    padding: 0;
    border-radius: 0;
}
.derived-pills .nav-link {
    padding: 2px 12px;
    font-size: var(--gin-fs-sm);
    font-weight: 600;
    color: #868e96;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    background: #fff;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.derived-pills .nav-link:hover {
    color: #c92a2a;
    border-color: #ffa8a8;
    background: #fff5f5;
}
.derived-pills .nav-link.active {
    color: #fff;
    background: #c92a2a;
    border-color: #c92a2a;
}
/* 중첩 tab-content: 바깥 카드가 이미 테두리를 그리므로 안쪽은 민짜 */
.worksheet-data .tab-content .derived-tab-content {
    border: none;
    border-radius: 0;
    overflow: visible;
}

/* ─── analysis 상세: 탭줄 + pill줄 + 툴바 sticky 스택 ───
   각 줄의 높이는 줄바꿈에 따라 가변이라 JS(worksheet_detail.js update_sticky_tab_offsets)가
   측정해 --wd-tabs-h / --wd-pills-h로 넘긴다. 표 헤더(.derived-table thead)는 스택 맨 아래에 붙는다. */
.worksheet-data.sticky-tabs .nav-tabs {
    position: sticky;
    top: 0;
    z-index: 12;
    background: #fff;
}
.worksheet-data.sticky-tabs .derived-pills {
    position: sticky;
    top: var(--wd-tabs-h, 42px);
    z-index: 11;
}
/* pill줄이 없는 pane(지문 탭 등)은 탭줄 높이만 더한다. pill줄이 있는 pane(.derived-tab-content 안)은 아래에서 pill 높이까지 추가. */
.worksheet-data.sticky-tabs .words-toolbar {
    top: var(--wd-tabs-h, 42px);
}
.worksheet-data.sticky-tabs .spreadsheet .jexcel > thead > tr > td {
    top: var(--wd-tabs-h, 42px);
}
.worksheet-data.sticky-tabs .spreadsheet.derived-table .jexcel > thead > tr > td {
    top: calc(var(--wd-tabs-h, 42px) + 52px);
}
.worksheet-data.sticky-tabs .derived-tab-content .words-toolbar {
    top: calc(var(--wd-tabs-h, 42px) + var(--wd-pills-h, 40px));
}
.worksheet-data.sticky-tabs .derived-tab-content .spreadsheet.derived-table .jexcel > thead > tr > td {
    top: calc(var(--wd-tabs-h, 42px) + var(--wd-pills-h, 40px) + 52px);
}

/* ─── 어휘/문장 탭 내 toolbar ─── */
.words-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    /* 스크롤해도 상단 고정. 높이 52px은 .derived-table 표 헤더의 sticky top(52px)과 맞물린다 */
    position: sticky;
    top: 0;
    z-index: 10;
    height: 52px;
}
.words-toolbar-label {
    font-size: var(--gin-fs);
    font-weight: 600;
    color: #495057;
}
.words-toolbar-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: var(--gin-fs-sm);
    font-weight: 600;
    color: var(--gin-dark);
    background: #fff;
    border: 1px solid var(--gin-dark);
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
}
.words-toolbar-action:hover {
    background: var(--gin-dark);
    color: #fff;
    text-decoration: none;
}

/* ─── edit_document 탭 UI ─── */
#document_canvas .document-navtab {
    display: flex;
    flex-wrap: wrap;
    border-bottom: none;
    gap: 5px;
    padding: 6px 0 8px;
}
#document_canvas .document-navtab .nav-item {
    flex-shrink: 0;
    padding: 0;
    border-radius: 0;
    font-size: var(--gin-fs);
    font-weight: 500;
}
#document_canvas .document-navtab .nav-link {
    display: block;
    padding: 5px 14px;
    font-size: var(--gin-fs);
    font-weight: 500;
    color: #c92a2a;
    background: #fff5f5;
    border: 1px solid #ffc9c9;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#document_canvas .document-navtab .nav-link:hover {
    background: #ffe3e3;
    border-color: #ffa8a8;
}
#document_canvas .document-navtab .nav-link.active {
    background: #c92a2a;
    border-color: #c92a2a;
    color: #fff;
    font-weight: 600;
}

/* ─── profile / gin_admin 탭 UI ─── */
#profile > .nav-tabs,
#gin_admin > .nav-tabs {
    display: flex;
    flex-wrap: wrap;
    border-bottom: none;
    gap: 5px;
    padding: 6px 0 8px;
}
#profile > .nav-tabs .nav-item,
#gin_admin > .nav-tabs .nav-item {
    flex-shrink: 0;
    padding: 0;
    border-radius: 0;
    font-size: var(--gin-fs);
    font-weight: 500;
}
#profile > .nav-tabs .nav-link,
#gin_admin > .nav-tabs .nav-link {
    display: block;
    padding: 5px 14px;
    font-size: var(--gin-fs);
    font-weight: 500;
    color: #495057;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
#profile > .nav-tabs .nav-link:hover,
#gin_admin > .nav-tabs .nav-link:hover {
    background: #e9ecef;
    border-color: #ced4da;
    color: var(--gin-dark);
}
#profile > .nav-tabs .nav-link.active,
#gin_admin > .nav-tabs .nav-link.active {
    background: var(--gin-dark);
    border-color: var(--gin-dark);
    color: #fff;
    font-weight: 600;
}
/* 관리자 탭은 개수가 많아 줄마다 길이가 달라지면 들쭉날쭉하다: 같은 폭 칸에 왼쪽부터 채운다 */
#gin_admin > .nav-tabs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
#gin_admin > .nav-tabs .nav-link {
    text-align: left;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* fallback for non-.worksheet-data tabs */
.nav-tabs .nav-link{
    font-size: var(--gin-fs-lg);
    color: black;
}
.nav-tabs .nav-link.nav-link-red-text {
    color: #dc3545;
    font-weight: bold;
}


.table-row[data-href] {
    cursor: pointer;
}

.content .jexcel_toolbar i {
    box-sizing: content-box;
}
.content .table {
    vertical-align: middle;
    --bs-table-hover-bg: #f3f3f3;
}

.worksheet-input-label {
    display: inline-block;
    padding: .375rem .75rem;
    line-height: 1.5;
    text-align: center;
    background-color: #e9ecef;
    border: 1px solid #ced4da;
}

.spreadsheet .jexcel > thead > tr > td {
    top: 0;
}
.spreadsheet.derived-table .jexcel > thead > tr > td {
    top: 52px;
}
/* 폼: 표 헤더를 sticky 툴바(.form-toolbar) 바로 아래에 붙인다. 툴바 높이는 가변이라
   JS(worksheet_form.js)가 --sticky-header-top을 측정해 넘긴다(폴백 56px). */
.spreadsheet.with-custom-toolbar .jexcel > thead > tr > td {
    top: var(--sticky-header-top, 56px);
}

.spreadsheet .jexcel br {
    content: "";
    display: block;
    margin: 3px;
    border: 1px dashed #bbf;
}

.spreadsheet .jexcel > tbody > tr > td.readonly {
    color: #000000;
}
.spreadsheet.derived-table .jexcel > tbody > tr > td.readonly {
    color: #dc3545;
}

.center {
    text-align: center;
}
.right {
    text-align: right;
}

.gallery .image {
    box-sizing: border-box;
    border-bottom: 1px solid #ddd;
    text-align: center;
}
.gallery .image img {
    width: 100%;
    height: auto;
}
.modal-xl .image img {
    max-width: 100%;
    width: auto;
}

td.paragraph-numbering {
    vertical-align: top; font-weight:bold; user-select: none;
    width: 80px; text-align: center;
}
td.sentence-numbering {
    vertical-align: top; font-weight:bold; user-select: none;
    width: 90px; text-align: center;
}
td.valign-top {
    vertical-align: top;
}
/* 지문 출처 */
td.paragraph-source {
    min-width: 80px;
    max-width: 350px;
    vertical-align: top;
}

/* #input_sentence_blacklist_tab table thead th {
    text-align: center;
} */
#input_sentence_blacklist_tab td {
    border-bottom-width: 0;
}
#input_sentence_blacklist_tab tr.border-bottom td {
    border-bottom-width: 1px;
}
#input_sentence_blacklist_tab table td {
    padding: 0.2rem;
    text-align: center;
}
#input_sentence_blacklist_tab table td:last-child {
    text-align: justify;
}
#input_sentence_blacklist_tab tbody tr:hover {
    background-color: #ffffaa;
}

.content .thick-border-top {
    border-top-width: 3px;
}

.flex {
    flex: 1;
}

.highlight-yellow-red {
    background-color: yellow;
    color: red;
    user-select: none;
}

.join-form-errors {
    color: red;
}
.join-form-errors .errorlist {
    margin: 0;
}

@media screen and (max-width: 700px) {
    .pc-only {
        display: none;
    }

    #spreadsheet .jexcel_toolbar br {
        display: initial;
    }
}

.pagination {
    text-align: center;;
}
.pagination .page-btn {
    color: #999;
}
.pagination .page-btn:hover {
    border-color: #aaa;
}
.pagination .current {
    font-weight: bold;
    background-color: #f9f9f9;
    border-color: #aaa;
}

#gin_admin {
    color: blue;
}

/* gin_admin: LLM 응답 JSON 뷰어 */
.gin-llm-response {
    white-space: pre-wrap;
    font-size: 0.8rem;
    line-height: 1.2;
    max-height: 500px;
    overflow-y: auto;
    background: #fff;
    padding: 8px;
    border: 1px solid #dee2e6;
    margin-bottom: 0;
}

.vocabulary-table td {
    border: 1px solid #dee2e6;
}
.vocabulary-table th {
    border: 1px solid #dee2e6;
}

#worksheet_category {
    border: 1px solid var(--bs-border-color);
    background-color: #f9f9f9 ;
    padding: 5px 0;
    margin-bottom: 14px;  /* 아래 파일 리스트(폴더 행)와의 간격 */
}
#worksheet_category .nav-link {
    color: #6c757d;
    font-weight: normal;
}
#worksheet_category .nav-link.active {
    color: var(--gin-dark);
    border: 2px dotted var(--gin-dark);
    border-radius: 50%;
    font-weight: bold;
}

/* ************************ */
/* WORKSHEET EDIT DOCUMENT */
/* ************************ */
:root {
    --theme-color: #c65252;
}
#document_canvas {
    /* 반응형: 본문(container) 폭을 그대로 채운다. 페이지가 이미 .container-lg(최대 1320px)에 담겨 있어
       상한이 있으므로 별도 max-width 캡을 주지 않는다 (그러면 이 박스만 위의 search panel/설정보다
       좌우로 좁아 보임). 문서 탐색기 펼침 등으로 좁아지면 그 폭에 맞게 줄어 오버플로우가 없다. */
    width: 100%;

    /* PDF _LAYOUT_STYLES 근사용 변수. layout-<style> 클래스(JS _apply_layout_style)로 오버라이드된다.
       폰트는 PDF와 굳이 일치시키지 않고 기존 본문 폰트를 그대로 사용(inherit). */
    --doc-title-font: inherit;
    --box-radius: 0px;            /* 콘텐츠 박스 모서리 */
    --box-border-width: 2px;
    --heading-radius: 0px;        /* 섹션 heading 배지 모서리 */
    /* 본문 배경 tint. theme-color를 흰색 쪽으로 연하게 (PDF tint_color 대응) */
    --box-tint: color-mix(in srgb, var(--theme-color) 10%, white);
    /* 지문/해석 박스 배경: default는 PDF의 베이지 bg_color, style 계열은 theme tint */
    --text-box-bg: rgba(252, 245, 231, 0.7);
    /* 보조 박스(어휘/핵심정리/한 줄 해석) 배경: default/style 계열 모두 흰색 (PDF 대응) */
    --box-bg: white;
}

/* style1~3: 둥근 박스 + 지문/해석 박스만 옅은 theme tint (PDF style1 대응). 폰트는 변경하지 않음 */
#document_canvas.layout-style1,
#document_canvas.layout-style2,
#document_canvas.layout-style3 {
    --box-radius: 16px;
    --box-border-width: 1px;
    --heading-radius: 18px;
    /* PDF style1: 지문/해석 박스만 옅은 tint(bg_tint=0.12), 어휘/핵심정리 등 보조 표는 흰색 */
    --text-box-bg: var(--box-tint);
    --box-bg: white;
}

#document_canvas .header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    border-bottom: 4px solid var(--theme-color);
    margin-bottom: 10px;
}

#document_canvas .header .title {
    font-size: 24px;
    font-weight: bold;
    font-family: var(--doc-title-font);
}

#document_canvas .header .title-right {
    font-size: 20px;
    font-weight: bold;
    font-family: var(--doc-title-font);
}

#document_canvas h3 {
    display: inline-block;
    background-color: var(--theme-color);
    /* 테마색 밝기에 따라 검정/흰색 (PDF의 choose_text_color와 동일 기준, JS _set_theme_color가 설정) */
    color: var(--theme-text-color, white);
    font-size: 14pt;
    font-family: var(--doc-title-font);
    margin: 0;
    padding: 4px 20px;
    /* default=각진 배지, style 계열=둥근 pill (PDF GinBadge 근사) */
    border-radius: var(--heading-radius);
}

#document_canvas .spacer {
    width: 1px;
    height: 15px;
    padding: 0;
    margin: 0;
}

/* 지문 분석 - 출처 */
#document_canvas.analysis .source-wrapper {
    font-weight: bold;
    margin-bottom: 5px;
}
#document_canvas.analysis .source-wrapper .source[contenteditable="true"] {
    min-height: 25px;
}
#document_canvas.analysis .video-url-wrapper,
#document_canvas.comprehensive .video-url-wrapper {
    margin-bottom: 5px;
    font-size: 0.85em;
    color: #6c757d;
    word-break: break-all;
}

/* 지문 및 해석 */
#document_canvas.analysis table.text_eng_kor {
    width: 100%;
    border: var(--box-border-width) solid var(--theme-color);
    border-radius: var(--box-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    margin: 0;
    background: var(--text-box-bg);
}
#document_canvas.analysis table.text_eng_kor td {
    vertical-align: top;
    margin: 0;
    padding: 7px 10px;
}
#document_canvas.analysis table.text_eng_kor td.kor {
    width: 40%;
}

/* 지문 핵심 정리 */
#document_canvas.analysis table.keypoints {
    width: 100%;
    border: var(--box-border-width) solid var(--theme-color);
    border-radius: var(--box-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--box-bg);
    margin: 0;
}
#document_canvas.analysis table.keypoints th {
    text-align: center;
    vertical-align: middle;
    margin: 0;
    padding: 7px;
    width: 100px;
    border-right: 1px solid var(--theme-color);
    border-bottom: 1px solid color-mix(in srgb, var(--theme-color) 35%, transparent);
    color: var(--theme-color);
    font-family: var(--doc-title-font);
}
#document_canvas.analysis table.keypoints tr:last-child th,
#document_canvas.analysis table.keypoints tr:last-child td {
    border-bottom: none;
}
#document_canvas.analysis table.keypoints td {
    vertical-align: top;
    margin: 0;
    padding: 7px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-color) 35%, transparent);
}

/* 주요 어휘 */
#document_canvas.analysis table.words {
    width: 100%;
    border: var(--box-border-width) solid var(--theme-color);
    border-radius: var(--box-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--box-bg);
    margin: 0;
    table-layout: fixed;
}
#document_canvas.analysis table.words td {
    vertical-align: top;
    margin: 0;
    padding: 4px 10px;
    border-bottom: 1px solid color-mix(in srgb, var(--theme-color) 45%, transparent);
}
#document_canvas.analysis table.words tr td.eng {
    border-right: 1px dashed var(--theme-color);
}
#document_canvas.analysis table.words tr td.kor {
    border-right: 2px solid var(--theme-color);
}

/* 한 줄 해석 */
#document_canvas.analysis table.sentence_translation {
    width: 100%;
    border: var(--box-border-width) solid var(--theme-color);
    border-radius: var(--box-radius);
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    background: var(--box-bg);
    margin: 0;
    table-layout: fixed;
}
#document_canvas.analysis table.sentence_translation td {
    vertical-align: top;
    margin: 0;
    padding: 10px 10px;
}
#document_canvas.analysis table.sentence_translation tr td.eng {
    border-right: 2px dashed var(--theme-color);
    width: 60%;
    line-height: 300%;
}
#document_canvas.analysis table.sentence_translation tr td.num {
    line-height: 300%;
    text-align: center;
    width: 35px;
}
#document_canvas.analysis table.sentence_translation tr td.kor {
    padding-top: 20px;
}

/* 지문 탭 sticky */
#document_canvas .navtab-sticky {
    position: sticky;
    top: 60px;
    z-index: 9;
    background: white;
    padding-top: 4px;
    margin-bottom: 0;
}

/* 섹션 숨기기 — parent class 기반 (JS에서 DOM 탐색 불필요) */
#worksheet_edit_document.hide-illustration_visibility .edit-section[data-visibility-key="illustration_visibility"],
#worksheet_edit_document.hide-text_translation_visibility .edit-section[data-visibility-key="text_translation_visibility"],
#worksheet_edit_document.hide-keypoints_visibility .edit-section[data-visibility-key="keypoints_visibility"],
#worksheet_edit_document.hide-words_visibility .edit-section[data-visibility-key="words_visibility"],
#worksheet_edit_document.hide-direct_translation_visibility .edit-section[data-visibility-key="direct_translation_visibility"],
#worksheet_edit_document.hide-syntax_analysis_visibility .edit-section[data-visibility-key="syntax_analysis_visibility"] {
    display: none;
}

/* comprehensive 섹션 숨기기 — 렌더 시점 클래스(comp-section-hidden) + parent class 기반 (둘 다 같은 요소를 가린다) */
#worksheet_edit_document #document_canvas .element.comp-section-hidden,
#worksheet_edit_document.hide-illustration_visibility .element[data-visibility-key="illustration_visibility"],
#worksheet_edit_document.hide-passage_visibility .element[data-visibility-key="passage_visibility"],
#worksheet_edit_document.hide-ox_kor_visibility .element[data-visibility-key="ox_kor_visibility"],
#worksheet_edit_document.hide-ox_eng_visibility .element[data-visibility-key="ox_eng_visibility"],
#worksheet_edit_document.hide-ox_kor_high_visibility .element[data-visibility-key="ox_kor_high_visibility"],
#worksheet_edit_document.hide-ox_eng_high_visibility .element[data-visibility-key="ox_eng_high_visibility"],
#worksheet_edit_document.hide-translation_visibility .element[data-visibility-key="translation_visibility"],
#worksheet_edit_document.hide-paraphrasing_scramble_visibility .element[data-visibility-key="paraphrasing_scramble_visibility"],
#worksheet_edit_document.hide-keyword_meaning_visibility .element[data-visibility-key="keyword_meaning_visibility"],
#worksheet_edit_document.hide-understanding_test_visibility .element[data-visibility-key="understanding_test_visibility"],
#worksheet_edit_document.hide-summary_blank_low_visibility .element[data-visibility-key="summary_blank_low_visibility"],
#worksheet_edit_document.hide-summary_blank_visibility .element[data-visibility-key="summary_blank_visibility"] {
    display: none;
}

/* 섹션 나누기 토글 */
#document_canvas .section-break-toggle {
    display: flex;
    align-items: center;
    margin-top: 12px;
    cursor: pointer;
    user-select: none;
}
#document_canvas .section-break-toggle input {
    display: none;
}
#document_canvas .section-break-toggle .section-break-line {
    flex: 1;
    height: 0;
    border-top: 2px dashed #ddd;
    transition: border-color 0.15s;
}
#document_canvas .section-break-toggle .section-break-label {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    font-size: 13px;
    color: #bbb;
    transition: color 0.15s;
}
#document_canvas .section-break-toggle .section-break-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1;
    color: transparent;
    transition: all 0.15s;
}
#document_canvas .section-break-toggle:hover .section-break-line {
    border-color: #aaa;
}
#document_canvas .section-break-toggle:hover .section-break-label {
    color: #888;
}
#document_canvas .section-break-toggle:hover .section-break-check {
    border-color: #999;
}
#document_canvas .section-break-toggle:has(input:checked) .section-break-line {
    border-color: #d35400;
}
#document_canvas .section-break-toggle:has(input:checked) .section-break-label {
    color: #d35400;
    font-weight: 600;
}
#document_canvas .section-break-toggle:has(input:checked) .section-break-check {
    border-color: #d35400;
    background: #d35400;
    color: white;
}

/* */
#document_canvas .pagebreak {
    padding: 0;
    margin: 0;
    margin: 20px 0;
    border-top: 3px dashed black;
}

#document_canvas.grammar table.grammar_sentence_table th {
    padding: 5px;
    text-align: center;
    font-size: 12pt;
    background-color: #eee;
}

#document_canvas.grammar table.grammar_sentence_table td {
    padding: 5px;
}

#document_canvas.grammar table.grammar_sentence_table td.numbering {
    vertical-align: top;
    text-align: right;
}

#document_canvas.grammar table.grammar_sentence_table td.col1 {
    vertical-align: top;
}
#document_canvas.grammar table.grammar_sentence_table td.col2 {
    vertical-align: top;
}

#document_canvas.grammar table.grammar_sentence_table tr {
    border-top: 2px solid #ddd;
    border-bottom: 2px solid #ddd;
}

/* ── Sentence edit document ── */
#document_canvas.sentence table.sentence_list_table,
#document_canvas.sentence table.sentence_exam_table {
    width: 100%;
    border-collapse: collapse;
}
#document_canvas.sentence table.sentence_list_table th,
#document_canvas.sentence table.sentence_exam_table th {
    padding: 5px;
    text-align: center;
    font-size: 12pt;
    background-color: #eee;
}
#document_canvas.sentence table.sentence_list_table td,
#document_canvas.sentence table.sentence_exam_table td {
    padding: 5px;
    vertical-align: top;
}
#document_canvas.sentence table.sentence_list_table td.numbering,
#document_canvas.sentence table.sentence_exam_table td.numbering {
    text-align: right;
    width: 30px;
}
#document_canvas.sentence table.sentence_list_table tr,
#document_canvas.sentence table.sentence_exam_table tr {
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}
#document_canvas.sentence table.sentence_exam_table td.type-badge {
    width: 60px;
    text-align: center;
}
#document_canvas.sentence table.sentence_exam_table td.hint-disabled {
    background-color: #f0f0f0;
}
#document_canvas.sentence .sentence_document {
    margin-bottom: 10px;
}

#document_canvas.paragraph .doc_canvas {
    display: flex;
    width: 100%;
    height: 820px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
    overflow: hidden;
}
#document_canvas.paragraph .doc_canvas .ordering_column {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e5e7eb;
    background: #f9fafb;
}
#document_canvas.paragraph .doc_canvas .content_column {
    flex: 2;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
}
#document_canvas.paragraph .doc_canvas .ordering_column .ordering_column_body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px;
}
#document_canvas.paragraph .doc_canvas .content_column .content_column_body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 16px;
}

#document_canvas.paragraph .doc_canvas .content_column .content_column_body.large * {
    font-size: 12.1pt;
    line-height: 150%;
}
#document_canvas.paragraph .doc_canvas .content_column .content_column_body.medium * {
    font-size: 11pt;
    line-height: 150%;
}
#document_canvas.paragraph .doc_canvas .content_column .content_column_body.small * {
    font-size: 9.9pt;
    line-height: 150%;
}
#document_canvas.paragraph .doc_canvas .content_column .content_column_body.tiny * {
    font-size: 8.8pt;
    line-height: 150%;
}

/* 위 .content_column_body.<size> * 규칙이 모든 자식 폰트를 강제하므로, 재생성/오류제보 UI는
   analysis(.edit-section 내부)와 동일한 크기가 되도록 같은 조상 체인 + !important로 되돌린다.
   컨테이너 기준 폰트를 잡고(*는 1em으로 상속), 의도된 작은 크기(비용/제보 토글 등)만 다시 지정. */
#document_canvas.paragraph .content_column_body .regen-section-actions { font-size: var(--gin-fs) !important; line-height: 1.5 !important; }
#document_canvas.paragraph .content_column_body .regen-section-actions * { font-size: 1em !important; line-height: 1.5 !important; }
#document_canvas.paragraph .content_column_body .regen-btn-cost { font-size: 0.92em !important; }
#document_canvas.paragraph .content_column_body .regen-report-toggle,
#document_canvas.paragraph .content_column_body .regen-report-note,
#document_canvas.paragraph .content_column_body .regen-count-wrap { font-size: var(--gin-fs-sm) !important; }

#document_canvas.paragraph .datum {
    padding: 0;
}

#document_canvas.paragraph .source-wrapper, #document_search_panel .source-wrapper {
    color: #808080;
}
#document_canvas.paragraph .source-wrapper .source[contenteditable="true"] {
    min-height: 16px;
}

#document_canvas.paragraph .column h4 {
    display: flex;
    align-items: center;
    gap: 7px;
    text-align: left;
    font-size: var(--gin-fs);
    font-weight: 700;
    color: #111827;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 13px 16px;
    margin: 0;
}
#document_canvas.paragraph .ordering_column h4 {
    background: #f9fafb;
}
#document_canvas.paragraph .column h4 i {
    color: #6b7280;
    font-size: 13px;
}

/* 좌측 구성 패널 툴박스 (랜덤 배열) */
#document_canvas.paragraph .ordering-toolbox {
    padding: 10px 12px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}
#document_canvas.paragraph .shuffle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    font-size: var(--gin-fs-sm);
    font-weight: 600;
    color: #fff;
    background: #111827;
    border: 1px solid #111827;
    border-radius: 8px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.15s;
}
#document_canvas.paragraph .shuffle-btn:hover {
    background: #374151;
    border-color: #374151;
    color: #fff;
}
#document_canvas.paragraph .shuffle-btn .num_data {
    font-weight: 700;
}

/* Sortable (지문 구성 아이템) */
#document_canvas.paragraph .ordering_column .datum-ordering-item {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: grab;
    font-size: var(--gin-fs-sm);
    margin: 0 0 6px;
    padding: 9px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 9px;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#document_canvas.paragraph .ordering_column .datum-ordering-item:last-child {
    margin-bottom: 0;
}
#document_canvas.paragraph .ordering_column .datum-ordering-item:hover {
    border-color: #d1d5db;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}
#document_canvas.paragraph .ordering_column .datum-ordering-item.ghost {
    background: var(--box-tint, #eef2ff);
    border: 1px dashed var(--theme-color, #6366f1);
    box-shadow: none;
    opacity: 0.9;
}
#document_canvas.paragraph .ordering_column .datum-ordering-item.not-included {
    background: #f3f4f6 !important;
    border-color: #e5e7eb;
    opacity: 0.55;
}
#document_canvas.paragraph .datum-ordering-item .doi-grip {
    color: #cbd5e1;
    cursor: grab;
    font-size: 12px;
    padding-top: 2px;
}
#document_canvas.paragraph .datum-ordering-item .left-btn {
    display: flex;
    align-items: center;
    gap: 4px;
}
#document_canvas.paragraph .datum-ordering-item .left-btn .form-check {
    margin: 0;
    min-height: auto;
}
#document_canvas.paragraph .datum-ordering-item .doi-main {
    flex: 1;
    min-width: 0;
}
#document_canvas.paragraph .datum-ordering-item .doi-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 5px;
}
#document_canvas.paragraph .datum-ordering-item label {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    cursor: pointer;
    padding: 0;
    margin: 0;
}
#document_canvas.paragraph .datum-ordering-item .datum_numbering {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 22px;
    height: 20px;
    padding: 0 5px;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    background: #f3f4f6;
    border-radius: 5px;
}
#document_canvas.paragraph .datum-ordering-item .doi-preview {
    color: #6b7280;
    font-size: var(--gin-fs-xs);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 구성 아이템 배지 */
#document_canvas.paragraph .datum-ordering-item .badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
    padding: 1px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
#document_canvas.paragraph .datum-ordering-item .badge.bg-dark {
    background: #111827 !important;
}
#document_canvas.paragraph .datum-ordering-item .badge.bg-secondary {
    background: #9ca3af !important;
}
#document_canvas.paragraph .datum-ordering-item .badge.bg-success {
    min-width: 0;
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0;
}
/* 이동 / 삭제 버튼 */
#document_canvas.paragraph .datum-ordering-item .doi-actions {
    margin-left: auto;
}
#document_canvas.paragraph .datum-ordering-item .goto-btn,
#document_canvas.paragraph .datum-ordering-item .del-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border-radius: 7px;
    font-size: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    transition: all 0.15s;
}
#document_canvas.paragraph .datum-ordering-item .goto-btn {
    color: #6b7280;
    background: #f3f4f6;
}
#document_canvas.paragraph .datum-ordering-item .goto-btn:hover {
    color: #fff;
    background: #111827;
}
#document_canvas.paragraph .datum-ordering-item .del-btn {
    color: #dc2626;
    background: #fff;
    border-color: #fecaca;
}
#document_canvas.paragraph .datum-ordering-item .del-btn:hover {
    background: #fef2f2;
}
#document_canvas.paragraph .datum-ordering-item .del-btn i {
    color: #dc2626 !important;
}

/* 스크롤바 */
#document_canvas.paragraph .ordering_column_body::-webkit-scrollbar,
#document_canvas.paragraph .content_column_body::-webkit-scrollbar {
    width: 10px;
}
#document_canvas.paragraph .ordering_column_body::-webkit-scrollbar-thumb,
#document_canvas.paragraph .content_column_body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}
#document_canvas.paragraph .ordering_column_body::-webkit-scrollbar-thumb:hover,
#document_canvas.paragraph .content_column_body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    background-clip: content-box;
}
/* Sortable (choices) */
/* #document_canvas.paragraph .choices div:hover {
    background-color: #f7fc99;
}

#document_canvas.paragraph .choices div {
	cursor: move;
	cursor: -webkit-grabbing;
    background-color: #FCFFC3;
    margin-bottom: 2px;
}
#document_canvas.paragraph .choices div.ghost {
	border: 3px solid blue;
    background-color: #f7fc99;
} */
#document_canvas.paragraph .choices {
    width: 100%;
}
#document_canvas.paragraph .choices .answer {
    color: red;
}

#document_canvas.paragraph .datum.not-included {
    display: none;
}

/* 표완성 서술형의 표 (칸마다 고칠 수 있다) */
#document_canvas.paragraph .datum table.datum-table-edit {
    width: 100%;
    margin: 8px 0;
    border-collapse: collapse;
    font-size: 0.92em;
}
#document_canvas.paragraph .datum table.datum-table-edit th,
#document_canvas.paragraph .datum table.datum-table-edit td {
    border: 1px solid #9AA3AD;
    padding: 4px 6px;
    vertical-align: middle;
}
#document_canvas.paragraph .datum table.datum-table-edit th { background: #F1F4F6; }
#document_canvas.paragraph .datum .datum-table {
    display: flex;
    flex-direction: column;
    width: 100%;
}

#document_canvas.paragraph .datum .datum-row {
    display: flex;
}

#document_canvas.paragraph .datum .datum-cell {
    flex: 1;
    padding: 10px;
    text-align: justify;
}
#document_canvas.paragraph .datum .editable:hover {
    /* border: 2px solid blue; */
    background-color: #FCFFC3;
}

/* 내용 이해 - 출처 */
#document_canvas.comprehensive .source-wrapper {
    font-weight: bold;
    margin-bottom: 5px;
}
#document_canvas.comprehensive .source-wrapper .source[contenteditable="true"] {
    min-height: 25px;
}

#document_canvas.comprehensive .answer {
    color: #0000ff;
}

/* 내용 이해 - 문제 번호 묶음(1~5) 배지: analysis 섹션 헤딩처럼 테마색 둥근 박스 */
#document_canvas.comprehensive .comp-q-heading {
    font-weight: bold;
    margin: 10px 0 4px;
}
#document_canvas.comprehensive .comp-qrange {
    display: inline-block;
    background-color: var(--theme-color);
    color: var(--theme-text-color, white);
    padding: 4px 20px;
    border-radius: var(--heading-radius);
    margin-right: 6px;
    white-space: nowrap;
}

/* 내용 이해 - 지문/해석 2열 표 (왼쪽=지문, 오른쪽=해석) */
#document_canvas.comprehensive table.comp-passage {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 8px;
    table-layout: fixed;
}
#document_canvas.comprehensive table.comp-passage > tbody > tr > td {
    width: 50%;
    vertical-align: top;
    padding: 6px 8px;
    border: 1px solid #e3e3e3;
}

/* 내용 이해 - 문제 표 (col1=번호, col2=문제, col3=정답해설) */
#document_canvas.comprehensive table.comp-problems {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 2px;
    table-layout: fixed;
}
#document_canvas.comprehensive table.comp-problems > tbody > tr.problem > td {
    vertical-align: top;
    border: 1px solid #e3e3e3;
    height: 1px;  /* 자식 min-height:100% 기준 (실제 높이는 행에 의해 늘어남) */
}
#document_canvas.comprehensive table.comp-problems > tbody > tr.problem > td.problem-num {
    width: 7%;
    padding: 5px 8px;
    font-weight: bold;
    text-align: right;
    white-space: nowrap;
    color: #333;
}
#document_canvas.comprehensive table.comp-problems > tbody > tr.problem > td.problem-q {
    width: 53%;
    padding: 0;  /* 패딩은 편집영역으로 옮겨서 셀 전체가 클릭/편집되게 */
}
#document_canvas.comprehensive table.comp-problems > tbody > tr.problem > td.problem-a {
    width: 40%;
    padding: 0;
}
/* 편집영역이 셀을 가로로 꽉 채우고, 자체 패딩을 가진다 */
#document_canvas.comprehensive td.problem-q .question,
#document_canvas.comprehensive td.problem-q .scramble,
#document_canvas.comprehensive td.problem-a .answer {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-height: 28px;
    padding: 5px 8px;
}
/* 단일 편집영역(문제만/정답)은 셀 높이까지 채워서 빈 공간도 클릭되게 */
#document_canvas.comprehensive td.problem-q .question:only-child,
#document_canvas.comprehensive td.problem-a .answer {
    min-height: 100%;
}
#document_canvas.comprehensive td.problem-q .scramble {
    color: #555;
    border-top: 1px dashed #e3e3e3;
}

/* #document_canvas.paragraph ol.choices > li:nth-child(1)::marker { content: '① '; }
#document_canvas.paragraph ol.choices > li:nth-child(2)::marker { content: '② '; }
#document_canvas.paragraph ol.choices > li:nth-child(3)::marker { content: '③ '; }
#document_canvas.paragraph ol.choices > li:nth-child(4)::marker { content: '④ '; }
#document_canvas.paragraph ol.choices > li:nth-child(5)::marker { content: '⑤ '; }
#document_canvas.paragraph ol.choices > li:nth-child(6)::marker { content: '⑥ '; }
#document_canvas.paragraph ol.choices > li:nth-child(7)::marker { content: '⑦ '; }
#document_canvas.paragraph ol.choices > li:nth-child(8)::marker { content: '⑧ '; }
#document_canvas.paragraph ol.choices > li:nth-child(9)::marker { content: '⑨ '; } */

span[contenteditable="true"] {
    display: inline-block;
}
[contenteditable="true"] {
    min-width: 30px;
    min-height: 24px;
}
[contenteditable="true"]:empty::before {
    color: #ccc;
    content: attr(data-placeholder);
    pointer-events: none;
}
/* 모든 contenteditable(td/div/span 등) 포커스/하이라이트 스타일 통일.
   outline-offset 음수로 안쪽에 그려 컨테이너(overflow/테두리)에 잘리지 않게 → 어디서나 동일하게 보인다. */
#document_canvas [contenteditable="true"].highlight {
    background-color: yellow;
}
#document_canvas [contenteditable="true"]:focus {
    /* 요소별 배경 규칙(예: style 계열 td.kor 테마 틴트)이 specificity로 이기지 않도록 !important로 항상 통일 */
    background-color: var(--gin-edit-bg) !important;
    outline: 2px solid var(--gin-edit-border);
    outline-offset: -2px;
    border-radius: 2px;
}

#worksheet_edit_document #edit_document_toolbar_wrapper {
    /* 고정 height 60px 제거: 접힌 PDF 출력 설정 헤더보다 커서 아래 '편집 안내'와 간격이 크게 벌어졌음.
       내용(툴바) 높이에 맞춘다. */
    display: initial;
    overflow: initial;
}
/* 툴바 안 섹션 하단 여백 제거 (툴바 자체 padding으로 충분, 아래 '편집 안내'와 간격 최소화) */
#worksheet_edit_document #edit_document_toolbar .detail-cfg-section { margin-bottom: 0; }
#worksheet_edit_document #edit_document_toolbar {
    z-index: 10;  /* breadcrumb(z-index 50)보다 낮게 */
    transition: all 0.3s ease;
    box-sizing: border-box;
    position: sticky;
    /* sticky breadcrumb(#ws_folder_breadcrumb) 아래에 쌓이도록. 제목 입력이 들어가 높이가 가변이라
       패널 JS가 실측해 넣는 --wsfolder-breadcrumb-height를 쓴다 (없으면 39px). */
    top: var(--wsfolder-breadcrumb-height, 39px);
    /* 펼친 PDF 출력 설정이 화면보다 길면(휴대폰) sticky라 아래 줄로 끝내 내려가지 못했다 (2026-10-18 사장님 'PDF 출력 설정 스크롤 문제').
       화면 높이 안으로 묶고 넘치는 만큼은 패널 안에서 스크롤한다 */
    max-height: calc(100dvh - var(--wsfolder-breadcrumb-height, 39px));
    overflow-y: auto;
    margin: 0;
    padding: 8px 0;
    /* sticky로 콘텐츠 위에 뜨므로 배경은 불투명(흰색). 바깥 테두리는 없앤다 ('PDF 출력 설정' 버튼이
       자체 테두리를 가져 이중 박스로 보였음). 버튼 하나만 깔끔하게 남긴다. */
    background: #fff;
}
#worksheet_edit_document #edit_document_toolbar .btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--gin-fs);
    padding: 5px 12px;
    border-radius: 6px;
}
/* PDF 출력 설정 접기 토글: 섹션 헤더(.detail-cfg-section-title) 전체가 클릭 대상 (이중 테두리 없이) */
#worksheet_edit_document #edit_document_toolbar .pdf-config-toggle {
    padding: 0;
    cursor: pointer;
    user-select: none;
}
#worksheet_edit_document #edit_document_toolbar .pdf-config-toggle a {
    display: block;
    padding: 7px 10px;
    color: var(--gin-dark);
    text-decoration: none;
}
#worksheet_edit_document #edit_document_toolbar .pdf-config-toggle:hover { background: #e9ecef; }

/* (edit_document의 print-config-table td padding 스코프 override 제거: worksheet_form의 PDF 출력 설정
   테이블과 동일하게 Bootstrap .table 기본 padding을 써서 컬럼 폭이 두 곳에서 일치하도록) */

/* col1(설명) 최소 너비 + 줄바꿈 방지 ('출력 형식' 등 짧은 라벨이 좁은 창에서도 한 줄로 유지) */
.print-config-table td.right {
    min-width: 5.5em;
    white-space: nowrap;
}
/* 휴대폰 폭: PDF 출력 설정 표(생성 · 편집 · 상세 공용)는 이름 칸이 너무 넓어 값 칸이 화면 밖으로 잘렸다.
   이름을 위, 값을 아래로 쌓고 버튼 묶음 · 섹션 구성 위젯이 폭 안에서 줄바꿈되게 한다 (데스크톱은 그대로) */
@media (max-width: 576px) {
    .print-config-table, .print-config-table > tbody, .print-config-table > tbody > tr { display: block; width: 100%; }
    .print-config-table > tbody > tr > td { display: block; width: 100% !important; max-width: 100%; }
    .print-config-table > tbody > tr > td:first-child {
        text-align: left !important;
        white-space: normal;
        min-width: 0;
        font-weight: 600;
        padding-bottom: 2px;
        border-bottom: 0;
    }
    .print-config-table > tbody > tr > td + td { padding-top: 4px; }
    .print-config-table > thead, .print-config-table > thead > tr { display: block; width: 100%; }
    .print-config-table > thead > tr > th { display: block; }
    .print-config-table .btn-group { flex-wrap: wrap; max-width: 100%; }
    .print-config-table .section-order-widget { display: flex; min-width: 0; width: 100%; }
    .print-config-table .section-order-label { min-width: 0; overflow-wrap: anywhere; }
}

form .table.config-table td {
    padding: 3px 10px;
}
form .table.config-table td input {
    padding: 4px 10px;
}

.monospace {
    font-family: SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;
}

#worksheet_edit_document .search_panel {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(17, 24, 39, 0.06);
    padding: 14px;
    /* 폭은 본문(container)에 맞춘다. 예전엔 #document_canvas가 1200px 고정이라 min-width로 맞췄지만
       지금은 캔버스가 반응형이라 min-width를 두면 문서 탐색기를 펼쳤을 때 컨테이너를 넘친다.
       내부는 3열 그리드(1fr, min-width:0)라 폭이 줄면 그대로 좁아진다. */
}

#worksheet_edit_document .search_panel_body {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px; /* 컬럼 간격 */
    font-size: var(--gin-fs);
    margin-bottom: 0;
}

#worksheet_edit_document .search_panel_body .search_panel_col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#worksheet_edit_document .search_panel_body .search_panel_col h4 {
    display: flex;
    align-items: center;
    gap: 7px;
    text-align: left;
    font-size: var(--gin-fs);
    font-weight: 700;
    color: #111827;
    background: transparent;
    padding: 2px 2px 10px;
    margin: 0;
}
#worksheet_edit_document .search_panel_body .search_panel_col h4 i {
    color: #6b7280;
    font-size: 13px;
}
#worksheet_edit_document .search_panel_body .search_panel_col .body {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #f9fafb;
    padding: 8px;
    height: 600px;
    overflow-y: auto;
}
/* 문제 목록은 위(정렬 토글)/아래(추가하기)에 다른 요소가 있어 다른 pane보다 낮게 */
#worksheet_edit_document .search_panel_body .search_panel_documents_body { height: 530px; }
#worksheet_edit_document .search_panel_body .search_panel_col .body::-webkit-scrollbar {
    width: 10px;
}
#worksheet_edit_document .search_panel_body .search_panel_col .body::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}
#worksheet_edit_document .search_panel_body .search_panel_col .body::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
    background-clip: content-box;
}

/* 추가하기 버튼 */
#worksheet_edit_document .search_panel_body .add-data-wrap {
    margin-top: 8px;
}
#worksheet_edit_document .add-data-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    font-weight: 700;
    padding: 10px 14px;
    border-radius: 9px;
}
#worksheet_edit_document .add-data-btn i {
    font-size: 15px;
}
#worksheet_edit_document .add-data-btn .add-count {
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    padding: 1px 9px;
}

/* 검색 입력 줄 */
#worksheet_edit_document .search_panel_body .search-input-row {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}
#worksheet_edit_document .search_panel_body .search-input-row .form-control {
    flex: 1;
    min-width: 0;
    border-radius: 8px;
}
#worksheet_edit_document .search_panel_body .search-input-row .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    border-radius: 8px;
}

/* 워크시트 목록 행 */
#worksheet_edit_document .search_panel_body .table-row {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#worksheet_edit_document .search_panel_body .table-row:last-child {
    margin-bottom: 0;
}
#worksheet_edit_document .search_panel_body .table-row:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}
#worksheet_edit_document .search_panel_body .table-row.selected {
    background: #eff6ff;
    border-color: #60a5fa;
}
#worksheet_edit_document .search_panel_body .table-row.selected:hover {
    background: #dbeafe;
}
#worksheet_edit_document .search_panel_body .table-row .cell-row {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
#worksheet_edit_document .search_panel_body .cell-row .ws-title {
    flex: 1;
    min-width: 0;
}
#worksheet_edit_document .search_panel_body .cell-row .ws-date {
    flex-shrink: 0;
}
#worksheet_edit_document .search_panel_body .caption {
    font-size: var(--gin-fs-xs);
    color: #6b7280;
    font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: nowrap;
}

#worksheet_edit_document .search_panel_body .search_panel_preview {
    font-size: 10pt;
    line-height: 150%;
}
#worksheet_edit_document .search_panel_body .search_panel_preview .body {
    background: #fff;
}

/* 문제 목록 - 문서(지문 그룹) 헤더 */
#worksheet_edit_document .search_panel_body .search_panel_documents {
    user-select: none;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6 {
    display: flex;
    align-items: center;
    gap: 7px;
    background: #eef2f7;
    color: #374151;
    font-weight: 700;
    padding: 7px 10px;
    font-size: var(--gin-fs-sm);
    text-align: left;
    border-radius: 7px;
    margin: 8px 0 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6 .group-check {
    font-size: 15px;
    color: #6b7280;
    flex-shrink: 0;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6 .group-title {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6 .group-select-hint {
    flex-shrink: 0;
    font-size: var(--gin-fs-xs);
    font-weight: 600;
    color: #6b7280;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px;
    padding: 2px 9px;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6:hover .group-select-hint {
    border-color: #9ca3af;
    color: #374151;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6.selected .group-check,
#worksheet_edit_document .search_panel_body .search_panel_documents h6.selected .group-title {
    color: #fff;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6.selected .group-select-hint {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6:first-child {
    margin-top: 0;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6:hover {
    background: #e2e8f0;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6.selected {
    background: #111827;
    color: #fff;
}
#worksheet_edit_document .search_panel_body .search_panel_documents h6.selected:hover {
    background: #374151;
}
/* 문제 목록 - 개별 문제 아이템 */
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item {
    padding: 7px 9px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 5px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    box-shadow: 0 1px 4px rgba(17, 24, 39, 0.08);
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item.selected {
    background: #eff6ff;
    border-color: #60a5fa;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item.selected:hover {
    background: #dbeafe;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .badge {
    display: inline-flex;
    align-items: center;
    font-weight: 600;
    font-size: 11px;
    line-height: 1.2;
    padding: 1px 8px;
    border-radius: 6px;
    border: 1px solid transparent;
    white-space: nowrap;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .badge.bg-dark {
    flex-shrink: 0;
    background: #111827 !important;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .badge.bg-success {
    min-width: 0;
    background: #ecfdf5 !important;
    color: #047857 !important;
    border: 1px solid #a7f3d0;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .goto-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 7px;
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    border: 1px solid transparent;
    transition: all 0.15s;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .goto-btn:hover {
    color: #fff;
    background: #111827;
}
/* 문제 아이템 내부 레이아웃 (출제 구성 패널과 동일하게: 번호·유형·출처 한 줄, 지문 앞부분 아랫줄) */
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .datum-item-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .datum-check-wrap {
    display: flex;
    align-items: center;
    padding-top: 1px;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .doi-main {
    flex: 1;
    min-width: 0;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .doi-top {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    min-width: 0;
    gap: 5px;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .datum_numbering {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    min-width: 22px;
    height: 20px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: 700;
    color: #374151;
    background: #f3f4f6;
    border-radius: 5px;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .doi-preview {
    color: #6b7280;
    font-size: var(--gin-fs-xs);
    line-height: 1.2;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#worksheet_edit_document .search_panel_body .search_panel_documents .datum-item .datum-goto-wrap {
    margin-left: auto;
}

#worksheet_edit_document .bordered_box table{
    width: 100%;
    border-collapse: collapse;
    padding: 0;
    margin-bottom: 5px;
    text-align: justify;
}

#worksheet_edit_document .bordered_box table td {
    border: 1px solid black;
    padding: 5px;
}

#worksheet_edit_document .bordered_box .heading .text {
    display: inline-block;
    background-color: #eee;
    border-top: 1px solid black;
    border-left: 1px solid black;
    border-right: 1px solid black;
    padding: 3px 7px;
}

/* ===================================================================
   layout_style(style1~3) PDF 근사 (공통/타입별 테마 적용)
   변수(--box-radius/--box-bg/--heading-radius/--doc-title-font)는
   #document_canvas 베이스 + .layout-styleN 오버라이드에서 정의된다.
   =================================================================== */

/* analysis 지문/해석 박스: style 계열에서 영-한 세로 구분선 + 행 점선 구분 + 한국어쪽 진한 tint
   (PDF style1의 divider_after_col / text_divider / right_bg_tint 근사) */
#document_canvas.analysis.layout-style1 table.text_eng_kor td.eng,
#document_canvas.analysis.layout-style2 table.text_eng_kor td.eng,
#document_canvas.analysis.layout-style3 table.text_eng_kor td.eng {
    border-right: 1px solid color-mix(in srgb, var(--theme-color) 50%, transparent);
}
#document_canvas.analysis.layout-style1 table.text_eng_kor tr:not(:last-child) td,
#document_canvas.analysis.layout-style2 table.text_eng_kor tr:not(:last-child) td,
#document_canvas.analysis.layout-style3 table.text_eng_kor tr:not(:last-child) td {
    border-bottom: 1px dashed color-mix(in srgb, var(--theme-color) 35%, transparent);
}
#document_canvas.analysis.layout-style1 table.text_eng_kor td.kor,
#document_canvas.analysis.layout-style2 table.text_eng_kor td.kor,
#document_canvas.analysis.layout-style3 table.text_eng_kor td.kor {
    background: color-mix(in srgb, var(--theme-color) 14%, white);
}

/* 출처 배지 (PDF SourceBadge 근사): style 계열에서 theme outline pill */
#document_canvas.layout-style1 .source-wrapper .source[contenteditable="true"],
#document_canvas.layout-style2 .source-wrapper .source[contenteditable="true"],
#document_canvas.layout-style3 .source-wrapper .source[contenteditable="true"] {
    display: inline-block;
    border: 1px solid var(--theme-color);
    border-radius: 12px;
    padding: 1px 12px;
    color: var(--theme-color);
    font-size: 0.82em;
    font-weight: 600;
    min-height: 0;
}

/* comprehensive: 지문/정답 박스를 둥근 theme 박스로, heading은 theme 배지로 */
/* 둥근 모서리가 보이려면 테두리를 td가 아닌 table에 둬야 한다 (analysis text_eng_kor와 동일 방식) */
#document_canvas.layout-style1 .bordered_box table,
#document_canvas.layout-style2 .bordered_box table,
#document_canvas.layout-style3 .bordered_box table {
    border: var(--box-border-width) solid var(--theme-color);
    border-collapse: separate;
    border-spacing: 0;
    border-radius: var(--box-radius);
    overflow: hidden;
}
#document_canvas.layout-style1 .bordered_box table td,
#document_canvas.layout-style2 .bordered_box table td,
#document_canvas.layout-style3 .bordered_box table td {
    border: none;
    background: white;  /* PDF style1 지문 박스는 흰 배경 + theme 둥근 외곽선 */
    padding: 8px 10px;
}
/* 여러 행(예: 스크램블 문제/정답)인 경우 행 사이 구분선 */
#document_canvas.layout-style1 .bordered_box table tr:not(:last-child) td,
#document_canvas.layout-style2 .bordered_box table tr:not(:last-child) td,
#document_canvas.layout-style3 .bordered_box table tr:not(:last-child) td {
    border-bottom: 1px solid color-mix(in srgb, var(--theme-color) 45%, transparent);
}
#document_canvas.layout-style1 .bordered_box .heading .text,
#document_canvas.layout-style2 .bordered_box .heading .text,
#document_canvas.layout-style3 .bordered_box .heading .text {
    background-color: var(--theme-color);
    color: var(--theme-text-color, white);
    border: none;
    border-radius: var(--heading-radius);
    font-family: var(--doc-title-font);
    font-weight: 700;
    padding: 3px 12px;
    margin-bottom: 4px;
}

/* paragraph: 컬럼 heading(h4)을 theme 배지로, 문서 컨테이너 테두리를 theme로 */
#document_canvas.paragraph.layout-style1 .column h4,
#document_canvas.paragraph.layout-style2 .column h4,
#document_canvas.paragraph.layout-style3 .column h4 {
    background-color: var(--theme-color);
    color: var(--theme-text-color, white);
    font-family: var(--doc-title-font);
    font-weight: 700;
}
#document_canvas.paragraph.layout-style1 .column h4 i,
#document_canvas.paragraph.layout-style2 .column h4 i,
#document_canvas.paragraph.layout-style3 .column h4 i {
    color: inherit;
}
#document_canvas.paragraph.layout-style1 .doc_canvas,
#document_canvas.paragraph.layout-style2 .doc_canvas,
#document_canvas.paragraph.layout-style3 .doc_canvas {
    border: 1px solid var(--theme-color);
    border-radius: var(--box-radius);
}

#purchase_detail_table .admin td {
    color: red;
}

#profile .admin * {
    color: red !important;
}

.hide {
    display: none;
}

/* 종합시험지 안내 문구 */
.all-typelist-description {
    padding: 8px 12px;
    font-size: 0.82em;
    color: #666;
    line-height: 1.55;
    border-bottom: 1px solid #e9ecef;
}

.all-typelist-description .desc-badge {
    display: inline-block;
    padding: 1px 7px;
    border: 1px solid #74c0fc;
    border-radius: 10px;
    font-size: 0.95em;
    background: #e6f3ff;
    color: #1c7ed6;
    font-weight: 500;
    white-space: nowrap;
}

/* 종합시험지 포함유형 chip UI */
.all-type-group-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 12px;
    border-bottom: 1px solid #f0f0f0;
}
.all-type-group-name {
    width: 68px;
    flex-shrink: 0;
    font-weight: 700;
    font-size: 0.8em;
    color: #868e96;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    padding-top: 4px;
    white-space: nowrap;
}
.all-type-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    flex: 1;
}
.chips-item-group {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.type-chip-input {
    display: none;
}
.type-chip-btn {
    display: inline-block;
    padding: 2px 9px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    font-size: 0.82em;
    cursor: pointer;
    background: #fff;
    color: #868e96;
    user-select: none;
    font-weight: 400;
    margin: 0;
    white-space: nowrap;
    transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.type-chip-btn:hover {
    background: #f1f3f5;
    border-color: #adb5bd;
    color: #495057;
}
.type-chip-input:checked + .type-chip-btn {
    background: #e6f3ff;
    border-color: #74c0fc;
    color: #1c7ed6;
    font-weight: 500;
}
.type-chip-input:checked + .type-chip-btn:hover {
    background: #d0ebff;
    border-color: #4dabf7;
}

/* 상세 페이지 섹션 레이아웃 */
.detail-section {
    margin-bottom: 22px;
}
.detail-section-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-weight: 600;
    font-size: var(--gin-fs);
    padding-bottom: 5px;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 10px;
}
.section-meta {
    font-weight: 400;
    font-size: 0.85em;
    color: #6c757d;
}

/* 다운로드 목록 */
/* 지인에듀 기본 자료: 미리보기만, 결제하면 전체 다운로드 (worksheet_detail.html, utils/starter_documents.py) */
.starter-locked-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px;
  background: #fff7e6; border: 1px solid #f3d9a4; color: #6b4a12; font-size: 14px; }
.starter-locked-note .btn { margin-left: auto; }
.download-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 6px 0 14px;
}
.download-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: #fafafa;
    text-decoration: none;
    color: inherit;
}
.download-item:hover { background: #f1f3f5; color: inherit; text-decoration: none; }
.download-item-zip .download-icon { color: #198754; font-size: 1.15em; flex-shrink: 0; }
.download-item-pdf .download-icon { color: #dc3545; font-size: 1.15em; flex-shrink: 0; }
/* 챕터북 동화 영상 (worksheet_detail.html): 표지 그림 작게 + 재생 표시 */
.download-video-poster { position: relative; flex-shrink: 0; width: 88px; aspect-ratio: 16 / 9; border-radius: 6px; overflow: hidden; background: #d6cdbe; }
.download-video-poster img { width: 100%; height: 100%; object-fit: contain; display: block; }
.download-video-poster i { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.5em;
                           text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); }
.download-filename { font-size: 0.9em; word-break: break-all; }
.download-badge { flex-shrink: 0; }
.download-preview-btn {
    flex-shrink: 0;
    font-size: 0.82em;
    color: #1c7ed6;
    padding: 1px 7px;
    border: 1px solid #74c0fc;
    border-radius: 3px;
    white-space: nowrap;
    text-decoration: none;
}
.download-preview-btn:hover { background: #e7f5ff; text-decoration: none; }
/* 파닉스 책 상세: 쪽 미리보기 (누르면 PDF 미리보기 창) */
.phonics-book-thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; margin-top: 8px; }
.phonics-book-thumbs img { width: 100%; border: 1px solid #dee2e6; border-radius: 4px; background: #fff; }

/* 상세 페이지 설정 섹션 카드 */
.detail-cfg-section {
    border: 1px solid #dee2e6;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}
.detail-cfg-section .table {
    margin-bottom: 0;
}
th.detail-cfg-section-title {
    background-color: #f1f3f5;
    font-weight: 600;
    padding: 5px 10px;
    letter-spacing: 0.02em;
    text-align: center;
    position: relative;  /* 오른쪽 '수정하기' 링크의 기준 (제목은 가운데 유지) */
}
/* 설정 섹션 제목 오른쪽 '수정하기' 링크 (수정 화면의 해당 탭으로 바로 이동) */
.cfg-section-edit-link {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.85em;
    font-weight: 500;
    color: #495057;
    text-decoration: none;
    white-space: nowrap;
}
.cfg-section-edit-link:hover {
    color: #212529;
    text-decoration: underline;
}
/* paragraph config 표 셀 */
.cfg-label-cell {
    vertical-align: middle;
    padding: 5px 15px;
    font-weight: 500;
    border-right: 1px solid #e9ecef;
    text-align: right;
}
.cfg-inputs-cell {
    padding: 4px 15px;
}
.cfg-number-input,
form .table.config-table td input.cfg-number-input {
    width: 50px;
    padding: 0;
    text-align: center;
}

/* 모의고사 유형 세트형: 조합 설명 · 직접 고르기 칩 (paragraph_set_picker.js) */
.paragraph-set-summary {
    font-size: 0.8em;
    color: #6c757d;
    font-weight: normal;
}
.paragraph-set-custom {
    margin-top: 6px;
}
.paragraph-set-custom-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
/* 같이 못 넣는 칩: 부트스트랩 btn-check:disabled(0.65)보다 흐리게 해야 고른 칩과 갈린다 */
.paragraph-set-custom-chips .btn-check:disabled + .paragraph-set-chip.is-blocked {
    opacity: 0.3;
    cursor: not-allowed;
}
.paragraph-set-custom-note {
    margin-top: 4px;
    font-size: 0.8em;
    color: #6c757d;
}

/* 상세/폼 공용 그룹 레이블 */
.cfg-unit-label {
    font-size: 0.85em;
    color: #6c757d;
    white-space: nowrap;
}
/* 새로 연 유형에 붙는 NEW 배지. 표시 여부는 constants의 `is_new`가 정하고(worksheet_form.js의
   new_badge_html), 여기서는 모양만 맡는다. **배경 없이 글자만 작게 반짝인다**: 설정 표는
   줄이 빽빽해서 색 블록을 넣으면 그 줄만 떠 보이고 정작 값 입력칸이 눈에 안 든다. */
.cfg-new-badge {
    display: inline-block;
    margin-left: 3px;
    font-size: 0.6em;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #ff6b35;
    vertical-align: 2px;
    animation: cfg-new-twinkle 1.8s ease-in-out infinite;
}
@keyframes cfg-new-twinkle {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .cfg-new-badge { animation: none; opacity: 1; }
}

.cfg-price-tag {
    font-size: 0.8em;
    color: #adb5bd;
    white-space: nowrap;
    line-height: 1;
}
/* 설정 섹션 제목 옆 도움말(?) 아이콘 (hover 시 bootstrap tooltip) */
.cfg-help-icon {
    color: #adb5bd;
    font-weight: 400;
    font-size: 0.9em;
    cursor: help;
}

/* config / print-config 표 공용 그룹 헤더 (form + detail 동일 패턴) */
.detail-cfg-group-header td {
    background: transparent;
    font-weight: 700;
    color: #868e96;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 10px 10px 2px;
    border-top: 1px solid #e9ecef;
}
.detail-cfg-group-header:first-child td {
    border-top: none;
    padding-top: 6px;
}
/* 예제 문제 보기 버튼 */
.btn-example-problem {
    background: none;
    border: none;
    color: #adb5bd;
    padding: 0 2px;
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
    transition: color 0.15s;
}
.btn-example-problem:hover {
    color: #495057;
}
/* 원서 · 챕터북 활동 이름에 마우스를 올리면 뜨는 예제 그림 (book_workbook_form.js setupActivityHoverPreview) */
.book-activity-hover {
    position: fixed;
    z-index: 1080;
    width: 420px;
    max-width: calc(100vw - 24px);
    padding: 8px;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    pointer-events: none;
}
.book-activity-hover.is-wide {
    width: 560px;
}
.book-activity-hover-title {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
}
.book-activity-hover img {
    display: block;
    width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
/* 챕터북 유아 활동: 예제 그림 카드를 눌러 넣고 뺀다 (book_workbook_form.js toddlerCardsHtml, 2026-10-21 사장님 '그림으로 고르게') */
.book-toddler-group + .book-toddler-group {
    margin-top: 14px;
}
.book-toddler-group-title {
    margin: 2px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--gin-ink-soft);
}
.book-toddler-group-title small {
    font-weight: 500;
    color: var(--gin-ink-muted);
}
.book-toddler-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 10px;
    padding: 4px 0;
}
.book-toddler-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 6px 8px;
    background: #fff;
    border: 2px solid var(--gin-line);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.book-toddler-card:hover {
    border-color: var(--gin-ink-muted);
}
.book-toddler-card:focus-visible {
    outline: 2px solid var(--gin-edit-border);
    outline-offset: 2px;
}
.book-toddler-card.active {
    border-color: var(--gin-edit-border);
    box-shadow: 0 0 0 2px var(--gin-edit-bg);
}
.book-toddler-card img,
.book-toddler-card-empty {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: top;
    border: 1px solid var(--gin-line-soft);
    border-radius: 6px;
    background: #fff;
}
.book-toddler-card-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gin-ink-muted);
    font-size: 24px;
}
.book-toddler-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    display: none;
    width: 24px;
    height: 24px;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--gin-edit-border);
    border-radius: 50%;
}
.book-toddler-card.active .book-toddler-card-check {
    display: flex;
}
.book-toddler-card-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--gin-ink);
    text-align: center;
}
.book-toddler-card-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 12px;
    color: var(--gin-ink-muted);
}
.book-toddler-card-count input {
    width: 56px;
}
/* 예제 문제 모달 이미지 */
.example-problem-img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e9ecef;
    border-radius: 4px;
}
td.detail-cfg-label {
    vertical-align: middle;
    width: 280px;
    font-weight: 500;
    padding: 2px 8px;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
}
td.detail-cfg-label.zero {
    color: #ddd;
    font-weight: 400;
}
td.detail-cfg-label.zero .cfg-unit-label {
    color: inherit;
}
td.detail-cfg-values {
    padding: 2px 10px;
}
.detail-cfg-value-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}
.detail-cfg-val {
    color: var(--gin-dark);
    font-weight: 400;
    word-break: break-all;
}
.detail-cfg-val.zero {
    color: #ddd;
}
.detail-cfg-sep {
    color: #ddd;
    user-select: none;
}
.detail-cfg-price {
    color: #adb5bd;
    font-size: 0.8em;
}
td.detail-cfg-desc {
    text-align: right;
    vertical-align: middle;
    font-weight: 500;
    padding: 2px 8px;
    border-right: 1px solid #e9ecef;
    white-space: nowrap;
    width: 280px;
}
.detail-cfg-color-swatch {
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 2px;
    border: 1px solid #ccc;
    vertical-align: middle;
    flex-shrink: 0;
}

/* layout_style 버튼 반짝이 애니메이션 */
@keyframes sparkle {
    0%, 100% {
        box-shadow: 0 0 4px rgba(255, 200, 0, 0.4), 0 0 8px rgba(255, 200, 0, 0.2);
        border-color: rgba(255, 180, 0, 0.5);
    }
    50% {
        box-shadow: 0 0 10px rgba(255, 200, 0, 0.8), 0 0 24px rgba(255, 180, 0, 0.4), 0 0 40px rgba(255, 160, 0, 0.2);
        border-color: rgba(255, 180, 0, 0.9);
    }
}
label.layout-style-sparkle {
    animation: sparkle 1.4s ease-in-out infinite;
}
/* ─── 문제지 생성 버튼 ─────────────────────────── */
.start-processing-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}
.start-processing-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--gin-fs);
    padding: 8px 20px;
    border-radius: 8px;
    font-weight: 500;
    transition: transform 0.1s ease, box-shadow 0.15s ease;
}
.start-processing-btn:not(.disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
}
.start-processing-btn:not(.disabled):active {
    transform: translateY(0);
    box-shadow: none;
}
.start-processing-help {
    font-size: var(--gin-fs-sm);
    color: var(--bs-gray-600);
}

.layout-style-hint {
    margin-top: 5px;
    font-size: 0.78em;
    color: #b8860b;
    animation: hint-fade 2.5s ease-in-out infinite;
}
@keyframes hint-fade {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}
/* 레이아웃 스타일 미리보기: 버튼에 마우스를 올리면 뜨는 첫 쪽 + [스타일 미리보기] 모아 보기 (print_config_widgets.js layout_style_preview_setup) */
.layout-style-preview-open { padding: 2px 0; margin-top: 2px; font-size: var(--gin-fs-sm); text-decoration: none; }
.layout-style-pop { position: fixed; z-index: 1080; width: 280px; padding: 8px; background: #fff; border: 1px solid var(--gin-line, #dee2e6);
    border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); pointer-events: none; }
.layout-style-pop img { display: block; width: 100%; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; border: 1px solid #eee; border-radius: 4px; }
.layout-style-pop-name { margin-top: 6px; text-align: center; font-size: var(--gin-fs-sm); font-weight: 600; }
.layout-style-gallery { position: fixed; inset: 0; z-index: 1080; display: flex; align-items: center; justify-content: center;
    padding: 16px; background: rgba(0, 0, 0, 0.45); }
.layout-style-gallery-box { width: min(1100px, 100%); max-height: 100%; overflow-y: auto; padding: 16px; background: #fff; border-radius: 12px; }
.layout-style-gallery-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 12px; }
.layout-style-gallery-head span { font-size: var(--gin-fs-sm); color: var(--bs-gray-600); }
.layout-style-gallery-head .btn-close { margin-left: auto; }
.layout-style-gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.layout-style-gallery-card { display: flex; flex-direction: column; gap: 6px; padding: 6px; background: #fff; border: 2px solid transparent;
    border-radius: 8px; font-size: var(--gin-fs-sm); font-weight: 600; }
.layout-style-gallery-card img { width: 100%; aspect-ratio: 210 / 297; object-fit: cover; object-position: top; border: 1px solid #e5e5e5; border-radius: 4px; }
.layout-style-gallery-card:hover { border-color: var(--bs-gray-400); }
.layout-style-gallery-card.is-current { border-color: var(--theme-color, #333); }
@media (max-width: 576px) {
    .layout-style-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
}
/* ───────── 옵션 미리보기 카드: 페이지 레이아웃(1열/2열), 글씨 크기 (section_order_widget.js) ───────── */
/* SVG 미리보기 + 라벨을 세로로 쌓되, btn-group 기본 세그먼트(붙은) 토글 형태는 유지 (간격 없음) */
.btn-group.page-layout-group > .btn.page-layout-option,
.btn-group.fontsize-group > .btn.fontsize-option,
.btn-group.page-number-group > .btn.page-number-option {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
}
/* 붙은 세그먼트지만 그룹 양 끝 모서리만 둥글게.
   btn-check 패턴이라 그룹 첫 자식은 라디오 input → 첫 라벨은 '.btn-check:first-child + .btn'으로 잡는다. */
.btn-group.page-layout-group > .btn-check:first-child + .btn.page-layout-option,
.btn-group.fontsize-group > .btn-check:first-child + .btn.fontsize-option,
.btn-group.page-number-group > .btn-check:first-child + .btn.page-number-option {
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
}
.btn-group.page-layout-group > .btn.page-layout-option:last-child,
.btn-group.fontsize-group > .btn.fontsize-option:last-child,
.btn-group.page-number-group > .btn.page-number-option:last-child {
    border-top-right-radius: 8px;
    border-bottom-right-radius: 8px;
}
label.page-layout-option .page-layout-preview,
label.fontsize-option .fontsize-preview,
label.page-number-option .page-number-preview {
    display: block;
    line-height: 0;
}
.page-layout-svg,
.page-number-svg {
    width: 30px;
    height: 38px;
    display: block;
}
.fontsize-svg {
    width: 38px;
    height: 38px;
    display: block;
}
label.page-layout-option .page-layout-label,
label.fontsize-option .fontsize-label,
label.page-number-option .page-number-label {
    font-size: 0.82em;
    font-weight: 600;
}
/* 상세 페이지(읽기전용) 인라인 표시 */
.detail-cfg-val.page-layout-readonly,
.detail-cfg-val.fontsize-readonly,
.detail-cfg-val.page-number-readonly {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.detail-cfg-val.page-layout-readonly .page-layout-svg,
.detail-cfg-val.page-number-readonly .page-number-svg {
    width: 16px;
    height: 20px;
}
.detail-cfg-val.fontsize-readonly .fontsize-svg {
    width: 20px;
    height: 20px;
}
/* 여러 옵션을 한 row에 묶는 콤보 행 (페이지 번호 + 페이지 레이아웃) */
.combined-option-row {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    align-items: flex-start;
}
.combined-option-group {
    display: flex;
    flex-direction: column;
}
.combined-option-label {
    font-size: 0.85em;
    font-weight: 600;
    color: #6c757d;
}
/* ───────── 섹션 구성 위젯 (section_order_widget.js, PDF 출력 설정) ───────── */
.section-order-widget {
    display: inline-flex;
    flex-direction: column;
    gap: 4px;
    min-width: 250px;
}
.section-order-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 8px;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    background: #fff;
    font-size: var(--gin-fs);
}
.section-order-item.sortable-ghost {
    opacity: 0.4;
    background: #e6f3ff;
    border-color: #74c0fc;
}
.section-order-drag-area {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: grab;
    touch-action: none; /* 모바일에서 드래그 영역 터치 시 페이지 스크롤 방지 */
}
.section-order-handle {
    color: #adb5bd;
    padding: 2px 4px;
}
.section-order-btns {
    display: flex;
    gap: 2px;
}
.section-order-btns button {
    border: none;
    background: none;
    padding: 4px 6px;
    color: #495057;
    border-radius: 4px;
    line-height: 1;
}
.section-order-btns button:hover {
    background: #e9ecef;
}
.section-order-item.section-order-hidden {
    background: #f1f3f5;
    color: #adb5bd;
}
.section-order-item.section-order-hidden .section-order-label {
    text-decoration: line-through;
}
/* 생성 안 된(0문제) 섹션은 목록에서 숨긴다 (comprehensive). DOM에는 남아 데이터는 보존됨. */
.section-order-item.section-order-unavailable {
    display: none;
}
/* 순서 고정 섹션 (내용이해의 삽화·지문): 드래그/이동 불가, 출력 여부만 바꿀 수 있다 */
.section-order-item.section-order-fixed {
    background: #f8f9fa;
    border-style: dashed;
}
.section-order-item.section-order-fixed .section-order-drag-area {
    cursor: default;
}
.section-order-item.section-order-fixed .section-order-handle {
    color: #ced4da;
}
.section-order-footer {
    margin-top: 2px;
}
.section-order-reset {
    border: none;
    background: none;
    color: #868e96;
    font-size: var(--gin-fs-sm);
    padding: 2px 6px;
    border-radius: 4px;
}
.section-order-reset:hover {
    background: #e9ecef;
    color: #495057;
}
/* ───────── analysis 삽화 옵션 UI (worksheet_form) ───────── */
.illustration-onoff-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.illustration-panel {
    margin-top: 10px;
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    background: #fafbfc;
}
.illustration-lang-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.illustration-row-label {
    font-weight: 600;
    font-size: 0.9em;
}
.illustration-lang-hint {
    font-size: 0.82em;
    color: #adb5bd;
}
.illustration-lang-disabled {
    opacity: 0.45;
    pointer-events: none;
}
.illustration-style-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}
@media (max-width: 900px) {
    .illustration-style-cards { grid-template-columns: repeat(2, 1fr); }
}
.illustration-style-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin: 0;
    padding: 8px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.illustration-style-card:hover {
    border-color: #adb5bd;
}
.illustration-style-card.selected {
    border-color: #4dabf7;
    background: #e6f3ff;
    box-shadow: 0 0 0 3px rgba(28, 126, 214, 0.12);
}
.illustration-style-card.selected .illustration-style-label {
    color: #1c7ed6;
}
.illustration-style-card.selected::after {
    content: '✓';
    position: absolute;
    top: -9px;
    right: -9px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1c7ed6;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}
.illustration-style-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.illustration-style-thumb {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #f1f3f5;
    background: #f8f9fa;
}
.illustration-zoom-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(28, 126, 214, 0.92);
    color: #fff;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
    /* 평소엔 숨기고, 카드에 마우스를 올렸을 때만 표시 */
    opacity: 0;
    transition: opacity 0.15s ease;
}
.illustration-style-card:hover .illustration-zoom-btn {
    opacity: 1;
}
.illustration-zoom-btn:hover {
    background: #1567b8;
}
.illustration-example-img {
    max-width: 100%;
    border: 1px solid #e9ecef;
    border-radius: 6px;
}
.illustration-style-label {
    margin-top: 5px;
    font-weight: 600;
    font-size: 0.92em;
}
.illustration-style-desc {
    font-size: 0.8em;
    color: #868e96;
    line-height: 1.3;
}

/* ───────── 옵션 선택 줄 (칩) ─────────
   [라벨] [칩][칩]... 형태의 옵션 선택 UI. 삽화 재생성 피커(스타일/언어)와 비교 모달의
   '적용할 시험지' 선택이 같은 톤을 쓰도록 공용 클래스로 둔다 (한 곳에서만 정의). */
.picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.picker-label {
    font-weight: 600;
    color: #495057;
}
.picker-chip {
    padding: 4px 10px;
    border: 1px solid #ced4da;
    border-radius: 14px;
    background: #fff;
    cursor: pointer;
    font-size: 0.92em;
    line-height: 1.2;
}
.picker-chip:hover {
    border-color: #adb5bd;
}
.picker-chip.selected {
    border-color: #74c0fc;
    background: #e6f3ff;
    color: #1c7ed6;
    font-weight: 600;
}
.picker-chip.selected:hover {
    background: #d0ebff;
    border-color: #4dabf7;
}
.picker-chip:disabled {
    opacity: 0.45;
    cursor: default;
}
/* 여러 개를 고를 수 있는 칩 (단일 선택 칩과 구분되게 선택된 것에 체크 표시) */
.picker-chip--multi.selected::before {
    content: '✓ ';
    font-weight: 700;
}

/* ───────── analysis 삽화 재생성 피커 (worksheet_edit_document) ───────── */
.illustration-regen-picker {
    margin: 8px 0 12px;
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #fafbfc;
    font-size: 0.9em;
}
.illustration-regen-picker .picker-footer {
    margin-bottom: 0;
    margin-top: 10px;
    justify-content: flex-end;
}

/* 문장 분리 미리보기 (gin_shared.js renderSplitSentences). 인접 문장을 사이트 테마색으로
   번갈아 칠해 어디서 나뉘었는지 보여준다. 색은 변형 클래스(--a/--b)에서만 정의. */
.gin-sentence--a { color: var(--gin-sentence-a); }  /* 검정 */
.gin-sentence--b { color: var(--gin-sentence-b); }  /* 파랑 */
/* 문장 번호: absolute로 띄워 flow에서 빼므로 원문 텍스트 배열(가로/세로)에 전혀 영향이 없다.
   각 문장의 시작 글자 위에 테두리 박스로 겹쳐 표시. 색/테두리는 문장 색(currentColor)을 따름. */
.gin-sentence { position: relative; }
.gin-sentence__num {
    position: absolute;
    left: -1px;
    top: 2px;
    font-size: 0.72em;
    font-weight: 700;
    line-height: 1.3;
    border: 1.5px solid currentColor;
    border-radius: 3px;
    padding: 0 2px;
    background: rgba(255, 255, 255, 0.75);  /* 글자가 살짝 비치는 반투명 흰 배경 */
    pointer-events: none;
}

/* 지문 보기 스위치 (gin_shared.js makeViewToggle). '문장별 | 원문' 세그먼트 토글. */
.passage-view-toggle {
    display: inline-flex;
    margin-left: 8px;
    vertical-align: middle;
    border: 1px solid var(--gin-dark);
    border-radius: 4px;
    overflow: hidden;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.4;
    user-select: none;
    cursor: pointer;
}
.passage-view-toggle .pv-opt {
    padding: 1px 7px;
    color: var(--gin-dark);
    background: #fff;
    white-space: nowrap;
}
.passage-view-toggle .pv-opt + .pv-opt {
    border-left: 1px solid var(--gin-dark);
}
.passage-view-toggle .pv-opt.active {
    background: var(--gin-dark);
    color: #fff;
}

/* 마침표 뒤 공백 누락 경고 (gin_shared.js markNoSpaceAfterPeriod). 두 문장이 한 문장으로
   합쳐질 위험이 있는 '.대문자' 부분을 빨갛게 강조. */
.gin-warn-nospace {
    background-color: var(--gin-warn-bg);
    color: var(--gin-warn-fg);
    font-weight: 700;
    border-radius: 2px;
    padding: 0 1px;
    /* 빨간 박스 테두리. box-shadow(inset)라 줄 높이에 영향 없고, 안쪽에 그려 위/아래 줄 안 침범. */
    box-shadow: inset 0 0 0 1px var(--gin-warn-fg);
}

/* 경고 있는 행의 데이터 셀 배경(노랑). 인라인 대신 클래스로 둬서 선택 상태에 따라 색을 바꾼다
   (인라인이면 선택 오버레이를 덮어 표시가 안 됨). 엑셀/jexcel과 동일하게:
   - 메인(활성) 선택 셀(.highlight-selected): 흰색 대응 = 원래 노랑 그대로
   - 선택 범위 내 다른 셀(.highlight): 회색 대응 = 짙은 노랑
   .highlight-selected 규칙을 .highlight 뒤에 둬서, 둘 다 가진 메인 셀은 원래 노랑이 되게 한다
   (jexcel css가 .highlight-selected를 .highlight 뒤에 두는 것과 동일 원리). */
.jexcel td.gin-warn-cell {
    background-color: var(--gin-warn-row-bg);
}
.jexcel td.gin-warn-cell.highlight,
.jexcel td.gin-warn-cell.selection {
    background-color: var(--gin-warn-row-bg-range);
}
.jexcel td.gin-warn-cell.highlight-selected {
    background-color: var(--gin-warn-row-bg);
}
/* '번호 제거' 버튼 아이콘: 채워진 동그라미 숫자(❶, 검정 바탕+흰 숫자) 위에 굵은 빨간 X를 겹침.
   첫 아이콘이 박스 크기를 정하고, X는 중앙에 absolute로 겹쳐 약간 키우고 stroke로 굵게. */
.gin-stacked-icon {
    position: relative;
    display: inline-block;
    line-height: 1;
    vertical-align: -0.125em;
}
.gin-stacked-icon .bi-x {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(1.25);
    color: var(--gin-warn-fg);
    -webkit-text-stroke: 1.2px var(--gin-warn-fg);  /* X를 더 두껍게 */
    text-stroke: 1.2px var(--gin-warn-fg);
}

/* 경고 행 '헤더'(지문 N): 평소 노랑, 그 행에 선택 셀이 있으면(tr.selected) 짙은 노랑.
   행 헤더는 .highlight를 안 받으므로 활성셀 여부와 무관하게, 선택된 셀이 있는 행이면 무조건 짙게
   (jexcel 기본: tr.selected td:first-child=#dcdcdc). jexcel 기본 규칙(#f3f3f3 / #dcdcdc)보다
   우선하도록 jexcel_row 클래스까지 명시해 specificity를 높인다. */
.jexcel > tbody > tr > td.jexcel_row.gin-warn-cell {
    background-color: var(--gin-warn-row-bg);
}
.jexcel > tbody > tr.selected > td.jexcel_row.gin-warn-cell {
    background-color: var(--gin-warn-row-bg-range);
}

/* 행번호 '지문 N' 아래 부가표시 (gin_shared.js updatePassageRowHeader): (N문장) + 경고 물음표.
   display:block 으로 '지문 N' 다음에 줄바꿈되어 아래 줄에 표시된다. */
.gin-row-anno {
    display: block;
    margin-top: 2px;
    font-size: 0.82em;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;  /* 클릭은 행 헤더(td)로 통과시켜 행 선택/커서 일관 유지 */
}
.gin-row-count {
    color: #868e96;  /* 문장 수: 차분한 회색 */
}
.gin-row-count--warn {  /* 문장 수가 부족해 문제인 경우: 빨강 굵게 */
    color: var(--gin-warn-fg);
    font-weight: 700;
}
/* 지문 미리보기 콘텐츠 래퍼. 내부 <br>은 셀의 점선 br 비주얼을 해제하고 일반 줄바꿈으로. */
.spreadsheet .jexcel .gin-passage-cell br {
    display: inline;
    margin: 0;
    border: 0;
}
/* 영어 지문 셀은 텍스트가 .gin-passage-cell span으로 감싸여 있어, 그 위를 드래그하면 이벤트가 span에
   걸려 jexcel의 셀 드래그 선택(td 기준)이 안 잡혔다(텍스트 위=안됨, 빈 부분=됨). 마우스 이벤트를
   td로 통과시켜 텍스트 위에서도 셀 드래그가 되게 한다 (편집은 td 더블클릭이라 그대로 동작). */
.spreadsheet .jexcel .gin-passage-cell { pointer-events: none; }
/* 지문 내 줄바꿈마다 개행문자 ↵를 빨갛게 표시 (gin_shared.js newlineMarks).
   마침표-공백 하이라이트와 동일한 빨간 배경+테두리(기호라 폰트 축소, inset). ↵는 실제 줄바꿈
   위치에만 나오므로 인라인이어도 소프트 워드랩에는 영향이 없다. */
.gin-newline {
    background-color: var(--gin-warn-bg);
    color: var(--gin-warn-fg);
    font-weight: 700;
    font-size: 0.8em;
    line-height: 1;
    border-radius: 2px;
    padding: 0 1px;
    box-shadow: inset 0 0 0 1px var(--gin-warn-fg);
}
/* 경고 물음표(진한 노랑). (N문장) 오른쪽에 인라인으로. */
.gin-warn-rowq {
    margin-left: 3px;
    color: var(--gin-warn-q);
    cursor: help;
    pointer-events: auto;  /* 안내 콘텐츠는 통과시키되, 이 아이콘만 호버 툴팁 동작 */
}

/* ============================================================
   지문 DB 사이드 패널 (passage_database_panel.js, worksheet_form 전용)
   .pdb-split: 좌측 패널 + 우측 jExcel 그리드 flex 레이아웃
   ============================================================ */
.pdb-split {
    display: flex;
    align-items: flex-start;
    gap: 5px;  /* 리사이저 핸들 좌우 여백 (양쪽에 적용되므로 작게) */
}
.pdb-split .pdb-grid-col {
    flex: 1;
    min-width: 0;  /* 그리드가 남은 폭 안에서만 그려지게 */
}
/* 패널 하단 높이 조절 핸들 (드래그, passage_database_panel.js) */
#passage_database_panel .pdb-vresizer {
    flex-shrink: 0;
    height: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: row-resize;
    background: #f1f3f5;
    border-radius: 0 0 10px 10px;  /* 패널 하단 모서리에 맞춤 */
    color: #adb5bd;
    font-size: 10px;
    line-height: 1;
    user-select: none;
}
#passage_database_panel .pdb-vresizer:hover,
#passage_database_panel .pdb-vresizer.dragging {
    background: #cfe2ff;
    color: #0d6efd;
}

/* 패널-그리드 사이 폭 조절 핸들 (드래그, passage_database_panel.js) */
.pdb-resizer {
    flex-shrink: 0;
    align-self: stretch;
    width: 8px;
    margin: 5px 0;
    border-radius: 4px;
    cursor: col-resize;
    background: #f1f3f5;  /* 기본에도 살짝 보이게 (드래그 가능함을 암시) */
}
.pdb-resizer:hover,
.pdb-resizer.dragging {
    background: #cfe2ff;
}
/* 핸들 중앙의 ⋮ 그립 점: 세로 리사이저(pdb-vresizer)의 ⋯ 점과 같은 문법.
   세로로 긴 핸들에서 스크롤해도 화면 중앙쯤에 따라온다 */
.pdb-resizer-grip {
    position: sticky;
    top: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 8px;  /* 핸들 바 폭에 맞춤 */
    color: #adb5bd;
    font-size: 10px;
    line-height: 1;
    pointer-events: none;  /* 드래그 이벤트는 핸들 바가 받는다 */
}
.pdb-resizer:hover .pdb-resizer-grip,
.pdb-resizer.dragging .pdb-resizer-grip {
    color: #0d6efd;
}
/* 입력 그리드 아래의 큼직한 저장 버튼 (worksheet_save_bottom_btn.html) */
.worksheet-save-bottom-btn {
    display: block;
    width: 100%;
    margin: 14px 0 5px;
}
#passage_database_panel {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    width: 400px;
    height: 600px;
    border: 1px solid #dee2e6;
    border-radius: 10px;
    background: #fff;
    margin: 0 0 5px 0;  /* 상단·좌측 타이트하게 붙임 */
    /* 그리드를 깊이 스크롤해도 패널이 따라온다 (sticky 툴바 스택 바로 아래) */
    position: sticky;
    top: calc(var(--sticky-header-top, 108px) + 6px);
}
/* 접힌 상태의 세로 레일 (서랍 손잡이). 그리드 세로 길이만큼 늘어나 어디서든 클릭 가능.
   button이 아닌 div[role=button]인 이유: button 내부에서는 position: sticky가 안 먹혀 라벨 고정 불가 */
.pdb-rail {
    box-sizing: border-box;
    flex-shrink: 0;
    align-self: stretch;
    width: var(--gin-rail-width);
    padding: 10px 0;
    margin: 0;  /* 상하·좌우 타이트: stretch로 그리드 열(행추가 버튼 포함) 높이에 맞춰 아래 border까지 정렬 */
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: var(--gin-rail-bg);
    color: #495057;
    text-align: center;
    user-select: none;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.pdb-rail:hover {
    background: #e9ecef;
    border-color: var(--gin-dark);
    color: var(--gin-dark);
}
.pdb-rail[hidden] {
    display: none;
}
/* 라벨(펼침 셰브런 + 아이콘 + 세로 텍스트)은 스크롤해도 화면에 따라온다 */
.pdb-rail-label {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    position: sticky;
    top: calc(var(--sticky-header-top, 108px) + 14px);
    font-size: var(--gin-fs-sm);
    font-weight: 600;
}
/* 패널 헤더의 '내 DB 관리' 링크 (내 정보 > 내 지문 DB 새 창) */
.pdb-manage-link {
    font-size: var(--gin-fs-xs);
    color: #868e96;
    text-decoration: none;
    white-space: nowrap;
}
.pdb-manage-link:hover {
    color: var(--gin-dark);
    text-decoration: underline;
}
/* 패널 헤더의 접기 버튼 (레일의 펼침 셰브런과 짝) */
.pdb-collapse-btn {
    border: none;
    background: none;
    padding: 3px 7px;
    border-radius: 6px;
    color: #868e96;
    cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.pdb-collapse-btn:hover {
    background: #e9ecef;
    color: var(--gin-dark);
}
.pdb-rail-text {
    /* 책등처럼 문구 전체를 90도 회전 (글자를 한 자씩 쌓는 것보다 정돈돼 보인다) */
    writing-mode: vertical-rl;
    text-orientation: sideways;
    letter-spacing: 1px;
}
/* 참고: text-orientation: sideways는 줄 전체(아이콘 포함)를 눕히므로 아이콘에 별도 회전 불필요 */
#passage_database_panel[hidden] {
    display: none;
}
/* 지문 DB에서 추가된 그리드 행 하이라이트 번쩍 (잠깐 노랗게 들어왔다 서서히 사라짐) */
@keyframes pdb-row-flash {
    0% { background-color: #fff3bf; }
    55% { background-color: #fff3bf; }
    100% { background-color: transparent; }
}
.jexcel tbody tr.pdb-row-flash > td {
    animation: pdb-row-flash 1.8s ease-out;
}
#passage_database_panel .pdb-panel-header {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #f1f3f5;
    flex-shrink: 0;
}
/* 1행: 제목 + 접기 버튼 (접기 버튼은 항상 우상단) */
#passage_database_panel .pdb-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
/* 2행: 공용/내 DB 토글 + 내 DB 관리 (아주 좁으면 관리 링크가 아래로 wrap) */
#passage_database_panel .pdb-header-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px 8px;
    flex-wrap: wrap;
}
/* 공용 DB / 내 DB 토글: 시트 헤더의 작은 토글(10px)보다 크게, 헤더 타이틀과 어울리는 크기 */
#pdb_scope_toggle {
    font-size: var(--gin-fs-xs);
}
#pdb_scope_toggle .pv-opt {
    padding: 3px 10px;
}
#passage_database_panel .pdb-panel-title {
    font-weight: 700;
    color: var(--gin-dark);
}
#passage_database_panel .pdb-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

#passage_database_panel .pdb-loading,
/* 빈 폴더 안내: 목록 컨테이너 안 '상위 폴더로' 행 아래(항목 자리)에 표시 */
#passage_database_panel .pdb-empty {
    padding: 26px 12px;
    text-align: center;
    color: #868e96;
    font-size: var(--gin-fs-sm);
}
/* 상단: 브레드크럼 + 검색 (좁은 패널이라 세로 스택) */
/* breadcrumb 줄: 스크롤해도 항상 상단에 고정 (body 패딩을 상쇄해 가장자리까지 흰 배경) */
#passage_database_panel .pdb-topbar {
    position: sticky;
    top: -12px;
    z-index: 3;
    background: #fff;
    margin: -12px -14px 10px;
    padding: 12px 14px 6px;
    border-bottom: 1px solid #f1f3f5;
}
/* breadcrumb은 줄바꿈 없이 한 줄: 좁으면 중간 경로부터 축약(…)되고,
   최상위(전체)와 맨 오른쪽(현재 항목)은 최대한 온전히 보인다 */
#passage_database_panel .pdb-breadcrumb {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap;
    min-width: 0;
    font-size: var(--gin-fs-sm);
}
#passage_database_panel .pdb-breadcrumb-link {
    color: #495057;
    text-decoration: none;
}
#passage_database_panel .pdb-breadcrumb-link,
#passage_database_panel .pdb-breadcrumb-current {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* 축약 우선순위: 중간 항목(shrink 1000)이 먼저 아이콘+… 수준까지 줄고,
   그래도 모자라면 현재 항목(shrink 1)이 줄어든다. 루트(전체)는 고정 */
#passage_database_panel .pdb-breadcrumb-link:first-child {
    flex-shrink: 0;
}
#passage_database_panel .pdb-breadcrumb-link:not(:first-child) {
    flex-shrink: 1000;
    min-width: 30px;  /* 아이콘 + … 자리는 남긴다 (클릭 가능 유지) */
}
#passage_database_panel .pdb-breadcrumb-link:hover {
    color: var(--gin-dark);
    text-decoration: underline;
}
#passage_database_panel .pdb-breadcrumb-current {
    font-weight: 700;
    color: var(--gin-dark);
    flex-shrink: 1;
    min-width: 0;
}
#passage_database_panel .pdb-breadcrumb-sep {
    font-size: var(--gin-fs-xs);
    color: #adb5bd;
    flex-shrink: 0;
}

/* '상위 폴더로' (탐색기의 '..'): 목록의 첫 행이되, 실제 폴더명과 구분되게
   화살표 아이콘 + 회색 톤 + 연한 배경으로 표시 */
#passage_database_panel .pdb-up-card {
    background: #f8f9fa;
}
#passage_database_panel .pdb-up-card .pdb-folder-name {
    color: #6c757d;
    font-weight: 500;  /* 실제 폴더명(700)보다 가볍게 */
}
/* 루트에서는 항상 같은 자리에 비활성 상태("최상위 폴더입니다")로 유지 */
#passage_database_panel .pdb-up-card--disabled {
    cursor: default;
    opacity: 0.55;
    pointer-events: none;  /* 클릭해도 리프레시 등 아무 동작 없음 */
}
#passage_database_panel .pdb-up-card--disabled:hover {
    border-color: #dee2e6;
    background: #f8f9fa;
}
/* 폴더 리스트 (좁은 패널이라 세로 리스트) */
#passage_database_panel .pdb-folder-list {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;  /* 행 배경이 둥근 모서리 밖으로 안 나가게 */
}
#passage_database_panel .pdb-folder-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 9px 12px;
    border-bottom: 1px solid #f1f3f5;
    text-decoration: none;
    background: #fff;
}
#passage_database_panel .pdb-folder-card:last-child {
    border-bottom: none;
}
#passage_database_panel .pdb-folder-card:hover {
    background: #f8f9fa;
}
#passage_database_panel .pdb-folder-name {
    font-weight: 600;
    color: var(--gin-dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
#passage_database_panel .pdb-folder-name .bi {
    margin-right: 2px;
}
#passage_database_panel .pdb-folder-count {
    font-size: var(--gin-fs-xs);
    color: #868e96;
    flex-shrink: 0;
}
/* 유형별 일괄선택 버튼 */
#passage_database_panel .pdb-bulk-select {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
    /* 스크롤 시 sticky topbar 바로 아래에 고정 (top 값은 JS가 topbar 실측 높이로 지정) */
    position: sticky;
    z-index: 2;
    background: #fff;
    margin: 0 -14px 8px;
    padding: 6px 14px;
    border-bottom: 1px solid #f1f3f5;
}
/* 전체 선택 <-> 전체 해제 토글 (edit_document '문제 목록' 헤더와 동일 UX) */
#passage_database_panel .pdb-select-all-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 5px;
    font-size: var(--gin-fs-sm);
    font-weight: 600;
    color: var(--gin-dark);
    cursor: pointer;
    user-select: none;
}
#passage_database_panel .pdb-select-all-toggle:hover {
    background: #f1f3f5;
}
#passage_database_panel .pdb-select-all-toggle .group-check {
    font-size: 15px;
}
#passage_database_panel .pdb-bulk-select .btn {
    --bs-btn-padding-y: 4px;
    --bs-btn-padding-x: 11px;
    --bs-btn-font-size: var(--gin-fs-sm);
}
/* 지문 아코디언 리스트 */
#passage_database_panel .pdb-passage-list {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
}
#passage_database_panel .pdb-passage-item {
    border-bottom: 1px solid #f1f3f5;
}
#passage_database_panel .pdb-passage-item:last-child {
    border-bottom: none;
}
#passage_database_panel .pdb-passage-item.checked {
    background: var(--gin-edit-bg);
}
#passage_database_panel .pdb-passage-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    cursor: pointer;
    user-select: none;  /* shift 범위선택 시 텍스트 선택 방지 */
}
#passage_database_panel .pdb-passage-row:hover {
    background: #f8f9fa;
}
#passage_database_panel .pdb-passage-checkbox {
    margin-top: 3px;
    flex-shrink: 0;
    /* 표시 전용: 클릭/드래그 체크는 행(mousedown)에서 처리, 자체 토글로 어긋나지 않게 차단 */
    pointer-events: none;
}
#passage_database_panel .pdb-passage-info {
    min-width: 0;
    flex: 1;
}
#passage_database_panel .pdb-passage-head {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
#passage_database_panel .pdb-passage-source {
    font-weight: 700;
    color: var(--gin-dark);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#passage_database_panel .pdb-type-badge {
    background: #e7f5ff;
    color: #1971c2;
    font-weight: 600;
}
#passage_database_panel .pdb-passage-sub {
    font-size: var(--gin-fs-xs);
    color: #868e96;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
#passage_database_panel .pdb-passage-first-sentence {
    font-size: var(--gin-fs-xs);
    color: #495057;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
/* 모바일: 옆에 설 자리가 없으니 그리드 위를 덮는 오버레이로 전환 */
@media (max-width: 768px) {
    #passage_database_panel {
        position: fixed;
        left: 10px;
        right: 10px;
        top: 70px;
        bottom: 10px;
        width: auto;
        height: auto;
        z-index: 1050;
        margin: 0;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    }
}

/* ============================================================
   그리드 툴바 (worksheet_grid_toolbar.html)
   행 개수/추가/undo/redo와 타입별 그리드 조작 버튼을 탭 라벨과 같은 줄
   (그리드 바로 위)에 표시한다. 상단 form-toolbar에는 제목/저장만 남음.
   sticky 스택: form-toolbar(top:0) -> nav-tabs(그리드 툴바) -> jexcel 컬럼 헤더.
   오프셋은 worksheet_form.js의 update_sticky_header_top()이 실측해 CSS 변수로
   갱신한다 (--sticky-grid-toolbar-top, --sticky-header-top. 툴바가 여러 줄로
   감기는 좁은 화면 대응). 표 헤더 top은 기존 .spreadsheet.with-custom-toolbar
   규칙(--sticky-header-top)이 그대로 담당한다.
   ============================================================ */
.grid-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-left: auto;
    padding: 0 0 6px 8px;  /* 우측 0: 마지막 버튼(번호 제거 등) 오른쪽이 그리드 오른쪽 끝과 정렬 */
}
/* worksheet_form 전용 (worksheet_detail의 nav-tabs는 sticky 아님) */
.nav-tabs.grid-toolbar-tabs {
    position: sticky;
    top: var(--sticky-grid-toolbar-top, 52px);
    z-index: 9;
    background: #fff;
    align-items: flex-end;
}

/* worksheet_form: '한 문장당 최대 문제 수'(grammar) 옵션 예시 박스 */
.max-problems-example {
    margin-top: 6px;
    padding: 6px 10px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85em;
    color: #495057;
    max-width: 560px;
}
.max-problems-example-label {
    font-weight: 600;
    color: #6c757d;
    margin-right: 4px;
}
.max-problems-example-note {
    color: #868e96;
}

/* ============================================================
   이동 드롭다운 메뉴 (공용): worksheet 탐색기 '이동 ▾'와 지문 DB 탐색기 '이동 ▾'가 함께 쓴다.
   렌더링 로직은 gin_shared.js의 Gin.renderMoveMenu (데이터 접근자만 주입).
   ============================================================ */
.gin-move-wrap { position: relative; display: inline-flex; }
.gin-move-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;  /* 항상 '이동' 버튼 왼쪽에 맞춰 정렬 (오른쪽으로 펼침) */
    min-width: 200px;
    max-height: 320px;
    overflow-y: auto;
    z-index: 100;
    background: #fff;
    color: #212529;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
    padding: 4px;
}
.gin-move-menu-item {
    display: flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 6px;
    cursor: pointer;
    white-space: nowrap;
    font-size: 0.85rem;
}
.gin-move-menu-item > i.bi { margin-right: 5px; flex: none; }
.gin-move-menu-item > i.bi-folder-fill { color: #ffc107; }  /* 트리와 동일한 노란 폴더 아이콘 */
.gin-move-menu-item:hover { background: #e9ecef; }
/* 이동 메뉴 트리 가이드선 (flat 목록이라 깊이별 가이드 셀을 직접 그림).
   guide 셀은 align-self:stretch여도 메뉴 항목의 content box(패딩 안쪽)까지만 늘어나므로,
   세로획을 항목 세로 패딩(6px)만큼 위아래로 더 빼(top/bottom -7px) 항목 경계를 넘겨 이어지게 한다.
   위치는 정수(7px)로 고정해 반픽셀 흐림도 방지. */
.gin-move-guide { position: relative; width: 15px; flex: none; align-self: stretch; }
.gin-move-guide.cont::before {  /* 조상 레벨: 이어지는 형제 있으면 세로선 */
    content: ''; position: absolute; left: 7px; top: -7px; bottom: -7px;
    border-left: 1px solid #d6dbe0;
}
.gin-move-guide.branch::before {  /* 분기 셀 세로획: 기본은 tee(위->아래) */
    content: ''; position: absolute; left: 7px; top: -7px; bottom: -7px;
    border-left: 1px solid #d6dbe0;
}
.gin-move-guide.branch.last::before {  /* 마지막: 코너 (위->중앙까지만) */
    bottom: auto; height: calc(50% + 7px);
}
.gin-move-guide.branch::after {  /* 분기 셀 가로획(중앙->오른쪽) */
    content: ''; position: absolute; left: 7px; top: 50%; width: 8px;
    border-top: 1px solid #d6dbe0;
}
/* 선택 개수 라벨 (worksheet 탐색기 / 지문 DB 탐색기 툴바 공용) */
.gin-sel-count { font-weight: 600; color: #212529; }

/* ============================================================
   조합하여 만들기 검색 패널: 모바일 단일 pane 흐름
   데스크톱은 3열 그리드 그대로. 모바일(<=767px)에서는 한 번에 하나만 보여준다.
   1=워크시트 목록 -> (워크시트 선택) -> 2=문제 목록 -> (문제의 화살표) -> 3=문제 미리보기.
   단계 값은 JS(worksheet_edit_document.js)가 .search_panel[data-mobile-step]에 넣는다.
   ============================================================ */
.search-pane-back {
    display: none;  /* 데스크톱에서는 3개가 동시에 보이므로 뒤로 버튼이 필요 없다 */
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 6px;
    padding: 1px 7px;
    margin-right: 2px;
    line-height: 1.2;
}
.search-pane-back:hover { background: #e9ecef; color: #212529; }

@media (max-width: 767px) {
    #worksheet_edit_document .search_panel_body { grid-template-columns: 1fr; }
    #worksheet_edit_document .search-pane-back { display: inline-flex; align-items: center; }
    /* 현재 단계가 아닌 pane은 숨긴다 */
    #worksheet_edit_document .search_panel[data-mobile-step="1"] .search_panel_documents,
    #worksheet_edit_document .search_panel[data-mobile-step="1"] .search_panel_preview,
    #worksheet_edit_document .search_panel[data-mobile-step="2"] .search_panel_worksheets,
    #worksheet_edit_document .search_panel[data-mobile-step="2"] .search_panel_preview,
    #worksheet_edit_document .search_panel[data-mobile-step="3"] .search_panel_worksheets,
    #worksheet_edit_document .search_panel[data-mobile-step="3"] .search_panel_documents { display: none; }
    /* 목록/미리보기 높이: 고정 px 대신 화면 비율로 (모바일 화면이 짧아 600px는 넘침) */
    #worksheet_edit_document .search_panel_body .search_panel_col .body,
    #worksheet_edit_document .search_panel_body .search_panel_documents_body { height: 62vh; }
}

/* ============================================================
   paragraph 편집 캔버스: 모바일 단일 pane 흐름 (검색 패널과 동일 패턴)
   데스크톱은 2열(출제 구성 | 문제 및 해설) 그대로. 모바일(<=767px)에서는 한 번에 하나만.
   1=출제 구성·순서 조정 -> (문제의 → 버튼) -> 2=문제 및 해설.
   단계 값은 edit_document_paragraph.js가 .doc_canvas[data-mobile-step]에 넣는다.
   ============================================================ */
.doc-pane-back {
    display: none;  /* 데스크톱은 두 컬럼이 동시에 보이므로 뒤로 버튼이 필요 없다 */
    border: 1px solid #dee2e6;
    background: #fff;
    color: #495057;
    border-radius: 6px;
    padding: 1px 7px;
    margin-right: 6px;
    line-height: 1.2;
}
.doc-pane-back:hover { background: #e9ecef; color: #212529; }

@media (max-width: 767px) {
    #document_canvas.paragraph .doc-pane-back { display: inline-flex; align-items: center; }
    /* 현재 단계가 아닌 컬럼은 숨긴다 (남은 컬럼이 flex:1/2 비율과 무관하게 전체 폭을 쓰도록) */
    #document_canvas.paragraph .doc_canvas[data-mobile-step="1"] .content_column,
    #document_canvas.paragraph .doc_canvas[data-mobile-step="2"] .ordering_column { display: none; }
    #document_canvas.paragraph .doc_canvas > .column { flex: 1 1 100%; }
    /* 컬럼 구분선은 한 컬럼만 보일 때 의미가 없다 */
    #document_canvas.paragraph .doc_canvas .ordering_column { border-right: none; }
    /* 고정 820px는 모바일 화면에서 과하다 (헤더/툴바를 뺀 화면 높이에 맞춤) */
    #document_canvas.paragraph .doc_canvas { height: 78vh; }
}

/* 로딩 스피너 모달(base.html #loadingModal)의 다이얼로그.
   부트스트랩 .modal-dialog는 576px 이상에서만 margin이 'auto'라(좁은 화면은 0.5rem 고정), 폭을 100px로
   좁힌 이 모달은 모바일에서 왼쪽에 붙는다. 좌우 auto로 항상 화면 가운데 오게 한다 (세로는 -centered 담당). */
.gin-loading-dialog {
    width: 100px;
    margin-left: auto;
    margin-right: auto;
}

/* 다음 동작을 유도하는 강조 (오류용 .gin-invalid-glow와 달리 파랑 계열, 누를 때까지 계속 맥동).
   현재 사용처: '예시로 채우기' 직후 [저장] 버튼, 단어 유형에서는 [단어 정보 불러오기] 버튼 (worksheet_form.js). */
.gin-nudge {
    position: relative;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.25), 0 0 10px 2px rgba(13, 110, 253, 0.45);
    animation: gin-nudge-pulse 1.4s ease-in-out infinite;
}
@keyframes gin-nudge-pulse {
    50% { box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.12), 0 0 16px 4px rgba(13, 110, 253, 0.6); }
}
@media (prefers-reduced-motion: reduce) {
    .gin-nudge { animation: none; }  /* 움직임 최소화 설정이면 정적 강조만 */
}

/* 스포트라이트(온보딩 코치마크): 화면을 어둡게 덮고 대상 요소만 밝게 남긴다.
   구멍은 대상 위에 fixed로 얹은 빈 요소의 '거대한 box-shadow'로 만든다 (오버레이 4장이나 clip-path 불필요).
   pointer-events:none이라 대상 클릭이 그대로 통과하고 다른 곳 클릭도 막지 않는다 (가두지 않는 부드러운 유도).
   z-index는 토스트(100000)보다 낮게 둬서 안내 문구는 어두워지지 않게 한다. JS는 gin_shared.js의 Gin.spotlight. */
.gin-spotlight {
    position: fixed;
    z-index: 9000;
    pointer-events: none;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    /* 열릴 때: 화면 전체 크기 -> 대상 크기로 좁혀지며 가장자리부터 어두워진다 (조리개가 닫히는 느낌).
       geometry에 transition을 걸어 JS는 목표 rect만 지정한다. */
    transition: top 0.6s cubic-bezier(0.4, 0, 0.2, 1), left 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                width 0.6s cubic-bezier(0.4, 0, 0.2, 1), height 0.6s cubic-bezier(0.4, 0, 0.2, 1),
                border-radius 0.6s ease-out, opacity 0.15s ease-out;
}
/* 좁혀지기 전(화면 전체를 덮는 구멍)에는 모서리를 각지게 둬야 화면 밖으로 자연스럽게 이어진다 */
.gin-spotlight.opening { border-radius: 0; }
/* 단계별 안내 말풍선 (gin_shared.js Gin.coach). 덮개(.gin-spotlight, 9000)보다 위에 뜬다 */
.gin-coach-bubble { position: fixed; z-index: 9001; width: min(360px, calc(100vw - 24px)); padding: 14px 16px 12px; border-radius: 12px;
    background: #fff; color: var(--gin-ink); box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28); font-size: var(--gin-fs-sm); line-height: 1.55; }
.gin-coach-bubble::before { content: ''; position: absolute; top: -7px; left: var(--gin-coach-arrow-left, 50%); width: 14px; height: 14px; margin-left: -7px;
    background: #fff; transform: rotate(45deg); }
.gin-coach-bubble.above::before { top: auto; bottom: -7px; }
.gin-coach-head { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.gin-coach-step { flex: none; padding: 1px 7px; border-radius: 999px; background: var(--gin-mint-deep); color: #fff; font-size: 11px; font-weight: 700; }
.gin-coach-text { margin-top: 6px; color: var(--gin-ink-soft); white-space: pre-line; }
.gin-coach-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.gin-coach-actions button { border: 0; border-radius: 8px; padding: 6px 14px; font-weight: 600; }
.gin-coach-skip { background: transparent; color: var(--gin-ink-muted); }
.gin-coach-next { background: var(--gin-mint-deep); color: #fff; }
.gin-spotlight.settled { transition: opacity 0.15s ease-out; }  /* 정착 후엔 스크롤을 지연 없이 따라가게 */
.gin-spotlight.closing { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
    .gin-spotlight { transition: opacity 0.15s ease-out; }  /* 움직임 최소화 설정이면 바로 대상에 맞춤 */
}

/* 스포트라이트 - 밝게 남길 영역이 2곳 이상일 때: 화면 전체를 덮고 clip-path(evenodd)로 구멍을 뚫는다
   (box-shadow 구멍 방식은 구멍이 2개 이상이면 서로의 구멍을 덮어 쓸 수 없다). JS: Gin.spotlight */
.gin-spotlight-overlay {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
    transition: opacity 0.15s ease-out;
}
.gin-spotlight-overlay.closing { opacity: 0; }

/* ───────────────────────────────────────────────
   문법뱅크 '문법 고르기' 패널 (생성 폼 입력 탭)
   grammar_bank_picker.html / grammar_bank_picker.js 짝.
   다른 타입의 jexcel 그리드가 놓이는 자리라, 그리드와 같은 폭/테두리 톤을 쓴다.
   ─────────────────────────────────────────────── */
.gbank {
    --gbank-tree-height: 400px;
    border: 1px solid var(--gin-line);
    border-radius: 6px;
    background: #fff;
    overflow: hidden;
}
.gbank.gin-invalid-glow { border-radius: 6px; }

.gbank-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    padding: 8px 10px;
    border-bottom: 1px solid var(--gin-line-soft);
    background: var(--gin-rail-bg);
}
.gbank-search-wrap { position: relative; flex: 1 1 260px; min-width: 0; }
.gbank-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--gin-ink-muted);
    font-size: var(--gin-fs-sm);
    pointer-events: none;
}
.gbank-search {
    padding-left: 30px;
    font-size: var(--gin-fs-sm);
    height: 32px;
    min-width: 0;  /* flex 안의 input은 이게 없으면 기본 폭 밑으로 안 줄어든다 */
}
.gbank-summary {
    font-size: var(--gin-fs-sm);
    color: var(--gin-ink-soft);
    white-space: nowrap;
}
.gbank-summary b { color: var(--gin-mint-deep); }
.gbank-summary-pool { color: var(--gin-ink-muted); font-size: var(--gin-fs-xs); }
.gbank-summary-pool b { color: var(--gin-ink-muted); }
/* '실제 출제'가 '출제 가능'보다 적으면(소분류당 상한/난이도로 잘림) 눈에 띄게 */
.gbank-summary-pick-short b { color: var(--gin-warn-q); }

/* 출제 방식 카드 두 장 (범위 골라 뽑기 / 커리큘럼). 온라인 시스템의 모드 바와 같은 자리다. */
.gbank-modes {
    display: flex;
    gap: 10px;
    padding: 12px 12px 0;
}
.gbank-mode {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 10px 14px;
    border: 1.5px solid var(--gin-line);
    border-radius: 12px;
    background: #fff;
    text-align: left;
    color: var(--gin-ink-soft);
    transition: 0.12s;
}
.gbank-mode:hover { border-color: var(--gin-mint); }
.gbank-mode > b { font-size: var(--gin-fs); line-height: 1.4; }
.gbank-mode > small { font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); line-height: 1.4; }
.gbank-mode-on {
    border-color: var(--gin-mint-deep);
    background: var(--gin-mint-surface);
    color: var(--gin-mint-deep);
}
.gbank-mode-on > small { color: var(--gin-mint-deep); }
/* 커리큘럼일 때만 뜨는 안내 (두 갈래의 차이를 카드 문구만으로는 잘 모른다) */
.gbank-mode-note {
    padding: 10px 12px 0;
    font-size: var(--gin-fs-xs);
    line-height: 1.5;
    color: var(--gin-ink-muted);
}
/* 커리큘럼은 Set에 문항이 박혀 있어 분량·난이도·세트 수 설정이 아무 일도 하지 않는다.
   남겨 두면 바꿔도 문항이 안 바뀌는 조작부가 되므로 감춘다 (문항 형식만 통한다). */
.gbank-mode-curriculum .config-table tr[data-config-key="per_sub"],
.gbank-mode-curriculum .config-table tr[data-config-key="difficulty_min"],
.gbank-mode-curriculum .config-table tr[data-config-key="difficulty_max"],
.gbank-mode-curriculum .config-table tr[data-config-key="num_repeats"] { display: none; }

/* 커리큘럼 목록: 중분류 소제목 + 단원 줄(오른쪽에 Set 버튼) */
.gbank-unit-group {
    padding: 12px 12px 4px;
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    color: var(--gin-ink);
}
.gbank-unit-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: var(--gin-fs-sm);
    line-height: 1.4;
    color: var(--gin-ink-soft);
}
.gbank-unit-row:hover { background: #fafcfc; }
.gbank-unit-row-chosen { background: var(--gin-mint-surface); }
.gbank-unit-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbank-unit-sets { flex: none; display: flex; gap: 4px; }
.gbank-set-btn {
    padding: 2px 10px;
    border: 1.5px solid var(--gin-line);
    border-radius: 999px;
    background: #fff;
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    color: var(--gin-ink-muted);
    transition: 0.12s;
}
.gbank-set-btn:hover { border-color: var(--gin-mint); color: var(--gin-mint-deep); }
.gbank-set-btn-on {
    border-color: var(--gin-mint-deep);
    background: var(--gin-mint-surface);
    color: var(--gin-mint-deep);
}

/* 왼쪽 = 범위 고르기, 오른쪽 = 설정과 담은 목록. 온라인 시스템(ECHO) 출제 화면과 같은 배치.
   설정을 바꾸면 왼쪽 위 '출제 N문항'이 바로 갱신되므로 둘이 나란히 보여야 한다. */
.gbank-main { display: flex; align-items: stretch; }
.gbank-tree-area { flex: 1 1 auto; min-width: 0; }
.gbank-side {
    flex: 0 0 400px;
    min-width: 0;
    padding: 12px 14px 16px;
    border-left: 1px solid var(--gin-line-soft);
    overflow-y: auto;
    max-height: calc(var(--gbank-tree-height) + 100px);
}
.gbank-side-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 0 0 8px;
    font-size: var(--gin-fs-sm);
    font-weight: 700;
    color: var(--gin-ink);
}
.gbank-side-title > .bi { color: var(--gin-ink-muted); margin-right: 4px; }
/* 오른쪽 칸의 설정 표는 좁으므로 라벨/값을 촘촘하게. 라벨 칸을 고정해 두지 않으면
   (기본이 col-md-5 = 41%) 값 칸이 눌려 '객관식' 같은 버튼 글자가 두 줄로 접힌다. */
.gbank-side .config-table, .gbank-side .gbank-concept-table { font-size: var(--gin-fs-sm); margin-bottom: 18px; }
.gbank-side .config-table td, .gbank-side .config-table th,
.gbank-side .gbank-concept-table td { padding: 6px; vertical-align: middle; }
/* 개념 칸은 바로 아래 설정 표(분량 · 문항 조건)와 한 상자로 이어 보이게 붙인다 (마지막 개념 줄의 밑줄이 구분선) */
.gbank-side .gbank-concept-table { margin-bottom: 0; }
.gbank-side .gbank-concept-section { margin-bottom: 0; border-bottom: 0; border-radius: 4px 4px 0 0; }
.gbank-side .gbank-concept-section + .detail-cfg-section { border-top: 0; border-radius: 0 0 4px 4px; }
.gbank-side .gbank-concept-table .cfg-price-tag { text-transform: none; }
.gbank-side .config-table td.right, .gbank-side .gbank-concept-table td.right {
    width: 108px;
    white-space: nowrap;
    color: var(--gin-ink-soft);
}
.gbank-side .config-table input[type="number"] { max-width: 90px; }
.gbank-side .gbank-concept-table input[type="number"] { width: 70px; }
/* 토글은 **버튼 하나하나가 따로 보여야 한다**. 붙여 놓으면(기본 btn-group) 검은 띠 하나처럼
   보여서 몇 개를 켠 것인지, 각각이 눌리는 것인지가 안 읽힌다. 온라인 시스템처럼 알약을
   띄워 놓고 켠 것만 민트로 칠한다.
   border-radius/margin에 !important를 쓰는 이유: 부트스트랩의
   `.btn-group > .btn:not(:last-child):not(.dropdown-toggle)`이 클래스 4개짜리라
   여기 선택자(클래스 3 + 요소 1)보다 세서, 안 쓰면 가운데 버튼 모서리가 다시 각지게 된다. */
.gbank-side .config-table .btn-group, .gbank-side .gbank-concept-table .btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.gbank-side .config-table .btn-group > .btn, .gbank-side .gbank-concept-table .btn-group > .btn {
    margin: 0 !important;
    border-radius: 999px !important;
    border: 1.5px solid var(--gin-line);
    padding: 4px 14px;
    background: #fff;
    color: var(--gin-ink-soft);
    font-weight: 700;
    white-space: nowrap;
}
.gbank-side .config-table .btn-group > .btn:hover,
.gbank-side .gbank-concept-table .btn-group > .btn:hover { border-color: var(--gin-mint); }
.gbank-side .config-table .btn-check:checked + .btn,
.gbank-side .gbank-concept-table .btn-check:checked + .btn {
    border-color: var(--gin-mint-deep);
    background: var(--gin-mint-surface);
    color: var(--gin-mint-deep);
}

/* 대분류(레벨) 칩 줄. 대분류는 G레벨마다 갈라 두어(초등기초~고등 7줄) 목록에 섞으면
   길어지므로 위로 빼서 한 줄에 늘어놓는다. 지금 몇 학년 것을 보는지가 항상 눈에 있다.
   치수/톤은 온라인 시스템(ECHO)의 출제 화면과 같게 맞췄다: 알약 8px 15px, 굵은 13px,
   1.5px 테두리, 활성은 민트 면 + 민트 글자. 두 서비스가 같은 화면으로 보여야 한다. */
.gbank-levels {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px;
    border-bottom: 1px solid var(--gin-line-soft);
}
/* 검색 결과는 트리 전체에서 나온다. 대분류 하나가 강조된 채로 남으면 결과와 어긋나 감춘다. */
.gbank-searching .gbank-levels { display: none; }
.gbank-level-chip {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 15px;
    border: 1.5px solid var(--gin-line);
    border-radius: 999px;
    background: #fff;
    font-size: var(--gin-fs-sm);
    font-weight: 700;
    color: var(--gin-ink-soft);
    transition: 0.12s;
}
.gbank-level-chip:hover { border-color: var(--gin-mint); }
.gbank-level-chip-active {
    border-color: var(--gin-mint-deep);
    background: var(--gin-mint-surface);
    color: var(--gin-mint-deep);
}
.gbank-level-chip-chosen {
    min-width: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--gin-mint-deep);
    color: #fff;
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    text-align: center;
}

/* 중분류 아코디언. 중분류 행을 누르면 펼쳐지고, 안에 소분류 체크 행이 들어온다.
   **소분류는 한 줄에 하나씩만 늘어놓는다.** 여러 열로 나눠 담아 봤지만 드래그 선택과 맞지
   않았다: 3열이면 아래로 끄는 동안 1·4·7번만 지나가서 띄엄띄엄 칠해진다. 세로로 훑는
   손놀림이 연속으로 이어지는 것이 밀도보다 중요하다. */
.gbank-tree { display: flex; flex-direction: column; }
.gbank-tree-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 12px;
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    color: var(--gin-ink-muted);
    background: #fbfcfc;
    border-bottom: 1px solid var(--gin-line-soft);
}
/* 온라인 시스템은 페이지가 통째로 스크롤되지만, 여기는 생성 폼의 한 탭 안이라 목록만
   스크롤한다 (설정·안내가 같은 화면에 있어야 해서 패널이 화면을 다 먹으면 안 된다). */
.gbank-tree-body {
    height: var(--gbank-tree-height);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 8px 6px;
    /* 드래그로 칠할 때 글자가 블록 선택되지 않게 (mousedown 기본동작을 막아도 새는 브라우저가 있다) */
    user-select: none;
}
.gbank-empty {
    padding: 40px 16px;
    text-align: center;
    font-size: var(--gin-fs-sm);
    color: var(--gin-ink-muted);
}

/* 트리 행 (중분류/소분류 공통 치수) */
.gbank-cat-row,
.gbank-tree-body .gbank-sub-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 9px 12px;
    margin: 0;
    border-radius: 8px;
    font-size: var(--gin-fs);
    /* .content 의 line-height는 25px이라 그대로 두면 줄이 40px을 넘는다 (한 화면에 몇 개 안 들어옴) */
    line-height: 1.4;
    color: var(--gin-ink-soft);
    cursor: pointer;
}
.gbank-cat-row:hover,
.gbank-tree-body .gbank-sub-row:hover { background: #fafcfc; }
/* 중분류 행: 굵게, 접힘 화살표 + '이 중분류 전체' 체크박스 */
.gbank-cat-row { font-weight: 700; color: var(--gin-ink); }
.gbank-cat-caret {
    flex: none;
    width: 14px;
    font-size: 11px;
    color: var(--gin-ink-muted);
}
.gbank-cat-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbank-cat-chosen {
    flex: none;
    min-width: 17px;
    padding: 0 5px;
    border-radius: 9px;
    background: var(--gin-mint-deep);
    color: #fff;
    font-size: var(--gin-fs-xs);
    font-weight: 700;
    text-align: center;
}
.gbank-cat-meta {
    flex: none;
    margin-left: auto;
    font-size: var(--gin-fs-xs);
    font-weight: 400;
    color: var(--gin-ink-muted);
}

/* 체크박스: 기본 체크박스 대신 온라인 시스템과 같은 모양으로 그린다 (17px 둥근 사각,
   고르면 민트 면에 흰 체크, 반만 고른 중분류는 연한 민트). 스팬으로 흉내 내지 않고 진짜
   input을 칠하는 이유는 키보드·스크린리더에서 여전히 체크박스로 동작해야 하기 때문이다. */
.gbank-checkbox {
    flex: none;
    width: 17px;
    height: 17px;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
    border: 1.5px solid #cbd5d3;
    border-radius: 5px;
    background: #fff;
    position: relative;
    transition: 0.1s;
}
.gbank-checkbox:checked,
.gbank-checkbox:indeterminate { border-color: var(--gin-mint-deep); background: var(--gin-mint-deep); }
.gbank-checkbox:indeterminate { border-color: #8cd9ce; background: #8cd9ce; }
.gbank-checkbox:checked::after,
.gbank-checkbox:indeterminate::after {
    content: '✓';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: #fff;
}
.gbank-checkbox:disabled { background: #f3f6f6; border-color: var(--gin-line); }
.gbank-checkbox:focus-visible { outline: 2px solid var(--gin-mint); outline-offset: 1px; }

.gbank-link-btn {
    border: 0;
    background: none;
    padding: 0;
    font-size: var(--gin-fs-xs);
    font-weight: 600;
    color: var(--gin-mint-deep);
    text-decoration: underline;
}

/* 소분류 체크 행 */
/* 중분류 아래에 딸린 줄이라는 것이 보이게 들여쓴다 (검색 결과는 평평한 목록이라 그대로 둔다) */
.gbank-tree-body .gbank-sub-row { padding-left: 40px; font-size: var(--gin-fs-sm); }
.gbank-searching .gbank-tree-body .gbank-sub-row { padding-left: 12px; }
.gbank-sub-row-empty { color: var(--gin-ink-muted); cursor: not-allowed; }
.gbank-sub-row-empty:hover { background: none; }
/* 줄은 폭을 다 쓰고(마우스가 어디를 지나도 잡히도록) 개수는 오른쪽 끝에 세운다.
   중분류 줄의 '소분류 7 · 문항 420'과 같은 열에 놓여 눈이 한 줄로 훑힌다. */
.gbank-sub-label {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.gbank-sub-note { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); }
.gbank-sub-count {
    flex: none;
    margin-left: auto;
    padding-left: 10px;
    min-width: 34px;
    text-align: right;
    font-size: var(--gin-fs-xs);
    color: var(--gin-ink-muted);
}

/* 한 탭 안에서 구획을 나누는 소제목 (문법뱅크: 고르기 패널과 문서 생성 설정 사이) */
.form-section-title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 22px 0 8px;
    font-size: var(--gin-fs-lg);
    font-weight: 700;
    color: var(--gin-ink);
}
.form-section-title > .bi { color: var(--gin-ink-muted); }

/* 고른 문법이 총 문항 수에 밀려 빠질 때의 경고 줄 */
.gbank-warning {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 7px 10px;
    border-bottom: 1px solid var(--gin-line-soft);
    background: var(--gin-warn-row-bg);
    color: var(--gin-ink);
    font-size: var(--gin-fs-sm);
}
.gbank-warning > .bi { color: var(--gin-warn-q); }
.gbank-warning-text { flex: 1 1 auto; min-width: 0; }
.gbank-fix-btn {
    flex: 0 0 auto;
    border: 1px solid var(--gin-line);
    border-radius: 4px;
    background: #fff;
    padding: 2px 8px;
    font-size: var(--gin-fs-xs);
    font-weight: 600;
    color: var(--gin-ink);
}
.gbank-fix-btn:hover { background: var(--gin-mint-surface); border-color: var(--gin-mint-deep); }

/* '고른 문법' = 온라인 시스템의 '담은 범위'. 오른쪽 칸에서 세로로 한 줄씩 쌓인다
   (가로 칩으로 흘리면 이름이 길어 줄이 밀리고, 뭐가 담겼는지 훑기 어렵다). */
.gbank-chosen-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.gbank-chosen-empty { font-size: var(--gin-fs-sm); color: var(--gin-ink-muted); line-height: 1.5; }
.gbank-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 4px 6px 2px;
    border-bottom: 1px solid var(--gin-line-soft);
    background: none;
    font-size: var(--gin-fs-sm);
}
.gbank-chip-label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbank-chip-count { color: var(--gin-ink-muted); }
.gbank-chip-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 17px;
    height: 17px;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--gin-ink-muted);
    line-height: 1;
}
.gbank-chip-remove:hover { background: var(--gin-warn-bg); color: var(--gin-warn-fg); }
/* 총 문항 수에 밀려 출제되지 않는 문법: 골라 놓고도 안 나간다는 걸 칩에서 바로 보이게 */
.gbank-chip-dropped { color: var(--gin-ink-muted); }
.gbank-chip-dropped .gbank-chip-label { text-decoration: line-through; }

/* 좁은 화면: 두 칸을 위아래로 쌓고 목록 높이를 줄인다 */
@media (max-width: 992px) {
    .gbank { --gbank-tree-height: 300px; }
    .gbank-main { flex-direction: column; }
    .gbank-side {
        flex: 1 1 auto;
        max-height: none;
        border-left: 0;
        border-top: 1px solid var(--gin-line-soft);
    }
}


/* 생성 폼 '문서 생성 설정' 표 맨 위의 일괄 조작 버튼 줄 (전체 0으로 / 되돌리기).
   유형이 스무 줄이 넘어서, 몇 개만 남기고 끄려면 일괄 버튼이 있어야 한다. */
.cfg-tools-cell {
    text-align: right;
    padding-bottom: 6px;
    border-bottom: none;
}


/* 편집 화면 문법 문제 섹션. 문항 하나가 한 행이고, 왼쪽 칸에 소분류·유형을 고정해 둔다
   (그 두 값은 편집 대상이 아니라 어느 문법을 묻는 문항인지 알려주는 표시다). */
/* PDF 출력 설정 안의 '문법 문제 만들기' 줄. 지문마다 흩어진 버튼 대신 한 줄에서 모든 지문에 건다. */
.grammar-make { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.grammar-make .grammar-make-sets { width: 5em; flex: none; }
.grammar-make .grammar-make-unit { margin-left: -4px; }
.grammar-make .grammar-make-cost { font-weight: 600; }
.grammar-make .grammar-make-hint { font-size: var(--gin-fs-sm); color: #868e96; }



/* 구문 분석 편집 화면의 문법 태그 줄 ('*태그 : 설명'). 문장 아래에 좌측 정렬로 쌓는다.
   SVOC 라벨보다 크고 영어 문장보다 작게 (PDF의 note_fontsize와 같은 비율). */
.syntax_grammar_notes { margin-top: 6px; display: flex; flex-direction: column; gap: 1px; }
.syntax_grammar_note { font-size: 0.78em; line-height: 1.4; }


/* 편집 화면 문법 문제 섹션의 '세트 수' 선택 (재생성 버튼 옆).
   생성할 때 문법을 안 켠 지문에도 추가할 수 있어서, 여기서 몇 세트로 낼지 고른다. */


/* ─────────────────────────────────────────────────────────────────────────
   업데이트 안내 모달 (_update_popup.html + gin_shared.js의 setup_update_popup).
   랜딩 팝업과 같은 모양이라 색 토큰을 여기서 컴포넌트 스코프로 들고 있는다
   (--gin-* 은 사이트 전반의 값이고, 이쪽은 안내 팝업 브랜드 색이다).
   ───────────────────────────────────────────────────────────────────────── */
.gupd {
    --gupd-lime: #00D9C0; --gupd-teal: #17A98C; --gupd-leaf: #0FA88C; --gupd-mint: #EAF7F3;
    --gupd-ink: #12202B; --gupd-ink-soft: #4a5560; --gupd-ink-muted: #9aa4ad; --gupd-line: #EDF2F1;

    position: fixed; inset: 0; z-index: 99999;
    display: flex; align-items: center; justify-content: center;
    padding: 24px 18px;
    background: rgba(14, 20, 27, .5);
    opacity: 0; pointer-events: none; transition: opacity .28s ease;
    font-family: 'Spoqa Han Sans Neo', 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
    line-height: 1.6; word-break: keep-all;
}
.gupd *, .gupd *::before, .gupd *::after { box-sizing: border-box; }
.gupd h2, .gupd p, .gupd ul, .gupd li { margin: 0; padding: 0; }
.gupd ul { list-style: none; }
.gupd a { text-decoration: none; }
.gupd.is-open { opacity: 1; pointer-events: auto; }
.gupd[hidden] { display: none; }

.gupd .gupd__card {
    width: min(100%, 470px); max-height: calc(100vh - 48px); overflow-y: auto;
    background: #fff; border-radius: 22px; overflow: hidden;
    box-shadow: 0 26px 60px -22px rgba(14, 20, 27, .5);
    transform: translateY(16px) scale(.98);
    transition: transform .32s cubic-bezier(.2, .65, .25, 1);
}
.gupd.is-open .gupd__card { transform: translateY(0) scale(1); }

.gupd .gupd__head { background: var(--gupd-mint); padding: 30px; }
.gupd .gupd__lb {
    font-size: .82rem; font-weight: 800; letter-spacing: .16em;
    color: var(--gupd-leaf); margin-bottom: 16px;
}
.gupd .gupd__lb i { font-style: normal; color: #F0A93C; margin: 0 4px; }
.gupd .gupd__title {
    font-size: clamp(1.42rem, 3.4vw, 1.66rem); font-weight: 800;
    letter-spacing: -.035em; line-height: 1.34; color: var(--gupd-ink);
    margin-bottom: 26px;
}
.gupd .gupd__list { display: flex; flex-direction: column; gap: 5px; }
.gupd .gupd__list li {
    font-size: .95rem; line-height: 1.5; color: var(--gupd-ink-soft); font-weight: 600;
    display: flex; gap: 9px; align-items: flex-start;
}
.gupd .gupd__list li::before {
    content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%;
    background: var(--gupd-leaf); margin-top: 7px;
}

.gupd .gupd__body { padding: 20px 30px 18px; background: #fff; }
/* 스토어 이벤트 팝업(_store_event_popup.html)이 본문에 업데이트 목록을 함께 싣는다.
   머리 영역과 달리 흰 바탕이라 소제목 한 줄을 두고 목록을 조금 작게 깐다. */
.gupd .gupd__section-title {
    font-size: .8rem; font-weight: 800; letter-spacing: .02em;
    color: var(--gupd-ink-soft); opacity: .75; margin-bottom: 8px;
}
.gupd .gupd__list--ink { margin-bottom: 16px; }
.gupd .gupd__list--ink li { font-size: .88rem; font-weight: 500; }
.gupd .gupd__list--ink li::before { width: 5px; height: 5px; margin-top: 8px; }
/* li는 flex 컨테이너라(불릿 ::before와 나란히 두려고) 안의 텍스트와 <b>가 **각각 칸이 된다**.
   가운데 <b>가 든 문장은 세 칸으로 흩어져 글자가 벌어진 채 나온다 (실제 사고: 이벤트 팝업).
   내용을 span 하나로 감싸 그 안에서 평범하게 줄바꿈되게 한다. */
.gupd .gupd__list li > span { flex: 1; min-width: 0; }

/* 이벤트 팝업에서 한 줄만 눈에 띄게: 글자가 하나씩 차례로 통통 튀어오른다.
   글자마다 <i>로 쪼개고 nth-child로 시작을 조금씩 늦춰 물결처럼 지나가게 한다
   (첫 자식이 앞쪽 별이라 글자는 2번째 자식부터 센다).
   **움직임을 싫어하는 설정(prefers-reduced-motion)에서는 멈춘다**: 어지러움을 느끼는
   사용자가 있고, 광고성 움직임은 특히 거슬린다. 그 경우에도 굵기와 별은 남아 강조는 된다. */
.gupd .gupd-wave { display: inline-block; font-weight: 800; color: var(--gupd-ink); }
.gupd .gupd-wave__ch {
    display: inline-block;
    animation: gupd-wave 1.5s ease-in-out infinite;
}
.gupd .gupd-wave__ch:nth-child(2) { animation-delay: 0.00s; }
.gupd .gupd-wave__ch:nth-child(3) { animation-delay: 0.07s; }
.gupd .gupd-wave__ch:nth-child(4) { animation-delay: 0.14s; }
.gupd .gupd-wave__ch:nth-child(5) { animation-delay: 0.21s; }
.gupd .gupd-wave__ch:nth-child(6) { animation-delay: 0.28s; }
.gupd .gupd-wave__ch:nth-child(7) { animation-delay: 0.35s; }
.gupd .gupd-wave__ch:nth-child(8) { animation-delay: 0.42s; }
.gupd .gupd-wave__ch:nth-child(9) { animation-delay: 0.49s; }
.gupd .gupd-wave__ch:nth-child(10) { animation-delay: 0.56s; }
.gupd .gupd-wave__ch:nth-child(11) { animation-delay: 0.63s; }
.gupd .gupd-wave__ch:nth-child(12) { animation-delay: 0.70s; }
.gupd .gupd-wave__ch:nth-child(13) { animation-delay: 0.77s; }
.gupd .gupd-wave__star {
    font-style: normal; margin: 0 4px; display: inline-block;
    animation: gupd-twinkle 1.5s ease-in-out infinite;
}
.gupd .gupd-wave__star--late { animation-delay: .75s; }

/* 대부분의 시간은 가만히 있다가 제 차례에만 한 번 올라갔다 내려온다 */
@keyframes gupd-wave {
    0%, 55%, 100% { transform: translateY(0); }
    25%           { transform: translateY(-7px); }
}
@keyframes gupd-twinkle {
    0%, 100% { transform: scale(1) rotate(0deg); opacity: 1; }
    50%      { transform: scale(1.35) rotate(18deg); opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
    .gupd .gupd-wave__ch, .gupd .gupd-wave__star { animation: none; }
}
.gupd .gupd__go {
    display: flex; align-items: center; justify-content: center;
    background: var(--gupd-teal); color: #fff; border-radius: 10px;
    padding: 15px 20px; font-size: 1.02rem; font-weight: 800; letter-spacing: -.01em;
    transition: filter .18s ease;
}
.gupd .gupd__go:hover { filter: brightness(1.06); color: #fff; }
.gupd .gupd__foot {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--gupd-line);
}
.gupd .gupd__foot button {
    font-family: inherit; background: none; border: 0; cursor: pointer;
    font-size: .86rem; font-weight: 600; color: var(--gupd-ink-muted); padding: 4px 2px;
}
.gupd .gupd__foot button:hover { color: var(--gupd-ink); }
.gupd .gupd__foot .x { margin-left: 5px; }
.gupd .gupd__go:focus-visible, .gupd .gupd__foot button:focus-visible {
    outline: 2px solid var(--gupd-lime); outline-offset: 2px;
}

/* 새 기능 안내 (_update_popup.html): 기능마다 한 줄 + 그 메뉴로 가는 링크.
   작은 화면에서 목록이 길어지면 카드 안에서 스크롤한다 (기본 .gupd__card는 overflow:hidden). */
.gupd--news .gupd__card { width: min(100%, 430px); overflow-y: auto; }
.gupd--news .gupd__head { padding: 24px 22px 16px; }
.gupd--news .gupd__lb { margin-bottom: 8px; }
.gupd--news .gupd__title { font-size: 1.4rem; margin-bottom: 14px; }
.gupd .gupd__news { display: flex; flex-direction: column; gap: 6px; }
.gupd .gupd__news a {
    display: flex; flex-direction: column; gap: 1px;
    position: relative; padding: 9px 30px 9px 13px;
    background: #fff; border-radius: 11px; border: 1px solid var(--gupd-line);
    color: var(--gupd-ink); transition: border-color .15s ease, box-shadow .15s ease;
}
.gupd .gupd__news a::after {
    content: "›"; position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
    font-size: 1.2rem; line-height: 1; color: var(--gupd-ink-muted);
}
.gupd .gupd__news a:hover { border-color: var(--gupd-leaf); box-shadow: 0 4px 12px -8px rgba(14, 20, 27, .35); }
.gupd .gupd__news a:focus-visible { outline: 2px solid var(--gupd-lime); outline-offset: 1px; }
.gupd .gupd__news b { font-size: .93rem; font-weight: 800; letter-spacing: -.01em; }
.gupd .gupd__news span { font-size: .82rem; line-height: 1.45; color: var(--gupd-ink-soft); }
.gupd--news .gupd__body { padding: 4px 22px 12px; }
.gupd--news .gupd__foot { margin-top: 0; padding-top: 10px; border-top: 0; }

/* 기출 분석 오픈 안내 (2026-10-13): 메뉴 배지(gin_navbar.css .gin-nav-promo)와 같은 은은한 금색 */
.gupd--exam .gupd__head--gold {
    background: radial-gradient(120% 90% at 100% 0%, #fff4cf 0%, rgba(255, 244, 207, 0) 60%), linear-gradient(160deg, #fffaf0 0%, #fdf1d3 100%);
}
.gupd--exam .gupd__lb { color: #b07d12; }
.gupd--exam .gupd__title { margin-bottom: 20px; }
.gupd--exam .gupd__shine {
    background: linear-gradient(110deg, #9a6a00 0%, #d9a422 40%, #ffe9a6 50%, #d9a422 60%, #9a6a00 100%);
    background-size: 250% 100%;
    -webkit-background-clip: text; background-clip: text; color: transparent;
    animation: gupd-shine 3.4s ease-in-out infinite;
}
@keyframes gupd-shine {
    0%, 35% { background-position: 100% 0; }
    75%, 100% { background-position: 0 0; }
}
.gupd--exam .gupd__features { display: flex; flex-direction: column; gap: 10px; }
.gupd--exam .gupd__feature {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 13px 14px; border-radius: 14px; background: rgba(255, 255, 255, .78);
    border: 1px solid #f0dca4; box-shadow: 0 4px 14px -8px rgba(176, 128, 20, .35);
}
.gupd--exam .gupd__feature-icon {
    flex: none; width: 36px; height: 36px; border-radius: 10px; background: #fdf0c8;
    display: inline-flex; align-items: center; justify-content: center; font-size: 1.15rem; color: #b07d12;
}
.gupd--exam .gupd__feature p { font-size: .9rem; line-height: 1.55; color: var(--gupd-ink-soft); font-weight: 500; }
.gupd--exam .gupd__feature b { color: var(--gupd-ink); font-weight: 800; }
.gupd--exam .gupd__feature em { font-style: normal; font-weight: 800; color: #9a6a00; }
.gupd--exam .gupd__go { background: linear-gradient(110deg, #c8901a, #e3b13f); color: #fff; text-shadow: 0 1px 1px rgba(90, 60, 0, .25); }
.gupd--exam .gupd__go:hover { color: #fff; }
/* 샘플 보기: 시작 버튼 아래 보조 버튼 (문자 홍보용 모음 페이지 /p/와 같은 샘플) */
.gupd .gupd__sample {
    display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px;
    padding: 13px 20px; border-radius: 10px; border: 1.5px solid #e3b13f; background: #fffaf0;
    color: #a8740f; font-size: .95rem; font-weight: 700; text-decoration: none;
}
.gupd .gupd__sample:hover { background: #fff3d9; color: #8a5f0a; }
@media (prefers-reduced-motion: reduce) {
    .gupd--exam .gupd__shine { animation: none; }
}

@media (max-width: 560px) {
    .gupd { padding: 16px 14px; }
    .gupd .gupd__head { padding: 24px 20px 20px; }
    .gupd .gupd__body { padding: 16px 20px 14px; }
}
@media (prefers-reduced-motion: reduce) {
    .gupd, .gupd .gupd__card, .gupd .gupd__go { transition: none; }
}


/* 삽화 종류를 여러 개 고를 때 카드 왼쪽 위에 붙는 순서 번호 (1, 2, 3...).
   그 번호대로 문서에 실린다. 한 종류만 고르면 붙이지 않는다. */
.illustration-style-card { position: relative; }
.illustration-pick-order {
    position: absolute; top: 4px; left: 4px; z-index: 2;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: var(--gin-primary, #0d6efd); color: #fff;
    font-size: 0.72rem; font-weight: 700; line-height: 18px; text-align: center;
    padding: 0 5px;
}


/* 편집 화면의 삽화 카드 (종류마다 한 장). 손잡이를 끌어 순서를 바꾼다.
   한 종류만 있으면 손잡이와 이름표 없이 그림만 나온다 (예전 화면과 같은 모양). */
.illustration-cards { display: flex; flex-direction: column; gap: 12px; }
.illustration-card { border-radius: 6px; }
.illustration-card-head {
    display: flex; align-items: center; gap: 6px; margin-bottom: 4px;
    font-size: var(--gin-fs-sm); color: #495057;
}
.illustration-card-grip { cursor: grab; color: #adb5bd; touch-action: none; }
.illustration-card-grip:active { cursor: grabbing; }
.illustration-card-label { font-weight: 600; }

/* 기출 분석 생성 화면 · 상세 화면의 '학교 정보 + 시험지' 패널 (exam_analysis_upload.html, worksheet_detail.html) */
.exam-analysis-panel { display: flex; flex-direction: column; gap: 12px; padding: 4px 0; }
.eap-fields { display: grid; grid-template-columns: 2fr 1fr 2fr; gap: 10px; }
.eap-fields label { display: flex; flex-direction: column; gap: 4px; font-size: var(--gin-fs-sm); font-weight: 600; color: var(--gin-ink-soft); }
.eap-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; border: 2px dashed var(--gin-line); border-radius: 12px;
            padding: 26px 16px; text-align: center; cursor: pointer; background: var(--gin-mint-surface); margin: 0; }
.eap-drop.is-over { border-color: var(--gin-mint-deep); }
.eap-drop input { display: none; }
.eap-drop i { font-size: 30px; color: var(--gin-mint-deep); }
.eap-drop span { font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); }
.eap-files { display: flex; flex-direction: column; border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; }
.eap-files:empty { display: none; }
.eap-file { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #dee2e6; background: #fff; font-size: var(--gin-fs-sm); }
.eap-file:last-child { border-bottom: 0; }
.eap-file i { color: var(--gin-mint-deep); font-size: 18px; }
.eap-file span:first-of-type { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.eap-sub { color: var(--gin-ink-muted); font-size: var(--gin-fs-xs); }
.eap-remove { border: 0; background: none; color: var(--gin-ink-muted); font-size: 18px; line-height: 1; cursor: pointer; }
/* 기출 분석: 시험 범위 원문 지문 (선택, 변형 분석용). 왼쪽 지문 DB 패널 + 오른쪽 지문 카드 목록 */
.eap-passages { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--gin-line-soft); }
.eap-passages-head { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.eap-passages-head b { font-size: var(--gin-fs-md, 15px); color: var(--gin-ink); }
.eap-passages-head > span { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.eap-optional { margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--gin-mint-surface); color: var(--gin-mint-deep); font-size: 11px; font-weight: 700; vertical-align: 2px; }
.eap-check { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 13px; cursor: pointer; }
.eap-check input { width: 16px; height: 16px; accent-color: var(--gin-mint-deep); }
.eap-passage-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.eap-passage { border: 1px solid #dee2e6; border-radius: 8px; padding: 8px 10px; background: #fff; }
.eap-passage-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.eap-passage-num { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--gin-mint-surface); color: var(--gin-mint-deep); font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.eap-passage textarea { font-size: 13.5px; line-height: 1.55; }
.eap-passage-empty { padding: 18px; border: 1px dashed #cfd8dc; border-radius: 8px; color: var(--gin-ink-muted); font-size: var(--gin-fs-sm); text-align: center; }
/* 기출 분석: 학교 내신 기출 / 모의고사 고르기 (exam_analysis_upload.html) */
.eap-mode { display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap; margin-bottom: 14px; }
.eap-mode-btn { flex: 1 1 220px; display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; text-align: left; padding: 10px 14px; border: 1.5px solid var(--gin-line, #d5dfe0); border-radius: 10px; background: #fff; color: var(--gin-ink); }
.eap-mode-btn > i { grid-row: span 2; font-size: 22px; color: var(--gin-ink-muted); }
.eap-mode-btn > b { font-size: 15px; }
.eap-mode-btn > span { font-size: 12.5px; color: var(--gin-ink-muted); }
.eap-mode-btn.active { border-color: var(--gin-mint-deep); background: var(--gin-mint-surface); }
.eap-mode-btn.active > i { color: var(--gin-mint-deep); }
/* 내용 이해 워크북 원서 모드 (book_workbook_form.js): 책 제목 · 수준 · 지시문 언어 · 추천 패키지 · 활동 */
.book-input-head { display: flex; align-items: center; gap: 10px; margin: -4px 0 12px; }
.book-input-head label { font-weight: 600; white-space: nowrap; }
.book-input-head input { max-width: 360px; }
.book-config-panel { display: flex; flex-direction: column; gap: 14px; margin-bottom: 8px; }
.book-config-row { display: grid; grid-template-columns: 110px 1fr; gap: 12px; align-items: start; }
.book-config-label { font-weight: 600; padding-top: 6px; word-break: keep-all; }
.book-config-label small { font-weight: 400; color: var(--gin-ink-muted); }
.book-level-options { display: flex; gap: 8px; flex-wrap: wrap; }
.book-chip { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 7px 14px; border: 1.5px solid var(--gin-line, #d5dfe0); border-radius: 10px; background: #fff; color: var(--gin-ink); }
.book-chip span { font-size: 12px; color: var(--gin-ink-muted); }
.book-chip.active, .book-package.active { border-color: var(--gin-mint-deep); background: var(--gin-mint-surface); }
.book-option-hint { align-self: center; font-size: 12px; color: var(--gin-ink-muted); }
/* 원서 모드 설정 묶음 제목: '그림 · 음원'이 먼저, 그다음 '모드 설정' (수준 · 패키지 · 활동) */
.book-config-group-title { font-weight: 800; font-size: 15px; color: var(--gin-ink); padding-bottom: 6px; border-bottom: 1.5px solid var(--gin-line, #d5dfe0); }
.book-config-group-title ~ .book-config-group-title { margin-top: 10px; }
/* 챕터북 등장인물 (book_workbook_form.js charactersHtml): 줄마다 사진 칸 + 이름 + 빼기, 아래 '+ 추가' */
.book-characters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.book-character { position: relative; display: flex; flex-direction: column; gap: 6px; width: 132px; }
.book-character-photo { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 132px; height: 132px; padding: 0; overflow: hidden; border: 1.5px dashed var(--gin-line, #d5dfe0); border-radius: 12px; background: #fafcfc; color: var(--gin-ink-muted); font-size: 12px; cursor: pointer; }
.book-character-photo i { font-size: 26px; }
.book-character-photo:hover, .book-character-photo:focus { border-color: var(--gin-mint-deep); outline: none; background: var(--gin-mint-surface); }
.book-character-photo.has-image { border-style: solid; background: #fff; }
.book-character-photo img { width: 100%; height: 100%; object-fit: cover; }
.book-character-photo.is-uploading { opacity: .5; pointer-events: none; }
.book-character-remove { position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; display: grid; place-items: center; padding: 0; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .45); color: #fff; font-size: 12px; }
.book-character-add { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 6px; }
.book-character-add + .book-option-hint, .book-characters + .book-option-hint { display: block; }
/* 지문 배경 그림: 삽화 고르기 카드(.illustration-style-card)를 그대로 쓴다. '안 넣기'는 그림 대신 빈 칸 */
.book-art-cards { grid-template-columns: repeat(6, 1fr); margin-bottom: 4px; }
@media (max-width: 900px) { .book-art-cards { grid-template-columns: repeat(2, 1fr); } }
.book-art-none { display: flex; align-items: center; justify-content: center; color: #adb5bd; font-size: 26px; }
.book-packages { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.book-package { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 9px 12px; border: 1.5px solid var(--gin-line, #d5dfe0); border-radius: 10px; background: #fff; color: var(--gin-ink); }
.book-package span { font-size: 12px; color: var(--gin-ink-muted); word-break: keep-all; line-height: 1.45; }
.book-activities { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 16px; }
.book-activity-part-title { font-family: 'RiaSans', inherit; font-weight: 700; color: var(--gin-mint-deep); margin-bottom: 4px; }
.book-activity { display: flex; align-items: center; gap: 6px; padding: 2px 0; cursor: pointer; word-break: keep-all; }
/* 원서 패널 맨 아래 안내: 손봐야 할 때만 보인다 (book_workbook_form.js bookWarning) */
.book-warn-note { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--gin-warn-row-bg); border: 1px solid var(--gin-warn-row-bg-range); font-size: 13.5px; word-break: keep-all; }
@media (max-width: 640px) { .book-config-row { grid-template-columns: 1fr; gap: 6px; } }
.eap-fields-mock { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.eap-mock-help { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); margin: 4px 0 12px; word-break: keep-all; }
.eap-answer-upload { margin-top: 10px; }
.eap-drop.eap-drop-small { padding: 14px; }
.eap-drop.eap-drop-small > i { font-size: 22px; }
.eap-passage-tools { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.eap-passage-add { width: 100%; border: 1px solid #aaa; display: flex; justify-content: center; align-items: center; margin-top: 4px; }
.eap-detail-school { margin-bottom: 10px; font-size: var(--gin-fs); }
@media (max-width: 575.98px) { .eap-fields { grid-template-columns: 1fr; } }
.eap-fields-exam { grid-template-columns: 1fr 1fr 1fr; }
/* 과목: 목록 고르기 + '직접 입력'일 때만 아래에 칸 */
.eap-subject .eap-subject-custom { margin-top: 6px; }
/* 덜 채운 칸 · 고칠 칸 안내 (exam_analysis_upload.js guideText) */
.eap-field-guide { margin: 0; font-size: var(--gin-fs-sm); color: #b45309; }
.eap-field-guide::before { content: '\F33A'; font-family: 'bootstrap-icons'; margin-right: 6px; }
.eap-file[href] { text-decoration: none; color: inherit; }

/* 기출 분석 목록 [설명회 자료 만들기] 창: 넣을 분석 문서 목록 (worksheet_index.html, exam_briefing.js) */
.exam-briefing-sources { margin: 14px 0; padding: 10px 12px; border: 1px solid var(--gin-line); border-radius: 8px; }
.exam-briefing-sources ol { padding-left: 1.2em; max-height: 180px; overflow-y: auto; }
.exam-briefing-colors { margin: 0 0 14px; }
.exam-briefing-colors .rs-row { margin-bottom: 8px; }
/* 색 고르기 미리 보기 띠 (_report_style_colors.html): 대표색 막대 · 제목 · 형광펜 · 차트 색 칩 */
.rs-strip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border: 1px solid var(--gin-line); border-radius: 8px; font-size: 13px; }
.rs-strip-accent { width: 6px; height: 22px; border-radius: 2px; }
.rs-strip-title { font-weight: 800; }
.rs-strip-mark { padding: 0 4px; font-weight: 700; color: inherit; }
.rs-strip-chips { display: inline-flex; gap: 3px; margin-left: auto; }
.rs-strip-chips i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }

/* 기출 분석 상세: 홍보 이미지 미리보기 · 전체 문항과 지인에듀 유형 (worksheet_detail.html, exam_analysis_detail.js) */
.detail-section-header .ms-auto { margin-left: auto; }
.ea-promo-label { font-size: var(--gin-fs-xs); font-weight: 700; color: var(--gin-ink-muted); margin: 8px 0 6px; }
.ea-promo-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.ea-promo-row img { height: 220px; border-radius: 8px; border: 1px solid var(--gin-line-soft); }
.ea-promo-square img { height: 170px; }
.ea-promo-offer p { margin: 0 0 8px; color: var(--gin-ink-muted); font-size: var(--gin-fs-sm); }
.ea-bulk { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: space-between; padding: 10px 14px; margin-bottom: 10px;
           border: 1px solid #f3c6b3; background: #fff6f1; border-radius: 8px; font-size: 0.9rem; }
.ea-questions { border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden; }
.ea-q { border-bottom: 1px solid #dee2e6; background: #fff; }
.ea-q:last-child { border-bottom: 0; }
.ea-q summary { display: grid; grid-template-columns: 70px 1fr 50px 220px; gap: 10px; align-items: center; padding: 8px 12px; cursor: pointer; list-style: none; }
.ea-q summary::-webkit-details-marker { display: none; }
.ea-q summary:hover { background: #f8f9fa; }
.ea-q-num { font-weight: 800; color: var(--gin-ink); }
.ea-q-type { display: flex; flex-direction: column; min-width: 0; font-size: var(--gin-fs-sm); }
.ea-q-type span { color: var(--gin-ink-muted); font-size: var(--gin-fs-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ea-q-points { text-align: right; font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.ea-q-map { font-size: var(--gin-fs-sm); }
.ea-q-action { text-align: right; }
.ea-pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.ea-pill-ok { background: #f1f3f5; color: #343a40; }
.ea-pill-near { background: #f1f3f5; color: #495057; }
.ea-pill-miss { background: #fff; color: #495057; border: 1px solid #ced4da; }
.ea-pill-done { background: #f1f3f5; color: #495057; }
.ea-q-body { padding: 4px 16px 14px 92px; font-size: var(--gin-fs-sm); }
.ea-q-instruction { font-weight: 700; margin: 4px 0 8px; }
.ea-q-passage { background: var(--gin-mint-surface); border-radius: 8px; padding: 10px 12px; line-height: 1.7; margin-bottom: 8px; white-space: pre-wrap; }
.ea-q-box { border: 1px solid var(--gin-line); border-radius: 8px; padding: 8px 12px; margin-bottom: 8px; }
.ea-q-choices { margin: 0 0 6px; padding-left: 20px; }
.ea-q-note { color: var(--gin-ink-muted); font-size: var(--gin-fs-xs); margin: 4px 0 0; }
@media (max-width: 767.98px) {
    .ea-q summary { grid-template-columns: 54px 1fr; }
    .ea-q-points, .ea-q-map { grid-column: 2; }
    .ea-q-action { grid-column: 1 / -1; text-align: left; }
    .ea-q-body { padding-left: 16px; }
}

/* 모의고사 유형 생성: 학교 경향 불러오기 · 우리 학원 유형 (paragraph_school_preset.js) */
/* 다른 설정 표와 같은 흰 바탕 · 회색 선 (민트 톤은 ECHO 쪽 색이라 지인에듀 화면에서 튀었다) */
.school-preset-panel { border: 1px solid #dee2e6; border-radius: 6px; background: #fff; padding: 10px 14px; margin-bottom: 12px; }
.school-preset-panel:empty { display: none; }
.sp-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sp-mode-cards { margin-bottom: 10px; }   /* 모의고사 유형 모드 셋 (paragraph_school_preset.js): 내용 이해 모드 카드(.eap-mode)와 같은 모양 */
.sp-grade-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.sp-middle-box { margin: 0 0 14px; display: grid; gap: 8px; }
.sp-type-list { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sp-type-chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border: 1px solid #ced4da; border-radius: 999px; font-size: var(--gin-fs-sm); cursor: pointer; background: #fff; }
.sp-type-chip.on { border-color: var(--gin-ink, #1f2328); background: #f1f3f5; }
.sp-type-chip .btn-example-problem { border: 0; background: none; padding: 0 2px; color: var(--gin-ink-soft); }
.sp-label { font-weight: 700; font-size: var(--gin-fs-sm); color: var(--gin-ink); min-width: 110px; }
.sp-select { width: auto; min-width: 260px; }
.sp-note { font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); margin: 6px 0 0 118px; }
.sp-custom { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--gin-line); }
.sp-chip { border: 1px solid var(--gin-mint-deep); background: #fff; color: var(--gin-mint-deep); border-radius: 999px; padding: 3px 11px; font-size: var(--gin-fs-xs); font-weight: 700; cursor: pointer; }
.sp-chip:hover { background: var(--gin-mint-deep); color: #fff; }
@media (max-width: 575.98px) { .sp-note { margin-left: 0; } .sp-select { min-width: 0; width: 100%; } }

/* 관리자 유형 요청 (gin_admin_custom_types.html) */
.ct-admin .ct-label { font-size: 0.8rem; font-weight: 700; color: #6c757d; margin-bottom: 6px; }
.ct-admin .ct-problem { border: 1px solid #dee2e6; border-radius: 8px; padding: 12px 14px; font-size: 0.85rem; background: #fff; }
.ct-admin .ct-passage { margin-top: 8px; line-height: 1.6; white-space: normal; }
.ct-admin .ct-box { margin-top: 8px; padding: 8px 10px; border: 1px solid #ced4da; background: #f8f9fa; }
.ct-admin .ct-choices { margin: 8px 0 0; padding-left: 1.4em; }
.ct-admin .ct-paragraph { flex: 1 1 280px; max-width: 420px; }

/* 학교 동형 양식을 고르면 안내를 눈에 띄게 (paragraph_school_preset.js) */
.school-preset-panel.sp-mock-on .sp-mock-note { color: var(--gin-ink); }
/* 학교를 안 골랐을 때(일반 모의고사 유형)는 설정 표의 한 줄처럼 담담하게. 세트 수는 학교를 고른 뒤에만 */
.school-preset-panel:not(.sp-mock-on) .sp-mock-only { display: none; }
.sp-optional { font-weight: 400; color: var(--gin-ink-muted); }

/* 동형 시험지 학교 → 학년 → 과목 → 시험 고르기 (paragraph_school_preset.js) */
.school-preset-panel .sp-select-small { max-width: 150px; }

/* 학교 동형 양식을 고르면 설정 표에서 '학교 동형' 줄만 남기고 다른 유형 줄은 감춘다 (paragraph_school_preset.js, body.school-mock-mode) */
body.school-mock-mode .sp-general-config .config-table > tbody > tr:not(.sp-tr) { display: none !important; }
/* 설정 표 안에 들어간 학교 동형 패널: 표의 한 줄처럼 (상자 없이) */
.config-table td.sp-cell { padding: 8px 10px; }
.config-table .school-preset-panel { border: 0; border-radius: 0; padding: 0; margin: 0; background: transparent; }

/* 학교 동형 '문항별 지문 배정' (paragraph_school_preset.js) */
.school-preset-panel .sp-assign-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.school-preset-panel .sp-assign-table { background: #fff; margin-bottom: 4px; }
.school-preset-panel .sp-assign-table td { vertical-align: middle; font-size: 0.85rem; }
.school-preset-panel .sp-assign-q { width: 52%; }


/* 학교 동형 디자인 수정 요청 (school_design_request.js) */
.school-design-paste { border: 2px dashed #ced4da; border-radius: 8px; padding: 14px; text-align: center; font-size: 0.85rem; color: #6c757d; cursor: text; }
.school-design-paste:focus { border-color: #0b6e65; outline: none; }
.school-design-preview { display: block; max-width: 100%; max-height: 360px; margin: 10px auto 0; border: 1px solid #dee2e6; }

.school-preset-panel .sp-sets { width: 70px; }
.school-preset-panel .sp-mode { width: auto; min-width: 170px; }
.school-preset-panel .sp-sets-label { margin-left: 8px; min-width: auto; }
.school-preset-panel .sp-sets-unit { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.school-preset-panel .sp-mock-cancel { margin-left: auto; }

/* 경향 분석 상세: 추천 조합 · 유형 기억 */
.ea-combos { display: grid; gap: 10px; }
.ea-combo { border: 1px solid #dee2e6; border-radius: 8px; padding: 10px 12px; background: #fff; }
.ea-combo-head { display: flex; align-items: center; gap: 8px; }
.ea-combo-copy { font-size: 12px; padding: 2px 8px; white-space: nowrap; }   /* 추천 조합 카드의 [모의고사 유형으로 복사] */
.ea-combo-intent { font-size: 0.85rem; color: #495057; margin: 4px 0 6px; }
.ea-combo-types { display: flex; flex-wrap: wrap; gap: 4px; }
.ea-combo-types .badge { font-weight: 500; }
.ea-memory-table td, .ea-memory-table th { font-size: 0.85rem; }

.ct-admin .ct-group-head { border-bottom: 2px solid #212529; padding-bottom: 6px; }
.ct-admin .ct-spec { background: #f1f8f7; border-radius: 6px; padding: 8px 10px; }

/* 휴대폰: 설정 표의 이름 칸과 숫자 칸을 위아래로 (옆으로 두면 숫자 칸이 화면 밖으로 밀려 이름만 보였다) */
@media (max-width: 575.98px) {
    form .table.config-table tr:not(.detail-cfg-group-header) > td { display: block; width: 100%; }
    form .table.config-table td.cfg-label-cell, form .table.config-table td.right { text-align: left; white-space: normal; border-bottom: 0; padding-bottom: 0; }
}

/* 설정 표 '우리 학원 유형'의 학교 · 과목 고르기 줄 (worksheet_form.js attach_custom_type_school_picker). 다른 유형 줄과 같은 칸 모양 */
.cfg-custom-picker-row { display: flex; flex-wrap: wrap; gap: 6px; }
.cfg-custom-picker-select { width: auto; min-width: 130px; max-width: 100%; }

/* 학교 동형을 고른 동안 탭 위 한 줄 요약 (paragraph_school_preset.js syncSummary). 설정 표와 같은 흰 바탕 · 회색 선 */
.sp-summary-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 0 0 10px; padding: 9px 14px;
    border: 1px solid #dee2e6; border-radius: 6px; background: #fff; font-size: var(--gin-fs-sm); color: var(--gin-ink); }
.sp-summary-bar[hidden] { display: none; }
.sp-summary-next { color: var(--gin-ink-soft); }
.sp-summary-change { margin-left: auto; font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); text-decoration: underline; cursor: pointer; }

/* 학교 동형: 분석한 기출이 없을 때 안내 (paragraph_school_preset.js) */
.sp-empty-note { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.sp-empty-go { padding: 2px 10px; font-size: var(--gin-fs-xs); }
/* 기출 분석 상세: 올린 원본을 눌러 연다 */
.eap-file-link { color: inherit; text-decoration: none; }
.eap-file-link:hover { background: var(--gin-mint-surface); color: inherit; }
.eap-file-link .bi-box-arrow-up-right { color: var(--gin-ink-muted); font-size: 13px; }
/* 기출 분석 '디자인 재생성' 창: 원본 · 재현을 쪽마다 나란히 (스크롤) */
.school-design-compare-head { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; font-size: var(--gin-fs-xs); font-weight: 700; color: var(--gin-ink-soft); margin-bottom: 4px; }
.school-design-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; max-height: 58vh; overflow-y: auto; margin-bottom: 12px;
    padding: 8px; border: 1px solid var(--gin-line-soft); border-radius: 8px; background: #f6f7f8; }
.school-design-compare-page { grid-column: 1 / -1; font-size: var(--gin-fs-xs); font-weight: 700; color: var(--gin-ink-muted); margin-top: 6px; }
.school-design-compare-cell { display: flex; align-items: flex-start; justify-content: center; min-height: 120px; color: var(--gin-ink-muted); font-size: var(--gin-fs-xs); }
.school-design-compare-cell img { width: 100%; border: 1px solid var(--gin-line-soft); background: #fff; }
.school-design-compare-loading { grid-column: 1 / -1; padding: 40px; text-align: center; color: var(--gin-ink-muted); }
/* 기출 분석: 시험 정보 (선택) 엑셀 칸 모양 */
.eap-info { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--gin-line-soft); }
.eap-info-grid { width: 100%; border-collapse: collapse; background: #fff; }
.eap-info-grid th, .eap-info-grid td { border: 1px solid #cfd8dc; padding: 0; }
.eap-info-grid th { width: 150px; white-space: nowrap; background: #f1f4f5; font-size: var(--gin-fs-sm); font-weight: 700; color: var(--gin-ink-soft); padding: 6px 10px; text-align: left; }
.eap-info-grid .form-control, .eap-info-grid .form-select { border: 0; border-radius: 0; box-shadow: none; }
.eap-info-grid .form-control:focus, .eap-info-grid .form-select:focus { background: #f6fffd; outline: 2px solid var(--gin-mint-deep); outline-offset: -2px; }
.eap-required { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: #fdecea; color: #c8352d; font-size: 10.5px; font-weight: 700; }
/* 기출 분석 상세: 지난 시험 올리기 유도 */
.ea-past-nudge { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; padding: 12px 14px; border-radius: 10px;
    background: #fff8e6; border: 1px solid #f3dca0; font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.ea-past-nudge > i { font-size: 22px; color: #b07d12; }
.ea-past-nudge > div { flex: 1; word-break: keep-all; text-wrap: pretty; }
.ea-past-nudge p { margin: 0; line-height: 1.7; }
.ea-past-nudge .ea-past-title { font-weight: 800; }
/* 학생별 오답 리포트 안내 문단: 낱말 중간에서 끊기지 않게, 단계는 번호 목록으로 */
.sr-lead, .sr-help, .sr-steps { word-break: keep-all; text-wrap: pretty; }
/* 모의고사 학생 입력: 이번에 입력하는 학생들 (푼 날짜 · 학년 → 실제 응시 / 기출 풀이, student_reports.js) */
.sr-take { border: 1.5px solid var(--gin-mint-deep); border-radius: 10px; padding: 10px 14px; margin: 0 0 12px; background: #fff; }
.sr-take-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 14px; }
.sr-take-head > i { color: var(--gin-mint-deep); }
.sr-take-exam { margin-left: auto; font-size: 12.5px; color: var(--gin-ink-muted); }
.sr-take-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.sr-take-row label { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; }
.sr-take-row input, .sr-take-row select { width: auto; }
.sr-take-judge { font-size: 13px; padding: 4px 10px; border-radius: 8px; }
.sr-take-judge.is-real, .sr-take-badge.is-real { background: var(--gin-mint-surface); color: #0b5f55; }
.sr-take-judge.is-past, .sr-take-badge.is-past { background: #fff4e5; color: #9a4a00; }
.sr-take-note { margin: 6px 0 0; font-size: 12.5px; color: var(--gin-ink-muted); }
.sr-take-badge { font-size: 11.5px; font-weight: 700; padding: 1px 7px; border-radius: 99px; margin-left: 4px; }
/* 학생별 리포트 정답 관문: 정답표 입력 / AI 정답 · 해설 (student_reports.js) */
.sr-answer-gate { border: 1.5px solid #f0b65a; background: #fffaf0; border-radius: 10px; padding: 12px 16px; margin-bottom: 12px; font-size: 13.5px; word-break: keep-all; }
.sr-answer-gate p { margin: 0 0 6px; }
.sr-gate-title { font-size: 15px; }
.sr-gate-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.sr-gate-table { margin-top: 12px; max-height: 520px; overflow: auto; background: #fff; border: 1px solid var(--gin-line); border-radius: 8px; padding: 8px; }
.sr-gate-grid th { width: 80px; padding: 4px 8px; font-weight: 700; vertical-align: top; }
.sr-gate-grid td { padding: 4px; }
.sr-gated .sr-grid-tools, .sr-gated .sr-grid-wrap, .sr-gated .sr-steps, .sr-gated .sr-average-note, .sr-gated .sr-take { display: none; }
.sr-written { display: block; width: 100%; margin-top: 4px; font-size: 12px; border: 1px solid var(--gin-line); border-radius: 6px; padding: 3px 6px; }
.sr-average-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; padding: 9px 12px; border-radius: 8px; background: var(--gin-mint-surface); color: var(--gin-ink); font-size: 13px; line-height: 1.6; word-break: keep-all; }
.sr-average-note > i { color: var(--gin-mint-deep); margin-top: 2px; }
.sr-steps { margin: 0 0 12px; padding-left: 20px; font-size: 13px; line-height: 1.8; color: #495057; }
.ea-past-nudge .btn { flex: none; }
.eap-info.eap-info-top { margin-top: 14px; padding-top: 0; border-top: 0; margin-bottom: 6px; }
/* 기출 분석 '디자인 · 배점 수정' 창의 배점 표 (school_design_request.js) */
.school-points { margin-top: 12px; border: 1px solid var(--gin-line, #dfe6e8); border-radius: 10px; padding: 10px 12px; }
.school-points-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.school-points-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 10px; }
.school-points-cell { display: flex; align-items: center; gap: 6px; font-size: 13px; margin: 0; }
.school-points-cell span { flex: 1 1 auto; min-width: 44px; color: #495057; word-break: keep-all; }
.school-points-cell input { flex: none; width: 64px; }   /* '서·논술형 4-(1)'처럼 긴 번호에 밀려 칸이 사라지지 않게 */

/* 기출 분석 상세: 학생별 오답 리포트 (_student_reports.html, student_reports.js) */
.sr-lead { margin: 0 0 12px; color: var(--gin-ink-soft); font-size: var(--gin-fs-sm); line-height: 1.7; }
.sr-warn { color: #b26b00; }
.sr-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.sr-tab { padding: 7px 14px; border-radius: 999px; border: 1px solid var(--gin-line, #dfe6e8); background: #fff; font-size: 14px; font-weight: 700; color: var(--gin-ink-soft); }
.sr-tab.active { background: var(--gin-mint-surface); border-color: var(--gin-mint-deep); color: var(--gin-mint-deep); }
.sr-help { margin: 0 0 8px; font-size: 13px; color: var(--gin-ink-soft); line-height: 1.7; }
.sr-batch { font-size: 14px; }
.sr-numbers { display: flex; flex-wrap: wrap; gap: 4px; margin: 8px 0; font-size: 12px; color: var(--gin-ink-soft); align-items: center; }
.sr-numbers span { padding: 1px 7px; border-radius: 6px; background: #f1f4f5; }
.sr-batch-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.sr-batch-count { font-size: 13px; font-weight: 700; color: var(--gin-mint-deep); }
.sr-link-row { display: flex; gap: 6px; margin-bottom: 8px; }
.sr-switch { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.sr-list { margin-top: 16px; }
.sr-empty { margin: 0; font-size: 13px; color: var(--gin-ink-soft); }
.sr-table td { vertical-align: middle; font-size: 13px; }
.sr-wrong { max-width: 220px; color: var(--gin-ink-soft); }
.sr-summary { margin: 4px 0 8px; padding: 8px 12px; border-radius: 10px; background: #f6f9f9; font-size: 13px; }
.sr-table .sr-class-head td { background: #eef5f4; font-size: 13px; border-top: 2px solid #cfe3df; }
.sr-table .sr-class-col { width: 76px; }
.sr-class-input { width: 64px; padding: 2px 6px; }
.sr-rank { white-space: nowrap; color: var(--gin-ink-soft); }
.sr-rank b { color: var(--gin-ink, #222); }
.sr-grid-class { display: flex; gap: 4px; }
.sr-grid-class input:last-child { width: 64px; flex: 0 0 64px; }
.sr-school-field { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--gin-ink-soft); }
.sr-link-row .btn { white-space: nowrap; flex: none; }
.sr-school { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: #f6f9f9; }
.sr-school-label { flex: 1 1 100%; font-size: 13px; font-weight: 700; }
.sr-school-label small { font-weight: 400; color: var(--gin-ink-soft); }
.sr-school input { width: 120px; }
.sr-display { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; margin-top: 16px; padding: 10px 12px; border-radius: 12px; background: #f6f9f9; }
.sr-display .sr-school-label { flex: 0 0 auto; }
.sr-display .form-check { margin: 0; font-size: 13px; }
.sr-display-help { flex: 1 1 100%; color: var(--gin-ink-soft); font-size: 12px; }
/* 일괄 입력 표: 문항 세로 × 학생 가로 (학생 링크와 같은 답 고르기) */
/* 기출 분석 상세의 학생별 오답 리포트 소개 카드 (_student_reports_card.html) */
.sr-card-body { display: flex; align-items: center; gap: 28px; padding: 22px 26px; border: 1px solid #d6efe9; border-radius: 16px; background: linear-gradient(135deg, #f2fbf8 0%, #fff 70%); }
.sr-card-text { flex: 1; min-width: 0; }
.sr-card-kicker { margin: 0 0 6px; font-size: 13px; font-weight: 800; color: var(--gin-mint-deep, #00786f); }
.sr-card-text h3 { margin: 0 0 12px; font-size: 22px; font-weight: 800; line-height: 1.4; }
.sr-card-text h3 span { background: linear-gradient(transparent 60%, #b9eee3 60%); }
.sr-card-text ul { margin: 0 0 16px; padding-left: 18px; color: #3a434e; font-size: 14px; line-height: 1.9; }
.sr-card-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.sr-card-price { font-size: 13px; color: #868e96; }
.sr-card-sample img { display: block; width: 200px; border-radius: 6px; box-shadow: 0 10px 28px rgba(38,51,59,.16); transform: rotate(2deg); transition: transform .2s; }
.sr-card-sample:hover img { transform: rotate(0) scale(1.02); }
.school-mock-card .sr-card-body { background: linear-gradient(135deg, #f3f6fd 0%, #fff 70%); border-color: #dbe4f7; }
.school-mock-card .sr-card-kicker { color: #2f5d8a; }
.school-mock-card .sr-card-text h3 span { background: linear-gradient(transparent 60%, #cfdcf6 60%); }
.sp-cell .school-mock-card { margin-top: 14px; }
@media (max-width: 700px) { .sr-card-body { flex-direction: column; align-items: stretch; } .sr-card-sample img { width: 160px; margin: 0 auto; } }
.sr-grid-tools { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.sr-grid-wrap { overflow: auto; max-height: 560px; border: 1px solid #e6ecee; border-radius: 12px; }
.sr-grid { border-collapse: separate; border-spacing: 0; font-size: 13px; }
.sr-grid th, .sr-grid td { padding: 4px 8px; border-bottom: 1px solid #eef2f3; white-space: nowrap; background: #fff; }
.sr-grid thead th { position: sticky; top: 0; z-index: 2; background: #f6f9f9; vertical-align: top; }
.sr-grid .sr-grid-q { position: sticky; left: 0; z-index: 1; min-width: 72px; background: #f6f9f9; font-weight: 800; }
.sr-grid thead .sr-grid-q { z-index: 3; }
.sr-grid-s { min-width: 176px; }
.sr-grid-s input, .sr-grid-s .sr-message { margin-bottom: 4px; }
.sr-grid-s .sr-message { min-width: 160px; min-height: 110px; font-size: 12px; white-space: normal; resize: vertical; }
.sr-build-all { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; padding: 10px 12px; border-radius: 10px; background: #f2fbf8; border: 1px solid #d6efe9; font-size: 13px; }
.sr-grid-actions { display: flex; justify-content: space-between; }
.sr-grid-actions .btn { padding: 0; font-size: 12px; }
.sr-pick { min-width: 28px; height: 28px; margin-right: 2px; padding: 0 4px; border: 1px solid #d6e2e5; border-radius: 8px; background: #fff; font-size: 14px; }
.sr-pick-ox { font-size: 12px; font-weight: 700; }
.sr-pick.selected { background: #2bb5a0; border-color: #2bb5a0; color: #fff; }
.sr-partial { width: 54px; height: 28px; margin-left: 2px; padding: 0 4px; border: 1px solid #d6e2e5; border-radius: 8px; font-size: 12px; }
.sr-panel { margin-bottom: 10px; padding: 12px; border-radius: 12px; background: #f6f9f9; border: 1px solid #e6ecee; }
.sr-panel-foot { display: flex; justify-content: flex-end; margin-top: 8px; }
.sr-steps { margin: 0 0 8px; padding-left: 20px; font-size: 13px; line-height: 1.8; }
.sr-script { max-height: 180px; overflow: auto; margin: 0; padding: 10px; border-radius: 8px; background: #26333b; color: #e6f4f1; font-size: 11.5px; white-space: pre-wrap; }

/* 기출 분석 상세: 분석지 색상 (_report_style.html, report_style.js). 차트 색은 띠그래프 예시 팝업, 형광펜은 색상표 팝업 */
.rs-layout { display: grid; grid-template-columns: 1fr; gap: 18px; }
@media (min-width: 900px) { .rs-layout { grid-template-columns: 1.1fr 1fr; } }
.rs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.rs-label { min-width: 64px; font-size: 13px; font-weight: 800; }
.rs-label small { font-weight: 400; color: var(--gin-ink-soft); }
.rs-sections { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
/* 분석지 출력 설정 '학원 로고' 자리 고르기 (report_style.js renderLogos): 작은 A4 쪽 그림에 그 자리에 학원 로고 */
.rs-row-top { align-items: flex-start; }
.rs-logos { display: flex; flex-wrap: wrap; gap: 8px; }
.rs-logo-option { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border: 1px solid #dfe6e8; border-radius: 10px; background: #fff; font-size: 12px; color: #495057; }
.rs-logo-option.selected { border-color: var(--gin-mint-deep, #00786f); box-shadow: 0 0 0 2px var(--gin-mint-surface, #e3f6f2); color: #0e141b; }
.rs-logo-option.selected .rs-logo-label .bi { color: var(--gin-mint-deep, #00786f); }
.rs-page { position: relative; display: flex; flex-direction: column; gap: 4px; width: 76px; height: 106px; padding: 8px 8px 0; border: 1px solid #ced4da; border-radius: 3px; background: #fff; overflow: hidden; }
.rs-page > i { display: block; height: 3px; border-radius: 2px; background: #dee2e6; }
.rs-page > i.short { width: 60%; }
.rs-page > i.rs-page-title { height: 5px; width: 80%; margin: 0 auto 3px; background: #868e96; }
.rs-logo-title { display: block; max-width: 40px; max-height: 12px; margin: 0 auto; object-fit: contain; }
.rs-logo-bottom { position: absolute; bottom: 4px; max-width: 24px; max-height: 9px; object-fit: contain; }
.rs-logo-left { left: 5px; } .rs-logo-right { right: 5px; }
.rs-logo-empty { display: inline-flex; align-items: center; justify-content: center; font-size: 7px; font-weight: 800; color: #00786f; background: #e3f6f2; border-radius: 2px; padding: 1px 3px; }
span.rs-logo-title.rs-logo-empty { display: flex; width: 26px; margin: 0 auto; }
.rs-logo-small { max-height: 9px; } .rs-logo-large { max-height: 17px; max-width: 52px; }
.rs-logo-size { display: flex; align-items: center; gap: 8px; flex-basis: 100%; font-size: 12px; color: #495057; }
.rs-logo-size.is-off { opacity: .4; pointer-events: none; }
.rs-logo-hint { flex-basis: 100%; margin: 2px 0 0; font-size: 12px; color: #868e96; }
.rs-cover-toggle { flex-basis: 100%; display: flex; align-items: center; gap: 6px; margin-top: 4px; padding: 6px 10px; border: 1px solid #dee2e6; border-radius: 8px; background: #fff; font-size: 13px; color: #343a40; text-align: left; }
.rs-cover-toggle.selected { border-color: #20c997; background: #f1fbf7; }
.rs-cover-toggle small { color: #868e96; }
.rs-section-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid #e6ecee; border-radius: 10px; background: #fff; font-size: 13px; cursor: grab; }
.rs-section-item.is-hidden { opacity: .45; background: #f6f8f9; }
.rs-section-item.is-hidden .rs-section-label { text-decoration: line-through; }
.rs-grip { color: #b0bac0; }
.rs-num { min-width: 20px; font-weight: 800; color: var(--gin-mint-deep); }
.rs-section-label { flex: 1; font-weight: 700; }
.rs-icon { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--gin-ink-soft); }
.rs-icon:hover { background: #eef3f4; }
.rs-seg { display: inline-flex; border: 1px solid #dfe6e8; border-radius: 10px; overflow: hidden; }
.rs-seg-item { padding: 6px 14px; border: 0; background: #fff; font-size: 13px; font-weight: 700; color: var(--gin-ink-soft); }
.rs-seg-item + .rs-seg-item { border-left: 1px solid #dfe6e8; }
.rs-seg-item.selected { background: var(--gin-mint-surface); color: var(--gin-mint-deep); }
.rs-anchor { position: relative; }
.rs-current { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #dfe6e8; border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700; }
.rs-current .rs-band-bar { width: 90px; height: 12px; }
.rs-band-bar { display: flex; overflow: hidden; border-radius: 4px; }
.rs-band-bar i { display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; }
.rs-swatch { width: 26px; height: 14px; border-radius: 3px; display: inline-block; border: 1px solid rgba(0,0,0,.06); }
.rs-pop { position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; padding: 12px; border-radius: 14px; background: #fff; border: 1px solid #e6ecee; box-shadow: 0 12px 30px rgba(38,51,59,.16); }
.rs-pop-title { margin: 0 0 8px; font-size: 12px; font-weight: 800; color: var(--gin-ink-soft); }
.rs-pop-palette { width: 360px; }
.rs-palette { display: block; width: 100%; margin-bottom: 6px; padding: 8px 10px; border: 1px solid #e6ecee; border-radius: 10px; background: #fff; text-align: left; font-size: 13px; }
.rs-palette b { display: block; margin-bottom: 5px; }
.rs-palette .rs-band-bar { height: 20px; }
.rs-palette.selected, .rs-chip.selected { border-color: var(--gin-mint-deep); background: var(--gin-mint-surface); }
.rs-pop-highlight { width: 280px; }
.rs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.rs-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 4px; border: 1px solid #e6ecee; border-radius: 10px; background: #fff; font-size: 11px; font-weight: 700; }
.rs-chip span { width: 100%; height: 18px; border-radius: 4px; }
.rs-custom { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; font-size: 12px; font-weight: 700; }
.rs-custom input { width: 44px; height: 26px; padding: 0; border: 0; background: none; }
.rs-preview { margin: 4px 0 12px; font-size: 13px; color: var(--gin-ink-soft); }
.rs-preview mark { padding: 0 2px; font-weight: 700; color: inherit; }
/* 기출 분석 생성 화면의 분석지 출력 설정 (exam_analysis_upload.html) */
.eap-report-style { margin-top: 14px; padding: 14px; border: 1px solid #e6ecee; border-radius: 14px; background: #fbfdfc; }
.eap-report-style-head { margin-bottom: 10px; font-size: 14px; }
.eap-report-style-head span { margin-left: 6px; font-size: 12px; color: var(--gin-ink-soft); }
/* 기출 분석 상세: 학교 맞춤 유형 만들기 진행 팝업 (exam_analysis_detail.js) */
.types-progress-popup { position: fixed; right: 20px; bottom: 96px; z-index: 1080; width: 340px; max-width: calc(100vw - 32px); padding: 16px 18px; border-radius: 16px; background: #fff; border: 1px solid #cdeee6; box-shadow: 0 14px 36px rgba(38,51,59,.18); }
.types-progress-popup .btn-close { position: absolute; top: 10px; right: 10px; font-size: 10px; }
.types-progress-popup.is-done { border-color: var(--gin-mint-deep); }
.tp-title { margin: 0 0 6px; font-weight: 800; font-size: 15px; }
.tp-title .bi { color: var(--gin-mint-deep); }
.tp-text { margin: 0 0 10px; font-size: 13px; color: var(--gin-ink-soft); line-height: 1.6; }
.tp-bar { height: 8px; border-radius: 999px; background: #e9eef0; overflow: hidden; }
.tp-bar i { display: block; height: 100%; background: var(--gin-mint-deep); border-radius: 999px; transition: width .4s; }

/* 분석지 · 학생별 리포트 글 편집 (report_edit.html, report_edit.js): 지문분석 편집기(#document_canvas.analysis)의
   탭 · 머리 줄 · 섹션 배지 · keypoints 표를 그대로 쓰고, 여기에는 리포트에만 있는 것(빼기 버튼 · 한 칸짜리 표)만 둔다 */
#document_canvas.report-edit .edit-section { margin-top: 14px; }
#document_canvas.report-edit .edit-section-header { margin-bottom: 8px; }
#document_canvas.report-edit table.keypoints td[contenteditable] { line-height: 1.7; white-space: pre-wrap; }
#document_canvas.report-edit table.keypoints td[contenteditable]:focus { outline: 2px solid color-mix(in srgb, var(--theme-color) 45%, transparent); outline-offset: -2px; }
#document_canvas.report-edit table.re-single td { border-bottom: none; }
#document_canvas.report-edit table.keypoints th { width: 120px; }
#document_canvas.report-edit .re-del-cell { width: 40px; padding: 4px; text-align: center; vertical-align: middle; }
#document_canvas.report-edit .re-readonly { font-weight: 700; }
#document_canvas.report-edit .re-item { position: relative; margin-bottom: 8px; padding-right: 36px; }
#document_canvas.report-edit .re-item > .re-del { position: absolute; top: 4px; right: 0; }
#document_canvas.report-edit .re-del { width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; color: #9aa5ab; }
#document_canvas.report-edit .re-del:hover { background: #fdecea; color: #d0644a; }
#document_canvas.report-edit .re-divider { display: flex; align-items: center; gap: 10px; margin: 36px 0 6px; color: #00786f; font-size: 13px; font-weight: 800; }
#document_canvas.report-edit .re-divider::before, #document_canvas.report-edit .re-divider::after { content: ''; flex: 1; border-top: 2px dashed #9fd9cd; }
#document_canvas.report-edit .re-problem { position: relative; padding-right: 32px; }
#document_canvas.report-edit .re-problem > .re-del { position: absolute; top: 8px; right: 0; }
#document_canvas.report-edit .re-problem .datum-cell { padding: 8px 6px; }
#document_canvas.report-edit .re-problem .question, #document_canvas.report-edit .re-problem .choice,
#document_canvas.report-edit .re-problem .answer { min-height: 1.5em; outline: none; }
#document_canvas.report-edit .re-problem [contenteditable]:hover { background: #FCFFC3; }
#document_canvas.report-edit .re-problem .bordered_box table { width: 100%; border-collapse: collapse; margin: 4px 0; }
#document_canvas.report-edit .re-problem .bordered_box td { border: 1px solid #333; padding: 6px 8px; line-height: 1.7; white-space: pre-wrap; }
#document_canvas.report-edit .re-empty { font-size: 13px; color: var(--gin-ink-soft); }
#document_canvas.report-edit mark { padding: 0 1px; background: var(--re-highlight, #c8f0e8); font-weight: 700; color: inherit; }
/* 형광펜 도구 줄: 스크롤해도 위에 붙어 있다 (칠할 글자를 고른 채 바로 누르게) */
.re-marker-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 10px 0 4px; padding: 8px 10px;
  border: 1px solid #e6ecee; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(38,51,59,.06); }
.re-marker { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; font-size: var(--gin-fs-sm); border: 1px solid #ced4da; border-radius: 6px; background: #fff; }
.re-marker:hover { background: #f1f3f5; }
.re-marker > span { width: 16px; height: 12px; border-radius: 3px; border: 1px solid rgba(0,0,0,.08); }
.re-marker-clear { color: #c92a2a; border-color: #ffc9c9; }
.re-marker-hint { margin-left: auto; font-size: var(--gin-fs-xs, 12px); color: #868e96; }
/* 지문분석 편집: 구문 표시 · 해석 한 번에 지우기 [지우기 ▾] 메뉴 (edit_document_analysis.js _append_bulk_clear_tools) */
.syntax_bulk_tools { display: flex; justify-content: flex-end; margin: 0 0 6px; }
.syntax_bulk_menu { min-width: 300px; max-width: calc(100vw - 32px); }
.syntax_bulk_row { display: flex; align-items: center; gap: 4px; padding: 3px 10px; }
.syntax_bulk_row_label { flex: 1; font-size: var(--gin-fs-sm); color: var(--gin-ink); word-break: keep-all; }
.syntax_bulk_row .syntax_bulk_scope { padding: 1px 8px; font-size: var(--gin-fs-xs); border: 1px solid var(--gin-line); white-space: nowrap; }
.syntax_bulk_row .syntax_bulk_scope:hover { border-color: var(--gin-ink-muted); }
/* 지문 변형 생성: 학교 변형 방식 고르기 (paraphrase_school_variation.js) */
.psv-panel { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--gin-line); border-radius: 10px; background: #fff; }
.psv-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-bottom: 10px; }
.psv-head b { font-size: var(--gin-fs); color: var(--gin-ink); }
.psv-head span { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); word-break: keep-all; }
.psv-empty { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); word-break: keep-all; }
.psv-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.psv-row { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; align-items: center; text-align: left; padding: 9px 11px;
    border: 1px solid var(--gin-line); border-radius: 8px; background: #fff; cursor: pointer; }
.psv-row:hover { border-color: var(--gin-mint-deep); }
.psv-row.active { border-color: var(--gin-mint-deep); background: var(--gin-mint-surface); box-shadow: 0 0 0 1px var(--gin-mint-deep) inset; }
.psv-name { font-weight: 600; color: var(--gin-ink); font-size: var(--gin-fs-sm); }
.psv-degree { display: flex; align-items: center; gap: 6px; font-size: var(--gin-fs-sm); color: var(--gin-mint-deep); }
.psv-bar { width: 56px; height: 6px; border-radius: 3px; background: var(--gin-line-soft); overflow: hidden; }
.psv-bar span { display: block; height: 100%; background: var(--gin-mint-deep); }
.psv-sub { grid-column: 1 / -1; font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); word-break: keep-all; }
/* 학생 리포트: 학교 등급 기준 (student_reports.js syncRule) */
.sr-grade-rule { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.sr-grade-rule-label { font-size: 13px; font-weight: 600; }
.sr-grade-rule select { width: auto; }
.sr-school .sr-grade-rule input { width: 130px; }
.sr-grade-rule-help { flex: 1 1 100%; font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); word-break: keep-all; }
.sr-grade-rule-help:empty { display: none; }
/* 원서 모드: 활동별 문항 수 표 (book_workbook_form.js) */
.book-config-row-wide { grid-template-columns: 1fr; }
.book-config-row-wide .detail-cfg-section { margin: 0; }
.book-count-cell { display: flex; align-items: center; gap: 8px; }
/* 원서 모드 문서 편집 (edit_document_book.js) */
.rw-edit-chapter { padding: 12px 4px; }
.rw-edit-part { margin: 22px 0 8px; font-weight: 800; letter-spacing: .04em; color: var(--theme-color, #c65252); }
.rw-edit-reading { font-size: 1.15rem; padding-top: 14px; border-top: 2px solid var(--theme-color, #c65252); }   /* 지문으로 나눈 챕터: Reading 1 · 2 … · 종합 구분 (edit_document_book.js) */
.rw-edit-section { margin: 0 0 16px; }
.rw-edit-section h4 { font-size: 15px; font-weight: 700; margin: 0 0 8px; }
.rw-edit-item { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 10px 12px; margin-bottom: 8px; border: 1px solid var(--gin-line); border-radius: 8px; background: #fff; }
.rw-edit-item.rw-edit-off { opacity: .5; background: #f6f7f8; }
.rw-edit-item-head { flex: 1 1 100%; font-weight: 700; font-size: 13px; color: var(--gin-ink-soft); }
.rw-edit-item-head small { font-weight: 400; margin-left: 6px; }
.rw-edit-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 180px; margin: 0; }
.rw-edit-field.wide { flex: 1 1 100%; }
.rw-edit-field.narrow { flex: 0 0 90px; }
.rw-edit-field > span, .rw-edit-list > span { font-size: 12px; color: var(--gin-ink-muted); }
.rw-edit-field textarea, .rw-edit-list textarea { resize: none; overflow: hidden; }
.rw-edit-list { flex: 1 1 100%; display: flex; flex-direction: column; gap: 4px; }
.rw-edit-list-row { display: flex; align-items: flex-start; gap: 6px; flex: 1 1 100%; }
.rw-edit-list-row b { width: 20px; padding-top: 4px; color: var(--gin-ink-soft); }
/* 리더스북 문서 편집 (edit_document_readers_book.js): 칸 모양은 위 원서 편집(.rw-edit-*)을 같이 쓰고, 묶음 · 본문 · 순서 목록만 따로 */
.rb-edit .tab-pane { padding: 12px 4px; }
.rb-edit-group { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border-left: 3px solid var(--gin-line); }
.rb-edit-group > span { flex: 1 1 100%; font-size: 12px; font-weight: 700; color: var(--gin-ink-soft); }
.rb-edit-passage { min-height: 160px; font-family: 'Noto Serif', serif; line-height: 1.6; }
.rb-edit-help { font-size: 13px; color: var(--gin-ink-soft); margin: 0 0 10px; }
.rb-arrange { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rb-arrange-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--gin-line); border-radius: 10px; background: #fff;
                   cursor: grab; touch-action: pan-y; user-select: none; }
.rb-arrange-item.rb-arrange-unit { font-weight: 700; background: #fff8ef; border-color: #f3c99a; }
.rb-arrange-item.rb-arrange-part { font-weight: 800; background: #f1f5ff; }
.rb-arrange-item.rb-arrange-activity { margin-left: 22px; }
.rb-arrange-item.is-hidden { opacity: .45; background: #f3f4f6; }
.rb-arrange-item.is-hidden .rb-arrange-label { text-decoration: line-through; }
.rb-arrange-ghost { opacity: .35; }
.rb-arrange-grip { color: var(--gin-ink-muted); }
.rb-arrange-label { flex: 1; min-width: 0; }
.rb-arrange-eye { border: 0; background: none; font-size: 18px; color: var(--gin-ink-soft); padding: 2px 6px; }
.rb-arrange-fixed { padding: 8px 12px; margin: 6px 0; color: var(--gin-ink-muted); font-size: 13px; }
@media (max-width: 576px) { .rb-arrange-item.rb-arrange-activity { margin-left: 10px; } }
.book-sets { display: flex; align-items: center; gap: 8px; font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.book-sets input { width: 70px; }
/* 원서 모드: 지문당 문제 수를 켰을 때 모고 · 내신 유형마다 예제 보기 (book_workbook_form.js) */
/* 리더스북 편집: 그림 다시 그리기 칸 (edit_document_readers_book.js) */
.rb-regen-images { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 10px; }
.rb-regen-images .rb-regen-box { flex: 1 1 240px; max-width: 360px; }
.rb-regen-image { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--gin-ink-muted); }
.rb-regen-image img { width: 100%; border-radius: 8px; border: 1px solid var(--gin-line); background: #fafafa; }
.rb-regen-preview { max-width: 100%; border-radius: 8px; }
.rb-add-activity { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.rb-add-activity select { width: auto; max-width: 260px; }
/* 리더스북 편집 '쪽 보며 고치기' (edit_document_readers_book.js): 쪽 그림 위 누르는 상자 · 고치기 창 · 쪽 목록 */
:root { --gin-rbx-hit: #2f7cf6; --gin-rbx-edited: #f08a1c; }
#document_canvas.readers_book { padding: 0; }
.rbx-bar { position: sticky; top: var(--rbx-top, 0px); z-index: 20; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 4px; background: #fff;
           border-bottom: 1px solid var(--gin-line); }
.rbx-switch { display: inline-flex; border: 1px solid var(--gin-line); border-radius: 999px; overflow: hidden; }
.rbx-switch button { border: 0; background: #fff; padding: 6px 14px; font-size: 13.5px; color: var(--gin-ink-soft); }
.rbx-switch button.active { background: var(--gin-ink-soft); color: #fff; font-weight: 700; }
.rbx-status { flex: 1; min-width: 160px; font-size: 13px; color: var(--gin-ink-muted); display: inline-flex; align-items: center; gap: 6px; }
.rbx-wait { padding: 60px 16px; text-align: center; color: var(--gin-ink-soft); display: flex; gap: 8px; align-items: center; justify-content: center; flex-wrap: wrap; }
.rbx-view { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 18px; padding-top: 12px; }
.rbx-rail { position: sticky; top: calc(var(--rbx-top, 0px) + var(--rbx-bar-h, 0px) + 10px); align-self: start;
            max-height: calc(100vh - var(--rbx-top, 0px) - var(--rbx-bar-h, 0px) - 20px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px;
            padding: 2px 4px 12px 2px; }
.rbx-thumb { position: relative; border: 2px solid transparent; border-radius: 6px; padding: 0; background: none; text-align: center; font-size: 11px;
             color: var(--gin-ink-muted); }
.rbx-thumb img { width: 100%; height: auto; display: block; border-radius: 4px; box-shadow: 0 1px 3px rgba(0, 0, 0, .18); background: #f6f6f6; aspect-ratio: 210 / 297; }
.rbx-thumb.active { border-color: var(--gin-rbx-hit); }
.rbx-thumb.is-hidden img { opacity: .35; }
.rbx-thumb .regen-tab-dot { position: absolute; top: 4px; right: 4px; }
/* 고른 쪽 하나 (가운데) + 그 쪽 글 칸 (오른쪽, 좁으면 아래). 쪽 그림은 가벼운 JPEG (readers_book.readers_page_preview_path) */
.rbx-stage { display: grid; grid-template-columns: minmax(0, 620px) minmax(300px, 1fr); gap: 18px; align-items: start; min-width: 0; }
.rbx-page { margin: 0; min-width: 0; }
.rbx-page-nav { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.rbx-page-nav + .rbx-menu-btn { margin-left: 0; }
.rbx-nav-btn { border: 1px solid var(--gin-line); background: #fff; border-radius: 8px; padding: 1px 8px; font-size: 14px; color: var(--gin-ink-soft); line-height: 1.5; }
.rbx-nav-btn:disabled { opacity: .35; }
.rbx-page-count { font-size: 12px; color: var(--gin-ink-muted); min-width: 52px; text-align: center; }
.rbx-sheet-wait { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: #f6f7f8; line-height: normal; }
.rbx-side { position: sticky; top: calc(var(--rbx-top, 0px) + var(--rbx-bar-h, 0px) + 10px); max-height: calc(100vh - var(--rbx-top, 0px) - var(--rbx-bar-h, 0px) - 20px);
            overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding: 2px 4px 12px 2px; min-width: 0; }
.rbx-side-head { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.rbx-side-head span { font-size: 12px; color: var(--gin-ink-muted); }
.rbx-side-wait { padding: 24px 8px; color: var(--gin-ink-soft); font-size: 13px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rbx-side-item { border: 1px solid #e7ecee; border-radius: 10px; padding: 10px 12px; background: #fff; scroll-margin: 8px; }
.rbx-side-item h5 { font-size: 13px; font-weight: 700; margin: 0 0 8px; color: var(--gin-ink-soft); }
.rbx-side-item.is-focus { border-color: var(--gin-rbx-hit); box-shadow: 0 0 0 2px color-mix(in srgb, var(--gin-rbx-hit) 18%, transparent); }
.rbx-side-audio .rbx-note { margin: 0 0 8px; }
.rbx-progress { color: var(--gin-ink-muted); }
@media (max-width: 1100px) {
    .rbx-stage { grid-template-columns: minmax(0, 1fr); }
    .rbx-page { max-width: 640px; }
    .rbx-side { position: static; max-height: none; overflow: visible; }
}
.rbx-page-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--gin-ink-soft); margin-bottom: 6px; min-height: 30px; }
.rbx-page-head > b { min-width: 26px; height: 22px; border-radius: 11px; background: var(--gin-ink-soft); color: #fff; font-size: 12px; display: inline-flex;
                     align-items: center; justify-content: center; padding: 0 6px; }
.rbx-page-label { font-weight: 600; }
.rbx-tag { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: #eceff1; color: var(--gin-ink-muted); }
.rbx-page-head .rb-regen-box { display: inline-flex; }
.rbx-menu-btn { margin-left: auto; border: 1px solid var(--gin-line); background: #fff; border-radius: 8px; padding: 2px 10px; font-size: 16px; color: var(--gin-ink-soft); }
.rbx-menu-btn:hover { background: #f3f5f7; }
.rbx-sheet { position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .14); border-radius: 2px; background: #fff; line-height: 0; }
.rbx-sheet img { width: 100%; height: auto; display: block; aspect-ratio: 210 / 297; }
.rbx-page.is-hidden .rbx-sheet { opacity: .4; }
.rbx-hit { position: absolute; padding: 0; margin: 0; border: 1.5px solid transparent; border-radius: 4px; background: transparent; cursor: pointer; }
.rbx-hit:hover, .rbx-hit:focus-visible, .rbx-hit.is-open { border-color: var(--gin-rbx-hit); background: color-mix(in srgb, var(--gin-rbx-hit) 8%, transparent); outline: none; }
.rbx-hit-photo:hover, .rbx-hit-photo.is-open { border-style: dashed; background: color-mix(in srgb, var(--gin-rbx-hit) 5%, transparent); }
.rbx-hit.is-edited { border-color: var(--gin-rbx-edited); background: color-mix(in srgb, var(--gin-rbx-edited) 10%, transparent); }
.rbx-hit.is-edited::after { content: '고침'; position: absolute; top: -9px; right: -4px; line-height: 1; font-size: 10.5px; font-weight: 700; color: #fff;
                            background: var(--gin-rbx-edited); border-radius: 6px; padding: 3px 5px; }
/* 고치기 창: 넓은 화면은 누른 상자 옆, 휴대폰은 아래에서 올라오는 창 */
.rbx-pop { position: absolute; z-index: 1060; background: #fff; border-radius: 12px; box-shadow: 0 12px 40px rgba(20, 30, 40, .25); border: 1px solid var(--gin-line);
           display: flex; flex-direction: column; max-height: min(78vh, 720px); }
.rbx-pop.is-sheet { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 16px 16px 0 0; max-height: 80vh; }
.rbx-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 1059; }
.rbx-pop-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; border-bottom: 1px solid #eef1f3; }
.rbx-pop-head b { flex: 1; font-size: 15px; }
.rbx-pop-close { border: 0; background: none; font-size: 15px; color: var(--gin-ink-muted); padding: 4px; }
.rbx-pop-body { padding: 10px 14px; overflow-y: auto; flex: 1; }
.rbx-pop-actions { padding: 8px 14px 12px; border-top: 1px solid #eef1f3; display: flex; justify-content: flex-end; }
.rbx-pop-actions:empty { display: none; }
.rbx-pop-buttons { display: flex; gap: 8px; }
.rbx-pop.is-sheet .rbx-pop-actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.rbx-form { display: flex; flex-wrap: wrap; gap: 10px 12px; }
.rbx-form-part { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 8px 12px; }
.rbx-form-part h5 { flex: 1 1 100%; font-size: 13px; font-weight: 700; margin: 4px 0 0; color: var(--gin-ink-soft); }
.rbx-field { display: flex; flex-direction: column; gap: 3px; flex: 1 1 100%; margin: 0; }
.rbx-field.narrow { flex: 0 0 110px; }
.rbx-field > span, .rbx-list > span, .rbx-group > span { font-size: 12px; color: var(--gin-ink-muted); }
.rbx-field textarea { resize: none; overflow: hidden; font-size: 14px; }
.rbx-field textarea.rbx-passage { font-family: 'Noto Serif', serif; line-height: 1.6; min-height: 180px; }
.rbx-check { flex-direction: row; align-items: center; gap: 6px; font-size: 13px; }
.rbx-field.is-answer > span, .rbx-list.is-answer > span, .rbx-group.is-answer > span { color: #1f8a4c; font-weight: 700; }
.rbx-field.is-answer textarea, .rbx-field.is-answer input, .rbx-field.is-answer select { border-color: #9fd3b4; background: #f5fbf7; }
.rbx-list, .rbx-group { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.rbx-group { padding-left: 10px; border-left: 3px solid #eef1f3; }
.rbx-list-row { display: flex; align-items: flex-start; gap: 6px; }
.rbx-list-row b { width: 18px; padding-top: 6px; font-size: 12px; color: var(--gin-ink-muted); }
.rbx-item { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 10px; border: 1px solid #e7ecee; border-radius: 8px; }
.rbx-item-head { flex: 1 1 100%; font-size: 12px; font-weight: 700; color: var(--gin-ink-muted); }
.rbx-note { font-size: 12.5px; color: var(--gin-ink-muted); margin: 8px 0 0; flex: 1 1 100%; }
.rbx-crop { width: 100%; border-radius: 8px; background-repeat: no-repeat; background-color: #f3f4f6; }
.rbx-menu { display: flex; flex-direction: column; }
.rbx-menu-item { border: 0; background: none; text-align: left; padding: 10px 6px; font-size: 14px; border-radius: 8px; color: var(--gin-ink-soft); }
.rbx-menu-item:hover { background: #f3f5f7; }
.rbx-menu-item i { width: 22px; display: inline-block; }
.rbx-help { font-size: 13px; color: var(--gin-ink-soft); margin: 12px 0 10px; }
.rbx-arrange-pane { max-width: 760px; }
.rbx-arrange-thumb { width: 38px; flex: 0 0 38px; }
.rbx-arrange-thumb img { width: 100%; display: block; border-radius: 3px; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); aspect-ratio: 210 / 297; }
.rbx-cmp-page { width: 100%; border-radius: 6px; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
@media (max-width: 768px) {
    .rbx-view { grid-template-columns: minmax(0, 1fr); gap: 10px; }
    .rbx-rail { top: calc(var(--rbx-top, 0px) + var(--rbx-bar-h, 0px)); z-index: 15; flex-direction: row; overflow-x: auto; overflow-y: hidden; max-height: none;
                background: #fff; padding: 6px 2px; border-bottom: 1px solid #eef1f3; }
    .rbx-thumb > span { display: none; }
    .rbx-thumb { flex: 0 0 44px; }
    .rbx-page-count { min-width: 44px; }
    .rbx-bar { gap: 6px; padding: 6px 0; }
    .rbx-switch button { padding: 5px 10px; font-size: 13px; }
    #rbx_save { display: none; }   /* 휴대폰은 위 제목 줄의 저장 버튼 하나만 */
    .rbx-status.is-quiet { display: none; }
    #edit_document_toolbar.rbx-unstick { position: static; }
    .rbx-status { order: 3; flex: 1 1 100%; font-size: 12px; min-width: 0; }
}
.sr-answer-fix { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; font-size: 13px; word-break: keep-all; }
.sr-answer-fix-note { color: var(--gin-ink-muted); }
.sr-answer-fix .sr-gate-table { flex-basis: 100%; margin-top: 4px; }

/* 지문 문법 문서의 '✨ 개념 넣어 만들기' (_worksheet_breadcrumb.html): 메뉴에 숨지 않게 반짝이는 버튼. 움직임 줄이기 설정이면 멈춘다 */
.gin-shimmer-btn {
    position: relative; overflow: hidden; color: #fff; font-weight: 600; border: 0; white-space: nowrap;
    background: linear-gradient(110deg, var(--gin-primary, #0f766e) 0%, #14b8a6 50%, var(--gin-primary, #0f766e) 100%);
    background-size: 200% 100%; animation: gin-shimmer-bg 3.2s ease-in-out infinite; box-shadow: 0 2px 10px rgba(20, 184, 166, 0.35);
}
.gin-shimmer-btn:hover, .gin-shimmer-btn:focus { color: #fff; filter: brightness(1.06); }
.gin-shimmer-btn::after {
    content: ''; position: absolute; top: 0; left: -60%; width: 40%; height: 100%; pointer-events: none;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.55), transparent);
    animation: gin-shimmer-sweep 2.6s ease-in-out infinite;
}
.gin-shimmer-price { font-weight: 400; font-size: 0.85em; opacity: 0.9; margin-left: 2px; }
@keyframes gin-shimmer-bg { 0%, 100% { background-position: 0% 0; } 50% { background-position: 100% 0; } }
@keyframes gin-shimmer-sweep { 0% { left: -60%; } 55%, 100% { left: 130%; } }
@media (prefers-reduced-motion: reduce) {
    .gin-shimmer-btn, .gin-shimmer-btn::after { animation: none; }
    .gin-shimmer-btn::after { display: none; }
}
.cfg-disabled { opacity: 0.5; }
/* 원서: 지문이 여럿인데 문제가 모자랄 때 안내 (book_workbook_form.js refreshSparseNotice) · '지문마다 3문제 (추천)' 카드 */
.book-sparse-notice { margin: 4px 0 12px; padding: 10px 14px; border-radius: 10px; background: var(--gin-warn-row-bg); border: 1px solid var(--gin-warn-row-bg-range); font-size: 13.5px; word-break: keep-all; }
.book-sparse-notice p { margin: 0 0 8px; }
.book-sparse-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.book-sparse-actions .btn { white-space: nowrap; }
/* '활동별 문항 수' 줄: 제목은 왼쪽, [모두 지우기]는 오른쪽 끝 (아래 표의 입력 칸 쪽), 세로 가운데 맞춤 */
.book-config-label-bar { display: flex; align-items: center; gap: 8px; padding-top: 0; }
.book-config-label-bar .book-clear-counts { margin-left: auto; padding: 1px 8px; font-size: 12px; white-space: nowrap; }
/* 원서 '낱말 띠 색' (gin_shared.js Gin.renderBandColorInput): [테마 색] 칩 + 색 고르기 */
.band-color-input { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.band-color-input .clr-field input { width: 120px; }
/* 원서 · 챕터북 편집 화면 '음원 · 동화 영상' 칸 (edit_document_book.js media_panel_html) */
.rw-media-panel { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--gin-border, #dee2e6); border-radius: 10px; background: #fafbfc; }
.rw-media-title { font-weight: 700; margin-bottom: 8px; }
.rw-media-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 4px 0; }
.rw-media-name { min-width: 96px; font-weight: 600; font-size: 14px; }
.rw-media-state { font-size: 12.5px; padding: 1px 8px; border-radius: 999px; background: #eef0f2; color: #5a636e; }
.rw-media-state.on { background: #e3f4e8; color: #1f7a3d; }
.rw-media-point { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 12px; }
.rw-media-reason { font-size: 12.5px; color: var(--gin-ink-soft, #6b7480); }
.rw-media-hint { margin: 8px 0 0; font-size: 12.5px; color: var(--gin-ink-soft, #6b7480); word-break: keep-all; }

/* 모의고사 유형 PDF 출력 설정 '필기 해설지' 줄: 문항당 값 · 모양 미리보기 (school_explain_picker.js) */
.sx-line { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.sx-price { font-size: 0.82em; color: #8a8a8a; }
.sx-list-price { color: #9a9a9a; }
.sx-sale-price { color: var(--theme-color, #d6336c); font-weight: 700; }
.sx-btn-chip { display: block; margin-top: 2px; font-size: 0.72em; font-weight: 600; color: #ffd8a8; line-height: 1.2; }
.sx-discount-chip { display: inline-block; margin-left: 5px; padding: 0 6px; font-size: 0.9em; line-height: 1.6; border-radius: 9px; background: #fff1e8; color: #e8590c; font-weight: 600; }
.sx-inline-preview { display: block; width: 150px; height: auto; margin-top: 8px; border: 1px solid #ddd; border-radius: 3px; }
.sx-popover { position: absolute; z-index: 2000; padding: 6px; background: #fff; border: 1px solid #ddd; border-radius: 6px; box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15); }
.sx-popover img { display: block; width: 100%; height: auto; }
.sx-popover-caption { margin-top: 4px; font-size: 0.78em; color: #666; text-align: center; }

/* 지문분석 '어느 학교 시험을 준비하나요?' (analysis_study_form.js) */
.study-school .sp-select { min-width: 300px; }
.study-school .sp-note { margin: 6px 0 0; }
.study-school-link { color: var(--gin-mint-deep); font-weight: 700; text-decoration: none; }
.study-school-link:hover { text-decoration: underline; }
.study-school-picked { display: inline-flex; align-items: center; gap: 4px; font-size: var(--gin-fs-xs); color: var(--gin-mint-deep); font-weight: 700; }

/* 지문분석 '문법 설명 추가' 줄 (worksheet_form.js render_study_notes_config): 이름에 마우스를 올리면 스타일3 첫 쪽 예시 */
.study-label-wrap { position: relative; display: inline-flex; align-items: center; outline: none; }
.study-label-text { cursor: help; text-decoration: underline dotted; text-decoration-color: #adb5bd; text-underline-offset: 4px; text-decoration-thickness: 1px; }
.study-label-wrap:hover .study-label-text, .study-label-wrap:focus .study-label-text, .study-label-wrap.study-preview-open .study-label-text { color: var(--gin-mint-deep); text-decoration-color: var(--gin-mint-deep); }
.study-preview { display: none; position: absolute; top: calc(100% + 8px); left: 0; z-index: 30; width: 444px; padding: 10px 12px 12px; background: #fff; text-align: left;
  border: 1px solid #dee2e6; border-radius: 8px; box-shadow: 0 8px 24px rgba(14, 20, 27, 0.16); }
.study-preview::before { content: ''; position: absolute; top: -6px; right: 40px; width: 10px; height: 10px; background: #fff; border-left: 1px solid #dee2e6; border-top: 1px solid #dee2e6; transform: rotate(45deg); }
.study-preview-head { display: block; font-size: var(--gin-fs-sm); font-weight: 700; color: var(--gin-ink); margin-bottom: 8px; }
.study-preview-head span { font-weight: 400; font-size: var(--gin-fs-xs); color: var(--gin-ink-muted); margin-left: 4px; }
.study-preview img { display: block; width: 420px; height: auto; border: 1px solid #e5e5e5; }
@media (hover: hover) { .study-label-wrap:hover .study-preview { display: block; } }
.study-label-wrap.study-preview-open .study-preview { display: block; }
@media (min-width: 576px) { .study-preview { left: auto; right: -12px; } }
/* 넣기/안 넣기 묶음: 레이아웃 스타일 버튼의 '새 스타일' 반짝이(label.layout-style-sparkle, @keyframes sparkle)와 같은 노란 빛 + ✨ */
.study-highlight { position: relative; display: inline-flex; align-items: center; padding: 4px 16px 4px 10px; border-radius: 8px;
  background: #fff; border: 1px solid rgba(255, 180, 0, 0.5); animation: sparkle 1.4s ease-in-out infinite; }
.study-highlight .btn-group { position: relative; z-index: 1; }
.study-sparkle { position: absolute; top: 2px; right: 3px; z-index: 3; line-height: 0; }
@media (prefers-reduced-motion: reduce) { .study-highlight { animation: none; } }
@media (max-width: 575.98px) {
  .study-school .sp-select { min-width: 0; width: 100%; }
  .study-preview { width: calc(100vw - 32px); max-width: 444px; left: -4px; }
  .study-preview::before { right: auto; left: 40px; }
  .study-preview img { width: 100%; }
}

/* 기출 분석 '반별 리포트' 칸 (_class_report_card.html) */
.class-report-card { margin: 28px 0 12px; padding: 18px 20px; border: 1px solid #dee2e6; border-radius: 10px; background: #fff; }
.class-report-head h3 { font-size: 1.1rem; font-weight: 700; margin: 0 0 6px; }
.class-report-sub { font-size: var(--gin-fs-xs); font-weight: 500; color: var(--gin-ink-muted); margin-left: 6px; }
.class-report-head p { font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); margin: 0 0 12px; }
.class-report-actions { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.class-report-colors { display: flex; align-items: center; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.class-report-swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #fff; background: var(--swatch); box-shadow: 0 0 0 1px #ced4da; padding: 0; cursor: pointer; }
.class-report-swatch.active, .class-report-swatch-default.active { box-shadow: 0 0 0 2px var(--gin-ink, #1f2328); }
.class-report-swatch-default { height: 24px; padding: 0 10px; border-radius: 12px; border: 1px solid #ced4da; background: #fff; font-size: var(--gin-fs-xs); cursor: pointer; }
.class-report-swatch-custom { position: relative; overflow: hidden; background: conic-gradient(#d64545, #f6c453, #00a396, #2a78d6, #ad9fe3, #d64545); }
.class-report-swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* 지문분석 [생성하기] 전 '스타일3로 만들어 볼까요?' 팝업 (style3_offer.js) */
.style3-offer .modal-content { border: 0; border-radius: 14px; overflow: hidden; }
.style3-offer .modal-body { position: relative; padding: 22px; }
.style3-offer-close { position: absolute; top: 14px; right: 14px; z-index: 2; }
.style3-offer-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 22px; align-items: center; }
.style3-offer-pictures { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.style3-offer-pictures img { width: 100%; height: auto; border: 1px solid #e5e5e5; border-radius: 6px; box-shadow: 0 6px 18px rgba(14, 20, 27, 0.10); }
.style3-offer-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #e6f4ea; color: #2f9e44; font-weight: 700; font-size: var(--gin-fs-xs); margin-bottom: 8px; }
.style3-offer-text h3 { font-size: 1.45rem; font-weight: 800; margin: 0 0 6px; }
.style3-offer-lead { color: var(--gin-ink-soft); margin-bottom: 10px; }
.style3-offer-text ul { padding-left: 1.1em; margin-bottom: 12px; }
.style3-offer-text li { margin-bottom: 4px; }
.style3-offer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 767.98px) {
  .style3-offer-layout { grid-template-columns: 1fr; }
  .style3-offer .modal-body { padding: 16px; }
}

/* 학교 동형 편집: 문항 목록의 배점 칸 · 합계 (edit_document_paragraph.js) */
.school-points-input { width: 3.4em; padding: 0 2px; border: 1px solid #ced4da; border-radius: 4px; font-size: inherit; text-align: right; }
.school-points-total { padding: 6px 10px; font-weight: 700; font-size: var(--gin-fs-sm); color: var(--gin-ink-soft); }
.school-points-total.off { color: #c92a2a; }

/* 모의고사 유형 입력: 대화문으로 인식한 지문 안내 (worksheet_form.js update_dialogue_note) */
.dialogue-detect-note { margin: 6px 0; padding: 6px 10px; border-radius: 6px; background: #eef6ff; color: var(--gin-ink-soft); font-size: var(--gin-fs-sm); }

/* 단어장 저장 확인 창: 짝 표현 · 내 지문 DB 예문 넣기 (vocabulary_list_options.js) */
.vocabulary-save-option { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 10px; cursor: pointer; }
.vocabulary-save-option.is-disabled { cursor: default; opacity: .75; }
.vocabulary-save-option .form-check-input { margin-top: 4px; flex: none; }
.vocabulary-save-option-text { flex: 1; min-width: 0; }
.vocabulary-save-option-title { font-weight: 700; }
.vocabulary-save-option-description { font-size: .88rem; color: #4b5563; margin-top: 2px; }
.vocabulary-save-option-hint { font-size: .85rem; color: #b45309; margin-top: 6px; }
.vocabulary-save-option-preview { width: 240px; flex: none; border: 1px solid #e5e7eb; border-radius: 6px; }
.vocabulary-save-point { font-size: .9rem; color: #1f2937; font-weight: 600; text-align: right; }
@media (max-width: 576px) { .vocabulary-save-option { flex-wrap: wrap; } .vocabulary-save-option-preview { width: 100%; } }

/* 단어장 '찾을 범위' (내 지문 DB 예문을 고른 폴더 · 지문 세트에서만, vocabulary_list_options.js) */
.vocabulary-scope-tree { max-height: 240px; overflow-y: auto; border: 1px solid #dee2e6; border-radius: 6px; padding: 6px 10px; background: #fff; }
.vocabulary-scope-node { display: flex; align-items: center; gap: 6px; padding: 2px 0; font-size: 0.9rem; cursor: pointer; }
.vocabulary-scope-node .form-check-input { margin: 0; }
.vocabulary-scope-node .bi { color: #6c757d; }
.vocabulary-scope-node.is-file span { color: #343a40; }
.vocabulary-scope-summary { margin-top: 4px; font-size: 0.82rem; color: #6c757d; }
