/* 公開フォームテーマ（pages/form-public.html） */
/* 背景は画面いっぱい（body）、フォーム本体は中央カード。テーマ別の背景色は body に付与（JSで fm-theme-* を body へ） */
html { min-height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: #eef4fb;
}
body.fm-theme-standard { background: linear-gradient(180deg, #eef4fb 0%, #dbe8f6 100%); }
body.fm-theme-minimal  { background: #ffffff; }
body.fm-theme-card     { background: #e6ebf2; }
body.fm-theme-custom1  { background: #ebebeb; }

.fm-root {
  --fm-primary: #378add;
  --fm-accent: #185fa5;
  font-family: "ヒラギノ角ゴ ProN", "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, Meiryo, sans-serif;
  color: #334155;
  line-height: 1.5;
  max-width: 620px;
  margin: 40px auto;
  padding: 24px 16px 48px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.10);
  overflow: hidden; /* ヘッダーロゴ/色帯バナーの角丸クリップ */
}
/* スタンダード: 定番・白カード・青アクセント・枠線入力（＝ベース既定） */
.fm-root.fm-theme-standard {
  background: #fff;
}
/* ミニマル: フラット（影・角丸・枠なし）。入力は下線のみ・モノトーン */
.fm-root.fm-theme-minimal {
  background: #fff;
  box-shadow: none;
  border-radius: 0;
}
/* カード型: 浮いたカード（強い影・大きな角丸）＋色帯ヘッダー・塗り入力・ピルボタン */
.fm-root.fm-theme-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.16);
  border: none;
}
.fm-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--fm-accent);
  margin: 0 0 8px;
}
.fm-headline {
  font-size: 0.85rem;
  color: #64748b;
  margin: 0 0 20px;
}
/* カスタムヘッダー（ロゴ画像 / 色帯バナー）。fm-root の padding(24px 16px) を打ち消して端まで表示 */
.fm-hd-logo {
  margin: -24px -16px 6px;
  padding: 16px 20px 0;
}
.fm-hd-logo img {
  max-height: 54px;
  max-width: 80%;
  object-fit: contain;
  vertical-align: middle;
}
.fm-hd-banner {
  margin: 0 -16px 18px;
  padding: 20px 24px;
}
.fm-hd-banner .fm-title {
  margin: 0;
}
/* 角丸テーマでバナーがはみ出さないように */
.fm-root.fm-theme-card,
.fm-root.fm-theme-minimal {
  overflow: hidden;
}
.fm-field {
  margin-bottom: 16px;
}
.fm-note {
  margin-top: 6px;
  padding: 2px 0;
  font-size: 12px;
  color: #475569;
  line-height: 1.5;
}
.fm-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.fm-row > .fm-field {
  flex: 1 1 0;
  min-width: 0;
  margin-bottom: 0;
}
/* 単独半幅は半分のみ占有 */
.fm-row > .fm-field:only-child {
  max-width: calc(50% - 4px);
}
.fm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: #475569;
}
.fm-api-display {
  padding: 10px 12px;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  font-size: 0.9rem;
  color: #065f46;
}
.fm-input,
.fm-textarea,
.fm-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  box-sizing: border-box;
}
/* プレースホルダーは既定より薄いグレーに（Firefox は既定で薄くなるため opacity:1 で揃える） */
.fm-input::placeholder,
.fm-textarea::placeholder { color: #aab2bd; opacity: 1; }
/* フィールド編集の「文字色」(--fm-fc) を、そのフィールドのラベル・入力文字・注意書きに適用する */
.fm-field[style*="--fm-fc"] .fm-label,
.fm-field[style*="--fm-fc"] .fm-input,
.fm-field[style*="--fm-fc"] .fm-textarea,
.fm-field[style*="--fm-fc"] .fm-select,
.fm-field[style*="--fm-fc"] .fm-note { color: var(--fm-fc); }
.fm-textarea {
  min-height: 100px;
  resize: vertical;
}
.fm-divider {
  border: 0;
  border-top: 1px solid #e2e8f0;
  margin: 20px 0;
}
.fm-divider-section {
  margin: 24px 0 8px;
}
.fm-divider-section .fm-divider {
  margin: 8px 0 0;
}
.fm-divider-text {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  margin: 0 0 4px;
}
.fm-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--fm-primary);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  margin-top: 8px;
}
.fm-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.fm-done {
  padding: 20px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 10px;
  color: #166534;
  font-weight: 600;
}
.fm-error {
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 8px;
  color: #b91c1c;
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.fm-privacy {
  margin: 20px 0 8px;
  padding: 14px 16px;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #475569;
}
.fm-privacy a {
  color: #2563eb;
  text-decoration: underline;
}
.fm-privacy strong {
  font-weight: 700;
}
.fm-footer {
  margin: 18px 0 8px;
  padding: 12px 14px;
  font-size: 0.8rem;
  line-height: 1.7;
  color: #475569;
}
.fm-footer a {
  color: #2563eb;
  text-decoration: underline;
}
.fm-footer strong {
  font-weight: 700;
}
.fm-radio-row,
.fm-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 0.9rem;
}
/* 選択肢の横並び（ラジオ／チェック）。5段階評価などに */
.fm-opts-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 28px;
}
.fm-opts-inline .fm-radio-row,
.fm-opts-inline .fm-check-row {
  flex: 0 0 auto;
  margin-bottom: 4px;
}
/* 段階評価（両端ラベル付き）: 選択肢を全幅に均等配置し、両端ラベルと揃える */
.fm-scale-ends {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
  margin-bottom: 4px;
}
/* 段階評価は flex の折返し(space-between)だと2段目が全幅に散って列が揃わない。
   グリッドにして列を均等化し、上下段の列を揃える。列数は JS が --fm-cols で渡す。 */
