/* ========================================================
   Boosters AX — Global Stylesheet (Renewal v2)
   디자인 시스템: design.md (Apple) — 화이트/파치먼트 캔버스 ↔ 니어블랙 타일,
   단일 Action Blue 액센트, 필 버튼, 헤어라인 카드, 그림자 최소화
   폰트: Pretendard (SF Pro 한글 대체 — Apple 타입 스케일 적용)
   ======================================================== */

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
  /* ---- Apple 팔레트 (design.md) ---- */
  --blue:          #0066cc;   /* Action Blue — 유일한 인터랙티브 컬러 */
  --blue-focus:    #0071e3;   /* 포커스 링 */
  --blue-on-dark:  #2997ff;   /* 다크 타일 위 링크 */
  --ink:           #1d1d1f;   /* 모든 텍스트 */
  --ink-80:        #333333;
  --ink-48:        #7a7a7a;   /* 보조/비활성 */
  --canvas:        #ffffff;
  --parchment:     #f5f5f7;   /* 시그니처 오프화이트 */
  --pearl:         #fafafc;   /* 세컨더리 버튼 필 */
  --tile-1:        #272729;   /* 니어블랙 타일 */
  --tile-2:        #2a2a2c;
  --tile-3:        #252527;
  --true-black:    #000000;   /* 글로벌 네비 전용 */
  --hairline:      #e0e0e0;   /* 1px 카드 보더 */
  --divider:       #f0f0f0;   /* 더 옅은 구분선 */
  --chip-trans:    rgba(210,210,215,.64);
  --on-dark:       #ffffff;
  --muted-on-dark: #cccccc;
  --danger:        #e53e3e;

  /* ---- 레거시 별칭 (기존 마크업/JS 호환 — 제거 금지) ---- */
  --bg:        var(--canvas);
  --bg-2:      var(--parchment);
  --bg-3:      #ececee;
  --line:      var(--hairline);
  --line-2:    #d2d2d7;
  --fg:        var(--ink);
  --fg-2:      var(--ink-80);
  --fg-3:      var(--ink-48);
  --accent:    var(--blue);
  --accent-2:  var(--blue); /* 프레스는 hex 변경이 아니라 scale(.96) — 별칭만 유지 */

  /* ---- Type (Apple 스케일 · Pretendard) ---- */
  --font-sans: 'Pretendard', system-ui, -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
  --font-mono: var(--font-sans); /* 모노 폐지 — Apple 시스템엔 모노 없음 (레거시 참조 호환용) */

  /* ---- Radius (design.md rounded 스케일) ---- */
  --r-xs: 5px; --r-sm: 8px; --r-md: 11px; --r-lg: 18px; --r-pill: 999px;
  --radius: var(--r-md);       /* 레거시 별칭 */
  --radius-lg: var(--r-lg);    /* 레거시 별칭 */

  /* ---- Layout ---- */
  --max: 1080px;
  --max-wide: 1440px;
  --gnav-h: 44px;
  --subnav-h: 52px;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.4, 0, .25, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; scrollbar-gutter: stable; } /* 탭 전환 시 스크롤바 유무로 전체가 흔들리는 현상 방지 */
html, body {
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;   /* Apple: 본문 17px, 16px 아님 */
  line-height: 1.47;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { min-height: 100vh; }

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
img, video, iframe { display: block; max-width: 100%; }

:focus-visible { outline: 2px solid var(--blue-focus); outline-offset: 2px; border-radius: 4px; }

::selection { background: rgba(0,102,204,.15); }

/* ========================================================
   Layout
   ======================================================== */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 32px;
}
.container.wide { max-width: var(--max-wide); }
@media (max-width: 720px) { .container { padding: 0 20px; } }

/* 섹션 구분은 여백과 표면 전환으로 — 가로선 없음 (Apple 그래머) */
.section { padding: 88px 0; scroll-margin-top: calc(var(--gnav-h) + var(--subnav-h) + 12px); }
.section.on-parchment { background: var(--parchment); }
@media (max-width: 720px) { .section { padding: 56px 0; } }

/* ========================================================
   Global Nav — Apple global-nav (검정 44px)
   shell.js 가 렌더. 우측 #who 는 auth.js 가 채움.
   ======================================================== */
.gnav {
  position: sticky; top: 0; z-index: 50;
  background: var(--true-black); /* 플랫 순수 블랙 — 프로스티드는 sub-nav 전용 */
}
.gnav-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
  height: var(--gnav-h);
  display: flex; align-items: center; gap: 4px;
}
.gnav-logo { display: flex; align-items: center; margin-right: 18px; flex-shrink: 0; }
/* 로고 하단을 '메인' 텍스트 하단(베이스라인)에 정렬 — 워드마크 이미지의 하단 여백 보정 */
.gnav-logo img { height: 11px; width: auto; display: block; filter: brightness(0) invert(1); opacity: .92; transform: translateY(-1px); }
.gnav-links { display: flex; align-items: center; gap: 2px; flex: 1; }
.gnav a.gnav-link {
  color: rgba(255,255,255,.8);
  font-size: 12px; letter-spacing: -.01em;
  padding: 0 12px; height: var(--gnav-h);
  display: inline-flex; align-items: center;
  transition: color .2s var(--ease);
  white-space: nowrap;
}
.gnav a.gnav-link:hover { color: #fff; }
.gnav a.gnav-link.active { color: #fff; font-weight: 600; }
.gnav .gnav-link.soon {
  color: rgba(255,255,255,.8);
  font-size: 12px; letter-spacing: -.01em;
  padding: 0 12px; height: var(--gnav-h);
  display: inline-flex; align-items: center;
  opacity: .38; cursor: default; white-space: nowrap;
}
.gnav .gnav-link.soon::after { content: '곧'; font-size: 9px; margin-left: 4px; opacity: .8; vertical-align: super; }
.gnav-right { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.gnav-right .who { display: flex; align-items: center; gap: 2px; }
.gnav-right .who > a {
  color: rgba(255,255,255,.8); font-size: 12px;
  padding: 0 10px; height: var(--gnav-h); display: inline-flex; align-items: center;
}
.gnav-right .who > a:hover { color: #fff; }
.gnav-right .who > span { color: rgba(255,255,255,.45); font-size: 11px; padding: 0 8px; }
.gnav-right .who > .nbell-wrap { padding: 0 4px; font-size: initial; color: rgba(255,255,255,.85); }

/* 모바일 햄버거 (체크박스 해킹 — 기존 패턴 유지) */
.nav-toggle-input { display: none; }
.nav-toggle-btn {
  display: none; color: rgba(255,255,255,.85);
  font-size: 19px; line-height: 1; cursor: pointer;
  padding: 8px 10px; user-select: none; margin-left: auto;
}
.gnav-collapse { display: contents; } /* 데스크톱 기본 — 미디어쿼리 갭 없음 */
@media (max-width: 834px) {
  .nav-toggle-btn { display: block; }
  .gnav-collapse { display: none; }
  .nav-toggle-input:checked ~ .gnav-collapse {
    display: flex; flex-direction: column; align-items: stretch;
    position: absolute; top: var(--gnav-h); left: 0; right: 0; z-index: 49;
    background: var(--true-black);
    padding: 8px 20px 20px;
  }
  .gnav-collapse .gnav-links { display: flex; flex-direction: column; align-items: stretch; flex: none; }
  .gnav-collapse .gnav-right { display: flex; flex-direction: column; align-items: stretch; margin-left: 0; }
  .gnav-collapse .gnav-right .who { display: flex; flex-direction: column; align-items: stretch; padding-top: 8px; }
  .gnav-collapse a.gnav-link {
    color: rgba(255,255,255,.85); font-size: 15px;
    padding: 13px 4px; height: auto;
    border-bottom: 1px solid rgba(255,255,255,.08);
    display: block;
  }
  .gnav-collapse .gnav-link.soon {
    opacity: .38; color: rgba(255,255,255,.85); font-size: 15px;
    padding: 13px 4px; height: auto; display: block;
    border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .gnav-collapse .who > a { color: rgba(255,255,255,.85); font-size: 15px; padding: 13px 4px; height: auto; display: block; }
  .gnav-collapse .who > span { color: rgba(255,255,255,.45); font-size: 12px; padding: 10px 4px 0; }
  .gnav-collapse .who > .nbell-wrap { padding: 10px 4px 0; color: rgba(255,255,255,.85); }
}

/* ---- 레거시 .header (아직 전환 안 된 페이지 호환: 라이트 프로스티드) ---- */
.header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255,255,255,.85);
  border-bottom: 1px solid var(--divider);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 52px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 14px; letter-spacing: -.01em;
}
.brand-logo { height: 15px; width: auto; display: block; }
.brand-tag {
  color: var(--ink-48); font-weight: 400; font-size: 11px;
  border-left: 1px solid var(--hairline); padding-left: 10px; margin-left: 2px;
}
.nav { display: flex; gap: 2px; align-items: center; font-size: 13px; }
.nav a {
  padding: 7px 12px; border-radius: var(--r-pill);
  color: var(--ink-80); transition: color .2s var(--ease), background .2s var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--parchment); }
.nav .who {
  font-size: 12px; color: var(--ink-48);
  padding-left: 10px; margin-left: 4px; border-left: 1px solid var(--hairline);
}
@media (max-width: 720px) {
  .header .nav-toggle-btn { display: block; color: var(--ink); }
  .nav {
    display: none; flex-direction: column; align-items: stretch; gap: 2px;
    position: absolute; top: 52px; left: 0; right: 0; z-index: 49;
    background: var(--canvas); border-bottom: 1px solid var(--divider);
    padding: 8px 20px 16px;
  }
  .nav-toggle-input:checked ~ .nav { display: flex; }
  .nav a { padding: 12px 4px; }
  .nav .who { padding: 12px 4px 4px; margin-left: 0; border-left: 0; border-top: 1px solid var(--divider); }
}

/* ---- Sub-nav (프로스티드 앵커 바 — 기존 .anchor-nav 재정의) ---- */
.anchor-nav {
  position: sticky; top: var(--gnav-h); z-index: 40;
  background: rgba(245,245,247,.8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
  overflow-x: auto;
}
.anchor-nav .container { display: flex; gap: 2px; align-items: center; height: var(--subnav-h); }
.anchor-nav a {
  padding: 6px 14px; font-size: 12px; border-radius: var(--r-pill);
  color: var(--ink-80); white-space: nowrap;
  transition: color .15s var(--ease), background .15s var(--ease);
}
.anchor-nav a:hover { color: var(--ink); background: rgba(0,0,0,.05); }
.anchor-nav .subnav-title {
  font-size: 21px; font-weight: 600; letter-spacing: .01em; color: var(--ink);
  margin-right: 14px; white-space: nowrap;
}

/* ========================================================
   Hero — Apple 타일: 센터 스택, 타이트 헤드라인, 장식 없음
   ======================================================== */
.hero { padding: 96px 0 72px; position: relative; overflow: hidden; text-align: center; }
/* 메인 첫 화면: 뷰포트 높이에 꽉 차게 (gnav 제외, 모바일 주소창 변동 대응 svh) */
.hero.hero-full {
  min-height: calc(100vh - var(--gnav-h));
  min-height: calc(100svh - var(--gnav-h));
  display: flex; align-items: center;
  padding: 40px 0;
}
.hero.hero-full .container { width: 100%; }

/* ── 모바일 다듬기 ── */
@media (max-width: 720px) {
  /* .works-toolbar 부모 셀렉터로 특이성 확보 — 뒤에 선언된 .wide(패딩 0 16px)보다 우선해야 함 */
  .works-toolbar .works-toolbar-inner, .works-toolbar .works-toolbar-inner.wide {
    flex-wrap: wrap; height: auto; padding: 10px 12px; gap: 8px;
  }
  .wt-search { order: 3; flex: 1 1 100%; max-width: none; margin-left: 0; }
  .hr-tabs { flex-wrap: wrap; justify-content: center; max-width: 100%; border-radius: var(--r-lg); }
  .session-row { flex-wrap: wrap; }
  .gl-card { height: auto; min-height: 150px; }  /* 좁은 화면에선 내용 기준 높이 */
  .cls-detail-meta { gap: 8px; }
  .hero-stat .num { font-size: 26px; }
  .rank-teaser { margin-left: 20px; margin-right: 20px; }
  .dg-wrap { max-height: 420px; }
}
.hero::before { content: none; } /* 장식 그라디언트 제거 — Apple: no decorative gradients */
.hero-meta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 600; color: var(--ink-48);
  background: var(--parchment);
  padding: 6px 14px; border-radius: var(--r-sm);
  margin-bottom: 28px;
  letter-spacing: 0;
}
.hero-meta::before { content: ''; width: 6px; height: 6px; background: var(--blue); border-radius: 50%; }
.hero h1 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.07;
  letter-spacing: -.015em;
  font-weight: 600;
  margin: 0 auto 20px;
  max-width: 800px;
}
.hero h1 em { font-style: normal; color: var(--blue); }
.hero p.lead {
  max-width: 620px; margin: 0 auto 36px;
  font-size: clamp(17px, 2.2vw, 21px); font-weight: 400;
  color: var(--ink-48); line-height: 1.45; letter-spacing: 0;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* 놀이터 히어로 키워드 (playground.html) */
.pg-keywords { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 22px; }
.pg-kw {
  display: inline-flex; align-items: center; padding: 6px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  background: var(--canvas); color: var(--ink-80);
  font-size: 13px; letter-spacing: -.01em;
}

.hero-stats {
  margin: 72px auto 0; max-width: 820px;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--parchment); border-radius: var(--r-lg);
  overflow: hidden;
}
.hero-stat { padding: 28px 8px; border-right: 1px solid rgba(0,0,0,.05); }
.hero-stat:last-child { border-right: 0; }
.hero-stat .num {
  font-size: 34px; font-weight: 600; letter-spacing: -.011em;
  font-variant-numeric: tabular-nums;
}
.hero-stat .lbl { font-size: 12px; color: var(--ink-48); margin-top: 4px; letter-spacing: 0; }
@media (max-width: 720px) {
  .hero { padding: 64px 0 56px; }
  .hero-stats { grid-template-columns: repeat(2, 1fr); }
  .hero-stat:nth-child(2) { border-right: 0; }
  .hero-stat:nth-child(1), .hero-stat:nth-child(2) { border-bottom: 1px solid rgba(0,0,0,.05); }
}

/* ========================================================
   Why-AX — 화이트 유틸리티 카드 그리드
   ======================================================== */
.why-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  border: 0; border-radius: 0; overflow: visible; background: transparent;
}
.why-cell {
  padding: 28px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  display: flex; flex-direction: column; gap: 12px;
}
.why-cell .num { font-size: 12px; font-weight: 600; color: var(--blue); letter-spacing: 0; }
.why-cell h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.why-cell p { color: var(--ink-48); font-size: 15px; line-height: 1.5; }
@media (max-width: 720px) { .why-grid { grid-template-columns: 1fr; } }

