/* The client's help: a home with the topics, and topic pages rendered from Markdown. Layout and type only;
   every colour and face comes from the directory tokens in home.css, which the shell loads first. A topic
   page is the article with the topics in a sticky column beside it, one column below 960px. */

.help { max-width: 1120px; min-width: 0; }
.help-head { padding-bottom: 22px; min-width: 0; }
.help-head h1 {
    margin-top: 10px;
    color: var(--dir-text);
    font-size: clamp(30px, 5vw, 50px);
    font-weight: 500;
    letter-spacing: -0.035em;
    line-height: 1.02;
    overflow-wrap: anywhere;
}
.help-lede { max-width: 64ch; margin-top: 16px !important; color: var(--dir-muted); font-size: 17px; line-height: 1.55; }

/* The help home: the topics as a numbered grid of links. */
.help-topics {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 14px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
    counter-reset: topic;
}
.help-topics li { counter-increment: topic; min-width: 0; }
.help-topics a {
    display: block;
    height: 100%;
    padding: 18px 20px;
    border: 1px solid var(--dir-line);
    border-radius: 12px;
    background: var(--dir-surface);
    color: var(--dir-muted);
    font-size: 14px;
    line-height: 1.5;
}
.help-topics a:hover { border-color: var(--dir-accent); }
.help-topics strong { display: block; margin-bottom: 6px; color: var(--dir-text); font-size: 16px; font-weight: 600; }
.help-topics strong::before { content: counter(topic) ". "; color: var(--dir-faint); font-weight: 500; }
.help-more { margin-top: 34px !important; color: var(--dir-muted); font-size: 14px; }
.help-more a { color: var(--dir-accent-bright); }

/* A topic page. */
.help-page { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 56px; align-items: start; }
.help-article { min-width: 0; max-width: 760px; }
.help-toc { margin-bottom: 28px; padding: 16px 20px; border-left: 2px solid var(--dir-accent); background: var(--dir-surface); border-radius: 0 10px 10px 0; }
.help-toc p { color: var(--dir-faint); font-family: var(--dir-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.help-toc ul { margin: 8px 0 0; padding-left: 18px; }
.help-toc li { margin-top: 4px; font-size: 14px; }
.help-toc a { color: var(--dir-accent-bright); }

.help-body { color: var(--dir-muted); font-size: 16px; line-height: 1.7; }
.help-body > * + * { margin-top: 16px !important; }
.help-body h2 {
    margin-top: 44px !important;
    padding-top: 6px;
    color: var(--dir-text);
    font-size: 26px;
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.2;
    scroll-margin-top: 90px;
}
.help-body h3 { margin-top: 30px !important; color: var(--dir-text); font-size: 18px; font-weight: 600; scroll-margin-top: 90px; }
.help-body p, .help-body li { max-width: 72ch; }
.help-body ul, .help-body ol { padding-left: 22px; }
.help-body li + li { margin-top: 6px; }
.help-body strong { color: var(--dir-text); font-weight: 600; }
.help-body a { color: var(--dir-accent-bright); text-decoration: underline; text-underline-offset: 3px; }
.help-body code {
    padding: 1px 5px;
    border-radius: 4px;
    background: var(--dir-raised);
    color: var(--dir-text);
    font-family: var(--dir-mono);
    font-size: .88em;
}
.help-body pre {
    overflow-x: auto;
    padding: 16px 18px;
    border: 1px solid var(--dir-line);
    border-radius: 10px;
    background: var(--dir-rail);
    line-height: 1.55;
}
.help-body pre code { padding: 0; background: none; font-size: 13px; }
.help-body blockquote { padding: 12px 18px; border-left: 2px solid var(--dir-accent); background: var(--dir-surface); border-radius: 0 10px 10px 0; }
.help-body table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 14px; }
.help-body th, .help-body td { padding: 8px 14px; border-bottom: 1px solid var(--dir-line); text-align: left; vertical-align: top; }
.help-body th { color: var(--dir-text); font-weight: 600; }
/* Screenshots: Markdown images, shown like windows on the page. Never wider than they were captured: a panel
   cropped from the client stays at its own size instead of being blown up to the column's width. */
.help-body img {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    margin: 6px 0 4px;
    border-radius: 10px;
    box-shadow: 0 0 0 1px var(--dir-line), var(--dir-shadow-card);
}

.help-steps { display: flex; gap: 14px; justify-content: space-between; margin-top: 54px; padding-top: 22px; border-top: 1px solid var(--dir-line); }
.help-steps a { display: flex; flex-direction: column; gap: 4px; max-width: 48%; color: var(--dir-accent-bright); font-size: 15px; }
.help-steps small { color: var(--dir-faint); font-size: 12px; }
.help-next { margin-left: auto; text-align: right; }

.help-side { position: sticky; top: 90px; min-width: 0; font-size: 14px; }
.help-side p a { color: var(--dir-text); font-weight: 600; }
.help-side ol { margin: 12px 0 0; padding: 0; list-style: none; border-left: 1px solid var(--dir-line); }
.help-side li a { display: block; padding: 6px 0 6px 14px; margin-left: -1px; border-left: 2px solid transparent; color: var(--dir-muted); }
.help-side li a:hover { color: var(--dir-text); }
.help-side li a[aria-current="page"] { border-left-color: var(--dir-accent); color: var(--dir-text); font-weight: 600; }

@media (max-width: 960px) {
    .help-page { grid-template-columns: 1fr; gap: 40px; }
    .help-side { position: static; padding-top: 24px; border-top: 1px solid var(--dir-line); }
}
