/* F#scan — modern block explorer styles */
:root {
  --bg: #0a0c10;
  --bg-elevated: #11141b;
  --bg-card: #151922;
  --bg-hover: #1a1f2b;
  --border: #1e2433;
  --border-light: #2a3142;
  --text: #e8edf5;
  --text-muted: #8b95a8;
  --text-dim: #5c6578;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-muted: rgba(59, 130, 246, 0.15);
  --success: #22c55e;
  --success-muted: rgba(34, 197, 94, 0.15);
  --warning: #eab308;
  --warning-muted: rgba(234, 179, 8, 0.15);
  --danger: #ef4444;
  --danger-muted: rgba(239, 68, 68, 0.15);
  --purple: #a78bfa;
  --cyan: #22d3ee;
  --radius: 8px;
  --radius-lg: 12px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;
  --shadow: 0 1px 3px rgba(0,0,0,.3), 0 1px 2px rgba(0,0,0,.2);
  --shadow-lg: 0 8px 24px rgba(0,0,0,.4);
  --topbar-h: 56px;
}

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

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color .15s;
}
a:hover { color: var(--accent-hover); }

code, .mono {
  font-family: var(--mono);
  font-size: 0.9em;
}

/* ——— Topbar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--topbar-h);
  background: rgba(10, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0;
  text-decoration: none !important;
  flex-shrink: 0;
}
.brand-mark {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--accent);
  letter-spacing: -0.02em;
}
.brand-name {
  font-weight: 600;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}

.search {
  flex: 1;
  max-width: 420px;
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 0.75rem;
  color: var(--text-dim);
  pointer-events: none;
}
.search input {
  width: 100%;
  height: 36px;
  padding: 0 2.5rem 0 2.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.search input::placeholder { color: var(--text-dim); }
.search-kbd {
  position: absolute;
  right: 0.6rem;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--mono);
  pointer-events: none;
}

.nav {
  display: flex;
  gap: 0.15rem;
  flex-shrink: 0;
}
.nav-link {
  padding: 0.4rem 0.7rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none !important;
  transition: color .15s, background .15s;
}
.nav-link:hover {
  color: var(--text);
  background: var(--bg-hover);
}
.nav-link.active {
  color: var(--accent);
  background: var(--accent-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
  flex-shrink: 0;
}

.net-badge {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  white-space: nowrap;
}
.net-badge.online {
  border-color: rgba(34, 197, 94, 0.4);
  color: var(--success);
  background: var(--success-muted);
}
.net-badge.offline {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
  background: var(--danger-muted);
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 34px;
  padding: 0 0.9rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  white-space: nowrap;
}
.btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-light);
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}
.btn-icon {
  width: 34px;
  padding: 0;
  color: var(--text-muted);
}
.btn-icon:hover { color: var(--text); }
.btn-sm {
  height: 28px;
  padding: 0 0.6rem;
  font-size: 0.75rem;
}
.btn-ghost {
  background: transparent;
  border-color: transparent;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  border-color: transparent;
}

/* ——— Layout ——— */
.app {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 3rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: -0.75rem 0 1.25rem;
}

.section {
  margin-top: 1.5rem;
}
.section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.toolbar input {
  height: 34px;
  padding: 0 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
  min-width: 200px;
}
.toolbar input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

/* ——— Cards & Grid ——— */
.grid {
  display: grid;
  gap: 0.75rem;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .nav { display: none; }
}
@media (max-width: 600px) {
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .search { max-width: none; }
  .search-kbd { display: none; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.15rem;
  box-shadow: var(--shadow);
}
.card-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.35rem;
}
.card-value {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.card-value.sm {
  font-size: 0.9rem;
  font-weight: 500;
  word-break: break-all;
}
.card-value.hash {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.stat-card .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.35rem;
  font-size: 0.9rem;
}
.stat-icon.blue { background: var(--accent-muted); color: var(--accent); }
.stat-icon.green { background: var(--success-muted); color: var(--success); }
.stat-icon.yellow { background: var(--warning-muted); color: var(--warning); }
.stat-icon.purple { background: rgba(167, 139, 250, 0.15); color: var(--purple); }

/* ——— Tables ——— */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
th {
  text-align: left;
  padding: 0.7rem 1rem;
  font-weight: 500;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  white-space: nowrap;
}
td {
  padding: 0.7rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tbody tr {
  transition: background .1s;
}
tbody tr:hover {
  background: var(--bg-hover);
}

.truncate {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.empty {
  text-align: center;
  color: var(--text-dim);
  padding: 2rem 1rem !important;
}

/* ——— Detail pages ——— */
.detail-grid {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.6rem 1rem;
  margin: 0;
}
.detail-grid dt {
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  padding-top: 0.15rem;
}
.detail-grid dd {
  margin: 0;
  word-break: break-all;
  font-size: 0.875rem;
}
.detail-grid dd.hash {
  font-family: var(--mono);
  font-size: 0.8rem;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.15rem 0.3rem;
  border-radius: 4px;
  font-size: 0.75rem;
  vertical-align: middle;
  transition: color .15s, background .15s;
}
.copy-btn:hover {
  color: var(--accent);
  background: var(--accent-muted);
}

/* ——— Tabs ——— */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1rem;
}
.tab {
  padding: 0.6rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  margin-bottom: -1px;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ——— Pills & badges ——— */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.pill-info {
  background: var(--accent-muted);
  color: var(--accent);
}
.pill-ok {
  background: var(--success-muted);
  color: var(--success);
}
.pill-warn {
  background: var(--warning-muted);
  color: var(--warning);
}
.pill-danger {
  background: var(--danger-muted);
  color: var(--danger);
}

/* ——— JSON block ——— */
pre.json {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
  max-height: 480px;
  overflow-y: auto;
}

/* ——— Loading & errors ——— */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}
.loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--bg-elevated) 25%, var(--bg-hover) 50%, var(--bg-elevated) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s ease-in-out infinite;
  border-radius: var(--radius);
  height: 1em;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.error-box {
  background: var(--danger-muted);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  color: var(--danger);
  font-size: 0.875rem;
}

.hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.5rem 0 0;
}
.hint code {
  background: var(--bg-elevated);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8em;
}

