/* =========================================================================
   Sección "Temarios" — Ejército Ecuatoriano
   Directorio de estudio: especialidad → subárea → tema, con enlaces a la
   bibliografía oficial. Sin cuestionarios, sin gamificación, sin backend.
   Paleta: tokens oficiales ya migrados en el sitio (manual de identidad 2013)
   ========================================================================= */
#tmr{
  --rojo-institucional:#CF0A2C;
  --gris-institucional:#84898F;
  --verde-institucional:#42783C;
  --azul-institucional:#0068AD;
  /* Dorado del escudo del Ejército (heráldica oficial, #E5B822): el manual
     gráfico de 2013 no define amarillo/dorado a propósito (lo deja como
     "color funcional", no de marca — ver linea-grafica-y-secciones.md), así
     que aquí se usa con ese mismo criterio: nunca como color de marca
     (fondos, botones principales), solo como acento puntual de LOGRO/
     distinción — medallas y vistas "completado", el mismo papel que ya
     tiene el dorado en la heráldica militar real. */
  --dorado-escudo:#E5B822; --dorado-escudo-hover:#C79A13; --dorado-soft:#FBF2D9;
  --ink:#111; --ink-2:#1d1d1f;
  --red:#CF0A2C; --red-hover:#A80824; --red-soft:#FAE7EA;
  --azul-soft:#EBF3F8; --azul-2:#00538A;
  --verde-soft:#E5ECE4;
  --gris-soft:#EBECED;
  --paper:#fff; --mist:#e4e6eb; --mist-2:#f3f4f6; --mist-3:#eceef2;
  --line:#d7dae0; --line-strong:#bfc4cd; --muted:#5f6670; --text-2:#3d434d;
  --radius:14px; --shadow:0 2px 6px rgba(17,17,17,.08), 0 12px 28px rgba(17,17,17,.10);
  font-family:"Myriad Pro","Segoe UI",Arial,Helvetica,sans-serif;
  color:var(--ink-2);
  background:var(--paper);
  max-width:1180px;margin:0 auto;padding:0 18px 64px;
}
#tmr *{box-sizing:border-box;}
#tmr a{color:var(--azul-institucional);}
#tmr h1,#tmr h2,#tmr h3{font-family:"Franklin Gothic Demi","Arial Black",Arial,sans-serif;color:var(--ink);margin:0 0 6px;}
#tmr .tmr-oculto{display:none !important;}
#tmr svg{display:block;}
#tmr .tmr-ic{width:1em;height:1em;stroke:currentColor;fill:none;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto;}

/* ---------- Cabecera ---------- */
#tmr .tmr-hero{
  position:relative;border-radius:var(--radius);overflow:hidden;
  background:linear-gradient(135deg,var(--ink) 0%,#2a2a2d 55%,var(--red) 160%);
  color:#fff;padding:34px 28px;margin:22px 0 20px;
  box-shadow:var(--shadow);
}
#tmr .tmr-hero h1{color:#fff;font-size:28px;display:flex;align-items:center;gap:12px;}
#tmr .tmr-hero h1 .tmr-ic{width:30px;height:30px;}
#tmr .tmr-hero p{color:#e7e7ea;max-width:680px;margin:6px 0 0;line-height:1.5;}

/* Mini-resumen del hero: 4 números clave de un vistazo */
#tmr .tmr-hero-stats{display:flex;flex-wrap:wrap;gap:22px;margin:18px 0 4px;position:relative;z-index:1;}
#tmr .tmr-stat{display:flex;flex-direction:column;gap:1px;}
#tmr .tmr-stat b{font-size:20px;font-weight:800;color:#fff;line-height:1.1;}
#tmr .tmr-stat span{font-size:11px;color:#c9c9ce;text-transform:uppercase;letter-spacing:.03em;}
#tmr .tmr-hero-acciones{margin-top:16px;position:relative;z-index:1;}

