/* ============================================================
   열매똑똑 스마트워크 · 수강생 웹 앱 스타일시트
   대나무(Bamboo) 테마 · 나뭇잎 카드 · 커스텀 커서
   ============================================================ */

/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;900&family=Outfit:wght@300;400;500;600;700&display=swap');

/* ── CSS 변수 ── */
:root {
  /* 색상 팔레트 */
  --bg-primary: #0a0f0d;
  --bg-secondary: #111a15;
  --bg-card: rgba(20, 35, 25, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.04);
  --bg-overlay: rgba(0, 0, 0, 0.75);

  /* 대나무 색상 */
  --bamboo-stem: #2d5a3d;
  --bamboo-node: #4a8c5e;
  --bamboo-leaf: #3d7a4f;
  --bamboo-leaf-light: rgba(61, 122, 79, 0.15);

  /* 단계별 색상 (v3: 기반형 🟢 → 운영형 🔵 → 확장형 🔴) */
  --stage-common: #6C757D;
  --stage-foundation: #43A047;
  --stage-operational: #4A90D9;
  --stage-expansion: #E05252;

  /* 텍스트 */
  --text-primary: #e8f0eb;
  --text-secondary: #9ab8a5;
  --text-muted: #5a7d66;
  --text-accent: #7dcea0;

  /* 커서 */
  --cursor-default: #7dcea0;
  --cursor-click: #4CAF50;
  --cursor-loading: #FFD700;
  --cursor-error: #ff4757;

  /* 기타 */
  --border-subtle: rgba(125, 206, 160, 0.15);
  --shadow-glow: 0 0 30px rgba(77, 175, 100, 0.15);
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 레이아웃 */
  --header-height: 64px;
  --sidebar-width: 300px;
}

/* ── 전역 리셋 ── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  cursor: none;
}

body {
  font-family: 'Noto Sans KR', 'Outfit', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  cursor: none;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}

/* 기본 커서 숨기기 */
a, button, input, textarea, select, [role="button"] {
  cursor: none;
}

/* ── 커스텀 커서 ── */
#custom-cursor {
  position: fixed;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  border: 2px solid var(--cursor-default);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100000;
  will-change: translate; /* 위치는 app.js가 translate로 옮긴다(합성 단계 처리) */
  transition:
    width 0.3s var(--transition-spring),
    height 0.3s var(--transition-spring),
    border-color 0.3s ease,
    background-color 0.3s ease,
    transform 0.08s linear;
  transform: translate(-50%, -50%);
  mix-blend-mode: difference;
  background: radial-gradient(circle at 33% 28%, rgba(255, 255, 255, 0.22), rgba(125, 206, 160, 0.05) 55%, transparent 75%);
  animation: drop-morph 7s ease-in-out infinite; /* 물방울처럼 형태가 잔잔히 일렁임 */
}

/* 커서: 클릭(누름) — 눌린 물방울 */
#custom-cursor.clicking {
  border-color: var(--cursor-click);
  background: rgba(76, 175, 80, 0.18);
  transform: translate(-50%, -50%) scale(1.18, 0.78);
}

/* 커서: 로딩 시 회전 */
#custom-cursor.loading {
  width: 40px;
  height: 40px;
  border-color: transparent;
  border-top-color: var(--cursor-loading);
  border-right-color: var(--cursor-loading);
  animation: cursor-spin 0.8s linear infinite;
}

/* 커서: 오류 */
#custom-cursor.error {
  width: 40px;
  height: 40px;
  border-color: var(--cursor-error);
  background: rgba(255, 71, 87, 0.2);
  animation: cursor-shake 0.5s ease;
}

/* 커서: hover */
#custom-cursor.hovering {
  width: 48px;
  height: 48px;
  border-color: var(--text-accent);
  background: rgba(125, 206, 160, 0.08);
}

@keyframes cursor-spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes cursor-shake {
  0%, 100% { transform: translate(-50%, -50%) translateX(0); }
  20% { transform: translate(-50%, -50%) translateX(-4px); }
  40% { transform: translate(-50%, -50%) translateX(4px); }
  60% { transform: translate(-50%, -50%) translateX(-3px); }
  80% { transform: translate(-50%, -50%) translateX(2px); }
}

/* 커서 안쪽 점 */
#cursor-dot {
  position: fixed;
  top: 0;
  left: 0;
  width: 6px;
  height: 6px;
  background: var(--cursor-default);
  border-radius: 50%;
  pointer-events: none;
  z-index: 100001;
  will-change: translate;
  transform: translate(-50%, -50%);
  transition: background-color 0.3s ease, opacity 0.3s ease;
}

#custom-cursor.loading ~ #cursor-dot,
#custom-cursor.error ~ #cursor-dot {
  opacity: 0;
}

/* ── 배경 효과 ── */
.bg-pattern {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(45, 90, 61, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 144, 217, 0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(255, 152, 0, 0.06) 0%, transparent 50%);
}

/* 떠다니는 대나무 잎 파티클 */
.floating-leaf {
  position: fixed;
  width: 20px;
  height: 8px;
  background: linear-gradient(135deg, var(--bamboo-leaf), rgba(61, 122, 79, 0.3));
  border-radius: 50% 0 50% 0;
  opacity: 0.15;
  pointer-events: none;
  z-index: 1;
  animation: float-leaf linear infinite;
}

@keyframes float-leaf {
  0% {
    transform: translateY(110vh) rotate(0deg) translateX(0);
    opacity: 0;
  }
  10% { opacity: 0.15; }
  90% { opacity: 0.15; }
  100% {
    transform: translateY(-10vh) rotate(720deg) translateX(100px);
    opacity: 0;
  }
}

