:root {
  color-scheme: light;
  --bg: #f4f9ff;
  --surface: #ffffff;
  --surface-2: #eef7ff;
  --line: #d5e5f4;
  --text: #07192f;
  --muted: #59718c;
  --blue: #008de4;
  --blue-2: #00a8ff;
  --deep-blue: #012a5a;
  --midnight: #071b3a;
  --green: #18b978;
  --amber: #f3a712;
  --red: #d84a4a;
  --shadow: 0 18px 42px rgba(0, 61, 126, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  background:
    radial-gradient(circle at 8% -6%, rgba(0, 141, 228, 0.28), transparent 30rem),
    radial-gradient(circle at 92% 8%, rgba(1, 42, 90, 0.18), transparent 28rem),
    linear-gradient(180deg, #fafdff 0%, var(--bg) 42%, #edf6ff 100%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
  letter-spacing: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 72px;
  padding: 0.9rem clamp(1rem, 3vw, 2.5rem);
  border-bottom: 1px solid rgba(0, 141, 228, 0.15);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 13rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(0, 141, 228, 0.22);
}

.brand-mark img {
  width: 32px;
  height: 32px;
  display: block;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 1rem;
}

.brand small {
  margin-top: 0.18rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.search {
  display: grid;
  grid-template-columns: minmax(12rem, 30rem) auto;
  gap: 0.5rem;
  width: min(100%, 42rem);
}

.search input {
  min-width: 0;
  height: 42px;
  padding: 0 0.9rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  background: #ffffff;
}

.search input:focus {
  border-color: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(0, 141, 228, 0.24);
}

.search button,
.ghost {
  min-height: 42px;
  padding: 0 1rem;
  color: white;
  border: 1px solid rgba(0, 141, 228, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), #0067c4);
  cursor: pointer;
}

.ghost {
  color: var(--deep-blue);
  background: #ffffff;
}

main {
  width: min(100%, 1440px);
  margin: 0 auto;
  padding: clamp(1rem, 2.5vw, 2.2rem);
}

.status-band {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 22rem);
  align-items: end;
  gap: 1.5rem;
  min-height: 212px;
  padding: clamp(1.25rem, 3vw, 2.2rem);
  border: 0;
  border-radius: 8px;
  background:
    radial-gradient(circle at 92% 16%, rgba(255, 255, 255, 0.28), transparent 15rem),
    linear-gradient(135deg, var(--blue) 0%, #0270d0 48%, var(--deep-blue) 100%);
  box-shadow: 0 22px 54px rgba(0, 104, 196, 0.28);
}

.eyebrow {
  margin: 0 0 0.45rem;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 800;
  text-transform: uppercase;
}

.status-band .eyebrow,
.status-band h1,
.status-band .status-copy p:last-child,
.status-band #sync-percent {
  color: #ffffff;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 15ch;
  margin-bottom: 0.65rem;
  font-size: clamp(2rem, 4.4vw, 4.5rem);
  line-height: 0.98;
}

h2 {
  margin-bottom: 0;
  font-size: 1.1rem;
}

.status-copy p:last-child {
  max-width: 56rem;
  margin-bottom: 0;
  font-size: clamp(0.95rem, 1.2vw, 1.12rem);
}

.sync-meter {
  align-self: center;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

#sync-percent {
  display: block;
  margin-bottom: 0.7rem;
  font-size: 2rem;
  font-weight: 900;
}

.meter {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.meter i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff, #bfeaff);
  transition: width 0.4s ease;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0.9rem 0;
}

.stat,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.stat {
  min-height: 104px;
  padding: 1rem;
}

.stat span,
.muted {
  color: var(--muted);
  font-size: 0.84rem;
}

.stat strong {
  display: block;
  margin-top: 0.55rem;
  overflow-wrap: anywhere;
  color: var(--deep-blue);
  font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.panel {
  padding: 1rem;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(22rem, 0.85fr);
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.mempool-lanes {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  min-height: 146px;
}

.slice {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  border: 1px solid rgba(0, 141, 228, 0.2);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, var(--surface-2) 100%);
}

.slice-fill {
  position: absolute;
  inset: auto 0 0;
  min-height: 6%;
  background: linear-gradient(180deg, rgba(0, 168, 255, 0.88), rgba(0, 141, 228, 0.96));
}

.slice-content {
  position: relative;
  z-index: 1;
  display: grid;
  align-content: space-between;
  min-height: 146px;
  padding: 0.85rem;
}

.slice strong {
  display: block;
  font-size: 1.35rem;
}

.slice span {
  color: var(--muted);
  font-size: 0.82rem;
}

.histogram {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.histobar {
  min-height: 68px;
  padding: 0.55rem;
  border: 1px solid rgba(0, 141, 228, 0.18);
  border-radius: 8px;
  background: #f7fbff;
}

.histobar strong {
  display: block;
}

.histobar span {
  color: var(--muted);
  font-size: 0.78rem;
}

.block-list,
.tx-list {
  display: grid;
  gap: 0.55rem;
}

.row {
  display: grid;
  grid-template-columns: minmax(8rem, 1fr) repeat(3, minmax(5.5rem, auto));
  align-items: center;
  gap: 0.75rem;
  min-height: 64px;
  padding: 0.72rem;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 20px rgba(0, 61, 126, 0.06);
}

.row:hover {
  border-color: rgba(0, 141, 228, 0.52);
  background: #f2f9ff;
}

.row strong,
.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.row strong {
  overflow-wrap: anywhere;
  color: var(--deep-blue);
  font-size: 0.95rem;
}

.row span {
  color: var(--muted);
  font-size: 0.82rem;
}

.tx-list .row {
  grid-template-columns: minmax(0, 1fr) minmax(5rem, auto) minmax(5rem, auto);
}

.detail-panel {
  margin-top: 0.9rem;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
}

.detail-item {
  min-height: 76px;
  padding: 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.detail-item strong {
  display: block;
  margin-top: 0.35rem;
  overflow-wrap: anywhere;
}

.empty,
.error {
  padding: 1rem;
  color: var(--muted);
  border: 1px dashed rgba(0, 141, 228, 0.3);
  border-radius: 8px;
  background: #f8fbff;
}

.error {
  color: #8d2323;
  border-color: rgba(216, 74, 74, 0.4);
  background: rgba(216, 74, 74, 0.08);
}

@media (max-width: 980px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .brand {
    min-width: 0;
  }

  .search {
    grid-template-columns: 1fr auto;
    width: 100%;
  }

  .status-band,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .mempool-lanes,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .histogram {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  main {
    padding: 0.75rem;
  }

  .search {
    grid-template-columns: 1fr;
  }

  .stats-grid,
  .mempool-lanes,
  .histogram,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .row,
  .tx-list .row {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
}
