/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #eceef6;
  --text: #232323;
  --muted: #6e6e6e;
  --line: #dcdde8;
  --accent: #45489a;
  --accent-strong: #363979;
  --accent-soft: #e9eaf6;
  --on-accent: #ffffff;
  --brand-red: #d80c0c;
  --corp-bar: #45489a;
  --corp-dark: #232323;
  --sans: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --shadow: 0 1px 2px rgba(35, 35, 35, .05), 0 12px 32px -12px rgba(35, 35, 35, .16);
  --warn: #8a5300;
  --warn-soft: #fff2d9;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --ok: #2b8a3e;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 18px;
  --radius-sm: 10px;
  --gutter: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --surface: #1e1e1e;
    --surface-2: #2a2a33;
    --text: #f1f1f1;
    --muted: #a8a8b3;
    --line: #34343f;
    --accent: #8f93e8;
    --accent-strong: #b0b3f0;
    --accent-soft: #272a4d;
    --on-accent: #10123a;
    --brand-red: #ff5c5c;
    --corp-bar: #45489a;
    --corp-dark: #0f0f0f;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .5);
    --warn: #f3b453;
    --warn-soft: #33270f;
    --danger: #f28b82;
    --danger-soft: #3a1a18;
    --ok: #51cf66;
    color-scheme: dark;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: var(--accent); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { width: 100%; max-width: 1000px; margin-inline: auto; padding-inline: var(--gutter); }
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 99;
  padding: .6rem 1rem; background: var(--text); color: var(--bg);
  border-radius: 8px; font-weight: 600; text-decoration: none;
}
.skip-link:focus { top: 1rem; }
.mono { font-family: var(--mono); font-size: .92em; word-break: break-all; }

/* =============================================================
   4. Header / footer
   ============================================================= */
.site-header { border-bottom: 1px solid var(--line); background: var(--surface); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; }
.logo { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); text-decoration: none; font-weight: 800; font-size: 1.15rem; }
.logo span { color: var(--text); letter-spacing: -0.02em; }
.logo svg, .btn svg { flex: none; }
@media (max-width: 380px) { .header-note { display: none; } }
.header-note { color: var(--muted); font-size: .82rem; font-weight: 500; }

.site-footer { margin-top: 56px; border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; padding-block: 24px; }
.footer-inner nav { display: flex; gap: 18px; }
.footer-inner a { color: var(--muted); }

.tool-nav { display: flex; gap: 4px; }
.tool-nav a { padding: 6px 10px; border-radius: 8px; font-weight: 700; font-size: .88rem; color: var(--muted); text-decoration: none; }
.tool-nav a:hover { color: var(--text); background: var(--surface-2); }
.tool-nav a.is-current { color: var(--accent); background: var(--accent-soft); }

/* =============================================================
   5. Hero + tool card
   ============================================================= */
.hero { padding-top: 16px; }
.hero h1 { font-size: clamp(1.5rem, 1.1rem + 2vw, 2.35rem); font-weight: 800; }
.subtitle { color: var(--muted); margin-top: 4px; max-width: 66ch; font-size: .93rem; line-height: 1.5; }

.tool-card {
  margin-top: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  display: grid;
  gap: 14px;
}
.noscript { padding: 12px 14px; border-radius: var(--radius-sm); background: var(--warn-soft); color: var(--warn); font-weight: 600; }

.dropzone {
  position: relative; display: grid; justify-items: center; gap: 4px; text-align: center;
  padding: 26px 14px; border: 2px dashed var(--line); border-radius: 16px;
  background: var(--surface-2); cursor: pointer; color: var(--muted);
  transition: border-color .15s, background .15s;
}
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone svg { color: var(--accent); }
.dropzone strong { color: var(--text); font-size: 1.1rem; }
.dropzone span { font-size: .88rem; }
.dropzone small { font-size: .78rem; }
.dropzone:hover, .dropzone.is-dragover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.tool-card[data-state="has-files"] .dropzone { padding: 14px; }
.tool-card[data-state="has-files"] .dropzone svg, .tool-card[data-state="has-files"] .dropzone small { display: none; }

