/* ConversorOnline — diseño 2026 (piloto). Claro, sobrio, un solo color de marca. */

@font-face {
  font-family: "Instrument Sans";
  src: url("fonts/instrument-sans-latin-wght.woff2") format("woff2");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --sunken: #f3f2ee;
  --line: #e4e2dc;
  --line-strong: #cfccc4;
  --ink: #1b1b18;
  --muted: #65645d;
  --faint: #8d8b83;
  --brand: #0f6b5a;
  --brand-hover: #0b5548;
  --brand-soft: #e6f0ec;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(27, 27, 24, .05), 0 4px 16px rgba(27, 27, 24, .04);
  --wrap: 1120px;
  --font: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Grano de papel casi imperceptible: da textura sin llamar la atención. */
  background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.015em; margin: 0; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 12px; background: var(--surface); padding: 8px 12px; z-index: 10; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* ---------- Cabecera ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid transparent;
  background: rgba(250, 250, 247, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  transition: border-color .2s, box-shadow .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 6px 24px -18px rgba(27, 27, 24, .35); }
.site-header .wrap {
  display: flex; align-items: center; gap: 32px; height: 60px;
}
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--ink); text-decoration: none; font-weight: 650; font-size: 17px; letter-spacing: -0.01em;
}
.logo:hover { color: var(--ink); }
.logo-mark {
  width: 24px; height: 24px; border-radius: 6px; background: var(--brand);
  display: grid; place-items: center; color: #fff;
}
.nav { display: flex; gap: 24px; flex: 1; }
.nav a { color: var(--muted); text-decoration: none; font-size: 15px; position: relative; transition: color .15s; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1.5px; border-radius: 1px;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .25s cubic-bezier(.2, .7, .2, 1);
}
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.header-actions { display: flex; gap: 8px; align-items: center; }

@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: wrap; height: auto; padding-top: 12px; gap: 0; justify-content: space-between; }
  .nav {
    order: 3; flex-basis: 100%; gap: 20px; overflow-x: auto; scrollbar-width: none;
    padding: 12px 0; margin-top: 10px; border-top: 1px solid var(--line);
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
}

/* ---------- Botones ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: 500 15px var(--font); text-decoration: none; cursor: pointer;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .1s;
}
.btn:active:not(:disabled) { transform: translateY(.5px) scale(.985); }
.btn:hover { background: var(--sunken); color: var(--ink); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary {
  background: var(--brand); border-color: var(--brand); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .16), 0 1px 2px rgba(15, 107, 90, .3), 0 4px 12px -6px rgba(15, 107, 90, .5);
}
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--sunken); }
.btn-sm { height: 32px; padding: 0 10px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------- Cabecera de herramienta ---------- */

.tool-head { padding: 40px 0 24px; }
.crumbs { font-size: 14px; color: var(--faint); margin-bottom: 14px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }
.tool-head h1 { font-size: clamp(28px, 4vw, 38px); font-weight: 650; }
.tool-head p { color: var(--muted); font-size: 17px; margin: 10px 0 0; max-width: 62ch; }

.privacy-note {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  padding: 6px 12px 6px 10px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-hover); font-size: 14px; font-weight: 500;
}
.privacy-note.server { background: var(--sunken); color: var(--muted); }

/* ---------- Área de trabajo ---------- */

