.anp-root,
.anp-root * {
  box-sizing: border-box;
}

.anp-root {
  --anp-green: #2f6b45;
  --anp-green-dark: #204c31;
  --anp-cream: #f7f4ec;
  --anp-ink: #17211b;
  --anp-muted: #5d665f;
  --anp-border: #d9dfda;
  --anp-mobile-bottom: 24px;
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 999999;
  color: var(--anp-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.45;
}

.anp-launcher {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 11px 18px 11px 11px;
  border: 0;
  border-radius: 999px;
  background: var(--anp-green);
  color: #fff;
  box-shadow: 0 8px 28px rgba(18, 35, 24, 0.28);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.anp-launcher:hover,
.anp-launcher:focus-visible {
  background: var(--anp-green-dark);
}

.anp-launcher-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--anp-green-dark);
  font-size: 20px;
  font-weight: 800;
}

.anp-launcher-open {
  visibility: hidden;
}

.anp-panel {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  width: min(390px, calc(100vw - 32px));
  height: min(640px, calc(100vh - 40px));
  max-height: 720px;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--anp-border);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 16px 50px rgba(18, 35, 24, 0.26);
}

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

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

.anp-header strong,
.anp-header span {
  display: block;
}

.anp-header strong {
  font-size: 18px;
}

.anp-header span {
  margin-top: 1px;
  font-size: 12px;
  opacity: 0.86;
}

.anp-close {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 30px;
  line-height: 1;
}

.anp-close:hover,
.anp-close:focus-visible {
  background: rgba(255, 255, 255, 0.16);
}

.anp-transcript {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: var(--anp-cream);
  overscroll-behavior: contain;
}

.anp-message {
  width: fit-content;
  max-width: 88%;
  margin: 0 0 12px;
  padding: 11px 13px;
  border-radius: 15px;
  overflow-wrap: anywhere;
}

.anp-message-bot {
  border: 1px solid var(--anp-border);
  border-bottom-left-radius: 4px;
  background: #fff;
}

.anp-message-user {
  margin-left: auto;
  border-bottom-right-radius: 4px;
  background: var(--anp-green);
  color: #fff;
}

.anp-controls {
  display: grid;
  gap: 8px;
  max-height: 245px;
  overflow-y: auto;
  padding: 12px 14px;
  border-top: 1px solid var(--anp-border);
  background: #fff;
}

.anp-choice,
.anp-input-row button {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--anp-green);
  border-radius: 10px;
  background: #fff;
  color: var(--anp-green-dark);
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

.anp-choice:hover,
.anp-choice:focus-visible,
.anp-input-row button:hover,
.anp-input-row button:focus-visible {
  background: #edf5ef;
  color: var(--anp-green-dark);
}

.anp-primary,
.anp-input-row button {
  background: var(--anp-green);
  color: #fff;
}

.anp-primary:hover,
.anp-primary:focus-visible,
.anp-input-row button:hover,
.anp-input-row button:focus-visible {
  background: var(--anp-green-dark);
  color: #fff;
}

.anp-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

.anp-input-row input {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #8d978f;
  border-radius: 9px;
  background: #fff;
  color: var(--anp-ink);
  font: inherit;
}

.anp-input-row button {
  width: auto;
}

.anp-footer {
  padding: 8px 12px 10px;
  background: #fff;
  color: var(--anp-muted);
  font-size: 11px;
  text-align: center;
}

.anp-root button:focus-visible,
.anp-root a:focus-visible,
.anp-root input:focus-visible {
  outline: 3px solid #f4ba41;
  outline-offset: 2px;
}

@media (max-width: 782px) {
  .anp-root {
    right: 12px;
    bottom: var(--anp-mobile-bottom);
  }

  .anp-launcher {
    min-height: 50px;
  }

  .anp-panel {
    position: fixed;
    right: 8px;
    bottom: 8px;
    left: 8px;
    width: auto;
    height: min(680px, calc(100dvh - 16px));
    max-height: none;
    border-radius: 18px;
  }

  .anp-controls {
    max-height: 42vh;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .anp-panel {
    animation: anp-enter 160ms ease-out;
  }

  @keyframes anp-enter {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
}

@media print {
  .anp-root {
    display: none !important;
  }
}

