@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&family=Orbitron:wght@700;800;900&display=swap');

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

.aac-chat-root [hidden] {
  display: none !important;
}

.aac-chat {
  --aac-bg: #f7f8fb;
  --aac-surface: #ffffff;
  --aac-surface-2: #f1f5f9;
  --aac-text: #10131a;
  --aac-muted: #5f6878;
  --aac-border: rgba(16,19,26,.12);
  --aac-border-strong: rgba(16,19,26,.18);
  --aac-green: #04d99f;
  --aac-green-soft: rgba(4,217,159,.13);
  --aac-blue: #2563eb;
  --aac-blue-soft: rgba(37,99,235,.09);
  --aac-shadow: 0 24px 70px rgba(15,23,42,.18);
  --aac-shadow-soft: 0 10px 28px rgba(15,23,42,.06);
  color: var(--aac-text);
  font-family: Inter, Arial, Helvetica, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: geometricPrecision;
}

.aac-chat button,
.aac-chat textarea {
  font-family: inherit;
}

.aac-chat.is-floating {
  position: fixed;
  z-index: 2147483000;
  right: 18px;
  bottom: 18px;
  width: auto;
  height: auto;
  pointer-events: none;
}

.aac-chat.is-floating.is-left {
  right: auto;
  left: 18px;
}

.aac-bubble,
.aac-panel {
  pointer-events: auto;
}

.aac-bubble {
  width: 64px;
  height: 64px;
  border: 0;
  border-radius: 22px;
  background: var(--aac-text);
  color: #fff;
  box-shadow: 0 18px 44px rgba(15,23,42,.22);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
}

.aac-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 52px rgba(15,23,42,.25);
}

.aac-chat.is-open .aac-bubble {
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px) scale(.92);
}

