/* ===========================================================
  FundEdge brand styles
   Navy #0E1923 · Gold #EF9F27 · White surfaces · Light-grey page
   Mobile-first, no framework.
   =========================================================== */

:root {
  --navy: #0E1923;
  --navy-700: #15212E;
  --navy-600: #1C2A3A;
  --gold: #BA7517;
  --gold-600: #9a5a13;
  --gold-soft: #FFF5E1;
  --ink: #1A2330;
  --ink-2: #4A5566;
  --ink-3: #7A8597;
  --muted: #6B7280;
  --line: #E9E6E0;
  --surface: #FFFFFF;
  --page: #F5F4F1;
  --good: #1F9D55;
  --bad: #C0392B;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-pill: 999px;
  --max-width: 1180px;
  --shadow-sm: 0 1px 2px rgba(15, 25, 35, 0.04), 0 1px 3px rgba(15, 25, 35, 0.04);
  --shadow-md: 0 4px 12px rgba(15, 25, 35, 0.06), 0 2px 4px rgba(15, 25, 35, 0.04);
  --shadow-lg: 0 12px 28px rgba(15, 25, 35, 0.08), 0 4px 8px rgba(15, 25, 35, 0.04);
}

* { box-sizing: border-box; }

/* Make hidden attribute win over component display rules. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--page);
  color: var(--ink);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
a { color: var(--gold-600); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.2;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--gold);
  color: #fff;
  box-shadow: 0 1px 2px rgba(186, 117, 23, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.btn-primary:hover { background: var(--gold-600); text-decoration: none; box-shadow: 0 4px 10px rgba(186, 117, 23, 0.24); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn-outline:hover { background: rgba(0,0,0,0.03); border-color: #D9D5CD; text-decoration: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--navy);
  border-color: var(--line);
}
.btn-secondary:hover { border-color: var(--navy); text-decoration: none; }

.btn-sm { padding: 8px 14px; font-size: 0.85rem; }
.btn-block { width: 100%; margin-top: 8px; }

body.menu-open {
  overflow: hidden;
}

/* ---------- Top nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #fff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  max-width: var(--max-width);
  margin: 0 auto;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.nav-brand img {
  height: 34px;
  width: auto;
  background: transparent;
}
.nav-brand .nav-brand-text {
  display: none;
  font-weight: 500;
  letter-spacing: 0.2px;
  font-size: 1rem;
}

.nav-tabs {
  display: none;
  flex: 1;
  justify-content: center;
  gap: 4px;
}
.nav-tab {
  position: relative;
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.94rem;
  padding: 8px 14px;
  border-radius: 8px;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-tab:hover { background: rgba(14, 25, 35, 0.04); color: var(--ink); }
.nav-tab.is-active {
  color: var(--ink);
  background: rgba(186, 117, 23, 0.08);
}
.nav-tab.is-active::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: -1px;
  height: 2px;
  background: var(--gold);
  border-radius: 2px 2px 0 0;
}

/* CTA banner */
.cta-banner {
  max-width: var(--max-width);
  margin: 32px auto 36px;
  padding: 0 18px;
}
.cta-banner-tight {
  margin-top: 24px;
}
.cta-inner {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-600) 100%);
  color: #FFF;
  border-radius: var(--radius);
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-md);
}
.cta-text strong { display: block; font-size: 1.08rem; color: #FFF; font-weight: 600; }
.cta-sub { color: rgba(255, 255, 255, 0.78); font-size: 0.95rem; margin-top: 4px; }
.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.btn-ghost-dark {
  background: rgba(255, 255, 255, 0.06);
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.btn-ghost-dark:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.3); }

.nav-cta {
  flex-shrink: 0;
}

/* Mobile menu toggle */
.nav-toggle {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.nav-toggle:hover { background: rgba(14, 25, 35, 0.04); }
.nav-toggle svg { width: 20px; height: 20px; }

/* Mobile dropdown */
.nav-mobile {
  display: none;
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 10px 14px 16px;
  box-shadow: var(--shadow-md);
  position: relative;
  z-index: 65;
}
.nav-mobile.is-open { display: block; }
.nav-mobile .nav-tab {
  display: block;
  width: 100%;
  text-align: left;
  margin: 2px 0;
  padding: 12px 14px;
  border-radius: 8px;
}
.nav-mobile .nav-tab.is-active::after { display: none; }
.nav-mobile .btn { width: 100%; margin-top: 10px; }

.nav-backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(14, 25, 35, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
  z-index: 60;
}
.nav-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}

