/* =========================================================
   Financial Goals · Montserrat stylesheet
   (inherits tokens from style.css)
   ========================================================= */

.fg-body { padding-bottom: 3rem; }
.fg-main { padding-top: 5.5rem; }

/* ---------- Header ---------- */
.fg-head { padding-bottom: 1rem; }

.fg-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.35rem 0.85rem;
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 1.25rem;
}
.fg-kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--verdigris);
  animation: fg-pulse 2s ease-in-out infinite;
}
@keyframes fg-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.fg-title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  line-height: 0.95;
  letter-spacing: -0.035em;
  font-weight: 200;
  margin-bottom: 1rem;
}
.fg-title-line { display: block; }
.fg-title-accent {
  color: var(--verdigris);
  font-weight: 300;
  margin-left: 1rem;
}
.fg-title-period { color: var(--ink); font-weight: 500; }

.fg-intro {
  font-size: clamp(0.95rem, 1.3vw, 1.1rem);
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 44rem;
  margin-top: 0.75rem;
  font-weight: 300;
}

/* =========================================================
   FORM
   ========================================================= */
.fg-form-wrap { padding: 1rem 0 3rem; }
.fg-form {
  background: var(--paper);
  padding: 2rem 2.25rem;
  border: 0.5px solid var(--hairline);
  position: relative;
}
.fg-form::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}

.fg-form-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2rem 0 1.5rem;
  position: relative;
  z-index: 1;
}
.fg-form > .fg-form-head:first-child { margin-top: 0; }

/* --------- Goal picker (checkbox cards) --------- */
.goal-picker {
  display: grid;
  /* Fixed-count columns so every card is exactly the same width.
     Breakpoints below drop the column count on smaller screens. */
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 1fr;             /* ALL rows share the tallest row's height */
  gap: 0.75rem;
  position: relative;
  z-index: 1;
}
.goal-card {
  display: block;
  cursor: pointer;
  height: 100%;                     /* fill the equalized grid cell */
}
.goal-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.goal-card-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.95rem 1rem;
  min-height: 72px;                 /* floor height for consistency on wide screens */
  height: 100%;                     /* fill the full card */
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 2px;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  box-sizing: border-box;
}
.goal-card-inner:hover {
  border-color: var(--verdigris-soft);
  background: #FBF8ED;
}
.goal-card input:checked + .goal-card-inner {
  border-color: var(--verdigris);
  background: #ECF2F0;
  box-shadow: 0 0 0 1px var(--verdigris) inset;
}

.goal-card-tick {
  width: 18px;
  height: 18px;
  border: 1.2px solid var(--hairline);
  border-radius: 2px;
  flex-shrink: 0;
  background: var(--paper);
  position: relative;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.goal-card input:checked + .goal-card-inner .goal-card-tick {
  background: var(--verdigris);
  border-color: var(--verdigris);
}
.goal-card input:checked + .goal-card-inner .goal-card-tick::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 6px;
  width: 5px;
  height: 10px;
  border: solid var(--paper);
  border-width: 0 1.8px 1.8px 0;
  transform: rotate(45deg);
}

.goal-card-name {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
  line-height: 1.3;
}
.goal-card-note {
  font-size: 11px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  margin-left: auto;
}

/* --------- Goal details list (dynamic) --------- */
.goal-details-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  position: relative;
  z-index: 1;
}
.goal-detail-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1.5fr;
  gap: 1rem;
  align-items: end;
  padding: 1rem 1.25rem;
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-left: 3px solid var(--verdigris);
}
.goal-detail-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding-bottom: 0.5rem;
  letter-spacing: -0.005em;
}
.goal-detail-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.goal-detail-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.goal-detail-input-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--ink);
}
.goal-detail-input-wrap input {
  flex: 1;
  min-width: 0;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
}
.goal-detail-input-wrap input::-webkit-inner-spin-button,
.goal-detail-input-wrap input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.goal-detail-input-wrap input[type="number"] { -moz-appearance: textfield; }
.goal-detail-suffix,
.goal-detail-prefix {
  font-size: 0.95rem;
  color: var(--ink-muted);
  font-weight: 400;
}

