/* ====================================================================
   Tablero de indicadores estrategicos.

   Hereda del sistema del panel (app/ui_tokens.py) la escala tipografica
   (--fs-*), el ritmo (--sp-*) y la familia de estados. Lo propio es su
   IDENTIDAD: la de CEDIA tal como la lleva su sitio institucional (azul
   del logotipo, azul noche, celeste y Montserrat en los titulos), que se
   declara aqui una sola vez y solo dentro del tablero (.ind). El resto de
   la hoja y los guiones usan estos tokens, no literales.
   ==================================================================== */

.ind {
  /* --- identidad CEDIA */
  --cedia-azul: #01339F;        /* el azul del logotipo */
  --cedia-noche: #141A51;       /* azul noche: fondos profundos y tinta */
  --cedia-celeste: #4FC0E4;     /* celeste: el acento */
  /* El tablero viste los tokens del panel con esa identidad. */
  --brand: #01339F;
  --brand-strong: #062A80;
  --brand-tint: #E8EDFA;
  --brand-line: #C3CEF0;
  --ink: #141A51;
  --muted: #565F80;             /* 6,3:1 sobre el panel */
  --line: #DCE1EF;
  --panel-2: #F5F7FC;
  --focus-ring: 0 0 0 2px var(--panel), 0 0 0 4px var(--brand);
  /* --- la regla de tiempo y el riel del tablero, sobre azul noche */
  --ind-deep: #141A51;
  --ind-deep-2: #232C73;        /* tramo en reposo sobre la regla */
  --ind-deep-3: #2F3A8C;        /* el mismo tramo, senalado */
  --ind-deep-line: #36418F;     /* pelo sobre la regla */
  --ind-deep-edge: #8A94DC;     /* borde de un control sobre la regla: 5,7:1 sobre --ind-deep, 4,1:1 en lo mas claro del degradado, 3,5:1 sobre --ind-deep-3 */
  --ind-on-deep: #FFFFFF;
  --ind-on-deep-muted: #C3CAEE; /* 10:1 sobre --ind-deep */
  --ind-glow: #4FC0E4;          /* el ano elegido y el foco, sobre la regla */
  /* --- graficas */
  --ind-grid: #E6EAF4;
  --ind-axis: #BFC6DC;
  --ind-s1: #1F4FC4;            /* el azul CEDIA en el paso que admite una marca de dato */
  --ind-neg: #B4532A;
  /* D-221: los costos y gastos junto al ingreso, en un gris cálido que no se confunde con ningún color de categoría (5,6:1 sobre blanco) */
  --ind-costo: #6B6862;
  /* --- forma */
  --ind-display: "Montserrat", "Archivo", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --ind-lift: 0 1px 2px rgba(20, 26, 81, 0.05), 0 14px 34px rgba(20, 26, 81, 0.07);
  --ind-float: 0 24px 60px rgba(20, 26, 81, 0.24);
  /* --- D-189 («todo parece muy blanco»): el color de alto impacto de los tableros de vidrio que
     Freddy tomo de referencia (code.xr), con la identidad de CEDIA. Las tarjetas son de vidrio
     sobre un lienzo azulado con halos celeste y azul (va en `main`, mas abajo); lo elegido brilla
     en azul. Sigue sin ser un color de estado: eso es solo del semaforo. */
  --ind-vidrio: rgba(255, 255, 255, 0.76);
  --ind-vidrio-filo: rgba(255, 255, 255, 0.92);
  --ind-sombra-color: 0 1px 2px rgba(1, 51, 159, 0.07), 0 16px 36px -12px rgba(1, 51, 159, 0.26);
  --ind-azul-vivo: #2B5FDB;     /* el brillo de lo elegido: blanco encima a 5,6:1 */
  --ind-brillo: linear-gradient(180deg, var(--ind-azul-vivo), var(--cedia-azul));
  --ind-brillo-sombra: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 6px 14px -4px rgba(1, 51, 159, 0.55);
  --ind-filete-marca: linear-gradient(90deg, var(--cedia-azul), var(--ind-s1) 48%, var(--cedia-celeste));
  --ind-col-w: clamp(790px, 72%, 836px);  /* riel + cifras + indicadores: la regla y el cuadro de mando la comparten */
  --ind-rail-w: 142px;          /* el riel: la perspectiva y sus grupos */
  --ind-kpi-w: 300px;           /* las cifras grandes del grupo principal */
  /* --- listas de barras: el ancho de la columna del valor. Lo fija el pintor en cada lista (la fila mas ancha a
     la vista) para que todas compartan pista; hasta entonces, lo que mida cada una. */
  --valor: auto;
  /* --- el objetivo de un control cuando se pulsa con el dedo (PRODUCT.md: 44 px) */
  --ind-dedo: 44px;
  color: var(--ink);
}

/* D-189: el lienzo del BSC (el inicio y la vista de cada grupo), azulado y con halos celeste y
   azul, como los tableros de vidrio de referencia. Va en `main`, que es el que llega a los bordes
   de la pagina; las tarjetas de vidrio lo dejan asomar. */
main:has(#tab-indicadores.active) {
  background:
    radial-gradient(56% 62% at 0% 0%, rgba(79, 192, 228, 0.36), transparent 72%),
    radial-gradient(48% 56% at 100% 0%, rgba(31, 79, 196, 0.26), transparent 72%),
    radial-gradient(64% 58% at 62% 104%, rgba(79, 192, 228, 0.24), transparent 72%),
    #E6EDFA;
}
.ind ::selection { background: color-mix(in srgb, var(--cedia-celeste) 40%, transparent); }
.ind :focus-visible { box-shadow: var(--focus-ring); }
.ind .pill-brand { border-color: var(--brand-line); }
/* Los titulos hablan con la voz de la marca; las cifras siguen en la tipografia
   de datos del panel, que es condensada y de numerales tabulares. */
.ind-head h2, .ind-section-title, .ind-panel-title, .ind-tabcard-name, .ind-sheet-head h3, .ind-sheet-sec h4 { font-family: var(--ind-display); }

/* La seccion de indicadores aprovecha el ancho: una grafica necesita sitio. */
.page:has(#tab-indicadores.active) { max-width: 1480px; }

/* ----------------------------------------------------------- cabecera */
.ind-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-3) var(--sp-5); flex-wrap: wrap; margin: 0 0 var(--sp-3); }
.ind-head h2 { margin: 0; font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; color: var(--cedia-noche); }
.ind-head-main { min-width: 0; display: grid; gap: var(--sp-1); flex: 1 1 520px; }
.ind-head-side { display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-2); flex: 0 1 552px; min-width: 0; margin-left: auto; }
.ind-question { margin: 0; font-size: var(--fs-small); color: var(--muted); max-width: 110ch; }

.ind-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; min-height: 28px; font-size: var(--fs-small); }
.ind-crumb { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 3px 6px; border-radius: var(--radius-sm); color: var(--brand-strong); font-weight: 600; font-size: inherit; min-height: 28px; }
button.ind-crumb:hover { background: var(--brand-tint); }
.ind-crumb.is-current { color: var(--ink); font-weight: 650; }
.ind-crumb-sep { color: var(--muted); display: inline-flex; }
.ind-crumb-total { margin-left: auto; color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; padding-left: var(--sp-3); }

