/* Overpay or invest: page styles on top of the shared style.css.
   Everything here is prefixed "om-" so it never changes another page.
   Colours: invest = gold (the shared "growth" colour), overpay = slate (the steady, certain choice). */

.om-head { padding-block: 24px 4px; }
.om-head h1 { font-size: var(--step-3); margin-top: 6px; }

.om-work { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 16px; }
.om-stage { display: grid; min-width: 0; }

.om-answer { display: grid; gap: 2px; justify-items: start; }
.om-answer .label { font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.om-answer .big { font-size: clamp(2.6rem, 2rem + 2.4vw, 4rem); }
.om-answer .big.is-over { color: var(--slate); }
.om-answer .big.is-inv { color: var(--gold); }
.om-answer .big.is-even { color: var(--ink); }
.om-answer-line { color: var(--muted); font-size: 0.93rem; max-width: 60ch; margin-top: 6px; }
.om-answer-line strong { color: var(--ink); font-weight: 600; }

.om-figure { margin: 0; padding-top: 12px; }
.om-legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px; padding-top: 8px; }
.om-legend-row .hint { font-size: 0.8rem; }
.om-key { display: inline-flex; align-items: center; gap: 7px; }
.chip.om-chip-inv { border-color: var(--gold); }
.chip.om-chip-over { border-color: var(--slate); }

