/* ==========================================================================
   MicroSAS – hoja de estilos principal
   ========================================================================== */
/* Plus Jakarta Sans (variable, autoalojada: no se llama a Google Fonts). Licencia OFL en assets/fonts/PlusJakartaSans-OFL.txt */
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/plus-jakarta-sans-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Plus Jakarta Sans"; font-style: normal; font-display: swap; font-weight: 200 800; src: url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2-variations"), url("../fonts/plus-jakarta-sans-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* Temas: claro por defecto; oscuro si el sistema lo pide y no se ha elegido «claro» con el botón (data-theme en <html>),
   o si se ha elegido «oscuro». Los dos bloques oscuros deben ser idénticos. */
:root {
  --bg: #f6f7fc;
  --surface: #ffffff;
  --surface-2: #f0f1f8;
  --text: #0e1230;
  --muted: #4d5370;
  --line: #e3e5ef;
  --primary: #4f46e5;
  --primary-600: #4338ca;
  --primary-50: #eef2ff;
  --accent: #0ea5e9;
  --ok: #15803d;   /* verde y ámbar oscurecidos: contraste AA como texto sobre blanco */
  --warn: #b45309;
  --err: #dc2626;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 16px -4px rgba(15, 23, 42, .08);
  --shadow-hover: 0 2px 4px rgba(15, 23, 42, .05), 0 16px 32px -12px rgba(15, 23, 42, .22);
  --shadow-lg: 0 20px 60px rgba(15, 23, 42, .18);
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --on-primary: #fff; --ok-btn: #15803d; --on-ok: #fff;
  --brand-logo: #0b24f0;
  --ad-bg: #d4d4d8; --ad-fg: #3f3f46; --ad-line: #a1a1aa;
  --warn-strong: inherit;
  --err-strong: var(--err);
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6478' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0a0f1d; --surface: #111829; --surface-2: #182136; --text: #e8ecf5; --muted: #9aa4bb; --line: #243049;
    --primary: #818cf8; --primary-600: #a5b4fc; --primary-50: #1c2246;
    --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px -4px rgba(0, 0, 0, .35);
    --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 36px -12px rgba(0, 0, 0, .6);
    /* Contraste WCAG AA sobre fondo oscuro: verde y rojo más claros y texto oscuro sobre los botones de color */
    --ok: #4ade80; --err: #f87171; --on-primary: #0b1020; --ok-btn: #4ade80; --on-ok: #052e16;
    --brand-logo: #4d62ff;
    --ad-bg: #3f3f46; --ad-fg: #e4e4e7; --ad-line: #52525b;
    --warn-strong: #fbbf24; --err-strong: #f87171;
    --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa4bb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0a0f1d; --surface: #111829; --surface-2: #182136; --text: #e8ecf5; --muted: #9aa4bb; --line: #243049;
  --primary: #818cf8; --primary-600: #a5b4fc; --primary-50: #1c2246;
  --shadow: 0 1px 2px rgba(0, 0, 0, .35), 0 4px 16px -4px rgba(0, 0, 0, .35);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, .35), 0 18px 36px -12px rgba(0, 0, 0, .6);
  --ok: #4ade80; --err: #f87171; --on-primary: #0b1020; --ok-btn: #4ade80; --on-ok: #052e16;
  --brand-logo: #4d62ff;
  --ad-bg: #3f3f46; --ad-fg: #e4e4e7; --ad-line: #52525b;
  --warn-strong: #fbbf24; --err-strong: #f87171;
  --chev: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239aa4bb' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--text); background: var(--bg); overflow-x: hidden; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
/* Texto solo para lectores de pantalla */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
img, svg, canvas, video { max-width: 100%; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
/* Enlaces dentro de un texto: subrayados, para que no se distingan solo por el color (accesibilidad, WCAG 1.4.1) */
:is(.idea p, .prose, .faq__a, .legal p, .legal li, .lead, .step p) a:not(.btn):not(.chip) { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.75rem, 4.5vw, 2.6rem); letter-spacing: -.028em; }
h2 { font-size: clamp(1.35rem, 3vw, 1.8rem); letter-spacing: -.02em; }
h3 { font-size: 1.08rem; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { width: 100%; max-width: 1372px; margin: 0 auto; padding: 0 20px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }
.skip { position: absolute; left: -999px; top: 0; background: var(--primary); color: var(--on-primary); padding: 8px 12px; z-index: 100; }
.skip:focus { left: 8px; }
.ico { flex: none; vertical-align: middle; }
[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 1.15rem; }
.brand:hover { text-decoration: none; }
/* El logo nunca se encoge: si el traductor del navegador alarga los textos del menú, cede el menú, no la marca */
.brand { flex-shrink: 0; }
.brand__name { letter-spacing: -.02em; }
.brand__logo { color: var(--brand-logo); display: inline-flex; flex-shrink: 0; }
.brand__logo svg { flex-shrink: 0; }
/* Menú principal («Herramientas» abre el megamenú). Por debajo de 900 px lo sustituye el botón de menú */
.mainnav { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.mainnav__link { font: inherit; font-size: .97rem; font-weight: 650; color: var(--text); background: none; border: 0; padding: 10px 14px; border-radius: 10px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.mainnav__link:hover, .mainnav__link[aria-expanded="true"] { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav + .langmenu { margin-left: 12px; }
/* Botones de la cabecera: idioma, tema y menú */
.langbtn, .navtoggle, .themebtn { flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 8px; font: inherit; font-size: .92rem; font-weight: 650; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; height: 40px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.langbtn:hover, .navtoggle:hover, .themebtn:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.mainnav__link:focus-visible, .themebtn:focus-visible, .mega__theme:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 1px; }
.langbtn { font-size: .9rem; font-weight: 800; letter-spacing: .04em; text-decoration: none; gap: 6px; }
.themebtn { width: 40px; padding: 0; justify-content: center; }
/* Icono del tema: sol en claro, luna en oscuro (en el botón de la cabecera y en el del menú móvil) */
[data-theme-toggle] .ico-moon, :root[data-theme="dark"] [data-theme-toggle] .ico-sun { display: none; }
:root[data-theme="dark"] [data-theme-toggle] .ico-moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) [data-theme-toggle] .ico-sun { display: none; }
  :root:not([data-theme="light"]) [data-theme-toggle] .ico-moon { display: inline; }
}
/* Selector de idioma */
.langmenu { position: relative; flex: none; }
.langmenu > summary { list-style: none; }
.langmenu > summary::-webkit-details-marker { display: none; }
.langmenu[open] > summary { border-color: var(--primary); color: var(--primary); }
.langmenu__list { position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; min-width: 220px; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lg); animation: pop .16s ease; }
.langmenu__list a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; color: var(--text); font-weight: 600; font-size: .95rem; text-decoration: none; }
.langmenu__list a:hover { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.langmenu__list a[aria-current] { background: var(--primary-50); color: var(--primary); }
.langmenu__list a[aria-current]::after { content: "✓"; margin-left: auto; font-weight: 800; }
.langmenu__code { display: inline-flex; justify-content: center; min-width: 30px; font-size: .72rem; font-weight: 800; letter-spacing: .04em; padding: 3px 6px; border-radius: 6px; background: var(--surface-2); color: var(--muted); }
.navtoggle { display: none; padding: 0 9px; }

.mega { position: absolute; left: 0; right: 0; top: 100%; z-index: 45; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: 0 24px 48px rgba(15, 23, 42, .14); max-height: calc(100vh - 60px); overflow-y: auto; animation: megain .18s ease; }
@keyframes megain { from { opacity: 0; transform: translateY(-6px); } }
.mega__in { padding-top: 18px; padding-bottom: 22px; }
.mega__search { display: flex; align-items: center; gap: 10px; padding: 0 6px 0 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); color: var(--muted); margin-bottom: 18px; }
.mega__search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.mega__search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 1.02rem; color: var(--text); padding: 12px 0; outline: none; }
.mega__close { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.mega__close:hover { background: var(--surface); color: var(--text); }
.mega__grid { columns: 4 230px; column-gap: 24px; }
.mega__col { break-inside: avoid; margin-bottom: 18px; }
.mega__h { font-size: .74rem; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); font-weight: 750; margin: 0 0 6px 10px; }
.mega__col ul { list-style: none; margin: 0; padding: 0; }
.mega__col a { display: flex; gap: 11px; align-items: flex-start; padding: 8px 10px; border-radius: 10px; color: var(--text); }
.mega__col a:hover, .mega__col a:focus-visible { background: var(--surface-2); text-decoration: none; outline: none; }
.mega__col a[aria-current="page"] { background: var(--primary-50); }
.mega__col a strong { display: block; font-size: .93rem; font-weight: 650; line-height: 1.3; }
.mega__col a small { display: block; font-size: .8rem; color: var(--muted); line-height: 1.35; margin-top: 1px; }
.mega__ico { display: inline-flex; flex: none; padding: 7px; border-radius: 9px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); }
.mega-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(15, 23, 42, .35); }
body.mega-open { overflow: hidden; }
/* Modo oscuro dentro del menú: solo en móvil, donde la cabecera no tiene sitio para el botón */
.mega__theme { display: none; width: 100%; align-items: center; gap: 12px; margin: 0 0 18px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 650; text-align: left; cursor: pointer; }
.mega__theme:hover { background: var(--surface-2); }
.mega__theme .ico { color: var(--primary); }
.mega__theme-label { flex: 1; }
.mega__theme-state { font-size: .88rem; font-weight: 700; color: var(--muted); }
.mega__theme[aria-pressed="true"] .mega__theme-state { color: var(--primary); }

@media (max-width: 900px) {
  .mainnav { display: none; }
  .navtoggle { display: inline-flex; }
  .langmenu, .mainnav + .langmenu { margin-left: auto; }
}
@media (max-width: 640px) {
  .themebtn { display: none; }
  .mega__theme { display: flex; }
  .navtoggle { width: 44px; height: 44px; justify-content: center; }
  .langbtn { height: 44px; }
  /* absolute + altura explícita: el backdrop-filter del header rompe position:fixed en sus hijos */
  .mega { position: absolute; top: 100%; height: calc(100vh - 64px); height: calc(100dvh - 64px); max-height: none; box-shadow: none; overscroll-behavior: contain; }
  .mega__grid { columns: 1; }
  .mega__col a small { display: none; }
}

/* ---------- Cabecera de página (general: herramientas, páginas informativas y errores) ----------
   Alineada a la izquierda: migas, icono + título (herramientas), entradilla y ventajas. La portada la ajusta más abajo. */
.hero { position: relative; isolation: isolate; overflow: hidden; padding: 30px 0 26px; text-align: left; }
.hero h1 { margin: 0 0 8px; font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.1; letter-spacing: -.03em; }
.lead { font-size: 1.12rem; color: var(--muted); max-width: 720px; margin: 0 auto 16px; }
.hero .lead { margin: 0 0 16px; max-width: 860px; font-size: clamp(1.05rem, 1.6vw, 1.22rem); line-height: 1.5; }
.hero .lead strong { color: var(--text); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: .9rem; color: var(--muted); margin: 0 0 16px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--primary); }
.toolhead { display: flex; align-items: center; gap: 16px; margin-bottom: 8px; }
.toolhead h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.hero__ico { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 58px; height: 58px; border-radius: 14px; background: color-mix(in srgb, var(--primary) 9%, var(--surface)); color: var(--primary); }
.hero__ico .ico { stroke-width: 1.6; }
.badges { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 22px; }
.badges li { display: inline-flex; align-items: center; gap: 8px; font-size: .98rem; font-weight: 650; color: var(--muted); }
.badges .ico { color: var(--primary); }
@media (max-width: 640px) {
  .hero { padding: 20px 0 18px; }
  .toolhead { gap: 12px; }
  .hero__ico { width: 46px; height: 46px; border-radius: 12px; }
  .hero__ico .ico { width: 24px; height: 24px; }
  .badges { gap: 6px 16px; }
  .badges li { font-size: .92rem; }
}

/* ---------- Tarjetas ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(14, 18, 48, .04); }
.grid { display: grid; gap: 16px; }

/* ---------- Tool area ---------- */
.toolwrap { margin-top: 8px; }
.tool { padding: 22px; }
.tool.card { border-radius: 14px; }
@media (max-width: 640px) { .tool { padding: 14px; } }
.tool h2 { font-size: 1.2rem; }
/* Zona de arrastre: barra compacta y sobria (icono · texto · botón). app.js agrupa el texto en .dropzone__txt y añade
   el botón; si el recuadro es estrecho, el botón baja a su propia línea a todo el ancho (consulta de contenedor). */
.dropzone { position: relative; container-type: inline-size; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 18px 20px; border: 1px dashed color-mix(in srgb, var(--muted) 55%, var(--line)); border-radius: var(--radius-sm); background: var(--surface); text-align: left; cursor: pointer; transition: background .15s, border-color .15s; }
.dropzone:hover { border-color: var(--primary); }
.dropzone.is-over { border-style: solid; border-color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.dropzone .ico { color: var(--muted); }
.dropzone:not(.dropzone--sm) > .ico { flex: none; box-sizing: content-box; width: 20px; height: 20px; padding: 11px; border-radius: 10px; border: 1px solid var(--line); }
.dropzone__txt { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dropzone strong { font-size: 1rem; font-weight: 650; }
.dropzone small { color: var(--muted); font-size: .85rem; }
.dropzone__btn { flex: none; margin-left: auto; min-height: 40px; padding: 9px 16px; font-size: .92rem; pointer-events: none; }
@container (max-width: 460px) { .dropzone__btn { flex-basis: 100%; margin-left: 0; } }
.dropzone.is-over .dropzone__btn { visibility: hidden; }
.dropzone.is-over .dropzone__txt[data-drop] > * { display: none; }
.dropzone.is-over .dropzone__txt[data-drop]::before { content: attr(data-drop); font-weight: 650; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
button.dropzone { font: inherit; color: inherit; }
.dropzone--sm { flex-direction: column; justify-content: center; text-align: center; gap: 4px; padding: 18px 12px; }
.dropzone--sm .dropzone__txt { flex: none; align-items: center; }
.dropzone--sm strong { font-size: .95rem; }

.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > * { flex: 1 1 180px; }
.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > span, .label { font-size: .85rem; font-weight: 650; color: var(--muted); }
.input, .select, textarea.input { width: 100%; font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-height: 44px; }
.input:focus, .select:focus, .btn:focus-visible, textarea:focus { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 1px; border-color: var(--primary); }
textarea.input { min-height: 90px; resize: vertical; }
input[type=color].input { padding: 4px; height: 44px; cursor: pointer; }

/* ---------- Controles con estilo propio (no los del navegador) ---------- */
select, .select { -webkit-appearance: none; -moz-appearance: none; appearance: none; background-image: var(--chev); background-repeat: no-repeat; background-position: right 12px center; background-size: 16px; padding-right: 38px !important; cursor: pointer; text-overflow: ellipsis; }
select:hover, .select:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); }
select option { background: var(--surface); color: var(--text); }
select::-ms-expand { display: none; }

/* Desplegable con estilo propio (select personalizable de CSS). Los navegadores sin soporte muestran el desplegable nativo. */
@supports (appearance: base-select) {
  select:not([multiple]):not([size]), select:not([multiple]):not([size])::picker(select) { appearance: base-select; }
  select:not([multiple]):not([size]) { display: flex; align-items: center; gap: 8px; text-align: left; line-height: 1.35; transition: border-color .15s, box-shadow .15s; }
  select:not([multiple]):not([size])::picker-icon { display: none; } /* usamos la flecha propia (--chev) */
  select:not([multiple]):not([size]):open { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); background-image: none; }
  select:not([multiple]):not([size]):open::after { content: ""; position: absolute; }
  select::picker(select) {
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--text);
    box-shadow: var(--shadow-lg); padding: 6px; margin-block: 6px; min-width: anchor-size(width);
    max-height: min(340px, 60vh); overflow-y: auto; scrollbar-width: thin;
    opacity: 1; translate: 0 0; transition: opacity .16s ease, translate .16s ease, overlay .16s allow-discrete, display .16s allow-discrete;
  }
  @starting-style { select::picker(select):popover-open { opacity: 0; translate: 0 -6px; } }
  select::picker(select):not(:popover-open) { opacity: 0; translate: 0 -6px; }
  select:not([multiple]):not([size]) option {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--text); font-size: .95rem; line-height: 1.3; white-space: nowrap; transition: background .12s, color .12s;
  }
  select:not([multiple]):not([size]) option:hover, select:not([multiple]):not([size]) option:focus-visible { background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); outline: none; }
  select:not([multiple]):not([size]) option:checked { background: var(--primary-50); color: var(--primary); font-weight: 650; }
  select:not([multiple]):not([size]) option::checkmark { content: "✓"; order: 1; margin-left: auto; padding-left: 12px; font-weight: 800; color: var(--primary); }
  select:not([multiple]):not([size]) option:disabled { opacity: .45; cursor: not-allowed; background: transparent; color: var(--muted); }
  select:not([multiple]):not([size]) optgroup { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 8px 12px 4px; }
  select:not([multiple]):not([size]) selectedcontent { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (prefers-reduced-motion: reduce) { select::picker(select) { transition: none; } }
}

/* Input de archivo: botón propio + nombre del archivo */
input[type=file].input { padding: 6px 10px 6px 6px; display: flex; align-items: center; cursor: pointer; color: var(--muted); font-size: .9rem; }
input[type=file].input::file-selector-button { font: inherit; font-weight: 650; font-size: .88rem; margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--primary-50); color: var(--primary); cursor: pointer; transition: background .15s; }
input[type=file].input:hover::file-selector-button { background: color-mix(in srgb, var(--primary) 18%, var(--primary-50)); }
input[type=file].input::-webkit-file-upload-button { font: inherit; font-weight: 650; margin-right: 12px; padding: 8px 14px; border: 0; border-radius: 8px; background: var(--primary-50); color: var(--primary); cursor: pointer; }

/* Selector pequeño (app.js): un campo más del formulario, con el botón pegado a la derecha; con archivo, miniatura,
   nombre, tamaño y ✕ para quitarlo. Se puede arrastrar un archivo encima. */
.filepick { position: relative; display: flex; align-items: stretch; padding: 0; cursor: pointer; overflow: hidden; transition: border-color .15s, background .15s; }
.filepick input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.filepick:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.filepick.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 4%, var(--surface)); }
.filepick__val { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.filepick__thumb { flex: none; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); object-fit: contain; background: #fff; }
.filepick__name { min-width: 0; font-size: .9rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.filepick__size { flex: none; font-style: normal; font-size: .8rem; color: var(--muted); }
.filepick.has-file .filepick__name { color: var(--text); }
.filepick__x { position: relative; z-index: 1; flex: none; display: grid; place-items: center; width: 42px; padding: 0; border: 0; border-left: 1px solid var(--line); background: none; color: var(--muted); cursor: pointer; }
.filepick__x[hidden] { display: none; }
.filepick__x:hover { color: var(--text); background: var(--surface-2); }
.filepick__btn { flex: none; display: flex; align-items: center; padding: 0 14px; border-left: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 650; font-size: .88rem; white-space: nowrap; transition: background .15s; }
.filepick:hover .filepick__btn { background: color-mix(in srgb, var(--muted) 12%, var(--surface-2)); }
.filepick.has-file .filepick__btn { display: none; }
.filepick:focus-within { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 1px; border-color: var(--primary); }

/* Casillas */
input[type=checkbox] { -webkit-appearance: none; appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid color-mix(in srgb, var(--muted) 60%, var(--line)); border-radius: 6px; background: var(--surface); display: inline-grid; place-content: center; cursor: pointer; transition: background .15s, border-color .15s; }
input[type=checkbox]::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.4px 2.4px; transform: rotate(-45deg) scale(0); margin-top: -2px; transition: transform .12s; }
input[type=checkbox]:checked { background: var(--primary); border-color: var(--primary); }
input[type=checkbox]:checked::after { transform: rotate(-45deg) scale(1); }
input[type=checkbox]:focus-visible, input[type=range]:focus-visible { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 2px; }
.check input { width: 20px; height: 20px; }

/* Deslizadores */
input[type=range] { -webkit-appearance: none; appearance: none; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
input[type=range]::-moz-range-track { height: 6px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }
input[type=range]::-moz-range-progress { height: 6px; border-radius: 999px; background: var(--primary); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }
input[type=range]::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .2); }

