/* DearNest — A little closer, every day.
 * 시안(docs/mock-overview.png): 크림 바탕 · 따뜻한 갈색 · 파란 "Talk" 단추 · 고전 세리프 로고 · 레트로 사진.
 * 부모님 화면은 큰 글씨(--fs, 3단계) · 큰 단추(높이 64~72px) · 한 화면에 중요한 행동 하나 · 줄 간격 1.5 (기획 "글자 크기도 큼지막해야겠지?").
 * 가족 화면은 보통 앱 크기.
 */
:root {
  --bg: #f6efe4; --paper: #fffaf2; --card: #fffdf8; --ink: #3b2f27; --ink2: #5a4a3e; --muted: #7d6c5d; --line: #e6dac8; --line2: #d8c8b2;
  --brown: #4a3b31; --brown2: #6b5546; --blue: #4f86d6; --blue2: #3d73c2; --green: #4f8a5b; --red: #c9483f; --gold: #c9973b; --soft: #f1e6d6;
  --serif: 'Libre Caslon Text', 'Baskerville', Georgia, serif;
  --sans: 'Atkinson Hyperlegible', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --r: 18px; --shadow: 0 1px 2px rgba(60, 40, 20, .06), 0 6px 22px rgba(60, 40, 20, .07);
  --fs: 17px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 var(--fs)/1.5 var(--sans); -webkit-font-smoothing: antialiased; }
body.elder { --fs: 21px; }
body.elder.ts-xl { --fs: 24px; }
body.elder.ts-xxl { --fs: 27px; }
body.contrast { --bg: #fff; --paper: #fff; --card: #fff; --ink: #000; --ink2: #111; --muted: #2a2a2a; --line: #444; --line2: #222; --brown: #000; --blue: #0b4fb3; --blue2: #083d8c; --soft: #f0f0f0; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
.shell { max-width: 560px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
body.wide .shell { max-width: 1120px; }
body.elder .shell, body.noshellpad .shell { padding-bottom: env(safe-area-inset-bottom); }
.main { padding: 0 0 24px; }
.muted { color: var(--muted); }
.tiny { font-size: .82em; color: var(--muted); line-height: 1.45; }
.err { color: var(--red); font-size: .92em; margin: 8px 0 0; }
.warn { background: #fff2dc; border: 1px solid #f0d6a8; padding: 10px 12px; border-radius: 12px; font-size: .92em; }
.center { text-align: center; }

/* ── 단추 ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent; background: var(--brown); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; transition: transform .06s, background .15s; -webkit-tap-highlight-color: transparent; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-cta { background: var(--brown); }
.btn-blue { background: var(--blue); }
.btn-blue:hover { background: var(--blue2); }
.btn-ghost { background: var(--paper); color: var(--ink); border-color: var(--line2); }
.btn-danger { background: #fff; color: var(--red); border-color: #e9b8b3; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: .9em; }
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.link { background: none; border: 0; padding: 0; color: var(--blue2); text-decoration: underline; cursor: pointer; }

/* ── 머리 ── */
.top { display: flex; align-items: center; gap: 10px; padding: calc(14px + env(safe-area-inset-top)) 18px 10px; }
.top h1 { font: 700 1.25em/1.2 var(--serif); margin: 0; flex: 1; }
.top .icon-btn { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--paper); border: 1px solid var(--line); cursor: pointer; text-decoration: none; }
.top .icon-btn svg { width: 22px; height: 22px; }
.logo { font: 700 2.2em/1 var(--serif); letter-spacing: -.01em; margin: 0; }
.logo sup { font: 600 .32em var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); vertical-align: top; margin-left: 4px; }

/* ── 카드 · 시트 ── */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; margin: 12px 16px; }
.card h2, .card h3 { font-family: var(--serif); margin: 0 0 6px; }
.overlay, .modal { position: fixed; inset: 0; background: rgba(40, 28, 18, .45); z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--paper); width: 100%; max-width: 520px; border-radius: 24px 24px 0 0; padding: 26px 22px calc(22px + env(safe-area-inset-bottom)); position: relative; max-height: 92vh; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 640px) { .overlay, .modal { align-items: center; } .sheet { border-radius: 24px; } }
.sheet h2 { font: 700 1.4em/1.2 var(--serif); margin: 0; padding-right: 36px; }
.sheet p { margin: 0; }
.sheet-x { position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--soft); font-size: 24px; line-height: 1; cursor: pointer; }
.menu-sheet { gap: 8px; }
.fld { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95em; }
.fld em { font-weight: 400; color: var(--muted); font-style: normal; }
.fld input, .fld select, .fld textarea, textarea, .input { border: 1.5px solid var(--line2); background: #fff; border-radius: 14px; padding: 12px 14px; font-weight: 400; width: 100%; }
.fld input:focus, textarea:focus, select:focus { outline: 3px solid rgba(79, 134, 214, .35); border-color: var(--blue); }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line2); border-top-color: var(--brown); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); background: var(--brown); color: #fff; padding: 12px 18px; border-radius: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 90vw; text-align: center; font-size: .95em; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.keep { display: flex; align-items: center; gap: 8px; font-size: .92em; }
.gbtn { min-height: 48px; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; }

