:root,
[data-theme="light"] {
  color-scheme: light;
  --ink: #1b1d22;
  --mute: #666b76;
  --paper: #f2f2ee;
  --card: #fbfbf8;
  --field: #2f4858;
  --on-field: #eef2f4;
  --line: #dcdcd4;
  --chip: #e7e7df;
  --header: #1f2b38;
  --header-mute: #c3ccd4;
  --header-sep: #47586a;
  --danger: #9b2c2c;
  --danger-bg: #f7e9e7;
  --danger-line: #d9b8b2;
  --warn-bg: #efddb4;
  --warn-line: #d8bd74;
  --warn-ink: #6a5218;
  --signal-running: #b97612;
  --signal-queued: #3e5b74;
  --signal-failed: #9b2c2c;
  --signal-success: #2f5a44;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef0f2;
  --mute: #a6adb6;
  --paper: #121417;
  --card: #1a1d21;
  --field: #5d8ba3;
  --on-field: #eef2f4;
  --line: #34383d;
  --chip: #262a2f;
  --header: #16202a;
  --header-mute: #aebcc7;
  --header-sep: #3d4b58;
  --danger: #e39a90;
  --danger-bg: #2a1c1a;
  --danger-line: #5a3834;
  --warn-bg: #3d3220;
  --warn-line: #7a6230;
  --warn-ink: #e6c88a;
  --signal-running: #d69a38;
  --signal-queued: #6f93b0;
  --signal-failed: #d97d70;
  --signal-success: #5c9b76;
}

html,
body {
  font-family: "Avenir Next", "Segoe UI", system-ui, -apple-system, sans-serif;
  letter-spacing: 0.005em;
}

h1 {
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.012em;
  margin: 0.2rem 0 0.4rem;
}
h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  color: var(--mute);
  margin: 1.6rem 0 0.7rem;
}

.mono,
th.num,
td.num,
.stat-v {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.stats {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 0;
  margin: 0.6rem 0 1.6rem;
  border: 1px solid var(--header);
  border-radius: 3px;
  overflow: hidden;
  background: var(--header);
}
.stat {
  padding: 0.9rem 1.1rem 1rem;
  border-right: 1px solid var(--header-sep);
}
.stat:last-child {
  border-right: 0;
}
.stat-k {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--header-mute);
}
.stat-v {
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.05;
  color: var(--on-field);
}

table {
  border-radius: 3px;
}
th {
  font-weight: 600;
  font-size: 0.76rem;
  color: var(--mute);
}
tbody tr {
  transition: background-color 120ms ease;
}
tbody tr:hover {
  background: color-mix(in srgb, var(--field) 6%, transparent);
}
td a {
  color: var(--field);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--field) 35%, transparent);
}
td a:hover {
  border-bottom-color: var(--field);
}

.badge {
  font-weight: 600;
  font-size: 0.74rem;
  padding: 0.08rem 0.55rem;
  border-radius: 999px;
  color: var(--ink);
  background: var(--chip);
}

.share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.9rem;
  margin: 1.8rem 0 0;
  font-size: 0.85rem;
}
.share .mute {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
}
.share a {
  color: var(--field);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--field) 35%, transparent);
}
.share a:hover {
  border-bottom-color: var(--field);
}

.live {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--header-mute);
}
.live-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  background: var(--header-mute);
}
.live-open .live-dot {
  background: #7cd39a;
  box-shadow: 0 0 0 3px rgba(124, 211, 154, 0.22);
}
.live-connecting .live-dot {
  background: var(--signal-running);
}

.chart-raw {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  margin: 0.5rem 0 0;
  font-size: 0.78rem;
  color: var(--mute);
}
.raw-chip {
  padding: 0.08rem 0.5rem;
  border-radius: 999px;
  background: var(--chip);
  color: var(--ink);
  border-bottom: 1px dotted color-mix(in srgb, var(--field) 55%, transparent);
  cursor: help;
}
.raw-hint {
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

@media (max-width: 720px) {
  .stats {
    grid-auto-flow: row;
    grid-auto-columns: auto;
  }
  .stat {
    border-right: 0;
    border-bottom: 1px solid var(--header-sep);
  }
  .stat:last-child {
    border-bottom: 0;
  }
}