/* ── 헤더 ── */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: rgba(10, 15, 13, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger-btn {
  width: 44px;
  height: 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: none;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.hamburger-btn:hover {
  background: var(--bg-glass);
  border-color: var(--text-accent);
}

.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: var(--transition-fast);
}

.hamburger-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.hamburger-btn.active span:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.logo-text {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.logo-text .sub {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 뷰 토글 버튼 */
.view-toggle {
  display: flex;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle button {
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 16px;
  transition: var(--transition-fast);
}

.view-toggle button.active {
  background: var(--bamboo-leaf);
  color: white;
}

.view-toggle button:hover:not(.active) {
  background: var(--bg-glass);
  color: var(--text-primary);
}

/* 진행률 */
.progress-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  font-size: 13px;
  color: var(--text-secondary);
}

.progress-badge .progress-bar-mini {
  width: 60px;
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.progress-bar-mini .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--stage-foundation), var(--stage-operational), var(--stage-expansion));
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* 강의 후기 바로가기 — 사이트 기본 버튼(.btn .btn-primary)을 헤더 컨트롤 높이에 맞춘다.
   .btn 이 파일 뒤쪽에 정의돼 있어 .header-right 로 한정해 우선순위를 확보한다. */
.header-right .review-btn {
  padding: 8px 14px;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
}

/* ≤640px: 글자까지 두면 헤더 폭이 모자라 로고가 가려지므로 아이콘만 남긴다 (이름은 aria-label·title) */
@media (max-width: 640px) {
  .header-right .review-btn {
    padding: 6px 9px;
    font-size: 14px;
  }

  .review-btn-label {
    display: none;
  }
}

/* ── 사이드바 (햄버거 메뉴) ── */
.sidebar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: rgba(10, 15, 13, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-right: 1px solid var(--border-subtle);
  z-index: 999;
  transform: translateX(-100%);
  transition: transform var(--transition-smooth);
  overflow-y: auto;
  padding: 20px 0;
}

.sidebar.open {
  transform: translateX(0);
}

.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.sidebar-section {
  padding: 8px 16px;
}

.sidebar-section h3 {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 8px 12px;
  margin-bottom: 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 400;
  transition: var(--transition-fast);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.sidebar-item:hover {
  background: var(--bg-glass);
  color: var(--text-primary);
}

.sidebar-item.active {
  background: var(--bamboo-leaf-light);
  color: var(--text-accent);
}

.sidebar-item .icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
}

.sidebar-divider {
  height: 1px;
  margin: 12px 16px;
  background: var(--border-subtle);
}

/* ── 필터 바 ── */
.filter-bar {
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(10, 15, 13, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 900;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition-fast);
  white-space: nowrap;
}

.filter-chip:hover {
  border-color: var(--text-accent);
  color: var(--text-primary);
}

.filter-chip.active {
  background: var(--bamboo-leaf);
  border-color: var(--bamboo-leaf);
  color: white;
}

.filter-chip.stage-foundation.active { background: var(--stage-foundation); border-color: var(--stage-foundation); }
.filter-chip.stage-operational.active { background: var(--stage-operational); border-color: var(--stage-operational); }
.filter-chip.stage-expansion.active { background: var(--stage-expansion); border-color: var(--stage-expansion); }

.search-input {
  flex: 1;
  min-width: 200px;
  padding: 8px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: 20px;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: var(--transition-fast);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  border-color: var(--text-accent);
  background: rgba(125, 206, 160, 0.05);
}

/* ── 메인 콘텐츠 ── */
.main-content {
  padding-top: calc(var(--header-height) + 56px);
  min-height: 100vh;
  position: relative;
  z-index: 2;
}

/* ── 히어로 섹션 ── */
.hero {
  text-align: center;
  padding: 80px 24px 60px;
  position: relative;
}

.hero h1 {
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--text-accent), #b8e6c8, var(--text-accent));
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: gradient-shift 6s ease-in-out infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.hero p {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* 단계 표시 뱃지 */
.stage-badges {
  display: flex;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.stage-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid;
  transition: var(--transition-fast);
}

.stage-badge:hover {
  transform: translateY(-2px);
}

.stage-badge.foundation { border-color: var(--stage-foundation); color: var(--stage-foundation); }
.stage-badge.operational { border-color: var(--stage-operational); color: var(--stage-operational); }
.stage-badge.expansion { border-color: var(--stage-expansion); color: var(--stage-expansion); }

.stage-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.stage-badge.foundation .stage-dot { background: var(--stage-foundation); }
.stage-badge.operational .stage-dot { background: var(--stage-operational); }
.stage-badge.expansion .stage-dot { background: var(--stage-expansion); }

/* ── 대나무 타임라인 ── */
.bamboo-timeline {
  display: none;
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.bamboo-timeline.active {
  display: block;
}

/* 대나무 줄기 (중앙 수직선 — 마디 질감) */
.bamboo-stem {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 10px;
  background: repeating-linear-gradient(
    to bottom,
    var(--bamboo-stem) 0px,
    var(--bamboo-stem) 112px,
    var(--bamboo-node) 112px,
    var(--bamboo-node) 118px
  );
  opacity: 0.4;
  transform: translateX(-50%);
  border-radius: 5px;
}

/* 스크롤을 따라 자라나는 줄기 오버레이 */
.bamboo-stem-progress {
  position: absolute;
  left: 50%;
  top: 0;
  width: 10px;
  height: 0;
  background: repeating-linear-gradient(
    to bottom,
    var(--bamboo-node) 0px,
    var(--bamboo-node) 112px,
    #7dcea0 112px,
    #7dcea0 118px
  );
  transform: translateX(-50%);
  border-radius: 5px;
  box-shadow: 0 0 16px rgba(125, 206, 160, 0.35);
  transition: height 0.15s linear;
  pointer-events: none;
}

/* 대나무 마디 — 기본은 흐리게, 줄기가 자라 닿으면 점등 */
.bamboo-node {
  position: absolute;
  left: 50%;
  width: 22px;
  height: 12px;
  background: var(--bamboo-node);
  border-radius: 6px;
  transform: translateX(-50%);
  box-shadow: 0 0 12px rgba(74, 140, 94, 0.3);
  opacity: 0.35;
  z-index: 1;
  transition: opacity 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.bamboo-node.reached {
  opacity: 1;
}

.bamboo-node.completed {
  background: var(--text-accent);
  box-shadow: 0 0 18px rgba(125, 206, 160, 0.6);
}

.bamboo-node.completed::after {
  content: '🌱';
  position: absolute;
  top: -17px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
}

/* ── 나뭇잎 카드 (세션 카드) ── */
.session-card-wrapper {
  position: relative;
  display: flex;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.session-card-wrapper.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 왼쪽 카드 */
.session-card-wrapper.left {
  justify-content: flex-start;
  padding-right: calc(50% + 30px);
}

/* 오른쪽 카드 */
.session-card-wrapper.right {
  justify-content: flex-end;
  padding-left: calc(50% + 30px);
}

/* 나뭇잎 연결 줄기 */
.leaf-branch {
  position: absolute;
  top: 30px;
  height: 3px;
  background: var(--bamboo-stem);
}

.session-card-wrapper.left .leaf-branch {
  right: calc(50% - 3px);
  width: 30px;
}

.session-card-wrapper.right .leaf-branch {
  left: calc(50% - 3px);
  width: 30px;
}

/* 나뭇잎 형태 카드 */
.session-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 24px 8px 24px 8px;
  padding: 24px;
  width: 100%;
  transition: var(--transition-smooth);
  overflow: hidden;
}

.session-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 24px 8px 0 0;
}

/* 단계별 상단 바 색상 */
.session-card.stage-common::before { background: var(--stage-common); }
.session-card.stage-foundation::before { background: var(--stage-foundation); }
.session-card.stage-operational::before { background: var(--stage-operational); }
.session-card.stage-expansion::before { background: var(--stage-expansion); }

.session-card:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 206, 160, 0.3);
  box-shadow: var(--shadow-glow);
}

/* 카드 헤더 */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.session-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
  color: white;
}

.stage-common .session-number { background: var(--stage-common); }
.stage-foundation .session-number { background: var(--stage-foundation); }
.stage-operational .session-number { background: var(--stage-operational); }
.stage-expansion .session-number { background: var(--stage-expansion); }

.card-title-group {
  flex: 1;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
  margin-bottom: 4px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

/* 완료 체크박스 */
.completion-check {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  color: transparent;
  font-size: 14px;
  transition: var(--transition-fast);
  flex-shrink: 0;
}

.completion-check:hover {
  border-color: var(--text-accent);
}

.completion-check.completed {
  background: var(--bamboo-leaf);
  border-color: var(--bamboo-leaf);
  color: white;
}

/* 도구 태그 */
.tool-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tool-tag {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid rgba(255,255,255,0.06);
}

/* 목표 텍스트 */
.card-objective {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 카드 하단 액션 */
.card-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.card-action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-glass);
  color: var(--text-secondary);
  font-size: 12px;
  font-family: inherit;
  transition: var(--transition-fast);
}

.card-action-btn:hover {
  background: rgba(125, 206, 160, 0.1);
  border-color: var(--text-accent);
  color: var(--text-accent);
}

.card-action-btn .icon {
  font-size: 14px;
}

/* ── 그리드 뷰 ── */
.grid-view {
  display: none;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.grid-view.active {
  display: block;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.grid-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.grid-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}

.grid-card.stage-common::before { background: var(--stage-common); }
.grid-card.stage-foundation::before { background: var(--stage-foundation); }
.grid-card.stage-operational::before { background: var(--stage-operational); }
.grid-card.stage-expansion::before { background: var(--stage-expansion); }

.grid-card:hover {
  transform: translateY(-4px);
  border-color: rgba(125, 206, 160, 0.3);
  box-shadow: var(--shadow-glow);
}

/* ── 리스트 뷰 ── */
.list-view {
  display: none;
  max-width: 900px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.list-view.active {
  display: block;
}

.list-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  transition: var(--transition-fast);
}

.list-item:hover {
  border-color: rgba(125, 206, 160, 0.3);
  background: rgba(20, 35, 25, 0.95);
}

.list-item .session-number {
  width: 32px;
  height: 32px;
  font-size: 13px;
}

.list-item .list-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
}

.list-item .list-stage {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

.list-item .list-tools {
  font-size: 12px;
  color: var(--text-muted);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 모달이 body 스크롤을 잠가도 스크롤바 자리는 유지 — 열고 닫을 때 화면이 옆으로 밀리지 않는다 */
html{ scrollbar-gutter:stable; }

/* ── 모달 ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  backdrop-filter: blur(8px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 800px;
  max-height: 85vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transform: scale(0.95) translateY(20px);
  transition: transform 0.3s var(--transition-spring);
}

.modal-overlay.active .modal {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-subtle);
  background: none;
  color: var(--text-secondary);
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  background: rgba(255,71,87,0.1);
  border-color: var(--cursor-error);
  color: var(--cursor-error);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-subtle);
  justify-content: flex-end;
}

/* 세션 상세 모달 */
.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-accent);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.detail-section ul {
  list-style: none;
  padding: 0;
}

.detail-section ul li {
  padding: 6px 0;
  padding-left: 16px;
  position: relative;
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.detail-section ul li::before {
  content: '🌿';
  position: absolute;
  left: 0;
  font-size: 10px;
}

.detail-section p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ── 댓글 섹션 ── */
.comments-section {
  margin-top: 24px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.section-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  width: 100%;
  font-family: inherit;
  transition: var(--transition-fast);
  margin-bottom: 12px;
}

.section-toggle:hover {
  border-color: var(--text-accent);
}

.section-toggle .toggle-icon {
  transition: transform 0.3s ease;
}

.section-toggle.open .toggle-icon {
  transform: rotate(180deg);
}

.comments-list {
  display: none;
  margin-top: 12px;
}

.comments-list.open {
  display: block;
}

.comment-item {
  padding: 14px 16px;
  background: var(--bg-glass);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.comment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.comment-author {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-accent);
}

.comment-date {
  font-size: 11px;
  color: var(--text-muted);
}

.comment-body {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.comment-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.comment-action-btn {
  font-size: 11px;
  color: var(--text-muted);
  background: none;
  border: none;
  font-family: inherit;
  transition: var(--transition-fast);
  padding: 2px 6px;
  border-radius: 4px;
}

.comment-action-btn:hover {
  color: var(--text-accent);
  background: var(--bg-glass);
}

.comment-action-btn.delete:hover {
  color: var(--cursor-error);
}

/* 댓글 입력 폼 */
.comment-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.comment-form-row {
  display: flex;
  gap: 10px;
}

.comment-form-row input,
.comment-form-row select {
  min-width: 0; /* flex 자식이 내용 폭 이하로 줄어들 수 있게 — 좁은 화면 오버플로 방지 */
}

.comment-form input,
.comment-form textarea {
  flex: 1;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition-fast);
}

.comment-form input:focus,
.comment-form textarea:focus {
  border-color: var(--text-accent);
}

.comment-form textarea {
  min-height: 80px;
  resize: vertical;
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
  color: var(--text-muted);
}

/* 공통 버튼 */
.btn {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  border: none;
  transition: var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary {
  background: var(--bamboo-leaf);
  color: white;
}

.btn-primary:hover {
  background: #4a9a60;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-glass);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(125, 206, 160, 0.1);
  color: var(--text-primary);
  border-color: var(--text-accent);
}

.btn-danger {
  background: rgba(255, 71, 87, 0.1);
  color: var(--cursor-error);
  border: 1px solid rgba(255, 71, 87, 0.2);
}

.btn-danger:hover {
  background: rgba(255, 71, 87, 0.2);
}

/* ── 게시판 섹션 ── */
.board-section {
  margin-top: 20px;
  border-top: 1px solid var(--border-subtle);
  padding-top: 20px;
}

.board-item {
  padding: 14px 16px;
  background: var(--bg-glass);
  border: 1px solid rgba(255,255,255,0.04);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}

.board-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.board-item-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.board-item-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.media-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.media-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: rgba(0,0,0,0.2);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
}

.media-item:hover {
  background: rgba(125, 206, 160, 0.05);
}

.media-item .media-icon {
  font-size: 16px;
}

.media-item a {
  color: var(--text-accent);
  text-decoration: none;
}

.media-item a:hover {
  text-decoration: underline;
}

/* ── 이수 인증서 ── */
.certificate-section {
  max-width: 700px;
  margin: 60px auto;
  padding: 0 24px;
  text-align: center;
}

.certificate-card {
  background: linear-gradient(135deg, rgba(20, 40, 30, 0.9), rgba(30, 60, 40, 0.9));
  border: 2px solid var(--bamboo-node);
  border-radius: var(--radius-xl);
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}

.certificate-card::before {
  content: '';
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(125, 206, 160, 0.2);
  border-radius: calc(var(--radius-xl) - 8px);
}

.certificate-card h2 {
  font-size: 28px;
  font-weight: 900;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffd700, #ffaa00);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.certificate-card .cert-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

.certificate-card .cert-name {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border-subtle);
  display: inline-block;
}

.certificate-card .cert-body {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 32px;
}

.certificate-card .cert-date {
  font-size: 13px;
  color: var(--text-muted);
}

.certificate-card .cert-stamp {
  font-size: 48px;
  margin-top: 20px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.3));
}

.cert-not-ready {
  padding: 40px;
  color: var(--text-muted);
}

.cert-not-ready .lock-icon {
  font-size: 48px;
  margin-bottom: 16px;
  opacity: 0.5;
}

.cert-progress {
  margin-top: 20px;
}

.cert-progress-bar {
  width: 100%;
  max-width: 400px;
  height: 8px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  margin: 12px auto;
  overflow: hidden;
}

.cert-progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--stage-foundation), var(--stage-operational), var(--stage-expansion));
  border-radius: 4px;
  transition: width 0.5s ease;
}

