:root {
  --bg: #f6f1e7; --card: #fffdf8; --ink: #1f2a37; --sub: #5b6675; --line: #e3dccd;
  --mom: #dcebf7; --mom-ink: #123a5c; --kid: #efe9dc;
  --talk: #e2553d; --talk-dark: #b93c27; --ok: #1f7a5a; --ok-bg: #dff1e8; --warn-bg: #fbe6c8; --warn: #7a4b06;
  --r: 18px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--ink); font-family: "Noto Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  font-size: 17px; line-height: 1.5; -webkit-user-select: none; user-select: none; }
button, input, select { font: inherit; color: inherit; }
button { border: 1.5px solid var(--line); background: var(--card); border-radius: 14px; padding: 10px 16px; cursor: pointer; }
button:active { transform: scale(0.97); }
button.primary { background: var(--ink); color: #fff; border-color: var(--ink); }
button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge { font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--warn-bg); color: var(--warn); white-space: nowrap; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.hidden { display: none !important; }
.err { color: var(--talk-dark); font-size: 15px; min-height: 22px; }

/* ---------- 연결 화면 ---------- */
.join { max-width: 420px; margin: 0 auto; padding: 48px 24px; display: flex; flex-direction: column; gap: 16px; }
.join h1 { font-size: 26px; margin: 0; }
.join p { margin: 0; color: var(--sub); }
.join input { width: 100%; height: 56px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 16px; font-size: 22px; letter-spacing: 4px; text-align: center; }
.join .choices { display: grid; gap: 10px; }
.join .choices button { text-align: left; padding: 14px 16px; }
.join .choices small { display: block; color: var(--sub); font-size: 14px; }
.join .choices button.on small { color: #d5dbe3; }
.join .names { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 패드 ---------- */
.pad { height: 100%; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 20px; padding: 20px; }
.pad .left { display: flex; flex-direction: column; gap: 14px; min-height: 0; }
.pad .top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.pad .clock { font-size: 44px; font-weight: 700; letter-spacing: -1px; }
.pad .date { color: var(--sub); font-size: 18px; }
.now { background: var(--mom); color: var(--mom-ink); border-radius: var(--r); padding: 20px 22px; }
.now .who { font-size: 16px; margin-bottom: 6px; }
.now .text { font-size: 30px; font-weight: 700; line-height: 1.4; margin-bottom: 16px; word-break: keep-all; }
.now .row { display: flex; gap: 10px; flex-wrap: wrap; }
.now button { font-size: 20px; padding: 12px 22px; border-color: transparent; }
.now button.yes { background: var(--ok); color: #fff; }
.now.calm { background: var(--card); color: var(--sub); border: 1.5px dashed var(--line); font-size: 20px; text-align: center; padding: 28px; }
.log { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding-right: 4px; }
.log .m { max-width: 82%; padding: 8px 14px; border-radius: 14px; font-size: 18px; word-break: keep-all; }
.log .m.parent { background: var(--mom); color: var(--mom-ink); align-self: flex-start; }
.log .m.kid { background: var(--kid); align-self: flex-end; }
.log .m small { display: block; font-size: 12px; opacity: 0.7; }
.spacer { flex: 1; }
.quick { display: flex; gap: 10px; flex-wrap: wrap; }
.quick button { font-size: 19px; padding: 12px 18px; flex: 1; white-space: nowrap; }
.pad .right { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.pad .label { color: var(--sub); font-size: 15px; }
.who-pick { display: flex; gap: 10px; }
.who-pick button { flex: 1; font-size: 22px; font-weight: 700; padding: 14px; }
.talk { flex: 1; min-height: 180px; border: none; border-radius: 28px; background: var(--talk); color: #fff; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; font-size: 30px; font-weight: 700; touch-action: none; box-shadow: 0 8px 0 var(--talk-dark); }
.talk small { font-size: 17px; font-weight: 400; opacity: 0.9; }
.talk svg { width: 72px; height: 72px; }
.talk.rec { background: var(--talk-dark); box-shadow: 0 2px 0 #7d2516; transform: translateY(6px); }
.talk.rec svg { animation: pulse 0.9s infinite; }
@keyframes pulse { 50% { transform: scale(1.18); } }
.status { text-align: center; min-height: 26px; color: var(--sub); font-size: 16px; }
.start { position: absolute; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 5; text-align: center; padding: 24px; }
.start h1 { font-size: 34px; margin: 0; }
.start p { color: var(--sub); margin: 0; }
.start button { font-size: 26px; padding: 18px 44px; }
@media (max-width: 720px) { .pad { grid-template-columns: 1fr; grid-template-rows: minmax(0, 1fr) auto; } .talk { min-height: 130px; flex: none; } .pad .clock { font-size: 32px; } .now .text { font-size: 24px; } }

/* ---------- 부모 폰 ---------- */
.phone { height: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; -webkit-user-select: text; user-select: text; }
.phone header { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px 10px; }
.phone header h1 { font-size: 20px; margin: 0; }
.phone header div { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.bell { margin: 0 16px 6px; background: var(--warn-bg); color: var(--warn); border-color: transparent; font-size: 15px; }
.chat { flex: 1; overflow-y: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat .day { align-self: center; font-size: 13px; color: var(--sub); margin: 6px 0; }
.chat .m { max-width: 84%; padding: 9px 14px; border-radius: 16px; word-break: keep-all; }
.chat .m.theirs { background: var(--card); border: 1.5px solid var(--line); align-self: flex-start; }
.chat .m.mine { background: var(--mom); color: var(--mom-ink); align-self: flex-end; }
.chat .m .foot button.yes { background: var(--ok); color: #fff; border-color: var(--ok); font-size: 14px; padding: 4px 14px; }
.send .mic { background: var(--talk); border-color: var(--talk); color: #fff; touch-action: none; }
.send .mic svg { width: 26px; height: 26px; vertical-align: middle; }
.send .mic.rec { background: var(--talk-dark); transform: scale(1.12); }
.chat .m .head { font-size: 13px; color: var(--sub); }
.chat .m .foot { font-size: 12px; margin-top: 4px; color: var(--sub); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat .m .foot .seen { color: var(--ok); }
.chat .m audio { width: 220px; height: 34px; margin-top: 6px; display: block; }
.chat .m .wait { color: var(--sub); font-style: italic; }
.chat .empty { margin: auto; color: var(--sub); text-align: center; }
.compose { padding: 10px 16px 16px; display: flex; flex-direction: column; gap: 8px; background: var(--bg); border-top: 1.5px solid var(--line); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chips button { font-size: 14px; padding: 6px 12px; border-radius: 99px; white-space: nowrap; flex: none; }
.send { display: flex; gap: 8px; }
.send input { flex: 1; min-width: 0; height: 48px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); padding: 0 14px; }
.send button { width: 56px; padding: 0; font-size: 20px; }
