/* Demo "automation-flow" (/automatizaciones). Base: fl-phone.css.
   data-state: start | s1 | s2 | s3 | s4 (cada paso deja encendidos los anteriores) */

.lla-au { --lla-brand: #4f46e5; --lla-cursor-ring: rgba(79, 70, 229, .55); }

.lla-au__chip--auto { left: 360px; top: 40px; }
.lla-au__chip--auto .bi { color: #f59e0b; }
.lla-au__chip--once { left: 380px; top: 470px; animation-delay: -2.5s; }
.lla-au__chip--once .bi { color: #16a34a; }

/* La regla (siempre visible, encima del borde izquierdo del celular) */
.lla-au__rule {
  position: absolute; left: 0; top: 150px; z-index: 7; width: 200px; padding: 12px;
  border-radius: 16px; background: var(--lla-float-bg); color: var(--lla-float-text); box-shadow: var(--lla-float-shadow);
}
.lla-au__rule-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 10px; font-size: 12px; }
.lla-au__toggle { display: inline-flex; align-items: center; gap: 4px; font-size: 10px; font-weight: 700; color: var(--lla-ok); }
.lla-au__toggle i { width: 22px; height: 12px; border-radius: 999px; background: var(--lla-ok); position: relative; }
.lla-au__toggle i::after { content: ''; position: absolute; right: 2px; top: 2px; width: 8px; height: 8px; border-radius: 50%; background: #fff; }

.lla-au__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; position: relative; }
.lla-au__steps::before { content: ''; position: absolute; left: 12px; top: 12px; bottom: 12px; width: 2px; background: var(--lla-border); }
.lla-au__step {
  position: relative; display: flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; color: var(--lla-muted);
  transition: color .35s var(--lla-ease);
}
/* Apagado: fondo sólido (borde encima del fondo de la tarjeta) para que la línea no se vea a través */
.lla-au__ic {
  position: relative; z-index: 1; flex: none; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 8px; color: var(--lla-muted); font-size: 12px;
  background: linear-gradient(var(--lla-border), var(--lla-border)), var(--lla-float-bg);
  transition: background .35s var(--lla-ease), color .35s var(--lla-ease), transform .35s var(--lla-ease);
}
.lla-au:is([data-state="s1"], [data-state="s2"], [data-state="s3"], [data-state="s4"]) .lla-au__step--1,
.lla-au:is([data-state="s2"], [data-state="s3"], [data-state="s4"]) .lla-au__step--2,
.lla-au:is([data-state="s3"], [data-state="s4"]) .lla-au__step--3,
.lla-au[data-state="s4"] .lla-au__step--4 { color: var(--lla-float-text); }
.lla-au:is([data-state="s1"], [data-state="s2"], [data-state="s3"], [data-state="s4"]) .lla-au__step--1 .lla-au__ic { background: #f59e0b; color: #fff; }
.lla-au:is([data-state="s2"], [data-state="s3"], [data-state="s4"]) .lla-au__step--2 .lla-au__ic { background: #0ea5e9; color: #fff; }
.lla-au:is([data-state="s3"], [data-state="s4"]) .lla-au__step--3 .lla-au__ic { background: var(--lla-brand); color: #fff; }
.lla-au[data-state="s4"] .lla-au__step--4 .lla-au__ic { background: var(--lla-ok); color: #fff; }
.lla-au[data-state="s1"] .lla-au__step--1 .lla-au__ic,
.lla-au[data-state="s2"] .lla-au__step--2 .lla-au__ic,
.lla-au[data-state="s3"] .lla-au__step--3 .lla-au__ic,
.lla-au[data-state="s4"] .lla-au__step--4 .lla-au__ic { transform: scale(1.12); }
.lla-au[data-state="s2"] .lla-au__step--2 .bi { animation: lla-au-spin 1.2s ease-in-out infinite; }

/* Aviso al dueño */
.lla-au__notify { left: 300px; top: 330px; width: 250px; }
.lla-au[data-state="s4"] .lla-au__notify { opacity: 1; transform: none; }

/* Bandeja del cliente */
.lla-au__mailbar { display: flex; align-items: center; justify-content: space-between; margin: 34px 14px 8px; font-size: 13px; color: var(--lla-muted); }
.lla-au__mailbar strong { color: var(--lla-text); font-size: 15px; font-weight: 800; margin-right: auto; margin-left: 10px; }
.lla-au__inbox { list-style: none; margin: 0; padding: 0; }
.lla-au__mail { display: flex; gap: 9px; padding: 9px 14px; border-bottom: 1px solid var(--lla-border); }
.lla-au__avatar {
  flex: none; display: flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 50%;
  background: #b45309; color: #fff; font-size: 10px; font-weight: 700;
}
.lla-au__mail-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.lla-au__mail-top { display: flex; justify-content: space-between; gap: 6px; font-size: 11px; }
.lla-au__mail-top em { color: var(--lla-muted); font-size: 9.5px; }
.lla-au__mail small { color: var(--lla-muted); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lla-au__mail-subject { font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* El correo nuevo entra arriba al llegar al paso 3 */
.lla-au__mail--new {
  max-height: 0; padding-block: 0; overflow: hidden; opacity: 0; background: #eef2ff; border-bottom-width: 0;
  transition: max-height .45s var(--lla-ease), padding .45s var(--lla-ease), opacity .4s var(--lla-ease);
}
.lla-au:is([data-state="s3"], [data-state="s4"]) .lla-au__mail--new { max-height: 80px; padding-block: 9px; opacity: 1; border-bottom-width: 1px; }
.lla-au__mail--new .lla-au__mail-top b::after { content: ''; display: inline-block; width: 6px; height: 6px; margin-left: 5px; border-radius: 50%; background: var(--lla-brand); vertical-align: middle; }

@container (max-width: 399px) {
  .lla-au__rule { left: 35px; top: 300px; width: 220px; }
}

@keyframes lla-au-spin { 50% { transform: rotate(180deg); } }

@media (prefers-reduced-motion: reduce) {
  .lla-au__step, .lla-au__ic, .lla-au__mail--new { transition: none; }
  .lla-au .bi { animation: none !important; }
}
