:root {
  --bg: #faf6ee;
  --surface: #ffffff;
  --ink: #2a2a24;
  --ink-soft: #6b6a5f;
  --green: #234d3a;
  --green-dark: #163529;
  --orange: #f0a75c;
  --orange-dark: #d98a3d;
  --border: #e6ded0;
  --radius: 16px;
  --max-w: 520px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.75;
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  max-width: var(--max-w);
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 24px;
}

.app-header {
  padding: 20px 20px 12px;
  text-align: center;
}

.app-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--green-dark);
  letter-spacing: 0.02em;
}

.app-main {
  flex: 1;
  padding: 8px 20px 20px;
}

.app-footer {
  padding: 16px 20px 8px;
  text-align: center;
}

.hub-link {
  display: inline-block;
  font-size: 13px;
  color: var(--ink-soft);
  text-decoration: underline;
  margin-bottom: 10px;
}

.disclaimer {
  font-size: 11px;
  color: #a19f92;
  line-height: 1.6;
  margin: 0;
}

/* ---- 進捗バー ---- */
.progress-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.progress-text {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
  white-space: nowrap;
}

.progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* ---- 質問カード ---- */
.question-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 4px 0 6px;
  line-height: 1.5;
}

.question-note {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 16px;
}

.question-hint {
  font-size: 13px;
  color: var(--ink-soft);
  margin: -8px 0 16px;
}

.options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.05s ease;
  min-height: 56px;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.selected {
  border-color: var(--green);
  background: #eef5f0;
  color: var(--green-dark);
}

.option-btn .check {
  float: right;
  color: var(--green);
  font-weight: 700;
  visibility: hidden;
}

.option-btn.selected .check {
  visibility: visible;
}

.freetext-wrap {
  margin-top: 4px;
}

.freetext-wrap input[type="text"] {
  width: 100%;
  padding: 14px 16px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
}

.freetext-wrap input[type="text"]:focus {
  outline: none;
  border-color: var(--orange);
}

.freetext-hint {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 6px 2px 0;
}

/* ---- ナビゲーションボタン ---- */
.nav-row {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  padding: 16px 22px;
  min-height: 52px;
  font-family: inherit;
  transition: opacity 0.15s ease, transform 0.05s ease;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--green);
  color: #fff;
  flex: 1;
}

.btn-primary:hover { background: var(--green-dark); }

.btn-primary:disabled {
  background: #c9c6ba;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  border: 2px solid var(--border);
}

.btn-accent {
  background: var(--orange);
  color: #402400;
}

.btn-accent:hover { background: var(--orange-dark); }

.btn-block {
  width: 100%;
}

/* ---- 最初の画面 ---- */
.intro {
  text-align: center;
  padding: 28px 4px 8px;
}

.intro h1 {
  font-size: 26px;
  color: var(--green-dark);
  line-height: 1.5;
  margin: 8px 0 18px;
}

.intro p {
  font-size: 16px;
  color: var(--ink);
  line-height: 1.8;
  margin: 0 0 28px;
}

.intro .badge {
  display: inline-block;
  background: #eef5f0;
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}

/* ---- 結果画面 ---- */
.result-heading {
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  margin: 8px 0 20px;
  text-align: center;
}

.card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--green);
  background: #eef5f0;
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 10px;
}

.card-recommend {
  color: var(--orange-dark);
  background: #fdf0de;
}

.card-body {
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  margin: 0 0 16px;
  white-space: pre-wrap;
}

.copy-btn {
  width: 100%;
}

.copied-msg {
  font-size: 13px;
  color: var(--green-dark);
  font-weight: 700;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

.pick-note {
  background: #eef5f0;
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 24px 0 16px;
}

.pick-note h3 {
  font-size: 16px;
  color: var(--green-dark);
  margin: 0 0 8px;
}

.pick-note p {
  font-size: 14px;
  color: var(--ink);
  margin: 0;
  line-height: 1.8;
}

.ai-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.ai-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  padding: 10px 2px;
  font-size: 14px;
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.ai-body {
  margin-top: 10px;
}

.ai-body p.ai-desc {
  font-size: 13px;
  color: var(--ink-soft);
  margin: 0 0 12px;
  line-height: 1.7;
}

.ai-prompt-box {
  width: 100%;
  min-height: 160px;
  font-size: 13px;
  line-height: 1.7;
  padding: 14px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: #fbfaf6;
  color: var(--ink);
  font-family: inherit;
  resize: vertical;
}

.restart-row {
  margin-top: 28px;
}

@media (min-width: 640px) {
  body { font-size: 17px; }
  .app-shell { padding-bottom: 32px; }
}
