/* ─── Dear Diary — Main Stylesheet ─────────────────────────────────────────── */

/* ── Google Fonts fallback ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Noto Sans KR', sans-serif;
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}
a { text-decoration: none; color: inherit; }
img, video { max-width: 100%; display: block; }

/* ─── CSS 변수 (테마별) ──────────────────────────────────────────────────────── */

/* 러블리 (기본) */
.theme-lovely {
  --bg:          #fff0f6;
  --bg2:         #fff;
  --card:        #fff;
  --border:      #f9c0d8;
  --primary:     #e91e8c;
  --primary-fg:  #fff;
  --text:        #3d1a2e;
  --text-muted:  #b07090;
  --accent:      #fce4ec;
  --danger:      #e53935;
  --nav-bg:      #fff0f6;
  --shadow:      0 2px 16px rgba(233,30,140,0.08);
  background: var(--bg);
  color: var(--text);
}

/* 모던 */
.theme-modern {
  --bg:          #f5f5f7;
  --bg2:         #fff;
  --card:        #fff;
  --border:      #e0e0e0;
  --primary:     #1a1a2e;
  --primary-fg:  #fff;
  --text:        #1a1a2e;
  --text-muted:  #888;
  --accent:      #f0f0f0;
  --danger:      #e53935;
  --nav-bg:      #fff;
  --shadow:      0 2px 16px rgba(0,0,0,0.07);
  background: var(--bg);
  color: var(--text);
}

/* 앤틱 */
.theme-antique {
  --bg:          #f5efe0;
  --bg2:         #fdf8ee;
  --card:        #fdf8ee;
  --border:      #d4b896;
  --primary:     #8b5e3c;
  --primary-fg:  #fff;
  --text:        #3d2b1f;
  --text-muted:  #9c7b5e;
  --accent:      #f0e6d0;
  --danger:      #c0392b;
  --nav-bg:      #f5efe0;
  --shadow:      0 2px 16px rgba(139,94,60,0.1);
  background: var(--bg);
  color: var(--text);
  font-family: 'Nanum Myeongjo', serif;
}

/* 엘레강스 */
.theme-elegant {
  --bg:          #f8f4ff;
  --bg2:         #fff;
  --card:        #fff;
  --border:      #d8c8f0;
  --primary:     #6a1b9a;
  --primary-fg:  #fff;
  --text:        #2d1b4e;
  --text-muted:  #9575cd;
  --accent:      #ede7f6;
  --danger:      #e53935;
  --nav-bg:      #f8f4ff;
  --shadow:      0 2px 16px rgba(106,27,154,0.08);
  background: var(--bg);
  color: var(--text);
  font-family: 'Playfair Display', 'Noto Sans KR', serif;
}

/* 다크 */
.theme-dark {
  --bg:          #121212;
  --bg2:         #1e1e1e;
  --card:        #1e1e1e;
  --border:      #333;
  --primary:     #bb86fc;
  --primary-fg:  #000;
  --text:        #e0e0e0;
  --text-muted:  #888;
  --accent:      #2a2a2a;
  --danger:      #cf6679;
  --nav-bg:      #1a1a1a;
  --shadow:      0 2px 16px rgba(0,0,0,0.4);
  background: var(--bg);
  color: var(--text);
}

/* ─── 레이아웃 ───────────────────────────────────────────────────────────────── */

.page-wrap {
  max-width: 600px;
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
  min-height: 100vh;
}

/* 하단 네비게이션 */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  display: flex;
  background: var(--nav-bg);
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.6rem 0.25rem 0.5rem;
  gap: 0.15rem;
  color: var(--text-muted);
  font-size: 0.7rem;
  transition: color 0.2s;
}
.nav-item.active { color: var(--primary); }
.nav-icon { font-size: 1.3rem; }

/* ─── 버튼 ───────────────────────────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { filter: brightness(1.08); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-full { width: 100%; }
.btn-sm { padding: 0.4rem 0.9rem; font-size: 0.8rem; }

/* ─── 커버 페이지 ────────────────────────────────────────────────────────────── */

