/* Zappit Hilfe (docs/hilfe.md): the server-rendered pages under /help and the help sheet in the app. Mobile first, light
   only, colours from the tokens of zappit.css. The text body (.help-body) is shared by page and sheet; its screenshots
   float only when the body itself is wide enough (container query), so the sheet on a phone never squeezes the text. */
:root {
  --help-text-max: 680px;
  --help-side-width: 248px;
  --help-toc-width: 220px;
  --help-phone-width: 232px;
  --help-phone-bezel: #1d1f2b;
  --help-phone-edge: rgba(255, 255, 255, .08);
  --help-phone-shadow: 0 10px 28px rgba(39, 31, 102, .18);
}

body.help { min-height: 100dvh; display: flex; flex-direction: column; }

.help-skip { position: absolute; left: var(--z-gutter); top: -100px; z-index: var(--z-layer-dialog); padding: 10px 14px; border-radius: var(--z-radius-small); background: var(--z-surface); box-shadow: var(--z-shadow); }
.help-skip:focus { top: 8px; }

.help-header { border-bottom: 1px solid var(--z-border); background: var(--z-bar-bg); }
.help-header-inner { display: flex; align-items: center; gap: 16px; max-width: 1360px; min-height: var(--z-bar-height); margin: 0 auto; padding: 0 var(--z-gutter); }
.help-brand { display: inline-flex; align-items: center; min-height: var(--z-touch-target); }
.help-brand .brand-logo { width: 104px; height: auto; }
.help-header-link { display: inline-flex; align-items: center; min-height: var(--z-touch-target); padding: 0 4px; color: var(--z-text); font-weight: 700; text-decoration: none; }
.help-header-link:hover { color: var(--z-primary); }

.help-layout { flex: 1; width: 100%; max-width: 1360px; margin: 0 auto; padding: 20px var(--z-gutter) 40px; }
.help-main { min-width: 0; }
.help-side { display: none; }

.help-main h1 { margin-top: 4px; overflow-wrap: anywhere; }
.help-lead { margin: 0 0 20px; color: var(--z-muted); font-size: var(--z-font-size-large); max-width: var(--help-text-max); }

/* Trail */
.help-trail ol { display: flex; flex-wrap: wrap; gap: 4px 0; margin: 0 0 8px; padding: 0; list-style: none; font-size: var(--z-font-size-small); }
.help-trail li + li::before { content: "›"; margin: 0 8px; color: var(--z-muted); }
.help-trail a { color: var(--z-muted); }