/* ========================================================
   Section header
   ======================================================== */
.sec-head {
  display: flex; justify-content: space-between; align-items: end;
  margin-bottom: 36px; gap: 20px; flex-wrap: wrap;
}
.sec-tag { font-size: 12px; font-weight: 600; color: var(--blue); letter-spacing: 0; margin-bottom: 10px; }
.sec-title { font-size: clamp(26px, 3.6vw, 40px); letter-spacing: -.011em; font-weight: 600; line-height: 1.1; }
.sec-sub { color: var(--ink-48); font-size: 16px; max-width: 520px; letter-spacing: 0; }

/* ========================================================
   Buttons — Apple 필 문법
   기본(.btn) = 펄 캡슐 / .btn-primary = 블루 필 / .btn-ghost = 고스트 필
   ======================================================== */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 22px;
  border-radius: var(--r-pill);
  font-size: 14px; font-weight: 400; letter-spacing: -.01em;
  border: 1px solid var(--divider);
  background: var(--pearl); color: var(--ink-80);
  transition: background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.btn:hover { background: #f2f2f4; color: var(--ink); }
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--blue); color: #ffffff; border-color: var(--blue);
  font-weight: 400;
}
.btn-primary:hover { background: var(--blue-focus); border-color: var(--blue-focus); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--blue); border: 1px solid var(--blue);
}
.btn-ghost:hover { background: rgba(0,102,204,.06); color: var(--blue); }
.btn-sm { padding: 7px 15px; font-size: 13px; }
.btn-icon { width: 36px; height: 36px; padding: 0; justify-content: center; border-radius: 50%; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn.danger, .btn-danger { color: var(--danger); border-color: rgba(229,62,62,.35); background: transparent; }

/* ========================================================
   Forms
   ======================================================== */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row { display: flex; flex-direction: column; gap: 8px; }
.form-row.full { grid-column: 1 / -1; }
label.lbl {
  font-size: 12px; font-weight: 600; color: var(--ink-48);
  letter-spacing: 0;
}
input[type=text], input[type=url], input[type=email], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], textarea, select {
  width: 100%;
  padding: 11px 14px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  color: var(--ink);
  font-family: inherit; font-size: 15px; letter-spacing: -.01em;
  transition: border-color .15s var(--ease);
}
textarea { min-height: 88px; resize: vertical; }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--blue-focus);
}
input::placeholder, textarea::placeholder { color: var(--ink-48); }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }

.url-tabs { display: flex; gap: 6px; }
.url-tab {
  padding: 7px 14px; border: 1px solid var(--hairline); border-radius: var(--r-pill);
  background: var(--canvas); color: var(--ink-80);
  font-size: 12px; font-weight: 400;
  transition: all .15s var(--ease);
}
.url-tab:active { transform: scale(.96); }
.url-tab.active { border: 2px solid var(--blue-focus); color: var(--ink); padding: 6px 13px; font-weight: 600; }
.hint { font-size: 12px; color: var(--ink-48); margin-top: 6px; word-break: break-all; letter-spacing: 0; }

/* Multi-select chips — Apple 컨피규레이터 칩 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 15px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas);
  color: var(--ink);
  font-size: 13px; letter-spacing: -.01em;
  cursor: pointer;
  transition: border-color .15s var(--ease), transform .12s var(--ease);
}
.chip:hover { border-color: var(--line-2); }
.chip:active { transform: scale(.96); }
.chip.active {
  border: 2px solid var(--blue-focus);
  padding: 7px 14px;
  color: var(--ink); font-weight: 600;
  background: var(--canvas);
}

/* Card — 화이트 + 헤어라인 + 18px */
.card {
  background: var(--canvas); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); padding: 28px;
}
@media (max-width: 720px) { .card { padding: 22px; } }

/* ========================================================
   Leaderboard
   ======================================================== */
.lb-filter {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin-bottom: 24px; padding: 14px 16px;
  background: var(--parchment); border: 0; border-radius: var(--r-lg);
}
.lb-filter label {
  font-size: 12px; font-weight: 600; color: var(--ink-48);
  margin-right: -6px; letter-spacing: 0;
}
.lb-filter select { width: auto; min-width: 140px; padding: 8px 12px; font-size: 13px; border-radius: var(--r-pill); }
.lb-filter .reset { margin-left: auto; }

.lb-table { width: 100%; border-collapse: collapse; }
.lb-table thead th {
  text-align: left;
  font-size: 12px; font-weight: 600; color: var(--ink-48);
  letter-spacing: 0;
  padding: 12px 16px;
  border-bottom: 1px solid var(--hairline);
}
.lb-table thead th.num { text-align: right; }
.lb-table tbody td {
  padding: 16px;
  border-bottom: 1px solid var(--divider);
  font-size: 15px;
}
.lb-table tbody tr { transition: background .15s var(--ease); }
.lb-table tbody tr:hover { background: var(--pearl); }
.lb-rank {
  font-size: 15px; font-weight: 600; color: var(--ink-48); width: 60px;
  font-variant-numeric: tabular-nums;
}
.lb-rank.top-1 { color: var(--blue); font-size: 19px; }
.lb-rank.top-2 { color: var(--ink-80); font-size: 17px; }
.lb-rank.top-3 { color: var(--ink-48); font-size: 17px; }
.lb-name { font-weight: 600; letter-spacing: -.015em; }
.lb-dept {
  display: inline-block; font-size: 11px;
  color: var(--ink-48); padding: 2px 9px;
  border: 1px solid var(--hairline); border-radius: var(--r-sm); margin-left: 8px;
  letter-spacing: 0;
}
.lb-score { font-size: 19px; font-weight: 600; text-align: right; letter-spacing: -.011em; font-variant-numeric: tabular-nums; }
.lb-breakdown { font-size: 11px; color: var(--ink-48); text-align: right; margin-top: 4px; letter-spacing: 0; }
.lb-breakdown b { color: var(--ink-80); font-weight: 600; }
@media (max-width: 720px) {
  .lb-table thead { display: none; }
  .lb-table tbody td { padding: 13px 10px; }
  .lb-rank { width: 36px; font-size: 14px; }
}

/* ========================================================
   Survival Board — 폐기 결정 (2026-07-14): 전체 숨김.
   마크업/JS 는 Phase 3 index 리빌드 때 제거 예정.
   ======================================================== */
.survival-board { display: none !important; }

/* ========================================================
   Submission cards
   ======================================================== */
.recent-toolbar { display: flex; align-items: center; margin-bottom: 20px; }
.sort-btns {
  display: flex; gap: 2px;
  background: var(--parchment); border: 0;
  border-radius: var(--r-pill); padding: 3px;
}
.sort-btn {
  padding: 6px 16px; font-size: 13px; font-weight: 400;
  border: none; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-80); cursor: pointer;
  transition: all .15s var(--ease);
}
.sort-btn:hover { color: var(--ink); }
.sort-btn:active { transform: scale(.96); }
.sort-btn.active { background: var(--canvas); color: var(--ink); font-weight: 600; border: 1px solid var(--hairline); padding: 5px 15px; }

.subs-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .subs-grid { grid-template-columns: 1fr; } }

