/* ==========================================================================
   VibeStack — ssjsite 디자인 시스템 (애플 다크) 적용
   색·타이포·표면·여백·컴포넌트만 차용. 스크롤/등장 애니메이션은 쓰지 않는다.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 디자인 토큰
   -------------------------------------------------------------------------- */
:root {
  /* 배경 — 순수 블랙 + iOS 시스템 그레이 계단 */
  --paper: #000000;
  --surf: #1c1c1e;
  --tint: #2c2c2e;
  --tint2: #3a3a3c;
  --hair: #38383a;
  --hair2: #48484a;

  /* 텍스트 — 흰색에서 회색으로 4단계 */
  --ink: #f5f5f7;
  --body: #d1d1d6;
  --mut: #98989d;
  --faint: #6e6e73;

  /* 액센트 — iOS 블루, 포인트 골드 */
  --accent: #0a84ff;
  --accent-hi: #409cff;
  --gold: #ffd60a;

  /* 시맨틱·트랙 칩 — 투명 틴트 배경 + 채도 낮춘 글자 */
  --fg-blue: #64b5ff;    --bg-blue: rgba(10, 132, 255, 0.16);
  --fg-green: #4cd964;   --bg-green: rgba(48, 209, 88, 0.14);
  --fg-orange: #ffb340;  --bg-orange: rgba(255, 159, 10, 0.15);
  --fg-purple: #da8fff;  --bg-purple: rgba(191, 90, 242, 0.16);
  --fg-teal: #5ed5ea;    --bg-teal: rgba(64, 200, 224, 0.15);
  --fg-pink: #ff6482;    --bg-pink: rgba(255, 55, 95, 0.15);
  --fg-gold: #ffd60a;    --bg-gold: rgba(255, 214, 10, 0.12);
  --fg-red: #ff6961;     --bg-red: rgba(255, 69, 58, 0.16);

  /* 표면 보조 */
  --header-bg: rgba(0, 0, 0, 0.6);
  --header-line: rgba(255, 255, 255, 0.08);
  --overlay-bg: rgba(0, 0, 0, 0.72);
  --code-bg: #000000;
  --track-bg: rgba(255, 255, 255, 0.08);
  --option-bg: rgba(28, 28, 30, 0.85);
  --emphasis-bg: linear-gradient(165deg, #0b1830 0%, #070d1a 45%, #050508 100%);
  --emphasis-ring: rgba(255, 255, 255, 0.1);
  --emphasis-glow: rgba(10, 132, 255, 0.16);
  --focus-ring: rgba(10, 132, 255, 0.28);
  --card-shadow: none;
  --shadow-lift: 0 8px 32px rgb(0 0 0 / 0.6);

  --font-sans: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  /* 영문·숫자는 고정폭, 고정폭 폰트에 없는 한글은 Pretendard 로 표시 */
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, "D2Coding", "Pretendard Variable", Pretendard, monospace;
  --header-h: 56px;
  /* 헤더 위 CDSA 배너 높이 — 본문 여백은 헤더 + 배너로 계산한다 */
  --banner-h: 34px;
  --banner-bg: linear-gradient(90deg, #a87b12 0%, #e9be4a 30%, #ffd96a 50%, #e9be4a 70%, #a87b12 100%);
  --banner-bg-hi: linear-gradient(90deg, #b88a1c 0%, #f2c957 30%, #ffe285 50%, #f2c957 70%, #b88a1c 100%);
  --banner-ink: #1a1405;

  /* 인쇄 전용(용어표 인쇄) — 테마와 관계없이 흰 종이에 찍는다 */
  --print-paper: #ffffff;
  --print-ink: #000000;
  --print-line: #999999;
  --print-head: #eeeeee;

  /* app.js 인라인 스타일이 쓰는 기존 변수 이름 → 새 토큰 연결 */
  --text-main: var(--ink);
  --text-muted: var(--mut);
  --text-dim: var(--faint);
  --accent-cyan: var(--accent-hi);
  --primary: var(--accent);
  --bg-surface: var(--tint);
  --border-glass: var(--hair);
  --radius-md: 14px;

  color-scheme: dark;
}

/* 라이트 모드 — 같은 체계를 iOS 라이트 시스템 컬러로 매핑 */
[data-theme="light"] {
  --paper: #f5f5f7;
  --surf: #ffffff;
  --tint: #f2f2f7;
  --tint2: #e5e5ea;
  --hair: #d2d2d7;
  --hair2: #c7c7cc;

  --ink: #1d1d1f;
  --body: #424245;
  --mut: #6e6e73;
  --faint: #86868b;

  --accent: #0071e3;
  --accent-hi: #0066cc;

  --fg-blue: #0066cc;
  --fg-green: #1f7a35;
  --fg-orange: #b25000;
  --fg-purple: #8944ab;
  --fg-teal: #0e6f80;
  --fg-pink: #c4133f;
  --fg-gold: #8a6100;
  --fg-red: #d70015;

  --header-bg: rgba(245, 245, 247, 0.72);
  --header-line: rgba(0, 0, 0, 0.08);
  --overlay-bg: rgba(0, 0, 0, 0.4);
  --code-bg: #f5f5f7;
  --track-bg: rgba(0, 0, 0, 0.07);
  --option-bg: #ffffff;
  --emphasis-bg: linear-gradient(165deg, #e8f1ff 0%, #f3f6fb 45%, #ffffff 100%);
  --emphasis-ring: rgba(0, 0, 0, 0.08);
  --emphasis-glow: rgba(0, 113, 227, 0.1);
  --focus-ring: rgba(0, 113, 227, 0.22);
  --card-shadow: 0 1px 3px rgb(0 0 0 / 0.06), 0 4px 16px rgb(0 0 0 / 0.04);
  --shadow-lift: 0 8px 28px rgb(0 0 0 / 0.12);

  color-scheme: light;
}

/* --------------------------------------------------------------------------
   2. 기본 타이포 (Pretendard 특성 살리기)
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-padding-top: calc(var(--header-h) + var(--banner-h) + 16px);
  /* Windows 기본 15px 스크롤바 대신 배경에 녹아드는 얇은 스크롤바 */
  scrollbar-width: thin;
  scrollbar-color: var(--tint2) var(--paper);
}

body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  background: var(--paper);
  color: var(--body);
  word-break: keep-all;          /* 한글 단어 단위 줄바꿈 */
  overflow-wrap: break-word;
  letter-spacing: -0.01em;
  font-feature-settings: "ss05";
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.028em;
}

h1 { font-weight: 650; }

a { color: inherit; text-decoration: none; }

button, input, select, textarea {
  font: inherit;
  letter-spacing: inherit;
  color: inherit;
}

button:not(:disabled) { cursor: pointer; }

strong { color: var(--ink); font-weight: 600; }

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

::selection { background: rgba(10, 132, 255, 0.35); }

.tabular { font-variant-numeric: tabular-nums; }

/* 라인 아이콘 (app.js ICONS) — 글자 기준선에 맞춰 정렬 */
.icon {
  display: inline-block;
  flex-shrink: 0;
  vertical-align: -0.15em;
}

.scroll-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--tint2) transparent;
}