/* Search */
.help-search { margin: 0 0 28px; max-width: var(--help-text-max); }
.help-search label { display: block; margin-bottom: 6px; font-weight: 600; }
.help-search-row { display: flex; gap: 8px; }
.help-search input { flex: 1; min-width: 0; min-height: var(--z-touch-target); padding: 0 14px; border: 1px solid var(--z-border); border-radius: var(--z-radius-small); background: var(--z-surface); color: var(--z-text); font: inherit; }
.help-search input:focus-visible { outline: 2px solid var(--z-primary); outline-offset: 1px; }
.help-search button { min-height: var(--z-touch-target); padding: 0 18px; border: 0; border-radius: var(--z-radius-small); background: var(--z-primary); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.help-search button:hover { background: var(--z-primary-strong); }
.help-result-count { color: var(--z-muted); }

/* Overview and cards */
.help-audience { margin: 0 0 32px; }
.help-audience > h2 { font-size: 1.3rem; margin: 0 0 4px; }
.help-audience > h3 { margin: 20px 0 10px; font-size: 1.05rem; color: var(--z-muted); }
.help-cards { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.help-card { display: flex; flex-direction: column; gap: 4px; min-height: var(--z-touch-target); padding: 14px 16px; border: 1px solid var(--z-border); border-radius: var(--z-radius); background: var(--z-surface); color: var(--z-text); text-decoration: none; box-shadow: var(--z-shadow); }
.help-card strong { color: var(--z-primary-strong); }
.help-card span { color: var(--z-muted); font-size: var(--z-font-size-small); }
.help-card:hover { border-color: var(--z-primary); }
@media (min-width: 720px) { .help-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Page */
.help-article { max-width: var(--help-text-max); }
.help-toc { margin: 0 0 24px; padding: 4px 16px; border: 1px solid var(--z-border); border-radius: var(--z-radius-small); background: var(--z-surface); }
.help-toc summary { min-height: var(--z-touch-target); display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.help-toc ol, .help-toc-aside ol { margin: 0 0 8px; padding-left: 20px; }
.help-toc li, .help-toc-aside li { margin: 4px 0; }
.help-toc a, .help-toc-aside a { display: block; padding: 4px 0; }
.help-toc-sub { margin-left: 14px !important; list-style: circle; }
.help-toc-aside { display: none; }
.help-toc-title { margin: 0 0 8px; font-weight: 700; }
.help-updated { clear: both; margin: 28px 0 0; color: var(--z-muted); font-size: var(--z-font-size-small); }
.help-related { clear: both; margin: 36px 0 0; max-width: var(--help-text-max); }
.help-more { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--z-border); max-width: var(--help-text-max); }
.help-more .help-search { margin-bottom: 0; }

/* Side navigation */
.help-nav { font-size: var(--z-font-size-small); }
.help-nav-title { margin: 18px 0 6px; font-weight: 700; color: var(--z-muted); }
.help-nav-title:first-child { margin-top: 0; }
.help-nav ul { margin: 0; padding: 0; list-style: none; }
.help-nav a { display: block; padding: 6px 10px; border-radius: var(--z-radius-small); color: var(--z-text); text-decoration: none; }
.help-nav a:hover { background: var(--z-primary-soft); }
.help-nav a[aria-current="page"] { background: var(--z-primary-soft); color: var(--z-primary-strong); font-weight: 700; }

@media (min-width: 1024px) {
  .help-layout-nav { display: grid; grid-template-columns: var(--help-side-width) minmax(0, 1fr); gap: 40px; }
  .help-side { display: block; position: sticky; top: 16px; align-self: start; max-height: calc(100dvh - 32px); overflow-y: auto; }
}

@media (min-width: 1240px) {
  .help-page { display: grid; grid-template-columns: minmax(0, var(--help-text-max)) var(--help-toc-width); gap: 40px; }
  .help-toc { display: none; }
  .help-toc-aside { display: block; position: sticky; top: 16px; align-self: start; font-size: var(--z-font-size-small); }
}

/* Text body, shared by page and help sheet */
.help-body { container: help-body / inline-size; overflow-wrap: anywhere; }
.help-body::after { content: ""; display: block; clear: both; }
.help-body h2 { margin: 32px 0 8px; font-size: 1.25rem; line-height: 1.3; scroll-margin-top: 16px; }
.help-body h3 { margin: 24px 0 6px; font-size: 1.05rem; scroll-margin-top: 16px; }
.help-anchor { display: block; scroll-margin-top: 16px; }
.help-body p, .help-body ul, .help-body ol { margin: 0 0 14px; }
.help-body li { margin: 4px 0; }
.help-body blockquote { margin: 0 0 16px; padding: 12px 16px; border-left: 4px solid var(--z-warning); border-radius: 0 var(--z-radius-small) var(--z-radius-small) 0; background: var(--z-warning-soft); }
.help-body blockquote p:last-child { margin-bottom: 0; }
.help-body kbd { padding: 1px 6px; border: 1px solid var(--z-border); border-bottom-width: 2px; border-radius: 6px; background: var(--z-surface); font: inherit; font-size: .9em; }
.help-body code { font-family: var(--z-font-code); font-size: .92em; }
.help-body table { display: block; max-width: 100%; overflow-x: auto; margin: 0 0 16px; border-collapse: collapse; }
.help-body th, .help-body td { padding: 8px 10px; border-bottom: 1px solid var(--z-border); text-align: left; vertical-align: top; }
.help-body img { max-width: 100%; height: auto; }

/* Screenshot in a phone frame */
.help-shot { width: min(76%, 290px); margin: 8px auto 24px; }
@container help-body (min-width: 560px) {
  .help-shot { width: var(--help-phone-width); }
  .help-shot-right { float: right; margin: 6px 0 20px 28px; }
  .help-shot-left { float: left; margin: 6px 28px 20px 0; }
}
.help-phone { position: relative; padding: 24px 8px 8px; border-radius: 36px; background: var(--help-phone-bezel); box-shadow: inset 0 0 0 1px var(--help-phone-edge), var(--help-phone-shadow); }
.help-phone::before { content: ""; position: absolute; top: 8px; left: 50%; z-index: 1; width: 9px; height: 9px; border-radius: 50%; background: #3a3e52; transform: translateX(-50%); }
.help-phone::after { content: ""; position: absolute; top: 22%; right: -3px; width: 3px; height: 11%; border-radius: 0 3px 3px 0; background: var(--help-phone-bezel); }
.help-phone img { display: block; width: 100%; height: auto; border-radius: 18px 18px 28px 28px; background: var(--z-bg); }
.help-shot figcaption { margin-top: 12px; color: var(--z-muted); font-size: var(--z-font-size-small); line-height: 1.4; text-align: center; text-wrap: balance; }

.help-footer { border-top: 1px solid var(--z-border); }
.help-footer nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 20px; max-width: 1360px; margin: 0 auto; padding: 12px var(--z-gutter); font-size: var(--z-font-size-small); }
.help-footer a { display: inline-flex; align-items: center; min-height: var(--z-touch-target); color: var(--z-muted); }

/* (i) link and help sheet in the app (HelpLink, HelpSheet) */
.help-link { display: inline-flex; align-items: center; justify-content: center; flex: none; width: var(--z-touch-target); height: var(--z-touch-target); margin: calc((var(--z-touch-target) - 22px) / -2) 0; border-radius: 50%; color: var(--z-muted); vertical-align: middle; text-decoration: none; }
.help-link svg { width: 20px; height: 20px; }
.help-link:hover, .help-link:focus-visible { color: var(--z-primary); background: var(--z-primary-soft); }
.help-link:focus-visible { outline: 2px solid var(--z-primary); outline-offset: 0; }
.help-sheet-body { max-height: min(60dvh, 520px); overflow-y: auto; }
.help-sheet-status { color: var(--z-muted); }
.help-sheet-open { display: inline-flex; align-items: center; min-height: var(--z-touch-target); font-weight: 600; }
.help-heading { display: flex; align-items: center; gap: 2px; margin: 0 0 .5rem; }
.help-heading > h1, .help-heading > h2, .help-heading > h3 { margin: 0; }
.help-inline { display: inline-flex; align-items: center; gap: 2px; }
/* „Hilfe“ beside the legal links (docs/hilfe.md): same quiet look, its own element because it is no legal page. */
.legal-footer:has(.help-entry), .help-legal-block { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; column-gap: 16px; }
.help-entry { display: inline-flex; align-items: center; min-height: var(--z-touch-target); color: var(--z-muted); font-size: .8125rem; text-decoration: none; }
.help-entry:hover, .help-entry:focus-visible { color: var(--z-text); text-decoration: underline; }
.queue-summary-head .help-heading { margin: 0; }
