/*
  Components, on the --bq-* tokens (tokens.css). Class names the views and
  helpers already use (card, table, btn, badge, alert, nav-link...) keep their
  names; the new chrome (header, section nav, page head, footer) is bq-*.
*/

/* ---------- Icons (inline SVG from IconHelper#icon) ---------- */
.bq-icon { width: 1em; height: 1em; flex: none; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.125em; }

/* ---------- Buttons ---------- */
.btn, .bq-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 36px; padding: 0 0.875rem; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm);
  background: var(--bq-surface); color: var(--bq-text); font: 500 var(--bq-fs-md)/1.2 var(--bq-font);
  white-space: nowrap; text-decoration: none !important; cursor: pointer; transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover, .bq-btn:hover { background: var(--bq-surface-2); color: var(--bq-text); }
.btn-sm, .bq-btn-sm { min-height: 30px; padding: 0 0.625rem; font-size: var(--bq-fs-sm); }
.bq-btn-cta, .bg-custom-purple {
  background: var(--bq-accent) !important; border-color: var(--bq-accent) !important; color: var(--bq-accent-contrast) !important;
}
.bq-btn-cta:hover, .bg-custom-purple:hover { background: var(--bq-accent-hover) !important; border-color: var(--bq-accent-hover) !important; }
.bq-btn-ghost { background: transparent; border-color: transparent; color: var(--bq-text); }
.bq-btn-ghost:hover { background: var(--bq-surface-2); }
.bq-icon-btn { width: 36px; padding: 0; }
.btn-outline-secondary { background: transparent; }
.btn.disabled, .btn:disabled { opacity: 0.55; pointer-events: none; }

/* ---------- Header ---------- */
.bq-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bq-surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--bq-border); }
.bq-header::before { content: ""; position: absolute; inset: 0 0 auto; height: 2px; background: var(--bq-gradient); }
.bq-header-in { display: flex; align-items: center; gap: var(--bq-space-4); min-height: var(--bq-header-h); }
.bq-logo { display: inline-flex; align-items: center; gap: 0.6rem; flex: none; color: var(--bq-text-strong, var(--bq-text)) !important;
  font-weight: 600; font-size: 1.0625rem; letter-spacing: -0.01em; text-decoration: none !important; }
.bq-logo img { width: 24px; height: 30px; }
.bq-logo small { font-size: 0.9375rem; font-weight: 400; color: var(--bq-text-muted); }
.bq-header-actions { display: flex; align-items: center; gap: var(--bq-space-2); flex: none; margin-left: auto; }

/* Network switcher and other disclosure menus: <details class="bq-menu"> */
.bq-menu { position: relative; }
.bq-menu > summary { list-style: none; }
.bq-menu > summary::-webkit-details-marker { display: none; }
.bq-menu-panel { position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; min-width: 240px; max-height: min(70vh, 640px); overflow: auto;
  padding: var(--bq-space-2); border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); background: var(--bq-elevated); box-shadow: var(--bq-shadow-lg); }
.bq-menu-panel.end { left: auto; right: 0; }
.bq-menu-panel a, .bq-menu-panel button.bq-menu-item { display: flex; align-items: center; gap: 0.6rem; width: 100%; padding: 0.45rem 0.6rem; border: 0;
  border-radius: var(--bq-radius-sm); background: none; color: var(--bq-text); text-align: left; text-decoration: none; }
.bq-menu-panel a:hover, .bq-menu-panel button.bq-menu-item:hover { background: var(--bq-surface-2); text-decoration: none; color: var(--bq-text); }
.bq-menu-panel a[aria-current] { background: var(--bq-soft); color: var(--bq-text-active); font-weight: 600; }
.bq-menu-panel h3 { margin: var(--bq-space-2) 0.6rem var(--bq-space-1); font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--bq-text-muted); }
.bq-netsw > summary { display: inline-flex; align-items: center; gap: 0.5rem; height: 36px; padding: 0 0.6rem 0 0.4rem;
  border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-md); background: var(--bq-surface); cursor: pointer; font-weight: 500; white-space: nowrap; }
.bq-netsw > summary:hover { background: var(--bq-surface-2); }
.bq-netsw > summary .bq-icon { color: var(--bq-text-muted); }
/* The network switcher's panel (shared/_navbar): a filter on top, the live
   networks and the others side by side, each in two columns, and "All
   networks" at the foot; a hairline of the logo's colours along its top edge. Each network: logo, short name, currency in
   mono; the current one in the accent's tint with a check. */
.bq-netsw .bq-netsw-panel { --netsw-a: #e8691f; --netsw-b: #d6265a; --netsw-c: #8a33c2;
  width: min(980px, calc(100vw - 2rem)); max-height: min(78vh, 680px); padding: 0; overflow: hidden; display: flex; flex-direction: column;
  border-radius: 14px; border-color: var(--bq-border-strong); box-shadow: 0 24px 60px -20px rgba(10, 12, 20, 0.45), var(--bq-shadow-lg);
  animation: bq-netsw-in 0.16s ease-out; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bq-netsw .bq-netsw-panel { --netsw-a: #ff8a3d; --netsw-b: #f0436f; --netsw-c: #a24bd6; } }
:root[data-theme="dark"] .bq-netsw .bq-netsw-panel { --netsw-a: #ff8a3d; --netsw-b: #f0436f; --netsw-c: #a24bd6; }
.bq-netsw .bq-netsw-panel::before { content: ""; height: 1px; flex: none; background: linear-gradient(90deg, transparent, var(--netsw-a), var(--netsw-b), var(--netsw-c), transparent); opacity: 0.8; }
@keyframes bq-netsw-in { from { opacity: 0; transform: translateY(-4px); } }
.bq-netsw-top { display: flex; align-items: center; gap: var(--bq-space-2); flex: none; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--bq-border); }
.bq-netsw-top .bq-icon { flex: none; color: var(--bq-text-muted); }
.bq-netsw-filter { flex: 1 1 auto; min-width: 0; height: 32px; border: 0; outline: 0; background: transparent; color: var(--bq-text); font-size: var(--bq-fs-sm); }
.bq-netsw-top:has(.bq-netsw-filter:focus-visible) { border-bottom-color: color-mix(in srgb, var(--netsw-b) 55%, transparent); }
.bq-netsw-filter::placeholder { color: var(--bq-text-muted); opacity: 1; }
.bq-netsw-filter::-webkit-search-cancel-button { -webkit-appearance: none; }
.bq-netsw-count { flex: none; color: var(--bq-text-muted); font: 500 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.bq-netsw-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bq-space-2) var(--bq-space-5); padding: 0.75rem 0.75rem 0.5rem; overflow: auto; }
.bq-netsw-group { min-width: 0; }
.bq-netsw-group + .bq-netsw-group { position: relative; }
.bq-netsw-group + .bq-netsw-group::before { content: ""; position: absolute; top: 0.25rem; bottom: 0.25rem; left: calc(var(--bq-space-5) / -2); width: 1px; background: var(--bq-border); }
.bq-netsw-live { width: 6px; height: 6px; align-self: center; border-radius: 50%; background: var(--bq-success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--bq-success) 20%, transparent); }
.bq-netsw-l2 { flex: none; display: inline-block; margin-left: -0.25rem; padding: 1px 4px; border: 1px solid var(--bq-border-strong); border-radius: 4px;
  color: var(--bq-text-muted); font: 600 0.5625rem/1.2 var(--bq-mono); letter-spacing: 0.06em; vertical-align: 1px; }
.bq-netsw-group ul { margin: 0; padding: 0; list-style: none; }
.bq-netsw-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--bq-space-2); }
.bq-netsw-panel h3 { display: flex; align-items: baseline; gap: 0.4rem; margin: 0.25rem 0.6rem 0.35rem; }
.bq-netsw-panel h3 span { color: var(--bq-text-muted); opacity: 0.7; letter-spacing: 0; }
.bq-menu-panel.bq-netsw-panel li a { position: relative; gap: 0.6rem; padding: 0.4rem 0.6rem; border-radius: 8px; transition: background-color 0.12s; }
.bq-netsw-panel li a .bq-net-icon { width: 20px; height: 20px; transition: transform 0.15s; }
.bq-netsw-panel li a:hover .bq-net-icon { transform: scale(1.08); }
.bq-netsw-label { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--bq-fs-sm); }
.bq-netsw-panel li a small { flex: none; margin-left: auto; color: var(--bq-text-muted); font: 500 0.6875rem/1 var(--bq-mono); letter-spacing: 0.02em; }
.bq-netsw-panel li a > .bq-icon { flex: none; width: 14px; height: 14px; color: var(--netsw-b); }
.bq-menu-panel.bq-netsw-panel li a[aria-current] { background: color-mix(in srgb, var(--netsw-b) 10%, transparent); color: var(--bq-text-strong); font-weight: 500; }
.bq-menu-panel.bq-netsw-panel li a[aria-current]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--netsw-b); }
.bq-netsw-panel li[hidden], .bq-netsw-group[hidden] { display: none; }
.bq-menu-panel.bq-netsw-panel li.is-target a { background: var(--bq-surface-2); box-shadow: inset 0 0 0 1px var(--bq-border-strong); }
.bq-netsw-empty { margin: 0; padding: var(--bq-space-4); color: var(--bq-text-muted); text-align: center; font-size: var(--bq-fs-sm); }
.bq-netsw-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--bq-space-3); flex: none; padding: 0.4rem 0.75rem; border-top: 1px solid var(--bq-border);
  background: color-mix(in srgb, var(--bq-surface-2) 50%, transparent); }
.bq-menu-panel.bq-netsw-panel .bq-netsw-foot a { width: auto; font-size: var(--bq-fs-sm); font-weight: 500; }
.bq-netsw-foot span { color: var(--bq-text-muted); font: 500 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.06em; text-transform: uppercase; }
@media (max-width: 899.98px) {
  .bq-netsw-groups { grid-template-columns: minmax(0, 1fr); }
  .bq-netsw-group + .bq-netsw-group::before { display: none; }
  .bq-netsw-foot span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bq-netsw .bq-netsw-panel { animation: none; } }
.bq-net-icon { width: 22px; height: 22px; flex: none; object-fit: contain; }

/* Search */
.search-form { flex: 1 1 auto; min-width: 0; max-width: 720px; }
.bq-search { display: flex; align-items: center; gap: var(--bq-space-2); height: 40px; padding: 0 4px 0 12px; border: 1px solid var(--bq-border);
  border-radius: var(--bq-radius-md); background: var(--bq-surface-2); transition: border-color .15s, box-shadow .15s; }
.bq-search:focus-within { border-color: var(--bq-accent); box-shadow: 0 0 0 3px var(--bq-focus-ring); }
.bq-search > .bq-icon { color: var(--bq-text-muted); }
.bq-search input[type="search"] { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; color: var(--bq-text); }
.bq-search input::placeholder { color: var(--bq-text-muted); opacity: 1; }
.bq-search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.bq-search .bq-scope { flex: none; }
.bq-search .bq-scope > summary { display: inline-flex; align-items: center; gap: 0.3rem; height: 30px; padding: 0 0.55rem; border: 1px solid var(--bq-border);
  border-radius: var(--bq-radius-sm); background: var(--bq-surface); color: var(--bq-text); font-size: var(--bq-fs-sm); cursor: pointer; white-space: nowrap; }
.bq-search .bq-scope .bq-menu-panel { max-height: 50vh; }
.bq-search .bq-kbd { flex: none; font: var(--bq-fs-label)/1 var(--bq-mono); padding: 3px 6px; border: 1px solid var(--bq-border-strong); border-radius: 4px; color: var(--bq-text-muted); }
.bq-search .bq-btn { min-height: 30px; }

/* Theme toggle: shows the icon of the theme it switches to. */
.bq-theme .bq-moon { display: inline; } .bq-theme .bq-sun { display: none; }
:root[data-theme="dark"] .bq-theme .bq-moon { display: none; }
:root[data-theme="dark"] .bq-theme .bq-sun { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .bq-theme .bq-moon { display: none; }
  :root:not([data-theme="light"]) .bq-theme .bq-sun { display: inline; }
}

/* Ad slots */
.bq-ad { display: flex; justify-content: center; padding: var(--bq-space-3) 0; }
.bq-ad:empty { display: none; }
.bq-ad img { max-width: 100%; height: auto; border-radius: var(--bq-radius-md); }

/* ---------- Page head ---------- */
.bq-crumbs { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem; font-size: var(--bq-fs-sm); color: var(--bq-text-muted); }
.bq-crumbs li { display: inline-flex; align-items: center; gap: 0.35rem; min-width: 0; max-width: 100%; }
.bq-crumbs li + li::before { content: "/"; opacity: 0.6; }
.bq-crumbs a { color: var(--bq-text-muted); }
.bq-crumbs a:hover { color: var(--bq-text); }
.bq-crumbs [aria-current] { color: var(--bq-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--bq-space-4) var(--bq-space-5);
  padding: var(--bq-space-5) 0 var(--bq-space-5); }
