/* Real raise calculator: page-only styles. Builds on ../style.css and keeps its Ledger look.
   Everything here is prefixed rr- so it can't collide with other pages. */

.rr-head { padding-block: 26px 4px; }
.rr-head h1 { font-size: var(--step-3); max-width: none; margin-top: 6px; }

.rr-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 28px 40px; align-items: start; padding-top: 18px; }
.rr-stage { position: sticky; top: 12px; display: grid; min-width: 0; }
.rr-answer { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 4px 18px; }
.rr-answer .label { flex-basis: 100%; font-size: 0.78rem; font-weight: 600; color: var(--muted); }
.rr-answer .big { font-size: clamp(2.8rem, 2rem + 2.6vw, 4.2rem); }
.rr-answer .big.is-gain { color: var(--gold); }
.rr-answer .answer-line { padding-bottom: 6px; max-width: 46ch; }
.rr-answer .example-tag { flex-basis: 100%; }
.rr-stage .landscape { padding-top: 14px; }

/* Chart extras */
.chart-box .l-keep { fill: none; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }
.chart-box .l-keep-f { fill: none; stroke: var(--ink); stroke-width: 1.2; stroke-dasharray: 3 4; }
.chart-box .l-pay-f { fill: none; stroke: var(--gold); stroke-width: 2; stroke-dasharray: 6 4; stroke-linecap: round; }
.chart-box .dot-keep { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.chart-box .dot-start { fill: var(--ink); }
.chart-box .gap-bar { stroke-width: 1.5; }
.chart-box .gap-text { font-family: var(--font-body); font-style: normal; font-size: 12.5px; font-weight: 600; }
.chart-box .start-text { fill: var(--muted); }
.chip-keep { border-color: var(--ink); border-top-width: 1.5px; }
.chip-gap { width: 14px; height: 10px; border: 0; background: var(--gold-area); opacity: 0.55; border-radius: 2px; }
.legend-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 6px 24px; padding-top: 10px; }
.legend-row .hint { font-size: 0.8rem; }
.legend-static { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.84rem; color: var(--muted); }
.legend-static span { display: inline-flex; align-items: center; gap: 7px; }

