/* Control Center v2 direction pass: cleaner race-day cockpit styling only. */
.control-body {
  --cc-bg-top: #071522;
  --cc-bg-bottom: #02070b;
  --cc-panel: rgba(8, 18, 28, 0.93);
  --cc-panel-strong: rgba(10, 24, 37, 0.96);
  --cc-panel-soft: rgba(18, 35, 50, 0.74);
  --cc-line: rgba(120, 190, 238, 0.22);
  --cc-line-soft: rgba(210, 230, 245, 0.12);
  --cc-blue: #2f8cff;
  --cc-cyan: #54c7ec;
  --cc-green: #42df56;
  --cc-yellow: #f4c542;
  --cc-red: #e7332f;
  --cc-white: #f7fbff;
  --cc-muted: #aab8c5;
  min-height: 100vh;
  padding: clamp(14px, 1.25vw, 24px);
  background:
    radial-gradient(circle at 18% -8%, rgba(47, 140, 255, 0.22), transparent 34%),
    radial-gradient(circle at 82% 6%, rgba(244, 197, 66, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(7, 21, 34, 0.96), rgba(2, 7, 11, 0.98)),
    url("/assets/liberty-raceworks-splash.png") center / cover fixed;
}

.control-body .control {
  max-width: min(1880px, calc(100vw - 28px));
  gap: 12px;
}

.control-body .panel,
.control-body .control-subpanel,
.control-body .send-output-box,
.control-body .operator-health,
.control-body .vmix-url-box,
.control-body .banner-logo-status,
.control-body .race-ready-card,
.control-body .top3-driver-control,
.control-body .race-story-preview,
.control-body .output-info-panel,
.control-body .race-intel-card {
  border: 1px solid var(--cc-line-soft);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 34%),
    linear-gradient(180deg, rgba(14, 28, 41, 0.94), rgba(4, 10, 16, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.11),
    0 18px 40px rgba(0, 0, 0, 0.38);
}

.control-body .panel {
  padding: clamp(14px, 1vw, 20px);
}

.control-body .panel::after {
  left: 16px;
  right: 16px;
  height: 1px;
  opacity: 0.7;
  background: linear-gradient(90deg, transparent, rgba(84, 199, 236, 0.42), transparent);
}

.control-body .control-hero {
  display: grid;
  grid-template-columns: minmax(240px, 0.78fr) minmax(0, 1.05fr) minmax(240px, 0.72fr);
  gap: 18px;
  align-items: center;
  overflow: hidden;
  padding: 14px 18px;
  border-color: rgba(120, 190, 238, 0.24);
  background:
    radial-gradient(circle at 16% 0%, rgba(47, 140, 255, 0.2), transparent 34%),
    linear-gradient(180deg, rgba(9, 23, 36, 0.96), rgba(3, 9, 15, 0.96));
}

.control-body .control-hero > * {
  min-width: 0;
}

.control-body .control-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.control-body .control-logo {
  width: clamp(118px, 8vw, 164px);
  max-height: 86px;
  object-fit: contain;
  filter: drop-shadow(0 0 18px rgba(84, 199, 236, 0.2));
}

.control-body h1 {
  margin: 0;
  color: var(--cc-white);
  font-size: clamp(44px, 3.2vw, 64px);
  line-height: 0.9;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.42);
}

.control-body .control-hero p {
  margin-top: 8px;
  color: var(--cc-muted);
  font-size: 20px;
  line-height: 1.08;
}

.control-body .control-hero-actions {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  justify-items: stretch;
  align-items: stretch;
}

.control-body .control-mode-toggle {
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
  min-height: 56px;
  overflow: hidden;
  padding: 6px;
  border-color: rgba(120, 190, 238, 0.24);
  border-radius: 10px;
  background: rgba(2, 8, 13, 0.7);
}

.control-body .control-mode-toggle button,
.control-body .control-lock-toggle {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  min-height: 44px;
  overflow: hidden;
  font-size: clamp(15px, 0.98vw, 20px);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-body .control-mode-toggle button.active {
  border-color: rgba(244, 197, 66, 0.8);
  color: #fff5c4;
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.28), rgba(82, 62, 15, 0.82));
  box-shadow:
    0 0 18px rgba(244, 197, 66, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.control-body .status-pill {
  min-width: 0;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid rgba(120, 190, 238, 0.25);
  border-radius: 10px;
  color: #dce8f2;
  background: rgba(2, 8, 13, 0.74);
  font-size: 19px;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-body .control-quick-nav {
  top: 8px;
  gap: 0;
  padding: 0;
  overflow: hidden;
  border-color: rgba(120, 190, 238, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(12, 29, 44, 0.95), rgba(3, 10, 16, 0.95));
}

.control-body .control-quick-nav a {
  min-height: 58px;
  border: 0;
  border-left: 1px solid rgba(120, 190, 238, 0.13);
  border-radius: 0;
  color: #b7c5d2;
  background: transparent;
  font-size: clamp(17px, 1.05vw, 22px);
  box-shadow: none;
}

.control-body .control-quick-nav a:first-child {
  border-left: 0;
}

.control-body[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 140, 255, 0.38), transparent 58%),
    linear-gradient(180deg, rgba(31, 77, 122, 0.86), rgba(6, 16, 27, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(47, 140, 255, 0.78),
    inset 0 -12px 24px rgba(47, 140, 255, 0.12),
    0 0 22px rgba(47, 140, 255, 0.24);
}

.control-body .control-quick-nav a:hover,
.control-body .control-quick-nav a:focus-visible {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(120, 190, 238, 0.12), rgba(6, 16, 27, 0.44));
  box-shadow:
    inset 0 0 0 1px rgba(120, 190, 238, 0.22),
    inset 0 -10px 20px rgba(47, 140, 255, 0.035);
}

.control-body[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  color: #ffffff !important;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 140, 255, 0.38), transparent 58%),
    linear-gradient(180deg, rgba(31, 77, 122, 0.86), rgba(6, 16, 27, 0.96)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(47, 140, 255, 0.78),
    inset 0 -12px 24px rgba(47, 140, 255, 0.12),
    0 0 22px rgba(47, 140, 255, 0.24) !important;
}

/* Guard against stale focus/hover states making the previous tab look selected. */
.control-body.is-paged-control:not([data-active-control-page="timingPanel"]) .control-quick-nav a[href="#timingPanel"],
.control-body.is-paged-control:not([data-active-control-page="outputPanel"]) .control-quick-nav a[href="#outputPanel"],
.control-body.is-paged-control:not([data-active-control-page="storyPanel"]) .control-quick-nav a[href="#storyPanel"],
.control-body.is-paged-control:not([data-active-control-page="bannerPanel"]) .control-quick-nav a[href="#bannerPanel"],
.control-body.is-paged-control:not([data-active-control-page="weatherTickerPanel"]) .control-quick-nav a[href="#weatherTickerPanel"],
.control-body.is-paged-control:not([data-active-control-page="podiumPanel"]) .control-quick-nav a[href="#podiumPanel"],
.control-body.is-paged-control:not([data-active-control-page="stylePanel"]) .control-quick-nav a[href="#stylePanel"] {
  color: #b7c5d2 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]):focus-visible {
  outline: 2px solid rgba(120, 190, 238, 0.78);
  outline-offset: -4px;
}

.control-body .panel-heading {
  gap: 16px;
  border-bottom-color: rgba(120, 190, 238, 0.16);
}

.control-body .panel h2 {
  border-color: rgba(120, 190, 238, 0.34);
  border-left-color: var(--cc-red);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(231, 51, 47, 0.18), transparent 18%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.015));
  color: var(--cc-white);
  font-size: clamp(28px, 1.8vw, 42px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 0 18px rgba(84, 199, 236, 0.08);
}

.control-body .panel h2::before {
  background: var(--cc-red);
  box-shadow: 0 0 14px rgba(231, 51, 47, 0.65);
}

.control-body .race-story-control-grid {
  grid-template-columns: minmax(360px, 0.82fr) minmax(520px, 1.12fr) minmax(300px, 0.62fr);
  gap: 14px;
  align-items: stretch;
}

.control-body .race-story-selector,
.control-body .race-story-preview,
.control-body .race-story-side-controls {
  min-height: 100%;
}

.control-body .race-story-selector,
.control-body .race-story-preview {
  padding: 14px;
  border-color: rgba(120, 190, 238, 0.24);
  border-left-color: var(--cc-cyan);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 140, 255, 0.18), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(12, 28, 42, 0.94), rgba(3, 9, 15, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 16px 34px rgba(0, 0, 0, 0.34);
}

.control-body .race-story-status-strip {
  gap: 9px;
  padding-bottom: 2px;
}

.control-body .race-story-status-card {
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 9px;
  border-color: rgba(120, 190, 238, 0.24);
  border-left-width: 4px;
  background:
    radial-gradient(circle at 8% 12%, rgba(47, 140, 255, 0.16), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), transparent 44%),
    linear-gradient(180deg, rgba(8, 20, 31, 0.95), rgba(2, 8, 13, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.25);
}

.control-body .race-story-status-card span,
.control-body .race-story-status-card em {
  font-size: clamp(11px, 0.68vw, 15px);
}

.control-body .race-story-status-card strong {
  font-size: clamp(18px, 1.08vw, 25px);
}

.control-body .race-story-selector-head strong,
.control-body .race-story-preview-head strong {
  font-size: clamp(20px, 1.15vw, 27px);
}

.control-body .race-story-selector-head span,
.control-body .race-story-preview-head span,
.control-body .race-story-preview-guidance {
  font-size: clamp(14px, 0.82vw, 18px);
}

.control-body .race-story-mini-button {
  min-height: 44px;
  padding-inline: 16px;
  font-size: clamp(16px, 0.95vw, 21px);
}

.control-body .race-story-choice-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.control-body .race-story-choice {
  min-height: 104px;
  padding: 12px 14px;
  border-color: rgba(120, 190, 238, 0.2);
  border-left-color: var(--cc-blue);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.075), transparent 42%),
    rgba(5, 14, 22, 0.9);
}

