/* ==========================================================================
   Cycling For Fun - responsive shell
   Loaded after cyclingmanager.css. Night-race navy, leader's-jersey yellow,
   team red; condensed race-signage type. The stage-profile line under the
   top bar is the one decorative element.
   ========================================================================== */

:root {
  --night: #0a1238;        /* page background (brand navy, lifted for legibility) */
  --night-2: #121d4d;      /* panels */
  --night-3: #1c2a63;      /* raised / hover */
  --rule: #2c3b7a;         /* borders */
  --maillot: #ffd200;      /* leader's jersey: primary accent */
  --maillot-ink: #241c00;  /* text on the accent */
  --accent-hover: #ffe14d;
  --team-red: #b4142c;     /* top bar, alerts */
  --bar-ink: #ffffff;      /* text on the top bar */
  --text: #eef1fb;
  --muted: #aab4da;
  --link: #ffd200;
  --link-hover: #fff3a8;
  --input-bg: #ffffff;
  --input-ink: #111111;
  --focus: #ffd200;
  --stripe: rgba(255, 255, 255, .04);
  --shadow: 0 14px 30px rgba(0, 0, 0, .45);
  --radius: 10px;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", "Segoe UI", Roboto, Arial, sans-serif;
  color-scheme: dark;
}

/* Light: daylight stage start - white panels, team red bar, navy ink */
:root[data-theme="light"] {
  --night: #eef1f8;
  --night-2: #ffffff;
  --night-3: #e1e6f4;
  --rule: #c5cde6;
  --maillot: #ffd200;
  --maillot-ink: #241c00;
  --accent-hover: #ffe14d;
  --team-red: #b4142c;
  --bar-ink: #ffffff;
  --text: #141a3d;
  --muted: #4d5682;
  --link: #1f3fb0;
  --link-hover: #b4142c;
  --input-bg: #ffffff;
  --input-ink: #141a3d;
  --focus: #1f3fb0;
  --stripe: #f3f5fb;
  --shadow: 0 10px 24px rgba(20, 26, 61, .12);
  color-scheme: light;
}

/* High contrast: pure black and white, yellow for anything you can act on */
:root[data-theme="contrast"] {
  --night: #000000;
  --night-2: #000000;
  --night-3: #1f1f1f;
  --rule: #ffffff;
  --maillot: #ffff00;
  --maillot-ink: #000000;
  --accent-hover: #ffffff;
  --team-red: #000000;
  --bar-ink: #ffffff;
  --text: #ffffff;
  --muted: #ffffff;
  --link: #ffff00;
  --link-hover: #00ffff;
  --input-bg: #000000;
  --input-ink: #ffffff;
  --focus: #00ffff;
  --stripe: #141414;
  --shadow: none;
  color-scheme: dark;
}

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--night) !important;
  color: var(--text);
  font-family: var(--body);
  font-size: 15px;
  line-height: 1.45;
}
body a { color: var(--link); }
body a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---- top bar ------------------------------------------------------------ */
.cff-top {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 20px 22px;
  background: var(--team-red);
  color: var(--bar-ink);
}
.cff-wordmark {
  font-family: var(--display);
  font-style: italic;
  font-weight: 800;
  font-size: 30px;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--bar-ink) !important;
  text-decoration: none;
  white-space: nowrap;
}
.cff-clock {
  margin-left: auto;
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  color: var(--bar-ink);
  opacity: .9;
}
.cff-profile {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  width: 100%;
  height: 24px;
  fill: var(--night);
}
.cff-menu-btn {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 2px solid var(--bar-ink);
  border-radius: 999px;
  background: transparent;
  color: var(--bar-ink);
  font: 700 17px var(--display);
  cursor: pointer;
}
.cff-menu-btn__bars,
.cff-menu-btn__bars::before,
.cff-menu-btn__bars::after {
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  content: "";
}
.cff-menu-btn__bars { position: relative; }
.cff-menu-btn__bars::before { position: absolute; top: -6px; }
.cff-menu-btn__bars::after { position: absolute; top: 6px; }

/* ---- navigation --------------------------------------------------------- */
.cff-nav { background: var(--night); border-bottom: 1px solid var(--rule); position: relative; z-index: 50; }
.cff-nav ul { list-style: none; margin: 0; padding: 0; }
.cff-nav__groups { display: flex; flex-wrap: wrap; padding: 0 12px; }
.cff-nav__group summary,
.cff-nav__logout a {
  display: block;
  padding: 12px 14px;
  font: 700 18px var(--display);
  color: var(--text);
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}
.cff-nav__group summary::-webkit-details-marker { display: none; }
.cff-nav__group summary::after { content: " \25BE"; color: var(--muted); font-size: 14px; }
.cff-nav__group[open] summary,
.cff-nav__group summary:hover { color: var(--maillot); }
.cff-nav__group { position: relative; }
.cff-nav__group ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  padding: 6px 0;
  background: var(--night-2);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--maillot);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: var(--shadow);
}
.cff-nav__group li a {
  display: block;
  padding: 9px 16px;
  color: var(--text);
  text-decoration: none;
}
.cff-nav__group li a:hover { background: var(--night-3); color: var(--maillot); }
.cff-nav__logout { margin-left: auto; }
.cff-nav__admin a { display: block; padding: 12px 14px; font: 700 18px var(--display); color: var(--maillot); text-decoration: none; }
.cff-nav__logout a { color: var(--muted); text-decoration: none; }

/* ---- shell -------------------------------------------------------------- */
.cff-shell {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 20px 64px;
  align-items: start;
}

/* sidebar */
.cff-side {
  position: static !important;
  width: auto !important;
  font-size: 14px;
}
.cff-side h2 {
  margin: 0 0 8px;
  font: 700 20px var(--display);
  color: var(--maillot);
}
.cff-stage {
  margin-bottom: 18px;
  padding: 12px;
  background: var(--night-2);
  border-left: 4px solid var(--maillot);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.cff-stage img { display: block; width: 100%; height: auto; aspect-ratio: 13 / 8; max-height: 160px; object-fit: cover; background: var(--night-3); border-radius: 6px; margin-bottom: 8px; }
.cff-stage__name { margin: 0; font-weight: 600; }
.cff-stage__num {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  background: var(--text);
  color: var(--night);
  font: 700 14px var(--display);
  border-radius: 3px;
}
.cff-stage__tour, .cff-stage time { display: block; color: var(--muted); font-size: 13px; }
.cff-alerts { list-style: none; margin: 0 0 18px; padding: 0; }
.cff-alerts a {
  display: block;
  margin-bottom: 6px;
  padding: 10px 12px;
  background: var(--team-red);
  color: #fff;
  border: 2px solid var(--team-red);
  border-radius: var(--radius);
  font-weight: 600;
  text-decoration: none;
}
.cff-side__links { list-style: none; margin: 18px 0 0; padding: 0; }
.cff-side__links a { display: flex; align-items: center; gap: 10px; padding: 8px 0; color: var(--text); }
.cff-button,
a.buttono2 {
  display: inline-block;
  width: auto !important;
  white-space: nowrap;
  padding: 8px 20px;
  margin-bottom: 18px;
  line-height: 1.2;
  background: var(--maillot);
  color: var(--maillot-ink) !important;
  border-radius: 999px;
  font: 700 17px var(--display);
  text-decoration: none;
}
.cff-button:hover { background: var(--accent-hover); }
.cff-ad { margin: 12px 0; min-height: 0; }

/* ---- legacy page content ------------------------------------------------- */
/* everything a page prints goes in the main column; the sidebar spans the rows */
.cff-shell > *:not(.cff-side) { grid-column: 2; min-width: 0; max-width: 100%; overflow-x: auto; }
.cff-side { grid-column: 1; grid-row: 1 / span 30; }

/* old pages place boxes with absolute pixel positions (#skills, #trofeos,
   Layer1...): put them back in the normal flow, side by side when they fit */
/* (:not(:where(.cff-isolate *)) leaves third-party widgets alone, e.g. the
   PayPal buttons, whose iframe is absolutely positioned inside a div with an id) */
#content div[id]:not(:where(.cff-isolate *)), #content2 div[id]:not(:where(.cff-isolate *)),
.cff-shell [style*="position:absolute"]:not(:where(.cff-isolate *)), .cff-shell [style*="position: absolute"]:not(:where(.cff-isolate *)),
.cff-shell div#content2, .cff-shell div#content5 {
  position: static !important;
  left: auto !important;
  top: auto !important;
  height: auto !important;
}
#content div[id]:not(:where(.cff-isolate *)), .cff-shell [style*="position:absolute"]:not(:where(.cff-isolate *)), .cff-shell [style*="position: absolute"]:not(:where(.cff-isolate *)) {
  display: inline-block;
  vertical-align: top;
  max-width: 100%;
  margin: 0 16px 16px 0 !important;
}
#content .tip span, #content td.tooltip span { position: absolute !important; }

div#content, div#content2, div#content5 {
  position: relative !important;
  left: auto !important;
  top: auto !important;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 20px !important;
  background: var(--night-2) !important;
  border: 1px solid var(--rule) !important;
  border-radius: var(--radius) !important;
  font-family: var(--body) !important;
  font-size: 14px !important;
  color: var(--text);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
#content h1, #content h2, #content h3 { font-family: var(--display); font-weight: 700; line-height: 1.1; }
#content img { max-width: 100%; }
#content img:not([height]) { height: auto; }
#content input[type="text"], #content input[type="password"], #content input[type="number"],
#content input[type="email"], #content select, #content textarea,
#content2 input[type="text"], #content2 input[type="password"], #content2 input[type="number"],
#content2 input[type="email"], #content2 select, #content2 textarea {
  max-width: 100%;
  min-height: 34px;
  padding: 4px 8px;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--input-ink);
  font: inherit;
}
#content input[type="submit"], #content input[type="button"], #content button,
#content2 input[type="submit"], #content2 input[type="button"], #content2 button {
  min-height: 36px;
  padding: 6px 16px;
  border: 0;
  border-radius: 999px;
  background: var(--maillot);
  color: var(--maillot-ink);
  font: 700 16px var(--display);
  cursor: pointer;
}

/* ---- phones and small tablets ------------------------------------------- */
@media (max-width: 899px) {
  body { font-size: 16px; }
  .cff-top { padding: 10px 14px 20px; }
  .cff-wordmark { font-size: 22px; }
  .cff-top { gap: 10px; }
  .cff-clock { font-size: 16px; }
  .cff-clock__date { display: none; }
  .cff-menu-btn { display: inline-flex; }

  .cff-nav { display: none; }
  .cff-nav.is-open { display: block; }
  .cff-nav__groups { display: block; padding: 0 0 8px; }
  .cff-nav__group summary, .cff-nav__logout a { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .cff-nav__group ul { position: static; box-shadow: none; border: 0; border-radius: 0; background: var(--night-2); }
  .cff-nav__group li a { padding: 12px 28px; }

  .cff-shell { display: flex; flex-direction: column; align-items: stretch; padding: 12px 10px 48px; }
  .cff-shell > *:not(.cff-side) { order: 0; }
  .cff-side { order: 1; margin-top: 24px; }
  .cff-ad--side { display: none; }

  div#content { padding: 14px !important; font-size: 15px !important; }

  /* old fixed-width tables and images: fit the screen, scroll sideways if they must */
  table[width], table[style*="width"] { width: 100% !important; }
  img { max-width: 100%; }
  img:not([height]) { height: auto; }
  body > div, body > center, body > table { max-width: 100%; overflow-x: auto; }
  #content td, #content th { word-break: normal; }

  /* boxes that were placed with pixel positions: full width on phones */
  #content div[id]:not(:where(.cff-isolate *)), .cff-shell [style*="position:absolute"]:not(:where(.cff-isolate *)), .cff-shell [style*="position: absolute"]:not(:where(.cff-isolate *)) {
    display: block;
    width: auto !important;
    margin-right: 0 !important;
  }
}

/* ---- maintenance page ---------------------------------------------------- */
.cff-maintenance { max-width: 560px; margin: 12vh auto; padding: 0 20px; font-size: 18px; }
.cff-maintenance .cff-wordmark { color: var(--maillot) !important; font-size: 40px; }

@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ==========================================================================
   Themes
   Dark keeps the original page colours. Light and high contrast repaint the
   legacy page content (inline bgcolor/font colors, per-page <style> blocks)
   from the theme tokens so every old page follows the chosen theme.
   ========================================================================== */

