/* Página dedicada — Assistente Royal IA (MVP chat operacional) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

body.assist-page {
  overflow-x: hidden;
}

.assist-shell {
  min-height: calc(100vh - 5rem);
  padding: clamp(1rem, 3vw, 2rem) 1rem clamp(2.5rem, 5vw, 3rem);
  background:
    radial-gradient(120% 80% at 10% -10%, rgba(10, 42, 102, 0.08), transparent),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.assist-layout {
  max-width: 46rem;
  margin: 0 auto;
}

.assist-hero-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08), 0 4px 12px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  animation: assist-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes assist-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.assist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.35rem;
  background: linear-gradient(135deg, #071b33 0%, #0a2a66 55%, #123e7c 100%);
  color: #fff;
}

.assist-header__left {
  display: flex;
  gap: 0.85rem;
  min-width: 0;
}

.assist-header__avatar {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 14px;
  background: linear-gradient(145deg, #f4b000, #d4a017);
  color: #071b33;
  font-weight: 900;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.assist-header__titles h1 {
  margin: 0;
  font-size: clamp(1.12rem, 2.8vw, 1.35rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.assist-header__sub {
  margin: 0.25rem 0 0;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.4;
}

.assist-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.73rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.95);
  margin-top: 0.65rem;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.2);
  border: 1px solid rgba(34, 197, 94, 0.45);
}

.assist-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.25);
  animation: assist-pulse 2.2s ease-in-out infinite;
}

@keyframes assist-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.55;
  }
}

.assist-body {
  padding: 1rem 1.25rem 1.25rem;
}

.assist-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.assist-chip {
  border: 1px solid rgba(10, 42, 102, 0.18);
  background: #f8fafc;
  color: #0a2a66;
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.assist-chip:hover {
  background: #fff;
  border-color: rgba(212, 160, 23, 0.55);
  transform: translateY(-1px);
}

.assist-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(244, 176, 0, 0.35);
}

.assist-msg-box {
  min-height: 14rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  padding: 0.75rem 0.65rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #f8fafc, #ffffff);
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.assist-support-card {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(10, 42, 102, 0.06), rgba(244, 176, 0, 0.06));
  border: 1px solid rgba(10, 42, 102, 0.1);
}

.assist-support-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #0a2a66;
}

.assist-support-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #334155;
}

.assist-support-card__list li {
  margin-bottom: 0.35rem;
}

.assist-support-card__k {
  display: inline-block;
  min-width: 5.5rem;
  font-weight: 700;
  color: #0f172a;
}

.assist-support-card__list a {
  color: #0a2a66;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.assist-support-card__list a:hover {
  color: #c99500;
}

.assist-support-card__muted {
  color: #64748b;
  font-style: italic;
}

.assist-typing {
  font-size: 0.8125rem;
  color: #475569;
  font-style: italic;
  padding: 0 0 0.5rem;
}

.assist-typing--inner {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.assist-typing__label {
  font-style: italic;
  font-weight: 600;
  color: #475569;
}

.assist-dots span {
  display: inline-block;
  width: 0.35rem;
  height: 0.35rem;
  border-radius: 999px;
  background: #94a3b8;
  margin-right: 0.15rem;
  animation: assist-dot 1.2s infinite ease-in-out;
}

.assist-dots span:nth-child(2) {
  animation-delay: 0.18s;
}
.assist-dots span:nth-child(3) {
  animation-delay: 0.34s;
}

@keyframes assist-dot {
  0%,
  80%,
  100% {
    transform: scale(0.75);
    opacity: 0.45;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

.assist-msg {
  margin-bottom: 0.85rem;
}

.assist-msg__row {
  display: flex;
  gap: 0.65rem;
  align-items: flex-end;
}

.assist-msg--user .assist-msg__row {
  flex-direction: row-reverse;
}

.assist-msg__avatar {
  flex-shrink: 0;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 10px;
  font-size: 0.58rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
}

.assist-msg__avatar--user {
  background: #e2e8f0;
  color: #334155;
}

.assist-msg__avatar--bot {
  background: linear-gradient(145deg, #0a2a66, #123e7c);
  color: #fff;
  flex-direction: column;
  gap: 0;
  font-size: 0.5rem;
  padding: 0.15rem;
}

.assist-msg__avatar-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: #4ade80;
}

.assist-msg__avatar-label {
  font-size: 0.55rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.assist-msg__body {
  max-width: min(100%, 85%);
  min-width: 0;
}

.assist-msg__bubble {
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  font-size: 0.9rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.assist-msg--user .assist-msg__bubble {
  background: #0a2a66;
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.assist-msg--bot .assist-msg__bubble--bot {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-left: 3px solid rgba(212, 160, 23, 0.65);
  border-bottom-left-radius: 4px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.assist-rich p {
  margin: 0 0 0.5rem;
}

.assist-rich p:last-child {
  margin-bottom: 0;
}

.assist-copilot-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.65rem;
}

.assist-copilot-action {
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  border: 1px solid rgba(10, 42, 102, 0.2);
  background: #f8fafc;
  color: #0a2a66;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.assist-copilot-action:hover {
  background: #fff;
  border-color: rgba(212, 160, 23, 0.55);
}

.assist-suggestions-kicker {
  margin: 0.55rem 0 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.assist-suggestion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}

.assist-suggestion-chip {
  font-size: 0.72rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  background: rgba(10, 42, 102, 0.06);
  color: #0a2a66;
  border: 1px solid rgba(10, 42, 102, 0.1);
}

.assist-escalate-note {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
  font-weight: 600;
  color: #b45309;
}

.assist-msg__path {
  color: #0a2a66;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.assist-msg__path:hover {
  color: #123e7c;
}

.assist-msg__time {
  display: block;
  font-size: 0.68rem;
  color: #94a3b8;
  margin-top: 0.28rem;
}

.assist-msg--user .assist-msg__time {
  text-align: right;
}

.assist-form-wrap {
  margin-top: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.assist-form {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.assist-input {
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  resize: vertical;
  padding: 0.65rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.45;
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.assist-input:focus {
  outline: none;
  border-color: rgba(10, 42, 102, 0.45);
  box-shadow: 0 0 0 3px rgba(244, 176, 0, 0.22);
}

.assist-send {
  flex-shrink: 0;
  min-width: 6.5rem;
  min-height: 48px;
  padding: 0 1.1rem;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  font-weight: 800;
  font-size: 0.88rem;
  background: linear-gradient(120deg, #f4b000, #d4a017);
  color: #071b33;
  box-shadow: 0 10px 24px rgba(244, 176, 0, 0.28);
  transition: transform 0.2s ease, filter 0.2s ease;
}

.assist-send:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.assist-send:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.assist-footnote {
  font-size: 0.75rem;
  color: #64748b;
  line-height: 1.45;
}

.assist-status-line {
  min-height: 1.25rem;
  font-size: 0.78rem;
  color: #b45309;
  font-weight: 600;
}

.assist-quick-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}

.assist-quick-row a {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #0a2a66;
}

.assist-quick-row a:hover {
  color: #f4b000;
}

@media (max-width: 640px) {
  .assist-msg-box {
    max-height: min(48vh, 360px);
  }

  .assist-form {
    flex-direction: column;
  }

  .assist-send {
    width: 100%;
  }

  .assist-msg__body {
    max-width: 92%;
  }
}
