/* One dark theme, shared with the chart's colours in app.js. */
:root {
  color-scheme: dark;
  --bg: #0e131a;
  --card: #141b24;
  --border: #2a3444;
  --text: #c7d0dc;
  --muted: #8290a3;
  --accent: #5b9cf6;
  --up: #2ebd85;
  --down: #f6465d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 12px 16px 24px;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}

header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 16px;
  margin-bottom: 10px;
}

h1 { margin: 0; font-size: 20px; font-weight: 600; }
h1 .muted, .muted { color: var(--muted); font-weight: 400; }
.status { margin: 0; color: var(--muted); }

.error {
  margin: 0 0 10px;
  padding: 8px 12px;
  border: 1px solid var(--down);
  border-radius: 6px;
  background: #3a1d22;
  color: #ffd7dc;
}

.chart-card, .card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 0;
}
.chart-card { padding: 6px 8px 4px; }
.card { padding: 12px 14px; }

.legend {
  min-height: 1.6em;
  padding: 2px 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend b { color: var(--text); font-weight: 500; }

.chart { height: 56vh; min-height: 340px; }

.hint, .footnote { margin: 6px 6px 2px; font-size: 12px; color: var(--muted); }
.footnote { margin: 10px 0 0; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 12px;
  margin-top: 12px;
}

.card h2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 15px;
}
.meta { margin: 0 0 8px; color: var(--muted); }

.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
th, td { padding: 4px 8px; text-align: right; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { text-align: left; }
th { font-size: 12px; font-weight: 500; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.up { color: var(--up); }
.down { color: var(--down); }

select {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

footer { margin-top: 16px; font-size: 12px; color: var(--muted); }
footer a { color: var(--accent); }
