body.page-retirement-math .wrap { max-width: 920px; }

.page-head { padding: 2.5rem 0 1.2rem; }
.hl { background: var(--c-gold); }

.dollars-note {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 1.2rem;
}

.win { margin-bottom: 1.6rem; }
.win-body { padding: 1.3rem 1.4rem 1.4rem; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.stat {
  background: var(--win);
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--shadow);
  padding: 0.9rem 1rem;
}

.stat .k {
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.stat .v {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.stat .v.good { color: var(--c-green); }
.stat .v.bad { color: var(--c-red); }

.stat .sub {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 3px;
}

.section-note {
  font-size: 0.88rem;
  color: var(--text-mid);
  margin-bottom: 1rem;
  line-height: 1.6;
}

.fine-print {
  font-size: 0.8rem;
  color: var(--text-dim);
  margin-top: 1rem;
  line-height: 1.6;
}

.fine-print a {
  color: var(--c-blue);
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem 1.2rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.field-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.field-hint {
  font-family: var(--mono);
  font-size: 0.64rem;
  color: var(--text-dim);
  line-height: 1.4;
}

.field-hint a {
  color: var(--c-blue);
  font-weight: 600;
}

.money-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  padding: 0.5rem 0.8rem;
}

.money-wrap:focus-within { border-color: var(--c-green); }

.money-wrap .prefix {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-mid);
}

.money-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-hi);
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  outline: none;
  width: 100%;
}

.money-input--sm { font-size: 1rem; }

.money-input::-webkit-outer-spin-button,
.money-input::-webkit-inner-spin-button,
.pct-input::-webkit-outer-spin-button,
.pct-input::-webkit-inner-spin-button,
.num-input::-webkit-outer-spin-button,
.num-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.money-input,
.pct-input,
.num-input {
  -moz-appearance: textfield;
}

.cadence {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
}

.pct-wrap {
  display: flex;
  align-items: center;
  gap: 2px;
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  padding: 0.55rem 0.75rem;
}

.pct-wrap:focus-within { border-color: var(--c-green); }

.pct-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  outline: none;
  width: 100%;
}

.pct-wrap .ps {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--text-dim);
}

.num-input {
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  color: var(--text-hi);
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 700;
  padding: 0.55rem 0.75rem;
  outline: none;
  width: 100%;
}

.num-input:focus { border-color: var(--c-green); }

.range-input {
  width: 100%;
  accent-color: var(--c-gold);
  margin: 0.4rem 0 0.2rem;
}

.range-ticks {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: var(--text-dim);
}

.withdraw-controls { margin-bottom: 1rem; }
.field--slider { max-width: 420px; }
.range-input--blue { accent-color: var(--c-blue); }
.range-input--orange { accent-color: var(--c-orange); }

.tax-row .sub {
  display: block;
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--text-dim);
  margin-top: 2px;
}

.tax-row.dim .amt {
  color: var(--text-dim);
  font-weight: 600;
}

.timeline-wrap {
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-top: 1rem;
}

.timeline-chart {
  position: relative;
  min-width: 720px;
  height: 240px;
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  overflow: hidden;
}

.timeline-svg {
  display: block;
  width: 100%;
  height: 100%;
}

.tl-phase--accum { fill: color-mix(in srgb, var(--c-green) 10%, transparent); }
.tl-phase--decum { fill: color-mix(in srgb, var(--c-blue) 10%, transparent); }

.tl-retire-line {
  stroke: var(--c-gold);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.tl-retire-label {
  font-family: var(--mono);
  font-size: 8px;
  fill: var(--c-gold);
  font-weight: 700;
}

.tl-balance {
  fill: none;
  stroke: var(--c-blue);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tl-point {
  fill: var(--win);
  stroke: var(--c-blue);
  stroke-width: 2;
}

.tl-point--end {
  fill: var(--c-blue);
  stroke: var(--ink);
}

.tl-y,
.tl-x {
  font-family: var(--mono);
  fill: var(--text-dim);
}

.tl-y { font-size: 9px; }
.tl-x { font-size: 8px; text-anchor: middle; }

.timeline-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
  margin-top: 0.75rem;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-dim);
}

.tl-leg {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tl-swatch {
  width: 14px;
  height: 8px;
  border-radius: 2px;
  border: 1.5px solid var(--ink);
}

.tl-swatch.accum { background: color-mix(in srgb, var(--c-green) 35%, var(--win)); }
.tl-swatch.decum { background: color-mix(in srgb, var(--c-blue) 35%, var(--win)); }
.tl-swatch.balance { background: var(--c-blue); height: 4px; }

.rule-stats { display: grid; gap: 0.65rem; }

.rule-stat {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0.75rem;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--win-2);
}

.rule-stat .label {
  font-size: 0.86rem;
  color: var(--text-mid);
}

.rule-stat .value {
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
}

.ss-person {
  border: 2px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  margin-bottom: 1rem;
  overflow: hidden;
}

.ss-person-head {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
  padding: 0.5rem 0.9rem;
  border-bottom: 2px solid var(--ink);
  background: var(--win);
  color: var(--text-dim);
}

.ss-person-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 0.9rem;
}

.ss-timeline {
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  overflow: hidden;
  margin-top: 1rem;
}

.ss-event {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 0.55rem 0.9rem;
  border-bottom: 2px solid var(--ink);
  font-size: 0.86rem;
}

.ss-event:last-child { border-bottom: none; }

.ss-event-age {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
}

.ss-event-desc { color: var(--text-mid); }

.ss-event-total {
  font-family: var(--mono);
  font-weight: 700;
  text-align: right;
  font-size: 0.82rem;
}

.tax-sliders {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.tax-tables {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.tax-table-block .sec-label { margin-bottom: 0.5rem; }

.ss-result,
.tax-breakdown {
  border: 2.5px solid var(--ink);
  border-radius: 9px;
  background: var(--win-2);
  overflow: hidden;
}

.result-row,
.tax-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  padding: 0.6rem 0.9rem;
  border-bottom: 2px solid var(--ink);
  font-size: 0.9rem;
}

.result-row:last-child,
.tax-row:last-child { border-bottom: none; }

.result-row .nm,
.tax-row .nm { font-weight: 600; }

.result-row .amt,
.tax-row .amt {
  font-family: var(--mono);
  font-weight: 700;
  text-align: right;
}

.result-row.total,
.tax-row.total {
  background: var(--win);
  font-weight: 800;
}

body.page-retirement-math .footbar { margin-top: 1.4rem; }

@media (max-width: 760px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .field-grid { grid-template-columns: repeat(2, 1fr); }
  .ss-person-grid,
  .tax-tables { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .summary-grid,
  .field-grid { grid-template-columns: 1fr; }
  .ss-event { grid-template-columns: 1fr; }
  .ss-event-total { text-align: left; }
}