.sub-card {
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex; flex-direction: row;
  height: 192px;
  cursor: pointer;
  transition: border-color .18s var(--ease);
}
.sub-card:hover { border-color: var(--line-2); }
.sub-card.expanded { height: 320px; }
.sub-card.expanded .sub-title { white-space: normal; overflow: visible; text-overflow: unset; flex-shrink: 0; }
.sub-card.expanded .sub-desc { -webkit-line-clamp: unset; overflow: visible; flex-shrink: 0; }
.sub-card.expanded .sub-more-btn,
.sub-card.expanded .sub-tags,
.sub-card.expanded .sub-meta,
.sub-card.expanded .comment-panel { flex-shrink: 0; }
.sub-embed {
  position: relative;
  width: 160px; flex-shrink: 0;
  background: var(--parchment);
  border-right: 1px solid var(--divider);
  overflow: hidden;
}
.sub-embed iframe { width: 100%; height: 100%; border: 0; }
.sub-embed-thumb { width: 100%; height: 100%; object-fit: cover; display: block; }
.sub-embed-open {
  position: absolute; right: 6px; bottom: 6px;
  font-size: 10px; font-weight: 600; color: #fff;
  background: rgba(29,29,31,.72); padding: 4px 9px; border-radius: var(--r-pill);
  text-decoration: none; backdrop-filter: blur(8px);
}
.sub-embed-open:hover { background: rgba(29,29,31,.9); }
.sub-thumb-ph {
  width: 100%; height: 100%; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.sub-thumb-ph::before { content: none; }
.sub-thumb-ph-text {
  position: relative; z-index: 1; max-width: 100%;
  font-weight: 600; letter-spacing: -.02em;
  color: #fff; text-align: center; line-height: 1.25; font-size: 14px;
  padding: 0 10px; word-break: break-word;
}
/* 키워드 플레이스홀더 — 니어블랙 타일 마이크로스텝 (그라디언트 폐지) */
.sub-thumb-ph-0 { background: var(--tile-1); }
.sub-thumb-ph-1 { background: var(--tile-2); }
.sub-thumb-ph-2 { background: var(--tile-3); }
.sub-thumb-ph-3 { background: #1d1d1f; }
.sub-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; overflow: hidden; }
.sub-title {
  font-weight: 600; font-size: 15px; line-height: 1.35; letter-spacing: -.015em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sub-desc {
  color: var(--ink-48); font-size: 13px; line-height: 1.5; letter-spacing: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
  cursor: default;
}
.sub-more-btn {
  align-self: flex-start;
  border: 0; background: none; padding: 0;
  font-size: 12px; color: var(--blue);
}
.sub-more-btn:hover { text-decoration: underline; }
.sub-card.expanded .sub-body { overflow-y: auto; }
.sub-meta {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 10px; border-top: 1px solid var(--divider);
  font-size: 12px; color: var(--ink-48); letter-spacing: 0;
}
.sub-author { display: flex; align-items: center; gap: 8px; }
.voter-list { font-size: 12px; color: var(--ink-48); padding-top: 6px; line-height: 1.6; flex-shrink: 0; letter-spacing: 0; }
.voter-label { color: var(--blue); margin-right: 4px; font-weight: 600; }
.sub-tags { display: flex; gap: 4px; flex-wrap: wrap; max-height: 22px; overflow: hidden; }
.sub-tag {
  font-size: 11px; letter-spacing: 0;
  padding: 2px 9px; border: 1px solid var(--hairline); border-radius: var(--r-sm);
  color: var(--ink-48);
}
.sub-tag-solution { color: var(--blue); border-color: rgba(0,102,204,.3); background: rgba(0,102,204,.05); }
@media (max-width: 480px) {
  .sub-card { height: 168px; }
  .sub-embed { width: 110px; }
  .sub-thumb-ph-text { font-size: 12px; }
}
.sub-actions { display: flex; align-items: center; gap: 8px; }
.like-btn, .comment-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px;
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  background: var(--canvas); color: var(--ink-80);
  font-size: 12px; letter-spacing: 0;
  transition: all .15s var(--ease);
}
.like-btn:hover, .comment-toggle:hover { border-color: var(--blue); color: var(--blue); }
.like-btn:active, .comment-toggle:active { transform: scale(.96); }
.like-btn.active { background: rgba(0,102,204,.07); border-color: var(--blue); color: var(--blue); font-weight: 600; }

.comment-panel { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider); }
.comment-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.comment-empty { font-size: 12px; color: var(--ink-48); }
.comment-item { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 1.5; }
.comment-author { font-size: 11px; color: var(--ink-48); font-weight: 600; letter-spacing: 0; }
.comment-text { color: var(--ink-80); word-break: break-word; }
.comment-form { display: flex; flex-direction: column; gap: 8px; }
.comment-input-wrap { position: relative; }
.comment-input {
  width: 100%; resize: vertical; min-height: 56px;
  padding: 9px 12px; border: 1px solid var(--hairline); border-radius: var(--r-md);
  background: var(--canvas); color: var(--ink); font-size: 13px;
}
.comment-form .btn { align-self: flex-end; }
.mention-dropdown {
  position: absolute; left: 0; top: 100%; z-index: 5;
  width: 100%; max-height: 180px; overflow-y: auto;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  margin-top: 2px;
}
.mention-item { padding: 8px 12px; font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.mention-item:hover { background: var(--parchment); }
.mention-dept { color: var(--ink-48); font-size: 11px; letter-spacing: 0; }
.comment-login-hint { font-size: 12px; color: var(--ink-48); }
.comment-login-hint a { color: var(--blue); }

/* ========================================================
   My page
   ======================================================== */
.profile-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .profile-grid { grid-template-columns: 1fr; } }
.stat-card {
  background: var(--parchment); border: 0; border-radius: var(--r-lg);
  padding: 28px;
}
.stat-card .label { font-size: 12px; font-weight: 600; color: var(--ink-48); letter-spacing: 0; margin-bottom: 10px; }
.stat-card .big { font-size: 40px; font-weight: 600; letter-spacing: -.011em; font-variant-numeric: tabular-nums; }
.stat-card .sub { color: var(--ink-80); font-size: 13px; margin-top: 6px; letter-spacing: 0; }

.api-key-list { display: flex; flex-direction: column; gap: 0; }
.api-key-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 13px 0; border-top: 1px solid var(--divider);
}
.api-key-item:first-child { border-top: none; }
.api-key-label { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.api-key-revoked { color: var(--ink-48); font-weight: 400; }
.api-key-meta { font-size: 12px; color: var(--ink-48); margin-top: 2px; letter-spacing: 0; }

/* ========================================================
   Admin
   ======================================================== */
/* 관리자 영역은 무조건 1단 */
.admin-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }

/* ── 밀도 높은 데이터 그리드 (AgGrid 톤) — 셀 선택/복사 가능 ── */
.dg-wrap { overflow: auto; border: 1px solid var(--hairline); border-radius: var(--r-md); max-height: 560px; }
.dg { width: 100%; border-collapse: collapse; font-size: 12.5px; letter-spacing: 0; user-select: text; }
.dg th {
  position: sticky; top: 0; z-index: 2;
  background: var(--parchment); text-align: left;
  font-size: 11px; font-weight: 600; color: var(--ink-48);
  padding: 8px 10px; border-bottom: 1px solid var(--hairline);
  border-right: 1px solid var(--divider); white-space: nowrap;
}
.dg td {
  padding: 6px 10px; border-bottom: 1px solid var(--divider);
  border-right: 1px solid var(--divider); color: var(--ink-80); white-space: nowrap;
}
.dg td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dg tr:hover td { background: var(--pearl); }
.dg input[type=text] { padding: 4px 8px; font-size: 12.5px; border-radius: 6px; min-width: 140px; }
.dg select { padding: 4px 8px; font-size: 12px; border-radius: 6px; width: auto; }
.dg .btn { padding: 4px 10px; font-size: 11.5px; }

/* ── HR 배치 보드 (드래그&드롭) ── */
.hr-tabs { display: flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px; width: fit-content; margin-bottom: 18px; }
.hr-tabs button { border: 0; background: transparent; color: var(--ink-80); font-size: 13px; padding: 6px 16px; border-radius: var(--r-pill); cursor: pointer; }
.hr-tabs button.active { background: var(--canvas); color: var(--ink); font-weight: 600; }
/* 전 컬럼 중앙 정렬 변형 (자료 아카이브) */
.dg.dg-center th, .dg.dg-center td { text-align: center; }
.dg.dg-center td a { justify-content: center; }

/* 정렬 가능한 테이블 헤더 */
.dg th[data-k] { cursor: pointer; user-select: none; white-space: nowrap; }
.dg th[data-k]:hover { color: var(--ink); }
.dg th[data-k].asc::after { content: ' ↑'; color: var(--blue); }
.dg th[data-k].desc::after { content: ' ↓'; color: var(--blue); }

/* 마스터 관리 에디터 (admin 점수·마스터 탭) */
.me-rows { display: flex; flex-direction: column; gap: 6px; }
.me-row { display: flex; gap: 6px; align-items: center; }
.me-row .me-name { flex: 1; min-width: 0; padding: 7px 12px; font-size: 13px; border-radius: var(--r-sm); }
.me-row.me-new .me-name { border-style: dashed; }

.hr-board { display: grid; grid-template-columns: 340px 1fr; gap: 20px; align-items: start; }
@media (max-width: 980px) { .hr-board { grid-template-columns: 1fr; } }
/* 좌측 크루 리스트 — 우측 커뮤니티 보드를 스크롤해도 따라오는 floating */
.hr-crew-pane {
  display: flex; flex-direction: column; gap: 10px;
  position: sticky; top: calc(var(--gnav-h) + 16px); align-self: start;
}
@media (max-width: 980px) { .hr-crew-pane { position: static; } }
.hr-crew-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.hr-crew-filters input[type=search] { flex: 1; min-width: 120px; padding: 7px 12px; font-size: 12.5px; border-radius: var(--r-pill); }
.hr-crew-filters select { width: auto; padding: 6px 10px; font-size: 12px; border-radius: var(--r-pill); }
.hr-crew-list {
  display: flex; flex-direction: column; gap: 6px;
  max-height: calc(100vh - var(--gnav-h) - 120px); overflow-y: auto;   /* 화면 높이에 맞춰 최대 확장 */
  border: 1px dashed var(--hairline); border-radius: var(--r-md); padding: 10px;
}
.hr-crew-list.dropover { border-color: var(--danger); background: rgba(229,62,62,.04); }
.crew-card {
  display: flex; align-items: center; gap: 8px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 7px 10px; cursor: grab; font-size: 13px;
}
.crew-card:active { cursor: grabbing; }
/* 미가입 크루(사내 DB 명단) — 선배치 대상 고스트 표시 */
.crew-card.ghost { border-style: dashed; background: var(--pearl); color: var(--ink-80); }
.cc-ghost-tag {
  font-size: 9px; font-weight: 600; color: var(--ink-48);
  border: 1px solid var(--hairline); border-radius: var(--r-sm); padding: 0 4px; vertical-align: 1px;
}
.member-chip-ghost {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px dashed var(--hairline) !important; background: var(--pearl) !important;
  color: var(--ink-48) !important; cursor: grab;
}
.crew-card .cc-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crew-card .cc-dept { font-size: 11px; color: var(--ink-48); flex-shrink: 0; }
.crew-card .cc-comm { flex-shrink: 0; }
.crew-card .cc-comm {
  margin-left: auto; font-size: 10px; font-weight: 600; color: var(--blue);
  border: 1px solid rgba(0,102,204,.3); border-radius: var(--r-sm); padding: 1px 6px; white-space: nowrap;
}
.crew-card .cc-comm.none { color: var(--ink-48); border-color: var(--hairline); }
.hr-comm-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.comm-box {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  padding: 12px 14px; min-height: 90px;
  transition: border-color .15s, background .15s;
}
.comm-box.dropover { border: 2px dashed var(--blue); background: rgba(0,102,204,.04); }
.comm-box h4 { font-size: 13px; font-weight: 600; margin-bottom: 8px; display: flex; justify-content: space-between; letter-spacing: -.01em; }
.comm-box h4 .cb-count { color: var(--ink-48); font-weight: 400; font-size: 11px; }
.comm-box .cb-members { display: flex; flex-wrap: wrap; gap: 4px; }
.member-chip {
  font-size: 11px; padding: 3px 9px; border: 1px solid var(--hairline);
  border-radius: var(--r-pill); background: var(--pearl); cursor: grab; letter-spacing: 0;
}
.member-chip.leader { border-color: rgba(0,102,204,.4); color: var(--blue); font-weight: 600; }
.hr-hint { font-size: 12px; color: var(--ink-48); letter-spacing: 0; }

.weights-row {
  display: grid; grid-template-columns: 80px 1fr 60px; gap: 14px; align-items: center;
  padding: 12px 0;
}
.weights-row label { font-size: 12px; font-weight: 600; color: var(--ink-80); letter-spacing: 0; }
.weights-row input[type=range] { width: 100%; accent-color: var(--blue); }
.weights-row .val { font-size: 15px; font-weight: 600; text-align: right; color: var(--blue); font-variant-numeric: tabular-nums; }
.weights-sum {
  font-size: 12px; color: var(--ink-48); letter-spacing: 0;
  margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--divider);
  display: flex; justify-content: space-between;
}
.weights-sum.invalid { color: var(--danger); }

.adm-list { display: flex; flex-direction: column; gap: 12px; }
.adm-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: center;
  padding: 16px; background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.adm-item-meta { font-size: 14px; }
.adm-item-meta .who { font-size: 12px; color: var(--ink-48); margin-top: 4px; letter-spacing: 0; }
.adm-item input[type=number] {
  width: 80px; padding: 8px; text-align: right;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-md);
  color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums;
}

/* ========================================================
   Auth pages — 파치먼트 캔버스 위 화이트 카드
   ======================================================== */
.auth-shell {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 32px 20px;
  background: var(--parchment);
}
.auth-card {
  width: 100%; max-width: 440px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  padding: 40px;
}
.auth-card .brand { margin-bottom: 32px; }
.auth-card h1 { font-size: 27px; letter-spacing: -.01em; font-weight: 600; margin-bottom: 8px; }
.auth-card p.sub { color: var(--ink-48); font-size: 15px; margin-bottom: 28px; letter-spacing: 0; }
.auth-foot { font-size: 12px; color: var(--ink-48); margin-top: 24px; text-align: center; letter-spacing: 0; }