/* "Continuar donde quedé": aparece solo si hay un perfil guardado en este navegador */
#tmr .tmr-continuar{
  appearance:none;border:1px solid rgba(255,255,255,.25);background:rgba(255,255,255,.08);color:#fff;
  border-radius:10px;padding:9px 14px;font-size:13px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:8px;margin-top:12px;transition:.15s;position:relative;z-index:1;
}
#tmr .tmr-continuar:hover{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.4);}
#tmr .tmr-continuar .tmr-ic{width:15px;height:15px;}
#tmr .tmr-continuar b{font-weight:800;}

/* ---------- Barra de búsqueda / utilidades ---------- */
#tmr .tmr-utilbar{
  position:sticky;top:8px;z-index:20;display:flex;flex-wrap:wrap;gap:10px;align-items:center;
  background:var(--paper);border:1px solid var(--line);border-radius:var(--radius);
  padding:10px 12px;box-shadow:var(--shadow);margin-bottom:22px;
}
#tmr .tmr-buscador{
  flex:1 1 220px;display:flex;align-items:center;gap:8px;background:var(--mist-2);
  border:1px solid var(--line);border-radius:10px;padding:8px 12px;color:var(--muted);
}
#tmr .tmr-buscador .tmr-ic{color:var(--muted);}
#tmr .tmr-buscador input{flex:1;border:none;background:none;outline:none;font-size:14px;color:var(--ink-2);}
#tmr .tmr-utilbar-progreso{display:flex;align-items:center;gap:8px;font-size:13px;color:var(--muted);white-space:nowrap;}
#tmr .tmr-utilbar-progreso b{color:var(--verde-institucional);}

/* ---------- Botones ---------- */
#tmr .tmr-btn{
  appearance:none;border:1px solid var(--line-strong);background:#fff;color:var(--ink-2);
  border-radius:10px;padding:8px 14px;font-size:14px;font-weight:600;cursor:pointer;
  display:inline-flex;align-items:center;gap:7px;transition:.15s;white-space:nowrap;
}
#tmr .tmr-btn:hover{border-color:var(--red);color:var(--red);}
#tmr .tmr-btn-primario{background:var(--red);border-color:var(--red);color:#fff;}
#tmr .tmr-btn-primario:hover{background:var(--red-hover);border-color:var(--red-hover);color:#fff;}
#tmr .tmr-btn-ghost{background:transparent;border-color:transparent;color:var(--muted);}
#tmr .tmr-btn-sm{padding:6px 11px;font-size:12.5px;border-radius:8px;}
#tmr .tmr-btn-peligro{color:var(--red-hover);border-color:#f0c6cc;background:var(--red-soft);}
#tmr .tmr-btn-peligro:hover{background:var(--red);border-color:var(--red);color:#fff;}
#tmr .tmr-btn[disabled]{opacity:.5;cursor:not-allowed;}

/* ---------- Tarjetas de especialidad ----------
   Cada especialidad tiene su propio color institucional (asignado en
   temarios.js vía data-color): franja superior gruesa, insignia circular
   flotando sobre la foto, barra de progreso y bordes en ese mismo color —
   así cada tarjeta se distingue de un vistazo, no solo por el ícono. */
