/* Nexus 공통 스타일 — 듀얼 테마 시스템 (Option 1: Deep Obsidian vs Option 2: Titanium Mono). 라이트/다크 지원. */

/* [기본 / Option 1: Deep Obsidian & Cyber Cyan (Linear / Raycast 감성)] */
:root, [data-theme-style="obsidian"] {
  --bg: #f8fafc; --panel: #ffffff; --panel-elevated: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #0284c7; --brand-hover: #0369a1; --brand-weak: #e0f2fe; --brand-accent: #00e5ff;
  --danger: #ef4444; --side-bg: #0d111a; --side-text: #94a3b8; --side-active: #ffffff;
  --card-radius: 14px; --btn-radius: 10px;
  /* 상태 색 */
  --pj-red: #ef4444;   --pj-red-line: rgba(239,68,68,.35);   --pj-red-bg: rgba(239,68,68,.08);
  --pj-green: #10b981; --pj-green-line: rgba(16,185,129,.35); --pj-green-bg: rgba(16,185,129,.08);
  --pj-blue: #0284c7;  --pj-blue-line: rgba(2,132,199,.35);  --pj-blue-bg: rgba(2,132,199,.08);
  --pj-amber: #f59e0b; --pj-amber-line: rgba(245,158,11,.35); --pj-amber-bg: rgba(245,158,11,.10);
  --pj-teal: #14b8a6;  --pj-teal-bg: rgba(20,184,166,.10);
  --pj-slate: #64748b; --pj-slate-bg: rgba(100,116,139,.12);
  --pj-leaf: #22c55e;  --pj-leaf-bg: rgba(34,197,94,.12);
}

[data-theme="dark"], [data-theme-style="obsidian"][data-theme="dark"] {
  --bg: #0a0d14; --panel: #111622; --panel-elevated: #161c2b; --text: #f1f5f9; --muted: #8b9bb4; --line: rgba(255,255,255,0.08);
  --brand: #00e5ff; --brand-hover: #38bdf8; --brand-weak: rgba(0, 229, 255, 0.12); --brand-accent: #818cf8;
  --side-bg: #07090e; --side-text: #8b9bb4; --side-active: #00e5ff;
  --danger: #f87171;
  --pj-red: #f87171;   --pj-red-line: rgba(248,113,113,.40);   --pj-red-bg: rgba(248,113,113,.13);
  --pj-green: #34d399; --pj-green-line: rgba(52,211,153,.40);  --pj-green-bg: rgba(52,211,153,.13);
  --pj-blue: #38bdf8;  --pj-blue-line: rgba(56,189,248,.40);   --pj-blue-bg: rgba(56,189,248,.13);
  --pj-amber: #fbbf24; --pj-amber-line: rgba(251,191,36,.40);  --pj-amber-bg: rgba(251,191,36,.13);
  --pj-teal: #2dd4bf;  --pj-teal-bg: rgba(45,212,191,.14);
  --pj-slate: #94a3b8; --pj-slate-bg: rgba(148,163,184,.14);
  --pj-leaf: #4ade80;  --pj-leaf-bg: rgba(74,222,128,.14);
}

/* [Option 2: Titanium Mono & Terminal Amber (Vercel / Zed 감성)] */
[data-theme-style="titanium"] {
  --bg: #ffffff; --panel: #f7f7f8; --panel-elevated: #f0f0f2; --text: #0a0a0a; --muted: #6b6b76; --line: #e5e5e7;
  --brand: #ea580c; --brand-hover: #c2410c; --brand-weak: #ffedd5; --brand-accent: #f59e0b;
  --danger: #ef4444; --side-bg: #fbfbfb; --side-text: #6b6b76; --side-active: #ea580c;
  --card-radius: 4px; --btn-radius: 4px;
  --pj-red: #ef4444;   --pj-red-line: rgba(239,68,68,.35);   --pj-red-bg: rgba(239,68,68,.08);
  --pj-green: #000000; --pj-green-line: #000000;              --pj-green-bg: #e2e8f0;
  --pj-blue: #0284c7;  --pj-blue-line: rgba(2,132,199,.35);  --pj-blue-bg: rgba(2,132,199,.08);
  --pj-amber: #d97706; --pj-amber-line: rgba(217,119,6,.35);  --pj-amber-bg: rgba(217,119,6,.10);
  --pj-teal: #0d9488;  --pj-teal-bg: rgba(13,148,136,.10);
  --pj-slate: #6b6b76; --pj-slate-bg: rgba(107,107,118,.12);
  --pj-leaf: #16a34a;  --pj-leaf-bg: rgba(22,163,74,.12);
}

