/* ==========================================================================
   kitbasic — Hoja de estilos principal
   --------------------------------------------------------------------------
   Diseño limpio, moderno y mobile-first. Sin frameworks. Usa variables CSS
   para que cambiar colores sea trivial. Incluye modo oscuro automático.
   Las clases de componentes (.btn, .widget, .field, .dropzone...) las reutilizan
   todas las herramientas para verse consistentes.
   ========================================================================== */

/* ---------- Variables de tema (paleta oficial de marca kitbasic) ---------- */
:root {
    --azul:        #2F6BFF;   /* Primario — botones, enlaces, estados activos */
    --azul-osc:    #2456E0;   /* Primario hover */
    --azul-claro:  #E9EFFF;   /* Tinte suave del azul (fondos de icono, hover) */
    --coral:       #FF7A59;   /* Acento — solo detalles puntuales (5-10%) */
    --coral-claro: #FFEAE3;   /* Tinte del coral (fondos de badge) */
    --verde:       #22C55E;   /* Éxito */
    --rojo:        #EF4444;   /* Error */
    --ambar:       #F59E0B;   /* Aviso */

    --fondo:       #F8FAFC;   /* Fondo general */
    --superficie:  #FFFFFF;   /* Tarjetas y áreas de herramienta */
    --superficie-2:#F1F5F9;   /* Áreas hundidas (dropzone, resultados) */
    --borde:       #E2E8F0;   /* Bordes y divisores */
    --texto:       #0F172A;   /* Tinta — texto principal */
    --texto-suave: #64748B;   /* Apagado — texto secundario */
    --texto-tenue: #94A3B8;   /* Texto muy tenue (placeholders) */

    --sombra:      0 6px 24px rgba(15, 23, 42, .06);
    --sombra-alta: 0 12px 34px rgba(15, 23, 42, .12);
    --radio:       16px;      /* Radio medio (tarjetas, widgets) */
    --radio-sm:    10px;      /* Radio pequeño (botones, inputs) */
    --radio-lg:    24px;      /* Radio grande */
    --ancho:       1140px;
    --fuente:      'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --mono:        ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --fondo:       #0B1120;
        --superficie:  #0F172A;
        --superficie-2:#162033;
        --borde:       #1E293B;
        --texto:       #E2E8F0;
        --texto-suave: #94A3B8;
        --texto-tenue: #64748B;
        --azul-claro:  #14224A;
        --coral-claro: #3A2218;
        --sombra:      0 6px 24px rgba(0, 0, 0, .4);
        --sombra-alta: 0 12px 34px rgba(0, 0, 0, .55);
    }
}

/* ---------- Reset y base ---------- */
*, *::before, *::after { box-sizing: border-box; }

* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
    font-family: var(--fuente);
    background: var(--fondo);
    color: var(--texto);
    line-height: 1.65;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

img, svg, video { display: block; max-width: 100%; }

a { color: var(--azul); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.25; font-weight: 700; color: var(--texto); }
h1 { font-size: clamp(1.6rem, 1.1rem + 2vw, 2.3rem); }
h2 { font-size: clamp(1.3rem, 1rem + 1.2vw, 1.6rem); margin-top: .2em; }
h3 { font-size: 1.1rem; }

p { color: var(--texto-suave); }

.icono { width: 24px; height: 24px; flex: none; }

.skip-link {
    position: absolute; left: -999px; top: 0;
    background: var(--azul); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
    z-index: 1000;
}
.skip-link:focus { left: 0; }

/* ---------- Contenedor ---------- */
.contenedor {
    width: 100%;
    max-width: var(--ancho);
    margin-inline: auto;
    padding-inline: clamp(1rem, 4vw, 2rem);
}

main.contenedor { flex: 1 0 auto; padding-top: 1.6rem; padding-bottom: 3rem; }

/* ---------- Cabecera ---------- */
.cabecera {
    background: var(--superficie);
    border-bottom: 1px solid var(--borde);
    position: sticky; top: 0; z-index: 50;
}
.cabecera__inner {
    display: flex; align-items: center; gap: 1rem;
    min-height: 64px;
}

