/* Page layout on top of the shared /style.css (same layout as the
   savings goal calculator: graph and answer on the left, inputs on the right). Scoped to body.inf. */

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


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

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

/* Mode switch */
.inf .inf-seg { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 42px; }
.inf .inf-seg button { border: 0; background: var(--paper); color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; padding: 0 6px; }
.inf .inf-seg button + button { border-left: 1px solid var(--line); }
.inf .inf-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.inf .mode-date { display: grid; gap: 6px; }
.inf .mode-date[hidden], .inf .mode-monthly[hidden] { display: none; }

/* Main graph: stacked parts up to the goal */
.inf .sq-start { background: var(--slate); opacity: 0.45; }
.inf .sq-dep { background: var(--muted); opacity: 0.32; }
.inf .sq-int { background: var(--gold-area); opacity: 0.85; }
.inf .chip-goal { border-color: var(--ink); border-top-width: 1.5px; border-top-style: dashed; }
.inf .chip-cmp0 { border-color: var(--muted); border-top-width: 1.5px; border-top-style: dashed; }
.chart-box .a-start { fill: var(--slate); fill-opacity: 0.32; }
.chart-box .a-dep { fill: var(--muted); fill-opacity: 0.2; }
.chart-box .a-int { fill: var(--gold-area); fill-opacity: 0.7; }
.chart-box .goal-line { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 5 4; }
.chart-box .goal-l { font-size: 12px; font-weight: 700; fill: var(--ink); }
.chart-box .goal-s { font-size: 12px; fill: var(--muted); }
.chart-box .reach-line { stroke: var(--gold); stroke-width: 1; stroke-dasharray: 2 3; }
.chart-box .reach-v { font-size: 13px; font-weight: 700; fill: var(--gold); }
.chart-box .halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.chart-box .part-l { font-size: 11.5px; font-weight: 600; fill: var(--ink); }
.chart-box .part-l.g { fill: var(--gold); }
.chart-box .start-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-box .empty-msg { font-family: var(--font-display); font-style: normal; font-size: 15px; fill: var(--muted); }
.chart-box .l-flat { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 4 4; }
.chart-box .you-dot { fill: var(--gold); stroke: var(--paper); stroke-width: 2.5; }
.chart-box .mk-dot { fill: var(--paper); stroke: var(--gold); stroke-width: 1.5; }
.chart-box .mk-l { font-size: 11.5px; fill: var(--muted); }
.chart-box .you-l { font-size: 13px; font-weight: 700; fill: var(--gold); }

/* Second graph: monthly amount against time */
.inf .trade { padding-top: 64px; display: grid; gap: 14px; }
.inf .trade-msg { font-size: 1.05rem; max-width: 70ch; }
.inf .trade-msg b { font-weight: 700; }
.inf .trade-msg .g { color: var(--gold); }
.inf .trade-box { border-top: 1px solid var(--ink); padding-top: 6px; }
.inf .trade-legend { margin-top: -4px; }
.inf .trade-legend span { display: inline-flex; align-items: center; gap: 7px; }
/* Year by year */
.inf #years { padding-top: 56px; }
.inf #years h2 { margin-bottom: 14px; }
.inf .yt-scroll { overflow-x: auto; }
.inf .yt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.95rem; border-top: 1px solid var(--ink); }
.inf .yt th, .inf .yt td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.inf .yt th:first-child { text-align: left; }
.inf .yt th:last-child, .inf .yt td:last-child { padding-right: 0; }
.inf .yt thead th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.inf .yt tbody th { font-weight: 600; }
.inf .yt td.g { color: var(--gold); }
.inf .yt tr.is-goal { background: var(--surface-2); }
.inf .yt tr.is-target { background: var(--surface-2); }
.inf .yt-note { margin-top: 10px; }

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

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

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

/* Hide the "mo" unit while the custom target box shows its placeholder. */
.inf .preset-custom input:placeholder-shown + span { visibility: hidden; }

/* Very narrow phones: let the presets wrap instead of pushing the page sideways. */
@media (max-width: 360px) { .inf .presets { flex-wrap: wrap; } .inf .presets .preset { flex: 1 1 22%; } }

/* The goal column keeps to the panel width (it came out a few pixels too wide at 961-1200px). */
.inf fieldset.col, .inf .mode-date { min-width: 0; grid-template-columns: minmax(0, 1fr); }
.inf .mode-date .presets { flex-wrap: wrap; }

.chart-box .dep-line { stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 5 4; fill: none; }
.chart-box .cross-l { font-size: 12px; font-weight: 700; fill: var(--gold); }
.inf .stat-deep .v { color: var(--gold); }
.inf .bars-legend span { display: inline-flex; align-items: center; gap: 7px; }
.inf .date-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 8px; }
.inf .date-row select, .inf .date-row input { width: 100%; min-height: 42px; }
.inf .inf-seg { grid-template-columns: 1fr 1fr; }
.chart-box .l-ink-dash { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-dasharray: 5 4; }
.chart-box .l-rust { fill: none; stroke: var(--rust); stroke-width: 2; }
.chart-box .l-slate { fill: none; stroke: var(--slate); stroke-width: 2; }
.chart-box .b-pos { fill: var(--gold-area); fill-opacity: 0.85; }
.chart-box .b-neg { fill: var(--rust); fill-opacity: 0.8; }
.chart-box .b-hi { fill: var(--rust); fill-opacity: 0.85; }
.chart-box .end-l { font-size: 12px; font-weight: 700; }
.chart-box .end-l.g { fill: var(--gold); } .chart-box .end-l.k { fill: var(--ink); } .chart-box .end-l.r { fill: var(--rust); } .chart-box .end-l.s { fill: var(--slate); }
.chart-box .fall-band { fill: var(--rust); fill-opacity: 0.08; }
.inf .chip-gold { border-color: var(--gold); border-top-width: 2px; }
.inf .chip-ink-dash { border-color: var(--ink); border-top-width: 1.6px; border-top-style: dashed; }
.inf .chip-rust { border-color: var(--rust); border-top-width: 2px; }
.inf .chip-slate { border-color: var(--slate); border-top-width: 2px; }
.inf .stat-rust .v { color: var(--rust); }
.chart-box .b-down { fill: var(--slate); fill-opacity: 0.8; }
