:root {
  --bg: #fafaf8;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-soft: #f3f3ef;
  --border: rgba(15, 15, 20, 0.08);
  --border-strong: rgba(15, 15, 20, 0.14);
  --text: #1a1a22;
  --text-soft: #3d3d48;
  --text-muted: #6f6f7a;
  --accent: #ea4b71;
  --accent-strong: #d62553;
  --accent-soft: rgba(234, 75, 113, 0.12);
  --accent-bg: #fdeef2;
  --pink: #ea4b71;
  --pink-soft: rgba(234, 75, 113, 0.12);
  --pink-bg: #fdeef2;
  --code-bg: #1e1e28;
  --code-text: #e6e6ec;
  --shadow-sm: 0 1px 2px rgba(15, 15, 20, 0.05);
  --shadow-md: 0 8px 28px rgba(15, 15, 20, 0.08);
  --shadow-lg: 0 24px 60px rgba(15, 15, 20, 0.1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Pretendard Variable", Pretendard, -apple-system,
    BlinkMacSystemFont, system-ui, "Apple SD Gothic Neo", sans-serif;
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--accent-soft); color: var(--accent-strong); }
a {
  color: var(--accent-strong);
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
}
a:hover { border-bottom-color: var(--accent-strong); }

/* 학생용 2컬럼 레이아웃 */
.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  max-width: 1380px;
  margin: 0 auto;
  min-height: 100vh;
}
.main {
  max-width: 820px;
  padding: 80px 56px 160px;
  margin: 0;
}

.chapter-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-bg);
  border: 1px solid rgba(234, 75, 113, 0.22);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

h1 {
  font-size: 38px;
  line-height: 1.2;
  font-weight: 800;
  margin: 0 0 20px;
  letter-spacing: -0.02em;
  color: var(--text);
}
h1 .accent { color: var(--accent-strong); }
.lead {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-soft);
  margin: 0 0 48px;
}
.lead b { color: var(--text); }

h2 {
  font-size: 30px;
  font-weight: 800;
  margin: 88px 0 20px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
  scroll-margin-top: 24px;
}
h3 {
  font-size: 21px;
  font-weight: 700;
  margin: 44px 0 14px;
  line-height: 1.35;
  color: var(--text);
}
p {
  margin: 0 0 20px;
  color: var(--text-soft);
}
p b, p strong { color: var(--text); }
ul, ol { margin: 0 0 24px; padding-left: 24px; }
li { margin-bottom: 8px; color: var(--text-soft); }
li::marker { color: var(--text-muted); }
hr { border: none; height: 1px; background: var(--border); margin: 72px 0; }

/* clip-section — 한 챕터 페이지 안의 클립 블록 (앵커 스크롤 단위) */
.clip-section {
  scroll-margin-top: 24px;
}
.clip-section + .clip-section {
  margin-top: 96px;
  padding-top: 56px;
  border-top: 1px solid var(--border);
}
.clip-section h2 {
  font-size: 30px;
  font-weight: 800;
  margin: 0 0 28px;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--text);
}
.clip-label {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  margin-bottom: 14px;
}
h4 {
  font-size: 17px;
  font-weight: 700;
  margin: 32px 0 12px;
  line-height: 1.4;
  color: var(--text);
}

/* section-label — 본문 흐름 안 작은 라벨 박스 (예: "1부. 이론") */
.section-label {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 72px 0 16px;
}

/* 코드 블록 */
pre {
  margin: 0 0 24px;
  padding: 16px 20px;
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 10px;
  overflow-x: auto;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  line-height: 1.6;
}
pre code { background: transparent; padding: 0; color: inherit; font-family: inherit; }
:not(pre) > code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
  color: var(--text);
}

blockquote {
  margin: 0 0 20px;
  padding: 14px 22px;
  border-left: 3px solid var(--border-strong);
  background: var(--bg-soft);
  color: var(--text-soft);
  border-radius: 0 8px 8px 0;
}
blockquote p { margin: 0; color: var(--text-soft); }

