:root {
  --green: #15803d;
  --red: #b91c1c;
  --border: #e5e7eb;
  --muted: #6b7280;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1rem;
  max-width: 960px;
  margin-inline: auto;
  font: 15px/1.4 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: #111827;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

h1 { margin: 0; font-size: 1.4rem; }

select { font: inherit; padding: 0.25rem 0.5rem; margin-left: 0.4rem; }

#status { color: var(--muted); }
#status.error { color: var(--red); }

.table-wrap { overflow-x: auto; }

table { border-collapse: collapse; width: 100%; }

th, td {
  padding: 0.4rem 0.7rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

th {
  background: #f9fafb;
  text-align: left;
  cursor: pointer;
  user-select: none;
}
th[data-type="num"], td.num { text-align: right; }

th.asc::after  { content: " \25B2"; font-size: 0.7em; }
th.desc::after { content: " \25BC"; font-size: 0.7em; }

td.ticker { font-weight: 600; }
td.pos { color: var(--green); }
td.neg { color: var(--red); }

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  font-size: 0.8em;
  color: #fff;
}
.badge.bullish { background: var(--green); }
.badge.bearish { background: var(--red); }

.new {
  margin-left: 0.35rem;
  padding: 0.05rem 0.35rem;
  border: 1px solid var(--muted);
  border-radius: 4px;
  font-size: 0.7em;
  text-transform: uppercase;
  color: var(--muted);
}
