:root {
  color-scheme: dark;
  --bg: #121417;
  --panel: #1b2026;
  --panel-2: #232a31;
  --text: #f2f5f7;
  --muted: #9ba8b5;
  --line: #323b45;
  --green: #42d392;
  --yellow: #f4c430;
  --red: #ff5f57;
  --blue: #5aa7ff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  font-weight: 720;
}

h2 {
  font-size: 15px;
  font-weight: 680;
}

p {
  color: var(--muted);
  margin-top: 6px;
}

.status-pill {
  min-width: 132px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: var(--panel);
  color: var(--muted);
  font-weight: 650;
}

.status-pill.healthy {
  color: #062414;
  background: var(--green);
  border-color: var(--green);
}

.status-pill.active {
  color: #17210a;
  background: var(--yellow);
  border-color: var(--yellow);
}

.status-pill.failed {
  color: #2b0807;
  background: var(--red);
  border-color: var(--red);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  margin: 24px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.metrics div {
  background: var(--panel);
  padding: 18px;
}

.metrics span {
  display: block;
  font-size: 30px;
  font-weight: 760;
}

.metrics label {
  display: block;
  color: var(--muted);
  margin-top: 4px;
  font-size: 13px;
}

.toolbar {
  display: flex;
  gap: 10px;
  margin-bottom: 26px;
}

.toolbar a,
button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  padding: 9px 12px;
  text-decoration: none;
}

.token-form {
  display: grid;
  gap: 10px;
  max-width: 420px;
  margin-top: 24px;
}

.token-form label {
  color: var(--muted);
  font-size: 13px;
}

.token-form input {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--text);
  font: inherit;
  padding: 10px 12px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.activity {
  display: grid;
  gap: 10px;
}

.heartbeats {
  display: grid;
  gap: 10px;
  margin-bottom: 26px;
}

.row {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.heartbeat {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
}

.heartbeat.stale {
  border-color: color-mix(in srgb, var(--red) 55%, var(--line));
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.dot.healthy {
  background: var(--green);
}

.dot.active {
  background: var(--yellow);
}

.dot.failed {
  background: var(--red);
}

.title {
  font-weight: 680;
  overflow-wrap: anywhere;
}

.meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.provider {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

@media (max-width: 640px) {
  .shell {
    width: min(100vw - 20px, 1120px);
    padding-top: 18px;
  }

  .topbar,
  .toolbar {
    flex-direction: column;
  }

  .metrics {
    grid-template-columns: 1fr;
  }

  .row {
    grid-template-columns: 12px minmax(0, 1fr);
  }

  .provider {
    grid-column: 2;
  }
}