.control-body .race-story-choice span,
.control-body .race-story-choice em {
  font-size: clamp(13px, 0.78vw, 17px);
}

.control-body .race-story-choice strong {
  font-size: clamp(18px, 1.08vw, 25px);
}

.control-body .race-story-choice.is-selected {
  border-color: rgba(244, 197, 66, 0.78);
  border-left-color: var(--cc-yellow);
}

.control-body .race-story-side-controls {
  display: grid;
  gap: 12px;
  align-content: stretch;
}

.control-body .race-story-action-panel {
  padding: 14px 16px;
  border-color: rgba(120, 190, 238, 0.24);
  border-left-color: var(--cc-cyan);
  border-radius: 9px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 140, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.065), transparent 44%),
    linear-gradient(180deg, rgba(8, 20, 31, 0.95), rgba(2, 8, 13, 0.96));
}

.control-body .race-story-action-panel strong {
  font-size: clamp(20px, 1.15vw, 27px);
}

.control-body .race-story-action-panel span {
  font-size: clamp(14px, 0.82vw, 18px);
}

.control-body .race-story-side-controls .style-field {
  margin: 0;
}

.control-body .race-story-action-row {
  grid-template-columns: 1fr;
  gap: 12px;
}

.control-body .race-story-action-row button {
  min-height: 72px;
  font-size: clamp(22px, 1.35vw, 32px);
}

.control-body .race-story-history-panel {
  gap: 10px;
  padding: 12px 14px;
  border-color: rgba(120, 190, 238, 0.24);
  border-left: 3px solid var(--cc-cyan);
  border-radius: 9px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 140, 255, 0.16), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 42%),
    linear-gradient(180deg, rgba(8, 20, 31, 0.92), rgba(2, 8, 13, 0.94));
}

.control-body .race-story-history-head strong {
  color: var(--cc-text);
  font-size: clamp(17px, 1vw, 23px);
}

.control-body .race-story-history-head button {
  min-height: 38px;
  padding: 7px 14px;
  font-size: clamp(14px, 0.82vw, 18px);
}

.control-body .race-story-history-list {
  gap: 7px;
  color: var(--cc-muted);
  font-size: clamp(14px, 0.85vw, 18px);
}

.control-body .race-story-history-item {
  padding: 9px 10px;
  border-color: rgba(120, 190, 238, 0.16);
  background: rgba(255, 255, 255, 0.045);
}

.control-body .race-story-history-item strong {
  font-size: clamp(15px, 0.9vw, 20px);
}

.control-body .race-story-history-item em {
  color: var(--cc-cyan);
  font-size: clamp(12px, 0.74vw, 15px);
}

.control-body .panel > p,
.control-body .panel-heading p,
.control-body .race-ready-topline p,
.control-body .subpanel-heading span,
.control-body details p {
  color: var(--cc-muted);
  font-size: 19px;
  line-height: 1.15;
}

.control-body input,
.control-body select,
.control-body textarea {
  min-height: 48px;
  border-color: rgba(120, 190, 238, 0.22);
  border-radius: 8px;
  color: var(--cc-white);
  background:
    linear-gradient(180deg, rgba(2, 8, 13, 0.94), rgba(0, 3, 6, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 0 rgba(47, 140, 255, 0);
}

.control-body input:focus,
.control-body select:focus,
.control-body textarea:focus {
  border-color: rgba(47, 140, 255, 0.82);
  box-shadow:
    0 0 0 2px rgba(47, 140, 255, 0.24),
    0 0 22px rgba(47, 140, 255, 0.18);
}

.control-body button,
.control-body .links a,
.control-body details summary {
  min-height: 42px;
  border: 1px solid rgba(120, 190, 238, 0.26);
  border-left: 4px solid rgba(84, 199, 236, 0.9);
  border-radius: 8px;
  color: var(--cc-white);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0.06) 24%, rgba(6, 14, 22, 0.96) 74%),
    linear-gradient(90deg, rgba(84, 199, 236, 0.12), transparent 42%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.34),
    inset 0 -13px 20px rgba(0, 0, 0, 0.34),
    0 10px 22px rgba(0, 0, 0, 0.28);
}

.control-body button:hover,
.control-body .links a:hover,
.control-body details summary:hover {
  border-color: rgba(84, 199, 236, 0.7);
  border-left-color: var(--cc-cyan);
  filter: brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    inset 0 -13px 20px rgba(0, 0, 0, 0.3),
    0 0 22px rgba(84, 199, 236, 0.22),
    0 10px 22px rgba(0, 0, 0, 0.3);
}

.control-body .timing-ready-status-grid .health-summary,
.control-body .timing-ready-status-grid .operator-health-grid div,
.control-body .timing-ready-status-grid .race-ready-card,
.control-body .timing-ready-status-grid .race-ready-action,
.control-body .race-intel-card {
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 32%),
    rgba(4, 12, 18, 0.86);
}

.control-body .operator-health-grid span,
.control-body .race-ready-card span,
.control-body .race-ready-card em,
.control-body .banner-logo-status span,
.control-body .health-grid span,
.control-body .race-intel-card span {
  color: #b9c8d4;
  font-size: 17px;
}

.control-body .operator-health-grid strong,
.control-body .race-ready-card strong,
.control-body .banner-logo-status strong,
.control-body .health-grid strong,
.control-body .race-intel-card strong {
  color: var(--cc-white);
  font-size: clamp(24px, 1.55vw, 32px);
}

.control-body .race-ready-summary {
  min-height: 52px;
  padding: 8px 18px;
  border-radius: 999px;
  justify-content: center;
}

.control-body .race-ready-summary.is-good,
.control-body .race-ready-card.is-good,
.control-body .race-ready-action.is-good,
.control-body .send-readiness-note.is-good {
  border-color: rgba(66, 223, 86, 0.62);
  color: #d9ffdf;
  background:
    linear-gradient(180deg, rgba(66, 223, 86, 0.18), rgba(4, 18, 8, 0.86)),
    rgba(5, 18, 11, 0.9);
  box-shadow:
    0 0 22px rgba(66, 223, 86, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.control-body .race-ready-summary.is-warn,
.control-body .race-ready-card.is-warn,
.control-body .race-ready-action.is-warn,
.control-body .send-readiness-note.is-warn {
  border-color: rgba(244, 197, 66, 0.62);
  color: #fff4c2;
  background:
    linear-gradient(180deg, rgba(244, 197, 66, 0.18), rgba(28, 20, 4, 0.86)),
    rgba(18, 12, 3, 0.9);
}

.control-body .race-ready-summary.is-bad,
.control-body .race-ready-card.is-bad,
.control-body .race-ready-action.is-bad,
.control-body .send-readiness-note.is-bad,
.control-body button.needs-confirm {
  border-color: rgba(231, 51, 47, 0.7);
  color: #ffe3e1;
  background:
    linear-gradient(180deg, rgba(231, 51, 47, 0.2), rgba(32, 5, 4, 0.9)),
    rgba(22, 6, 5, 0.9);
}

.control-body .send-output-box {
  grid-template-columns: minmax(240px, 0.38fr) minmax(240px, 0.38fr) minmax(360px, 1fr);
  gap: 12px;
  padding: 10px;
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 40%),
    rgba(2, 8, 13, 0.82);
}

.control-body .send-output-box button,
.control-body .banner-control-actions button {
  min-height: 94px;
  font-size: clamp(28px, 2vw, 42px);
}

.control-body .send-output-box #takeProgram,
.control-body #sendTopBanner,
.control-body .race-story-action-row #sendRaceStory {
  border-color: rgba(66, 223, 86, 0.62);
  border-left-color: var(--cc-green);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(66, 223, 86, 0.2) 28%, rgba(8, 92, 29, 0.88) 100%),
    rgba(7, 76, 26, 0.92);
}

