/* ════════════════════════════════════════════════════════════════════
   NV Gestor · Entrega Automática 7.1 (nv-entrega-700.css)
   Rediseño minimalista encima de nv-entrega-610.css. Todo va dentro de
   .nve-ov.nv7e, usa solo las variables del tema elegido (--bg, --bg2,
   --text, --accent...) y anima con transform y opacity. Con "reducir
   movimiento" se queda quieto.
   ════════════════════════════════════════════════════════════════════ */

.nve-ov.nv7e {
  --n7-c: var(--accent);
  --n7-c2: var(--accent2, var(--accent));
  --n7-line: color-mix(in srgb, var(--text) 9%, transparent);
  --n7-soft: color-mix(in srgb, var(--text) 4%, transparent);
  --n7-ez: cubic-bezier(.22, 1, .36, 1);
  --n7-sp: cubic-bezier(.34, 1.36, .64, 1);
  background: color-mix(in srgb, var(--bg, #000) 62%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.1); backdrop-filter: blur(14px) saturate(1.1);
}

/* ── Ventana ──────────────────────────────────────────────────────── */
.nve-ov.nv7e .nve-card {
  width: min(760px, 100%);
  border-radius: 24px;
  border: 1px solid var(--n7-line);
  background:
    radial-gradient(120% 60% at 100% 0%, color-mix(in srgb, var(--n7-c) 9%, transparent), transparent 60%),
    var(--bg2);
  box-shadow: 0 1px 0 color-mix(in srgb, #fff 6%, transparent) inset, 0 40px 120px -30px rgba(0, 0, 0, .65);
  transform: translateY(18px) scale(.965); filter: blur(4px);
  transition: transform .5s var(--n7-sp), opacity .3s var(--n7-ez), filter .4s var(--n7-ez);
}
.nve-ov.nv7e.on .nve-card { transform: none; filter: none; }

.nve-ov.nv7e .nve-h { padding: 16px 18px 14px; gap: 12px; border-bottom: 1px solid var(--n7-line); }
.nve-ov.nv7e .nve-logo {
  width: 38px; height: 38px; border-radius: 12px; color: var(--n7-c2);
  background: conic-gradient(from 210deg, color-mix(in srgb, var(--n7-c) 26%, transparent), color-mix(in srgb, var(--n7-c2) 8%, transparent), color-mix(in srgb, var(--n7-c) 26%, transparent));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--n7-c) 30%, transparent) inset, 0 10px 24px -14px var(--n7-c);
  animation: n7Flota 6s ease-in-out infinite;
}
.nve-ov.nv7e .nve-logo i { animation: n7Chispa 2.8s ease-in-out infinite; }
.nve-ov.nv7e .nve-ht h3 { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.nve-ov.nv7e .nve-ht p { font-size: 12px; letter-spacing: .01em; }
.nve-ov.nv7e .nve-hb, .nve-ov.nv7e .nve-x { border-color: var(--n7-line); background: var(--n7-soft); }

/* Interruptores IA / Envío auto */
.nv7e-sws { display: flex; gap: 6px; flex-shrink: 0; }
.nv7e-sw {
  display: inline-flex; align-items: center; gap: 7px; height: 30px; padding: 0 11px 0 7px;
  border-radius: 999px; border: 1px solid var(--n7-line); background: var(--n7-soft);
  color: var(--text3); font: 650 11.5px/1 var(--nv-font-ui, inherit); cursor: pointer; white-space: nowrap;
  transition: color .25s ease, background .25s ease, border-color .25s ease, transform .2s var(--n7-sp);
}
.nv7e-sw i { position: relative; width: 24px; height: 14px; border-radius: 999px; background: color-mix(in srgb, var(--text) 16%, transparent); transition: background .25s ease; flex-shrink: 0; }
.nv7e-sw i::after { content: ''; position: absolute; top: 2px; left: 2px; width: 10px; height: 10px; border-radius: 50%; background: var(--bg2); box-shadow: 0 1px 3px rgba(0,0,0,.35); transition: transform .32s var(--n7-sp); }
.nv7e-sw[aria-pressed="true"] { color: var(--text); border-color: color-mix(in srgb, var(--n7-c) 40%, var(--n7-line)); background: color-mix(in srgb, var(--n7-c) 10%, transparent); }
.nv7e-sw[aria-pressed="true"] i { background: var(--n7-c); }
.nv7e-sw[aria-pressed="true"] i::after { transform: translateX(10px); }
.nv7e-sw:active { transform: scale(.95); }
.nv7e-sw:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--n7-c) 40%, transparent); }
@media (max-width: 640px) {
  .nve-ov.nv7e .nve-hb span { display: none; }
  .nv7e-sw { padding: 0 8px 0 6px; }
  .nv7e-sw span { font-size: 11px; }
}
.nv7e-sw .s { display: none; }
.nve-ov.nv7e .nve-ht h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .nve-ov.nv7e .nve-h { gap: 8px; padding: 12px 12px 10px; }
  .nve-ov.nv7e .nve-logo { width: 32px; height: 32px; border-radius: 10px; }
  .nve-ov.nv7e .nve-ht p { display: none; }
  .nve-ov.nv7e .nve-ht h3 { font-size: 15px; }
  .nv7e-sws { gap: 4px; }
  .nv7e-sw .l { display: none; }
  .nv7e-sw .s { display: inline; }
}
@media (max-width: 360px) { .nve-ov.nv7e .nve-hb { display: none; } }

