/* =========================================================
   현대 그리스어 학습 앱 — 성지순례자를 위한 현대 그리스어
   Design System | main.css
   =========================================================
   색채 테마: 에게해 블루 (지중해 · 그리스 국기)
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Serif:ital,wght@0,400;0,600;0,700;1,400&family=GFS+Didot&family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

/* ── CSS 변수 ── */
:root {
  /* 배경 */
  --bg:          #06080e;
  --surface:     #0c1221;
  --surface-2:   #111b30;
  --surface-3:   #182340;
  --border:      #1c2e50;
  --border-2:    #253e6e;

  /* 에게해 블루 (주 색상) */
  --blue:        #3a7bd5;
  --blue-light:  #6fa3ee;
  --blue-dark:   #1e4d9a;
  --blue-glow:   rgba(58,123,213,0.12);
  --blue-deep:   #0d2f6e;

  /* 지중해 하늘빛 */
  --sky:         #38bdf8;
  --sky-l:       #7dd3fc;
  --sky-dark:    #0284c7;

  /* 올리브 골드 (그리스 문화 상징) */
  --gold:        #d4a843;
  --gold-light:  #f0c96a;
  --gold-dark:   #8a6a1e;

  /* 흰색 계열 (그리스 국기, 건축) */
  --white:       #e8f0fe;
  --white-dim:   #b8cae8;

  /* 텍스트 */
  --text:        #e8f0fe;
  --text-muted:  #7a9ec8;
  --text-dim:    #3e5a80;
  --text-inv:    #06080e;

  /* 그리스어 폰트 */
  --gr-font:     'GFS Didot', 'Times New Roman', serif;
  --font-ui:     'Inter', 'Noto Sans KR', sans-serif;
  --font-serif:  'Noto Serif', serif;
  --font-kr:     'Noto Sans KR', 'Apple SD Gothic Neo', sans-serif;

  /* 형태 */
  --radius-sm:   6px;
  --radius:      12px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  /* 그림자 */
  --shadow-sm:   0 2px 8px rgba(0,0,0,0.5);
  --shadow:      0 4px 20px rgba(0,0,0,0.6);
  --shadow-lg:   0 8px 40px rgba(0,0,0,0.7);
  --shadow-blue: 0 0 30px rgba(58,123,213,0.18);

  --transition:  all 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* iOS 터치 최적화 */
a, button, [role="button"], input, select, textarea, label {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* ── 타이포그래피 ── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}
h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.1rem; }

a {
  color: var(--blue-light);
  text-decoration: none;
  transition: var(--transition);
}
a:hover { color: var(--sky-l); }

p { margin-bottom: 1rem; }
p:last-child { margin-bottom: 0; }

/* ── 그리스어 텍스트 ── */
.gr, [lang="el"] {
  font-family: var(--gr-font);
  font-size: 1.1em;
  color: var(--blue-light);
  line-height: 1.6;
}
.gr-lg {
  font-family: var(--gr-font);
  font-size: 1.4em;
  color: var(--blue-light);
  line-height: 1.5;
}
.gr-xl {
  font-family: var(--gr-font);
  font-size: 2em;
  color: var(--blue-light);
  line-height: 1.4;
}
.romanization {
  font-size: 0.85em;
  color: var(--sky-l);
  font-style: italic;
}
.translation {
  font-size: 0.85em;
  color: var(--text-muted);
}

/* ── 레이아웃 ── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 4rem 0;
}

.section-title {
  font-size: 1.8rem;
  font-family: var(--font-serif);
  color: var(--text);
  margin-bottom: 0.5rem;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2.5rem;
}

/* ── 공통 페이지 레이아웃 (사이드바 + 콘텐츠) ── */
.page-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 64px);
  margin-top: 64px;
}
.page-sidebar {
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  scrollbar-width: thin;
  scrollbar-color: var(--border-2) transparent;
}
.page-sidebar::-webkit-scrollbar { width: 4px; }
.page-sidebar::-webkit-scrollbar-track { background: transparent; }
.page-sidebar::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 2px; }

