:root {
  --semco-maya-bg: #ffffff;
  --semco-maya-text: #1f2933;
  --semco-maya-muted: #69737d;
  --semco-maya-border: #e5e7eb;
  --semco-maya-accent: #1f3d2f;
  --semco-maya-accent-contrast: #ffffff;
  --semco-maya-soft: #f4f6f5;
  --semco-maya-user: #1f3d2f;
  --semco-maya-shadow: 0 22px 60px rgba(0, 0, 0, 0.18);
}

.semco-maya,
.semco-maya * {
  box-sizing: border-box;
}

.semco-maya {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 999999;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--semco-maya-text);
}

.semco-maya__launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--semco-maya-accent);
  color: var(--semco-maya-accent-contrast);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.semco-maya__launcher-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #83d8a2;
  box-shadow: 0 0 0 4px rgba(131, 216, 162, 0.15);
}

.semco-maya__panel {
  position: absolute;
  right: 0;
  bottom: 66px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  height: min(620px, calc(100vh - 110px));
  min-height: 420px;
  overflow: hidden;
  border: 1px solid var(--semco-maya-border);
  border-radius: 18px;
  background: var(--semco-maya-bg);
  box-shadow: var(--semco-maya-shadow);
}

.semco-maya__panel[hidden] {
  display: none;
}

.semco-maya__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--semco-maya-border);
  background: var(--semco-maya-bg);
}

.semco-maya__eyebrow {
  margin-bottom: 2px;
  color: var(--semco-maya-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.semco-maya__title {
  font-size: 18px;
  font-weight: 700;
}

.semco-maya__close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--semco-maya-muted);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
}

.semco-maya__close:hover,
.semco-maya__close:focus-visible {
  background: var(--semco-maya-soft);
  color: var(--semco-maya-text);
}

.semco-maya__messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  background: #fbfcfb;
  scroll-behavior: smooth;
}

.semco-maya__row {
  display: flex;
  margin-bottom: 12px;
}

.semco-maya__row--assistant {
  justify-content: flex-start;
}

.semco-maya__row--user {
  justify-content: flex-end;
}

.semco-maya__bubble {
  max-width: 84%;
  padding: 11px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.semco-maya__bubble p {
  margin: 0;
}

.semco-maya__bubble--assistant {
  border: 1px solid var(--semco-maya-border);
  border-bottom-left-radius: 6px;
  background: #ffffff;
}

.semco-maya__bubble--user {
  border-bottom-right-radius: 6px;
  background: var(--semco-maya-user);
  color: #ffffff;
}

.semco-maya__typing {
  padding: 4px 18px 10px;
  background: #fbfcfb;
}

.semco-maya__typing span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 3px;
  border-radius: 50%;
  background: #9aa3aa;
  animation: semco-maya-bounce 1.1s infinite ease-in-out;
}

.semco-maya__typing span:nth-child(2) { animation-delay: 0.15s; }
.semco-maya__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes semco-maya-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30% { transform: translateY(-4px); opacity: 1; }
}

.semco-maya__composer {
  display: flex;
  align-items: flex-end;
  gap: 9px;
  padding: 12px;
  border-top: 1px solid var(--semco-maya-border);
  background: #ffffff;
}

.semco-maya__input {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  padding: 11px 12px;
  border: 1px solid #d8dde2;
  border-radius: 12px;
  outline: none;
  background: #ffffff;
  color: var(--semco-maya-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
}

.semco-maya__input:focus {
  border-color: #9ca8a1;
  box-shadow: 0 0 0 3px rgba(31, 61, 47, 0.08);
}

.semco-maya__send {
  min-width: 66px;
  min-height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--semco-maya-accent);
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
}

.semco-maya__send:disabled,
.semco-maya__input:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.semco-maya__footer {
  padding: 0 14px 12px;
  background: #ffffff;
  color: var(--semco-maya-muted);
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.semco-maya__footer a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 600px) {
  .semco-maya {
    right: 12px;
    bottom: 12px;
  }

  .semco-maya__launcher {
    min-height: 50px;
    padding: 0 16px;
  }

  .semco-maya__panel {
    position: fixed;
    inset: 10px;
    width: auto;
    height: auto;
    min-height: 0;
    border-radius: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .semco-maya__messages {
    scroll-behavior: auto;
  }

  .semco-maya__typing span {
    animation: none;
  }
}

.semco-maya__bubble--assistant a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
