/* =============================================================
   Utiliec PDF — hoja de estilos única
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Secciones · 7. Herramienta · 8. Anuncios
   9. Responsive · 10. Reduced motion
   ============================================================= */

/* 1. Tokens ---------------------------------------------------- */
:root {
  --bg:        #fbfaf7;
  --bg-deep:   #f2efe9;
  --surface:   #ffffff;
  --surface-2: #f7f6f3;
  --ink:       #16181f;
  --muted:     #606779;
  --line:      #e4e1da;
  --line-soft: #efece6;

  --accent:      #5250d4;
  --accent-ink:  #3a38a8;
  --accent-soft: #ecebfb;
  --warm:        #ff7a4d;
  --warm-soft:   #fff0e9;
  --good:        #1a8f5f;
  --good-soft:   #e6f5ee;
  --bad:         #c0392b;
  --bad-soft:    #fdecea;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Manrope", var(--sans);

  --r-sm: 10px;
  --r:    16px;
  --r-lg: 24px;

  --shadow-sm: 0 1px 2px rgba(22, 24, 31, .05), 0 1px 3px rgba(22, 24, 31, .04);
  --shadow:    0 2px 4px rgba(22, 24, 31, .04), 0 12px 28px -12px rgba(22, 24, 31, .16);
  --shadow-lg: 0 4px 8px rgba(22, 24, 31, .05), 0 28px 60px -24px rgba(22, 24, 31, .28);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1120px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:        #101218;
    --bg-deep:   #0b0d12;
    --surface:   #191c25;
    --surface-2: #1f232e;
    --ink:       #eef0f6;
    --muted:     #9aa2b5;
    --line:      #2b3040;
    --line-soft: #232735;

    --accent:      #8b89ff;
    --accent-ink:  #a8a7ff;
    --accent-soft: #23234a;
    --warm:        #ff9268;
    --warm-soft:   #3a251c;
    --good:        #4ecb96;
    --good-soft:   #16332a;
    --bad:         #ff8377;
    --bad-soft:    #3a1f1c;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow:    0 2px 4px rgba(0, 0, 0, .3), 0 12px 28px -12px rgba(0, 0, 0, .7);
    --shadow-lg: 0 4px 8px rgba(0, 0, 0, .35), 0 28px 60px -24px rgba(0, 0, 0, .8);
  }
}

/* 2. Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); text-wrap: balance; line-height: 1.12; letter-spacing: -0.02em; font-weight: 800; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

/* 3. Utilidades ------------------------------------------------ */
.wrap { width: min(100% - var(--gutter) * 2, var(--maxw)); margin-inline: auto; }
.wrap-narrow { width: min(100% - var(--gutter) * 2, 760px); margin-inline: auto; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--accent); color: #fff;
  border-radius: var(--r-sm); font-weight: 600;
}
.skip-link:focus { top: 1rem; }
.hidden { display: none !important; }
[hidden] { display: none !important; }   /* gana a los display de los componentes */

/* 4. Tipografía ------------------------------------------------ */
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.3vw, 2rem); }
h3 { font-size: clamp(1.08rem, 1rem + .4vw, 1.3rem); }
.lead { font-size: clamp(1rem, .96rem + .3vw, 1.18rem); color: var(--muted); }
.prose p { margin-bottom: 1.05rem; }
.prose h2 { margin: 2.4rem 0 .9rem; }
.prose h3 { margin: 1.8rem 0 .6rem; }
.prose ul { margin: 0 0 1.05rem 1.15rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }

