:root {
  --ga-assistant-bg: #ffffff;
  --ga-assistant-surface: #f7f7f8;
  --ga-assistant-text: #111319;
  --ga-assistant-muted: #6e6e80;
  --ga-assistant-line: rgba(17, 19, 25, 0.08);
  --ga-assistant-radius: 18px;
}

html,
body.assistant-embed {
  height: 100%;
}

body.assistant-embed {
  margin: 0;
  overflow: hidden;
}

.assistant-page {
  padding: 2rem 0 3.2rem;
}

.assistant-page--embed {
  padding: 0;
  height: 100dvh;
  overflow: hidden;
}

.assistant-page__chat--embed {
  width: 100%;
  max-width: none;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.assistant-page__chat--embed .guardian-assistant {
  height: 100%;
  min-height: 0;
  border-radius: 0;
  border: 0;
  box-shadow: none;
  padding: 0.8rem 0.9rem 0.7rem;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 0.65rem;
  overflow: hidden;
}

.assistant-page__chat--embed .guardian-assistant__messages {
  max-height: none;
  min-height: 0;
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.assistant-page__hero {
  margin-bottom: 1rem;
}

.assistant-page__lead {
  margin-top: 0.35rem;
  color: #38404a;
  max-width: 70ch;
}

.guardian-assistant {
  background: var(--ga-assistant-bg);
  border: 1px solid var(--ga-assistant-line);
  border-radius: var(--ga-assistant-radius);
  box-shadow: 0 16px 48px rgba(9, 16, 25, 0.08);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.assistant-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  border-bottom: 1px solid var(--ga-assistant-line);
  padding-bottom: 0.65rem;
}

.assistant-chat-head__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.assistant-chat-head__brand img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.assistant-chat-head__brand strong {
  font-size: 0.94rem;
  font-weight: 800;
  color: #171d29;
}

.assistant-chat-head__status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid #ccead9;
  background: #ebfff4;
  color: #0f6b43;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
}

.guardian-assistant__messages {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 400px;
  min-height: 220px;
  overflow-y: auto;
  padding: 0.2rem;
}

.ga-message {
  max-width: min(90%, 700px);
  border-radius: 14px;
  padding: 0.8rem 0.95rem;
  line-height: 1.62;
  font-size: 1.03rem;
  word-break: break-word;
}

.ga-message p {
  margin: 0;
  white-space: pre-wrap;
}

.ga-message h1,
.ga-message h2,
.ga-message h3 {
  margin: 0 0 0.45rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.ga-message h1 { font-size: 1.18rem; }
.ga-message h2 { font-size: 1.08rem; }
.ga-message h3 { font-size: 0.98rem; }

.ga-message ul,
.ga-message ol {
  margin: 0.4rem 0 0;
  padding-left: 1.25rem;
}

.ga-message li {
  margin: 0.22rem 0;
}

.ga-message code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  background: rgba(15, 23, 38, 0.08);
  border-radius: 6px;
  padding: 0.05rem 0.34rem;
}

.ga-message blockquote {
  margin: 0.5rem 0 0;
  padding: 0.38rem 0.72rem;
  border-left: 3px solid #98abc8;
  background: rgba(152, 171, 200, 0.14);
  border-radius: 0 8px 8px 0;
}

.ga-message a {
  color: #1f4f7f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ga-message--assistant {
  background: var(--ga-assistant-surface);
  color: var(--ga-assistant-text);
  border-top-left-radius: 6px;
}

.ga-message--user {
  margin-left: auto;
  background: #12151d;
  color: #ffffff;
  border-top-right-radius: 6px;
}

.ga-message--typing {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ga-assistant-muted);
}

.ga-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #8f95a3;
  opacity: 0.75;
  animation: gaTyping 1.4s ease-in-out infinite;
}

.ga-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.ga-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes gaTyping {
  0%, 60%, 100% {
    transform: translateY(0);
    opacity: 0.5;
  }

  30% {
    transform: translateY(-5px);
    opacity: 1;
  }
}

.guardian-assistant__form {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #fff;
  border: 1px solid #d4dbe7;
  border-radius: 999px;
  padding: 0.48rem 0.5rem;
  box-shadow: 0 4px 14px rgba(13, 22, 37, 0.06);
}

.guardian-assistant__attach {
  border: 0;
  background: transparent;
  color: #1c2638;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.08rem;
  line-height: 1;
  cursor: pointer;
}

.assistant-page__chat--embed .guardian-assistant__form {
  margin-top: 0.1rem;
}

.guardian-assistant__input {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ga-assistant-text);
  outline: none;
  resize: none;
  max-height: 180px;
  min-height: 28px;
  font: inherit;
  font-size: 1.02rem;
  line-height: 1.45;
  padding: 0.3rem 0.15rem;
}