.control-body .race-story-action-row #sendRaceStory:not(.is-story-ready),
.control-body button:disabled {
  cursor: not-allowed;
  border-color: rgba(174, 184, 193, 0.28);
  border-left-color: rgba(174, 184, 193, 0.68);
  color: rgba(247, 251, 255, 0.68);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.05) 28%, rgba(14, 20, 26, 0.92) 100%),
    rgba(10, 16, 22, 0.9);
  filter: saturate(0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -12px 18px rgba(0, 0, 0, 0.32);
}

.control-body .send-output-box #takeProgram.is-good {
  border-color: rgba(66, 223, 86, 0.62);
  border-left-color: var(--cc-green);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), rgba(66, 223, 86, 0.2) 28%, rgba(8, 92, 29, 0.88) 100%),
    rgba(7, 76, 26, 0.92);
}

.control-body .send-output-box #takeProgram.is-warn,
.control-body .send-output-box #takeProgram.needs-confirm {
  border-color: rgba(244, 197, 66, 0.68);
  border-left-color: var(--cc-yellow);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.27), rgba(244, 197, 66, 0.18) 28%, rgba(96, 70, 12, 0.9) 100%),
    rgba(72, 51, 9, 0.92);
}

.control-body .send-output-box #takeProgram.is-bad {
  border-color: rgba(231, 51, 47, 0.7);
  border-left-color: var(--cc-red);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(231, 51, 47, 0.14) 24%, rgba(68, 10, 8, 0.9) 100%),
    rgba(38, 8, 7, 0.92);
}

.control-body .send-output-box #clearProgram,
.control-body #clearTopBanner,
.control-body #hideRaceStory,
.control-body .race-story-action-row #hideRaceStory {
  border-color: rgba(231, 51, 47, 0.58);
  border-left-color: var(--cc-red);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(231, 51, 47, 0.14) 24%, rgba(68, 10, 8, 0.9) 100%),
    rgba(38, 8, 7, 0.92);
}

.control-body .send-readiness-note {
  min-height: 94px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: clamp(22px, 1.35vw, 30px);
}