[data-theme-style="titanium"][data-theme="dark"] {
  --bg: #000000; --panel: #0c0c0c; --panel-elevated: #141414; --text: #ffffff; --muted: #737373; --line: #262626;
  --brand: #ff5c00; --brand-hover: #ff7728; --brand-weak: #261205; --brand-accent: #f59e0b;
  --danger: #ff4d4d; --side-bg: #050505; --side-text: #737373; --side-active: #ff5c00;
  --card-radius: 4px; --btn-radius: 4px;
  --pj-red: #ff4d4d;   --pj-red-line: rgba(255,77,77,.40);   --pj-red-bg: rgba(255,77,77,.13);
  --pj-green: #00e599; --pj-green-line: rgba(0,229,153,.40);  --pj-green-bg: rgba(0,229,153,.13);
  --pj-blue: #38bdf8;  --pj-blue-line: rgba(56,189,248,.40);   --pj-blue-bg: rgba(56,189,248,.13);
  --pj-amber: #f59e0b; --pj-amber-line: rgba(245,158,11,.40); --pj-amber-bg: rgba(245,158,11,.13);
  --pj-teal: #2dd4bf;  --pj-teal-bg: rgba(45,212,191,.14);
  --pj-slate: #888888; --pj-slate-bg: rgba(136,136,136,.14);
  --pj-leaf: #22c55e;  --pj-leaf-bg: rgba(34,197,94,.14);
}

[data-theme-style="titanium"] .ver-btn,
[data-theme-style="titanium"] .badge,
[data-theme-style="titanium"] .range-label,
[data-theme-style="titanium"] .brand-title {
  font-family: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
}

/* 테마 규칙: data-theme 이 있으면 그 값, 없으면 라이트. (편집기 등 JS 도 같은 기준 — OS 설정은 보지 않는다) */
* { box-sizing: border-box; }
/* display:grid/flex 를 준 요소도 hidden 속성이 항상 이기게 (팝업·카드·탭이 안 숨겨지던 결함) */
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; }
/* 본문 글꼴: Pretendard(가변) 자체 호스팅 — 사내망에서 외부 폰트 CDN 이 막혀 있어 파일을 저장소에 둔다(static/vendor/pretendard).
   한글이 없는 환경으로 떨어져도 깨지지 않게 맑은 고딕·애플 고딕 순으로 대체한다. */
@font-face {
  font-family: "Pretendard Variable";
  src: url("/static/vendor/pretendard/PretendardVariable.woff2") format("woff2");
  font-weight: 45 920;   /* 가변 축 — 한 파일로 가는 글씨~굵은 글씨 */
  font-style: normal;
  font-display: swap;    /* 폰트 받는 동안 대체 글꼴로 먼저 보인다(빈 화면 방지) */
}
body { font: 14px/1.6 "Pretendard Variable", Pretendard, "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif; color: var(--text); background: var(--bg);
       word-break: keep-all; overflow-wrap: break-word; }   /* 한글은 단어 단위로 줄바꿈(낱글자 쪼개짐 방지), 긴 영문·URL 만 잘라 넘긴다 */
a { color: var(--brand); text-decoration: none; }

