/* =============================================================
   UtilsDock — hoja de estilos única
   1. Tokens · 2. Reset · 3. Utilidades · 4. Tipografía
   5. Componentes · 6. Secciones · 7. Efectos · 8. Responsive
   9. Reduced-motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --ink: #0e1524;
  --ink-soft: #46546a;
  --ink-faint: #5a677c;
  --line: #e1e6f0;
  --line-strong: #c9d2e0;

  --accent: #0f9e8e;
  --accent-ink: #0b7a6e;
  --accent-soft: #e5f6f3;
  --accent-contrast: #ffffff;
  --btn-bg: #0b7a6e;
  --btn-bg-hover: #086055;
  --grad-btn: linear-gradient(180deg, #0d8375 0%, #0b7a6e 55%, #096a5f 100%);
  --grad-btn-hover: linear-gradient(180deg, #0b7a6e 0%, #096a5f 55%, #075b52 100%);
  --btn-glow: rgba(11, 122, 110, .5);

  /* Segundo tono de la marca (índigo) y degradado firma */
  --accent-2: #6366f1;
  --accent-2-ink: #4f46e5;
  --accent-2-soft: #eceefe;
  --grad-brand: linear-gradient(135deg, #14b8a6 0%, #6366f1 100%);
  --grad-text: linear-gradient(100deg, #0a7d70 0%, #2f5fd0 55%, #5b4fe0 100%);
  --glass: color-mix(in srgb, #ffffff 72%, transparent);

  --warn: #995a0b;
  --warn-soft: #fdf3e3;
  --danger: #c0392f;
  --danger-soft: #fdecea;
  --ok: #17794a;
  --ok-soft: #e6f5ed;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: var(--sans);
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --maxw: 1180px;
  --maxw-narrow: 760px;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -10px rgba(15, 23, 42, .14);
  --shadow-lg: 0 2px 6px rgba(15, 23, 42, .05), 0 24px 56px -16px rgba(15, 23, 42, .22);

  /* Color de categoría: cada área (PDF, imagen, texto…) tiene su propio tono */
  --cat-h: 170;
  --cbs: 78%; --cbl: 93%; --cfs: 62%; --cfl: 30%;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.7, 0, 0.84, 0);
  --ease-soft: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Tema: claro por defecto; oscuro si el sistema lo pide, y ambos se pueden forzar con data-theme (botón del encabezado, guardado en «ud_theme»). */
:root { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #090e1a;
    --surface: #0f1729;
    --surface-2: #16203a;
    --ink: #e9eef8;
    --ink-soft: #a7b3c7;
    --ink-faint: #8d9ab0;
    --line: #1d2a45;
    --line-strong: #2c3d5f;

    --accent: #2dd4bf;
    --accent-ink: #5eead4;
    --accent-soft: #10312f;
    --accent-contrast: #06231f;
    --btn-bg: #2dd4bf;
    --btn-bg-hover: #5eead4;
    --grad-btn: linear-gradient(180deg, #46e3cf 0%, #2dd4bf 55%, #1fbfab 100%);
    --grad-btn-hover: linear-gradient(180deg, #6aeedb 0%, #4fe0cc 55%, #2dd4bf 100%);
    --btn-glow: rgba(45, 212, 191, .4);
    --accent-2: #818cf8;
    --accent-2-ink: #a5b4fc;
    --accent-2-soft: #1c2145;
    --grad-text: linear-gradient(100deg, #5eead4 0%, #7dd3fc 50%, #a5b4fc 100%);
    --glass: color-mix(in srgb, #0f1729 70%, transparent);

    --warn: #eab464;
    --warn-soft: #2e2413;
    --danger: #f28b82;
    --danger-soft: #331e1c;
    --ok: #6ee7a8;
    --ok-soft: #102c1f;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 14px 34px -12px rgba(0, 0, 0, .55);
    --shadow-lg: 0 6px 14px rgba(0, 0, 0, .4), 0 28px 60px -18px rgba(0, 0, 0, .65);

    --cbs: 42%; --cbl: 20%; --cfs: 80%; --cfl: 76%;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #090e1a;
  --surface: #0f1729;
  --surface-2: #16203a;
  --ink: #e9eef8;
  --ink-soft: #a7b3c7;
  --ink-faint: #8d9ab0;
  --line: #1d2a45;
  --line-strong: #2c3d5f;

  --accent: #2dd4bf;
  --accent-ink: #5eead4;
  --accent-soft: #10312f;
  --accent-contrast: #06231f;
  --btn-bg: #2dd4bf;
  --btn-bg-hover: #5eead4;
  --grad-btn: linear-gradient(180deg, #46e3cf 0%, #2dd4bf 55%, #1fbfab 100%);
  --grad-btn-hover: linear-gradient(180deg, #6aeedb 0%, #4fe0cc 55%, #2dd4bf 100%);
  --btn-glow: rgba(45, 212, 191, .4);
  --accent-2: #818cf8;
  --accent-2-ink: #a5b4fc;
  --accent-2-soft: #1c2145;
  --grad-text: linear-gradient(100deg, #5eead4 0%, #7dd3fc 50%, #a5b4fc 100%);
  --glass: color-mix(in srgb, #0f1729 70%, transparent);

  --warn: #eab464;
  --warn-soft: #2e2413;
  --danger: #f28b82;
  --danger-soft: #331e1c;
  --ok: #6ee7a8;
  --ok-soft: #102c1f;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 6px rgba(0, 0, 0, .3), 0 14px 34px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, .4), 0 28px 60px -18px rgba(0, 0, 0, .65);

  --cbs: 42%; --cbl: 20%; --cfs: 80%; --cfl: 76%;
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::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.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* El atributo hidden debe ganar siempre: componentes como .note o .btn
   fijan su propio display y, sin esto, lo anularían. */
[hidden] { display: none !important; }

img, svg, video, canvas { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.12; letter-spacing: -0.024em; font-family: var(--display); font-weight: 650; }
::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 5px;
}

/* =============================================================
   3. Utilidades
   ============================================================= */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: var(--maxw-narrow); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 9999;
  padding: .6rem 1rem; background: var(--ink); color: var(--bg);
  border-radius: 8px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

.stack > * + * { margin-top: 1rem; }
.mono { font-family: var(--mono); font-variant-ligatures: none; }
.nowrap { white-space: nowrap; }

/* =============================================================
   4. Tipografía
   ============================================================= */
h1 { font-size: clamp(1.9rem, 1.35rem + 2.5vw, 3rem); font-weight: 700; letter-spacing: -0.036em; }
h2 { font-size: clamp(1.45rem, 1.15rem + 1.3vw, 2.05rem); font-weight: 700; letter-spacing: -0.03em; }
h3 { font-size: clamp(1.1rem, 1rem + .5vw, 1.32rem); }
h4 { font-size: 1.02rem; }

.lede {
  font-size: clamp(1.02rem, .98rem + .35vw, 1.2rem);
  color: var(--ink-soft);
  max-width: 62ch;
}

.prose { max-width: 70ch; color: var(--ink-soft); overflow-wrap: anywhere; }   /* hashes y cadenas Base64 largas no ensanchan la página */
.prose h2 { color: var(--ink); margin-top: 2.4rem; margin-bottom: .7rem; }
.prose h3 { color: var(--ink); margin-top: 1.7rem; margin-bottom: .45rem; }
.prose p + p { margin-top: .9rem; }
.prose ul, .prose ol { margin: .8rem 0 .8rem 1.15rem; display: grid; gap: .42rem; }
.prose li::marker { color: var(--accent); }
.prose strong { color: var(--ink); font-weight: 600; }
.prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.prose code {
  font-family: var(--mono); font-size: .88em;
  background: var(--surface-2); padding: .12em .38em; border-radius: 5px;
}

/* =============================================================
   5. Componentes
   ============================================================= */

/* --- Botones --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.25rem;
  border-radius: 12px;
  font-weight: 600; font-size: .95rem;
  border: 1px solid transparent;
  transition: transform .35s var(--ease-soft), background .2s var(--ease-out),
              border-color .2s var(--ease-out), box-shadow .35s var(--ease-soft), color .2s, opacity .2s;
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); transition-duration: .1s; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }

.btn--primary {
  background: var(--grad-btn); color: var(--accent-contrast);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), 0 6px 16px -6px var(--btn-glow);
}
.btn--primary:hover { background: var(--grad-btn-hover); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 14px 26px -10px var(--btn-glow); }

.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }

.btn--quiet { background: transparent; color: var(--ink-soft); padding: .45rem .7rem; }
.btn--quiet:hover { color: var(--accent-ink); background: var(--surface-2); }

.btn--big { padding: .95rem 1.7rem; font-size: 1.05rem; border-radius: 12px; }
.btn--block { width: 100%; }

.btn svg { width: 18px; height: 18px; flex: none; }

/* --- Campos de formulario --- */
.field { display: grid; gap: .38rem; align-content: start; }
.field > label, .label {
  font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  letter-spacing: .01em;
}
.input, select.input, textarea.input {
  width: 100%;
  padding: .75rem .9rem;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .04);
  transition: border-color .16s var(--ease-out), box-shadow .16s var(--ease-out);
}
.input:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line-strong)); }
.input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
textarea.input { resize: vertical; min-height: 120px; font-family: var(--mono); font-size: .88rem; line-height: 1.55; }
select.input {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-faint) 50%),
                    linear-gradient(135deg, var(--ink-faint) 50%, transparent 50%);
  background-position: calc(100% - 17px) 50%, calc(100% - 12px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.2rem;
}
.input-row { display: flex; gap: .5rem; align-items: stretch; }
.input-row .input { flex: 1; min-width: 0; }

input[type="range"], input[type="range"].input {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 28px; min-height: 0; padding: 0; border: 0; box-shadow: none;
  background: transparent; cursor: pointer;
}
input[type="range"]::-webkit-slider-runnable-track { height: 6px; border-radius: 99px; background: var(--line-strong); }
input[type="range"]::-moz-range-track { height: 6px; border-radius: 99px; background: var(--line-strong); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; margin-top: -8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--surface);
  box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-strong); cursor: grab;
}
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%; border: 3px solid var(--surface);
  background: var(--accent); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line-strong); cursor: grab;
}
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); }
input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); }
input[type="color"] {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 42px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 10px; cursor: pointer;
}
input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch { border: none; border-radius: 7px; }

/* Interruptores tipo chip */
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .45rem .8rem;
  font-size: .87rem; font-weight: 550;
  background: var(--surface); color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 99px;
  cursor: pointer; user-select: none;
  transition: all .16s var(--ease-out);
}
.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip[data-on="true"], .chip:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent);
  color: var(--accent-ink); font-weight: 650;
}

/* Creador de firma: lienzo sobre fondo de cuadros (deja ver la transparencia) y chips de color con muestra */
.sc-stage {
  border: 1px solid var(--line); border-radius: var(--radius); padding: .9rem;
  display: flex; justify-content: center;
  background-color: var(--surface);
  background-image: linear-gradient(45deg, var(--line) 25%, transparent 25%), linear-gradient(-45deg, var(--line) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--line) 75%), linear-gradient(-45deg, transparent 75%, var(--line) 75%);
  background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0;
}
.sc-stage canvas { max-width: 100%; height: auto; touch-action: none; cursor: crosshair; background: transparent; border-radius: 6px; }
.sc-swatch::before { content: ""; width: 13px; height: 13px; border-radius: 50%; background: var(--sc-swatch); border: 1px solid rgba(0, 0, 0, .15); }

/* --- Tarjeta de herramienta (el corazón) --- */
.tool-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: var(--shadow);
  padding: clamp(1.1rem, 3vw, 2rem);
  display: grid;
  gap: 1.15rem;
}
/* Filo de color de la categoría en el borde superior */
.tool-card::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, hsl(var(--cat-h) 72% 52%), transparent); opacity: .9; pointer-events: none;
}
.tool-card__grid { display: grid; gap: 1rem; align-items: start; }
@media (min-width: 460px) {
  .tool-card__grid--2 { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 720px) {
  .tool-card__grid--3 { grid-template-columns: repeat(3, 1fr); }
  .tool-card__grid--4 { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 460px) and (max-width: 719px) {
  .tool-card__grid--4 { grid-template-columns: 1fr 1fr; }
}

/* Estados: el atributo data-state en .tool-card manda */
[data-when] { display: none; }
.tool-card[data-state="idle"]     [data-when~="idle"],
.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: revert; }

/* Zona de arrastre */
.dropzone {
  display: grid; place-items: center; gap: .5rem;
  padding: clamp(1.6rem, 6vw, 3rem) 1.2rem;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 70%, var(--surface)), var(--surface-2));
  cursor: pointer;
  transition: border-color .2s var(--ease-out), background-color .2s var(--ease-out), box-shadow .3s var(--ease-soft);
}
.dropzone:hover, .dropzone[data-drag="true"] {
  border-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 12%, transparent);
}
.dropzone:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-color: var(--accent); border-radius: var(--radius); }
.dropzone__icon { box-sizing: content-box; width: 26px; height: 26px; padding: 13px; border-radius: 16px; color: var(--accent-ink); background: var(--surface); box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--line); transition: transform .35s var(--ease-soft); }
.dropzone:hover .dropzone__icon { transform: translateY(-3px); }
.dropzone__title { font-weight: 650; font-size: 1.02rem; }
.dropzone__hint { font-size: .85rem; color: var(--ink-faint); }

/* Barra de progreso */
.progress { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress__bar {
  height: 100%; width: 0%; border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--accent-ink));
  transition: width .25s var(--ease-out);
}

/* Lista de archivos en proceso (lotes) */
.job {
  display: grid; gap: .5rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}
.job + .job { margin-top: .6rem; }
.job__head { display: flex; justify-content: space-between; gap: 1rem; align-items: baseline; }
.job__name { font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.job__size { font-size: .82rem; color: var(--ink-faint); font-family: var(--mono); flex: none; }
.job__status { font-size: .86rem; color: var(--ink-soft); line-height: 1.5; }
.job__status.is-ok { color: var(--ok); }
.job__status.is-warn { color: var(--warn); }
.job__status.is-error { color: var(--danger); }
.job__result { display: flex; gap: .8rem; align-items: center; flex-wrap: wrap; }
.job__result .job__status { flex: 1; min-width: 200px; }
.job__thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); flex: none; }


/* Vista previa antes / después */
.compare { display: grid; gap: .7rem; }
@media (min-width: 620px) { .compare { grid-template-columns: 1fr 1fr; } }
.compare figure { display: grid; gap: .4rem; }
.compare img {
  width: 100%; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface-2);
  object-fit: contain; max-height: 320px;
}
.compare figcaption { font-size: .82rem; color: var(--ink-faint); text-align: center; }


