/* 영소립 Sound & Build — 사이트 전체 CSS 한 파일 */

:root {
  /* 색: 바탕 60 · 잉크 30 · 버건디 7 · 노랑 3 */
  --paper: #ffffff;
  --paper-2: #f4f5f7;
  --tint: #f3f5f8;      /* 구분 띠 · 표 머리 · 하위 페이지 바탕 */
  --card: #ffffff;
  --ink: #16140f;
  --ink-2: #4b5059;
  --ink-3: #8b9099;
  --line: #e0e3e8;
  --dark: #141210;
  --dark-2: #1f1c18;
  --dark-line: #34302a;
  --red: #7a0e0e;          /* 로고 버건디 — 주요 버튼 · 강조 숫자에만 */
  --red-2: #961616;
  --red-soft: #f6e9e6;
  --yellow: #ffd400;       /* 형광펜 · 배지 · 진도바에만 */
  --yellow-soft: #fff1a8;

  /* 문장 훈련 문법 색 (브랜드 버건디와 다른 선명한 계열) */
  --g-verb: #1d4ed8;
  --g-noun: #e11d2a;
  --g-conn: #0f9d58;
  --g-coord: #9333ea;
  --g-mod: #4b8fd1;
  --g-comp: #b7791f;

  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  --serif: "Playfair Display", Georgia, "Times New Roman", serif;

  --wrap: 1180px;
  --gut: clamp(16px, 4vw, 32px);
  --r: 14px;
  --r-sm: 9px;
  --pill: 999px;
  --shadow: 0 1px 2px rgba(22, 20, 15, .06), 0 8px 24px rgba(22, 20, 15, .08);
  --shadow-up: 0 2px 4px rgba(22, 20, 15, .06), 0 16px 40px rgba(22, 20, 15, .12);
  --ease: cubic-bezier(.22, .8, .24, 1);
  --hdr: 76px;
}

/* ── 기본 ───────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
* { -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; font-size: 106.25%; } /* 글자 전체 17px 기준 */
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: var(--font); font-size: 1rem; line-height: 1.7;
  word-break: keep-all; overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ul, ol { margin: 0; }
/* 줄바꿈: 마지막 줄에 낱말 하나만 남지 않게, 제목은 줄 길이를 고르게 */
p, li, dd, figcaption, blockquote { text-wrap: pretty; }
h1, h2, h3, h4, .hero h1 { text-wrap: balance; }
ul, ol { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gut); }
.serif { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; }
.hl { background: linear-gradient(transparent 62%, var(--yellow) 62%, var(--yellow) 92%, transparent 92%); padding: 0 .1em; }

/* ── 헤더 ───────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--hdr);
  background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line); transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 4px 18px rgba(20, 24, 32, .06); }
.hdr-in { height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand img { width: 38px; height: 38px; border-radius: 50%; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.1; }
.brand-txt b { font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.brand-txt small { font-family: var(--serif); font-size: .78rem; color: var(--ink-3); letter-spacing: .02em; }
.gnb { display: flex; align-items: center; gap: clamp(4px, 2vw, 28px); margin: 0 auto; }
.gnb a { padding: 9px 16px; border-radius: var(--pill); font-family: var(--font); font-weight: 600; font-size: 1.08rem; letter-spacing: -.01em; color: var(--ink); transition: color .2s, background .2s; }
.gnb a:hover { color: var(--red); background: transparent; }
.gnb a[aria-current="page"] { color: var(--red); background: transparent; box-shadow: inset 0 -2px 0 var(--red); border-radius: 0; }
.hdr-act { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.hdr-my svg { color: var(--yellow); }
.gnb-account { --xa-bg: var(--ink); --xa-fg: var(--yellow); }
.gnb-account .xa-login { font-weight: 600; font-size: 1rem; padding: 8px 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card); }
.nav-toggle { display: none; width: 42px; height: 42px; border-radius: 50%; position: relative; }
.nav-toggle span { position: absolute; left: 12px; right: 12px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .3s var(--ease), top .3s var(--ease); }
.nav-toggle span:first-child { top: 16px; }
.nav-toggle span:last-child { top: 24px; }
.nav-open .nav-toggle span:first-child { top: 20px; transform: rotate(45deg); }
.nav-open .nav-toggle span:last-child { top: 20px; transform: rotate(-45deg); }

/* ── 버튼 · 배지 ───────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px; border-radius: var(--pill);
  font-weight: 700; font-size: 1rem; white-space: nowrap;
  transition: background .2s, color .2s, border-color .2s, transform .2s var(--ease);
}
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-2); }
.btn-yellow { background: var(--yellow); color: var(--ink); }
.btn-yellow:hover { background: #fff; color: var(--ink); }
.btn-line { border: 1.5px solid var(--line); background: var(--card); color: var(--ink); }
.btn-line:hover { border-color: var(--ink); }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: var(--red); }
.btn-ghost { border: 1.5px solid rgba(255, 255, 255, .28); color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .92rem; }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 6px; font-size: .78rem; font-weight: 700; background: var(--paper-2); color: var(--ink-2); }
.badge-y { background: var(--yellow); color: var(--ink); }
.badge-r { background: var(--red-soft); color: var(--red); }
.badge-dark { background: var(--ink); color: var(--yellow); }

/* ── 섹션 공통 ───────────────────────────── */
.sec { padding: clamp(64px, 9vw, 112px) 0; }
.sec-alt { background: var(--tint); }
.sec-head { margin-bottom: clamp(28px, 4vw, 44px); }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-family: var(--serif); font-style: italic; font-size: 1rem; color: var(--red); margin-bottom: 10px; }
.eyebrow::before { content: ""; width: 18px; height: 2px; background: currentColor; }
.sec-title { font-size: clamp(1.6rem, 3.6vw, 2.35rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.3; }
.sec-desc { margin-top: 12px; color: var(--ink-2); font-size: 1.1rem; max-width: 640px; }
.sec-head.center, .page-head.center { text-align: center; }
.sec-head.center .sec-desc, .page-head.center p { margin-left: auto; margin-right: auto; }
.sec-head.center .eyebrow, .page-head.center .eyebrow { justify-content: center; }
.center-more { margin-top: 32px; text-align: center; }

/* ── 홈: 히어로 (로고처럼 버건디 | 검정 반반) ───────────────────────────── */
.hero { position: relative; color: #fff; background: var(--dark); overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 50% 0 0; background: var(--red); }
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(circle at 75% 50%, rgba(255, 212, 0, .08), transparent 55%);
}
.hero-in { position: relative; z-index: 1; display: grid; grid-template-columns: 1.1fr .9fr; align-items: center; gap: 40px; padding-top: clamp(56px, 8vw, 96px); padding-bottom: clamp(56px, 8vw, 96px); }
.hero-eyebrow { font-family: var(--serif); font-style: italic; color: var(--yellow); font-size: 1.1rem; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.9rem); font-weight: 800; line-height: 1.18; letter-spacing: -.04em; }
.hero h1 em { font-style: normal; color: var(--yellow); }
.hero-desc { margin-top: 22px; font-size: clamp(1rem, 1.6vw, 1.15rem); color: rgba(255, 255, 255, .78); max-width: 500px; }
.hero-cta { margin-top: 32px; display: flex; gap: 10px; flex-wrap: wrap; }
.hero-logo { justify-self: center; width: min(420px, 100%); aspect-ratio: 1; border-radius: 50%; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.hero-logo img { width: 100%; height: 100%; border-radius: 50%; }

/* ── 홈: Sound · Build 두 축 ───────────────────────────── */
.pillars { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pillar { position: relative; padding: clamp(26px, 4vw, 40px); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; }
.pillar-word { font-family: var(--serif); font-size: clamp(2.6rem, 6vw, 3.8rem); line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.pillar-word span { color: var(--red); }
.pillar-kr { margin-top: 8px; font-weight: 700; font-size: 1.1rem; }
.pillar p { margin-top: 14px; color: var(--ink-2); }
.pillar ul { margin-top: 18px; display: grid; gap: 8px; }
.pillar li { display: flex; gap: 10px; align-items: baseline; font-size: .97rem; }
.pillar li::before { content: ""; flex-shrink: 0; width: 7px; height: 7px; border-radius: 50%; background: var(--yellow); box-shadow: 0 0 0 2px var(--ink); transform: translateY(-2px); }
.pillar-dark { background: var(--dark); border-color: var(--dark); color: #fff; }
.pillar-dark .pillar-word span { color: var(--yellow); }
.pillar-dark p { color: rgba(255, 255, 255, .72); }
.pillar-dark li::before { background: var(--yellow); box-shadow: 0 0 0 2px var(--dark-line); }

/* ── 홈: 계층 맛보기 — 위에 단계 카드 3개(누르면 그 단계까지 보기), 아래 넓은 훈련 화면 ── */
.layer-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.layer-step { display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px; border-radius: var(--r); background: var(--card); border: 1.5px solid var(--line); text-align: left; transition: border-color .25s, background .25s, transform .25s var(--ease), box-shadow .25s; }
.layer-step:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow); }
.layer-step b { flex-shrink: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); color: var(--ink); font-size: .9rem; transition: background .25s, color .25s; }
.layer-step strong { display: block; font-size: 1.05rem; font-weight: 800; letter-spacing: -.02em; }
.layer-step small { display: block; margin-top: 4px; font-size: .92rem; color: var(--ink-2); line-height: 1.55; transition: color .25s; }
.layer-step.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.layer-step.on b { background: var(--yellow); color: var(--ink); }
.layer-step.on small { color: rgba(255, 255, 255, .72); }
#homeTrainer .tr-stage { min-height: 0; }

/* ── 홈: 학습 로드맵 — 수준별 표 (LEVEL · 강의명 · 강의 소개) ── */
/* 로드맵: 왼쪽 단계(번호 · 세로 줄) + 오른쪽 강의 카드 */
.rm-level { position: relative; display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 28px; padding-bottom: 44px; }
.rm-level:last-child { padding-bottom: 0; }
.rm-level:not(:last-child)::before { content: ""; position: absolute; left: 23px; top: 56px; bottom: 8px; width: 2px; background: var(--line); }
.rm-side { display: flex; gap: 14px; align-items: flex-start; padding-top: 6px; }
.rm-step { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--rm); color: #fff; font-weight: 800; font-size: .95rem; letter-spacing: .02em; }
.rm-side h3 { font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; padding-top: 2px; }
.rm-side small { display: block; margin-top: 3px; font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.rm-side p { margin-top: 10px; font-size: .86rem; color: var(--ink-2); }
.rm-0 { --rm: var(--yellow); } .rm-0 .rm-step { color: var(--ink); }
.rm-1 { --rm: var(--red); }
.rm-2 { --rm: var(--ink); }
.rm-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; min-width: 0; }
.rm-card { display: grid; grid-template-columns: 176px minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 14px 22px 14px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .2s, box-shadow .25s var(--ease), transform .25s var(--ease); }
.rm-card:hover { border-color: var(--ink); box-shadow: var(--shadow); transform: translateY(-2px); }
.rm-card .thumb { padding: 12px 14px; border-radius: 10px; }
.rm-card .thumb-word { font-size: 1.3rem; }
.rm-card .thumb-sub { font-size: .74rem; }
.rm-body h4 { font-size: 1.1rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.4; }
.rm-meta { display: flex; align-items: center; gap: 8px; white-space: nowrap; margin-top: 3px; font-size: .84rem; font-weight: 600; color: var(--ink-3); }
.rm-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }
.rm-desc { margin-top: 8px; font-size: .95rem; line-height: 1.6; color: var(--ink-2); }
.rm-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rm-tags span { max-width: 100%; padding: 3px 10px; border-radius: var(--pill); background: var(--paper-2); font-size: .8rem; font-weight: 600; color: var(--ink-2); }
.rm-go { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); color: var(--ink); transition: background .25s, color .25s, border-color .25s; }
.rm-go svg { width: 16px; height: 16px; }
.rm-card:hover .rm-go { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ── 홈: 학습 흐름 ───────────────────────────── */
.flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: flow; }
.flow li { position: relative; display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; counter-increment: flow; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.flow li:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); }
.flow li::before { content: "0" counter(flow); position: absolute; z-index: 1; top: 12px; left: 12px; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 2px 8px rgba(22, 20, 15, .15); font-family: var(--serif); font-size: 1.05rem; font-weight: 700; color: var(--red); }
.flow-img { margin: 0; aspect-ratio: 4 / 3; overflow: hidden; background: var(--paper-2); }
.flow-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.flow li:hover .flow-img img { transform: scale(1.04); }
.flow h3 { padding: 18px 20px 0; font-size: 1.12rem; font-weight: 800; }
.flow p { margin-top: 6px; padding: 0 20px 22px; color: var(--ink-2); font-size: .95rem; }

