/* TV Graphics console — light theme with broadcast red accents.
   Keeps the app's 3-column layout (controls | 16:9 program monitor | on-air),
   optimises spacing, and renders the preview at true 1920×1080 scaled down. */

.race-event-panel--tv-graphics {
  --tvc-red: #e10600;
  --tvc-red-hot: #ff2d23;
  --tvc-red-soft: #fdecec;
  --tvc-red-border: #f5b8b5;
}

/* ————— Header ————— */
.race-event-panel--tv-graphics .race-tv-graphics-head__eyebrow {
  color: var(--tvc-red);
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}
.race-event-panel--tv-graphics .race-tv-graphics-head__h1 {
  font-weight: 900;
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .01em;
}
.race-event-panel--tv-graphics .race-tv-graphics-head__h1::after {
  content: "";
  display: inline-block;
  width: 30px;
  height: .62em;
  margin-left: .45rem;
  background: repeating-linear-gradient(-55deg, var(--tvc-red) 0 6px, transparent 6px 11px);
}

/* ————— Tabs: red when active ————— */
.race-event-panel--tv-graphics .race-tv-broadcast-tab:hover {
  border-color: var(--tvc-red-border);
  color: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-broadcast-tab--active {
  border-color: var(--tvc-red);
  color: var(--tvc-red);
  background: var(--tvc-red-soft);
  box-shadow: 0 2px 10px rgba(225, 6, 0, .18);
}
.race-event-panel--tv-graphics .race-tv-broadcast-tab:focus-visible {
  outline: 3px solid rgba(225, 6, 0, .35);
}

/* Custom accent colors (Settings → Producer tabs) */
.race-event-panel--tv-graphics .race-tv-broadcast-tab--custom-color {
  position: relative;
}
.race-event-panel--tv-graphics .race-tv-broadcast-tab--custom-color::after {
  content: "";
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--tv-tab-accent, var(--tvc-red));
  opacity: .95;
}
.race-event-panel--tv-graphics .race-tv-broadcast-tab--custom-color:hover {
  border-color: var(--tv-tab-accent-border, var(--tvc-red-border));
  color: var(--tv-tab-accent, var(--tvc-red));
}
.race-event-panel--tv-graphics .race-tv-broadcast-tab--custom-color.race-tv-broadcast-tab--active {
  border-color: var(--tv-tab-accent, var(--tvc-red));
  color: var(--tv-tab-accent, var(--tvc-red));
  background: var(--tv-tab-accent-soft, var(--tvc-red-soft));
  box-shadow: 0 2px 10px color-mix(in srgb, var(--tv-tab-accent, #e10600) 22%, transparent);
}

/* Settings → Producer tab prefs editor */
.race-tv-tabpref {
  margin-top: 4px;
}
.race-tv-tabpref-hr {
  margin: 14px 0 12px;
  border: 0;
  border-top: 1px solid rgba(0, 0, 0, .08);
}
.race-tv-tabpref-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0 10px;
}
.race-tv-tabpref-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.race-tv-tabpref-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(0, 0, 0, .08);
  border-radius: 8px;
  background: rgba(255, 255, 255, .55);
}
.race-tv-tabpref-vis {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
}
.race-tv-tabpref-vis input {
  margin: 0;
  flex: 0 0 auto;
}
.race-tv-tabpref-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, .2);
  flex: 0 0 auto;
  background: transparent;
}
.race-tv-tabpref-dot.is-empty {
  background: repeating-linear-gradient(-45deg, #ddd 0 2px, #fff 2px 4px) !important;
}
.race-tv-tabpref-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-tv-tabpref-name em {
  font-style: normal;
  font-weight: 500;
  opacity: .55;
  font-size: 11px;
}
.race-tv-tabpref-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  justify-content: flex-end;
  max-width: 168px;
}
.race-tv-tabpref-chip {
  width: 14px;
  height: 14px;
  padding: 0;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, .18);
  background: var(--chip, #ccc);
  cursor: pointer;
}
.race-tv-tabpref-chip--clear {
  background: #fff;
  color: #666;
  font-size: 10px;
  line-height: 12px;
  font-weight: 700;
}
.race-tv-tabpref-picker {
  width: 22px;
  height: 18px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, .2);
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
}

