/* ── Shared side card styles ────────────────────────────────────────────── */

.side-card {
  position: absolute;
  left: 70px;
  right: 16px;
  bottom: 84px; /* sits just above the bottom panel rail */
  margin: 0 auto;
  max-width: 340px;
  z-index: 1200;
  max-height: 72vh;   /* cap only — card hugs its content up to this height, then scrolls internally past it */  
  


  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow-float);
  overflow: hidden;
  contain: layout paint;
  isolation: isolate;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.25s cubic-bezier(0.4,0,0.2,1),
              transform 0.25s cubic-bezier(0.4,0,0.2,1),
              border-color 0.25s ease,
              box-shadow 0.25s ease;
  pointer-events: none;
}

.side-card.card-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
  border-color: var(--accent);
  box-shadow: var(--shadow-float), 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}



.side-card-title {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  padding: 12px 14px 0;
  flex-shrink: 0;
  text-align: center;
}

.side-card-body {
  flex: 1;
  overflow-y: hidden;
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
}



.side-card-body .tab-panel {
  flex: 1;
  max-height: calc(72vh - 100px);   /* ← CHANGED: matches new .side-card max-height above */
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  scrollbar-gutter: stable;
  padding-bottom: 14px;
  padding-right: 4px;
}

.side-card-body .tab-panel::-webkit-scrollbar { width: 4px; }
.side-card-body .tab-panel::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}




/* Ad slot — sits above the round label, same box in both driver and
   constructor standings cards. Fixed height so it doesn't eat into the
   scrollable table area below it. Fully transparent — just a layout box. */

.standings-promo-slot {
  flex-shrink: 0;
  width: 100%;
  height: 64px;
  margin-bottom: 8px;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.standings-promo-slot .promo-logo {
  max-height: 52px; /* box height minus padding, so the image never touches the edges */
}

/* Ad slot for the Articles panel — same box shape, independent
   placement from "main" and "standings". Sits above the article title. */
.article-promo-slot {
  flex-shrink: 0;
  width: 100%;
  height: 64px;
  margin-bottom: 8px;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-promo-slot .promo-logo {
  max-height: 52px;
}



/* Round label fixed above scroll */
.standings-round-label {
  font-size: 0.58rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
  flex-shrink: 0;
  text-align: center;
}


.side-card-body .card-tabs {
  flex-shrink: 0;
  padding: 0 0 8px 0;
  margin-bottom: 0;
}

.side-card-body::-webkit-scrollbar { width: 4px; }
.side-card-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

/* ── Tabs ───────────────────────────────────────────────────────────────── */
.card-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 14px 0;
  flex-shrink: 0;
}

.card-tab {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 4px 10px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.card-tab:hover:not(.active) {
  background: var(--bg-pill-hover);
  color: var(--text-primary);
}

.card-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

/* ── Standings table ────────────────────────────────────────────────────── */
.standings-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  margin-top: 8px;
}

.standings-table th {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 4px 4px 6px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.standings-table th.pts-col,
.standings-table td.pts-col {
  text-align: right;
  color: var(--accent);
  font-weight: 700;
}





.standings-table td {
  padding: 7px 4px;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}



.standings-table tbody tr:last-child td {
  border-bottom: none;
}

.standings-table tbody tr:hover td {
  background: var(--bg-pill);
}

/* Position number */
.standings-pos {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-secondary);
  width: 20px;
  text-align: center;
}





/* Driver row */
.standings-driver {
  display: flex;
  align-items: center;
  gap: 6px;
}



.standings-abbr {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.04em;
  min-width: 32px;
}

.standings-name {
  font-size: 0.65rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 80px;
}

/* Team colour bar */
.standings-team-bar {
  width: 3px;
  height: 18px;
  border-radius: 2px;
  flex-shrink: 0;
}

/* Team logo */
.standings-logo {
  height: 24px;
  width: auto;
  max-width: 60px;
  object-fit: contain;
  display: block;
}

/* Team name */
.standings-team-name {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* Round label */
.standings-round-label {
  font-size: 0.58rem;
  color: var(--text-secondary);
  font-style: italic;
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}

/* ── Map side action buttons ─────────────────────────────────────────────── */
#bottom-panel-actions {
  position: absolute;
  left: 70px;
  right: 16px;
  bottom: 20px;
  z-index: 500;
  display: flex;
  flex-direction: row;
  justify-content: center;
  pointer-events: none;
}

.bottom-panel-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 2px solid var(--border);
  background: rgba(15,15,26,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.bottom-panel-pill.rail-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}

body.light-theme .bottom-panel-pill {
  background: rgba(255,255,255,0.85);
  border-color: rgba(0,0,0,0.12);
}

body.light-theme .bottom-panel-pill.rail-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 14%, transparent);
}

