/**
 * Dianaa assistant: floating action button (Uiverse-style) + corner chat panel.
 * Light/dark accents use --shyft-bubble-* on html (shyftcom-dark-bg.css).
 */
.dianaa-assistant-wrap {
  position: fixed;
  inset-inline-end: 24px;
  bottom: 24px;
  z-index: 1040;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: none;
}

.dianaa-assistant-wrap > * {
  pointer-events: auto;
}

/* FAB — adapted from Uiverse (elijahgummer), single pill */
.dianaa-fab-nav {
  margin: 0;
  padding: 0;
}

.dianaa-fab-nav ul {
  position: relative;
  display: flex;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.dianaa-fab-nav li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.dianaa-fab-nav .dianaa-fab-trigger {
  /* --shyft-bubble-* on html (light/dark) from shyftcom-dark-bg.css */
  --dianaa-i: var(--shyft-bubble-fab-i, #8b6ae8);
  --dianaa-j: var(--shyft-bubble-fab-j, #c4a8ff);
  position: relative;
  width: 60px;
  height: 60px;
  background: #fff;
  border-radius: 60px;
  cursor: pointer;
  display: flex;
  justify-content: center;
  align-items: center;
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.1),
    0 0 0 1px rgba(149, 109, 255, 0.16);
  transition: width 0.45s ease, box-shadow 0.45s ease;
  border: none;
  padding: 0;
  overflow: hidden;
}

html[data-bs-theme="dark"] .dianaa-fab-nav .dianaa-fab-trigger {
  background: rgba(18, 12, 38, 0.94);
  box-shadow:
    0 10px 32px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(149, 109, 255, 0.22);
}

.dianaa-fab-nav .dianaa-fab-trigger:hover,
.dianaa-fab-nav .dianaa-fab-trigger:focus-visible {
  width: 200px;
  box-shadow: 0 14px 36px rgba(125, 90, 232, 0.32);
}

html[data-bs-theme="dark"] .dianaa-fab-nav .dianaa-fab-trigger:hover,
html[data-bs-theme="dark"] .dianaa-fab-nav .dianaa-fab-trigger:focus-visible {
  box-shadow:
    0 14px 36px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(149, 109, 255, 0.28) !important;
}

.dianaa-fab-nav .dianaa-fab-trigger::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 60px;
  background: linear-gradient(45deg, var(--dianaa-i), var(--dianaa-j));
  opacity: 0;
  transition: opacity 0.45s ease;
}

.dianaa-fab-nav .dianaa-fab-trigger:hover::before,
.dianaa-fab-nav .dianaa-fab-trigger:focus-visible::before {
  opacity: 1;
}

.dianaa-fab-nav .dianaa-fab-trigger::after {
  content: "";
  position: absolute;
  top: 10px;
  width: 100%;
  height: 100%;
  border-radius: 60px;
  background: linear-gradient(45deg, var(--dianaa-i), var(--dianaa-j));
  transition: opacity 0.45s ease;
  filter: blur(16px);
  z-index: -1;
  opacity: 0;
}

.dianaa-fab-nav .dianaa-fab-trigger:hover::after,
.dianaa-fab-nav .dianaa-fab-trigger:focus-visible::after {
  opacity: 0.45;
}

.dianaa-fab-nav .dianaa-fab-icon {
  color: var(--shyft-bubble-lilac, #6847c9);
  font-size: 1.75rem;
  transition: transform 0.45s ease, color 0.45s ease;
  transition-delay: 0.2s;
}

.dianaa-fab-nav .dianaa-fab-trigger:hover .dianaa-fab-icon,
.dianaa-fab-nav .dianaa-fab-trigger:focus-visible .dianaa-fab-icon {
  transform: scale(0);
  color: #fff;
  transition-delay: 0s;
}

.dianaa-fab-nav .dianaa-fab-title {
  position: absolute;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transform: scale(0);
  transition: transform 0.45s ease;
  transition-delay: 0s;
  padding-inline-start: 4px;
}

.dianaa-fab-nav .dianaa-fab-trigger:hover .dianaa-fab-title,
.dianaa-fab-nav .dianaa-fab-trigger:focus-visible .dianaa-fab-title {
  transform: scale(1);
  transition-delay: 0.2s;
}

/* Chat panel */
.dianaa-chat-panel {
  width: min(100vw - 32px, 380px);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--vz-secondary-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
  border: 1px solid rgba(149, 109, 255, 0.16);
  overflow: hidden;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  pointer-events: none;
  transition: opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

html[data-bs-theme="dark"] .dianaa-chat-panel {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5);
  /* Glass shell like dark sidebar/topbar */
  background: linear-gradient(
    180deg,
    rgba(20, 14, 44, 0.72) 0%,
    rgba(14, 10, 34, 0.66) 100%
  );
  position: relative;
  isolation: isolate;
}

[data-layout-mode="dark"] .dianaa-chat-panel {
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.5);
  background: linear-gradient(
    180deg,
    rgba(20, 14, 44, 0.72) 0%,
    rgba(14, 10, 34, 0.66) 100%
  );
  position: relative;
  isolation: isolate;
}

.dianaa-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.dianaa-chat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  color: #fff;
  background: linear-gradient(
    125deg,
    var(--shyft-bubble-header-1, rgba(135, 98, 232, 0.97)) 0%,
    var(--shyft-bubble-header-2, rgba(186, 165, 255, 0.93)) 46%,
    var(--shyft-bubble-header-3, rgba(158, 124, 240, 0.96)) 100%
  );
  border-bottom: 1px solid rgba(149, 109, 255, 0.22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

/* Dark glass material: blur + subtle inner edge */
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  html[data-bs-theme="dark"] .dianaa-chat-panel,
  [data-layout-mode="dark"] .dianaa-chat-panel {
    background: transparent !important;
    border-color: rgba(209, 188, 255, 0.18) !important;
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.12),
      0 22px 55px rgba(0, 0, 0, 0.5) !important;
  }

  html[data-bs-theme="dark"] .dianaa-chat-panel::before,
  [data-layout-mode="dark"] .dianaa-chat-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    z-index: 0;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backdrop-filter: blur(30px) saturate(190%) !important;
    backdrop-filter: blur(30px) saturate(190%) !important;
    background: linear-gradient(
      180deg,
      rgba(26, 18, 56, 0.66) 0%,
      rgba(16, 11, 40, 0.58) 100%
    ) !important;
    border: 1px solid rgba(220, 200, 255, 0.18);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  }

  html[data-bs-theme="dark"] .dianaa-chat-panel > *,
  [data-layout-mode="dark"] .dianaa-chat-panel > * {
    position: relative;
    z-index: 1;
  }

  html[data-bs-theme="dark"] .dianaa-chat-header {
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    background: linear-gradient(
      125deg,
      rgba(88, 52, 160, 0.54) 0%,
      rgba(149, 109, 255, 0.46) 46%,
      rgba(120, 82, 215, 0.52) 100%
    ) !important;
    border-bottom: 1px solid rgba(220, 200, 255, 0.2);
  }

  [data-layout-mode="dark"] .dianaa-chat-header {
    -webkit-backdrop-filter: blur(18px) saturate(170%);
    backdrop-filter: blur(18px) saturate(170%);
    background: linear-gradient(
      125deg,
      rgba(88, 52, 160, 0.54) 0%,
      rgba(149, 109, 255, 0.46) 46%,
      rgba(120, 82, 215, 0.52) 100%
    ) !important;
    border-bottom: 1px solid rgba(220, 200, 255, 0.2);
  }
}

