@font-face {
  font-family: "Teko Local";
  src: url("/fonts/Teko-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Teko Local";
  src: url("/fonts/Teko-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("/fonts/BarlowCondensed-SemiBold.ttf") format("truetype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Local";
  src: url("/fonts/BarlowCondensed-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barlow Condensed Title";
  src: url("/fonts/BarlowCondensed-BlackItalic.ttf") format("truetype");
  font-style: italic;
  font-weight: 900;
  font-display: swap;
}

@font-face {
  font-family: "Airstrike 3D Local";
  src: url("/fonts/AirstrikeBold3D.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Barber Local";
  src: url("/fonts/Barber-Complete.woff") format("woff");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Built Titling Local";
  src: url("/fonts/BuiltTitling-Bold.otf") format("opentype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

@font-face {
  font-family: "Built Titling Local";
  src: url("/fonts/BuiltTitling-BoldItalic.otf") format("opentype");
  font-style: italic;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: rgba(6, 12, 16, 0.82);
  --panel: rgba(12, 20, 26, 0.94);
  --line: rgba(255, 255, 255, 0.16);
  --text: #f5f7fa;
  --muted: #b8c2cc;
  --accent: #e7332f;
  --gold: #f4c542;
  --blue: #2f8cff;
  --toggle-on: #54c7ec;
  --neon-good: #8cf13d;
  --neon-work: #54c7ec;
  --neon-warn: #f4c542;
  --neon-bad: #e7332f;
  --control-metal: #171b1e;
  --control-metal-low: #090b0d;
  --name-color: #ffffff;
  --metric-color: #cfd4d9;
  --graphic-background-color: #071016;
  --graphic-panel-color: #242929;
  --graphic-border-color: #050505;
  --graphic-badge-color: #050505;
  --graphic-badge-text-color: #ffffff;
  --graphic-light-text-color: #111111;
  --graphic-light-subtext-color: #252525;
  --board-title-size: 88px;
  --board-row-name-size: 28px;
  --leader-name-size: 34px;
  --board-scale: 0.86;
  --board-offset-y: 72px;
  --panel-alpha: 0.92;
  --panel-alpha-percent: 92%;
  --banner-name-size: 20px;
  --banner-metric-size: 17px;
  --banner-info-size: 22px;
  --banner-duration-size: 22px;
  --banner-logo-panel-color: #d7dad7;
  --banner-dark-cell-color: #242929;
  --banner-light-cell-color: #e5e9ea;
  --banner-flyout-color: #5a6060;
  --banner-accent-line-color: #e7332f;
  --banner-panel-alpha: 1;
  --banner-flyout-alpha: 1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Barlow Condensed Local", "Arial Narrow", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
}

.control-body {
  background:
    radial-gradient(circle at 18% 0%, rgba(231, 51, 47, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(11, 17, 22, 0.88) 0%, rgba(16, 23, 28, 0.9) 48%, rgba(11, 17, 22, 0.92) 100%),
    url("/assets/liberty-raceworks-splash.png") center / cover fixed;
  padding: 24px;
}

.control {
  max-width: 1360px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(420px, 0.85fr) minmax(620px, 1.15fr);
  grid-template-areas:
    "hero hero"
    "nav nav"
    "timing timing"
    "output output"
    "story story"
    "banner banner"
    "weather weather"
    "podium podium"
    "data style"
    "data upper-left"
    "advanced advanced";
  gap: 10px 16px;
  align-items: start;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.full-width {
  grid-column: 1 / -1;
}

.control-quick-nav {
  grid-area: nav;
}

.control-hero {
  grid-area: hero;
}

.control > .race-ready-panel {
  grid-area: ready;
}

.output-panel {
  grid-area: output;
}

.race-story-panel {
  grid-area: story;
}

.control-stack {
  display: grid;
  gap: 8px;
}

.control-stack > .panel {
  grid-area: auto;
}

.upper-left-stack {
  grid-area: upper-left;
}

.timing-panel {
  grid-area: timing;
}

.timing-control-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(320px, 1fr) minmax(470px, 520px);
  gap: 10px;
  align-items: end;
}

.timing-control-row select {
  margin-bottom: 0;
}

.timing-url-field {
  min-width: 0;
}

.timing-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}

.timing-actions button {
  min-width: 0;
  min-height: 42px;
}

#resetLiveState {
  border-left-color: var(--cc-yellow);
}

.timing-panel #timingStatus {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
  text-align: right;
}

.timing-panel .operator-health-grid {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.timing-ready-panel {
  display: grid;
  gap: 8px;
}

.timing-ready-heading {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, auto) minmax(170px, auto);
  align-items: center;
  gap: 10px;
}

.timing-ready-title {
  min-width: 0;
}

.timing-ready-title h2 {
  margin-bottom: 4px;
}

.timing-ready-title p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.1;
}

.timing-ready-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: stretch;
}

.timing-source-block,
.race-ready-inline {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 8px;
}

.race-ready-inline {
  grid-area: auto;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.timing-ready-status-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: minmax(58px, auto);
  gap: 6px;
  align-items: stretch;
}

.timing-ready-status-grid .operator-health {
  display: contents;
  margin: 0;
  padding: 0;
  background: none;
  border: 0;
  box-shadow: none;
}

.timing-ready-status-grid .health-summary {
  order: 1;
  min-width: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-areas:
    "dot label"
    ". detail";
  align-content: center;
  gap: 4px 8px;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-left: 3px solid rgba(140, 241, 61, 0.9);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(255, 255, 255, 0.035);
}

.timing-ready-status-grid .operator-health-grid,
.timing-ready-status-grid .race-ready-grid {
  display: contents;
}

.timing-ready-status-grid .operator-health-grid div,
.timing-ready-status-grid .race-ready-card,
.timing-ready-status-grid .race-ready-action {
  min-height: 58px;
}

.timing-ready-status-grid .health-summary .health-dot {
  grid-area: dot;
  align-self: center;
}

.timing-ready-status-grid .health-summary strong {
  grid-area: label;
  min-width: 0;
  color: white;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timing-ready-status-grid .health-summary em {
  grid-area: detail;
  min-width: 0;
  display: block;
  color: #98a6b0;
  font-size: 14px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timing-ready-status-grid .operator-health-grid div {
  order: 20;
}

.timing-ready-status-grid .race-ready-action {
  order: 2;
  position: relative;
  z-index: 8;
  grid-template-columns: 1fr;
  align-content: center;
  gap: 4px;
  margin: 0;
  padding-right: 78px;
}

.timing-ready-status-grid .race-ready-action:has(.race-ready-details[open]) {
  z-index: 80;
}

.timing-ready-status-grid .race-ready-card {
  order: 3;
}

.timing-ready-status-grid .race-ready-action .race-ready-details {
  position: absolute;
  top: 8px;
  right: 9px;
  z-index: 12;
  margin: 0;
}

.timing-ready-status-grid .race-ready-action .race-ready-details summary {
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #ffd55f;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  text-shadow: 0 0 8px rgba(244, 197, 66, 0.28);
  box-shadow: none;
  cursor: pointer;
}

.timing-ready-status-grid .race-ready-action .race-ready-details summary::marker {
  color: #ffd55f;
}

.timing-ready-status-grid .race-ready-action .race-ready-details[open] summary,
.timing-ready-status-grid .race-ready-action .race-ready-details:hover summary {
  color: #fff0a8;
}

.timing-ready-status-grid .race-ready-action .race-ready-issues {
  position: absolute;
  left: calc(100% + 10px);
  right: auto;
  top: -7px;
  width: min(520px, 42vw);
  max-height: 220px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(244, 197, 66, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.08), transparent 36%),
    rgba(5, 8, 10, 0.96);
  box-shadow:
    0 0 22px rgba(244, 197, 66, 0.12),
    0 16px 30px rgba(0, 0, 0, 0.46);
}

.race-intel-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.race-intel-card {
  min-height: 54px;
  display: grid;
  align-content: center;
  gap: 3px;
  padding: 8px 10px;
  border: 1px solid rgba(102, 205, 232, 0.28);
  border-left: 3px solid rgba(102, 205, 232, 0.75);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), transparent 42%),
    rgba(5, 9, 11, 0.74);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 16px rgba(102, 205, 232, 0.08);
  overflow: hidden;
}

.race-intel-card span,
.race-intel-card em {
  min-width: 0;
  color: #aeb8c1;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-intel-card strong {
  min-width: 0;
  color: #ffffff;
  font-size: 18px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.48);
}

