.tsc-chatbot {
  --chatbot-bg: #041710;
  --chatbot-panel: rgba(6, 31, 21, 0.98);
  --chatbot-card: rgba(125, 255, 169, 0.075);
  --chatbot-line: rgba(125, 255, 169, 0.2);
  --chatbot-text: #ecfff6;
  --chatbot-muted: #9db8ab;
  --chatbot-green: #67f3a5;
  position: fixed;
  right: clamp(18px, 2vw, 34px);
  bottom: clamp(22px, 2.5vw, 38px);
  z-index: 10020;
  color: var(--chatbot-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tsc-chatbot *,
.tsc-chatbot *::before,
.tsc-chatbot *::after {
  box-sizing: border-box;
}

.tsc-chatbot__launcher {
  position: relative;
  display: grid;
  width: 66px;
  height: 66px;
  place-items: center;
  padding: 7px;
  cursor: pointer;
  color: var(--chatbot-text);
  background: linear-gradient(145deg, rgba(18, 77, 51, 0.98), rgba(3, 25, 17, 0.98));
  border: 1px solid rgba(125, 255, 169, 0.42);
  border-radius: 22px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.48), 0 0 32px rgba(25, 206, 115, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.tsc-chatbot__launcher:hover,
.tsc-chatbot__launcher:focus-visible,
.tsc-chatbot__launcher[aria-expanded="true"] {
  border-color: rgba(125, 255, 169, 0.78);
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.54), 0 0 38px rgba(25, 206, 115, 0.3);
  outline: none;
  transform: translateY(-3px);
}

.tsc-chatbot__launcher img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 15px;
  filter: drop-shadow(0 0 8px rgba(125, 255, 169, 0.24));
}

.tsc-chatbot__launcher-label {
  position: absolute;
  right: calc(100% + 12px);
  width: max-content;
  max-width: 210px;
  padding: 9px 12px;
  pointer-events: none;
  color: var(--chatbot-text);
  background: rgba(4, 23, 16, 0.97);
  border: 1px solid var(--chatbot-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.34);
  font-size: 13px;
  font-weight: 750;
  opacity: 0;
  transform: translateX(5px);
  transition: opacity 150ms ease, transform 150ms ease;
}

.tsc-chatbot__launcher:hover .tsc-chatbot__launcher-label,
.tsc-chatbot__launcher:focus-visible .tsc-chatbot__launcher-label {
  opacity: 1;
  transform: translateX(0);
}

.tsc-chatbot__presence {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 15px;
  height: 15px;
  background: #43eb91;
  border: 3px solid #041710;
  border-radius: 50%;
  box-shadow: 0 0 12px rgba(67, 235, 145, 0.65);
}

.tsc-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 82px;
  display: grid;
  width: min(410px, calc(100vw - 32px));
  height: min(650px, calc(100svh - 126px));
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  overflow: hidden;
  color: var(--chatbot-text);
  background:
    linear-gradient(rgba(125, 255, 169, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 255, 169, 0.035) 1px, transparent 1px),
    var(--chatbot-panel);
  background-size: 30px 30px, 30px 30px, auto;
  border: 1px solid rgba(125, 255, 169, 0.28);
  border-radius: 24px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 38px rgba(25, 206, 115, 0.1);
}

.tsc-chatbot__panel[hidden] {
  display: none;
}

.tsc-chatbot__header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 15px 16px;
  background: rgba(5, 28, 19, 0.96);
  border-bottom: 1px solid var(--chatbot-line);
}

.tsc-chatbot__avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  padding: 3px;
  background: rgba(125, 255, 169, 0.07);
  border: 1px solid rgba(125, 255, 169, 0.18);
  border-radius: 13px;
}