/* --- Editor de texto: entrada y salida lado a lado --- */
.split { display: grid; gap: 1rem; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split > .field { min-width: 0; }

.textarea-tall { min-height: 240px; }
@media (min-width: 860px) { .textarea-tall { min-height: 320px; } }

.toolbar { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.toolbar .meta { margin-left: auto; font-size: .78rem; color: var(--ink-faint); font-family: var(--mono); }

.stats { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.stat {
  font-size: .8rem; padding: .28rem .65rem; border-radius: 99px;
  background: var(--accent-soft); color: var(--accent-ink); font-weight: 600;
}
.stat--zero { background: var(--surface-2); color: var(--ink-faint); font-weight: 500; }

/* --- Salida de JSON con colores --- */
.code-out {
  margin: 0; padding: .9rem 1rem;
  font-family: var(--mono); font-size: .84rem; line-height: 1.6;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: auto; max-height: 460px; white-space: pre; tab-size: 2;
}
.tok-key { color: var(--accent-ink); }
.tok-str { color: var(--ok); }
.tok-num { color: var(--warn); }
.tok-lit { color: var(--danger); font-weight: 600; }
.tok-punc { color: var(--ink-faint); }
.err-line { background: var(--danger-soft); color: var(--danger); display: block; margin: 0 -1rem; padding: 0 1rem; }


/* --- Vista de árbol (JSON) --- */
.tree { white-space: normal; font-family: var(--mono); font-size: .84rem; line-height: 1.7; }
.tree details { margin: 0; }
.tree summary { cursor: pointer; list-style: none; padding-left: 1rem; position: relative; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
  content: ""; position: absolute; left: .1rem; top: .62em;
  border: 4px solid transparent; border-left-color: var(--ink-faint);
  transition: transform .15s var(--ease-out);
}
.tree details[open] > summary::before { transform: rotate(90deg) translateX(1px); }
.tree-children { margin-left: .55rem; padding-left: .9rem; border-left: 1px dashed var(--line-strong); }
.tree-leaf { padding-left: 1rem; overflow-wrap: anywhere; }
.tree-count { color: var(--ink-faint); font-size: .76rem; }
.tree-close { padding-left: 1rem; }
.error-msg { font-weight: 600; color: var(--danger); margin-bottom: .6rem; }


.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line-strong); flex: none; }
.field-err { font-size: .8rem; color: var(--danger); font-weight: 600; }
.input[aria-invalid="true"] { border-color: var(--danger); }
.ui-sample { display: inline-block; padding: .45rem 1rem; border: 2px solid currentColor; border-radius: 10px; font-weight: 600; font-size: .9rem; }

/* --- Lista de metadatos hallados --- */
.meta-details { margin-top: .5rem; }
.meta-details summary { cursor: pointer; font-weight: 600; color: var(--ink); font-size: .86rem; }
.meta-list { list-style: none; margin: .5rem 0 0; padding: .6rem .8rem; display: grid; gap: .3rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: .84rem; color: var(--ink-soft); overflow-wrap: anywhere; }
.meta-list strong { color: var(--ink); }
.meta-warn { color: var(--danger); }
.meta-warn strong { color: var(--danger); }
.meta-list a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; }
/* --- Muestra de contraste --- */
.swatch-row { display: grid; gap: .8rem; }
@media (min-width: 560px) { .swatch-row { grid-template-columns: 1fr 1fr; } }
.color-field { display: grid; grid-template-columns: 56px 1fr; gap: .5rem; align-items: center; }
.color-field input[type="color"] { height: 46px; }
.contrast-preview {
  border-radius: var(--radius); padding: 1.4rem 1.4rem 1.5rem;
  border: 1px solid var(--line); display: grid; gap: .5rem;
}
.contrast-preview .contrast-preview__large { font-family: var(--display); font-weight: 600; font-size: 1.5rem; line-height: 1.2; letter-spacing: -.02em; }
.contrast-preview p { margin: 0; }
.ratio-big { font-family: var(--display); font-size: clamp(2.4rem, 1.6rem + 3.5vw, 3.6rem); font-weight: 700; line-height: 1; letter-spacing: -.03em; }
.grade-grid { display: grid; gap: .55rem; }
@media (min-width: 560px) { .grade-grid { grid-template-columns: 1fr 1fr; } }
.grade {
  display: flex; justify-content: space-between; align-items: center; gap: .8rem;
  padding: .65rem .85rem; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--surface);
  font-size: .9rem;
}
.grade__pill { font-weight: 700; font-size: .78rem; padding: .18rem .6rem; border-radius: 99px; flex: none; }
.grade--pass .grade__pill { background: var(--ok-soft); color: var(--ok); }
.grade--fail .grade__pill { background: var(--danger-soft); color: var(--danger); }

/* Avisos */
.note {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .7rem .9rem;
  font-size: .87rem; line-height: 1.5;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-soft);
}
.note svg { width: 17px; height: 17px; flex: none; margin-top: .14rem; }
.note--ok { background: var(--ok-soft); border-color: transparent; color: var(--ok); }
.note--warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); }
.note--error { background: var(--danger-soft); border-color: transparent; color: var(--danger); }
.note strong { color: inherit; }

.privacy-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .855rem; color: var(--ink-soft);
}
.privacy-badge svg { width: 16px; height: 16px; color: var(--accent); flex: none; }

/* Resultado grande */
.result {
  display: grid; gap: .3rem;
  padding: 1.15rem 1.25rem;
  background: linear-gradient(180deg, color-mix(in srgb, var(--surface-2) 55%, var(--surface)), var(--surface-2));
  border-radius: 16px;
  border: 1px solid var(--line);
}
.result__label { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 650; }
.result__value {
  font-family: var(--display); font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.3rem);
  font-weight: 650; letter-spacing: -.02em; line-height: 1.1;
  overflow-wrap: anywhere;
}
.result__value--mono { font-family: var(--mono); font-size: clamp(1.25rem, 1rem + 1.4vw, 1.9rem); }
.result__sub { font-size: .87rem; color: var(--ink-soft); }

/* Tabla de datos */
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th, .data-table td { padding: .58rem .7rem; text-align: left; border-bottom: 1px solid var(--line); }
.data-table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 650; }
.data-table td.num, .data-table th.num { text-align: right; font-family: var(--mono); font-size: .86rem; }
.data-table tbody tr:hover { background: var(--surface-2); }
.data-table code { font-family: var(--mono); font-size: .82em; word-break: break-all; }
.prose pre.code-out { margin: .8rem 0 1rem; max-height: 320px; }
.table-scroll { overflow-x: auto; max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table-scroll .data-table th { position: sticky; top: 0; background: var(--surface); z-index: 1; }

/* Par clave/valor */
.kv { display: grid; gap: .1rem; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv__k { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); font-weight: 650; }
.kv__v { font-size: .98rem; overflow-wrap: anywhere; }

/* Botón copiar */
.copy-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .35rem .6rem; font-size: .8rem; font-weight: 600;
  color: var(--ink-soft); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 8px;
  transition: all .15s var(--ease-out);
}
.copy-btn:hover { color: var(--accent-ink); border-color: var(--accent); }
.copy-btn[data-copied="true"] { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.copy-btn svg { width: 14px; height: 14px; }

/* --- Tarjeta de herramienta en la rejilla --- */
.tool-tile {
  position: relative;
  display: grid; grid-template-columns: auto 1fr;
  grid-template-areas: "icon name" "icon desc";
  column-gap: .9rem; row-gap: .2rem; align-items: start; align-content: start;
  padding: 1rem 1.05rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .03);
  isolation: isolate;
  transition: transform .35s var(--ease-soft), box-shadow .35s var(--ease-soft), border-color .25s var(--ease-out);
}
.tool-tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(240px circle at var(--mx, 30%) var(--my, 0%), hsl(var(--cat-h) 85% 60% / .16), transparent 65%);
  opacity: 0; transition: opacity .3s var(--ease-out);
}
a.tool-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: hsl(var(--cat-h) 55% 55% / .7); }
a.tool-tile:hover::before { opacity: 1; }
a.tool-tile:focus-visible { outline-offset: 2px; border-radius: 16px; }
.tool-tile__icon {
  grid-area: icon;
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 12px;
  background: linear-gradient(150deg, hsl(var(--cat-h) var(--cbs) calc(var(--cbl) + 3%)), hsl(var(--cat-h) var(--cbs) calc(var(--cbl) - 5%)));
  color: hsl(var(--cat-h) var(--cfs) var(--cfl));
  box-shadow: inset 0 0 0 1px hsl(var(--cat-h) 60% 55% / .2);
}
.tool-tile__icon svg { width: 22px; height: 22px; }
.tool-tile__name {
  grid-area: name; font-family: var(--display); font-weight: 600; font-size: 1rem; letter-spacing: -.012em; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-tile__desc {
  grid-area: desc; font-size: .85rem; color: var(--ink-soft); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.tool-tile--soon { opacity: .62; }
.tool-tile__soon {
  position: absolute; top: .85rem; right: .9rem;
  font-size: .66rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-faint); background: var(--surface-2);
  padding: .2rem .5rem; border-radius: 99px; border: 1px solid var(--line);
}

.tools-grid { display: grid; gap: .85rem; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.tools-grid--feature { grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); }
.tools-grid--feature .tool-tile { padding: 1.2rem 1.2rem; box-shadow: var(--shadow); }
.tools-grid--feature .tool-tile__icon { width: 46px; height: 46px; border-radius: 13px; }

/* Colores por categoría (tono HSL) */
[data-cat="pdf"] { --cat-h: 2; }
[data-cat="tramites"] { --cat-h: 26; }
[data-cat="archivos"] { --cat-h: 46; }
[data-cat="diferencial"] { --cat-h: 78; }
[data-cat="numeros"] { --cat-h: 138; }
[data-cat="privacidad"] { --cat-h: 160; }
[data-cat="codigos"] { --cat-h: 182; }
[data-cat="datos"] { --cat-h: 202; }
[data-cat="web"] { --cat-h: 222; }
[data-cat="texto"] { --cat-h: 244; }
[data-cat="imagen"] { --cat-h: 272; }
[data-cat="color"] { --cat-h: 302; }
[data-cat="fechas"] { --cat-h: 332; }

/* --- FAQ --- */
.faq { display: grid; gap: .65rem; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 1.2rem;
  transition: border-color .2s var(--ease-out), box-shadow .3s var(--ease-soft);
}
.faq details:hover { border-color: var(--line-strong); }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); box-shadow: var(--shadow); }
.faq summary {
  cursor: pointer; font-weight: 600; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 1rem 0; min-height: 52px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {                                        /* «+» que se convierte en «−» */
  content: ""; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background:
    linear-gradient(var(--ink-soft), var(--ink-soft)) center / 10px 1.6px no-repeat,
    linear-gradient(var(--ink-soft), var(--ink-soft)) center / 1.6px 10px no-repeat,
    var(--surface-2);
  transition: transform .3s var(--ease-soft), background-color .2s;
}
.faq details[open] summary::after {
  background:
    linear-gradient(var(--accent-contrast), var(--accent-contrast)) center / 10px 1.6px no-repeat,
    var(--btn-bg);
  transform: rotate(180deg);
}
.faq details > p, .faq details > div { margin: 0 0 1.05rem; color: var(--ink-soft); font-size: .94rem; line-height: 1.65; }

/* --- Pasos --- */
.steps { display: grid; gap: 1.1rem; counter-reset: step; }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(3, 1fr); gap: 1.6rem; } }
.step { display: grid; gap: .4rem; align-content: start; }
.step__n {
  counter-increment: step;
  width: 30px; height: 30px; display: grid; place-items: center;
  border-radius: 10px;
  background: hsl(var(--cat-h) var(--cbs) var(--cbl)); color: hsl(var(--cat-h) var(--cfs) var(--cfl));
  box-shadow: inset 0 0 0 1px hsl(var(--cat-h) 60% 55% / .22);
  font-weight: 700; font-size: .87rem; font-family: var(--mono);
}
.step__n::before { content: counter(step); }
.step h3 { font-size: 1rem; }
.step p { font-size: .89rem; color: var(--ink-soft); }

/* =============================================================
   6. Secciones
   ============================================================= */

/* --- Cabecera: cristal que se solidifica al desplazar --- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 94%, transparent);            /* respaldo casi sólido */
  border-bottom: 1px solid transparent;
  transition: background-color .3s var(--ease-out), border-color .3s var(--ease-out), box-shadow .3s var(--ease-out);
}
@supports (backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px)) {
  .site-header {
    background: color-mix(in srgb, var(--bg) 62%, transparent);
    -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  }
  .site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 82%, transparent); }
}
.site-header.is-scrolled { border-bottom-color: var(--line); box-shadow: 0 10px 30px -18px rgba(15, 23, 42, .3); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  height: 64px;
}
.logo { display: inline-flex; align-items: center; gap: .6rem; font-family: var(--display); font-weight: 700; font-size: 1.18rem; letter-spacing: -.04em; }
.logo__mark {
  width: 34px; height: 34px; border-radius: 23.4%; flex: none;
  background: linear-gradient(135deg, #14b8a6 0%, #3b82c4 55%, #4f46e5 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), 0 6px 14px -4px rgba(79, 70, 229, .45);
  display: block; overflow: hidden;
}
.logo__mark svg { width: 100%; height: 100%; display: block; }
.logo span em { font-style: normal; color: var(--accent-ink); }

.site-nav { display: flex; align-items: center; gap: .35rem; }
.site-nav a:not(.lang-switch) {
  position: relative; padding: .5rem .7rem; border-radius: 8px;
  font-size: .9rem; font-weight: 560; color: var(--ink-soft);
  transition: color .2s var(--ease-out);
}
.site-nav a:not(.lang-switch)::after {
  content: ""; position: absolute; left: .7rem; right: .7rem; bottom: .2rem; height: 2px; border-radius: 2px;
  background: var(--grad-brand);
  transform: scaleX(0); transform-origin: right; transition: transform .4s var(--ease-soft);
}
.site-nav a:not(.lang-switch):hover, .site-nav a[aria-current="page"] { color: var(--ink); }
.site-nav a:not(.lang-switch):hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); transform-origin: left; }