/* Buscador: directo a la ficha de una institucion o de un servicio. */
.ind-search { position: relative; flex: 1 1 160px; min-width: 150px; max-width: 260px; }
.ind-search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ind-search .ind-search-input { padding-left: 30px; min-height: 32px; border-radius: var(--radius-pill); }
.ind-search-list { position: absolute; z-index: 40; top: calc(100% + 4px); right: 0; left: 0; min-width: 300px; margin: 0; padding: var(--sp-1); list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--ind-lift); max-height: 360px; overflow-y: auto; }
.ind-search-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-2); padding: 6px 8px; border-radius: 6px; cursor: pointer; min-height: 40px; }
.ind-search-list li[aria-selected="true"], .ind-search-list li:hover { background: var(--brand-tint); }
.ind-search-list li.ind-search-empty { display: block; color: var(--muted); font-size: var(--fs-caption); cursor: default; background: none; }
.ind-search-main { display: grid; min-width: 0; line-height: 1.3; }
.ind-search-main strong { font-size: var(--fs-small); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind-search-main span { font-size: var(--fs-caption); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind-search-list .pill { font-size: var(--fs-caption); }

/* Sello de confianza: el estado del dato, siempre a la vista. */
.ind-seal { display: inline-flex; align-items: center; gap: var(--sp-2); border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-pill); padding: 4px 12px 4px 6px; min-height: 32px; min-width: 0; max-width: 380px; flex: 0 1 auto; font-size: var(--fs-caption); font-weight: 600; color: var(--ink); transition: border-color 0.15s ease, background 0.15s ease; }
.ind-seal:hover { border-color: var(--brand); color: var(--brand-strong); }
.ind-seal .pill { padding: 1px 8px; flex: none; font-size: var(--fs-caption); }
.ind-seal > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.ind-seal small { font-size: var(--fs-caption); color: var(--muted); font-weight: 500; }
.ind-cut { font-size: var(--fs-caption); color: var(--muted); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------ regla de tiempo */
/* La pieza que manda: elegir un ano aqui recalcula todas las cifras y mueve
   la banda en todas las pistas a la vez. */
.ind-ruler {
  position: sticky; top: var(--sp-2); z-index: 20;
  display: grid; grid-template-columns: var(--ind-col-w) minmax(0, 1fr); align-items: stretch;
  /* Azul noche con el azul del logotipo asomando por la izquierda, y detras del
     ano elegido los aros del logotipo: el unico gesto de marca de la pagina. */
  background:
    radial-gradient(circle at 26px 50%, transparent 0 57px, rgba(79, 192, 228, 0.16) 57px 59px, transparent 59px 97px, rgba(79, 192, 228, 0.09) 97px 99px, transparent 99px) no-repeat,
    radial-gradient(130% 210% at 0% 0%, #1B2A94 0%, var(--ind-deep) 56%);
  color: var(--ind-on-deep);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: 0 12px 30px rgba(20, 26, 81, 0.22);
}
.ind-ruler.is-alone { border-radius: var(--radius); margin-bottom: var(--sp-4); }
/* D-192, D-195: el periodo. Un botón con el tramo elegido abre un panel, como el calendario de un tablero de
   analítica: atajos a la izquierda y los meses de dos años a la derecha (dos clics, primer y último mes, hasta 12).
   Los meses del tramo se rellenan y sus puntas van llenas; los que aún no cierran no se pueden elegir. */
/* D-198: los años van en el selector: la banda ya no dibuja el eje de años ni el zoom, y el lado ocupa todo el ancho. */
.ind-ruler .ind-ruler-axis, .ind-ruler .ind-ruler-side .ind-ruler-tools { display: none; }
.ind-ruler-side { grid-column: 1 / -1; border-right: none; }
.ind-mes-grupo { display: inline-flex; align-items: center; gap: 4px; justify-self: start; grid-column: 1 / -1; grid-row: 3; margin-top: var(--sp-2); }
.ind-mes-paso { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; border: 1px solid rgba(255, 255, 255, 0.28); border-radius: 50%; background: rgba(255, 255, 255, 0.08); color: var(--ind-on-deep); cursor: pointer; }
.ind-mes-paso.is-antes svg { transform: rotate(180deg); }
.ind-mes-paso:disabled { opacity: 0.35; cursor: not-allowed; }
.ind-mes-paso:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ind-mes-chip { display: inline-flex; align-items: center; min-height: 30px; padding: 0 var(--sp-3); border: 1px solid rgba(255, 255, 255, 0.28); border-radius: var(--radius-pill); background: rgba(255, 255, 255, 0.08); color: var(--ind-on-deep); font: inherit; font-size: var(--fs-caption); font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; white-space: nowrap; }
.ind-mes-chip::before { content: ""; width: 12px; height: 11px; margin-right: var(--sp-2); border: 1.5px solid currentColor; border-top-width: 3px; border-radius: 2px; opacity: 0.85; }
.ind-mes-chip::after { content: ""; width: 6px; height: 6px; margin-left: var(--sp-2); border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.ind-mes-chip.con-mes { background: var(--ind-glow); border-color: var(--ind-glow); color: var(--ind-deep); }
.ind-mes-chip:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.ind-per-anios { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line); }
.ind-per-anio-btn { display: inline-flex; flex-direction: column; align-items: center; min-width: 58px; padding: 3px var(--sp-2); border: 1px solid var(--line); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-caption); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; cursor: pointer; }
.ind-per-anio-btn small { font-size: var(--fs-micro); font-weight: 500; color: var(--muted); }
.ind-per-anio-btn:hover:not(.is-on) { background: var(--ind-vidrio); }
.ind-per-anio-btn.is-on { background: var(--brand); border-color: var(--brand); color: #fff; }
.ind-per-anio-btn.is-on small { color: #fff; }
.ind-per-anio-btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.ind-ruler-meses { display: none; position: absolute; left: var(--sp-3); top: calc(100% + 6px); z-index: 30; width: min(720px, calc(100vw - 2 * var(--sp-4))); grid-template-columns: 200px minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--ink); box-shadow: 0 18px 40px -16px rgba(20, 26, 81, 0.35); }
.ind-ruler.meses-abiertos .ind-ruler-meses { display: grid; }
.ind-per-atajos { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2); border-right: 1px solid var(--line); }
.ind-per-atajo { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; padding: 6px var(--sp-3); border: 0; border-radius: calc(var(--radius) - 4px); background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-caption); font-weight: 600; text-align: left; cursor: pointer; }
.ind-per-atajo small { font-size: var(--fs-micro); font-weight: 500; color: var(--muted); font-variant-numeric: tabular-nums; }
.ind-per-atajo:hover:not(.is-on) { background: var(--ind-vidrio); }
.ind-per-atajo.is-on { background: var(--brand-soft, rgba(1, 51, 159, 0.1)); color: var(--brand); }
.ind-per-atajo.is-on small { color: var(--brand); }
.ind-per-cuerpo { display: flex; flex-direction: column; gap: var(--sp-2); min-width: 0; padding: var(--sp-3); }
.ind-per-nav { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2); }
.ind-meses-rotulo { font-size: var(--fs-caption); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.ind-per-paso { display: inline-grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); cursor: pointer; }
.ind-per-paso.is-antes svg { transform: rotate(180deg); }
.ind-per-paso:disabled { opacity: 0.38; cursor: not-allowed; }
.ind-per-anio { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: var(--sp-2); }
.ind-per-rotulo { font-size: var(--fs-caption); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--muted); }
.ind-per-fila { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 2px; }
.ind-mes { min-width: 0; min-height: 30px; padding: 0 2px; border: 0; border-radius: 6px; background: transparent; color: var(--ink); font: inherit; font-size: var(--fs-caption); font-weight: 600; cursor: pointer; transition: background-color var(--dur-1, 160ms) ease, color var(--dur-1, 160ms) ease; }
.ind-mes.is-en { background: var(--brand-soft, rgba(1, 51, 159, 0.1)); color: var(--brand); }
.ind-mes.is-on { background: var(--brand); color: #fff; }
.ind-mes:hover:not(:disabled):not(.is-on) { background: var(--ind-vidrio); box-shadow: inset 0 0 0 1px var(--line); }
.ind-mes:disabled { opacity: 0.32; cursor: not-allowed; }
.ind-mes:focus-visible, .ind-per-atajo:focus-visible, .ind-per-paso:focus-visible, .ind-per-pie button:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.ind-meses-texto { margin: 0; font-size: var(--fs-caption); color: var(--muted); line-height: 1.4; }
.ind-per-pie { display: flex; justify-content: flex-end; gap: var(--sp-2); }
.ind-per-pie button { min-height: 32px; padding: 0 var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-pill); background: #fff; color: var(--ink); font: inherit; font-size: var(--fs-caption); font-weight: 600; cursor: pointer; }
.ind-per-pie .ind-per-aplicar { background: var(--brand); border-color: var(--brand); color: #fff; }
.ind-per-pie .ind-per-aplicar:disabled { opacity: 0.45; cursor: not-allowed; }
@media (max-width: 640px) {
  .ind-ruler-meses { left: 0; grid-template-columns: minmax(0, 1fr); }
  .ind-per-atajos { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); }
  .ind-per-fila { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
/* En el inicio (regla clara) el botón va junto a los años, a la derecha, y el panel se abre hacia la izquierda. */
.ind-ruler.is-inicio { position: relative; }
/* El estado del año («Año en curso: cifras al…», «Año fiscal cerrado») cambia de largo con el año: ocupa lo que sobra
   y se recorta, para que al elegir otro año las pastillas y el botón del periodo no salten de línea (D-192). */
.ind-ruler.is-inicio .ind-ruler-state { flex: 1 1 0; min-width: 0; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ind-ruler.is-inicio .ind-mes-grupo { order: 4; grid-column: auto; grid-row: auto; margin-top: 0; }
.ind-ruler.is-inicio .ind-mes-paso { width: 34px; height: 34px; border-color: var(--line); background: var(--ind-vidrio); color: var(--ink); }
.ind-ruler.is-inicio .ind-mes-paso:focus-visible { outline-color: var(--brand); }
.ind-ruler.is-inicio .ind-mes-chip { min-height: 34px; border-color: var(--line); background: var(--ind-vidrio); color: var(--ink); }
.ind-ruler.is-inicio .ind-mes-chip.con-mes { background: var(--brand); border-color: var(--brand); color: #fff; }
/* Sin el ícono del calendario: el botón mide lo que medía y no mueve las pastillas de los años (BSC protegido, D-001). */
.ind-ruler.is-inicio .ind-mes-chip::before { content: none; }
.ind-ruler.is-inicio .ind-mes-chip:focus-visible { outline-color: var(--brand); }
.ind-ruler.is-inicio .ind-ruler-meses { left: auto; right: 0; }
@media (prefers-reduced-motion: reduce) { .ind-mes { transition: none; } }
.ind-ruler-side { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: var(--sp-3); row-gap: 2px; align-items: center; align-content: center; padding: var(--sp-3) var(--sp-4); border-right: 1px solid var(--ind-deep-line); }
.ind-ruler-year { grid-column: 2; grid-row: 1; align-self: end; font-size: var(--fs-headline); font-weight: 700; letter-spacing: -0.02em; line-height: 1; font-variant-numeric: tabular-nums; font-stretch: 92%; }
.ind-ruler-state { grid-column: 2 / -1; grid-row: 2; align-self: start; font-size: var(--fs-caption); color: var(--ind-on-deep-muted); line-height: 1.3; }
.ind-ruler-tools { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: var(--sp-1); }
.ind-ruler-window { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ind-rbtn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; flex: none;
  border: 1px solid var(--ind-deep-line); border-radius: var(--radius-sm); background: transparent; color: var(--ind-on-deep);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.ind-rbtn:hover { background: var(--ind-deep-2); border-color: var(--ind-on-deep-muted); }
.ind-rbtn:disabled { opacity: 0.4; }
.ind-rbtn.is-play { width: 40px; height: 40px; border-radius: var(--radius-pill); background: var(--ind-on-deep); color: var(--ind-deep); border-color: var(--ind-on-deep); grid-column: 1; grid-row: 1 / span 2; }
.ind-rbtn.is-play:hover { background: var(--cedia-celeste); border-color: var(--cedia-celeste); }
.ind-ruler :focus-visible { box-shadow: 0 0 0 2px var(--ind-deep), 0 0 0 4px var(--ind-glow); }
.ind-ruler-axis { position: relative; min-width: 0; padding: 0; touch-action: pan-y; }
.ind-ruler-axis { height: 84px; }
.ind-ruler-axis svg { display: block; width: 100%; height: 84px; cursor: grab; }
.ind-ruler-axis svg:active { cursor: grabbing; }
.ind-ruler-axis .yr { cursor: pointer; }
.ind-ruler-axis .yr rect { fill: var(--ind-deep-2); transition: fill 0.18s ease; }
.ind-ruler-axis .yr:hover rect { fill: var(--ind-deep-3); }
/* El ano elegido: celeste con tinta azul noche, la pareja de la marca. */
.ind-ruler-axis .yr.is-on rect { fill: var(--ind-glow); }
.ind-ruler-axis .yr.is-empty rect { fill: transparent; stroke: var(--ind-deep-line); stroke-dasharray: none; }
.ind-ruler-axis .yr text { fill: var(--ind-on-deep); font-size: var(--fs-small); font-weight: 650; font-variant-numeric: tabular-nums; pointer-events: none; }
.ind-ruler-axis .yr.is-empty text, .ind-ruler-axis .yr .yr-note { fill: var(--ind-on-deep-muted); }
.ind-ruler-axis .yr .yr-note { font-size: var(--fs-caption); font-weight: 500; }
.ind-ruler-axis .yr.is-on text, .ind-ruler-axis .yr.is-on .yr-note { fill: var(--ind-deep); }
.ind-ruler-axis .yr.is-on .yr-note { font-weight: 600; }
.ind-ruler-axis .yr:focus-visible rect { stroke: var(--ind-on-deep); stroke-width: 2; }
.ind-ruler-axis .yr:focus-visible { outline: none; }
.ind-ruler-axis .tick line { stroke: var(--ind-deep-line); }
.ind-ruler-axis .tick text { fill: var(--ind-on-deep-muted); font-size: var(--fs-caption); }
/* El corte del dato cruza el ano elegido: blanco con un halo de azul noche, para verse sobre los dos fondos. */
.ind-ruler-axis .today line { stroke: var(--ind-on-deep); stroke-width: 1.5; filter: drop-shadow(0 0 1px var(--ind-deep)) drop-shadow(0 0 1px var(--ind-deep)); }
.ind-ruler-axis .today text { fill: var(--ind-on-deep); font-size: var(--fs-caption); font-weight: 600; }

/* ---- el ambito, dentro de la regla: la banda dice de que ano y de quien o de que.
   Un selector por eje, entre la nota del ano y los botones de la ventana: no
   anaden alto a la banda. Sin valor, borde y fondo transparente; con valor, fondo,
   nombre en negrita y su boton de quitar (tres senales, no solo color). */
.ind-ruler-side.con-ambito { grid-template-columns: auto minmax(148px, 200px) minmax(0, 1fr) auto; }
.ind-ruler-side.con-ambito .ind-ruler-state { grid-column: 2; }
.ind-ruler-side.con-ambito .ind-ruler-tools { grid-column: 4; grid-row: 1 / span 2; }
.ind-amb { grid-column: 3; grid-row: 1 / span 2; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: 28px; gap: var(--sp-1); align-content: center; min-width: 0; padding-left: var(--sp-3); border-left: 1px solid var(--ind-deep-line); }
.ind-amb-slot { display: flex; min-width: 0; border: 1px solid var(--ind-deep-edge); border-radius: var(--radius-sm); transition: background 0.15s ease, border-color 0.15s ease; }
.ind-amb-slot:hover, .ind-amb-slot:has(.ind-amb-btn[aria-expanded="true"]), .ind-amb-slot.is-set { background: var(--ind-deep-2); border-color: var(--ind-on-deep-muted); }
.ind-amb-btn { flex: 1 1 auto; display: flex; align-items: center; gap: var(--sp-2); min-width: 0; padding: 0 var(--sp-2); border: none; border-radius: calc(var(--radius-sm) - 1px); background: none; color: var(--ind-on-deep); font-size: var(--fs-small); line-height: 1.2; text-align: left; }
.ind-amb-btn > .ind-ico { flex: none; color: var(--ind-on-deep-muted); }
.ind-amb-slot.is-set .ind-amb-btn > .ind-ico { color: var(--ind-glow); }
.ind-amb-text { flex: 1 1 auto; display: flex; align-items: baseline; min-width: 0; white-space: nowrap; }
.ind-amb-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.ind-amb-slot.is-set .ind-amb-name { font-weight: 650; }
.ind-amb-count { flex: none; white-space: pre; color: var(--ind-on-deep-muted); font-variant-numeric: tabular-nums; }
.ind-amb-caret { flex: none; display: inline-flex; color: var(--ind-on-deep-muted); transition: transform 0.15s ease; }
.ind-amb-btn[aria-expanded="true"] .ind-amb-caret { transform: rotate(180deg); }
.ind-amb-x { flex: none; display: inline-grid; place-items: center; width: 28px; border: none; border-left: 1px solid var(--ind-deep-line); border-radius: 0 calc(var(--radius-sm) - 1px) calc(var(--radius-sm) - 1px) 0; background: none; color: var(--ind-on-deep); transition: background 0.15s ease; }
.ind-amb-x:hover { background: var(--ind-deep-3); }
/* Mientras llega el tablero del ambito pedido: una linea celeste al pie de la banda. */
.ind-ruler.is-busy::after { content: ""; position: absolute; left: var(--radius); right: var(--radius); bottom: 0; height: 2px; border-radius: 2px; background: var(--ind-glow); transform-origin: left center; animation: ind-busy 1.1s cubic-bezier(0.22, 1, 0.36, 1) infinite; }
@keyframes ind-busy { 0% { transform: scaleX(0); opacity: 1; } 70% { transform: scaleX(1); opacity: 1; } 100% { transform: scaleX(1); opacity: 0; } }
/* La linea de estado del ambito, al pie de la banda (solo con un ambito elegido):
   cuanto de lo que se ve responde a el, donde responde mas y la salida. */
.ind-amb-nota { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0 var(--sp-4); min-width: 0; padding: var(--sp-1) var(--sp-4); border-top: 1px solid var(--ind-deep-line); background: color-mix(in srgb, var(--ind-deep) 55%, transparent); font-size: var(--fs-caption); line-height: 1.4; }
.ind-ruler.is-alone .ind-amb-nota { border-radius: 0 0 var(--radius) var(--radius); }
.ind-amb-nota-text { flex: 1 1 420px; display: flex; align-items: flex-start; gap: var(--sp-2); min-width: 0; margin: 0; padding: var(--sp-1) 0; color: var(--ind-on-deep-muted); }
.ind-amb-nota-text .ind-ico { flex: none; margin-top: 2px; color: var(--ind-glow); }
.ind-amb-nota-text strong { color: var(--ind-on-deep); font-weight: 650; }
.ind-amb-nota-actions { flex: none; display: flex; align-items: center; flex-wrap: wrap; gap: 0 var(--sp-2); margin-left: auto; }
.ind-amb-link, .ind-amb-clear { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 24px; padding: 0 var(--sp-1); border: none; border-radius: var(--radius-sm); background: none; color: var(--ind-on-deep); font-size: var(--fs-caption); font-weight: 600; text-decoration: underline; text-decoration-color: var(--ind-deep-edge); text-decoration-thickness: 1px; text-underline-offset: 3px; transition: background 0.15s ease, text-decoration-color 0.15s ease; }
.ind-amb-link:hover, .ind-amb-clear:hover, .ind-amb-link[aria-expanded="true"] { background: var(--ind-deep-2); text-decoration-color: var(--ind-on-deep); }
.ind-amb-link .ind-ico { flex: none; }
/* Las listas del ambito flotan bajo la banda, que se queda pegada arriba: no se van con la pagina. */
.ind-prov.is-fija { position: fixed; }
.ind-prov.ind-amb-pop { width: min(400px, calc(100vw - 16px)); padding: var(--sp-3); }
.ind-amb-pop .ind-prov-head { align-items: center; margin-bottom: var(--sp-2); padding-left: var(--sp-2); }
.ind-amb-field { position: relative; margin-bottom: var(--sp-1); }
.ind-amb-field .ind-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.ind-amb-field .ind-amb-input { min-height: 36px; padding-left: 32px; }
.ind-amb-list { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--brand-line) transparent; }
.ind-amb-list:focus-visible { box-shadow: inset 0 0 0 2px var(--brand); }
.ind-amb-group { margin-top: var(--sp-1); }
.ind-amb-group-label { padding: var(--sp-1) var(--sp-2); font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.02em; color: var(--muted); }
.ind-amb-opt { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto; align-items: center; column-gap: var(--sp-2); min-height: 32px; padding: 0 var(--sp-2); border-radius: 6px; font-size: var(--fs-small); cursor: pointer; }
.ind-amb-opt.is-child { padding-left: var(--sp-5); }
.ind-amb-opt:hover, .ind-amb-opt[aria-selected="true"] { background: var(--brand-tint); }
.ind-amb-opt-check { display: inline-flex; color: var(--brand); }
.ind-amb-opt-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.ind-amb-opt.is-current .ind-amb-opt-name { font-weight: 700; color: var(--brand-strong); }
.ind-amb-opt-count { color: var(--muted); font-size: var(--fs-caption); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ind-amb-hint { margin: 0; padding: var(--sp-1) var(--sp-2) var(--sp-2) calc(12px + 2 * var(--sp-2)); color: var(--muted); font-size: var(--fs-caption); line-height: 1.4; }
.ind-amb-foot { margin: var(--sp-2) 0 0; padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.ind-prov .ind-amb-link { color: var(--brand-strong); text-decoration-color: var(--brand-line); }
.ind-prov .ind-amb-link:hover { background: var(--brand-tint); text-decoration-color: var(--brand-strong); }
.ind-amb-grupos { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.ind-amb-grupo { display: grid; grid-template-columns: minmax(0, 1fr) auto 11px; align-items: center; column-gap: var(--sp-2); width: 100%; min-height: 32px; padding: 0 var(--sp-2); border: none; border-radius: 6px; background: none; color: var(--ink); font-size: var(--fs-small); font-weight: 500; text-align: left; }
button.ind-amb-grupo:hover { background: var(--brand-tint); }
.ind-amb-grupo .num { color: var(--muted); font-size: var(--fs-caption); }
.ind-amb-grupo .num.is-on { color: var(--ink); font-weight: 650; }
.ind-amb-grupo .ind-ico { color: var(--muted); }

/* El cuadro de mando del inicio (bandas por perspectiva) vive en indicadores-inicio.css. */

/* ------------------------------------------------------------- la cifra */
.ind-cifra { display: grid; gap: 2px; align-content: start; min-width: 0; }
.ind-cifra-label { font-size: var(--fs-caption); color: var(--muted); font-weight: 600; line-height: 1.3; }
.ind-cifra-period { display: block; margin-top: 1px; font-size: var(--fs-micro); font-weight: 500; }
.ind-cifra-value { display: flex; align-items: baseline; gap: 5px; flex-wrap: wrap; }
.ind-cifra-value b { font-weight: 700; letter-spacing: -0.02em; line-height: 1.08; font-variant-numeric: tabular-nums; font-stretch: 92%; }
.ind-cifra-md .ind-cifra-value b { font-size: var(--fs-title); }
.ind-cifra-lg .ind-cifra-value b { font-size: var(--fs-headline); }
.ind-cifra-xl .ind-cifra-value b { font-size: var(--fs-display); }
.ind-cifra-unit { font-size: var(--fs-caption); color: var(--muted); font-weight: 600; }
.ind-cifra.is-empty .ind-cifra-value b { font-size: var(--fs-lead); color: var(--muted); font-weight: 600; letter-spacing: 0; }
.ind-cifra-meta { display: flex; align-items: center; gap: 6px var(--sp-2); flex-wrap: wrap; font-size: var(--fs-caption); color: var(--muted); min-height: 22px; }
.ind-cifra-goal, .ind-cifra-reading { font-variant-numeric: tabular-nums; }
.ind-delta { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 0 3px; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 0; }
.ind-delta b, .ind-delta .ind-ico { white-space: nowrap; flex: none; }
.ind-delta b { font-weight: 650; }
.ind-delta span { color: var(--muted); }
.ind-delta.is-good { color: var(--ok); }
.ind-delta.is-bad { color: var(--risk); }
.ind-estado { display: inline-flex; align-items: center; gap: 5px; padding: 1px 8px; font-size: var(--fs-micro); }
.ind-estado-glyph { flex: none; }
/* El avance de una cifra en la franja de un grupo (la barra y sus reglas base son las del inicio):
   aqui hay sitio para las dos cantidades enteras, que pueden ocupar dos renglones. */
/* La parte de un total que una cifra ensena («usado» de «asignado»): una barra
   fina y, debajo, las dos cantidades. La pintan el inicio y la franja de un
   grupo con la misma pieza (IND.avanceNode). */
.ind-avance { grid-column: 1 / -1; display: grid; gap: 2px; min-width: 0; padding-bottom: var(--sp-1); }
.ind-avance-track { position: relative; display: block; height: 4px; border-radius: var(--radius-pill); background: var(--brand-tint); }
.ind-avance-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--ind-s1); }
.ind-avance-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-caption); line-height: 1.25; color: var(--muted); font-variant-numeric: tabular-nums; }
/* Se uso mas de lo asignado: la barra llega al borde y una punta dice que sigue. */
.ind-avance.is-over .ind-avance-track { margin-right: 7px; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ind-avance.is-over .ind-avance-fill { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.ind-avance.is-over .ind-avance-track::after { content: ""; position: absolute; left: 100%; top: -3px; border-style: solid; border-width: 5px 0 5px 6px; border-color: transparent transparent transparent var(--ind-s1); }
.ind-cifra > .ind-avance { max-width: 280px; margin-top: var(--sp-1); padding-bottom: 0; gap: var(--sp-1); }
.ind-cifra > .ind-avance .ind-avance-text { white-space: normal; overflow: visible; text-overflow: clip; text-wrap: balance; }
/* Con un ambito elegido, lo que no respondio a el: una pastilla dice a que universo corresponde
   («Toda la red») y la pieza se atenua; sigue leyendose (6,3:1), pero ya no compite con las que si respondieron. */
.ind-alcance { display: inline-flex; align-items: center; gap: var(--sp-1); padding: 0 7px; font-size: var(--fs-micro); line-height: 1.35; white-space: nowrap; }
.ind-alcance .ind-ico { flex: none; }
.ind-cifra.is-fuera .ind-cifra-label, .ind-cifra.is-fuera .ind-cifra-value b, .ind-cifra.is-fuera .ind-cifra-value .ind-cifra-unit { color: var(--muted); }
.ind-cifra.is-fuera .ind-cifra-value b { font-weight: 500; }
.ind-panel.is-fuera { background: var(--panel-2); box-shadow: none; }
.ind-panel.is-fuera .ind-panel-title { color: var(--muted); }

.ind-prov-btn { display: inline-flex; align-items: center; gap: 4px; border: none; background: none; padding: 2px 6px; margin-left: -6px; border-radius: var(--radius-sm); color: var(--muted); font-size: var(--fs-micro); font-weight: 600; min-height: 28px; transition: background 0.15s ease, color 0.15s ease; }
.ind-prov-btn:hover, .ind-prov-btn[aria-expanded="true"] { background: var(--brand-tint); color: var(--brand-strong); }
@media (pointer: coarse) {
  .ind-prov-btn, .ind-crumb { min-height: 40px; padding-inline: 10px; }
  .ind-rbtn { width: 40px; height: 40px; }
  .ind-search .ind-search-input, .ind-seal, .ind-bars-row, button.ind-matrix-cell, .ind-rowlink { min-height: 40px; }
}

/* Franja de cifras de un grupo: una sola superficie dividida por pelos, no
   una fila de tarjetas. El ancho de cada casilla lo reparte quien la pinta
   (filas parejas, sin casillas sueltas); hasta que mide, lo que quepa. */
/* D-189: las cifras y cada grafica de un grupo, en vidrio con el filete de la marca arriba (azul a celeste). */
.ind-figs { display: flex; flex-wrap: wrap; background: var(--ind-filete-marca) top / 100% 3px no-repeat, var(--ind-vidrio); border: 1px solid var(--ind-vidrio-filo); border-radius: var(--radius); margin-bottom: var(--sp-4); overflow: clip; box-shadow: var(--ind-sombra-color); }
.ind-figs > .ind-cifra { flex: 1 1 156px; padding: var(--sp-4) var(--sp-4) var(--sp-3); box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
.ind-figs > .ind-cifra.is-lead { background: color-mix(in srgb, var(--cedia-celeste) 12%, transparent); }
/* Una franja larga (una cifra por serie) respira mas: menos casillas por fila, mas anchas. */
.ind-figs.is-many > .ind-cifra { flex-basis: 212px; }
.ind-cifra-label { overflow-wrap: anywhere; }

/* -------------------------------------------------------------- paneles */
.ind-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: var(--sp-4); align-items: stretch; }
.ind-grid > * { grid-column: span 12; min-width: 0; }
@container page (min-width: 900px) {
  .ind-grid > .span-8 { grid-column: span 8; }
  .ind-grid > .span-7 { grid-column: span 7; }
  .ind-grid > .span-6 { grid-column: span 6; }
  .ind-grid > .span-5 { grid-column: span 5; }
  .ind-grid > .span-4 { grid-column: span 4; }
}
.ind-panel { background: var(--ind-filete-marca) top / 100% 3px no-repeat, linear-gradient(180deg, color-mix(in srgb, var(--cedia-celeste) 9%, transparent), transparent 140px), var(--ind-vidrio); border: 1px solid var(--ind-vidrio-filo); border-radius: var(--radius); padding: var(--sp-4) var(--sp-4) var(--sp-3); min-width: 0; display: flex; flex-direction: column; box-shadow: var(--ind-sombra-color); }
.ind-panel.is-flat { box-shadow: none; }
.ind-panel-body { margin-bottom: auto; }
/* La cabecera decide por su propio ancho, no por el de la pagina: un panel de un
   tercio en un portatil es estrecho aunque la pantalla no lo sea. Ancha: el
   titulo a la izquierda, las herramientas a la derecha y las marcas debajo.
   Estrecha: el titulo a todo lo ancho y, debajo, las marcas a la izquierda y
   las herramientas a la derecha. Las herramientas nunca parten su renglon. */
.ind-panel-head { container: cabecera / inline-size; display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--sp-1) var(--sp-3); margin-bottom: var(--sp-3); }
.ind-panel-titles { order: 1; flex: 1 1 0; min-width: 0; }
.ind-panel-marks { order: 3; display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-1); flex: 1 1 100%; min-width: 0; }
.ind-panel-title { margin: 0; font-size: var(--fs-body); font-weight: 650; letter-spacing: -0.01em; line-height: 1.25; text-wrap: balance; }
.ind-panel-sub { margin: 2px 0 0; font-size: var(--fs-caption); color: var(--muted); line-height: 1.45; max-width: 70ch; }
.ind-panel-tools { order: 2; display: flex; align-items: center; gap: var(--sp-1); flex: none; margin-left: auto; }
/* Las cuatro herramientas de un panel con un solo trato: el mismo cuerpo, el mismo alto y el mismo color en reposo,
   al pasar y pulsadas («Fuente» iba a 11 px y 28 de alto; «Tabla», a 12 y 30, y con borde al pulsarla). */
.ind-panel-tools .ind-prov-btn, .ind-panel-tools button.mini.ind-toggle { min-height: 30px; margin-left: 0; padding: 5px 8px; gap: 5px; border: 1px solid transparent; font-size: var(--fs-caption); }
.ind-panel-tools button.mini.ghost:hover, .ind-panel-tools button.mini.ind-toggle[aria-pressed="true"] { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); }
.ind-panel-aviso { margin: 0 0 var(--sp-3); font-size: var(--fs-caption); color: var(--muted); }
@container cabecera (max-width: 488px) {
  .ind-panel-titles { flex-basis: 100%; }
  .ind-panel-marks { order: 2; flex: 1 1 auto; align-self: center; }
  .ind-panel-tools { order: 3; }
}
/* Sin sitio para las palabras, «Fuente» y «Tabla» se quedan en su icono: el nombre lo sigue llevando el control. */
@container cabecera (max-width: 340px) {
  .ind-panel-tools .ind-prov-btn, .ind-panel-tools button.mini.ind-toggle { justify-content: center; min-width: 30px; padding: 5px; }
  .ind-panel-tools .ind-prov-btn > span, .ind-panel-tools .ind-toggle > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
/* Exportar y ampliar: solo el icono; su nombre lo lleva el control. */
button.mini.ind-tool { padding: 5px; min-width: 30px; }
button.mini.ind-tool[aria-pressed="true"], button.mini.ind-tool[aria-expanded="true"] { background: var(--brand-tint); color: var(--brand-strong); }
/* «Ver por»: el mismo dato abierto por otra dimension. */
.ind-panel-bar, .ind-panel-lecturas { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); margin: 0 0 var(--sp-3); }
.ind-panel-lecturas[hidden] { display: none; }
.ind-panel-bar-label { font-size: var(--fs-caption); font-weight: 600; color: var(--muted); }
.ind-panel-bar select { width: auto; min-width: 168px; max-width: 100%; }
.ind-seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); }
.ind-seg button { border: none; background: none; border-radius: 6px; padding: 3px 10px; min-height: 26px; font-size: var(--fs-caption); font-weight: 600; color: var(--ink); transition: background 0.15s ease, color 0.15s ease; }
.ind-seg button:hover { color: var(--brand-strong); }
/* La elegida: superficie, tinta de marca y un filo que la separa de las demas (no solo el color). */
.ind-seg button[aria-pressed="true"] { background: var(--ind-brillo); color: var(--panel); box-shadow: var(--ind-brillo-sombra); }
.ind-seg button[aria-pressed="true"]:focus-visible { box-shadow: var(--focus-ring), var(--ind-brillo-sombra); }
/* D-219: lo que descuenta el margen, como ítems que se marcan (costos, gastos, depreciación); al menos uno queda. */
.ind-items { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.ind-item { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 3px 12px 3px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: var(--fs-caption); font-weight: 600; color: var(--ink); cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.ind-item:hover { border-color: var(--brand); color: var(--brand-strong); }
.ind-item:focus-visible { box-shadow: var(--focus-ring); }
.ind-item-check { width: 14px; height: 14px; flex: none; border: 1.5px solid currentColor; border-radius: 4px; opacity: 0.55; display: inline-grid; place-items: center; }
.ind-item[aria-checked="true"] { background: var(--brand-tint); border-color: var(--brand); color: var(--brand-strong); }
.ind-item[aria-checked="true"] .ind-item-check { opacity: 1; background: var(--brand); border-color: var(--brand); }
.ind-item[aria-checked="true"] .ind-item-check::after { content: ""; width: 7px; height: 4px; margin-top: -2px; border: solid var(--panel); border-width: 0 0 2px 2px; transform: rotate(-45deg); }
.ind-item[aria-disabled="true"] { cursor: default; }
.ind-item[aria-disabled="true"]:hover { border-color: var(--brand); }
/* La vista que el dato no sostiene: apagada y con borde discontinuo (el patron de «sin dato»), no tachada: no se ha quitado, no se puede. */
.ind-seg button.is-off { padding: 2px 9px; border: 1px dashed var(--inactive-line); color: var(--muted); font-weight: 500; cursor: not-allowed; }
.ind-panel-bar-why { flex: 1 1 100%; display: grid; gap: 2px; margin: 0; max-width: 86ch; font-size: var(--fs-micro); color: var(--muted); line-height: 1.45; }
.ind-panel-bar-why b { font-weight: 650; color: var(--ink); }
.ind-panel-note { margin: var(--sp-3) 0 0; padding-top: var(--sp-2); border-top: 1px solid var(--line); font-size: var(--fs-caption); color: var(--muted); line-height: 1.5; max-width: 86ch; }
.ind-panel-body { min-width: 0; }
/* Una nota larga ensena su primera frase; el resto, a un clic y en el mismo sitio. */
.ind-note-rest[hidden] { display: none; }
.ind-note-more { position: relative; border: none; background: none; padding: 0; font: inherit; font-weight: 600; color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }
.ind-note-more:hover { color: var(--brand); }
.ind-section-title { margin: var(--sp-5) 0 var(--sp-3); font-size: var(--fs-lead); font-weight: 700; letter-spacing: -0.015em; }
.ind-section-title small { display: block; font-size: var(--fs-caption); font-weight: 500; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

/* La formula de una grafica, dibujada para quien decide (setFormula). */
.ind-formula { display: flex; flex-wrap: wrap; align-items: stretch; gap: var(--sp-2); margin: var(--sp-2) 0 var(--sp-3); }
.ind-formula-term { display: grid; align-content: start; gap: 2px; min-width: 128px; max-width: 220px; flex: 1 1 140px; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2, transparent); }
.ind-formula-term.is-result { border-color: var(--ink); border-width: 2px; }
.ind-formula-label { font-size: var(--fs-caption); color: var(--muted); line-height: 1.35; }
.ind-formula-value { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); line-height: 1.2; }
.ind-formula-detail { font-size: var(--fs-micro); color: var(--muted); line-height: 1.35; }
.ind-formula-row { flex: 1 1 100%; margin: var(--sp-2) 0 0; padding-top: var(--sp-2); border-top: 1px dashed var(--line); font-size: var(--fs-caption); font-weight: 600; color: var(--muted); }
.ind-formula-row:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ind-formula-op { align-self: center; font-size: var(--fs-lead); font-weight: 700; color: var(--muted); padding: 0 2px; }
@media (max-width: 640px) { .ind-formula-term { max-width: none; flex-basis: 100%; } .ind-formula-op { flex-basis: 100%; text-align: center; } }
/* El ranking con calificacion de A a F (D-156). La letra va escrita en una insignia hexagonal con el tono de su nota
   (nota-1 a nota-5, blanco encima a 4,5:1 o mas): el color la acompana, nunca la reemplaza. */
.ind-nota { --tam: 28px; display: inline-grid; place-items: center; flex: none; width: var(--tam); height: calc(var(--tam) * 1.1); background: var(--nota, var(--muted)); color: #FFFFFF; font-size: var(--fs-caption); font-weight: 750; line-height: 1; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.ind-nota.is-grande { --tam: 52px; font-size: var(--fs-title); }
.ind-nota.is-chica { --tam: 22px; font-size: var(--fs-micro); }
.ind-nota.is-mini { --tam: 18px; font-size: var(--fs-micro); }
.ind-nota.is-vacia { background: var(--line); color: var(--muted); }
.ind-rank-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-3) var(--sp-4); margin: 0 0 var(--sp-3); }
.ind-rank-red { display: flex; align-items: center; gap: var(--sp-3); }
/* D-165: la cabeza del ranking es cada tipo de institucion, sin cifra de toda la red. */
.ind-rank-tipos-cabeza { display: flex; flex-wrap: wrap; gap: var(--sp-3) var(--sp-5); margin: 0; padding: 0; list-style: none; }
.ind-rank-red p { margin: 0; }
.ind-rank-red-valor { font-size: var(--fs-title); font-weight: 700; color: var(--ink); line-height: 1.1; }
.ind-rank-red-sub { font-size: var(--fs-caption); color: var(--muted); line-height: 1.35; }
.ind-rank-escala { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin: 0; padding: 0; list-style: none; font-size: var(--fs-caption); color: var(--ink); }
.ind-rank-escala li { display: inline-flex; align-items: center; gap: 6px; }
.ind-rank-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--sp-3); margin: 0 0 var(--sp-3); }
.ind-rank-card { border: 1px solid var(--line); border-radius: 10px; padding: var(--sp-2) var(--sp-3); background: var(--panel-2, transparent); min-width: 0; }
.ind-rank-card header { display: flex; justify-content: space-between; align-items: baseline; gap: var(--sp-2); padding-bottom: var(--sp-1); margin-bottom: var(--sp-1); border-bottom: 1px solid var(--line); }
.ind-rank-card h4 { margin: 0; font-size: var(--fs-body); font-weight: 700; color: var(--ink); }
.ind-rank-card header span { font-size: var(--fs-micro); color: var(--muted); text-align: right; }
.ind-rank-card-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.ind-rank-card-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 4px var(--sp-2); font-size: var(--fs-caption); }
.ind-rank-card-list li.is-barra { grid-template-columns: minmax(0, 1fr) auto; }
.ind-rank-card-list li.is-barra .ind-rank-card-det { grid-column: 2; grid-row: 2; }
.ind-rank-card-list li.is-barra .ind-rank-bar { grid-column: 1; grid-row: 2; }
.ind-rank-card-num { font-weight: 650; color: var(--ink); text-align: right; }
.ind-rank-card-det { font-size: var(--fs-micro); color: var(--muted); text-align: right; }
.ind-rank-card-vacio { margin: var(--sp-2) 0; font-size: var(--fs-caption); color: var(--muted); }
.ind-rank-bar { display: block; height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; align-self: center; }
.ind-rank-bar-fill { display: block; height: 100%; background: var(--risk); }
.ind-rank-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0; border: 0; background: none; font: inherit; font-weight: 550; color: var(--ink); text-align: left; }
button.ind-rank-name { cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
button.ind-rank-name:hover { color: var(--brand); text-decoration-color: currentColor; }
button.ind-rank-name:focus-visible { box-shadow: var(--focus-ring); border-radius: 2px; }
.ind-rank-table-wrap { overflow-x: auto; }
.ind-rank-table { width: 100%; border-collapse: collapse; font-size: var(--fs-caption); }
.ind-rank-table th, .ind-rank-table td { padding: 6px var(--sp-2); border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.ind-rank-table thead th { font-size: var(--fs-micro); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; background: var(--panel-2, transparent); white-space: nowrap; }
.ind-rank-table tbody th { font-weight: 550; max-width: 260px; }
.ind-rank-table .num { text-align: right; font-variant-numeric: tabular-nums; }
/* D-166: la lista agrupada por tipo de institucion; cada grupo abre con su fila (forma y color del tipo, cuantas,
   nota, uso y cambio), con aire arriba para separar un grupo del anterior. */
.ind-rank-table tbody tr.ind-rank-grupo th { max-width: none; padding: var(--sp-4) var(--sp-2) 6px; border-bottom: 1px solid var(--line); font-weight: 650; text-transform: none; letter-spacing: normal; background: transparent; }
.ind-rank-table tbody.ind-rank-tbody:first-of-type tr.ind-rank-grupo th { padding-top: var(--sp-2); }
.ind-rank-grupo-tit { display: inline-flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.ind-rank-grupo-nombre { font-size: var(--fs-small); color: var(--ink); }
.ind-rank-grupo-uso { font-weight: 650; color: var(--ink); }
/* D-170: en «Categorias con uso bajo», cada tipo de institucion abre su grupo. */
.ind-rank-card-list li.ind-rank-card-grupo { display: flex; align-items: center; gap: 6px; padding-top: var(--sp-2); font-size: var(--fs-micro); font-weight: 700; color: var(--muted); }
.ind-rank-card-list li.ind-rank-card-grupo:first-child { padding-top: 0; }
.ind-rank-pos { color: var(--muted); }
.ind-rank-delta { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ind-rank-delta.is-up { color: var(--ok); }
.ind-rank-delta.is-down { color: var(--risk); }
.ind-rank-delta.is-none { color: var(--muted); }
.ind-rank-hist { display: inline-flex; gap: 3px; }
.ind-rank-more { margin-top: var(--sp-2); }
/* El tipo de institucion: una marca antes del nombre y un filtro de botones (universidades, institutos, colegios…). */
.ind-rank-inst { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; }
.ind-rank-tipo { display: inline-flex; flex: none; }
.ind-rank-tipos { display: flex; flex-wrap: wrap; gap: var(--sp-1) 6px; margin: 0 0 var(--sp-3); font-size: var(--fs-caption); }
.ind-rank-tipo-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 2px 10px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--panel); color: var(--ink); font-size: inherit; cursor: pointer; }
.ind-rank-tipo-btn:hover { border-color: var(--brand-line); background: var(--brand-tint); }
.ind-rank-tipo-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 650; }
.ind-rank-tipo-btn:focus-visible { box-shadow: var(--focus-ring); }
.ind-rank-tipo-uso { color: var(--muted); }
@media (max-width: 640px) { .ind-rank-table tbody th { max-width: 150px; } .ind-rank-head { align-items: flex-start; } }
.ind-legend { display: flex; flex-wrap: wrap; gap: 4px var(--sp-4); margin: 0 0 var(--sp-2); font-size: var(--fs-caption); color: var(--ink); }
.ind-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.ind-legend-key { width: 10px; height: 10px; border-radius: 2px; flex: none; display: inline-block; }
.ind-legend-key.is-line { height: 2px; width: 14px; border-radius: 1px; }
.ind-legend-key.is-dashed { background-image: linear-gradient(90deg, var(--panel) 0 30%, transparent 30% 100%); background-size: 6px 100%; }
/* La leyenda por clases dice que significa el color (y la forma, en los tonos de estado: circulo, rombo,
   triangulo) y cuantas marcas hay de cada una. Si las marcas dicen su clase, cada entrada es un boton
   que la deja sola: la elegida lleva filo de marca y las demas se apagan sin dejar de leerse. */
.ind-legend-title { font-weight: 600; color: var(--muted); }
/* D-166: una segunda clave (de forma) abre su propio renglon en la leyenda. */
.ind-legend-break { flex-basis: 100%; height: 0; }
.ind-glifo { flex: none; display: block; overflow: visible; }
.ind-bars-name > .ind-glifo { display: inline-block; vertical-align: -1px; margin-right: 6px; }
/* El color propio de una fila (el oficial de su categoria) es una llave delante del nombre: la barra no lo lleva. */
.ind-bars-name > .ind-bars-id { margin-right: 6px; vertical-align: -0.5px; }
.ind-legend-n { color: var(--muted); font-variant-numeric: tabular-nums; }
.ind-legend.is-filter { align-items: center; gap: var(--sp-1) 6px; }
.ind-legend.is-filter .ind-legend-title { margin-right: 2px; }
.ind-legend-btn { border: 1px solid var(--line); background: var(--panel); border-radius: var(--radius-pill); padding: 2px 10px 2px 8px; min-height: 26px; font-size: inherit; color: var(--ink); transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.ind-legend-btn:hover:not(:disabled) { border-color: var(--brand-line); background: var(--brand-tint); }
.ind-legend-btn[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); font-weight: 650; }
.ind-legend-btn[aria-pressed="true"]:focus-visible { box-shadow: var(--focus-ring), inset 0 0 0 1px var(--brand); }
.ind-legend.is-isolating .ind-legend-btn[aria-pressed="false"] { color: var(--muted); }
.ind-legend.is-isolating .ind-legend-btn[aria-pressed="false"] :is(.ind-glifo, .ind-legend-key) { opacity: 0.4; }
.ind-legend-btn:disabled { color: var(--muted); background: var(--panel-2); }
.ind-legend-all { border: none; background: none; padding: 2px 6px; min-height: 26px; border-radius: var(--radius-sm); font-size: inherit; font-weight: 600; color: var(--brand-strong); text-decoration: underline; text-underline-offset: 3px; }
.ind-legend-all:hover { background: var(--brand-tint); }
/* Con muchas entradas (las categorias del catalogo) los botones van sin filo: la leyenda no pesa mas que la grafica. */
.ind-legend.is-dense { gap: 2px; }
.ind-legend.is-dense .ind-legend-btn { border-color: transparent; padding: 1px 8px 1px 6px; min-height: 24px; }
.ind-legend.is-dense .ind-legend-btn[aria-pressed="true"] { border-color: var(--brand); }


/* ------------------------------------------------------------ graficas */
.ind-plot { min-width: 0; position: relative; }
.ind-svg { display: block; max-width: 100%; overflow: visible; }
.ind-svg:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: var(--radius-sm); box-shadow: none; }
/* Una grafica que llena su panel: cuando un vecino mas alto lo estira, ocupa ese alto en vez de dejar un hueco
   debajo. El lienzo va fuera del flujo: el alto del cuerpo lo fijan su minimo (--alto, el de la grafica) y el
   panel, nunca la propia grafica. */