.tsc-chatbot__avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tsc-chatbot__identity {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.tsc-chatbot__identity strong {
  overflow: hidden;
  color: var(--chatbot-text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tsc-chatbot__identity small,
.tsc-chatbot__footer,
.tsc-chatbot__privacy {
  color: var(--chatbot-muted);
  font-size: 11px;
  line-height: 1.45;
}

.tsc-chatbot__close {
  width: 36px;
  height: 36px;
  padding: 0;
  cursor: pointer;
  color: #dffff0;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  border-radius: 11px;
  font: 300 27px/1 system-ui;
}

.tsc-chatbot__close:hover,
.tsc-chatbot__close:focus-visible {
  background: rgba(125, 255, 169, 0.1);
  border-color: var(--chatbot-line);
  outline: none;
}

.tsc-chatbot__banner {
  margin: 12px 14px 0;
  padding: 10px 12px;
  color: #fff3cf;
  background: rgba(186, 119, 22, 0.16);
  border: 1px solid rgba(255, 191, 71, 0.25);
  border-radius: 12px;
  font-size: 12px;
  line-height: 1.5;
}

.tsc-chatbot__body {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: rgba(125, 255, 169, 0.3) transparent;
}

.tsc-chatbot__conversation {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding: 16px;
}

.tsc-chatbot__message {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 13px;
  line-height: 1.52;
  white-space: pre-wrap;
}

.tsc-chatbot__message--assistant {
  align-self: flex-start;
  color: #eafff3;
  background: var(--chatbot-card);
  border: 1px solid rgba(125, 255, 169, 0.12);
  border-bottom-left-radius: 5px;
}

.tsc-chatbot__message--user {
  align-self: flex-end;
  color: #032014;
  background: linear-gradient(135deg, #7dffa9, #35df8b);
  border-bottom-right-radius: 5px;
  font-weight: 650;
}

.tsc-chatbot__knowledge {
  padding: 12px;
  color: #dffff0;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(125, 255, 169, 0.14);
  border-radius: 14px;
  font-size: 12px;
  line-height: 1.55;
}

.tsc-chatbot__knowledge strong {
  display: block;
  margin-bottom: 5px;
  color: var(--chatbot-green);
}

.tsc-chatbot__guidance {
  padding: 14px;
  color: #eafff3;
  background: linear-gradient(145deg, rgba(125, 255, 169, 0.12), rgba(5, 41, 28, 0.84));
  border: 1px solid rgba(125, 255, 169, 0.28);
  border-radius: 15px;
  font-size: 12px;
  line-height: 1.55;
}

.tsc-chatbot__guidance strong {
  display: block;
  margin-bottom: 6px;
  color: var(--chatbot-green);
  font-size: 13px;
}

.tsc-chatbot__guidance p {
  margin: 0;
}

.tsc-chatbot__guidance-actions {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.tsc-chatbot__guidance-link {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  padding: 8px 11px;
  color: #dffff0;
  background: rgba(3, 20, 14, 0.5);
  border: 1px solid rgba(125, 255, 169, 0.28);
  border-radius: 11px;
  font: inherit;
  font-weight: 750;
  text-align: center;
  text-decoration: none;
}

.tsc-chatbot__guidance-link:hover,
.tsc-chatbot__guidance-link:focus-visible {
  color: #032014;
  background: var(--chatbot-green);
  outline: none;
}

.tsc-chatbot__controls {
  display: grid;
  gap: 8px;
  padding: 13px 15px 15px;
  align-content: start;
  background: rgba(3, 20, 14, 0.9);
  border-top: 1px solid rgba(125, 255, 169, 0.12);
}

.tsc-chatbot__controls:empty {
  padding: 0;
  border-top: 0;
}

.tsc-chatbot__choice,
.tsc-chatbot__primary,
.tsc-chatbot__secondary,
.tsc-chatbot__action {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  padding: 10px 13px;
  cursor: pointer;
  border-radius: 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-align: left;
  text-decoration: none;
}

.tsc-chatbot__choice,
.tsc-chatbot__secondary {
  color: #dffff0;
  background: rgba(125, 255, 169, 0.05);
  border: 1px solid rgba(125, 255, 169, 0.18);
}

.tsc-chatbot__choice:hover,
.tsc-chatbot__choice:focus-visible,
.tsc-chatbot__secondary:hover,
.tsc-chatbot__secondary:focus-visible {
  background: rgba(125, 255, 169, 0.11);
  border-color: rgba(125, 255, 169, 0.44);
  outline: none;
}

.tsc-chatbot__primary,
.tsc-chatbot__action {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #032014;
  background: linear-gradient(135deg, #7dffa9, #27d87e);
  border: 0;
  text-align: center;
}

.tsc-chatbot__primary:hover,
.tsc-chatbot__primary:focus-visible,
.tsc-chatbot__action:hover,
.tsc-chatbot__action:focus-visible {
  filter: brightness(1.07);
  outline: 2px solid rgba(125, 255, 169, 0.28);
  outline-offset: 2px;
}

.tsc-chatbot__multi {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  color: #dffff0;
  background: rgba(125, 255, 169, 0.04);
  border: 1px solid rgba(125, 255, 169, 0.12);
  border-radius: 11px;
  font-size: 12px;
  line-height: 1.4;
}

.tsc-chatbot__multi input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: #35df8b;
}

.tsc-chatbot__text-form {
  display: grid;
  gap: 9px;
}

.tsc-chatbot__text-form textarea {
  width: 100%;
  min-height: 76px;
  resize: vertical;
  padding: 11px 12px;
  color: var(--chatbot-text);
  background: rgba(1, 12, 8, 0.86);
  border: 1px solid rgba(125, 255, 169, 0.24);
  border-radius: 12px;
  font: inherit;
  font-size: 13px;
  line-height: 1.5;
}

.tsc-chatbot__text-form textarea:focus {
  border-color: rgba(125, 255, 169, 0.65);
  outline: 2px solid rgba(125, 255, 169, 0.11);
}

.tsc-chatbot__consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 3px 1px;
  color: var(--chatbot-muted);
  font-size: 11px;
  line-height: 1.45;
}

.tsc-chatbot__consent input {
  width: 16px;
  height: 16px;
  margin: 1px 0 0;
  accent-color: #35df8b;
}

.tsc-chatbot__footer {
  display: flex;
  min-height: 39px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 15px;
  background: rgba(1, 12, 8, 0.92);
  border-top: 1px solid rgba(125, 255, 169, 0.09);
}

.tsc-chatbot__footer a {
  color: var(--chatbot-green);
  font-weight: 750;
  text-decoration: none;
}

.tsc-chatbot__busy {
  pointer-events: none;
  opacity: 0.62;
}

@media (max-width: 640px) {
  .tsc-chatbot {
    right: 14px;
    bottom: 16px;
  }

  .tsc-chatbot__launcher {
    width: 58px;
    height: 58px;
    border-radius: 19px;
  }

  .tsc-chatbot__panel {
    right: -2px;
    bottom: 72px;
    width: calc(100vw - 24px);
    height: min(680px, calc(100svh - 100px));
    border-radius: 21px;
  }

  .tsc-chatbot__launcher-label {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tsc-chatbot__launcher,
  .tsc-chatbot__launcher-label {
    transition: none;
  }
}
