/*
 * Comp Manager live running order (live.js). Everything is scoped to
 * .cm-live and takes its text colour and font from the page around it, so
 * it suits the site's light and dark themes. Override the custom properties
 * on .cm-live to restyle it.
 */
.cm-live {
  --cm-live-accent: #c8102e;
  --cm-live-muted: color-mix(in srgb, currentColor 62%, transparent);
  --cm-live-line: color-mix(in srgb, currentColor 14%, transparent);
  --cm-live-tint: color-mix(in srgb, currentColor 5%, transparent);
  --cm-live-on: color-mix(in srgb, var(--cm-live-accent) 12%, transparent);
  --cm-live-radius: 12px;
  color: inherit;
  font: inherit;
  line-height: 1.45;
  max-width: 960px;
  margin: 0 auto;
}

.cm-live *,
.cm-live *::before,
.cm-live *::after {
  box-sizing: border-box;
}

.cm-live__header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 16px;
  margin-bottom: 16px;
}

.cm-live__title {
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.2;
  text-wrap: balance;
}

.cm-live__meta {
  margin: 4px 0 0;
  color: var(--cm-live-muted);
  font-size: 0.95rem;
}

.cm-live__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 10px;
  border: 1px solid var(--cm-live-line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.cm-live__pill--live {
  border-color: var(--cm-live-accent);
  color: var(--cm-live-accent);
}

.cm-live__pill--live::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cm-live-accent);
  animation: cm-live-pulse 1.6s ease-in-out infinite;
}

@keyframes cm-live-pulse {
  50% {
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cm-live__pill--live::before {
    animation: none;
  }
}

.cm-live__notice {
  margin: 0 0 16px;
  padding: 10px 14px;
  border: 1px solid var(--cm-live-line);
  border-radius: var(--cm-live-radius);
  background: var(--cm-live-tint);
  font-size: 0.95rem;
}

/* The widget hides parts with the hidden attribute; their display rules
   (and the site's own CSS) must not show them again. */
.cm-live [hidden] {
  display: none !important;
}

.cm-live__holding {
  padding: 28px 20px;
  border: 1px solid var(--cm-live-line);
  border-radius: var(--cm-live-radius);
  background: var(--cm-live-tint);
  text-align: center;
}

.cm-live__holding-title {
  margin: 0 0 6px;
  font-size: 1.2rem;
  line-height: 1.3;
}

.cm-live__holding-text {
  max-width: 44ch;
  margin: 0 auto;
  color: var(--cm-live-muted);
  text-wrap: pretty;
}

.cm-live__now {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.cm-live__card {
  padding: 14px 16px;
  border: 1px solid var(--cm-live-line);
  border-radius: var(--cm-live-radius);
  background: var(--cm-live-tint);
}

.cm-live__card--on {
  border-color: var(--cm-live-accent);
  background: var(--cm-live-on);
}

.cm-live__card-label {
  margin: 0 0 4px;
  color: var(--cm-live-muted);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cm-live__card--on .cm-live__card-label {
  color: var(--cm-live-accent);
}

.cm-live__card-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
}

.cm-live__card-detail {
  margin: 4px 0 0;
  color: var(--cm-live-muted);
}

.cm-live__tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

.cm-live__search {
  flex: 1 1 220px;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--cm-live-line);
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font: inherit;
}

.cm-live__button {
  padding: 8px 14px;
  border: 1px solid var(--cm-live-line);
  border-radius: 8px;
  background: var(--cm-live-tint);
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.cm-live__button:hover {
  border-color: currentColor;
}

.cm-live__search:focus-visible,
.cm-live__button:focus-visible {
  outline: 2px solid var(--cm-live-accent);
  outline-offset: 2px;
}

.cm-live__section {
  margin-top: 20px;
}

.cm-live__section-title {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0 0 6px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--cm-live-line);
  font-size: 1.15rem;
}

.cm-live__section-time {
  color: var(--cm-live-muted);
  font-size: 0.9rem;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
}

.cm-live__rounds {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cm-live__round {
  display: grid;
  grid-template-columns: 3.5rem 2.75rem minmax(0, 1fr) auto;
  gap: 4px 10px;
  align-items: baseline;
  padding: 10px 8px;
  border-bottom: 1px solid var(--cm-live-line);
  scroll-margin-top: 96px;
}

.cm-live__time,
.cm-live__number {
  font-variant-numeric: tabular-nums;
}

.cm-live__time {
  color: var(--cm-live-muted);
}

.cm-live__number {
  font-weight: 600;
  text-align: right;
}

.cm-live__name {
  min-width: 0;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.cm-live__facts {
  display: block;
  color: var(--cm-live-muted);
  font-size: 0.88rem;
  font-weight: 400;
}

.cm-live__state {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.cm-live__round.is-break .cm-live__name {
  font-style: italic;
  font-weight: 400;
}

.cm-live__round.is-done {
  color: var(--cm-live-muted);
}

.cm-live__round.is-done .cm-live__time,
.cm-live__round.is-done .cm-live__facts {
  color: color-mix(in srgb, currentColor 75%, transparent);
}

.cm-live__round.is-on {
  border-radius: 8px;
  background: var(--cm-live-on);
  box-shadow: inset 3px 0 0 var(--cm-live-accent);
}

.cm-live__round.is-on .cm-live__state {
  color: var(--cm-live-accent);
}

.cm-live__round.is-next .cm-live__state {
  color: inherit;
}

.cm-live__empty,
.cm-live__foot {
  color: var(--cm-live-muted);
  font-size: 0.9rem;
}

.cm-live__foot {
  margin-top: 20px;
}

@media (max-width: 520px) {
  .cm-live__title {
    font-size: 1.25rem;
  }

  .cm-live__round {
    grid-template-columns: 3rem 2.25rem minmax(0, 1fr);
    padding: 10px 4px;
  }

  .cm-live__state {
    grid-column: 3;
  }
}
