.panel {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}

.panel + .panel {
  margin-top: 18px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
}

.panel-head .actions {
  flex-wrap: nowrap;
}

.live-tabs {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--line-soft);
  padding: 2px;
}

.live-tabs button {
  min-height: 30px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 0 10px;
  color: var(--muted);
  font-size: 12.5px;
  white-space: nowrap;
}

.live-tabs button:hover {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
}

.live-tabs button.active {
  background: var(--dark);
  color: var(--panel);
}

.panel-title {
  margin: 0;
  color: var(--dark);
  font-size: 15px;
  font-weight: 700;
}

.panel-copy {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-copy .meta-strong {
  color: var(--text);
  font-weight: 600;
}

.panel-copy .meta-mono {
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.panel-copy .meta-sep {
  margin: 0 6px;
  color: var(--muted-soft);
}

.panel-body {
  padding: 18px;
}

.row-clickable .row-toggle {
  cursor: pointer;
}

.row-clickable .row-toggle:hover td {
  background: #fafbfc;
}

.row-clickable .row-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: -2px;
}

.row-clickable .row-toggle.is-open td {
  background: #f5f7fa;
}

.caret-cell {
  width: 32px;
  padding-right: 0;
  color: var(--muted-soft);
}

.row-toggle .caret {
  display: inline-block;
  width: 14px;
  color: var(--muted);
  font-size: 10px;
  text-align: center;
  transition: transform 140ms ease;
}

.row-toggle.is-open .caret {
  color: var(--text);
}

.expand-row td {
  padding: 0;
  background: var(--panel-soft);
  border-bottom: 1px solid var(--line);
}

.expand-row:last-child td {
  border-bottom: 0;
}

.expand-inner {
  padding: 16px 22px 18px;
}

.expand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.expand-title {
  color: var(--dark);
  font-size: 14px;
  font-weight: 600;
}

.expand-meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12.5px;
}

.expand-meta .meta-mono {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.expand-inner .table-wrap {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  overflow: hidden;
}

.expand-inner table {
  min-width: 0;
}

.expand-inner thead th {
  background: #f3f5f8;
  border-bottom: 1px solid var(--line);
  font-size: 10.5px;
}

.expand-inner tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}

.expand-inner tbody tr:nth-child(even) td {
  background: #fafbfc;
}

.expand-inner tbody tr:hover td {
  background: #f3f6fa;
}

.expand-inner tbody tr:last-child td {
  border-bottom: 0;
}

