/* ==========================================================================
   guide.css — 스타일 가이드 문서 화면 (iot_guide.html 전용, 앱에는 넣지 않는다)
   ---------------------------------------------------------------------------
   떠 있는 헤더 · 왼쪽 목록 · 한 번에 한 페이지 · 미리보기+코드 상자 · 권장/지양 · 명세 표 · 검색
   색은 화면과 같은 토큰(--bg · --panel · --fg · --brand …)만 쓴다 → html.theme-dark 이면 함께 바뀐다
   미리보기 무대(.doc__stage.scr)는 화면 루트(.scr)와 같은 토큰 · 초기화를 받고, 제자리에 놓이도록 위치만 바꾼다
   ========================================================================== */
.gd {
  --gd-line: var(--line);
  --gd-fill: var(--panel-2);
  --gd-fill-2: var(--panel-3);
  --gd-do: #15803d;
  --gd-dont: #b42323;
  --gd-header-top: 12px;
  --gd-header-h: 60px;
  --gd-side-w: 232px;
  --gd-main-w: 1000px;
  --gd-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  margin: 0;
  min-height: 100vh;
  background: var(--bg-2);
  color: var(--fg);
  font-family: var(--f-body);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
.theme-dark .gd { --gd-do: #4ade80; --gd-dont: #f87171; background: var(--bg); }
.gd *, .gd *::before, .gd *::after { box-sizing: border-box; }
:where(.gd) a { color: inherit; }
:where(.gd) :where(button) { font: inherit; color: inherit; border: 0; background: none; padding: 0; cursor: pointer; }
:where(.gd) :where(h1, h2, h3, p, ul, ol, dl, dd) { margin: 0; }
.gd .ic { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.gd .ic--sm { width: 1em; height: 1em; }
.gd ::selection { background: var(--brand-weak); }
.gd kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--gd-line); background: var(--gd-fill); font: 600 11px/1 var(--f-body); color: var(--fg-3); }

/* ---------- 헤더 ---------- */
.gd-header { position: fixed; top: var(--gd-header-top); left: 0; right: 0; z-index: 60; display: flex; justify-content: center; padding: 0 16px; pointer-events: none; }
.gd-header__bar {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: 100%; max-width: 940px; height: var(--gd-header-h); padding: 0 10px 0 16px;
  border-radius: 999px; border: 1px solid var(--gd-line);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-1), 0 10px 30px -10px rgba(16, 24, 32, 0.18);
}
.gd-logo { display: inline-flex; align-items: center; gap: 9px; flex: none; text-decoration: none; }
.gd-logo .logo-mark { font-size: 14px; }
.gd-logo__name { font-size: 16px; font-weight: 800; letter-spacing: -0.03em; white-space: nowrap; }
.gd-logo__name span { margin-left: 4px; font-weight: 600; color: var(--fg-3); }
.gd-header__nav { display: flex; gap: 2px; margin-left: 14px; }
.gd-header__nav a { display: inline-flex; align-items: center; gap: 3px; padding: 8px 12px; border-radius: 999px; font-size: 14px; font-weight: 600; text-decoration: none; color: var(--fg-2); }
.gd-header__nav a:hover { color: var(--fg); }
.gd-header__nav a[aria-current="true"] { background: var(--gd-fill); color: var(--fg); }
.gd-search-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 8px 0 12px; border-radius: 999px; border: 1px solid var(--gd-line); background: var(--gd-fill); font-size: 13.5px; color: var(--fg-3); min-width: 170px; }
.gd-search-btn kbd { margin-left: auto; }
.gd-theme { margin-left: 4px; font-size: 13px; }
.gd-theme > button[aria-checked="true"] { background: var(--panel); color: var(--fg); box-shadow: var(--shadow-1); }
.gd-icon-btn { display: inline-grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 999px; color: var(--fg); text-decoration: none; cursor: pointer; }
.gd-icon-btn:hover { background: var(--gd-fill); }
.gd-icon-btn[aria-disabled="true"] { opacity: 0.3; pointer-events: none; }
.gd-header__menu { display: none; margin-left: -6px; }

