/* GitBook 호환 테마 — 본문 컴포넌트(hint·표·목록·인용구·hr·코드·그림·embed·탭·details·링크·제목 해시).
   구조는 공통(docpod.css)이고 여기는 값(토큰) override + 이 룩에만 필요한 소수 규칙이다. body.th-gitbook 아래로만 적용. */
body.th-gitbook {
  /* 블록 간격: GitBook 은 형제 블록 위 20px · 아래 0 */
  --gb-block-mt: 20px; --gb-block-mb: 0px;
  --gb-img-radius: 4px;
  --gb-caption-display: block; --gb-caption-fs: 12px; --gb-caption-lh: 16px; --gb-caption-color: #6A6E77; --gb-caption-align: center; --gb-caption-mt: 8px;
  --gb-hash-hover: 1; --gb-hash-color: #79859B;
  --gb-ext-arrow: inline-block;
  --gb-hint-radius: 6px; --gb-hint-pad: 0; --gb-hint-gap: 0; --gb-hint-fs: 14px; --gb-hint-lh: 20px;
  --gb-hint-info-bg: #F7F7F7;    --gb-hint-info-fg: #787878;
  --gb-hint-success-bg: #EEFCF0; --gb-hint-success-fg: #00C950;
  --gb-hint-warning-bg: #FFF5EC; --gb-hint-warning-fg: #FE9A00;
  --gb-hint-danger-bg: #FFF2EF;  --gb-hint-danger-fg: #FB2C36;
  --gb-embed-radius: 0px;
  --gb-tabs-radius: 8px;
  --gb-line: #E2E6EC; --gb-line-strong: #D5D9E0; --gb-tint-bg: #F6F7FA; --gb-tint: #6A6E77;
  --gb-ic-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath d='M313.5 239c9.4 9.4 9.4 24.6 0 33.9l-200 200c-9.4 9.4-24.6 9.4-33.9 0s-9.4-24.6 0-33.9l183-183-183-183c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l200 200z'/%3E%3C/svg%3E");
  --gb-ic-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464a256 256 0 1 0 0-512 256 256 0 1 0 0 512zM216 336c-13.3 0-24 10.7-24 24s10.7 24 24 24l80 0c13.3 0 24-10.7 24-24s-10.7-24-24-24l-8 0 0-88c0-13.3-10.7-24-24-24l-48 0c-13.3 0-24 10.7-24 24s10.7 24 24 24l24 0 0 64-24 0zm40-144a32 32 0 1 0 0-64 32 32 0 1 0 0 64z'/%3E%3C/svg%3E");
  --gb-ic-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-464a208 208 0 1 0 0 416 208 208 0 1 0 0-416zm0 336a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-256c18.2 0 32.7 15.5 31.4 33.7l-7.4 104c-.9 12.6-11.4 22.3-23.9 22.3-12.6 0-23-9.7-23.9-22.3l-7.4-104C223.3 143.5 237.8 128 256 128z'/%3E%3C/svg%3E");
  --gb-ic-success: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 512a256 256 0 1 1 0-512 256 256 0 1 1 0 512zm0-464a208 208 0 1 0 0 416 208 208 0 1 0 0-416zm70.7 121.9c7.8-10.7 22.8-13.1 33.5-5.3 10.7 7.8 13.1 22.8 5.3 33.5L243.4 366.1c-4.1 5.7-10.5 9.3-17.5 9.8-7 .5-13.9-2-18.8-6.9l-55.9-55.9c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l36 36 105.6-145.2z'/%3E%3C/svg%3E");
  --gb-ic-danger: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256.5 0c14.7 0 28.2 8.1 35.2 21l216 400c6.7 12.4 6.4 27.4-.8 39.5S486.6 480 472.5 480l-432 0c-14.1 0-27.1-7.4-34.3-19.5s-7.5-27.1-.8-39.5l216-400c7-12.9 20.5-21 35.2-21zM53.9 432L459.1 432 256.5 56.8 53.9 432zm202.6-40a32 32 0 1 1 0-64 32 32 0 1 1 0 64zm0-208c18.6 0 33 16.1 31 34.6l-7.1 64.1C279 294.8 268.7 304 256.5 304s-22.5-9.2-23.8-21.3l-7.1-64.1c-2-18.5 12.4-34.6 31-34.6z'/%3E%3C/svg%3E");
}