.logo { display: flex; align-items: center; gap: .5rem; }
.logo:hover { text-decoration: none; }
.logo__iso { width: 34px; height: 34px; flex: none; }
.logo__word {
    font-weight: 700; font-size: 1.4rem; letter-spacing: -.03em;
    line-height: 1; color: var(--texto);
}
.logo__word .b { color: var(--azul); }
.logo__word .dot { color: var(--coral); }
.logo--pie .logo__iso { width: 30px; height: 30px; }
.logo--pie .logo__word { font-size: 1.2rem; }

.nav { margin-left: auto; }
.nav__list {
    list-style: none; padding: 0; margin: 0;
    display: flex; gap: .12rem; align-items: center;
}
.nav__list > li { position: relative; }
.nav__list a,
.nav__otros-btn {
    display: flex; align-items: center; gap: .4rem;
    padding: .5rem .62rem; border-radius: var(--radio-sm);
    color: var(--texto-suave); font-size: .92rem; font-weight: 600;
    white-space: nowrap;
}
.nav__otros-btn { background: none; border: 0; cursor: pointer; font-family: inherit; }
.nav__list a:hover,
.nav__otros-btn:hover { background: var(--azul-claro); color: var(--azul); text-decoration: none; }
.nav__icon { width: 18px; height: 18px; flex: none; }
.nav__caret { font-size: .62rem; transition: transform .2s ease; }

/* Desplegable "Otros" */
.nav__sub {
    list-style: none; margin: 0; padding: .4rem;
    position: absolute; right: 0; top: calc(100% + 6px);
    min-width: 232px; display: none; flex-direction: column; gap: .1rem;
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); box-shadow: var(--sombra-alta); z-index: 60;
}
.nav__item-otros:hover .nav__sub,
.nav__item-otros:focus-within .nav__sub { display: flex; }
.nav__item-otros:hover .nav__caret,
.nav__item-otros:focus-within .nav__caret { transform: rotate(180deg); }
.nav__sub a { font-size: .9rem; }

.nav-toggle {
    margin-left: auto; display: none;
    background: var(--superficie-2); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); padding: .45rem; color: var(--texto); cursor: pointer;
}

