:root {
  color-scheme: light;
  --bg: #f4f7f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --line: #dce5e8;
  --text: #16272d;
  --muted: #64777e;
  --mint: #0b8f78;
  --mint-soft: rgba(11, 143, 120, 0.09);
  --amber: #c47a12;
  --danger: #c94c45;
  --blue: #3978d5;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 12% -8%, rgba(11, 143, 120, 0.10), transparent 32rem),
    linear-gradient(180deg, #f8fbfb 0%, var(--bg) 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: 0.45;
  background-image: linear-gradient(rgba(31,68,76,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(31,68,76,.035) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, black, transparent 78%);
}

main { width: min(1500px, calc(100% - 48px)); margin: 0 auto; padding: 48px 0 32px; }

.masthead, .section-heading, .panel-heading, footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.eyebrow, .kicker {
  margin: 0 0 8px;
  color: var(--mint);
  font-size: .76rem;
  font-weight: 750;
  letter-spacing: .14em;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(2.4rem, 5vw, 4.5rem); line-height: .98; letter-spacing: -.055em; font-weight: 720; }
h2 { margin-bottom: 0; font-size: clamp(1.35rem, 2vw, 2rem); letter-spacing: -.03em; }
h3 { margin-bottom: 9px; font-size: 1rem; }
.lede { margin-bottom: 0; color: var(--muted); font-size: 1rem; }

.download {
  flex: 0 0 auto;
  color: #ffffff;
  background: var(--mint);
  padding: 12px 17px;
  border-radius: 9px;
  text-decoration: none;
  font-size: .9rem;
  font-weight: 750;
  box-shadow: 0 10px 24px rgba(11,143,120,.18);
}
.download:hover { filter: brightness(1.08); }
.download:focus-visible { outline: 3px solid rgba(11,143,120,.25); outline-offset: 3px; }

.metric-grid { display: grid; grid-template-columns: 1.25fr 1fr 1fr 1fr; gap: 12px; margin: 36px 0 14px; }
.metric-card, .panel, .person-card {
  background: rgba(255, 255, 255, .96);
  border: 1px solid var(--line);
  box-shadow: 0 12px 34px rgba(40, 67, 73, .07);
}
.metric-card { min-height: 132px; padding: 22px; border-radius: 14px; display: flex; flex-direction: column; }
.metric-card.accent { background: linear-gradient(145deg, #0b8f78, #087663); color: #ffffff; border-color: transparent; }
.metric-card.accent span, .metric-card.accent small { color: rgba(255,255,255,.78); }
.metric-card span { color: var(--muted); font-size: .82rem; }
.metric-card strong { margin-top: auto; font-size: clamp(2rem, 3.4vw, 3.25rem); line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric-card small { margin-top: 7px; color: var(--muted); font-size: .75rem; }

.panel { border-radius: 16px; padding: 24px; }
.team-panel { margin-top: 12px; }
.panel-heading { align-items: center; }
.legend { display: flex; gap: 18px; color: var(--muted); font-size: .8rem; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { display: inline-block; width: 16px; height: 3px; border-radius: 2px; }
.swatch.observed { height: 9px; background: var(--mint); }
.swatch.expected { background: var(--amber); }
.team-chart { width: 100%; height: 390px; margin-top: 8px; }
.partial-note { margin: -2px 0 0; color: var(--muted); font-size: .77rem; }

.explorer-panel { margin-top: 42px; }
.gap-panel { margin-top: 14px; }
.table-heading { align-items: flex-end; }
.table-summary { margin: 0; color: var(--muted); font-size: .82rem; text-align: right; }
.filter-row { display: flex; align-items: flex-end; gap: 10px; margin: 22px 0 16px; }
.filter-row label { display: grid; gap: 7px; min-width: 190px; color: var(--muted); font-size: .76rem; font-weight: 650; }
.filter-row input, .filter-row select, .secondary-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  background: #ffffff;
  font: inherit;
}
.filter-row input, .filter-row select { width: 100%; padding: 0 12px; }
.filter-row input { color-scheme: light; }
.filter-row input:focus-visible, .filter-row select:focus-visible, .secondary-button:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.secondary-button { padding: 0 15px; color: var(--mint); cursor: pointer; }
.secondary-button:hover { border-color: rgba(84,214,182,.4); background: var(--mint-soft); }
.table-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: 11px; }
.gap-table-wrap { max-height: 440px; }
table { width: 100%; min-width: 1040px; border-collapse: collapse; font-size: .79rem; }
th, td { padding: 12px 13px; border-bottom: 1px solid #e8eef0; text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; color: #52676e; background: #f1f5f6; font-size: .7rem; font-weight: 700; letter-spacing: .025em; }
tbody tr { background: #ffffff; }
tbody tr:nth-child(even) { background: #f9fbfb; }
tbody tr:hover { background: #edf8f5; }
td { color: #263a40; font-variant-numeric: tabular-nums; }
.num { text-align: right; }
.status-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: #edf2f3; color: #51666d; font-size: .7rem; }
.status-pill.good { color: #08725f; background: #e4f5f1; }
.status-pill.warn { color: #a6630a; background: #fff3df; }
.status-pill.danger { color: #ad3e38; background: #fdeceb; }
.empty-row td { height: 110px; color: var(--muted); text-align: center; }

.section-heading { margin: 42px 0 15px; }
.section-heading > p { max-width: 420px; margin-bottom: 1px; color: var(--muted); font-size: .86rem; text-align: right; }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.person-card { border-radius: 15px; padding: 20px 20px 12px; min-width: 0; }
.person-card.missing { border-color: rgba(255,143,135,.35); }
.person-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.person-name { margin: 0; font-size: 1.08rem; }
.person-sub { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.person-stats { display: flex; gap: 18px; text-align: right; }
.person-stats span { display: block; color: var(--muted); font-size: .68rem; }
.person-stats strong { display: block; margin-top: 3px; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.badge { display: inline-flex; align-items: center; min-height: 23px; margin-top: 10px; padding: 3px 8px; border-radius: 999px; color: #a6630a; background: #fff5e5; border: 1px solid #f1d5a7; font-size: .7rem; }
.badge.danger { color: #ad3e38; background: #fdeceb; border-color: #f1c4c1; }
.person-chart { width: 100%; height: 270px; }
.missing-state { height: 270px; display: grid; place-items: center; text-align: center; color: var(--muted); }
.missing-state strong { display: block; margin-bottom: 8px; color: var(--danger); font-size: 1.05rem; }

.data-notes { margin-top: 42px; }
.note-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--line); }
.note-grid article { min-height: 145px; padding: 19px; background: #ffffff; }
.note-grid p { margin: 0; color: var(--muted); font-size: .86rem; line-height: 1.65; }

footer { align-items: center; margin-top: 22px; padding: 0 3px; color: var(--muted); font-size: .72rem; }

@media (max-width: 980px) {
  main { width: min(100% - 28px, 900px); padding-top: 30px; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  main { width: min(100% - 20px, 600px); padding-top: 22px; }
  .masthead, .section-heading { align-items: flex-start; flex-direction: column; }
  .download { width: 100%; text-align: center; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 22px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 2rem; }
  .panel, .person-card { padding: 17px 14px 10px; }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .table-heading { gap: 8px; }
  .table-summary { text-align: left; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .filter-row label { min-width: 0; width: 100%; }
  .secondary-button { width: 100%; }
  .team-chart { height: 330px; }
  .section-heading { gap: 7px; margin-top: 32px; }
  .section-heading > p { text-align: left; }
  .person-head { flex-direction: column; }
  .person-stats { width: 100%; justify-content: flex-start; text-align: left; }
  .person-chart { height: 250px; }
  .note-grid { grid-template-columns: 1fr; }
  footer { align-items: flex-start; flex-direction: column; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
