:root {
  --nova-fab-size: 60px;
}

#nova-ai-fab-root {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2147482000;
}

.novaai-fab-wrapper {
  position: fixed;
  pointer-events: none;
  width: 360px;
  max-width: 90vw;
}

.novaai-fab-button {
  pointer-events: auto;
  width: var(--nova-fab-size);
  height: var(--nova-fab-size);
  border-radius: 50%;
  border: none;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.25), transparent 70%), linear-gradient(135deg, #8e6bff, #5d3bff);
  box-shadow: 0 18px 38px rgba(42, 30, 90, 0.55);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.65rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease;
  position: relative;
}

.novaai-fab-button::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.14);
  opacity: 0;
  transition: opacity 160ms ease;
}

.novaai-fab-button:hover,
.novaai-fab-button:focus-visible {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 24px 48px rgba(42, 30, 90, 0.6);
  outline: none;
}

.novaai-fab-button:hover::after,
.novaai-fab-button:focus-visible::after {
  opacity: 1;
}

.novaai-fab-button.dragging {
  cursor: grabbing;
  opacity: 0.95;
}

.novaai-widget-panel {
  pointer-events: auto;
  position: absolute;
  bottom: calc(var(--nova-fab-size) + 16px);
  right: 0;
  width: min(340px, 90vw);
  background: rgba(15, 19, 27, 0.94);
  backdrop-filter: blur(16px);
  border-radius: 24px;
  border: 1px solid rgba(124, 92, 255, 0.25);
  box-shadow: 0 36px 70px rgba(8, 10, 24, 0.65);
  color: #e6e9f5;
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.novaai-widget-panel.align-right {
  left: calc(var(--nova-fab-size) + 16px);
  right: auto;
}

.novaai-widget-panel.open {
  display: flex;
  animation: panelIn 200ms ease;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.novaai-widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, rgba(124, 92, 255, 0.2), transparent);
  padding: 1.1rem 1.4rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.novaai-widget-title {
  font-size: 1.05rem;
  font-weight: 700;
}

.novaai-widget-close {
  appearance: none;
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.novaai-mini-transcript {
  padding: 1rem 1.3rem;
  display: grid;
  gap: 0.8rem;
  max-height: 280px;
  overflow-y: auto;
}

.novaai-mini-bubble {
  padding: 0.6rem 0.85rem;
  border-radius: 12px;
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: 0 12px 26px rgba(10, 12, 30, 0.45);
}

.novaai-mini-bubble.user {
  justify-self: end;
  background: rgba(124, 92, 255, 0.45);
}

.novaai-mini-bubble.assistant {
  justify-self: start;
  background: rgba(255, 255, 255, 0.08);
}

.novaai-mini-bubble.error {
  color: #ffd9e0;
  background: rgba(255, 107, 129, 0.35);
}

.novaai-mini-bubble.streaming::after {
  content: '▌';
  display: inline-block;
  margin-left: 0.2rem;
  animation: blink 900ms steps(2, start) infinite;
}

@keyframes blink {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

.novaai-mini-input {
  padding: 0 1.3rem 1.3rem;
  display: grid;
  gap: 0.75rem;
}

.novaai-mini-input select,
.novaai-mini-input textarea {
  background: rgba(21, 26, 38, 0.9);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: inherit;
  padding: 0.65rem 0.9rem;
  font-size: 0.92rem;
  resize: none;
}

.novaai-mini-input textarea {
  min-height: 84px;
}

.novaai-mini-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
}

.novaai-mini-send {
  flex: 1;
  appearance: none;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #8b68ff, #5f3cff);
  padding: 0.65rem 1rem;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(91, 63, 255, 0.45);
}

.novaai-mini-expand {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(230, 233, 245, 0.8);
  text-decoration: underline;
  cursor: pointer;
  font-size: 0.85rem;
}

.novaai-mini-loading::after {
  content: '▌';
  display: inline-block;
  margin-left: 0.2rem;
  animation: blink 900ms steps(2, start) infinite;
}

.novaai-mini-panel-open {
  overflow: hidden;
}

@media (max-width: 600px) {
  .novaai-widget-panel {
    width: min(90vw, 320px);
  }

  .novaai-mini-transcript {
    max-height: 220px;
  }
}
