:root {
  --nx-read-w: 700px; /* ancho de lectura de la portada: H1, introducción y video */
  --nx-bg: #f7f8fa;
  --nx-surface: #ffffff;
  --nx-text: var(--nx-brand-ink);
  --nx-text-muted: #5b6472;
  --nx-border: #e2e5eb;
  --nx-brand-blue: #2563EB;
  --nx-brand-teal: #14B8A6;
  --nx-brand-ink: #0F172A;
  --nx-brand-green-dark: #0D9488;
  --nx-primary: var(--nx-brand-blue);
  --nx-primary-dark: #1d4ed8;
  --nx-primary-contrast: #ffffff;
  --nx-danger: #c0392b;
  --nx-danger-bg: #fdecea;
  --nx-success: #1e8e5a;
  --nx-radius: 10px;
  --nx-shadow: 0 1px 3px rgba(20, 25, 40, 0.08), 0 1px 2px rgba(20, 25, 40, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--nx-bg);
  color: var(--nx-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.container {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--nx-primary); }

/* Header */
.site-header {
  background: var(--nx-surface);
  border-bottom: 1px solid var(--nx-border);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--nx-text);
}

.brand__img { height: 36px; width: auto; display: block; }
.footer-brand { display: inline-block; margin-bottom: 8px; }
.footer-brand img { height: 28px; width: auto; display: block; }

.main-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.95rem;
}

.main-nav a {
  text-decoration: none;
  color: var(--nx-text-muted);
  font-weight: 600;
}

.main-nav a:hover { color: var(--nx-primary); }

/* Layout */
.page {
  flex: 1;
  padding: 28px 16px 56px;
}

.site-footer {
  border-top: 1px solid var(--nx-border);
  padding: 20px 16px;
  color: var(--nx-text-muted);
  font-size: 0.875rem;
}

/* Home */
.hero { margin-bottom: 28px; }
.hero h1 { margin: 0 0 8px; font-size: 1.9rem; }
.hero p { margin: 0; color: var(--nx-text-muted); }

.category-title {
  margin: 32px 0 14px;
  font-size: 1.15rem;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.tool-card {
  display: block;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  padding: 18px;
  text-decoration: none;
  color: var(--nx-text);
  box-shadow: var(--nx-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.tool-card:hover:not(.tool-card--disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(20, 25, 40, 0.12);
}

.tool-card__icon { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.tool-card { position: relative; }
.tool-card__name { font-weight: 700; font-size: 1rem; margin: 0 0 4px; }
.tool-card__link { color: inherit; text-decoration: none; }
.tool-card__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--nx-radius); } /* toda la tarjeta clicable */
.tool-card__link:focus-visible { outline: none; }
.tool-card__link:focus-visible::after { outline: 2px solid var(--nx-primary, #2563eb); outline-offset: 2px; }
.hero.hero--home h1, .hero.hero--home p { max-width: var(--nx-read-w); }
.hero p { max-width: 70ch; line-height: 1.6; }
.hero--home p { text-wrap: pretty; }
.hero--home p + p { margin-top: 14px; }
@media (min-width: 768px) { .hero--home p { text-align: justify; hyphens: auto; } }
.tool-card__desc { margin: 0; font-size: 0.9rem; color: var(--nx-text-muted); }

.tool-card--disabled {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

.badge-soon {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--nx-text-muted);
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  border-radius: 999px;
  padding: 2px 8px;
}

/* Tool page */
.tool-page h1 { margin: 0 0 6px; font-size: 1.6rem; }
.tool-page > p.lead { margin: 0 0 24px; color: var(--nx-text-muted); }

.panel {
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  box-shadow: var(--nx-shadow);
  padding: 20px;
  margin-bottom: 20px;
}

.dropzone {
  border: 2px dashed var(--nx-border);
  border-radius: var(--nx-radius);
  padding: 32px 16px;
  text-align: center;
  color: var(--nx-text-muted);
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}

.dropzone:hover,
.dropzone.is-dragover {
  border-color: var(--nx-primary);
  background: rgba(37, 99, 235, 0.04);
}

.dropzone strong { color: var(--nx-text); }

.file-list {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.file-list__item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--nx-bg);
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  padding: 8px 10px;
}

.file-list__item[draggable="true"] { cursor: grab; }
.file-list__item.is-dragging { opacity: 0.5; }

.file-list__handle { color: var(--nx-text-muted); }
.file-list__name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.file-list__size { color: var(--nx-text-muted); font-size: 0.8rem; }

.icon-btn {
  border: none;
  background: transparent;
  color: var(--nx-text-muted);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
}

.icon-btn:hover { background: var(--nx-danger-bg); color: var(--nx-danger); }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
.field .hint { display: block; font-size: 0.8rem; color: var(--nx-text-muted); margin-top: 4px; }

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--nx-surface);
  color: var(--nx-text);
}

.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.checkbox input { width: 16px; height: 16px; }

.office-options { border: 1px solid var(--nx-border); border-radius: 10px; padding: 12px 16px 4px; margin: 16px 0; }
.office-options legend { font-weight: 700; font-size: 0.9rem; padding: 0 6px; }
.office-options .field:last-child { max-width: 420px; }
.office-options .field .checkbox { display: flex; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--nx-primary);
  color: var(--nx-primary-contrast);
}

.btn:hover { background: var(--nx-primary-dark); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.progress {
  margin-top: 14px;
  height: 8px;
  border-radius: 999px;
  background: var(--nx-border);
  overflow: hidden;
  display: none;
}

.progress.is-active { display: block; }

.progress__bar {
  height: 100%;
  width: 0%;
  background: var(--nx-primary);
  transition: width 0.15s ease;
}

/* Espera del servidor (Office a PDF): barra «en curso» sin porcentaje, con texto de estado debajo. Sin movimiento si el usuario lo pidió así. */
.progress--working .progress__bar { width: 40% !important; animation: progress-slide 1.2s ease-in-out infinite; }
@keyframes progress-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@media (prefers-reduced-motion: reduce) { .progress--working .progress__bar { animation: none; width: 100% !important; opacity: 0.6; } }
.progress-status { margin: 8px 0 0; min-height: 1.4em; font-size: 0.9rem; color: var(--nx-text-muted); }

.alert {
  display: none;
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 14px;
  font-size: 0.9rem;
}

.alert.is-visible { display: block; }

.alert--error {
  background: var(--nx-danger-bg);
  color: var(--nx-danger);
  border: 1px solid rgba(192, 57, 43, 0.25);
}

.alert--success {
  background: #eafaf1;
  color: var(--nx-success);
  border: 1px solid rgba(30, 142, 90, 0.25);
}

@media (max-width: 560px) {
  .main-nav { gap: 12px; font-size: 0.85rem; }
  .hero h1 { font-size: 1.5rem; }
}

/* ---------- Previsualizaciones (js/previews.js) ---------- */

.nx-thumb {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border: 1px solid var(--nx-border);
  border-radius: 6px;
  overflow: hidden;
  min-height: 60px;
}

.nx-thumb.is-loading:not(.nx-thumb--placeholder) { aspect-ratio: 3 / 4; background: var(--nx-bg); }
.nx-thumb canvas,
.nx-thumb img { display: block; width: 100%; height: auto; max-height: 220px; object-fit: contain; }

.nx-thumb--placeholder {
  flex-direction: column;
  gap: 6px;
  padding: 12px 8px;
  color: var(--nx-text-muted);
  text-align: center;
  background: var(--nx-bg);
}

.nx-thumb__msg { font-size: 0.72rem; line-height: 1.3; }

/* Tarjetas de archivo */
.file-list--cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.file-list__item--card {
  position: relative;
  align-items: stretch;
  padding: 10px;
}

.file-list__item--card .file-list__handle { position: absolute; top: 6px; left: 8px; z-index: 1; }
.file-list__item--card > .icon-btn:not(.icon-btn--move) {
  position: absolute; top: 4px; right: 4px; z-index: 1;
  background: rgba(255, 255, 255, 0.9);
}

.file-list__move { position: absolute; bottom: 4px; right: 4px; display: flex; gap: 2px; }
.icon-btn--move { font-size: 0.8rem; background: rgba(255, 255, 255, 0.9); }
.icon-btn--move:disabled { opacity: 0.3; cursor: default; }

.file-card { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.file-card .nx-thumb { height: 170px; }
.file-card .nx-thumb canvas,
.file-card .nx-thumb img { height: 100%; width: auto; max-width: 100%; }
.file-card__name { font-size: 0.85rem; font-weight: 600; overflow-wrap: anywhere; }
.file-card__meta { font-size: 0.78rem; color: var(--nx-text-muted); }
.file-card__new { font-size: 0.85rem; color: var(--nx-primary-dark); font-weight: 600; overflow-wrap: anywhere; }
.file-card__new.is-error { color: var(--nx-danger); font-weight: 400; }

/* Rejilla de páginas (Dividir) */
.nx-pages {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}

.nx-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--nx-surface);
  border: 2px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  color: var(--nx-text-muted);
}

