/* ============================================================
 * 사랑나눔 신우회 — 화면 모양
 *
 * 휴대폰 한 손 폭을 기준으로 만든 한 줄 화면입니다. 넓은 화면에서는 가운데에 그 폭으로 놓입니다.
 *
 * 생김새의 원칙 (요즘 잘 만든 국내 모바일 서비스들이 함께 쓰는 문법입니다)
 *   · 옅은 회색 바탕 위에 테두리 없는 흰 카드. 선 대신 여백과 면으로 나눕니다.
 *   · 글자는 크고 굵게, 색은 검정 한 가지에 회색 두 단계. 강조색은 파랑 하나만.
 *   · 누르는 것은 크게(높이 48px 이상), 눌렀을 때 살짝 눌리는 느낌.
 *   · 화면마다 가장 중요한 단추 하나는 엄지가 닿는 맨 아래에 붙여 둡니다.
 * ============================================================ */

:root {
  --bg: #f2f4f6;
  --surface: #ffffff;
  --fill: #f2f4f6;        /* 흰 면 위에 놓는 옅은 채움 (입력 칸 · 보조 단추) */
  --fill-press: #e5e8eb;
  --line: #eceef1;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;
  --primary: #3182f6;
  --primary-press: #1b64da;
  --primary-soft: #e8f3ff;
  --danger: #f04452;
  --danger-soft: #ffeff0;
  --amber: #b76e00;
  --amber-soft: #fff4dc;
  --green: #0a8f5b;
  --green-soft: #e3f7ee;
  --radius: 1.25rem;
  --radius-sm: 0.875rem;
  --nav-height: 3.75rem;
  --gutter: 1.25rem;

  /* 예전 이름 — 아직 이 이름을 쓰는 곳이 있어 새 색에 이어 둡니다. */
  --ink: var(--text);
  --muted: var(--text-3);
  --card: var(--surface);
  --paper: var(--fill);
  --accent: var(--primary);
  --accent-soft: var(--primary-soft);
  --primary-deep: var(--text);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  /* 주소창이 접히고 펴질 때 글자가 제멋대로 커지지 않게 합니다. */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", system-ui, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  /* 한글은 낱말 단위로 줄을 바꿔야 읽기 편합니다. */
  word-break: keep-all;
  overflow-wrap: anywhere;
}