/* ── Conversación ─────────────────────────────────────────────────── */
.nve-ov.nv7e .nve-log { padding: 18px 18px 12px; gap: 12px; }
.nve-ov.nv7e .nve-m { animation: n7Sube .5s var(--n7-ez) both; }
.nve-ov.nv7e .nve-b { border-radius: 16px; font-size: 13.5px; line-height: 1.55; }
.nve-ov.nv7e .nve-m--bot .nve-b { background: transparent; border: 0; padding: 4px 2px; }
.nve-ov.nv7e .nve-m--bot.nve-res .nve-b,
.nve-ov.nv7e .nve-m--bot.nve-chatm .nve-b { padding: 0; }
.nve-ov.nv7e .nve-m--yo .nve-b { background: color-mix(in srgb, var(--n7-c) 14%, var(--bg3)); border-color: transparent; border-bottom-right-radius: 6px; }
.nve-ov.nv7e .nve-m--bot.nve-hola .nve-b { padding: 6px 2px; }
.nve-ov.nv7e .nve-dropz {
  border-radius: 18px; border: 1.5px dashed color-mix(in srgb, var(--n7-c) 35%, var(--n7-line));
  background: color-mix(in srgb, var(--n7-c) 5%, transparent); transition: transform .25s var(--n7-sp), background .25s ease, border-color .25s ease;
}
.nve-ov.nv7e .nve-dropz:hover { transform: translateY(-2px); background: color-mix(in srgb, var(--n7-c) 9%, transparent); border-color: var(--n7-c); }
.nve-ov.nv7e .nve-dropz svg { animation: n7Flota 4s ease-in-out infinite; }
.nve-ov.nv7e .nve-chip { border-color: var(--n7-line); background: var(--n7-soft); }
.nve-ov.nv7e .nve-ej .nve-chip { animation: n7Sube .5s var(--n7-ez) both; }
.nve-ov.nv7e .nve-ej .nve-chip:nth-child(2) { animation-delay: .05s; }
.nve-ov.nv7e .nve-ej .nve-chip:nth-child(3) { animation-delay: .1s; }
.nve-ov.nv7e .nve-ej .nve-chip:nth-child(4) { animation-delay: .15s; }
.nve-ov.nv7e .nve-ej .nve-chip:nth-child(5) { animation-delay: .2s; }

