:root {
  --bg: #faf6ef;
  --surface: #ffffff;
  --ink: #222;
  --muted: #5b5b5b;
  --accent: #7a2e2e;
  --accent-ink: #ffffff;
  --accent-2: #2f5d50;
  --line: #d9cfc0;
  --warn: #8a5a00;
  --warn-bg: #fff4d6;
  --err: #a12222;
  --err-bg: #fde6e6;
  --info-bg: #eef3f7;
  --focus: #1f6feb;
  --radius: 14px;
  font-size: 19px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: "BIZ UDPGothic", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", "Noto Sans JP", sans-serif;
  line-height: 1.7;
}
a { color: var(--accent); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 8px; top: 8px; background: #fff; padding: 8px; z-index: 10; }

.site-head { padding: 10px 16px 2px; }
.site-head h1 { margin: 0; font-size: 1.2rem; line-height: 1.35; color: var(--accent); }
.site-head h1 span { display: block; font-size: .85rem; color: var(--ink); font-weight: 600; }
.lead { margin: 2px 0 0; font-size: .78rem; line-height: 1.5; color: var(--muted); }

.layout { padding: 0 16px 24px; max-width: 1100px; margin: 0 auto; }

/* プレビュー：スマホでは上部に常に見える大きさで */
.preview { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0 6px; }
.card-wrap { display: flex; justify-content: center; }
#card {
  height: 31vh; max-height: 400px; min-height: 210px; width: auto; aspect-ratio: 100 / 148;
  background: #fff; border-radius: 4px; box-shadow: 0 2px 10px rgba(0,0,0,.18); cursor: zoom-in;
}
body.compact #card { height: 22vh; min-height: 160px; }
.preview-tools { display: flex; gap: 10px; align-items: center; justify-content: center; margin-top: 4px; flex-wrap: wrap; }
.preview-tools .btn-sub { min-height: 40px; padding: 2px 14px; margin: 0; font-size: .85rem; }
.hint { display: none; }
.step h2:focus { outline: none; }
.hint { font-size: .72rem; color: var(--muted); max-width: 26em; line-height: 1.4; }

.steps { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 14px 18px; margin-top: 8px; }
.progress { display: flex; list-style: none; padding: 0; margin: 0 0 8px; gap: 4px; font-size: .7rem; color: var(--muted); }
.progress li { flex: 1; text-align: center; border-bottom: 4px solid var(--line); padding-bottom: 2px; }
.progress li.done { border-color: var(--accent-2); color: var(--accent-2); }
.progress li.now { border-color: var(--accent); color: var(--accent); font-weight: 700; }

.step h2 { font-size: 1.3rem; margin: 4px 0 12px; }
.step h2 small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.step h3 { font-size: 1.1rem; margin: 22px 0 8px; }

