/* 교회 관리 화면 공통 모양
   원칙: 글씨 18px 이상, 단추는 크게, 한 화면에 한 가지 일, 휴대폰 폭(360px)에서도 깨지지 않게 */

:root {
  --bar: #23303f;
  --bar-hi: #3d5a80;
  --bar-text: #ffffff;
  --sub: #e8edf3;
  --bg: #ffffff;
  --text: #1b1f24;
  --muted: #5b6470;
  --line: #cfd6de;
  --accent: #2b5d8c;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #1e6b3a;
  --row-alt: #f5f7fa;
  font-size: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: "Malgun Gothic", "맑은 고딕", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  font-size: 1rem;
  line-height: 1.6;
}
[hidden] { display: none !important; }

/* ----- 위쪽 검은 메뉴 줄 ----- */
.topbar { background: var(--bar); color: var(--bar-text); }
.topbar-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px;
  max-width: 1200px; margin: 0 auto; padding: 6px 16px;
}
.brand { font-weight: 700; font-size: 1.1rem; margin-right: 8px; }
/* 7-5 교단 마크: 위 메뉴 줄의 교회 이름 앞에 작게 */
.brand-logo { height: 28px; width: auto; max-width: 56px; object-fit: contain; background: #fff; border-radius: 4px; padding: 1px; }
.mainnav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
.mainnav a {
  color: var(--bar-text); text-decoration: none; padding: 10px 14px; border-radius: 4px;
  font-size: 1.05rem;
}
.mainnav a:hover, .mainnav a:focus-visible { background: rgba(255, 255, 255, 0.12); }
.mainnav a.on { background: var(--bar-hi); font-weight: 700; }
.who { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 1rem; }
a.btn-plain { display: inline-flex; align-items: center; text-decoration: none; }
.btn-plain {
  background: transparent; color: var(--bar-text); border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 4px; padding: 6px 12px; font-size: 1rem; cursor: pointer; min-height: 40px;
}

/* ----- 교적 아래 메뉴 ----- */
.subnav {
  background: var(--sub); border-bottom: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 4px;
  /* 위 메뉴·작업 영역과 같은 폭(1200px)으로 가운데 맞춤 */
  padding: 6px max(16px, calc((100% - 1200px) / 2 + 16px));
}
.subnav a { color: var(--text); text-decoration: none; padding: 8px 14px; border-radius: 4px; }
.subnav a.on { background: #fff; font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }

/* ----- 작업 영역 ----- */
.page { max-width: 1200px; margin: 0 auto; padding: 16px; }
.page.page-wide { max-width: 1560px; }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
h2 { font-size: 1.25rem; margin: 24px 0 8px; }
.muted { color: var(--muted); }
.msg { padding: 10px 14px; border-radius: 4px; margin: 8px 0; }
.msg.err { background: #fdecea; color: var(--danger); border: 1px solid #f3b8b3; }
.msg.ok { background: #e7f4ec; color: var(--ok); border: 1px solid #b5dcc3; }

/* 단추 */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-size: 1rem; min-height: 48px; padding: 8px 18px;
  border-radius: 6px; border: 1px solid var(--line); background: #fff; color: var(--text);
  cursor: pointer; text-decoration: none;
}
button.primary, .btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 700; }
button.danger { color: var(--danger); border-color: #e2a8a3; }
button:disabled { opacity: 0.5; cursor: default; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }

/* 입력 */
label { display: block; font-weight: 600; margin-bottom: 4px; }
input[type=text], input[type=password], input[type=tel], input[type=date], input[type=number], input[type=search], input[type=month], select, textarea {
  font: inherit; font-size: 1rem; width: 100%; min-height: 48px; padding: 8px 10px;
  border: 1px solid #9aa5b1; border-radius: 6px; background: #fff; color: var(--text);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 3px solid #7aa7d6; outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 600; min-height: 48px; }
.check input { width: 26px; height: 26px; }
.radios { display: flex; gap: 16px; min-height: 48px; align-items: center; }
.radios label { display: flex; align-items: center; gap: 6px; font-weight: 400; margin: 0; }
.radios input { width: 24px; height: 24px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px 20px; }
.form-grid .wide { grid-column: 1 / -1; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 40%); gap: 8px; }
.field-pair > * { min-width: 0; }
.form-grid > * { min-width: 0; }
.req::after { content: " (필수)"; color: var(--danger); font-weight: 400; font-size: 0.9rem; }
.narrow { max-width: 460px; }

/* 거르기 줄 */
.filters { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; align-items: start; margin-bottom: 12px; }

/* 표 */
table.list { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.list th, table.list td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: left; vertical-align: top; }
table.list th { background: var(--sub); white-space: nowrap; }
table.list tbody tr:nth-child(even) { background: var(--row-alt); }
table.list a { color: var(--accent); font-weight: 700; }
.count { margin: 8px 0; color: var(--muted); }
.table-wrap { width: 100%; overflow-x: auto; }

/* 보기 화면 */
dl.info { display: grid; grid-template-columns: 140px 1fr; gap: 6px 16px; margin: 0; }
dl.info dt { color: var(--muted); }
dl.info dd { margin: 0; word-break: break-word; white-space: pre-wrap; }
.box { border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li { padding: 10px 0; border-bottom: 1px solid var(--line); }
.cands { border: 1px solid var(--line); border-radius: 6px; margin-top: 4px; }
.cands button { display: block; width: 100%; text-align: left; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.cands button:last-child { border-bottom: 0; }
.tag { display: inline-block; font-size: 0.9rem; padding: 0 8px; border-radius: 10px; background: var(--sub); margin-left: 6px; }
/* 11-21 재정 설정 → 표준 과목 고르기 */
.cat-group { margin: 14px 0 6px; }
.cat-group h3 { margin: 0 0 4px; font-size: 1.05rem; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 4px 16px; }
.cat-item { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; padding: 3px 0; }
.cat-item.have { color: var(--muted, #666); }
.cat-item .small { flex-basis: 100%; margin-left: 26px; }

.login-box { max-width: 420px; margin: 40px auto; }

/* ----- 헌금 기록: 세 칸(왼쪽 날짜·과목, 가운데 목록·합계, 오른쪽 입력) ----- */
.offer-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr) 370px; gap: 16px 20px; align-items: start; }
.offer-grid > section { min-width: 0; }
.offer-grid h2 { margin-top: 4px; }
.offer-grid .col-left > div { margin-bottom: 10px; }
.entry-box { border: 2px solid var(--accent); border-radius: 8px; padding: 10px 14px; background: #f7fafd; }
/* 오른쪽 칸(입력 + 지금까지 기록)은 화면 높이 안에 두고, 기록 목록만 안에서 굴린다(7-2) */
.offer-grid .col-right { position: sticky; top: 8px; display: flex; flex-direction: column; max-height: calc(100vh - 128px); }
.offer-grid .col-right > .entry-box, .offer-grid .col-right > form { flex: 0 0 auto; }
.entry-box > div { margin-bottom: 10px; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
input.num { text-align: right; font-size: 1.15rem; }
table.list th.num, table.list td.num { text-align: right; white-space: nowrap; }
table.list.compact th, table.list.compact td { padding: 6px 6px; }
/* 11-21 오너: 모든 계정 요약 표는 칸 사이를 넉넉히 띄워 읽기 쉽게 */
table.list.fund-summary { width: auto; min-width: 100%; }
table.list.fund-summary th, table.list.fund-summary td { padding: 12px 22px; }
table.list.fund-summary th:first-child, table.list.fund-summary td:first-child { padding-left: 14px; padding-right: 28px; }
table.list.fund-summary .num { min-width: 7.5em; }
table.list tfoot th { background: var(--sub); border-top: 2px solid var(--text); }
table.list tr.cancelled td { color: var(--muted); }
table.list tr.cancelled td:not(.row-btns) { text-decoration: line-through; }
table.list tr.fresh td { background: #fff6d6; }
td.row-btns { white-space: nowrap; }
td.nowrap { white-space: nowrap; }
/* 그날 목록이 길어도 아래 합계·계수 칸이 보이게 목록만 안에서 굴린다 */
.list-scroll { max-height: 55vh; overflow-y: auto; border-bottom: 1px solid var(--line); }
.list-scroll thead th { position: sticky; top: 0; z-index: 1; }
@media (max-width: 1300px) { .hide-md { display: none; } }
.small { font-size: 0.9rem; }
.small-btn { min-height: 40px; padding: 4px 10px; font-size: 0.95rem; }
.actions.tight { margin: 4px 0; gap: 6px; }
.tag.warn { background: #fdecea; color: var(--danger); text-decoration: none; white-space: normal; }
.diff { font-weight: 700; padding: 8px 10px; border-radius: 6px; background: var(--sub); }
.diff.same { background: #e7f4ec; color: var(--ok); }
.diff.differ { background: #fdecea; color: var(--danger); }
.donor { position: relative; }
.cands-list { list-style: none; margin: 4px 0 0; padding: 0; border: 1px solid #9aa5b1; border-radius: 6px; background: #fff;
  position: absolute; left: 0; right: 0; z-index: 10; max-height: 320px; overflow-y: auto; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); }
.cands-list li { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.cands-list li:last-child { border-bottom: 0; }
.cands-list li span { color: var(--muted); }
.cands-list li.active { background: var(--accent); color: #fff; }
.cands-list li.active span { color: #e8eef5; }
.cands-list li.none { color: var(--muted); cursor: default; }
.chosen { font-size: 0.95rem; color: var(--muted); margin-top: 4px; min-height: 1.5em; }
.chosen.ok { color: var(--ok); font-weight: 600; }
.chosen.warn { color: var(--danger); }
table.list tr.off td { opacity: 0.6; }
table.report { width: auto; min-width: 320px; }
table.report.pivot { width: 100%; }
/* 7-2: 입력 칸 안 두 칸 줄, 온라인 표시, 고치는 중, 지금까지 기록 */
.entry-box h2 { margin: 0 0 6px; }
.entry-box .pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; margin-bottom: 8px; }
.entry-box .pair > div { min-width: 0; }
.entry-box .pair input, .entry-box .pair select { width: 100%; min-width: 0; }
.entry-box .checks { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; margin-bottom: 4px; }
.entry-box .checks .check { min-height: 40px; font-size: 0.95rem; gap: 6px; line-height: 1.2; }
.entry-box > div { margin-bottom: 8px; }
.entry-box .actions { margin: 4px 0; }
.entry-box .help { margin: 6px 0 0; }
.entry-box .msg { padding: 4px 8px; margin: 4px 0; font-size: 0.9rem; }
.entry-box.editing { border-color: #c77700; background: #fff4e0; }
.entry-box.editing h2 { color: #8a5200; }
.edit-note { margin: 0 0 8px; padding: 6px 8px; border-radius: 4px; background: #ffe2b0; color: #5c3700; font-weight: 600; font-size: 0.95rem; }
.link-btn { border: 0; background: none; padding: 0; min-height: 0; color: var(--accent); text-decoration: underline; font-size: inherit; cursor: pointer; }
.tag.online { background: #dcecff; color: #1d4f86; }
table.list tr.pick { cursor: pointer; }
table.list tr.pick:hover td, table.list tr.pick:focus td { background: #eef4fa; }
table.list tr.editing-row td { background: #ffe2b0; }
.run-box { margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; background: #fff;
  flex: 1 1 auto; min-height: 150px; display: flex; flex-direction: column; }
.run-box h3 { margin: 0; font-size: 1.05rem; }
.run-sum { margin: 2px 0 6px; font-size: 0.9rem; color: var(--muted); }
.run-list { flex: 1 1 auto; min-height: 60px; overflow-y: auto; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.run-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 6px;
  border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: none; text-align: left; font-size: 1rem; cursor: pointer; }
.run-item:last-child { border-bottom: 0; }
.run-item:hover, .run-item:focus { background: #eef4fa; }
.run-item.fresh { background: #fff6d6; }
.run-item.editing-row { background: #ffe2b0; }
.run-who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donor-row { display: flex; gap: 6px; align-items: stretch; flex-wrap: wrap; }
.donor-row > input { flex: 1 1 auto; min-width: 0; }
/* 7-5 교인 등록 때 성별(이름과 성별로 등록) */
.donor-row .donor-gender { flex: 0 0 auto; gap: 10px; min-height: 0; }
.donor-row .donor-gender input { width: 20px; height: 20px; }
.donor-row .small-btn { flex: 0 0 auto; white-space: nowrap; }
.donor input.unknown { background: #fde2e2; border-color: #c0392b; color: #3a0d0d; }
.cands-list li.create { color: var(--accent); font-weight: 700; }
.cands-list li.create.active { color: #fff; }
.cands-list li .no { color: var(--muted); font-variant-numeric: tabular-nums; }
.cands-list li.active .no { color: #e8eef5; }
.msg.warn-note { background: #fff4e0; color: #5c3700; border: 1px solid #f0c987; }
.split { margin: 8px 0 4px; font-weight: 600; }
tr.split-row td { font-size: 0.95rem; color: var(--muted); }
@media (max-width: 1000px) {
  .offer-grid .col-right { position: static; max-height: none; }
  .run-box { min-height: 0; }
  .run-list { flex: none; max-height: 40vh; }
  .offer-grid { grid-template-columns: minmax(0, 1fr); }
  .offer-grid .col-left { order: 1; }
  .offer-grid .col-right { order: 2; }
  .offer-grid .col-mid { order: 3; }
  .entry-box { position: static; }
  .list-scroll { max-height: none; }
}

/* 휴대폰 폭 */
@media (max-width: 640px) {
  /* 휴대폰: 첫 줄 = 교회 이름 + 사용자 단추, 둘째 줄 = 메뉴 한 줄(넘치면 옆으로 밀기) */
  .topbar-inner { padding: 6px 8px; gap: 4px 8px; }
  .brand { order: 1; font-size: 1rem; margin-right: 0; }
  .brand-logo { order: 0; height: 24px; }
  .who { order: 2; margin-left: auto; gap: 6px; font-size: 0.9rem; }
  .who .btn-plain { padding: 4px 8px; min-height: 34px; font-size: 0.9rem; }
  .mainnav {
    order: 3; flex: 0 0 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; scrollbar-width: none;
  }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { padding: 8px 10px; white-space: nowrap; flex: 0 0 auto; }
  .page { padding: 12px; }
  dl.info { grid-template-columns: 1fr; }
  dl.info dt { margin-top: 6px; }
  .hide-sm { display: none; }
  table.list th, table.list td { padding: 8px 4px; }
}

/* 인쇄: 메뉴·단추·거르기를 숨기고 표만 */
.print-only { display: none; }
@media print {
  :root { font-size: 12pt; }
  .topbar, .subnav, .filters, .actions, .no-print { display: none !important; }
  .print-only { display: block; }
  .page { max-width: none; padding: 0; }
  table.list th { background: #eee; }
  table.list a { color: #000; font-weight: 400; text-decoration: none; }
  .hide-sm { display: table-cell; }
  .offer-grid { display: block; }
  table.list tr.fresh td { background: none; }
}
.pre { white-space: pre-wrap; word-break: break-word; margin-top: 4px; }

/* ----- 3단계: 취소 사유 칸, 첫 화면 알림, 묶음 줄, 보고서 ----- */
.reason-box { border: 2px solid var(--danger); border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: #fff8f7; }
.reason-box .reason-text { margin: 0 0 8px; font-weight: 600; }
.reason-box .reason-err { color: var(--danger); margin: 4px 0 0; min-height: 0; }
.reason-box .reason-err:empty { display: none; }
.reason-box .actions { margin: 8px 0 0; }
.notice {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  max-width: 1200px; margin: 12px auto 0; padding: 10px 16px;
  background: #fff4d6; border: 1px solid #e8c66a; border-radius: 6px; font-weight: 600;
}
@media (max-width: 1232px) { .notice { margin: 12px 16px 0; } }
table.list tr.group th, table.list tr.group td { background: var(--sub); font-weight: 700; }
table.list td.indent { padding-left: 28px; }
table.list tr.strong th, table.list tr.strong td { font-weight: 700; border-top: 2px solid var(--text); }
table.summary { min-width: 360px; margin: 8px 0 4px; }
table.summary th { background: var(--sub); width: 12em; }
.report-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 0 28px; align-items: start; }
.report-cols table.report { width: 100%; min-width: 0; }
table.report.wide-report { width: 100%; }
table.budget td input.num { min-height: 40px; padding: 4px 8px; }
table.budget td:nth-child(2) { width: 46%; }
.narrow-wide { max-width: 760px; }

@page { size: A4 portrait; margin: 12mm; }
@media print {
  .notice, .reason-box { display: none !important; }
  .print-head h1 { font-size: 16pt; margin: 0 0 2mm; }
  .print-head p { margin: 0 0 4mm; }
  .report-cols { grid-template-columns: 1fr 1fr; gap: 0 8mm; }
  table.list.compact th, table.list.compact td { padding: 3px 5px; }
  table.list tr.group th, table.list tr.group td { background: #eee; }
  h2 { font-size: 13pt; margin: 4mm 0 2mm; }
  .msg { display: none; }
}

/* ----- 4단계: 기부금 영수증 ----- */
.msg.tax { background: #eef3f8; color: var(--text); border: 1px solid var(--line); }
.rrn-box { border: 2px solid var(--accent); border-radius: 8px; padding: 10px 14px; margin: 8px 0; background: #f7fafd; max-width: 560px; }
.rrn-box .reason-text { margin: 0 0 4px; font-weight: 600; }
.rrn-box .actions { margin: 8px 0 0; }

/* 영수증 한 장 = A4 한 쪽. 화면에서도 종이 모양으로 보인다. 서식(별지 제45호의2서식)의 칸 순서를 따른다. */
.receipt {
  width: 186mm; max-width: 100%; margin: 16px auto; padding: 10mm 10mm 8mm; background: #fff;
  border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 10pt; line-height: 1.35; color: #000;
}
.receipt .rc-form { margin: 0 0 2mm; font-size: 8.5pt; }
.receipt .rc-head { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4mm; margin-bottom: 2mm; }
.receipt .rc-title { margin: 0; text-align: center; font-size: 20pt; letter-spacing: 2px; padding-right: 30mm; }
.receipt .rc-note { margin: 0 0 1mm; font-size: 9pt; text-align: right; }
.receipt h3 { font-size: 10.5pt; margin: 2.5mm 0 1mm; padding-top: 1mm; border-top: 2px solid #000; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt table.rc-serial { width: auto; }
.receipt th, .receipt td { border: 1px solid #555; padding: 1mm 1.6mm; text-align: left; vertical-align: top; font-weight: 400; }
.receipt table.rc th { width: 24%; background: #f3f3f3; font-size: 8.5pt; }
.receipt table.rc td { width: 26%; word-break: break-all; }
.receipt table.rc-lines th { background: #f3f3f3; text-align: center; width: auto; font-size: 9.5pt; }
.receipt table.rc-lines { table-layout: fixed; }
.receipt table.rc-lines col:nth-child(1) { width: 9%; }
.receipt table.rc-lines col:nth-child(2) { width: 11%; }
.receipt table.rc-lines col:nth-child(3) { width: 22%; }
.receipt table.rc-lines col:nth-child(4) { width: 17%; }
.receipt table.rc-lines col:nth-child(5) { width: 9%; }
.receipt table.rc-lines col:nth-child(6) { width: 11%; }
.receipt table.rc-lines col:nth-child(7) { width: 21%; }
.receipt table.rc-lines td { height: 6mm; padding-top: 0.6mm; padding-bottom: 0.6mm; }
.receipt table.rc-lines td.c { text-align: center; }
.receipt table.rc-lines .num, .receipt table.rc-lines tfoot th.num { text-align: right; white-space: nowrap; }
.receipt table.rc-lines tfoot th { background: #f3f3f3; text-align: center; font-weight: 700; }
.receipt .rc-text { margin: 3mm 0 1mm; text-indent: 1em; }
.receipt .rc-date { margin: 1mm 0; text-align: right; }
.receipt .rc-sign { display: flex; justify-content: flex-end; align-items: center; gap: 6mm; margin: 1mm 0; }
.receipt .rc-name { min-width: 40mm; font-weight: 700; }
.receipt .rc-seal { font-size: 9pt; color: #333; }
.receipt .rc-seal.stamp { display: inline-flex; align-items: center; justify-content: center; width: 18mm; height: 18mm; border: 1px dashed #999; border-radius: 50%; }
.receipt hr { border: 0; border-top: 1px solid #000; margin: 2mm 0; }
@media (max-width: 640px) {
  .receipt { padding: 4mm; font-size: 9pt; }
  .receipt .rc-title { font-size: 15pt; padding-right: 0; }
  .receipt .rc-head { grid-template-columns: 1fr; }
}
@media print {
  .receipts { margin: 0; }
  .receipt { width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .receipt:last-child { break-after: auto; page-break-after: auto; }
  .receipt th, .receipt table.rc-lines th, .receipt table.rc-lines tfoot th { background: #f3f3f3; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ----- 5단계: 회계 구분 ----- */
.fund-tag { display: inline-block; font-size: 0.8rem; line-height: 1.5; color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 6px; margin-left: 6px; white-space: nowrap; vertical-align: middle; }
table.list tr.fund th, table.list tr.fund td { background: #d6e2ef; font-weight: 700; }
table.list td.indent2 { padding-left: 48px; }
table.list th.indent { padding-left: 28px; }
table.list tr.grand th, table.list tr.grand td { font-weight: 700; border-top: 3px double var(--text); }
table.pivot .fund-sub { background: var(--row-alt); font-weight: 700; }
table.pivot thead th.fund-head { text-align: center; border-bottom: 1px solid var(--line); }
.bundle-note { margin-top: 24px; border-top: 2px dashed var(--line); padding-top: 12px; }
.print-page + .print-page { margin-top: 32px; }
@media print {
  .fund-tag { border: 0; padding: 0; color: #333; }
  table.list tr.fund th, table.list tr.fund td { background: #ddd; }
  .print-page { break-after: page; page-break-after: always; }
  .print-page:last-child { break-after: auto; page-break-after: auto; }
  .print-page + .print-page { margin-top: 0; }
  .bundle-note { border: 0; margin: 0; padding: 0; }
}

/* ----- 6단계: 한글 금액, 회계 이체, 기부자별 발급명세서, 발급합계표 ----- */
.won-words { display: block; min-height: 1.3em; margin-top: 2px; font-size: 0.85rem; color: var(--muted); }
table.budget .won-words { font-size: 0.8rem; }
.transfer-form { position: static; max-width: 1100px; }
table.list tr.transfer td, table.list tr.transfer th { font-style: italic; }
.csv-confirm { max-width: 640px; }
.csv-confirm .actions a.btn { text-decoration: none; }

/* 기부자별 발급명세서: 서식(1)의 칸 순서. 영수증 한 장 = 두 층(성명·주민번호 / 주소). 인쇄는 A4 가로. */
@page statement { size: A4 landscape; margin: 10mm; }
.statement { page: statement; background: #fff; color: #000; font-size: 10pt; line-height: 1.35; margin: 12px 0; }
.statement .rc-form { margin: 0 0 2mm; font-size: 8.5pt; }
.statement table { width: 100%; border-collapse: collapse; }
.statement th, .statement td { border: 1px solid #555; padding: 1mm 1.5mm; vertical-align: middle; font-weight: 400; }
.statement th { background: #f3f3f3; text-align: center; }
.statement .c { text-align: center; }
.statement .num { text-align: right; white-space: nowrap; }
.statement .nowrap { white-space: nowrap; }
.statement .small { font-size: 8.5pt; }
.statement table.st-head { margin-bottom: 2mm; border-top: 2px solid #000; }
.statement table.st-head .st-title { text-align: center; font-size: 17pt; font-weight: 700; letter-spacing: 2px; width: 45%; }
.statement table.st-head th { width: 10%; }
.statement table.st-table { table-layout: fixed; border-top: 2px solid #000; border-bottom: 2px solid #000; }
.statement table.st-table col.w6 { width: 6%; }
.statement table.st-table col.w8 { width: 8%; }
.statement table.st-table col.w11 { width: 11%; }
.statement table.st-table col.w13 { width: 13%; }
.statement table.st-table col.w17 { width: 17%; }
.statement table.st-table td { word-break: break-all; }
.statement table.st-table tbody { break-inside: avoid; page-break-inside: avoid; }
.statement .st-note { display: block; font-size: 7.5pt; }
.statement .st-foot { font-size: 8.5pt; margin: 2mm 0 0; }

/* 기부금영수증 발급합계표: 서식(2) 한 장, A4 세로 */
.sumform { width: 186mm; max-width: 100%; margin: 12px auto; padding: 8mm; background: #fff; color: #000; border: 1px solid var(--line); font-size: 10.5pt; line-height: 1.4; }
.sumform .rc-form { margin: 0 0 4mm; font-size: 8.5pt; }
.sumform .sf-title { text-align: center; font-size: 19pt; letter-spacing: 4px; margin: 2mm 0 5mm; }
.sumform table { width: 100%; border-collapse: collapse; }
.sumform th, .sumform td { border: 1px solid #555; padding: 1.5mm 2mm; vertical-align: middle; font-weight: 400; text-align: left; }
.sumform th { background: #f3f3f3; text-align: center; }
.sumform table.sf-period { width: 90mm; margin-bottom: 5mm; border: 2px solid #555; }
.sumform table.sf-period th { width: 32mm; text-align: left; background: none; }
.sumform col.w22 { width: 22%; }
.sumform col.w39 { width: 39%; }
.sumform .sf-label { display: block; font-size: 9pt; color: #333; }
.sumform .sf-types { display: flex; flex-wrap: wrap; gap: 1mm 4mm; margin-top: 1mm; }
.sumform .sf-check { white-space: nowrap; }
.sumform .sf-sec { margin: 5mm 0 1mm; font-weight: 700; display: flex; justify-content: space-between; }
.sumform .sf-unit { font-weight: 400; font-size: 9pt; }
.sumform table.sf-grid td.num { text-align: right; white-space: nowrap; }
.sumform .sf-text { margin: 6mm 0 3mm; text-indent: 1em; }
.sumform .sf-date { text-align: right; margin: 3mm 0; white-space: pre; }
.sumform .sf-sign { display: flex; justify-content: flex-end; align-items: center; gap: 6mm; margin: 4mm 0; }
.sumform .rc-name { min-width: 40mm; font-weight: 700; }
.sumform .rc-seal { font-size: 9pt; color: #333; }
.sumform .sf-to { font-size: 13pt; font-weight: 700; margin: 6mm 0 0; }
.sumform .sf-blank { display: inline-block; width: 40mm; border-bottom: 1px solid #000; margin-right: 2mm; }
@media (max-width: 640px) {
  .sumform { padding: 4mm; font-size: 9.5pt; }
  .statement { font-size: 8.5pt; }
}
@media print {
  .statement { margin: 0; }
  .statement thead { display: table-header-group; }
  .statement th, .sumform th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sumform { width: auto; margin: 0; padding: 0; border: 0; }
  .won-words { display: none; }
}
@media screen {
  /* 좁은 화면에서는 서식 표를 줄이지 않고 옆으로 밀어 본다 */
  .statement { overflow-x: auto; }
  .statement table.st-head, .statement table.st-table { min-width: 900px; }
}

/* ----- 7단계: 직인, 사본, 한 번에 인쇄, 발급 금액 입력 ----- */
/* 직인은 ‘(서명 또는 인)’ 글자 위에 겹쳐 찍는다(지름 약 25mm). 그림이 없으면 4단계의 점선 원 그대로. */
.rc-seal.stamp { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 18mm; height: 18mm; border: 1px dashed #999; border-radius: 50%; font-size: 9pt; color: #333; }
.rc-seal.stamp.has-seal { border-color: transparent; }
.rc-seal .seal-img, .st-seal {
  position: absolute; left: 50%; top: 50%; width: 25mm; height: 25mm; transform: translate(-50%, -50%);
  object-fit: contain; pointer-events: none;
}
/* 발급명세서: 서식에 서명·인 자리가 없어 머리의 단체명 칸 오른쪽에 겹쳐 찍는다. */
.statement td.st-org { position: relative; padding-right: 22mm; }
.statement .st-seal { left: auto; right: 1mm; width: 20mm; height: 20mm; transform: translateY(-50%); }
.statement table.st-head { overflow: visible; }
/* 사본 한 장 = A4 한 쪽(여백 10mm), 비율을 지켜 맞춘다. */
@page copy { size: A4 portrait; margin: 10mm; }
.copy-page {
  page: copy; width: 190mm; max-width: 100%; height: 277mm; margin: 12px auto; padding: 0; box-sizing: border-box;
  display: flex; align-items: center; justify-content: center; background: #fff; border: 1px solid var(--line);
}
.copy-page .copy-img { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 640px) { .copy-page { height: 140vw; } }
@media print {
  .copy-page { width: auto; height: 276mm; margin: 0; border: 0; }
  .bundle > section { break-after: page; page-break-after: always; }
  .bundle > section:last-child { break-after: auto; page-break-after: auto; }
  .rc-seal .seal-img, .st-seal { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 한 번에 인쇄 상자와 인쇄 전 확인 칸 */
.bundle-box { border: 2px solid var(--accent); background: #f7fafd; }
.bundle-box h2 { margin-top: 0; }
.bundle-box .checks { display: flex; flex-wrap: wrap; gap: 0 24px; }
.plan-box { border-color: var(--accent); background: #fff; }
.plan-box table.plan-table th { width: 7em; white-space: nowrap; background: var(--sub); text-align: left; }
.plan-box table.plan-table td { word-break: keep-all; overflow-wrap: anywhere; }
.confirm-box { max-width: 720px; }
.confirm-box .confirm-text p { margin: 0 0 6px; }
/* 발급 금액 입력 */
.manual-box { border: 2px solid var(--accent); max-width: 720px; }
.manual-box h2 { margin-top: 0; }
table.manual-lines select { min-width: 6em; }
table.manual-lines input { width: 11em; text-align: right; }
.manual-total { font-size: 1.15rem; }
.won-words.inline { display: inline; font-size: 0.9rem; }
.manual-note { color: var(--accent); }
.manual-note small { color: var(--muted); }
/* 설정: 직인·사본 */
.images-section { margin-top: 28px; border-top: 2px solid var(--line); padding-top: 8px; }
.seal-preview {
  display: inline-block; padding: 8px; border: 1px solid var(--line); border-radius: 6px;
  background-color: #fff;
  background-image: linear-gradient(45deg, #ddd 25%, transparent 25%), linear-gradient(-45deg, #ddd 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #ddd 75%), linear-gradient(-45deg, transparent 75%, #ddd 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.seal-preview canvas, .seal-preview img { display: block; max-width: min(300px, 100%); max-height: 300px; }
.seal-preview.small img { max-width: 120px; max-height: 120px; }
.seal-now { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.seal-now > div:last-child { flex: 1 1 260px; }
.copy-list { display: grid; gap: 12px; }
.copy-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
.copy-thumb { width: 120px; height: 160px; object-fit: contain; background: #f3f3f3; border: 1px solid var(--line); }
.copy-meta { flex: 1 1 240px; }
.copy-meta input[type="text"] { width: 100%; max-width: 420px; }
.manual-box .reason-err { color: var(--danger); margin: 4px 0 0; font-weight: 600; }
.manual-box .reason-err:empty { display: none; }
/* 25mm 직인이 18mm 자리보다 커서 오른쪽 끝을 넘지 않게 조금 띄운다. */
.rc-seal.stamp.has-seal { margin-right: 4mm; }

/* ----- 7-3: 주보 헌금자 명단 ----- */
.bulletin { max-width: 900px; line-height: 1.7; }
.bulletin p { margin: 0 0 12px; word-break: keep-all; overflow-wrap: anywhere; }
.copy-note { align-self: center; }
.copy-fallback { width: 100%; max-width: 900px; font-size: 16px; margin-top: 8px; }
@media print {
  .bulletin { max-width: none; line-height: 1.6; font-size: 11pt; }
  .bulletin p { margin: 0 0 3mm; break-inside: avoid; }
}
/* 11-18 오너: 긴 입력 화면에서도 ‘저장’ 단추가 늘 보이게 화면 아래에 붙인다 */
.sticky-actions { position: sticky; bottom: 0; background: var(--bg, #fff); padding: 10px 0; border-top: 1px solid var(--line); z-index: 5; }
@media print { .sticky-actions { position: static; } }
.family-edit li select { width: auto; min-width: 8em; display: inline-block; }
/* 7-5 주소 찾기(우편번호 칸 + 단추, 아래에 도로명·상세 주소, 검색 상자) */
.address-row { display: flex; gap: 8px; margin-bottom: 8px; }
.address-row input { flex: 0 0 8em; }
.address-row + input { margin-bottom: 8px; }
.postcode-box { border: 1px solid var(--line); border-radius: 8px; margin-top: 8px; overflow: hidden; }
.postcode-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 10px; background: var(--sub); }
.postcode-frame { height: 460px; position: relative; }
.settings-logo { height: 64px; width: auto; max-width: 160px; object-fit: contain; border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 4px; }
/* 7-5 헌금 기록·지출 입력의 입력 목록: 줄을 낮게, 단추는 작게 한 줄로, 입력자 이름은 줄바꿈 없이 */
.col-mid table.list.compact td { padding: 3px 6px; vertical-align: middle; line-height: 1.3; }
.col-mid table.list.compact td.row-btns { white-space: nowrap; }
.col-mid table.list.compact td.row-btns .small-btn { min-height: 28px; padding: 1px 8px; font-size: 0.88rem; }
.col-mid table.list.compact td.row-btns .small-btn + .small-btn { margin-left: 4px; }
/* 11-21 오너: 입력자와 수정·삭제 단추는 붙여 두고, 금액과 메모 사이는 조금 띄운다 */
.col-mid table.list.compact td.row-btns, .col-mid table.list.compact td.who-by { width: 1%; white-space: nowrap; }
.col-mid table.list.compact .memo-col { padding-left: 18px; }
.col-mid table.list.compact td.nowrap .tag { margin-left: 4px; }
td.who-by { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 7em; }
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin: 6px 0; }
.pager .small-btn { min-height: 30px; min-width: 34px; padding: 2px 8px; }
.perm-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(16em, 1fr)); gap: 2px 16px; }
/* 변경 기록: 언제·누가·종류는 한 줄로 */
.audit-list td:nth-child(2), .audit-list td:nth-child(3), .audit-list td:nth-child(4) { white-space: nowrap; }

/* ----- 7-7 교인 요람(미리보기·인쇄) ----- */
.directory .dir-cover { text-align: center; padding: 40px 0; border-bottom: 1px solid var(--line, #ccc); margin-bottom: 16px; }
.directory .dir-logo { max-width: 110px; max-height: 110px; }
.directory .dir-church { font-size: 1.5rem; font-weight: 700; margin: 8px 0 4px; }
.directory .dir-title { font-size: 1.8rem; margin: 24px 0; }
.directory table.dir-house { width: 100%; margin: 0 0 10px; break-inside: avoid; page-break-inside: avoid; }
.directory table.dir-house td, .directory table.dir-house th { text-align: center; }
.directory table.dir-house td.dir-addr { text-align: left; }
.directory .dir-section h3 { margin: 18px 0 8px; break-after: avoid; page-break-after: avoid; }
@media print {
  .directory .dir-cover { border: 0; min-height: 240mm; display: flex; flex-direction: column; justify-content: center; break-after: page; page-break-after: always; }
  .directory .dir-deceased { break-before: page; page-break-before: always; }
}
.recurring-box { margin-top: 18px; }
.recurring-form { margin-top: 10px; }

/* 11-18 년간월별집계표: 과목 이름이 두 줄로 꺾이지 않게, 12달이 한 화면에 들어오게 */
table.pivot.year { font-size: 0.86em; }
table.pivot.year th, table.pivot.year td { white-space: nowrap; padding-left: 6px; padding-right: 6px; }
/* 11-21 오너: 회계 이름 줄 아래 과목은 다섯 칸쯤 들여쓴다(위 줄의 좁은 여백이 .indent 를 덮고 있었다). 지출은 대분류 아래 한 층 더. */
table.pivot.year td.indent, table.pivot.year th.indent { padding-left: 2.5em; }
table.pivot.year td.indent2 { padding-left: 5em; }
@media print { table.pivot.year { font-size: 8pt; } }
/* 11-22 오너: 년간월별집계표 머리줄(과목·예산·합계·예산 대비·1~12월)은 셀 가운데 */
table.pivot.year thead th, table.pivot.year thead th.num { text-align: center; }
/* 11-22 오너: 맨 아래 합계 글자는 가운데 */
table.pivot.year tfoot tr.grand > th:first-child { text-align: center; }

/* 11-18 오너 ‘일반, 선교, 목적이 다르게’: 회계별 색. 이름 줄은 진하게, 과목 줄은 옅게, 소계는 중간 */
table.list tr.fund.fc-1 th, table.pivot th.fund-head.fc-1 { background: #cfe0f5; color: #12406e; }
table.list tr.fund.fc-2 th, table.pivot th.fund-head.fc-2 { background: #d3ecd5; color: #1d5a26; }
table.list tr.fund.fc-3 th, table.pivot th.fund-head.fc-3 { background: #f8e0c2; color: #7a4510; }
table.list tbody tr.fc-1 { background: #f3f8fe; }
table.list tbody tr.fc-2 { background: #f3faf3; }
table.list tbody tr.fc-3 { background: #fdf7ef; }
table.list tr.fund-sub.fc-1 th, table.pivot .fund-sub.fc-1 { background: #e2edfa; }
table.list tr.fund-sub.fc-2 th, table.pivot .fund-sub.fc-2 { background: #e3f3e4; }
table.list tr.fund-sub.fc-3 th, table.pivot .fund-sub.fc-3 { background: #fbecd9; }
table.list tr.group.fc-1 th { background: #eaf2fc; }
table.list tr.group.fc-2 th { background: #eaf6eb; }
table.list tr.group.fc-3 th { background: #fcf1e3; }
@media print {
  table.list tr[class*="fc-"] th, table.list tr[class*="fc-"] td, table.pivot th[class*="fc-"], table.pivot td[class*="fc-"] { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 7-9 관리자·사용자 */
.box.master-box { border-color: var(--accent); background: var(--row-alt); }
.box.user-row.off { color: var(--muted); background: var(--row-alt); }
.box.user-row.just-saved { border-color: var(--ok); box-shadow: 0 0 0 2px #cfe8d8; }
.box.user-row.editing { border-color: var(--accent); }
.user-meta { color: var(--muted); margin: 4px 0; }
.cands button:disabled { color: var(--muted); background: var(--row-alt); cursor: not-allowed; }

/* 11-21 주보 헌금자 명단 거르기 줄: 날짜 두 칸 한 줄, 고르는 칸 둘은 그 아래 한 줄 */
.filters.bulletin-filters { display: block; }
.bulletin-filters .bf-dates { display: flex; flex-wrap: wrap; gap: 12px; }
.bulletin-filters .bf-dates > * { flex: 0 1 200px; }
.bulletin-filters .bf-hint { margin: 4px 0 8px; }
.bulletin-filters .bf-checks { display: flex; flex-wrap: wrap; gap: 4px 28px; }
.bulletin-filters .bf-checks .check { min-height: 40px; }

/* 11-21 오너: 교회 이름 다음에 프로그램 이름 ‘파카드’ */
.brand-app { font-size: 0.85rem; font-weight: 600; opacity: 0.75; margin-right: 14px; padding: 2px 8px; border: 1px solid rgba(255,255,255,0.35); border-radius: 999px; white-space: nowrap; }
@media (max-width: 640px) { .brand-app { order: 1; margin-right: 0; font-size: 0.78rem; } }

/* ----- 8단계(11-21 오너): 재정 보고 PPT · 월별 재정 보고서 ----- */
.show-options h2 { margin-top: 0; }
.show-options h3 { margin: 12px 0 4px; font-size: 1rem; }
.show-checks { display: flex; flex-wrap: wrap; gap: 0 28px; }
.show-checks .check { min-height: 40px; }
.show-row { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 28px; }
.show-notes p { margin: 4px 0; }

/* 한 장 = 16:9. 글자 크기는 --pt(장 폭 960pt 기준, PPT 파일과 같은 비율)로 맞춘다. */
.slide-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin: 12px 0 24px; }
.slide-frame { container-type: inline-size; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #fff; color: #222; }
.slide-frame.thumb { border: 1px solid var(--line); border-radius: 4px; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.slide-frame.thumb:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.slide {
  --pt: calc(100cqw / 960);
  position: absolute; inset: 0; box-sizing: border-box;
  padding: calc(var(--pt) * 21.6) calc(var(--pt) * 43.2);
  font-family: "맑은 고딕", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  font-size: calc(var(--pt) * 28); line-height: 1.25;
}
.slide p { margin: 0; }
.slide .sl-title {
  margin: 0; height: calc(var(--pt) * 64.8); display: flex; align-items: center;
  font-size: calc(var(--pt) * 40); color: #1f3a5f; border-bottom: calc(var(--pt) * 3.6) solid #1f3a5f;
}
.slide .sl-table { width: 100%; border-collapse: collapse; margin-top: calc(var(--pt) * 16); table-layout: fixed; }
.slide .sl-table th, .slide .sl-table td {
  border: 1px solid #c8cdd3; height: calc(var(--pt) * 43.2); padding: 0 calc(var(--pt) * 4.3);
  text-align: left; vertical-align: middle; font-weight: 400;
}
.slide .sl-table thead th { background: #e8eef5; font-weight: 700; }
.slide .sl-table tr.strong td { background: #f1f3f5; font-weight: 700; }
.slide .sl-table .num { text-align: right; }
.slide .sl-table.big { margin-top: calc(var(--pt) * 34); font-size: calc(var(--pt) * 32); }
.slide .sl-table.big td { height: calc(var(--pt) * 68.4); }
.slide .sl-muted, .slide .sl-note { color: #666; }
.slide .sl-note { position: absolute; left: calc(var(--pt) * 43.2); bottom: calc(var(--pt) * 32); font-size: calc(var(--pt) * 18); }
.slide .sl-no { position: absolute; right: calc(var(--pt) * 29); bottom: calc(var(--pt) * 12); font-size: calc(var(--pt) * 16); color: #666; }
.slide .sl-cover, .slide .sl-closing { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: calc(var(--pt) * 10); }
.slide .sl-logo { max-width: calc(var(--pt) * 122); max-height: calc(var(--pt) * 122); margin-bottom: calc(var(--pt) * 10); }
.slide .sl-church { font-size: calc(var(--pt) * 44); font-weight: 700; color: #1f3a5f; }
.slide .sl-cover-title, .slide .sl-closing-text { font-size: calc(var(--pt) * 40); font-weight: 700; }
.slide .sl-closing-text { color: #1f3a5f; }
.slide .sl-sub { color: #666; }
.slide .sl-chart { display: block; width: 100%; height: auto; margin-top: calc(var(--pt) * 10); font-family: inherit; }

/* 화면 발표(전체 화면) */
.show-overlay { position: fixed; inset: 0; z-index: 1000; background: #000; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.show-stage { width: min(100vw, calc(100vh * 16 / 9)); }
.show-frame { width: 100%; }
.show-exit { position: absolute; top: 8px; right: 8px; opacity: 0.35; min-height: 36px; padding: 4px 12px; }
.show-exit:hover, .show-exit:focus { opacity: 1; }

/* 월별 재정 보고서: 화면에서도 A4 종이 모양. 인쇄하면 메뉴·단추·고르기 칸은 나오지 않는다. */
.paper {
  width: 186mm; max-width: 100%; box-sizing: border-box; margin: 16px auto; padding: 12mm 12mm 10mm; background: #fff; color: #000;
  border: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); font-size: 10.5pt; line-height: 1.4;
}
.paper-head { display: flex; align-items: center; gap: 5mm; border-bottom: 2px solid #000; padding-bottom: 3mm; margin-bottom: 4mm; }
.paper-logo { max-width: 20mm; max-height: 20mm; }
.paper-head p, .paper-head h2 { margin: 0; }
.paper-church { font-size: 13pt; font-weight: 700; }
.paper-title { font-size: 18pt; }
.paper-sub { color: #333; font-size: 9.5pt; }
.paper-sec { margin: 0 0 4mm; break-inside: avoid; page-break-inside: avoid; }
.paper-sec h3 { font-size: 11.5pt; margin: 0 0 1.5mm; }
.paper-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 0 6mm; align-items: start; }
.paper-table { width: 100%; border-collapse: collapse; }
.paper-table th, .paper-table td { border: 1px solid #888; padding: 1mm 2mm; text-align: left; font-weight: 400; vertical-align: top; }
.paper-table thead th { background: #eee; font-weight: 700; }
.paper-table .num { text-align: right; white-space: nowrap; }
.paper-table tr.fund th { background: #e4e9ef; font-weight: 700; }
.paper-table tr.group th { background: #f3f3f3; font-weight: 700; }
.paper-table tr.total th, .paper-table tr.total td { font-weight: 700; border-top: 2px solid #000; }
.paper-table .ind1 { padding-left: 5mm; }
.paper-table .ind2 { padding-left: 9mm; }
.paper-summary { width: auto; min-width: 90mm; }
.paper-summary th { background: #f3f3f3; width: 32mm; }
.paper-table + .paper-table { margin-top: 2mm; }
.paper-note { color: #333; font-size: 9pt; margin: 1mm 0 0; }
.paper-sign { display: flex; justify-content: flex-end; gap: 10mm; margin: 6mm 0 3mm; break-inside: avoid; page-break-inside: avoid; }
.sign-box { display: flex; align-items: flex-end; gap: 2mm; }
.sign-label { font-weight: 700; }
.sign-line { display: inline-block; width: 30mm; border-bottom: 1px solid #000; height: 8mm; }
.paper-closing { text-align: center; margin: 5mm 0 0; font-size: 11pt; }
@media (max-width: 640px) { .paper-cols { grid-template-columns: 1fr; } .paper { padding: 6mm; } }
@media print {
  .paper { width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; font-size: 10pt; }
  .paper-cols { grid-template-columns: 1fr 1fr; }
  .paper-table thead th, .paper-table tr.fund th, .paper-table tr.group th, .paper-summary th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .show-overlay { display: none !important; }
}

/* 11-21 모든 계정 요약: 인쇄할 때는 A4 너비에 맞게 칸 간격을 줄인다 */
@media print {
  table.list.fund-summary th, table.list.fund-summary td { padding: 6px 10px; }
  table.list.fund-summary .num { min-width: 0; }
}

/* 11-21 지출 목록: 고르기 칸과 날짜 한꺼번에 바꾸기 줄 */
.pick-cell { width: 28px; text-align: center; }
.bulk-bar { margin: 4px 0 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--sub); }
.bulk-bar p { margin: 0 0 4px; }
.bulk-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px 10px; align-items: end; }

/* 11-21 달 고르기(해·달 두 칸) */
.month-input { display: inline-flex; gap: 6px; }
.month-input select { width: auto; }

/* 교적 통계(11-21) */
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin: 12px 0 18px; }
.stat-tile { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: var(--row-alt); }
.stat-label { display: block; color: var(--muted); font-size: 0.9rem; }
.stat-value { display: block; font-size: 1.4rem; font-weight: 700; }
.stat-block { margin: 0 0 22px; }
.stat-block h2 { font-size: 1.15rem; margin: 0 0 6px; }
.stat-table td.num, .stat-table th.num { text-align: right; white-space: nowrap; }
.stat-table .bar-col { width: 40%; white-space: nowrap; }
.stat-table .bar { display: inline-block; vertical-align: middle; width: calc(100% - 4.5em); max-width: 260px; height: 0.8em; background: var(--sub); border-radius: 3px; overflow: hidden; }
.stat-table .bar-fill { display: block; height: 100%; background: var(--accent); }
.stat-table .bar-pct { display: inline-block; width: 4.2em; text-align: right; font-size: 0.9rem; color: var(--muted); }
@media print {
  .stat-tile { background: #fff; }
  .stat-table .bar-fill { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .stat-block { break-inside: avoid; page-break-inside: avoid; }
}

/* ----- 로그인 화면(11-21 오너: 그림을 넣어 고급스럽게) ----- */
.login-wrap {
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  max-width: 920px; margin: 48px auto; border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
  background: #fff; box-shadow: 0 18px 48px rgba(20, 35, 55, 0.16);
}
.login-art {
  position: relative; min-height: 540px; padding: 40px 34px; color: #fff;
  background: #16243a url("/img/login-art.svg") center bottom / cover no-repeat;
}
.login-art p { margin: 0; text-shadow: 0 1px 6px rgba(10, 20, 35, 0.45); }
.login-heb { font-family: "Times New Roman", "SBL Hebrew", "David", serif; font-size: 3.4rem; line-height: 1.1; text-align: left; letter-spacing: 1px; }
.login-name { margin-top: 6px !important; font-size: 1.6rem; font-weight: 700; letter-spacing: 6px; }
.login-mean { margin-top: 14px !important; font-size: 0.95rem; line-height: 1.7; color: #e8eef6; }
.login-form { padding: 56px 44px 44px; display: flex; flex-direction: column; justify-content: center; }
.login-form h1 { margin: 0 0 4px; font-size: 1.7rem; }
.login-form .form-grid { margin-top: 10px; }
.login-form .actions button { width: 100%; padding: 12px; font-size: 1.05rem; }
@media (max-width: 760px) {
  .login-wrap { grid-template-columns: 1fr; margin: 12px auto; border-radius: 12px; }
  .login-art { min-height: 260px; padding: 24px 22px; }
  .login-heb { font-size: 2.6rem; }
  .login-form { padding: 28px 22px 32px; }
}
/* 교인 통계 고르기·남녀 성비(11-21) */
.stat-filters { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: flex-end; }
.stat-checks { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 6px 0 4px; }
.age-range { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.age-range .age-in { width: 5.2em; }
.stat-sub { display: block; color: var(--accent); font-weight: 700; font-size: 0.95rem; }
.stat-notes p { margin: 2px 0; }
.stat-table .ratio-col { white-space: nowrap; }
.stat-table .ratio-bar { display: inline-flex; vertical-align: middle; width: 90px; height: 0.8em; border-radius: 3px; overflow: hidden; background: var(--sub); }
.stat-table .ratio-m { display: block; height: 100%; background: #3d6fa6; }
.stat-table .ratio-f { display: block; height: 100%; background: #c4607a; }
.stat-table .ratio-txt { margin-left: 8px; font-size: 0.88rem; color: var(--muted); }
@media print {
  .stat-table .ratio-m, .stat-table .ratio-f { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* 심방 기록(11-21: 가정 단위·칸 더하기·대심방 진행표·오래 못 간 가정·다음 예정) */
.tab-bar { flex-wrap: wrap; margin-bottom: 14px; }
.visit-family-list { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-bottom: 6px; }
.btn-small { padding: 4px 12px; font-size: 0.9rem; }
.visit-item .small { margin-top: 2px; }
tr.visit-todo td { background: #fff7e6; }
.todo-mark { color: var(--danger); font-weight: 700; }
table.visit-ledger { font-size: 10pt; }
table.visit-ledger td { vertical-align: top; }
@media print {
  tr.visit-todo td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
/* 로그인 화면의 교단 마크·교회 이름(11-22 오너) */
.login-brand { display: flex; align-items: center; gap: 14px; margin-bottom: 22px; }
.login-brand:empty { display: none; }
.login-logo { width: 56px; height: 56px; object-fit: contain; }
.login-church { margin: 0; font-size: 1.45rem; font-weight: 700; letter-spacing: 1px; }
.login-denom { margin: 0 0 2px; font-size: 0.9rem; color: var(--muted); }
.login-names { display: inline-flex; flex-direction: column; }
.login-names .login-denom, .login-names .login-church { display: flex; justify-content: space-between; letter-spacing: 0; }

/* ---------------------------------------------------------------- 11-26 주보
   인쇄물: A4 가로 두 장(297×210mm), 장마다 두 면(접으면 4면). 면 안의 크기는 거의 em 이라
   면마다 --k(1 → 0.72)를 바꾸면 글자와 줄 높이가 함께 준다(bulletin.js fitSheets). */
@page bulletin { size: A4 landscape; margin: 0; }
.bl-doc-wrap { overflow-x: auto; }
.bl-doc { font-family: "Malgun Gothic", "맑은 고딕", sans-serif; color: #000; line-height: 1.25; word-break: keep-all; overflow-wrap: normal; line-break: strict; }
/* 한글은 기본으로 글자 사이에서도 줄이 바뀐다. 이름·낱말이 갈라지지 않게 띄어쓰기에서만 바꾼다(11-26 검토). */
.bl-sheet { page: bulletin; position: relative; width: 297mm; height: 210mm; overflow: hidden; background: #fff;
  margin: 0 auto 8mm; box-shadow: 0 1px 6px rgba(0, 0, 0, .25); }
.bl-panel { position: absolute; top: 8mm; height: 194mm; width: 131.5mm; overflow: hidden; --k: 1; font-size: calc(11pt * var(--k)); }
.bl-panel.left { left: 9.5mm; }
.bl-panel.right { left: 156.5mm; }
.bl-fit { min-height: 100%; display: flex; flex-direction: column; }
.bl-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bl-doc p, .bl-doc h2, .bl-doc h3 { margin: 0; }
.bl-spread { display: flex; justify-content: space-between; width: 100%; }
.bl-doc .bold { font-weight: 700; }

.bl-doc .bl-title { color: #1414c8; font-weight: 700; font-size: 1.42em; text-align: center; margin: .15em 0 .55em; letter-spacing: .04em; white-space: nowrap; line-height: 1.25; }
.bl-tlabel { font-size: .72em; letter-spacing: 0; }
.bl-order { border-top: 1.2pt solid #000; border-bottom: 1.2pt solid #000; }
.bl-ohead { display: flex; justify-content: space-between; align-items: center; height: 2.05em; padding: 0 .8em 0 1em; border-bottom: 1pt solid #000; white-space: nowrap; }
.bl-orow { display: grid; height: 1.85em; border-bottom: .6pt dotted #666; }
.bl-orow:last-child { border-bottom: 0; }
.bl-orow > div { display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.bl-order3 .bl-orow { grid-template-columns: 21.7% 57.8% 20.5%; }
.bl-order2 .bl-orow { grid-template-columns: 36% 64%; }
.bl-olabel { background: #fff2cc; padding: 0 .8em 0 .6em; }
.bl-ocontent { justify-content: center; }
.bl-oby, .bl-ovalue { justify-content: flex-end; padding-right: .6em; }
.bl-doc .bl-subtitle { font-weight: 700; font-size: 1.3em; text-align: center; margin: 1.6em 0 .45em; letter-spacing: .04em; }
.bl-serve { margin: 0 .1em 0 .5em; border-bottom: 1pt solid #000; }
.bl-srow { display: grid; grid-template-columns: 21.3% 29% 24.8% 24.9%; height: 1.95em; border-bottom: .6pt dotted #666; }
.bl-srow:last-child { border-bottom: 0; }
.bl-srow > div { display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.bl-shead { grid-column: span 2; background: #d9d9d9; padding: 0 2.4em; }
.bl-slabel { background: #d9d9d9; padding: 0 .7em; }
.bl-sright { border-left: 1pt solid #000; }
.bl-svalue { justify-content: center; }

.bl-two { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2.6mm; }
.bl-doc .bl-gtitle { margin: 2em .2em 0 .5em; padding-bottom: .55em; border-bottom: 1pt solid #000; }
.bl-gifts { font-size: .92em; line-height: 1.37; margin: .9em 0 .6em .4em; }
.bl-grow { display: grid; grid-template-columns: 1.4em 3.7em 1fr; column-gap: .6em; }
.bl-gnames { word-spacing: .2em; }
.bl-online { margin: auto .2em 1mm .5em; border-top: 1pt solid #000; border-bottom: 1pt solid #000; padding: .45em 1em .5em; }
.bl-doc .bl-otitle { text-align: center; margin-bottom: .3em; }
.bl-accounts { display: grid; grid-template-columns: 1fr 1fr; row-gap: .25em; column-gap: 1em; }

.bl-band { display: flex; align-items: center; justify-content: center; background: #e3e3e3; border-top: 1.2pt solid #000; border-bottom: 1pt solid #000;
  font-size: 1.3em; font-weight: 700; height: 1.66em; white-space: nowrap; }
.bl-band .bl-spread { width: 5.3em; }
.bl-band.blue { color: #1414c8; margin-top: 1.5mm; }
.bl-band.small { font-size: 1.25em; height: 1.55em; }
.bl-band.small .bl-spread { width: 5em; }
.bl-news { font-family: "Batang", "바탕", serif; font-size: .98em; line-height: 1.73; padding: .35em 0 0 .6em; margin-bottom: 1.2em; }
.bl-nline { white-space: pre-wrap; }
.bl-nline.bl-num { padding-left: 1.25em; text-indent: -1.25em; }
.bl-nblank { height: .5em; }
.bl-month { margin-bottom: .5em; }
.bl-mrow { display: grid; grid-template-columns: 23.6% 26.9% 23.2% 26.3%; height: 2.1em; border-bottom: .8pt solid #000; }
.bl-mrow > div { display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.bl-mlabel { padding-left: .9em; }
.bl-mvalue { justify-content: center; border-left: .6pt solid #000; }
.bl-mvalue:not(.last) { border-right: .6pt solid #000; }
.bl-mempty { grid-column: span 2; }
.bl-bottom2 { display: grid; grid-template-columns: 1fr 1fr; column-gap: 4.6mm; margin: auto 0 1.4mm .4mm; }
.bl-ptable { border-bottom: 1pt solid #000; }
.bl-prow { display: grid; grid-template-columns: 49% 51%; height: 1.85em; border-bottom: .6pt dotted #666; }
.bl-prow:last-child { border-bottom: 0; }
.bl-prow > div { display: flex; align-items: center; white-space: nowrap; overflow: hidden; }
.bl-plabel { padding: 0 .5em 0 .3em; border-right: .6pt solid #999; }
.bl-pvalue { padding-left: 1.5em; }
.bl-ptable.money .bl-pvalue { justify-content: flex-end; padding: 0 .8em 0 0; }

.bl-ctop { display: flex; justify-content: space-between; align-items: center; height: 8.6mm; margin-top: 1.9mm; padding: 0 2.5mm 0 4mm;
  border-top: 2pt solid #1f3864; border-bottom: .8pt solid #999; white-space: pre; }
.bl-doc .bl-cmtitle { text-align: center; margin-top: 3.2mm; font-size: 1.05em; }
.bl-doc .bl-cmotto { text-align: center; margin-top: 1.6mm; font-size: 1.1em; font-weight: 700; }
.bl-cname { display: flex; align-items: center; justify-content: center; gap: 4.5mm; margin-top: 2.6mm; }
.bl-clogo { width: 14.7mm; height: 19.3mm; object-fit: contain; }
.bl-cnames { text-align: center; color: #1a2fc0; font-weight: 700; }
.bl-cdenom { font-size: 1.33em; letter-spacing: .12em; }
.bl-cchurch { font-size: 2.75em; line-height: 1.15; }
.bl-cchurch .bl-spread { width: 5.4em; }
.bl-doc .bl-csite { text-align: center; text-decoration: underline; color: #3a2a7a; margin-top: .6mm; font-size: .95em; }
.bl-cphoto { width: 98.7mm; height: 74mm; margin: 5mm auto 0; }
.bl-cphoto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bl-cline { border-top: .8pt solid #aaa; margin-top: 5.7mm; }
.bl-doc .bl-cpastor { text-align: center; font-weight: 700; font-size: 1.2em; margin-top: 2.3mm; white-space: pre; }
.bl-cptitle { letter-spacing: .15em; margin-right: 1.6em; }
.bl-cpname { letter-spacing: .5em; }
.bl-cstaff { margin-top: 1.6mm; line-height: 1.45; }
.bl-cstrow { display: grid; grid-template-columns: 7.6em 1fr; column-gap: 3em; margin-left: 3.8em; }
.bl-doc .bl-caddr { text-align: center; margin-top: auto; }
.bl-doc .bl-cphone { text-align: center; padding: .25em 0 .3em; border-bottom: 2pt solid #1f3864; margin-bottom: .3mm; }

@media print {
  body.bl-printing .page { padding: 0; max-width: none; }
  body.bl-printing .msg { display: none; }
  .bl-sheet { margin: 0; box-shadow: none; break-after: page; page-break-after: always; }
  .bl-sheet:last-child { break-after: auto; page-break-after: auto; }
}

/* 고치기 화면 */
.bl-toolbar h1 { margin-bottom: 4px; }
.bl-ed-top { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; position: sticky; top: 0; z-index: 5; background: #fff; padding: 8px 0; border-bottom: 1px solid #ddd; }
.bl-ed-top h1 { margin: 0 12px 0 0; }
.bl-ed-top .actions { margin: 0; }
.bl-status { align-self: center; }
.bl-ed-field { display: flex; flex-direction: column; gap: 2px; }
.bl-ed-field label { font-size: 15px; color: #444; }
.bl-ed-sec { border: 1px solid #cfd6e0; border-radius: 6px; padding: 10px 14px 14px; margin: 16px 0; }
.bl-ed-sec h2 { font-size: 20px; margin: 0 0 8px; }
.bl-ed-sec h3 { font-size: 17px; margin: 10px 0 4px; }
.bl-ed-inline { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0; }
.bl-ed-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.bl-ed-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0; padding: 2px; border-radius: 4px; }
.bl-ed-row.special { background: #fff1d6; }
.bl-ed-row input[type=text], .bl-ed-row textarea, .bl-ed-title input[type=text], .bl-ed-field input { font-size: 18px; padding: 6px 8px; }
.bl-in-name { width: 9em; }
.bl-in-content { flex: 1 1 12em; min-width: 8em; }
.bl-in-by { width: 9em; }
.bl-in-wide { flex: 1 1 16em; min-width: 10em; }
.bl-in-money { width: 10em; text-align: right; }
.bl-in-title { width: 14em; font-weight: 700; }
.bl-in-label { width: 13em; }
.bl-in-group { width: 7em; }
.bl-in-no { width: 7em; }
.bl-in-news { width: 100%; font-size: 18px; line-height: 1.6; font-family: inherit; }
.bl-ed-row textarea { flex: 1 1 20em; min-height: 2.4em; }
.bl-ed-title { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 6px; }
.bl-ed-label, .bl-dev, .bl-title-changed { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.bl-title-changed[hidden] { display: none; }
.bl-once { font-size: 15px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.bl-ed-btns { display: inline-flex; gap: 3px; }
.bl-ed-add { margin-top: 6px; }
.bl-ed-add select { font-size: 17px; padding: 5px; }
.bl-ed-fill { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; }
.bl-ed-photo { display: flex; gap: 12px; align-items: flex-end; }
.bl-ed-photo img { max-height: 180px; max-width: 260px; border: 1px solid #ccc; }
.bl-ed-photo .bl-ed-logo { max-height: 70px; }
.bl-ed-end { margin-top: 20px; justify-content: space-between; }
.bl-probe { position: absolute; left: -99999px; top: 0; }
.danger-plain { color: #b00020; }
@media (max-width: 700px) { .bl-ed-cols { grid-template-columns: 1fr; } .bl-in-name, .bl-in-by { width: 7em; } }
/* 고치기 화면의 칸 너비(위의 공통 input 규칙 width:100% 를 이 화면에서만 덮는다) */
.bl-ed-sec input[type=text], .bl-ed-top input { width: auto; }
.bl-ed-sec .bl-in-name { width: 9em; }
.bl-ed-sec .bl-in-content { flex: 1 1 12em; width: auto; min-width: 8em; }
.bl-ed-sec .bl-in-by { width: 9em; }
.bl-ed-sec .bl-in-wide { flex: 1 1 16em; min-width: 10em; }
.bl-ed-sec .bl-in-money { width: 10em; }
.bl-ed-sec .bl-in-title { width: 14em; }
.bl-ed-sec .bl-in-label { width: 16em; }
.bl-ed-sec .bl-ed-add select { width: auto; }
.bl-ed-sec .bl-in-group { width: 7em; }
.bl-ed-top .bl-in-no { width: 7em; }
.bl-ed-sec .bl-ed-row textarea { width: auto; min-height: 2.6em; }
.bl-ed-sec .bl-in-news { width: 100%; min-height: 16em; }
@media (max-width: 700px) { .bl-ed-sec .bl-in-name, .bl-ed-sec .bl-in-by { width: 7em; } }
/* 11-26 ‘왔다갔다’ 고침: 저장 상태 글자 길이가 바뀌어도 위 막대 높이가 그대로이게(줄바꿈 없음, 너비 고정),
   알림은 흐름 밖(화면 아래 고정)에 띄워 칸이 밀리지 않게 */
.bl-ed-top .bl-status { display: inline-block; width: 15em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bl-toast { position: fixed; right: 16px; bottom: 16px; z-index: 20; max-width: min(460px, calc(100vw - 32px)); display: flex; flex-direction: column; gap: 6px; }
.bl-toast .msg { margin: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }

/* ---- 11-26 디자인2(오너 ‘내가 만든 프레임은 유지하고 색상 폰트 등은 아주 고급스럽게’)
   자리·크기·차례는 위 규칙 그대로 두고, 색·글꼴·선만 바꾼다.
   글꼴은 이 컴퓨터에 깔린 것만 이름으로 부른다(내려받기 없음): 제목·교회 이름은 Noto Serif KR → 한컴바탕 → 바탕, 본문은 맑은 고딕.
   강조색은 짙은 남색 하나(제목·굵은 선). 안쪽 줄은 가는 점선, 표마다 위·아래만 가는 실선. 흑백 인쇄에서도 또렷하게. */
.bl-doc {
  --bl-ink: #000; --bl-sub: #000; --bl-accent: #1f3a5f; --bl-dot: #9a9a9a; --bl-rule: #2b3d55;
  --bl-cream: #fbf8ef; --bl-mist: #f2f1ed;
  --bl-serif: "Noto Serif KR", "NotoSerifKR", "HANBatang", "한컴바탕", "Batang", "바탕", serif;
  color: var(--bl-ink);
}
.bl-doc .bl-title, .bl-doc .bl-subtitle, .bl-band, .bl-cnames, .bl-cpastor, .bl-cmotto, .bl-cmtitle { font-family: var(--bl-serif); }
.bl-doc .bl-title { color: var(--bl-accent); font-weight: 600; letter-spacing: .06em; }
.bl-doc .bl-title.spaced .bl-tmain { letter-spacing: .5em; margin-right: -.5em; }
.bl-tlabel { font-weight: 500; color: var(--bl-accent); }
.bl-doc .bl-subtitle { color: var(--bl-accent); font-weight: 600; letter-spacing: .12em; }

/* 순서표: 위·아래 가는 실선, 안쪽 줄은 머리카락 점선 */
.bl-order { border-top: .75pt solid var(--bl-rule); border-bottom: .75pt solid var(--bl-rule); }
.bl-ohead { border-bottom: .5pt solid var(--bl-rule); color: var(--bl-sub); letter-spacing: .06em; font-size: .95em; }
.bl-orow, .bl-srow, .bl-prow { border-bottom: .5px dotted var(--bl-dot); }
.bl-orow:last-child, .bl-srow:last-child, .bl-prow:last-child { border-bottom: 0; }
.bl-olabel { background: var(--bl-cream); color: var(--bl-ink); }
.bl-oby { color: var(--bl-sub); }
.bl-doc .bold { font-weight: 700; color: #000; }

/* 예배 및 봉사: 가운데 세로선 하나만(원본과 같이), 칸 바탕은 아주 옅게 */
.bl-serve { border-top: .75pt solid var(--bl-rule); border-bottom: .75pt solid var(--bl-rule); }
.bl-shead, .bl-slabel { background: var(--bl-mist); }
.bl-sright { border-left: .5pt solid var(--bl-rule); }

/* 향기로운 예물·온라인 헌금 */
.bl-doc .bl-gtitle { border-bottom: .75pt solid var(--bl-rule); }
.bl-gmark { color: var(--bl-accent); }
.bl-gtype { color: var(--bl-accent); font-weight: 600; }
.bl-online { border-top: .75pt solid var(--bl-rule); border-bottom: .75pt solid var(--bl-rule); }
.bl-doc .bl-otitle { color: var(--bl-sub); letter-spacing: .04em; }

/* 띠 제목: 옅은 바탕, 위는 남색 실선, 아래는 가는 실선 */
.bl-band { background: var(--bl-mist); border-top: .9pt solid var(--bl-rule); border-bottom: .5pt solid var(--bl-rule); color: var(--bl-accent); font-weight: 600; }
.bl-band.blue { color: var(--bl-accent); }
.bl-news { font-family: var(--bl-serif); color: var(--bl-ink); }
.bl-mrow { border-bottom: .5px dotted var(--bl-dot); }
.bl-mrow:last-child { border-bottom: .75pt solid var(--bl-rule); }
.bl-mvalue { border-left: .5px solid #c4c4c4; }
.bl-mvalue:not(.last) { border-right: .5px solid #c4c4c4; }
.bl-ptable { border-bottom: .75pt solid var(--bl-rule); }
.bl-plabel { border-right: .5px solid #c4c4c4; }
.bl-prow.total { font-weight: 700; }
.bl-prow.total .bl-pvalue { color: var(--bl-accent); }

/* 표지 */
.bl-ctop { border-top: 1.4pt solid var(--bl-accent); border-bottom: .5pt solid #b8b8b8; color: var(--bl-sub); letter-spacing: .04em; }
.bl-doc .bl-cmtitle { color: var(--bl-sub); letter-spacing: .1em; }
.bl-doc .bl-cmotto { color: var(--bl-ink); font-weight: 600; }
.bl-cnames { color: var(--bl-accent); }
.bl-cdenom { font-weight: 600; }
.bl-cchurch { font-weight: 700; }
.bl-doc .bl-csite { color: var(--bl-sub); text-decoration-thickness: .5px; text-underline-offset: 2px; }
.bl-cline { border-top: .5pt solid #b8b8b8; }
.bl-doc .bl-cpastor { color: var(--bl-ink); font-weight: 600; }
.bl-csrole { color: var(--bl-sub); }
.bl-doc .bl-caddr { color: var(--bl-sub); }
.bl-doc .bl-cphone { color: var(--bl-sub); border-bottom: 1.4pt solid var(--bl-accent); }

/* ---- 11-26 디자인3: 주보 색(테마). 디자인2 의 자리·글꼴·점선은 그대로, 색 변수만 바꾼다.
   --bl-accent  제목·굵은 선(짙은 색이라 흑백 인쇄에서도 검정에 가깝게 또렷하다)
   --bl-accent2 둘째 강조색, 아껴 쓴다(◎ 표, 표지 맨 위·맨 아래 선, 절기 이름)
   --bl-cream / --bl-mist 이름 칸 바탕(아주 옅게, 흑백에서는 거의 흰색) */
.bl-doc, .bl-doc * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.bl-doc { --bl-accent2: var(--bl-accent); }
.bl-doc.theme-autumn    { --bl-accent: #6b2737; --bl-rule: #5a2a31; --bl-accent2: #7a4a1e; --bl-cream: #faf3e8; --bl-mist: #f4eee5; --bl-sub: #000; --bl-dot: #a39888; }
.bl-doc.theme-christmas { --bl-accent: #1f4d3a; --bl-rule: #1f4d3a; --bl-accent2: #8b1e2d; --bl-cream: #f5f8f3; --bl-mist: #eef3ed; --bl-sub: #000; --bl-dot: #97a19a; }
.bl-doc.theme-spring    { --bl-accent: #5b3f66; --bl-rule: #4f3a59; --bl-accent2: #4f6b3a; --bl-cream: #fbf6f6; --bl-mist: #f4eff3; --bl-sub: #000; --bl-dot: #a59ca8; }
.bl-doc.theme-summer    { --bl-accent: #1d4f63; --bl-rule: #1d4f63; --bl-accent2: #2f6f73; --bl-cream: #f3f8f8; --bl-mist: #ecf2f3; --bl-sub: #000; --bl-dot: #93a3a5; }
.bl-doc.theme-winter    { --bl-accent: #2c3e50; --bl-rule: #2c3e50; --bl-accent2: #6b7a8a; --bl-cream: #f6f7f9; --bl-mist: #eff1f4; --bl-sub: #000; --bl-dot: #9aa0a7; }
/* theme-basic 은 디자인2 의 남색 그대로 */
.bl-gmark, .bl-tlabel { color: var(--bl-accent2); }
.bl-ctop { border-top-color: var(--bl-accent2); }
.bl-doc .bl-cphone { border-bottom-color: var(--bl-accent2); }
/* 11-26 오너 「주보 글자는 회색이 아니라 검정(가독성)」: 본문·보조 글자는 모두 #000, 제목 색만 테마 */
.bl-print-note { font-weight: 700; color: #8a4b00; margin: 4px 0; }
.bl-ed-theme { align-items: flex-end; }
.bl-ed-theme select { width: auto; min-width: 12em; font-size: 18px; }
/* 11-26 표지 사진 맞춤: 기본은 틀 안에 전체가 보이게(가운데, 자르지도 늘이지도 않음), .fill 이면 꽉 채움(가로 사진용) */
.bl-cphoto { display: flex; align-items: center; justify-content: center; }
.bl-cphoto img { object-fit: contain; }
.bl-cphoto.fill img { object-fit: cover; }

/* 11-26 오너 「오전예배·예배 및 봉사 ↔ 우측 온라인 헌금 계좌, 하단을 동일하게」: 두 면의 마지막 칸을 면 맨 아래에 붙여 아래 선을 맞춘다 */
/* 11-26 두 번째: 빈 간격으로 맞추지 말고(「오전예배와 예배 및 봉사 간격이 너무 넓다」) 순서 표의 줄을 고르게 늘려 아래를 채운다 */
.bl-panel.left .bl-fit > .bl-order:has(~ .bl-serve) { flex: 1 0 auto; display: flex; flex-direction: column; }
.bl-panel.left .bl-fit > .bl-order:has(~ .bl-serve) > .bl-orow { flex: 1 0 auto; align-items: stretch; }
.bl-panel.left .bl-fit > .bl-order:has(~ .bl-serve) > .bl-orow > * { display: flex; align-items: center; }
.bl-fit > .bl-online { margin-top: auto; }
.bl-fit > .bl-serve:last-child, .bl-fit > .bl-online:last-child { margin-bottom: 0; }

/* 11-26 오너 「예배 제목에 문양을 넣어 변화를, 고급스럽고 깔끔하게」: 제목 양옆에 가는 선이 안쪽으로 짙어지다가
   작은 마름모로 끝나는 장식. 색은 테마의 둘째 강조색(mask라 계절 색을 그대로 따른다). */
.bl-doc h2.bl-title { display: flex; align-items: center; justify-content: center; gap: .55em; }
.bl-doc h2.bl-title::before, .bl-doc h2.bl-title::after {
  content: ""; flex: 0 1 3.4em; min-width: 1.4em; height: .62em; background: var(--bl-accent2);
  /* CSP(img-src 'self') 때문에 data: 주소는 막힌다 → 같은 서버의 파일 */
  -webkit-mask: url("/img/bl-orn.svg") center / 100% 100% no-repeat; mask: url("/img/bl-orn.svg") center / 100% 100% no-repeat;
}
.bl-doc h2.bl-title::after { transform: scaleX(-1); }
.bl-doc h2.bl-title .bl-tmain { flex: none; }
/* 좁은 두 칸(오후·수요)에서는 장식이 줄어들고 간격도 좁다 — 제목 글자가 잘리지 않게 */
.bl-two h2.bl-title { gap: .35em; }

/* 11-26 오너 표지: 홈페이지 주소는 밑줄·점선 없이 「상광교회」 아래 가운데. 그림은 하나만(흐린 바탕 그림은 뺐다) */
.bl-doc .bl-csite, .bl-doc .bl-cnames .bl-csite { text-decoration: none !important; border: 0 !important; margin: .6mm 0 0; text-align: center; letter-spacing: .03em;
  font-family: "Malgun Gothic", "맑은 고딕", sans-serif; font-weight: 400; font-size: .9em; color: var(--bl-ink); }
.bl-doc .bl-cphoto { width: 122mm; height: 80mm; margin-top: 3mm; }
.bl-cphoto .bl-cphoto-main { width: 100%; height: 100%; object-fit: fill; display: block; margin: 0 auto; }
.bl-cphoto.fill .bl-cphoto-main { object-fit: cover; }