/* Documentos · índice y personas a la izquierda, documento al centro, Consulta flotante. */
/* Solo actúa con body.dx-index-on (lo pone documents-index.mjs). */
.dx-index { display: none; }
.dx-index-on .dx-index { display: flex; flex-direction: column; position: sticky; top: 60px; min-width: 0; max-height: calc(100dvh - 76px); overflow: visible; border: 1px solid #dfe6e2; border-radius: 12px; background: #fff; }
.dx-index-on .documents-panels,
.dx-index-on .documents-panels.consultation-open { grid-template-columns: 300px minmax(0, 1fr); }

/* «Trabajando sobre»: carpeta del expediente elegida. */
.dx-scope { border-radius: 12px 12px 0 0; position: relative; flex-shrink: 0; display: grid; gap: 6px; padding: 12px 12px 10px; border-bottom: 1px solid #e6ece8; background: #f7faf8; }
.dx-scope[hidden] { display: none; }
.dx-scope-label { color: #247d67; font: 500 10px "DM Mono", Manrope, monospace; letter-spacing: .08em; text-transform: uppercase; }
.dx-scope-button { display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #b9d6c8; border-radius: 10px; padding: 8px 10px; background: #fff; color: #173e32; text-align: left; cursor: pointer; }
.dx-scope-button span { display: grid; gap: 1px; min-width: 0; }
.dx-scope-button strong { font: 600 12px/1.4 Manrope, sans-serif; overflow-wrap: anywhere; }
.dx-scope-button small { color: #6c7d74; font-size: 10px; }
.dx-scope-button b { color: #1c6a57; font-size: 11px; }
.dx-scope-list { position: absolute; left: 12px; right: 12px; top: calc(100% - 6px); z-index: 6; max-height: 50dvh; overflow: auto; border: 1px solid #cbd6d1; border-radius: 10px; padding: 6px; background: #fff; box-shadow: 0 14px 36px #10261f26; }
.dx-scope-list button { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; width: 100%; border: 0; border-radius: 6px; padding: 7px 8px; background: none; color: #25433a; font: 500 12px Manrope, sans-serif; text-align: left; cursor: pointer; }
.dx-scope-list button.dx-scope-d1 { padding-left: 24px; }
.dx-scope-list button.dx-scope-d2 { padding-left: 40px; }
.dx-scope-list button.dx-scope-d3 { padding-left: 56px; }
.dx-scope-list button.dx-scope-d4 { padding-left: 72px; }
.dx-scope-list button.dx-scope-d5 { padding-left: 88px; }
.dx-scope-list button.dx-scope-d6 { padding-left: 104px; }
.dx-scope-list button.dx-scope-d7 { padding-left: 120px; }
.dx-scope-list button.dx-scope-d8 { padding-left: 136px; }
.dx-scope-list button.dx-scope-d9 { padding-left: 152px; }
.dx-scope-list button.dx-scope-d10 { padding-left: 168px; }
.dx-scope-list button:hover { background: #f2f6f4; }
.dx-scope-list button.is-active { background: #e3eee8; font-weight: 700; }
.dx-scope-list small { flex-shrink: 0; color: #6c7d74; font-size: 10px; }
.dx-tabs { display: flex; flex-shrink: 0; border-bottom: 1px solid #dfe6e2; }
.dx-tabs button { flex: 1; border: 0; border-bottom: 2px solid transparent; padding: 13px 8px 11px; background: none; color: #6c7d74; font: 600 12px Manrope, sans-serif; cursor: pointer; }
.dx-tabs button[aria-selected="true"] { border-bottom-color: #1c6a57; color: #173e32; }
.dx-tabs button:focus-visible, .dx-index button:focus-visible, .dx-person-bar button:focus-visible { outline: 2px solid #a58a4e; outline-offset: -2px; }

.dx-filter-slot { flex-shrink: 0; }
.dx-filter-slot:empty { display: none; }
.dx-filter-slot .case-document-filter { margin: 0; border: 0; border-bottom: 1px solid #e6ece8; border-radius: 0; padding: 12px; background: #f7faf8; box-shadow: none; }
.dx-filter-slot .case-filter-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px; margin: 0 0 8px; }
.dx-filter-slot .case-filter-heading strong { color: #247d67; font: 500 10px "DM Mono", Manrope, monospace; letter-spacing: .08em; text-transform: uppercase; }
.dx-filter-slot .case-filter-heading span { color: #6c7d74; font-size: 10px; }
/* 22 nov 2026: el contador va en su propia línea y nunca se sale del recuadro. */
.dx-filter-slot .case-filter-heading [data-case-filter-count] { flex: 1 1 100%; min-width: 0; white-space: normal; overflow-wrap: anywhere; }
.dx-filter-slot .case-filter-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.dx-filter-slot .case-filter-controls label, .dx-filter-slot .case-filter-controls input { width: 100%; min-width: 0; box-sizing: border-box; }
.dx-filter-slot .case-filter-controls button { justify-self: start; padding: 5px 9px; font-size: 11px; }
.dx-filter-slot .case-filter-help { display: none; }
.dx-filter-slot [data-case-filter-status] { margin: 6px 0 0; font-size: 10px; line-height: 1.5; }
.dx-filter-slot [data-case-filter-status]:empty { display: none; }

.dx-person-chip { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-bottom: 1px solid #e6ece8; background: #eef4f1; color: #173e32; font-size: 11px; line-height: 1.4; }
.dx-person-chip[hidden] { display: none; }
.dx-person-chip button { border: 0; padding: 2px 6px; background: none; color: #1c6a57; font-size: 12px; cursor: pointer; }

.dx-pane { flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain; padding: 8px; }
.dx-pane[hidden] { display: none; }
.dx-empty, .dx-people-note { margin: 10px 8px; color: #6c7d74; font-size: 11px; line-height: 1.6; }
.dx-empty button { border: 0; padding: 0; background: none; color: #1c6a57; font: inherit; text-decoration: underline; cursor: pointer; }

.dx-grouping { display: flex; align-items: center; gap: 6px; margin: 2px 4px 8px; color: #6c7d74; font-size: 10px; }
.dx-grouping button { border: 1px solid #dfe6e2; border-radius: 999px; padding: 3px 9px; background: #fff; color: #476056; font: 600 10px Manrope, sans-serif; cursor: pointer; }
.dx-grouping button[aria-pressed="true"] { border-color: #1c6a57; background: #1c6a57; color: #fff; }

.dx-group + .dx-group { margin-top: 2px; }
.dx-group-head { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; border-radius: 8px; padding: 9px 8px; background: none; color: #173e32; font: 600 12px Manrope, sans-serif; text-align: left; cursor: pointer; }
.dx-group-head::before { content: "›"; flex-shrink: 0; width: 10px; color: #7d8e85; font-size: 14px; line-height: 1; transition: transform .12s; }
.dx-group.is-open > .dx-group-head::before { transform: rotate(90deg); }
.dx-group-head:hover { background: #f2f6f4; }
.dx-group-head span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dx-group-head b { flex-shrink: 0; border-radius: 999px; padding: 1px 7px; background: #eef4f1; color: #476056; font-size: 10px; font-weight: 600; }
.dx-group ul, .dx-people { margin: 0 0 6px; padding: 0; list-style: none; }
.dx-row { display: flex; flex-wrap: wrap; align-items: stretch; border-left: 2px solid transparent; border-radius: 0 7px 7px 0; margin-left: 12px; }
.dx-row:hover { background: #f5f8f6; }
.dx-row.is-active { border-left-color: #1c6a57; background: #eef4f1; }
.dx-row-open { flex: 1; min-width: 0; display: grid; gap: 2px; border: 0; padding: 7px 4px 7px 9px; background: none; color: #25433a; font: 500 12px/1.4 Manrope, sans-serif; text-align: left; cursor: pointer; }
.dx-row-open span { overflow-wrap: anywhere; }
.dx-row-open small { color: #7a8a82; font-size: 10px; }
.dx-row-open small:empty { display: none; }
.dx-row.is-active .dx-row-open { color: #123a2f; font-weight: 600; }
.dx-row-eye { flex-shrink: 0; align-self: center; border: 0; border-radius: 6px; padding: 5px; background: none; color: #9aa9a1; line-height: 0; cursor: pointer; opacity: 0; }
.dx-row:hover .dx-row-eye, .dx-row-eye:focus-visible { opacity: 1; }
.dx-row-eye:hover { background: #e3ece7; color: #1c6a57; }

.dx-people button { display: grid; gap: 1px; width: 100%; border: 0; border-radius: 7px; padding: 7px 9px; background: none; color: #25433a; font: 500 12px/1.4 Manrope, sans-serif; text-align: left; cursor: pointer; }
.dx-people button:hover { background: #f5f8f6; }
.dx-people button.is-active { background: #eef4f1; color: #123a2f; font-weight: 600; }
.dx-people small { color: #7a8a82; font-size: 10px; font-weight: 400; }
.dx-people small:empty { display: none; }

/* Centro: portada hasta que se abre un documento. */
.dx-cover-hint, .dx-person-bar { display: none; }
.dx-index-on .dx-cover-hint { display: block; margin: 18px 0 0; border: 1px dashed #cfdad4; border-radius: 12px; padding: 26px 20px; color: #6c7d74; font-size: 13px; text-align: center; }
.dx-index-on.dx-doc-open .dx-cover-hint { display: none; }
.dx-index-on #analysis-content > .analysis-reading-guide { display: none; }
.dx-index-on .core4-pdf-group { overflow: visible; border: 0; border-radius: 0; background: none; }
.dx-index-on .core4-pdf-group > summary { display: none; }
/* 28 nov 2026: sin rayas vacías encima de la ficha. Los PDF sin ninguna ficha abierta no ocupan sitio y el bloque no pinta su línea. */
.dx-index-on .core4-pdf-group:has(.core4-document-card):not(:has(.core4-document-card[open])) { display: none; }
.dx-index-on .core4-pdf-group > .core4-pdf-documents { border-top: 0; }
.dx-index-on .core4-document-card:not([open]) { display: none; }
.dx-index-on.dx-doc-open #analysis-content > .summary-grid,
.dx-index-on.dx-doc-open .core4-library-header,
.dx-index-on.dx-doc-open .page-heading .analysis-note { display: none; }
.dx-index-on .core4-document-card[open] > summary { cursor: default; }
.dx-index-on .core4-document-card[open] > summary::after { content: "✕"; font-size: 13px; cursor: pointer; }

.dx-index-on .dx-person-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 12px; border: 1px solid #dfe6e2; border-radius: 10px; padding: 9px 12px; background: #fff; color: #476056; font-size: 12px; }
.dx-index-on .dx-person-bar[hidden] { display: none; }
.dx-person-bar div { display: inline-flex; border: 1px solid #cdd7cf; border-radius: 8px; overflow: hidden; }
.dx-person-bar button { border: 0; padding: 6px 11px; background: #fff; color: #245d49; font: 600 11px Manrope, sans-serif; cursor: pointer; }
.dx-person-bar button[aria-pressed="true"] { background: #1c6a57; color: #fff; }
.dx-person-bar p { flex-basis: 100%; margin: 0; color: #7a8a82; font-size: 11px; }

/* «Solo sus páginas»: una tarjeta por página con el nombre resaltado. */
.dx-own-pages { display: none; }
.dx-index-on .dx-own-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 10px; margin-top: 12px; }
.dx-index-on .dx-own-pages[hidden] { display: none; }
.dx-index-on.dx-only-pages .core4-document-card[open] > .core4-document-content { display: none; }
.dx-index-on.dx-only-pages .core4-document-card[open] > summary { border-bottom: 0; }
.dx-page-card { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; border: 1px solid #dfe6e2; border-radius: 12px; padding: 13px 16px; background: #fff; font-family: Manrope, sans-serif; text-align: left; cursor: pointer; }
.dx-page-card:hover { border-color: #9fc6b2; background: #f5f9f7; }
.dx-page-card strong { color: #173e32; font-size: 13px; }
.dx-read-count { grid-column: 1 / -1; margin: 0; color: #6c7d74; font-size: 11px; }
.dx-page-card em { margin-right: auto; color: #1c6a57; font-size: 11px; font-style: normal; font-weight: 600; }
.dx-page-card.is-read { border-color: #b9d6c8; background: #e6f1eb; }
.dx-page-card.is-read strong { color: #4d6a5e; }
.dx-page-card.is-read span { color: #6b8a7d; font-weight: 500; }
.dx-page-card span { flex-shrink: 0; color: #1c6a57; font-size: 12px; font-weight: 600; text-decoration: underline; }

/* Bloque de coincidencias: plegado hasta pulsar su título. */
.dx-index-on .analysis-match-navigation { padding: 10px 14px; }
.dx-index-on .analysis-match-navigation > strong { display: flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; }
.dx-index-on .analysis-match-navigation > strong::before { content: "›"; color: #8a7c4e; font-size: 15px; line-height: 1; transition: transform .12s; }
.dx-index-on .analysis-match-navigation.dx-matches-open > strong::before { transform: rotate(90deg); }
.dx-index-on .analysis-match-navigation:not(.dx-matches-open) > :not(strong) { display: none; }


/* Consulta: panel flotante a la derecha, sin desplazar la lectura. */
@media (min-width: 981px) {
  .dx-index-on .documents-consultation.query-content { position: fixed; top: var(--consultation-top, 60px); right: 16px; z-index: 40; width: min(460px, 42vw); background: #fff; box-shadow: 0 18px 48px #10261f2e, 0 2px 8px #10261f14; }
}
@media (max-width: 980px) {
  .dx-index-on .documents-panels, .dx-index-on .documents-panels.consultation-open { grid-template-columns: minmax(0, 1fr); }
  .dx-index-on .dx-index { position: static; max-height: 60dvh; }
  .dx-index-on .documents-panels.consultation-open > .dx-index { display: none; }
  .dx-row-eye { opacity: 1; }
}

/* Lector de páginas: las palabras buscadas se ven unos segundos y se apagan solas. */
@keyframes dx-mark-fade { to { background-color: transparent; outline-color: transparent; color: inherit; } }
@keyframes dx-box-fade { to { opacity: 0; } }
.dx-index-on .documents-original-dialog mark { animation: dx-mark-fade 1.6s ease-out 4s forwards; }
.dx-index-on .documents-original-dialog .documents-original-paper > div > * { animation: dx-box-fade 1.6s ease-out 4s forwards; }
@media (prefers-reduced-motion: reduce) {
  .dx-index-on .documents-original-dialog mark, .dx-index-on .documents-original-dialog .documents-original-paper > div > * { animation-duration: .01s; }
}

/* 16 nov 2026: «Informes guardados» retirado de la Consulta (decisión de Raul). */
#query-history-open { display: none !important; }

/* Persona elegida: sus documentos del censo se ven aunque el filtro de palabras no encuentre su nombre (19 nov 2026). */
.core4-document-card[open].dx-person-doc.analysis-filter-hidden, .core4-pdf-group.dx-person-doc.analysis-filter-hidden { display: block !important; }
.dx-filter-clearing .core4-document-card[open].analysis-filter-hidden, .dx-filter-clearing .core4-pdf-group.analysis-filter-hidden { display: block !important; }
/* Enviar el documento abierto al Cuaderno desde el índice (19 nov 2026). */
.dx-row-send { flex-basis: 100%; display: flex; margin: 0 8px 8px 9px; }
.dx-row-send button { border: 1px solid #1c6a57; border-radius: 7px; padding: 4px 10px; background: #fff; color: #1c6a57; font: 600 11px Manrope, sans-serif; cursor: pointer; }
.dx-row-send button:hover:not(:disabled) { background: #1c6a57; color: #fff; }
.dx-row-send button:disabled { opacity: .55; cursor: default; }
.dx-in-notebook { color: #1c6a57; font-weight: 700; white-space: nowrap; }
.dx-toast { position: fixed; left: 50%; bottom: 24px; z-index: 40; transform: translateX(-50%); display: flex; align-items: center; gap: 14px; max-width: calc(100vw - 32px); padding: 10px 16px; border-radius: 10px; background: #173e32; color: #f5f4e9; font: 500 12px/1.4 Manrope, sans-serif; box-shadow: 0 10px 30px #10261f40; }
.dx-toast[hidden] { display: none; }
.dx-toast a { color: #cfe6d9; font-weight: 700; white-space: nowrap; }