/* 인용 박스 3종 (build_web가 > 첫 글자로 분류) */
/* 프롬프트·인용 — 차분한 중립(기본). alert처럼 안 보이게 */
blockquote.cl-quote { font-style: italic; position: relative; padding-right: 48px; }
/* 프롬프트 박스 복사 버튼 (cl-quote 전용) */
blockquote.cl-quote .copy-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: var(--bg-elev);
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  opacity: 0.5;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
blockquote.cl-quote:hover .copy-btn,
blockquote.cl-quote .copy-btn:focus-visible { opacity: 1; }
blockquote.cl-quote .copy-btn:hover { color: var(--accent); border-color: var(--accent); }
blockquote.cl-quote .copy-btn.copied { color: #2e9e5b; border-color: #2e9e5b; opacity: 1; }
/* mock-doc — 긴 실습 원문(메일·회의 녹취): 줄바꿈 보존 + 정체 + 좌측정렬 */
blockquote.cl-quote.mock-doc { font-style: normal; }
blockquote.cl-quote.mock-doc > p {
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  font-size: 14px;
  line-height: 1.72;
  color: var(--text);
}
/* 아주 긴 녹취는 스크롤 박스로 접어 페이지 흐름 유지 */
blockquote.cl-quote.mock-doc--scroll > p {
  max-height: 440px;
  overflow-y: auto;
  padding-right: 8px;
}

/* ★ 중요·안전 — 핑크 강조 (꼭 봐야 할 것만) */
blockquote.cl-important {
  border-left-color: var(--accent-strong);
  background: var(--accent-bg);
}
/* 💡 팁 — 옅은 앰버 */
blockquote.cl-tip {
  border-left-color: #e0a200;
  background: #fff7e0;
}

/* summary — 큰 콜아웃 박스 */
.summary {
  background: linear-gradient(135deg, rgba(234, 75, 113, 0.08), rgba(200, 50, 79, 0.06));
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  padding: 28px 32px;
  margin: 28px 0;
  box-shadow: var(--shadow-sm);
}
.summary p {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--text);
  margin: 0 0 12px;
}
.summary p:last-child { margin-bottom: 0; }
.summary b { color: var(--accent-strong); }

/* mission — 회차별 3시간 산출물 미션 */
.mission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0 36px;
}
.mission-card,
.mission-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.mission-card {
  padding: 20px 22px;
}
.mission-card h4 {
  margin: 6px 0 8px;
  font-size: 17px;
}
.mission-card p {
  margin-bottom: 14px;
  font-size: 15px;
  line-height: 1.65;
}
.mission-panel {
  margin: 28px 0 40px;
  padding: 26px 30px;
  border-left: 4px solid var(--accent-strong);
}
.mission-panel h2 {
  margin: 4px 0 10px;
  font-size: 25px;
}
.mission-panel p {
  margin-bottom: 14px;
}
.mission-panel ul {
  margin-bottom: 18px;
}
.mission-kicker {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.mission-submit {
  display: block;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

/* step-diagram — 순서 있는 짧은 리스트: 세로 행 + 원형 번호 */
.step-diagram {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 24px 0 36px;
}
.step-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
}
.step-card .step-num {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 14px;
  font-weight: 800;
}
.step-card p {
  margin: 0;
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.55;
}
.step-card p strong { color: var(--accent-strong); }
.step-card p code { font-size: 0.9em; }

/* exercise — 회차별 단계별 미션 실습 */
.exercise {
  margin: 20px 0 32px; padding: 24px; border: 1px solid var(--border-strong);
  border-radius: 16px; background: var(--bg-soft);
}
.ex-scenario { margin: 0 0 18px; font-size: 15px; line-height: 1.7; color: var(--text-soft); }
.ex-scenario b { color: var(--accent-strong); }
.ex-mission { display: flex; gap: 14px; margin-bottom: 16px; }
.ex-m-num {
  flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 14px;
}
.ex-m-body { flex: 1; min-width: 0; }
.ex-m-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 4px 0 8px; }
.ex-mission .cl-quote { margin: 0; }
.ex-checklist {
  margin-top: 20px; padding-top: 18px; border-top: 1px dashed var(--border-strong);
}
.ex-check-label { font-size: 12px; font-weight: 800; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 10px; }
.ex-check {
  display: flex; align-items: flex-start; gap: 10px; padding: 8px 0;
  font-size: 14.5px; line-height: 1.5; color: var(--text-soft); cursor: pointer;
}
.ex-check input { margin-top: 3px; accent-color: var(--accent); flex: none; width: 16px; height: 16px; }
.ex-check input:checked + span { color: var(--text-muted); text-decoration: line-through; }

@media (max-width: 640px) { .exercise { padding: 16px; } }