@media (min-width: 860px) {
  .nav-brand .nav-brand-text { display: inline; color: var(--ink); }
  .nav-brand .nav-brand-text .logo-accent { color: var(--gold); margin-left: 2px; }
  .nav-tabs { display: flex; }
  .nav-toggle { display: none; }
  .nav-mobile { display: none !important; }
  .nav-backdrop { display: none !important; }
}

/* Logo text variants */
.logo-plain { font-weight: 500; color: var(--ink); }
.logo-accent { font-weight: 500; color: var(--gold); }

/* Trust signals under hero */
.trust-signals {
  list-style: none;
  padding: 0;
  margin: 14px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--ink-2);
  font-size: 0.9rem;
  align-items: center;
  justify-content: center;
}
.trust-signals li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.86);
}
.ts-icon {
  display: inline-flex;
  width: 18px; height: 18px;
  align-items: center; justify-content: center;
  font-size: 11px; color: var(--gold);
  background: rgba(186, 117, 23, 0.08);
  border-radius: 5px;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(186, 117, 23, 0.11), transparent 50%),
    radial-gradient(120% 120% at 100% 100%, rgba(14, 25, 35, 0.07), transparent 56%),
    linear-gradient(180deg, #FFFFFF 0%, #F7F6F2 100%);
  padding: 34px 0 36px;
  border-bottom: 1px solid var(--line);
}
.hero::before {
  content: "";
  position: absolute;
  width: 280px;
  height: 280px;
  top: -120px;
  right: -80px;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(186, 117, 23, 0.18), rgba(186, 117, 23, 0));
}
.hero::after {
  content: "";
  position: absolute;
  width: 220px;
  height: 220px;
  bottom: -120px;
  left: -90px;
  pointer-events: none;
  background: radial-gradient(circle at center, rgba(14, 25, 35, 0.12), rgba(14, 25, 35, 0));
}
.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 980px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  align-items: start;
  justify-items: center;
  text-align: center;
}
.hero-copy {
  max-width: 760px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--gold);
  background: rgba(186, 117, 23, 0.10);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
  letter-spacing: 0.02em;
}
.hero h1 {
  font-size: clamp(28px, 4.6vw, 44px);
  line-height: 1.12;
  margin: 8px 0 14px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.hero h1 .accent { color: var(--gold); }
.hero p.lead {
  font-size: clamp(15px, 1.6vw, 17px);
  color: var(--ink-2);
  margin: 0 auto 18px;
  max-width: 660px;
  line-height: 1.55;
}
.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.hero-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.hero-preview {
  width: 100%;
  max-width: 900px;
  padding: 14px 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(255, 255, 255, 0.92)),
    radial-gradient(130% 130% at 100% 0%, rgba(186, 117, 23, 0.12), transparent 65%);
  border-color: rgba(186, 117, 23, 0.24);
  box-shadow: var(--shadow-lg);
  text-align: left;
}
.hero-preview-head {
  margin-bottom: 8px;
}
.hero-preview-kicker {
  display: inline-flex;
  padding: 4px 9px;
  border-radius: var(--radius-pill);
  background: rgba(186, 117, 23, 0.12);
  color: #8A5A0E;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}
.hero-preview-title {
  margin: 6px 0 0;
  font-size: 1rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.hero-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.hero-kpi {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 9px;
  background: #FFF;
}
.hero-kpi-label {
  display: block;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 2px;
}
.hero-kpi strong {
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.25;
}
.hero-preview-foot {
  margin: 8px 0 8px;
  color: var(--ink-2);
  font-size: 0.78rem;
  line-height: 1.45;
}
.hero-preview .btn-block {
  width: auto;
  margin-top: 0;
  margin-left: auto;
  padding: 9px 16px;
}
@media (min-width: 720px) {
  .hero { padding: 42px 0 46px; }
}
@media (min-width: 860px) {
  .hero-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}
@media (min-width: 980px) {
  .hero-inner {
    max-width: 1020px;
    gap: 16px;
  }
}

/* ---------- Tab sections ---------- */
.tab-section {
  display: none;
  padding: 20px 0 48px;
}
.tab-section.is-active { display: block; }

.section-title {
  font-size: clamp(1.4rem, 2.6vw, 1.65rem);
  margin: 0 0 6px;
  letter-spacing: -0.015em;
  font-weight: 600;
  color: var(--ink);
}
.section-sub {
  color: var(--ink-2);
  margin: 0 0 20px;
  font-size: 0.98rem;
  line-height: 1.55;
}

/* ---------- Cards (used across phases) ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Placeholder cards shown during phase 1 */
.placeholder {
  border: 1px dashed var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  color: var(--ink-2);
}
.placeholder strong { color: var(--ink); display: block; margin-bottom: 6px; font-size: 1.05rem; }

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  color: #C9D2E0;
  padding: 32px 0 24px;
  margin-top: 24px;
}
.footer-inner {
  display: grid;
  gap: 18px;
  align-items: center;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.footer-brand img {
  height: 36px;
  background: #FFF;
  padding: 4px 8px;
  border-radius: 8px;
}
.footer-brand .footer-text strong { color: #FFF; display: block; }
.footer-brand .footer-text span { font-size: 0.88rem; color: #95A2B5; }
.footer-meta {
  font-size: 0.85rem;
  color: #8B97AA;
}
@media (min-width: 720px) {
  .footer-inner {
    grid-template-columns: 1fr auto;
  }
  .footer-meta { text-align: right; }
}

/* ===========================================================
   Calculator (phase 2)
   =========================================================== */

/* Prepared-for amber bar */
.prepared-bar {
  background: var(--gold-soft);
  border: 1px solid #F5DBA7;
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.prepared-bar label {
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #8A5A0E;
  flex-shrink: 0;
}
.prepared-bar input {
  flex: 1;
  min-width: 180px;
  background: var(--surface);
  border: 1px solid var(--line);
  outline: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink);
  padding: 10px 12px;
  border-radius: 8px;
}
.prepared-bar input::placeholder { color: #B58A45; font-weight: 500; }

/* Header + currency selector */
.calc-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
}
.calc-header .section-title { margin: 0; }
.calc-header .section-sub { margin: 4px 0 0; }
.calc-toolbar { display: flex; gap: 10px; align-items: center; }
.calc-toolbar .select { min-width: 200px; font-weight: 500; }
@media (min-width: 720px) {
  .calc-header {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
  }
  .calc-toolbar { flex-shrink: 0; }
}

/* Calc grid: inputs left, results right (stacked on mobile) */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 920px) {
  .calc-grid { grid-template-columns: 340px 1fr; align-items: start; }
  .calc-inputs { position: sticky; top: 80px; }
}

/* Inputs card */
.calc-inputs { padding: 24px; }
.calc-inputs .field + .field { margin-top: 18px; }

.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 7px;
  letter-spacing: 0.005em;
}
.field-hint {
  font-size: 0.78rem;
  color: var(--ink-3);
  margin: 7px 0 0;
  line-height: 1.4;
}

.input-wrap { position: relative; }

.field input[type="number"],
.field input[type="text"],
select.select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFF;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-variant-numeric: tabular-nums;
}
.field input:focus,
select.select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(239, 159, 39, 0.18);
}
.field input.has-prefix { padding-left: 64px; font-weight: 600; }
.field input.has-suffix { padding-right: 64px; font-weight: 600; }