.bottom-panel-pill .map-side-btn {
  pointer-events: all;
}




.map-side-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(15,15,26,0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ccccdd;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  transition: background 0.2s, color 0.2s, transform 0.2s, border-color 0.2s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.map-side-btn:hover {
  background: rgba(40,40,60,0.9);
  color: #ffffff;
  transform: scale(1.08);
}


.map-side-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
  transform: scale(1.08);
}

.map-side-btn.active::after {
  content: '';
  position: absolute;
  bottom: -7px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}




body.light-theme .map-side-btn {
  background: rgba(255,255,255,0.85);
  border: 1px solid rgba(0,0,0,0.1);
  color: #333344;
  box-shadow: 0 2px 10px rgba(0,0,0,0.12);
}

body.light-theme .map-side-btn:hover {
  background: rgba(235,235,245,0.95);
  color: #111122;
}

body.light-theme .map-side-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}








/* ── Bottom panel icon buttons (PNG icons) — desktop default ─────────────── */
.map-side-btn img.btn-icon-img {
  width: 17px !important;
  height: 17px !important;
  max-width: 17px;
  max-height: 17px;
  display: block;
  object-fit: contain;
  border: none;
  outline: none;
  -webkit-user-drag: none;
}



@media (max-width: 768px) {
  #bottom-panel-actions {
    left: 60px;
    right: 12px;
    bottom: 16px;
  }

  .map-side-btn {
    width: 30px;
    height: 30px;
    font-size: 0.74rem;
  }

  .map-side-btn img.btn-icon-img {
    width: 15px !important;
    height: 15px !important;
    max-width: 15px;
    max-height: 15px;
  }

  .side-card {
    left: 60px;
    right: 12px;
    bottom: 70px;
    max-width: none;
    max-height: 65vh;
  }

  .socials-stage {
    max-height: calc(65vh - 150px);   /* ← ADDED: matches the mobile .side-card max-height above, slightly smaller header allowance since mobile pills/nav are more compact */
  }
}




body.circuit-panel-open #card-standings-drivers,
body.circuit-panel-open #card-standings-constructors,
body.circuit-panel-open #bottom-panel-actions {
  display: none;
}


/* ── Info button (i) in standings rows ─────────────────────────────────── */
.standings-info-cell {
  width: 18px;
  padding-right: 2px !important;
}

.standings-info-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1;
  transition: color 0.15s, transform 0.15s;
}

.standings-info-btn:hover {
  color: var(--accent);
  transform: scale(1.15);
}








/* ── Detail view: sticky header + independently scrolling stats ─────────── */
.detail-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0; /* required for the child scroll area to respect flex sizing */
}

.detail-header-sticky {
  flex-shrink: 0;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.detail-back-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 6px;
  display: inline-block;
}

.detail-back-btn:hover {
  text-decoration: underline;
}

.detail-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-scroll {
  flex: 1;
  min-height: 0;
}





/* ── Standings row flags (drivers only) ──────────────────────────────────── */
.standings-flag {
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ── Team column: logo + full name stacked (constructors only) ──────────── */
.standings-team-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
}

.standings-team-fullname {
  font-size: 0.56rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.15;
  max-width: 130px;
  white-space: normal;
}