/* ========================================================
   Toast — 잉크 다크 필
   ======================================================== */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; border: 0;
  padding: 12px 22px; border-radius: var(--r-pill);
  font-size: 14px; z-index: 1100; letter-spacing: -.01em;
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  animation: tin .25s var(--ease);
}
.toast.success { background: var(--ink); }
.toast.success::before { content: '✓  '; font-weight: 600; }
.toast.error { background: var(--danger); color: #fff; }

@keyframes tin {
  from { opacity: 0; transform: translate(-50%, 8px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

/* Empty state */
.empty {
  padding: 64px 24px; text-align: center; color: var(--ink-48);
  background: var(--parchment); border: 0; border-radius: var(--r-lg);
  font-size: 15px;
}
.empty .ico { font-size: 12px; font-weight: 600; color: var(--blue); letter-spacing: 0; margin-bottom: 12px; }

/* Loading */
.loading { font-size: 13px; color: var(--ink-48); letter-spacing: 0; }
.loading::after {
  content: ''; display: inline-block; width: 7px; height: 7px;
  background: var(--blue); border-radius: 50%; margin-left: 8px;
  animation: pulse 1s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: .3; transform: scale(1); }
  50%      { opacity: 1;  transform: scale(1.2); }
}

/* Footer — 파치먼트 파인프린트 (표면 전환이 곧 구분선) */
.footer {
  padding: 48px 0; background: var(--parchment);
  font-size: 12px; color: var(--ink-48); letter-spacing: 0;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}

/* Hidden util */
.hide { display: none !important; }

/* 탭 섹션 전환: 부드러운 페이드 (플리커 방지) */
section[data-atab]:not(.hide), section[data-mtab]:not(.hide), #hr-tab-board:not(.hide), #hr-tab-metrics:not(.hide) {
  animation: tabfade .22s var(--ease);
}
@keyframes tabfade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* =====================
   모달 — 화이트 시트 + 블러 오버레이
   ===================== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  overflow-y: auto;
}
.modal-box {
  background: var(--canvas);
  border: 0;
  border-radius: var(--r-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,.2);
  width: 100%; max-width: 600px;
  max-height: calc(100vh - 40px);
  display: flex; flex-direction: column;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--divider);
  flex-shrink: 0;
}
.modal-title { font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin: 0; }
.modal-close {
  background: var(--parchment); border: none; color: var(--ink-80);
  font-size: 15px; line-height: 1; cursor: pointer;
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s, transform .12s var(--ease);
}
.modal-close:hover { background: var(--bg-3); color: var(--ink); }
.modal-close:active { transform: scale(.92); }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 8px; }
@media (max-width: 640px) {
  .modal-box { border-radius: var(--r-lg); }
  .modal-head, .modal-body { padding-left: 16px; padding-right: 16px; }
}

/* ========================================================
   다크 타일 유틸리티
   ======================================================== */
.tile-dark { background: var(--tile-1); color: var(--on-dark); }
.tile-dark a { color: var(--blue-on-dark); }
.tile-dark .muted { color: var(--muted-on-dark); }
.tile-parchment { background: var(--parchment); }

/* ========================================================
   홈 랜딩 — 풀블리드 교차 타일 (Apple 뮤지엄 그래머)
   ======================================================== */
.home-tile { padding: 108px 0; text-align: center; }

/* 메인: 모든 섹션을 첫 화면처럼 뷰포트 크기로 + 세로 페이지네이션 스냅 (데스크톱) */
@media (min-width: 981px) {
  html:has(body.snap-home) { scroll-snap-type: y mandatory; }
  body.snap-home .hero.hero-full {
    scroll-snap-align: start; scroll-snap-stop: always; scroll-margin-top: var(--gnav-h);
  }
  body.snap-home .home-tile {
    min-height: calc(100svh - var(--gnav-h));
    display: flex; flex-direction: column; justify-content: center;
    padding: 60px 0;
    scroll-snap-align: start; scroll-snap-stop: always; scroll-margin-top: var(--gnav-h);
  }
  body.snap-home .footer { scroll-snap-align: end; }
}
.home-tile.t-dark   { background: var(--tile-1); color: var(--on-dark); }
.home-tile.t-dark2  { background: var(--tile-2); color: var(--on-dark); }
.home-tile.t-parch  { background: var(--parchment); }
/* 타일 타이포/여백은 히어로(첫 화면)와 동일 스케일 — 작아 보이거나 몰려 보이지 않게 */
.home-tile .eyebrow {
  font-size: 13px; font-weight: 600; color: var(--blue);
  margin-bottom: 26px; letter-spacing: 0;
}
.home-tile.t-dark .eyebrow, .home-tile.t-dark2 .eyebrow { color: var(--blue-on-dark); }
.home-tile h2 {
  font-size: clamp(34px, 5.4vw, 56px); font-weight: 600;   /* = .hero h1 */
  line-height: 1.07; letter-spacing: -.015em;
  margin: 0 auto 20px; max-width: 800px;
}
.home-tile .tagline {
  font-size: clamp(17px, 2.2vw, 21px); font-weight: 400; letter-spacing: 0;  /* = .hero .lead */
  color: var(--ink-48); max-width: 620px; margin: 0 auto 36px; line-height: 1.45;
}
.home-tile.t-dark .tagline, .home-tile.t-dark2 .tagline { color: var(--muted-on-dark); }
.home-tile .tile-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.home-tile .btn-soon { opacity: .6; pointer-events: none; }
.tile-dark-note { font-size: 12px; color: rgba(255,255,255,.62); margin-top: 18px; letter-spacing: 0; }
/* 다크 타일 위 고스트 버튼: 블루 대신 화이트 라인 */
.t-dark .btn-ghost, .t-dark2 .btn-ghost { color: #fff; border-color: rgba(255,255,255,.45); }
.t-dark .btn-ghost:hover, .t-dark2 .btn-ghost:hover { background: rgba(255,255,255,.08); color: #fff; }
@media (max-width: 720px) {
  .home-tile { padding: 64px 0; }
  .hl-strip, .duo-grid { padding: 0 20px; }
}

/* 스크롤 리빌 */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }

/* 하이라이트 스트립 (다크 타일 위 최근 작업 카드) */
.hl-strip {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
  max-width: var(--max); margin: 44px auto 34px; padding: 0 32px;
  text-align: left;
}
.hl-card {
  background: var(--tile-2); border-radius: var(--r-lg); overflow: hidden;
  cursor: pointer; display: flex; flex-direction: column;
  transition: transform .25s var(--ease);
}
.t-dark2 .hl-card { background: var(--tile-3); }
.hl-card:hover { transform: translateY(-3px); }
.hl-card:active { transform: translateY(-1px) scale(.98); }
.hl-thumb { aspect-ratio: 16/9; background: var(--tile-3); overflow: hidden; position: relative; }
.hl-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hl-thumb .ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.85); font-weight: 600; font-size: 16px; letter-spacing: -.01em;
  padding: 0 18px; text-align: center; line-height: 1.3;
}
.hl-body { padding: 16px 18px 18px; }
.hl-title {
  color: #fff; font-size: 15px; font-weight: 600; letter-spacing: -.01em;
  line-height: 1.35; margin-bottom: 6px;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.hl-meta { color: var(--muted-on-dark); opacity: .85; font-size: 12px; letter-spacing: 0; }
@media (max-width: 834px) { .hl-strip { grid-template-columns: 1fr; } }

/* 랭킹 티저 (파치먼트 타일 위 top3) */
.rank-teaser {
  max-width: 560px; margin: 36px auto 30px;
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  overflow: hidden; text-align: left;
}
.rt-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 22px; border-top: 1px solid var(--divider);
}
.rt-row:first-child { border-top: 0; }
.rt-rank { font-size: 17px; font-weight: 600; width: 34px; color: var(--ink-48); font-variant-numeric: tabular-nums; }
.rt-row:first-child .rt-rank { color: var(--blue); }
.rt-name { font-weight: 600; font-size: 15px; letter-spacing: -.01em; flex: 1; }
.rt-sub { font-size: 12px; color: var(--ink-48); letter-spacing: 0; }
.rt-score { font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 지식/사전 듀오 카드 */
.duo-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
  max-width: 880px; margin: 40px auto 0; padding: 0 32px; text-align: left;
}
.duo-card {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 32px; display: flex; flex-direction: column; gap: 10px;
}
.t-parch .duo-card { border: 0; }
.duo-card h3 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; }
.duo-card p { font-size: 15px; color: var(--ink-48); letter-spacing: 0; line-height: 1.5; flex: 1; }
.duo-card .duo-cta { color: var(--blue); font-size: 14px; }
.duo-card .duo-cta.soon { color: var(--ink-48); }
@media (max-width: 720px) { .duo-grid { grid-template-columns: 1fr; } }

/* ========================================================
   작업물 — 마스터-디테일 (works.html)
   ======================================================== */