/* ── 어두운 띠 (CTA) ───────────────────────────── */
.band { background: var(--dark); color: #fff; }
.band-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; padding: clamp(44px, 6vw, 64px) var(--gut); }
.band h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -.03em; }
.band p { margin-top: 6px; color: rgba(255, 255, 255, .7); }
.band-cta { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 하위 페이지 머리 ───────────────────────────── */
.page-head { padding: clamp(40px, 6vw, 72px) 0 clamp(24px, 3vw, 32px); }
.page-head h1 { font-size: clamp(1.8rem, 4.2vw, 2.7rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.page-head p { margin-top: 10px; color: var(--ink-2); font-size: 1.1rem; max-width: 640px; }

.sub-main { background: var(--tint); min-height: 60vh; padding-bottom: clamp(56px, 8vw, 96px); }
.sub-main.board-main { background: var(--paper); }   /* 게시판 · 회원 화면은 흰 바탕 그대로 */

/* ── 알약 탭 (떠 있는 배경 하나가 미끄러짐) ───────────────────────────── */
.seg { position: relative; display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--paper-2); border: 1px solid var(--line); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { position: relative; z-index: 1; flex-shrink: 0; padding: 7px 16px; border-radius: var(--pill); font-weight: 600; font-size: .94rem; color: var(--ink-2); white-space: nowrap; transition: color .35s var(--ease); }
.seg button.on { color: var(--yellow); }
.seg-ind { position: absolute; z-index: 0; top: 4px; left: 0; bottom: 4px; width: 0; border-radius: var(--pill); background: var(--ink); transition: transform .35s var(--ease), width .35s var(--ease); }
.seg.no-ind button.on { background: var(--ink); }
.seg.no-ind .seg-ind { display: none; }
.seg-light { background: var(--card); }

/* ── 강의 목록 ───────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 18px; }
.chip { height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--card); font-size: .9rem; font-weight: 600; color: var(--ink-2); transition: background .2s, color .2s, border-color .2s; }
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.count-line { color: var(--ink-3); font-size: .92rem; margin-bottom: 14px; }
.count-line b { color: var(--red); }

.course-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.course-card { display: flex; flex-direction: column; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.course-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-up); border-color: transparent; }
.course-body { padding: 18px 20px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.course-card h3 { font-size: 1.12rem; font-weight: 700; line-height: 1.4; letter-spacing: -.02em; }
.course-card p { font-size: .93rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-meta { margin-top: auto; padding-top: 10px; display: flex; gap: 14px; font-size: .86rem; color: var(--ink-3); }
.progress { height: 6px; border-radius: 6px; background: var(--paper-2); overflow: hidden; }
.progress i { display: block; height: 100%; width: 0; background: var(--yellow); box-shadow: inset 0 0 0 1px rgba(22, 20, 15, .08); border-radius: inherit; transition: width .6s var(--ease); }
.prog-row { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink-3); }
.prog-row .progress { flex: 1; }
.empty-gap { margin-bottom: 32px; }
.empty { padding: 60px 20px; text-align: center; color: var(--ink-3); border: 1px dashed var(--line); border-radius: var(--r); }

/* 썸네일: 그림 없이 글자로 (영상 썸네일이 오면 그것으로) */
.thumb { position: relative; aspect-ratio: 16 / 9; display: flex; flex-direction: column; justify-content: flex-end; padding: 18px 20px; background: var(--dark); color: #fff; overflow: hidden; }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.thumb::before { content: ""; position: absolute; right: -18%; top: -40%; width: 70%; aspect-ratio: 1; border-radius: 50%; border: 2px solid rgba(255, 212, 0, .35); }
.thumb::after { content: ""; position: absolute; right: -6%; top: -18%; width: 42%; aspect-ratio: 1; border-radius: 50%; border: 1px dashed rgba(255, 212, 0, .3); }
.thumb.t-red { background: var(--red); }
.thumb.t-black { background: var(--dark); }
.thumb.t-split { background: linear-gradient(90deg, var(--red) 50%, var(--dark) 50%); }
.thumb-word { position: relative; z-index: 1; font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.1rem); font-weight: 700; line-height: 1; }
.thumb-word span { color: var(--yellow); }
.thumb-sub { position: relative; z-index: 1; margin-top: 6px; font-size: .82rem; color: rgba(255, 255, 255, .72); font-weight: 600; letter-spacing: .02em; }

/* ── 강의 상세 ───────────────────────────── */
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 36px; align-items: start; }
.detail-head .course-tags { margin-bottom: 12px; }
.detail-head h1 { font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.25; }
.detail-head p { margin-top: 12px; font-size: 1.05rem; color: var(--ink-2); }
.facts { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--ink-2); font-size: .95rem; }
.facts b { color: var(--ink); }
.box { margin-top: 28px; padding: 24px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.box h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.02em; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.checks li { position: relative; padding-left: 26px; font-size: .97rem; }
.checks li::before { content: ""; position: absolute; left: 2px; top: .45em; width: 12px; height: 7px; border-left: 2.5px solid var(--red); border-bottom: 2.5px solid var(--red); transform: rotate(-45deg); }
.side-card { position: sticky; top: calc(var(--hdr) + 20px); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.side-card .side-in { padding: 20px; display: grid; gap: 12px; }
.side-card .btn { width: 100%; }
.side-note { font-size: .86rem; color: var(--ink-3); text-align: center; }

/* 커리큘럼 (섹션 접기) */
.curri { margin-top: 28px; }
.curri-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.curri-head h2 { font-size: 1.15rem; font-weight: 800; }
.curri-head span { font-size: .9rem; color: var(--ink-3); }
.sect { border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--card); overflow: hidden; }
.sect + .sect { margin-top: 8px; }
.sect-btn { width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 18px; text-align: left; font-weight: 700; }
.sect-btn small { margin-left: auto; font-weight: 500; font-size: .85rem; color: var(--ink-3); white-space: nowrap; }
.sect-btn::after { content: ""; flex-shrink: 0; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translate(-2px, -2px); transition: transform .3s var(--ease); }
.sect.open .sect-btn::after { transform: rotate(-135deg) translate(-1px, -1px); }
.sect-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .35s var(--ease); }
.sect.open .sect-body { grid-template-rows: 1fr; }
.sect-body > ol { overflow: hidden; }
.lesson { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); font-size: .95rem; transition: background .2s; }
a.lesson:hover { background: var(--paper); }
.lesson-ic { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--paper-2); color: var(--ink-2); }
.lesson-ic svg { width: 11px; height: 11px; }
.lesson.done .lesson-ic { background: var(--ink); color: var(--yellow); }
.lesson.now { background: var(--yellow-soft); }
.lesson.now .lesson-ic { background: var(--yellow); color: var(--ink); }
.lesson.locked { color: var(--ink-3); }
.lesson.locked .lesson-ic { background: transparent; color: var(--ink-3); border: 1px solid var(--line); }
.player-empty .btn { margin-top: 14px; }
.player-empty svg { display: block; margin: 0 auto 10px; color: var(--yellow); }
.player-empty > div > b:not(.serif) { display: block; color: #fff; font-size: 1.05rem; }
.lesson-t { flex: 1; min-width: 0; }
.lesson-d { flex-shrink: 0; font-size: .85rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* ── 강의실 ───────────────────────────── */
.class-body { background: var(--paper); }
/* 머리 · 꼬리와 같은 .wrap 끝선 (화면 끝까지 퍼지지 않게) */
.classroom { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; max-width: var(--wrap); margin: 0 auto; padding: 24px var(--gut) clamp(48px, 7vw, 80px); }
.class-main { min-width: 0; }
.player { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: var(--dark); }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: rgba(255, 255, 255, .7); padding: 20px; }
.player-empty b { display: block; font-family: var(--serif); font-size: clamp(1.4rem, 4vw, 2.2rem); color: #fff; margin-bottom: 6px; }
.player-empty b span { color: var(--yellow); }
.class-title { margin-top: 18px; display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.class-title small { display: block; color: var(--ink-3); font-size: .88rem; margin-bottom: 2px; }
.class-title h1 { font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.35; }
.class-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.class-tabs { margin-top: 22px; }
.tab-panel { margin-top: 16px; }
.tab-panel[hidden] { display: none; }
.note-area { width: 100%; min-height: 160px; padding: 14px 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); font: inherit; color: var(--ink); resize: vertical; }
.note-area:focus { outline: none; border-color: var(--ink); }
.note-help { margin-top: 8px; font-size: .86rem; color: var(--ink-3); }
.files li { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.class-side { border: 1px solid var(--line); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow); max-height: calc(100vh - var(--hdr) - 48px); position: sticky; top: calc(var(--hdr) + 24px); overflow-y: auto; }
.class-side-head { padding: 18px 20px; border-bottom: 1px solid var(--line); }
.class-side-head h2 { font-size: 1rem; font-weight: 800; line-height: 1.4; }
.class-side-head .prog-row { margin-top: 10px; }
.class-side .sect { border-radius: 0; border-width: 0 0 1px; }
.class-side .sect + .sect { margin-top: 0; }
.class-only-m { display: none; }

/* ── 내 강의실 ───────────────────────────── */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 32px; }
.stat { padding: 20px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); }
.stat small { color: var(--ink-3); font-size: .88rem; }
.stat b { display: block; font-size: 1.9rem; font-weight: 800; letter-spacing: -.03em; margin-top: 2px; }
.stat b em { font-style: normal; color: var(--red); }
.stat b span { font-size: 1rem; font-weight: 600; color: var(--ink-2); margin-left: 3px; }
.resume { display: grid; grid-template-columns: 260px 1fr; gap: 0; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); overflow: hidden; margin-bottom: 32px; }
.resume-body { padding: 22px 24px; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.resume-body small { color: var(--red); font-weight: 700; font-size: .86rem; }
.resume-body h2 { font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; }
.resume-body .btn { align-self: flex-start; margin-top: 6px; }
.h-sub { font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; letter-spacing: -.02em; }

/* ── 문장 훈련 ───────────────────────────── */
.train-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.trainer { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.tr-bar { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.tr-bar .grow { flex: 1; }
.tr-label { font-size: .82rem; font-weight: 700; color: var(--ink-3); margin-right: -4px; }
.tr-source { padding: 22px 24px 18px; border-bottom: 1px dashed var(--line); }
.tr-source small { display: inline-block; font-family: var(--serif); font-weight: 700; font-size: 1.05rem; color: var(--g-noun); margin-bottom: 6px; letter-spacing: .02em; }
.tr-source p { font-size: clamp(1.02rem, 1.8vw, 1.15rem); line-height: 1.75; }
.tr-source .tts { margin-left: 4px; vertical-align: -3px; }
.tr-stage { position: relative; padding: 24px 24px 28px; min-height: 260px; }
.tr-diagram { position: relative; font-size: clamp(1rem, 1.6vw, 1.1rem); }
.tr-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--paper); }
.tr-count { font-size: .9rem; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tr-foot .btns { display: flex; gap: 8px; }
.icon-btn { width: 38px; height: 38px; border-radius: 50%; display: inline-grid; place-items: center; border: 1px solid var(--line); background: var(--card); transition: background .2s, color .2s, border-color .2s; }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; }
.icon-btn.sm svg { width: 14px; height: 14px; }
.icon-btn.on { background: var(--ink); color: var(--yellow); border-color: var(--ink); }

/* 도식 한 줄 */
.dl { position: relative; display: block; width: max-content; max-width: 100%; padding: 3px 4px 3px 6px; margin: 2px 0; line-height: 1.6; transition: opacity .35s var(--ease), filter .35s var(--ease); }
.dl.kid::before { content: ""; position: absolute; left: calc(var(--cx, 6px) - 4px); bottom: 4px; height: var(--up, 18px); border-left: 1.5px solid var(--ink-3); }
.dl.kid::after, .dl.has-kids::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; border-bottom: 1.5px solid var(--ink-3); }
.dl .tier { display: none; margin-right: 6px; padding: 0 5px; border-radius: 4px; background: var(--ink); color: var(--yellow); font-size: .68rem; font-weight: 800; font-style: normal; vertical-align: 2px; }
.show-tier .dl .tier { display: inline-block; }
.dl.clause { padding: 3px 10px; border: 2px solid var(--g-conn); border-radius: 4px; }
.dl.clause.kid::after, .dl.clause.has-kids::after { bottom: -2px; left: -2px; right: -2px; }
.dl.clause.kid::before { left: calc(var(--cx, 6px) - 4px); bottom: -2px; }
.dl.gap { margin-top: 12px; }
.dl.pending { visibility: hidden; }
.dl.reveal { animation: wipe .7s var(--ease) both; }
@keyframes wipe {
  from { clip-path: inset(-6px 100% -6px -6px); opacity: .2; }
  to { clip-path: inset(-6px -6px -6px -6px); opacity: 1; }
}
.dl.dim { opacity: .28; filter: grayscale(1); }
.dl.speaking { background: var(--yellow-soft); border-radius: 4px; }
.dl[data-speak] { cursor: pointer; }