/* Selector de color: la muestra lleva un borde translúcido del color del texto, para que se vea aunque el color
   elegido sea igual que el fondo (blanco en modo claro, casi negro en modo oscuro) */
input[type=color].input::-webkit-color-swatch-wrapper { padding: 0; }
input[type=color].input::-webkit-color-swatch { border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 7px; }
input[type=color].input::-moz-color-swatch { border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 7px; }
/* Con JS (app.js): campo con muestra pequeña a la izquierda y el código del color; pulsar en cualquier parte abre el selector */
.colorpick { position: relative; display: flex; align-items: center; gap: 10px; padding: 0 12px 0 8px; cursor: pointer; min-width: 0; }
.colorpick:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.colorpick:focus-within { outline: 2px solid color-mix(in srgb, var(--primary) 60%, transparent); outline-offset: 1px; border-color: var(--primary); }
.colorpick input[type=color] { flex: none; width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; }
.colorpick input[type=color]::-webkit-color-swatch-wrapper { padding: 0; }
.colorpick input[type=color]::-webkit-color-swatch { border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 6px; }
.colorpick input[type=color]::-moz-color-swatch { border: 1px solid color-mix(in srgb, var(--text) 22%, transparent); border-radius: 6px; }
.colorpick__hex { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .9rem; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--text); }
input[type=range] { width: 100%; accent-color: var(--primary); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .95rem; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--primary); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 700; padding: 11px 18px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--primary); color: var(--on-primary); cursor: pointer; transition: background .15s, transform .05s; text-decoration: none; }
.btn:hover { background: var(--primary-600); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--ok { background: var(--ok-btn); color: var(--on-ok); }
.btn--ok:hover { background: var(--ok-btn); filter: brightness(1.08); }
.btn--sm { padding: 6px 12px; min-height: 36px; font-size: .9rem; }
.btn--block { width: 100%; }
.btn--lg { padding: 14px 26px; font-size: 1.05rem; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.actions--end { justify-content: flex-end; }

.tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 4px; background: var(--surface-2); border-radius: 12px; margin-bottom: 18px; }
.tabs button { flex: 1 1 auto; font: inherit; font-size: .92rem; font-weight: 600; padding: 9px 12px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; white-space: nowrap; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.panel { display: none; }
.panel.is-active { display: block; }

.filelist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.fileitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.fileitem.dragging { opacity: .5; }
.fileitem.drop-target { border-color: var(--primary); }
.fileitem__grip { cursor: grab; color: var(--muted); display: inline-flex; touch-action: none; }
.fileitem__thumb { width: 44px; height: 56px; object-fit: cover; border-radius: 6px; background: var(--surface); border: 1px solid var(--line); flex: none; }
.fileitem__meta { flex: 1; min-width: 0; }
.fileitem__name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.fileitem__info { font-size: .82rem; color: var(--muted); }
.fileitem__btns { display: flex; gap: 4px; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.iconbtn:hover { color: var(--err); border-color: var(--err); }
.iconbtn--plain:hover { color: var(--primary); border-color: var(--primary); }
.status { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--surface-2); font-size: .95rem; }
.status--ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--text); }
.status--err { background: color-mix(in srgb, var(--err) 12%, var(--surface)); }
.progress { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 12px; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .2s; }
.result { margin-top: 16px; display: grid; gap: 10px; }
.resultitem { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.resultitem__meta { flex: 1 1 200px; min-width: 0; }
.resultitem__meta strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result { min-width: 0; max-width: 100%; }
/* En el móvil, los nombres de archivo largos y sin espacios se parten en varias líneas en lugar de desbordar */
@media (max-width: 640px) { .resultitem__meta strong { white-space: normal; overflow-wrap: anywhere; } }
.pill { display: inline-block; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--primary-50); color: var(--primary); }
.pill--ok { background: color-mix(in srgb, var(--ok) 14%, var(--surface)); color: var(--ok); }
.split2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; }
.split2--wide { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
/* minmax(0, …): con «1fr» a secas la columna crecía hasta el campo más ancho y el generador de facturas desbordaba en móviles de 390 px */
@media (max-width: 820px) { .split2, .split2--wide { grid-template-columns: minmax(0, 1fr); } }
.stack { display: flex; flex-direction: column; gap: 12px; }
.hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.checker { background-color: #fff; background-image: linear-gradient(45deg, #e5e7eb 25%, transparent 25%), linear-gradient(-45deg, #e5e7eb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e5e7eb 75%), linear-gradient(-45deg, transparent 75%, #e5e7eb 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview { border: 1px solid var(--line); border-radius: var(--radius-sm); min-height: 220px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; }
.preview img, .preview canvas { max-height: 460px; object-fit: contain; }
/* Recorte manual (Redimensionar imagen): recuadro con 8 asas sobre la imagen; lo de fuera se oscurece */
.cropper { display: inline-block; max-width: 100%; padding: 12px; box-sizing: border-box; touch-action: none; user-select: none; -webkit-user-select: none; }
.cropper__stage { position: relative; line-height: 0; }
.cropper img { display: block; max-width: 100%; max-height: 440px; width: auto; height: auto; pointer-events: none; }
.cropper__clip { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.cropper__shade { position: absolute; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .5); }
.cropper__box { position: absolute; box-sizing: border-box; border: 2px solid #fff; outline: 1px solid rgba(0, 0, 0, .55); cursor: move;
  background-image: linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35)), linear-gradient(rgba(255,255,255,.35), rgba(255,255,255,.35));
  background-size: 1px 100%, 1px 100%, 100% 1px, 100% 1px; background-position: 33.33% 0, 66.66% 0, 0 33.33%, 0 66.66%; background-repeat: no-repeat; }
