:root {
  --bg: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #d9dee5;
  --accent: #0a6e5c;
  --accent-ink: #ffffff;
  --soft: #eef6f4;
  font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); }
body { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

.screen {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: calc(12px + env(safe-area-inset-top)) 16px calc(16px + env(safe-area-inset-bottom));
  max-width: 560px;
  margin: 0 auto;
}

.top { display: flex; align-items: center; justify-content: space-between; }
.top h1 { font-size: 22px; margin: 0; }
.top small { font-size: 13px; color: var(--muted); font-weight: 500; }
.link-btn {
  font: inherit; font-size: 17px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
}

.start-btn {
  flex: 1 1 auto;
  min-height: 46vh;
  border: 0;
  border-radius: 24px;
  background: var(--accent);
  color: var(--accent-ink);
  font: inherit;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  padding: 24px;
  touch-action: manipulation;
}
.start-btn:active { filter: brightness(0.92); }
.start-main { font-size: 64px; font-weight: 800; letter-spacing: 4px; }
.start-sub { font-size: 16px; line-height: 1.5; opacity: 0.92; text-align: center; }

.quick { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-label { width: 72px; flex: none; font-size: 16px; color: var(--muted); }
.seg { display: flex; flex: 1; gap: 6px; }
.seg button {
  flex: 1; font: inherit; font-size: 18px; padding: 14px 6px; border-radius: 12px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  touch-action: manipulation;
}
.seg button[aria-pressed="true"] { background: var(--soft); border-color: var(--accent); color: var(--accent); font-weight: 700; }
.model-line { margin: 0; font-size: 15px; color: var(--muted); }
.notice { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }

.field { display: flex; flex-direction: column; gap: 8px; border: 0; padding: 0; margin: 0; }
.field > span, .field legend { font-size: 15px; color: var(--muted); padding: 0; margin-bottom: 4px; }
.field input[type="text"], .field input[type="password"] {
  font: inherit; font-size: 18px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); width: 100%;
}
.inline { display: flex; gap: 8px; }
.small-btn, .wide-btn {
  font: inherit; font-size: 16px; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); flex: none;
}
.wide-btn { width: 100%; padding: 14px; }
.radios { display: flex; flex-direction: column; gap: 8px; }
.radio {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
}
.radio input { margin-top: 4px; width: 20px; height: 20px; flex: none; }
.radio strong { display: block; font-size: 17px; }
.radio span { font-size: 14px; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.4; padding: 6px 0; }
.check input { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.stats { font-size: 14px; line-height: 1.5; }
.stats table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.stats th, .stats td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: right; }
.stats th:first-child, .stats td:first-child, .stats th:nth-child(2), .stats td:nth-child(2) { text-align: left; }
.stats .ok { color: var(--accent); font-weight: 700; }
.stats .bad { color: #b3261e; font-weight: 700; }

/* 켜진 화면: 검게. 대사는 동행자만 볼 수 있게 아주 흐리게. */
.run { position: fixed; inset: 0; background: #000; }
.run-pad {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border: 0; background: #000; color: #4a4a4a; font: inherit;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 18px;
  padding: 24px; text-align: center;
  touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
}
.run-state { font-size: 18px; color: #3a3a3a; }
.run-text { font-size: 22px; line-height: 1.5; color: #555; max-width: 30em; }
.run-info { font-size: 12px; color: #333; line-height: 1.6; }

#cam { position: fixed; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; top: 0; }