/* Buscador rápido (Ctrl/⌘ + K) — solo con JavaScript */
.nav-search {
  display: none; align-items: center; justify-content: space-between; gap: .7rem;
  min-width: 210px; height: 40px; padding: 0 .5rem 0 .85rem;
  font: inherit; font-size: .88rem; font-weight: 550; color: var(--ink-faint);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  transition: border-color .2s var(--ease-out), box-shadow .2s var(--ease-out), color .2s var(--ease-out);
}
.js .nav-search { display: inline-flex; }
.nav-search__label { display: inline-flex; align-items: center; gap: .55rem; }
.nav-search svg { width: 16px; height: 16px; flex: none; }
.nav-search kbd {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; padding: .14rem .45rem; border-radius: 7px;
  color: var(--ink-faint); background: var(--surface-2); border: 1px solid var(--line);
}
.nav-search:hover { border-color: var(--accent); color: var(--ink); box-shadow: 0 0 0 4px var(--accent-soft); }

/* Selector de idioma: lleva a la MISMA herramienta en el otro idioma */
.lang-switch {
  border: 1px solid var(--line-strong);
  border-radius: 12px; background: var(--surface);
  padding: .5rem .85rem !important; height: 40px; display: inline-flex; align-items: center;
  font-size: .84rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang-switch:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 720px) {
  .nav-search { min-width: 0; width: 44px; height: 44px; padding: 0; justify-content: center; }
  .nav-search__text, .nav-search kbd { display: none; }
  .site-nav .site-nav__all { display: none; }
}