h1, h2, h3, p, ul, ol, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
/* 손가락으로 누르는 것들은 눌렀을 때 회색 번쩍임이 없게 */
a, button, summary, label { -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
img { max-width: 100%; }
[hidden] { display: none !important; }

.icon { width: 1.5rem; height: 1.5rem; flex-shrink: 0; }

.muted { color: var(--text-3); }
.small { font-size: 0.875rem; }
.tiny { font-size: 0.8125rem; }
.center { text-align: center; }

/* 누르면 살짝 눌리는 느낌 — 카드·줄·단추가 함께 씁니다. */
.pressable, .card-link, .btn, .list > li > a, .tile, .chips a, .pill, .poll-choice, .grid-books a, .grid-chapters a {
  transition: transform 0.12s ease, background-color 0.12s ease;
}
.card-link:active, .tile:active { transform: scale(0.98); }
.btn:active, .pill:active, .poll-choice:active { transform: scale(0.97); }

/* ---------- 틀 ---------- */

.page {
  max-width: 34rem;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}
/* 바닥 메뉴에 내용이 가리지 않게 */
.page.has-nav { padding-bottom: calc(var(--nav-height) + 1.5rem + env(safe-area-inset-bottom)); }

.content { padding: 0.75rem var(--gutter) 1rem; }
.content-top0 { padding-top: 0; }
.stack > * + * { margin-top: 0.625rem; }
.stack-lg > * + * { margin-top: 1.5rem; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* 맨 위 줄 — 안쪽 화면(뒤로 가기가 있는 화면)에서는 얇게 위에 붙어 있습니다. */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 0.125rem;
  height: 3.25rem;
  padding: 0 0.5rem;
  background: rgba(242, 244, 246, 0.9);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.topbar h1 {
  flex: 1;
  min-width: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-gap { width: calc(var(--gutter) - 0.5rem); }
.topbar-back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  border-radius: 50%;
}
.topbar-back:active { background: var(--fill-press); }
/* 큰 메뉴의 첫 화면(공지·예배식순·찬양·성경)은 제목을 크게 씁니다. 스크롤하면 함께 올라갑니다. */
.topbar-large {
  position: static;
  height: auto;
  padding: 1.5rem 0.75rem 0.5rem;
  background: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.topbar-large h1 { font-size: 1.625rem; font-weight: 800; letter-spacing: -0.03em; }
.topbar-btn {
  display: flex;
  align-items: center;
  gap: 0.125rem;
  height: 2.375rem;
  margin-right: calc(var(--gutter) - 0.75rem);
  padding: 0 0.875rem 0 0.625rem;
  flex-shrink: 0;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 700;
}
.topbar:not(.topbar-large) .topbar-btn { margin-right: 0.5rem; }
.topbar-btn .icon { width: 1.125rem; height: 1.125rem; stroke-width: 2.2; }
.topbar-btn:active { opacity: 0.8; }

/* 맨 아래 메뉴 — 엄지손가락이 닿는 자리 */
.bottomnav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(255, 255, 255, 0.94);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
}
.bottomnav ul { display: flex; max-width: 34rem; margin: 0 auto; }
.bottomnav li { flex: 1; }
.bottomnav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1875rem;
  height: var(--nav-height);
  color: #b0b8c1;
  font-size: 0.6875rem;
  font-weight: 600;
}
.bottomnav .icon { width: 1.5rem; height: 1.5rem; }
/* 지금 있는 칸은 검정으로, 아이콘 속을 채워 또렷하게 */
.bottomnav a.on { color: var(--text); }
.bottomnav a.on .icon { stroke-width: 2.1; fill: rgba(25, 31, 40, 0.1); }

/* ---------- 카드 · 목록 ---------- */

.card {
  display: block;
  padding: 1.25rem;
  background: var(--surface);
  border-radius: var(--radius);
}
.card-title { font-size: 1.125rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.02em; }
.card-sub { margin-top: 0.25rem; font-size: 0.9375rem; color: var(--text-2); }
.cards > li + li { margin-top: 0.625rem; }
.cards { margin-top: 0.75rem; }
.content-top0 > .cards { margin-top: 0; }

.list {
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--radius);
}
.list > li { position: relative; }
/* 줄 사이의 선은 글자가 시작하는 자리부터 긋습니다. */
.list > li + li::before {
  content: "";
  position: absolute;
  top: 0;
  left: 1.25rem;
  right: 1.25rem;
  height: 1px;
  background: var(--line);
}
.list > li > a { display: block; padding: 1rem 1.25rem; }
.list > li > a:active { background: var(--fill); }
.list-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.02em; }
.list-meta { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--text-3); }
.list-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; margin-bottom: 0.375rem; }
.list-row { display: flex; align-items: center; gap: 0.75rem; padding: 0.875rem 1.25rem; }
.list-row > div { flex: 1; min-width: 0; }
.clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}
/* 오른쪽 끝에 ">" 가 붙는 줄 */
.row-arrow, .list > li > a.row-arrow { display: flex; align-items: center; gap: 0.75rem; }
.row-arrow > div { flex: 1; min-width: 0; }
.row-arrow > .icon { width: 1.125rem; height: 1.125rem; color: #c4cad1; }

.pin { width: 0.9375rem; height: 0.9375rem; margin-right: 0.25rem; vertical-align: -0.125rem; color: var(--primary); }
.pinned { display: inline-flex; align-items: center; gap: 0.125rem; color: var(--primary); font-size: 0.75rem; font-weight: 700; }
.pinned .icon { width: 0.875rem; height: 0.875rem; }

.badge { display: inline-flex; align-items: center; height: 1.375rem; padding: 0 0.5rem; border-radius: 0.375rem; font-size: 0.75rem; font-weight: 700; }
.badge-all { background: var(--fill); color: var(--text-2); }
.badge-org { background: var(--primary-soft); color: var(--primary); }
.badge-poll { background: var(--green-soft); color: var(--green); }
.badge-todo { background: var(--danger-soft); color: var(--danger); }
.badge-soon { background: var(--amber-soft); color: var(--amber); }

.empty { padding: 4rem 1rem; text-align: center; color: var(--text-3); }
.card.empty { padding: 2.25rem 1rem; }
.note { margin-top: 0.75rem; padding: 0 0.25rem; }
.eyebrow { font-size: 0.8125rem; font-weight: 700; color: var(--primary); }
.more { display: inline-flex; align-items: center; gap: 0.125rem; margin-top: 0.875rem; font-size: 0.875rem; font-weight: 700; color: var(--primary); }
.more .icon { width: 1rem; height: 1rem; }
.section-title { margin-bottom: 0.625rem; padding: 0 0.25rem; font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.02em; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; padding: 0 0.25rem; }
.section-head h2 { font-size: 1.1875rem; font-weight: 800; letter-spacing: -0.02em; }
.section-head a { display: flex; align-items: center; height: 2.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-3); }
.section-head .icon { width: 1rem; height: 1rem; }
.notice-box { padding: 0.875rem 1rem; border-radius: var(--radius-sm); background: var(--primary-soft); color: #1b4f9c; font-size: 0.875rem; line-height: 1.65; }

/* ---------- 단추 · 입력 칸 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  height: 2.875rem;
  padding: 0 1.125rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 700;
}
.btn:active { background: var(--fill-press); }
.btn .icon { width: 1.125rem; height: 1.125rem; }
/* 흰 카드 안에 놓인 단추는 회색으로 채워 바탕과 구분합니다. */
.card .btn { background: var(--fill); }
.btn-primary, .card .btn-primary { background: var(--primary); color: #fff; }
.card .btn-danger { background: var(--danger-soft); }
.btn-primary:active { background: var(--primary-press); }
.btn-danger { background: var(--danger-soft); color: var(--danger); }
.btn-danger:active { background: #ffdfe1; }
.btn-lg { height: 3.5rem; border-radius: 1rem; font-size: 1.0625rem; }
.btn-sm { height: 2.375rem; padding: 0 0.875rem; border-radius: 0.625rem; font-size: 0.875rem; }
.btn-block { display: flex; width: 100%; }
.btn:disabled { opacity: 0.55; }

.actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; margin-top: 0.875rem; }
/* 목록 단추는 왼쪽 끝에, 고치기·지우기는 오른쪽에 모읍니다. */
.actions-left { margin-right: auto; }

/* 가장 중요한 단추(저장·올리기)는 화면 맨 아래에 붙여 둡니다 — 긴 폼에서도 늘 엄지 아래에 있게. */
.submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 15;
  margin: 1.5rem calc(var(--gutter) * -1) 0;
  padding: 0.75rem var(--gutter) calc(0.75rem + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 70%, rgba(242, 244, 246, 0));
}

/* 글자 크기 16px — 이보다 작으면 아이폰이 입력할 때 화면을 확대합니다. */
.input {
  display: block;
  width: 100%;
  height: 3.25rem;
  padding: 0 1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 1rem;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}
.card .input, .item .input, .poll-edit .input { background: var(--fill); }
.input::placeholder { color: #b0b8c1; }
.input:focus { border-color: var(--primary); background: var(--surface); outline: none; }
textarea.input { height: auto; padding: 0.875rem 1rem; line-height: 1.6; resize: vertical; }
select.input {
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 10l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
}
.input-lg { height: 3.5rem; border-radius: 1rem; }
.input-sm { height: 2.875rem; padding: 0 0.875rem; border-radius: 0.75rem; }
.strong { font-weight: 700; }

.field { display: block; }
.field > span, .field-title { display: block; margin-bottom: 0.5rem; padding-left: 0.125rem; font-size: 0.875rem; font-weight: 700; color: var(--text-2); }
.field > span small { font-weight: 500; }
.check { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0.5rem 1rem; border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; }
.check input { width: 1.375rem; height: 1.375rem; flex-shrink: 0; accent-color: var(--primary); }
.check .muted { font-weight: 500; }
.form-error { padding: 0.875rem 1rem; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 0.9375rem; font-weight: 600; }

.search { position: relative; }
.search .icon { position: absolute; left: 1rem; top: 50%; width: 1.25rem; height: 1.25rem; margin-top: -0.625rem; color: var(--text-3); pointer-events: none; }
.search .input { padding-left: 2.875rem; }

/* 둘·셋 가운데 하나를 고르는 묶음 단추 (찬양 구분 · 구약/신약) */
.segment { display: flex; padding: 0.25rem; border-radius: 0.875rem; background: #e5e8eb; }
.segment button, .segment a {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 2.375rem;
  border: 0;
  border-radius: 0.625rem;
  background: none;
  color: var(--text-2);
  font-size: 0.9375rem;
  font-weight: 600;
}
.segment .on { background: var(--surface); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08); }

/* ---------- 얼굴 사진 ---------- */

/* 이름 첫 글자를 밑에 깔고 사진을 그 위에 덮습니다. 사진이 없으면 글자가 보입니다. */
.avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 4rem; height: 4rem; font-size: 1.5rem; }
.profile { display: flex; align-items: center; gap: 0.875rem; }
.profile > div, .profile > p { min-width: 0; }

/* ---------- 로그인 ---------- */

.login { display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; max-width: 26rem; margin: 0 auto; padding: 2.5rem 1.5rem; }
.login-head { margin-bottom: 2.25rem; }
.login-head h1 { margin-top: 0.75rem; font-size: 1.75rem; font-weight: 800; line-height: 1.3; letter-spacing: -0.03em; }
.login-head p { margin-top: 0.5rem; font-size: 0.9375rem; }
.login-mark { display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1rem; background: var(--primary); color: #fff; }
.login-mark .icon { width: 1.75rem; height: 1.75rem; stroke-width: 2.4; }
.login-note { margin-top: 1.25rem; text-align: center; font-size: 0.8125rem; line-height: 1.6; }

.center-box { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.5rem; min-height: 100vh; min-height: 100dvh; padding: 1.5rem; text-align: center; }
.center-box .btn { margin-top: 1rem; height: 3.25rem; padding: 0 1.75rem; font-size: 1rem; }
.lead { font-size: 1.25rem; font-weight: 800; }

/* ---------- 첫 화면 ---------- */

.hello { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.75rem var(--gutter) 0.5rem; }
.hello h1 { font-size: 1.5rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.03em; }
.hello p { margin-top: 0.25rem; font-size: 0.875rem; color: var(--text-3); }
.hello-me:active { opacity: 0.7; }

.home { padding: 0.75rem var(--gutter) 0; }
.home > * + * { margin-top: 0.75rem; }
.home > section { margin-top: 1.75rem; }

/* 이번 예배 — 첫 화면에서 가장 먼저 눈에 들어와야 하는 카드 */
.featured { background: var(--primary); color: #fff; }
.featured .eyebrow { color: rgba(255, 255, 255, 0.75); }
.featured h2 { margin-top: 0.375rem; font-size: 1.375rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.02em; }
.featured-date { margin-top: 0.25rem; font-size: 0.9375rem; color: rgba(255, 255, 255, 0.82); }
.featured-sermon { display: flex; align-items: center; gap: 0.75rem; margin-top: 1rem; padding: 0.875rem 1rem; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.16); }
.featured-sermon > div { flex: 1; min-width: 0; }
.featured-sermon b { display: block; font-size: 1rem; line-height: 1.4; }
.featured-sermon span { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.8); }
.featured-sermon .icon { width: 1.125rem; height: 1.125rem; opacity: 0.8; }
.featured-go { display: flex; align-items: center; gap: 0.125rem; margin-top: 1rem; font-size: 0.875rem; font-weight: 700; color: rgba(255, 255, 255, 0.95); }
.featured-go .icon { width: 1rem; height: 1rem; }
.featured-none { background: var(--surface); color: var(--text); }
.featured-none .eyebrow { color: var(--primary); }

/* 해야 할 일 — 아직 응답하지 않은 설문 */
.todo { display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.25rem; }
.todo-icon { display: flex; align-items: center; justify-content: center; width: 2.5rem; height: 2.5rem; flex-shrink: 0; border-radius: 0.75rem; background: var(--danger-soft); color: var(--danger); }
.todo > div { flex: 1; min-width: 0; }
.todo b { display: block; font-size: 1rem; line-height: 1.4; }
.todo span { font-size: 0.8125rem; color: var(--text-3); }
.todo > .icon { width: 1.125rem; height: 1.125rem; color: #c4cad1; }

/* 네 칸짜리 바로 가기 */
.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem; padding: 1rem 0.5rem; }
.tile { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding: 0.375rem 0; border-radius: 1rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-2); }
.tile-icon { display: flex; align-items: center; justify-content: center; width: 3.25rem; height: 3.25rem; border-radius: 1.125rem; }
.tile-icon .icon { width: 1.625rem; height: 1.625rem; }
.tile-blue { background: var(--primary-soft); color: var(--primary); }
.tile-green { background: var(--green-soft); color: var(--green); }
.tile-amber { background: var(--amber-soft); color: var(--amber); }
.tile-violet { background: #efeaff; color: #6b4ee6; }

/* 찬양 번호로 바로 가기 · 성경 이어 읽기 */
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.quick > * { padding: 1rem 1.125rem; }
.quick-label { font-size: 0.8125rem; font-weight: 700; color: var(--text-3); }
.quick-form { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.5rem; }
.quick-form .input { height: 2.75rem; padding: 0 0.75rem; border-radius: 0.75rem; font-size: 1.125rem; font-weight: 700; text-align: center; }
.quick-form .btn { height: 2.75rem; padding: 0 0.875rem; flex-shrink: 0; border-radius: 0.75rem; background: var(--text); color: #fff; }
.quick-go { display: block; margin-top: 0.5rem; font-size: 1.0625rem; font-weight: 700; line-height: 1.4; letter-spacing: -0.02em; }
.quick-go small { display: block; margin-top: 0.125rem; font-size: 0.8125rem; font-weight: 600; color: var(--primary); }

/* ---------- 공지 ---------- */

.article h2 { margin-top: 0.75rem; font-size: 1.4375rem; font-weight: 800; line-height: 1.4; letter-spacing: -0.03em; }
.article-meta { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.625rem; font-size: 0.8125rem; color: var(--text-3); }
.article-body { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line); font-size: 1.0625rem; line-height: 1.8; white-space: pre-wrap; }

/* 편집기로 쓴 본문 — 편집기에서 보이던 모양과 같게 맞춥니다. */
.rich { white-space: normal; }
/* 편집기는 줄마다 문단 하나를 만들고, 빈 줄은 빈 문단입니다. 빈 문단도 한 줄 높이를 차지하게 합니다. */
.rich p { min-height: 1.8em; }
.rich h1, .rich h2 { margin: 0.5em 0 0.25em; font-size: 1.3125rem; font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; }
.rich h3 { margin: 0.5em 0 0.25em; font-size: 1.125rem; font-weight: 700; line-height: 1.4; }
.rich ul, .rich ol { padding-left: 1.5em; }
.rich ul { list-style: disc; }
.rich ol { list-style: decimal; }
.rich blockquote { margin: 0.5em 0; padding-left: 0.875rem; border-left: 3px solid var(--line); color: var(--text-2); }
.rich a { color: var(--primary); text-decoration: underline; text-underline-offset: 0.2em; }
.rich img { display: block; max-width: 100%; height: auto; margin: 0.75em 0; border-radius: 0.875rem; }
.rich pre { padding: 0.875rem; border-radius: 0.75rem; background: var(--fill); font-size: 0.875rem; white-space: pre-wrap; }
.rich .ql-align-center { text-align: center; }
.rich .ql-align-right { text-align: right; }
.rich .ql-align-justify { text-align: justify; }
.rich .ql-align-center img { margin-left: auto; margin-right: auto; }
.rich .ql-indent-1 { padding-left: 2em; }
.rich .ql-indent-2 { padding-left: 4em; }
.rich .ql-indent-3 { padding-left: 6em; }

/* 첨부파일 — 보기 화면 */
.files { margin-top: 1.5rem; }
.files h3 { margin-bottom: 0.5rem; font-size: 0.8125rem; font-weight: 700; color: var(--text-3); }
.files li + li { margin-top: 0.5rem; }
.files a { display: flex; align-items: center; gap: 0.75rem; min-height: 3.25rem; padding: 0.625rem 1rem; border-radius: var(--radius-sm); background: var(--fill); }
.files a:active { background: var(--fill-press); }
.files a span { flex: 1; min-width: 0; font-weight: 600; word-break: break-all; }
.files a .icon { width: 1.25rem; height: 1.25rem; color: var(--text-3); }

/* 공지 쓰기의 편집기 — Quill 의 기본 모양을 우리 화면에 맞게 다듬습니다. */
.editor-box .ql-toolbar.ql-snow { padding: 0.375rem 0.5rem; border: 0; border-bottom: 1px solid var(--line); border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--surface); }
.editor-box .ql-container.ql-snow { border: 0; border-radius: 0 0 var(--radius-sm) var(--radius-sm); background: var(--surface); font-family: inherit; font-size: 1rem; }
.editor-box .ql-editor { min-height: 14rem; padding: 1rem; line-height: 1.8; word-break: keep-all; }
.editor-box .ql-editor.ql-blank::before { left: 1rem; color: #b0b8c1; font-style: normal; }
.editor-box .ql-editor img { max-width: 100%; height: auto; border-radius: 0.875rem; }
/* 도구 단추를 손가락으로 누르기 쉽게 키웁니다. */
.editor-box .ql-snow.ql-toolbar button { width: 2.375rem; height: 2.375rem; padding: 0.5rem; border-radius: 0.5rem; }
.editor-box .ql-snow.ql-toolbar button:active { background: var(--fill); }
.editor-box .ql-snow .ql-picker { height: 2.375rem; line-height: 2.375rem; font-size: 0.875rem; font-weight: 600; }
.editor-box .ql-snow .ql-formats { margin-right: 0.25rem; }
.editor-box .ql-snow .ql-stroke { stroke: var(--text-2); }
.editor-box .ql-snow .ql-fill { fill: var(--text-2); }
.editor-box .ql-snow .ql-picker { color: var(--text-2); }
.editor-box .ql-snow.ql-toolbar button.ql-active .ql-stroke, .editor-box .ql-snow.ql-toolbar button:hover .ql-stroke { stroke: var(--primary); }
.editor-box .ql-snow.ql-toolbar button.ql-active .ql-fill, .editor-box .ql-snow.ql-toolbar button:hover .ql-fill { fill: var(--primary); }
.editor-box textarea { min-height: 14rem; }

/* 첨부파일 — 쓰기 화면 */
.attach-list li { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.5rem 0.5rem 1rem; border-radius: var(--radius-sm); background: var(--surface); }
.attach-list li + li { margin-top: 0.5rem; }
.attach-list:not(:empty) { margin-bottom: 0.625rem; }
.attach-list .btn { flex-shrink: 0; background: var(--primary-soft); color: var(--primary); }
.attach-name { flex: 1; min-width: 0; font-weight: 600; word-break: break-all; }
.attach-name small { font-weight: 500; }
.attach-help { margin-top: 0.625rem; padding-left: 0.125rem; }
.upload-message { margin-top: 0.625rem; padding: 0.75rem 1rem; border-radius: var(--radius-sm); background: var(--amber-soft); color: var(--amber); font-size: 0.875rem; font-weight: 600; }
/* 「본문 삽입」은 편집기가 떠 있을 때만 쓸 수 있습니다(editor.js 가 폼에 has-editor 를 붙입니다). */
form:not(.has-editor) [data-attach-insert] { display: none; }
#attach-button { background: var(--surface); }

/* ---------- 공지에 붙는 설문 ---------- */

.poll { margin-top: 0.75rem; scroll-margin-top: 4.5rem; }
.poll h3 { margin-top: 0.375rem; font-size: 1.1875rem; font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; }
.poll-choices { display: grid; gap: 0.5rem; margin-top: 1rem; }
/* 고르는 줄 — 왼쪽 동그라미가 채워지면 내가 고른 것입니다. */
.poll-choice {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  min-height: 3.5rem;
  padding: 0.625rem 1rem;
  border: 2px solid transparent;
  border-radius: 1rem;
  background: var(--fill);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: left;
}
.poll-choice::before {
  content: "";
  width: 1.375rem;
  height: 1.375rem;
  flex-shrink: 0;
  border: 2px solid #c4cad1;
  border-radius: 50%;
  background: var(--surface);
}
.poll-choice.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.poll-choice.on::before { border: 0; background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6.5 12.5l3.5 3.5 7.5-8'/%3E%3C/svg%3E") center / 1rem no-repeat; }
.poll-choice span { flex: 1; min-width: 0; }
.poll-choice small { font-size: 0.75rem; font-weight: 700; }
.poll-foot { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; min-height: 2.25rem; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--text-3); }
.link-btn { height: 2.25rem; padding: 0 0.25rem; border: 0; background: none; color: var(--text-3); font-size: 0.8125rem; font-weight: 600; text-decoration: underline; text-underline-offset: 0.2em; }

.poll-result { margin-top: 1rem; padding-top: 1.125rem; border-top: 1px solid var(--line); }
.poll-result-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; }
.poll-result-head b { font-size: 1rem; }
.poll-group { margin-top: 1rem; }
.poll-bar-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.5rem; font-weight: 700; }
.poll-count { color: var(--primary); font-variant-numeric: tabular-nums; }
.poll-count small { margin-left: 0.25rem; font-size: 0.8125rem; font-weight: 600; color: var(--text-3); }
.poll-bar { height: 0.5rem; margin-top: 0.375rem; overflow: hidden; border-radius: 999px; background: var(--fill); }
.poll-bar i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.poll-names { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.625rem; }
.poll-names li { padding: 0.25rem 0.625rem; border-radius: 0.5rem; background: var(--fill); font-size: 0.875rem; font-weight: 600; }
.poll-names small { margin-left: 0.125rem; font-size: 0.75rem; font-weight: 500; }

