/* ==========================================================================
   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 */
#content div[id], #content2 div[id],
.cff-shell [style*="position:absolute"], .cff-shell [style*="position: absolute"],
.cff-shell div#content2, .cff-shell div#content5 {
  position: static !important;
  left: auto !important;
  top: auto !important;
  height: auto !important;
}
#content div[id], .cff-shell [style*="position:absolute"], .cff-shell [style*="position: absolute"] {
  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], .cff-shell [style*="position:absolute"], .cff-shell [style*="position: absolute"] {
    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 *, 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 *, 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: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:has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > * > tr { background: transparent !important; }
html:root body:not(.landing) .cff-shell 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: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: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:has(> tbody > tr > td[class^="fondo"], > tbody > tr > th, > thead > tr > th) > tbody > tr > td:not([class^="fondo"]) font { font-size: inherit !important; }
html:root body:not(.landing) .cff-shell 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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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: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 font { 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: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 font { 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:has(> tbody > tr > td:nth-child(5) select) { width: 100% !important; max-width: 100%; table-layout: fixed; }
.cff-shell 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: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:has(> tbody > tr > td:nth-child(5) select) select { font-size: 13px !important; padding: 2px 2px 2px 6px !important; }
.cff-shell 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: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: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: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: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: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; }

/* ---- universes (lib/universe.php) ------------------------------------------ */
.cff-universe { margin-left: 10px; padding: 2px 10px; border-radius: 999px; background: var(--maillot); color: var(--maillot-ink); font: 700 13px/1.6 var(--body); white-space: nowrap; align-self: center; }

/* ---- junior draft (draft.php) ---------------------------------------------- */
.draft { max-width: 980px; }
.draft__intro { color: var(--muted); max-width: 70ch; }
.draft__bar { display: flex; flex-wrap: wrap; gap: 6px 18px; padding: 10px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--maillot); border-radius: var(--radius); }
.draft__closed { color: var(--team-red); font-weight: 600; }
.draft__flash { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--rule); border-left-width: 4px; }
.draft__flash--ok { border-left-color: var(--maillot); }
.draft__flash--err { border-left-color: var(--team-red); }
.draft__help { color: var(--muted); font-size: .9em; max-width: 70ch; }
.draft__scroll { overflow-x: auto; max-width: 100%; }
.draft__days { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.draft-table { border-collapse: collapse; width: 100%; }
.draft-table th, .draft-table td { padding: 6px 8px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.draft-table tbody tr:nth-child(odd) { background: var(--stripe); }
.draft-table td.draft-scouted { white-space: normal; }
.draft-flag { vertical-align: -2px; border-radius: 2px; }
.draft-stars { color: var(--maillot); letter-spacing: 1px; white-space: nowrap; }
.draft-stars span { color: var(--muted); opacity: .6; }
.draft-hidden { color: var(--muted); }
.draft-admin { color: var(--muted); font-style: italic; }
.draft-skills { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 4px 18px; }
.draft-skills li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--rule); }
.draft-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.draft-form input[type="number"] { width: 140px; padding: 6px 8px; }
.draft-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.draft-filter input[type="search"] { flex: 1 1 180px; padding: 6px 8px; }
.draft-races { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.draft-race { border: 1px solid var(--rule); border-radius: var(--radius); padding: 10px 12px; }
.draft-race h3 { margin: 0 0 6px; }
.draft-race h3 small, .draft h2 small { color: var(--muted); font-weight: normal; }
.draft h3 { margin: 18px 0 6px; padding: 0; background: none !important; color: var(--text) !important; font: 700 19px/1.15 var(--display) !important; }
.draft-race h3 { margin: 0 0 6px; }
.draft-race .draft-table { width: 100%; }

/* ---- 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; } }
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 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; }
.draft-junior { display: flex; align-items: center; gap: 14px; margin: 6px 0 4px; }
.draft-junior svg { flex: 0 0 auto; border-radius: 14px; box-shadow: 0 0 0 2px var(--maillot); }
.draft-junior h2 { margin: 0; }
/* small screens: the universe badge takes the clock's place so the menu button stays visible */
@media (max-width: 520px) {
  .cff-universe { margin-left: 6px; padding: 1px 8px; font-size: 12px; }
  header:has(.cff-universe) .cff-clock { display: none; }
}

/* ---- season objectives (objetivos.php) ------------------------------------- */
.obj { max-width: 980px; }
.obj__intro, .obj__help { color: var(--muted); max-width: 70ch; }
.obj__band, .obj__window { padding: 10px 14px; border: 1px solid var(--rule); border-left: 4px solid var(--maillot); border-radius: var(--radius); }
.obj__flash { padding: 10px 14px; border-radius: 6px; border: 1px solid var(--rule); border-left-width: 4px; }
.obj__flash--ok { border-left-color: var(--maillot); }
.obj__flash--err { border-left-color: var(--team-red); }
.obj-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin: 12px 0; }
.obj-card { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--stripe); cursor: pointer; }
.obj-card input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--maillot); flex: 0 0 auto; }
.obj-card:has(input:checked) { border-color: var(--maillot); box-shadow: 0 0 0 1px var(--maillot) inset; }
.obj-card:has(input:disabled) { opacity: .55; cursor: default; }
.obj-card--chosen { cursor: default; }
.obj-card--met { border-color: var(--maillot); }
.obj-card__body { display: flex; flex-direction: column; gap: 6px; }
.obj-card__body strong { font: 700 16px/1.25 var(--body); color: var(--text); }
.obj-card__prize { color: var(--maillot); font-weight: 700; }
.obj-diff { font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); }
.obj-diff--3 { color: var(--team-red); }
.obj__scroll { overflow-x: auto; }
.obj-table { border-collapse: collapse; width: 100%; }
.obj-table th, .obj-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; }

