.dofin-dofi-assistant,
.dofin-dofi-assistant * {
  box-sizing: border-box;
}

.dofin-dofi-assistant {
  --dofi-navy: #06264d;
  --dofi-blue: #0d4f86;
  --dofi-gold: #dcb53f;
  --dofi-brown: #9a6b43;
  --dofi-cream: #f7f4ec;
  position: fixed;
  right: 24px;
  bottom: max(24px, env(safe-area-inset-bottom));
  z-index: 1200;
  width: 68px;
  height: 68px;
  color: var(--dofi-navy);
  font-family: inherit;
  font-size: 16px;
  line-height: 1.5;
  transition: bottom 180ms ease, opacity 180ms ease;
}

.dofin-dofi-assistant[data-consent-visible="true"] {
  bottom: calc(var(--dofin-consent-offset, 190px) + env(safe-area-inset-bottom));
}

.dofin-dofi-assistant [hidden] {
  display: none !important;
}

.dofin-dofi-assistant__bubble {
  position: absolute;
  right: calc(100% + 12px);
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  width: max-content;
  max-width: min(240px, calc(100vw - 116px));
  padding: 9px 14px;
  border: 1px solid rgba(6, 38, 77, 0.12);
  border-radius: 16px 16px 4px 16px;
  color: var(--dofi-navy);
  background: #fff;
  box-shadow: 0 10px 28px rgba(6, 38, 77, 0.16);
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.3;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease, visibility 160ms ease;
}

.dofin-dofi-assistant[data-open="true"] .dofin-dofi-assistant__bubble {
  visibility: hidden;
  opacity: 0;
  transform: translateY(5px);
}

.dofin-dofi-assistant__toggle {
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  margin: 0;
  padding: 4px;
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(145deg, var(--dofi-blue), var(--dofi-navy));
  box-shadow: 0 12px 30px rgba(6, 38, 77, 0.3);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.dofin-dofi-assistant__toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 34px rgba(6, 38, 77, 0.36);
}

.dofin-dofi-assistant__toggle:focus-visible,
.dofin-dofi-assistant__close:focus-visible,
.dofin-dofi-assistant__action:focus-visible,
.dofin-dofi-assistant__faq-button:focus-visible,
.dofin-dofi-assistant__answer-link:focus-visible {
  outline: 3px solid var(--dofi-gold);
  outline-offset: 3px;
}

.dofin-dofi-assistant__avatar {
  display: block;
  width: 56px;
  height: 56px;
  animation: dofin-dofi-float 3.6s ease-in-out infinite;
}

.dofin-dofi-assistant__avatar [data-dofi-eyes] {
  transform-origin: center;
  animation: dofin-dofi-blink 5.5s infinite;
}

.dofin-dofi-assistant__panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 14px);
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 132px);
  margin: 0;
  padding: 22px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(6, 38, 77, 0.12);
  border-radius: 22px;
  color: var(--dofi-navy);
  background: #fff;
  box-shadow: 0 22px 56px rgba(6, 38, 77, 0.24);
}

.dofin-dofi-assistant__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.dofin-dofi-assistant__title {
  margin: 0;
  padding: 0;
  color: var(--dofi-navy);
  font-family: inherit;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.dofin-dofi-assistant__close {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  margin: -7px -7px 0 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--dofi-navy);
  background: #edf3f8;
  font: inherit;
  font-size: 1.55rem;
  line-height: 1;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.dofin-dofi-assistant__close:hover {
  color: #fff;
  background: var(--dofi-blue);
}

.dofin-dofi-assistant__intro {
  margin: 12px 0 0;
  color: #36516c;
  font-size: 0.9375rem;
  line-height: 1.55;
}

.dofin-dofi-assistant__actions {
  display: grid;
  gap: 8px;
  margin-top: 17px;
}

.dofin-dofi-assistant__action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid #d7e2ec;
  border-radius: 12px;
  color: var(--dofi-navy);
  background: #f8fbfd;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
  transition: border-color 160ms ease, color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.dofin-dofi-assistant__action:last-child {
  border-color: var(--dofi-navy);
  color: #fff;
  background: var(--dofi-navy);
}

.dofin-dofi-assistant__action:hover {
  border-color: var(--dofi-blue);
  color: #fff;
  background: var(--dofi-blue);
  transform: translateX(2px);
}

.dofin-dofi-assistant__faq {
  display: grid;
  gap: 7px;
  margin-top: 20px;
  padding-top: 17px;
  border-top: 1px solid #e2eaf1;
}

.dofin-dofi-assistant__faq h3,
.dofin-dofi-assistant__answer h3 {
  margin: 0 0 3px;
  padding: 0;
  color: var(--dofi-navy);
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.35;
}

.dofin-dofi-assistant__faq-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 9px 11px;
  border: 0;
  border-radius: 10px;
  color: #24445f;
  background: #edf3f8;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 650;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  transition: color 160ms ease, background-color 160ms ease;
}

.dofin-dofi-assistant__faq-button:hover {
  color: #fff;
  background: var(--dofi-blue);
}

.dofin-dofi-assistant__answer {
  margin-top: 20px;
  padding: 17px;
  border: 1px solid #d7e2ec;
  border-radius: 14px;
  background: var(--dofi-cream);
}

.dofin-dofi-assistant__answer p {
  margin: 10px 0 0;
  color: #36516c;
  font-size: 0.875rem;
  line-height: 1.55;
}

.dofin-dofi-assistant__answer-link {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: 13px;
  color: var(--dofi-blue);
  font-size: 0.875rem;
  font-weight: 800;
  line-height: 1.3;
  text-underline-offset: 3px;
}

.dofin-dofi-assistant__answer-link:hover {
  color: var(--dofi-brown);
}

.dofin-dofi-assistant__answer .dofin-dofi-assistant__faq-button {
  justify-content: flex-start;
  margin-top: 10px;
  background: #fff;
}

.dofin-dofi-assistant__answer .dofin-dofi-assistant__faq-button:hover {
  background: var(--dofi-blue);
}

@keyframes dofin-dofi-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-2px);
  }
}

@keyframes dofin-dofi-blink {
  0%,
  45%,
  49%,
  100% {
    transform: scaleY(1);
  }
  47% {
    transform: scaleY(0.12);
  }
}

@media (max-width: 767px) {
  .dofin-dofi-assistant {
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: 62px;
    height: 62px;
  }

  .dofin-dofi-assistant[data-consent-visible="true"] {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
  }

  .dofin-dofi-assistant__toggle {
    width: 62px;
    height: 62px;
  }

  .dofin-dofi-assistant__avatar {
    width: 51px;
    height: 51px;
  }

  .dofin-dofi-assistant__panel {
    max-height: calc(100dvh - 112px);
    padding: 18px;
    border-radius: 18px;
  }

  .dofin-dofi-assistant__bubble {
    bottom: 9px;
    font-size: 0.8125rem;
  }
}

@media (max-width: 480px) {
  .dofin-dofi-assistant__bubble {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dofin-dofi-assistant,
  .dofin-dofi-assistant__bubble,
  .dofin-dofi-assistant__toggle,
  .dofin-dofi-assistant__action,
  .dofin-dofi-assistant__avatar,
  .dofin-dofi-assistant__avatar [data-dofi-eyes] {
    animation: none;
    scroll-behavior: auto;
    transition: none;
  }
}