.grid {
  display: grid;
  gap: 12px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.baseline-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.baseline-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.baseline-name {
  color: var(--dark);
  font-weight: 700;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.table-wrap {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.opta-table {
  min-width: 900px;
}

.opta-table td:nth-child(n + 3) {
  white-space: nowrap;
}

.opta-table tbody:not(:last-child) tr:last-child td {
  border-bottom: 1px solid var(--line-soft);
}

.fixture-day-row,
.fixture-row-meta {
  display: none;
}

.live-table {
  min-width: 1360px;
  table-layout: fixed;
}

.live-table td {
  white-space: nowrap;
}

.live-table td:nth-child(1),
.live-table td:nth-child(7) {
  white-space: normal;
  overflow-wrap: anywhere;
}

.live-table th:nth-child(1) {
  width: 25rem;
}

.live-table th:nth-child(2) {
  width: 110px;
}

.live-table th:nth-child(3),
.live-table th:nth-child(8) {
  width: 160px;
}

.live-table th:nth-child(4) {
  width: 140px;
}

.live-table th:nth-child(5) {
  width: 170px;
}

.live-table th:nth-child(6) {
  width: 80px;
}

.live-list-clock {
  font-variant-numeric: tabular-nums;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #f1f3f5;
  color: #374151;
  font-size: 12px;
  font-weight: 600;
}

.state-pill-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state-pill-live {
  background: #fee2e2;
  color: #b91c1c;
}

.state-pill-live .state-pill-dot {
  animation: pulse-live 1.6s ease-in-out infinite;
}

.state-pill-ok {
  background: var(--green-soft);
  color: var(--green);
}

.state-pill-warn {
  background: #fef3c7;
  color: #b25c0d;
}

.state-pill-quiet {
  padding-left: 0;
  background: transparent;
  color: var(--muted);
}

.live-age {
  font-variant-numeric: tabular-nums;
}

.live-age.is-stalled {
  color: #b25c0d;
  font-weight: 600;
}

.delivery-table {
  min-width: 940px;
  table-layout: fixed;
}

.delivery-table th,
.delivery-table td {
  padding: 13px 18px;
  vertical-align: top;
}

.delivery-table th:nth-child(1),
.delivery-table td:nth-child(1) {
  width: 150px;
}

.delivery-table th:nth-child(2),
.delivery-table td:nth-child(2) {
  width: 236px;
}

.delivery-table th:nth-child(4),
.delivery-table td:nth-child(4) {
  width: 156px;
}

.delivery-table th:nth-child(5),
.delivery-table td:nth-child(5) {
  width: 130px;
}

.delivery-state-cell {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: var(--muted);
  font-size: 12px;
}

.delivery-state-cell .row-expander {
  margin-right: 0;
  pointer-events: auto;
}

.delivery-expandable-row {
  cursor: pointer;
}

.delivery-expandable-row:hover td {
  background: #f8fafc;
}

.delivery-expandable-row.is-open td {
  border-bottom-color: var(--line);
}

.delivery-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #475467;
  font-size: 13px;
  font-weight: 700;
}

.delivery-status .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f59e0b;
}

.delivery-status-sent .dot {
  background: #17a469;
}

.delivery-status-failed {
  color: #b42318;
}

.delivery-status-failed .dot {
  background: #d92d20;
}

.delivery-event-chip {
  display: inline-flex;
  max-width: 100%;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--panel-soft);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-match-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.delivery-team-line {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 6px;
  color: var(--dark);
  font-weight: 700;
}

.delivery-team-line span:not(.delivery-versus) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-versus {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.delivery-market-cell {
  display: grid;
  gap: 5px;
  justify-items: start;
  min-width: 0;
}

.delivery-market-head {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
}

.delivery-market-template {
  min-width: 0;
  overflow: hidden;
  color: var(--dark);
  font-weight: 600;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-window-chip {
  flex: none;
  padding: 2px 7px;
  border: 1px solid #d0d5dd;
  border-radius: 999px;
  background: #fff;
  color: #475467;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
}

.delivery-meta-cell {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  white-space: nowrap;
}

.delivery-meta-cell span {
  display: block;
}

.delivery-meta-cell strong {
  color: #344054;
  font-weight: 700;
}

.delivery-error-cell {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.delivery-error-cell.has-error {
  color: #b42318;
  font-weight: 600;
}

.delivery-detail-row td {
  padding: 0;
}

.delivery-detail-panel {
  display: grid;
  gap: 14px;
}

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

.detail-item {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--panel);
}

.detail-item span,
.delivery-detail-error span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.detail-item strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-item .meta-mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
}

.delivery-detail-error {
  display: grid;
  gap: 6px;
  padding: 10px 12px;
  border: 1px solid #fecdca;
  border-radius: 8px;
  background: #fffbfa;
}

.delivery-detail-error code {
  color: #b42318;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.delivery-table .delivery-expandable-row.is-striped td {
  background: #fcfcfd;
}

.delivery-table .delivery-expandable-row:hover td,
.delivery-table tbody tr:hover td {
  background: #f8fafc;
}

.delivery-table .delivery-detail-row td,
.delivery-table .delivery-detail-row:hover td {
  background: var(--panel-soft);
}

.delivery-table .match-cell-name,
.delivery-table .match-cell-meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.capture-cell {
  display: grid;
  justify-items: start;
  gap: 4px;
}

.capture-error {
  max-width: 220px;
  white-space: normal;
  overflow-wrap: anywhere;
  color: #b25c0d;
  font-size: 11.5px;
  line-height: 1.3;
}


.kickoff-cell {
  display: grid;
  gap: 2px;
  font-variant-numeric: tabular-nums;
}

.kickoff-cell.muted {
  color: var(--muted);
}

.kickoff-rel {
  color: var(--dark);
  font-weight: 500;
}

.kickoff-abs {
  color: var(--dark);
  font-size: 13px;
}

.period-chip {
  color: var(--dark);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.live-updated {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.live-updated::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(8, 127, 91, 0.18);
  animation: pulse-live-green 1.8s ease-in-out infinite;
}

.pagination-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pagination-summary {
  font-variant-numeric: tabular-nums;
}

.page-size {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.page-size select {
  padding: 4px 32px 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background-color: var(--panel);
  color: var(--dark);
  font-size: 13px;
  cursor: pointer;
}

.live-events-table {
  min-width: 1040px;
}
