/* Pension lump sum vs monthly calculator: page layout on top of the shared /style.css.
   Kept in this folder so the shared stylesheet stays untouched. Same layout as the other
   calculators: graph and answer on the left, a short inputs panel on the right
   (stacked graph, inputs, stats on phones). Everything is scoped to body.pl. */

.pl .hero-head { display: block; padding-block: 26px 6px; }
.pl .hero-head h1 { font-size: var(--step-3); max-width: none; margin-top: 6px; }
.pl .workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 18px; }
.pl .stage { position: sticky; top: 12px; display: grid; min-width: 0; }
.pl .answer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; }
.pl .answer .label { flex-basis: 100%; }
.pl .answer .big { font-size: clamp(2.8rem, 2rem + 2.6vw, 4.2rem); }
.pl .answer .big.is-ahead { color: var(--slate); }
.pl .answer-line { padding-bottom: 6px; max-width: 46ch; }
.pl .landscape { padding-top: 14px; }
.pl .legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 10px; }
.pl .legend { pointer-events: none; }
.pl .legend span { display: inline-flex; align-items: center; gap: 7px; }


/* Stats under the graph */
.pl .stats { margin-top: 22px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .pl .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.pl .stat { align-content: start; }
.pl .stat .sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.pl .stat-gold .v { color: var(--gold); }
.pl .stat-rust .v { color: var(--rust); }

/* Inputs panel */
.pl .panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; display: grid; gap: 4px; min-width: 0; }
.pl .panel-head { display: grid; gap: 10px; padding-bottom: 12px; }
.pl .panel-head h2 { font-size: 1.45rem; }
.pl .panel-head .btn-row { flex-wrap: nowrap; }
.pl .panel-head .inline-field { flex: 1; min-width: 0; }
.pl .panel-head .inline-field select { width: 100%; }
.pl .simple { display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--ink); }
.pl .simple .col { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 12px; align-content: start; min-width: 0; }
.pl .simple .col + .col { border-top: 1px solid var(--line); }
.pl .simple .col:last-child { padding-bottom: 4px; }
.pl .simple legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.pl .simple legend + * { clear: both; }
.pl .row2 { gap: 10px; }
.pl .row3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pl .field-hint { font-size: 0.78rem; color: var(--muted); line-height: 1.4; }
.pl .pct input { padding-right: 28px; }
.pl .privacy { margin-top: 8px; }
.pl .errors { margin-top: 8px; }
.pl .errors:empty { display: none; }
.pl input[type="text"] { min-height: 42px; }