.bq-head-main { display: flex; flex-direction: column; gap: var(--bq-space-3); min-width: 0; flex: 1 1 520px; }
.bq-title { display: flex; align-items: center; gap: var(--bq-space-3); min-width: 0; }
.bq-title > img, .bq-title > .bq-net-icon { width: 40px; height: 40px; flex: none; }
.bq-title h1 { margin: 0; min-width: 0; font-size: var(--bq-fs-2xl); font-weight: 600; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
/* The network's name with a quiet "Blockchain Explorer" under it (shared/header/_network). */
.bq-title h1:has(.bq-title-kind) { display: flex; flex-direction: column; gap: 0.125rem; }
.bq-title-kind { color: var(--bq-text-muted); font-size: 0.9375rem; font-weight: 400; letter-spacing: 0; line-height: 1.3; }
.bq-title h1 .copy-text { font-family: var(--bq-mono); font-size: 0.72em; font-weight: 500; letter-spacing: -0.02em; }
/* In "Block 26342703" the number is the title, in the title's own size. */
.bq-title h1 .bq-title-id { display: flex; flex-wrap: wrap; align-items: center; gap: 0.125rem 0.75rem; }
.bq-title h1 .bq-title-id .copy-text { color: var(--bq-text) !important; font-size: 0.9375rem; font-weight: 400; letter-spacing: 0; }
.bq-title-net::before { content: "·"; margin-right: 0.75rem; color: var(--bq-text-muted); }
@media (max-width: 40rem) { .bq-title-net { flex-basis: 100%; } .bq-title-net::before { content: none; } }
.bq-title h1 .bq-title-name .copy-text { font-size: 0.92em; font-weight: 600; letter-spacing: -0.01em; }

/* Period (shared/_reportrange): a button with the period, a panel with Cally's
   range calendar (explorer/period). Without JS the panel has the From/To
   fields; with the calendar defined they are only the form's values. */
/* Filters of a transfer table (ethereum/address/_transfer_filters). */
.q-tf { padding: var(--bq-space-3) var(--bq-space-4); }
.q-tf-fields { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--bq-space-3); }
.q-tf-field { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0; border: 0; min-width: 0; font-size: var(--bq-fs-xs); color: var(--bq-text-muted); }
.q-tf-range { display: flex; gap: 6px; }
.q-tf-field input, .q-tf-field select { height: 36px; width: 7.5rem; padding: 0 0.55rem; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm);
  background: var(--bq-surface); color: var(--bq-text); font-size: var(--bq-fs-sm); }
.q-tf-token select { width: 15rem; }
.q-tf-token input { width: 24rem; max-width: 100%; font-family: var(--bq-mono); }
.q-tf-field select[name=sort] { width: 10rem; }
.q-tf-field input:focus-visible, .q-tf-field select:focus-visible { outline: none; border-color: var(--bq-accent); }
.q-tf-field.is-off, .q-tf-field :disabled { opacity: 0.45; cursor: not-allowed; }
.q-tf-field.is-off :disabled { opacity: 1; }
.q-tf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2) var(--bq-space-4); margin-top: var(--bq-space-3); font-size: var(--bq-fs-sm); }
.q-tf-check { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--bq-text); cursor: pointer; }
.q-tf-actions { display: flex; gap: var(--bq-space-2); margin-left: auto; }
.q-tf-error { flex-basis: 100%; margin: 0; color: var(--bq-danger); font-size: var(--bq-fs-xs); }
.q-labelled { display: inline-flex; align-items: center; max-width: 100%; min-width: 0; vertical-align: middle; }
.q-labelled > .q-mid { flex: 1 1 auto; min-width: 5.5rem; }
.q-labelled > .q-label { flex: 0 1 auto; min-width: 3rem; }
.q-label { display: inline-block; max-width: 11rem; margin-left: 0.4rem; padding: 0 0.4rem; overflow: hidden; vertical-align: middle;
  border-radius: 999px; background: var(--bq-surface-2); color: var(--bq-text-muted); font-size: var(--bq-fs-xs); line-height: 1.5;
  text-overflow: ellipsis; white-space: nowrap; }
.q-label-head { display: inline-flex; align-items: center; gap: 0.5rem; margin-left: 0.6rem; font-size: var(--bq-fs-sm); vertical-align: middle; }
.q-label-name { color: var(--bq-text); font-weight: 500; }
.q-filter-link { white-space: nowrap; font-size: var(--bq-fs-xs); }
/* The Transfers tab (ethereum/address/flows). */
.q-flow-stats.is-both { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--bq-space-4); }
.q-flow-stats.is-both .q-fig-grid, .q-flow-stats.is-both [class*="q-figures"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .q-flow-stats.is-both { grid-template-columns: minmax(0, 1fr); } }
.q-flow-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 var(--bq-space-4); align-items: start; }
@media (min-width: 1600px) { .q-flow-grid:not(.is-single) { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.q-seg { display: inline-flex; height: 36px; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm); overflow: hidden; }
.q-seg-item { display: inline-flex; align-items: center; padding: 0 0.85rem; color: var(--bq-text-muted); font-size: var(--bq-fs-sm); text-decoration: none; }
.q-seg-item + .q-seg-item { border-left: 1px solid var(--bq-border-strong); }
.q-seg-item:hover { color: var(--bq-text); background: var(--bq-surface-2); text-decoration: none; }
.q-seg-item.is-on { background: var(--bq-accent); color: var(--bq-accent-contrast); font-weight: 600; }
.q-tf-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2); margin-top: var(--bq-space-3); padding-top: var(--bq-space-3); border-top: 1px solid var(--bq-border); }
.q-chip { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.15rem 0.6rem; border: 1px solid var(--bq-border-strong); border-radius: 999px; color: var(--bq-text); font-size: var(--bq-fs-xs); text-decoration: none; }
.q-chip:hover { border-color: var(--bq-accent); text-decoration: none; }
.q-chip span { color: var(--bq-text-muted); }
.q-chip-clear { margin-left: auto; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-party { display: inline-flex; flex-direction: column; max-width: 100%; min-width: 0; line-height: 1.25; vertical-align: middle; }
.q-party-name { overflow: hidden; color: var(--bq-text); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.q-party .q-mid { font-size: var(--bq-fs-xs); }
.q-way { display: inline-block; min-width: 2.4rem; padding: 0 0.4rem; border-radius: 999px; font-size: var(--bq-fs-xs); text-align: center; }
.q-way-in { background: var(--bq-success-soft, rgba(46, 160, 67, 0.15)); color: var(--bq-success, #3fb950); }
.q-way-out { background: var(--bq-danger-soft); color: var(--bq-danger); }
.q-pager-num { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 30px; padding: 0 0.45rem;
  border: 1px solid var(--bq-border); border-radius: var(--bq-radius-sm); color: var(--bq-text); font-size: var(--bq-fs-xs); text-decoration: none; }
a.q-pager-num:hover { border-color: var(--bq-accent); text-decoration: none; }
.q-pager-num.is-current { border-color: var(--bq-accent); background: var(--bq-accent); color: var(--bq-accent-contrast); font-weight: 600; }
.q-pager-gap { color: var(--bq-text-muted); }
.q-noprice { color: var(--bq-text-muted); font-style: italic; }
.q-tf-tools { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); }
.q-tf-tools .bq-btn { gap: 0.35rem; }
/* Copy link reuses the copy buttons' script (.to-clipboard), not their icon-only look. */
.q-tf-tools .bq-btn.to-clipboard { position: relative; width: auto; height: auto; min-height: 30px; margin: 0; padding: 0 0.7rem;
  border: 1px solid var(--bq-border-strong); color: var(--bq-text); }
.q-tf-tools .bq-icon { width: 14px; height: 14px; }
.q-tf-locked { opacity: 0.7; }
.q-tf-locked-note { flex-basis: 100%; margin: 0; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-tf-summary { padding: 0.55rem var(--bq-space-4); border-bottom: 1px solid var(--bq-border); font-size: var(--bq-fs-sm); }
@media (max-width: 640px) { .q-tf-field, .q-tf-token select, .q-tf-field input { width: 100%; } .q-tf-range input { width: calc(50% - 3px); } .q-tf-actions { margin-left: 0; } }
/* Pages of a paged table (shared/query/_table, pager:). */
.q-pager { display: flex; align-items: center; gap: var(--bq-space-2); margin-left: auto; }
.q-pager-page { color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }

.q-period { position: relative; }
.q-period-menu > summary { list-style: none; }
.q-period-menu > summary::-webkit-details-marker { display: none; }
.q-period-button { min-height: 40px; gap: 0.5rem; padding: 0 0.85rem; font-weight: 500; }
.q-period-button > .bq-icon:first-child { color: var(--bq-text-muted); }
.q-period-days { padding: 0.1rem 0.45rem; border-radius: 999px; background: var(--bq-surface-2); color: var(--bq-text-muted);
  font-size: var(--bq-fs-xs); font-weight: 500; }
.q-period-days:empty { display: none; }
.q-period-caret { width: 16px; height: 16px; color: var(--bq-text-muted); transition: transform 0.15s; }
.q-period-menu[open] .q-period-caret { transform: rotate(180deg); }
.q-period-panel { display: flex; flex-direction: column; gap: var(--bq-space-3); width: max-content; max-width: calc(100vw - 2rem);
  max-height: none; padding: var(--bq-space-4); }
.q-period-fields { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); }
.q-period-panel:has(calendar-range:defined) .q-period-fields { display: none; }
calendar-range:not(:defined) { display: none; }
.q-period-field { display: flex; flex-direction: column; gap: 3px; margin: 0; font-size: var(--bq-fs-xs); color: var(--bq-text-muted); }
.q-period-field input { height: 34px; padding: 0 0.5rem; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm);
  background: var(--bq-surface); color: var(--bq-text); font-size: var(--bq-fs-sm); }
.q-period-field input:focus-visible { border-color: var(--bq-accent); }
.q-period-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--bq-space-3);
  padding-top: var(--bq-space-3); border-top: 1px solid var(--bq-border); }
.q-period-note { color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-period-apply:disabled { opacity: 0.5; cursor: not-allowed; }

/* The calendar: months side by side, days as round buttons, the period as a
   band between its ends. Cally's own sheet is styled through its parts. */
.q-period-calendar { --color-accent: var(--bq-accent); --color-text-on-accent: var(--bq-accent-contrast); color: var(--bq-text); }
.q-period-calendar::part(container) { gap: var(--bq-space-2); }
.q-period-calendar::part(header) { display: flex; align-items: center; justify-content: space-between; }
.q-period-calendar::part(heading) { font-weight: 600; }
.q-period-calendar::part(months) { display: flex; gap: var(--bq-space-5); }
.q-period-calendar::part(button previous), .q-period-calendar::part(button next) {
  display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm);
  background: var(--bq-surface); color: var(--bq-text); cursor: pointer; }
.q-period-calendar::part(button previous):hover, .q-period-calendar::part(button next):hover { border-color: var(--bq-accent); }
.q-period-calendar::part(disabled) { opacity: 0.35; cursor: default; }
.q-period-prev { transform: rotate(90deg); }
.q-period-next { transform: rotate(-90deg); }
.q-period-calendar calendar-month { color: var(--bq-text); }
.q-period-calendar calendar-month::part(heading) { font-weight: 600; }
.q-period-calendar calendar-month::part(th) { color: var(--bq-text-muted); font-size: var(--bq-fs-xs); font-weight: 500; }
.q-period-calendar calendar-month::part(button) { border-radius: 999px; cursor: pointer; font-size: var(--bq-fs-sm); }
.q-period-calendar calendar-month::part(button):hover { background: var(--bq-row-hover); }
.q-period-calendar calendar-month::part(today) { font-weight: 700; color: var(--bq-link); }
.q-period-calendar calendar-month::part(range-start) { border-radius: 999px 0 0 999px; }
.q-period-calendar calendar-month::part(range-end) { border-radius: 0 999px 999px 0; }
.q-period-calendar calendar-month::part(range-start range-end) { border-radius: 999px; }
.q-period-calendar calendar-month::part(selected) { background: var(--bq-accent); color: var(--bq-accent-contrast); }
.q-period-calendar calendar-month::part(selected):hover { background: var(--bq-accent-hover); color: var(--bq-accent-contrast); }
.q-period-calendar calendar-month::part(range-inner) { border-radius: 0; background: color-mix(in srgb, var(--bq-accent) 20%, transparent); color: var(--bq-text); }
.q-period-calendar calendar-month::part(range-inner):hover { background: color-mix(in srgb, var(--bq-accent) 32%, transparent); }
.q-period-calendar calendar-month::part(disallowed), .q-period-calendar calendar-month::part(outside) { opacity: 0.35; cursor: default; }