.nx-page .nx-thumb { width: 100%; }
.nx-page__label { font-size: 0.78rem; }
.nx-page:hover { border-color: var(--nx-border); }
.nx-page.is-selected { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.08); color: var(--nx-text); font-weight: 700; }
.nx-pages__more { margin-top: 12px; }
.nx-disabled { opacity: 0.5; pointer-events: none; }
.page-tools { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0 8px; align-items: center; }
.page-tools .hint { font-size: 0.8rem; color: var(--nx-text-muted); }

.btn--secondary {
  background: var(--nx-surface);
  color: var(--nx-primary);
  border: 1px solid var(--nx-primary);
  padding: 6px 12px;
  font-size: 0.85rem;
}
.btn--secondary:hover { background: rgba(37, 99, 235, 0.08); }

/* Resultado de compresión */
.result-box {
  margin-top: 14px;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.95rem;
}
.result-box--ok { background: #eafaf1; border-color: rgba(30, 142, 90, 0.25); }
.result-box--none { background: #fff7e6; border-color: rgba(200, 130, 0, 0.3); }

@media (max-width: 560px) {
  .file-list--cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .file-card .nx-thumb { height: 130px; }
  .nx-pages { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
}
[hidden] { display: none !important; }

/* Promoción cruzada NexAI (tools.js: showCrossPromo) */
.cross-promo {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
  padding: 10px 34px 10px 14px;
  border-radius: 10px;
  border: 1px solid #d9cffb;
  border-left: 4px solid #7c4dff;
  background: linear-gradient(90deg, #f5f1ff, #fbfaff);
  font-size: 0.85rem;
}
.cross-promo__text { margin: 0; flex: 1 1 220px; color: #3b2f63; }
.cross-promo__link {
  flex: 0 0 auto;
  padding: 6px 12px;
  border-radius: 999px;
  background: #7c4dff;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}
.cross-promo__link:hover { background: #5f34e0; }
.cross-promo__close {
  position: absolute; top: 4px; right: 6px;
  border: none; background: transparent; cursor: pointer;
  color: #7a6fa3; font-size: 0.85rem; padding: 4px;
}

/* Estado de éxito (tools.js: showSuccessState) */
.is-success-hidden { display: none !important; }

.success-state { text-align: center; padding: 12px 4px 4px; }
.success-state__icon {
  width: 84px; height: 84px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(30, 142, 90, 0.14);
  color: var(--nx-success);
  animation: nx-pop 0.4s ease-out;
}
.success-state__title { margin: 0 0 8px; font-size: 1.5rem; outline: none; }
.success-state__file { margin: 0 0 4px; color: var(--nx-text-muted); overflow-wrap: anywhere; }
.success-state__detail { margin: 0 0 4px; color: var(--nx-text-muted); font-size: 0.9rem; }
.success-state__actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.btn--lg { padding: 10px 18px; font-size: 1rem; }
.success-state__promo { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--nx-border); text-align: left; }
.success-state__promo .cross-promo { margin-top: 0; }

@keyframes nx-pop { from { transform: scale(0.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .success-state__icon { animation: none; } }

/* Menús desplegables de categorías (site.js) */
.site-header__bar { position: relative; }
.nav-item { position: relative; }

.nav-item__btn {
  font: inherit;
  font-weight: 600;
  color: var(--nx-text-muted);
  background: none;
  border: none;
  padding: 4px 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.nav-item__btn:hover,
.nav-item.is-open .nav-item__btn { color: var(--nx-primary); }
.nav-item__caret { font-size: 0.7rem; transition: transform 0.15s ease; }
.nav-item.is-open .nav-item__caret { transform: rotate(180deg); }

.nav-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 220px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--nx-surface);
  border: 1px solid var(--nx-border);
  border-radius: var(--nx-radius);
  box-shadow: 0 6px 18px rgba(20, 25, 40, 0.12);
}
.nav-item.is-open .nav-menu { display: block; }

/* Puente invisible para que el menú no se cierre al mover el mouse del botón a la lista */
.nav-menu::before { content: ""; position: absolute; left: 0; right: 0; top: -10px; height: 10px; }

@media (hover: hover) and (min-width: 561px) {
  .nav-item:hover .nav-menu { display: block; }
  .nav-item:hover .nav-item__btn { color: var(--nx-primary); }
}

.main-nav .nav-menu a {
  display: block;
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--nx-text);
  white-space: nowrap;
}
.main-nav .nav-menu a:hover,
.main-nav .nav-menu a:focus-visible { background: rgba(37, 99, 235, 0.08); color: var(--nx-primary); }
.main-nav .nav-menu a[aria-current="page"] { font-weight: 700; color: var(--nx-primary); }

.main-nav a:focus-visible,
.nav-item__btn:focus-visible { outline: 2px solid var(--nx-primary); outline-offset: 2px; border-radius: 4px; }

@media (max-width: 560px) {
  /* En móvil el panel ocupa el ancho de la barra y las categorías se expanden al tocarlas */
  .nav-item { position: static; }
  .nav-menu { left: 0; right: 0; top: 100%; min-width: 0; border-radius: 0 0 var(--nx-radius) var(--nx-radius); border-top: none; }
  .nav-menu::before { display: none; }
  .main-nav .nav-menu a { padding: 12px 14px; white-space: normal; }
  .nav-item__btn { padding: 8px 4px; }
}
.main-nav { align-items: center; }
.main-nav > a { padding: 4px 2px; line-height: inherit; }
.nav-item__btn { line-height: inherit; }

/* Traductor (Pages/Traductor.cshtml) */
.translator {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 12px;
  align-items: start;
}
.translator__col { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.translator__label { font-weight: 600; font-size: 0.9rem; }
.translator select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  font-size: 0.95rem;
  background: var(--nx-surface);
  color: var(--nx-text);
}
.translator textarea {
  width: 100%;
  min-height: 220px;
  padding: 10px 12px;
  border: 1px solid var(--nx-border);
  border-radius: 8px;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--nx-text);
  background: var(--nx-surface);
  resize: vertical;
}
.translator textarea[readonly] { background: var(--nx-bg); }
.translator__meta { display: flex; justify-content: flex-end; align-items: center; min-height: 34px; font-size: 0.8rem; color: var(--nx-text-muted); }
.translator__swap {
  margin-top: 30px;
  font-size: 1.3rem;
  border: 1px solid var(--nx-border);
  background: var(--nx-surface);
  padding: 8px 10px;
}
.translator__swap:disabled { opacity: 0.4; cursor: not-allowed; }
.translator__swap:not(:disabled):hover { background: rgba(37, 99, 235, 0.08); color: var(--nx-primary); }

@media (max-width: 700px) {
  .translator { grid-template-columns: 1fr; }
  .translator__swap { margin: 0 auto; transform: rotate(90deg); }
  .translator textarea { min-height: 160px; }
}

/* Rotar PDF (Pages/RotarPdf.cshtml): cuadrícula con giro por página; el giro en sí vive en .flow-tile.has-turn (más abajo) */
.rot-grid { --flow-thumb: 170px; }
.rot-grid .nx-thumb canvas { max-height: none; }
.nx-static .nx-page { pointer-events: none; }

/* Marca de agua PDF (Pages/MarcaDeAguaPdf.cshtml): los controles y la vista previa están en «Marca de agua (componente compartido)», más abajo */
.range-hint { font-weight: 400; color: var(--nx-text-muted); font-size: 0.8rem; }

/* Marca de agua con imagen */
.dropzone--small { padding: 18px 12px; font-size: 0.9rem; }
.dropzone[hidden] { display: none; }
.img-chosen { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: 8px; }
.img-chosen[hidden] { display: none; }
.img-chosen__thumb { width: 44px; height: 44px; object-fit: contain; background: repeating-conic-gradient(#e9ebef 0% 25%, #fff 0% 50%) 50% / 12px 12px; border-radius: 4px; }
.img-chosen__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.9rem; }
.range-row { display: flex; align-items: center; gap: 10px; }
.range-row input[type="range"] { flex: 1; }
.range-row output { min-width: 3.2em; text-align: right; font-weight: 600; font-size: 0.9rem; }

/* Herramientas de imágenes */
.alert--warn { background: #fff7e6; color: #8a5a00; border: 1px solid rgba(200, 130, 0, 0.3); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.file-card .nx-thumb { background: repeating-conic-gradient(#eceef2 0% 25%, #fff 0% 50%) 50% / 14px 14px; } /* cuadrícula para ver transparencias */

.crop-tools { display: flex; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin: 20px 0 12px; }
.crop-tools .field select { min-width: 190px; }
.cropper { display: flex; justify-content: center; background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: 8px; padding: 10px; }
.cropper__stage { position: relative; display: inline-block; line-height: 0; overflow: hidden; user-select: none; -webkit-user-select: none; max-width: 100%; }
.cropper__stage img { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; -webkit-user-drag: none; }
.cropper__box {
  position: absolute; box-sizing: border-box; cursor: move; touch-action: none;
  border: 2px solid #fff; outline: 1px solid rgba(0, 0, 0, 0.5);
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55); /* oscurece todo lo que queda fuera del recuadro */
  background-image:
    linear-gradient(to right, transparent 33.2%, rgba(255,255,255,.55) 33.3%, rgba(255,255,255,.55) 33.5%, transparent 33.6%, transparent 66.5%, rgba(255,255,255,.55) 66.6%, rgba(255,255,255,.55) 66.8%, transparent 66.9%),
    linear-gradient(to bottom, transparent 33.2%, rgba(255,255,255,.55) 33.3%, rgba(255,255,255,.55) 33.5%, transparent 33.6%, transparent 66.5%, rgba(255,255,255,.55) 66.6%, rgba(255,255,255,.55) 66.8%, transparent 66.9%);
}
.cropper__box:focus-visible { outline: 3px solid var(--nx-primary); }
.cropper__box[hidden] { display: none; }
.cropper__handle { position: absolute; width: 18px; height: 18px; background: #fff; border: 2px solid var(--nx-primary); border-radius: 50%; touch-action: none; box-sizing: border-box; }
.cropper__handle[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; }
.cropper__handle[data-h="n"]  { left: calc(50% - 9px); top: -9px; cursor: ns-resize; }
.cropper__handle[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; }
.cropper__handle[data-h="e"]  { right: -9px; top: calc(50% - 9px); cursor: ew-resize; }
.cropper__handle[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.cropper__handle[data-h="s"]  { left: calc(50% - 9px); bottom: -9px; cursor: ns-resize; }
.cropper__handle[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cropper__handle[data-h="w"]  { left: -9px; top: calc(50% - 9px); cursor: ew-resize; }
@media (pointer: coarse) { .cropper__handle { width: 26px; height: 26px; } .cropper__handle[data-h="nw"], .cropper__handle[data-h="w"], .cropper__handle[data-h="sw"] { left: -13px; } .cropper__handle[data-h="ne"], .cropper__handle[data-h="e"], .cropper__handle[data-h="se"] { right: -13px; } .cropper__handle[data-h="nw"], .cropper__handle[data-h="n"], .cropper__handle[data-h="ne"] { top: -13px; } .cropper__handle[data-h="sw"], .cropper__handle[data-h="s"], .cropper__handle[data-h="se"] { bottom: -13px; } .cropper__handle[data-h="n"], .cropper__handle[data-h="s"] { left: calc(50% - 13px); } .cropper__handle[data-h="e"], .cropper__handle[data-h="w"] { top: calc(50% - 13px); } }

/* Comprimir imagen: propósito (Pages/ComprimirImagen.cshtml) */
.purpose { border: 1px solid var(--nx-border); border-radius: var(--nx-radius); padding: 14px 16px 16px; margin: 20px 0 0; }
.purpose[hidden], .manual[hidden] { display: none; }
.purpose legend { font-weight: 700; padding: 0 6px; }
.purpose__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.purpose__opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--nx-border); border-radius: 8px; cursor: pointer; background: var(--nx-surface); }
.purpose__opt:hover { border-color: var(--nx-primary); }
.purpose__opt:has(input:checked) { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.07); box-shadow: 0 0 0 1px var(--nx-primary); }
.purpose__opt:has(input:focus-visible) { outline: 2px solid var(--nx-primary); outline-offset: 2px; }
.purpose__opt input { margin-top: 4px; }
.purpose__opt span { display: flex; flex-direction: column; gap: 2px; }
.purpose__opt small { color: var(--nx-text-muted); font-size: 0.8rem; line-height: 1.35; }
.manual { margin-top: 16px; padding-top: 16px; border-top: 1px dashed var(--nx-border); }

/* Panel de estadísticas (Pages/Admin/Estadisticas.cshtml) */
.admin .panel h2 { margin: 0 0 14px; font-size: 1.15rem; }
.admin h2 small { font-weight: 400; color: var(--nx-text-muted); font-size: 0.85rem; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.stat { background: var(--nx-bg); border: 1px solid var(--nx-border); border-radius: 8px; padding: 12px 14px; display: flex; flex-direction: column; gap: 2px; }
.stat__num { font-size: 1.7rem; font-weight: 700; line-height: 1.2; }
.stat__label { font-size: 0.8rem; color: var(--nx-text-muted); }
.rate--good { color: var(--nx-success); }
.rate--warn { color: #b7791f; }
.rate--bad { color: var(--nx-danger); }
.period { margin: 4px 0 14px; font-size: 0.9rem; color: var(--nx-text-muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.period a { padding: 3px 10px; border-radius: 999px; text-decoration: none; color: var(--nx-text-muted); border: 1px solid var(--nx-border); background: var(--nx-surface); }
.period a.is-active { background: var(--nx-primary); border-color: var(--nx-primary); color: #fff; font-weight: 600; }
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--nx-border); white-space: nowrap; }
.table th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.03em; color: var(--nx-text-muted); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.bar { width: 160px; max-width: 100%; height: 10px; border-radius: 999px; background: var(--nx-border); overflow: hidden; display: inline-block; vertical-align: middle; }
.bar span { display: block; height: 100%; background: var(--nx-primary); border-radius: 999px; }
.bar--rate.rate--good span { background: var(--nx-success); }
.bar--rate.rate--warn span { background: #d69e2e; }
.bar--rate.rate--bad span { background: var(--nx-danger); }
.rate-text { margin-left: 8px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--nx-border); stroke-width: 1; }
.chart__label { font-size: 10px; fill: var(--nx-text-muted); }
.chart__ok { fill: var(--nx-primary); }
.chart__fail { fill: var(--nx-danger); }
.legend { margin: 6px 0 0; font-size: 0.8rem; color: var(--nx-text-muted); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin: 0 4px 0 12px; }
.dot:first-child { margin-left: 0; }
.dot--ok { background: var(--nx-primary); }
.dot--fail { background: var(--nx-danger); }

/* Advertencia visible antes de procesar (PDF a Word / PDF a Excel) */
.warn-box { display: block; font-size: 0.95rem; line-height: 1.5; margin-top: 0; }
.warn-box a { color: inherit; font-weight: 700; }

/* Editor de texto PDF (Pages/EditarTextoPdf.cshtml) */
.ed-controls { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin-top: 14px; font-size: 0.9rem; }
.ed-pages { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.ed-page { position: relative; width: 100%; max-width: 860px; background: #fff; box-shadow: 0 1px 6px rgba(0, 0, 0, 0.25); }
.ed-page canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.ed-page__label { position: absolute; top: -1.4em; left: 0; font-size: 0.75rem; color: var(--nx-text-muted); }
.ed-overlay { position: absolute; inset: 0; }
.ed-box { position: absolute; box-sizing: border-box; border: 1px solid rgba(37, 99, 235, 0.55); background: rgba(37, 99, 235, 0.05); cursor: text; outline: none; }
.ed-box:hover, .ed-box:focus-visible { background: rgba(255, 170, 0, 0.25); border-color: #e08a00; z-index: 2; }
.ed-box.is-edited { background: var(--patch, #fff); border-color: rgba(30, 142, 90, 0.9); z-index: 3; }
.ed-box.is-active { background: var(--patch, #fff); border: 2px solid #2f6fed; z-index: 5; }
.ed-txt { display: none; position: absolute; left: 0; white-space: pre; line-height: 1; margin: 0; padding: 0; outline: none; cursor: text; }
.ed-box.is-edited .ed-txt, .ed-box.is-active .ed-txt { display: block; }
.hide-boxes .ed-box:not(.is-edited):not(.is-active) { border-color: transparent; background: transparent; }
.hide-boxes .ed-box:not(.is-edited):not(.is-active):hover { border-color: #e08a00; background: rgba(255, 170, 0, 0.2); }
.ed-toolbar { position: absolute; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: 8px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25); font-size: 0.85rem; max-width: calc(100% - 8px); }
.ed-toolbar[hidden] { display: none; }
.ed-toolbar button, .ed-toolbar select, .ed-toolbar input[type="number"] { font: inherit; padding: 4px 8px; border: 1px solid var(--nx-border); border-radius: 6px; background: var(--nx-bg); color: inherit; }
.ed-toolbar button { cursor: pointer; min-width: 32px; }
.ed-toolbar button[aria-pressed="true"] { background: #2f6fed; border-color: #2f6fed; color: #fff; }
.ed-toolbar input[type="number"] { width: 4.6em; }
.ed-toolbar input[type="color"] { width: 34px; height: 30px; padding: 1px; border: 1px solid var(--nx-border); border-radius: 6px; background: var(--nx-bg); cursor: pointer; }
.ed-toolbar .ed-sep { width: 1px; align-self: stretch; background: var(--nx-border); }
.ed-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 16px; }
/* Vista previa: el parche (color de fondo muestreado de la página, --patch; blanco si no se pudo leer) que tapa el texto original también cubre
   los rabillos (g, p, y) que la caja detectada no incluye, y como mínimo el ancho del texto nuevo (--patch-w, en pt). */
.ed-box.is-edited::before, .ed-box.is-active::before { content: ""; position: absolute; left: var(--patch-l, 0); right: auto; width: var(--patch-w, 100%); top: -15%; bottom: -40%; background: var(--patch, #fff); pointer-events: none; }

/* Organizar páginas: tarjetas de página reordenables */
.org-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 12px 0 0; }
.org-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 6px 6px; background: var(--nx-surface); border: 2px solid var(--nx-border); border-radius: 8px; cursor: grab; }
.org-card.is-dragging { opacity: 0.4; }
.org-card.is-over { border-color: var(--nx-primary); }
.org-card.is-removed { opacity: 0.45; border-style: dashed; }
.org-card.is-dup { border-color: var(--nx-primary); }
.org-card .nx-thumb { width: 100%; }
.org-card__pos { font-size: 0.85rem; font-weight: 700; }
.org-card__meta { font-size: 0.72rem; color: var(--nx-text-muted); min-height: 1em; }
.org-card__btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.org-card__btns button { font: inherit; font-size: 0.85rem; min-width: 32px; min-height: 32px; padding: 2px 6px; border: 1px solid var(--nx-border); border-radius: 6px; background: var(--nx-bg); color: inherit; cursor: pointer; }
.org-card__btns button:hover:not(:disabled) { border-color: var(--nx-primary); }
.org-card__btns button:disabled { opacity: 0.3; cursor: default; }
.org-card__btns .org-undo { padding: 2px 10px; }
.org-more { margin-top: 12px; }

/* Panel admin: tráfico */
.admin-sub { margin: 18px 0 8px; font-size: 0.95rem; color: var(--nx-brand-ink); }
.admin-jump a { margin: 0 2px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin-top: 4px; }
.admin-grid .table { width: 100%; }
.chart__uniq { fill: var(--nx-brand-teal); }
.dot--uniq { background: var(--nx-brand-teal); }
.admin code { font-size: 0.85em; overflow-wrap: anywhere; }

/* Página 404 */
.not-found-links { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-wrap: wrap; gap: 8px 20px; }

/* Contenido SEO bajo cada herramienta */
.seo-content { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--nx-border, #e2e8f0); max-width: 760px; }
.seo-content h2 { font-size: 1.25rem; margin: 0 0 12px; }
.seo-content h2 + ol, .seo-content h2 + p { margin-top: 0; }
.seo-content h2:not(:first-child) { margin-top: 28px; }
.seo-content h3 { font-size: 1rem; margin: 18px 0 4px; }
.seo-content p, .seo-content li { color: var(--nx-text-muted); line-height: 1.6; }
.seo-content ol { padding-left: 1.25rem; margin: 0 0 16px; }
.seo-content .seo-faq { margin-top: 28px; }
.seo-content a, .related-tools a { color: var(--nx-primary, #2563eb); }

/* Video con fachada (portada y /flujo-pdf) */
.video-block { margin: 0 0 28px; max-width: var(--nx-read-w); }
.video-block h2 { font-size: 1.25rem; margin: 0 0 12px; }
.video-facade { position: relative; aspect-ratio: 16 / 9; background: #0f172a; border-radius: var(--nx-radius); overflow: hidden; }
.video-facade__btn { all: unset; cursor: pointer; display: block; width: 100%; height: 100%; position: relative; }
.video-facade__btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.video-facade__btn:focus-visible { outline: 3px solid var(--nx-primary, #2563eb); outline-offset: -3px; }
.video-facade__play { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; border-radius: 12px; background: rgba(15, 23, 42, 0.85); }
.video-facade__play::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; left: 4px; border-style: solid; border-width: 10px 0 10px 18px; border-color: transparent transparent transparent #fff; }
.video-facade__btn:hover .video-facade__play { background: var(--nx-primary, #2563eb); }
.video-facade iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Herramientas relacionadas (enlaces internos al final de cada herramienta) */
.related-tools { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--nx-border, #e2e8f0); max-width: 760px; }
.related-tools h2 { font-size: 1.25rem; margin: 0 0 12px; }
.related-tools ul { margin: 0; padding-left: 1.25rem; line-height: 1.8; }

/* ---------- Quitar hojas en blanco y Flujo todo en uno ---------- */
.blank-summary { margin: 14px 0 8px; font-weight: 600; }
.blank-card { cursor: pointer; }
.blank-card.is-marked { border-color: var(--nx-danger); background: var(--nx-danger-bg); }
.blank-card.is-marked .nx-thumb { opacity: 0.55; }
.blank-tag { font-size: 0.72rem; color: var(--nx-text-muted); min-height: 1em; }
.blank-check { font-size: 0.85rem; cursor: pointer; }

/* ---------- Flujo todo en uno (/flujo-pdf, js/flow.js) ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.flow-app button:focus-visible, .flow-app input:focus-visible, .flow-app select:focus-visible, .flow-app summary:focus-visible, .flow-app .dropzone:focus-visible,
.flow-choice__opt:has(input:focus-visible) { outline: 3px solid var(--nx-primary); outline-offset: 2px; }
.flow-app [tabindex="-1"]:focus { outline: none; }
.flow-title { font-size: 1.25rem; margin: 0 0 12px; }
.flow-sub { font-size: 1rem; margin: 18px 0 6px; }
.flow-how { background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius); padding: 10px 16px; margin-bottom: 16px; }
.flow-how summary { font-weight: 700; cursor: pointer; min-height: 28px; }
.flow-how ol { margin: 8px 0 4px; padding-left: 22px; color: var(--nx-text-muted); }
.flow-how li { margin-bottom: 4px; }
.flow-progress { list-style: none; margin: 0 0 16px; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.flow-progress button { width: 100%; display: flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 10px; font: inherit; font-weight: 600; text-align: left; color: var(--nx-text-muted);
  background: var(--nx-surface); border: 2px solid var(--nx-border); border-radius: 10px; cursor: pointer; }
.flow-progress button:disabled { cursor: default; }
.flow-progress button:disabled:not(.is-current) { opacity: 0.65; }
.flow-progress__n { display: inline-grid; place-items: center; flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--nx-border); color: var(--nx-text); font-size: 0.9rem; }
.flow-progress .is-current { border-color: var(--nx-primary); color: var(--nx-text); }
.flow-progress .is-current .flow-progress__n { background: var(--nx-primary); color: var(--nx-primary-contrast); }
.flow-progress .is-done .flow-progress__n { background: var(--nx-success); color: #fff; }
.flow-progress .is-done { color: var(--nx-text); }
.flow-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.flow-nav .btn { min-height: 48px; justify-content: center; }
.btn--lg { min-height: 48px; }
.flow-file { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; }
.flow-file__name { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.flow-file__meta { margin: 2px 0 0; color: var(--nx-text-muted); font-size: 0.9rem; }
.flow-strip { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; -webkit-overflow-scrolling: touch; }
.flow-thumb { margin: 0; text-align: center; position: relative; min-width: 0; }
.flow-thumb figcaption { font-size: 0.75rem; color: var(--nx-text-muted); margin-top: 4px; }
.flow-thumb .nx-thumb, .flow-thumb img { width: 100%; }
.flow-thumb img { display: block; height: auto; border: 1px solid var(--nx-border); border-radius: 4px; background: #fff; }
.flow-thumb.is-marked img, .flow-thumb.is-marked .nx-thumb { opacity: 0.45; outline: 3px solid var(--nx-danger); outline-offset: -1px; }
.flow-thumb.is-marked figcaption { color: var(--nx-danger); font-weight: 700; }
.flow-recipes { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin-top: 10px; }
.flow-recipe { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 16px; min-height: 120px; font: inherit; text-align: left; color: var(--nx-text);
  background: var(--nx-surface); border: 2px solid var(--nx-border); border-radius: 12px; cursor: pointer; }
.flow-recipe:hover { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.04); }
.flow-recipe--own { border-style: dashed; }
.flow-recipe__icon { font-size: 1.6rem; }
.flow-recipe__title { font-weight: 700; }
.flow-recipe__text { font-size: 0.85rem; color: var(--nx-text-muted); }
.flow-builder-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.flow-recipe-name { margin: 0; color: var(--nx-text-muted); font-size: 0.9rem; flex: 1 1 240px; }
.flow-steps { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 14px; }
.flow-step { border: 2px solid var(--nx-border); border-radius: 12px; padding: 14px; background: var(--nx-surface); min-width: 0; }
.flow-step.is-failed { border-color: var(--nx-danger); background: var(--nx-danger-bg); }
.flow-step__head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.flow-step__icon { font-size: 1.6rem; line-height: 1; flex: none; }
.flow-step__title { flex: 1; min-width: 0; }
.flow-step__title h3 { margin: 0; font-size: 1.05rem; }
.flow-step__desc { margin: 2px 0 0; font-size: 0.9rem; }
.flow-step__ex { margin: 2px 0 0; font-size: 0.8rem; color: var(--nx-text-muted); }
.flow-step__btns { display: flex; gap: 6px; flex: none; }
.flow-iconbtn { font: inherit; min-width: 44px; min-height: 44px; padding: 2px 8px; border: 1px solid var(--nx-border); border-radius: 8px; background: var(--nx-bg); color: inherit; cursor: pointer; font-size: 1rem; }
.flow-iconbtn:hover:not(:disabled) { border-color: var(--nx-primary); }
.flow-iconbtn:disabled { opacity: 0.3; cursor: default; }
.flow-step__error { margin: 8px 0 0; padding: 8px 10px; border-radius: 8px; background: var(--nx-danger-bg); color: var(--nx-danger); font-size: 0.9rem; font-weight: 600; }
.flow-step__error[hidden] { display: none; }
.flow-count { display: block; font-size: 0.85rem; margin-top: 4px; color: var(--nx-success); font-weight: 600; }
.flow-count.is-bad { color: var(--nx-danger); }
.field input[aria-invalid="true"] { border-color: var(--nx-danger); }
.field__label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 6px; }
.field input[type="range"] { width: 100%; min-height: 32px; accent-color: var(--nx-primary); }
.flow-choice { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.flow-choice--row { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.flow-choice__opt { display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 12px; border: 2px solid var(--nx-border); border-radius: 10px; cursor: pointer; background: var(--nx-surface); }
.flow-choice__opt:has(input:checked) { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.08); }
.flow-choice__opt input { width: 20px; height: 20px; flex: none; accent-color: var(--nx-primary); }
.flow-choice__icon { font-size: 1.4rem; flex: none; }
.flow-choice__txt { display: flex; flex-direction: column; }
.flow-choice__txt small { color: var(--nx-text-muted); font-size: 0.8rem; }
.flow-pickrow { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.flow-pickrow__name { overflow-wrap: anywhere; font-size: 0.9rem; }
.flow-merge { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.flow-merge__item { display: flex; align-items: center; gap: 8px; padding: 8px; border: 1px solid var(--nx-border); border-radius: 10px; background: var(--nx-bg); min-width: 0; }
.flow-merge__item[draggable="true"] { cursor: grab; }
.flow-merge__item.is-me { border-style: dashed; }
.flow-merge__item.is-dragging { opacity: 0.4; }
.flow-merge__card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.flow-merge__card .nx-thumb { width: 56px; flex: none; }
.flow-merge__txt { display: flex; flex-direction: column; min-width: 0; }
.flow-merge__btns { display: flex; gap: 4px; flex: none; }
.flow-preview { margin-top: 10px; }
.flow-preview:empty { display: none; }
.flow-preview__btn { margin-top: 10px; min-height: 44px; }
.flow-preview__cap { margin: 0 0 4px; font-size: 0.85rem; font-weight: 600; }
.flow-preview__note { margin: 4px 0 0; font-size: 0.9rem; }
.flow-addmenu { display: grid; gap: 8px; margin: 10px 0; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.flow-addmenu[hidden] { display: none; }
.flow-addmenu__item { display: flex; gap: 10px; align-items: flex-start; min-height: 56px; padding: 10px 12px; font: inherit; text-align: left; color: var(--nx-text); background: var(--nx-surface); border: 2px solid var(--nx-border); border-radius: 10px; cursor: pointer; }
.flow-addmenu__item:hover { border-color: var(--nx-primary); }
.flow-addmenu__item > span:first-child { font-size: 1.4rem; }
.flow-addmenu__item small { display: block; color: var(--nx-text-muted); font-size: 0.8rem; }
.flow-output { margin-top: 16px; max-width: 420px; }
.flow-run { list-style: none; margin: 12px 0; padding: 0; display: grid; gap: 8px; }
.flow-run__item { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--nx-border); border-radius: 10px; }
.flow-run__item small { display: block; color: var(--nx-text-muted); }
.flow-run__note { color: var(--nx-text) !important; }
.flow-run__mark { flex: none; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--nx-border); margin-top: 2px; display: inline-grid; place-items: center; font-size: 0.8rem; font-weight: 800; }
.flow-run__item.is-busy .flow-run__mark { border-color: var(--nx-primary); border-top-color: transparent; animation: flow-spin 0.9s linear infinite; }
.flow-run__item.is-ok .flow-run__mark { background: var(--nx-success); border-color: var(--nx-success); color: #fff; }
.flow-run__item.is-ok .flow-run__mark::after { content: "✓"; }
.flow-run__item.is-bad { border-color: var(--nx-danger); background: var(--nx-danger-bg); }
.flow-run__item.is-bad .flow-run__mark { background: var(--nx-danger); border-color: var(--nx-danger); color: #fff; }
.flow-run__item.is-bad .flow-run__mark::after { content: "!"; }
@keyframes flow-spin { to { transform: rotate(360deg); } }
.flow-ok { font-weight: 700; color: var(--nx-success); margin: 0 0 12px; }
.flow-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.flow-compare__col { min-width: 0; border: 1px solid var(--nx-border); border-radius: 10px; padding: 12px; }
.flow-compare__col--after { border-color: var(--nx-success); }
.flow-compare__col h3 { margin: 0 0 4px; font-size: 1rem; }
.flow-compare__meta { margin: 0 0 8px; font-size: 0.85rem; color: var(--nx-text-muted); overflow-wrap: anywhere; }
.flow-notes { margin: 0; padding-left: 20px; }
.flow-final { margin: 14px 0 0; overflow-wrap: anywhere; }
@media (max-width: 700px) {
  .flow-compare { grid-template-columns: 1fr; }
  .flow-progress button { font-size: 0.8rem; flex-direction: column; text-align: center; justify-content: center; gap: 2px; padding: 6px 4px; }
  .flow-step__head { flex-wrap: wrap; }
  .flow-step__btns { width: 100%; justify-content: flex-end; }
  .flow-nav .btn { flex: 1 1 100%; }
  .flow-merge__item { flex-wrap: wrap; }
  .flow-merge__btns { width: 100%; justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) { .flow-run__item.is-busy .flow-run__mark { animation: none; } }

/* ---------- Flujo visual: miniaturas, cuadrículas, visor ampliado ---------- */
.flow-app { --flow-thumb: 170px; }
.flow-app .nx-thumb canvas, .flow-app .nx-thumb img { max-height: none; }
.flow-sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; }
.flow-sizes__lbl { font-size: 0.9rem; color: var(--nx-text-muted); margin-right: 4px; }
.flow-sizes button { font: inherit; font-size: 0.9rem; min-height: 40px; padding: 4px 12px; border: 2px solid var(--nx-border); border-radius: 999px; background: var(--nx-surface); color: var(--nx-text); cursor: pointer; }
.flow-sizes button[aria-pressed="true"] { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.1); font-weight: 700; }

/* Cuadrícula general: la usan la etapa 1, las vistas previas y el antes/después */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(var(--flow-thumb), 100%), 1fr)); gap: 12px; list-style: none; padding: 0; margin: 8px 0; }
.flow-thumb__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 6px; font: inherit; color: inherit; }
.flow-thumb__open:hover .nx-thumb, .flow-thumb__open:hover img { border-color: var(--nx-primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25); }
.flow-merge__open { width: 72px; flex: none; }
.flow-more { margin: 6px 0; min-height: 44px; }
.flow-pages { margin: 10px 0; min-width: 0; }
.flow-pages__foot { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0; }
.flow-inline-error { padding: 10px 12px; border-radius: 8px; background: var(--nx-danger-bg); color: var(--nx-danger); font-size: 0.9rem; }
.flow-inline-error p { margin: 0 0 6px; font-weight: 600; }
.flow-notice { margin: 6px 0; padding: 8px 12px; border-radius: 8px; background: rgba(37, 99, 235, 0.08); border: 1px solid var(--nx-primary); font-size: 0.9rem; }
.flow-notice[hidden] { display: none; }
.flow-check__lbl { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; font-weight: 600; cursor: pointer; }
.flow-check__lbl input { width: 22px; height: 22px; flex: none; accent-color: var(--nx-primary); margin-top: 2px; }

/* Casillas de página */
.flow-tile { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 8px; background: var(--nx-bg); border: 2px solid var(--nx-border); border-radius: 10px; min-width: 0; }
.flow-tile__pick { display: block; width: 100%; padding: 0; border: 0; background: none; font: inherit; color: inherit; cursor: pointer; text-align: center; position: relative; }
.flow-tile__open { display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; font: inherit; color: inherit; }
.flow-tile__pick .nx-thumb, .flow-tile__open .nx-thumb, .flow-tile__open img { width: 100%; }
.flow-tile__cap { display: block; margin-top: 6px; font-size: 0.8rem; color: var(--nx-text-muted); overflow-wrap: anywhere; }
.flow-tile__zoom { flex: none; min-width: 40px; min-height: 40px; margin-left: auto; border-radius: 50%; border: 1px solid var(--nx-border); background: var(--nx-surface); font-size: 1rem; cursor: zoom-in; }
.flow-tile__foot { display: flex; align-items: center; gap: 6px; min-width: 0; }
.flow-tile__foot .flow-tile__cap { margin-top: 0; flex: 1; min-width: 0; text-align: left; }
.flow-tile__mark { flex: none; display: none; width: 26px; height: 26px; border-radius: 50%; place-items: center; font-weight: 800; font-size: 0.8rem; color: #fff; background: var(--nx-danger); }
.flow-grid--remove .flow-tile.is-selected { border-color: var(--nx-danger); background: var(--nx-danger-bg); }
.flow-grid--remove .flow-tile.is-selected .nx-thumb { opacity: 0.5; }
.flow-grid--remove .flow-tile.is-selected .flow-tile__mark { display: grid; }
.flow-grid--remove .flow-tile__mark::after { content: "✕"; }
.flow-grid--remove .flow-tile.is-selected .flow-tile__cap { color: var(--nx-danger); font-weight: 700; }
.flow-tile__pick[aria-disabled="true"] { cursor: default; }

/* Reordenar */
.flow-tile--order { cursor: grab; }
.flow-tile--order.is-dragging { opacity: 0.4; }
.flow-tile--order.is-over { border-color: var(--nx-primary); border-style: dashed; }
.flow-tile--order.is-dup { border-color: var(--nx-primary); }
.flow-tile--order.is-grabbed { border-color: var(--nx-primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3); }
.flow-tile__pos { flex: none; min-width: 28px; height: 28px; padding: 0 6px; display: grid; place-items: center; border-radius: 14px; background: var(--nx-primary); color: var(--nx-primary-contrast); font-weight: 800; font-size: 0.85rem; }
.flow-tile__btns { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.flow-tile__btn { min-width: 44px; min-height: 44px; }
.flow-removed { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0; font-size: 0.9rem; }
.flow-removed:empty { display: none; }
.flow-restore { min-width: 44px; min-height: 40px; padding: 2px 10px; }
.flow-tile:focus-visible, .flow-tile__pick:focus-visible, .flow-tile__open:focus-visible, .flow-thumb__open:focus-visible, .flow-tile__zoom:focus-visible, .flow-sizes button:focus-visible { outline: 3px solid var(--nx-primary); outline-offset: 2px; }

/* Vista previa real de la marca de agua */
.flow-wmprev { margin: 10px 0; }
.flow-wmprev__frame { position: relative; max-width: 360px; min-height: 80px; }
.flow-wmprev__frame img { display: block; width: 100%; height: auto; border: 1px solid var(--nx-border); border-radius: 4px; background: #fff; }
.flow-wmprev__frame.is-loading { opacity: 0.6; }

/* Visor ampliado */
html.flow-viewer-open { overflow: hidden; }
.flow-viewer { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: stretch; justify-content: center; background: rgba(15, 23, 42, 0.78); padding: 12px; }
.flow-viewer[hidden] { display: none; }
.flow-viewer__box { display: flex; flex-direction: column; width: min(100%, 1100px); max-height: 100%; background: var(--nx-surface); color: var(--nx-text); border-radius: 12px; overflow: hidden; }
.flow-viewer__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--nx-border); }
.flow-viewer__title { flex: 1 1 160px; margin: 0; font-size: 1rem; overflow-wrap: anywhere; }
.flow-viewer__label { font-weight: 700; }
.flow-viewer__btn { font: inherit; min-height: 44px; min-width: 44px; padding: 4px 14px; border: 1px solid var(--nx-border); border-radius: 8px; background: var(--nx-bg); color: inherit; cursor: pointer; }
.flow-viewer__btn:hover:not(:disabled) { border-color: var(--nx-primary); }
.flow-viewer__btn:disabled { opacity: 0.35; cursor: default; }
.flow-viewer__btn:focus-visible, .flow-viewer__stage:focus-visible { outline: 3px solid var(--nx-primary); outline-offset: 2px; }
.flow-viewer__stage { position: relative; flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: #e8eaee; padding: 8px; -webkit-overflow-scrolling: touch; }
.flow-viewer__img { display: block; max-width: 100%; max-height: calc(100vh - 190px); width: auto; height: auto; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25); }
.flow-viewer__img:not([src]) { display: none; }
.flow-viewer.is-zoom .flow-viewer__img { max-width: none; max-height: none; }
.flow-viewer__stage.is-loading .flow-viewer__img { opacity: 0.35; }
.flow-viewer__status { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); margin: 0; padding: 8px 14px; border-radius: 8px; background: var(--nx-surface); color: var(--nx-text); font-weight: 600; text-align: center; max-width: 90%; }
.flow-viewer__status[hidden] { display: none; }
.flow-viewer__stage > .flow-viewer__btn { position: absolute; top: calc(50% + 40px); left: 50%; transform: translateX(-50%); }
.flow-viewer__stage > .flow-viewer__btn[hidden] { display: none; }
.flow-viewer__rot { position: relative; flex: none; }
.flow-viewer__rot .flow-viewer__img { position: absolute; left: 50%; top: 50%; max-width: none; max-height: none; transition: transform 0.25s ease; }
.flow-viewer.is-zoom .flow-viewer__rot .flow-viewer__img { max-width: none; max-height: none; }
.flow-viewer__turn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.flow-viewer__turn[hidden] { display: none; }
.flow-viewer__badge { font-weight: 700; color: var(--nx-primary); white-space: nowrap; }
.flow-viewer__badge[hidden], .flow-viewer__turn .flow-viewer__btn[hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .flow-viewer__rot .flow-viewer__img { transition: none; } }
.flow-viewer__nav { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 12px; border-top: 1px solid var(--nx-border); }
.flow-viewer__arrow { flex: 1; max-width: 220px; }
@media (max-width: 700px) {
  .flow-viewer { padding: 0; }
  .flow-viewer__box { border-radius: 0; width: 100%; }
  .flow-viewer__img { max-height: calc(100vh - 200px); }
  .flow-viewer__nav { padding: 8px; }
  .flow-viewer__arrow { flex: 1 1 40%; }
  .flow-viewer__turn { order: 3; flex: 1 0 100%; }
  .flow-grid { gap: 8px; }
}

.flow-loading { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 0.9rem; color: var(--nx-text-muted); }
.flow-spinner { flex: none; width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--nx-border); border-top-color: var(--nx-primary); animation: flow-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .flow-spinner { animation: none; } }

/* Giro por página (paso Girar y Reordenar del flujo): la miniatura gira en vivo con CSS; si queda de lado, la caja toma la forma de la hoja girada y la imagen se reduce para caber. */
.flow-tile--turn .flow-tile__open { cursor: zoom-in; }
.flow-tile.has-turn .nx-thumb { transition: aspect-ratio 0.25s ease; overflow: hidden; }
.flow-tile.has-turn .nx-thumb canvas, .flow-tile.has-turn .nx-thumb img { transform: rotate(var(--rot, 0deg)) scale(1); transition: transform 0.25s ease; }
.flow-tile.has-turn.is-side .nx-thumb canvas, .flow-tile.has-turn.is-side .nx-thumb img { transform: rotate(var(--rot, 0deg)) scale(var(--ratio, 0.77)); }
.flow-tile.has-turn.is-side .nx-thumb:not(.is-loading) { aspect-ratio: calc(1 / var(--ratio, 0.77)); }
.flow-tile.is-turned { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.08); }
.flow-turn { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; }
.flow-turn__btn { min-width: 44px; min-height: 44px; font-size: 1.2rem; }
.flow-turn__badge { font-size: 0.8rem; font-weight: 700; color: var(--nx-primary); white-space: nowrap; }
.flow-turn__reset { min-height: 44px; padding: 4px 10px; font-size: 0.85rem; }
.flow-turn__badge[hidden], .flow-turn__reset[hidden] { display: none; }
.flow-turn-all { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.flow-turn-all .btn { min-height: 44px; }
.flow-turn__btn:focus-visible, .flow-turn__reset:focus-visible, .flow-turn-all .btn:focus-visible { outline: 3px solid var(--nx-primary); outline-offset: 2px; }
.flow-count.is-warn { color: #8a5a00; background: #fff6e0; border-radius: 6px; padding: 6px 10px; }
@media (prefers-reduced-motion: reduce) { .flow-tile.has-turn .nx-thumb, .flow-tile.has-turn .nx-thumb canvas, .flow-tile.has-turn .nx-thumb img { transition: none; } }

/* ---------- Marca de agua (componente compartido: js/watermark-kit.js; lo usan el flujo y /marca-de-agua-pdf) ---------- */
.wm-kit { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 24px; align-items: start; margin: 12px 0; }
.wm-controls { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.wm-kit[data-kind="image"] .wm-only-text, .wm-kit[data-kind="text"] .wm-only-image { display: none; }
.wm-preview2 { position: sticky; top: 12px; min-width: 0; }
.wm-field input[type="range"] { width: 100%; height: 44px; margin: 0; accent-color: var(--nx-primary); }
.wm-field input[type="text"], .wm-field select { min-height: 44px; }
.wm-field output { font-weight: 700; }
.wm-row { display: flex; gap: 8px; align-items: center; min-width: 0; }
.wm-row--wrap { flex-wrap: wrap; }
.wm-row select { flex: 1; min-width: 0; }
.wm-btn { min-height: 44px; min-width: 44px; padding: 8px 14px; border: 2px solid var(--nx-border); border-radius: 10px; background: var(--nx-surface); color: inherit; font: inherit; font-weight: 600; cursor: pointer; }
.wm-btn:hover { border-color: var(--nx-primary); }
.wm-btn:focus-visible, .wm-anchor:focus-visible, .wm-swatch:focus-visible, .wm-mark--drag:focus-visible { outline: 3px solid var(--nx-primary); outline-offset: 2px; }
.wm-btn--toggle[aria-pressed="true"] { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.12); }
.wm-btn--b { font-weight: 800; }
.wm-btn--i { font-style: italic; }
.wm-btn--wide { margin-top: 6px; }
.wm-btn--icon { font-size: 1.4rem; line-height: 1; padding: 4px 10px; }
.wm-color { width: 52px; height: 44px; padding: 2px; border: 2px solid var(--nx-border); border-radius: 10px; background: var(--nx-surface); cursor: pointer; }
.wm-hex { width: 7.5em; text-transform: uppercase; font-family: ui-monospace, Consolas, monospace; }
.wm-swatch { width: 44px; height: 44px; border-radius: 50%; border: 3px solid var(--nx-surface); box-shadow: 0 0 0 2px var(--nx-border); cursor: pointer; padding: 0; }
.wm-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--nx-primary); }
.wm-anchors { display: grid; grid-template-columns: repeat(3, 44px); gap: 6px; margin: 4px 0 8px; }
.wm-anchor { width: 44px; height: 44px; padding: 0; display: grid; place-items: center; border: 2px solid var(--nx-border); border-radius: 8px; background: var(--nx-surface); cursor: pointer; }
.wm-anchor > span { width: 14px; height: 14px; border-radius: 3px; background: var(--nx-border); }
.wm-anchor[aria-pressed="true"] { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.12); }
.wm-anchor[aria-pressed="true"] > span { background: var(--nx-primary); }
.wm-anchor:disabled, .is-off .wm-anchors { opacity: 0.45; cursor: not-allowed; }
.wm-check { display: flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 600; cursor: pointer; }
.wm-check input { width: 22px; height: 22px; accent-color: var(--nx-primary); }
.wm-warn { margin: 6px 0 0; padding: 8px 12px; border-radius: 8px; background: var(--nx-danger-bg); color: var(--nx-danger); font-size: 0.9rem; }
.wm-modes { margin-bottom: 6px; }
.wm-mode { min-height: 44px; }
.flow-grid--wm { --flow-thumb: 110px; }
.flow-grid--wm .flow-tile.is-selected { border-color: var(--nx-primary); background: rgba(37, 99, 235, 0.08); }
.flow-grid--wm .flow-tile.is-off .nx-thumb { opacity: 0.45; }
.flow-grid--wm .flow-tile.is-selected .flow-tile__mark { display: grid; background: var(--nx-primary); }
.flow-grid--wm .flow-tile__mark::after { content: "✓"; }
.flow-grid--wm .flow-tile.is-selected .flow-tile__cap { color: var(--nx-primary); font-weight: 700; }
.wm-prevnav { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 4px 0 10px; flex-wrap: wrap; }
.wm-prevlabel { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.wm-pagenum { width: 4.5em; min-height: 44px; text-align: center; }
.wm-of { color: var(--nx-text-muted); font-weight: 400; }
.wm-stage { position: relative; width: 100%; max-width: 420px; margin: 0 auto; background: #fff; border: 1px solid var(--nx-border); border-radius: 4px; overflow: hidden; aspect-ratio: 612 / 792; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.wm-stage img { display: block; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.wm-stage__real { position: absolute; inset: 0; }
.wm-stage__marks { position: absolute; inset: 0; overflow: hidden; }
.wm-stage.is-loading::after, .wm-stage.is-busy::after { content: ""; position: absolute; top: 8px; right: 8px; width: 18px; height: 18px; border: 3px solid var(--nx-border); border-top-color: var(--nx-primary); border-radius: 50%; animation: wm-spin 0.8s linear infinite; }
@keyframes wm-spin { to { transform: rotate(360deg); } }
.wm-mark { position: absolute; white-space: nowrap; transform-origin: center; display: block; max-width: none; pointer-events: none; }
.wm-stage img.wm-mark--img { height: auto; width: auto; object-fit: contain; }
.wm-stage img.wm-mark--drag, .wm-mark--drag { pointer-events: auto; cursor: grab; touch-action: none; outline: 1px dashed rgba(37, 99, 235, 0.0); }
.wm-mark--drag.is-dragging { cursor: grabbing; }
/* Con la imagen real del servidor a la vista, la capa CSS queda invisible pero sigue siendo el «asa» para arrastrar. */
.wm-stage.is-real .wm-mark { opacity: 0 !important; }
.wm-stage.is-real .wm-mark--drag:hover, .wm-stage.is-real .wm-mark--drag:focus { outline: 2px dashed var(--nx-primary); outline-offset: 2px; }
.wm-prevcap { min-height: 2.4em; text-align: center; }
.wm-freenote { margin: 4px 0; }
@media (max-width: 860px) {
  .wm-kit { display: flex; flex-direction: column; gap: 14px; }
  .wm-preview2 { order: -1; }
}
@media (prefers-reduced-motion: reduce) { .wm-stage.is-loading::after, .wm-stage.is-busy::after { animation: none; } }
@media (max-width: 860px) {
  .wm-preview2 { position: sticky; top: 0; z-index: 5; padding: 6px 0 4px; background: var(--nx-bg); }
  .wm-stage { max-width: min(100%, 220px); }
}

/* ---------- Comprimir PDF: niveles y resultado visual (js/compress-kit.js, compartido con el paso Comprimir del flujo) ---------- */
.cmp-levels { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 10px; }
.cmp-levels > legend { padding: 0; margin-bottom: 8px; }
@media (min-width: 720px) { .cmp-levels { grid-template-columns: repeat(3, 1fr); } .cmp-levels > legend { grid-column: 1 / -1; margin-bottom: 0; } }
.cmp-level { position: relative; display: block; border: 2px solid var(--nx-border); border-radius: var(--nx-radius); background: var(--nx-surface); padding: 12px 14px; cursor: pointer; min-height: 44px; text-align: left; }
.cmp-level:hover { border-color: #b8c2d6; }
.cmp-level.is-selected { border-color: var(--nx-primary); background: #eff5ff; box-shadow: 0 0 0 1px var(--nx-primary) inset; }
.cmp-level:focus-within { outline: 3px solid var(--nx-primary); outline-offset: 2px; }
.cmp-level__input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.cmp-level__body { display: grid; gap: 4px; }
.cmp-level__top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.cmp-level__name { font-size: 1rem; }
.cmp-level__badge { font-size: 0.72rem; font-weight: 600; color: var(--nx-brand-green-dark); background: #e6f7f4; border-radius: 999px; padding: 2px 8px; }
.cmp-level.is-selected .cmp-level__badge { background: #dbe8ff; color: var(--nx-primary-dark); }
.cmp-level__text { font-size: 0.88rem; color: var(--nx-text-muted); line-height: 1.35; }

.cmp-result { margin: 18px auto 0; max-width: 640px; }
.cmp-summary { display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap; margin: 6px 0 4px; }
.cmp-ring { position: relative; width: 150px; height: 150px; flex: 0 0 auto; }
.cmp-ring__svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.cmp-ring__track { fill: none; stroke: #e6eaf1; stroke-width: 12; }
.cmp-ring__bar { fill: none; stroke: var(--nx-brand-teal); stroke-width: 12; stroke-linecap: round; transition: stroke-dashoffset 1.1s cubic-bezier(.2,.7,.2,1); }
.cmp-summary.is-kept .cmp-ring__bar { stroke: #9aa5b6; }
.cmp-ring__center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; }
.cmp-ring__pct { font-size: 1.9rem; font-weight: 800; color: var(--nx-brand-ink); }
.cmp-ring__sub { font-size: 0.78rem; color: var(--nx-text-muted); margin-top: 2px; }
.cmp-sizes { text-align: center; min-width: 0; }
.cmp-sizes__row { display: flex; align-items: baseline; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 1.45rem; font-weight: 700; }
.cmp-sizes__before { color: var(--nx-text-muted); text-decoration: line-through; text-decoration-thickness: 1px; }
.cmp-sizes__arrow { color: var(--nx-text-muted); font-weight: 400; }
.cmp-sizes__after { color: var(--nx-brand-green-dark); }
.cmp-summary.is-kept .cmp-sizes__before { text-decoration: none; }
.cmp-summary.is-kept .cmp-sizes__after { color: var(--nx-text); }
.cmp-sizes__legend { display: flex; justify-content: space-between; gap: 16px; font-size: 0.75rem; color: var(--nx-text-muted); margin-top: 2px; }
.cmp-sizes__saved { margin: 8px 0 0; font-size: 0.95rem; color: var(--nx-text-muted); }
.cmp-level-note { margin: 10px 0 0; font-size: 0.85rem; color: var(--nx-text-muted); }
.cmp-notes { list-style: none; margin: 8px auto 0; padding: 0; max-width: 520px; font-size: 0.85rem; color: var(--nx-text-muted); text-align: left; }
.cmp-notes li { padding-left: 1.4em; position: relative; margin-bottom: 3px; }
.cmp-notes li::before { content: "✓"; position: absolute; left: 0; color: var(--nx-success); font-weight: 700; }
.cmp-kept { margin: 12px auto 0; max-width: 520px; padding: 10px 14px; border-radius: var(--nx-radius); background: #fff8e1; border: 1px solid #f1dc9a; font-size: 0.92rem; text-align: left; }
.cmp-retry { margin-top: 10px; min-height: 44px; }
.cmp-compare__title { margin: 22px 0 10px; font-size: 1rem; }
.cmp-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.cmp-compare.is-single { grid-template-columns: minmax(0, 320px); justify-content: center; }
.cmp-compare__fig { margin: 0; min-width: 0; text-align: center; }
.cmp-compare__page { border: 1px solid var(--nx-border); border-radius: 6px; background: #fff; min-height: 120px; overflow: hidden; box-shadow: var(--nx-shadow); }
.cmp-compare__page .nx-thumb, .cmp-compare__page img, .cmp-compare__page canvas { width: 100%; height: auto; display: block; }
.cmp-compare__cap { display: flex; flex-direction: column; gap: 0; margin: 8px 0 6px; font-size: 0.85rem; color: var(--nx-text-muted); }
.cmp-compare__cap strong { color: var(--nx-text); }
.cmp-compare__zoom { min-height: 44px; width: 100%; max-width: 220px; }
.cmp-compare__hint { margin-top: 10px; text-align: center; }
@media (max-width: 480px) {
  .cmp-ring { width: 130px; height: 130px; }
  .cmp-ring__pct { font-size: 1.6rem; }
  .cmp-sizes__row { font-size: 1.2rem; }
  .cmp-compare { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) { .cmp-ring__bar { transition: none; } }
.cmp-flow { margin: 10px 0 18px; text-align: center; }
.cmp-flow .flow-sub { margin-bottom: 4px; }
.cmp-flow .cmp-kept { margin-left: auto; margin-right: auto; }

/* Botón de elegir archivo en los pasos del flujo (imagen de la marca de agua, PDF por unir): objetivo táctil de al menos 44 px */
.flow-pickrow .btn { min-height: 44px; }

/* Página de privacidad (/privacidad): texto de lectura con el mismo ancho que la portada */
.legal { max-width: var(--nx-read-w); }
.legal h2 { font-size: 1.2rem; margin: 28px 0 8px; }
.legal ul { padding-left: 1.2em; margin: 0 0 8px; }
.legal li { margin-bottom: 8px; line-height: 1.6; }
.legal p { line-height: 1.6; }
.legal__pending { padding: 12px 14px; border: 2px dashed #b45309; background: #fffbeb; color: #78350f; border-radius: var(--nx-radius); }
.site-footer p + p { margin-top: 6px; }

/* Portada: «¿Qué quieres hacer?» y buscador de herramientas */
.quick { margin: 24px 0 8px; max-width: var(--nx-read-w); }
.quick__title { margin: 0 0 12px; font-size: 1.15rem; }
.quick__btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.quick__btn {
  display: flex; align-items: center; justify-content: center; gap: 8px; text-align: center;
  min-height: 64px; padding: 12px 14px; font-weight: 700; text-decoration: none;
  color: var(--nx-primary-contrast); background: var(--nx-primary); border-radius: var(--nx-radius);
}
.quick__btn:hover { background: var(--nx-primary-dark); }
.quick__btn:focus-visible, .tool-search__input:focus-visible { outline: 3px solid var(--nx-primary-dark); outline-offset: 2px; }
.tool-search { margin-top: 16px; }
.tool-search__label { display: block; margin-bottom: 6px; font-weight: 600; }
.tool-search__input {
  width: 100%; box-sizing: border-box; padding: 12px 14px; font: inherit; color: var(--nx-text);
  background: var(--nx-surface); border: 1px solid var(--nx-border); border-radius: var(--nx-radius);
}
.tool-search__status { margin: 6px 0 0; min-height: 1.2em; font-size: 0.9rem; color: var(--nx-text-muted); }
.category-title { scroll-margin-top: 80px; }
[data-tool-card][hidden], [data-tool-section][hidden] { display: none; }
@media (max-width: 640px) { .quick__btns { grid-template-columns: 1fr; } }

/* Word, Excel y PowerPoint a PDF (sin estilos en línea en el marcado) */
.office-tool .hint { margin-top: 14px; }
.office-tool__actions { margin-top: 12px; }
.office-tool .warn-box { margin-top: 16px; }
