/* OddsDrops Trav Live – Race Theater */
:root {
  --tv-bg: #070b14;
  --tv-panel: #0f172a;
  --tv-panel2: #111827;
  --tv-border: #1e293b;
  --tv-text: #e2e8f0;
  --tv-muted: #94a3b8;
  --tv-dim: #64748b;
  --tv-amber: #fbbf24;
  --tv-emerald: #34d399;
  --tv-rose: #fb7185;
  --tv-sky: #38bdf8;
  --tv-violet: #a78bfa;
  --tv-orange: #fb923c;
  --tv-radius: 16px;
  --tv-radius-sm: 10px;
}

* { box-sizing: border-box; }

/* Trav-only: fast fullskärmsbakgrund horses.jpg */
html:has(body.atg-trav-body),
html:has(body[data-page="atg-trav"]),
html:has(body[data-page="trav"]),
html:has(body[data-page="trav-live"]) {
  background-color: #070b14 !important;
}

body.atg-trav-body,
body[data-page="atg-trav"],
body[data-page="trav"],
body[data-page="trav-live"] {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--tv-text);
  min-height: 100vh !important;
  background: linear-gradient(rgba(7, 11, 20, 0.42), rgba(7, 11, 20, 0.58)),
              url('/images/horses.jpg') center center / cover no-repeat !important;
  background-attachment: fixed !important;
  background-color: #070b14 !important;
}

/* Dölj global body::before (image3) på trav */
body.atg-trav-body::before,
body[data-page="atg-trav"]::before,
body[data-page="trav"]::before,
body[data-page="trav-live"]::before {
  display: none !important;
  content: none !important;
  background: none !important;
  opacity: 0 !important;
}

/* iOS: fixed bakgrund funkar sämre – använd scroll cover */
@supports (-webkit-touch-callout: none) {
  body.atg-trav-body,
  body[data-page="atg-trav"],
  body[data-page="trav"],
  body[data-page="trav-live"] {
    background-attachment: scroll !important;
  }
}

.atg-trav {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 16px 48px;
  position: relative;
  z-index: 1;
  background: transparent;
}

/* Top bar */
.tv-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.tv-top .tv-brand {
  flex: 1 1 160px;
  min-width: 140px;
}
.tv-top .tv-hero-banner {
  margin: 0;
  order: 0;
}
@media (max-width: 700px) {
  .tv-top {
    justify-content: center;
    text-align: center;
  }
  .tv-top .tv-brand {
    flex: 1 1 100%;
    order: 1;
  }
  .tv-top .tv-hero-banner {
    order: 0;
  }
  .tv-top > div:last-child {
    flex: 1 1 100%;
    align-items: center !important;
    order: 2;
  }
}
.tv-brand h1 {
  margin: 0;
  font-size: 1.45rem;
  font-weight: 850;
  letter-spacing: -0.03em;
}
.tv-brand p {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--tv-muted);
}

