:root {
  font-family: "Meiryo", "メイリオ", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", "YuGothic", "Noto Sans JP", sans-serif;
  color: #17242d;
  background: #F5FAFE;
  font-synthesis: none;
  --app-header: #DCEFFC;
  --app-header-ink: #245779;
  --app-accent: #A9D5F2;
  --app-accent-ink: #194E70;
  --app-bg: #F5FAFE;
  --app-border: #D5E7F3;
  --app-muted: #627B8D;
  --app-shadow: 0 5px 18px rgba(62,119,155,.08);
  --navy: var(--app-header-ink);
  --teal: #287fa9;
  --teal-dark: var(--app-accent-ink);
  --line: var(--app-border);
  --muted: var(--app-muted);
  --surface: #fff;
  --critical: #a52020;
  --critical-bg: #fff2f0;
  --high: #9a4b00;
  --high-bg: #fff7e8;
  --moderate: #315e75;
  --moderate-bg: #edf7fb;
  --shadow: var(--app-shadow);
}

* { box-sizing: border-box; }
html { font-size: 18px; background: var(--app-bg); }
[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; }
body { margin: 0; min-width: 320px; color: #263946; background: var(--app-bg); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button { cursor: pointer; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 20; background: white; padding: .75rem; }
.app-header { position: sticky; top: 0; z-index: 30; background: var(--app-header); color: var(--app-header-ink); padding: .65rem max(1rem, calc((100vw - 760px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: .75rem; border-bottom: 1px solid var(--app-border); box-shadow: 0 3px 14px rgba(62,119,155,.07); }
.app-header h1 { margin: .08rem 0 0; font-size: clamp(1.05rem, 4.8vw, 1.35rem); line-height: 1.25; }
.brand-lockup { display: flex; align-items: center; gap: .75rem; }
.brand-mark { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; flex: 0 0 auto; border-radius: 11px; background: rgba(255,255,255,.82); border: 1px solid var(--app-border); color: var(--app-accent-ink); font-size: 1.25rem; font-weight: 700; }
.eyebrow { margin: 0; font-size: .66rem; letter-spacing: .06em; color: var(--app-muted); }
.app-shell { width: min(calc(100% - 2rem), 760px); margin: 1.25rem auto 2rem; min-height: 60vh; }
.app-footer { color: var(--muted); font-size: .78rem; width: min(calc(100% - 2rem), 760px); margin: 0 auto; padding: 1rem 0 2rem; border-top: 1px solid var(--line); }
.app-footer p { margin: .35rem 0; }
.panel, .module-card, .result-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel { padding: 1.25rem; }
.intro { margin-bottom: 1.25rem; }
.intro h2, .screen-title { margin: 0 0 .55rem; color: var(--navy); }
.intro p, .lead { color: var(--muted); line-height: 1.65; }
.section-kicker { margin: 0 0 .35rem !important; color: var(--teal-dark) !important; font-size: .75rem; font-weight: 800; letter-spacing: .06em; }
.steps { margin: 0 0 1rem; }
.steps ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); }
.step { position: relative; display: grid; justify-items: center; gap: .3rem; color: #71828a; font-size: .7rem; font-weight: 700; text-align: center; }
.step:not(:last-child)::after { content: ""; position: absolute; top: .85rem; left: calc(50% + 1rem); right: calc(-50% + 1rem); height: 2px; background: #c8d5d9; }
.step-number { position: relative; z-index: 1; display: grid; place-items: center; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: #dce6e9; color: #52666f; }
.step.current { color: var(--navy); }
.step.current .step-number { background: var(--teal); color: white; box-shadow: 0 0 0 4px rgba(8,124,124,.12); }
.step.complete .step-number { background: #b9ded8; color: #075f60; }
.step.complete:not(:last-child)::after { background: #84c7bd; }
.module-grid { display: grid; gap: .8rem; }
.module-card { width: 100%; min-height: 84px; padding: .9rem 1rem; text-align: left; display: grid; grid-template-columns: 2.6rem 1fr auto; align-items: center; gap: .8rem; color: inherit; }
.module-card:hover, .module-card:focus-visible { border-color: var(--teal); outline: 3px solid rgba(8,124,124,.14); }
.module-icon { display: grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 12px; background: #e4f2f1; color: var(--teal-dark); font-weight: 900; }
.module-copy { display: grid; gap: .25rem; }
.module-card strong { color: var(--navy); font-size: 1rem; }
.module-card small { color: var(--muted); font-size: .78rem; line-height: 1.35; }
.module-card .arrow { color: var(--teal); font-size: 1.4rem; }
.field-list { display: grid; gap: 1rem; margin: 1.25rem 0; }
.field { display: grid; gap: .42rem; }
.field label, .field legend { font-weight: 700; color: var(--navy); }
.required { color: var(--critical); margin-left: .3rem; font-size: .78rem; }
.field input, .field select { width: 100%; min-height: 46px; border: 1px solid #aebfc5; border-radius: 9px; padding: .7rem .8rem; background: white; color: inherit; }
.field input:focus, .field select:focus { outline: 3px solid rgba(8,124,124,.18); border-color: var(--teal); }
.unit-wrap { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: .6rem; }
.unit { color: var(--muted); font-weight: 700; }
.help { color: var(--muted); font-size: .8rem; margin: 0; line-height: 1.5; }
.primary-button, .secondary-button, .ghost-button { border-radius: 9px; min-height: 44px; padding: .65rem 1rem; font-weight: 700; }
.primary-button { width: 100%; border: 0; background: var(--teal); color: white; }
.primary-button:hover { background: var(--teal-dark); }
.secondary-button { border: 1px solid var(--teal); background: white; color: var(--teal-dark); }
.form-actions { display: grid; gap: .7rem; }
.ghost-button { border: 1px solid #b9d5e7; color: var(--app-header-ink); background: rgba(255,255,255,.88); }
.back-button { margin-bottom: 1rem; }
.alert { border-radius: 12px; padding: 1rem; margin: 1rem 0; border: 2px solid; }
.alert h3 { margin: 0 0 .4rem; }
.alert p { margin: 0; line-height: 1.55; }
.critical { border-color: var(--critical); background: var(--critical-bg); }
.critical h3, .badge-critical { color: var(--critical); }
.high { border-color: var(--high); background: var(--high-bg); }
.high h3, .badge-high { color: var(--high); }
.moderate { border-color: var(--moderate); background: var(--moderate-bg); }
.moderate h3, .badge-moderate { color: var(--moderate); }
.result-list { display: grid; gap: .9rem; margin-top: 1rem; }
.result-card { padding: 1rem; border-left: 5px solid var(--moderate); }
.result-card.critical { border-left-color: var(--critical); }
.result-card.high { border-left-color: var(--high); }
.result-card h3 { margin: .3rem 0 .65rem; }
.result-card p { line-height: 1.55; }
.badge { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.result-labels, .source-card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: .7rem; }
.status-chip { display: inline-block; border: 1px solid #8b5b00; border-radius: 999px; padding: .22rem .5rem; background: #fff7df; color: #754b00; font-size: .7rem; font-weight: 800; white-space: nowrap; }
.verification-banner { display: grid; gap: .2rem; border-left: 4px solid var(--high); background: var(--high-bg); padding: .75rem .85rem; margin: 1rem 0; }
.verification-banner span { color: var(--muted); font-size: .8rem; }
.source-list { display: grid; gap: .9rem; }
.source-card { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 1rem; }
.source-card h3 { margin: 0; color: var(--navy); font-size: 1rem; line-height: 1.45; }
.verification-list { margin: .8rem 0; display: grid; gap: .45rem; }
.verification-list div { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; gap: .6rem; border-bottom: 1px solid #edf1f2; padding-bottom: .35rem; }
.verification-list dt { color: var(--muted); font-size: .76rem; }
.verification-list dd { margin: 0; font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.verification-list.compact { margin-bottom: .5rem; }
.meta { color: var(--muted); font-size: .78rem; }
.caution-list { padding-left: 1.25rem; }
.caution-list li { margin: .4rem 0; line-height: 1.5; }
.warning-box { border-left: 4px solid var(--high); padding: .7rem .9rem; background: var(--high-bg); margin: .8rem 0; }
.error-box { border-left-color: var(--critical); background: var(--critical-bg); }
details { border-top: 1px solid var(--line); padding-top: .7rem; margin-top: .7rem; }
summary { cursor: pointer; font-weight: 700; color: var(--teal-dark); }
.empty-state { text-align: center; padding: 1.5rem .8rem; }
.disclaimer-panel { margin-top: 1rem; border-style: dashed; box-shadow: none; }
.disclaimer-panel h3 { margin: 0 0 .5rem; color: var(--navy); font-size: .95rem; }
.loader-row { display: flex; align-items: center; justify-content: center; gap: .65rem; min-height: 38vh; padding: 2rem 0; color: var(--app-muted); font-size: .78rem; font-weight: 700; }
.loader-dot { width: 14px; height: 14px; border-radius: 50%; background: var(--app-accent); box-shadow: 24px 0 0 rgba(169,213,242,.55), 48px 0 0 rgba(169,213,242,.25); animation: loader-pulse .85s infinite ease-in-out alternate; transform: translateX(-24px); }
@keyframes loader-pulse { to { opacity: .45; transform: translateX(0); } }

@media (max-width: 420px) {
  .app-header { padding-block: .55rem; }
  .brand-lockup { gap: .55rem; min-width: 0; }
  .brand-lockup > div { min-width: 0; }
  .app-header h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .brand-mark { width: 2rem; height: 2rem; }
  .ghost-button { flex: 0 0 auto; padding-inline: .75rem; }
}

@media (min-width: 620px) {
  .module-grid { grid-template-columns: 1fr 1fr; }
  .panel { padding: 1.6rem; }
  .form-actions { grid-template-columns: 1fr auto; }
}

@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s ease, border-color .15s ease, transform .15s ease; }
  .module-card:hover { transform: translateY(-1px); }
}