/* Captura leída con IA: brillo que recorre la imagen */
.nve-ov.nv7e .nve-scan { border-radius: 18px; border-bottom-right-radius: 6px; border-color: transparent; background: color-mix(in srgb, var(--n7-c) 10%, var(--bg3)); }
.nve-ov.nv7e .nve-scan-in { border-radius: 13px; }
.nve-ov.nv7e .nve-scan.nv7e-ia .nve-scan-in::after {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: 0;
  background: linear-gradient(115deg, transparent 30%, color-mix(in srgb, var(--n7-c2) 30%, transparent) 48%, color-mix(in srgb, #fff 22%, transparent) 50%, color-mix(in srgb, var(--n7-c2) 30%, transparent) 52%, transparent 70%);
  background-size: 250% 100%;
}
.nve-ov.nv7e .nve-scan.nv7e-ia.leyendo .nve-scan-in::after { opacity: 1; animation: n7Brillo 1.6s linear infinite; }
.nve-ov.nv7e .nve-scan.nv7e-ia.leyendo img { filter: saturate(.85) brightness(.92); transition: filter .4s ease; }
.nve-ov.nv7e .nve-scan.listo { animation: n7Listo .6s var(--n7-sp); }

/* ── Tarjetas de entrega ──────────────────────────────────────────── */
.nve-ov.nv7e .nve-cards { gap: 12px; }
.nve-ov.nv7e .nve-tj {
  border-radius: 18px; border-color: var(--n7-line); background: color-mix(in srgb, var(--bg) 35%, var(--bg2));
  padding: 14px; animation: n7Tarjeta .6s var(--n7-sp) both;
  transition: border-color .25s ease, transform .3s var(--n7-ez), box-shadow .3s var(--n7-ez), opacity .2s ease;
}
.nve-ov.nv7e .nve-tj:hover { transform: translateY(-2px); box-shadow: 0 18px 40px -26px rgba(0,0,0,.7); border-color: color-mix(in srgb, var(--n7-c) 26%, var(--n7-line)); }
.nve-ov.nv7e .nve-tj[data-st="ok"] { border-color: color-mix(in srgb, var(--green, var(--n7-c)) 45%, var(--n7-line)); }
.nve-ov.nv7e .nve-pi { border-radius: 10px; box-shadow: 0 6px 16px -10px rgba(0,0,0,.6); }
.nve-ov.nv7e .nve-btn { border-radius: 12px; border-color: var(--n7-line); }
.nve-ov.nv7e .nve-btn--pri { border-color: transparent; position: relative; overflow: hidden; }
.nve-ov.nv7e .nve-btn--pri::after { content: ''; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 35%, rgba(255,255,255,.28) 50%, transparent 65%); transform: translateX(-120%); }
.nve-ov.nv7e .nve-btn--pri:not(:disabled):hover::after { transform: translateX(120%); transition: transform .7s var(--n7-ez); }

/* ── Escribir ─────────────────────────────────────────────────────── */
.nve-ov.nv7e .nve-comp { padding: 12px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--n7-line); background: transparent; }
.nve-ov.nv7e .nve-comp textarea { border-radius: 16px; border-color: var(--n7-line); background: var(--n7-soft); padding: 11px 14px; transition: border-color .2s ease, box-shadow .25s ease; }
.nve-ov.nv7e .nve-comp textarea:focus { border-color: color-mix(in srgb, var(--n7-c) 60%, transparent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--n7-c) 14%, transparent); }
.nve-ov.nv7e .nve-att, .nve-ov.nv7e .nve-send { width: 42px; height: 42px; border-radius: 14px; }
.nve-ov.nv7e .nve-att { border-color: var(--n7-line); background: var(--n7-soft); }
.nve-ov.nv7e .nve-send { box-shadow: 0 10px 24px -14px var(--n7-c); }
.nve-ov.nv7e .nve-send:hover svg { transform: translateX(2px) rotate(-8deg); }
.nve-ov.nv7e .nve-send svg { transition: transform .25s var(--n7-sp); }

