/* ============================================================
   CloudPos.Help — app chrome + content styling
   Light/dark via [data-theme]; text zoom via --help-font-scale.
   ============================================================ */

/* Inter, self-hosted from wwwroot/fonts (SIL Open Font License, see fonts/LICENSE-Inter.txt).
   Replaces the Google Fonts link in App.razor: one variable file covers every weight the site
   uses (400-700), no third-party request, cached with the rest of the static assets. */
@font-face {
    font-family: "Inter";
    font-style: normal;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/InterVariable.woff2") format("woff2");
}

@font-face {
    font-family: "Inter";
    font-style: italic;
    font-weight: 100 900;
    font-display: swap;
    src: url("../fonts/InterVariable-Italic.woff2") format("woff2");
}

:root {
    --help-font-scale: 1;
    --help-top-h: 56px;
    --help-rail-w: 286px;
    --help-max-w: 1400px;
    --bg: #ffffff;
    --bg-2: #f4f5f7;
    --surface: #ffffff;
    --surface-2: #f0f1f4;
    --text: #1f2430;
    --text-dim: #6b7280;
    --border: #e3e6ea;
    --accent: #e0701a;
    --accent-soft: #fdeede;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

[data-theme="dark"] {
    --bg: #1a1d23;
    --bg-2: #15171c;
    --surface: #21252c;
    --surface-2: #2a2f37;
    --text: #e8eaed;
    --text-dim: #9aa3af;
    --border: #333944;
    --accent: #f0852f;
    --accent-soft: #3a2a1a;
    --shadow: 0 1px 3px rgba(0,0,0,.4);
}

* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg-2);
    color: var(--text);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.hi {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.help-app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* -- Top bar -- */
.help-top {
    height: var(--help-top-h);
    display: flex;
    justify-content: center;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    z-index: 20;
}

.help-top-inner {
    width: 100%;
    max-width: var(--help-max-w);
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 0 24px;
}

.help-top-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    justify-self: start;
}

.help-top-center {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    justify-self: center;
}

.help-ask-btn {
    border: 1px solid var(--border);
}

.help-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 15px;
    white-space: nowrap;
    border: none;
    background: transparent;
    color: var(--text);
    font-family: inherit;
    padding: 4px 6px;
    border-radius: 8px;
    cursor: pointer;
}

    .help-brand:hover {
        background: var(--surface-2);
    }

    .help-brand .hi {
        color: var(--accent);
    }

.help-top .help-menu {
    display: none;
}

.help-searchbox {
    width: 460px;
    max-width: 44vw;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    height: 36px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

    .help-searchbox .help-search-ic {
        color: var(--text-dim);
        width: 16px;
        height: 16px;
    }

    .help-searchbox input {
        flex: 1;
        min-width: 0;
        border: none;
        background: transparent;
        color: var(--text);
        font-size: 14px;
        outline: none;
    }

.help-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-self: end;
}

.help-zoom-val {
    font-size: 12px;
    color: var(--text-dim);
    width: 38px;
    text-align: center;
}

.help-iconbtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: var(--text);
    border-radius: 8px;
    cursor: pointer;
}

    .help-iconbtn:hover {
        background: var(--surface-2);
    }

/* -- Body layout -- */
.help-body {
    flex: 1;
    width: 100%;
    max-width: var(--help-max-w);
    margin: 0 auto;
    display: flex;
    min-height: 0;
}

.help-rail {
    width: var(--help-rail-w);
    flex: 0 0 var(--help-rail-w);
    overflow-y: auto;
    padding: 14px 10px 24px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 16px 0 16px 12px;
    align-self: flex-start;
    position: sticky;
    top: 16px;
    max-height: calc(100vh - var(--help-top-h) - 32px);
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

    .help-rail::-webkit-scrollbar {
        width: 6px;
    }

    .help-rail::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 3px;
    }

    .help-rail::-webkit-scrollbar-track {
        background: transparent;
    }

.help-rail-head {
    font-size: 12px;
    color: var(--text-dim);
    padding: 4px 8px 10px;
}

.help-rail-empty {
    padding: 12px 8px;
    color: var(--text-dim);
    font-size: 13px;
}

.help-cat {
    margin-bottom: 6px;
}

.help-cat-title {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    padding: 0;
}

.help-cat-ic {
    font-size: 11px;
}