.scroll-thin::-webkit-scrollbar { width: 6px; height: 6px; }
.scroll-thin::-webkit-scrollbar-thumb { background: var(--tint2); border-radius: 999px; }
.scroll-thin::-webkit-scrollbar-track { background: transparent; }

/* --------------------------------------------------------------------------
   3. 레이아웃 & 섹션 리듬
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-narrow { max-width: 840px; }

.section { padding: 96px 0; }

.section-head { margin-bottom: 40px; }

.section-head-center {
  max-width: 640px;
  margin: 0 auto 40px;
  text-align: center;
}

.section-head-split {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.section-head-split > div { max-width: 640px; }

.overline-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
  margin-bottom: 6px;
}

.h-judge {
  font-size: clamp(28px, 4.6vw, 38px);
  font-weight: 600;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.section-desc {
  margin-top: 12px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--mut);
}

/* --------------------------------------------------------------------------
   4. 프로스티드 고정 헤더
   -------------------------------------------------------------------------- */
.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(150%) blur(20px);
  -webkit-backdrop-filter: saturate(150%) blur(20px);
  border-bottom: 1px solid var(--header-line);
}

/* CDSA 홈페이지 배너 — 헤더 맨 위에 붙어 스크롤해도 보인다 */
.cdsa-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: var(--banner-h);
  padding: 0 16px;
  background: var(--banner-bg);
  color: var(--banner-ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  transition: background-color 0.15s;
}
.cdsa-banner:hover { background: var(--banner-bg-hi); }
.cdsa-banner .cb-tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(26, 20, 5, 0.88);
  color: #ffd96a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.cdsa-banner .cb-url { font-weight: 700; }
