/* ==========================================================
   전도노트 디자인 — 토스·카카오 스타일의 깔끔한 카드형 UI
   ========================================================== */
:root {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #f4f5f9;
  --surface-3: #eceef4;
  --line: #e8eaf0;
  --text: #191f28;
  --text-2: #4e5968;
  --text-3: #8b95a1;
  --brand: #4f5bd5;
  --brand-deep: #3a43b8;
  --brand-2: #eef0ff;
  --brand-ink: #ffffff;
  --accent: #8b5cf6;
  --grad: linear-gradient(135deg, #5865f2 0%, #8b5cf6 55%, #c06cdb 100%);
  --grad-soft: linear-gradient(135deg, #eef0ff 0%, #f5edff 100%);
  --danger: #e5484d;
  --danger-2: #fdecec;
  --ok: #12a37f;
  --warn: #d98b19;
  --shadow-sm: 0 1px 2px rgba(25, 31, 40, .04);
  --shadow: 0 2px 6px rgba(25, 31, 40, .04), 0 10px 30px rgba(25, 31, 40, .06);
  --shadow-lg: 0 12px 40px rgba(40, 45, 120, .18);
  --glass: rgba(255, 255, 255, .78);
  --radius: 22px;
  --nav-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1015; --surface: #181b22; --surface-2: #20242c; --surface-3: #2a2e38; --line: #2a2e38;
    --text: #f2f4f7; --text-2: #b0b8c4; --text-3: #7a8494;
    --brand: #8b93ff; --brand-deep: #a5abff; --brand-2: #23264a; --brand-ink: #0e1015;
    --grad-soft: linear-gradient(135deg, #22254a 0%, #2b2246 100%);
    --danger: #ff6b6f; --danger-2: #3a1f22;
    --shadow-sm: none; --shadow: 0 1px 0 rgba(255, 255, 255, .03), 0 8px 24px rgba(0, 0, 0, .35);
    --glass: rgba(24, 27, 34, .78);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0e1015; --surface: #181b22; --surface-2: #20242c; --surface-3: #2a2e38; --line: #2a2e38;
  --text: #f2f4f7; --text-2: #b0b8c4; --text-3: #7a8494;
  --brand: #8b93ff; --brand-deep: #a5abff; --brand-2: #23264a; --brand-ink: #0e1015;
  --grad-soft: linear-gradient(135deg, #22254a 0%, #2b2246 100%);
  --danger: #ff6b6f; --danger-2: #3a1f22; --glass: rgba(24, 27, 34, .78);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-size: 16px; line-height: 1.5; letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased; word-break: keep-all; overflow-wrap: anywhere;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
svg { flex: none; }

#app { max-width: 560px; margin: 0 auto; min-height: 100%; background: var(--bg); position: relative; }
#view { padding-bottom: calc(var(--nav-h) + var(--safe-b) + 40px); min-height: 100vh; animation: page .28s cubic-bezier(.2, .8, .2, 1); }
#view.no-nav { padding-bottom: calc(var(--safe-b) + 40px); }
#view.full { padding-bottom: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; animation: none; }
@keyframes page { from { opacity: 0; transform: translateY(8px); } }

/* ---------- 상단 바 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: 8px;
  padding: calc(var(--safe-t) + 16px) 20px 12px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(16px); -webkit-backdrop-filter: saturate(180%) blur(16px);
}
.topbar h1 { font-size: 26px; font-weight: 800; margin: 0; flex: 1; letter-spacing: -.035em; }
.topbar h1 small { font-size: 16px; font-weight: 700; color: var(--brand); margin-left: 8px; }
.topbar .title-sm { font-size: 17px; font-weight: 700; flex: 1; text-align: center; margin: 0; }
.topbar.compact { padding-left: 8px; padding-right: 8px; }
.icon-btn {
  width: 42px; height: 42px; border-radius: 14px; border: 0; background: transparent;
  display: inline-grid; place-items: center; color: var(--text); flex: none; transition: background .15s, transform .1s;
}
.icon-btn:active { background: var(--surface-3); transform: scale(.94); }
.icon-btn.solid { background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-btn svg, .act svg, .nav svg, .fab svg, .tile-ic svg, .chev svg, .menu svg, .seg svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.text-btn { border: 0; background: transparent; color: var(--brand); font-weight: 700; padding: 8px 12px; font-size: 16px; border-radius: 12px; }
.text-btn:active { background: var(--brand-2); }

/* ---------- 떠 있는 하단 탭 (유리 효과) ---------- */
.nav {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 30;
  bottom: calc(var(--safe-b) + 10px);
  width: calc(100% - 24px); max-width: 536px; height: var(--nav-h);
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px;
  background: var(--glass); border-radius: 26px;
  backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--line) 70%, transparent), var(--shadow-lg);
}
.nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--text-3); font-size: 11px; font-weight: 700; border-radius: 20px; transition: color .2s, background .2s;
}
.nav a svg { width: 24px; height: 24px; transition: transform .2s; }
.nav a.on { color: var(--brand); background: var(--brand-2); }
.nav a.on svg { stroke-width: 2.3; transform: translateY(-1px); }
.nav a:active svg { transform: scale(.88); }

/* ---------- 검색 / 칩 / 세그먼트 ---------- */
.search { padding: 2px 20px 10px; }
.search input {
  width: 100%; height: 48px; border-radius: 16px; border: 0; padding: 0 16px 0 46px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E") no-repeat 15px center / 20px;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); outline: none; transition: box-shadow .15s;
}
.search input:focus { box-shadow: inset 0 0 0 2px var(--brand), 0 0 0 4px var(--brand-2); }
.chips { display: flex; gap: 8px; padding: 2px 20px 12px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--surface); color: var(--text-2); font-size: 14px; font-weight: 700; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 6px; box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line);
  transition: transform .1s, background .15s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--text); color: var(--bg); box-shadow: none; }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.chip b { font-weight: 800; opacity: .55; }
