:root {
  --ink: #1d1e3a;
  --muted: #6b6f8a;
  --bg: #f4f3ef;
  --card: #ffffff;
  --line: #e6e4dc;
  /* สีแบรนด์ (brand/BRAND_GUIDE.md): กรมท่าหลัก + ฟ้าโลโก้เน้น · ห้ามตัวหนังสือขาวบนฟ้า */
  --primary: #2b2d6e;
  --primary-ink: #ffffff;
  --sky: #29cef6;
  --sky-soft: #e4f8fe;
  --gold: #c9962b;
  --gold-soft: #fbf1db;
  --green: #2f8f5b;
  --red: #c4423c;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(0 0 0 / 0.05), 0 4px 14px rgb(30 30 70 / 0.06);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Kanit', 'Noto Sans Thai', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.3; }
p { margin: 0; }
img { max-width: 100%; }

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; }

/* ---------- layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 5;
  display: grid; grid-template-columns: 44px 1fr 44px; align-items: center;
  padding: 10px 8px; background: var(--primary); color: var(--primary-ink);
}
.topbar h1 { font-size: 17px; text-align: center; }
.back { font-size: 30px; line-height: 1; padding: 0 10px; }
.content { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.section { font-size: 15px; color: var(--muted); margin-top: 8px; }

.row { display: flex; align-items: center; gap: 8px; }
.row.between { justify-content: space-between; }
.row.end { justify-content: flex-end; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.center { text-align: center; align-items: center; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.pre { white-space: pre-wrap; margin-top: 6px; }
.block { width: 100%; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(160deg, var(--primary) 0%, #1f2058 100%);
  color: #fff; padding: 18px 20px 26px; border-radius: 0 0 26px 26px;
  box-shadow: inset 0 -5px 0 var(--sky);
}
.hero-top { display: flex; gap: 12px; align-items: center; }
.hero-name { font-weight: 700; font-size: 18px; }
.hero-church { opacity: 0.75; font-size: 13px; }
.hero-points { margin-top: 22px; display: flex; flex-direction: column; }
.hero-points .label { opacity: 0.75; font-size: 14px; }
.hero-points .value { font-size: 52px; font-weight: 700; line-height: 1.1; color: #ffd98a; font-variant-numeric: tabular-nums; }
.hero-streak { margin-top: 8px; font-size: 14px; opacity: 0.9; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tile {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; display: flex; flex-direction: column; gap: 2px; font-weight: 600;
  transition: transform 0.1s;
}
.tile:active { transform: scale(0.97); }
.tile small { font-weight: 400; color: var(--muted); font-size: 13px; }
.tile .ico { font-size: 28px; margin-bottom: 4px; }
.tile.big { grid-column: 1 / -1; background: var(--gold-soft); border: 1px solid #f0dcae; }

/* ---------- controls ---------- */
.btn {
  appearance: none; border: 1px solid transparent; border-radius: 12px;
  padding: 12px 18px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 46px; text-align: center;
}
.btn.small { padding: 6px 12px; min-height: 36px; font-size: 14px; border-radius: 10px; }
.btn.primary { background: var(--primary); color: var(--primary-ink); }
.btn.danger { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.danger-text { color: var(--red) !important; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 14px; font-weight: 600; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
input, textarea, select {
  font: inherit; font-weight: 400; padding: 11px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink); width: 100%;
}
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--sky); outline-offset: -1px; }