/* 5. Componentes ----------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  padding: .82rem 1.4rem; border-radius: 999px; font-weight: 700;
  background: var(--accent); color: #fff; box-shadow: var(--shadow-sm);
  transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), background .2s;
  text-align: center;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-lg { padding: 1.05rem 2rem; font-size: 1.06rem; }
.btn-ghost { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-ink); }
.btn-soft { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.btn-danger { background: var(--bad-soft); color: var(--bad); box-shadow: none; }
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line-soft);
}
.chip-good { background: var(--good-soft); color: var(--good); border-color: transparent; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field > label { font-size: .86rem; font-weight: 700; color: var(--muted); }
input[type="text"], input[type="number"], input[type="email"], select, textarea {
  padding: .7rem .85rem; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: none; }
input[type="range"] { accent-color: var(--accent); width: 100%; }
input[type="color"] { width: 46px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); }
.hint { font-size: .82rem; color: var(--muted); }

/* 6. Cabecera y pie -------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-soft);
}
.site-header .bar { display: flex; align-items: center; gap: 1rem; height: 64px; }
.logo { display: inline-flex; align-items: center; gap: .55rem; font-family: var(--display); font-weight: 800; font-size: 1.16rem; letter-spacing: -.03em; }
.logo-mark { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(140deg, var(--accent), var(--warm)); display: grid; place-items: center; color: #fff; font-size: .95rem; font-weight: 800; flex: none; }
.nav { margin-left: auto; display: flex; align-items: center; gap: .35rem; }
.nav a { padding: .45rem .8rem; border-radius: 999px; font-size: .92rem; font-weight: 600; color: var(--muted); transition: background .2s, color .2s; }
.nav a:hover, .nav a[aria-current="page"] { background: var(--surface-2); color: var(--ink); }

.site-footer { border-top: 1px solid var(--line-soft); background: var(--bg-deep); padding: 2.6rem 0 2rem; margin-top: 3.5rem; }
.site-footer .cols { display: grid; gap: 1.8rem; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: .7rem; font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .38rem; }
.site-footer a { font-size: .92rem; color: var(--muted); }
.site-footer a:hover { color: var(--accent-ink); }
.site-footer .legal { margin-top: 2rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; }

/* 7. Herramienta ----------------------------------------------- */
.tool-head { padding: 2.2rem 0 1.2rem; text-align: center; }
.tool-head .kicker { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-ink); background: var(--accent-soft); padding: .3rem .8rem; border-radius: 999px; margin-bottom: .9rem; }
.tool-head p.lead { margin: .8rem auto 0; max-width: 60ch; }

.tool-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 1.8rem);
}
.tool-card + .privacy-note { margin-top: 1rem; }

/* Estados: un único data-state gobierna qué se ve */
.tool-card [data-when] { display: none; }
.tool-card[data-state="idle"]    [data-when~="idle"],
.tool-card[data-state="ready"]   [data-when~="ready"],
.tool-card[data-state="engine"]  [data-when~="engine"],
.tool-card[data-state="working"] [data-when~="working"],
.tool-card[data-state="done"]    [data-when~="done"],
.tool-card[data-state="error"]   [data-when~="error"] { display: block; }
.tool-card [data-when~="flex"] { display: none; }
.tool-card[data-state="ready"]   [data-when~="ready"][data-when~="flex"],
.tool-card[data-state="done"]    [data-when~="done"][data-when~="flex"],
.tool-card[data-state="idle"]    [data-when~="idle"][data-when~="flex"] { display: flex; }

.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .7rem; text-align: center;
  min-height: 216px; padding: 2rem 1.2rem;
  border: 2px dashed var(--line); border-radius: var(--r);
  background: var(--surface-2); cursor: pointer;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out), transform .2s var(--ease-out);
}
.dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.is-over { border-color: var(--accent); background: var(--accent-soft); transform: scale(1.01); }
.dropzone .dz-icon { width: 54px; height: 54px; color: var(--accent); }
.dropzone .dz-title { font-family: var(--display); font-weight: 800; font-size: 1.15rem; }
.dropzone .dz-sub { font-size: .9rem; color: var(--muted); }
.dropzone .btn { pointer-events: none; }

.privacy-note {
  display: flex; align-items: flex-start; gap: .6rem;
  font-size: .89rem; color: var(--muted);
  background: var(--good-soft); color: var(--good);
  border-radius: var(--r); padding: .75rem 1rem;
}
.privacy-note strong { color: inherit; }
.limits-note { font-size: .85rem; color: var(--muted); margin-top: .6rem; text-align: center; }