/* cli-details — 선택 접이식 섹션 (터미널 설치 등) */
.cli-details {
  margin: 24px 0 28px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-soft, rgba(0,0,0,0.02));
  padding: 4px 20px;
}
.cli-details > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-strong);
  padding: 14px 4px;
  list-style: none;
}
.cli-details > summary::-webkit-details-marker { display: none; }
.cli-details > summary::before { content: "▸ "; }
.cli-details[open] > summary::before { content: "▾ "; }
.cli-details[open] > summary { border-bottom: 1px solid var(--border); margin-bottom: 12px; }

/* img-placeholder — 향후 스크린샷·영상이 들어갈 위치 표시 */
.img-placeholder {
  margin: 24px 0 28px;
  padding: 40px 24px;
  border: 2px dashed rgba(234, 75, 113, 0.35);
  border-radius: 14px;
  background: var(--accent-bg);
  text-align: center;
}
.img-placeholder .placeholder-icon {
  font-size: 32px;
  margin-bottom: 12px;
  filter: grayscale(20%);
}
.img-placeholder .placeholder-label {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-strong);
  margin-bottom: 8px;
}
.img-placeholder .placeholder-desc {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.55;
  max-width: 600px;
  margin: 0 auto;
}

/* compare-grid — vs 비교 두 컬럼 박스 */
.compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin: 24px 0 36px;
}

/* 사이드바 로고 → 홈 링크 */
a.brand { text-decoration: none; color: inherit; cursor: pointer; }
.compare-card {
  padding: 22px 26px;
  border-radius: 14px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.compare-card.bad {
  background: var(--bg-soft);
}
.compare-card.good {
  background: var(--accent-bg);
  border-color: rgba(234, 75, 113, 0.22);
}
.compare-card .cmp-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  margin-bottom: 10px;
}
.compare-card.bad .cmp-label { color: var(--text-muted); }
.compare-card.good .cmp-label { color: var(--accent-strong); }
.compare-card h4 {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--text);
}
.compare-card ul {
  margin: 0;
  padding-left: 20px;
}
.compare-card li {
  font-size: 14.5px;
  color: var(--text-soft);
  margin-bottom: 8px;
  line-height: 1.55;
}
.compare-card li:last-child { margin-bottom: 0; }
@media (max-width: 780px) {
  .compare-grid { grid-template-columns: 1fr; }
}

/* flow-diagram — 시스템 구조 흐름도 (박스 + 화살표) */
.flow-diagram {
  display: grid;
  gap: 14px;
  margin: 24px 0 36px;
  padding: 28px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.flow-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}
.flow-node {
  flex: 1 1 0;
  min-width: 140px;
  padding: 18px 16px;
  border-radius: 12px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 14.5px;
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.flow-node small {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 6px;
}
.flow-node.primary {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent-strong);
}
.flow-arrow {
  font-weight: 800;
  font-size: 13px;
  color: var(--accent-strong);
  white-space: nowrap;
  padding: 0 4px;
}
.flow-arrow::before { content: "→"; margin-right: 4px; font-size: 18px; }
@media (max-width: 780px) {
  .flow-row { flex-direction: column; }
  .flow-arrow::before { content: "↓"; }
}

/* concept-card — 개념·전환 카드 (다이어그램 placeholder 대체) */
.concept-card {
  text-align: center;
  padding: 30px 24px;
  margin: 24px 0 36px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--bg-soft);
}
.concept-card .cc-icon { font-size: 38px; line-height: 1; margin-bottom: 12px; }
.concept-card .cc-title { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 6px; }
.concept-card .cc-sub { font-size: 15px; color: var(--text-soft); }

/* md-figure — 마크다운 이미지 ![alt](src) (스크린샷·캡처) */
.md-figure { margin: 24px 0 36px; text-align: center; }
.md-figure img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.md-figure figcaption { margin-top: 10px; font-size: 13px; color: var(--text-muted); }

/* key-callout — 핵심 강조 박스 */
.key-callout {
  margin: 28px 0;
  padding: 22px 26px 22px 64px;
  border-radius: 12px;
  background: var(--accent-bg);
  border: 1px solid rgba(234, 75, 113, 0.22);
  position: relative;
}
.key-callout::before {
  content: "★";
  position: absolute;
  top: 22px;
  left: 24px;
  font-size: 22px;
  color: var(--accent-strong);
  line-height: 1;
}
.key-callout .kc-label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 800;
  color: var(--accent-strong);
  margin-bottom: 6px;
}
.key-callout p {
  margin: 0;
  color: var(--text);
  font-size: 15.5px;
  line-height: 1.7;
}
.key-callout p strong { color: var(--accent-strong); }

