/* スマホ優先。基本の文字は 17px、押せるところは高さ 48px 以上。 */
:root {
  --bg: #f6f7f2;
  --card: #ffffff;
  --text: #1d2318;
  --muted: #5a6352;
  --accent: #2f6b1f;
  --accent-weak: #e3efd9;
  --border: #c9d1c0;      /* カードの区切り線など、飾りの線だけに使う */
  --control: #727e68;     /* チップとテキスト欄の枠。白に対して 4.29:1、背景 #f6f7f2 に対して 3.98:1 */
  --focus: #a14a00;       /* フォーカスの枠。白に対して 6.01:1、背景に対して 5.58:1 */
  --error: #a3261b;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  font-size: 17px;
  line-height: 1.7;
  /* 下に固定したコピーボタンの分だけ余白をとる */
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.site-header, main { max-width: 720px; margin: 0 auto; padding: 0 16px; }
.site-header { padding-top: 20px; }

h1 { font-size: 1.4rem; line-height: 1.4; margin: 0 0 8px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; display: flex; align-items: center; gap: 8px; }
.num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--accent); color: #fff; font-size: 1rem;
}

.lead { margin: 0 0 8px; }
.note, .hint, .source, .small { color: var(--muted); font-size: 0.94rem; }
.hint:empty { display: none; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.toc a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px;
  border-radius: 20px; background: var(--card); border: 1px solid var(--border);
  color: var(--text); text-decoration: none; font-size: 0.94rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px 16px;
  margin: 16px 0;
  scroll-margin-top: 12px;
}

fieldset { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
legend { font-weight: 700; margin-bottom: 8px; padding: 0; }

/* 選択肢のチップ */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0;
}
.chip > span {
  display: inline-flex; align-items: center;
  flex-direction: column; justify-content: center;
  min-height: 48px; padding: 6px 16px;
  border: 2px solid var(--control); border-radius: 24px;
  background: #fff; cursor: pointer; user-select: none;
  line-height: 1.35;
}
.chip input:checked + span {
  background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700;
}
.chips-multi .chip input:checked + span .chip-main::before { content: "✓ "; white-space: pre; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.chip-sub { font-size: 0.8rem; line-height: 1.3; }
.chip input:checked + span .chip-sub { font-weight: 400; }

.free-label { display: block; margin: 14px 0 6px; font-weight: 700; }

textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* 16px 未満だと iOS Safari が入力時に拡大するため */
  line-height: 1.6;
  padding: 10px 12px;
  border: 2px solid var(--control);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
}
textarea:focus { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--accent); }
.btn-copy:focus-visible, .toc a:focus-visible, a:focus-visible, .checklist input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.prompt-out { background: #fbfcf8; min-height: 280px; }

.btn-copy {
  display: block; width: 100%;
  min-height: 56px; margin-top: 12px;
  border: 0; border-radius: 28px;
  background: var(--accent); color: #fff;
  font: inherit; font-size: 1.1rem; font-weight: 700;
  cursor: pointer;
}
.btn-copy:active { filter: brightness(0.9); }

.copy-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(246, 247, 242, 0.96);
  border-top: 1px solid var(--border);
}
.copy-bar .btn-copy { max-width: 688px; margin: 0 auto; }

.recommend { font-weight: 700; margin: 0 0 6px; }
.list, .steps { padding-left: 1.4em; margin: 0 0 12px; }
.list li, .steps li { margin-bottom: 6px; }

.filming-common { margin: 0 0 8px; }
.filming-common dt { font-weight: 700; margin-top: 10px; }
.filming-common dd { margin: 2px 0 0; }

.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-top: 1px solid var(--border); }
.checklist li:first-child { border-top: 0; }
.checklist label { display: flex; gap: 12px; padding: 12px 0; cursor: pointer; }
.checklist input { width: 24px; height: 24px; flex: none; margin-top: 3px; accent-color: var(--accent); }
.checklist input:checked + span { color: var(--muted); text-decoration: line-through; }

.error {
  background: #fde9e6; color: var(--error);
  border: 1px solid var(--error); border-radius: 10px; padding: 12px;
}

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(20px);
  max-width: calc(100% - 32px);
  background: #1d2318; color: #fff; padding: 12px 18px; border-radius: 12px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  font-size: 0.95rem;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.site-footer { color: var(--muted); font-size: 0.9rem; padding: 8px 0 16px; }

a { color: var(--accent); }