/* Graph extras */
.pl .chip-ink { border-color: var(--ink); border-top-width: 1.8px; }
.pl .chip-area { width: 12px; height: 10px; border: 0; border-radius: 2px; background: var(--gold-area); opacity: 0.35; }
.pl .chip-area.ink { background: var(--ink); opacity: 0.16; }
.chart-box .l-pay { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .a-pot { fill: var(--gold-area); fill-opacity: 0.16; }
.chart-box .a-extra { fill: var(--ink); fill-opacity: 0.07; }
.chart-box .a-label { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; }
.chart-box .a-label.g { fill: var(--gold); }
.chart-box .a-label.k { fill: var(--ink); opacity: 0.75; }
.chart-box .be-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-box .be-dot { fill: var(--paper); stroke: var(--gold); stroke-width: 2.4; }
.chart-box .be-v { font-size: 13px; font-weight: 700; fill: var(--ink); }
.chart-box .end-v { font-size: 13px; font-weight: 700; }
.chart-box .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart-box .start-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-box .ink-dot { fill: var(--ink); stroke: var(--paper); stroke-width: 2; }
.chart-box .t-ahead { font-weight: 600; }
.tip .t-ahead { white-space: nowrap; font-weight: 600; color: var(--ink); border-top: 1px solid var(--line); padding-top: 4px; margin-top: 2px; }
.tip .t-ahead.g { color: var(--gold); }

/* Second graph: break-even age at each return */
.pl .by-return { padding-top: 64px; display: grid; gap: 14px; }
.pl .by-msg { font-size: 1.05rem; max-width: 70ch; }
.pl .by-msg b { font-weight: 700; }
.pl .by-msg .g { color: var(--gold); }
.pl .by-box { border-top: 1px solid var(--ink); padding-top: 8px; }
.chart-box .l-ret { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.chart-box .l-ret-off { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 2 4; opacity: 0.7; }
.chart-box .a-ret { fill: var(--gold-area); fill-opacity: 0.12; }
.chart-box .you-line { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 4 4; }
.chart-box .off-l { fill: var(--muted); font-size: 11.5px; }

/* Year by year */
.pl #by-age { padding-top: 56px; }
.pl #by-age h2 { margin-bottom: 14px; }
.pl .yt-scroll { overflow-x: auto; }
.pl .yt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.95rem; border-top: 1px solid var(--ink); }
.pl .yt th, .pl .yt td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.pl .yt th:first-child { text-align: left; }
.pl .yt th:last-child, .pl .yt td:last-child { padding-right: 0; }
.pl .yt thead th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.pl .yt tbody th { font-weight: 600; }
.pl .yt td.k { color: var(--ink); font-weight: 600; }
.pl .yt td.ok { color: var(--gold); font-weight: 600; }
.pl .yt tr.is-be { background: var(--surface-2); }
.pl .yt-note { margin-top: 10px; }

/* Reading: one content width, heading left and text right on wide screens */
.pl .prose, .pl .disclaimer { max-width: none; }
@media (min-width: 900px) {
  .pl .section.prose { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 48px; row-gap: 0; align-items: start; }
  .pl .section.prose > h2 { grid-column: 1; grid-row: 1 / span 30; }
  .pl .section.prose > :not(h2) { grid-column: 2; margin-bottom: 16px; }
}
.pl .sources { font-size: var(--step--1); color: var(--muted); }

@media (max-width: 1200px) and (min-width: 961px) { .pl .workspace { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; } }
@media (max-width: 960px) {
  .pl .workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .pl .stage { display: contents; }
  .pl .stage .answer { order: 1; }
  .pl .stage .landscape { order: 2; }
  .pl .panel { order: 3; margin-top: 20px; }
  .pl .stage .stats { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 600px) {
  .pl .simple { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .pl .simple .col:nth-child(2) { border-top: 0; border-left: 1px solid var(--line); padding-left: 18px; grid-row: span 2; }
  .pl .simple .col:nth-child(1), .pl .simple .col:nth-child(3) { padding-right: 18px; }
}
@media (max-width: 600px) {
  .pl .hero-head { padding-block: 18px 0; }
  .pl .hero-head h1 { font-size: 1.6rem; }
  .pl .hero-head .eyebrow { display: none; }
  .pl .answer .big { font-size: 2.9rem; }
  .pl .answer-line { font-size: 0.85rem; flex-basis: 100%; padding-bottom: 0; }
  .pl .landscape { padding-top: 6px; }
  .pl .panel { padding: 14px 14px 16px; margin-inline: -4px; }
  .pl .legend-row { gap: 6px 14px; padding-top: 6px; }
  .pl .legend { gap: 2px 14px; font-size: 0.8rem; }
  .pl .panel { margin-top: 14px; }
  .pl .yt { font-size: 0.84rem; }
  .pl .yt th, .pl .yt td { padding-right: 8px; }
  .pl .yt .wide { display: none; }
}

/* While a number is invalid, keep the last result but fade it. */
.pl .is-stale .landscape, .pl .is-stale .stats { opacity: 0.35; transition: opacity 0.15s; }


.pl .tip .t-row span { white-space: nowrap; }

/* The answer needs its label ("come out ahead if you live past") to make sense, so keep it on phones too. */
.pl .answer .label { display: block; }
