/* history styles: #/history pages (js/pages/history.js) */
/* --series-3 lives with the other tokens in styles.css */

.h-switch { display: inline-flex; gap: 2px; flex-wrap: wrap; margin-top: 18px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 4px; }
.h-switch .pill { text-decoration: none; padding: 6px 14px; font-size: 13.5px; background: none; color: var(--text-2); }
.h-switch .pill:hover { color: var(--text); background: var(--surface-3); }
.h-switch .pill[aria-current] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--border); }

.h-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.h-tall { max-height: 440px; overflow-y: auto; }
.h-scroll table.data { min-width: 100%; }
.h-scroll td, .h-scroll th { white-space: nowrap; }
.nowrap { white-space: nowrap; }
.h-team { color: var(--text); text-decoration: none; }
.h-team:hover span { text-decoration: underline; }
table.data td .team-cell span { max-width: 190px; }

.h-calc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.h-pick { display: grid; gap: 8px; background: var(--surface-2); border-radius: var(--radius); padding: 14px; min-width: 0; }
.h-pick select { background-color: var(--surface); }
.h-pick-label { font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.h-pick select, .h-calc-opts select { width: 100%; min-width: 0; }
.h-calc-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; font-size: 13px; color: var(--text-2); }
.h-calc-opts label { display: grid; gap: 4px; }
.h-calc-out { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 18px; border-radius: var(--radius); border: 1px solid var(--border); }
.h-side { display: grid; gap: 2px; min-width: 0; }
.h-side:nth-child(2) { text-align: right; }
.h-side:nth-child(2) .team-cell { justify-content: flex-end; }
.h-side > b { font: 800 40px/1.05 var(--font-display); letter-spacing: -0.03em; }
.h-side:first-child > b { color: var(--series-1); }
.h-calc-note { grid-column: 1 / -1; margin: 4px 0 0; }

.h-title { display: flex; gap: 14px; align-items: center; min-width: 0; }
.h-title > div { min-width: 0; }
.h-logo { width: 72px; height: 72px; padding: 10px; border-radius: 50%; background: var(--logo-plate); border: 1px solid var(--border); box-shadow: var(--shadow-sm); box-sizing: content-box; }
@media (max-width: 640px) { .h-logo { width: 44px; height: 44px; padding: 6px; } }
.h-links { display: flex; gap: 16px; flex-wrap: wrap; margin: 8px 0 0; font-size: 14px; }
.h-compare { font-size: 14px; color: var(--text-2); display: flex; gap: 8px; align-items: center; min-width: 0; }
.h-compare select { max-width: 220px; min-width: 0; }
#h-legend { margin-bottom: 6px; }

.h-callouts { display: grid; gap: 8px; margin-top: 10px; }
.h-callout { display: flex; gap: 14px; align-items: center; background: var(--surface-2); border-radius: var(--radius); padding: 12px 14px; font-size: 14px; }
.h-callout > b { font: 800 26px/1 var(--font-display); min-width: 64px; letter-spacing: -0.02em; }

@media (max-width: 640px) {
  .h-calc-grid, .h-calc-opts { grid-template-columns: 1fr; }
  .h-side > b { font-size: 24px; }
  h1 { overflow-wrap: anywhere; }
  .stat { min-width: 0; flex: 1 1 40%; }
  .h-compare { width: 100%; }
  .h-compare select { flex: 1; max-width: none; }
}

/* grid items default to min-width:auto, which lets wide tables push cards past the viewport */
.h-grid > .card { min-width: 0; }