.ind-panel-body.ind-fill { position: relative; flex: 1 1 auto; margin-bottom: 0; min-height: var(--alto, 340px); }
.ind-panel-body.ind-fill > svg.ind-svg { position: absolute; left: 0; top: 0; }
.ind-axis-text { font-size: var(--fs-micro); fill: var(--muted); font-variant-numeric: tabular-nums; }
.ind-direct-label { font-size: var(--fs-micro); fill: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.ind-lane-label { font-size: var(--fs-caption); fill: var(--ink); font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
/* El nombre de una zona de fondo, en la tinta de su tono sobre su tinte; el de una guia o un umbral,
   como el eje pero con halo, porque cruza puntos; el de un cuadrante, un paso mas presente y debajo de ellos. */
.ind-band-label { font-size: var(--fs-micro); font-weight: 650; font-variant-numeric: tabular-nums; }
.ind-guide-label { font-size: var(--fs-micro); fill: var(--muted); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }
.ind-quad-label { font-size: var(--fs-caption); fill: var(--muted); font-weight: 650; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; stroke-linejoin: round; }

/* D-216: la ayuda flotante, grande y ordenada: el título a --fs-lead, las filas a --fs-body con el rótulo a la
   izquierda y la cifra a la derecha (tabulares), la cifra principal grande y, si la hay, una tabla corta por pieza. */
.ind-tip {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; min-width: 260px; max-width: min(440px, calc(100vw - 16px));
  background: var(--ink); color: #fff; border-radius: 12px; padding: 12px 14px;
  font-size: var(--fs-body); line-height: 1.45; box-shadow: 0 16px 36px rgba(20, 26, 81, 0.35);
}
.ind-tip-title { font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 700; line-height: 1.25; margin-bottom: 8px; text-wrap: balance; }
.ind-tip-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: baseline; gap: 4px 10px; font-variant-numeric: tabular-nums; padding: 2px 0; }
.ind-tip-row span { color: #C9D0F2; grid-column: 2; }
.ind-tip-row b { font-weight: 700; grid-column: 3; text-align: right; white-space: nowrap; }
.ind-tip-key { width: 10px; height: 10px; border-radius: 3px; grid-column: 1; align-self: center; }
.ind-tip-key.is-empty { background: transparent; }
.ind-tip-row.is-strong { margin-top: 4px; padding-top: 6px; border-top: 1px solid rgba(255, 255, 255, 0.2); }
.ind-tip-total { display: grid; gap: 1px; padding-bottom: 8px; margin-bottom: 8px; border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
.ind-tip-total span { color: #C9D0F2; font-size: var(--fs-small); }
.ind-tip-total b { font-family: var(--font-display); font-size: var(--fs-title); font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ind-tip-total em { font-style: normal; font-size: var(--fs-small); color: #C9D0F2; }
.ind-tip-total b.con-llave { display: inline-flex; align-items: center; gap: 8px; }
.ind-tip-total b.con-llave::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--llave); flex: none; }
.ind-tip-table { display: grid; grid-template-columns: 10px minmax(0, 1fr) repeat(var(--cols, 1), auto); align-items: baseline; gap: 6px 12px; font-variant-numeric: tabular-nums; }
.ind-tip-name { color: #fff; }
.ind-tip-cell { text-align: right; white-space: nowrap; font-weight: 650; }
.ind-tip-name.is-head, .ind-tip-cell.is-head { color: #C9D0F2; font-size: var(--fs-micro); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
/* El signo en la ayuda oscura: el mismo sentido que en la barra (azul sube, naranja baja), en tonos claros legibles. */
.ind-tip :is(.is-pos) { color: #8FC2FF; }
.ind-tip :is(.is-neg) { color: #FFB27A; }
.ind-tip-note { margin-top: 8px; color: #C9D0F2; font-size: var(--fs-small); line-height: 1.45; }

.ind-prov {
  position: absolute; z-index: 80; width: min(440px, calc(100vw - 16px));
  background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--ind-float); padding: var(--sp-4) var(--sp-5) var(--sp-5); font-size: var(--fs-small); line-height: 1.55;
}
/* Con una tabla dentro (la de una serie del inicio) es mas ancha y desplaza por dentro. */
.ind-prov.is-wide { width: min(560px, calc(100vw - 16px)); }
.ind-prov.is-wide .ind-table-wrap { max-height: min(52vh, 420px); overflow: auto; }
.ind-prov:focus-visible { box-shadow: var(--ind-float); border-radius: var(--radius); }
.ind-prov-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-2); }
/* D-216: el cuadro con la misma claridad que la ayuda: título a --fs-lead, la cifra grande y redondeada, la exacta debajo. */
.ind-prov-head { padding-bottom: var(--sp-3); border-bottom: 1px solid var(--line); margin-bottom: var(--sp-3); }
.ind-prov-head strong { display: block; font-family: var(--font-display); font-size: var(--fs-lead); font-weight: 700; line-height: 1.3; text-wrap: balance; }
.ind-prov-cifra { display: grid; gap: 1px; margin-top: 4px; }
.ind-prov-value { display: block; font-family: var(--font-display); font-size: var(--fs-title); font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; margin-top: 2px; color: var(--brand-strong); }
.ind-prov-value small { font-family: var(--font-body); font-size: var(--fs-small); font-weight: 500; color: var(--muted); letter-spacing: 0; }
.ind-prov-exacto { font-size: var(--fs-caption); color: var(--muted); font-variant-numeric: tabular-nums; }
.ind-prov-close { padding: 4px; min-height: 28px; min-width: 28px; }
.ind-prov-estado { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0 0 var(--sp-3); color: var(--muted); }
.ind-prov-estado .pill { flex: none; }
.ind-prov-list { margin: 0; display: grid; gap: var(--sp-2); }
.ind-prov-row { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--sp-3); padding-top: var(--sp-2); border-top: 1px solid var(--line); }
.ind-prov-list > .ind-prov-row:first-child { border-top: 0; padding-top: 0; }
.ind-prov-row dt { color: var(--muted); font-weight: 600; }
.ind-prov-row dd { margin: 0; overflow-wrap: anywhere; }
.ind-prov-row code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--fs-micro); background: var(--panel-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; }
.ind-prov-note { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); background: var(--attention-tint); color: var(--attention); border-radius: var(--radius-sm); }
.ind-prov-tech { margin-top: var(--sp-3); border-top: 1px solid var(--line); padding-top: var(--sp-2); }
.ind-prov-tech summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; min-height: 26px; display: flex; align-items: center; }
.ind-prov-tech[open] summary { margin-bottom: var(--sp-2); }

/* barras ordenadas */
.ind-bars-list, .ind-diverging-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.ind-bars-row { display: grid; grid-template-columns: minmax(120px, 38%) minmax(60px, 1fr) minmax(64px, var(--valor)); align-items: center; gap: var(--sp-3); width: 100%; min-height: 32px; padding: 3px 6px; margin: 0 -6px; border: none; background: none; color: inherit; text-align: left; border-radius: var(--radius-sm); font-size: var(--fs-small); }
button.ind-bars-row:hover { background: var(--panel-2); }
button.ind-bars-row.is-selected { background: var(--brand-tint); }
.ind-bars-label { display: grid; min-width: 0; line-height: 1.25; }
/* El nombre de una fila y su segunda linea pueden ocupar dos renglones a cualquier ancho: en uno se cortaba justo
   lo que distingue a dos filas (la medida de un servicio, la segunda mitad de una categoria). La pista no se mueve
   (la fila se centra): la escala comun se conserva. Solo un tercer renglon se corta, y la ayuda de la fila lo dice entero. */
.ind-bars-name, .ind-bars-sub { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; white-space: normal; overflow-wrap: break-word; }
.ind-bars-name { font-weight: 550; }
.ind-bars-sub { font-size: var(--fs-micro); color: var(--muted); }
.ind-bars-track { position: relative; height: 10px; }
.ind-bars-fill { position: absolute; left: 0; top: 0; bottom: 0; min-width: 2px; border-radius: 0 4px 4px 0; }
/* Una barra por pieza (paquete y bajo demanda), una bajo otra, con su cifra al lado. La columna de la cifra tiene
   ancho fijo: si midiera lo que su texto, cada fila tendria su propia pista y la escala dejaria de ser comun. */
.ind-bars-pair { display: grid; gap: 3px; min-width: 0; }
.ind-bars-part { display: grid; grid-template-columns: minmax(0, 1fr) 5.2em; align-items: center; gap: var(--sp-2); }
.ind-bars-part .ind-bars-track { height: 7px; }
.ind-bars-partval { font-size: var(--fs-caption); color: var(--ink); text-align: right; white-space: nowrap; line-height: 1.2; }
/* D-215: la barra apilada (paquete y bajo demanda, y otros ingresos) y, debajo, la cifra de cada tramo con su porcentaje. */
.ind-bars-pair.is-stack { gap: 4px; padding-block: 2px; }
.ind-bars-stack { display: flex; height: 100%; min-width: 2px; border-radius: 999px; overflow: hidden; gap: 2px; }
.ind-bars-seg { flex: 0 0 auto; height: 100%; min-width: 2px; }
.ind-bars-partline { display: flex; flex-wrap: wrap; gap: 2px var(--sp-3); font-size: var(--fs-caption); color: var(--ink); line-height: 1.3; }
.ind-bars-partitem { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.ind-bars-partkey { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.ind-bars-partitem .ind-bars-mark { font-weight: 650; }
.ind-bars-kids .ind-bars-part .ind-bars-track { height: 5px; }
/* D-236 y D-237, Freddy: «que la pestaña de KPI tenga el estilo de las barras de Productos y servicios» y, después,
   «el estilo que hemos dado en la parte financiera, para datos financieros y de uso, en el caso de las barras»: toda
   barra de las pantallas de grupo lleva la misma presentación: 13 px con esquina de 2 px, sobre guías verticales en
   cada cuarto de la escala y con el eje a la izquierda. Solo presentación: qué muestra cada gráfica no cambia. */
.ind-bars .ind-bars-row, .ind-diverging .ind-bars-row { min-height: 44px; }
.ind-bars .ind-bars-track { height: 13px; background: linear-gradient(to right, var(--ind-grid) 1px, transparent 1px) 0 0 / 25% 100%; box-shadow: -1px 0 0 var(--ind-axis), inset -1px 0 0 var(--ind-grid); }
.ind-bars .ind-bars-stack { border-radius: 2px; gap: 1px; }
.ind-bars .ind-bars-fill { border-radius: 2px; }
.ind-bars .ind-bars-pair.is-stack { gap: 5px; padding-block: 4px; }
.ind-bars .ind-bars-partkey { width: 12px; height: 12px; }
.ind-bars .ind-bars-kids .ind-bars-track, .ind-diverging .ind-bars-kids .ind-diverging-track { height: 9px; }
/* Las barras a los dos lados de cero (flexibilización, variaciones): el mismo grosor, esquina y guías; el eje es el cero. */
.ind-diverging .ind-diverging-track { height: 13px; background: linear-gradient(to right, var(--ind-grid) 1px, transparent 1px) 0 0 / 25% 100%; box-shadow: inset -1px 0 0 var(--ind-grid); }
.ind-diverging .ind-diverging-half.is-neg .ind-diverging-fill { border-radius: 2px 0 0 2px; }
.ind-diverging .ind-diverging-half.is-pos .ind-diverging-fill { border-radius: 0 2px 2px 0; }
/* Una barra por año dentro de la fila: la etiqueta del año, la barra y su cifra justo donde termina. */
.ind-bars-yr { display: grid; grid-template-columns: 2.6em minmax(0, 1fr); align-items: center; gap: 6px; }
.ind-bars-anio { font-size: var(--fs-micro); color: var(--muted); text-align: right; }
.ind-bars-yr .ind-bars-track { display: flex; align-items: center; gap: 6px; padding-right: 5.5em; background-origin: content-box; background-clip: content-box; }
.ind-bars-yr .ind-bars-stack { flex: none; }
.ind-bars-yr.is-antes .ind-bars-seg { opacity: 0.42; }
.ind-bars-fin { font-size: var(--fs-micro); color: var(--ink); white-space: nowrap; }
.ind-bars-pair:has(> .ind-bars-yr) > .ind-bars-partline { margin-left: calc(2.6em + 6px); }
.ind-bars-ref { position: absolute; top: -4px; bottom: -4px; width: 2px; background: var(--ink); border-radius: 1px; }
.ind-bars-value { text-align: right; font-weight: 650; white-space: nowrap; display: grid; justify-items: end; line-height: 1.2; }
/* La marca bajo el valor puede ser una frase: parte el renglon en vez de empujar la fila fuera del panel. */
.ind-bars-mark { font-size: var(--fs-micro); color: var(--muted); font-weight: 500; white-space: normal; text-wrap: balance; }
/* D-211: el porcentaje de los KPI financieros, con el tono de su signo (no es el semáforo: dice la dirección). */
.ind-bars-mark.is-pos { color: var(--ind-s1); font-weight: 650; font-size: var(--fs-small); }
.ind-bars-mark.is-neg { color: var(--ind-neg); font-weight: 650; font-size: var(--fs-small); }
.ind-plot-key { margin: 0 0 var(--sp-2); font-size: var(--fs-micro); color: var(--muted); }
.ind-plot-tools { display: flex; justify-content: flex-end; margin: 0 0 var(--sp-1); }
.ind-esc-btn { display: inline-flex; align-items: center; gap: 4px; }
/* «Abrir todo» / «Cerrar todo», sobre una lista o una rejilla cuyas filas se abren. */
.ind-open-all { font-size: var(--fs-caption); font-weight: 600; color: var(--brand-strong); }
.ind-open-all[hidden] { display: none; }
.ind-bars-refnote { margin: var(--sp-2) 0 0; font-size: var(--fs-micro); color: var(--muted); display: flex; align-items: center; gap: 6px; }
.ind-bars-refkey { width: 2px; height: 12px; background: var(--ink); display: inline-block; }
/* Paginas: «Anterior», el tramo que se ve y «Siguiente», bajo lo que paginan y
   siempre en un renglon. El control decide por su propio ancho: donde no caben
   las palabras quedan las flechas (el nombre lo sigue llevando cada boton). */
.ind-pager { container: paginas / inline-size; display: flex; align-items: center; justify-content: flex-end; gap: var(--sp-1); margin-top: var(--sp-2); }
.ind-pager-text { min-width: 88px; text-align: center; white-space: nowrap; font-size: var(--fs-caption); color: var(--muted); font-variant-numeric: tabular-nums; }
button.mini.ind-pager-btn { flex: none; min-height: 40px; }
/* En su extremo el boton se apaga pero sigue pudiendo llevar el foco (no se deshabilita). */
button.mini.ind-pager-btn[aria-disabled="true"], button.mini.ind-pager-btn[aria-disabled="true"]:hover { opacity: 0.55; border-color: var(--line); color: var(--ink); cursor: default; }
@container paginas (max-width: 320px) {
  button.mini.ind-pager-btn { justify-content: center; min-width: 40px; padding-inline: 0; }
  .ind-pager-btn > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

/* Filas que se abren. El boton de despliegue va delante del nombre y los hijos,
   debajo y sangrados; la pista de la barra no se mueve, para que padre e hijos
   compartan origen y escala. */
.has-kids li { position: relative; }
.has-kids .ind-bars-label { padding-left: calc(22px + var(--sangria, 0px)); }
.ind-bars-kids { --sangria: 14px; }
.ind-bars-kids .ind-bars-kids { --sangria: 28px; }
.ind-bars-open { position: absolute; z-index: 1; left: calc(var(--sangria, 0px) - 4px); top: 4px; display: inline-grid; place-items: center; width: 24px; height: 24px; padding: 0; border: none; background: none; border-radius: var(--radius-sm); color: var(--muted); transition: background 0.15s ease, color 0.15s ease; }
.ind-bars-open:hover { background: var(--brand-tint); color: var(--brand-strong); }
.ind-bars-open[aria-expanded="true"] { color: var(--brand-strong); }
.ind-bars-open .ind-ico { transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1); }
.ind-bars-open[aria-expanded="true"] .ind-ico { transform: rotate(90deg); }
.ind-bars-row.is-opener { cursor: pointer; }
.ind-bars-kids .ind-bars-open { top: 2px; }
.ind-bars-kids .ind-bars-row { min-height: 28px; font-size: var(--fs-caption); }
.ind-bars-kids .ind-bars-name { font-weight: 450; }
.ind-bars-kids .ind-bars-track, .ind-bars-kids .ind-diverging-track { height: 6px; }
.ind-bars-kids .ind-bars-fill, .ind-bars-kids .ind-diverging-fill { opacity: 0.65; }

/* cascada: un paso por fila. Las tres columnas (nombre, pista, importe) son de la lista y las filas las heredan,
   asi todas las barras comparten pista y origen. La pista ocupa todo el alto de su fila: los pelos que unen un
   paso con el siguiente se tocan de fila a fila sin medir nada. */
.ind-wf-list { --cero: 0%; --pasos: 1; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(132px, 42%) minmax(72px, 1fr) max-content; grid-auto-rows: minmax(34px, 1fr); column-gap: var(--sp-3); font-size: var(--fs-small); }
/* En un panel que su vecino estira, las filas se reparten el alto (hasta 56 px cada una) en vez de dejar la
   grafica arriba y un hueco debajo. */
.ind-panel-body.ind-waterfall { flex: 1 1 auto; display: flex; flex-direction: column; margin-bottom: 0; }
.ind-waterfall > .ind-wf-list { flex: 1 1 auto; max-height: calc(var(--pasos) * 56px); }
.ind-wf-row { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center; }
.ind-wf-label { display: grid; grid-template-columns: 12px minmax(0, 1fr); gap: 6px; align-items: baseline; padding-block: 6px; line-height: 1.3; }
.ind-wf-op { color: var(--muted); font-weight: 650; text-align: center; font-variant-numeric: tabular-nums; }
.ind-wf-name { font-weight: 500; overflow-wrap: break-word; text-wrap: pretty; }
.ind-wf-row.is-total .ind-wf-name, .ind-wf-row.is-total .ind-wf-op { font-weight: 650; color: var(--ink); }
.ind-wf-track { position: relative; align-self: stretch; min-height: 34px; }
.ind-wf-track::before { content: ""; position: absolute; top: 0; bottom: 0; left: var(--cero); width: 1px; background: var(--ind-axis); }
.ind-wf-fill { position: absolute; top: 50%; height: 14px; margin-top: -7px; min-width: 2px; border-radius: 2px; }
.ind-wf-link { position: absolute; width: 1px; margin-left: -0.5px; background: var(--ind-axis); }
.ind-wf-link.is-in { top: 0; bottom: 50%; }
.ind-wf-link.is-out { top: 50%; bottom: 0; }
.ind-wf-value { text-align: right; font-weight: 650; white-space: nowrap; padding-block: 6px; }
.ind-wf-row:not(.is-total) .ind-wf-value { font-weight: 550; }
@supports not (grid-template-columns: subgrid) {
  .ind-wf-row { grid-template-columns: minmax(132px, 42%) minmax(72px, 1fr) 84px; column-gap: var(--sp-3); }
}

/* divergente */
.ind-diverging-track { display: grid; grid-template-columns: 1fr 1fr; height: 10px; position: relative; }
.ind-diverging-track::after { content: ""; position: absolute; left: 50%; top: -5px; bottom: -5px; width: 1px; background: var(--ind-axis); }
.ind-diverging-half { position: relative; }
.ind-diverging-half.is-neg .ind-diverging-fill { position: absolute; right: 0; top: 0; bottom: 0; border-radius: 4px 0 0 4px; }
.ind-diverging-half.is-pos .ind-diverging-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 0 4px 4px 0; }
/* La cabecera de una divergente lleva la rejilla y el relleno de sus filas (nombre, pista, valor): sus dos rotulos
   se reparten la pista a medias y lo que los separa cae justo en el eje. */
.ind-diverging-head { display: grid; grid-template-columns: minmax(120px, 38%) minmax(60px, 1fr) minmax(64px, var(--valor)); gap: 0 var(--sp-3); width: 100%; margin: 0 -6px 2px; padding: 0 6px; font-size: var(--fs-micro); color: var(--muted); }
.ind-diverging-head-mid { display: grid; grid-template-columns: 1fr 1fr; min-width: 0; }
.ind-diverging-head .is-neg { text-align: right; padding-right: 6px; }
.ind-diverging-head .is-pos { padding-left: 6px; }

/* reparto */
.ind-share-bar { display: flex; gap: 2px; height: 14px; border-radius: 4px; overflow: clip; }
.ind-share-seg { min-width: 3px; }
.ind-share-key { list-style: none; margin: var(--sp-3) 0 0; padding: 0; display: grid; gap: 2px; }
.ind-share-item { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; align-items: center; gap: var(--sp-2); width: 100%; border: none; background: none; text-align: left; color: inherit; padding: 4px 6px; margin: 0 -6px; border-radius: var(--radius-sm); font-size: var(--fs-small); min-height: 28px; }
button.ind-share-item:hover { background: var(--panel-2); }
.ind-share-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ind-share-pct { color: var(--muted); font-size: var(--fs-caption); min-width: 52px; text-align: right; }

/* matriz */
/* Cada columna guarda un ancho legible: si no caben, la tabla se desplaza en horizontal. */
.ind-matrix { border-collapse: separate; border-spacing: 2px; width: 100%; min-width: calc(var(--corner, 190px) + var(--cols, 0) * 46px); table-layout: fixed; }
.ind-matrix th, .ind-matrix td { border: none; padding: 0; }
.ind-matrix thead th { text-transform: none; letter-spacing: 0; font-size: var(--fs-micro); font-weight: 600; color: var(--muted); padding: 0 2px 6px; text-align: center; vertical-align: bottom; white-space: normal; line-height: 1.2; }
.ind-matrix .ind-matrix-corner { width: var(--corner, 190px); text-align: left; }
/* El nombre de una fila se lee entero: parte renglon en vez de cortarse (un servicio se quedaba en «Capacidades I+D+i de los Investigador…»). */
.ind-matrix th.ind-matrix-row { text-transform: none; letter-spacing: 0; font-size: var(--fs-caption); font-weight: 550; color: var(--ink); text-align: left; padding-right: var(--sp-2); white-space: normal; overflow-wrap: break-word; line-height: 1.25; }
.ind-matrix-cell { display: grid; place-items: center; width: 100%; min-height: 30px; border: none; border-radius: 3px; font-size: var(--fs-micro); font-weight: 650; font-variant-numeric: tabular-nums; padding: 0 2px; }
.ind-matrix-cell.is-empty { background: var(--panel-2); color: var(--muted); font-weight: 400; }
button.ind-matrix-cell:hover, .ind-matrix-cell:focus-visible { outline: 2px solid var(--ink); outline-offset: 0; }
.ind-scale { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-2); font-size: var(--fs-micro); color: var(--muted); font-variant-numeric: tabular-nums; }
.ind-scale-ramp { display: inline-flex; gap: 1px; }
.ind-scale-ramp i { width: 18px; height: 8px; display: block; }
.ind-scale-ramp i:first-child { border-radius: 2px 0 0 2px; } .ind-scale-ramp i:last-child { border-radius: 0 2px 2px 0; }

/* mapa de arbol */
.ind-treemap-crumbs { margin-bottom: var(--sp-2); }
.ind-tile { cursor: pointer; outline: none; }
.ind-tile.is-leaf { cursor: default; }
.ind-tile-fill { transition: filter 0.15s ease; }
.ind-tile:hover .ind-tile-fill { filter: brightness(1.1); }
/* Foco de doble trazo: tinta por fuera y blanco por dentro, para que se vea sobre cualquier relleno. */
.ind-tile-ring { stroke: #FFFFFF; stroke-width: 2; opacity: 0; pointer-events: none; }
.ind-tile:focus-visible rect.ind-tile-fill { stroke: var(--ink); stroke-width: 2.5; }
.ind-tile:focus-visible .ind-tile-ring { opacity: 1; }
.ind-tile-name { font-size: var(--fs-caption); font-weight: 650; pointer-events: none; }
.ind-tile-value { font-size: var(--fs-micro); font-variant-numeric: tabular-nums; pointer-events: none; }

/* tabla gemela */
/* Una sola forma de avanzar: en un panel la tabla va en paginas y no se desplaza ademas por dentro (a lo
   ancho, si hace falta, si). Solo la ventana flotante, que no puede crecer, le pone alto. */
.ind-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.ind-table { font-size: var(--fs-caption); }
.ind-table thead th { position: sticky; top: 0; background: var(--panel-2); z-index: 1; }
.ind-table td, .ind-table th { padding: 6px 10px; }
.ind-table th { white-space: normal; line-height: 1.25; vertical-align: bottom; }
.ind-table tr.is-child td:not(.num) { color: var(--muted); }
.ind-table-paged { display: grid; }
/* Filas que se abren (tablas y matriz): la flecha -y el nombre, si la fila no abre ficha- es el control;
   cada nivel entra un paso y lo que cuelga de una fila se lee mas ligero que ella. */
.ind-table-lead { display: inline-flex; align-items: center; gap: var(--sp-1); min-width: 0; max-width: 100%; }
.ind-table-open { display: inline-flex; align-items: center; gap: var(--sp-1); flex: none; min-width: 24px; min-height: 24px; padding: 0 2px; margin-left: -4px; border: none; background: none; border-radius: var(--radius-sm); color: var(--muted); font-size: inherit; font-weight: inherit; text-align: left; transition: background 0.15s ease, color 0.15s ease; }
.ind-table-open > span { color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ind-table-open:not(.is-leaf):hover { background: var(--brand-tint); color: var(--brand-strong); }
.ind-table-open[aria-expanded="true"] { color: var(--brand-strong); }
.ind-table-open .ind-ico { flex: none; margin: 0 4px; transition: transform 0.18s cubic-bezier(0.22, 1, 0.36, 1); }
.ind-table-open[aria-expanded="true"] .ind-ico { transform: rotate(90deg); }
.ind-table-open.is-leaf { min-height: 0; }
.ind-table td.ind-table-first { padding-left: calc(10px + var(--nivel, 0) * var(--sp-4)); }
.ind-table tr.is-parent td { font-weight: 600; }
.ind-table tr.is-child .ind-rowlink { font-weight: 500; }
.ind-matrix.has-kids { --corner: 268px; }
.ind-matrix th.ind-matrix-row { padding-left: calc(var(--nivel, 0) * var(--sp-4)); }
/* Una cabecera de columna mas larga que su columna parte la palabra: no se monta sobre la de al lado. */
.ind-matrix thead th.ind-matrix-col { overflow-wrap: anywhere; hyphens: auto; }
.ind-matrix tr.is-child th.ind-matrix-row { font-weight: 450; }
/* D-172: la fila de totales cierra la rejilla: raya arriba, cifras en tinta y sin color de intensidad. */
.ind-matrix tr.is-total > th, .ind-matrix tr.is-total > td { border-top: 2px solid var(--line); padding-top: 4px; }
.ind-matrix tr.is-total th.ind-matrix-row { font-weight: 700; }
.ind-matrix tr.is-total .ind-matrix-cell { background: var(--panel); color: var(--ink); font-weight: 700; }
.ind-matrix tr.is-child .ind-rowlink { font-weight: 500; }
.ind-matrix th.ind-matrix-row .ind-table-lead { display: flex; }
.ind-matrix th.ind-matrix-row :is(.ind-table-open:has(> span), .ind-rowlink, .ind-table-lead > span:not(.ind-table-open)) { flex: 0 1 auto; min-width: 0; white-space: normal; overflow-wrap: break-word; text-align: left; }
.ind-matrix th.ind-matrix-row .ind-rowlink { margin: 0; padding: 2px 0; }
/* D-163 y D-164: el nombre de la categoria va dentro de su color oficial, en la cabecera; las celdas siguen en su
   unica escala de intensidad, asi el color de identidad no compite con el de la cifra. El texto toma el color que
   contrasta (blanco o tinta); en un tono medio, el color lleva el velo de tinta (`--cat` ya viene velado). */
.ind-matrix thead th.has-cat { background: var(--cat); color: var(--cat-ink); border-radius: var(--radius-xs, 4px); padding: 6px; vertical-align: middle; font-weight: 650; }
.ind-matrix thead tr.ind-matrix-groups th.ind-matrix-group { text-align: left; vertical-align: middle; color: var(--ink); font-weight: 650; padding: 6px; }
.ind-matrix thead tr.ind-matrix-groups th.ind-matrix-group.has-cat { color: var(--cat-ink); }
.ind-matrix thead th.ind-matrix-group > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: break-word; hyphens: auto; }
/* Con los servicios, cada columna lleva el nombre oficial en hasta tres renglones (entero en su ayuda y para el lector). */
.ind-matrix.is-grouped { min-width: calc(var(--corner, 190px) + var(--lead, 0px) + var(--cols, 0) * 84px); }
.ind-matrix.is-grouped thead th.ind-matrix-col { padding-top: 6px; }
.ind-matrix.is-grouped thead th.ind-matrix-col > span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* Una rejilla que se desliza de lado deja a la vista la columna de las instituciones (y la de su uso general). */
.ind-matrix th.ind-matrix-row, .ind-matrix thead .ind-matrix-corner { position: sticky; left: 0; z-index: 2; background: var(--panel); box-shadow: 0 0 0 2px var(--panel); }
/* D-164: la primera columna, el uso general de la fila con su barra, de mayor a menor dentro de cada grupo. */
.ind-matrix.has-lead { --lead: 120px; min-width: calc(var(--corner, 190px) + var(--lead) + var(--cols, 0) * 46px); }
.ind-matrix.is-grouped.has-lead { min-width: calc(var(--corner, 190px) + var(--lead) + var(--cols, 0) * 84px); }
.ind-matrix .ind-matrix-lead { width: var(--lead); position: sticky; left: calc(var(--corner, 190px) + 2px); z-index: 2; background: var(--panel); box-shadow: 0 0 0 2px var(--panel); white-space: nowrap; }
.ind-matrix thead th.ind-matrix-lead { text-align: left; vertical-align: bottom; }
.ind-matrix td.ind-matrix-lead { padding: 0 var(--sp-2) 0 2px; }
.ind-matrix-bar { display: inline-block; vertical-align: middle; width: 60px; height: 8px; border-radius: var(--radius-pill, 999px); background: var(--line); overflow: hidden; }
.ind-matrix-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--brand); }
.ind-matrix tr.is-parent .ind-matrix-bar > i { background: var(--ink); }
.ind-matrix-num { display: inline-block; vertical-align: middle; margin-left: var(--sp-2); font-size: var(--fs-micro); font-weight: 650; font-variant-numeric: tabular-nums; color: var(--ink); }
.ind-matrix td.ind-matrix-lead.is-empty .ind-matrix-num { color: var(--muted); font-weight: 400; }
/* D-165: el uso general que trae el contrato vigente de la institucion: la cifra se subraya con puntos, como un termino. */
.ind-matrix td.ind-matrix-lead.has-detail { cursor: help; }
.ind-matrix td.ind-matrix-lead.has-detail .ind-matrix-num { text-decoration: underline dotted; text-underline-offset: 3px; text-decoration-color: var(--muted); }
/* Una celda que se abre al pulsarla (Fondos Connect) lleva una esquina doblada, sin otro color que el de su escala. */
.ind-matrix-cell.has-desglose { position: relative; cursor: pointer; }
.ind-matrix-cell.has-desglose::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid; border-width: 0 7px 7px 0; border-color: transparent currentColor transparent transparent; opacity: .55; }
/* D-165: el paquete de una institucion, dibujado sobre la rejilla del uso de lo contratado. Ancho de cada columna:
   lo que pesa la categoria en el costo del paquete; alto: lo que usa. El color oficial solo identifica. */
