/* Experiencia guiada (bloque 13): cabecera con menú por situación, «¿Qué hago aquí?», glosario al pasar y la franja
   «Tu siguiente paso». Autónoma: cada color lleva su respaldo, porque el informe no carga base.css.
   Movimiento: solo opacidad y transform, 150 a 200 ms; con movimiento reducido, cambios instantáneos. */

/* ---------- Cabecera única ---------- */
.barra-der { display: flex; align-items: center; gap: 4px 8px; min-width: 0; }
.ayuda-aqui { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 12px; border-radius: 6px; color: var(--oro-claro, #e6c887); font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.ayuda-aqui:hover { background: var(--noche-3, #18233b); text-decoration: none; }
.ayuda-aqui::before { content: "?"; flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid currentColor; display: grid; place-items: center; font-size: .8rem; font-weight: 700; line-height: 1; }
.barra-enlace { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 12px; border-radius: 6px; color: var(--noche-tinta, #e9edf5); font-weight: 500; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.barra-enlace:hover { background: var(--noche-3, #18233b); text-decoration: none; }

.menu { position: static; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 14px; border-radius: 8px; border: 1px solid rgba(233, 237, 245, .38); color: #fff; font-weight: 600; font-size: .95rem; cursor: pointer; user-select: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary:hover { background: var(--noche-3, #18233b); border-color: rgba(233, 237, 245, .6); }
.menu-rayas { width: 16px; height: 2px; background: currentColor; border-radius: 2px; box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor; transition: box-shadow .15s ease; }
.menu[open] .menu-rayas { box-shadow: 0 0 0 currentColor, 0 0 0 currentColor; }
.menu-panel { position: absolute; left: 0; right: 0; top: 100%; z-index: 30; background: var(--noche-2, #0e1729); color: var(--noche-tinta, #e9edf5); border-top: 1px solid var(--noche-linea, #26324d); border-bottom: 1px solid var(--noche-linea, #26324d);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .55); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 32px; padding: 24px max(24px, calc((100vw - 1092px) / 2)) 28px; max-height: calc(100vh - 64px); overflow-y: auto; }
.barra nav.menu-panel { display: grid; align-items: start; justify-content: stretch; }
.menu-grupo b { display: block; font-family: var(--f-titulo, Georgia, serif); font-weight: 400; font-size: 1.25rem; color: #fff; padding: 4px 0 8px; border-bottom: 1px solid var(--noche-linea, #26324d); margin-bottom: 6px; }
.menu-grupo { min-width: 0; }
.menu-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.barra nav.menu-panel a, .menu-panel a { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 2px; min-height: 44px; padding: 8px 10px; margin-inline: -10px; border-radius: 6px; color: var(--noche-tinta, #e9edf5); font-weight: 500; font-size: .95rem; text-decoration: none; }
.menu-panel a:hover { background: var(--noche-3, #18233b); text-decoration: none; }
.menu-panel a small { color: var(--noche-suave, #a9b3c4); font-weight: 400; font-size: .8125rem; line-height: 1.35; }
.barra nav.menu-panel a[aria-current="page"] { color: var(--oro-claro, #e6c887); }
@media (prefers-reduced-motion: no-preference) {
  .menu[open] .menu-panel { animation: guia-entra .18s ease-out both; }
}
@keyframes guia-entra { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (max-width: 860px) {
  .menu-panel { grid-template-columns: 1fr; gap: 20px; padding: 20px 16px 32px; height: calc(100vh - 64px); height: calc(100dvh - 64px); max-height: none; }
  .barra-enlace.solo-ancho { display: none; }
}
@media (max-width: 560px) {
  .ayuda-aqui { padding: 8px; }
  .menu > summary { padding: 8px 12px; }
  .barra .contenedor { gap: 8px; }
}
/* En el celular, la ayuda y el menú quedan con su ícono (44 px) y su nombre para los lectores de pantalla. */
@media (max-width: 560px) {
  .guia-texto { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .ayuda-aqui, .menu > summary { position: relative; width: 44px; flex: none; padding: 0; justify-content: center; }
  /* Bloque 14: con un enlace de texto en la barra (Mis empresas o Ingresar del portal), ese enlace cede ancho; los íconos, no. */
  .barra-der .barra-enlace { min-width: 0; padding-inline: 8px; }
  .barra-der .barra-enlace > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ayuda-aqui::before { width: 24px; height: 24px; }
  .barra .usuario .rol { display: none; }
}
@media print { .menu, .ayuda-aqui { display: none !important; } }

/* ---------- «¿Qué hago aquí?»: panel lateral; en el celular, a pantalla completa ---------- */
.guia-panel { position: fixed; inset: 0 0 0 auto; margin: 0; width: min(520px, 100vw); max-width: none; height: 100vh; height: 100dvh; max-height: none; padding: 0; border: 0; border-left: 1px solid var(--linea-fuerte, #c4ccd8);
  background: var(--superficie, #fff); color: var(--tinta, #0b1324); display: none; flex-direction: column; font-family: var(--f-texto, "IBM Plex Sans", system-ui, sans-serif); }
.guia-panel[open] { display: flex; }
html.guia-fija { overflow: hidden; }
.guia-panel-cuerpo.documento { overscroll-behavior: contain; }
.guia-panel::backdrop { background: rgba(7, 13, 26, .55); }
.guia-panel-cabeza { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 12px 12px 24px; background: var(--noche, #070d1a); color: #fff; border-bottom: 1px solid var(--noche-linea, #26324d); padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
.guia-panel-cabeza h2 { font-family: var(--f-titulo, Georgia, serif); font-weight: 400; font-size: 1.5rem; margin: 0; color: #fff; }
.guia-cerrar { flex: none; width: 44px; height: 44px; display: grid; place-items: center; background: transparent; border: 1px solid rgba(233, 237, 245, .38); border-radius: 8px; color: #fff; cursor: pointer; }
.guia-cerrar:hover { background: var(--noche-3, #18233b); }
.guia-cerrar:focus-visible { outline: 2px solid var(--oro-claro, #e6c887); outline-offset: 2px; }
.guia-cerrar svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.guia-panel-cuerpo.documento { flex: 1 1 auto; overflow-y: auto; margin: 0; border: 0; border-radius: 0; padding: 20px 24px 24px; display: grid; gap: 16px; align-content: start; background: transparent; box-shadow: none; max-width: none; }
.guia-panel-cuerpo:focus { outline: none; }
.guia-panel-cuerpo h2 { font-size: 1.2rem; margin-top: 0; }
.guia-panel-cuerpo h3 { font-size: 1.05rem; margin: 0; }
.guia-panel-cuerpo > section, .guia-panel-cuerpo > details { display: grid; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--linea, #dce1e8); }
.guia-panel-cuerpo > :last-child { border-bottom: 0; }
.guia-panel-cuerpo section section { display: grid; gap: 12px; }
.guia-panel-cuerpo ol, .guia-panel-cuerpo ul { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.guia-panel-cuerpo details > summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; }
.guia-panel-pie { margin: 0; padding: 8px 24px calc(8px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--linea, #dce1e8); background: var(--superficie-2, #f8f9fb); }
.guia-panel-pie a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
@media (prefers-reduced-motion: no-preference) {
  .guia-panel[open] { animation: guia-lado .2s ease-out both; }
  .guia-panel[open]::backdrop { animation: guia-velo .2s ease-out both; }
}
@keyframes guia-lado { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
@keyframes guia-velo { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 620px) { .guia-panel { width: 100vw; border-left: 0; } .guia-panel-cuerpo.documento { padding: 16px; } .guia-panel-pie { padding-inline: 16px; } }

/* ---------- Glosario al pasar ---------- */
.glosa { cursor: help; border-radius: 2px; text-decoration: underline dotted; text-decoration-color: var(--oro-tinta, #7a5c17); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.glosa:hover, .glosa[aria-expanded="true"] { text-decoration-style: solid; }
.glosa:focus-visible { outline: 2px solid var(--foco, #3b5bdb); outline-offset: 2px; }
.que-sigue .glosa, .barra .glosa, .noche .glosa { text-decoration-color: var(--oro-claro, #e6c887); }
.glosa-pop { position: absolute; z-index: 60; width: max-content; max-width: min(340px, calc(100vw - 24px)); display: grid; gap: 4px; padding: 12px 14px; border-radius: 10px;
  background: var(--noche, #070d1a); color: var(--noche-tinta, #e9edf5); border: 1px solid var(--noche-linea, #26324d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 12px 28px -12px rgba(7, 13, 26, .45);
  font-family: var(--f-texto, "IBM Plex Sans", system-ui, sans-serif); font-size: .875rem; line-height: 1.45; text-align: left; }
.glosa-pop[hidden] { display: none; }
.glosa-pop b { color: var(--oro-claro, #e6c887); font-weight: 600; }
@media (prefers-reduced-motion: no-preference) { .glosa-pop:not([hidden]) { animation: guia-velo .15s ease-out both; } }
@media print { .glosa { text-decoration: none; cursor: auto; } .glosa-pop, .guia-panel { display: none !important; } }

/* ---------- «Tu siguiente paso» (Mis empresas e informe; el diagnóstico usa .que-sigue de app.css) ---------- */
.siguiente { background: var(--noche, #070d1a); color: var(--noche-tinta, #e9edf5); border-radius: var(--r-hoja, 14px); border-left: 3px solid var(--oro, #d4b26b); padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; }
.siguiente[hidden] { display: none; }
.siguiente-texto { flex: 1 1 320px; min-width: 0; display: grid; gap: 2px; }
.siguiente p.siguiente-rotulo { color: var(--oro-claro, #e6c887); font-size: .8125rem; font-weight: 600; display: flex; align-items: center; gap: 8px; margin: 0; }
.siguiente-rotulo::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--oro, #d4b26b); }
.siguiente b { color: #fff; font-size: 1.1rem; display: block; }
.siguiente p { color: #c9d1e0; margin: 0; max-width: 68ch; }
.siguiente :focus-visible { outline-color: var(--oro-claro, #e6c887); }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .siguiente { background: var(--superficie-2, #121d33); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06); }
}
@media (max-width: 560px) { .siguiente { padding: 16px 18px; } .siguiente .boton { width: 100%; } }
@media print { .siguiente { display: none !important; } }

/* Mis empresas: la entrada del contador va después de las empresas del dueño (hallazgo F-4 del bloque 12). */
.portal-entrada { display: flex; }
.portal-entrada .enlace-portal { flex: 1 1 auto; max-width: 560px; }

/* Mis empresas sin empresas: la lista vacía no deja un hueco; la franja y el formulario bastan. */
#lista-empresas:empty { display: none; }

/* «Ver el detalle»: la base legal completa, plegada bajo la línea llana (diagnóstico, dato del SIRE). */
.detalle-legal > summary { cursor: pointer; font-weight: 600; font-size: .875rem; min-height: 44px; display: inline-flex; align-items: center; color: var(--suave, #566074); }
.detalle-legal[open] > summary { color: var(--tinta, #0b1324); }

/* Videos por acción (bloque 15), en el centro de ayuda y en «¿Qué hago aquí?». Dos vistas del mismo video: la de escritorio
   en pantallas anchas (desde 900 px, donde se muestra a 720 px) y la de celular en las demás y en el panel, que se leen
   mejor a ese ancho. Sin JavaScript: solo CSS.
   Controles nativos, sin reproducción automática; el texto del video está debajo, en «Lo que dice el video». */
.video-accion { margin: 4px 0 0; display: grid; gap: 8px; justify-items: start; }
.video-accion video { display: block; width: 100%; height: auto; max-width: 720px; border: 1px solid var(--linea, #dce1e8); border-radius: 8px; background: #0b1324; }
.video-accion .video-movil { display: none; width: auto; max-width: 100%; max-height: 72vh; }
.video-accion figcaption { font-size: .875rem; color: var(--suave, #566074); }
.video-accion figcaption b { color: var(--tinta, #0b1324); font-weight: 600; }
.video-texto > summary { cursor: pointer; font-weight: 600; font-size: .875rem; min-height: 44px; display: inline-flex; align-items: center; }
.video-texto ol { margin: 4px 0 0; padding-left: 1.4em; font-size: .9375rem; display: grid; gap: 4px; }
.video-accion video::cue { font-family: inherit; font-size: 1rem; line-height: 1.35; }
@media (max-width: 899px) {
  .video-accion .video-escritorio { display: none; }
  .video-accion .video-movil { display: block; }
}
.guia-panel .video-accion .video-escritorio { display: none; }
.guia-panel .video-accion .video-movil { display: block; max-height: 64vh; }
@media (prefers-color-scheme: dark) {
  :root:not([data-tema="claro"]) .video-accion figcaption b { color: var(--tinta, #f4f1ea); }
}
/* En papel el video no sirve: se imprime solo «Lo que dice el video», abierto. */
@media print {
  .video-accion video, .video-accion figcaption, .video-texto > summary { display: none !important; }
  .video-texto::details-content { content-visibility: visible; display: contents; }
  .video-texto > ol { display: grid !important; }
}
