/* Evertrace — Everscale explorer styles */

:root {
  --paper: #f2f4f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #172033;
  --ink-2: #394457;
  --muted: #5e6a7d;
  --line: #d9dfe7;
  --line-soft: #e8ecf1;
  --accent: #2b59c3;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfa;
  --pos: #0f7b5f;
  --neg: #b4460c;
  --warn: #9a6700;
  --bad: #b42318;
  --type-int: #2b59c3;
  --type-extin: #0f7b5f;
  --type-extout: #7a4fc4;
  --strip-a: #2b59c3;
  --strip-b: #5d82d9;
  --focus: #2b59c3;
  --radius-l: 12px;
  --radius-s: 6px;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #121a26;
    --surface: #19222f;
    --surface-2: #1e2836;
    --ink: #e4e9f0;
    --ink-2: #c3ccd8;
    --muted: #93a0b3;
    --line: #2d3949;
    --line-soft: #243040;
    --accent: #86a6ff;
    --accent-ink: #0f1a33;
    --accent-soft: #22304c;
    --pos: #4cc79f;
    --neg: #f0955c;
    --warn: #e0b54a;
    --bad: #f07b6e;
    --type-int: #86a6ff;
    --type-extin: #4cc79f;
    --type-extout: #b69cf0;
    --strip-a: #86a6ff;
    --strip-b: #4f6fbf;
    --focus: #86a6ff;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

code,
.mono {
  font-family: var(--mono);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
}
code {
  background: var(--surface-2);
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  padding: 0 0.3em;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -0.01em;
}
h1 {
  font-size: 1.75rem;
}
h2 {
  font-size: 1.05rem;
}
h3 {
  font-size: 0.95rem;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 0.85rem;
}
.wrap {
  overflow-wrap: anywhere;
}
.pos {
  color: var(--pos);
}
.neg {
  color: var(--neg);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: var(--radius-s);
  z-index: 10;
}
.skip:focus {
  top: 12px;
}

/* Top bar */

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 5;
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}
.brand:hover {
  text-decoration: none;
}
.brand-mark {
  width: 26px;
  height: 26px;
}
.brand-mark path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
}
.brand-mark circle {
  fill: var(--accent);
}
.topbar nav {
  display: flex;
  gap: 4px;
}
.topbar nav a {
  color: var(--ink-2);
  padding: 6px 12px;
  border-radius: var(--radius-s);
  font-weight: 500;
}
.topbar nav a:hover {
  background: var(--surface-2);
  text-decoration: none;
}
.topbar nav a[aria-current="page"] {
  color: var(--accent);
  background: var(--accent-soft);
}

/* Search */

.search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.search input {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 8px 12px 8px 36px;
}
.search input::placeholder {
  color: var(--muted);
}
.search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.search-icon {
  position: absolute;
  left: 11px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.7;
  stroke-linecap: round;
  pointer-events: none;
}
.search-top {
  margin-left: auto;
  width: min(360px, 100%);
}
.search-top kbd {
  position: absolute;
  right: 9px;
  font: 500 0.75rem var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0 6px;
  background: var(--surface);
}
.search-big input {
  font-size: 1.05rem;
  padding: 13px 14px 13px 42px;
  border-radius: 10px;
  background: var(--surface);
}
.search-big .search-icon {
  left: 14px;
  width: 19px;
  height: 19px;
}

/* Buttons */

.btn {
  font: 500 0.92rem var(--font);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 14px;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.btn:disabled {
  opacity: 0.6;
  cursor: progress;
}
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
  padding: 13px 22px;
  border-radius: 10px;
  font-size: 1rem;
}
.btn-primary:hover {
  color: var(--accent-ink);
  filter: brightness(1.08);
}

.copy {
  display: inline-flex;
  vertical-align: middle;
  margin-left: 6px;
  padding: 3px;
  background: none;
  border: 1px solid transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--muted);
}
.copy svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
.copy:hover {
  color: var(--accent);
  border-color: var(--line);
}
.copy.copied {
  color: var(--pos);
}

