.tj-robot {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 1200;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #162235;
}

.tj-robot * {
  box-sizing: border-box;
}

.tj-robot__launcher {
  width: 64px;
  height: 64px;
  border: 1px solid rgba(56, 132, 255, 0.28);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(229, 246, 255, 0.94));
  box-shadow: 0 24px 60px rgba(43, 103, 169, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.tj-robot__launcher:hover {
  transform: translateY(-3px);
  border-color: rgba(12, 148, 212, 0.46);
  box-shadow: 0 30px 70px rgba(43, 103, 169, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.tj-robot__mark {
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: radial-gradient(circle at 28% 20%, #ffffff 0 16%, #dff8ff 17% 42%, #33b7dc 43% 70%, #0d5a90 71% 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7), 0 10px 22px rgba(8, 88, 145, 0.24);
  position: relative;
}

.tj-robot__mark::before,
.tj-robot__mark::after {
  content: "";
  position: absolute;
  top: 16px;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #10243c;
}

.tj-robot__mark::before {
  left: 12px;
}

.tj-robot__mark::after {
  right: 12px;
}

.tj-robot__panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  width: min(390px, calc(100vw - 28px));
  max-height: min(650px, calc(100vh - 128px));
  display: none;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(86, 137, 190, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(219, 248, 255, 0.9), transparent 34%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 252, 255, 0.96));
  box-shadow: 0 32px 90px rgba(38, 83, 132, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(18px);
}

.tj-robot[data-open="true"] .tj-robot__panel {
  display: grid;
}

.tj-robot__header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid rgba(89, 129, 169, 0.14);
}

.tj-robot__identity {
  display: grid;
  gap: 2px;
}

.tj-robot__identity strong {
  font-size: 15px;
  letter-spacing: 0;
}

.tj-robot__identity span {
  font-size: 12px;
  color: #60718a;
}

.tj-robot__close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(90, 128, 168, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  color: #31415a;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.tj-robot__body {
  overflow: auto;
  padding: 14px;
  display: grid;
  gap: 12px;
}

.tj-robot__hint {
  margin: 0;
  padding: 12px;
  border-radius: 16px;
  background: rgba(224, 246, 255, 0.64);
  color: #466178;
  font-size: 12px;
  line-height: 1.5;
}

.tj-robot__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tj-robot__chip {
  border: 1px solid rgba(39, 139, 199, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: #1d5f88;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 10px;
}

.tj-robot__messages {
  display: grid;
  gap: 10px;
}

.tj-robot__message {
  max-width: 92%;
  padding: 11px 12px;
  border-radius: 16px;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}

.tj-robot__message--bot {
  justify-self: start;
  background: #ffffff;
  border: 1px solid rgba(83, 127, 169, 0.15);
  color: #21354d;
}

.tj-robot__message--user {
  justify-self: end;
  background: linear-gradient(135deg, #0f8fbd, #166fd0);
  color: #ffffff;
  box-shadow: 0 14px 26px rgba(22, 111, 208, 0.22);
}

.tj-robot__message--warn {
  justify-self: stretch;
  max-width: none;
  background: #fff4df;
  border: 1px solid rgba(221, 150, 45, 0.28);
  color: #7a5214;
}

.tj-robot__form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(89, 129, 169, 0.14);
  background: rgba(255, 255, 255, 0.7);
}

.tj-robot__input {
  min-width: 0;
  border: 1px solid rgba(91, 130, 170, 0.22);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.88);
  color: #17243a;
  font: inherit;
  font-size: 13px;
  padding: 12px;
  outline: none;
}

.tj-robot__input:focus {
  border-color: rgba(16, 143, 189, 0.62);
  box-shadow: 0 0 0 4px rgba(39, 178, 222, 0.14);
}

.tj-robot__send {
  border: 0;
  border-radius: 15px;
  background: #12385c;
  color: #ffffff;
  cursor: pointer;
  font-weight: 800;
  padding: 0 16px;
}

.tj-robot__send:disabled,
.tj-robot__input:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

@media (max-width: 640px) {
  .tj-robot {
    right: 12px;
    bottom: 78px;
  }

  .tj-robot__panel {
    right: -2px;
    bottom: 72px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 112px);
    border-radius: 22px;
  }

  .tj-robot__launcher {
    width: 58px;
    height: 58px;
    border-radius: 20px;
  }
}
