:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-soft: #eef5fa;
  --text: #10263a;
  --muted: #607486;
  --line: #dbe5ec;
  --primary: #0b5ea8;
  --primary-dark: #083e6c;
  --accent: #00a57a;
  --accent-soft: #e8f8f3;
  --warning: #b46b00;
  --danger: #b73a3a;
  --shadow: 0 18px 50px rgba(15, 47, 72, .10);
  --radius: 22px;
  --radius-sm: 14px;
  --container: 1240px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
.container { width: min(var(--container), calc(100% - 36px)); margin-inline: auto; }

.skip-link {
  position: fixed;
  z-index: 9999;
  left: 12px;
  top: 12px;
  transform: translateY(-160%);
  padding: 10px 14px;
  border-radius: 10px;
  background: #111;
  color: #fff;
  transition: transform .2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,.92);
  border-bottom: 1px solid rgba(219,229,236,.9);
  backdrop-filter: blur(14px);
}
.header-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 22px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 900; letter-spacing: .05em; color: var(--primary-dark); }
.brand img { width: 42px; height: 42px; border-radius: 12px; object-fit: cover; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.language-label { font-size: .84rem; color: var(--muted); }
.language-select { min-height: 42px; padding: 0 34px 0 12px; border: 1px solid var(--line); border-radius: 11px; background: #fff; color: var(--text); }
.back-link { text-decoration: none; font-weight: 750; color: var(--primary); }
.back-link:hover { text-decoration: underline; }

.hero { padding: 46px 0 30px; background: radial-gradient(circle at 15% 10%, #e0f4ff 0, transparent 35%), linear-gradient(180deg,#fff 0,#f7fbfe 100%); border-bottom: 1px solid var(--line); overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: .9fr 1.1fr; align-items: center; gap: 48px; }
.eyebrow { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; color: var(--accent); }
h1 { margin: 0; font-size: clamp(2.25rem,5vw,4.7rem); line-height: .98; letter-spacing: -.045em; max-width: 900px; }
.hero-lead { margin: 22px 0 0; max-width: 680px; font-size: clamp(1.05rem,1.8vw,1.35rem); color: var(--muted); }
.privacy-pill { display: inline-flex; gap: 9px; align-items: center; margin-top: 20px; padding: 9px 12px; border: 1px solid #bfe9dc; border-radius: 999px; background: var(--accent-soft); color: #13654e; font-weight: 700; font-size: .9rem; }
.privacy-pill > span:first-child { color: var(--accent); }
.hero-cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-visual { margin: 0; border-radius: 28px; overflow: hidden; box-shadow: 0 28px 70px rgba(6, 42, 70, .22); border: 1px solid #d9e3ea; background: #071d35; aspect-ratio: 16 / 9; }
.hero-visual img { width: 100%; height: 100%; object-fit: cover; }

.button { min-height: 46px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; padding: 0 17px; font-weight: 850; border: 1px solid transparent; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button-primary { background: var(--primary); color: white; box-shadow: 0 12px 25px rgba(11,94,168,.22); }
.button-primary:hover { background: #07528f; }
.button-ghost { border-color: var(--line); background: #fff; color: var(--primary-dark); }
.button-secondary { background: #eaf3f9; color: var(--primary-dark); border-color: #cfe0ec; }
.button-danger-ghost { color: var(--danger); background: #fff; border-color: #efcece; }

.trust-strip { background: #fff; border-bottom: 1px solid var(--line); }
.trust-grid { display: grid; grid-template-columns: repeat(4,1fr); }
.trust-grid > div { padding: 22px 24px; border-right: 1px solid var(--line); }
.trust-grid > div:last-child { border-right: 0; }
.trust-grid strong, .trust-grid span { display: block; }
.trust-grid strong { font-size: .95rem; }
.trust-grid span { margin-top: 3px; color: var(--muted); font-size: .87rem; }

.app-section { padding: 48px 0 64px; }
.app-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
.main-column { min-width: 0; display: grid; gap: 24px; }
.side-column { min-width: 0; }
.card, .side-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card { padding: 28px; }
.card-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; margin-bottom: 24px; }
.card-heading h2 { margin: 6px 0 4px; font-size: clamp(1.35rem,2vw,1.75rem); letter-spacing: -.02em; }
.card-heading p { margin: 0; color: var(--muted); max-width: 760px; }
.step { display: inline-flex; width: 30px; height: 30px; border-radius: 9px; align-items: center; justify-content: center; background: #e8f3fb; color: var(--primary); font-weight: 900; }
.text-button { border: 0; background: transparent; color: var(--primary); font-weight: 800; padding: 8px; }
.text-button:hover { text-decoration: underline; }

.expense-grid, .form-grid { display: grid; gap: 16px; }
.expense-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.two-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.three-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: grid; gap: 7px; color: #31495b; font-size: .9rem; font-weight: 750; min-width: 0; }
.field-wide { grid-column: 1 / -1; }
.field input, .field select { width: 100%; min-width: 0; min-height: 46px; border: 1px solid #cfdce5; border-radius: 11px; background: #fff; color: var(--text); padding: 9px 12px; outline: none; }
.field input:focus, .field select:focus, .language-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,94,168,.12); }
.money-input, .suffix-input { display: flex; align-items: stretch; border: 1px solid #cfdce5; border-radius: 11px; overflow: hidden; background: #fff; }
.money-input:focus-within, .suffix-input:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(11,94,168,.12); }
.money-input > span, .suffix-input > span { display: grid; place-items: center; min-width: 42px; padding: 0 10px; background: #f4f8fb; color: var(--muted); font-weight: 850; border-right: 1px solid var(--line); }
.suffix-input > span { border-right: 0; border-left: 1px solid var(--line); min-width: 82px; }
.money-input input, .suffix-input input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }
.total-bar { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 18px; border-radius: 14px; background: linear-gradient(100deg,#edf9f5,#f7fbfd); border: 1px solid #c9eadf; }
.total-bar span { color: #28624f; font-weight: 750; }
.total-bar strong { color: #0c7253; font-size: 1.35rem; white-space: nowrap; }

.results-heading { align-items: center; }
.saved-indicator { font-size: .78rem; color: #397661; background: var(--accent-soft); border-radius: 999px; padding: 7px 10px; white-space: nowrap; }
.fund-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.fund-option { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: #fbfdff; min-width: 0; }
.fund-option span, .fund-option strong, .fund-option small { display: block; }
.fund-option span { font-size: .88rem; font-weight: 800; color: var(--muted); }
.fund-option strong { margin-top: 7px; font-size: clamp(1.12rem,2vw,1.45rem); letter-spacing: -.02em; overflow-wrap: anywhere; }
.fund-option small { margin-top: 7px; color: #7b8c99; line-height: 1.35; }
.fund-option.is-highlight { border-color: #9dd8c6; background: #f0fbf7; }
.recommendation { margin-top: 18px; display: grid; grid-template-columns: 46px 1fr; gap: 14px; padding: 18px; border: 1px solid #b9d7ea; border-radius: 16px; background: #f0f7fc; }
.recommendation-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; background: var(--primary); font-weight: 900; font-size: 1.4rem; }
.recommendation span { font-size: .85rem; color: var(--muted); }
.recommendation strong { display: block; margin-top: 3px; font-size: 1.25rem; }
.recommendation p { margin: 4px 0 0; color: #465f72; }

.mode-panel { margin-top: 18px; padding: 18px; border-radius: 14px; background: var(--surface-soft); }
.plan-input { max-width: 420px; }
.plan-summary { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 18px; }
.plan-summary > div { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.plan-summary span, .plan-summary strong { display: block; }
.plan-summary span { color: var(--muted); font-size: .8rem; }
.plan-summary strong { margin-top: 4px; font-size: 1rem; overflow-wrap: anywhere; }
.progress-wrap { margin-top: 20px; }
.progress-labels { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: .88rem; }
.progress-track { height: 14px; border-radius: 999px; background: #e4edf3; overflow: hidden; }
.progress-track > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg,#0b5ea8,#00a57a); border-radius: inherit; transition: width .25s ease; }
.milestones { display: grid; grid-template-columns: repeat(4,1fr); gap: 10px; margin-top: 15px; }
.milestone { padding: 12px; border-radius: 12px; background: #f7fafc; border: 1px solid var(--line); }
.milestone strong, .milestone span { display: block; }
.milestone strong { font-size: .86rem; }
.milestone span { margin-top: 3px; font-size: .78rem; color: var(--muted); }
.chart-card { margin-top: 22px; border: 1px solid var(--line); border-radius: 16px; padding: 16px; background: #fbfdff; }
.chart-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.chart-heading h3 { margin: 0; }
.chart-heading span { color: var(--muted); font-size: .78rem; }
.chart-wrap { position: relative; width: 100%; overflow: hidden; margin-top: 12px; }
.chart-wrap canvas { display: block; width: 100%; height: 280px; }

.export-card { display: flex; justify-content: space-between; align-items: center; gap: 24px; }
.export-card h2 { margin: 0 0 5px; }
.export-card p { margin: 0; color: var(--muted); }
.export-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

.side-card { padding: 20px; }
.sticky-card { position: sticky; top: 96px; }
.side-card > img { width: 100%; border-radius: 16px; aspect-ratio: 1.54 / 1; object-fit: cover; object-position: center; border: 1px solid #d7e2e9; }
.side-card h2 { margin: 20px 0 8px; font-size: 1.28rem; }
.side-card p { margin: 0; color: var(--muted); }
.check-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 11px; }
.check-list li { position: relative; padding-left: 24px; color: #344f61; font-size: .9rem; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 0; color: var(--accent); font-weight: 900; }
.notice { margin-top: 18px; padding: 13px; border-radius: 12px; background: #fff8e8; color: #725018; border: 1px solid #ecd8aa; font-size: .82rem; }

.seo-content { padding: 10px 0 64px; }
.prose-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 18px; }
.prose-grid article { border-top: 3px solid #c8deec; padding-top: 15px; }
.prose-grid h2 { margin: 0 0 8px; font-size: 1.1rem; }
.prose-grid p { margin: 0; color: var(--muted); }

.site-footer { background: #0a253d; color: #d7e4ef; }
.footer-inner { min-height: 88px; display: flex; align-items: center; justify-content: space-between; gap: 20px; font-size: .88rem; }
.site-footer a { color: #fff; font-weight: 750; }
.footer-local { color: #8fb0c8; }
.noscript { position: fixed; inset: auto 12px 12px 12px; z-index: 100; background: #fff3cd; border: 1px solid #e8c94b; color: #4d4010; border-radius: 12px; padding: 14px; }

@media (max-width: 1050px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-copy { max-width: 820px; }
  .app-layout { grid-template-columns: 1fr; }
  .sticky-card { position: static; }
  .side-card { display: grid; grid-template-columns: 260px 1fr; column-gap: 22px; align-items: start; }
  .side-card > img { grid-row: 1 / span 5; }
  .fund-grid { grid-template-columns: repeat(2,1fr); }
  .plan-summary { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  .container { width: min(100% - 24px, var(--container)); }
  .site-header { position: static; }
  .header-inner { min-height: 64px; }
  .brand span { display: none; }
  .language-label { display: none; }
  .back-link { font-size: .86rem; }
  .hero { padding-top: 30px; }
  h1 { font-size: clamp(2.2rem,11vw,3.6rem); }
  .hero-visual { border-radius: 18px; }
  .trust-grid { grid-template-columns: repeat(2,1fr); }
  .trust-grid > div { border-bottom: 1px solid var(--line); }
  .trust-grid > div:nth-child(2) { border-right: 0; }
  .trust-grid > div:nth-last-child(-n+2) { border-bottom: 0; }
  .card { padding: 20px; border-radius: 18px; }
  .expense-grid, .form-grid.two-cols, .form-grid.three-cols { grid-template-columns: 1fr; }
  .field-wide { grid-column: auto; }
  .card-heading { margin-bottom: 20px; }
  .saved-indicator { display: none; }
  .fund-grid { grid-template-columns: 1fr 1fr; }
  .milestones { grid-template-columns: repeat(2,1fr); }
  .chart-heading { display: block; }
  .chart-heading span { display: block; margin-top: 3px; }
  .export-card { display: block; }
  .export-actions { margin-top: 16px; justify-content: flex-start; }
  .side-card { display: block; }
  .side-card > img { margin-bottom: 18px; max-height: 300px; }
  .prose-grid { grid-template-columns: 1fr; }
  .footer-inner { padding: 22px 0; display: grid; justify-items: start; }
}

@media (max-width: 520px) {
  .header-actions { gap: 7px; }
  .language-select { min-height: 40px; padding-left: 9px; padding-right: 26px; }
  .back-link { max-width: 124px; line-height: 1.15; text-align: right; }
  .hero-cta-row > * { width: 100%; }
  .privacy-pill { border-radius: 14px; align-items: flex-start; }
  .trust-grid { grid-template-columns: 1fr; }
  .trust-grid > div { border-right: 0; border-bottom: 1px solid var(--line) !important; padding: 17px 6px; }
  .trust-grid > div:last-child { border-bottom: 0 !important; }
  .fund-grid { grid-template-columns: 1fr; }
  .plan-summary { grid-template-columns: 1fr; }
  .milestones { grid-template-columns: 1fr 1fr; }
  .recommendation { grid-template-columns: 1fr; }
  .chart-wrap canvas { height: 240px; }
  .total-bar { align-items: flex-start; flex-direction: column; }
  .footer-local { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