/* ── 입장 암호 · 18세 ── */
.dw-gate { position: fixed; inset: 0; z-index: 90; background: var(--bg) url('/img/buddies/hero.webp') center/cover; display: grid; place-items: center; padding: 20px; }
.dw-gate::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(246, 239, 228, .82), rgba(246, 239, 228, .94)); }
.gate-card { position: relative; background: var(--paper); border: 1px solid var(--line); border-radius: 24px; padding: 30px 24px; max-width: 420px; width: 100%; display: flex; flex-direction: column; gap: 14px; text-align: center; box-shadow: var(--shadow); }
.gate-card input { border: 1.5px solid var(--line2); border-radius: 14px; padding: 13px 14px; text-align: center; }
.gate-card .slogan { font: italic 400 1.25em/1.35 var(--serif); margin: 0; }

/* ── 첫 화면 (시안 왼쪽 위) ── */
.hero { position: relative; min-height: 560px; color: #fff; background: #3a2c22 url('/img/buddies/hero.webp') center/cover; display: flex; flex-direction: column; justify-content: flex-end; padding: calc(28px + env(safe-area-inset-top)) 22px 28px; border-radius: 0 0 26px 26px; overflow: hidden; }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(36, 24, 16, .78) 0%, rgba(36, 24, 16, .42) 55%, rgba(36, 24, 16, .1) 100%), linear-gradient(0deg, rgba(36, 24, 16, .7), rgba(36, 24, 16, 0) 55%); }
.hero > * { position: relative; }
.hero .logo { font-size: clamp(54px, 13vw, 92px); color: #fff9ef; }
.hero .tag { font: 400 clamp(22px, 5vw, 32px)/1.2 var(--serif); margin: 4px 0 16px; color: #f8ead6; }
.hero .lead { font: 400 1.25em/1.35 var(--serif); max-width: 22em; margin: 0 0 18px; }
.hero ul { list-style: none; padding: 0; margin: 0 0 22px; display: grid; gap: 12px; }
.hero li { display: flex; align-items: center; gap: 12px; font-size: 1.05em; }
.hero li i { width: 44px; height: 44px; border-radius: 50%; background: #fff9ef; color: var(--brown); display: grid; place-items: center; flex: none; }
.hero li i svg { width: 22px; height: 22px; }
.hero .script { position: absolute; right: 22px; top: calc(140px + env(safe-area-inset-top)); font: italic 1.3em/1.2 var(--serif); transform: rotate(-6deg); color: #fff3df; opacity: .9; }
.hero .ctas { display: grid; gap: 10px; }
.hero .btn-ghost { background: rgba(255, 250, 242, .92); }
body.wide .hero { border-radius: 0 0 30px 30px; min-height: 620px; padding-left: 48px; }

.section { padding: 26px 18px 6px; }
.section h2 { font: 700 1.6em/1.2 var(--serif); margin: 0 0 4px; }
.section > p { margin: 0 0 14px; color: var(--muted); }
.buddy-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 900px) { .buddy-grid.wide6 { grid-template-columns: repeat(6, 1fr); } }
.bcard { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; overflow: hidden; text-align: center; cursor: pointer; padding: 0 0 10px; position: relative; transition: border-color .15s, transform .1s; }
.bcard img { aspect-ratio: 1; object-fit: cover; width: 100%; background: var(--soft); }
.bcard b { display: block; font: 700 1.05em var(--serif); margin-top: 8px; }
.bcard span { font-size: .78em; color: var(--muted); }
.bcard.on { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201, 151, 59, .25); }
.bcard.on::after { content: '✓'; position: absolute; right: 8px; top: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--blue); color: #fff; font-weight: 700; display: grid; place-items: center; font-size: 15px; }
.features { display: grid; gap: 12px; padding: 0 16px; }
@media (min-width: 900px) { .features { grid-template-columns: repeat(4, 1fr); } }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.feature img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }
.feature div { padding: 14px 16px 16px; }
.feature h3 { font: 700 1.1em/1.25 var(--serif); margin: 0 0 4px; }
.feature p { margin: 0; color: var(--muted); font-size: .92em; }
.footer { padding: 22px 18px 40px; text-align: center; }

/* ── 부모님 홈 (시안 4번) ── */
.e-top { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 18px 4px; }
.e-top .logo { font-size: 1.5em; }
.e-top a, .e-top button { width: 56px; height: 56px; border-radius: 50%; border: 1px solid var(--line); background: var(--paper); display: grid; place-items: center; cursor: pointer; }
.e-top svg { width: 28px; height: 28px; }
.e-home { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 6px 22px 26px; gap: 16px; }
.e-face { width: min(62vw, 260px); aspect-ratio: 1; border-radius: 50%; overflow: hidden; border: 6px solid var(--paper); box-shadow: var(--shadow); background: var(--soft); }
.e-face img { width: 100%; height: 100%; object-fit: cover; animation: breathe 6s ease-in-out infinite; transform-origin: 50% 70%; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.018); } }
.e-say { font-size: 1.12em; line-height: 1.45; max-width: 18em; margin: 0; }
.e-say b { display: block; font: 700 1.15em/1.3 var(--serif); margin-bottom: 4px; }
.e-actions { display: grid; gap: 14px; width: 100%; max-width: 420px; }
.e-btn { min-height: 72px; border-radius: 20px; font-size: 1.05em; padding: 0 22px; justify-content: flex-start; gap: 16px; position: relative; }
.e-btn svg { width: 30px; height: 30px; }
.e-btn .badge { margin-left: auto; background: var(--red); color: #fff; border-radius: 999px; min-width: 34px; height: 34px; padding: 0 10px; display: grid; place-items: center; font-size: .8em; }
.e-btn.btn-blue { justify-content: center; }
.topics { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; max-width: 460px; }
.topics button { background: var(--paper); border: 1.5px solid var(--line2); border-radius: 999px; padding: 10px 16px; font-size: .85em; cursor: pointer; }
.news-pill { background: #fff3dc; border: 1px solid #efd7a6; border-radius: 16px; padding: 12px 16px; font-size: .95em; max-width: 420px; }

/* ── 통화 화면 (시안 가운데) ── */
.call { position: fixed; inset: 0; z-index: 40; background: #241a12 center/cover no-repeat; color: #fff; display: flex; flex-direction: column; }
.call::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 14, 9, .55) 0%, rgba(20, 14, 9, 0) 28%, rgba(20, 14, 9, 0) 52%, rgba(20, 14, 9, .82) 100%); }
.call > * { position: relative; }
@media (orientation: portrait) { .call { background-size: auto 74%; background-position: center top; } }
.call-head { display: flex; align-items: flex-start; justify-content: space-between; padding: calc(16px + env(safe-area-inset-top)) 18px 0; }
.call-head .who { text-align: center; flex: 1; }
.call-head h1 { font: 700 1.7em/1.1 var(--serif); margin: 0; }
.call-head .state { font-size: .9em; opacity: .92; display: inline-flex; gap: 6px; align-items: center; margin-top: 4px; }
.call-head .state i { width: 10px; height: 10px; border-radius: 50%; background: #9fd29f; display: inline-block; }
.call-head .state.listening i { animation: pulse 1.2s infinite; }
.call-head .state.thinking i { background: #f3d27a; animation: pulse .8s infinite; }
.call-head .state.speaking i { background: #9cc3ff; }
@keyframes pulse { 50% { opacity: .3; } }
.call-head button { width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .18); color: #fff; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(6px); }
.call-head button svg { width: 26px; height: 26px; }
.call-body { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 18px 10px; gap: 10px; overflow-y: auto; overscroll-behavior: contain; }
.call-body > :first-child { margin-top: auto; }
.cap { background: rgba(255, 250, 242, .95); color: var(--ink); border-radius: 22px; padding: 16px 18px; font-size: 1.05em; line-height: 1.45; box-shadow: 0 6px 24px rgba(0, 0, 0, .25); flex: none; }
.cap.me { background: rgba(255, 255, 255, .16); color: #fff; align-self: flex-end; font-size: .92em; max-width: 85%; border-radius: 18px 18px 4px 18px; padding: 10px 14px; box-shadow: none; }
.cap .care-msg { font-weight: 700; }
.ph-card { background: rgba(255, 250, 242, .97); color: var(--ink); border-radius: 22px; overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); animation: up .35s ease-out; cursor: pointer; }
.ph-card { flex: none; }
.ph-card img { width: 100%; max-height: 30vh; object-fit: cover; }
.ph-card .meta { padding: 10px 16px 12px; font: italic .9em var(--serif); color: var(--ink2); }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }
.offer { flex: none; background: #fffdf6; color: var(--ink); border-radius: 22px; padding: 16px 18px; display: grid; gap: 10px; box-shadow: 0 6px 24px rgba(0, 0, 0, .3); animation: up .35s ease-out; }
.offer q { font: italic 1em/1.4 var(--serif); }
.offer .row .btn { min-height: 60px; font-size: .95em; }
.call-foot { display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; padding: 8px 22px calc(22px + env(safe-area-inset-bottom)); gap: 10px; text-align: center; }
.call-foot button { background: none; border: 0; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: .78em; cursor: pointer; }
.call-foot .ring { width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .2); display: grid; place-items: center; backdrop-filter: blur(6px); }
.call-foot .ring svg { width: 30px; height: 30px; }
.call-foot .mic .ring { width: 104px; height: 104px; background: #fffaf2; color: var(--brown); box-shadow: 0 6px 24px rgba(0, 0, 0, .3); }
.call-foot .mic .ring svg { width: 44px; height: 44px; }
.call-foot .mic.on .ring { background: var(--blue); color: #fff; animation: glow 1.6s infinite; }
@keyframes glow { 0% { box-shadow: 0 0 0 0 rgba(79, 134, 214, .7); } 100% { box-shadow: 0 0 0 26px rgba(79, 134, 214, 0); } }
.call-foot .end .ring { background: var(--red); }
.call-type { display: flex; gap: 8px; padding: 0 18px 10px; }
.call-type textarea { flex: 1; border-radius: 18px; min-height: 60px; max-height: 140px; resize: none; color: var(--ink); }
.call-type .btn { min-height: 60px; border-radius: 18px; }

/* ── 대화 기록 (시안 오른쪽 위 Chat) ── */
.chat { padding: 4px 14px 150px; display: flex; flex-direction: column; gap: 12px; }
.msg { display: flex; gap: 10px; align-items: flex-end; max-width: 92%; }
.msg .av { width: 46px; height: 46px; border-radius: 50%; overflow: hidden; flex: none; background: var(--soft); }
.msg .av img { width: 100%; height: 100%; object-fit: cover; }
.bub { background: var(--card); border: 1px solid var(--line); border-radius: 20px 20px 20px 6px; padding: 12px 16px; line-height: 1.45; }
.msg.me { align-self: flex-end; }
.msg.me .bub { background: #dce8fb; border-color: #c4d7f4; border-radius: 20px 20px 6px 20px; }
.msg.care .bub { background: #fff1ef; border-color: #f2c4bd; font-weight: 600; }
.bub .ph { margin: 8px -6px 0; border-radius: 14px; overflow: hidden; cursor: pointer; }
.bub .ph img { width: 100%; max-height: 300px; object-fit: cover; }
.bub .ph small { display: block; padding: 6px 4px 0; font: italic .82em var(--serif); color: var(--muted); }
.bub .note { margin-top: 8px; font-size: .85em; color: var(--muted); }
.composer { position: fixed; left: 0; right: 0; bottom: 0; background: linear-gradient(0deg, var(--bg) 70%, rgba(246, 239, 228, 0)); padding: 18px 14px calc(14px + env(safe-area-inset-bottom)); z-index: 20; }
.composer .in { max-width: 560px; margin: 0 auto; display: flex; gap: 8px; align-items: flex-end; background: #fff; border: 1.5px solid var(--line2); border-radius: 26px; padding: 6px 6px 6px 16px; }
.composer textarea { border: 0; padding: 12px 0; min-height: 30px; max-height: 150px; resize: none; background: transparent; outline: none; }
.composer .round { width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--soft); color: var(--blue2); display: grid; place-items: center; cursor: pointer; flex: none; }
.composer .round.send { background: var(--brown); color: #fff; }
.composer .round.on { background: var(--blue); color: #fff; }
.composer .round svg { width: 26px; height: 26px; }

/* ── 사진 · 순간 ── */
.ph-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 6px 16px; }
.ph-grid button { border: 0; padding: 0; border-radius: 16px; overflow: hidden; position: relative; cursor: pointer; background: var(--soft); aspect-ratio: 1; }
.ph-grid img { width: 100%; height: 100%; object-fit: cover; }
.ph-grid .new { position: absolute; left: 8px; top: 8px; background: var(--red); color: #fff; border-radius: 999px; padding: 2px 10px; font-size: .7em; font-weight: 700; }
.ph-grid .from { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 8px; background: linear-gradient(0deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, 0)); color: #fff; font-size: .78em; text-align: left; }
.viewer { position: fixed; inset: 0; z-index: 60; background: #16110c; color: #fff; display: flex; flex-direction: column; }
.viewer .vtop { display: flex; justify-content: space-between; align-items: center; padding: calc(14px + env(safe-area-inset-top)) 16px 8px; gap: 10px; }
.viewer .vtop button, .viewer .vnav button { min-height: 56px; min-width: 56px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .16); color: #fff; font-size: .95em; padding: 0 18px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.viewer .vimg { flex: 1; display: grid; place-items: center; min-height: 0; padding: 0 8px; touch-action: pan-y; }
.viewer .vimg img { max-height: 100%; max-width: 100%; object-fit: contain; border-radius: 10px; }
.viewer .vcap { padding: 12px 20px 4px; font-size: 1em; line-height: 1.45; }
.viewer .vcap small { display: block; font: italic .85em var(--serif); opacity: .85; margin-bottom: 4px; }
.viewer .vnav { display: flex; justify-content: space-between; padding: 10px 16px calc(16px + env(safe-area-inset-bottom)); gap: 10px; }
.tabs { display: flex; gap: 6px; padding: 4px 16px 10px; overflow-x: auto; }
.tabs button { border: 1.5px solid var(--line2); background: var(--paper); border-radius: 999px; padding: 8px 16px; cursor: pointer; white-space: nowrap; font-size: .9em; }
.tabs button.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.timeline { padding: 0 16px; }
.tl { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); cursor: default; }
.tl .d { font-size: .8em; color: var(--muted); line-height: 1.25; padding-top: 4px; }
.tl .d b { display: block; color: var(--ink); font-size: 1.15em; }
.tl .b { display: flex; gap: 12px; align-items: flex-start; }
.tl .b img { width: 108px; height: 84px; border-radius: 12px; object-fit: cover; flex: none; cursor: pointer; }
.tl .b .ic { width: 52px; height: 52px; border-radius: 12px; background: var(--soft); display: grid; place-items: center; flex: none; }
.tl h4 { margin: 0 0 2px; font: 700 1em/1.3 var(--serif); }
.tl q { font: italic .9em/1.35 var(--serif); color: var(--ink2); display: block; }

/* ── 설정 (부모님) ── */
.set { padding: 0 16px; display: grid; gap: 14px; }
.set .grp { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; display: grid; gap: 12px; }
.set h3 { margin: 0; font: 700 1.05em var(--serif); }
.seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; }
.seg button { min-height: 64px; border-radius: 16px; border: 1.5px solid var(--line2); background: var(--paper); cursor: pointer; font-weight: 700; }
.seg button.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.tog { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.tog span { flex: 1; text-align: left; }
.tog small { display: block; color: var(--muted); font-size: .8em; }
.tog input { appearance: none; width: 64px; height: 38px; border-radius: 999px; background: var(--line2); position: relative; flex: none; cursor: pointer; transition: .2s; }
.tog input::after { content: ''; position: absolute; left: 4px; top: 4px; width: 30px; height: 30px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); }
.tog input:checked { background: var(--green); }
.tog input:checked::after { left: 30px; }

/* ── 가족 화면 ── */
.nav { position: fixed; left: 0; right: 0; bottom: 0; background: var(--paper); border-top: 1px solid var(--line); display: flex; justify-content: space-around; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); z-index: 30; }
.nav a { flex: 1; max-width: 120px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; color: var(--muted); font-size: 12px; padding: 6px 0; position: relative; }
.nav a svg { width: 26px; height: 26px; }
.nav a.on { color: var(--ink); font-weight: 700; }
.nav .dot { position: absolute; top: 4px; right: calc(50% - 18px); width: 9px; height: 9px; border-radius: 50%; background: var(--red); }
.f-head { display: flex; align-items: center; gap: 14px; padding: calc(16px + env(safe-area-inset-top)) 18px 6px; }
.f-head .av { width: 58px; height: 58px; border-radius: 50%; overflow: hidden; flex: none; border: 3px solid var(--paper); box-shadow: var(--shadow); }
.f-head .av img { width: 100%; height: 100%; object-fit: cover; }
.f-head h1 { font: 700 1.45em/1.15 var(--serif); margin: 0; }
.f-head p { margin: 2px 0 0; color: var(--muted); font-size: .9em; }
.compose { display: grid; gap: 10px; }
.compose textarea { min-height: 96px; resize: vertical; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs span { width: 74px; height: 74px; border-radius: 12px; overflow: hidden; position: relative; background: var(--soft); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button { position: absolute; right: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .6); color: #fff; cursor: pointer; line-height: 1; }
.post { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 12px 16px; overflow: hidden; }
.post .ph-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 8px; }
.post .ini { width: 40px; height: 40px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font: 700 1em var(--serif); flex: none; }
.post .ph-head b { display: block; }
.post .ph-head span { font-size: .82em; color: var(--muted); }
.post .ph-head .menu { margin-left: auto; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.post .txt { padding: 0 16px 10px; white-space: pre-wrap; }
.post .pics { display: grid; gap: 3px; grid-template-columns: repeat(2, 1fr); }
.post .pics.n1 { grid-template-columns: 1fr; }
.post .pics img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; cursor: pointer; }
.post .pics.n1 img { aspect-ratio: auto; max-height: 420px; }
.post .st { padding: 10px 16px 14px; font-size: .86em; color: var(--muted); display: grid; gap: 6px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: .92em; width: fit-content; }
.pill.ok { background: #e6f2e7; color: #2e6a3a; }
.pill.wait { background: #fff3dc; color: #8a6420; }
.retell { font: italic .95em/1.4 var(--serif); color: var(--ink2); }
.note-card { background: #fff6e6; border: 1px solid #f0d9ae; border-radius: var(--r); margin: 12px 16px; padding: 16px; }
.note-card small { color: var(--muted); font-size: .82em; }
.note-card p { margin: 6px 0 0; font: italic 1.05em/1.45 var(--serif); }
.alert-card { background: #fff0ee; border: 1px solid #f0beb6; border-radius: var(--r); margin: 12px 16px; padding: 16px; display: grid; gap: 10px; }
.menu-list { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); margin: 12px 16px; overflow: hidden; }
.menu-list > * { display: flex; align-items: center; gap: 12px; width: 100%; padding: 15px 16px; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left; text-decoration: none; cursor: pointer; font-size: 1em; }
.menu-list > *:last-child { border-bottom: 0; }
.menu-list svg { width: 22px; height: 22px; flex: none; color: var(--brown2); }
.menu-list .danger { color: var(--red); }
.menu-list select { margin-left: auto; border: 1px solid var(--line2); border-radius: 10px; padding: 6px 8px; background: #fff; }
.member { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.member:last-child { border-bottom: 0; }
.qr { background: #fff; border-radius: 18px; padding: 14px; width: min(260px, 70vw); margin: 0 auto; border: 1px solid var(--line); }
.qr svg { width: 100%; height: auto; display: block; }
.code-big { font: 700 2em/1 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .12em; text-align: center; margin: 6px 0; }
.steps { display: flex; gap: 6px; justify-content: center; margin: 4px 0 6px; }
.steps i { width: 30px; height: 5px; border-radius: 3px; background: var(--line2); }
.steps i.on { background: var(--brown); }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choices button { border: 1.5px solid var(--line2); background: var(--paper); border-radius: 999px; padding: 8px 14px; cursor: pointer; }
.choices button.on { background: var(--brown); color: #fff; border-color: var(--brown); }
.empty { text-align: center; padding: 40px 24px; color: var(--muted); }
.empty h3 { color: var(--ink); font-family: var(--serif); margin: 0 0 6px; }
.guide { padding: 0 20px 30px; }
.guide h2 { font: 700 1.5em/1.25 var(--serif); }
.guide h3 { font: 700 1.15em var(--serif); margin: 22px 0 6px; }
.guide li { margin-bottom: 8px; }
.ai-note { font-size: .8em; color: var(--muted); text-align: center; padding: 4px 16px; }

/* 데모 막대 (기기 하나로 가족 ⇄ 부모님) */
.demo-bar { position: fixed; left: 0; right: 0; top: 0; z-index: 85; display: flex; align-items: center; gap: 8px; padding: calc(6px + env(safe-area-inset-top)) 10px 6px; background: #2f2620; color: #fff; font: 600 14px/1.2 var(--sans); }
.demo-bar b { background: var(--gold); color: #2f2620; border-radius: 6px; padding: 3px 6px; font-size: 11px; letter-spacing: .06em; }
.demo-bar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .9; }
.demo-bar button { border: 0; border-radius: 999px; padding: 8px 12px; background: #fffaf2; color: #2f2620; font: 700 13px var(--sans); cursor: pointer; white-space: nowrap; }
.demo-bar #dEnd { background: transparent; color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
body.demo { padding-top: calc(46px + env(safe-area-inset-top)); }
body.demo .call, body.demo .viewer { top: calc(46px + env(safe-area-inset-top)); }
body.demo .call-head, body.demo .viewer .vtop, body.demo .top, body.demo .e-top, body.demo .f-head { padding-top: 12px; }

/* 자매품 (시리즈 공통) */
.sister { margin: 22px 16px 10px; }
.sister-title { display: block; font-size: .82em; color: var(--muted); margin-bottom: 8px; }
.sister-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.sister-card { flex: 0 0 150px; scroll-snap-align: start; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-decoration: none; display: flex; flex-direction: column; gap: 4px; }
.sister-icon { border-radius: 10px; }
.sister-name { font-weight: 700; font-size: .9em; }
.sister-tag { font-size: .75em; color: var(--muted); line-height: 1.3; }

/* 의견 */
.fb-stars { display: flex; gap: 6px; }
.fb-stars button { font-size: 30px; background: none; border: 0; color: var(--line2); cursor: pointer; padding: 0 2px; }
.fb-stars button.on { color: var(--gold); }

/* 설치 팝업 (install.js, 시리즈 공통) — 통화 · 대화 · 처음 화면 위에는 띄우지 않는다 */
.dwi { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 70; display: flex; justify-content: center; padding: 0 12px 12px; pointer-events: none; animation: up .4s ease both; }
body.elder .dwi { bottom: env(safe-area-inset-bottom); }
body[data-view="talk"] .dwi, body[data-view="chat"] .dwi, body[data-view="landing"] .dwi, body[data-view="setup"] .dwi, body[data-view="pair"] .dwi { display: none; }
.dwi-card { pointer-events: auto; width: min(440px, 100%); background: var(--card); color: var(--ink); border: 1px solid var(--line2); border-radius: 18px; padding: 16px 16px 14px; box-shadow: 0 18px 50px rgba(40, 28, 18, .22); display: flex; flex-direction: column; gap: 12px; }
.dwi-head { display: flex; gap: 12px; align-items: flex-start; }
.dwi-head img { width: 48px; height: 48px; border-radius: 12px; flex: none; }
.dwi-head b { display: block; font-weight: 700; }
.dwi-head p { margin: 3px 0 0; font-size: .85em; line-height: 1.5; color: var(--ink2); }
.dwi-acts { display: flex; flex-wrap: wrap; gap: 6px; }
.dwi-btn { padding: 10px 14px; border-radius: 999px; font-size: .85em; border: 0; cursor: pointer; background: none; }
.dwi-main { background: var(--brown); color: #fff; font-weight: 700; }
.dwi-ghost { border: 1px solid var(--line2); color: var(--ink2); }
.dwi-more { font-size: .9em; }
.dwi-steps { margin: 0; padding-left: 20px; line-height: 1.9; }
.dwi-ico { display: inline-flex; vertical-align: -4px; padding: 2px 4px; border-radius: 6px; background: var(--soft); }
.dwi-guide { margin: 0 0 8px; line-height: 1.6; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