/* ---- rider comparison (comparar.php) --------------------------------------- */
.cmp { max-width: 980px; }
.cmp__intro { color: var(--muted); max-width: 70ch; }
.cmp__note { padding: 8px 12px; border-left: 4px solid var(--maillot); border: 1px solid var(--rule); border-radius: 6px; }
.cmp-search { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.cmp-search input { flex: 1 1 200px; padding: 6px 8px; }
.cmp-found { list-style: none; padding: 0; margin: 0 0 14px; }
.cmp-found li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--rule); }
.cmp__scroll { overflow-x: auto; max-width: 100%; }
.cmp-table { border-collapse: collapse; width: 100%; min-width: 340px; }
.cmp-table th, .cmp-table td { padding: 6px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.cmp-table thead th { font-size: 14px; }
.cmp-table tbody th { color: var(--muted); font-weight: 600; white-space: nowrap; }
.cmp-table td { position: relative; min-width: 84px; }
.cmp-group th { color: var(--maillot) !important; text-transform: uppercase; letter-spacing: .4px; font-size: 12px; padding-top: 14px; }
.cmp-bar { position: absolute; left: 0; top: 20%; bottom: 20%; width: var(--v); background: var(--maillot); opacity: .14; border-radius: 0 4px 4px 0; }
.cmp-table td b { position: relative; }
.cmp-best b { color: var(--maillot); }
.cmp-best::after { content: '★'; color: var(--maillot); margin-left: 4px; font-size: 12px; position: relative; }
.cmp-hidden { color: var(--muted); font-style: italic; font-size: 13px; }
.cmp-remove { margin-left: 6px; text-decoration: none; font-weight: 700; color: var(--muted); }
.rider-compare { margin: 8px 0; }
a.cmp-add { text-decoration: none; padding: 0 4px; border-radius: 4px; border: 1px solid var(--rule); font-size: 12px; }
.cmp-table td b { background: none !important; color: var(--text); padding: 0; }
.cmp-best b { color: var(--maillot) !important; }
