/* Past market crashes calculator: page-only styles on top of the shared style.css. */
.cr-gold { color: var(--gold); }
.cr-rust { color: var(--rust); }
.cr-short, .legend-static .cr-short { display: none; }
@media (max-width: 600px) { .cr-long, .legend-static .cr-long { display: none; } .cr-short, .legend-static .cr-short { display: inline; } }

/* the crash picker, above the answer */
.cr-pick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cr-pick .preset { padding: 6px 11px; font-variant-numeric: lining-nums tabular-nums; }
@media (max-width: 600px) {
  .cr-pick { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; margin-bottom: 10px; }
  .cr-pick .preset { padding: 7px 0; text-align: center; font-size: 0.8rem; letter-spacing: -0.01em; }
}
.answer .cr-label { display: block; flex-basis: 100%; }

/* legend chips */
.cr-chip-in { border-color: var(--ink); border-top-width: 1.3px; border-top-style: dashed; }
.cr-chip-other { border-color: var(--muted); border-top-width: 1.5px; opacity: 0.5; }

/* main chart */
.cr-chart .cr-other { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-opacity: 0.32; stroke-linejoin: round; }
.cr-chart .cr-in { fill: none; stroke: var(--ink); stroke-width: 1.3; stroke-dasharray: 4 4; stroke-opacity: 0.8; }
.cr-chart .cr-hole { fill: var(--rust); fill-opacity: 0.13; }
.cr-chart .cr-low-dot { fill: var(--rust); stroke: var(--paper); stroke-width: 2; }
.cr-chart .cr-open-dot { fill: var(--paper); stroke: var(--gold); stroke-width: 2; }
.cr-chart .cr-tag-low { fill: var(--rust); font-size: 12.5px; font-weight: 700; }
.cr-chart .cr-tag-back { fill: var(--gold); font-size: 12.5px; font-weight: 700; }

/* every crash, side by side */
.cr-msg { color: var(--muted); font-size: 0.95rem; }
.cr-bars { margin: 6px 0 12px; }
.cr-bars .cr-row { cursor: pointer; outline: none; }
.cr-bars .cr-row-bg { fill: transparent; }
.cr-bars .cr-row:hover .cr-row-bg { fill: var(--surface-2); }
.cr-bars .cr-row.is-sel .cr-row-bg { fill: var(--gold-soft); }
.cr-bars .cr-row:focus-visible .cr-row-bg { stroke: var(--focus); stroke-width: 2; }
.cr-bars .cr-bar-fall { fill: var(--rust); fill-opacity: 0.8; }
.cr-bars .cr-bar-climb { fill: var(--gold-area); }
.cr-bars .cr-bar-climb.is-open { fill-opacity: 0.35; }
.cr-bars .cr-bar-year { fill: var(--ink); font-size: 12.5px; font-weight: 700; }
.cr-bars .cr-bar-year.is-sel { fill: var(--gold); }
.cr-bars .cr-bar-val { fill: var(--ink); font-size: 12px; font-weight: 600; }
.cr-sq-fall { background: var(--rust); opacity: 0.8; }
.cr-sq-climb { background: var(--gold-area); }

/* while inputs are invalid, the old result stays but fades */
.cr-invalid .stage, .cr-invalid #side-by-side { opacity: 0.4; transition: opacity 0.2s; }

/* four numbers in one row (the shared .stats rule defaults to three), two by two on phones */
.stats.cr-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 640px) { .stats.cr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
