:root {
  --mps-cyan: #70d1de;
  --mps-cyan-dark: #5bbbc9;
  --mps-cyan-glow: rgba(112, 209, 222, 0.35);
  --mps-dark: #212529;
  --mps-gray: #f4f7f8;
  --skeleton-base: #e8edf0;
  --skeleton-shine: #f4f7f8;

  --mps-heading-blue: #50b2e2;

  --mps-ui-heading-font: "Plus Jakarta Sans", "Open Sans", system-ui,
    -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body {
  font-family: "Plus Jakarta Sans", "Open Sans", sans-serif;
  background-color: var(--mps-gray);
  padding-top: 80px;
}

:where(a, button, input, [tabindex]):focus {
  outline: none;
}
:where(a, button, input, [tabindex]):focus-visible {
  outline: 3px solid rgba(80, 178, 226, 0.55);
  outline-offset: 3px;
}

/* Evita que los inputs “cambien de forma” al enfocar */
:where(input, textarea, select):focus-visible {
  border-radius: inherit;
}

html,
body {
  overflow-anchor: none;
}

.d-none {
  display: none !important;
}

i.fas.fa-lock.me-1 {
  font-size: 1.2rem;
  padding-left: 3px;
}


/* ── Animaciones ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}
@keyframes pulseRing {
  0% {
    box-shadow: 0 0 0 0 var(--mps-cyan-glow);
  }
  70% {
    box-shadow: 0 0 0 6px rgba(112, 209, 222, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(112, 209, 222, 0);
  }
}
@keyframes lockWiggle {
  0%,
  100% {
    transform: translateY(-50%) rotate(0deg);
  }
  20% {
    transform: translateY(-50%) rotate(-12deg);
  }
  40% {
    transform: translateY(-50%) rotate(12deg);
  }
  60% {
    transform: translateY(-50%) rotate(-6deg);
  }
  80% {
    transform: translateY(-50%) rotate(6deg);
  }
}
@keyframes dots {
  0% {
    content: "";
  }
  25% {
    content: ".";
  }
  50% {
    content: "..";
  }
  75% {
    content: "...";
  }
  100% {
    content: "";
  }
}

/* ── Skeleton loader ──────────────────────────────────────────────────────── */
@keyframes skeletonShimmer {
  0% {
    background-position: -600px 0;
  }
  100% {
    background-position: 600px 0;
  }
}

.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 600px 100%;
  animation: skeletonShimmer 1.4s ease infinite;
  border-radius: 8px;
}

.skeleton-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  width: calc(33.333% - 14px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
}
.skeleton-card .sk-thumb {
  aspect-ratio: 16/9;
  width: 100%;
}
.skeleton-card .sk-body {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.skeleton-card .sk-title {
  height: 30px;
  width: 100%;
}
.skeleton-card .sk-sub {
  display: none;
}

.skeleton-img-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  flex-shrink: 0;
  width: calc(25% - 15px);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.skeleton-img-card .sk-square {
  aspect-ratio: 1/1;
  width: 100%;
}

.skeleton-doc {
  display: flex;
  align-items: center;
  padding: 18px;
  border-radius: 15px;
  gap: 15px;
  border: 1px solid transparent;
}
.skeleton-doc .sk-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  flex-shrink: 0;
}
.skeleton-doc .sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.skeleton-doc .sk-line-a {
  height: 20px;
  width: 75%;
}
.skeleton-doc .sk-line-b {
  display: none;
}

