:root {
  --ink: #17282a;
  --muted: #58696b;
  --paper: #fffdf8;
  --canvas: #f3f6ef;
  --green: #1d6654;
  --green-dark: #11483c;
  --mint: #dceee5;
  --amber: #9b5c16;
  --amber-soft: #fff0d5;
  --rose: #9a3f49;
  --rose-soft: #fde8e8;
  --line: #cbd8d2;
  --focus: #1769aa;
  --shadow: 0 14px 34px rgba(28, 61, 53, .09);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { max-width: 100%; overflow-x: clip; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.75;
}
a { color: var(--green-dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
button, input, select { font: inherit; }
button, .button {
  min-height: 46px;
  border: 1px solid var(--green);
  border-radius: 999px;
  padding: .65rem 1.1rem;
  color: #fff;
  background: var(--green);
  font-weight: 700;
  cursor: pointer;
}
.button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
button:hover, .button:hover { background: var(--green-dark); }
button.secondary, .button.secondary { color: var(--green-dark); background: #fff; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 20; transform: translateY(-160%); padding: .6rem 1rem; background: #fff; }
.skip-link:focus { transform: none; }
.site-header { border-bottom: 1px solid var(--line); background: rgba(255, 253, 248, .97); }
.header-inner, .page-shell, .footer-inner { width: min(1160px, calc(100% - 32px)); margin-inline: auto; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.1rem 0 .75rem; }
.brand { color: var(--ink); text-decoration: none; font-weight: 800; letter-spacing: .01em; }
.brand-mark { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; margin-right: .55rem; border-radius: 50%; color: #fff; background: var(--green); }
.nonofficial { padding: .2rem .6rem; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .78rem; white-space: nowrap; }
.site-nav { display: flex; gap: .35rem; max-width: 100%; overflow-x: auto; padding: 0 0 .8rem; scrollbar-width: thin; contain: inline-size; }
.site-nav a { flex: 0 0 auto; padding: .45rem .72rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: .9rem; }
.site-nav a[aria-current="page"] { color: #fff; background: var(--green-dark); }
.breadcrumb { margin: 0; padding: 1rem 0 0; color: var(--muted); font-size: .88rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; padding: 0; list-style: none; }
.breadcrumb li + li::before { content: "/"; margin-right: .4rem; color: #8b9995; }
.scope-note { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
button:disabled { cursor: default; opacity: .55; }

main { padding-bottom: 4rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(260px, .6fr); gap: 2rem; align-items: center; padding: clamp(2.4rem, 6vw, 5.5rem) 0 2.25rem; }
.hero.compact { grid-template-columns: 1fr; padding-bottom: 1.5rem; }
.hero h1 { max-width: 18ch; margin: .25rem 0 1rem; font-size: clamp(2rem, 5vw, 4rem); line-height: 1.15; letter-spacing: -.035em; }
.hero:not(.compact) h1 { max-width: none; font-size: clamp(2rem, 3.4vw, 2.8rem); }
.hero:not(.compact) h1 span { display: block; }
.hero.compact h1 { max-width: 24ch; font-size: clamp(2rem, 4vw, 3.2rem); }
.hero p { max-width: 65ch; }
.eyebrow { margin: 0 0 .3rem; color: var(--green); font-size: .82rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.hero-note { padding: 1.4rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.hero-note ul { margin-bottom: 0; padding-left: 1.2rem; }
.hero-actions { margin-top: 1.25rem; }
.hero-disclaimer { margin: 1rem 0 0; color: var(--muted); font-size: .9rem; }
.meta-strip { display: flex; flex-wrap: wrap; gap: .6rem 1rem; margin-top: 1.2rem; color: var(--muted); font-size: .9rem; }

.section { margin-top: 2rem; padding: clamp(1.2rem, 3vw, 2rem); border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); box-shadow: var(--shadow); }
.section.plain { border: 0; box-shadow: none; background: transparent; }
.scope-limits { background: #f8faf8; box-shadow: none; }
.scope-limits-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem 1.25rem; margin: .75rem 0 0; padding-left: 1.2rem; }
#income-check, #application-check { scroll-margin-top: 1rem; }
.section-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.section-header h2, .section h2 { margin: 0 0 .5rem; font-size: clamp(1.45rem, 3vw, 2rem); line-height: 1.3; }
.section-header p { margin: 0; max-width: 66ch; color: var(--muted); }
.step-number { display: inline-grid; place-items: center; flex: 0 0 2.5rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; color: #fff; background: var(--green); font-weight: 800; }
.subsection { min-width: 0; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }
.subsection h3 { margin-top: 0; }

.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field > label, .field > .field-label { display: block; margin-bottom: .35rem; font-weight: 800; }
.field select, .field input[type="number"] { width: 100%; min-height: 48px; border: 1px solid #91a49d; border-radius: 10px; padding: .65rem .75rem; color: var(--ink); background: #fff; }
.choice-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { display: inline-flex; align-items: center; gap: .45rem; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.choice input { width: 1.15rem; height: 1.15rem; accent-color: var(--green); }
.field-help, .source-mini, .muted { color: var(--muted); font-size: .88rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.preset-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.preset-row button { min-height: 38px; padding: .35rem .85rem; }

.availability-shell { width: 100%; max-width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; contain: inline-size; }
.availability-table { width: 100%; min-width: 840px; border-collapse: collapse; font-size: .86rem; }
.availability-table th, .availability-table td { border-right: 1px solid #e2e9e5; border-bottom: 1px solid #e2e9e5; padding: .45rem; text-align: center; vertical-align: middle; }
.availability-table th { background: #eef5f0; }
.availability-table input { width: 1.2rem; height: 1.2rem; accent-color: var(--green); }
.availability-count { margin: .7rem 0 0; font-weight: 800; }
.separation-note { padding: 1rem; border-left: 5px solid var(--amber); background: var(--amber-soft); }

.result-panel { margin-top: 1.5rem; outline: none; }
.result-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.result-head h2 { margin-top: 0; }
.result-badge { padding: .35rem .75rem; border-radius: 999px; color: var(--rose); background: var(--rose-soft); font-size: .82rem; font-weight: 800; }
.scenario-grid, .card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
.card-grid.two-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.two-column { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.two-column > div { padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.two-column h3 { margin-top: 0; }
.scenario-card, .info-card { padding: 1.15rem; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.scenario-card h3, .info-card h3 { margin: 0 0 .75rem; line-height: 1.35; }
.money-list { margin: 0; }
.money-list div { padding: .55rem 0; border-top: 1px solid #e4ebe7; }
.money-list dt { color: var(--muted); font-size: .84rem; }
.money-list dd { margin: .05rem 0 0; font-size: 1.25rem; font-weight: 800; }
.formula { padding: .5rem; border-radius: 8px; background: #f1f6f3; font-size: .84rem; }
.message { margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 12px; }
.message.caution { border: 1px solid #e9c991; background: var(--amber-soft); }
.message.error { border: 1px solid #e2a5aa; background: var(--rose-soft); }
.message.info { border: 1px solid #a9c9bb; background: var(--mint); }
.message ul { margin-bottom: 0; }
.empty-state { padding: 1.2rem; border: 1px dashed #9fb0aa; border-radius: 12px; color: var(--muted); background: #f8faf8; }
.result-group { margin-top: 1.25rem; }
.check-list { display: grid; gap: .75rem; }
.check-item { padding: 1rem; border: 1px solid var(--line); border-left-width: 6px; border-radius: 10px; background: #fff; }
.check-item p { margin: .35rem 0; }
.status-confirmed { border-left-color: var(--green); }
.status-ask { border-left-color: var(--amber); }
.status-reconsider { border-left-color: var(--rose); }
.check-title { display: flex; justify-content: space-between; gap: 1rem; }
.check-title h4 { margin: 0; }
.status-pill { align-self: flex-start; padding: .2rem .55rem; border-radius: 999px; background: #edf2ef; font-size: .78rem; font-weight: 800; }
.question-list { padding-left: 1.4rem; }
.question-list li { margin: .65rem 0; padding-left: .25rem; }

.data-table-shell { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td { border-bottom: 1px solid var(--line); padding: .7rem; text-align: left; vertical-align: top; }
.data-table th { color: var(--green-dark); background: #edf4ef; }
.timeline { list-style: none; padding: 0; counter-reset: process; }
.timeline li { position: relative; margin-left: 1rem; padding: 0 0 1.5rem 2.5rem; border-left: 2px solid var(--line); counter-increment: process; }
.timeline li::before { content: counter(process); position: absolute; left: -1.05rem; top: 0; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; color: #fff; background: var(--green); font-weight: 800; }
.timeline h3 { margin: 0; }
.timeline p { margin: .35rem 0 0; color: var(--muted); }
details { border: 1px solid var(--line); border-radius: 12px; background: #fff; }
summary { padding: 1rem; color: var(--green-dark); font-weight: 800; cursor: pointer; }
details[open] > summary { border-bottom: 1px solid var(--line); }
details > p, details > .data-table-shell { margin-inline: 1rem; }
.operator-info { margin: 0; }
.operator-info div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.operator-info dt { font-weight: 800; }
.operator-info dd { margin: 0; overflow-wrap: anywhere; }
.email-text { font-family: ui-monospace, "Yu Gothic UI", monospace; }

.site-footer { padding: 2.5rem 0; border-top: 1px solid var(--line); background: #e6eee8; }
.footer-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 2rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: .45rem 1rem; }
.footer-note { color: var(--muted); font-size: .86rem; }
.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; }
.noscript { margin: 1rem 0; padding: 1rem; border: 2px solid var(--amber); border-radius: 10px; background: #fff; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 1rem; }
  .scenario-grid, .card-grid, .card-grid.two-cards, .two-column { grid-template-columns: 1fr; }
  .scope-limits-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .result-head, .section-header { flex-direction: column; }
}

@media (max-width: 520px) {
  .header-inner, .page-shell, .footer-inner { width: min(100% - 20px, 1160px); }
  .brand-row { align-items: flex-start; }
  .brand { font-size: .9rem; }
  .brand-mark { width: 1.8rem; height: 1.8rem; }
  .section { padding: 1rem; border-radius: 14px; }
  .hero { padding-top: 2.2rem; }
  .hero h1 { font-size: 1.7rem; }
  .hero-note { padding: 1rem; box-shadow: none; }
  .scope-limits-list { grid-template-columns: 1fr; }
  .actions button, .actions .button { width: 100%; text-align: center; }
}

@media print {
  .site-header, .breadcrumb, .site-footer, .no-print, .hero-note { display: none !important; }
  body { background: #fff; color: #000; }
  .page-shell { width: 100%; }
  .section { border: 0; box-shadow: none; }
  .question-list { font-size: 12pt; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
