/* Help pages (ROADMAP F21, templates/help/) and the first-visit tour (static/js/tour.js). Tokens from app.css. */

.help-page { max-width: 1150px; }

/* index */
.help-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

a.help-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    height: 100%;
    color: var(--ink);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

/* lifts slightly on hover, like the tool cards (ROADMAP F88) */
a.help-card:hover { border-color: var(--accent); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.help-card-title { font-size: calc(18px * var(--text-scale, 1)); font-weight: 600; color: var(--link); }
.help-card-text { color: var(--ink-dim); font-size: calc(16px * var(--text-scale, 1)); }
.help-foot { margin-top: 18px; color: var(--ink-dim); }

/* topic pages */
.help-crumb { margin: 0; font-size: var(--fs-meta); color: var(--ink-faint); }
.help-crumb a { color: var(--link); }

.help-layout {
    display: grid;
    grid-template-columns: 230px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.help-menu { position: sticky; top: 12px; }
.help-menu ul { list-style: none; margin: 0; padding: 0; }
.help-menu li a {
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius, 8px);
    color: var(--ink-dim);
    text-decoration: none;
    font-size: calc(16px * var(--text-scale, 1));
}
.help-menu li a:hover { background: var(--panel-2); color: var(--ink); }
.help-menu li a.active { background: var(--panel-2); color: var(--ink); font-weight: 600; }
.help-menu-foot { margin-top: 12px; padding: 0 10px; font-size: calc(15px * var(--text-scale, 1)); line-height: 1.8; }
.help-menu-foot a { color: var(--link); }

.help-text { max-width: 82ch; font-size: calc(17px * var(--text-scale, 1)); line-height: 1.6; }
.help-text h2 { font-size: calc(19px * var(--text-scale, 1)); font-weight: 600; margin: 22px 0 8px; }
.help-text h2:first-child { margin-top: 0; }
.help-text a { color: var(--link); }
.help-text ul, .help-text ol { padding-inline-start: 22px; }
.help-text li { margin-bottom: 6px; }
.help-text code { color: var(--ink); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: calc(15.5px * var(--text-scale, 1)); }
.help-lead { font-size: calc(18px * var(--text-scale, 1)); color: var(--ink); }
.help-note { color: var(--ink-dim); font-size: calc(16px * var(--text-scale, 1)); }

.help-example {
    margin: 12px 0 14px;
    padding: 10px 14px;
    border-inline-start: 3px solid var(--accent);
    background: var(--panel-2);
    border-radius: 0 var(--radius, 8px) var(--radius, 8px) 0;
    font-size: calc(16.5px * var(--text-scale, 1));
}

.help-table { width: 100%; border-collapse: collapse; margin: 8px 0 14px; font-size: calc(16px * var(--text-scale, 1)); }
.help-table th, .help-table td { text-align: start; padding: 6px 8px; border-bottom: 1px solid var(--border); vertical-align: top; white-space: normal; }   /* sentences wrap: no sideways scroll in the help (2026-10-30) */
.help-table th { color: var(--ink-dim); font-weight: 600; }

@media (max-width: 768px) {
    .help-layout { grid-template-columns: 1fr; }
    .help-menu { position: static; }
    .help-menu ul { display: flex; flex-wrap: wrap; gap: 4px; }
    .help-table { font-size: calc(15px * var(--text-scale, 1)); }
}

/* The animated guides (help_guides.js; owner, 2026-11-29): a chart card per case, the play bar, the hands-on chart */
.guide-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 10px 0 4px; }
.guide-btn, .guide-seg button, .guide-try-bar select { font: inherit; font-size: calc(14px * var(--text-scale, 1)); color: var(--ink);
    background: var(--raised); border: 1px solid var(--border); border-radius: 8px; padding: 5px 12px; cursor: pointer; }
.guide-btn:hover, .guide-seg button:hover { border-color: var(--ink-faint); }
.guide-legend { font-size: calc(14px * var(--text-scale, 1)); color: var(--ink-dim); display: inline-flex; align-items: center; gap: 6px; }
.guide-legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; }
.guide-legend .is-avg { background: var(--chart-compare); }
.guide-legend .is-close { width: 8px; height: 8px; border-radius: 50%; background: var(--link); }
.guide-legend .is-ghost { background: repeating-linear-gradient(90deg, var(--violet) 0 4px, transparent 4px 7px); }
.guide-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 10px 0 14px; }
.guide-stack { display: grid; gap: 14px; margin: 10px 0 14px; }
.guide-card { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; min-width: 0; }
.guide-card figcaption { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
    padding: 10px 12px 2px; font-weight: 600; }