.page-content {
  padding: 2rem 2.5rem 5rem;
  max-width: 860px;
  min-width: 0;
}

/* ── 내비게이션 바 ── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 64px;
  background: rgba(6,8,14,0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 0 1.5rem;
  z-index: 100;
}
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}
.navbar-brand-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--blue-dark) 0%, var(--blue) 100%);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--gr-font);
  font-size: 1rem;
  color: #fff;
  font-weight: 700;
}
.navbar-brand-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.navbar-brand-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
  font-weight: 400;
}
.navbar-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}
.navbar-links a {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: var(--transition);
  white-space: nowrap;
}
.navbar-links a:hover { color: var(--text); background: var(--surface-2); }
.navbar-links a.active { color: var(--blue-light); background: var(--blue-glow); }
.navbar-links a svg { opacity: 0.7; }

.navbar-portal {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}
.btn-portal {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-dim);
  background: none;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn-portal:hover {
  border-color: var(--blue-dark);
  color: var(--blue-light);
  background: var(--blue-glow);
}

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.88rem;
  font-weight: 600;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition);
  border: none;
  min-height: 40px;
  text-decoration: none;
}
.btn-primary {
  background: var(--blue);
  color: #fff;
}
.btn-primary:hover { background: var(--blue-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-blue); }
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-2); }
.btn-ghost {
  background: none;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-gold {
  background: var(--gold-dark);
  color: var(--gold-light);
  border: 1px solid var(--gold-dark);
}
.btn-gold:hover { background: var(--gold); color: var(--text-inv); }

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
  min-height: 30px;
  border-radius: var(--radius-sm);
}
.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
  min-height: 52px;
  border-radius: var(--radius-lg);
}

/* ── 카드 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  transition: var(--transition);
}
.card:hover { border-color: var(--border-2); }
.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  font-family: var(--font-ui);
}

/* ── 모듈 카드 (메인 페이지 섹션 링크) ── */
.module-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: var(--transition);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.module-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--blue) 0%, var(--sky) 100%);
  opacity: 0;
  transition: var(--transition);
}
.module-card:hover {
  border-color: var(--blue-dark);
  box-shadow: var(--shadow-blue);
  transform: translateY(-2px);
  color: var(--text);
}
.module-card:hover::before { opacity: 1; }
.module-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
}
.module-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font-serif);
}
.module-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.module-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.module-tag {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--blue-glow);
  border: 1px solid var(--blue-deep);
  color: var(--blue-light);
  letter-spacing: 0.05em;
}

/* ── 배지 / 레벨 표시 ── */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.badge-beginner {
  background: rgba(52,211,153,0.12);
  color: #6ee7b7;
  border: 1px solid rgba(52,211,153,0.2);
}
.badge-intermediate {
  background: rgba(251,191,36,0.12);
  color: #fcd34d;
  border: 1px solid rgba(251,191,36,0.2);
}
.badge-advanced {
  background: rgba(249,115,22,0.12);
  color: #fdba74;
  border: 1px solid rgba(249,115,22,0.2);
}
.badge-blue {
  background: var(--blue-glow);
  color: var(--blue-light);
  border: 1px solid var(--blue-deep);
}
.badge-gold {
  background: rgba(212,168,67,0.12);
  color: var(--gold-light);
  border: 1px solid rgba(212,168,67,0.2);
}

/* ── 입력 요소 ── */
input, select, textarea {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  padding: 0.6rem 0.9rem;
  width: 100%;
  transition: var(--transition);
  outline: none;
  -webkit-appearance: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue-dark);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
input::placeholder { color: var(--text-dim); }

/* 검색 입력 */
.search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-input-wrap input {
  padding-left: 2.5rem;
}
.search-input-wrap svg {
  position: absolute;
  left: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
  flex-shrink: 0;
}

/* ── 탭 네비게이션 ── */
.tab-nav {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  padding: 0 1rem;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 0.7rem 1.2rem;
  border: none;
  background: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.88rem;
  font-family: var(--font-ui);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
  min-height: 44px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--blue-light); border-bottom-color: var(--blue); font-weight: 600; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── 사이드바 공통 ── */