/* 아이콘 (스프라이트 _icons.html) */
.i { width: 16px; height: 16px; vertical-align: -3px; flex: none; }

/* 레이아웃 · 사이드바 (data-sidebar="closed" 면 아이콘만 남기고 접힘 — 크롬식) */
.layout { display: flex; min-height: 100vh; }
.sidebar { --sw: 224px; width: var(--sw); flex: 0 0 var(--sw); background: var(--side-bg); color: var(--side-text); display: flex; flex-direction: column; padding: 14px 12px; transition: width .18s ease, flex-basis .18s ease;
  position: sticky; top: 0; height: 100vh; box-sizing: border-box; overflow-y: auto;
  will-change: transform; backface-visibility: hidden;
  z-index: 30; }
.content { flex: 1; min-width: 0; padding: 28px 32px; max-width: 1720px; overflow-x: hidden; }
.md-view img, .toastui-editor-contents img { max-width: 100%; height: auto; border-radius: var(--btn-radius); border: 1px solid var(--line); }
.md-view img { cursor: zoom-in; }
.md-view, .md-view p { overflow-wrap: anywhere; }
.brand-row { display: flex; gap: 10px; align-items: center; margin-bottom: 18px; padding: 2px 4px; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; object-fit: contain; flex: none; }
.brand-text { min-width: 0; }
.brand-title { font-weight: 700; color: var(--side-active); white-space: nowrap; }
.brand-sub { font-size: 12px; color: var(--side-text); }
.me-avatar { position: relative; width: 22px; height: 22px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; flex: none; }   /* 사이드바 내 사진, 없으면 사람 아이콘 */
.me-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ver-btn { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 2px 9px 2px 8px; border-radius: 999px; border: 1px solid rgba(255,255,255,.14); background: rgba(255,255,255,.07); color: var(--side-text); font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .2px; cursor: pointer; transition: background .15s, color .15s, border-color .15s; }
.ver-btn::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px rgba(139,133,255,.22); }
.ver-btn:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.ver-btn:hover::before { background: #fff; box-shadow: none; }
.side-toggle { margin-left: auto; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent; color: var(--side-text); cursor: pointer; display: grid; place-items: center; }
.side-toggle:hover { background: rgba(255,255,255,.08); color: var(--side-active); }
.side-toggle .i { width: 18px; height: 18px; }
.side-toggle .ic-open { display: none; }
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.menu { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--side-text); white-space: nowrap; }
.menu .i { width: 18px; height: 18px; }
.menu:hover { background: rgba(255,255,255,.06); color: var(--side-active); }
.menu.active { background: var(--brand); color: #fff; font-weight: 600; }
/* 사이드바 알림 배지(피드백 처리 대기) — 어느 화면에서 보든 같은 모양이어야 해서 전역에 둔다(2026-09-10) */
.menu .fb-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 6px; border-radius: 999px; background: #e5484d; color: #fff;
                  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; flex: none; box-shadow: 0 0 0 1px rgba(0,0,0,.15); }