.help-cat-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

    .help-cat-label .hi.help-cat-ic {
        width: 15px;
        height: 15px;
        color: var(--accent);
        flex: 0 0 auto;
    }

.help-cat-ic-ph {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
}

.help-subcat {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 12px 8px 4px 8px;
}

.help-topic {
    display: block;
    width: 100%;
    min-height: 32px;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text-dim);
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 8px;
    cursor: pointer;
    line-height: 1.4;
}

    .help-topic:hover {
        background: var(--surface-2);
        color: var(--text);
    }

    .help-topic.active {
        background: var(--accent-soft);
        color: var(--accent);
        font-weight: 600;
    }

.help-topic-indent {
    margin-left: 10px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
    border-radius: 0 7px 7px 0;
}

.help-topic-title {
    display: block;
    font-weight: 600;
}

.help-topic-sub {
    display: block;
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 2px;
}

.help-scrim {
    display: none;
}

/* -- Content -- */
.help-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px clamp(20px, 5vw, 64px);
    font-size: calc(15px * var(--help-font-scale));
}

.help-empty {
    color: var(--text-dim);
    max-width: 640px;
}

    .help-empty h1 {
        color: var(--text);
    }

.help-article {
    max-width: 820px;
}

    .help-article h1 {
        font-size: 1.9em;
        margin: 0 0 .25em;
    }

.help-article-summary {
    color: var(--text-dim);
    font-size: 1.05em;
    margin: 0 0 1.4em;
}

.help-article-body {
    line-height: 1.65;
}

    .help-article-body h2 {
        font-size: 1.35em;
        margin: 1.6em 0 .5em;
    }

    .help-article-body h3 {
        font-size: 1.12em;
        margin: 1.3em 0 .4em;
    }

    .help-article-body p {
        margin: .7em 0;
    }

    .help-article-body a {
        color: var(--accent);
    }

    .help-article-body img {
        max-width: 100%;
        height: auto;
        border-radius: 8px;
    }

    .help-article-body code {
        background: var(--surface-2);
        padding: .12em .4em;
        border-radius: 4px;
        font-family: ui-monospace, monospace;
        font-size: .9em;
    }

    .help-article-body table {
        border-collapse: collapse;
        width: 100%;
        margin: 1em 0;
    }

    .help-article-body th, .help-article-body td {
        border: 1px solid var(--border);
        padding: 8px 10px;
        text-align: left;
    }

    .help-article-body th {
        background: var(--surface-2);
    }

/* House-style content blocks (use these in topic HTML) */
.hc-note, .hc-tip, .hc-warning {
    border-left: 3px solid var(--accent);
    background: var(--surface-2);
    padding: 10px 14px;
    border-radius: 6px;
    margin: 1.1em 0;
}

.hc-tip {
    border-left-color: #2e9e6b;
}

.hc-warning {
    border-left-color: #d9534f;
}

.hc-steps {
    margin: 1em 0;
    padding-left: 1.3em;
}

    .hc-steps li {
        margin: .45em 0;
    }

kbd {
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: .05em .45em;
    font-size: .85em;
    background: var(--surface);
    font-family: ui-monospace, monospace;
}

/* -- Topic footer -- */
.help-breadcrumb {
    font-size: 12.5px;
    color: var(--text-dim);
    margin-bottom: 6px;
}

/* Article + "On this page" side-by-side */
.help-article-wrap {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

    .help-article-wrap .help-article {
        flex: 1;
        min-width: 0;
    }

.help-otp {
    flex: 0 0 190px;
    position: sticky;
    top: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-left: 14px;
    border-left: 1px solid var(--border);
}

.help-otp-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 6px;
}

.help-otp-link {
    display: block;
    width: 100%;
    background: none;
    border: 0;
    padding: 4px 0;
    cursor: pointer;
    text-align: left;
    font: inherit;
    font-size: 12.5px;
    line-height: 1.35;
    color: var(--text-dim);
    border-radius: 4px;
}

    .help-otp-link:hover {
        color: var(--text);
    }

    .help-otp-link.active {
        color: var(--accent);
        font-weight: 600;
    }

    .help-otp-link.lvl-3 {
        padding-left: 12px;
    }

.help-article-body h2,
.help-article-body h3 {
    scroll-margin-top: 16px;
}

@media (max-width: 1240px) {
    .help-otp {
        display: none;
    }
}

.help-pn {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-top: 36px;
}

.help-pn-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 16px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: var(--text);
}

    .help-pn-card:hover {
        border-color: var(--accent);
    }

