.price-history { min-width: 0; color: var(--text); font-size: 12px; }
.history-toolbar, .history-controls, .history-scope { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; }
.history-toolbar > strong { font-size: 14px; }
.history-periods { display: flex; flex-wrap: wrap; gap: 3px; padding: 3px; background: var(--raised); border: 1px solid var(--line); border-radius: 9px; }
.price-history button { background: transparent; border: 1px solid transparent; border-radius: 6px; color: var(--muted); cursor: pointer; padding: 6px 9px; font: inherit; min-height: 32px; transition: background .12s, color .12s; }
.price-history button:hover { background: var(--hover); color: var(--text); }
.history-periods button[aria-pressed=true] { background: var(--card); border-color: var(--line); color: var(--text); font-weight: 650; }
.price-history button:focus-visible, .history-plot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.history-scope { margin-top: 12px; color: var(--muted); font-size: 11px; }
.price-history label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.price-history input { accent-color: var(--accent); }
.history-stats { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--raised); }
.history-stats > div { padding: 12px; min-width: 0; }
.history-stats span { display: block; color: var(--muted); font-size: 11px; margin-bottom: 5px; }
.history-stats strong { font-size: clamp(12px,1.3vw,17px); font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.history-stats .falling, .history-comparison { color: var(--good); }
.history-comparison { margin: 9px 0 12px; font-size: 11px; }
.history-controls button[aria-pressed=false] { opacity: .5; text-decoration: line-through; }
.history-controls i { display: inline-block; width: 14px; height: 2px; margin-right: 6px; vertical-align: middle; background: var(--series-1); }
.history-controls i.coupon { background: var(--series-2); }
.price-history button:disabled { opacity: .4; cursor: default; }
.history-plot { position: relative; min-width: 0; touch-action: none; cursor: crosshair; margin-top: 4px; }
.history-plot svg { width: 100%; height: 260px; display: block; overflow: hidden; user-select: none; }
.history-plot .axis { fill: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.history-tip { position: fixed; z-index: 3; pointer-events: none; background: var(--card); border: 1px solid var(--line-strong); border-radius: 9px; padding: 10px 12px; max-width: min(300px,calc(100vw - 16px)); box-sizing: border-box; font-size: 11px; line-height: 1.65; color: var(--text); overflow-wrap: anywhere; }
.history-tip strong { display: block; margin-bottom: 3px; }
.history-options { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; border-top: 1px solid var(--line); color: var(--muted); }
.history-note, .history-help { color: var(--muted); font-size: 10px; line-height: 1.5; margin: 7px 0 0; }
.hist > details { overflow-x: auto; max-width: 100%; }
@media (max-width: 640px) {
  .history-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .history-stats > div { padding: 9px 8px; }
  .history-stats strong { font-size: 13px; }
  .history-periods { width: 100%; justify-content: space-between; }
  .history-toolbar { gap: 8px; }
  .history-options { font-size: 11px; gap: 6px 10px; }
  .history-controls { gap: 2px; }
}