/* ——— Toast ——— */
.toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 200;
  padding: 0.75rem 1.15rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 0.875rem;
  font-weight: 500;
  max-width: 360px;
  animation: slideUp .25s ease;
}
.toast.ok { border-color: rgba(34, 197, 94, 0.4); }
.toast.err {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--danger);
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ——— Footer ——— */
.footer {
  border-top: 1px solid var(--border);
  padding: 0.85rem 1.25rem;
  background: var(--bg-elevated);
}
.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: var(--text-dim);
  flex-wrap: wrap;
}
.footer .sep { opacity: 0.4; }
.footer-brand { margin-left: auto; color: var(--text-muted); font-weight: 500; }

/* ——— Dialog / Settings ——— */
dialog {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  color: var(--text);
  padding: 0;
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: var(--shadow-lg);
}
dialog::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
}
.settings-form {
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.25rem;
}
.dialog-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}
.settings-form label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-muted);
}
.settings-form label input[type="url"],
.settings-form label input[type="password"],
.settings-form label input[type="text"] {
  height: 36px;
  padding: 0 0.75rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.875rem;
  outline: none;
}
.settings-form label input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}
.label-hint {
  font-weight: 400;
  opacity: 0.6;
  font-size: 0.75rem;
}
.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem !important;
  cursor: pointer;
}
.checkbox-label input { width: auto; accent-color: var(--accent); }
.checkbox-label span { font-weight: 400; color: var(--text); }
.checkbox-label code {
  background: var(--bg-elevated);
  padding: 0.05rem 0.3rem;
  border-radius: 3px;
  font-size: 0.8em;
}
.dialog-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.5rem;
}

/* ——— Pagination ——— */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ——— Relative time ——— */
.rel-time {
  color: var(--text-muted);
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* ——— Tx list in block ——— */
.tx-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.tx-item:last-child { border-bottom: none; }
.tx-idx {
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.75rem;
  min-width: 1.5rem;
}

/* ——— Contract ABI call form ——— */
.abi-method {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
  overflow: hidden;
}
.abi-method-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elevated);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  user-select: none;
}
.abi-method-header:hover { background: var(--bg-hover); }
.abi-method-body {
  padding: 0.85rem;
  border-top: 1px solid var(--border);
  display: none;
}
.abi-method.open .abi-method-body { display: block; }
.abi-param {
  margin-bottom: 0.5rem;
}
.abi-param label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
}
.abi-param input {
  width: 100%;
  height: 32px;
  padding: 0 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.8rem;
  outline: none;
}
.abi-param input:focus {
  border-color: var(--accent);
}

/* ——— Breadcrumb ——— */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { opacity: 0.4; }


/* =========================================================
   Etherscan-inspired UI refresh
   ========================================================= */
:root {
  --bg: #f5f7fa;
  --bg-elevated: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f6f8fb;
  --border: #e4e8ee;
  --border-light: #cfd6df;
  --text: #1f2937;
  --text-muted: #64748b;
  --text-dim: #94a3b8;
  --accent: #0784c3;
  --accent-hover: #056b9e;
  --accent-muted: #e8f4fa;
  --success: #16a34a;
  --success-muted: #eaf7ef;
  --warning: #d97706;
  --warning-muted: #fff6e7;
  --danger: #dc2626;
  --danger-muted: #fef0f0;
  --purple: #7c3aed;
  --cyan: #0891b2;
  --radius: 6px;
  --radius-lg: 8px;
  --shadow: 0 1px 2px rgba(15,23,42,.04);
  --shadow-lg: 0 8px 24px rgba(15,23,42,.08);
  --topbar-h: 64px;
}