/* ---------- Section navigation ---------- */
.bq-sections { display: grid; grid-template-columns: 216px minmax(0, 1fr); gap: var(--bq-space-5); align-items: start; }
.bq-sections > .bq-content { min-width: 0; }
.bq-snav { position: sticky; top: calc(var(--bq-header-h) + var(--bq-space-4)); display: flex; flex-direction: column; gap: 2px;
  padding: var(--bq-space-2); border: 1px solid var(--bq-border); border-radius: var(--bq-radius-lg); background: var(--bq-surface); }
.bq-snav h2 { margin: var(--bq-space-3) 0.6rem var(--bq-space-1); font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bq-text-muted); }
.bq-snav h2:first-child { margin-top: var(--bq-space-1); }
.bq-snav a { display: flex; align-items: center; justify-content: space-between; gap: var(--bq-space-2); min-height: 36px; padding: 0.35rem 0.6rem;
  border-radius: var(--bq-radius-sm); color: var(--bq-text); font-weight: 500; line-height: 1.25; text-decoration: none; }
.bq-snav a:hover { background: var(--bq-surface-2); color: var(--bq-text); text-decoration: none; }
.bq-snav a[aria-current] { background: var(--bq-soft); color: var(--bq-text-active); font-weight: 600; box-shadow: inset 2px 0 0 var(--bq-accent); }
.bq-snav a .bq-icon { width: 12px; height: 12px; opacity: 0.7; }
/* A tool (shared/_tabs): its product's logo as an app icon, its name and a
   quiet line on what it does. DEXrabbit's and Money Flow's own full-colour
   marks (promo/, transparent, right on either theme); a product without one
   (MCP) gets its icon in white on the plum-to-ruby of the Bitquery mark. */
.bq-snav-tool { display: flex; align-items: center; gap: 10px; min-width: 0; }
.bq-snav-tool-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.bq-snav-tool-text small { font-size: var(--bq-fs-label); color: var(--bq-text-muted); }
.bq-snav-tool-text small:empty { display: none; }
.bq-snav-mark { display: grid; place-items: center; flex: none; width: 24px; height: 24px; }
.bq-snav-mark img { display: block; width: 24px; height: 24px; object-fit: contain; }
/* Money Flow's mark keeps a margin of 2 of its 32 units on each side (the
   corner card's file): drawn 32/28 larger, it is as big as DEXrabbit's. */
.bq-snav-logo-moneyflow { transform: scale(1.143); }
.bq-snav-mark-icon { border-radius: 7px; background: linear-gradient(135deg, #5a1a4f 0%, #bc2b5f 100%);
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 0.12); color: #fff; }
.bq-snav a .bq-snav-mark-icon .bq-icon { width: 14px; height: 14px; opacity: 1; fill: currentColor; stroke: none; }
.bq-snav .bq-snav-live { width: 7px; height: 7px; border-radius: 50%; background: var(--bq-teal); flex: none; }
.bq-snav .nav-item-ad, .bq-snav li { list-style: none; }
.bq-snav .nav-link-ad { display: flex; min-height: 36px; padding: 0.35rem 0.6rem; border-radius: var(--bq-radius-sm); background: var(--bq-teal-soft); color: var(--bq-teal-text); }

/* ---------- Cards ---------- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-lg);
  background: var(--bq-surface); box-shadow: var(--bq-shadow); overflow: hidden; }
.card-header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem var(--bq-space-3); padding: var(--bq-space-3) var(--bq-space-5);
  border-bottom: 1px solid var(--bq-border); font-size: var(--bq-fs-lg); font-weight: 600; line-height: 1.35; color: var(--bq-text-strong, var(--bq-text)); }
.card-header .small, .card-header small, .card-header .text-muted, .card-header .q-muted { font-size: var(--bq-fs-sm); font-weight: 400; }
.card-header img { width: 22px; height: 22px; }
.card-body { flex: 1 1 auto; padding: var(--bq-space-4) var(--bq-space-5); }
.card-footer { padding: 0.625rem var(--bq-space-5); border-top: 1px solid var(--bq-border); font-size: var(--bq-fs-sm); color: var(--bq-text-muted); }
.card-title { font-size: var(--bq-fs-lg); }
.card-text { color: var(--bq-text-muted); }

/* A server-rendered block: its card or message, then "Get API" / "Get Stream"
   as the card's last row (QueryBlocksHelper). */
.q-block { margin-bottom: var(--bq-space-5); }
.q-block > .card, .q-block > .alert { margin-bottom: 0 !important; }
.q-block > :first-child:not(:last-child) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.q-api-buttons { display: flex; justify-content: flex-end; gap: var(--bq-space-2); padding: var(--bq-space-2) var(--bq-space-4);
  border: 1px solid var(--bq-border); border-top: 0; border-radius: 0 0 var(--bq-radius-lg) var(--bq-radius-lg); background: var(--bq-surface-2); }
.q-api-buttons form { margin: 0; }
/* Live and Mempool (shared/query/_live) join the IDE buttons in one row, set
   a little apart; the live status goes on a line of its own under the row.
   It ticks every second, so it is in the monospace font (DM Sans has no
   tabular digits) and keeps its width. Overrides the inline group of live.css. */
.q-api-buttons { flex-wrap: wrap; align-items: center; }
.q-api-buttons .q-live:not([hidden]) { display: contents; }
.q-api-buttons .q-live button { order: -1; min-height: 30px; font-size: var(--bq-fs-sm); }
.q-api-buttons .q-live button:last-of-type { margin-right: var(--bq-space-2); }
.q-api-buttons .q-live-status { order: 1; flex-basis: 100%; text-align: right; font-family: var(--bq-mono);
  font-size: var(--bq-fs-xs); color: var(--bq-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  contain: inline-size; } /* its text does not widen the row: the buttons stay next to the title */
.q-api-buttons .q-live-status:empty { display: none; }
/* The title stays level with the row of buttons, the status hangs below. */
.card-header:has(.q-live:not([hidden])) { align-items: baseline; }
.q-api-buttons .bq-btn:not(.bq-btn-cta) .bq-icon { color: var(--bq-teal-text); }
/* In the card header: the block's call to action, on the right of its title. */
.card-header .q-api-buttons { margin-left: auto; padding: 0; border: 0; border-radius: 0; background: none; }
.card-header:has(.q-api-buttons) { align-items: center; padding-top: var(--bq-space-2); padding-bottom: var(--bq-space-2); padding-right: var(--bq-space-4); }
.card-header .q-api-buttons .bq-btn { font-size: var(--bq-fs-sm); }

/* "↑ N new rows" over a live table read further down (live.css places it). */
.q-live-more button { min-height: 34px; padding: 0 var(--bq-space-4); font: 600 var(--bq-fs-sm)/1 var(--bq-font);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--bq-accent) 25%, transparent), 0 6px 18px rgba(0, 0, 0, 0.35); }

/* ---------- Back to top (layouts/application, explorer/to_top) ---------- */
.bq-to-top { position: fixed; right: var(--bq-space-5); bottom: var(--bq-space-5); z-index: 40; display: grid; place-items: center;
  width: 44px; height: 44px; border: 1px solid var(--bq-border-strong); border-radius: 50%; background: var(--bq-elevated);
  color: var(--bq-text); box-shadow: var(--bq-shadow); opacity: 0; visibility: hidden; transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s, visibility 0s 0.2s; }
.bq-to-top.is-shown { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
.bq-to-top:hover { border-color: var(--bq-accent); color: var(--bq-accent-contrast); background: var(--bq-accent); text-decoration: none; }
.bq-to-top .bq-icon { width: 20px; height: 20px; }
/* Above the HubSpot chat bubble where it shows. */
body:has(#hubspot-messages-iframe-container) .bq-to-top { bottom: 96px; }

/* ---------- Tables ---------- */
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; margin-bottom: var(--bq-space-4); color: var(--bq-text); font-size: var(--bq-fs-table); font-variant-numeric: tabular-nums; }
.table > :not(caption) > * > * { padding: 0.6rem 0.875rem; border-bottom: 1px solid var(--bq-border); vertical-align: middle; }
.table-sm > :not(caption) > * > * { padding: 0.5rem 0.75rem; }
.table th:first-child, .table td:first-child { padding-left: var(--bq-space-5); }
.table th:last-child, .table td:last-child { padding-right: var(--bq-space-5); }
.table > thead > tr > th, .table > thead > tr > td { position: sticky; top: 0; background: var(--bq-surface-2); color: var(--bq-text-muted);
  font-size: var(--bq-fs-xs); font-weight: 500; text-align: left; white-space: nowrap; }
.table > thead > tr > th.text-end { text-align: right; }
.table > tbody > tr:last-child > * { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { background: var(--bq-row-hover); }
.table-striped > tbody > tr:nth-of-type(odd) > * { background: var(--bq-surface-2); }
.table th[scope="row"] { font-weight: 400; text-align: left; color: var(--bq-text-muted); }
.table th { text-align: left; }
.card .table { margin-bottom: 0; }
.table .text-truncate { max-width: 16rem; }
.table a { overflow-wrap: anywhere; }
.table td.font-monospace, .table .font-monospace { font-size: 0.9em; }
.q-usd { color: var(--bq-usd); font-weight: 500; }
/* An amount with its USD value raised after it, like an exponent (QueryTableHelper#cell_amount). */
.q-amount { white-space: nowrap; }
/* Numbers (NumberTagHelper#number_tag): digits of one width; the count of
   collapsed zeros (0.0₆105) small and low. The raw value shows in .bq-tip
   (explorer/value_tip), like the whole of an address (.q-mid). */
.q-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-num-zeros { margin: 0 0.05em; font-size: 0.72em; line-height: 0; vertical-align: -0.3em; }
.bq-tip { position: fixed; z-index: 90; max-width: min(92vw, 34rem); padding: 0.3rem 0.55rem; border-radius: var(--bq-radius-sm, 4px);
  background: var(--bq-text); color: var(--bq-surface); font: 500 var(--bq-fs-xs)/1.4 var(--bq-mono); overflow-wrap: anywhere;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); pointer-events: none; }
.bq-tip[hidden] { display: none; }
sup.q-usd { margin-left: 0.3em; font-size: 0.8em; line-height: 0; vertical-align: 0.6em; }

/* ---------- Badges, alerts, lists ---------- */
.badge, .bq-badge { display: inline-flex; align-items: center; gap: 0.3rem; min-height: 22px; padding: 0 0.5rem; border-radius: var(--bq-radius-sm);
  background: var(--bq-surface-3); color: var(--bq-text); font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; vertical-align: 0.1em; }
.bq-badge-ok { background: var(--bq-success-soft); color: var(--bq-success); }
.bq-badge-fail { background: var(--bq-danger-soft); color: var(--bq-danger); }
.bq-badge-kind { background: var(--bq-soft); color: var(--bq-text-active); }
.alert { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2) var(--bq-space-3); padding: var(--bq-space-4) var(--bq-space-5);
  border: 1px solid var(--bq-border); border-radius: var(--bq-radius-lg); background: var(--bq-surface); color: var(--bq-text); }
.alert::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--bq-text-muted); flex: none; }
.alert-light::before { background: var(--bq-border-strong); }
.alert-warning { border-color: color-mix(in srgb, var(--bq-warning) 35%, var(--bq-border)); }
.alert-warning::before { background: var(--bq-warning); }
.alert-info::before { background: var(--bq-teal); }
.alert-link { font-weight: 600; }
.list-group { display: flex; flex-direction: column; padding: 0; margin: 0; list-style: none; }
.list-group-item { display: flex; align-items: center; gap: var(--bq-space-2); padding: 0.6rem var(--bq-space-5); border-bottom: 1px solid var(--bq-border); }
.list-group-flush > .list-group-item:last-child { border-bottom: 0; }
.list-group-item img { width: 22px; height: 22px; }

/* Breadcrumb (legacy markup) */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 0.35rem; padding: 0; margin: 0; list-style: none; }
.breadcrumb-item + .breadcrumb-item::before { content: "/"; padding-right: 0.35rem; color: var(--bq-text-muted); }

/* ---------- Address / hash with copy (ApplicationHelper#copy_text) ---------- */
.copy-text { display: inline; overflow-wrap: anywhere; }
.to-clipboard { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; margin-left: 2px; padding: 0; border: 0;
  border-radius: var(--bq-radius-sm); background: transparent; color: var(--bq-text-muted) !important; vertical-align: middle; cursor: pointer; position: relative; }
.to-clipboard:hover { background: var(--bq-surface-2); color: var(--bq-text) !important; text-decoration: none; }
.to-clipboard .bq-icon { width: 15px; height: 15px; }
.to-clipboard[data-copied]::after { content: "Copied"; position: absolute; bottom: calc(100% + 4px); left: 50%; transform: translateX(-50%);
  padding: 2px 8px; border-radius: var(--bq-radius-sm); background: var(--bq-text); color: var(--bq-bg); font: 500 var(--bq-fs-xs)/1.6 var(--bq-font); white-space: nowrap; }
