/* The staff guide (Plan 15): /help and /help/:chapter. Tokens come from staff.css. */
.help { max-width: 46rem; font-size: 1.0625rem; line-height: 1.6; }
.help h2, .help h3 { line-height: 1.25; margin-top: 2rem; }
.help h2:target, .help h3:target { scroll-margin-top: 1rem; }
.help input[type="search"] { display: block; width: 100%; margin: .25rem 0 1rem; padding: .6rem .75rem; font: inherit; border: 1px solid var(--bb-line); border-radius: 8px; background: var(--bb-card); }
.help-toc { padding-left: 1.25rem; }
.help-toc__chapter { margin-bottom: 1rem; font-weight: 600; }
.help-toc__chapter ul { font-weight: 400; margin: .25rem 0 0; }
.help-contents { background: var(--bb-card); border: 1px solid var(--bb-line); border-radius: 8px; padding: .75rem 1rem; margin-bottom: 1.5rem; }
.help-contents__title { margin: 0 0 .25rem; font-weight: 700; color: var(--bb-dusk); }
.help-contents ol { margin: 0; padding-left: 1.25rem; }
figure.shot { margin: 1.25rem 0; }
figure.shot img { max-width: 100%; height: auto; border: 1px solid var(--bb-line); border-radius: 8px; }
figure.shot figcaption { color: var(--bb-muted); font-size: .875rem; margin-top: .25rem; }
.callout { border-left: 4px solid var(--bb-muted); background: var(--bb-card); padding: .5rem 1rem; margin: 1rem 0; border-radius: 0 8px 8px 0; }
.callout--before { border-left-color: var(--bb-dusk); }
.callout--tip { border-left-color: var(--bb-muted); }
.callout--irreversible { border-left-color: var(--bb-bad); }
.callout--irreversible .callout__title::before { content: "⚠️ "; }
strong.ui { font-weight: 700; }
.anchor { opacity: 0; margin-left: .35rem; text-decoration: none; }
h2:hover .anchor, h3:hover .anchor, .anchor:focus { opacity: 1; }
.help-foot { margin-top: 2.5rem; border-top: 1px solid var(--bb-line); padding-top: 1rem; }
.help-foot__nav { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
@media (max-width: 600px) {
  figure.shot { margin-inline: -1.25rem; }
  figure.shot img { border-radius: 0; border-inline: 0; }
}
@media print {
  .topbar, .venuenav, .skip, .help-contents, .help-foot__nav, .helpbtn, .helpmenu, .welcome { display: none !important; }
  body { background: #fff; }
  figure.shot { break-inside: avoid; }
  figure.shot img { max-width: 100%; max-height: 60vh; }
  a[href^="/"]::after { content: none; }
}

/* ---- Help chrome on every staff screen (Plan 15 Task 4; injected by src/lib/help/inject.ts) ---- */

/* Top bar: Help sits beside Sign out and takes over the push to the right. The sibling
   selector keeps Sign out right-aligned on any page that has no Help link. */
.topbar__help { margin-left: auto; color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; padding: .4rem .25rem; }
.topbar__help + .topbar__out { margin-left: 0; }
body.door .topbar__help { color: var(--d-cream); }

/* The ? menu: last in .page__head, after the page's own actions. */
.helpmenu { position: relative; align-self: flex-start; }
.page__head .actions + .helpmenu { margin-left: 0; }
.page__head > h1 + .helpmenu { margin-left: auto; }
summary.helpbtn-toggle {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  width: 2rem; height: 2rem; border: 2px solid var(--bb-dusk); border-radius: 50%;
  color: var(--bb-dusk); font-weight: 700; line-height: 1; background: var(--bb-card); position: relative;
}
/* A 44px touch target around the 2rem circle. */
summary.helpbtn-toggle::after { content: ""; position: absolute; inset: -.4rem; }
summary.helpbtn-toggle::-webkit-details-marker { display: none; }
summary.helpbtn-toggle::marker { content: ""; }
.helpmenu[open] summary.helpbtn-toggle { background: var(--bb-dusk); color: #fff; }
.helpmenu__panel {
  position: absolute; right: 0; top: calc(100% + .25rem); z-index: 20; min-width: 15rem;
  background: var(--bb-card); color: var(--bb-ink); border: 1px solid var(--bb-line); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(31, 36, 48, .15); padding: .5rem .75rem; display: grid; gap: .25rem;
}
.helpmenu__panel a, .helpmenu__panel .linkish { display: flex; align-items: center; min-height: 44px; }
.helpmenu__panel form { margin: 0; }
.linkish { font: inherit; color: var(--bb-dusk); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
body.door summary.helpbtn-toggle { border-color: var(--d-gold); color: var(--d-gold); background: transparent; }
body.door .helpmenu[open] summary.helpbtn-toggle { background: var(--d-gold); color: var(--d-bg); }

/* The first-visit welcome panel, straight after .page__head. */
.welcome { background: var(--bb-card); border: 1px solid var(--bb-line); border-left: 4px solid var(--bb-dusk); border-radius: 0 8px 8px 0; padding: .9rem 1.1rem; margin: 0 0 1.5rem; }
.welcome__title { margin: 0 0 .25rem; font-weight: 700; color: var(--bb-dusk); }
.welcome__lead { margin: 0 0 .5rem; }
.welcome__steps { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; margin: 0 0 .75rem; padding-left: 1.25rem; }
.welcome__steps a { display: inline-flex; align-items: center; min-height: 44px; }
.welcome__actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0; }
@media (max-width: 40rem) {
  .welcome__steps { flex-direction: column; gap: 0; }
}

/* The door: dark and compact. The title stays for assistive tech (aria-labelledby) but takes
   no line. The steps WRAP rather than scroll, so all three are always visible (Task 4 review);
   at 390px that is about four lines: two for the lead, one or two for the steps, one for the actions. */
.welcome--door { background: #1b1f27; color: #e8eaf0; border-color: #1b1f27; border-left-color: var(--d-gold, #c9a35a); padding: .6rem; max-height: none; margin-bottom: 1rem; font-size: .875rem; line-height: 1.35; }
.welcome--door .welcome__title {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.welcome--door .welcome__lead { margin: 0 0 .15rem; }
.welcome--door .welcome__steps { flex-direction: row; flex-wrap: wrap; gap: 0 1.25rem; margin: 0 0 .15rem; padding-left: 1rem; }
.welcome--door .welcome__steps a { min-height: 44px; color: #e8eaf0; }
.welcome--door .welcome__actions { flex-wrap: nowrap; gap: .5rem; }
.welcome--door .welcome__actions .button { min-height: 44px; padding: .3rem .8rem; font-size: .875rem; }
.welcome--door .welcome__actions .button--ghost { color: #e8eaf0; border-color: #e8eaf0; }

/* Contextual help links: "What do I do?" after a problem, and "How?" after a label. */
.helplink { font-size: .875rem; text-decoration: underline; text-underline-offset: 2px; }
.howlink { font-size: .8125rem; color: var(--bb-muted); margin-left: .35rem; }
body.door .howlink { color: var(--d-mute); }