.guardian-assistant__mic {
  border: 0;
  background: transparent;
  color: #202a3c;
  border-radius: 999px;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.08rem;
  cursor: pointer;
}

.guardian-assistant__mic.is-listening {
  background: #ffedf0;
  color: #b32235;
  animation: micPulse 1.1s ease-in-out infinite;
}

.guardian-assistant__send {
  border: 0;
  border-radius: 999px;
  background: #0f1218;
  color: #ffffff;
  font-weight: 700;
  width: 44px;
  height: 44px;
  padding: 0;
  font-size: 0.88rem;
  cursor: pointer;
  transition: opacity 160ms ease;
}

.guardian-assistant__attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.ga-attachment-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid #d6dce8;
  background: #f6f9ff;
  border-radius: 999px;
  padding: 0.18rem 0.45rem 0.18rem 0.2rem;
}

.ga-attachment-pill img {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  object-fit: cover;
  border: 1px solid #d2d8e4;
}

.ga-attachment-pill span {
  font-size: 0.8rem;
  font-weight: 600;
  color: #2a344a;
}

.ga-attachment-pill button {
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 999px;
  background: #1b2435;
  color: #fff;
  font-size: 0.95rem;
  line-height: 1;
  cursor: pointer;
}

.guardian-assistant__send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.guardian-assistant__disclaimer {
  margin: 0;
  color: var(--ga-assistant-muted);
  text-align: center;
  font-size: 0.78rem;
}

.ga-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ga-action-chip {
  border: 1px solid #d0d8e7;
  background: #f6f9ff;
  color: #1e3659;
  border-radius: 999px;
  padding: 0.36rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
}

.ga-action-chip:hover {
  background: #eaf2ff;
}

@keyframes micPulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(179, 34, 53, 0.18);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(179, 34, 53, 0);
  }
}

.ga-message-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
}

.ga-msg-btn {
  border: 1px solid #d6dce8;
  background: #fff;
  color: #22314c;
  border-radius: 999px;
  padding: 0.26rem 0.58rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
}

.ga-msg-btn--vote {
  min-width: 32px;
  padding: 0.26rem 0.48rem;
}

.ga-msg-btn:hover {
  background: #f5f8ff;
}

.ga-msg-btn.is-active {
  border-color: #8fb0e1;
  background: #eaf2ff;
  color: #164989;
}

.ga-risk {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.ga-risk-lights {
  display: inline-flex;
  align-items: center;
  gap: 0.24rem;
}

.ga-risk-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  opacity: 0.35;
  transform: scale(0.95);
  transition: transform 140ms ease, opacity 140ms ease;
}

.ga-risk-dot--bajo { background: #15a25e; }
.ga-risk-dot--medio { background: #f2b230; }
.ga-risk-dot--alto { background: #ec7a2d; }
.ga-risk-dot--critico { background: #dc3d4b; }

.ga-risk-dot.is-active {
  opacity: 1;
  transform: scale(1.1);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.06);
}

.ga-risk-label {
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.ga-risk-label--bajo { color: #0f6b43; }
.ga-risk-label--medio { color: #8a6409; }
.ga-risk-label--alto { color: #a14d0f; }
.ga-risk-label--critico { color: #9a1e2b; }

.assistant-page__chat--embed .guardian-assistant__disclaimer {
  line-height: 1.25;
}

.assistant-feature {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

.assistant-feature__head p {
  margin: 0.2rem 0 0;
  color: #474e58;
}

.assistant-feature__link {
  display: inline-flex;
  margin-top: 0.65rem;
}

.guardian-assistant--modal {
  height: 100%;
  min-height: 0;
  padding: 0.95rem 1rem 0.85rem;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto auto;
  gap: 0.7rem;
  overflow: hidden;
  background: #fff;
}

.guardian-assistant--modal .guardian-assistant__messages {
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 0.2rem;
}

.guardian-assistant--modal .guardian-assistant__form {
  margin: 0;
}

.guardian-assistant--modal .guardian-assistant__disclaimer {
  margin: 0;
  line-height: 1.25;
}

@media (max-width: 720px) {
  .guardian-assistant {
    padding: 0.8rem;
  }

  .guardian-assistant__messages {
    max-height: 320px;
    min-height: 190px;
  }

  .guardian-assistant__form {
    gap: 0.5rem;
    padding: 0.6rem;
  }

  .guardian-assistant__send {
    padding: 0.6rem 0.82rem;
    font-size: 0.88rem;
  }

  .guardian-assistant--modal {
    padding: 0.75rem 0.75rem 0.68rem;
    gap: 0.58rem;
  }
}