.bq-mono { font-family: var(--bq-mono); font-size: 0.92em; }
/* Head actions: the previous/next block links (ApplicationHelper#block_nav)
   and the period form, on the right of the page head. */
.bq-head-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-3); }
.block-nav { display: inline-flex; gap: var(--bq-space-2); }
.block-nav-btn { display: inline-flex; align-items: center; gap: 0.375rem; height: 36px; padding: 0 0.75rem; border: 1px solid var(--bq-border);
  border-radius: var(--bq-radius-sm); background: var(--bq-surface); color: var(--bq-text) !important; font: 500 var(--bq-fs-sm)/1 var(--bq-mono);
  text-decoration: none !important; white-space: nowrap; }
.block-nav-btn:hover { background: var(--bq-surface-2); border-color: var(--bq-text-muted); }
.block-nav-btn:focus-visible { outline: 2px solid var(--bq-link); outline-offset: 2px; }
.block-nav-btn .bq-icon { width: 16px; height: 16px; color: var(--bq-text-muted); }


/* ---------- Loading skeleton (shared/query/_lazy) ---------- */
.placeholder { display: inline-block; min-height: 0.9rem; border-radius: 6px; background: var(--bq-surface-3); }
.placeholder.col-2 { width: 16%; } .placeholder.col-3 { width: 24%; } .placeholder.col-4 { width: 32%; } .placeholder.col-5 { width: 40%; }
.placeholder-glow .placeholder { animation: bq-glow 1.6s ease-in-out infinite; }
@keyframes bq-glow { 50% { opacity: 0.45; } }
.q-skeleton .card-body > div { display: flex; gap: var(--bq-space-4); margin-bottom: var(--bq-space-3); }
/* A frame reloading on Try again or stale data: the card's data veiled and
   blurred, and the block's loader over it (explorer/loader: the query's name
   and a resolving value, or a line drawing itself over a chart). The header
   stays above the veil, so Get API / Get Stream can always be clicked. A live
   update (src with live=, explorer/live) swaps the rows in place without either.
   Without the script, a spinner. */
turbo-frame[busy]:not([src*="live="]) > .q-block > .card > .card-header { position: relative; z-index: 7; background: var(--bq-surface); }
turbo-frame[busy]:not([src*="live="]) > .q-block > .card:not(.q-skeleton)::before {
  content: ""; position: absolute; inset: 0; z-index: 5; border-radius: inherit;
  background: color-mix(in srgb, var(--bq-surface) 74%, transparent);
  -webkit-backdrop-filter: blur(4px) saturate(0.5); backdrop-filter: blur(4px) saturate(0.5); }
turbo-frame[busy]:not([src*="live="]) > .q-block > .card:not(.q-skeleton):not(:has(> .q-loader))::after {
  content: ""; position: absolute; z-index: 6; top: min(calc(50% + 1.5rem - 20px), calc(45vh - 20px)); left: calc(50% - 20px); width: 40px; height: 40px;
  border: 3px solid color-mix(in srgb, var(--bq-text) 14%, transparent); border-top-color: var(--bq-link); border-radius: 50%;
  animation: bq-spin 0.8s linear infinite; }
.q-loader { position: absolute; z-index: 6; left: 0; right: 0; top: var(--q-loader-top, 0); height: min(calc(100% - var(--q-loader-top, 0px)), 22rem);
  display: flex; align-items: center; justify-content: center; pointer-events: none; animation: q-loader-in 0.25s ease-out; }
@keyframes q-loader-in { from { opacity: 0; } }
.q-loader-label { font: 500 0.6875rem/1.4 var(--bq-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bq-text-muted); }
.q-loader-box { display: flex; flex-direction: column; align-items: center; gap: 0.375rem; max-width: calc(100% - 2rem); text-align: center; }
.q-loader-value { font: 400 0.9375rem/1.4 var(--bq-mono); color: var(--bq-text); letter-spacing: 0.02em; white-space: nowrap; }
.q-loader-value i { font-style: normal; color: var(--bq-link); }
.q-loader-hair { position: relative; width: 11rem; height: 1px; margin-top: 0.25rem; overflow: hidden; background: var(--bq-border); }
.q-loader-hair::after { content: ""; position: absolute; top: 0; bottom: 0; left: -4rem; width: 4rem;
  background: linear-gradient(90deg, transparent, var(--bq-link), transparent); animation: q-loader-hair 1.8s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes q-loader-hair { to { left: 11rem; } }
.q-loader-chart { align-items: stretch; padding: 1.25rem 1.5rem; }
.q-loader-chart .q-loader-label { position: absolute; top: 0.75rem; right: 1rem; }
.q-loader-plot { display: block; width: 100%; height: 100%; overflow: visible; }
.q-loader-grid { stroke: var(--bq-border); stroke-width: 1; }
.q-loader-bar { fill: var(--bq-chart-1); opacity: calc(0.55 * var(--q-loader-fade, 1)); }
.q-loader-line.is-driven { animation: none; opacity: var(--q-loader-fade, 1); }
.q-loader-line { fill: none; stroke: var(--bq-link); stroke-width: 2; stroke-linecap: round;
  stroke-dasharray: 100; animation: q-loader-draw 2.6s cubic-bezier(0.65, 0, 0.35, 1) infinite; }
@keyframes q-loader-draw { 0% { stroke-dashoffset: 100; opacity: 1; } 55% { stroke-dashoffset: 0; } 75% { stroke-dashoffset: 0; opacity: 1; } 100% { stroke-dashoffset: 0; opacity: 0; } }
/* Over a first-load skeleton the placeholder rows fade back behind it. */
.q-skeleton:has(> .q-loader) .card-body { opacity: 0.35; filter: blur(2px); }
@media (prefers-reduced-motion: reduce) {
  .q-loader, .q-loader-hair::after { animation: none; }
  .q-loader-line { animation: none; stroke-dashoffset: 0; opacity: 0.6; }
}

/* ---------- Forms (legacy) ---------- */
.form-control { width: 100%; height: 36px; padding: 0 0.6rem; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-sm); background: var(--bq-surface); color: var(--bq-text); }

/* ---------- Footer ---------- */
.bq-footer { margin-top: auto; border-top: 1px solid var(--bq-border); background: var(--bq-surface); padding: var(--bq-space-6) 0 var(--bq-space-5); font-size: var(--bq-fs-sm); }
.bq-footer-cols { display: grid; grid-template-columns: 1.3fr repeat(4, minmax(0, 1fr)); gap: var(--bq-space-5); }
.bq-footer h2 { margin: 0 0 var(--bq-space-3); font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--bq-text-muted); }
.bq-footer ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.bq-footer a { color: var(--bq-text); }
.bq-footer a:hover { color: var(--bq-link); }
.bq-footer p { color: var(--bq-text-muted); max-width: 300px; }
.bq-footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--bq-space-3); margin-top: var(--bq-space-5); padding-top: var(--bq-space-4);
  border-top: 1px solid var(--bq-border); color: var(--bq-text-muted); }
.bq-footer-bottom a { color: var(--bq-text-muted); }

/* ---------- Home ---------- */
.bq-eyebrow { font: 500 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.14em; text-transform: uppercase; color: var(--bq-teal-text); }
.bq-nets { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: var(--bq-space-3); margin: 0; padding: 0; list-style: none; }
.bq-net { display: flex; align-items: center; gap: var(--bq-space-3); min-height: 64px; padding: var(--bq-space-3) var(--bq-space-4); border: 1px solid var(--bq-border);
  border-radius: var(--bq-radius-lg); background: var(--bq-surface); box-shadow: var(--bq-shadow); color: var(--bq-text) !important; text-decoration: none !important;
  transition: border-color .15s, background-color .15s, transform .15s; }
.bq-net:hover { border-color: var(--bq-border-strong); background: var(--bq-surface-2); }
.bq-net img { width: 32px; height: 32px; object-fit: contain; flex: none; }
.bq-net b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bq-net small { display: block; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.bq-net .bq-badge { margin-left: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1199.98px) {
  .bq-snav-tool-text small { display: none; }
  .bq-snav-mark, .bq-snav-mark img { width: 20px; height: 20px; }
  .bq-sections { grid-template-columns: minmax(0, 1fr); gap: var(--bq-space-4); }
  .bq-snav { position: static; flex-direction: row; overflow-x: auto; scrollbar-width: none; padding: 4px; gap: 2px; border-radius: var(--bq-radius-md);
    mask-image: linear-gradient(90deg, #000 calc(100% - 32px), transparent); }
  .bq-snav::-webkit-scrollbar { display: none; }
  .bq-snav h2 { display: none; }
  .bq-snav a { flex: none; white-space: nowrap; min-height: 36px; }
  .bq-snav a[aria-current] { box-shadow: inset 0 -2px 0 var(--bq-accent); }
  .bq-snav .bq-snav-sep { width: 1px; flex: none; margin: 8px 4px; background: var(--bq-border); }
  .bq-footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bq-footer-cols > :first-child { grid-column: 1 / -1; }
}
@media (min-width: 1200px) { .bq-snav .bq-snav-sep { display: none; } }
@media (max-width: 767.98px) {
  .wrap, .container-fluid { padding-inline: var(--bq-space-4); }
  .row { margin-inline: calc(var(--bq-space-4) / -2); }
  .row > * { padding-inline: calc(var(--bq-space-4) / 2); }
  /* Two rows on a phone (logo and controls, then search): 8 + 36 + 8 + 40 + 8
     and the border. Sticky things below the header and the scroll padding
     go by --bq-header-h. */
  :root { --bq-header-h: 101px; }
  .bq-header-in { flex-wrap: wrap; gap: var(--bq-space-2) var(--bq-space-3); padding-block: var(--bq-space-2); min-height: 0; }
  .bq-header .search-form { order: 5; flex-basis: 100%; max-width: none; }
  .bq-header .bq-kbd, .bq-header .bq-scope, .bq-header .bq-cta-wide, .bq-netsw .bq-netsw-name, .bq-logo small { display: none; }
  .bq-netsw .bq-menu-panel { position: fixed; left: var(--bq-space-3); right: var(--bq-space-3); top: auto; width: auto; }
  .bq-ad { display: none; }
  .bq-head { padding-top: var(--bq-space-4); }
  .bq-title h1 { font-size: 1.25rem; }
  .bq-title > img, .bq-title > .bq-net-icon { width: 32px; height: 32px; }
  .q-period, .q-period-button { width: 100%; }
  .q-period-button .q-period-caret { margin-left: auto; }
  .bq-menu-panel.q-period-panel { position: fixed; left: var(--bq-space-3); right: var(--bq-space-3); top: auto; width: auto; max-width: none; }
  .q-period-calendar { margin: 0 auto; }
  .q-period-field { flex: 1 1 120px; }
  .card-header, .card-body, .alert { padding-inline: var(--bq-space-4); }
  .bq-to-top { right: var(--bq-space-4); bottom: var(--bq-space-4); }
  /* On a phone the buttons go under the title: from the left, like it. */
  .card-header .q-api-buttons { margin-left: 0; justify-content: flex-start; }
  /* From the left nothing before the time moves, so the narrower text font
     fits the status on one line. */
  .card-header .q-api-buttons .q-live-status { text-align: left; font-family: var(--bq-font); }
  /* Live and Mempool in a row of their own, the IDE buttons under them. */
  .q-api-buttons:has(.q-live:not([hidden])) .q-live button { order: -2; }
  .q-api-buttons:has(.q-live:not([hidden]))::before { content: ""; order: -1; flex-basis: 100%; }
  .table th:first-child, .table td:first-child { padding-left: var(--bq-space-4); }
  .table th:last-child, .table td:last-child { padding-right: var(--bq-space-4); }
        .bq-nets { grid-template-columns: minmax(0, 1fr); gap: var(--bq-space-2); }
}
@media (max-width: 479.98px) {
  .bq-netsw-groups { grid-template-columns: minmax(0, 1fr); }
  .bq-netsw-group ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--bq-space-1); }
  .bq-netsw-panel li a small { display: none; }
  .bq-footer-cols { grid-template-columns: minmax(0, 1fr); }
}

/* Breadcrumbs row, above every page head */
.bq-crumbs-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bq-space-2) var(--bq-space-5); padding-top: var(--bq-space-5); }
.bq-crumbs-row + * .bq-head, .bq-crumbs-row + .bq-head { padding-top: var(--bq-space-3); }
.bq-crumbs-row nav { min-width: 0; }
/* The news keeps to the right, also on a page without breadcrumbs (the home page). */
.bq-crumbs-row > .bq-news { margin-left: auto; }
/* The Bitquery news (shared/_crumbs, explorer/news): a see-through pill in a quiet hairline
   frame, along which a short beam in the logo's colours (orange, pink, violet) slowly travels
   round (.bq-news-ring: the frame's ring, its beam moving on an offset-path; browsers without
   offset-path keep the plain frame); inside, a "News" label in the orange with a live dot,
   then one post at a time: its date, quiet, its title in the text colour, an arrow in the
   violet. The posts sit in one cell, so the pill is as wide as the longest one and nothing
   moves when the next comes up from below. The current post's link covers the whole pill. On
   a phone it takes its own line, the title cut with an ellipsis. The orange and violet text:
   4.8:1 and more on the page in both themes. */
