﻿/* MindGate AI chat component */
    .chat-placement {
      width: 100%;
      max-width: 680px;
      margin: 10px 0px 10px 0px;
    }

    .mg-ai-chat {
      --mg-ai-chat-active-line: rgba(13, 149, 22, 0.86);
      --mg-ai-chat-user-rest-line: rgba(64, 128, 64, 0.34);
      --mg-ai-chat-assistant-rest-line: rgba(64, 128, 64, 0.26);
      --mg-ai-chat-soft-line: rgba(64, 128, 64, 0.22);
      --mg-ai-chat-input-bg: rgba(255, 255, 255, 0.96);
      --mg-ai-chat-input-bg-active: #ffffff;
      --mg-ai-chat-input-text: #a64f00;
      --mg-ai-chat-input-muted: #c78a4d;
      --mg-ai-chat-user-text: #a64f00;
      --mg-ai-chat-answer-bg: #dff3df;
      --mg-ai-chat-answer-text: #25852a;
      --mg-ai-chat-send-text: #ffffff;
      --mg-ai-chat-send-text-hover: #ffffff;
      --mg-ai-chat-send-bg: linear-gradient(180deg, #0d9516 0%, #408040 100%);
      --mg-ai-chat-send-bg-hover: linear-gradient(180deg, #16ad20 0%, #0d9516 100%);
      --mg-ai-chat-send-border: rgba(13, 149, 22, 0.42);
      --mg-ai-chat-send-border-hover: rgba(13, 149, 22, 0.72);
      x--mg-ai-chat-shadow: 0 12px 32px rgba(64, 128, 64, 0.16), 0 0 24px rgba(255, 255, 255, 0.78);
      position: relative;
      max-height: min(54vh, 560px);
      margin: 0 auto !important;
      width: 100% !important;
      margin-top: 20px;
      display: grid;
      gap: 8px;
      overflow-x: hidden;
      overflow-y: hidden;
      overscroll-behavior: contain;
      scroll-padding: 18px 0;
      text-align: left;
      font-family: Roboto, Tahoma, sans-serif;
      font-size: 16px;
      letter-spacing: 0;
      padding-right: 4px;
      scrollbar-width: none;
    }

    .mg-ai-chat.mg-ai-chat-is-starting {
      opacity: 0;
      transform: translateY(14px);
      pointer-events: none;
      visibility: hidden;
    }

    .mg-ai-chat.mg-ai-chat-is-ready {
      opacity: 1;
      transform: translateY(0);
      visibility: visible;
      transition: opacity 900ms ease, transform 900ms ease, visibility 0ms linear 0ms;
    }

    .mg-ai-chat.mg-ai-chat-has-scroll {
      overflow-y: auto;
      scrollbar-width: thin;
      scrollbar-color: rgba(13, 149, 22, 0.42) rgba(204, 235, 204, 0.48);
    }

    .mg-ai-chat::-webkit-scrollbar {
      width: 0;
      height: 0;
      display: none;
    }

    .mg-ai-chat.mg-ai-chat-has-scroll::-webkit-scrollbar {
      width: 6px;
      display: block;
    }

    .mg-ai-chat::-webkit-scrollbar-track {
      background: rgba(204, 235, 204, 0.48);
    }

    .mg-ai-chat::-webkit-scrollbar-thumb {
      background: rgba(13, 149, 22, 0.42);
      border-radius: 6px;
    }

    .mg-ai-chat__composer,
    .mg-ai-chat__message,
    .mg-ai-chat__thinking {
      opacity: 0;
      transform: translateY(12px);
      animation: mg-ai-chat-reveal 420ms ease forwards;
    }

    .mg-ai-chat__form,
    .mg-ai-chat__message {
      width: 100%;
      border-radius: 8px;
      box-shadow: var(--mg-ai-chat-shadow);
    }

    .mg-ai-chat__form {
      display: grid;
      grid-template-columns: 1fr auto;
      gap: 8px;
      align-items: center;
      min-height: 58px;
      padding: 5px 7px 5px 5px;
      border: 1px solid var(--mg-ai-chat-active-line);
      background: var(--mg-ai-chat-input-bg);
      transition: border-color 720ms ease, box-shadow 720ms ease, background 360ms ease, opacity 360ms ease;
      box-shadow: var(--mg-ai-chat-shadow), 0 0 0 1px rgba(255, 255, 255, 0.72);
    }

    .mg-ai-chat__form.mg-ai-chat-is-crystallizing {
      border-color: var(--mg-ai-chat-active-line);
      background: var(--mg-ai-chat-input-bg-active);
      box-shadow: var(--mg-ai-chat-shadow), 0 0 0 1px rgba(13, 149, 22, 0.12);
    }

    .mg-ai-chat__input {
      min-width: 0;
      width: 100%;
      display: block;
      height: 48px;
      min-height: 48px;
      max-height: 1400px;
      resize: none;
      overflow: hidden;
      border: 0;
      border-radius: 6px;
      padding: 12px 13px;
      color: var(--mg-ai-chat-input-text);
      background: transparent;
      font: inherit;
      font-size: 16px;
      line-height: 1.42;
      letter-spacing: 0;
      outline: none;
    }

    .mg-ai-chat__input::placeholder {
      color: var(--mg-ai-chat-input-muted);
      font: inherit;
      opacity: 1;
    }

    .mg-ai-chat__input:disabled {
      opacity: 1;
      -webkit-text-fill-color: var(--mg-ai-chat-input-text);
    }

    .mg-ai-chat__send {
      width: 42px;
      min-width: 42px;
      height: 42px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      border: 1px solid var(--mg-ai-chat-send-border);
      border-radius: 8px;
      padding: 0;
      color: var(--mg-ai-chat-send-text);
      background: var(--mg-ai-chat-send-bg);
      cursor: pointer;
      line-height: 1;
      transform-origin: center;
      transition: opacity 460ms ease, visibility 460ms ease, transform 460ms ease, background 220ms ease, border-color 220ms ease, color 220ms ease;
    }

    .mg-ai-chat__send svg {
      width: 27px;
      height: 27px;
      display: block;
      transform: translateX(1px);
      fill: currentColor;
    }

    .mg-ai-chat__send:hover,
    .mg-ai-chat__send:focus-visible {
      color: var(--mg-ai-chat-send-text-hover);
      background: var(--mg-ai-chat-send-bg-hover);
      border-color: var(--mg-ai-chat-send-border-hover);
      outline: none;
    }

    .mg-ai-chat__send.mg-ai-chat-is-fading {
      opacity: 0;
      visibility: hidden;
      transform: scale(0.18);
      pointer-events: none;
    }

    .mg-ai-chat__message {
      padding: 17px 19px;
      border: 1px solid var(--mg-ai-chat-soft-line);
      font: inherit;
      font-size: 16px;
      line-height: 1.58;
      letter-spacing: 0;
      overflow-wrap: anywhere;
      white-space: pre-wrap;
      transition: height 860ms ease, opacity 680ms ease, color 680ms ease, background 680ms ease, border-color 680ms ease, transform 680ms ease;
    }

    .mg-ai-chat__message.mg-ai-chat-is-stable {
      opacity: 1;
      transform: none;
      animation: none;
    }

    .mg-ai-chat__message--user.mg-ai-chat-is-crystallized {
      opacity: 1;
      transform: none;
      animation: none;
      transition: height 860ms ease, color 680ms ease, background 680ms ease, border-color 680ms ease, box-shadow 680ms ease;
    }

    .mg-ai-chat__message--user {
      padding: 16px 18px;
      color: var(--mg-ai-chat-user-text);
      background: var(--mg-ai-chat-input-bg);
      border-color: rgba(13, 149, 22, 0.4);
      line-height: 1.42;
    }

    .mg-ai-chat__message--user.mg-ai-chat-is-resting {
      border-color: var(--mg-ai-chat-user-rest-line);
      box-shadow: var(--mg-ai-chat-shadow);
    }

    .mg-ai-chat__message--assistant {
      color: var(--mg-ai-chat-answer-text);
      background: var(--mg-ai-chat-answer-bg);
      border-color: var(--mg-ai-chat-assistant-rest-line);
      font-weight: 700;
    }

    .mg-ai-chat__message--assistant.mg-ai-chat-is-active,
    .mg-ai-chat__thinking.mg-ai-chat-is-active {
      border-color: var(--mg-ai-chat-active-line);
      box-shadow: var(--mg-ai-chat-shadow), 0 0 0 1px rgba(13, 149, 22, 0.1);
    }

    .mg-ai-chat__message--assistant.mg-ai-chat-is-resting {
      border-color: var(--mg-ai-chat-assistant-rest-line);
      box-shadow: var(--mg-ai-chat-shadow);
    }

    .mg-ai-chat__thinking {
      position: relative;
      display: flex;
      align-items: center;
      min-height: 58px;
      padding: 0 18px;
      overflow: hidden;
      border: 1px solid var(--mg-ai-chat-active-line);
      border-radius: 8px;
      background:
        radial-gradient(circle at 18% 50%, rgba(204, 235, 204, 0.72), transparent 17rem),
        linear-gradient(120deg, transparent 20%, rgba(13, 149, 22, 0.08), transparent 72%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(238, 248, 238, 0.98));
      background-size: 100% 100%, 180% 100%, 100% 100%;
      background-position: 0 0, 120% 0, 0 0;
      box-shadow: var(--mg-ai-chat-shadow);
      animation: mg-ai-chat-reveal 420ms ease forwards, mg-ai-chat-slow-scan 5200ms ease-in-out infinite;
      transition: height 860ms ease, opacity 680ms ease, background 680ms ease, border-color 760ms ease, box-shadow 760ms ease;
    }

    .mg-ai-chat__thinking::after {
      content: "";
      position: absolute;
      inset: 0;
      background:
        radial-gradient(circle at 24% 45%, rgba(255, 255, 255, 0.62), transparent 9rem),
        radial-gradient(circle at 76% 55%, rgba(13, 149, 22, 0.08), transparent 11rem);
      opacity: 0.65;
      animation: mg-ai-chat-breathe 4600ms ease-in-out infinite alternate;
      pointer-events: none;
    }

    .mg-ai-chat__thinking-label {
      position: relative;
      z-index: 1;
      color: rgba(64, 128, 64, 0.84);
      font: inherit;
      font-size: 16px;
      line-height: 1.4;
      letter-spacing: 0;
      animation: mg-ai-chat-text-breathe 4600ms ease-in-out infinite alternate;
    }

    .mg-ai-chat__message--assistant.mg-ai-chat-is-answering {
      opacity: 1;
      animation: none;
    }

    .mg-ai-chat__answer-content {
      opacity: 0;
      transform: translateY(8px);
      clip-path: inset(0 0 100% 0);
      transition: opacity 980ms ease, transform 980ms ease, clip-path 1100ms ease;
    }

    .mg-ai-chat__answer-content a {
      color: var(--mg-ai-chat-answer-text);
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    .mg-ai-chat__answer-content strong {
      font-weight: 700;
    }

    .mg-ai-chat__answer-content em {
      font-style: italic;
    }

    .mg-ai-chat__answer-content u {
      text-decoration-thickness: 1px;
      text-underline-offset: 3px;
    }

    .mg-ai-chat__message--assistant.mg-ai-chat-is-answering.mg-ai-chat-is-visible .mg-ai-chat__answer-content {
      opacity: 1;
      transform: translateY(0);
      clip-path: inset(0);
    }

    .mg-ai-chat__answer-content.mg-ai-chat-is-shown {
      opacity: 1;
      transform: translateY(0);
      clip-path: inset(0);
    }
    /* End Splitall AI chat component */
@keyframes mg-ai-chat-reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes mg-ai-chat-slow-scan {
  0% {
    background-position: 0 0, 120% 0, 0 0;
  }

  50% {
    background-position: 0 0, 42% 0, 0 0;
  }

  100% {
    background-position: 0 0, -35% 0, 0 0;
  }
}

@keyframes mg-ai-chat-breathe {
  from {
    transform: scale(1);
    opacity: 0.42;
  }

  to {
    transform: scale(1.04);
    opacity: 0.82;
  }
}

@keyframes mg-ai-chat-text-breathe {
  from {
    color: rgba(64, 128, 64, 0.58);
    text-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }

  to {
    color: rgba(13, 149, 22, 0.92);
    text-shadow: 0 0 16px rgba(255, 255, 255, 0.88);
  }
}

@media (max-width: 720px) {
  .mg-ai-chat {
    margin-top: 12px;
    max-height: min(58vh, 560px);
    gap: 6px;
    font-size: 14px;
  }

  .mg-ai-chat__form {
    min-height: 54px;
    gap: 6px;
    padding: 4px 6px 4px 4px;
  }

  .mg-ai-chat__input {
    height: 46px;
    min-height: 46px;
    padding: 12px 10px;
    font-size: 14px;
    line-height: 1.35;
  }

  .mg-ai-chat__message {
    padding: 14px 15px;
    font-size: 14px;
    line-height: 1.5;
  }

  .mg-ai-chat__message--user {
    padding: 13px 14px;
    line-height: 1.35;
  }

  .mg-ai-chat__thinking {
    min-height: 54px;
    padding: 0 15px;
  }

  .mg-ai-chat__thinking-label {
    font-size: 14px;
    line-height: 1.35;
  }

  .mg-ai-chat__send.mg-ai-chat-is-fading {
    transform: scale(0.18);
  }
}

@media (max-width: 390px) {
  .mg-ai-chat {
    font-size: 13px;
  }

  .mg-ai-chat__form {
    min-height: 48px;
    gap: 5px;
    padding: 3px 5px 3px 3px;
  }

  .mg-ai-chat__input {
    height: 40px;
    min-height: 40px;
    font-size: 13px;
    padding: 9px 8px;
    line-height: 1.32;
  }

  .mg-ai-chat__send {
    width: 37px;
    min-width: 37px;
    height: 37px;
  }

  .mg-ai-chat__send svg {
    width: 24px;
    height: 24px;
  }

  .mg-ai-chat__message,
  .mg-ai-chat__thinking-label {
    font-size: 13px;
  }
}