/* ————— Program monitor (center column) ————— */
.race-event-panel--tv-graphics .race-tv-graphics-rail__col--center {
  background: #0f0f13;
  border-color: #2c2c34;
  justify-content: center;
}
.race-event-panel--tv-graphics .race-tv-preview-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  color: #fff;
  letter-spacing: .2em;
}
.race-event-panel--tv-graphics .race-tv-preview-label::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tvc-red-hot);
  animation: tvcOnAir 1.4s ease-out infinite;
}
.race-event-panel--tv-graphics .race-tv-preview-label::after {
  content: "16:9";
  font-size: .56rem;
  letter-spacing: .1em;
  color: #0f0f13;
  background: #fff;
  padding: .08rem .38rem;
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
}
@keyframes tvcOnAir {
  0% { box-shadow: 0 0 0 0 rgba(255, 45, 35, .7); }
  70% { box-shadow: 0 0 0 7px rgba(255, 45, 35, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 45, 35, 0); }
}

/* Strict 16:9 monitor that fills the column width */
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit {
  flex: 0 0 auto;
  aspect-ratio: 16 / 9;
  width: min(100%, calc((100vh - 300px) * 16 / 9));
  min-height: 0;
  align-self: center;
  border: 1px solid #34343d;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 18px 44px rgba(0, 0, 0, .5), inset 0 0 0 1px rgba(255, 255, 255, .03);
  background: repeating-linear-gradient(45deg, #101014, #101014 10px, #15151a 10px 20px);
}
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit::before,
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, .4);
  pointer-events: none;
  z-index: 2;
}
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit::before {
  top: 5px; left: 5px; border-right: 0; border-bottom: 0;
}
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit::after {
  bottom: 5px; right: 5px; border-left: 0; border-top: 0;
}
/* Overlay renders at real 1920×1080; race.html scales it to fit (--tvp-scale) */
.race-event-panel--tv-graphics .race-tv-graphics-preview-frame--fit .race-tv-graphics-preview-iframe {
  width: 1920px;
  height: 1080px;
  transform: scale(var(--tvp-scale, 0.35));
  transform-origin: top left;
}

/* ————— Section titles get the red rail ————— */
.race-event-panel--tv-graphics .race-tv-rail-title {
  font-style: italic;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding-left: .5rem;
  border-left: 3px solid var(--tvc-red);
}

/* ————— Buttons: red primary ————— */
.race-event-panel--tv-graphics .btn--primary {
  background: var(--tvc-red);
  border-color: var(--tvc-red);
  transition: background .15s, box-shadow .15s, transform .12s;
}
.race-event-panel--tv-graphics .btn--primary:hover {
  background: var(--tvc-red-hot);
  border-color: var(--tvc-red-hot);
  box-shadow: 0 4px 16px rgba(225, 6, 0, .3);
  transform: translateY(-1px);
}

/* ————— Inputs: red focus ring ————— */
.race-event-panel--tv-graphics .race-tv-tab-panel input:focus,
.race-event-panel--tv-graphics .race-tv-tab-panel select:focus,
.race-event-panel--tv-graphics .race-tv-tab-panel textarea:focus {
  border-color: var(--tvc-red) !important;
  box-shadow: 0 0 0 3px rgba(225, 6, 0, .16) !important;
  outline: none;
}

/* ————— On-air column ————— */
.race-event-panel--tv-graphics #race-tv-onair-h::after {
  content: "ON AIR";
  margin-left: .5rem;
  font-size: .56rem;
  font-weight: 900;
  letter-spacing: .16em;
  color: #fff;
  background: var(--tvc-red);
  padding: .13rem .45rem;
  clip-path: polygon(3px 0, 100% 0, calc(100% - 3px) 100%, 0 100%);
  vertical-align: middle;
  animation: tvcBlink 2.4s ease-in-out infinite;
}
@keyframes tvcBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* Toggles glow red when the graphic is live */
.race-event-panel--tv-graphics .race-tv-toggle:hover .race-tv-toggle__card {
  border-color: var(--tvc-red-border);
}
.race-event-panel--tv-graphics .race-tv-toggle__input:checked + .race-tv-toggle__card {
  border-color: var(--tvc-red);
  background: var(--tvc-red-soft);
  box-shadow: 0 2px 12px rgba(225, 6, 0, .16);
}
.race-event-panel--tv-graphics .race-tv-toggle__input:checked + .race-tv-toggle__card .race-tv-toggle__switch {
  background: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-toggle:focus-within .race-tv-toggle__card {
  outline: 3px solid rgba(225, 6, 0, .3);
}

/* TV left/right rails: force scroll when tab content is taller than the column.
   flex-basis:auto (from the main bundle) grows with content and clips without scrolling. */
.race-event-panel--tv-graphics .race-tv-graphics-rail {
  min-height: 0;
}
.race-event-panel--tv-graphics .race-tv-graphics-rail__col--left,
.race-event-panel--tv-graphics .race-tv-graphics-rail__col--right {
  min-height: 0;
  overflow: hidden;
}
.race-event-panel--tv-graphics .race-tv-tab-panel {
  flex: 1 1 0 !important;
  min-height: 0 !important;
  max-height: 100%;
  overflow-x: hidden;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.25rem;
}
.race-event-panel--tv-graphics #race-tv-overlay-sidebar {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1.25rem;
}

