.hkhelp-hub {
    --help-navy: var(--hkd-deep);
    --help-ink: var(--hkd-ink);
    --help-muted: var(--hkd-muted);
    --help-line: var(--hkd-line);
    --help-accent: var(--hkd-orange);
    background: var(--hkd-paper);
    color: var(--help-ink);
}

.hkhelp-hub .hkhelp-hero {
    background: linear-gradient(112deg, #262321, #38312c);
    text-align: center;
}

.hkhelp-hub .hkhelp-hero .hkd-shell { padding-block: clamp(26px, 3.3vw, 43px) clamp(27px, 3.2vw, 40px); }
.hkhelp-hub .hkhelp-hero h1 { color: #fff; font-size: clamp(30px, 4vw, 48px); margin: 0; line-height: 1.17; }
.hkhelp-hub .hkhelp-hero p { max-width: 64ch; margin: .7rem auto 0; }
.hkhelp-hub .hkhelp-search { margin: 1.2rem auto .75rem; max-width: 700px; gap: .45rem; grid-template-columns: minmax(0,1fr) auto; }
.hkhelp-hub .hkhelp-search input { border-color: transparent; }
.hkhelp-hub .hkhelp-search button { background: var(--help-accent); padding-inline: 1.1rem; }
.hkhelp-hub .hkhelp-search button:hover { background: #ff9a4d; }

.hkhelp-hub .hkhelp-examples { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: .35rem .5rem; font-size: .87rem; }
.hkhelp-hub .hkhelp-examples a {
    margin: 0;
    padding: .16rem .55rem;
    color: #f7efe8;
    background: #ffffff12;
    border: 1px solid #ffffff36;
    border-radius: 20px;
    text-decoration: none;
}
.hkhelp-hub .hkhelp-examples a:hover { background: #ffffff25; }

.hkhelp-hub .hkhelp-section { padding-block: 28px; }
.hkhelp-hub .hkhelp-section h2 { color: var(--help-navy); font-size: clamp(21px, 2.6vw, 26px); margin: 0 0 14px; }
.hkhelp-hub .hkhelp-topics { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 11px; }
.hkhelp-hub .hkhelp-topic {
    position: relative;
    display: block;
    min-width: 0;
    overflow: hidden;
    padding: 17px 13px 16px;
    color: var(--help-ink);
    background: #fff;
    border: 1px solid var(--help-line);
    border-radius: 12px;
    box-shadow: 0 2px 6px #10283e0a;
    text-decoration: none;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.hkhelp-hub .hkhelp-topic::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: transparent;
}
.hkhelp-hub .hkhelp-topic::after {
    content: "›";
    position: absolute;
    inset: 13px 10px auto auto;
    color: #6c7e91;
    font-size: 17px;
    line-height: 1;
}
.hkhelp-hub .hkhelp-topic:hover { transform: translateY(-2px); border-color: #b8c7d3; box-shadow: 0 7px 15px #10283e15; }
.hkhelp-hub .hkhelp-topic[aria-current="true"] {
    transform: translateY(-3px);
    border-color: #d17228;
    box-shadow: 0 7px 17px #513c261a;
    background: #fffdf9;
}
.hkhelp-hub .hkhelp-topic[aria-current="true"]::before { background: var(--help-accent); }
.hkhelp-topic-title { display: block; color: #30465a; font-weight: 720; font-size: 15px; line-height: 1.36; margin-bottom: 7px; padding-inline-end: 10px; }
.hkhelp-hub .hkhelp-topic[aria-current="true"]::after { content: "✓"; color: #9e4b13; font-weight: 750; }
.hkhelp-topic[aria-current="true"] .hkhelp-topic-title { color: var(--help-navy); font-weight: 800; }
.hkhelp-topic-summary { display: block; color: var(--help-muted); font-size: 13px; line-height: 1.5; min-height: 2.8em; }
.hkhelp-topic-samples { display: grid; gap: 4px; margin-top: 9px; font-size: 12px; line-height: 1.48; color: #405469; }
.hkhelp-topic-samples > span { display: flex; gap: .4em; align-items: baseline; }
.hkhelp-topic-samples > span::before { content: "·"; color: #8f643e; font-weight: 800; }

.hkhelp-catalog { scroll-margin-top: 14px; }
.hkhelp-topic-results { margin-top: 23px; scroll-margin-top: 20px; }
.hkhelp-hub .hkhelp-topic-panel[hidden] { display: none; }
.hkhelp-topic-panel { background: #fff; border: 1px solid var(--help-line); padding: clamp(15px, 3vw, 23px); border-radius: 13px; }
.hkhelp-panel-head { display: flex; flex-wrap: wrap; gap: .4rem 1rem; justify-content: space-between; align-items: baseline; margin-bottom: 13px; }
.hkhelp-hub .hkhelp-section .hkhelp-panel-head h2 { margin: 0; }
.hkhelp-panel-head > a { color: #435f77; text-underline-offset: .2em; font-size: 14px; }

.hkhelp-hub .hkhelp-questions { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; grid-template-columns: repeat(2,minmax(0,1fr)); }
.hkhelp-hub .hkhelp-questions > li { margin: 0; min-width: 0; }
.hkhelp-question {
    box-sizing: border-box;
    min-height: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
    padding: 13px 14px;
    border: 1px solid var(--help-line);
    border-radius: 8px;
    color: var(--help-navy);
    background: #f8fafc;
    text-decoration: none;
}
.hkhelp-question:hover { background: var(--hkd-hover); border-color: #bed0df; }
.hkhelp-question strong { font-weight: 660; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.hkhelp-question-summary { display: block; margin-top: 2px; color: var(--help-muted); font-size: 13px; line-height: 1.45; }
.hkhelp-question-arrow { color: #516d87; font-size: 17px; flex: none; }
.hkhelp-hub :is(a, button, input):focus-visible { outline: 2px solid #cf670e; outline-offset: 3px; }
.hkhelp-hub .hkhelp-popular { border-top: 0; padding-top: 6px; padding-bottom: 34px; }
.hkhelp-hub .hkhelp-popular .hkhelp-question { background: white; }
.hkhelp-hub .hkhelp-popular .hkhelp-question:hover { background: var(--hkd-hover); }

@media (max-width: 1050px) { .hkhelp-hub .hkhelp-topics { grid-template-columns: repeat(3,minmax(0,1fr)); } }
@media (max-width: 700px) {
    .hkhelp-hub .hkhelp-topics { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .hkhelp-hub .hkhelp-questions { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 360px) {
    .hkhelp-hub .hkhelp-topics { grid-template-columns: minmax(0,1fr); }
}
@media (prefers-reduced-motion: reduce) {
    .hkhelp-hub .hkhelp-topic { transition: none; }
}

.hkhelp-hub .hkhelp-topic,
.hkhelp-hub .hkhelp-question {
    border-radius: var(--hkd-radius);
    box-shadow: var(--hkd-shadow);
    transition: transform .15s ease-out, background-color .15s, border-color .15s, box-shadow .15s;
}
.hkhelp-hub .hkhelp-topic,
.hkhelp-hub .hkhelp-question,
.hkhelp-hub .hkhelp-topic-panel { background: var(--hkd-card); }
.hkhelp-hub .hkhelp-topic-summary { min-height: 0; }
.hkhelp-hub .hkhelp-topic-samples { font-size: .78rem; }
.hkhelp-hub :is(.hkhelp-topic,.hkhelp-question):is(:hover,:focus-visible) {
    border-color: var(--hkd-orange);
    background: var(--hkd-hover);
    box-shadow: var(--hkd-shadow-raised);
    cursor: pointer;
}
.hkhelp-hub :is(.hkhelp-topic,.hkhelp-question):hover .hkhelp-question-arrow { color: var(--hkd-rust); }
.hkhelp-hub .hkhelp-topic[aria-current="true"] {
    background: var(--hkd-selected);
    border-color: var(--hkd-orange);
    box-shadow: var(--hkd-shadow-raised);
}
.hkhelp-hub :is(.hkhelp-topic,.hkhelp-question):active {
    transform: translateY(1px) scale(.985);
    transition-duration: 0s;
}
@media (hover: hover) { .hkhelp-hub .hkhelp-question:hover { transform: translateY(-2px); } }
@media (prefers-reduced-motion: reduce) {
    .hkhelp-hub :is(.hkhelp-topic,.hkhelp-question):is(:hover,:active,[aria-current="true"]) { transform: none; transition: none; }
}


html:has(.hkhelp-hub) { scrollbar-gutter: stable; }
.hkhelp-hub :is([data-help-view],[data-help-search])[hidden] { display: none; }
.hkhelp-switcher { padding-top: 16px; }
.hkhelp-segments {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    gap: 4px;
    padding: 4px;
    border: 1px solid #e1d8ce;
    border-radius: 12px;
    background: #e9e2da;
}
.hkhelp-segments > a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5em;
    min-height: 43px;
    padding: .35rem .5rem;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #5d554e;
    font-size: clamp(.84rem,1.2vw,.97rem);
    font-weight: 650;
    line-height: 1.25;
    white-space: nowrap;
    text-decoration: none;
    transition: background-color 100ms, color 100ms, border-color 100ms;
}
.hkhelp-segments svg { flex: none; }
.hkhelp-segments > a:hover { color: var(--hkd-rust); }
.hkhelp-segments > a[aria-current="true"] {
    color: var(--hkd-rust);
    border-color: #ece3d8;
    background: var(--hkd-card);
}
.hkhelp-switcher + [data-help-view] > .hkhelp-catalog { padding-top: 15px; }
.hkhelp-hub [data-help-search] > .hkhelp-examples { min-height: 1.85em; }
.hkl-help-pane { padding-block: 14px 32px; }
.hkl-help-pane .hkl-manual-card {
    grid-template-columns: minmax(0,1fr) minmax(0,.7fr);
    min-height: 0;
    padding: clamp(16px,2.7vw,34px);
    border-radius: 12px;
}
.hkl-help-pane .hkl-manual-card h2 { font-size: clamp(21px,2.6vw,34px); }
.hkl-help-pane .hkl-cover {
    width: min(92%,220px);
    min-height: 236px;
    box-shadow: 9px 9px #e7dbcb;
}
.hkl-help-pane .hkl-cover strong { font-size: clamp(27px,4.8vw,47px); }
.hkl-help-pane .hkl-cover b { font-size: clamp(15px,1.65vw,21px); }
.hkl-help-pane .hkl-help-facts { font-size: .88rem; }
.hkl-help-chapters { margin: 16px 0 0; }
.hkl-help-chapters + .hkl-manual-card { margin-top: 22px; }
.hkl-help-chapters h2 { margin: 0; font-size: 1.12rem; }
.hkl-help-chapters .hkl-road { display: grid; gap: 7px; }
.hkl-help-chapters .hkl-road li { border: 0; }
.hkl-help-chapters .hkl-road a {
    min-height: 43px;
    padding: .55rem .75rem;
    box-sizing: border-box;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--hkd-card);
}
.hkl-help-chapters .hkl-road a:hover { border-color: #e1c5aa; background: var(--hkd-hover); }
.hkl-help-chapters .hkl-step { color: var(--hkd-rust); font-size: .96rem; }
@media (max-width: 650px) {
    .hkhelp-switcher { padding-top: 12px; }
    .hkhelp-segments > a { min-height: 44px; }
    .hkl-help-pane .hkl-manual-card {
        grid-template-columns: minmax(0,1fr) minmax(76px,32%);
        gap: .65rem;
    }
    .hkl-help-pane .hkl-cover {
        width: 100%;
        min-height: 127px;
        padding: .42rem .25rem;
        gap: .18rem;
        border-left-width: 5px;
        box-shadow: 4px 5px #e7dbcb;
    }
    .hkl-help-pane .hkl-cover strong { font-size: clamp(17px,5.3vw,27px); margin: .15rem 0; }
    .hkl-help-pane .hkl-cover b { font-size: clamp(10px,2.8vw,13px); }
    .hkl-help-pane .hkl-cover :is(small,span) { font-size: .57rem; letter-spacing: .06em; }
    .hkl-help-pane .hkl-cover small { margin: .15rem 0; padding-top: .2rem; }
}
@media (prefers-reduced-motion: reduce) { .hkhelp-segments > a { transition: none; } }

@media (max-width: 430px) {
    .hkhelp-hub [data-help-search] > .hkhelp-examples {
        flex-wrap: nowrap;
        white-space: nowrap;
        gap: .25rem;
        font-size: .75rem;
    }
    .hkhelp-hub [data-help-search] > .hkhelp-examples a { padding-inline: .4rem; }
}
