.upload-overlay {
  position: fixed;
  inset: 0;
  background: rgba(9, 10, 14, 0.84);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.upload-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.overlay-card {
  background: var(--bg-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-modal);
  padding: 30px 32px 26px;
  max-width: 430px;
  width: 90%;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.6);
}

/* ── Head: icon, what is happening, and the elapsed clock ───────────────── */

.overlay-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.overlay-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 14px;
  background: var(--elec-soft);
  border: 1px solid var(--elec-line);
  color: var(--elec);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay-bolt {
  width: 21px;
  height: 21px;
  animation: bolt-pulse 1.5s ease-in-out infinite;
}

@keyframes bolt-pulse {
  0%, 100% { transform: scale(1);    opacity: .9; }
  50%      { transform: scale(1.12); opacity: 1; }
}

.overlay-headings { flex: 1; min-width: 0; }

.overlay-message {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -.5px;
  color: var(--text);
  transition: opacity .2s ease;
}

.overlay-file {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-4);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.overlay-file[hidden] { display: none; }

.overlay-elapsed {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.overlay-elapsed[hidden] { display: none; }

/* ── Progress ────────────────────────────────────────────────────────────
   Determinate only while there are bytes to measure. */

.overlay-progress-track {
  width: 100%;
  height: 6px;
  background: var(--surface-2);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 18px;
}

.overlay-progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  width: 0%;
  transition: width .25s ease-out;
}

.overlay-progress-track.done .overlay-progress-fill { background: var(--lime-bar); }

/* No signal from the server about how far along the LLM is — so the bar stops
   claiming a percentage and just shows that work is happening. */
.overlay-progress-track.indeterminate .overlay-progress-fill {
  width: 100%;
  transition: none;
  background: linear-gradient(90deg,
    transparent 0%, var(--accent) 38%, var(--lime) 68%, transparent 100%);
  background-size: 42% 100%;
  background-repeat: no-repeat;
  animation: overlay-sweep 1.3s ease-in-out infinite;
}

@keyframes overlay-sweep {
  0%   { background-position: -42% 0; }
  100% { background-position: 142% 0; }
}

/* ── What the server is actually doing ───────────────────────────────────
   The wait is long enough that "analizando con IA" is not an answer. These are
   the pipeline's real steps, in order, without pretending to know which one is
   running: no ticks, no fake progress. The privacy step is the one worth
   colouring — it is the reassurance the user came for. */

.overlay-steps {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  padding: 13px 15px;
  margin-bottom: 16px;
}
.overlay-steps[hidden] { display: none; }

.overlay-steps-title {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  color: var(--text-4);
  margin-bottom: 9px;
}

.overlay-steps ul { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.overlay-steps li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  color: var(--text-2);
  text-align: left;
}
.overlay-steps li::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-4);
  flex-shrink: 0;
}
.overlay-steps li.is-privacy { color: var(--lime); }
.overlay-steps li.is-privacy::before { background: var(--lime); }

.overlay-hint {
  font-size: 11.5px;
  color: var(--text-4);
  line-height: 1.5;
  text-align: center;
  transition: color .2s;
}
.overlay-hint.warn { color: var(--elec); }

.overlay-cancel {
  display: block;
  width: 100%;
  margin-top: 14px;
  background: none;
  border: 1px solid var(--border-strong);
  color: var(--text-3);
  border-radius: 11px;
  padding: 10px;
  font-size: 12.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.overlay-cancel:hover { border-color: var(--red); color: var(--red); }
.overlay-cancel[hidden] { display: none; }

@media (prefers-reduced-motion: reduce) {
  .overlay-bolt { animation: none; }
  .overlay-progress-track.indeterminate .overlay-progress-fill { animation: none; opacity: .6; }
}
