/* with-inspired, light-only palette. Keep font sizes on the documented scale. */
:root {
  color-scheme: light;
  --brand: #fe6970;
  --brand-lightest: #ffeded;
  --brand-lighter: #ffdcdc;
  --theme: #ff387a;
  --bg: #eaeaea;
  --white: #fff;
  --border: #ececeb;
  --text-87: rgba(0, 0, 0, .87);
  --text-80: rgba(0, 0, 0, .80);
  --text-70: rgba(0, 0, 0, .70);
  --text-60: rgba(0, 0, 0, .60);
  --text-40: rgba(0, 0, 0, .40);
  --font: "Helvetica Neue", Helvetica, "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN W3", "メイリオ", Meiryo, sans-serif;
  --max-width: 700px;
  --space: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  color: var(--text-60);
  background: var(--bg);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
[hidden] { display: none !important; }

.quiz-app, .result-app { max-width: var(--max-width); min-height: 100vh; margin: 0 auto; background: var(--bg); }
.quiz-screen { min-height: 100vh; }
.quiz-cover {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 72px var(--space) 42px;
  color: var(--white);
  text-align: center;
  background: linear-gradient(168deg, var(--theme) 0%, var(--brand) 58%, #ffa4a4 100%);
}
.cover-inner { margin: auto 0; }
.eyebrow { margin: 0 0 16px; font-size: 12px; font-weight: bold; letter-spacing: .14em; }
.quiz-cover h1 { margin: 0; font-size: 24px; line-height: 1.35; letter-spacing: .04em; }
.cover-rule { width: 40px; height: 3px; margin: 20px auto; border-radius: 2px; background: rgba(255,255,255,.75); }
.cover-lead { margin: 0; font-size: 15px; font-weight: bold; line-height: 1.9; }
.cover-note { max-width: 300px; margin: 28px auto 0; font-size: 11px; opacity: .8; }

.button {
  position: relative;
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 var(--space);
  border: 0;
  border-radius: 30px;
  color: var(--white);
  background: var(--brand);
  font-size: 20px;
  font-weight: bold;
  line-height: 50px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}
.button::after { position: absolute; inset: 0; border-radius: inherit; background: rgba(0,0,0,.07); content: ""; opacity: 0; pointer-events: none; transition: opacity .2s; }
.button:hover::after, .button:focus-visible::after, .button:active::after { opacity: 1; }
.button-invert { max-width: 320px; color: var(--brand); background: var(--white); }
.button-small { height: 44px; font-size: 16px; line-height: 44px; }
.button:disabled { cursor: not-allowed; opacity: .4; }

.quiz-questions { background: var(--bg); }
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 50px;
  padding: 0 var(--space);
  color: var(--white);
  background: var(--theme);
  font-size: 13px;
  font-weight: bold;
}
.quiz-progress { font-size: 12px; font-weight: normal; }
.question-list { padding: 30px var(--space) 24px; }
.question-card { position: relative; padding: 44px 18px 22px; border-radius: 15px; background: rgba(255,255,255,.96); text-align: center; }
.question-number { position: absolute; top: -28px; left: 50%; display: grid; width: 68px; height: 68px; place-items: center; border-radius: 50%; color: var(--white); background: rgba(255,56,122,.95); font-size: 22px; font-weight: bold; transform: translateX(-50%); }
.question-prompt { margin: 0 0 18px; color: var(--text-87); font-size: 20px; font-weight: bold; line-height: 1.5; }
.no-break { white-space: nowrap; }
.question-options { display: flex; flex-direction: column; gap: 10px; }
.option-button { width: 100%; padding: 14px; border: 1px solid var(--brand-lighter); border-radius: 12px; color: var(--text-80); background: var(--brand-lightest); font-size: 15px; font-weight: bold; line-height: 1.6; cursor: pointer; }
.option-button:hover, .option-button:focus-visible { background: var(--brand-lighter); outline: 2px solid var(--brand); outline-offset: 2px; }
.option-button.is-selected { color: var(--white); border-color: var(--brand); background: var(--brand); }
.option-button code { font-family: ui-monospace, Menlo, monospace; font-size: 14px; }
.question-actions { margin-top: 18px; }
.quiz-error { margin: 0 var(--space) 24px; padding: 10px 12px; border-radius: 10px; color: var(--text-70); background: #fff0f2; font-size: 13px; }

.result-header { padding: 42px var(--space) 30px; color: var(--white); background: linear-gradient(168deg, var(--type-color) 0%, var(--theme) 100%); text-align: center; }
.result-header .eyebrow { margin-bottom: 10px; opacity: .85; }
.result-header h1 { margin: 0; font-size: 24px; line-height: 1.35; }
.result-header h1 span { margin-left: 4px; font-size: 15px; }
.result-subtitle { margin: 14px 0 0; font-size: 13px; text-wrap: balance; }
.result-section { margin: 14px 0 0; padding: 22px var(--space); background: var(--white); }
.result-section h2 { margin: 0 0 16px; color: var(--text-87); font-size: 16px; }
.type-name { font-size: 24px; font-weight: bold; }
.type-axis, .section-note { margin: 5px 0 0; color: var(--text-60); font-size: 13px; }
.type-tagline { margin: 14px 0 0; color: var(--text-87); font-size: 15px; font-weight: bold; line-height: 1.7; }
.axis-row + .axis-row { margin-top: 18px; }
.axis-labels { display: flex; justify-content: space-between; margin-bottom: 6px; color: var(--text-70); font-size: 12px; font-weight: bold; }
.axis-track { position: relative; height: 12px; overflow: hidden; border-radius: 8px; background: #f5f5f5; }
.axis-track::before { position: absolute; top: 0; bottom: 0; left: 50%; width: 1px; background: var(--border); content: ""; }
.axis-fill { position: absolute; top: 0; bottom: 0; left: 0; width: var(--axis-position); border-radius: inherit; background: var(--type-color); opacity: .75; }
.axis-fill.is-right { right: 0; left: auto; }
.axis-count { margin-top: 4px; color: var(--text-40); font-size: 11px; text-align: right; }
.minority-list { display: grid; gap: 12px; }
.minority-item { padding: 13px; border-left: 4px solid var(--type-color); background: #fafafa; }
.minority-question { margin: 0; color: var(--text-87); font-size: 14px; font-weight: bold; }
.minority-answer, .minority-count { margin: 7px 0 0; font-size: 12px; }
.minority-count { color: var(--type-color); font-weight: bold; }
.empty-state { margin: 0; color: var(--text-70); font-size: 13px; }
.distribution-list { display: grid; gap: 18px; }
.distribution-item > p { margin: 0 0 7px; color: var(--text-70); font-size: 13px; font-weight: bold; }
.distribution-bars { display: grid; gap: 5px; }
.distribution-bar {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  color: var(--text-80);
  background: linear-gradient(to right, var(--bar-fill) 0 var(--bar-size), var(--bar-track) var(--bar-size) 100%);
  font-size: 12px;
  line-height: 1.4;
}
.distribution-bar.left { --bar-fill: var(--brand-lighter); --bar-track: var(--brand-lightest); }
.distribution-bar.right { --bar-fill: #ddd3f5; --bar-track: #f2edff; }
.distribution-bar strong { margin-left: 4px; color: var(--text-87); white-space: nowrap; }
.result-cta { padding: 28px var(--space) 42px; text-align: center; }
.result-cta p { margin: 0 0 16px; color: var(--text-70); font-size: 14px; font-weight: bold; }

@media (min-width: 701px) {
  body { padding: 18px 0; }
  .quiz-app, .result-app { min-height: calc(100vh - 36px); border-radius: 16px; overflow: hidden; box-shadow: 0 3px 18px rgba(0,0,0,.08); }
}

@media (max-width: 360px) {
  .question-prompt { max-width: 220px; margin-inline: auto; }
}