.ind-paquete { margin: 0 0 var(--sp-5); }
.ind-paquete-titulo { font-size: var(--fs-small); font-weight: 650; color: var(--ink); }
.ind-paquete-barra { display: flex; gap: 2px; height: 64px; margin-top: var(--sp-2); }
.ind-paquete-barra:focus-visible { outline: 2px solid var(--brand); outline-offset: 4px; border-radius: 2px; }
.ind-paquete-col { position: relative; min-width: 3px; background: var(--cat); border-radius: 3px; }
.ind-paquete-col:hover, .ind-paquete-col.is-senalada { outline: 2px solid var(--ink); outline-offset: 1px; z-index: 1; }
.ind-paquete-uso { position: absolute; top: 50%; left: 0; right: 0; transform: translateY(-50%); text-align: center; font-size: var(--fs-caption); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--cat-ink); white-space: nowrap; }
.ind-paquete-rotulos { display: flex; gap: 2px; margin-top: 6px; }
.ind-paquete-rotulo { min-width: 3px; overflow: hidden; display: flex; flex-direction: column; gap: 1px; font-size: var(--fs-micro); line-height: 1.25; padding-right: 2px; }
.ind-paquete-nombre { color: var(--ink); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ind-paquete-nombre.is-corto { display: none; }
.ind-paquete-rotulo.is-estrecho > * { visibility: hidden; }
.ind-paquete-explica { margin: var(--sp-3) 0 0; font-size: var(--fs-caption); color: var(--muted); max-width: 75ch; }
@media (max-width: 640px) {
  .ind-paquete-barra { height: 56px; }
  .ind-paquete-rotulo:not(.is-ancho) > * { visibility: hidden; }
  .ind-paquete-uso.es-angosta { display: none; }
  .ind-paquete-nombre { display: none; }
  .ind-paquete-nombre.is-corto { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
/* Las secciones del detalle de una celda (por fondo, por convocatoria). */
.ind-prov-sec { margin: var(--sp-3) 0 var(--sp-2); font-size: var(--fs-caption); font-weight: 700; color: var(--ink); }
.ind-prov.is-wide .ind-prov-row { grid-template-columns: minmax(120px, 34%) minmax(0, 1fr); }

.ind-bullet { width: 100%; height: 22px; display: block; }

/* ------------------------------------------------------ ficha de detalle */
/* Institucion o servicio: una hoja lateral, no un modal. La pagina sigue viva
   detras y Esc la cierra devolviendo el foco. */
.ind-sheet {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(560px, 100vw);
  background: var(--panel); border-left: 1px solid var(--line); box-shadow: -24px 0 60px rgba(20, 26, 81, 0.18);
  display: grid; grid-template-rows: auto auto minmax(0, 1fr);   /* cabecera, indice y lo que se desplaza */
  transform: translateX(100%); transition: transform 0.26s cubic-bezier(0.22, 1, 0.36, 1); visibility: hidden;
}
.ind-sheet.is-open { transform: none; visibility: visible; }
.ind-sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-4) var(--sp-5) var(--sp-3); border-bottom: 1px solid var(--line); }
.ind-sheet-head h3 { margin: 0; font-size: var(--fs-lead); font-weight: 650; letter-spacing: -0.01em; line-height: 1.2; text-wrap: balance; }
.ind-sheet-kind { font-size: var(--fs-caption); color: var(--muted); margin: 2px 0 0; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ind-sheet-body { grid-row: 3; overflow-y: auto; padding: var(--sp-4) var(--sp-5) var(--sp-6); display: grid; gap: var(--sp-5); align-content: start; }
/* El indice de la ficha: un boton por bloque, entre la cabecera y lo que se desplaza (por eso no se pierde al
   bajar). En ancho las pastillas parten renglon; en un telefono van en un solo renglon que se desliza. */
.ind-sheet-toc { grid-row: 2; padding: var(--sp-2) var(--sp-5); border-bottom: 1px solid var(--line); background: var(--panel-2); }
.ind-sheet-toc[hidden] { display: none; }
.ind-sheet-toc ul { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.ind-sheet-toc-item { border: 1px solid transparent; background: none; border-radius: var(--radius-pill); padding: 3px 9px; min-height: 28px; font-size: var(--fs-caption); font-weight: 600; color: var(--muted); text-align: left; transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.ind-sheet-toc-item:hover { background: var(--brand-tint); color: var(--brand-strong); }
.ind-sheet-toc-item[aria-current="true"] { background: var(--panel); border-color: var(--brand-line); color: var(--brand-strong); }
.ind-sheet-sec h4:focus-visible { box-shadow: none; outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 2px; }
.ind-sheet-body:focus-visible { box-shadow: none; }
.ind-sheet-sec h4 { margin: 0 0 var(--sp-2); font-size: var(--fs-small); font-weight: 700; }
.ind-sheet-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--sp-3) var(--sp-4); }
.ind-kv { margin: 0; display: grid; gap: 6px; font-size: var(--fs-small); }
.ind-kv > div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: var(--sp-2); }
.ind-kv dt { color: var(--muted); }
.ind-kv dd { margin: 0; font-weight: 550; overflow-wrap: anywhere; }
.ind-link { color: var(--brand-strong); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.ind-link:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------- estados vacios */
.ind-empty { display: grid; gap: 4px; padding: var(--sp-5) var(--sp-4); text-align: left; border: 1px dashed var(--inactive-line); border-radius: var(--radius-sm); background: var(--inactive-tint); color: var(--inactive); font-size: var(--fs-small); }
.ind-empty strong { color: var(--ink); font-weight: 650; }
.ind-empty-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-2); }
.ind-grid > .ind-empty { grid-column: 1 / -1; }
.ind-sheet-internal { margin-left: var(--sp-2); font-size: var(--fs-micro); vertical-align: 1px; }
.ind-absent { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--sp-2); }
.ind-absent li { display: grid; grid-template-columns: auto 1fr; gap: var(--sp-2); align-items: start; font-size: var(--fs-small); line-height: 1.45; }
.ind-absent li .pill { margin-top: 1px; }
.ind-error { padding: var(--sp-4); border: 1px solid var(--risk-line); background: var(--risk-tint); color: var(--risk); border-radius: var(--radius); font-size: var(--fs-small); display: flex; gap: var(--sp-3); align-items: center; justify-content: space-between; flex-wrap: wrap; }
.ind-skeleton { border-radius: var(--radius); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%) 0 0 / 300% 100%; border: 1px solid var(--line); animation: ind-shimmer 1.4s ease-in-out infinite; }
@keyframes ind-shimmer { to { background-position: -150% 0; } }
.ind.is-stale .ind-view { opacity: 0.55; transition: opacity 0.15s ease; }
/* Un ambito que no se pudo pintar: la vista lo dice, sin cifras, y ofrece la salida. */
.ind-error-actions { display: inline-flex; flex-wrap: wrap; gap: var(--sp-2); }
/* La ficha no se acota: con un ambito elegido en el tablero, lo dice una vez. */
.ind-sheet-ambito { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--muted); font-size: var(--fs-caption); line-height: 1.45; }
.ind-sheet-ambito .ind-ico { flex: none; margin-top: 2px; }