#tmr .tmr-especialidades{display:grid;grid-template-columns:repeat(auto-fit,minmax(252px,1fr));gap:18px;margin-bottom:26px;}
#tmr .tmr-esp-card{
  text-align:left;border:1px solid var(--line);border-radius:14px;background:#fff;
  padding:0;cursor:pointer;box-shadow:0 2px 8px rgba(17,17,17,.05);position:relative;overflow:hidden;
  transition:border-color .2s, box-shadow .25s, transform .25s cubic-bezier(.2,.8,.3,1.3);
  display:flex;flex-direction:column;
  animation:tmrAparece .5s cubic-bezier(.2,.7,.3,1) both;animation-delay:var(--retardo,0s);
}
#tmr .tmr-esp-card[data-color="rojo"]{--esp-color:var(--rojo-institucional);--esp-soft:var(--red-soft);}
#tmr .tmr-esp-card[data-color="azul"]{--esp-color:var(--azul-institucional);--esp-soft:var(--azul-soft);}
#tmr .tmr-esp-card[data-color="verde"]{--esp-color:var(--verde-institucional);--esp-soft:var(--verde-soft);}
#tmr .tmr-esp-card[data-color="gris"]{--esp-color:var(--gris-institucional);--esp-soft:var(--gris-soft);}
#tmr .tmr-esp-card::before{content:"";position:absolute;left:0;right:0;top:0;height:6px;background:var(--esp-color);z-index:1;}
#tmr .tmr-esp-card:hover{border-color:var(--esp-color);box-shadow:0 14px 28px rgba(17,17,17,.14);transform:translateY(-4px) scale(1.012);}
#tmr .tmr-esp-card:hover .tmr-esp-imagen img,
#tmr .tmr-esp-card:hover .tmr-esp-imagen-marcador{transform:scale(1.06);}
#tmr .tmr-esp-card:hover .tmr-esp-pill{transform:translateY(-2px);}
#tmr .tmr-esp-card[aria-pressed="true"]{outline:2px solid var(--esp-color);outline-offset:-2px;}

@keyframes tmrAparece{from{opacity:0;transform:translateY(14px);}to{opacity:1;transform:translateY(0);}}

/* Espacio para la imagen de la especialidad: relación 16:9 fija */
#tmr .tmr-esp-imagen{
  position:relative;width:100%;aspect-ratio:16/9;overflow:hidden;
  background:var(--mist-2);border-bottom:1px solid var(--line);
}
#tmr .tmr-esp-imagen img{width:100%;height:100%;object-fit:cover;display:block;transition:transform .4s ease;}
#tmr .tmr-esp-imagen-marcador{
  width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;
  background:linear-gradient(135deg,var(--esp-soft) 0%,var(--mist-3) 100%);color:var(--esp-color);opacity:.7;
  transition:transform .4s ease;
}
#tmr .tmr-esp-imagen-marcador .tmr-ic{width:26%;height:26%;max-width:46px;max-height:46px;}
/* Medida sugerida, visible en el propio espacio reservado, para que al crear
   la foto de cada especialidad no haga falta volver a este chat a buscar el
   tamaño: relación 16:9, archivo recomendado 1280×720 px (mínimo 960×540). */
#tmr .tmr-esp-imagen-marcador .tmr-esp-imagen-medida{
  font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--muted);text-transform:none;
}
/* Etiqueta en píldora con el nombre de la especialidad, sobre la esquina
   superior izquierda de la imagen — mismo lenguaje visual que las tarjetas
   de "valores institucionales" del sitio (título + color de la tarjeta,
   siempre arriba a la izquierda de la foto). */
#tmr .tmr-esp-pill{
  position:absolute;left:12px;top:12px;right:12px;z-index:2;width:fit-content;max-width:calc(100% - 24px);
  background:var(--esp-color);color:#fff;font-size:12.5px;font-weight:700;line-height:1.3;
  padding:6px 13px;border-radius:14px;display:inline-block;
  box-shadow:0 2px 8px rgba(17,17,17,.25);transition:transform .2s ease;
}

#tmr .tmr-esp-cuerpo{padding:16px;display:flex;flex-direction:column;gap:9px;flex:1;}
#tmr .tmr-esp-lema-titulo{font-size:13.5px;font-weight:700;color:var(--ink);margin:0;}
#tmr .tmr-esp-lema-desc{font-size:12.5px;color:var(--muted);margin:0;line-height:1.45;}
#tmr .tmr-esp-meta{display:flex;gap:7px;flex-wrap:wrap;}
#tmr .tmr-badge{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.03em;
  background:var(--mist-2);border:1px solid var(--line);border-radius:999px;padding:3px 9px 3px 7px;color:var(--text-2);
  display:inline-flex;align-items:center;gap:4px;}