.bq-news { --news-a: #e8691f; --news-b: #d6265a; --news-c: #8a33c2; --news-label: #c2410c; --news-arrow: #8a33c2; --news-fill: var(--bq-bg);
  position: relative; display: inline-flex; align-items: center; gap: var(--bq-space-2); min-width: 0; max-width: 100%;
  padding: 0.25rem 0.85rem 0.25rem 0.35rem; border: 1px solid var(--bq-border-strong); border-radius: 999px; background: var(--news-fill);
  font-size: var(--bq-fs-sm); transition: background-color 0.15s; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bq-news { --news-a: #ff8a3d; --news-b: #f0436f; --news-c: #a24bd6; --news-label: #ff9b6a; --news-arrow: #c48cf0; } }
:root[data-theme="dark"] .bq-news { --news-a: #ff8a3d; --news-b: #f0436f; --news-c: #a24bd6; --news-label: #ff9b6a; --news-arrow: #c48cf0; }
.bq-news-ring { position: absolute; inset: -1px; padding: 1px; border-radius: inherit; overflow: hidden; pointer-events: none;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0); }
.bq-news-ring > span { position: absolute; top: 0; left: 0; width: 9rem; height: 6px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--news-c), var(--news-b), var(--news-a));
  offset-path: inset(0.5px round 999px); offset-rotate: auto; animation: bq-news-beam 14s linear infinite; }
@supports not (offset-path: inset(0 round 1px)) { .bq-news-ring { display: none; } }
@keyframes bq-news-beam { from { offset-distance: 0%; } to { offset-distance: 100%; } }
.bq-news:hover { --news-fill: color-mix(in srgb, var(--news-b) 7%, var(--bq-bg)); }
.bq-news:has(.bq-news-item:focus-visible) { box-shadow: 0 0 0 3px var(--bq-focus-ring); }
.bq-news-badge { display: inline-flex; flex: none; align-items: center; gap: 0.45rem; min-height: 22px; padding: 0 0.35rem 0 0.45rem;
  color: var(--news-label); font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.08em; text-transform: uppercase; }
.bq-news-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--news-a);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--news-a) 60%, transparent); animation: bq-news-live 2s ease-out infinite; }
@keyframes bq-news-live { 70%, to { box-shadow: 0 0 0 5px color-mix(in srgb, var(--news-a) 0%, transparent); } }
.bq-news-reel { display: grid; min-width: 0; overflow: hidden; }
.bq-news-item { grid-area: 1 / 1; display: flex; align-items: center; gap: var(--bq-space-2); min-width: 0; color: var(--bq-text) !important; text-decoration: none !important;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s, visibility 0s 0.5s; }
.bq-news-item:not(.is-current) { visibility: hidden; opacity: 0; transform: translateY(120%); }
.bq-news-item.is-leaving { transform: translateY(-120%); }
.bq-news-item.is-current { transition-delay: 0s; }
.bq-news-item::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.bq-news-date { flex: none; color: var(--bq-text-muted); font: 500 var(--bq-fs-xs)/1 var(--bq-mono); text-transform: uppercase; letter-spacing: 0.04em; }
.bq-news-title { flex: 1 1 auto; min-width: 0; overflow: hidden; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.bq-news:hover .bq-news-title { text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--news-b) 60%, transparent); text-underline-offset: 3px; }
.bq-news-item .bq-icon { flex: none; width: 14px; height: 14px; color: var(--news-arrow); transition: transform 0.15s; }
.bq-news:hover .bq-news-item .bq-icon { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) {
  .bq-news-ring > span, .bq-news-badge::before { animation: none; }
  .bq-news-ring > span { offset-distance: 4%; }
  .bq-news-item { transition: none; }
}
.grow { flex: 1 1 auto; }

/* Network landing intro (shared/_network_intro) */
.bq-intro h2 { margin: 0 0 var(--bq-space-3); color: var(--bq-text-strong); font-size: var(--bq-fs-lg); }
.bq-intro p { max-width: 900px; color: var(--bq-text); }
/* The page in words (shared/_page_text): quiet, under the data. */
.bq-page-text { margin: var(--bq-space-5) 0 var(--bq-space-4); padding-top: var(--bq-space-4); border-top: 1px solid var(--bq-border); color: var(--bq-text); font-size: var(--bq-fs-sm); }
.bq-page-text h2 { margin: 0 0 var(--bq-space-3); color: var(--bq-text-strong); font-size: var(--bq-fs-md); font-weight: 600; }
.bq-page-text h3 { margin: var(--bq-space-4) 0 var(--bq-space-2); color: var(--bq-text-strong); font-size: var(--bq-fs-sm); font-weight: 600; }
.bq-page-text p { max-width: 760px; overflow-wrap: anywhere; }
.bq-faq { max-width: 760px; border-top: 1px solid var(--bq-border); }
.bq-faq:last-of-type { border-bottom: 1px solid var(--bq-border); }
.bq-faq summary { padding: var(--bq-space-2) 0; cursor: pointer; color: var(--bq-text-strong); overflow-wrap: anywhere; }
.bq-faq p { margin: 0 0 var(--bq-space-3); }
.bq-page-text-links { display: flex; flex-wrap: wrap; gap: var(--bq-space-2) var(--bq-space-4); margin: var(--bq-space-3) 0 0; }
/* Cells grow to fill their row, whatever the number of facts: no empty cell. */
.bq-facts { display: flex; flex-wrap: wrap; gap: 1px; margin: var(--bq-space-4) 0 0;
  border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); background: var(--bq-border); overflow: hidden; }
.bq-facts > div { flex: 1 1 200px; padding: var(--bq-space-3) var(--bq-space-4); background: var(--bq-surface); }
.bq-facts dt { font-size: var(--bq-fs-xs); font-weight: 400; color: var(--bq-text-muted); }
.bq-facts dd { margin: 2px 0 0; font-weight: 600; }
.bq-snav .nav-item-ad { margin-top: var(--bq-space-2); }
.bq-snav .nav-link-ad { justify-content: space-between; gap: var(--bq-space-2); font-weight: 500; text-decoration: none; }
.bq-ad-mark { font: 600 var(--bq-fs-label)/1 var(--bq-mono); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.75; }
@media (max-width: 1199.98px) { .bq-snav .nav-item-ad { margin: 0 0 0 4px; flex: none; } .bq-snav .nav-link-ad { white-space: nowrap; } }

.bq-hash, .table .font-monospace { font-family: var(--bq-mono); font-size: 0.9em; letter-spacing: -0.01em; }
/* Addresses and hashes (ExplorerLinksHelper#hash_parts): as the cell narrows
   an ellipsis takes the middle; the start (7 characters at least) and the
   last characters always show. A grid, so a table sees two sizes: the whole value at most, 7 characters
   and the tail at least, and gives it what room it has between them. */
.q-mid { display: inline-grid; grid-template-columns: minmax(7ch, max-content) max-content; max-width: 100%;
  vertical-align: bottom; white-space: nowrap; }
.q-mid-head { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.q-cell-hash { white-space: nowrap; }

/* Tabs between blocks (QueryTabsHelper): in the card header of the shown
   block, or above its message when it has none. With scripting only the
   chosen block shows (explorer/tabs.js); without, they stand in a column. */
.q-tabs-list { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem var(--bq-space-4); }
.q-tab { margin-bottom: -2px; padding-bottom: 0.125rem; border-bottom: 2px solid transparent; color: var(--bq-text-muted); text-decoration: none; }
.q-tab:hover { color: var(--bq-text); text-decoration: none; }
.q-tab[aria-selected="true"] { border-bottom-color: var(--bq-accent); color: var(--bq-text); }
.q-tabs-alone { margin-bottom: var(--bq-space-3); font-weight: 600; }
/* On a phone the tabs keep to one line and scroll sideways. */
@media (max-width: 40rem) {
  .q-tabs-list { flex-wrap: nowrap; max-width: 100%; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
}
.q-tab-panel:has(.card-header) > .q-tabs-alone { display: none; }
@media (scripting: enabled) {
  .q-tab-panel:not(.is-active) { display: none; }
}

/* A value drawn as a bar behind it, as long as it is to its column's largest
   (shared/query/_table, `bar: true`); from the right, like the numbers. */
.q-cell-bar { min-width: 9rem; background: linear-gradient(to left, color-mix(in srgb, var(--bq-link) 30%, transparent) var(--q-bar), transparent var(--q-bar)) no-repeat;
  background-size: calc(100% - 1.5rem) 3px; background-position: center bottom 0.3rem; }

/* Key figures (shared/query/_figures): labelled values in a row under the
   block's card header, set apart by short hairlines. All start at the top, so
   the labels and the values each keep one line across the row; what goes
   with a value (its USD, a clock, the other count) is quieter and under or
   after it. One row on a wide screen, --q-cols-md columns on a narrower one,
   two on a phone; the spans (QueryTableHelper#figure_layout) leave no holes.
   Each figure draws the hairline on its left and the one above it; the list
   clips those of its first column and first row. */
.q-figs { display: grid; grid-template-columns: repeat(var(--q-cols), minmax(0, 1fr)); margin: 0; overflow: hidden; }
.q-fig { position: relative; grid-column: span var(--q-span, 1); display: flex; flex-direction: column; gap: 0.4rem; min-width: 0;
  padding: 1.125rem var(--bq-space-5) 1.25rem; }
.q-fig::before, .q-fig::after { content: ""; position: absolute; background: var(--bq-border); }
.q-fig::before { top: 1.125rem; bottom: 1.25rem; left: -1px; width: 1px; }
.q-fig::after { top: -1px; right: var(--bq-space-5); left: var(--bq-space-5); height: 1px; }
.q-fig dt { overflow: hidden; color: var(--bq-text-muted); font: 500 var(--bq-fs-xs)/1.25 var(--bq-font); text-overflow: ellipsis; white-space: nowrap; }
.q-fig dt.q-fig-hint { cursor: help; text-decoration: underline dotted color-mix(in srgb, currentColor 45%, transparent); text-underline-offset: 3px; }
.q-fig dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.5rem; margin: 0; }
.q-fig-value { min-width: 0; color: var(--bq-text-strong); font-size: 1.5rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; }
.q-fig-value a { color: inherit; }
.q-fig-value a:hover { color: var(--bq-link); }
.q-fig-second { color: var(--bq-text-muted); font-size: 0.75em; font-weight: 500; letter-spacing: 0; }
.q-fig-second { white-space: nowrap; }
.q-fig-second a, .q-fig-second .q-num { color: inherit; }
/* An amount's USD value under it, a time's clock likewise: grey, not the
   green of USD in tables, which here would read as a rise. */
.q-fig sup.q-usd, .q-fig .q-time-clock { display: block; margin: 0.3rem 0 0; color: var(--bq-text-muted); font-size: var(--bq-fs-sm);
  font-weight: 500; letter-spacing: 0; line-height: 1.3; vertical-align: baseline; }
.q-fig-value .q-usd { color: inherit; }
.q-fig .q-time-sep { display: none; }
.q-fig .q-change-pct { align-self: center; padding: 0.15rem 0.45rem; border-radius: var(--bq-radius-pill); font-size: var(--bq-fs-xs);
  font-weight: 600; letter-spacing: 0; line-height: 1.2; }
.q-fig .q-usage { margin-top: 0.5rem; }
.q-fig-note { display: block; margin-top: 0.4rem; color: var(--bq-text-muted); font-size: var(--bq-fs-sm); font-weight: 500; letter-spacing: 0; line-height: 1.3; }
.q-fig-note .q-num { color: inherit; }
/* The page's main figure: larger, two columns wide. */
.q-fig-lead .q-fig-value { font-size: 2rem; letter-spacing: -0.025em; line-height: 1.1; }
.q-fig-lead .q-change-pct { font-size: var(--bq-fs-sm); }
@media (max-width: 80rem) {
  .q-figs { grid-template-columns: repeat(var(--q-cols-md), minmax(0, 1fr)); }
  .q-fig { grid-column: span var(--q-span-md, 1); }
}
@media (max-width: 40rem) {
  .q-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .q-fig { grid-column: span var(--q-span-sm, 1); padding: var(--bq-space-4); }
  .q-fig::before { top: var(--bq-space-4); bottom: var(--bq-space-4); }
  .q-fig::after { right: var(--bq-space-4); left: var(--bq-space-4); }
  .q-fig-value { font-size: 1.25rem; }
  .q-fig-lead .q-fig-value { font-size: 1.625rem; }
}

/* Times (TimeTagHelper): a readable date, its time a step quieter; in a live
   block "12 s ago" (explorer/time_ago.js), in a box wide enough for its
   longest form, so the column does not move as the seconds pass. */
.q-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.q-time-sep { color: var(--bq-text-muted); }
.q-time-ago { display: inline-block; min-width: 8.5ch; }
@media (max-width: 767.98px) { .bq-crumbs-row { padding-top: var(--bq-space-4); } }
.bq-results { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.bq-results .bq-net > span { min-width: 0; flex: 1 1 auto; }
.bq-results .bq-net > .bq-icon { color: var(--bq-text-muted); }

/* A long table shows its first rows; the "Show all" checkbox shows the rest (shared/query/_table). */
.q-table-note { color: var(--bq-text-muted); font-size: var(--bq-fs-sm); }
.q-table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bq-space-2) var(--bq-space-4); }
.q-collapsible:not(:has(.q-more-toggle input:checked)) .q-more { display: none; }
.q-more-toggle .q-hide, .q-collapsible:has(.q-more-toggle input:checked) .q-more-toggle .q-show { display: none; }
.q-collapsible:has(.q-more-toggle input:checked) .q-more-toggle .q-hide { display: inline; }
.q-more-toggle:has(input:focus-visible) { box-shadow: 0 0 0 3px var(--bq-focus-ring); }
/* Medium widths: the search keeps its room. */
@media (max-width: 1099.98px) { .bq-header .bq-kbd, .bq-header .bq-scope, .bq-logo small { display: none; } }

