:root {
  color-scheme: dark light;
  font-family: "Inter", "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: #0f1117;
  color: #f6f7fb;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

header h1 {
  margin: 0;
  font-size: 1.75rem;
}

header p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.65);
}

button {
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  background: #4c6ef5;
  color: white;
  transition: background 0.2s ease;
}

button:hover {
  background: #5f7efc;
}

main {
  display: grid;
  grid-template-columns: minmax(280px, 360px) 1fr;
  gap: 24px;
  padding: 24px;
}

section {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  padding: 20px;
  min-height: 200px;
}

section h2 {
  margin-top: 0;
  margin-bottom: 16px;
  font-size: 1.1rem;
}

#runList {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.run-item {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: border 0.2s ease, background 0.2s ease;
}

.run-item:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.run-item.active {
  border-color: #4c6ef5;
  background: rgba(76, 110, 245, 0.12);
}

.run-item small {
  color: rgba(255, 255, 255, 0.6);
}

.details-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

#runMeta {
  text-align: right;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

.events {
  margin-top: 16px;
  max-height: 520px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.error {
  color: #ff6b6b;
}

.event-card {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
  font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  font-size: 0.85rem;
}

.event-card .type {
  font-weight: 600;
  color: #8ecbff;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(0, 0, 0, 0.85);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.hidden {
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
}

@media (max-width: 960px) {
  main {
    grid-template-columns: 1fr;
  }

  #runMeta {
    text-align: left;
  }
}