#tmr .tmr-badge .tmr-ic{width:11px;height:11px;}
#tmr .tmr-badge-perfiles{background:var(--azul-soft);border-color:#cfe0ee;color:var(--azul-2);}
#tmr .tmr-badge-temas{background:var(--verde-soft);border-color:#cfe0cb;color:var(--verde-institucional);}
#tmr .tmr-badge-referencias{background:var(--red-soft);border-color:#f3d2d8;color:var(--red-hover);}
#tmr .tmr-esp-progreso{height:6px;border-radius:999px;background:var(--mist);overflow:hidden;margin-top:auto;}
#tmr .tmr-esp-progreso>i{display:block;height:100%;background:var(--esp-color);width:0%;transition:width .5s ease;}
#tmr .tmr-esp-progreso-txt{font-size:11.5px;color:var(--muted);}
/* Insignia dorada de "completado": aparece solo al llegar al 100%, como una
   pequeña condecoración — el mismo uso del dorado que ya tiene en el escudo
   del Ejército (un acento de logro/distinción, no de marca). */
#tmr .tmr-esp-completo{
  display:inline-flex;align-items:center;gap:5px;align-self:flex-start;
  background:var(--dorado-soft);border:1px solid #efd98a;color:#8a6d0a;
  font-size:11px;font-weight:700;border-radius:999px;padding:3px 10px 3px 7px;
}
#tmr .tmr-esp-completo .tmr-ic{width:12px;height:12px;color:var(--dorado-escudo-hover);}
/* Botón-invitación debajo de cada tarjeta: toda la tarjeta ya es clicable,
   pero sin esta pista explícita un visitante nuevo no sabe que puede abrirla. */
#tmr .tmr-esp-cta{
  display:inline-flex;align-items:center;gap:6px;margin-top:2px;
  font-size:12.5px;font-weight:700;color:var(--esp-color);
}
#tmr .tmr-esp-cta .tmr-ic{width:13px;height:13px;transition:transform .2s ease;}
#tmr .tmr-esp-card:hover .tmr-esp-cta .tmr-ic{transform:translateX(4px);}

/* ---------- Árbol: panel lateral tipo documentación ----------
   En vez de un acordeón de ramas que se abren y cierran, la especialidad
   se ve como una página de documentación: a la izquierda, la lista fija
   de todos los perfiles (subáreas); a la derecha, el contenido del perfil
   seleccionado. Nunca hay dos perfiles compitiendo por espacio en pantalla,
   y el color de cada perfil (rota rojo/azul/verde/gris) se nota tanto en su
   fila de la lista como en el encabezado y las tarjetas de tema del panel. */
#tmr .tmr-arbol-cabecera{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:10px;}
/* Migas de pan: Especialidades > {especialidad} > {perfil activo} */
#tmr .tmr-breadcrumb{display:flex;align-items:center;gap:6px;flex-wrap:wrap;font-size:13.5px;color:var(--muted);}
#tmr .tmr-breadcrumb button{appearance:none;border:none;background:none;color:var(--azul-institucional);font-size:13.5px;font-weight:700;cursor:pointer;padding:0;}
#tmr .tmr-breadcrumb button:hover{text-decoration:underline;}
#tmr .tmr-breadcrumb-sep{color:var(--line-strong);}
#tmr .tmr-breadcrumb #tmr-breadcrumb-esp{font-weight:700;color:var(--ink-2);}
#tmr .tmr-breadcrumb #tmr-breadcrumb-perfil{color:var(--muted);}
#tmr .tmr-arbol{
  border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;background:#fff;
  display:grid;grid-template-columns:240px minmax(0,1fr);align-items:start;
}