/* --------- Retirement row (special) --------- */
.goal-detail-row.retirement-row {
  grid-template-columns: 1fr;           /* stack: name → grid of inputs → derived */
  gap: 1.25rem;
  padding: 1.5rem 1.5rem;
  background: #FBF8ED;
  border-left-color: #B5A567;           /* gold rail distinguishes retirement */
}
.goal-detail-row.retirement-row .goal-detail-name {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0;
  font-size: 16px;
}
.retirement-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ret-assumption-tag {
  display: inline-block;
  margin-left: 0.4rem;
  padding: 0.08rem 0.4rem;
  background: #F0E6C8;
  color: #8B7A3F;
  border-radius: 2px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  vertical-align: middle;
}
.retirement-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem 1.5rem;
}
.retirement-derived {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--hairline);
}
.retirement-derived-placeholder {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 0.25rem 0;
}
.retirement-derived-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem 1rem;
}
.rd-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.3rem 0.6rem;
  border-left: 2px solid var(--hairline);
}
.rd-stat.rd-stat-primary {
  border-left-color: var(--verdigris);
  background: #ECF2F0;
  padding: 0.5rem 0.6rem;
}
.rd-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.rd-value {
  font-size: 1.15rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.rd-stat.rd-stat-primary .rd-value {
  color: var(--verdigris);
  font-weight: 500;
}
.rd-sub {
  font-size: 10.5px;
  color: var(--ink-muted);
  font-weight: 400;
}

/* --------- Child's Higher Education row (investment modes) --------- */
.goal-detail-row.education-row {
  grid-template-columns: 2fr 1fr 1.5fr;
  grid-template-rows: auto auto;
  gap: 1rem 1rem;
  background: #FBF8ED;
  border-left-color: #B5A567;         /* same gold rail as Retirement */
  padding: 1.25rem 1.25rem;
}
.goal-detail-row.education-row .goal-detail-name {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding-bottom: 0;
}
.education-sub {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.education-derived {
  grid-column: 1 / -1;                /* span all three columns */
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 0.5px solid var(--hairline);
}
.education-derived-placeholder {
  display: block;
  font-size: 12.5px;
  color: var(--ink-muted);
  font-style: italic;
  padding: 0.25rem 0;
}
.education-derived-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 0.5px dashed var(--hairline);
}
.ed-head-label {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ed-head-value {
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.ed-head-sub {
  font-size: 11.5px;
  color: var(--ink-muted);
  font-weight: 400;
}
.education-derived-grid {
  display: grid;
  /* 3 mode cards with an "Or" badge between each pair */
  grid-template-columns: 1fr auto 1fr auto 1fr;
  gap: 0.5rem 0.4rem;
  align-items: stretch;
}
.ed-or-separator {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  min-width: 44px;
}
/* Subtle hairline connector above & below the circle so it feels linked */
.ed-or-separator::before,
.ed-or-separator::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 0.5px;
  background: var(--hairline);
  z-index: 0;
}
.ed-or-separator::before { top: 0;  height: calc(50% - 20px); }
.ed-or-separator::after  { bottom: 0; height: calc(50% - 20px); }
.ed-or-separator span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--paper);
  border: 0.6px solid var(--verdigris);
  color: var(--verdigris);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  z-index: 1;
  line-height: 1;
}
.ed-stat {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.6rem 0.75rem;
  border-left: 2px solid var(--hairline);
}
.ed-stat.ed-stat-mode {
  border-left-color: var(--verdigris);
  background: #FFFFFFCC;
}
.ed-stat.ed-stat-primary {
  background: #ECF2F0;
  border-left-color: var(--verdigris);
}
.ed-label {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.ed-value {
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
}
.ed-stat.ed-stat-primary .ed-value {
  color: var(--verdigris);
  font-weight: 500;
}
.ed-sub {
  font-size: 10.5px;
  color: var(--ink-muted);
  font-weight: 400;
}
.education-derived-note {
  margin: 0.75rem 0 0;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 400;
}
.education-derived-note em {
  color: var(--verdigris);
  font-style: normal;
  font-weight: 500;
}

@media (max-width: 1024px) {
  .goal-detail-row.education-row { grid-template-columns: 1fr 1fr; }
  /* Keep 3-column mode layout at tablet width — cards get smaller rather than reflow */
  .education-derived-grid { gap: 0.4rem 0.25rem; }
  .ed-or-separator { min-width: 36px; }
  .ed-or-separator span { width: 32px; height: 32px; font-size: 9px; }
}
@media (max-width: 760px) {
  .education-derived-grid {
    grid-template-columns: 1fr;        /* stack vertically */
  }
  .ed-or-separator {
    padding: 0.35rem 0;
    min-width: 0;
  }
  /* Horizontal connectors instead of vertical when stacked */
  .ed-or-separator::before,
  .ed-or-separator::after {
    left: 0; top: 50%;
    width: calc(50% - 24px);
    height: 0.5px;
  }
  .ed-or-separator::before { right: auto; }
  .ed-or-separator::after  { left: auto; right: 0; }
}
@media (max-width: 640px) {
  .goal-detail-row.education-row { grid-template-columns: 1fr; }
}

/* Name cell annotation on the Goals Timeline table */
.cell-name-main { display: block; }
.cell-name-note {
  display: block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-style: normal;
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .retirement-grid { grid-template-columns: repeat(2, 1fr); }
  .retirement-derived-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .retirement-grid { grid-template-columns: 1fr; }
  .retirement-derived-grid { grid-template-columns: 1fr; }
}

/* --------- Financial inputs grid --------- */
/* 2 × 2 layout — labels and input lines align in two neat columns */
.fg-field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem 2.5rem;
  position: relative;
  z-index: 1;
}

