@font-face {
  font-family: "B Esfehan";
  src: url("./assets/fonts/B-Esfehan-Bold.ttf?v=20260822.25") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-08FF, U+200C-200F, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FEFC;
}
@font-face {
  font-family: "B Esfehan";
  src: url("./assets/fonts/B-Esfehan-Bold.ttf?v=20260822.25") format("truetype");
  font-style: normal;
  font-weight: 500;
  font-display: swap;
}
@font-face {
  font-family: "B Esfehan";
  src: url("./assets/fonts/B-Esfehan-Bold.ttf?v=20260822.25") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "B Esfehan";
  src: url("./assets/fonts/B-Esfehan-Bold.ttf?v=20260822.25") format("truetype");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
}

:host {
  position: fixed;
  z-index: 1100;
  inset: 0;
  display: block;
  pointer-events: none;
  font-family: "B Esfehan", Tahoma, sans-serif;
}

:host,
:host * {
  font-family: "B Esfehan", Tahoma, sans-serif !important;
  font-synthesis: none;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mg-assistant {
  --mg-chat-acid: #c6ff3f;
  --mg-chat-ink: #080a08;
  --mg-chat-panel: rgba(14, 17, 13, .96);
  position: fixed;
  z-index: 1100;
  right: max(22px, env(safe-area-inset-right));
  bottom: max(22px, env(safe-area-inset-bottom));
  direction: rtl;
  font-family: "B Esfehan", Tahoma, sans-serif;
  pointer-events: none;
}

.mg-assistant__launcher,
.mg-assistant__panel {
  pointer-events: auto;
}

.mg-assistant__launcher {
  position: relative;
  width: 74px;
  height: 74px;
  padding: 0;
  display: grid;
  place-items: center;
  overflow: visible;
  color: var(--mg-chat-ink);
  border: 1px solid rgba(198, 255, 63, .7);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, .18), transparent 28%),
    #11160e;
  box-shadow:
    0 18px 48px rgba(0, 0, 0, .42),
    0 0 0 5px rgba(198, 255, 63, .08),
    inset 0 0 22px rgba(198, 255, 63, .08);
  isolation: isolate;
  transition: transform .45s cubic-bezier(.16, 1, .3, 1), box-shadow .35s, opacity .3s;
}

.mg-assistant__launcher::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 7px;
  border-radius: inherit;
  background: linear-gradient(145deg, #d9ff77, #9edb1e);
}

.mg-assistant__launcher:hover,
.mg-assistant__launcher:focus-visible,
.mg-assistant.is-reacting .mg-assistant__launcher {
  transform: translateY(-4px) scale(1.04);
  box-shadow:
    0 22px 58px rgba(0, 0, 0, .5),
    0 0 0 7px rgba(198, 255, 63, .1),
    0 0 32px rgba(198, 255, 63, .22);
}

.mg-assistant.is-open .mg-assistant__launcher {
  pointer-events: none;
  opacity: 0;
  transform: scale(.55) translateY(-24px);
}

.mg-assistant__orbit {
  position: absolute;
  inset: -7px;
  border: 1px solid transparent;
  border-top-color: var(--mg-chat-acid);
  border-right-color: rgba(198, 255, 63, .35);
  border-radius: 50%;
  pointer-events: none;
  will-change: transform;
  animation: mg-orbit 8s linear infinite;
}

.mg-assistant__orbit--two {
  inset: -12px;
  border-top-color: transparent;
  border-right-color: transparent;
  border-bottom-color: rgba(245, 246, 241, .56);
  border-left-color: rgba(198, 255, 63, .62);
  animation: mg-orbit-reverse 11s linear infinite;
}

.mg-assistant__launcher:hover .mg-assistant__orbit--one,
.mg-assistant__launcher:focus-visible .mg-assistant__orbit--one,
.mg-assistant.is-reacting .mg-assistant__orbit--one {
  animation-duration: .75s;
}

.mg-assistant__launcher:hover .mg-assistant__orbit--two,
.mg-assistant__launcher:focus-visible .mg-assistant__orbit--two,
.mg-assistant.is-reacting .mg-assistant__orbit--two {
  animation-duration: 1.05s;
}

