:root {
    --corcilen-primary: #7c3aed;
    --corcilen-primary-dark: #4c1d95;
    --corcilen-secondary: #4f46e5;
    --corcilen-accent: #3b82f6;
    --corcilen-accent-light: #60a5fa;
    --corcilen-dark: #131022;
}

body {
    font-family: 'Inter', sans-serif;
    color: #1e1b2e;
}

h1, h2, h3, .brand-word {
    font-family: 'Sora', 'Inter', sans-serif;
}

.navbar-corcilen {
    background: rgba(255, 255, 255, .85);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(76, 29, 149, .08);
}

.navbar-corcilen .navbar-brand {
    font-weight: 800;
    letter-spacing: .5px;
}

.navbar-corcilen .brand-word {
    color: var(--corcilen-dark);
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.navbar-corcilen .nav-link {
    font-weight: 500;
    color: #3f3a52 !important;
}

.navbar-corcilen .nav-link:hover {
    color: var(--corcilen-primary) !important;
}

.hero-corcilen {
    background:
        radial-gradient(circle at 15% 20%, rgba(124, 58, 237, .55), transparent 45%),
        radial-gradient(circle at 85% 15%, rgba(59, 130, 246, .45), transparent 50%),
        linear-gradient(160deg, var(--corcilen-dark) 0%, #241b45 55%, #1c2a5e 100%);
    color: #fff;
    padding: 7rem 0 8rem;
    position: relative;
    overflow: hidden;
}

.hero-corcilen .badge-provisional {
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .25);
    color: #e9e5ff;
    font-weight: 500;
    letter-spacing: .3px;
}

.hero-corcilen h1 {
    font-weight: 800;
    font-size: clamp(2.2rem, 4vw, 3.4rem);
}

.hero-corcilen p.lead {
    color: #d8d3f5;
    max-width: 640px;
}

.btn-gradient {
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    border: none;
    color: #fff;
    font-weight: 600;
    box-shadow: 0 10px 25px rgba(124, 58, 237, .35);
}

.btn-gradient:hover {
    filter: brightness(1.08);
    color: #fff;
}

.section-card {
    border: none;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(76, 29, 149, .07);
    transition: transform .2s ease, box-shadow .2s ease;
}

.section-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 18px 40px rgba(76, 29, 149, .14);
}

.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    color: #fff;
    font-size: 1.3rem;
}


.hero-logo {
    width: 88px;
    height: auto;
    filter: drop-shadow(0 8px 20px rgba(124, 58, 237, .45));
}

.brand-word-hero {
    background: linear-gradient(135deg, #c4b5fd, #93c5fd);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-stats {
    display: inline-flex;
    align-items: center;
    gap: 2rem;
    background: rgba(255, 255, 255, .07);
    border: 1px solid rgba(255, 255, 255, .15);
    border-radius: 18px;
    padding: 1.1rem 2.2rem;
}

.hero-stat-value {
    font-family: 'Sora', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.hero-stat-label {
    color: #c9c3ec;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-top: .3rem;
}

.hero-stat-sep {
    width: 1px;
    height: 38px;
    background: rgba(255, 255, 255, .18);
}

.tema-pill {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    border: 1px solid #ece9f7;
    border-radius: 999px;
    padding: .5rem 1rem;
    font-size: .87rem;
    font-weight: 600;
    color: #2b2640;
    text-decoration: none;
    transition: all .15s ease;
}

.tema-pill:hover {
    border-color: rgba(124, 58, 237, .4);
    box-shadow: 0 8px 20px rgba(76, 29, 149, .12);
    transform: translateY(-2px);
    color: #2b2640;
}

.tema-pill .dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    display: inline-block;
}

.tema-pill .count {
    background: #f4f2fb;
    color: #6b6489;
    border-radius: 999px;
    padding: .05rem .5rem;
    font-size: .75rem;
}

footer.footer-corcilen {
    background: var(--corcilen-dark);
    color: #a29bc7;
}

footer.footer-corcilen a {
    color: #d8d3f5;
    text-decoration: none;
}

footer.footer-corcilen a:hover {
    color: #fff;
}

/* -------- Buscador -------- */
.search-hero {
    background:
        radial-gradient(circle at 10% 10%, rgba(124, 58, 237, .5), transparent 45%),
        radial-gradient(circle at 90% 0%, rgba(59, 130, 246, .45), transparent 50%),
        linear-gradient(160deg, var(--corcilen-dark) 0%, #241b45 60%, #1c2a5e 100%);
    color: #fff;
    padding: 4rem 0 6rem;
}

.search-box {
    background: rgba(255, 255, 255, .97);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
    padding: 1.2rem;
}

.search-box .form-control,
.search-box .form-select {
    border: none;
    background: #f4f2fb;
}

.search-box .form-control:focus,
.search-box .form-select:focus {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, .18);
}

.filters-panel {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ece9f7;
    box-shadow: 0 8px 24px rgba(76, 29, 149, .05);
    padding: 1.4rem;
}

.filters-panel label {
    font-size: .78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #6b6489;
}

mark {
    background: rgba(124, 58, 237, .18);
    color: #4c1d95;
    font-weight: 700;
    padding: 0 .1em;
    border-radius: 3px;
}

.stat-box {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #ece9f7;
    padding: 1.4rem;
    text-align: center;
}

.stat-box-value {
    font-family: 'Sora', sans-serif;
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--corcilen-dark);
}