.workspace {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 24px; align-items: start;
  padding-bottom: 64px;
}
@media (max-width: 880px) { .workspace { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
@media (min-width: 881px) { .workspace > .panel { position: sticky; top: 84px; } }
.panel-body { padding: 20px; }
.panel h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 240px; padding: 32px; text-align: center; cursor: pointer;
  border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: var(--surface);
  transition: border-color .15s, background-color .15s, min-height .3s cubic-bezier(.2, .7, .2, 1), transform .2s;
}
.dropzone:hover { border-color: var(--brand); background-color: var(--brand-soft); }
.dropzone .icon { transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.dropzone:hover .icon, .dropzone.is-over .icon { transform: translateY(-3px); }
/* Al arrastrar encima, el borde punteado se mueve. */
.dropzone.is-over {
  border-color: transparent; background-color: var(--brand-soft); transform: scale(1.005);
  background-image:
    linear-gradient(90deg, var(--brand) 50%, transparent 0), linear-gradient(90deg, var(--brand) 50%, transparent 0),
    linear-gradient(0deg, var(--brand) 50%, transparent 0), linear-gradient(0deg, var(--brand) 50%, transparent 0);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 12px 1.5px, 12px 1.5px, 1.5px 12px, 1.5px 12px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  animation: ants .5s linear infinite;
}
@keyframes ants { to { background-position: 12px 0, -12px 100%, 0 -12px, 100% 12px; } }
.dropzone strong { font-size: 17px; font-weight: 600; }
.dropzone span { color: var(--muted); font-size: 14px; }
.dropzone .icon { color: var(--brand); margin-bottom: 6px; }
.dropzone.compact { min-height: 0; flex-direction: row; padding: 14px; gap: 10px; }
.dropzone.compact .icon { margin: 0; }

/* ---------- Lista de archivos ---------- */

.files { list-style: none; margin: 16px 0 0; padding: 0; }
.file {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  transition: border-color .15s, box-shadow .2s;
}
.file:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
/* Barra fina mientras se procesa ese archivo. */
.file.is-working::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 2px; width: 35%;
  background: linear-gradient(90deg, transparent, var(--brand), transparent);
  animation: working 1.1s cubic-bezier(.4, 0, .2, 1) infinite;
}
@keyframes working { from { transform: translateX(-100%); } to { transform: translateX(290%); } }
.file + .file { margin-top: 8px; }
.file.dragging { opacity: .5; }
.file.drop-before { box-shadow: 0 -2px 0 var(--brand); }
.thumb {
  width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--sunken);
  object-fit: cover; display: grid; place-items: center; color: var(--faint); font: 600 11px var(--mono);
}
.file-name { font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { color: var(--muted); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.file-meta .saving, .file-meta .worse {
  display: inline-block; padding: 0 7px; border-radius: 999px; font-weight: 600; font-size: 12.5px; line-height: 20px;
}
.file-meta .saving { color: var(--brand-hover); background: var(--brand-soft); }
.file-meta .worse { color: var(--danger); background: var(--danger-soft); }
.file-meta .err { color: var(--danger); }
.file-actions { display: flex; gap: 4px; align-items: center; }
.handle { cursor: grab; color: var(--faint); padding: 4px; display: grid; place-items: center; }
.handle:active { cursor: grabbing; }

/* ---------- Formularios ---------- */

.field + .field { margin-top: 18px; }
.field > label, .field > .label { display: block; font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.hint { color: var(--faint); font-size: 13px; margin-top: 6px; }

.segmented { display: flex; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.segmented label { flex: 1; position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.segmented span {
  transition: background-color .2s, color .2s;
  display: block; text-align: center; padding: 8px 4px; font-size: 14px; font-weight: 500; color: var(--muted);
}
.segmented label + label span { border-left: 1px solid var(--line-strong); }
.segmented input:checked + span { background: var(--ink); color: #fff; }
.segmented input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: -2px; }
.segmented input:disabled + span { opacity: .4; }

input[type="range"] { width: 100%; accent-color: var(--brand); }
.range-row { display: flex; justify-content: space-between; font-size: 14px; }
.range-row output { font-variant-numeric: tabular-nums; color: var(--muted); }

select, input[type="number"], input[type="text"] {
  width: 100%; height: 38px; padding: 0 10px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); font: 15px var(--font);
}

.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

.summary { font-size: 14px; color: var(--muted); margin-bottom: 12px; font-variant-numeric: tabular-nums; }
.summary strong { color: var(--ink); }

.alert {
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-sm); font-size: 14px;
  background: var(--danger-soft); color: var(--danger);
}

/* ---------- Bloques de contenido ---------- */

.section { padding: 56px 0; border-top: 1px solid var(--line); }
.section h2 { font-size: 22px; font-weight: 650; margin-bottom: 20px; }
.cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
@media (max-width: 760px) { .cols { grid-template-columns: 1fr; gap: 20px; } }
.cols h3 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.cols p { color: var(--muted); margin: 0; font-size: 15px; }

.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
.faq summary::after { content: "+"; color: var(--faint); font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq p { color: var(--muted); margin: 10px 0 0; max-width: 70ch; }

/* ---------- Pie ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 40px 0; font-size: 14px; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 24px 48px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--ink); text-decoration: underline; }

/* ---------- Aviso de cookies ---------- */

.consent {
  position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 520px; z-index: 50;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(27, 27, 24, .12); padding: 16px; font-size: 14px;
}
.consent p { margin: 0 0 12px; color: var(--muted); }
.consent .actions { display: flex; gap: 8px; justify-content: flex-end; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Portada ---------- */

html { scroll-behavior: smooth; }
[id] { scroll-margin-top: 80px; }

.hero { padding: 72px 0 64px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 56px; align-items: center; }
.eyebrow { margin: 0 0 16px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); }
.hero h1 { font-size: clamp(34px, 5vw, 52px); font-weight: 650; letter-spacing: -0.028em; line-height: 1.08; text-wrap: balance; }
.lead { font-size: 18px; color: var(--muted); margin: 20px 0 0; max-width: 54ch; text-wrap: pretty; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.hero-copy > * { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.hero-copy > :nth-child(2) { animation-delay: .05s; }
.hero-copy > :nth-child(3) { animation-delay: .1s; }
.hero-copy > :nth-child(4) { animation-delay: .15s; }
.finder { padding: 8px; animation: rise .6s .18s cubic-bezier(.2, .7, .2, 1) both; }
.finder-drop { min-height: 320px; border-color: var(--line); }
.finder-drop .icon { display: grid; }
.finder-drop span:last-child { line-height: 1.6; }
.finder-result { padding: 8px; }
.finder-file { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 4px 4px 14px; border-bottom: 1px solid var(--line); }
.finder-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; max-height: 360px; overflow: auto; }
.finder-empty { color: var(--muted); font-size: 14px; padding: 12px 4px; }
.finder-more { font-size: 14px; padding: 6px 4px 2px; }
.finder .tool { padding: 12px 14px; align-items: center; }
.finder .tool-text { display: none; }
.finder .tool-body { flex-direction: row; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.finder .tool .tag { margin-top: 0; }
@media (max-width: 880px) {
  .hero { padding: 40px 0 48px; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .finder-drop { min-height: 200px; }
}

/* ---------- Catálogo ---------- */

.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 8px 24px; }
.section-head h2 { margin-bottom: 0; }
.legend { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.group-title { margin: 36px 0 12px; font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--faint); }
.tools { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 10px; }
@media (max-width: 400px) { .tools { grid-template-columns: 1fr; } }
.tool {
  height: 100%; display: grid; grid-template-columns: 40px minmax(0, 1fr) 16px; gap: 14px; align-items: start;
  padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink); text-decoration: none;
  transition: border-color .15s, box-shadow .2s, transform .2s cubic-bezier(.2, .7, .2, 1);
}
.tool:hover { color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow); transform: translateY(-1px); }
.tool-icon {
  width: 40px; height: 40px; border-radius: 8px; display: grid; place-items: center;
  background: var(--sunken); color: var(--ink); transition: background-color .2s, color .2s;
}
.tool:hover .tool-icon { background: var(--brand-soft); color: var(--brand); }
.tool-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.tool-name { font-weight: 600; font-size: 15.5px; }
.tool-text { color: var(--muted); font-size: 14px; line-height: 1.45; }
.tool-arrow { color: var(--faint); align-self: center; opacity: 0; transform: translateX(-4px); transition: opacity .2s, transform .2s; }
.tool:hover .tool-arrow { opacity: 1; transform: none; color: var(--brand); }
.tool .tag { margin-top: 8px; }

.tag {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted);
  font-size: 12px; font-weight: 500; line-height: 20px; white-space: nowrap;
}
.tag-local { background: var(--brand-soft); color: var(--brand-hover); }

/* ---------- Dónde se procesan ---------- */

.where { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .where { grid-template-columns: 1fr; } }
.where-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.where-icon { width: 42px; height: 42px; border-radius: 9px; display: grid; place-items: center; background: var(--sunken); color: var(--ink); }
.where-icon.local { background: var(--brand-soft); color: var(--brand); }
.where-card h3 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; }
.where-card p { color: var(--muted); margin: 0; }
.where-card .where-proof { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); font-size: 14px; color: var(--faint); }

/* ---------- Herramientas de PDF ---------- */

.docbar {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.err-text { color: var(--danger); }

.pages {
  list-style: none; margin: 16px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px;
}
.page { position: relative; user-select: none; }
.page[draggable="true"] { cursor: grab; }
.page.dragging { opacity: .4; }
.page.drop-before::before, .page.drop-after::after {
  content: ""; position: absolute; top: 0; bottom: 34px; width: 3px; border-radius: 2px; background: var(--brand);
}
.page.drop-before::before { left: -9px; }
.page.drop-after::after { right: -9px; }
.page-thumb {
  position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 3 / 4; padding: 10px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; overflow: hidden;
  transition: border-color .15s, box-shadow .2s, background-color .2s;
}
.page.is-static .page-thumb { cursor: default; }
.page-thumb:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.page-thumb canvas {
  max-width: 100%; max-height: 100%; background: #fff; box-shadow: 0 1px 3px rgba(27, 27, 24, .18);
  transform: rotate(var(--rot, 0deg)) scale(var(--fit, 1)); transition: transform .3s cubic-bezier(.2, .7, .2, 1), opacity .2s, filter .2s;
}
.page-x {
  position: absolute; inset: 0; display: none; place-items: center; font-size: 44px; font-weight: 300; color: var(--danger);
}
.page.is-removed .page-thumb { border-color: var(--danger); background: var(--danger-soft); }
.page.is-removed canvas { opacity: .25; filter: grayscale(1); }
.page.is-removed .page-x { display: grid; }
.page.is-out canvas { opacity: .3; }
.page-foot { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 34px; padding-top: 4px; }
.page-num { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; padding-left: 2px; }
.page-tools { display: flex; opacity: 0; transition: opacity .15s; }
.page-tools .btn { height: 28px; padding: 0 7px; font-size: 15px; }
.page:hover .page-tools, .page:focus-within .page-tools { opacity: 1; }
@media (hover: none) { .page-tools { opacity: 1; } }
[data-modo="rotar"] .page-tools [data-act="remove"], [data-modo="quitar"] .page-tools [data-act="left"],
[data-modo="quitar"] .page-tools [data-act="right"] { display: none; }

.page.has-part .page-thumb { border-color: hsl(var(--part-hue) 40% 62%); background: hsl(var(--part-hue) 35% 95%); }
.part-tag { font-size: 12px; font-weight: 600; color: hsl(var(--part-hue) 45% 35%); }
.page.has-part .part-tag::before { content: "Archivo "; font-weight: 500; }
.parts { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 14px; }
.parts li { display: flex; align-items: center; gap: 8px; }
.parts li span:last-child { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.parts .dot { width: 9px; height: 9px; border-radius: 50%; background: hsl(var(--part-hue) 45% 50%); }
.parts .more { color: var(--muted); }

.bulk { display: flex; flex-wrap: wrap; gap: 8px; }

.choices { display: grid; gap: 8px; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; }
.choice span {
  display: block; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.choice strong { display: block; font-size: 14.5px; font-weight: 600; }
.choice em { display: block; font-style: normal; font-size: 13px; color: var(--muted); }
.choice input:checked + span { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.choice input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Metadatos */
.file-tall { align-items: start; }
.found { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  display: inline-block; padding: 1px 9px; border-radius: 999px; background: var(--sunken); color: var(--muted);
  font-size: 12.5px; line-height: 21px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip-risk { background: var(--danger-soft); color: var(--danger); font-weight: 500; }
.chip-ok { background: var(--brand-soft); color: var(--brand-hover); font-weight: 600; }

/* Aplanar */
.fields-table { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 520px; }
.fields-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.fields-table th { position: sticky; top: 0; background: var(--sunken); text-align: left; font-weight: 600; padding: 9px 14px; }
.fields-table td { padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.fields-table td:first-child { color: var(--muted); width: 40%; }
.fields-table td.empty { color: var(--faint); }

/* Marca de agua */
.preview { position: relative; margin-top: 16px; width: min(100%, 560px); line-height: 0; box-shadow: var(--shadow); border: 1px solid var(--line); }
.preview canvas { display: block; width: 100% !important; height: auto; }
.preview #overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.swatches { display: flex; gap: 10px; }
.swatches label { position: relative; cursor: pointer; }
.swatches input { position: absolute; opacity: 0; }
.swatches span { display: block; width: 28px; height: 28px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 2px rgba(255,255,255,.6); transition: transform .15s; }
.swatches input:checked + span { outline: 2px solid var(--ink); outline-offset: 2px; }
.swatches input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.swatches label:hover span { transform: scale(1.08); }

/* ---------- Editor de PDF ---------- */

.editor-drop { min-height: 280px; margin-bottom: 64px; }
body.is-editing .site-footer { display: none; }
.editor { --tb: 60px; }
.ed-toolbar {
  position: sticky; top: var(--tb); z-index: 15;
  display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap;
  padding: 8px 16px; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.ed-group { display: flex; align-items: center; gap: 2px; }
.ed-right { margin-left: auto; gap: 4px; }
.ed-sep { width: 1px; height: 22px; background: var(--line); margin: 0 6px; }
.ed-tool {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 46px; height: 46px; padding: 0 6px; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--muted); font: 500 11.5px var(--font); cursor: pointer;
  transition: background-color .15s, color .15s;
}
.ed-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ed-tool:hover { background: var(--sunken); color: var(--ink); }
.ed-tool.is-active { background: var(--brand-soft); color: var(--brand-hover); }
.ed-tool:disabled { opacity: .35; cursor: default; background: transparent; }
.ed-mini { min-width: 34px; height: 34px; padding: 0 6px; font-size: 15px; }
.ed-mini svg { width: 18px; height: 18px; }
.ed-mini[aria-pressed="true"] { background: var(--ink); color: #fff; }
.ed-zoom { min-width: 48px; text-align: center; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ed-props { gap: 6px; padding-left: 14px; border-left: 1px solid var(--line); }
.ed-props select { width: 108px; height: 34px; }
.ed-props input[type="number"] { width: 64px; height: 34px; }
.ed-color { position: relative; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--radius-sm); cursor: pointer; }
.ed-color:hover { background: var(--sunken); }
.ed-color input { width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; overflow: hidden; cursor: pointer; background: none; }
.ed-color input::-webkit-color-swatch-wrapper { padding: 0; }
.ed-color input::-webkit-color-swatch { border: 0; border-radius: 50%; }
.ed-redact { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-right: 6px; cursor: pointer; }
.ed-redact input { accent-color: var(--brand); }
.ed-hint { padding: 8px 16px; font-size: 13.5px; color: var(--muted); text-align: center; min-height: 36px; transition: color .2s, background-color .2s; }
.ed-hint.is-error { color: var(--danger); background: var(--danger-soft); }
.ed-ocr {
  display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap;
  margin: 0 16px 8px; padding: 10px 14px; border-radius: var(--radius-sm);
  background: var(--brand-soft); color: var(--brand-hover); font-size: 14px; text-align: center;
}
.ed-ocr[hidden] { display: none; }

.ed-body { display: grid; grid-template-columns: 132px minmax(0, 1fr); align-items: start; }
.ed-thumbs {
  position: sticky; top: calc(var(--tb) + 64px); max-height: calc(100vh - var(--tb) - 80px); overflow: auto;
  display: grid; gap: 12px; padding: 4px 16px 24px; scrollbar-width: thin;
}
.ed-thumb { display: grid; gap: 4px; justify-items: center; padding: 6px; border: 1px solid transparent; border-radius: var(--radius-sm); background: none; cursor: pointer; color: var(--muted); font: 12px var(--font); }
.ed-thumb canvas { width: 96px; background: #fff; box-shadow: 0 1px 3px rgba(27, 27, 24, .2); }
.ed-thumb:hover { background: var(--sunken); }
.ed-thumb.is-current { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-hover); }
.ed-pages { display: flex; flex-direction: column; align-items: safe center; gap: 20px; padding: 8px 16px 80px; min-width: 0; overflow-x: auto; }
.ed-page { flex: none; }
@media (max-width: 860px) {
  .ed-body { grid-template-columns: 1fr; }
  .ed-thumbs { display: none; }
  .ed-tool span { display: none; }
  .ed-tool { min-width: 40px; height: 40px; }
  .ed-toolbar { gap: 4px 8px; padding: 6px 8px; }
  .ed-group#tools { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .ed-right { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .ed-right .ed-sep { display: none; }
  .ed-right #save { margin-left: auto; }
  .ed-zoom { min-width: 40px; }
  body.is-editing .site-header { position: relative; }
  .editor { --tb: 0px; }
  .ed-pages { padding: 8px 8px 80px; }
}
.ed-right .btn { white-space: nowrap; }

.ed-page { position: relative; background: #fff; box-shadow: 0 1px 2px rgba(27, 27, 24, .08), 0 6px 24px rgba(27, 27, 24, .08); }
.ed-page > canvas { position: absolute; inset: 0; width: 100% !important; height: 100%; }
.ed-hits, .ed-layer { position: absolute; inset: 0; }
.ed-hits { display: none; }
.editor[data-tool="edit"] .ed-hits { display: block; }
.ed-hit { position: absolute; cursor: text; border-radius: 2px; transition: background-color .12s, box-shadow .12s; }
.ed-hit:hover { background: rgba(15, 107, 90, .12); box-shadow: 0 0 0 1px rgba(15, 107, 90, .55); }
.ed-layer { pointer-events: none; }
.editor[data-tool="text"] .ed-page { cursor: text; }
.editor:is([data-tool="check"], [data-tool="cross"], [data-tool="dot"], [data-tool="sign"], [data-tool="image"], [data-tool="highlight"], [data-tool="whiteout"]) .ed-page { cursor: crosshair; }

.ed-obj { position: absolute; pointer-events: auto; cursor: move; touch-action: none; }
.ed-obj.is-selected { outline: 1.5px solid var(--brand); outline-offset: 2px; }
.ed-obj:not(.is-selected):hover { outline: 1px dashed rgba(15, 107, 90, .6); outline-offset: 2px; }
.ed-handle {
  position: absolute; right: -7px; bottom: -7px; width: 12px; height: 12px; border-radius: 3px;
  background: #fff; border: 1.5px solid var(--brand); cursor: nwse-resize; display: none;
}
.ed-obj.is-selected .ed-handle { display: block; }
.ed-text { white-space: pre; line-height: 1.2; padding: 0; min-width: 4px; transform-origin: 0 0; }
.ed-text.is-empty::before { content: "Escribe aquí"; color: rgba(27, 27, 24, .35); }
.ed-text.is-editing { cursor: text; outline: 1.5px solid var(--brand); outline-offset: 2px; caret-color: var(--brand); }
.ed-text.is-editing.is-empty::before { content: none; }
.ed-cover { position: absolute; background: #fff; pointer-events: none; }
.ed-image img, .ed-sign img { width: 100%; height: 100%; display: block; user-select: none; }
.ed-check svg, .ed-cross svg, .ed-dot svg { width: 100%; height: 100%; display: block; overflow: visible; }
.ed-check path, .ed-cross path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ed-dot circle { fill: currentColor; }
.ed-highlight { background: rgba(255, 217, 0, .4); mix-blend-mode: multiply; }
.ed-whiteout { background: #fff; box-shadow: 0 0 0 1px rgba(27, 27, 24, .08); }

.sign-dialog { border: 0; padding: 0; border-radius: 14px; width: min(640px, calc(100vw - 32px)); box-shadow: 0 24px 64px rgba(27, 27, 24, .25); }
.sign-dialog::backdrop { background: rgba(27, 27, 24, .35); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.sign-box { padding: 20px; }
.sign-box h2 { font-size: 18px; margin-bottom: 14px; }
.sign-tabs { display: inline-flex; gap: 4px; padding: 3px; background: var(--sunken); border-radius: 8px; margin-bottom: 12px; }
.sign-tabs button { border: 0; background: none; padding: 6px 14px; border-radius: 6px; font: 500 14px var(--font); color: var(--muted); cursor: pointer; }
.sign-tabs .is-active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(27, 27, 24, .1); }
.sign-pad { position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius); background: #fff; overflow: hidden; }
.sign-pad canvas { display: block; width: 100%; aspect-ratio: 3 / 1; touch-action: none; cursor: crosshair; }
#pad-draw::after { content: ""; position: absolute; left: 8%; right: 8%; bottom: 26%; border-bottom: 1px dashed var(--line-strong); pointer-events: none; }
.sign-line { position: absolute; left: 8%; bottom: 14%; font-size: 12px; color: var(--faint); pointer-events: none; }
#pad-type input { border: 0; border-bottom: 1px solid var(--line); border-radius: 0; }
.sign-actions { display: flex; gap: 8px; margin-top: 14px; align-items: center; }

/* ---------- Detalles ---------- */

img.thumb { opacity: 0; transition: opacity .35s; }
img.thumb.loaded { opacity: 1; }

.tool-head > * { animation: rise .55s cubic-bezier(.2, .7, .2, 1) both; }
.tool-head > :nth-child(2) { animation-delay: .04s; }
.tool-head > :nth-child(3) { animation-delay: .09s; }
.tool-head > :nth-child(4) { animation-delay: .14s; }
.workspace { animation: rise .6s .16s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* Botón ocupado: pequeño indicador giratorio. */
.btn.is-busy::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Botón terminado: la marca se dibuja. */
.btn.is-done, .btn.is-done:disabled { opacity: 1; background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn .check path { stroke-dasharray: 16; stroke-dashoffset: 16; animation: draw .45s .05s cubic-bezier(.2, .7, .2, 1) forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

.privacy-note svg { flex: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  img.thumb, .btn .check path { opacity: 1; stroke-dashoffset: 0; }
}

/* Páginas de error */
.error-page { padding: 72px 0 96px; }
.error-page .error-code { font-size: 15px; font-weight: 600; color: var(--muted); letter-spacing: .08em; margin: 0 0 6px; }
.error-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }

/* ---------- Convertir, traducir y reconocer texto (/convert/) ---------- */
.modes { margin-bottom: 14px; background: var(--surface); }
.jobs-title { font-size: 15px; font-weight: 600; margin: 28px 0 0; }
.job .thumb { font-size: 10px; }
.job.is-done .thumb { background: var(--brand-soft); color: var(--brand-hover); }
.job.is-failed .thumb { background: var(--danger-soft); color: var(--danger); }
.job .file-meta { white-space: normal; }
.job-bar { height: 4px; margin-top: 8px; border-radius: 2px; background: var(--sunken); overflow: hidden; }
.job-bar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; transition: width .4s; }
.choice strong .tag { margin-left: 6px; font-weight: 500; vertical-align: 1px; }
.alert-action { margin-left: 4px; font: inherit; font-weight: 600; color: inherit; text-decoration: underline; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---------- Quitar fondo y ampliar: original y resultado lado a lado ---------- */
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 14px; }
@media (max-width: 600px) { .compare { grid-template-columns: 1fr; } }
.compare figure { margin: 0; position: relative; display: grid; place-items: center; min-height: 220px; padding: 10px;
  background: var(--sunken); border: 1px solid var(--line); border-radius: var(--radius); }
.compare img { max-width: 100%; max-height: 420px; object-fit: contain; }
.compare figcaption { position: absolute; left: 10px; top: 8px; font-size: 12px; color: var(--muted); background: var(--surface);
  padding: 1px 8px; border-radius: 999px; }
.compare .checker { background-color: #fff; background-image:
  linear-gradient(45deg, #e8e6e0 25%, transparent 25%), linear-gradient(-45deg, #e8e6e0 25%, transparent 25%),
  linear-gradient(45deg, transparent 75%, #e8e6e0 75%), linear-gradient(-45deg, transparent 75%, #e8e6e0 75%);
  background-size: 18px 18px; background-position: 0 0, 0 9px, 9px -9px, -9px 0; }
.compare-wait { color: var(--muted); font-size: 14px; text-align: center; }
#download { margin-top: 8px; }

/* Aviso breve abajo de la pantalla (UI.aviso) */
.ui-aviso { position: fixed; left: 50%; bottom: 20px; z-index: 60; max-width: min(560px, calc(100vw - 32px));
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  padding: 10px 14px; border-radius: var(--radius-sm); background: var(--ink); color: #fff; font-size: 14px;
  box-shadow: 0 6px 24px rgba(27, 27, 24, .2); }
.ui-aviso.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.ui-aviso a { color: #9fe3d2; font-weight: 600; }

/* ---------- Panel de administración ---------- */
.adm { padding-bottom: 64px; }
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.adm-card, .adm-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.adm-card { display: grid; gap: 2px; padding: 18px; }
.adm-num { font-size: 28px; font-weight: 650; font-variant-numeric: tabular-nums; }
.adm-label { font-weight: 500; }
.adm-sub { display: block; color: var(--muted); font-size: 13.5px; }
.adm-box { padding: 20px; margin-top: 16px; min-width: 0; }
.adm-box h2 { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.adm-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.adm-cols .adm-box { margin-top: 16px; }
@media (max-width: 800px) { .adm-cols { grid-template-columns: 1fr; } }
.adm-services { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.adm-services li { display: grid; grid-template-columns: 12px auto; column-gap: 10px; align-items: baseline; }
.adm-services .adm-sub { grid-column: 2; }
.adm-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--faint); }
.adm-dot.ok { background: #1f9d6b; }
.adm-dot.err { background: var(--danger); }
.adm-chart { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 3px; align-items: end; height: 160px; margin-bottom: 8px; }
.adm-bar { display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 4px; }
.adm-bar i { display: flex; flex-direction: column; justify-content: flex-end; width: 100%; min-height: 2px; background: var(--brand); border-radius: 3px 3px 0 0; overflow: hidden; }
.adm-bar b { display: block; width: 100%; background: var(--danger); }
.adm-bar span { font-size: 10px; color: var(--faint); font-variant-numeric: tabular-nums; }
.adm-pills { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.adm-table th { text-align: left; font-weight: 500; color: var(--muted); padding: 6px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.adm-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.adm-scroll { overflow-x: auto; }
.adm-file { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-tag { display: inline-block; padding: 0 8px; border-radius: 999px; font-size: 12px; line-height: 20px; background: var(--sunken); color: var(--muted); }
.adm-tag.ok { background: var(--brand-soft); color: var(--brand-hover); }
.adm-tag.err { background: var(--danger-soft); color: var(--danger); }
.adm-fallos { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; font-size: 14px; }
@media (max-width: 600px) { .adm-bar .adm-minor { visibility: hidden; } .adm-file { max-width: 160px; } }