.cover-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 60%, #fff) 100%);
}
.cover-deco {
  position: absolute;
  font-size: 2rem;
  opacity: 0.25;
  animation: float 4s ease-in-out infinite;
}
.cover-deco-1 { top: 10%; left: 8%; animation-delay: 0s; }
.cover-deco-2 { top: 20%; right: 10%; animation-delay: 1s; }
.cover-deco-3 { bottom: 25%; right: 8%; animation-delay: 2s; }
.cover-deco-4 { bottom: 15%; left: 12%; animation-delay: 0.5s; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
.cover-content {
  text-align: center;
  padding: 2rem 1.5rem;
  max-width: 360px;
  width: 100%;
  z-index: 1;
}
.cover-icon { font-size: 4rem; margin-bottom: 0.5rem; }
.cover-title {
  font-size: 2.8rem;
  font-weight: 700;
  color: #fff;
  font-family: 'Playfair Display', serif;
  margin-bottom: 0.3rem;
}
.cover-subtitle { color: rgba(255,255,255,0.85); font-size: 1rem; margin-bottom: 0.5rem; }
.cover-icons-row { font-size: 1.2rem; margin-bottom: 1rem; }
.cover-quote {
  color: rgba(255,255,255,0.9);
  font-style: italic;
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 1.5rem;
}
.cover-lang-row {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.lang-btn {
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  font-size: 0.75rem;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s;
}
.lang-btn.active, .lang-btn:hover { background: rgba(255,255,255,0.4); }
.cover-content .btn { margin-bottom: 0.75rem; }
.btn-outline.btn-full { border-color: rgba(255,255,255,0.6); color: #fff; }
.btn-outline.btn-full:hover { background: rgba(255,255,255,0.15); }

/* ─── 인증 페이지 ────────────────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--bg);
}
.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  width: 100%;
  max-width: 380px;
  box-shadow: var(--shadow);
}
.auth-back { font-size: 0.85rem; color: var(--text-muted); display: block; margin-bottom: 1rem; }
.auth-icon { font-size: 3rem; text-align: center; margin-bottom: 0.5rem; }
.auth-title { font-size: 1.5rem; font-weight: 700; text-align: center; margin-bottom: 1.5rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted); }
.form-group input, .modal-input {
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
  transition: border-color 0.2s;
}
.form-group input:focus, .modal-input:focus { border-color: var(--primary); }
.auth-switch { text-align: center; margin-top: 1rem; font-size: 0.85rem; color: var(--text-muted); }
.auth-switch a { color: var(--primary); font-weight: 600; }
.auth-terms { text-align: center; margin-top: 0.75rem; font-size: 0.78rem; color: var(--text-muted); }
.auth-terms a { color: var(--primary); }
.alert {
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error   { background: #fde8e8; color: #c0392b; border: 1px solid #f5c6c6; }
.alert-success { background: #e8f5e9; color: #2e7d32; border: 1px solid #c8e6c9; }

/* ─── 달력 ───────────────────────────────────────────────────────────────────── */

.calendar-page { padding-bottom: 1rem; }
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  margin-bottom: 0.5rem;
}
.cal-nav-btn {
  width: 2.5rem; height: 2.5rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 1.4rem;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}
.cal-nav-btn:hover { background: var(--accent); }
.cal-title-wrap { text-align: center; }
.cal-month-title { font-size: 1.2rem; font-weight: 700; }
.today-btn {
  font-size: 0.72rem;
  color: var(--primary);
  background: var(--accent);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-top: 0.2rem;
  display: inline-block;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0;
}
.cal-dow.sun { color: #e53935; }
.cal-dow.sat { color: #1565c0; }
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.3rem 0.1rem;
  border-radius: 0.6rem;
  font-size: 0.85rem;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
  overflow: hidden;
}
.cal-cell:hover { background: var(--accent); }
.cal-cell.empty { cursor: default; }
.cal-cell.today { background: var(--primary); color: var(--primary-fg); }
.cal-cell.today:hover { filter: brightness(1.1); }
.cal-cell.has-entry:not(.today) { background: color-mix(in srgb, var(--primary) 12%, transparent); }
.cal-cell.sun:not(.today) .cal-day { color: #e53935; }
.cal-cell.sat:not(.today) .cal-day { color: #1565c0; }
.cal-day { font-weight: 600; line-height: 1.2; }
.cal-mood { font-size: 0.9rem; }
.cal-snippet { font-size: 0.6rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; text-align: center; }
.cal-lock { font-size: 0.75rem; }

/* ─── 일기 편집기 ────────────────────────────────────────────────────────────── */

.diary-page { padding-bottom: 1rem; }
.diary-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0 1rem;
}
.diary-header-info { flex: 1; }
.diary-date { font-size: 1.05rem; font-weight: 700; }
.diary-header-actions { display: flex; align-items: center; gap: 0.5rem; }
.icon-btn {
  width: 2.2rem; height: 2.2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--border);
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.2s;
}
.icon-btn:hover { background: var(--accent); }
.icon-arrow { font-size: 1.1rem; color: var(--text-muted); }

.diary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.6rem;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--accent);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border: 1.5px solid transparent;
}
.chip.active {
  background: var(--primary);
  color: var(--primary-fg);
  border-color: var(--primary);
}
.chip:hover:not(.active) { border-color: var(--primary); color: var(--primary); }

.diary-title-input {
  width: 100%;
  padding: 0.9rem 1.1rem;
  border-radius: 1rem;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  outline: none;
  box-shadow: var(--shadow);
  transition: border-color 0.2s;
}
.diary-title-input:focus { border-color: var(--primary); }
.diary-content-wrap {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
  position: relative;
}
.diary-content {
  width: 100%;
  padding: 1rem 1.1rem;
  background: transparent;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 2;
  resize: none;
  outline: none;
  font-family: inherit;
}

/* 잠금 화면 */
.locked-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 3rem 2rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.locked-icon { font-size: 4rem; margin-bottom: 1rem; }
.locked-card h2 { font-size: 1.3rem; margin-bottom: 0.5rem; }
.locked-card p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.5rem; }