.cdsa-banner .cb-go { display: inline-flex; align-items: center; gap: 2px; font-weight: 500; opacity: 0.8; }
.cdsa-banner .cb-short { display: none; }

.header-inner {
  max-width: 1120px;
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.brand-title {
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* 서비스 선택 — 바이브코딩 스택 / AI 교육과정 (두 페이지 공통) */
.site-switch {
  display: inline-flex;
  flex-shrink: 0;
  padding: 3px;
  border-radius: 999px;
  background: var(--tint);
}

.site-switch a {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  color: var(--mut);
  transition: background-color 0.15s, color 0.15s;
}

.site-switch a:hover { color: var(--ink); }

/* 항목이 많아 모든 폭에서 짧은 이름만 보이고, 긴 이름은 링크 title로 보여 준다 */
.site-switch .ss-full { display: none; }

.site-switch a[aria-current="page"] {
  background: var(--ink);
  color: var(--paper);
}

.header-nav {
  display: flex;
  gap: 22px;
  font-size: 14px;
  color: var(--mut);
}

.header-nav a:hover { color: var(--ink); }

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-actions .btn:not(.btn-icon) {
  padding: 7px 14px;
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   5. 버튼
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-sm { padding: 7px 14px; font-size: 13.5px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }
.btn-block { width: 100%; }

.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hi); }

.btn-secondary { background: var(--tint); color: var(--ink); }
.btn-secondary:hover { background: var(--tint2); }

.btn-ghost { background: transparent; color: var(--mut); }
.btn-ghost:hover { background: var(--tint); color: var(--ink); }

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 15px;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-hi);
  font-size: 15px;
  font-weight: 500;
}

.btn-link:hover { text-decoration: underline; }

.btn-link-dim { color: var(--faint); font-size: 13.5px; }

/* --------------------------------------------------------------------------
   6. 히어로
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-h) + var(--banner-h) + 104px) 20px 88px;
  text-align: center;
}

.hero-glow {
  position: absolute;
  top: -180px;
  left: 50%;
  width: 760px;
  height: 460px;
  margin-left: -380px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--emphasis-glow), transparent);
  pointer-events: none;
}

.hero-content {
  position: relative;
  max-width: 820px;
  margin: 0 auto;
}

.hero-title {
  margin-top: 10px;
  font-size: clamp(34px, 6.2vw, 58px);
  line-height: 1.14;
  letter-spacing: -0.035em;
}

.hero-title-accent { color: var(--accent-hi); }

.hero-sub {
  max-width: 640px;
  margin: 24px auto 0;
  font-size: clamp(16px, 2vw, 18.5px);
  line-height: 1.7;
  color: var(--mut);
}

.hero-cta {
  margin-top: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-stats {
  max-width: 620px;
  margin: 64px auto 0;
  padding-top: 28px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--hair);
}

.stat {
  display: flex;
  flex-direction: column-reverse;   /* 숫자를 라벨 위에 표시 */
  align-items: center;
  gap: 4px;
}

.stat + .stat { border-left: 1px solid var(--hair); }

.stat-value {
  font-size: clamp(30px, 4.4vw, 42px);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.stat-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--mut);
}

/* --------------------------------------------------------------------------
   7. 스택 진단 위저드 (강조 패널)
   -------------------------------------------------------------------------- */
#wizard, #fullCatalogSection, #gallery, #comboDeckBox, #questionBox {
  scroll-margin-top: calc(var(--header-h) + var(--banner-h) + 16px);
}

.wizard-card {
  position: relative;
  overflow: hidden;
  padding: 36px 40px 28px;
  border-radius: 28px;
  background: var(--emphasis-bg);
  box-shadow: inset 0 0 0 1px var(--emphasis-ring), var(--card-shadow);
}