/* =========================================================
   REPORT
   ========================================================= */
.fg-report { padding: 2rem 0 3rem; }

.fg-report-head {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 0.5px solid var(--hairline);
}
.fg-report-kicker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--verdigris);
  margin-bottom: 0.75rem;
}
.fg-report-title {
  font-size: clamp(1.75rem, 3.2vw, 2.5rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 0.65rem;
}
.fg-report-sub {
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.5;
  max-width: 42rem;
}

/* Summary */
.fg-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-left: 0.5px solid var(--hairline);
  margin-bottom: 3rem;
}
.fg-summary-grid .summary-stat {
  padding: 1.5rem 1.25rem;
  border-right: 0.5px solid var(--hairline);
  border-top: 0.5px solid var(--hairline);
  border-bottom: 0.5px solid var(--hairline);
  display: flex;
  flex-direction: column;
}
.summary-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-bottom: 0.75rem;
}
.summary-value {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  font-weight: 300;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}
.summary-value.is-positive { color: var(--verdigris); }
.summary-value.is-negative { color: #A14744; }
.summary-sub {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-soft);
  line-height: 1.5;
}

/* Report section head */
.fg-section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2.5rem 0 1.25rem;
}

/* Goals table */
.fg-table-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem 2.5rem;
  padding: 0 0.5rem 1rem;
}
.fg-table {
  width: 100%;
  min-width: 740px;
  border-collapse: collapse;
  font-size: 14px;
}
.fg-table thead th {
  text-align: left;
  padding: 1rem 1rem 0.75rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.fg-table thead th.th-today,
.fg-table thead th.th-future,
.fg-table thead th.th-port,
.fg-table thead th.th-diff { text-align: right; }
.fg-table tbody tr {
  border-bottom: 0.5px solid var(--hairline-soft);
  transition: background 0.15s ease;
}
.fg-table tbody tr:hover { background: var(--paper-deep); }
.fg-table tbody tr:nth-child(even) { background: #FBF8ED; }
.fg-table tbody tr:nth-child(even):hover { background: var(--paper-deep); }
.fg-table tbody td {
  padding: 0.95rem 1rem;
  vertical-align: baseline;
  color: var(--ink);
}
.fg-table .cell-name {
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.fg-table .cell-year {
  font-size: 13px;
  color: var(--ink);
  font-weight: 500;
}
.fg-table .cell-year em {
  display: block;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin-top: 2px;
}
.fg-table .cell-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fg-table .cell-diff {
  text-align: right;
  font-weight: 600;
  white-space: nowrap;
}
.fg-table .cell-diff.is-surplus { color: var(--verdigris); }
.fg-table .cell-diff.is-shortfall { color: #A14744; }
.fg-table .cell-diff .status-pill {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.15rem 0.5rem;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  border-radius: 2px;
}
.fg-table .cell-diff.is-surplus .status-pill {
  background: #DBEBE5;
  color: var(--verdigris);
}
.fg-table .cell-diff.is-shortfall .status-pill {
  background: #F7E3E2;
  color: #A14744;
}

/* =========================================================
   SIP RECOMMENDATION BLOCK
   ========================================================= */
.sip-advice {
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  border-left: 3px solid #A14744;      /* red accent for shortfall */
  padding: 2rem 2.25rem;
  margin: 0 0 2.5rem;
  position: relative;
}
.sip-advice::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}
.sip-advice-head {
  position: relative;
  z-index: 1;
  margin-bottom: 1.25rem;
}
.sip-advice-kicker {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: #A14744;
  margin-bottom: 0.65rem;
}
.sip-advice-title {
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.015em;
  line-height: 1.3;
}

.sip-advice-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr 1fr;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
  margin-bottom: 1.25rem;
  border-top: 0.5px solid var(--hairline);
  border-bottom: 0.5px solid var(--hairline);
  position: relative;
  z-index: 1;
}
.sip-advice-stat {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.sip-advice-stat.is-delta {
  padding-left: 1.5rem;
  border-left: 0.5px solid var(--hairline);
}
.sip-advice-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
}
.sip-advice-value {
  font-size: clamp(1.35rem, 2.1vw, 1.75rem);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1;
}
.sip-advice-value.is-current { color: var(--ink-soft); }
.sip-advice-value.is-target { color: var(--verdigris); font-weight: 400; }
.sip-advice-value.is-gap { color: #A14744; font-weight: 500; }
.sip-advice-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-muted);
  letter-spacing: 0.04em;
  margin-top: 0.1rem;
}
.sip-advice-arrow {
  font-size: 1.5rem;
  color: var(--ink-muted);
  font-weight: 300;
  text-align: center;
  padding: 0 0.5rem;
}

.sip-advice-copy {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
  font-weight: 400;
  position: relative;
  z-index: 1;
  max-width: 48rem;
}
.sip-advice-copy strong {
  color: var(--ink);
  font-weight: 600;
}
.sip-advice-copy em {
  color: var(--verdigris);
  font-style: normal;
  font-weight: 500;
}

.sip-advice-cta {
  margin-top: 0.9rem;
  font-size: 13px;
  color: var(--ink-muted);
  position: relative;
  z-index: 1;
}
.sip-advice-cta em {
  color: var(--verdigris);
  font-style: normal;
  font-weight: 600;
}

.sip-advice.is-ceiling { border-left-color: #A14744; }

@media (max-width: 820px) {
  .sip-advice { padding: 1.75rem 1.5rem; }
  .sip-advice-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }
  .sip-advice-arrow { display: none; }
  .sip-advice-stat.is-delta {
    padding-left: 0;
    padding-top: 1.25rem;
    border-left: 0;
    border-top: 0.5px solid var(--hairline);
  }
}

/* =========================================================
   PORTFOLIO STATEMENT — year-by-year bank-statement view
   ========================================================= */
.fg-statement-table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
  font-size: 13px;
}
.fg-statement-table thead th {
  text-align: left;
  padding: 1rem 0.75rem 0.75rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
}
.fg-statement-table thead th.th-money { text-align: right; }
.fg-statement-table thead th.th-yr { width: 44px; }
.fg-statement-table thead th.th-period { width: 68px; }

