/* admin.css — Flyncom 4 · sistema de diseño del panel.
   Escala de 8px, jerarquía tipográfica real, componentes consistentes. */

:root {
  --tinta: #10131a; --texto: #2a2f3a; --gris: #5a6376; --gris-2: #6b7487;
  --fondo: #f5f6f9; --panel: #ffffff; --linea: #e6e8ef; --suave: #f0f2f6;
  --ac: #4338ca; --ac-hover: #3730a3; --ac-2: #6425c7;
  --ok: #067a52; --ok-bg: #e3f4ec; --ok-viva: #10b981;
  --mal: #bd2430; --mal-bg: #fbe9e8; --alerta: #8f4708; --alerta-bg: #fcf1e0;
  --info: #14509f; --info-bg: #e6effb;
  --sombra: 0 1px 2px rgba(16,19,26,.05), 0 8px 24px -16px rgba(16,19,26,.12);
  --sombra-alta: 0 24px 64px -24px rgba(16,19,26,.28);
  --radio: 12px;
  --sans: 'Inter', system-ui, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; }
body { font-family: var(--sans); background: var(--fondo); color: var(--texto); font-size: 13.5px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
svg.ic { width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }

/* ═══ Tipografía ═══ */
.t-display { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--tinta); line-height: 1.2; }
.t-titulo  { font-size: 16px; font-weight: 700; letter-spacing: -0.2px; color: var(--tinta); }
.t-sub     { font-size: 13px; color: var(--gris); }
.t-mini    { font-size: 12px; color: var(--gris); }
.t-micro   { font-size: 11px; font-weight: 600; letter-spacing: 0.6px; text-transform: uppercase; color: var(--gris-2); }

/* ═══ Controles ═══ */
input, select, textarea {
  font-family: var(--sans); font-size: 13.5px; color: var(--texto);
  border: 1px solid var(--linea); border-radius: 8px; padding: 9px 12px;
  background: var(--panel); width: 100%; transition: border-color .12s, box-shadow .12s;
}
input:hover, select:hover, textarea:hover { border-color: #cdd2de; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
input::placeholder, textarea::placeholder { color: var(--gris-2); }
label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: 0.4px; text-transform: uppercase; color: var(--gris); margin-bottom: 6px; }
.campo { margin-bottom: 16px; }
.fila { display: grid; gap: 16px; }
.fila.c2 { grid-template-columns: 1fr 1fr; }
.fila.c3 { grid-template-columns: 1fr 1fr 1fr; }
button { font-family: var(--sans); cursor: pointer; }

/* El `hidden` del HTML lo pisa cualquier regla con `display`: sin esto un
   botón oculto (`.btn` es inline-flex) se sigue viendo. */
[hidden] { display: none !important; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  font-size: 13px; font-weight: 600; border-radius: 8px; padding: 9px 16px; border: 1px solid transparent;
  transition: all .12s; white-space: nowrap; }