/* ── Previous drivers (team detail) ──────────────────────────────────────── */
.detail-prev-drivers {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-prev-driver {
  font-size: 0.66rem;
  color: var(--text-primary);
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 3px 8px;
  white-space: nowrap;
}

/* ── Social icons + click-to-reveal handle ──────────────────────────────── */
.detail-social {
  display: flex;
  gap: 6px;
}

.detail-social-btn {
  position: relative;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.detail-social-btn img {
  width: 14px;
  height: 14px;
  display: block;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.detail-social-btn:hover img {
  opacity: 1;
}

.social-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  box-shadow: var(--shadow-float);
  z-index: 10;
}

/* Articles-specific tooltip variant: opens downward instead of upward.
   The article byline can sit at the very top of the scrollable
   .article-scroll area (when there's no image above it) — a tooltip
   opening upward from there would render past the scroll container's
   own top edge and get silently clipped by its overflow-y: auto. */
.article-scroll .social-tooltip {
  bottom: auto;
  top: calc(100% + 6px);
}


.detail-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
}

.detail-sub {
  font-size: 0.66rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

.detail-stats-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-stat-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.7rem;
  border-bottom: 1px dashed var(--border);
  padding-bottom: 4px;
}

.detail-stat-label {
  color: var(--text-secondary);
}

.detail-stat-value {
  color: var(--text-primary);
  font-weight: 700;
}

.detail-section-label {
  font-size: 0.58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin: 10px 0 6px;
}

.detail-prev-team {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  color: var(--text-primary);
  padding: 3px 0;
}

.detail-prev-team-years {
  margin-left: auto;
  color: var(--text-secondary);
  font-size: 0.64rem;
}

.detail-prev-names {
  font-size: 0.7rem;
  color: var(--text-primary);
}

.detail-fun-fact {
  margin-top: 12px;
  font-size: 0.68rem;
  font-style: italic;
  color: var(--text-secondary);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

.detail-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 16px 0;
  text-align: center;
}


/* ── Socials stage (embed display area) ──────────────────────────────────── */

.socials-stage {
  position: relative;
  width: 100%;
  min-height: 200px;
  max-height: calc(72vh - 160px);   /* ← CHANGED: was a fixed 300px — now scales with the card's own height (72vh, set on .side-card) instead of being capped independently */
  overflow-y: auto;
  overflow-x: hidden;
  contain: layout paint;
  isolation: isolate;
  transform: translateZ(0); /* forces Chrome to properly contain the embed iframe within this box, rather than letting it escape on some mobile renders */
  display: flex;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 6px;
}








/* Hard backstop: whatever width the platform script tries to render at,
   never let it exceed the card's own available width. Twitter/Instagram
   embeds render as an iframe once processed. */


.socials-stage iframe,
.socials-stage .twitter-tweet,
.socials-stage .instagram-media {
  max-width: 100% !important;
  width: 100% !important;
  min-width: 0 !important;
}

.socials-stage blockquote.instagram-media {
  margin: 0 !important;
}




.socials-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

.socials-counter {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  min-width: 40px;
  text-align: center;
}

/* ── Bottom nav row: arrow · pills (scrollable) · arrow ──────────────────── */

.socials-nav-row {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.socials-arrow {
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  font-size: 0.95rem;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.socials-arrow:hover {
  background: var(--bg-pill-hover);
}

/* ── Circuit filter pill strip ────────────────────────────────────────────── */

.socials-pills {
  width: 100%;
  flex-shrink: 0; /* never let this row get compressed by flex — it's a
                     fixed strip, not flexible space, so pill buttons and
                     the scrollbar beneath them always render at full size */
  min-height: 40px; /* pill button height (~28px) + scrollbar clearance,
                        so the scrollbar never overlaps/eats into button
                        content — increase this a few px if pills still
                        look tight after this fix */
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  -webkit-overflow-scrolling: touch;
}

.socials-pills::-webkit-scrollbar {
  height: 6px;
}

.socials-pills::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
}

.socials-pills::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}

.socials-pills::-webkit-scrollbar-thumb:hover {
  background: var(--accent-hover);
}

.socials-pills::-webkit-scrollbar { height: 4px; }
.socials-pills::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}



.socials-pill {
  flex: 0 0 auto;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  overflow: visible;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}




.socials-pill:hover:not(.active) {
  background: var(--bg-pill-hover);
  color: var(--text-primary);
}


.socials-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.socials-pill.pill-unseen {
  border-color: #00c853;
  box-shadow: 0 0 0 2px rgba(0,200,83,0.25);
}



.map-side-btn {
  position: relative; /* required for the dot to anchor correctly */
}

.map-side-btn-unread-dot {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #00c853;
  border: 1.5px solid var(--bg-header);
  display: none;
}

.map-side-btn-unread-dot.visible {
  display: block;
}




/* ── Socials loading state ────────────────────────────────────────────── */
.socials-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 0;
  width: 100%;
}

.socials-loading-dots {
  display: flex;
  gap: 6px;
}

.socials-loading-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: socialsDotPulse 1.2s ease-in-out infinite;
}

.socials-loading-dots span:nth-child(2) { animation-delay: 0.15s; }
.socials-loading-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes socialsDotPulse {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1;   }
}

.socials-loading-text {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 600;
}





/* Title sits OUTSIDE the scroll area, flex-shrink:0, exactly like
   .side-card-title sits outside .tab-panel/.socials-stage. This is
   what actually makes it "sticky" — nesting title+scroll together
   inside one shrink-wrapped wrapper (the previous approach) meant
   flex:1 on the inner scroll had no real parent height to fill, so
   short articles left dead space instead of the card hugging content
   correctly. */


