/* Optional, full-page guide for the unified dataset upload journey. */
.public-upload-tour-launcher {
  position: relative;
  width: 100%;
  min-height: 52px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 22px;
  gap: 10px;
  align-items: center;
  overflow: hidden;
  padding: 8px 12px 8px 10px;
  color: #17365f;
  border: 1px solid rgba(30, 40, 165, .15);
  border-radius: 18px;
  background: #fffef8;
  box-shadow: 0 10px 26px rgba(17, 24, 79, .08);
  font-family: var(--public-font-action), system-ui, sans-serif;
  text-align: left;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.public-upload-tour-launcher::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: #fad741;
}

.public-upload-tour-launcher > .material-symbols-outlined:first-child {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #1e28a5;
  border-radius: 11px;
  background: rgba(250, 215, 65, .32);
  font-size: 20px;
}

.public-upload-tour-launcher-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.public-upload-tour-launcher-copy strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.public-upload-tour-launcher-copy small {
  color: #6b7390;
  font-family: var(--public-font-data), ui-monospace, monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.public-upload-tour-launcher-arrow {
  color: #f55a78;
  font-size: 19px;
  transition: transform .18s ease;
}

.public-upload-tour-launcher:hover {
  transform: translateY(-1px);
  border-color: rgba(30, 40, 165, .28);
  box-shadow: 0 14px 30px rgba(17, 24, 79, .13);
}

.public-upload-tour-launcher:hover .public-upload-tour-launcher-arrow {
  transform: translateX(3px);
}

.public-upload-tour-launcher:focus-visible {
  outline: 3px solid rgba(250, 215, 65, .8);
  outline-offset: 3px;
}

.upload-guided-tour[hidden] {
  display: none !important;
}

html.upload-guided-tour-active {
  scroll-behavior: auto !important;
  overscroll-behavior: none;
}

.upload-guided-tour {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  pointer-events: auto;
  font-family: var(--public-font-body), system-ui, sans-serif;
  touch-action: none;
}

.upload-guided-tour-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1;
  opacity: 0;
  background: rgba(4, 19, 43, .76);
  backdrop-filter: blur(2px);
  transition: opacity 180ms ease;
}

.upload-guided-tour.is-centered .upload-guided-tour-backdrop {
  opacity: 1;
}

.upload-guided-tour-spotlight {
  position: fixed;
  z-index: 2;
  border: 2px solid #fad741;
  border-radius: 17px;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(4, 19, 43, .76),
    0 0 0 7px rgba(250, 215, 65, .2),
    0 18px 48px rgba(0, 34, 80, .3);
  pointer-events: none;
  transition: left 180ms ease, top 180ms ease, width 180ms ease, height 180ms ease;
}

.upload-guided-tour-spotlight[hidden] {
  display: none !important;
}

.upload-guided-tour-card {
  --upload-tour-surface: #fffefa;
  position: fixed;
  z-index: 3;
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  overflow: visible;
  padding: 0 !important;
  color: #17304f;
  border: 1px solid rgba(13, 55, 104, .16);
  border-top: 5px solid #fad741;
  border-radius: 20px;
  background: var(--upload-tour-surface);
  box-shadow: 0 28px 90px rgba(1, 22, 54, .38);
  pointer-events: auto;
}

/* The public theme deliberately styles every class ending in “-card”.
   This modal owns its geometry, so keep the global card customizer out. */
body.upload-database-page .upload-guided-tour-card {
  padding: 0 !important;
  border-width: 5px 1px 1px !important;
  border-style: solid !important;
  border-color: #fad741 rgba(13, 55, 104, .16) rgba(13, 55, 104, .16) !important;
  border-radius: 20px !important;
  box-shadow: 0 28px 90px rgba(1, 22, 54, .38) !important;
  transition: none !important;
}

body.upload-database-page .upload-guided-tour-card:hover {
  box-shadow: 0 28px 90px rgba(1, 22, 54, .38) !important;
}

body.upload-database-page .upload-guided-tour-card:not([data-side="center"]):hover {
  transform: none !important;
}

.upload-guided-tour-card::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--upload-tour-surface);
  transform: rotate(45deg);
}