.wizard-card::before {
  content: '';
  position: absolute;
  top: -120px;
  left: 50%;
  width: 560px;
  height: 240px;
  margin-left: -280px;
  border-radius: 50%;
  background: radial-gradient(closest-side, var(--emphasis-glow), transparent);
  pointer-events: none;
}

.wizard-card > * { position: relative; }

.wizard-progress-bar-container {
  height: 4px;
  margin-bottom: 24px;
  border-radius: 999px;
  background: var(--track-bg);
  overflow: hidden;
}

.wizard-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.wizard-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.wizard-step-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-blue);
  color: var(--fg-blue);
  font-size: 12.5px;
  font-weight: 600;
}

.wizard-question {
  font-size: clamp(21px, 3vw, 27px);
  line-height: 1.4;
  letter-spacing: -0.025em;
}

.wizard-desc {
  margin-top: 10px;
  font-size: 15.5px;
  color: var(--mut);
}

.wizard-options-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-top: 28px;
}

.wizard-options-grid.yn-grid { grid-template-columns: 1fr 1fr; }

.wizard-card-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  padding: 20px 22px;
  border: 1px solid var(--hair);
  border-radius: 18px;
  background: var(--option-bg);
  color: var(--ink);
  text-align: left;
  transition: border-color 0.15s, background-color 0.15s;
}

.wizard-card-btn:hover { border-color: var(--accent); }
.wizard-card-btn.type-yes:hover { border-color: var(--fg-green); }
.wizard-card-btn.type-no:hover { border-color: var(--fg-blue); }

.yn-badge-chip {
  display: inline-flex;
  margin-bottom: 4px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.chip-yes { background: var(--bg-green); color: var(--fg-green); }
.chip-no { background: var(--bg-blue); color: var(--fg-blue); }

.btn-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16.5px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.btn-subtitle {
  font-size: 14px;
  line-height: 1.55;
  color: var(--mut);
}

.wizard-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--emphasis-ring);
}

.wizard-footer-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--faint);
}

.tree-history {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--faint);
}

.history-item { color: var(--mut); }
.history-sep { color: var(--faint); }

/* 일반 선택지 오른쪽 화살표 */
.option-chevron {
  display: inline-flex;
  color: var(--faint);
}

.wizard-card-btn:hover .option-chevron { color: var(--accent-hi); }
.history-item.current { color: var(--accent-hi); font-weight: 600; }

/* --------------------------------------------------------------------------
   8. 추천 조합 덱
   -------------------------------------------------------------------------- */
.combo-deck-container { padding-top: 8px; }

.deck-header {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.deck-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--bg-gold);
  color: var(--fg-gold);
  font-size: 12.5px;
  font-weight: 600;
}

.deck-title {
  margin-top: 14px;
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.3;
}

.deck-desc {
  margin-top: 12px;
  font-size: 15.5px;
  color: var(--mut);
}

.combo-cards-showcase {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.deck-footer {
  margin-top: 40px;
  text-align: center;
}

/* 진단 결과 */
.wizard-top-actions { display: flex; gap: 4px; }
.wizard-top-actions .btn:disabled { opacity: 0.4; cursor: default; }
.wizard-options-grid.wizard-options-2 { grid-template-columns: 1fr 1fr; }
.wizard-card-btn.is-picked { border-color: var(--accent); }
.history-btn {
  padding: 2px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.history-btn:hover { border-color: var(--accent); color: var(--ink); }

.diag-axes,
.diag-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.diag-axis,
.diag-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  border-radius: 18px;
  background: var(--surf);
  box-shadow: var(--card-shadow);
}

.diag-panel { margin-bottom: 16px; }
.diag-grid .diag-panel { margin-bottom: 0; }
.diag-k { font-size: 12.5px; font-weight: 600; color: var(--faint); }
.diag-v { font-size: 22px; letter-spacing: -0.02em; color: var(--ink); }
.diag-d { font-size: 14.5px; color: var(--mut); }

.diag-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  padding: 0;
  list-style: none;
}

.diag-step {
  display: inline-flex;
  gap: 6px;
  padding: 4px 10px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--faint);
}