.race-intel-card em {
  color: #d8dee4;
  text-transform: none;
}

.missing-panel {
  grid-area: missing;
}

.missing-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.missing-control-row select {
  margin-bottom: 0;
}

.missing-control-row button {
  min-height: 42px;
}

.banner-panel {
  grid-area: banner;
}

.weather-ticker-panel {
  grid-area: weather;
}

.podium-panel {
  grid-area: podium;
}

.vmix-panel {
  grid-area: vmix;
}

.vmix-advanced {
  margin-top: 10px;
}

.vmix-advanced summary {
  color: var(--muted);
  font-size: 15px;
}

.vmix-advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.footer-panel {
  grid-area: footer;
}

.footer-control-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.52fr) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.footer-control-row select,
.footer-control-row input {
  margin-bottom: 0;
}

.style-panel {
  grid-area: style;
}

.data-panel {
  grid-area: data;
  align-self: start;
  height: var(--data-panel-height, auto);
  max-height: var(--data-panel-height, none);
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.advanced-panel {
  grid-area: advanced;
}

.control-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 36%),
    linear-gradient(90deg, rgba(231, 51, 47, 0.18), rgba(12, 20, 26, 0.96) 36%, rgba(12, 20, 26, 0.96));
}

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

.control-logo {
  width: 190px;
  max-width: 28vw;
  max-height: 108px;
  object-fit: contain;
  filter: drop-shadow(0 12px 18px rgba(0, 0, 0, 0.42));
}

.control-hero p,
.panel-heading p,
.panel > p,
details p {
  margin: 0 0 12px;
  color: var(--muted);
}

.control-hero p {
  margin-bottom: 0;
}

.status-pill {
  flex: 0 0 auto;
  min-width: 260px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-align: center;
  color: var(--text) !important;
  font-weight: 700;
}

.operator-health {
  display: grid;
  grid-template-columns: minmax(180px, 0.34fr) minmax(0, 1fr);
  gap: 8px;
  align-items: stretch;
  margin-top: 10px;
  padding: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.055), transparent 38%),
    rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  box-shadow: none;
}

.health-summary {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 10px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
}

.health-summary strong {
  min-width: 0;
  color: white;
  font-size: 18px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.health-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #7c8790;
  box-shadow: 0 0 0 4px rgba(124, 135, 144, 0.16);
}

.health-dot.is-good {
  background: #8cf13d;
  box-shadow: 0 0 0 4px rgba(140, 241, 61, 0.16), 0 0 12px rgba(140, 241, 61, 0.32);
}

.health-dot.is-warn {
  background: #f4c542;
  box-shadow: 0 0 0 4px rgba(244, 197, 66, 0.16), 0 0 12px rgba(244, 197, 66, 0.28);
}

.health-dot.is-bad {
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent), 0 0 12px color-mix(in srgb, var(--accent) 34%, transparent);
}

.operator-health-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.operator-health-grid div {
  min-width: 0;
  padding: 7px 8px;
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 6px;
}