/* ---- switcher ------------------------------------------------------------ */
.cff-nav__theme { margin-left: auto; display: flex; align-items: center; padding: 0 8px; }
.cff-nav__theme + .cff-nav__logout { margin-left: 0; }
.cff-theme { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.cff-theme button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: 600 14px var(--body);
  cursor: pointer;
}
.cff-theme button[aria-pressed="true"] { background: var(--maillot); color: var(--maillot-ink); }
.cff-theme__swatch { width: 12px; height: 12px; border-radius: 50%; border: 1px solid currentColor; }
.cff-theme__swatch--dark { background: #0a1238; }
.cff-theme__swatch--light { background: #ffffff; }
.cff-theme__swatch--contrast { background: linear-gradient(90deg, #000 50%, #ff0 50%); }

@media (max-width: 899px) {
  .cff-nav__theme { padding: 14px 16px; border-bottom: 1px solid var(--rule); }
  .cff-theme { width: 100%; justify-content: space-between; }
  .cff-theme button { flex: 1; justify-content: center; min-height: 40px; padding: 0 6px; }
}

/* ---- legacy content in light / high contrast ------------------------------ */
:root[data-theme="light"] body:not(.landing),
:root[data-theme="contrast"] body:not(.landing) { background: var(--night) !important; color: var(--text) !important; }

:root[data-theme="light"] body:not(.landing) :not(.cff-top, .cff-top *, .cff-nav, .cff-nav *, .cff-side, .cff-side *,
  .cff-button, .cff-theme *, .cff-tabbar, .cff-tabbar *, .cff-install-banner, .cff-install-banner *, .cff-install-ios, .cff-install-ios *, .cff-isolate, .cff-isolate *, img, svg, svg *, iframe, ins, input, select, textarea, button),
:root[data-theme="contrast"] body:not(.landing) :not(.cff-top, .cff-top *, .cff-nav, .cff-nav *, .cff-side, .cff-side *,
  .cff-button, .cff-theme *, .cff-tabbar, .cff-tabbar *, .cff-install-banner, .cff-install-banner *, .cff-install-ios, .cff-install-ios *, .cff-isolate, .cff-isolate *, img, svg, svg *, iframe, ins, input, select, textarea, button) {
  background-color: transparent !important;
  background-image: none !important;
  color: var(--text) !important;
  border-color: var(--rule) !important;
  text-shadow: none !important;
  box-shadow: none !important;
}
:root[data-theme="light"] body:not(.landing) a:not(.cff-button, .cff-wordmark),
:root[data-theme="contrast"] body:not(.landing) a:not(.cff-button, .cff-wordmark) { color: var(--link) !important; }
:root[data-theme="light"] .cff-shell > :not(.cff-side),
:root[data-theme="contrast"] .cff-shell > :not(.cff-side) { background-color: var(--night-2) !important; }

/* tables: header rows, striping, cell rules */
:root[data-theme="light"] body:not(.landing) tr:nth-child(even) > td,
:root[data-theme="contrast"] body:not(.landing) tr:nth-child(even) > td { background-color: var(--stripe) !important; }
:root[data-theme="light"] body:not(.landing) th,
:root[data-theme="light"] body:not(.landing) tr:first-child > td[class] {
  background-color: var(--night-3) !important;
  font-weight: 700;
}
:root[data-theme="light"] body:not(.landing) td, :root[data-theme="light"] body:not(.landing) th { border-bottom: 1px solid var(--rule); }

/* controls inside old pages */
:root[data-theme="light"] body:not(.landing) input[type="submit"], :root[data-theme="light"] body:not(.landing) input[type="button"],
:root[data-theme="light"] body:not(.landing) button:not(.cff-theme button, .cff-menu-btn),
:root[data-theme="contrast"] body:not(.landing) input[type="submit"], :root[data-theme="contrast"] body:not(.landing) input[type="button"],
:root[data-theme="contrast"] body:not(.landing) button:not(.cff-theme button, .cff-menu-btn) {
  background: var(--maillot) !important;
  color: var(--maillot-ink) !important;
  border: 2px solid var(--maillot) !important;
}
:root[data-theme="light"] body:not(.landing) input:not([type="submit"], [type="button"], [type="image"], [type="checkbox"], [type="radio"]),
:root[data-theme="light"] body:not(.landing) select, :root[data-theme="light"] body:not(.landing) textarea,
:root[data-theme="contrast"] body:not(.landing) input:not([type="submit"], [type="button"], [type="image"], [type="checkbox"], [type="radio"]),
:root[data-theme="contrast"] body:not(.landing) select, :root[data-theme="contrast"] body:not(.landing) textarea {
  background: var(--input-bg) !important;
  color: var(--input-ink) !important;
  border: 2px solid var(--rule) !important;
}
/* old pill-style links (class buttono / buttono2 / buttonox) */
:root[data-theme="light"] body:not(.landing) a[class^="buttono"], :root[data-theme="contrast"] body:not(.landing) a[class^="buttono"] {
  display: inline-block;
  padding: 4px 12px;
  border: 2px solid var(--link) !important;
  border-radius: 999px;
}

/* ---- high contrast extras ------------------------------------------------- */
:root[data-theme="contrast"] .cff-top { border-bottom: 3px solid #fff; }
:root[data-theme="contrast"] .cff-profile { fill: #000; stroke: #fff; stroke-width: 2; }
:root[data-theme="contrast"] body a:not(.cff-wordmark) { text-decoration: underline !important; text-underline-offset: 2px; }
:root[data-theme="contrast"] .cff-alerts a { border-color: #fff; }
:root[data-theme="contrast"] .cff-stage,
:root[data-theme="contrast"] div#content,
:root[data-theme="contrast"] .cff-nav__group ul { border: 2px solid #fff !important; }
:root[data-theme="contrast"] body td, :root[data-theme="contrast"] body th { border: 1px solid #fff !important; }
:root[data-theme="contrast"] :focus-visible { outline: 3px solid var(--focus) !important; outline-offset: 3px; }

/* ---- light extras ---------------------------------------------------------- */
:root[data-theme="light"] .cff-nav { background: #fff; }
:root[data-theme="light"] .cff-side h2 { color: var(--team-red); }
:root[data-theme="light"] .cff-stage { border-left-color: var(--team-red); }
:root[data-theme="light"] .cff-stage__num { background: var(--text); color: #fff; }
:root[data-theme="light"] .landing__title { color: var(--text); }

/* ---- squad page (plantilla.php) ------------------------------------------ */
#content .cff-squad-title { margin: 0 0 10px; font-size: 24px; color: var(--maillot); }
.cff-squad-extra { margin: 18px 0; font-size: 14px; line-height: 1.6; }
.cff-squad-extra select { margin: 6px 0; }
.cff-squad-ad { margin: 12px 0; max-width: 100%; overflow: hidden; }
.cff-squad-note { margin: 18px 0; color: var(--maillot); font-weight: 600; }

/* ---- pages whose boxes sat side by side with absolute positions ---------- */
.cff-cols { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px 24px; }
.cff-cols > * { min-width: 0; max-width: 100%; }
.cff-cols > div[id] { margin: 0 !important; }
.cff-cols__main { flex: 1 1 380px; max-width: 640px; min-width: 0; overflow-x: auto; }
.cff-cols__main table[width] { width: 100% !important; max-width: 100%; }
.cff-cols > #twitter2 { flex: 0 1 280px; }
.cff-cols > #twitter2 table { width: 100% !important; }
.cff-cols > #twitter { flex: 0 1 260px; }
.cff-cols__side, .cff-cols > div[id] { flex: 0 1 auto; }
@media (max-width: 700px) { .cff-cols > * { flex: 1 1 100%; } }

/* team page sub-menu (.menuu2_div / .menuu_div): was pinned at a fixed spot
   by cyclingmanager.css; now a row of links at the top of the content */
.cff-shell .menuu2_div ul, .cff-shell .menuu_div ul {
  position: static !important;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: auto !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  text-indent: 0 !important;
  font: 600 14px var(--body) !important;
}
.cff-shell .menuu2_div ul li, .cff-shell .menuu_div ul li {
  background: var(--night-3) !important;
  border: 1px solid var(--rule) !important;
  border-radius: 999px;
  line-height: 1.2 !important;
}
.cff-shell .menuu2_div ul li a, .cff-shell .menuu_div ul li a { padding: 6px 12px; color: var(--text) !important; border-radius: 999px; }
.cff-shell .menuu2_div ul li a:hover, .cff-shell .menuu_div ul li a:hover { background: var(--maillot) !important; color: var(--maillot-ink) !important; }

/* section tabs on race pages (Tramo 1..5: a.buttono, current one a.buttonox).
   The old gradient background no longer renders, so draw them as pills. */
.cff-shell a.buttono, .cff-shell a.buttonox {
  display: inline-block;
  width: auto !important;
  min-width: 96px;
  margin: 0 6px 8px 0;
  padding: 6px 14px !important;
  border: 2px solid var(--team-red) !important;
  border-radius: 999px !important;
  background: var(--team-red) !important;
  box-shadow: none !important;
  color: #fff !important;
  font: 700 15px/1.2 var(--display) !important;
  text-align: center;
  text-shadow: none !important;
  text-decoration: none;
}
.cff-shell a.buttono:hover { border-color: var(--maillot) !important; }
.cff-shell a.buttonox { background: var(--maillot) !important; border-color: var(--maillot) !important; color: var(--maillot-ink) !important; }
.cff-tabs { display: flex; flex-wrap: wrap; margin: 8px 0 12px; }

/* ---- rider page (vision.php) --------------------------------------------- */
.rider-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin: 0 0 18px;
  padding: 18px 20px;
  background: var(--night-3);
  border: 1px solid var(--rule);
  border-left: 6px solid var(--maillot);
  border-radius: var(--radius);
}
#content2 .rider-hero div[id], #content .rider-hero div[id] {
  display: block; width: auto !important; margin: 0 !important; padding: 0;
}
.rider-hero #logo:empty { display: none !important; }
.rider-hero #logo img { width: 72px; height: 72px; object-fit: contain; }
.rider-hero #bandera img { width: 44px; height: 33px; border-radius: 4px; box-shadow: 0 0 0 1px var(--rule); }
.rider-hero #namecab { flex: 1 1 260px; }
.rider-hero #namecab p { margin: 0 !important; text-align: left !important; }
.rider-hero #namecab br { display: none; }
.rider-hero h22 {
  display: block;
  font: 800 italic 34px/1.05 var(--display) !important;
  letter-spacing: 0 !important;
  color: var(--text) !important;
}
.rider-hero #namecab h3 { margin: 4px 0 0; font: 700 20px var(--display); }
.rider-hero #namecab h3 a { color: var(--maillot) !important; }
.rider-hero #iconos { display: flex !important; flex-wrap: wrap; align-items: center; gap: 6px; }
.rider-hero #iconos img { width: 34px; height: 34px; object-fit: contain; }
.rider-hero__side { display: flex !important; flex-wrap: wrap; align-items: center; gap: 10px; margin-left: auto !important; }
.rider-hero__side > a img { width: 30px; height: 30px; }
.rider-hero__side > br { display: none; }
.rider-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.rider-chips > div { min-width: 82px; padding: 6px 12px; background: var(--night-2); border: 1px solid var(--rule); border-radius: 10px; }
.rider-chips dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.rider-chips dd { margin: 0; font: 700 22px/1.1 var(--display); color: var(--text); }

.rider-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 0 18px; }
.rider-actions:empty { display: none; }
.rider-action {
  display: flex; flex-direction: column; gap: 6px;
  min-width: 200px; padding: 12px 14px;
  background: var(--night-3); border: 1px solid var(--rule); border-radius: var(--radius);
  font-weight: 600;
}
.rider-action br { display: none; }
.rider-action form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0; }
.rider-action input[type="text"] { width: 140px !important; }
.rider-action input[type="submit"] {
  padding: 6px 16px; border: 0; border-radius: 999px;
  background: var(--maillot); color: var(--maillot-ink); font: 700 15px var(--display); cursor: pointer;
}
.rider-action p { margin: 4px 0; text-align: left !important; }

.rider-grid { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 20px; }
.rider-grid > div[id] {
  margin: 0 !important; padding: 16px !important;
  background: var(--night-3); border: 1px solid var(--rule) !important; border-radius: var(--radius) !important;
}
.rider-grid table[width] { max-width: 100%; }
@media (max-width: 700px) {
  .rider-hero h22 { font-size: 28px !important; }
  .rider-hero__side { margin-left: 0 !important; }
  .rider-action, .rider-grid > div[id] { flex: 1 1 100%; }
}
.rider-hero #namecab h3, .rider-hero #namecab h3 * { background: transparent !important; }
.rider-grid #trofeos { order: -1; }
.rider-grid #trofeos table { font-size: 14px !important; }
.rider-grid #resultados table { font-size: 14px !important; }
.rider-grid td { padding: 3px 6px; }
.rider-grid #trofeos td.fondo, .rider-grid #resultados td.fondo { font-size: 13px; }

/* ad slots in old pages are inline-block: links printed next to them (race
   section tabs, buttons) wrapped around the ad. Give every ad its own row. */
.cff-shell ins.adsbygoogle { display: block !important; max-width: 100%; margin: 12px 0; }

/* rider skills as bars */
.rider-skills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; min-width: min(420px, 100%); }
.rider-skill { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 2px 8px; }
.rider-skill span { color: var(--muted); font-size: 14px; }
.rider-skill b { font: 700 20px/1 var(--display); color: var(--text); }
.rider-skill i, .rider-meter i {
  grid-column: 1 / -1; display: block; height: 8px; border-radius: 999px;
  background: linear-gradient(90deg, var(--bar) var(--v), var(--night-2) var(--v));
  box-shadow: inset 0 0 0 1px var(--rule);
}
.rider-skill { --bar: #6c7aa8; }
.rider-skill--t1 { --bar: #4f9d69; }
.rider-skill--t2 { --bar: #8fbf3f; }
.rider-skill--t3 { --bar: #f2c230; }
.rider-skill--t4 { --bar: #f08a24; }
.rider-skill--t5 { --bar: #e5383b; }
.rider-skill--t4 b, .rider-skill--t5 b { color: var(--maillot); }
.rider-condition { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule); }
.rider-meter { display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; }
.rider-meter span { color: var(--muted); font-size: 14px; }
.rider-meter b { font: 700 18px/1 var(--display); }
.rider-meter i { height: 10px; }
.rider-meter--good { --bar: #2fa36b; }
.rider-meter--ok { --bar: #f2c230; }
.rider-meter--low { --bar: #e5383b; }
.rider-copy { margin: 12px 0 0; font-size: 13px; text-align: right; }
:root[data-theme="contrast"] .rider-skill i, :root[data-theme="contrast"] .rider-meter i { box-shadow: inset 0 0 0 1px #fff; }
@media (max-width: 480px) { .rider-skills { grid-template-columns: 1fr 1fr; gap: 8px 12px; } }

/* rider page: old section headings (h1/h4 bars) as clean card headings */
.rider-grid h1, .rider-grid h4 {
  margin: 18px 0 10px !important; padding: 0 0 6px !important;
  background: none !important; border: 0; border-bottom: 1px solid var(--rule) !important;
  color: var(--maillot) !important; font: 700 20px/1.1 var(--display) !important; text-align: left !important;
}
.rider-grid > div[id] > h1:first-child, .rider-grid > div[id] > table:first-child h4 { margin-top: 0 !important; }
.rider-grid h1 p, .rider-grid h4 p { margin: 0; text-align: left !important; }
.rider-grid h3 { margin: 4px 0; background: none !important; color: var(--text) !important; font: 700 17px var(--display) !important; }
.rider-grid table, .rider-grid td { background: transparent !important; }
.rider-grid table[width] { width: 100% !important; }
.rider-grid td.fondo {
  background: var(--night-2) !important; color: var(--muted) !important;
  border-radius: 8px; font: 600 13px var(--body) !important; padding: 6px 4px;
}
.rider-grid #resultados { flex: 1 1 280px; max-width: 420px; }
.rider-grid #trofeos { flex: 1 1 440px; }
.rider-grid td { font-size: 14px; line-height: 1.4; }

/* ==== data tables (all themes) ==============================================
   The old pages colour every cell (fondo* = red/grey header cells, tabla* /
   subra rows = navy with 9-10px text, per-page <style> blocks too). Any table
   with a header row (td.fondo* or th) now gets one calm style: header row,
   readable rows, zebra, hover, and a tint only where the colour meant something
   (own team, promotion, relegation, skill tiers). Clicking a header sorts
   (js/sortable-tables.js). */
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) {
  border-collapse: collapse !important;
  border-spacing: 0 !important;
  border: 0 !important;
}
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr { background: transparent !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > :is(td[class^="fondo"], th) {
  padding: 8px 10px !important;
  background: var(--night-3) !important;
  color: var(--muted) !important;
  border: 0 !important;
  border-bottom: 2px solid var(--rule) !important;
  font: 700 13px/1.25 var(--body) !important;
  text-align: center;
  white-space: nowrap;
}
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > :is(td[class^="fondo"], th) a { color: var(--text) !important; text-decoration: underline dotted; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]) {
  padding: 7px 10px !important;
  background: transparent !important;
  color: var(--text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  font: 400 14px/1.35 var(--body) !important;
}
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]) :is(font, span[class^="t-"]) { font-size: inherit !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr:nth-child(even) > td:not([class^="fondo"]) { background: var(--stripe) !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr:hover > td:not([class^="fondo"]) { background: var(--night-3) !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]) a { color: var(--link, var(--maillot)) !important; }

/* colours that carried meaning */
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]):is(.tabla41, .tabla8, .tabla12, .tabla15, .fondo3) { background: color-mix(in srgb, var(--maillot) 22%, transparent) !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]):is(.tabla4, .tablax2) { background: color-mix(in srgb, #2fa36b 26%, transparent) !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]):is(.tabla5, .tabla13, .tabla14, .tablann3, .tablan, .tabla27, .tabla28) { background: color-mix(in srgb, #e5383b 24%, transparent) !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tablar { color: #e5383b !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tabla51 { color: #8fbf3f !important; font-weight: 600 !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tabla52 { color: #c9a227 !important; font-weight: 600 !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tabla53 { color: #e09a1e !important; font-weight: 700 !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tabla54 { color: #e8742a !important; font-weight: 700 !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]).tabla55 { color: #e5383b !important; font-weight: 800 !important; }

html:root body:not(.landing) .cff-shell table.cff-sortable > tbody > tr > td:nth-child(-n+2) { white-space: nowrap; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td img { vertical-align: middle; }

/* sortable headers */
.cff-sortable td.cff-sort, .cff-sortable th.cff-sort { cursor: pointer; user-select: none; }
.cff-sortable .cff-sort::after { content: " \2195"; opacity: .45; font-size: .9em; }
.cff-sortable .cff-sort[aria-sort="ascending"]::after { content: " \25B2"; opacity: 1; }
.cff-sortable .cff-sort[aria-sort="descending"]::after { content: " \25BC"; opacity: 1; }
html:root body:not(.landing) .cff-shell .cff-sortable .cff-sort:hover,
html:root body:not(.landing) .cff-shell .cff-sortable .cff-sort[aria-sort$="ending"] { color: var(--text) !important; }
.cff-sortable .cff-sort:focus-visible { outline: 2px solid var(--maillot); outline-offset: -2px; }
.admin .table th.cff-sort:hover { color: var(--text); }

/* ---- icons ------------------------------------------------------------------
   Most game icons (medals, specialists, weather, cards) are JPG/GIF drawn on a
   navy square. "lighten" lets the panel colour show through that square in
   every theme (navy is darker than any of our panels) while the icon keeps its
   colours; a small radius and a touch of softness take off the hard edge. */
.cff-shell img[src*="imagenes/"]:not([src$=".png"]),
.cff-side img[src*="imagenes/"]:not([src$=".png"]) {
  mix-blend-mode: lighten;
  border-radius: 6px;
  filter: saturate(1.05) brightness(1.08);
}
/* on the light theme "lighten" would wash the icons out: keep them as soft tiles */
:root[data-theme="light"] .cff-shell img[src*="imagenes/"]:not([src$=".png"]),
:root[data-theme="light"] .cff-side img[src*="imagenes/"]:not([src$=".png"]) {
  mix-blend-mode: normal; filter: brightness(1.35) saturate(1.1); box-shadow: 0 1px 2px rgba(10, 18, 56, .25);
}
/* keep the rider bars in light / high contrast (the legacy repaint clears backgrounds) */
html:root body:not(.landing) .cff-shell .rider-skill i,
html:root body:not(.landing) .cff-shell .rider-meter i {
  background: linear-gradient(90deg, var(--bar) var(--v), var(--night-3) var(--v)) !important;
}
html:root body:not(.landing) .cff-shell .rider-chips > div,
html:root body:not(.landing) .cff-shell .rider-action,
html:root body:not(.landing) .cff-shell .rider-hero { background: var(--night-3) !important; }
:root[data-theme="light"] .rider-hero #namecab h3 a { color: var(--link) !important; }

/* data tables fill the card and shrink instead of scrolling: header labels may
   wrap, and tables with many columns get tighter cells */
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) { width: 100% !important; max-width: 100%; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > :is(td[class^="fondo"], th) { white-space: normal; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th):has(> tbody > tr > :nth-child(9)) > * > tr > td { padding: 6px 5px !important; font-size: 13px !important; }
.cff-ad { clear: both; }
.cff-ad ins.adsbygoogle { overflow: hidden; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th):has(> tbody > tr > :nth-child(13)) > * > tr > td { padding: 5px 3px !important; font-size: 12px !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th):has(> tbody > tr > :nth-child(13)) > * > tr > :is(td[class^="fondo"], th) { font-size: 11.5px !important; letter-spacing: 0; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th):has(> tbody > tr > :nth-child(13)) select { max-width: 110px; min-height: 28px !important; padding: 2px 4px !important; font-size: 12px !important; }
.cff-sortable .cff-sort::after { white-space: nowrap; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th):has(> tbody > tr > :nth-child(13)) > * > tr > :is(td[class^="fondo"], th) { hyphens: auto; -webkit-hyphens: auto; }
html:root body:not(.landing) .cff-shell table.cff-sortable:has(> tbody > tr > :nth-child(13)) > tbody > tr > td:nth-child(-n+2) { white-space: normal; }
#content table[width], #content2 table[width] { max-width: 100%; }

/* ---- team page (team.php) ------------------------------------------------- */
.team-hero h22 a { color: var(--text) !important; text-decoration: none; }
.team-hero #bandera { display: flex !important; flex-direction: column; align-items: center; gap: 8px; }
.team-hero #bandera br { display: none; }
.team-hero #namecab p { margin: 2px 0 !important; }
.team-hero .team-level { display: grid; max-width: 280px; margin-top: 8px; text-decoration: none; color: var(--text); }
.team-hero .team-level span { color: var(--muted); font-size: 13px; }
.team-hero .rider-hero__side { flex-direction: column; align-items: flex-end; }
.team-chips dd a { color: var(--text) !important; text-decoration: none; }
.team-chips dd a:hover { color: var(--maillot) !important; }
.team-meta { margin: 0; color: var(--muted); font-size: 13px; text-align: right; }
.team-meta a { color: var(--maillot); }
/* supporter extras printed inside the team menu (best times, prestige, favourite stages) */
.cff-shell .menuu2_div ul li:has(table) {
  flex: 1 1 100%; border-radius: var(--radius) !important; padding: 10px 12px;
}
.cff-shell .menuu2_div ul > table, .cff-shell .menuu2_div ul li table { width: auto !important; }
@media (max-width: 700px) {
  .team-hero .rider-hero__side { align-items: flex-start; }
  .team-meta { text-align: left; }
}
.rider-grid > div[id] { min-width: 0; } .rider-grid table { max-width: 100% !important; table-layout: auto; } .rider-grid #resultados table td { padding-left: 2px !important; padding-right: 2px !important; }

/* phones: data tables keep their rows on one line and scroll sideways inside the card */
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) { display: block; width: auto !important; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > td { white-space: nowrap !important; }
}

/* theme switcher in the red top bar, left of the clock (desktop); on phones it
   stays in the menu drawer where there is room for it */
.cff-top__theme { margin-left: auto; display: flex; }
.cff-top__theme + .cff-clock { margin-left: 0; }
.cff-top .cff-theme { border-color: rgba(255, 255, 255, .35); background: rgba(0, 0, 0, .12); }
.cff-top .cff-theme button { color: var(--bar-ink); }
.cff-top .cff-theme button[aria-pressed="true"] { background: var(--maillot); color: var(--maillot-ink); }
.cff-nav__theme { display: none !important; }
.cff-nav__logout { margin-left: auto !important; }
@media (max-width: 899px) {
  .cff-top__theme { display: none; }
  .cff-top__theme + .cff-clock { margin-left: auto; }
  .cff-nav__theme { display: flex !important; }
}
:root[data-theme="contrast"] .cff-top .cff-theme { border-color: #fff; background: #000; }
.team-chips .team-chip--supporter { border-color: var(--maillot) !important; }
.team-chips .team-chip--supporter dt { color: var(--maillot); }
.team-admin { margin: 6px 0 0; text-align: right; }
.team-admin .cff-button { margin: 0; padding: 6px 14px; font-size: 15px; }
.team-extras { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 6px 24px; margin: 0 0 18px; padding: 14px 16px; background: var(--night-3); border: 1px solid var(--rule); border-radius: var(--radius); }
.team-extras .team-extra__title { flex: 1 1 100%; margin: 6px 0 0; font: 700 17px var(--display); color: var(--maillot); }
.team-extras .team-extra__title a { color: var(--maillot) !important; }
.team-extras table { width: auto !important; }
.team-extras table img[src*="etapas/"] { border-radius: 6px; }
html:root body:not(.landing) .cff-shell .team-extras .team-extra__title { background: none !important; padding: 0 !important; border-bottom: 1px solid var(--rule); }
html:root body:not(.landing) .cff-shell .team-extras td { background: transparent !important; font: 400 14px/1.4 var(--body) !important; padding: 3px 8px !important; }

/* ---- calendars (newcalendar.php, totalcalendar2.php): one card per stage -- */
.cff-shell table.cff-cal, .cff-shell table.cff-cal > tbody { display: block; width: 100% !important; }
.cff-shell table.cff-cal tr.cff-cal__head { display: none; }
.cff-shell table.cff-cal > tbody > tr {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  margin: 0 0 12px; padding: 14px 18px;
  background: var(--night-3); border: 1px solid var(--rule); border-radius: var(--radius);
}
.cff-shell table.cff-cal > tbody > tr > td { display: block; padding: 0 !important; border: 0 !important; background: none !important; }
.cff-shell table.cff-cal > tbody > tr > td:first-child { flex: 0 0 44px; text-align: center; }
.cff-shell table.cff-cal > tbody > tr > td:first-child :is(font, span) { font: 800 italic 30px/1 var(--display) !important; color: var(--maillot) !important; }
.cff-shell table.cff-cal > tbody > tr > td:nth-child(2) { flex: 1 1 220px; min-width: 0; }
.cff-shell table.cff-cal h3 { margin: 0 0 2px; font: 700 20px/1.15 var(--display) !important; color: var(--text) !important; background: none !important; }
.cff-shell table.cff-cal td:nth-child(2) strong { color: var(--muted); font-weight: 600; }
.cff-shell table.cff-cal td:nth-child(2) br + br { display: none; }
.cff-shell table.cff-cal h1 { margin: 10px 0 4px; font: 700 15px var(--display) !important; color: var(--maillot) !important; background: none !important; }
.cff-shell table.cff-cal img[src*="etapas/"] { display: block; width: 280px; max-width: 100%; height: auto; border-radius: 8px; }
.cff-shell table.cff-cal > tbody > tr > td:nth-child(3) { flex: 0 1 280px; color: var(--muted); font-size: 13px; text-align: center; }
.cff-cal__riders { flex: 1 1 180px; }
.cff-cal__riders ul { margin: 0; padding: 0; list-style: none; columns: 1; }
.cff-cal__riders li { padding: 3px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.cff-cal__riders li:last-child { border-bottom: 0; }
.cff-cal__riders:not(:has(li)) { display: none !important; }
.cff-shell table.cff-cal > tbody > tr > td:last-child:not(:nth-child(3)) { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; align-items: stretch; }
.cff-shell table.cff-cal form { margin: 0; }
.cff-shell table.cff-cal td:last-child br { display: none; }
.cff-shell table.cff-cal input.buttono { width: 100%; }
@media (max-width: 700px) {
  .cff-shell table.cff-cal > tbody > tr > td:nth-child(3) { flex: 1 1 100%; }
  .cff-shell table.cff-cal img[src*="etapas/"] { width: 100%; }
  .cff-shell table.cff-cal > tbody > tr > td:last-child:not(:nth-child(3)) { flex: 1 1 100%; flex-direction: row; flex-wrap: wrap; }
}
/* calendar cards as a grid so the columns line up from card to card */
@media (min-width: 701px) {
  .cff-shell table.cff-cal > tbody > tr { display: grid; grid-template-columns: 44px minmax(0, 1fr) 280px; }
  .cff-shell table.cff-cal:has(.cff-cal__riders) > tbody > tr { grid-template-columns: 44px minmax(0, 1fr) 280px minmax(140px, 200px) 150px; }
  .cff-shell table.cff-cal:has(.cff-cal__riders) > tbody > tr > td:nth-child(3):last-child { grid-column: 3 / -1; }
  .cff-cal__riders:not(:has(li)) { display: block !important; visibility: hidden; }
}
.cff-shell table.cff-cal > tbody > tr > td:nth-child(2), .cff-shell table.cff-cal > tbody > tr > td:nth-child(2) * { text-align: left !important; }
.cff-shell table.cff-cal > tbody > tr > td:nth-child(2) p { margin: 0; }
/* status pages: both columns share the row (the squad box used to take its
   table's full width and drop under the info column) */
.cff-cols > .cff-cols__main { flex: 1 1 280px; max-width: 600px; }
.cff-cols > .cff-cols__side { flex: 1 1 300px; min-width: 0; }
.cff-cols > .cff-cols__side table { width: 100% !important; }

/* icons with width/height attributes inside table cells were squeezed by
   max-width:100% (thin, stretched); keep their size and aspect ratio */
#content td img[width][height], #content2 td img[width][height], #content5 td img[width][height],
.cff-shell td img[width][height] { max-width: none; object-fit: contain; }
img[width][height] { object-fit: contain; }

/* dropdown lists: the dark colour scheme paints the open list dark, while the
   options inherited the select's dark ink (invisible). Give options the input
   colours in every theme, on every page. */
select option, select optgroup { background-color: var(--input-bg) !important; color: var(--input-ink) !important; }
select { color: var(--input-ink); background-color: var(--input-bg); }

/* dropdowns inside data tables (race tactics, strategies) fit their column */
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) select { max-width: 128px; min-height: 32px !important; padding: 2px 6px !important; font-size: 13px !important; }

/* ---- transfer market (bucca.php) ----------------------------------------- */
.market { display: grid; grid-template-columns: minmax(200px, 240px) minmax(0, 1fr); gap: 20px; align-items: start; }
.market > div[id] { display: block !important; width: auto !important; margin: 0 !important; min-width: 0; }
.market > #iconos2 { grid-row: span 3; display: grid !important; gap: 14px; }
.market > #iconos2 > table:first-child { width: 100% !important; border-collapse: separate; border-spacing: 0 8px; }
.market > #iconos2 > table:first-child td { padding: 0; text-align: left !important; }
.market > #iconos2 > table:first-child a {
  display: flex; align-items: center; gap: 10px; padding: 8px 12px;
  background: var(--night-3); border: 1px solid var(--rule); border-radius: var(--radius);
  color: var(--text) !important; font-weight: 600; text-decoration: none;
}
.market > #iconos2 > table:first-child a:hover { border-color: var(--maillot); }
.market > #iconos2 > table:first-child a br { display: none; }
.market > #iconos2 > table:first-child a img { order: -1; width: 34px; height: 34px; object-fit: contain; border-radius: 6px; }
.market > #iconos2 table + table, .market > #iconos2 > table:not(:first-child) { width: 100% !important; }
.market-search { padding: 18px 20px !important; background: var(--night-3); border: 1px solid var(--rule) !important; border-radius: var(--radius) !important; }
.market-search center { display: none; }
.market-form h2 { margin: 0 0 12px; font: 800 italic 28px/1 var(--display); color: var(--text); }
.market-form fieldset { margin: 0 0 14px; padding: 0; border: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; }
.market-form legend { margin-bottom: 8px; color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: .04em; }
.market-range, .market-field { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: 6px; }
.market-field { grid-template-columns: 1fr minmax(0, 170px); }
.market-range span, .market-field span { font-weight: 600; color: var(--text); }
.market-range i { color: var(--muted); font-style: normal; }
#content2 .market-range input { width: 68px; min-height: 36px; text-align: center; }
#content2 .market-field input, #content2 .market-field select { width: 100%; min-height: 36px; }
.market-actions { display: flex; gap: 10px; align-items: center; }
.market-reset { background: transparent !important; color: var(--text) !important; border: 2px solid var(--rule) !important; }
.market > #pujas { grid-column: 2; }
@media (max-width: 800px) {
  .market { grid-template-columns: 1fr; }
  .market > #iconos2 { grid-row: auto; }
  .market > #pujas { grid-column: auto; }
}
.market > #iconos2 > table:first-child a { font-size: 15px !important; } .market > #iconos2 > table:first-child a :is(font, span) { font-size: inherit !important; }

/* old pages use <h1> as a 12px black-on-white bar; make it a real title */
.cff-shell h1 {
  margin: 4px 0 12px; padding: 0;
  background: none !important; color: var(--text) !important;
  font: 800 italic 26px/1.15 var(--display) !important; text-align: inherit;
}

/* ---- World Challenge (desafiando2.php / desafiando4.php) ------------------ */
.fio-hero {
  display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px;
  margin: 0 0 18px; padding: 16px 18px;
  background: var(--night-3); border: 1px solid var(--rule); border-left: 6px solid var(--maillot); border-radius: var(--radius);
}
.fio-hero__photo { width: 320px; max-width: 100%; height: auto; border-radius: 8px; }
.fio-hero__info { flex: 1 1 260px; display: grid; gap: 10px; justify-items: start; }
.fio-hero__info h1 { margin: 0 !important; font-size: 32px !important; }
.fio-hero__tour { margin: -6px 0 0; color: var(--muted); font-weight: 600; }
.fio-hero .rider-chips dd { display: flex; align-items: center; gap: 4px; }
.fio-hero form { margin: 0; }
.fio-run { margin: 0 !important; border: 0; cursor: pointer; font-size: 19px !important; padding: 10px 26px !important; }
/* results page: the yellow-bordered boxes of the old layout */
#content #fotop2 { padding: 12px !important; background: var(--night-3); border: 1px solid var(--rule) !important; border-radius: var(--radius) !important; }
#content span.gold, #content .gold { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--team-red); color: #fff; font-weight: 700; font-size: 13px; }
/* challenge results: one card per team, side by side */
#content td:has(> #fotop2) { display: flex; flex-wrap: wrap; gap: 12px; align-content: flex-start; }
#content #fotop2 table { width: 100% !important; }
#content #fotop2 h3 { margin: 6px 0; text-align: center; }
/* skill bars (bar.php) with their value as text */
.skill-bar { display: inline-flex; align-items: center; gap: 8px; }
.skill-bar b { min-width: 2ch; font: 700 15px var(--display); color: var(--maillot); }
:root[data-theme="light"] .skill-bar b { color: var(--link); }

/* tactics / strategy grids (a row of dropdowns per rider): share the card
   width equally instead of growing with the longest option ("Very Aggressive") */
.cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) { width: 100% !important; max-width: 100%; table-layout: fixed; }
.cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) > tbody > tr > td { padding-left: 4px !important; padding-right: 4px !important; overflow: hidden; }
.cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) select { width: 100% !important; max-width: 100% !important; min-width: 0; text-overflow: ellipsis; }
.cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) select { font-size: 13px !important; padding: 2px 2px 2px 6px !important; }
.cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) > tbody > tr > td:last-child:empty { width: 0; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) select {
  width: 100% !important; max-width: 100% !important; font-size: 13px !important; padding: 2px 0 2px 6px !important;
}
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td:nth-child(5) select) > tbody > tr > td:first-child { width: 12%; }

/* Tactics grids on phones (js/sortable-tables.js marks them .cff-tactics):
   one card per rider, every dropdown full width under its column title */
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics,
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; border: 0 !important; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__head { display: none !important; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row {
    display: grid !important; grid-template-columns: 1fr 1fr; gap: 8px 10px; align-items: end;
    margin: 0 0 12px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--night-3) !important;
  }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td {
    display: block !important; width: auto !important; padding: 0 !important; border: 0 !important;
    background: none !important; text-align: left !important; overflow: visible !important; order: 3;
  }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td br { display: none; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td[data-label]::before {
    content: attr(data-label); display: block; margin-bottom: 3px; font: 600 12px/1.2 var(--body);
    letter-spacing: .03em; text-transform: uppercase; color: var(--muted);
  }
  /* rider name across the top, effort counter next to it */
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__name {
    order: 1; grid-column: 1; align-self: center; font: 700 17px/1.2 var(--display); color: var(--text) !important;
  }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__name::before { display: none; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__info { order: 2; justify-self: end; align-self: center; text-align: right !important; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__info:empty { display: none !important; }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__info > div {
    display: inline-block; min-width: 3.5em; padding: 2px 8px; border-radius: 999px; color: #fff; font-weight: 700; text-align: center;
  }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row select {
    width: 100% !important; max-width: 100% !important; min-height: 40px; font-size: 15px !important;
    padding: 6px 8px !important; text-overflow: clip;
  }
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics form { margin: 0; }
}
/* ---- compact tactics table (preinscribir.php, lib/tactics.php) ----------
   One row per rider like the old table, each segment a small slider or a
   dropdown (switch above), copy/paste buttons next to the rider's name. */
.cff-ctactics { --lvl-0: #22c55e; --lvl-1: #84cc16; --lvl-2: #eab308; --lvl-3: #f59e0b; --lvl-4: #f97316; --lvl-5: #ef4444; margin: 8px 0 16px; }
.cff-tview { display: inline-flex; margin: 0 0 10px; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }
.cff-tview__btn { padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--text) !important; text-decoration: none !important; }
.cff-tview__btn + .cff-tview__btn { border-left: 1px solid var(--rule); }
.cff-tview__btn.is-active { background: var(--maillot); color: var(--maillot-ink) !important; }
html:root body:not(.landing) .cff-shell table.cff-ctactics__table { width: 100% !important; max-width: 100%; table-layout: fixed; border-collapse: collapse; }
.cff-shell table.cff-ctactics__table th { padding: 6px 4px !important; font-size: 12px; text-align: center; }
.cff-shell table.cff-ctactics__table th:first-child { width: 22%; text-align: left; }
.cff-shell table.cff-ctactics__table th:nth-child(2) { width: 12%; }
.cff-shell table.cff-ctactics__table th:nth-child(8) { width: 9%; }
.cff-shell table.cff-ctactics__table td { padding: 6px 4px !important; vertical-align: middle; border-top: 1px solid var(--rule); }
.cff-shell table.cff-ctactics__table tr.is-copied > td { background: color-mix(in srgb, var(--maillot) 12%, transparent) !important; }
.cff-shell table.cff-ctactics__table tr.is-pasted > td { animation: cff-tflash .7s ease-out; }
@keyframes cff-tflash { from { background: color-mix(in srgb, var(--maillot) 35%, transparent); } }
html:root body:not(.landing) .cff-shell table.cff-ctactics__table select { width: 100% !important; max-width: 100% !important; min-width: 0; }
.cff-shell table.cff-ctactics__table td.cff-tactics__name { font-weight: 600; }
.cff-ctactics__who { display: flex; align-items: center; gap: 6px; min-width: 0; }
.cff-ctactics[data-view="select"] table.cff-ctactics__table th:first-child { width: 18%; }
html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr > td:first-child { width: auto; }
.cff-ctactics__rider { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* copy / paste */
.cff-ttools { display: inline-flex; flex: none; gap: 4px; }
.cff-ttools button {
  width: 28px; height: 26px; padding: 0 !important; margin: 0 !important; display: inline-grid; place-items: center;
  border: 1px solid var(--rule) !important; border-radius: 6px !important; background: var(--night-3) !important;
  color: var(--text) !important; font-size: 14px !important; line-height: 1; cursor: pointer; box-shadow: none !important;
}
.cff-ttools button:hover:not(:disabled) { background: var(--maillot) !important; border-color: var(--maillot) !important; color: var(--maillot-ink) !important; }
.cff-ttools button:disabled { opacity: .35; cursor: default; }
/* small slider: coloured thumb + level name under it */
.cff-mini-slider { --lvl: var(--lvl-0); display: grid; gap: 2px; justify-items: stretch; }
.cff-mini-slider[data-level="1"] { --lvl: var(--lvl-1); } .cff-mini-slider[data-level="2"] { --lvl: var(--lvl-2); }
.cff-mini-slider[data-level="3"] { --lvl: var(--lvl-3); } .cff-mini-slider[data-level="4"] { --lvl: var(--lvl-4); }
.cff-mini-slider[data-level="5"] { --lvl: var(--lvl-5); }
.cff-mini-slider input[type=range] {
  -webkit-appearance: none; appearance: none; width: 100% !important; min-width: 0; height: 22px !important; margin: 0 !important;
  padding: 0 !important; border: 0 !important; background: transparent !important; cursor: pointer;
}
.cff-mini-slider input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--lvl-0), var(--lvl-2), var(--lvl-5)); }
.cff-mini-slider input[type=range]::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, var(--lvl-0), var(--lvl-2), var(--lvl-5)); }
.cff-mini-slider input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%;
  background: var(--lvl); border: 2px solid var(--night-2); box-shadow: 0 0 0 1px var(--rule), 0 1px 3px rgba(0,0,0,.4);
}
.cff-mini-slider input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--lvl); border: 2px solid var(--night-2); box-shadow: 0 0 0 1px var(--rule);
}
.cff-mini-slider input[type=range]:focus-visible { outline: 2px solid var(--maillot); outline-offset: 2px; border-radius: 4px; }
.cff-mini-slider output { font-size: 11px; line-height: 1.2; text-align: center; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cff-mini-slider[data-level="4"] output, .cff-mini-slider[data-level="5"] output { color: var(--text); font-weight: 600; }
/* effort counter */
.cff-ctactics__total { display: inline-block; min-width: 3.5em; padding: 2px 8px; border-radius: 999px; background: #15803d; color: #fff; font-weight: 700; text-align: center; }
.cff-ctactics__total.is-over { background: #b91c1c; }
.cff-ctactics__save { margin: 12px 0 0; text-align: center; }
/* light / high contrast repaint every element of old pages: keep these controls' own colours */
:root[data-theme] body:not(.landing) .cff-ctactics .cff-mini-slider input[type=range] { background: transparent !important; border: 0 !important; box-shadow: none !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-ttools button { background: var(--night-3) !important; color: var(--text) !important; border: 1px solid var(--rule) !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-ttools button:hover:not(:disabled) { background: var(--maillot) !important; color: var(--maillot-ink) !important; border-color: var(--maillot) !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-ctactics__total { background-color: #15803d !important; color: #fff !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-ctactics__total.is-over { background-color: #b91c1c !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-tview__btn.is-active { background-color: var(--maillot) !important; color: var(--maillot-ink) !important; }
:root[data-theme] body:not(.landing) .cff-ctactics tr.is-copied > td { background-color: color-mix(in srgb, var(--maillot) 18%, var(--night-2)) !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-mini-slider output { color: var(--muted) !important; }
:root[data-theme] body:not(.landing) .cff-ctactics .cff-mini-slider[data-level="4"] output,
:root[data-theme] body:not(.landing) .cff-ctactics .cff-mini-slider[data-level="5"] output { color: var(--text) !important; }
.cff-ctactics__status { min-height: 1.2em; margin: 6px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
/* Mobile (small screen, or a touch screen up to tablet size, which also
   covers phones showing the desktop site): a list, one item per rider,
   name / role / efforts on the first line and the five segments side by
   side under it. Desktop keeps the one-row-per-rider table. */
@media (max-width: 700px), (pointer: coarse) and (max-width: 1100px) {
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table,
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody { display: block !important; width: 100% !important; border: 0 !important; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr.cff-tactics__head { display: none !important; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr.cff-tactics__row {
    display: grid !important; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px 8px; align-items: center;
    margin: 0 0 8px; padding: 10px; border: 1px solid var(--rule); border-radius: var(--radius);
    background: var(--night-3) !important;
  }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr.cff-tactics__row.is-copied { border-color: var(--maillot); }
  /* (:has / :nth-child(n) / :not only lift specificity over the table striping rule) */
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table:has(> tbody > tr > th) > tbody > tr.cff-tactics__row:nth-child(n) > td:not(.cff-none) {
    display: block !important; width: auto !important; min-width: 0; padding: 0 !important; border: 0 !important; overflow: visible !important; text-align: left !important;
    background: transparent !important; animation: none;
  }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr > td.cff-tactics__name { grid-row: 1; grid-column: 1 / span 3; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr > td.cff-ctactics__rolecell { grid-row: 1; grid-column: 4 / span 2; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table--effort > tbody > tr > td.cff-ctactics__rolecell { grid-column: 4; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr > td.cff-tactics__info { grid-row: 1; grid-column: 5; justify-self: end; }
  html:root body:not(.landing) .cff-shell .cff-ctactics table.cff-ctactics__table > tbody > tr > td.cff-ctactics__seg::before {
    content: attr(data-label); display: block; margin-bottom: 1px; font: 600 10px/1.2 var(--body); letter-spacing: .03em;
    text-transform: uppercase; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .cff-ctactics__rider { font-size: 15px; }
}
/* phones with sliders: name / role / efforts on a 10-column grid so the
   role dropdown is wide enough; five segments of two columns each */
@media (max-width: 480px) {
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table > tbody > tr.cff-tactics__row { grid-template-columns: repeat(10, minmax(0, 1fr)); }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table > tbody > tr > td.cff-tactics__name { grid-column: 1 / span 5; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table > tbody > tr > td.cff-ctactics__rolecell { grid-column: 6 / span 5; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table--effort > tbody > tr > td.cff-ctactics__rolecell { grid-column: 6 / span 3; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table > tbody > tr > td.cff-tactics__info { grid-column: 9 / span 2; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="slider"] table.cff-ctactics__table > tbody > tr > td.cff-ctactics__seg { grid-column: span 2; }
}
/* phones with dropdowns: three segments per line so the level names fit */
@media (max-width: 480px) {
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table > tbody > tr.cff-tactics__row { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table > tbody > tr > td.cff-tactics__name { grid-column: 1 / span 3; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table > tbody > tr > td.cff-ctactics__rolecell { grid-column: 4 / span 3; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table--effort > tbody > tr > td.cff-ctactics__rolecell { grid-column: 4 / span 2; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table > tbody > tr > td.cff-tactics__info { grid-column: 6; }
  html:root body:not(.landing) .cff-shell .cff-ctactics[data-view="select"] table.cff-ctactics__table > tbody > tr > td.cff-ctactics__seg { grid-column: span 2; }
}
@media (pointer: coarse) {
  .cff-ttools button { width: 34px; height: 32px; font-size: 16px !important; }
  .cff-mini-slider input[type=range] { height: 30px !important; }
  .cff-mini-slider input[type=range]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -8px; }
  .cff-mini-slider input[type=range]::-moz-range-thumb { width: 18px; height: 18px; }
}

/* old fixed-size ad units (468x60, 728x90) never wider than the screen */
.cff-shell ins.adsbygoogle { max-width: 100% !important; overflow: hidden; }
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell table.cff-tactics.cff-tactics > tbody > tr.cff-tactics__row.cff-tactics__row > td.cff-tactics__info::before { display: inline; margin: 0 6px 0 0; }
}
/* desktop: give the dropdowns the room of the narrow effort column */
@media (min-width: 701px) {
  html:root body:not(.landing) .cff-shell table.cff-tactics > tbody > tr.cff-tactics__head > td:last-child:not(:nth-child(-n+5)) { width: 74px; }
}

/* Division standings: promotion (green) and relegation (red) places, from divisiones.suben/bajan */
:root { --zone-up: rgba(46, 204, 113, .28); --zone-up-edge: #2ecc71; --zone-down: rgba(231, 76, 60, .30); --zone-down-edge: #e74c3c; }
:root[data-theme="light"] { --zone-up: #dff5e7; --zone-up-edge: #1e8e4e; --zone-down: #fbe1de; --zone-down-edge: #c0392b; }
html:root body:not(.landing) :is(#content, .cff-shell) table tr.cff-zone--up > td { background: var(--zone-up) !important; }
html:root body:not(.landing) :is(#content, .cff-shell) table tr.cff-zone--down > td { background: var(--zone-down) !important; }
html:root body:not(.landing) :is(#content, .cff-shell) table tr.cff-zone--up > td:first-child { box-shadow: inset 4px 0 0 var(--zone-up-edge); }
html:root body:not(.landing) :is(#content, .cff-shell) table tr.cff-zone--down > td:first-child { box-shadow: inset 4px 0 0 var(--zone-down-edge); }
:root[data-theme="contrast"] body:not(.landing) table tr.cff-zone--up > td:first-child::after { content: " ▲"; }
:root[data-theme="contrast"] body:not(.landing) table tr.cff-zone--down > td:first-child::after { content: " ▼"; }
.cff-zone-legend { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; margin: 8px 0 12px; font-size: 14px; color: var(--muted); }
.cff-zone-key { display: inline-block; width: 14px; height: 14px; margin-right: 6px; vertical-align: -2px; border-radius: 3px; }
.cff-zone-key--up { background: var(--zone-up-edge); }
.cff-zone-key--down { background: var(--zone-down-edge); }
.team-chips .team-chip--up { box-shadow: inset 0 -3px 0 var(--zone-up-edge); }
.team-chips .team-chip--down { box-shadow: inset 0 -3px 0 var(--zone-down-edge); }

/* Phones: stacked layout tables (js/sortable-tables.js adds .cff-stack) */
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell table.cff-stack,
  html:root body:not(.landing) .cff-shell table.cff-stack > tbody,
  html:root body:not(.landing) .cff-shell table.cff-stack > tbody > tr,
  html:root body:not(.landing) .cff-shell table.cff-stack > tbody > tr > td {
    display: block !important; width: auto !important; max-width: 100% !important; min-width: 0 !important; height: auto !important;
  }
  html:root body:not(.landing) .cff-shell table.cff-stack > tbody > tr > td { padding: 8px 0 !important; text-align: center; }
  html:root body:not(.landing) .cff-shell table.cff-stack img { max-width: 100% !important; height: auto !important; }

  /* wide data tables scroll sideways on their own, name column pinned */
  html:root body:not(.landing) .cff-shell table.cff-sortable:not(.cff-tactics) {
    display: block !important; max-width: 100% !important; width: auto !important; overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  html:root body:not(.landing) .cff-shell table.cff-sortable:not(.cff-tactics) > tbody > tr > :first-child {
    position: sticky; left: 0; z-index: 1; background-color: var(--night-2) !important;
  }
  html:root body:not(.landing) .cff-shell table.cff-sortable:not(.cff-tactics) > tbody > tr > td.fondo:first-child,
  html:root body:not(.landing) .cff-shell table.cff-sortable:not(.cff-tactics) > tbody > tr > th:first-child { background-color: var(--night-3) !important; }
}
/* hidden tooltips (.tip span) took up room off-screen and made the page scroll sideways */
#content .tip span { display: none; max-width: min(23em, 80vw); }
#content .tip:hover span, #content .tip:focus span { display: block; }

/* Phones: denser tables (less padding, smaller type) so most fit without scrolling */
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell { padding-left: 6px; padding-right: 6px; }
  html:root body:not(.landing) div#content { padding: 8px !important; }
  html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > :is(td[class^="fondo"], th) {
    padding: 5px 3px !important; font: 700 11px/1.15 var(--body) !important; white-space: normal; letter-spacing: -.01em;
  }
  html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]) {
    padding: 4px 3px !important; font: 400 12.5px/1.25 var(--body) !important;
  }
  html:root body:not(.landing) .cff-shell table td { padding-left: 3px !important; padding-right: 3px !important; }
  html:root body:not(.landing) .cff-shell table { font-size: 13px; }
  /* flags and small icons inside table cells */
  html:root body:not(.landing) .cff-shell td img:is([width="30"], [width="35"], [width="40"], [height="30"], [height="40"]) { width: 22px !important; height: auto !important; }
  html:root body:not(.landing) .cff-shell td img:is([width="20"], [width="25"]) { width: 16px !important; height: auto !important; }
  html:root body:not(.landing) .cff-shell .skill-bar { gap: 4px; }
  html:root body:not(.landing) .cff-shell .skill-bar img { width: 48px !important; height: auto !important; }
}
@media (max-width: 700px) {
  /* the ↕ hint takes a column's worth of room on 20-column tables; keep only ▲/▼ once sorted */
  .cff-sortable .cff-sort[aria-sort="none"]::after { content: none; }
  html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr > :is(td[class^="fondo"], th) { font-size: 10.5px !important; }
  html:root body:not(.landing) #content select { max-width: 100% !important; }
  html:root body:not(.landing) #content input:not([type="checkbox"], [type="radio"], [type="image"]) { max-width: 100% !important; }
}
@media (max-width: 700px) {
  html:root body:not(.landing) .cff-shell table.cff-tactics td form { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
  html:root body:not(.landing) .cff-shell table.cff-tactics td form select { flex: 1 1 100%; min-width: 0; }
}

/* ---- Installable app ---------------------------------------------------- */
.cff-install-btn { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--rule); background: transparent;
  color: var(--text); padding: 8px 12px; border-radius: 999px; font: 600 14px var(--body); cursor: pointer; }
.cff-install-btn:hover { border-color: var(--maillot); color: var(--maillot); }
.cff-install-btn[hidden], [data-cff-install][hidden] { display: none !important; }
.landing__install { display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--rule); background: var(--night-3); color: var(--text); font: 600 15px var(--body); cursor: pointer; }
.landing__install img { border-radius: 7px; }
.cff-install-ios { max-width: 340px; border: 1px solid var(--rule); border-radius: 16px; background: var(--night-2); color: var(--text);
  padding: 22px; text-align: center; box-shadow: var(--shadow); }
.cff-install-ios::backdrop { background: rgba(0, 0, 0, .55); }
.cff-install-ios img { border-radius: 14px; }
.cff-install-ios h2 { font: 700 20px var(--display); margin: 10px 0 6px; }
.cff-install-ios svg { vertical-align: -4px; color: #3d8bff; }
.cff-install-banner { display: none; }
/* belt and braces if the banner is still inside #content (no JS yet) */
#cff-install-banner[hidden], .cff-install-ios:not([open]) { display: none !important; }
@media (max-width: 899px) {
  .cff-install-banner:not([hidden]) {
    display: flex; align-items: center; gap: 10px; position: fixed; left: 8px; right: 8px; bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 60; padding: 10px 12px; border-radius: 14px; background: var(--night-3); border: 1px solid var(--rule); box-shadow: var(--shadow);
  }
  .landing .cff-install-banner:not([hidden]) { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .cff-install-banner img { border-radius: 10px; flex: none; }
  .cff-install-banner div { flex: 1; min-width: 0; font-size: 13px; line-height: 1.3; }
  .cff-install-banner strong { display: block; font-size: 14px; }
  .cff-install-banner span { color: var(--muted); }
  .cff-install-banner .cff-button { padding: 8px 12px; font-size: 13px; white-space: nowrap; }
  .cff-install-banner__x { background: none; border: 0; color: var(--muted); font-size: 22px; line-height: 1; padding: 4px; cursor: pointer; }
}

/* ---- Phones: app-style bottom tab bar ------------------------------------ */
.cff-tabbar { display: none; }
@media (max-width: 899px) {
  .cff-tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom)); background: var(--night-2) !important; border-top: 1px solid var(--rule);
    box-shadow: 0 -6px 18px rgba(0, 0, 0, .35);
  }
  .cff-tabbar a { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px;
    color: var(--muted) !important; text-decoration: none !important; font: 600 10.5px/1.15 var(--body); text-align: center; border-radius: 10px; }
  .cff-tabbar a span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cff-tabbar svg { width: 24px; height: 24px; fill: currentColor; }
  .cff-tabbar a[aria-current="page"] { color: var(--maillot) !important; }
  .cff-tabbar a[aria-current="page"]::before { content: ""; position: absolute; top: -4px; width: 28px; height: 3px; border-radius: 3px; background: var(--maillot); }
  .cff-tabbar__dot { position: absolute; top: 4px; left: calc(50% + 6px); width: 9px; height: 9px; border-radius: 50%; background: var(--team-red); box-shadow: 0 0 0 2px var(--night-2); }
  body:has(.cff-tabbar) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  /* compact top bar on phones */
  .cff-top { padding-top: calc(8px + env(safe-area-inset-top)); padding-bottom: 16px; }
  .cff-wordmark { font-size: 20px; }
}
:root[data-theme="light"] .cff-tabbar { background: #fff !important; }
:root[data-theme="light"] .cff-tabbar a[aria-current="page"] { color: var(--team-red) !important; }
:root[data-theme="light"] .cff-tabbar a[aria-current="page"]::before { background: var(--team-red); }
:root[data-theme="contrast"] .cff-tabbar { background: #000 !important; border-top: 2px solid #fff; }
/* installed app: no browser bar, so leave room for the phone's status bar */
.cff-standalone .cff-top { padding-top: calc(10px + env(safe-area-inset-top)); }

/* ---- "Hoy" / Today page (status1.php) ------------------------------------- */
.today { font-family: var(--body); }
.today__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 14px 24px; margin-bottom: 18px; }
.today__date { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .06em; text-transform: uppercase; }
.today h1 { margin: 2px 0; font: italic 800 32px/1.05 var(--display); color: var(--text); }
.today__team { margin: 0; font-size: 16px; }
.today__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.today__chips div { padding: 8px 14px; border-radius: 12px; background: var(--night-3); border: 1px solid var(--rule); min-width: 92px; }
.today__chips dt { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.today__chips dd { margin: 2px 0 0; font: 700 20px/1.1 var(--display); color: var(--text); }
.today__chips small { font: 400 12px var(--body); color: var(--muted); }
.today__chips .today__chip--up { box-shadow: inset 0 -3px 0 var(--zone-up-edge, #2ecc71); }
.today__chips .today__chip--down { box-shadow: inset 0 -3px 0 var(--zone-down-edge, #e74c3c); }
.today__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.today__card { padding: 16px 18px; border-radius: var(--radius); background: var(--night-3); border: 1px solid var(--rule); min-width: 0; }
.today__card h2 { margin: 0 0 10px; font: 700 18px/1.2 var(--display); color: var(--maillot); letter-spacing: .02em; }
.today__race img { width: 100%; height: auto; border-radius: 8px; display: block; margin-bottom: 10px; }
.today__race-name { margin: 0 0 4px; font-weight: 600; font-size: 16px; }
.today__when, .today__count { margin: 4px 0; font-size: 15px; }
.today__riders { list-style: none; margin: 8px 0; padding: 0; }
.today__riders li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.today__riders li a { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.today__tag { font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--maillot); color: var(--maillot-ink); font-weight: 700; }
.today__eff { font-variant-numeric: tabular-nums; padding: 1px 8px; border-radius: 999px; background: rgba(46, 204, 113, .25); font-size: 12px; font-weight: 700; }
.today__eff.is-over { background: rgba(231, 76, 60, .4); }
.today__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.cff-button--ghost { background: transparent !important; color: var(--text) !important; border: 1px solid var(--rule) !important; box-shadow: none !important; }
.today__todo ul { list-style: none; margin: 0; padding: 0; }
.today__item a { display: flex; align-items: center; gap: 10px; padding: 11px 12px; margin-bottom: 8px; border-radius: 10px;
  background: var(--night-2); border-left: 4px solid var(--rule); color: var(--text) !important; text-decoration: none !important; font-size: 14.5px; line-height: 1.35; }
.today__item a span { flex: 1; }
.today__item a b { color: var(--muted); font-size: 20px; }
.today__item--warn a { border-left-color: var(--team-red); }
.today__item--info a { border-left-color: var(--maillot); }
.today__item a:hover { background: var(--night); }
.today__done { margin: 0; padding: 14px; border-radius: 10px; background: rgba(46, 204, 113, .15); color: var(--text); font-weight: 600; }
.today__big { margin: 2px 0 6px; font: 800 38px/1 var(--display); color: var(--text); }
.today__big small { font: 400 15px var(--body); color: var(--muted); }
.today__zone { display: inline-block; margin: 0 0 6px; padding: 3px 10px; border-radius: 999px; font-weight: 700; font-size: 13px; }
.today__zone--up { background: var(--zone-up, rgba(46, 204, 113, .28)); }
.today__zone--down { background: var(--zone-down, rgba(231, 76, 60, .3)); }
.today__top { list-style: none; margin: 10px 0; padding: 0; }
.today__top li { display: flex; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--rule); font-size: 14px; }
.today__top li span { width: 2.2em; color: var(--muted); }
.today__top li b { margin-left: auto; font-variant-numeric: tabular-nums; }
.today__top li.is-me { color: var(--maillot); font-weight: 700; }
.today__link { display: inline-block; margin-top: 8px; font-weight: 600; }
.today__classic { margin: 18px 0 0; text-align: center; font-size: 13px; }
.today__classic a { color: var(--muted) !important; }
.today .muted { color: var(--muted); margin: 4px 0; font-size: 14px; }
@media (max-width: 760px) {
  .today__grid { grid-template-columns: minmax(0, 1fr); }
  .today__todo { order: -1; }   /* phones: the to-do list first */
  .today h1 { font-size: 26px; }
  .today__chips { width: 100%; }
  .today__chips div { flex: 1; min-width: 0; padding: 8px 10px; }
  .today__chips dd { font-size: 17px; }
}
:root[data-theme="light"] .today__card, :root[data-theme="light"] .today__chips div { background: #fff !important; }
:root[data-theme="light"] .today__item a { background: #f3f5fb !important; }
:root[data-theme="light"] .today__card h2 { color: var(--team-red) !important; }

/* Training (ent.php, concentracion.php): +1 / -1 markers keep their colours in
   the light and high-contrast themes (the theme reset made them transparent) */
:root[data-theme] body:not(.landing) :is(#content, #content2, #content5) span.verde { background-color: #1e8e4e !important; color: #fff !important; }
:root[data-theme] body:not(.landing) :is(#content, #content2, #content5) span.amarillo { background-color: #33cc66 !important; color: #06230f !important; }
:root[data-theme] body:not(.landing) :is(#content, #content2, #content5) span.rojo { background-color: #d62828 !important; color: #fff !important; }
:root[data-theme] body:not(.landing) :is(#content, #content2, #content5) span.rosa { background-color: #ff0066 !important; color: #fff !important; }
:root[data-theme="contrast"] body:not(.landing) :is(#content, #content2, #content5) :is(span.verde, span.amarillo, span.rojo, span.rosa) { outline: 2px solid #fff; }

/* ---- Mailbox (mensajeria.php) -------------------------------------------- */
.mail__tabs { display: flex; gap: 6px; margin: 0 0 14px; border-bottom: 1px solid var(--rule); }
.mail__tabs a { padding: 10px 14px; color: var(--muted) !important; text-decoration: none !important; font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.mail__tabs a[aria-current="page"] { color: var(--text) !important; border-bottom-color: var(--maillot); }
.mail__layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; }
.mail__list ul { list-style: none; margin: 0; padding: 0; border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.mail__item { display: flex; align-items: center; border-bottom: 1px solid var(--rule); background: var(--night-2); }
.mail__item:last-child { border-bottom: 0; }
.mail__item.is-current { background: var(--night-3); box-shadow: inset 3px 0 0 var(--maillot); }
.mail__open { flex: 1; min-width: 0; display: grid; grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "icon who when" "icon subject subject";
  gap: 2px 10px; align-items: center; padding: 10px 12px; color: var(--text) !important; text-decoration: none !important; }
.mail__open img { grid-area: icon; }
.mail__who { grid-area: who; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__subject { grid-area: subject; color: var(--muted); font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mail__open time { grid-area: when; color: var(--muted); font-size: 12px; white-space: nowrap; }
.mail__item.is-unread .mail__who, .mail__item.is-unread .mail__subject { color: var(--text); font-weight: 700; }
.mail__actions { display: flex; gap: 4px; padding-right: 8px; }
.mail__actions a { display: inline-flex; padding: 6px; border-radius: 8px; }
.mail__actions a:hover { background: var(--night); }
.mail__all { margin: 12px 0; text-align: center; }
.mail__empty { color: var(--muted); padding: 20px; text-align: center; border: 1px dashed var(--rule); border-radius: var(--radius); }
.mail__reader { padding: 16px 18px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--night-3); min-width: 0; overflow-wrap: anywhere; }
.mail__reader h2 { margin: 0 0 4px; font: 700 20px/1.25 var(--display); color: var(--text); }
.mail__reader header p { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.mail__body { font-size: 15px; line-height: 1.55; }
.mail__body img, .mail__body table { max-width: 100% !important; height: auto; }
.mail__body table { display: block; overflow-x: auto; }
.mail__back { display: none; }
@media (max-width: 760px) {
  .mail__layout { grid-template-columns: minmax(0, 1fr); }
  .mail--reading .mail__reader { order: -1; }        /* opened a message: read it first */
  .mail--reading .mail__back { display: inline-block; margin-bottom: 10px; font-weight: 600; }
  .mail:not(.mail--reading) .mail__reader { display: none; } /* list first on a phone */
  .mail__open time { font-size: 11px; }
}
:root[data-theme="light"] .mail__item, :root[data-theme="light"] .mail__reader { background: #fff !important; }
:root[data-theme="light"] .mail__item.is-current { background: #f3f5fb !important; }

/* ---- Text size (menu: A A A A) ------------------------------------------- */
:root[data-size="xs"] body { zoom: .8; }
:root[data-size="s"] body { zoom: .9; }
:root[data-size="l"] body { zoom: 1.12; }
.cff-nav__size { display: flex; align-items: center; padding: 0 8px; }
.cff-size { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border: 1px solid var(--rule); border-radius: 999px; }
.cff-size__label { display: none; }
.cff-size button { min-width: 30px; height: 30px; padding: 0 6px; border: 0; border-radius: 999px; background: transparent; color: var(--text);
  font-family: var(--body); font-weight: 700; line-height: 1; cursor: pointer; }
.cff-size .cff-size__xs { font-size: 11px; }
.cff-size .cff-size__s { font-size: 13px; }
.cff-size .cff-size__m { font-size: 15px; }
.cff-size .cff-size__l { font-size: 18px; }
.cff-size button[aria-pressed="true"] { background: var(--maillot); color: var(--maillot-ink); }
@media (max-width: 899px) {
  .cff-nav__size { padding: 12px 16px; border-bottom: 1px solid var(--rule); justify-content: space-between; }
  .cff-size { border: 0; padding: 0; width: 100%; justify-content: space-between; }
  .cff-size__label { display: inline; margin-right: auto; color: var(--muted); font-weight: 600; }
  .cff-size button { min-width: 40px; height: 40px; border: 1px solid var(--rule); margin-left: 6px; }
}

/* ---- Legal footer, legal pages, account deletion ------------------------- */
.cff-legal {
  clear: both; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px 18px; margin: 32px auto 0; padding: 18px 16px 28px; max-width: 1200px;
  border-top: 1px solid var(--rule); color: var(--muted); font: 13px/1.5 var(--body);
}
.cff-legal nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.cff-legal a { color: var(--muted) !important; text-decoration: none; }
.cff-legal a:hover, .cff-legal a:focus-visible { color: var(--link) !important; text-decoration: underline; }

.legal { max-width: 820px; margin: 0 auto; padding: 24px 16px 8px; font: 16px/1.6 var(--body); color: var(--text); }
.legal__bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.legal__tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.legal__tabs a { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 999px; color: var(--text) !important; text-decoration: none; font-size: 14px; }
.legal__tabs a[aria-current="page"] { background: var(--maillot); border-color: var(--maillot); color: var(--maillot-ink) !important; }
.legal__langs a { color: var(--muted) !important; margin-left: 10px; font-size: 14px; }
.legal__langs a[aria-current="true"] { color: var(--link) !important; font-weight: 600; }
.legal h1 { font: 700 34px/1.1 var(--display); margin: 0 0 4px; color: var(--text); }
.legal h2 { font: 600 21px/1.2 var(--display); margin: 28px 0 8px; color: var(--maillot); letter-spacing: .02em; }
.legal__updated { color: var(--muted); font-size: 14px; margin: 0 0 20px; }
.legal__note { padding: 10px 14px; border-left: 3px solid var(--maillot); background: var(--night-2); border-radius: 0 6px 6px 0; }
.legal ul { padding-left: 20px; }
.legal li { margin: 4px 0; }
.legal a { color: var(--link); }
.legal__facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 16px 0;
  padding: 14px 18px; background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.legal__facts dt { color: var(--muted); }
.legal__facts dd { margin: 0; }
.legal__missing { background: #ffd2001f; color: var(--maillot); padding: 0 4px; border-radius: 3px; }
.legal__scroll { overflow-x: auto; }
.legal__table { width: 100%; border-collapse: collapse; font-size: 14px; }
.legal__table th, .legal__table td { text-align: left; vertical-align: top; padding: 8px 10px; border-bottom: 1px solid var(--rule); }
@media (max-width: 560px) { .legal__facts { grid-template-columns: 1fr; } .legal__facts dd { margin-bottom: 8px; } }

.cff-accept { display: flex; gap: 10px; align-items: flex-start; max-width: 520px; margin: 14px 0; text-align: left; font-size: 14px; line-height: 1.45; }
.cff-accept input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--maillot); }

.erase { max-width: 560px; }
.erase__warn { padding: 12px 16px; border: 1px solid var(--team-red); border-left-width: 4px; border-radius: 6px; margin: 14px 0; }
.erase ul { padding-left: 20px; }
.erase label { display: block; margin: 12px 0 4px; }
.erase input[type="password"] { width: 100%; max-width: 320px; }
.erase .cff-danger { margin-top: 16px; padding: 10px 18px; background: var(--team-red) !important; color: #fff !important; border: 0 !important; border-radius: 6px; font-weight: 600; cursor: pointer; }
/* the footer lands inside the shell on pages that never close it */
.cff-shell > .cff-legal { grid-column: 1 / -1 !important; order: 9; width: 100%; margin-top: 8px; overflow: visible !important; background: none !important; }
:root[data-theme="light"] .cff-shell > .cff-legal, :root[data-theme="contrast"] .cff-shell > .cff-legal { background: none !important; }
:root[data-theme="light"] .legal h2 { color: var(--team-red); }
:root[data-theme="light"] .legal .cff-wordmark, :root[data-theme="contrast"] .legal .cff-wordmark { color: var(--text) !important; }
:root[data-theme="light"] .legal__missing { background: var(--maillot); color: var(--maillot-ink); }
:root[data-theme="contrast"] .legal h2 { color: var(--text); text-decoration: underline; }


/* Supporter contribution box (lib/supporter.php, js/supporter-paypal.js) */
.cff-support, #content #cff-support { display: block; box-sizing: border-box; width: 100%; max-width: 440px; margin: 12px auto 18px !important; padding: 16px 18px; text-align: left; border: 1px solid var(--rule); border-radius: var(--radius, 8px); font-size: 14px; line-height: 1.45; }
.cff-support h3 { margin: 0 0 6px; padding: 0; background: none !important; border: 0; font-size: 18px; color: var(--maillot); }
:root[data-theme="light"] .cff-support h3 { color: var(--text); }
.cff-support p { margin: 0 0 10px; }
.cff-support__team strong { color: var(--text); }
.cff-support__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 10px; }
.cff-support__chip input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.cff-support__chip span { display: inline-block; min-width: 56px; padding: 7px 12px; text-align: center; border: 1px solid var(--rule); border-radius: 999px; cursor: pointer; }
.cff-support__chip input:checked + span { background: var(--maillot); color: var(--maillot-ink); border-color: var(--maillot); font-weight: 600; }
.cff-support__chip input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.cff-support__other { display: block; margin: 0 0 10px; }
.cff-support__other[hidden] { display: none !important; }
.cff-support__other input { width: 110px; margin-left: 6px; padding: 6px 8px; background: var(--input-bg); color: var(--input-ink); border: 1px solid var(--rule); border-radius: 6px; font-size: 16px; }
.cff-support__msg:empty { display: none; }
.cff-support__msg--error { color: var(--team-red); font-weight: 600; }
.cff-support__msg--ok { color: var(--up, #3c9); font-weight: 600; }
#content #cff-support-buttons, #cff-support-buttons { display: block; width: 100% !important; margin: 0 !important; min-height: 45px; }

/* ---- rider portrait and physical profile (lib/portrait.php) ---------------- */
.rider-hero__portrait { margin: 0; flex: 0 0 auto; line-height: 0; }
.rider-hero__portrait svg { width: 120px; height: 120px; border-radius: 14px; box-shadow: 0 0 0 2px var(--maillot), var(--shadow); }
@media (max-width: 480px) { .rider-hero__portrait svg { width: 92px; height: 92px; } }
.rider-hero__portrait--placeholder img { display: block; width: 100px; height: 100px; border-radius: 14px; background: #8a8f9c; box-shadow: 0 0 0 2px var(--maillot); }
@media (max-width: 480px) { .rider-hero__portrait--placeholder img { width: 80px; height: 80px; } }
img.rider-portrait { border-radius: 8px; vertical-align: middle; margin-right: 6px; box-shadow: 0 0 0 1px var(--rule); }
.rider-physique { flex: 1 1 100%; }
.rider-physique__nick { margin: 0 0 10px; font-size: 15px; }
.rider-physique__nick strong { color: var(--maillot); font-family: var(--display); font-size: 20px; letter-spacing: .3px; }
.rider-physique__hidden { margin: 10px 0 0; font-size: 12px; opacity: .75; }
.rider-physique__edit { margin: 0 0 10px; font-size: 13px; }
.rider-physique__edit summary { cursor: pointer; color: var(--link); }
.rider-physique__edit form { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.rider-physique__edit input[type=text] { flex: 1 1 180px; padding: 6px 8px; font-size: 16px; background: var(--input-bg); color: var(--input-ink); border: 1px solid var(--rule); border-radius: 6px; }
.rider-physique dl { display: grid; gap: 8px; margin: 0 0 10px; }
.rider-physique__stats { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.rider-physique__fun { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.rider-physique dl > div { padding: 8px 10px; border: 1px solid var(--rule); border-radius: 8px; background: var(--stripe); }
.rider-physique dt { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .4px; }
.rider-physique dd { margin: 2px 0 0; font: 700 17px/1.2 var(--display); color: var(--text); }
.rider-physique__fun dd { font: 600 14px/1.3 var(--body); }
a.rider-name { white-space: nowrap; }

/* appearance editor (aspecto.php) */
.rider-hero__portrait figcaption { margin-top: 6px; line-height: 1.2; text-align: center; font-size: 12px; }
.aspect { max-width: 920px; margin: 0 auto; }
.aspect h1 { font: 700 24px var(--display); margin: 0 0 8px; }
.aspect__msg { padding: 8px 12px; border-left: 4px solid var(--maillot); background: var(--stripe); }
.aspect__note { font-size: 13px; opacity: .8; }
.aspect__grid { display: flex; flex-wrap: wrap; gap: 20px; align-items: flex-start; }
.aspect__preview { margin: 0; flex: 0 0 200px; position: sticky; top: 70px; line-height: 0; }
.aspect__preview svg { width: 200px; height: 200px; border-radius: 18px; box-shadow: 0 0 0 2px var(--maillot), var(--shadow); }
.aspect__form { flex: 1 1 320px; display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px 14px; }
.aspect__field { display: flex; flex-direction: column; gap: 4px; }
.aspect__field:first-of-type { grid-column: 1 / -1; }
.aspect__label { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.aspect__field select { padding: 7px 8px; font-size: 15px; background: var(--input-bg); color: var(--input-ink); border: 1px solid var(--rule); border-radius: 6px; }
.aspect__swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.aspect__swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.aspect__swatch span { display: block; width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--rule); cursor: pointer; }
.aspect__swatch input:checked + span { border-color: var(--maillot); box-shadow: 0 0 0 2px var(--maillot); }
.aspect__swatch input:focus-visible + span { outline: 2px solid var(--link); outline-offset: 2px; }
.aspect__actions { grid-column: 1 / -1; display: flex; gap: 12px; align-items: center; margin-top: 6px; }
@media (max-width: 560px) { .aspect__preview { position: static; flex-basis: 100%; display: flex; justify-content: center; } }
.aspect__actions .aspect__reset { background: transparent !important; color: var(--text) !important; border: 1px solid var(--rule) !important; }
@media (max-width: 560px) {
  .aspect__form { grid-template-columns: 1fr 1fr; gap: 8px 10px; }
  .aspect__field select { font-size: 14px; padding: 6px; }
  .aspect__swatch span { width: 26px; height: 26px; }
  .aspect__preview svg { width: 160px; height: 160px; }
}

/* end-of-season review on status1.php (lib/season_summary.php) */
.season .today__head { align-items: flex-start; }
.season__pick select { margin-left: 6px; padding: 6px 8px; font-size: 15px; background: var(--input-bg); color: var(--input-ink); border: 1px solid var(--rule); border-radius: 6px; }
.season__grid h2 small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 4px; }
.season__wide { grid-column: 1 / -1; }
.season__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.season__wide .season__list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px 18px; }
.season__list li { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; background: var(--stripe); min-width: 0; }
.season__list li.is-me { box-shadow: inset 3px 0 0 var(--maillot); }
.season__race { flex: 0 0 auto; font-weight: 700; font-size: 13px; color: var(--muted); max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season__who { flex: 1 1 auto; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.season__who small { color: var(--muted); }
.season__icon { width: 26px; height: 26px; border-radius: 4px; object-fit: cover; flex: 0 0 auto; }
.season__flag { width: 20px; height: 14px; border-radius: 2px; margin-right: 6px; vertical-align: -2px; box-shadow: 0 0 0 1px var(--rule); }
.season__note { font-size: 12px; margin-top: 6px; }
.season__nt { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.season__nt h3 { margin: 0 0 8px; padding: 0; font: 700 15px var(--display); color: var(--maillot); background: none !important; border: 0; }
.season__nt .season__list { grid-template-columns: 1fr; }
.season__sub { margin: 10px 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.season__gain { flex: 0 0 auto; min-width: 42px; text-align: center; padding: 3px 6px; border-radius: 6px; background: var(--maillot); color: var(--maillot-ink); font: 700 14px var(--display); }
.season__who--left { text-align: left; white-space: normal; }
.season__who--left small { display: inline-block; margin-top: 2px; }

/* El crack / El dandy / El desastre (lib/race_awards.php), sector 5 of carrera1.php / replay1sn.php */
.race-awards { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 12px auto 16px; max-width: 760px; }
.race-awards__card { flex: 1 1 200px; max-width: 240px; margin: 0; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; border: 1px solid var(--rule); border-radius: var(--radius, 10px); background: var(--stripe); }
.race-awards__card svg, .race-awards__ph { width: 96px; height: 96px; border-radius: 14px; box-shadow: 0 0 0 2px var(--maillot); }
.race-awards__ph { background: #8a8f9c; }
.race-awards__card figcaption { display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.race-awards__card strong { font: 700 17px var(--display); color: var(--maillot); text-transform: uppercase; letter-spacing: .5px; }
.race-awards__card--desastre strong { color: var(--team-red, #e5484d); }
.race-awards__card small { color: var(--muted); }
.race-awards__move { font-size: 13px; }
.race-awards__move b { margin-left: 4px; }
.race-awards__card--desastre .race-awards__move b { color: var(--team-red, #e5484d); }
@media (max-width: 560px) {
  .race-awards { flex-direction: column; align-items: center; }
  .race-awards__card { flex: 0 0 auto; width: 100%; max-width: 320px; }
}

/* analytics consent banner (cff_consent_banner, lib/layout.php) */
.cff-consent { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 70; max-width: 720px; margin: 0 auto;
  display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 14px; background: var(--night-3, #1d2550); color: var(--text);
  border: 1px solid var(--rule); box-shadow: var(--shadow, 0 8px 30px rgba(0,0,0,.4)); font: 14px/1.4 var(--body); }
.cff-consent[hidden] { display: none !important; }
.cff-consent p { margin: 0; flex: 1; }
.cff-consent a { color: var(--link); }
.cff-consent__btns { display: flex; gap: 8px; flex: none; }
.cff-consent button { cursor: pointer; padding: 8px 14px; font-size: 14px; border-radius: 10px; }
.cff-consent__no { background: transparent; color: var(--text); border: 1px solid var(--rule); }
:root[data-theme="light"] .cff-consent { background: #fff; }
:root[data-theme="contrast"] .cff-consent { background: #000; border: 2px solid #fff; }
@media (max-width: 899px) {
  .cff-consent { flex-direction: column; align-items: stretch; bottom: calc(72px + env(safe-area-inset-bottom)); }
  .landing .cff-consent, body:not(:has(.cff-tabbar)) .cff-consent { bottom: calc(12px + env(safe-area-inset-bottom)); }
  .cff-consent__btns button { flex: 1; }
  /* one bottom banner at a time: consent first, then "install app" */
  .cff-consent-open .cff-install-banner { display: none !important; }
}

/* Supporter ideas (ideas.php) */
.ideas { max-width: 860px; margin: 0 auto; }
.ideas h1 { font: 700 24px var(--display); margin: 0 0 8px; }
.ideas h2 { font: 700 19px var(--display); margin: 26px 0 8px; border-bottom: 2px solid var(--maillot); padding-bottom: 4px; }
.ideas h3 { font-size: 16px; margin: 14px 0 6px; }
.ideas__msg { padding: 8px 12px; border-left: 4px solid var(--maillot); background: var(--stripe); }
.ideas__msg--ok { border-left-color: #2e8b3a; }
.ideas__card { border: 1px solid var(--line, #d0d4da); border-radius: 10px; padding: 10px 14px; margin: 10px 0; background: var(--card, transparent); }
.ideas__card header { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.ideas__card h3 { margin: 0; flex: 1 1 200px; }
.ideas__card p { margin: 6px 0; overflow-wrap: anywhere; }
.ideas__rank { font: 700 20px var(--display); min-width: 1.6em; }
.ideas__pts { font-weight: 700; white-space: nowrap; }
.ideas__by { font-size: 13px; opacity: .75; }
.ideas__status { display: inline-block; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--stripe); }
.ideas__status--study { background: #fff2c2; color: #6b5200; }
.ideas__status--planned { background: #d7e8ff; color: #123d7a; }
.ideas__status--done { background: #d4f2d9; color: #1c5a26; }
.ideas__status--rejected { background: #f1d6d6; color: #6e1f1f; }
.ideas__note { margin: 8px 0 0; padding: 6px 10px; border-left: 3px solid var(--maillot); }
.ideas__form, .ideas__ballot { display: grid; gap: 10px; padding: 12px 14px; border-radius: 10px; background: var(--stripe); }
.ideas__form label, .ideas__ballot label { display: grid; gap: 4px; font-weight: 600; }
.ideas__form input, .ideas__form textarea, .ideas__ballot select, .ideas__admin select, .ideas__admin textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 6px 8px; }
.ideas__ballot label { grid-template-columns: 90px 1fr; align-items: center; }
.ideas__hint { font-size: 13px; opacity: .75; margin: 0; }
.ideas__form button, .ideas__ballot button { justify-self: start; }
.ideas__withdraw { margin: 6px 0 0; }
.ideas__admin { display: grid; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--line, #d0d4da); }
.ideas__past summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
@media (max-width: 560px) { .ideas__ballot label { grid-template-columns: 1fr; } }
.ideas h3, .ideas__card h3 { background: none; color: inherit; padding: 0; border: 0; }
.ideas__card h3 { color: var(--maillot); }
.ideas__admin button { justify-self: start; width: auto; }

/* Kit colours (maillot.php) */
.kitc { max-width: 860px; margin: 0 auto; }
.kitc h1 { font: 700 24px var(--display); margin: 0 0 8px; }
.kitc__grid { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.kitc__img { margin: 0; width: 200px; text-align: center; font-size: 13px; }
.kitc__img img { width: 200px; height: 200px; object-fit: contain; background: #fff; border-radius: 12px; display: block; margin-bottom: 6px; }
.kitc__previews { display: flex; gap: 10px; flex-wrap: wrap; }
.kitc__previews svg { border-radius: 12px; }
.kitc__form { display: grid; gap: 10px; margin-top: 12px; }
.kitc__form label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 600; }
.kitc__form input[type=color] { width: 46px; height: 32px; padding: 0; border: 0; background: none; }
.kitc__form small { font-weight: 400; opacity: .75; display: inline-flex; align-items: center; gap: 4px; }
.kitc__chip { display: inline-block; width: 14px; height: 14px; border-radius: 3px; border: 1px solid rgba(0,0,0,.3); }
.kitc__actions button { width: auto; }

/* Kit designer (maillot_editor.php) */
.kited { max-width: 1000px; margin: 0 auto; }
.kited h1 { font: 700 24px var(--display); margin: 0 0 8px; }
.kited__grid { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.kited__preview { position: sticky; top: 10px; text-align: center; }
.kited__preview #kited-kit svg { width: 100%; height: auto; max-width: 320px; background: #fff; border-radius: 14px; }
.kited__portrait { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; margin-top: 8px; font-size: 12px; opacity: .9; }
.kited__portrait svg { border-radius: 12px; }
.kited__form fieldset { border: 1px solid var(--line, #d0d4da); border-radius: 10px; margin: 0 0 12px; padding: 10px 12px; display: grid; gap: 8px; }
.kited__form legend { font-weight: 700; padding: 0 6px; }
.kited__form label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.kited__form input[type=text] { font: inherit; padding: 5px 8px; min-width: 0; }
.kited__form select { font: inherit; padding: 4px 6px; }
.kited__row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.kited__c input[type=color] { width: 38px; height: 28px; padding: 0; border: 0; background: none; }
.kited__slot { border-top: 1px dashed var(--line, #d0d4da); padding-top: 6px; }
.kited__slot summary { cursor: pointer; font-weight: 600; margin-bottom: 6px; }
.kited__icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 4px; margin-top: 8px; }
.kited__icons label { display: block; padding: 4px; border-radius: 8px; cursor: pointer; border: 2px solid transparent; }
.kited__icons input { position: absolute; opacity: 0; pointer-events: none; }
.kited__icons label:has(input:checked) { border-color: var(--maillot); background: var(--stripe); }
.kited__icons svg { width: 100%; height: auto; display: block; }
.kited__actions { display: flex; gap: 12px; align-items: center; }
.kited__actions button { width: auto; }
@media (max-width: 760px) {
  .kited__grid { grid-template-columns: 1fr; }
  .kited__preview { position: sticky; top: 0; z-index: 2; background: var(--bg, #0d1430); padding: 6px 0; display: flex; gap: 8px; align-items: center; justify-content: center; }
  .kited__preview #kited-kit svg { max-width: 190px; }
  .kited__portrait { margin: 0; }
  .kited__portrait svg { width: 90px; height: 90px; }
}
.kited__random { display: block; margin: 10px auto 0; width: auto; font-weight: 700; }
@media (max-width: 760px) { .kited__preview { flex-wrap: wrap; } .kited__random { order: 3; margin: 4px auto 0; flex-basis: 100%; max-width: 220px; } }

/* Past seasons rankings (tempinter.php, tempinter1.php) */
.sh { max-width: 720px; margin: 0 auto; }
.sh h1 { font: 700 22px var(--display); margin: 0 0 10px; }
.sh__tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.sh__tabs a { padding: 6px 12px; border-radius: 999px; background: var(--stripe); text-decoration: none; font-weight: 600; }
.sh__tabs a.is-on { background: var(--maillot); color: #fff; }
.sh__pick { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.sh__table { width: 100%; border-collapse: collapse; }
.sh__table th, .sh__table td { padding: 6px 8px; border-bottom: 1px solid var(--line, #d0d4da); text-align: left; }
.sh__table td:first-child, .sh__table th:first-child { width: 3em; text-align: right; }
.sh__table td:last-child, .sh__table th:last-child { text-align: right; }

/* Trophies (lib/trophies.php: vision.php, team.php; inside #content or #content2) */
ul.cff-trophies { list-style: none; margin: 4px 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
ul.cff-trophies li.cff-trophy { position: relative; list-style: none; margin: 0; padding: 0; }
ul.cff-trophies li.cff-trophy img { display: block; }
ul.cff-trophies li.cff-trophy > span { display: none; position: absolute; z-index: 20; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%);
  width: max-content; max-width: 220px; padding: 6px 10px; border-radius: 6px; background: #fff; color: #333; border: 1px solid #ccc;
  font-size: 12px; line-height: 1.35; text-align: center; box-shadow: 0 4px 12px rgba(0,0,0,.25); }
ul.cff-trophies li.cff-trophy:hover > span, ul.cff-trophies li.cff-trophy:focus-within > span { display: block; }

/* Rider / team hero: bigger kit, prev/next arrows on each side of the portrait */
.rider-hero #logo img { width: 104px; height: 104px; }
.rider-hero__media { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.rider-nav {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--night-2); border: 1px solid var(--rule); color: var(--text) !important;
  text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
a.rider-nav:hover, a.rider-nav:focus-visible { background: var(--maillot); border-color: var(--maillot); color: var(--maillot-ink) !important; }
.rider-nav--off { opacity: .25; }
.rider-hero__media .rider-hero__portrait figcaption { margin-top: 6px; }
@media (max-width: 700px) {
  .rider-hero #logo img { width: 84px; height: 84px; }
  /* portrait with its arrows on its own line, kit and flag next to the name */
  .rider-hero__media { flex: 1 1 100%; justify-content: center; }
}
@media (max-width: 480px) {
  .rider-hero #logo img { width: 72px; height: 72px; }
  .rider-nav { width: 28px; height: 28px; }
}
@media (max-width: 480px) {
  .rider-hero .rider-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; gap: 6px; }
  .rider-hero .rider-chips > div { min-width: 0; padding: 6px 8px; }
  .rider-hero .rider-chips dt { font-size: 11px; }
  .rider-hero .rider-chips dd { font-size: 18px; }
  .rider-hero__side { flex: 1 1 100%; }
}

/* Squad lists (team.php, plantilla.php): avatar + name aligned to the left, not centred per name length */
td:has(> a.rider-name > img.rider-portrait) { text-align: left !important; }
a.rider-name:has(> img.rider-portrait) { display: inline-flex; align-items: center; gap: 6px; text-align: left; }
a.rider-name > img.rider-portrait { margin-right: 0; flex: 0 0 auto; }

/* Private rider note (lib/notes.php, vision.php) */
.rider-note { margin: 0 0 18px; padding: 12px 14px; background: var(--night-3); border: 1px solid var(--rule); border-left: 4px solid var(--maillot); border-radius: var(--radius); }
.rider-note h4 { margin: 0 0 8px; font: 700 16px var(--display); }
.rider-note__form textarea { width: 100%; box-sizing: border-box; min-height: 90px; padding: 8px 10px; font: 15px/1.4 inherit; border-radius: 8px; resize: vertical; }
.rider-note__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 6px; font-size: 13px; color: var(--muted); }
.rider-note__count b { color: var(--text); }
.rider-note__status { flex: 1 1 auto; color: #3fbf6a; font-weight: 600; }
.rider-note__bar button { width: auto; padding: 5px 14px; border: 0; border-radius: 999px; background: var(--maillot); color: var(--maillot-ink); font-weight: 700; cursor: pointer; }
.rider-note__help { margin: 6px 0 0; font-size: 12px; color: var(--muted); }
.rider-note__text { margin: 0; white-space: normal; overflow-wrap: anywhere; }

/* Stage report (lib/cronica.php, carrera1.php): two commentators talking */
.cronica { max-width: 760px; margin: 10px 0 14px; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--radius); text-align: left; }
.cronica > summary { cursor: pointer; font-weight: 700; font-size: 1.05em; }
.cronica-chat { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.cronica-msg { display: flex; gap: 8px; align-items: flex-start; max-width: 92%; }
.cronica-msg--v { flex-direction: row-reverse; align-self: flex-end; }
.cronica-avatar { flex: 0 0 52px; width: 52px; height: 52px; border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 2px var(--rule); }
.cronica-avatar img { width: 52px; height: 52px; display: block; }
.cronica-bubble { padding: 7px 11px; border-radius: 12px; line-height: 1.45; border: 1px solid var(--rule); background: var(--stripe); }
.cronica-msg--n .cronica-bubble { border-top-left-radius: 3px; }
.cronica-msg--v .cronica-bubble { border-top-right-radius: 3px; background: color-mix(in srgb, var(--maillot) 12%, transparent); font-style: italic; }
.cronica-msg--l .cronica-bubble { border-top-left-radius: 3px; background: color-mix(in srgb, var(--text) 6%, transparent); border-left: 3px solid var(--maillot); }
.cronica-msg--l .cronica-avatar img { border-radius: 50%; box-shadow: 0 0 0 2px var(--maillot); }
.cronica-who small { font-weight: 400; }
.cronica-who { display: block; font-size: .78em; font-weight: 700; font-style: normal; color: var(--muted); margin-bottom: 2px; }
.cronica-sep { text-align: center; margin: 6px 0 0; }
.cronica-t { display: inline-block; font-size: .8em; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--maillot); }
.cronica-team { color: var(--muted); font-size: .9em; font-style: normal; }
.cronica-mine { color: var(--text); background: color-mix(in srgb, var(--maillot) 22%, transparent); border-radius: 3px; padding: 0 2px; }
.cronica-yours { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.cronica-yours summary { cursor: pointer; font-weight: 700; }
.cronica-yours ul { margin: 6px 0 0; padding-left: 18px; }
.cronica-yours li { margin: 3px 0; }
@media (max-width: 600px) { .cronica-avatar, .cronica-avatar img { width: 40px; height: 40px; flex-basis: 40px; } .cronica-msg { max-width: 100%; } }


/* Full calendar (totalcalendar.php): one card per race, same type scale everywhere */
.tc-page { max-width: 1200px; margin: 0 auto; }
.tc-page-title { font-family: var(--display); font-size: 1.9rem; font-weight: 700; letter-spacing: .02em; margin: 8px 0 14px; }
.tc-list { display: grid; gap: 12px; }
.tc-race { display: grid; grid-template-columns: 54px minmax(0, 1fr) 320px; gap: 14px 18px; align-items: start;
  padding: 14px 16px; background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); }
.tc-race:has(.tc-notes) { grid-template-columns: 54px minmax(220px, 1fr) 300px 250px; }
.tc-race--now { border-color: var(--maillot); box-shadow: 0 0 0 1px var(--maillot) inset; }
.tc-race--done { opacity: .72; }
.tc-num { font-family: var(--display); font-size: 1.6rem; font-weight: 700; line-height: 1; color: var(--maillot);
  text-align: center; padding: 8px 0; border: 1px solid var(--rule); border-radius: 8px; background: var(--stripe); }
.tc-info { min-width: 0; }
.tc-info h2.tc-title { font-family: var(--display); font-size: 1.35rem; font-weight: 700; line-height: 1.15; margin: 0 0 4px; color: var(--text); }
.tc-cat { font-size: .82rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--maillot); }
.tc-block { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); font-size: .92rem; line-height: 1.5; }
#content .tc-race h3.tc-h, .tc-race label.tc-h { display: block; font: 700 .75rem/1.3 var(--body) !important; text-transform: uppercase;
  letter-spacing: .07em; color: var(--muted) !important; margin: 0 0 4px; padding: 0; border: 0; background: none !important; width: auto; }
#content .tc-info h2.tc-title { background: none !important; padding: 0; border: 0; }
.tc-sub { font-weight: 600; margin-top: 6px; }
.tc-line { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; }
.tc-big { font-family: var(--display); font-size: 1.1rem; font-weight: 700; color: var(--maillot); }
.tc-meta { color: var(--muted); font-size: .85rem; }
.tc-block img { vertical-align: -2px; margin-left: 2px; }
.tc-media { text-align: center; }
.tc-date { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.tc-profile { width: 100%; max-width: 320px; height: auto; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.tc-notes textarea { width: 100%; box-sizing: border-box; min-height: 170px; font: .9rem/1.4 var(--body); }
.tc-notes input[type=submit] { margin-top: 6px; }
@media (max-width: 1100px) {
  .tc-race, .tc-race:has(.tc-notes) { grid-template-columns: 54px minmax(0, 1fr); }
  .tc-media, .tc-notes { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .tc-race, .tc-race:has(.tc-notes) { grid-template-columns: 1fr; }
  .tc-num { justify-self: start; padding: 6px 12px; }
}

/* Race entry (inscripciones.php): panels with the same type scale as the full calendar */
.ins-page { max-width: 1200px; margin: 0 auto 18px; }
.ins-grid { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.55fr) minmax(220px, 1fr); gap: 12px; align-items: stretch; }
.ins-panel { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; font-size: .92rem; line-height: 1.5; min-width: 0; }
#content .ins-panel h2.ins-title { font: 700 1.6rem/1.1 var(--display) !important; color: var(--text) !important; margin: 0 0 2px; padding: 0; background: none !important; border: 0; }
.ins-race { font: 700 1.2rem/1.2 var(--display); color: var(--maillot); margin-bottom: 4px; }
.ins-cat { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--maillot); }
.ins-meta { color: var(--muted); font-size: .85rem; }
.ins-weather { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-weight: 600; }
.ins-weather img { vertical-align: middle; }
.ins-more { display: inline-block; margin: 2px 0 4px; font-size: .88rem; }
#content .ins-panel h3.ins-h, .ins-panel label.ins-h { display: block; font: 700 .75rem/1.3 var(--body) !important; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted) !important; margin: 12px 0 6px; padding: 10px 0 0; border: 0; border-top: 1px solid var(--rule); background: none !important; }
#content .ins-panel > h3.ins-h:first-child, #content .ins-panel > label.ins-h:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ins-sep { margin: 12px 0 8px; padding-top: 10px; border-top: 1px solid var(--rule); }
.ins-terrain, .ins-legend { font-size: .88rem; }
.ins-terrain img, .ins-legend img { vertical-align: middle; margin: 0 8px 0 3px; }
.ins-legend { margin-top: 8px; color: var(--muted); font-size: .8rem; }
.ins-profile { text-align: center; }
.ins-date { font: 700 1.15rem var(--display); color: var(--text); margin-bottom: 8px; }
.ins-profile-img { width: 100%; max-width: 500px; height: auto; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.ins-key { margin-top: 10px; font-size: .8rem; line-height: 1.9; color: var(--muted); text-align: center; }
.ins-key img { vertical-align: middle; margin: 0 3px 0 0; }
.ins-k { white-space: nowrap; margin: 0 6px; }
.ins-nav { display: grid; gap: 2px; }
.ins-nav a { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; font-size: .9rem; font-weight: 600; color: var(--text); text-decoration: none; }
.ins-nav a:hover { background: var(--night-3); color: var(--link-hover); }
.ins-nav img { width: 22px; height: 22px; object-fit: contain; flex: none; }
.ins-links textarea { width: 100%; box-sizing: border-box; min-height: 90px; font: .9rem/1.4 var(--body); }
.ins-links form input[type=submit] { margin-top: 6px; }
.ins-sub { font-weight: 600; margin: 6px 0 2px; }
.ins-big { display: block; font: 700 1.35rem var(--display); color: var(--maillot); margin-top: 2px; }
.ins-record, .ins-favs, .ins-history { text-align: left; }
.ins-panel img[src*="gold.jpg"] { vertical-align: -2px; margin: 0 2px 0 4px; }
.ins-riders-wrap { max-width: 1200px; margin: 0 auto; }
.ins-riders { width: 100%; border-collapse: collapse; }
.ins-riders td { padding: 5px 6px; }
.ins-legend-table { margin: 14px 0; }
.ins-notes-text { color: var(--muted); font-size: .88rem; max-width: 80ch; margin-bottom: 16px; }
@media (max-width: 980px) {
  .ins-grid { grid-template-columns: 1fr 1fr; }
  .ins-profile { grid-column: 1 / -1; order: -1; }
}
@media (max-width: 600px) {
  .ins-grid { grid-template-columns: 1fr; }
}

/* ---- Legacy type scale ---------------------------------------------------
   Old pages size and colour text with <font size/color/face> and use <h1>-<h3>
   as labels inside layout tables. One scale for all of them, so every page
   reads like the redone ones (totalcalendar.php, inscripciones.php):
   body text at one size, yellow highlights in the theme accent, and headings
   inside tables at section size instead of page-title size. */
/* layout-table cells: the old stylesheet gives every td 10px Lucida; take the page's text size and font
   (data tables keep their own rules above, which are !important) */
.cff-shell #content td { font-size: inherit; font-family: inherit; line-height: 1.45; }
.cff-shell #content font[face] { font-family: inherit; }
.cff-shell #content font[size] { font-size: inherit; }
.cff-shell #content font:is([size="4"], [size="+1"]) { font-size: 1.15em; }
.cff-shell #content font:is([size="5"], [size="6"], [size="7"], [size="+2"], [size="+3"]) { font: 700 1.35em/1.2 var(--display); }
/* black text was meant for the old white <h1> bars, gone now */
.cff-shell #content font:is([color="black" i], [color="#000000"], [color="#000"]) { color: inherit; }
.cff-shell #content font:is([color="#FFFF00" i], [color="#FFD700" i], [color="yellow" i], [color="#D2BE22" i]) { color: var(--maillot); }
.cff-shell table:not(.cff-cal) td h1 { margin: 6px 0 4px; font: 700 20px/1.2 var(--display) !important; color: var(--maillot) !important; }
.cff-shell table:not(.cff-cal) td h2 { margin: 6px 0 4px; font: 700 18px/1.2 var(--display); }
.cff-shell table:not(.cff-cal) td h3 { margin: 6px 0 4px; font: 700 16px/1.25 var(--display); }
.cff-shell table:not(.cff-cal) td :is(h1, h2, h3) + br { display: none; }

/* Text accents that replaced the old <font color/size> tags (all pages) */
.t-acc, .t-acc-big { color: var(--maillot); }
.t-neg, .t-neg-big { color: #e5383b; }
.t-pos { color: #2fa36b; }
.t-big, .t-acc-big, .t-neg-big { font-size: 1.15em; }
.t-title { font: 700 1.35em/1.2 var(--display); }

/* Finances (finanzas.php) */
.fin-page { max-width: 1200px; margin: 0 auto; display: grid; gap: 14px; }
#content2 .fin-page h1.fin-title { margin: 4px 0 0; font: 800 italic 28px/1.1 var(--display) !important; color: var(--text) !important; background: none !important; text-align: left; }
.fin-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.fin-kpi { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 12px 16px; display: grid; gap: 4px; }
.fin-kpi__label { font: 700 .75rem/1.3 var(--body); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.fin-kpi strong { font: 700 1.6rem/1.1 var(--display); color: var(--text); }
.fin-kpi strong.t-neg { color: #e5383b; } .fin-kpi strong.t-pos { color: #2fa36b; }
.fin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; align-items: start; }
.fin-grid--3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fin-wide { grid-column: 1 / -1; }
.fin-panel { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; min-width: 0; overflow-x: auto; }
:is(#content, #content2) .fin-panel h2.fin-h { margin: 0 0 10px; font: 700 .78rem/1.3 var(--body) !important; text-transform: uppercase; letter-spacing: .07em; color: var(--muted) !important; background: none !important; text-align: left; }
.fin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.fin-table th, .fin-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: right; white-space: nowrap; font: inherit; color: var(--text); }
.fin-table th { color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.fin-table th:first-child, .fin-table td:first-child { text-align: left; white-space: normal; }
.fin-table tbody tr:nth-child(even) td { background: var(--stripe); }
.fin-table tfoot td { font-weight: 700; border-bottom: 0; border-top: 2px solid var(--rule); }
.fin-table td img { vertical-align: middle; }
.fin-sub { color: var(--muted); font-size: .82rem; }
.fin-empty { color: var(--muted); text-align: center !important; }
.fin-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: -2px 0 8px; font-size: .88rem; font-weight: 600; }
.fin-legend__swatch { width: 22px; height: 4px; border-radius: 2px; background: var(--link); }
.fin-legend__range { color: var(--muted); font-weight: 400; }
.fin-chart .eco-chart { display: block; width: 100%; height: auto; }
.fin-chart .eco-grid { stroke: var(--rule); stroke-width: 1; }
.fin-chart .eco-grid--zero { stroke: var(--muted); }
.fin-chart .eco-tick { fill: var(--muted); font: 13px var(--body); }
.fin-chart .eco-chart--narrow .eco-tick { font-size: 12px; }
.fin-chart .eco-area { fill: var(--link); fill-opacity: .16; }
.fin-chart .eco-line { fill: none; stroke: var(--link); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.fin-chart .eco-dot { fill: var(--link); stroke: transparent; stroke-width: 12; cursor: default; }
.fin-chart .eco-dot--last { stroke: var(--night-2); stroke-width: 2; }
.fin-chart .eco-dot:hover { opacity: .75; }
.fin-chart .eco-chart--narrow { display: none; }
@media (max-width: 600px) { .fin-chart .eco-chart--wide { display: none; } .fin-chart .eco-chart--narrow { display: block; } }
.fin-notes { color: var(--muted); font-size: .85rem; line-height: 1.5; max-width: 90ch; }
.fin-notes p { margin: 0 0 8px; }
@media (max-width: 600px) {
  .fin-panel { padding: 12px 10px; }
  .fin-table th, .fin-table td { padding: 5px 6px; }
  .fin-kpis { grid-template-columns: 1fr 1fr; }
  .fin-kpi strong { font-size: 1.25rem; }
}

/* National teams (seleccion.php): one panel per team (absolute, U21, U23) */
.sel-page { max-width: 1200px; margin: 0 auto 16px; }
.sel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; align-items: start; }
.sel-panel { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; font-size: .92rem; line-height: 1.45; min-width: 0; }
#content .sel-panel h2.sel-title { margin: 0 0 4px; font: 700 1.45rem/1.15 var(--display) !important; color: var(--text) !important; background: none !important; text-align: left; }
.sel-coach { margin: 0 0 10px; color: var(--muted); }
.sel-coach a { font-weight: 700; }
#content .sel-panel h3.sel-h { margin: 14px 0 6px; padding-top: 10px; border-top: 1px solid var(--rule); font: 700 .75rem/1.3 var(--body) !important;
  text-transform: uppercase; letter-spacing: .07em; color: var(--muted) !important; background: none !important; }
.sel-link { display: block; padding: 5px 8px; margin: 0 -8px; border-radius: 6px; font-weight: 600; text-decoration: none; }
.sel-link:hover { background: var(--night-3); }
#content .sel-profile { display: block; width: 100%; max-width: 320px; height: auto; max-height: 240px; object-fit: contain; margin: 8px 0 4px; border-radius: 6px; border: 1px solid var(--rule); background: #fff; }
.sel-panel form { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin: 4px 0 10px; }
.sel-panel form textarea { flex: 1 1 100%; width: 100%; box-sizing: border-box; }
#content .sel-panel .sel-go { min-height: 32px; padding: 4px 14px; }
.sel-cands { width: 100%; max-width: 600px; margin-top: 12px; }
@media (max-width: 600px) { .sel-panel { padding: 12px; } }

/* The viewer's own riders/team in old result tables come as rows of "fondo" cells:
   show them as a highlighted data row, not as a header (js/sortable-tables.js
   treats them as data too) */
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr:has(a[href*="ciclistaid="], a[href*="userid="], a[href*="team.php"]) > td[class^="fondo"] {
  padding: 7px 10px !important;
  background: color-mix(in srgb, var(--maillot) 22%, transparent) !important; /* same tint as the own team in other tables */
  color: var(--text) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--rule) !important;
  font: 600 14px/1.35 var(--body) !important;
  text-transform: none !important;
  letter-spacing: normal !important;
  white-space: normal;
}
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr:has(a[href*="ciclistaid="], a[href*="userid="], a[href*="team.php"]) > td[class^="fondo"] a { color: var(--link) !important; text-decoration: none !important; }
html:root body:not(.landing) .cff-shell table:not(:where(.cff-isolate table)):has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr:has(a[href*="ciclistaid="], a[href*="userid="], a[href*="team.php"]) > td[class^="fondo"]:first-child { box-shadow: inset 3px 0 0 var(--maillot); }

/* Team place over the stages (temi.php) */
.pos-chart { max-width: 1000px; margin: 16px 0; }
.fin-legend strong { color: var(--link); }

/* Public race pages (carreras.php): open to everybody and to search engines */
.pr { max-width: 1100px; margin: 0 auto; padding: 18px 16px 30px; font: 16px/1.6 var(--body); color: var(--text); }
.pr a { color: var(--link); }
.pr-crumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.pr-crumbs a { text-decoration: none; }
.pr-langs { margin-left: auto; }
.pr-langs a[aria-current] { font-weight: 700; color: var(--text); }
.pr-kind { margin: 0; font: 700 .8rem/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--maillot); }
.pr h1.pr-title { margin: 2px 0 10px; font: 800 italic clamp(30px, 5vw, 46px)/1.05 var(--display); color: var(--text); background: none; }
.pr-lead { max-width: 75ch; font-size: 1.05rem; color: var(--text); margin: 0 0 18px; }
.pr-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.pr-section { margin: 0 0 22px; }
.pr-section > p { max-width: 75ch; margin: 0 0 10px; }
.pr h2.pr-h { margin: 0 0 10px; padding: 0 0 6px; border-bottom: 1px solid var(--rule); font: 700 .8rem/1.3 var(--body); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: none; }
.pr-profile { display: block; width: 100%; max-width: 700px; height: auto; border-radius: 8px; border: 1px solid var(--rule); background: #fff; }
.pr-terrain { color: var(--muted); font-size: .92rem; }
.pr-stages { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.pr-stages li { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 4px; }
.pr-stages__n { font: 700 1.1rem var(--display); color: var(--maillot); }
.pr-stages img { width: 100%; height: auto; border-radius: 6px; background: #fff; }
.pr-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.pr-table th, .pr-table td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--rule); }
.pr-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.pr-table tbody tr:nth-child(even) td { background: var(--stripe); }
.pr-flag { vertical-align: -1px; border-radius: 2px; }
.pr-box { background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.pr-top { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.pr-top .pr-muted { display: block; font-size: .85rem; }
.pr-badge { display: inline-block; margin-top: 2px; padding: 1px 8px; border-radius: 999px; background: var(--maillot); color: var(--maillot-ink); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.pr-muted { color: var(--muted); }
.pr-cta { border-color: var(--maillot); }
.pr-cta h2 { margin: 0 0 6px; font: 700 1.3rem/1.2 var(--display); color: var(--text); background: none; }
.pr-cta p { margin: 0 0 12px; color: var(--muted); }
.pr-btn { display: inline-block; padding: 10px 18px; border-radius: 999px; background: var(--maillot); color: var(--maillot-ink) !important; font-weight: 700; text-decoration: none; }
.pr-cta--wide { margin-top: 10px; text-align: center; }
.pr-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.pr-card { display: grid; gap: 2px; height: 100%; box-sizing: border-box; padding: 12px 14px; background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); color: var(--text) !important; text-decoration: none; }
.pr-card:hover { border-color: var(--maillot); }
.pr-card strong { font: 700 1.15rem/1.2 var(--display); }
.pr-card__meta { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.pr-card__win { font-size: .85rem; color: var(--muted); }
.pr-more { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pr-more a { display: inline-block; padding: 5px 12px; border: 1px solid var(--rule); border-radius: 999px; font-size: .88rem; text-decoration: none; }
@media (max-width: 860px) { .pr-cols { grid-template-columns: 1fr; } }
.pr-share { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; }
.pr-share a, .pr-share button { display: inline-flex; align-items: center; min-height: 34px; padding: 4px 14px; border: 1px solid var(--rule); border-radius: 999px;
  background: var(--night-2); color: var(--text) !important; font: 600 .88rem var(--body); text-decoration: none; cursor: pointer; }
.pr-share a:hover, .pr-share button:hover { border-color: var(--maillot); }
.pr-share .pr-share__native { background: var(--maillot); border-color: var(--maillot); color: var(--maillot-ink) !important; }
.pr--cronica { max-width: 900px; }
.pr--cronica .cronica { margin: 0 0 18px; }
.pr-btn--ghost { background: transparent; border: 1px solid var(--maillot); color: var(--link) !important; }
.pr-divs { margin: -8px 0 16px; }
.pr-divs a[aria-current] { background: var(--maillot); border-color: var(--maillot); color: var(--maillot-ink) !important; }
.cronica + .pr-share, .cronica ~ .pr-share { margin: 10px 0 18px; }

/* 2D race replay (lib/replay2d.php, js/replay2d.js) */
.r2d { max-width: 760px; margin: 10px 0 14px; padding: 10px 12px 12px; background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); text-align: left; }
#content .r2d h3.r2d__title { margin: 0 0 6px; font: 700 1.05rem/1.2 var(--body) !important; color: var(--text) !important; background: none !important; text-align: left; }
.r2d__note { margin: 0 0 6px; color: var(--muted); font-size: .85rem; }
.r2d__stage { position: relative; }
.r2d__canvas { display: block; width: 100%; height: 224px; border-radius: 6px; background: linear-gradient(#232833, #1b1f28); touch-action: manipulation; }
.r2d__controls { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.r2d__seek { flex: 1 1 auto; min-width: 60px; accent-color: var(--maillot); }
#content .r2d .r2d__btn { min-width: 34px; min-height: 32px; padding: 2px 8px; border: 1px solid var(--rule); border-radius: 6px; background: var(--night-3, #2a2f3a); color: var(--text); font: 700 .85rem/1 var(--body); cursor: pointer; }
#content .r2d .r2d__btn:hover { border-color: var(--maillot); }
.r2d__speeds { display: inline-flex; gap: 3px; }
#content .r2d .r2d__speed.is-on { background: var(--maillot); border-color: var(--maillot); color: #111; }
.r2d__status { margin-top: 4px; color: var(--muted); font-size: .8rem; }
.r2d__mine { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 6px; font-size: .82rem; }
.r2d__mine-l { color: var(--muted); font-weight: 600; }
#content .r2d .r2d__chip { padding: 3px 9px 3px 7px; border: 1px solid var(--rule); border-left: 4px solid var(--c, var(--maillot)); border-radius: 999px; background: transparent; color: var(--text); font: 600 .8rem/1.2 var(--body); cursor: pointer; }
#content .r2d .r2d__chip.is-on { border-color: var(--maillot); background: rgba(242, 194, 48, .14); }
.r2d__hint { color: var(--muted); font-size: .75rem; }
.r2d__feed { list-style: none; margin: 6px 0 0; padding: 0; font-size: .82rem; }
.r2d__feed li { display: flex; align-items: center; gap: 6px; padding: 2px 0; color: var(--muted); }
.r2d__feed li.is-mine { color: var(--text); font-weight: 600; }
.r2d__feed img { flex: 0 0 16px; }
.r2d__next { display: inline-block; margin-top: 8px; }
.r2d [hidden] { display: none !important; }
.r2d--locked .r2d__canvas { filter: blur(3px) saturate(.8); }
.r2d__lock { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 12px;
  text-align: center; background: rgba(12, 15, 22, .55); border-radius: 6px; color: var(--text); font-size: .88rem; }
.r2d__lock strong { font-size: 1rem; }
.r2d__lock span { max-width: 460px; }
@media (max-width: 480px) { .r2d { padding: 8px; } .r2d__canvas { height: 204px; } #content .r2d .r2d__btn { min-width: 30px; padding: 2px 6px; } }
.r2d-choose { max-width: 760px; margin: 12px 0 16px; padding: 14px 16px; background: var(--night-2); border: 1px solid var(--rule); border-radius: var(--radius); text-align: left; }
#content .r2d-choose h3 { margin: 0 0 10px; font: 700 1.15rem/1.2 var(--body) !important; color: var(--text) !important; background: none !important; text-align: left; }
.r2d-choose__opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#content .r2d-choose__opt { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--night-3, #2a2f3a); color: var(--text); text-decoration: none; }
#content .r2d-choose__opt:hover { border-color: var(--maillot); }
.r2d-choose__opt strong { font-size: 1.05rem; }
.r2d-choose__opt span { color: var(--muted); font-size: .85rem; line-height: 1.35; }
#content .r2d-choose__opt--2d { border-color: var(--maillot); box-shadow: 0 0 0 1px var(--maillot) inset; }
.r2d-switch { max-width: 760px; margin: 8px 0; text-align: left; font-weight: 600; font-size: .9rem; }
@media (max-width: 480px) { .r2d-choose__opts { grid-template-columns: 1fr; } }
.r2d-cronica { max-width: 760px; }
.r2d-cronica__note { margin: 4px 0 -4px; color: var(--muted); font-size: .8rem; text-align: left; }
.r2d-cr[hidden] { display: none !important; }
.r2d-cr--in { animation: r2d-in .45s ease-out; }
@keyframes r2d-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .r2d-cr--in { animation: none; } }
/* 2D replay: top 10 beside the road, live gap, weather, clip */
.r2d__main { display: grid; grid-template-columns: minmax(0, 1fr) 190px; gap: 10px; align-items: start; }
.r2d--locked .r2d__main { grid-template-columns: minmax(0, 1fr); }
.r2d__top { background: rgba(0, 0, 0, .18); border: 1px solid var(--rule); border-radius: 6px; padding: 6px 8px; font-size: .78rem; }
#content .r2d__top h4 { margin: 0 0 4px; font: 700 .8rem/1.2 var(--body) !important; color: var(--muted) !important; background: none !important; text-transform: uppercase; letter-spacing: .04em; text-align: left; }
.r2d__top ol { margin: 0; padding: 0 0 0 1.6em; }
.r2d__top li { padding: 1px 0; color: var(--text); cursor: pointer; }
.r2d__top li > * { vertical-align: middle; }
.r2d__top li i { display: inline-block; width: 8px; height: 8px; margin-right: 5px; border-radius: 50%; }
.r2d__top li span { display: inline-block; max-width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.r2d__top li b { float: right; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.r2d__top li.is-mine { font-weight: 700; color: var(--maillot); }
.r2d__top li.is-leader i { box-shadow: 0 0 6px #ffd400; }
.r2d__status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.r2d__gap { padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.r2d__gap.is-closing { background: rgba(214, 64, 52, .25); color: #ff8a80; }
.r2d__gap.is-opening { background: rgba(63, 143, 78, .28); color: #8be39a; }
.r2d__wx { color: var(--muted); }
#content .r2d .r2d__clip { margin-left: auto; }
.r2d__clipbox { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: .85rem; }
.r2d__clipbox video { width: 100%; max-width: 420px; border-radius: 6px; }
#content .r2d__clipbox a.r2d__btn { display: inline-flex; align-items: center; text-decoration: none; }
@media (max-width: 700px) {
  .r2d__main { grid-template-columns: minmax(0, 1fr); }
  .r2d__top ol { columns: 2; column-gap: 14px; }
  .r2d__top li span { max-width: 70px; }
}
.r2d__wind { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; vertical-align: -1px; }
.r2d__wind i { display: block; width: 4px; border-radius: 1px; background: rgba(255, 255, 255, .2); }
.r2d__wind i:nth-child(1) { height: 4px; } .r2d__wind i:nth-child(2) { height: 6px; } .r2d__wind i:nth-child(3) { height: 9px; } .r2d__wind i:nth-child(4) { height: 12px; }
.r2d__wind--1 i:nth-child(-n+1), .r2d__wind--2 i:nth-child(-n+2), .r2d__wind--3 i:nth-child(-n+3), .r2d__wind--4 i:nth-child(-n+4) { background: #9fd3ff; }
.r2d__wind--4 i { background: #ff8a65 !important; }
