/* ── Help & FAQ ───────────────────────────────────────────────────────────────
   Read on a laptop in the timing tent and on a phone on the pontoon, so the
   layout collapses to one column early and the type stays large enough to scan
   in sunlight. Colours are all tokens — the page has to work in light mode,
   which is what the team uses outdoors. */

.help-search {
    width: 100%;
    max-width: 520px;
    margin-bottom: 24px;
}

.help-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 32px;
    align-items: start;
}

/* ── Section index ── */
.help-sidebar {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.help-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-left: 2px solid transparent;
}

.help-sidebar-link:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border-left-color: var(--accent);
}

.help-sidebar-icon { font-size: 1rem; line-height: 1; }

/* ── Sections ── */
.help-body {
    display: flex;
    flex-direction: column;
    gap: 28px;
    min-width: 0;
}

.help-section {
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
}

.help-section-head {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding-bottom: 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.help-section-icon { font-size: 1.5rem; line-height: 1.2; }
.help-section-head h2 { margin: 0; font-size: 1.25rem; }
.help-section-blurb {
    margin: 2px 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ── Question / answer ── */
.help-entry { border-bottom: 1px solid var(--border-light); }
.help-entry:last-child { border-bottom: none; }

.help-entry > summary {
    cursor: pointer;
    padding: 12px 0 12px 22px;
    font-weight: 600;
    list-style: none;
    position: relative;
}

.help-entry > summary::-webkit-details-marker { display: none; }

/* Own marker so it can rotate rather than jump between glyphs. */
.help-entry > summary::before {
    content: '\25B8';
    position: absolute;
    left: 2px;
    color: var(--accent);
    transition: transform 0.15s ease;
}

.help-entry[open] > summary::before { transform: rotate(90deg); }
.help-entry > summary:hover { color: var(--accent); }

.help-answer {
    padding: 0 0 16px 22px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.65;
}

.help-answer p { margin: 0 0 12px; }
.help-answer > *:last-child { margin-bottom: 0; }

.help-steps, .help-list { margin: 0 0 12px; padding-left: 20px; }
.help-steps li, .help-list li { margin-bottom: 6px; }
.help-steps { counter-reset: help-step; }

/* ── Callouts ── */
.help-callout {
    padding: 10px 14px;
    margin: 0 0 12px;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
    background: var(--bg-secondary);
    font-size: 0.9rem;
}

.help-callout--note { border-left-color: var(--accent); }
.help-callout--warn {
    border-left-color: var(--red, #dc2626);
    background: var(--red-soft, rgba(239, 68, 68, 0.12));
    color: var(--text-primary);
}

/* ── Hotkey legend ── */
.help-keys {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.help-key-row { display: flex; align-items: center; gap: 10px; }

.help-key-row kbd {
    flex: 0 0 auto;
    min-width: 72px;
    text-align: center;
    padding: 3px 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.8rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
}

/* ── Tables ── */
.help-table-wrap { overflow-x: auto; margin-bottom: 12px; }

.help-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.help-table th, .help-table td {
    padding: 7px 10px;
    text-align: left;
    border-bottom: 1px solid var(--border-light);
    vertical-align: top;
}

.help-table thead th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.help-table tbody th {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* ── Narrow screens ── */
@media (max-width: 860px) {
    .help-layout { grid-template-columns: 1fr; gap: 16px; }
    .help-sidebar {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }
    .help-sidebar-link {
        border-left: none;
        border: 1px solid var(--border);
        padding: 6px 10px;
        font-size: 0.85rem;
    }
    .help-sidebar-link:hover { border-color: var(--accent); }
    .help-section { padding: 16px; }
}
