:root {
  --fc-viewport-height: 100dvh;
  --fc-viewport-offset-bottom: 0px;
}

.fc-consultant {
  --fc-brand-green: #70ffc5;
  --fc-brand-green-dark: #50b98f;
  --fc-brand-purple: #635fff;
  --fc-brand-purple-dark: #423fa7;
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 2147483000;
  font-family: Arial, Helvetica, sans-serif;
  -webkit-text-size-adjust: 100%;
  color: #111;
}

.fc-consultant * {
  box-sizing: border-box;
}

html,
body {
  max-width: 100%;
  overflow-x: clip;
}

@supports not (overflow-x: clip) {
  html,
  body {
    overflow-x: hidden;
  }
}

.hero {
  max-width: 100%;
  min-width: 0;
  height: auto;
  overflow-x: clip;
}

#typed-text.typingh1 {
  max-width: calc(100vw - 32px);
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
}

.writer {
  flex: 0 0 auto;
}

.fc-chat-button {
  position: relative;
  width: 70px;
  height: 70px;
  border: 0;
  border-radius: 50%;
  background:#000;
  color: #fff;
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.32),
    0 0 0 2px rgba(112, 255, 197, 0.56),
    0 0 30px rgba(112, 255, 197, 0.48);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  overflow: visible;
  animation: fc-robot-float 3.2s ease-in-out infinite;
}

.fc-attention-ring {
  position: absolute;
  inset: -9px;
  border: 1px solid rgba(112, 255, 197, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 24px rgba(112, 255, 197, 0.3);
  animation: fc-robot-ping 2.4s ease-out infinite;
}

.fc-robot-icon {
  position: relative;
  width: 46px;
  height: 46px;
  display: block;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.28));
}

.fc-robot-antenna {
  position: absolute;
  left: 50%;
  top: 0;
  width: 2px;
  height: 10px;
  background: #fff;
  transform: translateX(-50%);
}

.fc-robot-antenna::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fc-brand-green);
  transform: translateX(-50%);
  box-shadow: 0 0 10px rgba(112, 255, 197, 0.78);
  animation: fc-robot-blink 1.8s steps(2, start) infinite;
}

.fc-robot-head {
  position: absolute;
  left: 50%;
  top: 11px;
  width: 36px;
  height: 26px;
  border-radius: 10px;
  background: #fff;
  border: 2px solid #313131;
  transform: translateX(-50%);
}

.fc-robot-head::before,
.fc-robot-head::after {
  content: "";
  position: absolute;
  top: 3px;
  width: 6px;
  height: 12px;
  border-radius: 4px;
  background: #fff;
  border: 2px solid #313131;
}

.fc-robot-head::before {
  left: -8px;
}

.fc-robot-head::after {
  right: -8px;
}

.fc-robot-eye {
  position: absolute;
  top: 8px;
  width: 4px;
  height: 6px;
  border-radius: 50%;
  background: var(--fc-brand-purple);
  animation: fc-robot-eye 2.7s ease-in-out infinite;
}

.fc-robot-eye:first-child {
  left: 6px;
}

.fc-robot-eye:nth-child(2) {
  right: 6px;
}

.fc-robot-mouth {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 8px;
  height: 4px;
  border-bottom: 2px solid rgba(17, 17, 17, 0.78);
  border-radius: 0 0 4px 4px;
  background: transparent;
  transform: translateX(-50%);
}

.fc-robot-body {
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 20px;
  height: 7px;
  border-radius: 5px 5px 8px 8px;
  background: #fff;
  border: 2px solid rgba(17, 17, 17, 0.9);
  transform: translateX(-50%);
}

@keyframes fc-robot-float {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }

  50% {
    transform: translateY(-5px) rotate(-2deg);
  }
}

@keyframes fc-robot-ping {
  0% {
    opacity: 0.65;
    transform: scale(0.86);
  }

  80%,
  100% {
    opacity: 0;
    transform: scale(1.25);
  }
}

@keyframes fc-robot-blink {
  0%,
  75% {
    opacity: 1;
  }

  76%,
  100% {
    opacity: 0.35;
  }
}

@keyframes fc-robot-eye {
  0%,
  90%,
  100% {
    transform: scaleY(1);
  }

  94% {
    transform: scaleY(0.25);
  }
}

.fc-chat-button:focus-visible,
.fc-icon-button:focus-visible,
.fc-send-button:focus-visible,
.fc-chat-input:focus-visible {
  outline: 2px solid var(--fc-brand-purple);
  outline-offset: 3px;
}

.fc-chat-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 32px));
  height: min(620px, calc(var(--fc-viewport-height, 100vh) - 120px));
  min-height: 420px;
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.12);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  display: none;
}

.fc-consultant.is-open .fc-chat-panel {
  display: flex;
  flex-direction: column;
}

