/* =============================================================
   AlgoLab — 통합 트레이딩 플랫폼 / 디자인 시스템
   다크 프리미엄 · 데이터 고밀도 · 시그니처 민트-시안
   ============================================================= */

:root {
  /* --- 배경 계층 (뉴트럴 잉크 톤) --- */
  --bg: #0a0b0d;
  --bg-soft: #0e1013;
  --surface: #131519;
  --surface-2: #181a1f;
  --surface-3: #1f2228;
  --elevated: #23262d;

  /* --- 라인/보더 (헤어라인) --- */
  --line: rgba(255, 255, 255, 0.06);
  --line-strong: rgba(255, 255, 255, 0.11);
  --line-faint: rgba(255, 255, 255, 0.035);

  /* --- 텍스트 --- */
  --text: #f4f5f7;
  --text-2: #9ba1ab;
  --text-3: #888e98;   /* WCAG AA 보정(다크): 6a6f78(3.35:1)→약5:1 */
  --text-faint: #7e848e;  /* 494e57(2.0:1)→약4.5:1, 계층 유지 */

  /* --- 액센트 (절제된 에메랄드, 글로우 없음) --- */
  --accent: #3ecf8e;
  --accent-hover: #4dd99b;
  --accent-2: #2bb39b;
  --accent-soft: rgba(62, 207, 142, 0.10);
  --accent-line: rgba(62, 207, 142, 0.26);
  --grad: linear-gradient(135deg, #45d196 0%, #28b39a 100%);
  --grad-soft: linear-gradient(135deg, rgba(62,207,142,0.10), rgba(43,179,155,0.04));

  /* --- 보조 색 --- */
  --violet: #9a8cff;
  --amber: #e8b057;
  --up: #3ecf8e;
  --down: #f0596f;

  /* --- 타이포 --- */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui,
          "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, Menlo, Consolas, monospace;

  /* --- 레이아웃 --- */
  --max: 1240px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-sm: 9px;
  --header-h: 64px;

  /* --- 그림자 (절제) --- */
  --shadow: 0 1px 2px rgba(0,0,0,0.4), 0 12px 28px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 2px 6px rgba(0,0,0,0.4), 0 30px 60px rgba(0, 0, 0, 0.5);
  --glow: 0 0 0 1px var(--accent-line);

  /* --- 테마별 표면 --- */
  --header-bg: rgba(10, 11, 13, 0.72);
  --bg-gradient: linear-gradient(180deg, #0e1014 0%, var(--bg) 42%);
  --primary-fg: #06120c;
}

/* ============================================================
   라이트 모드 — :root[data-theme="light"] 오버라이드
   ============================================================ */
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-soft: #eef0f3;
  --surface: #ffffff;
  --surface-2: #f1f3f5;
  --surface-3: #e7eaee;
  --elevated: #ffffff;

  --line: rgba(17, 20, 24, 0.10);
  --line-strong: rgba(17, 20, 24, 0.17);
  --line-faint: rgba(17, 20, 24, 0.055);

  --text: #14171c;
  --text-2: #525a64;
  --text-3: #686d76;   /* WCAG AA 보정(라이트): 818892(3.54:1)→약5:1 */
  --text-faint: #6d727b;  /* a7aeb6(2.2:1)→4.8:1(흰)·4.5:1(bg) AA, 계층 유지 */

  --accent: #0a9d62;
  --accent-hover: #088a56;
  --accent-2: #0a8f7e;
  --accent-soft: rgba(10, 157, 98, 0.10);
  --accent-line: rgba(10, 157, 98, 0.28);
  --grad: linear-gradient(135deg, #0fa86a 0%, #0a8f7e 100%);
  --grad-soft: linear-gradient(135deg, rgba(10,157,98,0.10), rgba(10,143,126,0.04));

  --violet: #6d5bd6;
  --amber: #b9791a;
  --up: #0a9d62;
  --down: #d83a50;

  --shadow: 0 1px 2px rgba(17,20,24,0.06), 0 12px 28px rgba(17,20,24,0.09);
  --shadow-lg: 0 2px 6px rgba(17,20,24,0.08), 0 30px 60px rgba(17,20,24,0.13);

  --header-bg: rgba(255, 255, 255, 0.72);
  --bg-gradient: linear-gradient(180deg, #ffffff 0%, var(--bg) 44%);
  --primary-fg: #04140c;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  letter-spacing: -0.011em;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
/* 인라인 아이콘 SVG 기본 크기 — 컨텍스트 글꼴 크기에 맞춤. 아래 고정 박스들은 개별 override */
svg { width: 1em; height: 1em; vertical-align: middle; flex-shrink: 0; }
.mono { font-family: var(--mono); font-feature-settings: "tnum"; letter-spacing: -0.02em; }

/* ---------- 배경: 절제된 톤 (격자/네온/그레인 필터 제거) ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background: var(--bg-gradient);
  pointer-events: none;
}

/* ---------- 레이아웃 헬퍼 ---------- */
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.section { padding: 96px 0; }
.section-sm { padding: 64px 0; }
.row { display: flex; align-items: center; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.center { display: flex; align-items: center; justify-content: center; }

/* ---------- 스킵 링크 (접근성) ---------- */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 300;
  padding: 10px 16px; border-radius: 10px;
  background: var(--accent); color: var(--primary-fg); font-weight: 650; font-size: 14px;
  transform: translateY(-150%); transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--text); outline-offset: 2px; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--header-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
}
.site-header .container { height: 100%; display: flex; align-items: center; gap: 28px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.02em; }
.brand .logo {
  width: 29px; height: 29px; border-radius: 8px;
  background: var(--accent);
  display: grid; place-items: center;
}
.brand .logo svg { width: 17px; height: 17px; }
.brand b { color: var(--text); font-weight: 700; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  position: relative;
  padding: 8px 14px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--text-2); transition: color .15s, background .15s;
}
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a.active { color: var(--text); }

/* 더보기 드롭다운 (가이드·이용방법 등 보조 메뉴) */
.nav-more { position: relative; }
.nav-more-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 8px 12px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--text-2); background: transparent; border: none; cursor: pointer;
  font-family: inherit; transition: color .15s, background .15s;
}
.nav-more-btn:hover, .nav-more.open .nav-more-btn, .nav-more-btn.active { color: var(--text); }
.nav-more-btn:hover, .nav-more.open .nav-more-btn { background: var(--surface-2); }
.nav-more-btn .chev { width: 14px; height: 14px; transition: transform .18s; }
.nav-more.open .nav-more-btn .chev { transform: rotate(180deg); }
.nav-more-panel {
  position: absolute; top: calc(100% + 9px); right: 0; min-width: 170px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 13px;
  box-shadow: 0 16px 38px rgba(0,0,0,.16); padding: 6px; z-index: 60;
  display: none; flex-direction: column; gap: 2px;
}
.nav-more.open .nav-more-panel { display: flex; }
.nav-more-panel a {
  padding: 10px 13px; border-radius: 9px; font-size: 14px; font-weight: 500;
  color: var(--text-2); white-space: nowrap; transition: color .15s, background .15s;
}
.nav-more-panel a:hover, .nav-more-panel a.active { color: var(--text); background: var(--surface-2); }
.header-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.header-auth { display: flex; align-items: center; gap: 10px; }
.nav-toggle { display: none; width: 38px; height: 38px; border-radius: 9px;
  align-items: center; justify-content: center; color: var(--text-2);
  background: transparent; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.nav-toggle svg { width: 20px; height: 20px; }
.nav-toggle:hover { background: var(--surface-2); color: var(--text); }
.theme-toggle {
  width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s;
}
.theme-toggle:hover { color: var(--text); border-color: var(--line-strong); }
.theme-toggle svg { width: 18px; height: 18px; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: 10px;
  font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: transform .12s ease, background .15s, border-color .15s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--primary-fg); font-weight: 650; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-3); border-color: var(--line-strong); }
.btn-outline { background: transparent; color: var(--text); border: 1px solid var(--line-strong); }
.btn-outline:hover { background: var(--surface-2); }
.btn-sm { height: 34px; padding: 0 13px; font-size: 13px; border-radius: 9px; }
.btn-lg { height: 50px; padding: 0 26px; font-size: 15.5px; border-radius: 12px; }
.btn-block { width: 100%; }

