/* Live data coverage: the topbar button and its two modals. Every block in
   the modals uses the 22px side padding of .modal-header, so edges line up. */
.coverage-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 12.5px;
  white-space: nowrap;
}

.coverage-button .coverage-bar {
  width: 72px;
}

.coverage-button .coverage-percent {
  min-width: 0;
}

.coverage-bar {
  display: flex;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line-soft);
}

.coverage-bar-segment {
  height: 100%;
}

.coverage-bar-covered {
  background: var(--green);
}

.coverage-bar-limited {
  background: #f59e0b;
}

.coverage-bar-unknown {
  background: var(--muted-soft);
}

.coverage-percent {
  min-width: 40px;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.coverage-modal {
  width: min(640px, calc(100vw - 48px));
}

.coverage-detail-modal {
  width: min(820px, calc(100vw - 48px));
}

.coverage-modal-body {
  display: block;
  padding: 0;
}

.coverage-back {
  display: inline-block;
  margin-bottom: 6px;
}

.coverage-overview {
  display: grid;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 18px 22px;
}

.coverage-overview-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.coverage-overview-percent {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.coverage-overview-label {
  color: var(--muted);
  font-size: 13px;
}

.coverage-overview .coverage-bar {
  height: 10px;
}

.coverage-legend {
  display: grid;
  margin: 0;
  gap: 10px 20px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.coverage-legend-term {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.coverage-legend-swatch {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 3px;
}

.coverage-legend-count {
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.coverage-legend-meaning {
  margin: 3px 0 0 16px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

/* Header and rows share one grid, so the columns line up. */
.coverage-table-head,
.coverage-row {
  display: grid;
  align-items: center;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 200px 72px 10px;
  padding: 0 22px;
}

.coverage-table-head {
  border-bottom: 1px solid var(--line);
  background: var(--panel-soft);
  padding-top: 9px;
  padding-bottom: 9px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.coverage-row {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: none;
  cursor: pointer;
  text-align: left;
}

.coverage-row:hover {
  background: var(--panel-soft);
}

.coverage-row-name {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.coverage-row-meter {
  display: flex;
  align-items: center;
  gap: 10px;
}

.coverage-row-meter .coverage-bar {
  flex: 1;
}

.coverage-cell-total {
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.coverage-row-chevron {
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
}

.coverage-note {
  margin: 0;
  background: var(--panel-soft);
  padding: 14px 22px 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.coverage-lead {
  margin: 0;
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.5;
}

.coverage-detail-modal .table-wrap {
  border: 0;
  border-radius: 0;
}

.coverage-fixtures {
  min-width: 0;
  width: 100%;
  table-layout: fixed;
}

.coverage-fixtures td:nth-child(n + 2) {
  white-space: nowrap;
}

.coverage-fixtures th:nth-child(2) {
  width: 140px;
}

.coverage-fixtures th:nth-child(3) {
  width: 170px;
}

.coverage-fixtures th:nth-child(4) {
  width: 130px;
}

.coverage-fixtures th:first-child,
.coverage-fixtures td:first-child {
  padding-left: 22px;
}

.coverage-fixtures th:last-child,
.coverage-fixtures td:last-child {
  padding-right: 22px;
}

.coverage-kickoff {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The stacked layout follows the width of the modal itself: it starts when
   the table columns no longer fit, at any screen width. */
.coverage-modal {
  container-type: inline-size;
}

@container (max-width: 559.98px) {
  .coverage-fixtures,
  .coverage-fixtures tbody {
    display: block;
    min-width: 0;
  }

  .coverage-fixtures thead {
    display: none;
  }

  .coverage-fixtures td:nth-child(n + 2) {
    white-space: normal;
  }

  .coverage-legend {
    grid-template-columns: 1fr;
  }

  .coverage-table-head,
  .coverage-row {
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) 64px 72px 8px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .coverage-fixtures tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px 12px;
    border-bottom: 1px solid var(--line-soft);
    padding: 12px 16px;
  }

  .coverage-fixtures td,
  .coverage-fixtures td:nth-child(1) {
    display: block;
    padding: 0;
  }

  /* Cell hover colours leave patches on a card, so the card has none. */
  .coverage-fixtures tr:hover td {
    background: transparent;
  }

  .coverage-fixtures td:nth-child(1) {
    grid-column: 1 / -1;
  }

  .coverage-fixtures td:nth-child(2) {
    grid-row: 2;
    color: var(--muted);
    font-size: 12.5px;
  }

  .coverage-fixtures td:nth-child(3) {
    grid-row: 3;
  }

  .coverage-fixtures td:nth-child(4) {
    grid-row: 2 / span 2;
    grid-column: 2;
  }

  .coverage-row-meter .coverage-bar {
    display: none;
  }

  .coverage-overview,
  .coverage-note,
  .coverage-lead {
    padding-right: 16px;
    padding-left: 16px;
  }
}

.fixture-detail {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.fixture-coverage {
  display: grid;
  justify-items: start;
  gap: 6px;
}

.fixture-coverage p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
