/* ---------- Page chrome ---------- */
:root {
  --bg: #f6f4f2;
  --surface: #ffffff;
  --text: #1d1a1b;
  --muted: #6c6468;
  --border: #e3ddd9;
  --accent: #7a4b8f;
  --accent-text: #ffffff;
  --tap: 48px;
  color-scheme: light;
  font: 16px/1.5 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); -webkit-text-size-adjust: 100%; }
main { max-width: 760px; margin: 0 auto; padding: 24px max(16px, env(safe-area-inset-right)) 48px max(16px, env(safe-area-inset-left)); }
h1 { font-size: 1.6rem; line-height: 1.2; margin: 8px 0 12px; }
h2 { font-size: 1.25rem; margin: 0 0 4px; }
p { margin: 0 0 12px; }
.lead { color: var(--muted); }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 20px 16px; margin: 20px 0; }
.step-no { color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; }
.hint { color: var(--muted); font-size: .9rem; }
fieldset { border: 0; padding: 0; margin: 16px 0 0; min-width: 0; }
legend { font-weight: 600; margin-bottom: 8px; padding: 0; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.seg label, .opts label { position: relative; display: flex; align-items: center; justify-content: center; min-height: var(--tap); padding: 8px 12px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; text-align: center; font-weight: 500; }
.seg input, .opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked), .opts label:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); color: var(--accent); font-weight: 700; }
.seg label:has(input:focus-visible), .opts label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
textarea { width: 100%; min-height: 72px; font: inherit; padding: 10px 12px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; resize: vertical; }
textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 52px; padding: 0 20px; border: 1.5px solid var(--accent); border-radius: 16px; background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.ghost { background: var(--surface); color: var(--accent); }
.btn + .btn { margin-top: 10px; }
.unrated { color: #a3361f; font-size: .9rem; margin-top: 8px; }
.result { display: none; }
.result.shown { display: block; }
.result textarea { min-height: 180px; font-size: .9rem; }
.variant-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.variant-tag { font-size: .85rem; color: var(--muted); }
.stage { display: flex; justify-content: center; margin: 16px -4px 4px; }