@media (max-width: 1024px) {
    .nav-toggle { display: block; }
    .nav { margin-left: 0; }
    .nav__list {
        display: none; flex-direction: column; align-items: stretch;
        position: absolute; left: 0; right: 0; top: 100%;
        background: var(--superficie); border-bottom: 1px solid var(--borde);
        padding: .6rem clamp(1rem, 4vw, 2rem) 1rem; gap: .15rem;
        box-shadow: var(--sombra);
    }
    .nav.abierto .nav__list { display: flex; }
    .nav__list a { padding: .7rem .6rem; }
    /* En móvil "Otros" se muestra siempre como sublista indentada. */
    .nav__otros-btn { width: 100%; padding: .7rem .6rem; cursor: default; }
    .nav__caret { display: none; }
    .nav__sub {
        position: static; display: flex; min-width: 0;
        border: 0; box-shadow: none; background: none; padding: 0 0 0 1.4rem;
    }
    .nav__sub a { padding: .6rem; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs ol {
    list-style: none; padding: 0; display: flex; flex-wrap: wrap;
    gap: .35rem; font-size: .86rem; margin-bottom: 1rem;
}
.breadcrumbs li { display: flex; align-items: center; gap: .35rem; color: var(--texto-tenue); }
.breadcrumbs li:not(:last-child)::after { content: "›"; color: var(--texto-tenue); }
.breadcrumbs a { color: var(--texto-suave); }
.breadcrumbs [aria-current] { color: var(--texto-tenue); }

/* ---------- Botones ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    font-family: inherit; font-size: .95rem; font-weight: 600;
    padding: .68rem 1.1rem; border-radius: var(--radio-sm);
    border: 1px solid var(--borde); background: var(--superficie); color: var(--texto);
    cursor: pointer; transition: transform .05s, background .15s, border-color .15s;
    text-decoration: none;
}
.btn:hover { background: var(--superficie-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .icono { width: 18px; height: 18px; }

.btn--primary { background: var(--azul); border-color: var(--azul); color: #fff; }
.btn--primary:hover { background: var(--azul-osc); }
.btn--ghost { background: transparent; }
.btn--bloque { width: 100%; }
.btn--grande { padding: .85rem 1.4rem; font-size: 1rem; }

.btn-fila { display: flex; flex-wrap: wrap; gap: .6rem; }

/* ---------- Campos de formulario ---------- */
.campo { margin-bottom: 1rem; }
.campo > label, .etiqueta {
    display: block; font-weight: 600; font-size: .9rem;
    margin-bottom: .35rem; color: var(--texto);
}
input[type=text], input[type=number], input[type=password], input[type=date],
input[type=datetime-local], input[type=color], input[type=email],
select, textarea {
    width: 100%; font-family: inherit; font-size: .95rem;
    padding: .62rem .75rem; color: var(--texto);
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--azul);
    box-shadow: 0 0 0 3px rgba(47, 107, 255, .18);
}
textarea { resize: vertical; min-height: 140px; line-height: 1.55; }
textarea.mono, input.mono { font-family: var(--mono); font-size: .9rem; }

input[type=range] { width: 100%; accent-color: var(--azul); }
input[type=color] { height: 44px; padding: .25rem; cursor: pointer; }

.fila { display: flex; gap: 1rem; flex-wrap: wrap; }
.fila > * { flex: 1 1 180px; }

/* ---------- Tarjetas / grid ---------- */
.grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}
.grid--rel { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }

.card {
    display: flex; gap: .85rem; align-items: flex-start;
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio); padding: 1.05rem;
    box-shadow: var(--sombra); transition: transform .12s, box-shadow .12s, border-color .12s;
}
.card:hover {
    text-decoration: none; transform: translateY(-3px);
    box-shadow: var(--sombra-alta); border-color: #c7d2fe;
}
.card__icon {
    display: grid; place-items: center; flex: none;
    width: 44px; height: 44px; border-radius: 11px;
    background: var(--azul-claro); color: var(--azul);
}
.card__icon .icono { width: 24px; height: 24px; }
.card__body { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.card__title { font-weight: 700; color: var(--texto); }
.card__desc { font-size: .85rem; color: var(--texto-suave); line-height: 1.5; }
.card__cat {
    display: none;
}

/* ---------- Home ---------- */
.hero {
    text-align: center; padding: 2.4rem 1rem 1.4rem;
}
.hero h1 { letter-spacing: -.02em; }
.hero p { max-width: 620px; margin: .7rem auto 0; font-size: 1.05rem; }

.buscador {
    position: relative; max-width: 540px; margin: 1.6rem auto 0;
}
.buscador .icono {
    position: absolute; left: .9rem; top: 50%; transform: translateY(-50%);
    color: var(--texto-tenue); width: 20px; height: 20px;
}
.buscador input {
    width: 100%; padding-left: 2.6rem; padding-right: 1.2rem;
    height: 52px; font-size: 1rem;
    border-radius: 999px; box-shadow: var(--sombra);
}

.seccion { margin-top: 2.6rem; }
.seccion__cab {
    display: flex; align-items: center; gap: .6rem; margin-bottom: 1rem;
}
.seccion__cab .icono { color: var(--azul); }
.seccion__cab h2 { margin: 0; }
.seccion__cab a { margin-left: auto; font-size: .88rem; font-weight: 600; }

.sin-resultados {
    display: none; text-align: center; padding: 2rem; color: var(--texto-tenue);
}

.intro-seo {
    margin-top: 3rem; background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio); padding: 1.6rem clamp(1.2rem, 4vw, 2.4rem);
}
.intro-seo h2 { margin-top: 1.2rem; }
.intro-seo h2:first-child { margin-top: 0; }
.intro-seo p, .intro-seo li { color: var(--texto-suave); }
.intro-seo ul { padding-left: 1.2rem; }

