:root {
  color-scheme: dark;
  --bg: #0b111b;
  --panel: #151f2e;
  --border: #263244;
  --text: #e2e8f0;
  --muted: #8494aa;
  --green: #4ade80;
  --red: #f87171;
  --blue: #38bdf8;
  --yellow: #fbbf24;
}

* { box-sizing: border-box; }

body {
  margin: 0 auto;
  max-width: 1000px;
  background: var(--bg);
  color: var(--text);
  font: 11px/1.5 Arial, sans-serif;
  font-variant-numeric: tabular-nums;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.brand {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
}

.muted { color: var(--muted); font-size: 10px; }
.positive { color: var(--green); }
.negative { color: var(--red); }
.warning { color: var(--yellow); }

main {
  padding: 10px;
  padding-bottom: 95px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px;
  margin-bottom: 8px;
}

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

.grid .panel { margin: 0; }

.metric {
  font-size: 18px;
  font-weight: 600;
  margin-top: 4px;
}

.hero { text-align: center; }
.hero .metric { font-size: 28px; }

h2 {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 10px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.row:last-child { border: 0; }

button {
  font: inherit;
  cursor: pointer;
  color: var(--text);
  background: #1e3448;
  border: 1px solid #30465a;
  border-radius: 7px;
  padding: 10px;
}

button:disabled { opacity: .5; }

.refresh {
  width: 100%;
  margin: 10px 0;
  color: var(--blue);
}

nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 1000px);
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: #101925;
  border-top: 1px solid var(--border);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
}

nav button {
  background: none;
  border: 0;
  font-size: 18px;
  padding: 5px 0;
  color: var(--muted);
}

nav button.active { color: var(--blue); }

nav small {
  display: block;
  font-size: 9px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}

td, th {
  padding: 7px 3px;
  text-align: right;
  border-bottom: 1px solid var(--border);
}

td:first-child, th:first-child {
  text-align: left;
}

th { color: var(--muted); }

.scroll { overflow-x: auto; }

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