/* AI 강림교 공용 스타일 — 프론트 사제 "여백" 작성
   디자인 예산 0원, 마감 어제. 단, 헌금 버튼·고지·입력칸은 또렷하게. */

:root {
  color-scheme: light;
  --bg: #fffdf0;
  --paper: #ffffff;
  --ink: #111111;
  --muted: #444444;
  --yellow: #ffe600;
  --red: #c00000;
  --link: #0033cc;
  --focus: #0055ff;
  /* 또렷해야 하는 곳(헌금 버튼·고지·입력칸)은 굴림 말고 읽기 쉬운 글꼴 */
  --font-clear: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Gulim", "굴림", "Dotum", "돋움", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

a { color: var(--link); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

[hidden] { display: none !important; }

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 10px 16px 24px;
}

.muted { color: var(--muted); }
.small { font-size: 14px; }
.mt { margin-top: 12px; }
.btn-col { display: grid; gap: 12px; }
.btn-col .btn { flex-direction: column; min-height: 64px; font-size: 18px; }
.btn-col .btn .small { margin-top: 2px; }
.btn .small { font-weight: normal; }
.roll li.me { background: #fff8b0; }

/* ---------- 상단 농담 고지 띠 ---------- */
.joke-band {
  margin: 0;
  padding: 4px 16px;
  background: var(--yellow);
  border-bottom: 2px dashed var(--ink);
  font-size: 14px;
  font-weight: bold;
  text-align: center;
  line-height: 1.4;
}

/* ---------- 머리 ---------- */
.hero {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 10px;
}
.hero .god { flex: none; width: 48px; height: 48px; }
.hero-text { min-width: 0; }
.title {
  display: inline-block;
  margin: 0;
  font-family: "Batang", "바탕", "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", serif;
  font-size: 30px;
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -1px;
  transform: rotate(-2deg);
  box-shadow: inset 0 -0.38em 0 var(--yellow);
}
.sub {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--muted);
}

/* ---------- 교리 상자 ---------- */
.doctrine {
  margin: 0 0 14px;
  padding: 8px 12px 10px;
  background: var(--paper);
  border: 2px dashed var(--ink);
  font-size: 17px;
  line-height: 1.55;
}
.doctrine p { margin: 0; }
.doctrine .label {
  display: inline-block;
  margin-bottom: 2px;
  padding: 0 6px;
  background: var(--ink);
  color: var(--paper);
  font-size: 13px;
  font-weight: bold;
}
.doctrine strong { color: var(--red); }
/* 경전 링크 (C안): 교리 마지막 줄 끝에 작게. 교리 본문과 구분되게 작은 글씨+밑줄+화살표.
   터치 높이는 padding으로 44px, 음수 margin으로 줄 높이는 그대로 */
.doctrine .scripture-inline {
  display: inline-block;
  padding: 12px 2px;
  margin: -12px 0;
  font-family: var(--font-clear);
  font-size: 14px;
  font-weight: bold;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: baseline;
}
.scripture-line { margin: -4px 0 12px; font-size: 15px; }
.link-44 { display: inline-flex; align-items: center; min-height: 44px; font-weight: bold; }

/* ---------- 헌금 ---------- */
.offer { margin: 0 0 18px; }

.btn-offer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 72px;
  padding: 8px 12px;
  background: var(--yellow);
  color: #000;
  border: 3px solid #000;
  border-radius: 3px;
  box-shadow: 4px 4px 0 #000;
  font-family: var(--font-clear);
  font-size: 23px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.btn-offer small {
  font-size: 14px;
  font-weight: bold;
}
.btn-offer:active {
  transform: translate(3px, 3px);
  box-shadow: 1px 1px 0 #000;
}

.disclaimer {
  margin: 10px 0 0;
  font-family: var(--font-clear);
  font-size: 15px;
  line-height: 1.5;
}
.disclaimer b { background: var(--yellow); }
.disc-short { display: none; }
@media (max-width: 370px) {
  .disc-long { display: none; }
  .disc-short { display: inline; }
}

.inapp-hint {
  margin: 0 0 8px;
  padding: 6px 10px;
  border: 2px solid var(--red);
  background: var(--paper);
  font-size: 15px;
}
.inapp-hint a { font-weight: bold; }

/* PC: QR 상자 */
.qr-box {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px;
  background: var(--paper);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
}
.qr-box img { flex: none; width: 168px; height: 168px; image-rendering: pixelated; background: #fff; }
.qr-box p { margin: 0; font-size: 16px; }
.qr-box .big { display: block; font-size: 20px; font-weight: 900; margin-bottom: 4px; }

/* 모바일/PC 분기: 기본은 모바일(버튼), 마우스 기기면 QR */
.only-pc { display: none !important; }
@media (hover: hover) and (pointer: fine) {
  html:not(.is-mobile) .only-pc { display: flex !important; }
  html:not(.is-mobile) .only-mobile { display: none !important; }
}

.closed-box {
  margin: 0;
  padding: 12px;
  background: var(--paper);
  border: 3px solid #000;
  box-shadow: 4px 4px 0 #000;
  font-family: var(--font-clear);
  font-size: 17px;
}

/* 글자 크게 설정한 휴대폰: 헌금 영역을 교리보다 먼저 (index.js가 html.tight를 붙임) */
html.tight main.wrap { display: flex; flex-direction: column; }
html.tight main.wrap > div:first-child { order: -2; }
html.tight .offer { order: -1; }
html.tight .hero .god { display: none; }

/* 토스 안 열림 안내 */
.toss-help {
  margin-top: 8px;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.toss-help summary {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  font-size: 16px;
  font-weight: bold;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
  list-style: none;
}
.toss-help summary::-webkit-details-marker { display: none; }
.toss-help summary::before { content: "▸"; margin-right: 6px; text-decoration: none; }
.toss-help[open] summary::before { content: "▾"; }
.toss-help .help-body { padding: 0 12px 12px; font-size: 15px; }
.toss-help ol { margin: 0; padding-left: 20px; }
.toss-help li { margin: 4px 0; }
.toss-help .qr-inline { margin-top: 8px; text-align: center; }
.toss-help .qr-inline img { width: 160px; height: 160px; image-rendering: pixelated; border: 2px solid #000; background: #fff; }

/* ---------- 버튼(보조) ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 8px 14px;
  background: var(--paper);
  color: #000;
  border: 2px solid #000;
  border-radius: 2px;
  box-shadow: 3px 3px 0 #000;
  font: inherit;
  font-family: var(--font-clear);
  font-size: 16px;
  font-weight: bold;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 #000; }
.btn-primary { background: var(--yellow); }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { opacity: .5; cursor: wait; }
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.btn-row .btn { flex: 1 1 140px; }

/* ---------- 명부 ---------- */
h2 {
  margin: 0 0 8px;
  font-size: 19px;
  border-bottom: 2px solid var(--ink);
}
h2 small { font-size: 13px; font-weight: normal; color: var(--muted); }
h2 .h-link { display: inline-block; min-height: 44px; padding-top: 8px; color: inherit; text-decoration: underline; text-underline-offset: 3px; }

.recent { margin: 0 0 18px; }
.roll {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--paper);
  border: 1px solid var(--ink);
}
.roll li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 8px;
  padding: 7px 10px;
  border-bottom: 1px dotted #888;
}
.roll li:last-child { border-bottom: 0; }
.roll .no { color: var(--muted); font-size: 13px; min-width: 2.5em; }
.roll .nick { font-weight: bold; }
.roll .when { margin-left: auto; color: var(--muted); font-size: 13px; }
.roll .stat { flex-basis: 100%; padding-left: calc(2.5em + 8px); font-size: 13px; color: var(--muted); }
.roll .empty { color: var(--muted); }
/* 0호 신도 고정 줄 (협상 결과, DB 행 아님) */
.roll-pin {
  margin: 0;
  padding: 7px 10px;
  background: #eeeeee;
  border: 1px solid var(--ink);
  border-bottom: 1px dashed var(--ink);
  font-size: 14px;
  font-weight: bold;
}
.roll-pin + .roll { border-top: 0; }

.badge {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid #000;
  font-size: 12px;
  font-weight: bold;
  line-height: 1.5;
  white-space: nowrap;
}
.badge-more { background: var(--yellow); }
.badge-eq { background: var(--paper); }

/* ---------- 폼 ---------- */
.field { margin: 0 0 10px; }
.field label { display: block; margin-bottom: 4px; font-weight: bold; }
.input {
  width: 100%;
  min-height: 52px;
  padding: 10px 12px;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid #000;
  border-radius: 0;
  font: inherit;
  font-family: var(--font-clear);
  font-size: 18px;
}
.hint { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.warn {
  margin: 10px 0;
  padding: 8px 10px;
  border: 2px dashed var(--red);
  background: var(--paper);
  color: var(--red);
  font-weight: bold;
}
.error { margin: 8px 0 0; color: var(--red); font-weight: bold; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- 이름 빼기 ---------- */
.btn-link {
  min-height: 44px;
  padding: 0;
  background: none;
  border: 0;
  color: var(--link);
  font: inherit;
  font-size: 15px;
  text-decoration: underline;
  cursor: pointer;
}
.leave-row { margin-bottom: 0; }
.removal { margin-top: 14px; }
.removal summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--link);
  text-decoration: underline;
  cursor: pointer;
}
.removal-body { padding: 8px 12px 12px; background: var(--paper); border: 1px solid var(--ink); }
.rm-kind { border: 0; padding: 0; margin: 0 0 10px; }
.rm-kind legend { font-weight: bold; padding: 0; margin-bottom: 4px; }
.rm-kind label { display: flex; align-items: center; gap: 8px; min-height: 44px; }
.rm-kind input { width: 20px; height: 20px; margin: 0; }

/* ---------- 자주 묻는 질문 ---------- */
.faq dl { margin: 0; padding: 4px 12px 10px; background: var(--paper); border: 1px dashed var(--ink); }
.faq dt { margin-top: 10px; font-weight: bold; }
.faq dd { margin: 2px 0 0; }

/* ---------- 탭 ---------- */
.tabs { display: flex; gap: 0; margin-bottom: -1px; }
.tabs button {
  flex: 1;
  min-height: 48px;
  padding: 4px 2px;
  word-break: keep-all;
  background: #eee;
  color: #000;
  border: 1px solid #000;
  font: inherit;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
}
.tabs button[aria-selected="true"] { background: var(--paper); border-bottom-color: var(--paper); }

/* ---------- 신도증 ---------- */
.card-area { margin: 0 0 18px; }
.card-img {
  display: block;
  width: 100%;
  height: auto;
  border: 2px solid #000;
  background: #fff;
}
.reward {
  margin: 10px 0 0;
  padding: 8px 10px;
  border: 1px dashed #000;
  background: var(--paper);
  font-size: 15px;
}
.sharelink { display: flex; gap: 6px; margin-top: 8px; }
.sharelink .input { min-height: 48px; font-size: 14px; }
.sharelink .btn { flex: none; }

/* ---------- 토스트 (닫기 버튼 있음, 3초 뒤 자동으로 사라짐) ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  width: calc(100% - 32px);
  max-width: 480px;
  padding: 10px 8px 10px 14px;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  border: 2px solid var(--yellow);
  font-size: 15px;
}
.toast p { flex: 1; margin: 0; }
.toast button {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  background: transparent;
  color: #fff;
  border: 1px solid #fff;
  font: inherit;
  cursor: pointer;
}

/* ---------- 바닥 ---------- */
.foot {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 16px 28px;
  border-top: 1px dashed var(--ink);
  font-size: 14px;
  color: var(--muted);
}
.foot p { margin: 4px 0; }

.topbar {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 0;
  font-size: 15px;
}

section { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