.btn.primario { background: var(--ac); color: #fff; }
.btn.primario:hover { background: var(--ac-hover); }
.btn.suave { background: var(--panel); color: var(--texto); border-color: var(--linea); box-shadow: 0 1px 2px rgba(16,19,26,.04); }
.btn.suave:hover { border-color: #c6cbda; }
.btn.peligro { background: var(--mal-bg); color: var(--mal); }
.btn.peligro:hover { background: #f9dcda; }
.btn.fantasma { background: none; color: var(--gris); padding: 7px 10px; }
.btn.fantasma:hover { background: var(--suave); color: var(--texto); }
.btn.mini { font-size: 12px; padding: 6px 11px; border-radius: 7px; }
.btn:disabled { opacity: .55; cursor: default; }
.btn .girando { width: 13px; height: 13px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: girar .7s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

/* ═══ Login / selector ═══ */
.centro { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.tarjeta-acceso { background: var(--panel); border: 1px solid var(--linea); border-radius: 16px;
  padding: 40px; width: 100%; max-width: 400px; box-shadow: var(--sombra-alta); }
.marca-grande { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.marca-grande img { width: 36px; height: 36px; }
.marca-grande b { font-size: 19px; font-weight: 800; letter-spacing: -0.3px; color: var(--tinta); }
.selector { width: 100%; max-width: 900px; }
.grilla-medios { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-top: 28px; }
.tarjeta-medio { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 22px; display: flex; gap: 16px; align-items: center; transition: all .15s; box-shadow: var(--sombra); }
.tarjeta-medio:hover { border-color: var(--ac); transform: translateY(-2px); box-shadow: 0 16px 40px -20px rgba(79,70,229,.35); }
.tarjeta-medio img { width: 44px; height: 44px; border-radius: 10px; object-fit: contain; }
.tarjeta-medio .nombre { font-size: 15px; font-weight: 700; color: var(--tinta); }
.tarjeta-medio.alta { border-style: dashed; justify-content: center; color: var(--ac); background: transparent; box-shadow: none; }
.chip-tpl { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: 0.8px;
  text-transform: uppercase; background: var(--suave); border-radius: 999px; padding: 3px 10px; color: var(--ac); margin-top: 6px; }

/* ═══ Estructura ═══ */
.app { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; }
.lateral { background: var(--panel); border-right: 1px solid var(--linea); padding: 20px 14px 16px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.lateral .marca { display: flex; align-items: center; gap: 10px; padding: 0 10px 18px; }
.lateral .marca img { width: 26px; height: 26px; }
.lateral .marca b { font-size: 15px; font-weight: 800; color: var(--tinta); }
/* Conmutador de medio: combobox propio con buscador. La red tiene 62 medios
   y un <select> nativo con 62 opciones no se puede recorrer; acá se tipea.
   La lista se monta fija sobre el body (ver nucleo.js): dentro de .lateral,
   que scrollea, quedaba recortada. */
.conmutador { margin-bottom: 14px; }
.cbx-disparador { display: flex; align-items: center; gap: 8px; width: 100%; font-family: var(--sans);
  font-size: 13.5px; font-weight: 600; color: var(--texto); text-align: left;
  background: var(--suave); border: 1px solid transparent; border-radius: 8px; padding: 9px 12px;
  transition: background .12s, border-color .12s, box-shadow .12s; }
.cbx-disparador:hover { background: var(--panel); border-color: var(--linea); }
.cbx-disparador[aria-expanded="true"] { background: var(--panel); border-color: var(--ac); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.cbx-disparador .cbx-nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-disparador .ic { width: 15px; height: 15px; color: var(--gris-2); }

.cbx-pop { position: fixed; top: 0; left: 0; z-index: 210; display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--linea); border-radius: 11px;
  box-shadow: var(--sombra-alta); padding: 6px; animation: aparecer .12s ease; }
.cbx-campo { display: flex; align-items: center; gap: 8px; padding: 3px 8px 8px; border-bottom: 1px solid var(--linea); }
.cbx-campo .ic { color: var(--gris-2); }
.cbx-campo input { border: 0; background: none; padding: 3px 0; }
.cbx-campo input:hover { border-color: transparent; }
.cbx-campo input:focus { box-shadow: none; }
.cbx-vacio { padding: 12px 10px 4px; }
.cbx-lista { overflow-y: auto; max-height: min(46vh, 320px); padding-top: 4px; scroll-padding-bottom: 40px; }
.cbx-op { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer; }
.cbx-op[hidden] { display: none; }
.cbx-op .txt { flex: 1; min-width: 0; }
.cbx-op .txt b { display: block; font-size: 13.5px; font-weight: 600; color: var(--tinta); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-op .txt span { display: block; font-size: 11.5px; color: var(--gris-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cbx-op .ic { width: 15px; height: 15px; color: var(--ac); opacity: 0; }
.cbx-op.activo { background: var(--suave); }
.cbx-op.actual .ic { opacity: 1; }
.cbx-op.actual .txt b { color: var(--ac); }
/* la vuelta al listado queda siempre a la vista aunque la lista scrollee */
.cbx-op.todos { position: sticky; bottom: 0; margin-top: 4px; background: var(--panel);
  border-top: 1px solid var(--linea); border-radius: 0 0 8px 8px; box-shadow: 0 -8px 12px -10px rgba(16,19,26,.3); }
.cbx-op.todos .txt b { color: var(--ac); }
.cbx-op.todos.activo { background: var(--suave); }
.lateral .grupo { padding: 16px 10px 6px; }
.lateral .item { display: flex; align-items: center; gap: 11px; padding: 9px 11px; border-radius: 9px;
  font-size: 13.5px; font-weight: 500; color: var(--texto); margin-bottom: 1px; position: relative; }
.lateral .item:hover { background: var(--suave); }
.lateral .item.activo { background: var(--ac); color: #fff; font-weight: 600; }
.lateral .item .globo { margin-left: auto; font-size: 11px; font-weight: 700; background: var(--alerta-bg);
  color: var(--alerta); border-radius: 999px; padding: 1px 8px; }
.lateral .item.activo .globo { background: rgba(255,255,255,.22); color: #fff; }
.lateral .abajo { margin-top: auto; border-top: 1px solid var(--linea); padding-top: 12px; }
.lateral button.item { width: 100%; background: none; border: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.lateral .quien { display: flex; align-items: center; gap: 10px; padding: 8px 10px; }
.lateral .quien .datos b { display: block; font-size: 12.5px; color: var(--tinta); }
.lateral .quien .datos span { font-size: 11px; color: var(--gris); }

.principal { padding: 28px 36px 48px; max-width: 1240px; width: 100%; }
.cabecera { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 24px; }
.cabecera .textos { flex: 1; }
.cabecera .textos p { margin-top: 3px; }
.cabecera .acciones { display: flex; gap: 10px; align-items: center; }

/* ═══ Paneles y tablas ═══ */
.panel { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
  padding: 24px; margin-bottom: 20px; box-shadow: var(--sombra); }
.panel > h2 { font-size: 15px; font-weight: 700; color: var(--tinta); margin-bottom: 4px; }
.panel > .t-sub { margin-bottom: 18px; }
.pie-form { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; align-items: center; }

.tabla { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio);
  overflow: hidden; box-shadow: var(--sombra); margin-bottom: 20px; }
.tabla table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tabla th { text-align: left; font-size: 11px; font-weight: 700; letter-spacing: 0.7px; text-transform: uppercase;
  color: var(--gris-2); padding: 12px 16px; border-bottom: 1px solid var(--linea); background: #fafbfd; white-space: nowrap; }
.tabla td { padding: 13px 16px; border-bottom: 1px solid var(--suave); vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr { transition: background .1s; }
.tabla tbody tr:hover { background: #fafbff; }

/* fila de artículo */
.art-fila { display: flex; gap: 14px; align-items: center; min-width: 320px; }
.art-fila img { width: 68px; height: 46px; object-fit: cover; border-radius: 7px; background: var(--suave); flex-shrink: 0; }
.art-fila .sin-img { width: 68px; height: 46px; border-radius: 7px; background: var(--suave); display: flex;
  align-items: center; justify-content: center; color: var(--gris-2); flex-shrink: 0; }
.art-fila .titulo { font-weight: 600; color: var(--tinta); line-height: 1.3; display: block; }
.art-fila .titulo:hover { color: var(--ac); }
.art-fila .meta { font-size: 12px; color: var(--gris); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.punto-cat { display: inline-block; width: 8px; height: 8px; border-radius: 3px; background: var(--cat, #999); }

/* pills de estado */
.pill { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.pill.publicado { background: var(--ok-bg); color: var(--ok); }
.pill.borrador { background: var(--suave); color: var(--gris); }
.pill.en_revision { background: var(--alerta-bg); color: var(--alerta); }
.pill.aprobado { background: var(--info-bg); color: var(--info); }
.pill.rechazado, .pill.pausado, .pill.apagado { background: var(--mal-bg); color: var(--mal); }
.pill.programado { background: #efe9fd; color: var(--ac-2); }
.pill.archivado { background: var(--suave); color: var(--gris-2); }
.pill.activo { background: var(--ok-bg); color: var(--ok); }
.pill.ia { background: #efe9fd; color: var(--ac-2); }
.pill.humano { background: var(--info-bg); color: var(--info); }

/* filtros */
.filtros { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
.filtros .chip { padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: var(--gris);
  background: var(--panel); border: 1px solid var(--linea); cursor: pointer; transition: all .12s; }
.filtros .chip:hover { border-color: #c6cbda; color: var(--texto); }
.filtros .chip.on { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.filtros .chip small { opacity: .65; font-size: 11px; margin-left: 4px; }
.filtros .buscador { margin-left: auto; position: relative; width: 240px; }
.filtros .buscador input { padding-left: 34px; border-radius: 999px; }
.filtros .buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gris-2); }

/* ═══ Tablero ═══ */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px 20px; box-shadow: var(--sombra); }
.kpi .valor { font-size: 26px; font-weight: 800; letter-spacing: -0.5px; color: var(--tinta); line-height: 1.1; }
.kpi .valor small { font-size: 14px; font-weight: 600; color: var(--gris-2); }
.kpi .icono { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.kpi .barra { height: 5px; border-radius: 3px; background: var(--suave); margin-top: 10px; overflow: hidden; }
.kpi .barra i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--ac), var(--ac-2)); }

/* ═══ Avatares ═══ */
.avatar { display: inline-flex; align-items: center; justify-content: center; border-radius: 50%;
  background: var(--av, #8b93a7); color: #fff; font-weight: 700; flex-shrink: 0; }

/* ═══ Editor ═══ */
.editor { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.editor .costado { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; }
.editor .costado .panel { margin-bottom: 0; }
.portada-preview { border-radius: 9px; overflow: hidden; background: var(--suave); aspect-ratio: 16/9;
  display: flex; align-items: center; justify-content: center; color: var(--gris-2); margin-bottom: 12px; }
.portada-preview img { width: 100%; height: 100%; object-fit: cover; }
.contador { font-size: 11px; color: var(--gris-2); text-align: right; margin-top: 3px; }

/* La celda de imagen de la tabla de destinos y del lote: miniatura + acciones.
   La miniatura "tenue" es la imagen general — la del lote entero — para que se
   distinga de un vistazo de la que ese medio eligió aparte. */
/* Acciones de cabecera que se comprimen a su ícono. La primera fila de una
   pantalla junta volver, ir a, ver y hacer: lo que no es la acción principal
   viaja como ícono con su `title`, o la fila se vuelve ilegible. */
.btn.solo-ic { padding: 9px 10px; gap: 0; }
.btn.solo-ic .ic { width: 16px; height: 16px; }

/* El buscador que agrega medios al lote: el mismo combobox del conmutador,
   acotado para que no se coma el ancho del panel. */
.cbx-agregar { max-width: 340px; margin-bottom: 14px; }
.cbx-agregar .cbx-disparador .ic:first-child { color: var(--ac); }
.celda-img { display: flex; align-items: center; gap: 8px; }
.mini-img { width: 54px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linea); }
.mini-img.tenue { opacity: .55; }
.tabla select.mini { font-size: 12.5px; padding: 5px 8px; max-width: 300px; }
.contador.alerta { color: var(--alerta); }

.bloques { display: flex; flex-direction: column; gap: 10px; }
.bloque { background: #fafbfd; border: 1px solid var(--linea); border-radius: 10px; padding: 14px;
  display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.bloque .etiqueta { font-size: 10px; font-weight: 700; letter-spacing: 0.8px; text-transform: uppercase;
  color: var(--ac); margin-bottom: 7px; display: flex; align-items: center; gap: 6px; }
.bloque textarea { min-height: 56px; resize: vertical; }
.bloque .mando { display: flex; flex-direction: column; gap: 2px; }
.bloque .mando button { border: 0; background: none; color: var(--gris-2); font-size: 13px; padding: 3px 6px; border-radius: 6px; }
.bloque .mando button:hover { background: var(--suave); color: var(--texto); }
.bloque .mando button.rojo:hover { color: var(--mal); background: var(--mal-bg); }
.agregar-bloques { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.agregar-bloques button { background: var(--panel); border: 1px dashed #c9cedb; border-radius: 8px;
  padding: 8px 14px; font-size: 12.5px; font-weight: 600; color: var(--gris); transition: all .12s; }
.agregar-bloques button:hover { color: var(--ac); border-color: var(--ac); }

/* ═══ Sliders bipolares ═══ */
.eje { margin-bottom: 18px; }
.eje .polos { display: flex; justify-content: space-between; font-size: 12px; font-weight: 600; margin-bottom: 6px; }
.eje .polos .izq { color: var(--info); } .eje .polos .der { color: var(--ac-2); }
.eje input[type=range] { width: 100%; accent-color: var(--ac); padding: 0; }
.eje .valor { text-align: center; font-size: 11px; color: var(--gris-2); margin-top: 3px; }

/* ═══ Zonas de banner ═══ */
.zonas { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-bottom: 16px; }
.zona { border: 1.5px solid var(--linea); border-radius: 10px; padding: 14px; cursor: pointer; text-align: center; transition: all .12s; background: var(--panel); }
.zona:hover { border-color: #c6cbda; }
.zona.sel { border-color: var(--ac); background: #f6f5ff; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
.zona b { display: block; font-size: 12.5px; color: var(--tinta); }
.zona .medida { font-size: 11px; color: var(--gris-2); font-variant-numeric: tabular-nums; }
.zona .ocupado { display: block; margin-top: 8px; height: 5px; border-radius: 3px; background: var(--suave); overflow: hidden; }
.zona .ocupado i { display: block; height: 100%; background: linear-gradient(90deg, var(--ac), var(--ac-2)); }
.creativo-thumb { width: 88px; height: 34px; object-fit: cover; border-radius: 6px; border: 1px solid var(--linea); background: var(--suave); }

/* ═══ Permisos ═══ */
.permisos { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.permiso-grupo { border: 1px solid var(--linea); border-radius: 10px; padding: 16px; }
.permiso-grupo h3 { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.7px; color: var(--gris); margin-bottom: 10px; }
.permiso-grupo label { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500;
  text-transform: none; letter-spacing: 0; color: var(--texto); margin: 8px 0; cursor: pointer; }
.permiso-grupo input[type=checkbox] { width: 15px; height: 15px; accent-color: var(--ac); }

/* ═══ Modal ═══ */
.velo-modal { position: fixed; inset: 0; background: rgba(16,19,26,.45); backdrop-filter: blur(2px);
  display: grid; place-items: center; z-index: 200; padding: 24px; animation: aparecer .14s ease; }
.modal { background: var(--panel); border-radius: 16px; box-shadow: var(--sombra-alta); width: 100%;
  max-width: 480px; max-height: 90vh; overflow-y: auto; padding: 28px; animation: subir .16s ease; }
.modal.ancho { max-width: 960px; }
.modal h2 { font-size: 17px; font-weight: 700; color: var(--tinta); margin-bottom: 4px; }
.modal .t-sub { margin-bottom: 18px; }
@keyframes aparecer { from { opacity: 0; } }
@keyframes subir { from { opacity: 0; transform: translateY(10px); } }

/* ═══ Toast ═══ */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 300; }
.toast { background: var(--tinta); color: #fff; border-radius: 10px; padding: 12px 18px; font-size: 13px;
  font-weight: 500; box-shadow: var(--sombra-alta); display: flex; align-items: center; gap: 10px;
  animation: subir .18s ease; max-width: 420px; }
.toast.error { background: var(--mal); }
.toast.exito { background: var(--ok); }

/* ═══ Estados vacíos y carga ═══ */
.vacio { text-align: center; padding: 56px 24px; color: var(--gris); }
.vacio .dibujo { font-size: 34px; margin-bottom: 12px; opacity: .5; }
.vacio b { display: block; font-size: 15px; color: var(--texto); margin-bottom: 4px; }
.esqueleto { border-radius: var(--radio); background: linear-gradient(90deg, var(--suave) 25%, #e9ebf2 50%, var(--suave) 75%);
  background-size: 200% 100%; animation: brillar 1.2s infinite; }
@keyframes brillar { to { background-position: -200% 0; } }
.cargando-pagina { display: flex; flex-direction: column; gap: 14px; }

.aviso-inline { border-radius: 9px; padding: 11px 14px; font-size: 13px; margin-top: 14px; }
.aviso-inline.error { background: var(--mal-bg); color: var(--mal); }
.aviso-inline.exito { background: var(--ok-bg); color: var(--ok); }

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .lateral { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .lateral .abajo { margin-top: 0; border: 0; }
  .principal { padding: 20px; }
  .fila.c2, .fila.c3, .permisos, .editor { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .editor .costado { position: static; }
}

/* ═══════════ COMPONENTES NUEVOS ═══════════ */
.girando.grande { width: 26px; height: 26px; border-width: 3px; border-color: var(--linea); border-top-color: var(--ac); }
.app-simple { min-height: 100vh; padding: 32px 24px; }
.hoja-central { max-width: 1100px; margin: 0 auto; }
code.cod { font-family: ui-monospace, Menlo, monospace; font-size: 12px; background: var(--suave); padding: 2px 7px; border-radius: 5px; }

/* Plan */
.plan-fila { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.plan-medidas { display: flex; gap: 32px; margin-left: auto; flex-wrap: wrap; }
.valor-plan { font-size: 19px; font-weight: 800; color: var(--tinta); }
.valor-plan small { font-size: 13px; font-weight: 600; color: var(--gris-2); }
.barra-mini { height: 4px; border-radius: 3px; background: var(--suave); margin-top: 6px; width: 110px; overflow: hidden; }
.barra-mini i { display: block; height: 100%; background: linear-gradient(90deg, var(--ac), var(--ac-2)); }
.variacion.sube { color: var(--ok); }
.medidas-plan { display: flex; gap: 24px; flex-wrap: wrap; }

/* Buscador lateral y global */
.busca-global { display: flex; align-items: center; gap: 9px; width: 100%; background: var(--suave); border: 1px solid transparent;
  border-radius: 9px; padding: 8px 11px; font-size: 13px; color: var(--gris); margin-bottom: 6px; font-family: var(--sans); }
.busca-global:hover { border-color: var(--linea); background: var(--panel); }
.busca-global kbd { margin-left: auto; font-size: 10px; background: var(--panel); border: 1px solid var(--linea);
  border-radius: 4px; padding: 1px 5px; font-family: var(--sans); }
.buscador-global { margin: -6px }
.bg-campo { display: flex; align-items: center; gap: 10px; padding: 4px 4px 14px; border-bottom: 1px solid var(--linea); }
.bg-campo input { border: 0; font-size: 17px; padding: 6px 0; }
.bg-campo input:focus { box-shadow: none; }
.bg-res { max-height: 50vh; overflow-y: auto; margin-top: 10px; }
.bg-grupo { margin-bottom: 12px; }
.bg-grupo a { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 8px; font-size: 13.5px; font-weight: 500; }
.bg-grupo a:hover { background: var(--suave); }
.bg-grupo a .t-mini, .bg-grupo a .pill { margin-left: auto; }

/* Campana y notificaciones */
.campana { position: relative; }
.globo-notif { position: absolute; top: 2px; right: 2px; background: var(--mal); color: #fff; font-size: 9.5px;
  font-weight: 700; border-radius: 999px; padding: 1px 5px; }
.lista-notif { max-height: 54vh; overflow-y: auto; margin: 0 -6px; }
.notif { display: block; padding: 12px 14px; border-radius: 9px; border-left: 3px solid transparent; }
.notif:hover { background: var(--suave); }
.notif.nueva { border-left-color: var(--ac); background: #f8f7ff; }
.notif b { font-size: 13.5px; color: var(--tinta); }
.notif p { font-size: 12.5px; color: var(--gris); margin: 3px 0; }

/* Alertas del tablero */
.alertas { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.alerta { display: flex; align-items: center; gap: 11px; background: var(--alerta-bg); color: var(--alerta);
  border-radius: 10px; padding: 12px 16px; font-size: 13.5px; font-weight: 500; }
.alerta b { margin-left: auto; font-weight: 700; white-space: nowrap; }
.alerta:hover { filter: brightness(.97); }

/* Gráficos */
.grafico-caja { height: 120px; }
.gr { width: 100%; height: 100%; display: block; }
.eje-x { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--gris-2); margin-top: 4px; }
.variacion { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; margin-top: 8px; }
.variacion.sube { color: var(--ok); } .variacion.baja { color: var(--mal); }
.variacion .ic { width: 13px; height: 13px; }
.barras { display: flex; flex-direction: column; gap: 9px; margin-top: 12px; }
.barra-cat { display: grid; grid-template-columns: 92px 1fr auto; gap: 10px; align-items: center; font-size: 12.5px; }
.barra-cat .pista { height: 7px; border-radius: 4px; background: var(--suave); overflow: hidden; }
.barra-cat .pista i { display: block; height: 100%; border-radius: 4px; }
.fila-equipo { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; }
.fila-equipo b { margin-left: auto; }

/* Filtros y lote */
.filtros-der { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filtros-der select { width: auto; border-radius: 999px; padding: 7px 12px; font-size: 12.5px; }
.filtros .buscador { position: relative; width: 210px; }
.filtros .buscador input { padding-left: 34px; border-radius: 999px; }
.filtros .buscador svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gris-2); }
.chip.mini { padding: 5px 11px; font-size: 12px; }
.chip.mini a { color: var(--gris-2); margin-left: 5px; font-weight: 700; }
.chip.mini a:hover { color: var(--mal); }
.vistas-guardadas { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.barra-lote { display: flex; align-items: center; gap: 16px; background: var(--tinta); color: #fff;
  border-radius: 10px; padding: 11px 18px; margin-bottom: 14px; font-size: 13px; }
.lote-acciones { display: flex; gap: 8px; margin-left: auto; align-items: center; flex-wrap: wrap; }
.lote-acciones select { width: auto; font-size: 12px; padding: 6px 10px; }
.tabla tr.marcada td { background: #f6f5ff; }
.acciones-fila { display: inline-flex; gap: 6px; align-items: center; }
.acciones-fila select { width: auto; font-size: 12px; padding: 5px 9px; }
.meta.rechazo { color: var(--mal); }

/* Gráficos: puntos con tooltip (los .pt vienen de grafico() en nucleo.js) */
.gr .pt .hit { stroke: transparent; stroke-width: 16; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.gr .pt .dot { stroke: var(--gr-c, var(--ac)); stroke-width: 5; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke-width .1s; }
.gr .pt:hover .dot { stroke-width: 9; }
.gr-tip { position: absolute; transform: translate(-50%, calc(-100% - 9px)); background: var(--tinta); color: #fff;
  font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; z-index: 60; box-shadow: var(--sombra-alta); }

/* Calendario */
.calendario { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; box-shadow: var(--sombra); }
.cal-cab { display: grid; grid-template-columns: repeat(7, 1fr); background: #fafbfd; border-bottom: 1px solid var(--linea); }
.cal-cab span { padding: 10px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--gris-2); text-align: center; }
/* minmax(0,1fr): con 1fr a secas los chips largos ensanchan su columna y
   el cuerpo desalinea con la cabecera (la columna de los domingos quedaba
   afuera del card) */
.cal-grilla { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.dia-cal { min-width: 0; min-height: 108px; border-right: 1px solid var(--suave); border-bottom: 1px solid var(--suave); padding: 7px; position: relative; }
.dia-cal.vacio-cal { background: #fafbfd; }
.dia-cal.hoy { background: #f6f5ff; }
.dia-cal.sobre { background: var(--ok-bg); outline: 2px dashed var(--ok); outline-offset: -3px; }
.n-dia { font-size: 12px; font-weight: 700; color: var(--gris); display: block; margin-bottom: 5px; }
.dia-cal.hoy .n-dia { color: var(--ac); }
.ev { display: block; font-size: 11px; padding: 3px 6px; border-radius: 5px; margin-bottom: 3px; cursor: grab;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; border-left: 3px solid; }
.ev.publicado { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.ev.programado { background: #efe9fd; color: var(--ac-2); border-color: var(--ac-2); }
.ev.aprobado { background: var(--info-bg); color: var(--info); border-color: var(--info); }
.ev.en_revision { background: var(--alerta-bg); color: var(--alerta); border-color: var(--alerta); }
.ev.borrador { background: var(--suave); color: var(--gris); border-color: var(--gris-2); }
.mas-ev { font-size: 10.5px; color: var(--gris-2); }
.leyenda-cal { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--gris); flex-wrap: wrap; }
.leyenda-cal .pt { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; }
.pt.publicado { background: var(--ok); } .pt.programado { background: var(--ac-2); }
.pt.aprobado { background: var(--info); } .pt.en_revision { background: var(--alerta); } .pt.borrador { background: var(--gris-2); }

/* Editor */
.titulo-grande { font-size: 20px; font-weight: 700; padding: 12px 14px; }
.estado-guardado { font-size: 12px; color: var(--gris); margin-right: 6px; }
.estado-guardado.ok { color: var(--ok); } .estado-guardado.sucio { color: var(--alerta); }
.barra-formato { display: flex; gap: 3px; margin-bottom: 7px; flex-wrap: wrap; }
.barra-formato button { width: 28px; height: 26px; border: 1px solid var(--linea); background: var(--panel);
  border-radius: 6px; font-size: 12px; color: var(--gris); }
.barra-formato button:hover { border-color: var(--ac); color: var(--ac); }
.rico { border: 1px solid var(--linea); border-radius: 8px; padding: 11px 13px; min-height: 62px;
  background: var(--panel); font-size: 14px; line-height: 1.6; }
.rico:focus { outline: none; border-color: var(--ac); box-shadow: 0 0 0 3px rgba(79,70,229,.14); }
.rico:empty::before { content: attr(placeholder); color: var(--gris-2); }
.bloque { grid-template-columns: 1fr auto; }
.bloque-cuerpo { min-width: 0; }
.campo-imagen { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.prev-bloque { max-height: 120px; border-radius: 8px; }
.prev-creativo { width: 180px; height: 60px; border-radius: 8px; background: var(--suave); display: flex;
  align-items: center; justify-content: center; overflow: hidden; color: var(--gris-2); }
.prev-creativo img { width: 100%; height: 100%; object-fit: contain; }
.layout-editor { display: grid; grid-template-columns: 210px 1fr; gap: 14px; align-items: start; }
.layout-editor.der { grid-template-columns: 1fr 210px; }
.layout-editor.der .lado-img { order: 2; }
.hueco-img { height: 110px; border: 1px dashed var(--linea); border-radius: 8px; display: flex;
  align-items: center; justify-content: center; color: var(--gris-2); margin-bottom: 8px; }
.lado-img img { margin-bottom: 8px; width: 100%; }
.mini-input { font-size: 12px; padding: 6px 9px; margin-top: 6px; }
.galeria-editor { display: flex; gap: 8px; flex-wrap: wrap; }
.gal-item { position: relative; width: 88px; height: 66px; }
.gal-item img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.gal-item button { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 0; background: var(--mal); color: #fff; font-size: 11px; }
.agregar-gal { width: 88px; height: 66px; border: 1px dashed var(--linea); border-radius: 7px; background: var(--panel); color: var(--gris-2); }
.sep-visual { text-align: center; color: var(--gris-2); font-size: 12px; padding: 8px; }
.prev-video { font-size: 12px; color: var(--ok); margin-top: 6px; }
.vista-google { border: 1px solid var(--linea); border-radius: 9px; padding: 12px 14px; margin-top: 10px; background: #fafbfd; }
.vista-google .url { display: block; font-size: 11.5px; color: var(--ok); }
.vista-google .tit { display: block; font-size: 15px; color: #1a0dab; margin: 3px 0; line-height: 1.3; }
.vista-google .desc { display: block; font-size: 12px; color: var(--gris); line-height: 1.45; }
details.panel summary { cursor: pointer; list-style: none; }
details.panel summary::-webkit-details-marker { display: none; }
details.panel summary::before { content: '▸ '; color: var(--gris-2); }
details.panel[open] summary::before { content: '▾ '; }

/* Modal de imágenes */
.tabs-modal { display: flex; gap: 4px; background: var(--suave); border-radius: 999px; padding: 3px; margin-bottom: 16px; width: fit-content; }
.tabs-modal button { border: 0; background: none; border-radius: 999px; padding: 6px 15px; font-size: 12.5px; font-weight: 600; color: var(--gris); }
.tabs-modal button.on { background: var(--panel); color: var(--tinta); box-shadow: var(--sombra); }
.grilla-media { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; max-height: 52vh; overflow-y: auto; }
.item-media { border: 1px solid var(--linea); border-radius: 9px; overflow: hidden; background: var(--panel); padding: 0; }
.item-media:hover { border-color: var(--ac); }
.item-media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.item-media span { display: block; font-size: 10.5px; color: var(--gris); padding: 5px; }
.zona-soltar { border: 2px dashed var(--linea); border-radius: 12px; padding: 40px 20px; text-align: center;
  color: var(--gris); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.zona-soltar:hover, .zona-soltar.sobre { border-color: var(--ac); background: #f8f7ff; }
.zona-soltar b { color: var(--tinta); }
.marco-preview { border: 1px solid var(--linea); border-radius: 10px; overflow: hidden; background: #fff; }
.marco-preview iframe { width: 100%; height: 68vh; border: 0; display: block; }
.marco-preview.movil { max-width: 400px; margin: 0 auto; }
.cab-modal { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.cab-modal .tabs-modal { margin: 0 0 0 auto; }
.pre-prompt { white-space: pre-wrap; font-size: 12px; color: var(--texto); background: var(--suave);
  padding: 16px; border-radius: 9px; max-height: 60vh; overflow: auto; line-height: 1.55; }
.lista-versiones, .lista-notas { max-height: 46vh; overflow-y: auto; }
.fila-version { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--suave); }
.fila-version b { display: block; font-size: 13.5px; }
.fila-version button { margin-left: auto; }
.nota-red { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--suave); }
.nota-red p { font-size: 13.5px; margin-top: 3px; }
.lista-acciones { display: flex; flex-direction: column; gap: 8px; }
.lista-acciones .btn { width: 100%; }
.lista-detalle { margin: 10px 0 0 18px; font-size: 13px; color: var(--gris); }
.lista-detalle li { margin-bottom: 5px; }

/* Automatización */
.fila-horario { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; font-size: 13px; }
.fila-horario select { width: auto; } .fila-horario input { width: 74px; }
.fila-pct { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; font-size: 13px; }
.fila-pct input { width: 74px; }
.check-linea { display: flex; align-items: center; gap: 9px; font-size: 13px; text-transform: none;
  letter-spacing: 0; color: var(--texto); margin: 0; font-weight: 500; }
.check-linea input { width: 15px; height: 15px; accent-color: var(--ac); }
.lista-medios-check { display: flex; flex-direction: column; gap: 6px; max-height: 40vh; overflow-y: auto; margin-bottom: 14px; }
.check-medio { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border: 1px solid var(--linea);
  border-radius: 9px; cursor: pointer; text-transform: none; letter-spacing: 0; margin: 0; font-size: 13.5px; }
.check-medio:hover { border-color: var(--ac); }
.check-medio input { width: 15px; height: 15px; accent-color: var(--ac); }
.check-medio img { width: 26px; height: 26px; object-fit: contain; }
.check-medio small { margin-left: auto; color: var(--gris-2); font-size: 11.5px; }

/* Banners */
.mapa-zonas { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-bottom: 20px; }
.zona-mapa { background: var(--panel); border: 1px solid var(--linea); border-radius: 10px; padding: 14px; box-shadow: var(--sombra); }
.zona-mapa.lleno { border-color: var(--mal); }
.zona-mapa b { display: block; font-size: 13px; color: var(--tinta); }
.zona-mapa .medida { font-size: 11px; color: var(--gris-2); font-variant-numeric: tabular-nums; }
.pista-zona { height: 6px; border-radius: 4px; background: var(--suave); margin: 9px 0 6px; overflow: hidden; }
.pista-zona i { display: block; height: 100%; background: linear-gradient(90deg, var(--ac), var(--ac-2)); }
.zona .medida { font-size: 11px; color: var(--gris-2); }
.reporte .rep-cab { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.reporte .rep-cab img { width: 46px; height: 46px; object-fit: contain; }
.tabla-rep { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 16px; }
.tabla-rep th { text-align: left; font-size: 11px; text-transform: uppercase; color: var(--gris-2); padding: 8px; border-bottom: 1px solid var(--linea); }
.tabla-rep td { padding: 10px 8px; border-bottom: 1px solid var(--suave); }
.tabla-rep img { vertical-align: middle; margin-right: 8px; }

/* Redes */
.grilla-redes { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 16px; margin-bottom: 20px; }
.tarjeta-red { background: var(--panel); border: 1px solid var(--linea); border-radius: var(--radio); padding: 18px; box-shadow: var(--sombra); }
.tarjeta-red.ok { border-color: var(--ok); }
.cab-red { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; }
.cab-red b { text-transform: capitalize; font-size: 14px; color: var(--tinta); }
.cab-red .pill { margin-left: auto; }
.punto-red { width: 10px; height: 10px; border-radius: 50%; }
.dato-red { margin-bottom: 10px; }
.acciones-red { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.acciones-red a.btn { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.acciones-red a.btn .ic { width: 14px; height: 14px; }
.par-horas { display: flex; align-items: center; gap: 8px; }
.par-horas input[type=time] { flex: 1; min-width: 0; }
.par-horas .t-mini { flex: none; }
.chips-redes { display: flex; gap: 10px; flex-wrap: wrap; }
/* La placa de redes dentro de la pantalla de conexiones: la miniatura es la
   previa que dibuja el server, así que el link al armador muestra de verdad
   con qué imagen sale el medio. Si el motor no puede dibujarla, .sin-previa
   deja el recuadro vacío en vez de un ícono de imagen rota. */
.fila-placa { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-top: 14px; }
.miniatura-placa { display: block; width: 210px; flex: 0 0 auto; border: 1px solid var(--linea); border-radius: var(--radio); overflow: hidden; background: var(--fondo); transition: border-color .15s; }
.miniatura-placa:hover { border-color: var(--acento); }
.miniatura-placa img { display: block; width: 100%; height: auto; }
.miniatura-placa.sin-previa { height: 118px; }
.miniatura-placa.sin-previa img { display: none; }
/* El payload y la respuesta de un pedido a Meta: JSON crudo, monoespaciado y
   con scroll propio — un caption largo no tiene que ensanchar el modal. */
.bloque-json { margin: 0; padding: 12px; background: var(--fondo); border: 1px solid var(--linea); border-radius: var(--radio); font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--tinta); white-space: pre-wrap; word-break: break-word; max-height: 260px; overflow: auto; }
.chip-red { display: flex; align-items: center; gap: 7px; border: 1px solid var(--linea); border-radius: 999px;
  padding: 7px 14px; font-size: 12.5px; text-transform: capitalize; cursor: pointer; margin: 0; letter-spacing: 0; color: var(--texto); }
.chip-red.off { opacity: .5; }
.chip-red small { color: var(--gris-2); font-size: 11px; }
.chip-red input { width: 14px; height: 14px; accent-color: var(--ac); }

/* Periodistas / arengue */
.cab-periodista { display: flex; align-items: center; gap: 16px; }
.separador-panel { height: 1px; background: var(--linea); margin: 22px 0; }
.muestra-ia { background: #f8f7ff; border: 1px solid #e0dcfb; border-radius: 10px; padding: 16px 18px; margin-top: 14px; }
.muestra-ia p { font-size: 14px; line-height: 1.65; margin: 8px 0; color: var(--texto); }
.muestra-ia .estilo { display: block; margin-top: 10px; font-style: italic; }
.com-muestra { display: flex; gap: 11px; padding: 10px 0; border-top: 1px solid #e8e5fb; }
.com-muestra:first-of-type { border-top: 0; }
.com-muestra p { font-size: 13.5px; margin-top: 4px; }
.variantes { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.variante { border: 1px solid var(--linea); border-radius: 10px; padding: 16px; }
.variante h3 { font-size: 15px; color: var(--tinta); line-height: 1.3; margin-bottom: 6px; }
.prev-cuerpo { font-size: 12.5px; color: var(--gris); margin: 10px 0; max-height: 140px; overflow: hidden; }
.prev-cuerpo p { margin-bottom: 6px; }
.lista-simulada { display: flex; flex-direction: column; gap: 6px; }
.linea-sim { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--ok); }

/* Valor agregado y config */
.fila-va { display: grid; grid-template-columns: 1fr 1fr 120px auto; gap: 8px; margin-bottom: 7px; }
.lista-cats { display: flex; flex-direction: column; gap: 7px; }
.fila-cat { display: flex; align-items: center; gap: 10px; }
.nombre-cat { flex: 1; }
.orden-cat { width: 66px; }
.colores { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.color-item { display: flex; flex-direction: column; align-items: center; gap: 5px; margin: 0; text-transform: none; letter-spacing: 0; }
.color-item input[type=color] { width: 52px; height: 34px; padding: 2px; border-radius: 7px; cursor: pointer; }
.dns table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 8px; }
.dns th { text-align: left; font-size: 10.5px; text-transform: uppercase; color: var(--gris-2); padding: 5px 8px; }
.dns td { padding: 6px 8px; border-top: 1px solid var(--suave); font-family: ui-monospace, Menlo, monospace; }
.lista-migracion { display: flex; flex-direction: column; gap: 8px; }
.fila-mig { display: flex; align-items: center; gap: 14px; padding: 11px 13px; border: 1px solid var(--linea); border-radius: 9px; }
.fila-mig b { display: block; font-size: 13.5px; }
.fila-mig select { width: auto; margin-left: auto; }
.fila-mig .pill { margin-left: auto; }

@media (max-width: 980px) {
  .layout-editor, .layout-editor.der, .variantes, .fila-va { grid-template-columns: 1fr; }
  .plan-medidas { margin-left: 0; }
  .cal-grilla .dia-cal { min-height: 74px; }
}

/* ═══ Paginador del admin ═══ */
.paginador-admin { display: flex; align-items: center; gap: 14px; padding: 6px 2px 18px; }
.paginador-admin select { width: auto; font-size: 12.5px; }

/* ═══ Kanban ═══ */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: start; }
.columna-k { background: var(--suave); border-radius: 12px; padding: 10px; min-height: 220px; transition: background .12s; }
.columna-k.sobre { background: #ece9ff; outline: 2px dashed var(--ac); outline-offset: -3px; }
.cab-col { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; }
.cab-col b { font-size: 12.5px; color: var(--gris); }
.cuerpo-col { display: flex; flex-direction: column; gap: 8px; max-height: 62vh; overflow-y: auto; }
.tarjeta-k { background: var(--panel); border: 1px solid var(--linea); border-radius: 9px; padding: 10px; cursor: grab; box-shadow: var(--sombra); }
.tarjeta-k.arrastrando { opacity: .45; }
.tarjeta-k img { width: 100%; height: 68px; object-fit: cover; border-radius: 6px; margin-bottom: 7px; }
.tarjeta-k a { font-size: 12.8px; font-weight: 600; color: var(--tinta); line-height: 1.3; display: block; }
.tarjeta-k a:hover { color: var(--ac); }
.meta-k { font-size: 11px; color: var(--gris); margin-top: 5px; }
.meta-k.rechazo { color: var(--mal); }
.col-vacia { text-align: center; font-size: 12px; color: var(--gris-2); padding: 22px 0; }

/* ═══ Relacionadas ═══ */
.rel-elegidas { display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.rel-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; background: var(--suave); border-radius: 8px; padding: 6px 9px; }
.rel-item img { width: 38px; height: 28px; object-fit: cover; border-radius: 5px; }
.rel-item span { flex: 1; line-height: 1.3; }
.rel-item button { border: 0; background: none; color: var(--gris-2); font-size: 13px; cursor: pointer; }
.rel-item button:hover { color: var(--mal); }
.lista-rel { max-height: 44vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; }
.fila-rel { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 8px; cursor: pointer;
  margin: 0; text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--texto); }
.fila-rel:hover { background: var(--suave); }
.fila-rel img, .fila-rel .sin-mini { width: 44px; height: 32px; object-fit: cover; border-radius: 5px; background: var(--suave); }
.fila-rel input { width: 15px; height: 15px; accent-color: var(--ac); }

/* ═══ Ayuda ═══ */
.lista-ayuda { margin: 4px 0 0 18px; }
.lista-ayuda li { font-size: 13.5px; color: var(--texto); margin-bottom: 9px; line-height: 1.55; }

/* ═══ Previa de valor agregado ═══ */
.previa-va { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.previa-va .item-va { background: var(--suave); border-radius: 10px; overflow: hidden; }
.previa-va .item-va img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.previa-va .item-va > div { padding: 10px 12px; }
.previa-va .item-va b { display: block; font-size: 13px; color: var(--tinta); line-height: 1.25; }
.previa-va .item-va span { font-size: 11.5px; color: var(--gris); }
.previa-va .cuando-va { display: inline-block; margin-top: 6px; font-size: 10.5px; font-weight: 700;
  background: var(--ac); color: #fff; padding: 2px 8px; border-radius: 5px; }

textarea.pre-prompt { width: 100%; font-family: ui-monospace, Menlo, monospace; resize: vertical; }
@media (max-width: 1100px) { .kanban { grid-template-columns: repeat(2, 1fr); } }

/* ═══════════ RESPONSIVE DEL PANEL ═══════════ */
/* Las tablas anchas scrollean dentro de su tarjeta, nunca arrastran la página */
.tabla { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.tabla table { min-width: 640px; }
/* "Lo más leído hoy" del inicio vive en una columna del grid c2 (~550px en
   desktop): el mínimo de 640px pensado para las tablas de datos la hacía
   desbordar el card A CUALQUIER ancho, no solo en el teléfono. La tabla es
   angosta (3 columnas) y wrappea bien sin mínimo. */
.fila.c2 > .tabla table { min-width: 0; }
.fila.c2 > .tabla td { overflow-wrap: break-word; }
.app, .principal, .lateral { min-width: 0; }
.principal { overflow-x: hidden; }
.filtros, .cabecera, .pie-form, .acciones-fila, .lote-acciones { flex-wrap: wrap; }
.grafico-caja, .kpis, .panel, .editor, .fila { min-width: 0; }

@media (max-width: 1100px) {
  .app { grid-template-columns: 210px 1fr; }
  .principal { padding: 22px 20px 40px; }
  .kpis { grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
  .editor .costado { position: static; flex-direction: row; flex-wrap: wrap; }
  .editor .costado .panel { flex: 1 1 280px; }
  .mapa-zonas { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .filtros-der { width: 100%; margin-left: 0; }
  .filtros .buscador { flex: 1; width: auto; min-width: 160px; }
}

@media (max-width: 860px) {
  /* la barra lateral pasa a ser una tira superior deslizable */
  .app { grid-template-columns: 1fr; }
  /* flex-wrap: nowrap pisa el wrap que hereda del breakpoint de 980px; sin
     esto, en pantallas angostas un ícono quedaba huérfano en segunda fila
     en vez de scrollear dentro de la tira */
  .lateral { position: sticky; top: 0; z-index: 60; height: auto; flex-direction: row; flex-wrap: nowrap;
    align-items: center; gap: 6px; padding: 10px 14px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--linea); }
  .lateral .marca { padding: 0 8px 0 0; flex-shrink: 0; }
  .lateral .marca b { display: none; }
  .lateral .grupo { display: none; }
  .lateral .conmutador { margin: 0; flex-shrink: 0; }
  .lateral .conmutador .cbx-disparador { width: auto; max-width: 160px; }
  .lateral .item { flex-shrink: 0; padding: 8px 10px; }
  .lateral .item span { display: none; }
  .lateral .item.activo span { display: inline; }
  .lateral .abajo { margin: 0 0 0 auto; border: 0; padding: 0; display: flex; flex-shrink: 0; }
  .lateral .quien { padding: 6px; }
  .lateral .quien .datos { display: none; }
  .busca-global { width: auto; margin: 0; flex-shrink: 0; padding: 8px 10px; }
  .busca-global span, .busca-global kbd { display: none; }
  .principal { padding: 18px 16px 40px; max-width: 100%; }
  .cabecera { flex-direction: column; align-items: stretch; gap: 12px; }
  /* los botones son nowrap: si no wrappean las acciones, "+ Nota manual"
     se sale del viewport y .principal (overflow hidden) lo decapita */
  .cabecera .acciones { justify-content: flex-start; flex-wrap: wrap; }
  /* (la excepción de min-width para "Lo más leído" del inicio subió a la
     sección global: desbordaba también en desktop, no solo acá) */
  .kanban { grid-template-columns: 1fr; }
  .columna-k { min-height: auto; }
  .cuerpo-col { max-height: none; flex-direction: row; overflow-x: auto; }
  .tarjeta-k { min-width: 200px; }
  .grilla-redes, .mapa-zonas { grid-template-columns: 1fr 1fr; }
  .plan-medidas { gap: 18px; }
  .modal { padding: 22px 18px; max-height: 92vh; }
  .marco-preview iframe { height: 60vh; }
  .layout-editor, .layout-editor.der { grid-template-columns: 1fr; }
  .dia-cal { min-height: 62px; padding: 4px; }
  .ev { font-size: 9.5px; padding: 2px 4px; }
}

@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr; }
  .grilla-redes, .mapa-zonas, .grilla-medios { grid-template-columns: 1fr; }
  .cal-grilla .n-dia { font-size: 10px; }
  .filtros .chip { padding: 6px 11px; font-size: 12px; }
  .toasts { left: 14px; right: 14px; }
  .toast { max-width: none; }
}

/* ═══════════ CONSTRUCTOR DE PROMPTS ═══════════ */
.escenario { background: linear-gradient(180deg, #fafbff, var(--panel)); }
.constructor { display: grid; grid-template-columns: 380px 1fr; gap: 18px; align-items: start; }

/* capas de la izquierda */
.capas { display: flex; flex-direction: column; gap: 10px; }
.capa { background: var(--panel); border: 1px solid var(--linea); border-radius: 11px;
  padding: 13px 15px; transition: all .15s; }
.capa .punto-capa { box-shadow: 0 0 0 3px color-mix(in srgb, var(--capa) 18%, transparent); }
.capa.apagada { opacity: .45; }
.capa.apagada .punto-capa { background: var(--gris-2); box-shadow: none; }
.capa.vacia { border-style: dashed; }
.capa.destacada { box-shadow: 0 0 0 3px color-mix(in srgb, var(--capa) 35%, transparent); }
.cab-capa { display: flex; align-items: flex-start; gap: 10px; }
.punto-capa { width: 10px; height: 10px; border-radius: 3px; background: var(--capa); margin-top: 4px; flex-shrink: 0; }
.tit-capa { flex: 1; min-width: 0; }
.tit-capa b { display: block; font-size: 13.5px; color: var(--tinta); }
.tit-capa a { color: var(--ac); }
.txt-capa { font-size: 12.5px; line-height: 1.6; color: var(--texto); background: var(--suave);
  border-radius: 8px; padding: 11px 13px; margin-top: 10px; max-height: 150px; overflow-y: auto; }
.vacio-capa { color: var(--gris-2); font-style: italic; background: transparent; padding: 6px 0; }
.pie-capa { font-size: 11px; color: var(--gris-2); margin-top: 7px; }
.regulador { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.regulador input { flex: 1; accent-color: var(--capa); }
.regulador b { font-size: 11.5px; color: var(--gris); min-width: 34px; text-align: right; }

/* interruptor */
.switch { position: relative; width: 36px; height: 20px; flex-shrink: 0; margin: 0; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--linea); border-radius: 999px; transition: background .15s; }
.switch span::before { content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--capa); }
.switch input:checked + span::before { transform: translateX(16px); }

/* prompt final */
.salida { position: sticky; top: 20px; }
.prompt-final { padding: 0; overflow: hidden; }
.cab-prompt { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--linea); flex-wrap: wrap; }
.metricas-prompt { margin-left: auto; display: flex; gap: 16px; font-size: 12px; color: var(--gris); }
.metricas-prompt b { color: var(--tinta); font-variant-numeric: tabular-nums; }
.metricas-prompt .costo { color: var(--ok); font-weight: 600; }
.cuerpo-prompt { max-height: 56vh; overflow-y: auto; padding: 20px 24px 20px 30px; }

/* El prompt se lee de corrido. El color va en un canal al margen, sin cortar el texto. */
.frag { position: relative; padding: 0 0 2px 10px; }
.frag + .frag { margin-top: 4px; }
.frag .canal { position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 2px;
  background: var(--capa); opacity: .3; transition: opacity .15s, width .15s; }
.frag p { font-size: 13.5px; line-height: 1.72; color: var(--texto); white-space: pre-wrap;
  font-family: var(--sans); margin: 0; }
.frag .etiq-frag { position: absolute; left: 14px; top: -7px; font-size: 9px; font-weight: 700;
  letter-spacing: .7px; text-transform: uppercase; color: var(--capa); background: var(--panel);
  padding: 0 6px; opacity: 0; transition: opacity .15s; pointer-events: none; white-space: nowrap; }
.frag:hover { cursor: pointer; }
.frag:hover .canal { opacity: 1; width: 4px; }
.frag:hover .etiq-frag { opacity: 1; }
.frag:hover p { color: var(--tinta); }
/* con el marcado apagado, el prompt es texto plano y limpio */
.cuerpo-prompt.sin-marcas .canal, .cuerpo-prompt.sin-marcas .etiq-frag { display: none; }
.cuerpo-prompt.sin-marcas .frag { padding-left: 0; }
.marcar-origen { font-size: 12px; color: var(--gris); }
.marcar-origen input { width: 14px; height: 14px; }

.prompt-final .pie-form { padding: 14px 20px; border-top: 1px solid var(--linea); margin: 0; }

/* conflictos */
.panel-conflicto { border-color: var(--alerta); background: var(--alerta-bg); }
.cab-conflicto { display: flex; align-items: center; gap: 9px; color: var(--alerta); font-size: 13.5px; margin-bottom: 12px; }
.conflicto { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.conflicto .lado { background: var(--panel); border-radius: 9px; padding: 11px 13px; border: 1px solid var(--linea); }
.conflicto .lado.gana { border-color: var(--ok); box-shadow: 0 0 0 2px color-mix(in srgb, var(--ok) 18%, transparent); }
.conflicto .lado.pierde { opacity: .5; text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--mal) 60%, transparent); }
.conflicto .lado p { font-size: 12.5px; margin-top: 4px; line-height: 1.45; }
.conflicto .vs { font-size: 11px; font-weight: 700; color: var(--alerta); }
.nota-conflicto { margin-top: 9px; font-style: italic; }

/* comparador y resultado */
.comparador { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 8px; }
.lado-comp { border: 1px solid var(--linea); border-radius: 10px; padding: 13px; }
.txt-comp { font-size: 12.5px; line-height: 1.55; background: var(--suave); border-radius: 8px; padding: 10px; margin: 7px 0; }
.resultado-prueba { border-color: var(--ok); }
.tit-prueba { font-size: 21px; font-weight: 800; color: var(--tinta); line-height: 1.2; margin: 14px 0 6px; }
.baj-prueba { font-size: 14.5px; color: var(--gris); margin-bottom: 14px; }
.cuerpo-prueba p { font-size: 14px; line-height: 1.7; margin-bottom: 12px; }
.cuerpo-prueba h4 { font-size: 15px; font-weight: 700; color: var(--tinta); margin: 16px 0 8px; }
.cuerpo-prueba ul { margin: 0 0 12px 20px; font-size: 14px; line-height: 1.6; }
.cuerpo-prueba blockquote { border-left: 3px solid var(--ac); padding-left: 14px; margin: 14px 0; font-size: 15px; font-style: italic; }
.cuerpo-prueba cite { display: block; font-size: 12px; color: var(--gris); font-style: normal; margin-top: 6px; }

/* plantillas */
.lista-plantillas { max-height: 58vh; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; }
.grupo-plantilla { border: 1px solid var(--linea); border-radius: 10px; padding: 14px; }
.cab-grupo { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; font-size: 13.5px; color: var(--tinta); }
.fila-plantilla { margin-bottom: 12px; }
.cab-plantilla { display: flex; align-items: center; gap: 9px; margin-bottom: 5px; }
.cab-plantilla button { margin-left: auto; }
.fila-plantilla textarea { font-size: 12.5px; line-height: 1.5; }

/* armador de la placa de redes: la previa la dibuja el server, acá sólo van
   las manijas arrastrables encima (por eso el fondo es un <img> y las cajas
   son divs posicionados en porcentaje del lienzo) */
.armador { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.armador .costado { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 48px); overflow-y: auto; }
.armador .costado .panel { margin-bottom: 0; }
.lienzo-placa { position: relative; margin: 0 auto; background: var(--suave); border-radius: 10px;
  overflow: hidden; box-shadow: var(--sombra-alta); touch-action: none; user-select: none; }
.lienzo-placa img { display: block; width: 100%; height: auto; }
.lienzo-placa.cargando img { opacity: .55; transition: opacity .15s; }
.caja-capa { position: absolute; border: 1.5px dashed rgba(255,255,255,.55); border-radius: 4px;
  cursor: grab; transition: border-color .12s, background .12s; }
.caja-capa:hover { border-color: #fff; background: rgba(255,255,255,.08); }
.caja-capa.sel { border: 2px solid var(--ac); background: rgba(79,70,229,.16); box-shadow: 0 0 0 2px rgba(255,255,255,.5); }
.caja-capa.arrastrando { cursor: grabbing; border-style: solid; }
.caja-capa .nombre { position: absolute; top: -19px; left: -2px; font-size: 10px; font-weight: 700;
  letter-spacing: .5px; text-transform: uppercase; color: #fff; background: var(--ac);
  padding: 1px 6px; border-radius: 4px; white-space: nowrap; opacity: 0; transition: opacity .12s; }
.caja-capa.sel .nombre, .caja-capa:hover .nombre { opacity: 1; }
.capas-placa { display: flex; flex-direction: column; gap: 4px; }
.capa-placa { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 8px;
  border: 1px solid var(--linea); background: var(--panel); cursor: pointer; font-size: 12.5px; text-align: left; }
.capa-placa:hover { border-color: #c6cbda; }
.capa-placa.sel { border-color: var(--ac); background: #f6f5ff; }
.capa-placa .tipo { margin-left: auto; font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--gris-2); }
.capa-placa.oculta b { text-decoration: line-through; opacity: .55; }
.fila-prop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fila-prop .campo { margin-bottom: 10px; }
.prop-color { display: flex; align-items: center; gap: 8px; }
.prop-color input[type=color] { width: 40px; height: 30px; border-radius: 7px; padding: 0; flex-shrink: 0; }
.prop-color select { flex: 1; }

@media (max-width: 1200px) {
  .constructor { grid-template-columns: 1fr; }
  .salida { position: static; }
  .conflicto { grid-template-columns: 1fr; }
  .conflicto .vs { text-align: center; }
  .comparador { grid-template-columns: 1fr; }
  .armador { grid-template-columns: 1fr; }
  .armador .costado { position: static; max-height: none; }
}

/* el "+" de cada día del calendario: discreto, aparece con el hover del día
   (en pantallas táctiles queda siempre visible, tenue) */
.dia-cal .dia-mas { position: absolute; top: 5px; right: 6px; width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center; border-radius: 6px;
  font-size: 15px; font-weight: 600; color: var(--gris-2); opacity: 0; transition: opacity .12s, background .12s; }
.dia-cal:hover .dia-mas { opacity: 1; }
.dia-cal .dia-mas:hover { background: var(--ac); color: #fff; }
@media (hover: none) { .dia-cal .dia-mas { opacity: .55; } }

/* ── Nota asistida: asistente de tres columnas ───────────────────────── */
.principal.ancho { max-width: none; padding: 24px 28px 40px; }
.principal.ancho .campana, .principal.ancho .cabecera .acciones > .btn.fantasma.campana { display: none; }
.principal.ancho .cabecera { align-items: center; margin-bottom: 18px; }
.principal.ancho .cabecera .acciones { flex-wrap: nowrap; gap: 12px; }
.principal.ancho .btn.contorno, .as-velo .btn.contorno { background: #fff; border: 1px solid #d5d9e3; color: var(--tinta); font-weight: 600; }
.principal.ancho .btn.contorno:hover, .as-velo .btn.contorno:hover { border-color: var(--ac); color: var(--ac); }
.principal.ancho .btn.primario, .as-velo .btn.primario { background: #4f46e5; }
.as-wiz { display: grid; grid-template-columns: minmax(0, .82fr) minmax(0, 1fr);
  gap: 20px; align-items: start; }
.as-col-a { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.as-wiz .as-col { margin: 0; min-width: 0; padding: 24px; border-radius: 14px; }
.as-wiz .as-col h2 { font-size: 17px; margin: 0 0 4px; color: var(--tinta); }
.as-wiz .as-col > .t-sub { margin: 0 0 16px; color: var(--gris-2); }
.as-wiz input:not([type=range]):not([type=checkbox]), .as-wiz select { height: 40px; border-radius: 8px; width: 100%; box-sizing: border-box; }
.as-wiz textarea { border-radius: 8px; width: 100%; box-sizing: border-box; resize: vertical; }
.as-wiz .campo { margin-bottom: 14px; }
.as-wiz .campo > label { display: block; font-size: 11.5px; font-weight: 600; letter-spacing: .4px; text-transform: uppercase; color: var(--gris-2); margin-bottom: 6px; }
.as-wiz .as-tres .campo > label, .as-wiz .fila .campo > label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--texto); font-weight: 500; }
.as-wiz .as-mas .campo > label { text-transform: none; letter-spacing: 0; }
.as-wiz select { text-overflow: clip; padding: 0 28px 0 12px; font-size: 13.5px; }

/* pasos */
.as-pasos { display: flex; align-items: center; list-style: none; margin: 0 8px 0 0; padding: 0; font-size: 13px; color: var(--gris-2); }
.as-pasos li { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.as-pasos li + li::before { content: ''; width: 44px; height: 1px; background: #cfd3de; margin: 0 12px; }
.as-pasos li span { display: inline-flex; width: 28px; height: 28px; border-radius: 50%; align-items: center; justify-content: center;
  background: #e8eaf1; color: var(--gris); font-weight: 700; font-size: 13px; }
.as-pasos li.on { color: var(--ac); font-weight: 700; }
.as-pasos li.on span { background: #4f46e5; color: #fff; }
.as-pasos li.hecho span { background: var(--ok-bg); color: var(--ok); }
.as-costo { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gris); white-space: nowrap; }

/* medios */
.as-av { display: inline-flex; flex: none; align-items: center; justify-content: center; border-radius: 8px; overflow: hidden;
  background: #fff; border: 1px solid var(--linea); box-sizing: border-box; }
.as-av img { width: 100%; height: 100%; object-fit: contain; }
.as-av.ini { color: #fff; font-weight: 700; font-size: 11px; border: 0; }
.as-combo { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #d5d9e3; border-radius: 10px;
  padding: 8px 10px; min-height: 52px; cursor: pointer; background: #fff; box-sizing: border-box; }
.as-combo.fijo { cursor: default; background: var(--suave); }
.as-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.as-chip { display: inline-flex; align-items: center; gap: 8px; background: var(--suave); border-radius: 8px; padding: 4px 8px 4px 6px; font-size: 13.5px; font-weight: 500; }
.as-chip a { cursor: pointer; color: var(--gris-2); font-size: 16px; line-height: 1; }
.as-mas-n { background: var(--suave); border-radius: 8px; padding: 7px 10px; font-size: 13px; color: var(--gris); }
.as-chev { display: inline-flex; color: var(--tinta); transition: transform .15s; }
.as-chev.arriba { transform: rotate(180deg); }
.as-combo-w { position: relative; }
.as-drop { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 40; border: 1px solid var(--linea); border-radius: 8px; background: #fff; box-shadow: var(--sombra-alta); overflow: hidden; }
.as-busca { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--linea); color: var(--gris-2); }
.as-busca input { border: 0 !important; outline: 0; box-shadow: none !important; padding: 0; background: none; }
.as-acc { display: flex; justify-content: space-between; padding: 8px 14px 0; font-size: 12px; }
.as-acc a { color: var(--ac); cursor: pointer; }
.as-lista-medios { list-style: none; margin: 0; padding: 4px 0; max-height: min(340px, 50vh); overflow-y: auto; overflow-x: hidden; }
.as-lista-medios label { text-transform: none; letter-spacing: 0; font-weight: 400; font-size: 14px; margin: 0; display: flex; align-items: center; gap: 12px; padding: 7px 14px; border-radius: 0; cursor: pointer; }
.as-lista-medios label:hover, .as-lista-medios label.on { background: #f1f2fb; }
.as-lista-medios input[type=checkbox] { width: 18px; height: 18px; accent-color: #4f46e5; flex: none; }
.as-nom { font-size: 14px; color: var(--tinta); overflow-wrap: anywhere; }
.as-nada { padding: 12px; font-size: 13px; color: var(--gris-2); }

/* el hecho */
.as-url { display: flex; gap: 8px; margin-bottom: 8px; }
.as-url input { flex: 1; min-width: 0; }
.as-url .btn { height: 40px; }
.as-zona { border: 1.5px dashed #cfd3de; border-radius: 10px; background: #fafbfd; cursor: pointer; min-height: 70px; display: flex; align-items: center; justify-content: center; padding: 12px; }
.as-zona.sobre, .as-zona:hover { border-color: #4f46e5; background: #f4f4fe; }
.as-zona-in { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--texto); text-align: left; }
.as-zona-in .ic { width: 22px; height: 22px; color: var(--gris-2); flex: none; }
.as-zona-in small { display: block; color: var(--gris-2); font-size: 12px; margin-top: 2px; }
.as-zona-in b { font-weight: 500; }
.as-zona-in img { max-width: 100%; max-height: 170px; border-radius: 8px; display: block; }
.as-img-acc { display: flex; gap: 14px; margin-top: 6px; font-size: 12px; }
.as-img-acc a, .as-discreto { color: var(--gris-2); cursor: pointer; text-decoration: underline; }
.as-discreto { display: inline-block; margin-top: 12px; font-size: 12px; }
.as-callout { display: flex; gap: 8px; align-items: center; background: #eaf2ff; color: #14509f; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; }
.as-callout .ic { flex: none; width: 16px; height: 16px; }

/* estrategia */
.as-analisis { display: grid; grid-template-columns: 38px 1fr auto; column-gap: 12px; row-gap: 2px; align-items: center; background: #eeeafd; border-radius: 12px; padding: 14px 16px; }
.as-an-ic { grid-row: 1 / 3; align-self: start; display: inline-flex; width: 38px; height: 38px; border-radius: 10px; background: #e0dbfb; color: #4f46e5; align-items: center; justify-content: center; }
.as-an-t { color: #4f46e5; font-size: 13.5px; }
.as-an-d, .as-an-err { grid-column: 2 / 4; margin: 0; font-size: 12px; color: var(--gris); line-height: 1.45; }
.as-an-err { color: var(--mal) !important; }
.as-analisis .btn { white-space: nowrap; background: #fff; }
.as-elementos { background: #f3f4f8; border-radius: 12px; padding: 14px 16px; margin-top: 12px; }
.as-elementos > b { font-size: 13px; }
.as-elementos.cargando { opacity: .55; }
.as-el-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 14px; margin-top: 12px; }
.as-el { display: flex; gap: 10px; min-width: 0; }
.as-el > .as-el-ic { display: flex; flex: none; flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%; background: #e6e8f6; color: #4f46e5; align-items: center; justify-content: center; }
.as-el small { display: block; font-size: 12px; color: var(--gris-2); margin-bottom: 2px; }
.as-el > div span { display: block; font-size: 13px; color: var(--tinta); overflow-wrap: anywhere; }
.as-el > div span.ph { color: #a4abbb; }
.as-div { display: flex; align-items: center; gap: 12px; margin: 22px 0 14px; font-size: 11.5px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--gris); }
.as-div::after { content: ''; flex: 1; height: 1px; background: var(--linea); }
.as-desl { display: grid; grid-template-columns: 100px 1fr 20px; gap: 12px; align-items: start; margin-bottom: 8px; }
.as-wiz .as-desl > label { font-size: 13px; color: var(--texto); padding-top: 2px; line-height: 1.3; text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.as-trk { position: relative; }
.as-fin { position: relative; display: flex; justify-content: space-between; font-size: 12px; color: var(--gris-2); margin-top: 4px; padding-top: 18px; }
.as-val { position: absolute; transform: translateX(-50%); color: var(--tinta); font-weight: 600; top: 0; }
.as-wiz input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; padding: 0; border: 0; margin: 8px 0 0; display: block;
  background: linear-gradient(to right, #4f46e5 var(--v, 0%), #dcdff0 var(--v, 0%)); }
.as-wiz input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #4f46e5; cursor: pointer; }
.as-wiz input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid #4f46e5; cursor: pointer; }
.as-i { color: #a4abbb; display: inline-flex; padding-top: 2px; cursor: help; }
.as-i .ic { width: 16px; height: 16px; }
.as-angulo { display: grid; grid-template-columns: minmax(150px, 1.3fr) 1.4fr 38px 20px; gap: 12px; align-items: center; padding: 6px 0; }
.as-wiz .as-angulo label { display: flex; align-items: center; gap: 10px; font-size: 13.5px; cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; color: var(--texto); }
.as-angulo input[type=checkbox] { width: 18px; height: 18px; accent-color: #4f46e5; flex: none; }
.as-angulo input.as-barra { margin: 0; height: 6px; }
.as-angulo input.as-barra::-webkit-slider-thumb { width: 12px; height: 12px; opacity: 0; }
.as-angulo input.as-barra:hover::-webkit-slider-thumb, .as-angulo input.as-barra:focus::-webkit-slider-thumb { opacity: 1; }
.as-peso { font-size: 12px; color: var(--gris); text-align: right; }
.as-angulo.base { opacity: .55; }
.as-tres { display: grid; grid-template-columns: 1.15fr 1fr 1.35fr; gap: 10px; }
.as-tres input { padding-right: 24px; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center / 14px; }
.as-tres input::-webkit-calendar-picker-indicator { opacity: 0; }
.as-mas { margin-top: 18px; }
.as-mas summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--gris); margin-bottom: 10px; }

/* vista previa: modal */
.as-tabs { position: relative; display: flex; gap: 2px; background: var(--suave); border-radius: 10px; padding: 4px; margin-bottom: 12px; }
.as-tabs button { white-space: nowrap; flex: none; display: inline-flex; align-items: center; gap: 8px; border: 0; background: none; padding: 8px 14px; font: inherit; font-size: 13.5px; font-weight: 500;
  color: var(--texto); cursor: pointer; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; }
.as-tabs button.on { color: var(--tinta); border-bottom-color: #4f46e5; font-weight: 600; background: #fff; }
.as-tabs .as-av { width: 20px; height: 20px; border-radius: 6px; }
.as-mas-tab { margin-left: auto; }
.as-menu { position: absolute; right: 4px; top: 100%; z-index: 5; background: #fff; border: 1px solid var(--linea); border-radius: 10px; box-shadow: var(--sombra-alta); padding: 4px; display: flex; flex-direction: column; min-width: 200px; max-height: 260px; overflow-y: auto; }
.as-velo .as-modal { width: min(1100px, 92vw); max-width: none; height: 88vh; max-height: 88vh; padding: 0; display: flex; flex-direction: column; overflow: hidden; border-radius: 16px; }
.as-modal-cab { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 28px 12px; }
.as-modal-cab h2 { margin: 0 0 2px; font-size: 18px; }
.as-modal-cab .t-sub { margin: 0; }
#as-vp-x { font-size: 24px; line-height: 1; }
.as-velo .as-tabs { margin: 0 28px 12px; }
.as-prev { position: relative; flex: 1; min-height: 0; overflow-y: auto; padding: 8px 28px 20px; }
.as-prev .as-nota, .as-prev .as-esq { max-width: 760px; margin: 0 auto; }
.as-esq { opacity: .9; }
.as-esq .l { height: 12px; border-radius: 6px; background: #eceef4; margin: 10px 0; width: 100%; }
.as-esq .l.t { height: 26px; }
.as-esq .w40 { width: 40%; } .as-esq .w80 { width: 80%; } .as-esq .w90 { width: 90%; } .as-esq .w70 { width: 70%; } .as-esq .w60 { width: 60%; }
.as-esq .img { height: 170px; border-radius: 8px; background: #eceef4; margin: 16px 0; }
.as-centro { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; background: rgba(255,255,255,.55); }
.as-vieja { background: var(--alerta-bg); color: var(--alerta); border-radius: 8px; padding: 6px 12px; font-size: 12.5px; margin-bottom: 12px; display: flex; gap: 10px; }
.as-vieja a { color: var(--ac); font-weight: 600; cursor: pointer; }
.as-nota { font-family: Georgia, 'Source Serif 4', serif; color: #1b1f27; }
.as-logo { margin-bottom: 14px; }
.as-logo img { height: 34px; max-width: 70%; object-fit: contain; display: block; }
.as-logo b { font-size: 22px; }
.as-kicker { font-family: var(--sans); font-size: 11px; font-weight: 600; letter-spacing: .5px; text-transform: uppercase; color: var(--gris); margin-bottom: 8px; }
.as-nota h3 { font-size: 28px; line-height: 1.15; font-weight: 700; margin: 0 0 12px; color: #11141a; }
.as-bajada { font-size: 16px; line-height: 1.5; color: #3a404c; margin: 0 0 16px; }
.as-nota figure { margin: 0 0 14px; }
.as-nota figure img { width: 100%; max-height: 300px; object-fit: cover; border-radius: 6px; display: block; }
.as-nota figcaption { font-family: var(--sans); font-size: 11.5px; color: var(--gris-2); margin-top: 6px; }
.as-firma { display: flex; gap: 10px; align-items: center; font-family: var(--sans); margin: 14px 0; }
.as-firma b { display: block; font-size: 13px; }
.as-firma small { color: var(--gris-2); font-size: 12px; }
.as-firma .as-av { border-radius: 50%; color: #fff; }
.as-cuerpo { font-size: 15.5px; line-height: 1.65; }
.as-cuerpo p { margin: 0 0 14px; }
.as-cuerpo h4 { margin: 18px 0 8px; font-size: 18px; }
.as-cuerpo blockquote { margin: 12px 0; padding-left: 14px; border-left: 3px solid #4f46e5; color: #444b58; }
.as-cuerpo cite { display: block; font-size: 12px; margin-top: 2px; }
.as-fade { position: sticky; bottom: -20px; height: 60px; margin: -60px -28px -20px; background: linear-gradient(to bottom, rgba(255,255,255,0), #fff); pointer-events: none; }
.as-prev-pie { display: flex; gap: 12px; padding: 14px 28px 20px; border-top: 1px solid var(--linea); background: #fff; }
.as-prev-pie .btn { height: 44px; justify-content: center; }
.as-prev-pie .btn.primario { flex: 1; }
@media (max-width: 1280px) {
  .principal.ancho .cabecera { flex-wrap: wrap; }
  .principal.ancho .cabecera .textos { flex-basis: 100%; }
  .principal.ancho .cabecera .acciones { flex-wrap: wrap; }
}
@media (max-width: 1000px) { .as-wiz { grid-template-columns: 1fr; } }
@media (max-width: 800px) {
  .as-wiz { grid-template-columns: 1fr; }
  .as-tres, .as-el-grid { grid-template-columns: 1fr; }
  .as-velo .as-modal { width: 100vw; height: 100vh; max-height: none; border-radius: 0; }
  .as-pasos li + li::before { width: 14px; margin: 0 6px; }
  .as-pasos li { font-size: 0; gap: 0; } .as-pasos li span { font-size: 13px; }
  .as-angulo { grid-template-columns: 1fr 1fr 38px; } .as-angulo .as-i { display: none; }
  .principal.ancho .cabecera .acciones { flex-wrap: wrap; }
}

.as-el-ic .ic, .as-an-ic .ic { width: 18px; height: 18px; display: block; }
.as-an-ic { flex-shrink: 0; }

/* redes conectadas por medio */
.as-redes { display: inline-flex; gap: 8px; align-items: center; margin-left: auto; flex: none; }
.as-redes.chica { gap: 4px; margin-left: 2px; }
.as-red { position: relative; display: inline-flex; width: 16px; height: 16px; }
.as-red svg { width: 100%; height: 100%; fill: currentColor; }
.as-redes.chica .as-red { width: 13px; height: 13px; }
.as-red.act.facebook { color: #1877f2; }
.as-red.act.instagram { color: #e1306c; }
.as-red.pau { color: #9aa1b2; }
.as-red.pau::after { content: ''; position: absolute; right: -3px; bottom: -3px; width: 6px; height: 6px; border-radius: 50%; background: #e0a100; border: 1px solid #fff; box-sizing: border-box; }
.as-red.no { color: #c9cdd8; opacity: .55; }

/* postura: a favor / en contra de un actor */
.as-postura { margin: 4px 0 12px 112px; padding: 10px 12px; background: #f6f7fb; border-radius: 10px; }
.as-post-fila { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.as-post-t { font-size: 13px; font-weight: 600; color: var(--tinta); margin-right: 4px; }
.as-seg { display: inline-flex; border: 1px solid #d5d9e3; border-radius: 8px; overflow: hidden; background: #fff; }
.as-seg button { border: 0; background: none; padding: 7px 12px; font: inherit; font-size: 13px; color: var(--texto); cursor: pointer; }
.as-seg button + button { border-left: 1px solid #d5d9e3; }
.as-seg button.on { background: #4f46e5; color: #fff; font-weight: 600; }
.as-postura select, .as-postura input { flex: 1 1 160px; min-width: 0; width: auto !important; height: 36px !important; }
.as-post-hint { margin: 6px 0 0; color: var(--alerta); }
@media (max-width: 800px) { .as-postura { margin-left: 0; } }

/* fuentes leídas, estado del análisis, reset */
.as-fuentes { margin-bottom: 8px; }
.as-fuente { border-bottom: 1px solid var(--linea); }
.as-f-lin { display: flex; align-items: center; gap: 8px; height: 32px; min-width: 0; }
.as-f-fav { width: 16px; height: 16px; flex: none; border-radius: 3px; }
.as-f-tit { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; color: var(--tinta); text-decoration: none; }
.as-f-tit:hover { color: var(--ac); text-decoration: underline; }
.as-f-dom { flex: none; font-size: 11.5px; color: var(--gris-2); max-width: 28%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-f-est { flex: none; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--ok-bg); color: var(--ok); white-space: nowrap; }
.as-f-est.par { background: var(--alerta-bg); color: var(--alerta); }
.as-f-est.ia { background: #efe9fd; color: var(--ac-2); }
.as-f-btn { flex: none; border: 0; background: none; cursor: pointer; color: var(--gris-2); padding: 2px 4px; font-size: 16px; line-height: 1; display: inline-flex; }
.as-f-btn .ic { width: 14px; height: 14px; }
.as-f-btn:hover { color: var(--tinta); }
.as-f-btn[aria-expanded="true"] .ic { transform: rotate(180deg); }
.as-f-texto { max-height: 140px; overflow-y: auto; font-size: 12px; line-height: 1.5; color: var(--gris); background: var(--suave); border-radius: 8px; padding: 8px 10px; margin: 0 0 6px; white-space: pre-wrap; }
.as-f-mas { border: 0; background: none; color: var(--ac); font: inherit; font-size: 12px; cursor: pointer; padding: 6px 0; }
.as-an-estado { grid-column: 2 / 4; margin: 0; font-size: 11.5px; color: var(--gris-2); min-height: 14px; }
.as-reset { margin: 4px 0 0; font-size: 12px; }
.as-reset a { color: var(--gris-2); cursor: pointer; text-decoration: underline; }
.as-post-por { margin: 6px 0 0; color: var(--gris); }

.as-pie-estrategia { justify-content: flex-end; margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--linea); }

/* estilo recordado */
.as-reset-estilo { order: 2; font-size: 11px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--gris-2); cursor: pointer; text-decoration: underline; }
.as-div::after { order: 1; }
.as-tono-hint { margin: 4px 0 0; color: var(--ac); }
.as-tono-hint a { cursor: pointer; text-decoration: underline; }