/* Keep inner layers transparent in dark so glass ::before stays visible */
html[data-bs-theme="dark"] .dianaa-chat-messages,
html[data-bs-theme="dark"] .dianaa-chat-footer,
html[data-bs-theme="dark"] .dianaa-chat-footer textarea,
[data-layout-mode="dark"] .dianaa-chat-messages,
[data-layout-mode="dark"] .dianaa-chat-footer,
[data-layout-mode="dark"] .dianaa-chat-footer textarea {
  background: transparent !important;
  background-color: transparent !important;
}

.dianaa-chat-header h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.dianaa-chat-header p {
  margin: 2px 0 0;
  font-size: 0.75rem;
  opacity: 0.88;
  line-height: 1.35;
}

.dianaa-chat-open-studio {
  color: rgba(255, 255, 255, 0.92) !important;
  text-decoration: none;
  font-weight: 500;
}

.dianaa-chat-open-studio:hover {
  color: #fff !important;
  text-decoration: underline;
}

.dianaa-chat-header .dianaa-chat-close {
  margin-inline-start: auto;
  background: rgba(255, 255, 255, 0.12);
  border: none;
  color: #fff;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.dianaa-chat-header .dianaa-chat-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.dianaa-chat-messages {
  flex: 1;
  min-height: 200px;
  max-height: 340px;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.875rem;
}

.dianaa-msg {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.45;
}

