:root {
  --navy-950: #041d3d;
  --navy-900: #082b5b;
  --navy-800: #0c3d78;
  --blue-700: #075fc9;
  --blue-600: #0874e8;
  --blue-100: #dcecff;
  --yellow-500: #ffc928;
  --yellow-100: #fff2b8;
  --green-700: #087443;
  --green-100: #d9f4e5;
  --red-700: #a82525;
  --red-100: #fde3e3;
  --ink: #10233e;
  --muted: #4b5e78;
  --line: #ccd7e5;
  --surface: #ffffff;
  --surface-soft: #f3f7fb;
  --focus: #ffb703;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-action: 0 8px 22px rgba(8, 43, 91, 0.14);
  --text-scale: 1;
  color-scheme: light;
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
  font-size: calc(16px * var(--text-scale));
  background: var(--surface-soft);
  color: var(--ink);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 1.125rem;
  line-height: 1.55;
  padding-bottom: 34px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { color: inherit; }
button, select, input, textarea, summary { outline: none; }

:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 3px;
}

[tabindex="-1"]:focus { outline: none; }

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 12px;
  left: 12px;
  transform: translateY(-150%);
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--yellow-500);
  color: var(--navy-950);
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  z-index: 50;
  top: 0;
  background: var(--navy-900);
  color: #fff;
  box-shadow: 0 5px 18px rgba(4, 29, 61, 0.2);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  width: min(1180px, calc(100% - 40px));
  min-height: 84px;
  margin: 0 auto;
}

.brand-button, .profile-button, .tool-button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.brand-button {
  display: flex;
  align-items: center;
  gap: 18px;
  min-height: 56px;
  padding: 6px 8px;
  text-align: left;
}

.brand-name {
  font-size: 1.65rem;
  font-weight: 900;
  letter-spacing: -0.025em;
}

.brand-context {
  padding-left: 18px;
  border-left: 1px solid rgba(255,255,255,.52);
  color: #d8e7fb;
  font-size: .95rem;
  font-weight: 700;
}

.header-tools { display: flex; align-items: center; gap: 12px; }
.text-size { display: flex; align-items: center; gap: 6px; }
.text-size-label { color: #d8e7fb; font-size: .86rem; margin-right: 4px; }

.tool-button {
  min-width: 48px;
  min-height: 48px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.45);
  border-radius: var(--radius-sm);
  font-weight: 800;
}
.tool-button:hover { background: rgba(255,255,255,.12); }
.language-button { min-width: 54px; }

.profile-button {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
}
.profile-button:hover { background: rgba(255,255,255,.1); }
.profile-button small, .profile-button strong { display: block; }
.profile-button small { color: #d8e7fb; font-size: .8rem; }
.profile-avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  color: var(--navy-900);
  font-size: .82rem;
  font-weight: 900;
}

.sample-banner {
  display: flex;
  justify-content: center;
  gap: 8px;
  padding: 8px 20px;
  background: var(--yellow-100);
  color: #4d3a00;
  font-size: .88rem;
  text-align: center;
}

.view { min-height: calc(100vh - 140px); }
.view[hidden] { display: none; }
.view.is-active { animation: route-in 320ms cubic-bezier(.2,.8,.2,1) both; }

@keyframes route-in {
  from { opacity: .15; transform: translateY(12px); clip-path: inset(0 0 4% 0); }
  to { opacity: 1; transform: translateY(0); clip-path: inset(0); }
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 42px 0 60px;
}
.home-shell { width: min(1000px, calc(100% - 40px)); }
.narrow-shell { width: min(800px, calc(100% - 40px)); }

.home-heading { margin-bottom: 22px; }
.welcome, .section-context {
  margin: 0 0 4px;
  color: var(--blue-700);
  font-weight: 800;
}

h1, h2, h3, p { text-wrap: pretty; }
h1 {
  max-width: 18ch;
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(2.25rem, 5vw, 4.1rem);
  line-height: 1.04;
  letter-spacing: -0.035em;
}
h2 { margin: 0; color: var(--navy-950); font-size: clamp(1.35rem, 3vw, 1.85rem); line-height: 1.2; letter-spacing: -.02em; }
p { max-width: 70ch; margin: 10px 0 0; color: var(--muted); }

.task-route { display: grid; gap: 10px; }

.destination {
  display: grid;
  grid-template-columns: 72px 1fr 44px;
  align-items: center;
  gap: 20px;
  width: 100%;
  min-height: 86px;
  padding: 11px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms cubic-bezier(.2,.8,.2,1), box-shadow 180ms ease, border-color 180ms ease;
}
.destination:hover, .destination:focus-visible { transform: translateY(-2px); border-color: var(--blue-600); box-shadow: var(--shadow-action); }
.destination:active { transform: translateY(1px); }