/* Hide number-input spinners (cleaner look) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
input[type="number"] {
  -moz-appearance: textfield;
  appearance: textfield;
}

.affix {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-2);
  pointer-events: none;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.affix.prefix {
  left: 0;
  padding: 0 12px;
  height: calc(100% - 12px);
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--line);
  background: linear-gradient(to right, rgba(186, 117, 23, 0.05), transparent);
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}
.affix.suffix { right: 14px; }

/* Native select styling */
select.select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 40px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%237A8597' d='M6 8L0 0h12z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 10px;
  cursor: pointer;
  font-weight: 600;
}

/* Toggle row */
.field-toggle {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.field-toggle > div:first-child { flex: 1; min-width: 0; }
.field-toggle .field-hint { margin-top: 4px; }
.toggle-label {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
}

/* iOS-style switch */
.switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: #D6DAE2;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.18s ease;
}
.slider::before {
  content: "";
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  top: 3px;
  background: #FFF;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.18s ease;
}
.switch input:checked + .slider { background: var(--gold); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:focus-visible + .slider {
  box-shadow: 0 0 0 3px rgba(239, 159, 39, 0.32);
}

/* Results grid */
.results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 560px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 920px) {
  .results-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
  .results-grid { grid-template-columns: repeat(4, 1fr); }
}

