:root {
  --bg: #0f1115;
  --fg: #e7e7e7;
  --muted: #9aa0a6;
  --accent: #6ea8fe;
  --card: #171a21;
  --border: #262a33;
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg); color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
}

header {
  padding: 24px 16px 8px;
  border-bottom: 1px solid var(--border);
}
h1 { margin: 0; font-size: 20px; }
.tagline { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.controls {
  display: grid; gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.buttons {
  display: grid;
  grid-template-columns: repeat(13, minmax(0, 1fr));
  gap: 6px;
}
@media (max-width: 800px) {
  .buttons { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
.buttons button {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
.buttons button.active { outline: 2px solid var(--accent); }
.buttons button:hover { border-color: var(--accent); }

.toggles { color: var(--muted); font-size: 13px; }
.toggles label { cursor: pointer; }

.info {
  display: flex; gap: 16px; flex-wrap: wrap;
  color: var(--muted); font-size: 12px;
}

.table-wrap { padding: 12px 16px 24px; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
thead th {
  text-align: left;
  font-weight: 600;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--muted);
  background: #141821;
  position: sticky; top: 0; z-index: 1;
}
tbody td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
}
tbody tr:hover { background: #131720; }
tbody tr.hidden { display: none; }

/* Base alignment (mobile defaults) */
th:nth-child(1), td:nth-child(1) { text-align: left; }
th:nth-child(2), td:nth-child(2),
th:nth-child(3), td:nth-child(3),
th:nth-child(4), td:nth-child(4),
th:nth-child(5), td:nth-child(5) { text-align: right; }

footer {
  padding: 12px 16px 24px;
  color: var(--muted); font-size: 12px;
}

/* Desktop: compact spacing and left-aligned table */
@media (min-width: 900px) {
  table {
    table-layout: fixed;
    width: auto;          /* shrink to content width */
    margin-left: 16px;    /* left alignment */
    border-spacing: 0;
  }

  thead th, tbody td {
    padding: 6px 10px;    /* compact cell spacing */
  }

  th:nth-child(1), td:nth-child(1) {
    width: 90px;
    min-width: 90px;
    max-width: 90px;
    text-align: left;
  }

  th:nth-child(2), td:nth-child(2) {
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    text-align: right;
  }

  th:nth-child(3), td:nth-child(3),
  th:nth-child(4), td:nth-child(4),
  th:nth-child(5), td:nth-child(5) {
    width: 150px;
    min-width: 150px;
    max-width: 150px;
    text-align: right;
  }
}