.dianaa-msg--bot {
  align-self: flex-start;
  background: rgba(149, 109, 255, 0.11);
  color: var(--vz-body-color, #212529);
}

html[data-bs-theme="dark"] .dianaa-msg--bot {
  background: rgba(149, 109, 255, 0.16);
  color: #e2e8f0;
}

.dianaa-msg--user {
  align-self: flex-end;
  background: linear-gradient(
    135deg,
    var(--shyft-bubble-violet-deep, #8460dc),
    var(--shyft-bubble-violet, #956dff)
  );
  color: #fff;
}

/* Typing indicator (Uiverse / aaronross1), scoped + light/dark tokens */
.dianaa-chat-typing {
  --dianaa-typing-dot: #1e293b;
  --dianaa-typing-shadow: rgba(15, 23, 42, 0.22);

  display: none;
  align-items: center;
  padding: 6px 14px 10px;
}

html[data-bs-theme="dark"] .dianaa-chat-typing {
  --dianaa-typing-dot: #cbd5f5;
  --dianaa-typing-shadow: rgba(0, 0, 0, 0.45);
}

.dianaa-chat-typing.is-visible {
  display: flex;
}

.dianaa-typing-indicator {
  width: 60px;
  height: 30px;
  position: relative;
  z-index: 4;
}

.dianaa-typing-circle {
  width: 8px;
  height: 8px;
  position: absolute;
  border-radius: 50%;
  background-color: var(--dianaa-typing-dot);
  left: 15%;
  transform-origin: 50%;
  animation: dianaa-typing-circle 0.5s alternate infinite ease;
}

@keyframes dianaa-typing-circle {
  0% {
    top: 20px;
    height: 5px;
    border-radius: 50px 50px 25px 25px;
    transform: scaleX(1.7);
  }

  40% {
    height: 8px;
    border-radius: 50%;
    transform: scaleX(1);
  }

  100% {
    top: 0%;
  }
}

.dianaa-typing-circle:nth-child(2) {
  left: 45%;
  animation-delay: 0.2s;
}

.dianaa-typing-circle:nth-child(3) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

.dianaa-typing-shadow {
  width: 5px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--dianaa-typing-shadow);
  position: absolute;
  top: 30px;
  transform-origin: 50%;
  z-index: 3;
  left: 15%;
  filter: blur(1px);
  animation: dianaa-typing-shadow 0.5s alternate infinite ease;
}

@keyframes dianaa-typing-shadow {
  0% {
    transform: scaleX(1.5);
  }

  40% {
    transform: scaleX(1);
    opacity: 0.7;
  }

  100% {
    transform: scaleX(0.2);
    opacity: 0.4;
  }
}

.dianaa-typing-shadow:nth-child(4) {
  left: 45%;
  animation-delay: 0.2s;
}

.dianaa-typing-shadow:nth-child(5) {
  left: auto;
  right: 15%;
  animation-delay: 0.3s;
}

.dianaa-chat-footer {
  padding: 12px;
  border-top: 1px solid rgba(149, 109, 255, 0.14);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}

html[data-bs-theme="dark"] .dianaa-chat-footer {
  border-top-color: rgba(255, 255, 255, 0.08);
}

.dianaa-chat-footer textarea {
  flex: 1;
  resize: none;
  min-height: 44px;
  max-height: 120px;
  border-radius: 12px;
  border: 1px solid rgba(149, 109, 255, 0.22);
  padding: 10px 12px;
  font-size: 0.875rem;
  background: var(--vz-secondary-bg, #fff);
  color: var(--vz-body-color, #212529);
}

.dianaa-chat-footer textarea:focus {
  outline: none;
  border-color: rgba(149, 109, 255, 0.55);
  box-shadow: 0 0 0 3px rgba(149, 109, 255, 0.2);
}

html[data-bs-theme="dark"] .dianaa-chat-footer textarea:focus {
  border-color: rgba(149, 109, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(149, 109, 255, 0.22);
}

.dianaa-chat-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  background: linear-gradient(
    135deg,
    var(--shyft-bubble-violet-deep, #8460dc),
    var(--shyft-bubble-violet, #956dff)
  );
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, opacity 0.15s;
}

.dianaa-chat-send:hover:not(:disabled) {
  transform: scale(1.04);
}

.dianaa-chat-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (prefers-reduced-motion: reduce) {
  .dianaa-chat-panel,
  .dianaa-fab-nav .dianaa-fab-trigger,
  .dianaa-fab-nav .dianaa-fab-trigger::before,
  .dianaa-fab-nav .dianaa-fab-trigger::after,
  .dianaa-fab-nav .dianaa-fab-icon,
  .dianaa-fab-nav .dianaa-fab-title {
    transition-duration: 0.01ms !important;
  }

  .dianaa-typing-circle,
  .dianaa-typing-shadow {
    animation: none !important;
  }

  .dianaa-typing-circle {
    top: 8px;
    opacity: 0.75;
  }

  .dianaa-typing-shadow {
    opacity: 0.35;
  }
}