#tmr .tmr-arbol-nav{display:flex;flex-direction:column;gap:3px;padding:10px;border-right:1px solid var(--line);background:var(--mist-2);}
#tmr .tmr-nav-item{
  display:flex;align-items:center;gap:10px;width:100%;text-align:left;
  border:none;border-left:3px solid transparent;background:transparent;border-radius:10px;padding:9px 10px 9px 8px;
  cursor:pointer;transition:background .15s,transform .15s;
}
#tmr .tmr-nav-item:hover{background:#fff;}
#tmr .tmr-nav-item[data-color="rojo"]{--accent-rama:var(--rojo-institucional);--accent-rama-soft:var(--red-soft);}
#tmr .tmr-nav-item[data-color="azul"]{--accent-rama:var(--azul-institucional);--accent-rama-soft:var(--azul-soft);}
#tmr .tmr-nav-item[data-color="verde"]{--accent-rama:var(--verde-institucional);--accent-rama-soft:var(--verde-soft);}
#tmr .tmr-nav-item[data-color="gris"]{--accent-rama:var(--gris-institucional);--accent-rama-soft:var(--gris-soft);}
#tmr .tmr-nav-item[aria-current="true"]{background:#fff;border-left-color:var(--accent-rama);box-shadow:0 1px 4px rgba(17,17,17,.08);}
#tmr .tmr-nav-item.tmr-nav-sin-match{opacity:.35;}
#tmr .tmr-nav-icono{
  width:30px;height:30px;border-radius:50%;flex:0 0 auto;background:var(--accent-rama-soft, var(--mist-3));
  color:var(--accent-rama, var(--muted));display:flex;align-items:center;justify-content:center;
}
#tmr .tmr-nav-icono .tmr-ic{width:16px;height:16px;}
#tmr .tmr-nav-texto{display:flex;flex-direction:column;gap:1px;min-width:0;}
#tmr .tmr-nav-nombre{font-size:13px;font-weight:700;color:var(--ink);line-height:1.3;}
#tmr .tmr-nav-conteo{font-size:11px;color:var(--muted);}

#tmr .tmr-arbol-panel{padding:18px 20px 20px;display:flex;flex-direction:column;gap:14px;min-width:0;}
#tmr .tmr-arbol-panel[data-color="rojo"]{--accent-rama:var(--rojo-institucional);--accent-rama-soft:var(--red-soft);}
#tmr .tmr-arbol-panel[data-color="azul"]{--accent-rama:var(--azul-institucional);--accent-rama-soft:var(--azul-soft);}
#tmr .tmr-arbol-panel[data-color="verde"]{--accent-rama:var(--verde-institucional);--accent-rama-soft:var(--verde-soft);}
#tmr .tmr-arbol-panel[data-color="gris"]{--accent-rama:var(--gris-institucional);--accent-rama-soft:var(--gris-soft);}
#tmr .tmr-panel-cabecera{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding-bottom:12px;border-bottom:2px solid var(--accent-rama-soft);}
#tmr .tmr-badge-dorado{background:var(--dorado-soft);border-color:#efd98a;color:#8a6d0a;}
#tmr .tmr-badge-dorado .tmr-ic{color:var(--dorado-escudo-hover);}
#tmr .tmr-panel-cabecera h3{margin:0;font-size:17px;flex:1;min-width:140px;}
#tmr .tmr-subarea-icono{
  width:30px;height:30px;border-radius:50%;flex:0 0 auto;background:var(--accent-rama-soft, var(--mist-3));
  color:var(--accent-rama, var(--muted));display:flex;align-items:center;justify-content:center;
}
#tmr .tmr-subarea-icono .tmr-ic{width:16px;height:16px;}
#tmr .tmr-panel-temas{display:grid;gap:10px;}
#tmr .tmr-panel-vacio{padding:24px;text-align:center;color:var(--muted);font-size:13.5px;border:1px dashed var(--line-strong);border-radius:12px;}