/* ---------- 제목 해시 아이콘(호버) ---------- */
body.th-gitbook .gb-content .gb-hash { transition: opacity .15s; }

/* ---------- 링크: 밑줄 두께 ---------- */
body.th-gitbook .gb-content a { text-decoration-thickness: max(0.07em, 1px); text-underline-offset: 2px; }

/* ---------- hint ---------- */
body.th-gitbook .gb-content .gb-hint { display: grid; grid-template-columns: auto 1fr; overflow: hidden; margin: 20px 0 0; }
body.th-gitbook .gb-content .gb-hint-icon { padding: 16px 0 16px 16px; margin: 0; font-size: 14px; }
body.th-gitbook .gb-content .gb-hint-icon:has(> svg) > svg { display: none; }
body.th-gitbook .gb-content .gb-hint-icon:has(> svg)::before {
  content: ''; display: block; width: 1.2em; height: 1.2em; margin-top: 1px; background: currentColor;
  -webkit-mask: var(--gb-ic-info) center / contain no-repeat; mask: var(--gb-ic-info) center / contain no-repeat;
}
body.th-gitbook .gb-content .gb-hint-warning .gb-hint-icon:has(> svg)::before { -webkit-mask-image: var(--gb-ic-warning); mask-image: var(--gb-ic-warning); }
body.th-gitbook .gb-content .gb-hint-success .gb-hint-icon:has(> svg)::before { -webkit-mask-image: var(--gb-ic-success); mask-image: var(--gb-ic-success); }
body.th-gitbook .gb-content .gb-hint-danger  .gb-hint-icon:has(> svg)::before { -webkit-mask-image: var(--gb-ic-danger);  mask-image: var(--gb-ic-danger); }
body.th-gitbook .gb-content .gb-hint-body { padding: 16px 16px 16px 12px; min-width: 0; color: #1D1D1D; }
body.th-gitbook .gb-content .gb-hint-body > * { margin: 0; }
body.th-gitbook .gb-content .gb-hint-body > * + * { margin-top: 12px; }

/* ---------- 목록: 마커 열 24px + 간격 4px, 항목 사이 8px ---------- */
body.th-gitbook .gb-content ul, body.th-gitbook .gb-content ol { list-style: none; padding-left: 0; margin: 20px 0 0; }
body.th-gitbook .gb-content li { position: relative; padding-left: 28px; margin: 8px 0 0; line-height: 24px; }
body.th-gitbook .gb-content li:first-child { margin-top: 0; }
body.th-gitbook .gb-content ul > li::before {
  content: '•'; position: absolute; left: 0; top: 0; width: 24px; height: 24px; text-align: center;
  font: 24px/24px Arial, sans-serif; color: var(--gb-tint);
}
body.th-gitbook .gb-content ol { counter-reset: gbol; }
body.th-gitbook .gb-content ol > li { counter-increment: gbol; }
body.th-gitbook .gb-content ol > li::before {
  content: counter(gbol) '.'; position: absolute; left: 0; top: 0; width: 24px; height: 24px; text-align: center; color: var(--gb-tint);
}
body.th-gitbook .gb-content li > p { margin: 0; line-height: 24px; }
body.th-gitbook .gb-content li > * + * { margin-top: 8px; }
body.th-gitbook .gb-content li > ul, body.th-gitbook .gb-content li > ol { margin-top: 8px; }

/* ---------- 인용구 / hr / 인라인 코드 ---------- */
body.th-gitbook .gb-content blockquote { margin: 20px 0 0; padding: 12px 0 12px 24px; border-left: 2px solid var(--gb-line-strong); color: var(--gb-tint); }
body.th-gitbook .gb-content blockquote > * { margin: 0; }
body.th-gitbook .gb-content blockquote > * + * { margin-top: 16px; }
body.th-gitbook .gb-content hr { border: 0; border-top: 1px solid var(--gb-line); margin: 20px 0 0; }
body.th-gitbook .gb-content :not(pre) > code {
  font-family: "IBM Plex Mono", ui-monospace, monospace; font-size: 14px; line-height: 20px; color: #1C1D1F;
  background: var(--gb-tint-bg); border: 0; box-shadow: inset 0 0 0 1px var(--gb-line-strong); border-radius: 4px; padding: 1px 6px;
}

/* ---------- 그림: 가운데 정렬 블록(캡션은 이미지 폭 안에서 가운데) ---------- */
body.th-gitbook .gb-content figure, body.th-gitbook .gb-content .gb-figure-md {
  display: flex; flex-direction: column; align-items: center; margin: 20px 0 0; text-align: center;
}
body.th-gitbook .gb-content figure img { border: 0; display: block; }
body.th-gitbook .gb-content .gb-figure-md img { display: block; max-width: 100%; height: auto; }
body.th-gitbook .gb-content .gb-figure-md figcaption, body.th-gitbook .gb-content figure figcaption { align-self: stretch; }

/* ---------- 표 ---------- */
body.th-gitbook .gb-content .gb-table-wrap { display: block; overflow-x: auto; margin: 20px 0 0; }
body.th-gitbook .gb-content .gb-table-wrap > table {
  display: table; width: 100%; margin: 0; border-collapse: separate; border-spacing: 0; table-layout: auto;
  font-size: 14px; line-height: 20px; color: #1C1D1F;
}
body.th-gitbook .gb-content table thead th {
  background: var(--gb-tint-bg); font-weight: 500; text-align: left; padding: 8px 12px; min-width: 0;
  border: 0; border-top: 1px solid var(--gb-line); border-bottom: 1px solid var(--gb-line); vertical-align: middle;
}
body.th-gitbook .gb-content table thead th:first-child { border-left: 1px solid var(--gb-line); border-radius: 8px 0 0 8px; }
body.th-gitbook .gb-content table thead th:last-child { border-right: 1px solid var(--gb-line); border-radius: 0 8px 8px 0; }
body.th-gitbook .gb-content table tbody::before { content: ''; display: table-row; height: 4px; }
body.th-gitbook .gb-content table td {
  padding: 8px 12px; min-width: 0; border: 0; border-bottom: 1px solid var(--gb-line); border-right: 1px solid var(--gb-line);
  vertical-align: middle; font-weight: 400;
}
body.th-gitbook .gb-content table td:last-child { border-right: 0; }
body.th-gitbook .gb-content table tbody tr:last-child td { border-bottom: 0; }
body.th-gitbook .gb-content table td > p, body.th-gitbook .gb-content table th > p { margin: 0; line-height: 21px; }

/* ---------- details(펼치기): 왼쪽 쉐브론(열리면 90° 회전) ---------- */
body.th-gitbook .gb-content details { margin: 20px 0 0; border: 1px solid var(--gb-line); border-radius: 8px; background: #fff; }
body.th-gitbook .gb-content details > summary {
  position: relative; cursor: pointer; list-style: none; padding: 16px 40px 16px 16px; color: #1C1D1F; font-weight: 400;
  font-size: 16px; line-height: 26px; user-select: none; display: block;
}
body.th-gitbook .gb-content details > summary::-webkit-details-marker { display: none; }
body.th-gitbook .gb-content details > summary::before {
  content: ''; display: inline-block; width: 12px; height: 12px; margin: 0 12px 0 0; vertical-align: baseline; background: currentColor;
  -webkit-mask: var(--gb-ic-chevron) center / contain no-repeat; mask: var(--gb-ic-chevron) center / contain no-repeat; transition: transform .15s;
}
body.th-gitbook .gb-content details[open] > summary::before { transform: rotate(90deg); }
body.th-gitbook .gb-content details > :not(summary) { margin-left: 40px; margin-right: 40px; }
body.th-gitbook .gb-content details > :last-child { margin-bottom: 20px; }

/* ---------- 탭: 1px 안쪽 링 · 비활성 탭은 옅은 회색 띠 ---------- */
body.th-gitbook .gb-content .gb-tabs { position: relative; border: 0; border-radius: 8px; margin: 20px 0 0; overflow: hidden; }
body.th-gitbook .gb-content .gb-tabs::after { content: ''; position: absolute; inset: 0; border-radius: 8px; box-shadow: inset 0 0 0 1px var(--gb-line); pointer-events: none; }
body.th-gitbook .gb-content .gb-tab-heads { display: flex; gap: 0; padding: 0; border-bottom: 0; background: rgba(28, 29, 31, .04); }
body.th-gitbook .gb-content .gb-tab-btn { padding: 10px 16px; font-size: 14px; font-weight: 500; line-height: 20px; color: var(--gb-tint); background: transparent; border: 0; }
body.th-gitbook .gb-content .gb-tab-btn.active { color: #1C1D1F; background: #fff; }
body.th-gitbook .gb-content .gb-tab-panel { padding: 0 16px 16px; }

/* ---------- embed ---------- */
body.th-gitbook .gb-content .gb-embed-video { margin: 20px 0 0; background: transparent; }

/* ================= 검색: 헤더 검색창 아래 팝오버(데스크톱) · 전체 화면(모바일) ================= */
body.th-gitbook {
  --gb-search-count-display: block; --gb-search-clear-display: flex; --gb-search-foot-display: flex;
  --gb-search-crumb-display: flex; --gb-search-ic-display: flex;
  --gb-search-sec-color: rgba(106,110,119,.8); --gb-search-sec-fs: 12px; --gb-search-sec-pt: 12px;
  --gb-search-hl-bg: #F1F8FF; --gb-search-hl-pad: 2px; --gb-search-hl-mg: -2px;
}
body.th-gitbook .gb-search-backdrop { background: transparent; }
body.th-gitbook .gb-search-panel {
  position: absolute; left: var(--gb-sb-x, 24px); top: var(--gb-sb-y, 12px); width: max(var(--gb-sb-w, 436px), 512px);
  margin: 0; background: transparent; border-radius: 0; box-shadow: none; overflow: visible;
}
body.th-gitbook .gb-search-inputrow {
  width: var(--gb-sb-w, 436px); height: var(--gb-sb-h, 40px); padding: 0 12px; gap: 8px; box-sizing: border-box;
  background: #fff; border: 1px solid #B6CDF6; border-radius: 12px;
  box-shadow: 0 0 0 2px #B6CDF6, 0 10px 15px -3px rgba(28,29,31,.1), 0 4px 6px -4px rgba(28,29,31,.1);
}
body.th-gitbook .gb-search-inputrow .gb-search-icon { width: 16px; height: 16px; color: #6A6E77; }
body.th-gitbook .gb-search-modal[data-has-q] .gb-search-inputrow > .gb-search-icon { display: none; }
body.th-gitbook .gb-search-inputrow input { font-size: 14px; line-height: 21px; color: #1C1D1F; background: transparent; min-width: 0; }
body.th-gitbook .gb-search-inputrow input::placeholder { color: #6A6E77; }
body.th-gitbook .gb-search-close { display: none; }
body.th-gitbook .gb-search-clear { color: #6A6E77; order: -1; }
body.th-gitbook .gb-search-count { color: #6A6E77; }
body.th-gitbook .gb-search-drop {
  display: flex; flex-direction: column; margin-top: 8px; width: 100%; box-sizing: border-box; height: 512px;
  max-height: calc(100vh - var(--gb-sb-y, 12px) - var(--gb-sb-h, 40px) - 24px);
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 0 0 1px #D5D9E0, 0 20px 25px -5px rgba(28,29,31,.16), 0 8px 10px -6px rgba(28,29,31,.16);
}
body.th-gitbook .gb-search-modal[data-state="empty"] .gb-search-drop { display: none; }
body.th-gitbook .gb-search-results { flex: 1; max-height: none; padding: 12px; }
body.th-gitbook .gb-search-empty { padding: 40px 16px; font-size: 14px; color: #6A6E77; }
body.th-gitbook .gb-search-hitrow {
  display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 12px; border-radius: 6px; color: #6A6E77;
}
body.th-gitbook .gb-search-hitrow + .gb-search-hitrow { margin-top: 0; }
body.th-gitbook .gb-search-hitrow:hover { background: transparent; }
body.th-gitbook .gb-search-hitrow.sel { background: #F1F8FF; color: #181D26; }
body.th-gitbook .gb-search-hit-title { font-size: 16px; line-height: 22px; font-weight: 600; color: #1C1D1F; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.th-gitbook .gb-search-hit-snip { font-size: 14px; line-height: 20px; color: #6A6E77; margin-top: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.th-gitbook .gb-search-hit-crumb svg { width: 8px; height: 8px; }
body.th-gitbook .gb-search-enter {
  display: flex; flex: none; width: 28px; height: 28px; align-items: center; justify-content: center; border-radius: 8px;
  color: #fff; background: var(--primary); visibility: hidden;
}
body.th-gitbook .gb-search-hitrow.sel .gb-search-enter { visibility: visible; }
body.th-gitbook .gb-search-foot { padding: 6px 16px; min-height: 46px; background: #F9FAFB; border-top: 1px solid #E2E6EC; font-size: 14px; line-height: 20px; color: #6A6E77; }
body.th-gitbook .gb-search-filter-btn { color: #6A6E77; }
body.th-gitbook .gb-search-filter-btn svg { color: #6A6E77; }
body.th-gitbook .gb-search-hint kbd { border-color: #E2E6EC; color: #6A6E77; }

@media (max-width: 768px) {
  body.th-gitbook { --gb-search-x-display: flex; }
  body.th-gitbook .gb-search-modal { background: rgba(255,255,255,.88); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
  body.th-gitbook .gb-search-panel { position: absolute; inset: 0; width: auto; display: flex; flex-direction: column; padding-top: 12px; }
  body.th-gitbook .gb-search-inputrow {
    width: auto; height: 40px; margin: 0 12px 0 12px; flex: none;
  }
  body.th-gitbook .gb-search-xbtn { position: absolute; top: 12px; left: 12px; width: 40px; height: 40px; border: 1px solid #E2E6EC; border-radius: 12px; background: #fff; }
  body.th-gitbook .gb-search-inputrow { margin-left: 64px; }
  body.th-gitbook .gb-search-drop { flex: 1; width: auto; max-height: none; height: auto; margin: 8px 0 0; border-radius: 0; box-shadow: none; background: transparent; }
  body.th-gitbook .gb-search-results { padding: 12px; }
  body.th-gitbook .gb-search-foot { padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
  body.th-gitbook .gb-search-hints { display: none; }
}

/* 추천 패널 행 — 결과 행과 같은 높이·톤 */
body.th-gitbook .gb-search-sug-row .gb-search-hit-title { font-size: 16px; line-height: 22px; font-weight: 600; }
body.th-gitbook .gb-search-recent-row .gb-search-hit-title { font-weight: 500; }
body.th-gitbook .gb-search-x { color: #79859B; }
body.th-gitbook .gb-search-hitrow.sel .gb-search-x:hover { background: rgba(121,133,155,.16); }