.seg {
  display: inline-flex; padding: 4px; gap: 2px; border-radius: 16px; background: var(--glass);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow);
}
.seg a { height: 38px; padding: 0 16px; border-radius: 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; color: var(--text-2); }
.seg a svg { width: 18px; height: 18px; }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

/* ---------- 목록 ---------- */
.section-label { font-size: 14px; font-weight: 700; color: var(--text-3); padding: 18px 24px 8px; display: flex; justify-content: space-between; align-items: center; }
.section-label a { color: var(--brand); font-size: 14px; }
.list { background: var(--surface); margin: 0 16px; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); padding: 6px 0; }
.row { display: flex; align-items: center; gap: 14px; padding: 10px 16px; position: relative; transition: background .12s; }
.row:active { background: var(--surface-2); }
.row .main { flex: 1; min-width: 0; }
.row .name { font-weight: 700; font-size: 16.5px; display: flex; align-items: center; gap: 6px; letter-spacing: -.02em; }
.row .name .sub { font-weight: 600; color: var(--text-3); font-size: 13.5px; }
.row .msg { color: var(--text-3); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.row .side { flex: none; font-size: 12.5px; color: var(--text-3); text-align: right; max-width: 34%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { text-align: center; color: var(--text-3); padding: 56px 28px; font-size: 15px; }
.empty .em-ic { width: 72px; height: 72px; border-radius: 24px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--grad-soft); font-size: 34px; }
.empty b { display: block; color: var(--text); font-size: 18px; margin-bottom: 6px; letter-spacing: -.02em; }

/* ---------- 아바타 ---------- */
.av { width: var(--s, 48px); height: var(--s, 48px); border-radius: 36%; object-fit: cover; flex: none; background: var(--surface-2); display: block; }
.av-init {
  display: grid; place-items: center; color: #fff; font-weight: 800;
  font-size: calc(var(--s, 48px) * .33); letter-spacing: -.04em;
  background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff) 0%, var(--c) 100%);
}
.ring { padding: 3px; border-radius: 40%; background: var(--grad); display: inline-block; }
.ring > .av { border: 3px solid var(--surface); }

/* ---------- 배지 ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 8px; font-size: 12px; font-weight: 800; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; letter-spacing: -.02em; }
.tag { font-size: 12px; font-weight: 700; color: var(--text-2); background: var(--surface-2); padding: 3px 9px; border-radius: 8px; }

/* ---------- 추가 버튼 ---------- */
.fab {
  position: fixed; z-index: 25; right: max(20px, calc(50% - 280px + 20px));
  bottom: calc(var(--nav-h) + var(--safe-b) + 24px);
  height: 54px; padding: 0 22px 0 18px; border-radius: 20px; border: 0;
  background: var(--grad); color: #fff; font-weight: 800; font-size: 16px;
  display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 10px 28px rgba(88, 101, 242, .45);
  transition: transform .12s;
}
.fab:active { transform: scale(.95); }
.fab svg { stroke-width: 2.6; }

