.mf-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 999999;
  font-family: inherit;
}

.mf-chat__fab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.35);
  color: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  cursor: pointer;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(12px);
}

.mf-chat__fab-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, #24d6c4, #8b5dff, #f04cff);
  box-shadow:
    0 0 0 4px rgba(255, 255, 255, 0.03),
    0 0 20px rgba(36, 214, 196, 0.22),
    0 0 26px rgba(139, 93, 255, 0.2);
}

.mf-chat__fab-label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mf-chat__panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(360px, calc(100vw - 36px));
  height: 520px;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(7, 7, 11, 0.86);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(16px);
  display: none;
  overflow: hidden;
}

.mf-chat[data-open="true"] .mf-chat__panel {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto auto auto;
}

.mf-chat__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(280px 180px at 16% 10%, rgba(36, 214, 196, 0.18), transparent 60%),
    radial-gradient(280px 180px at 86% 22%, rgba(139, 93, 255, 0.16), transparent 62%),
    rgba(0, 0, 0, 0.16);
}

.mf-chat__brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mf-chat__logo {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.8), rgba(139, 93, 255, 0.7), rgba(240, 76, 255, 0.55));
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.5);
}

.mf-chat__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.mf-chat__sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.mf-chat__close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}

.mf-chat__body {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 10px;
}

.mf-chat__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 12px 12px;
}

.mf-chat__chip {
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.9);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.mf-chat__chip--primary {
  border-color: rgba(36, 214, 196, 0.38);
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.22), rgba(139, 93, 255, 0.18), rgba(240, 76, 255, 0.14));
}

.mf-chat__lead {
  display: none;
  margin: 0 12px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.mf-chat__lead[data-open="true"] {
  display: block;
}

.mf-chat__lead-head {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.mf-chat__lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.mf-chat__lead-input,
.mf-chat__lead-text {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 10px 12px;
  outline: none;
  font-size: 12px;
}

.mf-chat__lead-text {
  grid-column: 1 / -1;
  resize: vertical;
}

.mf-chat__lead-actions {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.mf-chat__lead-btn {
  height: 38px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(36, 214, 196, 0.38);
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.22), rgba(139, 93, 255, 0.18), rgba(240, 76, 255, 0.14));
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.mf-chat__lead-btn--ghost {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
}

.mf-chat__lead-foot {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.6);
}

.mf-chat__mst {
  margin: 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.22);
  padding: 12px;
}

.mf-chat__mst[data-open="false"] {
  display: none;
}

.mf-chat__mst-title {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.mf-chat__mst-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mf-chat__mst-input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  outline: none;
}

.mf-chat__mst-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(36, 214, 196, 0.38);
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.22), rgba(139, 93, 255, 0.18), rgba(240, 76, 255, 0.14));
  color: rgba(255, 255, 255, 0.92);
  font-weight: 800;
  cursor: pointer;
}

.mf-chat__mst-hint {
  margin-top: 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.mf-chat__mst-company {
  margin-top: 10px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.82);
  white-space: pre-wrap;
}

.mf-chat__mst-err {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255, 157, 157, 0.9);
}

.mf-chat__msg {
  display: flex;
}

.mf-chat__msg--ai {
  justify-content: flex-start;
}

.mf-chat__msg--user {
  justify-content: flex-end;
}

.mf-chat__bubble {
  max-width: 86%;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(0, 0, 0, 0.2);
  white-space: pre-wrap;
}

.mf-chat__msg--ai .mf-chat__bubble {
  background:
    radial-gradient(240px 140px at 12% 18%, rgba(36, 214, 196, 0.12), transparent 62%),
    radial-gradient(240px 140px at 88% 30%, rgba(139, 93, 255, 0.1), transparent 64%),
    rgba(0, 0, 0, 0.18);
}

.mf-chat__msg--user .mf-chat__bubble {
  border-color: rgba(36, 214, 196, 0.26);
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.22), rgba(139, 93, 255, 0.18), rgba(240, 76, 255, 0.12));
}

.mf-chat__composer {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.mf-chat__input {
  height: 40px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 0 12px;
  outline: none;
}

.mf-chat__input:focus {
  box-shadow: 0 0 0 4px rgba(36, 214, 196, 0.18);
}

.mf-chat__send {
  height: 40px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(36, 214, 196, 0.38);
  background: linear-gradient(135deg, rgba(36, 214, 196, 0.22), rgba(139, 93, 255, 0.18), rgba(240, 76, 255, 0.14));
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  cursor: pointer;
}

.mf-chat__send:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.mf-chat__foot {
  padding: 10px 12px 12px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 520px) {
  .mf-chat {
    right: 12px;
    bottom: 12px;
  }

  .mf-chat__panel {
    right: 0;
    bottom: 58px;
    height: 520px;
  }

  .mf-chat__lead-grid {
    grid-template-columns: 1fr;
  }
}
