/* Grand Prix Hub · Fase 4: ficha de piloto (puntos acumulados y duelo con su compañero). */
.gph-ptsc { width: 100%; height: auto; display: block; margin: 4px 0 6px; overflow: visible; }
.gph-ptsc-grid { stroke: var(--line); stroke-width: 1; }
.gph-ptsc-axis { font: 500 8px 'DM Sans', sans-serif; fill: var(--muted); font-variant-numeric: tabular-nums; }
.gph-ptsc-me-line { fill: none; stroke: var(--team, var(--red)); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.gph-ptsc-mate-line { fill: none; stroke: var(--muted); stroke-width: 1.6; stroke-dasharray: 4 3; }
.gph-ptsc-me-dot { fill: var(--team, var(--red)); }
.gph-ptsc-me { font: 700 9px 'DM Sans', sans-serif; fill: var(--ink); }
.gph-ptsc-mate { font: 600 9px 'DM Sans', sans-serif; fill: var(--muted); }
.gph-modal-body h3 small { font: 500 12px 'DM Sans', sans-serif; color: var(--muted); text-transform: none; letter-spacing: 0; }

.gph-h2h { display: grid; gap: 8px; margin: 14px 0 6px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; }
.gph-h2h-names { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; }
.gph-h2h-names b { font: 700 18px 'Barlow Condensed', sans-serif; }
.gph-h2h-names b:first-child { color: var(--team, var(--red)); }
.gph-h2h-names span { text-align: center; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.gph-h2h-row { display: grid; grid-template-columns: 2.4em 1fr minmax(7em, auto) 1fr 2.4em; align-items: center; gap: 8px; font-variant-numeric: tabular-nums; }
.gph-h2h-row > b { font: 700 16px 'Barlow Condensed', sans-serif; text-align: center; }
.gph-h2h-row > span { font-size: 11px; text-align: center; color: var(--muted); }
.gph-h2h-bar { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--line) 70%, transparent); display: flex; justify-content: flex-end; overflow: hidden; }
.gph-h2h-bar i { display: block; height: 100%; background: var(--team, var(--red)); border-radius: 4px; }
.gph-h2h-bar.is-mate { justify-content: flex-start; }
.gph-h2h-bar.is-mate i { background: var(--muted); }
@media (max-width: 480px) { .gph-h2h-row { grid-template-columns: 2em 1fr minmax(6em, auto) 1fr 2em; gap: 6px; } }
.gph-ptsc { max-height: 260px; }
@media (max-width: 600px) {
  .gph-ptsc-axis { font-size: 12px; }
  .gph-ptsc-me, .gph-ptsc-mate { font-size: 12.5px; }
}

