:root {
  --ink: #181816;
  --muted: #666660;
  --paper: #f7f5ef;
  --paper-strong: #ece8dd;
  --line: rgba(24, 24, 22, 0.18);
  --dark: #171916;
  --accent: #9f4838;
  --type-accent: #b96951;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "Hiragino Sans", "Yu Gothic", sans-serif; line-height: 1.7; }
button, textarea, input { font: inherit; }

.topbar {
  min-height: 74px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 28px;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: var(--ink); font-size: 12px; font-weight: 800; letter-spacing: 0.22em; text-decoration: none; }
.brand img { width: 20px; height: 44px; object-fit: contain; }
.topbar p { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: 0.08em; white-space: nowrap; }
.topbar b { color: var(--accent); }
.privacy { justify-self: end; color: var(--muted); font-size: 12px; }

.prototype-status {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: clamp(20px, 4vw, 64px);
  align-items: center;
  padding: 18px clamp(20px, 5vw, 70px);
  color: var(--ink);
  border-bottom: 1px solid var(--ink);
  background: #e4cb58;
}
.prototype-status div { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.prototype-status span { padding: 4px 8px; color: var(--paper); background: var(--ink); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.prototype-status strong { font-size: 16px; }
.prototype-status p { max-width: 780px; margin: 0; font-size: 14px; line-height: 1.65; }

.mode-switch {
  position: fixed;
  z-index: 20;
  right: 28px;
  bottom: 24px;
  display: flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--line);
  background: rgba(247,245,239,.92);
  box-shadow: 0 14px 40px rgba(24,24,22,.12);
  backdrop-filter: blur(14px);
}
.mode-button { min-height: 38px; padding: 7px 13px; color: var(--muted); border: 0; background: transparent; font-size: 12px; }
.mode-button:hover, .mode-button:focus-visible { color: var(--ink); background: rgba(24,24,22,.06); }
.mode-button.active { color: var(--paper); background: var(--ink); }

.quiz { min-height: calc(100vh - 74px); }
.quiz-intro {
  min-height: calc(100vh - 74px);
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
  overflow: hidden;
  padding: clamp(60px, 8vw, 118px);
}
.quiz-intro__copy { position: relative; z-index: 2; max-width: 690px; }
.quiz-intro__copy h1 { font-size: clamp(48px, 5.4vw, 76px); line-height: 1.2; }
.quiz-intro__copy h1 span { white-space: nowrap; }
.quiz-intro__copy > p:not(.eyebrow) { max-width: 560px; margin: 0 0 34px; color: var(--muted); }
.quiz-intro__copy button { min-width: 220px; }
.quiz-intro__copy button span { margin-left: 28px; }
.quiz-intro__copy small { display: block; margin-top: 14px; color: var(--muted); font-size: 11px; }

.type-orbit { position: relative; width: min(42vw, 570px); aspect-ratio: 1; justify-self: center; }
.type-orbit::before, .type-orbit::after {
  content: "";
  position: absolute;
  inset: 12%;
  border: 1px solid var(--line);
  border-radius: 50%;
}
.type-orbit::after { inset: 27%; border-style: dashed; }
.orbit-center {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  display: grid;
  width: 116px;
  height: 116px;
  place-items: center;
  color: var(--paper);
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .2em;
}
.type-orbit > span:not(.orbit-center) {
  --angle: calc(var(--i) * 60deg - 90deg);
  position: absolute;
  z-index: 3;
  top: calc(50% + sin(var(--angle)) * 43%);
  left: calc(50% + cos(var(--angle)) * 43%);
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  color: var(--ink);
  border: 1px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
  transform: translate(-50%, -50%);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .1em;
}

.quiz-questions {
  width: min(860px, calc(100% - 40px));
  min-height: calc(100vh - 74px);
  margin: 0 auto;
  padding: clamp(64px, 10vw, 124px) 0;
}
.quiz-progress { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 16px; margin-bottom: clamp(58px, 8vw, 92px); color: var(--muted); font-size: 12px; font-weight: 800; }
.quiz-progress > div { height: 2px; overflow: hidden; background: var(--line); }
.quiz-progress i { display: block; width: 12.5%; height: 100%; background: var(--accent); transition: width .24s ease; }
.quiz-questions h2 { max-width: 760px; margin: 0 0 40px; font-size: clamp(34px, 5vw, 58px); line-height: 1.35; letter-spacing: -.025em; }
.quiz-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.answer-button { min-height: 82px; padding: 18px 20px; color: var(--ink); border-color: var(--line); background: rgba(255,255,255,.25); text-align: left; font-size: 14px; line-height: 1.55; }
.answer-button:hover, .answer-button:focus-visible { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.text-button { min-height: auto; margin-top: 24px; padding: 5px 0; color: var(--muted); border: 0; background: transparent; font-size: 12px; }
.text-button:hover, .text-button:focus-visible { color: var(--accent); background: transparent; }

.quiz-result { min-height: calc(100vh - 74px); display: grid; grid-template-columns: minmax(420px, .95fr) minmax(500px, 1.05fr); }
.result-card {
  position: sticky;
  top: 0;
  min-height: calc(100vh - 74px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 7vw, 100px);
  color: var(--paper-strong);
  background:
    radial-gradient(circle at 18% 24%, transparent 0 72px, rgba(236,232,221,.12) 73px 74px, transparent 75px),
    radial-gradient(circle at 25% 31%, transparent 0 105px, rgba(236,232,221,.08) 106px 107px, transparent 108px),
    var(--dark);
}
.result-card > p:first-child { margin: 0 0 44px; color: rgba(236,232,221,.55); font-size: 12px; font-weight: 800; letter-spacing: .27em; }
.result-card strong { color: var(--type-accent); font-size: clamp(26px, 3vw, 40px); letter-spacing: .08em; }
.result-card h2 { margin: 4px 0 24px; font-size: clamp(48px, 6vw, 82px); line-height: 1.2; letter-spacing: -.04em; }
.result-card > p:nth-of-type(2) { max-width: 520px; margin: 0; color: rgba(236,232,221,.76); font-family: "Yu Mincho", "Hiragino Mincho ProN", serif; font-size: clamp(18px, 2vw, 26px); }
.result-card small { margin-top: 56px; color: rgba(236,232,221,.45); }

.type-detail { padding: clamp(58px, 7vw, 100px); }
.type-detail > h2 { margin: 0 0 24px; font-size: clamp(32px, 4vw, 50px); line-height: 1.35; }
.type-detail > h2 small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 600; }
.type-description { max-width: 680px; margin: 0 0 46px; color: var(--muted); font-size: 16px; }
.type-grid { border-top: 1px solid var(--line); }
.type-grid article { display: grid; grid-template-columns: 160px 1fr; gap: 24px; padding: 22px 0; border-bottom: 1px solid var(--line); }
.type-grid span, .story-match > span { color: var(--type-accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.type-grid p { margin: 0; font-size: 14px; }
.story-match { margin-top: 54px; padding: 28px; border: 1px solid var(--line); background: rgba(255,255,255,.28); }
.story-match h3 { margin: 20px 0 10px; font-size: 24px; line-height: 1.45; }
.story-match p { margin: 0 0 22px; color: var(--muted); font-size: 14px; }
.story-match button { min-height: 38px; padding: 8px 13px; color: var(--muted); border-color: var(--line); background: transparent; cursor: not-allowed; font-size: 11px; }
.story-link { display: inline-flex; min-height: 44px; align-items: center; gap: 10px; padding: 10px 14px; color: var(--paper); background: var(--ink); font-size: 12px; font-weight: 800; text-decoration: none; }
.story-link:hover, .story-link:focus-visible { color: var(--ink); background: transparent; outline: 2px solid var(--ink); outline-offset: 2px; }
.story-status { margin: 9px 0 0 !important; font-size: 11px !important; }
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.share-actions .text-button { margin: 0 0 0 10px; }
.result-photo { margin: 72px 0 0; }
.result-photo__frame { position: relative; overflow: hidden; aspect-ratio: 4 / 5; background: var(--paper-strong); }
.result-photo__frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 58%, rgba(23,25,22,.18)); pointer-events: none; }
.result-photo img { width: 100%; height: 100%; display: block; object-fit: cover; filter: saturate(.82) contrast(1.03); }
.result-photo figcaption { display: grid; grid-template-columns: 120px 1fr; gap: 20px; padding-top: 14px; border-top: 1px solid var(--line); }
.result-photo figcaption span { color: var(--type-accent); font-size: 11px; font-weight: 800; letter-spacing: .09em; }
.result-photo figcaption p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }

.consult { min-height: calc(100vh - 74px); display: grid; grid-template-columns: minmax(380px, 0.88fr) minmax(520px, 1.12fr); }
.consult__input { padding: 64px clamp(34px, 6vw, 88px); border-right: 1px solid var(--line); }
.consult__result { padding: 64px clamp(34px, 6vw, 88px); background: rgba(255,255,255,.25); }
.eyebrow { margin: 0 0 18px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .26em; }
h1 { max-width: 620px; margin: 0 0 22px; font-size: clamp(38px, 4.4vw, 64px); line-height: 1.3; letter-spacing: -.03em; }
.intro { max-width: 620px; margin: 0 0 42px; color: var(--muted); }

fieldset { display: grid; gap: 10px; margin: 0 0 30px; padding: 0; border: 0; }
legend { margin-bottom: 12px; font-size: 14px; font-weight: 800; }
fieldset label { position: relative; display: block; cursor: pointer; }
fieldset input { position: absolute; opacity: 0; pointer-events: none; }
fieldset label span { display: block; padding: 14px 16px; border: 1px solid var(--line); background: rgba(255,255,255,.22); font-size: 15px; transition: .18s ease; }
fieldset label:hover span { border-color: rgba(24,24,22,.45); }
fieldset input:focus-visible + span { outline: 3px solid rgba(159,72,56,.24); outline-offset: 2px; }
fieldset input:checked + span { color: var(--paper); border-color: var(--ink); background: var(--ink); }

.free-text { display: block; }
.free-text > span { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 10px; font-size: 14px; font-weight: 800; }
.free-text small { color: var(--muted); font-size: 11px; font-weight: 500; }
textarea { width: 100%; padding: 15px 16px; color: var(--ink); border: 1px solid var(--line); border-radius: 0; background: rgba(255,255,255,.3); resize: vertical; }
textarea:focus { outline: 3px solid rgba(159,72,56,.2); border-color: var(--accent); }

.actions { display: flex; gap: 10px; margin-top: 20px; }
button { min-height: 50px; padding: 12px 20px; color: #fff; border: 1px solid var(--ink); border-radius: 0; background: var(--ink); cursor: pointer; font-weight: 800; }
button:hover, button:focus-visible { color: var(--ink); background: transparent; outline: none; }
button.secondary { color: var(--muted); border-color: var(--line); background: transparent; }
.form-message { min-height: 28px; margin: 10px 0 0; color: var(--accent); font-size: 13px; font-weight: 700; }

.empty-state { position: sticky; top: 64px; max-width: 620px; }
.empty-state h2 { margin: 0 0 54px; font-size: clamp(38px, 4.2vw, 60px); line-height: 1.35; letter-spacing: -.03em; }
.empty-state ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.empty-state li { display: grid; grid-template-columns: 44px 1fr; gap: 16px; padding: 22px 0; border-bottom: 1px solid var(--line); font-weight: 700; }
.empty-state li span { color: var(--accent); font-size: 12px; }

.result-state { max-width: 760px; }
.result-heading { margin-bottom: 34px; }
.result-heading h2 { margin: 0 0 14px; font-size: clamp(34px, 3.6vw, 52px); line-height: 1.35; }
.result-heading > p:last-child { color: var(--muted); }
.case-results { display: grid; gap: 18px; }
.no-match { padding: 28px; border: 1px dashed rgba(24,24,22,.34); background: rgba(255,255,255,.18); }
.no-match strong { font-size: 18px; }
.no-match p { margin: 8px 0 0; color: var(--muted); font-size: 14px; }
.case-card { padding: 26px; border: 1px solid var(--line); background: var(--paper); }
.case-card__meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
.case-card__meta span:first-child { color: var(--accent); }
.case-card h3 { margin: 30px 0 8px; font-size: 25px; line-height: 1.45; }
.source-title { margin: 0 0 26px; color: var(--muted); font-size: 13px; }
.case-card dl { margin: 0; }
.case-card dl div { display: grid; grid-template-columns: 128px 1fr; gap: 18px; padding: 14px 0; border-top: 1px solid var(--line); }
.case-card dt { color: var(--muted); font-size: 12px; font-weight: 800; }
.case-card dd { margin: 0; font-size: 14px; }
.match-reason { margin: 20px 0 12px; color: var(--accent); font-size: 12px; font-weight: 700; }
.case-card__action { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; }
.content-status { display: inline-flex; min-height: 32px; align-items: center; padding: 6px 10px; border: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; }
.content-status--published { color: #245f38; border-color: rgba(36,95,56,.28); background: rgba(121,161,130,.15); }
.article-button { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 9px 14px; color: var(--paper); border: 1px solid var(--ink); background: var(--ink); font-size: 12px; font-weight: 800; text-decoration: none; }
.article-button:hover, .article-button:focus-visible { color: var(--ink); background: transparent; outline: 2px solid var(--accent); outline-offset: 2px; }

.future-stories { margin-top: 64px; padding-top: 44px; border-top: 1px solid var(--line); }
.future-stories > h3 { margin: 0 0 10px; font-size: 30px; line-height: 1.35; }
.future-stories > p:not(.eyebrow) { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.future-results { display: grid; gap: 10px; }
.future-card { padding: 22px; border: 1px dashed rgba(24,24,22,.34); background: rgba(255,255,255,.18); }
.future-card__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 11px; font-weight: 800; }
.future-card__meta span:first-child { color: var(--accent); }
.future-card h4 { margin: 20px 0 10px; font-size: 21px; line-height: 1.45; }
.future-card h4 small { color: var(--accent); font-size: 12px; }
.future-card > p { margin: 0 0 10px; font-size: 13px; }
.future-card__limit { color: var(--muted); }
.future-card__waiting { display: block; padding-top: 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; font-weight: 800; }

.next-options, .support-map { margin-top: 54px; }
.next-options h3, .support-map h3 { margin: 0 0 22px; font-size: 30px; }
.next-options ul { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.next-options li { position: relative; padding: 18px 10px 18px 34px; border-bottom: 1px solid var(--line); }
.next-options li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }
#support-results { display: flex; flex-wrap: wrap; gap: 8px; }
#support-results span { padding: 9px 12px; border: 1px solid var(--line); background: var(--paper); font-size: 13px; }
.boundary { margin-top: 54px; padding: 22px; color: var(--paper-strong); background: var(--dark); }
.boundary strong { font-size: 14px; }
.boundary p { margin: 8px 0 0; color: rgba(236,232,221,.72); font-size: 13px; }

.prototype-footer { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 28px; align-items: center; padding: 32px clamp(20px, 5vw, 70px) 92px; color: var(--paper-strong); background: var(--dark); }
.prototype-footer p { max-width: 760px; margin: 0; color: rgba(236,232,221,.7); font-size: 12px; }
.prototype-footer strong { color: var(--paper-strong); }
.prototype-footer nav { display: flex; flex-wrap: wrap; gap: 12px 22px; justify-content: flex-end; }
.prototype-footer a { color: var(--paper-strong); font-size: 12px; font-weight: 800; text-decoration: underline; text-underline-offset: 5px; }

@media (max-width: 980px) {
  .quiz-intro { grid-template-columns: 1fr; }
  .type-orbit { width: min(72vw, 500px); margin-top: 24px; }
  .quiz-result { grid-template-columns: 1fr; }
  .result-card { position: static; min-height: 640px; }
  .consult { grid-template-columns: 1fr; }
  .consult__input { border-right: 0; border-bottom: 1px solid var(--line); }
  .empty-state { position: static; }
}

@media (max-width: 620px) {
  .topbar { grid-template-columns: 1fr auto; padding: 8px 18px; }
  .topbar > p { display: none; }
  .prototype-status { grid-template-columns: 1fr; gap: 10px; padding: 18px 20px; }
  .prototype-status p { font-size: 13px; }
  .mode-switch { right: 12px; bottom: 12px; }
  .mode-button { padding: 6px 9px; }
  .quiz-intro { min-height: auto; padding: 58px 20px 104px; }
  .quiz-intro__copy h1 { font-size: 43px; }
  .quiz-intro__copy button { width: 100%; }
  .type-orbit { width: min(86vw, 390px); }
  .type-orbit > span:not(.orbit-center) { width: 54px; height: 54px; font-size: 11px; }
  .orbit-center { width: 94px; height: 94px; }
  .quiz-questions { width: calc(100% - 40px); padding: 54px 0 110px; }
  .quiz-questions h2 { font-size: 33px; }
  .quiz-answers { grid-template-columns: 1fr; }
  .answer-button { min-height: 66px; }
  .result-card { min-height: 560px; padding: 56px 22px 70px; }
  .result-card h2 { font-size: 48px; }
  .type-detail { padding: 50px 20px 118px; }
  .type-grid article { grid-template-columns: 1fr; gap: 6px; }
  .share-actions { flex-direction: column; }
  .share-actions .text-button { margin: 10px 0 0; }
  .result-photo { margin-top: 54px; }
  .result-photo figcaption { grid-template-columns: 1fr; gap: 4px; }
  .consult__input, .consult__result { padding: 44px 20px; }
  h1 { font-size: 37px; }
  .free-text > span { display: block; }
  .free-text small { display: block; margin-top: 2px; }
  .actions { align-items: stretch; flex-direction: column; }
  .case-card { padding: 20px; }
  .case-card dl div { grid-template-columns: 1fr; gap: 5px; }
  .case-card h3 { font-size: 22px; }
  .case-card__action { align-items: stretch; flex-direction: column; }
  .article-button { justify-content: center; }
  .prototype-footer { grid-template-columns: 1fr; padding-bottom: 100px; }
  .prototype-footer nav { justify-content: flex-start; }
}