.works-toolbar {
  position: sticky; top: var(--gnav-h); z-index: 40;
  background: rgba(245,245,247,.85);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--divider);
}
/* 기본: .container(max 1080/패딩 32)와 좌우 라인 일치 */
.works-toolbar-inner {
  max-width: var(--max); margin: 0 auto; padding: 0 32px;
  height: var(--subnav-h);
  display: flex; align-items: center; gap: 14px;
}
/* 와이드(마스터-디테일) 페이지: 풀폭 + 리스트 내부 패딩(16px)과 좌측 라인 일치 */
.works-toolbar-inner.wide { max-width: none; padding: 0 16px; }
.works-toolbar .wt-title { font-size: 21px; font-weight: 600; letter-spacing: .01em; white-space: nowrap; }
.wt-tabs { display: flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px; }
.wt-tab {
  border: 0; background: transparent; color: var(--ink-80);
  font-size: 13px; padding: 5px 14px; border-radius: var(--r-pill);
  cursor: pointer; white-space: nowrap; transition: all .15s var(--ease);
}
.wt-tab:active { transform: scale(.96); }
.wt-tab.active { background: var(--canvas); color: var(--ink); font-weight: 600; }
.wt-search {
  flex: 1; max-width: 320px; margin-left: auto;
  display: flex; align-items: center;
}
.wt-search input {
  width: 100%; height: 34px; padding: 0 16px;
  border-radius: var(--r-pill); font-size: 13px;
  background: var(--canvas); border: 1px solid var(--hairline);
}
/* 풀폭 마스터-디테일 — 좌 리스트는 좁게, 우 본문 최대화 */
.works-shell {
  max-width: none; margin: 0;
  display: grid; grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - var(--gnav-h) - var(--subnav-h));
}
.works-list {
  border-right: 1px solid var(--divider);
  overflow-y: auto;
  height: calc(100vh - var(--gnav-h) - var(--subnav-h));
  position: sticky; top: calc(var(--gnav-h) + var(--subnav-h));
}
.wl-filters {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;   /* 2×2 균등 정렬 */
  padding: 12px 16px; border-bottom: 1px solid var(--divider);
  background: var(--canvas); position: sticky; top: 0; z-index: 2;
}
.wl-filters select {
  width: 100%; padding: 6px 10px; font-size: 12px;
  border-radius: var(--r-sm); border-color: var(--divider);
}
.wl-count { font-size: 12px; color: var(--ink-48); padding: 10px 16px 4px; letter-spacing: 0; }
.wl-item {
  display: flex; gap: 12px; align-items: center;
  padding: 13px 16px; cursor: pointer;
  border-bottom: 1px solid var(--divider);
  transition: background .15s var(--ease);
}
.wl-item:hover { background: var(--pearl); }
.wl-item.active { background: var(--parchment); }
.wl-body { flex: 1; min-width: 0; }
.wl-title {
  font-size: 11.5px; font-weight: 600; letter-spacing: -.01em; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.wl-byline { font-size: 12px; color: var(--ink-80); margin-top: 4px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wl-meta {
  display: flex; justify-content: space-between; gap: 8px;
  font-size: 11px; color: var(--ink-48); margin-top: 3px; letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}
.wl-meta .wl-cnt { flex-shrink: 0; }
.wl-title .wl-badge { font-size: 9px; vertical-align: 0; padding: 0 4px; margin-right: 5px; }
.wl-badge {
  display: inline-block; font-size: 10px; font-weight: 600; color: var(--blue);
  border: 1px solid rgba(0,102,204,.3); border-radius: var(--r-sm);
  padding: 0 5px; margin-right: 4px; vertical-align: 1px;
}

/* 멀티 첨부 드롭존 (작업물 올리기 모달) */
.dropzone {
  border: 1.5px dashed var(--hairline); border-radius: var(--r-md);
  padding: 22px 16px; text-align: center; cursor: pointer;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.dropzone:hover, .dropzone.dz-over { border-color: var(--blue); background: rgba(0,102,204,.04); }
.dz-hint { font-size: 13.5px; color: var(--ink-80); }
.dz-hint .dz-browse { color: var(--blue); font-weight: 600; }
.dz-sub { font-size: 11.5px; color: var(--ink-48); margin-top: 4px; letter-spacing: 0; }
.dz-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dz-item {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 7px 10px;
  background: var(--parchment); border-radius: var(--r-sm);
}
.dz-item.done { background: rgba(0,102,204,.06); }
.dz-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dz-state { color: var(--ink-48); font-size: 11px; flex-shrink: 0; letter-spacing: 0; }
.dz-item.done .dz-state { color: var(--blue); }
.dz-rm { border: 0; background: transparent; color: var(--ink-48); cursor: pointer; font-size: 12px; padding: 2px 4px; border-radius: var(--r-sm); flex-shrink: 0; }
.dz-rm:hover { color: var(--danger); }

/* 상세 첨부 리스트 — 아래 태그 영역과 여백 분리 */
.wd-attach { display: flex; flex-direction: column; gap: 6px; margin: 14px 0 28px; }
.wd-attach-item {
  display: inline-flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%;
  font-size: 13px; color: var(--ink); text-decoration: none;
  background: var(--parchment); border-radius: var(--r-sm); padding: 8px 12px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wd-attach-item:hover { background: var(--pearl); color: var(--blue); }

/* 디테일 페인 — 우측 라인을 툴바(16px)와 일치 */
.works-detail { padding: 34px 16px 80px 44px; min-width: 0; }
.wd-empty {
  height: 60vh; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; color: var(--ink-48);
  font-size: 15px;
}
.wd-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.wd-title { font-size: clamp(22px, 2.6vw, 30px); font-weight: 600; letter-spacing: -.011em; line-height: 1.2; flex: 1 1 320px; }
/* 한 줄 정렬: 제목 + 바로 우측 액션(세로 중앙) + 우측 끝 작성자/부서/작성일 (제목과 같은 라인) */
.wd-head { margin-bottom: 14px; }
.wd-titlerow { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.wd-titlerow .wd-title { flex: 0 1 auto; }   /* 액션이 제목 '바로 우측'에 붙도록 (끝까지 밀지 않음) */
.wd-titlerow .wd-actions { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.wd-byline {
  font-size: 13px; color: var(--ink-48); letter-spacing: 0;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.wd-titlerow .wd-byline { margin-left: auto; flex-shrink: 0; }  /* works: 제목과 같은 라인 우측 끝 */
.wd-actions .icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; color: var(--ink-80);
}
.wd-actions .icon-btn.danger:hover { color: var(--danger); border-color: var(--danger); }
/* 드라이브 프리뷰 우측 상단 팝아웃 아이콘 클릭 차단 (투명 레이어) */
.wv-popout-block { position: absolute; top: 0; right: 0; width: 60px; height: 60px; z-index: 4; }
.wd-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
/* 라이브 뷰어 탭 (대표 링크 + 첨부파일) */
.wd-viewer-tabs {
  display: flex; gap: 2px; flex-wrap: wrap;
  background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px;
  width: fit-content; max-width: 100%; margin-bottom: 10px;
}
.wv-tab {
  border: 0; background: transparent; color: var(--ink-80);
  font-size: 12.5px; padding: 5px 14px; border-radius: var(--r-pill);
  cursor: pointer; white-space: nowrap; max-width: 240px;
  overflow: hidden; text-overflow: ellipsis;
  transition: all .15s var(--ease);
}
.wv-tab:active { transform: scale(.96); }
.wv-tab.active { background: var(--canvas); color: var(--ink); font-weight: 600; }
.wv-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -14px 0 22px;
}
.wv-hint { font-size: 11.5px; color: var(--ink-48); letter-spacing: 0; }
.wv-open { font-size: 12.5px; color: var(--blue); text-decoration: none; white-space: nowrap; margin-left: auto; }
.wv-open:hover { text-decoration: underline; }

.wd-embed {
  border-radius: var(--r-lg); overflow: hidden;
  background: var(--parchment); margin-bottom: 22px;
  aspect-ratio: 16 / 9; position: relative;
}
.wd-embed iframe { width: 100%; height: 100%; border: 0; display: block; }
/* 가상 해상도 스케일 래퍼 — iframe 크기/transform 은 applyViewerScale(JS)이 지정 */
.wd-embed .wv-scale-wrap { overflow: hidden; }
.wd-embed .wv-scale-wrap iframe { width: auto; height: auto; }
.wd-embed.wv-pan { overflow: auto; }              /* 확대 시 가로 패닝 */
.wv-zoomcatch { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.wv-zoomcatch.on { pointer-events: auto; }
.wv-zoom { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; }
.wv-zoom button {
  border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink-80);
  font-size: 12px; line-height: 1; padding: 4px 9px; border-radius: var(--r-pill); cursor: pointer;
}
.wv-zoom button:active { transform: scale(.96); }
.wv-zoom #wv-zoom-val { font-size: 11.5px; color: var(--ink-48); min-width: 38px; text-align: center; font-variant-numeric: tabular-nums; }
.wv-bar .wv-zoom + .wv-open { margin-left: 12px; }
.wd-embed img { width: 100%; height: 100%; border: 0; object-fit: contain; display: block; }
.wd-embed.tall { aspect-ratio: auto; height: min(80vh, 940px); }
.wd-embed .ph {
  width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--tile-1); color: #fff; font-size: 24px; font-weight: 600;
  letter-spacing: -.015em; padding: 0 40px; text-align: center; line-height: 1.3;
}
/* 미리보기 행 — AI 요약이 있으면 오른쪽 일부(280px)를 요약 패널에 할애 */
.wd-preview { margin-bottom: 22px; }
.wd-preview .wd-embed { margin-bottom: 0; }
.wd-preview .wv-col { min-width: 0; }
.wd-preview .wv-bar { margin: 8px 0 0; }   /* 뷰어 바: embed 의 margin 이 0 이므로 음수 마진 대신 위쪽 여백 */
.wd-preview.with-ai {
  display: grid; grid-template-columns: minmax(0, 1fr) 280px;
  gap: 14px; align-items: stretch;
}
.wd-ai {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  background: var(--parchment);
  padding: 18px 20px; min-height: 0; overflow-y: auto;
}
.wd-ai-label { font-size: 12px; font-weight: 600; color: var(--blue); margin-bottom: 10px; }
.wd-ai-text { font-size: 13px; line-height: 1.75; color: var(--ink-80); white-space: pre-line; word-break: break-word; }
.wd-ai.pending .wd-ai-text { color: var(--ink-48); animation: ai-pulse 1.6s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (max-width: 980px) {
  .wd-preview.with-ai { grid-template-columns: 1fr; }
  .wd-ai { max-height: 220px; }
}
.wd-desc { font-size: 16px; line-height: 1.6; color: var(--ink-80); letter-spacing: -.005em; margin-bottom: 20px; white-space: pre-wrap; word-break: break-word; }
.wd-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 28px; }
.wd-section-label { font-size: 13px; font-weight: 600; color: var(--ink-48); margin: 28px 0 12px; letter-spacing: 0; }

/* 업데이트 타임라인 */
.timeline { display: flex; flex-direction: column; }
.tl-item { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-item::before {
  content: ''; position: absolute; left: 5px; top: 16px; bottom: 0;
  width: 1px; background: var(--hairline);
}
.tl-item:last-child::before { display: none; }
.tl-dot {
  width: 11px; height: 11px; border-radius: 50%; flex-shrink: 0;
  background: var(--canvas); border: 2px solid var(--blue); margin-top: 4px;
}
.tl-item.old .tl-dot { border-color: var(--line-2); }
.tl-body { min-width: 0; }
.tl-note { font-size: 14px; color: var(--ink); letter-spacing: -.005em; }
.tl-meta { font-size: 12px; color: var(--ink-48); margin-top: 2px; letter-spacing: 0; }
.tl-src {
  display: inline-block; font-size: 10px; font-weight: 600;
  border: 1px solid var(--hairline); border-radius: var(--r-sm);
  padding: 0 5px; margin-left: 6px; color: var(--ink-48); vertical-align: 1px;
}
.tl-src.agent { color: var(--blue); border-color: rgba(0,102,204,.3); }

/* 모바일: 리스트 우선, 디테일은 오버레이 */
@media (max-width: 980px) {
  .works-shell { grid-template-columns: 1fr; }
  .works-list { border-right: 0; height: auto; position: static; }
  .works-detail {
    display: none;
  }
  .works-detail.open {
    display: block; position: fixed; inset: 0; top: var(--gnav-h);
    background: var(--canvas); z-index: 60; overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 20px 80px;
  }
  .wd-back { display: inline-flex !important; margin-bottom: 16px; }
}
/* 태블릿(721~980px): 툴바 한 줄 유지 + 가로 스크롤 허용 (≤720px에선 wrap 규칙 우선) */
@media (min-width: 721px) and (max-width: 980px) {
  .works-toolbar-inner { flex-wrap: nowrap; overflow-x: auto; }
}
.wd-back { display: none; }

/* 랭킹 페이지 토글 */
.rk-toggle { display: flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px; }
.rk-toggle button {
  border: 0; background: transparent; color: var(--ink-80);
  font-size: 13px; padding: 5px 16px; border-radius: var(--r-pill); cursor: pointer;
}
.rk-toggle button.active { background: var(--canvas); color: var(--ink); font-weight: 600; }

/* 알림 종 (헤더) */
.nbell-wrap { position: relative; display: inline-flex; align-items: center; }
.nbell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border: 0; background: transparent; color: inherit;
  cursor: pointer; border-radius: 50%; padding: 0;
}
.nbell:hover { opacity: .7; }
.nbadge {
  position: absolute; top: -2px; right: -4px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff; font-size: 9.5px; font-weight: 700;
  border-radius: 999px; display: inline-flex; align-items: center; justify-content: center;
  letter-spacing: 0; line-height: 1;
}
.npanel {
  position: absolute; top: 36px; right: -8px; width: 340px; max-width: 90vw;
  background: var(--canvas); color: var(--ink);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  box-shadow: rgba(0,0,0,.22) 3px 5px 30px; z-index: 200;
  overflow: hidden; text-align: left;
}
.npanel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-bottom: 1px solid var(--divider);
  font-size: 13px; font-weight: 600;
}
.nread-all { border: 0; background: none; color: var(--blue); font-size: 12px; cursor: pointer; }
.nlist { max-height: 380px; overflow-y: auto; }
.nitem {
  display: flex; gap: 10px; padding: 11px 16px; text-decoration: none; color: var(--ink);
  border-bottom: 1px solid var(--divider);
}
.nitem:last-child { border-bottom: 0; }
.nitem:hover { background: var(--pearl); }
.nitem.unread { background: rgba(0,102,204,.05); }
.nicon { flex-shrink: 0; font-size: 13px; width: 18px; text-align: center; }
.nbody { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ntitle { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.ntext { font-size: 12px; color: var(--ink-48); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }
.ntime { font-size: 10.5px; color: var(--ink-48); letter-spacing: 0; }

/* 클래스 상세: 본문(소개+톡)이 좌측 컬럼을 꽉 채움 — 헤더/카드 좌측 라인 일치, 카드 간격 20px 통일 */
.cls-main { width: 100%; display: flex; flex-direction: column; gap: 20px; }

/* 강의 소개 접기/펼치기 */
.intro-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  border: 0; background: none; padding: 0; cursor: pointer; text-align: left;
}
.intro-caret { font-size: 12px; color: var(--ink-48); }

/* 클래스 톡 — 슬랙식 패널: 대화는 내부 스크롤, 입력창 항상 하단 */
.chat-card { display: flex; flex-direction: column; min-height: 380px; }

/* 상세(신청 화면): 목록용 필터 툴바는 무의미 — 숨김 (좌우 정렬 불일치도 함께 해소) */
body.cls-detail-open .works-toolbar { display: none; }

/* 상세(신청 화면)는 뷰포트에 고정 — 페이지 세로 스크롤 없음, 채팅/사이드만 내부 스크롤 (데스크톱) */
@media (min-width: 981px) {
  body.cls-detail-open { overflow: hidden; }
  #cls-detail-view { padding-bottom: 20px; }
  #cls-detail-view .container {
    height: calc(100vh - var(--gnav-h) - 40px);   /* 툴바 숨김 → 그만큼 화면 확장 */
    display: flex; flex-direction: column;
  }
  #cls-detail { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  #cls-detail .cls-detail-head { flex-shrink: 0; }
  #cls-detail .cls-body { flex: 1; min-height: 0; align-items: stretch; }
  #cls-detail .cls-main { height: 100%; min-height: 0; }
  #cls-detail .chat-card { flex: 1; min-height: 0; }
  #cls-detail .cls-side { position: static; max-height: 100%; }
  #cd-intro-body { max-height: 30vh; overflow-y: auto; }  /* 소개가 길어도 채팅 공간 확보 */
}
/* 모바일: 일반 문서 흐름 유지 */
@media (max-width: 980px) {
  .chat-card { height: 70vh; }
}
.chat-topbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.chat-chips { display: flex; gap: 2px; flex-wrap: wrap; background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px; }
.chat-chip {
  border: 0; background: transparent; color: var(--ink-80);
  font-size: 12px; padding: 4px 12px; border-radius: var(--r-pill); cursor: pointer; white-space: nowrap;
}
.chat-chip:active { transform: scale(.96); }
.chat-chip.active { background: var(--canvas); color: var(--ink); font-weight: 600; }
.chat-below { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-top: 4px; min-height: 16px; }
/* 첨부 대기 칩 (여러 개 · 개별 제거) */
#chat-file-name { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chat-pend {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--ink-80); letter-spacing: 0;
  background: var(--parchment); border-radius: var(--r-pill); padding: 3px 6px 3px 10px;
}
.chat-pend-size { color: var(--ink-48); font-size: 10.5px; }
.chat-pend-rm { border: 0; background: none; color: var(--ink-48); cursor: pointer; font-size: 11px; padding: 0 3px; }
.chat-pend-rm:hover { color: var(--danger); }

/* 채팅 이미지 썸네일 (메시지 2줄 높이) + 라이트박스 */
.chat-img-wrap { display: inline-flex; margin: 6px 8px 0 0; vertical-align: top; }
.chat-img {
  height: 48px; width: auto; max-width: 200px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--hairline);
  cursor: zoom-in; display: block;
}
.chat-img:hover { border-color: var(--blue); }
.il-overlay {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(0,0,0,.82);
  display: none; align-items: center; justify-content: center; flex-direction: column; gap: 12px;
  cursor: zoom-out;
}
.il-overlay.on { display: flex; }
.il-img {
  max-width: 90vw; max-height: 86vh; border-radius: var(--r-sm);
  transform-origin: center center; cursor: default;
  box-shadow: rgba(0,0,0,.22) 3px 5px 30px;
}
.il-name { color: rgba(255,255,255,.7); font-size: 12.5px; letter-spacing: 0; }

/* 클래스 톡 (클래스 내 질문/대화 아카이브) */
.class-chat {
  display: flex; flex-direction: column; gap: 14px;
  flex: 1; min-height: 0; overflow-y: auto; padding: 4px 2px 12px;
}
.chat-msg { border-bottom: 1px solid var(--divider); padding-bottom: 12px; }
.chat-msg:last-child { border-bottom: 0; }
/* 메시지 헤드 — 회차/이름/부서/시간을 글자 베이스라인 기준으로 정밀 정렬 */
.chat-head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; line-height: 1.3; }
.chat-head b { font-weight: 600; }
.chat-head b.me { color: var(--blue); }   /* 내가 쓴 메시지 — 파란 이름 */
.chat-head .chat-sess { align-self: center; transform: translateY(-1px); }
.chat-dept { font-size: 11px; color: var(--ink-48); }
.chat-time { font-size: 11px; color: var(--ink-48); letter-spacing: 0; }
.chat-del { margin-left: auto; border: 0; background: none; color: var(--ink-48); cursor: pointer; font-size: 12px; align-self: center; }
.chat-del:hover { color: var(--danger); }
.chat-body { font-size: 14px; line-height: 1.6; color: var(--ink); margin-top: 4px; white-space: pre-wrap; word-break: break-word; letter-spacing: 0; }
.chat-form { display: flex; gap: 8px; align-items: stretch; margin-top: 12px; border-radius: var(--r-md); }
.chat-form.dz-over { outline: 2px dashed var(--blue); outline-offset: 4px; }
.chat-form .comment-input-wrap { display: flex; }
.chat-form .chat-input { min-height: 120px; width: 100%; }   /* 기본 5줄 */
.chat-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; justify-content: flex-end; }
.chat-actions .btn { width: 100%; }
.chat-sess {
  display: inline-flex; align-items: center; font-size: 10px; font-weight: 600;
  color: var(--blue); border: 1px solid rgba(0,102,204,.3); border-radius: var(--r-sm);
  padding: 0 5px; letter-spacing: 0; flex-shrink: 0;
}
.mention-item.active { background: var(--parchment); }