.diag-step span { font-weight: 600; }
.diag-step.on { border-color: transparent; background: var(--bg-blue); color: var(--fg-blue); }
.diag-step.top { background: var(--accent); color: #fff; }

.diag-note {
  margin-top: 6px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--tint);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--body);
}

.diag-note b { color: var(--fg-orange); font-weight: 600; }
.diag-note ul { margin: 6px 0 0; padding-left: 18px; }

.diag-h { font-size: 16px; letter-spacing: -0.01em; color: var(--ink); }

.diag-stack { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 0; }
.diag-stack div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; }
.diag-stack dt { font-size: 13px; font-weight: 600; color: var(--fg-gold); }
.diag-stack dd { margin: 0; font-size: 14px; line-height: 1.6; color: var(--body); }

.diag-list { margin: 4px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.6; color: var(--body); }
.diag-list li + li { margin-top: 6px; }

.diag-prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.diag-note-label { margin-top: 6px; font-size: 13px; color: var(--mut); }

.diag-prompt-text {
  margin: 6px 0 0;
  padding: 16px 18px;
  max-height: 360px;
  overflow: auto;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--code-bg);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  color: var(--body);
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.diag-mods {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.diag-mod {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.15s;
}

.diag-mod:hover { border-color: var(--accent); }
.diag-mod-id { font-size: 12px; font-weight: 600; color: var(--faint); }
.diag-mod-t { font-size: 14px; line-height: 1.45; }

.diag-sc-head { margin-top: 40px; margin-bottom: 24px; }

@media (max-width: 640px) {
  .diag-axes,
  .diag-grid,
  .wizard-options-grid.wizard-options-2 { grid-template-columns: 1fr; }
  .diag-axis,
  .diag-panel { padding: 18px; }
  .diag-stack div { grid-template-columns: 1fr; gap: 2px; }
}

/* --------------------------------------------------------------------------
   9. 카드 (조합 · 도감 · 공유 갤러리) — .panel 스타일
   -------------------------------------------------------------------------- */
.project-combo-card,
.catalog-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: var(--surf);
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: border-color 0.15s;
}

.project-combo-card:hover,
.catalog-card:hover { border-color: var(--hair2); }

.card-top-row,
.card-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.card-badge-pill {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-blue);
  color: var(--fg-blue);
  font-size: 12.5px;
  font-weight: 600;
}

.card-track-name {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--faint);
  white-space: nowrap;
}

.card-project-title,
.card-title {
  font-size: 19px;
  line-height: 1.38;
  letter-spacing: -0.022em;
}

.card-project-summary,
.card-desc {
  margin-top: 8px;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--mut);
}

.card-ideas-summary {
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background: var(--tint);
}

.idea-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.idea-tag-chip {
  flex-shrink: 0;
  display: inline-flex;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.tag-chip-gov { background: var(--bg-gold); color: var(--fg-gold); }
.tag-chip-biz { background: var(--bg-blue); color: var(--fg-blue); }

.idea-text-mini {
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--body);
}

.card-tech-pills,
.card-tech-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tech-row { margin-top: 16px; }

.tech-pill-mini,
.tech-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--body);
  font-size: 12.5px;
  font-weight: 500;
}

.card-action-bar,
.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--hair);
}

.card-action-bar { margin-top: 16px; }

.btn-open-detail {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 14px;
  font-weight: 500;
  color: var(--accent-hi);
  white-space: nowrap;
}

/* 트랙 배지 — 시맨틱 칩 */
.track-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--body);
  font-size: 12.5px;
  font-weight: 600;
}

.track-badge.gov { background: var(--bg-purple); color: var(--fg-purple); }
.track-badge.office { background: var(--bg-green); color: var(--fg-green); }
.track-badge.desktop { background: var(--bg-orange); color: var(--fg-orange); }
.track-badge.web { background: var(--bg-blue); color: var(--fg-blue); }
.track-badge.browser { background: var(--bg-teal); color: var(--fg-teal); }
.track-badge.agent { background: var(--bg-pink); color: var(--fg-pink); }

/* --------------------------------------------------------------------------
   10. 도감
   -------------------------------------------------------------------------- */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 340px;
}