/* ── Lo que entendí / pensando ────────────────────────────────────── */
.nv7e-orb { position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, #fff 60%, var(--n7-c2)), var(--n7-c) 55%, color-mix(in srgb, var(--n7-c) 40%, #000)); box-shadow: 0 0 18px -2px color-mix(in srgb, var(--n7-c) 70%, transparent); animation: n7Orbe 2.4s ease-in-out infinite; }
.nv7e-orb i { position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid color-mix(in srgb, var(--n7-c2) 55%, transparent); border-top-color: transparent; border-left-color: transparent; animation: n7Gira 1.4s linear infinite; }
.nv7e-think { display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 8px; border-radius: 999px; background: var(--n7-soft); border: 1px solid var(--n7-line); font-size: 13px; color: var(--text2); }
.nv7e-think span:last-child { background: linear-gradient(90deg, var(--text2) 0%, var(--text) 40%, var(--text2) 80%); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: n7Brillo 1.8s linear infinite; }
.nv7e-pm.fuera { opacity: 0; transform: translateY(-4px) scale(.98); transition: opacity .2s ease, transform .2s ease; }

.nv7e-pense { border: 1px solid var(--n7-line); border-radius: 18px; padding: 14px; background: linear-gradient(160deg, color-mix(in srgb, var(--n7-c) 8%, transparent), transparent 55%), var(--n7-soft); display: grid; gap: 10px; }
.nv7e-pense-h { display: flex; align-items: center; gap: 10px; }
.nv7e-pense-h .nv7e-orb { width: 18px; height: 18px; animation: n7Orbe 3.2s ease-in-out infinite; }
.nv7e-pense-h .nv7e-orb i { display: none; }
.nv7e-pense-h b { font-size: 13.5px; color: var(--text); }
.nv7e-pense-h small { margin-left: auto; font-size: 11px; color: var(--text3); }
.nv7e-res { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text); }
.nv7e-peds { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.nv7e-peds li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 4px 10px; padding: 9px 12px; border-radius: 12px; background: color-mix(in srgb, var(--bg) 40%, transparent); border: 1px solid var(--n7-line); animation: n7Sube .45s var(--n7-ez) both; animation-delay: calc(var(--i, 0) * 70ms + 80ms); }
.nv7e-peds b { font-size: 13px; color: var(--text); white-space: nowrap; }
.nv7e-peds span { font-size: 12px; color: var(--text3); min-width: 0; overflow-wrap: anywhere; }
.nv7e-peds em { font-style: normal; font: 700 12.5px/1 var(--nv-font-num, var(--nv-font-ui, inherit)); color: var(--n7-c2); }
.nv7e-duda { display: flex; gap: 8px; align-items: flex-start; margin: 0; font-size: 12.5px; color: var(--amber, var(--text2)); }
.nv7e-duda span { width: 18px; height: 18px; border-radius: 50%; display: inline-grid; place-items: center; flex-shrink: 0; font: 800 11px/1 var(--nv-font-ui, inherit); background: color-mix(in srgb, var(--amber, var(--n7-c)) 20%, transparent); }
.nv7e-acc { display: flex; flex-wrap: wrap; gap: 6px; }
.nv7e-chip { border: 1px solid color-mix(in srgb, var(--n7-c) 35%, var(--n7-line)); background: color-mix(in srgb, var(--n7-c) 8%, transparent); color: var(--text); border-radius: 999px; padding: 6px 12px; font: 600 12px/1.25 var(--nv-font-ui, inherit); cursor: pointer; text-align: left; transition: transform .2s var(--n7-sp), background .2s ease; }
.nv7e-chip:hover { transform: translateY(-1px); background: color-mix(in srgb, var(--n7-c) 15%, transparent); }
.nv7e-chip.ok, .nv7e-chip:disabled { cursor: default; transform: none; border-color: color-mix(in srgb, var(--green, var(--n7-c)) 45%, transparent); background: color-mix(in srgb, var(--green, var(--n7-c)) 12%, transparent); }
.nv7e-aprendi { display: grid; gap: 4px; padding: 10px 12px; border-radius: 14px; border-left: 3px solid var(--green, var(--n7-c)); background: var(--n7-soft); animation: n7Listo .6s var(--n7-sp); }
.nv7e-aprendi > b { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--green, var(--n7-c2)); }
.nv7e-aprendi p { margin: 0; }