html { font-size: 14px; }
body {
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

a { color: #0784c3; }
a:hover { color: #056b9e; }
code, .mono { font-size: .875em; }

/* Header: clean explorer navigation */
.topbar {
  position: sticky;
  background: #fff;
  border-bottom: 1px solid #e4e8ee;
  box-shadow: 0 1px 2px rgba(15,23,42,.03);
  backdrop-filter: none;
}
.topbar-inner {
  max-width: 1320px;
  padding: 0 20px;
  gap: 18px;
}
.brand-mark { color: #0784c3; font-size: 1.35rem; }
.brand-name { color: #111827; font-size: 1.35rem; }
.search { max-width: 390px; }
.search input {
  height: 38px;
  background: #f8fafc;
  border-color: #d9e0e8;
  border-radius: 6px;
}
.search input:focus {
  border-color: #0784c3;
  box-shadow: 0 0 0 3px rgba(7,132,195,.10);
}
.search-icon { color: #8b98a9; }
.nav { gap: 2px; }
.nav-link {
  padding: 8px 9px;
  border-radius: 5px;
  color: #526173;
  font-size: .82rem;
}
.nav-link:hover { color: #111827; background: #f1f5f9; }
.nav-link.active {
  color: #0784c3;
  background: #eaf5fa;
}
.topbar-actions { gap: 8px; }
.net-badge {
  border-radius: 5px;
  background: #f8fafc;
  border-color: #dfe5ec;
  color: #64748b;
  font-size: .72rem;
}
.net-badge.online {
  color: #16803c;
  background: #edf8f1;
  border-color: #bfe4ca;
}
.net-badge.offline {
  color: #b42318;
  background: #fff3f2;
  border-color: #f1c2bd;
}

/* Main container */
.app {
  max-width: 1320px;
  padding: 24px 20px 48px;
}
.page-title {
  color: #172033;
  font-size: 1.55rem;
  font-weight: 600;
  margin: 0 0 14px;
  letter-spacing: -.015em;
}
.page-subtitle {
  color: #64748b;
  margin: -6px 0 18px;
}
.section { margin-top: 24px; }
.section-title {
  color: #334155;
  font-size: .98rem;
  font-weight: 600;
}
.breadcrumb {
  margin: 2px 0 14px;
  font-size: .78rem;
  color: #7a8797;
}
.breadcrumb .sep { margin: 0 8px; color: #b3bdc9; }

/* Etherscan-like cards */
.card {
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 7px;
  padding: 18px 20px;
  box-shadow: 0 1px 2px rgba(15,23,42,.025);
}
.card-label {
  color: #738197;
  font-size: .72rem;
  letter-spacing: .035em;
}
.card-value { color: #182230; }
.card-value.sm { color: #334155; }
.stat-card {
  min-height: 112px;
  justify-content: center;
  border-radius: 7px;
}
.stat-card .stat-icon {
  display: none;
}
.stat-card .card-label {
  text-transform: none;
  font-size: .78rem;
  margin-bottom: 7px;
}
.stat-card .card-value {
  font-size: 1.38rem;
}
.stat-card .card-value::first-letter { color: inherit; }

/* Dashboard hero */
.explorer-hero {
  margin: -24px -20px 24px;
  padding: 30px 20px 26px;
  background: linear-gradient(180deg, #f0f7fb 0%, #f7fafc 100%);
  border-bottom: 1px solid #e2e9ef;
}
.explorer-hero-inner { max-width: 980px; margin: 0 auto; text-align: center; }
.explorer-hero h1 {
  margin: 0 0 6px;
  font-size: 1.65rem;
  color: #172033;
}
.explorer-hero p {
  margin: 0 0 18px;
  color: #64748b;
  font-size: .88rem;
}
.hero-search {
  display: flex;
  max-width: 760px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #cfd9e3;
  border-radius: 7px;
  box-shadow: 0 2px 8px rgba(15,23,42,.06);
  overflow: hidden;
}
.hero-search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  border: 0;
  outline: 0;
  padding: 0 15px;
  color: #1f2937;
  font: inherit;
  background: #fff;
}
.hero-search button {
  width: 48px;
  border: 0;
  background: #0784c3;
  color: #fff;
  cursor: pointer;
}
.hero-search button:hover { background: #056b9e; }

/* Tables */
.table-wrap {
  border: 1px solid #dfe5eb;
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15,23,42,.025);
}
table { font-size: .83rem; }
th {
  padding: 11px 14px;
  color: #68778a;
  background: #f8fafc;
  border-bottom: 1px solid #dfe5eb;
  font-size: .70rem;
  font-weight: 600;
  text-transform: uppercase;
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid #edf0f3;
  color: #334155;
}
tbody tr:hover { background: #f8fbfd; }
tbody tr:last-child td { border-bottom: 0; }
.truncate { max-width: 230px; }
.empty { color: #8996a7; }

/* Links and status */
.pill {
  border-radius: 4px;
  padding: 3px 7px;
  font-size: .66rem;
  font-weight: 600;
}
.pill-info { background: #e9f5fb; color: #0877ad; }
.pill-ok { background: #eaf7ef; color: #18753b; }
.pill-warn { background: #fff5e5; color: #9a5b05; }
.pill-danger { background: #fff0f0; color: #b42318; }

.btn {
  height: 34px;
  border-radius: 5px;
  background: #fff;
  border-color: #d6dde5;
  color: #334155;
}
.btn:hover { background: #f8fafc; border-color: #bfc9d5; }
.btn-primary {
  background: #0784c3;
  border-color: #0784c3;
  color: #fff;
}
.btn-primary:hover {
  background: #056b9e;
  border-color: #056b9e;
}
.btn-ghost { background: transparent; border-color: transparent; }
.btn-icon { color: #64748b; }

/* Search/lookup toolbars */
.toolbar {
  padding: 12px;
  margin-bottom: 12px;
  background: #fff;
  border: 1px solid #e1e6ed;
  border-radius: 7px;
}
.toolbar input {
  height: 35px;
  background: #fff;
  border-color: #d6dde5;
  border-radius: 5px;
}
.toolbar input:focus {
  border-color: #0784c3;
  box-shadow: 0 0 0 3px rgba(7,132,195,.10);
}

/* Detail pages */
.detail-grid {
  grid-template-columns: 155px 1fr;
  gap: 0;
}
.detail-grid dt,
.detail-grid dd {
  padding: 10px 0;
  border-bottom: 1px solid #edf0f3;
}
.detail-grid dt { color: #64748b; font-weight: 500; }
.detail-grid dd { color: #334155; }
.detail-grid dt:last-of-type,
.detail-grid dd:last-of-type { border-bottom: 0; }

.tabs {
  background: #fff;
  border: 1px solid #e1e6ed;
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
  margin-bottom: 0;
  padding: 0 8px;
}
.tab { padding: 11px 14px; color: #64748b; }
.tab.active { color: #0784c3; border-bottom-color: #0784c3; }
#tab-overview, #tab-raw {
  background: #fff;
  border: 1px solid #e1e6ed;
  border-top: 0;
  border-radius: 0 0 7px 7px;
  padding: 18px;
}

pre.json {
  background: #f8fafc;
  border-color: #e1e6ed;
  color: #475569;
  border-radius: 5px;
  font-size: .77rem;
}

/* Block transaction rows */
.tx-item {
  background: #fff !important;
  border-color: #e7ebf0 !important;
  color: #334155;
}
.tx-item:hover { background: #f8fafc !important; }

/* Pagination/footer */
.pagination {
  color: #64748b;
  margin-top: 14px;
}
.footer {
  background: #fff;
  border-top: 1px solid #e1e6ed;
  color: #7b8796;
}
.footer-inner { max-width: 1320px; padding: 16px 20px; }

/* Settings dialog */
#settings-dialog {
  border: 1px solid #dfe5eb;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
}
#settings-dialog::backdrop { background: rgba(15,23,42,.35); }
.settings-form { color: #334155; }
.settings-form input {
  background: #fff;
  border-color: #d6dde5;
  color: #1f2937;
}
.dialog-header { border-bottom-color: #e7ebf0; }
.hint { color: #7a8797; }

/* ABI / contract panels */
.abi-method {
  border: 1px solid #e1e6ed !important;
  background: #fff !important;
}
.abi-method-header { background: #f8fafc !important; }
.abi-method-body { border-top-color: #e7ebf0 !important; }

/* Loading/error */
.loading { color: #718096; }
.loading::before { border-color: #dbe2ea; border-top-color: #0784c3; }
.error-box {
  background: #fff4f3;
  border-color: #efc7c3;
  color: #9f2d22;
}

/* Mobile: keep explorer usable */
@media (max-width: 1050px) {
  .topbar-inner { gap: 12px; }
  .nav { display: none; }
  .search { max-width: none; }
}
@media (max-width: 600px) {
  .app { padding: 18px 12px 36px; }
  .explorer-hero { margin: -18px -12px 20px; padding: 24px 12px; }
  .explorer-hero h1 { font-size: 1.35rem; }
  .hero-search input { height: 42px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid dt { border-bottom: 0; padding-bottom: 2px; }
  .detail-grid dd { padding-top: 2px; }
}
