
:root {
  --tr-blue: #0b5ed7;
  --tr-blue-2: #2f8cff;
  --tr-blue-soft: #eaf3ff;
  --tr-dark: #081b33;
  --tr-white: #ffffff;
}

#tulcea-robot-root,
#tulcea-robot-root * {
  box-sizing: border-box;
  font-family: Arial, Helvetica, sans-serif;
}

#tulcea-robot-root {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 2147483000;
  color: var(--tr-dark);
}

.tr-launcher {
  width: 41px;
  height: 49px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  position: relative;
  filter: drop-shadow(0 12px 18px rgba(12, 74, 150, .22));
}

.tr-launcher:focus-visible,
.tr-close:focus-visible,
.tr-send:focus-visible,
.tr-quick:focus-visible {
  outline: 3px solid rgba(47, 140, 255, .35);
  outline-offset: 3px;
}

.tr-bubble {
  position: absolute;
  right: 31px;
  bottom: 42px;
  width: max-content;
  max-width: 125px;
  padding: 5px 7px;
  border-radius: 12px 12px 4px 12px;
  background: rgba(255, 255, 255, .62);
  color: #10243d;
  font-size: 9px;
  font-weight: 700;
  line-height: 1.25;
  border: 1px solid rgba(255, 255, 255, .52);
  box-shadow: 0 4px 12px rgba(0, 55, 130, .12);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: tr-bubble-in .5s ease both, tr-bubble-float 3s ease-in-out infinite 1s;
}

.tr-bubble::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: -5px;
  border: 5px solid transparent;
  border-top-color: rgba(255, 255, 255, .62);
  border-right: 0;
}

.tr-robot-wrap {
  animation: tr-float 2.7s ease-in-out infinite;
  transform-origin: center bottom;
}

.tr-robot {
  width: 41px;
  height: 49px;
  overflow: visible;
}

.tr-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: tr-blink 5s infinite;
}

.tr-arm-wave {
  transform-box: fill-box;
  transform-origin: 22% 78%;
  animation: tr-wave 2.7s ease-in-out infinite;
}

.tr-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: tr-ring 2s ease-in-out infinite;
}

.tr-panel {
  position: absolute;
  right: 0;
  bottom: 58px;
  width: min(370px, calc(100vw - 28px));
  height: min(570px, calc(100vh - 165px));
  background: #fff;
  border: 1px solid rgba(11, 94, 215, .14);
  border-radius: 22px;
  box-shadow: 0 24px 70px rgba(5, 42, 91, .24);
  overflow: hidden;
  display: none;
  flex-direction: column;
  transform-origin: right bottom;
}

.tr-panel.tr-open {
  display: flex;
  animation: tr-panel-in .28s ease both;
}

.tr-header {
  min-height: 78px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  color: #fff;
  background: linear-gradient(135deg, #0b5ed7, #2f8cff);
}

.tr-avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.15);
}

.tr-avatar svg {
  width: 38px;
  height: 38px;
}

.tr-title {
  min-width: 0;
  flex: 1;
}

.tr-title strong {
  display: block;
  font-size: 17px;
}

.tr-status {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 9px;
  opacity: .94;
}

.tr-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #42f58d;
  box-shadow: 0 0 0 4px rgba(66,245,141,.16);
}

.tr-close {
  border: 0;
  background: rgba(255,255,255,.16);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.tr-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background:
    radial-gradient(circle at 0 0, rgba(47,140,255,.07), transparent 28%),
    #f7fbff;
  scroll-behavior: smooth;
}

.tr-message {
  display: flex;
  margin: 10px 0;
}

.tr-message.tr-user {
  justify-content: flex-end;
}