.search-icon {
  position: absolute;
  left: 15px;
  color: var(--faint);
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 11px 16px 11px 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--tint);
  color: var(--ink);
  font-size: 15px;
}

.search-box input::placeholder { color: var(--faint); }

.search-box input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.sort-select,
.form-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2398989d' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.sort-select {
  padding: 10px 40px 10px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background-color: var(--tint);
  color: var(--ink);
  font-size: 14.5px;
}

.sort-select:focus {
  outline: none;
  border-color: var(--accent);
}

/* --------------------------------------------------------------------------
   11. 모달
   -------------------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--overlay-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.modal-overlay.active { display: flex; }

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  border: 1px solid var(--hair);
  border-radius: 22px;
  background: var(--surf);
  box-shadow: var(--shadow-lift);
}

.modal-large { max-width: 1040px; }
.modal-sm { max-width: 420px; }

.modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--hair);
  background: var(--surf);
}

.modal-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
}

.modal-title {
  font-size: 19px;
  line-height: 1.35;
  letter-spacing: -0.02em;
}

.modal-close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--tint);
  color: var(--mut);
  font-size: 20px;
  line-height: 1;
}

.modal-close:hover { background: var(--tint2); color: var(--ink); }

.modal-body { padding: 24px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 24px 24px;
}

.modal-badge {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-blue);
  color: var(--fg-blue);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

.modal-summary {
  margin-bottom: 20px;
  font-size: 16px;
  line-height: 1.65;
  color: var(--body);
}

.modal-ideas-banner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.idea-box {
  padding: 18px;
  border-radius: 16px;
  background: var(--tint);
}

.idea-box-title {
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}

.idea-box-gov .idea-box-title { color: var(--fg-gold); }
.idea-box-biz .idea-box-title { color: var(--fg-blue); }

.idea-bullet-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.idea-bullet-list li {
  display: flex;
  gap: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--body);
}

/* 이모지 대신 박스 색과 같은 점으로 항목 표시 */
.idea-bullet-list li::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.6em;
  border-radius: 50%;
}

.idea-box-gov .idea-bullet-list li::before { background: var(--fg-gold); }
.idea-box-biz .idea-bullet-list li::before { background: var(--fg-blue); }

/* 갤러리 카드의 좋아요·댓글 수 */
.meta-count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.modal-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;
  gap: 20px;
  margin-top: 20px;
}

.detail-col { min-width: 0; }

.detail-col.highlight {
  padding: 20px;
  border-radius: 18px;
  background: var(--tint);
}

.detail-subtitle {
  margin-bottom: 10px;
  font-size: 15px;
  letter-spacing: -0.015em;
}

.detail-col > .detail-subtitle:not(:first-child) { margin-top: 24px; }

.tech-tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.reason-list {
  list-style: none;
  display: grid;
  gap: 8px;
}

.reason-list li {
  position: relative;
  padding-left: 22px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--body);
}

.reason-list li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--fg-green);
  font-weight: 700;
}

.code-snippet {
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-all;
  overflow-x: auto;
}

.vibe-tip-box {
  margin-top: 24px;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--bg-gold);
}

.vibe-tip-title {
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--fg-gold);
}

.vibe-tip-box p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--body);
}

.prompt-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.prompt-head .detail-subtitle { margin: 0; }

.prompt-hint {
  margin-bottom: 12px;
  font-size: 13.5px;
  color: var(--mut);
}

.prompt-output-box {
  display: block;
  width: 100%;
  min-height: 300px;
  padding: 14px 16px;
  border: 1px solid var(--hair);
  border-radius: 12px;
  background: var(--code-bg);
  color: var(--body);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.65;
  resize: vertical;
}

.prompt-output-box:focus { outline: none; border-color: var(--accent); }

.detail-col.highlight .btn-block { margin-top: 12px; }

/* tint 배경 위의 보조 버튼은 한 단계 밝게 */
.detail-col.highlight .btn-secondary { background: var(--tint2); }
.detail-col.highlight .btn-secondary:hover { background: var(--hair2); }

/* 공유 갤러리 상세 모달 소제목 (app.js 가 생성) */
.panel-title {
  margin: 20px 0 10px;
  font-size: 15px;
  letter-spacing: -0.015em;
  color: var(--ink);
}