/* "Try again" while its frame reloads: a spinner, and no second click. */
.q-retry-busy { display: none; }
turbo-frame[busy] .q-retry, .q-retry.is-loading { pointer-events: none; opacity: 0.85; }
turbo-frame[busy] .q-retry-idle, .q-retry.is-loading .q-retry-idle { display: none; }
turbo-frame[busy] .q-retry-busy, .q-retry.is-loading .q-retry-busy { display: inline-flex; align-items: center; gap: 0.45rem; }
turbo-frame[busy] .q-retry-busy::before, .q-retry.is-loading .q-retry-busy::before { content: ""; width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: bq-spin 0.7s linear infinite; }
@keyframes bq-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .q-retry-busy::before { animation-duration: 2s !important; } }

/* An empty block of the page's period: its message, and on the right the
   button that opens the period picker -- not on pages without one. */
.q-pick-period { margin-left: auto; }
body:not(:has(form[data-period])) .q-pick-period { display: none; }

/* A block's failure message (shared/query/_result): dot, text, button on one row. */
.alert.q-state { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: var(--bq-space-1) var(--bq-space-3); }
.alert.q-state::before { margin-top: 0.45em; }
.q-state-text p { margin: 0; }
.q-state-text p + p { margin-top: 2px; }
.q-state-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2); }
.q-state .bq-badge { background: var(--bq-warning-soft); color: var(--bq-warning); }
.q-state .q-retry { align-self: center; }
@media (max-width: 575.98px) { .alert.q-state { grid-template-columns: auto minmax(0, 1fr); } .q-state .q-retry { grid-column: 2; justify-self: start; } }

/* A network logo with a separate mark for dark backgrounds
   (NetworkHelper#network_logo): only the current theme's one shows. */
:root[data-theme="dark"] .bq-logo-light, :root[data-theme="light"] .bq-logo-dark { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) .bq-logo-light { display: none; } }
@media not (prefers-color-scheme: dark) { :root:not([data-theme]) .bq-logo-dark { display: none; } }

.bq-lead { margin: 0; color: var(--bq-text-muted); }
@media (max-width: 767.98px) { .bq-lead { font-size: var(--bq-fs-sm); } }
.bq-net > span { min-width: 0; overflow: hidden; }

/* A token pair's chart (ethereum/token_pair/trading_view): TradingView in the
   card's body, a Live mark while its stream is on. */
.q-pair-chart { overflow: visible; } /* the chooser's menu goes over the chart */
.q-pair-chart-body { height: clamp(380px, 64vh, 640px); overflow: hidden; border-radius: 0 0 var(--bq-radius-lg) var(--bq-radius-lg); }
.q-pair-chart-body > div { height: 100% !important; }
.q-pair-scope[hidden] { display: none; }
.q-pair-scope > summary { display: inline-flex; align-items: center; gap: 0.4rem; height: 30px; padding: 0 0.6rem; border: 1px solid var(--bq-border-strong); border-radius: var(--bq-radius-md);
  background: var(--bq-surface); color: var(--bq-text); font-size: var(--bq-fs-sm); font-weight: 500; cursor: pointer; white-space: nowrap; }
.q-pair-scope > summary:hover { background: var(--bq-surface-2); }
.q-pair-scope > summary .bq-icon { width: 14px; height: 14px; color: var(--bq-text-muted); }
.q-pair-scope .bq-menu-panel { width: min(22rem, calc(100vw - 2.5rem)); padding: 0.35rem; }
.q-pair-scope .bq-menu-panel button.bq-menu-item { justify-content: space-between; gap: var(--bq-space-3); font-size: var(--bq-fs-sm); font-weight: 400; text-align: left; }
.q-pair-scope .bq-menu-panel button.q-pair-scope-dex { font-weight: 600; }
.q-pair-scope .bq-menu-panel button.q-pair-scope-pool { padding-left: 1.4rem; font-family: var(--bq-mono); font-size: var(--bq-fs-xs); }
.q-pair-scope .bq-menu-panel button[aria-current] { background: var(--bq-soft); color: var(--bq-text-active); }
.q-pair-scope-num { flex: none; color: var(--bq-text-muted); font: 400 var(--bq-fs-xs)/1.2 var(--bq-font); }
.q-pair-live { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); font-weight: 500; }
.q-pair-live[hidden] { display: none; }
.q-pair-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--bq-success); }

/* Attributes of one item (shared/query/_attributes): label and value side by
   side; on a phone the label sits above its value, which gets the whole width. */
.q-attrs th { width: 14rem; white-space: nowrap; }
.q-attrs td { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  .q-attrs tr { display: block; padding: 0.625rem 1rem; border-bottom: 1px solid var(--bq-border); }
  .q-attrs tr:last-child { border-bottom: 0; }
  .q-attrs th, .q-attrs td { display: block; width: auto; padding: 0 !important; border: 0 !important; white-space: normal; }
  .q-attrs th { margin-bottom: 0.125rem; font-size: var(--bq-fs-sm); }
}
/* The meter of a usage cell (QueryTableHelper#cell_usage). */
.q-usage { display: block; max-width: 16rem; height: 4px; margin-top: 0.375rem; border-radius: 2px;
  background: linear-gradient(to right, var(--bq-link) var(--q-bar), var(--bq-surface-2) var(--q-bar)); }


/* A network in a table cell: its icon and short name, quiet. */
.q-net { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--bq-text-muted); }
.q-net-icon { width: 18px; height: 18px; flex: none; }

/* ---------- Call tree (CallTreeHelper, explorer/call_tree) ----------
   Rows are one grid, so the value columns stay aligned at every depth; the
   first cell is indented by --d steps, with a guide line per ancestor and an
   elbow into its own toggle. */
.q-tree { --q-tree-step: 1.375rem; --q-tree-cols: minmax(0, 1fr) minmax(7rem, auto) 8.5rem; font-size: var(--bq-fs-table); }
.q-tree-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-3); padding: var(--bq-space-3) var(--bq-space-4); border-bottom: 1px solid var(--bq-border); }
.q-tree-tools[hidden] { display: none; }
.q-tree-levels { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill); background: var(--bq-surface-2); }
.q-tree-tools-label { padding: 0 0.45rem 0 0.55rem; color: var(--bq-text-muted); font: 600 var(--bq-fs-label)/1 var(--bq-font); letter-spacing: 0.06em; text-transform: uppercase; }
.q-tree-level { min-width: 2.1rem; height: 1.75rem; padding: 0 0.65rem; border: 0; border-radius: var(--bq-radius-pill); background: transparent; color: var(--bq-text);
  font: 600 var(--bq-fs-sm)/1 var(--bq-font); cursor: pointer; transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.q-tree-level:hover { background: var(--bq-row-hover); color: var(--bq-text-strong); }
.q-tree-level[aria-pressed="true"] { background: var(--bq-surface); color: var(--bq-text-strong); box-shadow: var(--bq-shadow); }
.q-tree-level:focus-visible { outline: 2px solid var(--bq-focus); outline-offset: 1px; }
.q-tree-search { display: flex; flex: 1 1 15rem; align-items: center; gap: 0.5rem; max-width: 26rem; height: 2.15rem; margin: 0 0 0 auto; padding: 0 0.85rem;
  border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill); background: var(--bq-surface); color: var(--bq-text-muted); transition: border-color 0.15s, box-shadow 0.15s; }
.q-tree-search:focus-within { border-color: var(--bq-accent); box-shadow: 0 0 0 3px var(--bq-focus-ring); }
.q-tree-search svg { flex: none; width: 15px; height: 15px; }
.q-tree-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--bq-text); font: inherit; font-size: var(--bq-fs-sm); }
.q-tree-search input::-webkit-search-cancel-button { cursor: pointer; }
.q-tree-found { font: 500 var(--bq-fs-xs)/1 var(--bq-mono); white-space: nowrap; }

.q-tree-row { display: grid; grid-template-columns: var(--q-tree-cols); gap: var(--bq-space-4); align-items: center; min-height: 2.35rem; padding: 0 var(--bq-space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--bq-border) 55%, transparent); transition: background 0.12s, opacity 0.15s; }
.q-tree-head { min-height: 2rem; background: var(--bq-surface-2); color: var(--bq-text-muted); font: 600 var(--bq-fs-label)/1 var(--bq-font); letter-spacing: 0.06em; text-transform: uppercase; }
.q-tree-head .q-tree-cell:first-child { text-align: left; }
.q-tree-cell { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
summary.q-tree-row { list-style: none; cursor: pointer; }
summary.q-tree-row::-webkit-details-marker { display: none; }
summary.q-tree-row:hover, .q-tree-leaf:hover { background: var(--bq-row-hover); }
.q-tree-row:focus-visible { outline: 2px solid var(--bq-focus); outline-offset: -2px; }
/* Pointing at a call tints everything it called. */
.q-tree-node:has(> summary:hover) > .q-tree-group { background: color-mix(in srgb, var(--bq-teal) 4%, transparent); }
/* A branch the reader opens slides in (explorer/call_tree marks it). */
.q-tree-node.is-opening > .q-tree-group { animation: q-tree-in 0.18s ease-out; }
@keyframes q-tree-in { from { opacity: 0; transform: translateY(-3px); } }

.q-tree-main { position: relative; display: flex; align-items: center; gap: 0.5rem; align-self: stretch; min-width: 0; padding-left: calc(var(--d) * var(--q-tree-step)); }
.q-tree-main::before { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--d) * var(--q-tree-step)); pointer-events: none;
  background: repeating-linear-gradient(90deg, transparent 0 calc(var(--q-tree-step) / 2 - 0.5px), var(--bq-border-strong) 0 calc(var(--q-tree-step) / 2 + 0.5px), transparent 0 var(--q-tree-step)); }
.q-tree-main::after { content: ""; position: absolute; top: 50%; left: calc((var(--d) - 1) * var(--q-tree-step) + var(--q-tree-step) / 2); pointer-events: none;
  width: calc(min(var(--d), 1) * var(--q-tree-step) / 2); border-top: 1px solid var(--bq-border-strong); }
.q-tree-toggle { position: relative; z-index: 1; display: inline-grid; flex: none; place-items: center; width: var(--q-tree-step); height: var(--q-tree-step); margin-right: -0.2rem;
  border-radius: var(--bq-radius-sm); background: var(--bq-surface); color: var(--bq-text-muted); transition: background 0.15s, color 0.15s; }
