.history-page { min-height: 100%; overflow: auto; background: #070b0f; }
.history-shell { min-height: 100vh; }
.history-main { display: block; width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 48px 0 72px; }
.history-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 40px; margin-bottom: 30px; }
.history-hero h1 { margin: 7px 0 12px; font-size: clamp(34px, 5vw, 58px); line-height: .96; letter-spacing: -.06em; }
.history-hero p { max-width: 700px; margin: 0; color: #9ba8b0; font-size: 14px; line-height: 1.65; }
.history-window { min-width: 250px; padding: 15px 17px; border: 1px solid var(--line); border-radius: 12px; background: #0b1117; }
.history-window span, .history-window small { display: block; color: var(--muted); }
.history-window span { margin-bottom: 5px; font-size: 8px; letter-spacing: .1em; text-transform: uppercase; }
.history-window strong { display: block; font-size: 13px; }
.history-window small { margin-top: 5px; font-size: 9px; }
.history-controls { display: grid; grid-template-columns: minmax(200px, 1fr) 180px auto; gap: 12px; align-items: end; padding: 14px; border: 1px solid var(--line); border-radius: 13px; background: #0b1117; }
.history-controls label > span, .history-controls legend { display: block; margin-bottom: 6px; color: var(--muted); font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-controls select { width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: #131c23; }
.history-controls fieldset { margin: 0; padding: 0; border: 0; }
.range-buttons { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--line-strong); border-radius: 8px; background: #101820; }
.range-buttons button { min-width: 45px; height: 30px; padding: 0 10px; border: 0; border-radius: 5px; background: transparent; color: var(--muted); font-size: 9px; font-weight: 750; }
.range-buttons button.active { color: #081006; background: var(--lime); }
.history-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.history-stats > div { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.018); }
.history-stats span, .history-stats small { display: block; color: var(--muted); }
.history-stats span { font-size: 8px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.history-stats strong { display: block; margin: 7px 0 3px; color: var(--lime); font-size: 20px; letter-spacing: -.035em; }
.history-stats small { font-size: 9px; }
.history-card { margin-top: 14px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #0b1117; }
.history-card > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.history-card h2, .history-method h2 { margin: 5px 0 0; font-size: 18px; letter-spacing: -.035em; }
.chart-legend { display: flex; gap: 15px; color: var(--muted); font-size: 9px; }
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 18px; height: 7px; border-radius: 2px; }
.legend-outer { background: rgba(85,184,255,.14); }
.legend-inner { background: rgba(184,242,63,.18); }
.legend-line { height: 2px !important; background: var(--lime); }
.chart-frame { position: relative; min-height: 390px; padding: 10px 12px 0; }
#history-chart { display: block; width: 100%; height: 390px; overflow: visible; }
.chart-empty { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: var(--muted); font-size: 12px; }
.chart-empty[hidden] { display: none; }
.chart-note { margin: 0; padding: 12px 20px 15px; color: #77858e; border-top: 1px solid var(--line); font-size: 9px; line-height: 1.5; }
.axis-line { stroke: rgba(181,205,217,.16); stroke-width: 1; }
.axis-text { fill: #6f7d86; font-size: 9px; }
.outer-band { fill: rgba(85,184,255,.12); }
.inner-band { fill: rgba(184,242,63,.17); }
.median-line { fill: none; stroke: var(--lime); stroke-width: 2.3; stroke-linejoin: round; stroke-linecap: round; }
.median-point { fill: var(--lime); stroke: #0b1117; stroke-width: 2; }
.provider-time { color: var(--muted); font-size: 9px; }
.provider-chart-frame { overflow-x: auto; padding: 12px 14px 0; }
#provider-chart { display: block; width: 100%; min-width: 700px; }
.whisker-tail { stroke: rgba(85,184,255,.45); stroke-width: 1; }
.whisker-line { stroke: #7b8991; stroke-width: 1.5; }
.whisker-box { fill: rgba(184,242,63,.14); stroke: rgba(184,242,63,.55); }
.whisker-median { stroke: var(--lime); stroke-width: 2; }
.provider-label { fill: #cbd5da; font-size: 9px; }
.provider-table-wrap { overflow-x: auto; border-top: 1px solid var(--line); }
.provider-history-table { width: 100%; border-collapse: collapse; font-size: 10px; }
.provider-history-table th, .provider-history-table td { padding: 10px 16px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.provider-history-table th:first-child, .provider-history-table td:first-child { text-align: left; }
.provider-history-table th { color: var(--muted); background: rgba(255,255,255,.02); font-size: 8px; letter-spacing: .05em; text-transform: uppercase; }
.provider-history-table tr:last-child td { border-bottom: 0; }
.history-method { display: grid; grid-template-columns: 1fr minmax(360px, .8fr); gap: 34px; margin-top: 14px; padding: 22px; border: 1px solid rgba(85,184,255,.17); border-radius: 14px; background: rgba(85,184,255,.035); }
.history-method p { margin: 10px 0 0; color: #91a0a8; font-size: 11px; line-height: 1.65; }
.history-method dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 0; }
.history-method dl div { padding: 11px; border: 1px solid var(--line); border-radius: 9px; background: rgba(7,11,15,.45); }
.history-method dt { color: var(--muted); font-size: 8px; text-transform: uppercase; }
.history-method dd { margin: 5px 0 0; color: var(--blue); font-size: 14px; font-weight: 750; }

@media (max-width: 820px) {
  .history-topbar { grid-template-columns: 1fr auto; }
  .history-topbar .source-badge { display: none; }
  .history-nav { justify-content: flex-end; gap: 14px; }
  .history-main { width: min(100% - 24px, 1240px); padding-top: 28px; }
  .history-hero { grid-template-columns: 1fr; gap: 18px; }
  .history-window { min-width: 0; }
  .history-controls { grid-template-columns: 1fr 1fr; }
  .history-controls fieldset { grid-column: 1 / -1; }
  .range-buttons button { flex: 1; }
  .history-stats { grid-template-columns: 1fr 1fr; }
  .history-card > header { align-items: flex-start; flex-direction: column; }
  .chart-legend { flex-wrap: wrap; }
  .history-method { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .history-nav .top-nav-link:first-child { display: none; }
  .history-controls { grid-template-columns: 1fr; }
  .history-controls fieldset { grid-column: auto; }
  .history-stats { grid-template-columns: 1fr; }
  .history-method dl { grid-template-columns: 1fr 1fr; }
}
