:root {
  --bg: #f4f1e8;
  --paper: #fffdf7;
  --text: #194b36;
  --muted: #60776a;
  --accent: #13b86a;
  --line: rgba(25, 75, 54, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 6% 22%, rgba(242, 211, 108, 0.2) 0 64px, transparent 65px),
    var(--bg);
  font-family: ryo-gothic-plusn, "Noto Sans JP", sans-serif;
  font-weight: 600;
  line-height: 1.7;
}

button { font: inherit; color: inherit; cursor: pointer; }

.proto-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 16px clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.94);
}

.proto-header__logo img { display: block; height: 23px; }

.proto-header__book {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 15px;
  letter-spacing: 0.08em;
}

.proto-header__vol {
  padding: 2px 10px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--bg);
  font-size: 10px;
  letter-spacing: 0.04em;
}

.proto-header__cart {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  font-size: 12px;
  text-decoration: none;
}

.proto-header__cart:hover { border-color: var(--accent); color: var(--accent); }

.proto-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 400px);
  gap: 26px 32px;
  max-width: 1420px;
  margin: 0 auto;
  padding: 34px clamp(20px, 3vw, 44px) 64px;
}

.proto-heading { grid-column: 1 / -1; text-align: center; }

.proto-heading__en,
.proto-card__label span {
  color: var(--accent);
  font-size: 10px;
  letter-spacing: 0.2em;
}

.proto-heading h1 {
  margin: 4px 0 8px;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: 0.06em;
}

.proto-heading > p:last-child { color: var(--muted); font-size: 12px; }

.proto-preview {
  display: grid;
  align-content: start;
  align-self: start;
  gap: 16px;
  min-width: 0;
}

.proto-card {
  padding: 12px 14px 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: 0 12px 34px rgba(25, 75, 54, 0.07);
}

.proto-card__label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.book-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.book-head .proto-card__label { margin: 0; }

.page-arrow {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #f8f6ef;
  display: grid;
  place-items: center;
  padding: 0;
}

.page-arrow svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.page-arrow:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.page-arrow:disabled { opacity: 0.3; cursor: default; }

.page-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
}

.page-chip {
  min-width: 38px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f6ef;
  font-size: 11px;
}

.page-chip:hover { border-color: rgba(19, 184, 106, 0.5); }

.page-chip[aria-current="true"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.proto-card__label span { margin-right: 8px; font-size: 9px; }

.proto-card__label .proto-card__caption {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0;
}

.lineup svg { display: block; width: auto; max-width: 100%; height: 230px; margin: 0 auto; }

.lineup[data-style="art"] {
  border-radius: 12px;
  background: #e6e2d6;
}

.spread {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 14px 30px rgba(25, 75, 54, 0.16);
}

.spread svg { display: block; width: 100%; height: auto; }

.spread[data-single="true"] { width: 50%; margin: 0 auto; }

.spread[data-single="true"]::after { display: none; }

.spread::after {
  position: absolute;
  inset: 0 auto 0 50%;
  width: 18px;
  margin-left: -9px;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.1), transparent 45%, transparent 55%, rgba(0, 0, 0, 0.1));
  content: "";
  pointer-events: none;
}

.proto-panel {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: 0 18px 50px rgba(25, 75, 54, 0.1);
}

.option-group { margin-bottom: 18px; }

.option-group__title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.option-list { display: flex; flex-wrap: wrap; gap: 7px; }

.text-field { display: block; }

.text-field .option-group__title { display: block; }

.text-field textarea { min-height: 96px; resize: vertical; line-height: 1.7; }

.text-field input,
.text-field textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid rgba(25, 75, 54, 0.2);
  border-radius: 10px;
  color: var(--text);
  background: #fff;
  font: inherit;
  font-size: 14px;
}

.text-field input:focus,
.text-field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(19, 184, 106, 0.12);
  outline: 0;
}

.chip {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8f6ef;
  font-size: 12px;
  transition: all 0.18s ease;
}

.chip:hover { border-color: rgba(19, 184, 106, 0.5); }

.chip[aria-pressed="true"] {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.option-list--swatch { gap: 9px; }

.swatch {
  width: 32px;
  height: 32px;
  border: 1px solid rgba(25, 75, 54, 0.2);
  border-radius: 50%;
  background: var(--swatch);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.swatch:hover { transform: scale(1.08); }

.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px var(--accent); }

.panel-tabs { margin: 0 0 22px; }

.person-tabs,
.panel-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
  margin: 6px 0 20px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
}

.person-tab {
  padding: 8px 6px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 12px;
}

.person-tab[aria-selected="true"] {
  background: var(--paper);
  box-shadow: 0 3px 10px rgba(25, 75, 54, 0.12);
}

.random-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 4px;
  border: 1px dashed rgba(25, 75, 54, 0.35);
  border-radius: 999px;
  background: transparent;
  font-size: 13px;
}

.random-btn:hover { border-color: var(--accent); color: var(--accent); }

.text-field__note { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; font-weight: 500; }