/* ---------- 배지 / 칩 ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: 0;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge-accent { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }
.badge-new { background: rgba(139,123,255,0.14); color: var(--violet); border-color: rgba(139,123,255,0.3); }
/* '키 없이 페이퍼 체험' 강조 배지 — accent 변형 + 키 글리프 */
.badge-paper { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); font-weight: 650; }
.badge-paper::before { content: ""; width: 12px; height: 12px; flex-shrink: 0;
  background: currentColor; -webkit-mask: var(--key-glyph) center/contain no-repeat; mask: var(--key-glyph) center/contain no-repeat; }
:root { --key-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='8' cy='8' r='4.5'/%3E%3Cpath d='M11 11l8 8m-3 0 3-3m-6 0 2-2'/%3E%3C/svg%3E"); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 16px; border-radius: 999px;
  font-size: 13.5px; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line);
  transition: all .15s;
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* 페이지네이션 (소식 등) */
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; margin-top: 28px; }
.pager .pg-btn {
  min-width: 38px; height: 38px; padding: 0 12px; border-radius: 10px;
  font-size: 14px; font-weight: 500; color: var(--text-2);
  background: var(--surface); border: 1px solid var(--line); transition: all .15s; cursor: pointer;
}
.pager .pg-btn:hover:not([disabled]) { color: var(--text); border-color: var(--line-strong); }
.pager .pg-btn.active { background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent-line); font-weight: 600; }
.pager .pg-btn[disabled] { opacity: .4; cursor: default; }
.pager .pg-ellip { color: var(--text-3, var(--text-2)); padding: 0 2px; }

