/* Jarvis · v1 (28 nov 2026). Primero el móvil. */
:root {
  --fondo: #0a0f1a;
  --panel: #111a2b;
  --panel2: #172238;
  --borde: #22314d;
  --texto: #e9eefb;
  --suave: #9aabc9;
  --acento: #47c6f0;
  --acento-fuerte: #1aa6d9;
  --sobre-acento: #04131c;
  --ok: #3ddc97;
  --aviso: #ffb547;
  --mal: #ff6b6b;
  --sombra: 0 10px 30px rgba(0, 0, 0, .35);
  --radio: 14px;
  color-scheme: dark;
}
@media (prefers-color-scheme: light) {
  :root {
    --fondo: #f3f6fb;
    --panel: #ffffff;
    --panel2: #edf2fa;
    --borde: #d8e0ee;
    --texto: #0f1729;
    --suave: #5a6681;
    --acento: #0a86c9;
    --acento-fuerte: #076ea6;
    --sobre-acento: #ffffff;
    --ok: #12985f;
    --aviso: #b86e00;
    --mal: #c93636;
    --sombra: 0 8px 24px rgba(20, 40, 80, .12);
    color-scheme: light;
  }
}
@font-face { font-family: "Rotulo"; src: url("/letra.ttf") format("truetype"); font-weight: 600; font-display: swap; }

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--fondo); color: var(--texto); }
body {
  font: 16px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--acento); }
img, video { display: block; max-width: 100%; }
.oculto { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.app {
  max-width: 760px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 8px) 16px calc(env(safe-area-inset-bottom) + 110px);
}
.cargando { color: var(--suave); text-align: center; padding: 48px 0; }
.suave { color: var(--suave); }
.pequeno { font-size: 13px; }
.error { color: var(--mal); min-height: 1.4em; margin: 6px 0 0; }

/* Cabecera */
.cabecera {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0 14px; position: sticky; top: 0; z-index: 5;
  background: linear-gradient(var(--fondo) 75%, transparent);
}
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--texto); font-weight: 700; letter-spacing: .02em; }
.marca img { width: 30px; height: 30px; border-radius: 9px; }
.volver { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; color: var(--acento); font-weight: 600; padding: 6px 0; }

/* Botones */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 10px 16px; border-radius: 12px;
  border: 1px solid var(--borde); background: var(--panel2); color: var(--texto);
  font-weight: 600; cursor: pointer; text-decoration: none;
}
.boton:disabled { opacity: .55; cursor: default; }
.boton.principal { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); }
.boton.principal:active { background: var(--acento-fuerte); }
.boton.ok { background: color-mix(in srgb, var(--ok) 18%, var(--panel2)); border-color: var(--ok); color: var(--ok); }
.boton.peligro { color: var(--mal); border-color: color-mix(in srgb, var(--mal) 45%, var(--borde)); background: transparent; }
.boton.grande { width: 100%; min-height: 52px; font-size: 17px; }
.boton.pequeno { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.boton.anadir { width: 100%; border-style: dashed; background: transparent; color: var(--acento); margin-top: 4px; }
.enlace { background: none; border: 0; color: var(--suave); padding: 8px 4px; cursor: pointer; font-size: 15px; }

/* Entrada */
.entrada { min-height: 78vh; display: flex; flex-direction: column; justify-content: center; align-items: stretch; gap: 12px; max-width: 380px; margin: 0 auto; text-align: center; }
.entrada .logo { width: 84px; height: 84px; margin: 0 auto 4px; border-radius: 24px; box-shadow: 0 0 0 1px var(--borde), 0 0 40px color-mix(in srgb, var(--acento) 35%, transparent); }
.entrada h1 { margin: 0; font-size: 34px; letter-spacing: .04em; }
.entrada p { margin: 0 0 8px; }
.entrada input {
  width: 100%; min-height: 52px; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--borde); background: var(--panel); font-size: 17px; text-align: center;
}
.entrada input:focus { outline: 2px solid var(--acento); outline-offset: 1px; }