.result-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 16px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 104px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.result-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: #DBD6CC;
}
.result-card.primary {
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(186, 117, 23, 0.14), transparent 65%),
    var(--gold-soft);
  border-color: rgba(186, 117, 23, 0.24);
  color: var(--ink);
  grid-column: 1 / -1;
  padding: 22px 24px 26px;
  min-height: 132px;
}
.result-card.primary:hover { border-color: rgba(186, 117, 23, 0.45); }
@media (min-width: 560px) {
  .result-card.primary { grid-column: span 2; }
}
@media (min-width: 1100px) {
  .result-card.primary { grid-column: span 2; }
}
.result-label {
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
  margin-bottom: 8px;
  text-transform: none;
  line-height: 1.3;
  min-height: 1.3em;
}
.result-card.primary .result-label {
  color: rgba(26, 35, 48, 0.7);
  font-size: 0.86rem;
}
.result-value {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.result-card.primary .result-value {
  font-size: clamp(1.75rem, 3.4vw, 2.1rem);
  font-weight: 700;
  color: var(--gold);
  letter-spacing: -0.025em;
}
.result-value.good { color: var(--good); }
.result-value.bad { color: var(--bad); }
.result-foot {
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Chart card */
.chart-card { margin-top: 20px; padding: 22px; }
.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.chart-card-head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 0.82rem;
  color: var(--ink-2);
}
.chart-legend .dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.chart-legend .dot.gold { background: var(--gold); }
.chart-legend .dot.grey { background: #99A2B2; }

.chart-wrap {
  position: relative;
  width: 100%;
  height: 260px;
}
@media (min-width: 720px) { .chart-wrap { height: 320px; } }

/* Chart action buttons row */
.chart-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
@media (max-width: 560px) {
  .chart-actions {
    flex-direction: column;
  }
  .chart-actions .btn {
    width: 100%;
  }
}

/* Year-by-year breakdown */
.yearly-breakdown {
  margin-top: 20px;
  padding: 18px 20px;
}
.yearly-breakdown h4 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.table-wrap {
  width: 100%;
  overflow-x: auto;
}
.year-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  font-variant-numeric: tabular-nums;
}
.year-table thead tr {
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.year-table th,
.year-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.year-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #F7F5F1;
}
.year-table td:nth-child(n+2),
.year-table th:nth-child(n+2) {
  text-align: right;
}
.year-table th { font-weight: 600; }
.year-table tbody tr:last-child td { border-bottom: none; }
.year-table tbody tr:nth-child(odd) { background: rgba(14, 25, 35, 0.02); }
.year-table tbody tr:hover { background: rgba(186, 117, 23, 0.05); }

/* Currency code input (shows when CUSTOM is selected) */
.currency-code {
  margin-left: 8px;
  width: 110px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.currency-code:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(239, 159, 39, 0.18);
}

/* ===========================================================
   Savings goals
   =========================================================== */
.goals-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}
@media (min-width: 920px) {
  .goals-layout { grid-template-columns: 340px 1fr; align-items: start; }
  .goal-form { position: sticky; top: 80px; }
}

.card-title {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}

.goal-form .field + .field { margin-top: 16px; }
.goal-form input[type="date"] {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #FFF;
  color: var(--ink);
  outline: none;
  font-family: inherit;
}
.goal-form input[type="date"]:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(239, 159, 39, 0.18);
}

.goal-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .goal-list { grid-template-columns: repeat(2, 1fr); }
}

.goal-card { padding: 18px 20px 20px; }
.goal-card-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
  margin-bottom: 14px;
}
.goal-name {
  margin: 0 0 4px;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
}
.goal-meta {
  font-size: 0.84rem;
  color: var(--muted);
}
.goal-delete {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  line-height: 1;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.goal-delete:hover { background: rgba(192, 57, 43, 0.1); color: var(--bad); }

.progress {
  width: 100%;
  height: 8px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 8px;
}
.progress-bar {
  height: 100%;
  background: var(--gold);
  border-radius: 999px;
  transition: width 0.4s ease;
}
.progress-bar.on-pace { background: var(--good); }
.progress-bar.off-pace { background: var(--bad); }

.goal-progress-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  margin-bottom: 14px;
}