/* Control segmentado: Todos / Pendientes / Revisados / Favoritos */
#tmr .tmr-segmentado{display:flex;gap:4px;background:var(--mist-2);border:1px solid var(--line);border-radius:10px;padding:3px;align-self:flex-start;flex-wrap:wrap;}
#tmr .tmr-seg-item{
  appearance:none;border:none;background:transparent;color:var(--muted);font-size:12.5px;font-weight:700;
  border-radius:8px;padding:6px 12px;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:.15s;
}
#tmr .tmr-seg-item .tmr-ic{width:12px;height:12px;}
#tmr .tmr-seg-item:hover{color:var(--ink-2);}
#tmr .tmr-seg-item.tmr-seg-activo{background:#fff;color:var(--accent-rama, var(--ink));box-shadow:0 1px 4px rgba(17,17,17,.1);}

/* Navegación entre perfiles de la misma especialidad, al final del panel */
#tmr .tmr-panel-navperfil{display:flex;align-items:center;justify-content:space-between;gap:10px;padding-top:6px;border-top:1px solid var(--line);}
#tmr .tmr-panel-navperfil .tmr-btn{max-width:48%;overflow:hidden;text-overflow:ellipsis;}
#tmr .tmr-panel-navperfil #tmr-btn-perfil-siguiente{margin-left:auto;}

@media (max-width:680px){
  #tmr .tmr-arbol{grid-template-columns:1fr;}
  #tmr .tmr-arbol-nav{flex-direction:row;overflow-x:auto;border-right:none;border-bottom:1px solid var(--line);}
  #tmr .tmr-nav-item{flex:0 0 auto;min-width:160px;border-left:none;border-top:3px solid transparent;}
  #tmr .tmr-nav-item[aria-current="true"]{border-left:none;border-top-color:var(--accent-rama);}
}

#tmr .tmr-tema{
  border:1px solid var(--line);border-left:3px solid var(--accent-rama, var(--line));
  border-radius:12px;padding:14px 16px;background:#fff;
  animation:tmrTemaAparece .3s ease both;
}
#tmr .tmr-tema[data-filtrado="0"]{display:none;}
#tmr .tmr-tema.tmr-revisado{border-color:#bfe0bb;border-left-color:var(--verde-institucional);background:#f6fbf5;}
@keyframes tmrTemaAparece{from{opacity:0;transform:translateX(-6px);}to{opacity:1;transform:translateX(0);}}

#tmr .tmr-tema-top{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;align-items:flex-start;}
#tmr .tmr-tema-titulo-wrap{display:flex;align-items:center;gap:8px;flex-wrap:wrap;min-width:0;}
#tmr .tmr-tema h4{margin:0;font-size:14.5px;color:var(--ink);}
#tmr .tmr-tema-acciones{display:flex;align-items:center;gap:10px;flex:0 0 auto;}
#tmr .tmr-badge-tiempo{background:var(--mist-2);border-color:var(--line);color:var(--muted);}
#tmr .tmr-tema-lista{margin:8px 0 0;padding-left:18px;font-size:13px;color:var(--text-2);line-height:1.55;}

/* Botón de favorito (estrella), independiente del checkbox "Revisado" */
#tmr .tmr-favorito{
  appearance:none;border:none;background:none;cursor:pointer;color:var(--line-strong);
  padding:2px;display:flex;align-items:center;justify-content:center;transition:transform .15s, color .15s;
}
#tmr .tmr-favorito .tmr-ic{width:18px;height:18px;}
#tmr .tmr-favorito:hover{color:var(--dorado-escudo);transform:scale(1.1);}
#tmr .tmr-favorito.tmr-favorito-activo{color:var(--dorado-escudo);}
#tmr .tmr-favorito.tmr-favorito-activo .tmr-ic{fill:currentColor;}
#tmr .tmr-tema.tmr-tema-favorito{box-shadow:inset 0 0 0 1px #efd98a;}

