:root {
  --ink: #16181d;
  --body: #2d3138;
  --gray: #5b616e;
  --mute: #8b919e;
  --line: #e8e9ec;
  --line-soft: #f1f2f4;
  --bg: #ffffff;
  --bg-soft: #f7f8f9;
  --brand: #664bf4;
  --brand-soft: #f4f2ff;
  --ok-bg: #eef8f2;
  --ok-ink: #1f7a45;
  --warn-bg: #fff8e8;
  --warn-line: #f0dbab;
  --warn-ink: #7a5a12;
  --bad-bg: #fdf1f0;
  --bad-ink: #a13b34;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  --gnb-h: 64px;
  --side-w: 268px;
  --toc-w: 220px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    'Pretendard Variable',
    Pretendard,
    -apple-system,
    BlinkMacSystemFont,
    'Apple SD Gothic Neo',
    'Segoe UI',
    Roboto,
    sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 16px;
  line-height: 1.75;
  word-break: keep-all;
}

a {
  color: var(--brand);
}

/* 메일 링크는 본문 색 그대로 두고 밑줄로만 구분 */
a[href^='mailto:'] {
  color: var(--ink);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------- 상단 GNB ---------------- */
.gnb {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--gnb-h);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
}

.gnb-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  height: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 28px;
}

/* 좌측: 햄버거 + 로고 / 우측: 같은 폭의 빈 칸 → 가운데 메뉴가 화면 정중앙에 온다 */
.gnb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.gnb-right {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-self: end;
}

.btn-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.btn-home:hover {
  opacity: 0.82;
}

.btn-home svg {
  width: 13px;
  height: 13px;
  opacity: 0.75;
}

.gnb-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.gnb-logo:hover {
  opacity: 0.7;
}

.gnb-logo img {
  display: block;
  width: auto;
  height: 22px;
}

.gnb-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.gnb-menu a {
  padding: 7px 13px;
  border-radius: 9px;
  color: var(--gray);
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
}

.gnb-menu a:hover {
  background: var(--bg-soft);
  color: var(--ink);
}
.gnb-menu a.active {
  background: var(--bg-soft);
  color: var(--ink);
}

.gnb-burger {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.gnb-burger:hover {
  background: var(--bg-soft);
}

.gnb-burger span {
  position: relative;
  display: block;
  width: 15px;
  height: 1.6px;
  margin: 0 auto;
  border-radius: 2px;
  background: var(--ink);
}

.gnb-burger span::before,
.gnb-burger span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 15px;
  height: 1.6px;
  border-radius: 2px;
  background: var(--ink);
}

.gnb-burger span::before {
  top: -5px;
}
.gnb-burger span::after {
  top: 5px;
}

/* ---------------- 3단 레이아웃 ---------------- */
.shell {
  display: grid;
  grid-template-columns: var(--side-w) minmax(0, 1fr) var(--toc-w);
  column-gap: 0;
  max-width: 1520px;
  margin: 0 auto;
  padding: 0 28px;
}

/* 좌측 사이드바 */
.side {
  position: sticky;
  top: var(--gnb-h);
  align-self: start;
  max-height: calc(100vh - var(--gnb-h));
  overflow-y: auto;
  padding: 32px 8px 60px 0;
}

/* 그룹 라벨 — 항목보다 뒤로 물러나도록 얇고 옅게 */
.nav-sec .nav-group {
  margin: 0 0 8px;
  padding: 0 12px;
  color: #a7adb7;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--gray);
  font-size: 14.5px;
  font-weight: 500;
  text-decoration: none;
}

.nav-ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  overflow: hidden;
}

.nav-ico img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nav-item:hover {
  background: var(--bg-soft);
  color: var(--ink);
}

.nav-item.active {
  background: var(--bg-soft);
  color: var(--ink);
  font-weight: 700;
}

/* 사이드바에 고정되는 연결 값 카드 */
.nav-info {
  margin: 26px 12px 0;
  padding: 16px 16px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.nav-info-t {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}
.nav-info dl {
  margin: 0;
}
.nav-info dt {
  margin-bottom: 3px;
  color: #7d848f;
  font-size: 11.5px;
  font-weight: 500;
}

.nav-info dd {
  margin: 0 0 16px;
  color: var(--gray);
  font-size: 12px;
  line-height: 1.75;
  word-break: break-all;
}

.nav-info dd:last-of-type {
  margin-bottom: 0;
}

.nav-info code {
  padding: 1px 5px;
  border: none;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--ink);
  font-size: 11.5px;
}

.nav-info em {
  font-style: normal;
  font-size: 11.5px;
  color: var(--mute);
}

.nav-info-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.nav-info-row:last-child {
  margin-bottom: 0;
}

/* 값 자체가 복사 버튼 */
.copy-mini {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 0 5px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: var(--bg-soft);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.45;
  letter-spacing: -0.03em;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease;
}

.copy-mini span {
  min-width: 0;
  word-break: break-all;
}
.copy-mini svg {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  color: var(--mute);
}
.copy-mini:hover {
  border-color: #d8dade;
  background: #f0f1f3;
}
.copy-mini:hover svg {
  color: var(--ink);
}
.copy-mini.done svg {
  color: var(--ok-ink);
}