/* The hidden attribute must always win — several boxes here use display:flex/grid,
   which otherwise overrides it and leaves broken empty boxes on screen. */
.race-event-panel--tv-graphics [hidden] { display: none !important; }

/* ————— Live quiz tab ————— */
.race-event-panel--tv-graphics .race-tv-quiz-session,
.race-event-panel--tv-graphics .race-tv-quiz-timing,
.race-event-panel--tv-graphics .race-tv-quiz-live,
.race-event-panel--tv-graphics .race-tv-quiz-q {
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 10px;
  padding: 10px;
  margin: 10px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.race-event-panel--tv-graphics .race-tv-quiz-live {
  border-color: var(--tvc-red-border);
  background: var(--tvc-red-soft);
}
.race-event-panel--tv-graphics .race-tv-quiz-session__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.race-event-panel--tv-graphics .race-tv-quiz-code {
  font-weight: 900;
  font-size: 1.35rem;
  letter-spacing: .18em;
  color: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-quiz-session__meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-size: .78rem;
  color: #5b6472;
}
.race-event-panel--tv-graphics .race-tv-quiz-qr {
  display: flex;
  justify-content: center;
  padding: 8px;
  background: #fff;
  border-radius: 8px;
}
.race-event-panel--tv-graphics .race-tv-quiz-qr img {
  width: 200px;
  height: 200px;
}
.race-event-panel--tv-graphics .race-tv-quiz-live__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.race-event-panel--tv-graphics .race-tv-quiz-live__clock {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-quiz-q__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.race-event-panel--tv-graphics .race-tv-quiz-q__num {
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .1em;
  color: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-quiz-q__del {
  border: 0;
  background: none;
  font-size: 1.15rem;
  line-height: 1;
  color: #8b939f;
  cursor: pointer;
  padding: 2px 6px;
}
.race-event-panel--tv-graphics .race-tv-quiz-q__del:hover { color: var(--tvc-red); }
.race-event-panel--tv-graphics .race-tv-quiz-q__opts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.race-event-panel--tv-graphics .race-tv-quiz-q__opt {
  display: flex;
  align-items: center;
  gap: 8px;
}
.race-event-panel--tv-graphics .race-tv-quiz-q__opt input[type="radio"] { flex: none; }
.race-event-panel--tv-graphics .race-tv-quiz-q__opt input[type="text"] { flex: 1; min-width: 0; }
.race-event-panel--tv-graphics .race-tv-quiz-board {
  list-style: none;
  margin: 6px 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 7px;
  background: rgba(0, 0, 0, .04);
  font-size: .86rem;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__rank {
  flex: none;
  width: 1.6rem;
  font-weight: 800;
  color: var(--tvc-red);
}
.race-event-panel--tv-graphics .race-tv-quiz-board__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__score {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__empty {
  opacity: .7;
  padding: 8px 0;
}
.race-event-panel--tv-graphics .race-tv-quiz-q--asked {
  border-color: rgba(225, 6, 0, .35);
  background: rgba(225, 6, 0, .05);
}
.race-event-panel--tv-graphics .race-tv-quiz-q__asked {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .12em;
  color: #fff;
  background: var(--tvc-red);
  padding: 2px 6px;
  border-radius: 3px;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__row {
  display: grid;
  grid-template-columns: 28px 24px 1fr auto auto;
  gap: 6px;
  align-items: center;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__avatar {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__actions {
  display: flex;
  gap: 4px;
}
.race-event-panel--tv-graphics .race-tv-quiz-design {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.5);
}
.race-event-panel--tv-graphics .race-tv-quiz-details {
  margin: 10px 0 12px;
}
.race-event-panel--tv-graphics .race-tv-quiz-details__sum {
  cursor: pointer;
  user-select: none;
  padding: 9px 12px;
  border: 1px solid rgba(0,0,0,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.65);
  font-weight: 800;
  font-size: 13px;
}
.race-event-panel--tv-graphics .race-tv-quiz-details__sum:hover { background: rgba(255,255,255,.9); }
.race-event-panel--tv-graphics .race-tv-quiz-details[open] .race-tv-quiz-details__sum {
  border-radius: 8px 8px 0 0;
  margin-bottom: 0;
}
.race-event-panel--tv-graphics .race-tv-quiz-details[open] .race-tv-quiz-design {
  margin-top: 0;
  border-radius: 0 0 8px 8px;
  border-top: 0;
}
.race-event-panel--tv-graphics .race-tv-quiz-details__hint {
  font-weight: 600;
  font-size: 11px;
  color: #8b939f;
  margin-left: 6px;
}
.race-event-panel--tv-graphics .race-tv-quiz-auto {
  display: grid;
  gap: 8px;
  margin: 10px 0 12px;
  padding: 10px;
  border: 1px solid rgba(225, 6, 0, .2);
  border-radius: 8px;
  background: rgba(225, 6, 0, .04);
}

/* ————— Survey / poll producer ————— */
.race-event-panel--tv-graphics .race-tv-sv-letter {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: #2f7ce0;
}
.race-event-panel--tv-graphics .race-tv-sv-live-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 8px 0 10px;
}
.race-event-panel--tv-graphics .race-tv-sv-barrow {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.4fr) auto;
  gap: 8px;
  align-items: center;
}
.race-event-panel--tv-graphics .race-tv-sv-barrow__lab {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-event-panel--tv-graphics .race-tv-sv-barrow__track {
  height: 8px;
  border-radius: 999px;
  background: rgba(0,0,0,.1);
  overflow: hidden;
}
.race-event-panel--tv-graphics .race-tv-sv-barrow__fill {
  display: block;
  height: 100%;
  width: 0;
  background: #2f7ce0;
  border-radius: inherit;
  transition: width .4s ease;
}
.race-event-panel--tv-graphics .race-tv-sv-barrow__num {
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #4b5563;
  white-space: nowrap;
}

/* ————— Criterium producer ————— */
.race-event-panel--tv-graphics .race-tv-crit-hud {
  text-align: center;
  padding: 14px 10px;
  margin: 8px 0 10px;
  background: #0b1220;
  border-radius: 10px;
  border-top: 4px solid #c8ff00;
}
.race-event-panel--tv-graphics .race-tv-crit-hud__count {
  font-size: 64px;
  font-weight: 900;
  font-style: italic;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: #c8ff00;
}
.race-event-panel--tv-graphics .race-tv-crit-hud__sub {
  margin-top: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #9aa3ad;
}
.race-event-panel--tv-graphics .race-tv-crit-hud__mode {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #8EC7ED;
}
.race-event-panel--tv-graphics .race-tv-crit-pad {
  display: flex;
  gap: 6px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.race-event-panel--tv-graphics .race-tv-crit-map {
  display: block;
  width: 100%;
  max-width: 320px;
  height: auto;
  margin: 6px 0;
  border-radius: 8px;
  cursor: crosshair;
  border: 1px solid rgba(255,255,255,.1);
}
.race-event-panel--tv-graphics .race-tv-crit-mapbox {
  width: 100%;
  height: 240px;
  margin: 6px 0 10px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.12);
  background: #0b1220;
}
.race-event-panel--tv-graphics .race-tv-crit-pin {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ff2d23;
  border: 2px solid #0b0b0d;
  box-shadow: 0 0 0 4px rgba(255,45,35,.35);
}
.race-event-panel--tv-graphics .race-tv-crit-tracker {
  padding: 2px 6px;
  border-radius: 4px;
  background: #e10600;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
.race-event-panel--tv-graphics .race-tv-crit-trackers {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0 10px;
  max-height: 280px;
  overflow: auto;
}
.race-event-panel--tv-graphics .race-tv-crit-trow {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0,0,0,.2);
  border: 1px solid rgba(255,255,255,.08);
}
.race-event-panel--tv-graphics .race-tv-crit-trow.is-inside {
  border-color: rgba(255,45,35,.55);
  background: rgba(225,6,0,.12);
}
.race-event-panel--tv-graphics .race-tv-crit-trow__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.race-event-panel--tv-graphics .race-tv-crit-trow__who strong {
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-event-panel--tv-graphics .race-tv-crit-trow__who span {
  font-size: 11px;
  color: #9aa3ad;
}
.race-event-panel--tv-graphics .race-tv-crit-trow__count {
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: center;
  line-height: 1;
}
.race-event-panel--tv-graphics .race-tv-crit-trow__count span {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: #9aa3ad;
  margin-top: 2px;
}
.race-event-panel--tv-graphics .race-tv-crit-trow__actions {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.race-event-panel--tv-graphics .race-tv-crit-history {
  margin: 6px 0 0;
  padding-left: 18px;
  font-size: 12px;
  color: #6b7280;
  max-height: 110px;
  overflow: auto;
}

/* ————— Winner board editor ————— */
.race-event-panel--tv-graphics .race-tv-wb-results {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 50;
  max-height: 260px;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(0,0,0,.15);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(0,0,0,.25);
}
.race-event-panel--tv-graphics .race-tv-wb-hit {
  display: grid;
  grid-template-columns: 74px 1fr;
  gap: 2px 8px;
  align-items: center;
  width: 100%;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  background: none;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.race-event-panel--tv-graphics .race-tv-wb-hit:hover { background: rgba(47,124,224,.08); }
.race-event-panel--tv-graphics .race-tv-wb-hit__src {
  grid-row: 1 / 3;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
  padding: 3px 4px;
  border-radius: 4px;
  color: #fff;
  background: #2f7ce0;
}
.race-event-panel--tv-graphics .race-tv-wb-hit__src:empty { background: none; }
.race-event-panel--tv-graphics .race-tv-wb-hit__bib {
  font-weight: 800;
  font-size: .82rem;
  min-width: 2.2rem;
  color: #4ade80;
}
.race-event-panel--tv-graphics .race-tv-wb-hit__name { font-weight: 700; font-size: .88rem; }
.race-event-panel--tv-graphics .race-tv-wb-hit__team { font-size: .74rem; color: #6b7280; }
.race-event-panel--tv-graphics .race-tv-wb-hit--empty {
  pointer-events: none;
  opacity: 0.8;
  font-size: 0.82rem;
  font-weight: 600;
}
.race-event-panel--tv-graphics .race-tv-wb-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}
.race-event-panel--tv-graphics .race-tv-wb-row {
  display: grid;
  grid-template-columns: 24px 1fr 110px 70px 24px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 8px;
  background: rgba(255,255,255,.5);
}
.race-event-panel--tv-graphics .race-tv-wb-row__rank {
  font-weight: 900;
  font-style: italic;
  color: var(--tvc-red);
  text-align: center;
}
.race-event-panel--tv-graphics .race-tv-wb-row__who {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.race-event-panel--tv-graphics .race-tv-wb-row__who strong {
  font-size: .85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-event-panel--tv-graphics .race-tv-wb-row__who small {
  font-size: .7rem;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.race-event-panel--tv-graphics .race-tv-wb-row__disp {
  font-size: .8rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: #16691f;
}
.race-event-panel--tv-graphics .race-tv-wb-row__del {
  border: 0;
  background: none;
  font-size: 1.05rem;
  line-height: 1;
  color: #8b939f;
  cursor: pointer;
}
.race-event-panel--tv-graphics .race-tv-wb-row__del:hover { color: var(--tvc-red); }

.race-event-panel--tv-graphics .race-tv-left-brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
}
.race-event-panel--tv-graphics .race-tv-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.race-event-panel--tv-graphics .race-tv-custom-logo-preview-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 2px;
  min-height: 0;
}
.race-event-panel--tv-graphics .race-tv-custom-logo-preview {
  display: block;
  max-width: 120px;
  max-height: 64px;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #111;
  padding: 6px;
  border: 1px solid rgba(0,0,0,.08);
}
.race-event-panel--tv-graphics .race-tv-custom-logo-preview[hidden] {
  display: none !important;
}
.race-event-panel--tv-graphics .race-tv-toggle--nested {
  margin-top: 4px;
  clear: both;
}
.race-event-panel--tv-graphics .race-tv-toggle--nested .race-tv-toggle__card {
  position: relative;
  z-index: 1;
}
.race-event-panel--tv-graphics .race-tv-quiz-board__empty {
  font-size: .84rem;
  color: #7a828e;
}
.race-event-panel--tv-graphics .race-tv-rail-title--sub {
  font-size: .95rem;
  margin-top: 14px;
}
/*norTvKmTriggersV3 — stacked row (label full-width, actions below) */
.race-event-panel--tv-graphics .race-tv-trig-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(42vh, 360px);
  min-height: 72px;
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0 0 14px;
  padding: 8px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 10px;
  background: rgba(255,255,255,.72);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  isolation: isolate;
  width: 100%;
  box-sizing: border-box;
}
.race-event-panel--tv-graphics #race-tv-tab-panel-triggers {
  display: flex;
  flex-direction: column;
}
.race-event-panel--tv-graphics #race-tv-tab-panel-triggers[hidden] {
  display: none !important;
}
.race-event-panel--tv-graphics .race-tv-trig-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 8px;
  background: #fff;
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
}
.race-event-panel--tv-graphics .race-tv-trig-row.is-editing {
  border-color: rgba(225, 6, 0, .55);
  box-shadow: 0 0 0 2px rgba(225, 6, 0, .18);
}
.race-event-panel--tv-graphics .race-tv-trig-row.is-off {
  opacity: .55;
}
.race-event-panel--tv-graphics .race-tv-trig-row__main {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.race-event-panel--tv-graphics .race-tv-trig-row__live {
  display: inline-block;
  align-self: flex-start;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .08em;
  color: #fff;
  background: #16a34a;
  padding: 2px 6px;
  border-radius: 3px;
  line-height: 1.2;
}
.race-event-panel--tv-graphics .race-tv-trig-row__main strong {
  display: block;
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: normal;
}
.race-event-panel--tv-graphics .race-tv-trig-row__main .race-tv-rail-muted {
  display: block;
  line-height: 1.4;
  white-space: normal;
  overflow-wrap: anywhere;
}
.race-event-panel--tv-graphics .race-tv-trig-row__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
  width: 100%;
  min-width: 0;
}
.race-event-panel--tv-graphics .race-tv-trig-row__actions .btn {
  flex: 0 0 auto;
  min-width: 0;
  padding: .35rem .65rem;
}
.race-event-panel--tv-graphics .race-tv-trig-row__actions .btn[data-trig-act="show"] {
  background: var(--tvc-red, #e10600);
  color: #fff;
  border-color: var(--tvc-red, #e10600);
  font-weight: 700;
}
.race-event-panel--tv-graphics .race-tv-trig-row__actions .btn[data-trig-act="show"]:hover {
  background: var(--tvc-red-hot, #ff2d23);
  border-color: var(--tvc-red-hot, #ff2d23);
}
.race-event-panel--tv-graphics .race-tv-trig-row.is-onair {
  border-color: rgba(34, 197, 94, .55);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, .18);
}
.race-event-panel--tv-graphics .race-tv-trig-edit {
  position: relative;
  z-index: 1;
  margin-top: 4px;
  padding: 12px 12px 8px;
  border: 1px solid rgba(0,0,0,.1);
  border-radius: 10px;
  background: rgba(248,248,250,.95);
}
.race-event-panel--tv-graphics .race-tv-trig-media-preview {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 8px;
}
.race-event-panel--tv-graphics .race-tv-trig-media-preview img {
  max-width: 72px;
  max-height: 48px;
  object-fit: contain;
  border-radius: 6px;
  background: #111;
  padding: 4px;
  border: 1px solid rgba(0,0,0,.08);
}
.race-event-panel--tv-graphics .race-tv-trig-media-preview img[hidden] {
  display: none !important;
}
.race-event-panel--tv-graphics .race-tv-trig-strava-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
}
@media (max-width: 1100px) {
  .race-event-panel--tv-graphics .race-tv-trig-strava-grid {
    grid-template-columns: 1fr;
  }
}

/* Map pick mode for climb/segment start–end */
.nor-tv-seg-pick-banner {
  position: fixed;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10050;
  pointer-events: none;
}
.nor-tv-seg-pick-banner[hidden] { display: none !important; }
.nor-tv-seg-pick-banner__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(17, 17, 17, .92);
  color: #fff;
  border: 2px solid #e10600;
  box-shadow: 0 10px 30px rgba(0,0,0,.35);
  font-weight: 700;
  font-size: 14px;
  max-width: min(640px, 92vw);
}
.nor-tv-seg-pick-banner__text { flex: 1; min-width: 0; }
body.nor-tv-seg-picking { cursor: crosshair; }
#race-tv-trig-profile-status[data-ok="1"] {
  color: #15803d;
  font-weight: 700;
}

/* File inputs: absolute overlay ONLY inside Upload buttons.
   Bare .race-tv-file-input elsewhere must stay in normal flow — otherwise
   (with .race-tv-trig-edit { position:relative }) they cover the whole form
   and every click opens the OS file picker (Strava URL paste broken). */
.race-event-panel--tv-graphics .race-tv-file-input {
  position: static !important;
  inset: auto !important;
  opacity: 1 !important;
  width: auto !important;
  height: auto !important;
  max-width: 100%;
}
.race-event-panel--tv-graphics .race-tv-file-hit {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.race-event-panel--tv-graphics .race-tv-file-hit .race-tv-file-input {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  width: 100% !important;
  height: 100% !important;
  cursor: pointer;
  font-size: 0;
}

.race-event-panel--tv-graphics .race-tv-trig-layout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin-top: 6px;
}
@media (max-width: 1100px) {
  .race-event-panel--tv-graphics .race-tv-trig-layout-grid {
    grid-template-columns: 1fr;
  }
}

/* ── Startlist → FirstCycling link popup ── */
.race-tv-fc-link-dialog {
  border: none;
  padding: 0;
  margin: auto;
  max-width: none;
  max-height: none;
  width: min(960px, calc(100vw - 2rem));
  background: transparent;
  color: inherit;
}
.race-tv-fc-link-dialog::backdrop {
  background: rgba(6, 10, 18, 0.72);
  backdrop-filter: blur(4px);
}
.race-tv-fc-link-dialog__panel {
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 820px);
  padding: 1.1rem 1.25rem 1rem;
  border-radius: 14px;
  background: #121826;
  color: #e8eef7;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
.race-tv-fc-link-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.35rem;
}
.race-tv-fc-link-dialog__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.race-tv-fc-link-dialog__sub {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(232, 238, 247, 0.72);
}
.race-tv-fc-link-dialog__actions {
  display: flex;
  gap: 0.45rem;
  flex-shrink: 0;
}
.race-tv-fc-link-dialog__toolbar {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}
.race-tv-fc-link-dialog__list {
  flex: 1 1 auto;
  min-height: 280px;
  max-height: none;
  overflow: auto;
  padding-right: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.22);
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__row {
  padding: 10px 12px;
  margin: 0;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__row--linked {
  background: rgba(34, 197, 94, 0.12);
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__photo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  object-position: top;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__bib {
  min-width: 2.6rem;
  font-size: 0.95rem;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__row--linked .race-tv-fc-unmatched__bib {
  color: #4ade80;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__name {
  font-weight: 700;
  font-size: 0.95rem;
  flex: 1 1 10rem;
  min-width: 8rem;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__team {
  opacity: 0.65;
  font-size: 0.82rem;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__ok {
  color: #4ade80;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__need {
  opacity: 0.7;
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 600;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__fc {
  font-size: 0.8rem;
  color: #86efac;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__manual {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__manual input {
  flex: 1;
  font-size: 0.88rem;
}
.race-tv-fc-link-dialog__list .race-tv-fc-unmatched__cands {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
@media (max-width: 700px) {
  .race-tv-fc-link-dialog {
    width: calc(100vw - 1rem);
  }
  .race-tv-fc-link-dialog__head {
    flex-direction: column;
  }
}

/* Live map: background renderer preview (producer PC → vMix link) */
.race-tv-livemap-render-wrap {
  position: relative;
  margin-top: 10px;
  width: 100%;
  max-width: 480px;
  aspect-ratio: 16 / 9;
  min-height: 200px;
  border-radius: 10px;
  overflow: hidden;
  background: #0b1020;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.race-tv-livemap-render-frame {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #0b1020;
}
.race-tv-livemap-render-badge {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(8, 10, 18, 0.88);
  color: #fbbf24;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  pointer-events: none;
  text-align: center;
}
