/* 함께 돌봄 5.0 — 화면 디자인
   모든 색은 테마의 강조색(--accent-l / --accent-d, theme.js가 넣음)에서 만들어집니다.
   글꼴(--font)과 기본 글자 크기(--base)도 테마가 정합니다. 밝은 화면·어두운 화면 모두 지원. */
:root {
  --accent-l: #2F5545; --accent-d: #7FC9A2;
  --font: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  --base: 17.5px;
  --accent: var(--accent-l);
  --on-accent: #ffffff;
  --bg: #fcf5e5; --gold: #d0b973;
  --surface: #ffffff;
  --surface-2: color-mix(in oklab, var(--accent) 4%, #f9f9f7);
  --ink: #29342f; --ink-2: #3a413d; --muted: #576059; /* 흐린 글씨도 어르신이 읽을 수 있게(대비 약 6:1) */
  --line: color-mix(in oklab, var(--accent) 9%, #e3e5e1);
  --line-strong: color-mix(in oklab, var(--accent) 14%, #cdd2cc);
  --accent-soft: color-mix(in oklab, var(--accent) 11%, #ffffff);
  --accent-softer: color-mix(in oklab, var(--accent) 6%, #ffffff);
  --accent-text: color-mix(in oklab, var(--accent) 88%, #000000);
  --ok: #1d7a4b; --ok-soft: #e2f3e9; --warn: #9a5800; --warn-soft: #fdf0d9; --bad: #b3261e; --bad-soft: #fce8e6;
  --shadow-sm: 0 1px 2px rgb(20 28 24 / .06);
  --shadow: 0 1px 2px rgb(20 28 24 / .05), 0 10px 28px -14px rgb(20 28 24 / .18);
  --shadow-lg: 0 2px 6px rgb(20 28 24 / .06), 0 24px 60px -20px rgb(20 28 24 / .28);
  --r-sm: 10px; --r: 14px; --r-lg: 20px;
  --focus: color-mix(in oklab, var(--accent) 35%, transparent);
  color-scheme: light;
}
/* 어두운 화면: 테마의 밝기가 "어둡게"이거나, "기기 설정 따라"이면서 기기가 어두운 모드일 때 */
:root[data-mode="dark"] {
    --accent: var(--accent-d); --on-accent: #0f1311;
    --bg: color-mix(in oklab, var(--accent) 5%, #101312);
    --surface: #181c1a; --surface-2: color-mix(in oklab, var(--accent) 5%, #1d2220);
    --ink: #edf0ee; --ink-2: #cfd6d2; --muted: #9ea8a3;
    --line: color-mix(in oklab, var(--accent) 10%, #2a302d); --line-strong: color-mix(in oklab, var(--accent) 16%, #39413d);
    --accent-soft: color-mix(in oklab, var(--accent) 18%, #181c1a); --accent-softer: color-mix(in oklab, var(--accent) 9%, #181c1a);
    --accent-text: var(--accent);
    --ok: #7fd3a4; --ok-soft: #1c3327; --warn: #f2bb6b; --warn-soft: #3a2c16; --bad: #f4a49c; --bad-soft: #3d2220;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 30px -14px rgb(0 0 0 / .6); --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
@media (prefers-color-scheme: dark) {
  :root[data-mode="auto"] {
    --accent: var(--accent-d); --on-accent: #0f1311;
    --bg: color-mix(in oklab, var(--accent) 5%, #101312);
    --surface: #181c1a; --surface-2: color-mix(in oklab, var(--accent) 5%, #1d2220);
    --ink: #edf0ee; --ink-2: #cfd6d2; --muted: #9ea8a3;
    --line: color-mix(in oklab, var(--accent) 10%, #2a302d); --line-strong: color-mix(in oklab, var(--accent) 16%, #39413d);
    --accent-soft: color-mix(in oklab, var(--accent) 18%, #181c1a); --accent-softer: color-mix(in oklab, var(--accent) 9%, #181c1a);
    --accent-text: var(--accent);
    --ok: #7fd3a4; --ok-soft: #1c3327; --warn: #f2bb6b; --warn-soft: #3a2c16; --bad: #f4a49c; --bad-soft: #3d2220;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4); --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 12px 30px -14px rgb(0 0 0 / .6); --shadow-lg: 0 24px 60px -20px rgb(0 0 0 / .7);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
:root { --fs-xs: max(13px, .78rem); /* 가장 작은 글씨도 13px 아래로 내려가지 않음 */ --fs-sm: .875rem; --fs-md: 1rem; --fs-lg: 1.15rem; --fs-xl: 1.4rem; --fs-2xl: 1.85rem; }
html[data-reading] { font-size: max(var(--base), 21px); }
html { font-size: var(--base); -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.6; letter-spacing: -0.006em; -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: break-word; } /* 한글은 낱말 단위로 줄바꿈. 이름·낱말은 중간에서 끊지 않음(칸이 좁아도 글자 단위로 쪼개지 않음) */
h1 { font-size: var(--fs-2xl); } h2 { font-size: var(--fs-lg); } h3 { font-size: var(--fs-md); }
h1, h2, h3 { line-height: 1.3; letter-spacing: -0.02em; text-wrap: balance; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
a { color: var(--accent-text); }
::selection { background: var(--accent-soft); }
:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--focus); }
.skip { position: absolute; left: -999px; } .skip:focus { left: 12px; top: 12px; background: var(--surface); padding: 10px 14px; border-radius: var(--r-sm); z-index: 50; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); } .small { font-size: var(--fs-sm); }

/* ── 버튼 */
button, .button {
  cursor: pointer; min-height: 48px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: var(--fs-md); display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s;
}
button:hover, .button:hover { border-color: color-mix(in oklab, var(--accent) 45%, var(--line-strong)); background: var(--accent-softer); }
button:active, .button:active { transform: translateY(1px); }
button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); box-shadow: var(--shadow-sm); }
.primary:hover { background: color-mix(in oklab, var(--accent) 88%, #000); border-color: transparent; }
.quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.quiet:hover { background: var(--accent-softer); border-color: transparent; }
.danger { color: var(--bad); }
.danger-fill { background: var(--bad); border-color: transparent; color: #fff; }
.big { min-height: 56px; font-size: var(--fs-md); border-radius: 14px; }
.link { min-height: 0; padding: 0; border: 0; background: none; color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; }
.link:hover { background: none; }

/* ── 입력 */
input, select, textarea { width: 100%; min-height: 48px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--focus); }
input::placeholder, textarea::placeholder { color: color-mix(in oklab, var(--muted) 75%, transparent); }
textarea { min-height: 96px; resize: vertical; line-height: 1.55; }
input[type=checkbox], input[type=radio] { width: 22px; height: 22px; min-height: 0; margin: 0; accent-color: var(--accent); flex: none; box-shadow: none; }
label { display: block; font-weight: 600; font-size: var(--fs-md); color: var(--ink-2); }
label > input, label > select, label > textarea { margin-top: 6px; color: var(--ink); font-weight: 400; }
label.inline { display: inline-flex; align-items: center; gap: 10px; }
label.inline select, label.inline input { margin: 0; width: auto; }
label.check { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 10px 0; color: var(--ink); }
.notice { background: var(--accent-softer); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin: 12px 0; color: var(--ink-2); }
.notice.small { font-size: var(--fs-sm); }

/* ── 로그인 */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-content: center; gap: 18px; padding: 32px max(16px, env(safe-area-inset-left));
  background: radial-gradient(60rem 30rem at 15% -10%, var(--accent-soft), transparent 60%), radial-gradient(40rem 24rem at 110% 110%, var(--accent-softer), transparent 60%), var(--bg); }
.login-card { width: min(420px, calc(100vw - 32px)); background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 32px 28px; display: grid; gap: 10px; box-shadow: var(--shadow-lg); }
.login-card h1 { margin: 6px 0 0; font-size: var(--fs-2xl); font-weight: 800; }
.login-card > p { margin: 0; }
.brand-mark { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 28px; box-shadow: var(--shadow); }
.brand-mark.sm { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; box-shadow: none; }
.stack { display: grid; gap: 8px; margin: 10px 0 4px; }
.stack label { margin-top: 4px; }
details.more { border-top: 1px solid var(--line); padding-top: 6px; }
details.more summary { cursor: pointer; color: var(--muted); font-weight: 600; min-height: 44px; display: flex; align-items: center; gap: 6px; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1.2em; }
details.more[open] summary::before { transform: rotate(90deg); }
.credit { text-align: center; color: var(--muted); font-size: var(--fs-xs); padding: 20px 16px calc(28px + env(safe-area-inset-bottom)); letter-spacing: .01em; }
.guide-link { text-align: center; font-size: var(--fs-sm); }

/* ── 앱 틀 */
.top { position: sticky; top: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
  padding: calc(10px + env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) 10px max(16px, env(safe-area-inset-left));
  background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: var(--fs-lg); letter-spacing: -0.02em; }
.ministry-tag { background: var(--accent-soft); color: var(--accent-text); border-radius: 99px; padding: 3px 11px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0; }
.who { flex: 1; min-width: 150px; font-size: var(--fs-sm); }
.top-acts { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.top-acts button { min-height: 40px; padding: 0 12px; font-size: var(--fs-sm); }
.top-acts button.primary { box-shadow: none; }
#syncState { margin-right: 6px; display: inline-flex; align-items: center; gap: 6px; }
#syncState::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.tabs { position: sticky; top: var(--top-h, 0); z-index: 19; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding: 8px max(16px, env(safe-area-inset-left)); background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { min-height: 40px; padding: 0 14px; border-color: transparent; background: transparent; color: var(--muted); font-size: var(--fs-sm); border-radius: 99px; }
.tabs button:hover { color: var(--ink); background: var(--accent-softer); }
.tabs button.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.page { max-width: 1040px; margin: 0 auto; padding: 28px max(16px, env(safe-area-inset-left)) 40px max(16px, env(safe-area-inset-right)); }
.eyebrow { color: var(--accent-text); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .08em; }
.page-title { font-size: var(--fs-2xl); font-weight: 800; margin: 4px 0 10px; }
.subtitle { color: var(--muted); margin: 0 0 18px; max-width: 62ch; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; margin: 16px 0; min-width: 0; box-shadow: var(--shadow); }
.card h2 { font-size: var(--fs-lg); font-weight: 750; margin: 0 0 14px; }
.card h3 { font-size: var(--fs-md); margin: 18px 0 8px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.acts { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; align-items: end; }
.two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.two .card { margin: 0; }
@media (max-width: 760px) { .two { grid-template-columns: 1fr; } .page-title { font-size: var(--fs-xl); } .card { padding: 18px; border-radius: 18px; } }

/* ── 흐름 표시: 1 → 2 → 3 */
.flow { list-style: none; padding: 0; margin: 6px 0 18px; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 6px; counter-reset: f; font-size: var(--fs-sm); } /* 단계 표시: 한 줄에 같은 너비로 */
.flow li { counter-increment: f; display: inline-flex; align-items: center; gap: 8px; font-weight: 600; white-space: nowrap; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: 99px; padding: 4px 12px 4px 5px; }
.flow li::before { content: counter(f); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-size: var(--fs-xs); font-weight: 800; }
.flow li:not(:last-child)::after { content: none; }
.flow.steps li.now { border-color: var(--accent); color: var(--accent-text); background: var(--accent-softer); }
.flow.steps li.now::before { background: var(--accent); color: var(--on-accent); }
.flow.steps li.done::before { content: "✓"; background: var(--accent); color: var(--on-accent); }
.flow.steps li:not(.now):not(.done) { color: var(--muted); }
.small-flow { font-size: var(--fs-xs); }
.small-flow li::before { width: 20px; height: 20px; font-size: var(--fs-xs); }

/* ── 목록 */
.list { display: grid; gap: 8px; }
.row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); transition: border-color .15s, background .15s; }
.row:hover { border-color: var(--line-strong); }
.row .grow { min-width: 0; }
.row > .acts { justify-content: flex-end; flex-wrap: nowrap; }
.row.pick { grid-template-columns: auto minmax(0, 1fr); }
.row .grow > b { font-size: var(--fs-md); }
.row .acts button, .row .acts .button { min-height: 40px; min-width: 4.5em; padding: 0 14px; font-size: var(--fs-sm); }
.row.pick { cursor: pointer; font-weight: 500; }
.row.pick.on, .row.pick:has(input:checked) { border-color: var(--accent); background: var(--accent-softer); }
.chip { display: inline-flex; align-items: center; font-size: var(--fs-xs); font-weight: 700; padding: 2px 9px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); vertical-align: 2px; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--bad-soft); color: var(--bad); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 14px 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; color: var(--muted); font-size: var(--fs-sm); box-shadow: var(--shadow-sm); }
.stat b { display: block; font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; letter-spacing: -0.03em; line-height: 1.2; }
.stat.bad b { color: var(--bad); } .stat.warn b { color: var(--warn); }
.error-list, .warn-list { padding-left: 1.2em; } .error-list li { color: var(--bad); } .warn-list li { color: var(--warn); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); margin: 12px 0; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: var(--fs-sm); }
th, td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; } /* 표의 칸은 한 줄로(넓으면 표를 옆으로 밀어 봄) */
td.long, th.long { white-space: normal; min-width: 14em; } /* 메모·오류처럼 긴 글만 여러 줄 */
th { background: var(--surface-2); font-weight: 700; color: var(--ink-2); font-size: var(--fs-sm); }
tr:last-child td { border-bottom: 0; }

/* ── 대화상자·알림 */
dialog { border: 1px solid var(--line); border-radius: 24px; padding: 26px; width: min(560px, calc(100vw - 24px)); max-height: calc(100dvh - 40px); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
dialog::backdrop { background: rgb(10 14 12 / .42); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.dialog-x { position: absolute; right: 12px; top: 12px; min-height: 40px; width: 40px; padding: 0; border: 0; border-radius: 50%; font-size: var(--fs-xl); background: transparent; color: var(--muted); }
.dialog-title { margin: 0 44px 14px 0; font-size: var(--fs-xl); font-weight: 800; }
.code-box { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--r); padding: 16px; margin: 14px 0; }
.code { font: 700 1.4rem/1.5 ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .04em; word-break: break-all; user-select: all; flex: 1; min-width: 0; color: var(--accent-text); }
#toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(20px + env(safe-area-inset-bottom)); max-width: min(560px, calc(100vw - 32px)); background: var(--ink); color: var(--surface); padding: 13px 18px; border-radius: 14px; z-index: 60; box-shadow: var(--shadow-lg); font-size: var(--fs-md); }
.badge { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: var(--fs-xs); font-weight: 800; }

/* ── 심방 화면 */
.notice-btn { width: 100%; justify-content: flex-start; background: var(--accent-soft); color: var(--accent-text); border-color: transparent; margin: 6px 0 10px; font-weight: 700; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 8px 0; }
.filters input { flex: 1; min-width: 200px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); margin: 6px 0; }
.seg.wrap { display: flex; }
.seg button { min-height: 40px; border-color: transparent; background: transparent; color: var(--muted); border-radius: 10px; font-size: var(--fs-sm); }
.seg button.active { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.seg button b { margin-left: 4px; font-variant-numeric: tabular-nums; }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; font-weight: 500; cursor: pointer; border-radius: 10px; color: var(--ink); }
.seg-opt:has(input:checked) { background: var(--accent-soft); color: var(--accent-text); font-weight: 700; }
.seg-opt input { width: 18px; height: 18px; }
.tpl-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-bottom: 12px; }
.tpl-grid button { flex-direction: column; align-items: flex-start; text-align: left; padding: 14px 16px; min-height: 96px; white-space: normal; gap: 4px; border-radius: var(--r); }
.tpl-grid button.active { border-color: var(--accent); background: var(--accent-softer); }
.sms-preview { white-space: pre-wrap; background: var(--accent-soft); color: var(--ink); border-radius: 20px 20px 20px 6px; padding: 14px 18px; margin: 12px 0; max-width: 520px; line-height: 1.6; }
.sticky-acts { position: sticky; bottom: env(safe-area-inset-bottom); background: var(--surface); padding: 12px 0 4px; border-top: 1px solid var(--line); margin-top: 12px; }
.field-set { border: 1px solid var(--line); border-radius: var(--r); padding: 8px 14px; margin: 6px 0; }
.field-set legend { font-weight: 600; padding: 0 6px; color: var(--ink-2); font-size: var(--fs-md); }
.choice-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.choice-grid .check { margin: 6px 0; }
.report-doc header { margin-bottom: 8px; }
.report-doc h2 { margin: 2px 0; }

/* ── 새가족 화면 */
.dots { list-style: none; display: flex; gap: 5px; padding: 0; margin: 8px 0 4px; }
.dots li { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line-strong); background: var(--surface); }
.dots li.done { background: var(--accent); border-color: var(--accent); }
.dots li.late { background: var(--bad-soft); border-color: var(--bad); }
.stage-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 6px; counter-reset: st; }
.stage-list li { counter-increment: st; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--r); }
.stage-list li::before { content: counter(st); width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line-strong); font-size: var(--fs-xs); font-weight: 800; flex: none; }
.stage-list li.done::before { content: "✓"; background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.stage-list li.late { border-color: var(--bad); }
.stage-list .grow { flex: 1; min-width: 160px; }
.stage-list .acts button { min-height: 40px; font-size: var(--fs-sm); }
.fel-grid { display: grid; gap: 2px; }
.note-list { display: grid; gap: 8px; margin: 8px 0; }
.note { border: 1px solid var(--line); border-radius: var(--r); padding: 10px 14px; background: var(--surface-2); }
.note p { margin: 4px 0; }
.note.req { border-color: color-mix(in oklab, var(--warn) 50%, var(--line)); background: var(--warn-soft); }

/* ── 테마 설정 화면 */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.swatch { flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; min-height: 0; height: auto; border-radius: var(--r); white-space: normal; }
.swatch .chipset { display: flex; gap: 4px; }
.swatch .chipset i { flex: 1; height: 26px; border-radius: 8px; }
.swatch.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.fontlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.fontopt { flex-direction: column; align-items: flex-start; gap: 2px; padding: 14px 16px; min-height: 0; height: auto; white-space: normal; text-align: left; border-radius: var(--r); }
.fontopt .sample { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.fontopt.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--focus); }
.preview-card { border: 1px solid var(--line); border-radius: var(--r-lg); padding: 18px; background: var(--bg); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print {
  body { background: #fff; color: #000; }
  .top, .tabs, .credit, #toast, .no-print, .filters, .seg { display: none !important; }
  .page { padding: 0; max-width: none; }
  .card { border: 0; padding: 0; box-shadow: none; }
  .stat { border-color: #999; box-shadow: none; }
}
.who-login { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.who-login span { font-size: var(--fs-xs); font-weight: 700; padding: 4px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent-text); }
/* 좁은 화면: 머리글을 두 줄로(1줄: 이름표·버튼, 2줄: 사용자) */
@media (max-width: 640px) {
  .top { gap: 4px 8px; padding-bottom: 8px; }
  .brand { font-size: var(--fs-md); }
  .top-acts { margin-left: auto; gap: 2px; }
  .top-acts button { padding: 0 9px; }
  #syncState { font-size: 0; margin-right: 2px; }
  .who { order: 3; flex-basis: 100%; font-size: var(--fs-sm); min-width: 0; }
}
@media (max-width: 640px) { #syncState { display: none; } } /* 휴대폰에서도 단추 글자(새로고침 등)는 그대로 보입니다 */

/* 새가족 진행 그림 */
.name-link { all: unset; cursor: pointer; font-weight: 800; color: var(--ink); border-bottom: 2px solid var(--accent-soft); }
.name-link:hover, .name-link:focus-visible { color: var(--accent-text); border-bottom-color: var(--accent); }
.nc-steps { margin-top: 8px; } .nc-steps > summary { cursor: pointer; font-weight: 700; color: var(--ink-2); padding: 4px 0; }
.stepper { list-style: none; margin: 12px 0 8px; padding: 4px 0 8px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); overflow-x: auto; }
.stepper li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 0 4px; font-size: var(--fs-sm); word-break: keep-all; }
.stepper li::before { content: ""; position: absolute; top: 16px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 3px; border-radius: 2px; background: var(--line); }
.stepper li:first-child::before { content: none; }
.stepper li.done::before { background: var(--accent); } .stepper li.now::before, .stepper li.late::before { background: var(--accent-soft); }
.stepper .node { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 3px solid var(--line-strong); background: var(--surface); color: var(--on-accent); font-weight: 900; flex: none; }
.stepper li.done .node { background: var(--accent); border-color: var(--accent); }
.stepper li.now .node { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-softer); }
.stepper li.late .node { border-color: var(--bad); background: var(--bad-soft); }
.stepper li.todo .node { border-style: dashed; }
.stepper b { font-size: var(--fs-sm); line-height: 1.25; } .stepper li.todo b { color: var(--ink-3, var(--ink-2)); font-weight: 600; }
.stepper li.late b, .stepper li.late .sub { color: var(--bad); } .stepper li.now b { color: var(--accent-text); }
.stepper .sub { color: var(--ink-2); font-size: var(--fs-xs); }
.pips { display: flex; gap: 2px; flex-wrap: nowrap; justify-content: center; }
.pips i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); } .pips i.on { background: var(--accent); }
.edu-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0; }
.edu-quick > b { margin-right: 4px; min-width: 70px; }
.edu-quick button { padding: 6px 12px; min-height: 36px; font-size: var(--fs-sm); }
.edu-quick button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.edu-quick button.on::before { content: "✓ "; }

.admin-district { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; max-width: var(--page-w, 1080px); margin: 12px auto 0; padding: 10px 16px; border-radius: 14px; background: var(--accent-softer); border: 1px solid var(--line); }
.admin-district label { display: flex; align-items: center; gap: 8px; font-weight: 700; } .admin-district select { width: auto; min-width: 140px; }

/* 최고 관리자: 큰 영역 5개 + 영역 안의 작은 탭 */
.admin-shell { display: grid; grid-template-columns: 236px minmax(0, 1fr); max-width: 1360px; margin: 0 auto; align-items: start; }
.areas { position: sticky; top: var(--top-h, 0); display: grid; grid-auto-rows: auto; gap: 4px; padding: 20px 12px 20px 16px; }
.area-btn { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: center; justify-content: stretch; justify-items: start; column-gap: 12px; width: 100%; min-height: 60px; padding: 10px 14px; border: 1px solid transparent; border-radius: 14px; background: transparent; color: var(--ink-2); text-align: left; white-space: normal; box-shadow: none; }
.area-btn .ico { width: 24px; height: 24px; justify-self: center; }
.area-text { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; } .area-text b { font-size: var(--fs-md); line-height: 1.25; color: var(--ink); }
.area-hint { font-size: var(--fs-xs); line-height: 1.3; color: var(--muted); font-weight: 500; }
.area-btn:hover { background: var(--accent-softer); }
.area-btn.active { background: var(--surface); border-color: var(--line); color: var(--accent); box-shadow: 0 4px 14px rgb(0 0 0 / .05); }
.area-btn.active b { color: var(--accent-text); }
.admin-main { min-width: 0; }
.area-bar { position: sticky; top: var(--top-h, 0); z-index: 15; padding: 14px max(16px, env(safe-area-inset-left)) 10px; background: color-mix(in oklab, var(--bg) 92%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; } .subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; min-height: 38px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font-size: var(--fs-sm); box-shadow: none; }
.subtabs button.active { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 700; }
.subdesc { margin: 8px 2px 0; font-size: var(--fs-sm); color: var(--muted); }
.admin-shell .page { margin: 0; max-width: 1040px; padding-top: 22px; }
.admin-shell .admin-district { margin: 16px max(16px, env(safe-area-inset-left)) 0; max-width: 1008px; }
@media (max-width: 900px) {
  .admin-shell { display: block; padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
  .areas { position: fixed; top: auto; left: 0; right: 0; bottom: 0; z-index: 40; gap: 0; padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgb(0 0 0 / .06); }
  .areas { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .area-btn { grid-template-columns: 1fr; grid-template-rows: 24px auto; justify-items: center; row-gap: 3px; min-height: 58px; padding: 6px 2px; border-radius: 12px; text-align: center; }
  .area-text { align-items: center; }
  .area-btn .ico { width: 24px; height: 24px; } .area-text b { font-size: var(--fs-xs); color: inherit; } .area-hint { display: none; }
  .area-btn.active { background: var(--accent-soft); border-color: transparent; box-shadow: none; }
  .area-bar { padding: 10px 16px 8px; }
  .admin-shell ~ .credit { padding-bottom: calc(90px + env(safe-area-inset-bottom)); }
}
@media print { .areas, .area-bar { display: none !important; } .admin-shell { display: block; } }

.update-bar { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80; display: flex; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 16px; background: var(--ink); color: var(--bg); box-shadow: 0 10px 30px rgb(0 0 0 / .2); font-weight: 700; max-width: calc(100% - 32px); }
.update-bar button { min-height: 40px; }

/* 휴대폰: 목록 줄은 정보 위 · 단추 아래(왼쪽 맞춤), 단추가 많으면 다음 줄로 */
@media (max-width: 640px) {
  .row { grid-template-columns: minmax(0, 1fr); }
  /* 단추는 같은 너비 칸에: 기본 2칸, 새가족 4칸, 교구 성도 3칸. "다음 할 일" 단추는 한 줄 전체 */
  .row > .acts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .row.nc-row > .acts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .row > .acts > button, .row > .acts > .button { width: 100%; min-width: 0; padding: 0 6px; white-space: normal; line-height: 1.2; }
  .row > .acts > [data-next] { grid-column: 1 / -1; }
  .row.pick { grid-template-columns: auto minmax(0, 1fr); }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 새가족 카드(현황판) — 동그라미 40px + 간격 14px = 글자 시작선 54px. 이름·정보·다음·펼침이 모두 이 선에서 시작 */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 6px; }
.page-head .page-title { margin-bottom: 0; }
.filters select { width: 200px; flex: none; }
.nc-list { padding: 0; overflow: hidden; }
.nc-empty { padding: 20px 22px; margin: 0; }
.nc-card { --av: 40px; --gap: 14px; padding: 18px 20px; }
.nc-card + .nc-card { border-top: 1px solid var(--line); }
.nc-top { display: grid; grid-template-columns: var(--av) minmax(0, 1fr) auto; column-gap: var(--gap); align-items: center; }
.av { width: var(--av, 40px); height: var(--av, 40px); border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-text); font-weight: 800; font-size: var(--fs-md); }
.nc-title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; line-height: 1.3; }
.nc-title .name-link { font-size: var(--fs-lg); }
.nc-title .muted { font-size: var(--fs-sm); }
.nc-meta { margin-top: 4px; font-size: var(--fs-sm); color: var(--muted); }
.nc-icons { display: grid; grid-auto-flow: column; grid-auto-columns: 40px; gap: 4px; }
.ib { width: 40px; height: 40px; min-height: 40px; padding: 0; border: 0; border-radius: 12px; background: transparent; color: var(--ink-2); display: grid; place-items: center; box-shadow: none; }
.ib:hover { background: var(--accent-softer); color: var(--accent-text); }
.ib:disabled { opacity: .3; background: transparent; }
.nc-next, .nc-steps { margin-left: calc(var(--av) + var(--gap)); }
.nc-next { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: var(--fs-md); color: var(--ink-2); }
.nc-next b { color: var(--ink); }
.nc-next button { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); flex: none; }
.nc-steps { margin-top: 10px; }
.nc-steps > summary { font-size: var(--fs-sm); color: var(--accent-text); }
.edu-row { display: grid; grid-template-columns: 88px minmax(0, 1fr); column-gap: 12px; align-items: start; margin-top: 10px; }
.edu-row > b { font-size: var(--fs-sm); color: var(--ink-2); line-height: 36px; }
.edu-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.edu-btns button { min-height: 36px; padding: 0 12px; font-size: var(--fs-sm); border-radius: 10px; box-shadow: none; }
.edu-btns button.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.edu-btns button.on::before { content: "✓ "; }
.edu-btns .tpl-chip { border-radius: 99px; background: var(--surface); }
.edu-btns .tpl-chip.next { background: var(--warn-soft); border-color: color-mix(in oklab, var(--warn) 45%, transparent); color: var(--warn); font-weight: 700; }
@media (max-width: 640px) {
  .nc-card { --av: 36px; --gap: 12px; padding: 16px; }
  .nc-top { grid-template-columns: var(--av) minmax(0, 1fr); }
  .nc-icons { grid-column: 1 / -1; grid-auto-columns: minmax(0, 1fr); margin-top: 10px; }
  .ib { width: 100%; border: 1px solid var(--line); }
  .nc-next, .nc-steps { margin-left: 0; }
  .nc-next { flex-direction: column; align-items: stretch; }
  .edu-row { grid-template-columns: minmax(0, 1fr); row-gap: 6px; }
  .edu-row > b { line-height: 1.4; }
  .edu-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .edu-btns.fellowship { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .edu-btns button { padding: 0 6px; white-space: normal; line-height: 1.2; }
  .nc-steps .stepper { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 16px; overflow: visible; }
  .nc-steps .stepper li::before { content: none; }
  .filters select { width: 100%; }
}
.section-title { margin: 24px 0 10px; font-size: var(--fs-lg); }

/* 문자 보내기: 보내는 사람 서명 */
.sender { border: 1px solid var(--line-strong); border-radius: 14px; padding: 12px 16px 6px; margin: 14px 0 4px; }
.sender legend { padding: 0 6px; font-weight: 700; }
.sender-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-top: 8px; }
.sender-grid[hidden], .sender label[hidden] { display: none; }
.sender #sdLine { margin: 10px 0 6px; }