.q-tree-toggle svg { width: 14px; height: 14px; transition: transform 0.18s ease; }
.q-tree-node[open] > summary .q-tree-toggle svg { transform: rotate(90deg); }
summary:hover .q-tree-toggle { background: var(--bq-surface-3); color: var(--bq-text-strong); }
.q-tree-dot { background: transparent; }
.q-tree-dot::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: var(--bq-border-strong); }
.q-tree-what { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.q-tree-name { flex: none; max-width: min(18rem, 45%); overflow: hidden; color: var(--bq-text-strong); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.q-tree-on { display: inline-flex; flex: 0 1 auto; align-items: center; gap: 0.35rem; min-width: 0; color: var(--bq-text-muted); }
.q-tree-sep { color: var(--bq-text-muted); font-size: var(--bq-fs-sm); white-space: nowrap; }
.q-tree-arrow { flex: none; width: 13px; height: 13px; opacity: 0.7; }
.q-tree-addr { display: inline-flex; min-width: 2.5rem; max-width: 13rem; border-radius: 4px; transition: background 0.12s, box-shadow 0.12s; }
.q-tree-addr > a { min-width: 0; }
.q-tree-addr.is-lit { background: var(--bq-warning-soft); box-shadow: 0 0 0 3px var(--bq-warning-soft); }
.q-tree-unit { color: var(--bq-text-muted); }
.q-tree-more { display: none; flex: none; align-items: center; height: 1.2rem; padding: 0 0.45rem; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill);
  color: var(--bq-text-muted); font: 500 var(--bq-fs-xs)/1 var(--bq-mono); }
.q-tree-node:not([open]) > summary .q-tree-more { display: inline-flex; }
.q-tree-log { padding: 0.35rem 0; color: var(--bq-text-muted); font: var(--bq-fs-xs)/1.45 var(--bq-mono); white-space: pre-wrap; word-break: break-all; }
.q-tree-log.q-fail { color: var(--bq-danger); }

/* The kind of a node, in words (CallTreeHelper::KINDS); the hint names the opcode. */
.q-tree-kind { display: inline-flex; flex: none; align-items: center; justify-content: center; min-width: 4.4rem; height: 1.3rem; padding: 0 0.45rem; border-radius: var(--bq-radius-sm);
  background: var(--bq-surface-3); color: var(--bq-text); font: 600 0.6875rem/1 var(--bq-mono); letter-spacing: 0.04em; text-transform: uppercase; cursor: help; }
.q-tree-kind-tx { background: var(--bq-text-strong); color: var(--bq-surface); }
.q-tree-kind-read, .q-tree-kind-logs { border: 1px solid var(--bq-border-strong); background: transparent; color: var(--bq-text-muted); }
.q-tree-kind-delegate, .q-tree-kind-ix { background: var(--bq-soft); color: var(--bq-text-active); }
.q-tree-kind-create { background: var(--bq-success-soft); color: var(--bq-success); }
.q-tree-kind-destroy { background: var(--bq-danger-soft); color: var(--bq-danger); }
.q-tree-kind-event { background: var(--bq-warning-soft); color: var(--bq-warning); }
.q-tree-kind-transfer { background: var(--bq-teal-soft); color: var(--bq-teal-text); }

/* A call's share of the transaction's gas, under its number. */
.q-tree-gas { display: grid; gap: 4px; justify-items: end; }
.q-tree-gas::after { content: ""; width: 100%; max-width: 7rem; height: 3px; border-radius: 2px;
  background: linear-gradient(to left, color-mix(in srgb, var(--bq-teal) 75%, transparent) var(--q-gas), var(--bq-surface-3) var(--q-gas)); }

.q-tree-failed { background: color-mix(in srgb, var(--bq-danger) 6%, transparent); box-shadow: inset 3px 0 0 var(--bq-danger); }
.q-tree-failed .q-tree-name, .q-tree-failed .q-tree-name a { color: var(--bq-danger); }

/* Search: the rows found stand out, the rest step back. */
.q-tree.is-searching .q-tree-row:not(.q-tree-head):not(.is-hit) { opacity: 0.42; }
.q-tree-row.is-hit { box-shadow: inset 3px 0 0 var(--bq-teal); }
.q-tree-row.is-current { background: var(--bq-teal-soft); }

.q-tree-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--bq-space-2) var(--bq-space-5); padding: var(--bq-space-3) var(--bq-space-4);
  border-top: 1px solid var(--bq-border); background: var(--bq-surface-2); color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-tree-legend { display: flex; flex-wrap: wrap; gap: var(--bq-space-2) var(--bq-space-4); }
.q-tree-legend-item { display: inline-flex; align-items: center; gap: 0.4rem; }
.q-tree-legend .q-tree-kind { min-width: 0; cursor: default; }
.q-tree-hint { margin: 0; }
.q-tree-card .card-body { overflow: hidden; }

@media (max-width: 40rem) {
  .q-tree { --q-tree-step: 0.95rem; --q-tree-cols: minmax(0, 1fr) auto; }
  .q-tree-row { gap: var(--bq-space-2); padding: 0 var(--bq-space-3); }
  .q-tree-row > :nth-child(3) { display: none; }
  .q-tree-main { padding-left: calc(min(var(--d), 6) * var(--q-tree-step)); }
  .q-tree-kind { min-width: 0; }
  .q-tree-name { flex: 0 1 auto; max-width: none; }
  /* Addresses give their room to the name; the program of a Solana instruction stays. */
  .q-tree-on .q-tree-sep, .q-tree-on .q-tree-arrow, .q-tree-on .q-tree-addr { display: none; }
  .q-tree-search { flex-basis: 100%; max-width: none; }
  .q-tree-hint { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .q-tree-node.is-opening > .q-tree-group { animation: none; }
  .q-tree-toggle svg { transition: none; }
}

/* ---------- Transaction overview (shared/query/_tx_overview) ---------- */
.q-tx-hero { display: grid; gap: var(--bq-space-4); padding: var(--bq-space-5); border-top: 1px solid var(--bq-border); }
.q-tx-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2) var(--bq-space-4); color: var(--bq-text-muted); font-size: var(--bq-fs-sm); }
.q-tx-meta .q-time { color: var(--bq-text); }
.q-tx-status { display: inline-flex; align-items: center; gap: 0.35rem; height: 1.75rem; padding: 0 0.75rem 0 0.6rem; border-radius: var(--bq-radius-pill); font-weight: 600; }
.q-tx-status svg { width: 15px; height: 15px; stroke-width: 2.5; }
.q-tx-ok { background: var(--bq-success-soft); color: var(--bq-success); }
.q-tx-fail { background: var(--bq-danger-soft); color: var(--bq-danger); }
.q-tx-error { margin: 0; padding: var(--bq-space-3) var(--bq-space-4); border-left: 3px solid var(--bq-danger); border-radius: var(--bq-radius-sm);
  background: color-mix(in srgb, var(--bq-danger) 6%, transparent); color: var(--bq-text); font: var(--bq-fs-sm)/1.5 var(--bq-mono); word-break: break-word; }
.q-tx-flow { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: var(--bq-space-3); }
.q-tx-flow-one { grid-template-columns: minmax(0, 1fr); max-width: 32rem; }
.q-tx-party { display: grid; gap: 0.3rem; min-width: 0; padding: var(--bq-space-3) var(--bq-space-4); border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); background: var(--bq-surface-2); }
.q-tx-party > a { font-size: var(--bq-fs-md); }
.q-tx-label { color: var(--bq-text-muted); font: 600 var(--bq-fs-label)/1 var(--bq-font); letter-spacing: 0.06em; text-transform: uppercase; }
.q-tx-arrow { display: inline-grid; place-items: center; width: 2.25rem; height: 2.25rem; border: 1px solid var(--bq-border); border-radius: 50%; background: var(--bq-surface); color: var(--bq-accent); }
.q-tx-arrow svg { width: 16px; height: 16px; }
.q-tx-details { border-top: 1px solid var(--bq-border); }
.q-search-net img, .q-search-net svg { vertical-align: -0.2em; }
/* A small inline form: find by name, go to a token ID. */
.q-find { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2) var(--bq-space-3); }
.q-find label { color: var(--bq-text-muted); font-size: var(--bq-fs-sm); white-space: nowrap; }
.q-find input { flex: 1 1 12rem; width: auto; min-width: 0; max-width: 28rem; }
.q-find-card { padding: var(--bq-space-3) var(--bq-space-5); }
.q-find-row { padding: var(--bq-space-3) var(--bq-space-5); border-top: 1px solid var(--bq-border); }
/* An NFT: its picture beside what is known of it. */
.q-nft { display: grid; grid-template-columns: minmax(0, 16rem) minmax(0, 1fr); border-top: 1px solid var(--bq-border); }
.q-nft-no-media { grid-template-columns: minmax(0, 1fr); }
.q-nft-media { padding: var(--bq-space-5); }
.q-nft-media img { display: block; width: 100%; aspect-ratio: 1; border-radius: var(--bq-radius-md); background: var(--bq-surface-2); object-fit: contain; }
.q-nft-body { display: grid; align-content: start; min-width: 0; }
.q-nft-owner { padding: var(--bq-space-5) var(--bq-space-5) var(--bq-space-3); }
.q-nft-name { margin: 0 0 var(--bq-space-3); color: var(--bq-text-strong); font-size: var(--bq-fs-md); font-weight: 600; }
.q-nft-traits { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); margin: 0; padding: var(--bq-space-3) var(--bq-space-5); border-top: 1px solid var(--bq-border); list-style: none; }
.q-nft-traits li { padding: 0.25rem 0.6rem; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-sm); background: var(--bq-surface-2); font-size: var(--bq-fs-sm); }
.q-nft-traits span { color: var(--bq-text-muted); }
@media (max-width: 48rem) { .q-nft { grid-template-columns: minmax(0, 1fr); } .q-nft-media { padding-bottom: 0; } }
/* Two blocks that are read side by side: a transaction's inputs and outputs. */
.q-two { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--bq-space-5); align-items: start; }
@media (max-width: 80rem) { .q-two { grid-template-columns: minmax(0, 1fr); } }
/* Longs against shorts: the accounts as one bar, then each side. */
.q-longshort { padding: var(--bq-space-4) var(--bq-space-5); }
.q-longshort-bar { height: 8px; overflow: hidden; border-radius: var(--bq-radius-pill); background: var(--bq-danger); }
.q-longshort-bar span { display: block; height: 100%; background: var(--bq-success); }
.q-longshort-sides { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--bq-space-5); margin-top: var(--bq-space-4); }
.q-longshort-sides dl { display: grid; gap: 0.4rem; margin: 0; }
.q-longshort-sides dl > div { display: flex; justify-content: space-between; gap: var(--bq-space-3); }
.q-longshort-sides dt { color: var(--bq-text-muted); font-weight: 400; }
.q-longshort-sides dt.q-ok, .q-longshort-sides dt.q-fail { font-weight: 600; }
.q-longshort-sides dd { margin: 0; text-align: right; }
@media (max-width: 30rem) { .q-longshort-sides { grid-template-columns: minmax(0, 1fr); } }
/* A collection's tokens as a grid of pictures. */
.q-nft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr)); gap: var(--bq-space-3); margin: 0; padding: var(--bq-space-4) var(--bq-space-5); list-style: none; }
.q-nft-tile { display: grid; gap: 0.35rem; min-width: 0; color: var(--bq-text); text-decoration: none; }
.q-nft-tile-media { display: block; aspect-ratio: 1; overflow: hidden; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); background: var(--bq-surface-2); }
.q-nft-tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.q-nft-tile:hover .q-nft-tile-media { border-color: var(--bq-border-strong); }
.q-nft-tile:hover .q-nft-tile-id { color: var(--bq-link); }
.q-nft-tile-id { overflow: hidden; color: var(--bq-text-muted); font-size: var(--bq-fs-sm); text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 30rem) { .q-nft-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--bq-space-3) var(--bq-space-4); } }
/* A coin's small picture beside its name; an empty one keeps names in line. */
.q-coin-icon { display: inline-block; width: 18px; height: 18px; margin-right: 0.4rem; border-radius: 50%; background: var(--bq-surface-2); object-fit: cover; vertical-align: -4px; }
.bq-title-name .q-coin-icon { width: 28px; height: 28px; vertical-align: -5px; }
/* The filters of a list: which list, then its fields. */
.q-filter-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: var(--bq-space-3); padding: var(--bq-space-4) var(--bq-space-5) 0; }
.q-filter-fields label { display: grid; gap: 0.3rem; color: var(--bq-text-muted); font-size: var(--bq-fs-sm); }
.q-filter-bad { color: var(--bq-danger); font-size: var(--bq-fs-xs); }
.q-filter-actions { display: flex; align-items: center; gap: var(--bq-space-3); padding: var(--bq-space-3) var(--bq-space-5) var(--bq-space-4); }
.q-block-hero { padding-block: var(--bq-space-4); }
.q-block-producer { display: inline-flex; align-items: baseline; gap: 0.4em; min-width: 0; }
@media (max-width: 40rem) {
  .q-tx-hero { padding: var(--bq-space-4); }
  .q-tx-flow { grid-template-columns: minmax(0, 1fr); justify-items: stretch; }
  .q-tx-arrow { justify-self: center; transform: rotate(90deg); width: 1.9rem; height: 1.9rem; }
}

/* ---------- Transfers of a transaction (ethereum/tx/_transfers) ---------- */
.q-section-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.25rem 0.6rem; margin: 0; padding: var(--bq-space-3) var(--bq-space-4);
  border-top: 1px solid var(--bq-border); border-bottom: 1px solid var(--bq-border); background: var(--bq-surface-2);
  color: var(--bq-text-strong); font: 600 var(--bq-fs-sm)/1.3 var(--bq-font); }