.progress { height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--line-soft); }
.progress > i { display: block; height: 100%; width: 0%; background: linear-gradient(90deg, var(--accent), var(--warm)); transition: width .25s var(--ease-out); }
.status-line { display: flex; align-items: center; gap: .6rem; font-size: .93rem; color: var(--muted); margin-bottom: .7rem; }
.spinner { width: 17px; height: 17px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.result-box { text-align: center; padding: .6rem 0 .2rem; }
.result-box .result-icon { width: 54px; height: 54px; margin: 0 auto .7rem; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; }
.result-box h3 { margin-bottom: .3rem; }
.result-box .result-meta { color: var(--muted); font-size: .93rem; margin-bottom: 1.1rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

.alert { border-radius: var(--r); padding: .85rem 1rem; font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert-warn { background: var(--warm-soft); color: #9c4420; }
.alert-error { background: var(--bad-soft); color: var(--bad); }
@media (prefers-color-scheme: dark) { .alert-warn { color: var(--warm); } }
.alert-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .8rem; }

.noscript-note { background: var(--warm-soft); color: #9c4420; border-radius: var(--r); padding: 1rem; text-align: center; font-weight: 600; }

/* Lista de archivos */
.file-list { list-style: none; padding: 0; display: grid; gap: .55rem; margin: 1rem 0; }
.file-row {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem .85rem; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2);
}
.file-row .fr-badge { width: 34px; height: 34px; flex: none; border-radius: 8px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-size: .68rem; font-weight: 800; }
.file-row .fr-name { flex: 1; min-width: 0; font-weight: 600; font-size: .93rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row .fr-meta { font-size: .82rem; color: var(--muted); flex: none; }
.file-row .fr-actions { display: flex; gap: .2rem; flex: none; }
.icon-btn { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s; }
.icon-btn:hover { background: var(--surface); color: var(--accent-ink); }
.icon-btn[disabled] { opacity: .3; cursor: not-allowed; }
.file-row.is-dragging { opacity: .45; }
.file-row[draggable="true"] { cursor: grab; }

/* Rejilla de páginas (organizar / dividir) */
.page-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: .8rem; margin: 1rem 0; }
.page-thumb {
  position: relative; border: 2px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); overflow: hidden; padding: 0;
  aspect-ratio: 3 / 4; display: grid; place-items: center;
  transition: border-color .2s, transform .2s var(--ease-out);
}
.page-thumb canvas, .page-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; transition: transform .3s var(--ease-out); }
.page-thumb .pt-num { position: absolute; left: 5px; bottom: 5px; background: rgba(0,0,0,.66); color: #fff; font-size: .7rem; font-weight: 700; padding: .1rem .4rem; border-radius: 5px; }
.page-thumb .pt-tools { position: absolute; top: 4px; right: 4px; display: flex; gap: 3px; opacity: 0; transition: opacity .2s; }
.page-thumb:hover .pt-tools, .page-thumb:focus-within .pt-tools { opacity: 1; }
.page-thumb .pt-tools button { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,.94); color: #16181f; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.page-thumb.is-removed { opacity: .32; border-color: var(--bad); border-style: dashed; }
.page-thumb.is-selected { border-color: var(--accent); }
.page-thumb.is-dragging { opacity: .4; }

/* Lienzo de edición / firma */
.stage-wrap { position: relative; margin: 1rem 0; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface-2); overflow: auto; max-height: 68vh; display: grid; place-items: center; padding: .9rem; }
.stage { position: relative; box-shadow: var(--shadow); background: #fff; }
.stage canvas { display: block; }
.overlay-item {
  position: absolute; cursor: move; border: 1px dashed transparent;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.overlay-item:hover, .overlay-item.is-active { border-color: var(--accent); }
.overlay-item img { width: 100%; height: 100%; pointer-events: none; }
.overlay-item .oi-text { white-space: pre; line-height: 1.15; pointer-events: none; }
.overlay-item .oi-handle { position: absolute; right: -7px; bottom: -7px; width: 15px; height: 15px; border-radius: 50%; background: var(--accent); border: 2px solid #fff; cursor: nwse-resize; }
.overlay-item .oi-del { position: absolute; right: -9px; top: -9px; width: 19px; height: 19px; border-radius: 50%; background: var(--bad); color: #fff; font-size: .7rem; display: grid; place-items: center; border: 2px solid #fff; }
.sign-pad { width: 100%; border: 2px dashed var(--line); border-radius: var(--r-sm); background: #fff; touch-action: none; cursor: crosshair; }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: flex-end; padding: .85rem; background: var(--surface-2); border: 1px solid var(--line-soft); border-radius: var(--r); margin-bottom: 1rem; }
.toolbar .field { min-width: 0; }
.toolbar .grow { flex: 1 1 180px; }
.option-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin: 1rem 0; }
.option-row .field { flex: 1 1 180px; }
.radio-cards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); margin: 1rem 0; }
.radio-card { display: flex; gap: .6rem; align-items: flex-start; padding: .85rem; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface-2); cursor: pointer; transition: border-color .2s, background .2s; }
.radio-card:hover { border-color: var(--accent); }
.radio-card input { margin-top: .25rem; accent-color: var(--accent); flex: none; }
.radio-card b { display: block; font-size: .95rem; }
.radio-card span { font-size: .84rem; color: var(--muted); }

.compare { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin: 1rem 0; }
.compare figure { border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface-2); }
.compare img { width: 100%; aspect-ratio: 4/3; object-fit: contain; background: repeating-conic-gradient(#e9e9e9 0% 25%, #fff 0% 50%) 50%/16px 16px; }
.compare figcaption { padding: .5rem .7rem; font-size: .84rem; color: var(--muted); }
.savings { font-family: var(--display); font-weight: 800; font-size: clamp(1.6rem, 1.2rem + 1.8vw, 2.4rem); color: var(--good); }

.out-text { width: 100%; min-height: 240px; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: .9rem; line-height: 1.55; resize: vertical; }

/* 8. Anuncios (huecos vacíos, el dueño pega su código) ---------- */
.ad-slot {
  margin: 2.2rem auto; max-width: 970px;
  border: 1px dashed var(--line); border-radius: var(--r);
  background: var(--surface-2);
  display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: .72rem; letter-spacing: .14em; text-transform: uppercase;
}
.ad-leaderboard { min-height: 110px; }
.ad-incontent { min-height: 260px; max-width: 760px; }
.ad-slot:empty::after { content: "Publicidad"; }
.ad-slot > * { width: 100%; }

/* 9. Secciones de contenido ------------------------------------ */
.section { padding: 2.4rem 0; }
.section-title { text-align: center; margin-bottom: 1.6rem; }
.steps { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); counter-reset: step; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 1.2rem; }
.step .step-n { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); display: grid; place-items: center; font-weight: 800; margin-bottom: .7rem; font-size: .95rem; }
.step h3 { font-size: 1.04rem; margin-bottom: .3rem; }
.step p { font-size: .92rem; color: var(--muted); }

.faq { display: grid; gap: .6rem; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.faq summary { padding: 1rem 1.2rem; font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); line-height: 1; flex: none; }
.faq details[open] summary::after { content: "−"; }
.faq details > div { padding: 0 1.2rem 1.1rem; color: var(--muted); font-size: .95rem; }

.tool-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); }
.tool-tile {
  display: flex; gap: .8rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 1rem; transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s;
}
.tool-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent); }
.tool-tile .tt-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); }
.tool-tile.is-warm .tt-icon { background: var(--warm-soft); color: var(--warm); }
.tool-tile b { display: block; font-family: var(--display); font-size: .99rem; letter-spacing: -.01em; }
.tool-tile span { font-size: .85rem; color: var(--muted); line-height: 1.45; }

