:root {
  --bg: #0d1117;
  --bg-card: #151b23;
  --border: #2a323c;
  --text: #e6edf3;
  --text-dim: #8b949e;
  --accent: #ff6b5e;
  --accent-dim: #c73e2f;
  --advisory: #d9a441;
  --confirmed: #4caf7d;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 10;
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.brand::before { content: "▲ "; color: var(--accent); }

.site-header nav a {
  color: var(--text-dim);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.9rem;
}
.site-header nav a:hover { color: var(--text); }

main {
  max-width: 860px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.filters input, .filters select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  font-size: 0.85rem;
}
.filters button {
  background: var(--accent-dim);
  border: none;
  color: white;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
}
.filters a.clear {
  align-self: center;
  color: var(--text-dim);
  font-size: 0.85rem;
  text-decoration: none;
}

.timeline { list-style: none; margin: 0; padding: 0; }

.incident-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--text-dim);
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.75rem;
}
.incident-card.status-confirmed { border-left-color: var(--confirmed); }
.incident-card.status-official_notification { border-left-color: var(--accent); }

.incident-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
  font-size: 0.75rem;
}

.badge {
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.68rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: #1f2733;
  color: var(--text-dim);
  border: 1px solid var(--border);
}
.badge.type-ransomware { color: var(--accent); border-color: var(--accent-dim); }
.badge.type-nation-state { color: #b98cf0; border-color: #6c4a99; }
.badge.type-supply-chain { color: var(--advisory); border-color: #8a641f; }

.incident-meta .date { color: var(--text-dim); margin-left: auto; }

.incident-title {
  color: var(--text);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 600;
  display: block;
}
.incident-title:hover { color: var(--accent); }

.incident-sub {
  color: var(--text-dim);
  font-size: 0.82rem;
  margin-top: 0.2rem;
}

.empty { color: var(--text-dim); }

.back {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-block;
  margin-bottom: 1rem;
}

.incident-detail h1 { margin: 0.5rem 0 1rem; font-size: 1.4rem; }

.incident-fields {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.2rem 1rem;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.incident-fields dt { color: var(--text-dim); }
.incident-fields dd { margin: 0; }

.source-list { list-style: none; padding: 0; }
.source-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}
.source-list a { color: var(--text); }
.source-name, .source-list .date { color: var(--text-dim); font-size: 0.8rem; }

.health-table, .review-list { width: 100%; }
.health-table {
  border-collapse: collapse;
  font-size: 0.82rem;
  margin-bottom: 2rem;
}
.health-table th, .health-table td {
  border-bottom: 1px solid var(--border);
  padding: 0.4rem 0.6rem;
  text-align: left;
}
.health-table tr.unhealthy { color: var(--accent); }
.error-cell { color: var(--text-dim); max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.review-list { list-style: none; padding: 0; font-size: 0.85rem; }
.review-list li { padding: 0.3rem 0; border-bottom: 1px solid var(--border); }

.site-footer {
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  padding: 2rem 1rem;
}

@media (max-width: 600px) {
  .site-header nav a { margin-left: 0.75rem; }
}