/* Layout */

main {
  flex: 1;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 28px 24px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
main:focus {
  outline: none;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 18px 24px 24px;
}
.footer p {
  margin: 0;
}

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-head > div {
  min-width: 0;
  max-width: 100%;
}
.page-head .sub {
  overflow-wrap: anywhere;
  margin: 6px 0 0;
  color: var(--muted);
  max-width: 70ch;
}
.head-badges {
  display: flex;
  gap: 6px;
}
.known-note {
  max-width: 40ch;
  margin: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-l);
  padding: 20px 22px;
  min-width: 0;
}
.panel > h2 {
  margin-bottom: 14px;
}
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.panel-head p {
  margin: 0;
}
.more {
  font-weight: 500;
  font-size: 0.9rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.grid-home {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
  gap: 20px;
}

/* Home */

.hero {
  padding: 18px 0 6px;
  max-width: 760px;
}
.hero h1 {
  font-size: 2.2rem;
  letter-spacing: -0.02em;
}
.hero .sub {
  margin: 8px 0 20px;
  color: var(--ink-2);
  font-size: 1.05rem;
}
.hero .examples {
  margin: 10px 0 0;
}

/* Figures */

.figures {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 4px;
}
.figures-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0 0 16px;
}
.figures > div {
  display: flex;
  flex-direction: column-reverse;
  gap: 2px;
  margin: 0;
}
.figures dd {
  margin: 0;
}
.fig {
  font: 500 1.6rem/1.2 var(--mono);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.fig-sm {
  font-size: 1.15rem;
  font-family: var(--font);
  font-weight: 500;
}
.fig-label {
  color: var(--muted);
  font-size: 0.85rem;
}

/* Weight strip: the signature element */

.strip {
  display: flex;
  height: 30px;
  gap: 1px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--line-soft);
  margin: 10px 0 8px;
}
.strip .seg {
  flex-basis: 0;
  min-width: 1px;
  background: var(--strip-a);
  transition: background-color 0.12s;
}
.strip .seg:nth-child(even) {
  background: var(--strip-b);
}
.strip a.seg:hover,
.strip a.seg:focus-visible {
  background: var(--ink);
  outline: none;
}
.strip-title {
  margin-top: 22px;
}

.round-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.round-head .sub {
  margin: 4px 0 0;
  color: var(--muted);
}
.round-status {
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 500;
  font-size: 0.9rem;
}
.progress {
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  margin-top: 18px;
  overflow: hidden;
}
.progress span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}
.progress-caption {
  margin: 6px 0 0;
  font-size: 0.85rem;
}

/* Tables built with grid rows */

.table {
  --cols: minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 1.2fr) 22px minmax(0, 1.2fr) minmax(0, 1.1fr) minmax(0, 0.7fr);
  display: flex;
  flex-direction: column;
  font-size: 0.93rem;
}
.table-account {
  --cols: minmax(0, 1fr) minmax(0, 0.7fr) minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 1.2fr) minmax(0, 0.8fr);
}
.table-validators {
  --cols: 56px minmax(0, 1.4fr) minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1.2fr);
}
.table-known {
  --cols: minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr);
}
.table-active {
  --cols: minmax(0, 1.3fr) minmax(0, 1.2fr) minmax(0, 1.2fr) minmax(0, 0.7fr) minmax(0, 0.8fr);
}
.tr {
  display: grid;
  grid-template-columns: var(--cols);
  gap: 12px;
  align-items: center;
  padding: 10px 4px;
  border-top: 1px solid var(--line-soft);
}
.tr > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.table-known .tr > span:first-child {
  white-space: normal;
}
.th {
  border-top: none;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
  padding-top: 0;
}
.tr:not(.th):hover {
  background: var(--surface-2);
}
.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.flow-col svg {
  width: 20px;
  height: 10px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.4;
  display: block;
}
.rank {
  color: var(--muted);
  font-family: var(--mono);
}
.addr.is-self {
  color: var(--ink);
  font-weight: 500;
}
.strong-link {
  font-weight: 600;
}
.bar {
  display: block;
  height: 6px;
  background: var(--line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.bar span {
  display: block;
  height: 100%;
  background: var(--strip-a);
}
.tr.flash {
  animation: flash 1.6s ease-out;
}
@keyframes flash {
  0% {
    background: var(--accent-soft);
  }
  100% {
    background: transparent;
  }
}

/* Badges and statuses */

.badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 1px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.type-int {
  color: var(--type-int);
  border-color: color-mix(in srgb, var(--type-int) 35%, transparent);
}
.badge.type-extin {
  color: var(--type-extin);
  border-color: color-mix(in srgb, var(--type-extin) 35%, transparent);
}
.badge.type-extout {
  color: var(--type-extout);
  border-color: color-mix(in srgb, var(--type-extout) 35%, transparent);
}
.badge-warn {
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 40%, transparent);
}
.dir {
  font-weight: 500;
  font-size: 0.85rem;
}
.dir-in {
  color: var(--pos);
}
.dir-out {
  color: var(--neg);
}
.status {
  font-weight: 500;
}
.status::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
  background: currentColor;
}
.status-ok {
  color: var(--pos);
}
.status-warn {
  color: var(--warn);
}
.status-bad {
  color: var(--bad);
}
.amount .unit {
  color: var(--muted);
  font-size: 0.85em;
}

