.market-history-chart {
  padding: 16px;
  border: 1px solid rgba(150, 237, 218, .14);
  border-radius: 18px;
  color: #becbc8;
  background: rgba(9, 18, 22, .66);
  min-width: 0;
  overflow: hidden;
}
.market-history-head, .market-history-selected-head, .market-history-navigate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.market-history-head > div:first-child { display: grid; gap: 5px; }
.market-history-head span, .market-history-head small, .market-history-meta, .market-history-boundary, .market-history-status, .market-history-selected-head, .market-history-selection dt, .market-history-position {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: .035em;
}
.market-history-head span { font-weight: 700; color: #cfede4; }
.market-history-head small { color: #a4b8b2; }
.market-history-periods { display: flex; gap: 3px; padding: 3px; background: #111f24; border: 1px solid rgba(150, 237, 218, .12); border-radius: 12px; }
.market-history-periods button, .market-history-navigate button, .market-history-retry {
  min-height: 44px;
  min-width: 44px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: #becbc8;
  font: inherit;
  font-size: 11px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .15s ease, color .15s ease;
}
.market-history-periods button[aria-pressed="true"] { background: #96edda; color: #081714; font-weight: 700; }
.market-history-periods button:hover:not([aria-pressed="true"]), .market-history-navigate button:hover:not(:disabled) { background: #213634; color: #f0f4ef; }
.market-history-chart button:focus-visible, .market-history-boundary a:focus-visible { outline: 2px solid #b5f9e7; outline-offset: 3px; }
.market-history-plot { position: relative; margin-top: 14px; min-height: 180px; display: grid; align-items: center; }
.market-history-plot svg { width: 100%; height: auto; display: block; overflow: visible; }
.market-history-chart [hidden] { display: none !important; }
.market-history-empty { display: grid; place-items: center; min-height: 180px; padding: 24px; color: #a4b8b2; font-size: 12px; text-align: center; border: 1px dashed rgba(150, 237, 218, .15); border-radius: 12px; }
.market-history-grid { stroke: rgba(150, 237, 218, .08); stroke-width: .6; fill: none; }
.market-history-axis { fill: #a4b8b2; font-family: var(--font-mono, ui-monospace, monospace); font-size: 8px; }
.market-history-candle { cursor: pointer; outline: none; }
.market-history-hit { fill: transparent; }
.market-history-wick, .market-history-doji { stroke: currentColor; stroke-width: 1.2; fill: none; }
.market-history-body { fill: currentColor; stroke: currentColor; stroke-width: .8; }
.market-history-candle.is-up { color: #96edda; }
.market-history-candle.is-down { color: #f1a58e; }
.market-history-candle.is-down rect.market-history-body { fill: #10191e; stroke-width: 1.25; }
.market-history-candle.is-unchanged { color: #cdddba; }
.market-history-candle.is-partial .market-history-wick { stroke-dasharray: 2 1; }
.market-history-candle.is-selected .market-history-hit { fill: rgba(150, 237, 218, .07); }
.market-history-candle:focus-visible .market-history-hit { fill: rgba(150, 237, 218, .12); stroke: #b5f9e7; stroke-width: 1; }
.market-history-selection { padding-top: 11px; margin-top: 8px; border-top: 1px solid rgba(150, 237, 218, .12); }
.market-history-selected-head { flex-wrap: wrap; color: #cfede4; }
[data-history-completeness] { color: #cdddba; font-size: 9px; }
.market-history-selection dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 12px 0 5px; }
.market-history-selection dt { color: #a4b8b2; }
.market-history-selection dd { margin: 4px 0 0; color: #f0f4ef; font-family: var(--font-mono, ui-monospace, monospace); font-size: 12px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.market-history-navigate { justify-content: center; gap: 12px; }
.market-history-navigate button { border-color: rgba(150, 237, 218, .12); background: #142329; font-size: 16px; }
.market-history-navigate button:disabled, .market-history-retry:disabled { color: #a2b5af; cursor: default; background: #18242a; }
[data-history-position] { color: #a4b8b2; font-family: var(--font-mono, ui-monospace, monospace); font-size: 10px; text-align: center; }
.market-history-status { margin: 10px 0 0; color: #cfede4; }
.market-history-retry { border-color: rgba(150, 237, 218, .24); background: #182b2b; color: #cfede4; margin-top: 9px; }
.market-history-meta { display: grid; gap: 4px; margin-top: 10px; color: #a4b8b2; overflow-wrap: anywhere; }
.market-history-boundary { margin: 12px 0 0; padding-top: 10px; border-top: 1px solid rgba(150, 237, 218, .12); color: #a4b8b2; letter-spacing: 0; }
.market-history-boundary a { color: #cfede4; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
@media (max-width: 760px) {
  .market-history-chart { padding: 13px; }
  .market-history-head { align-items: start; flex-wrap: wrap; gap: 10px; }
  .market-history-plot { min-height: 145px; }
  .market-history-selection dd { font-size: 11px; }
}
@media (prefers-reduced-motion: reduce) {
  .market-history-chart * { animation: none !important; transition: none !important; }
}
@media (forced-colors: active) {
  .market-history-chart, .market-history-periods, .market-history-empty { border-color: CanvasText; }
  .market-history-periods button[aria-pressed="true"] { border-color: Highlight; }
  .market-history-candle { color: CanvasText; }
  .market-history-candle.is-down rect.market-history-body { fill: Canvas; }
  .market-history-candle.is-selected .market-history-hit, .market-history-candle:focus-visible .market-history-hit { stroke: Highlight; fill: none; }
}
