/* ===========================================================================
   LA AYUDA DEL PORTAL: el botón «?», su cajón, el Centro de ayuda, el ⓘ de una frase, la oferta de bienvenida y el
   globo de los tours (Driver.js, vendorizado en static/vendor/). Solo tokens (`var(--…)`): sigue el tema claro,
   oscuro y automático. Ver «La ayuda del portal» en app/web/CLAUDE.md.
   =========================================================================== */

/* --- Botón «?» de la cabecera y su punto de «hay novedades» --- */
.ayuda-btn { position: relative; }
.ayuda-punto { position: absolute; top: 7px; right: 7px; width: 9px; height: 9px; border-radius: var(--r-pill); background: var(--accent-btn); box-shadow: 0 0 0 2px var(--surface); }
.ayuda-punto[hidden] { display: none; }

/* --- El cajón del «?» --- */
.capa-ayuda .capa-caja { width: min(480px, calc(100% - 24px)); }
.ay-panel-bloque { padding: 0 4px 6px; }

/* --- ⓘ: ayuda de una frase junto a un campo (CSS puro: ratón, teclado y toque) --- */
.info { position: relative; display: inline-flex; align-items: center; margin-left: .3rem; color: var(--muted); font-size: .85em; cursor: help; line-height: 1; border-radius: var(--r-pill); }
.info:hover, .info:focus { color: var(--accent-text); }
.info-tip { position: absolute; z-index: 40; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%); width: max-content; max-width: min(300px, 80vw);
  padding: .5rem .65rem; border-radius: var(--r); background: var(--surface-3); color: var(--text); border: 1px solid var(--border-strong);
  box-shadow: var(--sh-2); font-size: .78rem; font-weight: 400; line-height: 1.4; text-align: left; white-space: normal; pointer-events: none;
  opacity: 0; visibility: hidden; transition: opacity .12s; }
.info:hover .info-tip, .info:focus .info-tip, .info:focus-within .info-tip { opacity: 1; visibility: visible; }

/* --- Centro de ayuda (/ayuda) --- */
.ay-seccion { margin: 1.4rem 0; }
.ay-seccion > h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; margin: 0 0 .6rem; }
.ay-sub { color: var(--muted); font-size: .82rem; margin: .2rem 0 .6rem; }
.ay-vacio { color: var(--muted); font-size: .88rem; }
.ay-novedad { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent-btn); border-radius: var(--r); padding: .8rem 1rem; margin: 0 0 .6rem; }
.ay-novedad h3 { margin: 0 0 .3rem; font-size: .98rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.ay-novedad h3 small { color: var(--muted); font-weight: 400; font-size: .72rem; }
.ay-novedad p { margin: .2rem 0; font-size: .88rem; color: var(--text-2); }
.ay-novedad ul { margin: .3rem 0 .2rem 1.1rem; padding: 0; font-size: .85rem; color: var(--text-2); }
.ay-novedad-mini { margin: 0 0 .5rem; padding: .6rem .8rem; }
.ay-anteriores { margin-top: .4rem; }
.ay-anteriores > summary { cursor: pointer; color: var(--text-2); font-size: .85rem; padding: .3rem 0; }
.ay-pie { display: flex; gap: .4rem; flex-wrap: wrap; align-items: center; margin-top: .55rem; }
.ay-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .6rem; }
.ay-tarjeta { display: flex; flex-direction: column; gap: .2rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: .75rem .9rem; color: var(--text); }
.ay-tarjeta small { color: var(--muted); font-size: .8rem; line-height: 1.35; }
.ay-tarjeta .ay-pie { margin-top: auto; padding-top: .5rem; }
.ay-enlace:hover { border-color: var(--border-strong); background: var(--surface-2); text-decoration: none; }