/* Key-value lists */

.kv {
  margin: 0;
}
.kv-row {
  display: grid;
  grid-template-columns: minmax(130px, 34%) minmax(0, 1fr);
  gap: 16px;
  padding: 9px 0;
  border-top: 1px solid var(--line-soft);
}
.kv-row:first-child {
  border-top: none;
  padding-top: 0;
}
.kv dt {
  color: var(--muted);
}
.kv dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}
.kv-stack .kv-row {
  grid-template-columns: 1fr;
  gap: 4px;
}
.hint {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  margin-left: 6px;
  font-size: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: help;
  vertical-align: 1px;
}

.tx {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tx-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 0.88rem;
}

/* Message flow */

.flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 1.3fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
}
.flow-end {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  min-width: 0;
}
.flow-end:last-child {
  text-align: right;
}
.flow-role {
  font-size: 0.82rem;
  color: var(--muted);
}
.flow-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.flow-line svg {
  width: 100%;
  height: 12px;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.flow-value {
  font-size: 1.05rem;
  font-weight: 500;
}

.balance {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-bottom: 16px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.balance-value {
  font-size: 1.7rem;
  font-weight: 500;
  overflow-wrap: anywhere;
}

/* Raw data */

.raw {
  margin-top: 12px;
}
.raw summary {
  cursor: pointer;
  color: var(--ink-2);
  font-weight: 500;
}
.raw-box {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  margin-top: 8px;
}
.raw-box code {
  display: block;
  flex: 1;
  max-height: 180px;
  overflow: auto;
  padding: 10px 12px;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

/* Controls */

.toolbar {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
main > .toolbar {
  margin-bottom: 0;
}
.segmented {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.segmented button {
  font: 500 0.88rem var(--font);
  color: var(--ink-2);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 5px 12px;
  cursor: pointer;
}
.segmented button:hover {
  color: var(--ink);
}
.segmented button.on {
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--line);
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}
.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
}

/* States */

.state {
  padding: 22px 4px;
}
.state p {
  margin: 6px 0 0;
  max-width: 70ch;
}
.state .btn {
  margin-top: 12px;
}
.state-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.state-error strong {
  color: var(--bad);
}

/* Accounts list: tabs, filters, sorting */

.system-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  font-size: 0.88rem;
  font-weight: 500;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.chip:hover {
  text-decoration: none;
  border-color: var(--accent);
}
.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line);
  margin-bottom: -20px;
}
.tab {
  font: 500 0.95rem var(--font);
  color: var(--ink-2);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 10px 14px;
  margin-bottom: -1px;
  cursor: pointer;
}
.tab:hover {
  color: var(--ink);
}
.tab.on {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tabs + .panel {
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  border-top: none;
  margin-top: 20px;
}
.filters {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-soft);
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  color: var(--muted);
  width: 170px;
}
.field-wide {
  flex: 1;
  min-width: 220px;
  width: auto;
}
.field input {
  font: 0.93rem var(--font);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 10px;
  width: 100%;
}
.field-wide input {
  font-family: var(--mono);
  font-size: 0.85rem;
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: var(--surface);
}
.filters-actions {
  display: flex;
  gap: 8px;
}
.btn-accent {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.btn-accent:hover {
  color: var(--accent-ink);
  filter: brightness(1.08);
}
.field-error {
  margin: 0;
  color: var(--bad);
  font-size: 0.88rem;
}
.sort {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.sort:hover,
.sort.on {
  color: var(--accent);
}
.sort-arrow {
  display: inline-block;
  width: 0.8em;
}
.linkish {
  font: inherit;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}
.linkish:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
.table-accounts {
  --cols: 44px minmax(0, 1.3fr) minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}
.pager-note {
  margin: 12px 0 0;
}
.value-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
}
.value-filter input {
  width: 120px;
  font: 0.93rem var(--font);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 6px 10px;
}
.value-filter input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
}
.sort-small {
  font-size: 0.82rem;
}

/* Sort picker, shown only where table headers are hidden */
.mobile-sort {
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.mobile-sort select {
  flex: 1;
  font: 0.93rem var(--font);
  color: var(--ink);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-s);
  padding: 7px 10px;
}

/* Responsive */

@media (max-width: 960px) {
  .grid-home,
  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
  .figures {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .topbar-inner {
    gap: 16px;
  }
}

@media (max-width: 760px) {
  .topbar-inner {
    flex-wrap: wrap;
    padding: 10px 16px;
    row-gap: 8px;
  }
  .topbar nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
  }
  .search-top {
    width: auto;
    flex: 1;
    min-width: 140px;
  }
  .search-top kbd {
    display: none;
  }
  main {
    padding: 20px 16px 40px;
    gap: 16px;
  }
  .panel {
    padding: 16px;
  }
  .hero h1 {
    font-size: 1.7rem;
  }
  .search-big {
    flex-direction: column;
    align-items: stretch;
  }
  .search-big .search-icon {
    top: 15px;
  }
  .th {
    display: none;
  }
  .mobile-sort {
    display: flex;
  }
  .value-filter {
    width: 100%;
    flex-wrap: wrap;
  }
  .value-filter input {
    flex: 1;
  }
  .tr {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    padding: 12px 2px;
  }
  .tr:first-child,
  .th + .tr {
    border-top: none;
  }
  .tr > span {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    text-align: right;
  }
  .tr > span[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.82rem;
    text-align: left;
  }
  .tr > .flow-col,
  .tr > .share-col {
    display: none;
  }
  .field,
  .field-wide {
    width: 100%;
    min-width: 0;
  }
  .filters-actions {
    width: 100%;
  }
  .filters-actions .btn {
    flex: 1;
  }
  .segmented {
    flex-wrap: wrap;
  }
  .table-known .tr > span {
    display: block;
    text-align: left;
  }
  .kv-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }
  .flow {
    grid-template-columns: minmax(0, 1fr);
  }
  .flow-end:last-child {
    text-align: left;
  }
  .flow-line svg {
    transform: rotate(90deg);
    width: 28px;
  }
  .fig {
    font-size: 1.3rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== Everscale theme: deep navy with blue and indigo light ===== */

:root,
:root:not([data-theme="light"]) {
  --paper: #080c18;
  --surface: #121829;
  --surface-2: #181f33;
  --ink: #e8ecf6;
  --ink-2: #c1c9dc;
  --muted: #8a94ad;
  --line: #262f47;
  --line-soft: #1d2539;
  --accent: #6884fa;
  --accent-ink: #ffffff;
  --accent-soft: rgba(104, 132, 250, 0.16);
  --pos: #4cc79f;
  --neg: #f0955c;
  --warn: #e0b54a;
  --bad: #f07b6e;
  --type-int: #8fa4ff;
  --type-extin: #4cc79f;
  --type-extout: #b69cf0;
  --strip-a: #6884fa;
  --strip-b: #4a5fb8;
  --focus: #8fa4ff;
  --chip: #3b5bdb;
  --chip-hover: #4c6cf0;
  --chip-active: #6884fa;
  color-scheme: dark;
}

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(900px 600px at 8% -10%, rgba(59, 91, 219, 0.35), transparent 60%),
    radial-gradient(700px 500px at 100% 10%, rgba(99, 60, 200, 0.22), transparent 60%),
    radial-gradient(800px 700px at 0% 70%, rgba(40, 70, 180, 0.18), transparent 65%);
  background-attachment: fixed;
}
.topbar {
  background: rgba(8, 12, 24, 0.72);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom-color: rgba(255, 255, 255, 0.07);
}
.panel {
  background: rgba(18, 24, 41, 0.86);
  border-color: rgba(255, 255, 255, 0.06);
}

/* Breadcrumbs and list page heads */

.list-head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}
.crumbs a {
  color: var(--muted);
}
.crumbs a:hover {
  color: var(--ink);
}
.crumbs svg {
  width: 7px;
  height: 9px;
  fill: currentColor;
}
.crumbs [aria-current] {
  color: var(--ink);
}
.list-head h1 {
  font-size: 1.9rem;
}