/* feature-grid — "**키워드**: 설명" 패턴 리스트의 카드 그리드 변환 */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0 32px;
}
.feature-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 22px;
  box-shadow: var(--shadow-sm);
}
.feature-card h4 {
  margin: 0 0 6px;
  font-size: 14.5px;
  font-weight: 800;
  color: var(--accent-strong);
  letter-spacing: -0.005em;
}
.feature-card p {
  margin: 0;
  font-size: 14px;
  color: var(--text-soft);
  line-height: 1.6;
}
@media (max-width: 780px) {
  .feature-grid { grid-template-columns: 1fr; }
  .mission-grid { grid-template-columns: 1fr; }
  .mission-panel { padding: 22px 20px; }
  .mission-panel h2 { font-size: 22px; }
}

/* routing-list — "A → B" 패턴 리스트의 라우팅 카드 */
.routing-list {
  display: grid;
  gap: 8px;
  margin: 16px 0 32px;
}
.routing-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 14px 22px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
}
.routing-row .from {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.routing-row .arrow {
  color: var(--accent-strong);
  font-weight: 800;
  font-size: 16px;
}
.routing-row .to {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-strong);
}
@media (max-width: 780px) {
  .routing-row {
    grid-template-columns: 1fr;
    gap: 4px;
    text-align: left;
  }
  .routing-row .arrow { transform: rotate(90deg); justify-self: start; }
}

/* md-table — 마크다운 표 변환 */
.md-table-wrap {
  margin: 16px 0 32px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  background: var(--bg-elev);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.md-table th, .md-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.md-table th {
  font-weight: 800;
  color: var(--text);
  background: var(--bg-soft);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.md-table td {
  color: var(--text-soft);
  line-height: 1.6;
}
.md-table tbody tr:last-child td { border-bottom: none; }
.md-table tbody tr { transition: background-color 130ms ease; }
.md-table tbody tr:hover td { background-color: var(--accent-bg); color: var(--text); }

/* 다음 클립 CTA */
.next-cta {
  margin-top: 24px;
  padding: 22px 26px;
  border-radius: 12px;
  background: var(--accent-bg);
  border: 1px solid rgba(234, 75, 113, 0.24);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.next-cta .label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
}
.next-cta .title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.next-cta a {
  border-bottom: none;
  font-weight: 700;
  font-size: 14px;
  padding: 10px 18px;
  background: var(--accent-strong);
  color: white;
  border-radius: 8px;
  white-space: nowrap;
}
.next-cta a:hover { background: var(--accent); }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 260px 1fr; }
  .main { padding: 64px 40px 120px; }
}
@media (max-width: 780px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { padding: 48px 24px 96px; }
}

