/* Empleado Digital — Café Ganoderma (landing). Usa colores de marca existentes. */
.ed-float {
  position: fixed;
  right: max(1.15rem, env(safe-area-inset-right));
  bottom: max(5.6rem, calc(5.2rem + env(safe-area-inset-bottom)));
  z-index: 9495;
  display: inline-flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: #fff;
  font-family: inherit;
}

.ed-float__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  background: #123d32;
  box-shadow: 0 8px 22px rgba(18, 61, 50, 0.35);
  color: #fff;
}

.ed-float__chip {
  background: #123d32;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(18, 61, 50, 0.22);
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ed-panel {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: 9600;
  width: min(380px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 2rem));
  display: none;
  flex-direction: column;
  background: #faf8f4;
  border: 1px solid rgba(18, 61, 50, 0.14);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(18, 61, 50, 0.22);
  overflow: hidden;
  font-family: "DM Sans", system-ui, sans-serif;
}

.ed-panel.is-open {
  display: flex;
}

.ed-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: #123d32;
  color: #fff;
}

.ed-panel__head strong {
  font-size: 0.98rem;
}

.ed-panel__head button {
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.ed-panel__msgs {
  flex: 1;
  overflow: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.ed-bubble {
  max-width: 88%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.35;
  white-space: pre-wrap;
  word-break: break-word;
}

.ed-bubble--bot {
  align-self: flex-start;
  background: #fff;
  color: #123d32;
  border: 1px solid rgba(18, 61, 50, 0.1);
}

.ed-bubble--user {
  align-self: flex-end;
  background: #123d32;
  color: #fff;
}

.ed-panel__form {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem;
  border-top: 1px solid rgba(18, 61, 50, 0.1);
  background: #fff;
}

.ed-panel__form input {
  flex: 1;
  border: 1px solid rgba(18, 61, 50, 0.18);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font: inherit;
}

.ed-panel__form button {
  border: 0;
  border-radius: 8px;
  background: #123d32;
  color: #fff;
  font-weight: 600;
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.ed-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.65rem 0.55rem;
  background: #fff;
}

.ed-panel__actions a,
.ed-panel__actions button {
  border: 1px solid rgba(18, 61, 50, 0.16);
  background: #f3f1ec;
  color: #123d32;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.ed-lead {
  display: none;
  padding: 0.75rem;
  border-top: 1px solid rgba(18, 61, 50, 0.1);
  background: #fff;
  gap: 0.4rem;
  flex-direction: column;
}

.ed-lead.is-open {
  display: flex;
}

.ed-lead input,
.ed-lead textarea {
  border: 1px solid rgba(18, 61, 50, 0.18);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font: inherit;
}

@media (max-width: 900px) {
  .ed-float {
    bottom: max(5.4rem, calc(5rem + env(safe-area-inset-bottom)));
  }
  .ed-float__chip {
    display: none;
  }
  .ed-panel {
    width: calc(100vw - 1rem);
    height: min(70vh, 560px);
    right: 0.5rem;
    left: 0.5rem;
    margin: 0 auto;
  }
}