/* Bibliografía del PERFIL (subárea) completo: un solo bloque, siempre al
   final de todos sus temas — nunca repetido tema por tema. Deliberadamente
   NO blanco como las tarjetas de tema: fondo celeste tenue + franja y texto
   en azul institucional (el mismo azul que ya usan los enlaces del sitio),
   para que de un vistazo se note "esto es distinto, es la referencia de
   todo el bloque de arriba", no otra tarjeta de contenido más. */
#tmr .tmr-subarea-biblio{
  border:1px solid #cfe0ee;border-left:4px solid var(--azul-institucional);border-radius:10px;
  padding:14px 16px;background:var(--azul-soft);
}
#tmr .tmr-subarea-biblio .tmr-tema-biblio-titulo{color:var(--azul-2);}
#tmr .tmr-subarea-biblio .tmr-tema-biblio-titulo .tmr-ic{color:var(--azul-institucional);}
#tmr .tmr-tema-biblio-titulo{display:flex;align-items:center;gap:6px;font-size:12px;font-weight:700;color:var(--muted);
  text-transform:uppercase;letter-spacing:.03em;margin:0 0 8px;}
#tmr .tmr-subarea-biblio .tmr-biblio-item{background:#fff;}
#tmr .tmr-subarea-biblio .tmr-biblio-sin-enlace li{background:#fff;border-color:#cfe0ee;}
#tmr .tmr-tema-biblio-titulo .tmr-ic{width:14px;height:14px;}
#tmr .tmr-biblio-lista{display:flex;flex-direction:column;gap:6px;margin-bottom:4px;}
#tmr .tmr-biblio-item{
  display:flex;align-items:center;gap:8px;border:1px solid var(--line);border-radius:10px;
  padding:8px 10px;font-size:13px;color:var(--ink-2);background:var(--mist-2);text-decoration:none;
  transition:.15s;
}
#tmr .tmr-biblio-item:hover{border-color:var(--azul-institucional);background:#eaf3fb;}
#tmr .tmr-biblio-item .tmr-ic{color:var(--azul-institucional);width:16px;height:16px;}
#tmr .tmr-biblio-item span{flex:1;}
/* Referencias sin enlace propio: se listan como texto, sin simular un botón */
#tmr .tmr-biblio-sin-enlace{list-style:none;margin:0 0 4px;padding:0;display:flex;flex-direction:column;gap:4px;}
#tmr .tmr-biblio-sin-enlace li{
  font-size:12.5px;color:var(--muted);padding:7px 10px;border:1px dashed var(--line-strong);
  border-radius:10px;background:var(--mist-2);
}

/* ---------- Checkbox "revisado" ---------- */
#tmr .tmr-revisar{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;font-weight:600;color:var(--muted);
  cursor:pointer;user-select:none;flex:0 0 auto;}
#tmr .tmr-revisar input{position:absolute;opacity:0;width:1px;height:1px;}
#tmr .tmr-revisar .tmr-check-caja{width:19px;height:19px;border-radius:6px;border:1.5px solid var(--line-strong);
  display:flex;align-items:center;justify-content:center;background:#fff;transition:.15s;}
#tmr .tmr-revisar .tmr-check-caja .tmr-ic{width:13px;height:13px;color:#fff;opacity:0;transition:.15s;}
/* El checkbox toma el color del perfil activo (--accent-rama), en vez de un
   verde fijo, para que se sienta parte de ese perfil en particular. */
/* Estado marcado: lo pone el JavaScript con la clase .tmr-marcado en la etiqueta,
   así se ve bien aunque el CSS de la página anfitriona (Joomla) altere el input. */