.choices { display: grid; gap: 10px; }
.choices.grid3 { grid-template-columns: repeat(3, 1fr); }
.choice {
  display: block; width: 100%; min-height: 66px; text-align: left; font: inherit; font-size: 1.12rem; font-weight: 700;
  padding: 12px 16px; border: 2px solid var(--line); border-radius: var(--radius); background: #fffdf9; color: var(--ink); cursor: pointer;
}
.choices.grid3 .choice { text-align: center; padding: 10px 4px; min-height: 60px; }
.choice small { display: block; font-size: .8rem; font-weight: 400; color: var(--muted); }
.choice .ico { margin-right: 8px; }
.choice:hover { border-color: var(--accent); }
.choice[aria-pressed="true"] { border-color: var(--accent); background: #fbeeee; }
button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible, a:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.toggle { display: flex; border: 2px solid var(--accent); border-radius: 999px; overflow: hidden; margin: 0 0 12px; }
.toggle button { flex: 1; min-height: 50px; font: inherit; font-weight: 700; border: 0; background: #fff; color: var(--accent); cursor: pointer; }
.toggle button[aria-checked="true"] { background: var(--accent); color: var(--accent-ink); }

.options { display: grid; gap: 10px; margin-bottom: 14px; }
.option { text-align: left; font: inherit; padding: 12px 14px; border: 2px solid var(--line); border-radius: var(--radius); background: #fff; cursor: pointer; color: var(--ink); }
.option b { display: inline-block; background: var(--accent-2); color: #fff; border-radius: 6px; padding: 0 8px; margin-right: 6px; font-size: .85rem; }
.option .oh { font-weight: 700; }
.option .ob { display: block; font-size: .92rem; color: var(--muted); margin-top: 4px; }
.option[aria-pressed="true"] { border-color: var(--accent); background: #fbeeee; }

.btn-main { display: block; width: 100%; min-height: 62px; font: inherit; font-size: 1.15rem; font-weight: 700; border: 0; border-radius: var(--radius); background: var(--accent); color: var(--accent-ink); cursor: pointer; margin: 10px 0; }
.btn-main.alt { background: var(--accent-2); }
.btn-sub { min-height: 48px; font: inherit; font-size: .95rem; padding: 6px 14px; border: 2px solid var(--accent); border-radius: 999px; background: #fff; color: var(--accent); cursor: pointer; margin: 6px 0; }
.save-buttons .btn-sub { display: block; width: 100%; }
.btn-back { display: block; margin: 14px auto 0; min-height: 44px; font: inherit; font-size: .95rem; background: none; border: 0; color: var(--muted); text-decoration: underline; cursor: pointer; }

.field { margin: 0 0 14px; }
.field > label, .inline-field label { display: block; font-weight: 700; margin-bottom: 4px; }
input[type=text], input[type=number], select, textarea {
  width: 100%; font: inherit; font-size: 1.05rem; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { line-height: 1.6; }
#fText { font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; }
.row3 { display: grid; grid-template-columns: 1.4fr 1fr .8fr; gap: 6px; margin-bottom: 8px; }
.inline-field { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin-top: 12px; }
.inline-field label { margin: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 10px 0; font-weight: 600; }
.check input { width: 26px; height: 26px; flex: none; margin-top: 3px; }
.note { font-size: .82rem; color: var(--muted); margin: 6px 0; line-height: 1.55; }

details.more { border: 1px solid var(--line); border-radius: 10px; padding: 4px 12px; margin: 10px 0; background: #fffdf9; }
details summary { cursor: pointer; font-weight: 700; min-height: 44px; display: flex; align-items: center; }
details.more[open] { padding-bottom: 12px; }

.checks { margin: 12px 0; }
.chk { border-radius: 10px; padding: 10px 12px; margin: 6px 0; font-size: .92rem; line-height: 1.55; background: var(--info-bg); }
.chk.warn { background: var(--warn-bg); color: #5a3b00; }
.chk.error { background: var(--err-bg); color: #6d1414; }
.chk .tag { font-weight: 700; margin-right: 4px; }
.chk button { margin-left: 6px; min-height: 38px; font: inherit; font-size: .85rem; border-radius: 999px; border: 1.5px solid currentColor; background: #fff; color: inherit; padding: 2px 12px; cursor: pointer; }
.chk.ok { background: #e7f4ec; color: #1e4d33; }

.timing { border-left: 6px solid var(--accent-2); background: #eef6f2; padding: 10px 12px; border-radius: 8px; font-size: .95rem; }
.timing.warn { border-color: var(--warn); background: var(--warn-bg); }

.guide details { border-bottom: 1px solid var(--line); padding: 2px 0 6px; }
.guide ol, .guide ul { padding-left: 1.3em; margin: 6px 0; }
.guide li { margin: 6px 0; }
.src { font-size: .78rem; color: var(--muted); }

.pr-head { display: flex; align-items: center; gap: 8px; }
.pr-badge { display: inline-block; font-size: .75rem; font-weight: 700; color: #fff; background: #555; border-radius: 4px; padding: 0 6px; }
.pr-slots { display: grid; gap: 10px; }
.pr { display: block; border: 2px dashed #999; border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--ink); background: #fafafa; position: relative; }
.pr::before { content: "PR"; position: absolute; top: 8px; right: 10px; font-size: .72rem; font-weight: 700; color: #fff; background: #555; border-radius: 4px; padding: 0 6px; }
.pr strong { display: block; padding-right: 36px; }
.pr span { font-size: .85rem; color: var(--muted); }
.pr.pr-empty { opacity: .75; cursor: default; }

.site-foot { max-width: 1100px; margin: 0 auto; padding: 8px 16px 40px; font-size: .85rem; color: var(--muted); }
.site-foot details { margin: 8px 0; }
.copy { text-align: center; margin-top: 16px; }

.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.82); z-index: 20; display: flex; align-items: center; justify-content: center; padding: 16px; }
.overlay[hidden] { display: none; }
.overlay-inner { max-width: 520px; width: 100%; max-height: 100%; overflow: auto; text-align: center; }
.overlay-msg { color: #fff; font-size: .95rem; }
.overlay img { width: 100%; height: auto; background: #fff; border-radius: 4px; }
#printImg { display: none; }

.debug { position: fixed; right: 6px; bottom: 6px; background: rgba(0,0,0,.78); color: #b6ffb6; font: 12px/1.4 monospace; padding: 6px 8px; border-radius: 6px; z-index: 30; white-space: pre; }

@media (min-width: 900px) {
  :root { font-size: 18px; }
  .layout { display: grid; grid-template-columns: minmax(320px, 1fr) 1.15fr; gap: 24px; align-items: start; }
  .preview { position: sticky; top: 12px; }
  #card, body.compact #card { height: min(78vh, 720px); max-height: none; }
  .hint, body.compact .hint { display: inline; }
  .steps { margin-top: 8px; }
}

@media print {
  @page { size: 100mm 148mm; margin: 0; }
  body { background: #fff; }
  body > *:not(#printImg) { display: none !important; }
  #printImg { display: block !important; width: 100mm; height: 148mm; margin: 0; }
}

.guide-links { padding-left: 1.1em; }
.guide-links li { margin: 6px 0; line-height: 1.8; }
