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

body {
  margin: 0;
  padding: 20px;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top, #0b1020 0, #020617 55%, #000 100%);
  color: #e5e7eb;
}

h1 {
  text-align: center;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 1.2rem;
}

.subtitle {
  text-align: center;
  font-size: 0.85rem;
  color: #9ca3af;
  margin-bottom: 20px;
}

.pair-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(8, 47, 73, 0.9);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.4);
  font-family: monospace;
  font-size: 0.8rem;
  color: #e0f2fe;
}

.layout {
  max-width: 1300px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #9ca3af;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ef4444;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
}

.status-ok .status-dot {
  background: #22c55e;
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
}

.card {
  background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.95), rgba(15, 23, 42, 0.85));
  border-radius: 16px;
  border: 1px solid rgba(30, 64, 175, 0.5);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.85);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at top right, rgba(56, 189, 248, 0.06), transparent);
  opacity: 0.8;
  pointer-events: none;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  position: relative;
  z-index: 1;
}

.card-header-inner {
  margin-bottom: 6px;
}

.card-header h2 {
  margin: 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.exchange-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.7);
  background: rgba(15, 23, 42, 0.9);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #bae6fd;
}

.small {
  font-size: 0.75rem;
  color: #6b7280;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.grid-3-stack {
  align-items: flex-start;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  font-size: 0.8rem;
}

.metric {
  background: rgba(15, 23, 42, 0.9);
  border-radius: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(30, 64, 175, 0.6);
  backdrop-filter: blur(8px);
}

.metric-label {
  color: #9ca3af;
  font-size: 0.75rem;
  margin-bottom: 2px;
}

.metric-value {
  font-size: 0.95rem;
  font-weight: 600;
}

.metric-sub {
  font-size: 0.7rem;
  color: #6b7280;
}

.positive {
  color: #22c55e;
}

.negative {
  color: #ef4444;
}

.ratio-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(30, 64, 175, 0.7);
  margin-top: 4px;
}

.ratio-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(to right, #22c55e, #22d3ee, #0ea5e9);
  width: 50%;
  transition: width 0.3s ease;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

th,
td {
  padding: 3px 4px;
  text-align: right;
  white-space: nowrap;
}

th {
  color: #9ca3af;
  border-bottom: 1px solid #1f2937;
  font-weight: 600;
}

tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.9);
}

tr:nth-child(odd) td {
  background: rgba(15, 23, 42, 0.7);
}

.price-bid {
  color: #22c55e;
  font-weight: 600;
}

.price-ask {
  color: #ef4444;
  font-weight: 600;
}

.tables-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  margin-bottom: 4px;
  color: #9ca3af;
}

.panel-title span:first-child {
  font-weight: 600;
}

@media (max-width: 1100px) {
  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .tables-wrapper {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    padding: 12px;
  }
  h1 {
    font-size: 1rem;
  }
}
