/* ============================ 레이아웃 ============================ */
.app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; position: relative; }
.app-body { display: flex; flex: 1; min-height: 0; align-items: stretch; }

/* 아이콘 버튼 (사이드바 접기 등) */
.icon-btn {
  flex-shrink: 0; width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-2); cursor: pointer;
  transition: background .12s ease, border-color .12s ease;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }

/* 접힘 시 다시 펼치는 플로팅 버튼 */
.sidebar-reopen {
  position: fixed; top: 12px; left: 12px; z-index: 50;
  width: 36px; height: 36px; display: none;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink-2); cursor: pointer;
}
.sidebar-reopen:hover { background: var(--surface-2); }
@media (min-width: 901px) { .app.sidebar-collapsed .sidebar-reopen { display: inline-flex; } }

/* ============================ 사이드바 ============================ */
.sidebar {
  width: 300px; flex-shrink: 0;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  padding: 20px 18px 40px;
  overflow-y: auto; overflow-x: hidden; height: 100%;
  transition: width .22s cubic-bezier(.4,0,.2,1), padding .22s cubic-bezier(.4,0,.2,1);
}
/* 데스크톱: 토글로 사이드바 접기 (ChatGPT 풍) */
@media (min-width: 901px) {
  .app.sidebar-collapsed .sidebar {
    width: 0; min-width: 0; padding-left: 0; padding-right: 0;
    border-right-color: transparent;
  }
}
/* 사이드바 제목 + (오른쪽) 접기 버튼 */
.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-bottom: 50px;
}
/* 로고(아이콘) + 타이틀: 왼쪽 정렬, 로고는 고정 오렌지 → 테마색 타이틀과 대비되어 돋보임 */
.side-brand { display: flex; flex-direction: row; align-items: center; gap: 11px; min-width: 0; }
.side-brand-logo {
  width: 0px; height: 42px; flex-shrink: 0;
  object-fit: contain; user-select: none;
  filter: drop-shadow(0 2px 5px rgba(217, 119, 6, .28));
}
.side-brand-text { display: flex; flex-direction: column; min-width: 0; }
.side-brand-name {
  font-family: var(--font-ui); font-weight: 800; font-size: 26px; color: var(--title);
  line-height: 1.1; letter-spacing: -0.02em;
}
.side-brand-sub {
  font-size: 11.5px; color: var(--ink); margin-top: 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight:600;
}
.sidebar-body { display: block; }
.side-group { margin-bottom: 20px; }
.side-divider { height: 1px; background: var(--line); margin: 20px 0; border: 0; }

/* ============================ 메인 ============================ */
.main { flex: 1; min-width: 0; overflow-y: auto; }
.main-inner { max-width: 1240px; margin: 0 auto; padding: 36px 48px 140px; }
/* 섹션 간격을 넓혀 구분 (구분선 없음) */
.section { margin-bottom: 56px; }
.section-head { display: flex; align-items: center; gap: 9px; margin-bottom: 16px; }
.section-head .sh-icon { width: 22px; height: 22px; flex-shrink: 0; color: var(--title); display: inline-flex; }
.section-head h2 {
  font-family: var(--font-ui); font-size: 18px; font-weight: 700;
  color: var(--title); margin: 0; letter-spacing: -0.01em; white-space: nowrap;
}
.section-head .sh-aux { margin-left: auto; font-size: 12px; color: var(--ink-3); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }

/* 반응형 */
@media (max-width: 900px) {
  .examples-grid { grid-template-columns: 1fr !important; }
  .parallel-row { grid-template-columns: 1fr !important; gap: 4px !important; }
  .main-inner { padding: 60px 20px 100px; }
  .sidebar-reopen { display: inline-flex; }
  /* 사이드바가 열리면 플로팅 펼치기 아이콘 숨김 (상단 중첩 방지) */
  .app.sidebar-open .sidebar-reopen { display: none; }
  .sidebar {
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 40;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: 0 0 40px rgba(0,0,0,.18);
  }
  .app.sidebar-open .sidebar { transform: translateX(0); }
  .scrim { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 35; }
  .app.sidebar-open .scrim { display: block; }
}