.menu.active .fb-badge { box-shadow: 0 0 0 1px rgba(255,255,255,.5); }   /* 선택된 메뉴에서도 같은 빨간 배지(2026-09-10 사용자 선택) */
[data-sidebar="closed"] .menu .fb-badge { display: none; }     /* 접힌 사이드바에서는 아이콘만 */
/* 2단계 하위 메뉴(현황판 판들). 대메뉴가 활성일 때만 펼침. 접힌 사이드바에서는 대메뉴 아이콘에 올리면 옆으로 뜬다 */
.menu-group { position: relative; }
.menu-group .menu .chev { margin-left: auto; width: 14px; height: 14px; opacity: .6; transition: transform .15s; }
.menu-group.open .menu .chev { transform: rotate(180deg); }
.menu-group .sub { display: none; flex-direction: column; gap: 1px; margin: 2px 0 4px 22px; padding-left: 8px; border-left: 1px solid rgba(255,255,255,.12); }
.menu-group.open .sub { display: flex; }
.submenu { display: block; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: var(--side-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.submenu:hover { background: rgba(255,255,255,.06); color: var(--side-active); }
.submenu.active { color: var(--side-active); font-weight: 600; background: rgba(255,255,255,.08); }
[data-sidebar="closed"] .menu-group .menu .chev { display: none; }
[data-sidebar="closed"] .sidebar { overflow: visible; }                 /* 접힘 상태는 내용이 짧으니 스크롤 대신 플라이아웃이 잘리지 않게 */
[data-sidebar="closed"] .menu-group .menu::after { content: ""; position: absolute; right: 6px; top: 50%; width: 5px; height: 5px; margin-top: -2px; border-radius: 50%; background: currentColor; opacity: .55; }   /* 하위 메뉴 있음 표시 */
[data-sidebar="closed"] .menu-group .menu { position: relative; }
[data-sidebar="closed"] .menu-group .sub { display: none; position: absolute; left: calc(100% + 4px); top: 0; margin: 0; padding: 6px; border: 1px solid rgba(255,255,255,.12); border-radius: 10px;
  background: var(--side-bg); box-shadow: 0 8px 24px rgba(0,0,0,.35); min-width: 180px; z-index: 40; }
[data-sidebar="closed"] .menu-group .sub::before { content: attr(aria-label); display: block; padding: 4px 10px 6px; font-size: 11.5px; color: var(--side-text); opacity: .7; }
[data-sidebar="closed"] .menu-group::after { content: ""; position: absolute; left: 100%; top: 0; width: 8px; height: 100%; }   /* 아이콘과 플라이아웃 사이 틈에서 hover 가 끊기지 않게 */
[data-sidebar="closed"] .menu-group:hover .sub, [data-sidebar="closed"] .menu-group:focus-within .sub { display: flex; }
[data-sidebar="closed"] .menu-group .sub .label { display: inline; }
.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 4px; padding-top: 12px; border-top: 1px solid rgba(255,255,255,.08); }
.me { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--side-text); white-space: nowrap; }
.me:hover { background: rgba(255,255,255,.06); }
.me .i { width: 18px; height: 18px; }
.me-name { font-weight: 700; color: var(--side-active); }
.me-change { margin-left: auto; font-size: 12px; text-decoration: underline; }
.foot-form { display: block; }   /* 사이드바 하단 토글(보기 방식) — 버튼은 .theme-switch 그대로 */
.foot-form .theme-switch { width: 100%; }
.theme-switch { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; border: 0; background: transparent; color: var(--side-text); cursor: pointer; font: inherit; font-size: 13px; text-align: left; }
.theme-switch:hover { background: rgba(255,255,255,.06); color: var(--side-active); }
.theme-switch.logout-btn { color: var(--side-text); text-decoration: none; }
.theme-switch.logout-btn:hover { background: rgba(239, 68, 68, 0.15); color: #ff8585; }
.theme-switch .i { width: 18px; height: 18px; }
.theme-switch .ic-sun { display: none; }
[data-theme="dark"] .theme-switch .ic-sun { display: inline; }
[data-theme="dark"] .theme-switch .ic-moon { display: none; }

/* 접힘 상태 */
[data-sidebar="closed"] .sidebar { --sw: 64px; padding: 14px 8px; }
[data-sidebar="closed"] .brand-row { flex-direction: column; gap: 8px; margin-bottom: 12px; }
[data-sidebar="closed"] .brand-text, [data-sidebar="closed"] .label { display: none; }
[data-sidebar="closed"] .side-toggle { margin-left: 0; }
[data-sidebar="closed"] .side-toggle .ic-close { display: none; }
[data-sidebar="closed"] .side-toggle .ic-open { display: inline; }
[data-sidebar="closed"] .menu, [data-sidebar="closed"] .me, [data-sidebar="closed"] .theme-switch { justify-content: center; padding: 10px 0; }

/* 공통 요소 */
.page-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; }
.page-head h1 { margin: 0; font-size: 22px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--card-radius); padding: 20px 22px; }
.card.narrow { max-width: 560px; }
.hint { color: var(--muted); font-size: 13px; }
.hint.small { font-size: 12px; margin-top: 14px; }
.badge { font-size: 12px; background: var(--brand-weak); color: var(--brand); border-radius: 999px; padding: 2px 10px; }
.error { color: var(--danger); font-size: 13px; margin: 6px 0 0; }
.btn { border: 1px solid var(--line); background: var(--panel); color: var(--text); border-radius: var(--btn-radius); padding: 8px 14px; cursor: pointer; font: inherit; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn.wide { width: 100%; margin-top: 12px; }
.input { width: 100%; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: var(--btn-radius); padding: 10px 12px; font: inherit; }

/* 대문 */
.center-page { display: grid; place-items: center; min-height: 100vh; }
/* ── 대문 (Nexus Gate - 모던 미니멀 반응형 카드) ─────────────────────────── */
.gate-body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  background-image: radial-gradient(circle at 50% 20%, rgba(79, 70, 229, 0.07), transparent 70%);
  padding: 24px;
}
[data-theme="dark"] .gate-body {
  background-image: radial-gradient(circle at 50% 20%, rgba(139, 133, 255, 0.09), transparent 70%);
}

