/* 사용 설명서(/guide). 데스크톱을 넓게 쓴다(2026-10-01 사용자 결정) — 캡처와 화면 위치를 보여 줄 것이
   많아 단계 설명 옆에 캡처를 크게 나란히 둔다. 폰은 한 줄로 쌓기만 하고 따로 다듬지 않는다.
   왼쪽 목차 · 가운데 본문 · 오른쪽 이 장의 정보, 세 칸이다. 팔레트는 제품(guide.css · tokens.css)과 같다. */
:root {
  color-scheme: light;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --line: #e3e6ee;
  --line-strong: #cfd4e0;
  --ink: #111827;
  --text: #374151;
  --muted: #6b7280;
  --faint: #9aa1b0;
  --primary: #3446a8;
  --primary-soft: #eef1ff;
  --ok: #147a4a;
  --ok-soft: #ecfdf3;
  --warn: #8a5300;
  --warn-soft: #fff5e1;
  --role: #6b3fa0;
  --role-soft: #f4effb;
  --top-h: 56px;
  --nav-w: 280px;
  --rail-w: 300px;
  font-family: Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-padding-top: calc(var(--top-h) + 16px); }
/* 설명서는 tokens.css 를 읽지 않는다 — 제품 화면과 같은 줄바꿈 규칙(낱말 가운데서 끊지 않기)을 여기에도 둔다. */
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.7; font-size: 15.5px; word-break: keep-all; overflow-wrap: break-word; }
a { color: var(--primary); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 50; background: var(--primary); color: #fff; padding: 8px 14px; }
.skip-link:focus { left: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── 위 막대 ── */
.gb-top {
  position: sticky; top: 0; z-index: 30; height: var(--top-h);
  display: flex; align-items: center; gap: 18px; padding: 0 20px;
  background: var(--ink); color: #e5e7eb;
}
.gb-brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; white-space: nowrap; }
.gb-brand img { width: 28px; height: 28px; border-radius: 7px; background: #fff; }
.gb-brand strong { font-size: 15px; }
.gb-brand small { font-size: 12px; color: #aab1c2; margin-left: 6px; }
.gb-parts { display: flex; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.gb-parts a { color: #c9cedb; text-decoration: none; font-size: 14px; font-weight: 600; padding: 6px 11px; border-radius: 7px; white-space: nowrap; }
.gb-parts a:hover { background: rgba(255,255,255,.08); color: #fff; }
.gb-parts a[aria-current="true"] { background: #fff; color: var(--ink); }
.gb-top-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.gb-search { position: relative; width: 300px; }
.gb-search input {
  width: 100%; height: 34px; border-radius: 8px; border: 1px solid #3a4152; background: #1d2433; color: #fff;
  padding: 0 34px 0 12px; font: inherit; font-size: 13.5px;
}
.gb-search input::placeholder { color: #8d95a7; }
.gb-search kbd { position: absolute; right: 8px; top: 7px; font: 600 11px/18px ui-monospace, Menlo, monospace; color: #8d95a7; border: 1px solid #3a4152; border-radius: 4px; padding: 0 5px; }
.gb-search-results {
  position: absolute; top: 40px; right: 0; width: 520px; max-height: 70vh; overflow-y: auto;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px -18px rgba(17,24,39,.45); padding: 6px;
}
.gb-search-results a { display: block; padding: 9px 12px; border-radius: 8px; text-decoration: none; color: var(--text); }
.gb-search-results a:hover, .gb-search-results a[aria-selected="true"] { background: var(--primary-soft); }
.gb-search-results strong { display: block; color: var(--ink); font-size: 14px; }
.gb-search-results small { display: block; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.gb-search-results mark { background: #fde68a; color: inherit; border-radius: 2px; }
.gb-search-results p { margin: 10px 12px; color: var(--muted); font-size: 13px; }
.gb-role-picker { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #aab1c2; white-space: nowrap; }
.gb-role-picker select {
  height: 34px; border-radius: 8px; border: 1px solid #3a4152; background: #1d2433; color: #fff; font: inherit; font-size: 13.5px; padding: 0 8px;
}
.gb-top-links { display: flex; }
.gb-top-links a { color: #c9cedb; font-size: 13px; text-decoration: none; padding: 6px 8px; border-radius: 6px; white-space: nowrap; }
.gb-top-links a:hover { color: #fff; background: rgba(255,255,255,.08); }

/* ── 세 칸 ── */
.gb-layout { display: grid; grid-template-columns: var(--nav-w) minmax(0, 1fr) var(--rail-w); min-height: calc(100vh - var(--top-h)); }
.gb-layout.no-rail { grid-template-columns: var(--nav-w) minmax(0, 1fr); }

.gb-nav {
  position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto;
  background: var(--surface); border-right: 1px solid var(--line); padding: 14px 12px 40px;
}
.gb-nav-filter { width: 100%; height: 34px; border: 1px solid var(--line-strong); border-radius: 8px; padding: 0 10px; font: inherit; font-size: 13.5px; margin-bottom: 8px; }
.gb-nav-role { font-size: 12.5px; color: var(--muted); margin: 0 4px 6px; }
.gb-nav-role label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.gb-nav section { margin-top: 14px; }
.gb-nav h2 { font-size: 12px; letter-spacing: .03em; color: var(--muted); margin: 0 6px 4px; font-weight: 700; }
.gb-nav ol { list-style: none; margin: 0; padding: 0; }
.gb-nav li a { display: block; padding: 5px 10px; border-radius: 7px; color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.45; }
.gb-nav li a:hover { background: var(--bg); }
.gb-nav li a[aria-current="page"] { background: var(--ink); color: #fff; font-weight: 600; }
.gb-nav li.other-role a { color: var(--faint); }
body.gb-mine-only .gb-nav li.other-role { display: none; }
.gb-nav li[hidden] { display: none; }

.gb-main { padding: 28px 40px 80px; min-width: 0; }
.gb-article { max-width: 1240px; }
.gb-part { margin: 0 0 4px; font-size: 13px; font-weight: 700; color: var(--primary); }
.gb-article h1 { margin: 0 0 8px; color: var(--ink); font-size: 30px; line-height: 1.3; letter-spacing: -.01em; }
.gb-summary { margin: 0 0 16px; font-size: 16.5px; max-width: 78ch; }
.gb-role-note { display: none; margin: 0 0 18px; padding: 10px 14px; border-radius: 10px; background: var(--warn-soft); color: var(--warn); font-size: 14px; max-width: 78ch; }
body.gb-role-not-here .gb-role-note { display: block; }

.gb-body > h2 { margin: 44px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--ink); font-size: 22px; counter-reset: step; }
.gb-body > h2:first-child { margin-top: 8px; }
.gb-body > h3 { margin: 26px 0 8px; color: var(--ink); font-size: 17px; }
.gb-body > p, .gb-body > ul, .gb-body > ol, .gb-body > .callout, .gb-body > blockquote { max-width: 78ch; }
.gb-body p { margin: 0 0 12px; }
.gb-body ul, .gb-body ol { padding-left: 1.3em; margin: 0 0 14px; }
.gb-body li { margin: 3px 0; }
.gb-body strong { color: var(--ink); }
.gb-body code { font: 13px ui-monospace, Menlo, monospace; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.anchor { float: left; margin-left: -22px; width: 22px; color: var(--faint); text-decoration: none; opacity: 0; font-weight: 400; }
h2:hover .anchor, h3:hover .anchor { opacity: 1; }

.ui {
  display: inline-block; padding: 0 7px; border-radius: 6px; border: 1px solid #d5dbf5;
  background: var(--primary-soft); color: var(--primary); font-weight: 600; font-size: .93em; line-height: 1.55; white-space: nowrap;
}

/* 단계: 설명은 왼쪽, 캡처는 오른쪽에 크게 */
.step {
  counter-increment: step; position: relative;
  display: grid; grid-template-columns: minmax(320px, 5fr) minmax(0, 7fr); gap: 28px; align-items: start;
  margin: 16px 0; padding: 20px 22px 20px 64px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
}
.step.no-shot { grid-template-columns: minmax(0, 1fr); }
.step::before {
  content: counter(step); position: absolute; left: 20px; top: 20px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center;
}
.step-title { margin: 2px 0 8px; color: var(--ink); font-size: 17px; line-height: 1.45; }
.step-text p { margin: 0 0 10px; }
.step-text > :last-child { margin-bottom: 0; }
.step-shots { display: grid; gap: 14px; min-width: 0; }

.shot { margin: 0; display: grid; gap: 8px; justify-items: start; }
.shot img { max-width: 100%; height: auto; border: 1px solid var(--line-strong); border-radius: 10px; background: #fff; box-shadow: 0 8px 24px -16px rgba(17,24,39,.35); cursor: zoom-in; }
.shot figcaption { font-size: 13px; color: var(--muted); line-height: 1.5; }
.shot.missing { padding: 18px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.gb-body > .shot, .gb-body > .shot-row { margin: 14px 0 18px; }
.shot-row { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-start; }

.callout { margin: 12px 0 14px; padding: 12px 16px; border-radius: 10px; font-size: 14.5px; border: 1px solid transparent; }
.callout p:last-child { margin-bottom: 0; }
.callout-label { margin: 0 0 2px !important; font-size: 12.5px; font-weight: 800; letter-spacing: .03em; }
.callout-note { background: var(--primary-soft); border-color: #d9def8; }
.callout-note .callout-label { color: var(--primary); }
.callout-tip { background: var(--ok-soft); border-color: #cdeedb; }
.callout-tip .callout-label { color: var(--ok); }
.callout-warn { background: var(--warn-soft); border-color: #f4dfb4; }
.callout-warn .callout-label { color: var(--warn); }
.callout-role { background: var(--role-soft); border-color: #e3d6f3; }
.callout-role .callout-label { color: var(--role); }

/* 역할 전용 문단 — 고른 역할이 아니면 접는다 */
.only { margin: 14px 0; border: 1px solid #e3d6f3; border-radius: 12px; background: var(--surface); }
.only > summary { cursor: pointer; list-style: none; padding: 10px 16px; font-size: 13.5px; color: var(--role); font-weight: 700; display: flex; gap: 8px; align-items: center; }
.only > summary::-webkit-details-marker { display: none; }
.only > summary::before { content: "▾"; font-size: 11px; }
.only:not([open]) > summary::before { content: "▸"; }
.only > summary span { font-weight: 500; color: var(--muted); }
.only-body { padding: 0 16px 6px; }
.only-body > .step { margin-top: 0; }

.table-wrap { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.gb-body table { border-collapse: collapse; width: 100%; font-size: 14px; }
.gb-body th, .gb-body td { text-align: left; vertical-align: top; padding: 9px 14px; border-bottom: 1px solid var(--line); }
.gb-body th { background: #f2f4f8; color: var(--ink); font-size: 13px; white-space: nowrap; }
.gb-body tr:last-child td { border-bottom: 0; }

.gb-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 48px; max-width: 900px; }
.gb-pager a { display: block; padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-decoration: none; color: var(--ink); font-weight: 600; }
.gb-pager a:hover { border-color: var(--primary); }
.gb-pager .next { text-align: right; }
.gb-pager small { display: block; color: var(--muted); font-weight: 500; font-size: 12.5px; }

/* ── 오른쪽: 이 장의 정보 ── */
.gb-rail {
  position: sticky; top: var(--top-h); align-self: start; height: calc(100vh - var(--top-h)); overflow-y: auto;
  border-left: 1px solid var(--line); background: var(--surface); padding: 22px 20px 40px; font-size: 13.5px;
}
.gb-rail section + section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.gb-rail h2 { margin: 0 0 8px; font-size: 12px; letter-spacing: .03em; color: var(--muted); font-weight: 700; }
.gb-rail ol, .gb-rail ul { list-style: none; margin: 0; padding: 0; }
.gb-rail li { margin: 2px 0; }
.gb-rail .toc a { display: block; padding: 3px 8px; border-left: 2px solid var(--line); color: var(--text); text-decoration: none; line-height: 1.45; }
.gb-rail .toc a.active { border-left-color: var(--primary); color: var(--primary); font-weight: 700; }
.gb-where { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.gb-where i { color: var(--faint); font-style: normal; }
.gb-who li { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.gb-who b { font-weight: 600; color: var(--ink); }
.gb-who span { font-size: 12px; border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.gb-who .can { background: var(--ok-soft); color: var(--ok); }
.gb-who .read { background: var(--bg); color: var(--muted); }
.gb-who li.me b::after { content: " · 나"; color: var(--primary); }
.gb-related a { display: block; padding: 3px 0; text-decoration: none; }
.gb-updated { color: var(--muted); font-size: 12.5px; }

/* ── 첫 화면 ── */
.gb-index .gb-intro { max-width: 82ch; font-size: 16px; }
.gb-roles { list-style: none; margin: 14px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.gb-role { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.gb-role.me { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.gb-role h3 { margin: 0; color: var(--ink); font-size: 16px; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gb-role h3 button { font: inherit; font-size: 12.5px; color: var(--primary); background: none; border: 0; cursor: pointer; padding: 0; }
.gb-role > p { margin: 2px 0 10px; color: var(--muted); font-size: 13.5px; }
.gb-role ol { margin: 0; padding-left: 1.3em; font-size: 14px; }
.gb-role .menus { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.gb-index-parts { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; margin-top: 14px; }
.gb-index-part { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; }
.gb-index-part h3 { margin: 0 0 2px; color: var(--ink); font-size: 16px; }
.gb-index-part > p { margin: 0 0 8px; color: var(--muted); font-size: 13.5px; }
.gb-index-part ul { list-style: none; margin: 0; padding: 0; }
.gb-index-part li a { display: block; padding: 6px 0; border-top: 1px solid var(--line); text-decoration: none; }
.gb-index-part li a strong { color: var(--ink); font-size: 14.5px; }
.gb-index-part li a span { display: block; color: var(--muted); font-size: 13px; line-height: 1.5; }
.gb-index-part li.other-role { opacity: .45; }
.gb-index h2 { margin: 40px 0 6px; color: var(--ink); font-size: 21px; }
.gb-matrix th:first-child, .gb-matrix td:first-child { white-space: nowrap; font-weight: 700; color: var(--ink); }
.gb-matrix td { text-align: center; }
.gb-matrix td:first-child { text-align: left; }
.gb-matrix tr.me td { background: var(--primary-soft); }

/* 그림 크게 보기 */
.gb-lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(17,24,39,.82); display: grid; place-items: center; padding: 32px; cursor: zoom-out; }
.gb-lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; background: #fff; }

/* 1440 폭에서는 부 탭 · 검색 · 역할이 한 줄에 다 앉지 못해 글자가 꺾였다 — 검색을 줄이고 부 탭 간격을 좁힌다. */
@media (max-width: 1600px) {
  .gb-search { width: 220px; }
  .gb-parts a { padding: 6px 8px; }
  .gb-brand small { display: none; }
}

/* 좁은 화면: 따로 다듬지 않고 한 줄로 쌓기만 한다 */
@media (max-width: 1180px) {
  .gb-layout, .gb-layout.no-rail { grid-template-columns: var(--nav-w) minmax(0, 1fr); }
  .gb-rail { display: none; }
}
@media (max-width: 860px) {
  .gb-layout, .gb-layout.no-rail { grid-template-columns: minmax(0, 1fr); }
  .gb-nav { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .gb-main { padding: 20px 16px 60px; }
  .step { grid-template-columns: minmax(0, 1fr); padding-left: 56px; }
  .gb-search { width: 180px; }
  .gb-parts, .gb-top-links { display: none; }
  /* 장을 열면 본문이 먼저다 — 목차가 위에 있으면 폰에서 목차를 몇 화면 넘겨야 본문이 나왔다(11월 18일 점검). */
  .gb-main { order: 1; }
  .gb-nav { order: 2; border-bottom: 0; border-top: 1px solid var(--line); }
}
/* 폰 폭: 위 막대가 이름 · 찾기 · 내 역할을 한 줄에 못 담아 화면이 옆으로 212px 밀렸다(11월 18일 점검, 390 폭).
   이름 글자와 '내 역할' 글자를 빼고 찾기 칸이 남는 폭을 쓴다 — 로고와 역할 고르기는 그대로 둔다. */
@media (max-width: 600px) {
  .gb-top { gap: 10px; padding: 0 12px; }
  .gb-brand strong { display: none; }
  .gb-top-right { flex: 1; min-width: 0; gap: 8px; }
  .gb-search { flex: 1; width: auto; min-width: 0; }
  /* '/' 단축키 표시는 키보드가 없는 폰에서 찾기 칸 자리만 먹는다. */
  .gb-search kbd { display: none; }
  .gb-search input { padding-right: 12px; }
  .gb-search-results { position: fixed; top: calc(var(--top-h) + 4px); left: 8px; right: 8px; width: auto; }
  .gb-role-picker { font-size: 0; gap: 0; }
  .gb-role-picker select { max-width: 132px; }
  /* 긴 단추 이름('위 구역과 다른 구역이 맞습니다 — 새 구역을 만듭니다')이 한 줄로 버텨 화면 밖으로 39px 나갔다. */
  .ui { max-width: 100%; white-space: normal; }
}

@media print {
  .gb-top, .gb-nav, .gb-rail, .gb-pager, .skip-link { display: none !important; }
  .gb-layout { display: block; }
  .gb-main { padding: 0; }
  .step { break-inside: avoid; box-shadow: none; }
  .only { border: 0; }
}