.stats.rr-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 22px; }
.rr-stats .sub { font-size: 0.8rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.rr-stats .v.is-gain { color: var(--gold); }
.rr-stats .v.is-loss { color: var(--rust); }

/* Inputs panel */
.rr-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; display: grid; gap: 4px; min-width: 0; }
.rr-panel-head { display: grid; gap: 10px; padding-bottom: 12px; }
.rr-panel-head h2 { font-size: 1.45rem; }
.rr-panel-head .btn-row { flex-wrap: nowrap; }
.rr-panel-head .inline-field { flex: 1; min-width: 0; }
.rr-panel-head .inline-field select { width: 100%; }
.rr-form { display: grid; border-top: 1px solid var(--ink); }
.rr-col { border: 0; margin: 0; padding: 14px 0; display: grid; gap: 10px; min-width: 0; }
.rr-col + .rr-col { border-top: 1px solid var(--line); }
.rr-col:last-child { padding-bottom: 4px; }
.rr-col legend { float: left; width: 100%; padding: 0; font-family: var(--font-display); font-size: 1.05rem; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.rr-col legend + * { clear: both; }
.rr-col legend select { width: auto; font-family: var(--font-body); font-size: 0.85rem; padding: 4px 8px; }
.rr-pay { display: grid; grid-template-columns: 5.2rem minmax(0, 1fr); gap: 10px; }
.rr-infl { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.rr-infl .seg { width: 10.5rem; }
.rr-infl .seg button { font-size: 0.82rem; }
.rr-infl .seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.rr-sources summary { cursor: pointer; font-size: var(--step--1); color: var(--muted); font-weight: 600; }
.rr-sources[open] { display: grid; gap: 6px; }
.rr-sources ul { margin: 4px 0 0; padding-left: 18px; display: grid; gap: 3px; font-size: 0.85rem; }
.rr-sources p { font-size: 0.8rem; color: var(--muted); }
.rr-panel .privacy { margin-top: 8px; }
.rr-panel .errors { margin-top: 8px; }

/* Where your raise went */
.rr-split { padding-top: 56px; }
.rr-split h2 { margin-bottom: 10px; }
.rr-split-msg { font-size: 1.05rem; max-width: 70ch; margin-bottom: 18px; }
.rr-split-msg b { font-weight: 700; }
.rr-split-msg .g { color: var(--gold); }
.rr-split-msg .r { color: var(--rust); }
.rr-bar { display: flex; height: 44px; border-radius: var(--radius); overflow: hidden; border-top: 1px solid var(--ink); }
.rr-seg { min-width: 3px; height: 100%; transition: flex-basis 0.25s; }
.rr-seg + .rr-seg { border-left: 2px solid var(--paper); }
.rr-seg.k-prices { background: var(--muted); opacity: 0.45; }
.rr-seg.k-gain { background: var(--gold-area); }
.rr-seg.k-cover { background: var(--gold-area); opacity: 0.5; }
.rr-seg.k-short { background: repeating-linear-gradient(135deg, var(--rust) 0 2px, transparent 2px 7px); box-shadow: inset 0 0 0 1.5px var(--rust); }
.rr-seg.k-cut { background: var(--rust); opacity: 0.75; }
.rr-seg.k-fall { background: var(--gold-area); opacity: 0.55; }
.rr-bar-labels { display: flex; justify-content: space-between; gap: 18px; margin-top: 10px; }
.rr-bar-labels div { display: grid; gap: 1px; min-width: 0; }
.rr-bar-labels div:last-child { text-align: right; }
.rr-bar-labels b { font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; font-variant-numeric: lining-nums tabular-nums; line-height: 1.2; }
.rr-bar-labels span { font-size: 0.8rem; color: var(--muted); }
.rr-bar-labels .is-gain b { color: var(--gold); }
.rr-bar-labels .is-loss b { color: var(--rust); }
.rr-ahead { margin-top: 26px; font-size: 1rem; max-width: 80ch; border-left: 3px solid var(--gold-area); padding: 2px 0 2px 14px; }
.rr-ahead.is-loss { border-left-color: var(--rust); }
.rr-ahead .note { color: var(--muted); font-size: 0.85rem; }

/* Year by year */
.rr-years { padding-top: 56px; }
.rr-years h2 { margin-bottom: 14px; }
.yt-scroll { overflow-x: auto; }
.yt { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 0.95rem; border-top: 1px solid var(--ink); }
.yt th, .yt td { padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.yt th:first-child { text-align: left; }
.yt th:last-child, .yt td:last-child { padding-right: 0; }
.yt thead th { font-size: 0.78rem; color: var(--muted); font-weight: 600; }
.yt tbody th { font-weight: 600; }
.yt td.neg { color: var(--rust); }
.yt td.pos { color: var(--gold); }
.yt tr.is-fc { color: var(--muted); }
.yt tr.is-now th, .yt tr.is-now td { border-bottom-color: var(--ink); }
.yt tr.yt-split td { text-align: left; padding-top: 18px; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.14em; font-weight: 700; color: var(--gold); }
.rr-years .hint { margin-top: 10px; }

/* One content width: reading sections use the full width, heading left, text right. */
.rr-page .prose, .rr-page .disclaimer { max-width: none; }
@media (min-width: 900px) {
  .rr-page .section.prose { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); column-gap: 48px; row-gap: 0; align-items: start; }
  .rr-page .section.prose > h2 { grid-column: 1; grid-row: 1 / span 30; }
  .rr-page .section.prose > :not(h2) { grid-column: 2; margin-bottom: 16px; }
}
.rr-page .prose ul.links { gap: 4px; }

/* Sizes */
@media (max-width: 1200px) and (min-width: 961px) { .rr-workspace { grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; } }
@media (max-width: 960px) {
  .rr-workspace { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rr-stage { display: contents; }
  .rr-stage .rr-answer { order: 1; }
  .rr-stage .landscape { order: 2; }
  .rr-panel { order: 3; margin-top: 18px; }
  .rr-stage .rr-stats { order: 4; margin-top: 28px; }
}
@media (max-width: 960px) and (min-width: 600px) {
  .rr-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 18px; }
  .rr-col:first-child { grid-column: 1 / -1; }
  .rr-col:nth-child(3) { border-left: 1px solid var(--line); padding-left: 18px; }
  .rr-col:nth-child(2) { border-top: 1px solid var(--line); }
}
@media (max-width: 640px) {
  .stats.rr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .rr-head { padding-block: 16px 0; }
  .rr-head h1 { font-size: 1.6rem; }
  .rr-head .eyebrow { display: none; }
  .rr-answer { gap: 2px 14px; }
  .rr-answer .big { font-size: 2.8rem; }
  .rr-answer .label { display: none; }
  .rr-answer .answer-line { font-size: 0.85rem; flex-basis: 100%; padding-bottom: 0; }
  .rr-stage .landscape { padding-top: 4px; }
  .legend-row .hint { display: none; }
  .rr-panel { padding: 14px 14px 16px; margin-inline: -4px; }
  .rr-bar-labels b { font-size: 1.1rem; }
}
@media (max-width: 480px) {
  .yt .wide { display: none; }
  .yt { font-size: 0.84rem; }
  .yt th, .yt td { padding-right: 8px; }
}

/* Small fixes from the browser review */
.rr-answer .big small { font-size: 0.9rem; font-family: var(--font-body); letter-spacing: 0; color: var(--muted); margin-left: 10px; }
.rr-page .tip { min-width: 214px; }
.rr-empty { height: 300px; border: 1px dashed var(--line); border-radius: var(--radius); display: grid; place-items: center; color: var(--muted); font-family: var(--font-body); font-style: normal; }
@media (max-width: 600px) { .rr-empty { height: 200px; } .rr-answer .big small { font-size: 0.8rem; margin-left: 6px; } }

/* Keep the currency picker readable: it used to shrink to an empty box next to Example, Share and Clear.
   The buttons wrap onto a second line when they don't fit beside it. */
.rr-panel-head .btn-row { flex-wrap: wrap; row-gap: 6px; }
.rr-panel-head .inline-field { flex: 1 1 8rem; min-width: 8rem; }