.fm-opts-inline.fm-scale {
  display: grid;
  grid-template-columns: repeat(var(--fm-cols, 5), minmax(0, 1fr));
  gap: 8px 4px;
}
.fm-opts-inline.fm-scale .fm-radio-row,
.fm-opts-inline.fm-scale .fm-check-row {
  justify-content: center;
  padding: 4px 2px;
  margin-bottom: 0;
}
/* スマホ: 列数を最大5に抑えて2段(10段階=5×2)で整列。横あふれ・バラつきを防ぐ。 */
@media (max-width: 560px) {
  .fm-opts-inline.fm-scale {
    grid-template-columns: repeat(var(--fm-cols-m, 5), minmax(0, 1fr));
  }
}
/* 星評価（rating）: radio を視覚的に隠し、ラベル★で表現。JSで data-v<=選択値 に .on を付与 */
.fm-stars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.fm-stars .fm-star-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.fm-stars .fm-star {
  font-size: 30px;
  line-height: 1;
  color: #d4d4d8;
  cursor: pointer;
  transition: color .1s ease, transform .1s ease;
  user-select: none;
}
.fm-stars .fm-star:hover { transform: scale(1.12); }
.fm-stars .fm-star.on { color: #f5b301; }
.fm-stars .fm-star-input:focus-visible + .fm-star { outline: 2px solid #378add; outline-offset: 2px; border-radius: 4px; }
.fm-star-num { margin-left: 8px; font-size: 0.85rem; font-weight: 700; color: #334155; min-width: 2.5em; }
.fm-confirm-table {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
}
.fm-confirm-row {
  display: flex;
  border-bottom: 1px solid #f1f5f9;
}
.fm-confirm-row:last-child {
  border-bottom: none;
}
.fm-confirm-label {
  width: 200px;
  flex-shrink: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #475569;
  background: #f8fafc;
}
.fm-confirm-value {
  flex: 1;
  padding: 10px 14px;
  font-size: 0.85rem;
  color: #1e293b;
  word-break: break-word;
}
.fm-date-selects {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.fm-date-y { width: 100px; }
.fm-date-m { width: 70px; }
.fm-date-d { width: 70px; }
.fm-date-sep {
  font-size: 0.85rem;
  color: #475569;
  flex-shrink: 0;
}
/* 複数チェックボックス: 既定は1列（プレビューと一致・長文の選択肢もそのまま1行ずつ）。
   従来は width:50% で強制2列になり、プレビュー(1列)と食い違い、かつ「横並び」トグルも
   .fm-check-group .fm-check-row に上書きされて効かなかった。 */
.fm-check-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}
/* 「選択肢を横並びにする」ON時のみ横に流す（5段階評価など短い選択肢向け）。
   詳細度を .fm-check-group より高くして確実に効かせる。 */
.fm-check-group.fm-opts-inline {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px 28px;
}
.fm-check-group.fm-opts-inline .fm-check-row {
  flex: 0 0 auto;
  width: auto;
  margin-bottom: 4px;
}
/* ── ミニマルテーマ: モノトーン・下線入力・フラット ── */
.fm-theme-minimal .fm-title {
  color: #111827;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.fm-theme-minimal .fm-headline { color: #9ca3af; }
.fm-theme-minimal .fm-label { color: #374151; font-weight: 500; }
.fm-theme-minimal .fm-input,
.fm-theme-minimal .fm-textarea,
.fm-theme-minimal .fm-select {
  border: none;
  border-bottom: 1.5px solid #d1d5db;
  border-radius: 0;
  background: transparent;
  padding: 8px 2px;
}
.fm-theme-minimal .fm-input:focus,
.fm-theme-minimal .fm-textarea:focus,
.fm-theme-minimal .fm-select:focus {
  outline: none;
  border-bottom-color: #111827;
}
.fm-theme-minimal .fm-submit {
  background: #111827;
  border-radius: 2px;
}

/* ── カードテーマ: 色帯ヘッダー・塗り入力・ピルボタン ── */
/* ロゴ/バナー未使用時(=タイトルが先頭)だけ色帯にする。ロゴ/バナー時は素通し */
.fm-theme-card .fm-title:first-child {
  background: var(--fm-primary);
  color: #fff;
  margin: -24px -16px 0;
  padding: 22px 20px 6px;
}
.fm-theme-card .fm-title:first-child + .fm-headline {
  background: var(--fm-primary);
  color: rgba(255, 255, 255, 0.9);
  margin: 0 -16px 18px;
  padding: 0 20px 20px;
}
.fm-theme-card .fm-input,
.fm-theme-card .fm-textarea,
.fm-theme-card .fm-select {
  border: none;
  background: #eef2f7;
  border-radius: 10px;
}
.fm-theme-card .fm-input:focus,
.fm-theme-card .fm-textarea:focus,
.fm-theme-card .fm-select:focus {
  outline: 2px solid var(--fm-primary);
  outline-offset: 1px;
  background: #fff;
}
.fm-theme-card .fm-submit {
  border-radius: 999px;
  padding: 13px 40px;
  display: block;
  margin: 22px auto 0;
}

/* ── カスタム１テーマ ── */
.fm-root.fm-theme-custom1 {
  --fm-primary: #27ae60;
  --fm-accent: #2c3e50;
  background: #fff;
  max-width: 640px;
}
.fm-theme-custom1 .fm-title {
  text-align: center;
  color: #2c3e50;
  font-size: 1.5rem;
  padding: 24px 0 16px;
  border-bottom: 2px solid #2c3e50;
  margin-bottom: 20px;
}
.fm-theme-custom1 .fm-headline {
  color: #555;
  font-size: 0.85rem;
}
.fm-theme-custom1 .fm-label {
  color: #333;
  font-size: 0.85rem;
  font-weight: 600;
}
.fm-theme-custom1 .fm-label .fm-req {
  background: #e74c3c;
  color: #fff;
  font-size: 0.65rem;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  font-weight: 700;
}
.fm-theme-custom1 .fm-input,
.fm-theme-custom1 .fm-textarea,
.fm-theme-custom1 .fm-select {
  border: none;
  border-bottom: 1px solid #ccc;
  border-radius: 0;
  background: transparent;
  padding: 8px 4px;
  font-size: 0.95rem;
}
.fm-theme-custom1 .fm-input:focus,
.fm-theme-custom1 .fm-textarea:focus,
.fm-theme-custom1 .fm-select:focus {
  outline: none;
  border-bottom-color: #2c3e50;
}
.fm-theme-custom1 .fm-submit {
  background: #27ae60;
  border-radius: 24px;
  padding: 14px 48px;
  font-size: 1rem;
  display: block;
  margin: 24px auto 0;
}
.fm-theme-custom1 .fm-submit:hover {
  background: #219a52;
}
.fm-theme-custom1 .fm-field {
  margin-bottom: 20px;
  padding-bottom: 4px;
}
.fm-theme-custom1 .fm-check-row {
  display: inline-flex;
  min-width: 180px;
  margin-bottom: 6px;
}

/* ── 確認ページボタンコンテナ ── */
.fm-confirm-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 24px;
}

/* ── モバイル対応: 確認ページ・完了ページ ── */
@media (max-width: 600px) {
  .fm-confirm-row {
    flex-direction: column;
  }
  .fm-confirm-label {
    width: 100% !important;
    padding: 8px 12px 4px;
    font-size: 0.75rem;
  }
  .fm-confirm-value {
    padding: 4px 12px 10px;
    font-size: 0.85rem;
  }
  .fm-confirm-buttons {
    flex-direction: column;
    gap: 10px;
  }
  .fm-confirm-buttons .fm-submit {
    width: 100%;
    padding: 14px 16px;
    box-sizing: border-box;
  }
  .fm-done {
    padding: 16px;
    font-size: 0.9rem;
    word-break: break-word;
  }
}

/* ── モバイル: カードを端まで広げる（浮いた余白を作らない） ── */
@media (max-width: 640px) {
  .fm-root,
  .fm-root.fm-theme-standard,
  .fm-root.fm-theme-minimal,
  .fm-root.fm-theme-card,
  .fm-root.fm-theme-custom1 {
    max-width: 100%;
    margin: 0 auto;
    border-radius: 0;
    box-shadow: none;
  }
}

/* ── カスタムA: 項目名を左、入力を右に置く横並び型 ──
   ワールドエステートの既存フォーム（digital-eyes.jp）に体裁を寄せたもの。
   1行1項目・点線区切り・薄いグレーの塗り入力・必須は緑バッジ。
   狭い画面では縦積みに戻す（横並びのままだと入力欄が潰れるため）。 */
body.fm-theme-customA { background: #ffffff; }
.fm-root.fm-theme-customA {
  --fm-primary: #14a19a;
  --fm-accent: #0f7f79;
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "游ゴシック", YuGothic, Meiryo, sans-serif;
  max-width: 1100px;
  color: #333;
  background: #fff;
  border-radius: 0;
  box-shadow: none;
  padding: 24px 16px 56px;
}
.fm-theme-customA .fm-title {
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: .14em;
  text-align: center;
  color: #333;
  padding-bottom: 14px;
  border-bottom: 1px solid #d8d8d8;
  max-width: 460px;
  margin: 8px auto 28px;
}
.fm-theme-customA .fm-headline {
  color: #333;
  font-size: .95rem;
  padding-bottom: 14px;
  border-bottom: 1px solid #e6e6e6;
  margin-bottom: 0;
}
/* 1項目＝1行。左が項目名、右が入力欄 */
.fm-theme-customA .fm-field {
  display: grid;
  grid-template-columns: 340px 1fr;
  align-items: start;
  gap: 0 24px;
  margin: 0;
  padding: 22px 4px;
  border-bottom: 1px dotted #d0d0d0;
}
.fm-theme-customA .fm-label {
  font-size: .875rem;
  font-weight: 400;
  color: #333;
  margin: 8px 0 0;
  line-height: 1.6;
}
/* 半幅（.fm-row）も、中の項目は他と同じ「左が項目名・右が入力欄」で1行ずつ並べる。
   .fm-row 自体を段組みにすると、中の .fm-field の項目名の列（340px）が
   行の1列目に収まりきらず、入力欄が項目名の下に落ちる。 */
.fm-theme-customA .fm-row {
  display: block;
  margin: 0;
  padding: 0;
  border: 0;
}
.fm-theme-customA .fm-row > .fm-field,
.fm-theme-customA .fm-row > .fm-field:only-child {
  max-width: none;
}
/* 半幅は「短い入力欄」の意図なので、入力欄だけ狭くする */
.fm-theme-customA .fm-row .fm-input,
.fm-theme-customA .fm-row .fm-select {
  max-width: 280px;
}
.fm-theme-customA .fm-input,
.fm-theme-customA .fm-textarea,
.fm-theme-customA .fm-select {
  background: #f6f6f6;
  border: 0;
  border-radius: 0;
  color: #555;
  font-size: 1rem;
  padding: 8px 12px;
  min-height: 40px;
  max-width: 560px;
}
.fm-theme-customA .fm-input:focus,
.fm-theme-customA .fm-textarea:focus,
.fm-theme-customA .fm-select:focus {
  outline: 2px solid var(--fm-primary);
  outline-offset: -2px;
  background: #fff;
}
/* 注記は入力欄の下（右カラム）に置く。grid の直下だと左カラムに落ちてしまう */
.fm-theme-customA .fm-field > .fm-note {
  grid-column: 2;
  color: #555;
  font-size: .8rem;
  margin-top: 6px;
}
.fm-theme-customA .fm-note {
  color: #555;
  font-size: .8rem;
  margin-top: 6px;
}
/* ラベルと入力の2つだけが並ぶ前提。3つ目以降（注記など）も右カラムに送る */
.fm-theme-customA .fm-field > *:not(.fm-label) { grid-column: 2; }
.fm-theme-customA .fm-field > .fm-label { grid-column: 1; }
/* 必須は緑のバッジ */
.fm-theme-customA .fm-req {
  display: inline-block;
  background: #14a19a;
  color: #fff;
  font-size: 10px;
  font-weight: 400;
  line-height: 1;
  padding: 3px 5px;
  border-radius: 2px;
  margin-left: 6px;
  vertical-align: 2px;
}
.fm-theme-customA .fm-submit {
  display: block;
  margin: 32px auto 0;
  min-width: 260px;
  background: var(--fm-primary);
  color: #fff;
  border: 0;
  border-radius: 2px;
  padding: 14px 28px;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: .08em;
}
.fm-theme-customA .fm-submit:hover { background: var(--fm-accent); }
.fm-theme-customA .fm-check-group,
.fm-theme-customA .fm-radio-row,
.fm-theme-customA .fm-check-row { color: #333; }
/* 画面が狭いときは縦積みに戻す */
@media (max-width: 820px) {
  .fm-theme-customA .fm-field {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 16px 2px;
  }
  .fm-theme-customA .fm-label { margin-top: 0; }
  /* 1列に戻すので、右カラム送りの指定も解除する（残すと列がずれて空白ができる） */
  .fm-theme-customA .fm-field > *:not(.fm-label),
  .fm-theme-customA .fm-field > .fm-note { grid-column: 1; }
  .fm-theme-customA .fm-input,
  .fm-theme-customA .fm-textarea,
  .fm-theme-customA .fm-select,
  .fm-theme-customA .fm-row .fm-input,
  .fm-theme-customA .fm-row .fm-select { max-width: none; }
}

/* ═══════════════════════════════════════════════════════════════════
   触り心地（タッチUX）強化 — 全テーマ共通・各テーマの見た目は保持
   ・タップ領域を広げる（チェック/ラジオ、送信ボタン、複数選択）
   ・指で押しやすいコントロールサイズ、押下/ホバーのフィードバック
   ・入力のトランジション、iOSの入力時ズーム防止
   ═══════════════════════════════════════════════════════════════════ */
.fm-input, .fm-select, .fm-textarea, .fm-submit,
.fm-check-row, .fm-radio-row, .fm-star, .fm-msel-control, .fm-msel-x {
  -webkit-tap-highlight-color: transparent;
}
.fm-input, .fm-select, .fm-textarea {
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
/* iOSは入力欄のfont-sizeが16px未満だとフォーカス時に自動ズームする。スマホ幅のみ16pxに上げて防止（PCの見た目は不変） */
@media (max-width: 768px) {
  .fm-input, .fm-select, .fm-textarea { font-size: 16px; }
}
/* チェック/ラジオ: コントロールを大きく、行全体に余白とホバー/押下ハイライトでタップしやすく */
.fm-check-row, .fm-radio-row {
  min-height: 44px;
  padding: 4px 8px;
  margin-bottom: 2px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color .12s ease;
}
.fm-check-row:hover, .fm-radio-row:hover { background: rgba(0, 0, 0, .035); }
.fm-check-row:active, .fm-radio-row:active { background: rgba(0, 0, 0, .06); }
.fm-check-row > input[type="checkbox"], .fm-check-row > input[type="radio"],
.fm-radio-row > input[type="checkbox"], .fm-radio-row > input[type="radio"] {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  cursor: pointer;
  accent-color: var(--fm-primary, #2563eb);
}
.fm-check-row > label, .fm-radio-row > label { cursor: pointer; flex: 1 1 auto; line-height: 1.45; }
/* 横並び（5段階評価など短い選択肢）は高さを詰めたまま */
.fm-opts-inline .fm-check-row, .fm-opts-inline .fm-radio-row { min-height: 0; padding: 2px 6px; margin-bottom: 4px; }
/* 送信ボタン: 押した感（沈む）＋ホバーの浮き、タップ領域を確保 */
.fm-submit { transition: transform .08s ease, box-shadow .15s ease, background-color .15s ease; min-height: 48px; }
.fm-submit:not(:disabled):hover { box-shadow: 0 6px 18px rgba(0, 0, 0, .14); }
.fm-submit:not(:disabled):active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(0, 0, 0, .12); }
/* 複数選択コントロールもタップしやすい高さに */
.fm-msel-control { min-height: 44px; }
/* 長いチェックリストは画面幅に応じて複数カラムに流し込む（スマホ=1列/PC=2列。行は途中で割れない）。
   横並び(.fm-opts-inline)と、複数選択のドロップダウン内(.fm-msel-menu)は対象外。 */
.fm-field > .fm-check-group:not(.fm-opts-inline) {
  display: block;
  columns: 260px 2;
  column-gap: 32px;
}
.fm-field > .fm-check-group:not(.fm-opts-inline) > .fm-check-row { break-inside: avoid; }
.fm-field > .fm-check-group:not(.fm-opts-inline) > .fm-opt-heading { break-inside: avoid; column-span: all; }

/* リアルタイム検証（#3）: エラー時の赤枠とインラインメッセージ */
.fm-field.fm-invalid .fm-input,
.fm-field.fm-invalid .fm-select,
.fm-field.fm-invalid .fm-textarea,
.fm-field.fm-invalid .fm-msel-control {
  outline: 2px solid #dc2626;
  outline-offset: -2px;
}
.fm-field-error {
  display: block;
  color: #dc2626;
  font-size: .8rem;
  margin-top: 6px;
  line-height: 1.5;
}

/* 確認・完了画面（#5）: ボタンをタップしやすく、スマホは縦積み（送信を上に）。完了は中央寄せ */
.fm-confirm-buttons { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.fm-confirm-buttons .fm-submit { flex: 1 1 auto; min-width: 160px; }
@media (max-width: 480px) {
  .fm-confirm-buttons { flex-direction: column-reverse; }
  .fm-confirm-buttons .fm-submit { width: 100%; }
}
.fm-confirm-table { box-shadow: 0 1px 3px rgba(0, 0, 0, .05); }
.fm-done { text-align: center; padding: 28px 22px; line-height: 1.7; }

/* 入力プログレスバー（#4）: 上部固定で必須項目の完了度を表示 */
.fm-progress {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  margin: 0 0 12px;
  background: rgba(255, 255, 255, .96);
  -webkit-backdrop-filter: saturate(1.4) blur(4px);
  backdrop-filter: saturate(1.4) blur(4px);
}
.fm-progress-track { flex: 1 1 auto; height: 8px; background: #e5e9f0; border-radius: 999px; overflow: hidden; }
.fm-progress-fill { height: 100%; width: 0; background: var(--fm-primary, #2563eb); border-radius: 999px; transition: width .25s ease; }
.fm-progress-text { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: #475569; white-space: nowrap; }
.fm-progress.fm-progress-done .fm-progress-text { color: var(--fm-primary, #16a34a); }