.upload-guided-tour-card[data-side="right"]::after {
  left: -9px;
  top: calc(50% - 8px);
  border-bottom: 1px solid rgba(13, 55, 104, .16);
  border-left: 1px solid rgba(13, 55, 104, .16);
}

.upload-guided-tour-card[data-side="left"]::after {
  right: -9px;
  top: calc(50% - 8px);
  border-right: 1px solid rgba(13, 55, 104, .16);
  border-top: 1px solid rgba(13, 55, 104, .16);
}

.upload-guided-tour-card[data-side="bottom"]::after {
  left: calc(50% - 8px);
  top: -9px;
  border-left: 1px solid rgba(13, 55, 104, .16);
  border-top: 1px solid rgba(13, 55, 104, .16);
}

.upload-guided-tour-card[data-side="top"]::after {
  left: calc(50% - 8px);
  bottom: -9px;
  border-right: 1px solid rgba(13, 55, 104, .16);
  border-bottom: 1px solid rgba(13, 55, 104, .16);
}

.upload-guided-tour-card[data-side="center"]::after,
.upload-guided-tour-card[data-side="bottom-sheet"]::after {
  display: none;
}

.upload-guided-tour .upload-guided-tour-card[data-side="center"] {
  right: auto !important;
  bottom: auto !important;
  left: 50% !important;
  top: 50% !important;
  transform: translate(-50%, -50%) !important;
}

.upload-guided-tour-card.is-entering {
  animation: uploadGuidedTourIn 220ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes uploadGuidedTourIn {
  from { opacity: 0; filter: blur(2px); }
  to { opacity: 1; filter: blur(0); }
}

.upload-guided-tour-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px 12px;
}

.upload-guided-tour-identity {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 11px;
}

.upload-guided-tour-identity > div {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.upload-guided-tour-identity > div > span {
  overflow: hidden;
  color: #8a6500;
  font-family: var(--public-font-data), ui-monospace, monospace;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.upload-guided-tour-identity strong {
  color: #17365f;
  font-size: 13px;
  font-weight: 800;
}

.upload-guided-tour-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  color: #1e28a5;
  border: 1px solid rgba(30, 40, 165, .15);
  border-radius: 14px 14px 14px 5px;
  background: rgba(250, 215, 65, .32);
  font-size: 21px;
}

.upload-guided-tour-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  padding: 0;
  color: #5d6a7c;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.upload-guided-tour-close:hover {
  color: #17365f;
  background: #edf2f9;
}

.upload-guided-tour-progress {
  height: 4px;
  overflow: hidden;
  background: #e8edf5;
}

.upload-guided-tour-progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 0 999px 999px 0;
  background: linear-gradient(90deg, #f55a78, #fad741);
  transition: width 220ms ease;
}

.upload-guided-tour-content {
  padding: 20px 22px 19px;
}

.upload-guided-tour-count {
  margin-bottom: 7px;
  color: #68758a;
  font-family: var(--public-font-data), ui-monospace, monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
}

.upload-guided-tour-content h2 {
  margin: 0 0 10px;
  color: #0a3264;
  font-family: var(--public-font-display), system-ui, sans-serif;
  font-size: clamp(21px, 2.2vw, 25px);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -.025em;
}

.upload-guided-tour-content > p {
  margin: 0;
  color: #40536b;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.58;
}

.upload-guided-tour-tip {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  margin-top: 15px;
  padding: 12px 13px;
  color: #594300;
  border: 1px solid #eed47e;
  border-radius: 13px;
  background: #fff7d7;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.48;
}

.upload-guided-tour-tip > .material-symbols-outlined {
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  color: #765600;
  font-size: 18px;
}

.upload-guided-tour-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 18px 18px;
  border-top: 1px solid #e7ebf1;
}

.upload-guided-tour-primary,
.upload-guided-tour-secondary {
  min-width: 112px;
  min-height: 42px;
  padding: 0 17px;
  border-radius: 12px;
  font-family: var(--public-font-action), system-ui, sans-serif;
  font-size: 14px;
  font-weight: 850;
  cursor: pointer;
}

.upload-guided-tour-primary {
  color: #fff;
  border: 1px solid #1e28a5;
  background: #1e28a5;
  box-shadow: 0 7px 18px rgba(30, 40, 165, .24);
}

.upload-guided-tour-primary:hover {
  background: #161d7a;
}