.article-title {
  flex-shrink: 0;
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.article-title.item-unseen {
  outline: 2px solid #00c853;
  outline-offset: 4px;
  border-radius: 6px;
}

.socials-stage.item-unseen {
  outline: 2px solid #00c853;
  outline-offset: 4px;
  border-radius: 10px;
}




.article-scroll {
  flex: 1;
  min-height: 0;
  max-height: calc(72vh - 160px);   /* same offset as .socials-stage — accounts for title + nav-row + pills below it */
  overflow-y: auto;
  padding-right: 2px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

@media (max-width: 768px) {
  .article-scroll {
    max-height: calc(65vh - 150px);
  }
}


.article-scroll::-webkit-scrollbar { width: 4px; }
.article-scroll::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.article-image {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 10px;
  display: block;
}


.article-image-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -4px;
}

.article-image-link {
  color: #3b82f6;
  font-size: 0.68rem;
  font-weight: 700;
  text-decoration: none;
  flex-shrink: 0;
}

.article-image-link:hover {
  text-decoration: underline;
}




.article-byline {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.article-author {
  font-size: 0.7rem;
  font-style: italic;
  color: var(--text-secondary);
}

.article-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.article-body p {
  font-family: Cambria, Georgia, 'Times New Roman', serif;
  font-size: 0.68rem;   /* reduced ~1pt from 0.76rem */
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
  text-align: justify;
  text-justify: inter-word;
}

.article-empty {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0;
  font-style: italic;
}


.article-views-row {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.66rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.article-views-icon {
  flex-shrink: 0;
}

.article-views-count {
  font-weight: 600;
}



/* ── Comparisons panel ────────────────────────────────────────────────── */
.comparisons-promo-slot {
  flex-shrink: 0;
  width: 100%;
  height: 64px;
  margin-bottom: 8px;
  padding: 6px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}

.comparisons-promo-slot .promo-logo {
  max-height: 52px;
}

.comparisons-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.comparisons-select {
  flex: 1;
  min-width: 0;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 8px;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.comparisons-vs {
  font-size: 0.66rem;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.comparisons-headers-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.comparisons-entity {
  flex: 1;
  min-width: 0;
}

.comparisons-entity-right {
  text-align: right;
}

.comparisons-entity-right .comparisons-entity-sub {
  justify-content: flex-end;
}

.comparisons-entity-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.25;
  margin-bottom: 3px;
}

.comparisons-entity-sub {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.64rem;
  color: var(--text-secondary);
}

.comparisons-entity-bar {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.comparisons-entity-empty {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-style: italic;
}

.comparisons-stats {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.comparisons-stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--border);
}

.comparisons-stat-value {
  flex: 1;
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.comparisons-stat-value:first-child { text-align: left; }
.comparisons-stat-value:last-child  { text-align: right; }

.comparisons-stat-value.is-leader {
  color: #00c853;
}

.comparisons-stat-label {
  flex: 0 0 auto;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: center;
  min-width: 70px;
}
















/* ── Comparisons: custom dropdown pickers ─────────────────────────────── */
.comparisons-picker {
  position: relative;
  flex: 1;
  min-width: 0;
}

.comparisons-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  width: 100%;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 7px 8px;
  cursor: pointer;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  text-align: left;
}

.comparisons-picker-trigger.is-placeholder {
  color: var(--text-secondary);
  font-weight: 500;
}

.comparisons-picker-trigger-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.comparisons-picker-arrow {
  flex-shrink: 0;
  font-size: 0.6rem;
  color: var(--text-secondary);
}

/* Always opens downward — position is fixed, never flipped above the
   trigger. max-height is set inline at open-time (JS) to stop exactly
   at the side-card's own bottom edge; .side-card's overflow:hidden is
   a second backstop against ever visually spilling past it. */
.comparisons-picker-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow-float);
  z-index: 50;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.comparisons-picker-dropdown.open {
  display: block;
}

.comparisons-picker-dropdown::-webkit-scrollbar { width: 4px; }
.comparisons-picker-dropdown::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 4px;
}

.comparisons-picker-option {
  padding: 8px 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}

.comparisons-picker-option:hover {
  background: var(--bg-pill-hover);
}

.comparisons-picker-option.selected {
  color: var(--accent);
}

.comparisons-picker-option.disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}



/* ── Points gap-from-leader, shown under each row's points except the
   leader's own row ─────────────────────────────────────────────────── */
.pts-value {
  line-height: 1.2;
}

.pts-gap {
  font-size: 0.58rem;
  font-style: italic;
  font-weight: 500;
  color: var(--text-secondary);
  margin-top: 2px;
  line-height: 1.2;
}