:root {
  --brand: #2f3b8c;
  --brand-d: #232c6b;
  --bg: #f5f6fa;
  --card: #ffffff;
  --line: #d9dce6;
  --text: #1c2030;
  --muted: #7a8094;
  --ok: #1f9d55;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  background: var(--bg); color: var(--text);
  padding-bottom: env(safe-area-inset-bottom);
}
.app-header {
  background: var(--brand); color: #fff;
  padding: calc(env(safe-area-inset-top) + 16px) 16px 16px;
  font-size: 20px; font-weight: 700; text-align: center;
  position: sticky; top: 0; z-index: 5;
}
main { max-width: 560px; margin: 0 auto; padding: 16px; }
form { display: flex; flex-direction: column; gap: 16px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.opt { color: var(--muted); font-weight: 400; font-size: 12px; }
.req { color: #c0392b; font-weight: 700; font-size: 11px; vertical-align: middle; }
input[type=text], input[type=date], textarea {
  font-size: 16px; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); color: var(--text); width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--brand); border-color: var(--brand); }
textarea { resize: vertical; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 600; font-size: 14px; padding: 0; }
.choices { display: flex; gap: 10px; }
.chip { flex: 1; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: block; text-align: center; padding: 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--card); font-weight: 700;
}
.chip input:checked + span { background: var(--brand); color: #fff; border-color: var(--brand); }
button#submit {
  font-size: 17px; font-weight: 700; color: #fff; background: var(--brand);
  border: 0; border-radius: 12px; padding: 16px; margin-top: 4px;
}
button#submit:active { background: var(--brand-d); }
button#submit:disabled { opacity: .5; }
.result {
  margin-top: 20px; padding: 18px; background: #eafaf0; border: 1px solid #b6e6c8;
  border-radius: 12px; text-align: center;
}
.result h2 { margin: 0 0 8px; color: var(--ok); font-size: 18px; }
.result .again { margin-top: 14px; display: inline-block; color: var(--brand); font-weight: 700; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #c0392b; color: #fff; padding: 12px 18px; border-radius: 10px;
  font-size: 14px; max-width: 90%; z-index: 20; box-shadow: 0 4px 16px rgba(0,0,0,.2);
}
