/* Código Rojo: chat con un chatbot de especialidad */

.cr-chat {
  display: flex;
  width: 100%;
  height: calc(100vh - 150px);
  min-height: 520px;
  background: #fff;
}

/* ---------- Lateral ---------- */

.cr-chat-side-panel {
  --bs-offcanvas-width: min(320px, 88vw);
  --bs-offcanvas-bg: var(--cr-pink-2);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

@media (min-width: 992px) {
  .cr-chat-side {
    flex-shrink: 0;
    width: 300px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--cr-pink-2);
    border-right: 1px solid var(--cr-pink);
  }

  .cr-chat-side-panel {
    flex-grow: 1;
  }
}

.cr-chat-side-head {
  flex-shrink: 0;
  padding: 22px 20px 18px;
  border-bottom: 1px solid var(--cr-pink);
}

.cr-chat-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.cr-chat-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--cr-slate);
  text-decoration: none;
}

.cr-chat-back:hover {
  color: var(--cr-red);
}

.cr-chat-id {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.cr-chat-id-icon {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px var(--cr-pink);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.cr-chat-id-icon img {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.cr-chat-id-text {
  min-width: 0;
}

.cr-chat-id-text .cr-tag {
  display: block;
}

.cr-chat-id h1 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.cr-chat-resources {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}

.cr-chat-resources:not(:has(*)) {
  display: none;
}

.cr-chat-resource {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: var(--cr-radius-sm);
  border: 1px solid var(--cr-pink);
  background: #fff;
  color: var(--cr-ink);
  font: 600 13px/1.35 var(--cr-font);
  text-align: left;
  text-decoration: none;
  transition: border-color 0.2s ease;
}

.cr-chat-resource:hover {
  border-color: var(--cr-red);
  color: var(--cr-ink);
}

.cr-chat-resource i {
  flex-shrink: 0;
  color: var(--cr-red);
  font-size: 18px;
}

/* ---------- Etiquetas ---------- */

.cr-chat-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
}

.cr-chat-tags:not(:has(.badge, .cr-chat-tag-add)) {
  display: none;
}

.cr-chat-tags-list {
  display: contents;
}

/* El color de la etiqueta (inline) pinta el fondo suave y el punto;
   el texto va siempre en tinta para que se lea con cualquier color. */
.cr-chat .chat_tag,
.cr-chat #mensajes .request_tags .badge,
.cr-tag-options > button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  height: 28px;
  padding: 0 4px 0 10px;
  border: none;
  border-radius: var(--cr-radius-pill);
  font: 600 12px/1 var(--cr-font);
  letter-spacing: 0;
  white-space: nowrap;
  -webkit-text-fill-color: var(--cr-ink);
}

.cr-chat .chat_tag::before,
.cr-chat #mensajes .request_tags .badge::before,
.cr-tag-options > button::before {
  content: '';
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
}

.cr-chat .chat_tag .dropdown,
.cr-chat #mensajes .request_tags .badge .dropdown {
  margin: 0 !important;
}

.cr-chat .chat_tag .dropdown-menu,
.cr-chat #mensajes .request_tags .badge .dropdown-menu {
  font-size: 14px;
  font-weight: 500;
  text-align: left;
  -webkit-text-fill-color: currentColor;
}

.cr-chat-tag-add {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 12px 0 10px;
  border: 1px dashed var(--cr-muted-dark);
  border-radius: var(--cr-radius-pill);
  background: transparent;
  color: var(--cr-slate);
  font: 600 12px/1 var(--cr-font);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.cr-chat-tag-add:hover {
  border-color: var(--cr-red);
  background: var(--cr-pink-2);
  color: var(--cr-red);
}

.cr-chat-new {
  margin: 18px 0 0;
}

.cr-chat-new .cr-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
}

.cr-chat-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.cr-chat-action {
  flex: 1 1 0;
  min-width: 0;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: var(--cr-radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--cr-slate);
  font: 600 12px var(--cr-font);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

a.cr-chat-action {
  text-align: center;
  text-decoration: none;
}

.cr-chat-action i {
  font-size: 18px;
}

.cr-chat-action:hover {
  background: #fff;
  border-color: var(--cr-pink);
  color: var(--cr-ink);
}

.cr-chat-action.is-on {
  background: #fff;
  border-color: var(--cr-pink);
  color: var(--cr-red);
}

.cr-chat-action.is-on i {
  animation: crPop 0.35s ease;
}

/* ---------- Conversaciones ---------- */

.cr-chat-convs {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 12px;
}

.cr-chat-convs-title {
  display: block;
  padding: 0 8px 10px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cr-red-dark);
}

