:root {
  --bg: #0a0b0e;
  --surface: #111318;
  --surface-alt: #161a21;
  --border: #1e2330;
  --border-subtle: rgba(255, 255, 255, 0.06);
  --text: #e8ebf0;
  --text-dim: #7a8194;
  --accent: #5b8def;
  --accent-glow: rgba(91, 141, 239, 0.15);
  --green: #22c55e;
  --green-dim: rgba(34, 197, 94, 0.15);
  --mono: 'JetBrains Mono', monospace;
  --sans: 'Inter', "SF Pro Display", -apple-system, system-ui, "Segoe UI", Roboto, sans-serif;

  /* Animation tokens */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --duration-normal: 0.2s;
  --duration-slow: 0.4s;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.4);
}

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  zoom: 1.5;
}

.app {
  padding: 16px 24px 48px;
}

/* ═══════════════════════════════════════════════════════════════
   TOP BAR - Editorial/Glassmorphic Style
   ═══════════════════════════════════════════════════════════════ */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: linear-gradient(135deg,
      rgba(17, 19, 24, 0.95) 0%,
      rgba(22, 26, 33, 0.9) 100%);
  border: 1px solid var(--border);
  border-top: 1px solid var(--border-subtle);
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow:
    0 1px 0 0 var(--border-subtle) inset,
    0 4px 24px -8px rgba(0, 0, 0, 0.5),
    0 1px 2px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  position: relative;
  overflow: hidden;

  /* Entrance animation */
  animation: slideDown var(--duration-slow) var(--ease-out-expo) forwards;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Subtle top highlight for depth */
.topbar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 1px;
  background: linear-gradient(90deg,
      transparent 0%,
      rgba(255, 255, 255, 0.08) 50%,
      transparent 100%);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-img {
  width: 48px;
  height: auto;
}

@keyframes logoPulse {

  0%,
  100% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 4px 12px -2px rgba(91, 141, 239, 0.4);
  }

  50% {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1) inset, 0 4px 20px -2px rgba(91, 141, 239, 0.6);
  }
}

.title {
  font-weight: 500;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}

.subtitle {
  display: none;
}

.meta {
  display: flex;
  align-items: center;
  gap: 12px;
}

.price-pill {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  padding: 8px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  letter-spacing: -0.01em;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  transition: all var(--duration-normal) var(--ease-out-expo);
}

.price-pill:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.ghost {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  background: linear-gradient(135deg, var(--surface-alt) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out-expo);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}

.ghost::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--accent) 0%, var(--green) 100%);
  opacity: 0;
  transition: opacity var(--duration-normal) var(--ease-out-expo);
}

.ghost:hover {
  border-color: var(--accent);
  color: var(--text);
  box-shadow:
    0 4px 12px -4px rgba(91, 141, 239, 0.4),
    0 0 0 3px var(--accent-glow);
}

.ghost:active {
  transform: translateY(1px);
}

/* Accessibility: Focus rings */
.ghost:focus-visible,
.price-pill:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Tabs */
.tabs {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
  margin-bottom: 16px;
  gap: 4px;
}

.tabs.inline {
  margin-bottom: 0;
}

.network-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--green);
  padding: 4px 10px;
  background: var(--green-dim);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.network-tag::before {
  content: "";
  width: 6px;
  height: 6px;
  background: var(--green);
  border-radius: 50%;
}

.tab {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
}