/* ── Envío automático ─────────────────────────────────────────────── */
.nv7e-env { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 18px; border: 1px solid var(--n7-line); background: var(--n7-soft); transition: border-color .3s ease, background .3s ease; }
.nv7e-ring { width: 36px; height: 36px; flex-shrink: 0; transform: rotate(-90deg); }
.nv7e-ring circle { fill: none; stroke-width: 3; stroke: color-mix(in srgb, var(--text) 12%, transparent); }
.nv7e-ring circle.v { stroke: var(--n7-c); stroke-linecap: round; stroke-dasharray: 100; stroke-dashoffset: 0; animation: n7Cuenta linear forwards; }
.nv7e-env-t { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.nv7e-env-t b { font-size: 13.5px; color: var(--text); }
.nv7e-env-t small { font-size: 12px; color: var(--text3); line-height: 1.4; }
.nv7e-env-a { display: flex; gap: 6px; flex-wrap: wrap; }
.nv7e-env-a:empty { display: none; }
.nv7e-b { height: 34px; padding: 0 14px; border-radius: 11px; border: 0; background: var(--accent); color: var(--nv6-on-accent, #fff); font: 650 12.5px/1 var(--nv-font-ui, inherit); cursor: pointer; transition: transform .2s var(--n7-sp), opacity .2s ease; }
.nv7e-b:hover { transform: translateY(-1px); }
.nv7e-b:active { transform: scale(.96); }
.nv7e-b--g { background: transparent; color: var(--text2); border: 1px solid var(--n7-line); }
.nv7e-b:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--n7-c) 40%, transparent); }
.nv7e-env[data-st="envia"] .nv7e-ring circle.v { animation: n7Gira 1s linear infinite; stroke-dasharray: 30 70; transform-origin: center; }
.nv7e-env[data-st="ok"] { border-color: color-mix(in srgb, var(--green, var(--n7-c)) 45%, var(--n7-line)); background: color-mix(in srgb, var(--green, var(--n7-c)) 9%, transparent); animation: n7Listo .6s var(--n7-sp); }
.nv7e-env[data-st="ok"] .nv7e-ring circle.v { animation: none; stroke: var(--green, var(--n7-c)); stroke-dashoffset: 0; }
.nv7e-env[data-st="err"] { border-color: color-mix(in srgb, var(--amber, var(--n7-c)) 45%, var(--n7-line)); }
.nv7e-env[data-st="err"] .nv7e-ring circle.v { animation: none; stroke: var(--amber, var(--n7-c)); stroke-dashoffset: 0; }
.nv7e-env[data-st="off"] { opacity: .75; }
.nv7e-env[data-st="off"] .nv7e-ring circle.v { animation: none; stroke-dashoffset: 100; }

/* ── Animaciones ──────────────────────────────────────────────────── */
@keyframes n7Sube { from { opacity: 0; transform: translateY(10px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes n7Tarjeta { from { opacity: 0; transform: perspective(900px) rotateX(10deg) translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes n7Listo { 0% { transform: scale(.98); } 45% { transform: scale(1.012); } 100% { transform: none; } }
@keyframes n7Brillo { from { background-position: 200% 0; } to { background-position: -50% 0; } }
@keyframes n7Flota { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-2px); } }
@keyframes n7Chispa { 0%, 100% { transform: scale(1) rotate(0); opacity: 1; } 50% { transform: scale(.75) rotate(25deg); opacity: .7; } }
@keyframes n7Orbe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
@keyframes n7Gira { to { transform: rotate(360deg); } }
@keyframes n7Cuenta { from { stroke-dashoffset: 0; } to { stroke-dashoffset: 100; } }

@media (prefers-reduced-motion: reduce) {
  .nve-ov.nv7e *, .nve-ov.nv7e *::before, .nve-ov.nv7e *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .nve-ov.nv7e .nve-card { filter: none; }
}

/* Arreglo: "Vista previa del contrato" heredaba el estilo de la vista de
   chat de Envíos (nv-envios-620.css usa la misma clase .nve-prev) y salía
   como una caja oscura vacía de 270 px. Aquí vuelve a ser un desplegable. */
#nve-ov details.nve-prev {
  display: block !important; height: auto !important; min-height: 0 !important; max-height: none !important; overflow: visible !important;
  padding: 0 !important; border: 0 !important; border-radius: 0 !important; background: none !important;
}
#nve-ov details.nve-prev > summary { display: list-item; padding: 2px 0; text-align: left; }
#nve-ov details.nve-prev[open] > .nve-pre { margin-top: 8px; animation: n7Sube .35s var(--n7-ez, ease) both; }
#nve-ov details.nve-prev:not([open]) > .nve-pre { display: none !important; }