/* chart marks */
.chart-box .om-inv { fill: none; stroke: var(--gold); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .om-over { fill: none; stroke: var(--slate); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-box .om-inv-area { fill: var(--gold-area); fill-opacity: 0.13; }
.chart-box .om-over-area { fill: var(--slate); fill-opacity: 0.11; }
.chart-box .om-dot-inv { fill: var(--gold); stroke: var(--paper); stroke-width: 2; }
.chart-box .om-dot-over { fill: var(--slate); stroke: var(--paper); stroke-width: 2; }
.chart-box .om-mark { font-size: 11.5px; font-weight: 700; }
.chart-box .om-mark-sub { font-size: 11px; fill: var(--muted); }
.chart-box .om-gap { stroke: var(--ink); stroke-width: 1; }
.chart-box .om-gap-label { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; fill: var(--ink); }
.chart-box .om-zone { fill: var(--muted); font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
.chart-box .om-zone-inv { fill: var(--gold-area); fill-opacity: 0.07; }
.chart-box .om-zone-over { fill: var(--slate); fill-opacity: 0.07; }
.chart-box .om-you { stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 3; }
.chart-box .om-be { stroke: var(--ink); stroke-width: 1; stroke-opacity: 0.35; }
.chart-box .om-be-dot { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-box .om-empty { fill: var(--muted); font-family: var(--font-body); font-style: normal; font-size: 13px; }
.tip .t-h { font-weight: 700; font-size: 0.78rem; margin-top: 4px; }
.tip .t-h.inv { color: var(--gold); }
.tip .t-h.over { color: var(--slate); }
.tip .t-ahead { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 5px; font-weight: 600; }

/* stats */
.om-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 22px; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.om-stat { padding: 12px 16px 14px 0; display: grid; gap: 2px; align-content: start; min-width: 0; }
.om-stat + .om-stat { padding-left: 16px; border-left: 1px solid var(--line); }
.om-stat .label { font-size: 0.76rem; font-weight: 600; color: var(--muted); }
.om-stat .v { font-family: var(--font-display); font-weight: 500; font-size: 1.5rem; font-variant-numeric: lining-nums tabular-nums; line-height: 1.2; overflow-wrap: anywhere; }
.om-stat .sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* inputs */
.om-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 16px; display: grid; gap: 4px; min-width: 0; position: sticky; top: 12px; }
.om-panel-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-bottom: 12px; }
.om-panel-head h2 { font-size: 1.4rem; }
.om-panel-head .btn-row { flex-wrap: nowrap; gap: 4px; }
.om-panel-head .inline-field select { max-width: 11.5rem; }
.om-form { display: grid; border-top: 1px solid var(--ink); }
.om-group { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 10px; min-width: 0; }
.om-group + .om-group { border-top: 1px solid var(--line); }
.om-group:last-child { padding-bottom: 6px; }
.om-group legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; }
.om-group legend + * { clear: both; }
.om-row3 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.om-row-extra { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 10px; }
.om-group .hint { font-size: 0.8rem; }
.om-panel .privacy { margin-top: 6px; }
.om-seg { display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 42px; }
.om-seg button { border: 0; background: var(--paper); color: var(--muted); font-weight: 600; font-size: 0.86rem; cursor: pointer; padding: 0 6px; }
.om-seg button + button { border-left: 1px solid var(--line); }
.om-seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.om-panel input[type="text"] { min-height: 42px; }

/* sections */
.om-section { padding-top: 64px; }
.om-section-head { display: grid; gap: 8px; margin-bottom: 8px; }
.om-msg { font-size: 1.05rem; max-width: 70ch; }
.om-msg b { font-weight: 700; }
.om-msg .c-inv { color: var(--gold); }
.om-msg .c-over { color: var(--slate); }

/* year by year */
.om-yt-scroll { overflow-x: auto; margin-top: 8px; }
.om-yt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.93rem; border-top: 1px solid var(--ink); }
.om-yt th, .om-yt td { padding: 7px 12px 7px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.om-yt th:first-child, .om-yt td:first-child { text-align: left; }
.om-yt thead th { font-size: 0.76rem; color: var(--muted); font-weight: 600; }
.om-yt .om-yt-group th { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; padding-top: 10px; text-align: center; border-bottom: 0; }
.om-yt .om-yt-group .g-inv { color: var(--gold); }
.om-yt .om-yt-group .g-over { color: var(--slate); }
.om-yt tbody th { font-weight: 600; }
.om-yt tbody th small { font-weight: 400; color: var(--muted); margin-left: 6px; }
.om-yt td.z { color: var(--muted); }
.om-yt td.ahead-inv { color: var(--gold); font-weight: 600; }
.om-yt td.ahead-over { color: var(--slate); font-weight: 600; }
.om-yt tr.is-free td:nth-child(2) { color: var(--slate); font-weight: 600; }
.om-yt td:nth-child(3), .om-yt th:nth-child(3) { padding-right: 22px; }
.om-yt-note { margin-top: 10px; }

@media (max-width: 1200px) and (min-width: 961px) { .om-work { grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; } }
@media (max-width: 960px) {
  .om-work { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .om-stage { display: contents; }
  .om-answer { order: 1; }
  .om-stage .om-figure { order: 2; }
  .om-panel { order: 3; margin-top: 18px; position: static; }
  .om-stats { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 640px) {
  .om-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 20px; }
  .om-form .om-group:first-child { grid-column: 1 / -1; }
  .om-form .om-group:nth-child(3) { border-left: 1px solid var(--line); padding-left: 20px; }
}
@media (max-width: 640px) {
  .om-stats { grid-template-columns: minmax(0, 1fr); }
  .om-stat + .om-stat { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .om-stat { grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; column-gap: 12px; padding-right: 0; }
  .om-stat .label { grid-column: 1; }
  .om-stat .v { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-size: 1.3rem; }
  .om-stat .sub { grid-column: 1; grid-row: 2; }
}
@media (max-width: 600px) {
  .om-head { padding-block: 16px 0; }
  .om-head .eyebrow { display: none; }
  .om-head h1 { font-size: 1.55rem; }
  .om-answer .big { font-size: 2.6rem; }
  .om-answer-line { font-size: 0.86rem; }
  .om-figure { padding-top: 6px; }
  .om-hover-hint { display: none; }
  .om-panel { padding: 14px 14px 14px; margin-inline: -4px; }
  .om-row3 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .om-row3 .om-wide { grid-column: 1 / -1; }
  .om-section { padding-top: 52px; }
  .om-yt { font-size: 0.84rem; }
  .om-yt th, .om-yt td { padding-right: 9px; }
  .om-yt td:nth-child(3), .om-yt th:nth-child(3) { padding-right: 14px; }
  .om-yt tbody th small { display: none; }
}

.chart-box .om-halo { paint-order: stroke; stroke: var(--paper); stroke-width: 4px; stroke-linejoin: round; }
.om-panel-head h2 { white-space: nowrap; }
@media (max-width: 600px) {
  .om-answer-line .om-more { display: none; }
  .om-answer .label { font-size: 0.76rem; }
  .om-answer .big { font-size: 2.3rem; }
  .om-head h1 { font-size: 1.4rem; }
  .om-panel-head h2 { font-size: 1.2rem; }
  .om-panel-head { padding-bottom: 10px; }
  .om-group { padding: 12px 0; gap: 8px; }
}
.om-panel-head h2 { flex: none; font-size: 1.3rem; }
.om-panel-head .btn-row { flex: 0 1 auto; min-width: 0; justify-content: flex-end; }
.om-panel-head .inline-field { min-width: 0; flex: 0 1 auto; }
.om-panel-head .inline-field select { max-width: 10rem; width: 100%; min-width: 0; }
.om-panel-head .btn-ghost { padding-inline: 6px; }
.om-group { align-content: start; }
.chart-box .om-tag-bg { fill: var(--paper); fill-opacity: 0.92; }

/* Keep the currency picker readable: it used to shrink to an empty box once Share joined Reset.
   When "Your numbers" and the buttons don't fit on one line, the buttons move under the title. */
.om-panel-head { flex-wrap: wrap; row-gap: 8px; }
.om-panel-head .btn-row { flex: 0 0 auto; max-width: 100%; flex-wrap: wrap; row-gap: 6px; }
.om-panel-head .inline-field { flex: 0 0 auto; }
.om-panel-head .inline-field select { width: 8rem; min-width: 8rem; max-width: 8rem; }