/* --------------------------------------------------------------------------
   12. 폼 & 로그인
   -------------------------------------------------------------------------- */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group { margin-bottom: 16px; }

.form-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--mut);
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  background-color: var(--tint);
  color: var(--ink);
  font-size: 15px;
}

.form-select { padding-right: 40px; }

.form-input::placeholder,
.form-textarea::placeholder { color: var(--faint); }

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-textarea {
  min-height: 160px;
  line-height: 1.6;
  resize: vertical;
}

/* 여러 줄 CLI 명령어 입력칸 (줄바꿈 보존) */
.form-textarea-code {
  min-height: 76px;
  font-family: var(--font-mono);
  font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   12-1. 바이브코딩 용어·오류 메시지 사전
   -------------------------------------------------------------------------- */
#glossary { scroll-margin-top: calc(var(--header-h) + var(--banner-h) + 16px); }

.gloss-tabs {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--tint);
}

.gloss-tabs button {
  padding: 7px 16px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.gloss-tabs button:hover { color: var(--ink); }
.gloss-tabs button[aria-pressed="true"] { background: var(--accent); color: #fff; }
.gloss-tabs span { font-weight: 500; opacity: 0.8; }

.gloss-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 20px;
}

.gloss-groups,
.gloss-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.gloss-search { max-width: 320px; }

.gloss-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border: 1px solid var(--hair);
  border-radius: 999px;
  background: transparent;
  color: var(--body);
  font-size: 13px;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}

.gloss-chip:hover { border-color: var(--accent); color: var(--ink); }
.gloss-chip[aria-pressed="true"] { border-color: transparent; background: var(--bg-blue); color: var(--fg-blue); }

.gloss-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}

.gloss-grid-err { grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }

.gloss-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  background: var(--surf);
  box-shadow: var(--card-shadow);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s;
}

.gloss-item:hover { border-color: var(--accent); }
.gloss-item-t { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.gloss-item-g { font-size: 12.5px; line-height: 1.5; color: var(--mut); }
.gloss-err .gloss-item-t { font-family: var(--font-mono); font-size: 13px; font-weight: 500; color: var(--fg-orange); }
.gloss-empty { grid-column: 1 / -1; padding: 32px; text-align: center; color: var(--mut); }

.gloss-row { padding: 14px 0; border-top: 1px solid var(--hair); }
.gloss-row:first-child { border-top: 0; padding-top: 0; }
.gloss-k { margin-bottom: 6px; font-size: 12.5px; font-weight: 600; color: var(--fg-gold); }
.gloss-v { font-size: 15px; line-height: 1.65; color: var(--body); }

.gloss-say {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--tint);
}

.gloss-say p { margin: 0; color: var(--ink); }

.diag-terms { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; padding-top: 14px; border-top: 1px solid var(--hair); }
.diag-terms:empty { display: none; }
.diag-terms-k { font-size: 12.5px; font-weight: 600; color: var(--faint); }

.gloss-print { display: none; }

@media (max-width: 640px) {
  .gloss-search { max-width: none; }
  .gloss-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gloss-grid-err { grid-template-columns: 1fr; }
}