.fg-statement-table tbody tr {
  border-bottom: 0.5px solid var(--hairline-soft);
  transition: background 0.15s ease;
}
.fg-statement-table tbody tr:nth-child(even) { background: #FBF8ED; }
.fg-statement-table tbody tr:hover { background: var(--paper-deep); }
.fg-statement-table tbody tr.is-goal-year {
  background: #F3EBD2;
  border-left: 3px solid var(--verdigris);
}
.fg-statement-table tbody tr.is-goal-year:hover { background: #EDE4C5; }

.fg-statement-table tbody td {
  padding: 0.72rem 0.75rem;
  vertical-align: top;
}
.fg-statement-table .cell-money {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fg-statement-table .statement-year-num {
  font-weight: 700;
  color: var(--verdigris);
  font-size: 13.5px;
  letter-spacing: -0.01em;
}
.fg-statement-table .statement-period {
  color: var(--ink-muted);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  padding-top: 0.85rem;
}
.fg-statement-table .statement-opening {
  color: var(--ink-soft);
}
.fg-statement-table .statement-inflow {
  color: var(--verdigris);
  font-weight: 500;
}
.fg-statement-table .statement-outflow {
  color: #A14744;
  font-weight: 600;
  display: block;
}
.fg-statement-table .statement-goal-tag {
  display: block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #A14744;
  font-style: normal;
  text-align: right;
  line-height: 1.3;
}
.fg-statement-table .statement-nil {
  color: var(--ink-muted);
  opacity: 0.5;
}
.fg-statement-table .statement-closing {
  color: var(--ink);
  font-weight: 600;
}
.fg-statement-table tbody tr.is-goal-year .statement-closing {
  color: var(--verdigris);
}

/* Totals footer */
.fg-statement-table tfoot .statement-totals td {
  padding: 1rem 0.75rem;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  border-top: 1.5px solid var(--ink);
  background: var(--paper-deep);
}
.fg-statement-table tfoot .statement-totals td:first-child {
  text-align: right;
  letter-spacing: 0.14em;
  font-size: 10.5px;
  text-transform: uppercase;
  color: var(--ink-muted);
  font-weight: 700;
}
.statement-legend {
  margin: 0.75rem 0 2.5rem;
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 400;
  max-width: 48rem;
  line-height: 1.5;
}
.statement-legend em {
  color: var(--verdigris);
  font-style: normal;
  font-weight: 500;
}

/* Chart */
.fg-chart-wrap {
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  padding: 1.5rem 1.25rem;
  margin-bottom: 2.5rem;
  position: relative;
  min-height: 360px;
}
#projectionChart { max-height: 420px; }

/* Methodology */
.fg-methodology {
  background: var(--paper);
  border: 0.5px solid var(--hairline);
  padding: 2.25rem 2rem;
  margin-bottom: 2rem;
  position: relative;
}
.fg-methodology::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid var(--hairline-soft);
  pointer-events: none;
}
.fg-methodology .method-title {
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 1.25rem;
  position: relative;
  z-index: 1;
}
.fg-methodology .method-title em { color: var(--verdigris); font-style: normal; font-weight: 500; }
.fg-methodology ul {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-left: 0;
  list-style: none;
}
.fg-methodology li {
  padding-left: 1.5rem;
  position: relative;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.fg-methodology li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 8px;
  height: 1px;
  background: var(--verdigris);
}

/* =========================================================
   SHARED FORM / FIELD / PDF-STRIP primitives
   (same visual language as planner.css; duplicated here so
    financialgoals.html doesn't need to import planner.css)
   ========================================================= */
.form-num {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 200;
  color: var(--verdigris);
  line-height: 1;
  letter-spacing: -0.03em;
}
.form-title {
  font-size: clamp(1.4rem, 2.4vw, 2rem);
  font-weight: 300;
  color: var(--ink);
  letter-spacing: -0.025em;
  line-height: 1;
}
.form-sub {
  font-size: clamp(0.85rem, 1.1vw, 0.95rem);
  font-weight: 400;
  color: var(--ink-muted);
  flex-basis: 100%;
  margin-top: 0.2rem;
}

/* Field */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  cursor: text;
}
.field-label {
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.field-letter {
  color: var(--verdigris);
  font-weight: 500;
  font-size: 11.5px;
  letter-spacing: 0;
}
.field-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: 1px solid var(--ink);
  padding: 0.45rem 0;
  transition: border-color 0.2s ease;
}
.field:focus-within .field-input-wrap {
  border-bottom-color: var(--verdigris);
  border-bottom-width: 1.5px;
}
.field-prefix, .field-suffix {
  font-size: 1.3rem;
  font-weight: 300;
  color: var(--ink-muted);
  line-height: 1;
}
.field-input-wrap input {
  flex: 1;
  background: transparent;
  border: 0;
  outline: 0;
  font-family: var(--sans);
  font-size: 1.4rem;
  color: var(--ink);
  font-weight: 400;
  padding: 0;
  letter-spacing: -0.015em;
  min-width: 0;
}
.field-input-wrap input::placeholder { color: var(--ink-muted); opacity: 0.4; }
.field-input-wrap input[type="number"]::-webkit-inner-spin-button,
.field-input-wrap input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.field-input-wrap input[type="number"] { -moz-appearance: textfield; }
.field-hint {
  font-size: 12.5px;
  font-weight: 400;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* Form actions */
.form-actions {
  margin-top: 3rem;
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.form-error {
  margin-top: 1.5rem;
  padding: 0.85rem 1.25rem;
  background: #FBEAEA;
  border-left: 2px solid #A32D2D;
  color: #501313;
  font-size: 13.5px;
  font-weight: 500;
}

/* PDF strip */
.pdf-strip {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: center;
  padding: 2.5rem 2.5rem;
  margin: 0 0 2.5rem;
  background: var(--ink);
  color: var(--paper);
  position: relative;
  overflow: hidden;
}
.pdf-strip::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 0.5px solid rgba(245, 241, 230, 0.14);
  pointer-events: none;
}
.pdf-strip::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 240px;
  height: 100%;
  background: radial-gradient(circle at 70% 50%, rgba(52, 90, 82, 0.4) 0%, transparent 70%);
  pointer-events: none;
}
.pdf-strip-text { position: relative; z-index: 1; }
.pdf-strip-kicker {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #B5A567;
  margin-bottom: 0.75rem;
}
.pdf-strip-title {
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 300;
  color: var(--paper);
  margin-bottom: 0.75rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.pdf-strip-title .accent-medium {
  color: #B5A567;
  font-weight: 500;
  display: block;
}
.pdf-strip-sub {
  font-size: 13.5px;
  font-weight: 400;
  color: rgba(245, 241, 230, 0.65);
  line-height: 1.55;
  max-width: 38rem;
}
.pdf-btn {
  position: relative;
  z-index: 1;
  background: #B5A567;
  color: var(--ink);
  border-color: #B5A567;
  flex-shrink: 0;
  cursor: pointer;
}
.pdf-btn::before { content: none !important; }
.pdf-btn:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}
.pdf-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}
.pdf-btn-icon {
  font-size: 1.1em;
  margin-right: 0.1em;
}

/* Results CTA */
.results-cta {
  text-align: center;
  padding: 3rem 2rem;
  border-top: 0.5px solid var(--hairline);
  border-bottom: 0.5px solid var(--hairline);
  margin-bottom: 2.5rem;
}
.results-cta-text {
  font-size: 1.2rem;
  font-weight: 300;
  color: var(--ink);
  margin-bottom: 1.5rem;
  max-width: 32rem;
  margin-inline: auto;
  line-height: 1.45;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1180px) {
  .goal-picker { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  /* .fg-field-grid stays 2x2 */
  .fg-summary-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
  .goal-picker { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .fg-main { padding-top: 6rem; }
  .fg-form { padding: 2rem 1.25rem; }
  .fg-field-grid { grid-template-columns: 1fr; gap: 1.75rem; }
  .goal-picker { grid-template-columns: 1fr; }
  .goal-detail-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem 1rem;
  }
  .goal-detail-name { padding-bottom: 0.25rem; }
  .fg-summary-grid { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: stretch; }
  .form-actions .btn { justify-content: center; }
  .fg-chart-wrap { padding: 1rem 0.5rem; min-height: 320px; }
  .pdf-strip {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 2rem 1.5rem;
  }
  .pdf-btn { justify-self: start; }
}