/* ---------- Página de herramienta ---------- */
.tool__lead {
    font-size: 1.05rem; color: var(--texto-suave); max-width: 720px; margin-bottom: 1.3rem;
}

.widget {
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio); box-shadow: var(--sombra);
    padding: clamp(1.1rem, 3vw, 1.8rem); margin-bottom: 1.4rem;
}

.bloque { margin-top: 2.2rem; }
.bloque--intro { margin-top: 1.6rem; }
.bloque p { margin-bottom: .7rem; }

.pasos { padding-left: 0; list-style: none; counter-reset: paso; }
.pasos li {
    position: relative; padding: .35rem 0 .35rem 2.6rem; counter-increment: paso;
    color: var(--texto-suave);
}
.pasos li::before {
    content: counter(paso); position: absolute; left: 0; top: .35rem;
    width: 1.7rem; height: 1.7rem; border-radius: 50%;
    background: var(--azul-claro); color: var(--azul);
    font-weight: 700; font-size: .85rem; display: grid; place-items: center;
}

/* ---------- FAQ ---------- */
.faq { display: flex; flex-direction: column; gap: .55rem; }
.faq__item {
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); overflow: hidden;
}
.faq__item summary {
    cursor: pointer; padding: .9rem 1.1rem; font-weight: 600;
    list-style: none; display: flex; justify-content: space-between; gap: 1rem;
}
.faq__item summary::-webkit-details-marker { display: none; }
.faq__item summary::after { content: "+"; color: var(--azul); font-weight: 700; font-size: 1.3rem; }
.faq__item[open] summary::after { content: "−"; }
.faq__resp { padding: 0 1.1rem 1rem; }
.faq__resp p { margin: 0; }

/* ---------- Dropzone (subida de archivos local) ---------- */
.dropzone {
    border: 2px dashed var(--borde); border-radius: var(--radio);
    background: var(--superficie-2); padding: 2rem 1rem; text-align: center;
    cursor: pointer; transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.sobre { border-color: var(--azul); background: var(--azul-claro); }
.dropzone .icono { width: 40px; height: 40px; margin: 0 auto .6rem; color: var(--azul); }
.dropzone strong { color: var(--texto); }
.dropzone small { display: block; color: var(--texto-tenue); margin-top: .3rem; }
.dropzone input[type=file] { display: none; }

/* ---------- Resultado / salida ---------- */
.resultado {
    background: var(--superficie-2); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); padding: 1rem; margin-top: 1rem;
}
.resultado--ok { border-color: var(--verde); }
.resultado--error { border-color: var(--rojo); color: var(--rojo); }

.copia-fila { display: flex; gap: .5rem; align-items: stretch; }
.copia-fila input, .copia-fila textarea { flex: 1; }

.dato-grande {
    font-size: clamp(1.8rem, 1.2rem + 3vw, 2.6rem); font-weight: 800;
    color: var(--azul); line-height: 1.1;
}
.nota { font-size: .85rem; color: var(--texto-tenue); }

.vista-previa { margin-top: 1rem; }
.vista-previa img {
    max-height: 320px; margin: 0 auto; border-radius: var(--radio-sm);
    border: 1px solid var(--borde);
}

.pildora {
    display: inline-flex; align-items: center; gap: .35rem;
    background: var(--azul-claro); color: var(--azul);
    font-size: .8rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px;
}

/* Conmutador de pestañas */
.tabs { display: flex; gap: .3rem; background: var(--superficie-2);
    padding: .3rem; border-radius: var(--radio-sm); margin-bottom: 1rem; }
.tabs button {
    flex: 1; padding: .5rem; border: 0; background: transparent; cursor: pointer;
    border-radius: 7px; font-family: inherit; font-weight: 600; color: var(--texto-suave);
}
.tabs button.activa { background: var(--superficie); color: var(--azul); box-shadow: var(--sombra); }