/* 담당자 관리: 교구별 한눈에 + 묶음 목록 */
table.overview { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.overview th, table.overview td { padding: 10px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.overview thead th { color: var(--muted); font-weight: 700; white-space: nowrap; }
table.overview tbody th { white-space: nowrap; }
table.overview td.num, table.overview th.num { text-align: right; font-variant-numeric: tabular-nums; width: 3.5em; }
table.overview tr.team { background: var(--accent-soft); }
.name-chip { display: inline-flex; align-items: center; margin: 2px 4px 2px 0; padding: 3px 10px; min-height: 30px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.name-chip:hover { border-color: var(--accent); }
.name-chip.off { color: var(--muted); text-decoration: line-through; background: transparent; }
.staff-group { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 14px; }
.staff-group:first-child { border-top: 0; margin-top: 0; padding-top: 0; }
.staff-group h3 { margin: 0 0 6px; }
.role-head { margin: 10px 0 4px; font-size: var(--fs-xs); font-weight: 700; color: var(--accent-text); letter-spacing: .02em; }
.row.flash { outline: 3px solid var(--accent); outline-offset: 2px; transition: outline-color .3s; }
#staffListCard .filters { display: flex; flex-wrap: wrap; gap: 8px; }
#staffListCard .filters select, #staffListCard .filters input { width: auto; min-width: 120px; }

/* 새가족 진행 점검(카드) */
.nc-check { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; padding-left: calc(var(--av, 40px) + var(--gap, 14px)); }
.ck { display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 3px 10px; border-radius: 99px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--muted); font: inherit; font-size: var(--fs-xs); font-weight: 700; line-height: 1.2; }
.ck small { font-weight: 500; opacity: .9; }
.ck i { font-style: normal; font-weight: 800; }
.ck.done { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.ck.late { background: var(--bad-soft); border-color: transparent; color: var(--bad); }
button.ck { cursor: pointer; } button.ck:hover { border-color: var(--accent); }
@media (max-width: 640px) { .nc-check { padding-left: 0; } }
/* 새가족 표로 한눈에 */
table.nc-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
table.nc-table th, table.nc-table td { padding: 8px 8px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
table.nc-table thead th { color: var(--muted); font-size: var(--fs-xs); position: sticky; top: 0; background: var(--surface); }
table.nc-table tr.paused td { opacity: .55; }
.ck-cell i { font-style: normal; font-weight: 800; margin-right: 3px; }
.ck-cell.done { color: var(--ok); } .ck-cell.late { color: var(--bad); font-weight: 700; } .ck-cell.todo { color: var(--muted); }
.ck-btn { all: unset; cursor: pointer; padding: 4px 6px; border-radius: 8px; min-width: 28px; min-height: 28px; display: inline-flex; align-items: center; }
.ck-btn:hover, .ck-btn:focus-visible { background: var(--accent-soft); outline: 2px solid var(--accent); outline-offset: -2px; }

/* 겸직: 맡은 역할 바꾸기 */
.role-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; padding: 8px max(16px, env(safe-area-inset-left)); background: var(--surface); border-bottom: 1px solid var(--line); }
.role-bar-label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.role-bar .seg { margin: 0; }
/* 휴대폰: 역할 단추를 같은 너비로 한 줄에(글자가 길면 단추 안에서 줄바꿈) */
@media (max-width: 640px) {
  .role-bar { display: grid; gap: 6px; }
  .role-bar .seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
  .role-bar .seg button { white-space: normal; line-height: 1.25; padding: 6px 8px; min-height: 48px; }
}
.admin-district.lead { margin: 12px max(16px, env(safe-area-inset-left)) 0; }
@media (min-width: 1072px) { .admin-district.lead { margin: 12px auto 0; max-width: 1008px; } }
.extras { margin: 4px 0 0; }
.extras .choice-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
/* 꼭 읽어야 하는 안내는 진한 글씨로 */
.login-card .must { color: var(--ink-2); }

/* 한 줄 규칙: 이름표·칩·버튼 글자·이름은 줄을 바꾸지 않음 */
.chip, .name-chip, .ministry-tag, .badge, .row .grow > b, .area-text b, .subtabs button, .tabs button, .seg button, .role-bar-label { white-space: nowrap; }
@media (max-width: 760px) { .flow { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(max(140px, 30%), 1fr)); } .flow li { min-width: 0; } }
td .code { white-space: nowrap; word-break: normal; font-size: var(--fs-md); } /* 표 안의 코드는 한 줄로 */
.area-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
/* 목록 한 줄: 설명 줄은 한 줄로(넘치면 … , 전체는 손가락을 대면 보임), 단추는 같은 너비 */
.row .grow { overflow: hidden; }
.one-line { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row > .acts button, .row > .acts .button { min-width: 6.5em; }

/* ── 통계(인포그래픽): 같은 크기의 숫자 칸, 한 가지 색 막대, 한 줄 이름표 */
.st-bar { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between; margin: 4px 0 8px; }
.st-bar .seg { margin: 0; }
.st-sec { font-size: var(--fs-xl); font-weight: 800; margin: 28px 0 10px; scroll-margin-top: calc(var(--top-h, 0px) + 64px); }
.st-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0 0 16px; }
.st-tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; min-width: 0; box-shadow: var(--shadow-sm); }
.st-tile .st-label { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.st-tile b { font-size: var(--fs-2xl); font-weight: 800; line-height: 1.15; color: var(--accent-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-tile .st-sub { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-tile.warn b { color: var(--bad); }
.st-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.st-grid .card { margin: 0; } .st-grid .wide { grid-column: 1 / -1; }
.st-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.st-head h2 { margin: 0; white-space: nowrap; } .st-head .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-hbars { display: grid; gap: 8px; }
.st-hrow { display: grid; grid-template-columns: minmax(7em, 34%) minmax(0, 1fr) 4.5em; align-items: center; gap: 10px; font-size: var(--fs-sm); }
.st-hlabel { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-2); font-weight: 600; }
.st-track { height: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.st-track i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.st-hbars.bad .st-track i { background: var(--bad); }
.st-hval { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.st-vbars { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 6px; height: 190px; }
.st-vcol { display: grid; grid-template-rows: 1.5em minmax(0, 1fr) 1.7em; height: 100%; text-align: center; min-width: 0; }
.st-vval { font-size: var(--fs-xs); font-weight: 700; color: var(--ink-2); align-self: end; white-space: nowrap; }
.st-vbar { display: flex; align-items: flex-end; justify-content: center; border-bottom: 1px solid var(--line-strong); }
.st-vbar i { display: block; width: min(28px, 72%); background: var(--accent); border-radius: 4px 4px 0 0; }
.st-vlabel { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; overflow: visible; padding-top: 4px; display: flex; justify-content: center; }
.st-vcol:hover .st-vbar i, .st-hrow:hover .st-track i { filter: brightness(.88); }
.st-ringrow { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: center; gap: 18px; margin-bottom: 14px; }
.st-ring { position: relative; width: 132px; height: 132px; }
.st-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.st-ring circle { fill: none; stroke-width: 12; } .st-ring .t { stroke: var(--surface-2); } .st-ring .v { stroke: var(--accent); stroke-linecap: round; }
.st-ring span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.st-ring b { font-size: var(--fs-xl); font-weight: 800; font-variant-numeric: tabular-nums; } .st-ring small { font-size: var(--fs-xs); color: var(--muted); }
.st-card .st-vbars + .st-hbars { margin-top: 16px; }
.st-good { color: var(--ok); font-weight: 700; margin: 0; }
.st-note { font-size: var(--fs-xs); color: var(--muted); margin: 6px 0 0; }
.st-tip { position: fixed; z-index: 90; pointer-events: none; background: var(--ink); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: var(--fs-sm); white-space: nowrap; box-shadow: var(--shadow); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .st-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } .st-grid { grid-template-columns: 1fr; } .st-ringrow { grid-template-columns: 110px minmax(0, 1fr); } .st-ring { width: 110px; height: 110px; } .st-vbars { height: 160px; } }
@media print { .st-tiles { grid-template-columns: repeat(4, 1fr); } .st-grid { grid-template-columns: repeat(2, 1fr); } .st-card { break-inside: avoid; } .st-bar { display: none; } }
/* 관리자 화면 시연 배너(한 줄) */
.demo-banner { display: flex; align-items: center; gap: 10px 14px; flex-wrap: wrap; margin: 12px max(16px, calc((100% - 1360px) / 2)) 0; padding: 10px max(16px, env(safe-area-inset-left)); background: var(--accent-softer); border: 1px solid var(--line); border-radius: 14px; }
.demo-banner-text { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-banner .acts { flex-wrap: nowrap; } .demo-banner .acts .button, .demo-banner .acts button { min-height: 40px; font-size: var(--fs-sm); }
@media (max-width: 760px) { .demo-banner { margin: 8px 8px 0; } .demo-banner-text { white-space: normal; flex-basis: 100%; order: 2; } .demo-banner .acts { order: 3; } }
@media print { .demo-banner { display: none; } }
/* 로고 이미지(십자가와 잎): 글자 표시 대신 그림. 그림 자체에 둥근 모서리와 바탕색이 있음 */
.brand-mark.logo { background: transparent; overflow: hidden; padding: 0; }
.brand-mark.logo img { display: block; width: 100%; height: 100%; }

/* 함께 돌봄 2.0 */
.login-card { width: min(470px, calc(100vw - 32px)); border-top: 4px solid var(--gold); }
.login-brand { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.login-brand .brand-mark { width: 72px; height: 72px; }
.login-card .primary { width: 100%; margin-top: 8px; }
#readingMode[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-text); }
.top-acts button, .tabs button, .subtabs button, .nc-icons .ib { min-height: 44px; }
.care-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 8px; margin-block: 16px; }
.care-overview span { display: flex; align-items: baseline; gap: 8px; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); }
.care-overview b { color: var(--accent-text); font-size: var(--fs-xl); }
.care-timeline { list-style: none; margin: 0; padding: 0 0 0 12px; border-inline-start: 2px solid var(--gold); }
.care-timeline li { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 4px; }
.care-timeline li + li { border-top: 1px solid var(--line); }
#visitForm details[open] summary { margin-bottom: 8px; }
#visitForm details > label { display: block; margin-bottom: 12px; }
@media (max-width: 640px) {
  .login-card { padding: 24px 18px; }
  html[data-reading] .top { position: static; }
}
.newcomer-timeline { border-inline-start: 2px solid var(--gold); padding-inline-start: 12px; }
@media (max-width: 400px) {
  .care-overview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr)); }
}
#pastorCareRequest[aria-pressed="true"] {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: currentColor;
}

/* 모바일에서는 모든 메뉴를 화면 너비 안에 표시합니다. */
@media (max-width: 900px) {
  .tabs, .subtabs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
    gap: 6px;
    overflow: visible;
  }
  .tabs, .area-bar { position: static; }
  .tabs button, .subtabs button, .area-text b {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  .tabs button, .subtabs button {
    padding: 6px 8px;
    line-height: 1.25;
  }
  .tabs button { background: var(--surface); border-color: var(--line); }
  .tabs button.active { border-color: var(--accent); }
}
@media (max-width: 480px) {
  .admin-shell { display: flex; flex-direction: column; align-items: stretch; padding-bottom: 0; }
  .areas {
    position: static;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-top: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: none;
    padding: 8px max(12px, env(safe-area-inset-left));
  }
  .admin-shell ~ .credit { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .role-bar .seg {
    grid-auto-flow: row;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 7.5rem), 1fr));
  }
  .role-bar .seg button { min-width: 0; overflow-wrap: anywhere; }
}
@media print { .tabs, .areas, .area-bar { display: none !important; } }

/* 심방 목록 */
.care-section-heading { margin-bottom: 10px; }
.care-section-heading h2, .care-section-heading p { margin: 0; }
.care-section-heading h2 { margin-bottom: 4px; }
.person {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 15rem);
  align-items: center;
  gap: 8px 12px;
  padding: 12px 0;
}
.person + .person { border-top: 1px solid var(--line); }
.person-name { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; }
.person-name b { font-size: var(--fs-lg); overflow-wrap: anywhere; }
.person-name .chip { white-space: normal; }
.person-status { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.person-history { min-height: 44px; padding-inline: 8px; color: var(--accent-text); font-size: var(--fs-sm); }
.person-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; min-width: 0; }
.person-actions > :is(button, .button) {
  min-width: 0;
  min-height: 44px;
  padding: 6px 2px;
  font-size: var(--fs-sm);
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .person { grid-template-columns: minmax(0, 1fr) auto; }
  .person-actions { grid-column: 1 / -1; }
  .care-section .list { gap: 0; }
}