.tab.active {
  background: linear-gradient(135deg, var(--accent) 0%, #3980ff 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(91, 141, 239, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1) inset;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Panel */
.panel {
  display: none;
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel.active {
  display: block;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-header h2 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 4px;
}

.panel-meta,
.muted {
  color: var(--text-dim);
  font-size: 12px;
}

.panel-tag {
  font-size: 12px;
  font-weight: 500;
  padding: 6px 12px;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-tag::before {
  content: '';
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

/* Hero Stats Row - Tranche + Price */
.hero-stats {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.hero-stat {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.hero-stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--green-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.hero-stat-content {
  flex: 1;
}

.hero-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 2px;
}

.hero-stat-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 500;
  color: var(--text);
}

.hero-stat-sub {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Stats Grid */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.card-header h3 {
  font-size: 13px;
  font-weight: 500;
}

.card-title {
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.card-value {
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.card-subvalue {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  margin-top: 4px;
}

/* Two Column Layout */
.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

/* Tables */
.table {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.table-header {
  background: var(--surface-alt);
  box-shadow: 0 1px 0 var(--border);
  position: sticky;
  top: 0;
  z-index: 2;
}

.table-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 320px;
  overflow-y: auto;
}

.table-row {
  display: grid;
  grid-template-columns: 1.5fr 1fr 0.8fr;
  gap: 8px;
  padding: 8px 20px 8px 10px;
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 11px;
  align-items: center;
}

.table-row:first-child {
  border-radius: 6px 6px 0 0;
}

.table-row:last-child {
  border-radius: 0 0 6px 6px;
}

.table-row:only-child {
  border-radius: 6px;
}

.table-row div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.table-row div:nth-child(2),
.table-row div:nth-child(3) {
  text-align: right;
}

.table-row.header {
  background: transparent;
  font-family: var(--sans);
  font-size: 10px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 6px 20px 6px 10px;
}

.table-row a {
  color: var(--accent);
  text-decoration: none;
}

.address-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.table-row:hover:not(.header) {
  background: var(--border);
}

.table-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 12px;
  background: var(--surface-alt);
  border-radius: 6px;
}

.sort-toggle {
  font-size: 9px;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 2px;
  margin-left: 2px;
}

.sort-toggle:hover {
  color: var(--accent);
}

/* Feed */
.feed {
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-height: 280px;
  overflow-y: auto;
}

.feed-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 11px;
}

.feed-item:first-child {
  border-radius: 6px 6px 0 0;
}

.feed-item:last-child {
  border-radius: 0 0 6px 6px;
}

.feed-item a {
  color: var(--accent);
  text-decoration: none;
}

.feed-item .muted {
  font-size: 10px;
  margin-top: 1px;
}

.badge {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 500;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.badge.info,
.badge.neutral {
  background: rgba(91, 141, 239, 0.15);
  color: var(--accent);
}

.badge.danger {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Responsive */
@media (max-width: 1100px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats {
    flex-direction: column;
  }
}

@media (max-width: 768px) {
  body {
    zoom: 1;
  }

  .app {
    padding: 12px 12px 32px;
  }

  .topbar {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
    padding: 14px 16px;
  }

  .brand {
    justify-content: center;
  }

  .top-actions {
    flex-direction: column;
    gap: 10px;
  }

  .tabs {
    width: 100%;
    order: 1;
  }

  .tab {
    flex: 1;
    text-align: center;
    padding: 10px 12px;
    font-size: 12px;
  }

  .network-tag {
    order: 2;
    text-align: center;
  }

  .meta {
    order: 3;
    justify-content: space-between;
    width: 100%;
  }

  .price-pill {
    flex: 1;
    text-align: center;
  }

  .ghost {
    flex-shrink: 0;
  }

  .hero-stats {
    flex-direction: column;
    gap: 10px;
  }

  .hero-stat {
    padding: 14px 16px;
  }

  .cards {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .card {
    padding: 14px;
  }

  .card-header h3 {
    font-size: 13px;
  }

  .panel-header {
    flex-direction: column;
    gap: 10px;
  }

  /* Mobile table: show as stacked cards */
  .table-row {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px 12px;
  }

  .table-row div:first-child {
    grid-column: 1 / -1;
    font-size: 12px;
    margin-bottom: 2px;
  }

  .table-row div:nth-child(2),
  .table-row div:nth-child(3) {
    text-align: left;
    font-size: 11px;
    color: var(--text-dim);
  }

  .table-row div:nth-child(2)::before {
    content: 'Amount: ';
    color: var(--text-dim);
    opacity: 0.7;
  }

  .table-row div:nth-child(3)::before {
    content: 'USD: ';
    color: var(--text-dim);
    opacity: 0.7;
  }

  .table-row.header {
    display: none;
  }

  .table-body {
    max-height: 260px;
  }

  /* Feed mobile */
  .feed {
    max-height: 220px;
  }

  .feed-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 10px 12px;
  }

  .feed-item > div:first-child {
    width: 100%;
  }
}

@media (max-width: 400px) {
  .app {
    padding: 8px 8px 24px;
  }

  .topbar {
    padding: 12px;
    border-radius: 8px;
  }

  .logo-img {
    width: 36px;
  }

  .title {
    font-size: 14px;
  }

  .tab {
    padding: 8px 10px;
    font-size: 11px;
  }

  .card-value {
    font-size: 16px;
  }

  .hero-stat-value {
    font-size: 22px;
  }
}
