:root {
  color-scheme: light;
  --navy: #10243d;
  --navy-soft: #203954;
  --green: #123f37;
  --green-bright: #1e6656;
  --gold: #b69145;
  --gold-light: #ead8ae;
  --paper: #fbfaf7;
  --white: #ffffff;
  --ink: #1b2730;
  --muted: #5d696f;
  --line: #d9dedb;
  --shadow: 0 18px 54px rgba(16, 36, 61, 0.13);
  --serif: "Yu Mincho", "Hiragino Mincho ProN", "Hiragino Mincho Pro", "Noto Serif JP", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: radial-gradient(circle at 50% -20%, #fff 0, var(--paper) 48%, #f3f5f1 100%); font-family: var(--sans); font-size: 18px; line-height: 1.65; line-break: strict; word-break: normal; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 4px solid rgba(182, 145, 69, 0.46); outline-offset: 3px; }
[hidden] { display: none !important; }

.skip-link { position: fixed; z-index: 100; left: 12px; top: -80px; padding: 12px 18px; color: #fff; background: var(--navy); border-radius: 0 0 8px 8px; }
.skip-link:focus { top: 0; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }

.site-header { padding: max(14px, env(safe-area-inset-top)) 18px 14px; color: #fff; background: var(--navy); border-bottom: 3px solid var(--gold); }
.brand { width: min(760px, 100%); margin: auto; display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 44px; height: 44px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.54); border-radius: 50%; color: var(--gold-light); font-family: var(--serif); font-size: 18px; }
.brand span:last-child { min-width: 0; display: grid; }
.brand strong { font-family: var(--serif); font-size: 18px; line-height: 1.35; letter-spacing: .03em; }
.brand small { display: none; margin-top: 2px; color: rgba(255,255,255,.75); font-size: 18px; line-height: 1.4; }

.app-shell { width: min(760px, 100%); min-height: calc(100vh - 160px); margin: 0 auto; padding: 24px 18px 56px; }
.screen { display: block; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }

.welcome-screen { overflow: hidden; border: 1px solid rgba(16,36,61,.1); border-radius: 18px; background: #fff; box-shadow: var(--shadow); }
.welcome-image-wrap { position: relative; height: 190px; overflow: hidden; background: #e6ece8; }
.welcome-image { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 58%; filter: saturate(.78) contrast(.96); }
.welcome-image-wrap::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(16,36,61,.42), transparent 58%); pointer-events: none; }
.welcome-image-label { position: absolute; z-index: 1; left: 16px; bottom: 11px; margin: 0; color: #fff; font-size: 18px; font-weight: 700; text-shadow: 0 2px 12px rgba(0,0,0,.45); }
.welcome-copy { padding: 26px 22px 28px; }
.eyebrow { margin: 0 0 10px; color: var(--green-bright); font-size: 18px; font-weight: 800; letter-spacing: .03em; }
h1, h2, .brand strong { text-wrap: pretty; }
.welcome-copy h1 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: clamp(34px, 9.6vw, 54px); font-weight: 700; line-height: 1.25; letter-spacing: .025em; }
.welcome-copy h1 span { color: var(--green); }
.lead { margin: 17px 0 0; color: #34434a; font-size: 19px; font-weight: 600; line-height: 1.75; }
.assurance { margin: 20px 0; display: flex; flex-wrap: wrap; gap: 6px; }
.assurance span { min-height: 38px; display: inline-flex; align-items: center; padding: 4px 8px; color: var(--green); background: #edf4f0; border: 1px solid #cddfd7; border-radius: 999px; font-size: 18px; font-weight: 800; }
.primary-button { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 19px; border: 0; border-radius: 10px; color: #fff; background: var(--green); box-shadow: 0 10px 26px rgba(18,63,55,.22); font-size: 18px; font-weight: 800; line-height: 1.4; text-decoration: none; cursor: pointer; }
.primary-button:hover { background: #0b332d; }
.primary-button:disabled { cursor: not-allowed; opacity: .45; box-shadow: none; }
.line-link-note { margin: 12px 0 0; color: var(--green); font-size: 18px; line-height: 1.6; text-align: center; }
.line-link-note strong { display: inline-block; margin-right: 4px; padding: 1px 7px; color: #fff; background: var(--green-bright); border-radius: 999px; font-size: 18px; }
.secondary-start-button { width: 100%; min-height: 56px; margin-top: 13px; padding: 11px 15px; border: 2px solid #cad5d0; border-radius: 10px; color: var(--navy); background: #fff; font-size: 18px; font-weight: 800; line-height: 1.45; cursor: pointer; }
.secondary-start-button:hover { border-color: var(--green); background: #eff6f2; }
.microcopy { margin: 12px 0 0; color: var(--muted); font-size: 18px; line-height: 1.65; text-align: center; }

.question-screen { padding-top: 4px; }
.progress-head { min-height: 44px; display: flex; align-items: center; justify-content: space-between; }
.back-button { min-height: 44px; padding: 4px 10px 4px 0; border: 0; color: var(--navy); background: transparent; font-size: 18px; font-weight: 800; cursor: pointer; }
.progress-label { margin: 0; color: var(--navy); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.progress-track { height: 7px; margin: 8px 0 22px; overflow: hidden; background: #dfe6e2; border-radius: 999px; }
.progress-track span { height: 100%; display: block; background: linear-gradient(90deg, var(--green), var(--gold)); border-radius: inherit; transition: width .22s ease; }
.question-card { padding: 28px 20px 24px; background: #fff; border: 1px solid rgba(16,36,61,.11); border-top: 4px solid var(--gold); border-radius: 14px; box-shadow: var(--shadow); }
.question-kicker, .result-overline { margin: 0 0 8px; color: var(--gold); font-size: 18px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.question-card h2 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: clamp(26px, 7.4vw, 36px); line-height: 1.42; letter-spacing: .025em; }
.question-help { margin: 10px 0 22px; color: var(--muted); font-size: 18px; }
.option-list { display: grid; gap: 11px; }
.option-button { width: 100%; min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 15px 17px; border: 2px solid #d7dedb; border-radius: 10px; color: var(--ink); background: #fff; font-size: 18px; font-weight: 800; line-height: 1.45; text-align: left; cursor: pointer; }
.option-button:hover, .option-button[aria-pressed="true"] { border-color: var(--green); background: #eff6f2; }
.option-arrow { color: var(--gold); font-size: 22px; }
.location-fields { display: grid; gap: 9px; }
.location-fields label { margin-top: 8px; color: var(--navy); font-size: 18px; font-weight: 800; }
.location-fields label span { color: #8e5b16; font-size: 18px; }
.location-fields label small { color: var(--muted); font-size: 18px; }
.location-fields select, .location-fields input { width: 100%; min-height: 60px; padding: 12px 14px; border: 2px solid #cbd4d0; border-radius: 9px; color: var(--ink); background: #fff; font-size: 18px; }
.location-fields .primary-button { margin-top: 16px; }

.result-screen { padding-top: 8px; }
.result-overline { text-align: center; }
.result-hero { position: relative; overflow: hidden; padding: 30px 22px 28px; color: #fff; background: linear-gradient(145deg, var(--navy), var(--green)); border-radius: 16px; box-shadow: var(--shadow); }
.result-hero::after { content: ""; position: absolute; width: 150px; height: 150px; right: -55px; bottom: -65px; border: 1px solid rgba(234,216,174,.35); border-radius: 50%; }
.result-hero h1 { position: relative; z-index: 1; margin: 0; font-family: var(--serif); font-size: clamp(30px, 8vw, 43px); line-height: 1.35; }
.result-hero h1:focus { outline: none; }
.situation-summary { position: relative; z-index: 1; margin: 17px 0 0; color: rgba(255,255,255,.9); font-size: 18px; line-height: 1.8; }
.priority-badge { position: relative; z-index: 1; width: fit-content; margin: 0 0 12px; padding: 5px 10px; color: #3d2a08; background: var(--gold-light); border-radius: 999px; font-size: 18px; font-weight: 900; }
.result-section { margin-top: 18px; padding: 23px 20px; background: #fff; border: 1px solid rgba(16,36,61,.1); border-radius: 13px; }
.section-number { margin: 0 0 2px; color: var(--gold); font-family: var(--serif); font-size: 18px; font-weight: 800; letter-spacing: .08em; }
.result-section h2, .advisor-card h2, .cta-section h2 { margin: 0; color: var(--navy); font-family: var(--serif); font-size: 26px; line-height: 1.45; }
.section-lead { margin: 9px 0 0; color: var(--muted); font-size: 18px; line-height: 1.7; }
.action-list { margin: 20px 0 0; padding: 0; display: grid; gap: 15px; list-style: none; }
.action-list li { display: grid; grid-template-columns: 43px 1fr; align-items: center; gap: 12px; }
.action-list li > span { width: 43px; height: 43px; display: grid; place-items: center; color: #fff; background: var(--green); border-radius: 50%; font-family: var(--serif); font-size: 18px; }
.action-list li > div { min-width: 0; display: grid; gap: 1px; }
.action-list small { color: #7d5b18; font-size: 18px; font-weight: 900; line-height: 1.45; }
.action-list strong { font-size: 18px; line-height: 1.65; }
.tax-section { border-top: 4px solid var(--green); }
.tax-disclosure { margin-top: 17px; }
.tax-disclosure summary { min-height: 64px; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 15px; color: #fff; background: var(--navy); border-radius: 10px; font-size: 18px; font-weight: 900; cursor: pointer; list-style: none; }
.tax-disclosure summary::-webkit-details-marker { display: none; }
.tax-disclosure summary::after { content: "+"; flex: 0 0 auto; color: var(--gold-light); font-size: 26px; line-height: 1; }
.tax-disclosure[open] summary::after { content: "−"; }
.tax-candidate-count { flex: 0 0 auto; padding: 3px 8px; color: var(--navy); background: var(--gold-light); border-radius: 999px; font-size: 18px; line-height: 1.4; }
.tax-candidate-list { margin-top: 13px; display: grid; gap: 12px; }
.tax-card, .tax-empty { padding: 18px 16px; background: #f7faf8; border: 1px solid #cbded5; border-radius: 11px; }
.tax-card h3 { margin: 7px 0 0; color: var(--navy); font-family: var(--serif); font-size: 22px; line-height: 1.45; }
.tax-card > p:not(.tax-badge), .tax-empty p { margin: 10px 0 0; font-size: 18px; line-height: 1.75; }
.tax-badge { width: fit-content; margin: 0; padding: 3px 8px; color: #533d12; background: #f4e6c3; border-radius: 999px; font-size: 18px; font-weight: 900; }
.tax-check-title { margin-top: 15px; display: block; color: var(--green); font-size: 18px; }
.tax-card ul { margin: 7px 0 0; padding-left: 1.35em; }
.tax-card li { font-size: 18px; line-height: 1.7; }
.tax-card li + li { margin-top: 5px; }
.tax-card a { min-height: 50px; margin-top: 13px; display: inline-flex; align-items: center; color: var(--navy); font-size: 18px; font-weight: 900; text-underline-offset: 4px; }
.tax-empty strong { color: var(--navy); font-size: 18px; }
.tax-note { margin: 14px 2px 0; color: var(--muted); font-size: 18px; line-height: 1.75; }
.result-grid { display: grid; gap: 0; }
.caution-section { border-left: 4px solid var(--gold); }
.caution-section ul { margin: 15px 0 0; padding-left: 1.35em; }
.caution-section li + li { margin-top: 9px; }
.caution-section li, .later-section p { font-size: 18px; line-height: 1.8; }
.later-section p { margin: 13px 0 0; }
.advisor-card { margin-top: 18px; padding: 20px; display: grid; grid-template-columns: 54px 1fr; gap: 15px; color: #fff; background: var(--navy); border-radius: 13px; }
.advisor-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid rgba(234,216,174,.55); border-radius: 50%; color: var(--gold-light); font-size: 18px; font-weight: 900; }
.advisor-card h2 { color: #fff; font-size: 22px; }
.advisor-card p { margin: 7px 0 0; color: rgba(255,255,255,.86); font-size: 18px; line-height: 1.75; }
.cta-section { margin-top: 28px; padding: 28px 20px; background: #eef4f0; border: 1px solid #cbded5; border-radius: 15px; }
.cta-section h2 { font-size: 30px; }
.cta-list { margin-top: 19px; display: grid; gap: 12px; }
.cta-button { min-height: 72px; display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 12px; padding: 12px 15px; color: var(--navy); background: #fff; border: 2px solid #cad5d0; border-radius: 11px; text-decoration: none; }
.cta-button--primary { color: #fff; background: var(--green); border-color: var(--green); box-shadow: 0 10px 24px rgba(18,63,55,.18); }
.cta-button--subtle { background: #fffdf7; border-color: #d8c99e; }
.cta-icon { width: 42px; height: 42px; display: grid; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-family: var(--serif); font-size: 18px; font-weight: 900; }
.cta-button > span:nth-child(2) { min-width: 0; display: grid; }
.cta-button strong { font-size: 18px; line-height: 1.4; }
.cta-button small { margin-top: 2px; color: var(--muted); font-size: 18px; line-height: 1.4; }
.cta-button--primary small { color: rgba(255,255,255,.76); }
.cta-note { margin: 14px 0 0; color: var(--muted); font-size: 18px; text-align: center; }
.text-button { min-height: 48px; margin: 20px auto 0; display: block; padding: 8px 14px; border: 0; color: var(--navy); background: transparent; font-size: 18px; font-weight: 800; text-decoration: underline; cursor: pointer; }
.legal-note { margin: 22px 4px 0; color: var(--muted); font-size: 18px; line-height: 1.75; }

.qa-panel { margin: 30px 0 0; padding: 16px; color: #e8f4ee; background: #101d19; border: 2px dashed #a88743; border-radius: 10px; }
.qa-panel h2 { margin: 0; font-size: 18px; }
.qa-panel pre { max-height: 360px; overflow: auto; margin: 10px 0 0; font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre-wrap; }
.site-footer { padding: 24px 18px calc(24px + env(safe-area-inset-bottom)); color: rgba(255,255,255,.82); background: var(--navy); text-align: center; }
.site-footer p { margin: 0; font-size: 18px; }
.site-footer p + p { margin-top: 2px; }

@media (min-width: 680px) {
  .brand small { display: block; }
  .app-shell { padding-top: 36px; }
  .welcome-screen { display: grid; grid-template-columns: .88fr 1.12fr; }
  .welcome-image-wrap { height: auto; min-height: 530px; }
  .welcome-image { object-position: 57% center; }
  .welcome-copy { padding: 46px 38px; display: flex; flex-direction: column; justify-content: center; }
  .question-card { padding: 38px 42px; }
  .result-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .result-grid .result-section { height: calc(100% - 18px); }
  .result-hero { padding: 38px; }
  .cta-section { padding: 34px; }
}

@media (max-width: 374px) {
  .app-shell { padding-inline: 12px; }
  .site-header { padding-inline: 12px; }
  .welcome-copy, .question-card, .result-section, .cta-section { padding-left: 16px; padding-right: 16px; }
  .welcome-copy h1 { font-size: 32px; }
  .option-button { padding-inline: 14px; }
  .cta-button { grid-template-columns: 38px 1fr auto; gap: 9px; padding-inline: 11px; }
  .cta-icon { width: 38px; height: 38px; }
}

@media (max-width: 480px) and (max-height: 700px) {
  .app-shell { padding-top: 16px; }
  .welcome-image-wrap { height: 120px; }
  .welcome-copy { padding-top: 18px; padding-bottom: 20px; }
  .welcome-copy h1 { font-size: 34px; line-height: 1.2; }
  .lead { margin-top: 10px; line-height: 1.55; }
  .assurance { margin: 12px 0; }
  .microcopy { display: none; }
}