/* Inicio */
.saludo h1 { margin: 6px 0 2px; font-size: 28px; }
.saludo p { margin: 0 0 18px; }
.banda {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: var(--radio);
  background: color-mix(in srgb, var(--acento) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--acento) 40%, var(--borde));
  margin-bottom: 16px; font-size: 15px;
}
.giro { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--acento); border-right-color: transparent; animation: giro .9s linear infinite; flex: none; }
@keyframes giro { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .giro { animation: none; } }
.tanda { margin-bottom: 28px; }
.tanda-cab h2 { margin: 0; font-size: 21px; }
.tanda-cab p { margin: 2px 0 6px; font-size: 14px; }
.grupo { margin: 18px 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; color: var(--suave); font-weight: 700; }
.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 560px) { .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tarjeta { text-decoration: none; color: var(--texto); background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; display: flex; flex-direction: column; }
.tarjeta:active { transform: scale(.985); }
.miniatura { position: relative; aspect-ratio: 9 / 16; background: var(--panel2); overflow: hidden; }
.miniatura img { width: 100%; height: 100%; object-fit: cover; }
.duracion { position: absolute; right: 6px; bottom: 6px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; font-weight: 600; padding: 2px 7px; border-radius: 8px; }
.estado { position: absolute; left: 6px; top: 6px; font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 9px; background: rgba(0, 0, 0, .72); color: #fff; }
.estado.ok { background: var(--ok); color: #04210f; }
.estado.trabajando { background: var(--acento); color: var(--sobre-acento); }
.estado.fallo { background: var(--mal); color: #fff; }
.tarjeta-pie { padding: 9px 10px 11px; display: flex; flex-direction: column; gap: 2px; font-size: 14px; line-height: 1.3; }
.tarjeta-pie strong { font-size: 13px; color: var(--acento); letter-spacing: .03em; }
.proximo { margin-top: 10px; padding: 14px; border-radius: var(--radio); border: 1px dashed var(--borde); color: var(--suave); font-size: 14px; }
.proximo a { font-weight: 600; }

/* Vídeo */
.titulo-video h1 { margin: 2px 0 2px; font-size: 22px; line-height: 1.25; }
.titulo-video p { margin: 0 0 12px; font-size: 14px; }
.reproductor { background: #000; border-radius: var(--radio); overflow: hidden; display: flex; justify-content: center; }
.reproductor video { width: 100%; max-height: 68vh; aspect-ratio: 9 / 16; object-fit: contain; background: #000; }
@media (min-width: 700px) { .reproductor video { width: auto; height: 68vh; } }
.bajo-video { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0 4px; font-size: 14px; flex-wrap: wrap; }
.linea-trabajo { margin: 10px 0 0; padding: 11px 13px; border-radius: 12px; background: var(--panel); border: 1px solid var(--borde); font-size: 15px; display: flex; gap: 10px; align-items: flex-start; }
.linea-trabajo.trabajando { border-color: color-mix(in srgb, var(--acento) 50%, var(--borde)); }
.linea-trabajo.hecho { border-color: color-mix(in srgb, var(--ok) 50%, var(--borde)); }
.linea-trabajo.fallo { border-color: color-mix(in srgb, var(--mal) 60%, var(--borde)); }
.linea-trabajo .cuerpo { flex: 1; }
.linea-trabajo .cuerpo .boton { margin-top: 8px; }
.revision { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; }
.revision .boton { flex: 1 1 140px; }
.nota-caja { width: 100%; margin-top: 4px; }
.nota-caja textarea { width: 100%; min-height: 84px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borde); background: var(--panel); resize: vertical; }
.nota-caja .acciones { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.nota-guardada { margin: 0 0 8px; padding: 10px 12px; border-radius: 12px; background: var(--panel); border-left: 3px solid var(--aviso); font-size: 15px; white-space: pre-wrap; }

.pestanas { display: grid; grid-template-columns: 1fr 1fr; background: var(--panel); border: 1px solid var(--borde); border-radius: 12px; padding: 4px; margin: 16px 0 12px; }
.pestanas button { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--suave); cursor: pointer; min-height: 42px; }
.pestanas button[aria-selected="true"] { background: var(--panel2); color: var(--texto); box-shadow: 0 0 0 1px var(--borde); }
.lista { display: flex; flex-direction: column; gap: 10px; }
.ficha { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; }
.ficha.abierta { border-color: color-mix(in srgb, var(--acento) 45%, var(--borde)); }
.ficha-cab { width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; background: none; border: 0; text-align: left; cursor: pointer; min-height: 56px; }
.ficha-cab .principal { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ficha-cab .principal strong { font-weight: 650; overflow-wrap: anywhere; }
.ficha-cab .flecha { color: var(--suave); flex: none; }
.cambiado { font-size: 12px; font-weight: 700; color: var(--aviso); }
.ficha-cuerpo { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }
.campo { display: flex; flex-direction: column; gap: 6px; }
.campo > span:first-child, .etiqueta { font-size: 13px; font-weight: 700; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; margin: 0; }
.campo textarea, .campo select {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--borde); background: var(--panel2); min-height: 46px;
}
.campo textarea { resize: vertical; font-family: "Rotulo", -apple-system, sans-serif; font-weight: 600; font-size: 18px; line-height: 1.35; }
.dos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.deslizador { display: flex; align-items: center; gap: 8px; }
.deslizador input[type="range"] { flex: 1; accent-color: var(--acento); min-height: 36px; }
.deslizador output { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; color: var(--suave); font-size: 14px; }
.casilla { display: flex; align-items: center; gap: 10px; min-height: 44px; }
.casilla input { width: 22px; height: 22px; accent-color: var(--acento); }
.acciones-fila { display: flex; gap: 8px; flex-wrap: wrap; }

/* El fotograma con el rótulo encima */
.editor-rotulo { display: grid; grid-template-columns: minmax(0, 46%) minmax(0, 1fr); gap: 14px; align-items: start; }
@media (max-width: 380px) { .editor-rotulo { grid-template-columns: 1fr; } .editor-rotulo .marco { max-width: 230px; margin: 0 auto; } }
.marco { position: relative; width: 100%; aspect-ratio: 9 / 16; border-radius: 12px; overflow: hidden; background: #111; user-select: none; -webkit-user-select: none; }
.marco .fondo { width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.marco .guia { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(255, 255, 255, .45); pointer-events: none; }
.marco .guia.arriba { top: 14.8%; }
.marco .guia.abajo { top: 85.2%; }
.marco .pista { position: absolute; left: 6px; right: 6px; bottom: 6px; font-size: 10px; color: rgba(255, 255, 255, .8); text-shadow: 0 1px 2px #000; pointer-events: none; text-align: center; }
.rotulo {
  position: absolute; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center;
  gap: calc(var(--tam, 20px) * .22); font-family: "Rotulo", -apple-system, sans-serif; font-weight: 600; white-space: pre;
  touch-action: none; cursor: grab; outline: 2px dashed transparent; outline-offset: 3px; border-radius: 4px;
}
.rotulo:hover, .rotulo.moviendo { outline-color: rgba(71, 198, 240, .9); }
.rotulo .linea {
  position: relative; font-size: var(--tam, 20px); line-height: 1; color: #fff; background: rgba(17, 17, 17, .92);
  padding: calc(var(--tam, 20px) * .14) calc(var(--tam, 20px) * .3); border-radius: calc(var(--tam, 20px) * .16);
}
.rotulo .linea.tachada::after { content: ""; position: absolute; left: calc(var(--tam, 20px) * .24); right: calc(var(--tam, 20px) * .24); top: 58%; height: max(1px, calc(var(--tam, 20px) / 14)); background: #eb4034; }
.nudge { display: grid; grid-template-columns: repeat(3, 44px); grid-template-rows: repeat(2, 40px); gap: 6px; justify-content: start; }
.nudge button { border-radius: 10px; border: 1px solid var(--borde); background: var(--panel2); cursor: pointer; font-size: 16px; }
.nudge .arr { grid-column: 2; grid-row: 1; }
.nudge .izq { grid-column: 1; grid-row: 2; }
.nudge .aba { grid-column: 2; grid-row: 2; }
.nudge .der { grid-column: 3; grid-row: 2; }

/* Clips */
.clip-cab { display: flex; align-items: center; gap: 10px; padding: 12px 14px 0; }
.clip-cab strong { flex: 1; }
.dicho { margin: 8px 14px 0; font-size: 15px; color: var(--texto); }
.bloque { padding: 12px 14px 0; display: flex; flex-direction: column; gap: 8px; }
.bloque:last-child { padding-bottom: 14px; }
.tomas { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px; }
.toma { flex: 0 0 auto; width: 96px; border-radius: 12px; border: 2px solid var(--borde); background: var(--panel2); padding: 0; overflow: hidden; cursor: pointer; text-align: center; }
.toma img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #111; }
.toma span { display: block; padding: 5px 4px; font-size: 12px; font-weight: 700; }
.toma.elegida { border-color: var(--ok); }
.toma.elegida span { color: var(--ok); }
.palabras { display: flex; flex-wrap: wrap; gap: 6px; }
.palabra { border: 1px solid var(--borde); background: var(--panel2); border-radius: 999px; padding: 7px 11px; min-height: 36px; cursor: pointer; font-size: 15px; }
.palabra.fuera { opacity: .4; }
.palabra.actual, .palabra.borde { background: var(--acento); border-color: var(--acento); color: var(--sobre-acento); font-weight: 700; }
.segmentado { display: inline-grid; grid-auto-flow: column; background: var(--panel2); border: 1px solid var(--borde); border-radius: 10px; padding: 3px; gap: 3px; }
.segmentado button { border: 0; background: none; padding: 7px 12px; border-radius: 8px; font-weight: 600; color: var(--suave); cursor: pointer; }
.segmentado button[aria-pressed="true"] { background: var(--acento); color: var(--sobre-acento); }

/* Historial */
.historial { margin-top: 24px; }
.historial h2 { font-size: 15px; margin: 0 0 8px; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; }
.historial ul { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.historial li { font-size: 14px; padding: 8px 10px; background: var(--panel); border-radius: 10px; border: 1px solid var(--borde); }
.historial li.deshecho { opacity: .55; text-decoration: line-through; }

/* Barra de guardar */
.barra {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 12px 16px calc(env(safe-area-inset-bottom) + 12px);
  background: color-mix(in srgb, var(--panel) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--borde); box-shadow: var(--sombra);
}
.barra .dentro { max-width: 760px; margin: 0 auto; display: flex; gap: 10px; align-items: center; }
.barra .texto { flex: 1; font-size: 14px; color: var(--suave); line-height: 1.25; }
.barra .boton.principal { flex: 0 0 auto; }

/* Ventana de la toma */
.velo { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, .78); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ventana { width: min(420px, 100%); max-height: 100%; overflow: auto; background: var(--panel); border-radius: 18px; border: 1px solid var(--borde); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.ventana video { width: 100%; max-height: 62vh; aspect-ratio: 9 / 16; background: #000; border-radius: 12px; object-fit: contain; }
.ventana h3 { margin: 0; font-size: 17px; }
.ventana .acciones-fila .boton { flex: 1; }

/* Aviso flotante */
.aviso {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 90px); z-index: 40;
  max-width: min(92vw, 520px); padding: 12px 16px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--borde);
  box-shadow: var(--sombra); font-size: 15px; font-weight: 600; text-align: center;
}
.aviso.ok { border-color: var(--ok); }
.aviso.mal { border-color: var(--mal); color: var(--mal); }

/* Menú de arriba: Creativos · Números */
.menu { display: inline-grid; grid-auto-flow: column; gap: 2px; background: var(--panel); border: 1px solid var(--borde); border-radius: 11px; padding: 3px; }
.menu a { text-decoration: none; color: var(--suave); font-weight: 650; font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.menu a[aria-current="page"] { background: var(--panel2); color: var(--texto); box-shadow: 0 0 0 1px var(--borde); }
@media (max-width: 360px) { .marca span { display: none; } }

/* Números */
.app.ancha { max-width: 1180px; }
.num-cab h1 { margin: 6px 0 2px; font-size: 28px; }
.num-cab p { margin: 0 0 12px; font-size: 14.5px; }
.controles { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.diasel { display: inline-flex; align-items: center; gap: 6px; }
.diasel button { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--borde); background: var(--panel2); cursor: pointer; font-size: 20px; line-height: 1; }
.diasel button:disabled { opacity: .35; cursor: default; }
.diasel strong { min-width: 8.5em; text-align: center; font-size: 15px; }
.rejilla-num { display: grid; gap: 14px; grid-template-columns: minmax(0, 1fr); }
.rejilla-num .col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
@media (min-width: 960px) {
  .rejilla-num { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); align-items: start; }
  .rejilla-num .ancho { grid-column: 1 / -1; }
}
.caja { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); padding: 14px; min-width: 0; }
.caja h2 { margin: 0 0 10px; font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--suave); }
.caja-cab { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.caja-cab h2 { margin-bottom: 10px; }
.beneficio .etiqueta { margin: 0; }
.cifra-grande { font-size: 42px; font-weight: 800; margin: 2px 0 2px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; line-height: 1.1; }
.beneficio > .suave { margin: 0; font-size: 14.5px; }
.beneficio > .suave.pequeno { margin-top: 8px; font-size: 13px; line-height: 1.45; }
.pos { color: var(--ok); }
.neg { color: var(--mal); }
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
@media (min-width: 560px) and (max-width: 959px) { .kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.kpi { background: var(--panel2); border-radius: 12px; padding: 10px 12px; min-width: 0; }
.kpi span { display: block; font-size: 11.5px; color: var(--suave); text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.kpi strong { display: block; font-size: 21px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi small { display: block; font-size: 12.5px; color: var(--suave); margin-top: 2px; line-height: 1.3; }
.vivo { border-style: dashed; color: var(--suave); font-size: 14.5px; }
.vivo strong { color: var(--texto); }
.cascada { display: flex; flex-direction: column; gap: 9px; }
.cascada .fila { display: grid; grid-template-columns: minmax(0, 10.5em) minmax(0, 1fr) auto; align-items: center; gap: 10px; font-size: 14.5px; }
.cascada .pista-c { height: 10px; }
.cascada .barra-c { height: 10px; border-radius: 6px; background: color-mix(in srgb, var(--mal) 65%, transparent); }
.cascada .fila.entra .barra-c { background: color-mix(in srgb, var(--acento) 80%, transparent); }
.cascada .fila.total { border-top: 1px solid var(--borde); padding-top: 9px; font-weight: 750; }
.cascada .fila.total .barra-c { background: var(--ok); }
.cascada .fila.total.neg .barra-c { background: var(--mal); }
.cascada .valor { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.camps { display: flex; flex-direction: column; gap: 10px; }
.camp { display: block; text-decoration: none; color: var(--texto); background: var(--panel2); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.camp:active { transform: scale(.99); }
.camp-cab { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.camp-cab strong { font-size: 16px; overflow-wrap: anywhere; }
.camp-cab .benef { font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.camp p { margin: 4px 0 0; font-size: 14px; color: var(--suave); font-variant-numeric: tabular-nums; }
.camp p b { color: var(--texto); font-weight: 650; }
.camp p b.pos { color: var(--ok); }
.camp p b.neg { color: var(--mal); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip { display: inline-block; font-size: 12.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--panel2); border: 1px solid var(--borde); color: var(--suave); white-space: nowrap; }
.chip.subir { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 55%, var(--borde)); }
.chip.bajar, .chip.apagar { color: var(--mal); border-color: color-mix(in srgb, var(--mal) 55%, var(--borde)); }
.chip.igual { color: var(--texto); }
.chip.ojo { color: var(--aviso); border-color: color-mix(in srgb, var(--aviso) 55%, var(--borde)); }
.hacer ul, .acciones-lista, .lista-meta { margin: 0; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.lista-meta { font-size: 14px; color: var(--suave); }
.lista-meta strong { color: var(--texto); }
.hacer details, .caja details { margin-top: 12px; font-size: 14px; }
.hacer summary, .caja summary { cursor: pointer; color: var(--acento); font-weight: 650; min-height: 32px; }
.md p { margin: 6px 0; }
.md h4 { margin: 12px 0 4px; font-size: 14px; }
.md ul { margin: 4px 0; padding-left: 18px; display: block; list-style: disc; font-size: 14px; }
.md li { margin: 3px 0; }
.tabla-md { overflow-x: auto; margin: 6px 0; }
.md table { border-collapse: collapse; font-size: 12.5px; }
.md td { border: 1px solid var(--borde); padding: 3px 6px; white-space: nowrap; }
.grafico svg { width: 100%; height: auto; display: block; }
.grafico .eje { stroke: var(--borde); stroke-width: 1; }
.grafico .bar { cursor: pointer; }
.grafico .bar.pos { fill: color-mix(in srgb, var(--ok) 70%, transparent); }
.grafico .bar.neg { fill: color-mix(in srgb, var(--mal) 70%, transparent); }
.grafico .bar.sel { stroke: var(--texto); stroke-width: 1.5; }
.grafico .bar.pos.sel { fill: var(--ok); }
.grafico .bar.neg.sel { fill: var(--mal); }
.grafico .dia { fill: var(--suave); font-size: 11px; }
.grafico .dia.sel { fill: var(--texto); font-weight: 700; }
.desliza { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; margin-top: 8px; }
.tabla th, .tabla td { padding: 7px 6px; text-align: right; border-bottom: 1px solid var(--borde); white-space: nowrap; }
.tabla th:first-child, .tabla td:first-child { text-align: left; }
.tabla thead th { color: var(--suave); font-size: 11.5px; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.tabla td a { color: var(--texto); text-decoration: none; }
.tabla.tres { font-size: 12.5px; }
.tabla.tres th, .tabla.tres td { padding: 6px 3px; }
.tabla.tres td:first-child { white-space: normal; line-height: 1.2; min-width: 4.6em; padding-right: 4px; }
@media (max-width: 400px) { .tabla.tres { font-size: 12px; } }
.tabla.tres th.total, .tabla.tres td.total { font-weight: 750; background: color-mix(in srgb, var(--acento) 8%, transparent); }
.tabla.tres td:first-child { color: var(--suave); }
.pie-num { font-size: 13px; color: var(--suave); margin: 18px 0 0; }
.anuncios { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.anuncio { background: var(--panel2); border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
.anuncio > p { margin: 2px 0 0; }
.anuncio .metricas { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 7px; font-size: 14px; font-variant-numeric: tabular-nums; color: var(--suave); }
.anuncio .metricas b { color: var(--texto); font-weight: 650; }
.caja .segmentado { max-width: 100%; }
.caja .segmentado button { white-space: nowrap; }

/* Submenú de Números y ranking de anuncios */
.submenu { display: inline-grid; grid-auto-flow: column; gap: 2px; background: var(--panel); border: 1px solid var(--borde); border-radius: 11px; padding: 3px; margin: 2px 0 14px; }
.submenu a { text-decoration: none; color: var(--suave); font-weight: 650; font-size: 14px; padding: 7px 12px; border-radius: 8px; }
.submenu a[aria-current="page"] { background: var(--panel2); color: var(--texto); box-shadow: 0 0 0 1px var(--borde); }
.desliza-x { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.desliza-x::-webkit-scrollbar { display: none; }
.desliza-x button { white-space: nowrap; }
.ordenes { margin: 10px 0 14px; }
.ranks { display: flex; flex-direction: column; gap: 10px; margin-top: 8px; }
.rank { display: grid; grid-template-columns: 28px 64px minmax(0, 1fr); gap: 10px; align-items: start; background: var(--panel2); border: 1px solid var(--borde); border-radius: 12px; padding: 10px; transition: box-shadow .3s; }
.rank.resalta { box-shadow: 0 0 0 2px var(--acento); }
.rank-n { font-weight: 800; font-size: 18px; color: var(--suave); text-align: center; padding-top: 2px; font-variant-numeric: tabular-nums; }
.rank-mini { width: 64px; height: 64px; border-radius: 9px; object-fit: cover; background: var(--panel); }
.rank-mini.vacia { border: 1px dashed var(--borde); }
.rank-cuerpo { min-width: 0; }
.rank-cuerpo strong { overflow-wrap: anywhere; font-size: 15px; }
.rank-valor { font-weight: 800; font-size: 17px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pista-r { height: 6px; background: var(--panel); border-radius: 4px; margin: 6px 0 4px; overflow: hidden; }
.barra-r { height: 6px; border-radius: 4px; background: var(--acento); }
.barra-r.neg { background: var(--mal); }
.rank .metricas { display: flex; flex-wrap: wrap; gap: 3px 12px; margin-top: 4px; font-size: 13px; color: var(--suave); font-variant-numeric: tabular-nums; }
.rank .metricas b { color: var(--texto); font-weight: 650; }
@media (max-width: 560px) { .rank .metricas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .rank { grid-template-columns: 22px 52px minmax(0, 1fr); gap: 8px; } .rank-mini { width: 52px; height: 52px; } }
.rank .metricas b.pos { color: var(--ok); }
.rank .metricas b.neg { color: var(--mal); }
.rank > .rank-cuerpo > p { margin: 0; }
.grafico .punto { stroke: rgba(0, 0, 0, .25); stroke-width: 1; cursor: pointer; }
.grafico .punto.pos { fill: color-mix(in srgb, var(--ok) 55%, transparent); }
.grafico .punto.neg { fill: color-mix(in srgb, var(--mal) 55%, transparent); }
.grafico .eje-t { fill: var(--suave); font-size: 10px; }
.grafico .rejilla-g { stroke: var(--borde); stroke-width: .6; stroke-dasharray: 3 4; }
.casilla.pequeno { font-size: 14px; min-height: 36px; }
.casilla.pequeno input { width: 18px; height: 18px; }

/* Ganchos y CTA */
.grupo-g { grid-template-columns: 28px minmax(0, 1fr); }
@media (max-width: 560px) { .grupo-g { grid-template-columns: 22px minmax(0, 1fr); } }
.cita { margin: 8px 0 2px; font-size: 16px; line-height: 1.4; font-weight: 600; color: var(--texto); }
.cita .etiqueta-c { display: inline-block; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--acento); margin-right: 6px; }