.cropper__box:focus-visible { outline: 3px solid var(--primary); }
.cropper__h { position: absolute; width: 16px; height: 16px; background: #fff; border: 2px solid var(--primary); border-radius: 3px; box-sizing: border-box; }
/* Zona táctil más grande que el cuadrado visible */
.cropper__h::after { content: ""; position: absolute; inset: -12px; }
.cropper__h--nw { left: -9px; top: -9px; cursor: nwse-resize; }
.cropper__h--ne { right: -9px; top: -9px; cursor: nesw-resize; }
.cropper__h--se { right: -9px; bottom: -9px; cursor: nwse-resize; }
.cropper__h--sw { left: -9px; bottom: -9px; cursor: nesw-resize; }
.cropper__h--n { left: calc(50% - 8px); top: -9px; cursor: ns-resize; }
.cropper__h--s { left: calc(50% - 8px); bottom: -9px; cursor: ns-resize; }
.cropper__h--e { top: calc(50% - 8px); right: -9px; cursor: ew-resize; }
.cropper__h--w { top: calc(50% - 8px); left: -9px; cursor: ew-resize; }

/* Thumbnails grid (separar PDF) */
.pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 12px; margin-top: 16px; }
.page { position: relative; border: 2px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); cursor: pointer; text-align: center; font-size: .82rem; color: var(--muted); user-select: none; }
.page canvas { width: 100%; height: auto; display: block; border-radius: 4px; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.page.is-selected { border-color: var(--primary); background: var(--primary-50); color: var(--primary); font-weight: 700; }
.page.is-selected::after { content: "✓"; position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-size: .8rem; display: flex; align-items: center; justify-content: center; }

.pages--org { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.page--org { cursor: grab; padding: 8px; }
.page__canvas { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.page__canvas img { max-width: 78%; max-height: 78%; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); background: #fff; transition: transform .2s; }
.page__bar { display: flex; align-items: center; justify-content: space-between; gap: 4px; margin-top: 6px; font-weight: 700; }
.page__bar .iconbtn { width: 30px; height: 30px; }
.page--org.is-deleted { opacity: .35; border-style: dashed; }
.page--org.dragging { opacity: .4; }

/* Firmar PDF */
.sigpad { width: 100%; height: 200px; border: 2px dashed var(--line); border-radius: 12px; background: #fff; touch-action: none; cursor: crosshair; display: block; }
.signpages { display: flex; flex-direction: column; align-items: center; gap: 18px; margin-top: 16px; background: var(--surface-2); border-radius: 12px; padding: 16px 8px; max-height: 80vh; overflow: auto; }
.signpage { position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); background: #fff; cursor: copy; max-width: 100%; }
.signpage canvas { display: block; max-width: 100%; height: auto; }
.signpage__n { position: absolute; left: -2px; top: -22px; font-size: .78rem; color: var(--muted); }
.placed { position: absolute; border: 1.5px dashed var(--primary); cursor: move; touch-action: none; user-select: none; }
.placed img { width: 100%; height: 100%; display: block; pointer-events: none; }
.placed__del, .placed__res { position: absolute; width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: var(--on-primary); border: 0; font-size: .75rem; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.placed__del { top: -11px; right: -11px; background: var(--err); }
.placed__res { bottom: -11px; right: -11px; cursor: nwse-resize; touch-action: none; }
.sigchoice { display: flex; gap: 10px; flex-wrap: wrap; }
.sigchoice img { height: 60px; max-width: 220px; object-fit: contain; border: 2px solid var(--line); border-radius: 10px; background: #fff; padding: 4px; cursor: pointer; }
.sigchoice img.is-active { border-color: var(--primary); }

/* Texto / contraseñas */
.textstats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 14px 0; }
.textstats > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.textstats b { display: block; font-size: 1.35rem; font-variant-numeric: tabular-nums; }
.textstats span { font-size: .8rem; color: var(--muted); }
.chipbar { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: .85rem; font-weight: 600; padding: 7px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; transition: border-color .15s, color .15s; }
.chip:hover { border-color: var(--primary); color: var(--primary); text-decoration: none; }
a.chip { display: inline-block; }
.pwout { display: flex; align-items: center; gap: 8px; padding: 10px 10px 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pwout code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 1.15rem; word-break: break-all; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin-top: 10px; }
.meter > i { display: block; height: 100%; width: 0; transition: width .25s, background .25s; }
.cam { width: 100%; max-height: 420px; border-radius: 12px; background: #000; object-fit: cover; }
.scanres { word-break: break-word; }
audio { width: 100%; }

/* Analizador web */
.disclaimer { border: 1px solid #f59e0b; background: color-mix(in srgb, #f59e0b 10%, var(--surface)); border-radius: 12px; padding: 12px 16px; margin-bottom: 16px; }
.disclaimer strong { color: #b45309; }
.disclaimer p { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .disclaimer strong { color: #fbbf24; } }
:root[data-theme="dark"] .disclaimer strong { color: #fbbf24; }
.analyzer { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.analyzer .btn { flex: 0 0 auto; }
.input--lg { font-size: 1.05rem; min-height: 52px; }
.repsum { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; padding: 18px; margin-top: 18px; box-shadow: none; }
@media (max-width: 720px) { .repsum { grid-template-columns: 1fr; } }
.repsum .kv { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.repsum .kv > div:last-child { grid-column: 1 / -1; }
.scores { display: flex; gap: 18px; justify-content: center; }
.score { position: relative; width: 120px; text-align: center; }
.score svg { width: 120px; height: 120px; display: block; }
.score circle { transition: stroke-dashoffset .8s ease; }
.score__in { position: absolute; top: 0; left: 0; width: 120px; height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; }
.score__in b { font-size: 2rem; font-variant-numeric: tabular-nums; }
.score__in span { font-size: .85rem; font-weight: 800; color: var(--muted); margin-top: 4px; }
.score__label { font-weight: 700; margin-top: 6px; }
.score__label small { display: block; font-weight: 500; font-size: .75rem; color: var(--muted); }
.chkgroup { margin-top: 18px; }
.chkgroup h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0 0 8px; }
.chk { border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--surface); margin-bottom: 8px; }
.chk--fail { border-left-color: var(--err); }
.chk--warn { border-left-color: var(--warn); }
.chk--ok { border-left-color: var(--ok); }
.chk--info { border-left-color: var(--accent); }
.chk summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.chk summary::-webkit-details-marker { display: none; }
.chk__t { flex: 1; font-weight: 650; }
.chk__st { font-size: .78rem; font-weight: 700; color: var(--muted); }
.chk__body { padding: 0 14px 12px 44px; font-size: .93rem; color: var(--muted); word-break: break-word; }
.chk__body p { margin: 0 0 6px; }
.chk__fix { color: var(--text); }

/* Meta tags: vistas previas (colores fijos de cada plataforma) */
.cnt { float: right; font-weight: 700; }
textarea.code, .code { font-family: var(--mono); font-size: .86rem; line-height: 1.5; white-space: pre; tab-size: 2; }
.serp { background: #fff; color: #202124; border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; font-family: Arial, sans-serif; max-width: 640px; }
.serp--mobile { max-width: 380px; margin-top: 12px; }
.serp__head { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.serp__fav { width: 26px; height: 26px; border-radius: 50%; background: #f1f3f4; border: 1px solid #dadce0; display: flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: #4d5156; flex: none; }
.serp__site { font-size: 14px; color: #202124; line-height: 1.2; }
.serp__url { font-size: 12px; color: #4d5156; line-height: 1.3; word-break: break-all; }
.serp__title { font-size: 20px; color: #1a0dab; line-height: 1.3; margin-bottom: 3px; }
.serp__desc { font-size: 14px; color: #4d5156; line-height: 1.58; }
.wa { background: #efeae2; border-radius: 12px; padding: 18px; }
.wa__bubble { margin-left: auto; max-width: 330px; background: #d9fdd3; border-radius: 10px; padding: 4px; box-shadow: 0 1px 1px rgba(0, 0, 0, .1); font-family: Arial, sans-serif; color: #111b21; }
.wa__card { background: #c8ecc2; border-radius: 8px; overflow: hidden; }
.wa__card img { width: 100%; max-height: 170px; object-fit: cover; display: block; }
.wa__txt { padding: 8px 10px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; }
.wa__txt span { color: #54656f; }
.wa__txt small { color: #667781; }
.wa__link { color: #027eb5; font-size: 13px; padding: 6px 6px 4px; word-break: break-all; }
.fbcard, .xcard { background: #fff; color: #050505; border: 1px solid #dadde1; border-radius: 10px; overflow: hidden; max-width: 520px; font-family: Arial, sans-serif; }
.fbcard img, .xcard img { width: 100%; aspect-ratio: 1.91; object-fit: cover; display: block; background: #f0f2f5; }
.noimg { aspect-ratio: 1.91; display: flex; align-items: center; justify-content: center; background: #f0f2f5; color: #65676b; font-size: .9rem; }
.fbcard__txt { padding: 10px 12px; background: #f0f2f5; display: flex; flex-direction: column; gap: 3px; }
.fbcard__txt small { color: #65676b; font-size: 12px; }
.fbcard__txt span { color: #65676b; font-size: 14px; }
.xcard { border-radius: 16px; position: relative; }
.xcard__dom { position: absolute; left: 12px; top: 12px; background: rgba(0, 0, 0, .7); color: #fff; font-size: 12px; padding: 1px 6px; border-radius: 4px; }
.xcard__t { padding: 8px 12px 10px; font-size: 15px; }
.serp, .wa, .fbcard, .xcard { overflow-wrap: anywhere; min-width: 0; }
.serp__head > div, .wa__txt { min-width: 0; }

/* Tablas DNS / propagación */
.tablewrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.dtable { width: 100%; border-collapse: collapse; font-size: .9rem; }
.dtable th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); padding: 9px 12px; }
.dtable td { padding: 9px 12px; border-top: 1px solid var(--line); vertical-align: top; word-break: break-word; }
.dtable td:nth-child(3) { font-family: var(--mono); font-size: .84rem; }
.dtable--plain td:nth-child(3) { font-family: inherit; font-size: inherit; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); margin: 12px 0; }
.legal .dtable td, .legal .dtable th { min-width: 140px; }
.propgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.propitem { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: var(--surface); font-size: .9rem; }
.propitem b { font-family: var(--mono); font-size: .82rem; font-weight: 600; text-align: right; word-break: break-all; }
.propitem.is-ok { border-left-color: var(--ok); }
.propitem.is-diff { border-left-color: var(--warn); }
.propitem.is-err { border-left-color: var(--err); }

/* Favicon */
.favprev { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--surface-2); border-radius: 12px; }
.favtab { display: flex; align-items: center; gap: 8px; width: 240px; max-width: 100%; padding: 8px 12px; background: #fff; color: #202124; border-radius: 10px 10px 0 0; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); font-size: .85rem; }
.favtab b { flex: 1; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favtab i { font-style: normal; color: #5f6368; font-size: .75rem; }
.favtab canvas { display: block; }
.favsizes { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.favsizes > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.favsizes small { color: var(--muted); font-size: .72rem; }
.favphone { width: 120px; padding: 18px 0 12px; border-radius: 18px; background: linear-gradient(160deg, #1e3a8a, #7c3aed); display: flex; flex-direction: column; align-items: center; gap: 6px; color: #fff; }
.favphone small { font-size: .72rem; max-width: 90%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favphone canvas { display: block; }

/* Dev tools */
.input.is-err { border-color: var(--err); box-shadow: 0 0 0 3px color-mix(in srgb, var(--err) 15%, transparent); }
.regexout { margin-top: 10px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); white-space: pre-wrap; word-break: break-word; font-family: var(--mono); font-size: .88rem; }
.regexout:empty { display: none; }
.regexout mark { background: color-mix(in srgb, var(--warn) 40%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.regexout .label { display: block; margin-bottom: 4px; font-family: var(--font); }

/* Colores */
.colorbig { position: relative; height: 230px; border-radius: 16px; border: 1px solid var(--line); display: flex; align-items: flex-end; padding: 14px 16px; font-family: var(--mono); font-weight: 700; font-size: 1.3rem; cursor: pointer; }
.colorbig::after { content: attr(data-hex); }
.colorbig input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sw { font: inherit; border: 0; cursor: pointer; display: flex; flex-direction: column; justify-content: flex-end; text-align: left; padding: 10px; border-radius: 10px; transition: transform .12s; }
.sw:hover { transform: translateY(-2px); }
.sw b { font-family: var(--mono); font-size: .85rem; }
.sw small { font-size: .74rem; opacity: .85; }
.swatches--big { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin-top: 12px; }
.swatches--big .sw { height: 120px; }
.swatches--scale { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; }
.swatches--scale .sw { height: 84px; padding: 6px; border-radius: 8px; }
.swatches--scale .sw b { font-size: .62rem; }
@media (max-width: 720px) { .swatches--scale { grid-template-columns: repeat(4, 1fr); } }
.swatches--list { display: flex; flex-direction: column; gap: 6px; }
.sw--row { flex-direction: row; align-items: center; justify-content: space-between; padding: 14px; }
.sw--inline { display: inline-flex; padding: 4px 10px; border-radius: 8px; vertical-align: middle; }
.contrastdemo { border-radius: 14px; padding: 22px; border: 1px solid var(--line); }

/* Sueldo neto */
.salbar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.salbar i { display: block; height: 100%; }
.dtable tr.tot td { border-top: 2px solid var(--line); background: var(--primary-50); }

/* Facturas */
.invlines { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; }
.invline { display: grid; grid-template-columns: minmax(0, 1fr) 64px 84px 64px 92px 36px; gap: 6px; align-items: center; }
.invline .input, .invline .select { min-height: 40px; padding: 8px; font-size: .9rem; }
@media (max-width: 600px) { .invline { grid-template-columns: 1fr 1fr 1fr 36px; } .invline [data-k=desc] { grid-column: 1 / -1; } .invline [data-k=disc] { display: none; } }
/* Selector de diseño de factura */
.designs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
.design { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .82rem; font-weight: 600; cursor: pointer; }
.design input { position: absolute; opacity: 0; pointer-events: none; }
.design__thumb { --a: var(--primary); position: relative; width: 100%; aspect-ratio: .75; background: #fff; border: 2px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; gap: 5px; padding: 26% 12% 0; }
.design input:checked + .design__thumb { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 25%, transparent); }
.design input:focus-visible + .design__thumb { outline: 2px solid var(--primary); outline-offset: 2px; }
.design__thumb i { position: absolute; left: 0; right: 0; top: 0; }
.design__thumb b { display: block; height: 5px; border-radius: 2px; background: #e2e8f0; }
.design__thumb b:last-child { width: 50%; margin-left: auto; height: 9px; background: var(--a); }
.design__thumb--clasico i { height: 5px; background: var(--a); }
.design__thumb--moderno i { height: 22%; background: var(--a); }
.design__thumb--minimal i { height: 0; }
.design__thumb--minimal b:last-child { background: #334155; height: 3px; }
.design__thumb--elegante i { top: 9%; left: 20%; right: 20%; height: 4px; border-top: 1px solid var(--a); border-bottom: 1px solid var(--a); }
.design__thumb--elegante b:last-child { background: none; border-top: 2px double var(--a); height: 6px; border-radius: 0; }

/* Variantes de la vista previa */
.invpaper--moderno { border-top: 0; padding-top: 0; }
.invpaper--moderno .ip-head { background: var(--acc); color: #fff; margin: 0 -26px; padding: 20px 26px; }
.invpaper--moderno .ip-head .ip-title h3, .invpaper--moderno .ip-head .ip-title p, .invpaper--moderno .ip-brand { color: #fff; }
.invpaper--moderno .ip-parties small { color: var(--acc); }
.invpaper--moderno .ip-table th { background: var(--acc); color: #fff; }
.invpaper--minimal { border-top: 0; }
.invpaper--minimal .ip-title h3 { color: #0f172a; font-weight: 400; letter-spacing: .2em; }
.invpaper--minimal .ip-table th { background: none; border-bottom: 1.5px solid #0f172a; color: #0f172a; }
.invpaper--minimal .ip-total { background: none; color: #0f172a; border-top: 1.5px solid #0f172a; border-radius: 0; padding: 7px 0 !important; }
.invpaper--elegante { border-top: 0; font-family: Georgia, "Times New Roman", serif; }
.invpaper--elegante .ip-head { flex-direction: column; align-items: center; text-align: center; border-bottom: 3px double var(--acc); padding-bottom: 12px; }
.invpaper--elegante .ip-title { text-align: center; }
.invpaper--elegante .ip-title h3 { letter-spacing: .25em; font-weight: 400; }
.invpaper--elegante .ip-table th { background: none; border-bottom: 1px solid var(--acc); color: var(--acc); font-style: italic; text-transform: none; font-size: .78rem; }
.invpaper--elegante .ip-total { background: none; color: var(--acc); border-top: 3px double var(--acc); border-radius: 0; }
.invpaper { --acc: #4f46e5; background: #fff; color: #0f172a; border-radius: 10px; box-shadow: 0 2px 16px rgba(0, 0, 0, .14); padding: 26px 26px 20px; font-size: .78rem; line-height: 1.45; border-top: 6px solid var(--acc); min-height: 520px; }
.ip-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.ip-logo { max-height: 52px; max-width: 170px; }
.ip-brand { font-size: 1.05rem; }
.ip-title { text-align: right; }
.ip-title h3 { color: var(--acc); font-size: 1.3rem; margin: 0 0 4px; letter-spacing: .02em; }
.ip-title p { margin: 0; color: #475569; }
.ip-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 22px 0 16px; }
.ip-parties small, .ip-foot small { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: 2px; }
.ip-table { width: 100%; border-collapse: collapse; }
.ip-table th { text-align: left; font-size: .66rem; text-transform: uppercase; color: #64748b; background: color-mix(in srgb, var(--acc) 10%, #fff); padding: 6px; }
.ip-table td { padding: 6px; border-bottom: 1px solid #e2e8f0; vertical-align: top; }
.ip-table th:not(:first-child), .ip-table td:not(:first-child) { text-align: right; white-space: nowrap; }
/* Móviles estrechos (≤ 420 px): la vista previa ocupa más ancho y la tabla se compacta para que «Importe» no se salga;
   si aun así no cupiera (importes enormes), se desplaza solo la vista previa, nunca la página */
@media (max-width: 420px) {
  .invpaper { padding: 18px 12px 16px; font-size: .72rem; overflow-x: auto; }
  .ip-table th { font-size: .6rem; letter-spacing: 0; }
  .ip-table th, .ip-table td { padding: 5px 3px; }
}
.ip-totals { margin: 14px 0 0 auto; width: min(260px, 100%); }
.ip-totals div { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; }
.ip-total { background: var(--acc); color: #fff; padding: 7px 10px !important; border-radius: 6px; margin-top: 6px; font-size: .95rem; }
.ip-foot { margin: 14px 0 0; }
/* Las variantes que no llevan la franja superior: «.invpaper.» para que ganen a la regla base, que va después */
.invpaper.invpaper--moderno, .invpaper.invpaper--minimal, .invpaper.invpaper--elegante { border-top: 0; }
.invpaper.invpaper--moderno { padding-top: 0; }

/* Plantillas nuevas: Corporativo, Lateral, Tradicional, Técnico, Creativo y Contraste */
.designs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 600px) { .designs { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.design__thumb--corporativo { background: linear-gradient(#f1f5f9 0 24%, #fff 24%); }
.design__thumb--corporativo i { top: 9%; left: 12%; width: 4px; height: 9%; background: var(--a); }
.design__thumb--lateral { padding-left: 24%; }
.design__thumb--lateral i { top: 0; bottom: 0; right: auto; width: 11%; background: var(--a); }
.design__thumb--tradicional b { border: 1px solid #94a3b8; background: #fff; height: 7px; border-radius: 0; }
.design__thumb--tradicional b:last-child { background: color-mix(in srgb, var(--a) 25%, #fff); border-color: var(--a); }
.design__thumb--tradicional i { top: 9%; left: 12%; right: 12%; height: 9%; border: 1px solid #94a3b8; }
.design__thumb--tecnico b { background: none; border-top: 2px dashed #94a3b8; height: 3px; border-radius: 0; }
.design__thumb--tecnico b:last-child { border-top: 0; background: #0f172a; height: 7px; }
.design__thumb--tecnico i { top: 9%; left: 12%; width: 40%; height: 6px; background: #0f172a; }
.design__thumb--creativo i { top: -18%; left: auto; right: -18%; width: 62%; aspect-ratio: 1; border-radius: 50%; background: color-mix(in srgb, var(--a) 22%, #fff); }
.design__thumb--creativo b:first-of-type { width: 70%; height: 10px; background: var(--a); }
.design__thumb--contraste i { height: 22%; background: #0f172a; }
.design__thumb--contraste b:last-child { background: var(--a); }

/* Corporativo: banda gris de cabecera, datos en recuadros, filas alternas y total enmarcado */
.invpaper.invpaper--corporativo { border-top: 0; padding-top: 0; }
.invpaper--corporativo .ip-head { background: #f1f5f9; margin: 0 -26px; padding: 22px 26px; border-bottom: 1px solid #e2e8f0; }
.invpaper--corporativo .ip-title { border-left: 4px solid var(--acc); padding-left: 12px; text-align: left; }
.invpaper--corporativo .ip-title h3 { color: #0f172a; }
.invpaper--corporativo .ip-parties > div { border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px 12px; }
.invpaper--corporativo .ip-parties small { color: var(--acc); }
.invpaper--corporativo .ip-table th { background: #0f172a; color: #fff; }
.invpaper--corporativo .ip-table tbody tr:nth-child(even) td { background: #f8fafc; }
.invpaper--corporativo .ip-total { background: none; color: var(--acc); border: 2px solid var(--acc); }
/* Lateral: franja de color a la izquierda en toda la altura */
.invpaper.invpaper--lateral { border-top: 0; position: relative; padding-left: 46px; }
.invpaper--lateral::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 16px; background: var(--acc); border-radius: 10px 0 0 10px; }
.invpaper--lateral .ip-head { flex-direction: column-reverse; }
.invpaper--lateral .ip-title { text-align: left; }
.invpaper--lateral .ip-title h3 { font-size: 1.9rem; letter-spacing: -.01em; line-height: 1.1; }
.invpaper--lateral .ip-table th { background: none; border-bottom: 2px solid var(--acc); color: var(--acc); }
/* Tradicional: todo en recuadros, tabla con cuadrícula completa (el aspecto de gestoría de siempre) */
.invpaper.invpaper--tradicional { border-top: 0; }
.invpaper--tradicional .ip-title { border: 1px solid #94a3b8; padding: 8px 12px; }
.invpaper--tradicional .ip-title h3 { color: #0f172a; font-size: 1.1rem; }
.invpaper--tradicional .ip-parties { gap: 0; }
.invpaper--tradicional .ip-parties > div { border: 1px solid #94a3b8; padding: 8px 10px; }
.invpaper--tradicional .ip-parties > div + div { border-left: 0; }
.invpaper--tradicional .ip-table th, .invpaper--tradicional .ip-table td { border: 1px solid #94a3b8; }
.invpaper--tradicional .ip-table th { background: color-mix(in srgb, var(--acc) 14%, #fff); color: #0f172a; }
.invpaper--tradicional .ip-totals { border: 1px solid #94a3b8; padding: 4px 8px; }
.invpaper--tradicional .ip-total { background: color-mix(in srgb, var(--acc) 14%, #fff); color: #0f172a; border-radius: 0; margin: 6px -8px -4px; padding: 7px 8px !important; border-top: 1px solid #94a3b8; }
/* Técnico: letra monoespaciada y separadores discontinuos, como un ticket */
.invpaper.invpaper--tecnico { border-top: 0; font-family: "Courier New", Courier, monospace; }
.invpaper--tecnico .ip-title h3 { color: #0f172a; letter-spacing: .12em; }
.invpaper--tecnico .ip-head { border-bottom: 2px dashed #94a3b8; padding-bottom: 12px; }
.invpaper--tecnico .ip-parties small { color: var(--acc); }
.invpaper--tecnico .ip-table th { background: none; border-bottom: 2px dashed #94a3b8; color: #0f172a; }
.invpaper--tecnico .ip-table td { border-bottom: 1px dashed #cbd5e1; }
.invpaper--tecnico .ip-total { background: #0f172a; border-radius: 0; }
/* Creativo: título grande, círculo de color de fondo y total destacado */
.invpaper.invpaper--creativo { border-top: 0; position: relative; overflow: hidden; }
.invpaper--creativo::before { content: ''; position: absolute; top: -90px; right: -90px; width: 240px; height: 240px; border-radius: 50%; background: color-mix(in srgb, var(--acc) 16%, #fff); }
.invpaper--creativo > * { position: relative; }
.invpaper--creativo .ip-head { flex-direction: column-reverse; }
.invpaper--creativo .ip-title { text-align: left; }
.invpaper--creativo .ip-title h3 { font-size: 2.3rem; line-height: 1; letter-spacing: -.03em; font-weight: 800; }
.invpaper--creativo .ip-table th { background: none; color: var(--acc); border-bottom: 1px solid #e2e8f0; }
.invpaper--creativo .ip-total { font-size: 1.25rem; border-radius: 999px; padding: 9px 16px !important; }
/* Contraste: cabecera oscura y el color elegido solo en el total y los rótulos */
.invpaper.invpaper--contraste { border-top: 0; padding-top: 0; }
.invpaper--contraste .ip-head { background: #0f172a; margin: 0 -26px; padding: 22px 26px; }
.invpaper--contraste .ip-title h3 { color: var(--acc-dark, var(--acc)); }
.invpaper--contraste .ip-title p, .invpaper--contraste .ip-brand { color: #e2e8f0; }
.invpaper--contraste .ip-parties small { color: var(--acc); }
.invpaper--contraste .ip-logo { background: #fff; padding: 5px; border-radius: 3px; }
.invpaper--contraste .ip-table th { background: #f1f5f9; color: #0f172a; }
@media (max-width: 420px) {
  .invpaper--corporativo .ip-head, .invpaper--contraste .ip-head, .invpaper--moderno .ip-head { margin: 0 -12px; padding: 16px 12px; }
  .invpaper.invpaper--lateral { padding-left: 26px; }
  .invpaper--lateral::before { width: 10px; }
}

/* ---------- Secciones (portada y herramientas) ---------- */
.section { padding: 36px 16px; }
.section > h2 { font-size: clamp(1.5rem, 2.6vw, 1.85rem); letter-spacing: -.025em; margin-bottom: 18px; }
.section--tight { padding-top: 8px; padding-bottom: 8px; }
.steps { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.step { position: relative; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(14, 18, 48, .04); }
.step p { color: var(--muted); margin: 0; }
.step__n { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); font-weight: 800; font-size: 1.05rem; margin-bottom: 10px; }
.prose { max-width: 820px; color: var(--muted); }
.prose h3 { color: var(--text); margin-top: 1.2em; }
.prose strong { color: var(--text); }
.sources { padding-left: 20px; }
.sources li { margin: 6px 0; }
.sources__rev, .sources__note { font-size: .92rem; }
.ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.idea { padding: 22px; border-radius: 12px; transition: border-color .18s; }
.idea:hover { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.idea h3 { margin-bottom: 6px; }
.idea p { color: var(--muted); margin: 0; font-size: .95rem; }
.idea__emoji { display: none; } /* los textos de las herramientas aún los traen; el diseño no usa emojis */
.faq { display: flex; flex-direction: column; gap: 10px; max-width: 860px; }
.faq__item { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 1px 2px rgba(14, 18, 48, .04); transition: border-color .15s; }
.faq__item[open] { border-color: color-mix(in srgb, var(--primary) 35%, var(--line)); }
.faq__item summary { cursor: pointer; padding: 16px 44px 16px 18px; font-weight: 700; list-style: none; position: relative; }
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; font-weight: 400; line-height: 1; color: var(--primary); }
.faq__item[open] summary::after { content: "−"; }
.faq__a { padding: 0 18px 14px; color: var(--muted); }
.faq__a p { margin: 0; }
.cathead { margin: 36px 0 14px; font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
/* Herramientas relacionadas (páginas de herramienta) y lista de la página 404 */
.relgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; }
.relgrid .toolrow__txt small { -webkit-line-clamp: 1; }
/* Guías */
.guide__meta { margin: 12px 0 0; font-size: .9rem; }
.guide__cta .toolrow__txt strong { font-size: 1.1rem; }
.guide__body > :first-child { margin-top: 0; }
.guide__body .btn { margin-top: 10px; }
.relgrid.guide__list .toolrow__txt small { -webkit-line-clamp: 2; }
@media (max-width: 1100px) { .relgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .relgrid { grid-template-columns: 1fr; gap: 10px; } }

/* ---------- Editor de vídeo ---------- */
.vedit__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.vedit__player { display: block; width: 100%; max-height: 62vh; background: #000; border-radius: var(--radius-sm); }
.vedit__timeline { position: relative; height: 56px; margin-top: 14px; border-radius: 8px; overflow: hidden; background: #222; cursor: pointer; touch-action: none; user-select: none; }
.vedit__timeline canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .85; }
.vedit__seg { position: absolute; top: 0; bottom: 0; border-left: 2px solid #fff; box-sizing: border-box; }
.vedit__seg:first-child { border-left: 0; }
.vedit__seg.is-removed { background: repeating-linear-gradient(45deg, rgba(220, 38, 38, .75) 0 8px, rgba(127, 29, 29, .75) 8px 16px); }
.vedit__head { position: absolute; top: -2px; bottom: -2px; width: 3px; margin-left: -1px; background: #facc15; box-shadow: 0 0 0 1px rgba(0, 0, 0, .5); pointer-events: none; }
.vedit__times { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); margin-top: 6px; font-variant-numeric: tabular-nums; }
.vedit__audio { margin-top: 20px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.vedit__audio h3 { margin-bottom: 10px; }
.vedit__audio .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; align-self: center; }
.vedit__addinfo { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin: 12px 0 8px; }
#rec.is-rec { background: var(--err); border-color: var(--err); color: #fff; animation: recpulse 1.2s ease-in-out infinite; }
@keyframes recpulse { 50% { opacity: .7; } }
#resultPlayer { margin-top: 12px; }

/* ---------- Grabar pantalla ---------- */
.rec__opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.rec__opts .check { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.rec__cam { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.rec__cam video { width: 200px; max-width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; background: #000; transform: scaleX(-1); }
.rec__cam > div { flex: 1 1 240px; }
.rec__live { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 14px 16px; border: 1px solid var(--err); border-radius: var(--radius-sm); background: color-mix(in srgb, var(--err) 8%, var(--surface)); font-size: 1.05rem; }
.rec__live b { font-variant-numeric: tabular-nums; font-size: 1.3rem; }
.rec__dot { width: 14px; height: 14px; border-radius: 50%; background: var(--err); animation: recpulse 1.2s ease-in-out infinite; }
.rec__live.is-paused .rec__dot { animation: none; background: var(--muted); }
.rec__btns { margin-left: auto; display: flex; gap: 8px; }
#done .vedit__player { margin-top: 14px; }

/* ---------- Lector de ebooks ---------- */
.rico { fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* Biblioteca (en la página de la herramienta) */
.lib .status { margin: 0 0 14px; }
.lib__cont { display: flex; gap: 16px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.lib__cont:empty { display: none; }
.lib__cont .bk-cover { width: 92px; flex: none; }
.lib__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.lib__k { font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary); }
.lib__t { font-size: 1.1rem; font-weight: 800; line-height: 1.25; margin: 4px 0 2px; overflow-wrap: anywhere; }
.lib__a { font-size: .88rem; color: var(--muted); }
.lib__meta { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; color: var(--muted); margin-top: auto; padding-top: 8px; }
.lib__meta span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib__bar { height: 5px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin: 6px 0 12px; }
.lib__bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }
.lib__cont .btn { align-self: flex-start; }
.lib__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 12px; }
.lib__h { font-size: 1.1rem; margin: 0; }
.lib__sort { width: auto; min-height: 38px; padding: 6px 10px; font-size: .88rem; }
.lib__shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 18px 12px; }
.lib__add { position: relative; aspect-ratio: 2 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 2px dashed color-mix(in srgb, var(--primary) 38%, var(--line)); border-radius: 8px; background: var(--surface); color: var(--primary); font-weight: 700; font-size: .9rem; cursor: pointer; text-align: center; }
.lib__add.is-over { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); }
.lib__add input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.bk { position: relative; min-width: 0; }
.bk__open { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; color: inherit; cursor: pointer; font: inherit; }
.bk-cover { position: relative; aspect-ratio: 2 / 3; border-radius: 4px 8px 8px 4px; overflow: hidden; box-shadow: 0 1px 3px rgba(14, 18, 48, .22), inset 3px 0 0 rgba(0, 0, 0, .12); color: #fff; display: flex; flex-direction: column; justify-content: space-between; padding: 10px 9px; background: #2f3640; }
.bk-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bk-cover .au { font-size: .6rem; letter-spacing: .05em; text-transform: uppercase; opacity: .85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-cover .ti { font-family: Georgia, serif; font-weight: 700; font-size: .82rem; line-height: 1.2; border-bottom: 1px solid rgba(255, 255, 255, .5); padding-bottom: 6px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.bk__name { font-size: .85rem; font-weight: 700; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bk__st { display: flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--muted); min-height: 1.3em; }
.bk__st .lib__bar { flex: 1; margin: 0; height: 4px; }
.bk__del { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgba(14, 18, 48, .6); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0; transition: opacity .15s; }
.bk:hover .bk__del, .bk__del:focus-visible { opacity: 1; }
@media (hover: none) { .bk__del { opacity: .85; } }
.lib__cont:empty, .lib__shelf[hidden], .lib__sort[hidden], .lib__empty[hidden] { display: none; }
.lib__cont { margin-bottom: 8px; }
.lib__head { margin-top: 18px; }
.lib__cont:empty + .lib__head { margin-top: 4px; }
/* Biblioteca vacía: estantería con un hueco para añadir el primer libro */
.lib__empty { position: relative; display: flex; align-items: center; gap: 22px; padding: 22px; border: 2px dashed color-mix(in srgb, var(--primary) 38%, var(--line)); border-radius: var(--radius); background: var(--surface); cursor: pointer; transition: background .15s, border-color .15s; }
.lib__empty:hover, .lib__empty.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 5%, var(--surface)); }
.lib__empty input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.lib__ghost { flex: none; display: flex; align-items: flex-end; gap: 6px; }
.lib__ghost i, .lib__ghost b { display: block; width: 46px; aspect-ratio: 2 / 3; border-radius: 3px 6px 6px 3px; background: var(--surface-2); box-shadow: inset 3px 0 0 rgba(0, 0, 0, .06); }
.lib__ghost i:nth-child(2) { width: 42px; }
.lib__ghost i:nth-child(3) { width: 48px; }
.lib__ghost b { display: flex; align-items: center; justify-content: center; width: 64px; border: 2px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); background: none; box-shadow: none; color: var(--primary); }
.lib__etx { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.lib__etx strong { font-size: 1.08rem; }
.lib__etx small { color: var(--muted); font-size: .88rem; line-height: 1.45; }
@media (max-width: 599px) {
  .lib__empty { flex-direction: column; text-align: center; padding: 26px 16px; gap: 16px; }
  .lib__ghost i, .lib__ghost b { width: 40px; } .lib__ghost b { width: 58px; }
}
/* Ventana modal de confirmación (MS.ask, en toda la web) */
.mdl { padding: 0; border: 0; border-radius: var(--radius); background: var(--surface); color: var(--text); width: min(420px, calc(100vw - 32px)); box-shadow: 0 18px 50px rgba(14, 18, 48, .28); }
.mdl::backdrop { background: rgba(14, 18, 48, .5); }
.mdl[open] { animation: mdl-in .16s ease-out; }
@keyframes mdl-in { from { opacity: 0; transform: translateY(8px); } }
.mdl__box { padding: 22px 22px 18px; }
.mdl__t { font-size: 1.12rem; line-height: 1.3; margin: 0 0 8px; overflow-wrap: anywhere; }
.mdl__p { margin: 0 0 20px; color: var(--muted); font-size: .95rem; line-height: 1.5; }
.mdl__acts { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.mdl__danger { background: #c62828; color: #fff; }
.mdl__danger:hover { background: #a91f1f; }
.mdl__in { width: 100%; margin: 0 0 20px; }
.mdl__in[hidden], .mdl__p[hidden] { display: none; }
@media (max-width: 420px) { .mdl__acts .btn { flex: 1; } }
/* Herramienta tipo aplicación: cabecera compacta y sin caja */
.hero--app { padding: 20px 0 6px; }
.hero--app h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.tool--app { padding: 0; }
.appintro { padding-top: 26px; }
.appintro .lead { margin: 0 0 14px; font-size: 1.02rem; }
.lib__priv { display: flex; gap: 8px; margin: 20px 0 0; font-size: .85rem; color: var(--muted); line-height: 1.45; }
.lib__priv .rico { margin-top: 2px; }

/* Lector a pantalla completa */
html.rdr-open, html.rdr-open body { overflow: hidden; }
.rdr { --rbg: #fffdf8; --rtx: #222; --rmu: #6b6b6b; --rln: #e7e2d6; --rsurf: #fff; --rd-size: 19px; --lh: 1.65; --mg: 24px; --primary: #4f46e5; position: fixed; inset: 0; z-index: 2000; display: flex; flex-direction: column; background: var(--rbg); color: var(--rtx); font-family: var(--font); -webkit-tap-highlight-color: transparent; }
.rdr[hidden] { display: none; }
.rdr[data-theme="sepia"] { --rbg: #f4ecd8; --rtx: #3b2f22; --rmu: #7a6a55; --rln: #e0d3b6; --rsurf: #faf4e6; }
.rdr[data-theme="gray"] { --rbg: #e3e3e1; --rtx: #1f1f1f; --rmu: #5f5f5c; --rln: #cdcdca; --rsurf: #ececea; }
.rdr[data-theme="dark"] { --primary: #8f96fa; --rbg: #15161a; --rtx: #d6d6d6; --rmu: #8d8f96; --rln: #2b2d33; --rsurf: #1e2026; }
.rdr[data-spacing="compact"] { --lh: 1.45; --mg: 16px; }
.rdr[data-spacing="wide"] { --lh: 1.9; --mg: 34px; }
.rdr__ib { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0 8px; border: 0; border-radius: 12px; background: none; color: var(--rtx); font: 800 17px/1 var(--font); cursor: pointer; flex: none; }
.rdr__ib:hover { background: color-mix(in srgb, var(--rtx) 8%, transparent); }
.rdr__ib[aria-pressed="true"], .rdr__ib[aria-expanded="true"] { color: var(--primary); }
.rdr__ib[aria-pressed="true"] .rico { fill: currentColor; }
.rdr__aa { font-family: Georgia, serif; }
.rdr__top { flex: none; display: flex; align-items: center; gap: 2px; height: 60px; padding: 0 8px; background: var(--rsurf); border-bottom: 1px solid var(--rln); z-index: 3; }
.rdr__back span { font-size: 14px; font-weight: 700; }
.rdr__title { flex: 1; min-width: 0; text-align: center; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; }
.rdr__body { flex: 1; min-height: 0; display: flex; position: relative; }
.rdr__stage { position: relative; flex: 1; min-width: 0; overflow: hidden; }
.rdr__view { position: absolute; inset: 46px 0 42px; overflow: hidden; outline: none; }
.rdr__run { position: absolute; top: 15px; left: 56px; right: 56px; text-align: center; font-size: 11.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--rmu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdr__mini { position: absolute; left: var(--mg); right: var(--mg); bottom: 13px; display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--rmu); pointer-events: none; }
.rdr__ribbon { position: absolute; top: 0; right: 22px; width: 18px; height: 32px; background: var(--primary); clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 76%, 0 100%); z-index: 1; }
.rdr__ribbon[hidden] { display: none; }
.rdr__page { font-family: Georgia, "Iowan Old Style", "Palatino Linotype", serif; font-size: var(--rd-size); line-height: var(--lh); overflow-wrap: break-word; }
.rdr[data-font="sans"] .rdr__page { font-family: var(--font); }
.rdr[data-font="dys"] .rdr__page { font-family: Verdana, Tahoma, var(--font); letter-spacing: .05em; word-spacing: .16em; }
.rdr__page h1, .rdr__page h2, .rdr__page h3, .rdr__page h4 { line-height: 1.25; text-align: center; font-weight: normal; margin: .3em 0 .9em; break-after: avoid; }
.rdr__page h1 { font-size: 1.45em; } .rdr__page h2 { font-size: 1.3em; } .rdr__page h3 { font-size: 1.15em; }
.rdr__page p { margin: 0 0 .8em; }
.rdr[data-justify="1"] .rdr__page p { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.rdr__page img { display: block; max-width: 100%; max-height: var(--colh, 80vh); width: auto; height: auto; margin: .6em auto; object-fit: contain; break-inside: avoid; }
.rdr__page a { color: inherit; text-decoration: underline; text-decoration-color: var(--primary); }
.rdr__page blockquote { margin: 1em 1.2em; font-style: italic; }
.rdr__page pre { white-space: pre-wrap; font-size: .85em; }
.rdr__page table { border-collapse: collapse; margin: 1em auto; max-width: 100%; }
.rdr__page td, .rdr__page th { border: 1px solid var(--rln); padding: .2em .5em; }
.rdr__page mark { color: inherit; }
.rdr__page mark.hl { background: rgba(250, 204, 21, .42); border-radius: 2px; cursor: pointer; }
.rdr[data-theme="dark"] .rdr__page mark.hl { background: rgba(250, 204, 21, .28); }
.rdr__page mark.hl-find { background: color-mix(in srgb, var(--primary) 30%, transparent); border-radius: 2px; }
::highlight(rdr-tts) { background-color: rgba(79, 70, 229, .22); }
.rdr[data-mode="pages"] .rdr__page { height: 100%; margin: 0 var(--mg); column-fill: auto; }
.rdr[data-mode="scroll"] .rdr__view { overflow-y: auto; }
.rdr[data-mode="scroll"] .rdr__page { max-width: 36em; margin: 0 auto; padding: 6px var(--mg) 48px; }
.rdr[data-mode="scroll"] .rdr__run { display: none; }
.rdr[data-mode="scroll"] .rdr__view { top: 0; }
.rdr__page.is-comic img { margin: 0 auto; }
.rdr__arrow { position: absolute; top: 50%; margin-top: -22px; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--rln); background: var(--rsurf); color: var(--rtx); display: none; align-items: center; justify-content: center; cursor: pointer; z-index: 2; }
.rdr__arrow--prev { left: 14px; } .rdr__arrow--next { right: 14px; }
.rdr__arrow:disabled { opacity: .35; cursor: default; }
.rdr__bot { flex: none; background: var(--rsurf); border-top: 1px solid var(--rln); padding: 12px 18px 14px; z-index: 3; }
.rdr__row { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; color: var(--rmu); margin-bottom: 4px; }
.rdr__row b { color: var(--rtx); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rdr__row span { white-space: nowrap; }
.rdr__seek { position: relative; height: 26px; }
.rdr__ticks { position: absolute; left: 9px; right: 9px; top: 9px; height: 8px; pointer-events: none; }
.rdr__ticks i { position: absolute; top: 0; width: 2px; height: 8px; margin-left: -1px; background: var(--rmu); opacity: .4; }
#seek { position: relative; display: block; width: 100%; height: 26px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
#seek::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(to right, var(--primary) var(--p, 0%), var(--rln) var(--p, 0%)); }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
#seek::-moz-range-track { height: 4px; border-radius: 2px; background: var(--rln); }
#seek::-moz-range-progress { height: 4px; border-radius: 2px; background: var(--primary); }
#seek::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 2px solid var(--primary); }
.rdr__acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 6px; }
.rdr__acts button { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 0; border: 0; border-radius: 10px; background: none; color: var(--rtx); font: 600 11.5px var(--font); cursor: pointer; }
.rdr__acts button:hover { background: color-mix(in srgb, var(--rtx) 7%, transparent); }
/* Panel lateral: índice, marcadores, subrayados y búsqueda */
.rdr__side { flex: none; width: 320px; display: flex; flex-direction: column; min-height: 0; background: var(--rsurf); border-right: 1px solid var(--rln); }
.rdr__side[hidden] { display: none; }
.rdr__sidetop { display: none; align-items: center; gap: 6px; height: 60px; padding: 0 8px; border-bottom: 1px solid var(--rln); flex: none; }
.rdr__sidetop strong { flex: 1; min-width: 0; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; padding-right: 44px; }
.rdr__tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rln); padding: 0 6px; flex: none; overflow-x: auto; scrollbar-width: none; }
.rdr__tabs button { flex: 1 1 auto; padding: 13px 7px 11px; border: 0; border-bottom: 2.5px solid transparent; background: none; color: var(--rmu); font: 700 12.5px var(--font); cursor: pointer; white-space: nowrap; }
.rdr__tabs button[aria-selected="true"] { color: var(--primary); border-bottom-color: var(--primary); }
.rdr__pane { flex: 1; min-height: 0; overflow-y: auto; padding: 10px 12px 24px; }
.rdr__pane[hidden] { display: none; }
.rdr__pane ol { list-style: none; margin: 0; padding: 0; }
.rdr__pane ol ol { padding-left: 14px; }
.rdr__toca { display: block; padding: 8px 10px; border-radius: 9px; color: var(--rtx); font-size: 14px; line-height: 1.35; text-decoration: none; }
.rdr__toca:hover { background: color-mix(in srgb, var(--rtx) 7%, transparent); text-decoration: none; }
.rdr__toca.is-current { background: color-mix(in srgb, var(--primary) 13%, transparent); color: var(--primary); font-weight: 700; }
.rdr__item { display: flex; align-items: flex-start; gap: 4px; border-bottom: 1px solid var(--rln); }
.rdr__go { flex: 1; min-width: 0; display: block; padding: 12px 4px; border: 0; background: none; color: var(--rtx); text-align: left; cursor: pointer; font: inherit; }
.rdr__go small { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.rdr__go small span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rdr__go small em { font-style: normal; color: var(--rmu); text-transform: none; letter-spacing: 0; font-weight: 600; flex: none; }
.rdr__go p { margin: 5px 0 0; font-family: Georgia, serif; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.rdr__go mark { background: color-mix(in srgb, var(--primary) 18%, transparent); color: inherit; font-weight: 700; border-radius: 3px; padding: 0 2px; }
.rdr__go.is-hl p { border-left: 3px solid rgba(234, 179, 8, .85); padding-left: 8px; }
.rdr__item .rdr__ib { margin-top: 6px; color: var(--rmu); }
.rdr__empty { color: var(--rmu); font-size: 14px; padding: 16px 4px; line-height: 1.5; margin: 0; }
.rdr__search { display: flex; align-items: center; gap: 8px; height: 46px; margin: 4px 0 8px; padding: 0 12px; border: 1.5px solid var(--primary); border-radius: 12px; background: var(--rbg); color: var(--rtx); }
.rdr__search input { flex: 1; min-width: 0; border: 0; background: none; color: inherit; font: 15px var(--font); outline: none; }
#findCount { font-size: 12.5px; color: var(--rmu); white-space: nowrap; }
/* Ajustes de lectura */
.rdr__shade { position: fixed; inset: 0; z-index: 5; background: rgba(10, 10, 10, .32); }
.rdr__shade[hidden] { display: none; }
.rdr__sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; max-height: 88vh; overflow-y: auto; background: var(--rsurf); color: var(--rtx); border-radius: 22px 22px 0 0; border-top: 1px solid var(--rln); padding: 10px 20px max(22px, env(safe-area-inset-bottom)); box-shadow: 0 -10px 40px rgba(0, 0, 0, .18); }
.rdr__sheet[hidden] { display: none; }
.rdr__grab { width: 40px; height: 5px; border-radius: 3px; background: var(--rln); margin: 0 auto 10px; }
.rdr__sh { display: flex; align-items: center; justify-content: space-between; font-size: 16px; margin: 0 0 8px; }
.rdr__opt { margin-bottom: 16px; }
.rdr__lab { display: block; font-size: 12.5px; color: var(--rmu); font-weight: 600; margin-bottom: 7px; }
.rdr__size { display: flex; align-items: center; gap: 12px; }
.rdr__sz { border: 1px solid var(--rln); font-family: var(--font); }
#size { flex: 1; min-width: 0; accent-color: var(--primary); }
.rdr__sw { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rdr__sw button { display: flex; flex-direction: column; align-items: center; gap: 6px; border: 0; background: none; color: var(--rtx); font: 12px var(--font); cursor: pointer; padding: 0; }
.rdr__sw i { display: flex; align-items: center; justify-content: center; width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--rln); font: 700 17px Georgia, serif; }
.rdr__sw button[aria-pressed="true"] i { outline: 2.5px solid var(--primary); outline-offset: 2px; }
.rdr__seg { display: flex; gap: 3px; padding: 3px; border: 1px solid var(--rln); border-radius: 12px; }
.rdr__seg button { flex: 1; min-width: 0; height: 38px; border: 0; border-radius: 9px; background: none; color: var(--rtx); font: 600 13.5px var(--font); cursor: pointer; }
.rdr__seg button[aria-pressed="true"] { background: var(--primary); color: #fff; }
.rdr[data-theme="dark"] .rdr__seg button[aria-pressed="true"] { color: #15161a; }
.rdr__tog { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 600; cursor: pointer; }
.rdr__tog input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 46px; height: 28px; margin: 0; border-radius: 14px; background: var(--rln); cursor: pointer; transition: background .15s; }
.rdr__tog input::after { content: ''; position: absolute; left: 3px; top: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .2); transition: left .15s; }
.rdr__tog input:checked { background: var(--primary); }
.rdr__tog input:checked::after { left: 21px; }
/* Subrayar y leer en voz alta */
.rdr__selbar { position: fixed; z-index: 7; transform: translate(-50%, calc(-100% - 10px)); }
.rdr__selbar[hidden] { display: none; }
.rdr__selbar button { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 14px; border: 0; border-radius: 10px; background: #1f2330; color: #fff; font: 700 13.5px var(--font); box-shadow: 0 6px 20px rgba(0, 0, 0, .25); cursor: pointer; white-space: nowrap; }
.rdr__tts { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 4; display: flex; align-items: center; gap: 6px; padding: 6px 8px 6px 6px; border-radius: 16px; background: var(--rsurf); border: 1px solid var(--rln); box-shadow: 0 8px 30px rgba(0, 0, 0, .18); }
.rdr__tts[hidden] { display: none; }
.rdr__ttsl { font-size: 13px; font-weight: 600; padding: 0 4px; white-space: nowrap; }
.rdr__tts .select { width: auto; min-height: 36px; padding: 4px 8px; font-size: 13px; background-color: transparent; color: var(--rtx); border-color: var(--rln); }
/* PDF: páginas originales */
.rdr.is-pdf .rdr__view { inset: 0 !important; overflow-y: auto; background: #5c5f66; padding: 12px 0; }
.rdr.is-pdf .rdr__run, .rdr.is-pdf .rdr__mini, .rdr.is-pdf .rdr__textonly, .rdr.is-pdf #size, .rdr.is-pdf [data-nopdf] { display: none !important; }
.rdr__pdfpage { width: min(calc((100% - 16px) * var(--pdf-z, 1)), calc(820px * var(--pdf-z, 1))); max-width: none; margin: 0 auto 12px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); }
.rdr__pdfpage canvas { display: block; width: 100%; height: 100%; }
/* Móvil: las barras aparecen al tocar el centro de la página */
@media (max-width: 899px) {
  .rdr__desk { display: none !important; }
  .rdr__back span { display: none; }
  .rdr__top, .rdr__bot { position: absolute; left: 0; right: 0; transition: transform .2s, opacity .2s; }
  .rdr__top { top: 0; }
  .rdr__bot { bottom: 0; padding-bottom: max(14px, env(safe-area-inset-bottom)); }
  .rdr:not(.is-chrome) .rdr__top { transform: translateY(-100%); opacity: 0; pointer-events: none; }
  .rdr:not(.is-chrome) .rdr__bot { transform: translateY(100%); opacity: 0; pointer-events: none; }
  .rdr__side { position: absolute; inset: 0; width: auto; z-index: 4; border-right: 0; }
  .rdr__sidetop { display: flex; }
  .rdr.is-chrome .rdr__tts { bottom: 176px; }
  /* Con los menús a la vista, el texto ocupa solo el hueco entre las barras (no queda nada debajo) */
  .rdr.is-chrome:not(.is-pdf) .rdr__view { top: calc(var(--ct, 60px) + 14px); bottom: calc(var(--cb, 170px) + 10px); }
  .rdr.is-chrome .rdr__run, .rdr.is-chrome .rdr__mini { visibility: hidden; }
}
@media (min-width: 900px) {
  .rdr__top { height: 64px; padding: 0 16px; }
  .rdr__acts, .rdr__mini { display: none; }
  .rdr__bot { display: flex; align-items: center; gap: 18px; height: 56px; padding: 0 28px; }
  .rdr__row { display: contents; }
  .rdr__seek { order: 1; flex: 1; }
  #pctText { order: 2; font-size: 12.5px; color: var(--rmu); }
  #posText { font-weight: 400; color: var(--rmu); font-size: 12.5px; max-width: 34%; }
  .rdr__arrow { display: flex; }
  .rdr__view { inset: 46px 72px 26px; }
  .rdr[data-mode="scroll"] .rdr__view { inset: 0 72px; }
  .rdr__sheet { left: auto; right: 16px; top: 72px; bottom: auto; width: 380px; max-height: calc(100vh - 90px); border-radius: 16px; border: 1px solid var(--rln); box-shadow: 0 16px 50px rgba(0, 0, 0, .2); padding-bottom: 20px; }
  .rdr__grab { display: none; }
  .rdr__shade { background: transparent; }
  .rdr__tts { bottom: 74px; }
}

/* ---------- Conversor de ebooks: lista de libros ---------- */
.ebooklist { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ebookitem { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ebookitem__cover { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 60px; border-radius: 6px; background: var(--surface); color: var(--muted); overflow: hidden; }
.ebookitem__cover img { width: 100%; height: 100%; object-fit: cover; }
.ebookitem__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.ebookitem__meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ebookitem__meta span, .ebookitem__meta small { font-size: .85rem; overflow: hidden; text-overflow: ellipsis; }
.ebookitem__meta small { font-size: .78rem; white-space: nowrap; }
.ebookitem__err { color: var(--err); }
.ebookitem__x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer; }
.ebookitem__x:hover { background: var(--surface); color: var(--text); }

/* ---------- Publicidad ----------
 * Los bloques van siempre fuera de la herramienta. El espacio se reserva (min-height) para que el anuncio no desplace
 * el contenido al cargar. Sin anuncios (ADS_PREVIEW y ADS_ENABLED apagados) no se pinta nada y «Cómo funciona» ocupa
 * todo el ancho como antes. Si AdSense no tiene anuncio (unfilled) o su script no carga, app.js pliega el hueco sin
 * mover lo que el usuario está leyendo (ver collapseAd). Los anuncios reales no se recortan ni se tapan. */
.ad { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; margin: 0 auto; border-radius: 10px; overflow: hidden; }
/* Anuncio real: sin recorte (los adaptables a ancho completo en móvil pueden salirse del contenedor a propósito) */
.ad--live { overflow: visible; border-radius: 0; }
/* Debajo de la herramienta: 40 px de separación con sus botones (evita clics por error) */
.adtool { margin-top: 40px; }
.adhome { margin-top: 26px; } /* portada: debajo de «Más usadas» (el contenedor .wrap lo centra) */
.admid { padding-top: 8px; padding-bottom: 8px; }
.ad--herramienta, .ad--contenido, .ad--portada { max-width: 728px; min-height: 280px; }
@media (min-width: 768px) { .ad--herramienta, .ad--contenido, .ad--portada { min-height: 250px; } }
.ad--preview { background: var(--ad-bg); color: var(--ad-fg); border: 1px solid var(--ad-line); }
.ad__tag { font-weight: 700; font-size: 1.05rem; letter-spacing: .04em; }
.ad--live { align-items: stretch; justify-content: flex-start; }
.ad--live .adsbygoogle { width: 100%; min-height: inherit; }
.ad__label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; text-align: center; padding: 0 0 4px; }
/* Plegado de un hueco sin anuncio: suave si está a la vista; instantáneo (y compensando el scroll) fuera de ella */
.ad-collapsing { overflow: hidden; transition: height .35s ease, margin .35s ease, padding .35s ease, opacity .25s ease; opacity: 0; }
.ad-collapsed { display: none !important; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; text-decoration: underline; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: scale(.94); opacity: 0; } }
@keyframes slidein { from { transform: translateY(20px); opacity: 0; } }

.toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 95; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: #0f172a; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem; box-shadow: var(--shadow-lg); animation: slidein .25s ease; max-width: calc(100vw - 32px); }
.toast--err { background: var(--err); }

/* ---------- Footer ---------- */
.footer { margin-top: 64px; background: var(--surface); border-top: 1px solid var(--line); padding: 48px 0 20px; font-size: .92rem; }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
@media (max-width: 900px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__grid > :first-child { grid-column: 1 / -1; } }
.footer__h { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--text); margin: 0 0 10px; }
.footer__list { list-style: none; padding: 0; margin: 0 0 16px; }
.footer__list li { margin: 6px 0; }
.footer__list a { color: var(--text); }
.footer__grid > :not(:first-child) .footer__list a { color: var(--muted); }
.footer__list a:hover { color: var(--text); }
.footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); margin-top: 24px; padding-top: 18px; color: var(--muted); font-size: .88rem; }
.brand--footer { font-size: 1.2rem; margin-bottom: 6px; }

/* ---------- Calculators ---------- */
.calc { max-width: 400px; margin: 0 auto; }
.calc__screen { background: #0f172a; color: #fff; border-radius: 12px; padding: 14px 16px; text-align: right; margin-bottom: 12px; min-height: 92px; display: flex; flex-direction: column; justify-content: flex-end; }
.calc__expr { font-family: var(--mono); font-size: .95rem; color: #94a3b8; min-height: 1.4em; word-break: break-all; }
.calc__out { font-family: var(--mono); font-size: 2rem; font-weight: 700; word-break: break-all; line-height: 1.2; }
.calc__keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.calc__keys button { font: inherit; font-weight: 650; font-size: 1.05rem; min-height: 50px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.calc__keys button:hover { background: var(--surface-2); }
.calc__keys .k-op { background: var(--primary-50); color: var(--primary); }
.calc__keys .k-eq { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.calc__keys .k-fn { font-size: .88rem; color: var(--muted); }
.outbox { margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--primary-50); }
.outbox strong { font-size: 1.5rem; color: var(--primary); display: block; }
.kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.kv > div { background: var(--surface-2); border-radius: 10px; padding: 10px 12px; }
.kv span { display: block; font-size: .8rem; color: var(--muted); }
.kv b { font-size: 1.15rem; }

/* ---------- Speed test ---------- */
.speed { text-align: center; }
.gauge { position: relative; width: min(320px, 100%); margin: 0 auto; }
.gauge svg { width: 100%; height: auto; display: block; }
/* El estado («Listo», «Descarga»…) va debajo de «Mbps», en el hueco entre las marcas 0 y 1000: encima chocaba con la marca 50 */
.gauge__val { position: absolute; left: 0; right: 0; bottom: 4%; text-align: center; display: flex; flex-direction: column; align-items: center; }
.gauge__val .gauge__phase { order: 3; margin-top: 6px; }
.gauge__num { font-size: clamp(1.9rem, 7vw, 2.35rem); font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.gauge__unit { color: var(--muted); font-weight: 600; }
.gauge__phase { font-size: .9rem; color: var(--primary); font-weight: 700; text-transform: uppercase; letter-spacing: .08em; min-height: 1.4em; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 18px 0; }
@media (max-width: 600px) { .metrics { grid-template-columns: repeat(2, 1fr); } }
.metric { background: var(--surface-2); border-radius: 12px; padding: 12px; }
.metric span { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.metric b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.metric small { color: var(--muted); }

/* ---------- QR ---------- */
.qrout { display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--surface-2); border-radius: 12px; min-height: 280px; }
.qrout canvas, .qrout svg { width: min(300px, 100%); height: auto; image-rendering: pixelated; background: #fff; border-radius: 6px; }
.viewer3d { width: 100%; aspect-ratio: 4 / 3; border-radius: 12px; background: linear-gradient(180deg, #e9edf6, #cfd6e6); overflow: hidden; position: relative; touch-action: none; }
.viewer3d canvas { width: 100% !important; height: 100% !important; display: block; }
.viewer__nogl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; font-size: .92rem; line-height: 1.45; color: #1e293b; }
.viewer3d__hint { position: absolute; left: 10px; bottom: 8px; font-size: .78rem; color: #475569; background: rgba(255, 255, 255, .7); padding: 2px 8px; border-radius: 6px; pointer-events: none; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }

.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.legal { max-width: 820px; }
.legal li { margin: 6px 0; color: var(--muted); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ad--live { border: 0; background: none; }
.legal h2 { margin-top: 1.4em; font-size: 1.3rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* ---------- Herramientas PDF avanzadas ---------- */
.adv { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 14px; background: var(--surface); }
.adv > summary { cursor: pointer; font-weight: 650; list-style: none; }
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: "▸ "; color: var(--primary); }
.adv[open] > summary::before { content: "▾ "; }
.pdfbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); position: sticky; top: 70px; z-index: 5; }
.pdfbar .sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.tbtn { font: inherit; font-size: .85rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 8px; border: 1px solid transparent; background: transparent; color: var(--text); cursor: pointer; }
.tbtn:hover { background: var(--surface-2); }
.tbtn[aria-pressed="true"] { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.tbtn:disabled { opacity: .45; cursor: not-allowed; }
.pdfbar label.mini { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.pdfbar label.mini .input, .pdfbar label.mini .select { width: auto; padding: 5px 8px; min-height: 0; font-size: .85rem; }
.pdfbar label.mini input[type=color] { width: 34px; height: 30px; padding: 2px; }
.pdfstage { display: flex; justify-content: center; padding: 16px; background: var(--surface-2); border-radius: var(--radius-sm); margin-top: 10px; overflow: auto; }
.pdfpage { position: relative; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); background: #fff; line-height: 0; touch-action: none; user-select: none; }
.pdfpage canvas { display: block; max-width: none; }
.pdfpage .layer { position: absolute; inset: 0; line-height: normal; }
.pdfpage[data-mode="select"] .layer { cursor: default; }
.pdfpage:not([data-mode="select"]) .layer { cursor: crosshair; }
.eobj { position: absolute; box-sizing: border-box; }
.eobj.is-sel { outline: 2px dashed var(--primary); outline-offset: 2px; }
.eobj--text { white-space: pre; font-family: Helvetica, Arial, sans-serif; line-height: 1.15; padding: 0; min-width: 8px; outline: none; cursor: move; }
.eobj--text[contenteditable="true"] { cursor: text; outline: 2px solid var(--primary); background: rgba(255, 255, 255, .6); }
.eobj--img img { width: 100%; height: 100%; display: block; pointer-events: none; }
.eobj--img, .eobj--rect, .eobj--hl, .eobj--white, .eobj--redact { cursor: move; }
.eobj--redact { background: #000; }
.eobj--redact.is-auto { background: rgba(0, 0, 0, .85); }
.eobj .grip { position: absolute; right: -7px; bottom: -7px; width: 14px; height: 14px; border-radius: 50%; background: var(--primary); border: 2px solid #fff; cursor: nwse-resize; display: none; }
.eobj.is-sel .grip { display: block; }
.eobj .del { position: absolute; right: -10px; top: -12px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: var(--err); color: #fff; font-size: 14px; line-height: 22px; text-align: center; cursor: pointer; display: none; padding: 0; }
.eobj.is-sel .del { display: block; }
.layer svg.ink { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.pagenav { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 10px; font-size: .9rem; }
.cropbox { position: absolute; border: 2px solid var(--primary); box-shadow: 0 0 0 9999px rgba(15, 23, 42, .45); cursor: move; }
.cropbox i { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid var(--primary); border-radius: 3px; }
.cropbox i[data-h="nw"] { left: -8px; top: -8px; cursor: nwse-resize; }
.cropbox i[data-h="ne"] { right: -8px; top: -8px; cursor: nesw-resize; }
.cropbox i[data-h="sw"] { left: -8px; bottom: -8px; cursor: nesw-resize; }
.cropbox i[data-h="se"] { right: -8px; bottom: -8px; cursor: nwse-resize; }
.pdfpage--crop { overflow: hidden; }
.formfields { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.formfields .field small { color: var(--muted); font-weight: 400; }
.diff { font-size: .95rem; line-height: 1.65; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px 18px; max-height: 70vh; overflow: auto; background: var(--surface); white-space: pre-wrap; word-break: break-word; }
.diff ins { background: rgba(22, 163, 74, .18); color: inherit; text-decoration: none; border-bottom: 2px solid #16a34a; }
.diff del { background: rgba(220, 38, 38, .16); color: inherit; text-decoration: line-through; text-decoration-color: #dc2626; }
.diff .pg { display: block; margin: 14px 0 6px; font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.diff .pg:first-child { margin-top: 0; }
.diff .gap { display: block; color: var(--muted); font-style: italic; margin: 6px 0; }
.diffstats { display: flex; gap: 10px; flex-wrap: wrap; margin: 12px 0; }
.diffstats span { padding: 5px 12px; border-radius: 999px; font-size: .85rem; font-weight: 650; background: var(--surface-2); }
.diffstats .a { color: var(--ok); } .diffstats .r { color: #b91c1c; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .diffstats .r { color: var(--err); } }
:root[data-theme="dark"] .diffstats .r { color: var(--err); }
.vdiff { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.vdiff figure { margin: 0; text-align: center; font-size: .82rem; color: var(--muted); }
.vdiff canvas { width: 100%; height: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.two-drops { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.two-drops .dropzone { min-height: 150px; }
.two-drops .dropzone.has-file { border-style: solid; border-color: var(--ok); }
.scanlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 14px; }
.scanitem { border: 1px solid var(--line); border-radius: 10px; padding: 6px; background: var(--surface); text-align: center; font-size: .8rem; }
.scanitem img { width: 100%; height: 150px; object-fit: contain; background: var(--surface-2); border-radius: 6px; display: block; }
.scanitem .acts { display: flex; justify-content: center; gap: 2px; margin-top: 4px; }
.scanitem .acts button { font-size: .95rem; padding: 4px 6px; border: 0; background: none; cursor: pointer; border-radius: 6px; color: var(--text); }
.scanitem .acts button:hover { background: var(--surface-2); }
.scanedit { position: relative; display: inline-block; touch-action: none; user-select: none; line-height: 0; }
.scanedit canvas { max-width: 100%; max-height: 70vh; display: block; }
.scanedit svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.scanedit .h { fill: #fff; stroke: var(--primary); stroke-width: 3; cursor: grab; }
.camera { position: relative; background: #000; border-radius: var(--radius-sm); overflow: hidden; line-height: 0; }
.camera video { width: 100%; max-height: 60vh; object-fit: contain; }
.camera .actions { position: absolute; left: 0; right: 0; bottom: 12px; justify-content: center; margin: 0; line-height: normal; }
.mdout { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .88rem; }
@media (max-width: 720px) {
  .two-drops, .vdiff { grid-template-columns: 1fr; }
  .pdfbar { position: static; gap: 4px; }
  .tbtn { padding: 6px 8px; }
  .pdfstage { padding: 8px; }
}

/* Calculadora de horas trabajadas */
.hcalc__head, .hcalc__row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, .8fr) minmax(64px, .7fr) 40px; gap: 8px; align-items: center; }
.hcalc__head { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 650; padding: 0 2px 6px; }
.hcalc__row { padding: 6px 0; border-top: 1px solid var(--line); }
.hcalc__cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.hcalc__cell > span { display: none; font-size: .8rem; font-weight: 650; color: var(--muted); }
.hcalc__cell .input { min-width: 0; padding: 8px; }
.hcalc__tot { font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.hcalc__row.is-night .hcalc__tot::after { content: " ☾"; color: var(--muted); }
.hcalc__del { padding: 0; width: 40px; min-height: 40px; justify-content: center; }
@media (max-width: 640px) {
  .hcalc__head { display: none; }
  .hcalc__row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, .5fr) 40px; grid-template-areas: "day day tot del" "ini fin pau pau"; padding: 12px 0; column-gap: 6px; row-gap: 10px; }
  .hcalc__cell > span { display: block; }
  .hcalc__cell .input { padding: 8px 6px; }
  .hcalc__day { grid-area: day; }
  .hcalc__row > .hcalc__cell:nth-child(2) { grid-area: ini; }
  .hcalc__row > .hcalc__cell:nth-child(3) { grid-area: fin; }
  .hcalc__row > .hcalc__cell:nth-child(4) { grid-area: pau; }
  .hcalc__tot { grid-area: tot; align-self: end; padding-bottom: 10px; }
  .hcalc__del { grid-area: del; align-self: end; }
}

/* Letra del DNI y validar NIE y CIF */
.dni__in, .dni__ta { font-family: var(--mono); letter-spacing: .03em; }
.dni__out strong { font-family: var(--mono); overflow-wrap: anywhere; }
.dni__out--ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.dni__out--ok strong { color: var(--ok); }
.dni__out--err { background: color-mix(in srgb, var(--err) 12%, var(--surface)); }
.dni__out--err strong { color: var(--err); }
.dni__ok { color: color-mix(in srgb, var(--ok) 75%, var(--text)); font-weight: 650; } /* verde con contraste AA también en modo claro */
.dni__err { color: var(--err); font-weight: 650; }

/* Validar IBAN */
.iban__in, .iban__ta, .iban__mono { font-family: var(--mono); letter-spacing: .03em; }
.iban__out strong { font-family: var(--mono); font-size: 1.3rem; overflow-wrap: anywhere; }
.iban__out--ok { background: color-mix(in srgb, var(--ok) 12%, var(--surface)); }
.iban__out--ok strong { color: var(--ok); }
.iban__out--err { background: color-mix(in srgb, var(--err) 12%, var(--surface)); }
.iban__out--err strong { color: var(--err); }
.iban__ok { color: color-mix(in srgb, var(--ok) 75%, var(--text)); font-weight: 650; } /* verde con contraste AA también en modo claro */
.iban__err { color: var(--err); font-weight: 650; }

/* Sorteos */
.srt-list { font-family: var(--mono); font-size: .92rem; }
.srt-wheel { position: relative; width: 100%; max-width: 440px; margin: 0 auto; }
.srt-wheel canvas { display: block; width: 100%; height: auto; aspect-ratio: 1; cursor: pointer; }
.srt-wheel__pointer { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 28px solid var(--text); z-index: 1; filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25)); }
.srt-live { text-align: center; font-weight: 700; font-size: 1.1rem; min-height: 1.6em; margin: 0; word-break: break-word; }
.srt-result { margin-top: 18px; padding: 16px 18px; border: 2px solid var(--primary); border-radius: var(--radius); background: var(--primary-50); }
.srt-result__head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; }
.srt-result__head strong { font-size: 1.05rem; }
.srt-result__meta { margin: 12px 0 0; font-size: .85rem; color: var(--muted); }
.srt-big { font-size: clamp(1.6rem, 6vw, 2.6rem); font-weight: 800; color: var(--primary); margin: 10px 0 4px; line-height: 1.15; word-break: break-word; }
.srt-roll { opacity: .55; }
.srt-sub { margin: 12px 0 4px; font-weight: 700; font-size: .85rem; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; }
.srt-ol { margin: 0; padding-left: 1.6em; font-size: 1.05rem; font-weight: 600; word-break: break-word; }
.srt-nums { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; max-height: 340px; overflow: auto; }
.srt-nums span { min-width: 3em; text-align: center; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-variant-numeric: tabular-nums; }
.srt-teams { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 10px; }
.srt-team { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; min-width: 0; }
.srt-team b { color: var(--primary); }
.srt-team__n { float: right; font-size: .8rem; color: var(--muted); }
.srt-team ul { margin: 6px 0 0; padding-left: 1.2em; word-break: break-word; }
.srt-confetti { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 9999; }
@media (prefers-reduced-motion: reduce) { .srt-confetti { display: none; } }

/* Generador de currículum */
.cv-privacy { margin-bottom: 16px; }
.cv--drop { outline: 2px dashed var(--primary); outline-offset: 6px; border-radius: var(--radius); background: color-mix(in srgb, var(--primary) 5%, transparent); }
#importNote { margin-top: 0; }
.cv-designs { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 380px; }
.cv-thumb--clasica i { height: 5px; background: var(--a); }
.cv-thumb--moderna { padding-left: 44%; }
.cv-thumb--moderna i { top: 0; bottom: 0; right: auto; width: 32%; background: var(--a); }
.cv-thumb--minimal i { height: 0; }
.cv-thumb--minimal b:last-child { background: #334155; height: 3px; }
.cv-colors { align-items: flex-end; }
.cv-swatches { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; flex: 1 1 220px; padding-bottom: 7px; }
.cv-swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.cv-swatches button[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--primary); }
.cv-sec { padding: 12px 16px; box-shadow: none; }
.cv-sec > summary { cursor: pointer; font-size: .95rem; color: var(--text); }
.cv-sec[open] > summary { margin-bottom: 10px; }
.cv-items { display: flex; flex-direction: column; gap: 10px; }
.cv-item { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cv-item__head { display: flex; align-items: center; gap: 8px; }
.cv-item__head b { flex: 1; min-width: 0; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cv-item__btns { display: flex; gap: 4px; flex: none; }
.cv-item .iconbtn:disabled { opacity: .35; cursor: default; pointer-events: none; }
.cv-item .input, .cv-item .select { min-height: 40px; padding: 8px 10px; }
.cv-item .row > * { flex-basis: 140px; }
.cv-item--lang { flex-direction: row; flex-wrap: wrap; align-items: center; }
.cv-item--lang .input { flex: 1 1 140px; width: auto; }
.cv-item--lang .select { flex: 1 1 160px; width: auto; }
.cv-add { margin-top: 10px; }
.cv-photoedit { display: flex; gap: 16px; flex-wrap: wrap; align-items: flex-start; }
.cv-photoedit canvas { width: 160px; height: 160px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); cursor: grab; touch-action: none; flex: none; }
.cv-photoedit canvas:active { cursor: grabbing; }
.cv-photoedit > .stack { flex: 1 1 180px; min-width: 0; }
.cv-side { min-width: 0; }
.cv-sticky { position: sticky; top: 84px; }
.cv-stage { width: 100%; max-height: calc(100vh - 250px); min-height: 320px; overflow: auto; border-radius: 6px; border: 1px solid var(--line); background: #fff; }
.cv-sizer { position: relative; overflow: hidden; }
@media (max-width: 820px) { .cv-sticky { position: static; } .cv-stage { max-height: none; min-height: 0; } }
/* Hoja A4: 794 × 1123 px (1 pt = 1,333 px) */
.cv-sheet { position: absolute; top: 0; left: 0; width: 794px; min-height: 1123px; transform-origin: 0 0; background: #fff; color: #333847; font: 12.8px/1.42 Helvetica, Arial, sans-serif; text-align: left; }
.cv-sheet::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(to bottom, transparent 0 1121px, rgba(100, 116, 139, .5) 1121px 1123px); }
.cv-sheet h1, .cv-sheet h2, .cv-sheet p, .cv-sheet ul { margin: 0; }
.cv-sheet ul { padding-left: 15px; }
.cv-sheet li::marker { color: var(--cv-acct); }
.cv-sheet p + p, .cv-sheet ul + p, .cv-sheet p + ul { margin-top: 2px; }
.cv-ph { color: #a3acbd; }
.cv-in { padding: 61px; }
.cv-h { display: flex; gap: 24px; align-items: flex-start; justify-content: space-between; }
.cv-h__txt { min-width: 0; flex: 1; }
.cv-h h1 { font-size: 32px; line-height: 1.2; font-weight: 700; color: #1c2130; word-break: break-word; }
.cv-h__title { font-size: 16.7px; color: var(--cv-acct); margin-top: 3px !important; }
.cv-h__contact { font-size: 12px; color: #666e80; margin-top: 8px !important; word-break: break-word; }
.cv-photo { width: 109px; height: 109px; flex: none; display: block; }
.cv-s { margin-top: 21px; }
.cv-s h2 { font-size: 14px; font-weight: 700; text-transform: uppercase; color: var(--cv-acct); padding-bottom: 5px; border-bottom: 1px solid var(--cv-acc); margin-bottom: 11px; }
.cv-e { margin-bottom: 11px; }
.cv-e__top { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.cv-e__top b { font-size: 14px; color: #1c2130; min-width: 0; word-break: break-word; }
.cv-e__top span { font-size: 11.7px; color: #666e80; white-space: nowrap; }
.cv-e__org { font-size: 12.5px; font-style: italic; color: var(--cv-acct); margin-bottom: 3px; }
.cv-t-moderna { display: grid; grid-template-columns: 253px minmax(0, 1fr); }
.cv-aside { background: var(--cv-acc); color: var(--cv-on); padding: 61px 32px; min-width: 0; }
.cv-aside .cv-photo { width: 149px; height: 149px; margin: 0 auto 8px; }
.cv-aside h2 { font-size: 12.7px; font-weight: 700; text-transform: uppercase; border-bottom: 1px solid color-mix(in srgb, currentColor 50%, transparent); padding-bottom: 5px; margin: 19px 0 9px; }
.cv-aside ul { list-style: none; padding: 0; }
.cv-aside li { font-size: 11.7px; line-height: 1.38; margin-bottom: 5px; word-break: break-word; }
.cv-aside li::marker { color: inherit; }
.cv-langs li { display: flex; justify-content: space-between; gap: 10px; }
.cv-mainc { padding: 61px 48px 61px 37px; min-width: 0; }
.cv-mainc .cv-s h2 { border-bottom: 0; position: relative; padding-bottom: 8px; }
.cv-mainc .cv-s h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 32px; height: 3px; background: var(--cv-acc); }
.cv-t-moderna .cv-h h1 { font-size: 32px; }
.cv-t-minimal .cv-in { padding: 67px; }
.cv-t-minimal .cv-h h1 { font-weight: 400; font-size: 33px; }
.cv-t-minimal .cv-h__title { color: #666e80; }
.cv-t-minimal .cv-photo { width: 99px; height: 99px; }
.cv-t-minimal .cv-s { display: grid; grid-template-columns: 157px minmax(0, 1fr); border-top: 1px solid #dde1e9; padding-top: 13px; margin-top: 16px; }
.cv-t-minimal .cv-s h2 { border: 0; font-size: 11.3px; margin: 0; padding: 0 12px 0 0; }
.cv-t-minimal .cv-e__org { font-style: normal; color: #666e80; }

/* ---------- Quitar metadatos de fotos ---------- */
.mdx-list { display: flex; flex-direction: column; gap: 10px; }
.mdx-card { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 12px; min-width: 0; }
.mdx-head { display: flex; align-items: center; gap: 12px; }
.mdx-thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.mdx-thumb--none { display: inline-flex; align-items: center; justify-content: center; font-size: .75rem; font-weight: 700; color: var(--muted); }
.mdx-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mdx-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdx-badges { display: flex; flex-wrap: wrap; gap: 4px; }
.mdx-pill--err { background: color-mix(in srgb, var(--err) 14%, var(--surface)); color: var(--err); }
.mdx-gps { margin-top: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--err); background: color-mix(in srgb, var(--err) 8%, var(--surface)); }
.mdx-gps strong { color: var(--err); }
.mdx-gps strong::before { content: "📍 "; }
.mdx-gps p { margin: 4px 0 0; font-size: .9rem; overflow-wrap: anywhere; }
.mdx-details { margin-top: 10px; }
.mdx-details summary { cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--primary); }
.mdx-details .tablewrap { margin-top: 6px; }
.mdx-details .dtable td { overflow-wrap: anywhere; vertical-align: top; font-size: .88rem; }
.mdx-details .dtable td:first-child { color: var(--muted); width: 42%; }
.mdx-g { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding-top: 12px; }
.mdx-after { margin: 8px 0 0; font-size: .9rem; font-weight: 600; }
.mdx-after--ok { color: var(--ok); }
.mdx-after--err { color: var(--err); }
/* Modo oscuro: el rojo de error estándar no llega al contraste mínimo sobre fondo oscuro */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) :is(.mdx-pill--err, .mdx-gps strong, .mdx-after--err) { color: #f87171; } }
:root[data-theme="dark"] :is(.mdx-pill--err, .mdx-gps strong, .mdx-after--err) { color: #f87171; }

/* ---------- Difuminar imagen ---------- */
.blr-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.blr-group { display: inline-flex; gap: 4px; }
.blr-mini { display: inline-flex; flex-direction: column; gap: 3px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.blr-mini .select { width: auto; min-height: 36px; padding: 5px 8px; font-size: .88rem; }
.blr-mini input[type=range] { width: 130px; }
.blr-mini input[type=color] { width: 48px; height: 36px; padding: 2px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; }
.blr-stage { margin-top: 12px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.blr-canvas { display: block; margin: 0 auto; max-width: 100%; max-height: 70vh; touch-action: none; cursor: crosshair; user-select: none; -webkit-user-select: none; }
.blr-canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ---------- Test de cámara y micrófono ---------- */
.cmt-video { position: relative; margin-top: 14px; background: #000; border-radius: var(--radius-sm); overflow: hidden; line-height: 0; }
.cmt-video video { width: 100%; max-height: 60vh; object-fit: contain; }
.cmt-mirror { transform: scaleX(-1); }
.kv b.cmt-small, .cmt-small { font-size: .9rem; overflow-wrap: anywhere; }
.cmt-level { display: flex; align-items: center; gap: 10px; margin-top: 14px; }
.cmt-level__label { font-size: .85rem; font-weight: 650; color: var(--muted); }
.cmt-meter { position: relative; flex: 1; height: 16px; margin: 0; }
.cmt-meter > i { transition: width .06s linear, background .2s; }
.cmt-meter > s { position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--text); opacity: .6; }
.cmt-level b { min-width: 64px; text-align: right; font-variant-numeric: tabular-nums; }
.cmt-err { margin-top: 14px; padding: 12px 16px; border: 1px solid var(--err); border-radius: 12px; background: color-mix(in srgb, var(--err) 7%, var(--surface)); }
.cmt-err > strong { color: var(--err); }
.cmt-err p, .cmt-err ul, .cmt-err ol { margin: 6px 0 0; font-size: .92rem; }
.cmt-err ul, .cmt-err ol { padding-left: 20px; }
.cmt-err .cmt-err__h { font-weight: 650; margin-top: 10px; }
.cmt-err details { margin-top: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 6px 10px; }
.cmt-err summary { cursor: pointer; font-weight: 650; }
.cmt-err code { overflow-wrap: anywhere; }
.cmt-spk { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.cmt-spk .btn { flex: 1 1 110px; }

/* Cortar audio */
.acut__wave { position: relative; height: 140px; margin-top: 4px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); cursor: pointer; touch-action: none; user-select: none; -webkit-user-select: none; }
.acut__wave canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; }
.acut__shade { position: absolute; top: 0; bottom: 0; background: color-mix(in srgb, var(--surface) 72%, transparent); pointer-events: none; }
.acut__shade--l { left: 0; border-radius: var(--radius-sm) 0 0 var(--radius-sm); }
.acut__shade--r { right: 0; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.acut__head { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--err); pointer-events: none; z-index: 1; }
.acut__handle { position: absolute; top: -6px; bottom: -6px; width: 24px; margin-left: -12px; padding: 0; border: 0; background: none; cursor: ew-resize; touch-action: none; z-index: 2; }
.acut__handle::before { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; width: 3px; margin-left: -1.5px; border-radius: 2px; background: var(--primary); }
.acut__handle::after { content: ''; position: absolute; left: 50%; top: 50%; width: 14px; height: 30px; margin: -15px 0 0 -7px; border-radius: 6px; background: var(--primary); box-shadow: 0 1px 4px rgba(0, 0, 0, .3); }
.acut__handle:focus-visible { outline: none; }
.acut__handle:focus-visible::after { outline: 2px solid var(--text); outline-offset: 2px; }
.acut__dur { font-size: 1.15rem; font-variant-numeric: tabular-nums; padding: 9px 0; }
.acut__time { font-variant-numeric: tabular-nums; }
.acut__result { display: block; width: 100%; margin-top: 14px; }
.acut__warn { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acut__warn[hidden] { display: none; }

/* Unir audios (reutiliza .filelist, .fileitem, .row, .result…) */
.ajoin__result { display: block; width: 100%; margin-top: 14px; }

/* Texto a voz */
.tts__text { min-height: 180px; resize: vertical; line-height: 1.55; }
.tts__val { font-weight: 700; color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.tts__reader { position: relative; margin-top: 14px; max-height: 300px; overflow: auto; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.tts__reader span[data-i] { cursor: pointer; border-radius: 4px; transition: background-color .15s; }
.tts__reader span[data-i]:hover { background: color-mix(in srgb, var(--primary) 10%, transparent); }
.tts__reader span.is-cur { background: color-mix(in srgb, var(--primary) 24%, transparent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 24%, transparent); }
.tts__reader span.is-done { color: var(--muted); }
.tts__audio { display: block; width: 100%; margin-top: 14px; }
.tts__privacy { margin-top: 18px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.tts__privacy p { margin: 0 0 6px; font-size: .92rem; }
.tts__sys { margin-top: 22px; padding: 0 16px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.tts__sys > summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
.tts__sys[open] { padding-bottom: 14px; }

/* Grabadora de voz (reutiliza .rec__live, .rec__dot, .rec__opts de grabar-pantalla) */
.vrec__meter { position: relative; height: 12px; margin-top: 12px; border-radius: 999px; overflow: hidden; background: linear-gradient(90deg, var(--ok) 0 70%, #f59e0b 70% 88%, var(--err) 88%); }
.vrec__meter i { position: absolute; top: 0; right: 0; bottom: 0; width: 100%; background: var(--surface-2); transition: width .06s linear; }
.vrec__wave { display: block; width: 100%; height: 90px; margin-top: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); }
.vrec__title { margin: 22px 0 10px; }
.vrec__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.vrec__item { padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.vrec__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.vrec__name { flex: 1 1 200px; min-width: 0; font-weight: 600; }
.vrec__meta { font-size: .85rem; font-variant-numeric: tabular-nums; }
.vrec__item audio { display: block; width: 100%; margin-top: 10px; }
.vrec__dl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* Unir vídeos (reutiliza .filelist, .fileitem, .vedit__*) */
.vjoin__thumb { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; background: #000; border: 1px solid var(--line); flex: none; }
.vjoin__trim { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.vjoin__trim .field { width: 88px; font-size: .82rem; }
.vjoin__trim .input { padding: 6px 8px; min-height: 0; }
.vjoin__result { margin-top: 14px; }
@media (max-width: 560px) {
  .vjoin__item { flex-wrap: wrap; }
  .vjoin__item .fileitem__btns { width: 100%; justify-content: flex-end; }
  .vjoin__thumb { width: 48px; height: 36px; }
  .vjoin__trim .field { width: 76px; }
}

/* Rotar vídeo (vista previa en canvas con rectángulo de recorte; reutiliza .vedit__*) */
.vrot__stage { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; overflow: hidden; border-radius: var(--radius-sm); background: #000; touch-action: none; user-select: none; }
.vrot__view { display: block; max-width: 100%; max-height: 62vh; width: auto; height: auto; }
.vrot__crop { position: absolute; box-sizing: border-box; border: 2px solid #fff; box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55); cursor: move; }
.vrot__h { position: absolute; width: 20px; height: 20px; margin: -11px; background: #fff; border: 2px solid var(--primary); border-radius: 50%; }
.vrot__h[data-h="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.vrot__h[data-h="ne"] { right: 0; top: 0; cursor: nesw-resize; }
.vrot__h[data-h="sw"] { left: 0; bottom: 0; cursor: nesw-resize; }
.vrot__h[data-h="se"] { right: 0; bottom: 0; cursor: nwse-resize; }
.vrot__bar { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.vrot__bar input[type="range"] { flex: 1; min-width: 0; }
.vrot__time { font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.vrot__chips .chip[aria-pressed="true"] { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.vrot__result { margin-top: 14px; }

/* ---------- Imagen a SVG ---------- */
.svg-presets { gap: 6px; }
.svg-presets .tbtn { border-color: var(--line); background: var(--surface); }
.svg-adv { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.svg-adv > summary { cursor: pointer; font-weight: 650; }
.svg-zoombar { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; }
.svg-zoombar input[type=range] { flex: 1 1 auto; min-width: 0; max-width: 260px; }
.svg-zoombar .tbtn { border-color: var(--line); min-width: 36px; justify-content: center; font-size: 1.1rem; }
.svg-pane { margin-top: 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: auto; height: 260px; overscroll-behavior: contain; }
.svg-inner { margin: 0 auto; }
.svg-inner canvas, .svg-inner img { display: block; width: 100%; height: 100%; max-width: none; }
.svg-inner canvas.svg-pixel { image-rendering: pixelated; }

/* Cronómetro y temporizador */
.cr-stage { text-align: center; padding: 18px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cr-big { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(2.8rem, 14vw, 6.5rem); line-height: 1.05; letter-spacing: -.02em; color: var(--text); overflow-wrap: anywhere; }
.cr-big small { font-size: .5em; color: var(--muted); font-weight: 700; }
.cr-sub { margin: 6px 0 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.cr-phase { margin: 0 0 4px; font-weight: 700; font-size: 1.15rem; color: var(--primary); }
.cr-stage[data-phase="short"] .cr-phase, .cr-stage[data-phase="long"] .cr-phase { color: var(--ok); }
.cr-stage[data-phase="short"] .cr-bar span, .cr-stage[data-phase="long"] .cr-bar span { background: var(--ok); }
.cr-btns { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 16px; }
.cr-fsbtn { padding-left: 14px; padding-right: 14px; font-size: 1.2rem; }
.cr-bar { height: 8px; border-radius: 999px; background: var(--surface-2); overflow: hidden; margin: 12px auto 0; max-width: 520px; }
.cr-bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: inherit; }
.cr-laphead { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin: 18px 0 8px; }
.cr-lapacts { display: flex; flex-wrap: wrap; gap: 8px; }
#swLapsBox .tablewrap { max-height: 360px; overflow: auto; }
.dtable td.cr-num, .dtable th.cr-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cr-best td { color: var(--ok); font-weight: 650; }
.cr-worst td { color: var(--err); }
.cr-hms > .field { flex: 1 1 90px; }
.cr-hms > .cr-name { flex: 3 1 200px; }
.cr-timers { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.cr-empty { grid-column: 1 / -1; color: var(--muted); text-align: center; padding: 18px; border: 1px dashed var(--line); border-radius: var(--radius); margin: 0; }
.cr-timer { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); min-width: 0; cursor: default; }
.cr-timer.is-current { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.cr-timer.is-paused .cr-timer__time { color: var(--muted); }
.cr-timer.is-done { border-color: var(--err); background: color-mix(in srgb, var(--err) 8%, var(--surface)); }
.cr-timer.is-done .cr-timer__time { color: var(--err); animation: cr-blink 1s steps(2) infinite; }
.cr-timer__top { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.cr-timer__name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-timer__time { font-family: var(--mono); font-variant-numeric: tabular-nums; font-weight: 800; font-size: clamp(2.2rem, 9vw, 3rem); text-align: center; line-height: 1.1; margin-top: 6px; }
.cr-timer__btns { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 10px; }
.cr-x { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font: inherit; cursor: pointer; }
.cr-x:hover { background: var(--surface-2); color: var(--err); }
.cr-opts { margin-top: 20px; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; background: var(--surface); }
.cr-opts summary { cursor: pointer; font-weight: 700; }
.cr-opts[open] summary { margin-bottom: 12px; }
.cr-range { width: 100%; min-height: 44px; accent-color: var(--primary); }
.cr-opts kbd { font-family: var(--mono); font-size: .8em; padding: 1px 6px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px; background: var(--surface-2); }
.cr-alarm { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 10000; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: center; width: max-content; max-width: calc(100vw - 32px); padding: 14px 18px; border-radius: var(--radius); background: #dc2626; color: #fff; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.cr-alarm p { margin: 0; font-weight: 800; font-size: 1.2rem; overflow-wrap: anywhere; }
.cr-alarm .btn { background: #fff; color: #b91c1c; }
.cr-stage:fullscreen, .cr-timers:fullscreen { background: var(--surface); padding: 24px; margin: 0; overflow: auto; }
.cr-full { position: fixed; inset: 0; z-index: 9999; margin: 0; padding: 24px; border-radius: 0; background: var(--surface); overflow: auto; }
.cr-stage:fullscreen, .cr-stage.cr-full { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 0; }
.cr-stage:fullscreen .cr-big, .cr-stage.cr-full .cr-big { font-size: min(20vw, 38vh); }
.cr-stage:fullscreen .cr-phase, .cr-stage.cr-full .cr-phase, .cr-stage:fullscreen .cr-sub, .cr-stage.cr-full .cr-sub { font-size: clamp(1.1rem, 3vw, 2rem); }
.cr-stage:fullscreen .cr-bar, .cr-stage.cr-full .cr-bar { width: 80%; max-width: none; height: 12px; }
.cr-timers:fullscreen, .cr-timers.cr-full { align-content: center; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.cr-timers:fullscreen .cr-timer__time, .cr-timers.cr-full .cr-timer__time { font-size: clamp(3rem, 10vw, 8rem); }
.cr-noscroll { overflow: hidden; }
@keyframes cr-blink { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .cr-timer.is-done .cr-timer__time { animation: none; } }

/* Conversor de unidades */
.uc-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.uc-cat { font: inherit; font-size: .88rem; font-weight: 600; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; }
.uc-cat:hover { border-color: var(--primary); color: var(--primary); }
.uc-cat[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.uc-search { margin-bottom: 16px; }
.uc-hits { margin-top: 8px; }
.uc-main { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
.uc-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.uc-val { font-family: var(--mono); font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.uc-swap { font-size: 1.3rem; padding: 8px 14px; }
@media (max-width: 640px) { .uc-main { grid-template-columns: minmax(0, 1fr); } .uc-swap { justify-self: center; transform: rotate(90deg); } }
.uc-opts { margin-top: 12px; }
.uc-eq strong { font-size: 1.3rem; overflow-wrap: anywhere; }
.uc-eq .muted { display: block; margin-top: 4px; font-size: .9rem; overflow-wrap: anywhere; }
.uc-allh { margin: 22px 0 10px; font-size: 1.05rem; }
.uc-all tbody tr { cursor: pointer; }
.uc-all tbody tr:hover td { background: var(--surface-2); }
.uc-all tr.is-from td { background: var(--surface-2); }
.uc-all tr.is-to td { background: var(--primary-50); font-weight: 700; }
.uc-all tr:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.uc-sym { color: var(--muted); white-space: nowrap; }
.dtable td.uc-num, .dtable th.uc-num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* Actualización del alquiler */
.rentup__rule:empty { display: none; }
.rentup__rule { border-left: 4px solid var(--primary); background: var(--surface-2); padding: 10px 14px; border-radius: var(--radius-sm); font-size: .9rem; }
.rentup__rule ul { margin: 6px 0 0; padding-left: 18px; }
.rentup__rule li + li { margin-top: 4px; }
.rentup__letter { font-family: inherit; font-size: .88rem; line-height: 1.45; resize: vertical; }
.rentup__table { max-height: 340px; overflow-y: auto; margin-top: 8px; }
.rentup__check { align-items: flex-start; }
.rentup__check input { flex-shrink: 0; margin-top: 2px; }

/* Calculadora de cuota de autónomos */
.cuota__reg { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.cuota__reg h3 { margin: 0 0 6px; font-size: 1.05rem; }
.cuota__reg p { margin: 6px 0 0; }
.cuota__good b:first-child { color: var(--ok); }
.cuota__bad b:first-child { color: var(--err); }
.cuota__h { font-size: 1.2rem; margin: 24px 0 4px; }
.cuota__tabla td, .cuota__tabla th { white-space: nowrap; }
.cuota__tabla tr.cuota__on td { background: var(--primary-50); font-weight: 650; }

/* Simulador de pensión de jubilación */
.pens__warn { margin: 0; padding: 12px 16px 12px 32px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); font-size: .85rem; color: var(--muted); }
.pens__warn li + li { margin-top: 6px; }
.pens__warn:empty { display: none; }

/* ---------- Editor de fotos ---------- */
.pe-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 6px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.pe-bar .tbtn { min-width: 38px; min-height: 38px; justify-content: center; font-size: 1.05rem; }
.pe-bar .pe-compare { font-size: .85rem; margin-left: auto; border-color: var(--line); background: var(--surface); user-select: none; -webkit-user-select: none; touch-action: none; }
.pe-sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.pe-stage { margin-top: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); background-image: linear-gradient(45deg, color-mix(in srgb, var(--line) 60%, transparent) 25%, transparent 25%, transparent 75%, color-mix(in srgb, var(--line) 60%, transparent) 75%); background-size: 20px 20px; }
.pe-canvas { display: block; margin: 0 auto; max-width: 100%; max-height: 65vh; touch-action: none; user-select: none; -webkit-user-select: none; }
.pe-canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.pe-sliders { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px 18px; }
.pe-filters { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 8px; scroll-snap-type: x proximity; }
.pe-filter { flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px; border: 2px solid transparent; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: .8rem; font-weight: 600; cursor: pointer; scroll-snap-align: start; }
.pe-filter canvas { width: 72px; height: 72px; border-radius: 8px; display: block; }
.pe-filter[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }

/* Recibo de alquiler */
.rrec__amounts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 6px; }
.rrec__sig { height: auto; aspect-ratio: 3 / 1; margin-top: 6px; }
.rrec__nav { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: .9rem; color: var(--muted); }
.rrec__nav .iconbtn:disabled { opacity: .4; cursor: default; }
.rrec__paper { min-height: 0; }
.rrec__line { margin: 0 0 8px; }
.rrec__line small, .rrec__signbox small { display: block; font-size: .64rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #64748b; margin-bottom: 2px; }
.rrec__signbox { margin-top: 14px; min-height: 70px; border-bottom: 1px solid #94a3b8; width: min(220px, 100%); padding-bottom: 4px; }
.rrec__signbox img { max-height: 60px; max-width: 100%; display: block; }

/* Comparar textos */
.ct-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.ct-ta { font-family: var(--mono); font-size: .9rem; line-height: 1.5; min-height: 220px; resize: vertical; tab-size: 4; }
.ct-ta.is-over { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.ct-info { margin: 0; min-height: 1.2em; }
.ct-opts { margin-top: 16px; }
.ct-checks { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; }
.ct-result { margin-top: 18px; }
.ct-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.ct-stats { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .95rem; margin: 0; }
.ct-add { color: var(--ok); font-weight: 650; }
.ct-rem { color: var(--err); font-weight: 650; }
.ct-nav { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.ct-pos { min-width: 4.5em; text-align: center; font-variant-numeric: tabular-nums; color: var(--muted); font-size: .9rem; }
.ct-panes { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
@media (max-width: 760px) { .ct-panes { grid-template-columns: minmax(0, 1fr); } .ct-panes .ct-scroll { max-height: 45vh; } }
.ct-pane__h { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.ct-scroll { position: relative; max-height: 70vh; overflow: auto; }
.ct-text { tab-size: 4; }
.ct-mark { display: inline-block; width: 0; height: 1em; vertical-align: text-bottom; }
.ct-out del.is-cur, .ct-out ins.is-cur { outline: 2px solid var(--primary); outline-offset: 1px; }
.ct-out tr.is-cur td { box-shadow: inset 0 2px 0 var(--primary); }
.ct-tablewrap { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); }
.ct-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-family: var(--mono); font-size: .84rem; line-height: 1.5; tab-size: 4; }
.ct-cn { width: 3.4em; }
.ct-cs { width: 1.6em; }
.ct-table td { padding: 1px 8px; vertical-align: top; white-space: pre-wrap; overflow-wrap: anywhere; }
.ct-table .ct-n { color: var(--muted); text-align: right; user-select: none; font-size: .78rem; padding-top: 2px; }
.ct-table--split td:nth-child(3) { border-left: 1px solid var(--line); }
.ct-table td.ct-del, .ct-table tr.ct-del td { background: rgba(220, 38, 38, .08); }
.ct-table td.ct-ins, .ct-table tr.ct-ins td { background: rgba(22, 163, 74, .09); }
.ct-table td.ct-empty { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface-2) 6px 12px); }
.ct-table del { background: rgba(220, 38, 38, .22); color: inherit; text-decoration: line-through; text-decoration-color: #dc2626; }
.ct-table ins { background: rgba(22, 163, 74, .25); color: inherit; text-decoration: none; }
.ct-table .ct-s { color: var(--muted); text-align: center; user-select: none; }
.ct-foldrow td { padding: 2px 8px; background: var(--surface-2); text-align: center; }
.ct-fold { font: inherit; font-size: .8rem; color: var(--primary); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 999px; padding: 2px 12px; margin: 4px 0; cursor: pointer; white-space: normal; }
.ct-fold:hover { border-color: var(--primary); }
@media (max-width: 640px) { .ct-table { font-size: .76rem; } .ct-cn { width: 2.6em; } .ct-cs { width: 1.2em; } .ct-table td { padding: 1px 4px; } }

/* ---------- Collage de fotos ---------- */
.clg-topbtns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.clg-add { position: relative; overflow: hidden; cursor: pointer; }
.clg-add input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 0; }
.clg-templates { display: flex; flex-wrap: wrap; gap: 8px; }
.clg-tpl { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; padding: 4px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; color: var(--muted); }
.clg-tpl svg rect { fill: currentColor; opacity: .55; }
.clg-tpl[aria-pressed="true"] { border-color: var(--primary); color: var(--primary); }
.clg-tpl[aria-pressed="true"] svg rect { opacity: .9; }
.clg-stage { margin-top: 10px; padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); }
.clg-canvas { display: block; margin: 0 auto; max-width: 100%; max-height: 70vh; touch-action: none; user-select: none; -webkit-user-select: none; box-shadow: 0 1px 6px rgba(0, 0, 0, .15); }
.clg-canvas:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.clg-slotbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 6px 8px; margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.clg-slotbar > b { align-self: center; margin-right: 4px; }
.clg-slotbar .tbtn { border-color: var(--line); background: var(--surface); min-height: 38px; }
.clg-zoom { flex: 1 1 180px; }
.clg-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.clg-thumb { display: inline-flex; align-items: center; justify-content: center; width: 72px; height: 72px; padding: 3px; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; }
.clg-thumb canvas { max-width: 100%; max-height: 100%; border-radius: 6px; display: block; }
.clg-thumb.is-unused { border-style: dashed; opacity: .7; }
.clg-text { margin-top: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-2); }
.clg-text > summary { cursor: pointer; font-weight: 650; }

/* ==========================================================================
   PORTADA (diseño del titular, 22-11-2026)
   Cabecera alineada a la izquierda con buscador · «Más usadas» · «Explora las herramientas» (categorías en una
   columna lateral en escritorio y en pestañas en móvil) · resultados de búsqueda.
   Va después de los componentes generales: .hero--home (misma especificidad que .hero) gana por orden.
   Puntos de ruptura: 900 px (escritorio ↔ móvil, el mismo que usa index.php en JS) y 640 px (teléfono).
   ========================================================================== */
.hero--home { padding: 34px 0 30px; }
.hero--home::after { content: ""; position: absolute; z-index: -1; right: -260px; top: -420px; width: 980px; height: 980px; border-radius: 50%; background: color-mix(in srgb, var(--primary) 5%, transparent); pointer-events: none; }
.kicker { margin: 0 0 12px; padding-left: 12px; border-left: 3px solid var(--primary); color: var(--primary); font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.hero--home h1 { margin: 0 0 6px; font-size: clamp(2.15rem, 5vw, 3.35rem); line-height: 1.08; letter-spacing: -.035em; }
.hero--home .lead { margin: 0 0 26px; max-width: none; font-size: clamp(1.12rem, 2vw, 1.5rem); line-height: 1.35; }

/* Buscador */
.homesearch { display: flex; align-items: center; gap: 12px; max-width: 842px; height: 58px; margin: 0; padding: 0 0 0 18px; border: 1.5px solid color-mix(in srgb, var(--primary) 55%, var(--line)); border-radius: 12px; background: var(--surface); overflow: hidden; color: var(--text); }
.homesearch:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 14%, transparent); }
.homesearch input { flex: 1; min-width: 0; height: 100%; border: 0; outline: none; background: transparent; font: inherit; font-size: 1.15rem; color: var(--text); padding: 0; }
.homesearch input::placeholder { color: var(--muted); }
.homesearch__btn { flex: none; align-self: stretch; display: grid; place-items: center; width: 84px; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; }
.homesearch__btn:hover { background: var(--primary-600); }
.homesearch__btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent); outline-offset: -3px; }
.homesearch__hint { margin: 10px 0 0; color: var(--muted); font-size: 1rem; }
.heroticks { display: none; list-style: none; margin: 22px 0 0; padding: 0; gap: 8px 26px; flex-wrap: wrap; align-items: center; font-weight: 650; font-size: 1.05rem; color: var(--muted); }
.heroticks li { display: inline-flex; align-items: center; gap: 10px; }
.heroticks .ico { color: var(--primary); }

/* Filas de herramienta (portada, relacionadas y 404): icono · nombre y descripción · flecha */
.toolrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; color: var(--text); box-shadow: 0 1px 2px rgba(14, 18, 48, .04); transition: border-color .15s, box-shadow .15s; }
.toolrow:hover { text-decoration: none; border-color: color-mix(in srgb, var(--primary) 40%, var(--line)); box-shadow: 0 6px 18px -10px rgba(14, 18, 48, .25); }
.toolrow:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.toolrow--hl { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); border-color: color-mix(in srgb, var(--primary) 16%, var(--line)); }
.toolrow__ico { display: flex; color: var(--primary); }
.toolrow__ico .ico { stroke-width: 1.6; }
.toolrow__txt { min-width: 0; }
.toolrow__txt strong { display: block; font-size: 1.14rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.25; overflow-wrap: break-word; hyphens: auto; }
.toolrow__txt small { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: .9rem; line-height: 1.4; color: var(--muted); }
.toolrow__go { display: flex; color: var(--primary); }
.toolrow__go .ico + .ico { display: none; }
.toolrow--sm { padding: 13px 20px; gap: 16px; }
.toolrow--sm .toolrow__txt strong { font-size: 1.04rem; }
.toolrow--sm .toolrow__txt small { -webkit-line-clamp: 1; font-size: .86rem; }
@media (prefers-reduced-motion: reduce) { .toolrow { transition: none; } }

/* Más usadas */
.toptools { margin-top: 6px; }
.toptools h2, .explore > h2 { margin: 0 0 16px; font-size: clamp(1.5rem, 2.6vw, 1.85rem); letter-spacing: -.025em; }
.toptools__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; }

/* Explora las herramientas */
.explore { padding-top: 44px; scroll-margin-top: 76px; }
.explore__in { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 0 34px; }
.explore__nav { display: flex; flex-direction: column; gap: 2px; align-self: start; padding: 0 24px 4px 0; border-right: 1px solid var(--line); }
.explore__tab { display: flex; align-items: center; gap: 14px; padding: 7px 16px; border-radius: 10px; color: var(--text); font-size: 1rem; font-weight: 500; line-height: 1.3; }
.explore__tab:hover { background: var(--surface-2); text-decoration: none; }
.explore__tab .ico { color: var(--text); stroke-width: 1.6; }
.explore__tab[aria-current] { background: var(--primary); color: var(--on-primary); font-weight: 700; }
.explore__tab[aria-current] .ico { color: var(--on-primary); }
/* «Todas» solo se ve en móvil, o en escritorio si es la elección actual (p. ej. tras girar el dispositivo) */
.explore__tab--all:not([aria-current]) { display: none; }
.explore__h { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; font-size: 1.5rem; letter-spacing: -.02em; }
.explore__h .ico { display: none; }
.explore__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.homecat { scroll-margin-top: 76px; }
.homecat + .homecat { margin-top: 30px; }
.explore__list > .homecat[hidden] + .homecat { margin-top: 0; }
/* Resultados de búsqueda: recuento (también se anuncia a los lectores de pantalla) y aviso sin resultados */
.explore__count { margin: 0 0 16px; font-weight: 700; color: var(--text); }
.explore__count:focus { outline: none; }
.explore__empty { padding: 8px 0 24px; color: var(--muted); }

@media (max-width: 900px) {
  .toptools__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .explore__in { display: block; }
  /* pestañas desplazables de borde a borde (el margen negativo es el relleno de .wrap) */
  .explore__nav { flex-direction: row; gap: 10px; overflow-x: auto; margin: 0 -20px 24px; padding: 0 20px 4px; border-right: 0; scrollbar-width: none; }
  .explore__nav::-webkit-scrollbar { display: none; }
  .explore__tab, .explore__tab--all:not([aria-current]) { flex: none; display: inline-flex; justify-content: center; min-width: 96px; padding: 10px 22px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 600; font-size: 1.02rem; }
  .explore__tab[aria-current] { border-color: var(--primary); }
  .explore__tab .ico { display: none; }
  .explore__h { font-size: 1.35rem; }
  .explore__h .ico { display: block; color: var(--text); stroke-width: 1.6; }
  .explore__grid { grid-template-columns: 1fr; gap: 10px; }
  .explore .toolrow__go { color: var(--muted); }
  .explore .toolrow__go .ico:first-child { display: none; }
  .explore .toolrow__go .ico + .ico { display: block; }
}
@media (max-width: 640px) {
  .hero--home { padding: 26px 0 22px; }
  .hero--home::after { display: none; }
  .kicker { display: none; }
  .hero--home h1 { font-size: 2.2rem; }
  .hero--home .lead { font-size: 1.12rem; margin-bottom: 22px; }
  .homesearch { height: 56px; padding-left: 18px; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 1px 3px rgba(14, 18, 48, .06); }
  .homesearch__btn { display: none; }
  .homesearch__hint { margin-left: 10px; }
  .heroticks { display: flex; margin-left: 10px; }
  .explore__nav { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
  .toptools__grid .toolrow { grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 16px 14px; }
  .toptools__grid .toolrow__go { display: none; }
  .toptools__grid .toolrow__ico .ico { width: 30px; height: 30px; }
  .toptools__grid .toolrow__txt strong { font-size: 1rem; }
  .toptools__grid .toolrow__txt small { font-size: .84rem; }
  .toolrow--sm { padding: 12px 14px; }
}
/* Teléfonos estrechos (320–420 px): en «Más usadas» el icono pasa encima del nombre. Así el nombre usa todo el ancho de
   la tarjeta y no se parte a mitad de palabra («Conversor de archivos», traducciones largas), con dos columnas */
@media (max-width: 420px) {
  .toptools__grid .toolrow { grid-template-columns: minmax(0, 1fr); align-items: start; align-content: start; gap: 8px; padding: 14px 12px; }
  .toptools__grid .toolrow__ico .ico { width: 28px; height: 28px; }
}

/* ============ Abrir ZIP, RAR y 7z (descomprimir-zip-rar) ============ */
.unz { position: relative; }
.unz__drop { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 34px 20px 28px; border: 1.5px dashed color-mix(in srgb, var(--primary) 45%, var(--line)); border-radius: 18px; background: var(--surface); cursor: pointer; transition: border-color .15s, background .15s; }
.unz__drop:hover, .unz__drop.is-over { border-color: var(--primary); background: color-mix(in srgb, var(--primary-50) 50%, var(--surface)); }
.unz__drop:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.unz__drop input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.unz__big { width: 64px; height: 64px; border-radius: 16px; background: var(--primary-50); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.unz__dt { font-size: 1.12rem; margin-bottom: 4px; }
.unz__ds { font-size: .88rem; color: var(--muted); margin-bottom: 18px; }
.unz__fmts { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 18px; }
.unz__fmts span { font-size: 12px; font-weight: 700; padding: 4px 9px; border-radius: 7px; background: var(--surface-2); color: var(--muted); letter-spacing: .02em; }
.unz__note { display: flex; gap: 8px; font-size: .82rem; color: var(--muted); line-height: 1.45; margin: 14px 4px 0; }
.unz__note .ico { flex: none; margin-top: 1px; }
.unz__err { margin: 12px 0 0; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--err) 40%, var(--line)); border-radius: 12px; background: color-mix(in srgb, var(--err) 8%, var(--surface)); color: var(--err-strong); font-size: .9rem; line-height: 1.45; }
.unz__ib { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); border: 1px solid var(--line); background: var(--surface); flex: none; cursor: pointer; padding: 0; }
.unz__ib:hover { color: var(--text); background: var(--surface-2); }
[hidden].unz__drop, .unz [hidden] { display: none !important; }

/* Archivo abierto */
.unz__app { display: grid; gap: 20px; align-items: start; }
.unz__main { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.unz__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.unz__badge { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 11.5px; font-weight: 800; letter-spacing: .03em; flex: none; }
.unz__ht { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.unz__ht strong { font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unz__ht small { font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unz__head .btn, .unz__bar .btn, .unz__sel .btn, .unz__pvf .btn { flex: none; white-space: nowrap; }
.unz__other { position: relative; }
.unz__other input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.unz__bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.unz__search { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--muted); }
.unz__search:focus-within { border-color: var(--primary); }
.unz__search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font: inherit; font-size: .92rem; outline: none; height: 100%; }
#selMode[aria-pressed="true"] { background: var(--primary-50); border-color: var(--primary); color: var(--primary); }
.unz__path { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 10px 16px; font-size: .86rem; color: var(--muted); border-bottom: 1px solid var(--line); min-height: 42px; }
.unz__path b { color: var(--text); overflow-wrap: anywhere; }
.unz__crumb { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 600; color: var(--primary); cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.unz__crumb:hover { text-decoration: underline; }
.unz__crumb .ico { flex: none; }
.unz__cols { display: none; }
.unz__list { list-style: none; margin: 0; padding: 0; }
.unz__row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--line); cursor: pointer; min-height: 58px; }
.unz__row:first-child { border-top: 0; }
.unz__row:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.unz__row.is-act, .unz__row.is-sel { background: var(--primary-50); }
.unz__chk { display: none; width: 20px; height: 20px; border-radius: 6px; border: 1.5px solid color-mix(in srgb, var(--muted) 50%, var(--line)); flex: none; align-items: center; justify-content: center; color: transparent; }
.unz__chk .ico { stroke-width: 3; }
.unz__chk.is-on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.unz.is-selecting .unz__row:not(.is-up) .unz__chk { display: flex; }
.unz__fi { width: 36px; height: 36px; border-radius: 9px; display: flex; align-items: center; justify-content: center; flex: none; background: var(--surface-2); color: var(--muted); font-size: 9.5px; font-weight: 800; letter-spacing: .02em; overflow: hidden; }
.unz__fi.is-dir { background: var(--primary-50); color: var(--primary); }
.unz__fi.is-pdf { color: #d64545; }
.unz__fi.is-doc { color: #2b6cd4; }
.unz__fi.is-xls { color: #1e8449; }
.unz__fi.is-arc { color: var(--warn); }
.unz__fi img { width: 100%; height: 100%; object-fit: cover; display: block; }
:root[data-theme="dark"] .unz__fi.is-pdf { color: #f08080; }
:root[data-theme="dark"] .unz__fi.is-doc { color: #7fb0ff; }
:root[data-theme="dark"] .unz__fi.is-xls { color: #6fd39a; }
:root[data-theme="dark"] .unz__fi.is-arc { color: #fbbf24; }
.unz__t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.unz__t strong { font-size: .92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unz__t small { font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.unz__sz, .unz__ty { display: none; }
.unz__go { display: flex; align-items: center; justify-content: center; color: var(--muted); flex: none; width: 36px; height: 36px; border-radius: 9px; }
.unz__dl { border: 0; background: none; cursor: pointer; padding: 0; }
.unz__dl:hover { background: var(--surface-2); color: var(--primary); }
.unz.is-selecting .unz__dl { visibility: hidden; }
.unz__empty { padding: 26px 16px; text-align: center; color: var(--muted); font-size: .92rem; margin: 0; }

/* Vista previa: en el móvil, hoja sobre la página */
.unz__pv { display: none; }
.unz.is-preview .unz__pv { display: block; position: fixed; inset: 0; z-index: 90; background: rgba(10, 15, 29, .55); }
.unz__pvph { display: none; }
.unz__pvin { position: absolute; left: 0; right: 0; bottom: 0; top: max(56px, env(safe-area-inset-top)); background: var(--surface); border-radius: 20px 20px 0 0; display: flex; flex-direction: column; overflow: hidden; animation: unzup .2s ease; }
@keyframes unzup { from { transform: translateY(30px); opacity: .4; } }
.unz__grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; flex: none; }
.unz__pvh { display: flex; align-items: center; gap: 10px; padding: 10px 14px 12px 18px; border-bottom: 1px solid var(--line); flex: none; }
.unz__pvb { flex: 1; min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--surface-2); }
.unz__pvb > img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }
.unz__pvb > video { max-width: 100%; max-height: 100%; border-radius: 6px; background: #000; }
.unz__pvb > audio { width: 100%; max-width: 440px; }
.unz__pvb > .spinner { width: 28px; height: 28px; color: var(--primary); }
.unz__txt { align-self: stretch; width: 100%; margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; font: 13px/1.6 var(--mono); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; overflow: auto; }
.unz__pdf { align-self: flex-start; width: 100%; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.unz__pdf canvas { max-width: 100%; height: auto !important; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.unz__nopv { color: var(--muted); text-align: center; max-width: 320px; margin: 0; font-size: .92rem; line-height: 1.5; }
.unz__pvm { display: grid; grid-template-columns: auto 1fr; gap: 4px 18px; margin: 0; padding: 12px 18px 0; font-size: .86rem; flex: none; }
.unz__pvm:empty { display: none; }
.unz__pvm dt { color: var(--muted); }
.unz__pvm dd { margin: 0; }
.unz__pvf { display: flex; gap: 8px; padding: 12px 16px calc(16px + env(safe-area-inset-bottom)); flex: none; }
.unz__pvf .btn { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }
.unz__pvf .btn:disabled { opacity: .45; cursor: default; }
html.unz-lock, html.unz-lock body { overflow: hidden; }

/* Barra de selección */
.unz__sel { position: fixed; left: 12px; right: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 80; max-width: 560px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: .92rem; font-weight: 700; box-shadow: 0 8px 24px rgba(10, 15, 29, .25); }
.unz__sel #selInfo { flex: 1; min-width: 0; line-height: 1.3; }
@media (max-width: 520px) { .unz__sel #selNone { display: none; } }
.unz__sel .btn { flex: none; }
.unz__sel .btn--ghost { background: transparent; color: var(--bg); border-color: color-mix(in srgb, var(--bg) 35%, transparent); }
.unz__sel #selDl { background: var(--bg); color: var(--text); }
.unz__sel #selDl:disabled { opacity: .5; cursor: default; }
.unz.is-selecting .unz__main { margin-bottom: 70px; }

/* Ocupado */
.unz__busy { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 96; display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg); font-weight: 700; color: var(--text); }
.unz__busy .spinner { color: var(--primary); }

/* Móvil: botones de la cabecera debajo */
@media (max-width: 899px) {
  .unz__head { flex-wrap: wrap; padding: 14px; }
  .unz__head .unz__ht { flex: 1 1 calc(100% - 120px); }
  .unz__close { order: 2; }
  .unz__all, .unz__other { order: 3; }
  .unz__all { flex: 1 1 auto !important; }
  .unz__all ~ .unz__other { flex: none; }
  .unz__other:only-of-type { flex: 1; }
  .unz__bar { padding: 10px 14px; }
  .unz__path { padding: 10px 14px; }
}
@media (max-width: 380px) {
  .unz__pvf .unz__nav span { display: none; }
  .unz__pvf .unz__nav { flex: 0 0 52px; }
}

/* Ordenador: lista en columnas y vista previa al lado */
@media (min-width: 900px) {
  .unz__app { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .unz__cols { display: grid; }
  .unz__cols, .unz__row { grid-template-columns: 24px 30px minmax(0, 1fr) 90px 90px 36px; }
  .unz__cols { gap: 12px; padding: 9px 16px; font-size: 12px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--line); }
  .unz__cols span:nth-child(2) { grid-column: 2 / 4; }
  .unz__cols span:nth-child(3), .unz__cols span:nth-child(4) { text-align: right; }
  .unz__row { display: grid; gap: 12px; padding: 7px 16px; min-height: 46px; }
  .unz__chk { display: flex; visibility: hidden; }
  .unz.is-selecting .unz__row:not(.is-up) .unz__chk { visibility: visible; }
  .unz__fi { width: 30px; height: 30px; border-radius: 8px; font-size: 8.5px; }
  .unz__fi .ico { width: 17px; height: 17px; }
  .unz__t small { display: none; }
  .unz__list[data-search] .unz__t small { display: block; }
  .unz__sz, .unz__ty { display: block; text-align: right; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .unz__list { max-height: min(640px, 70vh); overflow: auto; }
  .unz__pv, .unz.is-preview .unz__pv { display: block; position: sticky; top: 84px; inset: auto; z-index: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
  .unz__pvph { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; min-height: 360px; padding: 30px; text-align: center; color: var(--muted); font-size: .92rem; }
  .unz__pvph .ico { color: color-mix(in srgb, var(--muted) 60%, transparent); }
  .unz__pvin { position: static; border-radius: 0; animation: none; }
  .unz__grip { display: none; }
  .unz__pvh { padding: 14px 14px 14px 16px; }
  .unz__pvb { height: 380px; flex: none; }
  .unz__pvm { padding: 14px 16px 0; }
  .unz__pvf { padding: 14px 16px 16px; }
}
/* ===================== Amigo invisible ===================== */
.ami__names { min-height: 220px; resize: vertical; }
.ami__h { font-size: 1.05rem; margin: 0; }
.ami__excl { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.ami__excl .hint { margin: 0; }
.ami__xlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.ami__xlist:empty { display: none; }
.ami__x { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr) 44px; gap: 8px; align-items: center; }
.ami__x .select { min-width: 0; }
.ami__dir { color: var(--muted); }
.ami__ib { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--muted); cursor: pointer; }
.ami__ib:hover { color: var(--err); border-color: color-mix(in srgb, var(--err) 40%, var(--line)); }
.ami__mutual { margin-top: 18px; }
.ami__note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: .88rem; }
.ami__note .ico { flex: none; color: var(--primary); }

.ami__dhead { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.ami__dhead strong { display: block; font-size: 1.2rem; line-height: 1.3; overflow-wrap: anywhere; }
.ami__dhead small { display: block; color: var(--muted); font-size: .9rem; margin-top: 2px; }
.ami__dacts { display: flex; flex-wrap: wrap; gap: 8px; }
.ami__lead { margin: 16px 0 12px; font-weight: 600; }
.ami .tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.ami__ph { margin: 0 0 14px; }
.ami__people { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ami__person { display: flex; align-items: center; gap: 8px; padding: 10px 12px; }
.ami__person + .ami__person { border-top: 1px solid var(--line); }
.ami__pn { flex: 1 1 auto; min-width: 0; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ami__grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ami__pbtn { width: 100%; min-height: 72px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 3px; padding: 12px 14px; font: inherit; text-align: left; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; }
.ami__pbtn span { font-weight: 700; overflow-wrap: anywhere; }
.ami__pbtn small { color: var(--primary); font-size: .82rem; font-weight: 600; }
.ami__pbtn:hover { border-color: var(--primary); }
.ami__pbtn.is-seen { background: var(--surface-2); }
.ami__pbtn.is-seen small { color: var(--muted); }
.ami__all { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.ami__all summary { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: .92rem; }
.ami__pairs { margin: 10px 0 0; padding-left: 22px; line-height: 1.8; }

.ami__rev { max-width: 460px; margin: 0 auto; padding: 18px 0 8px; text-align: center; display: flex; flex-direction: column; align-items: center; }
.ami__revico { display: inline-flex; align-items: center; justify-content: center; width: 64px; height: 64px; border-radius: 16px; background: color-mix(in srgb, var(--primary) 10%, var(--surface)); color: var(--primary); }
.ami__revk { margin: 14px 0 0; color: var(--muted); font-weight: 600; font-size: .92rem; overflow-wrap: anywhere; }
.ami__revh { margin: 4px 0 10px; font-size: 1.6rem; overflow-wrap: anywhere; }
.ami__rev p { margin: 0 0 16px; }
.ami__revl { margin: 0 !important; color: var(--muted); font-weight: 600; }
.ami__revname { margin: 6px 0 16px !important; font-size: 2.2rem; font-weight: 800; line-height: 1.15; color: var(--primary); overflow-wrap: anywhere; }
.ami__revm { margin: 0 0 16px; display: flex; flex-direction: column; gap: 6px; width: 100%; }
.ami__revm div { display: flex; justify-content: center; gap: 8px; }
.ami__revm dt { color: var(--muted); }
.ami__revm dt::after { content: ':'; }
.ami__revm dd { margin: 0; font-weight: 650; }
.ami__revmsg { margin: 8px 0 0 !important; padding: 12px 14px; background: var(--surface-2); border-radius: var(--radius-sm); }
.ami__revo { margin: 18px 0 0 !important; font-size: .92rem; }
.ami__bad { text-align: center; color: var(--err); margin: 10px 0; }
.ami__mdl .mdl__box { text-align: center; padding-top: 28px; }
.ami__mdl .mdl__acts { justify-content: center; }

@media (max-width: 760px) {
  .ami__x { grid-template-columns: minmax(0, 1fr) 44px; }
  .ami__x .select:nth-child(1) { grid-column: 1; }
  .ami__x .ami__dir { grid-column: 1; grid-row: 2; }
  .ami__x .select:nth-child(3) { grid-column: 1; grid-row: 3; }
  .ami__x .ami__ib { grid-column: 2; grid-row: 1; }
  .ami__x + .ami__x { padding-top: 10px; border-top: 1px solid var(--line); }
  .ami .tabs button { flex: 1 1 100%; }
  .ami__person { flex-wrap: wrap; }
  .ami__pn { flex-basis: 100%; }
  .ami__person .btn { flex: 1 1 0; }
  .ami__revname { font-size: 1.9rem; }
}

/* ---------- Calendario laboral ---------- */
.cal { --c-nac: var(--primary); --c-on-nac: var(--on-primary); --c-aut: var(--primary-50); --c-aut-t: var(--primary-600);
  --c-loc: #fdf1de; --c-loc-t: var(--warn); --c-vac: #dcf3e3; --c-vac-t: var(--ok); --c-we: var(--surface-2); }
:root[data-theme="dark"] .cal { --c-loc: #3a2a12; --c-loc-t: #fbbf24; --c-vac: #12301e; --c-vac-t: #4ade80; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .cal { --c-loc: #3a2a12; --c-loc-t: #fbbf24; --c-vac: #12301e; --c-vac-t: #4ade80; } }
.cal__bar { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.cal__bar > .field { flex: 1 1 220px; }
.cal__bar > .cal__mode { flex: 0 1 auto; }
.cal__aran { padding-bottom: 10px; }
.cal__seg { display: flex; gap: 6px; }
.cal__seg .chip { padding: 10px 14px; }
.cal__seg .chip[aria-pressed="true"] { background: var(--primary-50); color: var(--primary); border-color: var(--primary); }
.cal__sum { margin-top: 18px; }
.cal__sum small { display: block; font-size: .78rem; color: var(--muted); margin-top: 2px; }
.cal__legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0 12px; font-size: .85rem; color: var(--muted); }
.cal__legend span { display: inline-flex; align-items: center; gap: 7px; }
.cal__k { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.cal__k--nac { background: var(--c-nac); border-color: var(--c-nac); }
.cal__k--aut { background: var(--c-aut); border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.cal__k--loc { background: var(--c-loc); border-color: color-mix(in srgb, var(--c-loc-t) 45%, transparent); }
.cal__k--vac { background: var(--c-vac); border-color: color-mix(in srgb, var(--c-vac-t) 45%, transparent); }
.cal__k--we { background: var(--c-we); }
.cal__year { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.cal__m { border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 10px; background: var(--surface); }
.cal__m h3 { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 8px; font-size: 1rem; }
.cal__m h3 small { font-size: .75rem; font-weight: 500; color: var(--muted); }
.cal__g { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.cal__wd { font-size: .68rem; text-transform: uppercase; color: var(--muted); text-align: center; padding-bottom: 2px; }
.cal__d { font: inherit; font-size: .85rem; font-variant-numeric: tabular-nums; aspect-ratio: 1; min-height: 28px; border: 1px solid transparent; border-radius: 7px; background: none; color: var(--text); cursor: pointer; padding: 0; }
.cal__d:hover { border-color: var(--primary); }
.cal__d:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal__d.is-we { background: var(--c-we); color: var(--muted); }
.cal__d.is-nac { background: var(--c-nac); color: var(--c-on-nac); font-weight: 700; }
.cal__d.is-aut { background: var(--c-aut); color: var(--c-aut-t); font-weight: 700; border-color: color-mix(in srgb, var(--primary) 35%, transparent); }
.cal__d.is-loc { background: var(--c-loc); color: var(--c-loc-t); font-weight: 700; border-color: color-mix(in srgb, var(--c-loc-t) 45%, transparent); }
.cal__d.is-vac { background: var(--c-vac); color: var(--c-vac-t); font-weight: 600; border-color: color-mix(in srgb, var(--c-vac-t) 45%, transparent); }
.cal__lists { margin-top: 26px; align-items: start; }
.cal__h { font-size: 1.1rem; margin: 0 0 10px; }
.cal .dtable tr.is-sun td { color: var(--muted); }
.cal .dtable td:first-child { word-break: normal; white-space: nowrap; }
.cal__tag { display: inline-block; font-size: .75rem; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.cal__tag--n { background: var(--c-nac); color: var(--c-on-nac); }
.cal__tag--a, .cal__tag--i { background: var(--c-aut); color: var(--c-aut-t); }
.cal__tag--l { background: var(--c-loc); color: var(--c-loc-t); }
.cal__bridges { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal__bridges li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; display: grid; gap: 2px; }
.cal__bridges span { font-size: .9rem; color: var(--muted); }
@media (max-width: 560px) {
  .cal__bar > .cal__mode { flex: 1 1 100%; }
  .cal__seg .chip { flex: 1 1 0; }
  .cal__year { grid-template-columns: 1fr; }
}

/* ===================== Gastos compartidos ===================== */
.gas__h { font-size: 1.1rem; margin: 0; }
.gas__h3 { font-size: 1rem; margin: 0 0 10px; }
.gas__top { align-items: start; }
.gas__sec { margin-top: 26px; padding-top: 20px; border-top: 1px solid var(--line); }
.gas__sec > .gas__h { margin-bottom: 12px; }
.gas__shared { margin: 0 0 18px; padding: 10px 14px; border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--line)); background: var(--primary-50); border-radius: var(--radius-sm); font-size: .92rem; }
.gas__add { display: flex; gap: 8px; align-items: flex-end; }
.gas__add .field { flex: 1 1 auto; }
.gas__cur { flex: 0 1 170px !important; }
.gas__people { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.gas__people:empty { display: none; }
.gas__person { display: inline-flex; align-items: center; gap: 2px; padding: 3px 4px 3px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-weight: 600; font-size: .92rem; }
.gas__person span { overflow-wrap: anywhere; }
.gas__rm { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; font: inherit; font-size: 1.2rem; line-height: 1; border: 0; border-radius: 8px; background: none; color: var(--muted); cursor: pointer; }
.gas__rm:hover { color: var(--err); background: var(--surface-2); }
.gas__exp { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, .8fr) minmax(0, 1fr); gap: 12px; align-items: end; }
.gas__ff, .gas__fb { grid-column: 1 / -1; }
.gas__fb { display: flex; flex-wrap: wrap; gap: 10px; }
.gas__for { display: flex; flex-wrap: wrap; gap: 6px; }
.gas__chk { display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: .9rem; font-weight: 600; cursor: pointer; }
.gas__chk input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.gas__chk:has(input:checked) { border-color: var(--primary); background: var(--primary-50); }
.gas__chk:has(input:not(:checked)) span { color: var(--muted); text-decoration: line-through; }
.gas__for:empty::before { content: '—'; color: var(--muted); }
#eWrap { margin-top: 18px; }
.gas__tbl td { word-break: normal; overflow-wrap: anywhere; }
.gas .input, .gas .select { height: 46px; }
.gas__tbl td small { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }
.gas__tbl tr.is-edit td { background: var(--primary-50); }
.dtable .gas__num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.gas__ops { white-space: nowrap; text-align: right; width: 1%; }
.gas__ops > * { vertical-align: middle; }
.gas__ops .gas__rm { margin-left: 4px; }
.gas__pos { color: var(--ok); font-weight: 700; }
.gas__neg { color: var(--err); font-weight: 700; }
.gas__res { margin-top: 20px; align-items: start; }
.gas__tx { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.gas__t { display: flex; align-items: center; justify-content: space-between; gap: 10px; border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; }
.gas__tt { overflow-wrap: anywhere; }
.gas__tt strong { color: var(--primary); white-space: nowrap; }
.gas__t.is-done { background: var(--surface-2); }
.gas__t.is-done .gas__tt { color: var(--muted); text-decoration: line-through; }
.gas__t.is-done .gas__tt strong { color: inherit; }
.gas__done { flex: none; font-size: .88rem; color: var(--muted); }
.gas__empty { color: var(--muted); font-size: .92rem; padding: 10px 0; }
.gas .btn.is-off { opacity: .5; pointer-events: none; }
.gas__note { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; color: var(--muted); font-size: .88rem; }
.gas__note .ico { flex: none; color: var(--primary); }
@media (max-width: 560px) {
  .gas__exp { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .gas__fc { grid-column: 1 / -1; }
  .gas__tbl th, .gas__tbl td { padding: 8px 6px; }
  .gas__tbl { font-size: .84rem; }
  .gas__tbl th { font-size: .68rem; letter-spacing: .03em; }
  .gas__t { padding: 10px 12px; }
}