/* Akari · páginas de ayuda y legales (/documentacion, /comandos, /condiciones-del-servicio, /politica-de-privacidad).
   Depende de ds-tokens.css y ds-site.css. Superficies sólidas, bordes de 1px y texto neutro:
   el naranja solo aparece en el foco y en los enlaces de texto (tinta accesible). */

.help { padding-block: 40px 72px; }

/* ---------- Cabecera de página ---------- */
.help-header { max-width: 720px; margin-bottom: 32px; }
.help-back {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 6px;
    height: 28px;
    margin: 0 0 16px -8px;
    padding: 0 8px;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-2);
    font-size: var(--ds-text-sm);
    font-weight: 500;
    text-decoration: none;
    transition: background-color var(--ds-ease), color var(--ds-ease);
}
.help-back:hover { background: var(--ds-nav-hover); color: var(--ds-text); }
.help-back .ds-icon { width: 14px; height: 14px; }
.help-header h1 { color: var(--ds-text); font-size: var(--ds-text-2xl); line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.help-header p { max-width: 62ch; margin-top: 8px; color: var(--ds-text-2); font-size: var(--ds-text-md); line-height: 1.6; }
.help-header .help-meta { margin-top: 12px; color: var(--ds-text-3); font-size: var(--ds-text-sm); }

/* Enlaces y código dentro del contenido */
.help :where(.help-prose, .help-header p, .help-crosslink) a { color: var(--ds-accent-ink); font-weight: 500; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; transition: text-decoration-color var(--ds-ease); }
.help :where(.help-prose, .help-header p, .help-crosslink) a:hover { text-decoration-color: currentColor; }
.help :where(.help-prose, .help-header p) code {
    padding: 1px 5px;
    border: 1px solid var(--ds-border);
    border-radius: 4px;
    background: var(--ds-surface-hover);
    color: var(--ds-text);
    font-size: .875em;
    white-space: nowrap;
}

/* ---------- Accesos rápidos ---------- */
.help-shortcuts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 48px; }
.help-shortcut {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-lg);
    background: var(--ds-surface);
    box-shadow: var(--ds-shadow-card);
    color: var(--ds-text);
    text-decoration: none;
    transition: border-color var(--ds-ease);
}
.help-shortcut:hover { border-color: var(--ds-border-strong); }
.help-shortcut-icon { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-md); background: var(--ds-bg); color: var(--ds-text-2); }
.help-shortcut-text { display: grid; flex: 1; min-width: 0; gap: 2px; }
.help-shortcut-text strong { font-size: var(--ds-text-base); font-weight: 600; }
.help-shortcut-text small { overflow: hidden; color: var(--ds-text-3); font-size: var(--ds-text-sm); white-space: nowrap; text-overflow: ellipsis; }
.help-shortcut > .ds-icon { color: var(--ds-text-3); transition: color var(--ds-ease); }
.help-shortcut:hover > .ds-icon { color: var(--ds-text); }

/* ---------- Documento con índice lateral ---------- */
.help-layout { display: grid; grid-template-columns: 208px minmax(0, 1fr); gap: 56px; align-items: start; }
.help-index { position: sticky; top: 88px; display: grid; gap: 1px; max-height: calc(100dvh - 112px); overflow-y: auto; overscroll-behavior: contain; }
.help-index-title { margin-bottom: 6px; padding: 0 10px; color: var(--ds-text-3); font-size: var(--ds-text-xs); font-weight: 500; line-height: 16px; }
.help-index a {
    display: block;
    padding: 5px 10px;
    border-radius: var(--ds-radius-sm);
    color: var(--ds-text-2);
    font-size: var(--ds-text-sm);
    line-height: 20px;
    text-decoration: none;
    transition: background-color var(--ds-ease), color var(--ds-ease);
}
.help-index a:hover { background: var(--ds-nav-hover); color: var(--ds-text); }
.help-index a[aria-current="true"] { background: var(--ds-nav-active); color: var(--ds-text); font-weight: 500; }

.help-prose { max-width: 720px; min-width: 0; }
.help-prose > section { scroll-margin-top: 88px; }
.help-prose > section + section { margin-top: 40px; padding-top: 40px; border-top: 1px solid var(--ds-border); }
.help-prose h2 { color: var(--ds-text); font-size: var(--ds-text-lg); line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.help-prose h3 { margin-top: 24px; color: var(--ds-text); font-size: var(--ds-text-base); line-height: 20px; font-weight: 600; }
.help-prose :is(p, ul, ol) { margin: 12px 0 0; color: var(--ds-text-2); font-size: var(--ds-text-base); line-height: 1.7; }
.help-prose :is(ul, ol) { padding-left: 20px; }
.help-prose li + li { margin-top: 6px; }
.help-prose li::marker { color: var(--ds-text-3); font-variant-numeric: tabular-nums; }
.help-prose strong { color: var(--ds-text); font-weight: 600; }

/* Notas: caja neutra con icono, sin franjas de color */
.help-note {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 12px 14px;
    border: 1px solid var(--ds-border);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-2);
    font-size: var(--ds-text-sm);
    line-height: 1.6;
}
.help-note .ds-icon { margin-top: 2px; color: var(--ds-text-3); }
.help-prose .help-note p { margin: 0; font-size: inherit; line-height: inherit; }