/* lista de controles y dudas (calidad del dato) */
.ind-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.ind-checks li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: var(--sp-3); align-items: start; padding: var(--sp-2) 0; border-top: 1px solid var(--line); font-size: var(--fs-small); line-height: 1.45; }
.ind-checks li:first-child { border-top: none; }
.ind-checks .ind-check-main strong { font-weight: 600; display: block; }
.ind-checks .ind-check-main span { color: var(--muted); font-size: var(--fs-caption); }
.ind-checks .ind-check-side { font-size: var(--fs-caption); color: var(--muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* ------------------------------------------- piezas de las vistas de grupo */
/* Secciones de un grupo: pestanas con cifra. La elegida se marca con el borde y
   el fondo de marca, no con una raya de color. */
.ind-subnav { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-2); margin: 0 0 var(--sp-4); }
.ind-tabcard { display: grid; align-content: start; justify-items: start; gap: 2px; min-width: 0; min-height: 84px; padding: var(--sp-3) var(--sp-4); background: var(--ind-vidrio); border: 1px solid var(--ind-vidrio-filo); border-radius: var(--radius); box-shadow: var(--ind-sombra-color); color: var(--ink); text-align: left; transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease; }
.ind-tabcard:hover { border-color: var(--brand); }
/* La elegida: azul noche con su cifra en blanco y su nombre en celeste. */
.ind-tabcard[aria-pressed="true"] { background: radial-gradient(90% 120% at 100% 0%, rgba(79, 192, 228, 0.28), transparent 62%), linear-gradient(120deg, var(--ind-deep), var(--cedia-azul)); border-color: var(--ind-deep); color: var(--ind-on-deep); box-shadow: 0 14px 30px -10px rgba(1, 51, 159, 0.6); }
.ind-tabcard-name { display: flex; align-items: center; flex-wrap: wrap; gap: 4px var(--sp-2); font-size: var(--fs-caption); font-weight: 650; color: var(--muted); }
.ind-tabcard[aria-pressed="true"] .ind-tabcard-name { color: var(--ind-glow); }
.ind-tabcard[aria-pressed="true"] .ind-tabcard-value small, .ind-tabcard[aria-pressed="true"] .ind-tabcard-label { color: var(--ind-on-deep-muted); }
.ind-tabcard[aria-pressed="true"]:focus-visible { box-shadow: 0 0 0 2px var(--panel), 0 0 0 4px var(--ind-glow); }
.ind-tabcard-name .pill { font-size: var(--fs-micro); padding: 0 7px; }
.ind-tabcard-value { display: flex; align-items: baseline; gap: 4px; font-variant-numeric: tabular-nums; line-height: 1.15; }
.ind-tabcard-value b { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.015em; }
.ind-tabcard-value small { font-size: var(--fs-micro); font-weight: 600; color: var(--muted); }
.ind-tabcard-value.is-empty b { font-size: var(--fs-small); font-weight: 600; color: var(--muted); letter-spacing: 0; }
.ind-tabcard-label { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; font-size: var(--fs-micro); color: var(--muted); line-height: 1.35; }
.ind-tabcard-label .pill { font-size: var(--fs-micro); padding: 0 7px; }
.ind-internal { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0 0 var(--sp-3); font-size: var(--fs-caption); color: var(--muted); }
.ind-figs-host { display: grid; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.ind-figs-host .ind-figs { margin-bottom: 0; }
button.mini.ind-toggle[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand-strong); border-color: var(--brand); }
/* La regla va pegada arriba: lo que recibe el foco no puede quedar debajo de ella. */
html:has(#tab-indicadores.active) { scroll-padding-top: 128px; }
/* Lo que una seccion dice antes de sus cifras (glosario minimo) y despues (su lectura). */
.ind-sec-note { margin: 0; font-size: var(--fs-caption); color: var(--muted); line-height: 1.5; max-width: 96ch; }
.ind-reading { display: flex; align-items: flex-start; gap: var(--sp-2); margin: 0; padding: var(--sp-3) var(--sp-4); background: var(--brand-tint); border-radius: var(--radius); color: var(--ink); font-size: var(--fs-small); font-weight: 550; line-height: 1.45; }
.ind-reading .ind-ico { flex: none; margin-top: 4px; color: var(--brand); }
/* Con un ambito elegido, la nota de la seccion y su frase llevan la marca de toda la red. */
.ind-reading .ind-alcance { flex: none; margin-top: 1px; }
.ind-reading .ind-alcance .ind-ico { margin-top: 0; color: inherit; }
.ind-sec-note .ind-alcance { margin-right: var(--sp-2); vertical-align: 1px; }
.ind-check-tech { margin-top: 2px; font-size: var(--fs-micro); color: var(--muted); }
.ind-check-tech summary { cursor: pointer; color: var(--brand-strong); font-weight: 600; min-height: 24px; display: inline-flex; align-items: center; }
.ind-check-tech span { display: block; overflow-wrap: anywhere; line-height: 1.5; }
.ind-figs-year { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: 0; font-size: var(--fs-caption); color: var(--muted); }
.ind-figs-host:empty { display: none; }

/* valor contra referencia (presupuesto, contratado, meta) */
.ind-goals { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--sp-1); }
.ind-goal { display: grid; grid-template-columns: minmax(120px, 34%) minmax(80px, 1fr) minmax(150px, auto); align-items: center; gap: var(--sp-3); min-height: 36px; font-size: var(--fs-small); }
/* En esta lista corta (sin paginas) el nombre y su segunda linea se leen enteros: la segunda linea es a veces una frase. */
.ind-goal :is(.ind-bars-name, .ind-bars-sub) { display: block; -webkit-line-clamp: none; line-clamp: none; overflow: visible; }
.ind-goal-bullet { min-width: 0; }
.ind-goal-nums { display: flex; align-items: baseline; justify-content: flex-end; gap: 4px 6px; flex-wrap: wrap; text-align: right; }
.ind-goal-nums b { font-weight: 650; }
.ind-goal-nums span { color: var(--muted); font-size: var(--fs-caption); }
.ind-goal-nums .ind-goal-pct { color: var(--ink); font-weight: 650; font-size: var(--fs-caption); }
.ind-goal-note { font-size: var(--fs-caption); color: var(--muted); padding: 0 0 var(--sp-1); }
.ind-bars-refnote .k-bar { width: 18px; height: 6px; border-radius: 3px; background: var(--brand); display: inline-block; }
.ind-bars-refnote .ind-bars-refkey { margin-left: var(--sp-2); }

/* centinelas: importes que cierran la suma pero no son una categoria ni una institucion */
.ind-bars-list li:has(.is-sentinel), .ind-diverging-list li:has(.is-sentinel) { border-top: 1px dashed var(--inactive-line); margin-top: var(--sp-1); padding-top: var(--sp-1); }
.ind-bars-row.is-sentinel .ind-bars-name { color: var(--inactive); font-style: italic; font-weight: 500; }

.ind-rowlink { border: none; background: none; padding: 2px 4px; margin: -2px -4px; border-radius: var(--radius-sm); color: var(--brand-strong); font: inherit; font-weight: 600; text-align: left; min-height: 24px; }
.ind-rowlink:hover { text-decoration: underline; text-underline-offset: 3px; }

/* un panel dentro de la ficha no es otra tarjeta: va plano */
.ind-panel.is-flat { border: none; padding: 0; border-radius: 0; background: none; }
.ind-panel.is-flat .ind-panel-head { margin-bottom: var(--sp-2); }
.ind-panel.is-flat .ind-panel-title { font-size: var(--fs-small); font-weight: 600; color: var(--muted); }
.ind-sheet-sec { display: grid; gap: var(--sp-3); }
.ind-sheet-sec h4 { margin: 0; padding-bottom: var(--sp-1); border-bottom: 1px solid var(--line); }
.ind-sheet-kind .pill { font-size: var(--fs-micro); }

/* ------------------------------------------------------ exportar y ampliar */
/* La ventana de exportar: tres renglones, cada uno dice que entrega. */
.ind-export-what { display: block; margin-top: 2px; font-size: var(--fs-caption); font-weight: 500; color: var(--muted); }
.ind-export-list { display: grid; gap: 2px; margin: 0 calc(var(--sp-2) * -1); }
.ind-export-item { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: var(--sp-3); width: 100%; min-height: 44px; padding: var(--sp-2); border: none; background: none; border-radius: var(--radius-sm); color: var(--ink); text-align: left; transition: background 0.15s ease; }
.ind-export-item:hover { background: var(--brand-tint); }
.ind-export-item .ind-ico { color: var(--brand); }
.ind-export-item strong { display: block; font-size: var(--fs-small); font-weight: 650; }
.ind-export-item small { display: block; font-size: var(--fs-micro); color: var(--muted); line-height: 1.35; }
.ind-export-internal { display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-1) var(--sp-2); margin: var(--sp-3) 0 0; color: var(--muted); }
.ind-export-internal .pill { font-size: var(--fs-micro); }
.ind-export-status { margin: var(--sp-3) 0 0; padding: var(--sp-2) var(--sp-3); background: var(--panel-2); border-radius: var(--radius-sm); color: var(--ink); }
.ind-export-status:empty { display: none; }

