/* TanziTech AI Assistant · Ice Blue SaaS Clean */

.tt-ai-button {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 99999;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(37, 99, 235, 0.20);
  border-radius: 999px;
  padding: 14px 18px;
  background: linear-gradient(135deg, #16a34a, #2563eb);
  color: #ffffff;
  font: 950 14px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  box-shadow: 0 18px 50px rgba(37, 99, 235, 0.22);
  cursor: pointer;
}

.tt-ai-button:hover {
  transform: translateY(-1px);
}

.tt-ai-panel {
  position: fixed;
  right: 22px;
  bottom: 86px;
  z-index: 99999;
  width: min(420px, calc(100vw - 32px));
  max-height: min(680px, calc(100vh - 120px));
  display: none;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 28px;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 20rem),
    radial-gradient(circle at top right, rgba(22, 163, 74, 0.08), transparent 20rem),
    rgba(255, 255, 255, 0.96);
  color: #0f172a;
  box-shadow: 0 28px 90px rgba(15, 23, 42, 0.18);
  backdrop-filter: blur(18px);
}

.tt-ai-panel[data-open="true"] {
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.tt-ai-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.tt-ai-kicker {
  color: #2563eb;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.tt-ai-title {
  margin-top: 5px;
  color: #0f172a;
  font-size: 20px;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.tt-ai-subtitle {
  margin-top: 6px;
  color: #475569;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 600;
}

.tt-ai-close {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  width: 34px;
  height: 34px;
  background: #ffffff;
  color: #0f172a;
  font-weight: 950;
  cursor: pointer;
}

.tt-ai-messages {
  min-height: 280px;
  max-height: 430px;
  overflow-y: auto;
  padding: 18px;
  display: grid;
  gap: 12px;
}

.tt-ai-message {
  border-radius: 18px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}

.tt-ai-message.user {
  justify-self: end;
  max-width: 86%;
  background: linear-gradient(135deg, #16a34a, #2563eb);
  color: #ffffff;
}

.tt-ai-message.assistant {
  justify-self: start;
  max-width: 92%;
  background: #f8fbff;
  border: 1px solid rgba(37, 99, 235, 0.12);
  color: #334155;
}

.tt-ai-message.assistant strong {
  color: #0f172a;
}

.tt-ai-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
}

.tt-ai-suggestion {
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #1d4ed8;
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}

.tt-ai-form {
  display: grid;
  gap: 10px;
  padding: 14px 18px 18px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.tt-ai-input {
  width: 100%;
  min-height: 82px;
  resize: vertical;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 18px;
  background: #ffffff;
  color: #0f172a;
  padding: 12px 14px;
  font: 600 14px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  outline: none;
}

.tt-ai-input::placeholder {
  color: #94a3b8;
}

.tt-ai-submit {
  justify-self: end;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #16a34a, #2563eb);
  color: #ffffff;
  padding: 12px 16px;
  font: 950 13px/1 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  cursor: pointer;
  box-shadow: 0 14px 38px rgba(37, 99, 235, 0.18);
}

.tt-ai-submit:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

@media (max-width: 720px) {
  .tt-ai-button {
    right: 16px;
    bottom: 16px;
  }

  .tt-ai-panel {
    right: 16px;
    bottom: 76px;
    width: calc(100vw - 32px);
  }
}

/* Hardening override: keep TanziTech AI as a compact floating widget. */
[data-tt-ai-assistant="button"],
.tt-ai-button {
  position: fixed !important;
  right: 22px !important;
  bottom: 22px !important;
  left: auto !important;
  top: auto !important;
  z-index: 2147483000 !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  max-width: max-content !important;
  margin: 0 !important;
  transform: none !important;
}

[data-tt-ai-assistant="panel"],
.tt-ai-panel {
  position: fixed !important;
  right: 22px !important;
  bottom: 86px !important;
  left: auto !important;
  top: auto !important;
  z-index: 2147482999 !important;
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: calc(100vw - 32px) !important;
  max-height: min(680px, calc(100vh - 120px)) !important;
  overflow: hidden !important;
  margin: 0 !important;
  transform: none !important;
}

.tt-ai-panel:not(.open):not([data-open="true"]) {
  display: none !important;
}

.tt-ai-messages {
  max-height: min(440px, calc(100vh - 280px)) !important;
  overflow-y: auto !important;
}

@media (max-width: 720px) {
  [data-tt-ai-assistant="button"],
  .tt-ai-button {
    right: 16px !important;
    bottom: 16px !important;
  }

  [data-tt-ai-assistant="panel"],
  .tt-ai-panel {
    right: 16px !important;
    bottom: 76px !important;
    width: calc(100vw - 32px) !important;
    max-height: calc(100vh - 110px) !important;
  }
}