.options { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.option { display: grid; gap: 5px; min-width: 0; }
.option.range { flex: 1 1 180px; }
.option-label { font-size: .82rem; font-weight: 700; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; }
.option-label output { font-family: var(--mono); color: var(--accent); }
.option select, .input-suffix input {
  padding: 9px 10px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600;
}
.option input[type="range"] { width: 100%; accent-color: var(--accent); height: 28px; }
.input-suffix { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--muted); }
.input-suffix input { width: 110px; }
.color-option input { width: 56px; height: 44px; padding: 3px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.segmented { display: inline-flex; padding: 3px; gap: 3px; background: var(--surface-2); border-radius: 11px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; padding: 8px 14px; border-radius: 8px; font-weight: 700; font-size: .9rem; color: var(--muted); }
.segmented input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.segmented label.is-disabled { opacity: .45; cursor: not-allowed; }
.note { font-size: .82rem; color: var(--muted); }
.note:empty { display: none; }

/* Results */
.results { display: grid; gap: 10px; }
.summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border-radius: 14px; background: var(--accent-soft); }
.summary-text { font-weight: 700; font-size: .95rem; }
.summary-text .saved { color: var(--accent); }
.summary-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.file-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.file {
  display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.file img, .file .thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.file-info { min-width: 0; display: grid; gap: 2px; }
.file-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-meta { font-size: .8rem; color: var(--muted); font-family: var(--mono); overflow-wrap: anywhere; }
.file-meta .saved { color: var(--accent); font-weight: 700; }
.file-meta .worse { color: var(--warn); font-weight: 700; }
.file-msg { font-size: .8rem; color: var(--muted); }
.file.is-error .file-msg { color: var(--danger); font-weight: 600; }
.bar { height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.file:not(.is-working) .bar { display: none; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); font-weight: 700; font-size: .95rem; text-decoration: none; color: var(--text);
  transition: transform .15s var(--ease-out), background .15s, border-color .15s, opacity .15s;
}
.btn:hover:not(:disabled) { border-color: var(--accent); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-ghost { background: transparent; }
.btn-small { min-height: 38px; padding: 7px 12px; font-size: .86rem; }

/* Under the tool */
.privacy-badge { margin-top: 14px; display: flex; gap: 8px; align-items: flex-start; font-size: .9rem; }
.privacy-badge svg { color: var(--accent); flex: none; margin-top: 2px; }
.limits { margin-top: 4px; font-size: .82rem; color: var(--muted); padding-left: 26px; }

/* =============================================================
   6. Content sections
   ============================================================= */
.ad-slot { margin-top: 32px; min-height: 100px; }
.ad-slot ins.adsbygoogle { width: 100%; }
.ad-incontent { min-height: 250px; }

.seo, .faq { margin-top: 48px; }
.seo h2, .faq h2 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.75rem); font-weight: 800; }
.prose { max-width: 760px; }
.prose p, .prose ul { margin-top: 12px; }
.prose h3 { margin-top: 26px; font-size: 1.15rem; }
.prose ul { padding-left: 1.2em; display: grid; gap: 6px; }

.faq { max-width: 760px; }
.faq h2 { margin-bottom: 14px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 14px 28px 14px 0; position: relative; font-weight: 700; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 4px; top: 12px; font-size: 1.3rem; color: var(--accent); transition: transform .2s var(--ease-out); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding-bottom: 14px; color: var(--muted); }

.credits { padding-bottom: 20px; font-size: .78rem; }
.credits a { color: var(--muted); }

/* Legal pages */
.legal { padding-top: 32px; }
.legal h1 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
.legal h2 { margin-top: 28px; font-size: 1.2rem; }
.legal .todo { background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 6px; font-weight: 600; }


/* =============================================================
   PDF tools
   ============================================================= */
.workspace { display: grid; gap: 14px; }
.doc-head { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: .9rem; }
.doc-head strong { font-size: 1rem; overflow-wrap: anywhere; }
.doc-head span { color: var(--muted); font-family: var(--mono); font-size: .82rem; }