.control-body .program-buttons {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(58px, auto);
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.control-body .program-buttons button,
.control-body .output-vmix-panel .links a {
  min-height: 58px;
  font-size: clamp(20px, 1.25vw, 28px);
  border-radius: 8px;
}

.control-body .program-buttons button {
  padding: 18px 10px 8px;
}

.control-body .program-buttons button[data-preview="blank"] {
  grid-row: span 2;
  min-height: 124px;
}

.control-body .program-buttons button::after {
  top: 6px;
  left: 10px;
  right: 10px;
  height: 18px;
  border-radius: 4px;
}

.control-body .program-buttons button.active,
.control-body .program-buttons button.on-program,
.control-body .program-buttons button.active.on-program {
  transform: translateY(-1px);
}

.control-body .output-vmix-panel .links {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.control-body .banner-control-actions {
  gap: 10px;
  margin-top: 10px;
}

.control-body .subpanel-heading strong,
.control-body .output-vmix-panel .subpanel-heading strong {
  border-color: rgba(120, 190, 238, 0.34);
  border-left-color: var(--cc-cyan);
  color: var(--cc-white);
  background: rgba(2, 8, 13, 0.58);
  font-size: clamp(23px, 1.45vw, 34px);
}

.control-body .race-story-panel.is-story-ready,
.control-body .race-story-panel:has(#raceStoryAlert.is-ready) {
  border-color: rgba(244, 197, 66, 0.48);
  box-shadow:
    0 0 34px rgba(244, 197, 66, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.control-body .race-story-alert.is-ready {
  color: #07110a;
  background: var(--cc-yellow);
}

@media (max-width: 1180px) {
  .control-body .control-hero,
  .control-body .output-topbar {
    grid-template-columns: 1fr;
  }

  .control-body .race-story-control-grid,
  .control-body .race-story-choice-list {
    grid-template-columns: 1fr;
  }

  .control-body .race-story-status-strip {
    grid-template-columns: 1fr;
  }

  .control-body .control-hero-actions {
    min-width: 0;
  }

  .control-body .control-quick-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-body .send-output-box,
  .control-body .output-vmix-panel .links {
    grid-template-columns: 1fr;
  }
}

/* Control Center v2 page layout: use the mockup-style tabs without changing output logic. */
.control-body .control-live-ribbon {
  display: grid;
  grid-template-columns: minmax(180px, 1.08fr) minmax(104px, 0.42fr) minmax(126px, 0.52fr) minmax(126px, 0.52fr);
  gap: 10px;
  align-items: stretch;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.control-body .live-ribbon-card {
  min-width: 0;
  overflow: hidden;
  padding: 10px 14px;
  border: 1px solid rgba(120, 190, 238, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(6, 17, 27, 0.92), rgba(2, 8, 13, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 12px 24px rgba(0, 0, 0, 0.28);
}

.control-body .live-ribbon-card span,
.control-body .live-ribbon-card em {
  display: block;
  color: var(--cc-muted);
  font-size: 15px;
  font-weight: 900;
  font-style: normal;
  line-height: 1;
  text-transform: uppercase;
}

.control-body .live-ribbon-card strong {
  display: block;
  max-width: 100%;
  margin: 6px 0 5px;
  overflow: hidden;
  color: var(--cc-white);
  font-size: clamp(22px, 1.45vw, 34px);
  line-height: 0.94;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-body .live-ribbon-flag strong {
  color: #ffffff;
  font-size: clamp(34px, 2.4vw, 54px);
  text-align: center;
}

.control-body .live-ribbon-flag span {
  color: var(--cc-green);
  text-align: center;
}

.control-body .live-ribbon-flag em,
.control-body .live-ribbon-time span,
.control-body .live-ribbon-time em {
  text-align: center;
}

.control-body .live-ribbon-ready {
  text-align: center;
}

.control-body .live-ribbon-ready strong,
.control-body .live-ribbon-ready span,
.control-body .live-ribbon-ready em {
  text-align: center;
}

.control-body .live-ribbon-ready.is-good {
  border-color: rgba(66, 223, 86, 0.66);
  background:
    radial-gradient(circle at 12% 18%, rgba(66, 223, 86, 0.22), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(8, 28, 17, 0.94), rgba(2, 8, 13, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 24px rgba(66, 223, 86, 0.2);
}

.control-body .live-ribbon-ready.is-warn {
  border-color: rgba(244, 197, 66, 0.72);
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 197, 66, 0.22), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(28, 24, 10, 0.94), rgba(2, 8, 13, 0.95));
}

.control-body .live-ribbon-ready.is-bad {
  border-color: rgba(235, 80, 72, 0.74);
  background:
    radial-gradient(circle at 12% 18%, rgba(235, 80, 72, 0.24), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(32, 10, 9, 0.94), rgba(2, 8, 13, 0.95));
}

.control-body .control-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.control-body .top3-preview-grid,
.control-body .weather-preview-grid,
.control-body .banner-preview-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.control-body .control-preview-card {
  min-width: 0;
  min-height: 96px;
  padding: 14px 16px;
  overflow: hidden;
  border: 1px solid rgba(120, 190, 238, 0.25);
  border-left: 4px solid var(--cc-cyan);
  border-radius: 10px;
  background:
    radial-gradient(circle at 0% 0%, rgba(47, 140, 255, 0.18), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 40%),
    linear-gradient(180deg, rgba(7, 19, 30, 0.94), rgba(2, 8, 13, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 14px 28px rgba(0, 0, 0, 0.28);
}

.control-body .control-preview-card.is-live {
  border-left-color: var(--cc-green);
}

.control-body .control-preview-card span,
.control-body .control-preview-card em {
  display: block;
  overflow: hidden;
  color: var(--cc-muted);
  font-size: clamp(14px, 0.78vw, 17px);
  font-weight: 900;
  font-style: normal;
  line-height: 1.1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.control-body .control-preview-card strong {
  display: block;
  margin: 8px 0 7px;
  overflow: hidden;
  color: var(--cc-white);
  font-size: clamp(26px, 1.55vw, 38px);
  line-height: 0.95;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.control-body .graphic-preview-panel {
  position: relative;
  margin: 12px 0 18px;
  padding: 14px;
  border: 1px solid rgba(120, 190, 238, 0.24);
  border-left: 4px solid var(--cc-blue);
  border-radius: 12px;
  background:
    radial-gradient(circle at 10% 0%, rgba(47, 140, 255, 0.16), transparent 48%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.06), transparent 36%),
    linear-gradient(180deg, rgba(7, 18, 29, 0.94), rgba(2, 8, 13, 0.96));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.1),
    0 18px 34px rgba(0, 0, 0, 0.24);
}

.control-body .graphic-preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: var(--cc-muted);
  font-size: clamp(14px, 0.82vw, 18px);
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.control-body .graphic-preview-heading strong {
  color: var(--cc-white);
  font-size: clamp(20px, 1.15vw, 28px);
  line-height: 0.95;
}

.control-body .graphic-preview-frame {
  position: relative;
  min-height: 120px;
  overflow: hidden;
  border: 1px solid rgba(198, 221, 235, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    linear-gradient(45deg, rgba(255, 255, 255, 0.035) 25%, transparent 25%, transparent 75%, rgba(255, 255, 255, 0.035) 75%),
    rgba(0, 0, 0, 0.5);
  background-position: 0 0, 10px 10px, 0 0;
  background-size: 20px 20px, 20px 20px, auto;
}

.control-body .graphic-preview-frame.is-wide {
  aspect-ratio: 16 / 7;
}

.control-body .graphic-preview-frame.is-banner {
  aspect-ratio: 16 / 2.2;
  min-height: 86px;
}

.control-body .graphic-preview-frame.is-side-tower {
  aspect-ratio: 5 / 8;
  min-height: 320px;
}

.control-body .graphic-preview-frame.is-ticker {
  aspect-ratio: 16 / 2;
  min-height: 76px;
}

.control-body .graphic-preview-frame iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: transparent;
  pointer-events: none;
}

.control-body .graphic-preview-frame.is-broadcast-preview {
  aspect-ratio: auto;
  min-height: 0;
}

.control-body .graphic-preview-frame.is-broadcast-preview iframe {
  position: absolute;
  top: var(--preview-offset-y, 0);
  left: 0;
  width: var(--preview-width, 1920px);
  height: var(--preview-height, 1080px);
  transform: scale(var(--preview-scale, 0.25));
  transform-origin: 0 0;
}

.control-body .output-visual-preview .graphic-preview-frame.is-broadcast-preview {
  max-width: 1120px;
  margin: 0 auto;
}

.control-body .weather-preview-layout .graphic-preview-frame.is-broadcast-preview {
  max-width: 820px;
  margin: 0 auto;
}

.control-body .graphic-preview-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: var(--cc-muted);
  font-size: clamp(18px, 1.15vw, 28px);
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.control-body .graphic-preview-frame.has-preview .graphic-preview-empty {
  display: none;
}

.control-body .banner-preview-layout,
.control-body .weather-preview-layout,
.control-body .style-preview-layout {
  display: grid;
  gap: 12px;
}

.control-body .banner-preview-layout {
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.44fr);
  align-items: start;
}

.control-body .weather-preview-layout,
.control-body .style-preview-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.control-body .weather-preview-mini,
.control-body .ticker-preview-mini {
  position: relative;
  overflow: hidden;
  min-height: 220px;
  border: 1px solid rgba(120, 190, 238, 0.26);
  border-radius: 10px;
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 255, 255, 0.12), transparent 34%),
    linear-gradient(115deg, rgba(255, 255, 255, 0.09), transparent 38%),
    linear-gradient(180deg, rgba(23, 30, 31, 0.96), rgba(3, 7, 8, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 32px rgba(0, 0, 0, 0.32);
}

.control-body .weather-preview-mini {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.control-body .weather-preview-mini::after,
.control-body .ticker-preview-mini::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(106deg, transparent 0 33%, rgba(255, 255, 255, 0.12) 43%, transparent 52%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent 18%, rgba(0, 0, 0, 0.2));
  opacity: 0.62;
}

.control-body .weather-preview-mini-head {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 22px;
  border-bottom: 4px solid var(--cc-red);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.04));
}

.control-body .weather-preview-mini-head span {
  color: #ff6868;
  font-size: clamp(22px, 1.45vw, 34px);
  font-weight: 1000;
  line-height: 0.95;
  text-transform: uppercase;
}

.control-body .weather-preview-mini-head strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--cc-white);
  font-size: clamp(24px, 1.55vw, 38px);
  line-height: 0.9;
  text-transform: uppercase;
  text-shadow: 0 3px 7px rgba(0, 0, 0, 0.45);
}

.control-body .weather-preview-mini-body {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 22px;
}

.control-body .weather-preview-icon {
  position: relative;
  width: 92px;
  height: 92px;
  margin: 0 auto;
}

.control-body .weather-preview-icon::before {
  content: "";
  position: absolute;
  width: 58px;
  height: 58px;
  left: 0;
  top: 8px;
  border-radius: 50%;
  background: #f4c542;
  box-shadow: 0 0 24px rgba(244, 197, 66, 0.55);
}

.control-body .weather-preview-icon span,
.control-body .weather-preview-icon::after {
  position: absolute;
  content: "";
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, #cfdae2);
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.24);
}

.control-body .weather-preview-icon span {
  width: 72px;
  height: 36px;
  left: 18px;
  top: 36px;
}

.control-body .weather-preview-icon::after {
  width: 48px;
  height: 48px;
  left: 42px;
  top: 25px;
}

.control-body .weather-preview-icon.is-sun span,
.control-body .weather-preview-icon.is-sun::after,
.control-body .weather-preview-icon.is-cloud::before,
.control-body .weather-preview-icon.is-unknown::before {
  opacity: 0;
}

.control-body .weather-preview-icon.is-cloud span {
  left: 8px;
  width: 78px;
  height: 42px;
}

.control-body .weather-preview-icon.is-cloud::after {
  left: 48px;
  width: 42px;
  height: 42px;
}

.control-body .weather-preview-icon.is-rain::before {
  width: 10px;
  height: 24px;
  left: 24px;
  top: 66px;
  border-radius: 999px;
  background: #54c8ff;
  box-shadow:
    20px 7px 0 #54c8ff,
    40px 2px 0 #54c8ff;
}

.control-body .weather-preview-icon.is-storm::before {
  width: 22px;
  height: 42px;
  left: 36px;
  top: 55px;
  border-radius: 2px;
  background: #ffd44d;
  clip-path: polygon(42% 0, 100% 0, 62% 42%, 100% 42%, 26% 100%, 45% 55%, 0 55%);
  box-shadow: 0 0 18px rgba(255, 212, 77, 0.55);
}

.control-body .weather-preview-icon.is-snow::before {
  width: 9px;
  height: 9px;
  left: 23px;
  top: 68px;
  border-radius: 50%;
  background: #eaf7ff;
  box-shadow:
    22px 8px 0 #eaf7ff,
    44px 1px 0 #eaf7ff;
}

.control-body .weather-preview-icon.is-fog::before {
  width: 74px;
  height: 6px;
  left: 9px;
  top: 72px;
  border-radius: 999px;
  background: rgba(235, 242, 246, 0.82);
  box-shadow:
    0 13px 0 rgba(235, 242, 246, 0.68),
    0 -13px 0 rgba(235, 242, 246, 0.58);
}

.control-body .weather-preview-icon.is-unknown span {
  opacity: 0.42;
}

.control-body .weather-preview-reading {
  min-width: 0;
}

.control-body .weather-preview-reading strong,
.control-body .weather-preview-reading span,
.control-body .weather-preview-reading em {
  display: block;
  font-style: normal;
  line-height: 1;
}

.control-body .weather-preview-reading strong {
  color: var(--cc-white);
  font-size: clamp(46px, 3.6vw, 76px);
  font-weight: 1000;
}

.control-body .weather-preview-reading span {
  margin-top: 6px;
  color: var(--cc-white);
  font-size: clamp(18px, 1.25vw, 28px);
  font-weight: 900;
  text-transform: uppercase;
}

.control-body .weather-preview-reading em {
  margin-top: 7px;
  color: var(--cc-muted);
  font-size: clamp(16px, 1vw, 22px);
  font-weight: 900;
  text-transform: uppercase;
}

.control-body .weather-preview-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(0, 0, 0, 0.32);
}

.control-body .weather-preview-stats span {
  display: grid;
  place-items: center;
  gap: 4px;
  min-height: 70px;
  padding: 10px 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.control-body .weather-preview-stats span:first-child {
  border-left: 0;
}

.control-body .weather-preview-stats em,
.control-body .weather-preview-stats strong {
  display: block;
  font-style: normal;
  line-height: 1;
  text-transform: uppercase;
}

.control-body .weather-preview-stats em {
  color: var(--cc-muted);
  font-size: clamp(12px, 0.78vw, 16px);
  font-weight: 900;
}

.control-body .weather-preview-stats strong {
  color: var(--cc-white);
  font-size: clamp(18px, 1.2vw, 26px);
  font-weight: 1000;
}

.control-body .ticker-preview-mini {
  display: flex;
  align-items: end;
  min-height: 220px;
  padding: 0 20px 34px;
}

.control-body .ticker-preview-mini-track {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 66px;
  align-items: center;
  overflow: hidden;
  border-top: 5px solid var(--cc-red);
  background:
    linear-gradient(180deg, rgba(25, 25, 26, 0.98), rgba(7, 7, 8, 0.99));
  box-shadow: 0 -10px 26px rgba(0, 0, 0, 0.35);
}

.control-body .ticker-preview-mini-track span,
.control-body .ticker-preview-mini-track em {
  flex: 0 0 auto;
  color: rgba(245, 247, 250, 0.82);
  font-style: normal;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.control-body .ticker-preview-mini-track span {
  padding-inline: clamp(22px, 2vw, 46px);
  font-size: clamp(22px, 1.65vw, 36px);
}

.control-body .ticker-preview-mini-track em {
  color: rgba(245, 247, 250, 0.68);
  font-size: clamp(18px, 1.3vw, 28px);
}

.control-body .style-preset-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 18px;
}

.control-body .style-preset-card {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  padding: 16px 18px;
  text-align: left;
  border-left: 4px solid var(--cc-blue);
}

.control-body .style-preset-card span,
.control-body .style-preset-card em {
  display: block;
  color: var(--cc-muted);
  font-size: clamp(13px, 0.78vw, 17px);
  font-style: normal;
  line-height: 1.1;
}

.control-body .style-preset-card strong {
  display: block;
  color: var(--cc-white);
  font-size: clamp(26px, 1.5vw, 36px);
  line-height: 0.92;
}

.control-body .style-preset-card.is-active {
  border-color: rgba(66, 223, 86, 0.72);
  border-left-color: var(--cc-green);
  color: #ffffff;
  background:
    radial-gradient(circle at 8% 16%, rgba(66, 223, 86, 0.24), transparent 46%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 40%),
    linear-gradient(180deg, rgba(8, 28, 17, 0.94), rgba(2, 8, 13, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(66, 223, 86, 0.34),
    0 0 24px rgba(66, 223, 86, 0.16);
}

.control-body .saved-looks {
  margin: 0 0 18px;
}

.control-body .saved-looks-actions {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.control-body .saved-looks-actions input {
  flex: 1;
  min-width: 0;
}

.control-body .saved-looks-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.control-body .saved-looks-list:empty {
  display: none;
}

.control-body .saved-look-row {
  display: flex;
  align-items: stretch;
}

.control-body .saved-look-apply {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-left: 4px solid var(--cc-blue);
  border-radius: 6px 0 0 6px;
  text-align: left;
}

.control-body .saved-look-apply strong {
  color: var(--cc-white);
  font-size: clamp(14px, 0.85vw, 18px);
  line-height: 1;
}

.control-body .saved-look-swatches {
  display: inline-flex;
  gap: 3px;
}

.control-body .saved-look-swatches i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.control-body .saved-look-delete {
  padding: 8px 10px;
  border-radius: 0 6px 6px 0;
  color: var(--cc-muted);
  font-size: 16px;
  line-height: 1;
}

.control-body .saved-look-delete:hover {
  color: #ff6b66;
}

.control-body.is-paged-control .control {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "hero"
    "nav";
}

.control-body.is-paged-control .control > [data-control-page-panel] {
  grid-area: auto !important;
  grid-column: 1 / -1;
}

.control-body.is-paged-control .control > [data-control-page-panel]:not(.is-current-control-page) {
  display: none !important;
}

.control-body.is-paged-control .control > [data-control-page-panel].is-current-control-page {
  display: block;
}

.control-body.is-paged-control .control > #setupToolsPanel.is-current-control-page {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.control-body.is-paged-control[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body.is-paged-control[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body.is-paged-control[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body.is-paged-control[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body.is-paged-control[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body.is-paged-control[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body.is-paged-control[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 140, 255, 0.38), transparent 58%),
    linear-gradient(180deg, rgba(31, 77, 122, 0.86), rgba(6, 16, 27, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(47, 140, 255, 0.78),
    inset 0 -12px 24px rgba(47, 140, 255, 0.12),
    0 0 22px rgba(47, 140, 255, 0.24);
}

.control-body.is-paged-control[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body.is-paged-control[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body.is-paged-control[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body.is-paged-control[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body.is-paged-control[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body.is-paged-control[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body.is-paged-control[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  pointer-events: none;
}

.control-body.is-race-day-mode .control-quick-nav {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.control-body.is-setup-mode .control-quick-nav {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

/* Final tab-state guard: only the page stored on the body gets the selected glow. */
.control-body .control-quick-nav a,
.control-body .control-quick-nav a.active,
.control-body .control-quick-nav a.is-active,
.control-body .control-quick-nav a[aria-selected="true"] {
  color: #b7c5d2;
  background: transparent;
  box-shadow: none;
}

.control-body[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  color: #ffffff;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 140, 255, 0.38), transparent 58%),
    linear-gradient(180deg, rgba(31, 77, 122, 0.86), rgba(6, 16, 27, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(47, 140, 255, 0.78),
    inset 0 -12px 24px rgba(47, 140, 255, 0.12),
    0 0 22px rgba(47, 140, 255, 0.24);
}

.control-body .control-quick-nav a:hover,
.control-body .control-quick-nav a:focus-visible {
  color: #ffffff;
  background:
    linear-gradient(180deg, rgba(120, 190, 238, 0.12), rgba(6, 16, 27, 0.44));
  box-shadow:
    inset 0 0 0 1px rgba(120, 190, 238, 0.22),
    inset 0 -10px 20px rgba(47, 140, 255, 0.035);
}

.control-body[data-active-control-page="timingPanel"] .control-quick-nav a[href="#timingPanel"],
.control-body[data-active-control-page="outputPanel"] .control-quick-nav a[href="#outputPanel"],
.control-body[data-active-control-page="storyPanel"] .control-quick-nav a[href="#storyPanel"],
.control-body[data-active-control-page="bannerPanel"] .control-quick-nav a[href="#bannerPanel"],
.control-body[data-active-control-page="weatherTickerPanel"] .control-quick-nav a[href="#weatherTickerPanel"],
.control-body[data-active-control-page="podiumPanel"] .control-quick-nav a[href="#podiumPanel"],
.control-body[data-active-control-page="stylePanel"] .control-quick-nav a[href="#stylePanel"] {
  color: #ffffff !important;
  background:
    radial-gradient(circle at 50% 100%, rgba(47, 140, 255, 0.38), transparent 58%),
    linear-gradient(180deg, rgba(31, 77, 122, 0.86), rgba(6, 16, 27, 0.96)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(47, 140, 255, 0.78),
    inset 0 -12px 24px rgba(47, 140, 255, 0.12),
    0 0 22px rgba(47, 140, 255, 0.24) !important;
}

.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]),
.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]).active,
.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]).is-active {
  color: #b7c5d2 !important;
  background: transparent !important;
  box-shadow: none !important;
}

.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]):hover,
.control-body.is-paged-control .control-quick-nav a:not([aria-selected="true"]):focus-visible {
  color: #e8f2ff !important;
  background:
    linear-gradient(180deg, rgba(120, 190, 238, 0.12), rgba(6, 16, 27, 0.44)) !important;
  box-shadow:
    inset 0 0 0 1px rgba(120, 190, 238, 0.22),
    inset 0 -10px 20px rgba(47, 140, 255, 0.035) !important;
}

.control-body .weather-preview-layout {
  display: grid !important;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

.control-body .weather-preview-layout > .weather-preview-mini {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 260px;
  opacity: 1 !important;
  visibility: visible !important;
}

.control-body .weather-preview-layout > .ticker-preview-mini {
  display: flex !important;
  min-height: 260px;
  opacity: 1 !important;
  visibility: visible !important;
}

.control-body .weather-preview-mini > *,
.control-body .ticker-preview-mini > * {
  opacity: 1 !important;
  visibility: visible !important;
}

@media (max-width: 1500px) {
  .timing-control-row {
    grid-template-columns: minmax(150px, 0.45fr) minmax(300px, 1fr);
  }

  .timing-actions {
    grid-column: 1 / -1;
    justify-self: end;
    width: min(100%, 560px);
  }
}

@media (min-width: 1281px) {
  .control-body .control-hero {
    grid-template-columns: minmax(250px, 0.76fr) minmax(520px, 1.45fr) minmax(220px, 0.58fr);
  }
}

@media (max-width: 1450px) {
  .control-body .control-live-ribbon {
    grid-template-columns: minmax(220px, 1fr) minmax(110px, 0.44fr) minmax(130px, 0.52fr);
  }

  .control-body .live-ribbon-time {
    display: none;
  }
}

@media (max-width: 1180px) {
  .control-body .control-live-ribbon {
    grid-template-columns: 1fr;
  }

  .control-body .control-preview-grid,
  .control-body .style-preset-grid,
  .control-body .banner-preview-layout,
  .control-body .weather-preview-layout,
  .control-body .style-preview-layout {
    grid-template-columns: 1fr !important;
  }

  .control-body.is-paged-control .control > #setupToolsPanel.is-current-control-page {
    grid-template-columns: 1fr;
  }
}


/* Server health chip, LIVE output indicators, stale-timing strip, session presets. */
.control-body .live-ribbon-server.is-good {
  border-color: rgba(66, 223, 86, 0.66);
  background:
    radial-gradient(circle at 12% 18%, rgba(66, 223, 86, 0.22), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(8, 28, 17, 0.94), rgba(2, 8, 13, 0.95));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 0 24px rgba(66, 223, 86, 0.2);
}

.control-body .live-ribbon-server.is-warn {
  border-color: rgba(244, 197, 66, 0.72);
  background:
    radial-gradient(circle at 12% 18%, rgba(244, 197, 66, 0.22), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(28, 24, 10, 0.94), rgba(2, 8, 13, 0.95));
}

.control-body .live-ribbon-server.is-bad {
  border-color: rgba(235, 80, 72, 0.95);
  background:
    radial-gradient(circle at 12% 18%, rgba(235, 80, 72, 0.3), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 34%),
    linear-gradient(180deg, rgba(32, 10, 9, 0.94), rgba(2, 8, 13, 0.95));
  box-shadow: 0 0 28px rgba(235, 80, 72, 0.4);
  animation: lrwServerBadPulse 1.6s ease-in-out infinite;
}

@keyframes lrwServerBadPulse {
  0%, 100% { box-shadow: 0 0 28px rgba(235, 80, 72, 0.4); }
  50% { box-shadow: 0 0 38px rgba(235, 80, 72, 0.75); }
}

.control-body .program-buttons [data-preview].is-live-output {
  position: relative;
  outline: 2px solid rgba(231, 51, 47, 0.95);
  outline-offset: -2px;
  box-shadow: 0 0 16px rgba(231, 51, 47, 0.45);
}

.control-body .program-buttons [data-preview].is-live-output::after {
  content: "LIVE";
  position: absolute;
  top: 4px;
  right: 6px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  color: #fff;
  background: #e7332f;
  border-radius: 3px;
  padding: 2px 5px;
  pointer-events: none;
}

@keyframes lrwSendFlash {
  0% { box-shadow: 0 0 0 4px rgba(231, 51, 47, 0.95), 0 0 30px rgba(231, 51, 47, 0.85); }
  100% { box-shadow: 0 0 16px rgba(231, 51, 47, 0.45); }
}

.control-body .program-buttons [data-preview].send-flash {
  animation: lrwSendFlash 0.9s ease-out;
}

.control-body .stale-timing-strip {
  grid-column: 1 / -1;
  border: 1px solid rgba(244, 197, 66, 0.85);
  border-radius: 12px;
  background:
    radial-gradient(circle at 8% 30%, rgba(244, 197, 66, 0.22), transparent 50%),
    linear-gradient(180deg, rgba(46, 36, 8, 0.95), rgba(20, 16, 4, 0.95));
  color: #ffe9ad;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 12px 18px;
}

.control-body .stale-timing-strip[hidden] {
  display: none;
}

.control-body .session-preset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 4px 0 12px;
}

.control-body .session-preset-label {
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 12px;
  color: #cfd4d9;
}

.control-body .session-preset-hint {
  font-size: 12px;
  color: #8d959c;
  font-style: normal;
}


/* Five-card live ribbon: make room for the server health card at every width. */
.control-body .control-live-ribbon {
  grid-template-columns: minmax(118px, 0.5fr) minmax(170px, 1.04fr) minmax(100px, 0.4fr) minmax(120px, 0.5fr) minmax(120px, 0.5fr);
}

@media (max-width: 1450px) {
  .control-body .control-live-ribbon {
    grid-template-columns: minmax(112px, 0.5fr) minmax(200px, 1fr) minmax(104px, 0.42fr) minmax(124px, 0.5fr);
  }
}

@media (max-width: 1180px) {
  .control-body .control-live-ribbon {
    grid-template-columns: 1fr;
  }
}


/* Let the hero status pill wrap instead of clipping its send-status text. */
.control-body .control-hero-actions .status-pill {
  white-space: normal;
  flex-wrap: wrap;
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  overflow: visible;
}


/* Lap-down gaps read "-2 LAPS" now; give the banner metric column room for it. */
.race-strip .lap-row {
  grid-template-columns: 38px 34px minmax(0, 1fr) 92px;
}


/* The premium template pinned the flyout metric column at 52px; "-2 LAPS" and
   lap times need ~84px. Name column absorbs the difference. */
.race-strip.template-reference-premium .lap-row {
  grid-template-columns: 30px 38px minmax(0, 1fr) 84px;
}


/* ---- Live motion pass: position arrows, fastest lap, reorders, entrances ---
   Markers and overlays are appended by app.js helpers (applyPositionTrend,
   applyFastestLapFlash) as <u> elements so the b/em/span/i row grids and the
   board's .pos/.num/.name/.metric selectors never see extra grid children. */

.side-driver-row,
.strip-cell,
.strip-cell b,
.side-driver-row b,
.lap-row,
.lap-row b {
  position: relative;
}

.pos-trend {
  position: absolute;
  top: 2px;
  right: 2px;
  z-index: 6;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.65));
  animation: lrw-trend-fade 10s linear both;
}

.pos-trend-up {
  border-bottom: 7px solid #3ed273;
}

.pos-trend-down {
  border-top: 7px solid #e8453c;
}

@keyframes lrw-trend-fade {
  0%, 62% { opacity: 1; }
  100% { opacity: 0; }
}

/* Fastest-lap purple: translucent sweep across the holder's row, fading out
   over the hold window. Sits above row backgrounds, below nothing critical -
   the tint stays light enough to read text through. */
.fastlap-flash {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(139, 47, 214, 0.1),
    rgba(139, 47, 214, 0.42) 28% 72%,
    rgba(139, 47, 214, 0.1)
  );
  animation: lrw-fastlap-flash 8s ease-out both;
}

@keyframes lrw-fastlap-flash {
  0% { opacity: 0; }
  5% { opacity: 1; }
  16% { opacity: 0.5; }
  26% { opacity: 0.95; }
  60% { opacity: 0.55; }
  100% { opacity: 0; }
}

/* Chip text stays on one line at full size; when it overflows the footer it
   becomes a scrolling marquee (setOverflowMarquee) instead of shrinking. */
.last-lap-panel footer {
  white-space: nowrap;
  overflow: hidden;
  padding-left: 6px;
  padding-right: 6px;
}

.last-lap-panel footer.chip-marquee {
  text-overflow: clip;
}

.chip-marquee-track {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  animation: lrw-chip-marquee 12s linear infinite;
  will-change: transform;
}

.chip-marquee-track span {
  flex: 0 0 auto;
  padding-right: 48px;
}

@keyframes lrw-chip-marquee {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}


/* ---- Premium pass: sheen sweeps, leader plates, metric crossfade ---------- */

/* Specular glint that sweeps the logo panels every ~26s. The overlay element
   is appended by the banner/tower pages (both pseudo slots are taken by the
   bevel and reflection treatments). */
.strip-logo,
.side-tower-header {
  position: relative;
}

.panel-sheen {
  position: absolute;
  inset: 0;
  z-index: 5;
  overflow: hidden;
  pointer-events: none;
  border-radius: inherit;
}

.panel-sheen::before {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: 0;
  width: 34%;
  background: linear-gradient(105deg, transparent, rgba(255, 255, 255, 0.17) 45% 55%, transparent);
  transform: translateX(-240%) skewX(-16deg);
  animation: lrw-panel-sheen 12s linear infinite;
}

@keyframes lrw-panel-sheen {
  0%, 90% { transform: translateX(-240%) skewX(-16deg); }
  100% { transform: translateX(440%) skewX(-16deg); }
}

/* Glass look (bannerGlassOpen): translucent panels with the video showing
   through, plus a brighter glass edge. Deliberately NOT backdrop-filter:
   vMix composites video behind the rendered browser frame, so a blur has
   nothing to sample there - translucency is the part of "glass" that
   actually reaches air. */
body.banner-glass .race-strip,
body.banner-glass .race-side-tower {
  /* Panels stack a backing layer plus row layers, so per-layer alpha
     compounds; 0.55 per layer is the user-approved glass strength. */
  --banner-panel-alpha: 0.55;
  --banner-flyout-alpha: 0.52;
}

body.banner-glass .race-strip .strip-cell,
body.banner-glass .race-side-tower .side-driver-row {
  border-top: 1px solid rgba(255, 255, 255, 0.22);
}

/* Glass for the boards and lower graphics: the themes paint rows, rails,
   headers and footers from these per-board variables, so translucent
   variants of the same colors carry the glass look to the lineup board,
   results, Top 5, Current Leaders, and the running-order bug. */
body.banner-glass.graphics-theme-dark .lineup-board,
body.banner-glass.graphics-theme-dark .leaders-third,
body.banner-glass.graphics-theme-dark .top-five-board,
body.banner-glass.graphics-theme-dark .bug,
body.banner-glass.graphics-theme-dark .topbar,
body.banner-glass.graphics-theme-dark .lower-third {
  --theme-rail-top: rgb(53 58 58 / 0.62);
  --theme-rail-mid: rgb(24 27 27 / 0.66);
  --theme-rail-bottom: rgb(6 7 7 / 0.7);
  --theme-row-top: rgb(60 65 65 / 0.62);
  --theme-row-mid: rgb(26 29 29 / 0.66);
  --theme-row-bottom: rgb(5 6 6 / 0.7);
}

body.banner-glass.graphics-theme-light .lineup-board,
body.banner-glass.graphics-theme-light .leaders-third,
body.banner-glass.graphics-theme-light .top-five-board,
body.banner-glass.graphics-theme-light .bug,
body.banner-glass.graphics-theme-light .topbar,
body.banner-glass.graphics-theme-light .lower-third {
  --theme-rail-top: rgb(255 255 255 / 0.66);
  --theme-rail-mid: rgb(246 248 248 / 0.62);
  --theme-rail-bottom: rgb(223 231 231 / 0.66);
  --theme-row-top: rgb(255 255 255 / 0.62);
  --theme-row-mid: rgb(251 252 252 / 0.58);
  --theme-row-bottom: rgb(233 238 238 / 0.62);
}

body.banner-glass .bug,
body.banner-glass .topbar {
  background: color-mix(in srgb, var(--graphic-background-color) 58%, transparent);
}

body.banner-glass .lower-ticker {
  --banner-panel-alpha: 0.55;
}

/* The leader always reads: P1 position plates carry a steady dark-gold plate
   with a gold number. Quieter than podium gold - that stays the payoff at the
   finish. */
.strip-cell.is-leader b,
.lap-row.is-leader b,
.side-driver-row.is-leader b {
  color: #ffd75e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.24), transparent 40%),
    linear-gradient(180deg, #6b5410 0%, #483607 60%, #241a02 100%);
  box-shadow:
    inset 0 0 0 1px rgba(217, 164, 28, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 4px 8px rgba(0, 0, 0, 0.34);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
}

body .lineup-row.is-leader .pos {
  color: #ffd75e;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(180deg, #6b5410 0%, #483607 58%, #241a02 100%);
  box-shadow:
    inset 0 0 0 1px rgba(217, 164, 28, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.86),
    0 1px 2px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.14), 0 3px 5px black;
}

/* Metric crossfade: when the rotating field changes, the value column fades
   in over ~240ms instead of snapping. Opacity only - any transform here
   makes the column (and the chip footer below it) visibly jump on every
   rotation. The footer is deliberately not animated. */
#metricRows.is-metric-swap .lap-row em,
.race-side-tower.is-metric-swap .side-driver-row i,
.race-side-tower.is-metric-swap .side-driver-group-main header em {
  animation: lrw-metric-swap 240ms ease-out both;
}

@keyframes lrw-metric-swap {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

/* Banner flyout footer becomes the FASTEST LAP chip while the flash is live. */
.last-lap-panel.is-fastlap footer {
  background: linear-gradient(90deg, #4c1d80, #8b2fd6 50%, #4c1d80);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* And the BATTLE chip while two cars run nose-to-tail (amber, persistent). */
.last-lap-panel.is-battle footer {
  background: linear-gradient(90deg, #6e2c06, #d96a1c 50%, #6e2c06);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* NEW LEADER flash right after a pass for the lead (green, 8s). */
.last-lap-panel.is-new-leader footer {
  background: linear-gradient(90deg, #0c4a23, #1d9e51 50%, #0c4a23);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* Rotating quiet story (biggest mover, etc.) - steel blue, occasional. */
.last-lap-panel.is-story footer {
  background: linear-gradient(90deg, #16314c, #2f6da8 50%, #16314c);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

/* GREEN GREEN GREEN at every green-out (start and restarts), 6s. */
.last-lap-panel.is-green-start footer {
  background: linear-gradient(90deg, #0a5e2a, #21c161 50%, #0a5e2a);
  color: #ffffff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}

/* One-shot moment sweeps across the whole banner/tower: green at green-out,
   gold at the checkered. The overlay is parked invisible until fired. */
.moment-flash {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
}

.moment-flash.is-firing-green,
.moment-flash.is-firing-gold {
  opacity: 1;
}

.moment-flash::before {
  content: "";
  position: absolute;
  top: -20%;
  bottom: -20%;
  left: 0;
  width: 30%;
  /* On a panel as tall as the tower, the skew displaces the line's top tip
     ~200px sideways, so the resting spot must sit far enough off-screen
     that the tip cannot poke into the top-left corner. The fill mode keeps
     the finished sweep parked off-right until the class is removed. */
  transform: translateX(-420%) skewX(-18deg);
}

.moment-flash.is-firing-green::before {
  background: linear-gradient(105deg, transparent, rgba(46, 224, 119, 0.5) 50%, transparent);
  animation: lrw-moment-sweep 1.4s ease-out both;
}

.moment-flash.is-firing-gold::before {
  background: linear-gradient(105deg, transparent, rgba(255, 203, 71, 0.55) 50%, transparent);
  animation: lrw-moment-sweep 1.4s ease-out both;
}

@keyframes lrw-moment-sweep {
  from { transform: translateX(-420%) skewX(-18deg); }
  to { transform: translateX(640%) skewX(-18deg); }
}

/* Both rows of the live battle pair carry an amber wash with edge bars, so
   the fight is findable in the running order, not just readable in the chip. */
.battle-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  /* Marker, not highlighter - but with enough amber to find at a glance. */
  background: linear-gradient(
    90deg,
    rgba(217, 106, 28, 0.22),
    rgba(217, 106, 28, 0.06) 20% 80%,
    rgba(217, 106, 28, 0.22)
  );
  box-shadow:
    inset 3px 0 0 rgba(217, 106, 28, 0.7),
    inset -3px 0 0 rgba(217, 106, 28, 0.7);
}

/* Tower story chip: the label bar above the top five becomes the moment chip,
   same colors and priority as the banner flyout footer. */
.side-driver-group-main header.is-chip span {
  display: none;
}

.side-driver-group-main header.is-chip em {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
  padding: 6px 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  color: #ffffff;
  font-size: 29px;
  font-style: normal;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
}

.side-driver-group-main header.chip-checkered {
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.78), rgba(5, 6, 8, 0.78)),
    repeating-conic-gradient(#e8e8e8 0% 25%, #0a0a0a 0% 50%) 0 0 / 16px 16px;
}

.side-driver-group-main header.chip-white-flag {
  background: linear-gradient(180deg, #ffffff 0%, #dde2e6 60%, #b8bec5 100%);
}

.side-driver-group-main header.chip-white-flag em {
  color: #0d0f12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.side-driver-group-main header.chip-green-start {
  background: linear-gradient(90deg, #0a5e2a, #21c161 50%, #0a5e2a);
}

.side-driver-group-main header.chip-fastlap {
  background: linear-gradient(90deg, #4c1d80, #8b2fd6 50%, #4c1d80);
}

.side-driver-group-main header.chip-new-leader {
  background: linear-gradient(90deg, #0c4a23, #1d9e51 50%, #0c4a23);
}

.side-driver-group-main header.chip-battle {
  background: linear-gradient(90deg, #6e2c06, #d96a1c 50%, #6e2c06);
}

.side-driver-group-main header.chip-story {
  background: linear-gradient(90deg, #16314c, #2f6da8 50%, #16314c);
}

/* Tower readability pass: the tower is widened to 420px and the type scaled
   to match - it reads from the couch, not the desk. (fitTextToBox maxSizes
   in side-banner.html match these.) */
.race-side-tower {
  width: 420px;
}

.side-driver-row {
  grid-template-columns: 52px 56px minmax(0, 1fr) 76px;
}

.side-driver-group-rotation .side-driver-row {
  grid-template-columns: 52px 56px minmax(0, 1fr) 76px;
}

.side-driver-group-main .side-driver-rows {
  grid-template-rows: repeat(5, 60px);
}

.side-driver-group-rotation .side-driver-rows {
  grid-auto-rows: 58px;
}

/* styles-4 shrinks the rotation rows' type (18px metrics); P6+ reads at the
   same scale as the top five now - matching specificity, later file wins. */
.side-driver-group-rotation .side-driver-row b {
  height: 42px;
  font-size: 34px;
}

.side-driver-group-rotation .side-driver-row em {
  font-size: 26px;
}

.side-driver-group-rotation .side-driver-row i {
  font-size: 24px;
}

.side-driver-group-rotation .side-driver-row span {
  font-size: 31px;
}

.side-driver-row b {
  height: 42px;
  font-size: 34px;
}

.side-driver-row em {
  font-size: 26px;
}

.side-driver-row span {
  font-size: 31px;
}

.side-driver-row i {
  font-size: 24px;
}

.side-duration span {
  font-size: 32px;
}

.side-duration strong {
  font-size: 46px;
}

.side-driver-group header span {
  font-size: 28px;
}

.side-driver-group header em {
  font-size: 24px;
}

/* Style panel package toggles: buttons that read On/Off and glow green when
   active, matching the preset-card active treatment. */
.control-body .package-toggle {
  min-height: 42px;
}

.control-body .package-toggle.is-active {
  color: #ffffff;
  border-color: rgba(66, 223, 86, 0.72);
  background:
    radial-gradient(circle at 10% 20%, rgba(66, 223, 86, 0.22), transparent 50%),
    linear-gradient(180deg, rgba(8, 28, 17, 0.94), rgba(2, 8, 13, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(66, 223, 86, 0.34),
    0 0 16px rgba(66, 223, 86, 0.14);
}

/* Results board winner strip: a gold band between the title and the rows
   once the race is decided. */
.lineup-board .winner-strip {
  width: 820px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  height: 62px;
  border: 1px solid rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  color: #1c1304;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.42), transparent 32%),
    linear-gradient(180deg, #f0c044 0%, #d9a41c 52%, #93700d 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -3px 0 rgba(0, 0, 0, 0.3),
    0 6px 14px rgba(0, 0, 0, 0.4);
  font-family: "Barlow Condensed Local", "Arial Narrow", Arial, sans-serif;
  font-size: 38px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  overflow: hidden;
}

.lineup-board .winner-strip[hidden] {
  display: none;
}

/* Race Story spotlight scaled up: bigger card, bigger story. The centered
   position offset tracks the new width (half of 1020px). */
.race-story-spotlight {
  width: 1020px;
  min-height: 214px;
}

body.race-story-position-bottom-center .race-story-spotlight {
  left: calc(50% - 510px);
}

.story-spotlight-content {
  grid-template-rows: minmax(0, auto) minmax(0, auto) 44px;
  gap: 10px;
  padding: 32px 38px 14px;
}

.story-spotlight-title {
  font-size: 68px;
}

.story-spotlight-detail {
  font-size: 46px;
}

.story-spotlight-meta {
  font-size: 27px;
}

/* Staggered row entrance on the board's first reveal. board-rows-entered is
   set by board.html shortly after the reveal so mid-air rebuilds (reorders,
   metric changes) never replay the entrance. */
body.graphic-ready:not(.board-rows-entered) .lineup-group .lineup-row {
  animation: lrw-row-enter 380ms cubic-bezier(0.18, 0.9, 0.24, 1) both;
  animation-delay: calc(240ms + var(--row-index, 0) * 45ms);
}

@keyframes lrw-row-enter {
  0% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 1; transform: translateY(0); }
}

/* Results podium: gold/silver/bronze position cells for P1-P3. Base bevel
   shadows from .lineup-row .pos carry through; only the plate color changes. */
body .lineup-row.is-podium-1 .pos {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 26%),
    linear-gradient(180deg, #d9a41c 0%, #a87a0e 58%, #6e4f06 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 5px rgba(0, 0, 0, 0.85);
}

body .lineup-row.is-podium-2 .pos {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(180deg, #c9ced6 0%, #939aa4 58%, #5d636c 100%);
  color: #0d0f12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 3px rgba(0, 0, 0, 0.35);
}

body .lineup-row.is-podium-3 .pos {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 26%),
    linear-gradient(180deg, #c87f42 0%, #96572a 58%, #5e3517 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28), 0 3px 5px rgba(0, 0, 0, 0.85);
}


/* ---- Top 3 podium: gold/silver/bronze, matching the results board ----------
   The feature-board place plates are set with !important in styles-4, so the
   overrides here match that; the steps below the cards have no !important
   competition and recolor with plain rules. */

body .top3-feature-board .podium-card.first .podium-place {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 38%),
    linear-gradient(180deg, #d9a41c 0%, #a87a0e 58%, #6e4f06 100%) !important;
}

body .top3-feature-board .podium-card.second .podium-place {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 38%),
    linear-gradient(180deg, #c9ced6 0%, #939aa4 58%, #5d636c 100%) !important;
  color: #0d0f12 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 4px 6px rgba(0, 0, 0, 0.4) !important;
}

body .top3-feature-board .podium-card.third .podium-place {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.28), transparent 38%),
    linear-gradient(180deg, #c87f42 0%, #96572a 58%, #5e3517 100%) !important;
}

body .top3-v2 .qualifier-step-first {
  background:
    linear-gradient(180deg, #ecc757 0%, #cf9d1d 48%, #8a6410 100%);
}

body .top3-v2 .qualifier-step-second {
  background:
    linear-gradient(180deg, #e8ebef 0%, #b9bfc8 48%, #848b95 100%);
}

body .top3-v2 .qualifier-step-third {
  background:
    linear-gradient(180deg, #dfa06a 0%, #b06c35 48%, #71421d 100%);
}


/* ---- Motion extensions: Current Leaders arrows/flash, Top 5 podium ---------
   Anchor hosts for the appended .pos-trend / .fastlap-flash markers. */

.leaders-row,
.leaders-pos {
  position: relative;
}

/* Top 5 results: same gold/silver/bronze plates as the results board. The
   body prefix outranks the graphics-theme rules that recolor .rank. */
body .top-five-row.is-podium-1 .rank {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.32), transparent 26%),
    linear-gradient(180deg, #d9a41c 0%, #a87a0e 58%, #6e4f06 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3), 0 3px 5px rgba(0, 0, 0, 0.85);
}

body .top-five-row.is-podium-2 .rank {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), transparent 26%),
    linear-gradient(180deg, #c9ced6 0%, #939aa4 58%, #5d636c 100%);
  color: #0d0f12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5), 0 2px 3px rgba(0, 0, 0, 0.35);
}

body .top-five-row.is-podium-3 .rank {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.3), transparent 26%),
    linear-gradient(180deg, #c87f42 0%, #96572a 58%, #5e3517 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28), 0 3px 5px rgba(0, 0, 0, 0.85);
}

/* Top 5 rows stagger in on first reveal only (body.top5-rows-entered is set
   by results.html shortly after the first rows land). */
body:not(.top5-rows-entered) .top-five-row {
  animation: lrw-row-enter 360ms cubic-bezier(0.18, 0.9, 0.24, 1) both;
  animation-delay: calc(160ms + var(--row-index, 0) * 55ms);
}


/* ---- Race moments: white flag / checkered chips, winner gold, caution wash,
   lap-count tick. Banner and tower only - flags stay off the boards. -------- */

/* Flyout footer chips. Checkered mirrors the laps-box flag-final checker. */
.last-lap-panel.is-white-flag footer {
  background: linear-gradient(180deg, #ffffff 0%, #dde2e6 60%, #b8bec5 100%);
  color: #0d0f12;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.last-lap-panel.is-checkered footer {
  color: #ffffff;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.9);
  background:
    linear-gradient(180deg, rgba(5, 6, 8, 0.78), rgba(5, 6, 8, 0.78)),
    repeating-conic-gradient(#e8e8e8 0% 25%, #0a0a0a 0% 50%) 0 0 / 20px 20px;
}

/* Winner gold: persistent shimmer on the leader's row while checkered is up.
   Appended by applyWinnerGlow as a <u> overlay, same pattern as the
   fastest-lap flash. */
.winner-glow {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    90deg,
    rgba(217, 164, 28, 0.14),
    rgba(217, 164, 28, 0.42) 30% 70%,
    rgba(217, 164, 28, 0.14)
  );
  animation: lrw-winner-shimmer 2.2s ease-in-out infinite;
}

@keyframes lrw-winner-shimmer {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* Caution / red flag: the banner family's accent lines take the flag color
   while the condition lasts; green restores the configured accent. */
.race-strip.is-caution,
.race-side-tower.is-caution {
  --banner-accent-line-color: #ffd24a;
}

.race-strip.is-red-flag,
.race-side-tower.is-red-flag {
  --banner-accent-line-color: #ff6b66;
}

/* Lap-count tick: the laps-to-go value pulses when it decrements, and turns
   urgent inside the last five laps (unless a flag already recolors the box). */
/* No display override here: these strongs are grid-centered plates, and
   forcing inline-block knocked the number off-center permanently. */
.laps-box strong.is-ticking,
.side-duration strong.is-ticking {
  animation: lrw-lap-tick 600ms cubic-bezier(0.2, 1.4, 0.4, 1);
}

@keyframes lrw-lap-tick {
  0% { transform: scale(1); }
  35% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

.laps-box.is-closing-laps:not(.flag-yellow):not(.flag-red):not(.flag-final) strong,
.side-duration.is-closing-laps:not(.flag-yellow):not(.flag-red):not(.flag-final) strong {
  color: #ff5a52;
  text-shadow: 0 0 12px rgba(255, 90, 82, 0.45), 0 2px 4px rgba(0, 0, 0, 0.7);
}

/* White flag gets its own state - it used to share the checkered pattern with
   flag-final, which made the white flag read as the finish a lap early. */
.race-strip .laps-box.flag-white,
.side-duration.flag-white {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.12) 34%, transparent 56%),
    linear-gradient(90deg, rgb(186 192 198 / var(--banner-panel-alpha)) 0%, rgb(244 247 249 / var(--banner-panel-alpha)) 48%, rgb(172 179 186 / var(--banner-panel-alpha)) 100%);
  border-bottom-color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.8),
    inset 0 -12px 18px rgba(40, 48, 54, 0.22),
    0 0 18px rgba(238, 243, 246, 0.4),
    0 6px 12px rgba(0, 0, 0, 0.34);
}

.race-strip .laps-box.flag-white span,
.side-duration.flag-white span {
  color: #14181c;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
}

.race-strip .laps-box.flag-white strong,
.side-duration.flag-white strong {
  color: #14181c;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), transparent 30%),
    linear-gradient(180deg, #ffffff 0%, #dde2e6 56%, #aab2ba 100%);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.65);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.85),
    inset 0 -2px 0 rgba(60, 70, 78, 0.45),
    0 1px 2px rgba(0, 0, 0, 0.4);
}