/* ---------- Aviso de privacidad de las herramientas ---------- */
.aviso-privacidad {
    display: flex; align-items: center; gap: .55rem;
    font-size: .85rem; color: var(--verde); margin-top: .4rem;
}
.aviso-privacidad .icono { width: 18px; height: 18px; }

/* ---------- Anuncios ---------- */
.ad {
    margin: 1.4rem 0; padding: .5rem; text-align: center;
    border: 1px dashed var(--borde); border-radius: var(--radio-sm);
    min-height: 90px; display: grid; place-items: center;
    background: var(--superficie-2);
}
.ad::before { content: "Publicidad"; font-size: .7rem; color: var(--texto-tenue);
    position: absolute; }

/* ---------- Pie de página ---------- */
.pie {
    background: var(--superficie); border-top: 1px solid var(--borde);
    margin-top: auto; padding: 2.4rem 0 1.4rem;
}
.pie__marca { max-width: 540px; margin-bottom: 1.8rem; }
.pie__lema { font-size: .9rem; margin-top: .6rem; color: var(--texto-suave); }
.logo--pie .logo__text { font-size: 1.1rem; }

/* Directorio multicolumna: 4 columnas en escritorio, 2 en móvil. */
.pie__cats { column-count: 4; column-gap: 1.8rem; }
.pie__cat {
    break-inside: avoid; -webkit-column-break-inside: avoid;
    display: inline-block; width: 100%; margin-bottom: 1.5rem;
}
.pie__titulo { font-size: .95rem; margin-bottom: .5rem; }
.pie__titulo a { color: var(--texto); }
.pie__cat ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.pie__cat a { color: var(--texto-suave); font-size: .86rem; }
.pie__cat a:hover { color: var(--azul); }

@media (max-width: 900px) { .pie__cats { column-count: 3; } }
@media (max-width: 600px) { .pie__cats { column-count: 2; column-gap: 1.1rem; } }
.pie__legal {
    border-top: 1px solid var(--borde); margin-top: 2rem; padding-top: 1.2rem;
    display: flex; flex-wrap: wrap; gap: .6rem 1.2rem;
    align-items: center; justify-content: space-between;
}
.pie__legal nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.pie__legal a { color: var(--texto-suave); font-size: .88rem; }
.pie__legal p { font-size: .82rem; color: var(--texto-tenue); }

/* ---------- Panel de estadísticas ---------- */
.panel-stats { display: flex; flex-direction: column; gap: 1.4rem; }
.stats-grid {
    display: grid; gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}
.stat-card {
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio); padding: 1.2rem; box-shadow: var(--sombra);
}
.stat-card .etq { font-size: .82rem; color: var(--texto-tenue); font-weight: 600;
    text-transform: uppercase; letter-spacing: .04em; }
.stat-card .num { font-size: 2rem; font-weight: 800; color: var(--texto); margin-top: .2rem; }
.stat-card .etq .etq-icono { width: 14px; height: 14px; vertical-align: -2px; }
.stat-card .sub { font-size: .82rem; color: var(--texto-suave); }

.grafico {
    display: flex; align-items: flex-end; gap: 4px; height: 130px;
    padding-top: .5rem;
}
.grafico .barra {
    flex: 1; background: var(--azul); border-radius: 4px 4px 0 0;
    min-height: 3px; position: relative;
}
.grafico .barra:hover { background: var(--azul-osc); }

.tabla-wrap { overflow-x: auto; }
table.tabla {
    width: 100%; border-collapse: collapse; font-size: .92rem;
    background: var(--superficie); border-radius: var(--radio); overflow: hidden;
    box-shadow: var(--sombra);
}
table.tabla th, table.tabla td {
    padding: .7rem .9rem; text-align: left; border-bottom: 1px solid var(--borde);
}
table.tabla th { background: var(--superficie-2); font-size: .8rem;
    text-transform: uppercase; letter-spacing: .03em; color: var(--texto-tenue); }
