:root {
  --bg: #F7EFE3;
  --ink: #33291F;
  --ink-soft: #7A6A58;
  --line: #EADBC6;
  --card: #FFFCF7;
  --brand: #9A4A24;
  --brand-soft: #F6E4D6;
  --danger: #C5533F;
  --warn: #E3A93C;
  --present: #6FA671;
  --late: #E3A93C;
  --absent: #C5533F;
  --g1: #4E8FC4;
  --g1-soft: #E7F0F8;
  --g2: #6B5B95;
  --g2-soft: #EFEAF5;
  --g3: #A9743C;
  --g3-soft: #F5EEE2;
  --g4: #4C9A6B;
  --g4-soft: #E6F3EB;
  --g5: #C0577A;
  --g5-soft: #F8E6EC;
  --g6: #2E8B84;
  --g6-soft: #E2F2F0;
  --g7: #B8901A;
  --g7-soft: #F8F0D8;
  --g8: #7A6A58;
  --g8-soft: #EFEAE4;
  --g9: #5F7A3A;
  --g9-soft: #EBF1E1;
  --g10: #B5653A;
  --g10-soft: #F6E9E0;
  --g11: #3E6FA8;
  --g11-soft: #E4ECF6;
  --new: #4C9A6B;
  --praise: #C0577A;
  --new-soft: #E6F3EB;
  --nf-yellow: #B8901A;
  --nf-yellow-soft: #FBF1D6;
  --prayer-pink: #C15C86;
  --prayer-pink-soft: #FBE7F0;
  --assurance-teal: #2E8B84;
  --assurance-teal-soft: #E2F2F0;
  --radius: 18px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "NanumSquareRound", "Pretendard Variable", "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}

body { background: radial-gradient(120% 60% at 100% 0%, #F3DCC4 0%, rgba(243,220,196,0) 60%) fixed, var(--bg); min-height: 100dvh; padding-bottom: calc(24px + var(--safe-bottom)); }

button { font-family: inherit; cursor: pointer; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: calc(14px + var(--safe-top)) 16px 14px;
  background: rgba(247,239,227,0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.app-header h1 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.02em;
  flex: 1;
  text-align: center;
}

.back-btn {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 17px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hidden { display: none !important; }

#app {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 40px;
}

/* ---------- Home ---------- */
.home-intro { padding: 4px 2px 18px; }
.home-intro .eyebrow {
  font-size: 12px; font-weight: 700; color: var(--brand);
  letter-spacing: 0.04em; text-transform: uppercase;
}
.home-intro h2 { font-size: 21px; margin: 6px 0 4px; letter-spacing: -0.02em; }
.home-intro p { margin: 0; color: var(--ink-soft); font-size: 13.5px; line-height: 1.5; }

.grade-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.grade-card {
  position: relative;
  border: none;
  border-radius: var(--radius);
  padding: 18px 18px;
  text-align: left;
  background: var(--card);
  box-shadow: 0 1px 0 var(--line);
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 14px;
}
.grade-card::before {
  content: ""; position: absolute; inset: 0; opacity: 0.10; background: var(--accent);
}
.grade-card .mark {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 18px; flex-shrink: 0; position: relative;
}
.grade-card .info { position: relative; flex: 1; }
.grade-card .name { font-weight: 700; font-size: 16.5px; }
.grade-card .count { font-size: 12px; color: var(--ink-soft); margin-top: 3px; }
.grade-card .chev { color: var(--ink-soft); font-size: 16px; position: relative; }

.section-label {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  margin: 18px 2px 8px; text-transform: uppercase; letter-spacing: 0.03em;
  display: flex; align-items: center; justify-content: space-between;
}
.section-label-action {
  border: none; background: transparent; color: var(--brand);
  font-size: 12px; font-weight: 700; text-transform: none; letter-spacing: normal; padding: 0;
}

.list-card { background: var(--card); border-radius: 16px; border: 1px solid var(--line); overflow: hidden; }
.list-row {
  display: flex; align-items: center; gap: 12px; padding: 14px 14px;
  border-bottom: 1px solid var(--line); width: 100%; border-left: none; border-right: none; border-top: none;
  background: transparent; text-align: left;
}
.list-row:last-child { border-bottom: none; }
.list-row .row-main { flex: 1; min-width: 0; }
.list-row .row-title { font-weight: 700; font-size: 15px; }
.list-row .row-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.chev { color: var(--ink-soft); font-size: 15px; }

.newcomer-helper-row .chev { display: inline-block; transition: transform 0.15s ease; }
.newcomer-helper-row.open .chev { transform: rotate(90deg); }
.helper-student-list { background: var(--bg); }
.helper-student-list .student-row { padding-left: 26px; }

.fab-row { display: flex; gap: 10px; margin-top: 14px; }
.btn {
  border: none; border-radius: 14px; padding: 13px 16px; font-weight: 700;
  font-size: 14.5px; background: var(--brand); color: #fff; flex: 1;
}
.btn.secondary { background: var(--brand-soft); color: var(--brand); }
.btn.outline { background: #fff; color: var(--ink); border: 1px solid var(--line); }

.admin-group { margin-top: 14px; }
.admin-group > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-size: 12px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em;
  padding: 6px 2px;
}
.admin-group > summary::-webkit-details-marker { display: none; }
.admin-group > summary::before {
  content: "▸"; font-size: 11px; color: var(--ink-soft); transition: transform 0.15s ease; flex-shrink: 0;
}
.admin-group[open] > summary::before { transform: rotate(90deg); }
.admin-group-badge {
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--danger); padding: 1px 7px; border-radius: 999px;
}
/* display를 여기서 강제하지 않음 — <details>가 닫혀있을 때 브라우저가 내부 콘텐츠에 거는
   기본 display:none을 이 규칙이 덮어써버리면(specificity 문제) 접어도 버튼이 계속 보이는
   버그가 남. 대신 열렸을 때 자식 버튼 각각에 세로쌓임을 지정. */
.admin-group-body > .btn { display: block; width: 100%; margin-top: 8px; }
.admin-group-body > .btn:first-child { margin-top: 4px; }
/* 2026-10-19: 홈 버튼 옆 빨간 알림(무물 새 질문·게임 지급 대기) */
.btn-badge { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.btn-small { border: none; border-radius: 10px; padding: 7px 12px; font-size: 12.5px; font-weight: 700; background: var(--brand); color: #fff; }
.btn-small.ghost { background: transparent; color: var(--ink-soft); }

/* ---------- Class / roster ---------- */
.grade-banner {
  border-radius: var(--radius); padding: 16px; margin-bottom: 16px;
  background: var(--accent); color: #fff; display: flex; align-items: center; gap: 12px;
}
.grade-banner .mark {
  width: 42px; height: 42px; border-radius: 12px; background: rgba(255,255,255,0.22);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 17px; flex-shrink: 0;
}
.grade-banner .title { font-weight: 700; font-size: 16.5px; }
.grade-banner .sub { font-size: 12px; opacity: 0.88; margin-top: 2px; }

.newcomer-row .row-title::after {
  content: "새가족"; margin-left: 6px; font-size: 10.5px; font-weight: 700; color: #fff;
  background: var(--new); padding: 2px 7px; border-radius: 999px; vertical-align: middle;
}

.date-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.date-bar input[type="date"] {
  border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 13.5px; background: #fff; color: var(--ink);
}
.stat-pill { font-size: 12px; font-weight: 700; color: var(--ink-soft); }

.student-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line);
}
.student-row:last-child { border-bottom: none; }
.student-row .name-block { flex: 1; min-width: 0; }
/* 교구판 구역 명단의 작은 사진(rowPhoto_) — 사진이 없으면 이름 첫 글자 */
.row-photo { flex: none; width: 46px; height: 58px; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, .05); color: var(--ink-soft); font-size: 16px; font-weight: 700; display: flex; align-items: center; justify-content: center; text-decoration: none; }
.row-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.student-row.with-photo { gap: 9px; }
.student-row .s-name { font-weight: 700; font-size: 15px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.student-row .s-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.streak-badge {
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--danger); padding: 2px 7px; border-radius: 999px;
}
.flag-badge {
  font-size: 10.5px; font-weight: 700; color: #fff; padding: 2px 7px; border-radius: 999px;
}
.flag-badge.urgent { background: var(--danger); }
.flag-badge.caution { background: var(--warn); }
.nb-badge {
  font-size: 10.5px; font-weight: 700; color: var(--new); background: var(--new-soft); padding: 2px 7px; border-radius: 999px;
}
.nb-badge.badge-nb { color: var(--new); background: var(--new-soft); }
.nb-badge.badge-nf { color: var(--nf-yellow); background: var(--nf-yellow-soft); }
.nb-badge.badge-prayer { color: var(--prayer-pink); background: var(--prayer-pink-soft); }
.nb-badge.badge-assurance { color: var(--assurance-teal); background: var(--assurance-teal-soft); }
.longabsence-badge {
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--ink-soft); padding: 2px 7px; border-radius: 999px;
}
.att-toggle {
  border: 1.5px solid var(--line); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; font-weight: 700;
  background: #fff; color: var(--ink-soft); min-width: 56px; text-align: center; flex-shrink: 0;
}
.att-toggle[data-status="present"] { background: var(--present); border-color: var(--present); color: #fff; }
.att-toggle[data-status="late"] { background: var(--late); border-color: var(--late); color: #fff; }
.att-toggle[data-status="absent"] { background: var(--absent); border-color: var(--absent); color: #fff; }

.milestone-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.milestone-btn {
  border: 1.5px solid var(--line); border-radius: 999px; padding: 4px 9px; font-size: 10.5px; font-weight: 700;
  background: #fff; color: var(--ink-soft);
}
.milestone-btn.done { background: var(--new-soft); border-color: var(--new); color: var(--new); }

.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: #fff;
  color: var(--ink-soft); font-size: 14px; flex-shrink: 0;
}
.icon-btn.has-mark { background: var(--brand-soft); color: var(--brand); border-color: transparent; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--ink-soft); }
.empty-state .mark { font-size: 32px; margin-bottom: 10px; }
.empty-state p { font-size: 13.5px; line-height: 1.5; margin: 0 0 14px; }

/* ---------- Care list (심방 우선순위) ---------- */
.care-section {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; margin: 4px 0 16px;
}
.care-section .section-label { margin: 0 0 10px; }
.care-section .care-card:last-child { margin-bottom: 0; }
.care-card {
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--danger);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 8px; width: 100%; text-align: left;
  display: flex; align-items: center; gap: 10px;
}
.care-card-main { flex: 1; min-width: 0; border: none; background: transparent; padding: 0; text-align: left; }
.care-card .c-name { font-weight: 700; font-size: 14.5px; }
.care-card .c-info { font-size: 12.5px; color: var(--ink-soft); margin-top: 3px; }
.care-la-btn { flex-shrink: 0; white-space: nowrap; border: 1.5px solid var(--line); }

/* ---------- Student detail ---------- */
.student-banner {
  border-radius: var(--radius); padding: 18px; margin-bottom: 16px; background: var(--brand-soft);
}
.student-banner .name { font-size: 19px; font-weight: 700; }
.student-banner .meta { font-size: 12.5px; color: var(--ink-soft); margin-top: 6px; line-height: 1.7; }
.student-banner .meta div { display: flex; gap: 6px; }
.student-banner .meta b { color: var(--ink); font-weight: 700; min-width: 62px; flex-shrink: 0; }
/* 성도 사진(교구판 FEATURES.memberPhoto) — 성도 화면 이름 왼쪽 사진 칸과 올리기 창 */
.student-banner.with-photo { display: grid; grid-template-columns: 78px minmax(0, 1fr); grid-template-rows: auto 1fr; column-gap: 14px; }
.student-banner.with-photo > .member-photo { grid-column: 1; grid-row: 1 / span 2; align-self: start; }
.student-banner.with-photo > .name, .student-banner.with-photo > .meta { grid-column: 2; }
.student-banner.with-photo > .private-toggle, .student-banner.with-photo > .meta-private { grid-column: 1 / -1; }
.member-photo {
  width: 78px; height: 100px; margin: 0; padding: 0; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line); background: var(--card); color: var(--ink-soft); cursor: pointer; font: inherit;
}
.member-photo:not(.has) { border-style: dashed; }
.member-photo img, .photo-view img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mp-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; width: 100%; height: 100%; font-size: 22px; line-height: 1; }
.mp-empty small { font-size: 11.5px; font-weight: 600; line-height: 1.3; }
.photo-view {
  width: min(240px, 62vw); aspect-ratio: 3 / 4; margin: 0 auto 12px; border-radius: 18px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink-soft);
}
.photo-view .mp-empty { font-size: 34px; }
.photo-view .mp-empty small { font-size: 13px; }
.photo-note, .photo-size { font-size: 12.5px; color: var(--ink-soft); margin: 0 0 10px; line-height: 1.55; text-align: center; }
.photo-consent { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: 12px; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.photo-consent input { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--brand); }
.photo-msg { font-size: 13px; color: var(--danger); min-height: 18px; margin: 4px 0 0; text-align: center; }