.upload-guided-tour-secondary {
  color: #17365f;
  border: 1px solid #c9d5e2;
  background: #fff;
}

/* Atajo "Saltar al final": terciario discreto entre Atrás y Continuar */
.upload-guided-tour-skip {
  margin-right: auto;
  margin-left: 10px;
  min-height: 42px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: #4a5b8c;
  font-family: var(--public-font-action), system-ui, sans-serif;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.upload-guided-tour-skip:hover { color: #1f2493; }
.upload-guided-tour-skip[hidden] { display: none; }

.upload-guided-tour-secondary:hover {
  background: #edf4fb;
}

.upload-guided-tour-secondary:disabled {
  cursor: default;
  opacity: .42;
}

.upload-guided-tour-card.is-assistance-offer {
  border-top-color: #f55a78 !important;
}

.upload-guided-tour-card.is-assistance-offer .upload-guided-tour-mark {
  color: #fff;
  background: #f55a78;
}

.upload-guided-tour-card.is-assistance-offer .upload-guided-tour-tip {
  border-color: rgba(245, 90, 120, .2);
  background: #fff1f4;
}

.upload-assisted-guide[hidden] {
  display: none !important;
}

body.upload-assisted-mode .public-tool-upload-layout {
  padding-bottom: min(42vh, 380px);
}

body.upload-assisted-mode .public-tool-side-progress {
  width: min(380px, calc(100vw - 36px));
  max-height: min(76dvh, 720px);
  overflow-x: hidden !important;
  overflow-y: auto !important;
  border-color: rgba(245, 90, 120, .42) !important;
  box-shadow: 0 24px 70px rgba(6, 28, 66, .24), 0 0 0 5px rgba(250, 215, 65, .14) !important;
}

.upload-assisted-guide {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(30, 40, 165, .12);
  color: #17304f;
}

.upload-assisted-guide-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
}

.upload-assisted-guide-head > .material-symbols-outlined {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 11px;
  background: #1e28a5;
  box-shadow: 0 8px 18px rgba(30, 40, 165, .22);
}

.upload-assisted-guide-head > div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.upload-assisted-guide-head small {
  overflow: hidden;
  color: #8a6500;
  font-family: var(--public-font-data), ui-monospace, monospace;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.upload-assisted-guide-head strong {
  overflow: hidden;
  color: #11184f;
  font-size: 15px;
  font-weight: 900;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#uploadAssistedClose {
  width: 30px;
  height: 30px;
  padding: 0;
  color: #65758b;
  border: 0;
  border-radius: 10px;
  background: transparent;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

#uploadAssistedClose:hover {
  color: #132d50;
  background: #edf4fb;
}

.upload-assisted-status {
  width: fit-content;
  margin-top: 13px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #17365f;
  border: 1px solid rgba(30, 40, 165, .12);
  border-radius: 999px;
  background: #f4f7fb;
  font-size: 10px;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.upload-assisted-status-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #1e28a5;
}

.upload-assisted-status[data-tone="working"] {
  color: #6f5400;
  border-color: rgba(250, 188, 31, .28);
  background: #fff8db;
}

.upload-assisted-status[data-tone="working"] .upload-assisted-status-dot {
  background: #f0a800;
  animation: uploadAssistedPulse 1.05s ease-in-out infinite;
}

.upload-assisted-status[data-tone="ready"] {
  color: #0b6f58;
  border-color: rgba(16, 151, 116, .2);
  background: #eaf9f3;
}

.upload-assisted-status[data-tone="ready"] .upload-assisted-status-dot { background: #109774; }

.upload-assisted-status[data-tone="error"] {
  color: #a32945;
  border-color: rgba(216, 55, 92, .22);
  background: #fff0f3;
}

.upload-assisted-status[data-tone="error"] .upload-assisted-status-dot { background: #d8375c; }

@keyframes uploadAssistedPulse {
  0%, 100% { opacity: .45; transform: scale(.82); }
  50% { opacity: 1; transform: scale(1.18); }
}

.public-tool-side-progress #uploadAssistedDetail {
  margin: 11px 0 0;
  display: block;
  color: #4b5f78;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.55;
}

.upload-assisted-show {
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  border: 1px solid #1e28a5;
  border-radius: 12px;
  background: #1e28a5;
  font-family: var(--public-font-action), system-ui, sans-serif;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(30, 40, 165, .2);
}

.upload-assisted-show:hover { background: #161d7a; }
.upload-assisted-show:disabled { cursor: default; opacity: .52; }

/* «OK, siguiente»: confirma la parada actual del recorrido de metadatos */
.upload-assisted-next {
  background: #1f2493;
  border-color: #1f2493;
  color: #fff;
}
.upload-assisted-next:hover { background: #171b74; }
.upload-assisted-next[hidden] { display: none; }

[data-upload-assist-target="true"] {
  outline: 3px solid #fad741 !important;
  outline-offset: 6px !important;
  box-shadow: 0 0 0 10px rgba(250, 215, 65, .16), 0 18px 42px rgba(15, 40, 78, .14) !important;
  scroll-margin-top: 110px;
  animation: uploadAssistedTarget 1.8s ease-in-out infinite;
}

/* Cuando lo que toca es PULSAR (Continuar, ejecutar…), el botón señalado se
   transforma entero: fondo miel, tinta azul, escala y anillo coral pulsante,
   más una mano flotante. Un contorno fino amarillo sobre fondo blanco era
   invisible en la práctica; esto se ve desde la otra punta de la sala. */
button[data-upload-assist-target="true"],
a[data-upload-assist-target="true"],
.button.primary[data-upload-assist-target="true"],
.flow-actions .button[data-upload-assist-target="true"] {
  position: relative !important;
  background: #fad741 !important;
  color: #17365f !important;
  border-color: #b58300 !important;
  transform: scale(1.05);
  outline: 4px solid #f55a78 !important;
  outline-offset: 3px !important;
  box-shadow:
    0 0 0 10px rgba(245, 90, 120, .22),
    0 0 30px 10px rgba(250, 215, 65, .65),
    0 18px 42px rgba(15, 40, 78, .2) !important;
  animation: uploadAssistedButton 1.4s ease-in-out infinite !important;
}
button[data-upload-assist-target="true"]::after,
a[data-upload-assist-target="true"]::after {
  content: "👉";
  position: absolute;
  left: -44px;
  top: 50%;
  translate: 0 -50%;
  font-size: 26px;
  line-height: 1;
  animation: uploadAssistedPoint 1s ease-in-out infinite;
  pointer-events: none;
}
/* En el boton flotante del panel lateral la mano vive DENTRO (a la
   izquierda no hay sitio: se recortaria contra el borde del panel). */
.public-tool-floating-next[data-upload-assist-target="true"]::after {
  left: 12px;
  font-size: 20px;
}
@keyframes uploadAssistedButton {
  0%, 100% { outline-color: #f55a78; }
  50% { outline-color: #fad741; }
}
@keyframes uploadAssistedPoint {
  0%, 100% { margin-left: 0; }
  50% { margin-left: 8px; }
}

@keyframes uploadAssistedTarget {
  0%, 100% { outline-color: #fad741; }
  50% { outline-color: #f55a78; }
}

.upload-guided-tour :is(button, [href]):focus-visible {
  outline: 3px solid rgba(250, 215, 65, .88);
  outline-offset: 3px;
}

@media (max-width: 1040px) {
  .public-upload-tour-launcher {
    order: -2;
  }
}

@media (max-width: 760px) {
  html.upload-guided-tour-active body.upload-database-page .public-tool-upload-layout {
    padding-bottom: 60vh;
  }

  body.upload-assisted-mode .public-tool-upload-layout {
    padding-bottom: 62vh;
  }

  body.upload-assisted-mode .public-tool-side-progress {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: min(55dvh, 500px);
  }

  .upload-guided-tour-card[data-side="bottom-sheet"] {
    width: auto;
    height: min(54dvh, 520px);
    max-height: min(54dvh, 520px);
    display: grid;
    grid-template-rows: auto auto minmax(0, 1fr) auto;
    overflow: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
    border-radius: 19px 19px calc(19px + env(safe-area-inset-bottom)) calc(19px + env(safe-area-inset-bottom));
  }

  .upload-guided-tour-card[data-side="bottom-sheet"] .upload-guided-tour-content {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .upload-guided-tour-header { padding: 13px 14px 10px; }
  .upload-guided-tour-content { padding: 15px 16px 14px; }
  .upload-guided-tour-content h2 { font-size: 20px; }
  .upload-guided-tour-tip { margin-top: 11px; padding: 10px 11px; }

  .upload-guided-tour-footer {
    padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  }

  .upload-guided-tour-footer > button {
    flex: 1 1 0;
    min-width: 0;
  }
}

@media (min-width: 761px) and (max-height: 650px) {
  .upload-guided-tour-card {
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  .upload-guided-tour-card::after {
    display: none;
  }
}

/* ===== Modo asistido: foco oscurecido + globo contextual =====
   La misma experiencia que la guía del centro de curación, en versión NO
   bloqueante: el recorte ilumina el control actual, el resto de la página se
   oscurece pero sigue siendo interactiva (aquí la persona debe escribir). */
.upload-assist-focus {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.upload-assist-focus[hidden] { display: none !important; }

.upload-assist-hole {
  position: fixed;
  border: 2px solid #fad741;
  border-radius: 18px;
  background: transparent;
  pointer-events: none;
  box-shadow:
    0 0 0 9999px rgba(4, 19, 43, .52),
    0 0 0 7px rgba(250, 215, 65, .22),
    0 18px 48px rgba(0, 34, 80, .28);
  transition:
    left .45s cubic-bezier(.22, .9, .26, 1),
    top .45s cubic-bezier(.22, .9, .26, 1),
    width .45s cubic-bezier(.22, .9, .26, 1),
    height .45s cubic-bezier(.22, .9, .26, 1),
    opacity .3s ease;
  animation: uploadAssistHoleBreath 2.6s ease-in-out infinite;
}

@keyframes uploadAssistHoleBreath {
  0%, 100% { box-shadow: 0 0 0 9999px rgba(4, 19, 43, .52), 0 0 0 7px rgba(250, 215, 65, .22), 0 18px 48px rgba(0, 34, 80, .28); }
  50% { box-shadow: 0 0 0 9999px rgba(4, 19, 43, .46), 0 0 0 12px rgba(250, 215, 65, .3), 0 18px 48px rgba(0, 34, 80, .28); }
}

.upload-assist-pop {
  position: fixed;
  z-index: 1201;
  width: min(330px, calc(100vw - 24px));
  padding: 0;
  color: #17304f;
  border: 1px solid rgba(13, 55, 104, .16);
  border-top: 5px solid #fad741;
  border-radius: 18px;
  background: #fffefa;
  box-shadow: 0 24px 70px rgba(1, 22, 54, .42);
  pointer-events: auto;
  transition:
    left .45s cubic-bezier(.22, .9, .26, 1),
    top .45s cubic-bezier(.22, .9, .26, 1);
}

.upload-assist-pop[hidden] { display: none !important; }

.upload-assist-pop.is-entering {
  animation: uploadAssistPopIn 280ms cubic-bezier(.2, .8, .2, 1);
}

@keyframes uploadAssistPopIn {
  from { opacity: 0; transform: translateY(10px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.upload-assist-pop-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px 0;
}

.upload-assist-pop-step {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
  color: #5a6c8b;
  white-space: nowrap;
}

.upload-assist-pop-tone {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(30, 40, 165, .07);
}

.upload-assist-pop-tone i {
  width: 9px;
  height: 9px;
  flex: none;
  border-radius: 50%;
  background: #1e28a5;
  animation: uploadAssistedPulse 1.8s ease-in-out infinite;
}

.upload-assist-pop-tone b {
  font-size: 11.5px;
  font-weight: 850;
  color: #1f2d55;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upload-assist-pop-tone[data-tone="working"] i { background: #d99a06; }
.upload-assist-pop-tone[data-tone="working"] { background: rgba(217, 154, 6, .13); }
.upload-assist-pop-tone[data-tone="ready"] i { background: #167246; animation: none; }
.upload-assist-pop-tone[data-tone="ready"] { background: rgba(22, 114, 70, .12); }
.upload-assist-pop-tone[data-tone="error"] i { background: #f55a78; }
.upload-assist-pop-tone[data-tone="error"] { background: rgba(245, 90, 120, .13); }

.upload-assist-pop-close {
  margin-left: auto;
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 1px solid rgba(13, 55, 104, .16);
  border-radius: 50%;
  background: #fff;
  color: #44557a;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.upload-assist-pop-close:hover { border-color: #f55a78; color: #f55a78; }

.upload-assist-pop-text {
  margin: 10px 0 0;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.55;
  color: #33445f;
}

.upload-assist-pop-foot {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px 14px;
}

.upload-assist-pop-foot:has(.upload-assist-pop-ok[hidden]) { padding-top: 8px; }

/* El atributo hidden DEBE ganar al display de la clase: sin esta regla, el
   inline-flex de abajo lo pisaba y el «OK» aparecía cuando no tocaba. */
.upload-assist-pop-ok[hidden] {
  display: none !important;
}

.upload-assist-pop-ok {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 16px;
  border: 2px solid #b58300;
  border-radius: 999px;
  background: #fad741;
  color: #17365f;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease;
}

.upload-assist-pop-ok:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(181, 131, 0, .3);
}

.upload-assist-pop-ok:active { transform: translateY(0) scale(.98); }

.upload-assist-pop-ok .material-symbols-outlined { font-size: 17px; }

.upload-assist-pop[data-side="bottom-sheet"] {
  width: auto;
  border-radius: 18px 18px 14px 14px;
}

/* ===== Estado «Waggle está trabajando»: vida en pantalla ===== */
/* Cinturón: el «OK, siguiente» JAMÁS durante una operación. */
.upload-assist-pop[data-tone="working"] .upload-assist-pop-ok {
  display: none !important;
}

.upload-assist-pop-workbar {
  display: none;
  height: 6px;
  margin: 10px 14px 0;
  border-radius: 999px;
  background: rgba(30, 40, 165, .08);
  overflow: hidden;
}

.upload-assist-pop[data-tone="working"] .upload-assist-pop-workbar {
  display: block;
}

.upload-assist-pop-workbar span {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #fad741, #f5a623);
  animation: uploadWorkbarSlide 1.1s ease-in-out infinite alternate;
}

@keyframes uploadWorkbarSlide {
  from { margin-left: 0; }
  to { margin-left: 60%; }
}

/* El hueco del foco respira más deprisa y una abeja revolotea encima. */
.upload-assist-focus[data-tone="working"] .upload-assist-hole {
  border-style: dashed;
  animation: uploadAssistHoleBreath 1.1s ease-in-out infinite;
}

.upload-assist-focus[data-tone="working"] .upload-assist-hole::after {
  content: '🐝';
  position: absolute;
  top: -18px;
  right: -6px;
  font-size: 27px;
  filter: drop-shadow(0 4px 8px rgba(4, 19, 43, .35));
  animation: uploadBeeBuzz 1.7s ease-in-out infinite;
}

@keyframes uploadBeeBuzz {
  0%, 100% { transform: translate(0, 0) rotate(-10deg); }
  25% { transform: translate(-16px, -9px) rotate(8deg); }
  50% { transform: translate(-30px, 3px) rotate(-6deg); }
  75% { transform: translate(-12px, 10px) rotate(10deg); }
}

@media (prefers-reduced-motion: reduce) {
  .public-upload-tour-launcher,
  .public-upload-tour-launcher-arrow,
  .upload-guided-tour-backdrop,
  .upload-guided-tour-spotlight,
  .upload-guided-tour-progress > span {
    transition: none;
  }

  .upload-guided-tour-card.is-entering {
    animation: none;
  }

  .upload-assisted-status-dot,
  [data-upload-assist-target="true"],
  [data-upload-assist-target="true"]::after {
    animation: none !important;
  }

  .upload-assist-hole,
  .upload-assist-pop {
    transition: none;
    animation: none;
  }

  .upload-assist-pop.is-entering,
  .upload-assist-pop-tone i,
  .upload-assist-pop-workbar span,
  .upload-assist-focus[data-tone="working"] .upload-assist-hole::after {
    animation: none;
  }
}

@media (max-width: 760px) {
  body.upload-database-page .public-tool-side-progress,
  body.upload-assisted-mode.upload-database-page .public-tool-side-progress {
    position: static;
    width: 100%;
    max-height: none;
    margin-top: 16px;
    box-sizing: border-box;
  }
  body.upload-assisted-mode .public-tool-upload-layout { padding-bottom: 24px; }
}