.gate-card-wrap {
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
}

.gate-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 32px 32px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 4px 12px -2px rgba(0, 0, 0, 0.03);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
[data-theme="dark"] .gate-card {
  box-shadow: 0 12px 36px -10px rgba(0, 0, 0, 0.4);
}

.gate-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.gate-logo-box {
  width: 72px;
  height: 72px;
  border-radius: 20px;
  background: var(--brand-weak);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
}

.gate-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.gate-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.gate-desc {
  margin: 6px 0 0;
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.gate-action {
  width: 100%;
}

.hero-google-btn.gate-google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  border-radius: 12px;
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.hero-google-btn.gate-google-btn:hover {
  background: #f8f9fa;
  border-color: #c6c9ce;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}
.hero-google-btn.gate-google-btn:active {
  transform: translateY(0);
}
.hero-google-btn.gate-google-btn .i-google {
  width: 20px;
  height: 20px;
  flex: none;
}

.gate-alert {
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--pj-red-bg);
  border: 1px solid var(--pj-red-line);
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.gate-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 4px;
}
.gate-ver {
  font-weight: 500;
}
.gate-dot {
  opacity: 0.5;
}
.gate-auth-note {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
}

@media (max-width: 480px) {
  .gate-body {
    padding: 16px;
  }
  .gate-card {
    padding: 32px 24px 24px;
    border-radius: 16px;
    gap: 20px;
  }
  .gate-logo-box {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    margin-bottom: 12px;
  }
  .gate-logo {
    width: 40px;
    height: 40px;
  }
  .gate-title {
    font-size: 22px;
  }
  .hero-google-btn.gate-google-btn {
    height: 46px;
    font-size: 14.5px;
  }
}

/* 이름 선택 */
/* 이름 확인 화면 — 명단을 보여 주지 않고 직접 적게 한다(2026-09-10: 대문 비번만 아는 외부인이 아무 이름이나 고르는 것 방지) */
.whoami-form { display: flex; flex-direction: column; gap: 10px; }
.whoami-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
.whoami-form .input { max-width: 260px; font-size: 15px; padding: 9px 12px; }
.whoami-form .row { margin-top: 4px; }
.member-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.member-btn { padding: 16px 8px; font: inherit; font-size: 15px; font-weight: 600; border: 1px solid var(--line); background: var(--bg); color: var(--text); border-radius: 10px; cursor: pointer; }
.member-btn:hover, .member-btn.on { border-color: var(--brand); background: var(--brand-weak); color: var(--brand); }

/* 업데이트 내역 팝업 */
.modal-back { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; z-index: 50; }
.modal-back[hidden] { display: none; }   /* display:grid 가 hidden 속성의 기본 display:none 을 덮어쓰므로 명시 */
.modal { width: min(760px, 92vw); max-height: 80vh; background: var(--panel); border-radius: 12px; display: flex; flex-direction: column; overflow: hidden; }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-x { margin-left: auto; border: 0; background: none; cursor: pointer; color: var(--muted); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; }
.modal-x:hover { background: var(--bg); }
.modal-body { margin: 0; padding: 16px 18px; overflow: auto; font: 13px/1.6 "Malgun Gothic", system-ui, sans-serif; }

/* 구분 버튼(일간/주간/월간 · 사용자/개발자) — 공통 */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { display: inline-flex; align-items: center; border: 0; background: transparent; color: var(--muted); padding: 6px 12px; cursor: pointer; font: inherit; font-size: 13px; }
.seg button.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }

