:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1c1e21;
  --muted: #6b7280;
  --border: #e5e7eb;
  --brand: #c5050c;        /* UW–Madison cardinal */
  --brand-ink: #9b0000;
  --accent: #0479a8;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.08), 0 1px 2px rgba(0, 0, 0, 0.04);
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

.site-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-ink) 100%);
  color: #fff;
  padding: 40px 0 32px;
}
.site-header h1 { margin: 0 0 6px; font-size: 1.9rem; }
.site-header .tagline { margin: 0 0 10px; font-size: 1.05rem; opacity: 0.95; }
.site-header .meta { margin: 0; font-size: 0.88rem; opacity: 0.9; }
.site-header .meta a { color: #fff; font-weight: 600; text-decoration: underline; }

main { padding: 28px 0 48px; }

/* Summary cards */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.card .value { font-size: 2rem; font-weight: 700; line-height: 1; }
.card .label { color: var(--muted); font-size: 0.85rem; margin-top: 6px; }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 760px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 28px;
}
.panel h2 { margin: 0 0 14px; font-size: 1.15rem; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; }
.panel-head input[type="search"] {
  flex: 0 1 280px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.9rem;
}

.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; white-space: nowrap; }
th[data-sort] { cursor: pointer; user-select: none; }
th[data-sort]:hover { color: var(--ink); }
th.num, td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.sorted-asc::after { content: " ▲"; font-size: 0.7em; }
th.sorted-desc::after { content: " ▼"; font-size: 0.7em; }
tbody tr:hover { background: #fafbfc; }

.avatar {
  width: 24px; height: 24px; border-radius: 50%;
  vertical-align: middle; margin-right: 8px; background: var(--border);
}
.member-cell { display: flex; align-items: center; }
.member-cell .sub { color: var(--muted); font-size: 0.8rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  background: #eef2ff;
  color: #3730a3;
  text-transform: capitalize;
}
.badge.pr { background: #e7f5ec; color: #1b6e3c; }
.badge.docs { background: #fef3e2; color: #9a5b00; }
.badge.talk { background: #fdeaf1; color: #9b1c5b; }
.badge.maintainer { background: #ede9fe; color: #5b21b6; }
.badge.review { background: #e0f2fe; color: #075985; }

/* Collaboration network */
.toggle { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; }
.toggle input { cursor: pointer; }
.network { width: 100%; height: 480px; border: 1px solid var(--border); border-radius: 8px; background: #fcfcfd; overflow: hidden; }
.network svg { display: block; cursor: grab; }
.network svg:active { cursor: grabbing; }
.node { cursor: pointer; }
.node-label { fill: var(--ink); font-size: 10px; pointer-events: none; }
.node-label.member { font-weight: 600; }
.node-label.project { fill: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 12px; font-size: 0.82rem; color: var(--muted); }
.legend .dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 5px; vertical-align: -1px; }
.legend .dot.member { background: #c5050c; }
.legend .dot.project { background: #0479a8; }
.legend .dot.shared { background: #f59e0b; }
.legend-hint { margin-left: auto; font-style: italic; }

.more { color: var(--muted); font-size: 0.85rem; margin: 12px 0 0; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0;
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--panel);
}
