@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Parisienne&display=swap");

:root {
  --bg: #f3f7ef;
  --paper: #ffffff;
  --card: #ffffff;
  --ink: #333333;
  --muted: #7a8a72;
  --line: #d7e3cc;
  --brown: #6f8564;
  --deep: #7e9b62;
  --gold: #92c74d;
  --danger: #b42318;
  --pref: #7e9b62;
  --pref-soft: #eef5e4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; max-width: 100%; overflow-x: hidden; overflow-anchor: none; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 520px at 8% -12%, rgba(165, 196, 125, 0.28), transparent 52%),
    var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Sans", "Yu Gothic", sans-serif;
}

.sheet {
  max-width: 440px;
  margin: 0 auto;
  padding: 20px 16px 40px;
}

.form-hero {
  padding: 6px 4px 18px;
}

.brand {
  font-size: 11px;
  letter-spacing: 0.28em;
  color: var(--muted);
  margin-bottom: 10px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 14px;
}

.brand-logo {
  display: block;
  height: 52px;
  width: auto;
  background: transparent;
}

.brand-kicker {
  font-family: Parisienne, cursive;
  font-size: 22px;
  color: var(--gold);
  line-height: 1.1;
}

h1 {
  font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.45;
  margin: 0 0 8px;
  color: #3a4636;
}

h2 {
  font-family: "Noto Sans JP", "Hiragino Sans", sans-serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  color: #3a4636;
}

.lead {
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
  margin: 0 0 16px;
}

.progress {
  margin: 14px 0 0;
}
.progress-rail {
  position: relative;
  height: 2px;
  background: var(--line);
  border-radius: 99px;
  margin: 8px 8px 0;
}
.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: var(--deep);
  border-radius: 99px;
}
.progress .dot {
  position: absolute;
  top: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--line);
  box-sizing: border-box;
}
.progress .dot.is-done {
  background: var(--gold);
  border-color: var(--gold);
}
.progress .dot.is-on {
  background: var(--deep);
  border-color: var(--deep);
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
}
.progress-now {
  margin: 10px 0 0;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
}
.progress-now b {
  color: var(--deep);
  margin-right: 8px;
  font-weight: 700;
}

.pager-form {
  background: var(--paper);
  border: 1px solid rgba(126, 155, 98, 0.16);
  border-radius: 22px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 40px rgba(126, 155, 98, 0.08);
}

.step { display: none; }
.step.on { display: block; }

.step-kicker {
  margin: 0 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.field { margin-bottom: 18px; }
.field-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.field-head label {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.field-head-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.when.date-only {
  grid-template-columns: 1fr;
}
.req {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--brown);
  background: var(--pref-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

input, select, textarea {
  width: 100%;
  max-width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}
input:focus, select:focus, textarea:focus {
  outline: 2px solid rgba(146, 199, 77, 0.45);
  border-color: var(--gold);
}
input[data-other-for] { margin-top: 8px; }
textarea { min-height: 108px; resize: vertical; }

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.choice-grid.many {
  grid-template-columns: repeat(3, 1fr);
}
.choice-grid.row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.choice-grid.stack {
  grid-template-columns: 1fr;
}
.choice-grid.stack .choice span {
  justify-content: flex-start;
  text-align: left;
  padding: 12px 14px;
  min-height: 52px;
  font-size: 13px;
  line-height: 1.45;
}
.opt {
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--pref-soft);
  border-radius: 999px;
  padding: 2px 7px;
}
.field-hint {
  margin: -4px 0 8px;
  font-size: 12px;
  color: var(--muted);
}
#move-detail-wrap .field-hint {
  white-space: pre-line;
}
.parts-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.parts-row input { min-width: 0; flex: 1; }
.parts-box { flex: 1; min-width: 0; margin: 0; }
.parts-cap {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin: 0 0 4px;
  font-weight: 600;
}
.parts-row .hyphen {
  flex: 0 0 auto;
  padding-bottom: 12px;
  color: var(--muted);
  font-weight: 700;
}
.postal-parts input:first-child { flex: 0 0 4.8em; }
.when {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 8px;
}
.when.ymd-hm {
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
}
.when.time-range {
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  margin-top: 8px;
}
.when.time-range > span {
  padding-bottom: 12px;
  color: var(--muted);
}
.when.time-range label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.choice-grid.row .choice span {
  min-height: 40px;
  padding: 8px 4px;
  font-size: 14px;
}

.with-unit {
  display: flex;
  align-items: center;
  gap: 8px;
}
.with-unit input { flex: 1; min-width: 0; }
.with-unit .unit {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}
.choice {
  display: block;
  margin: 0;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}
.choice span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 6px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  line-height: 1.3;
}
.choice:has(input:checked) span {
  background: var(--deep);
  color: #fff;
  border-color: var(--deep);
}

