:root {
  --bg: #f6f5f2;
  --card: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a66;
  --line: #e2e0da;
  --accent: #2f6f4f;
  --accent-text: #ffffff;
  --danger: #b3261e;
  --ok: #2f6f4f;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161615;
    --card: #222220;
    --text: #ecebe7;
    --muted: #a3a29d;
    --line: #353531;
    --accent: #6fbf94;
    --accent-text: #0e1a13;
    --danger: #f2b8b5;
    --ok: #6fbf94;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 18px/1.5 system-ui, -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}
main { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
h1 { font-size: 26px; margin: 8px 0 20px; }
h2 { font-size: 19px; margin: 0 0 12px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; margin-bottom: 16px; }
.muted { color: var(--muted); font-size: 15px; }
button, .button {
  font: inherit;
  border: 0;
  border-radius: 12px;
  padding: 14px 20px;
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}
button.secondary { background: transparent; color: var(--text); border: 1px solid var(--line); }
button.danger { background: transparent; color: var(--danger); border: 1px solid var(--line); }
button.small { padding: 8px 12px; font-size: 15px; }
button:disabled { opacity: .5; cursor: default; }
button.big { width: 100%; font-size: 22px; padding: 20px; }
input, select {
  font: inherit;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  min-width: 0;
}
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; }
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.list li:first-child { border-top: 0; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.dot.on { background: var(--ok); }
.msg { min-height: 1.5em; margin-top: 12px; }
.msg.error { color: var(--danger); }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }
.list .devices { width: 100%; margin: 0; padding: 0 0 0 14px; list-style: none; }
.list .devices li { padding: 6px 0; border-top: 0; }
.link-box { word-break: break-all; padding: 10px; border: 1px dashed var(--line); border-radius: 10px; font-size: 15px; }
label.field { display: grid; grid-template-columns: 7em 1fr 3.5em; gap: 10px; align-items: center; margin: 6px 0; }
label.field input[type=range] { width: 100%; }

/* ---------- 자녀 화면 ---------- */
[hidden] { display: none !important; }
.actions { display: grid; gap: 12px; }
.top-link { color: var(--muted); font-size: 16px; text-decoration: none; display: inline-block; padding: 6px 0 10px; }
.progress { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; flex-basis: 100%; }
.progress > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .3s; }
.list li .state { color: var(--muted); font-size: 15px; }
.list li .state.error { color: var(--danger); }

/* 보기·통화: 화면 전체를 쓴다. 부모님 쪽 영상이 위, 끝내기 버튼이 아래 */
.media { position: fixed; inset: 0; z-index: 10; background: #000; color: #eee; display: flex; flex-direction: column; }
.media .remote { flex: 1; min-height: 0; width: 100%; object-fit: contain; background: #000; }
.media .bar { position: absolute; top: 0; left: 0; right: 0; padding: 14px 16px; font-size: 18px; background: rgba(0, 0, 0, .45); }
.media .self { position: absolute; top: 60px; right: 12px; width: 28vw; max-width: 150px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; background: #222; transform: scaleX(-1); }
.media .bottom { padding: 16px 16px max(16px, env(safe-area-inset-bottom)); display: grid; gap: 10px; }
.media button.stop { background: #2b2b2b; color: #fff; border: 1px solid #666; }
.media button.hangup { background: #b3261e; color: #fff; }
.media .tap { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); width: auto; }