/* 공지 쓰기의 설문 칸 */
.poll-edit { padding: 0.375rem; border-radius: var(--radius); background: var(--surface); }
.poll-edit > .check { background: none; }
.poll-fields { margin: 0.25rem 0.875rem 0.875rem; }
fieldset.field { margin: 0; padding: 0; border: 0; }
fieldset.field .check { background: var(--fill); }
fieldset.field .check + .check { margin-top: 0.5rem; }

/* ---------- 예배식순지 ---------- */

/* 기관 고르기 — 옆으로 밀어서 봅니다. */
.chips { display: flex; gap: 0.5rem; padding: 0.5rem var(--gutter) 0.875rem; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips a { display: flex; align-items: center; height: 2.375rem; padding: 0 0.875rem; flex-shrink: 0; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.chips a.on { background: var(--text); color: #fff; font-weight: 700; }
.chips small { margin-left: 0.375rem; padding: 0.0625rem 0.375rem; border-radius: 0.375rem; background: var(--primary-soft); color: var(--primary); font-size: 0.6875rem; font-weight: 700; }
.chips a.on small { background: rgba(255, 255, 255, 0.22); color: #fff; }

/* 목록의 한 장 — 왼쪽에 날짜를 달력처럼 크게 */
.date-card { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; }
.date-box { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 3.25rem; height: 3.5rem; flex-shrink: 0; border-radius: 0.875rem; background: var(--fill); }
.date-box b { font-size: 1.25rem; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.date-box small { font-size: 0.6875rem; font-weight: 700; color: var(--text-3); }
.date-card.is-soon .date-box { background: var(--primary); color: #fff; }
.date-card.is-soon .date-box small { color: rgba(255, 255, 255, 0.8); }
.date-card > div:nth-child(2) { flex: 1; min-width: 0; }
.date-card > .icon { width: 1.125rem; height: 1.125rem; color: #c4cad1; }

/*
 * 식순지 보기 — 기관에서 쓰는 종이 예배지와 같은 차례입니다.
 * 제목 → 인도자(오른쪽) → [순서 | 내용 | 맡은 이] 줄들 → 다음 주 인도자·기도자 → 기관 이름
 */
.order { padding: 1.75rem 1.25rem 1.5rem; }
.order-head { text-align: center; }
.order-head h2 { font-size: 1.3125rem; font-weight: 800; line-height: 1.4; letter-spacing: -0.03em; }
.order-head .muted { margin-top: 0.25rem; }
.order-leader { margin-top: 0.875rem; text-align: right; font-size: 0.9375rem; font-weight: 700; }
.order-leader span { margin-right: 0.375rem; font-weight: 600; color: var(--text-3); }
.order-list { margin-top: 0.75rem; border-top: 2px solid var(--text); border-bottom: 2px solid var(--text); }
.order-list > li { padding: 0.875rem 0; }
.order-list > li + li { border-top: 1px solid var(--line); }
/* 순서 이름은 왼쪽, 맡은 이는 오른쪽에 같은 폭으로 두고, 가운데에 내용을 놓습니다. */
.order-row { display: flex; align-items: center; gap: 0.5rem; font-size: 1rem; line-height: 1.45; }
.order-label { width: 4.25rem; flex-shrink: 0; font-weight: 800; letter-spacing: -0.02em; }
.order-content { flex: 1; min-width: 0; text-align: center; color: var(--text-2); }
.order-person { min-width: 4.25rem; flex-shrink: 0; text-align: right; font-size: 0.9375rem; font-weight: 600; }
/* 찬양·성경은 누르면 악보·본문으로 넘어갑니다 — 누를 수 있다는 것이 보이게 파랗게, 줄 하나를 통째로. */
.order-links { display: grid; gap: 0.5rem; margin-top: 0.625rem; }
.order-link { display: flex; align-items: center; gap: 0.5rem; min-height: 3rem; padding: 0.5rem 0.875rem; border-radius: var(--radius-sm); background: var(--primary-soft); color: var(--primary); font-weight: 700; line-height: 1.4; }
.order-link:active { background: #d3e7ff; }
.order-link span { flex: 1; min-width: 0; }
.order-link .icon { width: 1.125rem; height: 1.125rem; }
.order-link .icon:last-child { opacity: 0.6; }
/*
 * 함께 읽는 글(사도신경 등). 종이 예배지는 가운데로 모아 적지만, 휴대폰 폭에서는 줄마다
 * 두 줄로 꺾여 읽기 어렵습니다. 그래서 왼쪽에 맞추고, 원래의 줄바꿈은 살려 둡니다.
 */
.order-body { margin-top: 0.75rem; padding: 0.875rem 1rem; border-radius: var(--radius-sm); background: var(--fill); font-size: 0.9375rem; line-height: 1.8; white-space: pre-line; }
.pill { display: inline-flex; align-items: center; min-height: 2.375rem; padding: 0.25rem 0.875rem; border-radius: 0.75rem; background: var(--primary-soft); color: var(--primary); font-size: 0.9375rem; font-weight: 700; }
.pill:active { background: #d3e7ff; }
.order-passage { margin-top: 0.5rem; }
.order-passage summary { display: flex; align-items: center; justify-content: center; height: 2.25rem; font-size: 0.875rem; font-weight: 600; color: var(--text-3); cursor: pointer; }
.order-passage p { margin-top: 0.25rem; padding: 0.875rem 1rem; border-radius: var(--radius-sm); background: var(--fill); }
.order-next { margin-top: 0; }
.order-next > div { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.order-next dt { font-weight: 800; letter-spacing: -0.02em; }
.order-next dd { font-weight: 600; }
.order-memo { margin-top: 1.25rem; padding: 1rem; border-radius: var(--radius-sm); background: var(--fill); }
.order-memo h3 { font-size: 0.8125rem; font-weight: 700; color: var(--text-3); }
.order-memo p { margin-top: 0.375rem; line-height: 1.7; white-space: pre-wrap; }
.order-org { margin-top: 1.5rem; text-align: center; font-size: 0.9375rem; font-weight: 800; letter-spacing: -0.02em; color: var(--text-2); }

/* 식순지 쓰기 — 한 줄이 한 장의 작은 카드 */
.items { counter-reset: item; }
.items > li + li { margin-top: 0.625rem; }
.item { padding: 0.875rem; border-radius: var(--radius); background: var(--surface); counter-increment: item; }
.item > * + * { margin-top: 0.5rem; }
.item-bar { display: flex; align-items: center; gap: 0.375rem; }
.item-no { margin-right: auto; }
.item-no::before { content: counter(item); display: flex; align-items: center; justify-content: center; width: 1.625rem; height: 1.625rem; border-radius: 0.5rem; background: var(--text); color: #fff; font-size: 0.75rem; font-weight: 800; }
.round { display: flex; align-items: center; justify-content: center; width: 2.25rem; height: 2.25rem; flex-shrink: 0; border: 0; border-radius: 50%; background: var(--fill); color: var(--text-3); font-weight: 700; }
.round:active { background: var(--fill-press); }
.round-danger { color: var(--danger); background: var(--danger-soft); }
.item-main { display: grid; grid-template-columns: 6.5rem 1fr; gap: 0.5rem; }
.item-links summary { display: inline-flex; align-items: center; height: 2.25rem; padding: 0 0.75rem; border-radius: 999px; background: var(--fill); font-size: 0.8125rem; font-weight: 600; color: var(--text-3); cursor: pointer; list-style: none; }
.item-links summary::-webkit-details-marker { display: none; }
.item-links[open] summary { background: var(--primary-soft); color: var(--primary); }
.item-hymn { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; font-size: 0.875rem; font-weight: 600; color: var(--text-3); }
.item-hymn { flex-wrap: wrap; }
.item-hymn .input { width: 5.5rem; }
/* 번호를 치면 그 자리에 제목이 뜹니다. 없는 번호면 붉게. */
.item-hymn-title { flex-basis: 100%; min-height: 1.25rem; font-size: 0.9375rem; font-weight: 700; color: var(--primary); }
.item-hymn-title.is-missing { color: var(--danger); }
.item-body { margin-top: 0.5rem; height: auto; padding: 0.75rem; line-height: 1.6; }
/* 늘 쓰지는 않는 칸들을 접어 두는 자리 */
.more-fields > summary { display: inline-flex; align-items: center; height: 2.75rem; padding: 0 1rem; border-radius: 999px; background: var(--surface); font-size: 0.875rem; font-weight: 700; color: var(--text-2); cursor: pointer; list-style: none; }
.more-fields > summary::-webkit-details-marker { display: none; }
.more-fields[open] > summary { margin-bottom: 1.25rem; background: var(--primary-soft); color: var(--primary); }
.item-bible { display: grid; grid-template-columns: 1fr 3.9rem 3.9rem 3.9rem; gap: 0.375rem; margin-top: 0.5rem; }
.item-bible .input { padding: 0 0.5rem; }
.item-bible select.input { padding-right: 1.75rem; background-position: right 0.25rem center; }
.add-row { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }
.chip-btn { height: 2.375rem; padding: 0 0.875rem; border: 0; border-radius: 999px; background: var(--surface); color: var(--text-2); font-size: 0.875rem; font-weight: 600; }
.chip-btn:active { background: var(--fill-press); }
.chip-btn-dashed { background: var(--primary-soft); color: var(--primary); }

/* ---------- 찬양집 ---------- */

/* 찾기 칸은 목록을 내려도 위에 붙어 있습니다 — 다시 찾으려고 맨 위로 올라가지 않게. */
.sticky-search { position: sticky; top: 0; z-index: 10; margin: 0 calc(var(--gutter) * -1); padding: 0.5rem var(--gutter) 0.625rem; background: rgba(242, 244, 246, 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.filters { display: flex; align-items: center; gap: 0.75rem; margin-top: 0.625rem; }
.filters .segment { flex: 1; }
.hymn-list > li > a { display: flex; align-items: center; gap: 0.875rem; min-height: 3.75rem; padding: 0.625rem 1.25rem; }
.hymn-no { display: flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.375rem; flex-shrink: 0; border-radius: 0.75rem; background: var(--fill); font-size: 1rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.hymn-title { flex: 1; min-width: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.35; letter-spacing: -0.02em; }
.hymn-list .tiny { flex-shrink: 0; }

.hymn { padding: 0.25rem 0 0; }
.hymn-meta { display: flex; align-items: center; gap: 0.5rem; padding: 0 var(--gutter) 0.625rem; }
.hymn-sheet { background: #fff; }
.hymn-sheet img { display: block; width: 100%; height: auto; }
.hymn .pager { padding: 0 var(--gutter); }

.pager { display: flex; gap: 0.625rem; margin-top: 1rem; }
.pager > * { flex: 1; }
.pager .btn { height: 3.25rem; font-size: 1rem; }

/* ---------- 성경 ---------- */

.group-title { margin-bottom: 0.5rem; padding: 0 0.25rem; font-size: 0.8125rem; font-weight: 700; color: var(--text-3); }
/* 구약·신약 묶음 단추가 떠 있으면 그 아래의 "구약 39권" 제목은 겹치는 말이라 숨깁니다. */
#testament-tabs:not([hidden]) ~ section .group-title { display: none; }
.grid-books { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.grid-chapters { display: grid; grid-template-columns: repeat(5, 1fr); gap: 0.5rem; margin-top: 0.75rem; }
.grid-books a, .grid-chapters a { display: flex; align-items: center; justify-content: center; border-radius: var(--radius-sm); background: var(--surface); font-weight: 600; text-align: center; }
.grid-books a { height: 3.375rem; padding: 0 0.25rem; font-size: 0.9375rem; line-height: 1.25; letter-spacing: -0.02em; }
.grid-chapters a { height: 3.25rem; font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.grid-books a:active, .grid-chapters a:active { background: var(--fill-press); transform: scale(0.96); }
.continue { display: flex; align-items: center; gap: 0.875rem; padding: 1rem 1.25rem; }
.continue > div { flex: 1; min-width: 0; }
.continue span { font-size: 0.8125rem; font-weight: 700; color: var(--primary); }
.continue b { display: block; font-size: 1.0625rem; letter-spacing: -0.02em; }
.continue > .icon { width: 1.125rem; height: 1.125rem; color: #c4cad1; }

/* 본문 — 글자 크기는 읽는 사람이 고릅니다(app.js 가 --bible-font-size 를 바꿉니다). */
.bible-text { font-size: var(--bible-font-size, 18px); line-height: 1.85; letter-spacing: -0.005em; }
.bible-text sup { margin-right: 0.3em; font-size: 0.62em; font-weight: 700; color: var(--primary); }
.reading { margin: 0.25rem var(--gutter) 0; padding: 1.25rem; border-radius: var(--radius); background: var(--surface); }
.reading + .pager, .reading-pager { margin: 0.75rem var(--gutter) 0; }
/* 제목 줄에 가리지 않는 자리로 스크롤되게 */
.verse { margin: 0 -0.5rem; padding: 0.25rem 0.5rem; border-radius: 0.5rem; scroll-margin-top: 5rem; }
/* 식순지·찾기에서 넘어왔을 때 그 구절을 눈에 띄게 */
.verse-mark, .verse:target { background: #fff3c4; }

.sizer { display: flex; gap: 0.375rem; margin-right: 0.5rem; flex-shrink: 0; }
.sizer button { display: flex; align-items: center; justify-content: center; width: 2.375rem; height: 2.375rem; border: 0; border-radius: 50%; background: var(--surface); font-size: 0.8125rem; font-weight: 800; }
.sizer button.big { font-size: 1.1875rem; }
.sizer button:active { background: var(--fill-press); }

.hit b { display: block; font-size: 0.8125rem; color: var(--primary); }
.hit span { display: block; margin-top: 0.25rem; font-size: 1.0625rem; line-height: 1.7; }

/* ---------- 내 정보 · 담당자 ---------- */

.facts { margin-top: 1.125rem; padding-top: 1.125rem; border-top: 1px solid var(--line); font-size: 0.9375rem; }
.facts > div { display: flex; gap: 0.75rem; }
.facts > div + div { margin-top: 0.625rem; }
.facts dt { width: 3.5rem; flex-shrink: 0; color: var(--text-3); }
.facts dd { min-width: 0; font-weight: 600; word-break: break-all; }
.row-link { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; }
.row-link small { display: block; margin-top: 0.125rem; font-size: 0.8125rem; }
.row-link .icon { width: 1.125rem; height: 1.125rem; color: #c4cad1; }
.assign { display: flex; gap: 0.5rem; margin-top: 0.875rem; }
.assign .input { flex: 1; min-width: 0; }

/* 움직임을 줄여 달라고 해 둔 기기에서는 눌림 효과를 끕니다. */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
