.ec-assistant-fab {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 240;
  width: 3.35rem;
  height: 3.35rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--primary), var(--primary-deep, #007a54));
  color: #fff;
  box-shadow: 0 10px 28px rgba(0, 168, 112, 0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.ec-assistant-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(0, 168, 112, 0.5);
}
.ec-assistant-fab svg {
  width: 1.35rem;
  height: 1.35rem;
}

.ec-assistant-panel {
  position: fixed;
  right: 1rem;
  bottom: 4.75rem;
  z-index: 241;
  width: min(22.5rem, calc(100vw - 1.5rem));
  max-height: min(32rem, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.18);
  overflow: hidden;
  transform-origin: bottom right;
  animation: ec-asst-in 0.2s ease;
}
@keyframes ec-asst-in {
  from { opacity: 0; transform: scale(0.96) translateY(8px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.ec-assistant-panel[hidden] {
  display: none !important;
}

.ec-assistant-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.75rem 0.9rem;
  background: linear-gradient(135deg, #0f172a, #1e3a2f);
  color: #fff;
}
.ec-assistant-head strong {
  font-size: 0.9rem;
  font-weight: 700;
}
.ec-assistant-head span {
  font-size: 0.68rem;
  opacity: 0.85;
  display: block;
}
.ec-assistant-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 6px;
}
.ec-assistant-close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ec-assistant-msgs {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  background: var(--surface-muted, #f8fafc);
  min-height: 10rem;
}

.ec-assistant-msg {
  max-width: 92%;
  padding: 0.55rem 0.7rem;
  border-radius: 12px;
  font-size: 0.84rem;
  line-height: 1.45;
  white-space: pre-wrap;
}
.ec-assistant-msg--bot {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
}
.ec-assistant-msg--user {
  align-self: flex-end;
  background: var(--primary-pale, #e6f7f1);
  color: var(--primary-deep, #007a54);
  border: 1px solid rgba(0, 168, 112, 0.2);
}
.ec-assistant-msg a {
  color: var(--primary);
  font-weight: 600;
}

.ec-assistant-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}
.ec-assistant-links a {
  font-size: 0.72rem;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-pill);
  background: var(--primary-pale);
  text-decoration: none;
  color: var(--primary-deep);
  border: 1px solid rgba(0, 168, 112, 0.15);
}
.ec-assistant-links a:hover {
  background: var(--primary);
  color: #fff;
}

.ec-assistant-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  padding: 0 0.85rem 0.5rem;
  background: var(--surface-muted, #f8fafc);
}
.ec-assistant-chips button {
  font: inherit;
  font-size: 0.72rem;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
}
.ec-assistant-chips button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.ec-assistant-compose {
  display: flex;
  gap: 0.4rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--border);
  background: #fff;
}
.ec-assistant-compose input {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.75rem;
  font: inherit;
  font-size: 0.85rem;
}
.ec-assistant-compose input:focus {
  outline: 2px solid rgba(0, 168, 112, 0.25);
  border-color: var(--primary);
}
.ec-assistant-compose button[type="submit"] {
  border: none;
  border-radius: var(--radius-pill);
  padding: 0.5rem 0.85rem;
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
}
.ec-assistant-compose button[type="submit"]:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .ec-assistant-panel {
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
  }
}
