:root {
  color-scheme: light;
  --page: #f5f6f7;
  --surface: #ffffff;
  --text: #202428;
  --muted: #687078;
  --border: #dce1e4;
  --grid: #e8ebed;
  --orange: #ef7800;
  --orange-soft: #fff1e3;
  --charcoal: #34383b;
  --charcoal-soft: #eef0f1;
  --red: #df4238;
  --red-soft: #fdecea;
  --green: #25784a;
  --green-soft: #e9f4ed;
  --teal: #147a78;
  --teal-soft: #e7f4f2;
  --blue: #2f6f9f;
  --requirement: #7c8790;
  --shadow: 0 8px 24px rgba(31, 36, 40, 0.07);
}

* {
  box-sizing: border-box;
  letter-spacing: 0;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page);
  color: var(--text);
  font-family: Inter, Aptos, "Segoe UI", Arial, sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.top-accent {
  height: 4px;
  background: var(--orange);
}

.site-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  min-height: 82px;
  padding: 15px max(20px, calc((100% - 1500px) / 2));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  padding-right: 24px;
  border-right: 1px solid var(--border);
  white-space: nowrap;
}

.brand img {
  display: block;
  width: 145px;
  height: auto;
  max-height: 48px;
  object-fit: contain;
}

.header-title p,
.section-kicker,
.metric-label,
.scope-label,
.table-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-transform: uppercase;
}

.header-title h1 {
  margin: 3px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.snapshot-state {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
}

.snapshot-state span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--green);
  font-weight: 750;
}

.snapshot-state span::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.event-nav {
  position: sticky;
  z-index: 20;
  top: 0;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
}

.event-nav-inner {
  display: flex;
  width: min(1500px, calc(100% - 40px));
  min-width: max-content;
  margin: 0 auto;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 50px;
  padding: 0 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.nav-link:first-child {
  padding-left: 0;
  padding-right: 22px;
}

.nav-link:hover {
  color: var(--text);
}

.nav-link[aria-current="page"] {
  color: var(--text);
}

.nav-link-coming-soon {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  min-width: 174px;
  color: var(--muted);
  cursor: default;
  line-height: 1.05;
}

.nav-link-coming-soon:hover {
  color: var(--muted);
}

.nav-link-coming-soon small {
  color: var(--orange);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.nav-link[aria-current="page"]::after {
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 3px;
  background: var(--orange);
  content: "";
}

.nav-link:first-child[aria-current="page"]::after {
  right: 18px;
  left: 0;
}

main {
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 48px;
}

.view-heading,
.event-heading,
.chart-heading,
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
}

.view-heading h2,
.event-heading h2,
.section-heading h2,
.chart-heading h2 {
  margin: 5px 0 0;
  font-size: 23px;
  line-height: 1.25;
}

.view-heading > p,
.section-heading > p,
.chart-subtitle,
.event-description {
  max-width: 720px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.event-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-top: 4px solid var(--charcoal);
  border-radius: 6px;
  background: var(--surface);
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.event-card:nth-child(2) {
  border-top-color: var(--orange);
}

.event-card:nth-child(3) {
  border-top-color: var(--teal);
}

.event-card:nth-child(4) {
  border-top-color: var(--green);
}

.event-card:nth-child(5) {
  border-top-color: var(--red);
}

.event-card:nth-child(6) {
  border-top-color: var(--blue);
}

.event-card:hover {
  border-color: #c8ced2;
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.event-card a {
  display: flex;
  min-height: 242px;
  flex-direction: column;
  padding: 18px;
}

.event-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.event-card h3 {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.scope-tag,
.phase-tag,
.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--charcoal-soft);
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  white-space: nowrap;
}

.event-card-coverage {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 25px;
}

.event-card-coverage strong {
  font-size: 35px;
  line-height: 1;
}

.event-card-coverage span {
  color: var(--muted);
  font-size: 11px;
}

.progress-track {
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edef;
}

.progress-value {
  height: 100%;
  background: var(--green);
}

.progress-value.warning {
  background: var(--orange);
}

.progress-value.critical {
  background: var(--red);
}

.staffing-track {
  display: flex;
  height: 8px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 4px;
  background: #e9edef;
}

.staffing-value {
  display: block;
  height: 100%;
}

.staffing-value.fgh {
  background: var(--orange);
}

.staffing-value.sdp {
  background: var(--charcoal);
}

.event-card-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: auto;
  padding-top: 20px;
}

.event-card-stats span {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
}

.event-card-stats strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 16px;
}

.overview-table-section,
.daily-table-section,
.allocation-section,
.chart-section {
  margin-top: 34px;
}

.event-heading {
  align-items: flex-start;
}

.event-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.coverage-summary {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 13px;
}

.coverage-summary strong {
  font-size: 36px;
  line-height: 1;
}

.coverage-summary span {
  color: var(--muted);
  font-size: 13px;
}

.segmented-control {
  display: grid;
  width: min(390px, 100%);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  overflow: hidden;
  border: 1px solid #cdd3d6;
  border-radius: 6px;
  background: var(--surface);
}

