:root {
  --navy: #17324d;
  --blue: #176b87;
  --cyan: #dff3f6;
  --ink: #1d2b38;
  --muted: #5b6b78;
  --line: #dbe4ea;
  --paper: #ffffff;
  --bg: #f3f7f9;
  --focus: #f0a83b;
}

* { box-sizing: border-box; }
html { font-size: 16px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", "Yu Gothic", "Hiragino Kaku Gothic ProN", sans-serif;
  line-height: 1.7;
}
button { font: inherit; }
.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(24px, calc((100vw - 1080px) / 2));
  background: var(--navy);
  color: white;
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--blue); font-size: 1.35rem; }
.help-button { border: 1px solid #6f8497; border-radius: 999px; padding: 7px 18px; background: transparent; color: white; cursor: pointer; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.install-button { border: 0; border-radius: 999px; padding: 8px 17px; background: #fff; color: var(--navy); font-weight: 800; cursor: pointer; }
main { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 52px 0 64px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 36px; margin-bottom: 30px; }
.eyebrow { margin: 0 0 8px; color: var(--blue); font-size: .85rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; color: var(--navy); font-size: clamp(1.9rem, 4.5vw, 3.1rem); line-height: 1.35; letter-spacing: -.025em; }
h1 span { color: var(--blue); }
.intro-note { max-width: 350px; margin: 0 0 7px; color: var(--muted); font-size: .95rem; }
.intro-side { max-width: 350px; }
.offline-status { display: inline-flex; align-items: center; gap: 7px; margin: 11px 0 0; color: var(--blue); font-size: .86rem; font-weight: 700; }
.offline-status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--focus); }
.offline-status.ready::before { background: #198754; }
.help-panel { margin: -8px 0 24px; padding: 18px 22px; border-left: 5px solid var(--blue); background: var(--cyan); border-radius: 0 12px 12px 0; }
.help-panel p { margin: 4px 0 0; }
.assessment, .summary { background: var(--paper); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 16px 44px rgba(23,50,77,.08); overflow: hidden; }
.assessment-head, .summary-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 32px; border-bottom: 1px solid var(--line); }
.step-label { margin: 0 0 3px; color: var(--blue); font-size: .78rem; font-weight: 800; letter-spacing: .12em; }
h2 { margin: 0; color: var(--navy); font-size: clamp(1.22rem, 2.6vw, 1.65rem); line-height: 1.4; }
.progress { width: 170px; height: 7px; overflow: hidden; background: #e8eef2; border-radius: 99px; }
.progress span { display: block; width: 50%; height: 100%; background: var(--blue); border-radius: inherit; transition: width .25s ease; }
.question-area { padding: 34px 32px 15px; }
.question-number { color: var(--blue); margin: 0 0 5px; font-size: .8rem; font-weight: 800; letter-spacing: .08em; }
.question-title { margin: 0 0 8px; color: var(--navy); font-size: clamp(1.25rem, 3vw, 1.65rem); line-height: 1.55; }
.question-hint { margin: 0 0 23px; color: var(--muted); }
.scene-guide { margin: 0 0 24px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #eef7f9; }
.scene-guide img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; object-fit: cover; }
.scene-guide figcaption { padding: 10px 14px; color: var(--navy); background: #f4fafb; font-size: .9rem; font-weight: 700; text-align: center; }
.choices { display: grid; gap: 12px; }
.choice {
  width: 100%; display: grid; grid-template-columns: 36px 1fr; gap: 15px; align-items: start;
  padding: 18px 20px; border: 2px solid var(--line); border-radius: 14px; background: white;
  color: var(--ink); text-align: left; cursor: pointer; transition: border-color .15s, background .15s, transform .15s;
}
.choice:hover { border-color: var(--blue); background: #f7fcfd; transform: translateY(-1px); }
.choice:focus-visible, button:focus-visible { outline: 4px solid color-mix(in srgb, var(--focus) 60%, transparent); outline-offset: 2px; }
.choice-icon { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid #a9bbc6; border-radius: 50%; color: var(--blue); font-weight: 800; }
.choice strong { display: block; font-size: 1.05rem; line-height: 1.55; }
.choice small { display: block; margin-top: 3px; color: var(--muted); font-size: .9rem; line-height: 1.55; }
.actions { padding: 4px 32px 29px; }
.primary, .secondary { min-height: 48px; border-radius: 10px; padding: 10px 22px; font-weight: 700; cursor: pointer; }
.primary { border: 1px solid var(--blue); background: var(--blue); color: white; }
.secondary { border: 1px solid #afbec8; background: white; color: var(--navy); }
.summary { padding-bottom: 32px; }
.date { color: var(--muted); margin: 0; font-size: .9rem; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; padding: 28px 32px 18px; }
.result-card { border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.result-type { padding: 13px 18px; background: var(--navy); color: white; font-weight: 700; font-size: .9rem; }
.result-main { display: flex; gap: 18px; align-items: center; padding: 22px 20px 16px; }
.rank { min-width: 82px; color: var(--blue); font-size: 2.25rem; font-weight: 900; line-height: 1; text-align: center; }
.result-title { color: var(--navy); font-weight: 800; font-size: 1.07rem; line-height: 1.5; }
.reason { margin: 0; padding: 0 20px 22px; color: var(--muted); font-size: .93rem; }
.reason strong { color: var(--ink); }
.notice { margin: 0 32px 24px; padding: 17px 20px; border-left: 5px solid var(--focus); background: #fff8ea; border-radius: 0 10px 10px 0; }
.notice p { margin: 3px 0 0; font-size: .9rem; }
.summary-actions { display: flex; gap: 12px; padding: 0 32px; }
footer { width: min(1080px, calc(100% - 32px)); margin: 0 auto; padding: 0 0 30px; color: var(--muted); font-size: .78rem; text-align: center; }

@media (max-width: 720px) {
  .topbar { height: 64px; padding: 0 16px; }
  .brand { font-size: .87rem; }
  .brand-mark { width: 30px; height: 30px; }
  .help-button { padding: 5px 12px; font-size: .84rem; }
  .install-button { padding: 6px 11px; font-size: .78rem; }
  main { width: min(100% - 22px, 1080px); padding: 30px 0 42px; }
  .intro { display: block; margin-bottom: 22px; }
  .intro-side, .intro-note { max-width: none; }
  .intro-note { margin-top: 15px; }
  .assessment-head, .summary-head { align-items: flex-start; padding: 22px 20px; }
  .progress { width: 80px; margin-top: 12px; }
  .question-area { padding: 25px 18px 12px; }
  .actions { padding: 4px 18px 23px; }
  .choice { padding: 16px 14px; grid-template-columns: 32px 1fr; gap: 10px; }
  .scene-guide { margin-bottom: 18px; }
  .scene-guide figcaption { font-size: .82rem; line-height: 1.5; text-align: left; }
  .result-grid { grid-template-columns: 1fr; padding: 22px 18px 15px; }
  .notice { margin: 0 18px 20px; }
  .summary-actions { flex-direction: column; padding: 0 18px; }
}

@media print {
  @page { size: A4; margin: 14mm; }
  body { background: white; color: #111; }
  .topbar, .intro, .help-panel, .assessment, footer, .summary-actions { display: none !important; }
  main { width: 100%; margin: 0; padding: 0; }
  .summary { display: block !important; border: 0; box-shadow: none; padding: 0; }
  .summary-head { padding: 0 0 15px; }
  .result-grid { padding: 20px 0 14px; }
  .result-card { break-inside: avoid; }
  .result-type { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .notice { margin: 0; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}