/* ── 개인설정 패널 ── */
.settings-panel {
  display: none;
  max-width: 600px;
  margin: 0 auto;
  padding: 0 24px 120px;
}

.settings-panel.active {
  display: block;
}

.settings-group {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  margin-bottom: 16px;
}

.settings-group h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.settings-row:last-child {
  border-bottom: none;
}

.settings-label {
  font-size: 14px;
  color: var(--text-secondary);
}

.settings-input {
  padding: 8px 14px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: var(--transition-fast);
}

.settings-input:focus {
  border-color: var(--text-accent);
}

/* 토글 스위치 */
.toggle-switch {
  width: 44px;
  height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  position: relative;
  border: none;
  transition: background 0.3s ease;
}

.toggle-switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: white;
  border-radius: 50%;
  transition: transform 0.3s ease;
}

.toggle-switch.on {
  background: var(--bamboo-leaf);
}

.toggle-switch.on::after {
  transform: translateX(20px);
}

/* ── 미리보기 모달 ── */
.preview-modal .modal {
  max-width: 900px;
}

.preview-content {
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 24px;
  font-family: 'Noto Sans KR', monospace;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-height: 400px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* ── 토스트 알림 ── */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toast-in 0.3s ease, toast-out 0.3s ease 2.7s forwards;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.toast.success {
  background: rgba(61, 122, 79, 0.95);
  color: white;
}

.toast.error {
  background: rgba(255, 71, 87, 0.95);
  color: white;
}

.toast.info {
  background: rgba(74, 144, 217, 0.95);
  color: white;
}

@keyframes toast-in {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(100%); opacity: 0; }
}

/* ── 비밀번호 확인 다이얼로그 ── */
.password-dialog {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 3001;
  padding: 16px; /* 초소형 화면에서 다이얼로그가 가장자리에 붙지 않게 */
}

.password-dialog.active {
  display: flex;
}

.password-dialog-inner {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  width: 100%;
  max-width: 360px;
}

.password-dialog-inner h3 {
  font-size: 16px;
  margin-bottom: 16px;
}

.password-dialog-inner input {
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.password-dialog-inner .dialog-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--bamboo-stem);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--bamboo-node);
}

/* ── 반응형 ── */
@media (max-width: 768px) {
  .sidebar {
    width: 100%;
  }

  .bamboo-stem,
  .bamboo-stem-progress,
  .bamboo-node {
    left: 24px;
  }

  .session-card-wrapper.left,
  .session-card-wrapper.right {
    padding-left: 50px;
    padding-right: 0;
    justify-content: flex-start;
  }

  .session-card-wrapper.left .leaf-branch,
  .session-card-wrapper.right .leaf-branch {
    left: 21px;
    right: auto;
    width: 26px;
  }

  .grid-container {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 28px;
  }

  /* 필터바: fixed → sticky — 칩이 몇 줄이 되든 본문과 겹치지 않게 문서 흐름에 편입 */
  .filter-bar {
    position: sticky;
    margin-top: var(--header-height); /* 흐름 원위치를 고정 헤더 아래로 — 겹침 원천 차단 */
    padding: 10px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .main-content {
    padding-top: 0; /* 헤더 보정은 필터바 margin-top이 담당 */
  }

  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto; /* 칩은 한 줄 가로 스와이프 */
    scrollbar-width: none;
    padding-bottom: 2px;
    min-width: 0; /* flex 자식 min-width:auto 함정 — 없으면 내용 폭만큼 늘어나 가로 스크롤 유발 */
    max-width: 100%;
  }

  .filter-chips::-webkit-scrollbar {
    display: none;
  }

  .filter-chip {
    flex-shrink: 0;
  }

  .search-input {
    width: 100%;
  }

  .view-toggle button {
    padding: 6px 10px;
    font-size: 14px;
  }

  .list-item {
    flex-wrap: wrap;
  }

  .list-item .list-tools {
    display: none;
  }

  /* 헤더: 로고 한 줄 유지 + 우측 컨트롤 축소 방지 */
  .header {
    padding: 0 12px;
    gap: 8px;
  }

  .header-left {
    min-width: 0; /* flex 자식의 min-width:auto 함정 해제 — 로고 ellipsis 동작 조건 */
    flex: 1;
    gap: 10px;
  }

  .logo {
    min-width: 0;
  }

  /* 폭이 모자라면 로고 글자만 말줄임(…) — 메뉴 버튼(터치 44px)·로고 아이콘은 줄이지 않는다 */
  .hamburger-btn,
  .logo-icon {
    flex-shrink: 0;
  }

  .logo-text {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .logo-text .sub {
    display: none;
  }

  .header-right {
    flex-shrink: 0;
    gap: 8px;
  }

  .modal-overlay {
    padding: 16px 10px;
  }

  .modal {
    max-height: 92vh;
  }

  /* 터치 타깃 확대 */
  .card-action-btn {
    padding: 8px 12px;
  }

  .completion-check {
    width: 32px;
    height: 32px;
  }

  .comment-action-btn {
    padding: 6px 10px;
    font-size: 12px;
  }

  .certificate-card {
    padding: 32px 20px;
  }
}

/* ── 초소형 화면(≤480px) 추가 보정 ── */
@media (max-width: 480px) {
  .progress-badge {
    padding: 6px 10px;
  }

  .progress-badge .progress-bar-mini {
    display: none; /* 숫자(n/22)만 남겨 헤더 폭 확보 */
  }

  .view-toggle button {
    padding: 6px 8px;
  }

  .comment-form-row {
    flex-direction: column; /* 닉네임·비밀번호 세로 스택 */
  }

  .toast-container {
    left: 12px;
    right: 12px;
  }

  .toast {
    width: 100%;
  }
}

/* ── 다크 스크롤 업 버튼 ── */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  left: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bamboo-leaf);
  color: white;
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-fast);
  box-shadow: 0 4px 20px rgba(61, 122, 79, 0.3);
}

.scroll-top-btn.visible {
  opacity: 1;
  pointer-events: all;
}

.scroll-top-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(61, 122, 79, 0.4);
}

/* ── 단계 구분 배너 ── */
.stage-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 0;
  margin: 20px 0;
  position: relative;
  z-index: 2; /* 대나무 줄기(absolute)보다 위 — 글자 가림 방지 */
}

.stage-divider-line {
  flex: 1;
  height: 1px;
}

.stage-divider-label {
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  background: var(--bg-secondary); /* 불투명 배경 — 뒤로 지나가는 줄기 차단 */
  border: 1px solid transparent;
}

.stage-divider.foundation .stage-divider-line { background: var(--stage-foundation); }
.stage-divider.foundation .stage-divider-label { border-color: var(--stage-foundation); color: var(--stage-foundation); }
.stage-divider.operational .stage-divider-line { background: var(--stage-operational); }
.stage-divider.operational .stage-divider-label { border-color: var(--stage-operational); color: var(--stage-operational); }
.stage-divider.expansion .stage-divider-line { background: var(--stage-expansion); }
.stage-divider.expansion .stage-divider-label { border-color: var(--stage-expansion); color: var(--stage-expansion); }