.sidebar-header {
  padding: 1.25rem 1rem 1rem;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.5rem;
}
.sidebar-nav { flex: 1; padding: 0.5rem 0; }
.sidebar-section {
  padding: 0.5rem 0.75rem 0.25rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-top: 0.5rem;
}
.sidebar-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.45rem 1rem;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  font-family: var(--font-ui);
  text-decoration: none;
}
.sidebar-btn:hover { color: var(--text); background: var(--surface-2); }
.sidebar-btn.active {
  color: var(--blue-light);
  border-left-color: var(--blue);
  background: var(--blue-glow);
}
.sidebar-btn .badge { margin-left: auto; }

/* ── 테이블 ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
thead th {
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
tbody td {
  padding: 0.65rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: var(--surface-2); }

/* ── 진행도 바 ── */
.progress-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--sky) 100%);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── 알림 / 노트 박스 ── */
.note-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue-dark);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 1rem 0;
}
.note-box.gold { border-left-color: var(--gold-dark); }
.note-box.teal { border-left-color: var(--sky-dark); }
.note-box strong { color: var(--text); }

/* ── TTS 버튼 ── */
.btn-tts {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
  font-size: 0.82rem;
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-muted);
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.btn-tts:hover { border-color: var(--blue); color: var(--blue-light); background: var(--blue-glow); }
.btn-tts.playing { border-color: var(--sky); color: var(--sky-l); background: rgba(56,189,248,0.08); }

/* ── 플래시카드 ── */
.flashcard-wrap {
  perspective: 1000px;
  cursor: pointer;
  user-select: none;
}
.flashcard {
  position: relative;
  width: 100%; min-height: 200px;
  transform-style: preserve-3d;
  transition: transform 0.45s cubic-bezier(0.4,0,0.2,1);
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0.75rem;
}
.flashcard-back { transform: rotateY(180deg); }
.flashcard-front:hover { border-color: var(--border-2); }

/* ── 구분선 ── */
hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* ── 스크롤바 ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ── 애니메이션 ── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideDown { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes pulseBlue { 0%,100% { box-shadow: 0 0 0 0 var(--blue-glow); } 50% { box-shadow: 0 0 0 6px transparent; } }

.animate-in { animation: fadeIn 0.3s ease both; }

/* ── 검색 오버레이 ── */
.search-overlay {
  position: fixed; inset: 0;
  background: rgba(6,8,14,0.85);
  backdrop-filter: blur(8px);
  z-index: 200;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 10vh;
}
.search-overlay.open { display: flex; }
.search-panel {
  width: 100%;
  max-width: 640px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.2s ease;
}
.search-panel-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.search-panel-header input {
  flex: 1;
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text);
  padding: 0;
}
.search-panel-header input:focus { box-shadow: none; }
.search-results { max-height: 400px; overflow-y: auto; }
.search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}
.search-result-item:hover { background: var(--surface-2); }
.search-result-item:last-child { border-bottom: none; }
.search-result-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}
.search-result-body { flex: 1; }
.search-result-title { font-size: 0.9rem; color: var(--text); margin-bottom: 0.15rem; }
.search-result-title mark { background: rgba(58,123,213,0.2); color: var(--blue-light); border-radius: 2px; padding: 0 2px; }
.search-result-sub { font-size: 0.78rem; color: var(--text-dim); }
.search-result-tag {
  padding: 0.15rem 0.4rem; border-radius: 4px;
  font-size: 0.68rem; font-weight: 600; flex-shrink: 0;
  background: var(--surface-3); color: var(--text-dim); border: 1px solid var(--border);
  align-self: flex-start;
}
.search-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--text-dim); font-size: 0.9rem; }
.search-hint { padding: 0.8rem 1.25rem; font-size: 0.75rem; color: var(--text-dim); border-top: 1px solid var(--border); display: flex; gap: 1.5rem; }
.search-hint span { display: flex; align-items: center; gap: 0.3rem; }

