:root {
  --ajolo-chat-bg: #071629;
  --ajolo-chat-panel: #0a1f36;
  --ajolo-chat-panel-2: #0f2b4b;
  --ajolo-chat-border: #1f4062;
  --ajolo-chat-text: #e9f2fb;
  --ajolo-chat-muted: #9fb4cc;
  --ajolo-chat-accent: #1fd6df;
  --ajolo-chat-accent-2: #0cbfca;
  --ajolo-chat-user: #123256;
  --ajolo-chat-bot: #0f2744;
  --ajolo-chat-shadow: 0 24px 54px rgba(0, 0, 0, 0.42);
}

#ajoloChatRoot {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  z-index: 70;
  font-family: Manrope, sans-serif;
}

.ajolo-chat-launcher-wrap {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.ajolo-chat-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #0d2a47;
  color: #e7f6ff;
  border: 1px solid #1b4267;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.ajolo-chat-tooltip.is-visible {
  opacity: 1;
}

.ajolo-chat-launcher {
  width: 58px;
  height: 58px;
  border-radius: 999px;
  border: 1px solid #1f9461;
  background: linear-gradient(145deg, #25cf79, #12b567);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 18px 35px rgba(19, 167, 96, 0.35);
  position: relative;
}

.ajolo-chat-launcher .material-symbols-outlined {
  font-size: 28px;
}

.ajolo-chat-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #27f0bd;
  border: 2px solid #0f2a45;
  position: absolute;
  top: 8px;
  right: 9px;
  animation: ajoloPulse 1.9s infinite;
}

@keyframes ajoloPulse {
  0% { box-shadow: 0 0 0 0 rgba(39, 240, 189, 0.48); }
  70% { box-shadow: 0 0 0 10px rgba(39, 240, 189, 0); }
  100% { box-shadow: 0 0 0 0 rgba(39, 240, 189, 0); }
}

.ajolo-chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  left: auto;
  width: min(370px, calc(100dvw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right)));
  max-width: calc(100dvw - 24px - env(safe-area-inset-left) - env(safe-area-inset-right));
  height: min(640px, calc(100vh - 104px));
  background: linear-gradient(180deg, #081c31 0%, #061629 100%);
  border: 1px solid var(--ajolo-chat-border);
  border-radius: 16px;
  box-shadow: var(--ajolo-chat-shadow);
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.22s ease, transform 0.22s ease;
  overflow: hidden;
}

.ajolo-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.ajolo-chat-panel.is-minimized {
  height: auto;
  grid-template-rows: auto;
}

.ajolo-chat-header {
  padding: 12px;
  border-bottom: 1px solid #173553;
  background: linear-gradient(180deg, #102c49 0%, #0b223a 100%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.ajolo-chat-brand {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--ajolo-chat-text);
}

.ajolo-chat-brand img {
  width: 24px;
  height: 24px;
  border-radius: 6px;
}

.ajolo-chat-brand strong {
  font-size: 14px;
  display: block;
  line-height: 1.1;
}

.ajolo-chat-brand small {
  color: var(--ajolo-chat-muted);
  font-size: 11px;
}

.ajolo-chat-header-actions {
  display: flex;
  gap: 6px;
}

.ajolo-chat-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid #2a4f73;
  background: #0f2944;
  color: #c9deef;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.ajolo-chat-icon-btn .material-symbols-outlined {
  font-size: 19px;
}

.ajolo-chat-body {
  padding: 12px;
  overflow: auto;
  display: grid;
  gap: 8px;
  align-content: start;
  scrollbar-width: thin;
  scrollbar-color: #2f5274 #0b2037;
}

.ajolo-chat-msg {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 12px;
  line-height: 1.5;
  font-size: 13px;
}

.ajolo-chat-msg.bot {
  background: var(--ajolo-chat-bot);
  color: #e9f2fb;
  border: 1px solid #234569;
  border-top-left-radius: 4px;
}

.ajolo-chat-msg.user {
  margin-left: auto;
  background: var(--ajolo-chat-user);
  color: #dbedff;
  border: 1px solid #2d5883;
  border-top-right-radius: 4px;
}

.ajolo-chat-controls {
  padding: 12px;
  border-top: 1px solid #173553;
  background: #071a2f;
  display: grid;
  gap: 8px;
}

.ajolo-chat-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ajolo-chat-chip,
.ajolo-chat-btn,
.ajolo-chat-card button,
.ajolo-chat-submit {
  border: 1px solid #2a5279;
  background: #0f2945;
  color: #e8f4ff;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ajolo-chat-chip:hover,
.ajolo-chat-btn:hover,
.ajolo-chat-card button:hover,
.ajolo-chat-submit:hover {
  border-color: #3d6891;
}

.ajolo-chat-btn.is-primary,
.ajolo-chat-submit {
  background: linear-gradient(145deg, var(--ajolo-chat-accent), var(--ajolo-chat-accent-2));
  color: #032027;
  border-color: transparent;
}

.ajolo-chat-grid {
  display: grid;
  gap: 8px;
}

.ajolo-chat-card {
  border: 1px solid #234669;
  background: #0c243e;
  border-radius: 12px;
  padding: 11px;
}

.ajolo-chat-card h4 {
  margin: 0;
  color: #f5fbff;
  font-size: 14px;
}

.ajolo-chat-card p {
  margin: 6px 0 10px;
  color: #bdd0e2;
  font-size: 12px;
}

.ajolo-chat-form {
  display: grid;
  gap: 8px;
}

.ajolo-chat-form label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: #9eb4c8;
  text-transform: uppercase;
  letter-spacing: .08em;
  font-weight: 800;
}

.ajolo-chat-form input {
  width: 100%;
  border: 1px solid #2b5379;
  background: #0b223a;
  color: #e9f6ff;
  border-radius: 9px;
  padding: 10px;
  font: inherit;
  font-size: 13px;
}

.ajolo-chat-help {
  color: #9db4ca;
  font-size: 11px;
  margin: 0;
}

.ajolo-chat-error {
  color: #ffb4b4;
  background: rgba(153, 27, 27, 0.25);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  padding: 8px 9px;
  font-size: 12px;
}

.ajolo-chat-panel.is-minimized .ajolo-chat-body,
.ajolo-chat-panel.is-minimized .ajolo-chat-controls {
  display: none;
}

@media (max-width: 768px) {
  #ajoloChatRoot {
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .ajolo-chat-panel {
    left: auto;
    width: calc(100dvw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    max-width: calc(100dvw - 16px - env(safe-area-inset-left) - env(safe-area-inset-right));
    height: min(620px, calc(100vh - 88px));
    bottom: 68px;
    border-radius: 14px;
  }

  .ajolo-chat-tooltip {
    display: none;
  }
}