.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: #eceaf4; color: var(--primary); white-space: nowrap;
}
.badge.gold { background: var(--gold-soft); color: #8a6414; }
.badge.green { background: #e1f3e8; color: var(--green); }
.dot { background: var(--red); color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; }
.gold-text { color: var(--gold); font-weight: 700; }
.plus-text { color: var(--green); font-weight: 700; }
.minus-text { color: var(--red); font-weight: 700; }

.avatar {
  border-radius: 50%; object-fit: cover; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: #dcd8f0; color: var(--primary); font-weight: 700;
}

.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 12px 4px; border-bottom: 1px solid var(--line);
}
.list-item.clickable { cursor: pointer; }
.scroll { max-height: 50vh; overflow-y: auto; }
.scroll.short { max-height: 30vh; }

.code {
  font-family: ui-monospace, Menlo, monospace; font-weight: 700; letter-spacing: 2px;
  background: var(--gold-soft); color: #7a5810; padding: 4px 10px; border-radius: 8px;
}
.code.big { display: block; text-align: center; font-size: 34px; margin-top: 12px; padding: 12px; }

/* ---------- check-in ---------- */
.big-ico { font-size: 64px; }
.plus { font-size: 34px; font-weight: 700; color: var(--green); }
.streak-num { font-size: 44px; font-weight: 700; }
.pulse { animation: pulse 1.2s infinite; }
.pop { animation: pop 0.4s ease-out; }
@keyframes pulse { 50% { opacity: 0.4; } }
@keyframes pop { from { transform: scale(0.4); } }

/* ---------- rewards ---------- */
.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.reward { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.reward img, .reward-ph { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.reward-ph { display: flex; align-items: center; justify-content: center; font-size: 42px; background: var(--gold-soft); }
.reward-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.reward-body .btn { margin-top: auto; }

/* ---------- devotion suggestion ---------- */
.suggest-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px;
  background: var(--gold-soft); border: 1px solid #f0dcae; border-radius: 12px;
}
.suggest-passage { font-size: 22px; color: var(--primary); }

/* ---------- sermon questions / cell ---------- */
.choice { padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line); }
.choice.right { background: #e1f3e8; border-color: #b9e0c8; color: var(--green); font-weight: 600; }
.choice.wrong { background: #fbe4e2; border-color: #f1c3bf; color: var(--red); }
.choice-opt { font-weight: 400; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; align-items: flex-start; }
.choice-opt input { margin-top: 3px; flex: none; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.stats div { background: var(--bg); border-radius: 10px; padding: 10px 4px; display: flex; flex-direction: column; }
.stats b { font-size: 24px; color: var(--primary); }
.stats span { font-size: 12px; color: var(--muted); line-height: 1.3; }
.answer { border-left: 3px solid var(--gold); padding: 2px 0 2px 10px; }
.q-preview { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }

/* ---------- calendar ---------- */
.cal { padding: 12px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; text-align: center; }
.cal-wd { font-size: 12px; color: var(--muted); padding: 4px 0; }
.cal-day {
  appearance: none; border: 0; background: none; font: inherit; color: var(--ink); cursor: pointer;
  aspect-ratio: 1; border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-height: 40px;
}
.cal-day.today span:first-child { color: var(--gold); font-weight: 700; }
.cal-day.sel { background: var(--primary); color: #fff; }
.cal-day.sel.today span:first-child { color: #ffd98a; }
.cal-dots { display: flex; gap: 2px; height: 6px; }
.cal-dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.cal-day.sel .cal-dots i { outline: 1.5px solid #fff; }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.chip {
  flex: none; border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 5px 12px; font: inherit; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.team-bar { border-left: 5px solid var(--team, var(--primary)); }
.slots-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.slots-bar i { display: block; height: 100%; background: var(--green); }
.slots-bar.full i { background: var(--red); }
input[type=color] { padding: 2px; height: 44px; }

/* ---------- admin ---------- */
.tabs {
  display: flex; overflow-x: auto; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 56px; z-index: 4;
}
.tabs a {
  flex: 1 0 auto; padding: 8px 12px; display: flex; flex-direction: column; align-items: center;
  font-size: 12px; color: var(--muted); border-bottom: 3px solid transparent;
}
.tabs a span { font-size: 18px; }
.tabs a.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 700; }

/* ---------- modal / toast ---------- */
.modal-wrap {
  position: fixed; inset: 0; background: rgb(20 20 40 / 0.45); z-index: 20;
  display: flex; align-items: flex-end; justify-content: center;
}
.modal {
  background: var(--card); width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto;
  border-radius: 20px 20px 0 0; padding: 20px 16px calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; gap: 14px;
}
.modal-body { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 600px) {
  .modal-wrap { align-items: center; }
  .modal { border-radius: 20px; }
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; z-index: 30;
  max-width: calc(100% - 32px); transition: all 0.25s; pointer-events: none; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.success { background: var(--green); }
.toast.error { background: var(--red); }

.loading { display: flex; justify-content: center; padding: 48px; }
.spinner {
  width: 32px; height: 32px; border: 3px solid var(--line); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- QR display screen ---------- */
.qr-screen {
  position: fixed; inset: 0; background: var(--primary); color: #fff;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px;
  text-align: center;
}
.qr-screen h1 { font-size: clamp(24px, 4vw, 44px); }
.qr-sub { font-size: clamp(16px, 2.4vw, 26px); color: #ffd98a; }
.qr-box {
  background: #fff; border-radius: 20px; padding: 12px;
  width: min(70vh, 85vw); aspect-ratio: 1; display: flex; align-items: center; justify-content: center; color: var(--ink);
}
.qr-box svg { width: 100%; height: 100%; }
.qr-meta { display: flex; gap: 24px; font-size: clamp(15px, 2vw, 22px); font-variant-numeric: tabular-nums; }
.qr-hint { opacity: 0.7; font-size: 14px; }
.qr-back { position: absolute; top: 16px; left: 16px; opacity: 0.6; }

.prompt-box {
  white-space: pre-wrap; font-family: inherit; font-size: 13px; background: var(--bg);
  border-radius: 10px; padding: 10px; margin: 8px 0; max-height: 220px; overflow-y: auto;
}
details summary { cursor: pointer; font-weight: 600; color: var(--primary); }
details ol { padding-left: 20px; margin: 6px 0; }

/* ---------- tier / visitor ---------- */
.hero-top .tier { margin-left: auto; }
.tier {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 700; white-space: nowrap;
}
.tier-bronze { background: #f3e1cf; color: #8a4f1f; }
.tier-silver { background: #eceef2; color: #555b66; }
.tier-gold { background: #fbf1db; color: #8a6414; }
.tier-platinum { background: #e3f1f6; color: #23657a; }
.tier-progress { margin-top: 10px; font-size: 12px; opacity: 0.9; display: flex; flex-direction: column; gap: 4px; }
.tier-bar { height: 6px; border-radius: 3px; background: rgb(255 255 255 / 0.25); overflow: hidden; }
.tier-bar i { display: block; height: 100%; background: #ffd98a; }
.notice {
  margin: 12px 16px 0; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: var(--gold-soft); border: 1px solid #f0dcae;
}
.content > .notice { margin: 0; }
.signups:empty { display: none; }
.member-no { font-family: ui-monospace, Menlo, monospace; font-weight: 700; color: var(--primary); }

.perm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.perm-table th { font-size: 12px; color: var(--muted); font-weight: 600; padding: 4px; }
.perm-table td { padding: 8px 4px; border-top: 1px solid var(--line); }
.perm-table td:not(:first-child), .perm-table th { text-align: center; width: 76px; }

/* ---------- profile photo / language ---------- */
.hero-avatar { position: relative; flex: none; }
.hero-avatar .avatar { border: 2px solid rgb(255 255 255 / 0.6); }
.hero-avatar .cam {
  position: absolute; right: -4px; bottom: -2px; font-size: 12px; background: #fff; border-radius: 50%;
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow);
}
.hero-right { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.lang-btn {
  appearance: none; border: 1px solid rgb(255 255 255 / 0.5); background: transparent; color: inherit;
  font: inherit; font-size: 12px; font-weight: 700; border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.topbar .lang-btn { justify-self: end; margin-right: 6px; }
.profile-photo .avatar { font-size: 44px; box-shadow: var(--shadow); }

.notice.campaign { background: #fde7e4; border-color: #f6c6bf; }

.tier.big { font-size: 20px; padding: 8px 18px; }

/* ---------- bulletin ---------- */
.tile.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 12px; }
.tile.wide .ico { margin: 0; }
.tile.wide span:last-child { display: flex; flex-direction: column; }
.bulletin { background: #efeeea; border-radius: var(--radius); padding: 18px 16px 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow); }
.bl-head { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; }
.bl-head h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; }
.bl-church { color: var(--muted); font-size: 18px; margin: 2px 0 8px; }
.bl-date { display: inline-block; background: #b5985a; color: #fff; padding: 4px 12px; font-size: 14px; }
.bl-photo { width: 104px; height: 130px; object-fit: cover; border-radius: 12px; flex: none; }
.bl-topic { background: #b5985a; color: #fff; border-radius: 16px; padding: 14px; text-align: center; display: flex; flex-direction: column; gap: 4px; }
.bl-topic span { font-size: 13px; font-style: italic; opacity: 0.9; }
.bl-topic b { font-size: 20px; line-height: 1.4; }
.bl-message { white-space: pre-wrap; line-height: 1.75; font-size: 15px; }
.bl-sign { text-align: right; font-style: italic; color: var(--muted); font-size: 14px; }
.bl-sign b { color: var(--ink); font-style: italic; }
.bl-notes ol { margin: 6px 0 0; padding-left: 22px; line-height: 1.7; font-size: 15px; }
.bl-stats { background: var(--card); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }

/* ภาพรวม (แดชบอร์ด) */
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.kpi { background: var(--card, #fff); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.kpi b { font-size: 26px; color: var(--primary); }
.kpi span { font-size: 13px; color: var(--muted, #6b6d8f); }
.vchart { display: flex; align-items: flex-end; gap: 2px; border-bottom: 1px solid var(--line); }
.vchart i { flex: 1; min-width: 2px; border-radius: 3px 3px 0 0; }
.vchart-labels { display: flex; gap: 2px; font-size: 10px; color: var(--muted, #6b6d8f); }
.vchart-labels span { flex: 1; min-width: 2px; white-space: nowrap; overflow: visible; }
.hbar { display: grid; grid-template-columns: 7em 1fr auto; align-items: center; gap: 8px; font-size: 13px; }
.hbar i { height: 12px; border-radius: 6px; }
.table-scroll { overflow-x: auto; }

/* ถวายทรัพย์ / ขอความช่วยเหลือ / อธิษฐาน / พี่เลี้ยง */
.give-qr { width: 100%; max-width: 320px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.steps { margin: 0; padding-left: 1.3em; display: grid; gap: 6px; }
.help-btn { background: #fde8e6; color: var(--red); border: 1px solid #f3c4bf; font-weight: 700; }
.danger-notice { background: #fde8e6; border-color: #f3c4bf; color: #7a201b; }
.danger-notice a { color: inherit; font-weight: 700; }
.card-alert { border-left: 4px solid var(--red); }
.note { background: var(--bg); border-radius: 10px; padding: 8px 10px; }
.chip-radio input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-radio span { display: inline-block; white-space: nowrap; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-size: 14px; }
.chip-radio input:checked + span { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); }
.avatar-anon { width: 32px; height: 32px; border-radius: 50%; background: var(--gold-soft); display: inline-grid; place-items: center; }
.mentor-opt { align-items: center; gap: 8px; }

.rule { align-items: flex-start; }
.rule input { margin-top: 3px; flex: none; }

/* ประกาศในสูจิบัตร */
.bl-note { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-top: 1px solid var(--line); }
.bl-note:first-of-type { border-top: 0; }
.bl-no { flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--gold-soft); color: var(--gold); font-weight: 700; display: grid; place-items: center; font-size: 14px; }
.bl-note p { margin: 2px 0 0; }
.note-edit { background: var(--bg); }

/* พิมพ์ / PDF: A4 เฉพาะเนื้อสูจิบัตร */
@media print {
  @page { size: A4; margin: 14mm; }
  body { background: #fff !important; }
  .topbar, .tabs, .no-print, #toast, .modal-wrap { display: none !important; }
  .content { padding: 0 !important; max-width: none !important; }
  .bulletin { box-shadow: none !important; border: 0 !important; }
  .bl-note, .bl-stats, .bl-topic { break-inside: avoid; }
  .bulletin.tabbed .bl-page { display: flex !important; }
  .bl-page + .bl-page { break-before: page; border-top: 0 !important; margin-top: 0 !important; padding-top: 0 !important; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
.list-item.sub { padding-top: 2px; padding-bottom: 2px; border: 0; color: var(--muted); }

/* แบรนด์ */
.hero-logo { display: block; height: 30px; width: auto; margin-bottom: 14px; }
/* โลโก้คงสัดส่วนตาม Brand Guide: กล่อง .bulletin เป็น flex จะยืดลูกให้เต็มกว้าง จึงต้องไม่ให้ยืด */
.bl-logo { display: block; align-self: flex-start; flex: none; height: 34px; width: auto; max-width: none; object-fit: contain; margin: 4px 0 10px; }
.section { border-left: 4px solid var(--sky); padding-left: 8px; }
.chip.on { box-shadow: inset 0 -3px 0 var(--sky); }
.topbar { box-shadow: inset 0 -3px 0 var(--sky); }

/* 📣 การ์ดขอคนช่วยงานอาสา (หน้าแรก) */
.call-card { border: 0; border-left: 5px solid var(--team, var(--primary)); display: flex; flex-direction: column; gap: 4px; text-align: left; font: inherit; color: inherit; cursor: pointer; margin-bottom: 12px; }

/* โปรไฟล์: วันที่แบบ วัน / เดือน / ปี */
.date-sel { gap: 6px; margin-top: 4px; }
.date-sel select { flex: 1; min-width: 0; }
.date-sel select[data-part="m"] { flex: 2; }
.right { text-align: right; }

/* สูจิบัตรแบ่งหน้า: ในแอปเลือกดูทีละหน้า (แท็บ) · ดูตัวอย่าง/พิมพ์แสดงครบทุกหน้า */
.bl-page { display: flex; flex-direction: column; gap: 14px; }
.bl-page + .bl-page { border-top: 2px dashed var(--line); padding-top: 18px; margin-top: 6px; }
.bulletin.tabbed .bl-page:not(.on) { display: none; }
.bulletin.tabbed .bl-page + .bl-page { border-top: 0; padding-top: 0; margin-top: 0; }
.bl-pagehead { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bl-pagehead .bl-logo { margin: 0; height: 28px; }
.bl-page h2 { font-size: 22px; font-weight: 800; }
.bl-tabs { margin-bottom: 10px; }

/* hidden ต้องชนะ display ของคลาสอื่น (เช่น .btn, .check) */
[hidden] { display: none !important; }

/* PDPA: กดอ่านรายละเอียดเต็ม */
.pdpa summary { cursor: pointer; color: var(--primary); }
.pdpa > div, .pdpa > p { max-height: 40vh; overflow-y: auto; background: var(--cream, #f4f3ef); padding: 10px; border-radius: 10px; }
@media print { .pdpa > div, .pdpa > p { max-height: none; overflow: visible; } .pdpa summary { display: none; } .pdpa { display: block; } }

/* ช่องชื่อท้ายเอกสาร (ใบสมัคร / ใบยกเลิก) */
.doc-sign { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.doc-sign > div { display: flex; flex-direction: column; gap: 4px; text-align: center; padding-top: 28px; border-top: 1px dashed var(--line); }

/* กิจกรรม */
.act-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 12px; }
/* ผลโหวต */
.vote-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; background: var(--line); }
.vote-bar i { display: block; height: 100%; }
.vote-bar .agree { background: #2e9e5b; } .vote-bar .disagree { background: #d9534f; } .vote-bar .abstain { background: #9a9ab0; }
.vote-result { display: flex; flex-direction: column; gap: 6px; }

/* เอกสาร: เส้นจุดว่างเว้นไว้ · ภาคผนวกแสดงเฉพาะตอนพิมพ์ (ขึ้นหน้าใหม่) */
.blank-lines { display: flex; flex-direction: column; gap: 18px; padding: 10px 0 4px; }
.blank-lines span { display: block; border-bottom: 1px dotted #b9b9c6; height: 1px; }
.print-only { display: none; }
@media print {
  .print-only { display: block !important; }
  .appendix { break-before: page; }
  .appendix h3 { font-size: 18px; margin: 0 0 4px; }
  .appendix p { font-size: 13px; line-height: 1.6; margin: 6px 0; }
}

/* ---------- ติดตามเรา (ท้ายหน้าแรก) ---------- */
.social-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.social-row .social {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: inherit; text-decoration: none; font-size: 13px;
}
.social-row .social i {
  font-style: normal; font-weight: 700; font-size: 12px; color: #fff; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
}
.social-row .facebook i { background: #1877f2; }
.social-row .youtube i { background: #ff0000; }
.social-row .line i { background: #06c755; }