/* ═══════════════════════════════════════════
   모바일 반응형
═══════════════════════════════════════════ */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
  border-radius: var(--radius-sm); transition: var(--transition);
  margin-left: auto;
}
.nav-hamburger:hover { background: var(--surface-3); }
.nav-hamburger span { display: block; height: 2px; background: var(--text-muted); border-radius: 2px; transition: var(--transition); }
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-drawer {
  display: none;
  position: fixed; top: 64px; left: 0; right: 0;
  background: rgba(6,8,14,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  padding: 1rem 1.5rem;
  flex-direction: column; gap: 0.3rem;
  animation: slideDown 0.2s ease;
}
.nav-drawer.open { display: flex; }
.nav-drawer a {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.65rem 0.75rem; border-radius: var(--radius-sm);
  font-size: 0.95rem; font-weight: 500; color: var(--text-muted);
  transition: var(--transition);
}
.nav-drawer a:hover, .nav-drawer a.active { background: var(--blue-glow); color: var(--blue-light); }

/* 모바일 사이드바 토글 */
.mobile-sidebar-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.9rem;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-family: var(--font-ui);
  cursor: pointer;
  transition: var(--transition);
  min-height: 36px;
}
.mobile-sidebar-toggle:hover { border-color: var(--blue-dark); color: var(--blue); background: var(--blue-glow); }

.mobile-sidebar-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(2px);
  z-index: 150;
}
.mobile-sidebar-backdrop.open { display: block; }

.mobile-topbar {
  display: none;
  position: sticky;
  top: 64px;
  z-index: 80;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 1rem;
  align-items: center;
  gap: 0.75rem;
}
.mobile-topbar-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .navbar { padding: 0 1rem; gap: 0.75rem; }
  .navbar-links { display: none; }
  .nav-hamburger { display: flex; }
  .mobile-sidebar-toggle { display: flex; }
  .mobile-topbar { display: flex; }
  .section { padding: 2rem 0; }
  .container { padding: 0 1rem; }
  .page-layout { grid-template-columns: 1fr; }
  .page-sidebar {
    position: fixed;
    top: 0; bottom: 0; left: 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 160;
    height: 100vh;
  }
  .page-sidebar.open { transform: translateX(0); }
  .page-content { padding: 1.25rem 1rem; }
  h1 { font-size: 1.8rem; }
  h2 { font-size: 1.4rem; }
  h3 { font-size: 1.15rem; }
  .section-title { font-size: 1.5rem; }
  .btn { min-height: 44px; padding: 0.65rem 1.1rem; font-size: 0.85rem; }
  .card { padding: 1rem; }
  .module-card { padding: 1.25rem; }
  table { font-size: 0.82rem; }
  thead th, tbody td { padding: 0.5rem 0.65rem; }
}

/* ── iOS 안전영역 ── */
@supports (padding: max(0px)) {
  .navbar {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }
  body { padding-bottom: env(safe-area-inset-bottom); }
}

/* ═══════════════════════════════════════════
   푸터
═══════════════════════════════════════════ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: 4rem;
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.footer-text {
  font-size: 0.78rem;
  color: var(--text-dim);
  line-height: 1.6;
}
.footer-links {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.footer-links a {
  font-size: 0.78rem;
  color: var(--text-dim);
  transition: var(--transition);
}
.footer-links a:hover { color: var(--blue-light); }

/* ═══════════════════════════════════════════
   인쇄 스타일
═══════════════════════════════════════════ */
@media print {
  *, *::before, *::after {
    background: white !important;
    color: #111 !important;
    box-shadow: none !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .gr, [lang="el"] { font-family: 'GFS Didot', 'Times New Roman', serif !important; color: #003399 !important; }
  .navbar, .nav-drawer, .nav-hamburger, .search-overlay, button, .btn, .footer { display: none !important; }
  a[href]::after { content: none !important; }
  @page { margin: 1.5cm 1.8cm; size: A4; }
  body { font-size: 11pt; line-height: 1.5; }
  h1, h2, h3 { page-break-after: avoid; }
  table { page-break-inside: avoid; }
  table, th, td { border: 1px solid #bbb !important; }
  th { background: #f0f0f0 !important; }
}