/* Hero-bild – kvadratisk, liten, centrerad (ej stretchad banner) */
.tv-hero-banner {
  position: relative;
  width: min(200px, 42vw);
  aspect-ratio: 1 / 1;
  margin: 0 auto 16px;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(51, 65, 85, 0.7);
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  background: #0b1220;
  flex-shrink: 0;
}
.tv-hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    transparent 55%,
    rgba(7, 11, 20, 0.35) 100%
  );
  border-radius: inherit;
}
.tv-hero-banner .tv-hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
  display: block;
}
.tv-hero-banner .tv-hero-slide.active {
  opacity: 1;
  z-index: 1;
}
@media (max-width: 700px) {
  .tv-hero-banner {
    width: min(148px, 38vw);
    margin-bottom: 12px;
    border-radius: 14px;
  }
}
/* ---------- Rullande ticker (vinnare + pooler) ---------- */
/* Primär stil ligger även inline i atg-trav.php (cache-säker) */
#atg-trav-root .tv-ticker,
.at-trav .tv-ticker {
  position: relative;
  margin: 0 0 14px;
  border-radius: 14px;
  border: 1px solid rgba(51, 65, 85, 0.75);
  background: linear-gradient(90deg, rgba(6, 78, 59, 0.25), rgba(15, 23, 42, 0.95) 18%, rgba(15, 23, 42, 0.95) 82%, rgba(120, 53, 15, 0.22));
  overflow: hidden;
  min-height: 44px;
  max-height: 48px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28);
}
#atg-trav-root .tv-ticker-viewport,
.at-trav .tv-ticker-viewport {
  overflow: hidden;
  width: 100%;
  height: 44px;
}
#atg-trav-root .tv-ticker-track,
.at-trav .tv-ticker-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  width: max-content;
  max-width: none;
  white-space: nowrap;
  animation: tv-ticker-scroll 55s linear infinite;
  padding: 10px 0;
  margin: 0;
  will-change: transform;
}
#atg-trav-root .tv-ticker:hover .tv-ticker-track,
.at-trav .tv-ticker:hover .tv-ticker-track {
  animation-play-state: paused;
}
@keyframes tv-ticker-scroll {
  0% { transform: translate3d(0, 0, 0); }
  100% { transform: translate3d(-50%, 0, 0); }
}
#atg-trav-root .tv-ticker-item,
.at-trav .tv-ticker-item {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  font-size: 12.5px;
  font-weight: 650;
  color: #e2e8f0;
  white-space: nowrap;
  border-right: 1px solid rgba(51, 65, 85, 0.55);
  letter-spacing: 0.01em;
  line-height: 1.2;
}
#atg-trav-root .tv-ticker-item .tv-ticker-dot,
.at-trav .tv-ticker-item .tv-ticker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #64748b;
  box-shadow: 0 0 8px currentColor;
}
#atg-trav-root .tv-ticker-item.tone-emerald,
.at-trav .tv-ticker-item.tone-emerald { color: #a7f3d0; }
#atg-trav-root .tv-ticker-item.tone-emerald .tv-ticker-dot,
.at-trav .tv-ticker-item.tone-emerald .tv-ticker-dot { background: #34d399; color: #34d399; }
#atg-trav-root .tv-ticker-item.tone-gold,
.at-trav .tv-ticker-item.tone-gold { color: #fde68a; }
#atg-trav-root .tv-ticker-item.tone-gold .tv-ticker-dot,
.at-trav .tv-ticker-item.tone-gold .tv-ticker-dot { background: #fbbf24; color: #fbbf24; }
#atg-trav-root .tv-ticker-item.tone-amber,
.at-trav .tv-ticker-item.tone-amber { color: #fcd34d; }
#atg-trav-root .tv-ticker-item.tone-violet,
.at-trav .tv-ticker-item.tone-violet { color: #ddd6fe; }
#atg-trav-root .tv-ticker-item.tone-sky,
.at-trav .tv-ticker-item.tone-sky { color: #bae6fd; }
#atg-trav-root .tv-ticker-item.tone-slate,
.at-trav .tv-ticker-item.tone-slate { color: #cbd5e1; }
#atg-trav-root .tv-ticker-fade,
.at-trav .tv-ticker-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 36px;
  z-index: 2;
  pointer-events: none;
}
#atg-trav-root .tv-ticker-fade-l,
.at-trav .tv-ticker-fade-l {
  left: 0;
  background: linear-gradient(90deg, rgba(7, 11, 20, 0.95), transparent);
}
#atg-trav-root .tv-ticker-fade-r,
.at-trav .tv-ticker-fade-r {
  right: 0;
  background: linear-gradient(270deg, rgba(7, 11, 20, 0.95), transparent);
}
@media (max-width: 700px) {
  #atg-trav-root .tv-ticker-item,
  .atg-trav .tv-ticker-item { font-size: 11.5px; padding: 0 14px; }
  #atg-trav-root .tv-ticker-track,
  .atg-trav .tv-ticker-track { animation-duration: 42s; }
}
@media (prefers-reduced-motion: reduce) {
  #atg-trav-root .tv-ticker-track,
  .atg-trav .tv-ticker-track { animation: none; }
}

.tv-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(52, 211, 153, 0.15);
  color: var(--tv-emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
  vertical-align: middle;
}

.tv-dates {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tv-dates button {
  border: 1px solid var(--tv-border);
  background: var(--tv-panel);
  color: var(--tv-text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.tv-dates button:hover { border-color: #475569; }
.tv-dates button.active {
  background: linear-gradient(135deg, #10b981, #0d9488);
  color: #052e16;
  border-color: transparent;
}

/* Hero next race */
.tv-hero {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.1fr;
  gap: 12px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .tv-hero { grid-template-columns: 1fr; }
}
.tv-card {
  background: linear-gradient(160deg, rgba(30,41,59,.9), rgba(15,23,42,.95));
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius);
  padding: 14px 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.tv-card h2 {
  margin: 0 0 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--tv-dim);
  font-weight: 800;
}
.tv-hero-title {
  font-size: 1.25rem;
  font-weight: 850;
  margin: 0 0 4px;
}
.tv-hero-meta { color: var(--tv-muted); font-size: 13px; }
.tv-facit-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 4px;
}
.tv-facit-stats .k {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--tv-dim);
  font-weight: 700;
}
.tv-facit-stats .v {
  font-size: 1.15rem;
  font-weight: 850;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.tv-facit-recent {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 140px;
  overflow: auto;
}
.tv-facit-row {
  font-size: 12px;
  color: var(--tv-muted);
  line-height: 1.35;
}
.tv-facit-row .hit {
  display: inline-flex;
  width: 16px;
  height: 16px;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 900;
  margin-right: 4px;
}
.tv-facit-row .hit.ok { background: rgba(52,211,153,.2); color: #34d399; }
.tv-facit-row .hit.no { background: rgba(251,113,133,.15); color: #fb7185; }
@media (max-width: 800px) {
  .tv-facit-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tv-countdown {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  font-size: 1.6rem;
  font-weight: 850;
  color: var(--tv-amber);
  letter-spacing: 0.04em;
  min-width: 6.5ch;
  transition: color 0.25s ease;
}
.tv-countdown.soon { color: #fbbf24; }
.tv-countdown.urgent { color: #fb923c; }
.tv-countdown.imminent {
  color: #fb7185;
  animation: tv-cd-pulse 1s ease-in-out infinite;
}
.tv-countdown.started { color: #94a3b8; }
.tv-countdown-race {
  margin-top: 2px;
  font-size: 1.55rem;
  line-height: 1.15;
}
.tv-race-clock-col {
  text-align: right;
  min-width: 7.5rem;
  flex-shrink: 0;
}
.tv-countdown-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--tv-dim, #64748b);
  margin-bottom: 2px;
}
.tv-race-live-clock {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  color: #94a3b8;
  letter-spacing: 0.03em;
}
@keyframes tv-cd-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.82; transform: scale(1.03); }
}
.tv-pool-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.tv-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  border: 1px solid rgba(251,191,36,.3);
  background: rgba(251,191,36,.08);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  color: inherit;
  text-decoration: none;
}
.tv-chip:hover { border-color: rgba(251,191,36,.55); }
.tv-chip strong { color: var(--tv-amber); font-weight: 800; }
.tv-chip span.hint { color: var(--tv-dim); font-size: 10px; text-transform: uppercase; }

/* Tracks */
.tv-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 0 10px;
}
.tv-section-head h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
}
.tv-section-head span { color: var(--tv-muted); font-size: 12px; }

.tv-tracks { display: flex; flex-direction: column; gap: 10px; }

.tv-track {
  border: 1px solid var(--tv-border);
  background: var(--tv-panel);
  border-radius: var(--tv-radius);
  overflow: hidden;
}
.tv-track-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--tv-border);
  cursor: pointer;
}
.tv-track-head:hover { background: rgba(255,255,255,.02); }
.tv-flag { font-size: 1.4rem; line-height: 1; }
.tv-track-name { font-weight: 800; font-size: 1rem; }
.tv-track-sub { font-size: 12px; color: var(--tv-muted); margin-top: 2px; }
.tv-track-badge {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(167,139,250,.15);
  color: var(--tv-violet);
  border: 1px solid rgba(167,139,250,.3);
  white-space: nowrap;
}
.tv-races {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 10px 12px 12px;
}
.tv-race-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--tv-border);
  background: #0b1220;
  color: var(--tv-text);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.tv-race-pill:hover { border-color: #64748b; }
.tv-race-pill.done { opacity: .55; }
.tv-race-pill.active {
  border-color: rgba(52,211,153,.5);
  background: rgba(16,185,129,.15);
  color: #a7f3d0;
}
.tv-race-pill.live {
  border-color: rgba(251,113,133,.5);
  box-shadow: 0 0 0 1px rgba(251,113,133,.2);
}
/* V85/V65/… avdelningslopp */
.tv-race-pill.pool-leg {
  border-color: rgba(251, 191, 36, 0.45);
  background: rgba(251, 191, 36, 0.08);
}
.tv-race-pill.big-start {
  border-color: rgba(251, 191, 36, 0.85);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.12));
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.25), 0 6px 18px rgba(251, 191, 36, 0.12);
  font-weight: 850;
}
.tv-race-pill.minor-pool {
  border-color: rgba(56, 189, 248, 0.35);
}
.tv-race-n { white-space: nowrap; }
.tv-race-tag {
  font-size: 9px;
  font-weight: 850;
  letter-spacing: .03em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.35);
  white-space: nowrap;
}
.tv-race-tag.first {
  background: #fbbf24;
  color: #1c1000;
  border-color: transparent;
}
.tv-race-pill.minor-pool .tv-race-tag {
  background: rgba(56, 189, 248, 0.15);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.35);
}
/* Tydlig linje: här börjar det stora spelet */
.tv-race-divider {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 6px 0 2px;
  width: 100%;
}
.tv-race-divider-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(251, 191, 36, 0.55), transparent);
}
.tv-race-divider-label {
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #fbbf24;
  white-space: nowrap;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  background: rgba(251, 191, 36, 0.1);
}

/* Theater */
.tv-theater {
  display: none;
  margin-top: 18px;
}
.tv-theater.open { display: block; }
.tv-theater-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
  align-items: start;
}
@media (max-width: 960px) {
  .tv-theater-grid { grid-template-columns: 1fr; }
}

