:root {
  --bg: #fffaf3;
  --card: #ffffff;
  --text: #2b2622;
  --muted: #7a7068;
  --line: #ece4da;
  --accent: #f07a3a;
  --accent-text: #ffffff;
  --error: #c0392b;
  --ok: #2e7d4f;
}

* { box-sizing: border-box; }

html, body { margin: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 480px;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(24px, env(safe-area-inset-bottom));
}

.brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 8px 0 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
}

.card h2 { font-size: 18px; margin: 0 0 6px; }

.muted { color: var(--muted); margin: 0 0 16px; word-break: break-all; }

label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

/* 16px 이상이어야 아이폰에서 입력할 때 화면이 확대되지 않는다 */
input {
  width: 100%;
  font: inherit;
  font-size: 17px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  margin-bottom: 12px;
}

input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

#input-code { letter-spacing: 0.3em; font-size: 22px; text-align: center; }

.btn {
  display: block;
  width: 100%;
  font: inherit;
  font-weight: 700;
  padding: 13px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }

.btn:disabled { opacity: 0.5; cursor: default; }

.btn.link {
  width: auto;
  border: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
  padding: 8px 0;
  text-decoration: underline;
}

.row { display: flex; justify-content: space-between; margin-top: 8px; }

.msg { margin: 12px 4px 0; font-size: 14px; }
.msg.error { color: var(--error); }
.msg.ok { color: var(--ok); }
.msg { white-space: pre-line; overflow-wrap: anywhere; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.child-list { list-style: none; margin: 0 0 12px; padding: 0; }

.child-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.child-list li:first-child { border-top: 1px solid var(--line); }

.child-name { flex: 1; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }

.child-list input { margin: 0; flex: 1; min-width: 0; }

.btn.small {
  display: inline-block;
  width: auto;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.btn.danger { color: var(--error); }

.add-row { display: flex; gap: 8px; }
.add-row input { margin: 0; flex: 1; min-width: 0; }
.add-row .btn { width: auto; white-space: nowrap; }

.account {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 12px 4px 0;
}
.account .muted { margin: 0; font-size: 14px; }