/* 미디어 */
.media-section { }
.media-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.75rem; }
.media-empty {
  border: 2px dashed var(--border);
  border-radius: 0.75rem;
  padding: 2.5rem 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: border-color 0.2s;
}
.media-empty:hover { border-color: var(--primary); }
.media-slider { position: relative; border-radius: 0.75rem; overflow: hidden; background: #000; aspect-ratio: 1; }
.media-slides { position: relative; width: 100%; height: 100%; }
.media-slide { position: absolute; inset: 0; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.media-slide.active { opacity: 1; pointer-events: auto; }
.media-img { width: 100%; height: 100%; object-fit: contain; }
.media-delete-form { position: absolute; top: 0.5rem; right: 0.5rem; }
.media-delete-btn {
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2rem; height: 2rem;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.media-delete-btn:hover { background: rgba(229,57,53,0.8); }
.slide-btn {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 2rem; height: 2rem;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.slide-btn:hover { background: rgba(0,0,0,0.65); }
.slide-prev { left: 0.5rem; }
.slide-next { right: 0.5rem; }
.slide-counter {
  position: absolute;
  top: 0.5rem; left: 0.5rem;
  background: rgba(0,0,0,0.4);
  color: #fff;
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}
.slide-dots {
  position: absolute;
  bottom: 0.75rem;
  left: 0; right: 0;
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}
.slide-dot {
  width: 0.5rem; height: 0.5rem;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  border: none;
  cursor: pointer;
  transition: all 0.2s;
}
.slide-dot.active { width: 1rem; border-radius: 999px; background: #fff; }
.media-thumbs { display: flex; gap: 0.4rem; margin-top: 0.5rem; overflow-x: auto; padding-bottom: 0.25rem; }
.media-thumb {
  flex-shrink: 0;
  width: 3.5rem; height: 3.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--accent);
  cursor: pointer;
  transition: all 0.15s;
  display: flex; align-items: center; justify-content: center;
}
.media-thumb.active { border-color: var(--primary); transform: scale(1.05); }
.media-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-video-icon { font-size: 1.2rem; color: var(--text-muted); }

/* 토스트 */
.toast-msg {
  position: fixed;
  bottom: 5rem; left: 50%; transform: translateX(-50%);
  background: var(--primary);
  color: var(--primary-fg);
  padding: 0.6rem 1.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  z-index: 200;
  transition: opacity 0.5s;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* ─── 메모 ───────────────────────────────────────────────────────────────────── */

.notes-page { }
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0 0.75rem;
}
.page-title { font-size: 1.4rem; font-weight: 700; }
.notes-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}
.note-card {
  border-radius: 1rem;
  padding: 1rem;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
  border: 1px solid var(--border);
  min-height: 8rem;
}
.note-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.note-pin { position: absolute; top: 0.5rem; right: 0.5rem; font-size: 0.9rem; }
.note-title { font-size: 0.9rem; font-weight: 700; color: #333; margin-bottom: 0.4rem; }
.note-content { font-size: 0.78rem; color: #555; line-height: 1.5; }
.note-date { font-size: 0.68rem; color: #999; margin-top: 0.5rem; }

/* ─── 검색 ───────────────────────────────────────────────────────────────────── */

.search-page { }
.search-form { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.search-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text);
  font-size: 0.9rem;
  outline: none;
}
.search-input:focus { border-color: var(--primary); }
.search-results { display: flex; flex-direction: column; gap: 0.5rem; }
.search-result-item {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1rem;
  transition: background 0.15s;
  display: block;
}
.search-result-item:hover { background: var(--accent); }
.result-date { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.result-title { font-size: 0.95rem; font-weight: 600; margin-bottom: 0.3rem; }
.result-snippet { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; }

/* ─── 설정 ───────────────────────────────────────────────────────────────────── */

.settings-page { }
.settings-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 1.25rem;
  margin-bottom: 0.75rem;
  box-shadow: var(--shadow);
}
.settings-section-title { font-size: 0.85rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.75rem; }
.theme-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.4rem; }
.theme-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.6rem 0.25rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  background: var(--accent);
}
.theme-item.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.theme-emoji { font-size: 1.3rem; }
.theme-label { font-size: 0.65rem; font-weight: 600; color: var(--text-muted); }
.lang-grid { display: flex; gap: 0.5rem; }
.lang-item {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.65rem;
  border-radius: 0.75rem;
  border: 2px solid transparent;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--accent);
  transition: all 0.15s;
}
.lang-item.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, transparent); }
.account-info { display: flex; flex-direction: column; gap: 0.6rem; }
.account-row { display: flex; justify-content: space-between; font-size: 0.9rem; }
.account-label { color: var(--text-muted); font-size: 0.82rem; }
.danger-zone { border-color: color-mix(in srgb, var(--danger) 40%, transparent); }
.danger-title { color: var(--danger); }
.danger-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.75rem; }