.q-section-title span { color: var(--bq-text-muted); font-weight: 400; }
.q-changes-list { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.q-change { display: inline-flex; align-items: baseline; gap: 0.1rem; padding: 0.15rem 0.5rem; border-radius: var(--bq-radius-sm); font-weight: 600; white-space: nowrap; }
.q-change .q-num { font-variant-numeric: tabular-nums; }
.q-change a, .q-change > span:not(.q-num) { color: inherit; font-weight: 500; }
.q-change-in { background: var(--bq-success-soft); color: var(--bq-success); }
.q-change-out { background: var(--bq-danger-soft); color: var(--bq-danger); }
.q-change-usd.q-change-in, .q-change-usd.q-change-out { background: none; font-weight: 600; }
.q-change-usd .q-usd { color: inherit; }
.q-transfer-n { width: 2.5rem; font-variant-numeric: tabular-nums; }
.q-transfer-arrow { width: 1.5rem; padding-left: 0 !important; padding-right: 0 !important; color: var(--bq-text-muted); }
.q-transfer-arrow svg { width: 14px; height: 14px; vertical-align: -2px; }
.q-transfer-cur { color: var(--bq-text-muted); }
.q-transfer-failed td { opacity: 0.6; }
.q-transfer-failed td:last-child, .q-transfer-failed td:nth-last-child(2) { opacity: 1; }
@media (max-width: 40rem) {
  .q-transfers .q-transfer-n { display: none; }
  .q-transfers .q-party-note { display: table; margin: 0.2rem 0 0; }
}
.q-party-note { margin-left: 0.4rem; padding: 0 0.4rem; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill); color: var(--bq-text-muted); font-size: var(--bq-fs-xs); white-space: nowrap; }

/* ---------- DEX trades of a transaction (ethereum/tx/_dex_trades) ---------- */
.q-route { display: grid; gap: var(--bq-space-3); padding: var(--bq-space-4) var(--bq-space-5); border-top: 1px solid var(--bq-border); border-bottom: 1px solid var(--bq-border); background: var(--bq-surface-2); }
.q-route-label { color: var(--bq-text-muted); font: 600 var(--bq-fs-label)/1 var(--bq-font); letter-spacing: 0.06em; text-transform: uppercase; }
.q-route-label span { margin-left: 0.3rem; font-weight: 500; letter-spacing: 0; text-transform: none; }
.q-route-path { display: flex; flex-wrap: wrap; align-items: center; gap: var(--bq-space-2); margin: 0; padding: 0; list-style: none; }
.q-route-node { display: grid; gap: 0.15rem; padding: 0.55rem 0.9rem; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); background: var(--bq-surface); }
.q-route-node .q-trade-amount { font-size: var(--bq-fs-md); font-weight: 600; color: var(--bq-text-strong); white-space: nowrap; }
.q-route-start { border-color: color-mix(in srgb, var(--bq-danger) 35%, var(--bq-border)); }
.q-route-end { border-color: color-mix(in srgb, var(--bq-success) 45%, var(--bq-border)); box-shadow: 0 0 0 3px var(--bq-success-soft); }
.q-route-hop { display: inline-flex; flex-direction: column; align-items: center; gap: 0.1rem; min-width: 4rem; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); }
.q-route-hop svg { width: 18px; height: 18px; color: var(--bq-accent); }
.q-route-dex { white-space: nowrap; }
.q-trade-cell { line-height: 1.25; }
.q-trade-amount, .q-trade-usd { display: block; }
.q-trade-usd { font-size: var(--bq-fs-xs); }
.q-trade-via td { opacity: 0.55; }
@media (max-width: 40rem) {
  .q-route { padding: var(--bq-space-4); }
  .q-route-path { flex-direction: column; align-items: stretch; }
  .q-route-hop { flex-direction: row; justify-content: center; gap: 0.4rem; }
  .q-route-hop svg { transform: rotate(90deg); order: -1; }
  .q-trades .q-transfer-n { display: none; }
}

/* ---------- Events of a transaction (ethereum/tx/_events) ---------- */
.q-event-chips { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); padding: var(--bq-space-3) var(--bq-space-4); border-top: 1px solid var(--bq-border); }
.q-event-chip { display: inline-flex; align-items: center; gap: 0.4rem; height: 1.9rem; padding: 0 0.8rem; border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill);
  background: var(--bq-surface); color: var(--bq-text); font: 500 var(--bq-fs-sm)/1 var(--bq-font); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.q-event-chip span { color: var(--bq-text-muted); font: 500 var(--bq-fs-xs)/1 var(--bq-mono); }
.q-event-chip:hover { border-color: var(--bq-border-strong); background: var(--bq-row-hover); }
.q-event-chip[aria-pressed="true"] { border-color: var(--bq-accent); background: var(--bq-soft); color: var(--bq-text-active); }
.q-event-chip:focus-visible { outline: 2px solid var(--bq-focus); outline-offset: 2px; }
.q-event-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--bq-border); }
.q-event { border-bottom: 1px solid var(--bq-border); }
.q-event:last-child { border-bottom: 0; }
.q-event summary { display: grid; grid-template-columns: 2rem 1rem auto minmax(0, auto) minmax(0, 1fr); align-items: center; gap: var(--bq-space-3);
  min-height: 2.75rem; padding: 0.4rem var(--bq-space-4); list-style: none; cursor: pointer; }
.q-event summary::-webkit-details-marker { display: none; }
.q-event summary:hover { background: var(--bq-row-hover); }
.q-event summary:focus-visible { outline: 2px solid var(--bq-focus); outline-offset: -2px; }
.q-event-n { color: var(--bq-text-muted); font: 500 var(--bq-fs-xs)/1 var(--bq-mono); text-align: right; }
.q-event-toggle { width: 14px; height: 14px; color: var(--bq-text-muted); transition: transform 0.18s ease; }
.q-event details[open] .q-event-toggle { transform: rotate(90deg); }
.q-event-name { font-weight: 600; white-space: nowrap; }
.q-event-by { display: inline-flex; gap: 0.35rem; min-width: 0; max-width: 16rem; font-size: var(--bq-fs-sm); }
.q-event-preview { min-width: 0; overflow: hidden; color: var(--bq-text); font-size: var(--bq-fs-sm); text-overflow: ellipsis; white-space: nowrap; }
.q-event-preview .q-mid { display: inline-flex; max-width: 9rem; vertical-align: bottom; }
.q-event details[open] .q-event-preview { visibility: hidden; }
.q-event-body { display: grid; gap: var(--bq-space-3); padding: 0 var(--bq-space-4) var(--bq-space-4) calc(var(--bq-space-4) + 3rem + 2 * var(--bq-space-3)); }
.q-event-sig { justify-self: start; max-width: 100%; padding: 0.25rem 0.55rem; border-radius: var(--bq-radius-sm); background: var(--bq-code-bg); color: var(--bq-code-text);
  font: var(--bq-fs-xs)/1.5 var(--bq-mono); overflow-wrap: anywhere; }
.q-event-args { border: 1px solid var(--bq-border); border-radius: var(--bq-radius-md); overflow: hidden; border-collapse: separate; border-spacing: 0; }
.q-event-args thead th { background: var(--bq-surface-2); color: var(--bq-text-muted); font: 600 var(--bq-fs-label)/1 var(--bq-font); letter-spacing: 0.06em; text-transform: uppercase; }
.q-event-args tr:last-child td { border-bottom: 0; }
.q-arg-name { width: 1%; font-weight: 600; white-space: nowrap; }
.q-arg-type { width: 1%; color: var(--bq-text-muted); font: var(--bq-fs-xs)/1.4 var(--bq-mono); white-space: nowrap; }
.q-arg-int { font-family: var(--bq-mono); font-variant-numeric: tabular-nums; }
.q-arg-bool { font-family: var(--bq-mono); }
@media (max-width: 40rem) {
  .q-event summary { grid-template-columns: 1rem auto minmax(0, 1fr); gap: var(--bq-space-2); padding: 0.5rem var(--bq-space-3); }
  .q-event-n, .q-event-preview { display: none; }
  .q-event-body { padding: 0 var(--bq-space-3) var(--bq-space-3); }
  .q-event-args { display: block; overflow-x: auto; }
}
/* Solana instruction arguments in the call tree (TxTreeHelper). */
.q-tree-kind-args { border: 1px solid color-mix(in srgb, var(--bq-teal) 45%, var(--bq-border)); background: transparent; color: var(--bq-teal-text); }
.q-tree-argtype { flex: none; color: var(--bq-text-muted); font: var(--bq-fs-xs)/1 var(--bq-mono); }
.q-tree-argvalue { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.q-tree-argvalue .q-mid { display: inline-flex; max-width: 100%; vertical-align: bottom; }
.q-arg-json { display: block; max-height: 9rem; overflow: auto; padding: 0.3rem 0; color: var(--bq-text-muted); font: var(--bq-fs-xs)/1.45 var(--bq-mono); white-space: pre-wrap; word-break: break-all; }
.q-tree-argvalue:has(.q-arg-json) { white-space: normal; }
.q-tree-argname { flex: none; max-width: none; font-weight: 500; }

/* ---------- Accounts of a Solana transaction (solana/tx/_accounts) ---------- */
.q-accounts .q-event-chips { border-top: 1px solid var(--bq-border); }
.q-accounts tr[hidden] { display: none; }
.q-account-cell { line-height: 1.3; }
.q-account-owner { display: flex; gap: 0.3rem; max-width: 22rem; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); white-space: nowrap; }
.q-account-owner .q-mid { min-width: 0; }
.q-account-roles { white-space: nowrap; }
.q-account-roles .bq-badge { margin-right: 0.25rem; }
.q-role-signer { background: var(--bq-soft); color: var(--bq-text-active); }
.q-role-ro { background: transparent; border: 1px solid var(--bq-border); color: var(--bq-text-muted); }
.q-account-signer td { background: color-mix(in srgb, var(--bq-accent) 4%, transparent); }
.q-account-post { display: block; margin-top: 0.15rem; color: var(--bq-text-muted); font-size: var(--bq-fs-xs); white-space: nowrap; }
.q-account-token { display: inline-flex; flex-direction: column; margin: 0.1rem 0.5rem 0.1rem 0; vertical-align: top; }

/* ---------- The method a transaction called (ethereum/tx/_input) ---------- */
.q-input-head { display: grid; gap: var(--bq-space-3); padding: var(--bq-space-4) var(--bq-space-5); border-top: 1px solid var(--bq-border); }
.q-input-head p { margin: 0; }
.q-input-type { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; color: var(--bq-text); }
.q-input-method { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.6rem; }
.q-input-name { font-size: var(--bq-fs-lg); font-weight: 600; }
.q-input-selector { color: var(--bq-text-muted); font: var(--bq-fs-xs)/1 var(--bq-mono); }
.q-input-flow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; max-width: 100%; font-size: var(--bq-fs-sm); }
.q-input-flow svg { width: 14px; height: 14px; color: var(--bq-text-muted); }
.q-input-args { padding: var(--bq-space-4) var(--bq-space-5); }
.q-input-note { margin: 0; padding: 0 var(--bq-space-5) var(--bq-space-4); }
@media (max-width: 40rem) {
  .q-input-head, .q-input-args { padding: var(--bq-space-3) var(--bq-space-4); }
  .q-input-args .q-event-args { display: block; overflow-x: auto; }
}

/* A page that does not exist (utility/errors). public/404.html looks the same, with no stylesheet to lean on. */
.bq-error { max-width: 46rem; margin: var(--bq-space-7) auto; }
.bq-error-code { margin: 0 0 var(--bq-space-2); color: var(--bq-teal-text); font-family: var(--bq-mono); font-size: var(--bq-fs-sm); font-weight: 500; }
.bq-error h1 { margin: 0 0 var(--bq-space-3); color: var(--bq-text-strong); font-size: var(--bq-fs-3xl); line-height: 1.15; }
.bq-error-text { margin: 0 0 var(--bq-space-5); font-size: var(--bq-fs-lg); }
.bq-error-actions { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); }
.bq-error-actions .bq-btn { min-height: 40px; padding: 0 var(--bq-space-4); max-width: 100%; }
.bq-error h2 { margin: var(--bq-space-7) 0 var(--bq-space-3); color: var(--bq-text-strong); font-size: var(--bq-fs-md); font-weight: 600; }
.bq-error-nets { display: flex; flex-wrap: wrap; gap: var(--bq-space-2); margin: 0; padding: 0; list-style: none; }
.bq-error-nets a { display: inline-flex; align-items: center; gap: var(--bq-space-2); min-height: 36px; padding: 0 var(--bq-space-3); border: 1px solid var(--bq-border); border-radius: var(--bq-radius-pill); color: var(--bq-text); font-size: var(--bq-fs-sm); }
.bq-error-nets a:hover { border-color: var(--bq-border-strong); text-decoration: none; }
.bq-error-api { margin: var(--bq-space-6) 0 0; padding-top: var(--bq-space-4); border-top: 1px solid var(--bq-border); color: var(--bq-text-muted); font-size: var(--bq-fs-sm); }
@media (max-width: 575px) {
  .bq-error { margin: var(--bq-space-5) auto; }
  .bq-error h1 { font-size: var(--bq-fs-2xl); }
}