/* --- Hero de herramienta --- */
.tool-hero { position: relative; isolation: isolate; padding: clamp(1.8rem, 5vw, 3.2rem) 0 1.4rem; text-align: center; overflow: hidden; }
.tool-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(58% 120% at 50% -20%, hsl(var(--cat-h) 80% 58% / .2), transparent 70%),
    radial-gradient(30% 70% at 92% 0%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 70%);
}
.tool-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 16%, transparent) 1px, transparent 0);
  background-size: 24px 24px; opacity: .45;
  -webkit-mask-image: radial-gradient(60% 90% at 50% 0%, #000 20%, transparent 75%); mask-image: radial-gradient(60% 90% at 50% 0%, #000 20%, transparent 75%);
}
.tool-hero h1 { margin-bottom: .7rem; letter-spacing: -.032em; }
.tool-hero .lede { margin-inline: auto; }
.hero-badges { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem .5rem; padding: 0; margin: 1.1rem 0 0; }
.hero-badges li { font-size: .78rem; font-weight: 600; padding: .22rem .75rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.hero-badges li::before { content: "✓"; color: var(--accent); margin-right: .35rem; font-weight: 800; }

@media (max-width: 560px) { .hero-badges { display: none; } .tool-hero { padding-bottom: .5rem; } }
.breadcrumb { display: flex; flex-wrap: wrap; justify-content: center; gap: .2rem .45rem; font-size: .83rem; color: var(--ink-faint); margin-bottom: .9rem; }
.breadcrumb a:hover { color: var(--accent-ink); }

/* --- Hero de portada: malla de color viva, cuadrícula de puntos y buscador de cristal --- */
.home-hero {
  position: relative; isolation: isolate; overflow: hidden; text-align: center;
  margin-top: -64px;                                          /* el cristal de la cabecera flota sobre el héroe */
  padding: calc(clamp(3rem, 9vw, 6.2rem) + 64px) 0 clamp(2rem, 5vw, 3rem);
}
.home-hero__mesh {
  position: absolute; inset: -22% -12% -8%; z-index: -2; pointer-events: none;
  background:
    radial-gradient(36% 44% at 20% 30%, color-mix(in srgb, #14b8a6 38%, transparent), transparent 70%),
    radial-gradient(34% 42% at 80% 22%, color-mix(in srgb, #6366f1 34%, transparent), transparent 70%),
    radial-gradient(30% 38% at 58% 92%, color-mix(in srgb, #f59e0b 24%, transparent), transparent 70%);
  filter: blur(46px) saturate(140%);
  animation: meshDrift 38s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes meshDrift {
  0%   { transform: translate3d(-2%, -1%, 0) scale(1) rotate(0deg); }
  100% { transform: translate3d(3%, 2%, 0) scale(1.12) rotate(7deg); }
}
.home-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--ink) 18%, transparent) 1px, transparent 0);
  background-size: 26px 26px; opacity: .5;
  -webkit-mask-image: radial-gradient(70% 75% at 50% 30%, #000 25%, transparent 78%); mask-image: radial-gradient(70% 75% at 50% 30%, #000 25%, transparent 78%);
}
.home-hero::after {                                           /* funde el héroe con el resto de la página */
  content: ""; position: absolute; inset: auto 0 0; height: 30%; z-index: -1; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
.home-hero__eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 1.3rem; padding: .38rem .95rem .38rem .8rem; border-radius: 99px;
  font-size: .8rem; font-weight: 650; letter-spacing: .01em; color: var(--accent-ink);
  background: var(--glass); border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.home-hero__eyebrow::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px rgba(34, 197, 94, .2);
}
.home-hero h1 { font-size: clamp(2.5rem, 1.1rem + 5.2vw, 4.7rem); line-height: 1.02; letter-spacing: -.046em; font-weight: 700; margin-bottom: 1rem; }
.home-hero .lede { margin-inline: auto; margin-bottom: 2rem; font-size: clamp(1.05rem, .98rem + .4vw, 1.25rem); }
.home-hero__accent { color: var(--accent-ink); }
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .home-hero__accent { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; color: transparent; }
}
.search-status { min-height: 1.5em; margin: .7rem 0 0; font-size: .86rem; color: var(--ink-soft); }
.home-hero__quick { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .5rem; margin-top: .4rem; font-size: .85rem; color: var(--ink-faint); }
.home-hero__quick a {
  padding: .32rem .85rem; border-radius: 99px; font-weight: 560; color: var(--ink-soft);
  background: var(--glass); border: 1px solid var(--line);
  transition: transform .3s var(--ease-soft), border-color .2s, color .2s, box-shadow .3s;
}
.home-hero__quick a:hover { transform: translateY(-2px); border-color: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.home-stats { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 3rem; margin: 2.6rem 0 0; padding: 0; }
.home-stats li { display: grid; justify-items: center; gap: .15rem; }
.home-stats strong { font-family: var(--display); font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.05; color: var(--ink); }
.home-stats span { font-size: .74rem; font-weight: 650; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-faint); }
@media (prefers-reduced-motion: reduce) { .home-hero__mesh { animation: none; } }
@media (max-width: 560px) {
  .home-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 2rem; }
  .home-stats span { font-size: .62rem; letter-spacing: .07em; text-align: center; }
  .home-hero__quick a:nth-of-type(n+4) { display: none; }
  .home-hero__quick span { flex-basis: 100%; }
}

.search-box { position: relative; max-width: 620px; margin-inline: auto; }
.search-box svg { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; z-index: 1; color: var(--ink-faint); pointer-events: none; }
.search-box .input { padding-left: 2.8rem; height: 60px; border-radius: 18px; font-size: 1.05rem; box-shadow: var(--shadow-lg); background: var(--glass); border-color: color-mix(in srgb, var(--line-strong) 80%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.search-box .input:focus { box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg); background: var(--surface); }
@media (hover: hover) {
  .search-box:not(:focus-within):has(input:placeholder-shown)::after {
    content: "/"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%);
    width: 26px; height: 26px; display: grid; place-items: center; border-radius: 7px;
    font-family: var(--mono); font-size: .85rem; color: var(--ink-faint);
    border: 1px solid var(--line-strong); background: var(--surface-2); pointer-events: none;
  }
}

.section { padding-block: clamp(2rem, 5vw, 3.4rem); }
.section--band { background: linear-gradient(180deg, var(--surface), color-mix(in srgb, var(--surface) 55%, var(--bg))); border-block: 1px solid var(--line); }
.section__head { margin-bottom: 1.5rem; }
.section__head h2 { margin-bottom: .35rem; letter-spacing: -.03em; }
.section__head p { color: var(--ink-soft); font-size: .98rem; }
.eyebrow { margin: 0 0 .5rem; font-size: .74rem; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--accent-ink); }

.cat-block { scroll-margin-top: 8.6rem; }
.cat-block + .cat-block { margin-top: 2.6rem; }
.cat-block__head { display: flex; align-items: center; gap: .7rem; margin-bottom: 1rem; }
.cat-block__head::after { content: ""; flex: 1; height: 1px; background: var(--line); order: 9; }
.cat-block__badge {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 12px;
  background: linear-gradient(150deg, hsl(var(--cat-h) var(--cbs) calc(var(--cbl) + 3%)), hsl(var(--cat-h) var(--cbs) calc(var(--cbl) - 5%)));
  color: hsl(var(--cat-h) var(--cfs) var(--cfl));
  box-shadow: inset 0 0 0 1px hsl(var(--cat-h) 60% 55% / .2);
}
.cat-block__title { font-family: var(--display); font-size: 1.28rem; font-weight: 650; letter-spacing: -.02em; margin: 0; }
.cat-block__count {
  font-size: .76rem; font-weight: 650; color: var(--ink-soft);
  padding: .12rem .55rem; border-radius: 99px; background: var(--surface-2); border: 1px solid var(--line);
}
.cat-block__more {
  margin-top: .95rem; min-height: 44px; padding: .55rem 1.1rem;
  font-size: .9rem; font-weight: 600; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99px;
  transition: color .16s var(--ease-out), border-color .16s var(--ease-out);
}
.cat-block__more:hover { color: var(--accent-ink); border-color: var(--accent); }
.cat-block[data-collapsed] .tool-tile:nth-child(n+9) { display: none; }
@media (max-width: 719px) { .cat-block[data-collapsed] .tool-tile:nth-child(n+5) { display: none; } .tools-grid--feature .tool-tile:nth-child(n+5) { display: none; } }
@media (min-width: 720px) { .cat-block__more--mobile { display: none; } }
.is-searching .cat-block[data-collapsed] .tool-tile:nth-child(n+5) { display: grid; }
.is-searching .cat-block__more, .is-searching .home-featured, .is-searching .trust { display: none; }

/* Barra de categorías de la portada */
.cat-nav {
  position: sticky; top: 64px; z-index: 40;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
  border-block: 1px solid var(--line);
}
.cat-nav__row { display: flex; gap: .5rem; overflow-x: auto; padding-block: .65rem; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); }
.cat-nav__row::-webkit-scrollbar { display: none; }
.cat-chip {
  display: inline-flex; align-items: center; gap: .5rem; flex: none;
  padding: .3rem .8rem .3rem .35rem; min-height: 40px;
  font-size: .86rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 99px;
  transition: color .16s var(--ease-out), border-color .16s var(--ease-out), background-color .16s var(--ease-out);
}
.cat-chip__icon {
  width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%;
  background: hsl(var(--cat-h) var(--cbs) var(--cbl)); color: hsl(var(--cat-h) var(--cfs) var(--cfl));
}
.cat-chip__icon svg { width: 16px; height: 16px; }
.cat-chip__n { font-size: .74rem; font-weight: 600; color: var(--ink-faint); }
.cat-chip:hover, .cat-chip[aria-current="true"] { color: var(--ink); border-color: hsl(var(--cat-h) 55% 52%); }
.cat-chip[aria-current="true"] { background: hsl(var(--cat-h) var(--cbs) var(--cbl)); }
@media (max-height: 520px) { .cat-nav { position: static; } }

/* Franja de confianza */
.trust { padding-block: clamp(2.4rem, 6vw, 4rem); }
.trust__grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(235px, 1fr)); }
.trust__item {
  position: relative; display: flex; gap: .95rem; align-items: flex-start; isolation: isolate;
  padding: 1.25rem 1.2rem; border-radius: 18px;
  background: var(--glass); border: 1px solid var(--line);
  transition: transform .35s var(--ease-soft), box-shadow .35s var(--ease-soft), border-color .25s;
}
@supports (backdrop-filter: blur(10px)) { .trust__item { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); } }
.trust__item:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.trust__icon {
  width: 46px; height: 46px; flex: none; display: grid; place-items: center; border-radius: 14px;
  background: linear-gradient(150deg, var(--accent-soft), color-mix(in srgb, var(--accent-2-soft) 80%, var(--accent-soft)));
  color: var(--accent-ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.trust__item strong { display: block; font-family: var(--display); font-size: 1.05rem; font-weight: 650; letter-spacing: -.015em; margin-bottom: .2rem; }
.trust__item div span { display: block; font-size: .88rem; color: var(--ink-soft); line-height: 1.5; }

/* --- Pie --- */
/* Pie oscuro (igual en modo claro y oscuro): cierra la página con peso */
.site-footer {
  --f-ink: #f1f5fb; --f-soft: #b4c0d4; --f-faint: #8391a9; --f-line: rgba(255, 255, 255, .1);
  position: relative; isolation: isolate; margin-top: auto; overflow: hidden;
  background: #0a1120; color: var(--f-soft);
  padding-block: 3.2rem 1.8rem;
  font-size: .9rem;
}
.site-footer::before {                                        /* filo de marca en el borde superior */
  content: ""; position: absolute; inset: 0 0 auto; height: 2px; z-index: 1;
  background: linear-gradient(90deg, transparent 0%, #14b8a6 30%, #6366f1 70%, transparent 100%); opacity: .8;
}
.site-footer::after {                                         /* resplandor suave */
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: -40% -10% auto;
  height: 90%;
  background:
    radial-gradient(40% 60% at 15% 0%, rgba(20, 184, 166, .16), transparent 70%),
    radial-gradient(40% 60% at 85% 0%, rgba(99, 102, 241, .16), transparent 70%);
}
.site-footer__grid { display: grid; gap: 2rem; }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.2rem 2.4rem; } }
@media (min-width: 1000px) { .site-footer__grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(0, 1.35fr) minmax(0, .9fr); } }
.site-footer .logo { color: var(--f-ink); }
.site-footer .logo span em { color: #5eead4; }
.site-footer__tagline { margin: .9rem 0 0; max-width: 34ch; color: var(--f-soft); line-height: 1.6; }
.site-footer .site-footer__cats ul { columns: 2; column-gap: 1.4rem; display: block; }
.site-footer__cats li { break-inside: avoid; margin-bottom: .5rem; }
.site-footer h3 { font-size: .74rem; text-transform: uppercase; letter-spacing: .12em; color: var(--f-faint); margin-bottom: .95rem; font-family: var(--sans); font-weight: 700; }
.site-footer ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.site-footer a { color: var(--f-soft); transition: color .2s var(--ease-out); }
.site-footer a:hover { color: #fff; }
.site-footer :focus-visible { outline-color: #5eead4; }
.site-footer__bottom {
  margin-top: 2.4rem; padding-top: 1.2rem; border-top: 1px solid var(--f-line);
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; justify-content: space-between;
  color: var(--f-faint); font-size: .84rem;
}

main { flex: 1; }

/* Aviso de "necesita JavaScript" */
.needs-js { display: none; }
html:not(.is-ready) .needs-js { display: revert; }

/* =============================================================
   7. Efectos
   ============================================================= */
@view-transition { navigation: auto; }

/* Solo se oculta a la espera del efecto si hay JavaScript (la clase «js» la pone la cabecera) */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .55s var(--ease-out), transform .55s var(--ease-out); }
.js .reveal.is-in { opacity: 1; transform: none; }

@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

@keyframes pulse-soft { 50% { opacity: .55; } }
.is-pulsing { animation: pulse-soft 1.5s var(--ease-soft) infinite; }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (max-width: 539px) {
  .site-nav a { padding: .4rem .55rem; font-size: .85rem; }
  .site-nav__extra { display: none; }
}

/* Pantallas táctiles y móviles: zonas de toque de al menos 44 px */
@media (max-width: 719px), (pointer: coarse) {
  .btn, .btn--quiet, .copy-btn, .result__copy, .chip, .lang-switch, .site-nav a { min-height: 44px; }
  .btn--quiet, .copy-btn, .result__copy, .lang-switch, .site-nav a { display: inline-flex; align-items: center; justify-content: center; }
  .input, select.input { min-height: 44px; }
  .pal-swatch__copy { min-height: 40px; padding-inline: .6rem; }
  .breadcrumb a { display: inline-block; padding-block: .5rem; }
  .cp-hist { width: 34px; height: 34px; }
}

/* =============================================================
   9. Reduced-motion — solo lo intrusivo
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .is-pulsing { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  @view-transition { navigation: none; }
}

/* =============================================================
   10. Impresión
   ============================================================= */
@media print {
  .site-header, .site-footer, .ad-slot, .faq, .btn, .breadcrumb { display: none !important; }
  body { background: #fff; color: #000; }
  .tool-card { box-shadow: none; border: 1px solid #ccc; }
  .table-scroll { max-height: none; overflow: visible; border: 0; }
}

/* --- Editor de foto de carnet --- */
.pp-stage { display: grid; place-items: center; padding: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); }
.pp-stage canvas { touch-action: none; cursor: grab; border-radius: 6px; box-shadow: var(--shadow); background: #fff; max-width: 100%; }
.pp-stage--circle canvas { border-radius: 50%; }

/* --- Lista de PDF (unir, comprobar) --- */
.pdf-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.pdf-row { display: flex; gap: .8rem; align-items: center; padding: .7rem .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.pdf-thumb { width: 46px; height: 60px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line-strong); background: var(--surface); flex: none; }
.pdf-thumb--empty { display: block; }
.pdf-row__main { flex: 1; min-width: 0; display: grid; gap: .15rem; }
.pdf-row__meta { font-size: .8rem; color: var(--ink-faint); font-family: var(--mono); }
.pdf-row__btns { display: flex; gap: .1rem; flex: none; }
.pdf-row__btns .btn { padding: .35rem .6rem; }
.pdf-row .job__status a { color: inherit; text-decoration: underline; }
.progress[hidden] { display: none; }

.opt { display: flex; gap: .7rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }
.opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.opt input { margin-top: .3rem; accent-color: var(--accent); flex: none; }
.opt small { color: var(--ink-soft); font-size: .84rem; line-height: 1.45; display: block; margin-top: .15rem; }
.opt-group { display: grid; gap: .55rem; border: 0; padding: 0; margin: 0; }

/* --- Lista de comprobaciones --- */
.checks { list-style: none; margin: .4rem 0 .6rem; padding: 0; display: grid; gap: .4rem; }
.check { position: relative; padding-left: 1.7rem; font-size: .92rem; color: var(--ink-soft); }
.check::before { position: absolute; left: 0; top: .05rem; font-weight: 700; }
.check--ok::before { content: "✓"; color: var(--ok); }
.check--bad::before { content: "✗"; color: var(--danger); }
.check--warn::before { content: "!"; color: var(--warn); }
.check--bad { color: var(--danger); }

/* --- Contador de palabras: recuadros de cifras y límite de referencia --- */
.tiles { display: grid; gap: .6rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile {
  display: grid; gap: .1rem; padding: .8rem .9rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm, 10px);
}
.tile__value { font-family: var(--display); font-size: 1.5rem; font-weight: 700; line-height: 1.15; color: var(--ink); }
.tile__label { font-size: .78rem; color: var(--ink-faint); }
.tile--hero { background: var(--accent-soft, var(--surface-2)); border-color: transparent; }
.tile--hero .tile__value { font-size: 1.9rem; color: var(--accent-ink, var(--ink)); }
@media (min-width: 640px) { .tile--hero { grid-column: span 2; } }
.limit { height: .5rem; background: var(--surface-2); border-radius: 99px; overflow: hidden; }
.limit__bar { height: 100%; width: 0; background: var(--accent); border-radius: 99px; transition: width .15s; }
.limit--over .limit__bar { background: var(--danger); }
.kw-list { list-style: none; padding: 0; display: grid; gap: .35rem; }
.kw-list li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }

/* --- Comparador de textos --- */
.diff { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; font-family: var(--mono); font-size: .86rem; line-height: 1.5; }
.diff__row { display: grid; grid-template-columns: 2.6rem 2.6rem 1.2rem 1fr; align-items: start; }
.diff__no, .diff__sign { padding: .1rem .4rem; color: var(--ink-faint); text-align: right; user-select: none; }
.diff__sign { text-align: center; }
.diff__text { padding: .1rem .5rem; white-space: pre-wrap; word-break: break-word; }
.diff__row--add { background: var(--ok-soft); }
.diff__row--del { background: var(--danger-soft); }
.diff__row--add .diff__sign { color: var(--ok); }
.diff__row--del .diff__sign { color: var(--danger); }
.diff__gap { padding: .3rem .8rem; background: var(--surface-2); color: var(--ink-faint); font-family: var(--sans); font-size: .8rem; text-align: center; }
.diff ins, .diff del { text-decoration: none; border-radius: 3px; padding: 0 .12em; }
.diff ins { background: color-mix(in srgb, var(--ok) 28%, transparent); }
.diff del { background: color-mix(in srgb, var(--danger) 26%, transparent); }
.diff__flow { padding: .8rem 1rem; white-space: pre-wrap; word-break: break-word; font-family: var(--sans); font-size: .95rem; }
@media (max-width: 560px) { .diff__row { grid-template-columns: 2rem 2rem 1rem 1fr; } }

/* --- Trozos de texto --- */
.chunk { display: grid; gap: .4rem; padding: .8rem; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.chunk__head { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.chunk__head .btn { margin-left: auto; }
[data-ck-list] { display: grid; gap: .8rem; }

/* --- Espacios y caracteres invisibles --- */
.ws-view { font-family: var(--mono); font-size: .9rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 6rem; tab-size: 4; }
.ws { border-radius: 3px; }
.ws--sp { color: var(--ink-faint); }
.ws--tab, .ws--nl { color: var(--accent-ink); opacity: .85; }
.ws--x { display: inline-block; padding: 0 .3em; margin: 0 .05em; font-size: .72em; font-weight: 600; letter-spacing: .02em; line-height: 1.5; vertical-align: .08em; color: var(--warn); background: var(--warn-soft); }
.ws--zero, .ws--format { color: var(--danger); background: var(--danger-soft); }
.ws--bidi { color: var(--accent-ink); background: var(--accent-soft); }
.ws--space { color: var(--warn); background: var(--warn-soft); }
.uc-scroll { overflow-x: auto; }
.uc-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.uc-table th, .uc-table td { padding: .4rem .6rem; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.uc-table th { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }
.uc-table td:nth-child(5), .uc-table td:nth-child(3) { white-space: normal; }

/* --- Calculadoras: rejilla de resultados --- */
[data-calc-out] { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
[data-calc-out] .result { position: relative; }
.result--big { grid-column: 1 / -1; }
.result--wide { grid-column: 1 / -1; }
.result--ok { border-color: var(--ok); }
.result--warn { border-color: var(--warn); }
.result__copy { justify-self: start; margin-top: .3rem; padding: .3rem .7rem; font-size: .8rem; font-weight: 600; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; }
.result__copy:hover { color: var(--accent-ink); border-color: var(--accent); background: var(--surface); }
.calc-pick { display: grid; gap: .25rem; }
.mini-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.mini-table th, .mini-table td { padding: .35rem .5rem; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mini-table th:first-child, .mini-table td:first-child { text-align: left; }
.mini-table th { font-size: .78rem; color: var(--ink-faint); font-weight: 600; }

/* --- Cuenta atrás y temporizador --- */
.cd { display: flex; flex-wrap: wrap; gap: .6rem; margin: .4rem 0; }
.cd-unit { display: grid; justify-items: center; min-width: 4.4rem; padding: .6rem .5rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.cd-unit strong { font-family: var(--display); font-size: 2rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.cd-unit small { font-size: .74rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; }
.cd-display { font-family: var(--display); font-size: clamp(3rem, 12vw, 5.5rem); font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; padding: .4rem 0; }
.cd-done { color: var(--danger); animation: cd-blink 1s steps(2) infinite; }
@keyframes cd-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cd-done { animation: none; } }

/* --- Contraseñas --- */
.pw-list { display: grid; gap: .5rem; }
.pw-row { display: flex; align-items: center; justify-content: space-between; gap: .8rem; padding: .55rem .8rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.pw { font-family: var(--mono); font-size: 1.05rem; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.pw-row .result__copy { margin: 0; flex: none; }

/* --- Hashes --- */
.hash-row { display: grid; gap: .3rem; padding: .7rem .9rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.hash-row--ok { border-color: var(--ok); background: var(--ok-soft); }
.hash-name { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); font-weight: 650; }
.hash-val { font-family: var(--mono); font-size: .88rem; overflow-wrap: anywhere; word-break: break-all; user-select: all; }
.hash-row .btn { justify-self: start; }

/* --- Probador de expresiones regulares y selector de color --- */
.rx-view { font-family: var(--mono); font-size: .9rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; padding: .8rem 1rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 4rem; }
.rx-m0 { background: color-mix(in srgb, var(--accent) 32%, transparent); border-radius: 3px; color: inherit; }
.rx-m1 { background: color-mix(in srgb, var(--warn) 32%, transparent); border-radius: 3px; color: inherit; }
.cc-swatch { width: 100%; height: 72px; border-radius: var(--radius-sm); border: 1px solid var(--line); background-image: linear-gradient(45deg, #8884 25%, transparent 25%), linear-gradient(-45deg, #8884 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #8884 75%), linear-gradient(-45deg, transparent 75%, #8884 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; position: relative; overflow: hidden; }
.cc-swatch > i { position: absolute; inset: 0; }

/* Código de barras */
.bc-preview { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem; overflow: auto; text-align: center; }
.bc-preview svg { max-width: 100%; height: auto; }

/* CSV */
.csv-wrap { max-height: 30rem; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.csv-table { border-collapse: collapse; font-size: .84rem; width: max-content; min-width: 100%; }
.csv-table th, .csv-table td { padding: .32rem .6rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; max-width: 24rem; overflow: hidden; text-overflow: ellipsis; }
.csv-table th { position: sticky; top: 0; background: var(--surface-2); font-weight: 650; z-index: 1; }
.csv-table th[data-csv-sort] { cursor: pointer; }
.csv-table th[data-csv-sort]:hover { color: var(--accent-ink); }
.csv-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }

.cron-runs { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .15rem; font-family: var(--mono); font-size: .9rem; }

/* Comparador de JSON */
.diff-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.diff-item { display: grid; grid-template-columns: auto minmax(0, 15rem) minmax(0, 1fr); gap: .3rem .7rem; align-items: baseline; padding: .45rem .65rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .88rem; }
.diff-item__badge { font-weight: 700; width: 1.5rem; text-align: center; border-radius: 6px; }
.diff-item__path { overflow-wrap: anywhere; }
.diff-item code { overflow-wrap: anywhere; }
.diff-item--added .diff-item__badge { background: var(--ok-soft); color: var(--ok); }
.diff-item--removed .diff-item__badge { background: var(--danger-soft); color: var(--danger); }
.diff-item--changed .diff-item__badge, .diff-item--type .diff-item__badge { background: var(--warn-soft); color: var(--warn); }
@media (max-width: 640px) { .diff-item { grid-template-columns: auto 1fr; } .diff-item > span:last-child { grid-column: 1 / -1; } }

.tool-card__sub { margin: .8rem 0 0; font-size: 1rem; font-weight: 650; }

/* Generadores de CSS */
.css-stage { display: grid; place-items: center; min-height: 240px; padding: 2rem; border-radius: var(--radius); background: var(--surface-2); border: 1px solid var(--line); }
.css-box { width: min(240px, 80%); height: 130px; }
[data-css-sec] input[type=range] { width: 100%; }

/* Resultado de búsqueda simulado */
.serp { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .9rem 1rem; font-family: Arial, Helvetica, sans-serif; }
.serp__url { color: #4d5156; font-size: 12px; margin-bottom: 2px; }
.serp__title { color: #1a0dab; font-size: 20px; line-height: 1.3; white-space: nowrap; overflow: hidden; }
.serp__desc { color: #4d5156; font-size: 14px; line-height: 1.58; margin-top: 3px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .serp__title { color: #8ab4f8; } :root:not([data-theme="light"]) .serp__url, :root:not([data-theme="light"]) .serp__desc { color: #bdc1c6; } }
:root[data-theme="dark"] .serp__title { color: #8ab4f8; }
:root[data-theme="dark"] .serp__url, :root[data-theme="dark"] .serp__desc { color: #bdc1c6; }

/* Tamaño de pantalla */
.ss-hero { display: grid; gap: .2rem; padding: 1.2rem; border-radius: var(--radius); background: var(--accent-soft); text-align: center; }
.ss-hero__label { font-size: .85rem; color: var(--ink-soft); }
.ss-hero__value { font-family: var(--display); font-size: clamp(2rem, 7vw, 3.2rem); line-height: 1.1; }
.ss-hero__hint { font-size: .8rem; color: var(--ink-faint); }
.ss-grid { display: grid; gap: .4rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.ss-row { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .8rem; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .9rem; }
.ss-row span { color: var(--ink-soft); }

/* Vista previa de enlace y favicon */
.og-wrap { display: grid; gap: .4rem; margin-top: .4rem; }
.og-card { display: grid; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; background: var(--surface); max-width: 520px; }
.og-card__img { background: var(--surface-2); aspect-ratio: 1.91 / 1; display: grid; place-items: center; overflow: hidden; }
.og-card__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.og-card__noimg { color: var(--ink-faint); font-size: .85rem; }
.og-card__body { display: grid; gap: .15rem; padding: .65rem .8rem .8rem; }
.og-card__dom { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-faint); }
.og-card__title { font-size: .98rem; line-height: 1.3; overflow-wrap: anywhere; }
.og-card__desc { font-size: .85rem; color: var(--ink-soft); line-height: 1.4; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.og-card--small { grid-template-columns: 120px 1fr; max-width: 520px; }
.og-card--small .og-card__img { aspect-ratio: 1 / 1; height: 100%; }
.og-card--x { border-radius: 16px; }
.fc-row { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.fc-prev { margin: 0; display: grid; gap: .3rem; justify-items: center; font-size: .75rem; color: var(--ink-faint); }
.fc-prev__box { padding: .6rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.fc-prev__box--dark { background: #1f2933; border-color: #1f2933; }
.fc-code--out { max-height: 18rem; overflow: auto; margin: .3rem 0 .2rem; }
.fc-code { margin: 0; padding: .7rem .9rem; border-radius: var(--radius-sm); background: var(--surface-2); font-family: var(--mono); font-size: .8rem; overflow-x: auto; white-space: pre; }

.es-preview { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; color: #111; overflow-x: auto; }

/* Color: tiras de paleta, cuentagotas, simulador y legibilidad */
.pal-strip { display: flex; flex-wrap: wrap; gap: .6rem; }
.pal-swatch { flex: 1 1 100px; min-width: 90px; min-height: 84px; border-radius: var(--radius-sm); display: flex; flex-direction: column; justify-content: flex-end; padding: .5rem .6rem; gap: .15rem; border: 1px solid rgba(0,0,0,.06); }
.pal-swatch .meta { align-self: flex-start; color: #111; background: rgba(255,255,255,.85); border-radius: 6px; padding: .1rem .4rem; font-weight: 600; }
.pal-swatch__copy { align-self: flex-start; font-family: var(--mono); font-size: .8rem; font-weight: 700; background: rgba(255,255,255,.85); color: #111; border: none; border-radius: 6px; padding: .15rem .4rem; cursor: pointer; }
.pal-swatch__meta { font-size: .74rem; background: rgba(255,255,255,.85); color: #111; border-radius: 6px; padding: .1rem .35rem; align-self: flex-start; }
.pal-strip--shades { flex-wrap: nowrap; overflow-x: auto; }
.pal-strip--shades .pal-swatch { min-width: 70px; flex: 0 0 auto; }
.pal-swatch--current { outline: 2px solid var(--accent); outline-offset: 2px; }
.pal-row { display: flex; align-items: center; gap: .7rem; padding: .5rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.pal-row:last-child { border-bottom: none; }
.pal-row__swatch { width: 36px; height: 36px; border-radius: var(--radius-sm); border: 1px solid rgba(0,0,0,.08); flex: none; }
.pal-row__code { font-family: var(--mono); font-weight: 700; min-width: 80px; }
.pal-row__rgb { font-family: var(--mono); color: var(--muted); font-size: .88rem; }
.pal-row__pct { color: var(--muted); font-size: .85rem; margin-left: auto; }
.dc-result { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 1rem 0; }
.dc-result__swatch { width: 72px; height: 72px; border-radius: var(--radius); border: 1px solid rgba(0,0,0,.08); flex: none; }
.dc-result__meta { display: flex; flex-direction: column; gap: .2rem; }
.dc-result__hex { font-family: var(--mono); font-size: 1.3rem; }
.ic-wrap { position: relative; width: 100%; max-width: 760px; margin: 0 auto; overflow: hidden; border-radius: var(--radius); border: 1px solid var(--line); cursor: ew-resize; touch-action: none; user-select: none; background: #000; }
.ic-wrap img { display: block; width: 100%; height: 100%; object-fit: contain; position: absolute; top: 0; left: 0; }
.ic-wrap img:first-child { position: relative; }
.ic-handle { position: absolute; top: 0; bottom: 0; width: 3px; background: #fff; transform: translateX(-50%); pointer-events: none; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }
.ic-handle::after { content: "⇔"; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); width: 34px; height: 34px; background: #fff; color: #111; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; box-shadow: 0 2px 8px rgba(0,0,0,.25); }
.ic-labels { display: flex; justify-content: space-between; font-size: .82rem; color: var(--ink-faint); max-width: 760px; margin: .4rem auto 0; }
.cp-stage { position: relative; max-width: 100%; overflow: auto; border-radius: var(--radius); border: 1px solid var(--line); background: repeating-conic-gradient(#e9edf2 0% 25%, #fff 0% 50%) 0 0 / 20px 20px; }
.cp-stage canvas { display: block; max-width: 100%; cursor: crosshair; touch-action: none; }
.cp-loupe { position: absolute; width: 110px; height: 110px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 2px 10px rgba(0,0,0,.35); pointer-events: none; overflow: hidden; }
.cp-loupe canvas { width: 100%; height: 100%; }
.cp-loupe::after { content: ""; position: absolute; inset: 50% 0 0 50%; width: 1px; height: 1px; box-shadow: 0 0 0 1px rgba(0,0,0,.5), 0 0 0 3px rgba(255,255,255,.8); border-radius: 50%; transform: translate(-50%, -50%); }
.cp-row { display: flex; align-items: center; gap: .7rem; padding: .6rem .2rem; }
.cp-swatch { width: 46px; height: 46px; border-radius: 10px; flex: none; border: 1px solid rgba(0,0,0,.08); }
.cp-row__body { display: flex; flex-direction: column; gap: .1rem; flex: 1; min-width: 0; }
.cp-history { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.cp-hist { width: 26px; height: 26px; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); cursor: pointer; }
.cvd-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.cvd-fig { margin: 0; display: grid; gap: .4rem; }
.cvd-fig canvas { width: 100%; height: auto; border-radius: var(--radius-sm); border: 1px solid var(--line); background: #fff; }
.cvd-fig figcaption { font-size: .85rem; font-weight: 600; }
.rp-preview { display: grid; gap: .5rem; }
.rp-row { position: relative; padding: .8rem 1rem; border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.rp-row__badge { display: block; font-size: .7rem; font-weight: 600; opacity: .75; margin-top: .3rem; }
.rp-row__badge--bad { color: var(--danger); opacity: 1; }
.gs-grid { display: grid; gap: .5rem; }
.gs-pair { display: flex; align-items: center; gap: .5rem; }
.gs-pair__sw { width: 40px; height: 40px; border-radius: 8px; border: 1px solid rgba(0,0,0,.08); }

/* Sorteo con ruleta */
.rw-layout { display: grid; gap: 1.4rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 720px) { .rw-layout { grid-template-columns: minmax(0, 340px) 1fr; } }
.rw-stage { position: relative; display: grid; place-items: center; padding: 1rem 0; }
.rw-wheel-wrap { position: relative; width: min(360px, 88vw); aspect-ratio: 1; }
.rw-wheel-wrap canvas[data-rw-wheel] { width: 100%; height: 100%; display: block; border-radius: 50%; box-shadow: 0 6px 24px rgba(19,24,32,.18), 0 0 0 6px var(--surface); }
.rw-pointer { position: absolute; top: -6px; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 24px solid var(--ink); filter: drop-shadow(0 2px 2px rgba(0,0,0,.25)); z-index: 2; }
canvas[data-rw-confetti] { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; }
.rw-winners { list-style: none; margin: 0; padding: 0; display: grid; gap: .4rem; max-height: 16rem; overflow-y: auto; }
.rw-winner { display: flex; align-items: center; gap: .6rem; padding: .5rem .7rem; border-radius: var(--radius-sm); background: var(--accent-soft); font-weight: 600; }
.rw-winner__n { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--accent); color: var(--accent-contrast); font-size: .78rem; flex: none; }
.rw-progress { font-size: .85rem; color: var(--ink-soft); }
.rw-announce { margin: .6rem 0 0; padding: .7rem 1.1rem; border-radius: var(--radius); background: var(--accent); color: var(--accent-contrast); font-weight: 700; font-size: 1.25rem; text-align: center; max-width: 100%; overflow-wrap: anywhere; }

.cp-stage canvas[data-sp-canvas] { background: repeating-conic-gradient(#e9edf2 0% 25%, #fff 0% 50%) 0 0 / 20px 20px; }

/* Herramientas de páginas de PDF */
.pt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .9rem; }
.pt-page { margin: 0; display: grid; gap: .3rem; justify-items: center; }
.pt-page__thumb { width: 100%; aspect-ratio: 3/4; border: 1px solid var(--line); border-radius: 8px; background: #fff; display: grid; place-items: center; overflow: hidden; }
.pt-page__thumb img { max-width: 88%; max-height: 88%; transition: transform .15s; }
.pt-page figcaption { font-size: .75rem; color: var(--ink-faint); }
.pt-page__controls { display: flex; gap: .3rem; flex-wrap: wrap; justify-content: center; }
.pt-page--off .pt-page__thumb { opacity: .3; }

/* =============================================================
   11. Buscador rápido (Ctrl/⌘ + K)
   ============================================================= */
.palette {
  border: 0; padding: 0; background: transparent; color: var(--ink);
  width: min(660px, calc(100vw - 1.5rem)); max-width: none; max-height: none;
  margin: 11vh auto auto; overflow: visible;
}
.palette::backdrop { background: rgba(6, 11, 24, .58); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.palette[open] { animation: palIn .22s var(--ease-out); }
@keyframes palIn { from { opacity: 0; transform: translateY(-10px) scale(.985); } to { opacity: 1; transform: none; } }
.palette__box {
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; overflow: hidden;
  box-shadow: 0 40px 90px -24px rgba(2, 6, 23, .6), 0 0 0 1px rgba(255, 255, 255, .04);
}
.palette__field { display: flex; align-items: center; gap: .8rem; padding: 0 1.1rem; border-bottom: 1px solid var(--line); }
.palette__field svg { width: 20px; height: 20px; flex: none; color: var(--ink-faint); }
.palette__input { flex: 1; min-width: 0; height: 60px; border: 0; background: transparent; font: inherit; font-size: 1.08rem; color: inherit; outline: none; }
.palette__input::placeholder { color: var(--ink-faint); }
.palette__field kbd, .palette__hint kbd {
  font-family: var(--mono); font-size: .72rem; font-weight: 600; padding: .14rem .45rem; border-radius: 7px;
  color: var(--ink-faint); background: var(--surface-2); border: 1px solid var(--line);
}
.palette__list { list-style: none; margin: 0; padding: .5rem; max-height: min(50vh, 400px); overflow-y: auto; }
.palette__group { padding: .65rem .8rem .3rem; font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.palette__item { display: flex; align-items: center; gap: .85rem; padding: .6rem .8rem; border-radius: 13px; color: inherit; }
.palette__item[aria-selected="true"] { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.palette__icon {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px;
  background: hsl(var(--cat-h) var(--cbs) var(--cbl)); color: hsl(var(--cat-h) var(--cfs) var(--cfl));
}
.palette__icon svg { width: 19px; height: 19px; }
.palette__text { display: grid; min-width: 0; flex: 1; }
.palette__text strong { font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__text small { font-size: .8rem; color: var(--ink-soft); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette__cat { flex: none; font-size: .72rem; font-weight: 650; color: var(--ink-faint); padding: .15rem .55rem; border-radius: 99px; border: 1px solid var(--line); }
.palette__empty { margin: 0; padding: 2rem 1rem; text-align: center; color: var(--ink-soft); }
.palette__hint { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; padding: .7rem 1.1rem; border-top: 1px solid var(--line); font-size: .76rem; color: var(--ink-faint); background: color-mix(in srgb, var(--surface-2) 60%, var(--surface)); }
.palette__hint span { display: inline-flex; align-items: center; gap: .35rem; }
@media (max-width: 560px) { .palette { margin-top: 5vh; } .palette__cat, .palette__hint { display: none; } }
@media print { .palette { display: none !important; } }

/* Barra de progreso de lectura en el borde de la cabecera (solo navegadores con animación ligada al scroll) */
@supports (animation-timeline: scroll()) {
  .site-header::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; pointer-events: none;
    background: var(--grad-brand); transform: scaleX(0); transform-origin: left;
    animation: readProgress linear both; animation-timeline: scroll(root);
  }
  @keyframes readProgress { to { transform: scaleX(1); } }
}
@media print { .site-header::after { display: none; } }

/* =============================================================
   12. Publicidad
   Reglas que sigue el diseño: siempre etiquetada («Publicidad»), separada del contenido y de los
   botones (nunca pegada a un control), con altura reservada para no mover la página, sin anuncios
   en la parte alta (la herramienta va primero) ni en páginas sin contenido propio (404, avisos legales).
   ============================================================= */
.ad { display: block; margin: clamp(2.2rem, 5vw, 3.4rem) auto; max-width: 970px; text-align: center; contain: layout; }
.ad__label { display: block; margin-bottom: .55rem; font-size: .66rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }
.ad__box { position: relative; display: grid; place-items: center; min-height: 280px; border-radius: 16px; overflow: hidden; }
.ad--wide .ad__box { min-height: 110px; }
@media (max-width: 720px) { .ad--wide .ad__box { min-height: 250px; } }
.ad ins.adsbygoogle { width: 100%; }

/* Hueco de muestra (modo «placeholder») */
.ad__demo {
  display: grid; place-content: center; gap: .3rem; width: 100%; min-height: inherit; padding: 1.4rem;
  border: 1.5px dashed var(--line-strong); border-radius: 16px; color: var(--ink-faint);
  background: repeating-linear-gradient(135deg, transparent 0 14px, color-mix(in srgb, var(--ink) 3.5%, transparent) 14px 15px);
}
.ad__demo strong { font-family: var(--display); font-size: 1rem; color: var(--ink-soft); }
.ad__demo span { font-size: .8rem; }

/* Sin anuncio servido: el hueco se pliega en vez de dejar una caja vacía */
.ad:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

/* Anuncio dentro del catálogo de la portada */
.cat-ad { margin-block: 2.6rem; }
.cat-ad .ad { margin-block: 0; }
.is-searching .cat-ad, .is-searching .home-ad { display: none; }

/* Columnas laterales fijas 160×600: solo donde sobra sitio a los lados del contenido */
.ad-rail { display: none; }
@media (min-width: 1560px) {
  .ad-rail { display: block; position: fixed; top: 148px; width: 160px; z-index: 1; }
  .ad-rail--left { left: calc(50% - 590px - 24px - 160px); }
  .ad-rail--right { right: calc(50% - 590px - 24px - 160px); }
  .ad-rail .ad { margin: 0; max-width: 160px; }
  .ad-rail .ad__box { min-height: 600px; width: 160px; }
  .ad-rail .ad__demo { padding: .8rem; }
}
@media print { .ad, .ad-rail, .cat-ad { display: none !important; } }


/* Bloque de enlaces entre herramientas del mismo grupo (conversiones, tamaños, unidades…) */
.cluster__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.cluster__list a {
  display: inline-block; padding: .45rem .9rem; border-radius: 99px; font-size: .88rem; font-weight: 560; color: var(--ink-soft);
  background: var(--surface); border: 1px solid var(--line);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out), transform .3s var(--ease-soft);
}
.cluster__list a:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-2px); }
.cluster__list .cluster__main { color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
@media (max-width: 719px) { .cluster__list a { padding: .7rem 1rem; } }

/* --- Páginas de categoría (hubs) y datos de la página --- */
.page-meta { margin: .9rem 0 0; text-align: center; font-size: .8rem; color: var(--ink-faint); }
.hub-groups { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); }
.hub-group {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem 1.2rem;
  box-shadow: var(--shadow-sm, 0 1px 2px rgb(15 23 42 / .05));
}
.hub-group h3 { font-size: 1rem; font-weight: 650; letter-spacing: -.01em; margin: 0 0 .7rem; }
.hub-group h3 a { color: var(--ink); text-decoration: none; }
.hub-group h3 a:hover { color: var(--accent-ink); }
.hub-group ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.hub-group li a {
  display: inline-block; padding: .3rem .72rem; font-size: .84rem; border: 1px solid var(--line); border-radius: 999px;
  color: var(--ink-soft); text-decoration: none; background: var(--surface-2);
  transition: border-color .15s, color .15s, transform .15s;
}
.hub-group li a:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.hub-group__more a { color: var(--accent-ink); border-style: dashed; background: transparent; font-weight: 600; }
@media (max-width: 719px) { .hub-group li a { padding: .5rem .85rem; } }
.cat-block__hub { order: 10; font-size: .82rem; font-weight: 600; color: var(--accent-ink); white-space: nowrap; text-decoration: none; }
.cat-block__hub::after { content: " →"; }
.cat-block__hub:hover { text-decoration: underline; text-underline-offset: 3px; }

/* =============================================================
   El muelle: fijar herramientas, siguiente paso, pegar/soltar, contador en vivo
   ============================================================= */
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin-top: .9rem; }
.pin-btn {
  font: inherit; font-size: .82rem; font-weight: 600; padding: .4rem .95rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.pin-btn:hover { border-color: var(--accent); color: var(--accent-ink); transform: translateY(-1px); }
.pin-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); color: var(--accent-ink); }
.pin-btn--quiet { background: transparent; }
.pin-btn:focus-visible, .live-badge:focus-visible, .nextstep__chip:focus-visible, .smart__chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (max-width: 719px) { .pin-btn { padding: .6rem 1rem; } }

.home-dock { padding-top: 1.2rem; }
.dock-label { margin: 1.3rem 0 .6rem; font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); font-weight: 650; }
.dock-stats { margin-top: 1rem; font-size: .86rem; color: var(--ink-soft); }
.dock-actions { margin-top: .8rem; }
.tool-tile--pinned { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }

.live-badge { display: inline-flex; align-items: center; gap: .1rem; }
.live-dot { flex: none; margin-right: .4rem; width: .5rem; height: .5rem; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 25%, transparent); }
.live-panel {
  max-width: 560px; margin: .8rem auto 0; padding: .85rem 1.1rem; border-radius: 14px; text-align: left;
  border: 1px solid var(--line); background: var(--surface); font-size: .86rem; color: var(--ink-soft);
}
.live-panel p + p { margin-top: .4rem; }
.live-panel strong { color: var(--ink); }

.nextstep {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem; z-index: 60;
  display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem;
  width: max-content; max-width: min(780px, calc(100vw - 1.6rem)); padding: .75rem 1rem;
  border-radius: 16px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
}
.nextstep[hidden] { display: none; }
.nextstep__msg { font-size: .9rem; font-weight: 650; color: var(--ink); }
.nextstep__chips, .smart__chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.nextstep__chip, .smart__chip {
  display: inline-block; padding: .35rem .8rem; font-size: .84rem; font-weight: 600; border-radius: 999px; text-decoration: none;
  color: var(--accent-ink); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
  transition: transform .15s, border-color .15s;
}
.nextstep__chip:hover, .smart__chip:hover { transform: translateY(-1px); border-color: var(--accent); }
.nextstep__close { margin-left: auto; width: 2rem; height: 2rem; border-radius: 50%; border: 0; background: transparent; color: var(--ink-faint); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.nextstep__close:hover { color: var(--ink); background: var(--surface-2); }
@media (max-width: 719px) { .nextstep { bottom: .6rem; } .nextstep__chip, .smart__chip { padding: .55rem .9rem; } }

.smart-hint { margin: .9rem auto 0; max-width: 620px; font-size: .84rem; color: var(--ink-faint); text-align: center; }
.smart {
  max-width: 760px; margin: .9rem auto 0; padding: .9rem 1.1rem; border-radius: 16px; text-align: left;
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line)); box-shadow: var(--shadow);
}
.smart[hidden] { display: none; }
.smart__msg { font-size: .92rem; font-weight: 650; color: var(--ink); margin-bottom: .6rem; }
.is-dropping body::after {
  content: ""; position: fixed; inset: 10px; z-index: 70; pointer-events: none; border-radius: 20px;
  border: 2px dashed var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.handoff-note { margin-bottom: .8rem; }
/* Sitio reservado para lo que dock.js añade después de pintar (botón de privacidad y de favoritas):
   así la página no se mueve cuando aparecen (CLS). Alturas = las del botón ya montado. */
.tool-hero .hero-actions { min-height: 2.24rem; }
.wb-actions { min-height: 34px; }
@media (max-width: 719px) { .tool-hero .hero-actions { min-height: 2.64rem; } }
@media (pointer: coarse), (max-width: 720px) { .wb-actions { min-height: 44px; } }
@media print { .nextstep, .smart, .smart-hint, .hero-actions, .live-panel { display: none !important; } }

/* Mensaje de privacidad de la portada */
.home-privacy {
  display: flex; align-items: center; justify-content: center; gap: .6rem; flex-wrap: wrap;
  width: fit-content; max-width: 100%; margin: 1.6rem auto 0; padding: .6rem 1.1rem; border-radius: 999px; text-align: center;
  font-size: .92rem; font-weight: 600; color: var(--ink);
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line));
}
.home-privacy__icon { display: inline-grid; place-items: center; color: var(--accent-ink); }
.home-privacy a { color: var(--accent-ink); white-space: nowrap; }
@media (max-width: 719px) {
  .home-stats { grid-template-columns: repeat(2, 1fr); }
  .home-privacy { border-radius: 16px; font-size: .88rem; }
}

/* Siguiente paso: qué suele hacerse después de cada herramienta */
.chain { padding: 1.4rem 0 .2rem; }
.chain__title { font-size: 1.15rem; letter-spacing: -.01em; }
.chain__sub { margin-top: .2rem; font-size: .88rem; color: var(--ink-faint); }
.chain__list { list-style: none; margin: .9rem 0 0; padding: 0; display: grid; gap: .7rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.chain__item {
  display: grid; gap: .25rem; height: 100%; padding: .85rem 1rem; text-decoration: none; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm);
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.chain__item strong { font-size: .95rem; font-weight: 650; color: var(--ink); }
.chain__item strong::after { content: " →"; color: var(--accent); }
.chain__item span { font-size: .82rem; line-height: 1.45; color: var(--ink-soft); }
.chain__item:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow); }
.chain__item:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media print { .chain { display: none; } }

/* --- Menú de idiomas (cuando una página existe en 2 o más idiomas más) --- */
.lang-menu { position: relative; }
.lang-menu > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: inline-flex; align-items: center; gap: .4rem; height: 40px; padding: 0 .8rem;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-size: .84rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-menu > summary:hover, .lang-menu[open] > summary { border-color: var(--accent); color: var(--ink); }
.lang-menu > summary svg { flex: none; }
.lang-menu ul {
  position: absolute; z-index: 60; top: calc(100% + .4rem); right: 0; min-width: 9.5rem; margin: 0; padding: .35rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; box-shadow: 0 14px 34px -14px rgba(15, 23, 42, .35);
}
.lang-menu li a { display: block; padding: .5rem .7rem; border-radius: 8px; font-size: .9rem; font-weight: 560; color: var(--ink-soft); }
.lang-menu li a:hover, .lang-menu li a:focus-visible { background: var(--surface-2, rgba(127, 127, 127, .12)); color: var(--ink); }
@media (max-width: 720px) { .lang-menu > summary { min-height: 44px; } }

/* --- Botón de tema claro/oscuro (encabezado) --- */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; padding: 0; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink-soft);
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out), background .2s var(--ease-out);
}
.theme-toggle:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 720px) { .theme-toggle { width: 44px; height: 44px; } }

/* --- Botón «Instalar la app» (solo aparece si el navegador lo ofrece de verdad) --- */
.install-btn {
  display: inline-flex; align-items: center; gap: .4rem; flex: none; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink-soft);
  padding: .5rem .85rem; height: 40px; font: inherit; font-size: .84rem; font-weight: 600;
  transition: border-color .2s var(--ease-out), color .2s var(--ease-out);
}
.install-btn:hover { border-color: var(--accent); color: var(--ink); }
@media (max-width: 900px) { .install-btn { display: none; } }         /* en móvil, Chrome ya ofrece «Añadir a inicio» por su cuenta */

/* Cabecera de categoría en pantallas estrechas (≤ 480 px): el enlace «Ver toda la categoría» baja a su propia línea en vez de ensanchar la página */
@media (max-width: 480px) {
  .cat-block__head { flex-wrap: wrap; row-gap: .35rem; }
  .cat-block__head::after { display: none; }
  .cat-block__hub { flex-basis: 100%; order: 10; padding-left: calc(38px + .7rem); }
}

/* Resultados anchos (tablas pequeñas dentro de un resultado): se desplazan dentro de su caja en vez de ensanchar la página */
[data-calc-out] > *, .result { min-width: 0; }
.result--wide { overflow-x: auto; }

/* Cabecera en pantallas muy estrechas (≤ 400 px): el enlace de idioma muestra solo el código (EN/ES/FR) y el botón de tema se ajusta */
@media (max-width: 400px) {
  .site-nav { gap: .25rem; }
  .theme-toggle { width: 40px; height: 40px; }
  .site-nav .lang-switch { font-size: 0 !important; padding: .5rem .7rem !important; }
  .site-nav .lang-switch::after { content: attr(hreflang); text-transform: uppercase; font-size: .84rem; }
}

/* =============================================================
   DISEÑO v3 «Workshop» — papel cálido / tinta, acento verde azulado, titulares Bricolage Grotesque,
   escaparate interactivo en la portada y herramientas como ventanas de aplicación.
   Va al final de la hoja: redefine los tokens de arriba (claro y oscuro) y ajusta los componentes.
   ============================================================= */
:root {
  --display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --bg: #fafaf7; --surface: #ffffff; --surface-2: #f2f2ed;
  --ink: #0a0e13; --ink-soft: #414c59; --ink-faint: #5a6572;
  --line: #e6e6df; --line-strong: #d2d2c9;
  --accent: #00a98f; --accent-ink: #00705f; --accent-soft: #dff6f0; --accent-contrast: #ffffff;
  --btn-bg: #0a0e13; --btn-bg-hover: #1b222b;
  --grad-btn: linear-gradient(#0a0e13, #0a0e13); --grad-btn-hover: linear-gradient(#1b222b, #1b222b);
  --btn-glow: rgba(10, 14, 19, .32);
  --grad-brand: linear-gradient(135deg, #00a98f 0%, #6366f1 100%);
  --grad-text: linear-gradient(100deg, #007a68, #00a98f);
  --glass: color-mix(in srgb, #ffffff 82%, transparent);
  --radius: 14px; --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(10, 14, 19, .05);
  --shadow: 0 1px 2px rgba(10, 14, 19, .04), 0 12px 30px -14px rgba(10, 14, 19, .16);
  --shadow-lg: 0 2px 6px rgba(10, 14, 19, .05), 0 30px 60px -24px rgba(10, 14, 19, .28);
  --hl: color-mix(in srgb, var(--accent) 36%, transparent);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #08090c; --surface: #0f1217; --surface-2: #151a21;
    --ink: #eef1f5; --ink-soft: #a9b2bf; --ink-faint: #8993a1;
    --line: #1c222b; --line-strong: #2a323d;
    --accent: #2de0bf; --accent-ink: #5ff0d4; --accent-soft: #0d2925; --accent-contrast: #0a0e13;
    --btn-bg: #eef1f5; --btn-bg-hover: #ffffff;
    --grad-btn: linear-gradient(#eef1f5, #eef1f5); --grad-btn-hover: linear-gradient(#ffffff, #ffffff);
    --btn-glow: rgba(45, 224, 191, .35);
    --grad-text: linear-gradient(100deg, #5ff0d4, #a5b4fc);
    --glass: color-mix(in srgb, #0f1217 78%, transparent);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -14px rgba(0, 0, 0, .6);
    --shadow-lg: 0 6px 14px rgba(0, 0, 0, .4), 0 34px 64px -22px rgba(0, 0, 0, .7);
    --hl: color-mix(in srgb, var(--accent) 30%, transparent);
  }
}
:root[data-theme="dark"] {
  --bg: #08090c; --surface: #0f1217; --surface-2: #151a21;
  --ink: #eef1f5; --ink-soft: #a9b2bf; --ink-faint: #8993a1;
  --line: #1c222b; --line-strong: #2a323d;
  --accent: #2de0bf; --accent-ink: #5ff0d4; --accent-soft: #0d2925; --accent-contrast: #0a0e13;
  --btn-bg: #eef1f5; --btn-bg-hover: #ffffff;
  --grad-btn: linear-gradient(#eef1f5, #eef1f5); --grad-btn-hover: linear-gradient(#ffffff, #ffffff);
  --btn-glow: rgba(45, 224, 191, .35);
  --grad-text: linear-gradient(100deg, #5ff0d4, #a5b4fc);
  --glass: color-mix(in srgb, #0f1217 78%, transparent);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 14px 34px -14px rgba(0, 0, 0, .6);
  --shadow-lg: 0 6px 14px rgba(0, 0, 0, .4), 0 34px 64px -22px rgba(0, 0, 0, .7);
  --hl: color-mix(in srgb, var(--accent) 30%, transparent);
}

/* ---------- Tipografía ---------- */
h1, h2, h3 { font-family: var(--display); font-weight: 700; letter-spacing: -.035em; }
.section__head h2 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.5rem); letter-spacing: -.04em; }
.eyebrow { color: var(--accent-ink); letter-spacing: .14em; }
mark.hl { background: none; color: inherit; padding-inline: .06em; background-image: linear-gradient(transparent 62%, var(--hl) 62% 90%, transparent 90%); -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* ---------- Cabecera ---------- */
.site-header, .site-header.is-scrolled { background: color-mix(in srgb, var(--bg) 78%, transparent); border-bottom: 1px solid var(--line); box-shadow: none; }
.logo { letter-spacing: -.045em; }
.nav-search { border-radius: 999px; background: var(--surface); }
.lang-switch, .theme-toggle, .lang-menu > summary { border-radius: 999px; }

/* ---------- Botones ---------- */
.btn { border-radius: 12px; }
.btn--primary { box-shadow: 0 8px 22px -10px var(--btn-glow); }
.btn--primary:hover { box-shadow: 0 16px 30px -12px var(--btn-glow); }

/* ============================================================
   PORTADA
   ============================================================ */
.h3 { position: relative; isolation: isolate; overflow: clip; padding: clamp(1.6rem, 4vw, 3.2rem) 0 clamp(1.6rem, 3.4vw, 2.6rem); }
.h3::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(55% 60% at 82% 12%, color-mix(in srgb, var(--accent) 17%, transparent), transparent 70%),
    radial-gradient(40% 45% at 4% 92%, color-mix(in srgb, #6366f1 11%, transparent), transparent 70%),
    radial-gradient(color-mix(in srgb, var(--ink) 7%, transparent) 1px, transparent 1.3px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 55%, transparent); mask-image: linear-gradient(180deg, #000 55%, transparent);
}
.h3__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.6rem; align-items: center; }
.h3__copy, .stage { min-width: 0; }
@media (min-width: 980px) { .h3__grid { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); gap: 3.5rem; } }
.h3__eyebrow {
  display: inline-flex; align-items: center; gap: .55rem; margin: 0 0 .9rem; padding: .34rem .85rem .34rem .7rem;
  font-size: .8rem; font-weight: 650; color: var(--ink-soft); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 999px;
}
.h3__eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #22c55e; box-shadow: 0 0 0 4px color-mix(in srgb, #22c55e 22%, transparent); }
.h3 h1 { font-size: clamp(2.4rem, 1rem + 4.3vw, 4.1rem); line-height: 1.02; letter-spacing: -.048em; font-weight: 750; margin: 0 0 .9rem; }
.h3__lede { font-size: clamp(1.02rem, .96rem + .35vw, 1.2rem); color: var(--ink-soft); line-height: 1.5; max-width: 34em; margin: 0 0 1.4rem; text-wrap: pretty; }
.h3 .search-box { margin-inline: 0; max-width: 560px; }
.h3 .search-box .input { height: 62px; border-radius: 18px; border: 1.5px solid var(--ink); box-shadow: 0 14px 34px -16px rgba(10, 14, 19, .38); background: var(--surface); }
.h3 .search-box .input:focus { box-shadow: 0 0 0 4px var(--accent-soft), 0 14px 34px -16px rgba(10, 14, 19, .38); }
.h3 .home-hero__quick { justify-content: flex-start; margin-top: 1rem; }
.h3 .search-status, .h3 .smart-hint { text-align: left; }
.h3 .smart-hint { margin: .7rem 0 0; }
.trust-strip { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.4rem; margin: 1.6rem 0 0; padding: 0; font-size: .85rem; font-weight: 600; color: var(--ink-soft); }
.trust-strip li { display: inline-flex; align-items: center; gap: .45rem; }
.trust-strip svg { width: 18px; height: 18px; color: var(--accent-ink); flex: none; }

/* --- Escaparate: carrusel interactivo de herramientas --- */
.stage { position: relative; max-width: 540px; width: 100%; margin-inline: auto; }
.stage::before { content: ""; position: absolute; inset: 8% -6% -6% 10%; z-index: -1; border-radius: 34px; background: var(--grad-brand); opacity: .16; filter: blur(46px); }
.stage__win { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 20px; box-shadow: var(--shadow-lg); overflow: hidden; }
.stage__bar, .wb-bar { display: flex; align-items: center; gap: .8rem; padding: .7rem 1rem; background: var(--surface-2); border-bottom: 1px solid var(--line); font-size: .78rem; color: var(--ink-faint); }
.stage__dots, .wb-dots { display: inline-flex; gap: 6px; }
.stage__dots i, .wb-dots i { width: 10px; height: 10px; border-radius: 50%; background: #d8d8d0; }
.stage__dots i:nth-child(1), .wb-dots i:nth-child(1) { background: #ff5f57; }
.stage__dots i:nth-child(2), .wb-dots i:nth-child(2) { background: #febc2e; }
.stage__dots i:nth-child(3), .wb-dots i:nth-child(3) { background: #28c840; }
.stage__name, .wb-title { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); }
.stage__pause { margin-left: auto; width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.stage__pause:hover { color: var(--ink); border-color: var(--accent); }
.stage__pause svg { width: 14px; height: 14px; }
.stage__pause .i-play { display: none; } .stage__pause.is-paused .i-play { display: block; } .stage__pause.is-paused .i-pause { display: none; }
.stage__tabs { display: flex; gap: .25rem; padding: .5rem .6rem 0; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity; border-bottom: 1px solid var(--line); background: var(--surface); }
.stage__tabs::-webkit-scrollbar { display: none; }
.stage:not(.is-ready) .stage__tabs, .stage:not(.is-ready) .stage__pause { display: none; }
.stage__tab { position: relative; flex: none; display: inline-flex; align-items: center; gap: .45rem; padding: .55rem .8rem .65rem; border: 0; background: none; font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-faint); cursor: pointer; white-space: nowrap; border-radius: 10px 10px 0 0; scroll-snap-align: start; transition: color .2s, background .2s; }
.stage__tab svg { width: 18px; height: 18px; flex: none; }
.stage__tab:not(.is-active) span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stage__tab:not(.is-active) { padding-inline: .7rem; }
.stage__tab:hover { color: var(--ink); background: var(--surface-2); }
.stage__tab.is-active { color: var(--ink); }
.stage__tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stage__prog { position: absolute; left: .5rem; right: .5rem; bottom: 0; height: 2px; border-radius: 2px; background: var(--accent); transform-origin: left; transform: scaleX(0); }
.stage__tab.is-active .stage__prog { animation: stageProg var(--dur, 4.5s) linear forwards; }
.stage.is-paused .stage__prog { animation-play-state: paused; }
@keyframes stageProg { to { transform: scaleX(1); } }
.stage__panel { padding: 1.1rem 1.15rem 1.15rem; display: grid; gap: .9rem; min-height: 372px; grid-template-rows: 1fr auto; animation: stageIn .45s var(--ease-out); }
.stage__panel[hidden] { display: none; }
@keyframes stageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.sp__art { display: grid; align-content: center; gap: .8rem; }
.sp__foot { display: flex; align-items: center; justify-content: space-between; gap: .8rem; }
.sp__note { font-size: .74rem; color: var(--ink-faint); margin: 0; }
.sp__cta { display: inline-flex; align-items: center; gap: .45rem; padding: .55rem 1rem; border-radius: 10px; background: var(--btn-bg); color: var(--accent-contrast); font-size: .85rem; font-weight: 650; text-decoration: none; transition: transform .2s var(--ease-out); }
.sp__cta:hover { transform: translateY(-2px); }
.sp__cta svg { width: 14px; height: 14px; }
.sp__bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.sp__bar i { display: block; height: 100%; width: var(--w, 100%); border-radius: inherit; background: linear-gradient(90deg, var(--accent), #6366f1); transition: width .8s var(--ease-out); }
.sp__row { display: flex; align-items: center; gap: .8rem; font-size: .85rem; color: var(--ink-soft); }
.sp__row input[type="range"] { flex: 1; min-width: 0; accent-color: var(--accent); }
.sp__pct { font-weight: 700; color: var(--accent-ink); background: var(--accent-soft); padding: .2rem .6rem; border-radius: 999px; font-size: .8rem; }
.sp__big { font-family: var(--display); font-weight: 700; font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem); letter-spacing: -.05em; line-height: 1; }
.sp__big small { font-size: .38em; letter-spacing: 0; color: var(--ink-faint); font-weight: 600; margin-left: .4rem; }
.sp__sizes { display: flex; align-items: baseline; gap: .9rem; flex-wrap: wrap; }
.sp__old { font-size: 1.1rem; color: var(--ink-faint); text-decoration: line-through; }
.sp__chips { display: flex; gap: .4rem; flex-wrap: wrap; }
.sp__chips button, .sp__btn { font: inherit; font-size: .8rem; font-weight: 600; padding: .4rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-soft); cursor: pointer; }
.sp__chips button[aria-pressed="true"] { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); color: var(--accent-ink); }
.sp__btn { border-radius: 10px; }
.sp__btn--dark { background: var(--btn-bg); color: var(--accent-contrast); border-color: transparent; }
.sp__input { width: 100%; font: inherit; font-size: .95rem; padding: .7rem .9rem; border-radius: 12px; border: 1.5px solid var(--line-strong); background: var(--surface); color: var(--ink); }
.sp__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
/* miniaturas de los paneles */
.sp__photo { position: relative; height: 150px; border-radius: 16px; overflow: hidden; background: linear-gradient(160deg, #7dd3fc, #818cf8 60%, #c084fc); }
.sp__photo::after { content: ""; position: absolute; inset: auto -6% -6% -6%; height: 56%; background: rgba(255, 255, 255, .86); clip-path: polygon(0 100%, 24% 30%, 48% 76%, 70% 38%, 100% 100%); }
.sp__photo i { position: absolute; top: 18px; right: 22px; width: 24px; height: 24px; border-radius: 50%; background: #fde68a; }
.sp__photo span { position: absolute; z-index: 2; left: 12px; top: 12px; padding: .2rem .65rem; border-radius: 999px; background: rgba(10, 14, 19, .78); color: #fff; font-size: .74rem; font-weight: 700; }
.sp__pages { display: flex; align-items: flex-end; justify-content: center; gap: .6rem; height: 130px; }
.sp__pg { width: 74px; height: 100px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: 12px 9px; display: grid; align-content: start; gap: 6px; position: relative; transform-origin: bottom; transition: transform .8s var(--ease-out); }
.sp__pg i { display: block; height: 5px; border-radius: 3px; background: var(--line-strong); } .sp__pg i:first-child { width: 68%; background: hsl(var(--cat-h, 2) 75% 60% / .75); }
.sp__pg b { position: absolute; top: -8px; left: -8px; padding: .1rem .4rem; border-radius: 6px; background: #ef4444; color: #fff; font-size: .6rem; }
.sp__pg em { position: absolute; bottom: 6px; left: 0; right: 0; text-align: center; font-style: normal; font-size: .6rem; color: var(--ink-faint); font-family: var(--mono); }
.run .sp__pages .sp__pg { animation: pgSquash 1.1s var(--ease-out) both; }
@keyframes pgSquash { from { transform: scaleY(1.28); } to { transform: scaleY(1); } }
.mrg { position: relative; height: 150px; }
.mrg .sp__pg { position: absolute; top: 24px; left: calc(50% - 37px); }
.mrg .sp__pg:nth-child(1) { transform: translateX(-108px) rotate(-4deg); }
.mrg .sp__pg:nth-child(2) { transform: translateX(0); }
.mrg .sp__pg:nth-child(3) { transform: translateX(108px) rotate(4deg); }
.run .mrg .sp__pg:nth-child(1) { animation: mrg1 1.5s var(--ease-out) .25s both; }
.run .mrg .sp__pg:nth-child(3) { animation: mrg3 1.5s var(--ease-out) .25s both; }
.run .mrg .sp__pg:nth-child(2) { animation: mrg2 1.5s var(--ease-out) .25s both; }
@keyframes mrg1 { to { transform: translate(-6px, -6px) rotate(-2deg); } }
@keyframes mrg3 { to { transform: translate(6px, 6px) rotate(2deg); } }
@keyframes mrg2 { to { transform: translate(0, 0); } }
.mrg__tag { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); padding: .28rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .78rem; font-weight: 700; opacity: 0; white-space: nowrap; }
.run .mrg .mrg__tag { animation: fadeUp .5s var(--ease-out) 1.3s both; }
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
.cvt { display: grid; gap: .55rem; }
.cvt__row { display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-size: .84rem; }
.cvt__row .th { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(160deg, #fdba74, #f472b6); flex: none; }
.cvt__row b { font-weight: 650; } .cvt__row .ext { margin-left: auto; position: relative; width: 116px; height: 24px; }
.cvt__row .ext span { position: absolute; inset: 0; display: grid; place-items: center; border-radius: 8px; font-family: var(--mono); font-size: .74rem; font-weight: 700; }
.cvt__row .from { background: var(--surface-2); color: var(--ink-soft); } .cvt__row .to { background: var(--btn-bg); color: var(--accent-contrast); opacity: 0; }
.run .cvt .cvt__row .from { animation: cvFrom .5s ease both; } .run .cvt .cvt__row .to { animation: cvTo .5s ease both; }
.run .cvt .cvt__row:nth-child(1) .from, .run .cvt .cvt__row:nth-child(1) .to { animation-delay: .3s; }
.run .cvt .cvt__row:nth-child(2) .from, .run .cvt .cvt__row:nth-child(2) .to { animation-delay: .75s; }
.run .cvt .cvt__row:nth-child(3) .from, .run .cvt .cvt__row:nth-child(3) .to { animation-delay: 1.2s; }
@keyframes cvFrom { to { opacity: 0; transform: translateY(-8px); } } @keyframes cvTo { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.qrp { display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.qrp canvas { width: 156px; height: 156px; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
.qrp__ctl { display: grid; gap: .6rem; }
.pw__out { font-family: var(--mono); font-size: clamp(1.05rem, .9rem + 1vw, 1.4rem); font-weight: 600; letter-spacing: .02em; padding: 1rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); word-break: break-all; min-height: 4.2em; display: grid; align-items: center; }
.pw__meta { display: flex; align-items: center; justify-content: space-between; font-size: .8rem; color: var(--ink-soft); }
.pw__meta strong { color: var(--accent-ink); }
.pc { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; font-size: 1.05rem; }
.pc .sp__input { width: 5.5rem; text-align: center; font-weight: 700; padding: .6rem; }
.pc__res { font-family: var(--display); font-size: clamp(3rem, 2.4rem + 3vw, 4.4rem); font-weight: 700; letter-spacing: -.05em; line-height: 1; margin-top: .3rem; color: var(--accent-ink); }
@media (max-width: 420px) { .qrp { grid-template-columns: 1fr; } .qrp canvas { justify-self: center; } .sp__foot .sp__note { display: none; } .sp__cta { width: 100%; justify-content: center; } }
@media (prefers-reduced-motion: reduce) {
  .stage__prog, .stage__panel, .sp__bar i { animation: none !important; transition: none; }
  .stage__prog { display: none; }
  .run .sp__pages .sp__pg, .run .mrg .sp__pg, .run .mrg .mrg__tag, .run .cvt .cvt__row .from, .run .cvt .cvt__row .to { animation: none; }
  .mrg .sp__pg:nth-child(1) { transform: translate(-6px, -6px) rotate(-2deg); } .mrg .sp__pg:nth-child(3) { transform: translate(6px, 6px) rotate(2deg); } .mrg .sp__pg:nth-child(2) { left: calc(50% - 37px); }
  .mrg__tag { opacity: 1; } .cvt__row .from { opacity: 0; } .cvt__row .to { opacity: 1; }
}

/* --- Bento: las más usadas --- */
.bento { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .bento { grid-template-columns: repeat(12, 1fr); } .bento__tile { grid-column: span 3; } .bento__tile--xl { grid-column: span 6; grid-row: span 2; } .bento__tile--w { grid-column: span 4; } }
.bento__tile {
  position: relative; display: flex; flex-direction: column; gap: .5rem; padding: 1.15rem 1.2rem 1.2rem; min-height: 230px; overflow: hidden; isolation: isolate;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease-soft), box-shadow .35s var(--ease-soft), border-color .25s var(--ease-out);
}
.bento__tile::before { content: ""; position: absolute; inset: 0; z-index: -1; opacity: .9; background: radial-gradient(90% 70% at 100% 0%, hsl(var(--cat-h) 80% 60% / .13), transparent 70%); pointer-events: none; }
.bento__tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: hsl(var(--cat-h) 55% 50% / .55); }
.bento__tile--xl { min-height: 300px; }
.bento__art { flex: 1; display: grid; place-items: center; min-height: 110px; }
.bento__tile--xl .bento__art { min-height: 200px; }
.bento__head { display: grid; gap: .15rem; }
.bento__title { font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.03em; line-height: 1.2; }
.bento__tile--xl .bento__title { font-size: 1.6rem; }
.bento__desc { font-size: .86rem; color: var(--ink-soft); line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bento__go { z-index: 3; position: absolute; top: 1rem; right: 1rem; width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); transition: transform .3s var(--ease-out), background .2s; }
.bento__tile:hover .bento__go { background: var(--btn-bg); color: var(--accent-contrast); transform: rotate(-45deg); }
.bento__tile--all { justify-content: flex-end; background: linear-gradient(150deg, var(--accent-soft), var(--surface) 72%); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.bento__tile--all::before { background: radial-gradient(70% 70% at 100% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%); opacity: 1; }
.bento__tile--all .bento__title { color: var(--accent-ink); }
.bento__tile--all .bento__go { background: var(--accent); border-color: transparent; color: #04231d; }
/* miniaturas */
.art { display: flex; align-items: center; justify-content: center; gap: .8rem; width: 100%; }
.art__photo { position: relative; width: 112px; height: 84px; border-radius: 14px; overflow: hidden; background: linear-gradient(160deg, #7dd3fc, #818cf8 60%, #c084fc); box-shadow: var(--shadow); }
.art__photo::after { content: ""; position: absolute; inset: auto -8% -6% -8%; height: 58%; background: rgba(255, 255, 255, .85); clip-path: polygon(0 100%, 26% 28%, 50% 74%, 72% 38%, 100% 100%); }
.art__photo i { position: absolute; top: 12px; right: 14px; width: 16px; height: 16px; border-radius: 50%; background: #fde68a; }
.art__photo--sm { transform: scale(.78); }
@media (min-width: 1000px) { .bento__tile--xl .art { transform: scale(1.55); } }
.bento__tile--xl .art__photo { box-shadow: 0 18px 30px -14px rgba(10, 14, 19, .35); }
.art__tag { position: absolute; left: 8px; bottom: 8px; z-index: 1; padding: .12rem .5rem; border-radius: 999px; font-size: .7rem; font-weight: 700; background: rgba(10, 14, 19, .78); color: #fff; }
.art__tag--ok { background: #16a34a; }
.art__arrow { font-size: 1.4rem; color: var(--ink-faint); }
.art__page { position: relative; width: 66px; height: 88px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow); padding: 12px 9px; display: grid; align-content: start; gap: 6px; }
.art__page i { display: block; height: 5px; border-radius: 3px; background: var(--line-strong); }
.art__page i:nth-child(1) { width: 70%; background: hsl(var(--cat-h) 70% 60% / .7); }
.art__page i:nth-child(4) { width: 55%; }
.art__page b { position: absolute; top: -9px; left: -9px; padding: .1rem .42rem; border-radius: 6px; background: #ef4444; color: #fff; font-size: .62rem; letter-spacing: .04em; }
.art__page--f { transform: rotate(-7deg) translateX(14px); } .art__page--m { transform: translateY(-5px); z-index: 1; } .art__page--b { transform: rotate(7deg) translateX(-14px); }
.bento__tile .art:has(.art__page--f) { transform: scale(.94); }
.art__chip { padding: .28rem .75rem; border-radius: 999px; font-size: .78rem; font-weight: 700; background: var(--accent-soft); color: var(--accent-ink); }
.art__pill { padding: .5rem .85rem; border-radius: 12px; font-family: var(--mono); font-size: .82rem; font-weight: 600; background: var(--surface-2); border: 1px solid var(--line-strong); }
.art__pill--to { background: var(--btn-bg); color: var(--accent-contrast); border-color: transparent; }
.art__qr { width: 88px; height: 88px; padding: 8px; background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.art__pw { display: grid; gap: .5rem; font-family: var(--mono); font-size: 1.05rem; font-weight: 600; letter-spacing: .04em; }
.art__pw span { color: var(--ink-faint); letter-spacing: .12em; }
.art__pw em { display: block; height: 6px; border-radius: 4px; background: linear-gradient(90deg, #22c55e 0 82%, var(--line) 82%); }
.art__code { font-family: var(--mono); font-size: .78rem; line-height: 1.55; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-soft); white-space: pre; }
.art__code b { color: var(--accent-ink); font-weight: 600; } .art__code u { text-decoration: none; color: #f59e0b; }

/* --- Categorías y tarjetas --- */
.cat-chip { border-radius: 999px; background: var(--surface); }
.cat-block__title { font-size: 1.5rem; letter-spacing: -.04em; }
.tool-tile { border-radius: 16px; box-shadow: none; }
.tool-tile__icon { background: hsl(var(--cat-h) var(--cbs) var(--cbl)); box-shadow: none; border-radius: 11px; width: 42px; height: 42px; }
a.tool-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.trust__item { border-radius: 18px; }
.section--band { background: var(--surface); }

/* ============================================================
   HERRAMIENTA: la herramienta es una ventana de aplicación
   ============================================================ */
.tool-hero { position: relative; isolation: isolate; padding: clamp(1.4rem, 4vw, 2.4rem) 0 1.4rem; overflow: visible; }
.tool-hero::before { display: block; content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; height: auto;
  background:
    radial-gradient(50% 90% at 50% -20%, color-mix(in srgb, var(--accent) 14%, transparent), transparent 70%),
    radial-gradient(color-mix(in srgb, var(--ink) 6%, transparent) 1px, transparent 1.3px) 0 0 / 22px 22px;
  -webkit-mask-image: linear-gradient(180deg, #000 60%, transparent); mask-image: linear-gradient(180deg, #000 60%, transparent); }
.tool-hero::after { display: none; }
.tool-hero .container { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .4rem .5rem; }
.tool-hero .breadcrumb, .tool-hero h1, .tool-hero .lede { flex: 0 0 100%; }
.tool-hero .breadcrumb { margin: 0 0 .5rem; font-size: .78rem; }
.tool-hero h1 { font-size: clamp(2rem, 1.15rem + 3vw, 3.3rem); line-height: 1.04; letter-spacing: -.045em; font-weight: 750; margin: 0 0 .5rem; }
.tool-hero .lede { font-size: 1.05rem; max-width: none; padding-inline: max(0px, calc((100% - 56ch) / 2)); margin: 0 0 .8rem; text-wrap: pretty; color: var(--ink-soft); }
.tool-hero .hero-badges, .tool-hero .hero-actions { margin: 0; }
.tool-hero .hero-badges li:nth-child(3) { display: none; }

.tool-card { --tc-pad: clamp(1.1rem, 3vw, 1.8rem); padding: var(--tc-pad); border-radius: 22px; border-color: var(--line-strong); box-shadow: var(--shadow-lg); gap: 1.05rem; }
.tool-card::before { display: none; }
.tool-card > .wb-bar { margin: calc(var(--tc-pad) * -1) calc(var(--tc-pad) * -1) 0; border-radius: 21px 21px 0 0; order: -9; }
.tool-card .dropzone { padding: clamp(2.2rem, 6vw, 3.6rem) 1.2rem; border: 2px dashed var(--line-strong); border-radius: 18px; gap: .6rem;
  background: radial-gradient(color-mix(in srgb, var(--ink) 8%, transparent) 1px, transparent 1.2px) 0 0 / 16px 16px, var(--surface); }
.tool-card .dropzone:hover, .tool-card .dropzone[data-drag="true"] { border-color: var(--accent); background-color: var(--accent-soft); }
/* herramientas de imagen que se recalculan al cambiar una opción: la zona de soltar va primero, las opciones debajo */
.tool-card[data-drop-first] > .dropzone { order: -3; }
.tool-card[data-drop-first] > [data-hoist] { order: -2; }
.tool-card > .opts-title { order: -1; display: flex; align-items: center; gap: .7rem; margin: .3rem 0 -.2rem; font-size: .72rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); }
.tool-card > .opts-title::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.dropzone__icon { width: 30px; height: 30px; padding: 15px; border-radius: 18px; }
.dropzone__title { font-family: var(--display); font-size: 1.3rem; letter-spacing: -.03em; font-weight: 650; }
.dropzone__btn { display: inline-flex; align-items: center; justify-content: center; margin-top: .3rem; padding: .75rem 1.6rem; min-height: 46px; border-radius: 12px; font-weight: 650; background: var(--grad-btn); color: var(--accent-contrast); box-shadow: 0 10px 24px -10px var(--btn-glow); transition: transform .2s var(--ease-out); }
.dropzone:hover .dropzone__btn { transform: translateY(-2px); }
.step__n { color: var(--accent-ink); }


/* barra de la ventana de herramienta: título a la izquierda y «Añadir a favoritas» a la derecha */
.wb-actions { margin-left: auto; display: inline-flex; align-items: center; gap: .4rem; }
.wb-bar .pin-btn { padding: .3rem .8rem; font-size: .78rem; background: var(--surface); }
.wb-bar .pin-btn:hover { transform: none; }
@media (max-width: 520px) { .wb-title { display: none; } }


/* Split PDF: seis páginas que se separan en dos archivos */
.spl { display: grid; gap: .8rem; }
.spl__pgs { position: relative; display: flex; justify-content: center; align-items: flex-end; gap: 6px; height: 118px; }
.spl__pg { position: relative; width: 50px; height: 76px; border-radius: 6px; background: var(--surface); border: 1px solid var(--line-strong); box-shadow: var(--shadow-sm); padding: 9px 7px; display: grid; align-content: start; gap: 5px; transition: transform .7s var(--ease-out); }
.spl__pg i { display: block; height: 4px; border-radius: 2px; background: var(--line-strong); } .spl__pg i:first-child { width: 66%; background: hsl(2 75% 60% / .75); }
.spl__pg em { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: normal 700 .62rem var(--mono); color: var(--ink-faint); }
.spl.is-split .spl__pg.l { transform: translateX(-14px) rotate(-3deg); } .spl.is-split .spl__pg.r { transform: translateX(14px) rotate(3deg); }
.spl__cut { position: absolute; top: -6px; bottom: -6px; width: 0; border-left: 2px dashed #ef4444; opacity: 0; left: calc(50% + (var(--cut) - 3) * 56px - 1px); transform: scaleY(0); transform-origin: top; transition: transform .35s var(--ease-out), opacity .2s; }
.spl:not(.is-split) .spl__cut { opacity: 1; transform: scaleY(1); }
.spl__parts { display: flex; justify-content: center; gap: .7rem; flex-wrap: wrap; }
.spl__tag { padding: .28rem .8rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: .76rem; font-weight: 700; opacity: 0; transition: opacity .4s .25s; }
.spl.is-split .spl__tag { opacity: 1; }
@media (prefers-reduced-motion: reduce) { .spl__pg, .spl__tag, .spl__cut { transition: none; } }

/* Objetivos táctiles del escaparate y de la barra de la herramienta */
.sp__chips button, .sp__btn, .wb-bar .pin-btn, .stage__tab { min-height: 34px; }
@media (pointer: coarse), (max-width: 720px) { .sp__chips button, .sp__btn, .wb-bar .pin-btn, .stage__tab, .stage__pause { min-height: 44px; } .stage__pause { min-width: 44px; } .sp__cta { min-height: 44px; } }

/* El pie sigue el tema: claro en modo claro (sin caja oscura) y oscuro en modo oscuro */
.site-footer { --f-ink: var(--ink); --f-soft: var(--ink-soft); --f-faint: var(--ink-faint); --f-line: var(--line); background: var(--surface-2); border-top: 1px solid var(--line); }
.site-footer::after { opacity: .45; }
.site-footer .logo span em { color: var(--accent-ink); }
.site-footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.site-footer :focus-visible { outline-color: var(--accent); }
