.tp-aiq {
  margin: 32px 0;
  padding: 20px;
  border: 1px solid #d9e2ea;
  border-radius: 8px;
  background: #f7fafc;
}

.tp-aiq__header {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.tp-aiq__header h2,
.tp-aiq-modal__panel h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.tp-aiq__open,
.tp-aiq-modal__form button {
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  color: #fff;
  background: #0f5b7f;
  cursor: pointer;
  font-weight: 700;
}

.tp-aiq__chips,
.tp-aiq-modal__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tp-aiq__chip {
  border: 1px solid #bdd0dc;
  border-radius: 999px;
  padding: 7px 11px;
  color: #183b4c;
  background: #fff;
  cursor: pointer;
  font-size: 0.92rem;
}

.tp-aiq__open:hover,
.tp-aiq-modal__form button:hover {
  background: #0b4865;
}

.tp-aiq__chip:hover {
  border-color: #0f5b7f;
}

.tp-aiq-is-open {
  overflow: hidden;
}

.tp-aiq-modal[hidden] {
  display: none;
}

.tp-aiq-modal {
  position: fixed;
  z-index: 99999;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
}

.tp-aiq-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 21, 30, 0.58);
}

.tp-aiq-modal__panel {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
}

.tp-aiq-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #eef3f6;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.tp-aiq-modal__suggestions {
  margin: 18px 0;
}

.tp-aiq-modal__form {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.tp-aiq-modal__form label {
  font-weight: 700;
}

.tp-aiq-modal__form textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #c7d4dd;
  border-radius: 6px;
  padding: 10px;
  resize: vertical;
  font: inherit;
}

.tp-aiq-modal__answer {
  min-height: 24px;
  margin-top: 18px;
  padding: 14px;
  border-radius: 6px;
  background: #f4f7f9;
  white-space: pre-wrap;
}

.tp-aiq-modal__answer:empty {
  display: none;
}

.tp-aiq-modal__answer[data-state='error'] {
  color: #8a1f11;
  background: #fff0ec;
}

.tp-aiq-modal__answer[data-state='loading'] {
  color: #415565;
}

@media (max-width: 640px) {
  .tp-aiq {
    padding: 16px;
  }

  .tp-aiq__header {
    align-items: flex-start;
    flex-direction: column;
  }

  .tp-aiq__open,
  .tp-aiq-modal__form button {
    width: 100%;
  }

  .tp-aiq-modal__panel {
    padding: 20px;
  }
}