/* ---------- Segunda pantalla (móvil junto a la tele) ---------- */
#secondScreen {
  position: fixed; inset: 0; z-index: 90; display: grid; grid-template-rows: auto auto 1fr auto;
  background: #0f1113; color: #f2f3f4; font-family: 'DM Sans', system-ui, sans-serif;
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
}
body.sp-open { overflow: hidden; }
.sp-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px 10px; }
.sp-head { display: flex; align-items: center; gap: 14px; min-width: 0; flex: 1; }
.sp-head div { display: grid; min-width: 0; }
.sp-head b { font: 700 22px/1.05 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .02em; }
.sp-head span { font-size: 12px; color: #a9adb0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-tools { display: flex; gap: 8px; }
.sp-btn { min-height: 44px; min-width: 44px; padding: 0 12px; border-radius: 12px; border: 1px solid #2c3135; background: #1a1d20; color: #f2f3f4; font: 600 13px 'DM Sans', sans-serif; }
.sp-btn:focus-visible { outline: 2px solid #ff4b3e; outline-offset: 2px; }
.sp-flag { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 6px 16px; font: 700 16px 'Barlow Condensed', sans-serif; letter-spacing: .08em; text-transform: uppercase; background: #1f6f3a; color: #fff; }
.sp-flag b { font-size: 22px; letter-spacing: .02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sp-flag-yellow, .sp-flag-double_yellow { background: #f2c230; color: #111; }
.sp-flag-sc, .sp-flag-vsc, .sp-flag-vsc_ending { background: #f29b1d; color: #111; }
.sp-flag-red { background: #d7261e; }
.sp-flag-chequered { background: repeating-conic-gradient(#fff 0 25%, #111 0 50%) 0 0 / 18px 18px; color: #111; }
.sp-flag-chequered span, .sp-flag-chequered b { background: #fff; padding: 2px 10px; border-radius: 6px; }
.sp-scroll { overflow-y: auto; padding: 6px 12px 14px; overscroll-behavior: contain; }
.sp-label { margin: 12px 4px 6px; font: 600 11px 'DM Sans', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8d9296; }
.sp-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 3px; }
.sp-row {
  display: grid; grid-template-columns: 2.1em 5px minmax(0, 1fr) auto 1.9em minmax(5.6em, auto); align-items: center; gap: 10px;
  min-height: 48px; padding: 0 10px; border-radius: 10px; background: #171a1d; font-variant-numeric: tabular-nums;
}
.sp-row.is-fav { background: #22272b; box-shadow: inset 0 0 0 1px var(--team); }
.sp-row.is-out { opacity: .45; }
.sp-row.is-pit .sp-gap { color: #f2c230; }
.sp-pos { font: 700 22px 'Barlow Condensed', sans-serif; text-align: right; }
.sp-bar { width: 5px; height: 26px; border-radius: 3px; background: var(--team); }
.sp-name { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.sp-name b { font: 700 22px 'Barlow Condensed', sans-serif; letter-spacing: .03em; }
.sp-name em { font-style: normal; font-size: 12px; color: #9aa0a4; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-row small { font-size: 11px; font-weight: 700; min-width: 2.2em; text-align: right; }
.sp-row small.up { color: #4cc77a; }
.sp-row small.down { color: #ff6b5e; }
.sp-tyre { width: 1.7em; height: 1.7em; border-radius: 50%; display: grid; place-items: center; font: 700 12px 'DM Sans', sans-serif; font-style: normal; border: 3px solid #555; background: #111; color: #fff; }
.sp-soft { border-color: #e8302a; } .sp-medium { border-color: #f2c230; } .sp-hard { border-color: #e9e9e9; }
.sp-intermediate { border-color: #3fae4a; } .sp-wet { border-color: #2f7fe0; }
.sp-gap { font: 600 17px 'Barlow Condensed', sans-serif; text-align: right; white-space: nowrap; }
.sp-msg { display: grid; gap: 2px; padding: 10px 16px 12px; border-top: 1px solid #23272a; background: #131618; font-size: 13px; }
.sp-msg strong { font: 600 10.5px 'DM Sans', sans-serif; letter-spacing: .1em; text-transform: uppercase; color: #8d9296; }
.sp-msg span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (min-width: 900px) { .sp-scroll { width: min(720px, 100%); margin: 0 auto; } }
@media (max-width: 380px) { .sp-row { gap: 7px; padding: 0 8px; } .sp-name em { display: none; } }
@media (prefers-reduced-motion: reduce) { #secondScreen * { transition: none !important; } }

/* ---------- Probabilidad de ser campeón ---------- */
.gph-odds { margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(0,0,0,.08); }
.gph-odds h3 { margin: 0 0 10px; font: 700 18px 'Barlow Condensed', sans-serif; text-transform: uppercase; letter-spacing: .03em; }
.gph-odds-wait { margin: 0; font-size: 13px; color: #8a8f93; }
.gph-odds-bar { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: rgba(0,0,0,.07); gap: 2px; }
.gph-odds-bar i { flex: 0 0 var(--w); background: var(--c); min-width: 3px; }
.gph-odds-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; }
.gph-odds-list li { display: flex; align-items: center; gap: 6px; }
.gph-odds-list b { font: 700 17px 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.gph-odds-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.gph-odds-rest { color: #8a8f93; }
.gph-odds-note { margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; }
.gph-odds-how { margin: 8px 0 0; font-size: 11.5px; line-height: 1.5; color: #8a8f93; }
.gph-odds-bar i.is-mate { background: repeating-linear-gradient(135deg, var(--c) 0 5px, color-mix(in srgb, var(--c) 45%, #fff) 5px 9px); }
.gph-odds-dot.is-mate { background: transparent; box-shadow: inset 0 0 0 3px var(--c); }

/* ---------- Clasificación · pestaña Adelantamientos ---------- */
#standingsView .standings-panel[hidden], #overtakesPanel[hidden] { display: none !important; }
.gph-ot { --gph-ot-accent: #e10600; margin-top: 18px; }
.gph-ot-pending { margin: 0 0 14px; padding: 10px 14px; border-radius: 10px; background: rgba(225, 6, 0, .07); font-size: 13px; }
.gph-ot-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.gph-ot-kpis > div { display: grid; gap: 2px; padding: 14px 16px; border-radius: 14px; background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.06); min-width: 0; }
.gph-ot-kpis span { font-size: 10.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: #8a8f93; }
.gph-ot-kpis b { font: 700 34px/1 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.gph-ot-kpis small { font-size: 12px; color: #6b7075; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gph-ot-h { margin: 28px 0 10px; font: 700 26px 'Barlow Condensed', sans-serif; }
.gph-ot-rank, .gph-ot-gps { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.gph-ot-rank li { display: grid; grid-template-columns: 2em minmax(200px, 1.4fr) minmax(80px, 1fr) 4.2em 4.6em 3.2em; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.05); cursor: pointer; }
.gph-ot-rank li:hover, .gph-ot-rank li:focus-visible { border-color: rgba(0,0,0,.18); outline: none; }
.gph-ot-pos { font: 700 20px 'Barlow Condensed', sans-serif; color: #8a8f93; text-align: right; }
.gph-ot-who, .gph-ot-best { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gph-ot-who > span:last-child, .gph-ot-best > span:last-child { display: grid; min-width: 0; }
.gph-ot-who strong, .gph-ot-gp strong, .gph-ot-best strong { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gph-ot-who em, .gph-ot-gp em, .gph-ot-best em { font-style: normal; font-size: 12px; color: #7d8287; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gph-ot .driver-avatar { width: 30px; height: 30px; font-size: 9px; flex: none; }
.gph-ot-bar { height: 10px; border-radius: 5px; background: linear-gradient(90deg, var(--c) var(--w), rgba(0,0,0,.07) var(--w)); }
.gph-ot-num { display: grid; justify-items: end; line-height: 1; }
.gph-ot-num b { font: 700 22px 'Barlow Condensed', sans-serif; font-variant-numeric: tabular-nums; }
.gph-ot-num small { font-size: 10.5px; color: #8a8f93; }
.gph-ot-suf b { color: #6b7075; font-size: 18px; }
.gph-ot-net { font: 700 16px 'Barlow Condensed', sans-serif; text-align: right; color: #8a8f93; }
.gph-ot-net.up { color: #1f8a4c; } .gph-ot-net.down { color: #c4271e; }
.gph-ot-more { margin-top: 10px; }
.gph-ot-gps li { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(80px, 1fr) 3em minmax(150px, 1fr); align-items: center; gap: 14px; padding: 10px 14px; border-radius: 12px; background: rgba(255,255,255,.72); border: 1px solid rgba(0,0,0,.05); }
.gph-ot-gp { display: grid; min-width: 0; }
.gph-ot-total { font: 700 24px 'Barlow Condensed', sans-serif; text-align: right; font-variant-numeric: tabular-nums; }
.gph-ot-how { margin: 22px 0 6px; padding: 12px 16px; border-radius: 12px; background: rgba(0,0,0,.035); font-size: 13px; line-height: 1.55; }
.gph-ot-how summary { cursor: pointer; font-weight: 700; min-height: 28px; display: flex; align-items: center; }
.gph-ot-how ul { margin: 6px 0; padding-left: 20px; }
@media (max-width: 760px) {
  .gph-ot-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gph-ot-kpis b { font-size: 28px; }
  .gph-ot-rank li { grid-template-columns: 1.6em minmax(0, 1fr) auto auto; grid-template-areas: "pos who made net" "pos bar suf net"; row-gap: 6px; gap: 6px 10px; padding: 10px 12px; }
  .gph-ot-rank .gph-ot-pos { grid-area: pos; } .gph-ot-rank .gph-ot-who { grid-area: who; } .gph-ot-rank .gph-ot-bar { grid-area: bar; }
  .gph-ot-rank .gph-ot-num:not(.gph-ot-suf) { grid-area: made; } .gph-ot-rank .gph-ot-suf { grid-area: suf; } .gph-ot-rank .gph-ot-net { grid-area: net; }
  .gph-ot-num { grid-auto-flow: column; align-items: baseline; gap: 4px; }
  .gph-ot-who em { display: none; }
  .gph-ot-gps li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "gp total" "bar bar" "best best"; gap: 6px 10px; padding: 10px 12px; }
  .gph-ot-gp { grid-area: gp; } .gph-ot-gps .gph-ot-bar { grid-area: bar; } .gph-ot-total { grid-area: total; } .gph-ot-best { grid-area: best; }
  .gph-ot .driver-avatar { width: 26px; height: 26px; }
  .gph-ot-h { font-size: 22px; margin-top: 22px; }
}
@media (max-width: 760px) {
  /* Con tres pestañas no cabe la hora de actualización al lado: pasa debajo. */
  .standings-switch { flex-wrap: wrap; }
  .standings-switch button { padding: 12px 12px; flex: 1 1 auto; }
  .standings-switch span { flex-basis: 100%; margin: 0; padding: 6px 4px 8px; text-align: right; }
}

/* ---------- Historias ---------- */
.gph-hist-week { margin: 26px 0 6px; }
.gph-hist-week h2 { margin: 2px 0 12px; font: 700 26px 'Barlow Condensed', sans-serif; }
.gph-hist-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 26px 0 14px; }
.gph-hist-filters button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line, #deded8); background: var(--card, #fff); color: var(--ink, #111315); font: 600 13px 'DM Sans', sans-serif; cursor: pointer; }
.gph-hist-filters button small { margin-left: 4px; color: #8a8f93; font-weight: 500; }
.gph-hist-filters button.active { background: var(--ink, #111315); border-color: var(--ink, #111315); color: #fff; }
.gph-hist-filters button.active small { color: rgba(255,255,255,.7); }
.gph-hist-filters button:focus-visible { outline: 2px solid var(--red, #ed3b2f); outline-offset: 2px; }
.gph-story-chips { display: block; margin-top: 8px; font-size: 11px; color: #8a8f93; }
.gph-story-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line, #deded8); }
.gph-story-nav span { font-size: 12px; color: #8a8f93; white-space: nowrap; }
.gph-story-nav .outline-button { min-height: 44px; max-width: 42%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 740px) {
  .gph-hist-filters { flex-wrap: nowrap; overflow-x: auto; margin-left: -12px; margin-right: -12px; padding: 0 12px 4px; scrollbar-width: none; }
  .gph-hist-filters button { flex: none; }
  .gph-story-nav .outline-button { font-size: 12px; padding: 0 10px; }
}
/* Arreglo: la capa decorativa de la historia destacada tapaba el botón «Ver historia» (no se podía pulsar). */
.history-feature::after { pointer-events: none; }
.history-feature > div:first-child { position: relative; z-index: 1; }
@media (max-width: 740px) {
  /* 40 historias: en el móvil van de dos en dos y más compactas; las del circuito de la semana, en fila deslizable. */
  #historyView > .history-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #historyView .history-cards article { padding: 14px; min-height: 0; }
  #historyView .history-cards span { font-size: 17px; }
  #historyView .history-cards h3 { margin: 6px 0 4px; font-size: 18px; }
  #historyView .gph-story-chips { display: none; }
  .gph-hist-week .history-cards { display: flex; overflow-x: auto; gap: 10px; margin-left: -12px; margin-right: -12px; padding: 0 12px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
  .gph-hist-week .history-cards article { flex: 0 0 62%; scroll-snap-align: start; }
}
/* Arreglo: otra regla de styles.css le ponía fondo blanco a la historia destacada y el título verde lima no se leía.
   Se recupera el fondo oscuro con el que estaba diseñada. */
#historyView .history-feature { background: var(--ink, #111315); border-color: transparent; }

/* ---------- Resumen de libres ---------- */
.gph-pr { margin-bottom: 22px; padding: 22px 24px; border-radius: 18px; background: rgba(255,255,255,.78); border: 1px solid rgba(0,0,0,.06); }
.gph-pr[hidden] { display: none !important; }
.gph-pr .section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.gph-pr h2 { margin: 2px 0 0; }
.gph-pr-tabs { display: flex; gap: 6px; }
.gph-pr-tabs button { min-width: 48px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line, #deded8); background: var(--card, #fff); font: 700 15px 'Barlow Condensed', sans-serif; cursor: pointer; color: var(--ink, #111315); }
.gph-pr-tabs button.active { background: var(--ink, #111315); color: #fff; border-color: var(--ink, #111315); }
.gph-pr-tabs button:disabled { opacity: .4; cursor: default; }
.gph-pr-wait { margin: 12px 0 0; font-size: 13px; color: #8a8f93; }
.gph-pr-text { margin: 14px 0 18px; font-size: 15px; line-height: 1.6; max-width: 900px; }
.gph-pr-grid { display: grid; grid-template-columns: 1.15fr 1fr .85fr; gap: 14px; }
.gph-pr-card { min-width: 0; padding: 14px 16px; border-radius: 14px; background: rgba(0,0,0,.025); }
.gph-pr-card h3 { margin: 0 0 10px; font: 700 13px 'DM Sans', sans-serif; letter-spacing: .08em; text-transform: uppercase; color: #6b7075; }
.gph-pr-best, .gph-pr-laps { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.gph-pr-best li { display: grid; grid-template-columns: 1.4em 26px minmax(0, 1fr) 22px auto 3.6em; align-items: center; gap: 8px; font-size: 13px; font-variant-numeric: tabular-nums; }
.gph-pr-best b { font: 700 16px 'Barlow Condensed', sans-serif; }
.gph-pr-best small { color: #8a8f93; text-align: right; font-size: 11.5px; }
.gph-pr-pos { color: #8a8f93; font: 700 15px 'Barlow Condensed', sans-serif; text-align: right; }
.gph-pr .driver-avatar { width: 26px; height: 26px; font-size: 8.5px; flex: none; }
.gph-pr-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 600; }
.gph-pr-tyre { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; font: 700 9.5px 'DM Sans', sans-serif; font-style: normal; border: 2.5px solid #bbb; background: #111; color: #fff; }
.gph-pr-soft { border-color: #e8302a; } .gph-pr-medium { border-color: #f2c230; } .gph-pr-hard { border-color: #e9e9e9; }
.gph-pr-intermediate { border-color: #3fae4a; } .gph-pr-wet { border-color: #2f7fe0; }
.gph-pr-laps li { display: grid; grid-template-columns: 26px minmax(0, 6em) 1fr 2em; align-items: center; gap: 8px; font-size: 13px; }
.gph-pr-laps i { height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--c) var(--w), rgba(0,0,0,.07) var(--w)); }
.gph-pr-laps b { font: 700 16px 'Barlow Condensed', sans-serif; text-align: right; }
.gph-pr-note { margin: 10px 0 0; font-size: 11.5px; line-height: 1.5; color: #8a8f93; }
.gph-pr-flag { margin: 12px 0 0; font-size: 13px; font-weight: 600; }
@media (max-width: 1100px) { .gph-pr-grid { grid-template-columns: 1fr 1fr; } .gph-pr-grid > :last-child { grid-column: 1 / -1; } }
@media (max-width: 740px) {
  .gph-pr { padding: 16px 14px; }
  .gph-pr-grid { grid-template-columns: 1fr; }
  .gph-pr-text { font-size: 14.5px; }
}

/* ---------- Motivo de la bandera roja ---------- */
.gph-red-why { display: block; margin-top: 3px; font: 600 12.5px/1.35 'DM Sans', system-ui, sans-serif; letter-spacing: 0; text-transform: none; text-shadow: none; }
.gph-ov-flag + .gph-red-why { display: inline-block; margin: 0 0 0 8px; color: #c4271e; vertical-align: middle; }
.gph-rs-flag .gph-red-why { opacity: .92; }
.sp-flag span .gph-red-why { font-size: 13px; }
.tv-flag .gph-red-why { font-size: 15px; opacity: .95; }
.weather .gph-red-why { font-weight: 700; }

/* ===== Menú lateral: que quepa entero en pantallas de portátil ===== */
.sidebar{overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#3a3d40 transparent}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:#3a3d40;border-radius:3px}
.sidebar .brand,.sidebar .main-nav,.sidebar .sidebar-footer{flex-shrink:0}
@media (min-width:721px) and (max-height:960px){
  .sidebar{padding-top:22px;padding-bottom:16px}
  .sidebar .brand{margin-bottom:28px}
  .sidebar .brand-logo{width:150px;margin:0 auto}
  .sidebar .main-nav{gap:4px}
  .sidebar .nav-item{min-height:40px}
  .sidebar .sidebar-footer>.nav-item{margin-bottom:12px}
  .sidebar .user-mini{padding-top:12px}
}
@media (min-width:721px) and (max-height:760px){
  .sidebar{padding-top:16px;padding-bottom:12px}
  .sidebar .brand{margin-bottom:16px}
  .sidebar .brand-logo{width:110px}
  .sidebar .main-nav{gap:2px}
  .sidebar .nav-item{min-height:36px}
  .sidebar .sidebar-footer>.nav-item{margin-bottom:8px}
  .sidebar .user-mini{padding-top:10px}
}
@media (min-width:721px) and (max-height:600px){
  .sidebar .brand-logo{width:80px}
  .sidebar .nav-item{min-height:32px}
}

/* ===== Revivir carrera: selector de temporada y carreras antiguas (gph-archive.js) ===== */
.gph-ar-years{display:flex;align-items:center;flex-wrap:wrap;gap:10px 14px;margin:0 0 18px}
.gph-ar-years label{font:700 11px 'DM Sans',sans-serif;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}
.gph-ar-years select{font:700 20px 'Barlow Condensed',sans-serif;color:var(--ink);background:var(--card);border:1px solid var(--line);border-radius:8px;padding:6px 34px 6px 12px;cursor:pointer;appearance:none;background-image:linear-gradient(45deg,transparent 50%,currentColor 50%),linear-gradient(135deg,currentColor 50%,transparent 50%);background-position:calc(100% - 17px) 55%,calc(100% - 12px) 55%;background-size:5px 5px;background-repeat:no-repeat}
.gph-ar-years select:focus-visible{outline:3px solid color-mix(in srgb,var(--red) 60%,white);outline-offset:2px}
.gph-ar-years-note{color:var(--muted);font-size:13px}
#replayPicker.gph-ar-mode{display:block}
.gph-ar-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(290px,1fr));gap:12px}
.gph-ar-race{display:flex;align-items:center;gap:14px;text-align:left;background:var(--card);color:var(--ink);border:1px solid var(--line);border-radius:10px;padding:14px 16px;cursor:pointer;transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.gph-ar-race:hover{transform:translateY(-2px);border-color:var(--red);box-shadow:var(--shadow)}
.gph-ar-race:focus-visible{outline:3px solid color-mix(in srgb,var(--red) 60%,white);outline-offset:2px}
.gph-ar-round{font:800 26px 'Barlow Condensed',sans-serif;color:var(--red);min-width:34px}
.gph-ar-race-copy{display:flex;flex-direction:column;gap:3px;min-width:0;flex:1}
.gph-ar-race-copy strong{font:700 19px/1.05 'Barlow Condensed',sans-serif}
.gph-ar-race-copy small{color:var(--muted);font-size:12px}
.gph-ar-go{color:var(--muted);font-size:18px}
.gph-ar{display:grid;gap:18px}
.gph-ar-back{justify-self:start;font-size:13px}
.gph-ar-head h2{font-size:44px;line-height:.95;margin:4px 0 6px}
.gph-ar-head p:last-child{color:var(--muted);margin:0}
.gph-ar-card{background:var(--card);border:1px solid var(--line);border-radius:12px;padding:20px 22px;box-shadow:var(--shadow);min-width:0}
.gph-ar-card h3{font-size:24px;margin:0 0 12px}
.gph-ar-sum p{font-size:15.5px;line-height:1.55;margin:0 0 8px;max-width:820px}
.gph-ar-wiki{display:inline-block;margin-top:6px;color:var(--red);font-weight:700;font-size:13px}
.gph-ar-laps-head{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:12px;margin-bottom:14px}
.gph-ar-laps-head h3{margin:0}
.gph-ar-controls{display:flex;align-items:center;gap:12px;flex:1 1 360px;max-width:620px}
.gph-ar-controls .primary-button{min-width:44px;min-height:40px;padding:0 14px;border-radius:8px;font-size:15px}
.gph-ar-controls input[type=range]{flex:1;accent-color:var(--red);min-width:120px}
.gph-ar-controls b{font:700 18px 'Barlow Condensed',sans-serif;white-space:nowrap;min-width:118px;text-align:right}
.gph-ar-laps-body{display:grid;grid-template-columns:minmax(0,1fr);gap:22px}
.gph-ar-order{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:column;grid-template-rows:repeat(var(--rows,11),auto);gap:3px 22px}
.gph-ar-order li{display:grid;grid-template-columns:26px 4px minmax(0,1fr) auto auto;align-items:center;gap:9px;padding:6px 8px;border-radius:7px;cursor:pointer}
.gph-ar-order li:hover,.gph-ar-order li.is-focus{background:color-mix(in srgb,var(--ink) 7%,transparent)}
.gph-ar-order i,.gph-ar-driver i{display:block;width:4px;height:22px;border-radius:2px}
.gph-ar-pos{font:700 18px 'Barlow Condensed',sans-serif;text-align:right}
.gph-ar-who{display:flex;flex-direction:column;min-width:0}
.gph-ar-who b{font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gph-ar-who small{color:var(--muted);font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gph-ar-gap{font:600 12.5px 'DM Sans',sans-serif;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.gph-ar-box{font:700 10px 'DM Sans',sans-serif;font-style:normal;letter-spacing:.06em;background:var(--yellow);color:#111315;border-radius:4px;padding:2px 5px}
.gph-ar-gone{opacity:.55}
.gph-ar-chart-wrap{min-width:0}
.gph-ar-chart-wrap p{margin:0 0 6px}
.gph-ar-svg{width:100%;height:auto;display:block;overflow:visible}
.gph-ar-svg polyline{fill:none;stroke-width:2.6;stroke-linejoin:round;stroke-linecap:round;transition:opacity .2s,stroke-width .2s}
.gph-ar-svg text{font:700 11px 'DM Sans',sans-serif;fill:var(--ink)}
.gph-ar-svg .gph-ar-tick{font-weight:500;fill:var(--muted);text-anchor:middle;font-size:10px}
.gph-ar-grid{stroke:var(--line);stroke-width:1}
.gph-ar-cursor{stroke:var(--red);stroke-width:2;stroke-dasharray:4 3}
.gph-ar-line{cursor:pointer}
#arChart.has-focus .gph-ar-line:not(.is-focus){opacity:.18}
#arChart .gph-ar-line.is-focus polyline{stroke-width:4}
.gph-ar-table{display:grid;overflow-x:auto}
.gph-ar-row{display:grid;grid-template-columns:44px minmax(190px,1.4fr) minmax(130px,1fr) 62px 66px minmax(150px,1fr) 56px;align-items:center;gap:10px;padding:9px 6px;border-top:1px solid var(--line);font-size:13.5px;min-width:760px}
.gph-ar-row-head{border-top:0;font-size:10px;letter-spacing:.1em;text-transform:uppercase;color:var(--muted);font-weight:700}
.gph-ar-row .gph-ar-pos{text-align:left}
.gph-ar-driver{display:flex;align-items:center;gap:8px;font-weight:700;min-width:0}
.gph-ar-team{color:var(--muted)}
.gph-ar-out{color:var(--muted)}
.gph-ar-fl{font-style:normal;font:700 9px 'DM Sans',sans-serif;background:#8b3dd6;color:#fff;border-radius:4px;padding:2px 4px;margin-left:4px;vertical-align:1px}
@media (max-width:980px){.gph-ar-order{grid-template-columns:1fr;grid-auto-flow:row;grid-template-rows:none}}
@media (max-width:720px){
  .gph-ar-head h2{font-size:34px}
  .gph-ar-card{padding:16px 14px;border-radius:10px}
  .gph-ar-controls{flex-basis:100%;max-width:none;flex-wrap:wrap}
  .gph-ar-controls .primary-button{flex:none;width:auto;align-self:auto}
  .gph-ar-controls input[type=range]{flex:1 1 150px}
  .gph-ar-controls b{flex-basis:100%;min-width:0;font-size:16px;text-align:left}
  .gph-ar-row{grid-template-columns:30px minmax(0,1fr) minmax(76px,auto) 30px;min-width:0;font-size:12.5px;gap:8px}
  .gph-ar-row>:nth-child(3),.gph-ar-row>:nth-child(4),.gph-ar-row>:nth-child(5){display:none}
  .gph-ar-row>:nth-child(6){text-align:right}
  .gph-ar-list{grid-template-columns:1fr}
}
#arChart{overflow-x:auto;-webkit-overflow-scrolling:touch}
@media (max-width:720px){.gph-ar-svg{min-width:680px}}

/* ===== En directo: la tabla de resultados se ve entera, sin tener que desplazarla de lado ===== */
/* Entre 721 y 1100 px el mapa y la tabla van a todo el ancho (antes la columna se quedaba muy estrecha). */
@media (min-width:721px) and (max-width:1100px){
  #liveView .live-layout{grid-template-columns:minmax(0,1fr)}
}
/* En PC la tabla pasa debajo del mapa y del horario, ocupando todo el ancho. */
@media (min-width:1101px){
  #liveView .live-layout{grid-template-areas:"map weekend" "map moments" "results results" "panels panels";grid-template-rows:auto 1fr auto auto}
  #liveView .live-main{display:contents}
  #liveView .live-main>.track-panel{grid-area:map}
  #liveView .live-main>.live-card{grid-area:results}
}
/* Columnas ajustadas al ancho disponible. Si la ventana es estrecha se esconden primero las menos importantes
   (sectores; después velocidad punta y paradas; después intervalo y vueltas). */
@media (min-width:721px){
  #fullStandings{container-type:inline-size;overflow-x:clip}
  #fullStandings .race-row.gph-live{grid-template-columns:36px 34px minmax(144px,1.5fr) 62px 80px 64px 74px 58px 58px 58px 74px 62px 40px 52px;min-width:0}
  #fullStandings .race-row.head>*{white-space:normal;line-height:1.15;min-width:0;letter-spacing:.04em;padding-right:4px}
  #fullStandings .race-row.head>:last-child{padding-right:0}
  #fullStandings .race-row.gph-live>.c-gain,#fullStandings .race-row.gph-live>.c-drv{position:static;box-shadow:none}
  @container (max-width:895px){
    #fullStandings .race-row.gph-live{grid-template-columns:36px 34px minmax(144px,1.5fr) 62px 80px 64px 74px 74px 62px 40px 52px}
    #fullStandings .race-row.gph-live>:is(.c-s1,.c-s2,.c-s3){display:none}
  }
  @container (max-width:721px){
    #fullStandings .race-row.gph-live{grid-template-columns:36px 34px minmax(144px,1.5fr) 62px 80px 64px 74px 74px 52px}
    #fullStandings .race-row.gph-live>:is(.c-spd,.c-pit){display:none}
  }
  @container (max-width:619px){
    #fullStandings .race-row.gph-live{grid-template-columns:36px 34px minmax(150px,1.5fr) 62px 80px 74px 74px}
    #fullStandings .race-row.gph-live>:is(.c-int,.c-laps){display:none}
  }
  @container (max-width:509px){
    #fullStandings .race-row.gph-live{grid-template-columns:36px minmax(150px,1.5fr) 62px 80px 74px}
    #fullStandings .race-row.gph-live>:is(.c-gain,.c-best){display:none}
  }
}