/* 업데이트 내역 — 세로 타임라인: 왼쪽 레일(점·버전·날짜·최신) + 오른쪽 카드(소제목별 목록) */
.cl-body { padding: 18px 22px 8px; }
.cl-rel { display: grid; grid-template-columns: 96px 1fr; gap: 0 18px; position: relative; padding-bottom: 22px; }
.cl-rel::before { content: ""; position: absolute; left: 7px; top: 18px; bottom: 0; width: 2px; background: var(--line); }
.cl-rel:last-child::before { display: none; }
.cl-rail { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding-left: 24px; position: relative; font-size: 12px; color: var(--muted); }
.cl-dot { position: absolute; left: 0; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--panel); border: 3px solid var(--line); }
.cl-rel.latest .cl-dot { background: var(--brand); border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-weak); }
.cl-ver { font-size: 15px; color: var(--text); line-height: 1.4; }
.cl-badge { margin-top: 3px; padding: 1px 8px; border-radius: 999px; background: var(--brand); color: #fff; font-size: 11px; font-weight: 600; }
.cl-card { border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 14px 18px 8px; min-width: 0; }
.cl-card h3 { margin: 0; font-size: 15px; }
/* 제목 줄 = 펼침 버튼. 최신 판만 펼쳐 두고 나머지는 접는다 */
.cl-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 0 0 10px; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.cl-head .cl-n { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.cl-head .cl-chev { width: 14px; height: 14px; color: var(--muted); transition: transform .12s; flex: none; }
.cl-rel.collapsed .cl-head { padding-bottom: 0; }
.cl-rel.collapsed .cl-head .cl-chev { transform: rotate(-90deg); }
.cl-rel.collapsed .cl-groups { display: none; }
.cl-rel.collapsed .cl-card { padding-bottom: 14px; }
.cl-card h5 { margin: 8px 0 2px; font-size: 12px; font-weight: 600; color: var(--muted); padding-left: 2px; }
.cl-card h4 { margin: 10px 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); }
.cl-card ul { margin: 0 0 8px; padding-left: 18px; }
.cl-card li { margin: 3px 0; }
.cl-card li::marker { color: var(--brand); }
.cl-card code { font-size: 12px; padding: 0 4px; border-radius: 4px; background: var(--brand-weak); }

/* 모바일 전용 헤더 및 하단 네비게이션 기본 숨김 (데스크톱) */
.mobile-header { display: none; }
.mobile-nav { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 768px) {
  /* 상단 모바일 헤더 */
  .mobile-header {
    display: flex; align-items: center; justify-content: space-between;
    position: fixed; top: 0; left: 0; right: 0; height: 50px;
    padding: 0 14px; background: var(--side-bg); color: var(--side-text);
    z-index: 40; border-bottom: 1px solid rgba(255,255,255,.08);
  }
  .mobile-menu-btn, .mobile-theme-btn, .mobile-logout-btn {
    width: 36px; height: 36px; display: grid; place-items: center;
    border: 0; background: transparent; color: var(--side-text); cursor: pointer; border-radius: 8px; text-decoration: none;
  }
  .mobile-menu-btn:hover, .mobile-theme-btn:hover {
    background: rgba(255,255,255,.08); color: var(--side-active);
  }
  .mobile-logout-btn:hover {
    background: rgba(239, 68, 68, 0.15); color: #ff8585;
  }
  .mobile-logout-btn .i { width: 18px; height: 18px; }
  .mobile-header-actions { display: flex; align-items: center; gap: 4px; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--side-active); font-size: 15px; }
  .mobile-brand img { border-radius: 6px; }

  /* 사이드바 서랍(Drawer)화 */
  .sidebar {
    position: fixed; top: 0; bottom: 0; left: 0; width: 280px; height: 100vh;
    z-index: 60; transform: translateX(-100%); transition: transform .22s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 4px 0 24px rgba(0,0,0,.35);
  }
  body.drawer-open .sidebar { transform: translateX(0); }
  
  /* 사이드바 백드롭 */
  .sidebar-backdrop {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5);
    z-index: 55; opacity: 0; pointer-events: none; transition: opacity .22s ease;
    backdrop-filter: blur(2px);
  }
  body.drawer-open .sidebar-backdrop {
    opacity: 1; pointer-events: auto;
  }
  body.drawer-open { overflow: hidden; }

  /* 하단 모바일 바 */
  .mobile-nav {
    display: flex; flex-direction: row; align-items: stretch; justify-content: space-around;
    position: fixed; bottom: 0; left: 0; right: 0; height: 56px;
    background: var(--panel); border-top: 1px solid var(--line);
    z-index: 45; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  }
  .mobile-nav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; color: var(--muted); font-size: 11px; font-weight: 500; text-decoration: none;
    transition: color .15s ease;
  }
  .mobile-nav-item .i { width: 20px; height: 20px; }
  .mobile-nav-item.active { color: var(--brand); font-weight: 600; }

  /* 본문 여백 조정 (상하 바 가림 방지) */
  .layout { display: block; }
  .content { padding: 62px 14px 72px; width: 100%; box-sizing: border-box; }
  .member-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 사이드바 메뉴 순서 편집 (2026-09-10) — "메뉴 순서" 를 누르면 끌어서 옮길 수 있다. 내 설정에만 저장 */