.help-pn-next {
    align-items: flex-end;
    text-align: right;
}

.help-pn-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-dim);
}

    .help-pn-label .hi {
        width: 13px;
        height: 13px;
    }

.help-pn-title {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--accent);
}

.help-pn-spacer {
    display: block;
}

.help-topic-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 2.4em;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.help-footbtn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}

    .help-footbtn:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.help-email {
    display: inline-flex;
    gap: 6px;
}

    .help-email input {
        padding: 7px 10px;
        border: 1px solid var(--border);
        border-radius: 8px;
        background: var(--surface);
        color: var(--text);
        font-size: 13px;
    }

.help-status {
    font-size: 13px;
    color: var(--text-dim);
}

/* -- Rail becomes a slide-in drawer when sidebar no longer fits -- */
@media (max-width: 1000px) {
    .help-top .help-menu {
        display: inline-flex;
    }

    .help-brand span {
        display: none;
    }

    .help-rail {
        position: fixed;
        top: var(--help-top-h);
        left: 0;
        bottom: 0;
        margin: 0;
        border: none;
        border-right: 1px solid var(--border);
        border-radius: 0;
        max-height: none;
        transform: translateX(-100%);
        transition: transform .2s ease;
        z-index: 30;
        box-shadow: var(--shadow);
    }

        .help-rail.open {
            transform: translateX(0);
        }

    .help-scrim {
        display: block;
        position: fixed;
        inset: var(--help-top-h) 0 0 0;
        background: rgba(0,0,0,.4);
        z-index: 25;
    }
}

/* -- Admin: edit mode + editors -- */
.help-iconbtn.active {
    background: var(--accent-soft);
    color: var(--accent);
}

.help-newbtn {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    padding: 8px 10px;
    margin-bottom: 10px;
    border: 1px dashed var(--border);
    border-radius: 8px;
    background: transparent;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .help-newbtn:hover {
        border-color: var(--accent);
    }

.help-cat-title, .help-subcat {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.help-rowtools {
    display: inline-flex;
    gap: 2px;
}

.help-rowtool {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    color: var(--text-dim);
    border-radius: 5px;
    cursor: pointer;
}

    .help-rowtool:hover {
        background: var(--surface-2);
        color: var(--accent);
    }

    .help-rowtool .hi {
        width: 14px;
        height: 14px;
    }

.help-toprow {
    display: flex;
    align-items: center;
    gap: 2px;
}

    .help-toprow .help-topic {
        flex: 1;
    }

/* Editor pane */
.help-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 1200px;
}

.help-editor-h {
    margin: 0 0 14px;
    font-size: 1.3em;
}

.help-editor-meta {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 14px;
}

.he-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .he-field > label {
        font-size: 11px;
        font-weight: 600;
        color: var(--text-dim);
    }

.he-col-2 {
    grid-column: span 2;
}

.he-narrow {
    grid-column: span 1;
}

.he-input {
    padding: 8px 10px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    outline: none;
}

    .he-input:focus {
        border-color: var(--accent);
    }

.he-switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 22px;
}

    .he-switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

    .he-switch span {
        position: absolute;
        inset: 0;
        background: var(--surface-2);
        border: 1px solid var(--border);
        border-radius: 22px;
        transition: .15s;
        cursor: pointer;
    }

        .he-switch span::before {
            content: "";
            position: absolute;
            width: 16px;
            height: 16px;
            left: 3px;
            top: 2px;
            background: var(--text-dim);
            border-radius: 50%;
            transition: .15s;
        }

    .he-switch input:checked + span {
        background: var(--accent);
        border-color: var(--accent);
    }

        .he-switch input:checked + span::before {
            transform: translateX(18px);
            background: #fff;
        }

.help-editor .e-richtexteditor {
    flex: 1;
    min-height: 320px;
    margin-bottom: 12px;
}

.help-editor-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.he-btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .he-btn:hover {
        border-color: var(--accent);
    }

.he-btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.he-btn-danger {
    color: #d9534f;
}

    .he-btn-danger:hover {
        border-color: #d9534f;
    }

.he-status {
    font-size: 13px;
    color: var(--text-dim);
}

@media (max-width: 820px) {
    .help-editor-meta {
        grid-template-columns: 1fr 1fr;
    }

    .he-col-2 {
        grid-column: span 2;
    }
}

