/* ==========================================================================
   Encarrera.uy — Sistema de resultados
   Réplica del diseño aprobado (Resultados Gran Fondo.dc.html) sobre los tokens
   del design system. Nada de colores/tipografías/radios fuera de los tokens.
   ========================================================================== */

/* ---- Reset / base (del helmet del diseño) ---- */
html, body { margin: 0; padding: 0; background: var(--ec-ink-700); }
* { box-sizing: border-box; }
body { color: var(--text-primary); font-family: var(--font-body); -webkit-text-size-adjust: 100%; }
a { color: var(--ec-orange-500); text-decoration: none; }
a:hover { color: var(--ec-orange-600); }
input, select, button { font: inherit; }
input::placeholder { color: var(--ec-white-40); }
img { max-width: 100%; }
button { color: inherit; }

@keyframes ec-rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes ec-sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
@keyframes ec-fade-in { from { opacity: 0; } to { opacity: 1; } }

.ec-app { min-height: 100vh; background: var(--bg-canvas); }

/* Estado de carga y errores */
.ec-boot { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; min-height: 70vh; padding: 40px 20px; text-align: center; }
.ec-boot img { width: 100%; max-width: 260px; height: auto; opacity: .9; }
.ec-boot span { font-family: var(--font-data); font-size: 12px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted); }
.ec-fatal { display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 18px; min-height: 80vh; padding: 40px 20px; text-align: center; color: var(--text-secondary); }
.ec-noscript { padding: 16px; text-align: center; background: var(--ec-orange-700); color: #fff;
  font-size: 14px; }

/* Eyebrow inclinado "RESULTADOS OFICIALES" */
.ec-eyebrow { display: inline-block; background: var(--ec-orange-500); transform: skewX(-8deg); padding: 5px 12px; }
.ec-eyebrow > span { display: inline-block; transform: skewX(8deg); font-weight: 700; font-size: 11px;
  letter-spacing: .16em; text-transform: uppercase; color: #fff; }

/* Línea de metadatos del evento (fecha · lugar · distancia) */
.ec-meta { font-family: var(--font-data); font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--text-secondary); }

/* ==========================================================================
   MÓVIL (vista principal, < 760px)
   ========================================================================== */
.ec-m { width: 100%; max-width: 560px; margin: 0 auto; background: var(--bg-canvas);
  position: relative; padding-bottom: env(safe-area-inset-bottom); }

