@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@600;700&family=Noto+Sans+JP:wght@400;500;600;700&display=swap");

:root {
  --ink: #111827;
  --navy: #222c55;
  --navy-light: #edf0f8;
  --gold: #8c7651;
  --muted: #657080;
  --line: #dfe3e8;
  --surface: #ffffff;
  --background: #f4f5f7;
  --danger: #a33a3a;
  --focus: #4567c4;
}

* { box-sizing: border-box; }
html { color-scheme: light; }
body { margin: 0; background: var(--background); color: var(--ink); font-family: "Noto Sans JP", sans-serif; line-height: 1.7; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.shell { width: min(900px, calc(100% - 32px)); margin: 0 auto; padding: 44px 0 72px; }
.hero { margin-bottom: 28px; }
.brand, .step-label { margin: 0 0 8px; color: var(--gold); font-family: Montserrat, sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .13em; }
.hero h1 { margin: 0; font-size: clamp(30px, 6vw, 48px); line-height: 1.25; }
.hero > p:last-child { max-width: 680px; margin: 12px 0 0; color: var(--muted); }
.card { padding: clamp(22px, 5vw, 38px); border: 1px solid var(--line); border-radius: 20px; background: var(--surface); box-shadow: 0 12px 34px rgba(17,24,39,.06); }
.card h2 { margin: 0 0 10px; font-size: clamp(22px, 4vw, 30px); line-height: 1.45; }
.lead { margin: 0 0 26px; color: var(--muted); }
#decision-guidance-view p:not(.step-label) { margin: 12px 0 0; color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-grid label { display: grid; gap: 7px; color: var(--ink); font-size: 13px; font-weight: 700; }
.form-grid label:last-child { grid-column: 1 / -1; }
input, select { width: 100%; min-height: 46px; padding: 11px 13px; border: 1px solid #cfd5dc; border-radius: 10px; background: #fbfcfd; color: var(--ink); }
.required { margin-left: 7px; color: var(--gold); font-size: 10px; }
.actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; }
.actions.end { justify-content: flex-end; }
.primary, .secondary { min-height: 46px; padding: 11px 19px; border-radius: 10px; font-weight: 700; }
.primary { border: 1px solid var(--navy); background: var(--navy); color: white; }
.primary:hover { background: #111936; }
.secondary { border: 1px solid #cbd1d9; background: white; color: var(--navy); }
.progress-panel { margin: -8px 0 30px; }
.progress-panel > div:first-child { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 9px; font-size: 12px; }
#progress-stage { color: var(--navy); font-weight: 700; }
#progress-detail { color: var(--muted); }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e7eaf0; }
#progress-fill { width: 20%; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--navy), #53669e); transition: width .3s ease; }
.answer-field { margin: 0; padding: 22px 0; border: 0; border-top: 1px solid var(--line); }
.answer-field legend { width: 100%; padding: 0 0 12px; color: var(--ink); font-weight: 700; }
.answer-field-hint { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; font-weight: 400; }
.temporary-save-note { margin: 18px 0 0; color: var(--muted); font-size: 12px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.choice { position: relative; display: flex; align-items: flex-start; gap: 9px; min-height: 48px; padding: 12px; border: 1px solid var(--line); border-radius: 11px; background: #fafbfc; font-size: 13px; }
.choice:has(input:checked) { border-color: var(--navy); background: var(--navy-light); box-shadow: inset 3px 0 var(--navy); }
.choice input { width: 18px; min-height: 18px; margin: 2px 0 0; padding: 0; }
.inline-error { margin: 15px 0 0; padding: 11px 13px; border-left: 4px solid var(--danger); background: #fff3f3; color: var(--danger); font-size: 13px; }
.centered { text-align: center; }
.spinner { width: 34px; height: 34px; margin: 0 auto 18px; border: 3px solid #dfe4ef; border-top-color: var(--navy); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.shell:has(#report-view:not(.hidden)) { width: min(1000px, calc(100% - 32px)); }
.shell:has(#report-view:not(.hidden)) .brand { color: var(--navy); }
.shell:has(#report-view:not(.hidden)) .brand-version { display: none; }
.report-flow { display: grid; gap: 0; }
.result-section { padding: 36px 16px; border-bottom: 1px solid var(--line); }
.result-section h2, .report-cta h2 { margin: 0 0 14px; color: var(--navy); font-size: clamp(22px, 3vw, 29px); line-height: 1.45; }
.result-section:not(.result-executive_summary):not(.result-primary_recommendation) h2::before { content: ''; display: inline-block; width: 7px; height: 19px; margin-right: 12px; border-radius: 3px; background: #8c7a5a; vertical-align: -2px; }
.result-section h3 { margin: 0 0 12px; color: var(--navy); font-size: clamp(21px, 2.6vw, 27px); line-height: 1.5; }
.result-section p, .result-section li, .report-cta p { max-width: 740px; margin: 0 0 12px; color: var(--ink); font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.result-section ul { margin: 10px 0 0; padding-left: 1.4em; }
.result-section li { margin-bottom: 8px; }
.result-executive_summary, .result-primary_recommendation, .result-readiness { border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.result-executive_summary { padding: 34px 38px; border-top: 4px solid #8c7a5a; box-shadow: 0 14px 34px rgba(17,24,39,.05); }
.result-executive_summary p:first-of-type { font-size: clamp(18px, 2.4vw, 22px); font-weight: 600; color: var(--navy); }
.result-primary_recommendation { margin-top: 24px; padding: 32px 38px; border-left: 3px solid #4567c4; background: #f9faff; }
.result-primary_recommendation h3 { margin-top: 8px; }
.result-primary_recommendation li::marker { color: #8c7a5a; }
.result-feature-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 26px; border-top: 1px solid var(--line); }
.result-feature { min-width: 0; padding: 20px 22px 14px 0; border-bottom: 1px solid var(--line); }
.result-feature:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--line); }
.result-feature h4 { margin: 0 0 8px; color: var(--navy); font-size: 16px; line-height: 1.5; }
.result-feature p { margin-bottom: 0; }
.result-readiness { margin: 24px 0; padding: 26px 32px; background: #f7f8fb; }
.result-readiness h3 { font-size: 21px; }
.result-readiness h3::before { content: ''; display: inline-block; width: 7px; height: 19px; margin-right: 10px; border-radius: 3px; background: #8c7a5a; vertical-align: -1px; }
.result-requirements { max-width: 780px; padding: 0 !important; list-style: none; }
.result-requirements li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 18px; align-items: start; padding: 13px 0; margin: 0; border-bottom: 1px solid var(--line); }
.result-requirement-label { font-weight: 600; }
.result-requirement-status { color: var(--navy); white-space: nowrap; font-weight: 700; }
.result-requirement-note { grid-column: 1 / -1; color: var(--muted); font-size: 15px; }
.result-reasoning { border-top: 0; }
.result-section details { max-width: 740px; margin-top: 16px; }
.result-section summary { display: flex; align-items: center; min-height: 44px; width: fit-content; color: var(--navy); font-size: 16px; font-weight: 700; cursor: pointer; }
.result-section summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.result-section details ul, .result-section details p { margin-top: 12px; }
.result-secondary_section { border-bottom: 0; }
.report-cta { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 32px; padding: 28px 32px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); }
.report-cta h2 { font-size: 22px; }
.report-cta p { margin: 0 0 8px; color: var(--muted); }
.report-cta .primary { flex: 0 0 auto; min-height: 48px; }

@media (max-width: 700px) {
  .shell { width: min(100% - 24px, 900px); padding-top: 28px; }
  .form-grid, .choice-grid { grid-template-columns: 1fr; }
  .form-grid label:last-child { grid-column: auto; }
  .report-cta { align-items: stretch; flex-direction: column; }
  .actions { align-items: stretch; flex-direction: column-reverse; }
  .actions button, .report-cta button { width: 100%; }
  #decision-guidance-view .actions { margin-top: 24px; }
  .shell:has(#report-view:not(.hidden)) { width: min(100% - 24px, 1000px); }
  .result-executive_summary, .result-primary_recommendation, .result-readiness, .report-cta { padding: 22px; }
  .result-section { padding: 28px 4px; }
  .result-executive_summary, .result-primary_recommendation, .result-readiness { padding: 22px; }
  .result-feature-grid { grid-template-columns: 1fr; }
  .result-feature, .result-feature:nth-child(even) { padding: 16px 0 12px; border-left: 0; }
  .result-requirements li { grid-template-columns: 1fr; gap: 2px; }
  .result-requirement-note { grid-column: auto; }
}

@media (max-width: 400px) {
  .shell { width: calc(100% - 16px); }
  .shell:has(#report-view:not(.hidden)) { width: calc(100% - 16px); }
  .card { padding: 20px 16px; border-radius: 15px; }
  .progress-panel > div:first-child { align-items: flex-start; flex-direction: column; gap: 2px; }
  .choice { min-height: 52px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