/* Tabla de límites */
.help-table { margin-top: 20px; overflow-x: auto; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow-card); }
.help-table table { width: 100%; border-collapse: collapse; font-size: var(--ds-text-sm); }
.help-table th { padding: 10px 16px; border-bottom: 1px solid var(--ds-border); background: var(--ds-bg); color: var(--ds-text-3); font-size: var(--ds-text-xs); font-weight: 500; text-align: left; white-space: nowrap; }
.help-table td { padding: 10px 16px; color: var(--ds-text); }
.help-table tbody tr + tr td { border-top: 1px solid var(--ds-border); }
.help-table :is(th, td):not(:first-child) { width: 1%; text-align: right; white-space: nowrap; }
.help-table td:not(:first-child) { color: var(--ds-text-2); font-family: var(--ds-font-mono); font-feature-settings: normal; font-variant-numeric: tabular-nums; }
.help-table td:last-child { color: var(--ds-text); }

/* Solución de problemas */
.help-faq { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.help-faq article { padding: 16px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow-card); }
.help-faq h3 { margin: 0; }
.help-prose .help-faq p { margin-top: 6px; font-size: var(--ds-text-sm); line-height: 1.6; }

.help .help-crosslink { margin-top: 32px; color: var(--ds-text-2); font-size: var(--ds-text-sm); }

/* ---------- Comandos ---------- */
.help-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.help-search {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
    max-width: 480px;
    height: 40px;
    padding: 0 8px 0 12px;
    border: 1px solid var(--ds-border-control);
    border-radius: var(--ds-radius-md);
    background: var(--ds-surface);
    color: var(--ds-text-3);
    cursor: text;
    transition: border-color var(--ds-ease), box-shadow var(--ds-ease);
}
.help-search:hover { border-color: var(--ds-text-3); }
.help-search:focus-within { border-color: var(--ds-focus); box-shadow: 0 0 0 1px var(--ds-focus); }
.help-search input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; background: transparent; color: var(--ds-text); font: inherit; font-size: var(--ds-text-base); outline: none; }
.help-search input::placeholder { color: var(--ds-text-3); }
.ds-site .help-search input:focus-visible { outline: none; }
.help-search:focus-within kbd { visibility: hidden; }
.help-count { margin-left: auto; color: var(--ds-text-3); font-size: var(--ds-text-sm); white-space: nowrap; }

.command-list { overflow: hidden; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); box-shadow: var(--ds-shadow-card); }
.command-row { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 24px; padding: 14px 20px; transition: background-color var(--ds-ease); }
.command-row:hover { background: var(--ds-surface-hover); }
/* Separadores solo entre filas visibles (el buscador oculta filas con [hidden]). */
.command-row:not([hidden]) ~ .command-row:not([hidden]) { border-top: 1px solid var(--ds-border); }
.command-name { align-self: start; overflow: hidden; color: var(--ds-text); font-size: var(--ds-text-base); font-weight: 500; line-height: 20px; white-space: nowrap; text-overflow: ellipsis; }
.command-slash { color: var(--ds-text-3); }
.command-body { min-width: 0; }
.command-body p { color: var(--ds-text-2); font-size: var(--ds-text-base); line-height: 20px; }
.command-subs { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.command-subs li code { display: inline-block; padding: 0 6px; border: 1px solid var(--ds-border); border-radius: 4px; background: var(--ds-bg); color: var(--ds-text-2); font-size: 12px; line-height: 20px; }
.help-empty { display: grid; justify-items: center; gap: 4px; padding: 48px 16px; border: 1px dashed var(--ds-border-strong); border-radius: var(--ds-radius-lg); color: var(--ds-text-2); font-size: var(--ds-text-sm); text-align: center; }
.help-empty .ds-icon { width: 18px; height: 18px; margin-bottom: 4px; color: var(--ds-text-3); }
.help-empty strong { color: var(--ds-text); font-weight: 600; }

/* ---------- Legal ---------- */
.help-notice { display: flex; gap: 10px; max-width: 720px; margin-bottom: 40px; padding: 12px 14px; border: 1px solid color-mix(in srgb, var(--ds-warning) 35%, transparent); border-radius: var(--ds-radius-md); background: color-mix(in srgb, var(--ds-warning) 6%, transparent); color: var(--ds-text); font-size: var(--ds-text-sm); line-height: 1.6; }
.help-notice .ds-icon { margin-top: 2px; color: var(--ds-warning); }
.help-notice strong { font-weight: 600; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .help-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .help-index { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 8px; max-height: none; padding: 12px 6px; border: 1px solid var(--ds-border); border-radius: var(--ds-radius-lg); background: var(--ds-surface); }
    .help-index-title { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
    .help-shortcuts { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 32px; }
    .help-faq { grid-template-columns: minmax(0, 1fr); }
    .command-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
}
@media (max-width: 560px) {
    .help { padding-block: 24px 56px; }
    .help-header h1 { font-size: var(--ds-text-xl); line-height: 32px; }
    .help-header p { font-size: var(--ds-text-base); }
    .help-index { grid-template-columns: minmax(0, 1fr); }
    .help-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
    .help-search { flex: none; max-width: none; }
    .help-count { margin-left: 0; }
}