.destination-marker {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  color: #fff;
  font-weight: 900;
  letter-spacing: -.02em;
}
.destination-marker svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.marker-yellow { background: var(--yellow-500); color: var(--navy-950); }
.marker-blue { background: var(--blue-700); }
.marker-green { background: var(--green-700); font-size: 2rem; }
.marker-navy { background: var(--navy-900); }
.marker-pale { background: var(--blue-100); color: var(--navy-900); font-size: 1.8rem; }

.destination-copy strong, .destination-copy small { display: block; }
.destination-copy strong { color: var(--navy-950); font-size: 1.32rem; line-height: 1.2; }
.destination-copy small { margin-top: 5px; color: var(--muted); font-size: 1rem; line-height: 1.4; }
.destination-arrow { justify-self: end; color: var(--navy-900); font-size: 3rem; line-height: 1; }

.attention-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 26px;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--yellow-100);
}
.attention-strip h2 { margin-top: 7px; font-size: 1.35rem; }
.attention-strip p { margin-top: 4px; color: #504113; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px); }
.button-primary { background: var(--blue-700); color: #fff; }
.button-primary:hover { background: var(--navy-800); box-shadow: var(--shadow-action); }
.button-secondary { border-color: var(--navy-800); background: #fff; color: var(--navy-900); }
.button-secondary:hover { background: var(--blue-100); }
.button-help { min-width: 124px; gap: 8px; background: var(--yellow-500); color: var(--navy-950); }
.button-help:hover { background: #ffe078; }
.button-help-icon { font-size: 1.2rem; font-weight: 900; }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; box-shadow: none; }

.back-button, .text-button {
  min-height: 48px;
  padding: 8px 4px;
  border: 0;
  background: transparent;
  color: var(--blue-700);
  cursor: pointer;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.back-button { margin-bottom: 26px; }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 34px;
}
.section-heading h1 { font-size: clamp(2.2rem, 4vw, 3.5rem); }

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 900;
}
.status-attention { background: var(--yellow-500); color: var(--navy-950); }
.status-progress { background: var(--blue-100); color: var(--navy-900); }
.status-success { background: var(--green-100); color: var(--green-700); }

.balance-panel {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 28px;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--navy-900);
  color: #fff;
}
.balance-primary span, .balance-primary strong, .balance-primary small { display: block; }
.balance-primary span, .balance-primary small { color: #cfe1f8; }
.balance-primary strong { margin: 10px 0; font-size: clamp(2.2rem, 5vw, 3.7rem); line-height: 1; letter-spacing: -.035em; }
.balance-breakdown { display: grid; gap: 8px; margin: 0; }
.balance-breakdown div { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.25); }
.balance-breakdown dt { color: #cfe1f8; }
.balance-breakdown dd { margin: 0; font-weight: 900; }

.content-grid { display: grid; grid-template-columns: .85fr 1.15fr; gap: 22px; margin-top: 24px; }
.content-section {
  padding: 26px;
  border-radius: var(--radius-md);
  background: var(--surface);
}
.content-section-heading { display: flex; align-items: start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.content-section-heading p { font-size: .95rem; }
.inline-control { display: grid; gap: 4px; }
.inline-control label { font-size: .82rem; font-weight: 800; }
.field-help { font-size: .9rem; }

select, input, textarea {
  width: 100%;
  min-height: 52px;
  padding: 11px 13px;
  border: 2px solid #9fb0c5;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { border-color: var(--blue-700); box-shadow: 0 0 0 3px var(--blue-100); }
input:invalid:not(:placeholder-shown) { border-color: var(--red-700); }

.record-list { list-style: none; margin: 0; padding: 0; }
.record-list li { display: flex; justify-content: space-between; gap: 22px; padding: 15px 0; border-top: 1px solid var(--line); }
.record-list li:first-child { border-top: 0; }
.record-list strong, .record-list small { display: block; }
.record-list small { color: var(--muted); }
.record-list li > span:last-child { white-space: nowrap; font-weight: 900; }
.amount-positive { color: var(--green-700); }

.status-board { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); }
.status-board-top { display: flex; align-items: start; justify-content: space-between; gap: 22px; }
.status-board h2 { margin-top: 10px; }

.progress-route { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 34px 0 0; padding: 0; counter-reset: stage; }
.progress-route li { position: relative; padding: 48px 20px 0 0; color: var(--muted); counter-increment: stage; }
.progress-route li::before {
  content: counter(stage);
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #d6dfeb;
  color: var(--navy-900);
  font-weight: 900;
}
.progress-route li::after { content: ""; position: absolute; top: 18px; left: 38px; right: 0; height: 3px; background: #d6dfeb; }
.progress-route li:last-child::after { display: none; }
.progress-route li.is-done::before, .progress-route li.is-done::after { background: var(--green-700); color: #fff; }
.progress-route li.is-current::before { background: var(--yellow-500); color: var(--navy-950); }
.progress-route strong, .progress-route span { display: block; }
.progress-route strong { color: var(--ink); }
.progress-route span { font-size: .9rem; }

.application-flow { margin-top: 24px; padding: 30px; border-radius: var(--radius-lg); background: var(--surface); }
.flow-heading { display: flex; justify-content: space-between; gap: 18px; }
.step-meter { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 22px 0 32px; }
.step-meter span { height: 8px; border-radius: 999px; background: #d6dfeb; }
.step-meter span.is-active { background: var(--blue-700); }

fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
legend { padding: 0; color: var(--navy-950); font-size: 1.55rem; font-weight: 900; }
.legend-help { margin: 4px 0 22px; }
.choice-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice span { display: block; min-height: 105px; padding: 18px; border: 2px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.choice strong, .choice small { display: block; }
.choice strong { color: var(--navy-950); font-size: 1.15rem; }
.choice small { margin-top: 5px; color: var(--muted); }
.choice input:checked + span { border-color: var(--blue-700); background: var(--blue-100); box-shadow: 0 0 0 2px var(--blue-700); }
.choice input:focus-visible + span { outline: 4px solid var(--focus); outline-offset: 3px; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: grid; gap: 7px; margin-bottom: 20px; }
.field label { color: var(--navy-950); font-weight: 800; }
.field label span { color: var(--muted); font-weight: 500; }
.field small { color: var(--muted); }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 24px; }
.form-error { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-100); color: var(--red-700); font-weight: 800; }

.application-success { max-width: 680px; padding: 18px 0 4px; }
.success-mark { display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: 20px; border-radius: 50%; background: var(--green-700); color: #fff; font-size: 2rem; font-weight: 900; }
.receipt-note { margin-top: 24px; padding: 18px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-700); }
.receipt-note p { color: #245a41; }

.review-list { margin: 20px 0; border-top: 1px solid var(--line); }
.review-list div { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.review-list dt { color: var(--muted); }
.review-list dd { margin: 0; font-weight: 900; }
.confirm-check { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-sm); background: var(--surface-soft); cursor: pointer; }
.confirm-check input { width: 26px; min-height: 26px; }

.document-layout { display: grid; grid-template-columns: 1.35fr .65fr; gap: 22px; align-items: start; }
.content-section > h2:not(:first-child) { margin-top: 32px; }
.upload-zone {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 24px;
  border: 3px dashed #8aa2bf;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  cursor: pointer;
  text-align: center;
}
.upload-zone:hover, .upload-zone.is-dragging { border-color: var(--blue-700); background: var(--blue-100); }
.upload-zone:has(input:focus-visible) { outline: 4px solid var(--focus); outline-offset: 3px; border-color: var(--blue-700); }
.upload-zone input { position: absolute; width: 1px; min-height: 1px; opacity: 0; }
.upload-zone strong, .upload-zone small { display: block; }
.upload-zone small { color: var(--muted); }
.upload-symbol { color: var(--blue-700); font-size: 3rem; font-weight: 900; line-height: 1; }
.selected-file { margin: 14px 0; padding: 14px; border-radius: var(--radius-sm); background: var(--green-100); color: var(--green-700); font-weight: 800; }
.guidance-panel { padding: 26px; border-radius: var(--radius-md); background: var(--navy-900); color: #fff; }
.guidance-panel h2 { color: #fff; }
.guidance-panel ol { padding-left: 26px; }
.guidance-panel li { margin-bottom: 14px; }
.privacy-note { margin-top: 24px; padding: 16px; border-radius: var(--radius-sm); background: rgba(255,255,255,.12); }
.privacy-note p { color: #d8e7fb; }

.profile-form { padding: 28px; border-radius: var(--radius-lg); background: var(--surface); }
.read-only-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.read-only-row span { color: var(--muted); }
.read-only-row small { grid-column: 2; color: var(--muted); }
.profile-form .field:first-of-type { margin-top: 28px; }

.help-options { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.help-choice { min-height: 130px; padding: 22px; border: 2px solid var(--line); border-radius: var(--radius-md); background: #fff; text-align: left; cursor: pointer; }
.help-choice:hover { border-color: var(--blue-700); box-shadow: var(--shadow-action); }
.help-choice strong, .help-choice span { display: block; }
.help-choice strong { color: var(--navy-950); font-size: 1.2rem; }
.help-choice span { margin-top: 6px; color: var(--muted); }
.faq { margin-top: 34px; }
.faq h2 { margin-bottom: 14px; }
details { border-top: 1px solid var(--line); background: var(--surface); }
details:last-child { border-bottom: 1px solid var(--line); }
summary { min-height: 60px; padding: 16px; color: var(--navy-950); cursor: pointer; font-weight: 800; }
details p { padding: 0 16px 18px; }

.help-dock {
  position: fixed;
  z-index: 40;
  right: 20px;
  bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 0;
  padding: 7px;
  border-radius: var(--radius-md);
  background: var(--navy-950);
  color: #fff;
  box-shadow: 0 -8px 24px rgba(4, 29, 61, .18);
}
.help-dock > div { display: none; }
.help-dock strong, .help-dock small { display: block; }
.help-dock small { color: #d8e7fb; }
.help-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%; background: #fff; color: var(--navy-900); font-size: 1.5rem; font-weight: 900; }

.toast {
  position: fixed;
  z-index: 100;
  right: 24px;
  bottom: 106px;
  max-width: min(430px, calc(100% - 48px));
  padding: 17px 20px;
  border-radius: var(--radius-md);
  background: var(--green-700);
  color: #fff;
  box-shadow: 0 10px 28px rgba(4, 29, 61, .25);
  font-weight: 800;
}
.toast[hidden] { display: none; }

@media (max-width: 820px) {
  body { padding-bottom: 24px; }
  .header-inner { width: min(100% - 24px, 1120px); min-height: 72px; }
  .brand-context, .text-size-label, .profile-button > span:last-child { display: none; }
  .header-tools { gap: 6px; }
  .text-size { gap: 4px; }
  .tool-button { min-width: 44px; min-height: 44px; padding: 6px; }
  .profile-button { padding: 0; }
  .profile-avatar { width: 42px; height: 42px; }
  .sample-banner { flex-direction: column; gap: 0; }
  .page-shell, .home-shell, .narrow-shell { width: min(100% - 24px, 1120px); padding-top: 28px; }
  .content-grid, .document-layout { grid-template-columns: 1fr; }
  .balance-panel { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; }
  .section-heading .button { width: 100%; }
  .progress-route { grid-template-columns: 1fr; gap: 0; }
  .progress-route li { min-height: 98px; padding: 4px 0 22px 58px; }
  .progress-route li::after { top: 38px; left: 18px; bottom: 0; width: 3px; height: auto; }
  .choice-grid, .field-row, .help-options { grid-template-columns: 1fr; }
  .choice span { min-height: auto; }
  .help-dock { right: 12px; bottom: 12px; padding: 6px; }
  .button-help { width: 52px; min-width: 52px; min-height: 52px; padding: 0; border-radius: 50%; }
  .button-help-icon { font-size: 1.5rem; }
  .button-help-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 560px) {
  .brand-name { font-size: 1.35rem; }
  .language-button { display: none; }
  .page-shell { padding-bottom: 44px; }
  h1 { font-size: clamp(2rem, 10.5vw, 2.85rem); }
  .destination { grid-template-columns: 50px 1fr 24px; gap: 11px; min-height: 80px; padding: 10px; }
  .destination-marker { width: 46px; height: 46px; font-size: .9rem; }
  .destination-marker svg { width: 25px; height: 25px; }
  .destination-copy strong { font-size: 1.08rem; }
  .destination-copy small { font-size: .82rem; }
  .destination-arrow { font-size: 2.4rem; }
  .attention-strip, .status-board-top { align-items: stretch; flex-direction: column; }
  .attention-strip .button, .status-board-top .button { width: 100%; }
  .balance-panel, .content-section, .status-board, .application-flow, .profile-form { padding: 20px 16px; }
  .content-section-heading { flex-direction: column; }
  .inline-control { width: 100%; }
  .record-list li { align-items: start; flex-direction: column; gap: 4px; }
  .form-actions { flex-direction: column-reverse; }
  .form-actions .button { width: 100%; }
  .read-only-row { grid-template-columns: 1fr; }
  .read-only-row small { grid-column: 1; }
  .help-dock > div span:last-child { display: none; }
}

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