.aac-bubble span {
  font-family: Orbitron, Inter, Arial, sans-serif;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.aac-panel {
  width: min(430px, calc(100vw - 28px));
  height: min(680px, calc(100vh - 106px));
  max-height: calc(100vh - 106px);
  background: rgba(255,255,255,.96);
  border: 1px solid var(--aac-border);
  border-radius: 30px;
  box-shadow: var(--aac-shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0,1fr) auto auto auto;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.aac-chat.is-floating .aac-panel {
  position: absolute;
  right: 0;
  bottom: 0;
}

.aac-chat.is-left .aac-panel {
  right: auto;
  left: 0;
}

.aac-chat.is-inline .aac-panel {
  width: 100%;
  height: 620px;
  max-height: 80vh;
  position: relative;
}

.aac-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 15px;
  border-bottom: 1px solid var(--aac-border);
  background:
    radial-gradient(circle at 0 0, rgba(4,217,159,.12), transparent 36%),
    linear-gradient(180deg,#fff,#f8fafc);
}

.aac-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.aac-logo {
  width: 42px;
  height: 42px;
  border-radius: 15px;
  background: var(--aac-green-soft);
  color: #07624c;
  display: grid;
  place-items: center;
  font-family: Orbitron, Inter, Arial, sans-serif;
  font-size: 12px;
  font-weight: 900;
  border: 1px solid rgba(4,217,159,.25);
  flex: 0 0 auto;
}

.aac-brand-copy {
  min-width: 0;
}

.aac-brand strong {
  display: block;
  color: var(--aac-text);
  font-size: 16px;
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -0.026em;
  white-space: nowrap;
}

.aac-brand span {
  display: block;
  color: var(--aac-muted);
  font-size: 12px;
  line-height: 1.2;
  font-weight: 800;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.aac-close {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 15px;
  border: 1px solid var(--aac-border);
  background: #fff;
  color: var(--aac-text);
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 8px 20px rgba(15,23,42,.05);
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
  position: relative;
  z-index: 3;
}

.aac-close:hover {
  transform: translateY(-1px);
  background: var(--aac-surface-2);
  border-color: var(--aac-border-strong);
}

.aac-close span {
  display: block;
  transform: translateY(-1px);
}

.aac-messages {
  min-height: 0;
  padding: 16px;
  overflow: auto;
  background:
    radial-gradient(circle at 18% 0, rgba(4,217,159,.10), transparent 26%),
    var(--aac-bg);
  scroll-behavior: smooth;
}

.aac-msg {
  display: flex;
  margin: 0 0 12px;
}

.aac-msg.is-user {
  justify-content: flex-end;
}

.aac-msg-inner {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--aac-border);
  box-shadow: 0 8px 22px rgba(15,23,42,.045);
  color: var(--aac-text);
  font-size: 14px;
  line-height: 1.58;
  font-weight: 500;
  letter-spacing: -0.006em;
  overflow-wrap: anywhere;
}

.aac-msg.is-user .aac-msg-inner {
  background: var(--aac-text);
  color: #fff;
  border-color: transparent;
}

.aac-msg-inner p {
  margin: 0 0 9px;
}

.aac-msg-inner p:last-child {
  margin-bottom: 0;
}

.aac-msg-inner ul {
  margin: 0 0 9px;
  padding-left: 18px;
}

.aac-msg-inner li {
  margin: 0 0 5px;
}

.aac-msg-inner strong {
  font-weight: 900;
}

.aac-suggestions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid var(--aac-border);
  background: #fff;
  overflow: visible;
}

.aac-suggestions button {
  min-width: 0;
  border: 1px solid var(--aac-border);
  background: var(--aac-surface-2);
  color: var(--aac-text);
  border-radius: 999px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.12;
  font-weight: 900;
  cursor: pointer;
  white-space: normal;
  text-align: center;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  transition: background .2s ease, border-color .2s ease, transform .2s ease;
}

.aac-suggestions button:hover {
  background: #fff;
  border-color: var(--aac-border-strong);
  transform: translateY(-1px);
}

.aac-form {
  display: grid;
  grid-template-columns: minmax(0,1fr) 48px;
  gap: 9px;
  padding: 12px 14px 10px;
  background: #fff;
  border-top: 1px solid var(--aac-border);
}

.aac-form textarea {
  width: 100%;
  height: 48px;
  min-height: 48px;
  max-height: 118px;
  resize: none;
  overflow: hidden;
  border: 1px solid var(--aac-border);
  border-radius: 17px;
  padding: 13px 14px;
  background: #fff;
  color: var(--aac-text);
  font-size: 14px;
  line-height: 1.35;
  outline: 0;
  box-shadow: none;
}

.aac-form textarea:focus {
  border-color: rgba(37,99,235,.38);
  box-shadow: 0 0 0 4px rgba(37,99,235,.08);
}

.aac-form button {
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 17px;
  background: var(--aac-green);
  color: #04110d;
  font-weight: 950;
  font-size: 22px;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  transition: transform .2s ease, opacity .2s ease;
}

.aac-form button:hover {
  transform: translateY(-1px);
}

.aac-form button:disabled,
.aac-form textarea:disabled {
  opacity: .58;
  cursor: not-allowed;
}

.aac-privacy {
  padding: 0 16px 14px;
  background: #fff;
  color: var(--aac-muted);
  font-size: 11px;
  line-height: 1.35;
  text-align: center;
}

.aac-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.aac-dots i {
  width: 7px;
  height: 7px;
  background: var(--aac-muted);
  border-radius: 50%;
  display: block;
  animation: aacDots 1s infinite ease-in-out;
}

.aac-dots i:nth-child(2) {
  animation-delay: .12s;
}

.aac-dots i:nth-child(3) {
  animation-delay: .24s;
}

@keyframes aacDots {
  0%,80%,100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

@media (max-width: 640px) {
  .aac-chat.is-floating {
    left: 11px !important;
    right: 11px !important;
    bottom: 11px;
  }

  .aac-bubble {
    width: 58px;
    height: 58px;
    border-radius: 20px;
    margin-left: auto;
  }

  .aac-chat.is-left .aac-bubble {
    margin-left: 0;
    margin-right: auto;
  }

  .aac-chat.is-floating .aac-panel {
    position: fixed;
    left: 11px !important;
    right: 11px !important;
    bottom: 11px;
    width: auto;
    height: min(78vh, 680px);
    max-height: calc(100vh - 22px);
    border-radius: 26px;
  }

  .aac-chat.is-inline .aac-panel {
    height: 680px;
    max-height: 78vh;
  }

  .aac-head {
    padding: 14px;
  }

  .aac-logo {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .aac-brand strong {
    font-size: 15px;
  }

  .aac-brand span {
    max-width: 225px;
  }

  .aac-close {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 14px;
  }

  .aac-messages {
    padding: 14px;
  }

  .aac-msg-inner {
    max-width: 94%;
    font-size: 14px;
  }

  .aac-suggestions {
    grid-template-columns: 1fr;
    padding: 10px 12px;
  }

  .aac-form {
    grid-template-columns: minmax(0,1fr) 46px;
    padding: 10px 12px 9px;
  }

  .aac-form button {
    width: 46px;
    height: 46px;
    border-radius: 16px;
  }

  .aac-form textarea {
    height: 46px;
    min-height: 46px;
    border-radius: 16px;
  }

  .aac-privacy {
    padding: 0 14px 12px;
    font-size: 10.5px;
  }
}

@media (max-width: 380px) {
  .aac-brand span {
    max-width: 180px;
  }

  .aac-panel {
    border-radius: 22px;
  }
}