/* -- Filled icon (favorite star) -- */
.hi.filled {
    fill: currentColor;
}

/* -- Auth area -- */
.help-user {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    margin-left: 6px;
    white-space: nowrap;
}

    .help-user .hi {
        width: 15px;
        height: 15px;
    }

.help-authform {
    display: inline;
    margin: 0;
}

a.help-iconbtn {
    text-decoration: none;
}

/* -- Per-user lists (favorites / recent) -- */
.help-userlist {
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
}

    .help-userlist > summary {
        list-style: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        gap: 6px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: .6px;
        text-transform: uppercase;
        color: var(--text-dim);
        padding: 4px 8px;
    }

        .help-userlist > summary::-webkit-details-marker {
            display: none;
        }

        .help-userlist > summary .hi {
            width: 13px;
            height: 13px;
            color: var(--accent);
        }

.help-showhidden {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-dim);
    padding: 4px 8px 10px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
    cursor: pointer;
}

.help-topic.is-hidden {
    opacity: .5;
}

/* -- Login page -- */
.help-login {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-2);
    padding: 20px;
}

.help-login-card {
    width: 100%;
    max-width: 360px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 28px;
    box-shadow: var(--shadow);
}

.help-login-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 4px;
}

.help-login-card h1 {
    margin: 0 0 12px;
    font-size: 1.4em;
}

.help-login-card label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-dim);
    margin-top: 6px;
}

.help-login-card input {
    padding: 9px 11px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    outline: none;
}

    .help-login-card input:focus {
        border-color: var(--accent);
    }