.operator-health-grid span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.operator-health-grid strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  color: white;
  font-size: 16px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-ready-panel {
  padding: 10px 12px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(7, 14, 19, 0.9);
}

.race-ready-topline {
  display: grid;
  grid-template-columns: minmax(190px, 0.5fr) auto minmax(360px, 1fr);
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.race-ready-topline h2 {
  margin: 0;
}

.race-ready-topline p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.1;
}

.race-ready-summary {
  min-width: 146px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
}

.race-ready-summary strong {
  color: white;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.race-ready-summary.is-good {
  border-color: rgba(140, 241, 61, 0.38);
  background: rgba(140, 241, 61, 0.09);
}

.race-ready-summary.is-warn {
  border-color: rgba(244, 197, 66, 0.42);
  background: rgba(244, 197, 66, 0.08);
}

.race-ready-summary.is-bad {
  border-color: color-mix(in srgb, var(--accent) 48%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.race-ready-action {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid #7c8790;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 34%),
    rgba(0, 0, 0, 0.2);
}

.race-ready-action.is-good {
  border-left-color: #8cf13d;
}

.race-ready-action.is-warn {
  border-left-color: #f4c542;
}

.race-ready-action.is-bad {
  border-left-color: var(--accent);
}

.race-ready-action strong {
  color: white;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-ready-action span {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-ready-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.race-ready-card {
  min-width: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 6px 8px;
  padding: 7px 8px;
  border: 1px solid rgba(255, 255, 255, 0.095);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent),
    rgba(255, 255, 255, 0.035);
}

.race-ready-card.is-good {
  border-left: 3px solid #8cf13d;
}

.race-ready-card.is-warn {
  border-left: 3px solid #f4c542;
}

.race-ready-card.is-bad {
  border-left: 3px solid var(--accent);
}

.race-ready-card span,
.race-ready-card em {
  display: block;
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-ready-card strong {
  display: block;
  min-width: 0;
  margin: 0;
  color: white;
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.race-ready-card em {
  grid-column: 1 / -1;
  color: #98a6b0;
  font-size: 10px;
  font-weight: 700;
  text-transform: none;
}

.race-ready-details {
  margin-top: 6px;
}

.race-ready-details summary {
  width: max-content;
  min-height: 24px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.race-ready-details[open] summary {
  margin-bottom: 6px;
}

.race-ready-issues {
  min-height: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0;
}

.race-ready-issues span {
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.race-ready-issues span.is-warn {
  background: rgba(244, 197, 66, 0.16);
  color: #ffe9a5;
}

.race-ready-issues span.is-bad {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: #ffd1d1;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.panel-heading.compact {
  align-items: flex-start;
}

.output-panel {
  border-color: rgba(231, 51, 47, 0.34);
  background:
    linear-gradient(120deg, rgba(231, 51, 47, 0.12), transparent 35%),
    var(--panel);
}

.output-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "topbar"
    "url"
    "qrbutton"
    "qrpanel";
  align-items: start;
  gap: 8px;
  margin-bottom: 10px;
}

.output-topbar {
  grid-area: topbar;
  display: grid;
  grid-template-columns: minmax(300px, 0.34fr) minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  min-width: 0;
}

.output-heading-copy {
  display: block;
  min-width: 0;
}

.output-heading-copy h2 {
  margin-bottom: 8px;
}

.output-heading-copy p {
  margin: 0;
}

h1,
h2 {
  margin: 0 0 12px;
}

h1 {
  font-size: 40px;
  line-height: 1;
}

h2 {
  font-size: 25px;
  line-height: 1.05;
}

textarea,
input,
select {
  width: 100%;
  background: #071016;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 32px;
  padding: 5px 8px;
  font: inherit;
}

select {
  margin-bottom: 6px;
}

input[type="color"] {
  min-height: 32px;
  padding: 4px;
}

.color-code-control {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 6px;
  align-items: center;
}

.color-code-control input[type="color"] {
  width: 36px;
  min-height: 32px;
}

.color-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.color-code-input.invalid {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 42%, transparent);
}

.style-color-control {
  display: none;
}

input[type="range"] {
  padding: 0;
}

.number-stepper {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  gap: 5px;
  align-items: stretch;
}

.number-stepper input[type="number"] {
  min-height: 32px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-weight: 800;
}

.number-stepper input[type="number"]::-webkit-outer-spin-button,
.number-stepper input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
}

.stepper-buttons {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
}

.stepper-buttons button {
  min-height: 0;
  height: 14px;
  padding: 0;
  border-radius: 5px;
  background: #2c3842;
  color: var(--text);
  font-size: 10px;
  line-height: 1;
}

.stepper-buttons button:hover {
  background: color-mix(in srgb, var(--blue) 62%, #2c3842);
}

textarea {
  min-height: 220px;
  resize: vertical;
}

button {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #2c3842;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.program-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.program-buttons button {
  position: relative;
  min-height: 54px;
  padding: 20px 10px 6px;
  line-height: 1.1;
}

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

.program-buttons button::after {
  position: absolute;
  top: 4px;
  left: 6px;
  right: 6px;
  max-width: none;
  padding: 1px 5px 0;
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.58);
  color: white;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.program-buttons button.active:not(.on-program)::after {
  content: "Preview";
}

.program-buttons button.on-program:not(.active)::after {
  content: "Live";
  background: rgba(244, 197, 66, 0.92);
  color: #101010;
}

.program-buttons button.active.on-program::after {
  content: "Live + Preview";
  background: rgba(244, 197, 66, 0.92);
  color: #101010;
}

.program-buttons button[data-preview="story"].is-story-ready {
  border-color: rgba(244, 197, 66, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), transparent 30%),
    radial-gradient(circle at 50% 0%, rgba(244, 197, 66, 0.42), transparent 62%),
    linear-gradient(180deg, rgba(77, 63, 18, 0.98), rgba(19, 17, 12, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.13),
    0 0 22px rgba(244, 197, 66, 0.44);
  animation: race-story-button-ready 1.05s ease-in-out infinite;
}

.program-buttons button[data-preview="story"].is-story-ready:not(.active):not(.on-program)::after {
  content: "Story Ready";
  background: rgba(244, 197, 66, 0.95);
  color: #11110d;
}

.output-vmix-panel {
  margin-top: 18px;
  padding: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.045), transparent 44%),
    rgba(3, 8, 12, 0.28);
  border-color: rgba(255, 255, 255, 0.08);
}

.output-vmix-panel .subpanel-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.output-vmix-panel .subpanel-heading strong {
  font-size: 16px;
}

.output-vmix-panel .subpanel-heading span {
  font-size: 12px;
  text-align: right;
}

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

.output-vmix-panel .vmix-advanced-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.output-info-panels {
  display: grid;
  grid-template-columns: minmax(380px, 0.8fr) minmax(560px, 1.2fr);
  gap: 8px;
  margin-top: 7px;
}

.output-info-panel {
  display: grid;
  grid-template-columns: minmax(138px, 0.28fr) minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  padding: 6px 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.05), transparent 46%),
    rgba(3, 8, 12, 0.34);
  border-color: rgba(255, 255, 255, 0.1);
}

.output-info-panel .subpanel-heading {
  display: grid;
  align-self: start;
  align-content: start;
  gap: 2px;
  margin-bottom: 0;
}

.output-info-panel .subpanel-heading strong {
  font-size: 15px;
  line-height: 1;
}

.output-info-panel .subpanel-heading span {
  font-size: 10px;
  line-height: 1.05;
  text-align: left;
}

.output-info-grid {
  display: grid;
  align-items: end;
  gap: 8px;
}

.output-weather-panel .output-info-grid {
  grid-template-columns: minmax(0, 1fr) minmax(132px, auto);
}

.output-ticker-panel .output-info-grid {
  grid-template-columns: minmax(138px, 0.42fr) minmax(0, 1fr) 118px minmax(126px, auto);
}

.race-story-panel {
  border-color: rgba(102, 205, 232, 0.3);
  background:
    linear-gradient(118deg, rgba(102, 205, 232, 0.08), transparent 34%, rgba(244, 197, 66, 0.035)),
    var(--panel);
}

.race-story-heading {
  align-items: center;
  margin-bottom: 8px;
}

.race-story-heading h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.race-story-heading-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex: 0 0 auto;
}

.race-story-alert {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 4px 9px 3px;
  border: 1px solid rgba(174, 184, 193, 0.28);
  border-radius: 999px;
  color: #aeb8c1;
  background: rgba(174, 184, 193, 0.08);
  font-size: 11px;
  font-weight: 1000;
  line-height: 1;
  letter-spacing: 0;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-alert.is-ready {
  border-color: rgba(244, 197, 66, 0.86);
  color: #fff6c2;
  background:
    radial-gradient(circle at 20% 50%, rgba(244, 197, 66, 0.48), transparent 50%),
    rgba(244, 197, 66, 0.14);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.08),
    0 0 22px rgba(244, 197, 66, 0.42);
  animation: race-story-alert-pulse 1.05s ease-in-out infinite;
}

.race-story-alert.is-bad {
  border-color: rgba(232, 74, 64, 0.58);
  color: #ffb4ae;
  background: rgba(232, 74, 64, 0.12);
}

.race-story-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #c9d2da;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #f4c542;
}

