:root {
  --pink: #A16C7C;
  --blue: #667AAD;
  --pink-bg: #F7EEF1;
  --blue-bg: #EEF1F8;
  --text: #3a3335;
  --line: #e6dce0;
}
* { box-sizing: border-box; margin: 0; }
html, body { height: 100%; }
body {
  font-family: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", sans-serif;
  color: var(--text);
  background: #fdfbfc;
  display: flex; flex-direction: column;
  max-width: 640px; margin: 0 auto;
}
.top {
  padding: 14px 16px 10px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.top-title { font-size: 16px; font-weight: 700; color: var(--pink); }
.top-sub { font-size: 11px; color: #9a8b90; margin-top: 2px; }
.progress { height: 4px; background: var(--pink-bg); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--pink); transition: width .4s; }

.chat { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 86%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.7; white-space: pre-wrap; animation: pop .18s ease-out; }
.bot   { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.user  { align-self: flex-end; background: var(--blue-bg); border-bottom-right-radius: 4px; }
.sys   { align-self: center; font-size: 12px; color: #9a8b90; background: none; padding: 4px; }
@keyframes pop { from { opacity: 0; transform: translateY(6px);} to { opacity: 1; transform: none;} }

.input-area { padding: 10px 14px calc(14px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice-btn {
  padding: 12px 14px; border: 1.5px solid var(--blue); border-radius: 12px;
  background: #fff; color: var(--blue); font-size: 14px; line-height: 1.5;
  text-align: left; cursor: pointer;
}
.choice-btn:active { background: var(--blue-bg); }
.textbox { display: flex; gap: 8px; align-items: flex-end; }
.textbox[hidden], .choices[hidden] { display: none !important; }
textarea {
  flex: 1; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  font-size: 16px; font-family: inherit; resize: none;
}
textarea:focus { outline: none; border-color: var(--blue); }
.btn { border: none; border-radius: 12px; padding: 12px 18px; font-size: 14px; font-weight: 700; cursor: pointer; }
.btn.primary { background: var(--pink); color: #fff; }
.btn.primary:disabled { opacity: .5; }

/* 結果カード */
.result-card {
  align-self: stretch; background: #fff; border: 1.5px solid var(--pink);
  border-radius: 14px; padding: 18px 16px; animation: pop .25s ease-out;
}
.result-label { font-size: 11px; color: var(--pink); font-weight: 700; letter-spacing: .1em; }
.result-type { font-size: 20px; font-weight: 700; color: var(--pink); margin: 4px 0 2px; }
.result-cat { font-size: 12px; color: #9a8b90; margin-bottom: 10px; }
.result-sec { font-size: 13px; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); }
.result-sec b { color: var(--blue); }
.result-quote { margin-top: 10px; padding: 10px 12px; background: var(--pink-bg); border-radius: 10px; font-size: 13px; }
.result-body { font-size: 14px; line-height: 1.8; }
.result-advice { margin-top: 10px; font-size: 14px; line-height: 1.8; }
.result-advice b { color: var(--pink); }
.cta { display: block; margin-top: 14px; padding: 14px; background: var(--pink); color: #fff;
  text-align: center; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: 15px; }
.cta.blue { background: var(--blue); }