.tr-message-bubble {
  max-width: 83%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.tr-bot .tr-message-bubble {
  background: #fff;
  color: #19324f;
  border: 1px solid #e1ecf8;
  border-bottom-left-radius: 5px;
  box-shadow: 0 5px 14px rgba(7,66,130,.07);
}

.tr-user .tr-message-bubble {
  background: linear-gradient(135deg, #0b5ed7, #2f8cff);
  color: #fff;
  border-bottom-right-radius: 5px;
}

.tr-quick-area {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding: 0 14px 12px;
  background: #f7fbff;
}

.tr-quick {
  border: 1px solid #cfe3fb;
  background: #fff;
  color: #0b5ed7;
  border-radius: 999px;
  padding: 5px 7px;
  font-size: 9px;
  cursor: pointer;
}

.tr-quick:hover {
  background: #eaf3ff;
}

.tr-typing {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.tr-typing i {
  width: 6px;
  height: 6px;
  background: #2f8cff;
  border-radius: 50%;
  display: block;
  animation: tr-dot 1.1s infinite ease-in-out;
}

.tr-typing i:nth-child(2) { animation-delay: .15s; }
.tr-typing i:nth-child(3) { animation-delay: .30s; }

.tr-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  background: #fff;
  border-top: 1px solid #e5eef8;
}

.tr-input {
  flex: 1;
  min-width: 0;
  border: 1px solid #cddff3;
  background: #f9fcff;
  border-radius: 13px;
  padding: 12px 13px;
  font-size: 14px;
  color: #123;
}

.tr-input:focus {
  outline: 0;
  border-color: #2f8cff;
  box-shadow: 0 0 0 3px rgba(47,140,255,.14);
}

.tr-send {
  width: 46px;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, #0b5ed7, #2f8cff);
  color: #fff;
  cursor: pointer;
  font-size: 19px;
}

.tr-send:disabled {
  opacity: .55;
  cursor: wait;
}

.tr-note {
  padding: 0 14px 11px;
  text-align: center;
  font-size: 10px;
  color: #70839a;
  background: #fff;
}

@keyframes tr-float {
  0%,100% { transform: translateY(0) rotate(-1deg); }
  50% { transform: translateY(-9px) rotate(1deg); }
}

@keyframes tr-wave {
  0%, 38%, 100% { transform: rotate(0deg); }
  46% { transform: rotate(-20deg); }
  54% { transform: rotate(13deg); }
  62% { transform: rotate(-17deg); }
  70% { transform: rotate(8deg); }
}

@keyframes tr-blink {
  0%, 46%, 48%, 100% { transform: scaleY(1); }
  47% { transform: scaleY(.08); }
}

@keyframes tr-ring {
  0%,100% { transform: scaleX(1); opacity: .7; }
  50% { transform: scaleX(1.12); opacity: 1; }
}

@keyframes tr-bubble-in {
  from { opacity: 0; transform: translateY(8px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes tr-bubble-float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@keyframes tr-panel-in {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

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

@media (max-width: 600px) {
  #tulcea-robot-root {
    right: 8px;
    bottom: 8px;
  }

  .tr-launcher {
    width: 34px;
    height: 41px;
  }

  .tr-robot {
    width: 92px;
    height: 110px;
  }

  .tr-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: 52px;
    width: auto;
    height: min(620px, calc(100vh - 135px));
  }

  .tr-bubble {
    right: 27px;
    bottom: 36px;
    font-size: 8px;
    max-width: 110px;
    padding: 4px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tr-robot-wrap,
  .tr-eye,
  .tr-arm-wave,
  .tr-ring,
  .tr-bubble,
  .tr-panel.tr-open,
  .tr-typing i {
    animation: none !important;
  }
}

.tr-result-links{display:flex;flex-wrap:wrap;gap:7px;margin:7px 0 13px;padding-left:2px}.tr-result-link{display:inline-flex;align-items:center;max-width:100%;padding:8px 10px;border:1px solid #bcd8f5;border-radius:10px;background:rgba(255,255,255,.72);color:#0b5ed7!important;font-size:12px;font-weight:700;text-decoration:none;backdrop-filter:blur(4px)}.tr-result-link:hover{background:#eaf3ff}
