:root {
  --ta-green: #173f34;
  --ta-green-2: #245d4b;
  --ta-cream: #f7f2e8;
  --ta-line: rgba(23, 63, 52, .12);
  --ta-shadow: 0 18px 55px rgba(16, 52, 42, .18);
}

.terra-agent-root,
.terra-agent-root * {
  box-sizing: border-box;
}

.terra-agent-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9998;
  font-family: inherit;
}

.terra-agent-launcher {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ta-green);
  color: #fff;
  box-shadow: var(--ta-shadow);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.terra-agent-launcher:hover {
  background: var(--ta-green-2);
}

.terra-agent-launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #bfe3a1;
  box-shadow: 0 0 0 4px rgba(191, 227, 161, .15);
}

.terra-agent-panel {
  position: absolute;
  right: 0;
  bottom: 68px;
  width: min(370px, calc(100vw - 28px));
  height: min(570px, calc(100vh - 120px));
  display: none;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--ta-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--ta-shadow);
}

.terra-agent-root.is-open .terra-agent-panel {
  display: flex;
}

.terra-agent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 17px;
  background: var(--ta-green);
  color: #fff;
}

.terra-agent-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
}

.terra-agent-subtitle {
  margin-top: 3px;
  color: rgba(255,255,255,.76);
  font-size: 12px;
}

.terra-agent-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

.terra-agent-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #fbfaf6;
}

.terra-agent-message {
  max-width: 88%;
  margin: 0 0 11px;
  padding: 11px 13px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.45;
  white-space: pre-line;
}

.terra-agent-message.bot {
  margin-right: auto;
  border-bottom-left-radius: 5px;
  background: #fff;
  color: #23332e;
  border: 1px solid var(--ta-line);
}

.terra-agent-message.user {
  margin-left: auto;
  border-bottom-right-radius: 5px;
  background: var(--ta-green);
  color: #fff;
}

.terra-agent-products {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.terra-agent-product {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--ta-line);
  border-radius: 13px;
  background: #fff;
  color: inherit;
  text-decoration: none;
}

.terra-agent-product img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  border-radius: 9px;
  background: #f8f8f4;
}

.terra-agent-product-name {
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.terra-agent-product-price {
  margin-top: 3px;
  color: var(--ta-green-2);
  font-size: 12px;
  font-weight: 800;
}

.terra-agent-product-arrow {
  color: var(--ta-green);
  font-size: 18px;
}

.terra-agent-quick {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 12px;
  background: #fff;
}

.terra-agent-chip {
  border: 1px solid var(--ta-line);
  border-radius: 999px;
  padding: 8px 10px;
  background: var(--ta-cream);
  color: var(--ta-green);
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
}

.terra-agent-compose {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 11px;
  border-top: 1px solid var(--ta-line);
  background: #fff;
}

.terra-agent-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--ta-line);
  border-radius: 12px;
  outline: none;
  font: inherit;
  font-size: 14px;
}

.terra-agent-input:focus {
  border-color: rgba(23,63,52,.38);
  box-shadow: 0 0 0 3px rgba(23,63,52,.08);
}

.terra-agent-send {
  width: 44px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--ta-green);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}

.terra-agent-note {
  padding: 0 13px 11px;
  background: #fff;
  color: #7a817e;
  font-size: 10px;
  text-align: center;
}

@media (max-width: 600px) {
  .terra-agent-root {
    right: 12px;
    bottom: 12px;
  }

  .terra-agent-launcher {
    min-height: 50px;
    padding: 0 15px;
  }

  .terra-agent-panel {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 72px;
    width: auto;
    height: min(610px, calc(100vh - 92px));
    border-radius: 18px;
  }
}