/* ---------- 바깥 배치 : 왼쪽 목록 + 본문 ---------- */
.gd-layout { display: flex; gap: 48px; max-width: calc(var(--gd-side-w) + var(--gd-main-w) + 48px + 96px); margin: 0 auto; padding: 0 48px; }
.gd-side { position: sticky; top: 0; flex: none; width: var(--gd-side-w); height: 100vh; padding: calc(var(--gd-header-top) + var(--gd-header-h) + 28px) 0 32px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.gd-side__group { margin: 22px 0 6px; padding: 0 8px; font-size: 12.5px; font-weight: 700; color: var(--fg-3); }
.gd-side__group:first-child { margin-top: 0; }
.gd-side__link { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 8px; font-size: 14.5px; font-weight: 500; text-decoration: none; color: var(--fg-2); }
.gd-side__link:hover { background: var(--gd-fill); color: var(--fg); }
.gd-side__link[aria-current="page"] { background: var(--brand-weak); color: var(--brand-text); font-weight: 700; }
.gd-scrim { position: fixed; inset: 0; z-index: 70; background: var(--scrim); }
.gd-scrim[hidden] { display: none; }
.gd-main { flex: 1; min-width: 0; max-width: var(--gd-main-w); padding: calc(var(--gd-header-top) + var(--gd-header-h) + 28px) 0 80px; }

/* ---------- 페이지 ---------- */
.page[hidden] { display: none; }
.page { animation: gd-page-in 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes gd-page-in { from { opacity: 0; transform: translateY(6px); } }
.page__top { display: flex; align-items: center; justify-content: space-between; min-height: 36px; }
.page__crumb { font-size: 13px; font-weight: 600; color: var(--fg-3); }
.page__pager { display: flex; gap: 2px; }
.page__title { margin: 6px 0 18px; font-size: 30px; font-weight: 800; letter-spacing: -0.035em; line-height: 1.25; }
.page .page__title code { margin-left: 6px; font-size: 15px; font-weight: 600; vertical-align: 5px; letter-spacing: 0; color: var(--brand-text); background: var(--brand-weak); }
.page__lead { display: flex; gap: 10px; align-items: flex-start; padding: 15px 18px; border-radius: 12px; border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); background: var(--brand-weak); font-size: 14.5px; line-height: 1.6; }
.page__lead > .ic { margin-top: 1px; color: var(--brand-text); }
.page__h2 { display: flex; align-items: center; gap: 8px; margin: 48px 0 14px; padding-bottom: 11px; border-bottom: 1px solid var(--gd-line); font-size: 20px; font-weight: 800; letter-spacing: -0.025em; scroll-margin-top: 100px; }
.page__h3 { margin: 22px 0 8px; font-size: 15.5px; font-weight: 750; }
.page__p { margin: -2px 0 14px; font-size: 14.5px; line-height: 1.7; color: var(--fg-2); }
.page__p b, .doc__section b { color: var(--fg); }
.doc__section { margin: 0 0 18px; font-size: 14px; line-height: 1.6; color: var(--fg-2); }
.doc__row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.page code { font-family: var(--gd-mono); font-size: 0.86em; padding: 1px 6px; border-radius: 6px; background: var(--gd-fill); color: var(--fg); }
.page__lead code { background: color-mix(in srgb, var(--brand) 14%, transparent); }

/* ---------- 미리보기 + 코드 상자 ---------- */
.example { margin: 0 0 18px; border: 1px solid var(--gd-line); border-radius: 14px; overflow: hidden; background: var(--panel); }
/* 무대 = 화면 루트(.scr) 하나 — 토큰 · 아이콘 · 버튼 초기화가 화면과 같다 */
.doc__stage.scr {
  position: relative; inset: auto; z-index: 0;
  min-height: 170px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px;
  padding: 36px 28px;
  background: var(--bg);
  overflow: hidden;
}
.doc__stage--tall.scr { min-height: 320px; }
.doc__stage--col.scr { flex-direction: column; align-items: stretch; }
.doc__stage--col.scr > * { width: 100%; max-width: 460px; margin-inline: auto; }
.doc__stage--wide.scr > * { max-width: 760px; }
.doc__stage--start.scr { align-items: flex-start; justify-content: flex-start; }
.doc__stage--3d.scr { padding: 0; min-height: 300px; display: block; }
.example > .code { border-top: 1px solid var(--gd-line); }
.example--code > .code { border-top: 0; }
.doc__cap { padding: 9px 14px; border-top: 1px solid var(--gd-line); font-size: 12.5px; color: var(--fg-3); }

/* ---------- 코드 ---------- */
.code { position: relative; background: var(--panel); color: var(--fg); font-family: var(--gd-mono); font-size: 12.5px; line-height: 1.7; }
.code__bar { display: flex; align-items: center; justify-content: space-between; height: 40px; padding: 0 6px 0 16px; border-bottom: 1px solid var(--gd-line); }
.code__lang { font-family: var(--f-body); font-size: 12px; font-weight: 600; color: var(--fg-3); text-transform: lowercase; }
.code__copy { display: inline-flex; align-items: center; gap: 4px; height: 28px; padding: 0 8px; border-radius: 8px; font-family: var(--f-body); font-size: 12px; font-weight: 650; color: var(--fg-2); }
.code__copy:hover { background: var(--gd-fill); color: var(--fg); }
.code pre { margin: 0; padding: 12px 18px 14px 0; overflow: auto; white-space: pre; tab-size: 2; }
.code .ln { display: block; padding-left: 16px; }
.code .ln::before { content: attr(data-n); display: inline-block; width: 2.2em; margin-right: 1em; text-align: right; color: var(--fg-3); opacity: 0.6; user-select: none; }
.code[data-collapsed] pre { max-height: calc(1.7em * 10 + 12px); overflow: hidden; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.code__more { display: flex; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 36px; border-top: 1px solid var(--gd-line); font-family: var(--f-body); font-size: 13px; font-weight: 600; color: var(--fg-2); }
.code__more:hover { background: var(--gd-fill); color: var(--fg); }
.tok-t { color: #116329; } .tok-a { color: #b4490b; } .tok-s { color: #0a3069; } .tok-k { color: #cf222e; } .tok-c { color: #6e7781; }
.theme-dark .tok-t { color: #7ee787; } .theme-dark .tok-a { color: #ffa657; } .theme-dark .tok-s { color: #a5d6ff; } .theme-dark .tok-k { color: #ff7b72; } .theme-dark .tok-c { color: #8b949e; }

/* ---------- 권장 · 지양 ---------- */
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
.dd { display: flex; flex-direction: column; gap: 10px; }
.dd .doc__stage.scr { min-height: 130px; padding: 24px 18px; border: 1px solid var(--gd-line); border-radius: 14px; }
.dd__note { flex: 1; display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; border: 1px solid; font-size: 13.5px; line-height: 1.55; }
.dd__note b { display: block; margin-bottom: 2px; font-weight: 750; }
.dd--do .dd__note { background: color-mix(in srgb, var(--gd-do) 9%, transparent); border-color: color-mix(in srgb, var(--gd-do) 30%, transparent); color: var(--gd-do); }
.dd--dont .dd__note { background: color-mix(in srgb, var(--gd-dont) 9%, transparent); border-color: color-mix(in srgb, var(--gd-dont) 30%, transparent); color: var(--gd-dont); }
.dd__note p { color: var(--fg-2); }
.dd__note code { background: color-mix(in srgb, currentColor 10%, transparent); }

/* ---------- 표 (명세 · 토큰) ---------- */
.props { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--gd-line); border-radius: 12px; overflow: hidden; font-size: 13.5px; background: var(--panel); }
.props th, .props td { padding: 10px 14px; border-bottom: 1px solid var(--gd-line); text-align: left; vertical-align: top; }
.props tr:last-child td { border-bottom: 0; }
.props th { background: var(--gd-fill); font-size: 12px; font-weight: 700; color: var(--fg-3); }
.props td { color: var(--fg-2); }
.props td:first-child { font-family: var(--gd-mono); font-size: 12.5px; font-weight: 650; color: var(--fg); white-space: nowrap; }
.props td.props__plain { font-family: inherit; font-size: 13.5px; }

/* ---------- 기초 견본 ---------- */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 18px; }
.swatch { display: flex; flex-direction: column; overflow: hidden; border: 1px solid var(--gd-line); border-radius: 12px; background: var(--panel); }
.swatch i { display: block; height: 62px; border-bottom: 1px solid var(--gd-line); }
.swatch b { padding: 8px 10px 0; font-family: var(--gd-mono); font-size: 12px; font-weight: 700; }
.swatch span { padding: 2px 10px 9px; font-size: 12px; color: var(--fg-3); }
.swatch [data-hex] { font-family: var(--gd-mono); font-size: 11px; }
.status-row { display: grid; grid-template-columns: 150px 120px 1fr; gap: 14px; align-items: center; padding: 12px 4px; border-bottom: 1px solid var(--gd-line); font-size: 13.5px; color: var(--fg-2); }
.status-row:last-child { border-bottom: 0; }
.status-row code { justify-self: start; }
.type-row { display: grid; grid-template-columns: 140px 1fr 170px; gap: 14px; align-items: baseline; padding: 14px 0; border-bottom: 1px solid var(--gd-line); }
.type-row__name { font-size: 13px; font-weight: 700; color: var(--fg-2); }
.type-row__meta { font-family: var(--gd-mono); font-size: 11.5px; color: var(--fg-3); }
.scale-row { display: flex; align-items: center; gap: 14px; padding: 7px 0; font-size: 13.5px; color: var(--fg-2); }
.scale-row__name { width: 110px; font-family: var(--gd-mono); font-weight: 650; color: var(--fg); }
.scale-row__bar { height: 14px; border-radius: 3px; background: var(--brand-weak); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 40%, transparent); }
.scale-row__val { color: var(--fg-3); font-family: var(--gd-mono); font-size: 12.5px; }
.radius-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.radius-box { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 8px 12px; border: 1px solid var(--gd-line); border-radius: 12px; background: var(--panel); font-size: 12px; color: var(--fg-3); text-align: center; }
.radius-box i { width: 72px; height: 52px; background: var(--brand-weak); border: 2px solid var(--brand); }
.radius-box b { font-family: var(--gd-mono); font-size: 12px; color: var(--fg); }
.surface-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.surface-box { min-height: 100px; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; padding: 12px 14px; border-radius: 1em; font-size: 12.5px; font-weight: 700; font-family: var(--gd-mono); }
.surface-box span { font-family: var(--f-body); font-weight: 500; font-size: 12px; color: var(--fg-3); }
.icon-tools { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; margin-bottom: 12px; padding: 10px 12px; border: 1px solid var(--gd-line); border-radius: 12px; background: var(--panel); font-size: 13px; }
.icon-tools input[type="search"] { flex: 1; min-width: 180px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line-2); background: var(--panel-2); color: var(--fg); font: inherit; }
.icon-tools label { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; color: var(--fg-2); }
.icon-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 8px; }
.icon-cell { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 16px 4px 10px; border-radius: 12px; border: 1px solid var(--gd-line); background: var(--panel); font-size: 11px; color: var(--fg-3); font-family: var(--gd-mono); overflow: hidden; }
.icon-cell .ic { width: var(--icon-size, 24px); height: var(--icon-size, 24px); color: var(--fg); stroke-width: var(--icon-stroke, 1.9); }
.icon-cell:hover { border-color: var(--brand); color: var(--brand-text); }
.icon-cell[data-copied] { border-color: var(--st-ok); color: var(--st-ok); }
.icon-cell[hidden] { display: none; }
.motion-track { position: relative; width: 260px; height: 40px; border-radius: 10px; background: var(--panel-2); border: 1px dashed var(--line-2); }
.motion-track i { position: absolute; top: 8px; left: 8px; width: 24px; height: 24px; border-radius: 7px; background: var(--brand); }
.motion-track[data-run] i { animation: gd-move 900ms cubic-bezier(0.2, 0.8, 0.2, 1) infinite alternate; }
@keyframes gd-move { to { transform: translateX(216px); } }
.step-list { counter-reset: st; display: flex; flex-direction: column; gap: 12px; list-style: none; margin: 0 0 18px; padding: 0; }
.step-list > li { counter-increment: st; position: relative; padding-left: 36px; font-size: 14px; color: var(--fg-2); line-height: 1.6; }
.step-list > li::before { content: counter(st); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-size: 12px; font-weight: 800; }
.step-list > li b { color: var(--fg); }