.hero { padding: clamp(2.4rem, 6vw, 4.2rem) 0 1.6rem; text-align: center; }
.hero h1 { margin-bottom: .9rem; }
.hero .lead { max-width: 62ch; margin: 0 auto 1.6rem; }
.hero-badges { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; }

/* 10. Responsive ----------------------------------------------- */
@media (min-width: 720px) {
  .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr 1fr; }
}
@media (max-width: 719px) {
  .nav a.nav-extra { display: none; }
  .site-header .bar { height: 58px; }
}

/* 11. Reduced motion (solo lo intrusivo) ----------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .spinner { animation-duration: 1.6s; }
}

/* 12. Extras de maquetación de herramientas -------------------- */
.actions-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }
.actions-row .spacer { flex: 1 1 auto; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.panel-info { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; font-size: .92rem; color: var(--muted); margin-bottom: .9rem; }
.panel-info b { color: var(--ink); }
.stat-row { display: flex; flex-wrap: wrap; gap: 1.4rem; justify-content: center; margin: .6rem 0 1.1rem; }
.stat { text-align: center; }
.stat b { display: block; font-family: var(--display); font-size: 1.25rem; }
.stat span { font-size: .8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; padding: 3px; gap: 2px; }
.seg button { padding: .42rem .95rem; border-radius: 999px; font-size: .88rem; font-weight: 700; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--accent-ink); box-shadow: var(--shadow-sm); }