.visit-card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.visit-card .v-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.visit-card .v-date { font-weight: 700; font-size: 13.5px; }
.visit-card .v-teacher { font-size: 12px; color: var(--ink-soft); }
.visit-card .v-q { font-size: 13px; margin-top: 6px; line-height: 1.5; }
.visit-card .v-q b { color: var(--brand); }
.visit-card .v-edit-row { display: flex; justify-content: flex-end; gap: 6px; margin-top: 10px; }
.visit-card .v-edit-btn { background: transparent; color: var(--ink-soft); border: 1px solid var(--line); }
.visit-card .v-delete-btn { background: transparent; color: #C0392B; border: 1px solid #E8B4AC; }

/* ---------- Modal ---------- */
.modal-backdrop { position: fixed; inset: 0; background: rgba(30,25,20,0.4); display: flex; align-items: flex-end; z-index: 50; }
.modal-sheet {
  background: #fff; width: 100%; max-width: 560px; margin: 0 auto; border-radius: 22px 22px 0 0;
  padding: 20px 18px calc(20px + var(--safe-bottom)); max-height: 88vh; overflow-y: auto;
}
.modal-sheet h3 { margin: 0 0 14px; font-size: 17px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.field input[type="text"], .field input[type="tel"], .field input[type="date"], .field input[type="number"], .field input[type="password"],
.field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font-size: 14.5px;
  font-family: inherit; background: #FFFAF3; color: var(--ink);
}
.field textarea { min-height: 60px; resize: vertical; }
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1.5px solid var(--line); border-radius: 999px; padding: 7px 13px; font-size: 12.5px; font-weight: 700;
  background: #fff; color: var(--ink-soft);
}
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.flag-group { display: flex; gap: 8px; }
.flag-group .chip { flex: 1; text-align: center; }
.flag-group .chip[data-flag="주의"].on { background: var(--warn); border-color: var(--warn); }
.flag-group .chip[data-flag="긴급"].on { background: var(--danger); border-color: var(--danger); }