/* ---------- 홈 ---------- */
.home-head { display: flex; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 20px) 20px 6px; }
.home-head .hello { flex: 1; }
.home-head .hello small { display: block; color: var(--text-3); font-size: 14px; font-weight: 600; }
.home-head .hello b { font-size: 24px; font-weight: 800; letter-spacing: -.035em; }
.hero-card {
  margin: 14px 16px 0; padding: 22px 22px 20px; border-radius: 26px; color: #fff; position: relative; overflow: hidden;
  background: var(--grad); box-shadow: var(--shadow-lg);
}
.hero-card::after { content: ""; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.hero-card::before { content: ""; position: absolute; right: 40px; bottom: -70px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255, 255, 255, .08); }
.hero-card .verse { font-size: 17px; font-weight: 700; line-height: 1.55; position: relative; z-index: 1; letter-spacing: -.02em; }
.hero-card .ref { font-size: 13px; opacity: .8; margin-top: 8px; position: relative; z-index: 1; font-weight: 600; }
.bento { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 12px 16px 0; }
.tile {
  background: var(--surface); border-radius: var(--radius); padding: 16px 16px 18px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px; min-height: 128px; transition: transform .12s; position: relative;
}
.tile:active { transform: scale(.97); }
.tile-ic { width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); }
.tile .num { font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; margin-top: auto; }
.tile .num small { font-size: 16px; font-weight: 700; color: var(--text-3); margin-left: 2px; }
.tile .lbl { font-size: 14px; color: var(--text-2); font-weight: 600; }
.tile.wide { grid-column: span 2; min-height: 0; }
.funnel { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-3); gap: 2px; }
.funnel i { display: block; background: var(--c); min-width: 0; }
.legend { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.legend div { text-align: center; font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.legend b { display: block; font-size: 18px; color: var(--text); font-weight: 800; letter-spacing: -.03em; }
.legend span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--c); margin-right: 3px; vertical-align: 2px; }
.stories { display: flex; gap: 14px; overflow-x: auto; padding: 4px 20px 6px; scrollbar-width: none; }
.stories::-webkit-scrollbar { display: none; }
.story { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 72px; font-size: 13px; font-weight: 700; }
.story small { font-size: 11.5px; color: var(--text-3); font-weight: 600; margin-top: -4px; }
.feed { background: var(--surface); margin: 0 16px; border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px 0; }
.feed a { display: flex; gap: 12px; padding: 12px 16px; align-items: flex-start; }
.feed a:active { background: var(--surface-2); }
.feed .main { flex: 1; min-width: 0; }
.feed .top { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.feed .top time { margin-left: auto; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.feed .txt { font-size: 14.5px; color: var(--text-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed .by { font-size: 12.5px; color: var(--text-3); margin-top: 2px; }

/* ---------- 프로필 ---------- */
.profile-hero {
  position: relative; min-height: 420px; padding: calc(var(--safe-t) + 12px) 12px 30px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  color: #fff; text-align: center; overflow: hidden; isolation: isolate;
  background: linear-gradient(160deg, var(--c1, #6c74f0) 0%, var(--c2, #4b3fb0) 100%);
}
.profile-hero .bgphoto { position: absolute; inset: -40px; z-index: -2; background-size: cover; background-position: center; filter: blur(28px) saturate(1.3); transform: scale(1.1); }
.profile-hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .12) 0%, rgba(0, 0, 0, .05) 40%, rgba(0, 0, 0, .38) 100%); }
.profile-hero .bar { width: 100%; display: flex; justify-content: space-between; }
.profile-hero .icon-btn { color: #fff; background: rgba(255, 255, 255, .16); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.profile-hero .who { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-hero .av { box-shadow: 0 10px 30px rgba(0, 0, 0, .28); border: 3px solid rgba(255, 255, 255, .85); }
.profile-hero .pname { font-size: 27px; font-weight: 800; letter-spacing: -.035em; margin-top: 8px; text-shadow: 0 1px 8px rgba(0, 0, 0, .15); }
.profile-hero .pname small { font-size: 15px; font-weight: 700; opacity: .85; margin-left: 6px; }
.profile-hero .pmsg { font-size: 15px; opacity: .92; max-width: 320px; font-weight: 500; }
.profile-hero .pill-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 2px; }
.profile-hero .pill-row span { background: rgba(255, 255, 255, .2); backdrop-filter: blur(8px); padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.acts {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; padding: 14px 14px;
  margin: -34px 16px 0; position: relative; z-index: 2; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
}
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 700; color: var(--text-2); border: 0; background: none; padding: 4px 0; border-radius: 14px; }
.act .ai { width: 48px; height: 48px; border-radius: 16px; display: grid; place-items: center; background: var(--brand-2); color: var(--brand); transition: transform .12s; }
.act:active .ai { transform: scale(.9); }
.act svg { width: 23px; height: 23px; }
.act.off { opacity: .35; pointer-events: none; }

.card { background: var(--surface); margin: 14px 16px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.card h3 { font-size: 15px; color: var(--text); font-weight: 800; margin: 0; padding: 18px 18px 6px; display: flex; justify-content: space-between; align-items: center; letter-spacing: -.02em; }
.card h3 > span { font-size: 13px; color: var(--text-3); font-weight: 600; }
.info { display: grid; grid-template-columns: 76px 1fr; gap: 0 12px; padding: 4px 18px 16px; margin: 0; }
.info dt { color: var(--text-3); font-size: 14px; padding: 9px 0; font-weight: 600; }
.info dd { margin: 0; padding: 9px 0; font-size: 15.5px; white-space: pre-wrap; font-weight: 500; }
.info dt:not(:first-of-type), .info dt:not(:first-of-type) + dd { border-top: 1px solid var(--line); }
.info dd a { color: var(--brand); font-weight: 700; }
.prayer { margin: 6px 18px 18px; padding: 16px 18px; border-radius: 16px; background: var(--grad-soft); white-space: pre-wrap; font-size: 15.5px; position: relative; font-weight: 500; }
.prayer.plain { background: var(--surface-2); }
.meta { font-size: 12.5px; color: var(--text-3); text-align: center; padding: 10px 16px 0; font-weight: 500; }
.danger-link { display: block; margin: 18px auto 0; border: 0; background: none; color: var(--text-3); font-size: 14px; font-weight: 600; padding: 10px 16px; text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 전도 단계 ---------- */
.stepper { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 12px 16px 18px; }
.step { border: 0; background: none; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text-3); }
.step i { display: block; width: 100%; height: 8px; border-radius: 999px; background: var(--surface-3); transition: background .2s; }
.step.done i { background: var(--c); }
.step.cur { color: var(--text); }
.step.cur i { box-shadow: 0 0 0 4px color-mix(in srgb, var(--c) 25%, transparent); }

/* ---------- 만남 기록 ---------- */
.visit-form { padding: 6px 18px 18px; display: grid; gap: 8px; }
.visit-form .line { display: flex; gap: 8px; }
.visit-form input[type=date] { flex: none; width: 150px; }
.timeline { list-style: none; margin: 0; padding: 0 18px 12px; }
.timeline li { position: relative; padding: 0 0 18px 24px; }
.timeline li::before { content: ""; position: absolute; left: 3px; top: 6px; width: 11px; height: 11px; border-radius: 50%; background: var(--surface); border: 3px solid var(--brand); }
.timeline li::after { content: ""; position: absolute; left: 9px; top: 22px; bottom: 2px; width: 2px; border-radius: 2px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .when { font-size: 13px; color: var(--text-3); display: flex; gap: 6px; align-items: center; font-weight: 600; }
.timeline .when button { margin-left: auto; border: 0; background: none; color: var(--text-3); font-size: 13px; padding: 2px 4px; }
.timeline .what { white-space: pre-wrap; font-size: 15px; margin-top: 2px; background: var(--surface-2); padding: 10px 14px; border-radius: 4px 14px 14px 14px; }

/* ---------- 입력 폼 ---------- */
.form { padding: 4px 16px 24px; }
.form-group { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 16px 4px; margin-bottom: 14px; }
.form-group > h4 { margin: 0 0 14px 4px; font-size: 15px; font-weight: 800; letter-spacing: -.02em; }
.photo-pick { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0 20px; }
.photo-pick .ph { position: relative; cursor: pointer; }
.photo-pick .ph .cam { position: absolute; right: -4px; bottom: -4px; width: 34px; height: 34px; border-radius: 12px; background: var(--text); color: var(--bg); display: grid; place-items: center; border: 3px solid var(--bg); }
.photo-pick .ph .cam svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.photo-pick .row-btns { display: flex; gap: 8px; }
.field { display: block; margin: 0 0 14px; }
.field > span { display: block; font-size: 13.5px; font-weight: 700; color: var(--text-2); margin: 0 0 6px 4px; }
.field > span em { color: var(--danger); font-style: normal; }
.input, .field input, .field select, .field textarea {
  width: 100%; min-height: 50px; border-radius: 14px; border: 0; background: var(--surface-2);
  box-shadow: inset 0 0 0 1px transparent; padding: 12px 15px; outline: none; font-size: 16px; transition: box-shadow .15s, background .15s;
}
.field select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b95a1' stroke-width='2.2' stroke-linecap='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 20px; padding-right: 40px; }
.field textarea, textarea.input { min-height: 100px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { box-shadow: inset 0 0 0 2px var(--brand); background: var(--surface); }
.field .with-btn { display: flex; gap: 8px; }
.field .with-btn input { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.loc-note { font-size: 13px; color: var(--text-3); margin: 8px 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-weight: 600; }
.loc-note.ok { color: var(--ok); }
.loc-note.warn { color: var(--warn); }
.loc-note button { border: 0; background: var(--brand-2); color: var(--brand); font-weight: 700; font-size: 12.5px; padding: 4px 10px; border-radius: 8px; }
.sticky-save { position: sticky; bottom: calc(var(--safe-b) + 12px); z-index: 5; margin-top: 6px; }

.btn {
  height: 50px; padding: 0 18px; border-radius: 15px; border: 0; font-weight: 700; font-size: 16px;
  background: var(--surface-2); color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; transition: transform .1s, filter .15s;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--grad); color: #fff; box-shadow: 0 8px 20px rgba(88, 101, 242, .3); }
.btn.soft { background: var(--brand-2); color: var(--brand); }
.btn.danger { background: var(--danger-2); color: var(--danger); }
.btn.small { height: 38px; padding: 0 14px; font-size: 14px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; }

/* ---------- 지도 ---------- */
.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: var(--surface-2); }
.map-top { position: absolute; z-index: 5; top: 0; left: 0; right: 0; padding: calc(var(--safe-t) + 12px) 0 0; pointer-events: none; }
.map-top .chips { pointer-events: auto; padding-bottom: 6px; padding-top: 8px; }
.map-top .chip { box-shadow: var(--shadow); }
.map-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; pointer-events: auto; }
.map-title .pill { background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: var(--shadow); border-radius: 14px; padding: 9px 14px; font-weight: 800; font-size: 14px; color: var(--text-2); }
.map-fab { position: absolute; z-index: 5; right: 16px; width: 48px; height: 48px; border-radius: 16px; background: var(--glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 0; box-shadow: var(--shadow); display: grid; place-items: center; color: var(--text); }
.map-fab svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-msg { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center; color: var(--text-2); background: var(--grad-soft); }
.map-msg .box { background: var(--surface); border-radius: 26px; padding: 30px 24px; box-shadow: var(--shadow); max-width: 340px; font-size: 15px; }
.map-msg .box .em-ic { width: 64px; height: 64px; border-radius: 22px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--brand-2); font-size: 30px; }
.map-msg .box b { display: block; font-size: 18px; color: var(--text); margin-bottom: 8px; letter-spacing: -.02em; }

.pin { transform: translate(-50%, -100%); display: flex; flex-direction: column; align-items: center; cursor: pointer; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .22)); }
.pin .lbl {
  background: #fff; color: #191f28; font-family: "Pretendard Variable", Pretendard, sans-serif;
  font-size: 12.5px; font-weight: 800; padding: 3px 10px 3px 3px; border-radius: 999px; white-space: nowrap;
  max-width: 140px; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 6px; letter-spacing: -.02em;
}
.pin .lbl i { width: 22px; height: 22px; border-radius: 50%; background: var(--c); color: #fff; display: grid; place-items: center; font-style: normal; font-size: 11px; flex: none; }
.pin .tip { width: 0; height: 0; border: 6px solid transparent; border-top: 7px solid #fff; margin-top: -1px; }
.me-dot { width: 18px; height: 18px; border-radius: 50%; background: #3182f6; border: 3px solid #fff; box-shadow: 0 0 0 8px rgba(49, 130, 246, .22); transform: translate(-50%, -50%); }

/* ---------- 하단 시트 ---------- */
.sheet-back { position: fixed; inset: 0; z-index: 50; background: rgba(10, 12, 20, .45); display: flex; align-items: flex-end; justify-content: center; animation: fade .18s; backdrop-filter: blur(2px); }
.sheet {
  width: 100%; max-width: 560px; max-height: 88vh; background: var(--surface); border-radius: 28px 28px 0 0;
  padding: 8px 0 calc(var(--safe-b) + 18px); display: flex; flex-direction: column; animation: up .28s cubic-bezier(.2, .9, .2, 1);
}
.sheet .grip { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 4px auto 8px; flex: none; }
.sheet .sheet-head { display: flex; align-items: center; padding: 4px 10px 10px 22px; flex: none; }
.sheet .sheet-head h2 { flex: 1; font-size: 19px; margin: 0; font-weight: 800; letter-spacing: -.03em; }
.sheet .sheet-body { overflow: auto; padding: 0 18px; flex: 1; min-height: 0; }
.sheet.tall { height: 88vh; }
.sheet .postcode { height: 100%; min-height: 420px; border-radius: 16px; overflow: hidden; }
.sheet .pick-map { position: relative; height: 52vh; border-radius: 18px; overflow: hidden; margin-bottom: 12px; }
.sheet .pick-map .center-pin { position: absolute; left: 50%; top: 50%; z-index: 3; transform: translate(-50%, -100%); pointer-events: none; color: var(--brand); }
.sheet .pick-map .center-pin svg { width: 40px; height: 40px; fill: currentColor; stroke: #fff; stroke-width: 1.5; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .3)); }
.sheet .sheet-actions { display: flex; gap: 8px; padding: 14px 18px 0; flex: none; }
.sheet .sheet-actions .btn { flex: 1; }
.place-card { display: flex; gap: 12px; align-items: center; padding: 12px 4px; }
.place-card + .place-card { border-top: 1px solid var(--line); }
.place-card .main { flex: 1; min-width: 0; }
.place-card .addr { color: var(--text-3); font-size: 14px; }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translateY(40%); opacity: .5; } }

/* ---------- 로그인 ---------- */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; background: var(--grad); }
.login-top { padding: calc(var(--safe-t) + 64px) 28px 48px; color: #fff; position: relative; overflow: hidden; }
.login-top::after { content: ""; position: absolute; right: -60px; top: -40px; width: 240px; height: 240px; border-radius: 50%; background: rgba(255, 255, 255, .1); }
.login-top h1 { font-size: 32px; margin: 0 0 6px; letter-spacing: -.04em; font-weight: 800; position: relative; z-index: 1; }
.login-top p { margin: 0; opacity: .88; font-weight: 500; position: relative; z-index: 1; }
.login { flex: 1; background: var(--bg); border-radius: 30px 30px 0 0; padding: 32px 24px calc(var(--safe-b) + 32px); }
.login .err { color: var(--danger); font-size: 14px; min-height: 22px; margin: 4px 4px 10px; font-weight: 600; }
.login .field input { background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); }
.login .field input:focus { box-shadow: inset 0 0 0 2px var(--brand); }

/* ---------- 더보기 ---------- */
.me-card { display: flex; align-items: center; gap: 14px; margin: 6px 16px 0; padding: 18px; border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.me-card b { font-size: 19px; letter-spacing: -.03em; }
.me-card small { display: block; color: var(--text-3); font-size: 13.5px; font-weight: 600; }
.menu { background: var(--surface); margin: 14px 16px; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; padding: 6px 0; }
.menu > * { display: flex; align-items: center; gap: 14px; width: 100%; padding: 13px 18px; border: 0; background: none; text-align: left; font-size: 16px; font-weight: 600; }
.menu > button:active { background: var(--surface-2); }
.menu .mi { width: 38px; height: 38px; border-radius: 13px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); flex: none; }
.menu .mi svg { width: 20px; height: 20px; }
.menu .k { flex: 1; }
.menu .v { color: var(--text-3); font-size: 14px; font-weight: 600; }
.help { color: var(--text-2); font-size: 14.5px; padding: 0 18px 18px; }
.help ol { margin: 6px 0 0; padding-left: 20px; }
.help li { margin: 4px 0; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + var(--safe-b) + 96px); z-index: 80;
  transform: translate(-50%, 16px) scale(.96); opacity: 0; pointer-events: none; transition: .25s cubic-bezier(.2, .9, .2, 1);
  background: rgba(25, 31, 40, .92); color: #fff; padding: 13px 20px; border-radius: 16px; font-size: 15px; font-weight: 700;
  max-width: calc(100% - 40px); text-align: center; backdrop-filter: blur(10px); box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* ---------- 로딩 (스켈레톤) ---------- */
.loading { display: grid; place-items: center; padding: 80px; color: var(--text-3); }
.spinner { width: 30px; height: 30px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.skel-row { display: flex; gap: 14px; align-items: center; padding: 10px 16px; }

@media (min-width: 600px) {
  body { background: color-mix(in srgb, var(--bg) 85%, var(--surface-3)); }
  #app { box-shadow: 0 0 0 1px var(--line); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ==========================================================
   v3 추가: 성도/전도 전환, 출석 상태, 지도 사진 핀, 기도 게시판
   ========================================================== */
.people-top { justify-content: space-between; }
.seg.big { background: var(--surface-3); box-shadow: none; backdrop-filter: none; }
.seg.big a { height: 40px; padding: 0 18px; font-size: 16px; }
.count-pill { font-size: 14px; font-weight: 800; color: var(--brand); background: var(--brand-2); padding: 6px 12px; border-radius: 999px; }
.count-pill:empty { display: none; }
.chips.sub { padding-top: 0; margin-top: -4px; }
.chip.small { height: 32px; font-size: 13.5px; padding: 0 12px; }
.chip.on.danger { background: var(--danger); color: #fff; }
.chip.on.danger .dot { background: #fff; }

/* 아바타 옆 출석 점 */
.av-wrap { position: relative; display: inline-block; flex: none; }
.att-dot { position: absolute; right: -2px; bottom: -2px; width: 15px; height: 15px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); }
.row .name .badge { margin-left: 2px; }
.profile-hero .pill-row .att-pill { display: inline-flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .92); color: var(--c); }
.att-pill i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }

/* 출석 상태 선택 */
.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle label { position: relative; cursor: pointer; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span { display: flex; align-items: center; justify-content: center; height: 50px; border-radius: 14px; background: var(--surface-2); font-weight: 700; color: var(--text-3); transition: .15s; }
.toggle input:checked + span { background: color-mix(in srgb, var(--c) 13%, transparent); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.toggle input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 지도 핀: 사진 + 이름, 테두리 색 = 출석(초록) / 미출석(빨강) */
.pin .lbl { border: 2.5px solid var(--c); padding: 2px 10px 2px 2px; }
.pin .tip { border-top-color: var(--c); }
.pin .pav { position: relative; display: block; flex: none; }
.pin .pav .av { border-radius: 50%; }
.pin .pav em { position: absolute; right: -6px; top: -6px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--c); color: #fff; font-style: normal; font-size: 10px; font-weight: 800; display: grid; place-items: center; border: 1.5px solid #fff; }

/* 기도 게시판 */
.pcard { background: var(--surface); margin: 0 16px 12px; border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 16px 10px; }
.pcard.done { background: linear-gradient(135deg, color-mix(in srgb, #12a37f 7%, var(--surface)) 0%, var(--surface) 70%); }
.pc-head { display: flex; align-items: center; gap: 10px; }
.pc-head .main { flex: 1; min-width: 0; }
.pc-head b { display: block; font-size: 15.5px; letter-spacing: -.02em; }
.pc-head small { color: var(--text-3); font-size: 13px; font-weight: 600; }
.pc-head .for { color: var(--brand); font-weight: 700; }
.pc-body { margin: 12px 2px 12px; white-space: pre-wrap; font-size: 16px; line-height: 1.6; }
.pc-actions { display: flex; align-items: center; gap: 4px; border-top: 1px solid var(--line); padding-top: 8px; }
.pc-actions button { border: 0; background: none; display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 10px; border-radius: 12px; font-size: 14px; font-weight: 700; color: var(--text-2); }
.pc-actions button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pc-actions button:active { background: var(--surface-2); }
.pc-actions .pray-btn { background: var(--brand-2); color: var(--brand); margin-right: auto; }
.pc-actions .pray-btn.on { background: var(--grad); color: #fff; }
.pc-actions .pray-btn b { font-weight: 800; }
.pc-actions .ghost { color: var(--text-3); }
.pc-actions .ghost[data-edit], .pc-actions .ghost[data-del] { padding: 0 8px; }
.pc-actions button { white-space: nowrap; flex: none; }
.pc-head .for { display: block; margin-top: 2px; font-size: 13px; color: var(--brand); font-weight: 700; }

/* ==========================================================
   v4: 지도 레이어 버튼, 교회 일정(달력)
   ========================================================== */
.map-top .chips { padding-top: 0; }
.chip.layer { gap: 7px; padding-left: 8px; }
.chip.layer .lchk { width: 20px; height: 20px; border-radius: 7px; display: grid; place-items: center; border: 2px solid var(--c); background: var(--surface); }
.chip.layer .lchk svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.chip.layer.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow), inset 0 0 0 2px var(--c); }
.chip.layer.on .lchk { background: var(--c); }
.chip.layer:not(.on) { opacity: .75; }
.pin.prospect .lbl { border-style: dashed; }

/* 홈 일정 칸 */
.cal-tile .next { margin-top: auto; font-size: 13px; color: var(--text-3); font-weight: 600; line-height: 1.35; }
.cal-tile .next b { display: block; font-size: 17px; color: var(--text); font-weight: 800; letter-spacing: -.03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.up-list a { align-items: center; }
.up-date { width: 46px; flex: none; border-radius: 14px; padding: 5px 0; text-align: center; background: color-mix(in srgb, var(--c) 12%, transparent); color: var(--c); line-height: 1.15; }
.up-date b { display: block; font-size: 19px; font-weight: 800; }
.up-date small { display: block; font-size: 10.5px; font-weight: 700; }

/* 달력 */
.cal-card { margin: 0 16px; background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); padding: 10px 10px 14px; user-select: none; -webkit-user-select: none; }
.cal-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 8px; }
.cal-title { font-size: 24px; font-weight: 800; letter-spacing: -.04em; text-align: center; line-height: 1.1; }
.cal-title small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 700; letter-spacing: 0; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); }
.cal-week span { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-3); padding: 4px 0 8px; }
.cal-week .sun, .day.sun .n { color: #e5484d; }
.cal-week .sat, .day.sat .n { color: #3182f6; }
.cal-grid { gap: 2px; }
.day { border: 0; background: none; min-height: 66px; padding: 4px 1px 3px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 0; transition: background .15s; }
.day:active { background: var(--surface-2); }
.day .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 700; color: var(--text); }
.day.out { opacity: .32; }
.day.today .n { background: var(--grad); color: #fff !important; box-shadow: 0 4px 10px rgba(88, 101, 242, .35); }
.day.sel { background: var(--brand-2); }
.day.sel:not(.today) .n { box-shadow: inset 0 0 0 2px var(--brand); }
.day .evs { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 0 2px; }
.day .evs i { display: block; font-style: normal; font-size: 10px; font-weight: 700; line-height: 1.5; padding: 0 3px; border-radius: 5px; white-space: nowrap; overflow: hidden; text-overflow: clip; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); text-align: left; }
.day .evs em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--text-3); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: center; padding: 10px 4px 0; border-top: 1px solid var(--line); margin-top: 8px; }
.cal-legend span { font-size: 12px; color: var(--text-3); font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.cal-legend i { width: 8px; height: 8px; border-radius: 3px; background: var(--c); }
.ev-card { display: flex; align-items: center; gap: 12px; width: calc(100% - 32px); margin: 0 16px 10px; padding: 14px 14px 14px 18px; border: 0; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: left; position: relative; overflow: hidden; }
.ev-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--c); }
.ev-card:active { transform: scale(.98); }
.ev-time { flex: none; width: 62px; font-size: 13px; font-weight: 700; color: var(--c); }
.ev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ev-main b { font-size: 16px; letter-spacing: -.02em; }
.ev-main small { font-size: 13px; color: var(--text-3); font-weight: 600; }
.ev-empty { margin: 0 16px; padding: 22px; border-radius: 18px; background: var(--surface); box-shadow: var(--shadow); text-align: center; color: var(--text-3); font-weight: 600; }
.ev-empty button { display: block; margin: 8px auto 0; border: 0; background: var(--brand-2); color: var(--brand); font-weight: 700; padding: 8px 14px; border-radius: 12px; }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-pick label { cursor: pointer; }
.cat-pick input { position: absolute; opacity: 0; pointer-events: none; }
.cat-pick span { display: inline-flex; align-items: center; height: 38px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); font-weight: 700; font-size: 14px; color: var(--text-2); }
.cat-pick input:checked + span { background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c); box-shadow: inset 0 0 0 2px var(--c); }
.cat-pick input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
#agenda { padding-bottom: 76px; }

