:root {
  --bg: #f6f4f1;
  --card: #ffffff;
  --text: #2b2a28;
  --muted: #77736d;
  --line: #e2ddd6;
  --accent: #6b4f3a;
  --accent-soft: #f1e9e2;
  --error: #b3261e;
  --ok: #1e6b3a;
  --radius: 14px;
}

* { box-sizing: border-box; }

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

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", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

.container {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}

[hidden] { display: none !important; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 0 0 14px;
  min-width: 0;
}

fieldset.card { margin-inline: 0; }

.center { text-align: center; }
.muted { color: var(--muted); }

.store-header { padding: 8px 4px 12px; }
.store-category { margin: 0; color: var(--muted); font-size: 13px; }
.store-name { margin: 2px 0 4px; font-size: 22px; line-height: 1.35; }
.store-feature { margin: 0 0 8px; color: var(--muted); font-size: 14px; }
.lead { margin: 8px 0 0; font-size: 15px; }
.title { font-size: 20px; }

.q {
  font-weight: 700;
  font-size: 16px;
  padding: 0;
  margin: 0 0 10px;
}
legend.q { float: left; width: 100%; }
legend.q + * { clear: both; }

.required {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  vertical-align: 2px;
}
.hint { margin-left: 6px; color: var(--muted); font-size: 12px; font-weight: 400; }

/* 満足度（5段階） */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale label { display: flex; }  /* 5つの枠の高さをそろえる */
.scale input { position: absolute; opacity: 0; pointer-events: none; }
.scale span {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 64px;
  flex: 1;
  padding: 6px 2px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.3;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  user-select: none;
}
.scale span b { font-size: 20px; color: var(--text); }
/* 言葉の途中で改行しない（<wbr> の位置でだけ改行する） */
.scale.keep-words span { word-break: keep-all; overflow-wrap: anywhere; }
.scale input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}
.scale input:checked + span b { color: var(--accent); }
.scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 複数選択のボタン */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { display: block; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span {
  display: inline-block;
  padding: 9px 14px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font-size: 15px;
  cursor: pointer;
  user-select: none;
}
.chips input:checked + span {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
}
.chips input:checked + span::before { content: "✓ "; }
.chips input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.select, .textarea {
  width: 100%;
  font: inherit;
  font-size: 16px; /* iPhoneで自動ズームしない大きさ */
  color: var(--text);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}
.select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 20px) 50%, calc(100% - 14px) 50%; background-size: 6px 6px; background-repeat: no-repeat; }
.textarea { resize: vertical; }
.textarea:focus, .select:focus { outline: none; border-color: var(--accent); }
.draft { line-height: 1.75; -webkit-user-select: text; user-select: text; }

.note { margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.note a { color: var(--accent); }

.ai-notice {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f0dca8;
  font-size: 14px;
}

.btn {
  display: block;
  width: 100%;
  min-height: 52px;
  margin: 14px 0 0;
  border: none;
  border-radius: 12px;
  font: inherit;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: #fff; }
.btn.secondary { background: #fff; color: var(--accent); border: 1.5px solid var(--accent); }
.btn:disabled { opacity: 0.45; cursor: default; }

.error { color: var(--error); font-size: 14px; margin: 8px 0 0; }
.message {
  margin: 10px 0 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e8f4ec;
  color: var(--ok);
  font-size: 14px;
  font-weight: 600;
}
.message.warn { background: #fdecea; color: var(--error); }

.busy {
  position: fixed;
  inset: 0;
  background: rgba(30, 25, 20, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}
.busy-box {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  max-width: 320px;
  width: 100%;
}
.spinner {
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 4px solid var(--accent-soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 画面下の規約リンク ---- */
.site-footer {
  margin: 24px 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.site-footer p { margin: 0; }
.site-footer a { color: var(--muted); text-decoration: underline; padding: 4px 2px; }
.site-footer .sep { margin: 0 8px; }

/* ---- 利用規約・プライバシーポリシー ---- */
.legal { font-size: 15px; line-height: 1.85; }
.legal h1 { font-size: 20px; line-height: 1.45; margin: 4px 0 4px; }
.legal .legal-sub { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.legal h2 {
  font-size: 16px;
  margin: 24px 0 8px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
  line-height: 1.5;
}
.legal p { margin: 0 0 10px; }
.legal ol { margin: 0 0 10px; padding-left: 1.6em; }
.legal ol li { margin: 0 0 6px; }
.legal ol.paren { list-style: none; padding-left: 0; }
.legal ol.paren li { padding-left: 2em; text-indent: -2em; }
.legal a { color: var(--accent); }
.legal .table-wrap { overflow-x: auto; margin: 0 0 10px; -webkit-overflow-scrolling: touch; }
.legal table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px; overflow-wrap: anywhere; text-align: left; vertical-align: top; }
.legal thead th { background: var(--accent-soft); color: var(--accent); }
.legal tbody th { background: #faf8f5; font-weight: 600; }
.legal .callout {
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff8e6;
  border: 1px solid #f0dca8;
  font-size: 14px;
}
.legal .signature { margin-top: 24px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.legal .signature p { margin: 0; }
.btn.close-btn { text-align: center; text-decoration: none; line-height: 52px; }

/* ---- 良かった点の詳細（選んだ項目の下に出る） ---- */
.chips .details {
  flex-basis: 100%;
  margin: -2px 0 4px;
  padding: 10px 10px 4px;
  border-left: 3px solid var(--accent-soft);
  background: #faf8f5;
  border-radius: 0 10px 10px 0;
}
.chips .details-title { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.chips .details .chips { gap: 6px; }
.chips .details span { padding: 6px 11px; font-size: 14px; }

/* 一言欄が空だったときの声かけ */
.nudge {
  margin: 8px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
}