.race-story-panel.is-story-ready {
  border-color: rgba(244, 197, 66, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 28px rgba(244, 197, 66, 0.24);
  animation: race-story-panel-ready 1.35s ease-in-out infinite;
}

.race-story-control-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.38fr) minmax(0, 1fr) minmax(220px, 0.34fr);
  align-items: stretch;
  gap: 10px;
}

.race-story-control-grid .race-story-position-field {
  align-self: start;
}

.race-story-selector,
.race-story-side-controls {
  min-width: 0;
}

.race-story-selector {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(102, 205, 232, 0.28);
  border-left: 3px solid rgba(102, 205, 232, 0.8);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 46%),
    rgba(5, 9, 11, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 18px rgba(102, 205, 232, 0.08);
}

.race-story-status-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
}

.race-story-status-card {
  position: relative;
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 74px;
  padding: 9px 10px;
  border: 1px solid rgba(120, 190, 238, 0.2);
  border-left: 3px solid rgba(120, 190, 238, 0.54);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(3, 9, 14, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 10px 18px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.race-story-status-card::before {
  content: "";
  position: absolute;
  top: 11px;
  right: 11px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #73828d;
  box-shadow: 0 0 10px rgba(115, 130, 141, 0.3);
}

.race-story-status-card span,
.race-story-status-card em {
  min-width: 0;
  color: #aab6bf;
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-status-card strong {
  min-width: 0;
  color: #ffffff;
  font-size: 17px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-story-status-card.is-good,
.race-story-status-card.is-live {
  border-color: rgba(66, 223, 86, 0.36);
  border-left-color: rgba(66, 223, 86, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(66, 223, 86, 0.16), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(3, 14, 8, 0.86);
}

.race-story-status-card.is-good::before,
.race-story-status-card.is-live::before {
  background: #42df56;
  box-shadow: 0 0 14px rgba(66, 223, 86, 0.8);
}

.race-story-status-card.is-warn {
  border-color: rgba(244, 197, 66, 0.36);
  border-left-color: rgba(244, 197, 66, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(244, 197, 66, 0.16), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(16, 12, 4, 0.86);
}

.race-story-status-card.is-warn::before {
  background: #f4c542;
  box-shadow: 0 0 14px rgba(244, 197, 66, 0.75);
}

.race-story-status-card.is-bad {
  border-color: rgba(231, 51, 47, 0.36);
  border-left-color: rgba(231, 51, 47, 0.95);
  background:
    radial-gradient(circle at 0% 0%, rgba(231, 51, 47, 0.16), transparent 52%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(18, 5, 5, 0.88);
}

.race-story-status-card.is-bad::before {
  background: #e7332f;
  box-shadow: 0 0 14px rgba(231, 51, 47, 0.75);
}

.race-story-selector-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.race-story-selector-head div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.race-story-selector-head strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.race-story-selector-head span {
  min-width: 0;
  color: #aeb8c1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-story-mini-button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 5px 10px;
  font-size: 12px;
}

.race-story-mini-button.is-active {
  border-color: rgba(66, 223, 86, 0.62);
  color: #d9ffdf;
  background:
    linear-gradient(180deg, rgba(66, 223, 86, 0.22), rgba(5, 18, 11, 0.88)),
    rgba(5, 18, 11, 0.9);
}

.race-story-choice-list {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.race-story-choice {
  display: grid;
  gap: 3px;
  min-width: 0;
  min-height: 72px;
  padding: 9px 11px;
  border: 1px solid rgba(174, 184, 193, 0.2);
  border-left: 3px solid rgba(102, 205, 232, 0.74);
  border-radius: 7px;
  color: #ffffff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 42%),
    rgba(7, 15, 20, 0.84);
  text-align: left;
  cursor: pointer;
}

.race-story-choice:hover,
.race-story-choice:focus-visible {
  border-color: rgba(102, 205, 232, 0.62);
  box-shadow: 0 0 18px rgba(102, 205, 232, 0.18);
}

.race-story-choice.is-selected {
  border-color: rgba(244, 197, 66, 0.82);
  border-left-color: #f4c542;
  background:
    linear-gradient(135deg, rgba(244, 197, 66, 0.18), transparent 44%),
    rgba(16, 15, 10, 0.9);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.06),
    0 0 20px rgba(244, 197, 66, 0.22);
}

.race-story-choice.is-recommended:not(.is-selected) {
  border-color: rgba(244, 197, 66, 0.42);
  border-left-color: #f4c542;
}

.race-story-choice.is-good,
.race-story-choice.is-live {
  border-left-color: #85d24e;
}

.race-story-choice.is-warn {
  border-left-color: #f4c542;
}

.race-story-choice.is-bad {
  border-left-color: #e84a40;
}

.race-story-choice.is-empty {
  cursor: default;
  opacity: 0.72;
}

.race-story-choice span,
.race-story-choice em {
  min-width: 0;
  color: #aeb8c1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-choice .race-story-choice-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.race-story-choice .race-story-choice-meta b {
  flex: 0 0 auto;
  padding: 3px 6px;
  border-radius: 4px;
  color: #07110a;
  background: linear-gradient(180deg, #8ee35a, #4cb83c);
  font-size: 9px;
  font-weight: 1000;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 0 0 10px rgba(66, 223, 86, 0.28);
}

.race-story-choice strong {
  min-width: 0;
  color: #ffffff;
  font-size: 15px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-choice em {
  color: #d7e1e8;
  font-style: normal;
  text-transform: none;
}

.race-story-side-controls {
  display: grid;
  gap: 10px;
  align-content: start;
}

.race-story-action-panel {
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(102, 205, 232, 0.28);
  border-left: 3px solid rgba(102, 205, 232, 0.82);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 44%),
    rgba(5, 9, 11, 0.78);
}

.race-story-action-panel strong {
  color: #ffffff;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.race-story-action-panel span {
  color: #aeb8c1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.race-story-preview {
  display: grid;
  gap: 7px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid rgba(102, 205, 232, 0.28);
  border-left: 3px solid rgba(102, 205, 232, 0.8);
  border-radius: 7px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 45%),
    rgba(5, 9, 11, 0.78);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 18px rgba(102, 205, 232, 0.08);
}

.race-story-action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.race-story-action-row button {
  min-height: 54px;
  font-size: clamp(18px, 1.35vw, 26px);
}

.race-story-history-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(102, 205, 232, 0.24);
  border-radius: 7px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(3, 8, 11, 0.78);
}

.race-story-history-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.race-story-history-head strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.race-story-history-head button {
  min-height: 32px;
  padding: 5px 12px;
  font-size: 12px;
}

.race-story-history-list {
  display: grid;
  gap: 6px;
  color: #aeb8c1;
  font-size: 12px;
  font-weight: 900;
}

.race-story-history-item {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
}

.race-story-history-item strong,
.race-story-history-item em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-story-history-item strong {
  color: #ffffff;
  font-size: 13px;
}

.race-story-history-item em {
  color: #7edfff;
  font-size: 11px;
  font-style: normal;
  text-transform: uppercase;
}

.race-story-action-row #sendRaceStory.is-story-ready {
  border-color: rgba(244, 197, 66, 0.82);
  color: #fff6c2;
  background:
    linear-gradient(112deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.1) 34%, rgba(244, 197, 66, 0.22) 62%, rgba(0, 0, 0, 0.18)),
    linear-gradient(180deg, color-mix(in srgb, var(--neon-warn) 34%, #3c3420), rgba(54, 39, 12, 0.88) 54%, rgba(18, 12, 3, 0.94));
  box-shadow:
    inset 3px 0 0 color-mix(in srgb, var(--neon-warn) 52%, transparent),
    0 0 24px color-mix(in srgb, var(--neon-warn) 38%, transparent),
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    inset 0 -8px 16px rgba(0, 0, 0, 0.32);
  animation: race-story-button-ready 1.05s ease-in-out infinite;
}

.race-story-preview.is-good {
  border-color: rgba(133, 210, 78, 0.55);
  border-left-color: #85d24e;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(133, 210, 78, 0.16);
}

.race-story-preview.is-good .race-story-preview-pill:not(:disabled) {
  animation: race-story-ready-pulse 1.2s ease-in-out infinite;
}

.race-story-preview.is-warn {
  border-color: rgba(244, 197, 66, 0.55);
  border-left-color: #f4c542;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(244, 197, 66, 0.14);
}

.race-story-preview.is-warn .race-story-preview-pill:not(:disabled) {
  animation: race-story-warn-pulse 1.45s ease-in-out infinite;
}

.race-story-preview.is-bad {
  border-color: rgba(232, 74, 64, 0.55);
  border-left-color: #e84a40;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.04),
    0 0 18px rgba(232, 74, 64, 0.14);
}

.race-story-preview-head,
.race-story-preview-body,
.race-story-preview-output {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.race-story-preview-head {
  justify-content: space-between;
}

.race-story-preview-link {
  flex: 0 0 auto;
  color: #66cde8;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}

.race-story-preview-link:hover,
.race-story-preview-link:focus-visible {
  color: #ffffff;
  text-decoration: underline;
}

.race-story-preview-head strong,
.race-story-preview-output span {
  color: #ffffff;
  font-size: 13px;
  line-height: 1;
  text-transform: uppercase;
}

.race-story-preview-head span,
.race-story-preview-guidance {
  min-width: 0;
  color: #aeb8c1;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.1;
}

.race-story-preview-pill {
  flex: 0 0 auto;
  min-width: 122px;
  padding: 5px 8px;
  border-radius: 999px;
  border: 0;
  color: #061009;
  background: #aeb8c1;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 1000;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.race-story-preview-pill:disabled {
  cursor: default;
  opacity: 0.78;
}

.race-story-preview.is-good .race-story-preview-pill {
  background: #85d24e;
}

.race-story-preview.is-warn .race-story-preview-pill {
  background: #f4c542;
}

.race-story-preview.is-bad .race-story-preview-pill {
  color: #ffffff;
  background: #e84a40;
}

.race-story-preview-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-width: 0;
  min-height: 148px;
  padding: 18px 20px 16px;
  border: 1px solid rgba(120, 190, 238, 0.18);
  border-left: 4px solid rgba(84, 199, 236, 0.88);
  border-radius: 9px;
  background:
    radial-gradient(circle at 92% 18%, rgba(47, 140, 255, 0.22), transparent 42%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 38%),
    linear-gradient(180deg, rgba(6, 18, 29, 0.96), rgba(2, 7, 12, 0.97));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 16px 30px rgba(0, 0, 0, 0.24);
  overflow: hidden;
}

.race-story-preview-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(118deg, transparent 0 54%, rgba(84, 199, 236, 0.08) 55% 56%, transparent 57%),
    linear-gradient(118deg, transparent 0 68%, rgba(255, 255, 255, 0.06) 69% 70%, transparent 71%);
  pointer-events: none;
}

.race-story-preview-card span,
.race-story-preview-card small {
  min-width: 0;
  color: #54c7ec;
  font-size: 12px;
  font-weight: 1000;
  letter-spacing: 0;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-preview-card strong {
  min-width: 0;
  color: #ffffff;
  font-size: clamp(32px, 2.15vw, 48px);
  line-height: 0.96;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.55);
  text-transform: uppercase;
  white-space: nowrap;
}

.race-story-preview-card em {
  min-width: 0;
  color: #dce8f2;
  font-size: clamp(18px, 1.05vw, 24px);
  font-style: normal;
  font-weight: 900;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.race-story-preview-card small {
  color: #aeb8c1;
  font-size: 11px;
}

.race-story-preview.is-good .race-story-preview-card,
.race-story-preview.is-live .race-story-preview-card {
  border-left-color: #42df56;
}

.race-story-preview.is-good .race-story-preview-card span,
.race-story-preview.is-live .race-story-preview-card span {
  color: #42df56;
}

.race-story-preview.is-warn .race-story-preview-card {
  border-left-color: #f4c542;
}

.race-story-preview.is-warn .race-story-preview-card span {
  color: #f4c542;
}

.race-story-preview.is-bad .race-story-preview-card {
  border-left-color: #e84a40;
}

.race-story-preview.is-bad .race-story-preview-card span {
  color: #ff8c86;
}

@keyframes race-story-ready-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(133, 210, 78, 0);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 18px rgba(133, 210, 78, 0.5);
    filter: brightness(1.15);
  }
}

@keyframes race-story-warn-pulse {
  0%, 100% {
    box-shadow: 0 0 0 rgba(244, 197, 66, 0);
    filter: brightness(1);
  }
  50% {
    box-shadow: 0 0 16px rgba(244, 197, 66, 0.42);
    filter: brightness(1.12);
  }
}

@keyframes race-story-alert-pulse {
  0%, 100% {
    filter: brightness(1);
    transform: translateZ(0);
  }
  50% {
    filter: brightness(1.18);
  }
}

@keyframes race-story-panel-ready {
  0%, 100% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.06),
      0 0 18px rgba(244, 197, 66, 0.18);
  }
  50% {
    box-shadow:
      inset 0 0 0 1px rgba(255, 255, 255, 0.08),
      0 0 32px rgba(244, 197, 66, 0.42);
  }
}

@keyframes race-story-button-ready {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.16);
  }
}

.race-story-preview-output {
  align-items: flex-start;
  padding-top: 5px;
  border-top: 1px solid rgba(255, 255, 255, 0.09);
}

.race-story-preview-output span {
  flex: 0 0 auto;
  color: #aeb8c1;
  font-size: 11px;
}

.race-story-preview-output strong {
  min-width: 0;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.12;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-info-grid button {
  min-height: 38px;
  padding-inline: 14px;
}

.output-info-panel .style-field {
  gap: 2px;
  font-size: 12px;
}

.output-info-panel input {
  min-height: 34px;
  padding-block: 5px;
}

.output-ticker-panel .size-field .number-stepper {
  max-width: 118px;
  grid-template-columns: minmax(0, 78px) 28px;
  gap: 4px;
}

.output-ticker-panel .number-stepper input[type="number"] {
  min-height: 28px;
  padding: 3px 8px;
}

.output-ticker-panel .stepper-buttons button {
  height: 12px;
}

.send-output-box {
  display: grid;
  grid-template-columns: minmax(220px, 260px) minmax(220px, 260px) minmax(340px, 1fr);
  gap: 10px;
  min-width: 0;
  align-self: stretch;
  justify-self: stretch;
  width: 100%;
  padding: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.send-output-box button {
  min-height: 62px;
  padding: 6px 14px;
  font-size: 22px;
  line-height: 0.98;
}

.send-output-box #takeProgram {
  background: var(--accent);
}

.send-output-box #takeProgram.is-good {
  background: var(--blue);
}

.send-output-box #takeProgram.is-warn {
  background: #b58223;
}