.goal-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
  margin-bottom: 14px;
}
.goal-stats > div { display: flex; flex-direction: column; }
.goal-stat-label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 2px;
}
.goal-stat-value {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.goal-stat-value.on-pace, .goal-stat-value.good { color: var(--good); }
.goal-stat-value.off-pace, .goal-stat-value.bad { color: var(--bad); }

.goal-suggestion {
  background: rgba(186, 117, 23, 0.08);
  border: 1px solid rgba(186, 117, 23, 0.18);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 0.88rem;
  color: var(--ink-2);
  line-height: 1.4;
}
.goal-suggestion strong { color: var(--ink); }

.goals-empty {
  border: 1px dashed var(--line);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 24px;
  text-align: center;
  color: var(--ink-2);
  margin-top: 24px;
}
.goals-empty strong { display: block; margin-bottom: 6px; color: var(--ink); font-size: 1.05rem; }

/* ===========================================================
   About
   =========================================================== */
.about-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
@media (min-width: 980px) {
  .about-grid {
    grid-template-columns: 1.4fr 1fr;
    align-items: start;
  }
}

.about-profile {
  padding: 24px;
}
.about-profile-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 14px;
}
.about-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.28rem;
  font-weight: 700;
  color: #8A5A0E;
  background: linear-gradient(135deg, #FFE3B3, #FFD08C);
  border: 1px solid #F1C37A;
  flex-shrink: 0;
}
.about-name {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}
.about-title {
  margin: 4px 0 2px;
  color: var(--ink-2);
  font-size: 0.95rem;
}
.about-location {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}
.about-copy {
  margin: 0 0 10px;
  color: var(--ink-2);
  line-height: 1.62;
}
.about-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.about-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: rgba(186, 117, 23, 0.1);
  border: 1px solid rgba(186, 117, 23, 0.24);
  color: #8A5A0E;
  font-size: 0.8rem;
  font-weight: 600;
}
.about-actions {
  margin-top: 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.about-services {
  padding: 22px;
  background:
    radial-gradient(140% 90% at 100% 0%, rgba(14, 25, 35, 0.04), transparent 65%),
    var(--surface);
}
.about-services-title {
  margin: 0 0 10px;
  font-size: 1.02rem;
}
.about-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.about-list li {
  position: relative;
  padding-left: 18px;
  color: var(--ink-2);
  line-height: 1.5;
}
.about-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.58em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
}

@media (max-width: 560px) {
  .about-actions .btn,
  .cta-actions .btn {
    width: 100%;
  }
}

/* ===========================================================
   Scenarios
   =========================================================== */
.scn-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: 8px;
}
.scn-low, .dot.scn-low { background: #6B7280; }
.scn-mid, .dot.scn-mid { background: var(--gold); }
.scn-high, .dot.scn-high { background: var(--good); }

.scenario-rates {
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.scenario-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin-bottom: 18px;
}
@media (min-width: 720px) {
  .scenario-cards { grid-template-columns: repeat(3, 1fr); }
}
.scenario-card .result-label {
  display: flex;
  align-items: center;
}
.scenario-card.highlight {
  border-color: rgba(186, 117, 23, 0.4);
  background:
    radial-gradient(120% 100% at 0% 0%, rgba(186, 117, 23, 0.10), transparent 65%),
    var(--surface);
}
.scenario-card .result-value {
  font-size: 1.4rem;
  font-weight: 600;
}
.scenario-card.highlight .result-value { color: var(--gold); }
.scenario-card .result-foot { color: var(--ink-2); font-weight: 500; }
.scenario-card .result-foot span { color: var(--ink); font-weight: 600; }
.scenario-best-badge {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  background: rgba(186, 117, 23, 0.14);
  color: #8A5A0E;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
}

/* ===========================================================
   Loan calculator
   =========================================================== */
.segmented {
  display: flex;
  background: var(--page);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 4px;
  gap: 4px;
}
.segmented-option {
  flex: 1;
  position: relative;
  cursor: pointer;
}
.segmented-option input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}
.segmented-option span {
  display: block;
  text-align: center;
  padding: 9px 10px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--muted);
  border-radius: 7px;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.segmented-option input:checked + span {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ===========================================================
   Advisor tip card (shared)
   =========================================================== */
.advisor-tip {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: linear-gradient(135deg, rgba(186, 117, 23, 0.08), rgba(186, 117, 23, 0.02));
  border: 1px solid rgba(186, 117, 23, 0.2);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 18px 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.advisor-tip-icon {
  font-size: 1.3rem;
  line-height: 1;
  flex-shrink: 0;
}
.advisor-tip-body strong { color: var(--ink); font-weight: 600; }
.advisor-tip-body strong.good { color: var(--good); }
.advisor-tip-body strong.bad { color: var(--bad); }

/* ---------- Toast notifications ---------- */
.toast-host {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(420px, calc(100vw - 24px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: #15212E;
  color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 4px solid #7A8597;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.toast.is-success { border-left-color: var(--good); }
.toast.is-warn { border-left-color: var(--gold); }
.toast.is-error { border-left-color: var(--bad); }

@media (max-width: 560px) {
  .toast-host {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: none;
  }
}

/* ---------- Utilities ---------- */
.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;
}

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 6px;
}
