/*
 * Agentes, el ARM (centr.ar/agentes/). La portada: en la bandeja aparece el punto de CENTRAR en una
 * conversación que se enfrió; al abrirla, el agente dice que preparó el seguimiento, «Ver borrador»
 * abre la respuesta con el texto listo y se manda. Ciclo de 12 s: el punto al 8 %, la conversación
 * se abre al 20 %, la línea del agente al 28 %, el borrador al 48 % y «Enviar» al 70 %.
 * Como en las demás páginas, lo que se anima parte del estado final: sin movimiento se ve completo.
 * Los textos y la forma de la línea, la marca y los botones copian la extensión (gmail.css,
 * .centr-agent-*).
 */
.ag-live {
  --T: 12s;
  position: relative;
  align-items: stretch;
  background:
    radial-gradient(420px 260px at 100% 100%, rgb(241 107 75 / 0.07), transparent 70%),
    #fff;
}

/* La bandeja de Gmail, con el chip del embudo en cada fila. */
.ag-inbox {
  display: flex;
  flex-direction: column;
  padding: 8px 0;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: #202124;
  font-size: 13px;
}
.ag-inbox-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 18px 12px;
  border-bottom: 1px solid #eef1ec;
  font-size: 14px;
}
.ag-inbox-head svg {
  width: 16px;
  height: 16px;
}
.ag-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas:
    'from from time'
    'tag sub sub';
  align-items: center;
  gap: 4px 10px;
  padding: 12px 18px 12px 26px;
  border-bottom: 1px solid #f1f3f4;
}
.ag-row:last-child {
  border-bottom: 0;
}
.ag-row b {
  grid-area: from;
  font-weight: 600;
}
.ag-row time {
  grid-area: time;
  color: #5f6368;
  font-size: 12px;
}
.ag-row .ag-sub {
  grid-area: sub;
  overflow: hidden;
  color: #5f6368;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ag-row em,
.ag-subj em {
  position: relative;
  grid-area: tag;
  justify-self: start;
  padding: 2px 8px;
  border-radius: 99px;
  background: #e3efe7;
  color: #1f5a45;
  font-size: 11.5px;
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}
/* El punto del agente, a la izquierda del chip, como en la fila de Gmail. */
.ag-row.is-it em::before {
  content: '';
  position: absolute;
  left: -15px;
  top: calc(50% - 4px);
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 2px #fff;
}
.ag-live .ag-row.is-it em::before {
  animation: ag-pt var(--T) infinite both;
}
.ag-live .ag-row.is-it {
  animation: ag-pick-row var(--T) infinite both;
}

/* La conversación abierta: el asunto con su etapa, la línea del agente, tu correo y el borrador. */
.ag-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: #202124;
  font-size: 13px;
}
.ag-live .ag-thread {
  animation: ag-open var(--T) infinite both;
}
.ag-subj {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}
.ag-subj b {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.ag-from {
  display: flex;
  align-items: center;
  gap: 10px;
}
.ag-me {
  display: grid;
  place-items: center;
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
}
.ag-from span {
  display: grid;
}
.ag-from small,
.ag-from time {
  color: #5f6368;
  font-size: 12px;
}
.ag-from time {
  margin-left: auto;
}
.ag-body {
  display: grid;
  gap: 8px;
  padding-left: 42px;
}
.ag-body i {
  height: 8px;
  border-radius: 99px;
  background: #e8ece7;
}
.ag-body .w1 {
  width: 92%;
}
.ag-body .w2 {
  width: 78%;
}
.ag-body .w3 {
  width: 54%;
}

/* La línea del agente: la marca coral, el texto y sus botones. */
.ag-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  color: #202124;
  font-size: 12.5px;
  line-height: 1.4;
  white-space: normal;
}
.ag-line > span {
  flex: 1 1 180px;
  min-width: 0;
}
.ag-mark {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
}
.ag-line u {
  padding: 2px 8px;
  border: 1px solid #c4c7c5;
  border-radius: 6px;
  background: #fff;
  color: #12332f;
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.ag-line.is-risk {
  color: #8a3b00;
}
.ag-line.is-risk .ag-mark {
  background: #e37400;
}
.ag-live .ag-say {
  animation: ag-say var(--T) infinite both;
}
.ag-live .ag-say u:first-of-type {
  animation: ag-press var(--T) infinite both;
}

/* El borrador abierto con «Ver borrador»: el texto de tu respuesta rápida, con nombre y empresa. */
.ag-reply {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  line-height: 1.5;
  white-space: normal;
}
.ag-reply small {
  color: #5f6368;
  font-size: 12px;
}
.ag-send {
  display: grid;
  justify-self: start;
}
.ag-send b,
.ag-send em {
  grid-area: 1 / 1;
  padding: 6px 18px;
  border-radius: 18px;
  font-size: 12.5px;
  font-style: normal;
  font-weight: 600;
}
.ag-send b {
  background: #0b57d0;
  color: #fff;
}
.ag-send em {
  background: var(--okbg, #e6f4ea);
  color: var(--ok);
  opacity: 0;
}
.ag-live .ag-reply {
  animation: ag-reply var(--T) infinite both;
}
.ag-live .ag-send b {
  animation: ag-send var(--T) infinite both;
}
.ag-live .ag-send em {
  animation: ag-sent var(--T) infinite both;
}

/* El cursor: abre la conversación, toca «Ver borrador» y después «Enviar». */
.ag-cur {
  --row-x: 28%;
  --row-y: 45%;
  --draft-x: 80%;
  --draft-y: 26%;
  --send-x: 56%;
  --send-y: 80%;
  position: absolute;
  z-index: 2;
  width: 22px;
  height: 22px;
  opacity: 0;
  pointer-events: none;
  animation: ag-cur var(--T) infinite both;
}

@keyframes ag-pt {
  0%,
  7% {
    opacity: 0;
    scale: 0.2;
  }
  10% {
    opacity: 1;
    scale: 1.6;
  }
  13%,
  94% {
    opacity: 1;
    scale: 1;
  }
  100% {
    opacity: 0;
    scale: 1;
  }
}
@keyframes ag-pick-row {
  0%,
  19% {
    background: #fff;
  }
  21%,
  94% {
    background: #f2f6ee;
  }
  100% {
    background: #fff;
  }
}
@keyframes ag-open {
  0%,
  19% {
    opacity: 0.35;
  }
  23%,
  96% {
    opacity: 1;
  }
  100% {
    opacity: 0.35;
  }
}
@keyframes ag-say {
  0%,
  26% {
    opacity: 0;
    translate: 0 6px;
  }
  30%,
  94% {
    opacity: 1;
    translate: 0 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ag-press {
  0%,
  45% {
    background: #fff;
  }
  46%,
  52% {
    background: #e3efe7;
  }
  54%,
  100% {
    background: #fff;
  }
}
@keyframes ag-reply {
  0%,
  48% {
    opacity: 0;
    translate: 0 8px;
  }
  52%,
  94% {
    opacity: 1;
    translate: 0 0;
  }
  100% {
    opacity: 0;
  }
}
@keyframes ag-send {
  0%,
  69% {
    opacity: 1;
    scale: 1;
  }
  70% {
    scale: 0.94;
  }
  72%,
  100% {
    opacity: 0;
    scale: 1;
  }
}
@keyframes ag-sent {
  0%,
  71% {
    opacity: 0;
  }
  73%,
  94% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}
/* Las posiciones son del recuadro animado (.ag-live): la fila de Marina, «Ver borrador» y «Enviar». */
@keyframes ag-cur {
  0%,
  11% {
    opacity: 0;
    left: 40%;
    top: 90%;
    scale: 1;
  }
  13% {
    opacity: 1;
  }
  19% {
    left: var(--row-x);
    top: var(--row-y);
    scale: 1;
  }
  20% {
    scale: 0.82;
  }
  21% {
    scale: 1;
  }
  38% {
    left: var(--row-x);
    top: var(--row-y);
  }
  45% {
    left: var(--draft-x);
    top: var(--draft-y);
    scale: 1;
  }
  46% {
    scale: 0.82;
  }
  47% {
    scale: 1;
  }
  56% {
    left: var(--draft-x);
    top: var(--draft-y);
  }
  69% {
    left: var(--send-x);
    top: var(--send-y);
    scale: 1;
  }
  70% {
    scale: 0.82;
  }
  71% {
    scale: 1;
  }
  78% {
    opacity: 1;
  }
  82%,
  100% {
    opacity: 0;
    left: var(--send-x);
    top: var(--send-y);
  }
}

/* Cómo funciona: la escalera de un trabajo, lo que mira y el punto en la fila. */
.ag-fx-ladder,
.ag-fx-watch,
.ag-fx-dot {
  align-items: center;
}
.ag-job {
  display: grid;
  gap: 8px;
  width: min(300px, 100%);
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  white-space: normal;
}
.ag-job b {
  font-size: 12.5px;
}
.ag-job small {
  color: var(--ink-3);
  font-size: 11px;
}
.ag-steps {
  display: flex;
  overflow: hidden;
  border: 1px solid #c4c7c5;
  border-radius: 8px;
}
.ag-steps i {
  display: grid;
  place-items: center;
  flex: 1;
  min-width: 0;
  padding: 5px 3px;
  border-left: 1px solid #c4c7c5;
  font-size: 10.5px;
  font-style: normal;
  line-height: 1.2;
  text-align: center;
  /* En inglés y en la columna angosta, «Prepares it for me» va en dos renglones. */
  white-space: normal;
  text-wrap: balance;
}
.ag-steps i:first-child {
  border-left: 0;
}
.ag-steps .pick {
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  animation: ag-pick var(--s) infinite both;
}
.ag-steps .lock {
  background: #f6f7f6;
  color: #9aa0a6;
}
.ag-fx-ladder .rdr-cur {
  left: 58%;
  top: 52%;
}
@keyframes ag-pick {
  0%,
  45% {
    background: #fff;
    color: #202124;
  }
  47%,
  92% {
    background: var(--ink);
    color: #fff;
  }
  100% {
    background: #fff;
    color: #202124;
  }
}

.ag-sig {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 8px;
  padding: 7px 13px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: #fff;
  font-size: 12px;
  animation: ag-sig var(--s) infinite both;
}
.ag-sig svg {
  color: var(--ok);
}
.ag-sig.s2 {
  animation-delay: 0.9s;
}
.ag-sig.s3 {
  animation-delay: 1.8s;
}
@keyframes ag-sig {
  0%,
  8% {
    opacity: 0;
    translate: 0 6px;
  }
  14%,
  88% {
    opacity: 1;
    translate: 0 0;
  }
  100% {
    opacity: 0;
  }
}

.ag-fx-dot {
  gap: 0;
  padding: 0 12px;
}
.ag-fx-dot .ag-row {
  width: min(300px, 100%);
  background: #fff;
}
.ag-fx-dot .ag-row:first-child {
  border-radius: 10px 10px 0 0;
}
.ag-fx-dot .ag-row:last-child {
  border-radius: 0 0 10px 10px;
}
.ag-fx-dot .ag-row.is-it em::before {
  animation: ag-pulse 1.8s infinite both;
}
@keyframes ag-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 2px #fff, 0 0 0 2px rgb(241 107 75 / 0.35);
  }
  50% {
    box-shadow: 0 0 0 2px #fff, 0 0 0 7px rgb(241 107 75 / 0);
  }
}

/* De avisar a hacer: cada tarjeta con lo que el agente deja en la conversación. */
.ag-jobs .fp-col p {
  flex: 0 0 auto;
}
.ag-ex {
  display: grid;
  align-content: start;
  gap: 12px;
  margin: auto 0 0;
  padding: 14px;
  border-radius: 12px;
  background: #f2f6ee;
}
.ag-brief {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 14px;
  color: #202124;
  font-size: 12.5px;
  line-height: 1.45;
}
.ag-brief dt {
  color: #5f6368;
}
.ag-brief dd {
  margin: 0;
}

/* El Dot de ChatGPT: una conversación de chat. */
.ag-dot {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfcfa;
  color: #202124;
  font-size: 13.5px;
  white-space: normal;
}
.ag-dot-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eef1ec;
}
.ag-dot-head small {
  margin-left: auto;
  color: var(--ink-3);
  font-size: 11.5px;
}
.ag-face {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 9px var(--ink), inset 0 0 0 28px var(--coral);
}
.ag-msg {
  display: grid;
  gap: 6px;
  max-width: 86%;
  padding: 10px 13px;
  border-radius: 14px;
  line-height: 1.45;
}
.ag-msg.mine {
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  background: #eef3ea;
}
.ag-msg.in {
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line);
}
.ag-msg u {
  color: var(--ok);
  font-weight: 650;
  text-decoration: none;
}

@media (max-width: 900px) {
  .ag-cur {
    display: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .ag-cur {
    display: none;
  }
  .ag-live .ag-row.is-it em::before,
  .ag-live .ag-row.is-it,
  .ag-live .ag-thread,
  .ag-live .ag-say,
  .ag-live .ag-say u:first-of-type,
  .ag-live .ag-reply,
  .ag-live .ag-send b,
  .ag-live .ag-send em,
  .ag-steps .pick,
  .ag-sig,
  .ag-fx-dot .ag-row.is-it em::before {
    animation: none;
  }
}
