/* Summit AI chat widget — matches dark theme + brand gradients */

.summit-chat {
  --chat-z: 1080;
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  left: auto;
  bottom: max(1rem, env(safe-area-inset-bottom));
  z-index: var(--chat-z);
  font-family: var(--font-sans);
}

.summit-chat__launcher {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.15rem 0.85rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: var(--grad-brand);
  color: #071008;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), var(--shadow-glow-green);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.summit-chat__launcher:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 40px rgba(138, 197, 62, 0.35);
}

.summit-chat__launcher[aria-expanded="true"] {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.92);
}

.summit-chat__launcher-icon {
  display: inline-flex;
  width: 1.65rem;
  height: 1.65rem;
  align-items: center;
  justify-content: center;
}

.summit-chat__panel {
  position: absolute;
  right: 0;
  left: auto;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 2rem));
  height: min(620px, calc(100dvh - 2rem));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(16, 20, 28, 0.98) 0%, rgba(7, 9, 14, 0.98) 100%);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  overflow: hidden;
  transform-origin: bottom right;
  animation: summit-chat-in 0.24s ease;
}

.summit-chat__panel[hidden] {
  display: none !important;
}

@keyframes summit-chat-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.summit-chat__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1rem 0.95rem;
  border-bottom: 1px solid var(--color-border);
  background: linear-gradient(135deg, rgba(138, 197, 62, 0.12), rgba(0, 172, 237, 0.08));
}

.summit-chat__title {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
}

.summit-chat__subtitle {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.75rem;
  color: var(--color-muted);
}

.summit-chat__close {
  display: inline-flex;
  width: 2rem;
  height: 2rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--color-text);
  cursor: pointer;
}

.summit-chat__close:hover {
  background: rgba(255, 255, 255, 0.12);
}

.summit-chat__messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.summit-chat__welcome {
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.summit-chat__bubble {
  max-width: 92%;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  font-size: 0.875rem;
  line-height: 1.55;
  word-break: break-word;
}

.summit-chat__bubble--user {
  align-self: flex-end;
  background: rgba(138, 197, 62, 0.18);
  border: 1px solid rgba(138, 197, 62, 0.35);
  color: var(--color-text);
}

.summit-chat__bubble--assistant {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
  color: var(--color-text);
}

.summit-chat__bubble--assistant a {
  color: var(--color-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.summit-chat__bubble--error {
  align-self: stretch;
  background: rgba(220, 53, 69, 0.12);
  border: 1px solid rgba(220, 53, 69, 0.35);
  color: #ffb4bc;
}

.summit-chat__typing {
  align-self: flex-start;
  display: inline-flex;
  gap: 0.35rem;
  padding: 0.75rem 0.95rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--color-border);
}

.summit-chat__typing span {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: var(--color-muted);
  animation: summit-chat-dot 1.2s infinite ease-in-out;
}

.summit-chat__typing span:nth-child(2) { animation-delay: 0.15s; }
.summit-chat__typing span:nth-child(3) { animation-delay: 0.3s; }

@keyframes summit-chat-dot {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-3px); }
}

.summit-chat__suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0 1rem 0.75rem;
}

.summit-chat__chip {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.summit-chat__chip:hover {
  background: rgba(138, 197, 62, 0.12);
  border-color: rgba(138, 197, 62, 0.35);
}

.summit-chat__form {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1rem 1rem;
  border-top: 1px solid var(--color-border);
  background: rgba(0, 0, 0, 0.22);
}

.summit-chat__input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 7rem;
  resize: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.04);
  color: var(--color-text);
  font: inherit;
  font-size: 0.875rem;
  line-height: 1.45;
}

.summit-chat__input:focus {
  outline: none;
  border-color: rgba(138, 197, 62, 0.55);
  box-shadow: 0 0 0 3px rgba(138, 197, 62, 0.15);
}

.summit-chat__send {
  display: inline-flex;
  width: 2.5rem;
  height: 2.5rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 12px;
  background: var(--grad-brand);
  color: #071008;
  cursor: pointer;
}

.summit-chat__send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 480px) {
  .summit-chat__launcher-label {
    display: none;
  }

  .summit-chat__launcher {
    width: 3.35rem;
    height: 3.35rem;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
  }

  .summit-chat__panel {
    width: calc(100vw - 1.25rem);
    height: min(78dvh, 620px);
  }
}