.cr-chat-convs-empty {
  margin: 0;
  padding: 4px 8px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--cr-slate);
}

.cr-chat-conv-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cr-chat-conv {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 6px 6px 12px;
  border-radius: var(--cr-radius-sm);
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.cr-chat-conv:hover {
  background: #fff;
  border-color: var(--cr-pink);
}

.cr-chat-conv.is-active {
  background: #fff;
  border-color: var(--cr-pink);
  box-shadow: 0 8px 20px -14px rgba(122, 2, 6, 0.35);
}

.cr-chat-conv-pin {
  flex-shrink: 0;
  color: var(--cr-red);
  font-size: 14px;
}

.cr-chat-conv.is-active:not(:has(.cr-chat-conv-pin))::before {
  content: '';
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cr-red);
}

.cr-chat-conv a {
  flex-grow: 1;
  min-width: 0;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--cr-slate);
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr-chat-conv.is-active a {
  font-weight: 600;
  color: var(--cr-ink);
}

.cr-chat-conv-menu {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--cr-slate);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.cr-chat-conv-menu:hover,
.cr-chat-conv-menu[aria-expanded='true'] {
  background: var(--cr-paper-2);
  color: var(--cr-ink);
}

.cr-chat-conv .dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- Área principal ---------- */

.cr-chat-main {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.cr-chat-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-bottom: 1px solid #f1edeb;
}

.cr-chat-topbar form {
  margin: 0;
}

.cr-chat-topbar-title {
  flex-grow: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cr-chat-topbar .form-control {
  height: 40px;
  text-align: left !important;
}

.cr-chat-topbar .cr-icon-btn.is-on {
  color: var(--cr-red);
}

@media (min-width: 992px) {
  .cr-chat-topbar {
    padding: 8px max(32px, calc((100% - 820px) / 2));
  }

  .cr-chat-topbar.is-mobile-only {
    display: none;
  }
}

/* ---------- Mensajes ---------- */

.cr-chat #mensajes {
  flex-grow: 1;
  min-height: 0;
  overflow-y: auto;
  scroll-behavior: smooth;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 40px max(32px, calc((100% - 820px) / 2)) 24px;
}

.cr-chat #mensajes > * {
  max-width: 100%;
  margin-bottom: 0;
}

.cr-chat #mensajes .message {
  max-width: 100%;
  margin: 0 !important;
}

.cr-chat #mensajes .user-message {
  max-width: min(78%, 640px);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cr-chat #mensajes .justify-content-end > i,
.cr-chat #mensajes .justify-content-end > img {
  display: none;
}

.cr-chat #mensajes .user-message > div:first-child {
  margin: 0 !important;
  padding: 16px 20px !important;
  border-radius: 22px 22px 6px 22px !important;
  background: var(--cr-ink) !important;
  color: #fff !important;
  font-size: 16px !important;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.cr-chat #mensajes .user-message .message-text {
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  color: inherit !important;
  font-size: inherit !important;
  white-space: pre-line;
}

.cr-chat #mensajes .user-message .anonymization-notice {
  margin-top: 8px !important;
  color: #cfcfcf !important;
  font-size: 12px;
}

.cr-chat #mensajes .upload_img {
  max-width: 220px;
  max-height: 220px;
  border-radius: 12px;
}

.cr-chat #mensajes .message-attachments {
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 !important;
  margin-top: 8px;
}

.cr-chat #mensajes .timestamp {
  margin: 0 !important;
  font-size: 12px !important;
  color: var(--cr-muted) !important;
}

.cr-chat #mensajes .justify-content-start {
  width: 100%;
  gap: 16px;
  align-items: flex-start;
}

.cr-chat #mensajes .justify-content-start > img,
.cr-chat #mensajes .justify-content-start > .rounded-circle {
  flex-shrink: 0;
  width: 40px !important;
  height: 40px !important;
  padding: 7px;
  border-radius: 50%;
  border: 1px solid var(--cr-pink);
  background: var(--cr-pink-2);
  object-fit: contain;
}

/* Un img redondeado recorta el logo; el círculo se pinta con el fondo. */
.cr-chat #mensajes .justify-content-start > img {
  padding: 9px;
  border: 0;
  border-radius: 0;
  background: radial-gradient(
    circle closest-side,
    var(--cr-pink-2) calc(100% - 1.5px),
    var(--cr-pink) calc(100% - 1px),
    var(--cr-pink) calc(100% - 0.5px),
    transparent 100%
  );
}