/* frontmatter 색상 강조 — description을 3분할(무엇을/트리거/우선순위)해 표와 색으로 연결 */
.fm-code .fm-what { color: #7dd3fc; font-weight: 600; }
.fm-code .fm-trigger { color: #86efac; font-weight: 600; }
.fm-code .fm-priority { color: #fcd34d; font-weight: 600; }

/* 표 안 영어 원문 하이라이트 — 코드블록 색(파랑/초록/노랑)과 짝 */
.md-table code.hl-what { background: #dbeafe; border-color: #bfdbfe; color: #1e3a8a; }
.md-table code.hl-trigger { background: #dcfce7; border-color: #bbf7d0; color: #14532d; }
.md-table code.hl-priority { background: #fef3c7; border-color: #fde68a; color: #78350f; }

/* contrast — 항목 비교 표 (행 레이블 + 컬럼별 비교) */
.contrast {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 32px;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--bg-elev);
}
.contrast th, .contrast td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border);
  vertical-align: top;
  line-height: 1.6;
}
.contrast th:last-child, .contrast td:last-child { border-right: none; }
.contrast tr:last-child th, .contrast tr:last-child td { border-bottom: none; }
/* 컬럼 헤더 행 */
.contrast tr:first-child th {
  font-weight: 800;
  color: var(--text);
  background: var(--bg-soft);
  font-size: 13px;
}
/* 행 레이블(첫 칸) */
.contrast td:first-child {
  font-weight: 700;
  color: var(--text);
  background: var(--bg-soft);
  white-space: nowrap;
}
.contrast td { color: var(--text-soft); }
/* 비교 대상 컬럼 은은한 강조 */
.contrast td.colB { background: var(--accent-bg); }
/* 행 hover — 데이터 행만 (헤더 행 제외) */
.contrast tr { transition: background-color 130ms ease; }
.contrast tr:not(:first-child):hover td { background-color: var(--accent-soft); color: var(--text); }
.contrast tr:not(:first-child):hover td:first-child { background-color: var(--accent-soft); }

/* 커리큘럼 모듈 카드 (index 커리큘럼 섹션) — 모듈 그룹 + 챕터 나열.
   주: 학생용엔 시간 표시 금지이므로 모듈에 .module-time(소요시간)은 두지 않는다. */
.curriculum-modules { display: flex; flex-direction: column; gap: 16px; margin: 18px 0 8px; }
.module-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.module-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.module-badge {
  background: var(--accent-bg);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 3px 11px;
  border-radius: 20px;
  white-space: nowrap;
}
.module-head h4 { margin: 0; font-size: 16px; font-weight: 800; color: var(--text); flex: 1; }
.module-ba { margin: 11px 0 12px; font-size: 13.5px; color: var(--text-soft); line-height: 1.6; }
.module-ba b { color: var(--accent-strong); font-weight: 800; }
.module-chapters {
  list-style: none;
  padding: 12px 0 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-top: 1px solid var(--border);
}
.module-chapters li { margin: 0; }
.module-chapters a {
  display: block;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13.5px;
  color: var(--text-soft);
  font-weight: 600;
  text-decoration: none;
  border-bottom: none;
  transition: background 120ms ease, color 120ms ease;
}
.module-chapters a:hover { background: var(--accent-bg); color: var(--accent-strong); border-bottom: none; }

/* ── 강사소개 페이지 (instructor.html) ──
   본문 원문 소스: instructor/<강사>/profile.md. 사진: instructor.jpg.
   강의별 web/로 복사해 쓰는 캐논 페이지 — 한 사람을 여러 강의에서 재사용. */
.instructor-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin: 8px 0 24px;
  flex-wrap: wrap;
}
.instructor-photo {
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
}
.instructor-id { flex: 1; min-width: 220px; }
.instructor-id h1 { margin: 0 0 6px; }
.instructor-role {
  margin: 0;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--accent-strong);
  line-height: 1.5;
}
/* 이력 묶음 — 저서/강의/발표/컨설팅 등. section-label + 간결한 목록 */
.instructor-block { margin: 22px 0; }
.instructor-block ul {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}
.instructor-block ul li { margin: 3px 0; }

/* ── 용어 사전 (glossary.html) — 용어 + 설명 정의 목록 ── */
.glossary-list {
  margin: 18px 0 8px;
  border-top: 1px solid var(--border);
}
.glossary-item {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 8px 32px;
  padding: 18px 0;
  border-bottom: 1px solid var(--border);
}
.glossary-item .g-term {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.5;
}
.glossary-item .g-en {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}
.glossary-item .g-def {
  margin: 0;
  font-size: 15px;
  color: var(--text-soft);
  line-height: 1.7;
}
.glossary-item .g-def code {
  font-size: 13px;
}
@media (max-width: 720px) {
  .glossary-item { grid-template-columns: 1fr; gap: 6px; }
}

/* ── 공용 푸터 (sidebar.js가 모든 페이지에 주입) — 외부 반출·재배포 금지 ── */
.page-footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.6;
}
.page-footer b { color: var(--text-soft); font-weight: 700; }

/* page-hud — 스크롤 중에도 현재 위치를 계속 보여주는 상단 고정 바.
   sidebar.js가 모든 페이지 .main 맨 앞에 주입한다(페이지마다 적지 않음).
   좌우 음수 마진으로 .main 패딩을 가로질러 폭을 채우므로, 아래 반응형에서
   .main 패딩이 바뀔 때 같은 값으로 맞춰야 한다. */
.page-hud {
  position: sticky;
  top: 0;
  z-index: 30;
  margin: -80px -56px 32px;
  padding: 12px 56px 0;
  background: rgba(250, 250, 248, 0.88);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.hud-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
}
.hud-mod {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--accent-strong);
  background: var(--accent-bg);
  border-radius: 999px;
  padding: 3px 9px;
  white-space: nowrap;
  flex: none;
}
.hud-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.hud-pos {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none;
}
.hud-bar {
  height: 2px;
  background: var(--accent-soft);
  margin: 0 -56px;
}
.hud-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 90ms linear;
}
@media (max-width: 1080px) {
  .page-hud { margin: -64px -40px 28px; padding: 11px 40px 0; }
  .hud-bar { margin: 0 -40px; }
}
@media (max-width: 780px) {
  .page-hud { margin: -48px -24px 24px; padding: 10px 24px 0; }
  .hud-bar { margin: 0 -24px; }
  .hud-title { font-size: 12.5px; }
}