/* 의견 게시판 */
.bd-card-row { display: flex; gap: 16px; align-items: flex-start; }
.bd-card-main { flex: 1; min-width: 0; }
.bd-title { font-size: 16.5px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.bd-body { color: var(--text-2); font-size: 14.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* 추천 버튼 */
.vote-btn {
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 2px;
  min-width: 50px; padding: 8px 6px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-3);
  cursor: pointer; transition: all .15s; line-height: 1;
}
.vote-btn:hover { border-color: var(--accent-line); color: var(--accent); }
.vote-btn .vote-n { font-size: 14px; font-weight: 700; }
.vote-btn.voted { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }

/* 상태 뱃지 */
.bd-status { display: inline-flex; align-items: center; height: 22px; padding: 0 9px;
  border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.bd-st-new      { color: var(--text-3); background: var(--surface-2, rgba(127,127,127,0.08)); border-color: var(--line); }
.bd-st-review   { color: var(--violet); background: rgba(139,123,255,0.12); border-color: rgba(139,123,255,0.28); }
.bd-st-planned  { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.bd-st-done     { color: #fff; background: var(--accent); border-color: var(--accent); }
[data-theme="light"] .bd-st-done { color: #06120c; }
.bd-st-declined { color: var(--text-3); background: transparent; border-color: var(--line); text-decoration: line-through; }
.bd-st-private  { gap: 4px; color: var(--text-3); background: var(--surface-2, rgba(127,127,127,0.08)); border-color: var(--line); }

/* 공개/비공개 선택 (작성 폼) */
.bd-vis { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  background: var(--bg-soft); border: 1px solid var(--line); }
.bd-vis-opt { display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px; border-radius: 8px; font-size: 13px; font-weight: 500; font-family: inherit;
  color: var(--text-3); background: transparent; border: none; cursor: pointer; transition: all .15s; }
.bd-vis-opt:hover { color: var(--text); }
.bd-vis-opt.active { color: var(--accent); background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.06); }

/* 비공개 글 카드 — 자물쇠(추천 자리) + 점선 강조 */
.bd-card-private { border-style: dashed; }
.vote-btn.vote-locked { cursor: default; color: var(--text-3); }
.vote-btn.vote-locked:hover { border-color: var(--line); color: var(--text-3); }

/* 운영팀 답변 */
.bd-reply { margin-top: 14px; padding: 12px 14px; border-radius: 10px;
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.bd-reply-head { display: flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 700;
  color: var(--accent); margin-bottom: 5px; }
.bd-reply-body { font-size: 13.5px; line-height: 1.65; color: var(--text-2); white-space: pre-wrap; }

@media (max-width: 560px) {
  .bd-card-row { gap: 12px; }
  .vote-btn { min-width: 44px; padding: 7px 4px; }
}

/* ---------- 타이포 스케일 ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent);
}
.h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.04; font-weight: 800; letter-spacing: -0.035em; }
.h2 { font-size: clamp(29px, 4vw, 47px); line-height: 1.1; font-weight: 800; letter-spacing: -0.032em; }
.h3 { font-size: 22px; font-weight: 700; letter-spacing: -0.022em; }
.lead { font-size: clamp(16px, 2vw, 20px); color: var(--text-2); line-height: 1.62; }
.muted { color: var(--text-3); }
.text-grad { color: var(--accent); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 56px; }
.section-head .h2 { margin: 14px 0 16px; }

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .18s, transform .18s, box-shadow .18s, background .18s;
}
.card-hover:hover { border-color: var(--line-strong); transform: translateY(-3px); box-shadow: var(--shadow); }

/* ====================== HERO ====================== */
.hero { position: relative; padding: 84px 0 72px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 56px; align-items: center; }
.hero h1 { margin: 22px 0 22px; }
.hero .lead { max-width: 520px; }
.hero-cta { display: flex; gap: 12px; margin-top: 32px; flex-wrap: wrap; }
.hero-trust { display: flex; align-items: center; gap: 22px; margin-top: 30px; color: var(--text-3); font-size: 13.5px; }
.hero-trust .avatars { display: flex; }
.hero-trust .avatars span {
  width: 30px; height: 30px; border-radius: 50%; margin-left: -8px;
  border: 2px solid var(--bg); background: var(--surface-3);
  display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--text-2);
}
.hero-trust .avatars span:first-child { margin-left: 0; }

/* hero 우측 미리보기 패널 (앱 윈도우 목업) */
.app-mock {
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.app-mock-bar { display: flex; align-items: center; gap: 7px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.app-mock-bar i { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.app-mock-bar .t { margin-left: 10px; font-size: 12.5px; color: var(--text-3); font-family: var(--mono); }
.app-mock-body { padding: 18px; display: grid; gap: 12px; }
.mock-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 15px; border-radius: 11px; background: var(--bg-soft); border: 1px solid var(--line); }
.mock-row .l { display: flex; align-items: center; gap: 12px; }
.mock-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-3); display: grid; place-items: center; font-size: 17px; color: var(--accent); }
.mock-row .name { font-size: 14px; font-weight: 600; }
.mock-row .sub { font-size: 12px; color: var(--text-3); }
.pnl-up { color: var(--up); font-weight: 700; }
.pnl-down { color: var(--down); font-weight: 700; }
/* 히어로 목업 — 누적 손익 요약 행 (스파크라인 + 강조 수치) */
.mock-pnl { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 15px; border-radius: 11px; background: var(--grad-soft); border: 1px solid var(--accent-line); }
.mock-pnl .l { display: flex; flex-direction: column; gap: 2px; }
.mock-pnl .k { font-size: 12px; color: var(--text-3); }
.mock-pnl .v { font-size: 22px; letter-spacing: -0.02em; }
/* 카테고리 틴트 — mock 아이콘 박스 (국내주식 톤 재사용) */
.mock-ico { background-color: var(--surface-3); background-blend-mode: normal; --mock-tint: radial-gradient(120% 120% at 70% 0%, rgba(62,207,142,.22), transparent 65%); }
.mock-foot { display: flex; gap: 10px; }
.mock-foot .btn { flex: 1; }

/* ---------- 로고 띠 ---------- */
.logos { padding: 40px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.logos .label { text-align: center; font-size: 12.5px; color: var(--text-3); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 22px; }
.logos-track { display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap; }
.logos-track span { font-weight: 600; font-size: 17px; color: var(--text-3); letter-spacing: -0.012em; transition: color .2s; }
.logos-track span:hover { color: var(--text); }

/* ---------- 통계 스트립 ---------- */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat { text-align: center; padding: 26px 18px; }
.stat-ic { display: inline-flex; width: 42px; height: 42px; border-radius: 12px;
  align-items: center; justify-content: center; color: var(--accent);
  background: var(--accent-soft); margin-bottom: 13px; }
.stat-ic svg { width: 21px; height: 21px; stroke-width: 1.8; }
.stat-t { font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); }
.stat .lbl { color: var(--text-3); font-size: 13px; margin-top: 5px; line-height: 1.5; }
/* 구버전 숫자형 호환 */
.stat .num { font-size: 40px; font-weight: 800; letter-spacing: -0.03em; }
.stat .num span { color: var(--accent); }

/* ---------- feature grid ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature { padding: 30px 26px; }
.feature .ico {
  width: 48px; height: 48px; border-radius: 13px; margin-bottom: 20px;
  background: var(--grad-soft); border: 1px solid var(--accent-line);
  display: grid; place-items: center; color: var(--accent);
}
.feature .ico svg { width: 24px; height: 24px; }
.feature h3 { font-size: 18px; font-weight: 700; margin-bottom: 9px; letter-spacing: -0.02em; }
.feature p { color: var(--text-3); font-size: 14.5px; line-height: 1.6; }

/* ---------- 프로그램 카드 ---------- */
.prog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.prog-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.prog-thumb {
  height: 150px; position: relative; overflow: hidden;
  background:
    radial-gradient(115% 135% at 82% -12%, color-mix(in srgb, var(--cat, #3ecf8e) 24%, transparent), transparent 58%),
    linear-gradient(158deg, #141b24 0%, #0d1117 72%);
  border-bottom: 1px solid var(--line);
  display: grid; place-items: center;
}
:root[data-theme="light"] .prog-thumb {
  background:
    radial-gradient(115% 135% at 82% -12%, color-mix(in srgb, var(--cat, #3ecf8e) 20%, transparent), transparent 58%),
    linear-gradient(158deg, #eef2f7 0%, #e4eaf0 72%);
}
/* 미세 그리드 텍스처 — 좌측에 페이드 마스크 */
.prog-thumb .pt-grid, .detail-hero-thumb .pt-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(color-mix(in srgb, var(--cat, #3ecf8e) 13%, transparent) 1px, transparent 1px),
    linear-gradient(90deg, color-mix(in srgb, var(--cat, #3ecf8e) 13%, transparent) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(90% 90% at 28% 55%, #000 0%, transparent 78%);
  mask-image: radial-gradient(90% 90% at 28% 55%, #000 0%, transparent 78%);
}
/* 우상단 소프트 글로우 */
.prog-thumb .pt-glow, .detail-hero-thumb .pt-glow {
  position: absolute; right: -8%; top: -45%; width: 190px; height: 190px; pointer-events: none;
  background: radial-gradient(circle, color-mix(in srgb, var(--cat, #3ecf8e) 42%, transparent), transparent 70%);
}
.prog-thumb .glyph {
  position: relative; z-index: 1;
  width: 64px; height: 64px; border-radius: 18px;
  background: color-mix(in srgb, var(--cat, #3ecf8e) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cat, #3ecf8e) 38%, transparent);
  display: grid; place-items: center; color: var(--cat, #3ecf8e);
  box-shadow: 0 8px 24px rgba(0,0,0,.28), 0 0 0 6px color-mix(in srgb, var(--cat, #3ecf8e) 8%, transparent);
  transition: transform .2s, box-shadow .2s;
}
.prog-thumb .glyph svg { width: 32px; height: 32px; stroke-width: 1.7; }
.prog-card:hover .prog-thumb .glyph {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 14px 32px rgba(0,0,0,.34), 0 0 0 8px color-mix(in srgb, var(--cat, #3ecf8e) 13%, transparent);
}
.prog-thumb .badge { position: absolute; top: 12px; left: 12px; z-index: 2; }
.prog-thumb .tag-os { position: absolute; top: auto; bottom: 12px; right: 12px; z-index: 2; }
/* '키 없이 체험' — 썸네일 하단 좌측 (기본/상태 배지와 겹치지 않게) */
.prog-thumb .badge-paper { position: absolute; top: auto; bottom: 12px; left: 12px; z-index: 2;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.prog-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.prog-cat { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: 0.02em; }
.prog-card h3 { font-size: 17px; font-weight: 700; margin: 7px 0 8px; letter-spacing: -0.02em; }
.prog-card .desc { font-size: 13.5px; color: var(--text-3); line-height: 1.55; flex: 1; }
.prog-meta { display: flex; align-items: center; gap: 14px; margin-top: 16px; font-size: 12.5px; color: var(--text-3); }
.prog-meta .s { display: flex; align-items: center; gap: 5px; }
.prog-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.price { font-size: 15px; font-weight: 700; }
.price .free { color: var(--accent); }
.price .sub { font-size: 12px; color: var(--text-3); font-weight: 500; }

/* ---------- how it works ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; counter-reset: s; }
.step { padding: 30px 26px; position: relative; }
.step .n {
  width: 40px; height: 40px; border-radius: 11px; margin-bottom: 18px;
  background: var(--surface-2); border: 1px solid var(--line-strong);
  display: grid; place-items: center; font-family: var(--mono); font-weight: 700; color: var(--accent);
}
.step h3 { font-size: 18px; margin-bottom: 8px; }
.step p { color: var(--text-3); font-size: 14.5px; }

/* ---------- CTA 밴드 ---------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  padding: 64px 48px; text-align: center;
}
.cta-band > * { position: relative; }
.cta-band .h2 { margin-bottom: 14px; }
.cta-band .lead { margin: 0 auto 30px; max-width: 520px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 60px 0 36px; margin-top: 40px; background: var(--bg-soft); }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; }
.footer-brand p { color: var(--text-3); font-size: 14px; margin: 16px 0 20px; max-width: 280px; line-height: 1.6; }
.footer-col h4 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-3); margin-bottom: 16px; }
.footer-col a { display: block; color: var(--text-2); font-size: 14px; padding: 6px 0; transition: color .15s; }
.footer-col a:hover { color: var(--text); }
.footer-company { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--line); color: var(--text-3); font-size: 12.5px; line-height: 1.6; }
.footer-company a { color: var(--text-2); }
.footer-company a:hover { color: var(--text); }
.footer-bottom { display: flex; align-items: center; justify-content: space-between; margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--line-faint); color: var(--text-3); font-size: 13px; flex-wrap: wrap; gap: 12px; }
.socials { display: flex; gap: 10px; }
.socials a { width: 36px; height: 36px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); display: grid; place-items: center; color: var(--text-2); transition: all .15s; }
.socials a:hover { color: var(--text); border-color: var(--line-strong); }

/* ====================== 카탈로그 페이지 ====================== */
.page-head { padding: 56px 0 32px; border-bottom: 1px solid var(--line); }
.page-head .h2 { margin: 12px 0 12px; }
.toolbar { display: flex; align-items: center; gap: 12px; padding: 24px 0; flex-wrap: wrap; }
.search {
  flex: 1; min-width: 240px; display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px; border-radius: 11px;
  background: var(--surface); border: 1px solid var(--line);
}
.search:focus-within { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.search input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-size: 14.5px; }
.search input::placeholder { color: var(--text-faint); }
.select {
  height: 44px; padding: 0 14px; border-radius: 11px; font-size: 14px; color: var(--text);
  background: var(--surface); border: 1px solid var(--line); outline: none;
}

/* 공용 폼 컨트롤 (input / select / textarea) */
.input {
  width: 100%; height: 46px; padding: 0 15px; border-radius: 11px;
  font-size: 14.5px; font-family: inherit; color: var(--text);
  background: var(--bg-soft); border: 1px solid var(--line);
  outline: none; transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
.input::placeholder { color: var(--text-3); }
.input:hover:not(:focus) { border-color: var(--line-strong); }
.input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { height: auto; min-height: 104px; padding: 13px 15px; line-height: 1.65; resize: vertical; }
select.input {
  padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236a6f78' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center;
}
.filters { display: flex; gap: 9px; flex-wrap: wrap; padding-bottom: 8px; }

/* ====================== 상품 상세 ====================== */
.detail-grid { display: grid; grid-template-columns: 1fr 360px; gap: 40px; align-items: start; padding-top: 40px; }
.detail-hero-thumb {
  height: 320px; border-radius: var(--radius-lg); border: 1px solid var(--line);
  position: relative; overflow: hidden;
  display: grid; place-items: center; margin-bottom: 16px;
  background:
    radial-gradient(90% 120% at 80% -8%, color-mix(in srgb, var(--cat, #3ecf8e) 24%, transparent), transparent 55%),
    linear-gradient(158deg, #141b24 0%, #0d1117 72%);
}
:root[data-theme="light"] .detail-hero-thumb {
  background:
    radial-gradient(90% 120% at 80% -8%, color-mix(in srgb, var(--cat, #3ecf8e) 18%, transparent), transparent 55%),
    linear-gradient(158deg, #eef2f7 0%, #e4eaf0 72%);
}
.detail-hero-thumb .glyph {
  position: relative; z-index: 1;
  width: 116px; height: 116px; border-radius: 28px;
  background: color-mix(in srgb, var(--cat, #3ecf8e) 13%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--cat, #3ecf8e) 38%, transparent);
  display: grid; place-items: center; color: var(--cat, #3ecf8e);
  box-shadow: 0 16px 40px rgba(0,0,0,.30), 0 0 0 10px color-mix(in srgb, var(--cat, #3ecf8e) 7%, transparent);
}
.detail-hero-thumb .glyph svg { width: 56px; height: 56px; stroke-width: 1.5; }
/* 상세 히어로는 더 큰 텍스처/글로우 */
.detail-hero-thumb .pt-grid { background-size: 34px 34px; }
.detail-hero-thumb .pt-glow { width: 320px; height: 320px; right: -6%; top: -40%; }
.thumbs { display: flex; gap: 12px; margin-bottom: 36px; }
.thumbs div { flex: 1; height: 64px; border-radius: 11px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; font-size: 22px; color: var(--text-3); cursor: pointer; transition: border-color .15s, color .15s; }
.thumbs div:hover, .thumbs div.active { border-color: var(--accent-line); color: var(--accent); }
.prose h2 { font-size: 24px; margin: 36px 0 14px; letter-spacing: -0.02em; }
.prose h2:first-child { margin-top: 0; }
.prose p { color: var(--text-2); margin-bottom: 14px; line-height: 1.7; }
.feature-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 8px 0 12px; }
.feature-list li { display: flex; gap: 11px; align-items: flex-start; color: var(--text-2); font-size: 14.5px; }
.feature-list .ck { flex-shrink: 0; width: 22px; height: 22px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; margin-top: 1px; }

/* 사이드 구매/다운로드 카드 */
.buy-card { padding: 24px; position: sticky; top: 88px; }
.buy-card .price-big { font-size: 34px; font-weight: 800; letter-spacing: -0.03em; }
.buy-card .price-big .free { color: var(--accent); }
.buy-card .price-sub { color: var(--text-3); font-size: 13.5px; margin-top: 2px; }
.buy-card .buy-hint { display: flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12.5px; color: var(--accent); line-height: 1.4; }
.buy-card .buy-hint svg { width: 14px; height: 14px; flex-shrink: 0; }
.buy-card .divider { height: 1px; background: var(--line); margin: 20px 0; }
.spec-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 0; font-size: 14px; }
.spec-row .k { color: var(--text-3); }
.spec-row .v { font-weight: 600; }

/* ====================== 인증 (로그인/가입) ====================== */
.auth-wrap { min-height: calc(100vh - var(--header-h)); display: grid; place-items: center; padding: 48px 24px; }
.auth-card { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 36px 32px; box-shadow: var(--shadow-lg); }
.auth-card .h-title { font-size: 25px; font-weight: 800; letter-spacing: -0.025em; text-align: center; }
.auth-card .h-sub { text-align: center; color: var(--text-3); font-size: 14.5px; margin: 8px 0 28px; }
.social-btns { display: grid; gap: 11px; }
.social-btn {
  display: flex; align-items: center; gap: 12px; width: 100%;
  height: 50px; padding: 0 18px; border-radius: 12px; font-size: 15px; font-weight: 600;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text);
  transition: all .15s; position: relative;
}
.social-btn:hover { border-color: var(--line-strong); background: var(--surface-3); }
.social-btn .ico { width: 22px; height: 22px; display: grid; place-items: center; flex-shrink: 0; }
.social-btn .ico img, .social-btn .ico svg { width: 20px; height: 20px; }
.social-btn.kakao { background: #FEE500; color: #191600; border-color: #FEE500; }
.social-btn.kakao:hover { background: #ffd900; }
.social-btn.naver { background: #03C75A; color: #fff; border-color: #03C75A; }
.social-btn.naver:hover { background: #02b350; }
.social-btn.google { background: #fff; color: #1f1f1f; border-color: #fff; }
.social-btn.google:hover { background: #f1f1f1; }
:root[data-theme="light"] .social-btn.google { border-color: var(--line-strong); }
:root[data-theme="light"] .social-btn.google:hover { background: #f4f5f7; }
.social-btn .arrow { margin-left: auto; opacity: .4; }
.auth-divider { display: flex; align-items: center; gap: 14px; margin: 24px 0; color: var(--text-faint); font-size: 12.5px; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 7px; font-weight: 500; }
.field input {
  width: 100%; height: 46px; padding: 0 15px; border-radius: 11px; font-size: 14.5px;
  background: var(--bg-soft); border: 1px solid var(--line); color: var(--text); outline: none; transition: all .15s;
}
.field input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.auth-foot { text-align: center; margin-top: 22px; color: var(--text-3); font-size: 14px; }
.auth-foot a { color: var(--accent); font-weight: 600; }
.auth-legal { text-align: center; margin-top: 20px; color: var(--text-faint); font-size: 12px; line-height: 1.6; }
.auth-legal a { color: var(--text-3); text-decoration: underline; }

/* ====================== 대시보드 ====================== */
.dash { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - var(--header-h)); }
.dash-side { border-right: 1px solid var(--line); padding: 28px 16px; background: var(--bg-soft); }
.dash-user { display: flex; align-items: center; gap: 12px; padding: 8px 10px 20px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.dash-user .av { width: 42px; height: 42px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; font-weight: 800; color: #04130d; }
.dash-user .nm { font-weight: 700; font-size: 14.5px; }
.dash-user .em { font-size: 12px; color: var(--text-3); }
.dash-nav { display: grid; gap: 3px; margin-top: 14px; }
.dash-nav a { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 10px; color: var(--text-2); font-size: 14px; font-weight: 500; transition: all .15s; }
.dash-nav a svg { width: 18px; height: 18px; opacity: .8; }
.dash-nav a:hover { background: var(--surface-2); color: var(--text); }
.dash-nav a.active { background: var(--accent-soft); color: var(--accent); }
.dash-main { padding: 36px 40px; }
.dash-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 16px; }
.dash-head h1 { font-size: 26px; font-weight: 800; letter-spacing: -0.025em; }
.dash-head p { color: var(--text-3); font-size: 14px; margin-top: 4px; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 32px; }
.kpi { padding: 20px; }
.kpi .k { font-size: 13px; color: var(--text-3); display: flex; align-items: center; gap: 7px; }
.kpi .v { font-size: 28px; font-weight: 800; letter-spacing: -0.02em; margin-top: 10px; }
.kpi .d { font-size: 12.5px; margin-top: 4px; }

/* 라이선스 / 내 프로그램 테이블 */
.panel { padding: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.panel-head h3 { font-size: 16px; font-weight: 700; }
.tbl-scroll { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; min-width: 640px; }
table.tbl td, table.tbl th { white-space: nowrap; }
.tbl-app .ct { white-space: nowrap; }
table.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.04em; padding: 13px 22px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 16px 22px; border-bottom: 1px solid var(--line-faint); font-size: 14px; vertical-align: middle; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl tr:hover td { background: var(--surface-2); }
.tbl-app { display: flex; align-items: center; gap: 12px; }
.tbl-app .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--surface-3); display: grid; place-items: center; font-size: 18px; color: var(--text-2); flex-shrink: 0; }
.tbl-app .nm { font-weight: 600; }
.tbl-app .ct { font-size: 12px; color: var(--text-3); }
.lic-key { font-family: var(--mono); font-size: 13px; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 8px; padding: 6px 11px; color: var(--text-2); display: inline-flex; align-items: center; gap: 8px; }
.lic-key button { color: var(--text-3); }
.lic-key button:hover { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; padding: 4px 10px; border-radius: 999px; }
.status.on { background: rgba(47,224,138,0.12); color: var(--up); }
.status.off { background: rgba(255,92,121,0.12); color: var(--down); }
.status.pending { background: rgba(255,181,71,0.12); color: var(--amber); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--elevated); border: 1px solid var(--line-strong); color: var(--text);
  padding: 13px 20px; border-radius: 12px; font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: all .25s; z-index: 200;
  display: flex; align-items: center; gap: 10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast .c { color: var(--accent); }

/* ---------- 애니메이션 (스크롤 인) ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 1000px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .feature-grid, .prog-grid, .steps { grid-template-columns: 1fr 1fr; }
  .stats { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .buy-card { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 720px) {
  /* 헤더 — 햄버거 토글 드롭다운 */
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--surface); border-bottom: 1px solid var(--line);
    padding: 10px 16px 14px;
    box-shadow: 0 14px 30px rgba(0,0,0,.14);
  }
  .site-header.menu-open .nav { display: flex; }
  .nav a { padding: 13px 12px; border-radius: 10px; font-size: 15px; }
  .nav a:hover, .nav a.active { background: var(--surface-2); }
  /* 모바일: 더보기를 펼친 평면 목록으로 — 햄버거 메뉴 하단에 그대로 노출 */
  .nav-more { position: static; }
  .nav-more-btn { display: none; }
  .nav-more-panel {
    position: static; display: flex; min-width: 0; padding: 8px 0 0; margin-top: 6px;
    border: none; border-top: 1px solid var(--line); border-radius: 0; box-shadow: none;
  }
  .nav-more-panel a { padding: 13px 12px; border-radius: 10px; font-size: 15px; }

  .section { padding: 56px 0; }
  .feature-grid, .prog-grid, .steps, .stats, .feature-list { grid-template-columns: 1fr; }
  .stats { gap: 4px; }
  /* 대시보드/관리자 — 사이드바를 상단 바로 reflow (계정·내비·로그아웃 유지) */
  .dash { grid-template-columns: 1fr; }
  .dash-side {
    display: block; border-right: none; border-bottom: 1px solid var(--line);
    padding: 14px 16px; background: var(--bg-soft);
  }
  .dash-user { padding: 2px 2px 12px; margin-bottom: 10px; }
  .dash-nav {
    display: flex; gap: 8px; margin-top: 0; overflow-x: auto;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .dash-nav::-webkit-scrollbar { display: none; }
  .dash-nav a {
    flex: 0 0 auto; white-space: nowrap; padding: 9px 13px; font-size: 13px;
    background: var(--surface); border: 1px solid var(--line);
  }
  .dash-side > div:last-child {
    display: flex; gap: 8px; margin-top: 12px !important; padding-top: 12px;
  }
  .dash-side > div:last-child > .btn-block { flex: 1; margin-top: 0 !important; }
  .dash-main { padding: 22px 16px; }
  .kpi-grid { gap: 10px; }
  .cta-band { padding: 44px 24px; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero-trust { flex-wrap: wrap; }
  .container { padding-left: 18px; padding-right: 18px; }
}

@media (max-width: 480px) {
  /* 작은 화면 — 큰 텍스트·간격 축소, 보조 버튼 숨김 */
  .hero h1, .h1 { font-size: 34px; }
  .h2 { font-size: 25px; }
  .display, .hero .display { font-size: 36px; }
  .header-auth .btn-ghost { display: none; }
  .stat-t { font-size: 16px; }
  .section { padding: 46px 0; }
  .app-mock-body { padding: 14px; }
}

/* ============================================================
   감도 향상 — 모션 · 재질 · 데이터 비주얼 · 마감
   ============================================================ */

/* --- 셀렉션 / 스크롤바 / 포커스 --- */
::selection { background: var(--accent-soft); color: var(--text); }
* { scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent; }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border: 3px solid var(--bg); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-faint); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 5px; }

/* --- 카드 상단 하이라이트 '립' --- */
.card { position: relative; }
.card-hover { will-change: transform; }
.card-hover::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  opacity: 0; transition: opacity .2s;
}
.card-hover:hover::after { opacity: 1; }
:root[data-theme="light"] .card-hover::after { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85); }

/* --- 네비 언더라인 --- */
/* 밑줄은 상단 1차 메뉴(직계 a)와 '더보기' 버튼에만 — 드롭다운 패널 링크 제외 */
.nav > a::after, .nav-more-btn::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px; height: 2px;
  background: var(--accent); border-radius: 2px; opacity: .9;
  transform: scaleX(0); transform-origin: left; transition: transform .22s ease;
}
.nav-more-btn::after { left: 12px; right: 12px; }
/* 밑줄은 hover 전용. 현재 페이지는 글자색(.active)으로만 표시 */
.nav > a:hover::after,
.nav-more-btn:hover::after { transform: scaleX(1); }

/* --- primary 버튼 윤기 --- */
.btn-primary { position: relative; overflow: hidden; }
.btn-primary::before {
  content: ""; position: absolute; top: 0; left: -120%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.38), transparent);
  transform: skewX(-18deg); pointer-events: none;
}
.btn-primary:hover::before { left: 150%; transition: left .6s ease; }

/* --- 스파크라인 --- */
.spark { display: block; width: 100%; height: 100%; overflow: visible; }
.spark .spark-line { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.spark .spark-area { stroke: none; opacity: 0.13; }
.spark-up { color: var(--up); }
.spark-down { color: var(--down); }
.prog-thumb .spark-wrap { position: absolute; right: 14px; bottom: 14px; width: 88px; height: 30px; opacity: .92; }
.mock-spark { display: inline-block; vertical-align: middle; width: 60px; height: 20px; margin-right: 10px; }
.row-spark { display: inline-block; vertical-align: middle; width: 88px; height: 26px; }

/* --- 마퀴 (연동 거래소) --- */
.logos-marquee { overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.logos-track { display: flex; align-items: center; gap: 46px; width: max-content; animation: marquee 32s linear infinite; }
.logos:hover .logos-track { animation-play-state: paused; }
/* 화면 밖이면 마퀴 정지 (initAnimPause) */
.logos-marquee.anim-paused .logos-track { animation-play-state: paused; }
.logos-track span { display: inline-flex; align-items: center; white-space: nowrap; }
/* 로고월 정제: 상태 닷 제거 — 모노크롬 워드마크 톤 */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* --- 스태거 등장 --- */
.reveal { transition-delay: var(--d, 0ms); }

/* --- 스켈레톤 로딩 (카탈로그 등) --- */
.skel-card { border-radius: var(--radius-lg); border: 1px solid var(--line); background: var(--surface); overflow: hidden; }
.skel-card .skel-thumb { height: 138px; border-bottom: 1px solid var(--line); }
.skel-card .skel-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.skel-line { height: 12px; border-radius: 6px; background: var(--bg-soft); }
.skel-line.w-40 { width: 40%; } .skel-line.w-70 { width: 70%; } .skel-line.w-90 { width: 90%; }
.skel-thumb, .skel-line {
  background-image: linear-gradient(100deg, transparent 30%, var(--surface-2, rgba(255,255,255,.06)) 50%, transparent 70%);
  background-size: 200% 100%; background-repeat: no-repeat;
  animation: skel-shimmer 1.3s ease-in-out infinite;
}
@keyframes skel-shimmer { from { background-position: 180% 0; } to { background-position: -80% 0; } }
@media (prefers-reduced-motion: reduce) { .skel-thumb, .skel-line { animation: none; } }

/* --- 테마 전환 크로스페이드 --- */
html.theme-anim * { transition: background-color .28s ease, border-color .28s ease, color .2s ease, fill .2s ease, box-shadow .28s ease !important; }

/* --- 라이브 목업 (히어로) --- */
.live-dot { position: relative; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--up); margin-right: 8px; vertical-align: middle; flex-shrink: 0; }
.live-dot::after { content: ""; position: absolute; inset: -3px; border-radius: 50%; border: 1px solid var(--up); animation: live-pulse 1.9s ease-out infinite; }
/* 화면 밖이면 펄스 정지 (initAnimPause) */
.live-dot.anim-paused::after { animation-play-state: paused; }
@keyframes live-pulse { 0% { transform: scale(.5); opacity: .8; } 100% { transform: scale(1.9); opacity: 0; } }
.mock-log { display: flex; align-items: center; margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); font-family: var(--mono); font-size: 11.5px; color: var(--text-3); overflow: hidden; }
.mock-log .line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: opacity .35s ease, transform .35s ease; }
.mock-log .line.swap { opacity: 0; transform: translateY(-7px); }

/* --- 스파크라인 1회 드로우인 --- */
.spark .spark-line { stroke-dasharray: 1; stroke-dashoffset: 0; }
.spark-anim .spark-line { stroke-dashoffset: 1; animation: spark-draw 1s ease-out forwards; }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }

/* --- 보안 강조 카드 --- */
.feature.feature-secure { border-color: var(--accent-line); background: var(--grad-soft); }
.feature.feature-secure .ico { background: var(--accent); color: var(--primary-fg); border-color: transparent; }
.feature.feature-secure h3 { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.secure-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }

/* --- 프로그램 카드 거래소 태그 --- */
.prog-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 13px; }
.prog-tag { font-size: 11.5px; padding: 3px 8px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-3); white-space: nowrap; }

/* --- 관리자 페이지 --- */
.admin-tabbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-section { display: none; }
.admin-section.active { display: block; }
.field select, .field textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 11px;
  color: var(--text); padding: 11px 14px; font-family: inherit; font-size: 14.5px; outline: none;
}
.field textarea { min-height: 78px; resize: vertical; line-height: 1.5; }
.field select:focus, .field textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.badge-admin { background: rgba(139,123,255,.15); color: var(--violet); border-color: rgba(139,123,255,.32); }

/* 관리자 — 주별 신규가입 막대 차트 */
.weekly-bars { display: flex; align-items: flex-end; gap: 10px; padding: 22px; min-height: 160px; overflow-x: auto; }
.weekly-bars .wbar { flex: 1; min-width: 28px; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 130px; justify-content: flex-end; }
.weekly-bars .wbar-fill { width: 100%; max-width: 38px; min-height: 3px; border-radius: 6px 6px 0 0; background: var(--grad); transition: height .4s ease; }
.weekly-bars .wbar-n { font-size: 12px; color: var(--text-2); font-weight: 600; }
.weekly-bars .wbar-x { font-size: 11px; color: var(--text-3); }

/* 모달 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  display: none; align-items: flex-start; justify-content: center; z-index: 300; overflow-y: auto; padding: 48px 16px;
}
.modal-overlay.open { display: flex; }
.modal { width: 100%; max-width: 580px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 17px; font-weight: 700; }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 16px 22px; border-top: 1px solid var(--line); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.x-btn { width: 32px; height: 32px; border-radius: 8px; color: var(--text-3); display: grid; place-items: center; }
.x-btn:hover { background: var(--surface-2); color: var(--text); }
@media (max-width: 600px) { .form-grid { grid-template-columns: 1fr; } }

/* ============================================================
   스프린트2 — 별점·리뷰 · 온보딩 · 신뢰배지 · 체크섬 · 깔때기
   ============================================================ */

/* --- 별점(★) 컴포넌트 --- */
.stars { display: inline-flex; align-items: center; gap: 1px; line-height: 1; color: var(--amber); flex-shrink: 0; }
.stars svg { width: 1em; height: 1em; }
.stars .st { color: var(--line-strong); }
.stars .st.on { color: var(--amber); }
.stars.sm { font-size: 13px; }
.stars.lg { font-size: 22px; }
/* 카드/메타용 별+숫자 인라인 */
.rating-inline { display: inline-flex; align-items: center; gap: 5px; }
.rating-inline .rv { font-weight: 700; color: var(--text-2); }
.rating-inline .rc { color: var(--text-3); }

/* --- 리뷰 섹션 (상세) --- */
.reviews { margin-top: 44px; padding-top: 8px; }
.reviews .rv-head { font-size: 24px; margin: 0 0 18px; letter-spacing: -0.02em; font-weight: 800; }
.rv-summary { display: grid; grid-template-columns: 200px 1fr; gap: 28px; align-items: center;
  padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin-bottom: 24px; }
.rv-avg { text-align: center; }
.rv-avg .big { font-size: 52px; font-weight: 800; letter-spacing: -0.03em; line-height: 1; }
.rv-avg .cnt { color: var(--text-3); font-size: 13px; margin-top: 8px; }
.rv-avg .stars { margin-top: 10px; justify-content: center; }
.rv-dist { display: grid; gap: 7px; }
.rv-dist .row-d { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 10px; font-size: 13px; color: var(--text-3); }
.rv-dist .row-d .lbl { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.rv-bar { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.rv-bar > i { display: block; height: 100%; border-radius: 99px; background: var(--amber); transition: width .5s ease; }
.rv-bar > i.zero { background: transparent; }
.rv-list { display: grid; gap: 14px; }
.rv-item { padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.rv-item .rv-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.rv-item .rv-who { display: flex; align-items: center; gap: 10px; }
.rv-item .rv-av { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-3); color: var(--text-2);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; flex-shrink: 0; }
.rv-item .rv-nm { font-weight: 650; font-size: 14px; }
.rv-item .rv-date { font-size: 12.5px; color: var(--text-faint); font-family: var(--mono); }
.rv-item .rv-cm { color: var(--text-2); font-size: 14.5px; line-height: 1.6; white-space: pre-wrap; }
.rv-empty { padding: 36px 22px; text-align: center; color: var(--text-3); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
/* 작성 폼 */
.rv-form { margin-top: 22px; padding: 20px 22px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--grad-soft); }
.rv-form h4 { font-size: 15.5px; font-weight: 700; margin-bottom: 12px; }
.rv-stars-pick { display: inline-flex; gap: 4px; font-size: 28px; color: var(--line-strong); cursor: pointer; margin-bottom: 14px; }
.rv-stars-pick .pk { transition: color .12s, transform .12s; }
.rv-stars-pick .pk.on { color: var(--amber); }
.rv-stars-pick .pk:hover { transform: scale(1.12); }
.rv-form textarea { width: 100%; min-height: 80px; resize: vertical; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 11px; color: var(--text); padding: 11px 14px;
  font-family: inherit; font-size: 14.5px; outline: none; line-height: 1.5; }
.rv-form textarea:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.rv-locked { margin-top: 22px; padding: 20px 22px; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--radius); color: var(--text-3); font-size: 14px; }
.rv-locked .btn { margin-top: 12px; }

/* --- 다운로드 안전 안내 (SmartScreen / 체크섬) --- */
.dl-safe { margin-top: 14px; }
.dl-note { border: 1px solid var(--line); border-radius: 10px; background: var(--bg-soft); overflow: hidden; }
.dl-note summary { list-style: none; cursor: pointer; padding: 11px 14px; font-size: 12.5px; color: var(--text-2);
  display: flex; align-items: center; gap: 8px; font-weight: 600; }
.dl-note summary::-webkit-details-marker { display: none; }
.dl-note summary .chev { margin-left: auto; transition: transform .2s; color: var(--text-3); }
.dl-note[open] summary .chev { transform: rotate(90deg); }
.dl-note summary svg { width: 15px; height: 15px; color: var(--amber); flex-shrink: 0; }
.dl-note .body { padding: 0 14px 13px; font-size: 12.5px; color: var(--text-3); line-height: 1.6; }
.dl-note .body b { color: var(--text-2); }
.dl-checksum { margin-top: 10px; font-size: 11.5px; color: var(--text-3); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.dl-checksum .k { font-weight: 600; }
.dl-checksum code { font-family: var(--mono); font-size: 11px; color: var(--text-2); word-break: break-all;
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.dl-checksum .copy-sum { color: var(--text-3); cursor: pointer; display: inline-grid; place-items: center; }
.dl-checksum .copy-sum:hover { color: var(--accent); }
.dl-checksum .copy-sum svg { width: 13px; height: 13px; }

/* --- 신뢰 배지 섹션 (랜딩) --- */
.trust-band { padding: 56px 0; border-top: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.trust-card { padding: 22px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--grad-soft);
  display: flex; flex-direction: column; gap: 10px; }
.trust-card .ti { width: 40px; height: 40px; border-radius: 11px; background: var(--accent-soft); border: 1px solid var(--accent-line);
  display: grid; place-items: center; color: var(--accent); }
.trust-card .ti svg { width: 21px; height: 21px; }
.trust-card .tt { font-size: 14.5px; font-weight: 700; letter-spacing: -0.015em; }
.trust-card .td { font-size: 12.5px; color: var(--text-3); line-height: 1.55; }

/* --- 온보딩 체크리스트 (대시보드) --- */
.onb-card { margin-bottom: 28px; padding: 24px; border: 1px solid var(--accent-line); border-radius: var(--radius); background: var(--grad-soft); }
.onb-card .onb-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.onb-card .onb-h h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.onb-card .onb-sub { color: var(--text-3); font-size: 13.5px; margin-bottom: 18px; }
.onb-prog { display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.onb-prog .track { width: 90px; height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.onb-prog .track > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .5s ease; }
.onb-steps { display: grid; gap: 12px; }
.onb-step { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--line); }
.onb-step.done { opacity: .72; }
.onb-step .chk { width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  border: 1.6px solid var(--line-strong); color: var(--text-3); font-family: var(--mono); font-weight: 700; font-size: 13px; }
.onb-step.done .chk { background: var(--accent); border-color: transparent; color: var(--primary-fg); }
.onb-step .onb-body { flex: 1; }
.onb-step .onb-t { font-weight: 700; font-size: 14.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.onb-step .onb-d { color: var(--text-3); font-size: 13px; margin-top: 3px; line-height: 1.5; }
.onb-step .onb-act { margin-top: 10px; }
.onb-recos { margin-top: 18px; }
.onb-recos .lbl { font-size: 12.5px; color: var(--text-3); font-weight: 600; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 12px; }

/* --- 전환 깔때기 (관리자) --- */
.funnel { display: grid; gap: 10px; padding: 22px; }
.funnel .fn-row { display: grid; grid-template-columns: 130px 1fr; gap: 14px; align-items: center; }
.funnel .fn-lbl { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 7px; }
.funnel .fn-lbl svg { width: 15px; height: 15px; color: var(--text-3); }
.funnel .fn-bar { position: relative; height: 36px; border-radius: 9px; background: var(--surface-2); border: 1px solid var(--line); overflow: hidden; }
.funnel .fn-fill { position: absolute; inset: 0; width: 0; background: var(--grad-soft); border-right: 2px solid var(--accent); transition: width .6s ease; }
.funnel .fn-val { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); font-family: var(--mono);
  font-size: 13px; font-weight: 700; color: var(--text); z-index: 1; }
.funnel .fn-pct { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); z-index: 1; }

@media (max-width: 1000px) {
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .rv-summary { grid-template-columns: 1fr; gap: 18px; }
}
@media (max-width: 720px) {
  .trust-grid { grid-template-columns: 1fr; }
  .funnel .fn-row { grid-template-columns: 96px 1fr; }
  .rv-summary { padding: 18px; }
}

/* ============================================================
   스프린트3 — 알림센터 · 즐겨찾기 · 다운로드 이력 · 필터 · 답신
   ============================================================ */

/* --- 알림센터 (헤더 벨 + 드롭다운) --- */
.notif { position: relative; }
.notif[hidden] { display: none; }
.notif-btn {
  position: relative; width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; color: var(--text-2);
  background: var(--surface-2); border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s;
}
.notif-btn:hover { color: var(--text); border-color: var(--line-strong); }
.notif-btn svg { width: 18px; height: 18px; }
.notif.open .notif-btn { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.notif-dot {
  position: absolute; top: -5px; right: -5px; min-width: 17px; height: 17px; padding: 0 4px;
  border-radius: 999px; background: var(--down); color: #fff; border: 2px solid var(--header-bg);
  font-size: 10.5px; font-weight: 700; line-height: 13px; text-align: center;
}
.notif-dot[hidden] { display: none; }
.notif-panel {
  position: absolute; top: calc(100% + 10px); right: 0; width: 360px; max-width: calc(100vw - 24px);
  background: var(--elevated); border: 1px solid var(--line-strong); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); z-index: 120; overflow: hidden;
}
.notif-panel[hidden] { display: none; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); font-weight: 700; font-size: 14.5px; }
.notif-readall { font-size: 12.5px; color: var(--accent); font-weight: 600; padding: 4px 8px; border-radius: 7px; }
.notif-readall:hover { background: var(--accent-soft); }
.notif-list { max-height: min(420px, 60vh); overflow-y: auto; }
.notif-item { display: flex; gap: 11px; align-items: flex-start; padding: 13px 16px; border-bottom: 1px solid var(--line-faint); color: var(--text); transition: background .14s; }
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); }
.notif-item.unread:hover { background: var(--accent-soft); }
.notif-item .ni-ico { width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); }
.notif-item.unread .ni-ico { background: var(--accent-soft); color: var(--accent); }
.notif-item .ni-ico svg { width: 16px; height: 16px; }
.notif-item .ni-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.notif-item .ni-title { font-size: 13.5px; font-weight: 650; letter-spacing: -0.01em; }
.notif-item .ni-text { font-size: 12.5px; color: var(--text-3); line-height: 1.45; }
.notif-item .ni-time { font-size: 11.5px; color: var(--text-faint); font-family: var(--mono); margin-top: 2px; }
.notif-item .ni-unread { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; margin-top: 5px; }
.notif-empty { padding: 38px 22px; text-align: center; color: var(--text-3); font-size: 13.5px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.notif-empty svg { width: 30px; height: 30px; color: var(--text-faint); }

/* --- 즐겨찾기 하트 --- */
.fav-btn {
  width: 34px; height: 34px; border-radius: 10px; display: inline-grid; place-items: center;
  color: var(--text-3); background: var(--surface); border: 1px solid var(--line);
  transition: color .15s, background .15s, border-color .15s, transform .12s;
}
.fav-btn svg { width: 17px; height: 17px; }
.fav-btn:hover { color: var(--down); border-color: var(--line-strong); }
.fav-btn:active { transform: scale(.9); }
.fav-btn.on { color: var(--down); border-color: rgba(240,89,111,.32); background: rgba(240,89,111,.10); }
/* 카드 썸네일 위 하트 — 우상단 OS 태그 아래 정렬 */
.prog-thumb .fav-btn {
  position: absolute; top: 12px; right: 12px; z-index: 3; width: 32px; height: 32px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); background: rgba(19,21,25,.55); border-color: var(--line-strong); color: #fff;
}
:root[data-theme="light"] .prog-thumb .fav-btn { background: rgba(255,255,255,.7); color: var(--text-2); }
.prog-thumb .fav-btn.on { color: var(--down); background: rgba(240,89,111,.18); }
/* OS/유형 태그는 카드 종류와 무관하게 항상 우하단(.tag-os 기본 규칙) — 상단 우측 하트와 분리 */
/* 상세페이지 하트 */
.fav-detail { width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0; }
.fav-detail svg { width: 21px; height: 21px; }
.fav-detail[hidden] { display: none; }

/* --- 보강 필터 바 (거래소·가격·유형) --- */
.filter-bar { display: flex; align-items: center; gap: 18px 22px; flex-wrap: wrap; padding: 4px 0 12px; }
.filter-group { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.filter-group .fg-label { font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: 0.02em; }
.chip-sm { height: 30px; padding: 0 12px; font-size: 12.5px; gap: 5px; }
.chip .chip-x { font-size: 10px; opacity: .7; }
.chip.active .chip-x { opacity: 1; }
.active-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 0 14px; }
.active-filters[hidden] { display: none; }
.filter-reset { font-size: 12.5px; color: var(--text-3); font-weight: 600; padding: 5px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); }
.filter-reset:hover { color: var(--text); border-color: var(--line-strong); }

/* --- 관리자 의견 답신 --- */
.fb-reply { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.fb-reply-input { flex: 1; min-height: 38px; max-height: 120px; resize: vertical; background: var(--bg-soft);
  border: 1px solid var(--line); border-radius: 9px; color: var(--text); padding: 8px 11px;
  font-family: inherit; font-size: 13px; outline: none; line-height: 1.45; }
.fb-reply-input:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.fb-reply .btn { white-space: nowrap; flex-shrink: 0; }
.fb-reply-done { margin-top: 10px; padding: 11px 13px; border-radius: 10px; background: var(--accent-soft); border: 1px solid var(--accent-line); }
.fb-reply-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); }
.fb-reply-badge svg { width: 14px; height: 14px; }
.fb-reply-text { font-size: 13px; color: var(--text-2); line-height: 1.5; margin: 6px 0 8px; white-space: pre-wrap; }
.fb-row-done td:first-child { box-shadow: inset 3px 0 0 var(--accent); }

@media (max-width: 480px) {
  .notif-panel { width: calc(100vw - 24px); right: -8px; }
  .fb-reply { flex-direction: column; align-items: stretch; }
}

/* ============================================================
   스프린트5 — 추천인 바이럴(친구 초대) · 일괄 메일 컴포저
   ============================================================ */

/* --- 친구 초대(추천인) 카드 --- */
.ref-count-badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 4px 11px; }
.ref-count-badge svg { width: 15px; height: 15px; }
.ref-body { padding: 20px 22px; }
.ref-lead { font-size: 13.5px; color: var(--text-2); line-height: 1.6; margin-bottom: 18px; }
.ref-lead b { color: var(--text); }
.field-lbl-sm { display: block; font-size: 12px; color: var(--text-3); font-weight: 600; letter-spacing: 0.02em; margin-bottom: 8px; }
.ref-link-row { display: flex; gap: 8px; align-items: center; }
.ref-url { flex: 1; min-width: 0; height: 44px; padding: 0 14px; border-radius: 11px; font-size: 13.5px;
  font-family: var(--mono); background: var(--bg-soft); border: 1px solid var(--line); color: var(--text-2); outline: none; }
.ref-url:focus { border-color: var(--accent-line); box-shadow: 0 0 0 3px var(--accent-soft); }
.ref-link-row .btn { white-space: nowrap; flex-shrink: 0; }
.ref-link-row .btn svg { width: 15px; height: 15px; }
.ref-share-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ref-share-btns .btn svg { width: 15px; height: 15px; }
.ref-tiers { display: flex; gap: 8px; flex-wrap: wrap; margin: 22px 0 14px; }
.ref-tier { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 650;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--text-3); background: var(--surface); }
.ref-tier svg { width: 15px; height: 15px; }
.ref-tier.on { color: var(--tc, var(--accent)); border-color: color-mix(in srgb, var(--tc, var(--accent)) 32%, transparent); background: color-mix(in srgb, var(--tc, var(--accent)) 10%, transparent); }
.ref-tier.cur { box-shadow: 0 0 0 2px color-mix(in srgb, var(--tc, var(--accent)) 22%, transparent); font-weight: 750; }
.ref-gauge { margin-bottom: 4px; }
.ref-gauge-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); font-weight: 600; margin-bottom: 7px; }
.ref-track { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.ref-track > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .5s ease; }
.ref-referred { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 16px; }
.ref-referred-h { font-size: 13.5px; font-weight: 700; margin-bottom: 12px; }
.ref-list { list-style: none; display: grid; gap: 8px; }
.ref-list li { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); }
.ref-list .ref-av { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); }
.ref-list .ref-av svg { width: 15px; height: 15px; }
.ref-list .ref-nm { flex: 1; font-size: 13.5px; color: var(--text); font-weight: 550; }
.ref-list .ref-dt { font-size: 11.5px; color: var(--text-faint); }
.ref-empty { padding: 22px; text-align: center; font-size: 13.5px; border: 1px dashed var(--line-strong); border-radius: 11px; }
/* 사이드바 프로필 '추천 N명' 미니 배지 */
.ref-mini { display: inline-flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 11px; font-weight: 650;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 999px; padding: 2px 8px; }
.ref-mini svg { width: 12px; height: 12px; }

/* --- 일괄 메일 컴포저(관리자) --- */
.bc-wrap { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 20px; align-items: start; }
.bc-aud { display: grid; gap: 9px; }
.bc-aud-opt { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--bg-soft); cursor: pointer; font-size: 13.5px; color: var(--text-2); transition: all .15s; }
.bc-aud-opt:hover { border-color: var(--line-strong); }
.bc-aud-opt input { accent-color: var(--accent); width: 16px; height: 16px; flex-shrink: 0; }
.bc-aud-opt b { color: var(--text); font-weight: 700; }
.bc-aud-opt:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.bc-warn { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; margin: 0 0 16px;
  border-radius: 11px; background: rgba(240,89,111,.10); border: 1px solid rgba(240,89,111,.32); color: var(--down); font-size: 13px; line-height: 1.5; }
.bc-warn[hidden] { display: none; }
.bc-warn svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.bc-warn b { font-weight: 700; }
.bc-preview { position: sticky; top: 90px; }
.bc-preview-body { padding: 20px; background: var(--bg-soft); }
.bc-mail { max-width: 420px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 14px; overflow: hidden; padding: 24px 24px 18px; }
.bc-mail-brand { display: inline-block; font-weight: 800; font-size: 16px; color: var(--accent);
  background: var(--accent-soft); border-radius: 8px; padding: 4px 10px; }
.bc-mail-subject { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; margin: 14px 0 12px; color: var(--text); word-break: break-word; }
.bc-mail-text { font-size: 14px; color: var(--text-2); line-height: 1.7; word-break: break-word; }
.bc-mail-btn { display: inline-block; margin-top: 16px; background: var(--accent); color: var(--primary-fg);
  font-weight: 700; font-size: 14px; text-decoration: none; padding: 11px 22px; border-radius: 11px; }
.bc-mail-foot { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 11.5px; color: var(--text-faint); line-height: 1.6; }

@media (max-width: 900px) {
  .bc-wrap { grid-template-columns: 1fr; }
  .bc-preview { position: static; }
}
@media (max-width: 480px) {
  .ref-link-row { flex-wrap: wrap; }
  .ref-url { width: 100%; flex-basis: 100%; }
  .ref-link-row .btn { width: 100%; justify-content: center; }
}

/* --- reduced motion 존중 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* =============================================================
   커뮤니티 쇼케이스 — 공유 모달 + 피드 카드 (AlgoShare / feed.html)
   ============================================================= */
/* 공유 버튼 */
.share-btn { gap: 6px; }
.share-btn svg { width: 15px; height: 15px; }

/* 공유 모달 */
.share-ov { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center;
  justify-content: center; padding: 20px; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(3px); animation: shFade .15s ease; }
@keyframes shFade { from { opacity: 0; } to { opacity: 1; } }
.share-modal { width: 100%; max-width: 460px; max-height: calc(100vh - 40px); overflow-y: auto;
  padding: 0; box-shadow: var(--shadow-lg); }
.share-x { background: none; border: none; color: var(--text-3); font-size: 24px;
  line-height: 1; cursor: pointer; padding: 0 2px; }
.share-x:hover { color: var(--text); }
.share-lbl { display: block; font-size: 13px; font-weight: 600; color: var(--text-2);
  margin: 14px 0 6px; }
.share-modal textarea.input { min-height: 64px; resize: vertical; }
.share-disc { font-size: 11.5px; color: var(--text-3); margin: 12px 0 0; line-height: 1.5; }

/* 미리보기 카드 + 피드 카드 공용 본문 */
.share-prev, .feed-art { background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm); padding: 14px 16px; }
.sp-title, .feed-art .sp-title { font-weight: 700; font-size: 15px; margin-bottom: 10px;
  color: var(--text); }
.sp-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 5px 0; border-top: 1px solid var(--line-faint); }
.sp-row:first-of-type { border-top: none; }
.sp-k { font-size: 13px; color: var(--text-3); }
.sp-v { font-size: 14px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.sp-v.up { color: var(--up); }
.sp-v.down { color: var(--down); }

/* 피드 카드 */
.feed-card { padding: 20px 22px; margin-bottom: 16px; }
.feed-card .feed-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.feed-kind { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: 6px; font-size: 12px; font-weight: 600;
  background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
.feed-card .feed-title { font-size: 16.5px; font-weight: 700; margin: 0 0 6px; line-height: 1.4; }
.feed-note { font-size: 14px; color: var(--text-2); line-height: 1.6; margin: 0 0 14px;
  white-space: pre-wrap; word-break: break-word; }
.feed-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.feed-meta { font-size: 12.5px; color: var(--text-3); }
.feed-foot .feed-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }

/* 좋아요 버튼 */
.like-btn { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px;
  border-radius: 10px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text-3); cursor: pointer; transition: all .15s; font-size: 13.5px; font-weight: 600; }
.like-btn svg { width: 15px; height: 15px; }
.like-btn:hover { border-color: var(--down); color: var(--down); }
.like-btn.liked { background: rgba(240,89,111,0.10); border-color: rgba(240,89,111,0.32); color: var(--down); }
