:root {
  color-scheme: dark;
  --bg: #162033;
  --panel: rgba(30, 41, 59, .7);
  --panel-strong: rgba(30, 41, 59, .82);
  --line: rgba(255, 255, 255, .24);
  --text: #f8fafc;
  --muted: rgba(248, 250, 252, .9);
  --cyan: #67e8f9;
  --amber: #fcd34d;
  --rose: #fb7185;
  --dark-text: #0f172a;
  --ok: #22d3ee;
  --warn: #fbbf24;
  --bad: #94a3b8;
}

* { box-sizing: border-box; }
body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  font-family: "Yu Gothic", "Hiragino Kaku Gothic ProN", Meiryo, system-ui, sans-serif;
  background:
    radial-gradient(circle at 12% 8%, rgba(125, 211, 252, .32), transparent 32rem),
    radial-gradient(circle at 86% 12%, rgba(252, 211, 77, .2), transparent 25rem),
    radial-gradient(circle at 68% 86%, rgba(167, 243, 208, .16), transparent 32rem),
    linear-gradient(180deg, #1f2a44 0%, #162033 50%, #101827 100%),
    var(--bg);
  color: var(--text);
  overflow-x: hidden;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: -20%;
  pointer-events: none;
  z-index: 0;
}

body::before {
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 255, 255, .16) 0 2px, transparent 3px),
    radial-gradient(circle at 70% 16%, rgba(125, 211, 252, .18) 0 2px, transparent 3px),
    radial-gradient(circle at 82% 72%, rgba(252, 211, 77, .18) 0 2px, transparent 3px),
    radial-gradient(circle at 36% 86%, rgba(167, 243, 208, .16) 0 2px, transparent 3px);
  background-size: 280px 280px, 340px 340px, 300px 300px, 380px 380px;
  animation: driftSparkles 18s linear infinite;
}

body::after {
  background: conic-gradient(from 120deg at 50% 50%, transparent, rgba(125, 211, 252, .1), transparent, rgba(252, 211, 77, .09), transparent);
  filter: blur(48px);
  opacity: .9;
  animation: auroraTurn 22s ease-in-out infinite alternate;
}

body.step-advance .progressBadge,
body.step-advance .routeBadge {
  animation: cheerfulPop .45s ease;
}

button { font: inherit; }
.shell { position: relative; z-index: 1; width: min(1240px, calc(100% - 24px)); margin: 0 auto; padding: 16px 0; }
.hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}
.eyebrow, .mini {
  margin: 0 0 5px;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.mini.dark { color: #64748b; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 5px; font-size: clamp(24px, 3vw, 38px); line-height: 1.12; letter-spacing: 0; }
.lead { max-width: 760px; margin-bottom: 0; color: var(--muted); font-size: 13px; line-height: 1.55; font-weight: 700; }
.progressBadge {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, .95);
  color: var(--dark-text);
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 0 rgba(103, 232, 249, 0);
}
.progressBar { height: 6px; overflow: hidden; border-radius: 999px; background: rgba(255,255,255,.14); }
.progressBar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), #e879f9, var(--amber));
  position: relative;
  transition: width .55s cubic-bezier(.2, .9, .2, 1);
}
.progressBar span::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.8), transparent);
  transform: translateX(-100%);
  animation: progressShine 1.6s ease-in-out infinite;
}
.sectionNav { display: flex; flex-wrap: wrap; gap: 6px; margin: 9px 0 12px; }
.sectionPill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--muted);
  background: rgba(255,255,255,.1);
  font-size: 11px;
  font-weight: 900;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
}
.sectionPill.active { background: var(--cyan); color: var(--dark-text); border-color: transparent; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(103, 232, 249, .22); }
.sectionPill.done { color: white; border-color: rgba(103, 232, 249, .55); background: rgba(103, 232, 249, .18); }