/* ── 미디어 폼 ── */
.media-form {
  margin-top: 12px;
  padding: 16px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.media-form select {
  padding: 8px 12px;
  background: rgba(0,0,0,0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.media-form select option {
  background: var(--bg-secondary);
}

/* 숨기기 유틸 */
.hidden { display: none !important; }

/* ============================================================
   2026-07 보강: 빈 상태 · CTA · 노트 · 컨페티 · 라이트 테마 등
   ============================================================ */

/* ── 빈 검색 결과 상태 ── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 20px;
}

.grid-container .empty-state {
  grid-column: 1 / -1;
}

/* ── 히어로 "이어서 학습" CTA ── */
.continue-cta {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.continue-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 28px;
  border-radius: 28px;
  border: 1px solid var(--bamboo-node);
  background: var(--bamboo-leaf-light);
  color: var(--text-accent);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition-fast);
  max-width: 90vw;
}

.continue-btn:hover {
  background: var(--bamboo-leaf);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

/* ── 과정 로드맵 배너 (config.program 이 있는 기관에서만 표시) ── */
.program-roadmap {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 780px;
  margin: 0 auto 28px;
}
.program-step {
  flex: 1 1 210px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 12px 16px;
  text-align: left;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-glass);
  font-size: 13px;
  color: var(--text-secondary);
}
.program-step .ps-label {
  font-weight: 700;
  color: var(--text-primary);
}
.program-step .ps-range,
.program-step .ps-note {
  font-size: 12px;
  color: var(--text-muted);
}
.program-step.here {
  border-color: var(--text-accent);
  background: var(--bamboo-leaf-light);
  box-shadow: var(--shadow-glow);
}
.program-step.here .ps-label { color: var(--text-accent); }
.program-step.done  { opacity: .75; }
.program-step.later { opacity: .6; border-style: dashed; }

@media (max-width: 640px) {
  .program-roadmap { gap: 8px; }
  .program-step { flex: 1 1 100%; padding: 10px 14px; }
}


/* ── 상세 모달: 메타 칩 · 회기 이동 · 학습 노트 ── */
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.detail-meta .meta-chip {
  padding: 4px 12px;
  border-radius: 14px;
  font-size: 12px;
  background: var(--bg-glass);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.modal-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border-subtle);
}

.modal-nav .btn {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}

.note-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.note-form textarea {
  min-height: 80px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
  transition: var(--transition-fast);
}

.note-form textarea:focus {
  border-color: var(--text-accent);
}

/* ── 댓글 인라인 수정 ── */
.comment-edit {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.comment-edit textarea {
  min-height: 70px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  resize: vertical;
}

.comment-edit .edit-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ── 이수 완료 카드 강조 ── */
.session-card.done,
.grid-card.done {
  background:
    linear-gradient(rgba(61, 122, 79, 0.1), rgba(61, 122, 79, 0.02)),
    var(--bg-card);
  border-color: rgba(125, 206, 160, 0.28);
}

/* ── 그리드·리스트 등장 애니메이션 ── */
.grid-card,
.list-item {
  animation: rise-in 0.45s ease both;
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 컨페티 (22회기 달성 축하) ── */
.confetti-piece {
  position: fixed;
  top: -14px;
  width: 10px;
  height: 14px;
  border-radius: 2px;
  z-index: 5000;
  pointer-events: none;
  opacity: 0.9;
  animation: confetti-fall linear forwards;
}

@keyframes confetti-fall {
  to {
    transform: translateY(110vh) translateX(var(--drift, 0px)) rotate(720deg);
    opacity: 0.6;
  }
}

/* ── 과제 모달: 링크형 버튼 ── */
.modal a.btn {
  text-decoration: none;
}

/* ── 토스트: 클릭으로 닫기 힌트 ── */
.toast:hover {
  filter: brightness(1.1);
}

/* ── 키보드 포커스 표시 (커스텀 커서 보완) ── */
:focus-visible {
  outline: 2px solid var(--text-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 라이트 테마 ── */
html[data-theme='light'] {
  --bg-primary: #f4f8f4;
  --bg-secondary: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.92);
  --bg-glass: rgba(45, 90, 61, 0.06);
  --bg-overlay: rgba(20, 30, 24, 0.45);
  --bamboo-stem: #8fbf9e;
  --bamboo-leaf-light: rgba(61, 122, 79, 0.12);
  --text-primary: #17301f;
  --text-secondary: #3e5c49;
  --text-muted: #7d9787;
  --text-accent: #2e7d4f;
  --cursor-default: #2e7d4f;
  --border-subtle: rgba(45, 90, 61, 0.18);
  --shadow-glow: 0 8px 30px rgba(45, 90, 61, 0.12);
}

html[data-theme='light'] #custom-cursor {
  mix-blend-mode: normal;
}

html[data-theme='light'] .header,
html[data-theme='light'] .filter-bar {
  background: rgba(244, 248, 244, 0.88);
}

html[data-theme='light'] .sidebar {
  background: rgba(250, 252, 250, 0.97);
}

html[data-theme='light'] .bg-pattern {
  background:
    radial-gradient(ellipse at 20% 50%, rgba(61, 122, 79, 0.1) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(74, 144, 217, 0.07) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(255, 152, 0, 0.05) 0%, transparent 50%);
}

html[data-theme='light'] .comment-form input,
html[data-theme='light'] .comment-form textarea,
html[data-theme='light'] .comment-edit textarea,
html[data-theme='light'] .note-form textarea,
html[data-theme='light'] .settings-input,
html[data-theme='light'] .password-dialog-inner input,
html[data-theme='light'] .preview-content,
html[data-theme='light'] .media-item,
html[data-theme='light'] .media-form select {
  background: rgba(45, 90, 61, 0.05);
}

html[data-theme='light'] .certificate-card {
  background: linear-gradient(135deg, #ffffff, #eef7f0);
}

html[data-theme='light'] .floating-leaf {
  opacity: 0.1;
}

html[data-theme='light'] .toggle-switch {
  background: rgba(45, 90, 61, 0.15);
}

html[data-theme='light'] .toggle-switch.on {
  background: var(--bamboo-leaf);
}

/* ── 💧 물방울 커서 모션 ── */
@keyframes drop-morph {
  0%, 100% { border-radius: 50%; }
  25% { border-radius: 47% 53% 52% 48% / 52% 46% 54% 48%; }
  50% { border-radius: 53% 47% 46% 54% / 47% 53% 48% 52%; }
  75% { border-radius: 48% 52% 55% 45% / 53% 49% 51% 47%; }
}

/* 왼클릭 후 튕기는 스프링 복원 */
#custom-cursor.splash {
  animation: drop-splash 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes drop-splash {
  0% { transform: translate(-50%, -50%) scale(1.2, 0.72); }
  40% { transform: translate(-50%, -50%) scale(0.82, 1.22); }
  70% { transform: translate(-50%, -50%) scale(1.08, 0.94); }
  100% { transform: translate(-50%, -50%) scale(1, 1); }
}

/* 우클릭 — 물이 출렁이는 모션 */
#custom-cursor.slosh {
  animation: drop-slosh 0.9s ease-in-out;
}

@keyframes drop-slosh {
  0%, 100% { border-radius: 50%; transform: translate(-50%, -50%) rotate(0deg) scale(1, 1); }
  20% { border-radius: 58% 42% 45% 55% / 48% 60% 40% 52%; transform: translate(-50%, -50%) rotate(-7deg) scale(1.08, 0.92); }
  45% { border-radius: 42% 58% 60% 40% / 55% 42% 58% 45%; transform: translate(-50%, -50%) rotate(6deg) scale(0.94, 1.06); }
  70% { border-radius: 55% 45% 42% 58% / 45% 55% 47% 53%; transform: translate(-50%, -50%) rotate(-3deg) scale(1.03, 0.97); }
}

/* 클릭 지점에서 튀어 오르는 잔물방울 */
.cursor-droplet {
  position: fixed;
  width: 6px;
  height: 6px;
  border-radius: 50% 50% 50% 50% / 62% 62% 38% 38%;
  background: var(--cursor-default);
  opacity: 0.85;
  pointer-events: none;
  z-index: 99999;
  animation: droplet-fly 0.6s cubic-bezier(0.2, 0.6, 0.4, 1) forwards;
}

@keyframes droplet-fly {
  0% { transform: translate(0, 0) scale(1); opacity: 0.85; }
  55% { transform: translate(var(--dx), var(--dy)) scale(0.9); opacity: 0.7; }
  100% { transform: translate(calc(var(--dx) * 1.15), calc(var(--dy) * 0.4 + 22px)) scale(0.55); opacity: 0; }
}

/* 클릭 지점의 파문 */
.cursor-ripple {
  position: fixed;
  width: 12px;
  height: 12px;
  border: 2px solid var(--cursor-default);
  border-radius: 50%;
  opacity: 0.5;
  pointer-events: none;
  z-index: 99998;
  transform: translate(-50%, -50%);
  animation: ripple-out 0.55s ease-out forwards;
}

@keyframes ripple-out {
  to { width: 68px; height: 68px; opacity: 0; }
}

/* ── ✂️ 이수 완료 = 잎자루가 잘리고, 잎이 줄기에서 밀려나 틈이 벌어짐 ──
   타임라인: 당김(0~0.35s) → 툭 절단(0.35~0.63s) → 바깥으로 표류(0.63~1.15s) → 부유 루프 */
.session-card-wrapper.left .leaf-branch { transform-origin: left center; }
.session-card-wrapper.right .leaf-branch { transform-origin: right center; }

.session-card-wrapper.left.completed .leaf-branch {
  animation: branch-cut-left 1.15s ease forwards;
}

.session-card-wrapper.right.completed .leaf-branch {
  animation: branch-cut-right 1.15s ease forwards;
}

@keyframes branch-cut-left {
  0% { transform: translateX(0) scaleX(1); }
  30% { transform: translateX(0) scaleX(1.06); } /* 살짝 당겨졌다가 */
  55% { transform: translateX(0) scaleX(0.38); } /* 툭 — 절단 */
  100% { transform: translateX(-16px) scaleX(0.38); } /* 잎자루 토막이 잎과 함께 표류 */
}

@keyframes branch-cut-right {
  0% { transform: translateX(0) scaleX(1); }
  30% { transform: translateX(0) scaleX(1.06); }
  55% { transform: translateX(0) scaleX(0.38); }
  100% { transform: translateX(16px) scaleX(0.38); }
}

/* 잘려나간 토막이 떨어지는 잔상 */
.session-card-wrapper.completed::after {
  content: '';
  position: absolute;
  top: 30px;
  width: 10px;
  height: 3px;
  background: var(--bamboo-stem);
  border-radius: 2px;
  pointer-events: none;
  opacity: 0;
  animation: branch-fall 0.7s ease-in 0.55s forwards;
}

.session-card-wrapper.left.completed::after { right: calc(50% - 3px); }
.session-card-wrapper.right.completed::after { left: calc(50% - 3px); }

@keyframes branch-fall {
  0% { opacity: 1; transform: translateY(0) rotate(0deg); }
  100% { opacity: 0; transform: translateY(18px) rotate(28deg); }
}

/* 분리된 잎: 절단 직후 줄기 반대쪽으로 밀려난 뒤 그 자리에서 부유 */
.session-card-wrapper.left.completed .session-card {
  animation:
    leaf-detach-left 0.55s ease-out 0.6s forwards,
    leaf-float-left 5s ease-in-out 1.25s infinite alternate;
}

.session-card-wrapper.right.completed .session-card {
  animation:
    leaf-detach-right 0.55s ease-out 0.6s forwards,
    leaf-float-right 5s ease-in-out 1.25s infinite alternate;
}

@keyframes leaf-detach-left {
  from { transform: translateX(0); }
  to { transform: translateX(-16px); }
}

@keyframes leaf-detach-right {
  from { transform: translateX(0); }
  to { transform: translateX(16px); }
}

@keyframes leaf-float-left {
  from { transform: translateX(-16px) translateY(0) rotate(0deg); }
  to { transform: translateX(-16px) translateY(-5px) rotate(-0.6deg); }
}

@keyframes leaf-float-right {
  from { transform: translateX(16px) translateY(0) rotate(0deg); }
  to { transform: translateX(16px) translateY(-5px) rotate(0.6deg); }
}

/* 모바일: 줄기가 왼쪽 고정이므로 잎은 항상 오른쪽으로 표류 */
@media (max-width: 768px) {
  .session-card-wrapper.left .leaf-branch,
  .session-card-wrapper.right .leaf-branch {
    transform-origin: right center; /* 토막은 카드 쪽에 남고 틈은 줄기 쪽에 */
  }

  .session-card-wrapper.left.completed .leaf-branch,
  .session-card-wrapper.right.completed .leaf-branch {
    animation: branch-cut-mobile 1.15s ease forwards;
  }

  @keyframes branch-cut-mobile {
    0% { transform: translateX(0) scaleX(1); }
    30% { transform: translateX(0) scaleX(1.06); }
    55% { transform: translateX(0) scaleX(0.38); }
    100% { transform: translateX(16px) scaleX(0.38); } /* 카드 표류 거리와 동일 */
  }

  .session-card-wrapper.left.completed .session-card,
  .session-card-wrapper.right.completed .session-card {
    animation:
      leaf-detach-right 0.55s ease-out 0.6s forwards,
      leaf-float-right 5s ease-in-out 1.25s infinite alternate;
  }

  .session-card-wrapper.left.completed::after,
  .session-card-wrapper.right.completed::after {
    left: 21px;
    right: auto;
  }
}

/* ── 로고 = 홈 버튼 ── */
.logo {
  user-select: none;
}

.logo:hover .logo-text {
  color: var(--text-accent);
}

/* ── 모션 최소화 환경 존중 ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ════════════════════════════════════════
   기관 접속 게이트
   ════════════════════════════════════════ */
.institution-gate{
  position:fixed; inset:0; z-index:2000;
  display:flex; align-items:center; justify-content:center; padding:24px;
  background:radial-gradient(circle at 50% 25%, var(--bg-secondary), var(--bg-primary));
}
.institution-gate.hidden{ display:none; }
.gate-card{
  width:100%; max-width:440px; text-align:center; padding:36px 28px;
  background:var(--bg-card); border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg); box-shadow:var(--shadow-glow); backdrop-filter:blur(12px);
}
.gate-logo{ font-size:44px; }
.gate-title{ font-size:22px; color:var(--text-primary); margin:8px 0 4px; }
.gate-desc{ font-size:14px; color:var(--text-secondary); margin-bottom:22px; }
.gate-list{ display:flex; flex-direction:column; gap:10px; }
.gate-loading{ color:var(--text-muted); font-size:13px; padding:12px; }
.gate-inst-btn{
  display:flex; align-items:center; gap:10px; width:100%; padding:16px 18px;
  border-radius:var(--radius-md); border:1px solid var(--border-subtle);
  background:var(--bg-glass); color:var(--text-primary); font-size:16px; font-weight:600;
  cursor:pointer; transition:var(--transition-fast); text-align:left;
}
.gate-inst-btn:hover{ border-color:var(--text-accent); background:var(--bamboo-leaf-light); transform:translateY(-1px); }
.gate-inst-btn .ico{ font-size:20px; }
.gate-pw{ display:flex; flex-direction:column; gap:12px; }
.gate-pw.hidden{ display:none; }
.gate-selected{ font-size:16px; font-weight:700; color:var(--text-accent); }
.gate-input{
  width:100%; padding:13px 15px; border-radius:var(--radius-md); box-sizing:border-box;
  border:1px solid var(--border-subtle); background:var(--bg-glass);
  color:var(--text-primary); font-size:15px; outline:none; font-family:inherit;
}
.gate-input:focus{ border-color:var(--text-accent); }
.gate-error{ color:var(--cursor-error); font-size:13px; min-height:18px; }
.gate-actions{ display:flex; gap:10px; justify-content:center; }
.gate-admin{ margin-top:22px; padding-top:16px; border-top:1px dashed var(--border-subtle); }
.gate-link{ background:none; border:none; color:var(--text-muted); font-size:13px; cursor:pointer; text-decoration:underline; }
.gate-link:hover{ color:var(--text-accent); }
.gate-admin-form{ display:flex; flex-direction:column; gap:10px; margin-top:12px; }
.gate-admin-form.hidden{ display:none; }

/* ════════════════════════════════════════
   관리자 툴바 + 회기 관리
   ════════════════════════════════════════ */
.admin-bar{
  position:fixed; left:50%; transform:translateX(-50%); bottom:18px; z-index:1500;
  display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:center;
  background:var(--bg-card); border:1px solid var(--border-subtle);
  border-radius:999px; box-shadow:var(--shadow-glow); padding:8px 14px;
  backdrop-filter:blur(12px); max-width:calc(100vw - 32px);
}
.admin-bar.hidden{ display:none; }
.admin-bar-label{ font-size:13px; font-weight:700; color:var(--text-accent); }
.admin-select{
  padding:7px 10px; border-radius:var(--radius-sm); font-size:13px;
  border:1px solid var(--border-subtle); background:var(--bg-glass); color:var(--text-primary);
}
.btn-sm{ padding:7px 12px !important; font-size:13px !important; }
.sm-row{
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  padding:10px 12px; margin-bottom:8px; border:1px solid var(--border-subtle);
  border-radius:var(--radius-md); background:var(--bg-glass);
}
.sm-row .sm-title{ color:var(--text-primary); font-size:14px; font-weight:600; }
.sm-row .sm-meta{ color:var(--text-muted); font-size:12px; margin-top:2px; }
.sm-actions{ display:flex; gap:6px; flex-shrink:0; }
.form-field{ margin-bottom:14px; text-align:left; }
.form-field label{ display:block; font-size:13px; color:var(--text-secondary); margin-bottom:5px; }
.form-field input, .form-field textarea, .form-field select{
  width:100%; padding:10px 12px; border-radius:var(--radius-sm); box-sizing:border-box;
  border:1px solid var(--border-subtle); background:var(--bg-glass); color:var(--text-primary);
  font-size:14px; font-family:inherit; outline:none;
}
.form-field textarea{ min-height:70px; resize:vertical; }
.form-actions{ display:flex; gap:10px; justify-content:flex-end; margin-top:8px; }

/* ════════════════════════════════════════
   비밀번호 보기 토글
   ════════════════════════════════════════ */
.pw-wrap{ position:relative; }
.pw-wrap input{ padding-right:40px !important; }
.pw-toggle{
  position:absolute; right:8px; top:50%; transform:translateY(-50%);
  background:none; border:none; cursor:pointer; font-size:16px; line-height:1;
  padding:2px 4px; color:var(--text-secondary);
}

/* ════════════════════════════════════════
   과제 편집 폼 + 첨부
   ════════════════════════════════════════ */
.form-divider{
  margin:16px 0 12px; padding-top:12px; border-top:1px dashed var(--border-subtle);
  font-size:13px; font-weight:700; color:var(--text-accent);
}
.chk-label{ display:flex !important; align-items:center; gap:8px; cursor:pointer; }
.chk-label input{ width:auto !important; }
.attach-editor{ display:flex; flex-direction:column; gap:6px; margin-bottom:8px; }
.attach-empty{ color:var(--text-muted); font-size:12px; padding:4px 2px; }
.attach-row{
  display:flex; align-items:center; gap:8px; padding:6px 8px;
  border:1px solid var(--border-subtle); border-radius:var(--radius-sm); background:var(--bg-glass);
}
.attach-ico{ flex-shrink:0; }
.attach-row .attach-name{ flex:1; color:var(--text-primary); font-size:13px; text-decoration:none;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.attach-row .attach-name:hover{ text-decoration:underline; color:var(--text-accent); }
.attach-del{ background:none; border:none; color:var(--cursor-error); cursor:pointer; font-size:14px; flex-shrink:0; }
.attach-add{ display:flex; gap:6px; margin-top:6px; flex-wrap:wrap; align-items:center; }
.attach-in{ flex:1; min-width:120px; padding:8px 10px !important; }

/* 첨부 보기 (수강생 모달) */
.attach-view{ display:flex; flex-direction:column; gap:8px; }
.attach-card{
  display:flex; align-items:center; gap:10px; padding:10px 12px;
  border:1px solid var(--border-subtle); border-radius:var(--radius-md); background:var(--bg-glass);
  color:var(--text-primary); text-decoration:none; font-size:14px; transition:var(--transition-fast);
}
.attach-card:hover{ border-color:var(--text-accent); background:var(--bamboo-leaf-light); }
.attach-card .ico{ font-size:18px; flex-shrink:0; }
.attach-card.img img{ width:56px; height:56px; object-fit:cover; border-radius:var(--radius-sm); flex-shrink:0; }

/* ── 구글 계정 로그인 버튼(관리자) ── */
.btn-google{
  display:inline-flex; align-items:center; justify-content:center; gap:10px;
  width:100%; padding:11px 16px;
  background:#ffffff; color:#1f1f1f;
  border:1px solid #dadce0; border-radius:var(--radius-md);
  font-size:14px; font-weight:600; cursor:pointer;
  transition:var(--transition-fast); box-shadow:0 1px 2px rgba(0,0,0,.15);
}
.btn-google:hover{ background:#f7f8f8; box-shadow:0 1px 3px rgba(0,0,0,.25); }
.btn-google .g-ico{
  display:inline-flex; align-items:center; justify-content:center;
  width:20px; height:20px; border-radius:50%;
  background:conic-gradient(from -45deg,#ea4335 0 25%,#fbbc05 0 50%,#34a853 0 75%,#4285f4 0);
  color:#fff; font-weight:800; font-size:12px; line-height:1;
}
/* 이메일/비번 폴백 영역 */
.gate-admin-alt{ margin-top:10px; }
.gate-link.small{ font-size:12px; opacity:.85; }
#gate-admin-pwform{ margin-top:8px; display:flex; flex-direction:column; gap:8px; }

/* ============================================================
   회기 공개 예정(잠금) — 학생 화면
   ============================================================ */
/* 잠긴 카드: 채도를 낮추고 점선 테두리, 호버 상승 제거 */
.session-card.locked,
.grid-card.locked{
  border-style:dashed;
  border-color:var(--border-subtle);
  background:var(--bg-glass);
}
.session-card.locked{ opacity:.92; }
.grid-card.locked{ cursor:default; }
.grid-card.locked:hover{ transform:none; box-shadow:none; border-color:var(--border-subtle); }
.grid-card.locked::before{ background:var(--stage-common) !important; opacity:.5; }

/* 잠긴 회기 번호 배지 */
.session-number.locked{
  background:var(--stage-common) !important;
  color:#fff; opacity:.75;
}

/* 카드 헤더의 자물쇠 배지 (완료 체크 자리 대체) */
.lock-badge{
  flex-shrink:0; width:36px; height:36px;
  display:flex; align-items:center; justify-content:center;
  border-radius:50%; font-size:16px;
  background:var(--bg-glass); border:1px solid var(--border-subtle);
  color:var(--text-muted);
}

/* '공개 예정' 안내 배너 */
.locked-notice{
  display:flex; align-items:center; gap:12px;
  margin-top:14px; padding:12px 14px;
  border:1px solid var(--border-subtle); border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.locked-notice-icon{ font-size:22px; flex-shrink:0; }
.locked-notice-text{ display:flex; flex-direction:column; line-height:1.4; }
.locked-notice-text strong{ color:var(--text-primary); font-size:14px; }
.locked-notice-text span{ color:var(--text-accent); font-size:13px; font-weight:600; }
.locked-hint{
  margin-top:10px; font-size:12px; color:var(--text-muted); text-align:center;
}

/* 리스트 뷰 잠금 행 */
.list-item.locked{ opacity:.85; }
.list-item .completion-check.locked{
  cursor:default; background:transparent; border-color:var(--border-subtle);
  color:var(--text-muted); font-size:14px;
}
.list-item .completion-check.locked:hover{ transform:none; }
.list-item .session-number.locked{ opacity:.7; }
.list-stage.locked{
  background:var(--bg-glass); color:var(--text-accent);
  border:1px solid var(--border-subtle); white-space:nowrap;
}

/* ── 관리자: 공개 예정일 폼 힌트 & 회기 관리 상태 칩 ── */
.field-hint{ color:var(--text-muted); font-size:12px; font-weight:400; }
.form-field .field-hint{ display:block; margin-top:5px; line-height:1.4; }
input[type="datetime-local"]{ color-scheme:dark; }
html[data-theme='light'] input[type="datetime-local"]{ color-scheme:light; }
.sm-pub{ font-weight:600; }
.sm-pub.upcoming{ color:var(--text-accent); }
.sm-pub.live{ color:var(--text-muted); }

/* ============================================================
   출강 기록 · AI 초안 검토 워크플로
   ============================================================ */
.lecture-workflow-modal{
  padding:16px;
  z-index:12000;
}
.lecture-workflow-modal .modal{
  width:min(1240px, 100%);
  max-width:1240px;
  height:min(900px, calc(100dvh - 32px));
  max-height:calc(100dvh - 32px);
}
.lecture-workflow-modal .modal-header{
  align-items:flex-start;
  gap:20px;
  flex-shrink:0;
}
.lw-modal-subtitle{
  max-width:760px;
  margin-top:4px;
  color:var(--text-secondary);
  font-size:13px;
  line-height:1.55;
}
.lw-modal-body{
  display:grid;
  grid-template-columns:minmax(250px, 310px) minmax(0, 1fr);
  gap:0;
  padding:0;
  overflow:hidden;
}
.lw-sidebar{
  min-width:0;
  padding:18px;
  border-right:1px solid var(--border-subtle);
  background:var(--bg-glass);
  overflow-y:auto;
}
.lw-sidebar-actions,
.lw-form-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
}
.lw-sidebar-actions .btn{ flex:1 1 120px; }
.lw-report-list{ margin-top:16px; }
.lw-report-card{
  margin-bottom:10px;
  padding:14px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-secondary);
  overflow-wrap:anywhere;
}
.lw-report-card.selected{
  border-color:var(--text-accent);
  box-shadow:0 0 0 1px var(--text-accent);
}
.lw-report-card-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:8px;
  margin-bottom:8px;
}
.lw-report-card p{
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.5;
}
.lw-report-route{ margin-top:3px; color:var(--text-accent) !important; }
.lw-current-label{
  display:inline-block;
  margin-top:6px;
  padding:2px 7px;
  border-radius:999px;
  background:var(--bamboo-leaf-light);
  color:var(--text-accent) !important;
  font-size:11px !important;
  font-weight:700;
}
.lw-report-mini-meta{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:5px 10px;
  margin-top:10px;
  font-size:11px;
}
.lw-report-mini-meta div{ min-width:0; }
.lw-report-mini-meta dt{ color:var(--text-secondary); }
.lw-report-mini-meta dd{ color:var(--text-primary); overflow-wrap:anywhere; }
.lw-report-action{ display:flex; flex-direction:column; gap:7px; margin-top:12px; }
.lw-report-action .btn{ width:100%; white-space:normal; }
.lw-report-error{
  margin-top:8px;
  padding:7px 9px;
  border-radius:var(--radius-sm);
  background:rgba(224,82,82,.13);
  color:#ff9d9d !important;
}
.lw-status-chip{
  display:inline-flex;
  align-items:center;
  flex:0 0 auto;
  min-height:26px;
  padding:4px 8px;
  border:1px solid var(--border-subtle);
  border-radius:999px;
  background:var(--bg-glass);
  color:var(--text-secondary);
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.lw-status-chip.ready,
.lw-status-chip.applied{ color:var(--text-accent); border-color:var(--text-accent); }
.lw-status-chip.failed{ color:#ff9d9d; border-color:rgba(224,82,82,.65); }
.lw-workspace{
  min-width:0;
  padding:24px clamp(18px, 3vw, 34px) 38px;
  overflow-y:auto;
}
.lw-workspace-title{ font-size:21px; margin-bottom:4px; }
.lw-workspace-desc,
.lw-empty{
  color:var(--text-secondary);
  font-size:13px;
  line-height:1.65;
}
.lw-form{ margin-top:22px; }
.lw-fieldset{
  min-width:0;
  margin:0 0 20px;
  padding:18px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
}
.lw-fieldset legend{
  padding:0 8px;
  color:var(--text-accent);
  font-size:14px;
  font-weight:700;
}
.lw-fieldset-note{
  margin:-2px 0 14px;
  color:var(--text-secondary);
  font-size:12px;
}
.lw-form-grid,
.lw-review-grid,
.lw-fact-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:0 16px;
}
.lw-time-pair{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:10px;
}
.lw-upload-grid{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}
.lw-upload-box{
  padding:15px;
  border:1px dashed var(--text-muted);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.lw-upload-box label{
  display:block;
  margin-bottom:9px;
  color:var(--text-primary);
  font-size:13px;
  font-weight:700;
}
.lw-upload-box input[type="file"]{
  width:100%;
  min-height:44px;
  color:var(--text-secondary);
  font:inherit;
  font-size:12px;
}
.lw-upload-box p{
  margin-top:8px;
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.55;
}
.lw-file-selection{
  margin-top:12px;
  padding:11px 13px;
  border-radius:var(--radius-sm);
  background:var(--bg-glass);
  color:var(--text-secondary);
  font-size:12px;
}
.lw-file-selection ul{ margin:6px 0 0; padding-left:20px; }
.lw-drive-panel{
  margin-top:14px;
  padding:14px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.lw-drive-panel-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:14px;
}
.lw-drive-panel-head h4{ margin:0 0 4px; color:var(--text-primary); font-size:14px; }
.lw-drive-panel-head p{ margin:0; color:var(--text-secondary); font-size:12px; line-height:1.55; }
.lw-drive-files{ margin-top:12px; }
.lw-drive-group + .lw-drive-group{ margin-top:14px; }
.lw-drive-group h5{
  margin:0 0 6px;
  color:var(--text-accent);
  font-size:12px;
}
.lw-drive-group ul{ list-style:none; margin:0; padding:0; }
.lw-drive-file{
  display:grid;
  grid-template-columns:minmax(0, 1fr) auto;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:7px 0;
  border-bottom:1px solid var(--border-subtle);
}
.lw-drive-file > label:first-child{
  display:grid;
  grid-template-columns:auto auto minmax(0, 1fr);
  align-items:center;
  gap:8px;
  min-width:0;
}
.lw-drive-file input[type="checkbox"]{ width:18px; height:18px; accent-color:var(--bamboo-leaf); }
.lw-drive-file strong{ display:block; min-width:0; color:var(--text-primary); font-size:12px; overflow-wrap:anywhere; }
.lw-drive-file small{ display:block; margin-top:2px; color:var(--text-secondary); font-size:12px; line-height:1.4; }
.lw-drive-file.disabled{
  grid-template-columns:auto minmax(0, 1fr);
  color:var(--text-secondary);
}
.lw-drive-kind select{ min-height:38px; padding:6px 28px 6px 9px; font-size:11px; }
.sr-only{
  position:absolute !important;
  width:1px !important;
  height:1px !important;
  padding:0 !important;
  margin:-1px !important;
  overflow:hidden !important;
  clip:rect(0, 0, 0, 0) !important;
  white-space:nowrap !important;
  border:0 !important;
}
.lw-check-card{
  display:flex;
  align-items:flex-start;
  gap:11px;
  margin-top:10px;
  padding:13px 14px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  background:var(--bg-glass);
}
.lw-check-card input{
  flex:0 0 auto;
  width:20px;
  height:20px;
  margin-top:2px;
  accent-color:var(--bamboo-leaf);
}
.lw-check-card span{ display:flex; flex-direction:column; gap:3px; }
.lw-check-card strong{ color:var(--text-primary); font-size:13px; line-height:1.45; }
.lw-check-card small{ color:var(--text-secondary); line-height:1.5; }
.lw-required{ color:#ffb0b0; font-size:11px; font-weight:400; }
.lw-private-field{
  padding:12px;
  border:1px solid rgba(255,193,7,.4);
  border-radius:var(--radius-sm);
  background:rgba(255,193,7,.05);
}
.lw-private-badge{
  display:inline-block;
  margin-left:5px;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(255,193,7,.16);
  color:#ffd76a;
  font-size:10px;
  font-weight:700;
}
.lw-suggest{
  margin:6px 0 14px;
  padding:14px 16px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.lw-suggest h4{ margin:0 0 6px; color:var(--text-primary); font-size:14px; }
.lw-suggest h5{ margin:0 0 6px; color:var(--text-primary); font-size:13px; }
.lw-suggest h5 small{ color:var(--text-secondary); font-weight:400; }
.lw-suggest .field-hint{ margin:4px 0; }
.lw-suggest-lead{ margin:8px 0 4px; color:var(--text-primary); font-size:13px; }
.lw-suggest-block{ margin-top:12px; }
.lw-suggest-list,
.lw-suggest-facts{ list-style:none; margin:0; padding:0; }
.lw-suggest-facts li{
  padding:4px 0;
  color:var(--text-secondary);
  font-size:12px;
  line-height:1.5;
  overflow-wrap:anywhere;
}
.lw-suggest-facts small{ display:block; color:var(--text-secondary); }
.lw-suggest-item{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px 0;
  border-top:1px solid var(--border-subtle);
}
.lw-suggest-item:first-child{ border-top:0; }
.lw-suggest-main{ display:flex; flex-direction:column; gap:2px; min-width:0; }
.lw-suggest-main a{
  color:var(--text-primary);
  font-size:13px;
  line-height:1.45;
  overflow-wrap:anywhere;
}
.lw-suggest-main small{ color:var(--text-secondary); font-size:12px; line-height:1.5; }
.lw-suggest-item .btn{ flex-shrink:0; }
.lw-suggest-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:10px;
  margin-top:12px;
}
.lw-suggest-actions small{ color:var(--text-secondary); font-size:12px; }
.lw-suggest-all{ margin-top:12px; }
.lw-suggest-all summary{
  min-height:36px;
  display:flex;
  align-items:center;
  gap:8px;
  cursor:pointer;
  color:var(--text-primary);
  font-size:13px;
}
.lw-suggest-all summary span{ color:var(--text-secondary); font-size:12px; }
@media (max-width:560px){
  .lw-suggest-item{ flex-direction:column; align-items:stretch; }
  .lw-suggest-item .btn{ align-self:flex-start; }
}
.lw-feedback-list{ display:flex; flex-direction:column; gap:14px; margin-top:14px; }
.lw-feedback-card{
  padding:14px 16px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.lw-feedback-head{ display:flex; flex-wrap:wrap; align-items:baseline; gap:6px 12px; }
.lw-feedback-head strong{ color:var(--text-primary); font-size:14px; }
.lw-feedback-head span{ color:var(--text-secondary); font-size:13px; }
.lw-feedback-meta{ margin:6px 0 0; color:var(--text-secondary); font-size:12px; }
.lw-feedback-warn{ color:#ffd76a; }
.lw-feedback-block{ margin-top:12px; }
.lw-feedback-block h5{ margin:0 0 6px; color:var(--text-primary); font-size:13px; }
.lw-feedback-block h5 small{ color:var(--text-secondary); font-weight:400; }
.lw-feedback-chips{ display:flex; flex-wrap:wrap; gap:6px; list-style:none; margin:0; padding:0; }
.lw-feedback-chip{
  padding:4px 10px;
  border:1px solid var(--border-subtle);
  border-radius:999px;
  color:var(--text-secondary);
  font-size:12px;
}
.lw-feedback-chip strong{ color:var(--text-primary); }
.lw-feedback-chip.unknown{ border-style:dashed; }
.lw-feedback-topic{ margin:10px 0 2px; color:var(--text-primary); font-size:13px; font-weight:600; }
html[data-theme='light'] .lw-feedback-warn{ color:#765700; }
.lw-feedback-publish{
  display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px;
  margin-top:12px; padding-top:10px; border-top:1px dashed var(--border-subtle);
}
.lw-feedback-published{ color:var(--text-accent); font-size:13px; font-weight:600; }
.lw-feedback-unpublished{ color:var(--text-secondary); font-size:12px; }
.lw-fn-links{ list-style:none; margin:0 0 8px; padding:0; display:flex; flex-direction:column; gap:6px; }
.lw-fn-link{ display:flex; gap:8px; align-items:flex-start; cursor:pointer; font-size:13px; }
.lw-fn-link input{ margin-top:3px; }
.lw-fn-link small{ display:block; color:var(--text-secondary); font-size:11px; }
.lw-fn-preview{ margin:14px 0; }
.lw-form-actions{
  justify-content:flex-end;
  padding-top:4px;
}
.lw-review-actions{ border-top:1px solid var(--border-subtle); padding-top:18px; }
.lw-review-head{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:14px;
}
.lw-review-head p{ color:var(--text-secondary); font-size:13px; }
.lw-fact-grid{
  margin:18px 0;
  padding:14px 16px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.lw-fact-grid div{ padding:7px 0; }
.lw-fact-grid dt{ color:var(--text-secondary); font-size:12px; }
.lw-fact-grid dd{ color:var(--text-primary); font-size:13px; overflow-wrap:anywhere; }
.lw-callout{
  margin:16px 0;
  padding:13px 15px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  background:var(--bg-glass);
  color:var(--text-secondary);
  font-size:13px;
}
.lw-callout.warning{ border-color:rgba(255,193,7,.55); }
.lw-callout.error{ border-color:rgba(224,82,82,.65); color:#ffb0b0; }
.lw-callout ul{ margin:7px 0 0; padding-left:20px; }
.lw-evidence-details{
  margin:16px 0;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
  overflow:hidden;
}
.lw-evidence-details summary{
  min-height:46px;
  padding:12px 15px;
  color:var(--text-primary);
  font-size:13px;
  font-weight:700;
}
.lw-evidence-details summary span{
  margin-left:6px;
  color:var(--text-secondary);
  font-size:12px;
  font-weight:500;
}
.lw-evidence-body{ padding:4px 15px 16px; }
.lw-source-list{ list-style:none; margin:0 0 14px; padding:0; }
.lw-source-list li{
  display:grid;
  grid-template-columns:auto minmax(0, 1fr) auto;
  align-items:center;
  gap:8px;
  padding:8px 0;
  border-bottom:1px solid var(--border-subtle);
  font-size:12px;
}
.lw-source-list strong{ min-width:0; overflow-wrap:anywhere; }
.lw-source-list small{ color:var(--text-secondary); }
.lw-private-evidence{ margin-top:14px; }
.lw-private-evidence h4{ margin-bottom:6px; color:var(--text-primary); font-size:13px; }
.lw-private-evidence p{ color:var(--text-secondary); font-size:12px; }
.lw-private-evidence pre{
  max-height:320px;
  overflow:auto;
  padding:12px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  background:var(--bg-primary);
  color:var(--text-secondary);
  font:12px/1.65 'Noto Sans KR', sans-serif;
  white-space:pre-wrap;
  overflow-wrap:anywhere;
}
.lw-apply-confirm{ margin:0 0 18px; }
.lw-global-status{
  display:block;
  flex-shrink:0;
  min-height:0;
  padding:0 22px;
  border-top:0;
  background:var(--bg-secondary);
  color:var(--text-secondary);
  font-size:13px;
}
.lw-global-status.visible{
  min-height:48px;
  padding:12px 22px;
  border-top:1px solid var(--border-subtle);
}
.lw-global-status.success{ color:var(--text-accent); }
.lw-global-status.error{ color:#ffb0b0; }
.lw-busy .lw-workspace,
.lw-busy .lw-sidebar{ cursor:progress; }
.lw-complete-panel{
  max-width:620px;
  margin:8vh auto 0;
  padding:32px;
  text-align:center;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-lg);
  background:var(--bg-glass);
}
.lw-complete-icon{ font-size:42px; margin-bottom:10px; }
.lw-complete-panel p{ margin:8px 0 18px; color:var(--text-secondary); }
.lw-private-reminder{ font-size:12px; }
.lw-complete-actions{ display:flex; flex-wrap:wrap; justify-content:center; gap:10px; }
.lecture-workflow-modal :is(input, select, textarea, button):focus-visible{
  outline:3px solid var(--text-accent) !important;
  outline-offset:3px;
}
.lecture-workflow-modal .field-hint{ color:var(--text-secondary); }
.lecture-workflow-modal [aria-invalid="true"]{
  border-color:#ff8585 !important;
  box-shadow:0 0 0 2px rgba(224,82,82,.22);
}
.lecture-workflow-modal :is(input, textarea)[readonly]{
  background:rgba(255,255,255,.025);
  color:var(--text-secondary);
}

/* 수강생 회기 상세에 노출되는, 검토 완료 공개 항목 */
.follow-up-section{
  padding:16px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-md);
  background:var(--bg-glass);
}
.follow-up-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:12px;
}
.follow-up-heading h3{ margin:0; }
.follow-up-badge{
  padding:3px 8px;
  border:1px solid var(--text-accent);
  border-radius:999px;
  color:var(--text-accent);
  font-size:10px;
  font-weight:700;
  white-space:nowrap;
}
.follow-up-grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:10px;
}
.follow-up-card{
  padding:12px;
  border:1px solid var(--border-subtle);
  border-radius:var(--radius-sm);
  background:var(--bg-secondary);
}
.follow-up-card h4{ margin-bottom:6px; color:var(--text-primary); font-size:13px; }
.follow-up-card ul{ margin:0; padding-left:18px; }
.follow-up-card li{ color:var(--text-secondary); font-size:12px; line-height:1.55; overflow-wrap:anywhere; }

/* 수강생 회기 상세: 지난 시간 후기와 더 공부할 자료(관리자가 고른 내용) */
.fb-note-grid{ grid-template-columns:repeat(2, minmax(0, 1fr)); }
.feedback-note-section .follow-up-card p{ margin:0; color:var(--text-secondary); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.fb-note-wide{ margin-top:10px; }
.fb-note-quotes,
.fb-note-links{ list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px; }
.fb-note-quotes li{ padding-left:10px; border-left:3px solid var(--text-accent); color:var(--text-secondary); font-size:13px; line-height:1.6; overflow-wrap:anywhere; }
.fb-note-links li{ display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 8px; font-size:13px; line-height:1.6; }
.fb-note-links a{ color:var(--text-accent); overflow-wrap:anywhere; }
.fb-note-kind{ color:var(--text-secondary); font-size:11px; white-space:nowrap; }
.fb-note-links small{ flex-basis:100%; color:var(--text-secondary); font-size:11px; }

html[data-theme='light'] .lw-report-error,
html[data-theme='light'] .lw-global-status.error,
html[data-theme='light'] .lw-callout.error,
html[data-theme='light'] .lw-required{ color:#a72b2b !important; }
html[data-theme='light'] .lw-private-badge{ color:#765700; }

@media (max-width:800px){
  .lecture-workflow-modal{ padding:0; }
  .lecture-workflow-modal .modal{
    height:100dvh;
    max-height:100dvh;
    border-radius:0;
    border-left:0;
    border-right:0;
  }
  .lw-modal-body{
    display:block;
    overflow-y:auto;
  }
  .lw-sidebar{
    max-height:260px;
    border-right:0;
    border-bottom:1px solid var(--border-subtle);
  }
  .lw-workspace{ overflow:visible; }
  .lw-form-grid,
  .lw-review-grid,
  .lw-fact-grid,
  .lw-upload-grid,
  .follow-up-grid,
  .fb-note-grid{ grid-template-columns:1fr; }
  .lw-drive-panel-head{ align-items:stretch; flex-direction:column; }
  .lw-drive-file{ grid-template-columns:1fr; }
  .lw-drive-kind{ padding-left:52px; }
  .lw-drive-kind select{ width:100%; }
  .lw-form-actions .btn{ flex:1 1 180px; white-space:normal; }
}

@media (max-width:480px){
  .lecture-workflow-modal .modal-header{ padding:16px; }
  .lw-workspace{ padding:18px 14px 30px; }
  .lw-sidebar{ padding:14px; }
  .lw-fieldset{ padding:14px; }
  .lw-time-pair{ grid-template-columns:1fr; }
}

@media (prefers-reduced-motion:reduce){
  .lecture-workflow-modal .modal{ transition:none; }
}


/* ════════════════════════════════════════
   공지사항 + 관리자 새 댓글 알림
   ════════════════════════════════════════ */
.notice-board{
  max-width:780px; margin:0 auto 28px; padding:16px 18px;
  border:1px solid var(--border-subtle); border-radius:var(--radius-md);
  background:var(--bg-card); box-shadow:var(--shadow-glow);
}
.notice-board[hidden]{ display:none; }
.notice-board-head{ display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:8px; }
.notice-board-head h2{ font-size:16px; color:var(--text-accent); margin:0; }
.notice-more{
  background:none; border:0; cursor:pointer; font:inherit; font-size:13px;
  color:var(--text-secondary); padding:4px 6px; border-radius:var(--radius-sm);
}
.notice-more:hover{ color:var(--text-accent); background:var(--bg-glass); }

.notice-list{ list-style:none; margin:0; padding:0; }
.notice-item{
  display:flex; align-items:center; gap:8px;
  border-top:1px solid var(--border-subtle);
}
.notice-item:first-child{ border-top:0; }
.notice-row{
  flex:1 1 auto; min-width:0; display:flex; align-items:center; justify-content:space-between; gap:12px;
  padding:11px 6px; text-align:left; cursor:pointer; font:inherit;
  background:none; border:0; color:var(--text-primary); border-radius:var(--radius-sm);
}
.notice-row:hover{ background:var(--bg-glass); }
.notice-row:focus-visible{ outline:2px solid var(--text-accent); outline-offset:1px; }
.notice-title{ display:flex; align-items:center; gap:6px; min-width:0; font-size:14px; font-weight:600; }
.notice-title-text{ overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.notice-date{ flex-shrink:0; font-size:12px; color:var(--text-muted); }
.notice-pin{ flex-shrink:0; font-size:13px; }
.notice-tag{
  flex-shrink:0; font-size:10px; font-weight:800; letter-spacing:.3px;
  padding:2px 6px; border-radius:999px; line-height:1.3;
}
.notice-tag.new{ background:#e05252; color:#fff; }
.notice-tag.draft{ background:var(--bg-glass); color:var(--text-muted); border:1px dashed var(--border-subtle); }
.notice-tag.scheduled{ background:#4a90d9; color:#fff; }
.notice-admin{ display:flex; gap:4px; flex-shrink:0; padding-right:4px; }
.notice-empty{ padding:18px 8px; text-align:center; color:var(--text-secondary); font-size:14px; }
.notice-empty.muted{ color:var(--text-muted); font-size:12px; padding:8px; }

.notice-meta{ display:flex; align-items:center; gap:8px; margin-bottom:14px; font-size:13px; color:var(--text-muted); }
.notice-body{ font-size:14px; line-height:1.75; color:var(--text-primary); overflow-wrap:anywhere; }
.notice-body p{ margin:0 0 12px; }
.notice-body ul{ margin:0 0 12px; padding-left:20px; }
.notice-body li{ margin-bottom:6px; }
.notice-body .notice-h{ margin:20px 0 8px; color:var(--text-accent); line-height:1.4; }
.notice-body h3.notice-h{ font-size:16px; padding-bottom:4px; border-bottom:1px solid var(--border-subtle); }
.notice-body h4.notice-h{ font-size:14px; }
.notice-body a{ color:var(--text-accent); text-decoration:underline; text-underline-offset:2px; }
.notice-body strong{ color:var(--text-primary); }

.notice-edit-body{ min-height:240px !important; line-height:1.6; }
.notice-hint{ margin:6px 0 0; font-size:12px; color:var(--text-muted); line-height:1.7; }
.notice-hint code{ background:var(--bg-glass); padding:1px 5px; border-radius:4px; font-size:11px; }
.notice-edit-flags{ display:flex; flex-direction:column; gap:8px; }
.notice-edit-flags label{ display:flex; align-items:center; gap:8px; margin:0; cursor:pointer; }
.notice-edit-flags input[type="checkbox"]{ width:auto; }

/* ── 공지 팝업 ── */
#notice-popup .modal{ max-width:720px; height:min(640px, 86vh); }   /* 목록↔상세를 바꿔도 크기가 출렁이지 않게 고정 */
.notice-head-left{ display:flex; align-items:center; gap:10px; min-width:0; }
.notice-head-right{ display:flex; align-items:center; gap:8px; flex-shrink:0; }
.notice-head-left h2{ min-width:0; }
.notice-head-left h2:focus, .notice-detail-title:focus{ outline:none; }
.notice-back{
  flex-shrink:0; font:inherit; font-size:13px; font-weight:600; cursor:pointer;
  color:var(--text-accent); background:var(--bg-glass);
  border:1px solid var(--border-subtle); border-radius:999px; padding:5px 12px;
  transition:var(--transition-fast);
}
.notice-back:hover{ border-color:var(--text-accent); }
.notice-back:focus-visible{ outline:2px solid var(--text-accent); outline-offset:2px; }
.notice-popup-body{ overflow-x:hidden; }
.notice-lead{ margin:0 0 6px; font-size:13px; color:var(--text-muted); }
.notice-detail-title{ margin:0 0 8px; font-size:18px; line-height:1.45; overflow-wrap:anywhere; }

/* 목록 ↔ 상세 전환 */
.notice-view.enter-fwd { animation:notice-in-fwd  .28s cubic-bezier(.16,1,.3,1) both; }
.notice-view.enter-back{ animation:notice-in-back .28s cubic-bezier(.16,1,.3,1) both; }
@keyframes notice-in-fwd { from{ opacity:0; transform:translateX(24px); } }
@keyframes notice-in-back{ from{ opacity:0; transform:translateX(-24px); } }

/* 팝업 열림·닫힘 모션 (.popup-motion)
   기존 .modal-overlay 는 display:none ↔ flex 로 바뀌어 전환이 걸리지 않았다(열릴 땐 툭, 닫힐 땐 사라짐).
   display 는 유지하고 visibility·opacity·transform 으로 숨겨서 열 때와 닫을 때 모두 움직이게 한다.
   Esc·바깥 클릭·✕ 등 닫는 길이 모두 .active 만 빼므로 어느 쪽으로 닫아도 같은 모션이 나온다. */
.modal-overlay.popup-motion{
  display:flex; visibility:hidden; pointer-events:none; opacity:0;
  transition:opacity .2s ease, visibility 0s linear .2s;
}
.modal-overlay.popup-motion.active{
  visibility:visible; pointer-events:auto; opacity:1;
  transition:opacity .24s ease, visibility 0s;
}
.popup-motion .modal{
  opacity:0; transform:scale(.92);                              /* 기준점은 JS 가 누른 자리로 잡는다 */
  transition:transform .2s cubic-bezier(.4,0,1,1), opacity .16s ease;
}
.popup-motion.active .modal{
  opacity:1; transform:none;
  transition:transform .34s cubic-bezier(.16,1,.3,1), opacity .2s ease;
}
/* 편집 모달은 공지 팝업 위에 겹쳐 뜨므로 배경을 덜 어둡게 해 겹침이 답답하지 않게 한다 */
#notice-edit-modal{ background:rgba(0,0,0,.45); }

@media (prefers-reduced-motion:reduce){
  .modal-overlay.popup-motion{ transition:opacity .12s linear, visibility 0s linear .12s; }
  .modal-overlay.popup-motion.active{ transition:opacity .12s linear, visibility 0s; }
  .popup-motion .modal, .popup-motion.active .modal{ transform:none; transition:opacity .12s linear; }
  .notice-view.enter-fwd, .notice-view.enter-back{ animation:none; }
}

/* 새 댓글 알림 배지 */
.notif-badge{
  display:inline-flex; align-items:center; justify-content:center;
  min-width:18px; height:18px; padding:0 5px; margin-left:4px;
  border-radius:999px; background:#e05252; color:#fff;
  font-size:11px; font-weight:800; line-height:1;
}
.notif-badge.hidden{ display:none; }
.notif-badge.inline{ margin-left:6px; vertical-align:1px; }
.admin-comments-btn.has-unread{ border-color:#e05252 !important; }

.inbox-inst{ margin-bottom:18px; }
.inbox-inst h3{ font-size:15px; margin:0 0 8px; color:var(--text-accent); }
.inbox-count{ font-size:12px; font-weight:400; color:var(--text-muted); margin-left:4px; }
.inbox-text{ min-width:0; }
.inbox-snippet{
  margin-top:4px; font-size:13px; color:var(--text-secondary);
  display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; overflow-wrap:anywhere;
}
.inbox-empty{ text-align:center; color:var(--text-secondary); padding:28px 8px; }

@media (max-width: 640px){
  .notice-board{ margin:0 16px 22px; padding:12px 12px; }
  #notice-popup .modal{ height:min(640px, 92vh); }
  .notice-row{ flex-direction:column; align-items:stretch; gap:2px; }
  .notice-title-text{ white-space:normal; overflow:visible; overflow-wrap:anywhere; }
  .notice-title{ align-items:flex-start; }
  .notice-item{ align-items:flex-start; }
  .notice-admin{ padding-top:10px; }
  /* 관리자 툴바: left:50% 로 놓인 고정 요소가 화면 절반 너비로 줄어 세로로 길어지는 것을 막는다 */
  .admin-bar{
    width:calc(100vw - 24px); max-width:none; bottom:10px; gap:6px;
    padding:8px 10px; border-radius:var(--radius-md);
  }
  .admin-bar .admin-bar-label{ flex:1 0 100%; text-align:center; }
}

/* ════════════════════════════════════════
   체험용 샘플(?sample) — index.html <head>의 판정 스크립트가 <html>에 is-sample 을 붙인다
   ════════════════════════════════════════ */
.sample-only{ display:none; }
html.is-sample .sample-only{ display:block; }
html.is-sample [data-sample-hide]{ display:none !important; }

html.is-sample .sample-gate-hint{
  max-width:600px; margin:-10px auto 18px; padding:10px 14px;
  font-size:13px; line-height:1.6; text-align:left; color:var(--text-secondary);
  background:var(--bg-glass); border:1px dashed var(--text-accent); border-radius:var(--radius-sm);
}
.sample-banner{
  max-width:780px; margin:0 auto 28px; padding:16px 20px; text-align:left;
  background:var(--bg-card); border:1px dashed var(--text-accent); border-radius:var(--radius-md);
}
.sample-banner h2{ font-size:18px; color:var(--text-primary); margin:0 0 6px; }
.hero .sample-banner p{ max-width:none; margin:0 0 12px; font-size:14px; }
.sample-tour{ margin:0 0 14px; font-size:14px; color:var(--text-secondary); }
.sample-tour summary{ cursor:pointer; font-weight:700; color:var(--text-accent); }
.sample-tour ol{ margin:10px 0 0; padding-left:22px; line-height:1.7; }
.sample-tour li + li{ margin-top:4px; }
.sample-tour summary:focus-visible,
.sample-restart:focus-visible{ outline:2px solid var(--text-accent); outline-offset:2px; }
.sample-callout{
  margin:12px 0 0; padding:10px 14px; font-size:13px; line-height:1.6; color:var(--text-secondary);
  background:var(--bg-glass); border:1px dashed var(--border-subtle); border-radius:var(--radius-sm);
}
@media (max-width: 640px){
  .sample-banner{ padding:14px 16px; }
}