.mg-assistant__ping {
  position: absolute;
  top: 0;
  right: 4px;
  width: 10px;
  height: 10px;
  border: 2px solid #11160e;
  border-radius: 50%;
  background: var(--mg-chat-acid);
  box-shadow: 0 0 13px rgba(198, 255, 63, .8);
}

@keyframes mg-orbit {
  to { transform: rotate(360deg); }
}

@keyframes mg-orbit-reverse {
  to { transform: rotate(-360deg); }
}

.mg-robot {
  position: relative;
  display: grid;
  justify-items: center;
}

.mg-robot--head {
  width: 52px;
  height: 54px;
  transform: translateY(3px);
}

.mg-robot__antenna {
  position: relative;
  z-index: 0;
  width: 2px;
  height: 10px;
  display: block;
  background: #182014;
}

.mg-robot__antenna b {
  position: absolute;
  top: -4px;
  left: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #182014;
  box-shadow: 0 0 0 2px rgba(24, 32, 20, .18);
  transform: translateX(-50%);
}

.mg-robot__head {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #182014;
  border-radius: 14px 14px 12px 12px;
  background: #d8ff76;
  box-shadow: inset 0 -7px 12px rgba(72, 102, 22, .12);
}

.mg-robot__face {
  width: 37px;
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 9px;
  background: #11170e;
}

.mg-robot__eye {
  width: 5px;
  height: 7px;
  display: block;
  border-radius: 5px;
  background: var(--mg-chat-acid);
  box-shadow: 0 0 7px rgba(198, 255, 63, .75);
  animation: mg-blink 5s infinite;
}

.mg-robot__mouth {
  position: absolute;
  bottom: 7px;
  width: 10px;
  height: 2px;
  margin-right: 0;
  border-radius: 2px;
  background: rgba(198, 255, 63, .7);
}

@keyframes mg-blink {
  0%, 46%, 50%, 100% { transform: scaleY(1); }
  48% { transform: scaleY(.12); }
}

.mg-assistant__panel {
  position: absolute;
  right: 0;
  bottom: 0;
  width: min(390px, calc(100vw - 30px));
  height: min(670px, calc(100svh - 30px));
  min-height: 560px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto auto;
  overflow: hidden;
  color: #f5f6f1;
  border: 1px solid rgba(198, 255, 63, .24);
  border-radius: 28px;
  background:
    linear-gradient(180deg, rgba(198, 255, 63, .035), transparent 28%),
    var(--mg-chat-panel);
  box-shadow: 0 30px 90px rgba(0, 0, 0, .58), inset 0 1px rgba(255, 255, 255, .06);
  backdrop-filter: blur(22px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(24px) scale(.9);
  transform-origin: bottom right;
  transition: opacity .32s, visibility .32s, transform .5s cubic-bezier(.16, 1, .3, 1);
}

.mg-assistant.is-open .mg-assistant__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.mg-assistant__header {
  height: 70px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(245, 246, 241, .09);
}

.mg-assistant__header > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mg-assistant__header p {
  margin: 0;
  display: grid;
  gap: 2px;
}

.mg-assistant__header strong {
  font-size: .84rem;
}

.mg-assistant__header small {
  color: #969e91;
  font-size: .62rem;
}

.mg-assistant__status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--mg-chat-acid);
  box-shadow: 0 0 0 5px rgba(198, 255, 63, .09), 0 0 12px rgba(198, 255, 63, .55);
}

.mg-assistant__close {
  width: 36px;
  height: 36px;
  padding: 0;
  display: grid;
  place-items: center;
  color: #c9cec4;
  border: 1px solid rgba(245, 246, 241, .12);
  border-radius: 50%;
  background: rgba(255, 255, 255, .03);
  font: 300 1.4rem/1 Arial, sans-serif;
  transition: color .25s, border-color .25s, transform .25s;
}

.mg-assistant__close:hover {
  color: var(--mg-chat-acid);
  border-color: rgba(198, 255, 63, .5);
  transform: rotate(8deg);
}

.mg-assistant__stage {
  min-height: 0;
  padding: 16px 18px 6px;
  display: grid;
  grid-template-rows: minmax(145px, 1fr) 150px;
  justify-items: center;
  overflow: hidden;
}