/* 용어표 인쇄: 인쇄 버튼을 누르면 body.print-gloss 로 용어표만 찍는다 */
@media print {
  body.print-gloss > *:not(main),
  body.print-gloss main > *:not(#glossary),
  body.print-gloss #glossary .section-head,
  body.print-gloss #glossary .gloss-tabs,
  body.print-gloss #glossary .gloss-filters,
  body.print-gloss #glossary .gloss-grid { display: none !important; }
  body.print-gloss { background: var(--print-paper); color: var(--print-ink); }
  body.print-gloss #glossary { padding: 0; }
  body.print-gloss .gloss-print { display: block; font-size: 10.5pt; color: var(--print-ink); }
  .gloss-print h2 { margin: 0 0 8pt; font-size: 16pt; }
  .gloss-print h3 { margin: 14pt 0 6pt; font-size: 12pt; }
  .gloss-print table { width: 100%; border-collapse: collapse; }
  .gloss-print th,
  .gloss-print td { padding: 4pt 6pt; border: 1px solid var(--print-line); text-align: left; vertical-align: top; }
  .gloss-print th { background: var(--print-head); }
  .gloss-print td:first-child { width: 16%; font-weight: 600; }
  .gloss-print tr { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   13. 토스트 & 푸터
   -------------------------------------------------------------------------- */
.toast-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  max-width: calc(100vw - 48px);
  pointer-events: none;
}

.toast {
  padding: 12px 18px;
  border: 1px solid var(--hair);
  border-radius: 14px;
  background: var(--tint);
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 500;
  box-shadow: var(--shadow-lift);
}

.toast-error {
  border-color: var(--fg-red);
  color: var(--fg-red);
}

.app-footer {
  padding: 28px 0 40px;
  border-top: 1px solid var(--hair);
  font-size: 13px;
  color: var(--faint);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-brand {
  font-weight: 600;
  color: var(--mut);
}

/* 라이트 모드: 페이지 배경(#f5f5f7) 위에 바로 놓이는 요소는 한 단계 대비를 올린다 */
[data-theme="light"] .site-switch,
[data-theme="light"] .app-header .btn-secondary { background: var(--tint2); }
[data-theme="light"] .app-header .btn-secondary:hover { background: var(--hair); }

[data-theme="light"] .search-box input,
[data-theme="light"] .sort-select {
  background-color: var(--surf);
  border-color: var(--hair);
}

/* --------------------------------------------------------------------------
   14. 반응형
   -------------------------------------------------------------------------- */

@media (max-width: 900px) {
  .header-nav { display: none; }
  .combo-cards-showcase,
  .modal-ideas-banner,
  .modal-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --header-h: 100px; }

  .header-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 16px;
  }

  /* 헤더 2줄: [아이콘 · 서비스 선택 · 테마] / [도감 | 용어 사전] */
  .header-actions { display: contents; }
  .brand { order: 0; }
  .brand-title { display: none; }
  /* 메뉴는 남는 폭을 채우고, 화면보다 길면 한 줄을 유지한 채 옆으로 밀어 본다 */
  .site-switch { order: 1; flex: 1 1 0; min-width: 0; overflow-x: auto; scrollbar-width: none; }
  .site-switch::-webkit-scrollbar { display: none; }
  .site-switch a { flex-shrink: 0; }
  /* 메인 페이지: 첫 줄 [아이콘 · 메뉴 · 테마] 다음에 줄을 끊어 둘째 줄에 섹션 버튼 */
  .app-header:has(#toggleCatalogBtn) .header-inner { row-gap: 0; }
  .app-header:has(#toggleCatalogBtn) .header-inner::after { content: ""; order: 2; flex-basis: 100%; height: 0; }
  #toggleCatalogBtn, #glossaryBtn { margin-top: 8px; }
  .site-switch a { padding: 5px 7px; font-size: 12px; letter-spacing: -0.02em; }
  .site-switch .ss-full { display: none; }
  .site-switch .ss-short { display: inline; }
  #themeToggleBtn { order: 2; }
  .lang-btn { order: 2; padding: 6px 10px !important; }
  #toggleCatalogBtn { order: 3; flex: 1 1 0; background: var(--tint); color: var(--ink); }
  #glossaryBtn { order: 4; flex: 1 1 0; justify-content: center; }

  .header-actions .btn:not(.btn-icon) {
    padding: 7px 12px;
    font-size: 13px;
  }

  .cdsa-banner { font-size: 12px; gap: 6px; }
  .cdsa-banner .cb-full { display: none; }
  .cdsa-banner .cb-short { display: inline; }
  .container { padding: 0 16px; }
  .hero { padding: calc(var(--header-h) + var(--banner-h) + 48px) 16px 64px; }
  .hero-stats { margin-top: 44px; }
  .section { padding: 64px 0; }

  .wizard-card {
    padding: 24px 18px 20px;
    border-radius: 22px;
  }

  .wizard-options-grid.yn-grid,
  .form-row { grid-template-columns: 1fr; }

  .search-box { max-width: none; }

  .modal-header,
  .modal-body { padding-left: 18px; padding-right: 18px; }

  .modal-footer { padding: 0 18px 18px; }

  .toast-container { right: 16px; bottom: 16px; max-width: calc(100vw - 32px); }
}