.stat-box-label {
    color: #6b6489;
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    margin-top: .2rem;
}

.badge-visible-stat {
    background: rgba(124, 58, 237, .12);
    color: var(--corcilen-primary);
    font-weight: 700;
}

.word-chip {
    background: #f4f2fb;
    color: #2b2640;
    border-radius: 999px;
    padding: .3rem .8rem;
    text-decoration: none;
    font-weight: 600;
    transition: all .15s ease;
}

.word-chip:hover {
    background: var(--corcilen-primary);
    color: #fff;
}

.author-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.6rem;
    flex-shrink: 0;
}

.auto-chip {
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .3);
    color: #fff;
    font-size: .78rem;
    font-weight: 600;
    padding: .25rem .7rem;
    border-radius: 999px;
}

.auto-chip:hover {
    background: rgba(255, 255, 255, .26);
    color: #fff;
}

.date-filter-chip {
    display: inline-flex;
    align-items: center;
    background: #ede9fe;
    border: 1px solid #ddd4f7;
    color: #4c1d95;
    font-size: .8rem;
    font-weight: 600;
    padding: .3rem .75rem;
    border-radius: 999px;
}

.date-filter-chip a {
    color: #4c1d95;
    opacity: .75;
}

.date-filter-chip a:hover {
    opacity: 1;
}

.autocomplete-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(30, 27, 46, .18);
    z-index: 40;
    overflow: hidden;
    text-align: left;
}

.autocomplete-item {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .65rem 1rem;
    color: #2b2640;
    text-decoration: none;
    font-size: .92rem;
    border-bottom: 1px solid #f4f2fb;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item i {
    color: var(--corcilen-primary);
}

.autocomplete-item:hover,
.autocomplete-item.activo {
    background: #f4f2fb;
}

.autocomplete-item .autocomplete-tipo {
    margin-left: auto;
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #a29bc7;
}

.kwic-table {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(76, 29, 149, .06);
}

.kwic-table table {
    margin-bottom: 0;
}

.kwic-table thead th {
    background: #f4f2fb;
    color: #6b6489;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .4px;
    border-bottom: none;
}

.kwic-context {
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: .87rem;
}

.kwic-term {
    display: inline-block;
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    color: #fff;
    font-weight: 700;
    padding: .2rem .6rem;
    border-radius: 8px;
    font-size: .85rem;
    white-space: nowrap;
}

.result-card {
    border: 1px solid #ece9f7;
    border-radius: 16px;
    background: #fff;
    transition: all .18s ease;
    height: 100%;
}

.result-card:hover {
    border-color: rgba(124, 58, 237, .35);
    box-shadow: 0 14px 34px rgba(76, 29, 149, .12);
    transform: translateY(-3px);
}

.tema-badge {
    font-weight: 600;
    letter-spacing: .2px;
    font-size: .72rem;
    text-transform: uppercase;
    padding: .3rem .65rem;
    border-radius: 999px;
}

.meta-pill {
    background: #f4f2fb;
    color: #4c1d95;
    border-radius: 999px;
    padding: .2rem .6rem;
    font-size: .75rem;
    font-weight: 500;
}