.doc-list { list-style: none; padding: 0; display: grid; gap: 8px; }
.doc {
  display: grid; grid-template-columns: 22px 54px minmax(0, 1fr); gap: 6px 10px; align-items: center;
  padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.doc.is-dragging { opacity: .5; }
.doc.is-over { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.doc-order { font-family: var(--mono); font-weight: 700; color: var(--muted); text-align: center; cursor: grab; }
.doc-thumb, .page-thumb canvas, .page-thumb .ph { background: #fff; border: 1px solid var(--line); border-radius: 4px; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.doc-thumb { width: 54px; height: 70px; object-fit: contain; display: grid; place-items: center; font-size: .7rem; color: var(--muted); }
.doc-info { min-width: 0; display: grid; gap: 2px; }
.doc-name { font-weight: 700; font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-meta { font-size: .8rem; color: var(--muted); font-family: var(--mono); }
.doc.is-error .doc-meta { color: var(--danger); font-family: var(--sans); font-weight: 600; }
.doc-tools { display: flex; gap: 4px; grid-column: 3; }
.doc-order, .doc-thumb { grid-row: span 2; }
.doc-meta { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (min-width: 540px) {
  .doc { grid-template-columns: 26px 54px minmax(0, 1fr) auto; }
  .doc-tools { grid-column: auto; }
  .doc-order, .doc-thumb { grid-row: auto; }
}
.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 1rem; font-weight: 700;
}
.icon-btn:hover:not(:disabled) { border-color: var(--accent); }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }

.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; max-height: 460px; overflow: auto; padding: 4px; }
.page-thumb { position: relative; display: grid; justify-items: center; gap: 4px; padding: 6px; border-radius: 10px; border: 2px solid transparent; cursor: pointer; background: var(--surface-2); }
.page-thumb canvas, .page-thumb .ph { width: 100%; height: auto; aspect-ratio: 0.75; object-fit: contain; }
.page-thumb .ph { display: block; }
.page-thumb small { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.page-thumb input { position: absolute; top: 8px; left: 8px; width: 18px; height: 18px; accent-color: var(--accent); }
.page-thumb.is-selected { border-color: var(--accent); background: var(--accent-soft); }
.tool-card[data-split-mode="ranges"] .page-thumb, .tool-card[data-split-mode="each"] .page-thumb { cursor: default; }
.tool-card[data-split-mode="ranges"] .page-thumb input, .tool-card[data-split-mode="each"] .page-thumb input { display: none; }
.tool-card[data-split-mode="ranges"] .page-thumb.is-selected, .tool-card[data-split-mode="each"] .page-thumb.is-selected { border-color: transparent; background: var(--surface-2); }

.hint { font-size: .86rem; color: var(--muted); }
.link-btn { color: var(--accent); font-weight: 700; text-decoration: underline; text-underline-offset: 2px; }
.field { display: grid; gap: 5px; }
.field > span { font-size: .82rem; font-weight: 700; color: var(--muted); }
.field input { padding: 10px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-family: var(--mono); }
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--danger); }

.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.btn-big { min-height: 52px; padding-inline: 26px; font-size: 1.05rem; }
.actions-note { font-size: .86rem; color: var(--muted); }

.text-warning { display: grid; gap: 8px; padding: 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-size: .9rem; }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

.progress { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.status { font-size: .88rem; color: var(--muted); min-height: 1.3em; }
.status.is-error { color: var(--danger); font-weight: 700; }
.result { display: grid; gap: 10px; padding: 14px; border-radius: 14px; background: var(--accent-soft); }
.result-text { font-weight: 700; }
.result-text .saved { color: var(--ok); }
.result-text .worse { color: var(--warn); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.more { margin-top: 48px; }
.more h2 { font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); font-weight: 800; }
.more-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.more-card { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .15s; }
.more-card:hover { border-color: var(--accent); }
.more-card strong { color: var(--accent); }
.more-card span { font-size: .9rem; color: var(--muted); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 720px) {
  .tool-card { padding: 22px; gap: 18px; }
  .dropzone { padding: 36px 20px; }
}

@media (min-width: 960px) {
  .hero { padding-top: 32px; }
}

/* =============================================================
   9. Reduced motion (only intrusive effects)
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* =============================================================
   10. Capa corporativa — mismos colores y cabecera que tecnohalecatez.com.co
   ============================================================= */
.site-header { background: var(--corp-bar); border-bottom: 0; color: #fff; }
.header-inner { flex-wrap: wrap; gap: 6px 14px; padding-block: 8px; min-height: 60px; }
.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.corp { display: block; flex: none; line-height: 0; }
.corp img { height: 26px; width: auto; }
.brand-sep { width: 1px; height: 24px; background: rgba(255, 255, 255, .35); flex: none; }
.site-header .logo { color: var(--brand-red); }
.site-header .logo span { color: #fff; }
.site-header .header-note { color: rgba(255, 255, 255, .8); }
.site-header a.header-note:hover { color: #fff; }
.site-header .tool-nav a { color: rgba(255, 255, 255, .82); }
.site-header .tool-nav a:hover, .site-header .tool-nav a.is-current { color: #fff; background: rgba(255, 255, 255, .15); }
.site-footer { background: var(--corp-dark); color: #b9b9b9; border-top: 0; }
.site-footer a { color: #e6e6e6; }
.site-footer .credits a { color: #b9b9b9; }
@media (max-width: 539px) {
  .corp img { height: 20px; }
  .brand-group { gap: 8px; }
  .site-header .logo span { font-size: 1rem; }
  .site-header .header-note { display: none; }
}

/* Migas de pan y tarjetas de herramientas (la página /herramientas/) */
.breadcrumb { font-size: .82rem; color: var(--muted); margin-bottom: 6px; }
.breadcrumb a { color: var(--accent); text-decoration: none; font-weight: 600; }
.breadcrumb a:hover { text-decoration: underline; }
.suite-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.suite-card { display: grid; grid-template-columns: 36px 1fr; gap: 4px 12px; align-items: start; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.suite-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.suite-card img { width: 36px; height: 36px; grid-row: span 2; }
.suite-card strong { color: var(--accent); font-size: .98rem; }
.suite-card span { font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* El menú de la categoría es una sola fila: si sus enlaces no caben (celular, tableta), se desliza en vez de ensanchar la página */
.site-header .tool-nav { min-width: 0; flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.site-header .tool-nav::-webkit-scrollbar { display: none; }
.site-header .tool-nav a { flex: none; white-space: nowrap; }

/* Celulares muy estrechos (320-379 px): logo y nombre algo más pequeños para que quepan */
@media (max-width: 379px) {
  .brand-group { gap: 6px; }
  .corp img { height: 16px; }
  .site-header .logo { gap: 6px; }
  .site-header .logo svg { width: 24px; height: 24px; flex: none; }
  .site-header .logo span { font-size: .92rem; }
}

/* =============================================================
   Firmar PDF y escanear documento
   ============================================================= */
.step { display: grid; gap: 10px; }
.step-title { font-size: .82rem; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.row .grow { flex: 1 1 200px; min-width: 0; }
.sig-pad {
  width: 100%; height: 170px; display: block; touch-action: none; cursor: crosshair;
  border: 2px dashed var(--line); border-radius: 12px; background: #fff;
}
.sig-input { width: 100%; min-height: 50px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #1a1a6e; font: 2rem "Dancing Script", "Segoe Script", cursive; }
.sig-preview { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: var(--accent-soft); font-size: .86rem; font-weight: 700; }
.sig-preview img { max-height: 46px; max-width: 220px; width: auto; background: #fff; border-radius: 6px; padding: 2px 6px; }
.swatches { display: inline-flex; gap: 6px; }
.swatch-btn { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); }
.swatch-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--accent); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.sign-stage { display: grid; justify-items: center; gap: 10px; }
.sign-page { position: relative; width: 100%; max-width: 900px; background: #fff; box-shadow: var(--shadow); border-radius: 4px; overflow: hidden; touch-action: pan-y; }
.sign-page canvas { display: block; width: 100%; height: 100%; }
.stamp { position: absolute; border: 2px dashed var(--accent); border-radius: 4px; cursor: move; touch-action: none; background: rgba(69, 72, 154, .06); }
.stamp.is-active { border-style: solid; }
.stamp img { width: 100%; height: 100%; object-fit: contain; pointer-events: none; user-select: none; }
.stamp-del { position: absolute; top: -12px; right: -12px; width: 24px; height: 24px; border-radius: 50%; background: var(--danger); color: #fff; font-weight: 800; line-height: 1; }
.stamp-grip { position: absolute; right: -8px; bottom: -8px; width: 18px; height: 18px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; }
.page-nav { display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: .9rem; }

.scan-editor { position: relative; width: 100%; max-width: 760px; margin-inline: auto; touch-action: none; }
.scan-editor canvas { width: 100%; height: auto; display: block; border-radius: 10px; }
.scan-editor svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.corner-area { fill: rgba(69, 72, 154, .18); stroke: #ff5c5c; vector-effect: non-scaling-stroke; }
.corner-area { stroke-width: 3; }
.corner { fill: #fff; stroke: #d80c0c; stroke-width: 4; vector-effect: non-scaling-stroke; cursor: grab; }
.scan-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.scan-page { display: grid; gap: 4px; justify-items: center; padding: 6px; border-radius: 10px; background: var(--surface-2); font-size: .8rem; font-weight: 700; }
.scan-page img { width: 100%; aspect-ratio: .72; object-fit: contain; background: #fff; border-radius: 4px; }
.scan-tools { display: flex; gap: 4px; }
.scan-tools .icon-btn { min-width: 32px; min-height: 32px; }
.capture-row { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
@media (max-width: 539px) { .capture-row { grid-template-columns: 1fr; } }

/* =============================================================
   JPG a PDF, PDF a JPG, rotar y ordenar, numerar y marca de agua
   ============================================================= */
.org-grid { list-style: none; padding: 4px; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; max-height: 560px; overflow: auto; }
.org-page { display: grid; gap: 6px; justify-items: center; min-width: 0; padding: 8px 6px; border-radius: 10px; background: var(--surface-2); border: 2px solid transparent; cursor: grab; }
.org-page.is-dragging { opacity: .5; }
.org-page.is-over { border-color: var(--accent); }
.org-page small { max-width: 100%; font-size: .75rem; font-weight: 600; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.org-page.is-error, .org-page.is-error small { cursor: default; color: var(--danger); }
.org-page.is-removed .org-thumb { opacity: .25; }
.org-page.is-removed small { color: var(--danger); }
/* La caja es siempre cuadrada, sea cual sea la forma de la página: la página se ajusta dentro */
.org-thumb { position: relative; width: 100%; aspect-ratio: 1; display: grid; place-items: center; color: var(--muted); }
.org-thumb canvas, .org-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .3)); transition: transform .2s var(--ease-out); }
.org-thumb .ph { position: absolute; inset: 4% 15%; background: #fff; border: 1px solid var(--line); border-radius: 3px; transition: transform .2s var(--ease-out); }
.org-tools { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; }
.org-tools .icon-btn { width: 30px; height: 30px; font-size: .9rem; }

.mark-layout { display: grid; gap: 16px; }
.mark-options { display: grid; gap: 12px; align-content: start; }
.mark-options .option select, .mark-options .input-suffix, .mark-options .input-suffix input, .mark-options .text-input { width: 100%; }
.text-input { padding: 9px 12px; min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; }
.text-input:focus, .mark-options select:focus, .mark-options .input-suffix input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.mark-page { max-width: 640px; }
.mark-overlay { position: absolute; inset: 0; pointer-events: none; }
@media (min-width: 820px) { .mark-layout { grid-template-columns: 290px minmax(0, 1fr); align-items: start; } }
/* Celulares estrechos: las opciones largas pasan a una segunda línea en vez de desbordar */
.options .option { max-width: 100%; }
.options .segmented { flex-wrap: wrap; }

/* Botones «¿Te sirvió? Compártela» bajo cada herramienta */
.share { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.share-title { font-weight: 700; font-size: .95rem; }
.share-links { display: flex; flex-wrap: wrap; gap: 8px; }
.share-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--text); font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s; }
.share-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
.share-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-btn::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--dot, var(--accent)); flex: none; }
.share-btn[hidden] { display: none; }
.share-wa { --dot: #25d366; }
.share-fb { --dot: #1877f2; }
.share-x { --dot: var(--text); }
.share-tg { --dot: #29a9eb; }
.share-mail { --dot: var(--brand-red); }
.share-native { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.share-native::before { display: none; }
.share-native:hover { background: var(--accent-strong); border-color: var(--accent-strong); }

/* Captura «Así se ve» de la herramienta en uso, al inicio del contenido */
.tool-shot { margin: 16px 0 24px; }
.tool-shot img { display: block; width: 100%; max-width: 760px; height: auto; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); background: var(--surface); }
.tool-shot figcaption { margin-top: 8px; max-width: 760px; font-size: .86rem; color: var(--muted); line-height: 1.45; }

/* Bloque «Aprende más en el blog» (2 artículos relacionados con la herramienta) */
.learn { margin-top: 48px; }
.learn h2 { font-size: clamp(1.2rem, 1rem + 1vw, 1.5rem); font-weight: 800; }
.learn-grid { margin-top: 14px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.learn-card { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 14px; background: var(--surface); text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.learn-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.learn-kicker { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.learn-card strong { color: var(--accent); font-size: 1.02rem; line-height: 1.35; }
.learn-card span:last-child { font-size: .88rem; color: var(--muted); line-height: 1.5; }