/* Un panel ampliado ocupa la pantalla: fondo opaco y, si no cabe, desplazable.
   Ampliar amplia la grafica entera en proporcion (Freddy, 14/11/2026): lo de
   dentro se maqueta con el ancho que tenia en la pagina y crece con `zoom`
   (--amp-k, que calcula el panel para que quepa en la pantalla); --amp-lado lo
   centra. La ayuda y los cuadros que se abren (llevan .ind) no se amplian: se
   anclan a lo que se ve. */
.ind-panel:fullscreen { background: var(--panel); border: none; border-radius: 0; box-shadow: none; overflow: auto; padding: var(--sp-5) var(--amp-lado, var(--sp-5)); }
.ind-panel:fullscreen > :not(.ind) { zoom: var(--amp-k, 1); }
/* Lo que el panel ampliado dice de si mismo (ano, corte y universo): la regla y la barra del ambito ya no se ven. */
.ind-panel-context { display: none; margin: var(--sp-1) 0 0; font-size: var(--fs-caption); font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ind-panel:fullscreen .ind-panel-context:not([hidden]) { display: block; }
/* Ampliado, lo que se desplaza es el cuerpo (o la tabla), no el panel: la
   cabecera, con el boton de volver, y la nota se quedan en su sitio, y el
   control de paginas, pegado al pie de lo que pagina, siempre a la vista. El
   margen lateral es para lo que una grafica deja asomar (el rotulo del ultimo
   punto de un eje): se sigue viendo y no trae desplazamiento de lado. */
.ind-panel:fullscreen .ind-panel-body, .ind-panel:fullscreen .ind-panel-table { flex: 1 1 auto; min-height: 240px; margin: 0 calc(-1 * var(--sp-4)); padding-inline: var(--sp-4); overflow-y: auto; }
.ind-panel:fullscreen .ind-pager { position: sticky; bottom: 0; z-index: 2; padding-block: var(--sp-2); background: var(--panel); }
.ind-panel:fullscreen .ind-table-wrap { max-height: none; }

/* Con el dedo, los controles del panel miden 40 px. Va aqui, tras las reglas que
   fijan su alto en reposo: antes de ellas, la fila de barras y el enlace de la
   tabla se quedaban en 32 y 24 px. */
@media (pointer: coarse) {
  .ind-amb { grid-auto-rows: 42px; }
  .ind-amb-x { width: 40px; }
  .ind-amb-link, .ind-amb-clear, .ind-amb-opt, .ind-amb-grupo { min-height: 40px; }
  .ind-amb-link, .ind-amb-clear { padding-inline: var(--sp-2); }
  .ind-prov-close { min-width: 40px; min-height: 40px; }
  button.mini.ind-tool, .ind-panel-tools .ind-prov-btn, .ind-panel-tools button.mini.ind-toggle { min-width: 40px; }
  .ind-bars-row, .ind-rowlink, .ind-seg button, .ind-bars-kids .ind-bars-row, .ind-legend-btn, .ind-legend-all, .ind-table-open:not(.is-leaf) { min-height: 40px; }
  .ind-table-open:not(.is-leaf) { min-width: 40px; justify-content: center; }
  .ind-table-open:not(.is-leaf):has(> span) { justify-content: flex-start; }
  .ind-bars-open, .ind-bars-kids .ind-bars-open { width: 40px; height: 40px; top: 0; left: calc(var(--sangria, 0px) - 10px); }
  .has-kids .ind-bars-label { padding-left: calc(32px + var(--sangria, 0px)); }
}
/* Los controles de un grupo, de un panel y de la ficha dan al dedo 44 px (--ind-dedo). Vale con puntero grueso y
   tambien en una pantalla de telefono, donde el dedo es lo que hay aunque el navegador diga otra cosa. Va tras
   las reglas de arriba (que dejaban 40) y solo cambia tamanos: nada se mueve de sitio. La regla de tiempo y la
   barra del ambito conservan los suyos. */
@media (pointer: coarse), (max-width: 640px) {
  .ind-prov-btn, .ind-crumb, .ind-bars-row, .ind-bars-kids .ind-bars-row, .ind-rowlink, .ind-seg button, .ind-legend-btn, .ind-legend-all, .ind-legend.is-dense .ind-legend-btn, .ind-table-open:not(.is-leaf), button.ind-matrix-cell, button.mini.ind-pager-btn, button.mini.ind-esc-btn, button.mini.ind-open-all, .ind-panel-bar select, .ind-sheet-toc-item { min-height: var(--ind-dedo); }
  .ind-prov-close, button.mini.ind-sheet-close, button.mini.ind-tool, .ind-panel-tools .ind-prov-btn, .ind-panel-tools button.mini.ind-toggle { min-width: var(--ind-dedo); min-height: var(--ind-dedo); }
  .ind-mes, .ind-mes-chip, .ind-per-atajo, .ind-per-anio-btn { min-height: var(--ind-dedo); }
  .ind-mes-paso { width: var(--ind-dedo); height: var(--ind-dedo); }
  .ind-table-open:not(.is-leaf) { min-width: var(--ind-dedo); justify-content: center; }
  .ind-table-open:not(.is-leaf):has(> span) { justify-content: flex-start; }
  .ind-bars-open, .ind-bars-kids .ind-bars-open { width: var(--ind-dedo); height: var(--ind-dedo); top: 0; left: calc(var(--sangria, 0px) - 12px); }
  .has-kids .ind-bars-label { padding-left: calc(34px + var(--sangria, 0px)); }
  button.mini.ind-pager-btn { min-width: var(--ind-dedo); }
  /* «Leer la nota completa» va en linea con el texto: su area crece sin mover el parrafo. */
  .ind-note-more::after { content: ""; position: absolute; inset: -14px -8px; }
}

@container page (max-width: 640px) {
  .ind-goal { grid-template-columns: minmax(0, 1fr) auto; }
  .ind-goal-bullet { grid-column: 1 / -1; order: 3; }
}

/* ---------------------------------------------------------- adaptacion */
/* Bajo 980 px de contenido la regla guarda la columna del riel (la serie del
   inicio baja debajo de sus cifras: indicadores-inicio.css, con el mismo corte),
   asi su eje y el de las series siguen midiendo lo mismo. */
@container page (max-width: 979px) {
  .ind-ruler { grid-template-columns: var(--ind-rail-w) minmax(0, 1fr); }
  .ind-ruler-side { grid-column: 1 / -1; border-right: none; border-bottom: 1px solid var(--ind-deep-line); }
  .ind-ruler-axis { grid-column: 2; }
  /* El lado ocupa todo el ancho: los dos selectores del ambito bajan a su fila, uno junto al otro. */
  .ind-ruler-side.con-ambito { grid-template-columns: auto minmax(0, 1fr) auto; }
  .ind-ruler-side.con-ambito .ind-ruler-state { grid-column: 2 / -1; }
  .ind-ruler-side.con-ambito .ind-ruler-tools { grid-column: 3; grid-row: 1; }
  .ind-amb { grid-column: 1 / -1; grid-row: 3; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); margin-top: var(--sp-2); padding-left: 0; border-left: none; }
  /* D-195: el botón del periodo, debajo de los selectores del ámbito. */
  .ind-ruler:not(.is-inicio) .ind-ruler-side.con-ambito .ind-mes-grupo { grid-row: 4; }
}
@container page (max-width: 640px) {
  .ind-ruler { position: relative; grid-template-columns: minmax(0, 1fr); }
  .ind-ruler-axis { grid-column: 1; }
  .ind-ruler-side { padding: var(--sp-3); }
  /* En un telefono, un selector por renglon y a la medida del dedo. */
  .ind-amb { grid-template-columns: minmax(0, 1fr); grid-auto-rows: 42px; }
  .ind-amb-x { width: 40px; }
  .ind-amb-nota { padding-inline: var(--sp-3); }
  .ind-amb-nota-actions { margin-left: 0; }
  .ind-amb-link, .ind-amb-clear { min-height: 40px; }
  .ind-bars-row { grid-template-columns: minmax(96px, 44%) minmax(40px, 1fr) minmax(56px, var(--valor)); gap: var(--sp-2); }
  /* Con una barra por modalidad, el nombre va en su renglon y las barras toman el ancho: en 40 px, con la cifra de
     cada una al lado, no quedaba barra. */
  .ind-bars-row:has(> .ind-bars-pair) { grid-template-columns: minmax(0, 1fr) minmax(56px, var(--valor)); row-gap: 2px; }
  .ind-bars-row:has(> .ind-bars-pair) > .ind-bars-label { grid-column: 1 / -1; }
  .ind-diverging-head { grid-template-columns: minmax(96px, 44%) minmax(40px, 1fr) minmax(56px, var(--valor)); gap: 0 var(--sp-2); }
  /* En un telefono, con la sangria de las filas que se abren, una palabra larga puede no caber en su columna: se parte. */
  .ind-bars-name { overflow-wrap: anywhere; }
  /* Y la frase bajo un valor parte el renglon antes: como la columna del valor es comun, una sola frase larga dejaba sin barra a todas las filas. */
  .ind-bars-mark { max-width: 14ch; }
  .ind-panel { padding: var(--sp-3); }
  /* En un telefono ampliar no da mas sitio: no se ofrece. Ya ampliado, el boton se queda para poder volver. */
  .ind-panel-tools .ind-tool-amp[aria-pressed="false"] { display: none; }
  .ind-figs > .ind-cifra { padding: var(--sp-3); }
  .ind-kv > div { grid-template-columns: 112px minmax(0, 1fr); }
  .ind-matrix { --corner: 120px; }
  /* En el telefono, el uso general va solo con su cifra: la barra no cabe junto a la columna fija. */
  .ind-matrix.has-lead { --lead: 56px; }
  .ind-matrix-bar { display: none; }
  .ind-matrix-num { margin-left: 0; }
  .ind-matrix.has-kids { --corner: 156px; }
  /* Una lista en una pantalla estrecha: lo que va al lado baja debajo de su elemento y puede partir el renglon. */
  .ind-checks li { grid-template-columns: auto minmax(0, 1fr); }
  .ind-checks .ind-check-side { grid-column: 2; text-align: left; white-space: normal; }
  .ind-head h2 { font-size: var(--fs-lead); }
  .ind-head-side { flex-wrap: wrap; justify-content: flex-start; margin-left: 0; }
  .ind-search { flex: 1 1 100%; }
  .ind-search-list { min-width: 0; }
}