body.menu-ordering #menuOrderToggle { color: var(--side-active); font-weight: 600; background: rgba(255,255,255,.08); }
#menuOrderToggle #menuOrderReset { margin-left: auto; font-size: 11.5px; opacity: .7; }
#menuOrderToggle #menuOrderReset:hover { opacity: 1; }
body.menu-ordering .sidebar nav .menu { cursor: grab; }
body.menu-ordering .sidebar nav .menu-group > .menu { cursor: grab; }
body.menu-ordering .sidebar nav .menu::before { content: "⋮⋮"; margin-right: 6px; opacity: .5; font-size: 11px; letter-spacing: -2px; }
body.menu-ordering .sidebar nav .sub { display: none; }                 /* 편집 중엔 하위 메뉴를 접어 단순하게 */
.sidebar nav .dragging { opacity: .45; }
.sidebar nav .drop-before { box-shadow: inset 0 2px 0 0 var(--brand); }
.sidebar nav .drop-after { box-shadow: inset 0 -2px 0 0 var(--brand); }


/* 내 설정의 접힌 카드(이 자리가 내가 아닌가요?) — 평소엔 한 줄, 펼치면 폼 */
.card.fold > summary { cursor: pointer; font-weight: 600; color: var(--muted); list-style: none; }
.card.fold > summary::-webkit-details-marker { display: none; }
.card.fold > summary::before { content: "▸ "; }
.card.fold[open] > summary::before { content: "▾ "; }
.card.fold[open] > summary { color: inherit; }