.dates { display: flex; gap: 8px; }
.dates select { flex: 1; }

.actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
button.btn {
  flex: 1;
  border: 0;
  background: var(--deep);
  color: #fff;
  padding: 14px 12px;
  border-radius: 14px;
  font: inherit;
  font-size: 15px;
}
button.btn.ghost {
  background: transparent;
  color: var(--brown);
  border: 1px solid var(--line);
}
button.btn:disabled { opacity: 0.55; }

.err {
  color: var(--danger);
  font-size: 13px;
  margin: 0 0 10px;
  min-height: 1.2em;
}
.err[hidden] { display: none; }

.thanks {
  text-align: center;
  padding: 72px 18px;
  background: var(--paper);
  border-radius: 22px;
  margin-top: 24px;
}
.thanks h1 { margin-bottom: 10px; }
.sent-copy {
  text-align: left;
  margin: 20px 0 0;
  padding: 14px 14px 12px;
  background: var(--bg);
  border: 1px solid var(--line, #e4d8cc);
  border-radius: 12px;
}
.sent-copy-title {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.sent-copy-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 13px;
  line-height: 1.55;
}
.next-choice {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  text-align: left;
}
.next-choice .btn {
  width: 100%;
  display: block;
  line-height: 1.45;
}
.pager-form.is-submitting {
  pointer-events: none;
  opacity: 0.72;
}

.sending {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(90, 110, 78, 0.42);
  padding: 24px;
}
.sending-card {
  width: min(300px, 100%);
  background: var(--paper);
  border-radius: 18px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 16px 40px rgba(90, 110, 78, 0.2);
}
.sending-title {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 700;
}
.sending-lead {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.area-range {
  display: flex;
  align-items: end;
  gap: 8px;
}
.area-box {
  flex: 1;
  min-width: 0;
  display: block;
  margin: 0;
}
.area-box span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: var(--muted);
}
.area-tilde {
  flex: 0 0 auto;
  padding-bottom: 14px;
  color: var(--muted);
  font-size: 16px;
}

.pref-helper { margin-top: 14px; overflow-anchor: none; }
.pref-helper-toggle {
  width: 100%;
  border: 1px dashed var(--pref);
  background: var(--pref-soft);
  color: var(--pref);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}
.pref-helper-toggle.on { border-style: solid; }
.pref-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
.pref-sheet[hidden],
.pref-cat-body[hidden],
.pref-cat-count[hidden] {
  display: none !important;
}
.pref-sheet-back {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(90, 110, 78, 0.46);
}
.pref-sheet-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 440px;
  margin-top: auto;
  height: min(92dvh, 100%);
  min-height: 0;
  padding: 12px 14px calc(16px + env(safe-area-inset-bottom, 0px));
  border-radius: 18px 18px 0 0;
  background: var(--paper);
  box-shadow: 0 -8px 28px rgba(90, 110, 78, 0.18);
}
.pref-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.pref-sheet-title {
  flex: 1;
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
}
.pref-sheet-head .btn { flex: 0 0 auto; width: auto; padding: 8px 14px; }
.pref-sheet .field-hint { margin: 0 0 8px; }
.pref-sheet .pref-search { margin-bottom: 8px; }
.pref-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
}
body.pref-sheet-open { overflow: hidden; }
.pref-search {
  margin-bottom: 10px;
  padding: 11px 12px;
  border-radius: 12px;
}
.pref-cat { margin: 0 0 8px; }
.pref-cat-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff8f2;
  color: var(--pref);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
}
.pref-cat.open .pref-cat-head {
  border-color: var(--pref);
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}
.pref-cat-count {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--pref);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
}
.pref-cat-chevron {
  margin-left: auto;
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}
.pref-cat.open .pref-cat-chevron { transform: rotate(-135deg); }
.pref-cat-body {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--pref);
  border-top: 0;
  border-radius: 0 0 12px 12px;
  background: #fff;
}
.pref-ico {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  color: var(--pref);
}
.pref-order { margin: 8px 0 4px; overflow-anchor: none; }
.pref-order-hint {
  margin: 0 0 4px;
  font-size: 12px;
  color: var(--muted);
}
.pref-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  overflow-anchor: none;
}
.pref-chip-n {
  flex: 0 0 auto;
  color: var(--pref);
  font-weight: 700;
  font-size: 14px;
}
.pref-chip-t {
  min-width: 0;
  flex: 1;
  font-size: 14px;
  line-height: 1.35;
}
.pref-chip-move {
  display: flex;
  gap: 2px;
}
.pref-chip-move button {
  min-width: 36px;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 11px;
}
.pref-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  font: inherit;
  font-size: 12px;
  line-height: 1.25;
}
.pref-tag-label { white-space: nowrap; }
.pref-tag-lv {
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--pref);
}
[data-pref-target="must"] .pref-tag.is-on {
  border-color: #c45d16;
  background: #f3d2b4;
}
[data-pref-target="want"] .pref-tag.is-on {
  border-color: var(--pref);
  background: var(--pref-soft);
}
.pref-tag.is-used,
.pref-tag:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  background: #f3f0eb;
}
@media (max-width: 360px) {
  .choice-grid.many { grid-template-columns: 1fr 1fr; }
}

