﻿.portestudio-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  font-family: "Inter", "Segoe UI", Arial, sans-serif;
}

.portestudio-widget *,
.portestudio-widget *::before,
.portestudio-widget *::after {
  box-sizing: border-box;
}

.portestudio-widget__launcher {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 228px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(234, 241, 255, 0.96));
  color: #122035;
  box-shadow: 0 22px 54px rgba(7, 17, 31, 0.24);
  backdrop-filter: blur(18px);
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.portestudio-widget__launcher:hover {
  transform: translateY(-3px);
  box-shadow: 0 28px 60px rgba(7, 17, 31, 0.28);
  border-color: rgba(91, 124, 255, 0.28);
}

.portestudio-widget__launcher-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, #3b6df6, #6d8eff);
  color: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.portestudio-widget__launcher-icon svg,
.portestudio-widget__close svg {
  width: 22px;
  height: 22px;
}

.portestudio-widget__launcher-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.portestudio-widget__launcher-copy strong {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.portestudio-widget__launcher-copy span {
  margin-top: 3px;
  font-size: 12px;
  color: #5f6e84;
}

.portestudio-widget__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 18px);
  width: min(396px, calc(100vw - 24px));
  height: min(690px, calc(100vh - 100px));
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(217, 227, 243, 0.9);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.985);
  box-shadow: 0 30px 90px rgba(7, 17, 31, 0.25);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(18px) scale(0.97);
  transform-origin: bottom right;
  transition: opacity 180ms ease, visibility 180ms ease, transform 180ms ease;
}

.portestudio-widget.is-open .portestudio-widget__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.portestudio-widget__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 18px;
  background:
    radial-gradient(circle at top right, rgba(91, 124, 255, 0.12), transparent 36%),
    linear-gradient(180deg, #fbfdff, #f3f7ff);
  border-bottom: 1px solid rgba(217, 227, 243, 0.92);
}

.portestudio-widget__title-wrap {
  display: flex;
  flex-direction: column;
}

.portestudio-widget__eyebrow {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #6b7ea1;
}

.portestudio-widget__header h2 {
  margin: 0;
  color: #102136;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.portestudio-widget__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  font-size: 13px;
  color: #617087;
}

.portestudio-widget__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #18b368;
  box-shadow: 0 0 0 4px rgba(24, 179, 104, 0.15);
}

.portestudio-widget__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
  color: #6b7b92;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, transform 160ms ease;
}

.portestudio-widget__close:hover {
  background: #edf4ff;
  color: #112033;
  transform: rotate(90deg);
}

.portestudio-widget__messages {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
  padding: 18px 18px 12px;
  overflow-y: auto;
  background:
    linear-gradient(180deg, #ffffff, #f8fbff 48%, #f7faff);
}

.portestudio-widget__message {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  width: fit-content;
  max-width: 88%;
}

.portestudio-widget__message--user {
  margin-left: auto;
  align-items: flex-end;
}

.portestudio-widget__bubble {
  min-width: 188px;
  max-width: 100%;
  padding: 15px 16px 14px;
  border-radius: 22px;
  background: linear-gradient(180deg, #ffffff, #f8fbff);
  border: 1px solid rgba(217, 227, 243, 0.92);
  box-shadow: 0 14px 34px rgba(14, 24, 42, 0.08);
  color: #15253c;
}

.portestudio-widget__message--assistant .portestudio-widget__bubble {
  border-top-left-radius: 12px;
  background: linear-gradient(180deg, #ffffff, #f6f9ff);
}

.portestudio-widget__message--user .portestudio-widget__bubble {
  background: linear-gradient(135deg, #3b6df6, #5b87ff);
  border-color: transparent;
  color: #ffffff;
  box-shadow: 0 18px 38px rgba(47, 109, 246, 0.25);
  border-top-right-radius: 12px;
}

.portestudio-widget__label {
  display: inline-flex;
  margin-bottom: 9px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: #7c8ca3;
}

.portestudio-widget__message--user .portestudio-widget__label {
  color: rgba(255, 255, 255, 0.82);
}

.portestudio-widget__text {
  font-size: 14px;
  line-height: 1.75;
  color: inherit;
  white-space: pre-line;
}

.portestudio-widget__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
  align-items: center;
}

.portestudio-widget__action {
  padding: 10px 14px;
  border: 1px solid rgba(205, 218, 239, 1);
  border-radius: 999px;
  background: #ffffff;
  color: #13243a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(12, 23, 42, 0.05);
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease, background 150ms ease, color 150ms ease;
}

.portestudio-widget__action:hover {
  transform: translateY(-1px);
  border-color: rgba(91, 124, 255, 0.52);
  background: #f6f9ff;
  box-shadow: 0 12px 24px rgba(12, 23, 42, 0.08);
  color: #284ec7;
}

.portestudio-widget__typing {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #617087;
}

.portestudio-widget__typing-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.portestudio-widget__typing-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #afbdd0;
  animation: portestudio-chat-bounce 1.2s infinite ease-in-out;
}

.portestudio-widget__typing-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.portestudio-widget__typing-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

.portestudio-widget__composer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid rgba(217, 227, 243, 0.92);
  background: rgba(251, 253, 255, 0.98);
}

.portestudio-widget__input {
  flex: 1;
  min-width: 0;
  height: 50px;
  padding: 0 16px;
  border: 1px solid rgba(214, 224, 239, 1);
  border-radius: 17px;
  background: #ffffff;
  color: #14243a;
  font: inherit;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.portestudio-widget__input:focus {
  border-color: rgba(91, 124, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(91, 124, 255, 0.12);
  background: #fcfdff;
}

.portestudio-widget__send {
  height: 50px;
  padding: 0 18px;
  border: 0;
  border-radius: 17px;
  background: linear-gradient(135deg, #3b6df6, #6a66f8);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  box-shadow: 0 14px 26px rgba(59, 109, 246, 0.25);
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, filter 150ms ease;
}

.portestudio-widget__send:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: 0 18px 30px rgba(59, 109, 246, 0.28);
}

@keyframes portestudio-chat-bounce {
  0%, 80%, 100% {
    transform: scale(0.8);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .portestudio-widget {
    right: 16px;
    bottom: 16px;
    left: 16px;
  }

  .portestudio-widget__launcher {
    width: 100%;
    min-width: 0;
    justify-content: center;
  }

  .portestudio-widget__panel {
    width: 100%;
    right: 0;
    height: min(72vh, 640px);
  }
}