/* v5: 여러 날 일정은 끊기지 않는 긴 막대 */
.cal-weeks { display: flex; flex-direction: column; }
.week { position: relative; min-height: 88px; border-top: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.week:first-child { border-top: 0; }
.week-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0; height: 100%; position: absolute; inset: 0; }
.week-days .day { min-height: 0; height: 100%; padding-top: 4px; justify-content: flex-start; }
.week-bars { position: relative; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 17px; row-gap: 2px; padding: 36px 0 6px; pointer-events: none; }
.bar { display: block; min-width: 0; margin: 0 2px; padding: 0 5px; border-radius: 6px; font-size: 10.5px; font-weight: 700; line-height: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--c); background: color-mix(in srgb, var(--c) 15%, transparent); }
.bar.long { background: var(--c); color: #fff; }
.bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.week-bars .more { font-size: 10px; font-weight: 800; color: var(--text-3); text-align: center; line-height: 14px; }
.bar:not(.long) { text-overflow: clip; padding: 0 3px; }

/* ==========================================================
   v6: 가족 연결 (가장 기준)
   ========================================================== */
.rel { display: inline-flex; align-items: center; height: 21px; padding: 0 7px; border-radius: 7px; font-size: 11.5px; font-weight: 800; color: var(--text-2); background: var(--surface-3); white-space: nowrap; letter-spacing: -.02em; }
.rel.head { color: #fff; background: var(--grad); }
.fam-chip.on { background: var(--brand); color: #fff; }
.fam-group { margin-bottom: 10px; }
.fam-group.single { padding: 2px 0; }
.fam-title { display: flex; align-items: center; gap: 6px; padding: 10px 16px 4px; font-size: 13.5px; font-weight: 800; color: var(--brand); letter-spacing: -.02em; }
.fam-title span { color: var(--text-3); font-weight: 700; }
.fam-title.in-sheet { padding: 12px 4px 2px; }
.row.fam-sub { padding-left: 34px; }
.row.fam-sub::after { content: ""; position: absolute; left: 24px; top: 0; bottom: 50%; width: 10px; border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); border-bottom-left-radius: 8px; }
.row.fam-sub .name { font-size: 15.5px; }
.fam-list { padding: 4px 10px 8px; }
.fam-row { display: flex; align-items: center; gap: 12px; padding: 8px; border-radius: 14px; }
.fam-row:active { background: var(--surface-2); }
.fam-row.me { background: var(--brand-2); }
.fam-row .main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fam-row .main b { font-size: 15.5px; letter-spacing: -.02em; }
.fam-row .main .sub { font-size: 13px; color: var(--text-3); font-weight: 600; }
.fam-row .main small { font-size: 12px; color: var(--brand); font-weight: 700; }
.fam-empty { margin: 4px 18px 12px; color: var(--text-3); font-size: 14.5px; line-height: 1.6; }
.fam-actions { display: flex; gap: 8px; flex-wrap: wrap; padding: 0 18px 18px; }
.fam-note { background: var(--brand-2); border-radius: 14px; padding: 12px 14px; font-size: 14.5px; line-height: 1.6; }
.fam-note small { color: var(--text-3); font-weight: 600; }
.fam-hint { margin: -6px 4px 14px; font-size: 13px; color: var(--text-3); font-weight: 600; line-height: 1.5; }
.fam-hint b { color: var(--brand); }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 38vh; overflow: auto; }
.pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; background: none; border-radius: 14px; text-align: left; }
.pick-row:active { background: var(--surface-2); }
.pick-row.on { background: var(--brand-2); }
.pick-row .main { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.pick-row .main b { font-size: 15.5px; }
.pick-row .main .sub { font-size: 13px; color: var(--text-3); font-weight: 600; }
.pick-row .main small { flex-basis: 100%; font-size: 12.5px; color: var(--text-3); }
.pick-row .radio { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line); flex: none; }
.pick-row.on .radio { border: 7px solid var(--brand); }
.check-line { display: flex; gap: 10px; align-items: flex-start; padding: 12px 4px; font-weight: 700; font-size: 15px; cursor: pointer; }
.check-line input { width: 20px; height: 20px; accent-color: var(--brand); margin-top: 2px; flex: none; }
.check-line small { display: block; font-size: 12.5px; color: var(--text-3); font-weight: 600; }
.sheet-sub { display: block; font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-top: 2px; }