.layout { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, .82fr); gap: 12px; align-items: start; }
.questionCard, .resultCard, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .24);
  backdrop-filter: blur(14px);
}
.questionCard, .resultCard {
  position: relative;
  overflow: hidden;
  padding: clamp(14px, 2vw, 20px);
  min-height: 430px;
  animation: cardArrive .46s cubic-bezier(.2, .9, .2, 1);
}
.questionCard:has(.multiList) {
  animation: multiCardSettle .16s ease-out;
}
.questionCard::before,
.resultCard::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: linear-gradient(115deg, rgba(125, 211, 252, .14), transparent 36%, rgba(252, 211, 77, .1));
  opacity: .8;
  pointer-events: none;
}
.questionCard > *,
.resultCard > * {
  position: relative;
}
.questionMeta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.stepText { color: var(--cyan); font-size: 12px; font-weight: 900; }
.metaActions {
  display: flex;
  align-items: center;
  justify-content: end;
  gap: 6px;
  flex: 0 0 auto;
}
.typeBadge, .routeBadge, .statusBadge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,255,255,.95);
  color: var(--dark-text);
  font-size: 11px;
  font-weight: 900;
}
.backBtn {
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255,255,255,.12);
  color: white;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .14s ease, background .14s ease, border-color .14s ease;
}
.backBtn:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,.2);
  border-color: rgba(103, 232, 249, .65);
}
.questionCard h2, .resultCard h2 { margin-bottom: 7px; font-size: clamp(20px, 2.8vw, 30px); line-height: 1.22; letter-spacing: 0; }
.subtitle { margin-bottom: 14px; color: var(--muted); font-size: 13px; line-height: 1.62; font-weight: 700; }
.options { display: grid; gap: 8px; }
.options.yesno { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.optionBtn {
  width: 100%;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  padding: 11px 12px;
  background: rgba(255,255,255,.96);
  color: var(--dark-text);
  text-align: left;
  cursor: pointer;
  animation: optionArrive .38s cubic-bezier(.2, .9, .2, 1) both;
  transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.optionBtn:nth-child(2) { animation-delay: .04s; }
.optionBtn:nth-child(3) { animation-delay: .08s; }
.optionBtn:nth-child(4) { animation-delay: .12s; }
.optionBtn:hover { transform: translateY(-3px); background: #ecfeff; border-color: var(--cyan); box-shadow: 0 12px 28px rgba(103, 232, 249, .24); }
.checkItem:hover { transform: translateY(-1px); background: #ecfeff; border-color: var(--cyan); box-shadow: 0 6px 16px rgba(103, 232, 249, .16); }
.optionBtn strong, .checkItem strong { display: block; font-size: 13px; line-height: 1.42; }
.optionBtn span { display: block; margin-top: 4px; color: #334155; font-size: 12px; line-height: 1.42; font-weight: 700; }
.multiList { display: grid; gap: 7px; max-height: 55vh; overflow: auto; padding-right: 4px; }
.checkItem {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(15, 23, 42, .12);
  border-radius: 8px;
  padding: 8px 9px;
  background: rgba(255,255,255,.96);
  color: var(--dark-text);
  text-align: left;
  cursor: pointer;
  animation: checkItemSettle .12s ease-out both;
  transition: transform .12s ease, background .12s ease, border-color .12s ease, box-shadow .12s ease;
}
.checkItem strong { text-align: left; }
.checkBox {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 5px;
  background: #e2e8f0;
  color: #64748b;
  font-weight: 900;
}
.checkItem.selected { background: #cffafe; border-color: var(--cyan); animation: selectedPulseSoft .14s ease; }
.checkItem.selected .checkBox { background: #0891b2; color: white; }
.itemBadge { border-radius: 999px; padding: 4px 7px; background: var(--amber); color: var(--dark-text); font-size: 10px; font-weight: 900; white-space: nowrap; }
.multiFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
}
.primaryBtn, .ghostBtn {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.primaryBtn { background: white; color: var(--dark-text); }
.ghostBtn { border: 1px solid var(--line); background: rgba(255,255,255,.08); color: white; }
.primaryBtn:hover, .ghostBtn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(103, 232, 249, .2); }
.sidePanel { display: grid; gap: 9px; position: sticky; top: 10px; }
.panel { padding: 11px; }
.panelHead { display: flex; align-items: center; justify-content: space-between; gap: 9px; margin-bottom: 9px; }
.panelHead h2 { margin: 0; font-size: 16px; line-height: 1.25; }
.routeBox {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  border-radius: 8px;
  padding: 9px;
  background: white;
  color: var(--dark-text);
}
.ladderWrap {
  margin-top: 8px;
  border-radius: 8px;
  padding: 8px 8px 7px;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.09));
  border: 1px solid rgba(255,255,255,.22);
  overflow: hidden;
}
.ladderHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}
.ladderHead span {
  color: rgba(255,255,255,.78);
  font-size: 11px;
  font-weight: 900;
}
.routeLadder {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: end;
  gap: 4px;
  min-height: 112px;
  padding: 6px 2px 0;
}
.ladderStep {
  --level: 0;
  position: relative;
  display: grid;
  grid-template-rows: 20px minmax(0, 1fr) auto;
  justify-items: center;
  align-content: end;
  gap: 3px;
  min-width: 0;
  min-height: calc(42px + var(--level) * 8px);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px 8px 6px 6px;
  padding: 5px 4px 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.24), rgba(255,255,255,.1));
  color: rgba(255,255,255,.78);
  transform-origin: bottom center;
  transition: transform .24s ease, background .24s ease, color .24s ease, border-color .24s ease, box-shadow .24s ease;
}
.ladderStep::before {
  content: "";
  position: absolute;
  inset: auto 7px 5px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
}
.ladderStep .rung {
  display: grid;
  place-items: center;
  width: 25px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  font-size: 10px;
  font-weight: 900;
}
.ladderStep strong {
  align-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
  font-size: 10px;
  line-height: 1.15;
  font-weight: 900;
  text-align: center;
}
.ladderMarker {
  min-width: 0;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 5px;
  text-align: center;
  font-size: 9px;
  line-height: 1;
  font-weight: 900;
  opacity: 0;
}
.ladderStep.reached {
  background: linear-gradient(180deg, rgba(125, 211, 252, .38), rgba(34, 211, 238, .16));
  border-color: rgba(125, 211, 252, .52);
  color: white;
}
.ladderStep.current {
  transform: translateY(-3px) scale(1.03);
  background: linear-gradient(180deg, rgba(103, 232, 249, .68), rgba(14, 165, 233, .24));
  border-color: rgba(103, 232, 249, .9);
  box-shadow: 0 10px 22px rgba(103, 232, 249, .22);
}
.ladderStep.target {
  border-color: rgba(252, 211, 77, .9);
}
.ladderStep.target:not(.current) {
  background: linear-gradient(180deg, rgba(252, 211, 77, .5), rgba(251, 191, 36, .16));
}
.ladderStep.current .ladderMarker,
.ladderStep.target .ladderMarker {
  opacity: 1;
}
.ladderStep.current .ladderMarker { background: white; color: #075985; }
.ladderStep.target .ladderMarker { background: var(--amber); color: var(--dark-text); }
small { display: block; color: #64748b; font-size: 10px; font-weight: 900; }
.routeBox strong { display: block; margin-top: 3px; font-size: 13px; line-height: 1.3; }
.arrow { color: #64748b; font-weight: 900; }
.gapBox { margin-top: 8px; border-radius: 8px; padding: 9px; background: rgba(255,255,255,.12); }
.gapBox p { margin: 4px 0 6px; color: var(--muted); line-height: 1.5; font-size: 12px; font-weight: 800; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { border-radius: 999px; padding: 4px 7px; background: rgba(255,255,255,.2); color: white; font-size: 11px; font-weight: 800; }
.lightPanel { background: white; color: var(--dark-text); }
.steps { display: grid; gap: 5px; }
.stepRow { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.num { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: #e2e8f0; color: #64748b; font-size: 10px; font-weight: 900; }
.stepRow.active .num { background: #0f172a; color: white; }
.stepName { min-width: 0; border-radius: 8px; padding: 6px 7px; background: #f1f5f9; font-size: 11px; font-weight: 900; }
.stepRow.active .stepName { background: #0f172a; color: white; }
.stepRow.active {
  animation: stepGlow .42s ease;
}
.statusBadge.ok { background: #cffafe; color: #164e63; }
.statusBadge.warn { background: #fde68a; color: #78350f; }
.statusBadge.no { background: #e2e8f0; color: #475569; }
.envPanel { background: rgba(14, 116, 144, .34); }
.envList { display: grid; gap: 5px; max-height: 22vh; overflow: auto; padding-right: 4px; }
.envRow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; border-radius: 8px; padding: 6px 7px; background: rgba(255,255,255,.1); font-size: 11px; font-weight: 800; }
.envRow span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.envPill { border-radius: 999px; padding: 4px 6px; background: rgba(255,255,255,.16); white-space: nowrap; }
.envPill.high { background: var(--cyan); color: var(--dark-text); }
.envPill.mid { background: white; color: var(--dark-text); }
.resultGrid { display: grid; gap: 10px; margin: 12px 0; }
.actionGrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.actionItem { border-radius: 8px; padding: 9px; background: white; color: var(--dark-text); font-size: 13px; font-weight: 800; line-height: 1.45; }
.resultEnv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.resultEnvItem { border-radius: 8px; padding: 8px; background: rgba(255,255,255,.1); font-size: 12px; font-weight: 800; }
.note { color: var(--muted); font-size: 13px; line-height: 1.55; font-weight: 700; }

@media (max-width: 900px) {
  .shell { width: min(100% - 16px, 720px); padding: 12px 0; }
  .hero { display: block; }
  .progressBadge { display: inline-flex; margin-top: 8px; }
  .layout { grid-template-columns: 1fr; }
  .sidePanel { position: static; }
  .options.yesno, .actionGrid, .resultEnv { grid-template-columns: 1fr; }
  .questionCard, .resultCard { min-height: auto; }
  .sidePanel { gap: 8px; }
  .multiList { max-height: 50vh; }
}

@media print {
  body { background: white; color: #0f172a; }
  .sectionNav, .progressBar, .progressBadge, .sidePanel, .ghostBtn, .primaryBtn, .backBtn { display: none !important; }
  .shell { width: 100%; padding: 0; }
  .layout { display: block; }
  .questionCard, .resultCard { border: 0; box-shadow: none; background: white; color: #0f172a; }
}

@keyframes cardArrive {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes optionArrive {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes multiCardSettle {
  from { opacity: .98; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes checkItemSettle {
  from { opacity: .96; transform: translateY(2px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes selectedPulse {
  0% { transform: scale(.99); }
  60% { transform: scale(1.015); }
  100% { transform: scale(1); }
}

@keyframes selectedPulseSoft {
  0% { transform: scale(.998); }
  60% { transform: scale(1.004); }
  100% { transform: scale(1); }
}

@keyframes stepGlow {
  0% { filter: brightness(1); transform: translateX(0); }
  50% { filter: brightness(1.25); transform: translateX(3px); }
  100% { filter: brightness(1); transform: translateX(0); }
}

@keyframes cheerfulPop {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(103, 232, 249, 0); }
  50% { transform: scale(1.06); box-shadow: 0 0 0 8px rgba(103, 232, 249, .18); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(103, 232, 249, 0); }
}

@keyframes progressShine {
  0% { transform: translateX(-120%); }
  55%, 100% { transform: translateX(120%); }
}

@keyframes driftSparkles {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(140px, -90px, 0); }
}

@keyframes auroraTurn {
  from { transform: rotate(0deg) scale(1); }
  to { transform: rotate(24deg) scale(1.08); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
