/* (20-nov, ENC-AGENTE-IA · Playground: rutinas desde el chat) LA PIEZA «rutinas» (asistente-rutinas-chat.js): la ficha de la rutina al crear o cambiar (como las
   tarjetas de la pantalla de Rutinas: el icono lima, el nombre, su cuándo) y las filas al pausar, reanudar o borrar (las de la familia «cuentas», asistente-gestion.css).
   Lima = lo que pone el agente; cobalto = lo que retoca la persona; rojo = lo que se borra. Se mide lo que mide el Playground (container), no la ventana. */
.pgr { display: flex; flex-direction: column; gap: var(--e3); min-width: 0; container-type: inline-size; }
.pgr-arriba { display: flex; flex-direction: column; gap: var(--e2); }
.pgr-arriba:empty { display: none; }
.pgr .pgg-ayuda { flex: none; margin: 0; }
.pgr-avisos { display: flex; flex-direction: column; gap: var(--e1); margin: 0; padding: 0; list-style: none; }

/* la ficha */
.pgr-ficha { display: flex; flex-direction: column; gap: var(--e3); padding: var(--e4); border: 1px solid var(--linea); border-radius: var(--r-l); background: var(--superficie); min-width: 0; }
/* (mejora 7) sin borde de color en un solo lado (DISENO §2): la tarjeta del agente, con su filo lima entero y el fondo lima tenue de «El cambio»; tocada, el filo cobalto */
.pgr-ficha.pgg-agente { border-color: var(--lima-filo); background: color-mix(in srgb, var(--lima-suave) 45%, var(--superficie)); }
.pgr-ficha.pgg-tocada { border-color: var(--acento); }
.pgr-ficha.con-motivo { border-style: dashed; }
.pgr-cab { display: flex; align-items: flex-start; gap: var(--e3); min-width: 0; }
.pgr-ico { width: 40px; height: 40px; }
.pgr-cab-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pgr-nombre { font-size: 16px; line-height: 22px; font-weight: 600; overflow-wrap: anywhere; }
.pgr-nombre.pgg-tocada { color: var(--acento-tinta); }
.pgr-cab-fin { flex: none; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--e1); }
.pgr-antes { font-size: 13px; line-height: 18px; text-decoration-thickness: 1px; overflow-wrap: anywhere; }
.pgr-datos { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 0; margin: 0; border-top: 1px solid var(--linea); }
.pgr-dato { display: contents; }
.pgr-dato > dt, .pgr-dato > dd { padding: 10px 0; border-bottom: 1px solid var(--linea); font-size: 14px; line-height: 20px; }
.pgr-dato:last-child > dt, .pgr-dato:last-child > dd { border-bottom: 0; padding-bottom: 0; }
.pgr-dato > dt { padding-right: var(--e4); color: var(--tinta-3); font-size: 13px; }
.pgr-dato > dd { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; margin: 0; min-width: 0; color: var(--tinta); }
.pgr-valor { min-width: 0; overflow-wrap: anywhere; white-space: pre-line; }
.pgr-dato.marcado.pgg-agente .pgr-valor { color: var(--lima-tinta); font-weight: 600; }
.pgr-dato.marcado.pgg-tocada .pgr-valor { color: var(--acento-tinta); font-weight: 600; }
.pgr-dato .pgg-flecha { align-self: center; }
.pgr-motivo { margin: 0; font-size: 13px; line-height: 18px; color: var(--aviso-tinta, var(--tinta-2)); }
.pgr-fin { flex-direction: row; align-items: center; justify-content: flex-start; margin: 0; }

/* retocar */
.pgr-barra { display: flex; justify-content: flex-end; }
.pgr-barra[hidden] { display: none; }
.pgr-retocar[aria-expanded="true"] { color: var(--acento-tinta); }
.pgr-editor { display: flex; flex-direction: column; gap: var(--e4); padding: var(--e4); border: 1px solid var(--acento); border-radius: var(--r-l); background: var(--acento-suave); min-width: 0; }
.pgr-editor .campo { display: flex; flex-direction: column; margin: 0; min-width: 0; }
.pgr-editor .entrada, .pgr-editor .area { width: 100%; background: var(--superficie); }
.pgr-editor .ru-dias { flex-wrap: wrap; }
.pgr-editor .ru-pest { background: var(--superficie); }
.pgr-resumen { margin: var(--e2) 0 0; color: var(--acento-tinta); }
.pgr-activa { display: flex; align-items: center; flex-wrap: wrap; gap: var(--e2); font-size: 14px; cursor: pointer; }

/* pausar, reanudar y borrar: las filas */
.pgr-mini-ico { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--r-m); background: var(--lima-suave); color: var(--lima-tinta); }
.pgr-mini-ico .ico { width: 18px; height: 18px; }
.pgr-fila.apagada .pgr-mini-ico { background: var(--superficie-3); color: var(--tinta-3); }
.pgr-borra { display: inline-flex; align-items: center; gap: 4px; outline: 1.5px solid var(--mal-tinta); outline-offset: -1.5px; }
.pgr-borra .ico { width: 12px; height: 12px; }
.pgr-desc { flex-basis: 100%; font-size: 12px; line-height: 16px; }
.pgr-fila.pgr-borrar:not(.quitada):not(.apagada) .pgr-mini-ico { background: var(--mal-suave, var(--superficie-3)); color: var(--mal-tinta); }

@container (max-width: 520px) {
  .pgr-ficha { padding: var(--e3); }
  .pgr-datos { grid-template-columns: minmax(0, 1fr); }
  .pgr-dato > dt { padding: 10px 0 0; border-bottom: 0; }
  .pgr-dato > dd { padding-top: 2px; }
  .pgr-cab-fin { flex-direction: column; align-items: flex-end; }
  .pgr-editor { padding: var(--e3); }
}
@container (max-width: 640px) {
  .pgr .pgg-fila { grid-template-columns: 18px minmax(0, 1fr) auto; row-gap: 8px; }
  .pgr .pgg-fila-cambio, .pgr .pgg-fila-motivo { grid-column: 2 / -1; grid-row: 2; }
  .pgr .pgg-fin { grid-column: 3; grid-row: 1; }
}

/* (unión 5, revisión H8) la insignia «Automática» en las filas de pausar, reanudar y borrar: no se encoge; el nombre se corta antes */
.pgr .pgg-fila-quien > .insignia { flex: none; }
