#matachin-chatbot.matachin-chatbot {
  --matachin-ink: #172f38;
  --matachin-teal: #0f4b50;
  --matachin-orange: #d95735;
  --matachin-gold: #efb536;
  --matachin-paper: #fffaf0;
  position: fixed;
  right: 20px;
  bottom: 16px;
  z-index: 2147483000;
  color: var(--matachin-ink);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

#matachin-chatbot.matachin-chatbot--position-left {
  right: auto;
  left: 20px;
}

#matachin-chatbot.matachin-chatbot--position-left .matachin-chatbot__panel {
  right: auto;
  left: 0;
}

#matachin-chatbot *,
#matachin-chatbot *::before,
#matachin-chatbot *::after {
  box-sizing: border-box;
}

#matachin-chatbot [hidden] {
  display: none !important;
}

.matachin-chatbot__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  filter: drop-shadow(0 9px 10px rgba(23, 47, 56, 0.22));
}

.matachin-chatbot__toggle span {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--matachin-teal);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.matachin-chatbot__toggle img {
  display: block;
  width: 96px;
  height: 104px;
  object-fit: contain;
  transition: transform 180ms ease;
}

.matachin-chatbot--pet-small .matachin-chatbot__toggle img {
  width: 78px;
  height: 84px;
}

.matachin-chatbot--pet-small .matachin-chatbot__panel {
  bottom: 94px;
}

.matachin-chatbot--pet-large .matachin-chatbot__toggle img {
  width: 118px;
  height: 128px;
}

.matachin-chatbot--pet-large .matachin-chatbot__panel {
  bottom: 136px;
}

.matachin-chatbot__toggle:hover img,
.matachin-chatbot__toggle:focus-visible img {
  transform: translateY(-4px) scale(1.03);
}

.matachin-chatbot__toggle:focus-visible,
.matachin-chatbot__close:focus-visible,
.matachin-chatbot__form:focus-within {
  outline: 3px solid var(--matachin-gold);
  outline-offset: 3px;
}

.matachin-chatbot__panel {
  position: absolute;
  right: 0;
  bottom: 112px;
  width: min(410px, calc(100vw - 32px));
  height: min(680px, calc(100dvh - 145px));
  min-height: 430px;
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
  border: 1px solid rgba(23, 47, 56, 0.16);
  border-radius: 24px;
  background: var(--matachin-paper);
  box-shadow: 0 24px 70px rgba(23, 47, 56, 0.26);
  animation: matachin-chatbot-in 180ms ease-out;
}

.matachin-chatbot--chat-compact .matachin-chatbot__panel {
  width: min(350px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 145px));
}

.matachin-chatbot--chat-large .matachin-chatbot__panel {
  width: min(480px, calc(100vw - 32px));
  height: min(740px, calc(100dvh - 145px));
}

.matachin-chatbot__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 32px;
  height: 32px;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: var(--matachin-orange);
  color: #fff;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.matachin-chatbot__header {
  min-height: 76px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 50px 12px 14px;
  border-bottom: 1px solid rgba(23, 47, 56, 0.13);
  background: rgba(255, 255, 255, 0.5);
}

.matachin-chatbot__avatar {
  width: 50px;
  height: 50px;
  display: grid;
  flex: 0 0 50px;
  place-items: center;
  overflow: hidden;
  border-radius: 15px;
  background: var(--matachin-gold);
}

.matachin-chatbot__avatar img {
  width: 56px;
  height: 60px;
  object-fit: contain;
}

.matachin-chatbot__header strong,
.matachin-chatbot__header small {
  display: block;
}

.matachin-chatbot__header strong {
  margin-bottom: 3px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1;
}

.matachin-chatbot__header small {
  color: #668086;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.matachin-chatbot__header b {
  margin-left: auto;
  color: #4b9a73;
  font-size: 8px;
  letter-spacing: 0.8px;
}

.matachin-chatbot__messages {
  overflow-y: auto;
  padding: 16px 14px;
  scrollbar-color: rgba(15, 75, 80, 0.25) transparent;
  scrollbar-width: thin;
}