.import-note {
  margin: 0 0 16px;
  padding: 10px 12px;
  background: var(--pref-soft);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--brown);
}

.q-label {
  margin: 0 0 8px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.warn {
  margin: 0 0 14px;
  padding: 10px 12px;
  background: #fff4eb;
  border: 1px solid #e7c4a4;
  border-radius: 12px;
  color: #8a4b16;
  font-size: 13px;
  line-height: 1.55;
}

.consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 16px;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
}
.consent input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--deep);
}
.consent span {
  font-size: 13px;
  line-height: 1.55;
}
.consent-list {
  margin: 8px 0 0;
  padding-left: 1.2em;
}
.consent-list li {
  margin: 0 0 6px;
}
.consent-list li:last-child { margin-bottom: 0; }
.req.opt { background: #f4ebe1; }

/* 送信の失敗（完了画面にはしない。理由・再送ボタン。入力はそのまま） */
.submit-error {
  margin: 16px 0 8px;
  padding: 14px 14px 12px;
  border: 1px solid var(--danger);
  border-radius: 14px;
  background: #fff7f6;
  text-align: left;
}
.submit-error-title { margin: 0 0 6px; font-weight: 700; color: var(--danger); font-size: 15px; }
.submit-error-text { margin: 0 0 6px; font-size: 14px; line-height: 1.6; }
.submit-error-note { margin: 0 0 10px; font-size: 12px; color: var(--brown, #6b5a4b); }
.submit-error-actions { display: flex; flex-direction: column; gap: 8px; }
.submit-error-actions .btn { width: 100%; }
.submit-error .sent-copy-body { max-height: 160px; overflow: auto; font-size: 12px; white-space: pre-wrap; margin: 0 0 10px; }
.pending-submit { margin: 12px 12px 0; }