.guide-card canvas { display: block; width: 100%; height: 270px; }
.guide-pair .guide-card canvas { height: 230px; }
.guide-card > p { margin: 0; padding: 0 12px 12px; color: var(--ink-dim); }
.guide-tag { font-size: calc(12.5px * var(--text-scale, 1)); font-weight: 600; padding: 2px 9px; border-radius: 999px; border: 1px solid currentColor; white-space: nowrap; }
.guide-tag.is-take { color: var(--up-ink); }
.guide-tag.is-skip { color: var(--down-ink); }
.guide-try-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 4px 12px 8px; color: var(--ink-dim); }
.guide-seg { display: inline-flex; }
.guide-seg button { border-radius: 0; margin-inline-start: -1px; min-width: 38px; padding: 5px 8px; }
.guide-seg button:first-child { border-start-start-radius: 8px; border-end-start-radius: 8px; }
.guide-seg button:last-child { border-start-end-radius: 8px; border-end-end-radius: 8px; }
.guide-seg button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* The test period's guide (guide_period.js; owner, 2026-11-29): its legend, the taller charts, the hands-on boxes */
.guide-legend .is-search, .guide-legend .is-check, .guide-legend .is-exam { width: 14px; height: 10px; border-radius: 3px; }
.guide-legend .is-search { background: color-mix(in srgb, var(--chart-compare) 55%, transparent); }
.guide-legend .is-check { background: color-mix(in srgb, var(--link) 55%, transparent); }
.guide-legend .is-exam { background: repeating-linear-gradient(135deg, var(--violet) 0 2px, transparent 2px 5px); border: 1px solid var(--violet); }
.guide-card canvas.guide-tall { height: 250px; }
.guide-try-bar input[type="date"] { font: inherit; color: var(--ink); background: var(--raised); border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; }
.guide-try-bar input[type="range"] { width: 120px; vertical-align: middle; accent-color: var(--accent); }
.guide-try-bar output { display: inline-block; min-width: 3.2em; color: var(--ink); font-weight: 600; }
@media (max-width: 640px) {
    .guide-pair { grid-template-columns: 1fr; }
    .guide-card canvas { height: 240px; }
    .guide-card canvas.guide-tall { height: 270px; }
}

/* A Help page inside the Brain's guide popup (?popout=1, guide_popup.js; owner, 2026-11-29): only the text */
html.is-popout .help-page .page-head,
html.is-popout .help-menu { display: none !important; }
html.is-popout .help-layout { grid-template-columns: 1fr; }
html.is-popout .help-text { max-width: none; }

/* The Researcher's road map (guide_road.js; owner, 2026-12-02): a track of stations, a dot travelling it, the step's
   card and the map of the Researcher page. Stacked under 760px. */
.road { margin: 10px 0 16px; }
.road .guide-bar { justify-content: space-between; }
.road-ctrl { display: inline-flex; align-items: center; gap: 6px; }
.road-count { min-width: 52px; text-align: center; color: var(--ink-dim); font-variant-numeric: tabular-nums; font-size: calc(14px * var(--text-scale, 1)); }
.road-trackbox { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 12px 16px; margin-top: 8px; overflow-x: auto; }
.road-track { position: relative; display: grid; grid-template-columns: repeat(9, minmax(72px, 1fr)); gap: 10px 8px; min-width: 720px; }
.road-band { grid-row: 1; font-size: calc(12px * var(--text-scale, 1)); font-weight: 600; text-transform: uppercase; letter-spacing: .05em;
    color: var(--ink-dim); border-bottom: 2px solid var(--border); padding-bottom: 3px; margin-bottom: 8px; }
.road-band.is-brain { grid-column: 1 / 3; } .road-band.is-research { grid-column: 3 / 8; color: var(--link); border-color: var(--link); }
.road-band.is-bot { grid-column: 8 / 10; }
.road-st { position: relative; grid-row: 2; display: grid; gap: 2px; align-content: start; text-align: center; padding: 9px 6px 8px;
    background: var(--panel-2); border: 1.5px solid var(--border); border-radius: 9px; transition: border-color .3s, background .3s, opacity .3s; }