.matachin-chatbot__message {
  display: flex;
  align-items: flex-end;
  gap: 7px;
  margin-bottom: 13px;
}

.matachin-chatbot__message > span {
  width: 24px;
  height: 24px;
  display: grid;
  flex: 0 0 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--matachin-orange);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 10px;
  font-weight: 700;
}

.matachin-chatbot__message > div {
  max-width: 84%;
}

.matachin-chatbot__message p {
  max-width: 84%;
  margin: 0;
  padding: 11px 13px;
  border-radius: 17px 17px 17px 4px;
  background: #fff;
  color: #29434a;
  box-shadow: 0 3px 14px rgba(23, 47, 56, 0.05);
  font-size: 13px;
  line-height: 1.5;
}

.matachin-chatbot__message > div p {
  max-width: none;
}

.matachin-chatbot__message a {
  display: inline-block;
  margin: 6px 5px 0;
  color: var(--matachin-orange);
  font-size: 10px;
  font-weight: 700;
  text-underline-offset: 2px;
}

.matachin-chatbot__message--user {
  justify-content: flex-end;
}

.matachin-chatbot__message--user p {
  max-width: 84%;
  border-radius: 17px 17px 4px 17px;
  background: var(--matachin-teal);
  color: #fff;
}

.matachin-chatbot__thinking p {
  display: flex;
  gap: 4px;
  padding: 15px 17px;
}

.matachin-chatbot__thinking i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--matachin-orange);
  animation: matachin-chatbot-dot 1s ease-in-out infinite;
}

.matachin-chatbot__thinking i:nth-child(2) { animation-delay: 150ms; }
.matachin-chatbot__thinking i:nth-child(3) { animation-delay: 300ms; }

.matachin-chatbot__controls {
  padding: 10px 14px 12px;
  border-top: 1px solid rgba(23, 47, 56, 0.13);
  background: rgba(255, 255, 255, 0.45);
}

.matachin-chatbot__prompts {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}

.matachin-chatbot__prompts button {
  flex: 0 0 auto;
  margin: 0;
  padding: 6px 9px;
  border: 1px solid rgba(15, 75, 80, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--matachin-teal);
  cursor: pointer;
  font-size: 9px;
}

.matachin-chatbot__prompts button:hover,
.matachin-chatbot__prompts button:focus-visible {
  background: var(--matachin-teal);
  color: #fff;
}

.matachin-chatbot__form {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 7px 7px 12px;
  border: 1px solid rgba(23, 47, 56, 0.17);
  border-radius: 16px;
  background: #fff;
}

.matachin-chatbot__form input {
  min-width: 0;
  flex: 1;
  margin: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--matachin-ink);
  font: 12px Arial, Helvetica, sans-serif;
}

.matachin-chatbot__form button {
  width: 36px;
  height: 36px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 11px;
  background: var(--matachin-orange);
  color: #fff;
  cursor: pointer;
  font-size: 17px;
}

.matachin-chatbot__form button:disabled,
.matachin-chatbot__prompts button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.matachin-chatbot__note {
  display: block;
  margin-top: 6px;
  color: #909da0;
  font-size: 8px;
  text-align: center;
}

.matachin-chatbot__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

@keyframes matachin-chatbot-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes matachin-chatbot-dot {
  0%, 100% { opacity: 0.4; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-4px); }
}

@media (max-width: 600px) {
  #matachin-chatbot.matachin-chatbot {
    right: 10px;
    bottom: 8px;
  }

  .matachin-chatbot__toggle img {
    width: 82px;
    height: 90px;
  }

  .matachin-chatbot__panel {
    position: fixed;
    right: 10px;
    bottom: 100px;
    left: 10px;
    width: auto;
    height: calc(100dvh - 118px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .matachin-chatbot__panel,
  .matachin-chatbot__toggle img,
  .matachin-chatbot__thinking i {
    animation: none;
    transition: none;
  }
}
