.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24; }
.serif-quote { font-family: 'Noto Serif KR', serif; }
.glass-nav { background: rgba(255, 255, 255, 0.8); backdrop-filter: blur(12px); }
.magic-nav { --nav-clr: #f8f9fa; position: fixed; bottom: 0; left: 0; right: 0; height: 70px; background: #fff; z-index: 120; display: flex; justify-content: center; box-shadow: 0 -2px 15px rgba(0,0,0,0.08); }
@media (min-width: 768px) { .magic-nav { display: none; } }
.magic-nav ul { display: flex; width: 100%; position: relative; list-style: none; margin: 0; padding: 0; }
.magic-nav ul li { position: relative; width: 25%; height: 70px; z-index: 1; }
.magic-nav ul li a, .magic-nav ul li button.magic-nav-btn { position: relative; display: flex; justify-content: center; align-items: center; flex-direction: column; width: 100%; height: 100%; text-align: center; font-weight: 500; background: none; border: none; cursor: pointer; text-decoration: none; padding: 0; gap: 2px; }
.magic-nav .nav-icon { display: flex; align-items: center; justify-content: center; transition: transform 0.5s, color 0.5s; color: #45464e; line-height: 1; }
.magic-nav .nav-label { font-size: 9px; font-weight: 500; color: #45464e; transition: transform 0.5s, color 0.5s; line-height: 1; }
.magic-nav ul li.active .nav-icon, .magic-nav ul li.active .nav-label { transform: translateY(-8px); color: #031539; }
.magic-nav .indicator { position: absolute; top: -10px; left: 0; width: calc(100% /4 ); height: 70px; border-bottom-left-radius: 35px; border-bottom-right-radius: 35px; border: 6px solid var(--nav-clr); background: var(--nav-clr); transition: transform 0.5s; pointer-events: none; }
.magic-nav .indicator::before { content: ""; position: absolute; top: 4px; left: -25.75px; width: 20px; height: 20px; border-top-right-radius: 20px; box-shadow: 4px -6px 0 2px var(--nav-clr); }
.magic-nav .indicator::after { content: ""; position: absolute; top: 4px; right: -25.75px; width: 20px; height: 20px; border-top-left-radius: 20px; box-shadow: -4px -6px 0 2px var(--nav-clr); z-index: -1; }
.magic-nav ul li:nth-child(2).active ~ .indicator { transform: translateX(100%); }
.magic-nav ul li:nth-child(3).active ~ .indicator { transform: translateX(200%); }
.magic-nav ul li:nth-child(4).active ~ .indicator { transform: translateX(300%); }
/* .magic-nav ul li:nth-child(5).active ~ .indicator { transform: translateX(400%); } */
.magic-nav .indicator span { position: absolute; bottom: 3px; left: 50%; margin-left: -30px; width: 60px; height: 60px; border: 4px solid #031539; background: #fff; border-radius: 50%; transform-origin: bottom center; box-shadow: 0 5px 15px rgba(0,0,0,0.15); transform: scale(0.85); }
.bg-divine-gradient { background: linear-gradient(135deg, #031539 0%, #1a2a4e 100%); }
.bg-soft-gradient { background: linear-gradient(135deg, rgba(255, 222, 165, 0.12) 0%, rgba(182, 198, 243, 0.14) 100%); }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
.worship-tab-panel { display: none; }
.worship-tab-panel.active { display: block; }
.worship-tab.active { background: #1a2a4e; color: #fff; border-color: #1a2a4e; }
.shorts-tab-multilang.active { background: #1a2a4e; border-color: #1a2a4e; color: #fff; }
.shorts-tab-basic.active { background: #1d4ed8; border-color: #1d4ed8; color: #fff; }
.shorts-tab-advanced.active { background: #7c3aed; border-color: #7c3aed; color: #fff; }
:root { --sermon-font-scale: 1; }
.markdown-body h1, .markdown-body h2, .markdown-body h3 { color: #031539; font-family: 'Noto Serif KR', serif; }
.markdown-body h1 { font-size: calc(1.2rem * var(--sermon-font-scale)); margin-bottom: 0.75rem; }
.markdown-body h2 { font-size: calc(1.05rem * var(--sermon-font-scale)); margin: 1rem 0 0.5rem; }
.markdown-body h3 { font-size: calc(0.95rem * var(--sermon-font-scale)); margin: 0.85rem 0 0.35rem; }
.markdown-body p, .markdown-body li { color: #45464e; line-height: 1.8; font-size: calc(1rem * var(--sermon-font-scale)); }
.markdown-body ul, .markdown-body ol { padding-left: 1.2rem; margin: 0.5rem 0 0.75rem; }
.markdown-body blockquote { border-left: 3px solid #775a19; padding-left: 0.8rem; color: #5f6368; margin: 0.75rem 0; font-size: calc(1rem * var(--sermon-font-scale)); }
.font-size-btn { display: inline-flex; align-items: center; justify-content: center; width: 4rem; height: 3rem; border-radius: 0.375rem; border: 1px solid #c5c6cf; background: #fff; font-weight: 700; cursor: pointer; transition: background .15s; }
.font-size-btn:hover { background: #f1f3f4; }
.feed-type.active { background: linear-gradient(135deg, #031539 0%, #1a2a4e 100%); color: #fff; border-color: transparent; }
.live-dot { width: 10px; height: 10px; border-radius: 999px; background: #ef4444; box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); animation: livePulse 1.5s infinite; }
.gallery-modal[hidden] { display: none; }
.church-info-card {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top right, rgba(197, 160, 89, 0.16), transparent 34%),
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.96));
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}
.church-info-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, var(--brand-color), rgba(197,160,89,0.95));
}
.church-info-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: #475569;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.church-info-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}
.church-info-section {
  border-radius: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.9);
  background: rgba(255,255,255,0.74);
}
.church-service-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  background: rgba(248, 250, 252, 0.92);
}
.church-service-row + .church-service-row {
  margin-top: 0.45rem;
}
.church-sns-link {
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.06);
  color: #334155;
  transition: all .2s ease;
}
.church-sns-link:hover {
  background: var(--brand-color);
  color: #fff;
  transform: translateY(-1px);
}
.church-info-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 0.95rem;
  border-radius: 0.9rem;
  border: 1px solid rgba(226, 232, 240, 0.95);
  background: rgba(255, 255, 255, 0.84);
  text-align: left;
}
.church-info-toggle-icon {
  transition: transform .2s ease;
}
.church-info-toggle[aria-expanded="true"] .church-info-toggle-icon {
  transform: rotate(180deg);
}
.church-info-detail[hidden] {
  display: none;
}
.church-home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  background:
    radial-gradient(circle at top left, rgba(255,255,255,0.18), transparent 32%),
    radial-gradient(circle at bottom right, rgba(197,160,89,0.18), transparent 28%),
    linear-gradient(135deg, #081a3d 0%, var(--brand-color) 55%, #243966 100%);
}
.church-home-panel {
  border-radius: 1.25rem;
  border: 1px solid rgba(226, 232, 240, 0.75);
  background: rgba(255,255,255,0.94);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
}
.church-home-stat {
  border-radius: 1rem;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
}
.church-home-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  transition: background .2s ease, transform .2s ease;
}
.church-home-link:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}
@media print {
  @page { margin: 25mm 30mm; size: A4; }

  *, *::before, *::after {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* ── 숨길 요소 ── */
  aside, header, nav,
  #liveStreamSection, #postLiveVideoSection,
  #section-tools, #section-feed, #section-shorts,
  #shareModal, #cheerModal, #transcribeModal,
  .fixed, .sticky,
  button,
  #aiContentTabBar,
  #sermonInfoToggleBtn { display: none !important; }

  /* ── 레이아웃 리셋 ── */
  body { background: #fff !important; font-size: 11pt; color: #1a1a1a; }
  main { margin-left: 0 !important; padding: 0 !important; }
  #section-word { padding: 0 !important; gap: 0 !important; }
  section { margin-bottom: 20pt !important; break-inside: avoid; }

  /* 그리드 → 단일 컬럼 */
  #section-sermon,
  #section-ai > div,
  .grid { display: block !important; }
  [class*="col-span"],
  [class*="lg:col-span"] { width: 100% !important; float: none !important; }

  /* ── 강제 표시 ── */
  #sermonInfoBlock { display: block !important; }
  .worship-tab-panel { display: block !important; margin-bottom: 12pt !important; }
  #orderBody { display: block !important; }

  /* ── section-verse: 말씀 카드 ── */
  #section-verse {
    position: relative !important;
    min-height: 140pt !important;
    padding: 28pt 36pt !important;
    border-radius: 8pt !important;
    page-break-after: avoid;
    break-after: avoid;
  }
  #section-verse .absolute { position: absolute !important; inset: 0 !important; }

  /* ── 설교자 카드 ── */
  #section-sermon .space-y-6 > * { margin-bottom: 14pt !important; }
  #section-sermon .lg\:col-span-2 { display: none !important; }

  /* ── AI 분석 ── */
  #section-ai { page-break-before: always; break-before: always; }
  #section-ai .xl\:col-span-2 { width: 100% !important; }
  .worship-tab-panel + .worship-tab-panel { border-top: 1pt solid #e5e7eb; padding-top: 10pt; }

  /* ── 배경·색상 ── */
  .bg-divine-gradient { background: #1a2a4e !important; }
  .bg-surface-container-low,
  .bg-surface-container-lowest,
  .bg-surface-container { background: #f7f8fa !important; }
  .bg-white { background: #fff !important; }
  .text-primary { color: #031539 !important; }
  .text-on-surface-variant { color: #555 !important; }
  .text-secondary { color: #775a19 !important; }
  .text-white { color: #fff !important; }

  /* ── 텍스트 정리 ── */
  .truncate { overflow: visible !important; white-space: normal !important; text-overflow: unset !important; }
  .line-clamp-1, .line-clamp-2 { -webkit-line-clamp: unset !important; overflow: visible !important; }
  #sermonInfoBlock { display: block !important; }
  .md\:hidden { display: none !important; }

  /* ── 시각 노이즈 제거 ── */
  * { box-shadow: none !important; }
  .border { border-color: #e5e7eb !important; }
  .rounded-2xl, .rounded-xl, .rounded-lg { border-radius: 6pt !important; }

  /* ── 여백 정규화 ── */
  .p-6, .p-8, .md\:p-8, .md\:p-10 { padding: 10pt !important; }
  .space-y-8 > * + *, .space-y-6 > * + * { margin-top: 10pt !important; }
  .gap-8, .gap-6 { gap: 10pt !important; }
  .mb-6 { margin-bottom: 8pt !important; }

  /* ── 동영상 숨김 ── */
  .aspect-video, iframe, video { display: none !important; }
}

.nl-accent-gold { color: #c5a059; }
.nl-bg-accent-gold { background-color: #c5a059; }
.nl-input-field { width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; padding: 0.75rem; font-size: 0.95rem; outline: none; }
.nl-input-field:focus { border-color: #c5a059; }
.quiz-progress { display:flex; align-items:center; gap:10px; margin-bottom:16px; }
.quiz-progress-bar { flex:1; height:6px; background:#e5e7eb; border-radius:3px; overflow:hidden; }
.quiz-progress-fill { height:100%; background:#16a34a; border-radius:3px; transition:width 0.3s ease; }
.quiz-progress-text { font-size:0.75rem; color:#6b7280; white-space:nowrap; }
.quiz-question-box { background:#f0fdf4; border:1px solid #bbf7d0; border-radius:12px; padding:16px 18px; margin-bottom:18px; }
.quiz-question-num { font-size:0.7rem; font-weight:700; color:#16a34a; text-transform:uppercase; letter-spacing:0.05em; margin-bottom:8px; }
.quiz-question-text { font-size:0.95rem; font-weight:700; color:#111827; line-height:1.6; }
.quiz-options-list { display:flex; flex-direction:column; gap:8px; margin-bottom:16px; }
.quiz-option-btn { width:100%; text-align:left; padding:12px 16px; border:1.5px solid #e5e7eb; border-radius:10px; background:#fff; font-size:0.875rem; color:#374151; cursor:pointer; transition:border-color 0.15s, background 0.15s; line-height:1.5; }
.quiz-option-btn:hover:not(:disabled) { border-color:#16a34a; background:#f0fdf4; }
.quiz-option-btn.correct { border-color:#16a34a; background:#dcfce7; color:#166534; font-weight:700; }
.quiz-option-btn.wrong { border-color:#ef4444; background:#fef2f2; color:#991b1b; }
.quiz-option-btn.show-correct { border-color:#16a34a; background:#dcfce7; color:#166534; }
.quiz-option-btn:disabled { cursor:default; }
.quiz-explanation { background:#fffbf5; border:1px solid #fed7aa; border-radius:10px; padding:12px 14px; font-size:0.825rem; color:#92400e; line-height:1.7; margin-bottom:16px; }
.quiz-explanation strong { color:#78350f; }
.quiz-next-btn { width:100%; padding:12px; background:#1a2a4e; color:#fff; border:none; border-radius:10px; font-size:0.875rem; font-weight:700; cursor:pointer; transition:opacity 0.15s; }
.quiz-next-btn:hover { opacity:0.85; }
.quiz-result-box { text-align:center; padding:24px 16px; }
.quiz-result-icon { font-size:3rem; margin-bottom:12px; }
.quiz-result-score { font-size:2.5rem; font-weight:700; color:#1a2a4e; margin-bottom:6px; }
.quiz-result-msg { font-size:0.9rem; color:#6b7280; margin-bottom:20px; line-height:1.6; }
.quiz-retry-btn { display:inline-block; padding:10px 28px; background:#16a34a; color:#fff; border:none; border-radius:10px; font-size:0.875rem; font-weight:700; cursor:pointer; transition:opacity 0.15s; }
.quiz-retry-btn:hover { opacity:0.85; }
.quiz-no-data { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; color:#9ca3af; text-align:center; padding:32px 20px; font-size:0.875rem; }
.sc-chat-area { flex:1; background:#f8fafc; border-radius:10px; padding:14px; overflow-y:auto; display:flex; flex-direction:column; gap:10px; min-height:200px; max-height:360px; }
.sc-chat-empty { display:flex; flex-direction:column; align-items:center; justify-content:center; height:100%; color:#9ca3af; gap:8px; font-size:0.875rem; padding:24px 0; text-align:center; }
.sc-msg-user { align-self:flex-end; background:#1a2a4e; color:#fff; border-radius:12px 12px 2px 12px; padding:8px 14px; font-size:0.875rem; max-width:82%; line-height:1.5; word-break:break-word; }
.sc-msg-ai { align-self:flex-start; background:#fff; border:1px solid #e8ecf0; border-radius:12px 12px 12px 2px; padding:8px 14px; font-size:0.875rem; max-width:82%; line-height:1.7; word-break:break-word; }
.sc-msg-loading { align-self:flex-start; display:flex; align-items:center; gap:8px; color:#9ca3af; font-size:0.85rem; }
.sc-dot-anim { display:flex; gap:4px; }
.sc-dot-anim span { width:6px; height:6px; background:#c5a059; border-radius:50%; animation:scBounce 1.2s infinite; }
.sc-dot-anim span:nth-child(2) { animation-delay:0.2s; }
.sc-dot-anim span:nth-child(3) { animation-delay:0.4s; }
@keyframes scBounce { 0%,80%,100%{transform:translateY(0)} 40%{transform:translateY(-6px)} }
.sc-quick-btns { display:flex; flex-wrap:wrap; gap:6px; margin-top:16px; }
.sc-quick-btn { padding:5px 12px; background:#fff; border:1px solid #e2e8f0; border-radius:20px; font-size:0.78rem; color:#374151; cursor:pointer; transition:border-color 0.15s; font-family:inherit; }
.sc-quick-btn:hover { border-color:#1a2a4e; background:#f8fafc; }
.sc-input-row { display:flex; gap:8px; margin-top:12px; }
.sc-chat-input { flex:1; padding:10px 14px; border:1px solid #e2e8f0; border-radius:8px; font-size:0.875rem; font-family:inherit; outline:none; transition:border-color 0.15s; min-width:0; }
.sc-chat-input:focus { border-color:#1a2a4e; }
.sc-send-btn { width:42px; height:42px; background:#c5a059; border:none; border-radius:8px; cursor:pointer; display:flex; align-items:center; justify-content:center; transition:background 0.15s; flex-shrink:0; }
.sc-send-btn:hover { background:#b08944; }

<style>
@keyframes v3spin { to { transform: rotate(360deg); } }
</style>

<?php include(dirname(__FILE__) . '/../engagement/_opinion_panel.php'); ?>

<style>
/* 인라인 편집 래퍼 */
.v3-iw { position: relative; }
/* 편집 버튼 */
.v3-edbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #94a3b8;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
  cursor: pointer;
  opacity: 1;
  transition: opacity .15s, color .15s;
  vertical-align: middle;
  flex-shrink: 0;
}
.v3-edbtn .material-symbols-outlined { font-size: 15px; }
.v3-edbtn:hover { color: #1a2a4e; border-color: #1a2a4e; }
.v3-iw:hover .v3-edbtn { opacity: 1; }
/* 편집 중 상태 */
.v3-el[contenteditable="true"] {
  outline: 2px solid #3b82f6;
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 40px;
  cursor: text;
}
/* 인라인 툴바 */
.v3-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  background: #1e293b;
  border-radius: 8px;
  padding: 5px 8px;
  margin-bottom: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
}
.v3-tb { padding: 3px 8px; font-size: 12px; border-radius: 4px; background: transparent; color: #e2e8f0; border: 1px solid transparent; cursor: pointer; line-height: 1.6; }
.v3-tb:hover { background: rgba(255,255,255,.12); }
.v3-tb-sep { width: 1px; height: 16px; background: rgba(255,255,255,.2); margin: 0 3px; }
.v3-actions { display: flex; gap: 6px; align-items: center; margin-top: 6px; }
.v3-save-btn { padding: 5px 16px; font-size: 12px; font-weight: 700; color: #fff; background: #1a2a4e; border: none; border-radius: 6px; cursor: pointer; }
.v3-cancel-btn { padding: 5px 12px; font-size: 12px; color: #64748b; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 6px; cursor: pointer; }
.v3-status { font-size: 11px; color: #64748b; margin-left: 4px; }