/* 13. Aviso de cookies y publicidad ---------------------------- */
.linklike { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.linklike:hover { color: var(--accent-ink); text-decoration: underline; }

.ad-slot:empty { display: none; }
.ad-slot ins[data-ad-status="unfilled"] { display: none !important; }

.cookie-bar {
  position: fixed; inset: auto 0 0 0; z-index: 90;
  background: var(--surface); border-top: 1px solid var(--line);
  box-shadow: 0 -10px 30px rgba(15, 17, 26, .10);
  padding: 1rem clamp(1rem, 4vw, 2rem);
  animation: cookie-in .25s ease-out;
}
@keyframes cookie-in { from { transform: translateY(100%); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .cookie-bar { animation: none; } }
.cookie-inner {
  max-width: 1080px; margin: 0 auto;
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between;
}
.cookie-text { flex: 1 1 380px; font-size: .9rem; line-height: 1.55; color: var(--muted); margin: 0; }
.cookie-text strong { color: var(--ink); }
.cookie-text a { color: var(--accent-ink); }
.cookie-actions { display: flex; gap: .6rem; flex: none; }
@media (max-width: 560px) {
  .cookie-actions { width: 100%; }
  .cookie-actions .btn { flex: 1 1 0; justify-content: center; }
}

/* 14. Edición del texto nativo del PDF ------------------------- */
.seg-row { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; margin-bottom: .9rem; }
.seg-row .hint { flex: 1 1 260px; }

.alert-info {
  display: block; background: var(--accent-soft); color: var(--accent-ink);
  border: 1px solid transparent; border-radius: var(--r); padding: .7rem .9rem;
  font-size: .9rem; line-height: 1.5; margin-bottom: .9rem;
}
.alert-info a { color: inherit; text-decoration: underline; }

.text-layer { position: absolute; inset: 0; z-index: 2; }
.stage.mode-add .text-layer { pointer-events: none; opacity: .45; }

.tl-line {
  position: absolute;
  white-space: pre;
  padding: 0 1px;
  border-radius: 3px;
  cursor: text;
  outline: none;
  transform-origin: left center;
  background: transparent;
  /* el texto original del canvas se ve debajo: la caja solo lo iguala */
  color: transparent;
  caret-color: var(--tl-ink, var(--ink));
}
.stage.mode-text .tl-line:hover { box-shadow: inset 0 0 0 1px var(--accent); background: rgba(82, 80, 212, .07); }
.tl-line:focus { box-shadow: inset 0 0 0 2px var(--accent); background: var(--surface); color: var(--tl-ink, var(--ink)); }
.tl-line.is-edited { color: var(--tl-ink, var(--ink)); box-shadow: inset 0 0 0 1px rgba(82, 80, 212, .45); }
.tl-line.is-edited::after {
  content: ""; position: absolute; right: -5px; top: -5px;
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent);
}
.result-warn { font-size: .88rem; color: var(--warm); max-width: 52ch; margin: .5rem auto 0; line-height: 1.5; }
