/* 상단 막대 */
.gx-top {
  position: sticky;
  top: 0;
  z-index: 1030;
  height: var(--gx-top-h);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  /* 불투명: 뒤로 지나가는 카드 글자가 비치면 안 된다 */
  background: var(--gx-surface);
  border-bottom: 1px solid var(--gx-line);
}
.gx-brand {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  color: var(--gx-fg);
}
a.gx-brand:hover {
  color: var(--sm-brand);
}
.gx-brand.is-current {
  color: var(--gx-muted);
}
.gx-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-left: 12px;
  min-width: 40px;
  height: 38px;
  padding: 0 12px;
  color: var(--gx-muted);
  background: var(--gx-surface-2);
  border: 1px solid var(--gx-line);
  border-radius: 10px;
}
.gx-search-btn:hover {
  color: var(--gx-fg);
  border-color: var(--gx-accent);
}
.gx-search-btn kbd,
.gx-hero-search kbd,
.gx-try-bar kbd {
  font-size: 11px;
  padding: 1px 6px;
  color: var(--gx-muted);
  background: var(--gx-surface);
  border: 1px solid var(--gx-line);
  border-radius: 5px;
}
.gx-top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.gx-icon-btn,
.gx-text-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--gx-muted);
  border: 0;
  border-radius: 10px;
  min-height: 38px;
}
.gx-icon-btn {
  width: 40px;
  justify-content: center;
  font-size: 1.2rem;
}
.gx-icon-btn:hover,
.gx-text-btn:hover {
  background: var(--gx-surface-2);
  color: var(--gx-fg);
}

/* 레이아웃 */
.gx-shell {
  display: block;
}
.gx-main {
  min-width: 0;
  padding: 24px 16px 64px;
  max-width: 1040px;
  margin: 0 auto;
  outline: 0;
}
@media (min-width: 992px) {
  .gx-shell {
    display: grid;
    grid-template-columns: var(--gx-side-w) minmax(0, 1fr);
  }
  .gx-side {
    position: sticky;
    top: var(--gx-top-h);
    height: calc(100vh - var(--gx-top-h));
    overflow-y: auto;
    background: var(--gx-surface);
    border-right: 1px solid var(--gx-line);
  }
  .gx-main {
    padding: 32px 32px 80px;
    width: 100%;
  }
}
.offcanvas-lg {
  --bs-offcanvas-bg: var(--gx-surface);
  --bs-offcanvas-width: min(86vw, 340px);
}

/* 사이드바 트리 */
.gx-tree,
.offcanvas-body.gx-tree {
  display: block !important;
  padding: 12px 10px 32px;
}
.gx-home-link,
.gx-group summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: var(--gx-fg);
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  font-size: 0.95rem;
}
.gx-group summary::-webkit-details-marker {
  display: none;
}
.gx-home-link:hover,
.gx-group summary:hover {
  background: var(--gx-surface-2);
}
.gx-home-link.active {
  background: var(--gx-accent-soft);
  color: var(--gx-accent-ink);
}
.gx-group summary i:first-child {
  color: var(--gx-accent);
  width: 20px;
  text-align: center;
}
.gx-group-title {
  flex: 1;
  min-width: 0;
}
.gx-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gx-muted);
  background: var(--gx-surface-2);
  padding: 0 8px;
  border-radius: 999px;
}
.gx-group summary::after {
  content: '\F282';
  font-family: bootstrap-icons;
  font-size: 0.7rem;
  color: var(--gx-muted);
  transition: transform 0.15s;
}
.gx-group[open] summary::after {
  transform: rotate(180deg);
}
.gx-group ul {
  list-style: none;
  margin: 2px 0 8px 18px;
  padding: 0 0 0 10px;
  border-left: 1px solid var(--gx-line);
}
.gx-item {
  display: block;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--gx-muted);
  font-size: 0.9rem;
  line-height: 1.4;
}
.gx-item:hover {
  background: var(--gx-surface-2);
  color: var(--gx-fg);
}
.gx-item.active {
  background: var(--gx-accent-soft);
  color: var(--gx-accent-ink);
  font-weight: 600;
}