/* ── Zoom Overlay ─────────────────────────────────────────────────────────── */
.zoom-overlay {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.92);
  cursor: pointer;
}
.zoom-overlay.active {
  display: flex;
  animation: fadeIn 0.25s ease-out;
}
.zoom-overlay img {
  max-width: 90%;
  max-height: 85%;
  border-radius: 12px;
  animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* ── Auth Modal ───────────────────────────────────────────────────────────── */
.auth-modal {
  display: none;
  position: fixed;
  inset: 0;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
}
.auth-modal.active {
  display: flex;
  animation: fadeIn 0.3s ease-out;
}
.auth-box {
  background: white;
  padding: 30px;
  border-radius: 20px;
  width: 90%;
  max-width: 400px;
  text-align: center;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

/* Evita que Bootstrap/otros estilos hagan los inputs “ovalados” al enfocar */
.auth-box .form-control {
  border-radius: 10px !important;
}
.auth-box .form-control:focus,
.auth-box .form-control:focus-visible {
  border-radius: 10px !important;
}

/* ── Video card ───────────────────────────────────────────────────────────── */
.video-info {
  padding: 12px 15px;
  background: #fff;
}
.video-title {
  font-size: 1.2rem !important;
  font-weight: 700 !important;
  color: var(--mps-dark);
  line-height: 1.4 !important;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
  transition: color 0.25s ease;
}
.content-card:hover .video-title {
  color: var(--mps-cyan-dark);
}

.video-description {
  margin: 6px 0 0;
  font-size: 0.98rem;
  line-height: 1.45;
  color: #64748b;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 2.8em;
}

/* ── Animaciones FAB (definidas aquí para ambos FABs) ─────────────────────── */
@keyframes fabIn {
  from {
    opacity: 0;
    transform: scale(0.6) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* ── Hero & barra de búsqueda ─────────────────────────────────────────────── */
.soporte-hero {
  position: sticky;
  top: 80px;
  z-index: 90;
  background-color: var(--mps-gray);
  padding: 30px 0 35px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition:
    padding 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
    background 0.4s ease,
    box-shadow 0.4s ease;
}
.soporte-hero h2,
.soporte-hero .soporte-hero-title {
  cursor: pointer;
  font-weight: 800;
  font-size: 3rem;
  margin-bottom: 30px;
  white-space: nowrap;
  color: var(--mps-dark);
  animation: fadeUp 0.5s ease both;
  transition:
    font-size 0.4s ease,
    margin 0.4s ease,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.search-container {
  width: 100%;
  max-width: 860px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeUp 0.55s 0.1s ease both;
  transition: max-width 0.4s ease;
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}



.search-bar-modern {
  width: 100%;
  padding: 16px 90px 16px 55px !important;
  border-radius: 50px;
  border: 2px solid transparent;
  background: white;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.07);
  outline: none;
  font-size: 1.5rem;
  font-family: inherit;
  color: var(--mps-dark);
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}
.search-bar-modern::placeholder {
  color: #aab4be;
}
.search-bar-modern:focus {
  border-color: var(--mps-cyan);
  box-shadow:
    0 0 0 4px var(--mps-cyan-glow),
    0 14px 35px rgba(0, 0, 0, 0.09);
  transform: translateY(-1px);
}

.search-wrapper .fa-search {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--mps-cyan);
  z-index: 1;
  pointer-events: none;
  transition:
    color 0.25s ease,
    transform 0.25s ease;
}
.search-wrapper:has(.search-bar-modern:focus) .fa-search {
  color: var(--mps-cyan-dark) !important;
  transform: translateY(-50%) scale(1.15);
}

.search-wrapper .fa-robot,
.search-wrapper .fa-lock {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}

/*Icono de Pagina de Soporte*/
.user-icon {
  position: absolute;
  right: 34px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  cursor: pointer;
  z-index: 2;
  font-size: 1.55rem;
  transition:
    color 0.25s ease,
    transform 0.2s ease;
}
.user-icon:hover {
  color: var(--mps-cyan);
  transform: translateY(-50%) scale(1.08);
}

.lock-icon {
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: #ccc;
  cursor: pointer;
  z-index: 2;
  font-size: 1.4rem;
  transition: color 0.3s ease;
}
.lock-icon:hover {
  color: var(--mps-cyan);
  animation: lockWiggle 0.5s ease;
}
.lock-icon.unlocked {
  color: var(--mps-cyan);
  animation: none !important;
}

.ai-icon {
  right: 42px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 999px;
  transition: color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
}
.ai-icon:hover {
  color: var(--mps-cyan);
  animation: lockWiggle 0.5s ease;
}

.ai-icon.ai-quota-paused {
  opacity: 0.7;
  animation: none !important;
  cursor: pointer;
}
.ai-icon.active {
  color: var(--mps-cyan) !important;
  animation: none !important;
  text-shadow: 0 0 10px var(--mps-cyan-glow);
}

#aiToggle.active {
  color: var(--mps-cyan) !important;
  animation: none !important;
  text-shadow: 0 0 10px var(--mps-cyan-glow);
}

.search-wrapper.ai-active .search-bar-modern {
  border-color: var(--mps-cyan);
  box-shadow: 0 0 15px var(--mps-cyan-glow), 0 12px 30px rgba(0, 0, 0, 0.07);
}

/* Deja espacio para usuario + candado dentro del input */
.search-wrapper .search-bar-modern {
  padding-right: 96px;
}
.soporte-hero.scrolled .search-wrapper .search-bar-modern {
  padding-right: 90px;
}

.upload-search-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 22px;
  border-radius: 50px;
  border: none;
  background: var(--mps-cyan);
  color: white;
  font-size: 1.18rem;
  font-weight: 700;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(112, 209, 222, 0.4);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.upload-search-btn:hover {
  background: var(--mps-cyan-dark);
  box-shadow: 0 12px 30px rgba(112, 209, 222, 0.55);
  transform: translateY(-2px);
}
.upload-search-btn:active {
  transform: scale(0.95);
}

/* ── Hero scrolled ────────────────────────────────────────────────────────── */
.soporte-hero.scrolled {
  padding: 18px 20px;
  background-color: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(18px);
  box-shadow:
    0 6px 24px rgba(112, 209, 222, 0.12),
    0 1px 0 rgba(112, 209, 222, 0.3);
  border-bottom: 2px solid var(--mps-cyan);
  flex-direction: row;
  align-items: center;
  gap: 14px;
}
.soporte-hero.scrolled h2 {
  font-size: 2.3rem;
  margin-top: 0;
  margin-bottom: 0;
  margin-left: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  font-weight: 800;
  line-height: 1;
}
.soporte-hero.scrolled .search-container {
  max-width: none;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 0;
  animation: none;
}
.soporte-hero.scrolled .search-bar-modern {
  padding: 16px 46px;
  font-size: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.soporte-hero.scrolled .upload-search-btn {
  padding: 12px 18px;
  font-size: 1.18rem;
}

/* ── FABs compartidos ─────────────────────────────────────────────────────── */
.mps-fab {
  display: flex;
  position: fixed;
  right: 20px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--mps-cyan);
  color: white;
  border: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  cursor: pointer;
  font-size: 1.3rem;
  box-shadow:
    0 6px 20px rgba(112, 209, 222, 0.55),
    0 2px 8px rgba(0, 0, 0, 0.15);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease;
}
.mps-fab:hover {
  background: var(--mps-cyan-dark);
  box-shadow: 0 10px 28px rgba(112, 209, 222, 0.65);
  transform: translateY(-3px);
}
.mps-fab:active {
  transform: scale(0.92);
}

#scrollTopFab {
  bottom: 28px;
  right: 110px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6) translateY(20px);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease,
    opacity 0.25s ease;
}

@media (max-width: 768px) {
  #scrollTopFab {
    display: none !important;
  }

  #uploadFab.fab-visible + #scrollTopFab {
    bottom: 176px;
  }
}
#scrollTopFab.fab-visible {
  opacity: 1;
  pointer-events: auto !important;
  transform: scale(1) translateY(0);
  animation: fabIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
#scrollTopFab.fab-hiding {
  animation: fabOut 0.25s ease forwards;
}

#uploadFab {
  bottom: 92px;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.6) translateY(20px);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.2s ease,
    opacity 0.25s ease;
  display: none;
}
@media (max-width: 768px) {
  #uploadFab {
    display: flex;
    width: 60px;
    height: 60px;
    font-size: 1.85rem;
  }
  #uploadFab.fab-visible {
    opacity: 1;
    pointer-events: auto !important;
    transform: scale(1) translateY(0);
    animation: fabIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