.tv-race-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.tv-race-header h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 850;
}
.tv-race-meta { color: var(--tv-muted); font-size: 13px; margin-top: 4px; }
.tv-lenses {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tv-lenses button {
  border: 1px solid var(--tv-border);
  background: #0b1220;
  color: var(--tv-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tv-lenses button.active {
  color: #052e16;
  background: var(--tv-emerald);
  border-color: transparent;
}

/* Start cards */
.tv-starts { display: flex; flex-direction: column; gap: 8px; }
.tv-start {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--tv-border);
  background: #0b1220;
  cursor: pointer;
  transition: border-color .15s, transform .12s;
}
.tv-start:hover { border-color: #475569; }
.tv-start.selected {
  border-color: rgba(56,189,248,.45);
  background: rgba(14,165,233,.08);
}
.tv-start.fav {
  border-color: rgba(251,191,36,.4);
}
.tv-num {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  background: #1e293b;
}
.tv-start-name { font-weight: 800; font-size: 14px; line-height: 1.25; }
.tv-start-sub { font-size: 11.5px; color: var(--tv-muted); margin-top: 2px; }
.tv-badges { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tv-badge-sm {
  font-size: 10px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.tv-badge-sm.amber { background: rgba(251,191,36,.15); color: #fbbf24; }
.tv-badge-sm.emerald { background: rgba(52,211,153,.15); color: #34d399; }
.tv-badge-sm.rose { background: rgba(251,113,133,.15); color: #fb7185; }
.tv-badge-sm.sky { background: rgba(56,189,248,.15); color: #38bdf8; }
.tv-badge-sm.violet { background: rgba(167,139,250,.15); color: #a78bfa; }
.tv-badge-sm.orange { background: rgba(251,146,60,.15); color: #fb923c; }
.tv-badge-sm.slate { background: rgba(148,163,184,.12); color: #94a3b8; }
.tv-badge-sm.drop-solid {
  background: rgba(16, 185, 129, 0.22);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.45);
}
.tv-badge-sm.drop-hard {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.35), rgba(52, 211, 153, 0.2));
  color: #ecfdf5;
  border: 1px solid rgba(52, 211, 153, 0.7);
  box-shadow: 0 0 12px rgba(16, 185, 129, 0.35);
  animation: tv-drop-pulse 1.6s ease-in-out infinite;
}

/* Odds drop – hästkort */
.tv-start.oddsdrop-mild {
  border-color: rgba(52, 211, 153, 0.35);
}
.tv-start.oddsdrop-solid {
  border-color: rgba(52, 211, 153, 0.55);
  background: linear-gradient(105deg, rgba(16, 185, 129, 0.12), #0b1220 55%);
  box-shadow: inset 3px 0 0 #34d399;
}
.tv-start.oddsdrop-hard {
  border-color: rgba(52, 211, 153, 0.75);
  background: linear-gradient(105deg, rgba(16, 185, 129, 0.22), rgba(6, 78, 59, 0.18), #0b1220 60%);
  box-shadow:
    inset 4px 0 0 #10b981,
    0 0 0 1px rgba(16, 185, 129, 0.25),
    0 0 22px rgba(16, 185, 129, 0.18);
  animation: tv-card-drop-glow 2s ease-in-out infinite;
}
.tv-oddsdrop-banner {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.tv-oddsdrop-banner.solid {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border: 1px solid rgba(52, 211, 153, 0.4);
}
.tv-oddsdrop-banner.hard {
  background: linear-gradient(90deg, rgba(16, 185, 129, 0.4), rgba(5, 150, 105, 0.28));
  color: #ecfdf5;
  border: 1px solid rgba(110, 231, 183, 0.65);
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  animation: tv-drop-pulse 1.6s ease-in-out infinite;
}
.tv-drop.tier-solid { font-size: 12px; }
.tv-drop.tier-hard {
  font-size: 13px;
  color: #6ee7b7 !important;
  text-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}
@keyframes tv-drop-pulse {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.88; filter: brightness(1.15); }
}
@keyframes tv-card-drop-glow {
  0%, 100% { box-shadow: inset 4px 0 0 #10b981, 0 0 0 1px rgba(16, 185, 129, 0.25), 0 0 18px rgba(16, 185, 129, 0.14); }
  50% { box-shadow: inset 4px 0 0 #34d399, 0 0 0 1px rgba(52, 211, 153, 0.4), 0 0 28px rgba(16, 185, 129, 0.28); }
}

/* ===== Målgång / resultat ===== */
.tv-finish-board {
  margin: 0 0 14px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.08), rgba(15, 23, 42, 0.95));
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.tv-finish-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 10px;
}
.tv-podium {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}
.tv-podium-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 10px 9px;
  border-radius: 14px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(2, 6, 23, 0.55);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform .12s, border-color .15s;
}
.tv-podium-card:hover {
  transform: translateY(-2px);
  border-color: rgba(251, 191, 36, 0.5);
}
.tv-podium-card.gold {
  border-color: rgba(251, 191, 36, 0.55);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.18), rgba(15, 23, 42, 0.7));
}
.tv-podium-card.silver {
  border-color: rgba(148, 163, 184, 0.45);
  background: linear-gradient(160deg, rgba(148, 163, 184, 0.14), rgba(15, 23, 42, 0.7));
}
.tv-podium-card.bronze {
  border-color: rgba(251, 146, 60, 0.45);
  background: linear-gradient(160deg, rgba(251, 146, 60, 0.14), rgba(15, 23, 42, 0.7));
}
.tv-podium-place { font-size: 12px; font-weight: 800; color: #fde68a; }
.tv-podium-num { font-size: 11px; color: #94a3b8; font-weight: 700; }
.tv-podium-name { font-size: 13px; font-weight: 800; line-height: 1.25; color: #f8fafc; }
.tv-podium-meta { font-size: 11px; color: #94a3b8; margin-top: 2px; }

.tv-finish-payouts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.tv-finish-mybets {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(51, 65, 85, 0.7);
}
.tv-finish-mybets-title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #94a3b8;
  margin-bottom: 6px;
}
.tv-finish-mybets-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tv-finish-rest {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tv-finish-row {
  display: grid;
  grid-template-columns: 28px 36px 1fr 48px 56px;
  gap: 6px;
  align-items: center;
  padding: 6px 8px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: rgba(15, 23, 42, 0.5);
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.tv-finish-row:hover {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.08);
}
.tv-finish-pl {
  font-weight: 900;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
}
.tv-finish-nr { color: #94a3b8; font-weight: 700; font-size: 12px; }
.tv-finish-nm { font-weight: 700; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tv-finish-od, .tv-finish-km {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.tv-status-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  vertical-align: middle;
}
.tv-status-pill.done {
  background: rgba(251, 191, 36, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.4);
}
.tv-status-pill.live {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.tv-place-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  margin-right: 4px;
}
.tv-place-badge.place-1 {
  background: rgba(251, 191, 36, 0.22);
  color: #fde047;
  border: 1px solid rgba(251, 191, 36, 0.5);
}
.tv-place-badge.place-2 {
  background: rgba(148, 163, 184, 0.2);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.45);
}
.tv-place-badge.place-3 {
  background: rgba(251, 146, 60, 0.2);
  color: #fdba74;
  border: 1px solid rgba(251, 146, 60, 0.45);
}
.tv-place-badge.place-n {
  background: rgba(51, 65, 85, 0.5);
  color: #cbd5e1;
}

.tv-result-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .02em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.tv-result-chip.hit {
  background: rgba(16, 185, 129, 0.18);
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
}
.tv-result-chip.miss {
  background: rgba(239, 68, 68, 0.16);
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.4);
}
.tv-result-chip.soft {
  opacity: 0.85;
  font-weight: 700;
}

.tv-start.is-winner {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.1), rgba(11, 18, 32, 0.95));
}
.tv-start.result-hit {
  box-shadow: inset 3px 0 0 #10b981;
}
.tv-start.result-miss {
  box-shadow: inset 3px 0 0 #f87171;
}
.tv-result-badges { margin-top: 6px; }
.tv-pulse-item.result-hit {
  border-radius: 10px;
  background: rgba(16, 185, 129, 0.1);
  outline: 1px solid rgba(16, 185, 129, 0.25);
}
.tv-pulse-item.result-miss {
  border-radius: 10px;
  background: rgba(239, 68, 68, 0.08);
  outline: 1px solid rgba(239, 68, 68, 0.22);
}

@media (max-width: 640px) {
  .tv-podium { grid-template-columns: 1fr; }
  .tv-finish-row {
    grid-template-columns: 24px 32px 1fr 40px;
  }
  .tv-finish-km { display: none; }
}

.tv-odds-col { text-align: right; min-width: 88px; }
.tv-odds-v {
  font-size: 1.2rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: #fff;
}
.tv-odds-p { font-size: 11px; color: var(--tv-muted); margin-top: 2px; }
.tv-drop {
  font-size: 11px;
  font-weight: 800;
  margin-top: 3px;
}
.tv-drop.down { color: var(--tv-emerald); }
.tv-drop.up { color: var(--tv-rose); }
.tv-spark {
  margin-top: 4px;
  opacity: .95;
}
.tv-spark-dual {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.tv-spark-labs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1;
}
.tv-spark-lab {
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.04em;
  opacity: 0.9;
}
.tv-spark-lab.v { color: #38bdf8; }
.tv-spark-lab.p { color: #fbbf24; }
.tv-spark-dual svg {
  display: block;
  flex-shrink: 0;
}

/* Side panel */
.tv-side { display: flex; flex-direction: column; gap: 12px; }
.tv-panel-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tv-dim);
  margin: 0 0 8px;
}
#tv-chart-wrap {
  position: relative;
  height: 220px;
}
#tv-chart-wrap canvas { width: 100% !important; height: 100% !important; }
.tv-pulse-list { display: flex; flex-direction: column; gap: 6px; }
.tv-pulse-kind {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.04em;
  margin-left: 4px;
  opacity: 0.85;
  color: #6ee7b7;
}
.tv-pulse-item.pulse-hard {
  border-left: 3px solid #10b981;
  padding-left: 6px;
  background: rgba(16, 185, 129, 0.08);
  border-radius: 6px;
}
.tv-pulse-item.pulse-solid {
  border-left: 2px solid rgba(52, 211, 153, 0.6);
  padding-left: 6px;
}
.tv-pulse-item {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #0b1220;
  border: 1px solid var(--tv-border);
}
.tv-pulse-item .pct.steam { color: var(--tv-emerald); font-weight: 800; }
.tv-pulse-item .pct.drift { color: var(--tv-rose); font-weight: 800; }
.tv-pick-why {
  display: block;
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--tv-dim, #94a3b8);
  line-height: 1.3;
  font-weight: 500;
}
.tv-pick-meta {
  font-size: 11px;
  color: var(--tv-dim, #94a3b8);
  font-weight: 500;
}
.tv-underlag-list {
  margin: 6px 0 0;
  padding-left: 1.1rem;
  font-size: 12px;
  color: #cbd5e1;
  line-height: 1.4;
}
.tv-underlag-list li { margin: 2px 0; }

/* OD-rekommenderad tvilling */
.tv-tvilling-rec {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.45);
  background: linear-gradient(145deg, rgba(16, 185, 129, 0.18), rgba(15, 23, 42, 0.92));
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.tv-tvilling-rec:hover {
  border-color: rgba(52, 211, 153, 0.7);
}
.tv-tvilling-rec-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
}
.tv-tvilling-rec-odds {
  margin-left: auto;
  font-weight: 800;
  font-size: 1.15rem;
  color: #34d399;
  font-variant-numeric: tabular-nums;
}
.tv-tvilling-rec-names {
  margin-top: 4px;
  font-size: 12px;
  color: #e2e8f0;
  font-weight: 600;
}
.tv-tvilling-rec-meta {
  margin-top: 2px;
  font-size: 11px;
  color: #94a3b8;
}
.tv-pulse-item.tv-tvilling-hot-rec {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.1);
}

/* Historik-panel i häst-DNA */
.tv-hist-block h4 { margin-bottom: 4px; }
.tv-hist-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (min-width: 720px) {
  .tv-hist-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.tv-hist-cell {
  background: rgba(2, 6, 23, 0.45);
  border: 1px solid rgba(51, 65, 85, 0.7);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 64px;
}
.tv-hist-cell.empty {
  opacity: 0.72;
  border-style: dashed;
}
.tv-hist-cell .muted,
.tv-hist-val.muted {
  color: #64748b;
  font-weight: 600;
}
.tv-hist-lab {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tv-dim, #64748b);
  margin-bottom: 3px;
}
.tv-hist-val {
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.3;
}
.tv-hist-val strong { color: #fbbf24; font-weight: 800; }
.tv-hist-sub {
  margin-top: 2px;
  font-size: 10.5px;
  color: #94a3b8;
  line-height: 1.3;
}
.tv-hist-career {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
  font-size: 11.5px;
  color: #cbd5e1;
}
.tv-hist-career strong { color: #fde68a; }
.tv-hist-boost {
  color: #34d399 !important;
  font-weight: 700;
}

/* Mini-historik i startlistan */
.tv-hist-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}
.tv-hist-chip {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  color: #7dd3fc;
  border: 1px solid rgba(56, 189, 248, 0.25);
  font-variant-numeric: tabular-nums;
}
.tv-hist-chip.plus {
  background: rgba(52, 211, 153, 0.14);
  color: #6ee7b7;
  border-color: rgba(52, 211, 153, 0.35);
}
.tv-hist-chip.risk {
  background: rgba(251, 113, 133, 0.14);
  color: #fda4af;
  border-color: rgba(251, 113, 133, 0.35);
}
.tv-drawer-live-drop {
  font-weight: 700;
  font-size: 12px;
}
.tv-drawer-live-drop.steam { color: #34d399; }
.tv-drawer-live-drop.drift { color: #fb7185; }

/* Spara-knappar i hästmodal (enhetlig rad) */
.tv-save-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid var(--tv-border);
}
.tv-save-btn {
  appearance: none;
  border: 1px solid #334155;
  background: #0f172a;
  color: #e2e8f0;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.2;
  transition: border-color .18s, background .18s, color .18s, box-shadow .18s, transform .12s;
}
.tv-save-btn:hover {
  border-color: #64748b;
  color: #fff;
}
.tv-save-btn:active { transform: scale(0.97); }
.tv-save-btn .ico {
  font-size: 15px;
  line-height: 1;
  color: #64748b;
  transition: color .18s, transform .2s, filter .2s;
  display: inline-block;
}
.tv-save-btn.on {
  border-color: rgba(251, 191, 36, 0.65);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.22), rgba(245, 158, 11, 0.12));
  color: #fde68a;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.12), 0 6px 18px rgba(251, 191, 36, 0.12);
}
.tv-save-btn.on .ico {
  color: #fbbf24;
  filter: drop-shadow(0 0 6px rgba(251, 191, 36, 0.75));
}
.tv-save-btn.spik.on {
  border-color: rgba(251, 191, 36, 0.75);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.14));
  color: #fde68a;
}
.tv-save-btn.spik.on .ico { color: #fbbf24; }
.tv-save-btn.plats.on {
  border-color: rgba(56, 189, 248, 0.65);
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.22), rgba(14, 165, 233, 0.1));
  color: #bae6fd;
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.12), 0 6px 18px rgba(56, 189, 248, 0.12);
}
.tv-save-btn.plats.on .ico {
  color: #38bdf8;
  filter: drop-shadow(0 0 6px rgba(56, 189, 248, 0.7));
}
.tv-save-btn.vinnare.on {
  border-color: rgba(52, 211, 153, 0.65);
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.22), rgba(16, 185, 129, 0.1));
  color: #a7f3d0;
  box-shadow: 0 0 0 1px rgba(52, 211, 153, 0.12), 0 6px 18px rgba(52, 211, 153, 0.12);
}
.tv-save-btn.vinnare.on .ico {
  color: #34d399;
  filter: drop-shadow(0 0 6px rgba(52, 211, 153, 0.7));
}
/* Klick-pop på spara-stjärna */
.tv-save-btn.tv-star-pop .ico,
.tv-icon-btn.tv-star-pop {
  animation: tv-star-pop 0.55s cubic-bezier(0.22, 1.35, 0.36, 1) both;
}
.tv-save-btn.tv-star-saved,
.tv-icon-btn.tv-star-saved {
  animation: tv-star-glow 0.7s ease-out both;
}
@keyframes tv-star-pop {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.55) rotate(-12deg); }
  55%  { transform: scale(0.9) rotate(8deg); }
  75%  { transform: scale(1.2) rotate(-4deg); }
  100% { transform: scale(1) rotate(0); }
}
@keyframes tv-star-glow {
  0%   { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0.55); }
  50%  { box-shadow: 0 0 0 10px rgba(251, 191, 36, 0); }
  100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
}
.tv-chip-btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
}