.segment {
  min-height: 40px;
  padding: 8px 13px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.segment + .segment {
  border-left: 1px solid #cdd3d6;
}

.segment[aria-pressed="true"] {
  background: var(--charcoal);
  color: #ffffff;
}

.segment:focus-visible,
.nav-link:focus-visible,
.event-card a:focus-visible,
.chart-scroll:focus-visible,
.bar-hit:focus-visible {
  outline: 3px solid rgba(20, 122, 120, 0.36);
  outline-offset: 2px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.metric-card {
  min-height: 116px;
  padding: 17px 17px 15px;
  border: 1px solid var(--border);
  border-left: 5px solid var(--green);
  border-radius: 6px;
  background: var(--surface);
}

.metric-card.required {
  border-left-color: var(--requirement);
}

.metric-card.fgh {
  border-left-color: var(--orange);
}

.metric-card.sdp {
  border-left-color: var(--charcoal);
}

.metric-card.gap {
  border-left-color: var(--red);
}

.metric-value {
  display: block;
  margin-top: 10px;
  font-size: 29px;
  line-height: 1;
}

.metric-context {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.allocation-section {
  padding: 18px 0 3px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.allocation-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 24px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.allocation-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 12px;
  min-height: 42px;
  padding: 9px 0;
  border-top: 1px solid var(--border);
}

.allocation-item strong {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.allocation-item span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
  white-space: nowrap;
}

.chart-heading {
  align-items: flex-start;
}

.chart-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

.phase-control {
  width: max-content;
  max-width: 100%;
  grid-auto-columns: minmax(72px, auto);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 11px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.swatch {
  width: 11px;
  height: 11px;
  border-radius: 2px;
}

.swatch.fgh {
  background: var(--orange);
}

.swatch.sdp {
  background: var(--charcoal);
}

.swatch.gap {
  background: var(--red);
}

.line-key {
  width: 22px;
  height: 0;
  border-top: 2px dashed var(--requirement);
}

.chart-shell {
  margin-top: 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.chart-scroll,
.table-scroll {
  overflow-x: auto;
  scrollbar-color: #b8c0c5 transparent;
  scrollbar-width: thin;
}

.chart-stage {
  position: relative;
  min-height: 500px;
}

.coverage-chart {
  display: block;
  width: 100%;
  height: 500px;
}

.chart-tooltip {
  position: absolute;
  z-index: 5;
  display: grid;
  min-width: 205px;
  gap: 6px;
  padding: 12px 13px;
  border: 1px solid #ccd2d6;
  border-radius: 6px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(31, 36, 40, 0.16);
  pointer-events: none;
  color: var(--text);
  font-size: 12px;
}

.chart-tooltip[hidden] {
  display: none;
}

.chart-tooltip strong {
  margin-bottom: 2px;
  font-size: 13px;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.tooltip-row span:first-child {
  color: var(--muted);
}

.chart-scroll-cue {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  line-height: 1.4;
}

.chart-scroll-cue[hidden] {
  display: none;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  background: var(--surface);
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

.data-table th {
  background: #f0f2f3;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.data-table th:first-child,
.data-table th:nth-child(2),
.data-table td:first-child,
.data-table td:nth-child(2) {
  text-align: left;
}

.data-table tbody tr:hover {
  background: #fafbfb;
}

.on-site-table th:nth-child(2),
.on-site-table td:nth-child(2) {
  text-align: right;
}

.on-site-table th:last-child,
.on-site-table td:last-child {
  text-align: left;
  white-space: normal;
}

.supplier-split {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 14px;
  min-width: 360px;
}

.supplier-split span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.supplier-split strong {
  color: var(--text);
}

.status-short {
  color: #a43129;
  font-weight: 750;
}

.status-covered {
  color: var(--green);
  font-weight: 750;
}

.error-banner {
  margin-top: 24px;
  padding: 14px 16px;
  border-left: 5px solid var(--red);
  background: var(--red-soft);
  color: #8b2f25;
  font-size: 13px;
}

@media (max-width: 1180px) {
  .overview-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .allocation-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: auto 1fr;
  }

  .snapshot-state {
    grid-column: 1 / -1;
    align-items: flex-start;
    padding-top: 10px;
    border-top: 1px solid var(--border);
  }

  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .allocation-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .view-heading,
  .event-heading,
  .chart-heading,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .chart-meta,
  .legend {
    align-items: flex-start;
    justify-content: flex-start;
  }

  .phase-control {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .site-header {
    gap: 14px;
    padding: 14px;
  }

  .brand {
    padding-right: 14px;
  }

  .brand img {
    width: 118px;
    max-height: 40px;
  }

  .header-title h1 {
    font-size: 18px;
  }

  .event-nav-inner,
  main {
    width: calc(100% - 28px);
  }

  .nav-link {
    min-height: 47px;
    padding: 0 13px;
    font-size: 12px;
  }

  .overview-grid {
    grid-template-columns: 1fr;
  }

  .event-card a {
    min-height: 220px;
  }

  .segmented-control {
    width: 100%;
  }

  .segment {
    padding: 8px 7px;
    font-size: 11px;
  }

  .metric-grid {
    gap: 8px;
  }

  .metric-card {
    min-height: 110px;
    padding: 14px 12px;
  }

  .metric-value {
    font-size: 24px;
  }

  .allocation-list {
    grid-template-columns: 1fr;
  }

  .chart-stage,
  .coverage-chart {
    height: 455px;
    min-height: 455px;
  }

}