.fc-consultant.is-open .fc-chat-button {
  display: none;
}

.fc-chat-header {
  min-height: 58px;
  padding: 12px 14px;
  background: #111;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fc-chat-identity {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.fc-chat-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(145deg, var(--fc-brand-purple), #111);
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 18px rgba(112, 255, 197, 0.36);
}

.fc-chat-avatar img {
  width: 18px;
  height: 18px;
  display: block;
  object-fit: contain;
}

.fc-chat-title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fc-chat-title strong {
  font-size: 15px;
  line-height: 1.2;
  font-weight: 700;
}

.fc-chat-title span {
  font-size: 12px;
  line-height: 1.25;
  color: rgba(255, 255, 255, 0.72);
}

.fc-chat-actions {
  display: flex;
  gap: 6px;
  flex: 0 0 auto;
}

.fc-icon-button {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.fc-chat-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 16px;
  background: #f7f7f7;
}

.fc-message {
  max-width: 88%;
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.fc-message.assistant {
  background: #fff;
  border: 1px solid rgba(17, 17, 17, 0.08);
}

.fc-message.user {
  margin-left: auto;
  background: #111;
  color: #fff;
}

.fc-message.system {
  max-width: 100%;
  background: transparent;
  color: #777;
  font-size: 12px;
  text-align: center;
}

.fc-chat-form {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(17, 17, 17, 0.1);
  background: #fff;
}

.fc-chat-input {
  flex: 1 1 auto;
  min-height: 42px;
  max-height: 116px;
  resize: none;
  border: 1px solid rgba(17, 17, 17, 0.16);
  border-radius: 8px;
  padding: 10px 11px;
  font: inherit;
  font-size: 14px;
  line-height: 1.35;
}

.fc-send-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: var(--fc-brand-purple);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  flex: 0 0 auto;
}

.fc-send-button:disabled,
.fc-chat-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 520px) {
  body.fc-chat-lock {
    overflow: hidden;
    touch-action: none;
    overscroll-behavior: none;
  }

  .fc-consultant {
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .fc-consultant.is-open {
    inset: 0;
    width: 100%;
    height: var(--fc-viewport-height, 100dvh);
    pointer-events: none;
  }

  .fc-consultant.is-open::before {
    content: "";
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.16);
    pointer-events: auto;
  }

  .fc-chat-button {
    width: 62px;
    height: 62px;
  }

  .fc-attention-ring {
    inset: -7px;
  }

  .fc-robot-icon {
    transform: scale(0.9);
  }

  .fc-chat-panel {
    position: fixed;
    left: 14px;
    right: 14px;
    top: auto;
    bottom: calc(var(--fc-viewport-offset-bottom, 0px) + 14px + env(safe-area-inset-bottom));
    width: auto;
    height: auto;
    height: min(520px, calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    height: min(520px, calc(var(--fc-viewport-height, 100dvh) - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: calc(100vh - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(var(--fc-viewport-height, 100dvh) - 28px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    z-index: 1;
    pointer-events: auto;
  }

  .fc-chat-header {
    min-height: 54px;
    padding: 10px 10px;
    gap: 8px;
  }

  .fc-chat-identity {
    gap: 8px;
  }

  .fc-chat-avatar {
    width: 30px;
    height: 30px;
  }

  .fc-chat-avatar img {
    width: 16px;
    height: 16px;
  }

  .fc-chat-title strong {
    font-size: 14px;
  }

  .fc-chat-title span {
    font-size: 11px;
  }

  .fc-icon-button {
    width: 30px;
    height: 30px;
  }

  .fc-chat-messages {
    padding: 10px;
    overscroll-behavior: contain;
  }

  .fc-message {
    max-width: 94%;
    padding: 9px 10px;
    font-size: 13px;
    line-height: 1.4;
  }

  .fc-chat-form {
    gap: 7px;
    padding: 9px;
  }

  .fc-chat-input {
    min-height: 42px;
    max-height: 92px;
    padding: 9px 10px;
    font-size: 16px;
  }

  .fc-send-button {
    width: 38px;
    height: 38px;
  }
}

@media (max-width: 360px), (max-height: 620px) {
  .fc-chat-panel {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: calc(var(--fc-viewport-offset-bottom, 0px) + 10px + env(safe-area-inset-bottom));
    height: min(480px, calc(var(--fc-viewport-height, 100dvh) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom)));
    max-height: calc(var(--fc-viewport-height, 100dvh) - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  }

  .fc-chat-header {
    min-height: 48px;
    padding: 8px;
  }

  .fc-chat-avatar {
    width: 28px;
    height: 28px;
  }

  .fc-chat-actions {
    gap: 4px;
  }

  .fc-icon-button {
    width: 28px;
    height: 28px;
  }

  .fc-chat-messages {
    padding: 8px;
  }

  .fc-message {
    margin-bottom: 8px;
  }
}
