:root {
  --brand: #aa3030;
  --brand-tint: #fbf1f1;
  --bg: #f5f3f3;
  --surface: #fff;
  --text: #262626;
  --muted: #555;
  --subtle: #666;
  --line: #c9c4c4;
  --danger: #c0392b;
  --danger-bg: #fdecec;
  --danger-text: #8a1f1f;
  --radius: 8px;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Meiryo", "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif; font-size: 15px; line-height: 1.7; }
.wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
header { border-top: 6px solid var(--brand); background: var(--surface); padding: 18px 24px; border-radius: 0 0 var(--radius) var(--radius); margin-bottom: 16px; }
header .brand { font-size: 12px; color: var(--brand); font-weight: bold; letter-spacing: .05em; }
header h1 { margin: 4px 0 0; font-size: 20px; }
/* 日本語を文節の区切りで折り返す（対応しているブラウザだけ。Safari は従来どおり） */
body { word-break: auto-phrase; }
/* 見出しを語の途中で折り返さない（区切りごとにまとめる） */
.nowrap { display: inline-block; }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px 24px; margin-bottom: 16px; }
.card h2 { margin: 0 0 12px; font-size: 16px; border-left: 4px solid var(--brand); padding-left: 8px; }
.lead { color: var(--muted); font-size: 14px; }
label, .label { display: block; font-weight: bold; margin: 14px 0 4px; font-size: 14px; }
.req::after { content: " *"; color: var(--danger); }
.help { font-weight: normal; color: var(--subtle); font-size: 12px; margin: 0 0 4px; }
input[type=text], input[type=email], input[type=tel], input[type=date], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface); }
input:focus-visible, textarea:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
input[readonly] { background: #f0eeee; color: #444; }
textarea { min-height: 80px; }
.choices label { font-weight: normal; display: flex; align-items: flex-start; gap: 8px; margin: 6px 0; padding: 10px 12px; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; }
.choices label:has(input:checked) { border-color: var(--brand); background: var(--brand-tint); }
.choices label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 1px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.sub { border: 1px dashed #d6cfcf; border-radius: 6px; padding: 4px 14px 14px; margin-top: 12px; }
.sub h3 { font-size: 14px; margin: 10px 0 0; }
.btns { display: flex; gap: 12px; justify-content: flex-end; margin-top: 8px; }
.btns.left { justify-content: flex-start; }
/* 書式と確認画面の「戻る」「確認・送信」は、長い画面でも押せるようウィンドウの下に固定する */
.btns.sticky {
  position: sticky; bottom: 0; z-index: 5;
  margin-top: 16px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface); border-top: 1px solid var(--line);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 -6px 16px rgba(0, 0, 0, 0.08);
}
.card .btns.sticky { margin: 16px -24px -20px; border-radius: 0 0 var(--radius) var(--radius); }
.btns.sticky button { white-space: nowrap; }
button, a.button { font: inherit; padding: 10px 22px; border-radius: 6px; border: 1px solid var(--brand); background: var(--brand); color: #fff; cursor: pointer; text-decoration: none; display: inline-block; }
button.secondary, a.button.secondary { background: var(--surface); color: var(--brand); }
button:hover:not(:disabled), a.button:hover { filter: brightness(1.08); }
button:focus-visible, a.button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
button:disabled { opacity: .5; cursor: default; }
.err { color: var(--danger); font-size: 13px; margin-top: 4px; white-space: pre-line; }
.box-error { background: var(--danger-bg); color: var(--danger-text); border-radius: 6px; padding: 10px 14px; white-space: pre-line; margin-bottom: 12px; }
.disclaimer { background: #f7f5f5; border: 1px solid #e6e1e1; border-radius: 6px; padding: 10px 14px; font-size: 13px; margin: 6px 0; height: 180px; overflow-y: auto; overscroll-behavior: contain; }
.disclaimer:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.disclaimer-note { margin: 12px 0 0; color: var(--danger-text); font-weight: bold; }
.disclaimer ul { margin: 0; padding-left: 18px; }
.disclaimer li { margin: 2px 0; }
table.confirm { width: 100%; border-collapse: collapse; font-size: 14px; }
table.confirm th { text-align: left; width: 38%; color: var(--muted); font-weight: normal; padding: 6px 8px; border-bottom: 1px solid #eee; vertical-align: top; }
table.confirm td { padding: 6px 8px; border-bottom: 1px solid #eee; white-space: pre-wrap; word-break: break-all; }
.receipt { font-size: 22px; font-weight: bold; color: var(--brand); letter-spacing: .03em; }
.hidden { display: none !important; }
.m0 { margin: 0; }
.mt16 { margin-top: 16px; }
.mt18 { margin-top: 18px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } .card { padding: 18px 16px; } .card .btns.sticky { margin: 16px -16px -18px; } .btns.sticky { gap: 8px; padding-left: 12px; padding-right: 12px; } .btns.sticky button { flex: 1; padding: 10px 8px; } }
/* 機器ごとの入力欄（3〜6） */
.device { margin-bottom: 8px; }
.device + .device { margin-top: 28px; padding-top: 20px; border-top: 2px dashed var(--line); }
.device-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 4px 10px; }
.device-title { margin: 0; font-size: 17px; color: var(--brand); }
button.small { padding: 6px 12px; font-size: 13px; }
.add-device { margin: 0 0 24px; padding: 16px 20px; border: 2px dashed var(--brand); border-radius: var(--radius); background: var(--brand-tint); }
.add-device .help { margin: 8px 0 0; }
table.confirm tr.group th { width: auto; color: var(--brand); font-weight: bold; padding-top: 16px; border-bottom: 2px solid var(--brand-tint); }
/* メニュー */
.menu { display: grid; gap: 12px; margin-top: 8px; }
.menu-item { display: block; width: 100%; text-align: left; background: var(--surface); color: var(--text); border: 1px solid var(--line); border-left: 6px solid var(--brand); border-radius: var(--radius); padding: 14px 16px; }
.menu-item:hover:not(:disabled) { background: var(--brand-tint); filter: none; }
.menu-title { display: block; font-weight: bold; font-size: 16px; color: var(--brand); }
.menu-desc { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-title { font-size: 18px; }
/* MC65S：製品の選択と NW 環境の表 */
.sub-label { font-size: 13px; color: var(--muted); margin: 10px 0 0; font-weight: bold; }
.choices.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 8px; }
table.nw { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 8px; }
table.nw th { text-align: left; font-weight: normal; color: var(--muted); padding: 4px 6px 4px 0; white-space: nowrap; }
table.nw thead th { font-weight: bold; }
table.nw td { padding: 3px 3px; }
table.nw input { padding: 7px 8px; }
.disclaimer.tall { height: 260px; }
.notes-title { font-weight: bold; margin: 10px 0 2px; }
.notes-title:first-child { margin-top: 0; }
select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 6px; font: inherit; background: var(--surface); }
select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; border-color: var(--brand); }
@media (max-width: 560px) {
  .choices.grid3 { grid-template-columns: 1fr; }
  table.nw, table.nw tbody, table.nw tr, table.nw th, table.nw td { display: block; width: 100%; }
  table.nw thead { display: none; }
  table.nw tbody th { padding-top: 10px; }
  table.nw td::before { display: block; font-size: 12px; color: var(--subtle); }
  table.nw td:nth-of-type(1)::before { content: '貴社導入'; }
  table.nw td:nth-of-type(2)::before { content: '他社導入'; }
}
h2[tabindex="-1"]:focus { outline: none; }
/* 個人情報の取り扱いの表示 */
.privacy { margin: 10px 0 0; }
.privacy a { color: var(--brand); text-decoration: underline; }
.privacy a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