#tmr .tmr-revisar.tmr-marcado .tmr-check-caja{background:var(--accent-rama, var(--verde-institucional));border-color:var(--accent-rama, var(--verde-institucional));animation:tmrCheckPop .32s ease;}
#tmr .tmr-revisar.tmr-marcado .tmr-check-caja .tmr-ic{opacity:1;}
#tmr .tmr-revisar.tmr-marcado .tmr-revisar-txt{color:var(--accent-rama, var(--verde-institucional));}
@keyframes tmrCheckPop{0%{transform:scale(.6);}55%{transform:scale(1.2);}100%{transform:scale(1);}}

#tmr .tmr-toast{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);background:var(--ink);color:#fff;
  padding:10px 18px;border-radius:999px;font-size:13.5px;box-shadow:var(--shadow);z-index:100;opacity:0;pointer-events:none;transition:.25s;}
#tmr .tmr-toast.tmr-mostrar{opacity:1;transform:translateX(-50%) translateY(-4px);}

/* Confirmación propia para acciones destructivas/masivas (marcar perfil
   entero, reiniciar especialidad): nunca usa window.confirm(), que algunos
   visores/iframes con sandbox bloquean en silencio (lo que hacía parecer que
   el botón "no hacía nada"). */
#tmr .tmr-confirm-overlay{
  position:fixed;inset:0;background:rgba(17,17,17,.55);z-index:200;
  display:flex;align-items:center;justify-content:center;padding:20px;
  animation:tmrConfirmFondo .15s ease both;
}
@keyframes tmrConfirmFondo{from{opacity:0;}to{opacity:1;}}
#tmr .tmr-confirm-caja{
  background:#fff;border-radius:var(--radius);padding:22px 24px;max-width:380px;width:100%;
  box-shadow:0 20px 50px rgba(17,17,17,.3);animation:tmrConfirmCaja .18s cubic-bezier(.2,.8,.3,1.2) both;
}
@keyframes tmrConfirmCaja{from{opacity:0;transform:translateY(8px) scale(.97);}to{opacity:1;transform:translateY(0) scale(1);}}
#tmr .tmr-confirm-caja p{margin:0 0 18px;font-size:14.5px;color:var(--ink-2);line-height:1.5;}
#tmr .tmr-confirm-botones{display:flex;justify-content:flex-end;gap:8px;}

#tmr .tmr-vacio{padding:40px 20px;text-align:center;color:var(--muted);font-size:14px;}

/* Normativa y documentos legales: visor PDF incrustado + enlace de descarga */
#tmr .tmr-normativa{margin:30px 0 10px;}
#tmr .tmr-normativa h2{margin-bottom:4px;}
#tmr .tmr-normativa-bajada{color:var(--muted);font-size:13.5px;margin:0 0 14px;}
#tmr .tmr-norm-lista{display:grid;gap:16px;}
#tmr .tmr-norm-card{border:1px solid var(--line);border-left:4px solid var(--azul-institucional);border-radius:var(--radius);background:#fff;padding:16px;}
#tmr .tmr-norm-card h3{font-size:15px;margin:0 0 10px;}
#tmr .tmr-norm-card iframe{width:100%;height:600px;border:1px solid var(--line);border-radius:10px;display:block;background:var(--mist-2);}
#tmr .tmr-norm-card a{display:inline-flex;margin-top:10px;font-size:13px;font-weight:700;color:var(--azul-institucional);}
#tmr .tmr-norm-card a:hover{text-decoration:underline;}
@media (max-width:640px){#tmr .tmr-norm-card iframe{height:460px;}}

/* Aviso para quien navega sin JavaScript: toda la sección depende de él
   (datos, panel, buscador), así que sin JS quedaría un espacio vacío sin
   explicación — esto al menos dice qué pasa. */
#tmr noscript{
  display:block;margin:22px 0;padding:14px 16px;border:1px solid var(--line-strong);
  border-left:4px solid var(--red);border-radius:10px;background:var(--mist-2);
  color:var(--ink-2);font-size:13.5px;
}

@media (max-width:640px){
  #tmr .tmr-utilbar{position:static;}
}