.help-login-btn {
    margin-top: 16px;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.help-login-err {
    background: #fde8e8;
    color: #b42318;
    border: 1px solid #f5c2c0;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 6px;
}

[data-theme="dark"] .help-login-err {
    background: #3a2020;
    color: #f3b0ab;
    border-color: #5a2c2c;
}

/* -- Sign-in prompt modal -- */
.help-modal-scrim {
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.help-modal {
    width: 100%;
    max-width: 360px;
    text-align: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 26px;
    box-shadow: var(--shadow);
}

.help-modal-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    margin-bottom: 12px;
}

    .help-modal-ic .hi {
        width: 22px;
        height: 22px;
    }

.help-modal h2 {
    margin: 0 0 6px;
    font-size: 1.15em;
}

.help-modal p {
    margin: 0 0 18px;
    color: var(--text-dim);
    font-size: 14px;
}

.help-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

    .help-modal-actions a {
        text-decoration: none;
    }

/* -- AI assistant -- */
.help-ask {
    max-width: 760px;
}

    .help-ask h1 {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.help-ask-spark {
    color: var(--accent);
    width: 24px;
    height: 24px;
}

.help-ask-hint {
    color: var(--text-dim);
    margin: 0 0 18px;
}

.help-ask-input {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

    .help-ask-input textarea {
        flex: 1;
        min-height: 64px;
        resize: vertical;
        padding: 12px 14px;
        background: var(--surface-2);
        color: var(--text);
        border: 1px solid var(--border);
        border-radius: 10px;
        font-family: inherit;
        font-size: 14px;
        line-height: 1.5;
        outline: none;
    }

        .help-ask-input textarea:focus {
            border-color: var(--accent);
        }

    .help-ask-input .he-btn {
        white-space: nowrap;
    }

.help-ask-answer {
    margin-top: 20px;
    padding: 16px 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    line-height: 1.65;
    white-space: pre-wrap;
}

.help-ask-sources {
    margin-top: 16px;
}

.help-ask-sources-h {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.help-ask-source {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin: 0 8px 8px 0;
    padding: 7px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    color: var(--text);
    font-size: 13px;
    cursor: pointer;
}

    .help-ask-source:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

    .help-ask-source .hi {
        width: 14px;
        height: 14px;
        color: var(--accent);
    }

/* -- Icon picker (category editor) -- */
.he-iconpick {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .he-iconpick select {
        flex: 1;
    }

.he-iconpreview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--accent);
}

    .he-iconpreview .hi {
        width: 18px;
        height: 18px;
    }

/* -- Culture switch -- */
.help-culture {
    height: 34px;
    padding: 0 10px;
    margin-right: 4px;
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .3px;
    cursor: pointer;
}

    .help-culture:hover {
        border-color: var(--accent);
    }

/* AI answer rendered as markdown reuses .help-article-body typography. */
.help-ask-answer.help-article-body p:first-child {
    margin-top: 0;
}

.help-ask-answer.help-article-body p:last-child {
    margin-bottom: 0;
}

/* Suppress the focus ring FocusOnNavigate puts on the heading after navigation. */
.help-content h1:focus,
.help-content h1:focus-visible {
    outline: none !important;
    box-shadow: none !important;
}

/* Admin status line (duplicate-to-culture feedback) */
.help-admin-status {
    margin: 4px 8px 8px;
    padding: 7px 10px;
    background: var(--accent-soft, rgba(59,130,246,.12));
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 12px;
}

/* Placeholder body for unwritten ("coming soon") topics */
.hc-pending {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 56px 20px;
    text-align: center;
    color: var(--text-dim, #8a93a3);
}

    .hc-pending svg {
        width: 48px;
        height: 48px;
        opacity: .65;
    }

    .hc-pending p {
        margin: 0;
        font-size: 15px;
    }

/* Collapsible categories */
.help-cat-label {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-height: 32px;
    background: none;
    border: 0;
    padding: 5px 8px;
    cursor: pointer;
    color: var(--text-dim);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    border-radius: 8px;
}

    .help-cat-label:hover {
        background: var(--surface-2);
        color: var(--text);
    }

.help-cat.has-active > .help-cat-title .help-cat-label {
    color: var(--text);
    font-weight: 600;
}

.help-caret {
    width: 15px;
    height: 15px;
    flex: 0 0 auto;
    margin-left: auto;
    transition: transform .15s ease;
    transform: rotate(-90deg);
    opacity: .55;
}

    .help-caret.open {
        transform: rotate(0);
    }

.help-tree-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2px;
    padding: 0 4px 6px;
}

.help-treebtn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: none;
    border: 0;
    border-radius: 6px;
    color: var(--text-dim, #8a93a3);
    cursor: pointer;
    padding: 0;
}

    .help-treebtn:hover {
        background: var(--surface-2);
        color: var(--text);
    }

    .help-treebtn .hi {
        width: 14px;
        height: 14px;
    }

/* -- Welcome / empty state -- */
.help-welcome {
    max-width: 720px;
    margin: 0 auto;
    padding: 8vh 24px 24px;
}

.help-welcome-hero {
    text-align: center;
}

.help-welcome-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 18px;
    margin-bottom: 18px;
    background: var(--accent-soft, rgba(59,130,246,.12));
    color: var(--accent, #3b82f6);
}

    .help-welcome-badge svg {
        width: 30px;
        height: 30px;
    }

.help-welcome-hero h1 {
    margin: 0 0 8px;
    font-size: 26px;
}

.help-welcome-hero p {
    margin: 0 auto;
    max-width: 46ch;
    color: var(--text-dim, #8a93a3);
    font-size: 15px;
}

.help-welcome-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 32px;
}

.help-welcome-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    text-align: left;
    padding: 16px;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: var(--surface-2, #f7f8fa);
    color: inherit;
    cursor: pointer;
    transition: border-color .15s, transform .15s, background .15s;
}

    .help-welcome-card:hover {
        border-color: var(--accent, #3b82f6);
        transform: translateY(-2px);
    }

.help-welcome-ic {
    display: inline-flex;
    width: 34px;
    height: 34px;
    border-radius: 9px;
    align-items: center;
    justify-content: center;
    background: var(--accent-soft, rgba(59,130,246,.12));
    color: var(--accent, #3b82f6);
}

    .help-welcome-ic svg {
        width: 18px;
        height: 18px;
    }

.help-welcome-ct {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.help-welcome-ct-h {
    font-weight: 600;
    font-size: 14px;
}

.help-welcome-ct-d {
    font-size: 12.5px;
    color: var(--text-dim, #8a93a3);
    line-height: 1.4;
}

@media (max-width: 720px) {
    .help-welcome-cards {
        grid-template-columns: 1fr;
    }
}

/* -- GitBook-style search results overlay -- */
.help-search-overlay {
    position: fixed;
    inset: var(--help-top-h) 0 0 0;
    background: rgba(0,0,0,.35);
    z-index: 40;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 10px 16px 16px;
}

.help-search-panel {
    width: min(640px, 100%);
    max-height: calc(100vh - var(--help-top-h) - 28px);
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0,0,0,.18);
    padding: 8px;
}

.help-search-count {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
    color: var(--text-dim);
    padding: 8px 10px 6px;
}

.help-search-hit {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    background: transparent;
    color: var(--text);
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
}

    .help-search-hit:hover,
    .help-search-hit:focus-visible {
        background: var(--surface-2);
        outline: none;
    }

.help-search-crumb {
    display: block;
    font-size: 11.5px;
    color: var(--text-dim);
    margin-bottom: 2px;
}

.help-search-title {
    display: block;
    font-size: 14.5px;
    font-weight: 600;
}

.help-search-sum {
    display: block;
    font-size: 12.5px;
    color: var(--text-dim);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* On phones, let the centered search stretch and keep all controls reachable */
@media (max-width: 760px) {
    .help-top-inner {
        grid-template-columns: auto 1fr auto;
        gap: 8px;
        padding: 0 10px;
    }

    .help-top-center {
        justify-self: stretch;
    }

    .help-searchbox {
        width: auto;
        max-width: none;
        flex: 1 1 auto;
    }

    .help-actions .help-zoomgroup {
        display: none;
    }
}

.help-zoomgroup {
    display: inline-flex;
    align-items: center;
    gap: 0;
    height: 34px;
    padding: 0 2px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 8px;
}

    .help-zoomgroup .help-iconbtn {
        width: 28px;
        height: 28px;
        border-radius: 6px;
    }

    .help-zoomgroup .help-zoom-val {
        min-width: 40px;
        font-variant-numeric: tabular-nums;
    }

.hc-imgph {
    margin: 1.4em 0;
    border: 2px dashed var(--border);
    border-radius: 10px;
    background: var(--surface-2);
    overflow: hidden;
}

    .hc-imgph .hc-imgph-frame {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 34px 16px;
        color: var(--text-dim, #8a93a3);
        border-bottom: 1px dashed var(--border);
    }

        .hc-imgph .hc-imgph-frame svg {
            width: 28px;
            height: 28px;
            opacity: .7;
        }

    .hc-imgph .hc-imgph-tag {
        font-size: 12px;
        font-weight: 600;
        letter-spacing: .04em;
        text-transform: uppercase;
    }

    .hc-imgph figcaption {
        padding: 10px 14px;
        font-size: 13px;
        color: var(--text-dim, #8a93a3);
    }

        .hc-imgph figcaption strong {
            color: var(--accent);
        }

.hc-shot img {
    max-width: 100%;
    height: auto; /* explicit, protects against any future width/height attrs */
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* -- Click a screenshot to enlarge it (the lightbox at the end of help.js) -- */
.help-article-body .hc-shot img {
    cursor: zoom-in; /* only in a topic being read; the editor has no lightbox */
}

.help-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60; /* above the sign-in prompt (50) */
    padding: 24px;
    overflow: auto;
    background: rgba(12, 14, 18, .88);
}

    .help-lightbox.is-open {
        display: flex;
    }

    .help-lightbox .help-lightbox-img {
        flex: 0 0 auto;
        margin: auto; /* centres it, and still lets an oversized picture scroll from its top-left corner */
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
        background: #fff;
        box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
    }

    .help-lightbox.can-zoom .help-lightbox-img {
        cursor: zoom-in;
    }

    .help-lightbox.is-full .help-lightbox-img {
        max-width: none;
        max-height: none;
        cursor: zoom-out;
    }

    .help-lightbox .help-lightbox-close {
        position: fixed;
        top: 14px;
        right: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 1px solid rgba(255, 255, 255, .4);
        border-radius: 50%;
        background: rgba(20, 23, 28, .82); /* dark on purpose: it can sit over the corner of a white screenshot */
        color: #fff;
        cursor: pointer;
    }

        .help-lightbox .help-lightbox-close:hover {
            background: rgba(64, 70, 80, .95);
        }

        .help-lightbox .help-lightbox-close:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }

        .help-lightbox .help-lightbox-close svg {
            width: 20px;
            height: 20px;
        }

@media print {
    .help-lightbox {
        display: none !important;
    }
}

/* Pending images admin page — append to the help site's site.css */

.pi-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px 20px 60px;
}

.pi-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}

    .pi-head h1 {
        margin: 0 0 4px;
        font-size: 1.5rem;
    }

.pi-sub {
    margin: 0;
    opacity: .75;
    font-size: .9rem;
}

    .pi-sub code {
        font-size: .85rem;
    }

.pi-ready {
    color: var(--hc-accent, #2f9e6e);
}

.pi-actions {
    display: flex;
    gap: 8px;
}

.pi-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid var(--hc-border, #3a3f4a);
    background: transparent;
    color: inherit;
    cursor: pointer;
    font-size: .9rem;
}

    .pi-btn:disabled {
        opacity: .45;
        cursor: default;
    }

.pi-btn-primary {
    background: var(--hc-accent, #2f9e6e);
    border-color: transparent;
    color: #fff;
}

.pi-result {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: .9rem;
    border: 1px solid;
}

.pi-result-ok {
    border-color: #2f9e6e55;
    background: #2f9e6e14;
}

.pi-result-warn {
    border-color: #d9822b55;
    background: #d9822b14;
}

.pi-msg {
    opacity: .85;
    margin-top: 4px;
}

.pi-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

    .pi-table th {
        text-align: left;
        padding: 8px 10px;
        opacity: .65;
        font-weight: 600;
        border-bottom: 1px solid var(--hc-border, #3a3f4a);
        white-space: nowrap;
    }

    .pi-table td {
        padding: 8px 10px;
        border-bottom: 1px solid var(--hc-border, #2a2e37);
        vertical-align: top;
    }

    .pi-table code {
        font-size: .82rem;
        white-space: nowrap;
    }

.pi-capture {
    max-width: 380px;
    opacity: .85;
}

.pi-status {
    width: 24px;
    text-align: center;
}

.pi-row-ready .pi-status {
    color: var(--hc-accent, #2f9e6e);
}

.pi-row-ready code {
    color: var(--hc-accent, #2f9e6e);
}

.pi-done {
    margin-top: 24px;
    opacity: .8;
}

.pi-file {
    white-space: nowrap;
}

.pi-copy {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 6px;
    color: inherit;
    opacity: .45;
    vertical-align: middle;
}

    .pi-copy:hover {
        opacity: 1;
    }

    .pi-copy .hi {
        width: 14px;
        height: 14px;
    }

.pi-copied {
    color: var(--hc-accent, #2f9e6e);
    opacity: 1;
}

a.help-iconbtn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

/* -- What's New (/whats-new): release notes from amigopos.com -- */
.help-whatsnew-link {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    font-size: 13.5px;
    text-decoration: none;
}

    .help-whatsnew-link:hover,
    .help-whatsnew-link.active {
        border-color: var(--accent);
    }

.help-rn h1 {
    display: flex;
    align-items: center;
    gap: 10px;
}

.help-rn-ic {
    color: var(--accent);
}

.help-rn-muted {
    color: var(--text-dim);
    font-size: 13px;
}

.help-rn-release {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

    .help-rn-release.is-next {
        padding: 18px;
        border: 1px dashed var(--accent);
        border-radius: 12px;
    }

    .help-rn-release h2 {
        margin: 8px 0 6px;
        font-size: calc(20px * var(--help-font-scale));
    }

.help-rn-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.help-rn-badge {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.help-rn-prod {
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 12px;
    font-weight: 600;
}

.help-rn-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

.help-rn-card {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    background: var(--surface);
}

.help-rn-shot {
    display: block;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
}

    .help-rn-shot img {
        display: block;
        width: 100%;
        aspect-ratio: 16 / 10;
        object-fit: cover;
        object-position: top center;
    }

.help-rn-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px 14px;
}

    .help-rn-body h3 {
        margin: 2px 0 0;
        font-size: calc(15px * var(--help-font-scale));
    }

    .help-rn-body .help-article-body {
        font-size: calc(14px * var(--help-font-scale));
    }

.help-rn-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.help-rn-kind {
    padding: 2px 7px;
    border-radius: 6px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

    .help-rn-kind.k-new {
        background: rgba(52, 168, 83, .16);
        color: #2e8f49;
    }

    .help-rn-kind.k-improved {
        background: rgba(54, 162, 235, .16);
        color: #1f7ac0;
    }

    .help-rn-kind.k-fixed {
        background: var(--accent-soft);
        color: var(--accent);
    }

.help-rn-more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

.help-rn-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.help-rn-pg {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: transparent;
    color: var(--accent);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

    .help-rn-pg:hover:not(:disabled) {
        border-color: var(--accent);
    }

    .help-rn-pg:disabled {
        color: var(--text-dim);
        cursor: default;
        opacity: .5;
    }

[dir="rtl"] .help-rn-arrow {
    display: inline-block;
    transform: scaleX(-1);
}