.cr-chat #mensajes .message-container {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cr-chat #mensajes .message-container > div:first-child {
  margin: 0 !important;
  padding: 18px 22px !important;
  border-radius: 22px 22px 22px 6px !important;
  border: 1px solid var(--cr-pink) !important;
  background: var(--cr-pink-2) !important;
  color: #2b2826;
}

.cr-chat #mensajes .chat-response {
  margin: 0 !important;
  background: transparent !important;
  font-size: 16px !important;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.cr-chat .chat-response > :last-child {
  margin-bottom: 0;
}

.cr-chat .chat-response h1,
.cr-chat .chat-response h2,
.cr-chat .chat-response h3,
.cr-chat .chat-response h4 {
  margin: 20px 0 8px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--cr-ink);
}

.cr-chat .chat-response > :first-child {
  margin-top: 0;
}

.cr-chat .chat-response p,
.cr-chat .chat-response ul,
.cr-chat .chat-response ol {
  margin: 0 0 12px;
}

.cr-chat .chat-response li {
  margin: 0 0 6px;
}

.cr-chat .chat-response strong {
  color: var(--cr-ink);
}

.cr-chat .chat-response table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 12px;
  border-collapse: collapse;
  font-size: 14px;
}

.cr-chat .chat-response th,
.cr-chat .chat-response td {
  padding: 6px 10px;
  border: 1px solid var(--cr-pink);
}

.cr-chat .chat-response pre {
  max-width: 100%;
  overflow-x: auto;
}

.cr-chat #mensajes .request_tags {
  flex-wrap: wrap;
}

.cr-chat #mensajes .request_tags:not(:has(*)) {
  display: none !important;
}

.cr-chat #mensajes .message-container > .d-flex:last-child {
  flex-wrap: wrap;
  gap: 4px 12px;
}

.cr-chat #mensajes .message-container .d-flex.gap-1 {
  flex-wrap: wrap;
  align-items: center !important;
}

.cr-chat #mensajes .message-container .btn-sm {
  width: 36px;
  height: 36px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cr-slate);
  font-size: 15px;
}

.cr-chat #mensajes .message-container .btn-sm:hover,
.cr-chat #mensajes .message-container .btn-sm[aria-expanded='true'] {
  background: var(--cr-paper-2);
  color: var(--cr-ink);
}

.cr-chat #mensajes .message-container .btn-sm.active,
.cr-chat #mensajes .message-container .btn-sm.btn-primary {
  background: var(--cr-pink);
  color: var(--cr-red);
}

.cr-chat #mensajes .message-container .btn-outline-secondary {
  width: auto;
  padding: 0 14px;
  border-radius: var(--cr-radius-pill);
  font-size: 13px;
}

.cr-chat #mensajes .request_tags .btn-sm,
.cr-chat .chat_tag .btn-sm {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  font-size: 13px;
  -webkit-text-fill-color: var(--cr-slate);
}

.cr-chat #mensajes .request_tags .btn-sm:hover,
.cr-chat #mensajes .request_tags .btn-sm[aria-expanded='true'],
.cr-chat .chat_tag .btn-sm:hover,
.cr-chat .chat_tag .btn-sm[aria-expanded='true'] {
  background: rgba(17, 17, 17, 0.08);
  -webkit-text-fill-color: var(--cr-ink);
}

.cr-chat #mensajes .voiceSelector {
  width: auto;
  height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  font-size: 13px;
}

.cr-chat #mensajes .dropdown-toggle::after {
  display: none;
}

/* Indicador de respuesta en curso */
.cr-chat #loading {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 56px;
  padding: 14px 18px;
  border-radius: var(--cr-radius-pill);
  background: var(--cr-pink-2);
}

.cr-chat #loading .spinner-grow {
  width: 10px;
  height: 10px;
  color: var(--cr-red);
}

/* Estado vacío */
.cr-chat-empty {
  margin: auto 0;
  padding: 24px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: crUp 0.5s var(--cr-ease) both;
}

.cr-chat-empty-logo {
  height: 56px;
  width: auto;
  margin-bottom: 24px;
}

.cr-chat-empty h2 {
  margin: 12px 0 0;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.cr-chat-empty p {
  margin: 16px 0 0;
  max-width: 620px;
  font-size: 17px;
  line-height: 1.65;
  color: var(--cr-slate);
  white-space: pre-line;
}

/* ---------- Composer ---------- */

.cr-composer {
  flex-shrink: 0;
  border-top: 1px solid #f1edeb;
  background: #fff;
}

.cr-composer-inner {
  max-width: 884px;
  margin: 0 auto;
  padding: 14px 32px 16px;
}

.cr-composer #message-alert {
  border-radius: var(--cr-radius-sm);
  margin-bottom: 10px;
}