/* ── Badges ───────────────────────────────────────────────────────────────── */
.restricted-label {
  display: block;
  color: var(--mps-heading-blue);
  font-size: 1.04rem;
  font-weight: 600;
  margin-top: 6px;
  margin-left: 0;
  line-height: 1.4;
  max-width: 100%;
}

.restricted-label .fa-lock {
  color: var(--mps-heading-blue);
}

.doc-row--restricted .restricted-label {
  color: var(--mps-heading-blue);
}
.video-duration {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.82);
  color: white;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 6;
  font-variant-numeric: tabular-nums;
}

/* ── Carousels ────────────────────────────────────────────────────────────── */
.mps-wrapper {
  position: relative;
  margin-bottom: 50px;
  padding: 0 10px;
}
.mps-scroll {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  gap: 20px;
  padding: 15px 5px;
  scrollbar-width: none;
  scroll-snap-type: x mandatory;
  content-visibility: auto;
  contain-intrinsic-size: 260px;
}

#v-scr {
  min-height: 220px;
}

#doc-scr {
  min-height: 420px;
  width: 100%;
  flex: 1;
}

#doc-scr.is-empty {
  display: flex;
  align-items: center;
  justify-content: center;
}

#v-scr.is-empty,
#i-scr.is-empty {
  justify-content: center;
}
.mps-scroll::-webkit-scrollbar {
  display: none;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.content-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.04);
  flex-shrink: 0;
  scroll-snap-align: start;
  border: 1px solid rgba(0, 0, 0, 0.05);
  cursor: pointer;
  transition:
    box-shadow 0.3s ease,
    transform 0.3s ease;
  animation: fadeUp 0.4s ease both;
}
.content-card:nth-child(1) { animation-delay: 0s; }
.content-card:nth-child(2) { animation-delay: 0.05s; }
.content-card:nth-child(3) { animation-delay: 0.1s; }
.content-card:nth-child(4) { animation-delay: 0.15s; }
.content-card:nth-child(5) { animation-delay: 0.2s; }
.content-card:nth-child(n + 6) { animation-delay: 0.25s; }
.content-card:hover {
  box-shadow: 0 18px 40px rgba(112, 209, 222, 0.22);
  transform: translateY(-4px);
}

.video-item { width: calc(33.333% - 14px); }
.img-item   { width: calc(25% - 15px); }

.thumb-box {
  position: relative;
  background: #f1f5f9;
  overflow: hidden;
  aspect-ratio: 16/9;
}

.thumb-box::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--skeleton-base) 25%,
    var(--skeleton-shine) 50%,
    var(--skeleton-base) 75%
  );
  background-size: 600px 100%;
  animation: skeletonShimmer 1.1s ease infinite;
  opacity: 1;
  transition: opacity 0.2s ease;
  z-index: 2;
}
.thumb-box.loaded::after {
  opacity: 0;
  animation: none;
}
.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.9;
  display: block;
  position: relative;
  z-index: 1;
  transition:
    opacity 0.35s ease,
    transform 0.4s ease;
}
.content-card:hover .thumb-box img {
  opacity: 1;
  transform: scale(1.04);
}

.play-icon-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(112, 209, 222, 0.95);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 5;
  transition:
    transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.25s ease;
}
.content-card:hover .play-icon-overlay {
  transform: translate(-50%, -50%) scale(1.15);
  background: var(--mps-cyan-dark);
}
.play-icon-overlay i {
  color: white;
  font-size: 1.6rem;
  margin-left: 4px;
}

.share-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: white;
  border: none;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition:
    opacity 0.25s ease,
    background 0.25s ease,
    transform 0.25s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: var(--mps-dark);
  cursor: pointer;
}
.content-card:hover .share-btn {
  opacity: 1;
  transform: scale(1.08);
}
.share-btn:hover {
  background: var(--mps-cyan);
  color: white;
}
.share-btn.shared {
  background: #28a745 !important;
  color: white !important;
  opacity: 1 !important;
}

/* ── Navigation arrows ────────────────────────────────────────────────────── */
.nav-arrow-sop {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  border: 1px solid rgba(0, 0, 0, 0.05);
  z-index: 20;
  color: var(--mps-dark);
  transition:
    background 0.25s ease,
    color 0.25s ease,
    box-shadow 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  cursor: pointer;
}
.nav-arrow-sop:hover {
  background: var(--mps-cyan);
  color: white;
  box-shadow: 0 8px 24px rgba(112, 209, 222, 0.45);
  transform: translateY(-50%) scale(1.12);
}
.arrow-l { left: -24px; }
.arrow-r { right: -24px; }

/* ── Documents panel ──────────────────────────────────────────────────────── */
.docs-panel {
  background: #fff;
  border-radius: 20px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
  border: 1px solid rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
}

.ai-panel-highlight {
  border: 2px solid rgba(80, 178, 226, 0.65);
  box-shadow:
    0 12px 34px rgba(80, 178, 226, 0.12),
    0 0 0 1px rgba(80, 178, 226, 0.08) inset;
}

#ai-result-wrap .docs-panel.ai-panel-highlight {
  border: 2px solid rgba(80, 178, 226, 0.65);
}

/* Cuando Recursos está vacío: centrar dentro de toda la card */
.docs-panel:has(#doc-scr.is-empty) {
  display: grid;
  place-items: center;
}

.docs-panel:has(#doc-scr.is-empty) #doc-scr {
  width: 100%;
}
.doc-row {
  display: flex;
  align-items: center;
  padding: 18px;
  border-radius: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
  animation: fadeUp 0.35s ease both;
}
.doc-row:hover {
  background: #f4fbfc;
  border-color: var(--mps-cyan);
  transform: translateX(4px);
  box-shadow: 0 4px 16px rgba(112, 209, 222, 0.1);
}
.doc-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  font-size: 1.4rem;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.doc-row:hover .doc-icon { transform: scale(1.12); }
.doc-row .flex-grow-1 {
  min-width: 0;
  padding-right: 10px;
}
.doc-row h6 {
  white-space: normal;
  word-break: break-word;
  overflow-wrap: break-word;
  line-height: 1.3;
}

