        /* =============================================================
           1. RESET Y VARIABLES BASE
           ============================================================= */
        *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

        :root {
            --bg-body:      #f4f6f8;
            --bg-hero:      linear-gradient(135deg, #343a40 0%, #1e293b 100%);
            --border-light: #eaecef;
            --text-main:    #334155;
            --accent:       #0072bb;
            --oro:          #fdb913;
            --rojo-alerta:  #ef4444;
            --verde-inti:   #2e7d32;
            --radius:       12px;
        }

        html { overflow-y: scroll; scrollbar-gutter: stable; view-transition-name: none; }
        html.detail-open { overflow: hidden; }
        body { font-family: 'Inter', Arial, sans-serif; background-color: var(--bg-body); color: var(--text-main); line-height: 1.6; }
        body.detail-open { position: fixed; left: 0; right: 0; width: 100%; overflow: hidden; }

        .cabecera-cat    { background-color: #343a40; border-left: 8px solid #64748b; }
        .cabecera-norma  { background-color: #0f766e; border-left: 8px solid #14b8a6; }
        .cabecera-kardex { background-color: #78350f; border-left: 8px solid #d97706; }

        /* --- HERO CONTAINER ------------------------------------------------- */
        .hero-container {
            background: linear-gradient(160deg, #1a2332 0%, #1e293b 55%, #243040 100%);
            padding: 28px 28px 22px;
            position: relative;
            overflow: visible;
            z-index: 20;
        }
        /* Línea dorada inferior */
        .hero-container::after {
            content: '';
            position: absolute;
            bottom: 0; left: 0; right: 0;
            height: 2px;
            background: linear-gradient(90deg, transparent 0%, rgba(253,185,19,0.55) 30%, rgba(0,114,187,0.45) 70%, transparent 100%);
        }
        /* Patrón de puntos decorativo, muy sutil */
        .hero-container::before {
            content: '';
            position: absolute;
            inset: 0;
            background-image: radial-gradient(circle, rgba(255,255,255,0.025) 1px, transparent 1px);
            background-size: 28px 28px;
            pointer-events: none;
        }
        .hero-inner { max-width: 1120px; margin: 0 auto; position: relative; }

        /* --- IDENTIDAD ------------------------------------------------------ */
        .hero-header {
            display: flex;
            align-items: center;
            gap: 0;
            margin-bottom: 22px;
        }
        /* Franja dorada vertical izquierda */
        .hero-brand {
            display: flex;
            align-items: center;
            gap: 14px;
        }
        .hero-brand-bar {
            width: 3px;
            height: 42px;
            background: linear-gradient(180deg, var(--oro) 0%, rgba(253,185,19,0.35) 100%);
            border-radius: 2px;
            flex-shrink: 0;
        }
        .hero-brand-text { display: flex; flex-direction: column; gap: 2px; }
        .hero-title {
            font-family: 'Poppins', sans-serif;
            font-size: 1.65rem;
            color: #f8fafc;
            font-weight: 700;
            line-height: 1.1;
            letter-spacing: -0.01em;
        }
        .hero-subtitle {
            font-size: 0.72rem;
            color: rgba(255,255,255,0.38);
            font-weight: 500;
            letter-spacing: 0.12em;
            text-transform: uppercase;
        }
        /* Chip "RDF · SPARQL" a la derecha del título */
        .hero-tech-badge {
            margin-left: auto;
            display: flex;
            align-items: center;
            gap: 6px;
            background: rgba(255,255,255,0.05);
            border: 1px solid rgba(255,255,255,0.1);
            border-radius: 20px;
            padding: 5px 12px;
            font-size: 0.7rem;
            font-weight: 600;
            color: rgba(255,255,255,0.38);
            letter-spacing: 0.06em;
            white-space: nowrap;
        }
        .hero-tech-badge i { color: rgba(253,185,19,0.5); font-size: 0.65rem; }

        /* --- BARRA DE BÚSQUEDA --------------------------------------------- */
        .search-wrapper {
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin-bottom: 14px;
        }
        .search-row {
            display: flex;
            gap: 8px;
            align-items: stretch;
            position: relative;
            z-index: 100;
        }
        .search-box {
            display: flex;
            position: relative;
            background: #fff;
            border-radius: 9px;
            padding: 4px 4px 4px 14px;
            box-shadow: 0 2px 12px rgba(0,0,0,0.22), inset 0 1px 0 rgba(255,255,255,0.8);
            align-items: center;
            gap: 8px;
            flex: 1;
            border: 1px solid rgba(255,255,255,0.15);
            transition: box-shadow 0.2s;
        }
        .search-box:focus-within {
            box-shadow: 0 2px 16px rgba(0,0,0,0.28), 0 0 0 2px rgba(253,185,19,0.45);
            z-index: 600;
        }
        .search-input {
            flex: 1;
            border: none;
            padding: 10px 0;
            font-size: 0.95rem;
            outline: none;
            text-overflow: ellipsis;
            background: transparent;
            font-family: 'Inter', sans-serif;
            color: #1e293b;
            min-width: 0;
        }
        .search-input::placeholder { color: #a0aec0; }
        .search-history-dropdown {
            position: absolute;
            top: calc(100% + 6px);
            left: 0;
            right: 0;
            display: none;
            background: #fff;
            border: 1px solid #dbe3ea;
            border-radius: 8px;
            box-shadow: 0 12px 28px rgba(15,23,42,0.22);
            overflow: hidden;
            z-index: 650;
            opacity: 1;
            isolation: isolate;
        }
        .search-history-dropdown.open { display: block; }
        .search-history-title {
            padding: 7px 12px 5px;
            font-size: 0.68rem;
            font-weight: 700;
            color: #64748b;
            text-transform: uppercase;
            letter-spacing: 0.08em;
            background: #f8fafc;
            border-bottom: 1px solid #edf2f7;
        }
        .search-history-item {
            width: 100%;
            border: none;
            background: #fff;
            color: #334155;
            text-align: left;
            padding: 9px 12px;
            display: flex;
            align-items: center;
            gap: 8px;
            font-family: 'Inter', sans-serif;
            font-size: 0.84rem;
            cursor: pointer;
        }
        .search-history-item:hover { background: #f1f5f9; }
        .search-history-item i { color: #94a3b8; font-size: 0.78rem; }
        .search-divider { width: 1px; height: 22px; background: #e2e8f0; flex-shrink: 0; }
        .search-btn {
            background: var(--accent);
            color: #fff;
            border: none;
            border-radius: 6px;
            padding: 0;
            width: 40px;
            height: 40px;
            font-weight: 600;
            font-size: 0.88rem;
            cursor: pointer;
            transition: background 0.2s, transform 0.1s;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .catalog-help-btn {
            margin-left: auto;
            width: 36px;
            height: 36px;
            background: rgba(253,185,19,0.12);
            border: 1px solid rgba(253,185,19,0.25);
            border-radius: 50%;
            color: var(--oro);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1rem;
            transition: all 0.2s ease;
            flex-shrink: 0;
        }
        .catalog-help-btn:hover {
            background: rgba(253,185,19,0.22);
            border-color: rgba(253,185,19,0.5);
            color: #fbbf24;
            box-shadow: 0 0 16px rgba(253,185,19,0.2);
        }
        .catalog-help-btn i {
            transition: transform 0.3s ease;
        }
        .catalog-help-btn:hover i {
            transform: rotate(-15deg);
        }
        .search-btn:hover  { background: #005a9c; }
        .search-btn:active { transform: scale(0.97); }
        .search-clear-btn { width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; border: 1px solid #e2e8f0; border-radius: 6px; background: #f8fafc; color: #64748b; cursor: pointer; transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.1s; }
        .search-clear-btn:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
        .search-clear-btn:active { transform: scale(0.97); }

        /* Botón secundario de búsqueda avanzada */
        .adv-toggle-btn {
            background: rgba(255,255,255,0.07);
            color: rgba(255,255,255,0.75);
            border: 1px solid rgba(255,255,255,0.14);
            border-radius: 9px;
            padding: 0 14px;
            font-size: 0.8rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            white-space: nowrap;
            flex-shrink: 0;
            height: 48px;
        }
        .adv-toggle-btn:hover { background: rgba(255,255,255,0.13); color: #fff; border-color: rgba(255,255,255,0.28); }
        .adv-toggle-btn.active { background: rgba(253,185,19,0.12); color: var(--oro); border-color: rgba(253,185,19,0.35); }
        /* --- PANEL AVANZADO ------------------------------------------------- */
        .adv-panel {
            display: grid;
            max-height: 0;
            opacity: 0;
            overflow: hidden;
            pointer-events: none;
            background: rgba(10,18,32,0.42);
            border: 1px solid rgba(255,255,255,0);
            padding: 0 14px;
            border-radius: 10px;
            grid-template-columns: repeat(12, 1fr);
            gap: 10px;
            transform: translateY(-6px);
            transition: max-height 0.34s ease, opacity 0.24s ease, padding 0.24s ease, border-color 0.24s ease, transform 0.24s ease;
        }
        .adv-panel.open {
            max-height: 320px;
            opacity: 1;
            pointer-events: auto;
            padding: 14px;
            border-color: rgba(255,255,255,0.12);
            transform: translateY(0);
        }
        .adv-panel-label {
            grid-column: 1 / -1;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 0.67rem;
            font-weight: 700;
            color: rgba(255,255,255,0.45);
            text-transform: uppercase;
            letter-spacing: 0.1em;
            margin-bottom: 2px;
            padding-bottom: 8px;
            border-bottom: 1px solid rgba(255,255,255,0.08);
        }
        .adv-panel-label span { color: rgba(255,255,255,0.28); font-size: 0.7rem; font-weight: 400; text-transform: none; letter-spacing: 0; margin-left: auto; }
        .adv-field { grid-column: span 3; min-width: 0; }
        .adv-field-wide { grid-column: span 4; }
        .adv-field-wide2 { grid-column: span 8; }
        .adv-field label {
            display: flex;
            align-items: center;
            gap: 5px;
            color: rgba(255,255,255,0.55);
            font-size: 0.68rem;
            font-weight: 600;
            margin: 0 0 5px 1px;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }
        .adv-field label i { color: rgba(253,185,19,0.7); font-size: 0.65rem; width: 12px; text-align: center; }
        .adv-panel > .adv-input { grid-column: span 3; align-self: end; }
        .adv-input {
            width: 100%;
            min-width: 0;
            padding: 8px 10px;
            border: 1px solid rgba(255,255,255,0.12);
            border-radius: 7px;
            font-family: 'Inter', sans-serif;
            font-size: 0.84rem;
            outline: none;
            background: rgba(255,255,255,0.93);
            color: #1e293b;
            transition: border-color 0.2s, box-shadow 0.2s;
        }
        .adv-input:focus { border-color: rgba(253,185,19,0.75); box-shadow: 0 0 0 3px rgba(253,185,19,0.14); background: #fff; }
        .adv-input::placeholder { color: #a0aec0; }
        /* Contenedor de años — en desktop es neutro (flex inline), en móvil se convierte en 2 col */
        .filters-year-row { display: contents; }

        /* adv-panel breakpoints incluidos en el bloque responsive general abajo */

        /* --- NUEVA BARRA DE FILTROS MODERNA ----------------------------------- */

        /*
         * PALETA DEL HERO — tres opciones naturales, elegir una descomentan la que querés:
         *
         * A) BOSQUE PROFUNDO (verde musgo + tierra)       ← actual si activás esta
         * B) PIZARRA CÁLIDA (gris cálido + acento arena)
         * C) AZUL PIZARRA SUAVIZADO (el actual, sólo más cálido)
         *
         * Para cambiar: descomentá el bloque deseado y comentá los demás.
         */

        /* ── OPCIÓN A: BOSQUE PROFUNDO ──────────────────────────────────────── */
        .hero-container {
            background: linear-gradient(160deg, #1c2b1e 0%, #243328 55%, #2a3d2e 100%) !important;
        }
        .hero-container::after {
            background: linear-gradient(90deg,
                transparent 0%,
                rgba(134,188,66,0.45) 30%,
                rgba(253,185,19,0.35) 70%,
                transparent 100%) !important;
        }

        /* ── OPCIÓN B: PIZARRA CÁLIDA (descomentá para usar) ────────────────
        .hero-container {
            background: linear-gradient(160deg, #2c2825 0%, #38322e 55%, #3d3630 100%) !important;
        }
        .hero-container::after {
            background: linear-gradient(90deg,
                transparent 0%,
                rgba(210,165,90,0.5) 30%,
                rgba(180,140,80,0.35) 70%,
                transparent 100%) !important;
        }
        ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

        /* ── OPCIÓN C: AZUL PIZARRA SUAVIZADO (descomentá para usar) ────────
        .hero-container {
            background: linear-gradient(160deg, #1e2d3d 0%, #263545 55%, #2c3e50 100%) !important;
        }
        .hero-container::after {
            background: linear-gradient(90deg,
                transparent 0%,
                rgba(253,185,19,0.5) 30%,
                rgba(100,160,220,0.35) 70%,
                transparent 100%) !important;
        }
        ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── ── */

        .modern-filters {
            display: flex;
            flex-wrap: nowrap;
            align-items: center;
            gap: 16px;
            background: rgba(0,0,0,0.22);
            border: 1px solid rgba(255,255,255,0.09);
            border-radius: 10px;
            padding: 0.45rem 0.55rem;
            margin-top: 10px;
            position: relative;
            z-index: 80;
            width: 100%;
            max-width: 100%;
            box-sizing: border-box;
            justify-content: center;
            margin-left: auto;
            margin-right: auto;
            transition:
                width 0.34s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        }
        .modern-filters.filters-compact { width: 790px; }

        /* Cada hijo: no crece, no encoge, ancho fijo */
        .modern-filters > * { flex: 0 0 auto; }

        /* Separador vertical entre items */
        .modern-filters > * + * {
            position: relative;
        }
        .modern-filters > * + *::before {
            content: '';
            position: absolute;
            left: calc(-8px - 0.5px); top: 18%; bottom: 18%;
            width: 1px;
            background: rgba(255,255,255,0.12);
            transition: opacity 0.22s ease;
        }

        /* ── SEGMENTED CONTROL (tipo de base) ──────────────────────────────── */
        .filter-segmented {
            display: flex;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid rgba(255,255,255,0.2);
            flex-shrink: 0;
        }
        .seg-option {
            background: transparent;
            color: rgba(255,255,255,0.7);
            border: none;
            padding: 7px 9px;
            font-size: 0.75rem;
            font-weight: 600;
            cursor: pointer;
            transition: background 0.2s, color 0.2s;
            white-space: nowrap;
        }
        .seg-option.active {
            background: var(--oro);
            color: #1e293b;
            font-weight: 600;
        }
        .seg-option:not(.active):hover { background: rgba(255,255,255,0.1); }

        /* ── DROPDOWN GENÉRICO ─────────────────────────────────────────────── */
        .filter-dropdown {
            position: relative;
            z-index: 82;
        }
        /*
         * ANCHOS FIJOS POR CONTROL
         * La clave del layout estático: cada botón tiene un min-width basado en
         * el texto más largo posible. El label se trunca con ellipsis si supera ese ancho.
         */
        .dropdown-trigger {
            background: rgba(255,255,255,0.1);
            color: #fff;
            border: 1px solid rgba(255,255,255,0.2);
            border-radius: 8px;
            padding: 7px 8px;
            font-size: 0.75rem;
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            transition: background 0.2s;
            white-space: nowrap;
            overflow: hidden;
            /* El ancho se fija por clase específica abajo */
        }
        .dropdown-trigger:hover { background: rgba(255,255,255,0.2); }

        /* Ancho fijo: basado en "Documento de conferencia" (el texto más largo esperado) */
        #dropdown-tipo-doc    .dropdown-trigger { width: 168px; }
        /* Ancho fijo: "PDF libre" es el más largo */
        #dropdown-disponibilidad .dropdown-trigger { width: 114px; }
        /* Ancho fijo: "Más recientes primero" → mostramos versión corta máx "Recientes" */
        #dropdown-orden       .dropdown-trigger { width: 88px; }
        /* Ancho fijo: número de 2 dígitos */
        #dropdown-page-size   .dropdown-trigger { width: 58px; justify-content: center; padding: 7px 6px; }

        /* El texto del trigger trunca con ellipsis si supera el ancho */
        .dropdown-trigger > :last-child {
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            min-width: 0;
        }
        .dropdown-menu {
            position: absolute;
            top: calc(100% + 5px);
            left: 0;
            background: #fff;
            color: #1e293b;
            border-radius: 8px;
            box-shadow: 0 8px 20px rgba(0,0,0,0.25);
            padding: 6px;
            display: none;
            z-index: 500;
            min-width: 180px;
            max-height: min(360px, 56vh);
            overflow-y: auto;
        }
        .dropdown-menu.open {
            display: block;
        }
        .dropdown-menu div {
            padding: 8px 12px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 0.85rem;
        }
        .dropdown-menu div:hover {
            background: #f1f5f9;
        }

        .filter-year-range {
            display: flex;
            align-items: center;
            gap: 4px;
            flex-shrink: 0;
        }
        .filter-year-range input {
            width: 62px;
            padding: 6px 4px;
            border-radius: 6px;
            border: 1px solid rgba(255,255,255,0.2);
            background: rgba(255,255,255,0.93);
            text-align: center;
            font-size: 0.75rem;
            font-family: 'Inter', sans-serif;
            flex-shrink: 0;
        }
        .year-sep { color: rgba(255,255,255,0.6); flex-shrink: 0; }

        .filter-switch {
            display: flex;
            align-items: center;
            gap: 5px;
            cursor: pointer;
            color: rgba(255,255,255,0.8);
            font-size: 0.75rem;
            white-space: nowrap;
            flex-shrink: 0;
        }
        .filter-switch input {
            position: absolute;
            width: 0; height: 0;
            opacity: 0;
            pointer-events: none;
        }
        .modern-filters > #inti-switch { margin-right: 0; }
        .switch-slider {
            width: 32px; height: 18px;
            background: rgba(255,255,255,0.2);
            border-radius: 10px;
            position: relative;
            transition: background 0.3s;
            flex-shrink: 0;
        }
        .switch-slider::before {
            content: '';
            position: absolute;
            width: 14px; height: 14px;
            background: white;
            border-radius: 50%;
            top: 2px; left: 2px;
            transition: transform 0.3s;
        }
        .filter-switch input:checked + .switch-slider { background: var(--oro); }
        .filter-switch input:checked + .switch-slider::before { transform: translateX(14px); }

        /*
         * SISTEMA DE VISIBILIDAD CON TRANSICIÓN SUAVE
         * En lugar de display:none (que es brusco), usamos:
         *   - max-width: 0  → colapsa el ancho sin romper el flujo
         *   - opacity: 0    → se desvanece
         *   - overflow: hidden + pointer-events: none → no ocupa espacio ni es clickeable
         *
         * .filter-collapsible es la clase base aplicada a los elementos colapsables.
         * .filter-hidden  es la clase que JS aplica para colapsar.
         */
        /*
         * SISTEMA DE VISIBILIDAD CON TRANSICIÓN SUAVE
         * NO usamos overflow:hidden en el wrapper porque cortaría el dropdown-menu
         * (que es position:absolute). En su lugar colapsamos con width explícito,
         * opacity y pointer-events. El wrapper tiene width fijo que se anima a 0.
         */
        .filter-collapsible {
            /* ancho máximo generoso — la animación va de este valor a 0 */
            width: auto;
            max-width: 300px;
            opacity: 1;
            pointer-events: auto;
            /* overflow:visible para que el dropdown-menu absoluto no quede clippeado */
            overflow: visible;
            transition:
                max-width  0.32s cubic-bezier(0.4, 0, 0.2, 1),
                opacity    0.22s ease,
                margin-left 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                margin-right 0.32s cubic-bezier(0.4, 0, 0.2, 1),
                padding-left 0.32s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .filter-collapsible.filter-hidden {
            max-width: 0 !important;
            opacity: 0 !important;
            pointer-events: none !important;
            margin-left: 0 !important;
            margin-right: -16px !important;
            padding-left: 0 !important;
        }
        /* Suprimir separador cuando oculto */
        .filter-collapsible.filter-hidden::before {
            opacity: 0 !important;
        }

        /* La altura acompaña la aparición y remoción de chips sin saltos bruscos. */
        .active-filters-bar {
            height: 0;
            min-height: 0;
            padding: 0;
            opacity: 0;
            overflow: hidden;
            box-sizing: border-box;
            transition:
                height 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.18s ease;
        }
        .active-filters-bar.has-filters {
            padding: 8px 0 2px;
            opacity: 1;
        }
        .active-filters-inner {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
            view-transition-name: filters-container;
        }

        /* Transiciones sutiles y rápidas para la API de View Transitions */
        ::view-transition-group(filters-container) {
            animation-duration: 0.12s;
            animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        }
        ::view-transition-old(filters-container),
        ::view-transition-new(filters-container) {
            animation-duration: 0.12s;
            animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
        }

        .filter-badge {
            background: var(--oro);
            color: #1e293b;
            font-size: 0.75rem;
            padding: 4px 10px;
            border-radius: 20px;
            display: flex;
            align-items: center;
            gap: 6px;
            font-weight: 600;
            animation: filterBadgeIn 0.18s ease both;
        }
        @keyframes filterBadgeIn {
            from { opacity: 0; transform: translateY(-4px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .filter-badge button {
            background: none;
            border: none;
            color: inherit;
            cursor: pointer;
            font-size: 0.9rem;
            padding: 0;
            line-height: 1;
        }

        /* Ocultamos los selects originales pero los mantenemos para la lógica */
        .hidden-select {
            position: absolute;
            opacity: 0;
            pointer-events: none;
            height: 0;
            width: 0;
        }

        /* --- BARRA DE FILTROS ORIGINAL (se oculta) ------------------------- */
        .filters-bar-original {
            display: none;
        }

        .stats-bar { max-width: 960px; margin: 0 auto; padding: 12px 24px; color: #64748b; font-size: 0.9rem; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; }
        #stat-info { min-width: 0; overflow-wrap: break-word; }
        #stat-time { white-space: nowrap; text-align: right; margin-left: 8px; padding-left: 12px; border-left: 1px solid #dbe3ea; }
        .main-content { max-width: 960px; margin: 10px auto 80px; padding: 0 24px; }
        .card-list { display: flex; flex-direction: column; gap: 16px; }

        .result-item { background: #fff; border: 1px solid #eaecef; border-radius: var(--radius); box-shadow: 0 4px 12px rgba(0,0,0,0.05); transition: all 0.3s ease; overflow: hidden; cursor: pointer; animation: resultIn 0.32s ease both; }
        .result-item:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(0,0,0,0.08); border-color: #cbd5e1; }
        @keyframes resultIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

        .zona-cabecera { padding: 12px 20px; display: flex; flex-wrap: wrap; align-items: flex-start; }
        .badges-container { display: flex; gap: 6px; margin-bottom: 8px; width: 100%; flex-wrap: wrap; }
        .info-tag { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.66); border: 1px solid rgba(255,255,255,0.15); padding: 3px 8px; border-radius: 6px; font-size: 0.72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; cursor: default; }
        .info-tag.inti-work { background: rgba(232,196,104,0.08); color: rgba(253,220,130,0.78); border-color: rgba(232,196,104,0.25); }
        .info-tag.general-collection { background: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); border-color: rgba(255,255,255,0.15); }
        .info-tag.snrd-tag { background: rgba(59,130,246,0.2); color: #93c5fd; border-color: rgba(59,130,246,0.4); }
        .info-tag.web-tag { background: rgba(14,165,233,0.18); color: #bae6fd; border-color: rgba(125,211,252,0.42); }

        .titulo-wrapper { flex: 1; min-width: 0; padding-right: 15px; }
        .titulo-destacado { color: #fff; font-family: 'Poppins', sans-serif; font-size: 1.16rem; font-weight: 600; line-height: 1.25; margin: 0; }
        .barra-dorada { width: 40px; height: 3px; background-color: var(--oro); border-radius: 2px; margin-top: 8px; }
        .titulo-destacado mark, .dato-flex mark, .titulo-destacado .hl-mark, .dato-flex .hl-mark {
            background: #fef08a;
            color: #111;
            padding: 0;
            margin: 0;
            border-radius: 3px;
        }

        .botones-container { margin-left: auto; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
        .action-btn { background: #f8fafc; color: #1e293b; padding: 0 12px; border-radius: 6px; font-size: 0.78rem; font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; cursor: pointer; border: 1px solid transparent; transition: 0.2s; height: 30px; box-sizing: border-box; }
        .action-btn:hover { background: #e2e8f0; }
        .action-btn-link { background: #3d6b5e; color: white; }
        .action-btn-link:hover { background: #2f594f; }
        .action-btn-lock { background: #475569; color: white; }
        .action-btn-lock:hover { background: #334155; }
        .action-btn-pdf { background: #dc2626; color: white; }
        .action-btn-pdf:hover { background: #b91c1c; }
        .action-btn-index { background: #c2410c; color: white; }
        .action-btn-index:hover { background: #9a3412; }
        .action-btn-cart { background: #fff; color: #334155; border: 1px solid rgba(203,213,225,0.75); }
        .action-btn-cart:hover { background: #f1f5f9; }
        .action-btn-cart.saved { background: #dcfce7; color: #166534; border-color: #86efac; }
        .action-btn-cart.cart-pop { animation: cartPop 0.45s ease; }
        @keyframes cartPop { 0% { transform: scale(1); } 45% { transform: scale(1.08); } 100% { transform: scale(1); } }
        .norma-code-badge { background: #fef3c7; color: #78350f; border-color: #f59e0b; font-family: 'DM Mono', monospace; font-weight: 700; }
        .norma-title-code { display: inline-flex; align-items: center; padding: 1px 8px; margin-right: 8px; border: 1px solid #f59e0b; border-radius: 6px; background: #fef3c7; color: #78350f; font-family: 'DM Mono', monospace; font-size: 0.95em; font-weight: 700; line-height: 1.15; vertical-align: baseline; }
        .norma-title-sep { color: rgba(255,255,255,0.55); margin-right: 8px; font-weight: 500; }
        .editor-plain { display: inline; color: #475569; font-size: 0.9rem; }
        .editor-plain i { margin-right: 4px; }
        .editor-plain:not(:last-child)::after { content: "\00a0|\00a0"; color: #cbd5e1; font-weight: 400; }

        .zona-cuerpo { padding: 12px 20px; }
        .fila-flex { display: flex; align-items: baseline; padding: 5px 0; border-bottom: 1px solid #f1f5f9; }
        .fila-flex:last-child { border-bottom: none; }
        .etiqueta-flex { flex: 0 0 160px; display: flex; align-items: center; padding-right: 15px; }
        .icono-flex { flex: 0 0 20px; text-align: center; margin-right: 8px; color: #64748b; }
        .texto-etiqueta { font-family: 'Poppins', sans-serif; font-weight: 600; color: #475569; font-size: 0.8rem; }
        .dato-flex { flex: 1; font-size: 0.86rem; color: #334155; line-height: 1.38; text-align: justify; }

        .chip-registro { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; font-size: 0.77rem; font-weight: 500; margin: 1px 3px 1px 0; transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease, box-shadow 0.22s ease; cursor: pointer; }
        .chip-autor { background: #e6f4ea; color: #137333; border: 1px solid #ceead6; font-weight: 600; }
        .chip-autor:hover { background: var(--verde-inti); color: white; transform: translateY(-1px); box-shadow: 0 3px 7px rgba(46,125,50,0.16); }
        .chip-inst { background: #eff6ff; color: #075985; border: 1px solid #dbeafe; font-weight:600; }
        .chip-inst:hover { background: #e0f2fe; color: #075985; transform: translateY(-1px); box-shadow: 0 3px 7px rgba(3,105,161,0.12); }
        .chip-desc { background: #f5f0eb; color: #5a5047; border: 1px solid #ddd5cb; }
        .chip-desc:hover { background: #ddd5cb; color: #3d342a; transform: translateY(-1px); }

        .summary-checkbox { position: absolute; opacity: 0; pointer-events: none; }
        .summary-toggle { display: inline-block; background: #495057; border: 1px solid #495057; color: #fff; border-radius: 6px; padding: 3px 9px; font-size: 0.78rem; cursor: pointer; transition: background-color 0.24s ease, border-color 0.24s ease, transform 0.24s ease; font-weight: 500; }
        .summary-toggle i { transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1); }
        .summary-toggle:hover { background: #343a40; border-color: #343a40; transform: translateY(-1px); }
        .summary-checkbox:checked + .summary-toggle { background: #6c757d; border-color: #6c757d; }
        .summary-checkbox:checked + .summary-toggle i { transform: rotate(180deg); }
        .summary-content { max-height: 0; overflow: hidden; transition: max-height 0.34s ease, opacity 0.24s ease, padding 0.24s ease; opacity: 0; background: #f8fafc; border-left: 3px solid var(--accent); border-radius: 0 4px 4px 0; font-size: 0.85rem; line-height: 1.5; font-weight: 400; color: #444; padding: 0 13px; margin-top: 6px; }
        .summary-content, .summary-content * { font-size: 0.85rem; line-height: 1.5; }
        .summary-checkbox:checked + .summary-toggle + .summary-content { max-height: 1000px; opacity: 1; padding: 9px 13px; }

        .alerta-roja { background: #fef2f2; border-left: 4px solid var(--rojo-alerta); padding: 8px 12px; border-radius: 4px; color: #991b1b; display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }

        .zona-pie { background-color: #f8fafc; border-top: 1px solid #f1f5f9; padding: 7px 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
        .ubicacion-caja { background: #fdf8ee; border: 1px solid #fde68a; border-left: 3px solid #d97706; padding: 2px 8px; border-radius: 4px; color: #92400e; font-weight: 600; font-size: 0.8rem; font-family: 'DM Mono', monospace; }
        .dispo-caja { background: #fff; border: 1px solid #cbd5e1; padding: 2px 8px; border-radius: 4px; color: #475569; font-weight: 500; font-size: 0.8rem; }
        .separador { color: #cbd5e1; font-size: 1.2rem; margin: 0 4px; user-select: none; }
        .separador-vertical { color: #cbd5e1; user-select: none; font-weight: 400; }

        .pag-wrapper { display: flex; flex-direction: column; align-items: center; gap: 12px; margin: 40px 0 20px; padding-top: 20px; border-top: 1px solid var(--border-light); }
        .pag-controls { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: center; }
        .page-btn { padding: 6px 12px; border: 1px solid #cbd5e1; background: white; color: var(--accent); font-weight: 600; border-radius: 6px; cursor: pointer; transition: 0.2s; font-family: 'Inter', sans-serif; font-size: 0.85rem; }
        .page-btn:hover:not(:disabled) { background: #f1f5f9; }
        .page-btn.active { background: var(--accent); color: white; border-color: var(--accent); cursor: default; }
        .page-btn:disabled { color: #94a3b8; border-color: #e2e8f0; background: #f8fafc; cursor: default; }
        .page-dots { color: #64748b; padding: 0 4px; font-weight: bold; }
        .pag-info { color: #64748b; font-size: 0.88rem; text-align: center; }

        .pag-goto { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
        .pag-goto label { color: #555; font-size: 0.9rem; font-weight: 500; }
        .pag-goto input { width: 70px; padding: 6px 10px; border: 2px solid #dee2e6; border-radius: 6px; text-align: center; font-family: 'Inter', sans-serif; font-size: 0.9rem; outline: none; }
        .pag-goto input:focus { border-color: var(--accent); }
        .pag-goto-btn { background: #343a40; color: white; border: none; border-radius: 6px; padding: 6px 14px; font-size: 0.9rem; cursor: pointer; transition: 0.2s; }
        .pag-goto-btn:hover { background: #52796f; }

        .detail-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); opacity: 0; visibility: hidden; transition: opacity 0.16s ease, visibility 0.16s ease; z-index: 100; }
        .detail-overlay.active { opacity: 1; visibility: visible; }
        .detail-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(680px, 100vw); background: #fff; box-shadow: -10px 0 40px rgba(0,0,0,0.15); z-index: 101; transform: translateX(100%); transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1); display: flex; flex-direction: column; }
        .detail-panel.active { transform: translateX(0); }
        .panel-header { padding: 18px 22px; background: linear-gradient(135deg, #26323f 0%, #343a40 60%, #2f4a43 100%); color: white; display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; box-shadow: 0 1px 0 rgba(255,255,255,0.08) inset; }
        .panel-title { font-family: 'Poppins', sans-serif; font-size: 1.15rem; font-weight: 600; line-height: 1.25; margin-bottom: 12px; }
        .panel-submeta { display: none; }
        .panel-pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid rgba(255,255,255,0.18); background: rgba(255,255,255,0.10); color: rgba(255,255,255,0.88); padding: 3px 8px; border-radius: 999px; font-size: 0.72rem; font-weight: 700; }
        .panel-actions { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 4px; }
        .panel-actions .detail-cart-btn { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.3); }
        .panel-actions .detail-cart-btn.saved { background: #dcfce7; color: #166534; border-color: #86efac; }
        .close-btn { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 6px 10px; border-radius: 6px; cursor: pointer; transition: 0.2s; }
        .close-btn:hover { background: rgba(255,255,255,0.2); }
        .panel-body { padding: 18px 22px 26px; overflow-y: auto; flex: 1; background: #f8fafc; }
        .empty-state { text-align: center; padding: 60px 20px; color: #64748b; }
        .detail-section { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px 16px; margin-bottom: 12px; box-shadow: 0 1px 3px rgba(15,23,42,0.04); }
        .sec-title { font-family: 'Inter', sans-serif; font-size: 0.67rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.09em; font-weight: 700; border-bottom: 1px solid #f1f5f9; padding-bottom: 8px; margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }
        .grid-caja { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-bottom: 16px; }
        .grid-caja.grid-wide { grid-template-columns: 1fr; }
        .caja-item.full { grid-column: 1 / -1; }
        .license-value { display: flex; align-items: flex-start; gap: 6px; line-height: 1.45; overflow-wrap: anywhere; word-break: normal; }
        .license-value i { flex: 0 0 auto; margin-top: 2px; }
        .license-text { flex: 1 1 auto; min-width: 0; }
        .detail-section .grid-caja:last-child { margin-bottom: 0; }
        .caja-item label { display: block; font-size: 0.7rem; color: #64748b; font-weight: 600; margin-bottom: 2px; }
        .caja-item span { font-size: 0.9rem; color: #1e293b; font-weight: 500; }
        .access-panel { background: #fff7ed; border-color: #fed7aa; }
        .access-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
        .access-note { color: #92400e; font-size: 0.82rem; line-height: 1.45; margin: 0; }
        .link-list { display: grid; gap: 6px; margin-top: 8px; }
        .link-list a { color: var(--accent); text-decoration: none; font-size: 0.84rem; word-break: break-word; }
        .link-list a:hover { text-decoration: underline; }
        .tool-strip { max-width: 960px; margin: 10px auto 0; padding: 0 24px; display: flex; justify-content: flex-end; }
        .cart-dock { position: fixed; right: 18px; bottom: 18px; width: min(420px, calc(100vw - 36px)); background: #fff; border: 1px solid #dbe3ea; border-radius: 8px; box-shadow: 0 12px 36px rgba(15,23,42,0.18); z-index: 90; overflow: hidden; }
        .scroll-fab { position: fixed; right: 24px; bottom: 76px; width: 46px; height: 46px; border-radius: 50%; background: rgba(61,107,94,0.85); color: #fff; border: 1px solid rgba(255,255,255,0.2); cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 1.1rem; opacity: 0; pointer-events: none; z-index: 89; box-shadow: 0 4px 12px rgba(61,107,94,0.25); backdrop-filter: blur(4px); transition: opacity 0.34s ease, transform 0.3s, background 0.3s, box-shadow 0.3s, bottom 0.28s ease; outline: none; }
        .scroll-fab.visible { opacity: 1; pointer-events: auto; }
        .scroll-fab:hover { background: rgba(61,107,94,1); transform: scale(1.08); box-shadow: 0 6px 16px rgba(61,107,94,0.4); }
        .scroll-fab i { transition: transform 0.32s ease, opacity 0.2s ease; }
        .scroll-fab.direction-down i { transform: rotate(180deg); }
        body.detail-open .scroll-fab { opacity: 0; pointer-events: none; }
        .cart-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: #26323f; color: #fff; font-weight: 700; font-size: 0.86rem; }
        .cart-body { display: block; padding: 0 12px; max-height: 0; opacity: 0; overflow: hidden; transition: max-height 0.28s ease, opacity 0.2s ease, padding 0.22s ease; }
        .cart-dock.open .cart-body { max-height: 360px; opacity: 1; padding: 10px 12px; overflow-y: auto; }
        .cart-list { display: grid; gap: 7px; margin-bottom: 10px; }
        .cart-item { display: grid; grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; align-items: center; border: 1px solid #edf2f7; border-radius: 7px; padding: 8px; cursor: pointer; transition: background 0.18s ease, border-color 0.18s ease; }
        .cart-item:hover { background: #f8fafc; border-color: #bfdbfe; }
        .cart-item strong { font-size: 0.82rem; color: #1e293b; line-height: 1.3; }
        .cart-item span { font-size: 0.75rem; color: #64748b; }
        .cart-remove { width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center; padding: 0; justify-self: center; }
        .cart-actions { display: flex; flex-wrap: wrap; gap: 6px; }
        .mini-btn { border: 1px solid #cbd5e1; background: #f8fafc; color: #334155; border-radius: 6px; padding: 5px 8px; font-size: 0.76rem; font-weight: 700; cursor: pointer; }
        .mini-btn:hover { background: #e2e8f0; }
        .mini-btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
        .mini-btn.danger { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
        .related-list { display: grid; gap: 8px; }
        .related-item { display: grid; gap: 3px; border: 1px solid #e2e8f0; border-radius: 7px; padding: 9px 10px; background: #f8fafc; cursor: pointer; }
        .related-item:hover { border-color: #93c5fd; background: #eff6ff; }
        .related-item strong { color: #1e293b; font-size: 0.86rem; line-height: 1.3; }
        .related-item span { color: #64748b; font-size: 0.74rem; }
        .related-open { color: var(--accent); font-size: 0.74rem; font-weight: 700; }
        .related-pdf-btn, .related-pdf-btn:visited { color: #ef4444 !important; }
        .related-index-btn, .related-index-btn:visited { color: #f97316 !important; }
        /* El panel es una superficie de consulta rápida: sus respuestas visuales deben sentirse inmediatas. */
        .detail-panel .action-btn,
        .detail-panel .close-btn,
        .detail-panel .chip-registro,
        .detail-panel .related-item { transition-duration: 0.14s; }
        /* =============================================================
           RESPONSIVE
           ≤ 900px           Tablet apaisada / desktop angosto
           ≤ 768px           Móvil grande / tablet portrait  ← principal
           900px + h≤500px   Landscape en celular
           ≤ 480px           Móvil estándar
           ≤ 360px           Móvil pequeño
           ============================================================= */

        /* ── 900px: tablet apaisada ──────────────────────────────────── */
        @media (max-width: 900px) {
            .hero-container  { padding: 22px 20px 18px; }
            .hero-title      { font-size: 1.5rem; }
            .adv-field, .adv-field-wide { grid-column: span 6; }
            .modern-filters {
                display: grid;
                grid-template-columns: repeat(12, minmax(0, 1fr));
                gap: 6px;
                padding: 0.5rem;
            }
            .modern-filters > * + * { margin-left: 0; padding-left: 0; }
            .modern-filters > * + *::before { display: none; }
            .modern-filters > .filter-segmented { grid-column: span 6; }
            .modern-filters > #dropdown-tipo-doc,
            .modern-filters > #dropdown-disponibilidad,
            .modern-filters > #dropdown-orden,
            .modern-filters > #inti-switch { grid-column: span 3; }
            .modern-filters > #dropdown-page-size { grid-column: span 2; }
            .modern-filters > .filter-year-range { grid-column: span 4; }
            .modern-filters > .filter-dropdown,
            .modern-filters > .filter-year-range,
            .modern-filters > .filter-switch { min-width: 0; }
            #dropdown-tipo-doc .dropdown-trigger,
            #dropdown-disponibilidad .dropdown-trigger,
            #dropdown-orden .dropdown-trigger,
            #dropdown-page-size .dropdown-trigger { width: 100%; justify-content: center; }
            .modern-filters > .filter-year-range { justify-content: center; }
            .modern-filters > .filter-switch { justify-content: center; }
            .modern-filters > #inti-switch { margin-right: 0; }
            #s-orden         { min-width: 155px; }
            .main-content, .stats-bar { padding-left: 18px; padding-right: 18px; }
        }

        /* ── 768px: principal — móvil y tablet portrait ──────────────── */
        @media (max-width: 768px) {

            /* --- HERO ------------------------------------------------ */
            .hero-container  { padding: 15px 14px 13px; }
            .hero-header     { margin-bottom: 13px; }
            .hero-tech-badge { display: none; }
            .hero-brand-bar  { height: 30px; }
            .hero-title      { font-size: 1.2rem; }
            .hero-subtitle   { font-size: 0.64rem; letter-spacing: 0.07em; }

            /* --- BARRA DE BÚSQUEDA ----------------------------------- */
            .search-wrapper  { gap: 7px; margin-bottom: 10px; }
            .search-row      { flex-wrap: wrap; gap: 7px; }
            .search-box      { flex: 1 1 100%; order: 1; }
            .search-divider  { display: none; }
            .search-btn, .search-clear-btn { height: 42px; width: 42px; }
            .adv-toggle-btn  { order: 2; flex: 1 1 100%; justify-content: center; height: 40px; font-size: 0.78rem; }

            /* --- PANEL AVANZADO ------------------------------------- */
            .adv-field, .adv-field-wide { grid-column: 1 / -1; }
            .adv-panel.open  { max-height: 900px; }
            .adv-panel-label span { display: none; }

            /* --- FILTROS MODERNOS: layout apilado ------------------- */
            .modern-filters { flex-direction: column; align-items: stretch; }
            .modern-filters { display: flex; }
            .modern-filters > * + * { margin-left: 0; padding-left: 0; }
            .filter-segmented { width: 100%; justify-content: center; }
            .filter-dropdown .dropdown-trigger { width: 100%; justify-content: center; }
            .filter-year-range { justify-content: center; }
            .filter-switch { justify-content: center; }

            /* --- STATS BAR ------------------------------------------ */
            .stats-bar       { padding: 10px 14px; font-size: 0.74rem; line-height: 1.35; gap: 3px; grid-template-columns: 1fr; }
            #stat-time       { justify-self: start; margin-left: 0; padding: 3px 0 0; border-left: 0; color: #94a3b8; font-size: 0.7rem; }

            /* --- CONTENEDOR PRINCIPAL ------------------------------- */
            .main-content    { padding: 0 12px; margin-top: 8px; margin-bottom: 60px; }
            .card-list       { gap: 12px; }
            #stats-area > div { grid-template-columns: 1fr !important; }

            /* --- TARJETA: ZONA CABECERA (grid 2-col, como simple.xis) */
            .zona-cabecera {
                display: grid !important;
                grid-template-columns: 1fr auto !important;
                grid-template-rows: auto auto !important;
                padding: 15px !important;
                gap: 10px 8px !important;
                align-items: start !important;
            }
            .zona-cabecera .badges-container {
                grid-column: 1 / 2 !important;
                grid-row: 1 / 2 !important;
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: wrap !important;
                justify-content: flex-start !important;
                align-items: center !important;
                gap: 5px !important;
                width: 100% !important;
                margin: 0 !important;
            }
            .zona-cabecera .botones-container {
                grid-column: 2 / 3 !important;
                grid-row: 1 / 2 !important;
                display: flex !important;
                flex-direction: row !important;
                flex-wrap: nowrap !important;
                justify-content: flex-end !important;
                align-items: center !important;
                gap: 5px !important;
                margin: 0 !important;
            }
            .zona-cabecera .titulo-wrapper {
                grid-column: 1 / 3 !important;
                grid-row: 2 / 3 !important;
                width: 100% !important;
                padding-right: 0 !important;
                margin: 0 !important;
            }
            .zona-cabecera .info-tag,
            .zona-cabecera .action-btn {
                height: 28px !important;
                box-sizing: border-box !important;
                display: inline-flex !important;
                align-items: center !important;
                padding-top: 0 !important;
                padding-bottom: 0 !important;
                line-height: 1 !important;
            }
            .titulo-destacado { font-size: 1.15rem !important; }
            .barra-dorada     { width: 32px; }

            /* --- TARJETA: ZONA CUERPO ------------------------------- */
            .zona-cuerpo { padding: 15px !important; }
            .fila-flex {
                flex-direction: column !important;
                gap: 3px !important;
                padding: 8px 0 !important;
                border-bottom: 1px solid #f0f0f0;
            }
            .etiqueta-flex {
                flex: 0 0 auto !important;
                width: 100% !important;
                padding-right: 0 !important;
                align-items: flex-start !important;
            }
            .icono-flex { width: 16px !important; }
            .texto-etiqueta { font-size: 0.85rem !important; font-weight: 600 !important; }
            .dato-flex {
                flex: 0 0 auto !important;
                display: block !important;
                width: 100% !important;
                padding-left: 32px !important;
                padding-right: 6px !important;
                text-align: justify;
                hyphens: auto;
                font-size: 0.9rem !important;
                overflow-wrap: break-word !important;
                word-break: break-word !important;
                box-sizing: border-box !important;
            }

            /* --- TARJETA: ZONA PIE ---------------------------------- */
            .zona-pie { padding: 12px 15px !important; }

            /* --- PAGINACIÓN ----------------------------------------- */
            .pag-wrapper    { margin: 28px 0 14px; gap: 10px; }
            .pag-controls   { gap: 3px; }
            .page-btn       { padding: 5px 10px; font-size: 0.8rem; }
            .pag-goto       { gap: 6px; }
            .pag-goto input { width: 58px; }

            /* --- PANEL DETALLE: pantalla completa en móvil ---------- */
            .detail-panel  { width: 100vw; }
            .panel-header  { padding: 14px 16px; }
            .panel-title   { font-size: 1rem; }
            .panel-body    { padding: 14px 16px 20px; }
            .grid-caja     { grid-template-columns: 1fr; gap: 10px; }

            /* --- CART DOCK ------------------------------------------ */
            .cart-dock { right: 8px; bottom: 8px; width: calc(100vw - 16px); }
            .scroll-fab { right: 14px; bottom: 62px; width: 42px; height: 42px; }
        }

        /* ── Landscape en celular (ancho ≤900 + alto ≤500) ──────────── */
        @media (max-width: 900px) and (max-height: 500px) {
            .hero-container  { padding: 10px 14px 9px; }
            .hero-subtitle   { display: none; }
            .search-wrapper  { margin-bottom: 7px; }
            .modern-filters   { padding: 5px; }
            .main-content    { padding: 0 10px; }
        }

        /* ── 480px: móvil estándar ───────────────────────────────────── */
        @media (max-width: 480px) {
            .hero-container  { padding: 12px 12px 11px; }
            .hero-brand-bar  { height: 26px; width: 2px; }
            .hero-title      { font-size: 1.05rem; }
            .hero-subtitle   { display: none; }
            .search-btn, .search-clear-btn { height: 40px; width: 40px; font-size: 0.82rem; }

            .modern-filters { gap: 0.4rem; }
            .filter-year-row { display: flex !important; gap: 6px; }
            #f-anio-desde, #f-anio-hasta { flex: 1; }

            .result-item   { border-radius: 10px !important; }
            .zona-cabecera { padding: 12px 10px 10px 10px !important; }
            .zona-cuerpo   { padding: 10px !important; }
            .zona-pie      { padding: 10px !important; }
            .badges-container { gap: 4px !important; }
            .info-tag { font-size: 0.68rem !important; padding: 2px 6px !important; }
            .titulo-destacado { font-size: 1rem !important; }

            .pag-goto { flex-wrap: wrap; justify-content: center; }
            .cart-actions { gap: 3px !important; flex-wrap: nowrap !important; overflow-x: auto !important; }
            .cart-actions .mini-btn { font-size: 0.65rem !important; padding: 3px 5px !important; white-space: nowrap !important; }
        }

        /* ── 360px: móvil muy pequeño ───────────────────────────────── */
        @media (max-width: 360px) {
            .hero-container  { padding: 10px 10px 9px; }
            .hero-title      { font-size: 0.95rem; }
            .adv-toggle-btn { font-size: 0.72rem; }
            .filter-select, #s-orden,
            #f-anio-desde, #f-anio-hasta { font-size: 0.79rem; min-height: 36px; }
            .titulo-destacado { font-size: 0.9rem !important; }
            .zona-cabecera { padding: 10px !important; }
            .action-btn { font-size: 0.7rem; padding: 3px 7px; }
        }

        /* El encabezado usa un layout propio: flexible en tablet y apilado en móvil. */
        @media (max-width: 1120px) and (min-width: 769px) {
            .modern-filters {
                display: flex;
                flex-wrap: wrap;
                gap: 6px;
                width: 100%;
            }
            .modern-filters.filters-compact { width: 100%; }
            .modern-filters > * {
                flex: 1 1 auto;
                min-width: 0;
            }
            .modern-filters > * + * {
                margin-left: 0;
                padding-left: 0;
            }
            .modern-filters > * + *::before { display: none; }
            .modern-filters > .filter-segmented { flex: 1 1 100%; }
            .modern-filters > #dropdown-tipo-doc { flex-basis: 175px; }
            .modern-filters > #dropdown-disponibilidad { flex-basis: 132px; }
            .modern-filters > #dropdown-orden { flex-basis: 96px; }
            .modern-filters > #dropdown-page-size { flex-basis: 62px; }
            .modern-filters > .filter-year-range { flex-basis: 150px; justify-content: center; }
            .modern-filters > #inti-switch { flex-basis: 145px; justify-content: center; }
            #dropdown-tipo-doc .dropdown-trigger,
            #dropdown-disponibilidad .dropdown-trigger,
            #dropdown-orden .dropdown-trigger,
            #dropdown-page-size .dropdown-trigger { width: 100%; justify-content: center; }
            .filter-collapsible:not(.filter-hidden) { max-width: none; }
            .filter-collapsible.filter-hidden { display: none; }
        }

        @media (max-width: 768px) {
            .hero-inner { width: 100%; }
            .modern-filters {
                display: grid !important;
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 6px !important;
                width: 100% !important;
                max-width: none !important;
            }
            .modern-filters.filters-compact { width: 100%; }
            .modern-filters > * {
                width: 100%;
                max-width: none;
                box-sizing: border-box;
            }
            /* Filtros que necesitan fila completa en mobile */
            .modern-filters .filter-segmented,
            .modern-filters .filter-year-range,
            .modern-filters .filter-switch {
                grid-column: 1 / -1;
            }
            .modern-filters > * + * {
                margin-left: 0;
                padding-left: 0;
            }
            .modern-filters > * + *::before { display: none; }
            .filter-segmented {
                display: grid;
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
            .seg-option {
                min-width: 0;
                padding: 7px 4px;
                font-size: 0.71rem;
            }
            .modern-filters .dropdown-trigger { width: 100%; justify-content: center; }
            .modern-filters > .filter-year-range { justify-content: center; }
            .modern-filters > #inti-switch { justify-content: center; }
            .filter-collapsible.filter-hidden { display: none; }
        }

        /* [V52] Keyframes globales */
        @keyframes spin {
            from { transform: rotate(0deg); }
            to   { transform: rotate(360deg); }
        }
        @keyframes fadeInUp {
            from { opacity: 0; transform: translateY(10px); }
            to   { opacity: 1; transform: translateY(0); }
        }
        .det-body-anim { animation: fadeInUp 0.28s ease both; }
        .related-anim  { animation: fadeInUp 0.35s ease 0.12s both; }

        /* [V52] Responsive dashboard en mobile */
        @media (max-width: 768px) {
            #stats-area > div { grid-template-columns: 1fr !important; }
            #stats-area #kpi-row { grid-template-columns: 1fr 1fr !important; gap: 6px !important; }
            #chart-tipos, #chart-anios, #chart-idiomas { max-height: 180px !important; }
            #top-autores-list { max-height: 240px; overflow-y: auto; }
        }
        @media (max-width: 480px) {
            #stats-area { padding: 10px 6px !important; }
        }
        @media (max-width: 320px) {
            #stats-area #kpi-row { grid-template-columns: 1fr !important; }
        }

        .conteo-cargando { color: #94a3b8; font-style: italic; }
    
        /* --- TOAST NOTIFICATION --- */
        .toast-notification {
            position: fixed;
            bottom: 30px;
            left: 50%;
            transform: translateX(-50%) translateY(100px); 
            background-color: #333333;
            color: #ffffff;
            padding: 12px 25px;
            border-radius: 50px; 
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            font-size: 0.95rem;
            z-index: 999999;
            opacity: 0;
            transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); 
            display: flex;
            align-items: center;
            gap: 10px;
            pointer-events: none;
        }
        .toast-notification.show {
            transform: translateX(-50%) translateY(0); 
            opacity: 1;
        }
        .toast-notification i {
            vertical-align: middle;
            margin: 0 8px 0 0;
            font-size: 1.1rem;
            color: #4caf50;
        }
        @media (max-width: 768px) {
            .toast-notification {
                background-color: #333333 !important; 
                color: #ffffff !important;
                border-radius: 50px !important; 
                box-shadow: 0 4px 15px rgba(0,0,0,0.3) !important;
                white-space: nowrap !important; 
                width: max-content !important; 
                max-width: 90vw !important;
                padding: 12px 25px !important;
                font-size: 0.95rem !important;
                text-align: center !important;
                z-index: 999999 !important; 
            }
            .toast-notification i {
                vertical-align: middle !important;
                margin: 0 8px 0 0 !important;
                font-size: 1.1rem !important;
            }
        }
    
        @keyframes tabSwitchFade {
            from { opacity: 0; transform: translateY(5px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .tab-anim { animation: tabSwitchFade 0.4s ease-out forwards; }
    
    
        @media (max-width: 992px) {
            .modern-filters {
                display: grid !important;
                grid-template-columns: repeat(2, 1fr) !important;
                gap: 6px !important;
                align-items: stretch !important;
            }
            .modern-filters > * {
                grid-column: span 1 !important;
                width: 100% !important;
            }
            /* Solo la base de datos (TODO/DOC/NORMAS) ocupa todo el ancho */
            .modern-filters .filter-segmented {
                grid-column: 1 / -1 !important;
            }
        }

        /* --- DRIVER POPOVER INTI (tour del Catálogo) --- */
        .driver-popover-inti {
            background-color: #ffffff;
            color: #334155;
            border-radius: 12px;
            box-shadow: 0 4px 6px -1px rgba(0,0,0,0.08), 0 10px 30px -4px rgba(0,0,0,0.15);
            max-width: 340px;
            padding: 20px 20px 0;
            border: 1px solid rgba(0,0,0,0.04);
        }
        .driver-popover-inti .driver-popover-title {
            color: #1e3a5f;
            font-size: 1.05rem;
            font-weight: 700;
            letter-spacing: -0.01em;
            padding-right: 32px;
            margin: 0 0 8px 0;
            line-height: 1.4;
            display: flex;
            align-items: center;
        }
        .driver-popover-inti .driver-popover-title::before {
            content: none;
        }
        .tour-step-icon {
            display: inline-flex;
            width: 28px;
            height: 28px;
            border-radius: 7px;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            margin-right: 10px;
        }
        .tour-step-icon i {
            font-size: 0.8rem;
        }
        .driver-popover-inti .driver-popover-description {
            color: #475569;
            font-size: 0.875rem;
            line-height: 1.65;
            margin: 0;
            padding-right: 6px;
        }
        .driver-popover-inti .driver-popover-description i {
            color: #fbbf24;
        }
        .driver-popover-inti .driver-popover-close-btn {
            position: absolute;
            z-index: 999999;
            top: 6px;
            right: 6px;
            width: 32px;
            height: 32px;
            line-height: 32px;
            text-align: center;
            font-size: 1.2rem;
            font-weight: 400;
            color: #475569;
            background: #f1f5f9;
            border: 1px solid #e2e8f0;
            border-radius: 8px;
            cursor: pointer;
            padding: 0;
            margin: 0;
            transition: all 0.15s ease;
        }
        .driver-popover-inti .driver-popover-close-btn:hover {
            color: #0f172a;
            background: #e2e8f0;
            border-color: #94a3b8;
        }
        .driver-popover-inti .driver-popover-footer {
            margin-top: 12px;
            padding-top: 10px;
            padding-bottom: 18px;
            border-top: 1px solid #dce1e9;
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            background: #eef2f6;
            margin-left: -20px;
            margin-right: -20px;
            padding-left: 20px;
            padding-right: 20px;
            border-radius: 0 0 12px 12px;
        }
        .driver-popover-inti .driver-popover-progress-text {
            color: #475569;
            font-size: 0.75rem;
            font-weight: 600;
            background: transparent;
            white-space: nowrap;
            letter-spacing: 0.01em;
        }
        .driver-popover-inti .driver-popover-navigation-btns {
            display: flex;
            flex-shrink: 0;
            gap: 6px;
        }
        .driver-popover-inti .driver-popover-navigation-btns button {
            display: inline-block;
            box-sizing: border-box;
            background: #ffffff;
            color: #1e3a5f;
            border: 1.5px solid #d1d9e6;
            border-radius: 7px;
            padding: 6px 14px;
            font-size: 0.8rem;
            font-weight: 600;
            font-family: inherit;
            cursor: pointer;
            line-height: 1.4;
            text-shadow: none;
            outline: none;
            transition: all 0.15s ease;
            white-space: nowrap;
        }
        .driver-popover-inti .driver-popover-navigation-btns button:hover {
            background: #f8fafc;
            border-color: #94a3b8;
            box-shadow: 0 1px 4px rgba(0,0,0,0.06);
        }
        .driver-popover-inti .driver-popover-arrow {
            filter: drop-shadow(0 1px 2px rgba(0,0,0,0.06));
        }
        .driver-popover-inti .fas,
        .driver-popover-inti .far,
        .driver-popover-inti .fab {
            font-family: "Font Awesome 7 Free" !important;
        }
        .driver-popover-inti .fas {
            font-weight: 900 !important;
        }
        .driver-popover-inti .far {
            font-weight: 400 !important;
        }


/* MENSAJES (Importados desde Fuentes) */
.message {
    padding: 30px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}
.message i { 
    font-size: 2.5rem;
    margin-bottom: 16px;
    opacity: 0.9;
    display: inline-block;
}
.message h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
    font-weight: 600;
}
.message-warning {
    background: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2b6cb0;
}
.message-warning i { color: #3182ce; }