.cr-composer #message_gallery {
  gap: 6px;
  margin-bottom: 10px;
}

.cr-composer #message_gallery > * {
  display: inline-flex;
  align-items: center;
  margin: 0 !important;
  padding: 4px 36px 4px 8px !important;
  border-radius: 12px;
  border: 1px solid var(--cr-pink);
  background: var(--cr-pink-2);
  font-size: 13px;
  font-weight: 600;
}

.cr-composer #message_gallery img {
  max-height: 48px;
  border-radius: 8px;
}

.cr-composer #message_gallery .upload_doc {
  margin: 0 !important;
  padding: 4px !important;
  width: auto !important;
}

.cr-composer #message_gallery .close-file {
  top: 50% !important;
  right: 4px !important;
  width: 26px;
  height: 26px;
  padding: 0;
  transform: translateY(-50%);
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--cr-slate);
  font-size: 16px;
  line-height: 1;
}

.cr-composer #message_gallery .close-file:hover {
  background: #fff;
  color: var(--cr-red);
}

.cr-composer-pill {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  padding: 8px 8px 8px 22px;
  border-radius: var(--cr-radius-xl);
  border: 1px solid var(--cr-line);
  background: #fff;
  box-shadow: 0 10px 30px -16px rgba(17, 17, 17, 0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.cr-composer-pill:focus-within {
  border-color: var(--cr-red);
  box-shadow: 0 0 0 4px rgba(222, 6, 19, 0.12);
}

.cr-composer-input {
  flex-grow: 1;
  min-width: 0;
  resize: none;
  border: none;
  outline: none;
  background: transparent;
  padding: 10px 0;
  font: 500 16px/1.5 var(--cr-font);
  color: var(--cr-ink);
  box-shadow: none !important;
}

.cr-composer-input::placeholder {
  color: var(--cr-muted);
}

.cr-composer-input:disabled {
  background: transparent;
}

.cr-composer .action-buttons,
.cr-composer .mobile-action-menu {
  align-items: center;
  gap: 4px;
}

.cr-composer .cr-composer-tool,
.cr-composer .cr-composer-send {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border-radius: 50%;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.cr-composer .cr-composer-tool {
  background: transparent;
  color: var(--cr-slate);
}

.cr-composer .cr-composer-tool:hover {
  background: var(--cr-paper-2);
  color: var(--cr-ink);
}

.cr-composer .cr-composer-tool.is-recording {
  background: var(--cr-red);
  color: #fff;
  animation: crChatPulse 1.4s infinite;
}

.cr-composer .cr-composer-send {
  background: var(--cr-red);
  color: #fff;
  font-size: 18px;
  box-shadow: 0 8px 18px -8px rgba(222, 6, 19, 0.9);
}

.cr-composer .cr-composer-send:hover {
  background: var(--cr-red-hover);
  transform: scale(1.06);
}

.cr-composer .cr-composer-tool:disabled,
.cr-composer .cr-composer-send:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.cr-composer .mobile-action-dropdown {
  bottom: calc(100% + 8px);
  min-width: 220px;
}

.cr-composer .mobile-action-item {
  display: flex;
  align-items: center;
  font-weight: 600;
}

.cr-composer-notes {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--cr-slate);
  text-align: center;
}

.cr-composer-notes > span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cr-composer-notes i {
  color: var(--cr-success);
  font-size: 14px;
}

.cr-composer-notes .ia-generated {
  font-size: inherit;
  color: inherit;
  align-self: auto;
}

@keyframes crChatPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(222, 6, 19, 0.55);
  }
  70% {
    box-shadow: 0 0 0 14px rgba(222, 6, 19, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(222, 6, 19, 0);
  }
}

/* ---------- Publicidad lateral ---------- */

/* ---------- Aviso de copiado ---------- */

#copiedToast {
  width: auto;
  border: none;
  border-radius: var(--cr-radius-pill);
  background: var(--cr-ink);
  color: #fff;
  box-shadow: var(--cr-shadow-modal);
}

#copiedToast .toast-body {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  font-size: 14px;
}

#copiedToast .toast-body i {
  color: #7fd1a1;
  font-size: 18px;
}

#copiedToast .btn-close {
  display: none;
}

/* ---------- Modales del chat ---------- */

.cr-tag-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.cr-tag-options:empty {
  display: none;
}

.cr-tag-options:empty + .cr-modal-label {
  margin-top: 0;
}