/* prompts.html — 전 챕터 복사용 프롬프트 모음 */
.pl-status {
  color: var(--text-muted);
  font-size: 14px;
}
.pl-group { margin: 0 0 44px; }
.pl-group-label {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  margin: 0 0 4px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-soft);
}
.pl-group-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 6px;
}
.pl-chapter { margin: 22px 0 0; }
.pl-chapter-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 8px;
}
.pl-ch-num {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 2px 7px;
  font-variant-numeric: tabular-nums;
}
.pl-ch-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-soft);
}
.pl-ch-link {
  margin-left: auto;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-strong);
  white-space: nowrap;
}
.pl-item { position: relative; }
.pl-item .cl-quote { margin: 10px 0; }
.pl-badge {
  position: absolute;
  top: -4px;
  right: 44px;
  font-size: 10.5px;
  font-weight: 700;
  color: var(--accent-strong);
  background: var(--accent-bg);
  border-radius: 999px;
  padding: 2px 8px;
}
@media (max-width: 640px) {
  .pl-ch-link { display: none; }
  .pl-badge { right: 40px; }
}

/* 검색 결과에서 넘어왔을 때 본문에서 찾은 말 표시 (search.js) */
mark.search-hit {
  background: #fde68a;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}
mark.search-hit-first {
  box-shadow: 0 0 0 3px rgba(253, 230, 138, 0.55);
}

/* ----- 아래 두 블록은 components.md 어휘(cl-aside·figure.diagram)의 스타일. 템플릿 styles.css에 빠져 있어 기존 번들(zigbang)에서 이식 ----- */
/* 막히면·부차 안내 — 강조 박스보다 한 단계 낮은 조용한 주석 */
blockquote.cl-aside {
  border-left: 2px solid var(--border);
  background: transparent;
  border-radius: 0;
  padding: 4px 0 4px 16px;
  margin: 14px 0 20px;
  font-size: 14px;
}
blockquote.cl-aside p { color: var(--text-muted); }
blockquote.cl-aside strong { color: var(--text); }

/* ===== 시각자료 — 화면 캡처(figure.shot) · 개념도(figure.diagram) ===== */
figure.shot,
figure.diagram {
  margin: 26px 0;
  padding: 0;
}
figure.shot img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-elev);
  box-shadow: var(--shadow-sm);
}
figure.diagram > svg {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  padding: 18px 16px;
}
figure.shot figcaption,
figure.diagram figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.62;
  color: var(--text-muted);
  text-align: left;
}
figure.shot figcaption b,
figure.diagram figcaption b { color: var(--text-soft); font-weight: 700; }

/* 개념도 안에서 쓰는 공통 표현 — SVG마다 style을 새로 짓지 않는다 */
figure.diagram .d-label { font-family: inherit; font-size: 13px; font-weight: 700; fill: var(--text); }
figure.diagram .d-sub { font-family: inherit; font-size: 11.5px; font-weight: 500; fill: var(--text-muted); }
figure.diagram .d-box { fill: var(--bg-card); stroke: var(--border-strong); stroke-width: 1.5; }
figure.diagram .d-box-accent { fill: var(--accent-bg); stroke: var(--accent); stroke-width: 1.5; }
figure.diagram .d-box-soft { fill: var(--bg-soft); stroke: var(--border); stroke-width: 1.5; }
figure.diagram .d-line { stroke: var(--border-strong); stroke-width: 1.5; fill: none; }
figure.diagram .d-line-accent { stroke: var(--accent); stroke-width: 1.8; fill: none; }
figure.diagram .d-fill-accent { fill: var(--accent); }

@media (max-width: 780px) {
  figure.shot, figure.diagram { margin: 20px 0; }
  figure.diagram > svg { padding: 12px 10px; }
}

/* ===== 결과물 미디어 — 세로 숏폼 영상·나레이션 오디오 ===== */
figure.media { margin: 24px 0 32px; text-align: center; }
figure.media video { width: 100%; max-width: 360px; border-radius: 12px; border: 1px solid var(--border, #e5e5e5); background: #000; }
figure.media audio { width: 100%; max-width: 480px; }
figure.media figcaption { margin-top: 10px; font-size: 13px; color: var(--text-muted); text-align: left; }
figure.media figcaption b { color: var(--text-soft); font-weight: 700; }