/* v7: 관리자 · 자동 로그인 */
.login-checks { display: flex; flex-direction: column; gap: 0; margin: -4px 0 6px; }
.login-checks .check-line { padding: 8px 4px; font-size: 15px; }
.admin-badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; margin-left: 6px; border-radius: 8px; font-size: 12px; font-weight: 800; color: #fff; background: linear-gradient(135deg, #f59e0b, #e5484d); vertical-align: 3px; letter-spacing: -.02em; }
.home-head .hello .admin-badge { vertical-align: 5px; }
.admin-mark { margin-left: auto; font-size: 11px; font-weight: 800; color: #e5484d; background: color-mix(in srgb, #e5484d 12%, transparent); padding: 2px 7px; border-radius: 6px; }
.admin-card { border: 1.5px solid color-mix(in srgb, #f59e0b 45%, transparent); }
.switch-row { display: flex; align-items: center; gap: 12px; padding: 12px 18px; border-top: 1px solid var(--line); cursor: pointer; }
.switch-row span { flex: 1; }
.switch-row b { display: block; font-size: 15.5px; }
.switch-row small { display: block; color: var(--text-3); font-size: 13px; font-weight: 600; }
.switch { appearance: none; -webkit-appearance: none; width: 50px; height: 30px; border-radius: 999px; background: var(--surface-3); position: relative; cursor: pointer; transition: background .2s; flex: none; margin: 0; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .2s; }
.switch:checked { background: var(--brand); }
.switch:checked::after { transform: translateX(20px); }
.switch:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* v8: 앱 설치 버튼 */
.install-card { display: flex; align-items: center; gap: 14px; margin: 14px 16px 0; padding: 16px 18px; border-radius: var(--radius) var(--radius) 0 0; background: var(--grad-soft); }
.install-card .install-ic { width: 52px; height: 52px; border-radius: 16px; box-shadow: var(--shadow); flex: none; }
.install-card .main { flex: 1; min-width: 0; }
.install-card b { display: block; font-size: 17px; letter-spacing: -.03em; }
.install-card small { color: var(--text-2); font-size: 13.5px; font-weight: 600; }
.install-btns { display: flex; gap: 8px; margin: 0 16px 14px; padding: 0 18px 16px; background: var(--grad-soft); border-radius: 0 0 var(--radius) var(--radius); }
.install-btns .btn { flex: 1; padding: 0 10px; font-size: 15px; }
.install-lead { margin: 2px 0 14px; font-size: 15.5px; line-height: 1.6; }
.install-steps { list-style: none; margin: 4px 0 6px; padding: 0; display: grid; gap: 10px; }
.install-steps li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-2); border-radius: 16px; padding: 14px; font-size: 15.5px; line-height: 1.55; }
.install-steps .num { width: 26px; height: 26px; border-radius: 50%; background: var(--grad); color: #fff; font-weight: 800; font-size: 14px; display: grid; place-items: center; flex: none; }
.install-steps .key { display: inline-block; padding: 0 7px; border-radius: 6px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); font-weight: 800; }