table.tabla td.num, table.tabla th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tabla tr:last-child td { border-bottom: 0; }

.caja-login {
    max-width: 380px; margin: 3rem auto; background: var(--superficie);
    border: 1px solid var(--borde); border-radius: var(--radio);
    padding: 2rem; box-shadow: var(--sombra);
}

.aviso {
    padding: .9rem 1.1rem; border-radius: var(--radio-sm);
    background: var(--azul-claro); color: var(--azul-osc);
    border: 1px solid #bfdbfe; font-size: .92rem;
}
.aviso--error { background: #fef2f2; color: var(--rojo); border-color: #fecaca; }

/* ---------- Panel de estadísticas — ampliación ---------- */
.panel-sec { display: flex; flex-direction: column; gap: .7rem; }
.panel-sec > h2 { font-size: 1.15rem; }
.panel-sec > .nota { margin-top: -.2rem; }
.panel-sec__cab {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; flex-wrap: wrap;
}
.panel-sec__cab h2 { font-size: 1.15rem; }
.periodo-sel {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .85rem; color: var(--texto-suave); font-weight: 600;
}
.periodo-sel select {
    padding: .34rem .55rem; border-radius: var(--radio-sm);
    border: 1px solid var(--borde); background: var(--superficie);
    color: var(--texto); font-family: inherit; font-size: .85rem; cursor: pointer;
}

.tarjeta {
    background: var(--superficie); border: 1px solid var(--borde);
    border-radius: var(--radio); padding: 1.3rem; box-shadow: var(--sombra);
}

/* Píldoras de crecimiento (▲ sube / ▼ baja) */
.kpi-delta {
    display: inline-flex; align-items: center; gap: .2rem;
    font-size: .76rem; font-weight: 700; padding: .08rem .42rem;
    border-radius: 999px; white-space: nowrap;
}
.kpi-delta.sube    { background: rgba(34, 197, 94, .16);  color: var(--verde); }
.kpi-delta.baja    { background: rgba(239, 68, 68, .16);  color: var(--rojo); }
.kpi-delta.nuevo   { background: rgba(255, 122, 89, .18); color: var(--coral); }
.kpi-delta.neutral { background: var(--superficie-2);     color: var(--texto-tenue); }

/* Gráfica de líneas de 30 días */
.grafico-linea { width: 100%; overflow: hidden; }
.grafico-linea .g-linea { width: 100%; height: auto; display: block; }
.leyenda {
    display: flex; flex-wrap: wrap; gap: 1.1rem;
    font-size: .84rem; color: var(--texto-suave);
}
.leyenda span { display: inline-flex; align-items: center; gap: .4rem; }
.leyenda i { width: 16px; height: 3px; border-radius: 2px; }

/* Sparklines (mini-tendencia por herramienta) */
.spark { width: 90px; height: 28px; display: block; }
.spark-vacio { color: var(--texto-tenue); font-weight: 700; }
table.tabla td.tendencia { width: 104px; }

/* Barras horizontales reutilizables */
.barra-h-pista {
    display: block; width: 100%; height: 9px;
    background: var(--superficie-2); border-radius: 5px; overflow: hidden;
}
.barra-h { display: block; height: 100%; border-radius: 5px; min-width: 3px; }

/* Comparativa de categorías */
.barras-cat { display: flex; flex-direction: column; gap: .9rem; }
.barra-cat { display: grid; gap: .25rem; }
.barra-cat__etq {
    display: flex; align-items: center; gap: .45rem;
    font-weight: 600; font-size: .92rem;
}
.barra-cat__etq .icono { width: 18px; height: 18px; color: var(--azul); }
.barra-cat__val { font-size: .8rem; color: var(--texto-suave); }

/* Bloques de categoría en el listado completo */
.cat-bloque { margin-top: 1.4rem; }
.cat-cab {
    display: flex; align-items: center; gap: .5rem; margin-bottom: .55rem;
    flex-wrap: wrap;
}
.cat-cab .icono { width: 20px; height: 20px; color: var(--azul); }
.cat-cab h3 { font-size: 1.02rem; margin: 0; }
.cat-tot { font-size: .8rem; color: var(--texto-suave); font-weight: 600; }

/* ---------- Aviso de responsabilidad al pie de cada herramienta ---------- */
.aviso-uso {
    display: flex; gap: .6rem; align-items: flex-start;
    margin-top: 2rem; padding: .9rem 1.1rem;
    border-top: 1px solid var(--borde);
    font-size: .8rem; line-height: 1.5; color: var(--texto-tenue);
}
.aviso-uso .icono { width: 18px; height: 18px; flex-shrink: 0; margin-top: .1rem; }
.aviso-uso strong { color: var(--texto-suave); }

/* ---------- Impresión / Descargar PDF ---------- */
@media print {
    /* El cromo del sitio (cabecera, pie, anuncios…) nunca se imprime. */
    .cabecera, .pie, .ad, .skip-link, .breadcrumbs, .aviso-uso,
    .nav-toggle { display: none !important; }

    /* En las páginas de los generadores, imprimir SOLO el documento:
       se ocultan todos los elementos que no están en la rama de .doc-preview
       (formulario, botones, contenido SEO…). Así el PDF sale limpio. */
    body:has(.doc-preview) *:not(:has(.doc-preview)):not(.doc-preview):not(.doc-preview *) {
        display: none !important;
    }
    body:has(.doc-preview) .doc-preview {
        margin: 0 !important; width: 100% !important; min-height: 0 !important;
        border: 0 !important; box-shadow: none !important; border-radius: 0 !important;
    }

    @page { margin: 1.4cm; }
    body { background: #fff !important; }
}

/* ---------- Toast (mensaje "copiado") ---------- */
.toast {
    position: fixed; left: 50%; bottom: 1.5rem; transform: translateX(-50%) translateY(20px);
    background: var(--texto); color: var(--fondo);
    padding: .65rem 1.1rem; border-radius: 999px; font-size: .88rem; font-weight: 600;
    opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 999;
}
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Contenido de texto largo ---------- */
.prosa { max-width: 760px; }
.prosa h2 { margin-top: 1.6rem; }
.prosa p, .prosa li { color: var(--texto-suave); }
.prosa ul { padding-left: 1.2rem; }

/* ---------- Utilidades ---------- */
.oculto { display: none !important; }
.centro { text-align: center; }
.mt-1 { margin-top: 1rem; }
.mb-0 { margin-bottom: 0; }

/* ---------- Calculadora ---------- */
.calc { max-width: 360px; margin: 0 auto; }
.calc__pantalla {
    display: block; width: 100%; text-align: right;
    background: var(--superficie-2); border: 1px solid var(--borde);
    border-radius: var(--radio-sm); padding: 1rem 1.1rem; margin-bottom: .7rem;
    font-size: clamp(1.8rem, 1.2rem + 3vw, 2.4rem); font-weight: 700;
    color: var(--texto); overflow-x: auto; white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.calc__teclas { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.calc__t {
    font-family: inherit; font-size: 1.2rem; font-weight: 600;
    padding: .9rem 0; border: 1px solid var(--borde);
    background: var(--superficie); color: var(--texto);
    border-radius: var(--radio-sm); cursor: pointer;
    transition: background .12s, transform .05s;
}
.calc__t:hover { background: var(--superficie-2); }
.calc__t:active { transform: translateY(1px); }
.calc__t--op { background: var(--azul-claro); color: var(--azul); }
.calc__t--op:hover { background: #dbe5ff; }
.calc__t--op.activa { background: var(--azul); color: #fff; }
.calc__t--fn { color: var(--texto-suave); }
.calc__t--ig { background: var(--azul); color: #fff; }
.calc__t--ig:hover { background: var(--azul-osc); }
.calc__t--cero { grid-column: span 2; }