/* 사이드 첨부자료 리스트 */
.mat-item {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 8px; border-radius: var(--r-sm); text-decoration: none; color: var(--ink);
  font-size: 12.5px;
}
.mat-item:hover { background: var(--pearl); }
.mat-item .mat-ico { flex-shrink: 0; font-size: 12px; }
.mat-item .mat-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0; }

/* ========================================================
   커서 로봇 (메인 페이지 — js/robot.js)
   원본 디자인 유지: 잉크/화이트, 안테나 글로우, 봅 모션
   ======================================================== */
.cr-robot {
  position: fixed; left: 0; top: 0; width: 120px; height: 140px;
  pointer-events: none; z-index: 45; /* gnav(50)/모달(1000) 아래 */
  will-change: transform;
}
.cr-bob {
  width: 100%; height: 100%;
  animation: cr-bob 3.2s ease-in-out infinite;
  display: flex; flex-direction: column; align-items: center;
}
/* follow 모드: 안테나 끝이 커서에 정확히 붙어야 하므로 봅 모션 제거 */
.cr-robot.follow .cr-bob { animation: none; }
.cr-antenna { width: 3px; height: 14px; background: var(--ink); border-radius: 2px; }
.cr-antenna-tip {
  width: 10px; height: 10px; border-radius: 50%; background: var(--ink);
  margin-top: -3px; animation: cr-antenna-glow 2.4s ease-in-out infinite;
}
.cr-head {
  width: 104px; height: 96px; background: #fff;
  border: 3px solid var(--ink); border-radius: 30px; margin-top: 4px;
  display: flex; flex-direction: column; align-items: center;
  box-shadow: 0 10px 24px rgba(17,17,17,.14); /* 로봇=콘텐츠 이미지 취급 — 유일한 섀도 규칙 적용 */
  will-change: transform;
}
.cr-logo { width: 62px; height: 16px; object-fit: contain; margin: 10px 0 2px; }
.cr-face {
  width: 78px; height: 44px; background: var(--ink); border-radius: 16px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; gap: 14px; overflow: hidden;
}
.cr-eye { width: 12px; height: 18px; background: #fff; border-radius: 7px; will-change: transform; }
.cr-body {
  width: 56px; height: 26px; background: #fff;
  border: 3px solid var(--ink); border-radius: 14px 14px 18px 18px; margin-top: -6px;
}
.cr-shadow {
  width: 64px; height: 10px; background: var(--ink); border-radius: 50%;
  margin-top: 10px; opacity: .16; animation: cr-shadow-pulse 3.2s ease-in-out infinite;
}
.cr-ripple {
  position: fixed; width: 56px; height: 56px;
  border: 3px solid var(--ink); border-radius: 50%;
  pointer-events: none; z-index: 44;
  animation: cr-ripple .5s ease-out forwards;
}
@keyframes cr-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes cr-shadow-pulse { 0%, 100% { transform: scaleX(1); opacity: .18; } 50% { transform: scaleX(.82); opacity: .12; } }
@keyframes cr-antenna-glow { 0%, 100% { box-shadow: 0 0 6px 2px rgba(17,17,17,.25); } 50% { box-shadow: 0 0 10px 4px rgba(17,17,17,.45); } }
@keyframes cr-ripple { 0% { transform: translate(-50%,-50%) scale(.2); opacity: .5; } 100% { transform: translate(-50%,-50%) scale(1); opacity: 0; } }
@media (max-width: 834px) { .cr-robot { display: none; } .cr-ripple { display: none; } } /* 모바일은 커서가 없어 비표시 */

/* ========================================================
   Class 818 / 커뮤니티
   ======================================================== */
.cls-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .cls-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .cls-grid { grid-template-columns: 1fr; } }
.cls-card {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 26px; cursor: pointer; display: flex; flex-direction: column; gap: 10px;
  transition: border-color .18s var(--ease);
}
.cls-card:hover { border-color: var(--line-2); }
.cls-status {
  align-self: flex-start; font-size: 11px; font-weight: 600;
  padding: 3px 9px; border-radius: var(--r-sm); letter-spacing: 0;
}
.cls-status.open   { color: #fff; background: var(--blue); }            /* 모집중 강조 */
.cls-status.closed { color: var(--ink-48); background: var(--bg-3); }
.cls-status.done   { color: var(--ink-48); background: var(--bg-3); }
/* 마감/종료 카드는 회색 음영으로 확연히 구분 */
.cls-card.dim { background: var(--parchment); border-color: var(--divider); }
.cls-card.dim h3, .cls-card.dim .cls-community { color: var(--ink-48); }
.cls-card.dim:hover { border-color: var(--line-2); }
.cls-status.draft  { color: var(--warn, #d97706); background: rgba(217,119,6,.08); }
.cls-card h3 { font-size: 19px; font-weight: 600; letter-spacing: -.01em; line-height: 1.3; }
.cls-card .cls-community { font-size: 13px; color: var(--blue); font-weight: 600; letter-spacing: 0; }
.cls-card .cls-meta { font-size: 13px; color: var(--ink-48); letter-spacing: 0; line-height: 1.6; margin-top: auto; }

/* 클래스 상세 */
/* 헤더 한 줄: 목록으로 · 제목 · 상태태그 (좌) — 주최/강사/신청/액션 (우) — 전 요소 세로 중앙 정밀 정렬 */
.cls-detail-head { margin-bottom: 20px; }
.cls-head-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.cls-head-row .cls-status {
  align-self: center; flex-shrink: 0;   /* 베이스 align-self:flex-start 무효화 */
  line-height: 1; display: inline-flex; align-items: center;
  transform: translateY(1px);           /* 제목 글자의 시각적 중심(하프리딩 보정)에 맞춤 */
}
.cls-head-title {
  font-size: clamp(20px, 2.2vw, 28px); font-weight: 600; letter-spacing: -.011em;
  margin: 0; min-width: 0; flex: 0 1 auto; line-height: 1.2;
}
.cls-detail-meta {
  font-size: 14px; color: var(--ink-48); display: flex; gap: 10px; flex-wrap: wrap;
  align-items: center; letter-spacing: 0; margin-left: auto;
}
.cls-detail-meta > span { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.cls-detail-meta .btn { flex-shrink: 0; }
.cls-body {
  display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start;
}
@media (max-width: 980px) { .cls-body { grid-template-columns: 1fr; } .cls-side { position: static; } }
.cls-content { min-width: 0; }
/* 우측 사이드: floating(sticky) — 길어지면 사이드 안에서 스크롤 (스크롤바는 숨김) */
.cls-side {
  display: flex; flex-direction: column; gap: 20px;
  position: sticky; top: calc(var(--gnav-h) + var(--subnav-h) + 16px);
  max-height: calc(100vh - var(--gnav-h) - var(--subnav-h) - 32px);
  overflow-y: auto;
  scrollbar-width: none;             /* Firefox */
}
.cls-side::-webkit-scrollbar { display: none; }   /* Chrome/Edge/Safari */
/* 모바일 1열: sticky/내부 스크롤 해제 (베이스 규칙보다 뒤에 선언해야 이김) */
@media (max-width: 980px) {
  .cls-side { position: static; max-height: none; overflow: visible; }
}
.session-list { display: flex; flex-direction: column; }
.session-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 0; border-top: 1px solid var(--divider); font-size: 14px;
}
.session-row:first-child { border-top: 0; }
.session-no { font-size: 12px; font-weight: 600; color: var(--blue); width: 44px; flex-shrink: 0; padding-top: 2px; }
.session-main { flex: 1; min-width: 0; }
.session-time { letter-spacing: 0; }
.session-meta-line { font-size: 12px; color: var(--ink-48); letter-spacing: 0; margin-top: 2px; }
.session-meta-line:empty { display: none; }
/* 겹치는 일정: 일자 아래 한 줄로 작게 (줄바꿈 최소화) */
.session-conflict-line {
  font-size: 11px; color: var(--danger); letter-spacing: 0; margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-ok-line { font-size: 11px; color: var(--blue); letter-spacing: 0; margin-top: 2px; }
.session-room { font-size: 12px; color: var(--ink-48); flex-shrink: 0; padding-top: 2px; }
.session-edit-btn {
  border: 0; background: none; color: var(--ink-48); cursor: pointer;
  font-size: 12px; padding: 2px 6px; border-radius: var(--r-sm); flex-shrink: 0;
}
.session-edit-btn:hover { color: var(--blue); background: var(--parchment); }
.session-check { font-size: 13px; flex-shrink: 0; padding-top: 2px; }
.session-check.ok { color: var(--blue); }
.session-check.conflict { color: var(--danger); }

/* 참석자/멤버 그리드 */
.people-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border: 1px solid var(--hairline); border-radius: var(--r-pill);
  font-size: 13px; line-height: 1.2; background: var(--canvas);
}
.person-chip .p-dept { font-size: 11px; color: var(--ink-48); line-height: 1.2; }
.person-chip.leader { border-color: rgba(0,102,204,.4); color: var(--blue); font-weight: 600; background: rgba(0,102,204,.08); }

/* 출석 관리 테이블 */
.att-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.att-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--ink-48); padding: 8px 6px; border-bottom: 1px solid var(--hairline); }
.att-table td { padding: 8px 6px; border-bottom: 1px solid var(--divider); }
.att-btn {
  border: 1px solid var(--hairline); background: var(--canvas); border-radius: var(--r-pill);
  font-size: 11px; padding: 3px 10px; cursor: pointer; color: var(--ink-80);
}
.att-btn.on-attend { border-color: var(--blue); color: var(--blue); font-weight: 600; background: rgba(0,102,204,.06); }
.att-btn.on-noshow { border-color: var(--danger); color: var(--danger); font-weight: 600; background: rgba(229,62,62,.06); }

/* Editor.js 읽기 렌더 — 지식 문서 타이포그래피 */
.ed-h { font-size: 22px; font-weight: 600; letter-spacing: -.01em; margin: 30px 0 10px; }
h3.ed-h { font-size: 18px; }
.ed-p { font-size: 16px; line-height: 1.7; color: var(--ink-80); margin: 12px 0; letter-spacing: -.005em; word-break: break-word; }
.ed-p b { color: var(--ink); }
ul.ed-list { margin: 12px 0 12px 22px; font-size: 16px; line-height: 1.75; color: var(--ink-80); }
ul.ed-list li { margin: 4px 0; }
.ed-list li b { color: var(--ink); }
/* 순서 목록 = 원본 위키의 '파란 원형 번호 스텝' 룩 */
ol.ed-list {
  margin: 14px 0; padding: 0; list-style: none;
  counter-reset: edstep;
  font-size: 15px; line-height: 1.65; color: var(--ink-80);
}
ol.ed-list li {
  counter-increment: edstep;
  position: relative; padding: 7px 0 7px 40px; margin: 0;
}
ol.ed-list li::before {
  content: counter(edstep);
  position: absolute; left: 0; top: 7px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--blue); color: #fff;
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ed-quote {
  margin: 18px 0; padding: 14px 20px; border-left: 3px solid var(--blue);
  background: var(--parchment); border-radius: 0 var(--r-md) var(--r-md) 0;
  font-size: 15px; line-height: 1.65; color: var(--ink-80); letter-spacing: 0;
}
.ed-quote-label { font-size: 12px; font-weight: 700; color: var(--blue); margin-bottom: 6px; }
.ed-quote-warn { border-left-color: var(--danger); }
.ed-quote-warn .ed-quote-label { color: var(--danger); }
.ed-quote cite { display: block; font-size: 13px; color: var(--ink-48); margin-top: 6px; font-style: normal; }
.ed-delim { text-align: center; color: var(--ink-48); letter-spacing: .5em; margin: 22px 0; }
.ed-empty { color: var(--ink-48); font-size: 15px; }
/* 코드 블록 — 니어블랙 타일 (코드는 콘텐츠 — 모노 서체 허용) */
.ed-pre {
  background: #16161a; color: #e8e8ea;   /* 원본 위키 코드블록 톤 */
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 13px; line-height: 1.75; letter-spacing: 0;
  padding: 20px 24px; border-radius: var(--r-md);
  margin: 16px 0; overflow-x: auto; white-space: pre;
}
.ed-pre .cd-comment { color: #7d8590; }
.ed-pre .cd-str { color: #7ee787; }
.ed-pre .cd-key { color: #a5a3ff; }
.ed-code-inline {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: .88em; background: rgba(0,0,0,.06);
  padding: 1px 6px; border-radius: 5px; color: var(--ink);
}
.ed-quote .ed-code-inline { background: rgba(0,0,0,.08); }
/* 테이블 */
.ed-table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--hairline); border-radius: var(--r-md); }
.ed-table { width: 100%; border-collapse: collapse; font-size: 14px; letter-spacing: 0; }
.ed-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-48);
  padding: 10px 14px; background: var(--parchment); border-bottom: 1px solid var(--hairline);
}
.ed-table td { padding: 10px 14px; border-bottom: 1px solid var(--divider); color: var(--ink-80); line-height: 1.55; }
.ed-table tr:last-child td { border-bottom: 0; }
/* 플로 (A → B → C) */
.ed-flow { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 16px 0; }
.ed-flow-box { background: var(--parchment); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 8px 14px; font-size: 13px; }
.ed-flow-arrow { color: var(--ink-48); }