.doc-hero {
    background: linear-gradient(160deg, var(--corcilen-dark) 0%, #241b45 60%, #1c2a5e 100%);
    color: #fff;
    padding: 3.5rem 0 5rem;
}

.doc-content {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 50px rgba(76, 29, 149, .1);
}

.doc-content p {
    line-height: 1.85;
    color: #2b2640;
}

.doc-meta-table th {
    color: #6b6489;
    font-weight: 600;
    width: 42%;
}

/* --- Carrusel de "Relacionados" en la ficha pública --- */
.carousel-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e4e0f2;
    background: #fff;
    color: var(--corcilen-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    transition: all .2s ease;
}

.carousel-arrow:hover {
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 10px 22px rgba(124, 58, 237, .28);
}

.related-carousel {
    display: flex;
    gap: 1.1rem;
    overflow-x: auto;
    padding: .5rem .25rem 1.25rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.related-carousel::-webkit-scrollbar {
    display: none;
}

.related-card {
    flex: 0 0 auto;
    width: 270px;
    background: #fff;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    box-shadow: 0 10px 28px rgba(76, 29, 149, .08);
    border: 1px solid #ede9f9;
    scroll-snap-align: start;
    transition: transform .22s ease, box-shadow .22s ease;
    display: flex;
    flex-direction: column;
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(76, 29, 149, .18);
    color: inherit;
}

.related-card-bar {
    display: block;
    height: 5px;
    width: 100%;
}

.related-card-body {
    padding: 1.15rem 1.25rem 1.35rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.related-card-tag {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .4px;
    margin-bottom: .45rem;
}

.related-card-title {
    font-weight: 700;
    font-size: .96rem;
    line-height: 1.35;
    margin-bottom: .5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #1e1b2e;
}

.related-card-snippet {
    font-size: .82rem;
    color: #6b6489;
    line-height: 1.5;
    margin-bottom: .9rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    font-size: .72rem;
    color: #9791b3;
}

.related-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
}

@media (max-width: 767.98px) {
    .related-card { width: 230px; }
}

/* Botón que hace de "select" desplegable con checkboxes dentro (filtro de
   Sesgo). A propósito NO usa .form-select ni .btn juntos: Bootstrap añade
   su propia flecha de fondo en .form-select y OTRA flecha (::after) en
   .dropdown-toggle, y los padding/altura de .btn no coinciden con los de
   .form-select-sm — mezclados, se veía descuadrado. Este estilo propio
   imita el aspecto de .form-select-sm sin arrastrar ese conflicto. */
.filtro-dropdown-toggle {
    display: block;
    width: 100%;
    font-size: .875rem;
    padding: .25rem 2rem .25rem .5rem;
    border: 1px solid #ced4da;
    border-radius: .375rem;
    background-color: #fff;
    color: #212529;
    text-align: left;
    /* La misma flecha que trae Bootstrap de serie en los <select> normales
       (.form-select), para que se vea igual que los desplegables de al
       lado — a propósito NO se usa la clase .dropdown-toggle de Bootstrap,
       que añade su propio triángulo genérico encima de este. */
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right .75rem center;
    background-size: 16px 12px;
}

.filtro-dropdown-toggle:hover,
.filtro-dropdown-toggle:focus {
    border-color: #b8bfc6;
    background: #fff;
    color: #212529;
}

/* ==========================================================================
   LANDING (prefijo lp-)
   Lo memorable: una nube con las palabras reales del corpus orbitando detrás
   del título, coloreadas por tema. El resto de la página se mantiene sobrio.
   ========================================================================== */

/* --- Las letras de CORCILEN: el color fluye por ellas ---------------------
   Un degradado que empieza y termina en el mismo color, desplazado en bucle,
   hace que el color "corra" por las letras sin tener que separarlas una a
   una (así el nombre sigue siendo una sola palabra para lectores de pantalla). */
@keyframes lp-flujo {
    from { background-position: 0% 0; }
    to   { background-position: 200% 0; }
}

.brand-word-hero {
    background-image: linear-gradient(100deg, #c4b5fd 0%, #93c5fd 20%, #67e8f9 40%, #f0abfc 60%, #a78bfa 80%, #c4b5fd 100%);
    background-size: 200% 100%;
    animation: lp-flujo 7s linear infinite;
    filter: drop-shadow(0 0 22px rgba(147, 197, 253, .35));
}

.navbar-corcilen .brand-word {
    background-image: linear-gradient(100deg, #7c3aed 0%, #4f46e5 20%, #3b82f6 40%, #06b6d4 60%, #a855f7 80%, #7c3aed 100%);
    background-size: 200% 100%;
    animation: lp-flujo 10s linear infinite;
}

@media (prefers-reduced-motion: reduce) {
    .brand-word-hero,
    .navbar-corcilen .brand-word {
        animation: none;
    }
}

/* --- Hero: mismo fondo y colores de siempre, con aire --- */
.hero-corcilen.lp-hero {
    padding: 4.5rem 0 7.5rem;
    overflow: hidden; /* la nube no debe salirse del hero */
}

.lp-hero .hero-logo {
    display: block;
    width: 72px;
    margin: 0 auto 1rem;
}

.lp-hero .badge-provisional {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 1.4rem;
    white-space: normal; /* Bootstrap lo fuerza a una sola línea y en móvil se salía de la pantalla */
    line-height: 1.35;
}

.lp-hero h1 {
    font-size: clamp(2.4rem, 5.4vw, 4.2rem);
    line-height: 1.04;
    letter-spacing: -.025em;
    margin-bottom: 1rem;
}

.lp-hero p.lead {
    font-size: 1.12rem;
    line-height: 1.55;
}

/* El texto del hero va por encima de la nube; lo que no es interactivo deja pasar el ratón
   para que se pueda tocar la nube por detrás. */
.lp-hero-contenido {
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.lp-hero-contenido a,
.lp-hero-contenido button,
.lp-hero-contenido input,
.lp-hero-contenido form {
    pointer-events: auto;
}

/* --- Buscador del hero --- */
.lp-search {
    display: flex;
    align-items: center;
    gap: .5rem;
    max-width: 640px;
    margin: 1.9rem auto 0;
    padding: .4rem .4rem .4rem 1.3rem;
    background: rgba(255, 255, 255, .09);
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: 999px;
    backdrop-filter: blur(10px);
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.lp-search:focus-within {
    background: rgba(255, 255, 255, .14);
    border-color: rgba(196, 181, 253, .75);
    box-shadow: 0 0 0 4px rgba(124, 58, 237, .28);
}

.lp-search > i {
    color: #c4b5fd;
    font-size: 1.05rem;
}

.lp-search input {
    flex: 1;
    min-width: 0;
    padding: .6rem .3rem;
    background: transparent;
    border: 0;
    outline: 0;
    color: #fff;
    font-size: 1.02rem;
}

.lp-search input::placeholder {
    color: #bdb5e8;
}

.lp-search .btn-gradient {
    padding: .65rem 1.6rem;
    border-radius: 999px;
    white-space: nowrap;
}

/* --- Enlace al buscador + cifras, en una sola línea compacta --- */
.lp-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: .6rem 1.6rem;
    margin-top: 1.3rem;
    color: #c9c3ec;
    font-size: .93rem;
}

.lp-meta a {
    color: #e9e5ff;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(196, 181, 253, .5);
    text-underline-offset: 5px;
}

.lp-meta a:hover {
    color: #fff;
    text-decoration-color: #c4b5fd;
}

.lp-meta strong {
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-weight: 700;
}

.lp-meta-sep {
    width: 1px;
    height: 16px;
    background: rgba(255, 255, 255, .25);
}

/* --- La nube de palabras (lo memorable) --- */
.lp-nube {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.lp-nube canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.lp-nube-tip {
    position: absolute;
    z-index: 3;
    padding: .3rem .7rem;
    background: rgba(19, 16, 34, .92);
    border: 1px solid rgba(196, 181, 253, .45);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
    color: #fff;
    font-size: .82rem;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    transform: translate(-50%, 0);
}

.lp-nube-tip small {
    color: #b9b1e6;
    font-weight: 500;
}

.lp-nube-pie {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.3rem;
    z-index: 2;
    padding: 0 1rem;
    text-align: center;
    pointer-events: none;
}

.lp-nube-pie p {
    margin: 0 0 .55rem;
    color: #bdb5e8;
    font-size: .88rem;
}

.lp-leyenda {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .35rem 1.1rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #a79fcf;
    font-size: .78rem;
}

.lp-leyenda li {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
}

.lp-leyenda i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

/* La lista de palabras para teclado y lectores de pantalla: invisible hasta que recibe el foco */
.lp-nube-lista:focus-within {
    position: absolute;
    left: 50%;
    bottom: 5.5rem;
    z-index: 5;
    max-width: 92%;
    padding: 1rem 1.3rem;
    background: #17122e;
    border: 1px solid rgba(196, 181, 253, .35);
    border-radius: 14px;
    color: #d8d3f5;
    font-size: .88rem;
    transform: translateX(-50%);
}

.lp-nube-lista ul {
    display: flex;
    flex-wrap: wrap;
    gap: .3rem 1.2rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.lp-nube-lista a {
    color: #c4b5fd;
    font-weight: 600;
}

/* En pantallas estrechas el texto ocupa todo el ancho: la nube pasa a su propio espacio, debajo */
@media (max-width: 991.98px) {
    .hero-corcilen.lp-hero {
        padding-bottom: 2rem;
    }

    .lp-nube {
        position: relative;
        inset: auto;
        height: 340px;
        margin-top: 1.2rem;
    }

    .lp-nube-pie {
        position: static;
        margin-top: .4rem;
    }
}

@media (max-width: 575.98px) {
    .lp-meta { gap: .4rem 1.2rem; }
    .lp-meta-sep { display: none; } /* al saltar de línea dejaban un separador suelto */
    .lp-search { padding-left: 1rem; }
    .lp-search .btn-gradient { padding: .6rem 1.15rem; }
    .lp-nube { height: 300px; }
}

/* --- Temas: el tamaño de cada etiqueta refleja cuántos artículos tiene (como una nube de palabras) --- */
.lp-temas .tema-pill {
    font-size: calc(.84rem + var(--r, 0) * .2rem);
    padding: calc(.45rem + var(--r, 0) * .1rem) calc(.95rem + var(--r, 0) * .15rem);
}

/* --- Tres formas de leer el corpus --- */
.lp-tools {
    padding: 5rem 0 3rem;
    background: #fff;
}

.lp-tools h2 {
    max-width: 22ch;
    margin-bottom: .6rem;
    font-size: clamp(1.7rem, 3.2vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -.02em;
    line-height: 1.12;
    color: var(--corcilen-dark);
}

.lp-tools-intro {
    max-width: 52ch;
    margin-bottom: 0;
    color: #6b6489;
}

.lp-tools-grid {
    margin-top: 2.6rem;
    border-top: 1px solid #ece9f7;
}

.lp-tool {
    padding: 2rem 2rem 1.2rem 0;
}

.lp-tool h3 {
    margin-bottom: .45rem;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--corcilen-dark);
}

.lp-tool p {
    margin-bottom: .8rem;
    color: #5f5878;
    font-size: .95rem;
    line-height: 1.55;
}

.lp-tool a.lp-tool-link {
    color: var(--corcilen-primary);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, .35);
    text-underline-offset: 5px;
}

.lp-tool a.lp-tool-link:hover {
    color: var(--corcilen-primary-dark);
}

@media (min-width: 992px) {
    .lp-tool + .lp-tool {
        padding-left: 2rem;
        border-left: 1px solid #ece9f7;
    }
}

@media (max-width: 991.98px) {
    .lp-tool + .lp-tool {
        border-top: 1px solid #ece9f7;
        padding-right: 0;
    }
}

.lp-demo {
    max-width: 23rem;
    height: 168px;
    margin-bottom: 1.3rem;
    padding: 1rem 1.1rem;
    background: #faf9ff;
    border: 1px solid #ece9f7;
    border-radius: 14px;
    font-size: .88rem;
    overflow: hidden;
}

@media (max-width: 991.98px) {
    .lp-demo { height: auto; min-height: 138px; }
}

/* Si falta el ejemplo, se conserva su hueco (sin dibujarlo) para que los títulos sigan alineados */
.lp-demo-vacio {
    visibility: hidden;
}

/* demo 1: una búsqueda de ejemplo */
.lp-demo-q {
    display: flex;
    align-items: center;
    gap: .6rem;
    padding: .55rem .9rem;
    background: #fff;
    border: 1px solid #e3def5;
    border-radius: 999px;
    color: #2b2640;
    font-weight: 500;
}

.lp-demo-q i { color: var(--corcilen-primary); }

.lp-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .8rem;
}

.lp-chip {
    padding: .22rem .65rem;
    background: #ede9fe;
    border: 1px solid #ddd4f7;
    border-radius: 999px;
    color: #4c1d95;
    font-size: .78rem;
    font-weight: 600;
}

/* demo 2: concordancia (una palabra con su contexto a cada lado) */
.lp-mini-kwic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: baseline;
    padding: .38rem 0;
    font-size: .82rem;
    white-space: nowrap;
}

.lp-mini-kwic + .lp-mini-kwic {
    border-top: 1px dashed #e3def5;
}

.lp-mini-kwic .lp-l {
    display: flex;
    justify-content: flex-end;
    overflow: hidden;
    color: #8a82ab;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 22%);
    mask-image: linear-gradient(to right, transparent, #000 22%);
}

.lp-mini-kwic .lp-r {
    overflow: hidden;
    color: #8a82ab;
    -webkit-mask-image: linear-gradient(to left, transparent, #000 14%);
    mask-image: linear-gradient(to left, transparent, #000 14%);
}

.lp-mini-kwic .lp-k {
    padding: 0 .32em;
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    background: linear-gradient(135deg, var(--corcilen-primary), var(--corcilen-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sin-esp-izq .lp-k { padding-left: 0; }
.sin-esp-der .lp-k { padding-right: 0; }

/* demo 3: barras por tema (datos reales) */
.lp-bar {
    display: grid;
    grid-template-columns: minmax(0, 10.5rem) minmax(0, 1fr) 2.2rem;
    align-items: center;
    gap: .6rem;
    padding: .2rem 0;
    font-size: .8rem;
    color: #3f3a52;
}

.lp-bar-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lp-bar-track {
    display: block;
    height: 8px;
    background: #ece9f7;
    border-radius: 99px;
    overflow: hidden;
}

.lp-bar-fill {
    display: block;
    height: 100%;
    border-radius: 99px;
}

.lp-bar-n {
    text-align: right;
    font-weight: 700;
    color: #6b6489;
}

/* Los enlaces "Nosotros" y "Contacto" del menú saltan a su tarjeta: que la barra superior no la tape. */
#nosotros, #contacto {
    scroll-margin-top: 96px;
}

html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

/* Una palabra o consulta larguísima, sin espacios, no debe ensanchar la página. */
.auto-chip {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ==========================================================================
   GUÍA EXPLICATIVA (prefijo guia-)
   Página de lectura: texto cómodo, bloques bien separados y ejemplos que se distinguen a simple vista.
   ========================================================================== */
.guia {
    color: #3b3555;
    font-size: 1.05rem;
    line-height: 1.75;
}

.guia p {
    margin-bottom: 1rem;
}

.guia h2 {
    font-family: 'Sora', 'Inter', sans-serif;
    font-weight: 700;
    letter-spacing: -.01em;
    color: var(--corcilen-dark, #1e1b4b);
}

.guia-bloque,
.guia-aviso,
.guia-indice,
.guia-sesgo,
.guia-uso,
.guia-faq {
    margin-bottom: 1.75rem;
    padding: 1.7rem 1.9rem;
    background: #fff;
    border: 1px solid #ece9f7;
    border-radius: 20px;
    box-shadow: 0 8px 28px rgba(76, 29, 149, .06);
}

.guia-bloque {
    font-size: 1.12rem;
}

.guia-bloque p:last-child {
    margin-bottom: 0;
}

/* Aviso clave: un sesgo no es una mentira */
.guia-aviso {
    display: flex;
    gap: 1.1rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #f5f3ff, #eef4ff);
    border-color: #ddd6fe;
}

.guia-aviso h2 {
    margin-bottom: .4rem;
    font-size: 1.25rem;
}

.guia-aviso-icono {
    flex: none;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    background: #fff;
    color: var(--corcilen-primary, #7c3aed);
    font-size: 1.4rem;
    box-shadow: 0 4px 14px rgba(124, 58, 237, .18);
}

/* Índice */
.guia-indice h2 {
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.guia-indice ol {
    display: grid;
    gap: .35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.guia-indice a {
    display: flex;
    gap: .9rem;
    align-items: flex-start;
    padding: .65rem .8rem;
    border-radius: 12px;
    color: inherit;
    text-decoration: none;
    transition: background .15s ease;
}

.guia-indice a:hover,
.guia-indice a:focus-visible {
    background: #f5f3ff;
}

.guia-indice strong {
    display: block;
    color: var(--corcilen-dark, #1e1b4b);
    line-height: 1.3;
}

.guia-indice small {
    display: block;
    color: #6b6489;
    font-size: .92rem;
    line-height: 1.4;
}

.guia-num {
    flex: none;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--corcilen-primary, #7c3aed), var(--corcilen-accent, #3b82f6));
    color: #fff;
    font-family: 'Sora', sans-serif;
    font-size: .9rem;
    font-weight: 700;
}

/* Un sesgo */
.guia-sesgo {
    scroll-margin-top: 90px;
    border-left: 5px solid var(--corcilen-primary, #7c3aed);
}

.guia-sesgo header {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.1rem;
}

.guia-sesgo h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.25;
}

.guia-icono {
    flex: none;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    border-radius: 16px;
    background: #f5f3ff;
    color: var(--corcilen-primary, #7c3aed);
    font-size: 1.55rem;
}

.guia-etiqueta {
    display: block;
    margin-bottom: .1rem;
    color: #7c6fb0;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.guia-corto {
    color: var(--corcilen-dark, #1e1b4b);
    font-size: 1.18rem;
    font-weight: 600;
    line-height: 1.5;
}

/* El ejemplo real, bien diferenciado del texto explicativo */
.guia-ejemplo {
    margin: 1.3rem 0 1.1rem;
    padding: 1.2rem 1.3rem;
    background: #faf9ff;
    border: 1px dashed #c4b5fd;
    border-radius: 14px;
    font-size: 1rem;
}

.guia-ejemplo-etiqueta {
    display: inline-block;
    margin-bottom: .6rem;
    padding: .2rem .65rem;
    border-radius: 999px;
    background: #ede9fe;
    color: #5b21b6;
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.guia-ejemplo blockquote {
    margin: .4rem 0 0;
    padding: .7rem 1rem;
    background: #fff;
    border-left: 4px solid #a78bfa;
    border-radius: 0 10px 10px 0;
    color: var(--corcilen-dark, #1e1b4b);
    font-family: 'Sora', 'Inter', sans-serif;
    font-size: .98rem;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.guia-ejemplo ul {
    padding-left: 1.2rem;
}

.guia-ejemplo li {
    margin-bottom: .55rem;
}

.guia-pregunta {
    display: flex;
    gap: .7rem;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: .85rem 1rem;
    border-radius: 12px;
    background: #fffbeb;
    color: #78350f;
}

.guia-pregunta i {
    flex: none;
    margin-top: .2rem;
    color: #d97706;
    font-size: 1.15rem;
}

.guia-enlace {
    display: inline-flex;
    gap: .5rem;
    align-items: center;
    color: var(--corcilen-primary, #7c3aed);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(124, 58, 237, .35);
    text-underline-offset: 5px;
}

.guia-enlace:hover {
    color: var(--corcilen-primary-dark, #5b21b6);
}

/* Cómo usarlo y preguntas frecuentes */
.guia-uso h2,
.guia-faq h2 {
    margin-bottom: 1.1rem;
    font-size: 1.3rem;
}

.guia-uso-item {
    height: 100%;
    padding: 1.1rem;
    border-radius: 14px;
    background: #faf9ff;
    border: 1px solid #ece9f7;
    font-size: .98rem;
    line-height: 1.55;
}

.guia-uso-item i {
    display: block;
    margin-bottom: .5rem;
    color: var(--corcilen-primary, #7c3aed);
    font-size: 1.5rem;
}

.guia-uso-item h3 {
    margin-bottom: .35rem;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--corcilen-dark, #1e1b4b);
}

.guia-faq details {
    padding: .9rem 0;
    border-top: 1px solid #ece9f7;
}

.guia-faq details:first-of-type {
    border-top: 0;
}

.guia-faq summary {
    cursor: pointer;
    color: var(--corcilen-dark, #1e1b4b);
    font-weight: 600;
}

.guia-faq summary:focus-visible {
    outline: 3px solid #c4b5fd;
    outline-offset: 4px;
    border-radius: 6px;
}

.guia-faq details p {
    margin: .7rem 0 0;
}

.guia-fuentes {
    margin-top: 1.5rem;
    color: #8a82ab;
    font-size: .85rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 575.98px) {
    .guia { font-size: 1rem; }
    .guia-bloque,
    .guia-aviso,
    .guia-indice,
    .guia-sesgo,
    .guia-uso,
    .guia-faq {
        padding: 1.25rem 1.1rem;
        border-radius: 16px;
    }
    .guia-sesgo h2 { font-size: 1.25rem; }
    .guia-aviso { flex-direction: column; }
}