.road-st b { font-weight: 500; font-size: calc(12px * var(--text-scale, 1)); color: var(--ink-faint); }
.road-st span:not(.road-mark) { font-weight: 600; font-size: calc(14px * var(--text-scale, 1)); line-height: 1.25; }
.road-st small { font-size: calc(12px * var(--text-scale, 1)); color: var(--ink-dim); }
.road-st small.is-hard { color: var(--down-ink); } .road-st small.is-soft { color: var(--gold); }
.road-st.is-side { grid-row: 3; grid-column: 5 / 7; border-style: dashed; margin-top: 14px; }
.road-mark { position: absolute; top: -9px; inset-inline-end: -6px; width: 21px; height: 21px; border-radius: 50%; display: none;
    place-items: center; font-size: calc(12px * var(--text-scale, 1)); font-weight: 700; color: var(--panel); }
.road-st.is-ok { border-color: var(--up-ink); } .road-st.is-ok .road-mark { display: grid; background: var(--up-ink); }
.road-st.is-warn { border-color: var(--gold); } .road-st.is-warn .road-mark { display: grid; background: var(--gold); }
.road-st.is-stop { border-color: var(--down-ink); } .road-st.is-stop .road-mark { display: grid; background: var(--down-ink); }
.road-st.is-pass { border-color: var(--link); }
.road-st.is-active { background: var(--accent-soft); border-color: var(--link); box-shadow: 0 0 0 3px var(--accent-soft); }
.road-st.is-dim { opacity: .4; }
.road-token { position: absolute; z-index: 3; inset-inline-start: 0; top: 0; width: 22px; height: 22px; border-radius: 50%; pointer-events: none;
    background: var(--link); border: 3px solid var(--surface); box-shadow: var(--shadow-sm); transition: transform .9s cubic-bezier(.6,.05,.3,1), background .4s; }
.road-token.is-ok { background: var(--up-ink); } .road-token.is-warn { background: var(--gold); } .road-token.is-stop { background: var(--down-ink); }
.road-lower { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; margin-top: 14px; align-items: start; }
.road-card, .road-map { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; min-width: 0; }
.road-card { display: grid; gap: 8px; }
.road-card h3, .road-map h3 { margin: 0; font-size: calc(17px * var(--text-scale, 1)); font-weight: 600; }
.road-card p { margin: 0; }
.road-where { font-size: calc(13.5px * var(--text-scale, 1)); color: var(--link); font-weight: 600; }
.road-press { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.road-press-label { font-size: calc(12px * var(--text-scale, 1)); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-faint); }
.road-fake { font-size: calc(14px * var(--text-scale, 1)); font-weight: 600; border-radius: 7px; padding: 3px 10px;
    background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.road-fake.is-plain { background: transparent; color: var(--link); border-color: var(--link); }
.road-pill { font-size: calc(13px * var(--text-scale, 1)); font-weight: 600; padding: 1px 9px; border-radius: 999px; border: 1px solid currentColor; }
.road-pill.is-ok { color: var(--up-ink); } .road-pill.is-warn { color: var(--gold); } .road-pill.is-stop { color: var(--down-ink); }
.road-pill.is-info { color: var(--link); }
.road-note { color: var(--ink-dim); font-size: calc(15px * var(--text-scale, 1)); border-inline-start: 3px solid var(--border); padding-inline-start: 9px; }
.road-map ol { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 4px; }
.road-map li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 8px; border-radius: 6px; border: 1px solid transparent;
    font-size: calc(14.5px * var(--text-scale, 1)); margin: 0; }
.road-map li.is-on { background: var(--accent-soft); border-color: var(--link); font-weight: 600; }
.road-map-step { color: var(--ink-faint); white-space: nowrap; font-size: calc(12.5px * var(--text-scale, 1)); }
@media (max-width: 760px) {
    .road-lower { grid-template-columns: 1fr; }
    .road-trackbox { overflow-x: visible; }
    .road-track { grid-template-columns: 1fr; min-width: 0; padding-inline-start: 30px; }
    .road-band { display: none; }
    .road-st, .road-st.is-side { grid-row: auto; grid-column: 1; text-align: start; margin-top: 0; }
    .road-st.is-side { margin-inline-start: 18px; }
}
@media (prefers-reduced-motion: reduce) { .road-token, .road-st { transition: none; } }