/* 문법 기호 — 강사 수업 표시 규칙 (형광 = 뼈대, 괄호 색 = 붙는 자리) */
.w-v { background: var(--g-verb); color: #fff; font-weight: 600; padding: 0 3px; border-radius: 2px; }
.w-n { background: var(--g-noun); color: #fff; font-weight: 600; padding: 0 3px; border-radius: 2px; }
.w-p { background: var(--yellow); color: var(--ink); font-weight: 600; padding: 0 3px; border-radius: 2px; }
.w-c { color: var(--g-conn); font-weight: 800; }
.w-k { color: var(--g-coord); font-weight: 800; }
.w-a { color: var(--g-verb); font-weight: 500; }
.w-r { color: var(--g-noun); font-weight: 800; margin-right: 2px; }
.w-y { outline: 2px solid #f2b705; outline-offset: 1px; border-radius: 3px; background: #fff8d6; padding: 0 3px; }
.pp > b { font-weight: 700; font-size: 1.12em; line-height: 1; }
.pp-n > b { color: var(--g-noun); }
.pp-j > b { color: #e0a800; }
.pp-v > b { color: var(--g-verb); }
.pp-s > b { color: var(--g-conn); }

/* 기호 설명 */
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 14px 24px 0; font-size: .84rem; color: var(--ink-2); }
.legend .lg-sep { font-weight: 800; color: var(--ink-3); margin-left: 6px; }
.legend .lg-box { border: 2px solid var(--g-conn); border-radius: 3px; padding: 0 4px; }
.legend .lg-red { border-color: var(--g-noun); }
.tr-diagram.gap { margin-top: 22px; padding-top: 20px; border-top: 1px dashed var(--line); }
.tr-diagram[hidden] { display: none; }
/* 절 박스: 절 줄 + 매달린 줄을 한 박스로 (줄 자체 테두리는 끄고 겹친 틀로 그린다) */
.dl.boxed { border-color: transparent !important; background: none !important; }
.dl-box { position: absolute; z-index: 0; border: 2px solid var(--g-conn); border-radius: 5px; pointer-events: none; }
.dl-box.c-j { border-color: #f2b705; } .dl-box.c-v { border-color: var(--g-noun); }
.bx-h { display: none; }
.tr-editing .bx-h { display: block; position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 3px; background: #fff; border: 2px solid currentColor; color: var(--ink); cursor: nwse-resize; pointer-events: auto; touch-action: none; }
/* 조립도 고치기 (관리자) — 격자 위에서 줄을 끌어 옮긴다 */
.tr-edit-btn { margin-left: auto; }
.tr-edbar { display: grid; gap: 10px; padding: 12px 18px; border-bottom: 1px solid var(--line); background: #fffbe6; }
.tr-edbar p { font-size: .88rem; color: var(--ink-2); }
.tr-edbar p b { margin-right: 6px; color: var(--ink); }
.tr-edbar .btns { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tr-edbar .grow { flex: 1; }
.tr-editing .tr-stage { position: relative; }
.tr-editing .tr-diagram { background-image: linear-gradient(90deg, rgba(29, 78, 216, .08) 1px, transparent 1px); background-size: 12px 100%; background-position: 6px 0; outline: 1px dashed rgba(29, 78, 216, .25); outline-offset: 6px; }
.tr-editing .dl { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; border-radius: 6px; }
.tr-editing .dl:hover { background: rgba(29, 78, 216, .06); }
.tr-editing .dl.ed-sel { background: rgba(255, 212, 0, .25); box-shadow: 0 0 0 1.5px #e0a800; }
.tr-editing .dl.ed-drag { cursor: grabbing; z-index: 5; background: #fff; box-shadow: 0 8px 22px rgba(22, 20, 15, .18); transition: none; }
.tr-editing .pp { cursor: pointer; border-radius: 4px; }
.tr-editing .pp:hover { background: rgba(22, 20, 15, .07); }
.tr-guide { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 1.5px dashed var(--g-conn); pointer-events: none; z-index: 6; }
.tr-pick { position: absolute; z-index: 10; display: flex; flex-wrap: wrap; gap: 4px; width: 240px; padding: 6px; border-radius: 12px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-up); }
.tr-pick[hidden] { display: none; }
.tr-pick button { display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px; border-radius: 8px; border: 1px solid var(--line); background: #fff; font: 600 .84rem/1 var(--font); color: var(--ink); cursor: pointer; }
.tr-pick button:hover { border-color: var(--ink); }
.tr-toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 9999; padding: 10px 16px; border-radius: 12px; background: var(--ink); color: #fff; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow-up); }

/* 조립(Build) 훈련 */
.build-pool { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 24px 22px; border-top: 1px dashed var(--line); background: var(--paper); }
.build-pool[hidden] { display: none; }
.build-pool p { width: 100%; font-size: .9rem; color: var(--ink-2); }
.piece { padding: 8px 14px; border-radius: var(--r-sm); background: var(--card); border: 1.5px solid var(--line); font-size: .97rem; text-align: left; box-shadow: 0 1px 2px rgba(22, 20, 15, .05); transition: border-color .2s, transform .2s var(--ease), opacity .3s; }
.piece:hover { border-color: var(--ink); }
.piece.wrong { animation: shake .35s; border-color: var(--g-noun); }
.piece.used { opacity: 0; pointer-events: none; transform: scale(.9); }
@keyframes shake { 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.build-done { width: 100%; font-weight: 700; color: var(--g-conn); }

/* ── 문장 표시 훈련 (학생이 직접 기호를 친다) ───────────────────────────── */
.mk-sets { margin-bottom: 16px; }
.mk-sets small { font-weight: 500; opacity: .6; margin-left: 2px; }
.marker { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.mk-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 14px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.mk-teacher.on { background: var(--red); border-color: var(--red); color: #fff; }
.marker.teacher { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft), var(--shadow); }
.mk-guide { padding: 16px 24px 0; font-size: .95rem; color: var(--ink-2); line-height: 1.7; }
.mk-guide b { color: var(--ink); }
.mk-guide .w-n, .mk-guide .w-v, .mk-guide .w-p { color: #fff; }
.mk-guide .w-p { color: var(--ink); }
.mk-pens, .mk-tree-bar { padding: 14px 24px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.mk-pens[hidden], .mk-tree-bar[hidden], .mk-text[hidden], .mk-diagram[hidden], .mk-sheet[hidden], .mk-parts[hidden], .mk-teacher-box[hidden] { display: none; }
#mkPenSeg button[data-v="n"].on { color: #fff; }
#mkPenSeg:has(button[data-v="n"].on) .seg-ind { background: var(--g-noun); }
#mkPenSeg:has(button[data-v="v"].on) .seg-ind { background: var(--g-verb); }
#mkPenSeg:has(button[data-v="v"].on) button.on { color: #fff; }
#mkPenSeg:has(button[data-v="j"].on) .seg-ind { background: var(--yellow); }
#mkPenSeg:has(button[data-v="j"].on) button.on { color: var(--ink); }
.mk-text { padding: 22px 24px 26px; font-size: clamp(1.12rem, 2.2vw, 1.3rem); line-height: 2.35; -webkit-user-select: none; user-select: none; }
.wd { cursor: pointer; padding: 2px 2px; border-radius: 3px; transition: background .15s, box-shadow .15s, color .15s; }
.wd:hover { background: var(--paper-2); }
.wd.r-v { background: var(--g-verb); color: #fff; }
.wd.r-n { background: var(--g-noun); color: #fff; }
.wd.r-j { background: var(--yellow); color: var(--ink); }
.wd.insel { background: #ece6ff; box-shadow: inset 0 -3px 0 var(--g-coord); }
.wd.insel.r-v, .wd.insel.r-n { box-shadow: inset 0 -3px 0 #fff; }
.wd.sel-a { outline: 2px dashed var(--g-coord); outline-offset: 1px; }
.wd.g-ok { box-shadow: 0 0 0 2.5px var(--g-conn); }
.wd.g-bad { box-shadow: 0 0 0 2.5px var(--g-noun); text-decoration: line-through; text-decoration-thickness: 2px; }
.wd.g-miss { outline: 2.5px dashed var(--g-noun); outline-offset: 1px; }
.pu { color: var(--ink-2); }
.mk { border-radius: 4px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.mk .br, .dl .br { font-weight: 800; font-size: 1.15em; line-height: 1; margin: 0 1px; }
.mk.a-n > .br, .br.a-n { color: var(--g-noun); }
.mk.a-j > .br, .br.a-j { color: #e0a800; }
.mk.a-v > .br, .br.a-v { color: var(--g-verb); }
.mk.a-s > .br, .br.a-s { color: var(--g-conn); }
.mk .sl, .dl .sl { color: var(--g-noun); font-weight: 900; font-size: 1.2em; margin-right: 2px; }
.mk.cl.a-j { border: 2px solid #f2b705; background: #fff8d6; padding: 2px 4px; }
.mk.cl.a-v { border: 2px solid var(--g-noun); padding: 2px 4px; }
.mk.cl.a-s { border: 2px solid var(--g-conn); padding: 2px 4px; }
.mk.g-ok { box-shadow: 0 0 0 4px rgba(15, 157, 88, .22); }
.mk.g-half { box-shadow: 0 0 0 4px rgba(242, 183, 5, .35); }
.mk.g-bad { box-shadow: 0 0 0 4px rgba(225, 29, 42, .22); }
.mk-diagram { margin: 24px 24px 28px; min-height: 140px; }
.dl.bx { padding: 3px 10px; border-radius: 4px; }
.dl.bx-j { border: 2px solid #f2b705; background: #fff8d6; }
.dl.bx-v { border: 2px solid var(--g-noun); }
.dl.bx-s { border: 2px solid var(--g-conn); }
.dl.bx.kid::after, .dl.bx.has-kids::after { bottom: -2px; left: -2px; right: -2px; }
.dl.bx.kid::before { left: calc(var(--cx, 6px) - 4px); bottom: -2px; }
.dl.kid::after { left: calc(var(--cx, 6px) - 4px) !important; }
.dl.has-kids::after { right: var(--ur, 0px) !important; }
.dl.has-kids:not(.kid)::after { left: var(--ul, 0px) !important; }
.dl.boxed.kid::before { bottom: calc(100% + 1px); height: var(--upb, 12px); border-left-width: 2px; border-left-color: var(--g-conn); }
.dl.boxed.bx-j.kid::before { border-left-color: #f2b705; } .dl.boxed.bx-v.kid::before { border-left-color: var(--g-noun); }
.dl.boxed.kid:not(.has-kids)::after { display: none; }
.mk-sheet { margin: 0 24px 20px; padding: 16px; border-radius: var(--r-sm); background: var(--paper); border: 1.5px solid var(--g-coord); }
.mk-sel-t { font-weight: 700; margin-bottom: 10px; }
.mk-row { display: grid; grid-template-columns: 64px repeat(4, 1fr); gap: 6px; align-items: stretch; margin-top: 6px; }
.mk-row-h { align-self: center; font-size: .85rem; font-weight: 800; color: var(--ink-3); }
.mk-opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-height: 64px; padding: 8px 4px; border-radius: var(--r-sm); background: var(--card); border: 1.5px solid var(--line); font-size: 1.05rem; transition: border-color .2s, transform .2s var(--ease); }
.mk-opt:hover { border-color: var(--ink); transform: translateY(-1px); }
.mk-opt small { font-size: .78rem; font-weight: 700; color: var(--ink-2); }
.mk-sheet-foot { margin-top: 10px; text-align: right; }
.mk-parts { padding: 0 24px 18px; display: grid; gap: 6px; }
.mk-part { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); border: 1px solid var(--line); font-size: .93rem; }
.mk-part.g-ok { border-color: var(--g-conn); background: #eefaf3; }
.mk-part.g-half { border-color: #f2b705; background: #fffbe6; }
.mk-part.g-bad { border-color: var(--g-noun); background: #fdeeee; }
.mk-part-tag { flex-shrink: 0; font-size: .78rem; font-weight: 800; padding: 2px 8px; border-radius: 6px; background: var(--paper-2); }
.mk-part-tag.a-n { color: var(--g-noun); } .mk-part-tag.a-j { color: #b58800; } .mk-part-tag.a-v { color: var(--g-verb); } .mk-part-tag.a-s { color: var(--g-conn); }
.mk-part-t { flex: 1; min-width: 0; }
.mk-empty { color: var(--ink-3); font-size: .9rem; }
.mk-teacher-box { margin: 0 24px 18px; padding: 16px; border-radius: var(--r-sm); background: var(--red-soft); display: grid; gap: 8px; }
.mk-teacher-box label { font-size: .85rem; font-weight: 800; color: var(--red); }
.mk-teacher-box input, .mk-teacher-box textarea { width: 100%; min-width: 0; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); font: inherit; font-size: .95rem; color: var(--ink); }
.mk-teacher-box textarea { font-family: ui-monospace, Consolas, monospace; font-size: .85rem; resize: vertical; }
.mk-new { display: flex; gap: 8px; align-items: center; }
.mk-saved { font-size: .88rem; color: var(--g-conn); font-weight: 700; }
.mk-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--paper); }
.mk-foot .btns { display: flex; gap: 8px; margin-left: auto; }
.mk-result { font-size: .93rem; color: var(--ink-2); flex: 1 1 260px; }
.mk-result .ok { color: var(--g-conn); font-weight: 700; } .mk-result .bad { color: var(--g-noun); } .mk-result .miss { color: var(--g-noun); } .mk-result .half { color: #b58800; }
.marker[data-step="tree"] .mk-foot .btns { display: none; }
.sec-sub { margin-top: clamp(48px, 7vw, 80px); }
.sec-sub .sec-desc { margin: 0 0 16px; }
@media (max-width: 640px) {
  .mk-guide, .mk-pens, .mk-tree-bar { padding-left: 16px; padding-right: 16px; }
  .mk-text { padding-left: 16px; padding-right: 16px; }
  .mk-diagram { margin-left: 16px; margin-right: 16px; }
  .mk-sheet, .mk-teacher-box { margin-left: 12px; margin-right: 12px; padding: 12px; }
  .mk-parts { padding-left: 16px; padding-right: 16px; }
  .mk-row { grid-template-columns: repeat(4, 1fr); }
  .mk-row-h { grid-column: 1 / -1; }
  .mk-opt { min-height: 58px; }
  .mk-foot .btns { width: 100%; }
  #mkSteps button { padding: 7px 11px; font-size: .9rem; }
  .mk-foot .btns .btn { flex: 1; padding: 0 8px; }
}

/* ── 보기 문장 · 단계 표시 (문장 원리 · 구조 생성기 공통) ───────────────────────────── */
.ex { margin: 14px 0; padding: 14px 18px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
/* 정보 단계 숫자: 뼈대 낱말 · 부품 여는 표시 아래에 작게 (1차 진하게, 2차 파랑, 3차 이하 회색) */
[data-t] { position: relative; }
.tn { position: relative; display: inline-block; width: 0; height: 1.2em; vertical-align: -.3em; }
.wd[data-t]::after, .tn::after { content: attr(data-t); position: absolute; left: 50%; top: 100%; transform: translate(-50%, 1px); min-width: 1.35em; padding: 0 .3em; border-radius: 99px; font: 800 .58em/1.5 var(--font); font-style: normal; letter-spacing: 0; text-align: center; color: var(--ink-3); background: var(--paper-2); pointer-events: none; white-space: nowrap; }
.tn::after { left: var(--c, .6em); top: calc(100% + 5px); }
.mk.tu > .tn::after { top: calc(100% + 9px); }
.mk.tu { padding-bottom: 7px; border-bottom: 2px solid #9db4e6; }
.mk.tu3 { padding-bottom: 4px; border-bottom-color: #c3c8d0; }
.mk.tu4 { padding-bottom: 2px; border-bottom: 1.5px dotted #c3c8d0; }
[data-t="1"]::after { background: var(--ink) !important; color: var(--yellow) !important; }
[data-t="2"]::after { background: #dfe6f5 !important; color: var(--g-verb) !important; }
.ex-s { font-size: clamp(1.05rem, 2vw, 1.2rem); line-height: 2.2; }
.ex .wd, .fs .wd { cursor: default; }
.ex .wd:not([class*="r-"]):hover, .fs .wd:not([class*="r-"]):hover { background: none; }
.ex-tree { margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line); }
.ex > .ex-tree:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.tier-chip { flex-shrink: 0; display: inline-grid; place-items: center; min-width: 40px; height: 24px; padding: 0 7px; border-radius: 6px; font-size: .78rem; font-weight: 800; font-style: normal; background: var(--paper-2); color: var(--ink-2); }
.tier-chip.t1 { background: var(--ink); color: var(--yellow); }
.tier-chip.t2 { background: #dfe6f5; color: var(--g-verb); }
.tier-chip.t3, .tier-chip.t4 { background: var(--paper-2); color: var(--ink-3); }
.lg-bx { display: inline-block; width: 22px; height: 14px; border-radius: 3px; vertical-align: -2px; border: 2px solid; }
.lg-bx.j { border-color: #f2b705; background: #fff8d6; }
.lg-bx.v { border-color: var(--g-noun); }
.lg-bx.s { border-color: var(--g-conn); }
.doc-s { display: inline-block; padding: 0 5px; border-radius: 2px; border: 2px solid var(--g-conn); color: var(--g-conn); font-weight: 700; line-height: 1.3; }

/* ── 문장 원리 ───────────────────────────── */
/* 차례: 한 줄, 머리 아래에 붙어 따라다님, 지금 읽는 장으로 배경이 미끄러진다 */
.doc-toc { position: sticky; top: var(--hdr); z-index: 30; display: flex; flex-wrap: nowrap; justify-content: safe center; gap: 6px; margin: 0 calc(-1 * var(--gut)) clamp(20px, 3vw, 32px); padding: 10px var(--gut); overflow-x: auto; scrollbar-width: none; background: rgba(243, 245, 248, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); transition: box-shadow .3s; }
.doc-toc::-webkit-scrollbar { display: none; }
.doc-toc.stuck { box-shadow: 0 6px 16px rgba(22, 20, 15, .06); }
.doc-toc a { position: relative; z-index: 1; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px 0 5px; border-radius: var(--pill); background: var(--card); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--ink-2); white-space: nowrap; transition: border-color .2s, color .35s var(--ease), background .35s var(--ease); }
.doc-toc a b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--paper-2); font-size: .8rem; color: var(--ink); transition: background .35s var(--ease), color .35s var(--ease); }
.doc-toc a:hover { border-color: var(--ink); color: var(--ink); }
.doc-toc.has-ind a.on { background: transparent; border-color: transparent; color: #fff; }
.doc-toc a.on b { background: var(--yellow); color: var(--ink); }
.doc-toc:not(.has-ind) a.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.toc-ind { position: absolute; z-index: 0; top: 10px; left: 0; height: 36px; width: 0; border-radius: var(--pill); background: var(--ink); transition: transform .35s var(--ease), width .35s var(--ease); }
.doc { display: grid; gap: clamp(20px, 3vw, 28px); }
.doc-sec { scroll-margin-top: calc(var(--hdr) + 72px); padding: clamp(24px, 4vw, 44px); border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.doc-sec > p, .doc-sec .doc-way > p { margin: 12px 0; color: var(--ink-2); font-size: 1.05rem; line-height: 1.85; }
.doc-sec p b { color: var(--ink); }
.doc-no { margin: 0 0 4px !important; font-family: var(--serif); font-size: 1.4rem !important; font-weight: 700; color: var(--red) !important; }
.doc-sec h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); font-weight: 800; letter-spacing: -.03em; line-height: 1.35; margin-bottom: 8px; }
.doc-sec h3 { margin: 26px 0 8px; font-size: 1.15rem; font-weight: 800; letter-spacing: -.02em; }
.doc-sec .ex { background: var(--tint); border-color: transparent; }
.doc-key { padding: 16px 18px; border-radius: var(--r-sm); background: var(--yellow-soft); color: var(--ink) !important; border-left: 4px solid var(--yellow); }
.doc-cap { font-size: .97rem !important; }
.doc-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.doc-grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 16px 0; }
.doc-card { padding: 16px; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--card); }
.doc-card small { display: block; font-size: .8rem; font-weight: 700; color: var(--ink-3); }
.doc-card > b { display: block; font-size: 1.15rem; font-weight: 800; margin: 2px 0 6px; }
.doc-card p { font-size: .95rem; color: var(--ink-2); line-height: 1.65; }
.doc-card em { font-style: normal; font-family: var(--serif); color: var(--ink); }
.doc-card .ex { margin-bottom: 0; background: var(--tint); border-color: transparent; padding: 8px 12px; }
.doc-card .ex-s { font-size: 1rem; }
.doc-words { font-family: var(--serif); font-weight: 600; color: var(--ink) !important; }
.doc-vs { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.doc-vs > div { padding: 16px; border-radius: var(--r-sm); background: var(--tint); }
.doc-vs small { font-size: .8rem; font-weight: 800; color: var(--ink-3); }
.doc-vs p { margin: 6px 0; font-size: 1.1rem; font-weight: 600; }
.doc-vs span { font-size: .88rem; color: var(--ink-2); }
.doc-tiers { display: grid; gap: 8px; margin: 14px 0; }
.doc-tiers li { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }
.doc-tiers li:nth-child(2) { padding-left: 22px; }
.doc-tiers li:nth-child(3) { padding-left: 44px; }
.doc-parts { display: grid; gap: 12px; margin: 16px 0; counter-reset: dp; }
.doc-parts li { position: relative; padding: 16px 18px 16px 58px; border-radius: var(--r-sm); border: 1px solid var(--line); counter-increment: dp; }
.doc-parts li::before { content: counter(dp); position: absolute; left: 16px; top: 15px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--ink); color: var(--yellow); font-weight: 800; font-size: .9rem; }
.doc-parts li > b { font-size: 1.12rem; font-weight: 800; }
.doc-parts li > small { margin-left: 6px; font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.doc-parts li p { margin-top: 4px; color: var(--ink-2); }
.doc-parts .ex { margin-bottom: 0; background: var(--tint); border-color: transparent; }
.doc-eg { font-family: var(--serif); font-weight: 600; color: var(--ink) !important; }
.doc-table { margin: 16px 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.dt-row { display: grid; grid-template-columns: 1.1fr 1fr 1fr; }
.dt-row > span { padding: 12px 14px; border-top: 1px solid var(--line); font-size: .97rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.dt-row > span + span { border-left: 1px solid var(--line); }
.dt-row small { width: 100%; font-size: .78rem; color: var(--ink-3); }
.dt-head > span { border-top: 0; background: var(--ink); color: #fff; font-weight: 800; font-size: .9rem; }
.dt-head > span + span { border-left-color: rgba(255, 255, 255, .15); }
.doc-ex { margin: 12px 0; }
.doc-ex dt { margin-top: 18px; font-weight: 800; font-size: 1.05rem; }
.doc-ex dd { margin: 0; }
.doc-ex dd .ex { margin: 8px 0; }
.doc-ex dd p { font-size: .97rem; color: var(--ink-2); }
.doc-wh { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 14px 0; }
.doc-wh span { padding: 10px 12px; border-radius: var(--r-sm); background: var(--tint); font-size: .9rem; color: var(--ink-2); line-height: 1.4; }
.doc-wh b { display: block; font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.doc-wh small { display: block; font-size: .75rem; color: var(--ink-3); }
/* 절 4가지 표: 이름(붙는 자리 · 표시 · 단계) + 본드별 예문 · 우리말 */
.doc-ctab { display: grid; gap: 14px; margin: 18px 0 8px; }
.ct-g { display: grid; grid-template-columns: 200px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--card); }
.ct-h { padding: 18px 16px; background: var(--tint); border-right: 1px solid var(--line); }
.ct-no { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--ct); color: #fff; font-size: .82rem; font-weight: 800; }
.ct-p .ct-no { color: var(--ink); }
.ct-h h3 { margin: 8px 0 2px; font-size: 1.2rem; font-weight: 800; letter-spacing: -.02em; color: var(--ct-t, var(--ct)); }
.ct-h p { font-size: .86rem; color: var(--ink-2); font-weight: 600; }
.ct-h .ct-mk { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; font-weight: 500; }
.ct-n { --ct: var(--g-noun); } .ct-j { --ct: var(--g-noun); } .ct-s { --ct: var(--g-conn); } .ct-p { --ct: var(--yellow); --ct-t: #b8860b; }
.ct-rows li { display: grid; grid-template-columns: 110px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); }
.ct-rows li:first-child { border-top: 0; }
.ct-name { font-size: .9rem; font-weight: 800; color: var(--ink); white-space: nowrap; }
.ct-name i { font-style: normal; color: var(--ink-3); font-weight: 600; }
.ct-ex .ex { margin: 0; padding: 0; background: none; }
.ct-ex .ex-s { font-size: 1.05rem; }
.ct-ko { margin-top: 12px; font-size: .86rem; color: var(--ink-2); }
.ct-ko b { color: var(--ink); }
.doc-qp, .doc-qa { padding: 0 4px; border-radius: 4px; background: var(--g-verb); color: #fff; }
.doc-qa { background: var(--yellow); color: var(--ink); }
.doc-qd { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.doc-qkey { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; font-size: .78rem; font-weight: 700; }
.doc-qpro { margin: 18px 0; padding: 18px 20px; border-radius: var(--r-sm); background: var(--tint); }
.doc-qpro h3 { margin: 0 0 8px; font-size: 1.1rem; }
.qp-rows { display: grid; gap: 8px; margin-top: 12px; }
.qp-rows li { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); }
.qp-at { display: inline-grid; place-items: center; height: 28px; margin-top: 6px; border-radius: var(--pill); background: var(--ink); color: #fff; font-size: .82rem; font-weight: 700; }
.qp-at.qa { background: var(--yellow); color: var(--ink); }
.qp-at.qd { background: var(--paper-2); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink-3); }
.qp-rows .ex { margin: 0; padding: 0; background: none; }
.qp-rows p { margin-top: 10px; font-size: .92rem; color: var(--ink-2); }
.pu.gap-dot { color: var(--g-noun); font-size: .8em; }
.doc-way { margin: 18px 0; padding: 18px; border-radius: var(--r-sm); border: 1px solid var(--line); }
.doc-way h3 { margin-top: 0; }
.doc-way .ex { background: var(--tint); border-color: transparent; }
.way-dots { margin-right: 6px; color: var(--red); letter-spacing: .1em; }
.doc-steps { display: grid; gap: 4px; margin: 16px 0; counter-reset: st; }
.doc-steps li { position: relative; padding: 4px 0 4px 40px; counter-increment: st; }
.doc-steps li::before { content: counter(st); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; font-weight: 800; font-size: .88rem; }
.doc-steps li p { color: var(--ink-2); }
.doc-steps .ex { margin: 6px 0 12px; background: var(--tint); border-color: transparent; }
.doc-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.doc-sum { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.doc-sum > div { padding: 14px 16px; border-radius: var(--r-sm); background: var(--tint); }
.doc-sum b { font-weight: 800; }
.doc-sum p { margin-top: 4px; color: var(--ink-2); font-size: .95rem; line-height: 1.9; }

/* 문장 원리 → 카툰보기 띠 */
.doc-comic { display: flex; align-items: center; gap: 18px; margin: 0 0 18px; padding: 14px 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); transition: border-color .2s, transform .25s var(--ease), box-shadow .25s var(--ease); }
.doc-comic:hover { border-color: var(--ink); transform: translateY(-2px); box-shadow: var(--shadow-up); }
.doc-comic img { width: 64px; height: auto; border-radius: 6px; box-shadow: 0 4px 12px rgba(22, 20, 15, .18); flex-shrink: 0; }
.doc-comic > span:not(.btn) { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.doc-comic small { font-size: .8rem; font-weight: 700; color: var(--red); }
.doc-comic b { font-size: 1.12rem; font-weight: 800; }
.doc-comic em { font-style: normal; font-size: .92rem; color: var(--ink-2); }
.doc-comic .btn svg { width: 16px; height: 16px; }

/* ── 카툰보기: 전자책 뷰어 ───────────────────────────── */
.reader { position: relative; display: flex; flex-direction: column; height: calc(100vh - var(--hdr)); height: calc(100dvh - var(--hdr)); min-height: 460px; background: #24211e; color: #fff; }
.reader.is-full { height: 100vh; }
.rd-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 4px; }
.rd-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; min-width: 0; }
.rd-title b { font-size: 1.05rem; font-weight: 800; }
.rd-title small { font-size: .82rem; color: rgba(255, 255, 255, .55); }
.rd-back { display: inline-flex; align-items: center; gap: 4px; flex-shrink: 0; font-size: .9rem; color: rgba(255, 255, 255, .7); transition: color .2s; }
.rd-back:hover { color: var(--yellow); }
.rd-back svg { width: 16px; height: 16px; }
.rd-stage { position: relative; flex: 1; min-height: 0; display: grid; place-items: center; overflow: hidden; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.reader.zoomed .rd-stage { overflow-y: auto; place-items: start center; padding: 12px 0; }
.rd-book, .rd-old { grid-area: 1 / 1; position: relative; display: flex; perspective: 2600px; cursor: pointer; }
.rd-old { pointer-events: none; }
.rd-pg, .rd-face { width: var(--pw); height: var(--ph); background: #fff; overflow: hidden; }
.rd-pg img, .rd-face img { display: block; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; }
.rd-book .rd-pg { box-shadow: 0 18px 50px rgba(0, 0, 0, .45); }
.rd-l { border-radius: 4px 0 0 4px; box-shadow: inset -22px 0 26px -20px rgba(0, 0, 0, .28), 0 18px 50px rgba(0, 0, 0, .45) !important; }
.rd-r { border-radius: 0 4px 4px 0; box-shadow: inset 22px 0 26px -20px rgba(0, 0, 0, .28), 0 18px 50px rgba(0, 0, 0, .45) !important; }
.rd-one { border-radius: 4px; }
/* 종이 넘김 (두 쪽 펼침) */
.rd-leaf { position: absolute; top: 0; z-index: 3; width: var(--pw); height: var(--ph); transform-style: preserve-3d; transition: transform .7s cubic-bezier(.45, .05, .3, 1); }
.rd-leaf.to-left { left: var(--pw); transform-origin: left center; }
.rd-leaf.to-right { left: 0; transform-origin: right center; }
.rd-leaf.to-left.go { transform: rotateY(-180deg); }
.rd-leaf.to-right.go { transform: rotateY(180deg); }
.rd-face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.rd-face.back { transform: rotateY(180deg); }
.rd-face::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(90deg, rgba(0, 0, 0, .12), rgba(0, 0, 0, 0) 30%, rgba(0, 0, 0, 0) 70%, rgba(0, 0, 0, .12)); }
/* 한 쪽씩: 옆으로 밀어 넘김 */
.rd-book.rd-in { opacity: 0; }
.rd-book.rd-in.from-r { transform: translateX(48px); }
.rd-book.rd-in.from-l { transform: translateX(-48px); }
.rd-book.rd-in.go { opacity: 1; transform: none; transition: transform .35s var(--ease), opacity .35s var(--ease); }
.rd-old.go { opacity: 0; transition: transform .35s var(--ease), opacity .3s var(--ease); }
.rd-old.out-l.go { transform: translateX(-48px); }
.rd-old.out-r.go { transform: translateX(48px); }
.rd-book.bump { animation: rd-bump .3s; }
@keyframes rd-bump { 30% { transform: translateX(-6px); } 70% { transform: translateX(6px); } }
.rd-arrow { position: absolute; top: 50%; z-index: 4; width: 48px; height: 48px; margin-top: -24px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .1); color: #fff; transition: background .2s, color .2s, opacity .2s; }
.rd-arrow svg { width: 22px; height: 22px; }
.rd-arrow:hover { background: #fff; color: var(--ink); }
.rd-arrow:disabled { opacity: 0; pointer-events: none; }
.rd-arrow.prev { left: max(12px, calc((100% - var(--wrap)) / 2 + 8px)); }
.rd-arrow.next { right: max(12px, calc((100% - var(--wrap)) / 2 + 8px)); }
.rd-bar { display: flex; align-items: center; gap: 10px; padding-top: 10px; padding-bottom: 14px; }
.rd-btn { flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, .22); color: #fff; transition: background .2s, color .2s, border-color .2s; }
.rd-btn svg { width: 18px; height: 18px; }
.rd-btn:hover { background: #fff; color: var(--ink); border-color: #fff; }
.rd-btn.on { background: var(--yellow); color: var(--ink); border-color: var(--yellow); }
.rd-range { flex: 1; min-width: 60px; accent-color: var(--yellow); }
.rd-count { flex-shrink: 0; min-width: 64px; text-align: center; font-family: var(--serif); font-weight: 700; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); }
.reader.two .rd-zoom { display: none; }
/* 목차 */
.rd-toc { position: absolute; inset: 0; z-index: 10; display: flex; justify-content: center; align-items: flex-end; background: rgba(0, 0, 0, .6); }
.rd-toc[hidden] { display: none; }
.rd-toc-in { width: 100%; max-width: var(--wrap); max-height: 78%; display: flex; flex-direction: column; border-radius: var(--r) var(--r) 0 0; background: var(--card); color: var(--ink); }
.rd-toc-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px var(--gut); border-bottom: 1px solid var(--line); }
.rd-toc-head .rd-btn { color: var(--ink); border-color: var(--line); }
.rd-toc-head .rd-btn:hover { background: var(--ink); color: #fff; border-color: var(--ink); }
.rd-thumbs { overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 14px; padding: 16px var(--gut) 24px; }
.rd-thumbs button { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .82rem; font-weight: 700; color: var(--ink-2); }
.rd-thumbs img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--line); transition: transform .2s var(--ease), box-shadow .2s; }
.rd-thumbs button:hover img { transform: translateY(-2px); box-shadow: var(--shadow); }
.rd-thumbs button.on img { outline: 3px solid var(--yellow); outline-offset: 1px; }
.rd-thumbs button.on span { color: var(--ink); }
@media (max-width: 640px) {
  .doc-comic { gap: 12px; padding: 12px; }
  .doc-comic img { width: 48px; }
  .doc-comic em { display: none; }
  .doc-comic .btn { padding: 0 12px; }
  .rd-title small { display: none; }
  .rd-arrow { display: none; }
  .rd-bar { gap: 8px; }
  .rd-count { min-width: 54px; font-size: .9rem; }
}

/* ── 구조 생성기 ───────────────────────────── */
.gen-in { padding: 18px; border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); }
.gen-label { display: block; font-weight: 800; margin-bottom: 8px; }
.gen-label small { font-weight: 500; color: var(--ink-3); font-size: .84rem; margin-left: 6px; }
#genText { width: 100%; min-height: 110px; padding: 14px 16px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--card); font: inherit; font-size: 1.08rem; line-height: 1.6; color: var(--ink); resize: vertical; transition: border-color .2s; }
#genText:focus { outline: none; border-color: var(--ink); }
.gen-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.gen-samples { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.gen-samples > span { font-size: .84rem; font-weight: 700; color: var(--ink-3); margin-right: 2px; }
.gen-act .btns { display: flex; gap: 8px; margin-left: auto; }
.gen-legend { margin: 18px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; font-size: .86rem; color: var(--ink-2); }
.gen-legend .br, .gen-legend .sl { font-weight: 800; }
.br.a-n, .sl { color: var(--g-noun); } .br.a-j { color: #e0a800; } .br.a-v { color: var(--g-verb); } .br.a-s { color: var(--g-conn); }
.gen-note { margin: 10px 0 0; text-align: center; font-size: .86rem; color: var(--ink-3); }
.gen-out { margin: 24px 0 0; display: grid; gap: 18px; scroll-margin-top: calc(var(--hdr) + 16px); }
.gen-count { font-size: .92rem; color: var(--ink-2); }
.gen-empty { text-align: center; color: var(--ink-3); padding: 30px 0; }
.gen-card { border-radius: var(--r); background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.gen-card.editing { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft), var(--shadow); }
.gen-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line); }
.gen-no { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--red); }
.gen-tools { display: flex; gap: 6px; }
.gen-edit { padding: 14px 20px 0; }
.gen-tip { margin-top: 8px; font-size: .9rem; color: var(--ink-2); }
.gen-tip .bad { color: var(--g-noun); font-weight: 700; }
.gen-pens button[data-v="part"] { color: var(--g-coord); }
.gen-sent { padding: 18px 20px 6px; }
.gen-card:not(.editing) .gen-sent .wd { cursor: default; }
.gen-card:not(.editing) .gen-sent .wd:not([class*="r-"]):hover { background: none; }
.gen-sheet { margin: 6px 20px 12px; }
.gen-tree { margin: 10px 20px 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.gen-exp { border-top: 1px solid var(--line); background: var(--tint); }
.gen-exp summary { cursor: pointer; padding: 12px 20px; font-weight: 800; font-size: .95rem; list-style: none; display: flex; align-items: center; gap: 8px; }
.gen-exp summary::-webkit-details-marker { display: none; }
.gen-exp summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ink-3); border-bottom: 2px solid var(--ink-3); transform: rotate(45deg) translateY(-2px); transition: transform .25s var(--ease); }
.gen-exp[open] summary::after { transform: rotate(225deg) translateY(-2px); }
.ex-list { padding: 0 20px 16px; display: grid; gap: 8px; }
.ex-row { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; margin-left: calc(var(--d, 0) * 18px); border-radius: var(--r-sm); background: var(--card); border: 1px solid var(--line); font-size: .95rem; }
.ex-row > div { min-width: 0; flex: 1; }
.ex-row p { margin-top: 4px; font-size: .88rem; color: var(--ink-2); line-height: 1.6; }
.ex-row small { color: var(--ink-3); font-size: .78rem; }
.ex-row .mk { line-height: 1.9; }
.ex-row em { font-style: normal; font-weight: 800; font-size: .78rem; padding: 1px 6px; border-radius: 4px; margin-right: 4px; }
.ex-row em.ser { background: var(--red-soft); color: var(--red); }
.ex-row em.par { background: #e6f4ec; color: var(--g-conn); }
.mkname.a-n { color: var(--g-noun); } .mkname.a-j { color: #b58800; } .mkname.a-v { color: var(--g-verb); } .mkname.a-s { color: var(--g-conn); }
.ex-row .mkname.a-v { color: var(--g-noun); }
.ex-bone { border-color: var(--ink); }
.ex-bone .w-n, .ex-bone .w-v, .ex-bone .w-p { font-size: .95rem; }
.gen-code { padding: 0 20px 18px; display: grid; gap: 8px; }
.gen-code label { font-size: .85rem; font-weight: 800; color: var(--red); }
.gen-code label small { display: block; font-weight: 500; color: var(--ink-3); }
.gen-code textarea { width: 100%; padding: 10px 12px; border-radius: var(--r-sm); border: 1px solid var(--line); font-family: ui-monospace, Consolas, monospace; font-size: .85rem; color: var(--ink); resize: vertical; }
.gen-code .btns { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

/* 전체화면 — 흰 바탕에 문장과 구조만 */
.fs { position: fixed; inset: 0; z-index: 200; background: #fff; overflow: auto; display: flex; flex-direction: column; }
.fs[hidden] { display: none; }
.fs-on { overflow: hidden; }
.fs-bar { position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; transition: opacity .4s; }
.fs.idle .fs-bar { opacity: 0; }
.fs-no { font-family: var(--serif); font-weight: 700; color: var(--ink-3); }
.fs-btns { display: flex; gap: 8px; }
.fs-btns .icon-btn:disabled { opacity: .3; pointer-events: none; }
.fs-body { flex: 1; width: 100%; max-width: 1400px; margin: 0 auto; padding: 2vh clamp(20px, 5vw, 72px) 8vh; display: flex; flex-direction: column; justify-content: center; }
.fs-sent { font-size: clamp(1.4rem, 3vw, 2.5rem); line-height: 2.1; letter-spacing: -.005em; }
.fs-sent.one-line { white-space: nowrap; }
.fs-tree { margin-top: clamp(28px, 5vh, 56px); padding-top: clamp(20px, 4vh, 40px); border-top: 1.5px dashed var(--line); font-size: clamp(1.15rem, 2.2vw, 1.8rem); }
.fs-tree .dl { line-height: 1.7; margin: 6px 0; }
.fs-left { display: flex; align-items: center; gap: 14px; }
.fs-sent .wd { transition: color .4s var(--ease), opacity .4s var(--ease); }
.fs-sent .wd.fs-later { color: var(--ink-3); opacity: .35; }
.fs.stepping .fs-body { cursor: pointer; padding-bottom: 4vh; }
.fs-step { position: sticky; bottom: 0; width: 100%; max-width: 1400px; margin: 0 auto; padding: 0 clamp(20px, 5vw, 72px) 20px; background: linear-gradient(rgba(255, 255, 255, 0), #fff 24px); }
.fs-step[hidden] { display: none; }
.fs-cap { margin: 0 0 12px; font-size: 1.05rem; }
.fs-cap .mk { font-size: 1.1rem; }
.fs-step-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.fs-step-nav .btn svg { width: 16px; height: 16px; }
.fs-step-nav .btn:disabled { opacity: .35; pointer-events: none; }
.fs-count { font-family: var(--serif); font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .fs-bar { padding: 10px 12px; }
  .fs-no { display: none; }
  .fs-btns { gap: 4px; }
  .fs-step-nav .btn { padding: 0 12px; }
}

@media (max-width: 640px) {
  .doc-sec { padding: 22px 18px; }
  .doc-pair, .doc-vs, .doc-sum { grid-template-columns: 1fr; }
  .ct-g { grid-template-columns: 1fr; }
  .qp-rows li { grid-template-columns: 1fr; gap: 6px; }
  .qp-at { justify-self: start; padding: 0 12px; margin-top: 0; }
  .ct-h { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 14px; }
  .ct-h h3 { margin: 0; }
  .ct-h .ct-mk { margin-top: 0; }
  .ct-rows li { grid-template-columns: 1fr; gap: 4px; padding: 10px 14px; }
  .doc-wh { grid-template-columns: 1fr 1fr; }
  .doc-grid4 { grid-template-columns: 1fr 1fr; }
  .dt-row { grid-template-columns: .9fr 1fr 1fr; }
  .dt-row > span { padding: 10px 8px; font-size: .86rem; }
  .doc-parts li { padding-left: 50px; }
  .doc-toc { justify-content: flex-start; padding-top: 8px; padding-bottom: 8px; }
  .toc-ind { top: 8px; height: 34px; }
  .doc-toc a { height: 34px; font-size: .86rem; }
  .ex { padding: 12px 12px; }
  .gen-in { padding: 14px; }
  .gen-act .btns { width: 100%; }
  .gen-act .btns .btn { flex: 1; }
  .gen-head { padding-left: 16px; }
  .gen-sent, .gen-edit { padding-left: 16px; padding-right: 16px; }
  .gen-tree, .gen-sheet { margin-left: 16px; margin-right: 16px; }
  .ex-list { padding: 0 12px 14px; }
  .gen-exp summary { padding-left: 16px; }
  .ex-row { margin-left: calc(var(--d, 0) * 8px); }
  .gen-pens button { padding: 7px 10px; font-size: .88rem; }
}

/* ── 푸터 — 흰 바탕, 본문과 같은 .wrap 끝선 ───────────────────────────── */
.site-footer { background: #fff; color: var(--ink-3); font-size: .92rem; border-top: 1px solid var(--line); }
.ft-in { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px 40px; flex-wrap: wrap; padding-top: 44px; padding-bottom: 28px; }
.ft-brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.ft-brand img { width: 40px; height: 40px; border-radius: 50%; }
.ft-brand b { display: block; font-size: 1.05rem; }
.ft-brand small { font-family: var(--serif); color: var(--ink-3); font-size: .8rem; }
.ft-desc { margin-top: 12px; }
.ft-links { display: flex; gap: 6px 22px; flex-wrap: wrap; align-items: center; color: var(--ink-2); }
.ft-links a:hover { color: var(--red); }
.ft-links b { color: var(--ink); }
.ft-bottom { padding-bottom: 32px; font-size: .84rem; }
.ft-bottom p { padding-top: 18px; border-top: 1px solid var(--line); } /* 선도 글자와 같은 끝선 (wrap 안쪽) */

/* xms 게시판 · 회원 화면 강조색 */
.xms-c { --brand: var(--red); }

/* ── 움직임 줄이기 ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ── 1024 이하 ───────────────────────────── */
@media (max-width: 1024px) {
  .course-grid { grid-template-columns: repeat(2, 1fr); }
  .rm-level { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .rm-level:not(:last-child)::before { display: none; }
  .rm-side { padding-top: 0; align-items: center; }
  .rm-side > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; }
  .rm-side small, .rm-side p { margin-top: 0; }
  .detail { grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; }
  .classroom { grid-template-columns: minmax(0, 1fr) 300px; gap: 18px; }
  .flow { grid-template-columns: repeat(2, 1fr); }
}

/* ── 860 이하: 모바일 메뉴 ───────────────────────────── */
@media (max-width: 860px) {
  :root { --hdr: 60px; }
  .nav-toggle { display: block; margin-right: -6px; }
  .hdr-act { margin-left: auto; }
  .hdr-my { display: none; }
  .gnb {
    position: fixed; top: var(--hdr); left: 0; right: 0; z-index: 49;
    flex-direction: column; align-items: stretch; gap: 0; margin: 0;
    padding: 8px var(--gut) 20px; background: var(--paper); border-bottom: 1px solid var(--line);
    box-shadow: 0 20px 40px rgba(22, 20, 15, .08);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity .25s var(--ease), transform .25s var(--ease), visibility .25s;
  }
  .nav-open .gnb { opacity: 1; visibility: visible; transform: none; }
  .gnb a { padding: 15px 6px; border-radius: 0; border-bottom: 1px solid var(--line); font-size: 1.12rem; }
  .gnb a:hover, .gnb a[aria-current="page"] { background: none; color: var(--red); }

  .hero::before { inset: 0 0 auto 0; height: calc(clamp(56px, 8vw, 96px) + min(130px, 35vw)); }
  .hero-in { grid-template-columns: 1fr; gap: 36px; text-align: left; }
  .hero-logo { width: min(260px, 70%); order: -1; }
  .pillars { grid-template-columns: 1fr; }
  .layer-steps { grid-template-columns: 1fr; gap: 8px; }
  .layer-step { padding: 12px 14px; align-items: center; }
  .layer-step small { display: none; }
  .layer-step b { width: 34px; height: 34px; }
  .detail { grid-template-columns: 1fr; }
  .side-card { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; border-radius: 0; border-width: 1px 0 0; box-shadow: 0 -8px 24px rgba(22, 20, 15, .08); }
  .side-card .thumb, .side-card .side-note, .side-card .prog-row { display: none; }
  .side-card .side-in { grid-template-columns: 1fr 1fr; gap: 8px; padding: 10px var(--gut) calc(10px + env(safe-area-inset-bottom)); }
  .side-card .side-in > .btn:only-of-type { grid-column: 1 / -1; }
  .has-bar { padding-bottom: 96px; }
  .classroom { display: block; padding: 0; }
  .class-main { padding: 20px var(--gut) 32px; }
  .class-side { position: static; max-height: none; border-width: 1px 0 0; border-radius: 0; box-shadow: none; }
  .class-only-m { display: block; }
  .class-side.m-hide { display: none; }
  .resume { grid-template-columns: 1fr; }
}

/* ── 640 이하 ───────────────────────────── */
@media (max-width: 640px) {
  .course-grid { grid-template-columns: 1fr; gap: 16px; }
  .rm-card { grid-template-columns: 96px minmax(0, 1fr); gap: 0 12px; padding: 12px; align-items: center; }
  .rm-body { display: contents; }
  .rm-thumb { grid-row: 1 / 3; align-self: start; }
  .rm-card .thumb { padding: 6px 8px; }
  .rm-card .thumb-word { font-size: .95rem; }
  .rm-card .thumb-sub, .rm-go { display: none; }
  .rm-body h4 { grid-column: 2; align-self: end; font-size: 1rem; line-height: 1.35; }
  .rm-meta { grid-column: 2; align-self: start; font-size: .8rem; }
  .rm-desc, .rm-tags { grid-column: 1 / -1; }
  .rm-desc { font-size: .92rem; margin-top: 10px; }
  .rm-tags span { border-radius: 8px; }
  .ft-in { flex-direction: column; }
  .checks { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stat { padding: 14px 12px; }
  .stat b { font-size: 1.4rem; }
  .stat b span { font-size: .85rem; }
  .flow { grid-template-columns: 1fr; gap: 12px; }
  .flow li { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-content: center; }
  .flow li::before { top: 8px; left: 8px; width: 32px; height: 32px; font-size: .85rem; }
  .flow-img { grid-row: 1 / 3; aspect-ratio: auto; height: 100%; min-height: 116px; }
  .flow h3 { padding: 14px 14px 0; }
  .flow p { padding: 0 14px 14px; font-size: .92rem; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .hero-cta .btn, .band-cta .btn { flex: 1 1 auto; }
  .tr-source, .tr-stage { padding-left: 16px; padding-right: 16px; }
  .legend { padding-left: 16px; padding-right: 16px; }
  .build-pool { padding-left: 16px; padding-right: 16px; }
  .tr-bar { padding: 12px 14px; }
  .class-main { padding-top: 0; padding-left: 0; padding-right: 0; }
  .class-main .player { border-radius: 0; }
  .class-main > :not(.player) { margin-left: var(--gut); margin-right: var(--gut); }
  .class-title { flex-direction: column; }
  .class-nav { width: 100%; display: grid; grid-template-columns: auto 1fr auto; }
  .class-nav .btn { padding: 0 14px; }
  .brand-txt small { display: none; }
}