.text-field__note.is-error { color: #c0392b; }

.order-lead { margin-bottom: 14px; color: var(--muted); font-size: 12px; }

.order-summary {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8f6ef;
  font-size: 12px;
}

.order-summary div { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 8px; }

.order-summary dt { color: var(--muted); }

.order-summary dd { overflow-wrap: anywhere; white-space: pre-wrap; }

.order-errors {
  margin-bottom: 14px;
  padding: 12px 16px 12px 30px;
  border-radius: 12px;
  color: #a5301f;
  background: #fdecea;
  font-size: 12px;
}

.order-check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: 13px; cursor: pointer; }

.order-check input { width: 18px; height: 18px; margin-top: 3px; accent-color: var(--accent); }

.order-price { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; font-size: 12px; }

.order-price strong { font-size: 20px; }

.order-price small { font-size: 11px; }

.order-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 15px;
  letter-spacing: 0.06em;
  box-shadow: 0 10px 22px rgba(19, 184, 106, 0.25);
}

.order-btn:disabled { opacity: 0.4; cursor: default; box-shadow: none; }

.order-status { margin-top: 12px; color: var(--muted); font-size: 12px; }

.order-status.is-error { color: #c0392b; }

.order-progress { display: block; height: 6px; margin-top: 8px; border-radius: 999px; background: var(--bg); overflow: hidden; }

.order-progress span { display: block; height: 100%; background: var(--accent); transition: width 0.2s ease; }

.step-num {
  display: inline-grid;
  place-items: center;
  width: 17px;
  height: 17px;
  margin-right: 5px;
  border-radius: 50%;
  color: var(--paper);
  background: var(--muted);
  font-size: 10px;
  line-height: 1;
  vertical-align: 1px;
}

.person-tab[aria-selected="true"] .step-num { background: var(--accent); }

.next-step {
  width: 100%;
  min-height: 50px;
  margin-top: 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--text);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.next-step:hover { background: var(--accent); }

/* PCでは右パネルの下端に、スマホでは画面の下端に常に表示する */
.order-bar {
  position: sticky;
  bottom: -22px;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 22px -24px -22px;
  padding: 12px 24px 14px;
  border-top: 1px solid var(--line);
  background: rgba(255, 253, 247, 0.97);
  box-shadow: 0 -8px 20px rgba(25, 75, 54, 0.06);
}

.order-bar[hidden] { display: none; }

.order-bar__info strong { font-size: 18px; }

.order-bar__info small { font-size: 10px; }

.order-bar__btn {
  flex: 1;
  max-width: 230px;
  min-height: 46px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  letter-spacing: 0.06em;
  box-shadow: 0 8px 18px rgba(19, 184, 106, 0.25);
}

/* ==== 1問ずつ進める質問 ==== */

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--bg);
}

.wizard-dots { display: flex; flex-wrap: wrap; gap: 6px; }

.wizard-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--line);
}

.wizard-dot.is-done { background: rgba(19, 184, 106, 0.45); }

.wizard-dot.is-current { width: 18px; border-radius: 999px; background: var(--accent); }

.wizard-count { flex-shrink: 0; color: var(--muted); font-size: 11px; white-space: nowrap; }

.wizard-title { margin-bottom: 14px; font-size: 17px; font-weight: 700; letter-spacing: 0.04em; }

/* 質問の最初の見出しを大きく(vol.001 のように、いま答える質問をはっきりさせる) */
.wizard-body > .option-group:first-child > .option-group__title,
.wizard-body > .text-field:first-child > .option-group__title {
  margin-bottom: 12px;
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
}

.wizard-hint { margin-top: 4px; color: var(--accent); font-size: 11px; font-weight: 700; }

.wizard-hint:empty { display: none; }

.order-bar__back {
  flex-shrink: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--paper);
  font-size: 13px;
}

.order-bar__back:disabled { opacity: 0.35; }

.order-back {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: var(--paper);
  font-size: 13px;
}

.reset-btn {
  display: block;
  margin: 18px auto 0;
  border: 0;
  color: var(--muted);
  background: none;
  font-size: 11px;
  text-decoration: underline;
}

@media (max-width: 900px) {
  .proto-main { grid-template-columns: minmax(0, 1fr); padding: 24px 16px 48px; }
  .proto-panel { position: static; max-height: none; padding: 22px 18px; }
  .lineup svg { height: 180px; }
  .proto-header { min-height: 66px; padding: 14px 18px; }
  .proto-header__logo img { height: 16px; }
  .proto-header__book { display: none; }
  .order-bar {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20;
    margin: 0;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  }
  body:has(.order-bar:not([hidden])) .proto-main { padding-bottom: 110px; }
  .panel-tabs .person-tab { padding: 8px 2px; font-size: 11px; white-space: nowrap; }
  .panel-tabs .step-num { margin-right: 3px; }
  /* スマホでは「本のプレビュー → 質問 → 家族のキャラクター」の順に並べる */
  .proto-preview { display: contents; }
  .proto-card--book { order: 1; }
  .proto-panel { order: 2; }
  .proto-card--lineup { order: 3; }
  .order-bar__info strong { font-size: 15px; }
  .order-bar__btn { padding: 0 14px; font-size: 13px; }
}
