:root {
    --help-ink: #18231e;
    --help-muted: #617068;
    --help-page: #f4f1eb;
    --help-surface: #ffffff;
    --help-soft: #f3f6f3;
    --help-forest: #122a21;
    --help-brand: #982f39;
    --help-focus: #c88d39;
    --help-border: #dbe3dc;
    --help-shadow: 0 16px 42px rgba(18, 42, 33, .1);
}

* { box-sizing: border-box; }

html {
    min-width: 0;
    min-height: 100%;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body.helpPage {
    min-width: 0;
    min-height: 100%;
    margin: 0;
    color: var(--help-ink);
    background: radial-gradient(circle at top right, rgba(200, 141, 57, .1), transparent 30rem), var(--help-page);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body.helpPage button,
body.helpPage input { font: inherit; }

.helpTopMenu {
    position: sticky;
    top: 0;
    z-index: 50;
}

.helpShell {
    width: min(calc(100% - 32px), 1520px);
    margin: 0 auto;
    padding: 32px 0 56px;
}

.helpHero,
.helpSearchPanel,
.helpSection,
.helpSectionNavigation,
.helpEmpty {
    border: 1px solid var(--help-border);
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--help-shadow);
}

.helpHero {
    padding: clamp(24px, 4vw, 52px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    color: #ffffff;
    border-color: rgba(255, 255, 255, .08);
    border-radius: 28px;
    background: linear-gradient(135deg, #122a21 0%, #1f4738 100%);
}

.helpHero h1,
.helpSearchPanel h2,
.helpSection h2,
.helpEmpty h2 {
    margin: 0;
    line-height: 1.08;
    letter-spacing: -.035em;
}

.helpHero h1 { font-size: clamp(2.15rem, 5vw, 4.4rem); }
.helpHero p { max-width: 720px; margin: 12px 0 0; font-size: clamp(1rem, 1.6vw, 1.18rem); }

.helpReturnLink {
    width: fit-content;
    min-height: 48px;
    margin-top: 22px;
    padding: 11px 18px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    color: var(--help-forest);
    border: 2px solid #ffffff;
    border-radius: 999px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, .16);
    font-weight: 850;
    text-decoration: none;
}

.helpReturnLink:hover,
.helpReturnLink:focus-visible {
    color: #ffffff;
    background: transparent;
    outline: none;
}

.helpReturnLink:focus-visible {
    box-shadow: 0 0 0 4px rgba(200, 141, 57, .65);
}

.helpEyebrow {
    margin: 0 0 7px !important;
    color: var(--help-focus);
    font-size: .76rem !important;
    font-weight: 850;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.helpAccessNote {
    min-width: 150px;
    padding: 20px;
    display: grid;
    justify-items: center;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 20px;
    background: rgba(255, 255, 255, .1);
    text-align: center;
}

.helpAccessNote strong { font-size: 2.25rem; line-height: 1; }
.helpAccessNote span { margin-top: 6px; font-size: .82rem; font-weight: 750; }

.helpSearchPanel {
    margin-top: 22px;
    padding: clamp(20px, 3vw, 30px);
    border-radius: 22px;
}

.helpSearchHeading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 20px;
}

.helpSearchPanel h2 { font-size: clamp(1.45rem, 2.8vw, 2.2rem); }

.helpResultCount {
    margin: 0;
    color: var(--help-muted);
    font-weight: 750;
    white-space: nowrap;
}

.helpSearchControl {
    min-height: 58px;
    margin-top: 18px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 0 10px 0 18px;
    border: 2px solid var(--help-border);
    border-radius: 16px;
    background: var(--help-surface);
}

.helpSearchControl:focus-within {
    border-color: var(--help-focus);
    box-shadow: 0 0 0 4px rgba(200, 141, 57, .16);
}

.helpSearchControl > span { color: var(--help-muted); font-size: 1.7rem; line-height: 1; }

.helpSearchControl input {
    min-width: 0;
    width: 100%;
    min-height: 54px;
    padding: 0;
    color: var(--help-ink);
    border: 0;
    outline: 0;
    background: transparent;
    font-size: 1.05rem;
}

.helpSearchControl button,
.helpEmpty button {
    min-height: 40px;
    padding: 8px 15px;
    color: #ffffff;
    border: 0;
    border-radius: 999px;
    background: var(--help-brand);
    font-weight: 800;
    cursor: pointer;
}

.helpFilters {
    margin-top: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.helpFilter {
    min-height: 40px;
    padding: 8px 15px;
    color: var(--help-forest);
    border: 1px solid var(--help-border);
    border-radius: 999px;
    background: var(--help-soft);
    font-weight: 780;
    cursor: pointer;
}

.helpFilter:hover,
.helpFilter:focus-visible { border-color: var(--help-focus); }

.helpFilter.is-active {
    color: #ffffff;
    border-color: var(--help-forest);
    background: var(--help-forest);
}

.helpLayout {
    margin-top: 22px;
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    align-items: start;
    gap: 22px;
}

.helpSectionNavigation {
    position: sticky;
    top: 84px;
    padding: 18px;
    border-radius: 20px;
}

.helpSectionNavigation nav { display: grid; gap: 7px; }

.helpSectionNavigation a {
    padding: 11px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: var(--help-forest);
    border-radius: 11px;
    font-weight: 800;
    text-decoration: none;
}

.helpSectionNavigation a:hover,
.helpSectionNavigation a:focus-visible { background: var(--help-soft); }
.helpSectionNavigation small { color: var(--help-muted); font-size: .7rem; white-space: nowrap; }

.helpSections { min-width: 0; display: grid; gap: 22px; }

.helpSection {
    min-width: 0;
    padding: clamp(20px, 3vw, 34px);
    scroll-margin-top: 86px;
    border-radius: 22px;
}

.helpSectionHeader {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 20px;
}

.helpSectionHeader h2 { font-size: clamp(1.7rem, 3vw, 2.55rem); }
.helpSectionHeader p:not(.helpEyebrow) { max-width: 760px; margin: 9px 0 0; color: var(--help-muted); }

.helpSectionCount {
    padding: 7px 11px;
    color: var(--help-brand);
    border: 1px solid rgba(152, 47, 57, .18);
    border-radius: 999px;
    background: rgba(152, 47, 57, .06);
    font-size: .76rem;
    font-weight: 850;
    white-space: nowrap;
}

.helpScreenshot {
    margin: 22px 0;
    padding: 12px;
    border: 1px solid var(--help-border);
    border-radius: 16px;
    background: var(--help-soft);
}

.helpScreenshotButton {
    width: 100%;
    padding: 0;
    position: relative;
    display: block;
    overflow: hidden;
    color: #ffffff;
    border: 0;
    border-radius: 11px;
    background: var(--help-forest);
    cursor: zoom-in;
}

.helpScreenshotButton img {
    width: 100%;
    max-height: 430px;
    display: block;
    object-fit: contain;
    object-position: top center;
    background: #eef2ee;
}

.helpScreenshotButton span {
    position: absolute;
    right: 12px;
    bottom: 12px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(18, 42, 33, .9);
    font-size: .76rem;
    font-weight: 800;
}

.helpScreenshot figcaption { margin-top: 9px; color: var(--help-muted); font-size: .82rem; }

.helpTopicScreenshot {
    margin: 0 0 18px;
    padding: 10px;
    border: 1px solid var(--help-border);
    border-radius: 14px;
    background: var(--help-soft);
}

.helpTopicScreenshot .helpScreenshotButton img { max-height: 360px; }
.helpTopicScreenshot figcaption { margin: 8px 2px 0; color: var(--help-muted); font-size: .8rem; }

.helpTopicGroups {
    display: grid;
    gap: 28px;
}

.helpTopicGroup {
    min-width: 0;
}

.helpTopicGroupHeader {
    margin: 0 0 10px;
    padding-bottom: 9px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 2px solid var(--help-soft);
}

.helpTopicGroupHeader h3 {
    margin: 0;
    color: var(--help-forest);
    font-size: clamp(1.12rem, 2vw, 1.4rem);
    line-height: 1.2;
}

.helpTopicGroupHeader span {
    color: var(--help-muted);
    font-size: .76rem;
    font-weight: 800;
    white-space: nowrap;
}

.helpTopicList { display: grid; gap: 10px; }

.helpTopic {
    overflow: hidden;
    border: 1px solid var(--help-border);
    border-radius: 14px;
    background: var(--help-surface);
    scroll-margin-top: 90px;
}

.helpTopic[open] { border-color: rgba(152, 47, 57, .32); box-shadow: 0 9px 24px rgba(18, 42, 33, .07); }

.helpTopic summary {
    min-height: 72px;
    padding: 15px 17px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    cursor: pointer;
    list-style: none;
}

.helpTopic summary::-webkit-details-marker { display: none; }
.helpTopic summary > span:first-child { min-width: 0; display: grid; gap: 3px; }
.helpTopic summary strong { font-size: 1.02rem; }
.helpTopic summary small { color: var(--help-muted); font-size: .82rem; font-weight: 520; }

.helpTopicChevron {
    flex: 0 0 auto;
    color: var(--help-brand);
    font-size: 1.6rem;
    font-weight: 900;
    transition: transform .18s ease;
}

.helpTopic[open] .helpTopicChevron { transform: rotate(180deg); }

.helpTopicBody {
    padding: 0 18px 20px;
    border-top: 1px solid var(--help-border);
}

.helpPath {
    margin: 16px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    color: var(--help-forest);
    font-weight: 800;
}

.helpPath span {
    padding: 4px 8px;
    color: var(--help-muted);
    border-radius: 7px;
    background: var(--help-soft);
    font-size: .68rem;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.helpTopicBody ol { margin: 0; padding-left: 24px; }
.helpTopicBody li { margin: 8px 0; padding-left: 4px; }

.helpTip {
    margin: 16px 0 0;
    padding: 12px 14px;
    color: #53390f;
    border: 1px solid rgba(200, 141, 57, .35);
    border-radius: 11px;
    background: rgba(240, 199, 94, .16);
}

.helpEmpty {
    margin-top: 22px;
    padding: 34px;
    border-radius: 20px;
    text-align: center;
}

.helpEmpty p { color: var(--help-muted); }
.helpEmptyAccess { text-align: left; }

.helpImageDialog {
    width: min(calc(100% - 32px), 1500px);
    max-height: calc(100vh - 32px);
    padding: 0;
    overflow: hidden;
    color: var(--help-ink);
    border: 0;
    border-radius: 18px;
    background: var(--help-surface);
    box-shadow: 0 30px 90px rgba(0, 0, 0, .34);
}

.helpImageDialog::backdrop { background: rgba(7, 18, 13, .78); }

.helpImageDialogHeader {
    padding: 12px 14px 12px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--help-border);
}

.helpImageDialogHeader p { margin: 0; font-weight: 750; }

.helpImageDialogHeader button {
    width: 42px;
    height: 42px;
    color: #ffffff;
    border: 0;
    border-radius: 50%;
    background: var(--help-brand);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}

.helpImageDialog img {
    width: 100%;
    max-height: calc(100vh - 100px);
    display: block;
    object-fit: contain;
    background: #eef2ee;
}

.helpVisuallyHidden {
    width: 1px;
    height: 1px;
    padding: 0;
    position: absolute;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

[hidden] { display: none !important; }

@media (max-width: 900px) {
    .helpLayout { grid-template-columns: minmax(0, 1fr); }
    .helpSectionNavigation { position: static; }
    .helpSectionNavigation nav { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}

@media (max-width: 620px) {
    .helpShell { width: min(calc(100% - 16px), 600px); padding-top: 16px; }
    .helpHero { padding: 24px 20px; align-items: start; flex-direction: column; border-radius: 20px; }
    .helpAccessNote { width: 100%; grid-template-columns: auto auto; justify-content: center; align-items: baseline; gap: 7px; }
    .helpSearchHeading,
    .helpSectionHeader { align-items: start; flex-direction: column; gap: 10px; }
    .helpResultCount { white-space: normal; }
    .helpFilters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
    .helpFilter { flex: 0 0 auto; }
    .helpSectionNavigation { display: none; }
    .helpSection { padding: 20px 14px; }
    .helpTopicGroupHeader { align-items: start; flex-direction: column; gap: 3px; }
    .helpTopic summary { align-items: start; }
    .helpScreenshotButton img { max-height: 300px; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .helpTopicChevron { transition: none; }
}