.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn.danger-text { background: #fff; color: var(--danger); border: 1px solid var(--line); flex: 0 0 auto; }

.toast {
  position: fixed; bottom: calc(20px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: #2E2A26; color: #fff; padding: 10px 18px; border-radius: 999px; font-size: 13px; z-index: 60;
  box-shadow: 0 6px 20px rgba(0,0,0,0.2); max-width: 88vw; text-align: center;
}

/* 교구판: 명단이 빈 기기에서 받는 동안(pullChip_) */
.pull-chip {
  position: fixed; top: calc(62px + var(--safe-top)); left: 50%; transform: translateX(-50%);
  background: var(--card, #fff); color: var(--ink, #2E2A26); border: 1px solid var(--line, #E7E0D4); padding: 7px 16px; border-radius: 999px;
  font-size: 13px; font-weight: 600; z-index: 25; box-shadow: 0 4px 14px rgba(0,0,0,0.08); pointer-events: none;
}

.install-banner {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: var(--brand); color: #fff; padding: 10px 14px; font-size: 12.5px;
  padding-top: calc(10px + var(--safe-top));
}
.install-banner-actions { display: flex; gap: 6px; flex-shrink: 0; }
.install-banner .btn-small { background: #fff; color: var(--brand); }
.install-banner .btn-small.ghost { background: transparent; color: rgba(255,255,255,0.85); }

.sync-banner {
  position: sticky; top: 0; z-index: 25; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: #FBE8C8; color: #7A4A0B; padding: 9px 14px; font-size: 12px; font-weight: 600;
}
.sync-banner .btn-small { background: #7A4A0B; color: #fff; flex-shrink: 0; }

.sync-status-line { font-size: 12px; color: var(--ink-soft); margin: 8px 0 0; }

/* ---------- 반별 출석 비교표 ---------- */
.report-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 336px; }
.report-table th {
  text-align: left; font-size: 10px; font-weight: 700; color: var(--ink-soft); text-transform: uppercase;
  padding: 6px 4px; border-bottom: 1.5px solid var(--line); position: sticky; top: 0; background: var(--bg);
}
.report-table th.num, .report-table td.num { text-align: right; white-space: nowrap; }
.report-table td { padding: 9px 4px; border-bottom: 1px solid var(--line); background: var(--card); }
.report-table th:first-child, .report-table td:first-child { padding-left: 2px; }
.report-table tr:hover td { background: var(--brand-soft); cursor: pointer; }
.report-grade-head td {
  background: var(--brand); color: #fff; font-weight: 700; font-size: 11.5px; padding: 6px 8px; cursor: default;
}
.report-grade-head:hover td { background: var(--brand); }
.report-total-row td { background: var(--brand-soft); font-size: 13px; cursor: default; }
.report-total-row:hover td { background: var(--brand-soft); }
/* 내가 못 여는 다른 반 행 — 숫자는 보이되 눌러도 상세는 안 열립니다. */
.report-row-locked td { color: var(--ink-soft); cursor: default; }
.report-row-locked td:first-child::after { content: ' 🔒'; font-size: 10px; opacity: .5; }
.report-row-locked:hover td { background: var(--card); }

/* ---------- 출석 빠른 수정 시트 ---------- */
.att-sheet h3 { text-align: center; }
.att-picker { display: flex; gap: 10px; margin: 6px 0 14px; }
.att-pick {
  flex: 1; border: 1.5px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink-soft);
  padding: 16px 8px; font-size: 13px; font-weight: 700; line-height: 1.6; text-align: center;
}
.att-pick[data-status="present"].active,
.att-pick[data-status="present"]:active { background: var(--present); border-color: var(--present); color: #fff; }
.att-pick[data-status="late"].active,
.att-pick[data-status="late"]:active { background: var(--late); border-color: var(--late); color: #fff; }
.att-pick[data-status="absent"].active,
.att-pick[data-status="absent"]:active { background: var(--absent); border-color: var(--absent); color: #fff; }
.att-clear-btn { width: 100%; color: var(--ink-soft); }

/* ---------------- 개인정보 더보기 토글 (학생 상세) ---------------- */
.private-toggle {
  margin-top: 10px;
  width: 100%;
  border: 1px dashed var(--line);
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.private-toggle:active { background: var(--brand-soft); }
.meta-private { margin-top: 8px; }

/* ---------------- 캡쳐 억제: 백그라운드 화면 가림 ---------------- */
#privacy-cover {
  position: fixed;
  inset: 0;
  z-index: 2147483600;
  background: var(--brand);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
}
#privacy-cover.on { display: flex; }
#privacy-cover small { font-weight: 500; opacity: 0.8; font-size: 12.5px; }

/* ================================================================
   2026-10-02 UI 리프레시 — 한국어 줄바꿈 정리 + 부드러운 카드형 디자인.
   기존 규칙은 그대로 두고 여기서 덮어씁니다(app.js 인라인 스타일과 충돌 최소화).
   ================================================================ */
:root {
  --radius: 20px;
  --shadow-sm: 0 1px 2px rgba(80, 50, 20, 0.05);
  --shadow: 0 1px 2px rgba(80, 50, 20, 0.04), 0 6px 18px rgba(80, 50, 20, 0.06);
  --shadow-lg: 0 10px 40px rgba(60, 35, 15, 0.16);
  --line-soft: rgba(154, 74, 36, 0.10);
}

/* 한국어 단어 중간에서 끊기지 않게("다시보/기" 방지). 아주 긴 영문·URL만 강제 줄바꿈. */
html, body { word-break: keep-all; overflow-wrap: anywhere; letter-spacing: -0.01em; line-height: 1.45; }
button, .btn, .btn-small, .chip, .att-toggle, .milestone-btn { line-height: 1.3; text-wrap: balance; }
p, .row-sub, .s-sub, .c-info { text-wrap: pretty; }
input, select, textarea { font-family: inherit; letter-spacing: -0.01em; }

/* 헤더 — 선 대신 은은한 블러 */
.app-header { border-bottom: none; background: rgba(247, 239, 227, 0.78); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); }
.app-header h1 { font-size: 17px; letter-spacing: -0.03em; }
.back-btn { width: 38px; height: 38px; border-radius: 12px; }

/* 홈 인트로 */
.home-intro { padding: 6px 2px 20px; }
.home-intro .eyebrow { font-size: 12.5px; letter-spacing: 0; text-transform: none; }
.home-intro h2 { font-size: 23px; line-height: 1.3; margin: 6px 0 8px; letter-spacing: -0.035em; }
.home-intro p { font-size: 14px; line-height: 1.6; }

.section-label { font-size: 13px; letter-spacing: -0.01em; text-transform: none; margin: 22px 4px 10px; }
.admin-group > summary { font-size: 13px; text-transform: none; letter-spacing: -0.01em; }

/* 카드류 — 테두리 대신 부드러운 그림자 */
.list-card, .care-section, .visit-card {
  border: 1px solid var(--line-soft); box-shadow: var(--shadow); border-radius: var(--radius); background: var(--card);
}
.grade-card { box-shadow: var(--shadow); border-radius: var(--radius); padding: 18px 18px; transition: transform .12s ease; }
.grade-card .mark, .grade-banner .mark { border-radius: 16px; }
.grade-banner { border-radius: 22px; padding: 18px; box-shadow: var(--shadow); }
.list-row, .student-row { border-bottom-color: var(--line-soft); }
.list-row { padding: 15px 16px; }
.student-row { padding: 13px 16px; }
.care-card { border: 1px solid var(--line-soft); border-left: 4px solid var(--danger); border-radius: 14px; box-shadow: var(--shadow-sm); }
.student-banner { border-radius: 22px; padding: 20px; }

/* 버튼 */
.btn { border-radius: 16px; padding: 14px 16px; font-size: 15px; box-shadow: 0 2px 8px rgba(154, 74, 36, 0.18); transition: transform .1s ease, filter .15s ease; }
.btn.secondary { box-shadow: none; }
.btn.outline { background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); }
.btn-small { border-radius: 999px; padding: 8px 14px; font-size: 13px; white-space: nowrap; }
.btn-small.ghost { background: var(--brand-soft); color: var(--brand); }
.icon-btn { width: 36px; height: 36px; border: 1px solid var(--line-soft); background: var(--card); box-shadow: var(--shadow-sm); }
.btn:active, .btn-small:active, .grade-card:active, .att-toggle:active, .chip:active, .icon-btn:active { transform: scale(0.97); }
/* 버튼 줄: 두 개씩 나란히, 남는 칸은 늘려서 채움. 주 버튼(첫 칸 채움색)은 한 줄 전체 */
.fab-row { display: flex; flex-wrap: wrap; gap: 10px; }
.fab-row > .btn { flex: 1 1 calc(50% - 5px); min-width: 0; font-size: 14px; padding: 13px 10px; display: flex; align-items: center; justify-content: center; text-align: center; }
.fab-row > .btn:first-child:not(.outline):not(.secondary) { flex-basis: 100%; }
/* 인라인 flex-wrap 줄에서 버튼이 글자를 찌그러뜨리지 않고 다음 줄로 넘어가게 */
.btn { flex: 1 1 auto; }
.modal-actions .btn { flex: 1 1 0; }
.modal-actions .btn.danger-text { flex: 0 0 auto; }

/* 출석 토글·칩 — 알약형 */
.att-toggle { border-radius: 999px; padding: 8px 14px; min-width: 60px; border-color: var(--line); background: var(--card); white-space: nowrap; transition: background .15s ease, transform .1s ease; }
.chip { border-radius: 999px; padding: 8px 14px; background: var(--card); white-space: nowrap; }
.milestone-btn { background: var(--card); white-space: nowrap; }
.streak-badge, .flag-badge, .nb-badge, .longabsence-badge { white-space: nowrap; font-size: 11px; padding: 2px 8px; }
.newcomer-row .row-title::after { white-space: nowrap; }

/* 입력창 */
.field label { font-size: 13px; }
.field input[type="text"], .field input[type="tel"], .field input[type="date"], .field input[type="number"], .field input[type="password"],
.field textarea, .field select, .date-bar input[type="date"] {
  border-radius: 14px; border: 1px solid var(--line); background: #FFFDF9; padding: 12px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.date-bar input[type="date"] { padding: 9px 12px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand) !important; box-shadow: 0 0 0 3px rgba(154, 74, 36, 0.14); }

/* 모달 — 바텀시트 */
.modal-backdrop { background: rgba(40, 25, 12, 0.38); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: jdFade .18s ease; }
.modal-sheet { background: var(--card); border-radius: 28px 28px 0 0; padding: 26px 20px calc(22px + var(--safe-bottom)); box-shadow: var(--shadow-lg); position: relative; animation: jdUp .24s cubic-bezier(.2, .8, .2, 1); }
.modal-sheet::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
.modal-sheet h3 { font-size: 18px; letter-spacing: -0.03em; }
.att-pick { border-radius: 18px; background: var(--card); }
@keyframes jdFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes jdUp { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }

/* 토스트·배너 */
.toast { background: rgba(45, 30, 18, 0.92); backdrop-filter: blur(8px); padding: 11px 20px; font-size: 13.5px; box-shadow: var(--shadow-lg); }
.sync-banner { font-size: 12.5px; line-height: 1.45; }
.install-banner { line-height: 1.45; }

/* 비교표 */
.report-table th { text-transform: none; font-size: 11px; white-space: nowrap; }
.report-table td { white-space: nowrap; }
.report-table td:first-child { white-space: normal; }

/* ================================================================
   2026-10-03 홈 리디자인 — 인사말(선생님 이름) + 검색 알약 + 원형 빠른메뉴 + 주간 카드 + 내 반 카드
   ================================================================ */
.home-greet { padding: 8px 4px 18px; }
.home-greet .hello { font-size: 17px; color: var(--ink-soft); }
.home-greet .who { font-size: 27px; font-weight: 800; letter-spacing: -0.04em; margin-top: 2px; line-height: 1.25; }
.home-greet .role { font-size: 13.5px; color: var(--ink-soft); margin-top: 4px; }

.home-search { display: flex; align-items: center; gap: 10px; background: var(--card); border: 1px solid var(--line-soft); border-radius: 18px; padding: 0 16px; margin-bottom: 18px; box-shadow: var(--shadow-sm); color: var(--ink-soft); }
.home-search input { flex: 1; min-width: 0; border: none !important; background: transparent; padding: 15px 0; font-size: 15px; color: var(--ink); box-shadow: none !important; }
.home-search input::placeholder { color: #B3A390; }

.home-quick { display: flex; gap: 6px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 6px; padding: 2px 16px 8px; scrollbar-width: none; }
.home-quick::-webkit-scrollbar { display: none; }
.quick-btn { flex: 0 0 auto; width: 72px; display: flex; flex-direction: column; align-items: center; gap: 8px; background: none; border: none; padding: 0; color: var(--ink); scroll-snap-align: start; cursor: pointer; font-family: inherit; }
.quick-ico { position: relative; width: 62px; height: 62px; border-radius: 50%; background: var(--card); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); display: flex; align-items: center; justify-content: center; color: var(--brand); transition: transform .1s ease; }
.quick-btn:active .quick-ico { transform: scale(0.94); }
.quick-label { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; letter-spacing: -0.03em; }
.quick-badge { position: absolute; top: -2px; right: -2px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; border: 2px solid var(--bg); }

.home-h { font-size: 18px; font-weight: 800; letter-spacing: -0.035em; margin: 22px 4px 12px; }

.week-card { padding: 16px !important; }
.week-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.week-arrow { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--bg); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; font-family: inherit; }
.week-arrow:disabled { opacity: .35; cursor: default; }
.week-pill { position: relative; flex: 1; min-width: 0; height: 46px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 800; font-size: 16.5px; letter-spacing: -0.03em; cursor: pointer; overflow: hidden; }
.week-pill input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; border: none; padding: 0; pointer-events: none; }
.week-stats { display: flex; gap: 10px; }
.week-stat { flex: 1; min-width: 0; background: var(--bg); border-radius: 16px; padding: 14px 14px 12px; }
.week-stat .k { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.week-stat .v { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 6px; line-height: 1.1; }
.week-stat .v small { font-size: 15px; font-weight: 700; margin-left: 2px; }
.week-stat .v em { font-style: normal; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-left: 6px; letter-spacing: 0; }
.week-stat.now { background: var(--brand-soft); }
/* 출석·재적이 둘 다 네 자리(교구판 관리자 '1711명 / 2214')일 때만 붙는 클래스 — 글씨를 조금 줄이고 '/ 재적'은 쪼개지지 않고 통째로만 내려가게 */
.week-stats.wide .week-stat .v { font-size: 24px; }
/* 교구판 달 칸(monthStats): 그 달 주일 4~5칸 — 칸이 좁아 날짜·숫자만, 재적은 위 한 줄에 */
.week-month { font-size: 13px; color: var(--ink-soft); margin: 0 2px 8px; }
.week-stats.month { gap: 6px; }
.week-stats.month .week-stat { border: 0; font: inherit; color: inherit; text-align: center; padding: 10px 2px 9px; border-radius: 12px; cursor: pointer; }
.week-stats.month .week-stat:disabled { cursor: default; opacity: .55; }
.week-stats.month .week-stat .k { font-size: 12px; }
.week-stats.month .week-stat .v { font-size: 19px; margin-top: 4px; line-height: 24px; white-space: nowrap; }
.week-stats.month .week-stat .v small { font-size: 11px; margin-left: 1px; }
.week-stats.month .week-stat .v.wait { font-size: 12px; line-height: 24px; }
.week-stats.month.wide .week-stat .v { font-size: 15px; letter-spacing: -0.05em; }
@media (max-width: 340px) { .week-stats.month { gap: 4px; } .week-stats.month .week-stat .v { font-size: 16px; } .week-stats.month.wide .week-stat .v { font-size: 13px; } }
.week-stats.wide .week-stat .v em { display: inline-block; white-space: nowrap; font-size: 12px; margin-left: 4px; }
.week-note { margin-top: 10px; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
.report-table .nc, .report-note .nc { font-size: 11px; font-weight: 700; color: var(--new); margin-left: 3px; }
.report-note { margin: 8px 2px 0; font-size: 12px; color: var(--ink-soft); line-height: 1.45; }
/* 비교표 보여주기 재적 (2026-11-11) */
.show-roster-btn { border: 1px solid var(--line-soft); background: var(--card); color: var(--ink-soft); font: inherit; font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 999px; cursor: pointer; white-space: nowrap; }
.show-roster-btn.on { background: var(--brand-soft); color: var(--brand); border-color: transparent; }
.report-table td.roster-edit { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 3px; }
.week-stat.now .k, .week-stat.now .v { color: var(--brand); }
/* 교구판 교구목사: 명단을 아직 안 적은 주일은 큰 0명 대신 차분한 글씨로 '명단 전'(칸 높이는 숫자 칸과 같게) */
.week-stat.now .v.wait { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; line-height: 33px; color: var(--ink-soft); }

.class-card { display: block; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line-soft); border-radius: 22px; box-shadow: var(--shadow); padding: 16px 18px 0; margin-bottom: 12px; color: var(--ink); cursor: pointer; font-family: inherit; transition: transform .12s ease; }
.class-card:active { transform: scale(0.98); }
.cc-top { display: flex; align-items: center; gap: 14px; padding-bottom: 14px; }
.cc-avatar { flex: 0 0 auto; width: 52px; height: 52px; border-radius: 50%; background: var(--soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 19px; }
.cc-main { flex: 1; min-width: 0; }
.cc-title { font-weight: 800; font-size: 17px; letter-spacing: -0.03em; }
.cc-sub { font-size: 13px; color: var(--ink-soft); margin-top: 3px; }
.class-card .chev { color: var(--ink-soft); font-size: 20px; }
.cc-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line-soft); padding: 12px 0 14px; font-size: 13px; color: var(--ink-soft); }
.cc-foot span { display: inline-flex; align-items: center; gap: 6px; }
/* 빠른메뉴: 스크롤 없이 한 줄에 균등 배치(관리자 6개도 한 화면) */
.home-quick { overflow: visible; margin: 0 0 6px; padding: 2px 0 8px; gap: 4px; }
.quick-btn { flex: 1 1 0; width: auto; min-width: 0; max-width: 76px; }
.home-quick { justify-content: space-between; }
.quick-ico { width: 56px; height: 56px; }
.week-check { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 12px; padding: 12px 4px 0; border: none; border-top: 1px solid var(--line-soft); background: none; font-family: inherit; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.week-check span { display: inline-flex; align-items: center; gap: 6px; }
.week-check.warn span:last-child { color: var(--danger); font-weight: 700; }

/* ===== 찬양팀 (praise.js) — .pr- 접두어로 격리 ===== */
.pr-weekbar { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 4px 0 12px; }
.pr-weekbar button { border: 1px solid var(--line); background: var(--card); color: var(--ink); width: 34px; height: 34px; border-radius: 10px; font-size: 18px; }
.pr-weekbar b { font-size: 15px; min-width: 84px; text-align: center; }
.pr-teamgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pr-teamcard { border: none; border-radius: 16px; padding: 16px 14px; text-align: left; background: var(--card); box-shadow: 0 1px 0 var(--line); border-top: 4px solid var(--praise); color: var(--ink); }
.pr-team-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.pr-team-sub { font-size: 12px; color: var(--ink-soft); }
.pr-staffline { font-size: 12.5px; color: var(--ink-soft); text-align: center; margin: 2px 0 8px; }
.pr-list { display: flex; flex-direction: column; gap: 8px; }
.pr-row { background: var(--card); border-radius: 14px; padding: 10px 12px; box-shadow: 0 1px 0 var(--line); }
.pr-top { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.pr-name { font-weight: 700; font-size: 15px; color: var(--ink); text-decoration: none; }
.pr-sub { font-size: 12px; color: var(--ink-soft); }
.pr-memo-btn { margin-left: auto; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 8px; font-size: 12px; padding: 3px 9px; }
.pr-memo-btn.has { border-color: var(--praise); color: var(--praise); font-weight: 700; }
.pr-line { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.pr-lab { width: 30px; flex-shrink: 0; font-size: 12px; color: var(--ink-soft); }
.pr-seg { display: flex; gap: 4px; flex: 1; flex-wrap: wrap; }
.pr-seg button { flex: 1; min-width: 38px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px; padding: 6px 4px; font-size: 13px; }
.pr-med button { min-width: 0; padding: 6px 0; }
.pr-seg button.on.ok { background: #C9E4D2; border-color: #6fb78a; color: #1f5c37; font-weight: 700; }
.pr-seg button.on.mid { background: #F3E3C0; border-color: #e0b45a; color: #6b4a0c; font-weight: 700; }
.pr-seg button.on.low { background: #F6D2CE; border-color: #e08a80; color: #8c2a22; font-weight: 700; }
.pr-memo { display: none; width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-size: 13px; background: var(--bg); color: var(--ink); font-family: inherit; box-sizing: border-box; }
.pr-row.memo-open .pr-memo { display: block; }
.pr-summary { display: flex; justify-content: space-between; gap: 6px; margin-top: 12px; padding: 9px 12px; background: #EDE1CF; border-radius: 10px; font-size: 12.5px; }
.pr-add { margin-top: 14px; }
.pr-add-body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.pr-add-body input { border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; font-size: 14px; background: var(--card); color: var(--ink); }
.pr-cand { border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 8px; padding: 9px 10px; font-size: 14px; text-align: left; width: 100%; margin-top: 4px; }
.pr-cand:disabled { opacity: 0.5; }
.pr-head { margin: 2px 0 10px; font-size: 16px; }
.pr-alert { background: #F6D2CE; color: #8c2a22; border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 6px; }
.pr-hist { background: var(--card); border-radius: 14px; padding: 10px; margin: 10px 0; box-shadow: 0 1px 0 var(--line); }
.pr-hist-row { display: grid; grid-template-columns: 34px repeat(8, 1fr); gap: 3px; align-items: center; margin-top: 4px; font-size: 10.5px; text-align: center; color: var(--ink-soft); }
.pr-hist-row i { display: block; height: 20px; line-height: 20px; border-radius: 4px; font-style: normal; font-size: 11px; background: var(--bg); color: var(--ink); }
.pr-hist-row i.c-ok { background: #C9E4D2; color: #1f5c37; }
.pr-hist-row i.c-mid { background: #F3E3C0; color: #6b4a0c; }
.pr-hist-row i.c-low { background: #F6D2CE; color: #8c2a22; }
.pr-hist-head { margin-top: 0; }
.pr-box { background: var(--card); border-radius: 14px; padding: 12px; margin-top: 10px; box-shadow: 0 1px 0 var(--line); }
.pr-box-h { font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.pr-memo-item { padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; white-space: pre-wrap; }
.pr-memo-item:first-of-type { border-top: none; }
.pr-vact { display: flex; gap: 10px; margin-top: 4px; }
.pr-vact button, .pr-staff-row button { border: none; background: transparent; color: var(--brand); font-size: 12px; padding: 0; }
.pr-staff-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pr-staff-add { display: flex; gap: 6px; margin-top: 10px; }
.pr-staff-add select { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 7px; background: var(--card); color: var(--ink); font-size: 13px; }

/* 결석자 등급·조치(교구판 4단계, FEATURES.absenceGrade) */
.absence-card { flex-wrap: wrap; }
.absence-card.grade-a { border-left-color: var(--danger); }
.absence-card.grade-b { border-left-color: var(--warn); }
.absence-card.is-done { opacity: .6; }
.grade-pill { display: inline-block; min-width: 20px; text-align: center; font-size: 11px; font-weight: 800; color: #fff; padding: 1px 6px; border-radius: 999px; vertical-align: 1px; }
.grade-pill.grade-a { background: var(--danger); }
.grade-pill.grade-b { background: var(--warn); }
.unassigned-badge { font-size: 10.5px; font-weight: 700; color: var(--danger); border: 1px solid var(--danger); padding: 1px 6px; border-radius: 999px; }
.unassigned-badge[hidden] { display: none; }
.absence-act { width: 100%; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.absence-act select { font: inherit; font-size: 13px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); }
.absence-done { display: inline-flex; gap: 5px; align-items: center; font-size: 13.5px; font-weight: 600; cursor: pointer; }
.absence-done input { width: 18px; height: 18px; accent-color: var(--present); }
.cause-card { padding: 4px 14px; margin-bottom: 16px; }
.cause-row { padding: 10px 0; }
.cause-row + .cause-row { border-top: 1px solid var(--line); }
.cause-label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.cause-line { display: flex; gap: 8px; margin-top: 6px; }
.cause-line input { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); }

/* 교우 동정(교구판 7단계, FEATURES.fellowship) */
.fw-week { cursor: default; }
.fw-empty { padding: 16px; color: var(--ink-soft); font-size: 13.5px; }
.fw-row { align-items: flex-start; text-align: left; }
.fw-kind { display: inline-block; font-size: 12px; font-weight: 800; color: var(--brand); background: var(--brand-soft); border-radius: 999px; padding: 2px 8px; margin-right: 2px; vertical-align: 1px; }
.fw-text { font-size: 14px; line-height: 1.5; margin-top: 4px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }
.btn.fw-add { width: calc(100% - 24px); margin: 10px 12px 12px; }
.cause-line textarea.fw-note { flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--card); color: var(--ink); resize: vertical; }

/* 교구·구역 이동·새가족 등록(교구판, FEATURES.memberMove) */
.mv-zones .chip small { font-weight: 500; opacity: .75; margin-left: 2px; }
.mv-zones .chip:disabled { opacity: .35; }
.mv-sum { font-size: 14px; line-height: 1.55; margin: 6px 0 0; min-height: 20px; }
.mv-out { font-size: 12.5px; color: var(--ink-soft); }
.mv-out.mv-warn { color: var(--danger); font-weight: 600; }
/* 교구판 성도 수정 창: 소속은 고르는 칸 대신 글자로만(옮길 땐 이동 창) */
.field-static { padding: 10px 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: 14.5px; color: var(--ink); }
.field-static-hint { display: block; margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
/* 교구판 홈: 수정 기간이 지나 못 올린 출석(app.js lateAttHomeCard_) — 빨간 경고색 대신 노란 띠(잘못이 아니라 '관리자에게 넘길 것') */
.late-att-card { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--warn); border-radius: 14px; padding: 14px 14px 12px; margin: 0 0 16px; }
.late-att-title { font-size: 15.5px; font-weight: 800; color: var(--ink); }
.late-att-desc { font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); margin: 6px 0 8px; }
.late-att-day { font-size: 13.5px; line-height: 1.5; margin-top: 4px; }
.late-att-day span { display: block; font-size: 12.5px; color: var(--ink-soft); }
.late-att-acts { display: flex; gap: 8px; margin-top: 10px; }
.late-att-text { width: 100%; box-sizing: border-box; margin-top: 10px; min-height: 96px; font: inherit; font-size: 12.5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); }
/* 교구판 홈: 주일 출석 숫자 먼저(app.js appendHeadcountHomeCard_ · headcountRowEl_) — 큰 숫자 칸 하나 + 버튼 하나 */
.hc-card { padding: 16px 16px 14px; margin: 0 0 16px; overflow: visible; }
.hc-title { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-size: 17px; font-weight: 800; color: var(--ink); }
.hc-title span { font-size: 13.5px; font-weight: 600; color: var(--ink-soft); }
.hc-row { margin-top: 12px; }
.hc-row + .hc-row { padding-top: 12px; border-top: 1px solid var(--line); }
.hc-g { font-size: 13.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 6px; }
.hc-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.hc-line input { flex: 0 1 132px; min-width: 96px; width: 132px; min-height: 54px; box-sizing: border-box; font: inherit; font-size: 26px; font-weight: 800; text-align: center; padding: 6px 8px; border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--ink); -moz-appearance: textfield; }
.hc-line input::-webkit-outer-spin-button, .hc-line input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hc-line input::placeholder { font-size: 17px; font-weight: 600; color: var(--ink-soft); opacity: 0.6; }
.hc-line input:focus { outline: none; border-color: var(--brand); }
.hc-unit { font-size: 16px; font-weight: 700; color: var(--ink-soft); }
.hc-line .btn { flex: 0 0 auto; width: auto; min-height: 54px; padding: 0 22px; font-size: 16.5px; margin-left: auto; }
.hc-done { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.hc-msg { font-size: 15.5px; line-height: 1.5; color: var(--ink); }
.hc-msg b { color: #2F7D4F; font-weight: 800; }
.hc-msg small { font-size: 12.5px; color: var(--ink-soft); font-weight: 500; }
.hc-hint { margin: 12px 0 0; font-size: 13px; line-height: 1.6; color: var(--ink-soft); }
.hc-admin { margin-top: 12px; padding-top: 4px; border-top: 1px solid var(--line-soft); }
.hc-admin > summary { display: flex; align-items: center; min-height: 44px; font-size: 13.5px; color: var(--ink-soft); cursor: pointer; }
.hc-admin .hc-line input { min-height: 46px; font-size: 20px; flex-basis: 110px; width: 110px; }
.hc-admin .hc-line .btn { min-height: 46px; font-size: 15px; padding: 0 18px; }
/* 교구판 심방 쓰기 창 맨 위 '심방한 날' 요일 칩(app.js visitDayFieldHtml_) */
.visit-day .day-chips { gap: 6px; margin-bottom: 8px; }
.visit-day .day-chip { padding-left: 12px; padding-right: 12px; }
.mv-find { padding: 12px; }
.mv-find input[type="search"] { width: 100%; font: inherit; font-size: 15px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); box-sizing: border-box; }
.mv-find .list-row { width: 100%; text-align: left; }
.mv-row { align-items: center; }
.mv-row .row-title { cursor: pointer; }
.mv-acts { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }
.mv-acts .btn-small.secondary { background: var(--brand-soft); color: var(--brand); }
.mv-ok { font-size: 12px; font-weight: 700; color: var(--present); }
.mv-wait { font-size: 12px; color: var(--ink-soft); }
.mv-hist { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin: -8px 0 16px; }

/* ---------- PC 명단 표 (#/table, FEATURES.rosterTable — 교구판) ---------- */
body.wide-page #app { max-width: 1100px; }
.rt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }
.rt-bar select, .rt-bar input[type="date"], .rt-bar input[type="search"] { font: inherit; font-size: 14px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); }
.rt-bar input[type="search"] { width: 130px; }
.rt-title { font-weight: 800; font-size: 15px; }
.rt-check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-soft); }
.rt-bar .stat-pill { margin-left: auto; }
.rt-locked { font-size: 12.5px; color: var(--ink-soft); margin: -4px 0 10px; }
.rt-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; background: var(--card); border-radius: 14px; border: 1px solid var(--line); }
.rt-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
/* PC(넓은 화면): 표 칸 안에서 세로로 넘겨 머리줄(구역·이름·주일 날짜)이 계속 보이게.
   .rt-wrap이 가로 넘김(overflow-x) 칸이라 th의 sticky는 이 칸 기준 — 칸이 세로로 안 넘어가면 페이지를 내릴 때 머리줄이 같이 올라가 버렸음.
   폰은 그대로(칸 안 세로 넘김은 좁은 화면에서 손가락이 걸림). */
@media (min-width: 900px) and (min-height: 560px) { .rt-wrap { max-height: calc(100vh - 210px); overflow-y: auto; } }
.rt-table th { position: sticky; top: 0; background: var(--bg); font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: left; padding: 8px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; z-index: 1; }
.rt-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.rt-table tbody tr:hover td { background: rgba(0,0,0,0.025); }
.rt-table .rt-wk { text-align: center; width: 54px; }
.rt-table .rt-now { text-align: center; }
.rt-name a { color: inherit; text-decoration: none; font-weight: 700; }
.rt-tag { display: inline-block; margin-left: 5px; font-size: 10.5px; font-weight: 700; padding: 1px 5px; border-radius: 6px; background: var(--line); color: var(--ink-soft); vertical-align: 1px; }
.rt-tag.nc { background: var(--g1-soft); color: var(--g1); }
.rt-role { color: var(--ink-soft); font-size: 12.5px; }
.rt-btns { display: inline-flex; gap: 3px; }
.rt-b { width: 32px; height: 28px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink-soft); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; padding: 0; }
.rt-b:disabled { opacity: 0.45; cursor: default; }
.rt-b.on-present { background: var(--present); border-color: transparent; color: #fff; }
.rt-b.on-late { background: var(--late); border-color: transparent; color: #fff; }
.rt-b.on-absent { background: var(--absent); border-color: transparent; color: #fff; }
.rt-m { color: var(--ink-soft); font-weight: 700; }
.rt-m.m-present { color: var(--present); }
.rt-m.m-late { color: var(--late); }
.rt-m.m-absent { color: var(--absent); }
.rt-empty { text-align: center; color: var(--ink-soft); padding: 24px 8px !important; }
.rt-open { color: var(--present); font-weight: 600; }
/* 교구판 출석 빨리 적기(FEATURES.quickAtt) — 빈 칸 [출석][결석] 한 번 누르기 · '나머지 한 번에' 카드. 새 선택자만(기존 규칙은 그대로). */
.att-quick { display: inline-flex; gap: 6px; flex-shrink: 0; }
.att-q { min-width: 54px; min-height: 44px; padding: 8px 10px; border: 1.5px solid var(--present); border-radius: 12px; background: #fff; color: var(--present); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.att-q.q-absent { border-color: var(--line); color: var(--ink-soft); }
.att-q:active { background: var(--present); color: #fff; transform: scale(0.97); }
.att-q.q-absent:active { background: var(--absent); border-color: var(--absent); color: #fff; }
/* 교구 이동: 그 주일엔 다른 교구 소속이던 성도의 출석 칸(단추 대신 글자 — 그때 소속 교구 몫) */
.att-elsewhere { flex-shrink: 0; font-size: 12px; color: var(--ink-soft); padding: 8px 4px; white-space: nowrap; }
.att-toggle.att-away { opacity: .6; }   /* 적힌 칸인데 그 주일엔 다른 교구 소속 — 여기서는 못 고침(누르면 이유를 알림) */
.fill-card { margin: 12px 0 0; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; }
.fill-card.is-done { border-color: var(--present); }
.fill-title { font-size: 15px; font-weight: 700; color: var(--ink); }
.fill-title b { font-weight: 800; }
.fill-btns { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fill-btns .btn { flex: 1 1 200px; min-height: 48px; }
.fill-hint { margin: 10px 0 0; font-size: 12.5px; line-height: 1.55; color: var(--ink-soft); }
.fill-undo { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.fill-undo .btn-small { border: 1px solid var(--line); min-height: 44px; }
/* PC 명단 표 위: 한 줄로 낮게(표가 내려가지 않게), 안내문은 생략 */
.rt-fill .fill-card { margin: 0 0 10px; padding: 10px 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.rt-fill .fill-btns { margin-top: 0; flex: 1 1 auto; }
.rt-fill .fill-btns .btn { flex: 0 1 auto; min-height: 40px; padding: 9px 14px; font-size: 13.5px; }
.rt-fill .fill-hint { display: none; }
.rt-fill .fill-undo { margin: 0; }
@media (min-width: 900px) and (min-height: 560px) { .rt-fill:not(:empty) + .rt-wrap { max-height: calc(100vh - 275px); } }

/* 보기 전용 모드(교구판 — 담임 화면 안에서 교구목사 화면 둘러보기, app.js VIEW_ONLY): 설정·설치 안내 숨김 + 화면을 덮는 안내 */
body.view-only #settings-btn { visibility: hidden; }
body.view-only #install-banner, body.view-only #sync-banner { display: none; }
body.view-only .att-toggle[data-status=""] { opacity: .6; }
#view-cover { position: fixed; inset: 0; z-index: 9000; background: var(--bg, #FAF7F2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; text-align: center; }
#view-cover .vc-title { font-size: 20px; font-weight: 800; color: var(--ink, #2E2A26); }
#view-cover .vc-sub { font-size: 16px; line-height: 1.55; color: var(--ink-soft, #7A6A58); }
#view-cover .btn { margin-top: 8px; min-height: 52px; padding: 12px 28px; font-size: 16px; }

/* 교구판 교역자 계정 관리(FEATURES.staffAdmin) — 연락처 수정 창 아래 '로그인 · 맡은 교구' 칸 */
.staff-box { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.staff-box:empty { display: none; }
.staff-title { font-weight: 800; font-size: 15px; margin-bottom: 6px; }
.staff-state { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 12px; line-height: 1.5; }
.staff-state.blocked { color: var(--danger); font-weight: 700; }
.staff-hint { font-weight: 500; opacity: .8; margin-left: 4px; }
.staff-box .chip { min-height: 44px; padding: 10px 16px; }
.staff-btn { width: 100%; min-height: 48px; margin-top: 10px; }
.staff-btn.staff-danger { background: #fff; color: var(--danger); border: 1px solid var(--danger); box-shadow: none; }
.staff-btn:disabled { opacity: .45; }
.staff-note { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 0; line-height: 1.5; }
.staff-msg { font-size: 13px; color: var(--ink-soft); min-height: 16px; margin: 8px 0 0; line-height: 1.5; }
.staff-msg.err { color: var(--danger); font-weight: 700; }
/* 방금 발급한 PIN — 이 창이 열려 있는 동안 한 번만 보임 */
.staff-pin { margin: 0 0 12px; padding: 14px 14px 4px; border: 2px solid var(--brand); border-radius: 14px; background: var(--brand-soft); text-align: center; }
.staff-pin-label { font-size: 13px; font-weight: 700; color: var(--brand); }
.staff-pin-num { font-size: 34px; font-weight: 800; letter-spacing: 6px; color: var(--ink); margin: 6px 0 4px; user-select: all; -webkit-user-select: all; font-variant-numeric: tabular-nums; }
.staff-pin-note { font-size: 13.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; text-align: left; }
