/*
 * Ayuda contextual: botón del header + cajón.
 *
 * Archivo propio y no un bloque dentro de ska-admin-components.css: ese se sirve
 * con ?v=N y bumpearlo obliga a re-descargar el design-system entero a todos los
 * productos por un cambio que solo afecta a la ayuda.
 *
 * Solo tokens `ska-*` (los que sirve /api/v1/config-manager/admin-theme.css, que
 * deriva la paleta de la Organization activa). Nada de utilities Tailwind
 * inventadas: no hay build del proyecto y el bundle de Unfold trae safelist fija,
 * así que una clase nueva se purga en silencio.
 */

/* ── Herramientas del header (chat + ayuda), agrupadas y ancladas a la derecha ── */
.ska-header-tools {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;   /* empuja el grupo al extremo derecho (antes vivía en .ska-help-btn) */
    margin-right: 8px;
}

/* ── El botón ? del header ─────────────────────────────────────────────── */
.ska-help-btn {
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--ska-border, #e5e7eb);
    background: transparent;
    color: var(--ska-text-muted, #6b7280);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: color .15s, border-color .15s, background-color .15s;
}
.ska-help-btn:hover {
    color: var(--ska-primary, #14b8a6);
    border-color: var(--ska-primary, #14b8a6);
    background: var(--ska-primary-light, rgba(20, 184, 166, .1));
}
.ska-help-btn:focus-visible {
    outline: 2px solid var(--ska-primary, #14b8a6);
    outline-offset: 2px;
}

/* ── Acceso a chat en el header (reemplaza el FAB flotante que tapaba el contenido) ── */
.ska-chat-btn {
    position: relative;
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    border: 1px solid var(--ska-border, #e5e7eb);
    background: transparent;
    color: var(--ska-text-muted, #6b7280);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: color .15s, border-color .15s, background-color .15s;
}
.ska-chat-btn:hover {
    color: var(--ska-primary, #14b8a6);
    border-color: var(--ska-primary, #14b8a6);
    background: var(--ska-primary-light, rgba(20, 184, 166, .1));
}
.ska-chat-btn:focus-visible {
    outline: 2px solid var(--ska-primary, #14b8a6);
    outline-offset: 2px;
}
.ska-chat-btn--unread {
    color: var(--ska-primary, #14b8a6);
    border-color: var(--ska-primary, #14b8a6);
}
.ska-chat-btn__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: var(--ska-danger, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
}

/* ── El cajón ──────────────────────────────────────────────────────────── */
dialog.ska-help {
    width: min(420px, 92vw);
    max-width: none;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0 0 0 auto;   /* pegado a la derecha */
    padding: 0;
    border: none;
    border-left: 1px solid var(--ska-border, #e5e7eb);
    background: var(--ska-bg, #fff);
    color: var(--ska-text, #1f2937);
    box-shadow: -14px 0 40px rgba(0, 0, 0, .1);
}
dialog.ska-help::backdrop {
    background: rgba(10, 20, 18, .28);
}

.ska-help__head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--ska-border, #e5e7eb);
}
.ska-help__eyebrow {
    flex: 1;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--ska-text-muted, #6b7280);
}
.ska-help__all {
    font-size: 12px;
    color: var(--ska-primary, #14b8a6);
    text-decoration: none;
}
.ska-help__all:hover { text-decoration: underline; }
.ska-help__x {
    border: 0;
    background: transparent;
    color: var(--ska-text-muted, #6b7280);
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
    border-radius: 5px;
    cursor: pointer;
}
.ska-help__x:hover { background: var(--ska-surface-alt, #f3f4f6); }

.ska-help__body {
    overflow-y: auto;
    height: calc(100dvh - 49px);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ska-help__notice {
    margin: 0;
    padding: 14px 6px;
    font-size: 13px;
    color: var(--ska-text-muted, #6b7280);
    text-align: center;
}

/* ── Un artículo ───────────────────────────────────────────────────────── */
.ska-help__art {
    border: 1px solid var(--ska-border, #e5e7eb);
    border-radius: var(--ska-radius-md, 8px);
    overflow: hidden;
}
/* Los fallos van marcados: cuando algo no funciona, esa es la respuesta que se busca. */
.ska-help__art--troubleshooting {
    border-left: 3px solid var(--ska-danger, #dc2626);
}
.ska-help__art > summary {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 11px 12px;
    cursor: pointer;
    list-style: none;
}
.ska-help__art > summary::-webkit-details-marker { display: none; }
.ska-help__art > summary:hover { background: var(--ska-surface-alt, #f9fafb); }

.ska-help__title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    text-wrap: balance;
}
/* La respuesta de ≤40 palabras: SIEMPRE visible, sin abrir nada. Es la capa de 5
   segundos y también es la lista cuando la pantalla tiene varios artículos. */
.ska-help__answer {
    font-size: 13px;
    line-height: 1.5;
    color: var(--ska-text-secondary, #4b5563);
}
.ska-help__more {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--ska-primary, #14b8a6);
}
.ska-help__art[open] .ska-help__more { display: none; }

.ska-help__full {
    padding: 2px 12px 12px;
    border-top: 1px solid var(--ska-border, #e5e7eb);
    font-size: 13px;
    line-height: 1.55;
    color: var(--ska-text-secondary, #4b5563);
}
.ska-help__full h2 {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--ska-text-muted, #6b7280);
    margin: 14px 0 4px;
}
.ska-help__full p { margin: 0 0 7px; }
.ska-help__full ol,
.ska-help__full ul { margin: 0 0 7px; padding-left: 18px; }
.ska-help__full li { margin-bottom: 3px; }
.ska-help__full strong { color: var(--ska-text, #1f2937); }
.ska-help__full a { color: var(--ska-primary, #14b8a6); }

.ska-help__permalink {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 12px !important;
    padding-top: 10px;
    border-top: 1px dashed var(--ska-border, #e5e7eb);
    font-size: 11.5px;
}
.ska-help__copy {
    border: 0;
    background: transparent;
    padding: 0;
    font: inherit;
    color: var(--ska-primary, #14b8a6);
    cursor: pointer;
    text-decoration: underline;
}