/* ─── 모달 ───────────────────────────────────────────────────────────────────── */

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal-card {
  background: var(--card);
  border-radius: 1.5rem;
  padding: 1.75rem;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-large { max-width: 440px; }
.modal-card h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: 1rem; }
.modal-desc { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 1rem; }
.modal-input { margin-bottom: 0.75rem; display: block; }
.modal-textarea {
  width: 100%;
  padding: 0.7rem 1rem;
  border-radius: 0.75rem;
  border: 1.5px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.9rem;
  resize: none;
  outline: none;
  margin-bottom: 0.75rem;
  font-family: inherit;
}
.modal-textarea:focus { border-color: var(--primary); }
.modal-btns { display: flex; gap: 0.5rem; justify-content: flex-end; flex-wrap: wrap; }
.color-row { display: flex; gap: 0.5rem; margin-bottom: 0.75rem; }
.color-chip { cursor: pointer; }
.color-dot {
  width: 1.5rem; height: 1.5rem;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: block;
  transition: transform 0.15s;
}
.color-chip.active .color-dot, .color-chip:hover .color-dot { transform: scale(1.2); border-color: var(--primary); }

/* ─── 법적 페이지 ────────────────────────────────────────────────────────────── */

.legal-page {
  min-height: 100vh;
  background: var(--bg);
  padding: 2rem 1rem;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}
.legal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1.5rem;
  padding: 2rem 1.75rem;
  max-width: 680px;
  width: 100%;
  box-shadow: var(--shadow);
}
.legal-card h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.25rem; }
.legal-date { color: var(--text-muted); font-size: 0.82rem; margin-bottom: 1.5rem; }
.legal-card h2 { font-size: 1rem; font-weight: 700; margin: 1.25rem 0 0.5rem; }
.legal-card p, .legal-card li { font-size: 0.9rem; line-height: 1.7; color: var(--text); }
.legal-card ul { padding-left: 1.25rem; margin-bottom: 0.5rem; }
.legal-card a { color: var(--primary); }
.legal-footer { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--border); font-size: 0.82rem; color: var(--text-muted); }
.legal-footer a { color: var(--primary); margin: 0 0.25rem; }

/* ─── 빈 상태 ────────────────────────────────────────────────────────────────── */

.empty-state {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
}
.empty-icon { font-size: 3rem; margin-bottom: 1rem; }
.empty-state p { font-size: 0.9rem; line-height: 1.7; }

/* ─── 반응형 ─────────────────────────────────────────────────────────────────── */

@media (max-width: 400px) {
  .theme-grid { grid-template-columns: repeat(5, 1fr); }
  .theme-label { font-size: 0.58rem; }
  .notes-grid { grid-template-columns: 1fr; }
}
