.ai-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 999;
  font-family: var(--sans);
}

.ai-launcher {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: var(--green-dark);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .2);
  font: 600 .9rem var(--sans);
  cursor: pointer;
}

.ai-launcher:hover { background: var(--green); }
.ai-launcher span { font-size: 1.2rem; }

.ai-panel {
  position: absolute;
  right: 0;
  bottom: 72px;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 32px));
  height: 440px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  box-shadow: 0 14px 45px rgba(0, 0, 0, .18);
}

.ai-panel[hidden] { display: none; }

.ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  color: #fff;
  background: var(--green-dark);
}

.ai-header strong,
.ai-header small { display: block; }

.ai-header small {
  margin-top: 3px;
  color: rgba(255, 255, 255, .75);
  font-size: .72rem;
}

.ai-close {
  border: 0;
  color: #fff;
  background: transparent;
  font-size: 1.7rem;
  cursor: pointer;
}

.ai-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.ai-bubble {
  max-width: 88%;
  margin: 0;
  padding: 10px 12px;
  border-radius: 12px;
  font-size: .85rem;
  line-height: 1.5;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.ai-bot {
  align-self: flex-start;
  color: var(--ink);
  background: #f1f2ed;
}

.ai-user {
  align-self: flex-end;
  color: #fff;
  background: var(--green);
}

.ai-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ai-form input {
  min-width: 0;
  flex: 1;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  font: .85rem var(--sans);
}

.ai-form button {
  width: 42px;
  border: 0;
  border-radius: 7px;
  color: #fff;
  background: var(--green);
  cursor: pointer;
}

.ai-form button:disabled { opacity: .6; cursor: wait; }

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

@media (max-width: 480px) {
  .ai-widget { right: 16px; bottom: 16px; }
  .ai-launcher { min-height: 52px; padding: 0 16px; }
  .ai-panel { bottom: 64px; }
}