/* ---------- 패턴 : 미니 화면 (실제 화면 루트를 작게) ---------- */
/* <div class="mini" data-fit="1920" data-fit-h="1080"><div class="dc-artboard mini__in" data-screen="…"><div class="scr app" data-shell="…">
   안쪽(.mini__in)을 실제 기기 폭으로 그려 화면 크기 규칙(@container screen)이 그대로 걸리고, guide.js 가 칸에 맞게 줄인다 */
.mini { position: relative; overflow: hidden; border-radius: 14px; border: 1px solid var(--gd-line); background: var(--bg); }
.mini__in { position: relative; container: screen / inline-size; }
.mini--phone { width: 330px; margin: 0 auto; border-radius: 30px; border: 7px solid var(--panel-3); }
.mini-pair { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.mini-cap { margin-top: 8px; font-size: 12.5px; color: var(--fg-3); text-align: center; }
.bp-row { display: grid; grid-template-columns: 150px 140px 1fr; gap: 14px; padding: 11px 0; border-bottom: 1px solid var(--gd-line); font-size: 13.5px; color: var(--fg-2); }
.bp-row:last-child { border-bottom: 0; }
.bp-row b { color: var(--fg); }
.bp-row code { justify-self: start; }

/* ---------- 이전 · 다음 ---------- */
.page__foot { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 60px; }
.page__foot a { display: flex; flex-direction: column; gap: 2px; padding: 15px 18px; border: 1px solid var(--gd-line); border-radius: 14px; background: var(--panel); text-decoration: none; }
.page__foot a:hover { border-color: var(--brand); }
.page__foot a[data-dir="next"] { grid-column: 2; text-align: right; }
.page__foot small { font-size: 12px; color: var(--fg-3); }
.page__foot b { font-size: 15.5px; font-weight: 700; }
.page__foot span { font-size: 12.5px; color: var(--fg-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }

/* ---------- 첫 화면 ---------- */
.home-hero { padding: 24px 0 4px; }
.home-hero__eyebrow { font-size: 13px; font-weight: 650; color: var(--fg-3); }
.home-hero__title { margin: 10px 0 14px; font-size: 40px; font-weight: 800; letter-spacing: -0.045em; line-height: 1.22; }
.home-hero__title em { font-style: normal; color: var(--brand-text); }
.home-hero__desc { max-width: 40em; font-size: 16px; line-height: 1.7; color: var(--fg-2); }
.home-hero__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.home-hero__actions .btn { text-decoration: none; font-size: 14.5px; }
.home-hero__stats { display: flex; flex-wrap: wrap; gap: 12px 40px; margin: 32px 0 0; padding: 18px 22px; border-radius: 16px; background: var(--panel); border: 1px solid var(--gd-line); }
.home-hero__stats dt { font-size: 12.5px; font-weight: 600; color: var(--fg-3); }
.home-hero__stats dd { margin: 2px 0 0; font-size: 24px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.home__group { margin: 52px 0 6px; font-size: 21px; font-weight: 800; letter-spacing: -0.025em; scroll-margin-top: 100px; }
.home__group-desc { margin-bottom: 16px; font-size: 14.5px; color: var(--fg-2); }
.home-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.home-card { display: flex; flex-direction: column; border: 1px solid var(--gd-line); border-radius: 14px; overflow: hidden; text-decoration: none; background: var(--panel); transition: border-color 160ms, box-shadow 160ms, transform 160ms; }
.home-card:hover { border-color: color-mix(in srgb, var(--brand) 50%, transparent); box-shadow: var(--shadow-1), 0 10px 26px -12px rgba(16, 24, 32, 0.25); transform: translateY(-2px); }
.home-card__thumb { position: relative; height: 124px; display: grid; place-items: center; overflow: hidden; background: var(--bg); border-bottom: 1px solid var(--gd-line); }
.home-card__body { padding: 13px 15px 15px; }
.home-card__title { font-size: 15px; font-weight: 700; }
.home-card__desc { margin-top: 3px; font-size: 12.5px; line-height: 1.5; color: var(--fg-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
/* 썸네일 : 페이지 첫 미리보기를 복제해 줄인다 (guide.js) */
.thumb-stage.doc__stage.scr { position: absolute; left: 50%; top: 50%; width: 200%; height: 200%; min-height: 0; padding: 0; background: none; transform: translate(-50%, -50%) scale(0.5); pointer-events: none; }
.thumb-swatch { display: flex; gap: 6px; }
.thumb-swatch i { width: 24px; height: 24px; border-radius: 7px; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08); }
.thumb-type { font-size: 40px; font-weight: 800; letter-spacing: -0.04em; }
.thumb-type span { margin-left: 6px; font-weight: 500; color: var(--fg-3); }
.thumb-icons { display: flex; gap: 16px; }
.thumb-icons .ic { width: 26px; height: 26px; }
.thumb-text { font-family: var(--gd-mono); font-size: 13px; color: var(--fg-2); }
.thumb-copy { font-size: 15px; font-weight: 700; line-height: 1.4; text-align: center; }

/* ---------- 바닥글 ---------- */
.gd-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; max-width: calc(var(--gd-side-w) + var(--gd-main-w) + 48px + 96px); margin: 0 auto; padding: 32px 48px 44px; border-top: 1px solid var(--gd-line); font-size: 13px; color: var(--fg-3); }
.gd-footer code { font-family: var(--gd-mono); font-size: 12px; }

/* ---------- 검색 ---------- */
.gd-search { position: fixed; inset: 0; z-index: 90; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; background: var(--scrim); animation: gd-fade 150ms ease-out; }
.gd-search[hidden] { display: none; }
@keyframes gd-fade { from { opacity: 0; } }
.gd-search__panel { width: 100%; max-width: 580px; border-radius: 18px; background: var(--panel); border: 1px solid var(--gd-line); box-shadow: var(--shadow-2); overflow: hidden; }
.gd-search__field { display: flex; align-items: center; gap: 10px; height: 54px; padding: 0 16px; border-bottom: 1px solid var(--gd-line); color: var(--fg-3); }
.gd-search__field input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font: inherit; font-size: 16px; color: var(--fg); }
.gd-search__list { max-height: min(52vh, 440px); overflow-y: auto; padding: 8px; }
.gd-search__item { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.gd-search__item b { font-size: 14.5px; font-weight: 650; }
.gd-search__item small { grid-row: span 2; align-self: center; font-size: 12px; color: var(--fg-3); }
.gd-search__item span { font-size: 12.5px; color: var(--fg-3); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gd-search__item[data-active] { background: var(--gd-fill); }
.gd-search__empty { padding: 28px; text-align: center; font-size: 14px; color: var(--fg-3); }
.gd-search__hint { display: flex; align-items: center; gap: 4px; padding: 10px 16px; border-top: 1px solid var(--gd-line); font-size: 12px; color: var(--fg-3); }

/* ---------- 좁은 화면 ---------- */
@media (max-width: 1100px) {
  .gd-layout { padding: 0 24px; gap: 32px; }
  .gd-side { width: 200px; }
}
@media (max-width: 900px) {
  .gd { --gd-header-top: 8px; --gd-header-h: 54px; }
  .gd-header { padding: 0 8px; }
  .gd-header__bar { padding: 0 6px 0 12px; }
  .gd-header__menu { display: inline-grid; }
  .gd-header__nav, .gd-logo__name span { display: none; }
  .gd-search-btn { min-width: 0; width: 36px; padding: 0; justify-content: center; border: 0; background: none; color: var(--fg); }
  .gd-search-btn span, .gd-search-btn kbd { display: none; }
  .gd-layout { display: block; padding: 0 16px; }
  .gd-side { position: fixed; top: 0; left: 0; z-index: 80; width: 280px; height: 100%; padding: 20px 16px 32px; background: var(--panel); box-shadow: var(--shadow-2); transform: translateX(-104%); transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
  .gd-side[data-open] { transform: none; }
  .gd-main { padding-top: calc(var(--gd-header-top) + var(--gd-header-h) + 20px); }
  .page__title { font-size: 25px; }
  .home-hero__title { font-size: 29px; }
  .dd-grid { grid-template-columns: 1fr; }
  .doc__stage.scr { padding: 28px 14px; }
  .type-row, .status-row, .bp-row { grid-template-columns: 1fr; gap: 4px; }
  .page__foot { grid-template-columns: 1fr; }
  .page__foot a[data-dir="next"] { grid-column: auto; }
  .mini-pair { grid-template-columns: 1fr; }
  .gd-footer { padding: 26px 16px 34px; }
}