.send-output-box #takeProgram.is-bad {
  background: var(--accent);
}

.send-readiness-note {
  grid-column: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  margin: 0;
  min-height: 62px;
  padding: 8px 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  color: #d7e1e8;
  background: rgba(0, 0, 0, 0.22);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.send-readiness-note.is-good {
  color: #caffad;
}

.send-readiness-note.is-warn {
  color: #ffe9a5;
}

.send-readiness-note.is-bad {
  color: #ffd1d1;
}

.vmix-url-box {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  padding: 8px 10px;
  background:
    linear-gradient(110deg, rgba(244, 197, 66, 0.1), transparent 34%),
    rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(244, 197, 66, 0.28);
  border-radius: 8px;
}

.output-url-box {
  grid-area: url;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: none;
  margin-bottom: 0;
  padding: 6px 8px;
}

.vmix-url-box strong {
  display: block;
  color: white;
  font-size: 13px;
  line-height: 1;
}

.vmix-url-box input {
  min-height: 32px;
  margin-bottom: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.vmix-url-box button {
  min-height: 32px;
}

.ipad-qr-open-row {
  grid-area: qrbutton;
  justify-self: start;
  margin-top: 0;
}

.ipad-qr-open-row .qr-mini-button {
  min-height: 32px;
  min-width: 178px;
  padding-inline: 16px;
}

.ipad-qr-panel {
  grid-area: qrpanel;
  justify-self: start;
  width: min(284px, 100%);
  margin-top: 0;
  padding: 8px;
  border: 1px solid rgba(125, 203, 255, 0.46);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(125, 203, 255, 0.13), transparent 42%),
    rgba(0, 0, 0, 0.88);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.06) inset,
    0 18px 34px rgba(0, 0, 0, 0.34),
    0 0 28px rgba(125, 203, 255, 0.18);
}