.cr-tag-options > button {
  width: auto;
  max-width: 100%;
  flex: 0 0 auto;
  padding-right: 14px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cr-tag-options > button:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -8px rgba(17, 17, 17, 0.35);
}

.cr-tag-new {
  margin-top: 4px;
}

.cr-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* tags.js marca la selección con border-color inline: sin borde no se
   ve, y el anillo de .active es el que indica el color elegido. */
.cr-swatch {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--swatch);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cr-swatch:hover {
  transform: scale(1.1);
}

.cr-swatch.active {
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--swatch);
}

.cr-rating {
  margin: 0 0 4px;
  padding: 0;
  border: none;
  text-align: center;
}

.cr-rating-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 6px;
}

.cr-rating-stars label {
  color: var(--cr-line);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transition: color 0.15s ease, transform 0.15s ease;
}

.cr-rating-stars label:hover {
  transform: scale(1.12);
}

.cr-rating-stars input:checked ~ label,
.cr-rating-stars label:hover,
.cr-rating-stars label:hover ~ label {
  color: var(--cr-red);
}

.cr-rating-stars input:focus-visible + label {
  border-radius: 50%;
  box-shadow: var(--cr-shadow-focus);
}

.cr-modal .cr-dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
  padding: 32px 20px 24px;
  border: 2px dashed var(--cr-line);
  border-radius: var(--cr-radius-lg);
  background: var(--cr-paper-2);
  outline: none;
  text-align: center;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.cr-modal .cr-dropzone.highlight {
  border-color: var(--cr-red);
  background: var(--cr-pink-2);
}

.cr-modal .cr-dropzone-icon,
.cr-modal .cr-dropzone-text,
.cr-modal .cr-dropzone-hint {
  pointer-events: none;
}

.cr-modal .cr-dropzone-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #fff;
  color: var(--cr-red);
  font-size: 26px;
  box-shadow: var(--cr-shadow-card);
}

.cr-modal .cr-dropzone-text {
  max-width: 300px;
  margin: 16px 0 4px;
  font-weight: 600;
  color: var(--cr-ink);
}

.cr-modal .cr-dropzone-hint {
  margin: 0 0 18px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--cr-slate);
}

.cr-modal .cr-dropzone-gallery {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.cr-modal .cr-dropzone-gallery:not(:empty) {
  margin-top: 18px;
}

#evaluationModal .cr-metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

#evaluationModal .cr-metric-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  margin: 0;
  padding: 10px 14px;
  border: 1px solid var(--cr-line);
  border-radius: var(--cr-radius-sm);
  background: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

#evaluationModal .cr-metric-option:hover {
  border-color: var(--cr-ink);
}

#evaluationModal .cr-metric-option:has(input:checked) {
  border-color: var(--cr-red);
  background: var(--cr-pink-2);
}

#evaluationModal .cr-metric-option input {
  flex-shrink: 0;
  margin: 0;
}

.cr-chat-ad {
  flex-shrink: 0;
  width: 180px;
  padding: 20px 16px;
  border-left: 1px solid #f1edeb;
}

.cr-chat-ad img {
  max-width: 100%;
  height: auto;
}

/* ---------- Móvil ---------- */

@media (max-width: 767.98px) {
  .cr-chat #mensajes {
    gap: 20px;
    padding: 24px 16px 16px;
  }

  .cr-chat #mensajes .user-message {
    max-width: 88%;
  }

  .cr-chat #mensajes .justify-content-start {
    gap: 10px;
  }

  .cr-chat #mensajes .justify-content-start > img {
    width: 32px !important;
    height: 32px !important;
    padding: 7px;
  }

  .cr-chat #mensajes .message-container > div:first-child {
    padding: 14px 16px !important;
  }

  .cr-chat #loading {
    margin-left: 42px;
  }

  .cr-composer-inner {
    padding: 10px 16px 12px;
  }

  .cr-composer-pill {
    padding-left: 16px;
  }

  .cr-composer-notes {
    font-size: 11px;
  }

  .cr-chat-topbar {
    padding: 6px 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cr-chat-empty,
  .cr-chat-action.is-on i,
  .cr-composer-tool.is-recording {
    animation: none;
  }

  .cr-chat #mensajes {
    scroll-behavior: auto;
  }

  .cr-tag-options > button,
  .cr-swatch,
  .cr-rating-stars label {
    transition: none;
  }

  .cr-tag-options > button:hover,
  .cr-swatch:hover,
  .cr-rating-stars label:hover {
    transform: none;
  }
}