.icon-pdf   { background: #ffebee; color: #f44336; }
.icon-docx  { background: #e3f2fd; color: #2196f3; }
.icon-pptx  { background: #fff3e0; color: #ff9800; }
.icon-xlsx  { background: #e8f5e9; color: #4caf50; }
.icon-youtube { background: #ff0000; color: #ffffff; }
.icon-video { background: #f3e5f5; color: #9c27b0; }
.icon-audio { background: #fce4ec; color: #e91e63; }
.icon-img   { background: #e8eaf6; color: #3f51b5; }
.icon-zip   { background: #fff8e1; color: #ffc107; }
.icon-txt   { background: #f1f8e9; color: #8bc34a; }
.icon-code  { background: #e8f5e9; color: #009688; }
.icon-apk   { background: #e8f5e9; color: #3ddc84; }
.icon-file  { background: #f1f5f9; color: #64748b; }

.btn-share-doc {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid #eee;
  background: white;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    border-color 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
}
.btn-share-doc:hover {
  background: var(--mps-cyan);
  color: white;
  border-color: var(--mps-cyan);
  transform: scale(1.12);
}
.btn-share-doc.shared {
  background: #28a745 !important;
  color: white !important;
  border-color: #28a745 !important;
}

/* ── File explorer modal ──────────────────────────────────────────────────── */
.custom-modal {
  display: none;
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}
.custom-modal.show {
  display: flex !important;
  animation: fadeIn 0.2s ease;
}
.custom-modal.show .explorer-minimal-final {
  animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.explorer-minimal-final {
  width: 95%;
  max-width: 750px;
  background: #fff;
  border-radius: 14px;
  border: 1px solid #ddd;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}
.explorer-header-mini {
  display: flex;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #eee;
}
.path-bar-final {
  background: #f1f5f9;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 1.2rem;
  color: #334155;
  flex-grow: 1;
  display: flex;
  align-items: center;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
}
.path-bar-final span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.close-btn-final {
  background: none;
  border: none;
  font-size: 2.2rem;
  color: #94a3b8;
  cursor: pointer;
  margin-left: 15px;
  flex-shrink: 0;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}
.close-btn-final:hover {
  color: #475569;
  transform: rotate(90deg);
}
.explorer-actions-final {
  padding: 15px 25px;
  display: flex;
  gap: 30px;
  border-bottom: 1px solid #f8fafc;
  align-items: center;
}
.action-btn-final {
  background: none;
  border: none;
  color: #00acc1;
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 5px;
  transition:
    color 0.2s ease,
    transform 0.2s ease;
}
.action-btn-final:hover {
  color: var(--mps-cyan-dark);
  transform: translateY(-1px);
}
.explorer-body-final {
  height: 400px;
  overflow-y: auto;
}

.file-row-final {
  display: flex;
  align-items: center;
  padding: 12px 30px;
  cursor: pointer;
  border-bottom: 1px solid #f1f5f9;
  transition:
    background 0.15s ease,
    padding-left 0.2s ease;
  min-width: 0;
  overflow: hidden;
  gap: 0;
}
.file-row-final:hover {
  background: #f8fafc;
  padding-left: 36px;
}

.icon-dir {
  color: #f59e0b;
  font-size: 1.6rem;
  margin-right: 20px;
  flex-shrink: 0;
}
.icon-file-item {
  color: #64748b;
  font-size: 1.6rem;
  margin-right: 20px;
  flex-shrink: 0;
}

.file-name-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-row-final .name-label {
  font-size: 1.2rem;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.file-row-final .restricted-label {
  font-size: 0.78rem;
  color: var(--mps-cyan-dark);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
  margin-left: 0;
}

.btn-delete-file {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  margin: 0 0 0 12px;
  outline: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.btn-delete-file:hover { transform: scale(1.2); }
.btn-delete-file:focus { outline: none; box-shadow: none; }
.btn-delete-file:focus-visible { outline: none; box-shadow: none; }

/* ── Nota sobre carpeta restringida ──────────────────────────────────────── */
.restricted-folder-notice {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: linear-gradient(135deg, #e0f7fa 0%, #f0fdfe 100%);
  border: 1.5px solid var(--mps-cyan);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 25px 10px;
}
.restricted-folder-notice .notice-icon {
  font-size: 1.8rem;
  color: var(--mps-cyan-dark);
  flex-shrink: 0;
  margin-top: 2px;
}
.restricted-folder-notice .notice-body { flex: 1; min-width: 0; }
.restricted-folder-notice .notice-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #0e7490;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.restricted-folder-notice .notice-text {
  font-size: 1.1rem;
  color: #164e63;
  line-height: 1.55;
  margin: 0;
}
.restricted-folder-notice .notice-text strong { color: #0e7490; }

.name-label { font-size: 1.2rem; color: #1e293b; }
.explorer-footer-final {
  padding: 12px 30px;
  font-size: 1rem;
  color: #94a3b8;
  background: #f8fafc;
}

/* ── Upload & misc ────────────────────────────────────────────────────────── */
.upload-limit-info {
  font-size: 1.1rem;
  color: #4f5c6e;
  background: #f1f5f9;
  padding: 6px 12px;
  border-radius: 20px;
  white-space: nowrap;
  margin-left: auto;
}

.upload-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.9);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.upload-spinner-container {
  text-align: center;
  background: white;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  animation: scaleIn 0.3s ease;
}
.upload-spinner-container span {
  display: block;
  font-size: 1.2rem;
  color: #334155;
  font-weight: 500;
}

/* ── Global overlay ───────────────────────────────────────────────────────── */
.global-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
  z-index: 99999;
  align-items: center;
  justify-content: center;
}
.global-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}
.global-overlay-box {
  background: white;
  border-radius: 20px;
  padding: 40px 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  min-width: 220px;
  text-align: center;
  animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.global-overlay-box span {
  font-size: 1.2rem;
  font-weight: 600;
  color: #334155;
}
.global-overlay-box span::after {
  content: "";
  animation: dots 1.4s infinite;
}

/* ── Scroll-to-top FAB (animación de salida) ──────────────────────────────── */
@keyframes fabOut {
  from { opacity: 1; transform: scale(1) translateY(0); }
  to   { opacity: 0; transform: scale(0.6) translateY(20px); }
}

/* ── Upload subfolder mini-modal ──────────────────────────────────────────── */
.upload-subfolder-modal {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
}
.upload-subfolder-modal.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}
.upload-subfolder-box {
  background: #fff;
  border-radius: 16px;
  padding: 28px 28px 24px;
  width: 90%;
  max-width: 460px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
  animation: scaleIn 0.25s cubic-bezier(0.18, 0.89, 0.32, 1.28);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.upload-subfolder-box h5 {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.upload-subfolder-box h5 i { color: var(--mps-cyan-dark); }
.upload-subfolder-hint {
  background: #f1f9ff;
  border: 1px solid #bae6fd;
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 1.08rem;
  color: #334155;
  line-height: 1.85;
}
.upload-subfolder-hint code {
  background: #e0f2fe;
  color: #0369a1;
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 1.2rem;
  font-weight: 600;
}

.subfolder-restricted-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: linear-gradient(135deg, #fff7ed 0%, #fffbf5 100%);
  border: 1.5px solid #fdba74;
  border-radius: 10px;
  padding: 14px 16px;
}
.subfolder-restricted-note .srn-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  margin-top: 1px;
}
.subfolder-restricted-note .srn-body { flex: 1; min-width: 0; }
.subfolder-restricted-note .srn-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #92400e;
  margin-bottom: 4px;
}
.subfolder-restricted-note .srn-text {
  font-size: 0.8rem;
  color: #78350f;
  line-height: 1.5;
  margin: 0;
}
.subfolder-restricted-note .srn-text strong { color: #92400e; }

.upload-subfolder-input-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.upload-subfolder-input-wrap label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.upload-subfolder-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.upload-subfolder-input:focus {
  border-color: var(--mps-cyan);
  box-shadow: 0 0 0 3px var(--mps-cyan-glow);
}
.upload-subfolder-input.is-invalid {
  border-color: #f87171;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.2);
}
.upload-subfolder-input::placeholder { color: #94a3b8; }

.external-link-section {
  background: #f8faff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  overflow: hidden;
}
.external-link-toggle { padding: 14px 16px; }
.elt-header { display: flex; align-items: center; gap: 12px; }
.elt-icon { font-size: 1.3rem; color: var(--mps-cyan-dark); flex-shrink: 0; }
.elt-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.elt-title { font-size: 1rem; font-weight: 700; color: #1e293b; line-height: 1.3; }
.elt-sub   { font-size: 0.90rem; color: #636b75; }

.elt-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.elt-switch input { opacity: 0; width: 0; height: 0; }
.elt-slider {
  position: absolute;
  inset: 0;
  background: #cbd5e1;
  border-radius: 24px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.elt-slider::before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}
.elt-switch input:checked + .elt-slider { background: var(--mps-cyan); }
.elt-switch input:checked + .elt-slider::before { transform: translateX(20px); }

#externalLinkFields {
  padding: 0 16px 14px;
  animation: fadeUp 0.2s ease both;
}
.external-link-input {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  color: #1e293b;
  outline: none;
  background: white;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}
.external-link-input:focus {
  border-color: var(--mps-cyan);
  box-shadow: 0 0 0 3px var(--mps-cyan-glow);
}
.external-link-input::placeholder { color: #94a3b8; }
.external-link-hint { font-size: 0.90rem; color: #94a3b8; margin: 6px 0 0; }

/* ── Preview de archivos seleccionados ───────────────────────────────────── */
.selected-files-preview {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sfp-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  background: #f1f5f9;
  border-radius: 10px;
  animation: fadeUp 0.2s ease both;
}
.sfp-icon { font-size: 1.1rem; color: var(--mps-cyan-dark); flex-shrink: 0; }
.sfp-name {
  flex: 1;
  font-size: 0.85rem;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sfp-size { font-size: 0.76rem; color: #94a3b8; flex-shrink: 0; }

.upload-subfolder-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 4px;
}
.upload-subfolder-actions .btn-cancel-sub {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: white;
  color: #64748b;
  font-size: 1.2rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}
.upload-subfolder-actions .btn-cancel-sub:hover {
  background: #f1f5f9;
  color: #334155;
}
.upload-subfolder-actions .btn-confirm-sub {
  padding: 9px 22px;
  border-radius: 8px;
  border: none;
  background: var(--mps-cyan);
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition:
    background 0.2s ease,
    transform 0.15s ease;
}
.upload-subfolder-actions .btn-confirm-sub:hover {
  background: var(--mps-cyan-dark);
  transform: translateY(-1px);
}

.ai-flat-container {
  background: transparent;
  padding: 10px 0 40px 0;
  max-width: 1000px;
  margin: 0 auto;
  font-family: inherit;
}

.ai-result-container-wrap {
  width: 100%;
  max-width: none;
  padding: 0;
  margin: 0;

  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-6px);
  pointer-events: none;

  transition:
    max-height 260ms ease,
    opacity 180ms ease,
    transform 260ms ease;
}

.ai-result-container-wrap.active {
  max-height: 520px;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
  margin: 18px 0 72px 0;
}

#ai-result-wrap .docs-panel {
  border: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  background: #fff;
  width: 100%;
}

.ai-result-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--mps-cyan-dark);
  font-size: 1.05rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.ai-result-panel {
  position: relative;
  min-height: 120px;
  max-height: 380px;
  overflow-y: auto;
  font-family: inherit;
  content-visibility: auto;
  contain-intrinsic-size: 380px;
}

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

.ai-reveal {
  animation: aiReveal 280ms ease-out both;
}

.ai-result-panel .ai-flat-container {
  padding: 0;
  margin: 0;
  max-width: none;
}

.ai-thinking {
  font-family: inherit;
  padding: 28px 18px 32px;
  text-align: center;
  color: var(--mps-heading-blue);
}

.ai-thinking-row {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ai-thinking-icon-wrap {
  color: var(--mps-heading-blue);
  font-size: 1.05em;
  line-height: 1;
  opacity: 0.95;
}

.ai-thinking-label {
  font-weight: 800;
}

.ai-thinking-dots span {
  display: inline-block;
  color: var(--mps-heading-blue);
  animation: aiThinkingPulse 1.2s ease-in-out infinite;
  opacity: 0.35;
}

.ai-thinking-dots span:nth-child(2) {
  animation-delay: 0.15s;
}

.ai-thinking-dots span:nth-child(3) {
  animation-delay: 0.3s;
}

@keyframes aiThinkingPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  50% {
    opacity: 1;
    transform: translateY(-2px);
  }
}

.ai-thinking-hint {
  margin: 18px auto 0;
  font-family: inherit;
}

.mps-empty-text,
.ai-thinking-hint {
  color: #64748b;
  font-size: clamp(1.12rem, 2.1vw, 1.28rem);
  font-weight: 500;
  line-height: 1.65;
  text-align: center;
  max-width: 520px;
}

.ai-empty {
  padding: 26px 16px;
  text-align: center;
  color: #4a5568;
}

.ai-empty h5 {
  font-family: var(--mps-ui-heading-font);
  font-size: clamp(1.4rem, 2.8vw, 1.65rem);
  font-weight: 800;
  color: var(--mps-heading-blue);
  margin-bottom: 10px;
  letter-spacing: -0.03em;
}

.ai-empty p {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  font-weight: 500;
  line-height: 1.6;
  color: #64748b;
  max-width: 520px;
  margin: 0 auto;
}

.ai-empty-icon svg {
  width: 44px;
  height: 44px;
  color: var(--mps-cyan-dark);
  margin: 0 auto 10px auto;
  display: block;
}

.ai-flat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: inherit;
  color: var(--mps-heading-blue);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 18px;
}

.ai-flat-header .ai-brand-title {
  font-family: var(--mps-ui-heading-font);
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
  line-height: 1.2;
  color: var(--mps-heading-blue);
}

.ai-beta-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.62em;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  background: linear-gradient(120deg, #50b2e2, #3c8fcb);
  box-shadow: none;
  line-height: 1;
  vertical-align: middle;
  transform: translateY(-1px);
}

.ai-assistant-label {
  color: var(--mps-heading-blue);
}

.ai-flat-header .fa-robot {
  font-size: 1.75em;
  line-height: 1;
  opacity: 0.95;
  color: var(--mps-heading-blue);
}

.ai-flat-content {
  font-family: inherit;
  color: #1a202c !important;
  font-size: clamp(1.2rem, 2.2vw, 1.42rem);
  line-height: 1.55;
  margin-bottom: 26px;
}

.ai-flat-content,
.ai-flat-content p,
.ai-flat-content li,
.ai-flat-content ul,
.ai-flat-content ol,
.ai-flat-content h3,
.ai-flat-content h4 {
  color: #1a202c !important;
}

.ai-flat-content p {
  margin: 0 0 10px;
}

.ai-flat-content h3 {
  font-size: 1.22em;
  font-weight: 800;
  margin: 12px 0 6px;
  color: #0f172a !important;
  border-bottom: 1px solid rgba(14, 116, 144, 0.2);
  padding-bottom: 4px;
}

.ai-flat-content h4 {
  font-size: 1.12em;
  font-weight: 800;
  margin: 10px 0 5px;
  color: #0f172a !important;
}

.ai-flat-content h5 {
  font-size: 1.05em;
  font-weight: 800;
  margin: 8px 0 4px;
  color: #1e293b !important;
}

.ai-flat-content ul,
.ai-flat-content ol {
  padding-left: 22px;
  margin: 6px 0 12px;
}

.ai-flat-content li {
  margin: 6px 0;
}

.ai-flat-content a {
  color: var(--mps-cyan-dark) !important;
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px dashed rgba(91, 187, 201, 0.5);
}
.ai-flat-content a:hover {
  border-bottom-style: solid;
}

.ai-flat-content strong {
  color: #000 !important;
  font-weight: 700;
}

.ai-flat-content > *:first-child {
  margin-top: 0;
}
.ai-flat-content > *:last-child {
  margin-bottom: 0;
}

.ai-flat-content hr {
  border: 0;
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  margin: 16px 0;
}

.ai-flat-content blockquote {
  margin: 14px 0;
  padding: 10px 14px;
  border-left: 4px solid rgba(80, 178, 226, 0.75);
  background: rgba(80, 178, 226, 0.06);
  border-radius: 12px;
  color: #334155 !important;
}
.ai-flat-content blockquote p {
  margin: 0;
}

.ai-flat-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
  padding: 0.12em 0.38em;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.08);
}
.ai-flat-content pre {
  margin: 14px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: #0b1220;
  color: #e2e8f0;
  overflow: auto;
  border: 1px solid rgba(15, 23, 42, 0.22);
}
.ai-flat-content pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: inherit;
  font-size: 0.92em;
  line-height: 1.6;
  display: block;
  white-space: pre;
}

.ai-flat-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 14px 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.ai-flat-content thead th {
  background: rgba(80, 178, 226, 0.1);
  color: #0f172a !important;
  font-weight: 800;
}
.ai-flat-content th,
.ai-flat-content td {
  text-align: left;
  vertical-align: top;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}
.ai-flat-content tbody tr:last-child td {
  border-bottom: 0;
}
.ai-flat-content tbody tr:nth-child(even) td {
  background: rgba(15, 23, 42, 0.02);
}

.ai-flat-content ul ul,
.ai-flat-content ol ol,
.ai-flat-content ul ol,
.ai-flat-content ol ul {
  margin-top: 6px;
  margin-bottom: 6px;
}

.ai-flat-footer {
  font-family: inherit;
  border-top: 1px dashed #cbd5e0;
  padding-top: 20px;
}

.footer-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: #718096;
  margin-bottom: 12px;
}

.ai-flat-footer .footer-label {
  font-size: 1.08rem;
}

.pill-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}

.ai-source-pill {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  background: #f8fafc;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 1.02rem;
  color: #334155;
  border: 1px solid rgba(15, 23, 42, 0.08);
  transition:
    background 0.2s,
    border-color 0.2s,
    transform 0.2s;
  width: max-content;
  max-width: min(100%, 560px);
  position: relative;
}

.ai-source-pill--restricted {
  border-color: rgba(80, 178, 226, 0.35);
  background: rgba(80, 178, 226, 0.08);
}

.ai-pill-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.pill-restricted-note {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.35;
  font-weight: 800;
  color: var(--mps-heading-blue);
  padding: 10px 12px;
  background: rgba(80, 178, 226, 0.12);
  border: 1px solid rgba(80, 178, 226, 0.26);
  border-radius: 14px;
  display: none !important;
}

.pill-login-cta {
  width: max-content;
  padding: 9px 12px;
  border-radius: 14px;
  border: 1px solid rgba(80, 178, 226, 0.35);
  background: rgba(80, 178, 226, 0.12);
  color: #0f172a;
  font-weight: 800;
  font-size: 0.98rem;
  line-height: 1;
}
.pill-login-cta:hover {
  background: rgba(80, 178, 226, 0.18);
}

.ai-restricted-hint {
  margin-top: 14px;
  font-size: 0.95rem;
  line-height: 1.45;
  color: #64748b;
  font-weight: 500;
}

.ai-source-pill:hover {
  background: #f1f5f9;
  border-color: rgba(15, 23, 42, 0.14);
  /* Evita CLS: no movemos la card en hover */
  transform: none;
}

.ai-source-pill--restricted:hover {
  background: rgba(80, 178, 226, 0.12);
  border-color: rgba(80, 178, 226, 0.5);
}

.ai-source-pill i {
  font-size: 1.22rem;
  line-height: 1;
  color: #0f172a;
}

.pill-name {
  flex: 1;
  min-width: 0;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 1.1rem;
  font-weight: 700;
  color: #0f172a;
}

.pill-link {
  margin-left: auto;
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
  border-bottom: none;
  font-size: 1.0rem;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(91, 187, 201, 0.14);
  border: 1px solid rgba(91, 187, 201, 0.25);
  line-height: 1;
}
.pill-link:hover {
  background: rgba(91, 187, 201, 0.22);
  text-decoration: none;
  border-bottom: none;
}

@keyframes aiCaretBlink {
  50% {
    opacity: 0;
  }
}



.ai-lock-icon {
  font-size: 1.02rem;
  color: var(--mps-heading-blue);
}

.mps-empty-state {
  width: 100%;
  height: 100%;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.02);
  font-family: inherit;
}

.docs-panel #doc-scr .mps-empty-state {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 42px 16px;
  height: auto;
  min-height: 0;
}

.mps-empty-icon {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(112, 209, 222, 0.12);
  color: var(--mps-cyan-dark);
  margin-bottom: 12px;
}

.mps-empty-icon i {
  font-size: 1.95rem;
}

.mps-empty-title,
.ai-thinking-row {
  font-family: var(--mps-ui-heading-font);
  font-weight: 800;
  color: var(--mps-heading-blue);
  font-size: clamp(1.4rem, 2.8vw, 1.65rem);
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.mps-empty-title {
  margin-bottom: 10px;
  text-align: center;
}

#v-scr,
#i-scr,
#doc-scr,
.docs-panel,
.mps-wrapper {
  overflow-anchor: none;
}

.ai-no-results {
  text-align: center;
  color: #a0aec0;
  padding: 40px;
  font-style: italic;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 992px) {
  .video-item,
  .img-item {
    width: calc(50% - 10px);
  }
  .skeleton-card {
    width: calc(50% - 10px);
  }
  .skeleton-img-card {
    width: calc(50% - 10px);
  }
  .upload-search-label {
    display: none;
  }
  .upload-search-btn {
    padding: 15px 16px;
  }
}

@media (max-width: 768px) {
  .upload-search-btn {
    display: none !important;
  }

  .support-search-btn:not(.d-none) {
    display: flex !important;
    box-shadow: none !important;
    padding: 12px !important;
  }

  #uploadFab.fab-visible {
    bottom: 92px;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: scale(1) translateY(0) !important;
  }

  .soporte-hero {
    top: 80px;
    flex-direction: column !important;
    padding: 15px 0 30px !important;
  }
  .soporte-hero h2 {
    font-size: 2.8rem !important;
    text-align: center !important;
    padding: 0 !important;
    width: 100%;
    margin-bottom: 20px !important;
  }
  .search-container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 20px !important;
    margin: 0 !important;
  }

  .search-bar-modern {
    font-size: 1.08rem !important;
    padding: 13px 72px 13px 44px !important;
  }

  .search-wrapper .fa-search {
    left: 16px;
    font-size: 0.95rem;
  }

  .lock-icon {
    right: 14px;
    font-size: 1.05rem;
  }

  .ai-icon {
    right: 34px;
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }
  .soporte-hero.scrolled {
    padding: 10px 15px !important;
    background-color: rgba(255, 255, 255, 0.98) !important;
    flex-direction: column !important;
    gap: 0 !important;
  }
  .soporte-hero.scrolled h2 {
    opacity: 0 !important;
    max-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translateY(-20px);
  }

  #v-scr {
    min-height: 180px;
  }

  #doc-scr {
    min-height: 350px;
  }
  .video-info {
    padding: 10px;
  }
  .video-title {
    font-size: 1rem !important;
    margin: 0;
  }
  .nav-arrow-sop {
    display: none !important;
  }
  .doc-row:hover {
    transform: none;
  }

  /* Ajustes para respuesta IA en móvil */
  .ai-flat-header .ai-brand-title {
    font-size: 1.32rem;
  }
  .ai-flat-content {
    font-size: 1.12rem !important;
  }
  .mps-empty-title,
  .ai-thinking-row {
    font-size: clamp(1.45rem, 4vw, 1.65rem);
  }
  .footer-label {
    font-size: 0.9rem;
  }
  .ai-source-pill {
    padding: 6px 10px;
    font-size: 0.95rem;
  }
  .ai-source-pill i {
    font-size: 1rem;
  }
  .pill-name {
    max-width: 160px;
    font-size: 1rem;
  }

  .pill-wrapper {
    width: 100%;
  }

  .ai-source-pill {
    width: 100%;
    max-width: 100%;
  }

  .ai-pill-main {
    flex-wrap: wrap;
  }

  .pill-link {
    margin-left: 0;
  }

  /* Fuentes IA en móvil: layout compacto y alineado */
  .ai-pill-main {
    display: grid;
    grid-template-columns: 22px 1fr auto auto;
    align-items: center;
    gap: 10px;
  }
  .ai-source-pill i {
    font-size: 1.15rem;
  }
  .pill-name {
    max-width: none;
    font-size: 1.02rem;
  }
  .ai-lock-icon {
    font-size: 0.95rem;
  }
  .pill-link {
    padding: 8px 12px;
    font-size: 0.98rem;
    border-radius: 999px;
  }

  .explorer-minimal-final {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }
  .custom-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .explorer-body-final {
    flex: 1;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .explorer-actions-final {
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }
  .upload-limit-info {
    width: 100%;
    text-align: center;
    margin-left: 0;
    font-size: 0.88rem;
  }
  .explorer-header-mini {
    padding: 14px 16px;
  }
  .path-bar-final {
    font-size: 1rem;
    padding: 8px 14px;
  }
  .explorer-footer-final {
    padding: 10px 16px;
    font-size: 0.82rem;
  }
  .file-row-final {
    padding: 13px 14px;
    gap: 0;
  }
  .file-row-final:hover {
    padding-left: 18px;
  }
  .icon-dir,
  .icon-file-item {
    font-size: 1.45rem;
    margin-right: 12px;
  }
  .file-row-final .name-label {
    font-size: 1rem;
  }
  .file-row-final .restricted-label {
    font-size: 0.8rem;
  }
  .path-bar-final {
    font-size: 1.05rem;
    padding: 9px 14px;
  }
  .action-btn-final {
    font-size: 1.15rem;
  }
  .explorer-footer-final {
    padding: 10px 16px;
    font-size: 0.9rem;
  }
  .upload-limit-info {
    font-size: 0.92rem;
  }

  /* Mini-modal de subida: bottom sheet en móvil */
  .upload-subfolder-modal {
    align-items: flex-end;
    border-radius: 0;
  }
  .upload-subfolder-box {
    width: 100%;
    max-width: 100%;
    border-radius: 20px 20px 0 0;
    padding: 24px 20px 32px;
    max-height: 90dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .upload-subfolder-hint {
    font-size: 0.9rem;
    line-height: 1.7;
  }

  .ai-card-inner { padding: 18px; }
  .ai-sep        { margin: 0 -18px 16px; }
  .ai-src-btn span { display: none; }
}

/* Desktop: buscador scrolled full width de pantalla */
@media (min-width: 993px) {
  .soporte-hero.scrolled {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 0;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }

  .soporte-hero.scrolled .search-container {
    width: 100%;
    max-width: 100% !important;
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 576px) {
  .video-item,
  .img-item {
    width: calc(85% - 10px);
  }
  .skeleton-card {
    width: calc(85% - 10px);
  }
  .skeleton-img-card {
    width: calc(85% - 10px);
  }
  .soporte-hero h2 {
    font-size: 2.2rem;
  }
}

/* ── Overrides Soporte (movidos desde soporte.html) ─────────────────────── */
html {
  font-size: 14px;
}

.support-search-btn {
  background: #343a40 !important;
  box-shadow: 0 8px 24px rgba(52, 58, 64, 0.4) !important;
}

.support-search-btn:hover {
  background: #212529 !important;
  box-shadow: 0 12px 30px rgba(33, 37, 41, 0.55) !important;
}

/* Mantener barra amplia en estado inicial (desktop) */
@media (min-width: 993px) {
  .search-container {
    max-width: 1120px !important;
  }

  .search-wrapper {
    min-width: 640px;
  }
}

/* Flechas carrusel fuera de imagen/video y más grandes */
.mps-wrapper {
  padding: 0 64px;
}

.nav-arrow-sop {
  width: 58px;
  height: 58px;
  font-size: 1.35rem;
}

.arrow-l {
  left: 0;
}

.arrow-r {
  right: 0;
}

/* Responsive fino carruseles soporte */
@media (max-width: 1200px) {
  .mps-wrapper {
    padding: 0 48px;
  }

  .nav-arrow-sop {
    width: 54px;
    height: 54px;
    font-size: 1.2rem;
  }

  .arrow-l { left: 2px; }
  .arrow-r { right: 2px; }
}

@media (max-width: 992px) {
  .mps-wrapper {
    padding: 0 30px;
    margin-bottom: 40px;
  }

  .mps-scroll {
    gap: 16px;
    padding: 12px 2px;
  }

  .video-item { width: calc(50% - 8px); }
  .img-item { width: calc(50% - 8px); }
}

@media (max-width: 768px) {
  .mps-wrapper {
    padding: 0 10px;
    margin-bottom: 30px;
  }

  .mps-scroll {
    gap: 14px;
    padding: 10px 2px 14px;
    scroll-snap-type: x proximity;
  }

  .video-item,
  .img-item,
  .skeleton-card,
  .skeleton-img-card {
    width: calc(82% - 8px);
  }
}

@media (max-width: 576px) {
  .mps-scroll {
    gap: 12px;
  }

  .video-item,
  .img-item,
  .skeleton-card,
  .skeleton-img-card {
    width: calc(88% - 8px);
  }
}

@media (max-width: 768px) {
  .support-search-btn,
  .support-search-btn:hover,
  .support-search-btn:active {
    box-shadow: none !important;
  }
}