/* Layout and legacy article compatibility. Loaded after the visual foundation. */
.help-ui {
    --h-font-color: var(--help-heading);
    --font-color: var(--help-text);
    --bg-color: var(--help-bg);
    --heading-color: var(--help-heading);
    --menu-bgcolor: var(--help-surface);
    --menu-item-hover: var(--help-hover);
    --menu-item-color: var(--help-accent);
    scroll-padding-top: 24px;
}
.help-ui .help-page { margin: 0; background: var(--help-bg); color: var(--help-text); font: inherit; }
.help-ui [hidden] { display: none !important; }
.help-frame { max-width: var(--help-layout-max); margin: auto; padding: 24px; }
.help-header { display: flex; align-items: center; gap: 24px; min-height: 72px; padding: 12px 20px; margin-bottom: 8px; border: 1px solid var(--help-border); border-radius: 5px; background: var(--help-surface); }
.help-header .help-brand { flex-shrink: 0; }
.help-header .help-brand-mark { display: block; width: 48px; height: 48px; flex-shrink: 0; object-fit: contain; filter: drop-shadow(0 1px 2px #0006); }
.help-ui[data-theme='light'] .help-brand-mark { filter: contrast(1.08) drop-shadow(0 1px 1px #30271940); }
.help-search { position: relative; flex: 1; min-width: 120px; max-width: 620px; margin: 0 auto; }
.help-search > .help-icon { position: absolute; left: 12px; top: 10px; color: var(--help-muted); pointer-events: none; }
.help-search .help-input { padding-left: 44px; }
.help-search-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; padding: 8px; max-height: 360px; overflow-y: auto; z-index: 10; border: 1px solid var(--help-border); border-radius: 5px; background: var(--help-surface-raised); box-shadow: 0 8px 24px #0003; }
.help-search-results a { display: block; padding: 10px; text-decoration: none; }
.help-search-results a:hover, .help-search-results a:focus { background: var(--help-hover); }
.help-search-results p { padding: 8px; margin: 0; font-size: 14px; }
.help-icon-button { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; height: 44px; padding: 8px; color: var(--help-accent); background: transparent; border: 1px solid transparent; border-radius: 50%; cursor: pointer; }
.help-icon-button:hover { background: var(--help-hover); border-color: var(--help-border); }
.help-icon-button span { display: flex; }
.help-ui[data-theme='dark'] .help-theme-light, .help-ui[data-theme='light'] .help-theme-dark { display: none; }
.help-game-link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding-left: 24px; border-left: 1px solid var(--help-border); white-space: nowrap; text-decoration: none; font-family: var(--help-font-heading); }
.help-game-link .help-icon { width: 18px; height: 18px; }
.help-menu-button { display: none; }
.help-ui .help-layout { display: grid; grid-template-columns: var(--help-nav-width) minmax(0, 1fr) var(--help-toc-width); gap: 8px; padding: 0; text-align: left; align-items: stretch; }
.help-sidebar, .help-toc-panel, .help-article-panel { min-width: 0; border: 1px solid var(--help-divider); border-radius: 5px; background: var(--help-surface); }
.help-sidebar, .help-toc-panel { display: flex; flex-direction: column; }
.help-toc-panel.help-decoration { overflow: clip; }
.help-sidebar { padding: 16px 8px; grid-column: 1; grid-row: 1; }
.help-ui .help-sidebar-title { font-size: 19px; letter-spacing: .08em; margin: 0 8px; text-transform: uppercase; }
.help-ornament { display: flex; align-items: center; margin: 8px; color: var(--help-accent); }
.help-ornament::before, .help-ornament::after { content: ''; height: 1px; background: var(--help-border); flex: 1; }
.help-ornament .help-icon { width: 26px; height: 20px; }
.help-nav-group { margin: 8px 0 16px; }
.help-nav-group summary { display: flex; align-items: center; justify-content: space-between; gap: 4px; padding: 8px; min-height: 44px; cursor: pointer; list-style: none; font: 12px/1.5 var(--help-font-heading); text-transform: uppercase; letter-spacing: .07em; color: var(--help-heading); }
.help-nav-group summary::-webkit-details-marker { display: none; }
.help-nav-group summary .help-icon { width: 14px; height: 14px; }
.help-nav-group[open] summary .help-icon { transform: rotate(90deg); }
.help-ui .help-sidebar .help-nav-link { padding: 6px 12px; font-size: 14px; line-height: 1.4; }
.help-ui .help-sidebar-motto { margin: auto 0 0; padding: 96px 8px 12px; color: var(--help-heading); text-align: center; text-transform: uppercase; font: 11px/1.8 var(--help-font-heading); letter-spacing: .18em; }
.help-article-panel { padding: 24px; grid-column: 2; grid-row: 1; }
.help-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; color: var(--help-muted); font-size: 12px; }
.help-breadcrumbs a { color: inherit; text-decoration: none; }
.help-ui .help-article-title { position: static; margin: 0 0 20px; }
.help-article-body { max-width: var(--help-article-max); overflow-wrap: break-word; }
.help-ui .help-article-body td, .help-ui .help-article-body table { font: inherit; color: var(--help-text); }
.help-article-body img { max-width: 100%; height: auto; }
.help-article-body > table { max-width: 100%; }
.help-table-scroll { overflow-x: auto; max-width: 100%; }
.help-article-body .caption { font-size: inherit; }
.help-article-body .sfListCaption { font: 24px/1.3 var(--help-font-heading); margin: 24px 0 12px; }
.help-article-body .nav-link:hover, .help-article-body .nav-link.selected { background: var(--help-selected); }
.help-article-body [id] { scroll-margin-top: 24px; }
.help-toc-panel { padding: 20px 16px; grid-column: 3; grid-row: 1; }
.help-toc-sticky { position: sticky; top: 24px; }
.help-ui .help-toc-title { font-size: 11px; line-height: 1.5; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 16px; padding-bottom: 12px; border-bottom: 1px solid var(--help-divider); }
.help-ui summary.help-toc-title { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 44px; padding: 8px 0; cursor: pointer; list-style: none; color: var(--help-heading); font-family: var(--help-font-heading); }
.help-toc-title::-webkit-details-marker { display: none; }
.help-toc-title .help-icon { width: 14px; height: 14px; }
.help-toc-disclosure[open] .help-toc-title .help-icon { transform: rotate(90deg); }
.help-ui .help-toc-disclosure:not([open]) .help-toc-title { margin-bottom: 0; border-bottom-color: transparent; }
#help-toc { max-height: 65vh; overflow-y: auto; padding: 4px; }
#help-toc a { display: flex; align-items: center; min-height: 44px; padding: 8px 10px; border-left: 2px solid var(--help-divider); color: var(--help-muted); text-decoration: none; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
#help-toc a:hover, #help-toc a[aria-current] { color: var(--help-accent); border-color: var(--help-accent); }
.help-back-top { display: inline-block; padding: 12px 0; font-size: 12px; }
.help-sr-only, .help-skip:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.help-skip:focus { display: block; padding: 12px; background: var(--help-surface); }
.help-ui .help-search-results a { min-height: 44px; }
.help-ui :focus-visible { outline: 2px solid var(--help-focus); outline-offset: 2px; }
.help-ui #help-title { scroll-margin-top: 24px; }
@media (max-width: 1150px) {
    .help-ui .help-layout { grid-template-columns: 200px minmax(0, 1fr); grid-template-rows: min-content 1fr; }
    .help-toc-panel { grid-column: 2; grid-row: 1; }
    .help-sidebar { grid-row: 1 / 3; }
    .help-article-panel { grid-column: 2; grid-row: 2; }
    .help-toc-panel { padding: 8px 16px; }
    .help-toc-panel .help-sidebar-motto, .help-toc-panel::before, .help-back-top { display: none; }
    .help-toc-sticky { position: static; }
    #help-toc { max-height: 160px; }
    .help-header { gap: 12px; }
}
@media (max-width: 760px) {
    .help-frame { padding: 12px; }
    .help-header { flex-wrap: wrap; padding: 12px; gap: 8px; }
    .help-header .help-brand { flex: 1; }
    .help-brand-name { font-size: 20px !important; }
    .help-header .help-brand-mark { width: 36px; height: 36px; }
    .help-search { order: 5; flex-basis: 100%; max-width: none; }
    .help-game-link { padding-left: 8px; font-size: 14px; }
    .help-game-link .help-icon { display: none; }
    .help-menu-button { display: inline-flex; }
    .help-ui .help-layout { display: flex; flex-direction: column; }
    .help-sidebar { order: 0; }
    .help-ui.help-has-js .help-sidebar:not(.is-open) { display: none; }
    .help-toc-panel { order: 1; }
    .help-article-panel { order: 2; padding: 20px 16px; }
    .help-sidebar .help-sidebar-motto { display: none; }
    .help-article-body .nav-item { font-size: inherit; }
}
@media (prefers-reduced-motion: reduce) { .help-ui { scroll-behavior: auto; } }