.mg-assistant__speech {
  position: relative;
  width: 100%;
  min-height: 0;
  padding: 14px 14px 18px;
  overflow: hidden;
  color: #171b14;
  border-radius: 18px 18px 5px 18px;
  background: #eef0e8;
  box-shadow: 0 13px 38px rgba(0, 0, 0, .22);
}

.mg-assistant__speech::after {
  content: "";
  position: absolute;
  right: 30px;
  bottom: -10px;
  width: 20px;
  height: 20px;
  background: #eef0e8;
  transform: rotate(45deg);
}

.mg-assistant__messages {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: #9fbf51 transparent;
}

.mg-assistant__message {
  width: fit-content;
  max-width: 92%;
  margin: 0 0 9px;
  padding: 9px 11px;
  white-space: pre-wrap;
  border-radius: 12px;
  font-size: .74rem;
  line-height: 1.8;
}

.mg-assistant__message--bot {
  margin-left: auto;
  background: transparent;
}

.mg-assistant__message--user {
  margin-right: auto;
  color: #f3f5ed;
  border-radius: 12px 12px 12px 3px;
  background: #1b2118;
}

.mg-assistant__message--error {
  color: #722c25;
  background: #ffe7df;
}

.mg-assistant__typing {
  position: absolute;
  right: 15px;
  bottom: 10px;
  display: flex;
  gap: 4px;
}

.mg-assistant__typing[hidden] {
  display: none;
}

.mg-assistant__typing i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b765f;
  animation: mg-typing 1s ease-in-out infinite;
}

.mg-assistant__typing i:nth-child(2) { animation-delay: .14s; }
.mg-assistant__typing i:nth-child(3) { animation-delay: .28s; }

@keyframes mg-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: .45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.mg-robot--full {
  align-self: end;
  width: 150px;
  height: 142px;
  transform: translateY(12px);
  filter: drop-shadow(0 15px 18px rgba(0, 0, 0, .32));
}

.mg-robot--full .mg-robot__antenna {
  height: 15px;
  background: #76806e;
}

.mg-robot--full .mg-robot__antenna b {
  width: 10px;
  height: 10px;
  background: var(--mg-chat-acid);
  box-shadow: 0 0 13px rgba(198, 255, 63, .75);
}

.mg-robot--full > .mg-robot__head {
  width: 92px;
  height: 66px;
  border: 2px solid #778071;
  border-radius: 25px 25px 18px 18px;
  background: linear-gradient(145deg, #e3e7dc, #9ba494);
}

.mg-robot--full .mg-robot__face {
  position: relative;
  width: 72px;
  height: 45px;
  gap: 20px;
  border-radius: 16px;
  background: #0b0f09;
}

.mg-robot--full .mg-robot__eye {
  width: 8px;
  height: 11px;
}

.mg-robot--full .mg-robot__mouth {
  bottom: 8px;
  width: 15px;
}

.mg-robot__ear {
  position: absolute;
  top: 22px;
  width: 9px;
  height: 24px;
  border: 1px solid #6f7869;
  background: #a9b0a3;
}

.mg-robot__ear--right {
  right: -9px;
  border-radius: 0 7px 7px 0;
}

.mg-robot__ear--left {
  left: -9px;
  border-radius: 7px 0 0 7px;
}

.mg-robot__neck {
  width: 25px;
  height: 8px;
  border-right: 2px solid #747d6d;
  border-left: 2px solid #747d6d;
  background: #aab2a3;
}

.mg-robot__body {
  position: relative;
  width: 118px;
  height: 60px;
  display: flex;
  justify-content: center;
}

.mg-robot__chest {
  position: relative;
  z-index: 1;
  width: 82px;
  height: 62px;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: var(--mg-chat-acid);
  border: 2px solid #747d6d;
  border-radius: 18px 18px 10px 10px;
  background: linear-gradient(145deg, #252c21, #10140e);
  font: 900 1.05rem/1 Arial, sans-serif;
}

.mg-robot__chest::after {
  content: "";
  position: absolute;
  right: 12px;
  bottom: 7px;
  left: 12px;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(198, 255, 63, .55), transparent);
}

.mg-robot__chest > i {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mg-chat-acid);
  box-shadow: 0 0 8px rgba(198, 255, 63, .8);
}

