/* Server-rendered charts and blocks (QueryChartHelper, QueryTableHelper), on the --bq-* tokens. */

/* Charts (QueryChartHelper, ChartPlot, explorer/chart.js): the marks are an SVG stretched to
   its box, everything with text or a round shape is HTML over it, so text keeps its size at any width. */
.q-plot { margin: 0; display: grid; gap: var(--bq-space-2); min-width: 0; outline-offset: 6px; border-radius: var(--bq-radius-sm); }
.q-plot:focus:not(:focus-visible) { outline: none; }
.q-plot-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 var(--bq-space-3); align-items: start; }
.q-plot-figure { grid-column: 1; display: flex; flex-wrap: wrap; color: var(--bq-text-strong); font-size: var(--bq-fs-3xl); font-weight: 500; line-height: 1.15; letter-spacing: -0.02em; overflow-wrap: anywhere; }
.q-plot-note { grid-column: 1; margin: 0.15rem 0 0; color: var(--bq-text-muted); font-size: var(--bq-fs-sm); min-height: 1.5em; max-width: 62ch; text-wrap: pretty; }
.q-plot-foot { margin: 0; color: var(--bq-text-muted); font-size: var(--bq-fs-label); }
.q-plot-reset { grid-column: 2; grid-row: 1; align-self: start; padding: 0; border: 0; background: none; color: var(--bq-link); font-size: var(--bq-fs-xs); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.q-plot-figure > span { white-space: pre; }
.q-digit { display: inline-block; height: 1.15em; overflow: hidden; text-align: center; transition: width .3s cubic-bezier(.2,.8,.2,1); }
.q-digit > span { display: block; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.q-digit > span > span { display: block; height: 1.15em; line-height: 1.15em; }

.q-pane { display: grid; gap: 2px; min-width: 0; }
.q-pane-lower { margin-top: var(--bq-space-3); padding-top: var(--bq-space-2); border-top: 1px solid var(--bq-border); }
.q-pane-head { color: var(--bq-text-muted); font-size: var(--bq-fs-sm); }
.q-pane-value { color: var(--bq-text-strong); font-weight: 500; }
.q-plot-area { padding: 14px 46px 22px 2px; height: clamp(190px, 25vw, 290px); }
.q-pane-lower .q-plot-area { height: clamp(110px, 12vw, 150px); padding-top: 6px; }
.q-plot-box { position: relative; height: 100%; touch-action: pan-y; cursor: crosshair; border-bottom: 1px solid var(--bq-border-strong); }
.q-plot-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; clip-path: inset(0 var(--q-cut, 0%) 0 0); }
.q-plot-dim { clip-path: none; }
.q-plot-dim .q-line { stroke: var(--bq-border-strong) !important; }

/* Marks: strokes keep their width however the SVG is stretched. */
.q-s-1 { --q-c: var(--bq-chart-1); } .q-s-2 { --q-c: var(--bq-chart-5); } .q-s-3 { --q-c: var(--bq-chart-2); }
.q-s-4 { --q-c: var(--bq-chart-3); } .q-s-5 { --q-c: var(--bq-chart-4); } .q-s-other { --q-c: var(--bq-chart-other); }
.q-line { fill: none; stroke: var(--q-c); stroke-width: 1.75px; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.q-plot:not(:has(.q-serie)) .q-line { stroke: var(--bq-text-strong); }
.q-bar { fill: var(--bq-chart-1); transition: opacity .12s; }
.q-bar-none { fill: var(--bq-border-strong); }
.q-part { fill-opacity: .55; }
.is-reading .q-bar, .is-reading .q-bar-none { opacity: .3; }
.is-reading .q-on { opacity: 1; }
.q-partial { position: absolute; top: 0; bottom: 0; pointer-events: none; background: repeating-linear-gradient(135deg, var(--bq-border-strong) 0 1px, transparent 1px 6px); opacity: .5; }

/* Axes: tick values at the right, no grid across the data. */
.q-y, .q-x { position: absolute; color: var(--bq-text-muted); font-size: 11px; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; pointer-events: none; }
.q-y { left: calc(100% + 8px); transform: translateY(-50%); }
.q-y::before { content: ""; position: absolute; left: -7px; top: 50%; width: 4px; border-top: 1px solid var(--bq-border-strong); }
.q-x { top: calc(100% + 7px); transform: translateX(-50%); }
.is-viewed .q-y:not(.q-js), .is-viewed .q-x:not(.q-js), .is-viewed .q-note, .is-viewed .q-dot-end, .is-viewed .q-dot-peak, .is-viewed .q-lone, .is-viewed .q-off { display: none; }

/* Points and labels. */
.q-dot { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--bq-text-strong); box-shadow: 0 0 0 2px var(--bq-surface); pointer-events: none; }
.q-dot-end { background: var(--bq-accent); }
.q-dot-peak { width: 6px; height: 6px; margin: -3px 0 0 -3px; }
.q-lone { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: var(--q-c, var(--bq-text-strong)); box-shadow: none; }
.q-plot:not(:has(.q-serie)) .q-lone { background: var(--bq-text-strong); }
.q-hair { position: absolute; top: 0; bottom: 0; width: 0; border-left: 1px solid var(--bq-text-muted); pointer-events: none; }
.q-band { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--bq-text) 12%, transparent); pointer-events: none; }
.q-note { position: absolute; margin-top: -1.35rem; padding: 0 6px; color: var(--bq-text-strong); font-size: var(--bq-fs-label); font-weight: 600; white-space: nowrap; pointer-events: none; }
.q-note-left { transform: translateX(-100%); }
.q-plot-box:has(.q-hair:not([hidden])) .q-note { opacity: 0; }
.q-off { position: absolute; padding: 0 6px; border: 0; background: var(--bq-surface); color: var(--bq-text-strong); font-size: var(--bq-fs-label); font-weight: 500; white-space: nowrap; text-decoration: underline; text-decoration-color: var(--bq-text-muted); text-underline-offset: 2px; cursor: pointer; }
.q-off::before { color: var(--bq-accent); font-size: 9px; margin-right: 3px; }
.q-off.q-note-left { transform: translateX(-100%); }
.q-off-up { top: -8px; } .q-off-up::before { content: "\25B2"; }
.q-off-down { bottom: 4px; } .q-off-down::before { content: "\25BC"; }