/* Mina tips – inbyggd favoritsida */
.tv-favs-page {
  margin: 0 0 20px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: linear-gradient(160deg, rgba(251, 191, 36, 0.08), rgba(15, 23, 42, 0.96));
}
.tv-favs-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tv-favs-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 850;
  color: #fde68a;
}
.tv-favs-head p {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: #94a3b8;
  line-height: 1.4;
}
.tv-favs-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}
@media (max-width: 640px) {
  .tv-favs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.tv-favs-kpi {
  background: rgba(2, 6, 23, 0.55);
  border: 1px solid #1e293b;
  border-radius: 12px;
  padding: 10px 12px;
}
.tv-favs-kpi .k { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #64748b; }
.tv-favs-kpi .v { font-size: 1.25rem; font-weight: 850; color: #f1f5f9; margin-top: 2px; font-variant-numeric: tabular-nums; }
.tv-favs-kpi .v.hit { color: #34d399; }
.tv-favs-kpi .v.miss { color: #fb7185; }
.tv-favs-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}
.tv-favs-filters button {
  appearance: none;
  border: 1px solid #334155;
  background: #0b1220;
  color: #cbd5e1;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}
.tv-favs-filters button.active {
  background: rgba(251, 191, 36, 0.18);
  border-color: rgba(251, 191, 36, 0.45);
  color: #fde68a;
}
.tv-fav-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid #1e293b;
  background: rgba(11, 18, 32, 0.92);
  margin-bottom: 8px;
}
.tv-fav-card.hit {
  border-color: rgba(52, 211, 153, 0.4);
  background: rgba(16, 185, 129, 0.08);
}
.tv-fav-card.miss {
  border-color: rgba(251, 113, 133, 0.35);
  background: rgba(244, 63, 94, 0.06);
}
.tv-fav-card .title {
  font-weight: 800;
  font-size: 14px;
  color: #f1f5f9;
  line-height: 1.3;
}
.tv-fav-card .meta {
  font-size: 12px;
  color: #94a3b8;
  margin-top: 3px;
  line-height: 1.35;
}
.tv-fav-card .odds {
  font-weight: 850;
  font-size: 1.15rem;
  color: #fbbf24;
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.tv-fav-card .res {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 800;
  text-align: right;
}
.tv-fav-card .res.hit { color: #34d399; }
.tv-fav-card .res.miss { color: #fb7185; }
.tv-fav-card .res.open { color: #94a3b8; }
.tv-fav-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tv-fav-actions a,
.tv-fav-actions button {
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: #0f172a;
  color: #cbd5e1;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
}
.tv-fav-actions button.danger:hover {
  border-color: #fb7185;
  color: #fda4af;
}

/* OddsDrops poolsystem (Harry-stil) */
.tv-system-page {
  margin: 0 0 24px;
  padding: 16px 16px 20px;
  border-radius: 18px;
  border: 1px solid rgba(52, 211, 153, 0.3);
  background: linear-gradient(165deg, rgba(16, 185, 129, 0.1), rgba(15, 23, 42, 0.97));
}
.tv-sys-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.tv-sys-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #6ee7b7;
}
.tv-sys-head h2 {
  margin: 4px 0 0;
  font-size: 1.25rem;
  font-weight: 850;
  color: #f1f5f9;
}
.tv-sys-controls {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}
.tv-sys-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.tv-sys-group .lab {
  font-size: 11px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  margin-right: 4px;
  min-width: 3.5rem;
}
.tv-sys-pill {
  appearance: none;
  border: 1px solid #334155;
  background: #0b1220;
  color: #94a3b8;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .12s;
}
.tv-sys-pill:hover {
  border-color: #64748b;
  color: #e2e8f0;
  background: #111827;
}
.tv-sys-pill:active { transform: scale(0.97); }
/* Tydligt valt före Bygg system */
.tv-sys-pill.active,
.tv-sys-pill[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.45), rgba(5, 150, 105, 0.35));
  border-color: #34d399;
  color: #ecfdf5;
  box-shadow:
    0 0 0 2px rgba(52, 211, 153, 0.35),
    0 4px 14px rgba(16, 185, 129, 0.25);
  font-weight: 850;
}
.tv-sys-pill.active::before,
.tv-sys-pill[aria-pressed="true"]::before {
  content: '✓ ';
  font-weight: 900;
  color: #a7f3d0;
}
.tv-sys-pill.tv-pill-flash {
  animation: tv-pill-flash 0.35s ease-out;
}
@keyframes tv-pill-flash {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.08); }
  100% { transform: scale(1); }
}
.tv-sys-choice {
  margin: 4px 0 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(52, 211, 153, 0.35);
  background: rgba(16, 185, 129, 0.1);
  color: #d1fae5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}
.tv-sys-choice strong {
  color: #6ee7b7;
  font-weight: 850;
}
.tv-sys-build-wrap {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(51, 65, 85, 0.55);
}
.tv-sys-build {
  appearance: none;
  width: 100%;
  max-width: 420px;
  border: 0;
  border-radius: 14px;
  padding: 14px 20px;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  cursor: pointer;
  color: #042f1a;
  background: linear-gradient(135deg, #34d399 0%, #10b981 55%, #059669 100%);
  box-shadow: 0 8px 24px rgba(16, 185, 129, 0.28);
}
.tv-sys-build:hover {
  filter: brightness(1.06);
}
.tv-sys-build:active {
  transform: translateY(1px);
}
.tv-sys-setup-info {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.tv-sys-setup-card {
  border: 1px solid #1e293b;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.tv-sys-setup-card strong {
  color: #6ee7b7;
  font-size: 13px;
}
.tv-sys-setup-card span {
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.35;
}
.tv-sys-coupon {
  border: 1px solid #1e293b;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.55);
  margin-bottom: 12px;
}
.tv-sys-coupon-title {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding: 8px 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #64748b;
  background: #020617;
  border-bottom: 1px solid #1e293b;
}
.tv-sys-leg {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30, 41, 59, 0.85);
  cursor: pointer;
  transition: background .12s;
}
.tv-sys-leg:hover { background: rgba(16, 185, 129, 0.06); }
.tv-sys-leg:last-child { border-bottom: 0; }
.tv-sys-avd {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.05rem;
  background: #1e293b;
  color: #fde68a;
}
.tv-sys-nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.tv-sys-num {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 850;
  font-size: 13px;
  background: #0f172a;
  border: 1px solid #334155;
  color: #e2e8f0;
  font-variant-numeric: tabular-nums;
}
.tv-sys-num.spik {
  background: rgba(251, 191, 36, 0.2);
  border-color: rgba(251, 191, 36, 0.55);
  color: #fbbf24;
}
.tv-sys-name-row {
  font-size: 12.5px;
  color: #e2e8f0;
  line-height: 1.4;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.tv-sys-name-row .muted { color: #64748b; font-size: 11px; }
.tv-sys-pay {
  display: grid;
  grid-template-columns: 1fr 1fr 1.4fr;
  gap: 10px;
  margin-bottom: 12px;
}
.tv-sys-pay .lab {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}
.tv-sys-pay .val {
  font-size: 1.15rem;
  font-weight: 850;
  color: #f1f5f9;
  font-variant-numeric: tabular-nums;
}
.tv-sys-pay .pay {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(251, 191, 36, 0.12);
  border: 1px solid rgba(251, 191, 36, 0.35);
}
.tv-sys-pay .pay-val { color: #fbbf24; font-size: 1.35rem; }
.tv-sys-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tv-sys-text {
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
  background: #020617;
  border: 1px solid #1e293b;
  border-radius: 12px;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.45;
  padding: 10px 12px;
  resize: vertical;
}
.tv-chip-sys {
  border-color: rgba(16, 185, 129, 0.4) !important;
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}
.tv-chip-sys strong { color: #6ee7b7 !important; }
.tv-chip-jackpot-on {
  border-color: rgba(251, 191, 36, 0.55) !important;
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.15), 0 6px 18px rgba(251, 191, 36, 0.12);
}
.tv-chip-jackpot-on strong {
  color: #fbbf24 !important;
  font-size: 1.05em;
}
.tv-chip-jackpot {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 800;
  color: #fde68a;
  letter-spacing: 0.02em;
}
.tv-sys-jackpot-banner {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(251, 191, 36, 0.45);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.08));
  color: #fde68a;
  font-weight: 800;
  font-size: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: baseline;
}
.tv-sys-jackpot-banner .jp-amt {
  color: #fbbf24;
  font-size: 1.25rem;
  font-variant-numeric: tabular-nums;
}
.tv-sys-jackpot-banner .jp-meta {
  font-weight: 600;
  font-size: 12px;
  color: #fcd34d;
  opacity: 0.9;
}
.tv-sys-pairs { margin: 0 0 12px; }
.tv-sys-pair-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.tv-sys-pair-chip {
  font-size: 11.5px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.35);
  color: #c4b5fd;
}

/* Horse DNA – modal (inte längst ner på sidan) */
.tv-horse-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  align-items: center;
  justify-content: center;
  padding: 14px;
  background: rgba(0, 0, 0, 0.82);
  backdrop-filter: blur(5px);
  box-sizing: border-box;
}
.tv-horse-modal.open {
  display: flex;
}
.tv-horse-modal-panel {
  width: 100%;
  max-width: 52rem;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  background: var(--tv-panel);
  border: 1px solid var(--tv-border);
  border-radius: var(--tv-radius);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}
.tv-horse-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--tv-border);
  background: #020617;
  flex-shrink: 0;
}
.tv-horse-modal-kicker {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--tv-emerald);
}
.tv-horse-modal-title {
  font-size: 1.1rem;
  font-weight: 850;
  color: #f1f5f9;
  line-height: 1.25;
  margin-top: 2px;
}
.tv-horse-modal-close {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid #64748b;
  background: #1e293b;
  color: #f8fafc;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.tv-horse-modal-close:hover {
  background: #334155;
  color: #fff;
}
.tv-horse-modal-body {
  padding: 14px 16px 18px;
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
/* Större oddskurva i hästmodalen (persistent – rivs inte vid soft refresh) */
.tv-horse-chart-block {
  margin: 0 0 14px;
  padding: 10px 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(56, 189, 248, 0.28);
  background: linear-gradient(160deg, rgba(14, 165, 233, 0.1), rgba(15, 23, 42, 0.95));
}
.tv-horse-chart-block[hidden] { display: none !important; }
.tv-horse-chart-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.tv-horse-chart-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7dd3fc;
}
.tv-horse-chart-meta {
  font-size: 11px;
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}
#tv-horse-chart-wrap {
  position: relative;
  width: 100%;
  height: 240px; /* lite högre för V+P-legend */
}
@media (min-width: 700px) {
  #tv-horse-chart-wrap { height: 280px; }
}
@media (max-width: 480px) {
  #tv-horse-chart-wrap { height: 210px; }
}
#tv-horse-chart-wrap canvas {
  width: 100% !important;
  height: 100% !important;
}
/* bakåtkompat: gammalt .tv-drawer-innehåll ligger i modal-body */
.tv-drawer h3 { margin: 0 0 8px; font-size: 1.05rem; }
.tv-dna-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 700px) {
  .tv-dna-grid { grid-template-columns: 1fr; }
  .tv-horse-modal { padding: 8px; align-items: flex-end; }
  .tv-horse-modal-panel { max-height: 94vh; border-radius: 16px 16px 12px 12px; }
}
.tv-dna-block {
  background: #0b1220;
  border: 1px solid var(--tv-border);
  border-radius: 12px;
  padding: 10px 12px;
}
.tv-dna-block h4 {
  margin: 0 0 6px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--tv-dim);
}
.tv-dna-block p { margin: 0 0 4px; font-size: 13px; line-height: 1.35; }
.tv-dna-block .muted { color: var(--tv-muted); font-size: 12px; }
.tv-signal-why {
  font-size: 12px;
  color: var(--tv-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* Pool cockpit modal-ish panel */
.tv-pool-panel {
  display: none;
  margin-top: 14px;
}
.tv-pool-panel.open { display: block; }
.tv-legs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.tv-leg {
  border: 1px solid var(--tv-border);
  background: #0b1220;
  border-radius: 12px;
  padding: 10px;
  cursor: pointer;
}
.tv-leg:hover { border-color: #64748b; }
.tv-leg .leg-h { font-weight: 800; font-size: 13px; }
.tv-leg .leg-m { font-size: 12px; color: var(--tv-muted); margin-top: 4px; }

.tv-empty {
  text-align: center;
  color: var(--tv-muted);
  padding: 28px 12px;
  font-size: 14px;
}
.tv-loading { color: var(--tv-amber); font-size: 13px; padding: 12px; }
.tv-error { color: var(--tv-rose); font-size: 13px; padding: 12px; }

.tv-back {
  border: 1px solid var(--tv-border);
  background: transparent;
  color: var(--tv-muted);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.tv-back:hover { color: #fff; border-color: #64748b; }

.tv-footer-note {
  margin-top: 20px;
  font-size: 11px;
  color: var(--tv-dim);
  text-align: center;
}
.tv-footer-note a { color: var(--tv-emerald); }

.tv-formline {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  letter-spacing: 0.12em;
  color: #fbbf24;
  margin-top: 4px;
  font-weight: 700;
}
.tv-row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  margin-bottom: 4px;
}
.tv-icon-btn {
  border: 1px solid var(--tv-border);
  background: #0b1220;
  color: #64748b;
  border-radius: 8px;
  width: 32px;
  height: 30px;
  font-size: 16px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color .18s, border-color .18s, background .18s, box-shadow .18s, transform .12s;
}
.tv-icon-btn.star:hover {
  border-color: rgba(251, 191, 36, 0.45);
  color: #fcd34d;
  background: rgba(251, 191, 36, 0.08);
}
.tv-icon-btn:hover { border-color: #64748b; color: #fff; }
.tv-icon-btn:active { transform: scale(0.92); }
/* Sparad stjärna – tydligt gul/guldig */
.tv-icon-btn.star.on,
.tv-icon-btn.on.star {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.7);
  background: linear-gradient(145deg, rgba(251, 191, 36, 0.28), rgba(245, 158, 11, 0.12));
  box-shadow: 0 0 0 1px rgba(251, 191, 36, 0.2), 0 0 14px rgba(251, 191, 36, 0.35);
  text-shadow: 0 0 10px rgba(251, 191, 36, 0.65);
}
.tv-icon-btn.star.on.spik {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.75);
}
.tv-icon-btn.star.on.plats {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.65);
  background: linear-gradient(145deg, rgba(56, 189, 248, 0.25), rgba(14, 165, 233, 0.1));
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.2), 0 0 14px rgba(56, 189, 248, 0.3);
  text-shadow: 0 0 10px rgba(56, 189, 248, 0.55);
}
.tv-icon-btn.star.pending {
  opacity: 0.75;
  pointer-events: none;
}
.tv-start.has-fav {
  border-color: rgba(251, 191, 36, 0.35);
  box-shadow: inset 0 0 0 1px rgba(251, 191, 36, 0.08);
}
.tv-start.coup { border-color: rgba(56,189,248,.4); }
.tv-career-table {
  border: 1px solid #1e293b;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.45);
  margin-top: 6px;
}
.tv-career-head,
.tv-career-row {
  display: grid;
  grid-template-columns: 64px 56px 88px 1fr 88px;
  gap: 6px;
  padding: 8px 10px;
  font-size: 12px;
  align-items: center;
}
.tv-career-head {
  background: rgba(15, 23, 42, 0.9);
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid #1e293b;
}
.tv-career-row {
  color: #e2e8f0;
  border-bottom: 1px solid rgba(30, 41, 59, 0.65);
}
.tv-career-row:last-child { border-bottom: 0; }
.tv-career-row.total {
  background: rgba(16, 185, 129, 0.06);
  font-weight: 700;
  color: #f1f5f9;
}
.tv-career-rec {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fbbf24;
  font-weight: 700;
}
.tv-career-note {
  margin: 6px 0 0;
  font-size: 11px;
  color: #94a3b8;
}
.tv-form-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}
.tv-form-head-row h4 { margin: 0; }
.tv-formline-big {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  color: #fbbf24;
  margin: 0 0 2px;
  font-weight: 700;
}
.tv-form-help-btn {
  appearance: none;
  border: 1px solid rgba(56, 189, 248, 0.35);
  background: rgba(14, 165, 233, 0.1);
  color: #7dd3fc;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.tv-form-help-btn:hover { border-color: #38bdf8; color: #e0f2fe; }
.tv-form-help-btn.open {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(52, 211, 153, 0.45);
  color: #6ee7b7;
}
.tv-form-help {
  margin: 8px 0 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: rgba(2, 6, 23, 0.55);
}
.tv-form-help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 6px 12px;
  font-size: 12px;
  color: #cbd5e1;
}
.tv-form-code {
  display: inline-block;
  min-width: 2.2rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 800;
  color: #fbbf24;
  margin-right: 4px;
}
.tv-form-help-tip {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: #94a3b8;
  line-height: 1.4;
}
.tv-form-help-tip strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fde68a;
}
.tv-form-table { display: flex; flex-direction: column; gap: 0; margin-top: 6px; }
.tv-form-table-full { margin-top: 8px; }
.tv-form-row {
  display: grid;
  grid-template-columns: 78px 32px minmax(70px, 1fr) minmax(70px, 1fr) 72px 44px 52px;
  gap: 6px;
  font-size: 11px;
  color: var(--tv-muted);
  align-items: center;
  padding: 5px 2px;
  border-bottom: 1px solid rgba(30,41,59,.8);
}
.tv-form-row.tv-form-head {
  color: #64748b;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom-color: #1e293b;
}
.tv-form-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .tv-career-head,
  .tv-career-row {
    grid-template-columns: 52px 44px 72px 1fr 70px;
    font-size: 11px;
    padding: 6px 8px;
  }
  .tv-form-row {
    grid-template-columns: 68px 28px 1fr 48px 40px;
    font-size: 11px;
  }
  .tv-form-row span:nth-child(4),
  .tv-form-row span:nth-child(7) { display: none; }
}
.tv-tools .tv-race-pill:disabled { opacity: .4; cursor: not-allowed; }

.tv-ext-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 4px;
  font-size: 11px;
}
.tv-ext-links a {
  color: #67e8f9;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(103, 232, 249, .25);
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(14, 165, 233, .08);
}
.tv-ext-links a:hover {
  border-color: rgba(103, 232, 249, .5);
  background: rgba(14, 165, 233, .15);
}