.mg-robot__arm {
  position: absolute;
  top: 7px;
  width: 23px;
  height: 51px;
  border: 2px solid #747d6d;
  background: #aab2a3;
}

.mg-robot__arm--right {
  right: 0;
  border-radius: 14px 5px 12px 12px;
  transform: rotate(-8deg);
}

.mg-robot__arm--left {
  left: 0;
  border-radius: 5px 14px 12px 12px;
  transform: rotate(8deg);
}

.mg-assistant.is-thinking .mg-robot--full .mg-robot__antenna b {
  animation: mg-thinking-light .8s ease-in-out infinite alternate;
}

.mg-assistant.is-thinking .mg-robot--full .mg-robot__head {
  animation: mg-thinking-head 1.1s ease-in-out infinite alternate;
}

@keyframes mg-thinking-light {
  to { background: #fff; box-shadow: 0 0 20px rgba(198, 255, 63, 1); }
}

@keyframes mg-thinking-head {
  to { transform: rotate(2deg) translateY(-2px); }
}

.mg-assistant__suggestions {
  padding: 7px 16px 9px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
}

.mg-assistant__suggestions::-webkit-scrollbar {
  display: none;
}

.mg-assistant__suggestions button {
  flex: 0 0 auto;
  padding: 7px 10px;
  color: #cfd4ca;
  border: 1px solid rgba(245, 246, 241, .12);
  border-radius: 999px;
  background: rgba(255, 255, 255, .035);
  font-size: .61rem;
  white-space: nowrap;
  transition: color .25s, border-color .25s, background .25s;
}

.mg-assistant__suggestions button:hover {
  color: var(--mg-chat-ink);
  border-color: var(--mg-chat-acid);
  background: var(--mg-chat-acid);
}

.mg-assistant__composer {
  margin: 0 14px;
  padding: 7px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  border: 1px solid rgba(245, 246, 241, .15);
  border-radius: 16px;
  background: rgba(255, 255, 255, .045);
  transition: border-color .25s, box-shadow .25s;
}

.mg-assistant__composer:focus-within {
  border-color: rgba(198, 255, 63, .55);
  box-shadow: 0 0 0 3px rgba(198, 255, 63, .06);
}

.mg-assistant__composer textarea {
  width: 100%;
  max-height: 92px;
  padding: 8px 8px 7px;
  resize: none;
  overflow-y: auto;
  color: #f5f6f1;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: .74rem;
  line-height: 1.7;
}

.mg-assistant__composer textarea::placeholder {
  color: #7e8778;
}

.mg-assistant__composer button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  display: grid;
  place-items: center;
  color: var(--mg-chat-ink);
  border: 0;
  border-radius: 12px;
  background: var(--mg-chat-acid);
  transition: transform .25s, opacity .25s;
}

.mg-assistant__composer button:hover {
  transform: translateY(-2px);
}

.mg-assistant__composer button:disabled {
  cursor: wait;
  opacity: .5;
}

.mg-assistant__composer svg {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.mg-assistant__notice {
  padding: 8px 17px 12px;
  color: #737c6e;
  font-size: .54rem;
  text-align: center;
}

@media (max-width: 680px) {
  .mg-assistant {
    right: max(14px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
  }

  .mg-assistant__launcher {
    width: 64px;
    height: 64px;
  }

  .mg-robot--head {
    transform: scale(.88) translateY(3px);
  }

  .mg-assistant__panel {
    position: fixed;
    right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
    height: min(650px, calc(100svh - 20px));
    min-height: 0;
    border-radius: 24px;
    transform-origin: bottom right;
  }

  .mg-assistant__stage {
    grid-template-rows: minmax(128px, 1fr) 135px;
  }

  .mg-robot--full {
    transform: scale(.9) translateY(22px);
  }
}

@media (max-height: 620px) and (min-width: 681px) {
  .mg-assistant__panel {
    height: calc(100svh - 24px);
    min-height: 0;
  }

  .mg-assistant__stage {
    grid-template-rows: minmax(105px, 1fr) 100px;
  }

  .mg-robot--full {
    transform: scale(.72) translateY(40px);
  }
}

@media (prefers-reduced-motion: reduce) and (update: none) {
  .mg-assistant *,
  .mg-assistant *::before,
  .mg-assistant *::after {
    scroll-behavior: auto !important;
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}
