:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1c2733;
  --sub: #5b6b7b;
  --line: #d5dce3;
  --brand: #1f5f8b;
  --brand-dark: #174a6d;
  --brand-soft: #e6f0f7;
  --danger: #c0392b;
  --danger-soft: #fdecea;
  --ok: #1e7e4a;
  --warn-bg: #fff6dd;
  --warn-line: #e8c96a;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Noto Sans JP", "Yu Gothic", "Meiryo", "Noto Sans", sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
.top {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--brand-dark); }
.mark {
  display: inline-flex; width: 28px; height: 28px; border-radius: 7px; background: var(--brand); color: #fff;
  align-items: center; justify-content: center; font-size: 16px;
}
.lang-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 14px;
  font-size: 14px; color: var(--text); cursor: pointer;
}
.wrap { max-width: 640px; margin: 0 auto; padding: 16px 16px 96px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px 18px; margin-bottom: 16px; }
h1 { font-size: 22px; margin: 0 0 8px; line-height: 1.35; }
h2 { font-size: 20px; margin: 0 0 4px; line-height: 1.35; }
h3 { font-size: 16px; margin: 0; }
h4 { font-size: 14px; margin: 12px 0 4px; color: var(--sub); }
p { margin: 8px 0; }
.sub, .ja-sub { color: var(--sub); font-size: 13px; line-height: 1.5; }
.ja-sub { display: block; font-weight: 400; margin-top: 2px; }
.loading { text-align: center; color: var(--sub); }
.year { color: var(--sub); font-size: 14px; margin: 0 0 12px; }

.lang-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.lang-grid button {
  padding: 16px 8px; font-size: 17px; border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--card); color: var(--text); cursor: pointer; font-weight: 600;
}
.lang-grid button:active, .lang-grid button:hover { border-color: var(--brand); background: var(--brand-soft); }

.notice li { margin-bottom: 10px; }
.notice ul { padding-left: 20px; margin: 8px 0; }
.warn {
  background: var(--warn-bg); border: 1px solid var(--warn-line); border-radius: 10px; padding: 10px 12px;
  font-size: 14px; margin: 10px 0;
}

.progress { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin: 4px 0 6px; }
.progress > div { height: 100%; background: var(--brand); width: 0; transition: width .2s; }
.step-count { font-size: 13px; color: var(--sub); margin: 0 0 12px; }
.company { font-size: 13px; color: var(--sub); margin: 0 0 8px; }

.field { margin: 18px 0; }
.field > label, .field > .label { display: block; font-weight: 600; margin-bottom: 6px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; border-radius: 4px; padding: 1px 6px; margin-left: 6px; vertical-align: middle; }
.badge.req { background: var(--danger-soft); color: var(--danger); }
.badge.opt { background: #eef1f4; color: var(--sub); }
.hint { font-size: 13px; color: var(--sub); margin: 0 0 6px; }
input[type="text"], input[type="password"], input[type="tel"], textarea {
  width: 100%; font: inherit; padding: 12px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--text);
}
textarea { min-height: 96px; resize: vertical; }
input:focus, textarea:focus, button:focus-visible { outline: 3px solid #9cc6e3; outline-offset: 1px; border-color: var(--brand); }
.date-row { display: flex; gap: 8px; align-items: center; }
.date-row input { text-align: center; }
.date-row .y { flex: 2; }
.date-row .m, .date-row .d { flex: 1; }
.date-row span { color: var(--sub); }

.choices { display: flex; flex-direction: column; gap: 8px; }
.choices.two { flex-direction: row; }
.choices.two .choice { flex: 1; justify-content: center; text-align: center; }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 10px;
  background: #fff; cursor: pointer; font: inherit; color: var(--text); text-align: left; width: 100%;
}
.choice.on { border-color: var(--brand); background: var(--brand-soft); font-weight: 600; }
.choice .box {
  flex: none; width: 22px; height: 22px; border: 2px solid #9aa8b5; border-radius: 5px; background: #fff;
  display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 15px; line-height: 1;
}
.choice.on .box { background: var(--brand); border-color: var(--brand); }

.field.bad input, .field.bad textarea, .field.bad .choice { border-color: var(--danger); }
.error { color: var(--danger); font-size: 14px; margin: 6px 0 0; }
.alert { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin: 12px 0; font-size: 15px; }

.item { border: 1px solid var(--line); border-radius: 12px; padding: 4px 14px 10px; margin: 14px 0; background: #fbfcfd; }
.item-head { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }
.link-btn { background: none; border: none; color: var(--brand); font: inherit; font-size: 15px; cursor: pointer; padding: 6px 4px; text-decoration: underline; }
.link-btn.danger { color: var(--danger); }

.upload { border: 1.5px dashed #a9b7c4; border-radius: 12px; padding: 12px 14px; margin: 14px 0; background: #fbfcfd; }
.upload .title { font-weight: 600; }
.file-list { list-style: none; padding: 0; margin: 8px 0; }
.file-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.file-list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; font: inherit; font-weight: 600;
  padding: 14px 18px; border-radius: 12px; border: 1.5px solid var(--brand); cursor: pointer; min-height: 52px;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:active { background: var(--brand-dark); }
.btn.ghost { background: #fff; color: var(--brand); }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: 15px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,.96); border-top: 1px solid var(--line);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.nav-inner { max-width: 640px; margin: 0 auto; display: flex; gap: 10px; }
.nav-inner .btn.primary { flex: 2; }
.nav-inner .btn.ghost { flex: 1; }

.review section { border-top: 1px solid var(--line); padding: 12px 0; }
.review .sec-head { display: flex; justify-content: space-between; align-items: center; }
.review table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.review th, .review td { text-align: left; vertical-align: top; padding: 5px 0; font-size: 14px; border-bottom: 1px dotted var(--line); }
.review th { width: 48%; font-weight: 400; color: var(--sub); padding-right: 8px; }
.review .empty { color: var(--sub); }
.review .files { font-size: 14px; }

.done { text-align: center; }
.done .check { width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 36px; display: inline-flex; align-items: center; justify-content: center; }
.receipt { font-size: 26px; font-weight: 700; letter-spacing: 2px; margin: 4px 0 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