/* --- Primeros pasos --- */
.ay-progreso { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; max-width: 420px; }
.ay-progreso > i { display: block; height: 100%; background: var(--ok); transition: width .3s; }
.ay-pasos { list-style: none; margin: .4rem 0 0; padding: 0; display: grid; gap: .45rem; }
.ay-pasos li { display: flex; align-items: center; gap: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: .55rem .75rem; flex-wrap: wrap; }
.ay-pasos li.hecho { opacity: .7; }
.ay-pasos li.hecho .ay-paso-txt b { text-decoration: line-through; }
.ay-check { width: 26px; height: 26px; border-radius: var(--r-pill); border: 2px solid var(--border-strong); background: transparent; color: var(--on-ok); cursor: pointer; font-weight: 700; line-height: 1; padding: 0; }
.ay-pasos li.hecho .ay-check { background: var(--ok); border-color: var(--ok); }
.ay-paso-txt { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.ay-paso-txt small { color: var(--muted); font-size: .78rem; }
.ay-paso-acc { display: flex; gap: .35rem; }

/* --- Una guía como página --- */
.ay-guia { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 1.5rem; align-items: start; }
.ay-contenido { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.2rem 1.5rem; line-height: 1.6; font-size: .93rem; }
.ay-contenido h1 { font-size: 1.35rem; margin: 0 0 .8rem; }
.ay-contenido h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; padding-top: .8rem; border-top: 1px solid var(--border); }
.ay-contenido h2:first-of-type { border-top: 0; padding-top: 0; }
.ay-contenido ul, .ay-contenido ol { padding-left: 1.3rem; }
.ay-contenido code { background: var(--surface-3); padding: .08rem .35rem; border-radius: var(--r-sm); font-size: .85em; }
.ay-contenido table { border-collapse: collapse; }
.ay-contenido th, .ay-contenido td { border: 1px solid var(--border); padding: .35rem .6rem; }
.ay-otras { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: .15rem; font-size: .85rem; }
.ay-otras a { padding: .3rem .5rem; border-radius: var(--r-sm); color: var(--text-2); }
.ay-otras a:hover, .ay-otras a[aria-current="page"] { background: var(--surface-2); color: var(--text); text-decoration: none; }

/* --- Pestañas del asistente (Reportero | Guía de uso) --- */
.asist-tabs { display: flex; gap: .25rem; margin-bottom: .6rem; }
.asist-tabs button { flex: 1; padding: .4rem .6rem; border-radius: var(--r); border: 1px solid var(--border); background: transparent; color: var(--text-2); cursor: pointer; font-size: .85rem; }
.asist-tabs button[aria-selected="true"] { background: var(--accent-soft); border-color: var(--accent-btn); color: var(--text); font-weight: 600; }

/* --- Oferta del tour de bienvenida (esquina inferior, una vez) --- */
.ay-oferta { position: fixed; right: 16px; bottom: 16px; z-index: 60; max-width: min(340px, calc(100% - 32px)); display: flex; flex-direction: column; gap: .3rem;
  background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); padding: .85rem 1rem; box-shadow: var(--sh-3); font-size: .86rem; }
.ay-oferta span { color: var(--text-2); }

/* --- El globo de los tours (Driver.js): sobre las clases de driver-1.9.0.css, bajo `.cr-tour` --- */
.driver-popover.cr-tour { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-lg); box-shadow: var(--sh-3); max-width: min(340px, calc(100vw - 24px)); padding: 1rem; }
.cr-tour .driver-popover-title { font-size: 1rem; color: var(--text); padding-right: 1.6rem; }
.cr-tour .driver-popover-description { color: var(--text-2); font-size: .88rem; }
.cr-tour .driver-popover-progress-text { color: var(--muted); }
.cr-tour .driver-popover-close-btn { color: var(--muted); }
.cr-tour .driver-popover-close-btn:hover, .cr-tour .driver-popover-close-btn:focus { color: var(--text); }
.cr-tour .driver-popover-footer-btn { background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--r-sm); padding: .3rem .65rem; font-size: .8rem; }
.cr-tour .driver-popover-footer-btn:hover, .cr-tour .driver-popover-footer-btn:focus { background: var(--surface-3); }
.cr-tour .driver-popover-next-btn, .cr-tour .driver-popover-footer .driver-popover-next-btn { background: var(--accent-btn); border-color: var(--accent-btn); color: var(--on-accent); }
.cr-tour .driver-popover-next-btn:hover, .cr-tour .driver-popover-next-btn:focus { background: var(--accent-hover); }
.driver-popover.cr-tour .driver-popover-arrow-side-left { border-left-color: var(--surface); }
.driver-popover.cr-tour .driver-popover-arrow-side-right { border-right-color: var(--surface); }
.driver-popover.cr-tour .driver-popover-arrow-side-top { border-top-color: var(--surface); }
.driver-popover.cr-tour .driver-popover-arrow-side-bottom { border-bottom-color: var(--surface); }

@media (max-width: 600px) {
  .ay-oferta { left: 12px; right: 12px; bottom: calc(76px + env(safe-area-inset-bottom)); max-width: none; }   /* sobre la barra inferior */
}
@media (max-width: 900px) {
  .ay-guia { grid-template-columns: 1fr; }
  .ay-otras { position: static; }
}
