/* Кнопка-портал в правом нижнем углу */
  .portal-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, #7b4bff, #3a1c8c);
    border: none;
    cursor: pointer;
    z-index: 9998;
    box-shadow: 0 0 25px rgba(123, 75, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
  }
  .portal-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 0 40px rgba(123, 75, 255, 0.9);
  }
  .portal-btn svg {
    width: 32px;
    height: 32px;
    fill: white;
  }

  /* Полноэкранный чат-портал */
  .chat-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 5, 15, 0.85);
    backdrop-filter: blur(20px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Inter', sans-serif;
  }
  .chat-overlay.active {
    display: flex;
  }

  .chat-container {
    width: 100%;
    max-width: 800px;
    height: 90vh;
    background: rgba(20, 20, 40, 0.7);
    border-radius: 32px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: portalAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  }
  @keyframes portalAppear {
    from { opacity: 0; transform: scale(0.9) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }

  .chat-header {
    padding: 24px 32px;
    background: rgba(123, 75, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .chat-header h3 {
    color: #f0e6ff;
    font-size: 22px;
    font-weight: 600;
    letter-spacing: -0.3px;
  }
  .chat-header button {
    background: none;
    border: none;
    color: #ffffffaa;
    font-size: 28px;
    cursor: pointer;
    transition: color 0.2s;
  }
  .chat-header button:hover {
    color: white;
  }

  .messages-area {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
  }
  .message {
    display: flex;
    flex-direction: column;
    max-width: 80%;
    animation: messageIn 0.3s ease;
  }
  @keyframes messageIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }
  .message.assistant {
    align-self: flex-start;
  }
  .message.user {
    align-self: flex-end;
  }
  .message .sender {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: #a99;
  }
  .message.assistant .sender {
    color: #c9b0ff;
  }
  .message.user .sender {
    color: #ffb0c0;
  }
  .message .bubble {
    padding: 16px 20px;
    border-radius: 24px;
    font-size: 16px;
    line-height: 1.5;
    color: white;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }
  .message.assistant .bubble {
    background: linear-gradient(135deg, rgba(123, 75, 255, 0.25), rgba(60, 30, 130, 0.25));
    border: 1px solid rgba(123, 75, 255, 0.3);
  }
  .message.user .bubble {
    background: linear-gradient(135deg, rgba(255, 80, 120, 0.2), rgba(180, 40, 70, 0.2));
    border: 1px solid rgba(255, 80, 120, 0.3);
  }

  .input-area {
    padding: 24px 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 12px;
  }
  .input-area input {
    flex: 1;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 40px;
    padding: 14px 24px;
    color: white;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
  }
  .input-area input:focus {
    border-color: #7b4bff;
  }
  .input-area button {
    background: #7b4bff;
    border: none;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    color: white;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
  }
  .input-area button:hover {
    background: #9b6bff;
  }

  @media (max-width: 600px) {
    .chat-container {
      height: 100vh;
      border-radius: 0;
    }
    .chat-header h3 {
      font-size: 18px;
    }
  }