 #vx-ai-widget,
  #vx-ai-widget * {
    box-sizing: border-box;
  }

  #vx-ai-widget {
    --vx-ai-edge: clamp(12px, 2.5vw, 24px);
    --vx-ai-left: max(var(--vx-ai-edge), env(safe-area-inset-left, 0px));
    --vx-ai-right: max(var(--vx-ai-edge), env(safe-area-inset-right, 0px));
    --vx-ai-bottom: max(var(--vx-ai-edge), env(safe-area-inset-bottom, 0px));
    --vx-ai-button-height: 52px;
    --vx-ai-viewport-height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 100000;
    pointer-events: none;
    font-family: Arial, Helvetica, sans-serif;
    color: #171717;
  }

  @supports (height: 100dvh) {
    #vx-ai-widget {
      --vx-ai-viewport-height: 100dvh;
    }
  }

  #vx-ai-toggle {
    position: absolute;
    right: var(--vx-ai-right);
    bottom: var(--vx-ai-bottom);
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: var(--vx-ai-button-height);
    max-width: calc(100vw - var(--vx-ai-left) - var(--vx-ai-right));
    padding: 0 clamp(14px, 2vw, 20px);
    border: 1px solid #4a1fe0;
    border-radius: 999px;
    background-color: #4a1fe0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 6px 24px #14083f40;
    pointer-events: auto;
    transition: transform 0.2s, background-color 0.2s;
  }

  #vx-ai-toggle:hover {
    background-color: #3815b5;
    transform: translateY(-2px);
  }

  #vx-ai-toggle:focus-visible,
  #vx-ai-close:focus-visible,
  #vx-ai-send:focus-visible {
    outline: 3px solid #8bafff;
    outline-offset: 3px;
  }

  #vx-ai-panel {
    position: absolute;
    right: var(--vx-ai-right);
    bottom: calc(var(--vx-ai-bottom) + var(--vx-ai-button-height) + 12px);
    z-index: 1;
    display: none;
    flex-direction: column;
    width: min(
      380px,
      calc(100vw - var(--vx-ai-left) - var(--vx-ai-right))
    );
    height: min(
      540px,
      calc(
        var(--vx-ai-viewport-height) - var(--vx-ai-bottom) -
          var(--vx-ai-button-height) - 24px
      )
    );
    min-height: 0;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 12px 45px #0002;
    pointer-events: auto;
  }

  #vx-ai-panel.vx-open {
    display: flex;
    animation: vx-ai-appear .18s ease-out;
  }

  @keyframes vx-ai-appear {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  .vx-ai-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 17px;
    background: #171717;
    color: #fff;
  }

  .vx-ai-title {
    font-size: 16px;
    font-weight: 700;
  }

  .vx-ai-subtitle {
    display: block;
    margin-top: 5px;
    color: #d4d4d4;
    font-size: 12px;
    font-weight: 400;
  }

  #vx-ai-close {
    display: grid;
    place-items: center;
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #fff;
    font-size: 27px;
    cursor: pointer;
  }

  #vx-ai-close:hover {
    background: #ffffff20;
  }

  #vx-ai-messages {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    background: #fafafa;
    scroll-behavior: smooth;
  }

  .vx-ai-message {
    max-width: 88%;
    padding: 11px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .vx-ai-bot {
    align-self: flex-start;
    border: 1px solid #e9e9e9;
    border-bottom-left-radius: 5px;
    background: #fff;
    color: #222;
  }

  .vx-ai-user {
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    background: #171717;
    color: #fff;
  }

  .vx-ai-typing {
    color: #666;
    font-style: italic;
  }

  .vx-ai-form {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #eee;
    background: #fff;
  }

  #vx-ai-input {
    flex: 1 1 auto;
    width: 0;
    min-width: 0;
    min-height: 44px;
    padding: 11px 12px;
    border: 1px solid #d9d9d9;
    border-radius: 11px;
    background: #fff;
    color: #171717;
    font: inherit;
    font-size: 14px;
  }

  #vx-ai-input:focus {
    border-color: #777;
    outline: 2px solid #17171720;
  }

  #vx-ai-send {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 15px;
    border: 0;
    border-radius: 11px;
    background: #171717;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  #vx-ai-send:disabled {
    opacity: .55;
    cursor: not-allowed;
  }

  .vx-ai-note {
    flex: 0 0 auto;
    padding: 0 12px 9px;
    background: #fff;
    color: #777;
    text-align: center;
    font-size: 10px;
  }

  @media (max-width: 600px) {
    #vx-ai-widget {
      --vx-ai-edge: 12px;
      --vx-ai-button-height: 48px;
    }

    #vx-ai-toggle {
      font-size: 13px;
    }

    #vx-ai-panel {
      border-radius: 16px;
    }
  }

  @media (max-width: 380px) {
    .vx-ai-header {
      padding: 13px;
    }

    #vx-ai-messages {
      padding: 12px;
    }

    .vx-ai-form {
      padding: 9px;
      gap: 6px;
    }

    #vx-ai-send {
      padding: 0 11px;
    }
  }

  @media (max-height: 450px) {
    #vx-ai-panel {
      height: min(
        540px,
        calc(
          var(--vx-ai-viewport-height) - var(--vx-ai-bottom) -
            var(--vx-ai-button-height) - 16px
        )
      );
    }
  }

  @media (prefers-reduced-motion: reduce) {
    #vx-ai-toggle,
    #vx-ai-panel,
    #vx-ai-messages {
      animation: none;
      transition: none;
      scroll-behavior: auto;
    }
  }