/* ------------------------------------------------------- mientras carga */
/* Hasta que llega el resumen, la regla y el lado de la cabecera estan vacios y la
   vista solo lleva su esqueleto. Se les reserva el alto que tendran pintados, para
   que al llegar no empujen hacia abajo lo que ya se ve (CLS, D-039). Solo mientras
   esta el esqueleto: un aviso de error o de almacen vacio no deja un hueco. Son los
   altos del inicio pintado, con los mismos cortes de arriba; si cambian, el salto
   vuelve y lo mide app/tests/bsc_rendimiento_checks.mjs. En una fila (desde 980 px
   de pagina) la regla mide lo que su eje (indicadores-inicio.css). */
.ind:has(> .ind-view > .ind-skeleton) > #ind-ruler:empty { min-height: calc(68px + var(--ind-v) * 4); }
/* El lado de la regla ocupa su fila sobre el eje. El de la cabecera baja bajo el
   titulo y se reserva neto: al pintar el inicio se va la frase bajo el titulo (20 px). */
/* D-198: sin las pastillas de años ni el sello en regla, la regla del inicio es una sola fila y la cabecera, el buscador. */
@container page (max-width: 979px) {
  .ind:has(> .ind-view > .ind-skeleton) > #ind-ruler:empty { min-height: 46px; }
  .ind:has(> .ind-view > .ind-skeleton) #ind-head-side:empty { min-height: 32px; }
}
/* Con el dedo, los botones y los selectores miden 44 px. */
@media (pointer: coarse) {
  @container page (max-width: 979px) {
    .ind:has(> .ind-view > .ind-skeleton) > #ind-ruler:empty { min-height: 54px; }
    .ind:has(> .ind-view > .ind-skeleton) #ind-head-side:empty { min-height: 44px; }
  }
}
/* En un telefono, los dos selectores del ambito van uno por renglon y el buscador y el sello tambien. */
@container page (max-width: 640px) {
  .ind:has(> .ind-view > .ind-skeleton) > #ind-ruler:empty { min-height: 134px; }
  .ind:has(> .ind-view > .ind-skeleton) #ind-head-side:empty { min-height: 44px; }
}
@media (max-width: 700px) {
  /* Las listas del ambito cuelgan de la pagina, no del contenedor del tablero: en un telefono se miden con la ventana. */
  .ind-amb-opt, .ind-amb-grupo, .ind-prov .ind-amb-link { min-height: 40px; }
  .ind-amb-pop .ind-prov-close { min-width: 40px; min-height: 40px; }
  .ind-sheet { width: 100vw; border-left: none; }
  .ind-sheet-head, .ind-sheet-body { padding-inline: var(--sp-4); }
  .ind-sheet-toc { padding-inline: var(--sp-4); overflow-x: auto; scrollbar-width: none; }
  .ind-sheet-toc ul { flex-wrap: nowrap; }
  .ind-sheet-toc-item { white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
  .ind-skeleton, .ind-ruler.is-busy::after { animation: none; }
  .ind-amb-slot, .ind-amb-caret, .ind-amb-x, .ind-amb-link, .ind-amb-clear { transition: none; }
  .ind-sheet, .ind-bars-open, .ind-bars-open .ind-ico, .ind-seg button, .ind-export-item, .ind-legend-btn, .ind-table-open, .ind-table-open .ind-ico, .ind-sheet-toc-item { transition: none; }
}
@media (forced-colors: active) {
  .ind-bars-fill, .ind-share-seg, .ind-legend-key, .ind-diverging-fill, .ind-avance-fill, .ind-wf-fill { forced-color-adjust: none; }
  .ind-avance-track { border: 1px solid CanvasText; }
  .ind-ruler { border: 1px solid CanvasText; }
}

/* D-197: la franja que resume una gráfica (cupo disponible, consumido y saldo; ingreso y crecimiento) y su avance. */
.ind-resumen { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--sp-2) var(--sp-4); margin: 0 0 var(--sp-3); padding: var(--sp-3) var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius); background: var(--ind-vidrio); }
.ind-resumen-item { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ind-resumen-etiqueta { font-size: var(--fs-caption); color: var(--muted); }
.ind-resumen-valor { font-size: var(--fs-lead); font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ind-avance { grid-column: 1 / -1; display: flex; align-items: center; gap: var(--sp-3); }
.ind-avance-track { flex: 1 1 auto; height: 10px; overflow: hidden; border-radius: var(--radius-pill); background: var(--brand-soft, rgba(1, 51, 159, 0.1)); }
.ind-avance-fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--brand); transition: width 700ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.ind-avance-texto { font-size: var(--fs-caption); font-weight: 600; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .ind-avance-fill { transition: none; } }