/* The series of a pane: legend and readout in one. */
.q-plot-series { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: 1px var(--bq-space-4); }
.q-serie { display: flex; align-items: center; gap: 0.45rem; min-width: 0; padding: 2px 0; border: 0; background: none; color: var(--bq-text); font-size: var(--bq-fs-xs); text-align: left; cursor: pointer; }
.q-serie[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.q-serie-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-serie-value { margin-left: auto; color: var(--bq-text-strong); font-weight: 500; font-variant-numeric: tabular-nums; }
.q-key { flex: none; display: inline-block; width: 12px; height: 2px; background: var(--q-c); }

/* Categories: a ranked list instead of slanted labels. */
.q-plot-keys { display: flex; flex-wrap: wrap; gap: 0 var(--bq-space-4); color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-plot-keys span { display: inline-flex; align-items: center; gap: 0.4rem; }
.q-rank { display: grid; gap: var(--bq-space-2); }
.q-rank-row { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(6.5rem, 1fr); grid-template-columns: minmax(0, 2fr); gap: 0 var(--bq-space-4); align-items: baseline; transition: opacity .12s; }
.q-rank:hover .q-rank-row:not(:hover) { opacity: .55; }
.q-rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bq-fs-sm); }
.q-rank-cell { display: grid; gap: 3px; text-align: right; font-size: var(--bq-fs-sm); }
.q-rank-cell b { color: var(--bq-text-strong); font-weight: 500; font-variant-numeric: tabular-nums; }
.q-rank-bar { display: block; height: 3px; background: var(--bq-surface-3); }
.q-rank-bar u { display: block; height: 100%; margin-left: auto; background: var(--q-c); text-decoration: none; }

/* The strip of a live table: a needle per block (explorer/live_strip). */
.q-strip { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--bq-space-4); align-items: end; padding: var(--bq-space-3) var(--bq-space-4); border-bottom: 1px solid var(--bq-border); }
.q-strip-text { display: grid; min-width: 9rem; font-size: var(--bq-fs-label); color: var(--bq-text-muted); }
.q-strip-value { color: var(--bq-text-strong); font-size: var(--bq-fs-lg); font-weight: 500; font-variant-numeric: tabular-nums; }
.q-strip-svg { display: block; width: 100%; height: 72px; overflow: hidden; border-bottom: 1px solid var(--bq-border-strong); }
.q-strip-needles { fill: none; stroke: var(--bq-text); stroke-width: 1.4px; opacity: .7; vector-effect: non-scaling-stroke; }
.q-strip-new { stroke: var(--bq-accent); stroke-width: 2px; }
.q-strip-hair { stroke: var(--bq-text-muted); stroke-width: 1px; }
@media (max-width: 575.98px) {
  .q-strip { grid-template-columns: minmax(0, 1fr); gap: var(--bq-space-2); }
  .q-plot-figure { font-size: var(--bq-fs-2xl); }
  .q-plot-area { padding-right: 38px; }
  .q-x-odd { display: none; }
}
@media (prefers-reduced-motion: reduce) { .q-digit, .q-digit > span, .q-bar { transition: none; } }

/* Networks on the multichain page. */
.q-network-card { border-top: 3px solid var(--q-net, var(--bq-border-strong)); }
.q-network-eth { --q-net: #627eea; }
.q-network-bsc { --q-net: #c8930a; }
.q-network-arbitrum { --q-net: #1b8ad0; }
.q-network-base { --q-net: #0052ff; }