/* Stats: tiles column + chart */

.stats {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(0, 2.6fr);
  gap: 12px;
}
.stats-flat {
  grid-template-columns: minmax(0, 1fr);
}
.tiles {
  display: grid;
  gap: 12px;
}
.stats-flat .tiles {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  background: rgba(18, 24, 41, 0.86);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-l);
  min-height: 88px;
}
.tile-label {
  color: var(--muted);
  font-size: 0.85rem;
}
.tile-value {
  font-size: 1.45rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
.tile-wait {
  display: inline-block;
  width: 72px;
  height: 18px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--line-soft), var(--line), var(--line-soft));
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.chart-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.chart-panel h2 {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--ink-2);
}
.chart {
  position: relative;
  margin: 0;
}
.chart svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart .grid {
  stroke: var(--line-soft);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.chart .ytick,
.chart .xtick {
  fill: var(--muted);
  font: 11px var(--font);
}
.chart .line {
  fill: none;
  stroke: #6884fa;
  stroke-width: 2;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.chart .area {
  fill: rgba(104, 132, 250, 0.12);
}
.chart .last {
  fill: #6884fa;
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .cross {
  stroke: var(--muted);
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}
.chart .dot {
  fill: #6884fa;
  stroke: var(--surface);
  stroke-width: 2;
}
.chart .hit {
  fill: transparent;
  cursor: crosshair;
}
.tip {
  position: absolute;
  transform: translate(-50%, calc(-100% - 12px));
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 0.82rem;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  white-space: nowrap;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.tip span {
  color: var(--muted);
}
.chart-note {
  margin: 0;
}

/* Filter chips */

.fchips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.chip-wrap {
  position: relative;
}
.fchip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 0.92rem var(--font);
  color: #fff;
  background: var(--chip);
  border: none;
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  max-width: 320px;
}
.fchip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fchip:hover {
  background: var(--chip-hover);
}
.fchip.active {
  background: var(--chip-active);
}
.fchip-val {
  font-weight: 500;
}
.fchip svg {
  width: 10px;
  height: 6px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.fchip[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.fchips-reset {
  font-size: 0.9rem;
}
.fpanel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  min-width: 240px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fpanel[hidden] {
  display: none;
}
.fpanel-wide {
  min-width: 340px;
}
.fpanel .field {
  width: 100%;
}
.fpanel-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
.fpanel-row {
  display: flex;
  gap: 8px;
}
.opt-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.opt {
  text-align: left;
  font: 0.93rem var(--font);
  color: var(--ink-2);
  background: none;
  border: none;
  border-radius: 6px;
  padding: 7px 10px;
  cursor: pointer;
}
.opt:hover {
  background: var(--line-soft);
  color: var(--ink);
}
.opt.on {
  color: var(--ink);
  background: var(--accent-soft);
}
.opt.on::after {
  content: "✓";
  float: right;
  color: var(--accent);
}
.check-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.check-list label {
  display: flex;
  gap: 10px;
  align-items: center;
  cursor: pointer;
}
.check-list input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

/* Big list tables */

.panel-list {
  padding: 8px 22px 16px;
}
.table-big .tr {
  padding: 14px 4px;
}
.table-big .th {
  padding: 14px 4px 12px;
  font-size: 0.88rem;
}
.table-accounts2 {
  --cols: minmax(0, 1.3fr) minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 0.9fr) minmax(0, 0.9fr);
}
.table-messages2 {
  --cols: minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1fr) minmax(0, 0.8fr);
}
.stime {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.3;
}
.stime-date {
  color: var(--muted);
  font-size: 0.8rem;
}
.hashcell {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.35;
  min-width: 0;
}
.hashcell .sub {
  color: var(--muted);
  font-size: 0.8rem;
}
.th .sort {
  color: var(--ink-2);
}
.th .sort.on,
.th .sort:hover {
  color: var(--ink);
}
.th .sort-arrow {
  font-size: 0.8em;
}

@media (max-width: 960px) {
  .stats {
    grid-template-columns: minmax(0, 1fr);
  }
  .tiles,
  .stats-flat .tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 760px) {
  .fpanel,
  .fpanel-wide {
    position: fixed;
    left: 16px;
    right: 16px;
    top: auto;
    bottom: 16px;
    min-width: 0;
  }
  .panel-list {
    padding: 4px 16px 12px;
  }
  .stime {
    align-items: flex-end;
  }
  .hashcell {
    align-items: flex-end;
  }
  .tile-value {
    font-size: 1.2rem;
  }
}

/* Named addresses from addresses.json */
.addr.named {
  font-family: var(--font);
  font-weight: 500;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
.addr.named-full {
  display: inline-flex;
  flex-direction: column;
  white-space: normal;
}
.addr-raw {
  font-weight: 400;
  font-size: 0.85em;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.table-known {
  --cols: minmax(0, 1fr);
}

/* Account page */
.acc-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 14px;
}
.acc-title-addr {
  font-size: 0.8em;
  font-weight: 500;
  color: var(--ink-2);
}
.acc-ok {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(76, 199, 159, 0.16);
}
.acc-ok svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: var(--pos);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 500;
}
.section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.count-pill {
  font: 500 0.82rem var(--mono);
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--line);
  color: var(--ink);
}
.kv-wide .kv-row {
  grid-template-columns: minmax(150px, 28%) minmax(0, 1fr);
  padding: 12px 0;
}
.unit-strong {
  color: var(--ink-2);
}
.more-details {
  margin-top: 6px;
  border-top: 1px solid var(--line-soft);
  padding-top: 12px;
}
.more-details summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.more-details summary::-webkit-details-marker {
  display: none;
}
.more-details summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}
.more-details[open] summary::after {
  transform: rotate(-135deg) translateY(-2px);
}
.more-details[open] summary {
  margin-bottom: 8px;
}
.acc-tabs {
  margin-bottom: 0;
}
#tab-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#tab-body .section-head {
  margin-bottom: 0;
}
.table-accmsgs {
  --cols: minmax(0, 1fr) minmax(0, 0.9fr) minmax(0, 1fr) minmax(0, 1fr) 44px minmax(0, 1.2fr) minmax(0, 0.8fr);
}
.table-acctxs {
  --cols: minmax(0, 1fr) minmax(0, 1.5fr) minmax(0, 0.7fr) minmax(0, 1.1fr) minmax(0, 0.9fr) minmax(0, 0.8fr);
}
.self-pick {
  align-self: flex-start;
}
@media (max-width: 760px) {
  .kv-wide .kv-row {
    grid-template-columns: minmax(0, 1fr);
  }
  .section-title {
    font-size: 1.15rem;
  }
}
