/* ============================================================
   style.css - 성경 앱 스타일시트
   색상 변수, 레이아웃, 컴포넌트 순서로 구성
   ============================================================ */

/* ── 색상 & 폰트 변수 ── */
:root {
  --primary:      #4a6fa5;   /* 메인 파란색 */
  --primary-dark: #2e4d7a;
  --accent:       #c8a96e;   /* 골든 강조색 */
  --bg:           #f9f6f0;   /* 크림색 배경 */
  --bg-card:      #ffffff;
  --text:         #2c2c2c;
  --text-muted:   #888;
  --border:       #ddd;
  --shadow:       0 2px 8px rgba(0,0,0,.1);
  --radius:       8px;
  --font:         'Malgun Gothic', '맑은 고딕', sans-serif;
}

/* ── 리셋 & 기본 ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

/* ── 헤더 ── */
.header {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 56px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: .05em;
  white-space: nowrap;
}

/* ── 탭 네비게이션 ── */
.nav-tabs {
  display: flex;
  gap: 4px;
}

.tab {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  padding: 8px 16px;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--font);
  transition: background .2s, color .2s;
}

.tab:hover  { background: rgba(255,255,255,.15); color: #fff; }
.tab.active { background: rgba(255,255,255,.25); color: #fff; font-weight: 600; }

/* ── 메인 컨테이너 ── */
.container {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px;
}

/* ── 탭 콘텐츠 ── */
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============================================================
   성경 읽기 탭
   ============================================================ */
.read-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 16px;
  min-height: calc(100vh - 90px);
}

/* 사이드바 */
.sidebar {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-y: auto;
  max-height: calc(100vh - 90px);
  padding: 8px;
}

/* 구약/신약 필터 */
.testament-filter {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.filter-btn {
  flex: 1;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  font-size: .8rem;
  font-family: var(--font);
  transition: background .2s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.filter-cnt {
  font-size: .7rem;
  opacity: .75;
  margin-left: 2px;
}

/* 권 목록 */
.book-list {
  list-style: none;
}

.book-list li.book-item {
  padding: 8px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-size: .88rem;
  line-height: 1.4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background .15s;
}

.book-list li.book-item:hover   { background: #eef2f9; }
.book-list li.book-item.active  { background: var(--primary); color: #fff; }

.book-abbr { font-size: .75rem; opacity: .7; }

/* 우측 콘텐츠 영역 */
.content-area {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  overflow-y: auto;
  max-height: calc(100vh - 90px);
}

/* 장 탭 */
.chapter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.chapter-tabs.hidden { display: none; }

.chap-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: transparent;
  cursor: pointer;
  font-size: .85rem;
  font-family: var(--font);
  transition: background .15s;
}

.chap-btn:hover  { background: #eef2f9; }
.chap-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 사이드바 번역본 선택 */
.sidebar-translation {
  padding: 8px 4px 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.sidebar-translation select {
  width: 100%;
  padding: 5px 6px;
  font-family: var(--font);
  font-size: .85rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text);
}

/* 언어추가 버튼 */
.btn-add-lang {
  padding: 5px 14px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 16px;
  font-size: .82rem;
  cursor: pointer;
  font-family: var(--font);
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.btn-add-lang:hover { background: var(--primary); color: #fff; }
.btn-add-lang.hidden { display: none; }

/* ── 비교 모드 영역 ── */
.compare-area { display: flex; flex-direction: column; gap: 8px; }
.compare-area.hidden { display: none; }

/* 정렬 툴바 */
.compare-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
}
.layout-label { font-size: .78rem; color: var(--text-muted); white-space: nowrap; }
.layout-btn {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: transparent;
  cursor: pointer;
  font-size: .78rem;
  font-family: var(--font);
  color: var(--text-muted);
  transition: background .15s, color .15s;
}
.layout-btn:hover  { background: #eef2f9; color: var(--primary); }
.layout-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }

/* 정렬 모드별 compare-cols */
.compare-cols                         { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.compare-cols[data-layout="row"]      { flex-direction: row; }
.compare-cols[data-layout="column"]   { flex-direction: column; overflow-x: unset; }
.compare-cols[data-layout="grid"]     { display: grid; grid-template-columns: repeat(2, 1fr); overflow-x: unset; }

.compare-cols[data-layout="column"]  .compare-col { min-width: unset; }
.compare-cols[data-layout="column"]  .compare-col-body { max-height: 45vh; }
.compare-cols[data-layout="grid"]    .compare-col { min-width: unset; }
.compare-cols[data-layout="grid"]    .compare-col-body { max-height: 45vh; }

.compare-col {
  flex: 1;
  min-width: 280px;
  max-width: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow .15s;
}
.compare-col.drag-over { box-shadow: 0 0 0 2px var(--primary); }
.compare-col.dragging  { opacity: .4; }

.compare-col-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  cursor: grab;
  user-select: none;
}
.compare-col-header:active { cursor: grabbing; }
.drag-handle { color: var(--text-muted); flex-shrink: 0; }
.compare-col-header select {
  flex: 1;
  font-size: .8rem;
  font-family: var(--font);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 4px;
  background: var(--bg-card);
  color: var(--text);
}
.btn-col-remove {
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 1rem; padding: 0 2px; line-height: 1; flex-shrink: 0;
}
.btn-col-remove:hover { color: #c0392b; }

.compare-col-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  font-size: .93rem;
  line-height: 1.9;
  max-height: calc(100vh - 230px);
}
.compare-col[data-trans="Hebrew"] .compare-col-body { direction: rtl; text-align: right; }

.compare-col .c-verse-row {
  display: flex;
  gap: 6px;
  padding: 3px 4px;
  border-radius: 4px;
  cursor: pointer;
  transition: background .1s;
}
.compare-col .c-verse-row:hover { background: var(--bg); }
.compare-col .c-verse-row.x-hl {
  background: #fff6cc;
  border-left: 3px solid var(--accent);
  padding-left: 6px;
}
.compare-col[data-trans="Hebrew"] .c-verse-row.x-hl {
  border-left: none;
  border-right: 3px solid var(--accent);
  padding-left: 4px;
  padding-right: 6px;
}
.c-verse-num { color: var(--accent); font-size: .72rem; min-width: 16px; padding-top: 3px; font-weight: 700; flex-shrink: 0; }

.btn-add-col {
  margin-top: 8px;
  align-self: flex-start;
  padding: 6px 16px;
  border: 1px dashed var(--primary);
  background: transparent;
  color: var(--primary);
  border-radius: 8px;
  font-size: .85rem;
  cursor: pointer;
  font-family: var(--font);
}
.btn-add-col:hover { background: var(--primary); color: #fff; }

@media (max-width: 768px) {
  .compare-cols { flex-direction: column; }
  .compare-col  { min-width: unset; max-width: unset; }
  .compare-col-body { max-height: 40vh; }
}

/* 절 본문 */
.verse-area { line-height: 1.9; }

.verse-row {
  display: flex;
  gap: 10px;
  padding: 6px 4px;
  border-radius: 6px;
  cursor: pointer;
  transition: background .15s;
}

.verse-row:hover { background: #f0f4fb; }

.verse-num {
  font-size: .75rem;
  color: var(--accent);
  font-weight: 700;
  min-width: 24px;
  padding-top: 3px;
}

.verse-text { font-size: 1rem; flex: 1; }

/* 플레이스홀더 메시지 */
.placeholder {
  color: var(--text-muted);
  text-align: center;
  margin-top: 40px;
}

/* ============================================================
   검색 탭
   ============================================================ */
.search-box {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.search-box input {
  flex: 1;
  min-width: 200px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  outline: none;
}

.search-box input:focus { border-color: var(--primary); }

.search-box select {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
}

.search-box button,
#daily-refresh {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-size: .95rem;
  font-family: var(--font);
  transition: background .2s;
}

.search-box button:hover,
#daily-refresh:hover { background: var(--primary-dark); }

/* 검색/북마크 결과 목록 */
.result-list { display: flex; flex-direction: column; gap: 10px; }

.result-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
}

.result-ref {
  font-size: .82rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.result-text { font-size: .95rem; line-height: 1.7; }

.result-memo {
  margin-top: 6px;
  font-size: .82rem;
  color: var(--text-muted);
  font-style: italic;
}

.result-card .card-actions {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  cursor: pointer;
  font-size: .8rem;
  font-family: var(--font);
  transition: background .15s;
}

.btn-icon:hover { background: #eef2f9; }
.btn-icon.danger:hover { background: #ffeaea; border-color: #e55; color: #c00; }

/* ============================================================
   오늘의 말씀 탭
   ============================================================ */
.daily-card {
  max-width: 640px;
  margin: 40px auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

.daily-card h2 {
  color: var(--primary);
  margin-bottom: 24px;
  font-size: 1.3rem;
}

.daily-text {
  font-size: 1.15rem;
  line-height: 2;
  margin-bottom: 24px;
  min-height: 80px;
}

.daily-ref {
  display: block;
  margin-top: 12px;
  font-size: .9rem;
  font-weight: 700;
  color: var(--accent);
}

/* ============================================================
   북마크 모달
   ============================================================ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}

.modal.hidden { display: none; }

.modal-inner {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px;
  width: 90%;
  max-width: 480px;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}

.modal-inner h3 { margin-bottom: 12px; color: var(--primary); }

.modal-verse {
  font-size: .95rem;
  line-height: 1.7;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg);
  border-radius: 6px;
}

.modal-inner textarea {
  width: 100%;
  height: 80px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: var(--font);
  font-size: .9rem;
  resize: vertical;
  margin-bottom: 12px;
  outline: none;
}

.modal-buttons { display: flex; gap: 8px; justify-content: flex-end; }

.modal-buttons button {
  padding: 8px 20px;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-family: var(--font);
  font-size: .9rem;
}

#modal-save { background: var(--primary); color: #fff; }
#modal-save:hover { background: var(--primary-dark); }

.btn-secondary { background: var(--border); color: var(--text); }
.btn-secondary:hover { background: #ccc; }

/* ── 북마크 이동 후 하이라이트 ── */
.verse-row.highlight {
  background: #fff6cc;
  border-left: 3px solid var(--accent);
  transition: background 2s ease;
}

/* ── 사도신경 / 주기도문 ── */
.liturgy-card {
  max-width: 640px;
  margin: 24px auto;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
  text-align: center;
}

.liturgy-card h2 {
  color: var(--primary);
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.liturgy-sub {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  letter-spacing: .05em;
}

.btn-tts-liturgy {
  display: inline-block;
  margin-bottom: 24px;
  padding: 9px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: .88rem;
  font-family: var(--font);
  transition: background .2s;
}
.btn-tts-liturgy:hover { background: var(--primary-dark); }

.liturgy-text {
  text-align: left;
  line-height: 2.2;
  font-size: 1.05rem;
}

.liturgy-text p {
  padding: 2px 0;
  border-bottom: 1px dashed #eee;
}
.liturgy-text p:last-child { border-bottom: none; }

.liturgy-amen {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
  text-align: center;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .liturgy-card { margin: 12px 0; padding: 20px 16px; }
  .liturgy-text { font-size: .97rem; }
}

/* ── 맨 위로 버튼 ── */
#scroll-top {
  position: fixed;
  bottom: 24px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .25s, transform .25s;
  pointer-events: none;
  z-index: 500;
}
#scroll-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#scroll-top:hover { background: var(--primary-dark); }

/* ── 공통 유틸 ── */
.hidden { display: none !important; }
.loading-msg { color: var(--text-muted); font-size: .9rem; padding: 12px 0; }

/* ── 북마크 버튼 (절 우측) ── */
.verse-row { position: relative; padding-right: 44px; }

.btn-bm {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s;
  padding: 4px;
  line-height: 1;
}

/* 모바일에서는 항상 보이게 */
@media (hover: hover) {
  .verse-row:hover .btn-bm { opacity: 1; }
}
@media (hover: none) {
  .btn-bm { opacity: 0.5; }
}

/* ── 상단 바 (번역본 + TTS) ── */
.top-bar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── TTS 바 ── */
.tts-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  background: #eef2fb;
  border-radius: var(--radius);
  padding: 8px 12px;
}

.tts-label {
  font-size: .82rem;
  color: var(--primary);
  font-weight: 600;
  flex: 1;
  min-width: 100px;
}

.tts-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tts-btn {
  padding: 6px 14px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: .82rem;
  font-family: var(--font);
  transition: background .2s;
  white-space: nowrap;
}

.tts-btn:hover { background: var(--primary-dark); }
.tts-btn.tts-stop { background: #888; padding: 6px 10px; }
.tts-btn.tts-stop:hover { background: #555; }

.tts-rate-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: .8rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.tts-rate-wrap input[type="range"] {
  width: 70px;
  cursor: pointer;
}

/* ── 오늘의 말씀 TTS 버튼 ── */
.btn-tts-daily {
  display: block;
  margin: 16px auto 0;
  padding: 10px 24px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  font-size: .9rem;
  font-family: var(--font);
  transition: background .2s;
}
.btn-tts-daily:hover { background: var(--primary-dark); }

/* ── 토스트 메시지 ── */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #333;
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: .88rem;
  opacity: 0;
  transition: opacity .3s, transform .3s;
  pointer-events: none;
  z-index: 300;
  white-space: nowrap;
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── 검색 결과 수 ── */
.result-count {
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ── 드래그 선택 단어 마킹 ── */
mark.sel-word {
  background: #b3d9ff;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── 검색어 강조 ── */
.highlight-word {
  font-weight: 700;
  color: var(--primary-dark);
  background: #fff0b3;
  border-radius: 2px;
  padding: 0 1px;
}

/* ── 검색 책별 그룹 ── */
.search-group {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.search-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #f0f4fb;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.search-group-header:hover { background: #e2eaf7; }

.group-book  { font-weight: 700; font-size: .95rem; color: var(--primary); flex: 1; }
.group-count { font-size: .8rem; color: var(--text-muted); white-space: nowrap; }
.group-arrow { font-size: .75rem; color: var(--text-muted); transition: transform .2s; }

.search-group-body { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.search-group-body.collapsed { display: none; }

.more-hint {
  font-size: .78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 6px;
  font-style: italic;
}

/* 검색 결과 안내 텍스트 */
.result-hint {
  font-size: .75rem;
  color: var(--text-muted);
}

/* ── 오늘의 말씀 본문 ── */
.daily-body { font-size: 1.15rem; line-height: 2; }

/* ── 장 제목 ── */
.chapter-title {
  font-size: 1.2rem;
  color: var(--primary);
  margin-bottom: 12px;
}

/* ════════════════════════════════════════════
   반응형 — 데스크탑 중간 (1200px 이하)
   ════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .container { padding: 12px 16px; }
  .header-inner { padding: 0 16px; }
  .read-layout { grid-template-columns: 210px 1fr; }
}

/* ════════════════════════════════════════════
   반응형 — 태블릿 (900px 이하)
   ════════════════════════════════════════════ */
@media (max-width: 900px) {
  .read-layout { grid-template-columns: 180px 1fr; gap: 10px; }
  .sidebar { padding: 6px; }
  .book-list li.book-item { font-size: .82rem; padding: 6px 8px; }
  .compare-cols { gap: 6px; }
  .compare-col-body { max-height: calc(100vh - 280px); }
  .daily-card, .liturgy-card { max-width: 100%; }
}

/* ════════════════════════════════════════════
   반응형 — 모바일 (768px 이하)
   ════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* 헤더 */
  .header-inner {
    flex-direction: column;
    height: auto;
    padding: 10px 12px;
    gap: 6px;
  }
  .logo { font-size: 1.1rem; }
  .nav-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 100%;
  }
  .tab { padding: 7px 4px; font-size: .8rem; text-align: center; }

  /* 컨테이너 */
  .container { padding: 8px 10px; }

  /* 읽기 탭: 세로 배치 */
  .read-layout { grid-template-columns: 1fr; gap: 8px; }

  .sidebar {
    max-height: 180px;
    -webkit-overflow-scrolling: touch;
  }

  /* 권 목록 2열 */
  .book-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2px;
  }
  .book-list li.book-item { padding: 7px 8px; font-size: .82rem; }

  .content-area { max-height: none; padding: 10px; }

  /* 장 버튼 */
  .chap-btn { width: 32px; height: 32px; font-size: .78rem; }

  /* 절 본문 */
  .verse-text { font-size: .95rem; }
  .verse-row  { padding-right: 40px; }
  .btn-bm     { opacity: 0.4; font-size: 1rem; }

  /* TTS 바 */
  .tts-bar { padding: 8px; flex-wrap: wrap; }
  .tts-label { font-size: .75rem; }
  .tts-btn { padding: 6px 10px; font-size: .78rem; }
  .tts-rate-wrap input { width: 55px; }

  /* 비교 모드 */
  .compare-cols { flex-direction: column; }
  .compare-col  { min-width: unset; }
  .compare-col-body { max-height: 50vh; }

  /* 검색 탭 */
  .search-box { flex-direction: column; }
  .search-box input,
  .search-box select,
  .search-box button { width: 100%; }

  /* 오늘의 말씀 / 사도신경 / 주기도문 */
  .daily-card  { margin: 8px 0; padding: 20px 14px; }
  .liturgy-card { margin: 8px 0; padding: 20px 14px; }
  .daily-body  { font-size: 1.05rem; }
  .liturgy-text { font-size: .97rem; }

  /* 모달 */
  .modal-inner { padding: 20px 14px; }

  /* 토스트 */
  #toast { bottom: 20px; font-size: .82rem; }
}

/* ════════════════════════════════════════════
   반응형 — 소형 모바일 (480px 이하)
   ════════════════════════════════════════════ */
@media (max-width: 480px) {
  .nav-tabs { grid-template-columns: repeat(3, 1fr); }
  .tab { font-size: .75rem; padding: 6px 2px; }
  .book-list { grid-template-columns: repeat(2, 1fr); }
  .chapter-title { font-size: 1.05rem; }
  .chap-btn { width: 30px; height: 30px; font-size: .74rem; }
  .tts-controls { gap: 4px; }
}

/* ════════════════════════════════════════════
   반응형 — 초소형 (360px 이하)
   ════════════════════════════════════════════ */
@media (max-width: 360px) {
  .nav-tabs { grid-template-columns: repeat(2, 1fr); }
  .book-list { grid-template-columns: 1fr 1fr; }
  .tts-rate-wrap { display: none; }
}
