.aicra-sllm-toggle {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 2500;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 999px;
  background: #2f5d50;
  color: #fff;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
}

.aicra-sllm-toggle:hover {
  filter: brightness(1.05);
}

.aicra-sllm-panel {
  position: fixed;
  right: 18px;
  bottom: 84px;
  z-index: 2500;
  width: min(92vw, 380px);
  height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
  background: var(--surface, #faf7f2);
  border: 1px solid var(--border, #d6d0c4);
  border-radius: 14px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.aicra-sllm-panel.hidden {
  display: none !important;
}

.aicra-sllm-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid var(--border, #d6d0c4);
  background: var(--surface-alt, #edebe4);
}

.aicra-sllm-header strong {
  display: block;
  font-size: 0.98rem;
}

.aicra-sllm-sub {
  margin: 4px 0 0;
  font-size: 0.75rem;
  color: var(--text-muted, #6b665c);
}

.aicra-sllm-close {
  border: none;
  background: transparent;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: #6b665c;
}

.aicra-sllm-messages {
  flex: 1;
  overflow: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface, #faf7f2);
}

.aicra-sllm-bubble {
  max-width: 92%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.aicra-sllm-bubble--user {
  align-self: flex-end;
  background: #2f5d50;
  color: #fff;
}

.aicra-sllm-bubble--assistant {
  align-self: flex-start;
  background: var(--surface-alt, #edebe4);
  color: var(--text, #1f1c17);
}

.aicra-sllm-bubble-role {
  font-size: 0.7rem;
  opacity: 0.75;
  margin-bottom: 4px;
  font-weight: 600;
}

.aicra-sllm-hint {
  margin: 0;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: #6b665c;
  border-top: 1px solid var(--border, #d6d0c4);
}

.aicra-sllm-hint.hidden,
.aicra-sllm-form.hidden {
  display: none !important;
}

.aicra-sllm-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border, #d6d0c4);
  background: var(--surface, #faf7f2);
}

.aicra-sllm-form textarea {
  width: 100%;
  resize: none;
  border: 1px solid var(--border, #d6d0c4);
  border-radius: 8px;
  padding: 8px 10px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}

.aicra-sllm-send {
  border: none;
  border-radius: 8px;
  padding: 0 14px;
  background: #2f5d50;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.aicra-sllm-send:disabled {
  opacity: 0.6;
  cursor: wait;
}

@media (max-width: 640px) {
  .aicra-sllm-panel {
    right: 10px;
    left: 10px;
    width: auto;
    bottom: 78px;
    max-height: min(70vh, 520px);
  }
  .aicra-sllm-toggle {
    right: 12px;
    bottom: 12px;
  }
  .aicra-sllm-input {
    font-size: 16px;
    min-height: 44px;
  }
  .aicra-sllm-send {
    min-height: 44px;
  }
}