.ipad-qr-panel[hidden] {
  display: none;
}

.ipad-qr-card {
  display: grid;
  gap: 8px;
}

.ipad-qr-heading,
.ipad-qr-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px;
}

.ipad-qr-heading strong {
  color: #fff;
  font-size: 14px;
  line-height: 1;
  text-transform: uppercase;
}

.ipad-qr-small-button {
  min-height: 28px;
  padding: 0 10px;
  font-size: 13px;
}

.ipad-qr-anchor {
  color: #9fdcff;
  font-size: 12px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.ipad-qr-code {
  display: grid;
  place-items: center;
  width: 154px;
  height: 154px;
  margin: 0 auto;
  padding: 6px;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.ipad-qr-code img,
.ipad-qr-code svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ipad-qr-link-row input {
  min-height: 30px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.ipad-qr-card p {
  margin: 0;
  color: #c4ccd3;
  font-size: 12px;
  line-height: 1.2;
}

button.active {
  background: var(--accent);
}

button.on-program {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.preset-subpanel {
  margin: 0 0 12px;
}

.preset-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
}

.preset-row select {
  margin-bottom: 0;
}

.wide-field {
  grid-column: 1 / -1;
}

.style-field {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.top3-settings-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.top3-settings-grid select {
  margin-bottom: 0;
}

.top3-photo-guidance {
  margin: 0 0 10px;
  padding: 9px 12px;
  border: 1px solid rgba(78, 189, 226, 0.28);
  border-radius: 6px;
  background:
    linear-gradient(135deg, rgba(78, 189, 226, 0.12), transparent 42%),
    rgba(0, 0, 0, 0.2);
  color: #cfd8df;
  font-size: 17px;
  line-height: 1.15;
}

.top3-photo-guidance strong {
  color: #ffffff;
}

.size-field .number-stepper {
  max-width: 112px;
}

.toggle-field,
.checkbox-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.toggle-field {
  margin-top: 8px;
}

.toggle-field input,
.checkbox-grid input {
  width: auto;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 12px;
}

.control-subpanel {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.055), transparent 42%),
    rgba(0, 0, 0, 0.18);
}

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

.top3-driver-control {
  margin-top: 8px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border-color: rgba(255, 255, 255, 0.13);
  background:
    linear-gradient(135deg, rgba(231, 51, 47, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
    rgba(0, 0, 0, 0.2);
}

.top3-driver-control.is-primary {
  border-color: color-mix(in srgb, var(--accent) 42%, rgba(255, 255, 255, 0.13));
  box-shadow: inset 4px 0 0 color-mix(in srgb, var(--accent) 72%, transparent);
}

.top3-driver-control .subpanel-heading {
  margin-bottom: 0;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top3-photo-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.top3-photo-row .style-field {
  min-width: 0;
}

.clear-top3-photo {
  height: 40px;
  white-space: nowrap;
}

.top3-driver-fields {
  display: grid;
  grid-template-columns: minmax(74px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
}

.top3-actions {
  margin-top: 8px;
}

.top3-actions button {
  min-width: 220px;
}

.banner-metric-subpanel {
  margin-top: 10px;
  padding: 8px 10px 10px;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.025);
}

.banner-actions-subpanel {
  margin: 12px 0 14px;
}

.banner-panel .style-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.banner-panel .banner-logo-upload-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
  margin-bottom: 8px;
}

.banner-panel .banner-logo-upload-grid .banner-logo-field {
  grid-column: span 1;
}

.banner-panel .banner-adjustments-grid {
  grid-template-columns: repeat(8, minmax(82px, 1fr));
  align-items: end;
  gap: 8px;
  margin-bottom: 8px;
}

.banner-panel .banner-adjustments-grid .size-field .number-stepper {
  grid-template-columns: minmax(42px, 1fr) 26px;
  max-width: none;
  gap: 4px;
}

.banner-panel .banner-adjustments-grid .size-field input[type="number"] {
  padding: 6px 7px;
}

.banner-panel .banner-colors-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  gap: 8px;
}

.banner-panel .banner-colors-grid .color-field,
.banner-panel .banner-colors-grid .color-apply-actions {
  grid-column: span 1;
}

.banner-panel .banner-colors-grid .color-code-control {
  grid-template-columns: 40px minmax(84px, 1fr);
}

.style-panel .style-grid {
  grid-template-columns: repeat(6, minmax(78px, 1fr));
  gap: 8px;
}

.style-panel .size-field .number-stepper {
  max-width: none;
}

.style-option-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.style-option-row select {
  margin-bottom: 0;
}

.banner-panel .wide-field {
  grid-column: span 2;
}

.banner-control-grid {
  display: grid;
  grid-template-columns:
    minmax(138px, 0.7fr)
    minmax(145px, 0.76fr)
    minmax(145px, 0.76fr)
    minmax(145px, 0.76fr)
    minmax(190px, 1fr)
    minmax(145px, 0.76fr)
    minmax(260px, 1.32fr);
  gap: 8px;
  margin-top: 10px;
  align-items: end;
}

.banner-control-grid .style-field {
  min-width: 0;
}

.banner-control-grid select {
  margin-bottom: 0;
}

.banner-control-grid input {
  margin-bottom: 0;
}

.banner-info-source-field {
  grid-column: auto;
  grid-row: auto;
}

.banner-control-grid .banner-control-toggle {
  grid-column: auto;
  grid-row: auto;
  min-height: 54px;
  margin-top: 0;
  align-self: end;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  white-space: nowrap;
}

.banner-mode-preset-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
}

.banner-mode-preset-row span {
  color: #c8d2dc;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.banner-mode-preset-row button {
  width: auto;
  min-width: 104px;
  margin: 0;
  padding: 8px 12px;
  border-color: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
}

.banner-mode-preset-row button.is-active {
  border-color: rgba(231, 51, 47, 0.92);
  box-shadow: 0 0 0 1px rgba(231, 51, 47, 0.28), 0 0 16px rgba(231, 51, 47, 0.16);
}

.banner-manual-info-field {
  grid-column: auto;
  grid-row: auto;
}

.banner-logo-field {
  grid-column: span 2;
}

.banner-logo-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0 0 10px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-left: 4px solid color-mix(in srgb, var(--accent) 72%, #000 28%);
  border-radius: 8px;
  background:
    linear-gradient(110deg, color-mix(in srgb, var(--accent) 10%, transparent), transparent 34%),
    rgba(0, 0, 0, 0.2);
}

.banner-logo-status div {
  min-width: 0;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
}

.banner-logo-status span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.banner-logo-status strong {
  display: block;
  min-width: 0;
  margin-top: 4px;
  color: white;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.metric-checkbox-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.banner-control-actions {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 0;
}

.banner-control-actions button {
  width: 100%;
  min-height: 88px;
  padding: 8px 14px;
  font-size: clamp(20px, 1.28vw, 28px);
  line-height: 1.05;
}

.subpanel-heading {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.subpanel-heading strong {
  color: white;
  font-size: 18px;
}

.subpanel-heading span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

.metric-checkbox-grid {
  margin-top: 0;
}

.metric-checkbox-grid label {
  min-height: 32px;
  justify-content: center;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.metric-checkbox-grid input {
  display: none;
}

.metric-checkbox-grid label:has(input:checked) {
  border-color: color-mix(in srgb, var(--toggle-on) 68%, rgba(255, 255, 255, 0.12));
  background: color-mix(in srgb, var(--toggle-on) 20%, rgba(255, 255, 255, 0.055));
  color: white;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--toggle-on) 18%, transparent);
}

.subpanel-actions {
  padding-top: 10px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.color-apply-actions {
  grid-column: auto;
  align-self: end;
  justify-content: stretch;
  margin-top: 0;
  padding-top: 0;
}

.color-apply-actions button {
  width: 100%;
  min-height: 42px;
}

.links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.links a {
  color: white;
  background: #1a2730;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 8px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-list {
  display: grid;
  flex: 1 1 auto;
  gap: 6px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.health-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.health-grid div {
  min-width: 0;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
}

.health-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.health-grid strong {
  display: block;
  min-width: 0;
  color: white;
  font-size: 18px;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.correction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.correction-list strong {
  flex-basis: 100%;
  color: white;
  font-size: 15px;
}

.correction-chip {
  padding: 7px 10px;
  border-radius: 6px;
  background: #1a2730;
  border: 1px solid var(--line);
  color: white;
  font-size: 14px;
}