.ec-m__head { padding: 22px 20px 18px; background: var(--ec-ink-900); }
.ec-m__headtop { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ec-m__year { font-family: var(--font-data); font-size: 10px; letter-spacing: .14em; color: var(--text-muted); padding-top: 6px; }
.ec-m__logo { width: 100%; max-width: 300px; height: auto; display: block; margin: 18px 0 4px; }
.ec-m__meta { margin-top: 10px; }
.ec-m__resumen { display: flex; gap: 18px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border-hairline); }
.ec-stat__v { font-family: var(--font-data); font-weight: 700; font-size: 19px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ec-stat__l { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-top: 5px; }

/* Tabs de modalidad */
.ec-mods { display: flex; gap: 6px; padding: 12px 20px 0; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.ec-mods::-webkit-scrollbar { display: none; }
.ec-mod { flex: 0 0 auto; font-weight: 700; font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  padding: 9px 12px; border: 0; border-radius: 4px; cursor: pointer; white-space: nowrap;
  background: var(--ec-white-08); color: var(--text-secondary); }
.ec-mod[aria-selected="true"] { background: var(--ec-orange-500); color: #fff; }
.ec-mod[disabled] { cursor: not-allowed; color: var(--text-muted); }

/* Barra de búsqueda + filtros (sticky en móvil) */
.ec-m__filtros { position: sticky; top: 0; z-index: 20; padding: 12px 20px 14px;
  background: var(--bg-canvas); border-bottom: 1px solid var(--border-hairline); }
.ec-search { width: 100%; height: 46px; padding: 0 14px; background: var(--ec-white-08);
  border: 1px solid var(--border-hairline); border-radius: 4px; color: var(--text-primary); font-size: 15px; }
.ec-search:focus, .ec-select:focus { outline: none; border-color: var(--border-strong); }
.ec-m__row2 { display: flex; gap: 8px; margin-top: 10px; }
.ec-select { flex: 1; min-width: 0; height: 44px; padding: 0 10px; background: var(--ec-white-08);
  border: 1px solid var(--border-hairline); border-radius: 4px; color: var(--text-primary); font-size: 13px; }
.ec-select option { background: var(--ec-ink-700); }
.ec-sexos { display: flex; gap: 4px; flex: 0 0 auto; }
.ec-sexo { width: 44px; height: 44px; border: 1px solid var(--border-hairline); border-radius: 4px; cursor: pointer;
  font-weight: 700; font-size: 12px; letter-spacing: .06em; background: var(--ec-white-08); color: var(--text-secondary); }
.ec-sexo[aria-pressed="true"] { background: var(--ec-orange-500); color: #fff; }
.ec-m__row3 { display: flex; gap: 6px; margin-top: 10px; align-items: center; justify-content: space-between; }
.ec-tabs { display: flex; gap: 6px; }
.ec-tab { font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; padding: 8px 12px;
  border: 0; border-bottom: 2px solid transparent; background: transparent; cursor: pointer; color: var(--text-muted); }
.ec-tab[aria-selected="true"] { color: var(--text-primary); border-bottom-color: var(--ec-orange-500); }
.ec-conteo { font-family: var(--font-data); font-size: 11px; color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* Filas de la lista (móvil) */
.ec-list { display: flex; flex-direction: column; }
.ec-mrow { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px; width: 100%;
  text-align: left; padding: 13px 20px 13px 14px; background: transparent; border: 0;
  border-bottom: 1px solid var(--ec-white-08); border-left: 4px solid transparent; cursor: pointer; }
.ec-mrow:hover { background: var(--ec-white-08); }
.ec-mrow__pos { font-family: var(--font-data); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; text-align: center; }
.ec-mrow__nm { display: block; font-weight: 700; font-size: 15px; letter-spacing: .01em; text-transform: uppercase;
  color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ec-mrow__meta { display: block; font-family: var(--font-data); font-size: 11px; letter-spacing: .06em; color: var(--text-muted); margin-top: 3px; }
.ec-mrow__t { text-align: right; }
.ec-mrow__tmain { display: block; font-family: var(--font-data); font-weight: 500; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text-primary); }
.ec-mrow__pc { display: block; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-gold); margin-top: 3px; }

/* Paginación (móvil) */
.ec-pager-m { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 20px 4px; }
.ec-pager__nums { display: flex; gap: 5px; flex-wrap: wrap; justify-content: center; }
.ec-page { min-width: 38px; height: 38px; padding: 0 10px; border: 1px solid var(--border-hairline); border-radius: 4px;
  font-family: var(--font-data); font-weight: 700; font-size: 12px; letter-spacing: .08em; cursor: pointer;
  background: transparent; color: var(--text-secondary); }
.ec-page[aria-current="page"] { background: var(--ec-orange-500); border-color: var(--ec-orange-500); color: #fff; }
.ec-page[disabled] { color: var(--text-muted); cursor: default; }
.ec-page--dots { border-color: transparent; color: var(--text-muted); cursor: default; background: transparent; }
.ec-rango { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; color: var(--text-muted); }

.ec-vacio { padding: 48px 20px; text-align: center; color: var(--text-muted); font-size: 14px; }

/* Podio (móvil) */
.ec-podios-m { padding: 14px 20px 4px; display: flex; flex-direction: column; gap: 14px; }
.ec-podcard { background: var(--surface-card); border-radius: 8px; overflow: hidden; }
.ec-podcard__h { padding: 10px 14px; background: var(--ec-white-08); font-weight: 700; font-size: 12px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-gold); }
.ec-podrow { display: grid; grid-template-columns: 28px 1fr auto; align-items: center; gap: 12px; width: 100%;
  text-align: left; padding: 11px 14px; background: transparent; border: 0; border-top: 1px solid var(--ec-white-08); cursor: pointer; }
.ec-podrow:hover { background: var(--ec-white-08); }
.ec-podrow__pc { font-family: var(--font-data); font-weight: 700; font-size: 16px; }
.ec-podrow__nm { font-weight: 700; font-size: 14px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ec-podrow__t { font-family: var(--font-data); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-primary); }

/* Botón fantasma reutilizable */
.ec-btn-ghost { flex: 1; height: 44px; background: transparent; border: 1px solid var(--border-strong); border-radius: 4px;
  color: var(--text-primary); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.ec-btn-ghost:hover { background: var(--ec-white-08); }

/* Franja de marca Encarrera.uy (footer) — idéntica en móvil, escritorio y TV */
.ec-band { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 16px 20px; background: var(--ec-ink-900); border-top: 4px solid var(--ec-orange-500); }
.ec-band img { height: 18px; width: auto; }
.ec-band__right { display: flex; align-items: center; gap: 8px; }
.ec-band__dl { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.ec-band__dl:hover { color: var(--ec-orange-500); }
.ec-band__sep { font-family: var(--font-data); font-size: 11px; color: var(--text-muted); }
.ec-band__tag { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; color: var(--ec-orange-500); }
.ec-band--wide { padding: 20px 32px; }

/* ==========================================================================
   ESCRITORIO (>= 760px)
   ========================================================================== */
.ec-d { padding: 32px 32px 72px; max-width: 1280px; margin: 0 auto; }
.ec-d__head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border-hairline); }
.ec-d__logo { display: block; width: 100%; max-width: 420px; height: auto; }
.ec-d__brand .ec-eyebrow { margin-bottom: 16px; }
.ec-d__meta { margin-top: 14px; }
.ec-d__stats { display: flex; gap: 36px; }
.ec-d__stats .ec-stat__v { font-size: 34px; line-height: 1; }
.ec-d__stats .ec-stat__l { font-size: 11px; margin-top: 8px; }

.ec-d__mods { display: flex; gap: 8px; margin: 24px 0 18px; flex-wrap: wrap; }
.ec-d__mods .ec-mod { font-size: 12px; letter-spacing: .12em; padding: 11px 18px; }

.ec-d__filtros { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; padding: 14px;
  background: var(--surface-card); border-radius: 8px; }
.ec-d__filtros .ec-search { flex: 1 1 260px; height: 44px; background: var(--bg-canvas); }
.ec-d__filtros .ec-select { flex: 0 1 200px; height: 44px; background: var(--bg-canvas); }
.ec-d__tabs { display: flex; gap: 4px; }
.ec-d__tab { height: 44px; padding: 0 16px; border: 1px solid var(--border-hairline); border-radius: 4px; cursor: pointer;
  font-weight: 700; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; background: transparent; color: var(--text-secondary); }
.ec-d__tab[aria-selected="true"] { background: var(--ec-white-16); color: var(--text-primary); }
.ec-d__sexos .ec-sexo { width: auto; padding: 0 16px; }

/* Tabla (escritorio) — grilla compartida entre encabezado y filas */
.ec-tbl { --cols: 56px 68px minmax(160px,3.4fr) minmax(80px,1fr) 54px 112px minmax(70px,.9fr); }
.ec-tbl__head { display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 16px 14px 12px;
  font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted);
  border-bottom: 1px solid var(--border-hairline); margin-top: 10px; }
.ec-tbl__head .r { text-align: right; }
.ec-drow { display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: center; width: 100%; text-align: left;
  padding: 13px 14px; background: transparent; border: 0; border-bottom: 1px solid var(--ec-white-08);
  border-left: 4px solid transparent; cursor: pointer; }
.ec-drow:hover { background: var(--ec-white-08); }
.ec-drow__pos { font-family: var(--font-data); font-weight: 700; font-size: 17px; font-variant-numeric: tabular-nums; }
.ec-drow__n { font-family: var(--font-data); font-size: 14px; color: var(--text-secondary); }
.ec-drow__nm { font-weight: 700; font-size: 15px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ec-drow__cat { font-family: var(--font-data); font-size: 12px; letter-spacing: .06em; color: var(--text-gold); }
.ec-drow__pc { font-family: var(--font-data); font-size: 14px; font-variant-numeric: tabular-nums; color: var(--text-secondary); }
.ec-drow__t { font-family: var(--font-data); font-weight: 500; font-size: 16px; font-variant-numeric: tabular-nums; text-align: right; }
.ec-drow__nac { display: flex; align-items: center; gap: 8px; min-width: 0; }
.ec-flag { width: 24px; height: 16px; flex: 0 0 auto; display: block; border: 1px solid var(--border-hairline);
  background-color: var(--ec-ink-500); background-size: cover; background-position: center; }
.ec-iso { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; color: var(--text-muted); }

.ec-pager-d { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 0 4px; }
.ec-pager-d .ec-rango { font-size: 12px; }
.ec-pager-d .ec-pager__nums { justify-content: flex-end; gap: 6px; }
.ec-pager-d .ec-page { min-width: 42px; height: 42px; padding: 0 14px; font-size: 13px; }

/* Podio (escritorio) */
.ec-podios-d { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 20px; }
.ec-podios-d .ec-podcard__h { padding: 11px 16px; }
.ec-podios-d .ec-podrow { grid-template-columns: 30px minmax(0,1fr) auto; padding: 12px 16px; }
.ec-podios-d .ec-podrow__pc { font-size: 17px; }

/* ==========================================================================
   FICHA DEL CORREDOR (hoja en móvil, modal en escritorio)
   ========================================================================== */
.ec-ficha { position: fixed; inset: 0; z-index: 60; background: rgba(20, 20, 13, .82);
  display: flex; align-items: flex-end; justify-content: center; padding: 0; animation: ec-fade-in .2s ease both; }
.ec-ficha__panel { width: 100%; max-width: 460px; max-height: 92vh; overflow-y: auto; background: var(--bg-canvas);
  border-top: 4px solid var(--ec-orange-500); border-radius: 12px 12px 0 0; animation: ec-sheet-in .32s cubic-bezier(.2,.7,.3,1) both;
  padding-bottom: env(safe-area-inset-bottom); }
.ec-ficha__head { padding: 20px 22px 18px; background: var(--ec-ink-900); }
.ec-ficha__headrow { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.ec-ficha__dorsal { font-family: var(--font-data); font-size: 11px; letter-spacing: .16em; color: var(--ec-orange-500); }
.ec-ficha__nm { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 34px; line-height: 1;
  text-transform: uppercase; margin-top: 8px; text-wrap: pretty; }
.ec-ficha__sub { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-secondary); margin-top: 8px; }
.ec-ficha__x { flex: 0 0 auto; width: 36px; height: 36px; background: var(--ec-white-08); border: 1px solid var(--border-hairline);
  border-radius: 4px; color: var(--text-primary); font-size: 16px; cursor: pointer; line-height: 1; }
.ec-ficha__x:hover { background: var(--ec-white-16); }
.ec-ficha__tlabel { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.ec-ficha__tbody { padding: 20px 22px 8px; }
.ec-ficha__t { font-family: var(--font-data); font-weight: 700; font-size: 46px; line-height: 1.05; font-variant-numeric: tabular-nums;
  color: var(--ec-orange-500); margin-top: 6px; }
.ec-ficha__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--ec-white-16); margin: 16px 22px 0; }
.ec-ficha__cell { background: var(--surface-card); padding: 14px 16px; }
.ec-ficha__cv { font-family: var(--font-data); font-weight: 700; font-size: 20px; font-variant-numeric: tabular-nums; }
.ec-ficha__cl { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-muted); margin-top: 6px; }
.ec-ficha__acc { display: flex; gap: 8px; padding: 18px 22px 26px; }
.ec-btn-primary { flex: 1; height: 48px; background: var(--ec-orange-500); border: 0; border-radius: 4px; color: #fff;
  font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.ec-btn-primary:hover { background: var(--ec-orange-600); }
.ec-ficha__acc .ec-btn-ghost { height: 48px; font-size: 12px; }

@media (min-width: 760px) {
  .ec-ficha { align-items: center; padding: 24px; }
  .ec-ficha__panel { border-radius: 12px; border-top: 4px solid var(--ec-orange-500); animation: ec-rise-in .28s cubic-bezier(.2,.7,.3,1) both; }
}

/* ==========================================================================
   PANTALLA DE PROYECCIÓN (/tv)
   ========================================================================== */
.ec-tv-body { background: #000; overflow: hidden; }
.ec-tv { min-height: 100vh; display: flex; align-items: center; justify-content: center; }
.ec-tv__frame { width: 100vw; height: 100vh; max-width: calc(100vh * 16 / 9); max-height: calc(100vw * 9 / 16);
  background: var(--ec-ink-900); display: grid; grid-template-rows: auto minmax(0, 1fr) auto; overflow: hidden; container-type: size; }
.ec-tv__head { display: flex; align-items: center; justify-content: space-between; gap: 24px;
  padding: 2.6cqh 3% 2cqh; border-bottom: 4px solid var(--ec-orange-500); }
.ec-tv__head img { height: auto; width: clamp(160px, 24%, 420px); }
.ec-tv__title { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: clamp(18px, 5.2cqh, 40px);
  letter-spacing: -.01em; text-transform: uppercase; line-height: 1; text-align: right; }
.ec-tv__sub { font-family: var(--font-data); font-size: clamp(10px, 2.1cqh, 16px); letter-spacing: .16em;
  color: var(--ec-orange-500); margin-top: .7cqh; text-align: right; }
.ec-tv__body { display: flex; flex-direction: column; justify-content: flex-start; min-height: 0; overflow: hidden; padding: 1.2cqh 3%; }
.ec-tv__cols, .ec-tv__row { display: grid; grid-template-columns: 9% 11% minmax(0, 1fr) 16% 18%; gap: 1.5%; }
.ec-tv__cols { padding: 0 1% 1cqh; font-size: clamp(9px, 1.9cqh, 15px); letter-spacing: .16em; text-transform: uppercase; color: var(--text-muted); }
.ec-tv__cols .r { text-align: right; }
.ec-tv__row { align-items: center; padding: .85cqh 1%; border-left: 5px solid transparent;
  border-bottom: 1px solid rgba(255, 255, 255, .08); animation: ec-rise-in .42s cubic-bezier(.2,.7,.3,1) both; }
.ec-tv__pos { font-family: var(--font-data); font-weight: 700; font-size: clamp(14px, 3.6cqh, 34px); font-variant-numeric: tabular-nums; }
.ec-tv__n { font-family: var(--font-data); font-size: clamp(11px, 2.5cqh, 22px); color: var(--text-secondary); }
.ec-tv__nm { font-family: var(--font-display); font-style: italic; font-weight: 700; font-size: clamp(14px, 3.6cqh, 34px);
  text-transform: uppercase; line-height: 1.05; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ec-tv__cat { font-family: var(--font-data); font-size: clamp(10px, 2.3cqh, 20px); letter-spacing: .06em; color: var(--text-gold); }
.ec-tv__t { font-family: var(--font-data); font-weight: 500; font-size: clamp(13px, 3.2cqh, 30px); font-variant-numeric: tabular-nums; text-align: right; }
.ec-tv__foot { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 1.8cqh 3%;
  background: #0F0F0A; border-top: 1px solid var(--border-hairline); }
.ec-tv__foot img { height: auto; width: clamp(110px, 13%, 200px); }
.ec-tv__footr { display: flex; align-items: center; gap: 18px; }
.ec-tv__page { font-family: var(--font-data); font-size: clamp(10px, 2.1cqh, 17px); letter-spacing: .14em; color: var(--text-secondary); }
.ec-tv__url { font-family: var(--font-data); font-size: clamp(10px, 2.1cqh, 17px); letter-spacing: .14em; color: var(--ec-orange-500); }

/* Controles del operador (se ocultan solos) */
.ec-tv__ctrl { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); display: flex; align-items: center; gap: 12px;
  padding: 8px 12px; background: rgba(20, 20, 13, .85); border: 1px solid var(--border-hairline); border-radius: 6px;
  transition: opacity .4s ease; z-index: 10; }
.ec-tv.idle .ec-tv__ctrl { opacity: 0; pointer-events: none; }
.ec-tv__btn { height: 40px; padding: 0 18px; background: var(--ec-white-08); border: 1px solid var(--border-hairline); border-radius: 4px;
  color: var(--text-primary); font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; cursor: pointer; }
.ec-tv__hint { font-size: 12px; color: var(--text-muted); }
.ec-tv.idle { cursor: none; }

/* ==========================================================================
   ANIMACIÓN / accesibilidad
   ========================================================================== */
[data-anim="off"] *, [data-anim="off"] { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
:focus-visible { outline: 2px solid var(--ec-orange-400); outline-offset: 2px; }

/* ==========================================================================
   PÁGINA DE DESCARGAS (descargas.php)
   ========================================================================== */
.ec-dl { max-width: 900px; margin: 0 auto; padding: 32px 20px 56px; }
.ec-dl__head { padding-bottom: 22px; border-bottom: 1px solid var(--border-hairline); }
.ec-dl__logo { display: block; width: 100%; max-width: 320px; height: auto; margin: 16px 0 0; }
.ec-dl__title { font-family: var(--font-display); font-style: italic; font-weight: 800; font-size: 30px;
  text-transform: uppercase; margin: 18px 0 6px; letter-spacing: -.01em; }
.ec-dl__lead { font-size: 14px; color: var(--text-secondary); max-width: 60ch; }
.ec-dl__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; margin-top: 24px; }
.ec-dlcard { background: var(--surface-card); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.ec-dlcard__h { padding: 12px 16px; background: var(--ec-white-08); font-weight: 700; font-size: 13px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--text-gold); }
.ec-dlcard__body { padding: 16px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.ec-dlcard__meta { font-family: var(--font-data); font-size: 11px; letter-spacing: .08em; color: var(--text-muted); }
.ec-dlcard__acc { display: flex; gap: 8px; margin-top: auto; }
.ec-dlcard__acc a { flex: 1; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 4px; font-weight: 700; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.ec-dl__csv { background: transparent; border: 1px solid var(--border-strong); color: var(--text-primary); }
.ec-dl__csv:hover { background: var(--ec-white-08); color: var(--text-primary); }
.ec-dl__pdf { background: var(--ec-orange-500); color: #fff; }
.ec-dl__pdf:hover { background: var(--ec-orange-600); color: #fff; }
.ec-dl__vacio { margin-top: 24px; padding: 40px 20px; text-align: center; color: var(--text-muted);
  background: var(--surface-card); border-radius: 8px; }
.ec-dl__back { display: inline-block; margin-top: 8px; font-family: var(--font-data); font-size: 11px;
  letter-spacing: .08em; text-transform: uppercase; color: var(--text-secondary); }
.ec-dl__back:hover { color: var(--ec-orange-500); }

/* ---- Panel de ajustes (ajustes.php) ---- */
.ec-cfg__msg { margin-top: 20px; padding: 12px 16px; border-radius: 6px; font-size: 13px; }
.ec-cfg__msg--ok { background: rgba(84,160,74,.18); color: #b8e0b0; border: 1px solid rgba(120,200,110,.4); }
.ec-cfg__msg--err { background: rgba(241,101,42,.16); color: var(--ec-orange-200); border: 1px solid var(--ec-orange-700); }
.ec-cfg__msg--warn { background: var(--ec-white-08); color: var(--text-secondary); border: 1px solid var(--border-hairline); }
.ec-cfg__msg code { font-family: var(--font-data); color: var(--text-gold); }
.ec-cfg__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; margin-top: 22px; }
.ec-cfg__card { background: var(--surface-card); border: 1px solid var(--border-hairline); border-radius: 8px;
  padding: 16px; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.ec-cfg__card legend { display: flex; align-items: center; gap: 10px; padding: 0; font-weight: 700; font-size: 13px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--text-gold); }
.ec-cfg__badge { font-family: var(--font-data); font-size: 10px; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 3px; }
.ec-cfg__crudo { font-family: var(--font-data); font-size: 11px; letter-spacing: .04em; color: var(--text-muted); margin-top: -4px; }
.ec-cfg__crudo b { color: var(--text-secondary); font-weight: 700; }
.ec-cfg__badge.is-on { background: rgba(84,160,74,.22); color: #b8e0b0; }
.ec-cfg__badge.is-hold { background: var(--ec-white-08); color: var(--text-muted); }
.ec-cfg__badge.is-off { background: var(--ec-white-08); color: var(--text-muted); }
.ec-cfg__row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ec-cfg__field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .04em;
  text-transform: uppercase; color: var(--text-secondary); }
.ec-cfg__field small { text-transform: none; letter-spacing: 0; color: var(--text-muted); }
.ec-cfg__field input { height: 42px; padding: 0 12px; background: var(--bg-canvas); border: 1px solid var(--border-hairline);
  border-radius: 4px; color: var(--text-primary); font-size: 14px; }
.ec-cfg__field input:focus { outline: none; border-color: var(--border-strong); }
.ec-cfg__check { display: flex; align-items: flex-start; gap: 10px; font-size: 12px; color: var(--text-secondary); cursor: pointer; }
.ec-cfg__check input { width: 18px; height: 18px; margin-top: 1px; flex: 0 0 auto; accent-color: var(--ec-orange-500); }
.ec-cfg__actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.ec-cfg__actions .ec-btn-primary { flex: 0 0 auto; padding: 0 28px; }
.ec-cfg__login { display: flex; flex-direction: column; gap: 14px; max-width: 320px; margin-top: 28px; }
.ec-cfg__login .ec-btn-primary { flex: 0 0 auto; align-self: flex-start; padding: 0 28px; }

/* ==========================================================================
   IMPRESIÓN (página imprimir.php y respaldo de la vista principal)
   ========================================================================== */
@media print {
  @page { margin: 14mm; }
  html, body { background: #fff !important; color: #111 !important; }
  .ec-app { background: #fff !important; }
  .ec-m__filtros, .ec-mods, .ec-d__mods, .ec-d__filtros,
  .ec-pager-m, .ec-pager-d, .ec-band, .ec-sexos, .ec-tabs, .ec-boot { display: none !important; }
  .ec-m, .ec-d { max-width: none; }
  .ec-m__head, .ec-d__head { background: #fff !important; }
  .ec-m__logo, .ec-d__logo { filter: invert(1); }
  .ec-stat__v, .ec-mrow__nm, .ec-drow__nm, .ec-mrow__tmain, .ec-drow__t, .ec-drow__pos, .ec-mrow__pos { color: #111 !important; }
  .ec-mrow, .ec-drow { border-color: #ccc !important; break-inside: avoid; }
  .ec-drow__cat, .ec-mrow__pc { color: #7a5a00 !important; }
  .ec-iso, .ec-drow__n, .ec-mrow__meta { color: #555 !important; }
  .ec-eyebrow { background: #F1652A !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