/* 에디터 쓰기 영역 — Editor.js 의 +/⋮ 툴바가 왼쪽 거터에 뜨므로 좌측 여백 확보 */
.editor-holder {
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 18px 22px 18px 52px; min-height: 200px; background: var(--canvas);
  position: relative; overflow: visible;
}
.editor-holder .codex-editor__redactor { padding-bottom: 60px !important; }
.editor-holder .ce-toolbar__plus,
.editor-holder .ce-toolbar__settings-btn {
  color: var(--ink-48); background: var(--canvas);
  border: 1px solid var(--divider); border-radius: var(--r-sm);
  width: 24px; height: 24px;
}
.editor-holder .ce-toolbar__plus:hover,
.editor-holder .ce-toolbar__settings-btn:hover { background: var(--parchment); color: var(--ink); }
.editor-holder .ce-block--selected .ce-block__content { background: rgba(0,102,204,.06); }

/* 미니 캘린더 — 카드 안에서 가운데 정렬 */
.mini-cal {
  display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; justify-content: center;
  margin-top: 12px; padding: 14px; background: var(--parchment); border-radius: var(--r-md);
}
.mc-legend { justify-content: center; }
.mc-month { }
.mc-title { font-size: 12px; font-weight: 600; margin-bottom: 6px; letter-spacing: 0; }
.mc-dows, .mc-grid { display: grid; grid-template-columns: repeat(7, 24px); gap: 2px; }
.mc-dows span { font-size: 9px; color: var(--ink-48); text-align: center; }
.mc-day {
  width: 24px; height: 24px; font-size: 11px; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; color: var(--ink-80);
}
.mc-blank { visibility: hidden; }
.mc-day.mc-ok       { background: var(--blue); color: #fff; font-weight: 600; }
.mc-day.mc-conflict { background: var(--danger); color: #fff; font-weight: 600; }
.mc-day.mc-session  { border: 2px solid var(--blue); font-weight: 600; }
.mc-legend { display: flex; gap: 12px; font-size: 11px; color: var(--ink-48); align-items: center; width: 100%; letter-spacing: 0; }
.mc-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.mc-dot.mc-ok { background: var(--blue); }
.mc-dot.mc-conflict { background: var(--danger); }
.mc-dot.mc-session { border: 2px solid var(--blue); width: 7px; height: 7px; }
.session-conflict-with { font-size: 11px; color: var(--danger); }

/* 세션 빌더 (개설 모달) */
.sess-type-tabs { display: flex; gap: 6px; }
.dow-picker { display: flex; gap: 6px; flex-wrap: wrap; }
.dow-picker .chip { padding: 6px 12px; }
.sess-preview { display: flex; flex-direction: column; gap: 4px; max-height: 180px; overflow-y: auto; }
.sess-preview-row {
  display: flex; align-items: center; gap: 10px; font-size: 13px;
  padding: 7px 12px; background: var(--parchment); border-radius: var(--r-sm); letter-spacing: 0;
}
.sess-preview-row .del { margin-left: auto; cursor: pointer; color: var(--ink-48); border: 0; background: none; font-size: 13px; }
.sess-preview-row .del:hover { color: var(--danger); }
.room-avail { font-size: 12px; color: var(--ink-48); letter-spacing: 0; }
.room-avail b { color: var(--blue); font-weight: 600; }

/* ========================================================
   AX 지식 트리 / 용어사전
   ======================================================== */
.kn-row {
  display: flex; align-items: center; gap: 2px;
  height: 30px; padding-right: 8px;
  border-radius: var(--r-sm); cursor: pointer;
  transition: background .12s var(--ease);
}
.kn-row:hover { background: var(--pearl); }
.kn-row.active { background: var(--parchment); }
.kn-row.active .kn-title { font-weight: 600; color: var(--ink); }
.kn-caret {
  border: 0; background: none; cursor: pointer; flex-shrink: 0;
  width: 18px; height: 18px; font-size: 10px; color: var(--ink-48);
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.kn-caret:hover { background: rgba(0,0,0,.05); }
.kn-caret.empty { pointer-events: none; }
.kn-title {
  font-size: 13px; color: var(--ink-80); letter-spacing: -.01em; line-height: 1;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.kn-draft {
  font-size: 10px; font-weight: 600; color: var(--danger);
  border: 1px solid rgba(229,62,62,.3); border-radius: var(--r-sm);
  padding: 0 5px; margin-left: 6px;
}
/* 문서 본문은 영역 중앙 정렬 (좌측 치우침 방지) */
#kn-doc { max-width: 860px; margin: 0 auto; }
.kn-content { max-width: 760px; }

/* stretch: 한 카드가 열리면 같은 행의 카드도 같은 높이로 늘어남 */
.gl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: stretch; }
@media (max-width: 834px) { .gl-grid { grid-template-columns: 1fr; } }
.gl-card {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 8px;
  height: 100%; min-height: 172px; overflow: hidden;   /* 접힘 = 클램프로 통일, 행 높이 공유 */
  transition: border-color .18s var(--ease);
}
.gl-card.has-demo, .gl-card:has(.gl-expand-hint) { cursor: pointer; }
.gl-card:hover { border-color: var(--line-2); }
.gl-card.expanded { height: auto; }
.gl-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.gl-ko { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }
.gl-en { font-size: 14px; color: var(--blue); }
.gl-demo-tag {
  font-size: 10px; font-weight: 600; color: var(--blue);
  border: 1px solid rgba(0,102,204,.35); background: rgba(0,102,204,.06);
  border-radius: var(--r-sm); padding: 1px 7px;
}
.gl-desc {
  font-size: 14px; line-height: 1.6; color: var(--ink-80); letter-spacing: 0;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.gl-card.expanded .gl-desc { -webkit-line-clamp: unset; overflow: visible; }
.gl-more { display: none; flex-direction: column; gap: 10px; }
.gl-card.expanded .gl-more { display: flex; }
.gl-expand-hint { margin-top: auto; font-size: 12px; color: var(--blue); letter-spacing: 0; }
.gl-ex {
  font-size: 13px; line-height: 1.55; color: var(--ink-80); letter-spacing: 0;
  background: var(--parchment); border-radius: var(--r-md); padding: 10px 14px;
}
.gl-ex b { color: var(--blue); font-weight: 600; margin-right: 4px; }
.gl-card mark { background: rgba(0,102,204,.15); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── 라이브 데모 프레임 (.gd-*) ── */
.gd-frame {
  position: relative; overflow: hidden;
  background: var(--parchment); border-radius: var(--r-md);
  min-height: 150px; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  font-size: 13px; color: var(--ink-80); letter-spacing: 0;
}
.gd-center { display: flex; align-items: center; gap: 8px; position: relative; }
.gd-gap { gap: 10px; }
.gd-col { display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 300px; position: relative; }
.gd-center-col { align-items: center; }
.gd-dim { font-size: 11px; color: var(--ink-48); }
.gd-btn {
  border: 1px solid var(--hairline); background: var(--canvas); color: var(--ink);
  font-size: 13px; padding: 8px 18px; border-radius: var(--r-pill); cursor: pointer;
  transition: transform .12s var(--ease);
}
.gd-btn:active { transform: scale(.95); }
.gd-btn.gd-primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.gd-btn.gd-ghost { background: transparent; color: var(--blue); border-color: var(--blue); }
.gd-btn.gd-sm { font-size: 12px; padding: 5px 13px; }
.gd-input { width: 100%; padding: 8px 12px; font-size: 13px; border: 1px solid var(--hairline); border-radius: var(--r-md); }
.gd-overlay {
  position: absolute; inset: 0; background: rgba(0,0,0,.4); z-index: 5;
  display: flex; align-items: center; justify-content: center;
}
.gd-overlay-right { justify-content: flex-end; align-items: stretch; }
.gd-sheet {
  background: #fff; border-radius: var(--r-md); padding: 16px; max-width: 84%;
  display: flex; flex-direction: column; gap: 8px; box-shadow: 0 12px 32px rgba(0,0,0,.2);
}
.gd-sheet-title { font-weight: 600; font-size: 14px; }
.gd-sheet-body { font-size: 12px; color: var(--ink-80); line-height: 1.5; }
.gd-drawer {
  background: #fff; width: 45%; padding: 14px; display: flex; flex-direction: column; gap: 8px;
  font-size: 13px; transform: translateX(100%); transition: transform .25s var(--ease);
}
.gd-drawer.in { transform: translateX(0); }
.gd-toast {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 12px;
  padding: 8px 16px; border-radius: var(--r-pill); white-space: nowrap;
  animation: tin .25s var(--ease); z-index: 6;
  display: flex; gap: 10px; align-items: center;
}
.gd-undo { border: 0; background: none; color: var(--blue-on-dark); font-size: 12px; cursor: pointer; }
.gd-tip-target {
  display: inline-flex; width: 18px; height: 18px; border-radius: 50%;
  background: var(--ink); color: #fff; font-size: 11px;
  align-items: center; justify-content: center; cursor: help;
}
.gd-tooltip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; font-size: 11px; padding: 6px 10px;
  border-radius: var(--r-sm); white-space: nowrap; z-index: 6;
}
.gd-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 6;
  background: #fff; border: 1px solid var(--hairline); border-radius: var(--r-md);
  box-shadow: 0 8px 24px rgba(0,0,0,.12); overflow: hidden; min-width: 130px;
}
.gd-popover > div { padding: 8px 14px; font-size: 12px; cursor: pointer; }
.gd-popover > div:hover { background: var(--parchment); }
.gd-ac-list { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--divider); background: #fff; }
.gd-ac-list:empty { display: none; }
.gd-ac-item { padding: 7px 12px; font-size: 13px; cursor: pointer; }
.gd-ac-item:hover { background: var(--parchment); }
.gd-ac-item b { color: var(--blue); }
.gd-acc { background: #fff; border: 1px solid var(--divider); border-radius: var(--r-md); overflow: hidden; }
.gd-acc-head { padding: 9px 13px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; }
.gd-acc-body { display: none; padding: 0 13px 10px; font-size: 12px; color: var(--ink-48); }
.gd-acc.open .gd-acc-body { display: block; }
.gd-acc.open .gd-acc-head span { transform: rotate(180deg); }
.gd-tabs { display: flex; gap: 2px; background: rgba(0,0,0,.05); border-radius: var(--r-pill); padding: 3px; align-self: center; }
.gd-tab { border: 0; background: transparent; font-size: 12px; padding: 4px 12px; border-radius: var(--r-pill); cursor: pointer; color: var(--ink-80); }
.gd-tab.active { background: #fff; font-weight: 600; color: var(--ink); }
.gd-tab-body { text-align: center; font-size: 12px; color: var(--ink-48); }
.gd-card { background: #fff; border: 1px solid var(--hairline); border-radius: var(--r-md); overflow: hidden; width: 200px; }
.gd-card-thumb { height: 64px; background: var(--tile-1); }
.gd-card-body { padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.gd-card-body span { color: var(--ink-48); font-size: 11px; }
.gd-bell { position: relative; font-size: 20px; }
.gd-badge {
  position: absolute; top: -6px; right: -8px; background: var(--danger); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: var(--r-pill); padding: 1px 5px;
}
.gd-label-badge { font-size: 10px; font-weight: 700; color: var(--blue); border: 1px solid rgba(0,102,204,.35); border-radius: var(--r-sm); padding: 1px 6px; }
.gd-chip { border: 1px solid var(--hairline); background: #fff; font-size: 12px; padding: 5px 13px; border-radius: var(--r-pill); cursor: pointer; }
.gd-chip.on { border: 2px solid var(--blue-focus); font-weight: 600; padding: 4px 12px; }
.gd-skel { height: 12px; border-radius: 6px; background: linear-gradient(90deg, #e8e8ec 25%, #f5f5f7 50%, #e8e8ec 75%); background-size: 200% 100%; animation: gd-shimmer 1.2s infinite; }
.gd-skel-title { height: 16px; width: 70%; }
@keyframes gd-shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.gd-spinner {
  display: inline-block; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--hairline); border-top-color: var(--blue);
  animation: gd-spin .8s linear infinite; vertical-align: -3px;
}
.gd-spinner-sm { width: 12px; height: 12px; border-width: 2px; }
@keyframes gd-spin { to { transform: rotate(360deg); } }
.gd-progress { position: relative; width: 100%; max-width: 260px; height: 22px; background: #fff; border: 1px solid var(--divider); border-radius: var(--r-pill); overflow: hidden; }
.gd-progress-fill { height: 100%; width: 0; background: var(--blue); transition: width .18s; }
.gd-progress-txt { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; color: var(--ink); mix-blend-mode: difference; color: #fff; }
.gd-crumb { font-size: 13px; color: var(--ink-48); }
.gd-crumb a { color: var(--blue); cursor: pointer; }
.gd-crumb b { color: var(--ink); }
.gd-page { width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--hairline); background: #fff; font-size: 12px; cursor: pointer; }
.gd-page.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.gd-scroll { width: 100%; max-width: 260px; height: 96px; overflow-y: auto; background: #fff; border: 1px solid var(--divider); border-radius: var(--r-md); }
.gd-row-item { padding: 7px 12px; font-size: 12px; border-bottom: 1px solid var(--divider); }
.gd-nav { display: flex; gap: 14px; align-items: center; background: var(--true-black); color: rgba(255,255,255,.75); font-size: 12px; padding: 10px 16px; border-radius: var(--r-md); width: 100%; max-width: 280px; }
.gd-nav b { color: #fff; font-size: 11px; letter-spacing: .04em; }
.gd-nav .on { color: #fff; font-weight: 600; }
.gd-mini-screen { position: relative; width: 100%; max-width: 280px; height: 110px; background: #fff; border: 1px solid var(--divider); border-radius: var(--r-md); padding: 12px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; transition: background .3s, color .3s; }
.gd-mini-screen.gd-theme span { color: var(--ink-48); font-size: 12px; }
.gd-mini-screen.dark { background: var(--tile-1); color: #fff; border-color: var(--tile-1); }
.gd-mini-screen.dark span { color: var(--muted-on-dark); }
.gd-fab { position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--blue); color: #fff; font-size: 18px; cursor: pointer; transition: transform .25s var(--ease); }
.gd-switch { position: relative; width: 42px; height: 24px; border-radius: 12px; border: 0; background: #d2d2d7; cursor: pointer; transition: background .2s; }
.gd-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: left .2s var(--ease); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.gd-switch.on { background: var(--blue); }
.gd-switch.on::after { left: 20px; }
.gd-seg { display: flex; background: rgba(0,0,0,.05); border-radius: var(--r-sm); padding: 2px; }
.gd-seg button { border: 0; background: transparent; font-size: 12px; padding: 5px 16px; border-radius: 6px; cursor: pointer; color: var(--ink-80); }
.gd-seg button.on { background: #fff; font-weight: 600; color: var(--ink); box-shadow: none; }
.gd-avatar { width: 34px; height: 34px; border-radius: 50%; color: #fff; font-size: 13px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.gd-avatar-more { background: var(--parchment); color: var(--ink-48); border: 1px solid var(--hairline); font-size: 11px; }
.gd-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-48); }
.gd-empty b { color: var(--ink); }
.gd-heart { border: 0; background: none; font-size: 26px; color: var(--ink-48); cursor: pointer; transition: color .15s; line-height: 1; }
.gd-heart.liked { color: var(--danger); }
.gd-heart.pop { animation: gd-pop .35s var(--ease); }
@keyframes gd-pop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }

/* 커뮤니티 카드 */
.comm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 980px) { .comm-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .comm-grid { grid-template-columns: 1fr; } }
/* 히어로 상단 로봇 슬롯 (BOOSTERS AX 텍스트 대체) */
.hero-robot-slot { height: 78px; margin: 0 auto 24px; width: 120px; }
@media (max-width: 834px) { .hero-robot-slot { display: none; } }  /* 모바일은 로봇 미장착 */

/* 아카이브 타일 지표 (다크 배경 세그먼트) */
.arc-stats {
  margin: 40px auto 36px; max-width: 560px;
  display: grid; grid-template-columns: repeat(3, 1fr);
  background: rgba(255,255,255,.07); border-radius: var(--r-lg); overflow: hidden;
}
.arc-stat { padding: 24px 8px; text-align: center; border-right: 1px solid rgba(255,255,255,.08); }
.arc-stat:last-child { border-right: 0; }
.arc-stat .num { font-size: 30px; font-weight: 600; color: #fff; font-variant-numeric: tabular-nums; }
.arc-stat .lbl { font-size: 12px; color: rgba(255,255,255,.55); margin-top: 4px; letter-spacing: 0; }

/* 메인 Class 818 타일 지표 — 히어로 지표(hero-stats)와 동일한 세그먼트 박스 문법 */
.cls-tile-stats {
  margin: 44px auto 40px; max-width: 460px;
  display: grid; grid-template-columns: repeat(2, 1fr);
  background: var(--parchment); border-radius: var(--r-lg); overflow: hidden;
}
.cls-tile-stat { padding: 26px 8px; border-right: 1px solid rgba(0,0,0,.05); text-align: center; }
.cls-tile-stat:last-child { border-right: 0; }
.cls-tile-stat .num {
  font-size: 32px; font-weight: 600; letter-spacing: -.011em;
  font-variant-numeric: tabular-nums;
}
.cls-tile-stat .lbl { font-size: 12px; color: var(--ink-48); margin-top: 4px; letter-spacing: 0; }

/* 내 소속 커뮤니티 — 연한 파란 음영으로 구분 */
.comm-card.mine { background: rgba(0,102,204,.05); border-color: rgba(0,102,204,.3); }
.comm-card {
  background: var(--canvas); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  padding: 26px; cursor: pointer; transition: border-color .18s var(--ease);
}
.comm-card:hover { border-color: var(--line-2); }
.comm-card h3 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.comm-card .cls-status { transform: translateY(4px); } /* 제목 시각 중심과 정렬 */
.comm-card .comm-leader { font-size: 13px; color: var(--blue); font-weight: 600; margin-bottom: 12px; letter-spacing: 0; }
.comm-card .comm-stats { font-size: 13px; color: var(--ink-48); display: flex; gap: 14px; letter-spacing: 0; }
